<?php
/*
SHOUTcast Status
*/
header("Content-Type: text/html; charset=tis-620");// Charset=tis-620 or utf-8
header("Cache-Control: no-cache, must-revalidate");// HTTP/1.1
error_reporting(E_ALL & ~E_NOTICE);
// Edit the next two lines with your server information
$ip = '173.0.52.51';
$port = '8000';
if(!$get=@fsockopen($ip, $port, &$errno, &$errstr, 3)) {
//เมื่อไม่สามารถติดต่อ host ได้
echo "อุ๊ย! บางสิ่งผิดพลาด เจ้าหน้าที่กำลังดำเนินการแก้ไขเร็วที่สุด";
} else {
//Get 7.html
//fputs($get,"GET /7.html HTTP/1.0\r\n HTTP/1.0\r\nUser-Agent: Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0)\r\n\r\n");
fputs($get,"GET /7 HTTP/1.1\nUser-Agent:Mozilla\n\n");
while(!feof($get)) {
//The var $page gets the result of the 7.html.
$page = fgets($get, 1000);
}
//Close the connection because we no longer need it.
fclose($get);
//Remove stuff we don't need ( html tags)
$page = ereg_replace(".*<body>", "", $page);
$page = ereg_replace("</body>.*", ",", $page);
//Rip data we need.
$title = explode(",",$page);
//เปลี่ยนรูปแบบข้อมูล
$luisteraars = $title[0]; //Number of listeners
$streaming = $title[1]; //Streamstatus 1 = streaming 0 = not streaming
$piek = $title[2]; //Peak
$max = $title[3]; //Max. listeners
$unieke = $title[4]; //Unique listeners
$bitrate = $title[5]; //Bitrate
$song = $title[6]; //Current song
//เมื่อจัดรายการให้แสดงข้อมูลเพลง
if(isset($streaming)) {
if($streaming == "1") {
echo "<HTML><meta http-equiv=\"Pragma\" content=\"no-cache\"></head><body><b>Status กำลังเล่นเพลง :</b> ".$song." Bitrate ".$bitrate." Kbps (จำนวนผู้ฟัง : ".$unieke."/".$max.") <!-- จัดโดย ".$title." --></body></html>";// output "$song" (the songtitle) this output will be shown on the SHOUTcast Status container.
}
}
//เมื่อไม่ได้จัดรายการให้แสดง
if(isset($streaming)) {
if($streaming == "0") {
echo "สถานีปิด...คุณสามารถติดตามเเละรับฟังผลงานเพลงเพราะๆ กับเราได้ใหม่ ที่นี้ !!";
}
}
}
?>
พออัพขึ้นแล้วจะขึ้นแต่ อุ๊ย! บางสิ่งผิดพลาด เจ้าหน้าที่กำลังดำเนินการแก้ไขเร็วที่สุด อ่ะครับไม่รู้ว่าผิดตรงไหน
