I just saw that i had 3 unread PMs :D
Well, here\'s the source code to my img.. Requerments:
MySQL (Loggs all IPs :p)
PHP (Duh) with GD support
set_time_limit(60*1);
mysql_connect(\"localhost\", \"user\", \"pass\");
mysql_select_db(\"jpeg_log\");
mysql_query(\"INSERT INTO log (ip,time) VALUES (\'\".$_SERVER[\'REMOTE_ADDR\'].\"\',\'\".date(\"H:i:s Y/m/d\").\"\')\");
$comments=array(\"Don\'t complain, it\'s free!\",\"Great work devs!\",\"Long live PlaneShift!\",\"Greetings!\",\"I would like a beer\",\"Sorry, I know nothing about that\");
$handle = fopen (\"http://planeshift.fragnetics.com/\", \"r\");
if(!$handle){
exit(\"FILE ERROR\");
}
while (!feof ($handle)) {
$buffer = fgets($handle, 4096);
$contents=$contents.$buffer;
}
fclose ($handle);
$contents= substr($contents,strpos($contents,\"Server Status :\"));
$contents= substr($contents,0,strpos($contents,\"\"));
$contents=str_replace(\"
\",\"\",$contents);
$contents=str_replace(\" \",\"\",$contents);
$contents=str_replace(\" \",\"\",$contents);
$contents=str_replace(\"
\",\"\",$contents);
if(strpos($contents,\"\") > 0 ) {
$status=\"Online\";
}
if(strpos($contents,\"\") > 0 ) {
$status=\"Offline\";
}
$contents=str_replace(\"\",\"\",$contents);
$contents=str_replace(\"\",\"\",$contents);
$contents=str_replace(\"\\n\",\"\",$contents);
$contents=str_replace(\"
\",\"\",$contents);
for($i=5;$i > 0;$i--) {
$clients=(substr($contents,strpos($contents,\"Clients:\")+8,$i));
if(is_numeric($clients)) {
break;
}
}
if($i == 0) {
$clients=\"??\";
}
$server= \"PlaneShift Laanx (planeshift.fragnetics.com/203.81.47.74)\";
$world=substr($contents,strpos($contents,\"World:\")+6,strpos($contents,\".Clients\")-(strpos($contents,\"World:\")+6));
// create the image
$width=660;
$height=100;
$im = imagecreate($width, $height);
// white background and blue text
$bg = imagecolorallocate($im, 255, 255, 255);
$textcolor = imagecolorallocate($im, 255, 255, 255);
$green = imagecolorallocate($im, 0, 255, 0);
$red = imagecolorallocate($im, 255, 0, 0);
$backRec = imagecolorallocate($im, 0, 0, 0);
$orange=imagecolorallocate($im, 255, 128, 0);
$blue=imagecolorallocate($im, 0, 0,255);
$colors=array($red,$green,$blue,$orange);
ImageFilledRectangle($im,0,0,$width,$height,$backRec);
ImageRectangle($im,0,0,$width-1,$height-1,$red);
// write the string at the top left
imagestring($im, 5, 5, 2, \"$server server status:\", $textcolor);
if($status==\"Online\") {
imagestring($im, 5, 5, 20, $status, $green);
imagestring($im, 5, 5, 35, \"$clients clients is connected\", $textcolor);
imagestring($im, 5, 5, 50, \"The world is $world\", $textcolor);
} else {
imagestring($im, 5, 5, 20, $status, $red);
}
//And add the ad
imagestring($im, 5, 5, 65, $comments[rand(0,(count($comments)-1))], $colors[rand(0,(count($colors)-1))]);
imagestring($im, 5, 510, 80, \"Made by Androgos\", $red);
// output the image
header(\"Content-type: image/jpg\");
imagejpeg($im,\"\",80);
?>