coppermine-gallery.com/forum

Support => cpg1.4.x Support => Older/other versions => cpg1.4 permissions => Topic started by: loonasee on April 17, 2007, 02:38:09 PM

Title: setup for guest to view only 1 album & thumbnails for others
Post by: loonasee on April 17, 2007, 02:38:09 PM
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__);


Title: Re: setup for guest to view only 1 album & thumbnails for others
Post by: Joachim Müller on April 17, 2007, 05:28:32 PM
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.
Title: Re: setup for guest to view only 1 album & thumbnails for others
Post by: loonasee on April 17, 2007, 11:48:53 PM
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.
Title: Re: setup for guest to view only 1 album & thumbnails for others
Post by: Nibbler on April 17, 2007, 11:57:11 PM
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.
Title: Re: setup for guest to view only 1 album & thumbnails for others
Post by: loonasee on April 18, 2007, 01:10:25 AM
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 !!!!!!