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
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']) {
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']) {
Please attach your whole index.php file.
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
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']);
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)
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?
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.
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']) {