Parašė iSin· 2010 Bir. 4 15:06:22
#5
Kolkas dar neperdariau.. tik perdarynesiu kaip tas žmogus "ATSILAISVYNS" :D..
o BASEFM tai duosiu kitokia biški panele:
openside("Exit-radio INFO");
//konfiguravimas
$scdef = "Exit-radio"; // serverio paw.
$scip = "82.135.249.18"; // ip arba URL (tik be jokiu html://)
$scport = "11111"; // Portas serverio
$scpass = "grybazzz"; // Paswordas
$maxusers = "112"; //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="404">
<tr>
<td width="109" align="right">
<b>DJ:</b></td>
<td width="13" align="right">
</td>
<td width="282" nowrap>
'.$servertitle.'</td>
</tr>
<tr>
<td width="109" align="right">
<b>Klauso:</b></td>
<td width="13" align="right">
</td>
<td width="282" nowrap>
'.$currentlisteners.' / '.$maxusers.'</td>
</tr>
<tr>
<td width="109" align="right">
<b>
Grojo:</b></td>
<td width="13" align="right">
</td>
<td width="282" nowrap>
'.$song[0].'</td>
</tr>
<tr>
<td width="109" align="right"> </td>
<td width="13" align="right"> </td>
<td width="282" nowrap> </td>
</tr>
</table>
</body>
</html>
';
} else {
echo'Serveris neveikia';
}
?>
<html>
<br><br>
<b><center>Klausytis Exit-radio</center></b>
<center><br><a href="http://82.135.249.18:11111/listen.pls" target="_blank"><img src="http://ecoeco2.freehostia.com/w.GIF"></a> <a href="http://82.135.249.18:11111/listen.m3u" target="_blank"><img src="http://ecoeco2.freehostia.com/m.gif"></a></center>
</html>
<?
closeside();