Hi ich bitte um hilfe ich bekomm das nicht hin. Ich hab bis jetzt den Server Status, Stream Status, Listener Peak und die Song anzeige hin bekommen nur die anzeige für den Moderator der ON AIR ist bekomm ich nicht hin.
Ich bedanke mich schon mal im vorraus für die hilfe
Ich bedanke mich schon mal im vorraus für die hilfe
Code:
<?
$host = "localhost";
$port = "8000";
$fp = @fsockopen($host, $port, $errno, $errstr, 01);
if(!$fp) {
$status = "Offline";
}else{
fputs($fp,"GET /7.html HTTP/1.0\r\nUser-Agent: XML Getter (Mozilla Compatible)\r\n\r\n");
while(!feof($fp)) {
$page .= fgets($fp, 1000);
}
fclose($fp);
$page = ereg_replace(".*<body>", "", $page);
$page = ereg_replace("</body>.*", ",", $page);
$numbers = explode(",",$page);
$currentlisteners=$numbers[0];
$connected=$numbers[1];
$peaklisteners=$numbers[2];
$maxlisteners=$numbers[3];
$reportedlisteners=$numbers[4];
$bit=$numbers[5];
$song=$numbers[6];
$titel=$numbers[7];
if($connected==0) {
$status = "Nicht_Verbunden";
}else{
$status = "Online";
} }
?>
<html>
<title>nfsmw15</title>
<body bgcolor="#EEEEEE" text="#000000">
<center>
<? if($status == "Online"){
?>
<table width="514" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="104"><font face="Arial, Helvetica, sans-serif" size=2>Server Status:</font></td>
<td width="377"><font color="#339900" size=2 face="Arial, Helvetica, sans-serif">Server ist Online.</font></td>
</tr>
<tr>
<td width="104"><font face="Arial, Helvetica, sans-serif" size=2>Stream Status:</font></td>
<td width="377"><font face="Arial, Helvetica, sans-serif" size=2>Stream ist Online <? echo $bit; ?> kb/s mit <? echo $currentlisteners; ?> von <? echo $maxlisteners; ?> listeners (<? echo $reportedlisteners; ?> unique)</font></td>
</tr>
<tr>
<td width="104"><font face="Arial, Helvetica, sans-serif" size=2>Listener Peak:</font></td>
<td width="377"><font face="Arial, Helvetica, sans-serif" size=2><? echo $peaklisteners; ?></font></td>
</tr>
<tr>
<td width="104"><font face="Arial, Helvetica, sans-serif" size=2>DJ:</font></td>
<td width="377"><font face="Arial, Helvetica, sans-serif" size=2><? echo $titel; ?></font></td>
</tr>
<tr>
<td width="104"><font face="Arial, Helvetica, sans-serif" size=2>Song:</font></td>
<td width="377"><font face="Arial, Helvetica, sans-serif" size=2><? echo $song; ?></font></td>
</tr>
</table>
<? }else{
if($status == "Offline"){
?>
<table width="514" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="104"><font face="Arial, Helvetica, sans-serif" size=2>Server Status:</font></td>
<td width="377"><font color="#FF0000" size=2 face="Arial, Helvetica, sans-serif">Server ist offline.</font></td>
</tr>
<tr>
<td width="104"><font face="Arial, Helvetica, sans-serif" size=2>Stream Status:</font></td>
<td width="377"><font face="Arial, Helvetica, sans-serif" size=2>Stream ist Offline</font></td>
</tr>
<tr>
<td width="104"><font face="Arial, Helvetica, sans-serif" size=2>Listener Peak:</font></td>
<td width="377"><font face="Arial, Helvetica, sans-serif" size=2>0</font></td>
</tr>
<tr>
<td width="104"><font face="Arial, Helvetica, sans-serif" size=2>Song:</font></td>
<td width="377"><font face="Arial, Helvetica, sans-serif" size=2>None</font></td>
</tr>
</table>
<? }else{
if($status == "Nicht_Verbunden"){
?>
<table width="514" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="104"><font face="Arial, Helvetica, sans-serif" size=2>Server Status:</font></td>
<td width="377"><font color="#FF0000" size=2 face="Arial, Helvetica, sans-serif">Server ist Offline.</font></td>
</tr>
<tr>
<td width="104"><font face="Arial, Helvetica, sans-serif" size=2>Stream Status:</font></td>
<td width="377"><font face="Arial, Helvetica, sans-serif" size=2>Stream ist Offline <? echo $bit; ?> kb/s mit <? echo $currentlisteners; ?> von <? echo $maxlisteners; ?> listeners (<? echo $reportedlisteners; ?> unique)</font></td>
</tr>
<tr>
<td width="104"><font face="Arial, Helvetica, sans-serif" size=2>Listener Peak:</font></td>
<td width="377"><font face="Arial, Helvetica, sans-serif" size=2><? echo $peaklisteners; ?></font></td>
</tr>
<tr>
<td width="104"><font face="Arial, Helvetica, sans-serif" size=2>Song:</font></td>
<td width="377"><font face="Arial, Helvetica, sans-serif" size=2><? echo $song; ?></font></td>
</tr>
</table>
<? }}} ?>
</center>
</body>
</html>