Log in

View Full Version : Customiable flyers for referals


jim doodle
03-03-2009, 03:35 PM
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



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!

dbirosel
04-24-2009, 04:45 AM
Where did u get the referral statistic mod at?