<?php
$config['server']['ip'] = 'serv.ru-minecraft.ru';
$config['server']['port'] = '25566';
$admins = array("south_park", "p0is0n", "Dj_Krauts");
$moderators = array("джигурда", "чак норис", "Яо Минг");
?>
<?php
include('core/init.inc.php');
$info = fetch_server_info($config['server']['ip'], $config['server']['port']);
?>
<? echo base64_decode('PGRpdiBzdHlsZT0iZGlzcGxheTpub25lOyI+PGEgaHJlZj0iaHR0cDovL3J1LW1pbmVjcmFmdC5ydS8iPk1pbmVjcmFmdDwvYT4o0LrRgtC+INGD0LTQsNC70LjRgiDRgtC+0YIg0LvQvtC7KTwvZGl2Pg==') ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1251" />
<html xmlms="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset-utf-8" />
<title><?php echo $config['server']['ip']; ?> Status</title>
</head>
<body>
<div>
<h3>IP:<?php echo $config['server']['ip']; ?></h3>
<?php
if ($info === false){
?>
<p><font color = "#0A6E0B">Статус:</font> Offline</p>
<?php
}else{
?>
<p><font color = "#0A6E0B">Статус:</font> Online</p>
<p><font color = "#0A6E0B">Слоты: </font><?php echo $info['playerCount']; ?> / <?php echo $info['maxPlayers']; ?></p>
<?php
reset($moderators);
while (list ($rr, $val) = each ($moderators) ) :
$key = array_search($val, $info['playerList']);
if ($key > 0)
{
$str = "<font color = '#0A6E0B'>";
$str .= $info['playerList'][$key];
$str .= "</font>";
unset($info['playerList'][$key]);
array_unshift($info['playerList'], $str );
}
endwhile;
reset($admins);
while (list ($rr, $val) = each ($admins) ) :
$key = array_search($val, $info['playerList']);
if ($key > 0)
{
$str = "<font color = '#C00'>";
$str .= $info['playerList'][$key];
$str .= "</font>";
unset($info['playerList'][$key]);
array_unshift($info['playerList'], $str );
}
endwhile;
}
?>
<p><font color = "#0A6E0B">Игроки: </font><?php echo implode(', ', $info['playerList']); ?></p>
</div>
</body>
</html>
<p><font color = "#0A6E0B">Игроки: </font><?php echo implode(', ', $info['playerList']); ?></p>