query(" SELECT playerId FROM hlstats_PlayerUniqueIds WHERE uniqueId='$uniqueid' AND game='$game' "); if ($db->num_rows() > 1) { header('Location: ' . $g_options['scripturl'] . "&mode=search&st=uniqueid&q=$uniqueid&game=$game"); exit; } elseif ($db->num_rows() < 1) { error("No players found matching uniqueId '$uniqueid'"); } else { list($player) = $db->fetch_row(); $player = intval($player); } } elseif (!$player && !$uniqueid) { error('No player ID specified.'); } $db->query(" SELECT hlstats_Players.playerId, hlstats_Players.connection_time, hlstats_Players.lastName, hlstats_Players.country, hlstats_Players.flag, hlstats_Players.clan, hlstats_Players.fullName, hlstats_Players.email, hlstats_Players.homepage, hlstats_Players.icq, hlstats_Players.game, hlstats_Players.skill, hlstats_Players.kills, hlstats_Players.deaths, IFNULL(kills/deaths, '-') AS kpd, hlstats_Players.suicides, hlstats_Players.headshots, IFNULL(headshots/kills, '-') AS hpk, hlstats_Players.shots, hlstats_Players.hits, hlstats_Players.teamkills, hlstats_Players.kill_streak, hlstats_Players.death_streak, IFNULL(ROUND((hits / shots * 100), 1), 0.0) AS acc, hlstats_Clans.name AS clan_name, activity FROM hlstats_Players LEFT JOIN hlstats_Clans ON hlstats_Clans.clanId = hlstats_Players.clan WHERE playerId='$player' "); if ($db->num_rows() != 1) error("No such player '$player'."); $playerdata = $db->fetch_array(); $db->free_result(); $pl_name = $playerdata['lastName']; if (strlen($pl_name) > 10) { $pl_shortname = substr($pl_name, 0, 8) . '...'; } else { $pl_shortname = $pl_name; } $pl_name = htmlspecialchars($pl_name, ENT_COMPAT); $pl_shortname = htmlspecialchars($pl_shortname, ENT_COMPAT); $pl_urlname = urlencode($playerdata['lastName']); $game = $playerdata['game']; $db->query("SELECT name FROM hlstats_Games WHERE code='$game'"); if ($db->num_rows() != 1) $gamename = ucfirst($game); else list($gamename) = $db->fetch_row(); ?>
Statistics Summary | ||
Name: | '; echo '' . htmlspecialchars($playerdata['lastName'], ENT_COMPAT) . ''; ?> | |
Member of Clan: | ' . htmlspecialchars($playerdata['clan_name'], ENT_COMPAT) . ''; } else echo '(None)'; ?> | |
Rank: | 0) { $rank = get_player_rank($playerdata); } else { $rank = 'Not active'; } if (is_numeric($rank)) echo '' . number_format($rank) . ''; else echo "$rank"; ?> | |
Points: | ' . number_format($playerdata['skill']) . ''; ?> | |
Activity:* | 40) $bar_type = '6'; elseif ($playerdata['activity'] > 30) $bar_type = '5'; elseif ($playerdata['activity'] > 20) $bar_type = '4'; elseif ($playerdata['activity'] > 10) $bar_type = '3'; elseif ($playerdata['activity'] > 5) $bar_type = '2'; echo ''; ?> | |
Kills: | query(" SELECT COUNT(*) FROM hlstats_Events_Frags LEFT JOIN hlstats_Servers ON hlstats_Servers.serverId=hlstats_Events_Frags.serverId WHERE hlstats_Servers.game='$game' AND killerId='$player' "); list($realkills) = $db->fetch_row(); echo ' ('.number_format($realkills).')'; ?> | |
Deaths: | ||
Suicides: | ||
Kills per Death: | query(" SELECT IFNULL(SUM(killerId='$player')/SUM(victimId='$player'), '-') AS kpd FROM hlstats_Events_Frags, hlstats_Servers WHERE hlstats_Servers.serverId=hlstats_Events_Frags.serverId AND (hlstats_Events_Frags.killerId='$player' OR hlstats_Events_Frags.victimId='$player') AND hlstats_Servers.game='$game' "); list($realkpd) = $db->fetch_row(); echo $playerdata['kpd']; echo " ($realkpd)"; ?> | |
Headshots: | query(" SELECT COUNT(*) FROM hlstats_Events_Frags LEFT JOIN hlstats_Servers ON hlstats_Servers.serverId=hlstats_Events_Frags.serverId WHERE hlstats_Servers.game='$game' AND killerId='$player' AND headshot=1 "); list($realheadshots) = $db->fetch_row(); if ($playerdata['headshots'] == 0) echo number_format($realheadshots); else echo number_format($playerdata['headshots']); echo ' ('.number_format($realheadshots).')'; ?> | |
Headshots per Kill: | query(" SELECT IFNULL(SUM(headshot=1)/COUNT(*), '-') AS hpk FROM hlstats_Events_Frags LEFT JOIN hlstats_Servers ON hlstats_Servers.serverId=hlstats_Events_Frags.serverId WHERE hlstats_Servers.game='$game' AND killerId='$player' "); list($realhpk) = $db->fetch_row(); echo $playerdata['hpk']; echo " ($realhpk)"; ?> | |
Weapon Accuracy: | query(" SELECT IFNULL(ROUND((SUM(hlstats_Events_Statsme.hits) / SUM(hlstats_Events_Statsme.shots) * 100), 1), 0.0) AS accuracy, SUM(hlstats_Events_Statsme.shots) as shots, SUM(hlstats_Events_Statsme.hits) as hits FROM hlstats_Events_Statsme LEFT JOIN hlstats_Servers ON hlstats_Servers.serverId=hlstats_Events_Statsme.serverId WHERE hlstats_Servers.game='$game' AND playerId='$player' "); list($playerdata['accuracy'], $sm_shots, $sm_hits) = $db->fetch_row(); echo $playerdata['acc'] . '%'; echo ' ('.$playerdata['accuracy'] . '%)'; ?> | |
Teammate Kills: | query(" SELECT COUNT(*) FROM hlstats_Events_Teamkills LEFT JOIN hlstats_Servers ON hlstats_Servers.serverId=hlstats_Events_Teamkills.serverId WHERE hlstats_Servers.game='$game' AND killerId='$player' "); list($realteamkills) = $db->fetch_row(); echo ' ('.number_format($realteamkills).')'; ?> | |
Longest Kill Streak: | ||
Longest Death Streak: | ||
Total Connection Time: |