Display thumbnail for a password protected album, instead of padlock Display thumbnail for a password protected album, instead of padlock
 

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

Display thumbnail for a password protected album, instead of padlock

Started by dashar, September 07, 2011, 06:30:38 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

dashar

I am a photographer and use coppermine as a proofing gallery for my clients. I don't want to make my customers register and so I show my password protected albums to unlogged users, but only have the option to display the padlock image. Is there anyway I can display the associated thumbnail and still keep the album password protected? It makes it easier for customers to navigate to their photos.

Can someone can point me to the place in the code where I can comment out the padlock image logic and replace it with a call to get the thumbnail?

Thank you
http://www.dariaellington.com/coppermine

Αndré

Open index.php, find
        if (!in_array($aid, $FORBIDDEN_SET_DATA) || $CONFIG['allow_private_albums'] == 0) { //test for visibility
            if ($album['pic_count'] > 0  || !empty($album['link_pic_count'])) {

and replace with
        if (!in_array($aid, $FORBIDDEN_SET_DATA) || $CONFIG['allow_private_albums'] == 0 || $CONFIG['show_private']) { //test for visibility
            if ($album['pic_count'] > 0  || !empty($album['link_pic_count']) || $album['thumb']) {

dashar

This did not solve the issue. Still displaying padlock image...

This is what my index.php looks like:

// Insert a thumbnail if the album contains 1 or more images
        //if (!in_array($aid, $FORBIDDEN_SET_DATA) || $CONFIG['allow_private_albums'] == 0) { //test for visibility
            //if ($album['pic_count'] > 0  || !empty($album['link_pic_count'])) {
if (!in_array($aid, $FORBIDDEN_SET_DATA) || $CONFIG['allow_private_albums'] == 0 || $CONFIG['show_private']) { //test for visibility - daria
            if ($album['pic_count'] > 0  || !empty($album['link_pic_count']) || $album['thumb']) {





Αndré


dashar

I don't see an attachment option, and it's too big fot the textarea field here.

I renamed and put it here:  http://www.dariaellington.com/coppermine/index.txt  see line 1025

Thank you

Αndré

Your file works as expected in my testbed. Please check the content of some variables right before the modifications:
            var_dump($CONFIG['show_private']);
            var_dump($album['thumb']);

dashar

I placed that code right before the if statements, to figure out why it's not going inside them. Where are the variable being written to?

The thumbnail only displays if I was logged in as admin, and then logged out. Seems like it's cached.
If I clear my cache, and refresh as an unlogged user, the padlock image displays again. Tried in 4 different browsers.

www.dariaellington.com/coppermine

Αndré

Quote from: dashar on September 14, 2011, 05:10:55 AM
I placed that code right before the if statements, to figure out why it's not going inside them.
What's the output of the additional code?



dashar

Should I see this output on the page? I am not seeing it on the page or in the source code. I placed it outside of, and right before the if statements.

Αndré

Open index.php, find
        if (!in_array($aid, $FORBIDDEN_SET_DATA) || $CONFIG['allow_private_albums'] == 0) {
            if ($count > 0 || !empty($alb_stats[$alb_idx]['link_pic_count'])) {

and replace with
        if (!in_array($aid, $FORBIDDEN_SET_DATA) || $CONFIG['allow_private_albums'] == 0 || $CONFIG['show_private']) {
            if ($count > 0 || !empty($alb_stats[$alb_idx]['link_pic_count']) || $alb_thumb['thumb']) {