
so anyway here's the source code:
CODE
<?php
/*
All images and lines of code were written/drawn from scratch by alex...
*/
header("Content-type: image/jpeg");
function newclockhand($time,$color,$length,$thickness){
global $clock;
imagefilledpolygon($clock,array(96,89,99-$thickness+cos(deg2rad($time+90))*2,92+$thickness+sin(deg2rad($time+90))*2,$length*cos(deg2rad($time))+165-$length,$length*sin(deg2rad($time))+165-$length),3,$color);
}
$clock=imagecreatetruecolor(200,200);
$back=imagecreatefromjpeg("back.jpg");
$dot=imagecreatefromjpeg("dot.jpg");
imagecopy($clock,$back,0,0,0,0,200,200);
newclockhand(intval(date("i"))/60*360-90,imagecolorallocate($clock,0,0,0),70,3);
newclockhand(intval(date("g"))/12*360-80+30*intval(date("i"))/60,imagecolorallocate($clock,10,10,10),55,5);
newclockhand(intval(date("s"))/60*360-90,imagecolorallocate($clock,255,0,0),70,1);
imagecopy($clock,$dot,97,91,0,0,6,6);
imagejpeg($clock);
imagedestroy($clock);
?>
/*
All images and lines of code were written/drawn from scratch by alex...
*/
header("Content-type: image/jpeg");
function newclockhand($time,$color,$length,$thickness){
global $clock;
imagefilledpolygon($clock,array(96,89,99-$thickness+cos(deg2rad($time+90))*2,92+$thickness+sin(deg2rad($time+90))*2,$length*cos(deg2rad($time))+165-$length,$length*sin(deg2rad($time))+165-$length),3,$color);
}
$clock=imagecreatetruecolor(200,200);
$back=imagecreatefromjpeg("back.jpg");
$dot=imagecreatefromjpeg("dot.jpg");
imagecopy($clock,$back,0,0,0,0,200,200);
newclockhand(intval(date("i"))/60*360-90,imagecolorallocate($clock,0,0,0),70,3);
newclockhand(intval(date("g"))/12*360-80+30*intval(date("i"))/60,imagecolorallocate($clock,10,10,10),55,5);
newclockhand(intval(date("s"))/60*360-90,imagecolorallocate($clock,255,0,0),70,1);
imagecopy($clock,$dot,97,91,0,0,6,6);
imagejpeg($clock);
imagedestroy($clock);
?>
and attached are all the images needed.
but if you refresh a bit you can tell there are a few bugs... especially with the thickness of the hands changing. I'm not that great at trig functions, I just know the basic unit circle which I used to make this, but i had to play around with some of the numbers to get it right, but I never got the thickness to work quite right. If any of you math whizzes out there want to improve my code go for it. Also changing the length of the hands affects the time sometimes so make sure you compensate for it by adding degrees within the deg2rad() function.
But other than those 2 the clock works pretty good. Have fun!

