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

News:

CPG Release 1.6.27
change DB IP storage fields to accommodate IPv6 addresses
remove use of E_STRICT (PHP 8.4 deprecated)
update README to reflect new website
align code with new .com CPG website
correct deprecation in captcha

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!