coppermine-gallery.com/forum

Support => cpg1.4.x Support => Older/other versions => cpg1.4 permissions => Topic started by: paquets on August 29, 2009, 10:50:53 PM

Title: Hide or cvhange thumbnails for guest users
Post by: paquets on August 29, 2009, 10:50:53 PM
Hi,

I was wondering if it is possible to change the thumbnails of images to something else (for instance a thumbnail that would read "please register to see images") for guest users. Registered users would see the real thumbnail. The reason for this is I'd like to keep my gallery open to searches so guests can read image titles, descriptions and keywords, but not see the actual thumbnail, normal and full-size images. I've got the normal and full-size image part down, but searches will still display the thumbnail.

Is that possible?

Site: adpharm.net (http://adpharm.net)
Title: Re: Hide or cvhange thumbnails for guest users
Post by: Nibbler on August 30, 2009, 05:01:28 PM
Just copy the theme_display_thumbnails() function from the sample theme.php to your custom theme.php and change all occurrences of


'{THUMB}' => $thumb['image'],


to something like


'{THUMB}' => USER_ID ? $thumb['image'] : '<img src="path/to/your/pic.png" alt="please register to see images" width="xx" height="xx" />',

Title: Re: Hide or cvhange thumbnails for guest users
Post by: paquets on August 30, 2009, 08:52:14 PM
You definitely know your stuff. It works perfectly.
Had to disable the plugin "Lightbox" though as for some reason it uses "theme_display_thumbnails" another way and it conflicts.

Thanks Nibbler!