HabboxWiki needs you!
Are you a Habbo buff? Or maybe a rare trader with a bunch of LTDs? Get involved with HabboxWiki to share your knowledge!
Join our team!
Whether you're raving for rares, excited for events or happy helping, there's something for you! Click here to apply
Need a helping hand?
Check out our guides for all things to help you make friends, make rooms, and make money!


Results 1 to 8 of 8

Thread: Radio Stats

  1. #1
    Join Date
    Oct 2006
    Posts
    238
    Tokens
    0

    Default Radio Stats

    Okay, my radio_stats.php file dont work.

    Can anyone make me a stats.php page?

    I need it looking like www.freshhabbo.com 's / Clubhabbo.net 's/ThinkHabbo's as it's going to be in a box like that.

    ty.

    in Verdana Font
    White Text
    Size 1

    Likethis but in White:

    Currrent DJ: DJ Kport
    Listeners: 13
    Song: My My My (Radio Edit)


    Who ever can will get a Dicemaster from me for there help

    Last edited by Seduced; 05-11-2006 at 12:30 AM.

  2. #2
    Join Date
    Apr 2006
    Location
    Australia
    Posts
    307
    Tokens
    0

    Default

    radio_stats.php:
    PHP Code:
      <?php
    // Shoutcast Server Stats
    // Parses shoutcasts xml to make an effective stats thing for any website
    // ©2004-2005 Daniel Brown http://www.gmtt.co.uk
    // Please refer to the readme file for use.
    include('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.' 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($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">
    <META HTTP-EQUIV="REFRESH" CONTENT="30;URL=radio_stats.php">
    <link rel=stylesheet href="" type="text/css">
    <title>'
    .$scdef.'</title>
    <style type="text/css">body,html{background-color:transparent;}</style>
    </head>

    <body style="scrollbar-face-color: #006699; scrollbar-highlight-color: #000000; scrollbar-shadow-color: #000000; scrollbar-3dlight-color: #000000; scrollbar-arrow-color: #ffffff; scrollbar-track-color: #000000; scrollbar-darkshadow-color: #000000;" text="#ffffff">

    <p align="left">
     
    <font face="verdana" size="1"><b>&nbsp;Current DJ:</b>&nbsp;'
    .$servertitle.'</font></p>
    <font face="verdana" size="1"><b>&nbsp;Listeners:</b>&nbsp;'
    .$currentlisteners.'</font></p>

    <font face="verdana" size="1" color="#ffffff"><b>

        Current Song:</b>'
    .$song[0].'</font></p>
        <b>
     
    <BR>
    </p></p>
    </body>

    </html>'
    ;
    }
    if(
    $streamstatus == "0")
    {
    //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">
    <META HTTP-EQUIV="REFRESH" CONTENT="30;URL=radio_stats.php">
    <link rel=stylesheet href="" type="text/css">
    <title>Radio Server Is Offline</title>
    <style type="text/css">body,html{background-color:transparent;}</style>
    </head>

    <body text="#ffffff">
    <font face="verdana" size="1"><center>HabboSimple is currently offline!<br><br>Radio is currently Offline</font>
    </body>

    </html>'
    ;
    }
    ?>
    config_radio.php:
    PHP Code:
    <?php 
    ////////////////////////////////////////////////////////////////////////////////////////////// 
    // Dinghy Radio Stats Information 
    // Grabs the xml from your radio server and displays it in a iframe that refreshes every 30 seconds. 
    // ©Daniel Brown www.gmtt.co.uk 
    ////////////////////////////////////////////////////////////////////////////////////////////// 
    //Configuration 
    $scdef "Site Name";               // Default station name to display when server or stream is down 
    $scip "IP"// ip or url of shoutcast server (DO NOT ADD HTTP:// don't include the port) 
    $scport "port";                   // port of shoutcast server 
    $scpass "password";                 // password to shoutcast server 
    //End configuration 

    ?>
    Habbo UK Name: chrism182

    Drop dicemaster in my donations if you can
    Last edited by Zaub; 05-11-2006 at 02:10 AM.

  3. #3
    Join Date
    Oct 2006
    Posts
    238
    Tokens
    0

    Default

    This appears:


    Warning: fsockopen() [function.fsockopen]: unable to connect to shallowhosting.com:7000 in /home/hshout/public_html/radio_stats.php on line 7
    radio is Offline
    Last edited by Seduced; 05-11-2006 at 09:26 AM.

  4. #4
    Join Date
    Nov 2004
    Location
    HabboWeb FM Offices
    Posts
    3,019
    Tokens
    0

    Latest Awards:

    Default

    Quote Originally Posted by Catastrophical View Post
    radio_stats.php:
    PHP Code:
      <?php
    // Shoutcast Server Stats
    // Parses shoutcasts xml to make an effective stats thing for any website
    // ©2004-2005 Daniel Brown http://www.gmtt.co.uk
    // Please refer to the readme file for use.
    include('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.' 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($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">
    <META HTTP-EQUIV="REFRESH" CONTENT="30;URL=radio_stats.php">
    <link rel=stylesheet href="" type="text/css">
    <title>'
    .$scdef.'</title>
    <style type="text/css">body,html{background-color:transparent;}</style>
    </head>

    <body style="scrollbar-face-color: #006699; scrollbar-highlight-color: #000000; scrollbar-shadow-color: #000000; scrollbar-3dlight-color: #000000; scrollbar-arrow-color: #ffffff; scrollbar-track-color: #000000; scrollbar-darkshadow-color: #000000;" text="#ffffff">

    <p align="left">
     
    <font face="verdana" size="1"><b>&nbsp;Current DJ:</b>&nbsp;'
    .$servertitle.'</font></p>
    <font face="verdana" size="1"><b>&nbsp;Listeners:</b>&nbsp;'
    .$currentlisteners.'</font></p>

    <font face="verdana" size="1" color="#ffffff"><b>

        Current Song:</b>'
    .$song[0].'</font></p>
        <b>
     
    <BR>
    </p></p>
    </body>

    </html>'
    ;
    }
    if(
    $streamstatus == "0")
    {
    //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">
    <META HTTP-EQUIV="REFRESH" CONTENT="30;URL=radio_stats.php">
    <link rel=stylesheet href="" type="text/css">
    <title>Radio Server Is Offline</title>
    <style type="text/css">body,html{background-color:transparent;}</style>
    </head>

    <body text="#ffffff">
    <font face="verdana" size="1"><center>HabboSimple is currently offline!<br><br>Radio is currently Offline</font>
    </body>

    </html>'
    ;
    }
    ?>
    config_radio.php:
    PHP Code:
    <?php 
    ////////////////////////////////////////////////////////////////////////////////////////////// 
    // Dinghy Radio Stats Information 
    // Grabs the xml from your radio server and displays it in a iframe that refreshes every 30 seconds. 
    // ©Daniel Brown www.gmtt.co.uk 
    ////////////////////////////////////////////////////////////////////////////////////////////// 
    //Configuration 
    $scdef "Site Name";               // Default station name to display when server or stream is down 
    $scip "IP"// ip or url of shoutcast server (DO NOT ADD HTTP:// don't include the port) 
    $scport "port";                   // port of shoutcast server 
    $scpass "password";                 // password to shoutcast server 
    //End configuration 

    ?>
    Habbo UK Name: chrism182

    Drop dicemaster in my donations if you can

    All you have done is copied my tutorial.. I could have done that.

  5. #5
    Join Date
    Oct 2006
    Posts
    238
    Tokens
    0

    Default

    Warning: fsockopen() expects parameter 2 to be long, string given in /home/hshout/public_html/radio_stats.php on line 7
    radio is Offline

    tried both of them

  6. #6
    Join Date
    Sep 2006
    Location
    Doncaster, UK
    Posts
    574
    Tokens
    0

    Default

    either:

    enter the details properly
    turn your radio on
    make sure your host supports php
    Cheesecake.

  7. #7
    Join Date
    Sep 2005
    Location
    East London
    Posts
    3,028
    Tokens
    0

    Latest Awards:

    Default

    Quote Originally Posted by Vixt View Post
    either:

    enter the details properly
    turn your radio on
    make sure your host supports php
    - Lol course the host supports php! otherwhys he wouldn't of got a error like that!
    - Course hes turned the radio on..

    The details probs are turned on properly

    You need shell access.

  8. #8
    Join Date
    Nov 2006
    Posts
    14
    Tokens
    0

    Default

    Jack, if he radio was on, why would it say "radio is Offline". It might be a case of your typing in the infomation worng.

    If you could post the infomation you posted, just edit out the password so we can see what you've done worng.

Posting Permissions

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