query("SELECT name FROM hlstats_Games WHERE code='$game'"); if ($db->num_rows() < 1) error("No such game '$game'."); list($gamename) = $db->fetch_row(); $db->free_result(); $minkills = 1; $minmembers = 3; $players = 10; if ((isset($_GET['players'])) && (is_numeric($_GET['players']))) $players = valid_request($_GET['players'], 1); $clans = 3; if ((isset($_GET['clans'])) && (is_numeric($_GET['clans']))) $clans = valid_request($_GET['clans'], 1); $servers = 9001; if ((isset($_GET['servers'])) && (is_numeric($_GET['servers']))) $servers = valid_request($_GET['servers'], 1); // // Top 10 Players // if($players > 0) { $table_players = new Table( array( new TableColumn( 'lastName', 'Playername', 'width=50&flag=1&link=' . urlencode('mode=statsme&player=%k') ), new TableColumn( 'skill', 'Points', 'width=10&align=right' ), new TableColumn( 'activity', 'Activity', 'width=10&sort=no&type=bargraph' ), new TableColumn( 'connection_time', 'Time', 'width=15&align=right&type=timestamp' ), new TableColumn( 'kpd', 'Kpd', 'width=10&align=right' ), ), 'playerId', 'skill', 'kpd', true, 10 ); $result_players = $db->query(" SELECT playerId, lastName, connection_time, skill, flag, country, IFNULL(kills/deaths, '-') AS kpd, IFNULL(headshots/kills, '-') AS hpk, activity FROM hlstats_Players WHERE game='$game' AND hideranking=0 AND kills >= $minkills ORDER BY $table_players->sort $table_players->sortorder LIMIT 0,$players "); $table_players->draw($result_players, 10, 100); } // // Top 3 Clans // if($clans > 0) { $table_clans = new Table( array( new TableColumn( 'name', 'Clanname', 'width=50&link=' . urlencode('mode=claninfo&clan=%k') ), new TableColumn( 'tag', 'Tag', 'width=25&align=center' ), new TableColumn( 'skill', 'Points', 'width=10&align=right' ), new TableColumn( 'nummembers', 'Members', 'width=10&align=right' ), ), 'clanId', 'skill', 'kpd', true, 3 ); $result_clans = $db->query(" SELECT hlstats_Clans.clanId, hlstats_Clans.name, hlstats_Clans.tag, COUNT(hlstats_Players.playerId) AS nummembers, ROUND(AVG(hlstats_Players.skill)) AS skill, TRUNCATE(AVG(IF(".$g_options['MinActivity']." > (UNIX_TIMESTAMP() - hlstats_Players.last_event), ((100/".$g_options['MinActivity'].") * (".$g_options['MinActivity']." - (UNIX_TIMESTAMP() - hlstats_Players.last_event))), -1)),2) as activity FROM hlstats_Clans LEFT JOIN hlstats_Players ON hlstats_Players.clan=hlstats_Clans.clanId WHERE hlstats_Clans.game='$game' AND hlstats_Clans.hidden <> 1 AND hlstats_Players.hideranking = 0 AND IF(".$g_options['MinActivity']." > (UNIX_TIMESTAMP() - hlstats_Players.last_event), ((100/".$g_options['MinActivity'].") * (".$g_options['MinActivity']." - (UNIX_TIMESTAMP() - hlstats_Players.last_event))), -1) >= 0 GROUP BY hlstats_Clans.clanId HAVING activity >= 0 AND nummembers >= $minmembers ORDER BY $table_clans->sort $table_clans->sortorder LIMIT 0,$clans "); $table_clans->draw($result_clans, 3, 100); } // // Servers // if ($servers > 0) { ?>
Participating Servers | Address | Map | Played | Players |
'.$rowdata['name'].''; ?> |