S2 member Nextgen gallery
-
I have a site with s2member and nextgen gallery, I want to protect the content under the nextgen gallery ?gallery? folder. I have tried this code from Cristián Lávaque to change the s2member protected folder:
` <?php
add_filter(‘ws_plugin__s2member_files_dir’, ‘ngg_gallery_directory’);
function ngg_gallery_directory() {
return ‘https://mysite.com/wp-content/gallery/’;
}
?>`Then I have added a ?download? button in the gallery page:
<a class="download-link" href="<?php echo $image->imageURL ?>">Download</a>
Following the instructions of S2member > Download options > Basic downloads restrictions, I can link to any protected file using:
https://mysite.com/?s2member_file_download=example-file.zip
So, the download button now look like this:
<a class="download-link" href="https://mysite.com/?s2member_file_download=<?php echo $image->imageURL ?>">Download</a>
The final URL looks like this:
https://mysite.com/?s2member_file_download=/gallery01folder/gallery01image_01.jpg
But I get an 404 error from s2member:
404: Sorry, file not found. Please contact Support for assistance.
`Surely I’m doing something wrong, I have uploaded the same folder with the files to the s2member-files folder and I can download them, so the folder-changing-hack is not working, I guess.
Can you please help me to protect the ?gallery? folder?
Thanks!
- The topic ‘S2 member Nextgen gallery’ is closed to new replies.