cobrastyle
Mitglied
Hallo.
Ich habe ein kleines Problem.
Und zwar Code ich gerade an nem Online Radio !
Dazu gehöhrt natürlich auch ein Stream usw. und eine Streamanzeige :)
Beim Versuch die PHP Datei die den Stream Ausliest also den gerade gespielten titel habe ich ein problem die PHP Datei wird einfach nicht includiert
Warum?
Test.html
Stream.php
das stream.php scipt funktioniert aber ich bekomms nicht includiert ^^
was mache iich falsch??
URL zur Homepage Bassimpulse Startseite ... Online Radio ...Trance ,Techno ,House , Electro, Minimal
Ich habe ein kleines Problem.
Und zwar Code ich gerade an nem Online Radio !
Dazu gehöhrt natürlich auch ein Stream usw. und eine Streamanzeige :)
Beim Versuch die PHP Datei die den Stream Ausliest also den gerade gespielten titel habe ich ein problem die PHP Datei wird einfach nicht includiert
Warum?
Test.html
HTML:
<html>
<head>
<title> Der Include Befehl </title>
</head>
<body>
<? include("stream.php"); ?>
</body>
</html>
Stream.php
HTML:
<?php
// Serverdaten
$scast_host = 'test';
$scast_name = 'Bassimpulse';
$scast_port = '8008';
$scast_pass = 'test';
// Viewmodis
if ($_REQUEST['history']) {
$show_sc_songhistory = 1;
}
else {
$show_sc_songhistory = 0;
}
if ($_REQUEST['listener']) {
$show_sc_listeners = 1;
}
else {
$show_sc_listeners = 0;
}
// XML holen
if($fp = @fsockopen($scast_host, $scast_port, $errno, $errstr, 30)) {
if(fputs($fp, "GET /admin.cgi?pass=".$scast_pass."&mode=viewxml HTTP/1.0\r\nUser-Agent: XML Getter (Mozilla Compatible)\r\n\r\n")) {
$xmldata = "";
while(!feof($fp)) $xmldata .= fgets($fp, 1000);
$xmldata = explode("\r\n", $xmldata);
$xmldata = $xmldata[3];
}
}
// Regex Funktionen
function get_item($name, $source) {
preg_match('#<'.$name.'>(.*?)</'.$name.'>#', $source, $matches);
return $matches[1];
}
function get_items($name, $source) {
preg_match_all('#<'.$name.'>(.*?)</'.$name.'>#', $source, $matches);
return $matches[1];
}
// Werte aus XML auslesen
$sc_stream_status = get_item("STREAMSTATUS", $xmldata);
if($sc_stream_status) { /// Alle StreamVars
$sc_stream_bitrate = get_item("BITRATE", $xmldata);
$sc_listeners_cur = get_item("CURRENTLISTENERS", $xmldata);
$sc_listeners_peak = get_item("PEAKLISTENERS", $xmldata);
$sc_listeners_max = get_item("MAXLISTENERS", $xmldata);
$sc_server_title = get_item("SERVERTITLE", $xmldata);
$sc_server_url = get_item("SERVERURL", $xmldata);
$sc_server_genre = get_item("SERVERGENRE", $xmldata);
$sc_server_version = get_item("VERSION", $xmldata);
$sc_current_song = get_item("SONGTITLE", $xmldata);
$sc_irc = get_item("IRC", $xmldata);
$sc_icq = get_item("ICQ", $xmldata);
$sc_aim = get_item("AIM", $xmldata);
}
$sc_current_song = str_replace("&", "", $sc_current_song);
$sc_current_song = str_replace("'", "", $sc_current_song);
$sc_current_song = str_replace("\\", "", $sc_current_song);
$sc_current_song = str_replace("'", "", $sc_current_song);
$sc_current_song = str_replace("\"", "", $sc_current_song);
$sc_current_song = str_replace("$", "", $sc_current_song);
$sc_current_song = str_replace("<", "", $sc_current_song);
$sc_current_song = str_replace("ä", "", $sc_current_song);
$sc_current_song = str_replace("ü", "", $sc_current_song);
$sc_current_song = str_replace("Ü", "", $sc_current_song);
$sc_current_song = str_replace("Ä", "", $sc_current_song);
$sc_current_song = str_replace("Ö", "", $sc_current_song);
$sc_current_song = str_replace("ö", "", $sc_current_song);
if(!($sc_stream_bitrate)) {
echo "Sorry, aber Server ist offline!";
} else {
echo $sc_current_song. " = Current song";
}
?>
das stream.php scipt funktioniert aber ich bekomms nicht includiert ^^
was mache iich falsch??
URL zur Homepage Bassimpulse Startseite ... Online Radio ...Trance ,Techno ,House , Electro, Minimal