Announcement

Collapse
No announcement yet.

What did i do wrong?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • What did i do wrong?

    ok heres my code what do i have to do to get 30 songs in the history?



    <?php
    // Shoutcast Server Stats
    // Parses shoutcasts xml to make an effective stats thing for any website
    // hardcore coded by daniel brown aka xbrowniex ©www.gmtt.co.uk 2003.
    include('config_radio.php'); //you may edit this path to fit your server environment otherwise leave it alone
    $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]);



    $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>
    <TITLE>WiKKiD NeTworK</TITLE>
    </HEAD><div align="center">
    <BODY >
    <table>
    <td colspan="3"><font color="#990000">
    <b>Past Songs:</b><br><br>
    <b>&nbsp; 1.</b> '.$song[1].'<BR>
    <b>&nbsp; 2.</b> '.$song[2].'<BR>
    <b>&nbsp; 3.</b> '.$song[3].'<BR>
    <b>&nbsp; 4.</b> '.$song[4].'<BR>
    <b>&nbsp; 5.</b> '.$song[5].'<BR>
    <b>&nbsp; 6.</b> '.$song[6].'<BR>
    <b>&nbsp; 7.</b> '.$song[7].'<BR>
    <b>&nbsp; 8.</b> '.$song[8].'<BR>
    <b>&nbsp; 9.</b> '.$song[9].'<BR>
    <b>10.</b> '.$song[10].'<BR>
    <b>11.</b> '.$song[11].'<BR>
    <b>12.</b> '.$song[12].'<BR>
    <b>13.</b> '.$song[13].'<BR>
    <b>14.</b> '.$song[14].'<BR>
    <b>15.</b> '.$song[15].'<BR>
    <b>16.</b> '.$song[16].'<BR>
    <b>17.</b> '.$song[17].'<BR>
    <b>18.</b> '.$song[18].'<BR>
    <b>19.</b> '.$song[19].'<BR>
    <b>20.</b> '.$song[20].'<BR>
    <b>21.</b> '.$song[21].'<BR>
    <b>22.</b> '.$song[22].'<BR>
    <b>23.</b> '.$song[23].'<BR>
    <b>24.</b> '.$song[24].'<BR>
    <b>25.</b> '.$song[25].'<BR>
    <b>26.</b> '.$song[26].'<BR>
    <b>27.</b> '.$song[27].'<BR>
    <b>28.</b> '.$song[28].'<BR>
    <b>29.</b> '.$song[29].'<BR>
    <b>30.</b> '.$song[30].'<BR></font></td>
    </tr>
    </table
    </body>
    </html>';
    }
    ?>

  • #2
    The DNAS supports up to 20 songs in the history list.

    Check out the DNASs sc_serv.ini/conf configuration file for the section (default shown below):
    code:
    ; ShowLastSongs specifies how many songs to list in the /played.html
    ; page. The default is 10. Acceptable entries are 1 to 20.
    ShowLastSongs=10

    Comment

    Working...
    X