short_name] = $row->fid;
}
$flags["--"] = 4;
// nastaveni aktivni BF3 DB
db_set_active('bf3db');
$res = db_query("SELECT tbl_playerdata.CountryCode, tbl_playerdata.SoldierName as Nick, SUM(tbl_playerstats.Score) as PlayerScore
FROM tbl_playerstats,tbl_server_player,tbl_playerdata
WHERE tbl_playerstats.StatsID = tbl_server_player.StatsID and tbl_server_player.PlayerID = tbl_playerdata.PlayerID
GROUP BY Nick
ORDER BY PlayerScore DESC
LIMIT 100");
// vraceni aktivni PZ DB
db_set_active('default');
$i = 1;
while($row = db_fetch_object($res)) {
$uid = db_result(db_query("SELECT uid FROM {games_gameid} WHERE gid = %d AND LOWER(gameid) = LOWER('%s')", 1586, $row->Nick));
$trows[] = array(
array("data" => ($i++) . ".", "class" => "w_15p"),
theme('flag', $flags[$row->CountryCode]) . ' ' . ($uid ? l($row->Nick, 'user/'.$uid) : check_plain($row->Nick)),
array("data" => $row->PlayerScore, "class" => "w_25p"),
);
}
$thead = array("Pozice", "Nick", "Body");
print theme('table', $thead, $trows);
?>