@ 2013-12-15T03:53:21Z <?PHP
// Shoutcast Server Stats
// Parses shoutcasts xml to make an effective stats thing for any website
// ©2004-2005 Daniel Brown http://www.gmtt.co.uk
// Please refer to the readme file for use.
//////////////////////////////////////////////////////////////////////////////////////////////
// Dinghy Radio Stats Information
// Grabs the xml from your radio server and displays it in a iframe that refreshes every 30 seconds.
// ©Daniel Brown www.gmtt.co.uk
//////////////////////////////////////////////////////////////////////////////////////////////
//Configuracion
$scdef = "Radio Ts-H"; // Nombre de la radio por defecto, se muestra cuando el servidor esta caido
$scip = "94.23.149.176"; // ip or url del servidor shoutcast (NO AÑADIR HTTP:// No incluir el puerto)
$scport = "9996"; // Puerto del servidor shoutcast
$scpass = "tshdj"; // Contraseña del servidor to shoutcast
//Fin configuratio
$scfp = fsockopen("$scip", $scport, &$errno, &$errstr, 30);
if(!$scfp) {
$scsuccs=1;
$locutor = 'Sin Locutor';
$actuals = 'Sin Cancion Actual';
$canciones = '
<b>1.</b> Sin Canciones Pasadas <BR><BR>
<b>2.</b> Sin Canciones Pasadas <BR><BR>
<b>3.</b> Sin Canciones Pasadas <BR><BR>
<b>4.</b> Sin Canciones Pasadas <BR><BR>
<b>5.</b> Sin Canciones Pasadas <BR><BR>'
;
}
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", "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);
// 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);
$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++;
}
//end song info
fclose($scfp);
}
//display stats
if($streamstatus == "1"){
//you may edit the html below, make sure to keep variable intact
$locutor = ''.$servertitle.'';
$actuals = ''.$song[0].'';
$canciones = '
<b>1.</b> '.$song[1].'<BR><BR>
<b>2.</b> '.$song[2].'<BR><BR>
<b>3.</b> '.$song[3].'<BR><BR>
<b>4.</b> '.$song[4].'<BR><BR>
<b>5.</b> '.$song[5].'<BR><BR>'
;
}
if($streamstatus == "0")
{
//you may edit the html below, make sure to keep variable intact
$locutor = 'Sin Locutor';
$actuals = 'Sin Cancion Actual';
$canciones = '
<b>1.</b> Sin Canciones Pasadas <BR><BR>
<b>2.</b> Sin Canciones Pasadas <BR><BR>
<b>3.</b> Sin Canciones Pasadas <BR><BR>
<b>4.</b> Sin Canciones Pasadas <BR><BR>
<b>5.</b> Sin Canciones Pasadas <BR><BR>'
;
}
?>
Enable javascript to submit You have javascript disabled. You will not be able to edit any code.
Output for 7.3.0 - 7.3.20 , 7.4.0 - 7.4.8 Parse error: syntax error, unexpected '&', expecting ')' in /in/I73L4 on line 17
Process exited with code 255 . Output for 7.0.0 - 7.0.33 , 7.1.0 - 7.1.33 , 7.2.0 - 7.2.32 Parse error: syntax error, unexpected '&' in /in/I73L4 on line 17
Process exited with code 255 . Output for 5.4.0 - 5.4.45 , 5.5.0 - 5.5.38 , 5.6.0 - 5.6.40 Fatal error: Call-time pass-by-reference has been removed in /in/I73L4 on line 17
Process exited with code 255 . Output for 5.3.0 - 5.3.29 Deprecated: Call-time pass-by-reference has been deprecated in /in/I73L4 on line 17
Deprecated: Call-time pass-by-reference has been deprecated in /in/I73L4 on line 17
Warning: fsockopen(): unable to connect to 94.23.149.176:9996 (Network is unreachable) in /in/I73L4 on line 17
Notice: Undefined variable: streamstatus in /in/I73L4 on line 77
Notice: Undefined variable: streamstatus in /in/I73L4 on line 91
preferences:dark mode live preview
323.83 ms | 1395 KiB | 294 Q