setup for guest to view only 1 album & thumbnails for others setup for guest to view only 1 album & thumbnails for others
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

setup for guest to view only 1 album & thumbnails for others

Started by loonasee, April 17, 2007, 02:38:09 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

loonasee

I have recently setup a coppermin gallery bridged to phpbb.

I would like to allow  guests (non registered users)  to view the slideshow of only 1 album while restricting guests to viewing only thumbnails for all other albums.

I am currently using the code below to restrict guests from viewing pictures but this is all or nothing.

Any suggestions??????

***
How can I let unregistered users see the thumbnails only, but not the actual pictures?

if (!USER_ID) cpg_die(ERROR, 'You need to register to access this page', __FILE__, __LINE__);



Joachim Müller

So you refered to the FAQ (http://coppermine-gallery.net/demo/cpg14x/docs/faq.htm#viewThumbnailsOnly)...

Not tested - should be something like
if (!USER_ID) {
    if ($aid != 23) {
        cpg_die(ERROR, 'You need to register to access this page', __FILE__, __LINE__);
    }
}
Replacing "23" with the actual album ID that you want to allow.
As suggested, I haven't tested this - please post feedback.

loonasee

Excellent Idea!

Dumb question. Where can I find the album ID for The album I want to open to the public?
Do I need to do an SQL query?

Replacing "23" with the actual album ID that you want to allow.
As suggested, I haven't tested this - please post feedback.

Nibbler

Go into the album with your web browser and then look at the address bar. You might need $_GET['album'] or $_GET['aid'] instead of $aid - depends where you use the code.

loonasee

Works great !!!!


I added this code into displayimage.php

if (!USER_ID) {
    if ($_GET['album'] != 2) {
        cpg_die(ERROR, 'You need to register to access this page', __FILE__, __LINE__);
    }
}

THANK YOU !!!!!!