Pepak.net Forum

Discussion in english => Discussion in english => Topic started by: mischa on August 18, 2010, 10:46:45 AM

Title: SDM monitoring more than 1 directory?
Post by: mischa 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.
Title: SDM monitoring more than 1 directory?
Post by: Mischa 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.
Title: SDM monitoring more than 1 directory?
Post by: pepak 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:
/files|/files2|/files3
At least, it should work. I didn't actually try it.
Title: SDM monitoring more than 1 directory?
Post by: pepak on August 18, 2010, 03:36:20 PM
Or better yet, put it into paretheses:
(/files|/files2|/files3)
Title: SDM monitoring more than 1 directory?
Post by: Mischa 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!
Title: SDM monitoring more than 1 directory?
Post by: sadr 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!
Title: SDM monitoring more than 1 directory?
Post by: pepak 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.)