It is all nice and dandy, however GT does not really solve this problem as my e-mail address was still part of the HTML code after displaying it as an image, thanks to the ingenious little thing called ALT tag. GT will use your original text as the ALT tag for the generated image. While it makes sense for the most part, it defeats the whole purpose of having your e-mail address displayed via graphic text to avoid spam robots.
So I extended the GT tag to my liking where I can set the ALT tag to whatever I prefer.
Code: Select all
#
#-----[ OPEN ]------------------------------------------
#
include/inc_module/mod_graphical_text/inc_front/gt.func.inc.php
#
#-----[ FIND ]------------------------------------------
#
$content["all"] = preg_replace('/\{GT:(.+?)\}(.*?)\{\/GT\}/ei', "get_gt_by_style(\$gt, \"\$1\", \"\$2\")", $content["all"]);
#
#-----[ BEFORE, ADD ]------
#
$content["all"] = preg_replace('/\{GT:(.+?):(.*?)\}(.*?)\{\/GT\}/ei', "get_gt_by_style(\$gt, \"\$1\", \"\$3\", \"\$2\")", $content["all"]);
#
#-----[ FIND ]------------------------------------------
#
function get_gt_by_style ($gt, $style_name, $text)
#
#-----[ REPLACE WITH ]------------------------------------------
#
function get_gt_by_style ($gt, $style_name, $text, $alt_txt="")
#
#-----[ FIND ]------------------------------------------
#
$result = show_picture($font, $text, $antialiasing, $size, $fgcolor, $fgtransparency, $bgcolor, $bgtransparency, $line_width, $format);
#
#-----[ REPLACE WITH ]------------------------------------------
#
$result = show_picture($font, $text, $antialiasing, $size, $fgcolor, $fgtransparency, $bgcolor, $bgtransparency, $line_width, $format, $alt_txt);
#
#-----[ FIND ]------------------------------------------
#
function show_picture ($font, $text, $antialiasing, $size, $fgcolor, $fgtransparency, $bgcolor, $bgtransparency, $line_width, $format)
#
#-----[ REPLACE WITH ]------------------------------------------
#
function show_picture ($font, $text, $antialiasing, $size, $fgcolor, $fgtransparency, $bgcolor, $bgtransparency, $line_width, $format, $alt_txt ="")
#
#-----[ FIND ]------------------------------------------
#
return '<img src="'.$displayfile.'" alt="'.htmlentities($alt_txt).'" border="0" />';
#
#-----[ BEFORE, ADD]------------------------------------------
#
if (empty($alt_txt)) {
$alt_txt = $text;
}
Usage:
{GT:style}Text{/GT}
Works just like before, adding the entire text as ALT tag
{GT:style:}Text{/GT}
Works just like before, adding the entire text as ALT tag
{GT:style:bla}Text{/GT}
Instead of the word "Text" being the ALT tag, when you hover over with your mouse, you'll see the word "bla" being displayed.
{GT:style: }Text{/GT} (notice the extra space after the second colon)
The new ALT tag will be a single space, when you hover over you will get an empty string.
With this mod in place, I am not that worried about having my e-mail address showing on my website as robots can't really harvest it. Feel free to add this hack to the next release of the GT MOD. I would actually prefer to have it in the next release, I'd hate to have to re-add it myself.