johannes.jarolim.com/yapb-forum

Full Version: Watermark Text and Template Tags
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I know this is not really a YAPB question and more of a phpThumb question but thought maybe someone could help me figure this out. I am trying to use the watermark text filter and get it to display the authors name. just not sure of the syntax to put a template tag in the param.

example:
Code:
<img  src="<?php echo $post->image->getThumbnailHref(array('q=95','wl=500','hp=500','fltr[]=wmt|the_author() Copyright 2007|2|BL|ffffff|||5|||0|]')) ?>" alt="<?php the_title() ?>" title="<?php the_title() ?>"   />
Hi thedesigncoalition -

Code:
$thumbConf = array(
    'q=95',
    'wl=500',
    'hp=500',
    'fltr[]=wmt|' . the_author() . ' Copyright 2007|2|BL|ffffff|||5|||100|'
  )

Should do what you want - Don't forget: the_author() may contain special characters - They may have to be encoded according to the phpThumb doc. The only thing i found is opacity 0 instead of 100 (100 is opaque, 0 is totally transparent).

Greets from Salzburg,

Johannes
Hi,
That's not the main purpose of Johannes' forums but here some additional helpfull informations for watermarking (phpThumb) :


WaterMarkText
Preview » phpThumb demo #51 #52 #53
Syntax » fltr[]=wmt|<t>|<s>|<a>|<c>|<f>|<o>|<m>|<n>

<t> is the text to use as a watermark
<s> is the font size (1-5 for built-in font or point size for TrueType fonts)
<a> is the alignment (one of BR, BL, TR, TL, C, R, L, T, B, * where B=bottom, T=top, L=left, R=right, C=center, *=tile)
<c> is the hex color of the text
<f> is the filename of the TTF file (optional, if omitted a built-in font will be used)
<o> is opacity from 0 to 100 (requires PHP version >= 4.3.2 otherwise 100% opaque)
<m> is the edge (and inter-tile) margin in percent
<n> is the angle


WaterMarkImage
Preview » phpThumb demo #6 #7 #8
Syntax » fltr[]=wmi|<f>|<a>|<o>|<m>

<f> is the (relative path and) filename of the image to overlay
<a> is the alignment (one of BR, BL, TR, TL, C, R, L, T, B, *, where B=bottom, T=top, L=left, R=right, C=center, *=tile)
<o> is opacity from 0 to 100 (requires PHP version >= 4.3.2 otherwise 100% opaque)
<m> is the edge (and inter-tile) margin in percent



Greetings from Paris Wink
Rumores
I needed to add a background to my watermark as it wasn't showing too well on white/light pictures.

'fltr[]=wmt| YAPB RULES! |2|C|ffffff|arial.ttf|100|0||000000|100|x&f=png'

Cheers
Tim
http://www.nuganics.com.au
Reference URL's