Results 1 to 5 of 5
  1. #1
    Join Date
    Nov 2006
    Location
    D?sseldorf
    Posts
    2,858
    Tokens
    2,256

    Latest Awards:

    Default Why won't this work >:{

    Ok, i have a shoutcast, and i also have some php stats.

    But the stats won't work

    Here's the link:
    http://habtown.net/staff/frontend/stats.php

    Here's the code:
    PHP Code:
    <?php

    $scdef 
    = "Habtown"; // radio name here

    $scip = "205.234.215.43"; // url here

    $scport = "8052"; // port number here

    $scpass = "******"; // password here
    ?>

    <?php 


    $scfp 
    = fsockopen("$scip", $scport, &$errno, &$errstr, 30); 

    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($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); 

    } 

    ?>

    <body bgcolor="#FDDF85">

    <font face="Verdana" size="1">

    <p><br>

    <? if($streamstatus == "1"){ echo "<meta http-equiv=\"refresh\" content=\"5;><body bgcolor=\"#FFFFFF\"><b>Online:</b> Yes <b>DJ:</b> $servertitle <b>Listeners:</b> $currentlisteners <b> Song: </b> $song[0]"; } else { echo "<b>Online:</b> No"; } ?>

    </p>

    </p>

      

    </body>



    </html>
    Anyone any idea's?

    Btw, the radio is online at this present moment

  2. #2
    Join Date
    Nov 2006
    Location
    D?sseldorf
    Posts
    2,858
    Tokens
    2,256

    Latest Awards:

    Default

    anyone?

  3. #3
    Join Date
    Dec 2007
    Posts
    1,683
    Tokens
    0

    Latest Awards:

    Default

    argh.

    Erm, if you edited the stats, are you sure the slashes are in before the quotes (In the php.)

  4. #4
    Join Date
    May 2006
    Posts
    1,797
    Tokens
    0

    Latest Awards:

    Default

    Dont bump thread

    And youve put in details wrong/your shoutcast aint working
    Coming and going...
    Highers are getting the better of me

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

    Latest Awards:

    Default

    Contact your host and ask them to alow you to use port 8052. Then they will work

Posting Permissions

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