Sveiki, taigi as noriu i panele iterpt paveiksleli paneles virsuje stai kodas: openside("Radijas");
$scip="78.60.60.29";
$scport="8000";
$scpass="ssss";
//$ip="$s"; //localhost
$scfp = fsockopen($scip, $scport);
//$scfp = fsockopen("$scip", $scport, &$errno, &$errstr, 30);
if(!$scfp) {
$scsuccs=1;
//echo''.$scdef.' is Offline';
}
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);
}
######################################################################################################################
/////////////////////////part 1 \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
//define xml elements
$loop = array("STREAMSTATUS", "BITRATE", "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)
$$scphp = urldecode($$scphp);
// $servert[$y] = ereg_replace(".*<SERVERTITLE>", "", $servert[$y]);
// $servert[$y] = ereg_replace("</SERVERTITLE>.*", "", $servert[$y]);
// uncomment the next line to see all variables
// echo'$'.$scphp.' = '.$$scphp.'<br>';
$y++;
}
//end intro xml elements
######################################################################################################################
######################################################################################################################
/////////////////////////part 2\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
//get song info and history
$pageed = ereg_replace(".*<SONGHISTORY>", "", $page);
$pageed = ereg_replace("<SONGHISTORY>.*", "", $pageed);
$songatime = explode("<SONG>", $pageed);
$pageed = ereg_replace(".*<SERVERTITLE>", "", $page);
$pageed = ereg_replace("</SERVERTITLE>.*", "", $pageed);
$servert = explode("<SERVERTITLE>", $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]);
$r++;
}
//end song info
// $obisk = explode("<POINTER>", $obisk);
fclose($scfp);
}
//display stats
if($streamstatus == "1"){
//you may edit the html below, make sure to keep variable intact
echo"
<table width=100% align=center border=0 cellpadding=0 cellspacing=0>
<tr><b>
<td><div align=center><font size=2 face=Tahoma><strong>
Daina: <br> <marquee><font color=#f0051>$song[0]</marquee></font></b>
Eteryje: <br><font color=#yudf55>$servert[0] <br></font>
Klausytoju: <br> <font color=#fg551>$currentlisteners </font>
<p>>>><a href='http://78.60.60.29:8000/listen.pls' target='_blank'><b> Klausyk </b></a><<<</p>
</tr>
</table>
";
}
closeside();
?>
Noriu iterpti si paveiksleli: http://www.part.lt/perziura/d9aa...9a3180.jpg
Gal galite iterpti? Prasau pagalbos
|