PDA

View Full Version : errors with radio stats



bunc.man
15-06-2008, 10:23 PM
help me please i keep getting this error

Warning: fsockopen() [function.fsockopen (http://www.habbomelody.com/function.fsockopen)]: unable to connect to 66.79.188.157:8220 in /home/habbomel/public_html/radio_stats.php on line 3
www.habbomelody.com1 (http://www.habbomelody.com1)

my config code is the following


<?php
$scdef = "www.habbomelody.com"; // Default station name to display when server or stream is down
$scip = ""; // ip or url of shoutcast server (DO NOT ADD HTTP:// )
$scport = ""; // port of shoutcast server
$scpass = ""; // password to shoutcast server
?>


not going to say details obviously :)

and heres my radio_stats


<?php
include('sn_config_radio.php'); //you may edit this path to fit your server environment otherwise leave it alone
$scfp = fsockopen("$scip", $scport, &$errno, &$errstr, 30);
if(!$scfp) {
$scsuccs=1;
echo''.$scdef.'1';
}
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
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">
<link rel=stylesheet href="" type="text/css">
<title>'.$scdef.'</title>
</head>
<body text="#000000" bgcolor="#99CCFF">

<font face="Tahoma" size="1">
<b>&nbsp;Dj:</b>&nbsp;'.$servertitle.'</p>
<b>&nbsp;Listeners:</b>&nbsp;'.$currentlisteners.'</p>
<b>
Current Song:</b> '.$song[0].'
<br>
<br>
<b>Past Songs:</b>
<br>
<b>1.</b> '.$song[1].'<BR>
<b>2.</b> '.$song[2].'<BR>
<b>3.</b> '.$song[3].'<BR>
<b>4.</b> '.$song[4].'<BR>
</font>
</body>
</html>';
}
if($streamstatus == "0")
{
echo'
<html>
</body>
<head>
<title>Radio Server Is Offline</title>
</head>

</body>
</html>';
}
?>

please help me much appreciated also the pages are uploaded on the same server as my website.

Ash564
19-06-2008, 07:00 AM
After <?php tag, on the next line type

error_reporting(0);

Then that should work.

Ash

iJoe
19-06-2008, 01:56 PM
Your stats cant connect ;)

make sure you are putting the ADMIN password and not the broadcast password

Want to hide these adverts? Register an account for free!