Member
Member
klikini   2014-08-04, 00:06
#1
I would only like to show watermarks to guests (anyone that isn't logged in) but let logged-in users see and download watermark-free images. Seeing the watermark on the image page but downloading it without one would be fine too. Is there an option for this?
Member
Member
sbillard   2014-08-04, 00:24
#2
To do this you will have to have your theme use different function calls for logged-in users versus the general public since the watermark is permanent in the cached image.

You can use `printCustomSizedImage()` to show the image with or without the watermark--that is a parameter to the function.
Member
Member
klikini   2014-08-04, 04:13
#3
I'm using the default theme, dark. How would I implement this, and is there a doc page for the function?
Administrator
Administrator
acrylian   2014-08-04, 08:29
#4
There is: http://www.zenphoto.org/documentation/functions/_template-functions.php.html#functionprintCustomSizedImage
Member
Member
klikini   2014-08-04, 17:01
#5
Okay so now I have it displaying images without a watermark, but they are very large. What is the format of the "size" parameter? I tried `$size = 595` assuming it was the width in pixels, but it didn't work.
Administrator
Administrator
acrylian   2014-08-04, 17:06
#6
"Size" is in pixel. If it is the width or height depends on your image option settings regarding "longest side". If it didn't work you maybe did not set the parameters correctly.
http://www.zenphoto.org/news/how-to-read-the-zenphoto-functions-guide
Member
Member
klikini   2014-08-04, 19:00
#7
Okay, the size works now, but the watermark show up now too. What do I need to put in the `$effects` parameter to hide it?
Administrator
Administrator
acrylian   2014-08-04, 19:07
#8
`$thumbStandin` is the one and must be set to false. That means the image is treatened as a "thumb" and the only difference between a thumb and a sized image is that thumbs don't have watermarks.
Member
Member
klikini   2014-08-04, 19:19
#9
That works! Now how can I also hide it for logged in users on the full image page?

`full-image.php` isn't there.
Administrator
Administrator
acrylian   2014-08-04, 19:36
#10
There is no full-image page on theme level and it is only used for protected images. Use the image functions for it.
http://www.zenphoto.org/documentation/functions/_template-functions.php.html#functiongetUnprotectedImageURL
http://www.zenphoto.org/documentation/functions/_template-functions.php.html#functiongetProtectedImageURL

Add a check using `if(zp_loggedin()) { … } else { … }`
Member
Member
klikini   2014-08-04, 21:02
#11
It works perfectly now!

I have it set up so that logged in users see and download (no more full-image.php... I have so it downloads directly) a watermark-free image while guests see and download a watermarked image.

Thank you!
Member
Member
klikini   2014-08-05, 15:36
#12
Hah! It was messed up by the ``
  
Powered By MyBB, © 2002-2026 MyBB Group.
Made with by Curves UI.