coppermine-gallery.com/forum

Support => cpg1.5.x Support => cpg1.5 themes (visuals) => Topic started by: dashar on September 07, 2011, 06:30:38 AM

Title: Display thumbnail for a password protected album, instead of padlock
Post by: dashar on September 07, 2011, 06:30:38 AM
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
Title: Re: Display thumbnail for a password protected album, instead of padlock
Post by: Αndré on September 07, 2011, 10:25:32 AM
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']) {
Title: Re: Display thumbnail for a password protected album, instead of padlock
Post by: dashar on September 07, 2011, 11:27:49 PM
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']) {




Title: Re: Display thumbnail for a password protected album, instead of padlock
Post by: Αndré on September 08, 2011, 10:00:07 AM
Please attach your whole index.php file.
Title: Re: Display thumbnail for a password protected album, instead of padlock
Post by: dashar on September 08, 2011, 08:07:42 PM
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 (http://www.dariaellington.com/coppermine/index.txt)  see line 1025

Thank you
Title: Re: Display thumbnail for a password protected album, instead of padlock
Post by: Αndré on September 09, 2011, 12:04:12 PM
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']);
Title: Re: Display thumbnail for a password protected album, instead of padlock
Post by: 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. 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 (http://www.dariaellington.com/coppermine)
Title: Re: Display thumbnail for a password protected album, instead of padlock
Post by: Αndré on September 14, 2011, 10:08:48 AM
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?


Title: Re: Display thumbnail for a password protected album, instead of padlock
Post by: dashar on September 19, 2011, 05:38:31 AM
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.
Title: Re: Display thumbnail for a password protected album, instead of padlock
Post by: Αndré on September 19, 2011, 11:55:08 AM
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']) {