if ($db->num_rows() < 1) { error("No such game '{$game}'."); } list($gamename) = $db->fetch_row(); $db->free_result(); pageHeader(array($gamename, 'Ribbon Details', $act_name), array($gamename => $g_options['scripturl'] . "?game={$game}", 'Ribbons' => $g_options['scripturl'] . "mode=awards&game={$game}&tab=ribbons", 'Ribbon Details' => ''), $act_name); $table = new Table(array(new TableColumn('playerName', 'Player', 'width=45&align=left&flag=1&link=' . urlencode('mode=playerinfo&player=%k')), new TableColumn('numawards', 'Daily awards', 'width=10&align=right&append=' . urlencode(' times')), new TableColumn('awardName', '', 'width=40&align=left')), 'playerId', 'numawards', 'playerName', true, 50); $result = $db->query("\r\n\t\tSELECT\r\n\t\t\tflag,\r\n\t\t\tlastName AS playerName,\r\n\t\t\thlstats_Players.playerId,\r\n\t\t\thlstats_Awards.name as awardName,\r\n\t\t\tCOUNT(hlstats_Awards.name) AS numawards\r\n\t\tFROM\r\n\t\t\thlstats_Players\r\n\t\tINNER JOIN\r\n\t\t\thlstats_Players_Awards\r\n\t\t\tON (\r\n\t\t\t hlstats_Players_Awards.playerId=hlstats_Players.playerId AND\r\n\t\t\t hlstats_Players_Awards.game=hlstats_Players.game\t\t\t \r\n\t\t\t )\r\n\t\tINNER JOIN\r\n\t\t\thlstats_Awards \r\n\t\t\tON (\r\n\t\t\t hlstats_Players_Awards.awardId=hlstats_Awards.awardId AND\r\n\t\t\t hlstats_Players_Awards.game=hlstats_Awards.game\t\t\t \r\n\t\t\t )\r\n\t\tWHERE\r\n\t\t\thlstats_Awards.code = '{$awardcode}' AND\r\n\t\t\thlstats_Players.game = '{$game}' AND\r\n\t\t\thlstats_Players.hideranking<>'1'\r\n\t\tGROUP BY\r\n\t\t\tflag,\r\n\t\t\tlastName,\r\n\t\t\thlstats_Players.playerId\r\n\t\tHAVING\r\n\t\t\tCOUNT(hlstats_Awards.name) >= {$awardmin} \t\r\n\t\tORDER BY\r\n\t\t\t{$table->sort} {$table->sortorder},\r\n\t\t\t{$table->sort2} {$table->sortorder}\r\n\t\tLIMIT {$table->startitem},{$table->numperpage}\r\n\t"); $resultCount = $db->query("\r\n\t\tSELECT\r\n\t\t\tflag,\r\n\t\t\tlastName AS playerName,\r\n\t\t\thlstats_Players.playerId,\r\n\t\t\thlstats_Awards.name as awardName,\r\n\t\t\tCOUNT(hlstats_Awards.name) AS numawards\r\n\t\tFROM\r\n\t\t\thlstats_Players\r\n\t\tINNER JOIN\r\n\t\t\thlstats_Players_Awards\r\n\t\t\tON (\r\n\t\t\t hlstats_Players_Awards.playerId=hlstats_Players.playerId AND\r\n\t\t\t hlstats_Players_Awards.game=hlstats_Players.game\t\t\t \r\n\t\t\t )\r\n\t\tINNER JOIN\r\n\t\t\thlstats_Awards \r\n\t\t\tON (\r\n\t\t\t hlstats_Players_Awards.awardId=hlstats_Awards.awardId AND\r\n\t\t\t hlstats_Players_Awards.game=hlstats_Awards.game\t\t\t \r\n\t\t\t )\r\n\t\tWHERE\r\n\t\t\thlstats_Awards.code = '{$awardcode}' AND\r\n\t\t\thlstats_Players.game = '{$game}' AND\r\n\t\t\thlstats_Players.hideranking<>'1'\r\n\t\tGROUP BY\r\n\t\t\tflag,\r\n\t\t\tlastName,\r\n\t\t\thlstats_Players.playerId\r\n\t\tHAVING\r\n\t\t\tCOUNT(hlstats_Awards.name) >= {$awardmin} \t\r\n\t"); $numitems = mysql_num_rows($resultCount); ?> <div class="block"> <?php printSectionTitle('Ribbon Details'); ?> <div class="subblock"> <div style="float:right;"> Back to <a href="<?php echo $g_options['scripturl'] . "?mode=awards&game={$game}&tab=ribbons"; ?> ">Ribbons</a> </div> <div style="clear:both;"></div> </div> <br /><br /> <?php echo '<img src="' . IMAGE_PATH . "/games/{$game}/ribbons/{$image}\" alt=\"\" /> <b>{$act_name}</b>"; $table->draw($result, $numitems, 95, 'center'); ?> </div>
<span style="padding-left:35px;">Optimizing tables...</span></td> </tr> </table><br /><br /> <?php flush(); $result = $db->query("SHOW TABLES"); while (list($table) = $db->fetch_row($result)) { if ($dbtables) { $dbtables .= ", "; } $dbtables .= $table; } $tableOptimize = new Table(array(new TableColumn("Table", "Table", "width=30&sort=no"), new TableColumn("Op", "Operation", "width=12&sort=no"), new TableColumn("Msg_type", "Msg. Type", "width=12&sort=no"), new TableColumn("Msg_text", "Message", "width=46&sort=no")), "Table", "Table", "Msg_type", false, 9999); $result = $db->query("OPTIMIZE TABLE {$dbtables}"); $tableOptimize->draw($result, mysql_num_rows($result), 80); ?> <br /><br /> <table style="width:90%;text-align:center;border:0" cellspacing="0" cellpadding="2"> <tr> <td class="fNormal">Analyzing tables...</td> </tr> </table><br /><br /> <?php $tableAnalyze = new Table(array(new TableColumn("Table", "Table", "width=30&sort=no"), new TableColumn("Op", "Operation", "width=12&sort=no"), new TableColumn("Msg_type", "Msg. Type", "width=12&sort=no"), new TableColumn("Msg_text", "Message", "width=46&sort=no")), "Table", "Table", "Msg_type", false, 9999); $result = $db->query("ANALYZE TABLE {$dbtables}"); $tableAnalyze->draw($result, mysql_num_rows($result), 80);
die("No player exists with ID #{$id}"); } $data = $db->fetch_array($result); echo '<span class="fTitle">'; echo $data['lastName']; echo '</span>'; echo '<span class="fNormal"> ' . '<a href="' . $g_options['scripturl'] . "?mode=playerinfo&player={$id}&" . strip_tags(SID) . '">' . '(View Player Details)</a></span>'; ?> <br /><br /> <table width="60%" align="center" border="0" cellspacing="0" cellpadding="0"> <tr> <td class="fNormal"><?php $proppage->draw($data); ?> <center><input type="submit" value=" Apply " class="submit" /></center></td> </tr> </table> </form> <?php $tblIps = new Table(array(new TableColumn('ipAddress', 'IP Address', 'width=40'), new TableColumn('eventTime', 'Last Used', 'width=60')), 'ipAddress', 'eventTime', 'eventTime'); $result = $db->query("\r\n\t\tSELECT\r\n\t\t\tipAddress,\r\n\t\t\teventTime\r\n\t\tFROM\r\n\t\t\thlstats_Events_Connects\r\n\t\tWHERE\r\n\t\t\tplayerId = {$playerId}\r\n\t\tGROUP BY\r\n\t\t\tipAddress\r\n\t\tORDER BY\r\n\t\t\teventTime DESC\r\n\t"); ?> <div class="block"> <?php printSectionTitle('Player IP Addresses'); $tblIps->draw($result, 50, 50); ?> </div><br /><br />
"> <input type="hidden" name="mode" value="search" /> <input type="hidden" name="game" value="<?php echo $game; ?> " /> <input type="hidden" name="st" value="player" /> <strong>•</strong> Find a player: <input type="text" name="q" size="20" maxlength="64" class="textbox" /> <input type="submit" value="Search" class="smallsubmit" /> </form> </div> </div><br /><br /> <div style="clear:both;padding-top:4px;"></div> <?php $table->draw($result, $numitems, 95); ?> <br /><br /> <div class="subblock"> <div style="float:left;"> <form method="get" action="<?php echo $g_options['scripturl']; ?> "> <?php foreach ($_GET as $k => $v) { $v = valid_request($v, 0); if ($k != "minkills") { echo "<input type=\"hidden\" name=\"" . htmlspecialchars($k) . "\" value=\"" . htmlspecialchars($v) . "\" />\n"; } }
echo $g_options['graphtxt_load']; ?> &numcolor_pct=#<?php echo $g_options['graphtxt_load']; ?> &linecolor=#<?php echo $g_options['graphtxt_load']; ?> &barcolor=#FFFFFF&barbackground=#000000&textcolor=#FFFFFF&captioncolor=#FFFFFF&textcolor_total=#FFFFFF'); } } } /* ]]> */ </script> <?php $tblWeaponstats2->draw($result, $db->num_rows($result), 100); $flashlink = IMAGE_PATH . '/hitbox.swf?wname=All+Weapons&head=' . $weapon_data['total']['head'] . '&rightarm=' . $weapon_data['total']['leftarm'] . '&leftarm=' . $weapon_data['total']['rightarm'] . '&chest=' . $weapon_data['total']['chest'] . '&stomach=' . $weapon_data['total']['stomach'] . '&rightleg=' . $weapon_data['total']['leftleg'] . '&leftleg=' . $weapon_data['total']['rightleg'] . '&model=' . $start_model . '&numcolor_num=#' . $g_options['graphtxt_load'] . '&numcolor_pct=#' . $g_options['graphtxt_load'] . '&linecolor=#' . $g_options['graphtxt_load'] . '&barcolor=#FFFFFF&barbackground=#000000&textcolor=#FFFFFF&captioncolor=#FFFFFF&textcolor_total=#FFFFFF'; ?> </div> <div style="float:right;vertical-align:top;width:480px;"> <table class="data-table"> <tr class="data-table-head"> <td style="text-align:center;">Targets</td> </tr> <tr class="bg1"> <td style="text-align:center;"> <object width="470" height="360" align="middle" id="hitbox" data="<?php echo $flashlink; ?> " type="application/x-shockwave-flash"> <param name="movie" value="<?php
of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. For support and installation notes visit http://www.hlxcommunity.com */ if (!defined('IN_HLSTATS')) { die('Do not access this file directly.'); } flush(); $tblMaps = new Table(array(new TableColumn('map', 'Map', 'width=22&align=left&link=' . urlencode("mode=mapinfo&map=%k&game={$game}")), new TableColumn('kills', 'Kills', 'width=7&align=right'), new TableColumn('kpercent', '%', 'width=6&sort=no&align=right&append=' . urlencode('%')), new TableColumn('kpercent', 'Ratio', 'width=8&sort=no&type=bargraph'), new TableColumn('deaths', 'Deaths', 'width=7&align=right'), new TableColumn('dpercent', '%', 'width=6&sort=no&align=right&append=' . urlencode('%')), new TableColumn('dpercent', 'Ratio', 'width=8&sort=no&type=bargraph'), new TableColumn('kpd', 'K:D', 'width=5&align=right'), new TableColumn('headshots', 'Headshots', 'width=7&align=right'), new TableColumn('hpercent', '%', 'width=6&sort=no&align=right&append=' . urlencode('%')), new TableColumn('hpercent', 'Ratio', 'width=8&sort=no&type=bargraph'), new TableColumn('hpk', 'HS:K', 'width=5&align=right')), 'map', 'kpd', 'kills', true, 9999, 'maps_page', 'maps_sort', 'maps_sortorder', 'tabmaps', 'desc', true); $result = $db->query("\r\n\t\tSELECT\r\n\t\t\tIF(hlstats_Events_Frags.map='', '(Unaccounted)', hlstats_Events_Frags.map) AS map,\r\n\t\t\tSUM(hlstats_Events_Frags.killerId = {$player}) AS kills,\r\n\t\t\tSUM(hlstats_Events_Frags.victimId = {$player}) AS deaths,\r\n\t\t\tIFNULL(ROUND(SUM(hlstats_Events_Frags.killerId = {$player}) / IF(SUM(hlstats_Events_Frags.victimId = {$player}) = 0, 1, SUM(hlstats_Events_Frags.victimId = {$player})), 2), '-') AS kpd,\r\n\t\t\tROUND(CONCAT(SUM(hlstats_Events_Frags.killerId = {$player})) / {$realkills} * 100, 2) AS kpercent,\r\n\t\t\tROUND(CONCAT(SUM(hlstats_Events_Frags.victimId = {$player})) / {$realdeaths} * 100, 2) AS dpercent,\r\n\t\t\tSUM(hlstats_Events_Frags.killerId = {$player} AND hlstats_Events_Frags.headshot = 1) AS headshots,\r\n\t\t\tIFNULL(ROUND(SUM(hlstats_Events_Frags.killerId = {$player} AND hlstats_Events_Frags.headshot = 1) / SUM(hlstats_Events_Frags.killerId = {$player}), 2),'-') AS hpk,\r\n\t\t\tROUND(CONCAT(SUM(hlstats_Events_Frags.killerId = {$player} AND hlstats_Events_Frags.headshot = 1)) / {$realheadshots} * 100, 2) AS hpercent\r\n\t\tFROM\r\n\t\t\thlstats_Events_Frags\r\n\t\tWHERE\r\n\t\t\thlstats_Events_Frags.killerId = '{$player}'\r\n\t\t\tOR hlstats_Events_Frags.victimId = '{$player}'\r\n\t\tGROUP BY\r\n\t\t\thlstats_Events_Frags.map\r\n\t\tORDER BY\r\n\t\t\t{$tblMaps->sort} {$tblMaps->sortorder},\r\n\t\t\t{$tblMaps->sort2} {$tblMaps->sortorder}\r\n\t"); $numitems = $db->num_rows($result); if ($numitems > 0) { ?> <div style="clear:both;padding-top:20px;"></div> <?php printSectionTitle('Map Performance *'); $tblMaps->draw($result, $numitems, 95); ?> <br /><br /> <?php }
} $db->query("\n\t\tSELECT\n\t\t\thlstats_Players.playerId,\n\t\t\thlstats_Players.lastName,\n\t\t\thlstats_Players.game\n\t\tFROM\n\t\t\thlstats_Players\n\t\tWHERE\n\t\t\tplayerId={$player}\n\t"); 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(); } $tblWeapons = new Table(array(new TableColumn('weapon', 'Weapon', 'width=15&type=weaponimg&align=center&link=' . urlencode("mode=weaponinfo&weapon=%k&game={$game}")), new TableColumn('modifier', 'Modifier', 'width=10&align=right'), new TableColumn('kills', 'Kills', 'width=11&align=right'), new TableColumn('kpercent', 'Perc. Kills', 'width=18&sort=no&type=bargraph'), new TableColumn('kpercent', '%', 'width=5&sort=no&align=right&append=' . urlencode('%')), new TableColumn('headshots', 'Headshots', 'width=8&align=right'), new TableColumn('hpercent', 'Perc. Headshots', 'width=18&sort=no&type=bargraph'), new TableColumn('hpercent', '%', 'width=5&sort=no&align=right&append=' . urlencode('%')), new TableColumn('hpk', 'Hpk', 'width=5&align=right')), 'weapon', 'kills', 'weapon', true, 9999, 'weap_page', 'weap_sort', 'weap_sortorder', 'weapons'); $db->query("\n\t\t\tSELECT\n\t\t\t\tCOUNT(*)\n\t\t\tFROM\n\t\t\t\thlstats_Events_Frags\n\t\t\tLEFT JOIN hlstats_Servers ON\n\t\t\t\thlstats_Servers.serverId=hlstats_Events_Frags.serverId\n\t\t\tWHERE\n\t\t\t\thlstats_Servers.game='{$game}' AND killerId={$player}\n\t"); list($realkills) = $db->fetch_row(); $db->query("\n\t\t\tSELECT\n\t\t\t\tCOUNT(*)\n\t\t\tFROM\n\t\t\t\thlstats_Events_Frags\n\t\t\tLEFT JOIN hlstats_Servers ON\n\t\t\t\thlstats_Servers.serverId=hlstats_Events_Frags.serverId\n\t\t\tWHERE\n\t\t\t\thlstats_Servers.game='{$game}' AND killerId={$player}\n\t\t\t\tAND headshot=1 \n\t"); list($realheadshots) = $db->fetch_row(); $result = $db->query("\n\t\tSELECT\n\t\t\thlstats_Events_Frags.weapon,\n\t\t\tIFNULL(hlstats_Weapons.modifier, 1.00) AS modifier,\n\t\t\tCOUNT(hlstats_Events_Frags.weapon) AS kills,\n\t\t\tCOUNT(hlstats_Events_Frags.weapon) / {$realkills} * 100 AS kpercent,\n\t\t\tSUM(hlstats_Events_Frags.headshot=1) as headshots,\n\t\t\tSUM(hlstats_Events_Frags.headshot=1) / COUNT(hlstats_Events_Frags.weapon) AS hpk,\n\t\t\tSUM(hlstats_Events_Frags.headshot=1) / {$realheadshots} * 100 AS hpercent\n\t\tFROM\n\t\t\thlstats_Events_Frags\n\t\tLEFT JOIN hlstats_Weapons ON\n\t\t\thlstats_Weapons.code = hlstats_Events_Frags.weapon\n\t\tLEFT JOIN hlstats_Servers ON\n\t\t\thlstats_Servers.serverId=hlstats_Events_Frags.serverId\n\t\tWHERE\n\t\t\thlstats_Servers.game='{$game}' AND hlstats_Events_Frags.killerId={$player}\n\t\t\tAND (hlstats_Weapons.game='{$game}' OR hlstats_Weapons.weaponId IS NULL)\n\t\tGROUP BY\n\t\t\thlstats_Events_Frags.weapon\n\t\tORDER BY\n\t\t\t{$tblWeapons->sort} {$tblWeapons->sortorder},\n\t\t\t{$tblWeapons->sort2} {$tblWeapons->sortorder}\n\t"); $tblWeapons->draw($result, $db->num_rows($result), 100);
<tr class="data-table-head"> <td colspan="3">Player Locations</td> </tr> <tr class="bg1"> <td> <div id="map" style="margin:10px auto;width: 430px; height: 290px;"></div> </td> </tr> </table> </div> </div><br /> <?php flush(); $tblMembers = new Table(array(new TableColumn('lastName', 'Name', 'width=32&flag=1&link=' . urlencode('mode=playerinfo&player=%k')), new TableColumn('skill', 'Points', 'width=6&align=right'), new TableColumn('activity', 'Activity', 'width=10&sort=no&type=bargraph'), new TableColumn('connection_time', 'Time', 'width=13&align=right&type=timestamp'), new TableColumn('kills', 'Kills', 'width=6&align=right'), new TableColumn('percent', 'Clan Kills', 'width=10&sort=no&type=bargraph'), new TableColumn('percent', '%', 'width=6&sort=no&align=right&append=' . urlencode('%')), new TableColumn('deaths', 'Deaths', 'width=6&align=right'), new TableColumn('kpd', 'Kpd', 'width=6&align=right')), 'playerId', 'skill', 'kpd', true, 20, 'members_page', 'members_sort', 'members_sortorder', 'members', 'desc', true); $result = $db->query("\r\n\t\tSELECT\r\n\t\t\thlstats_Players.playerId,\r\n\t\t\thlstats_Players.lastName,\r\n\t\t\thlstats_Players.country,\r\n\t\t\thlstats_Players.flag,\r\n\t\t\thlstats_Players.skill,\r\n\t\t\thlstats_Players.connection_time,\r\n\t\t\thlstats_Players.kills,\r\n\t\t\thlstats_Players.deaths,\r\n\t\t\tROUND(hlstats_Players.kills / IF(hlstats_Players.deaths = 0, 1, hlstats_Players.deaths), 2) AS kpd,\r\n\t\t\tROUND(hlstats_Players.kills / IF(" . $clandata['kills'] . " = 0, 1, " . $clandata['kills'] . ") * 100, 2) AS percent,\r\n\t\t\tactivity\r\n\t\tFROM\r\n\t\t\thlstats_Players\r\n\t\tWHERE\r\n\t\t\thlstats_Players.clan={$clan}\r\n\t\t\tAND hlstats_Players.hideranking = 0\r\n\t\tGROUP BY\r\n\t\t\thlstats_Players.playerId\r\n\t\tORDER BY\r\n\t\t\t{$tblMembers->sort} {$tblMembers->sortorder},\r\n\t\t\t{$tblMembers->sort2} {$tblMembers->sortorder},\r\n\t\t\thlstats_Players.skill DESC\r\n\t\tLIMIT {$tblMembers->startitem},{$tblMembers->numperpage}\r\n\t"); $resultCount = $db->query("\r\n\t\tSELECT\r\n\t\t\tCOUNT(*)\r\n\t\tFROM\r\n\t\t\thlstats_Players\r\n\t\tWHERE\r\n\t\t\thlstats_Players.clan={$clan}\r\n\t\t\tAND hlstats_Players.hideranking = 0\r\n\t"); list($numitems) = $db->fetch_row($resultCount); ?> <div style="clear:both;padding-top:20px;"></div> <?php printSectionTitle('Members'); $tblMembers->draw($result, $numitems, 95); ?> <br /><br /> <?php if ($g_options['show_google_map'] == 1) { include INCLUDE_PATH . '/google_maps.php'; printMap('clan'); }
$tblTeams->draw($result, $numitems, 95); ?> <br /><br /> <?php } flush(); $result = $db->query("\r\n\t\tSELECT\r\n\t\t\thlstats_Roles.code,\r\n\t\t\thlstats_Roles.name\r\n\t\tFROM\r\n\t\t\thlstats_Roles\r\n\t\tWHERE\r\n\t\t\thlstats_Roles.game = '{$game}'\r\n\t"); while ($rowdata = $db->fetch_row($result)) { $code = preg_replace("/[ \r\n\t]+/", "", $rowdata[0]); $fname[strToLower($code)] = htmlspecialchars($rowdata[1]); } $tblRoles = new Table(array(new TableColumn('code', 'Role', 'width=25&type=roleimg&align=left&link=' . urlencode("mode=rolesinfo&role=%k&game={$game}"), $fname), new TableColumn('rolecount', 'Joined', 'width=10&align=right&append=+times'), new TableColumn('percent', '%', 'width=10&sort=no&align=right&append=' . urlencode('%')), new TableColumn('percent', 'Ratio', 'width=20&sort=no&type=bargraph'), new TableColumn('killsTotal', 'Kills', 'width=10&align=right'), new TableColumn('deathsTotal', 'Deaths', 'width=10&align=right'), new TableColumn('kpd', 'K:D', 'width=10&align=right')), 'code', 'rolecount', 'name', true, 9999, 'roles_page', 'roles_sort', 'roles_sortorder', 'roles', 'desc', true); $db->query("\r\n\t\tDROP TABLE IF EXISTS\r\n\t\t\thlstats_Frags_as\r\n\t"); $db->query("\r\n\t\tCREATE TEMPORARY TABLE\r\n\t\t\thlstats_Frags_as\r\n\t\t\t(\r\n\t\t\t\tplayerId INT(10),\r\n\t\t\t\tkills INT(10),\r\n\t\t\t\tdeaths INT(10),\r\n\t\t\t\trole varchar(128) NOT NULL default ''\r\n\t\t\t)\r\n\t"); $db->query("\r\n\t\tINSERT INTO\r\n\t\t\thlstats_Frags_as\r\n\t\t\t(\r\n\t\t\t\tplayerId,\r\n\t\t\t\tkills,\r\n\t\t\t\trole\r\n\t\t\t)\r\n\t\tSELECT\r\n\t\t\thlstats_Events_Frags.victimId,\r\n\t\t\thlstats_Events_Frags.killerId,\r\n\t\t\thlstats_Events_Frags.killerRole\r\n\t\tFROM\r\n\t\t\thlstats_Events_Frags\r\n\t\tWHERE \r\n\t\t\thlstats_Events_Frags.killerId = {$player}\r\n\t"); $db->query("\r\n\t\tINSERT INTO\r\n\t\t\thlstats_Frags_as\r\n\t\t\t(\r\n\t\t\t\tplayerId,\r\n\t\t\t\tdeaths,\r\n\t\t\t\trole\r\n\t\t\t)\r\n\t\tSELECT\r\n\t\t\thlstats_Events_Frags.killerId,\r\n\t\t\thlstats_Events_Frags.victimId,\r\n\t\t\thlstats_Events_Frags.victimRole\r\n\t\tFROM\r\n\t\t\thlstats_Events_Frags\r\n\t\tWHERE \r\n\t\t\thlstats_Events_Frags.victimId = {$player} \r\n\t"); $db->query("\r\n\t\tDROP TABLE IF EXISTS\r\n\t\t\thlstats_Frags_as_res\r\n\t"); $db->query("\r\n\t\tCREATE TEMPORARY TABLE\r\n\t\t\thlstats_Frags_as_res\r\n\t\t\t(\r\n\t\t\t\tkillsTotal INT(10),\r\n\t\t\t\tdeathsTotal INT(10),\r\n\t\t\t\trole varchar(128) NOT NULL default ''\r\n\t\t\t)\r\n\t"); $db->query("\r\n\t\tINSERT INTO\r\n\t\t\thlstats_Frags_as_res\r\n\t\t\t(\r\n\t\t\t\tkillsTotal,\r\n\t\t\t\tdeathsTotal,\r\n\t\t\t\trole\r\n\t\t\t)\r\n\t\tSELECT\r\n\t\t\tCOUNT(hlstats_Frags_as.kills) AS kills, \r\n\t\t\tCOUNT(hlstats_Frags_as.deaths) AS deaths,\r\n\t\t\thlstats_Frags_as.role\r\n\t\tFROM\r\n\t\t\thlstats_Frags_as\r\n\t\tGROUP BY\r\n\t\t\thlstats_Frags_as.role\r\n\t"); $db->query("\r\n\t\tSELECT\r\n\t\t\tCOUNT(*)\r\n\t\tFROM\r\n\t\t\thlstats_Events_ChangeRole\r\n\t\tWHERE\r\n\t\t\thlstats_Events_ChangeRole.playerId = {$player}\r\n\t"); list($numrolejoins) = $db->fetch_row(); $result = $db->query("\r\n\t\tSELECT\r\n\t\t\tIFNULL(hlstats_Roles.name, hlstats_Events_ChangeRole.role) AS name,\r\n\t\t\tIFNULL(hlstats_Roles.code, hlstats_Events_ChangeRole.role) AS code,\r\n\t\t\tCOUNT(hlstats_Events_ChangeRole.id) AS rolecount,\r\n\t\t\tROUND(COUNT(hlstats_Events_ChangeRole.id) / IF({$numrolejoins} = 0, 1, {$numrolejoins}) * 100, 2) AS percent,\r\n\t\t\thlstats_Frags_as_res.killsTotal,\r\n\t\t\thlstats_Frags_as_res.deathsTotal,\r\n\t\t\tROUND(hlstats_Frags_as_res.killsTotal / IF(hlstats_Frags_as_res.deathsTotal = 0, 1, hlstats_Frags_as_res.deathsTotal), 2) AS kpd\r\n\t\tFROM\r\n\t\t\thlstats_Events_ChangeRole\r\n\t\tLEFT JOIN\r\n\t\t\thlstats_Roles\r\n\t\tON\r\n\t\t\thlstats_Events_ChangeRole.role = hlstats_Roles.code\r\n\t\tLEFT JOIN\r\n\t\t\thlstats_Frags_as_res\r\n\t\tON\r\n\t\t\thlstats_Frags_as_res.role = hlstats_Events_ChangeRole.role\r\n\t\tWHERE\r\n\t\t\thlstats_Events_ChangeRole.playerId = {$player}\r\n\t\t\tAND\r\n\t\t\t(\r\n\t\t\t\thidden <> '1'\r\n\t\t\t\tOR hidden IS NULL\r\n\t\t\t)\r\n\t\t\tAND hlstats_Roles.game = '{$game}'\r\n\t\tGROUP BY\r\n\t\t\thlstats_Events_ChangeRole.role\r\n\t\tORDER BY\r\n\t\t\t{$tblRoles->sort} {$tblRoles->sortorder},\r\n\t\t\t{$tblRoles->sort2} {$tblRoles->sortorder}\r\n\t"); $numitems = $db->num_rows($result); if ($numitems > 0) { printSectionTitle('Role Selection *'); $tblRoles->draw($result, $numitems, 95); ?> <br /><br /> <?php }
die('Do not access this file directly.'); } flush(); $tblPlayerActions = new Table(array(new TableColumn('description', 'Action', 'width=45&link=' . urlencode("mode=actioninfo&action=%k&game={$game}")), new TableColumn('obj_count', 'Earned', 'width=25&align=right&append=+times'), new TableColumn('obj_bonus', 'Accumulated Points', 'width=25&align=right')), 'code', 'obj_count', 'description', true, 9999, 'obj_page', 'obj_sort', 'obj_sortorder', 'tabteams', 'desc', true); $result = $db->query("\r\n\t\t(\r\n\t\tSELECT\r\n\t\t\thlstats_Actions.code,\r\n\t\t\thlstats_Actions.description,\r\n\t\t\tCOUNT(hlstats_Events_PlayerActions.id) AS obj_count,\r\n\t\t\tSUM(hlstats_Events_PlayerActions.bonus) AS obj_bonus\r\n\t\tFROM\r\n\t\t\thlstats_Actions\r\n\t\tLEFT JOIN\r\n\t\t\thlstats_Events_PlayerActions\r\n\t\tON\r\n\t\t\thlstats_Events_PlayerActions.actionId = hlstats_Actions.id\r\n\t\tWHERE\r\n\t\t\thlstats_Events_PlayerActions.playerId = {$player}\r\n\t\tGROUP BY\r\n\t\t\thlstats_Actions.id\r\n\t\t)\r\n\t\tUNION ALL\r\n\t\t(\r\n\t\tSELECT\r\n\t\t\thlstats_Actions.code,\r\n\t\t\thlstats_Actions.description,\r\n\t\t\tCOUNT(hlstats_Events_PlayerPlayerActions.id) AS obj_count,\r\n\t\t\tSUM(hlstats_Events_PlayerPlayerActions.bonus) AS obj_bonus\r\n\t\tFROM\r\n\t\t\thlstats_Actions\r\n\t\tLEFT JOIN\r\n\t\t\thlstats_Events_PlayerPlayerActions\r\n\t\tON\r\n\t\t\thlstats_Events_PlayerPlayerActions.actionId = hlstats_Actions.id\r\n\t\tWHERE\r\n\t\t\thlstats_Events_PlayerPlayerActions.playerId = {$player}\r\n\t\tGROUP BY\r\n\t\t\thlstats_Actions.id\r\n\t\t)\r\n\t\tORDER BY\r\n\t\t\t{$tblPlayerActions->sort} {$tblPlayerActions->sortorder},\r\n\t\t\t{$tblPlayerActions->sort2} {$tblPlayerActions->sortorder}\r\n\t"); $numitems = $db->num_rows($result); if ($numitems > 0) { ?> <div style="clear:both;padding-top:20px;"></div> <?php printSectionTitle('Player Actions *'); $tblPlayerActions->draw($result, $numitems, 95); ?> <br /><br /> <?php } $tblPlayerPlayerActionsV = new Table(array(new TableColumn('description', 'Action', 'width=45&link=' . urlencode("mode=actioninfo&action=%k&game={$game}#victims")), new TableColumn('obj_count', 'Earned Against', 'width=25&align=right&append=+times'), new TableColumn('obj_bonus', 'Accumulated Points', 'width=25&align=right')), 'code', 'obj_count', 'description', true, 9999, 'ppa_page', 'ppa_sort', 'ppa_sortorder', 'tabteams', 'desc', true); $result = $db->query("\r\n\t\tSELECT\r\n\t\t\thlstats_Actions.code,\r\n\t\t\thlstats_Actions.description,\r\n\t\t\tCOUNT(hlstats_Events_PlayerPlayerActions.id) AS obj_count,\r\n\t\t\tSUM(hlstats_Events_PlayerPlayerActions.bonus) * -1 AS obj_bonus\r\n\t\tFROM\r\n\t\t\thlstats_Actions\r\n\t\tLEFT JOIN\r\n\t\t\thlstats_Events_PlayerPlayerActions\r\n\t\tON\r\n\t\t\thlstats_Events_PlayerPlayerActions.actionId = hlstats_Actions.id\r\n\t\tWHERE\r\n\t\t\thlstats_Events_PlayerPlayerActions.victimId = {$player}\r\n\t\tGROUP BY\r\n\t\t\thlstats_Actions.id\r\n\t\tORDER BY\r\n\t\t\t{$tblPlayerPlayerActionsV->sort} {$tblPlayerPlayerActionsV->sortorder},\r\n\t\t\t{$tblPlayerPlayerActionsV->sort2} {$tblPlayerPlayerActionsV->sortorder}\r\n\t"); $numitemsv = $db->num_rows($result); if ($numitemsv > 0) { if ($numitems == 0) { ?> <div style="clear:both;padding-top:20px;"></div> <?php } printSectionTitle('Victims of Player-Player Actions *'); $tblPlayerPlayerActionsV->draw($result, $numitems, 95); ?> <br /><br /> <?php }
echo 'Kills per Death'; ?> :</td> <td colspan="2" class="fSmall"><?php if ($clandata['deaths'] != 0) { printf('%0.2f', $clandata['kills'] / $clandata['deaths']); } else { echo '-'; } ?> </td> </tr> <tr class="bg1"> <td class="fSmall"><?php echo 'Total Connection Time'; ?> :</td> <td colspan="2" class="fSmall"><?php echo timestamp_to_str($clandata['connection_time']); ?> </td> </tr> </table> <?php flush(); $tblMembers = new Table(array(new TableColumn('lastName', 'Name', 'width=32&flag=1&link=' . urlencode('mode=statsme&player=%k')), new TableColumn('skill', 'Points', 'width=7&align=right'), new TableColumn('activity', 'Activity', 'width=9&sort=no&type=bargraph'), new TableColumn('connection_time', 'Time', 'width=14&align=right&type=timestamp'), new TableColumn('kills', 'Kills', 'width=7&align=right'), new TableColumn('percent', 'Clan Kills', 'width=5&sort=no&type=bargraph'), new TableColumn('percent', '%', 'width=7&sort=no&align=right&append=' . urlencode('%')), new TableColumn('deaths', 'Deaths', 'width=7&align=right'), new TableColumn('kpd', 'KPD', 'width=7&align=right')), 'playerId', 'skill', 'kpd', true, 20, 'members_page', 'members_sort', 'members_sortorder', 'members'); $result = $db->query("\r\n\t\tSELECT\r\n\t\t\tplayerId,\r\n\t\t\tlastName,\r\n\t\t\tcountry,\r\n\t\t\tflag,\r\n\t\t\tskill,\r\n\t\t\tconnection_time,\r\n\t\t\tkills,\r\n\t\t\tdeaths,\r\n\t\t\tIFNULL(kills/deaths, '-') AS kpd,\r\n\t\t\t(kills/" . $clandata["kills"] . ") * 100 AS percent,\r\n\t\t\tactivity\r\n\t\tFROM\r\n\t\t\thlstats_Players\r\n\t\tWHERE\r\n\t\t\tclan={$clan}\r\n\t\t\tAND hlstats_Players.hideranking = 0\r\n\t\tORDER BY\r\n\t\t\t{$tblMembers->sort} {$tblMembers->sortorder},\r\n\t\t\t{$tblMembers->sort2} {$tblMembers->sortorder},\r\n\t\t\tlastName ASC\r\n\t\tLIMIT {$tblMembers->startitem},{$tblMembers->numperpage}\r\n\t"); $resultCount = $db->query("\r\n\t\tSELECT\r\n\t\t\tCOUNT(*)\r\n\t\tFROM\r\n\t\t\thlstats_Players\r\n\t\tWHERE\r\n\t\t\tclan={$clan}\r\n\t\t\tAND hlstats_Players.hideranking = 0\r\n\t"); list($numitems) = $db->fetch_row($resultCount); $tblMembers->draw($result, $numitems, 100);
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. For support and installation notes visit http://www.hlxcommunity.com */ if (!defined('IN_HLSTATS')) { die('Do not access this file directly.'); } flush(); $tblServers = new Table(array(new TableColumn('server', 'Server', 'width=26&align=left'), new TableColumn('kills', 'Kills', 'width=6&align=right'), new TableColumn('kpercent', '%', 'width=5&sort=no&align=right&append=' . urlencode('%')), new TableColumn('kpercent', 'Ratio', 'width=15&sort=no&type=bargraph'), new TableColumn('deaths', 'Deaths', 'width=6&align=right'), new TableColumn('kpd', 'K:D', 'width=5&align=right'), new TableColumn('headshots', 'Headshots', 'width=6&align=right'), new TableColumn('hpercent', 'Percentage of Headshots', 'width=16&sort=no&type=bargraph'), new TableColumn('hpercent', '%', 'width=5&sort=no&align=right&append=' . urlencode('%')), new TableColumn('hpk', 'HS:K', 'width=5&align=right')), 'server', 'kills', 'kills', true, 9999, 'server_page', 'server_sort', 'server_sortorder', 'tabmaps', 'desc', true); // leave the join on this one, we do groupings.. $result = $db->query("\r\n\t\tSELECT\r\n\t\t\thlstats_Servers.name AS server,\r\n\t\t\tSUM(hlstats_Events_Frags.killerId = {$player}) AS kills,\r\n\t\t\tSUM(hlstats_Events_Frags.victimId = {$player}) AS deaths,\r\n\t\t\tSUM(hlstats_Events_Frags.killerId = {$player}) / IF(SUM(hlstats_Events_Frags.victimId = {$player}) = 0, 1, SUM(hlstats_Events_Frags.victimId = {$player})) AS kpd,\r\n\t\t\tROUND(SUM(hlstats_Events_Frags.killerId = {$player}) / {$realkills} * 100, 2) AS kpercent,\r\n\t\t\tROUND(SUM(hlstats_Events_Frags.victimId = {$player}) / {$realdeaths} * 100, 2) AS dpercent,\r\n\t\t\tSUM(hlstats_Events_Frags.killerId = {$player} AND hlstats_Events_Frags.headshot = 1) AS headshots,\r\n\t\t\tIFNULL(SUM(hlstats_Events_Frags.killerId = {$player} AND hlstats_Events_Frags.headshot = 1) / SUM(hlstats_Events_Frags.killerId = {$player}), '-') AS hpk,\r\n\t\t\tROUND(SUM(hlstats_Events_Frags.killerId = {$player} AND hlstats_Events_Frags.headshot = 1) / {$realheadshots} * 100, 2) AS hpercent\r\n\t\tFROM\r\n\t\t\thlstats_Events_Frags\r\n\t\tLEFT JOIN\r\n\t\t\thlstats_Servers\r\n\t\tON\r\n\t\t\thlstats_Servers.serverId = hlstats_Events_Frags.serverId\r\n\t\tWHERE\r\n\t\t\thlstats_Servers.game = '{$game}'\r\n\t\t\tAND hlstats_Events_Frags.killerId = '{$player}'\r\n\t\t\tOR hlstats_Events_Frags.victimId = '{$player}'\r\n\t\tGROUP BY\r\n\t\t\thlstats_Servers.name\r\n\t\tORDER BY\r\n\t\t\t{$tblServers->sort} {$tblServers->sortorder},\r\n\t\t\t{$tblServers->sort2} {$tblServers->sortorder}\r\n\t"); $numitems = $db->num_rows($result); if ($numitems > 0) { printSectionTitle('Server Activity *'); $tblServers->draw($result, $numitems, 95); ?> <br /><br /> <?php }
<?php $tblActions = new Table(array(new TableColumn('gamename', 'Game', 'width=24&sort=no'), new TableColumn('for_PlayerActions', 'Player Action', 'width=4&sort=no&align=center'), new TableColumn('for_PlayerPlayerActions', 'PlyrPlyr Action', 'width=4&sort=no&align=center'), new TableColumn('for_TeamActions', 'Team Action', 'width=4&sort=no&align=center'), new TableColumn('for_WorldActions', 'World Action', 'width=4&sort=no&align=center'), new TableColumn('description', 'Action', 'width=33'), new TableColumn('s_reward_player', 'Player Reward', 'width=12'), new TableColumn('s_reward_team', 'Team Reward', 'width=15')), 'id', 'description', 's_reward_player', false, 9999, 'act_page', 'act_sort', 'act_sortorder', 'actions', 'asc'); $result = $db->query("\r\n\t\t\t\t\tSELECT\r\n\t\t\t\t\t\thlstats_Games.name AS gamename,\r\n\t\t\t\t\t\thlstats_Actions.description,\r\n\t\t\t\t\t\tIF(SIGN(hlstats_Actions.reward_player) > 0, CONCAT('+', hlstats_Actions.reward_player), hlstats_Actions.reward_player) AS s_reward_player,\r\n\t\t\t\t\t\tIF(hlstats_Actions.team != '' AND hlstats_Actions.reward_team != 0,\r\n\t\t\t\t\t\tIF(SIGN(hlstats_Actions.reward_team) >= 0, CONCAT(hlstats_Teams.name, ' +', hlstats_Actions.reward_team), CONCAT(hlstats_Teams.name, ' ', hlstats_Actions.reward_team)), '') AS s_reward_team,\r\n\t\t\t\t\t\tIF(for_PlayerActions='1', 'Yes', 'No') AS for_PlayerActions,\r\n\t\t\t\t\t\tIF(for_PlayerPlayerActions='1', 'Yes', 'No') AS for_PlayerPlayerActions,\r\n\t\t\t\t\t\tIF(for_TeamActions='1', 'Yes', 'No') AS for_TeamActions,\r\n\t\t\t\t\t\tIF(for_WorldActions='1', 'Yes', 'No') AS for_WorldActions\r\n\t\t\t\t\tFROM\r\n\t\t\t\t\t\thlstats_Actions\r\n\t\t\t\t\tINNER JOIN\r\n\t\t\t\t\t\thlstats_Games\r\n\t\t\t\t\tON\r\n\t\t\t\t\t\thlstats_Games.code = hlstats_Actions.game\r\n\t\t\t\t\t\tAND hlstats_Games.hidden = '0'\r\n\t\t\t\t\tLEFT JOIN\r\n\t\t\t\t\t\thlstats_Teams\r\n\t\t\t\t\tON\r\n\t\t\t\t\t\thlstats_Teams.code = hlstats_Actions.team\r\n\t\t\t\t\t\tAND hlstats_Teams.game = hlstats_Actions.game\r\n\t\t\t\t\tORDER BY\r\n\t\t\t\t\t\thlstats_Actions.game ASC,\r\n\t\t\t\t\t\t{$tblActions->sort} {$tblActions->sortorder},\r\n\t\t\t\t\t\t{$tblActions->sort2} {$tblActions->sortorder}\r\n\t\t\t\t"); $numitems = $db->num_rows($result); $tblActions->draw($result, $numitems, 90, 'center'); ?> <br /><br /> <strong>Note:</strong> The player who triggers an action may receive both the player reward and the team reward.<br /><br /> <h1 class="fTitle" style="padding-top:10px;"><a name="weaponmods">3. What are all the weapon points modifiers?</a></h1><br /><br /> Weapon points modifiers are used to determine how many points you should gain or lose when you make a kill or are killed by another player. Higher modifiers indicate that more points will be gained when killing with that weapon (and similarly, more points will be lost when being killed <em>by</em> that weapon). Modifiers generally range from 0.00 to 2.00.<br /><br /> <a name="weapons"></a> <?php $tblWeapons = new Table(array(new TableColumn('gamename', 'Game', 'width=24&sort=no'), new TableColumn('code', 'Weapon', 'width=14'), new TableColumn('name', 'Name', 'width=50'), new TableColumn('modifier', 'Points Modifier', 'width=12')), 'weaponId', 'modifier', 'code', false, 9999, 'weap_page', 'weap_sort', 'weap_sortorder', 'weapons', 'desc'); $result = $db->query("\r\n\t\t\t\t\tSELECT\r\n\t\t\t\t\t\thlstats_Games.name AS gamename,\r\n\t\t\t\t\t\thlstats_Weapons.code,\r\n\t\t\t\t\t\thlstats_Weapons.name,\r\n\t\t\t\t\t\thlstats_Weapons.modifier\r\n\t\t\t\t\tFROM\r\n\t\t\t\t\t\thlstats_Weapons\r\n\t\t\t\t\tINNER JOIN\r\n\t\t\t\t\t\thlstats_Games\r\n\t\t\t\t\tON\r\n\t\t\t\t\t\thlstats_Games.code = hlstats_Weapons.game\r\n\t\t\t\t\t\tAND hlstats_Games.hidden = '0'\r\n\t\t\t\t\tORDER BY\r\n\t\t\t\t\t\thlstats_Weapons.game ASC,\r\n\t\t\t\t\t\t{$tblWeapons->sort} {$tblWeapons->sortorder},\r\n\t\t\t\t\t\t{$tblWeapons->sort2} {$tblWeapons->sortorder}\r\n\t\t\t\t"); $numitems = $db->num_rows($result); $tblWeapons->draw($result, $numitems, 90, "center"); ?> <br /><br /> <h1 class="fTitle" style="padding-top:10px;"><a name="set">4. How can I set my real name, e-mail address, and homepage?</a></h1><br /><br /> Player profile options can be configured by saying the appropriate <strong>HLX_SET</strong> command while you are playing on a participating game server. To say commands, push your chat key and type the command text.<br /><br /> Syntax: say <strong>/hlx_set option value</strong>.<br /><br /> Acceptable "options" are: <ul> <li><strong>realname</strong><br /> Sets your Real Name as shown in your profile.<br /> Example: <strong>/hlx_set realname Joe Bloggs</strong><br /><br /> </li> <li><strong>email</strong><br /> Sets your E-mail Address as shown in your profile.<br /> Example: <strong>/hlx_set email joe@joebloggs.com</strong><br /><br />
<form method="get" action="<?php echo $g_options["scripturl"]; ?> "> <input type="hidden" name="mode" value="admin" /> <input type="hidden" name="task" value="<?php echo $code; ?> " /> <input type="hidden" name="sort" value="<?php echo $sort; ?> " /> <input type="hidden" name="sortorder" value="<?php echo $sortorder; ?> " /> <b style="padding-left:35px;">•</b> Show only events of type: <?php $resultTypes = $db->query("\r\n\t\tSELECT\r\n\t\t\tDISTINCT eventType\r\n\t\tFROM\r\n\t\t\thlstats_AdminEventHistory\r\n\t\tORDER BY\r\n\t\t\teventType ASC\r\n\t"); $types[""] = "(All)"; while (list($k) = $db->fetch_row($resultTypes)) { $types[$k] = $k; } echo getSelect("type", $types, $type); ?> <input type="submit" value="Filter" class="smallsubmit" /><br /><br /> </form> <?php $table->draw($result, $numitems, 95, "center");
GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. For support and installation notes visit http://www.hlxcommunity.com */ if (!defined('IN_HLSTATS')) { die('Do not access this file directly.'); } // Weapon Details $weapon = valid_request($_GET['weapon'], 0) or error('No weapon ID specified.'); $db->query("\n\t\tSELECT\n\t\t\tname\n\t\tFROM\n\t\t\thlstats_Weapons\n\t\tWHERE\n\t\t\tcode='{$weapon}'\n\t\t\tAND game='{$game}'\n\t"); if ($db->num_rows() != 1) { $wep_name = ucfirst($weapon); } else { $weapondata = $db->fetch_array(); $db->free_result(); $wep_name = $weapondata['name']; } $db->query("SELECT name FROM hlstats_Games WHERE code='{$game}'"); if ($db->num_rows() != 1) { error('Invalid or no game specified.'); } else { list($gamename) = $db->fetch_row(); } $table = new Table(array(new TableColumn('killerName', 'Player', 'width=60&align=left&flag=1&link=' . urlencode('mode=statsme&player=%k')), new TableColumn('frags', ucfirst($weapon) . ' kills', 'width=15&align=right'), new TableColumn('headshots', 'Headshots', 'width=15&align=right'), new TableColumn('hpk', 'Hpk', 'width=5&align=right')), 'killerId', 'frags', 'killerName', true, 25); $result = $db->query("\n\t\tSELECT\n\t\t\thlstats_Events_Frags.killerId,\n\t\t\thlstats_Players.country,\n\t\t\thlstats_Players.flag,\n\t\t\thlstats_Players.lastName AS killerName,\n\t\t\tCOUNT(hlstats_Events_Frags.weapon) AS frags,\n\t\t\tSUM(hlstats_Events_Frags.headshot=1) as headshots,\n\t\t\tIFNULL(SUM(hlstats_Events_Frags.headshot=1) / Count(hlstats_Events_Frags.weapon), '-') AS hpk\n\t\tFROM\n\t\t\thlstats_Events_Frags,\n\t\t\thlstats_Players\n\t\tWHERE\n\t\t\thlstats_Players.playerId = hlstats_Events_Frags.killerId\n\t\t\tAND hlstats_Events_Frags.weapon='{$weapon}'\n\t\t\tAND hlstats_Players.game='{$game}'\n\t\t\tAND hlstats_Players.hideranking<>'1'\n\t\tGROUP BY\n\t\t\thlstats_Events_Frags.killerId\n\t\tORDER BY\n\t\t\t{$table->sort} {$table->sortorder},\n\t\t\t{$table->sort2} {$table->sortorder}\n\t\tLIMIT {$table->startitem},{$table->numperpage}\n\t"); $table->draw($result, 25, 100);
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. For support and installation notes visit http://www.hlxcommunity.com */ if (!defined('IN_HLSTATS')) { die('Do not access this file directly.'); } flush(); $tblMaps = new Table(array(new TableColumn('map', 'Map Name', 'width=15&align=left&link=' . urlencode("mode=mapinfo&map=%k&game={$game}")), new TableColumn('kills', 'Kills', 'width=6&align=right'), new TableColumn('kpercent', 'Percentage of Kills', 'width=15&sort=no&type=bargraph'), new TableColumn('kpercent', '%', 'width=5&sort=no&align=right&append=' . urlencode('%')), new TableColumn('deaths', 'Deaths', 'width=6&align=right'), new TableColumn('kpd', 'Kills per Death', 'width=13&align=right'), new TableColumn('headshots', 'Headshots', 'width=9&align=right'), new TableColumn('hpercent', 'Percentage of Headshots', 'width=16&sort=no&type=bargraph'), new TableColumn('hpercent', '%', 'width=5&sort=no&align=right&append=' . urlencode('%')), new TableColumn('hpk', 'Hpk', 'width=5&align=right')), 'map', 'kills', 'kills', true, 9999, 'maps_page', 'maps_sort', 'maps_sortorder', 'tabmaps', 'desc', true); $db->query("\r\n\t\tCREATE TEMPORARY TABLE tmp_clan_kills\r\n\t\t\tSELECT\r\n\t\t\t\tIF(map='', '(Unaccounted)', map) AS map,\r\n\t\t\t\tCOUNT(*) AS kills,\r\n\t\t\t\tSUM(headshot=1) AS headshots\r\n\t\t\tFROM\r\n\t\t\t\thlstats_Events_Frags, hlstats_Players\r\n\t\t\tWHERE\r\n\t\t\t\thlstats_Players.playerId = hlstats_Events_Frags.killerId\r\n\t\t\t\tAND hlstats_Players.clan = {$clan}\r\n\t\t\tGROUP BY\r\n\t\t\t\tmap;\r\n\t"); $db->query("\r\n\t\tCREATE TEMPORARY TABLE tmp_clan_deaths\r\n\t\t\tSELECT\r\n\t\t\t\tIF(map='', '(Unaccounted)', map) AS map,\r\n\t\t\t\tCOUNT(*) AS deaths\r\n\t\t\tFROM\r\n\t\t\t\thlstats_Events_Frags, hlstats_Players\r\n\t\t\tWHERE\r\n\t\t\t\thlstats_Players.playerId = hlstats_Events_Frags.victimId\r\n\t\t\t\tAND hlstats_Players.clan = {$clan}\r\n\t\t\tGROUP BY\r\n\t\t\t\tmap;\r\n\t"); $result = $db->query("\r\n\t\tSELECT *, \r\n\t\t\tIFNULL(kills/deaths, '-') AS kpd,\r\n\t\t\tIFNULL(headshots / kills, '-') AS hpk,\r\n\t\t\tROUND(kills / {$realkills} * 100, 2) AS kpercent,\r\n\t\t\tROUND(headshots / {$realheadshots} * 100, 2) AS hpercent\r\n\t\tFROM\r\n\t\t\ttmp_clan_kills, tmp_clan_deaths\r\n\t\tWHERE\r\n\t\t\ttmp_clan_kills.map = tmp_clan_deaths.map\r\n\t\tORDER BY\r\n\t\t\t{$tblMaps->sort} {$tblMaps->sortorder},\r\n\t\t\t{$tblMaps->sort2} {$tblMaps->sortorder}\r\n\t"); $numitems = $db->num_rows($result); if ($numitems > 0) { ?> <div style="clear:both;padding-top:20px;"></div> <?php printSectionTitle('Map Performance *'); $tblMaps->draw($result, $db->num_rows($result), 95); ?> <br /><br /> <?php }
but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. For support and installation notes visit http://www.hlxcommunity.com */ if (!defined('IN_HLSTATS')) { die('Do not access this file directly.'); } // Action Statistics $player = valid_request(intval($_GET['player']), 1); $uniqueid = valid_request(strval($_GET['uniqueid']), 0); $db->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(); $tblPlayerActions = new Table(array(new TableColumn('description', 'Action', 'width=45&link=' . urlencode("mode=actioninfo&action=%k&game={$game}")), new TableColumn('obj_count', 'Achieved', 'width=25&align=right&append=+times'), new TableColumn('obj_bonus', 'Skill Bonus', 'width=25&align=right')), 'code', 'obj_count', 'description', true, 9999, 'obj_page', 'obj_sort', 'obj_sortorder'); $db->query("\n\t\tSELECT\n\t\t\tSUM(count)\n\t\tFROM\n\t\t\thlstats_Actions\n\t\tWHERE\n\t\t\thlstats_Actions.game='{$game}'\n\t"); list($totalactions) = $db->fetch_row(); $result = $db->query("\n\t\tSELECT\n\t\t\tcode,\n\t\t\tdescription,\n\t\t\tcount AS obj_count,\n\t\t\treward_player AS obj_bonus\n\t\tFROM\n\t\t\thlstats_Actions\n\t\tWHERE\n\t\t\thlstats_Actions.game='{$game}'\n\t\t\tAND count > 0\n\t\tGROUP BY\n\t\t\thlstats_Actions.id\n\t\tORDER BY\n\t\t\t{$tblPlayerActions->sort} {$tblPlayerActions->sortorder},\n\t\t\t{$tblPlayerActions->sort2} {$tblPlayerActions->sortorder}\n\t"); ?> <?php $tblPlayerActions->draw($result, $db->num_rows($result), 100);
function drawResults($link_player = -1, $link_clan = -1) { global $g_options, $db; if ($link_player == -1) { $link_player = "mode=playerinfo&player=%k"; } if ($link_clan == -1) { $link_clan = "mode=claninfo&clan=%k"; } ?> </div class="block"> <a name="results"></a> <?php printSectionTitle('Search Results'); ?> <br /><br /> <?php $sr_query = preg_replace('/^STEAM_\\d+?\\:/i', '', $this->query); $sr_query = $db->escape($sr_query); $sr_query = preg_replace('/\\s/', '%', $sr_query); if ($this->type == 'player') { $table = new Table(array(new TableColumn('player_id', 'ID', 'width=5&align=right'), new TableColumn('name', 'Player', 'width=65&flag=1&link=' . urlencode($link_player)), new TableColumn('gamename', 'Game', 'width=30')), 'player_id', 'name', 'player_id', false, 50, 'page', 'sort', 'sortorder', 'results', 'asc'); if ($this->game) { $andgame = "AND hlstats_Players.game='" . $this->game . "'"; } else { $andgame = ''; } $result = $db->query("\r\n\t\t\t\t\tSELECT\r\n\t\t\t\t\t\thlstats_PlayerNames.playerId AS player_id,\r\n\t\t\t\t\t\thlstats_PlayerNames.name,\r\n\t\t\t\t\t\thlstats_Players.flag,\r\n\t\t\t\t\t\thlstats_Players.country,\r\n\t\t\t\t\t\thlstats_Games.name AS gamename\r\n\t\t\t\t\tFROM\r\n\t\t\t\t\t\thlstats_PlayerNames\r\n\t\t\t\t\tLEFT JOIN\r\n\t\t\t\t\t\thlstats_Players\r\n\t\t\t\t\tON\r\n\t\t\t\t\t\thlstats_Players.playerId = hlstats_PlayerNames.playerId\r\n\t\t\t\t\tLEFT JOIN\r\n\t\t\t\t\t\thlstats_Games\r\n\t\t\t\t\tON\r\n\t\t\t\t\t\thlstats_Games.code = hlstats_Players.game\r\n\t\t\t\t\tWHERE\r\n\t\t\t\t\t\thlstats_Games.hidden = '0'\r\n\t\t\t\t\t\tAND hlstats_PlayerNames.name LIKE '%{$sr_query}%'\r\n\t\t\t\t\t\t{$andgame}\r\n\t\t\t\t\tORDER BY\r\n\t\t\t\t\t\t{$table->sort} {$table->sortorder},\r\n\t\t\t\t\t\t{$table->sort2} {$table->sortorder}\r\n\t\t\t\t\tLIMIT\r\n\t\t\t\t\t\t{$table->startitem},\r\n\t\t\t\t\t\t{$table->numperpage}\r\n\t\t\t\t"); $resultCount = $db->query("\r\n\t\t\t\t\tSELECT\r\n\t\t\t\t\t\tCOUNT(*)\r\n\t\t\t\t\tFROM\r\n\t\t\t\t\t\thlstats_PlayerNames\r\n\t\t\t\t\tLEFT JOIN\r\n\t\t\t\t\t\thlstats_Players\r\n\t\t\t\t\tON\r\n\t\t\t\t\t\thlstats_Players.playerId = hlstats_PlayerNames.playerId\r\n\t\t\t\t\tLEFT JOIN\r\n\t\t\t\t\t\thlstats_Games\r\n\t\t\t\t\tON\r\n\t\t\t\t\t\thlstats_Games.code = hlstats_Players.game\r\n\t\t\t\t\tWHERE\r\n\t\t\t\t\t\thlstats_Games.hidden = '0'\r\n\t\t\t\t\t\tAND hlstats_PlayerNames.name LIKE '%{$sr_query}%'\r\n\t\t\t\t\t\t{$andgame}\r\n\t\t\t\t"); list($numitems) = $db->fetch_row($resultCount); $table->draw($result, $numitems, 95); } elseif ($this->type == 'uniqueid') { $table = new Table(array(new TableColumn('uniqueId', $this->uniqueid_string, 'width=15'), new TableColumn('lastName', 'Player', 'width=50&flag=1&link=' . urlencode($link_player)), new TableColumn('gamename', 'Game', 'width=30'), new TableColumn('playerId', 'ID', 'width=5&align=right')), 'playerId', 'lastName', 'uniqueId', false, 50, 'page', 'sort', 'sortorder', 'results', 'asc'); if ($this->game) { $andgame = "AND hlstats_PlayerUniqueIds.game='" . $this->game . "'"; } else { $andgame = ''; } $result = $db->query("\r\n\t\t\t\t\tSELECT\r\n\t\t\t\t\t\thlstats_PlayerUniqueIds.uniqueId,\r\n\t\t\t\t\t\thlstats_PlayerUniqueIds.playerId,\r\n\t\t\t\t\t\thlstats_Players.lastName,\r\n\t\t\t\t\t\thlstats_Players.flag,\r\n\t\t\t\t\t\thlstats_Players.country,\r\n\t\t\t\t\t\thlstats_Games.name AS gamename\r\n\t\t\t\t\tFROM\r\n\t\t\t\t\t\thlstats_PlayerUniqueIds\r\n\t\t\t\t\tLEFT JOIN\r\n\t\t\t\t\t\thlstats_Players\r\n\t\t\t\t\tON\r\n\t\t\t\t\t\thlstats_Players.playerId = hlstats_PlayerUniqueIds.playerId\r\n\t\t\t\t\tLEFT JOIN\r\n\t\t\t\t\t\thlstats_Games\r\n\t\t\t\t\tON\r\n\t\t\t\t\t\thlstats_Games.code = hlstats_PlayerUniqueIds.game\r\n\t\t\t\t\tWHERE\r\n\t\t\t\t\t\thlstats_Games.hidden = '0' AND\r\n\t\t\t\t\t\thlstats_PlayerUniqueIds.uniqueId LIKE '%{$sr_query}%'\r\n\t\t\t\t\t\t{$andgame}\r\n\t\t\t\t\tORDER BY\r\n\t\t\t\t\t\t{$table->sort} {$table->sortorder},\r\n\t\t\t\t\t\t{$table->sort2} {$table->sortorder}\r\n\t\t\t\t\tLIMIT\r\n\t\t\t\t\t\t{$table->startitem},\r\n\t\t\t\t\t\t{$table->numperpage}\r\n\t\t\t\t"); $resultCount = $db->query("\r\n\t\t\t\t\tSELECT\r\n\t\t\t\t\t\tCOUNT(*)\r\n\t\t\t\t\tFROM\r\n\t\t\t\t\t\thlstats_PlayerUniqueIds\r\n\t\t\t\t\tLEFT JOIN\r\n\t\t\t\t\t\thlstats_Players\r\n\t\t\t\t\tON\r\n\t\t\t\t\t\thlstats_Players.playerId = hlstats_PlayerUniqueIds.playerId\r\n\t\t\t\t\tWHERE\r\n\t\t\t\t\t\thlstats_PlayerUniqueIds.uniqueId LIKE '%{$sr_query}%'\r\n\t\t\t\t\t\t{$andgame}\r\n\t\t\t\t"); list($numitems) = $db->fetch_row($resultCount); $table->draw($result, $numitems, 95); } elseif ($this->type == 'ip') { if (!isset($_SESSION['loggedin']) || $_SESSION['acclevel'] < 80) { die("Access denied!"); } $table = new Table(array(new TableColumn('player_id', 'ID', 'width=5&align=right'), new TableColumn('name', 'Player', 'width=65&flag=1&link=' . urlencode($link_player)), new TableColumn('gamename', 'Game', 'width=30')), 'player_id', 'name', 'player_id', false, 50, 'page', 'sort', 'sortorder', 'results', 'asc'); if ($this->game) { $andgame = "AND hlstats_Players.game='" . $this->game . "'"; } else { $andgame = ''; } $result = $db->query("\r\n\t\t\t\t\tSELECT\r\n\t\t\t\t\t\tconnects.playerId AS player_id,\r\n\t\t\t\t\t\thlstats_Players.lastname AS name,\r\n\t\t\t\t\t\thlstats_Players.flag,\r\n\t\t\t\t\t\thlstats_Players.country,\r\n\t\t\t\t\t\thlstats_Games.name AS gamename\r\n\t\t\t\t\tFROM\r\n\t\t\t\t\t\t(\r\n\t\t\t\t\t\t\tSELECT\r\n\t\t\t\t\t\t\t\tplayerId,\r\n\t\t\t\t\t\t\t\tipAddress\r\n\t\t\t\t\t\t\tFROM\r\n\t\t\t\t\t\t\t\t`hlstats_Events_Connects`\r\n\t\t\t\t\t\t\tGROUP BY\r\n\t\t\t\t\t\t\t\tplayerId,\r\n\t\t\t\t\t\t\t\tipAddress\r\n\t\t\t\t\t\t) AS connects\r\n\t\t\t\t\tLEFT JOIN\r\n\t\t\t\t\t\thlstats_Players\r\n\t\t\t\t\tON\r\n\t\t\t\t\t\thlstats_Players.playerId = connects.playerId\r\n\t\t\t\t\tLEFT JOIN\r\n\t\t\t\t\t\thlstats_Games\r\n\t\t\t\t\tON\r\n\t\t\t\t\t\thlstats_Games.code = hlstats_Players.game\r\n\t\t\t\t\tWHERE\r\n\t\t\t\t\t\thlstats_Games.hidden = '0'\r\n\t\t\t\t\t\tAND connects.ipAddress LIKE '{$sr_query}%'\r\n\t\t\t\t\t\t{$andgame}\r\n\t\t\t\t\tORDER BY\r\n\t\t\t\t\t\t{$table->sort} {$table->sortorder},\r\n\t\t\t\t\t\t{$table->sort2} {$table->sortorder}\r\n\t\t\t\t\tLIMIT\r\n\t\t\t\t\t\t{$table->startitem},\r\n\t\t\t\t\t\t{$table->numperpage}\r\n\t\t\t\t"); $resultCount = $db->query("\r\n\t\t\t\t\tSELECT\r\n\t\t\t\t\t\tCOUNT(*)\r\n\t\t\t\t\tFROM\r\n\t\t\t\t\t\t(\r\n\t\t\t\t\t\t\tSELECT\r\n\t\t\t\t\t\t\t\tplayerId,\r\n\t\t\t\t\t\t\t\tipAddress\r\n\t\t\t\t\t\t\tFROM\r\n\t\t\t\t\t\t\t\t`hlstats_Events_Connects`\r\n\t\t\t\t\t\t\tGROUP BY\r\n\t\t\t\t\t\t\t\tplayerId,\r\n\t\t\t\t\t\t\t\tipAddress\r\n\t\t\t\t\t\t) AS connects\r\n\t\t\t\t\tLEFT JOIN\r\n\t\t\t\t\t\thlstats_Players\r\n\t\t\t\t\tON\r\n\t\t\t\t\t\thlstats_Players.playerId = connects.playerId\r\n\t\t\t\t\tLEFT JOIN\r\n\t\t\t\t\t\thlstats_Games\r\n\t\t\t\t\tON\r\n\t\t\t\t\t\thlstats_Games.code = hlstats_Players.game\r\n\t\t\t\t\tWHERE\r\n\t\t\t\t\t\thlstats_Games.hidden = '0'\r\n\t\t\t\t\t\tAND connects.ipAddress LIKE '{$sr_query}%'\r\n\t\t\t\t\t\t{$andgame}\r\n\t\t\t\t"); list($numitems) = $db->fetch_row($resultCount); $table->draw($result, $numitems, 95); } elseif ($this->type == 'clan') { $table = new Table(array(new TableColumn('tag', 'Tag', 'width=15'), new TableColumn('name', 'Name', 'width=50&icon=clan&link=' . urlencode($link_clan)), new TableColumn('gamename', 'Game', 'width=30'), new TableColumn('clanId', 'ID', 'width=5&align=right')), 'clanId', 'name', 'tag', false, 50, 'page', 'sort', 'sortorder', 'results', 'asc'); if ($this->game) { $andgame = "AND hlstats_Clans.game='" . $this->game . "'"; } else { $andgame = ""; } $result = $db->query("\r\n\t\t\t\t\tSELECT\r\n\t\t\t\t\t\thlstats_Clans.clanId,\r\n\t\t\t\t\t\thlstats_Clans.tag,\r\n\t\t\t\t\t\thlstats_Clans.name,\r\n\t\t\t\t\t\thlstats_Games.name AS gamename\r\n\t\t\t\t\tFROM\r\n\t\t\t\t\t\thlstats_Clans\r\n\t\t\t\t\tLEFT JOIN hlstats_Games ON\r\n\t\t\t\t\t\thlstats_Games.code = hlstats_Clans.game\r\n\t\t\t\t\tWHERE\r\n\t\t\t\t\t\thlstats_Games.hidden = '0'\r\n\t\t\t\t\t\tAND (\r\n\t\t\t\t\t\t\thlstats_Clans.tag LIKE '%{$sr_query}%'\r\n\t\t\t\t\t\t\tOR hlstats_Clans.name LIKE '%{$sr_query}%'\r\n\t\t\t\t\t\t)\r\n\t\t\t\t\t\t{$andgame}\r\n\t\t\t\t\tORDER BY\r\n\t\t\t\t\t\t{$table->sort} {$table->sortorder},\r\n\t\t\t\t\t\t{$table->sort2} {$table->sortorder}\r\n\t\t\t\t\tLIMIT\r\n\t\t\t\t\t\t{$table->startitem},\r\n\t\t\t\t\t\t{$table->numperpage}\r\n\t\t\t\t"); $resultCount = $db->query("\r\n\t\t\t\t\tSELECT\r\n\t\t\t\t\t\tCOUNT(*)\r\n\t\t\t\t\tFROM\r\n\t\t\t\t\t\thlstats_Clans\r\n\t\t\t\t\tWHERE\r\n\t\t\t\t\t\thlstats_Clans.tag LIKE '%{$sr_query}%'\r\n\t\t\t\t\t\tOR hlstats_Clans.name LIKE '%{$sr_query}%'\r\n\t\t\t\t\t\t{$andgame}\r\n\t\t\t\t"); list($numitems) = $db->fetch_row($resultCount); $table->draw($result, $numitems, 95); } ?> <br /><br /> <div class="subblock" style="text-align:center;"> Search results: <strong><?php echo $numitems; ?> </strong> items matching </div> </div> <?php }
} // // 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("\n\t\t\tSELECT\n\t\t\t\tplayerId,\n\t\t\t\tlastName,\n\t\t\t\tconnection_time,\n\t\t\t\tskill,\n\t\t\t\tflag,\n\t\t\t\tcountry,\n\t\t\t\tIFNULL(kills/deaths, '-') AS kpd,\n\t\t\t\tIFNULL(headshots/kills, '-') AS hpk,\n\t\t\t\tactivity\n\t\t\tFROM\n\t\t\t\thlstats_Players\n\t\t\tWHERE\n\t\t\t\tgame='{$game}'\n\t\t\t\tAND hideranking=0\n\t\t\t\tAND kills >= {$minkills}\n\t\t\tORDER BY\n\t\t\t\t{$table_players->sort} {$table_players->sortorder}\n\t\t\tLIMIT 0,{$players}\n\t\t"); $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("\n\t\t\tSELECT\n\t\t\t\thlstats_Clans.clanId,\n\t\t\t\thlstats_Clans.name,\n\t\t\t\thlstats_Clans.tag,\n\t\t\t\tCOUNT(hlstats_Players.playerId) AS nummembers,\n\t\t\t\tROUND(AVG(hlstats_Players.skill)) AS skill,\n\t\t\t\tTRUNCATE(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\n\t\t\tFROM\n\t\t\t\thlstats_Clans\n\t\t\tLEFT JOIN hlstats_Players ON\n\t\t\t\thlstats_Players.clan=hlstats_Clans.clanId\n\t\t\tWHERE\n\t\t\t\thlstats_Clans.game='{$game}'\n\t\t\t\tAND hlstats_Clans.hidden <> 1\n\t\t\t\tAND hlstats_Players.hideranking = 0\n\t\t\t\tAND 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\n\t\t\tGROUP BY\n\t\t\t\thlstats_Clans.clanId\n\t\t\tHAVING\n\t\t\t\tactivity >= 0 AND\n\t\t\t\tnummembers >= {$minmembers}\n\t\t\tORDER BY\n\t\t\t\t{$table_clans->sort} {$table_clans->sortorder}\n\t\t\tLIMIT 0,{$clans}\n\t\t"); $table_clans->draw($result_clans, 3, 100); } // // Servers // if ($servers > 0) { ?> <table class="data-table" > <tr class="data-table-head"> <td style="width:50%;" class="fSmall"> Participating Servers</td> <td style="width:20%;" class="fSmall"> Address</td> <td style="width:10%;text-align:center;" class="fSmall"> Map</td> <td style="width:10%;text-align:center;" class="fSmall"> Played</td> <td style="width:10%;" class="fSmall"> Players</td> </tr>
public static function table($object, $fields, $instances) { if (count($instances)) { $table = new Table(); $table->rows($instances); foreach ($fields as $field) { $table->column($field->name, $field->type, $field->title, $field->width, $field->height); } $table->column('updated_at', 'updated_at', trans('avalon::messages.site_updated_at')); if ($object->can_edit) { $table->deletable(); if ($object->order_by == 'precedence') { $table->draggable(URL::action('InstanceController@reorder', $object->name)); } } if (!empty($object->group_by_field)) { $table->groupBy('group'); } return $table->draw(); } }
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. For support and installation notes visit http://www.hlxcommunity.com */ if (!defined('IN_HLSTATS')) { die('Do not access this file directly.'); } // Clan Rankings $db->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(); if (isset($_GET['minmembers'])) { $minmembers = valid_request(intval($_GET['minmembers']), 1); } else { $minmembers = 3; } $table = new Table(array(new TableColumn('name', 'Clan', 'width=25&icon=clan&link=' . urlencode('mode=claninfo&clan=%k')), new TableColumn('tag', 'Tag', 'width=15&align=center'), new TableColumn('skill', 'Avg. Points', 'width=8&align=right&skill_change=1'), new TableColumn('nummembers', 'Members', 'width=5&align=right'), new TableColumn('activity', 'Activity', 'width=8&type=bargraph'), new TableColumn('connection_time', 'Connection Time', 'width=13&align=right&type=timestamp'), new TableColumn('kills', 'Kills', 'width=7&align=right'), new TableColumn('deaths', 'Deaths', 'width=7&align=right'), new TableColumn('kpd', 'K:D', 'width=7&align=right')), 'clanId', 'skill', 'kpd', true); $result = $db->query("\n\t\tSELECT\n\t\t\thlstats_Clans.clanId,\n\t\t\thlstats_Clans.name,\n\t\t\thlstats_Clans.tag,\n\t\t\tCOUNT(hlstats_Players.playerId) AS nummembers,\n\t\t\tSUM(hlstats_Players.kills) AS kills,\n\t\t\tSUM(hlstats_Players.deaths) AS deaths,\n\t\t\tSUM(hlstats_Players.connection_time) AS connection_time,\n\t\t\tROUND(AVG(hlstats_Players.skill)) AS skill,\n\t\t\tIFNULL(SUM(hlstats_Players.kills)/SUM(hlstats_Players.deaths), '-') AS kpd,\n\t\t\tTRUNCATE(AVG(activity),2) as activity\n\t\tFROM\n\t\t\thlstats_Clans,\n\t\t\thlstats_Players\n\t\tWHERE\n\t\t\thlstats_Clans.game = '{$game}'\n\t\t\tAND hlstats_Clans.hidden <> 1\n\t\t\tAND hlstats_Players.clan = hlstats_Clans.clanId\n\t\t\tAND hlstats_Players.hideranking = 0\n\t\tGROUP BY\n\t\t\thlstats_Clans.clanId\n\t\tHAVING\n\t\t\tactivity >= 0 AND\n\t\t\tnummembers >= {$minmembers}\n\t\tORDER BY\n\t\t\t{$table->sort} {$table->sortorder},\n\t\t\t{$table->sort2} {$table->sortorder},\n\t\t\tname ASC\n\t\tLIMIT\n\t\t\t{$table->startitem},{$table->numperpage}\n\t"); $resultCount = $db->query("\n\t\tSELECT\n\t\t\thlstats_Clans.clanId,\n\t\t\tSUM(activity) as activity\n\t\tFROM\n\t\t\thlstats_Clans\n\t\tLEFT JOIN\n\t\t\thlstats_Players\n\t\tON\n\t\t\thlstats_Players.clan = hlstats_Clans.clanId\n\t\tWHERE\n\t\t\thlstats_Clans.game = '{$game}'\n\t\t\tAND hlstats_Clans.hidden <> 1\n\t\t\tAND hlstats_Players.hideranking = 0\n\t\tGROUP BY\n\t\t\thlstats_Clans.clanId\n\t\tHAVING\n\t\t\tactivity >= 0 AND\n\t\t\tCOUNT(hlstats_Players.playerId) >= {$minmembers}\n\t"); $table->draw($result, $db->num_rows($resultCount), 100);
// support them yet. (NOTE you need MySQL 3.23 for temporary table support.) $db->query("\r\n\t\tDROP TABLE IF EXISTS\r\n\t\t\thlstats_Frags_Kills\r\n\t"); $db->query("\r\n\t\tCREATE TEMPORARY TABLE\r\n\t\t\thlstats_Frags_Kills\r\n\t\t\t(\r\n\t\t\t\tplayerId INT(10),\r\n\t\t\t\tkills INT(10),\r\n\t\t\t\tdeaths INT(10),\r\n\t\t\t\theadshot INT(10),\r\n\t\t\t\tcountry varchar(128),\r\n\t\t\t\tflag char(2)\r\n\t\t\t)\r\n\t"); $db->query("\r\n\t\tINSERT INTO\r\n\t\t\thlstats_Frags_Kills\r\n\t\t\t(\r\n\t\t\t\tplayerId,\r\n\t\t\t\tkills,\r\n\t\t\t\theadshot\r\n\t\t\t)\r\n\t\tSELECT\r\n\t\t\thlstats_Events_Frags.victimId,\r\n\t\t\thlstats_Events_Frags.killerId,\r\n\t\t\thlstats_Events_Frags.headshot\r\n\t\tFROM\r\n\t\t\thlstats_Events_Frags\r\n\t\tWHERE\r\n\t\t\thlstats_Events_Frags.killerId = {$player}\r\n\t\tGROUP BY\r\n\t\t\thlstats_Events_Frags.id\r\n\t"); $db->query("\r\n\t\tINSERT INTO\r\n\t\t\thlstats_Frags_Kills\r\n\t\t\t(\r\n\t\t\t\tplayerId,\r\n\t\t\t\tdeaths\r\n\t\t\t)\r\n\t\tSELECT\r\n\t\t\thlstats_Events_Frags.killerId,\r\n\t\t\thlstats_Events_Frags.victimId\r\n\t\tFROM\r\n\t\t\thlstats_Events_Frags\r\n\t\tWHERE\r\n\t\t\thlstats_Events_Frags.victimId = {$player}\r\n\t"); $result = $db->query("\r\n\t\t\tSELECT\r\n\t\t\t\tSUM(hlstats_Frags_Kills.headshot) AS headshots\r\n\t\t\tFROM\r\n\t\t\t\thlstats_Frags_Kills\r\n\t\t\tGROUP BY\r\n\t\t\t\thlstats_Frags_Kills.playerId\r\n\t\t\tHAVING\r\n\t\t\t\tCOUNT(hlstats_Frags_Kills.kills) >= {$killLimit}\r\n\t"); $realheadshots = 0; while ($rowdata = $db->fetch_array($result)) { $realheadshots += $rowdata['headshots']; } $db->query("\r\n\t\tSELECT\r\n\t\t\thlstats_Players.lastName AS name\r\n\t\tFROM\r\n\t\t\thlstats_Frags_Kills,\r\n\t\t\thlstats_Players\r\n\t\tWHERE\r\n\t\t\thlstats_Frags_Kills.playerId = hlstats_Players.playerId\r\n\t\tGROUP BY\r\n\t\t\thlstats_Frags_Kills.playerId\r\n\t\tHAVING\r\n\t\t\tCOUNT(hlstats_Frags_Kills.kills) >= {$killLimit}\r\n\t"); $numitems = $db->num_rows(); $result = $db->query("\r\n\t\tSELECT\r\n\t\t\thlstats_Players.lastName AS name,\r\n\t\t\thlstats_Players.flag AS flag,\r\n\t\t\thlstats_Players.country AS country,\r\n\t\t\tCOUNT(hlstats_Frags_Kills.kills) AS kills,\r\n\t\t\tCOUNT(hlstats_Frags_Kills.deaths) AS deaths,\r\n\t\t\tROUND(COUNT(hlstats_Frags_Kills.kills) / {$realkills} * 100, 2) AS kpercent,\r\n\t\t\tROUND(COUNT(hlstats_Frags_Kills.deaths) / {$realdeaths} * 100, 2) AS dpercent,\r\n\t\t\thlstats_Frags_Kills.playerId AS victimId,\r\n\t\t\tROUND(COUNT(hlstats_Frags_Kills.kills) / IF(COUNT(hlstats_Frags_Kills.deaths) = 0, 1, COUNT(hlstats_Frags_Kills.deaths)), 2) AS kpd,\r\n\t\t\tSUM(hlstats_Frags_Kills.headshot = 1) AS headshots,\r\n\t\t\tROUND(SUM(hlstats_Frags_Kills.headshot = 1) / IF(COUNT(hlstats_Frags_Kills.kills) = 0, 1, COUNT(hlstats_Frags_Kills.kills)), 2) AS hpk,\r\n\t\t\tROUND(SUM(hlstats_Frags_Kills.headshot = 1) / {$realheadshots} * 100, 2) AS hpercent\r\n\t\tFROM\r\n\t\t\thlstats_Frags_Kills,\r\n\t\t\thlstats_Players\r\n\t\tWHERE\r\n\t\t\thlstats_Frags_Kills.playerId = hlstats_Players.playerId\r\n\t\tGROUP BY\r\n\t\t\thlstats_Frags_Kills.playerId\r\n\t\tHAVING\r\n\t\t\tCount(hlstats_Frags_Kills.kills) >= {$killLimit}\r\n\t\tORDER BY\r\n\t\t\t{$tblPlayerKillStats->sort} {$tblPlayerKillStats->sortorder},\r\n\t\t\t{$tblPlayerKillStats->sort2} {$tblPlayerKillStats->sortorder}\r\n\t\tLIMIT {$tblPlayerKillStats->startitem},{$tblPlayerKillStats->numperpage}\r\n\t"); if ($numitems > 0) { printSectionTitle('Player Kill Statistics *'); $tblPlayerKillStats->draw($result, $numitems, 95); ?> <br /><br /> <div class="subblock"> <form method="get" action="<?php echo $g_options['scripturl']; ?> "> <strong>•</strong> Show only victims this person has killed <select name="killLimit" onchange="Tabs.refreshTab({'killLimit': this.options[this.selectedIndex].value, 'playerkills_page': 1})"> <?php for ($j = 0; $j < 16; $j++) { echo "<option value=\"{$j}\""; if ($killLimit == $j) { echo ' selected="selected"'; }
<div class="block"> <?php printSectionTitle('Role Statistics'); ?> <div class="subblock"> From a total of <strong><?php echo number_format($realkills); ?> </strong> kills with <strong><?php echo number_format($realdeaths); ?> </strong> deaths </div> <br /><br /> <?php $tblRoles->draw($result, $db->num_rows($result), 95); ?> <br /><br /> <div class="subblock"> <div style="float:right;"> Go to: <a href="<?php echo $g_options['scripturl'] . "?game={$game}"; ?> "><?php echo $gamename; ?> </a> </div> </div> </div>
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. For support and installation notes visit http://www.hlxcommunity.com */ if (!defined('IN_HLSTATS')) { die('Do not access this file directly.'); } flush(); $tblAliases = new Table(array(new TableColumn('name', 'Name', 'width=21'), new TableColumn('connection_time', 'Time', 'width=8&align=right&type=timestamp'), new TableColumn('lastuse', 'Last Use', 'width=15'), new TableColumn('kills', 'Kills', 'width=7&align=right'), new TableColumn('deaths', 'Deaths', 'width=7&align=right'), new TableColumn('kpd', 'K:D', 'width=11&align=right'), new TableColumn('headshots', 'Headshots', 'width=8&align=right'), new TableColumn('hpk', 'HS:K', 'width=6&align=right'), new TableColumn('suicides', 'Suicides', 'width=6&align=right'), new TableColumn('acc', 'Accuracy', 'width=6&align=right&append=' . urlencode('%'))), 'name', 'lastuse', 'name', true, 20, 'aliases_page', 'aliases_sort', 'aliases_sortorder', 'tabteams', 'desc', true); $result = $db->query("\r\n\t\tSELECT\r\n\t\t\thlstats_PlayerNames.name,\r\n\t\t\thlstats_PlayerNames.connection_time,\r\n\t\t\thlstats_PlayerNames.lastuse,\r\n\t\t\thlstats_PlayerNames.numuses,\r\n\t\t\thlstats_PlayerNames.kills,\r\n\t\t\thlstats_PlayerNames.deaths,\r\n\t\t\tIFNULL(ROUND(hlstats_PlayerNames.kills / IF(hlstats_PlayerNames.deaths = 0, 1, hlstats_PlayerNames.deaths), 2), '-') AS kpd,\r\n\t\t\thlstats_PlayerNames.headshots,\r\n\t\t\tIFNULL(ROUND(hlstats_PlayerNames.headshots / hlstats_PlayerNames.kills, 2), '-') AS hpk,\r\n\t\t\thlstats_PlayerNames.suicides,\r\n\t\t\tIFNULL(ROUND(hlstats_PlayerNames.hits / hlstats_PlayerNames.shots * 100, 1), 0.0) AS acc\r\n\t\tFROM\r\n\t\t\thlstats_PlayerNames\r\n\t\tWHERE\r\n\t\t\thlstats_PlayerNames.playerId = {$player}\r\n\t\tORDER BY\r\n\t\t\t{$tblAliases->sort} {$tblAliases->sortorder}\r\n\t\tLIMIT\r\n\t\t\t{$tblAliases->startitem},\r\n\t\t\t{$tblAliases->numperpage}\r\n\t"); $resultCount = $db->query("\r\n\t\tSELECT\r\n\t\t\tCOUNT(*)\r\n\t\tFROM\r\n\t\t\thlstats_PlayerNames\r\n\t\tWHERE\r\n\t\t\thlstats_PlayerNames.playerId = {$player}\r\n\t"); list($numitems) = $db->fetch_row($resultCount); if ($numitems > 1) { ?> <div style="clear:both;padding-top:24px;"></div> <?php printSectionTitle('Aliases'); if ($numitems > 0) { $tblAliases->draw($result, $numitems, 95); } ?> <br /><br /> <?php }