<form action="https://www.paypal.com/cgi-bin/webscr" method="post">

<input type="hidden" name="cmd" value="_s-xclick">

<input type="hidden" name="hosted_button_id" value="3952111">

<input type="image" src="https://www.paypal.com/en_US/i/btn/btn_donate_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">

<img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1">

</form>
<br>

<font color="#FFFFFF"></font><?php
$fontcolor = "#FFFFFF"; // text color
$offset = (60*5) + (60*2); // converts time to GMT by adding 5 hours as well as compensates for the 22 minute lag in the server time.
$realoffset = (60*0) + (60*0); // converts time to GMT by adding 5 hours as well as compensates for the 22 minute lag in the server time.
$today = getdate();
$month = $today['month'];
$mday = $today['mday'];
$year = $today['year'];

error_reporting(0);
include('config.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.0\r\nUser-Agent: SHOUTcast Song Status (Mozilla Compatible)\r\n\r\n");
while(!feof($scfp)) {
  $page .= fgets($scfp, 1000);
}



//define  xml elements
$loop = array("STREAMSTATUS", "BITRATE");
$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);


// uncomment the next line to see all variables
// echo'$'.$scphp.' = '.$$scphp.'<br>';
  $y++;
}
//end intro xml elements




//get song info and history
$pageed = ereg_replace(".*<SONGHISTORY>", "", $page);
$pageed = ereg_replace("<SONGHISTORY>.*", "", $pageed);
$songatime = explode("<SONG>", $pageed);
$now = time();
$realtime = $now + $realoffset;
$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

fclose($scfp);
}

//display stats
if($streamstatus == "1"){
//you may edit the html below, make sure to keep variable intact
echo'
<html>

<head>
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">

<title>'.$scdef.'</title>
</head>

<body background="homecoming_fullsize.jpg" text="'.$fontcolor.'">
<p style="margin-top: 0; margin-bottom: 0">
<font size="3" face="arial" color="'.$fontcolor.'"><b>'. $month . ' ' . $mday . ', ' . $year . ' - ' . date("h:i:s A", $realtime) . '<b></font><br><font size="2" face="arial" color="'.$fontcolor.'">(Times are PST)<br></font>
<font face="Arial" size="2"><b>Stream Bitrate:</b>&nbsp; '.$bitrate.'kbps</font></p>
<p style="margin-top: 0; margin-bottom: 0">
<font face="Verdana" size="2" color="'.$fontcolor.'"><b>

    <BR>

        Current Mix:</b> '.$song[0].' <b>Played @</b> '.date('jS F\, g:i A', $playedat[0] + $offset).'</font></p>
    <p style="margin-top: 0; margin-bottom: 0"><b>
    <font face="Verdana" size="2" color="'.$fontcolor.'"><BR>
        Mix Sets Played:</font></b></p>
    <p style="margin-top: 0; margin-bottom: 0"><font color="'.$fontcolor.'"><font face="Arial" size="1">

<b>1.</b>  '.$song[1].' - <b>Played </b> '.date('jS F\, g:i A', $playedat[1] + $offset).'<BR>
<b>2.</b>  '.$song[2].' - <b>Played </b> '.date('jS F\, g:i A', $playedat[2] + $offset).'<BR>
<b>3.</b>  '.$song[3].' - <b>Played </b> '.date('jS F\, g:i A', $playedat[3] + $offset).'<BR>

<b>4.</b>  '.$song[4].' - <b>Played </b> '.date('jS F\, g:i A', $playedat[4] + $offset).'<BR>
<b>5.</b>  '.$song[5].' - <b>Played </b> '.date('jS F\, g:i A', $playedat[5] + $offset).'<BR>
<b>6.</b>  '.$song[6].' - <b>Played </b> '.date('jS F\, g:i A', $playedat[6] + $offset).'<BR>

<b>7.</b>  '.$song[7].' - <b>Played </b> '.date('jS F\, g:i A', $playedat[7] + $offset).'<BR>
<b>8.</b>  '.$song[8].' - <b>Played </b> '.date('jS F\, g:i A', $playedat[8] + $offset).'<BR>
<b>9.</b>  '.$song[9].' - <b>Played </b> '.date('jS F\, g:i A', $playedat[9] + $offset).'<BR></font><BR>

</body>

</html>';
}
?>

