Hide or cvhange thumbnails for guest users Hide or cvhange thumbnails for guest users
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

Hide or cvhange thumbnails for guest users

Started by paquets, August 29, 2009, 10:50:53 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

paquets

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

Nibbler

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" />',


paquets

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!