Radiosatus

    Diese Seite verwendet Cookies. Durch die Nutzung unserer Seite erklären Sie sich damit einverstanden, dass wir Cookies setzen. Weitere Informationen

      Ist einfacher als man glaub hier mal bisschen Code für dich :)

      erst mal eine anzeige.php

      PHP-Quellcode

      1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
      2. <html>
      3. <head>
      4. <link rel="stylesheet" href="style.css" type="text/css">
      5. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
      6. <meta http-equiv="refresh" content="60; URL=http://URL ZUR DER DATEI!!!!/anzeige.php">
      7. <title>Jetzt on Air</title>
      8. <style type="text/css">
      9. <!--
      10. body {
      11. margin-left: 0px;
      12. margin-top: 0px;
      13. margin-right: 0px;
      14. margin-bottom: 0px;
      15. }
      16. .Stil5 {
      17. font-family: Verdana, Helvetica, sans-serif;
      18. font-weight: bold;
      19. color: #FF7F00;
      20. }
      21. -->
      22. </style></head>
      23. <body>
      24. <?php
      25. include "getdatafromstream.php";
      26. ?>
      27. <div align="center"><table width="120" border="0" cellspacing="0">
      28. <tr>
      29. <td><div align="center" class="row2">
      30. <?php
      31. if($streamstatus<>'0') {
      32. echo "<img src='URL ZU DEN MODERATOREN BILDERN/$aim.gif' width='100' height='100' alt='' border='0'>";
      33. }
      34. else {
      35. echo "<img src='URL ZU DEM BILD WAS ANGEZEIGT WERDEN SOLL WENN KEINER SENDET!!/BILDER NAME.gif' alt='' border='0'>";
      36. }
      37. ?></div></td>
      38. <tr>
      39. <td><div align="center" class="smalltext">
      40. <?php
      41. if($streamstatus<>'0') {
      42. echo "<font color=\"#000000\"><b><u> $aim </u></b></font>";
      43. }
      44. else {
      45. echo "<font color=\"#FF0000\"><b>..:: offline ::..</b></font>";
      46. }
      47. ?></div></td>
      48. </tr>
      49. <tr>
      50. <td><div align="center" class="smalltext">
      51. <?php
      52. if($streamstatus<>'0') {
      53. echo "<marquee scrollamount='2' scrolldelay='2' onmouseover='this.stop()' onmouseout='this.start()'>";
      54. echo "<font color=\"#0000FF\">Du h&ouml;rst aktuell:&nbsp;<b>$song[0]</b>&nbsp;&nbsp;</font><font color=\"#000000\">***</font><font color=\"#0000FF\">&nbsp;&nbsp;davor lief:&nbsp;<b>$song[1]</b>&nbsp;&nbsp;</font><font color=\"#000000\">***</font><font color=\"#0000FF\">&nbsp;&nbsp;und der vorletzte Titel war:&nbsp;<b>$song[2]</b></font></marquee>";
      55. }
      56. else {
      57. echo "<marquee scrollamount='2' scrolldelay='2' onmouseover='this.stop()' onmouseout='this.start()'>";
      58. echo "<font color=\"#FF0000\">Aus technischen Gr&uuml;nden ist unser Stream zur Zeit offline. Wir arbeiten mit Hochdruck daran, so schnell wie m&ouml;glich wieder f&uuml;r Euch da zu sein. Vielen Dank f&uuml;r Euer Verst&auml;ndnis</font></marquee>";
      59. }
      60. ?></div></td>
      61. </tr>
      62. </table></div>
      63. </body>
      64. </html>


      nun kümmern wir uns um die Datei getdatafromstream.php

      PHP-Quellcode

      1. <?php
      2. include "config.php";
      3. ?>
      4. <?php
      5. $timestamp = time();
      6. $datum = date("d.m.Y",$timestamp);
      7. $uhrzeit = date("H:i",$timestamp);
      8. $scfp = fsockopen("$scip", $scport, &$errno, &$errstr, 30);
      9. if(!$scfp) {
      10. $scsuccs=1;
      11. echo''.$scdef.' is Offline';
      12. }
      13. if($scsuccs!=1){
      14. fputs($scfp,"GET /admin.cgi?pass=$scpass&mode=viewxml HTTP/1.0\r\nUser-Agent: SHOUTcast Song Status (Mozilla Compatible)\r\n\r\n");
      15. while(!feof($scfp)) {
      16. $page .= fgets($scfp, 1000);
      17. }
      18. ######################################################################################################################
      19. /////////////////////////part 1 \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
      20. //define xml elements
      21. $loop = array("STREAMSTATUS", "CURRENTLISTENERS", "PEAKLISTENERS", "AVERAGETIME", "SERVERGENRE", "SERVERTITLE","ICQ","BITRATE","AIM");
      22. $y=0;
      23. while($loop[$y]!=''){
      24. $pageed = ereg_replace(".*<$loop[$y]>", "", $page);
      25. $scphp = strtolower($loop[$y]);
      26. $$scphp = ereg_replace("</$loop[$y]>.*", "", $pageed);
      27. if($loop[$y]==SERVERGENRE || $loop[$y]==SERVERTITLE || $loop[$y]==SONGTITLE || $loop[$y]==SERVERTITLE || $loop[$y]==AIM)
      28. $$scphp = urldecode($$scphp);
      29. // uncomment the next line to see all variables
      30. //echo'$'.$scphp.' = '.$$scphp.'<br>';
      31. $y++;
      32. }
      33. //end intro xml elements
      34. ######################################################################################################################
      35. ######################################################################################################################
      36. /////////////////////////part 2\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
      37. //get song info and history
      38. $pageed = ereg_replace(".*<SONGHISTORY>", "", $page);
      39. $pageed = ereg_replace("<SONGHISTORY>.*", "", $pageed);
      40. $songatime = explode("<SONG>", $pageed);
      41. $r=1;
      42. while($songatime[$r]!=""){
      43. $t=$r-1;
      44. $playedat[$t] = ereg_replace(".*<PLAYEDAT>", "", $songatime[$r]);
      45. $playedat[$t] = ereg_replace("</PLAYEDAT>.*", "", $playedat[$t]);
      46. $song[$t] = ereg_replace(".*<TITLE>", "", $songatime[$r]);
      47. $song[$t] = ereg_replace("</TITLE>.*", "", $song[$t]);
      48. $song[$t] = urldecode($song[$t]);
      49. $dj[$t] = ereg_replace(".*<AIM>", "", $page);
      50. $dj[$t] = ereg_replace("</AIM>.*", "", $pageed);
      51. $r++;
      52. }
      53. //end song info
      54. fclose($scfp);
      55. }
      56. ?>


      Nun die config.php

      PHP-Quellcode

      1. <?php
      2. // Name des Radios
      3. $scdef = "XXX";
      4. // IP des Servers
      5. $scip = "XXX";
      6. // Port des Servers
      7. $scport = "XXX";
      8. // Passwort des Servers
      9. $scpass = "XXX";
      10. ?>


      So das sind erst mal die Daten die man braucht, nun kommen wir zum einbau und erleuterung.

      anzeige.php

      Quellcode

      1. if($streamstatus<>'0') {
      2. echo "<img src='URL ZU DEN MODERATOREN BILDERN/$aim.gif' width='100' height='100' alt='' border='0'>";
      3. }
      4. else {
      5. echo "<img src='URL ZU DEM BILD WAS ANGEZEIGT WERDEN SOLL WENN KEINER SENDET!!/BILDER NAME.gif' alt='' border='0'>";
      6. }


      bei echo "<img src='URL ZU DEN MODERATOREN BILDERN/$aim.gif' width='100' height='100' alt='' border='0'>";

      ist klar link anpassen ALLE BILDER der moderatoren müssen gif sein wenn du allerings png oder jpg oder was du auch nehmen möchtest must du das hier ändern: $aim.gif
      das .gif in das format was du willst, genau so wie die andere spalte.

      config.php

      dort must du die daten des shoucast server reinpacken.

      wenn du das ganze nun z.b. in der user.html im Chat einbaun willst dann hau dort wo es sein soll diesen code rein...

      Quellcode

      1. <table border="0" width="100%" cellspacing="0" cellpadding="0"><tr><td>
      2. <table border="0" width="100%" cellspacing="1" cellpadding="0">
      3. <tr class="row2"><td><table cellspacing="3" width="100%">
      4. <tr>
      5. <th>Radiostream-Infos</th>
      6. </tr>
      7. </table>
      8. <center>
      9. <a href="http://DEINE STREAM URL:PORT/listen.pls"><img src="URL ZU EINER GRAFI DIE Z.B WIE WINAMPF ODER SO AUSSEHT" border="0" alt="Winamp"></a>&nbsp;
      10. <iframe allowtransparency="true" src="http://www.DEINE-URL.de/anzeige.php" height="150" width="110" frameborder="0" scrolling="no"></iframe>&nbsp;
      11. <a href="URL ZU EINER/dsl.asx"><img src="URL ZU EINER GRAFIK DIE DEM MEDIA PLAYER ÄNLICH SEHT" border="0" alt="Mediaplayer"></a>
      12. <br>
      13. </center>
      14. </td></tr></table>



      Als letztes noch öffne dein editor und füge dort ein:

      Quellcode

      1. http://DEINE-STREAMURL:PORT

      ist klar das du deine Daten da rein packen sollst,

      Diese Datei speicherst du als .asx ab.

      Und tataaaaaa du hast deine Onair anzeige im Chat.

      Natürlich kannst du auch was ganz anderes damit machen bzw. es anders gestallten oder so die ideen einfach freien lauf lassen.


      Lg. xXNeoXx
      Hosting-Panter.eu - Home
      Antiref.net


      if ($ahnung == 'keine' ) { use ( FAQ ) && ( Google | | Suche ) }
      if ($antwort == 0 ) { post ( Frage ) }