If anyone is interested, I managed to make this work, I have re-written how the title is checked on the SC Server and finally got it working..
<?php
/* ----------- Server configuration ---------- */
require_once('sc-config.php'); // Shoutcast
require_once('../../wp-config.php'); // WPdb
/* ----- No need to edit below this line ----- */
/* ------------------------------------------- */
$fp = @fsockopen($ip,$port,$errno,$errstr,1); // Open connection to Shoutcast
if (!$fp)
{
echo "Connection refused"; // Displays when sever is offline
}
else
{
fputs($fp, "GET /7.html HTTP/1.0\r\nUser-Agent: Mozilla\r\n\r\n"); // Get Stream Title
while (!feof($fp))
{
$info = fgets($fp);
}
$info = str_replace('</body></html>', "", $info);
$split = explode(',', $info);
$query = "SELECT title, userID FROM sc_options where id = '1'"; // Grab last title update from db table row
$result = mysql_query($query);
while($row = mysql_fetch_row($result))
$onAir_Title = $row[0]; // Create db show title string
$onAir_IMG = $row[1]; // User ID of last show update
if ($onAir_Title == $split[6]) // Check table row matches live stream title
{
echo $onAir_Title;
echo get_avatar( $onAir_IMG, 96); // User ID
}
else // If it doesn't match output the title from the SC server
{
$title = str_replace('\'', '`', $split[6]);
$title = str_replace(',', ' ', $title);
echo "$title"; // Displays song
}
}
?>