All pastes #472563 Raw Edit

Untitled

public text v1 · immutable
·published 2007-05-05 17:53 UTC
rendered paste body
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<?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.

// ©2004-2005 Coleman Hamilton http://www.dj-coleman.com
// Coleman Hamilton added:
// Add-On MAXLISTNERS insead of the / 10 MAXLISTENERS which was set, and the BITRATE add-on.
// Online and Offline graphics, and add-on code.
// Better HTML Script.

// Do Not Try To Edit This Only Unless You Know What You're Doing!!!!!!!

include('config_radio.php');

$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.0rnUser-Agent: SHOUTcast Song Status (Mozilla Compatible)rnrn");
 while(!feof($scfp)) {
  $page .= fgets($scfp, 1000);
 };
$loop = array("STREAMSTATUS", "BITRATE", "SERVERTITLE", "CURRENTLISTENERS", "MAXLISTENERS", "BITRATE");
 $y=0;
 while($loop[$y]!=''){
 $pageed = ereg_replace(".*<$loop[$y]--><html>
<head>
<title>", "", $songatime[$r]); $song[$t] = ereg_replace("</title>
</head>
<body background=\"http://www.discohabbo.co.uk/v1/backers.PNG\">", "", $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.' '; $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(".*.*", "", $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 echo' 
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<p align="center">&nbsp;</p>
<center><font face="Verdana" size="1"><b>On Air DJ:</b> '.$servertitle.' 
<br><b>Listeners:</b> '.$currentlisteners.' / '.$maxlisteners.' 
<br><b>Current Song:</b> '.$song[0].' 
<p>
<img title="" height="12" alt="" src="/statsbar.gif" width="60"></p><b>
<p>&nbsp;</p>'; } if($streamstatus == "0") { //you may edit the html below, make sure to keep variable intact echo' 
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<center><font face="Verdana">We are currently offline!</font> '; } ?> </center>
<center>&nbsp;</center>
<center>&nbsp;</center></b></font></center>
</body>
</html>