Selam arkadaşalar ..aşağıdaki koda göre dinleci sayısını nasıl sabıt göstere bilirim...
Kod: Kodu kopyalamak için üzerine çift tıklayın!
<?
$host = "111.111.111.11";
$port = "0000";
$fp = @fsockopen($host, $port, $errno, $errstr, 01);
if(!$fp) {
$status = "17";
}else{
fputs($fp,"GET /7.html HTTP/1.0\r\nUser-Agent: XML Getter (Mozilla Compatible)\r\n\r\n");
while(!feof($fp)) {
$page .= fgets($fp, 1000);
}
fclose($fp);
$page = ereg_replace(".*<body>", "", $page);
$page = ereg_replace("</body>.*", ",", $page);
$numbers = explode(",",$page);
$currentlisteners=$numbers[0];
$connected=$numbers[1];
$peaklisteners=$numbers[2];
$maxlisteners=$numbers[3];
$reportedlisteners=$numbers[4];
$bit=$numbers[5];
$song=$numbers[6];
if($connected==0) {
$status = "Not Connected";
}else{
$status = "Online";
} }
if($image == "true") {
header("Content-type: image/png");
if($status == "Online") {
$im = imagecreatefrompng("thugie.png");
$background_color = imagecolorallocate($im, 10, 10, 10);
$text_color = imagecolorallocate($im, 20, 200, 20);
imagestring($im, 3, 2, 1, "Server Status: Server is currently up and streaming.", $text_color);
imagestring($im, 3, 2, 15, "Stream Status: Stream is up at $bit kbps with $currentlisteners of $maxlisteners listeners ($reportedlisteners unique)", $text_color);
imagestring($im, 3, 2, 30, "Listener Peak: " . $peaklisteners, $text_color);
imagestring($im, 3, 2, 45, "Current Song: " . $song, $text_color);
imagepng($im);
}else{
if($status == "17"){
$im = imagecreatefrompng("thugie.png");
$background_color = imagecolorallocate($im, 10, 10, 10);
$text_color = imagecolorallocate($im, 20, 200, 20);
imagestring($im, 3, 2, 1, "Server Status: Server is currently 17.", $text_color);
imagestring($im, 3, 2, 15, "Stream Status: Stream is up at 0 kbps with 0 of 0 listeners (0 unique)", $text_color);
imagestring($im, 3, 2, 30, "Listener Peak: 0", $text_color);
imagestring($im, 3, 2, 45, "Current Song: None", $text_color);
imagepng($im);
}else{
if($status == "Not Connected") {
$im = imagecreatefrompng("thugie.png");
$background_color = imagecolorallocate($im, 10, 10, 10);
$text_color = imagecolorallocate($im, 20, 200, 20);
imagestring($im, 3, 2, 1, "Server Status: Server is currently up and not streaming.", $text_color);
imagestring($im, 3, 2, 15, "Stream Status: Stream is up at $bit kbps with $currentlisteners of $maxlisteners listeners ($reportedlisteners unique)", $text_color);
imagestring($im, 3, 2, 30, "Listener Peak: " . $peaklisteners, $text_color);
imagestring($im, 3, 2, 45, "Current Song: " . $song, $text_color);
imagepng($im);
}}}}else{
?>