Parašė T-Boy· 2010 Lie. 24 14:07:42
#5
Atkeliu. :)
O negali buti cia kur nors klaida:
<script type="text/javascript">
<!--
function myPopup2() {
window.open( "", "myWindow",
"status = 1, height = 18, width = 299, resizable = 0" )
}
//-->
</script>
<?php
error_reporting(0);
$scdef = "Atsiprasome, Siuo metu serveris yra isjungtas."; // Юinutл, kuri bus matoma serveriui bыnant offline.
$scip = ""; // Shoutcast IP
$scport = ""; // Shoutcast PORT
$scpass = ""; // Shoutcast SLAPTAЮODIS
error_reporting(0);
$scsuccs = NULL;
$page = NULL;
$scfp = fsockopen("$scip", $scport, &$errno, &$errstr, 30);
if(!$scfp) {
$scsuccs=1;
echo''.$scdef.' ';
}
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);
}
######################################################################################################################
/////////////////////////konfiguracija 2\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
//define xml elements
$loop = array("STREAMSTATUS", "BITRATE", "SERVERTITLE", "CURRENTLISTENERS", "AIM", "ICQ");
$y=0;
while (isset($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") || ($loop[$y] == "ICQ") || ($loop[$y] == "AIM"))
$$scphp = urldecode($$scphp);
// uncomment the next line to see all variables
// echo'$'.$scphp.' = '.$$scphp.'<br>';
$y++;
}
//end intro xml elements
######################################################################################################################
######################################################################################################################
/////////////////////////konfiguracija 2\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
//get song info and history
$pageed = ereg_replace(".*<SONGHISTORY>", "", $page);
$pageed = ereg_replace("<SONGHISTORY>.*", "", $pageed);
$songatime = explode("<SONG>", $pageed);
$r=1;
while (isset($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++;
}
$daina = str_replace('_',' ',substr ($song[0],0,70));
//end song info
fclose($scfp);
}
//display stats
if($streamstatus == "1"){
switch ($aim) {
default: $aimlogo = "$aim";
}
$_SESSION['dj'] = $dj;
echo'<div id="text" style="padding-left: 5px;"> <font size="2" face="Tahoma" color="#000000">On Air:</font>';
echo'<font size="2px" face="Tahoma" color="#000000"> '.$aimlogo.'</div> </font>';
}
if($streamstatus == "0")
{
echo'<font size="2" face="tahoma" color="#6C6D7B">Atsiprasome, radijas neveikia.</font>';
}
echo "";
?>