Discover Habbo's history
Treat yourself with a Secret Santa gift.... of a random Wiki page for you to start exploring Habbo's history!
Happy holidays!
Celebrate with us at Habbox on the hotel, on our Forum and right here!
Join Habbox!
One of us! One of us! Click here to see the roles you could take as part of the Habbox community!


Results 1 to 5 of 5
  1. #1
    Join Date
    Feb 2007
    Location
    Cyprus/London
    Posts
    601
    Tokens
    260
    Habbo
    -Cazz

    Latest Awards:

    Default ShoutCast stats [help]

    Hi, me and my friend just cannot get the stats working, can anyone help?
    the server is fine its just the script.
    +rep to helpers

    Edited by Aflux (Forum Moderator) - Moved to 'Online Radios'. Please post in the correction section.
    Last edited by Aflux; 20-01-2008 at 04:53 PM.
    What would life be, without music?

  2. #2
    Join Date
    Feb 2007
    Location
    West Midlands
    Posts
    1,168
    Tokens
    0
    Habbo
    Jibbish

    Latest Awards:

    Default

    Post the error an we might be able to help?

  3. #3
    Join Date
    Feb 2007
    Location
    Cyprus/London
    Posts
    601
    Tokens
    260
    Habbo
    -Cazz

    Latest Awards:

    Default

    i dont know the error lmao. i just need stats that work x]
    What would life be, without music?

  4. #4
    Join Date
    Dec 2006
    Location
    London
    Posts
    3,536
    Tokens
    170

    Latest Awards:

    Default

    HTML Code:
    <?
    // ** CONFIGURATION ** - Please enter details within the speech marks
    //Radio IP
    $scip = "RADIOIP";
    //Radio port
    $scport = "RADIOPORT";
    //Radio password
    $scpass = "RADIOPASSWORD";
    //If offline, say:
    $offlinemsg = "Sorry! The radio is currently offline!";
    // ** END CONFIGURATION **
    $scfp = fsockopen("$scip", $scport, &$errno, &$errstr, 30);
    if(!$scfp) {
       $scsuccs=1;
    echo $offlinemsg; 
     }
    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);
       }
    //define  xml elements
    $loop = array("STREAMSTATUS", "BITRATE", "SERVERTITLE", "CURRENTLISTENERS", "MAXLISTENERS", "BITRATE");
    $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);
       $y++;
    }
    //end intro xml elements
    //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 "
    <p align=center><center>
    <b>DJ:</b> $servertitle<br>
    <b>Listeners:</b> $currentlisteners / $maxlisteners<br>
    <b>Current Song:</b> $song[0]</p>
    <p><b>Song History</b></p>
    <p><b>1.</b> $song[1]<br>
    <b>2.</b> $song[2]<br>
    <b>3.</b> $song[3]<br>
    <b>4.</b> $song[4]<br></p>
    ";
    }
    //If radio is offline.
    if($streamstatus == "0")
    {
    echo "<p>$offlinemsg</p>";
    }
    ?>
    I made that for my DJ Panel a while ago.
    I hope it works You only need to change the top bit where it says RADIOIP etc.
    2005: JOINED ; Radio DJ

    2006: Radio DJ ; Senior DJ

    2007: HxTV Flash Artist ; Productions Staff ; HxHD Staff ; Head DJ ; Events Organiser ; Productions Staff ; Competitions Staff ; Assistant Radio Manager

    2008: Senior Competitions Staff ; Forum Moderator ; HxHD Staff ; Competitions Manager ; Graphics Designer

    2009: LEFT ; Guest DJ

  5. #5
    Join Date
    Jan 2008
    Location
    England
    Posts
    285
    Tokens
    0

    Default

    Quote Originally Posted by H0BJ0B View Post
    HTML Code:
    <?
    // ** CONFIGURATION ** - Please enter details within the speech marks
    //Radio IP
    $scip = "RADIOIP";
    //Radio port
    $scport = "RADIOPORT";
    //Radio password
    $scpass = "RADIOPASSWORD";
    //If offline, say:
    $offlinemsg = "Sorry! The radio is currently offline!";
    // ** END CONFIGURATION **
    $scfp = fsockopen("$scip", $scport, &$errno, &$errstr, 30);
    if(!$scfp) {
       $scsuccs=1;
    echo $offlinemsg; 
     }
    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);
       }
    //define  xml elements
    $loop = array("STREAMSTATUS", "BITRATE", "SERVERTITLE", "CURRENTLISTENERS", "MAXLISTENERS", "BITRATE");
    $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);
       $y++;
    }
    //end intro xml elements
    //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 "
    <p align=center><center>
    <b>DJ:</b> $servertitle<br>
    <b>Listeners:</b> $currentlisteners / $maxlisteners<br>
    <b>Current Song:</b> $song[0]</p>
    <p><b>Song History</b></p>
    <p><b>1.</b> $song[1]<br>
    <b>2.</b> $song[2]<br>
    <b>3.</b> $song[3]<br>
    <b>4.</b> $song[4]<br></p>
    ";
    }
    //If radio is offline.
    if($streamstatus == "0")
    {
    echo "<p>$offlinemsg</p>";
    }
    ?>
    I made that for my DJ Panel a while ago.
    I hope it works You only need to change the top bit where it says RADIOIP etc.
    You also need to change most of the varibles, such as the login infomation and the port.

Posting Permissions

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