<?php
$year="2006";
$month="12";
$day="25";
$hour="00";
$minute="00";
$second="00";
$event="Christmas Day 2006";
$time=mktime($hour, $minute, $second, $month, $day, $year);
$timecurrent=date('U');
$cdtime=$time-$timecurrent;
$cdmonths=$cddays/30;
$cdyears=$cddays/365;
$cdminutes=round($cdtime/60);
$cdhours=round($cdtime/3600);
$cddays=round($cdhours/24);
$currentdate = date('l, F j, Y');
header("Content-type: image/png");
$im = imagecreatetruecolor(701, 355);
$bg1 = 208;
$bg2 = 130;
$bg3 = 208;
$s1 = $bg1 - 20;
$s2 = $bg2 - 20;
$s3 = $bg3 - 20;
$t1 = $bg1 + 30;
$t2 = $bg2 + 30;
$t3 = $bg3 + 30;
$cArray=array();
$c1 = imagecolorallocate($im, $bg1, $bg2, $bg3); $c8 = imagecolorallocate($im, 255, $bg2, 255); $c2 = imagecolorallocate($im, $s1, $s2, $s3); $c3 = imagecolorallocate($im, $t1, $t2, $t3); imagefilledrectangle($im, 0, 0, 701, 50, $c1);
imagefilledrectangle($im, 0, 0, 701, 50, $c8);
$text = $string;
$fnum = rand(1, 9);
$font = "/f/font ($fnum)";
imagettftext($im, 29, 1, 17, 42, $c2, $font, "Today is:");
imagettftext($im, 28, -1, 15, 40, $c3, $font, "Today is:");
imagettftext($im, 29, 1, 17, 92, $c2, $font, "...$currentdate...");
imagettftext($im, 28, -1, 15, 90, $c3, $font, "...$currentdate...");
imagettftext($im, 29, 1, 17, 142, $c2, $font, "So there are exactly:");
imagettftext($im, 28, -1, 15, 140, $c3, $font, "So there are exactly:");
imagettftext($im, 29, 1, 17, 192, $c2, $font, "$cddays with just...");
imagettftext($im, 28, -1, 15, 190, $c3, $font, "$cddays days with just...");
imagettftext($im, 29, 1, 17, 242, $c2, $font, "$cdminutes minutes and only...");
imagettftext($im, 28, -1, 15, 240, $c3, $font, "$cdminutes minutes and only...");
imagettftext($im, 29, 1, 17, 292, $c2, $font, "$cdseconds seconds until...");
imagettftext($im, 28, -1, 15, 290, $c3, $font, "$cdseconds seconds until...");
imagettftext($im, 29, 1, 17, 342, $c2, $font, "- + $event + -");
imagettftext($im, 28, -1, 15, 340, $c3, $font, "- + $event + -");
imagepng($im);
imagedestroy($im);
?>