Right now I am running a radio server and I set up a WordPress blog for it.
I made it auto refresh the widget by including it in an iframe that auto refreshes every 10 seconds.
However, I have a programming issue. Whenever it has a "-" in the song name ($artist[2]), it automatically puts it into the next one ($artist[3])
Here is my code for the php file: http://fonts.googleapis.com/css?family=Merriweather+Sans:400,700' rel='stylesheet' type='text/css'> p { font-family: 'Merriweather Sans', sans-serif; font-weight: 400; } b { font-family: 'Merriweather Sans', sans-serif; font-weight: 700; }
<?php header("Refresh: 10")>
//Display IceCast Server Stats
$server = "direct.x86cam.com"; //IP (x.x.x.x or domain name)
$iceport = "8000"; //Port
$iceurl = "stream.mp3"; //Mountpoint
$online = "<font color=green><b>ONLINE</b> </font><br />";
$offline = "<font color=red><b>OFFLINE</b></font><br />";
if($fp = @fsockopen($server, $iceport, $errno, $errstr, '1')) {
fclose($fp);
$ice_status=$online;
echo "<p><b>Stream Status:</b> $ice_status";
$stats = file("http://" . $server . ":" . $iceport . "/status2.xsl");
$status = explode(",", $stats[5]);
$artist = explode("-", $status[5]);
echo "<b>Artist:</b> " . $artist[1];
echo "<b>Song:</b> " . $artist[2];
echo "<br />";
echo "<b>Listeners:</b> <b> " . $status[3] . "</b>";
echo "</p>";
//echo "<br />";
//echo "<p><a href=http://" . $server . ":" . $iceport . "/" . $iceurl . " target=new><b>Listen!</b></a></p>";
} else {
$ice_status=$offline;
echo "<p><b>Stream Status:</b> $ice_status";
}
?>
<hr />
</center>
Can anyone please explain how I could fix this?