yeh, I know that. I want to say that this is not enought for protection against spammers, becouse they can use a source-code of html pages generated by forum for collectiong e-mail addresses.
[x] tag generate image from string(like blalba@bla.com), but I think, it should do it from an user ID (etc 3252) ?r nickname (eth druvans)
[x]druvans[/x] or [x]1973[/x] should produce image with druvans@yahoo.com, NOT [x]druvans@yahoo.com[/x]
and the name of genegated file should not be : druvans_yahoo.png, just a druvans
but there is a problem: we can`t imagize e-mail that is not in a profile of some registered member...
BTW:
this version of function generate _transparent_ image (works in IE6, Mozilla, Opera not tested)
$fontsize=3;
// Create the image
$im = imagecreate( strlen($email)*8, 16 ) or die( "Cannot Initialize new GD image stream" );
//Create background color
$bg = imagecolorallocate($im, 255, 255, 255);
imagecolortransparent($im,$bg);
imagefill($im,0,0,$bg);
// Create foreground color
$foreground = imagecolorallocate($im, 0, 150, 0);
// write the string at the top left
imagestring($im,$fontsize, 0, 0, $email, $foreground);
// Using imagepng() results in clearer text compared with imagejpeg()
//filename modified as per spider8's comments - need to clean it up
$email =trim(preg_replace( '/^[^a-zA-Z0-9]+$/', '_', str_replace("@","_",$email)));
$filename ="img/imagize/".substr($email, 0,strrpos($email, '.')).".png";
imagepng($im,$filename);
return '<img src="'.$filename.'">';
}
//imagize code ends