<?php echo iconv ('UTF-8','CP-1251',$text) /////////////////////////////////////////////////// //icecast2 status refined v1.1 xsl refined // Author: that dude over there at casterclub.com // Bugs: post in the forums at casterclub ////////////////////////////////////////////////// //start the madness already ////////////////////////////////////////////////// //start the configurations $ip = "мой ип"; //your server address in the form of mydomain.com or 192.161.1.1 $port = "8000"; //the port of your server $ice2_station = "Radio"; // your station or stream name ////////////////start the parsin action\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ //opening socket $fp = fsockopen("$ip", $port, &$errno, &$errstr, 30); //open connection if(!$fp) { $success=2; //set if no connection //edit html to fit your stations site, this display is for offline status echo'<table> <tr> <td width="100%" colspan="2"> <img border="0" src="images/offline.gif" width="22" height="22"> <b><font face="Arial" size="2" color="#FF0000">'.$ice2_station.' в данный момент не работает</font></b></td> </tr> </table>'; } if($success!=2){ //if connection fputs($fp,"GET /status2.xsl HTTP/1.0\r\nUser-Agent: Icecast2 XSL Parser (Mozilla Compatible)\r\n\r\n"); //get status2.xsl while(!feof($fp)) { $page .= fgets($fp, 1000); } fclose($fp); //close connection $page = ereg_replace(".*<pre>", "", $page); //extract data $page = ereg_replace("</pre>.*", ",", $page); //extract data $numbers = explode(",",$page); //bomb it and extract data $mount = $numbers[0]; $connections = $numbers[1]; $stream_n = $numbers[2]; $listeners = $numbers[3]; $desc = $numbers[4]; $cur_song = $numbers[5]; $str_url = $numbers[6]; $client_info = $numbers[7]; $test1 = $numbers[8]; //set vars that where empty and still dont know what the heck those values are ;-) $test2 = $numbers[9]; //set vars that where empty and still dont know what the heck those values are ;-) $test3 = $numbers[10]; //set vars that where empty and still dont know what the heck those values are ;-) $mount = $numbers[11]; $connections = $numbers[12]; $station =$numbers[13]; $listeners = $numbers[14]; $description = $numbers[15]; $cur_song = $numbers[16]; $www_url = $numbers[17]; //edit html to fit your stations site, this display is for online status echo' <table width="100%" style="border-collapse: collapse" bordercolor="#111111" cellpadding="0" cellspacing="0"> <tr> <td width="100%"><b><font face="Arial" size="2"> <img border="0" src="images/ice2_status/icecast.gif" width="22" height="22"> Powered By Icecast2</font></b></td> </tr> <tr> <td width="100%"><b><font face="Arial" size="1"><a href="'.$www_url.'"> '.$station.'</a> - '.$description.'</font></b></td> </tr> <tr> <td width="100%"><b><font face="Arial" size="1"> <img border="0" src="images/ice2_status/listeners.gif" width="22" height="18"> Listeners: '.$listeners.'</font></b></td> </tr> <tr> <td width="100%"><b><font face="Arial" size="1"> <img border="0" src="images/ice2_status/tunes.gif" width="21" height="21"> Now Playing: '.$cur_song.'</font></b></td> </tr> <tr> <td width="100%"><b><font face="Arial" size="2"> <img border="0" src="images/ice2_status/play.gif" width="15" height="15"> <a target="_blank" href="http://'.$ip.':'.$port.''.$mount.'.m3u">Listen Now</a></font></b></td> </tr> </table>'; } ?>
<?php echo iconv ('UTF-8','CP-1251',$cur_song); /////////////////////////////////////////////////// //icecast2 status refined v1.1 xsl refined // Author: that dude over there at casterclub.com // Bugs: post in the forums at casterclub ////////////////////////////////////////////////// //start the madness already ////////////////////////////////////////////////// //start the configurations $ip = "мой ип"; //your server address in the form of mydomain.com or 192.161.1.1 $port = "8000"; //the port of your server $ice2_station = "Radio"; // your station or stream name
<?php /////////////////////////////////////////////////// //icecast2 status refined v1.1 xsl refined // Author: that dude over there at casterclub.com // Bugs: post in the forums at casterclub ////////////////////////////////////////////////// //start the madness already ////////////////////////////////////////////////// //start the configurations $ip = "мой ип"; //your server address in the form of mydomain.com or 192.161.1.1 $port = "8000"; //the port of your server $ice2_station = "Radio"; // your station or stream name ////////////////start the parsin action\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ //opening socket $fp = fsockopen("$ip", $port, &$errno, &$errstr, 30); //open connection if(!$fp) { $success=2; //set if no connection //edit html to fit your stations site, this display is for offline status echo'<table> <tr> <td width="100%" colspan="2"> <img border="0" src="images/offline.gif" width="22" height="22"> <b><font face="Arial" size="2" color="#FF0000">'.$ice2_station.' в данный момент не работает</font></b></td> </tr> </table>'; } if($success!=2){ //if connection fputs($fp,"GET /status2.xsl HTTP/1.0\r\nUser-Agent: Icecast2 XSL Parser (Mozilla Compatible)\r\n\r\n"); //get status2.xsl while(!feof($fp)) { $page .= fgets($fp, 1000); } fclose($fp); //close connection $page = ereg_replace(".*<pre>", "", $page); //extract data $page = ereg_replace("</pre>.*", ",", $page); //extract data $numbers = explode(",",$page); //bomb it and extract data $mount = $numbers[0]; $connections = $numbers[1]; $stream_n = $numbers[2]; $listeners = $numbers[3]; $desc = $numbers[4]; $cur_song = $numbers[5]; $str_url = $numbers[6]; $client_info = $numbers[7]; $test1 = $numbers[8]; //set vars that where empty and still dont know what the heck those values are ;-) $test2 = $numbers[9]; //set vars that where empty and still dont know what the heck those values are ;-) $test3 = $numbers[10]; //set vars that where empty and still dont know what the heck those values are ;-) $mount = $numbers[11]; $connections = $numbers[12]; $station =$numbers[13]; $listeners = $numbers[14]; $description = $numbers[15]; $cur_song = iconv ('UTF-8','CP-1251',$numbers[16]); $www_url = $numbers[17]; //edit html to fit your stations site, this display is for online status echo' <table width="100%" style="border-collapse: collapse" bordercolor="#111111" cellpadding="0" cellspacing="0"> <tr> <td width="100%"><b><font face="Arial" size="2"> <img border="0" src="images/ice2_status/icecast.gif" width="22" height="22"> Powered By Icecast2</font></b></td> </tr> <tr> <td width="100%"><b><font face="Arial" size="1"><a href="'.$www_url.'"> '.$station.'</a> - '.$description.'</font></b></td> </tr> <tr> <td width="100%"><b><font face="Arial" size="1"> <img border="0" src="images/ice2_status/listeners.gif" width="22" height="18"> Listeners: '.$listeners.'</font></b></td> </tr> <tr> <td width="100%"><b><font face="Arial" size="1"> <img border="0" src="images/ice2_status/tunes.gif" width="21" height="21"> Now Playing: '.$cur_song.'</font></b></td> </tr> <tr> <td width="100%"><b><font face="Arial" size="2"> <img border="0" src="images/ice2_status/play.gif" width="15" height="15"> <a target="_blank" href="http://'.$ip.':'.$port.''.$mount.'.m3u">Listen Now</a></font></b></td> </tr> </table>'; } ?>