<?php html_entity_decode($content,0,"cp1251")> // Shoutcast Server Stats // Parses shoutcasts xml to make an effective stats thing for any website // ©2004-2005 Daniel Brown ********** // Please refer to the readme file for use. // Add-On MAXLISTNERS insead of the / 10 MAXLISTENERS which was set, and the BITRATE add-on. // Online and Offline graphics, and add-on code. // Better HTML Script. // Do Not Try To Edit This Only Unless You Know What You're Doing!!!!!!! include('config_radio.php'); $scfp = fsockopen("$scip", $scport, &$errno, &$errstr, 30); if(!$scfp) { $scsuccs=1; echo''.$scdef.' is Offline'; } if($scsuccs!=1){ fputs($scfp,"GET /admin.cgi?pass=$scpass&mode=viewxml HTTP/1.0\r\nUser-Agent: SHOUTcast Song Status (Mozilla Compatible)\r\n\r\n"); while(!feof($scfp)) { $page .= fgets($scfp, 1000); } ###################################################################################################################### /////////////////////////part 1 \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ //define xml elements $loop = array("STREAMSTATUS", "BITRATE", "SERVERTITLE", "CURRENTLISTENERS", "MAXLISTENERS", "BITRATE", "RADIO",); $y=0; while($loop[$y]!=''){ $pageed = ereg_replace(".*<$loop[$y]>", "", $page); $scphp = strtolower($loop[$y]); $$scphp = ereg_replace("</$loop[$y]>.*", "", $pageed); if($loop[$y]==SERVERGENRE || $loop[$y]==SERVERTITLE || $loop[$y]==SONGTITLE || $loop[$y]==SERVERTITLE) $$scphp = urldecode($$scphp); // uncomment the next line to see all variables //echo'$'.$scphp.' = '.$$scphp.'<br>'; $y++; } //end intro xml elements ###################################################################################################################### ###################################################################################################################### /////////////////////////part 2\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ //get song info and history $pageed = ereg_replace(".*<SONGHISTORY>", "", $page); $pageed = ereg_replace("<SONGHISTORY>.*", "", $pageed); $songatime = explode("<SONG>", $pageed); $r=1; while($songatime[$r]!=""){ $t=$r-1; $playedat[$t] = ereg_replace(".*<PLAYEDAT>", "", $songatime[$r]); $playedat[$t] = ereg_replace("</PLAYEDAT>.*", "", $playedat[$t]); $song[$t] = ereg_replace(".*<TITLE>", "", $songatime[$r]); $song[$t] = ereg_replace("</TITLE>.*", "", $song[$t]); $song[$t] = urldecode($song[$t]); $dj[$t] = ereg_replace(".*<SERVERTITLE>", "", $page); $dj[$t] = ereg_replace("</SERVERTITLE>.*", "", $pageed); $r++; } //end song info fclose($scfp); } //display stats if($streamstatus == "1"){ //you may edit the html below, make sure to keep variable intact echo' <html> <head> <meta http-equiv="content-type" content="text/html; charset="windows-1251" /> <link rel=stylesheet href="" type="text/css"> <title>'.$scdef.'</title> </head> <body text="" bgcolor=""> <p align="center"><center> <img src="http://www.r-radio.org/images/radio-online.gif"><br> <b>За вертушкой:</b> '.$servertitle.'<br> <b>Сейчас играет:</b> '.$song[0].'<br> <b>Качество:</b> '.$bitrate.'kbps<br> <b>Нас слушают:</b> '.$currentlisteners.'<br> <b>Слушать:</b> <a href=http://89.108.83.167:8000/listen.pls><img src=/images/winamp.gif border=0></a> <a href=mms://89.108.83.167:8000/><img src=/images/wmp.gif border=0></a> <a href="http://www.r-radio.org/radio.htm" target="blank"><img src=/images/open.gif border=0></a></p> </body> </html>'; } if($streamstatus == "0") { //you may edit the html below, make sure to keep variable intact echo' <html> <head> <meta http-equiv="content-type" content="text/html; charset="windows-1251" /> <link rel=stylesheet href="" type="text/css"> <title>Radio Server Is Offline</title> </head> <body text="" bgcolor=""> <center> <img src="http://www.r-radio.org/images/radio-offline.gif"> </body> </html>'; } ?>
<?php html_entity_decode($content,0,"cp1251") ...
<?php html_entity_decode($content=0, "cp1251")