query(" SELECT hlstats_Clans.tag, hlstats_Clans.name, hlstats_Clans.homepage, hlstats_Clans.game, hlstats_Clans.mapregion, SUM(hlstats_Players.kills) AS kills, SUM(hlstats_Players.deaths) AS deaths, SUM(hlstats_Players.headshots) AS headshots, SUM(hlstats_Players.connection_time) AS connection_time, COUNT(hlstats_Players.playerId) AS nummembers, ROUND(AVG(hlstats_Players.skill)) AS avgskill, TRUNCATE(AVG(activity),2) as activity FROM hlstats_Clans LEFT JOIN hlstats_Players ON hlstats_Players.clan = hlstats_Clans.clanId WHERE hlstats_Clans.clanId=$clan AND hlstats_Players.hideranking = 0 GROUP BY hlstats_Clans.clanId "); if ($db->num_rows() != 1) { error("No such clan '$clan'."); } $clandata = $db->fetch_array(); $realkills = ($clandata['kills'] == 0) ? 1 : $clandata['kills']; $realheadshots = ($clandata['headshots'] == 0) ? 1 : $clandata['headshots']; $db->query(" SELECT count(playerId) FROM hlstats_Players WHERE clan=$clan GROUP BY clan "); list($totalclanplayers) = $db->fetch_array(); $db->free_result(); $cl_name = preg_replace('/\s/', ' ', htmlspecialchars($clandata['name'])); $cl_tag = preg_replace('/\s/', ' ', htmlspecialchars($clandata['tag'])); $cl_full = "$cl_tag $cl_name"; $game = $clandata['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(); } if ( $_GET['type'] == 'ajax' ) { unset($_GET['type']); $tabs = explode('|', preg_replace('[^a-z]', '', $_GET['tab'])); foreach ( $tabs as $tab ) { if ( file_exists(PAGE_PATH . '/claninfo_' . $tab . '.php') ) { @include(PAGE_PATH . '/claninfo_' . $tab . '.php'); } } exit; } pageHeader( array($gamename, 'Clan Details', $cl_full), array( $gamename=>$g_options['scripturl'] . "?game=$game", 'Clan Rankings'=>$g_options['scripturl'] . "?mode=clans&game=$game", 'Clan Details'=>'' ), $clandata['name'] ); if ( $g_options['show_google_map'] == 1 ) { echo (''); } ?>