PHP Code:
<img style="margin-top:15px;" id="loading" src="./img/loading.gif"/>
<div class="online-status" style="font-size:12px;">
<div id="status_pos">
<?php
$ip = gethostbyname($serverSettings['25.136.93.190']);
$portlist=array(3306,11002,13001,13002); // Ports
$status=array("Mysql Server:", "Login Server:", "Channel1:", "Channel2:"); // Bezeichnung
$i=0;
foreach ($portlist as $port){
$online = @fsockopen($ip, $port, $errno, $errstr, 1);
if ($online)
{
echo '<div id="status_bar">';
echo '<tr>'.$status[$i].'
<font color="#04bc00">Online</font>
';
echo '</div>';
}
else
{
echo '<div id="status_bar">';
echo '<tr>'.$status[$i].'
<font color="#cf0000">Offline</font>
';
echo '</div>';
}
@fclose($online);
$i++;
}
?>
<div id="status_bar">
<?php
$result1 = mysql_fetch_assoc(mysql_query("SELECT COUNT(id) AS count FROM player.player WHERE DATE_SUB(NOW(), INTERVAL 5 MINUTE) < last_play"));
echo 'Spieler Online: <font color="#749db7">'.$result1['count'].' </font>';
?>
</div>
</div>
</div>