<?php
// Mysql staus image script by Anthony Parkes
//
[email protected]
// www.aj-services.com
$server = ""; // IP address to your shoutcast server.
$port = ""; // port of your shoutcast server
$online = ""; // Online Gif image
$offline = ""; // offline gif image
// Start Data Collection
$fp = fsockopen("$server", $port, $errno, $errstr, 30);
fputs($fp, "GET /7.html HTTP/1.0\r\nUser-Agent: Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0)\r\n\r\n");
while (!feof($fp)) {
$content .= fgets($fp,128);
}
fclose($fp);
// start data processing
$debut = strpos($content, '<body>') + strlen('<body>');
$fin = strpos($content, '</body>', $debut);
$string = substr($content, $debut, $fin - $debut);
$stats = explode(',', $string);
// Start Image generation
// Dedug Status echo "$stats[1]";
//offline
if ($stats[1] == "0") {
header("Content-type: image/gif");
readfile('$offline');
}
//online
if ($stats[1] == "1") {
header("Content-type: image/gif");
readfile('$online');
}
?>
[http://www.habboring.com/scripts/SHOUTcast%20Image%20Stats.zip] (http://www.habboring.com/scripts/SHOUTcast%20Image%20Stats.zip%5D)
Ok, I have edited it to display the actual stats. I'm having trouble displaying the current radio dj.
echo("HabbCrazy is Online<br>Listeners: $stats[0] ($stats[4] unique)<br>Radio DJ: $stats[help]<br>Current Song: $stats[6]");
Do you know which number is stream title?