So nu hab ich das ohne fehler hin bekommen nu bin ich aber zu vertrotelt das ich den punkt finde wo ich die stream daten einbinde
gebs langsam auf.
Ich poste mal das komplete teil hier
vileicht weis einer von euch rad da es den herrausgeber nicht mehr gibt leider.
Das die index.php
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="refresh" content="60; URL=/scripts/current_title.php">
<style type="text/css">
<!--
body
{
FONT-SIZE: 10px;
FONT-FAMILY: Tahoma,Helvetica;
COLOR: #cc0000;
background-image:url(/images/back2.jpg);
}
-->
</style>
</head>
<body>
<?php
include ("query.php");
$statusbild = "";
$songinfo = "";
if ($streamdata["stream"]["status"] == "1")
{
$statusbild = "/images/onair.gif";
$songinfo = $streamdata["stream"]["song"];
}
else
{
$statusbild = "/images/offline.gif";
$songinfo = 'Ruhe';
}
?>
<div align="right" style="margin:3px;"><img width="40" height="50" src="<?php echo $statusbild; ?>"></div>
<div style="margin:3px;">
<strong>Jetzt auf Radio xx: </strong><br>
<?php echo $songinfo; ?>
</div>
</body>
</html>
quer.php
<?php
/** ShoutCast Query v2.0.1
*
* coded by rIppA - rippa@game4ever.de
* created: 22.01.2004
* modified: 02.02.2009
*
* Simple shoutcast server query
LICENSE:
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*
*/
/**
*
* HOW TO USE
*
$sc_server = "http://server2.blitz-stream.de:26640/"; // shoutcast server & port
$stream = Shoutcast::getStreamInfo($sc_server); // returns an array
# print_r($stream);
*
*
*/
//******************************************************************************
//*** do not edit below ********************************************************
//******************************************************************************
class Shoutcast {
function getStreamInfo ($src) {
if (empty($src)) {
self::Error("S101", "no streamserver entered!");
}
if (substr($src, -1, 1) != "/") {
$src .= "/";
}
return self::query($src);
}
function query ($url) {
$url_data = parse_url($url);
$host = $url_data["host"];
$port = $url_data["port"];
$page = $url_data["path"];
$page = "/";
$info["server"] = "http://".$host.":".$port."/";
if ($fp = @fsockopen ($host, $port, $errno, $errstr, 4)) {
fputs ($fp, "GET $page HTTP/1.0\r\nHost: Webabfrage\r\nUser-Agent: Mozilla\r\n\r\n");
while (!feof($fp)) {
$buffer .= fgets ($fp, 1024);
if (strlen($buffer) >= 7000) {
break;
}
}
fclose ($fp);
if (preg_match('/Server is currently down/is',$buffer)) {
$info["status"] = 0;
return $info;
}
preg_match('/<b>Stream is up at (.+?) kbps with <B>(.+?) of (.+?) listeners \((.+?) unique\)<\/b>/is',$buffer,$matches);
$info["bitrate"] = $matches[1];
$info["listener"] = $matches[2];
$info["listener_max"] = $matches[3];
$info["listener_unique"] = $matches[4];
preg_match('/Peak: <\/font><\/td><td><font class=default><b>(.+?)<\/b>/is',$buffer,$matches);
$info["peak"] = $matches[1];
preg_match('/Current Song: <\/font><\/td><td><font class=default><b>(.+?)<\/b>/is',$buffer,$matches);
$info["song"] = $matches[1];
if (preg_match('/<\/b>/is', $info["song"])) {
$info["song"] = "";
}
preg_match('/Stream Title: <\/font><\/td><td><font class=default><b>(.+?)<\/b>/is',$buffer,$matches);
$info["title"] = $matches[1];
preg_match('/Stream Genre: <\/font><\/td><td><font class=default><b>(.+?)<\/b>/is',$buffer,$matches);
$info["genre"] = $matches[1];
preg_match('/Stream URL: <\/font><\/td><td><font class=default><b><a href="(.+?)">(.+?)<\/a><\/b>/is',$buffer,$matches);
$info["url"] = $matches[1];
if (preg_match('/<\/b>/is', $info["url"])) {
$info["url"] = "";
}
preg_match('/Stream IRC: <\/font><\/td><td><font class=default><b><a href="(.+?)">(.+?)<\/a><\/b>/is',$buffer,$matches);
$info["irc"] = $matches[2];
if (preg_match('/<\/b>/is', $info["irc"])) {
$info["irc"] = "";
}
unset($buffer, $matches);
$info["status"] = 1;
return $info;
} else {
$info["status"] = 0;
return $info;
}
}
function Error($code, $msg='') {
echo "[error_code] = ".$code."<br />\n";
if (!empty($msg)) {
echo "[error_message] = ".$msg."<br />\n";
}
exit();
}
}
?>
foto.php
<?php
include "./html_tags-.php";
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="refresh" content="60; URL=http://www.xxxx/scripts/foto.php">
<style type="text/css">
<!--
body
{
FONT-SIZE: 10px;
FONT-FAMILY: Tahoma,Helvetica;
COLOR: #cc0000;
background-image:url(/images/back2.jpg);
}
-->
</style>
</head>
<div style="margin:3px;">
<strong>Jetzt auf Radio xx: </strong><br>
<body <?php echo "$BODY"; ?> >
<table >
<?php
echo "<td $TD>";
include "./query.php";
include "./variablen.php";
echo " <img src=\"$P\" $PIC >";
echo "<br><font $FONT ><b> $N <b></font>";
?>
</td>
</table>
</body>
</html>
variablen.php
<?php
#Dies ist ein dokument für die Variablen
#Einfach in den bereich $P1="." den pfad des bildes angeben (Zum beispiel $P1="./img/bild1.jpg"
#Die nummer nach dem P bestimmt den Pfad des fotos für den Dj mit der nummer nach dem P
#Der name nach dem N bestimmt den DJ-Namen der angezeigt werden sol!
#Einfach in den bereich $N1="." den Namen des DJ's angeben (Zum beispiel $N1="La Dj Chaos"
#Alle ausdrücke mit ' dafor werden vom Programm nich wahrgenommen und dienen als Kommentar
if ($IRC == 1 ){
$P="http://www.xxx.jpg";
$N="xxx" ;
}
if ($IRC == 2 ){
$P="http://www.xxx_klein.JPG";
$N="Daisy";
}
if ($IRC == 3 ){
$P="http://www.xxx.jpg";
$N="xxx";
}
if ($IRC == 4 ){
$P="http://www.xxx.jpg";
$N="xxx";
}
if ($IRC == 5 ){
$P="http://www.xxx.JPG";
$N="xxx";
}
if ($IRC == 6 ){
$P="http://www.xxx.jpg";
$N="xxx";
}
if ($IRC == 7 ){
$P="http://www.xxx.jpg";
$N="xxx";
}
if ($IRC == 8 ){
$P="http://www.xxx.jpg";
$N="xxx
}
if ($IRC == 9 ){
$P="http://www.xxx.jpg";
$N="xxx";
}
if ($IRC == 10){
$P="http://www.xxx.JPG";
$N="xxx";
}
if ($IRC == 11){
$P="http://www.xxx.jpg";
$N="xxx";
}
if ($IRC == 12){
$P="http://www.xxxjpg";
$N="xxx";
}
if ($IRC == 13){
$P="http://www.xxx.jpg";
$N="xxx";
}
if ($IRC == 14){
$P="http://www.xxxx.jpg";
$N="*xxx*";
}
if ($IRC == 15){
$P="http://www.xxxx.jpg";
$N="xxx";
}
if ($IRC == 16){
$P="http://www.xxx.jpg";
$N=" xxx";
}
if ($IRC == 17){
$P="http://www.xxx.jpg";
$N="xxx";
}
if ($IRC == 1 {
$P=".";
$N="La Dj 18";
}
if ($IRC == 19){
$P="http://xxx.jpg";
$N="xxx";
}
if ($IRC == 20){
$P="http://www.xxx";
$N="Stream";
}
if ( $SERVER == 0){
$P="http://xxx";
$N="xxx";
}
?>