Results 1 to 3 of 3
  1. #1
    Join Date
    Aug 2005
    Location
    nottingham
    Posts
    23
    Tokens
    1,389

    Latest Awards:

    Default errors with radio stats

    help me please i keep getting this error

    Warning: fsockopen() [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

    my config code is the following

    PHP Code:
    <?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 Code:
    <?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, &$errstr30);
     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($scfp1000);
     }
    ######################################################################################################################
    /////////////////////////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.

  2. #2
    Join Date
    Aug 2006
    Posts
    53
    Tokens
    50
    Habbo
    Ash564

    Latest Awards:

    Default

    After <?php tag, on the next line type

    error_reporting(0);

    Then that should work.

    Ash

  3. #3
    Join Date
    Nov 2006
    Location
    Liverpool/Manchester
    Posts
    2,457
    Tokens
    0

    Latest Awards:

    Default

    Your stats cant connect

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


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •