Einfach im Ordner Sendeplan eine neue Datei namens sendeplan.php anlegen. Im Editor öffnen und folgenden code eingeben:
PHP
- //entweder für einen laut.fm Stream diesen code eingeben:
- <?php
- $station = ""; //dein laut.fm Stationname
- $json_station = file_get_contents("http://api.laut.fm/station/".$station);
- $obj_station = json_decode($json_station);
- $json_song = file_get_contents("http://api.laut.fm/station/".$station."/current_song");
- $obj_song = json_decode($json_song);
- echo "<marquee width='300' scrollamount='5'><font color='#000000'><b>" . $obj_song->artist->name . " - " . $obj_song->title . "</b></font></marquee>";
- ?>
- //oder für einen SHOUTcast Stream diesen code eingeben:
- <?php
- $ip = ""; // IP oder URL ohne http://
- $port = ""; // Port
- $sid = "1"; // StreamID, Standard = 1
- $shoutcast = simplexml_load_file("http://".$ip.":".$port."/stats?sid=".$sid);
- $shoutcast_song = $shoutcast->SONGTITLE;
- echo "<marquee width='300' scrollamount='5'><font color='#000000'><b>$shoutcast_song</b></font></marquee>";
- ?>
- <?php
- include "index.php";
- ?>
Nun an Stelle der index.php, die neue sendeplan.php als Standardseite in der HP einbinden: