<?php error_reporting(0); $xml = simplexml_load_file("http://localhost:8000/test.xspf"); $anon1=$xml->trackList->track->annotation->info; $ma=explode("\n", $anon1); $anon=$xml->trackList->track->annotation; $mas=explode("\n", $anon); $m=explode(":", $mas[0]); $mas1=explode("\n", $anon); $lisn=explode(":", $mas1[5]); $s=$m[1]; $smb="^"; $file_name='http://localhost:8000/status2.xsl?mount=/test'; $r=fopen($file_name,'r'); $text=fread($r,1000); fclose($r); $mass=explode(",", $text); $current=$mass [16]; $string = strpos($m[1], "_"); if($string == "3" ) { echo'<html> <meta http-equiv="refresh" content="20"> </html> <table border="2" width="100%"> <td> <b>В эфире</b>: '.$s.' </td> <b>Сейчас играет</b>:<br><MARQUEE> '.$current.'</MARQUEE> <br> <b>Слушателей</b>: '.$lisn[1].' <br> </table>' ; } else { $xml = simplexml_load_file("http://localhost:8000/nonstop.xspf"); $anon2=$xml->trackList->track->annotation->info; $ma1=explode("\n", $anon1); $anon=$xml->trackList->track->annotation; $mas=explode("\n", $anon); $mas=explode("~", $mas[0]); $name=explode("^", $mas[1]); $mas1=explode("\n", $anon); $lisn1=explode(":", $mas1[4]); $file_name='http://localhost:8000/status2.xsl?mount=/nonstop'; $r=fopen($file_name,'r'); $text=fread($r,1000); fclose($r); $mass=explode(",", $text); $current1=$mass [16]; $listens=$mass [9]; echo'<html> <meta http-equiv="refresh" content="20"> </html> <table border="2" width="100%" align="left"> <td> <b>В эфире</b>: Non-Stop </td> <b>Сейчас играет</b>:<br><MARQUEE> '.$current1.'</MARQUEE> <br> <b>Слушателей</b>: '.$lisn1[1].' <br> </table> '; } ?>
<!-- This config file contains a minimal set of configurable parameters, and mostly just contains the things you need to change. We created this for those who got scared away from the rather large and heavily commented icecast.xml.dist file. --> <icecast> <limits> <sources>5</sources> </limits> <authentication> <source-password>******</source-password> <relay-password>******</relay-password> <admin-user>********</admin-user> <admin-password>*********</admin-password> </authentication> <hostname>localhost</hostname> <listen-socket> <port>8000</port> </listen-socket> <fileserve>1</fileserve> <mount> <mount-name>/live</mount-name> <fallback-mount>/nonstop</fallback-mount> <fallback-override>1</fallback-override> </mount> <mount> <mount-name>/nonstop</mount-name> <fallback-mount>/live</fallback-mount> <fallback-override>1</fallback-override> </mount> <mount> <mount-name>/test</mount-name> <fallback-mount>/live</fallback-mount> <fallback-override>1</fallback-override> </mount> <paths> <logdir>./logs</logdir> <webroot>./web</webroot> <adminroot>./admin</adminroot> <alias source="/" dest="/status.xsl"/> </paths> <logging> <accesslog>access.log</accesslog> <errorlog>error.log</errorlog> <loglevel>3</loglevel> <!-- 4 Debug, 3 Info, 2 Warn, 1 Error --> </logging> </icecast>
<mount> <mount-name>/live</mount-name> <fallback-mount>/nonstop</fallback-mount> <fallback-override>1</fallback-override> </mount> <mount> <mount-name>/nonstop</mount-name> </mount
<?php $fl = file_get_contents('http://localhost:8000/status.xsl?mount=/live'); function antara($string, $start, $end){ $string = " ".$string; $ini = strpos($string,$start); if ($ini == 0) return ""; $ini += strlen($start); $len = strpos($string,$end,$ini) - $ini; return substr($string,$ini,$len); } $stream = antara($fl,"<td>Stream Title:</td>\n<td class=\"streamdata\">","</td>"); $description = antara($fl, "<td>Stream Description:</td>\n<td class=\"streamdata\">", "</td>"); $listeners = antara($fl, "<td>Current Listeners:</td>\n<td class=\"streamdata\">", "</td>"); $song = antara($fl, "<td>Current Song:</td>\n<td class=\"streamdata\">", "</td>"); if($stream != '') if($description == "live") { echo "Skms"; } else if($description == "Default description") { echo "Нет ведущих"; } else echo "Нет ведущих"; else echo "Нет Ведущих"; ?>
<?php $fl = file_get_contents('http://localhost:8000/status.xsl'); function antara($string, $start, $end){ $string = " ".$string; $ini = strpos($string,$start); if ($ini == 0) return ""; $ini += strlen($start); $len = strpos($string,$end,$ini) - $ini; return substr($string,$ini,$len); } $stream = antara($fl,"<td>Stream Title:</td>\n<td class=\"streamdata\">","</td>"); $description = antara($fl, "<td>Stream Description:</td>\n<td class=\"streamdata\">", "</td>"); $listeners = antara($fl, "<td>Current Listeners:</td>\n<td class=\"streamdata\">", "</td>"); $song = antara($fl, "<td>Current Song:</td>\n<td class=\"streamdata\">", "</td>"); echo "$description"; ?>