Jump to content

Recommended Posts

Hi, please help me! lol its driving me crazy. I have the countdown script running at my site ( www.kal-el.org )

all i want to do is make the font be trebuchet. I cannot get it to work! Im not sure how to edit the imagestring!

please help me! i have the ttf uploaded to my server, not sure if thats needed or not. its at [a href=\"http://www/kal-el.org/trubuc.ttf\" target=\"_blank\"]http://www/kal-el.org/trubuc.ttf[/a]

i understand i might need to use imagettftext instead of imagestring, but i reall dont know what im doing, im lucky i got it this far. Im hoping someone can please help me out with this font problem...

here is the code i am using now:

thanks!

---------------------------

[img src=\"http://www.kal-el.org/countdown.png\" border=\"0\" alt=\"IPB Image\" /]


<?
// Bizzar PHP GD Countdown Script
// Written by: Brad Derstine (Brad@BizzarScripts.net)

$month = 6; // Month of the countdown
$day = 30; // Day of the countdown
$year = 2006; // Year of the countdown

// mktime is the marked time, and time() is the current time.
$target = mktime(0,0,0,$month,$day,$year);
$diff = $target - time();

$days = ($diff - ($diff % 86400)) / 86400;
$diff = $diff - ($days * 86400);
$hours = ($diff - ($diff % 3600)) / 3600;
$diff = $diff - ($hours * 3600);
$minutes = ($diff - ($diff % 60)) / 60;
$diff = $diff - ($minutes * 60);
$seconds = ($diff - ($diff % 1)) / 1;

header ("Content-type: image/png");
$imgname = "houseofel.png";
$im = @imagecreatefrompng ($imgname);

//Here are some common color codes in case you want to change the colors.
//$white = imagecolorallocate ($im, 255, 255, 255);
//$blue = imagecolorallocate ($im, 0, 0, 255);
//$black = imagecolorallocate ($im,0,0,0);
//$gray = imagecolorallocate ($im,153,153,153);
//$red = imagecolorallocate ($im,255,0,0);
//$orange = imagecolorallocate ($im, 255, 127, 36);

$background_color = imagecolorallocate ($im, 0, 0, 0);
$orange = imagecolorallocate ($im, 255, 127, 36);
$yellow = imagecolorallocate ($im, 247, 246, 201);
$red = imagecolorallocate ($im, 163, 37, 41);
$blue = imagecolorallocate ($im, 2, 137, 185);
$gold = imagecolorallocate ($im, 246, 164, 39);
imagestring ($im, 8, 44, 255, "SUPERMAN RETURNS", $gold);
imagestring ($im, 2, 51, 275, "IN $days DAYS & $hours HOUR(S)", $gold);
imagepng ($im);
imagedestroy ($im);
?>
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.