From 7abeb203d8b6d537a55b0dd9a1ccac32e6f948ec Mon Sep 17 00:00:00 2001 From: Matthijs Kuiper Date: Sat, 4 Feb 2017 23:57:49 +0100 Subject: [PATCH] Fix MySQL ONLY_FULL_GROUP_BY errors --- html/pages/graph_mbreakdown.php | 48 +++++---- html/pages/home.php | 13 ++- html/pages/match.php | 4 +- html/pages/match_info.php | 9 +- html/pages/match_info_other.php | 61 ++++++----- html/pages/match_player.php | 125 +++++++++++---------- html/pages/players_info.php | 2 +- html/pages/totals.php | 185 +++++++++++++++++--------------- 8 files changed, 243 insertions(+), 204 deletions(-) diff --git a/html/pages/graph_mbreakdown.php b/html/pages/graph_mbreakdown.php index 44ef717..1f386fe 100755 --- a/html/pages/graph_mbreakdown.php +++ b/html/pages/graph_mbreakdown.php @@ -3,28 +3,32 @@ // Hourly Breakdown $sql_ghours = "SELECT HOUR(time) AS res_hour, COUNT(*) AS res_count -FROM uts_match WHERE $bgwhere GROUP by res_hour"; + FROM uts_match + WHERE $bgwhere + GROUP by res_hour"; $q_ghours = mysql_query($sql_ghours) or die(mysql_error()); $hour_max = 0; $hour_sum = 0; while ($r_ghours = mysql_fetch_array($q_ghours)) { - $gb_hour[$r_ghours['res_hour']] = $r_ghours['res_count']; - if ($r_ghours['res_count'] > $hour_max) $hour_max = $r_ghours['res_count']; - $hour_sum += $r_ghours['res_count']; + $gb_hour[$r_ghours['res_hour']] = $r_ghours['res_count']; + if ($r_ghours['res_count'] > $hour_max) $hour_max = $r_ghours['res_count']; + $hour_sum += $r_ghours['res_count']; } if ($hour_max == 0) return; // Daily Breakdown // We use WEEKDAY rather then DAYOFWEEK because now the week starts with Monday instead of Sunday $sql_gdays = "SELECT WEEKDAY(time) AS res_day, COUNT(*) AS res_count -FROM uts_match WHERE $bgwhere GROUP by res_day"; + FROM uts_match + WHERE $bgwhere + GROUP by res_day"; $q_gdays = mysql_query($sql_gdays) or die(mysql_error()); $day_max = 0; $day_sum = 0; while ($r_gdays = mysql_fetch_array($q_gdays)) { - $gb_day[$r_gdays['res_day']] = $r_gdays['res_count']; - if ($r_gdays['res_count'] > $day_max) $day_max = $r_gdays['res_count']; - $day_sum += $r_gdays['res_count']; + $gb_day[$r_gdays['res_day']] = $r_gdays['res_count']; + if ($r_gdays['res_count'] > $day_max) $day_max = $r_gdays['res_count']; + $day_sum += $r_gdays['res_count']; } // Monthly Breakdown @@ -34,9 +38,9 @@ $month_max = 0; $month_sum = 0; while ($r_gmonths = mysql_fetch_array($q_gmonths)) { - $gb_month[$r_gmonths['res_month']] = $r_gmonths['res_count']; - if ($r_gmonths['res_count'] > $month_max) $month_max = $r_gmonths['res_count']; - $month_sum += $r_gmonths['res_count']; + $gb_month[$r_gmonths['res_month']] = $r_gmonths['res_count']; + if ($r_gmonths['res_count'] > $month_max) $month_max = $r_gmonths['res_count']; + $month_sum += $r_gmonths['res_count']; } // very dirty hack, to deal with the $bgwhere containing an OR @@ -54,19 +58,23 @@ } // Country Breakdown -$sql_gcountries = "SELECT country AS res_country, COUNT(*) AS res_count FROM - (SELECT p.country AS country FROM uts_player AS p, uts_match AS m - WHERE m.id = p.matchid AND $bgwhere GROUP BY p.pid) AS res_table -GROUP BY res_country ORDER BY res_count DESC"; +$sql_gcountries = "SELECT country AS res_country, COUNT(*) AS res_count +FROM (SELECT p.country AS country + FROM uts_player AS p, uts_match AS m + WHERE m.id = p.matchid AND $bgwhere + GROUP BY p.pid, p.country) AS res_table +GROUP BY res_country +ORDER BY res_count DESC"; + $q_gcountries = mysql_query($sql_gcountries) or die(mysql_error()); $country_max = 0; $country_sum = 0; $i = 0; while ($r_gcountries = mysql_fetch_array($q_gcountries)) { - $gb_country[$i] = $r_gcountries['res_country'] . ";" . $r_gcountries['res_count']; - if ($r_gcountries['res_count'] > $country_max) $country_max = $r_gcountries['res_count']; - $country_sum += $r_gcountries['res_count']; - $i++; + $gb_country[$i] = $r_gcountries['res_country'] . ";" . $r_gcountries['res_count']; + if ($r_gcountries['res_count'] > $country_max) $country_max = $r_gcountries['res_count']; + $country_sum += $r_gcountries['res_count']; + $i++; } echo' @@ -226,4 +234,4 @@
'; -?> \ No newline at end of file +?> diff --git a/html/pages/home.php b/html/pages/home.php index 3cb167d..be75b66 100755 --- a/html/pages/home.php +++ b/html/pages/home.php @@ -57,10 +57,14 @@ '; $sql_gamesummary = "SELECT g.id AS gid, g.name AS gamename, SUM(p.frags) AS frags, SUM(p.kills) AS kills, SUM(p.suicides) AS suicides, SUM(p.teamkills) AS teamkills, COUNT(DISTINCT p.matchid) AS matchcount -FROM uts_player AS p, uts_games AS g WHERE p.gid = g.id GROUP BY gamename ORDER BY gamename ASC"; +FROM uts_player AS p, uts_games AS g +WHERE p.gid = g.id +GROUP BY gamename, gid +ORDER BY gamename ASC"; + $q_gamesummary = mysql_query($sql_gamesummary) or die(mysql_error()); -while ($r_gamesummary = mysql_fetch_array($q_gamesummary)) { +while ($r_gamesummary = mysql_fetch_array($q_gamesummary)) { $gid = $r_gamesummary[gid]; $q_gametime = small_query("SELECT SUM(gametime) AS gametime FROM uts_match WHERE gid = '$gid'"); @@ -76,7 +80,8 @@ } $totalsummary = small_query("SELECT SUM(p.frags) AS frags, SUM(p.kills) AS kills, SUM(p.suicides) AS suicides, SUM(p.teamkills) AS teamkills, COUNT(DISTINCT p.matchid) AS matchcount, SUM(p.gametime) AS gametime -FROM uts_player AS p, uts_games AS g WHERE p.gid = g.id"); +FROM uts_player AS p, uts_games AS g +WHERE p.gid = g.id"); $q_gametime = small_query("SELECT SUM(gametime) AS gametime FROM uts_match"); $gametime = sec2hour($q_gametime[gametime]); @@ -97,4 +102,4 @@ $gtitle = "Across All Servers"; $bgwhere = "id >= 0"; include("pages/graph_mbreakdown.php"); -?> \ No newline at end of file +?> diff --git a/html/pages/match.php b/html/pages/match.php index 22a0399..8dfcee1 100755 --- a/html/pages/match.php +++ b/html/pages/match.php @@ -2,9 +2,9 @@ $mid = preg_replace('/\D/', '', $_GET[mid]); $pid = preg_replace('/\D/', '', $_GET[pid]); -IF ($pid != "") { +if ($pid != "") { include("match_player.php"); } else { include("match_info.php"); } -?> \ No newline at end of file +?> diff --git a/html/pages/match_info.php b/html/pages/match_info.php index 27b6669..7645077 100755 --- a/html/pages/match_info.php +++ b/html/pages/match_info.php @@ -23,18 +23,18 @@ case "Assault (insta)": include("pages/match_info_ass.php"); break; - + case "Capture the Flag": case "Capture the Flag (insta)": include("pages/match_info_ctf.php"); teamstats($mid, 'Match Summary'); break; - + case "Domination": case "Domination (insta)": teamstats($mid, 'Match Summary', 'dom_cp', 'Dom Pts'); break; - + case "JailBreak": case "JailBreak (insta)": teamstats($mid, 'Match Summary', 'ass_obj', 'Team Releases'); @@ -62,7 +62,6 @@ teamstats($mid, 'Player Summary'); } } - if ($real_gamename == "Assault" or $real_gamename== "Assault (insta)") { include("pages/match_info_other2.php"); @@ -75,4 +74,4 @@ include("pages/match_report.php"); } -?> \ No newline at end of file +?> diff --git a/html/pages/match_info_other.php b/html/pages/match_info_other.php index d0a3527..21dfca4 100755 --- a/html/pages/match_info_other.php +++ b/html/pages/match_info_other.php @@ -10,28 +10,33 @@ Special Events - Player - First Blood - Multis - Sprees + Player + First Blood + Multis + Sprees - Dbl - Multi - Ultra - Mons - Kill - Ram - Dom - Uns - God + Dbl + Multi + Ultra + Mons + Kill + Ram + Dom + Uns + God '; + $sql_firstblood = small_query("SELECT firstblood FROM uts_match WHERE id = $mid"); $sql_multis = "SELECT p.pid, pi.name, p.country, SUM(spree_double) AS spree_double, SUM(spree_multi) AS spree_multi, SUM(spree_ultra) AS spree_ultra, SUM(spree_monster) AS spree_monster, SUM(spree_kill) AS spree_kill, SUM(spree_rampage) AS spree_rampage, SUM(spree_dom) AS spree_dom, SUM(spree_uns) AS spree_uns, SUM(spree_god) AS spree_god -FROM uts_player as p, uts_pinfo AS pi WHERE p.pid = pi.id AND pi.banned <> 'Y' AND matchid = $mid GROUP BY pid ORDER BY name ASC"; +FROM uts_player as p, uts_pinfo AS pi +WHERE p.pid = pi.id AND pi.banned <> 'Y' AND matchid = $mid +GROUP BY pid, p.country +ORDER BY name ASC"; + $q_multis = mysql_query($sql_multis) or die(mysql_error()); $i = 0; while ($r_multis = zero_out(mysql_fetch_array($q_multis))) { @@ -42,17 +47,17 @@ echo' - '.FormatPlayerName($r_multis[country], $r_multis[pid], $r_pname, $gid, $gamename).' - ', ($sql_firstblood['firstblood'] == $r_multis['pid'] ? "Yes": ""), ' - '.$r_multis[spree_double].' - '.$r_multis[spree_multi].' - '.$r_multis[spree_ultra].' - '.$r_multis[spree_monster].' - '.$r_multis[spree_kill].' - '.$r_multis[spree_rampage].' - '.$r_multis[spree_dom].' - '.$r_multis[spree_uns].' - '.$r_multis[spree_god].' + '.FormatPlayerName($r_multis[country], $r_multis[pid], $r_pname, $gid, $gamename).' + ', ($sql_firstblood['firstblood'] == $r_multis['pid'] ? "Yes": ""), ' + '.$r_multis[spree_double].' + '.$r_multis[spree_multi].' + '.$r_multis[spree_ultra].' + '.$r_multis[spree_monster].' + '.$r_multis[spree_kill].' + '.$r_multis[spree_rampage].' + '.$r_multis[spree_dom].' + '.$r_multis[spree_uns].' + '.$r_multis[spree_god].' '; } @@ -75,7 +80,11 @@ $sql_pickups = "SELECT p.pid, pi.name, p.country, SUM(p.pu_pads) AS pu_pads, SUM(p.pu_armour) AS pu_armour, SUM(p.pu_keg) AS pu_keg, SUM(p.pu_invis) AS pu_invis, SUM(p.pu_belt) AS pu_belt, SUM(p.pu_amp) AS pu_amp - FROM uts_player as p, uts_pinfo AS pi WHERE p.pid = pi.id AND pi.banned <> 'Y' AND matchid = $mid GROUP BY pid ORDER BY name ASC"; + FROM uts_player as p, uts_pinfo AS pi + WHERE p.pid = pi.id AND pi.banned <> 'Y' AND matchid = $mid + GROUP BY pid, p.country + ORDER BY name ASC"; + $q_pickups = mysql_query($sql_pickups) or die(mysql_error()); $i = 0; while ($r_pickups = zero_out(mysql_fetch_array($q_pickups))) { diff --git a/html/pages/match_player.php b/html/pages/match_player.php index 4cc73a0..63a3787 100755 --- a/html/pages/match_player.php +++ b/html/pages/match_player.php @@ -2,23 +2,28 @@ $mid = preg_replace('/\D/', '', $_GET[mid]); $pid = preg_replace('/\D/', '', $_GET[pid]); -$r_infos = small_query("SELECT p.playerid, p.country, pi.name, pi.banned, p.gid, g.name AS gamename FROM uts_player p, uts_pinfo pi, uts_games g WHERE p.gid = g.id AND p.pid = pi.id AND p.pid = '$pid' AND matchid = '$mid' LIMIT 0,1;"); +$r_infos = small_query("SELECT p.playerid, p.country, pi.name, pi.banned, p.gid, g.name AS gamename + FROM uts_player p, uts_pinfo pi, uts_games g + WHERE p.gid = g.id AND p.pid = pi.id AND p.pid = '$pid' + AND matchid = '$mid' + LIMIT 0,1;"); if (!$r_infos) { - echo "Unable to retrieve data!"; - include("includes/footer.php"); - exit; + echo "Unable to retrieve data!"; + include("includes/footer.php"); + exit; } + if ($r_infos['banned'] == 'Y') { - if (isset($is_admin) and $is_admin) { - echo "Warning: Banned player - Admin override
"; - } else { - echo "Sorry, this player has been banned!"; - include("includes/footer.php"); - exit; - } + if (isset($is_admin) and $is_admin) { + echo "Warning: Banned player - Admin override
"; + } else { + echo "Sorry, this player has been banned!"; + include("includes/footer.php"); + exit; + } } - + $playerid = $r_infos['playerid']; $playername = $r_infos['name']; $country = $r_infos['country']; @@ -28,9 +33,10 @@ echo' - +
Individual Match Stats for '.FlagImage($country) .' '. htmlentities($playername) .' - '. RankImageOrText($pid, $playername, NULL, $gid, $gamename, true, '(%IT% in %GN% with %RP% ranking points)') .' - Individual Match Stats for + '.FlagImage($country) .' '. htmlentities($playername) .' + '. RankImageOrText($pid, $playername, NULL, $gid, $gamename, true, '(%IT% in %GN% with %RP% ranking points)') .' +

