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

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

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 2 Guests 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 !!!!!!