Results 1 to 6 of 6

Thread: I need help

  1. #1
    Join Date
    Jun 2007
    Posts
    56
    Tokens
    0

    Default I need help

    I have this code


    PHP Code:
    <? session_start();
    include(
    'config_radio.php');
    include
    'alert.php';
    $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 http-equiv="Content-Language" content="en-gb">
    <meta name="GENERATOR" content="Microsoft FrontPage 6.0">
    <meta name="ProgId" content="FrontPage.Editor.Document">
    <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
    <META HTTP-EQUIV="REFRESH" CONTENT="40;URL=last10.php">
    <link rel=stylesheet href="" type="text/css">
    <title>'
    .$scdef.'</title>
    </head>

    <body text="verdana" bgcolor="white">
    <font face="Trebuchet MS">

    <p align="center"><b>The Last Ten Songs Played on StokeFM</b></p>


    </body>

    <p align="center">
    <table border="0" style="border-collapse: collapse" width="36%" id="table1" cellspacing="6" height="48">
                                <tr>
                                    <td bgcolor="#33CCFF" style="border-style: dotted; border-width: 1px; padding-left: 4px; padding-right: 4px" bordercolor="#C0C0C0">
                                    <p style="margin-top: 0; margin-bottom: 0" align="center">


                                    <p style="margin-top: 0; margin-bottom: 0" align="center">


                                    <p style="margin-top: 0; margin-bottom: 0" align="center">


                                    <p style="margin-top: 0; margin-bottom: 0" align="center">

    <font face="Trebuchet MS"><font size="5" color="#00000">
    1.<? echo("$song[1]");?> <br/>
    2.<? echo("$song[2]");?><br/>
    3.<? echo("$song[3]");?><br/>
    4.<? echo("$song[4]");?><br/>
    5.<? echo("$song[5]");?><br/>
    6.<? echo("$song[6]");?><br/>
    7.<? echo("$song[7]");?><br/>
    8.<? echo("$song[8]");?><br/>
    9.<? echo("$song[9]");?><br/>
    10.<? echo("$song[10]");?><br/>
    </html></font>'
    ;
    }
    ?>

    It is sposed to display the last ten songs played

    Anyone no whats up with? - it just dosent display it :S
    Visit The Worlds #1 Online Radio Station - http://www.stokefm.co.uk

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

    Latest Awards:

    Default

    PHP Code:
    <? session_start();
    include(
    'config_radio.php');
    include
    'alert.php';
    $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 http-equiv="Content-Language" content="en-gb">
    <meta name="GENERATOR" content="Microsoft FrontPage 6.0">
    <meta name="ProgId" content="FrontPage.Editor.Document">
    <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
    <META HTTP-EQUIV="REFRESH" CONTENT="40;URL=last10.php">
    <link rel=stylesheet href="" type="text/css">
    <title>'
    .$scdef.'</title>
    </head>

    <body text="verdana" bgcolor="white">
    <font face="Trebuchet MS">

    <p align="center"><b>The Last Ten Songs Played on StokeFM</b></p>


    </body>

    <p align="center">
    <table border="0" style="border-collapse: collapse" width="36%" id="table1" cellspacing="6" height="48">
                                <tr>
                                    <td bgcolor="#33CCFF" style="border-style: dotted; border-width: 1px; padding-left: 4px; padding-right: 4px" bordercolor="#C0C0C0">
                                    <p style="margin-top: 0; margin-bottom: 0" align="center">


                                    <p style="margin-top: 0; margin-bottom: 0" align="center">


                                    <p style="margin-top: 0; margin-bottom: 0" align="center">


                                    <p style="margin-top: 0; margin-bottom: 0" align="center">

    <font face="Trebuchet MS"><font size="5" color="#00000">
    1.'
    .$song[1].' <br/>
    2.'
    .$song[2].'<br/>
    3.'
    .$song[3].'<br/>
    4.'
    .$song[4].'<br/>
    5.'
    .$song[5].'<br/>
    6.'
    .$song[6].'<br/>
    7.'
    .$song[7].'<br/>
    8.'
    .$song[8].'<br/>
    9.'
    .$song[9].'<br/>
    10.'
    .$song[10].'<br/>
    </html></font>'
    ;
    }
    ?>

  3. #3
    Join Date
    Jun 2007
    Posts
    56
    Tokens
    0

    Default omg

    OMG you star!
    Visit The Worlds #1 Online Radio Station - http://www.stokefm.co.uk

  4. #4
    Join Date
    Jun 2007
    Posts
    56
    Tokens
    0

    Default could

    I could not edit

    How do I get the code that Invent Made to say

    The Server Is offline

    when the server offline??

    is it? if($streamstatus == "0") -- Can someone edit it so it dose that??

    So to sum it up

    The code that invent did - is brill but it dosent display and offline message when the stream is offline...Can anyone do that for me?
    Visit The Worlds #1 Online Radio Station - http://www.stokefm.co.uk

  5. #5
    Join Date
    Jul 2006
    Location
    Athens
    Posts
    842
    Tokens
    0

    Default

    PHP Code:
     <? session_start();
    include(
    'config_radio.php');
    include
    'alert.php';
    $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 http-equiv="Content-Language" content="en-gb">
    <meta name="GENERATOR" content="Microsoft FrontPage 6.0">
    <meta name="ProgId" content="FrontPage.Editor.Document">
    <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
    <META HTTP-EQUIV="REFRESH" CONTENT="40;URL=last10.php">
    <link rel=stylesheet href="" type="text/css">
    <title>'
    .$scdef.'</title>
    </head>

    <body text="verdana" bgcolor="white">
    <font face="Trebuchet MS">

    <p align="center"><b>The Last Ten Songs Played on StokeFM</b></p>


    </body>

    <p align="center">
    <table border="0" style="border-collapse: collapse" width="36%" id="table1" cellspacing="6" height="48">
                                <tr>
                                    <td bgcolor="#33CCFF" style="border-style: dotted; border-width: 1px; padding-left: 4px; padding-right: 4px" bordercolor="#C0C0C0">
                                    <p style="margin-top: 0; margin-bottom: 0" align="center">


                                    <p style="margin-top: 0; margin-bottom: 0" align="center">


                                    <p style="margin-top: 0; margin-bottom: 0" align="center">


                                    <p style="margin-top: 0; margin-bottom: 0" align="center">

    <font face="Trebuchet MS"><font size="5" color="#00000">
    1.'
    .$song[1].' <br/>
    2.'
    .$song[2].'<br/>
    3.'
    .$song[3].'<br/>
    4.'
    .$song[4].'<br/>
    5.'
    .$song[5].'<br/>
    6.'
    .$song[6].'<br/>
    7.'
    .$song[7].'<br/>
    8.'
    .$song[8].'<br/>
    9.'
    .$song[9].'<br/>
    10.'
    .$song[10].'<br/>
    </html></font>'
    ;
    } else {
    // Radio Offline Message Starts Here
    echo "The Radio Is Currently Offline";
    // Radio Offline Message Ends Here
    }
    ?>


  6. #6
    Join Date
    Jun 2007
    Posts
    56
    Tokens
    0

    Default thanks

    Thankyou very much
    Visit The Worlds #1 Online Radio Station - http://www.stokefm.co.uk

Posting Permissions

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