<?php $data = file_get_contents('http://localhost:88/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); } $data = iconv("utf-8", "cp1251", $data); $title = antara($data, "Stream Title:</td>\n<td class=\"streamdata\">","</td>"); $description = antara($data, "Stream Description:</td>\n<td class=\"streamdata\">","</td>"); $content_type = antara($data, "Content Type:</td>\n<td class=\"streamdata\">","</td>"); $Mount_started = antara($data, "Mount started:</td>\n<td class=\"streamdata\">","</td>"); $Bitrate = antara($data, "Bitrate:</td>\n<td class=\"streamdata\">","</td>"); $Current_listeners = antara($data, "Current Listeners:</td>\n<td class=\"streamdata\">","</td>"); $Peak_listeners = antara($data, "Peak Listeners:</td>\n<td class=\"streamdata\">","</td>"); $Stream_genre = antara($data, "Peak Listeners:</td>\n<td class=\"streamdata\">","</td>"); $Stream_url = antara($data, "Stream URL:</td>\n<td class=\"streamdata\">","</td>"); $Current_song = antara($data, "Current Song:</td>\n<td class=\"streamdata\">","</td>"); $hellp_curr_listeners = antara($hellp, "Сейчас слушают:</td>\n<td class=\"streamdata\">","</td>"); $hellp_peak_listeners = antara($hellp, "Максимум было</td>\n<td class=\"streamdata\">","</td>"); $Curr_listens=$Current_listeners2+$Current_listeners+$hellp_curr_listeners; $Peak_listens=$Peak_listeners2+$Peak_listeners+$hellp_peak_listeners; $staylst=$Curr_listens+1; echo '<span style="font-size: 0.72em; font-family:Trebuchet MS, Tahoma, Arial, sans-serif; color:#3090c3"><b>Название радио:</b> '.$title.' <br> <b>За пультом:</b> '.$description.' <br> <b>Битрейт:</b> '.$Bitrate.' <br> <b>Сейчас слушают:</b> '.$Curr_listens.' <br> <b>Максимум слушало:</b> '.$Peak_listens.' <br> <b>Сейчас в эфире:</b> '.$Current_song.' <br> <br> <center><input type="button" value="Слушать радио" onclick="location.href=\'http://xoiniki.com:88/live.m3u\'" /></center>'; ?>
<limits> <clients>100</clients> <sources>2</sources> <queue-size>102400</queue-size> <client-timeout>30</client-timeout> <header-timeout>15</header-timeout> <source-timeout>10</source-timeout> <burst-on-connect>1</burst-on-connect> <burst-size>65536</burst-size> </limits>
<?php error_reporting(0); header("Content-Type: text/html; charset=cp1251"); $file_name="http://91.228.152.154:8000/status.xsl?mount=/live"; $r=fopen($file_name,'r'); $text=fread($r,10000); fclose($r); $mas=explode('<tr>', $text); $name = explode(':', $mas[3]); $q = explode ('</td>',$name[1]); $q2 = explode ('<td class="streamdata">',$q[1]); $rj = $q2[1]; if($rj == "0" or $rj == ""){ echo " Nonstop"; }else { $fl = file_get_contents('http://91.228.152.154: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>"); $max = antara($fl, "<td>Peak Listeners:</td>\n<td class=\"streamdata\">", "</td>"); $song = antara($fl, "<td>Current Song:</td>\n<td class=\"streamdata\">", "</td>"); switch ($stream) { case "gccvhvhgv": echo "<img src='http://dfm.ru/upload/contents/406/logo_bomb.gif' wight=100%>"; break; } echo ""; } ?>
<icecast> <limits> <clients>10000</clients> <sources>4</sources> Тут менять от количества подключенных Dj, каждый подключенный DJ +2. <threadpool>5</threadpool> <queue-size>524288</queue-size> <client-timeout>30</client-timeout> <header-timeout>15</header-timeout> <source-timeout>10</source-timeout> <burst-on-connect>1</burst-on-connect> <burst-size>65535</burst-size> </limits> <authentication> <source-password>пароль</source-password> <relay-password>пароль</relay-password> <admin-user>admin</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> <password>Пароль от админка icecast</password> <fallback-mount>/nonstop</fallback-mount> <fallback-override>1</fallback-override> </mount> <mount> <mount-name>/nonstop</mount-name> <password>Пароль от админка icecast</password> </mount> <mount> <mount-name>/ник Dj</mount-name> <password>пароль DJ</password> <fallback-mount>/nonstop</fallback-mount> <fallback-override>1</fallback-override> </mount> <mount> <mount-name>/nonstop</mount-name> <password>Пароль от админка icecast</password> </mount> <!-- Что бы подключить ещё одного Dj скопируйте <mount> <mount-name>/ник Dj</mount-name> <password>пароль DJ</password> <fallback-mount>/nonstop</fallback-mount> <fallback-override>1</fallback-override> </mount> <mount> <mount-name>/nonstop</mount-name> <password>Пароль от админка icecast</password> </mount> и замените ники и пароли.> --> <paths> <!-- basedir is only used if chroot is enabled --> <basedir>/usr/share/icecast2</basedir> <!-- Note that if <chroot> is turned on below, these paths must both be relative to the new root, not the original root --> <logdir>/home/radio</logdir> <webroot>/usr/share/icecast2/web</webroot> <adminroot>/usr/share/icecast2/admin</adminroot> <!-- <pidfile>/usr/share/icecast2/icecast.pid</pidfile> --> <!-- Aliases: treat requests for 'source' path as being for 'dest' path May be made specific to a port or bound address using the "port" and "bind-address" attributes. --> <!-- <alias source="/foo" dest="/bar"/> --> <!-- Aliases: can also be used for simple redirections as well, this example will redirect all requests for ********** to the status page --> <alias source="/" dest="/status.xsl"/> </paths> <logging> <accesslog>access.log</accesslog> <errorlog>error.log</errorlog> <!-- <playlistlog>playlist.log</playlistlog> --> <loglevel>3</loglevel> <!-- 4 Debug, 3 Info, 2 Warn, 1 Error --> <logsize>10000</logsize> <!-- Max size of a logfile --> <!-- If logarchive is enabled (1), then when logsize is reached the logfile will be moved to [error|access|playlist].log.DATESTAMP, otherwise it will be moved to [error|access|playlist].log.old. Default is non-archive mode (i.e. overwrite) --> <!-- <logarchive>1</logarchive> --> </logging> <security> <chroot>0</chroot> <changeowner> <user>icecast2</user> <group>icecast2</group> </changeowner> </security> </icecast>