Advanced search  

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

Pages: [1]   Go Down

Author Topic: Display thumbnail for a password protected album, instead of padlock  (Read 4917 times)

0 Members and 1 Guest are viewing this topic.

dashar

  • Coppermine newbie
  • Offline Offline
  • Posts: 5

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
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Display thumbnail for a password protected album, instead of padlock
« Reply #1 on: September 07, 2011, 10:25:32 am »

Open index.php, find
Code: [Select]
        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
Code: [Select]
        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']) {
Logged

dashar

  • Coppermine newbie
  • Offline Offline
  • Posts: 5
Re: Display thumbnail for a password protected album, instead of padlock
« Reply #2 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:
Code: [Select]
// 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']) {



Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Display thumbnail for a password protected album, instead of padlock
« Reply #3 on: September 08, 2011, 10:00:07 am »

Please attach your whole index.php file.
Logged

dashar

  • Coppermine newbie
  • Offline Offline
  • Posts: 5
Re: Display thumbnail for a password protected album, instead of padlock
« Reply #4 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  see line 1025

Thank you
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Display thumbnail for a password protected album, instead of padlock
« Reply #5 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:
Code: [Select]
            var_dump($CONFIG['show_private']);
            var_dump($album['thumb']);
Logged

dashar

  • Coppermine newbie
  • Offline Offline
  • Posts: 5
Re: Display thumbnail for a password protected album, instead of padlock
« Reply #6 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
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Display thumbnail for a password protected album, instead of padlock
« Reply #7 on: September 14, 2011, 10:08:48 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?


Logged

dashar

  • Coppermine newbie
  • Offline Offline
  • Posts: 5
Re: Display thumbnail for a password protected album, instead of padlock
« Reply #8 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.
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Display thumbnail for a password protected album, instead of padlock
« Reply #9 on: September 19, 2011, 11:55:08 am »

Open index.php, find
Code: [Select]
        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
Code: [Select]
        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']) {
Logged
Pages: [1]   Go Up
 

Page created in 0.03 seconds with 20 queries.