Hi Guys,
i thought i would share a little feature/mod i knocked up for customising a flyer with the GD PHP module, using the global login features to customise the flyer with the username for a referral competition.
http://www.vwt4forum.co.uk/competition.php
PHP Code:
require_once('./global.php');
ini_set("memory_limit","12M");
$image = imagecreatefrompng("images/flyer/flyer_front.png");
$color = imagecolorallocate($image, 255,255,255);
$black = imagecolorallocate($image, 44,78,108);
$text = $vbulletin->userinfo['username'];
$font_size = 550 / strlen($text);
ImageTTFText ($image, $font_size, 0, 811, 241, $black, "fonts/MyriadWebPro-Bold.ttf", $text);
ImageTTFText ($image, $font_size, 0, 810, 240, $color, "fonts/MyriadWebPro-Bold.ttf", $text);
header("Content-type: image/png");
imagepng($image);
imagedestroy($image);
?>
I'm currently outputting this as a PNG as the jpg (imagejpeg) introduces some nasty compression, any suggestions on how to modify the compression would be welcome!