SDM monitoring more than 1 directory?

Started by mischa, August 18, 2010, 10:46:45 AM

Previous topic - Next topic

mischa

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

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

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.

pepak

Or better yet, put it into paretheses:
(/files|/files2|/files3)

Mischa

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

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

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.)

Quick Reply

Note: this post will not display until it has been approved by a moderator.

Name:
Email:
Verification:
Please leave this box empty:
Type the letters shown in the picture
Listen to the letters / Request another image

Type the letters shown in the picture:
Shortcuts: ALT+S post or ALT+P preview