if ($work=1) $img="blankOn.png"; else $img="blankOff.png"; $im = ImageCreateFromPng($img);
<?php $ip = "194.24.190.24"; $port = "8000"; $ice2_station = "Rадио ZED-FM"; if (ini_get('display_errors') == 1) ini_set('display_errors', 0); $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"> <td><img border="0" src="images/ice2_status/radio_stopped.png" width="102" height="105"></td> <td><font face="Georgia" size="4" color="#FF0000">'.$ice2_station.' <br>сейчас не работает</font></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 $mount = $numbers[11]; $connections = $numbers[12]; $station =$numbers[13]; $listeners = $numbers[14]; $description = $numbers[15]; $cur_song = $numbers[16]; $www_url = $numbers[17]; if (strlen($mount)<2) echo '<table width="100%" style="border-collapse: collapse" bordercolor="#111111" cellpadding="0" cellspacing="0"> <tr> <td width="100%"> <td><img border="0" src="images/ice2_status/radio_stopped.png" width="102" height="105"></td> <td><font face="Georgia" color="red" size="3"><b>'.$ice2_station.'<br> Сервер запущен, но нет трансляции</b></font></td> </tr> </table>'; // не работает, но сервер запущен //edit html to fit your stations site, this display is for online status else echo '<table width="100%" style="border-collapse: collapse" bordercolor="#111111" cellpadding="0" cellspacing="0"> <tr> <td width="100%"><b><font face="Arial" size="2"> <tr> <td width="100%"><b><font face="Georgia" color="green" size="3"> <img border="0" src="images/ice2_status/radio_play.png" width="102" height="106"> '.$ice2_station.' в эфире! </font></b></td> <td width="100%"><b><font face="Georgia" color="green" size="3"> <img border="0" src="images/ice2_status/listeners.png" width="128" height="99"> Слушателей: '.$listeners.'. </font><a href="radio.htm">Присоединиться.</a></b></td> </tr> </table>'; } //сервер запущен и радио работает ?>