Author Topic: SDM monitoring more than 1 directory?  (Read 5804 times)

mischa

  • Guest
SDM monitoring more than 1 directory?
« on: August 18, 2010, 10:46:45 AM »
Hi Pepak,

Is it possible to monitor more than 1 directory (not a subdirectory)?

Can this be done by adding more than 1 rewrite rule in the .htaccess?
But I can only put 1 directory link in the SDM config page.

Thanks for the help.

Mischa

  • Guest
SDM monitoring more than 1 directory?
« Reply #1 on: August 18, 2010, 11:03:42 AM »
Also I saw the PREG comment, but I am not familiair with the syntax, sorry for this.

Could you provide a example how to use this function within your plugin?

Thanks again.

pepak

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 956
    • View Profile
    • Pepak.net
SDM monitoring more than 1 directory?
« Reply #2 on: August 18, 2010, 03:11:17 PM »
Adding an extra mod_rewrite rule to .htaccess is the first step.

Then you need to change the "Allowed directories" regular expression to something like:
Code: [Select]
/files|/files2|/files3
At least, it should work. I didn't actually try it.

pepak

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 956
    • View Profile
    • Pepak.net
SDM monitoring more than 1 directory?
« Reply #3 on: August 18, 2010, 03:36:20 PM »
Or better yet, put it into paretheses:
Code: [Select]
(/files|/files2|/files3)

Mischa

  • Guest
SDM monitoring more than 1 directory?
« Reply #4 on: August 18, 2010, 04:58:04 PM »
Yes, it works!

In the backend (config of SDM) I put: (wp-content/uploads/|images/) to have the two directories.
Also (I forgot) to add the file type I wanted to log in the download manager (my bad :S)

In the .htaccess file I added (just the first two rules, but I copied the third to show wherre I put it):
RewriteRule ^(wp-content/uploads/.*) /index.php?sdmon=$1 [L]
RewriteRule ^(images/.*) /index.php?sdmon=$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f

Thanks for your help and I hope someone else has some use of this post as well.
Godspeed!

sadr

  • Guest
SDM monitoring more than 1 directory?
« Reply #5 on: September 19, 2010, 09:49:31 PM »
i added (/files|/files2|/files3) to simple-download-monitor.php

and then copied:
   



so a second text box appeared.  

i wrote the second directory but then when i saved the file it saved the new directory as the first directory as well.

not really sure what to change to add a new directory.

i did look at the stats and noticed it worked but i had to change everything back as the first directory is my main one
thanks for the help!

pepak

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 956
    • View Profile
    • Pepak.net
SDM monitoring more than 1 directory?
« Reply #6 on: September 20, 2010, 05:42:20 AM »
I am afraid I understand neither what you wanted to do nor what you did. Why did you duplicate the text box? (I am not surprised that it overwrote the content of the first text box, since you gave them both the same name.)

 

With Quick-Reply you can write a post when viewing a topic without loading a new page. You can still use bulletin board code and smileys as you would in a normal post.

Note: this post will not display until it's been approved by a moderator.
Name: Email:
Verification:
This box must be left blank:

Type the letters shown in the picture
Listen to the letters / Request another image
Type the letters shown in the picture: