query (" SELECT hlstats_PlayerUniqueIds.playerId FROM hlstats_PlayerUniqueIds WHERE hlstats_PlayerUniqueIds.uniqueId = '$uniqueid' "); 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, unhex(replace(hex(hlstats_Players.lastName), 'E280AE', '')) as lastName, hlstats_Players.country, hlstats_Players.city, hlstats_Players.flag, hlstats_Players.clan, hlstats_Players.fullName, hlstats_Players.email, hlstats_Players.homepage, hlstats_Players.icq, hlstats_Players.game, hlstats_Players.hideranking, hlstats_Players.blockavatar, 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, IFNULL(ROUND((hits / shots * 100), 1), 0) AS acc, CONCAT(hlstats_Clans.name) AS clan_name, activity FROM hlstats_Players LEFT JOIN hlstats_Clans ON hlstats_Clans.clanId = hlstats_Players.clan WHERE hlstats_Players.playerId = '$player' LIMIT 1 "); 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 hlstats_Games.name FROM hlstats_Games WHERE hlstats_Games.code = '$game' "); if ($db->num_rows() != 1) { $gamename = ucfirst($game); } else { list($gamename) = $db->fetch_row(); } $hideranking = $playerdata['hideranking']; if( $hideranking == 2 ) { $statusmsg = 'Banned'; } else { $statusmsg = 'In good standing'; } // Required on a few pages, just decided to add it here // May get moved in the future $db->query (" SELECT COUNT(hlstats_Events_Frags.killerId) FROM hlstats_Events_Frags WHERE hlstats_Events_Frags.killerId = '$player' AND hlstats_Events_Frags.headshot = 1 "); list($realheadshots) = $db->fetch_row(); $db->query (" SELECT COUNT(hlstats_Events_Frags.killerId) FROM hlstats_Events_Frags WHERE hlstats_Events_Frags.killerId = '$player' "); list($realkills) = $db->fetch_row(); $db->query (" SELECT COUNT(hlstats_Events_Frags.victimId) FROM hlstats_Events_Frags WHERE hlstats_Events_Frags.victimId = '$player' "); list($realdeaths) = $db->fetch_row(); $db->query (" SELECT COUNT(hlstats_Events_Teamkills.killerId) FROM hlstats_Events_Teamkills WHERE hlstats_Events_Teamkills.killerId = '$player' "); list($realteamkills) = $db->fetch_row(); if(!isset($_GET['killLimit'])) $killLimit = 5; else $killLimit = valid_request($_GET['killLimit'], 1); if ( $_GET['type'] == 'ajax' ) { $tabs = explode('_', preg_replace('[^a-z]', '', $_GET['tab'])); foreach ( $tabs as $tab ) { if ( file_exists(PAGE_PATH . "/playerinfo_$tab.php") ) { @include(PAGE_PATH . "/playerinfo_$tab.php"); } } exit; } pageHeader ( array ($gamename, 'Player Details', $pl_name), array ( $gamename=>$g_options['scripturl'] . "?game=$game", 'Player Rankings'=>$g_options['scripturl'] . "?mode=players&game=$game", 'Player Details'=>"" ), $pl_name ); ?>