'; @@ -56,19 +62,20 @@ '; $r_gsumm = zero_out(small_query("SELECT gamescore, frags, SUM(frags+suicides) AS kills, deaths, suicides, teamkills, eff, accuracy, ttl, gametime, spree_kill, spree_rampage, spree_dom, spree_uns, spree_god -FROM uts_player WHERE matchid = $mid AND pid = '$pid' -GROUP BY pid")); + FROM uts_player + WHERE matchid = $mid AND pid = '$pid' + GROUP BY pid, gamescore, frags, deaths, suicides, teamkills, eff, accuracy, ttl, gametime, spree_kill, spree_rampage, spree_dom, spree_uns, spree_god")); echo' - '.$r_gsumm[frags].' - '.$r_gsumm[kills].' - '.$r_gsumm[deaths].' - '.$r_gsumm[suicides].' - '.$r_gsumm[eff].' - '.$r_gsumm[accuracy].' - '.$r_gsumm[ttl].' - '.GetMinutes($r_gsumm[gametime]).' + '.$r_gsumm[frags].' + '.$r_gsumm[kills].' + '.$r_gsumm[deaths].' + '.$r_gsumm[suicides].' + '.$r_gsumm[eff].' + '.$r_gsumm[accuracy].' + '.$r_gsumm[ttl].' + '.GetMinutes($r_gsumm[gametime]).' '; echo' @@ -96,30 +103,30 @@ '; $r_gsumm = zero_out(small_query("SELECT spree_double, spree_multi, spree_ultra, spree_monster, spree_kill, spree_rampage, spree_dom, spree_uns, spree_god -FROM uts_player WHERE matchid = $mid AND pid = '$pid' -GROUP BY pid")); + FROM uts_player + WHERE matchid = $mid AND pid = '$pid' + GROUP BY pid, spree_double, spree_multi, spree_ultra, spree_monster, spree_kill, spree_rampage, spree_dom, spree_uns, spree_god")); $sql_firstblood = small_query("SELECT firstblood FROM uts_match WHERE id = $mid"); -IF ($sql_firstblood[firstblood] == $pid) { - $firstblood = "Yes"; +if ($sql_firstblood[firstblood] == $pid) { + $firstblood = "Yes"; } else { - $firstblood = "No"; + $firstblood = "No"; } - - echo' +echo' - '.$firstblood.' - '.$r_gsumm[spree_double].' - '.$r_gsumm[spree_multi].' - '.$r_gsumm[spree_ultra].' - '.$r_gsumm[spree_monster].' - '.$r_gsumm[spree_kill].' - '.$r_gsumm[spree_rampage].' - '.$r_gsumm[spree_dom].' - '.$r_gsumm[spree_uns].' - '.$r_gsumm[spree_god].' + '.$firstblood.' + '.$r_gsumm[spree_double].' + '.$r_gsumm[spree_multi].' + '.$r_gsumm[spree_ultra].' + '.$r_gsumm[spree_monster].' + '.$r_gsumm[spree_kill].' + '.$r_gsumm[spree_rampage].' + '.$r_gsumm[spree_dom].' + '.$r_gsumm[spree_uns].' + '.$r_gsumm[spree_god].'
'; @@ -129,23 +136,23 @@ $r_pings = small_query("SELECT lowping, avgping, highping FROM uts_player WHERE pid = $pid and matchid = $mid and lowping > 0"); if ($r_pings and $r_pings['lowping']) { -echo ' -
- - - - - - - - - - - - - - -
Pings
MinAvgMax
'.ceil($r_pings['lowping']).''.ceil($r_pings['avgping']).''.ceil($r_pings['highping']).'
'; + echo ' +
+ + + + + + + + + + + + + + +
Pings
MinAvgMax
'.ceil($r_pings['lowping']).''.ceil($r_pings['avgping']).''.ceil($r_pings['highping']).'
'; } ?> diff --git a/html/pages/players_info.php b/html/pages/players_info.php index 11064dc..f4d131c 100755 --- a/html/pages/players_info.php +++ b/html/pages/players_info.php @@ -312,7 +312,7 @@ m.id = p.matchid AND e.col1 = 'btcap' GROUP BY - m.mapfile + m.mapfile, e.col3, e.col4 ORDER BY m.mapfile, 0 + e.col3 ASC"; diff --git a/html/pages/totals.php b/html/pages/totals.php index 64acedd..e5b5126 100755 --- a/html/pages/totals.php +++ b/html/pages/totals.php @@ -22,10 +22,14 @@ '; $sql_totsumm = "SELECT g.name AS gamename, SUM(p.gamescore) AS gamescore, SUM(p.frags) AS frags, SUM(p.kills) AS kills, SUM(p.suicides) AS suicides, SUM(p.teamkills) AS teamkills, COUNT(DISTINCT p.matchid) AS matchcount, SUM(p.gametime) AS sumgametime -FROM uts_player AS p, uts_games AS g WHERE p.gid = g.id GROUP BY gamename ORDER BY gamename ASC"; +FROM uts_player AS p, uts_games AS g +WHERE p.gid = g.id +GROUP BY g.name +ORDER BY gamename ASC"; + $q_totsumm = mysql_query($sql_totsumm) or die(mysql_error()); -while ($r_totsumm = zero_out(mysql_fetch_array($q_totsumm))) { +while ($r_totsumm = zero_out(mysql_fetch_array($q_totsumm))) { $gametime = sec2hour($r_totsumm[sumgametime]); echo' @@ -166,29 +170,28 @@ '; // NGStats Style Total Highs (All Time) - -$sql_chighfrags = small_query("SELECT p.pid, pi.name, p.country, SUM(frags) AS frags , SUM(gametime) AS sumgametime, COUNT(matchid) AS mcount FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND pi.banned <> 'Y' GROUP BY pid HAVING sumgametime > 1800 ORDER BY frags DESC LIMIT 0,1"); -$sql_chighdeaths = small_query("SELECT p.pid, pi.name, p.country, SUM(deaths) AS deaths , SUM(gametime) AS sumgametime, COUNT(matchid) AS mcount FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND pi.banned <> 'Y' GROUP BY pid HAVING sumgametime > 1800 ORDER BY deaths DESC LIMIT 0,1"); -$sql_chighkills = small_query("SELECT p.pid, pi.name, p.country, SUM(kills) AS kills , SUM(gametime) AS sumgametime, COUNT(matchid) AS mcount FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND pi.banned <> 'Y' GROUP BY pid HAVING sumgametime > 1800 ORDER BY kills DESC LIMIT 0,1"); -$sql_chighsuicides = small_query("SELECT p.pid, pi.name, p.country, SUM(suicides) AS suicides , SUM(gametime) AS sumgametime, COUNT(matchid) AS mcount FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND pi.banned <> 'Y' GROUP BY pid HAVING sumgametime > 1800 ORDER BY suicides DESC LIMIT 0,1"); -$sql_chighteamkills = small_query("SELECT p.pid, pi.name, p.country, SUM(teamkills) AS teamkills , SUM(gametime) AS sumgametime, COUNT(matchid) AS mcount FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND pi.banned <> 'Y' GROUP BY pid HAVING sumgametime > 1800 ORDER BY teamkills DESC LIMIT 0,1"); -$sql_chigheff = small_query("SELECT p.pid, pi.name, p.country, AVG(eff) AS eff , SUM(gametime) AS sumgametime, COUNT(matchid) AS mcount FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND pi.banned <> 'Y' GROUP BY pid HAVING sumgametime > 1800 ORDER BY eff DESC LIMIT 0,1"); -$sql_chighaccuracy = small_query("SELECT p.pid, pi.name, p.country, AVG(accuracy) AS accuracy , SUM(gametime) AS sumgametime, COUNT(matchid) AS mcount FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND pi.banned <> 'Y' GROUP BY pid HAVING sumgametime > 1800 ORDER BY accuracy DESC LIMIT 0,1"); -$sql_chighttl = small_query("SELECT p.pid, pi.name, p.country, AVG(ttl) AS ttl , SUM(gametime) AS sumgametime, COUNT(matchid) AS mcount FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND pi.banned <> 'Y' GROUP BY pid HAVING sumgametime > 1800 ORDER BY ttl DESC LIMIT 0,1"); -$sql_chighflag_capture = small_query("SELECT p.pid, pi.name, p.country, SUM(flag_capture) AS flag_capture , SUM(gametime) AS sumgametime, COUNT(matchid) AS mcount FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND pi.banned <> 'Y' GROUP BY pid HAVING sumgametime > 1800 ORDER BY flag_capture DESC LIMIT 0,1"); -$sql_chighflag_kill = small_query("SELECT p.pid, pi.name, p.country, SUM(flag_kill) AS flag_kill , SUM(gametime) AS sumgametime, COUNT(matchid) AS mcount FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND pi.banned <> 'Y' GROUP BY pid HAVING sumgametime > 1800 ORDER BY flag_kill DESC LIMIT 0,1"); -$sql_chighdom_cp = small_query("SELECT p.pid, pi.name, p.country, SUM(dom_cp) AS dom_cp , SUM(gametime) AS sumgametime, COUNT(matchid) AS mcount FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND pi.banned <> 'Y' GROUP BY pid HAVING sumgametime > 1800 ORDER BY dom_cp DESC LIMIT 0,1"); +$sql_chighfrags = small_query("SELECT p.pid, pi.name, p.country, SUM(frags) AS frags , SUM(gametime) AS sumgametime, COUNT(matchid) AS mcount FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND pi.banned <> 'Y' GROUP BY pid, p.country HAVING sumgametime > 1800 ORDER BY frags DESC LIMIT 0,1"); +$sql_chighdeaths = small_query("SELECT p.pid, pi.name, p.country, SUM(deaths) AS deaths , SUM(gametime) AS sumgametime, COUNT(matchid) AS mcount FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND pi.banned <> 'Y' GROUP BY pid, p.country HAVING sumgametime > 1800 ORDER BY deaths DESC LIMIT 0,1"); +$sql_chighkills = small_query("SELECT p.pid, pi.name, p.country, SUM(kills) AS kills , SUM(gametime) AS sumgametime, COUNT(matchid) AS mcount FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND pi.banned <> 'Y' GROUP BY pid, p.country HAVING sumgametime > 1800 ORDER BY kills DESC LIMIT 0,1"); +$sql_chighsuicides = small_query("SELECT p.pid, pi.name, p.country, SUM(suicides) AS suicides , SUM(gametime) AS sumgametime, COUNT(matchid) AS mcount FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND pi.banned <> 'Y' GROUP BY pid, p.country HAVING sumgametime > 1800 ORDER BY suicides DESC LIMIT 0,1"); +$sql_chighteamkills = small_query("SELECT p.pid, pi.name, p.country, SUM(teamkills) AS teamkills , SUM(gametime) AS sumgametime, COUNT(matchid) AS mcount FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND pi.banned <> 'Y' GROUP BY pid, p.country HAVING sumgametime > 1800 ORDER BY teamkills DESC LIMIT 0,1"); +$sql_chigheff = small_query("SELECT p.pid, pi.name, p.country, AVG(eff) AS eff , SUM(gametime) AS sumgametime, COUNT(matchid) AS mcount FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND pi.banned <> 'Y' GROUP BY pid, p.country HAVING sumgametime > 1800 ORDER BY eff DESC LIMIT 0,1"); +$sql_chighaccuracy = small_query("SELECT p.pid, pi.name, p.country, AVG(accuracy) AS accuracy , SUM(gametime) AS sumgametime, COUNT(matchid) AS mcount FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND pi.banned <> 'Y' GROUP BY pid, p.country HAVING sumgametime > 1800 ORDER BY accuracy DESC LIMIT 0,1"); +$sql_chighttl = small_query("SELECT p.pid, pi.name, p.country, AVG(ttl) AS ttl , SUM(gametime) AS sumgametime, COUNT(matchid) AS mcount FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND pi.banned <> 'Y' GROUP BY pid, p.country HAVING sumgametime > 1800 ORDER BY ttl DESC LIMIT 0,1"); +$sql_chighflag_capture = small_query("SELECT p.pid, pi.name, p.country, SUM(flag_capture) AS flag_capture , SUM(gametime) AS sumgametime, COUNT(matchid) AS mcount FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND pi.banned <> 'Y' GROUP BY pid, p.country HAVING sumgametime > 1800 ORDER BY flag_capture DESC LIMIT 0,1"); +$sql_chighflag_kill = small_query("SELECT p.pid, pi.name, p.country, SUM(flag_kill) AS flag_kill , SUM(gametime) AS sumgametime, COUNT(matchid) AS mcount FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND pi.banned <> 'Y' GROUP BY pid, p.country HAVING sumgametime > 1800 ORDER BY flag_kill DESC LIMIT 0,1"); +$sql_chighdom_cp = small_query("SELECT p.pid, pi.name, p.country, SUM(dom_cp) AS dom_cp , SUM(gametime) AS sumgametime, COUNT(matchid) AS mcount FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND pi.banned <> 'Y' GROUP BY pid, p.country HAVING sumgametime > 1800 ORDER BY dom_cp DESC LIMIT 0,1"); $ass_obj_check = small_query("SELECT COUNT(id) AS idcount FROM uts_games WHERE gamename LIKE '%Assault%';") or die(mysql_error()); -IF ($ass_obj_check[idcount] > 0 ) { +if ($ass_obj_check[idcount] > 0 ) { $sql_chighass_obj = small_query("SELECT p.pid, pi.name, p.country, SUM(ass_obj) AS ass_obj , SUM(gametime) AS sumgametime, COUNT(matchid) AS mcount FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND pi.banned <> 'Y' GROUP BY pid HAVING sumgametime > 1800 ORDER BY ass_obj DESC LIMIT 0,1"); } else { $sql_chighass_obj = ""; } -$sql_chighspree_monster = small_query("SELECT p.pid, pi.name, p.country, SUM(spree_monster) AS spree_monster , SUM(gametime) AS sumgametime, COUNT(matchid) AS mcount FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND pi.banned <> 'Y' GROUP BY pid HAVING sumgametime > 1800 ORDER BY spree_monster DESC LIMIT 0,1"); -$sql_chighspree_god = small_query("SELECT p.pid, pi.name, p.country, SUM(spree_god) AS spree_god , SUM(gametime) AS sumgametime, COUNT(matchid) AS mcount FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND pi.banned <> 'Y' GROUP BY pid HAVING sumgametime > 1800 ORDER BY spree_god DESC LIMIT 0,1"); -$sql_chighrank = small_query("SELECT p.pid, pi.name, p.country, SUM(rank) AS rank , SUM(gametime) AS sumgametime, COUNT(matchid) AS mcount FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND pi.banned <> 'Y' GROUP BY pid HAVING sumgametime > 1800 ORDER BY rank DESC LIMIT 0,1"); +$sql_chighspree_monster = small_query("SELECT p.pid, pi.name, p.country, SUM(spree_monster) AS spree_monster , SUM(gametime) AS sumgametime, COUNT(matchid) AS mcount FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND pi.banned <> 'Y' GROUP BY pid, p.country HAVING sumgametime > 1800 ORDER BY spree_monster DESC LIMIT 0,1"); +$sql_chighspree_god = small_query("SELECT p.pid, pi.name, p.country, SUM(spree_god) AS spree_god , SUM(gametime) AS sumgametime, COUNT(matchid) AS mcount FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND pi.banned <> 'Y' GROUP BY pid, p.country HAVING sumgametime > 1800 ORDER BY spree_god DESC LIMIT 0,1"); +$sql_chighrank = small_query("SELECT p.pid, pi.name, p.country, SUM(rank) AS rank , SUM(gametime) AS sumgametime, COUNT(matchid) AS mcount FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND pi.banned <> 'Y' GROUP BY pid, p.country HAVING sumgametime > 1800 ORDER BY rank DESC LIMIT 0,1"); echo'
@@ -203,8 +206,9 @@ '; + if ($sql_chighfrags and $sql_chighfrags[frags]) { - echo ' + echo ' @@ -214,7 +218,7 @@ '; } if ($sql_chighdeaths and $sql_chighdeaths[deaths]) { - echo ' + echo ' @@ -224,7 +228,7 @@ '; } if ($sql_chighkills and $sql_chighkills[kills]) { - echo ' + echo ' @@ -234,7 +238,7 @@ '; } if ($sql_chighsuicides and $sql_chighsuicides[suicides]) { - echo ' + echo ' @@ -244,7 +248,7 @@ '; } if ($sql_chighteamkills and $sql_chighteamkills[teamkills]) { - echo ' + echo ' @@ -254,7 +258,7 @@ '; } if ($sql_chigheff and $sql_chigheff[eff]) { - echo ' + echo ' @@ -264,7 +268,7 @@ '; } if ($sql_chighaccuracy and $sql_chighaccuracy[accuracy]) { - echo ' + echo ' @@ -274,7 +278,7 @@ '; } if ($sql_chighttl and $sql_chighttl[ttl]) { - echo ' + echo ' @@ -284,7 +288,7 @@ '; } if ($sql_chighflag_capture and $sql_chighflag_capture[flag_capture]) { - echo ' + echo ' @@ -294,7 +298,7 @@ '; } if ($sql_chighflag_kill and $sql_chighflag_kill[flag_kill]) { - echo ' + echo ' @@ -304,7 +308,7 @@ '; } if ($sql_chighdom_cp and $sql_chighdom_cp[dom_cp]) { - echo ' + echo ' @@ -314,7 +318,7 @@ '; } if ($sql_chighass_obj and $sql_chighass_obj[ass_obj]) { - echo ' + echo ' @@ -324,7 +328,7 @@ '; } if ($sql_chighspree_monster and $sql_chighspree_monster[spree_monster]) { - echo ' + echo ' @@ -334,7 +338,7 @@ '; } if ($sql_chighspree_god and $sql_chighspree_god[spree_god]) { - echo ' + echo ' @@ -344,7 +348,7 @@ '; } if ($sql_chighrank and $sql_chighrank[rank]) { - echo ' + echo ' @@ -357,31 +361,30 @@
Hours Matches
Frags '.FlagImage($sql_chighfrags['country'], false).' '.$sql_chighfrags[name].'
Deaths '.FlagImage($sql_chighdeaths['country'], false).' '.$sql_chighdeaths[name].'
Kills '.FlagImage($sql_chighkills['country'], false).' '.$sql_chighkills[name].'
Suicides '.FlagImage($sql_chighsuicides['country'], false).' '.$sql_chighsuicides[name].'
Team Kills '.FlagImage($sql_chighteamkills['country'], false).' '.$sql_chighteamkills[name].'
Efficiency '.FlagImage($sql_chigheff['country'], false).' '.$sql_chigheff[name].'
Accuracy '.FlagImage($sql_chighaccuracy['country'], false).' '.$sql_chighaccuracy[name].'
TTL '.FlagImage($sql_chighttl['country'], false).' '.$sql_chighttl[name].'
Flag Caps '.FlagImage($sql_chighflag_capture['country'], false).' '.$sql_chighflag_capture[name].'
Flag Kills '.FlagImage($sql_chighflag_kill['country'], false).' '.$sql_chighflag_kill[name].'
Domination Control Points '.FlagImage($sql_chighdom_cp['country'], false).' '.$sql_chighdom_cp[name].'
Assault Objectives '.FlagImage($sql_chighass_obj['country'], false).' '.$sql_chighass_obj[name].'
Monster Kills '.FlagImage($sql_chighspree_monster['country'], false).' '.$sql_chighspree_monster[name].'
Godlikes '.FlagImage($sql_chighspree_god['country'], false).' '.$sql_chighspree_god[name].'
Rank Points '.FlagImage($sql_chighrank['country'], false).' '.$sql_chighrank[name].'

'; - // NGStats Style Total Highs (Single Match) -$sql_mhighfrags = small_query("SELECT p.matchid, p.pid, pi.name, p.country, SUM(frags) AS frags , SUM(gametime) AS sumgametime FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND pi.banned <> 'Y' AND frags > 0 GROUP BY matchid, pid HAVING sumgametime > 600 ORDER BY frags DESC LIMIT 0,1"); -$sql_mhighdeaths = small_query("SELECT p.matchid, p.pid, pi.name, p.country, SUM(deaths) AS deaths , SUM(gametime) AS sumgametime FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND pi.banned <> 'Y' AND deaths > 0 GROUP BY matchid, pid HAVING sumgametime > 600 ORDER BY deaths DESC LIMIT 0,1"); -$sql_mhighkills = small_query("SELECT p.matchid, p.pid, pi.name, p.country, SUM(kills) AS kills , SUM(gametime) AS sumgametime FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND pi.banned <> 'Y' AND kills > 0 GROUP BY matchid, pid HAVING sumgametime > 600 ORDER BY kills DESC LIMIT 0,1"); -$sql_mhighsuicides = small_query("SELECT p.matchid, p.pid, pi.name, p.country, SUM(suicides) AS suicides , SUM(gametime) AS sumgametime FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND pi.banned <> 'Y' AND suicides > 0 GROUP BY matchid, pid HAVING sumgametime > 600 ORDER BY suicides DESC LIMIT 0,1"); -$sql_mhighteamkills = small_query("SELECT p.matchid, p.pid, pi.name, p.country, SUM(teamkills) AS teamkills , SUM(gametime) AS sumgametime FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND pi.banned <> 'Y' AND teamkills > 0 GROUP BY matchid, pid HAVING sumgametime > 600 ORDER BY teamkills DESC LIMIT 0,1"); -$sql_mhigheff = small_query("SELECT p.matchid, p.pid, pi.name, p.country, SUM(eff) AS eff , SUM(gametime) AS sumgametime FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND pi.banned <> 'Y' AND eff > 0 GROUP BY matchid, pid HAVING sumgametime > 600 ORDER BY eff DESC LIMIT 0,1"); -$sql_mhighaccuracy = small_query("SELECT p.matchid, p.pid, pi.name, p.country, SUM(accuracy) AS accuracy , SUM(gametime) AS sumgametime FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND pi.banned <> 'Y' AND accuracy > 0 GROUP BY matchid, pid HAVING sumgametime > 600 ORDER BY accuracy DESC LIMIT 0,1"); -$sql_mhighttl = small_query("SELECT p.matchid, p.pid, pi.name, p.country, SUM(ttl) AS ttl , SUM(gametime) AS sumgametime FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND pi.banned <> 'Y' AND ttl > 0 GROUP BY matchid, pid HAVING sumgametime > 600 ORDER BY ttl DESC LIMIT 0,1"); -$sql_mhighflag_capture = small_query("SELECT p.matchid, p.pid, pi.name, p.country, SUM(flag_capture) AS flag_capture , SUM(gametime) AS sumgametime FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND pi.banned <> 'Y' AND flag_capture > 0 GROUP BY matchid, pid HAVING sumgametime > 600 ORDER BY flag_capture DESC LIMIT 0,1"); -$sql_mhighflag_kill = small_query("SELECT p.matchid, p.pid, pi.name, p.country, SUM(flag_kill) AS flag_kill , SUM(gametime) AS sumgametime FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND pi.banned <> 'Y' AND flag_kill > 0 GROUP BY matchid, pid HAVING sumgametime > 600 ORDER BY flag_kill DESC LIMIT 0,1"); -$sql_mhighdom_cp = small_query("SELECT p.matchid, p.pid, pi.name, p.country, SUM(dom_cp) AS dom_cp , SUM(gametime) AS sumgametime FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND pi.banned <> 'Y' AND dom_cp > 0 GROUP BY matchid, pid HAVING sumgametime > 600 ORDER BY dom_cp DESC LIMIT 0,1"); +$sql_mhighfrags = small_query("SELECT p.matchid, p.pid, pi.name, p.country, SUM(frags) AS frags , SUM(gametime) AS sumgametime FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND pi.banned <> 'Y' AND frags > 0 GROUP BY matchid, pid, country HAVING sumgametime > 600 ORDER BY frags DESC LIMIT 0,1"); +$sql_mhighdeaths = small_query("SELECT p.matchid, p.pid, pi.name, p.country, SUM(deaths) AS deaths , SUM(gametime) AS sumgametime FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND pi.banned <> 'Y' AND deaths > 0 GROUP BY matchid, pid, country HAVING sumgametime > 600 ORDER BY deaths DESC LIMIT 0,1"); +$sql_mhighkills = small_query("SELECT p.matchid, p.pid, pi.name, p.country, SUM(kills) AS kills , SUM(gametime) AS sumgametime FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND pi.banned <> 'Y' AND kills > 0 GROUP BY matchid, pid, country HAVING sumgametime > 600 ORDER BY kills DESC LIMIT 0,1"); +$sql_mhighsuicides = small_query("SELECT p.matchid, p.pid, pi.name, p.country, SUM(suicides) AS suicides , SUM(gametime) AS sumgametime FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND pi.banned <> 'Y' AND suicides > 0 GROUP BY matchid, pid, country HAVING sumgametime > 600 ORDER BY suicides DESC LIMIT 0,1"); +$sql_mhighteamkills = small_query("SELECT p.matchid, p.pid, pi.name, p.country, SUM(teamkills) AS teamkills , SUM(gametime) AS sumgametime FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND pi.banned <> 'Y' AND teamkills > 0 GROUP BY matchid, pid, country HAVING sumgametime > 600 ORDER BY teamkills DESC LIMIT 0,1"); +$sql_mhigheff = small_query("SELECT p.matchid, p.pid, pi.name, p.country, SUM(eff) AS eff , SUM(gametime) AS sumgametime FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND pi.banned <> 'Y' AND eff > 0 GROUP BY matchid, pid, country HAVING sumgametime > 600 ORDER BY eff DESC LIMIT 0,1"); +$sql_mhighaccuracy = small_query("SELECT p.matchid, p.pid, pi.name, p.country, SUM(accuracy) AS accuracy , SUM(gametime) AS sumgametime FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND pi.banned <> 'Y' AND accuracy > 0 GROUP BY matchid, pid, country HAVING sumgametime > 600 ORDER BY accuracy DESC LIMIT 0,1"); +$sql_mhighttl = small_query("SELECT p.matchid, p.pid, pi.name, p.country, SUM(ttl) AS ttl , SUM(gametime) AS sumgametime FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND pi.banned <> 'Y' AND ttl > 0 GROUP BY matchid, pid, country HAVING sumgametime > 600 ORDER BY ttl DESC LIMIT 0,1"); +$sql_mhighflag_capture = small_query("SELECT p.matchid, p.pid, pi.name, p.country, SUM(flag_capture) AS flag_capture , SUM(gametime) AS sumgametime FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND pi.banned <> 'Y' AND flag_capture > 0 GROUP BY matchid, pid, country HAVING sumgametime > 600 ORDER BY flag_capture DESC LIMIT 0,1"); +$sql_mhighflag_kill = small_query("SELECT p.matchid, p.pid, pi.name, p.country, SUM(flag_kill) AS flag_kill , SUM(gametime) AS sumgametime FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND pi.banned <> 'Y' AND flag_kill > 0 GROUP BY matchid, pid, country HAVING sumgametime > 600 ORDER BY flag_kill DESC LIMIT 0,1"); +$sql_mhighdom_cp = small_query("SELECT p.matchid, p.pid, pi.name, p.country, SUM(dom_cp) AS dom_cp , SUM(gametime) AS sumgametime FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND pi.banned <> 'Y' AND dom_cp > 0 GROUP BY matchid, pid, country HAVING sumgametime > 600 ORDER BY dom_cp DESC LIMIT 0,1"); $ass_obj_check = small_query("SELECT COUNT(id) AS idcount FROM uts_games WHERE gamename LIKE '%Assault%';") or die(mysql_error()); -IF ($ass_obj_check[idcount] > 0 ) { - $sql_mhighass_obj = small_query("SELECT p.matchid, p.pid, pi.name, p.country, SUM(ass_obj) AS ass_obj , SUM(gametime) AS sumgametime FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND pi.banned <> 'Y' AND ass_obj > 0 GROUP BY matchid, pid HAVING sumgametime > 600 ORDER BY ass_obj DESC LIMIT 0,1"); +if ($ass_obj_check[idcount] > 0 ) { + $sql_mhighass_obj = small_query("SELECT p.matchid, p.pid, pi.name, p.country, SUM(ass_obj) AS ass_obj , SUM(gametime) AS sumgametime FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND pi.banned <> 'Y' AND ass_obj > 0 GROUP BY matchid, pid, country HAVING sumgametime > 600 ORDER BY ass_obj DESC LIMIT 0,1"); } else { $sql_mhighass_obj = ""; } -$sql_mhighspree_monster = small_query("SELECT p.matchid, p.pid, pi.name, p.country, SUM(spree_monster) AS spree_monster , SUM(gametime) AS sumgametime FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND pi.banned <> 'Y' AND spree_monster > 0 GROUP BY matchid, pid HAVING sumgametime > 600 ORDER BY spree_monster DESC LIMIT 0,1"); -$sql_mhighspree_god = small_query("SELECT p.matchid, p.pid, pi.name, p.country, SUM(spree_god) AS spree_god , SUM(gametime) AS sumgametime FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND pi.banned <> 'Y' AND spree_god > 0 GROUP BY matchid, pid HAVING sumgametime > 600 ORDER BY spree_god DESC LIMIT 0,1"); -$sql_mhighrank = small_query("SELECT p.matchid, p.pid, pi.name, p.country, SUM(rank) AS rank , SUM(gametime) AS sumgametime FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND pi.banned <> 'Y' AND rank > 0 GROUP BY matchid, pid HAVING sumgametime > 600 ORDER BY rank DESC LIMIT 0,1"); +$sql_mhighspree_monster = small_query("SELECT p.matchid, p.pid, pi.name, p.country, SUM(spree_monster) AS spree_monster , SUM(gametime) AS sumgametime FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND pi.banned <> 'Y' AND spree_monster > 0 GROUP BY matchid, pid, country HAVING sumgametime > 600 ORDER BY spree_monster DESC LIMIT 0,1"); +$sql_mhighspree_god = small_query("SELECT p.matchid, p.pid, pi.name, p.country, SUM(spree_god) AS spree_god , SUM(gametime) AS sumgametime FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND pi.banned <> 'Y' AND spree_god > 0 GROUP BY matchid, pid, country HAVING sumgametime > 600 ORDER BY spree_god DESC LIMIT 0,1"); +$sql_mhighrank = small_query("SELECT p.matchid, p.pid, pi.name, p.country, SUM(rank) AS rank , SUM(gametime) AS sumgametime FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND pi.banned <> 'Y' AND rank > 0 GROUP BY matchid, pid, country HAVING sumgametime > 600 ORDER BY rank DESC LIMIT 0,1"); echo' @@ -396,7 +399,7 @@ '; if ($sql_mhighfrags) { - echo ' + echo ' @@ -405,7 +408,7 @@ '; } if ($sql_mhighdeaths) { - echo ' + echo ' @@ -414,7 +417,7 @@ '; } if ($sql_mhighkills) { - echo ' + echo ' @@ -423,7 +426,7 @@ '; } if ($sql_mhighsuicides) { - echo ' + echo ' @@ -432,7 +435,7 @@ '; } if ($sql_mhighteamkills) { - echo ' + echo ' @@ -441,7 +444,7 @@ '; } if ($sql_mhigheff) { - echo ' + echo ' @@ -450,7 +453,7 @@ '; } if ($sql_mhighaccuracy) { - echo ' + echo ' @@ -459,7 +462,7 @@ '; } if ($sql_mhighttl) { - echo ' + echo ' @@ -468,7 +471,7 @@ '; } if ($sql_mhighflag_capture) { - echo ' + echo ' @@ -477,7 +480,7 @@ '; } if ($sql_mhighflag_kill) { - echo ' + echo ' @@ -486,7 +489,7 @@ '; } if ($sql_mhighdom_cp) { - echo ' + echo ' @@ -495,7 +498,7 @@ '; } if ($sql_mhighass_obj) { - echo ' + echo ' @@ -504,7 +507,7 @@ '; } if ($sql_mhighspree_monster) { - echo ' + echo ' @@ -513,7 +516,7 @@ '; } if ($sql_mhighspree_god) { - echo ' + echo ' @@ -522,7 +525,7 @@ '; } if ($sql_mhighrank) { - echo ' + echo ' @@ -530,6 +533,7 @@ '; } + echo '
Frags '.FlagImage($sql_mhighfrags['country'], false).' '.$sql_mhighfrags[name].'
Deaths '.FlagImage($sql_mhighdeaths['country'], false).' '.$sql_mhighdeaths[name].'
Kills '.FlagImage($sql_mhighkills['country'], false).' '.$sql_mhighkills[name].'
Suicides '.FlagImage($sql_mhighsuicides['country'], false).' '.$sql_mhighsuicides[name].'
Team Kills '.FlagImage($sql_mhighteamkills['country'], false).' '.$sql_mhighteamkills[name].'
Efficiency '.FlagImage($sql_mhigheff['country'], false).' '.$sql_mhigheff[name].'
Accuracy '.FlagImage($sql_mhighaccuracy['country'], false).' '.$sql_mhighaccuracy[name].'
TTL '.FlagImage($sql_mhighttl['country'], false).' '.$sql_mhighttl[name].'
Flag Caps '.FlagImage($sql_mhighflag_capture['country'], false).' '.$sql_mhighflag_capture[name].'
Flag Kills '.FlagImage($sql_mhighflag_kill['country'], false).' '.$sql_mhighflag_kill[name].'
Domination Control Points '.FlagImage($sql_mhighdom_cp['country'], false).' '.$sql_mhighdom_cp[name].'
Assault Objectives '.FlagImage($sql_mhighass_obj['country'], false).' '.$sql_mhighass_obj[name].'
Monster Kills '.FlagImage($sql_mhighspree_monster['country'], false).' '.$sql_mhighspree_monster[name].'
Godlikes '.FlagImage($sql_mhighspree_god['country'], false).' '.$sql_mhighspree_god[name].'
Rank Points '.FlagImage($sql_mhighrank['country'], false).' '.$sql_mhighrank[name].'(click)

