Код:
<?
include("config.php");
mssql_connect($mssql_server,$mssql_user,$mssql_pas s);
mssql_select_db($mssql_db);
$result=mssql_query("
select
char_name, Lev, builder,
class, use_time,
PK, Duel,gender
from user_data
where char_name not in (".("'".join("','",$exclude_from_top)."'").") and account_id>0 and login>logout
order by Lev desc");
$online_users=array();
for($x=0;$online_users[$x]=mssql_fetch_assoc($result);$x++){
$online_users[$x]['use_time_h']=round($online_users[$x]['use_time']/3600,1)."h";
};
unset($online_users[count($online_users)-1]);
$result=mssql_query("SELECT count(*) FROM [user_data]");
list($heroes)=mssql_fetch_array($result);
mssql_select_db("lin2db");
$result=mssql_query("SELECT count(*) FROM [user_account]");
list($accounts)=mssql_fetch_array($result);
?>
<table border="1" align=center size=5>
<tr>
<td colspan="5"><H5>Сейчас играют в Lineage 2:</H5></td>
</tr>
<tr>
<td>Ник</td>
<td>Уровень</td>
<td>Класс</td>
<td>Всего в игре</td>
<td>PvP/PK</td>
</tr>
<?for($x=0;$x<count($online_users);$x++){?>
<tr>
<td style="color:<?=$online_users[$x]["gender"]?"#FF8080":"#8080FF"?>"><?=$online_users[$x]["char_name"]?></td>
<td><?=$online_users[$x]["Lev"]?></td>
<td><?=$class_list[$online_users[$x]["class"]]?></td>
<td><?=$online_users[$x]["use_time_h"]?></td>
<td><?=$online_users[$x]["Duel"]?>/<?=$online_users[$x]["PK"]?></td>
</tr>
<?}?>
<tr>
<td colspan="3"><H5>Игроков Online:</H5></td>
<td><H5><?=count($online_users)?></H5></td>
</tr>
<tr>
<tr>
<td></td>
</tr><tr>
<td></td>
</tr>
<td colspan="5"><H5>На сервере зарегистрировано</H5></td>
</tr>
<tr>
<td colspan="3">Всего Аккаунтов:</td>
<td><?=$accounts?></td>
</tr>
<tr>
<td colspan="3">Всего Героев:</td>
<td><?=$heroes?></td>
</tr>
</table>