Psychognom
Grünschnabel
Habe hier eine php, die mir einige Dinge anzeigt von meinem Shoutcast-Server.
habe dennoch ein Prob.
Möchte gerne noch den DJ(Stream Title), Genre, Stream URl und Stream ICQ angezeigt haben.
wer kann mir da helfen.
habe dennoch ein Prob.
Möchte gerne noch den DJ(Stream Title), Genre, Stream URl und Stream ICQ angezeigt haben.
wer kann mir da helfen.
Code:
<?php
/////////////////////////////////////////shoutcast song status\\\\\\\\\\\\\\\\\\\
// Author: dstjohn (Mediacast1/Casterclub)
// Date started: 05-03-2002 (10:00A.M)
// Date Ended: 05-03-2002 (6:03 P.M)
// Requirements:
// 1.SHOUTcast streaming server
// 2.Oddcast dsp with winamp/xmms (recomended setup)
// 3.Webserver with php 4.x (Recommended environment: Unix (Freebsd, Red Hat etc.. with Apache 3.x)
// Support: None, post in the casterclub forums
// Core script Information:
// SHOUTcast Song Status was written and developed on Windows Xp with apache and php4.1.2
// Has not been tested on IIs webservers, if you do so and get it to work please let us know
// At the forums (http://casterclub.com/forums)
// Also has been tested on freebsd with apache, php4.1.2 and works fine.
//////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////open connection\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
//connect to shoutcast server
include('config.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");
$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)
$$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>
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta content="10" http-equiv="refresh">
<center><title>'.$scdef.'</title>
</head>
<body text="#FFFFFF" bgcolor="#000000">
<p style="margin-top: 0; margin-bottom: 0">
<font face="Arial" size="2">
Status: <img src="/images/silverstar/user_online.gif"><br>
Winamp-Direktlink: <a href="http://mmtn.info:8200/listen.pls" title="Psycho-Radio">
<img src="/images/winamp.gif" border="0"></a>
<p style="margin-top: 0; margin-bottom: 0">
<font face="Verdana" size="2" color="#FFFFFF">
Current Song: '.$song[0].'</font></p>
Stream Bitrate: '.$bitrate.' kbps</font></p>
<p style="margin-top: 0; margin-bottom: 0">
<font face="Verdana" size="2" color="#FFFFFF">
Past Songs:</font></p>
<p style="margin-top: 0; margin-bottom: 0"><font color="#FFFFFF"><font face="Verdana" size="2">
1. '.$song[1].'<BR>
2. '.$song[2].'<BR>
3. '.$song[3].'<BR>
4. '.$song[4].'<BR>
5. '.$song[5].'<BR></font><BR>
</center></body>
</html>';
}
else
echo'<html><meta content="10" http-equiv="refresh"> <body><p><font face="Verdana" size="1" color="#000000"><center>Status: <img src="/images/silverstar/user_offline.gif"><br>
Zur Zeit wird nicht gesendet.<br><br>Nächste Sendetermine entnehmen Sie bitte dem Sendeplan!</center></body></html>';
?>