MonkeyCMS Forum

Go Back   MonkeyCMS Forum > MonkeyCMS > Content Discussion
FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Display Modes
  #1  
Old 06-18-2009, 05:55 AM
harvey harvey is offline
Senior Member
 
Join Date: Jun 2008
Posts: 474
Default Watermarking images

Is there any way of adding the specified watermark to images when used in certain areas of a site?

What I'm looking for is a way of watermarking images from content unless a registered user is logged in, is that possible?
Reply With Quote
  #2  
Old 06-18-2009, 06:16 AM
Colin Colin is offline
Administrator
 
Join Date: Apr 2007
Posts: 1,614
Default

Yes, you can do this. I'd do it with inline PHP for ease:

Code:
<img src="
[image]
%% global $loggedin; if (!$loggedin) ** addToOutput('&watermark=true'); ** %%
">
Replace the ** with curly brackets

Then, if the user isn't logged in, the image should display with the watermark defined in the site settings and if they are, it won't be.

Does that cover it?
Reply With Quote
  #3  
Old 06-18-2009, 08:00 AM
harvey harvey is offline
Senior Member
 
Join Date: Jun 2008
Posts: 474
Default

Sounds perfect, I'll give it a go!

Cheers Colin
Reply With Quote
  #4  
Old 06-18-2009, 08:21 AM
harvey harvey is offline
Senior Member
 
Join Date: Jun 2008
Posts: 474
Default

That seems to work prefectly, thanks.

If i need to also specify a width or height to the image, how would I go about that? Sticking

Code:
&amp;width=308
Doesnt work
Reply With Quote
  #5  
Old 06-18-2009, 08:31 AM
Colin Colin is offline
Administrator
 
Join Date: Apr 2007
Posts: 1,614
Default

Quote:
Originally Posted by harvey View Post
That seems to work prefectly, thanks.

If i need to also specify a width or height to the image, how would I go about that? Sticking

Code:
&amp;width=308
Doesnt work
The snippet you entered should work? PM the image URL and I'll take a look
Reply With Quote
  #6  
Old 06-18-2009, 08:50 AM
harvey harvey is offline
Senior Member
 
Join Date: Jun 2008
Posts: 474
Default

Doh! Actually it does work, must have done something wrong the first time.

Sorry Colin, and thanks for such a quick response!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT. The time now is 04:03 AM.


Powered by vBulletin® Version 3.6.7
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
© Poisonous Monkey