@@ -546,22 +550,29 @@ '; + $sql_mweapons = "SELECT id, name, image FROM uts_weapons WHERE hide <> 'Y' ORDER BY sequence, id ASC"; $q_mweapons = mysql_query($sql_mweapons) or die(mysql_error()); -while ($r_mweapons = mysql_fetch_array($q_mweapons)) { +while ($r_mweapons = mysql_fetch_array($q_mweapons)) { $wid = $r_mweapons[id]; - $sql_mweaponsl = "SELECT w.pid AS playerid, pi.name AS name, pi.country AS country, SUM(w.kills) as kills, COUNT(DISTINCT w.matchid) AS mcount FROM uts_weaponstats AS w LEFT JOIN uts_pinfo AS pi ON w.pid = pi.id WHERE w.weapon = '$wid' AND w.pid > 0 AND w.matchid <> 0 AND pi.banned <> 'Y' GROUP BY w.pid ORDER BY kills DESC LIMIT 0,1"; - $q_mweaponsl = mysql_query($sql_mweaponsl) or die(mysql_error()); - while ($r_mweaponsl = mysql_fetch_array($q_mweaponsl)) { - echo ' - '.$r_mweapons[name].' - '.FlagImage($r_mweaponsl[country], false).' '.$r_mweaponsl[name].' - '.$r_mweaponsl[kills].' - '.$r_mweaponsl[mcount].' - '; + $sql_mweaponsl = "SELECT w.pid AS playerid, pi.name AS name, pi.country AS country, SUM(w.kills) as kills, COUNT(DISTINCT w.matchid) AS mcount + FROM uts_weaponstats AS w + LEFT JOIN uts_pinfo AS pi ON w.pid = pi.id + WHERE w.weapon = '$wid' AND w.pid > 0 AND w.matchid <> 0 AND pi.banned <> 'Y' + GROUP BY w.pid + ORDER BY kills DESC LIMIT 0,1"; + + $q_mweaponsl = mysql_query($sql_mweaponsl) or die(mysql_error()); + while ($r_mweaponsl = mysql_fetch_array($q_mweaponsl)) { + echo ' + '.$r_mweapons[name].' + '.FlagImage($r_mweaponsl[country], false).' '.$r_mweaponsl[name].' + '.$r_mweaponsl[kills].' + '.$r_mweaponsl[mcount].' + '; } } @@ -571,8 +582,8 @@ // NGStats Style Weapon Highs (All Time) echo ' - - + + @@ -580,27 +591,27 @@ - -'; + '; $sql_mweapons = "SELECT id, name, image FROM uts_weapons WHERE hide <> 'Y' ORDER BY sequence, id ASC"; $q_mweapons = mysql_query($sql_mweapons) or die(mysql_error()); -while ($r_mweapons = mysql_fetch_array($q_mweapons)) { +while ($r_mweapons = mysql_fetch_array($q_mweapons)) { $wid = $r_mweapons[id]; $sql_mweaponsl = "SELECT w.matchid, w.pid AS playerid, pi.name AS name, pi.country AS country, w.kills FROM uts_weaponstats AS w LEFT JOIN uts_pinfo AS pi ON w.pid = pi.id WHERE w.weapon = '$wid' AND w.pid > 0 AND w.matchid > 0 AND pi.banned <> 'Y' ORDER BY w.kills DESC LIMIT 0,1"; $q_mweaponsl = mysql_query($sql_mweaponsl) or die(mysql_error()); - while ($r_mweaponsl = mysql_fetch_array($q_mweaponsl)) { - echo ' - - - - - '; + while ($r_mweaponsl = mysql_fetch_array($q_mweaponsl)) { + echo ' + + + + + '; } } // NGStats Style Weapon Highs (Single Match) echo'
Weapon Match Highs
Player Kills Match
'.$r_mweapons[name].''.FlagImage($r_mweaponsl[country], false).' '.$r_mweaponsl[name].''.$r_mweaponsl[kills].'(click)
'.$r_mweapons[name].''.FlagImage($r_mweaponsl[country], false).' '.$r_mweaponsl[name].''.$r_mweaponsl[kills].'(click)
'; + ?>