Temos pavadinimas: WordPress, Shopify ir PHPFusion programuotojų bendruomenė :: Radio

Parašė Rytis· 2007 Bir. 5 18:06:00
#12

openside("LiuxFM eterio info");
//konfiguravimas
$scdef = "LiuxFM"; // serverio paw.
$scip = "liuxfm.servemp3.com"; // ip arba URL (tik be jokiu html://)
$scport = "8002"; // Portas serverio
$scpass = "xxxxxxx"; // Paswordas
$maxusers = "32"; //Kiek vienu sykiu klausosi zmoniu
//Konfiguracijos pabaiga


$scfp = fsockopen("$scip", $scport, &$errno, &$errstr, 30);
if(!$scfp) {
$scsuccs=1;
echo''.$scdef.' Neveikia';
}
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);
}

//tvarkome xml

$loop = array("STREAMSTATUS", "BITRATE", "SERVERTITLE", "CURRENTLISTENERS");
$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);

$y++;
}
//pabaiga xml sudarymas


$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++;
}


fclose($scfp);
}

//ishvedam i ekrana
if($streamstatus == "1"){
echo'
<html>
<p align="center"><center>
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100">
<tr>
<td width="100" align="center">
Eteryje:</td>
<td width="13" align="center">
</td>
<td width="50" nowrap>';
if($servertitle=="DJ AKER") {
$djphoto='djaker.jpg';
global $djphoto;
} elseif($servertitle=="DJ_wydmys") {
$djphoto='DJwydmys.jpg';
global $djphoto;
}
echo "<img src='imges/".$djphoto."' alt='".$servertitle."'><br/>Eteryje: ".$servertitle."<br/>";echo'

</td>
</tr>
<tr>
<td width="50" align="center">
Klauso:</td>
<td width="13" align="center">
</td>
<td width="50" nowrap>
'.$currentlisteners.' / '.$maxusers.'</td>
</tr><tr>
<td width="50" align="center">
</td>
<td width="13" align="center">
</td>
<td width="50" nowrap>
</td><i><marquee behavior="center">
'.$song[0].'</td>
</tr>
<tr>

</tr>
</table>
</body>

</html>
';
} else {
echo'Serveris neveikia';
}
?>
<html>
<center><a href="http://liuxfm.servemp3.com:8002/listen.pls"><img src="http://liuxfm.xz.lt/images/winampas.gif" border="0" alt="Winamp" /></a> <a href="http://84.32.149.125:8002/listen.m3u"><img src="http://liuxfm.xz.lt/images/media.gif" border="0" alt="Windows Media Player" /></a></center>

<center><img src="http://img444.imageshack.us/img444/7596/aacplussmallct1.gif" border="0" alt="aacPlus" /></a></center>
</html>
<?
closeside();


protauti reikia....