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!


Page 1 of 2 12 LastLast
Results 1 to 10 of 17
  1. #1
    Join Date
    Dec 2006
    Location
    I duno
    Posts
    229
    Tokens
    0

    Default Can someone tell me if these codes are right

    For some reason my radio stats dont seem to be working properly could someone tell me if they are right so i know im doing something wrong

    Thank You

    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> 
    </head> 
    <body text="verdana" bgcolor="#FFFFFF"> 
     
     
    <p align="center"><center> 
    <font face="arial" size="2"><b>&nbsp;Radio:</b>&nbsp;'
    .$servertitle.'</font></p> 
    <font face="arial" size="2"><b>&nbsp;Listeners:</b>&nbsp;'
    .$currentlisteners.' / 1000</font></p> 
    <font face="verdana" size="2" color=""><b> 
        Current Song:</b> '
    .$song[0].'</font></p> 
        <b> 
     
        <font face="arial" size="2"> 
        Past Songs:</font></b> 
    <font color=""><font face="verdana" size="2"> 
    <p align="center"> 
    <b>1.</b>  '
    .$song[1].'<BR> 
    <b>2.</b>  '
    .$song[2].'<BR> 
    <b>3.</b>  '
    .$song[3].'<BR> 
    </font> 
    <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> 
    </head> 
    <body text="" bgcolor=""> 
    Radio Offline! 
    </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 "Habbo-Charm";               // Default station name to display when server or stream is down 
    $scip "Shoutcastservers.info"// ip or url of shoutcast server (DO NOT ADD HTTP:// don't include the port) 
    $scport "8116";                   // port of shoutcast server 
    $scpass "I Know Pass Goes Here Im Just Not Gunna Tell Anyone Now Am I";                 // password to shoutcast server 
    //End configuration 
    ?>
    Thank You and yes i do know the password goes there it there on the one of my Cpanel i just dont want no1 contecting

    The Animals Holding Me Captive:
    OIver 30 mice ( Newst litter of 4 20th 8 08 )
    6 Rats-Gaz&Jonny,Amber&Ershala,Mortisha& Mitilda
    1 Dog-Barni ( Corgi Cross )
    2 Parrots-Polly & Oscar
    5 Cat-Buddy & Holly ( 4 kitten 28th 8 08 )

  2. #2
    Join Date
    May 2006
    Location
    Hull
    Posts
    7,701
    Tokens
    2,430
    Habbo
    Moh

    Latest Awards:

    Default

    whats the problem

  3. #3
    Join Date
    Dec 2006
    Location
    I duno
    Posts
    229
    Tokens
    0

    Default

    Quote Originally Posted by .:jack120:. View Post
    whats the problem
    They wont show up on my site which is here

    The Animals Holding Me Captive:
    OIver 30 mice ( Newst litter of 4 20th 8 08 )
    6 Rats-Gaz&Jonny,Amber&Ershala,Mortisha& Mitilda
    1 Dog-Barni ( Corgi Cross )
    2 Parrots-Polly & Oscar
    5 Cat-Buddy & Holly ( 4 kitten 28th 8 08 )

  4. #4
    Join Date
    Aug 2006
    Location
    Wakefield, West Yorkshire
    Posts
    1,351
    Tokens
    0

    Latest Awards:

    Default

    Seem to be right. Is your host fsock enabled? If not, then ur stats wont work. I can host them 4 u if u want. Just PM me ur pass ill put em on my old site. All im using it 4 now is hosting stuff. (i promise i wont connect i got my own site to dj on neway and i hardly eva dj). Btw shoutcastservers.info rawk. Its what I use.

  5. #5
    Join Date
    Dec 2006
    Location
    I duno
    Posts
    229
    Tokens
    0

    Default

    Quote Originally Posted by Lolly View Post
    Seem to be right. Is your host fsock enabled? If not, then ur stats wont work. I can host them 4 u if u want. Just PM me ur pass ill put em on my old site. All im using it 4 now is hosting stuff. (i promise i wont connect i got my own site to dj on neway and i hardly eva dj). Btw shoutcastservers.info rawk. Its what I use.
    They where working before i put this layout up and im using the same code :s

    The Animals Holding Me Captive:
    OIver 30 mice ( Newst litter of 4 20th 8 08 )
    6 Rats-Gaz&Jonny,Amber&Ershala,Mortisha& Mitilda
    1 Dog-Barni ( Corgi Cross )
    2 Parrots-Polly & Oscar
    5 Cat-Buddy & Holly ( 4 kitten 28th 8 08 )

  6. #6
    Join Date
    May 2005
    Location
    San Francisco, CA
    Posts
    7,160
    Tokens
    2,331

    Latest Awards:

    Default

    Im probs wrong but Lolly, fsock isnt something you "enable". Im sure its just a PHP Function?..

  7. #7
    Join Date
    Dec 2006
    Location
    I duno
    Posts
    229
    Tokens
    0

    Default

    ITs all confusing lol :s

    The Animals Holding Me Captive:
    OIver 30 mice ( Newst litter of 4 20th 8 08 )
    6 Rats-Gaz&Jonny,Amber&Ershala,Mortisha& Mitilda
    1 Dog-Barni ( Corgi Cross )
    2 Parrots-Polly & Oscar
    5 Cat-Buddy & Holly ( 4 kitten 28th 8 08 )

  8. #8
    Join Date
    Apr 2005
    Posts
    231
    Tokens
    0

    Default

    config_radio.php
    Code:
    <?php
    //////////////////////////////////////////////////////////////////////////////////////////////
    // Stats Information
    // Grabs the xml from your radio server and displays it in a iframe that refreshes every 30 seconds.
    //////////////////////////////////////////////////////////////////////////////////////////////
    //Configuration
    $scdef = "Habbo Shack Radio";               // Default station name to display when server or stream is down
    $scip = "Nor this.. But i do sell reseller shoutcast.";               // ip or url of shoutcast server
    $scport = "8002";             // port of shoutcast server
    $scpass = "Same Im not entering mine ^.^";             // password to shoutcast server
    //End configuration
    
    ?>
    And another file you'll need.

    radio_stats.php
    Code:
    <html>
    
    <head>
    <TEXT="ffffff">
    <body bgcolor="ffffff">
    	<font color="ffffff"><?php
    // Shoutcast Server Stats
    // Parses shoutcasts xml to make an effective stats thing for any website
    // Coded by Daniel Brown. Edited by Nick Coates [SharpeHosting.com] [SharpeNews] KEEP THIS INTACT!!!
    // 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, &$errstr, 10);
     if(!$scfp) {
      $scsuccs=1;
    echo''.$scdef.'Radio Is Currently 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($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">
    <META HTTP-EQUIV="REFRESH" CONTENT="30">
    <link rel=stylesheet href="" type="text/css">
    <title>'.$scdef.'</title>
    </head>
    <body text="ffffff" bgcolor="ffffff">
    
    <font color="black"><font face="verdana" size="1"><b>DJ:</b>&nbsp;'.$servertitle.'</font><br>
    <font color="black"><font face="verdana" size="1"><b>Listeners:</b>&nbsp;'.$currentlisteners.' / 500</font><br>
    <font face="verdana" size="1" color="black"><b>Current Song:</b>&nbsp;'.$song[0].'</font><br>
    </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="10;URL=radio_stats.php">
    <link rel=stylesheet href="" type="text/css">
    <title>Radio Is Curently Offline</title>
    </head>
    
    <body text="ffffff" bgcolor=""><STYLE type=text/css>
    UNKNOWN {
    	FONT-SIZE: 10px; COLOR: #black; FONT-FAMILY: verdana
    }
    BODY {
    	BACKGROUND-COLOR: ffffff
    }
    A:link {
    	COLOR: ; TEXT-DECORATION: none
    }
    A:visited {
    	COLOR: #000000; TEXT-DECORATION: none
    }
    A:hover {
    	COLOR: #000000; TEXT-DECORATION: underline
    }
    A:active {
    	TEXT-DECORATION: none
    }
    BODY {
    	FONT-SIZE: 10px; COLOR: ffffff; FONT-FAMILY: verdana
    }
    TD {
    	FONT-SIZE: 10px; COLOR: ffffff; FONT-FAMILY: verdana
    }
    TH {
    	FONT-SIZE: 10px; COLOR: ffffff; FONT-FAMILY: verdana
    }
    .style5 {font-size: 50px}
    </STYLE>
    <div><center><BR><BR><img src="images/offline.jpg"></img><BR>
    <BR><b>Radio is Currently</b><BR>
    <b>Offline</b>
    </center></div>
    </body>
    
    </html>';
    }
    ?></font>
    </body>
    Use these on my fansite. so i know they work..

    Rep please ^.^
    Last edited by Replicada; 11-01-2007 at 06:53 PM.
    Hosting / Shoutcast / Domains / Web Design
    VPS / Dedis / Gaming Servers(Coming Soon)

  9. #9
    Join Date
    Dec 2005
    Location
    Australia
    Posts
    693
    Tokens
    0

    Default

    Quote Originally Posted by Invent View Post
    Im probs wrong but Lolly, fsock isnt something you "enable". Im sure its just a PHP Function?..
    You are wrong. Some hosts disable fsockopen, like many other functions.
    XHTML, CSS, AJAX, JS, php, MySQL.

    --

    HxF moderators can't read timestamps.

  10. #10
    Join Date
    May 2005
    Location
    San Francisco, CA
    Posts
    7,160
    Tokens
    2,331

    Latest Awards:

    Default

    Ahh okay thanks. I got confused with him saying he has used the code before and it worked fine.

Page 1 of 2 12 LastLast

Posting Permissions

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