"Cops were called", 2=>"Blew my brains out", 3=>"Killing brain cells", 4=>"Killed the bitch", 5=>"I did something", 6=>"I wrote this", 7=>"I blew a speaker", 8=>"Amp caught on fire", 9=>"Got arrested", 10=>"Killed the neighbors", 11=>"told neighbors to go to hell", 12=>"Killed some brain cells", 13=>"Blew an ear drum", 14=>"Sacrificed a cat", 15=>"Played this song", 16=>"Random Error message", 17=>"I think this song played", 18=>"Error 90737-0034 on line 8", 19=>"I sang this to myself", 20=>"random_quote was lost", 21=>"Server time out", 22=>"Busted by RIAA", 23=>"Downloaded this song", 24=>"random_quote not found", 25=>"Destroyed the evidence", 26=>"Buried the bodies", 27=>"Harvested the crop", 28=>"This is a random_quote", 29=>"Smoked a fatty", 30=>"Made someone look stupid", 31=>"Computer blew up", 32=>"Stole your car", 33=>"killed your dog", 34=>"Computer blew up", 35=>"Shot computer", 36=>"killed some time", 37=>"Pissed someone off", 38=>"Destroyed something", 39=>"This is quote #666, last 1"); /* 40=>"", 41=>""); */ $random_number=rand(1, count($quotes)); $random_quote=$quotes[$random_number]; if (file_exists($filename)) { //$dtime = "$random_quote @ " . date ("g:i A \o\\n\ n-d-y", filemtime($filename)); $dtime = "$random_quote @ " . date ("g:i A \o\\n\ n-d-y", filemtime($filename)-60*420); // -8hrs } $font = "arialbd.ttf"; //$font = "arial.ttf"; $size = 8; $angle = 0; if (strlen($dtime)<56) { $im = imagecreatefromgif("images/extra/t_d_bc-f.gif"); } //black_c.png cut to 304 if (strlen($dtime)<55) { $im = imagecreatefromgif("images/black_c315-f.gif"); } if (strlen($dtime)<54) { $im = imagecreatefromgif("images/black_c300-f.gif"); } if (strlen($dtime)<46) { $im = imagecreatefromgif("images/black_c285-f.gif"); } if (strlen($dtime)<43) { $im = imagecreatefromgif("images/black_c270-f.gif"); } if (strlen($dtime)<41) { $im = imagecreatefromgif("images/black_c255-f.gif"); } if (strlen($dtime)<39) { $im = imagecreatefromgif("images/black_c240-f.gif"); } if (strlen($dtime)<36) { $im = imagecreatefromgif("images/black_c225-f.gif"); } if (strlen($dtime)<35) { $im = imagecreatefromgif("images/black_c33-f.gif"); } if (strlen($dtime)<34) { $im = imagecreatefromgif("images/black_c210-f.gif"); } //choose textcolor (white) if ($on) $text_color = imagecolorallocate($im, 0,255,255); else $text_color = imagecolorallocate($im, 128,128,128); //check width of the text $bbox = imagettfbbox ($size, $angle, $font, $dtime); $bbox["left"] = 0- min($bbox[0],$bbox[2],$bbox[4],$bbox[6]); $bbox["top"] = 0- min($bbox[1],$bbox[3],$bbox[5],$bbox[7]); $bbox["width"] = max($bbox[0],$bbox[2],$bbox[4],$bbox[6]) - min($bbox[0],$bbox[2],$bbox[4],$bbox[6]); $bbox["height"] = max($bbox[1],$bbox[3],$bbox[5],$bbox[7]) - min($bbox[1],$bbox[3],$bbox[5],$bbox[7]); extract ($bbox, EXTR_PREFIX_ALL, 'bb'); //check width of the image $width = imagesx($im); $height = imagesy($im); $pad = -3; //write text imagettftext($im, $size, $angle, $width/2-$bb_width/2, $height-$bb_height-$pad, $text_color, $font, $dtime); header("Content-type: image/gif"); imagepng($im,"",100); imagedestroy($im); exit; ?>