From 40dfa7d5c0dc8e4cb2c95e403b6b4b2c4bf70644 Mon Sep 17 00:00:00 2001 From: Matthijs Kuiper Date: Sat, 4 Feb 2017 16:05:45 +0100 Subject: Original UTStats beta 4.2.8 --- html/pages/admin/acelog.php | 318 +++++++++++++++++ html/pages/admin/aclog.php | 108 ++++++ html/pages/admin/check.php | 408 ++++++++++++++++++++++ html/pages/admin/dmatch.php | 105 ++++++ html/pages/admin/dplayer.php | 76 +++++ html/pages/admin/dpmatch.php | 106 ++++++ html/pages/admin/editgames.php | 74 ++++ html/pages/admin/editgamestype.php | 228 +++++++++++++ html/pages/admin/editweapons.php | 58 ++++ html/pages/admin/emptydb.php | 62 ++++ html/pages/admin/index.htm | 0 html/pages/admin/ipsearch.php | 58 ++++ html/pages/admin/main.php | 117 +++++++ html/pages/admin/mplayers.php | 91 +++++ html/pages/admin/mservers.php | 41 +++ html/pages/admin/pban.php | 74 ++++ html/pages/admin/pinfo.php | 91 +++++ html/pages/admin/plm.php | 329 ++++++++++++++++++ html/pages/admin/recalcflags.php | 72 ++++ html/pages/admin/recalcranking.php | 77 +++++ html/pages/admin/utdclog.php | 137 ++++++++ html/pages/admin/utdcshot.php | 22 ++ html/pages/credits.php | 311 +++++++++++++++++ html/pages/dpmatch.php | 102 ++++++ html/pages/graph_mbreakdown.php | 229 +++++++++++++ html/pages/graph_pbreakdown.php | 137 ++++++++ html/pages/help.php | 183 ++++++++++ html/pages/home.php | 100 ++++++ html/pages/index.htm | 0 html/pages/maps.php | 143 ++++++++ html/pages/maps_info.php | 321 +++++++++++++++++ html/pages/match.php | 10 + html/pages/match_info.php | 78 +++++ html/pages/match_info_ass.php | 64 ++++ html/pages/match_info_bt.php | 164 +++++++++ html/pages/match_info_ctf.php | 362 ++++++++++++++++++++ html/pages/match_info_killsmatrix.php | 131 +++++++ html/pages/match_info_lms.php | 144 ++++++++ html/pages/match_info_other.php | 115 +++++++ html/pages/match_info_other2.php | 143 ++++++++ html/pages/match_info_server.php | 114 +++++++ html/pages/match_player.php | 151 ++++++++ html/pages/match_report.php | 17 + html/pages/players.php | 124 +++++++ html/pages/players_explain_ranking.php | 190 +++++++++++ html/pages/players_info.php | 442 ++++++++++++++++++++++++ html/pages/players_search.php | 83 +++++ html/pages/rank.php | 56 +++ html/pages/rank_extended.php | 75 ++++ html/pages/recent.php | 137 ++++++++ html/pages/report.php | 24 ++ html/pages/report/bbcode.php | 424 +++++++++++++++++++++++ html/pages/report/clanbase.php | 530 ++++++++++++++++++++++++++++ html/pages/report/index.htm | 0 html/pages/report_cb.php | 168 +++++++++ html/pages/servers.php | 74 ++++ html/pages/servers_info.php | 104 ++++++ html/pages/servers_query.php | 176 ++++++++++ html/pages/totals.php | 606 +++++++++++++++++++++++++++++++++ html/pages/watchlist.php | 106 ++++++ 60 files changed, 8990 insertions(+) create mode 100755 html/pages/admin/acelog.php create mode 100755 html/pages/admin/aclog.php create mode 100755 html/pages/admin/check.php create mode 100755 html/pages/admin/dmatch.php create mode 100755 html/pages/admin/dplayer.php create mode 100755 html/pages/admin/dpmatch.php create mode 100755 html/pages/admin/editgames.php create mode 100755 html/pages/admin/editgamestype.php create mode 100755 html/pages/admin/editweapons.php create mode 100755 html/pages/admin/emptydb.php create mode 100755 html/pages/admin/index.htm create mode 100755 html/pages/admin/ipsearch.php create mode 100755 html/pages/admin/main.php create mode 100755 html/pages/admin/mplayers.php create mode 100755 html/pages/admin/mservers.php create mode 100755 html/pages/admin/pban.php create mode 100755 html/pages/admin/pinfo.php create mode 100755 html/pages/admin/plm.php create mode 100755 html/pages/admin/recalcflags.php create mode 100755 html/pages/admin/recalcranking.php create mode 100755 html/pages/admin/utdclog.php create mode 100755 html/pages/admin/utdcshot.php create mode 100755 html/pages/credits.php create mode 100755 html/pages/dpmatch.php create mode 100755 html/pages/graph_mbreakdown.php create mode 100755 html/pages/graph_pbreakdown.php create mode 100755 html/pages/help.php create mode 100755 html/pages/home.php create mode 100755 html/pages/index.htm create mode 100755 html/pages/maps.php create mode 100755 html/pages/maps_info.php create mode 100755 html/pages/match.php create mode 100755 html/pages/match_info.php create mode 100755 html/pages/match_info_ass.php create mode 100755 html/pages/match_info_bt.php create mode 100755 html/pages/match_info_ctf.php create mode 100755 html/pages/match_info_killsmatrix.php create mode 100755 html/pages/match_info_lms.php create mode 100755 html/pages/match_info_other.php create mode 100755 html/pages/match_info_other2.php create mode 100755 html/pages/match_info_server.php create mode 100755 html/pages/match_player.php create mode 100755 html/pages/match_report.php create mode 100755 html/pages/players.php create mode 100755 html/pages/players_explain_ranking.php create mode 100755 html/pages/players_info.php create mode 100755 html/pages/players_search.php create mode 100755 html/pages/rank.php create mode 100755 html/pages/rank_extended.php create mode 100755 html/pages/recent.php create mode 100755 html/pages/report.php create mode 100755 html/pages/report/bbcode.php create mode 100755 html/pages/report/clanbase.php create mode 100755 html/pages/report/index.htm create mode 100755 html/pages/report_cb.php create mode 100755 html/pages/servers.php create mode 100755 html/pages/servers_info.php create mode 100755 html/pages/servers_query.php create mode 100755 html/pages/totals.php create mode 100755 html/pages/watchlist.php (limited to 'html/pages') diff --git a/html/pages/admin/acelog.php b/html/pages/admin/acelog.php new file mode 100755 index 0000000..365174a --- /dev/null +++ b/html/pages/admin/acelog.php @@ -0,0 +1,318 @@ +'); +} + +// Get filter, order and set sorting +if (isset($_GET[order])) { + $order = my_addslashes($_GET[order]); + setcookie('uts_ace_order', $_GET['order'], time()+60*60*24*30*365); +} +else if (isset($_COOKIE['uts_ace_order'])){ + $order = $_REQUEST['uts_ace_order']; +} +else { + $order = "time"; +} + +if (isset($_GET[sort])) { + $sort = my_addslashes($_GET[sort]); + setcookie('uts_ace_sort', $_GET['sort'], time()+60*60*24*30*365); +} +else if (isset($_COOKIE['uts_ace_sort'])){ + $sort = $_REQUEST['uts_ace_sort']; +} +else { + $sort = ($order == "time") ? "DESC" : "ASC"; +} + +if (isset($_GET[timeout])) { + $timeout = my_addslashes($_GET[timeout]); + setcookie('uts_ace_timeout', $_GET['timeout'], time()+60*60*24*30*365); +} +else if (isset($_COOKIE['uts_ace_timeout'])){ + $timeout = $_REQUEST['uts_ace_timeout']; +} +else { + $timeout = 0; +} + +if (isset($_GET[show])) { + $show = my_addslashes($_GET[show]); + setcookie('uts_ace_show', $_GET['show'], time()+60*60*24*30*365); +} +else if (isset($_COOKIE['uts_ace_show'])){ + $show = $_REQUEST['uts_ace_show']; +} +else { + $show = "week"; +} + +if (!empty($filename)) { + if (!file_exists('logs/ace/'. $filename) or !is_file('logs/ace/'. $filename)) die('File not found'); + if (isset($_REQUEST['del'])) { + unlink('logs/ace/'. $filename); + $filename = ''; + } +} + +if (empty($filename)) { + echo ' + + +
+ + + + + + + + + + + + + '; + $logdir = opendir('logs/ace'); + $logs = array(); + $sortlogs = array(); + $i = 0; + while (false !== ($filename = readdir($logdir))) { + if (!is_file('logs/ace/'. $filename)) continue; + if ($filename == '.htaccess' or $filename == 'index.htm') continue; + + preg_match('/\d{4}\.\d{2}.\d{2}.\d{2}.\d{2}.\d{2}/', $filename, &$date); + $adate = preg_split('/\./', $date[0]); + // filter on days + if ($show != "all") { + // calculate days + $logAgeInDays = abs(strtotime(date("Y/m/d")) - strtotime("$adate[0]/$adate[1]/$adate[2]"))/68400-1; + if (($show == "day" and $logAgeInDays > 1) + or ($show == "week" and $logAgeInDays > 7) + or ($show == "month" and $logAgeInDays > 31)) { + continue; + } + } + + $i++; + $TimeStamp = "unknown"; + $PlayerName = "unknown"; + $KickReason = "unknown"; + if (substr($filename, strlen($filename) - strlen($import_ace_screenshot_extension)) == $import_ace_screenshot_extension + and substr($filename, 0, strlen($import_ace_screenshot_start)) == $import_ace_screenshot_start) { + // Screenshot + $TimeStamp = "$adate[2]-$adate[1]-$adate[0] / $adate[3]:$adate[4]:$adate[5]"; + $PlayerName = "Unknown"; + $KickReason = "Screenshot"; + } + else { + // logfile + + $fp = my_fopen('logs/ace/'.$filename, 'rb', $compression = NULL); + if (!$fp) die("Error opening file"); + + while (($line = my_fgets($fp, 5000, $compression)) !== FALSE) { + $info = preg_split('/\s/', $line, 3); + $info[2] = preg_replace('/[\r\n]+/', '', $info[2]); + if ($info[1] == "TimeStamp....:") { + $TimeStamp = $info[2]; + } + else if ($info[1] == "PlayerName...:") { + $PlayerName = $info[2]; + } + else if ($info[1] == "KickReason...:") { + $KickReason = $info[2]; + } + else if ($info[1] == "RequestedBy..:") { + $KickReason = "Requested Screenshot"; + } + else if ($info[1] == "WARNING:") { + $ainfo = preg_split('/\s/', $info[2]); + if ($ainfo[5] == "UDP") { + $TimeStamp = "$adate[2]-$adate[1]-$adate[0] / $adate[3]:$adate[4]:$adate[5]"; + $PlayerName = $ainfo[1]; + $KickReason = "Proxy/Tunnel"; + } + } + else if ($info[2] == ": Kicked - [REASON] Timeout during check spawn") { + $TimeStamp = "$adate[2]-$adate[1]-$adate[0] / $adate[3]:$adate[4]:$adate[5]"; + $PlayerName = preg_replace('/[\[\]]/', '', $info[1]); + $KickReason = "Timeout during check spawn"; + } + } + my_fclose($fp, $compression); + } + + // don't show timeout logs? + if (($timeout == 0) + and (($KickReason == "Timeout during check spawn") + or ($KickReason == "Timeout during checks") + or ($KickReason == "Timeout during initial check"))) { + continue; + } + + $logs[$i] = array($filename, $TimeStamp, $PlayerName, $KickReason); + $extra = 0; + if (substr($filename, -4) == '.bz2') $extra = 4; + if (substr($filename, -3) == '.gz') $extra = 3; + + if ($order == "time") { + $sortlogs[$i] = $date[0]; + } + else if ($order == "name") { + $sortlogs[$i] = strtolower($PlayerName); + } + else if ($order == "reason") { + $sortlogs[$i] = strtolower($KickReason); + } + } + closedir($logdir); + if (count($logs) == 0) { + echo ''; + } else { + if ($sort == "ASC") { + asort($sortlogs); + } + else { + arsort($sortlogs); + } + $i = 0; + foreach($sortlogs as $id => $date) { + $log = $logs[$id][0]; + if (empty($log)) { + continue; + } + $TimeStamp = $logs[$id][1]; + $PlayerName = $logs[$id][2]; + $KickReason = $logs[$id][3]; + $Screenshot = $logs[$id][4]; + $extra = 0; + if (substr($log, -4) == '.bz2') $extra = 4; + if (substr($log, -3) == '.gz') $extra = 3; + + $i++; + $class = ($i%2) ? 'grey' : 'grey2'; + echo ''; + } + } + echo ''; +} + + +if (!empty($filename)) { + if (!file_exists('logs/ace/'. $filename) or !is_file('logs/ace/'. $filename)) die('File not found (2)'); + echo'
Available ACE Logs:
Filter: + + Show timeouts
Time'.SortPic('time', $order, $sort).'Player Name'.SortPic('name', $order, $sort).'Kick Reason'.SortPic('reason', $order, $sort).'
No logs available!
'; + $tmp = substr($log, strlen($log) - (23 + $extra), 19); + $tmp = str_replace('.', '', $tmp); + // $ts = mtimestamp($tmp); + echo ' '.$TimeStamp.''; + echo ''; + echo ''.$PlayerName.''; + echo ''; + echo ''.$KickReason.''; + echo ''; + $d_size = file_size_info(filesize('logs/ace/'. $log)); + echo $d_size['size'] .' '. $d_size['type']; + echo ''; + echo 'Delete'; + echo '
+ + + + '; + if (substr($filename, strlen($filename) - strlen($import_ace_screenshot_extension)) == $import_ace_screenshot_extension + and substr($filename, 0, strlen($import_ace_screenshot_start)) == $import_ace_screenshot_start) { + // screenshot + echo ''; + } + else { + $fp = my_fopen('logs/ace/'.$filename, 'rb', $compression = NULL); + if (!$fp) die("Error opening file"); + + $i = 0; + echo ''; + */ + echo wordwrap(htmlentities($line), 80, '
', 1) ."
"; + $info = preg_split('/\s/', $line, 3); + $info[2] = preg_replace('/[\r\n]/', '', $info[2]); + if ($info[1] == "FileName.....:") { + $Screenshot = basename($info[2]); + } + + } + echo ''; + my_fclose($fp, $compression); + + // look for a matching ace screenshot + if (isset($Screenshot) and file_exists('logs/ace/' . $Screenshot)) { + echo ' + + + '; + + echo ''; + } + } +} + +echo ''; +if (!empty($filename)) echo''; +echo''; +echo '
'.$filename.''; + echo 'Delete'; + echo '
'; + echo ''; + echo '
'; + + while (($line = my_fgets($fp, 5000, $compression)) !== FALSE) { + /* + $i++; + $class = ($i%2) ? 'grey' : 'grey2'; + echo '
'; + echo ''; + echo htmlentities($line); + echo ''; + echo '
'.$Screenshot.''; + echo 'Delete'; + echo '
'; + echo ''; + echo '
Go Back To Logfile Overview
Go Back To Admin Page
'; + +?> diff --git a/html/pages/admin/aclog.php b/html/pages/admin/aclog.php new file mode 100755 index 0000000..ada35c8 --- /dev/null +++ b/html/pages/admin/aclog.php @@ -0,0 +1,108 @@ + + + + '; + $logdir = opendir('logs/ac'); + $logs = array(); + $sort = array(); + $i = 0; + while (false !== ($filename = readdir($logdir))) { + if (!is_file('logs/ac/'. $filename)) continue; + if ($filename == '.htaccess' or $filename == 'index.htm') continue; + $i++; + $logs[$i] = $filename; + $extra = 0; + if (substr($filename, -4) == '.bz2') $extra = 4; + if (substr($filename, -3) == '.gz') $extra = 3; + + $sort[$i] = substr($filename, strlen($filename) - (23 + $extra), 19); + } + closedir($logdir); + if (count($logs) == 0) { + echo ''; + } else { + arsort($sort); + $i = 0; + foreach($sort as $id => $date) { + $log = $logs[$id]; + $extra = 0; + if (substr($log, -4) == '.bz2') $extra = 4; + if (substr($log, -3) == '.gz') $extra = 3; + + $i++; + $class = ($i%2) ? 'grey' : 'grey2'; + echo ''; + } + } +} + + +if (!empty($filename)) { + if (!file_exists('logs/ac/'. $filename) or !is_file('logs/ac/'. $filename)) die('bla'); + echo'
Available AnthChecker Logs:
No logs available!
'; + $tmp = substr($log, strlen($log) - (23 + $extra), 19); + $tmp = str_replace('.', '', $tmp); + $ts = mtimestamp($tmp); + echo ' '.date('Y-m-d H:i', $ts).''; + echo ''; + echo ''.substr($log, 6, strlen($log) - 30 - $extra).''; + echo ''; + $d_size = file_size_info(filesize('logs/ac/'. $log)); + echo $d_size['size'] .' '. $d_size['type']; + echo ''; + echo 'Delete'; + echo '
+ + + + '; + + $fp = my_fopen('logs/ac/'.$filename, 'rb', $compression = NULL); + if (!$fp) die("Error opening file"); + + $i = 0; + echo ''; + */ + echo wordwrap(htmlentities($line), 80, '
', 1) ."
"; + } + echo ''; + my_fclose($fp, $compression); +} + +echo ''; +if (!empty($filename)) echo''; +echo''; +echo '
'.$filename.''; + echo 'Delete'; + echo '
'; + + while (($line = my_fgets($fp, 5000, $compression)) !== FALSE) { + /* + $i++; + $class = ($i%2) ? 'grey' : 'grey2'; + echo '
'; + echo ''; + echo htmlentities($line); + echo ''; + echo '
Go Back To Logfile Overview
Go Back To Admin Page
'; + +?> diff --git a/html/pages/admin/check.php b/html/pages/admin/check.php new file mode 100755 index 0000000..a03bf91 --- /dev/null +++ b/html/pages/admin/check.php @@ -0,0 +1,408 @@ + + + + +
Server configuration check

'; + +// Check access rights +echo ' + + + + '; + +// directories +foreach (array("logs", "logs/ac", "logs/backup", "logs/utdc", "logs/ace") as $dir) +{ + echo ' + + '; + if (!file_exists($dir)) { + if (mkdir($dir, 0777)) { + echo ' + '; + } + else { + echo ' + '; + } + } + else if (!is_dir($dir)) { + echo ' + '; + } + else if (!is_writable($dir)) { + if (@chmod($dir, 0777)) { + echo ' + '; + } + else { + echo ' + '; + } + } + else { + echo ' + '; + } +} + +// files: +foreach (array("includes/ftptimestamp.php") as $file) +{ + echo ' + + '; + if (!file_exists($file)) { + echo ' + '; + } + else if (!is_file($file)) { + echo ' + '; + } + else if (!is_writable($file)) { + if (@chmod($file, 0777)) { + echo ' + '; + } + else { + echo ' + '; + } + } + else { + echo ' + '; + } +} + +echo ' +
Checking access rights
', $dir, 'Created
Not found!
Not a directory!
SET
Incorrect access rights: ' , substr(sprintf('%o', fileperms($dir)), -4) , '
OK
', $file, 'Not found!
Not a file!
SET
Incorrect access rights: ' , substr(sprintf('%o', fileperms($file)), -4) , '
OK
+
* Might not work correctly on Windows systems *

'; + + +// connect to the database and check structure +echo ' + + + + '; + +// database creation array +// to add a database simply add $create_table['dbname'] = "database creation sql" +$create_table['uts_events'] = " +CREATE TABLE `uts_events` ( + `id` mediumint(10) NOT NULL auto_increment, + `matchid` mediumint(10) NOT NULL default '0', + `playerid` tinyint(3) NOT NULL default '0', + `col0` varchar(20) NOT NULL default '', + `col1` varchar(120) NOT NULL default '', + `col2` varchar(120) NOT NULL default '', + `col3` varchar(120) NOT NULL default '', + `col4` varchar(120) NOT NULL default '', + PRIMARY KEY (`id`) +); +"; + +$create_table['uts_games'] = " +CREATE TABLE `uts_games` ( + `id` tinyint(3) unsigned NOT NULL auto_increment, + `gamename` varchar(100) NOT NULL default '', + `name` varchar(100) NOT NULL default '', + PRIMARY KEY (`id`) +) ENGINE=MyISAM AUTO_INCREMENT=9 ; +"; + +$create_table['uts_gamestype'] = " +CREATE TABLE `uts_gamestype` ( + `id` smallint(5) unsigned NOT NULL auto_increment, + `serverip` varchar(21) NOT NULL default '', + `gamename` varchar(100) NOT NULL default '', + `mutator` varchar(100) NOT NULL default '', + `gid` tinyint(3) unsigned NOT NULL default '0', + PRIMARY KEY (`id`) +) ENGINE=MyISAM; +"; + +$create_table['uts_ignoreips'] = " +CREATE TABLE IF NOT EXISTS `uts_ignoreips` ( + `ip` bigint(15) NOT NULL default '0', + PRIMARY KEY (`ip`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1; +"; + +$create_table['uts_killsmatrix'] = " +CREATE TABLE `uts_killsmatrix` ( + `matchid` mediumint(8) unsigned NOT NULL default '0', + `killer` tinyint(4) NOT NULL default '0', + `victim` tinyint(4) NOT NULL default '0', + `kills` tinyint(3) unsigned NOT NULL default '0', + KEY `matchid` (`matchid`) +) ENGINE=MyISAM; +"; + +$create_table['uts_match'] = " +CREATE TABLE `uts_match` ( + `id` mediumint(10) NOT NULL auto_increment, + `time` varchar(14) default NULL, + `servername` varchar(100) NOT NULL default '', + `serverip` varchar(21) NOT NULL default '0', + `gamename` varchar(100) NOT NULL default '0', + `gid` tinyint(3) unsigned NOT NULL default '0', + `gametime` float NOT NULL default '0', + `mutators` longtext NOT NULL, + `insta` tinyint(1) NOT NULL default '0', + `tournament` varchar(5) NOT NULL default '', + `teamgame` varchar(5) NOT NULL default '', + `mapname` varchar(100) NOT NULL default '', + `mapfile` varchar(100) NOT NULL default '', + `serverinfo` mediumtext NOT NULL, + `gameinfo` mediumtext NOT NULL, + `firstblood` int(10) unsigned NOT NULL default '0', + `frags` mediumint(5) NOT NULL default '0', + `deaths` mediumint(5) NOT NULL default '0', + `kills` mediumint(5) NOT NULL default '0', + `suicides` mediumint(5) NOT NULL default '0', + `teamkills` mediumint(5) NOT NULL default '0', + `assaultid` varchar(10) NOT NULL default '', + `ass_att` tinyint(1) NOT NULL default '0', + `ass_win` tinyint(4) NOT NULL default '0', + `t0` tinyint(1) NOT NULL default '0', + `t1` tinyint(1) NOT NULL default '0', + `t2` tinyint(1) NOT NULL default '0', + `t3` tinyint(1) NOT NULL default '0', + `t0score` mediumint(5) NOT NULL default '0', + `t1score` mediumint(5) NOT NULL default '0', + `t2score` mediumint(5) NOT NULL default '0', + `t3score` mediumint(5) NOT NULL default '0', + PRIMARY KEY (`id`), + KEY `serverip` (`serverip`) +) ENGINE=MyISAM AUTO_INCREMENT=83 ; +"; + +$create_table['uts_pinfo'] = " +CREATE TABLE `uts_pinfo` ( + `id` int(10) unsigned NOT NULL auto_increment, + `name` varchar(50) NOT NULL default '', + `country` char(2) NOT NULL default '', + `banned` enum('Y','N') NOT NULL default 'N', + PRIMARY KEY (`id`), + KEY `name` (`name`(22)) +) ENGINE=MyISAM AUTO_INCREMENT=136 ; +"; + +$create_table['uts_player'] = " +CREATE TABLE `uts_player` ( + `id` mediumint(10) NOT NULL auto_increment, + `matchid` mediumint(10) NOT NULL default '0', + `insta` tinyint(1) NOT NULL default '0', + `playerid` tinyint(3) NOT NULL default '0', + `pid` int(10) unsigned NOT NULL default '0', + `team` tinyint(2) unsigned NOT NULL default '0', + `isabot` tinyint(1) NOT NULL default '0', + `country` char(2) NOT NULL default '', + `ip` int(10) unsigned NOT NULL default '0', + `gid` tinyint(3) unsigned NOT NULL default '0', + `gametime` float NOT NULL default '0', + `gamescore` smallint(5) NOT NULL default '0', + `lowping` smallint(5) unsigned NOT NULL default '0', + `highping` smallint(5) unsigned NOT NULL default '0', + `avgping` smallint(5) unsigned NOT NULL default '0', + `frags` smallint(5) NOT NULL default '0', + `deaths` smallint(5) unsigned NOT NULL default '0', + `kills` smallint(5) unsigned NOT NULL default '0', + `suicides` smallint(5) unsigned NOT NULL default '0', + `teamkills` smallint(5) unsigned NOT NULL default '0', + `eff` float NOT NULL default '0', + `accuracy` float NOT NULL default '0', + `ttl` float NOT NULL default '0', + `flag_taken` smallint(5) unsigned NOT NULL default '0', + `flag_dropped` smallint(5) unsigned NOT NULL default '0', + `flag_return` smallint(5) unsigned NOT NULL default '0', + `flag_capture` tinyint(3) unsigned NOT NULL default '0', + `flag_cover` smallint(5) unsigned NOT NULL default '0', + `flag_seal` smallint(5) unsigned NOT NULL default '0', + `flag_assist` smallint(5) unsigned NOT NULL default '0', + `flag_kill` mediumint(5) unsigned NOT NULL default '0', + `flag_pickedup` smallint(5) unsigned NOT NULL default '0', + `dom_cp` smallint(5) unsigned NOT NULL default '0', + `ass_obj` smallint(5) unsigned NOT NULL default '0', + `spree_double` smallint(5) unsigned NOT NULL default '0', + `spree_triple` smallint(5) unsigned NOT NULL default '0', + `spree_multi` smallint(5) unsigned NOT NULL default '0', + `spree_mega` tinyint(3) unsigned NOT NULL default '0', + `spree_ultra` tinyint(3) unsigned NOT NULL default '0', + `spree_monster` tinyint(3) unsigned NOT NULL default '0', + `spree_kill` smallint(5) unsigned NOT NULL default '0', + `spree_rampage` smallint(5) unsigned NOT NULL default '0', + `spree_dom` tinyint(3) unsigned NOT NULL default '0', + `spree_uns` tinyint(3) unsigned NOT NULL default '0', + `spree_god` smallint(5) unsigned NOT NULL default '0', + `pu_pads` tinyint(3) unsigned NOT NULL default '0', + `pu_armour` tinyint(3) unsigned NOT NULL default '0', + `pu_keg` tinyint(3) unsigned NOT NULL default '0', + `pu_invis` tinyint(3) unsigned NOT NULL default '0', + `pu_belt` tinyint(3) unsigned NOT NULL default '0', + `pu_amp` tinyint(3) unsigned NOT NULL default '0', + `rank` float NOT NULL default '0', + PRIMARY KEY (`id`), + KEY `matchid` (`matchid`,`team`), + KEY `pid` (`pid`), + KEY `gid` (`gid`) +) ENGINE=MyISAM AUTO_INCREMENT=615 ; +"; + +$create_table['uts_rank'] = " +CREATE TABLE `uts_rank` ( + `id` mediumint(10) NOT NULL auto_increment, + `time` float unsigned NOT NULL default '0', + `pid` int(10) unsigned NOT NULL default '0', + `gid` tinyint(3) unsigned NOT NULL default '0', + `rank` float NOT NULL default '0', + `prevrank` float NOT NULL default '0', + `matches` mediumint(5) NOT NULL default '0', + PRIMARY KEY (`id`), + KEY `name` (`pid`,`gid`), + KEY `rank` (`rank`), + KEY `gamename` (`gid`,`rank`) +) ENGINE=MyISAM AUTO_INCREMENT=173 ; +"; + +$create_table['uts_weapons'] = " +CREATE TABLE `uts_weapons` ( + `id` tinyint(3) unsigned NOT NULL auto_increment, + `name` varchar(100) NOT NULL default '', + `image` varchar(50) NOT NULL default '', + `sequence` tinyint(3) unsigned NOT NULL default '200', + `hide` enum('N','Y') NOT NULL default 'N', + PRIMARY KEY (`id`), + KEY `name` (`name`(20)) +) ENGINE=MyISAM AUTO_INCREMENT=20 ; +"; + +$create_table['uts_weaponstats'] = " +CREATE TABLE `uts_weaponstats` ( + `matchid` mediumint(8) unsigned NOT NULL default '0', + `pid` int(10) unsigned NOT NULL default '0', + `weapon` tinyint(3) unsigned NOT NULL default '0', + `kills` mediumint(8) unsigned NOT NULL default '0', + `shots` int(10) unsigned NOT NULL default '0', + `hits` int(10) unsigned NOT NULL default '0', + `damage` int(10) unsigned NOT NULL default '0', + `acc` float unsigned NOT NULL default '0', + KEY `full` (`matchid`,`pid`) +) ENGINE=MyISAM; +"; + +foreach ($create_table as $table => $query) { + echo ' + + '; + if (small_count("SHOW TABLES LIKE '$table'") == 1) { + // database exists, check columns + echo ' + '; + } + else { + if (mysql_query($query)) { + echo ' + '; + } + else { + echo ' + '; + } + } +} +echo ' +
Checking mysql tables
', $table, 'OK
Created
Not found!

'; + +// Check the weapons +$create_weapon['Translocator'] = "INSERT INTO `uts_weapons` VALUES (1, 'Translocator', 'trans.jpg', 1, 'N');"; +$create_weapon['Impact Hammer'] = "INSERT INTO `uts_weapons` VALUES (2, 'Impact Hammer', 'impact.jpg', 2, 'N');"; +$create_weapon['Enforcer'] = "INSERT INTO `uts_weapons` VALUES (3, 'Enforcer', 'enforcer.jpg', 3, 'N');"; +$create_weapon['Double Enforcer'] = "INSERT INTO `uts_weapons` VALUES (4, 'Double Enforcer', 'enforcer2.jpg', 4, 'N');"; +$create_weapon['GES Bio Rifle'] = "INSERT INTO `uts_weapons` VALUES (5, 'GES Bio Rifle', 'bio.jpg', 5, 'N');"; +$create_weapon['Ripper'] = "INSERT INTO `uts_weapons` VALUES (6, 'Ripper', 'ripper.jpg', 6, 'N');"; +$create_weapon['Shock Rifle'] = "INSERT INTO `uts_weapons` VALUES (7, 'Shock Rifle', 'shock.jpg', 7, 'N');"; +$create_weapon['Enhanced Shock Rifle'] = "INSERT INTO `uts_weapons` VALUES (8, 'Enhanced Shock Rifle', 'ishock.jpg', 8, 'N');"; +$create_weapon['Pulse Gun'] = "INSERT INTO `uts_weapons` VALUES (9, 'Pulse Gun', 'pulse.jpg', 9, 'N');"; +$create_weapon['Minigun'] = "INSERT INTO `uts_weapons` VALUES (10, 'Minigun', 'minigun.jpg', 10, 'N');"; +$create_weapon['Flak Cannon'] = "INSERT INTO `uts_weapons` VALUES (11, 'Flak Cannon', 'flak.jpg', 11, 'N');"; +$create_weapon['Rocket Launcher'] = "INSERT INTO `uts_weapons` VALUES (12, 'Rocket Launcher', 'rockets.jpg', 12, 'N');"; +$create_weapon['Sniper Rifle'] = "INSERT INTO `uts_weapons` VALUES (13, 'Sniper Rifle', 'sniper.jpg', 13, 'N');"; +$create_weapon['Redeemer'] = "INSERT INTO `uts_weapons` VALUES (14, 'Redeemer', 'deemer.jpg', 14, 'N');"; +$create_weapon['None'] = "INSERT INTO `uts_weapons` VALUES (15, 'None', 'blank.jpg', 15, 'N');"; +$create_weapon['Chainsaw'] = "INSERT INTO `uts_weapons` VALUES (16, 'Chainsaw', 'chainsaw.jpg', 16, 'N');"; + +echo ' + + + + '; +if (small_count("SHOW TABLES LIKE 'uts_weapons'") != 1) { + // database exists, check columns + echo ' + '; +} +else { + foreach ($create_weapon as $weapon => $query) { + echo ' + + '; + if (small_count("SELECT id FROM uts_weapons WHERE name = '$weapon' LIMIT 0,1") == 1) { + // database exists, check columns + echo ' + '; + } + else { + if (mysql_query($query)) { + echo ' + '; + } + else { + echo ' + '; + } + } + } +} +echo ' +
Checking supported weapons
Table uts_weapons does not exist!
', $weapon, 'OK
Added
Not found!

'; + +echo ' + + + + '; + + echo ' + + '; + + $q = mysql_query("UPDATE uts_events SET col3 = ROUND(CEILING((col3-1)*100/1.1) / 100, 2), col1 = 'btcap' WHERE col1 = 'cap'"); + $affected = mysql_affected_rows(); + + if ($affected == -1) { + echo ' + +
Checking data
Fix BT cap timesFailed
'; + } + else { + echo ' + +
Updated ' . $affected . ' rows.

'; + } + +echo ' +
+ '; +echo ''; +echo '
Go Back To Admin Page
'; + +?> \ No newline at end of file diff --git a/html/pages/admin/dmatch.php b/html/pages/admin/dmatch.php new file mode 100755 index 0000000..9fed97d --- /dev/null +++ b/html/pages/admin/dmatch.php @@ -0,0 +1,105 @@ + + + + + + '; +$sql_radjust = "SELECT pid, gid, rank FROM uts_player WHERE matchid = $matchid"; +$q_radjust = mysql_query($sql_radjust) or die(mysql_error()); +$pids = array(); +while ($r_radjust = mysql_fetch_array($q_radjust)) { + + $pid = $r_radjust[pid]; + $pids[] = $pid; + $gid = $r_radjust[gid]; + $rank = $r_radjust[rank]; + + $sql_crank = small_query("SELECT id, rank, matches FROM uts_rank WHERE pid = $pid AND gid = $gid"); + if (!$sql_crank) continue; + + $rid = $sql_crank[id]; + $newrank = $sql_crank[rank]-$rank; + $oldrank = $sql_crank[rank]; + $matchcount = $sql_crank[matches]-1; + + mysql_query("UPDATE uts_rank SET rank = $newrank, prevrank = $oldrank, matches = $matchcount WHERE id = $rid") or die(mysql_error()); + mysql_query("DELETE FROM uts_rank WHERE matches = 0") or die(mysql_error()); +} + echo' + + + '; +mysql_query("DELETE FROM uts_match WHERE id = $matchid") or die(mysql_error()); + echo' + + + '; +mysql_query("DELETE FROM uts_player WHERE matchid = $matchid") or die(mysql_error()); + echo' + + + '; +mysql_query("DELETE FROM uts_killsmatrix WHERE matchid = $matchid") or die(mysql_error()); + echo' + + + '; +mysql_query("DELETE FROM uts_weaponstats WHERE matchid = $matchid") or die(mysql_error()); + echo' + + + '; +foreach($pids as $pid) { + mysql_query("DELETE FROM uts_weaponstats WHERE matchid IN ('$matchid','0') AND pid = '$pid'") or die(mysql_error()); + + $q_weaponstats = mysql_query("SELECT weapon, SUM(kills) AS kills, SUM(shots) AS shots, SUM(hits) as hits, SUM(damage) as damage, AVG(acc) AS acc FROM uts_weaponstats WHERE pid = '$pid' GROUP BY weapon") or die(mysql_error()); + while ($r_weaponstats = mysql_fetch_array($q_weaponstats)) { + mysql_query("INSERT INTO uts_weaponstats SET matchid='0', pid='$pid', weapon='${r_weaponstats['weapon']}', kills='${r_weaponstats['kills']}', shots='${r_weaponstats['shots']}', hits='${r_weaponstats['hits']}', damage='${r_weaponstats['damage']}', acc='${r_weaponstats['acc']}'") or die(mysql_error()); + } +} + echo' + + + '; + mysql_query("DELETE FROM uts_weaponstats WHERE matchid='0' AND pid='0'") or die(mysql_error()); + + $q_weaponstats = mysql_query("SELECT weapon, SUM(kills) AS kills, SUM(shots) AS shots, SUM(hits) as hits, SUM(damage) as damage, AVG(acc) AS acc FROM uts_weaponstats WHERE matchid = '0' GROUP BY weapon") or die(mysql_error()); + while ($r_weaponstats = mysql_fetch_array($q_weaponstats)) { + mysql_query("INSERT INTO uts_weaponstats SET matchid='0', pid='0', weapon='${r_weaponstats['weapon']}', kills='${r_weaponstats['kills']}', shots='${r_weaponstats['shots']}', hits='${r_weaponstats['hits']}', damage='${r_weaponstats['damage']}', acc='${r_weaponstats['acc']}'") or die(mysql_error()); + } + + echo' + + + '; +mysql_query("DELETE FROM uts_events WHERE matchid = $matchid") or die(mysql_error()); + echo' + + + +
Deleting Match ID '.$matchid.'
Adjusting RankingsDone
Removing Match Record:Done
Removing Player Records:Done
Removing Kill Matrix Entries:Done
Removing Weapon Stats:Done
Amending Player Weapon Stats:Done
Amending Global Weapon Stats:Done
Removing events:Done
Match Deleted - Go Back To Admin Page
'; + + +?> diff --git a/html/pages/admin/dplayer.php b/html/pages/admin/dplayer.php new file mode 100755 index 0000000..0239e5d --- /dev/null +++ b/html/pages/admin/dplayer.php @@ -0,0 +1,76 @@ + + + Deleting Player + + + Removing Kill Matrix Entries:'; + $q_match = mysql_query("SELECT matchid, playerid FROM uts_player WHERE pid = '$pid'") or die(mysql_error()); + while ($r_match = mysql_fetch_array($q_match)) { + mysql_query("DELETE FROM uts_killsmatrix WHERE matchid = '${r_match['matchid']}' AND (killer = '${r_match['playerid']}' OR victim = '${r_match['playerid']}')") or die(mysql_error()); + } + echo'Done + + + + Removing Player Info:'; +$r_pinfo = small_query("SELECT banned FROM uts_pinfo WHERE id = $playerid"); +if ($r_pinfo['banned'] != 'Y') { + mysql_query("DELETE FROM uts_pinfo WHERE id = $playerid") or die(mysql_error()); + echo'Done'; +} else { + echo'No (player banned)'; +} +echo ' + + + Removing Player Match Events:'; +mysql_query("DELETE e.* FROM uts_player as p, uts_events as e WHERE p.pid = $playerid AND p.playerid = e.playerid AND p.matchid = e.matchid") or die(mysql_error()); + echo'Done + + + Removing Player Match Records:'; +mysql_query("DELETE FROM uts_player WHERE pid = $playerid") or die(mysql_error()); + echo'Done + + + Removing Player Rank:'; +mysql_query("DELETE FROM uts_rank WHERE pid = $playerid") or die(mysql_error()); + echo'Done + + + Removing Player Weapon Stats:'; +mysql_query("DELETE FROM uts_weaponstats WHERE pid = $playerid") or die(mysql_error()); + echo'Done + + + Amending Global Weapon Stats:'; + mysql_query("DELETE FROM uts_weaponstats WHERE matchid='0' AND pid='0'") or die(mysql_error()); + + $q_weaponstats = mysql_query("SELECT weapon, SUM(kills) AS kills, SUM(shots) AS shots, SUM(hits) as hits, SUM(damage) as damage, AVG(acc) AS acc FROM uts_weaponstats WHERE matchid = '0' GROUP BY weapon") or die(mysql_error()); + while ($r_weaponstats = mysql_fetch_array($q_weaponstats)) { + mysql_query("INSERT INTO uts_weaponstats SET matchid='0', pid='0', weapon='${r_weaponstats['weapon']}', kills='${r_weaponstats['kills']}', shots='${r_weaponstats['shots']}', hits='${r_weaponstats['hits']}', damage='${r_weaponstats['damage']}', acc='${r_weaponstats['acc']}'") or die(mysql_error()); + } + + echo'Done + + + Player Deleted - Go Back To Admin Page +'; +?> diff --git a/html/pages/admin/dpmatch.php b/html/pages/admin/dpmatch.php new file mode 100755 index 0000000..b021054 --- /dev/null +++ b/html/pages/admin/dpmatch.php @@ -0,0 +1,106 @@ + + + +'; + +echo' + '; + +$q_radjust = small_query("SELECT pid, gid, rank FROM uts_player WHERE id = $pid"); +if (!$q_radjust) { + $sql_crank = false; +} else { + $rank_pid = $q_radjust[pid]; + $rank_gid = $q_radjust[gid]; + $rank = $q_radjust[rank]; + + $sql_crank = small_query("SELECT id, rank, matches FROM uts_rank WHERE pid = $rank_pid AND gid = '$rank_gid'"); +} +if (!$sql_crank) { + echo''; +} else { + $rid = $sql_crank[id]; + $newrank = $sql_crank[rank]-$rank; + $oldrank = $sql_crank[rank]; + $matchcount = $sql_crank[matches]-1; + + mysql_query("UPDATE uts_rank SET rank = $newrank, prevrank = $oldrank, matches = $matchcount WHERE id = $rid") or die(mysql_error()); + mysql_query("DELETE FROM uts_rank WHERE matches = 0") or die(mysql_error()); + + echo''; +} +echo' + + '; + $q_match = mysql_query("SELECT matchid, playerid FROM uts_player WHERE pid = '$pid' and matchid = '$matchid'") or die(mysql_error()); + while ($r_match = mysql_fetch_array($q_match)) { + mysql_query("DELETE FROM uts_killsmatrix WHERE matchid = '${r_match['matchid']}' AND (killer = '${r_match['playerid']}' OR victim = '${r_match['playerid']}')") or die(mysql_error()); + } + echo' + + + + + '; +mysql_query("DELETE FROM uts_weaponstats WHERE matchid = $matchid AND pid = $pid") or die(mysql_error()); + echo' + + + '; +mysql_query("DELETE e.* FROM uts_events as e, uts_player as p WHERE p.pid = '$pid' AND e.matchid = $matchid AND p.playerid = e.playerid AND p.matchid = e.matchid") or die(mysql_error()); + echo' + + + '; +mysql_query("DELETE FROM uts_player WHERE matchid IN ('$matchid','0') AND pid = '$pid'") or die(mysql_error()); + echo' + + + '; +mysql_query("DELETE FROM uts_weaponstats WHERE matchid IN ('$matchid','0') AND pid = '$pid'") or die(mysql_error()); + +$q_weaponstats = mysql_query("SELECT SUM(kills) AS kills, SUM(shots) AS shots, SUM(hits) as hits, SUM(damage) as damage, AVG(acc) AS acc FROM uts_weaponstats WHERE pid = '$pid' GROUP BY weapon") or die(mysql_error()); +while ($r_weaponstats = mysql_fetch_array($q_weaponstats)) { + mysql_query("INSERT INTO uts_weaponstats SET matchid='0', pid='$pid', kills='${r_weaponstats['kills']}', shots='${r_weaponstats['shots']}', hits='${r_weaponstats['hits']}', damage='${r_weaponstats['damage']}', acc='${r_weaponstats['acc']}'") or die(mysql_error()); +} + echo' + + + '; + mysql_query("DELETE FROM uts_weaponstats WHERE matchid='0' AND pid='0'") or die(mysql_error()); + + $q_weaponstats = mysql_query("SELECT weapon, SUM(kills) AS kills, SUM(shots) AS shots, SUM(hits) as hits, SUM(damage) as damage, AVG(acc) AS acc FROM uts_weaponstats WHERE matchid = '0' GROUP BY weapon") or die(mysql_error()); + while ($r_weaponstats = mysql_fetch_array($q_weaponstats)) { + mysql_query("INSERT INTO uts_weaponstats SET matchid='0', pid='0', weapon='${r_weaponstats['weapon']}', kills='${r_weaponstats['kills']}', shots='${r_weaponstats['shots']}', hits='${r_weaponstats['hits']}', damage='${r_weaponstats['damage']}', acc='${r_weaponstats['acc']}'") or die(mysql_error()); + } + + echo' + + + +
Delete Player From Match ID '.$matchid.'
Amending Players Rank:Player not in rankingsDone
Removing Kill Matrix Entries:Done
Removing Player Weapon Stats:Done
Removing Player Events:Done
Removing Player From Match:Done
Amending Player Weapon Stats:Done
Amending Global Weapon Stats:Done
Match Deleted - Go Back To Admin Page
'; + +?> diff --git a/html/pages/admin/editgames.php b/html/pages/admin/editgames.php new file mode 100755 index 0000000..3f7a542 --- /dev/null +++ b/html/pages/admin/editgames.php @@ -0,0 +1,74 @@ + $bla) { + if ($id == 0) { + if (empty($_REQUEST['name'][$id])) continue; + mysql_query(" INSERT INTO uts_games + SET name = '". my_addslashes($_REQUEST['name'][$id]) ."', + gamename = '(user defined)';") or die(mysql_error()); + } else { + mysql_query(" UPDATE uts_games + SET name = '". my_addslashes($_REQUEST['name'][$id]) ."' + WHERE id = '$id';") or die(mysql_error()); + } + } +} + +echo'
+ + + + + + + + + + +'; + + +$sql_games = "SELECT id, gamename, name FROM uts_games ORDER BY gamename ASC;"; +$q_games = mysql_query($sql_games) or die(mysql_error()); +$i = 0; +while ($r_games = mysql_fetch_array($q_games)) { + $i++; + $class = ($i%2) ? 'grey' : 'grey2'; + echo ''; + echo ''; + echo ''; + echo ''; +} +echo' + + + + + + + + + + + + + + + + +'; + + +echo ''; +echo ''; +echo ''; + +echo' + + + +
Edit games
GameNameDisplayName
'.htmlentities($r_games['gamename']).'
 
Add new
(n/a)
 
Submit
Go Back To Admin Page
'; + +?> diff --git a/html/pages/admin/editgamestype.php b/html/pages/admin/editgamestype.php new file mode 100755 index 0000000..d9e4ff1 --- /dev/null +++ b/html/pages/admin/editgamestype.php @@ -0,0 +1,228 @@ + ''); +$serverips = array('0' => '*'); +while ($r_server = mysql_fetch_array($q_server)) { + $servernames[$r_server['id']] = $r_server['servername']; + $serverips[$r_server['id']] = $r_server['serverip']; +} + +$sql_games = "SELECT id, gamename, name FROM uts_games ORDER BY gamename ASC"; +$q_games = mysql_query($sql_games) or die(mysql_error()); +$gamedisplaynames = array('0' => ''); +$gamenames = array('0' => '*'); +while ($r_games = mysql_fetch_array($q_games)) { + $gamenames[$r_games['id']] = $r_games['gamename']; + $gamedisplaynames[$r_games['id']] = $r_games['name']; +} + + +if (isset($_REQUEST['submit'])) { + mysql_query(" INSERT INTO uts_gamestype + SET serverip = '". my_addslashes($_REQUEST['serverip']) ."', + gamename = '". my_addslashes($_REQUEST['gamename']) ."', + mutator = '". my_addslashes($_REQUEST['mutator']) ."', + gid = '". my_addslashes($_REQUEST['gid']) ."' + ") or die(mysql_error()); + + if (isset($_REQUEST['update'])) { + echo'
+ + + + + + + + '; + $where = 'WHERE 1'; + if ($_REQUEST['serverip'] != '*') { + $where .= " AND m.serverip = '". my_addslashes($_REQUEST['serverip']) ."'"; + } + if ($_REQUEST['gamename'] != '*') { + $gids = array_keys($gamenames, my_stripslashes($_REQUEST['gamename'])); + $where .= " AND m.gid IN (".implode(',', $gids).")"; + } + if ($_REQUEST['mutator'] != '*') { + $where .= " AND m.mutators LIKE '%".my_addslashes($_REQUEST['mutator'])."%'"; + } + + mysql_query("UPDATE uts_player p, uts_match m SET p.gid = '". my_addslashes($_REQUEST['gid']) ."' $where AND m.id = p.matchid;") or die(mysql_error()); + echo' + + + + + + + '; + mysql_query("UPDATE uts_match m SET m.gid = '". my_addslashes($_REQUEST['gid']) ."' $where;") or die(mysql_error()); + echo' + + + + + + + + '; + + if ($_REQUEST['gamename'] != '*') { + $gids[] = $_REQUEST['gid']; + $where = "WHERE gid IN (".implode(',', $gids).")"; + } else { + $where = 'WHERE 1'; + } + mysql_query("DELETE FROM uts_rank $where;") or die(mysql_error()); + + $sql_nrank = "SELECT SUM(p.gametime) AS time, p.pid, p.gid, SUM(p.rank) AS rank, COUNT(p.matchid) AS matches FROM uts_player p, uts_pinfo pi $where AND pi.id = p.pid AND pi.banned <> 'Y' GROUP BY p.gid, p.pid"; + $q_nrank = mysql_query($sql_nrank) or die(mysql_error()); + $num_ranks = 0; + while ($r_nrank = mysql_fetch_array($q_nrank)) { + mysql_query("INSERT INTO uts_rank SET time = '${r_nrank['time']}', pid = ${r_nrank['pid']}, gid = ${r_nrank['gid']}, rank = '${r_nrank['rank']}', prevrank = '${r_nrank['rank']}', matches = ${r_nrank['matches']}") or die(mysql_error()); + $num_ranks++; + } + echo' + + + + +
Updating...
Updating Player RecordsDone (updated '.mysql_affected_rows().' records)
Updating MatchesDone (updated '.mysql_affected_rows().' matches)
Re-Calcuating RankingsDone (recalculated '.$num_ranks.' rankings)
Update finished..
'; + } +} + +if (isset($_REQUEST['del'])) { + mysql_query(" DELETE FROM uts_gamestype + WHERE id = '". my_addslashes($_REQUEST['del']) ."' + ") or die(mysql_error()); +} + + + +echo'
+ + + + + + + + + + + + +'; + + + + + + +$sql_gamestype = "SELECT id, serverip, gamename, mutator, gid FROM uts_gamestype ORDER BY id ASC;"; +$q_gamestype = mysql_query($sql_gamestype) or die(mysql_error()); +$i = 0; +while ($r_gamestype = mysql_fetch_array($q_gamestype)) { + $i++; + $class = ($i%2) ? 'grey' : 'grey2'; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; +} + +echo '
Current Mappings
 Server IP Game Name Mutatorlist contains Game
 '.htmlentities($r_gamestype['serverip']).'+ '.htmlentities($r_gamestype['gamename']).'+ '.htmlentities($r_gamestype['mutator']).'= '.htmlentities($gamedisplaynames[$r_gamestype['gid']]).''; + echo ''; + echo 'Delete'; + echo ''; + echo '
'; + + + + + + + + +echo'
+ + + + + + +'; + +$class='grey'; +echo ''; +echo ''; +echo ''; + + +echo ''; +echo ''; + + +echo ''; +echo ''; + + +echo ''; +echo ''; + +echo ''; +echo ''; + + +echo ''; +echo ''; +echo ''; + +echo' + + + +
Add new gamestype
If server ='; +echo ''; +echo '
and gamename ='; + +echo ''; +echo '
and mutatorlist contains'; +echo ' (case insensitive substring)'; +echo '
==> assume gametype:'; + +echo ''; +echo '
Update existing matches:'; +echo ' (this cannot be undone easily!)'; +echo '
Go Back To Admin Page
'; + +?> diff --git a/html/pages/admin/editweapons.php b/html/pages/admin/editweapons.php new file mode 100755 index 0000000..2baeab9 --- /dev/null +++ b/html/pages/admin/editweapons.php @@ -0,0 +1,58 @@ + $bla) { + mysql_query(" UPDATE uts_weapons + SET image = '". my_addslashes($_REQUEST['image'][$id]) ."', + sequence = '". my_addslashes($_REQUEST['sequence'][$id]) ."', + hide = '". (isset($_REQUEST['hide'][$id]) ? 'Y' : 'N') ."' + WHERE id = '$id';") or die(mysql_error()); + } +} + +echo'
+ + + + + + + + + + + + +'; + + +$sql_weapons = "SELECT id, name, image, sequence, hide FROM uts_weapons ORDER BY sequence ASC;"; +$q_weapons = mysql_query($sql_weapons) or die(mysql_error()); +$i = 0; +while ($r_weapons = mysql_fetch_array($q_weapons)) { + $i++; + $class = ($i%2) ? 'grey' : 'grey2'; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; +} + +echo ''; +echo ''; +echo ''; + +echo' + + +
Edit weapons
NameShould exist in images/weapons/
Leave empty to display the weapon name').'>Image
OrderHide
'.htmlentities($r_weapons['name']).''; + echo '
'; + echo ''; + echo ''; + if (!empty($r_weapons['image'])) echo ' '; + echo'
Go Back To Admin Page
'; + +?> diff --git a/html/pages/admin/emptydb.php b/html/pages/admin/emptydb.php new file mode 100755 index 0000000..9eee7d2 --- /dev/null +++ b/html/pages/admin/emptydb.php @@ -0,0 +1,62 @@ + + + + + + '; + mysql_query("TRUNCATE uts_events;") or die(mysql_error()); + mysql_query("TRUNCATE uts_games;") or die(mysql_error()); + mysql_query("TRUNCATE uts_gamestype;") or die(mysql_error()); + mysql_query("TRUNCATE uts_killsmatrix;") or die(mysql_error()); + mysql_query("TRUNCATE uts_match;") or die(mysql_error()); + mysql_query("TRUNCATE uts_pinfo;") or die(mysql_error()); + mysql_query("TRUNCATE uts_player;") or die(mysql_error()); + mysql_query("TRUNCATE uts_rank;") or die(mysql_error()); + mysql_query("DELETE FROM uts_weapons WHERE id > 19") or die(mysql_error()); + mysql_query("ALTER TABLE uts_weapons AUTO_INCREMENT=20") or die(mysql_error()); + mysql_query("TRUNCATE uts_weaponstats;") or die(mysql_error()); + echo' + + + +
Empty Database
Emptying All Tables but uts_ip2country and uts_weaponstatsDone
Database Emptied - Go Back To Admin Page
'; +} else { + echo'
+ + + + + + + + + +
Empty Database
Database Not EmptiedAnswer Was No
Database Not Emptied - Go Back To Admin Page
'; +} + + +?> diff --git a/html/pages/admin/index.htm b/html/pages/admin/index.htm new file mode 100755 index 0000000..e69de29 diff --git a/html/pages/admin/ipsearch.php b/html/pages/admin/ipsearch.php new file mode 100755 index 0000000..4ac9731 --- /dev/null +++ b/html/pages/admin/ipsearch.php @@ -0,0 +1,58 @@ + + + +'; + + +$sql_players = "SELECT pi.name, pi.id AS pid FROM uts_player p, uts_pinfo pi WHERE p.pid = pi.id AND p.ip BETWEEN INET_ATON('$ip_from') AND INET_ATON('$ip_to') GROUP BY pid"; +$q_players = mysql_query($sql_players) or die(mysql_error()); +$j = 0; +while ($r_players = mysql_fetch_array($q_players)) { + echo ''; + echo ''; + $sql_recent = "SELECT m.time AS time, m.id AS mid, INET_NTOA(p.ip) AS ip FROM uts_player p, uts_match m WHERE m.id = p.matchid AND p.pid = '${r_players['pid']}' AND p.ip BETWEEN INET_ATON('$ip_from') AND INET_ATON('$ip_to') ORDER BY m.time DESC LIMIT 0,5"; + echo ''; +} + + +echo' + +
Players using IPs '.$ip_from.' - '.$ip_to.' and their last 5 matches using these IPs
'; + echo ''.$r_players['name'].''; + echo ''; + $q_recent= mysql_query($sql_recent) or die(mysql_error()); + while ($r_recent = mysql_fetch_array($q_recent)) { + $j++; + $class = ($j%2) ? 'grey' : 'grey2'; + echo ''; + } + echo '
'; + echo ''.mdate($r_recent['time']).''; + echo ''; + echo $r_recent['ip']; + echo '
Go Back To Admin Page
'; +?> diff --git a/html/pages/admin/main.php b/html/pages/admin/main.php new file mode 100755 index 0000000..4d60302 --- /dev/null +++ b/html/pages/admin/main.php @@ -0,0 +1,117 @@ + + + Database Statistics +'; + +$q_dbsize = mysql_query("SHOW table STATUS") or die(mysql_error()); +$tot_size = 0; +$tot_rows = 0; +$max_size = 0; +while ($r_dbsize = mysql_fetch_array($q_dbsize)) { + if (substr($r_dbsize['Name'], 0, 4) != 'uts_') continue; + $size = $r_dbsize['Data_length'] + $r_dbsize['Index_length']; + $rows = $r_dbsize['Rows']; + $tables[] = array ( + 'name' => $r_dbsize['Name'], + 'size' => $size, + 'rows' => $rows + ); + $tot_size += $size; + $tot_rows += $rows; + if ($max_size < $size) $max_size = $size; + +} + +$i = 0; +foreach($tables as $table) { + $i++; + $class = ($i%2) ? 'grey' : 'grey2'; + + $d_size = file_size_info($table['size']); + $title = get_dp($table['size'] / $tot_size * 100) .' %'; + echo' + '; + if (substr($table['name'], 0, 9) == 'uts_temp_' and strlen($table['name']) == 17) { + echo 'Delete'.$table['name'].''; + } else { + echo $table['name']; + } + echo ' + '.nf($table['rows']).' rows + '.$d_size['size'] .' '. $d_size['type'].' + '. $title .' + '; +} + +$d_size = file_size_info($tot_size); +echo' + Total Database Size + '.nf($tot_rows).' rows + '.$d_size['size'] .' '. $d_size['type'].' +   + +
'; + +echo' +
'; + +echo ' + +'; + + + +echo'
'; +?> diff --git a/html/pages/admin/mplayers.php b/html/pages/admin/mplayers.php new file mode 100755 index 0000000..3754d99 --- /dev/null +++ b/html/pages/admin/mplayers.php @@ -0,0 +1,91 @@ + + + + + + '; +mysql_query("DELETE FROM uts_pinfo WHERE id = $mplayer2") or die(mysql_error()); + echo' + + + '; +mysql_query("UPDATE uts_player SET pid = $mplayer1 WHERE pid = $mplayer2") or die(mysql_error()); + echo' + + + '; +mysql_query("UPDATE uts_weaponstats SET pid = $mplayer1 WHERE pid = $mplayer2") or die(mysql_error()); +mysql_query("DELETE FROM uts_weaponstats WHERE pid = $mplayer2") or die(mysql_error()); + echo' + + + '; +mysql_query("DELETE FROM uts_weaponstats WHERE matchid='0' AND pid = '$mplayer1'") or die(mysql_error()); + +$q_weaponstats = mysql_query("SELECT weapon, SUM(kills) AS kills, SUM(shots) AS shots, SUM(hits) as hits, SUM(damage) as damage, AVG(acc) AS acc FROM uts_weaponstats WHERE pid = '$mplayer1' GROUP BY weapon") or die(mysql_error()); +while ($r_weaponstats = mysql_fetch_array($q_weaponstats)) { + mysql_query("INSERT INTO uts_weaponstats SET matchid='0', pid='$mplayer1', weapon='${r_weaponstats['weapon']}', kills='${r_weaponstats['kills']}', shots='${r_weaponstats['shots']}', hits='${r_weaponstats['hits']}', damage='${r_weaponstats['damage']}', acc='${r_weaponstats['acc']}'") or die(mysql_error()); +} + echo' + + + '; +mysql_query("UPDATE uts_match SET firstblood = $mplayer1 WHERE firstblood = $mplayer2") or die(mysql_error()); + echo' + + + '; +mysql_query("UPDATE uts_rank SET pid = $mplayer2 WHERE pid= $mplayer1") or die(mysql_error()); + echo' + + + '; + +$sql_nrank = "SELECT SUM(time) AS time, pid, gid, AVG(rank) AS rank, AVG(prevrank) AS prevrank, SUM(matches) AS matches FROM uts_rank WHERE pid = $mplayer2 GROUP BY pid, gid"; +$q_nrank = mysql_query($sql_nrank) or die(mysql_error()); +while ($r_nrank = mysql_fetch_array($q_nrank)) { + + mysql_query("INSERT INTO uts_rank SET time = '$r_nrank[time]', pid = $mplayer1, gid = $r_nrank[gid], rank = '$r_nrank[rank]', prevrank = '$r_nrank[prevrank]', matches = $r_nrank[matches]") or die(mysql_error()); +} + + echo' + + + '; +mysql_query("DELETE FROM uts_rank WHERE pid = $mplayer2") or die(mysql_error()); + echo' + + + + +
Merging '.$mp2name[name].' Into '.$mp1name[name].'
Removing Info RecordsDone
Updating Player RecordsDone
Updating Weapon RecordsDone
Amending Player Weapon Stats:Done
Updating First Blood RecordsDone
Temporary RankDone
Creating New RankDone
Removing Old RankDone
Player Record Merged - Go Back To Admin Page
'; + +?> diff --git a/html/pages/admin/mservers.php b/html/pages/admin/mservers.php new file mode 100755 index 0000000..b52a9d1 --- /dev/null +++ b/html/pages/admin/mservers.php @@ -0,0 +1,41 @@ + + + + + + '; +mysql_query("UPDATE uts_match SET serverip = '". addslashes($q_myserver1[serverip]) ."', servername = '". addslashes($q_myserver1[servername]) ."' WHERE serverip = '". addslashes($q_myserver2[serverip]) ."' and servername = '". addslashes($q_myserver2[servername]) ."'") or die(mysql_error()); + echo' + + + +
Merging '.$q_myserver2[servername].' ('.$q_myserver2[serverip].')
+ Into '.$q_myserver1[servername].' ('.$q_myserver1[serverip].')
Merging RecordsDone
Server Records Merged - Go Back To Admin Page
'; + +?> diff --git a/html/pages/admin/pban.php b/html/pages/admin/pban.php new file mode 100755 index 0000000..f421ef5 --- /dev/null +++ b/html/pages/admin/pban.php @@ -0,0 +1,74 @@ + + + + + + '; + mysql_query("DELETE FROM uts_rank WHERE pid = $pid") or die(mysql_error()); + echo' + + + '; + mysql_query("UPDATE uts_pinfo SET banned = 'Y' WHERE id = $pid") or die(mysql_error()); + echo' + + + + +
Banning Player
Removing Player Rank:Done
Updating Player Record:Done
Player Banned - Go Back To Admin Page
'; +} else { + echo' + + + + + '; + mysql_query("UPDATE uts_pinfo SET banned = 'N' WHERE id = $pid") or die(mysql_error()); + echo' + + + '; + + $sql_nrank = "SELECT SUM(gametime) AS time, pid, gid, SUM(rank) AS rank, COUNT(matchid) AS matches FROM uts_player WHERE pid = $pid GROUP BY pid, gid"; + $q_nrank = mysql_query($sql_nrank) or die(mysql_error()); + while ($r_nrank = mysql_fetch_array($q_nrank)) { + + mysql_query("INSERT INTO uts_rank SET time = '$r_nrank[time]', pid = $pid, gid = $r_nrank[gid], rank = '$r_nrank[rank]', prevrank = '$r_nrank[rank]', matches = $r_nrank[matches]") or die(mysql_error()); + } + + echo' + + + +
Unbanning Player
Updating Player Record:Done
Restoring RankingsDone
Player Unbanned - Go Back To Admin Page
'; +} + +?> diff --git a/html/pages/admin/pinfo.php b/html/pages/admin/pinfo.php new file mode 100755 index 0000000..7be13ae --- /dev/null +++ b/html/pages/admin/pinfo.php @@ -0,0 +1,91 @@ +'; + +$sql_ips = "SELECT INET_NTOA(p.ip) AS ip, COUNT(p.id) AS matches, MIN(m.time) AS first, MAX(m.time) AS last FROM uts_player AS p, uts_match AS m WHERE p.pid = ".$pid." AND m.id = p.matchid GROUP BY ip ORDER BY ip"; +$q_ips = mysql_query($sql_ips) or die("Can't get ip's: " . mysql_error()); +echo ' + + + + + + + + + + + + '; + +while ($r_ips = mysql_fetch_assoc($q_ips)) { + echo ' + + + + + + + '; +} + +echo ' + +
IP\'s used
IPHostnameMatchesFirstLast
'.$r_ips['ip'].''.gethostbyaddr($r_ips['ip']).''.$r_ips['matches'].''.mdate($r_ips['first']).''.mdate($r_ips['last']).'
+
* Hostnames are real time and might have been different at the time of playing. *
+
'; + +mysql_free_result($q_ips); + +$sql_fakes = "SELECT INET_NTOA(p1.ip) AS ip, pi.name FROM uts_player AS p1, uts_player AS p2, uts_pinfo AS pi WHERE p1.pid = ".$pid." AND p1.ip = p2.ip AND p1.pid <> p2.pid AND pi.id = p2.pid GROUP BY pi.name"; +$q_fakes = mysql_query($sql_fakes) or die("Can't retrieve fake nicks: " . mysql_error()); +echo ' + + + + + + + + + '; + +if (mysql_num_rows($q_fakes) == 0) { + echo ' + + + '; +} +else { + while($r_fakes = mysql_fetch_assoc($q_fakes)) { + echo ' + + + + '; + } +} +echo ' + +
Possible aliasses
NickIP
No other names found
'.$r_fakes[ip].''.$r_fakes[name].'

'; +?> diff --git a/html/pages/admin/plm.php b/html/pages/admin/plm.php new file mode 100755 index 0000000..68992e2 --- /dev/null +++ b/html/pages/admin/plm.php @@ -0,0 +1,329 @@ +Player merging tool

'; +echo "

Merge ip's - Merge ip's, limited on range - Manage ignored ip's - Manage ignored ip's - only range

"; + +// CASE: MANAGE IGNORED IPS +if($_GET['manignore'] == "true") { + if($_POST['submit'] == "Remove from ignored list") { + echo "

Stopped ignore ip's

"; + foreach($_POST as $key=>$value) { + if($key !='submit') { + $key = mysql_real_escape_string(str_replace("_",".",$key)); + $query = "DELETE FROM uts_ignoreips WHERE ip = (INET_ATON('".$key."'))"; + mysql_query($query) or die(mysql_error()); + echo "
$key"; + } + } + } else if($_GET['onlyrange'] == "true") { + if($_POST['submit'] == "Confirm") { + echo '

Ignored ip\'s in range '.htmlentities($_POST['from']).' to '.htmlentities($_POST['to']).'
If you want to stop ignoring some ip\'s, because for example you accidently ignored these, check these and press the button at the lower end to confirm this

'; + echo '
'; + + $from = mysql_real_escape_string($_POST['from']); + $to = mysql_real_escape_string($_POST['to']); + + $ignore_ips = mysql_query("SELECT ip FROM uts_ignoreips WHERE ip >= INET_ATON('$from') AND ip <= INET_ATON('$to') ORDER BY ip ASC"); + + if(mysql_num_rows($ignore_ips) > 0) { + while ($r_pipcheck = mysql_fetch_array($ignore_ips)) { + + $playerip = $r_pipcheck[ip]; + $trueplayerip = long2ip($playerip); + $pidcount = $r_pipcheck[pidcount]; + + echo "
$trueplayerip"; + + // Query for player names and ids associated to that ip during the cycle + $sql_pcheck = "SELECT pi.id, pi.name, pi.country, p.pid, p.ip FROM uts_pinfo AS pi, uts_player AS p WHERE pi.id = p.pid AND p.ip = $playerip GROUP BY pi.id, pi.name, p.pid, p.ip, pi.country"; + $q_pcheck = mysql_query($sql_pcheck) or die(mysql_error()); + while ($r_pcheck = mysql_fetch_array($q_pcheck)) { + echo '
'.FormatPlayerName($r_pcheck[country], $r_pcheck['pid'], $r_pcheck['name']).' '; + } + echo '
'; + } + echo '
'; + } else { + echo "

No ignored ip's found

"; + } + } else { + echo "

Ignored ip's in range: Enter range to filter on

"; + echo '
'; + echo '
Ranging from to '; + echo '

'; + } + } else { + echo '

Ignored ip\'s
If you want to stop ignoring some ip\'s, because for example you accidently ignored these, check these and press the button at the lower end to confirm this

'; + echo '
'; + + $ignore_ips = mysql_query("SELECT ip FROM uts_ignoreips ORDER BY ip ASC"); + if(mysql_num_rows($ignore_ips) > 0) { + while ($r_pipcheck = mysql_fetch_array($ignore_ips)) { + + $playerip = $r_pipcheck[ip]; + $trueplayerip = long2ip($playerip); + $pidcount = $r_pipcheck[pidcount]; + + echo "
$trueplayerip"; + + // Query for player names and ids associated to that ip during the cycle + $sql_pcheck = "SELECT pi.id, pi.name, pi.country, p.pid, p.ip FROM uts_pinfo AS pi, uts_player AS p WHERE pi.id = p.pid AND p.ip = $playerip GROUP BY pi.id, pi.name, p.pid, p.ip, pi.country"; + $q_pcheck = mysql_query($sql_pcheck) or die(mysql_error()); + while ($r_pcheck = mysql_fetch_array($q_pcheck)) { + echo '
'.FormatPlayerName($r_pcheck[country], $r_pcheck['pid'], $r_pcheck['name']).' '; + } + echo '
'; + } + echo '
'; + } else { + echo "

No ignored ip's found

"; + } + } + +// CASE: IGNORE SUBMITTED IP'S +} else if($_POST['submit'] == "ignore") { + echo "

Ignored ips

"; + foreach($_POST as $key=>$value) { + if($key !='submit') { + $key = mysql_real_escape_string(str_replace("_",".",$key)); + $query = "INSERT INTO uts_ignoreips (ip) VALUES (INET_ATON('".$key."'))"; + mysql_query($query) or die(mysql_error()); + echo "
$key"; + } + } + echo "
"; + +// CASE: SHOW NICKS WITH GIVEN SHARED IP +} else if(substr($_POST['submit'],0,8) == "merge - ") { + echo "

Merge nicks with shared ip

"; + + $ip = mysql_real_escape_string(str_replace("_",".",substr($_POST['submit'],8))); + $sql_pipcheck = "SELECT ip, COUNT(DISTINCT pid) AS pidcount FROM uts_player WHERE ip = INET_ATON('$ip') GROUP BY ip ORDER BY ip ASC"; + $q_pipcheck = mysql_query($sql_pipcheck) or die(mysql_error()); + while ($r_pipcheck = mysql_fetch_array($q_pipcheck)) { + + $playerip = $r_pipcheck[ip]; + $trueplayerip = long2ip($playerip); + $pidcount = $r_pipcheck[pidcount]; + + // If there is more than one pid associated to an IP ... + IF ($pidcount > 1 ) { + echo '
'; + echo "
$trueplayerip"; + + // Query for player names and ids associated to that ip during the cycle + $sql_pcheck = "SELECT pi.id, pi.name, pi.country, p.pid, p.ip FROM uts_pinfo AS pi, uts_player AS p WHERE pi.id = p.pid AND p.ip = $playerip GROUP BY pi.id, pi.name, p.pid, p.ip, pi.country"; + + $q_pcheck = mysql_query($sql_pcheck) or die(mysql_error()); + while ($r_pcheck = mysql_fetch_array($q_pcheck)) { + echo '
'.FormatPlayerName($r_pcheck[country], $r_pcheck['pid'], $r_pcheck['name']).' '; + $options .= ''; + } + echo '

Merge to: '; + echo "
"; + echo '
'; + } + } + +// CASE: MERGE NICKS WITH SHARED IP +} else if($_POST['submit'] == "Player merge") { + echo "

Merging nicks with shared ip

"; + + $ip = mysql_real_escape_string(str_replace("_",".",$_POST['ip'])); + $merge_to_pid = mysql_real_escape_string($_POST['merge_to']); + $sql_pipcheck = "SELECT ip, COUNT(DISTINCT pid) AS pidcount FROM uts_player WHERE ip = INET_ATON('$ip') GROUP BY ip ORDER BY ip ASC"; + $q_pipcheck = mysql_query($sql_pipcheck) or die(mysql_error()); + while ($r_pipcheck = mysql_fetch_array($q_pipcheck)) { + + $playerip = $r_pipcheck[ip]; + $trueplayerip = long2ip($playerip); + $pidcount = $r_pipcheck[pidcount]; + + // If there is more than one pid associated to an IP ... + IF ($pidcount > 1 ) { + echo "$trueplayerip

merge:
"; + + // Query for player names and ids associated to that ip during the cycle + $sql_pcheck = "SELECT p.pid FROM uts_pinfo AS pi, uts_player AS p WHERE pi.id = p.pid AND p.ip = $playerip GROUP BY pi.id, pi.name, p.pid, p.ip, pi.country"; + + $q_pcheck = mysql_query($sql_pcheck) or die(mysql_error()); + $i=0; + while ($r_pcheck = mysql_fetch_array($q_pcheck)) { + if($r_pcheck['pid'] != $merge_to_pid) { + $pid_from[$i] = $r_pcheck['pid']; + echo $pid_from[$i].'
'; + $i++; + } + } + echo '
merge to: '.$merge_to_pid; + } + } + if($debug) echo "
-- started merging"; + for($j=0;$j -- merging ended"; + +// CASE: SHOW ALL IP'S LINKED TO MORE THAN ONE NICK - ONLY RANGE +} else if($_GET['onlyrange'] == "true") { + if($_POST['submit'] == "Confirm") { + echo "

Showing all ip's in range ".htmlentities($_POST['from'])." to ".htmlentities($_POST['to'])."
If you want to ignore some ip's, because for example different but unrelated nicks are associated with it, check these and press the button at the lower end to confirm this

"; + $from = mysql_real_escape_string($_POST['from']); + $to = mysql_real_escape_string($_POST['to']); + + $ignore_ips = mysql_query("SELECT ip FROM uts_ignoreips WHERE ip >= INET_ATON('$from') AND ip <= INET_ATON('$to')"); + $extended_query = "WHERE ip >= INET_ATON('$from') AND ip <= INET_ATON('$to')"; + $i=0; + while($ignore_ips_array = mysql_fetch_array($ignore_ips)) { + $ip = $ignore_ips_array[0]; + $extended_query .= " AND "; + $extended_query .= "ip <> '".$ip."'"; + $i++; + } + + echo '
'; + + + // Query for list of unique ips and player ids + $sql_pipcheck = "SELECT ip, COUNT(DISTINCT pid) AS pidcount FROM uts_player ".$extended_query." GROUP BY ip ORDER BY ip ASC"; + $q_pipcheck = mysql_query($sql_pipcheck) or die(mysql_error()); + if(mysql_num_rows($q_pipcheck) > 0) { + while ($r_pipcheck = mysql_fetch_array($q_pipcheck)) { + + $playerip = $r_pipcheck[ip]; + $trueplayerip = long2ip($playerip); + $pidcount = $r_pipcheck[pidcount]; + + // If there is more than one pid associated to an IP ... + IF ($pidcount > 1 ) { + + echo "
$trueplayerip"; + + // Query for player names and ids associated to that ip during the cycle + $sql_pcheck = "SELECT pi.id, pi.name, pi.country, p.pid, p.ip FROM uts_pinfo AS pi, uts_player AS p WHERE pi.id = p.pid AND p.ip = $playerip GROUP BY pi.id, pi.name, p.pid, p.ip, pi.country"; + $q_pcheck = mysql_query($sql_pcheck) or die(mysql_error()); + while ($r_pcheck = mysql_fetch_array($q_pcheck)) { + echo '
'.FormatPlayerName($r_pcheck[country], $r_pcheck['pid'], $r_pcheck['name']).' '; + } + echo "
"; + echo '
'; + } + } + + + echo '
'; + } else { + echo "


No ip's found with more than one nick linked to it and which are not ignored and are in this range

"; + } + + } else { + echo "

Showing all ip's in range - Enter range to filter on

"; + echo '
'; + echo '
Ranging from to '; + echo '

'; + } + +// CASE: SHOW ALL IP'S LINKED TO MORE THAN ONE NICK +} else { + echo "

IP's linked with more than one nick
If you want to ignore some ip's, because for example different but unrelated nicks are associated with it, check these and press the button at the lower end to confirm this

"; + + $ignore_ips = mysql_query("SELECT ip FROM uts_ignoreips"); + $extended_query = ""; + $i=0; + while($ignore_ips_array = mysql_fetch_array($ignore_ips)) { + $ip = $ignore_ips_array[0]; + if($i==0) + $extended_query = " WHERE "; + else + $extended_query .= " AND "; + $extended_query .= "ip <> '".$ip."'"; + $i++; + } + + echo '
'; + + + // Query for list of unique ips and player ids + $sql_pipcheck = "SELECT ip, COUNT(DISTINCT pid) AS pidcount FROM uts_player ".$extended_query." GROUP BY ip ORDER BY ip ASC"; + $q_pipcheck = mysql_query($sql_pipcheck) or die(mysql_error()); + if(mysql_num_rows($q_pipcheck) > 0) { + while ($r_pipcheck = mysql_fetch_array($q_pipcheck)) { + + $playerip = $r_pipcheck[ip]; + $trueplayerip = long2ip($playerip); + $pidcount = $r_pipcheck[pidcount]; + + // If there is more than one pid associated to an IP ... + IF ($pidcount > 1 ) { + + echo "
$trueplayerip"; + + // Query for player names and ids associated to that ip during the cycle + $sql_pcheck = "SELECT pi.id, pi.name, pi.country, p.pid, p.ip FROM uts_pinfo AS pi, uts_player AS p WHERE pi.id = p.pid AND p.ip = $playerip GROUP BY pi.id, pi.name, p.pid, p.ip, pi.country"; + $q_pcheck = mysql_query($sql_pcheck) or die(mysql_error()); + while ($r_pcheck = mysql_fetch_array($q_pcheck)) { + echo '
'.FormatPlayerName($r_pcheck[country], $r_pcheck['pid'], $r_pcheck['name']).' '; + } + echo "
"; + echo '
'; + } + } + echo '
'; + } else { + echo "


No ip's found with more than one nick linked to it and which are not ignored

"; + } +} + +// If debugmode is on, determine end time & output execution time +if($debug) { + $time = microtime(); + $time = explode(" ", $time); + $time = $time[1] + $time[0]; + $endtime = $time; + $totaltime = ($endtime - $begintime); + echo "
execution time: $totaltime"; +} +?> \ No newline at end of file diff --git a/html/pages/admin/recalcflags.php b/html/pages/admin/recalcflags.php new file mode 100755 index 0000000..073e648 --- /dev/null +++ b/html/pages/admin/recalcflags.php @@ -0,0 +1,72 @@ + + + +'; + +echo' + + '; + echo' + + + + +
Recalculating Countryflags
Recalculating Rankings:'; + + echo'Recalculating pinfo table...
'; + /* update pinfo table */ + $sql_pids = mysql_query("SELECT uts_pinfo.id as pid, uts_pinfo.country as country, uts_player.ip as ip FROM uts_pinfo, uts_player WHERE uts_pinfo.id = uts_player.pid GROUP BY uts_player.pid;") or die(mysql_error()); + while($sql_pid = mysql_fetch_array($sql_pids)) + { + $playercountry = strtolower(geoip_country_code_by_addr($gi,long2ip($sql_pid['ip']))); + + if ($playercountry != $sql_pid['country'] ) + { + mysql_query("UPDATE uts_pinfo SET country = '$playercountry' WHERE id = '".$sql_pid['pid']."'") or die(mysql_error()); + } + } + + echo'Recalculating player table...
'; + /* update player table */ + $sql_pids = mysql_query("SELECT pid, ip, country FROM uts_player"); + while ($sql_pid = mysql_fetch_array($sql_pids)) + { + $playercountry = strtolower(geoip_country_code_by_addr($gi,long2ip($sql_pid['ip']))); + + if ($playercountry != $sql_pid['country']) + { + mysql_query("UPDATE uts_player SET country = '$playercountry' WHERE pid = '".$sql_pid['pid']."'") or die(mysql_error()); + } + } + echo 'Done
Countryflags recalculated - Go Back To Admin Page
'; + +?> diff --git a/html/pages/admin/recalcranking.php b/html/pages/admin/recalcranking.php new file mode 100755 index 0000000..1cbc865 --- /dev/null +++ b/html/pages/admin/recalcranking.php @@ -0,0 +1,77 @@ + + + +'; + +echo' + '; + + mysql_query("TRUNCATE uts_rank") or die(mysql_error()); + + echo''; + +echo' + + '; + echo' + + + + +
Recalculating Rankings
Deleting rankingsDone
Recalculating Rankings:'; + $playerbanned = false; + $q_pm = mysql_query( " SELECT p.id, + p.matchid, + p.pid, + p.gid, + m.gamename + FROM uts_player p, + uts_pinfo pi, + uts_match m + WHERE pi.id = p.pid + AND pi.banned <> 'Y' + AND m.id = p.matchid + ORDER BY p.matchid ASC, + p.playerid ASC"); + $i = 0; + while ($r_pm = mysql_fetch_array($q_pm)) { + $i++; + if ($i%50 == 0) { + echo '. '; + flush(); + } + $playerecordid = $r_pm['id']; + $matchid = $r_pm['matchid']; + $pid = $r_pm['pid']; + $gid = $r_pm['gid']; + $gamename = $r_pm['gamename']; +// echo "$pid|$gid|$matchid
"; + include('import/import_ranking.php'); + } + echo 'Done
Rankings recalculated - Go Back To Admin Page
'; + +?> diff --git a/html/pages/admin/utdclog.php b/html/pages/admin/utdclog.php new file mode 100755 index 0000000..b22bfd7 --- /dev/null +++ b/html/pages/admin/utdclog.php @@ -0,0 +1,137 @@ + + + + '; + $logdir = opendir('logs/utdc'); + $logs = array(); + $sort = array(); + $i = 0; + while (false !== ($filename = readdir($logdir))) { + if (!is_file('logs/utdc/'. $filename)) continue; + if ($filename == '.htaccess' or $filename == 'index.htm') continue; + $i++; + $logs[$i] = $filename; + $extra = 0; + if (substr($filename, -4) == '.bz2') $extra = 4; + if (substr($filename, -3) == '.gz') $extra = 3; + + $sort[$i] = substr($filename, strlen($filename) - (23 + $extra), 19); + } + closedir($logdir); + if (count($logs) == 0) { + echo ''; + } else { + arsort($sort); + $i = 0; + foreach($sort as $id => $date) { + $log = $logs[$id]; + $extra = 0; + if (substr($log, -4) == '.bz2') $extra = 4; + if (substr($log, -3) == '.gz') $extra = 3; + + $i++; + $class = ($i%2) ? 'grey' : 'grey2'; + echo ''; + } + } +} + + +if (!empty($filename)) { + if (!file_exists('logs/utdc/'. $filename) or !is_file('logs/utdc/'. $filename)) die('bla'); + echo'
Available UTDC Logs:
No logs available!
'; + $tmp = substr($log, strlen($log) - (23 + $extra), 19); + $tmp = str_replace('.', '', $tmp); + $ts = mtimestamp($tmp); + echo ' '.date('Y-m-d H:i', $ts).''; + echo ''; + echo ''.substr($log, 6, strlen($log) - 30 - $extra).''; + echo ''; + $d_size = file_size_info(filesize('logs/utdc/'. $log)); + echo $d_size['size'] .' '. $d_size['type']; + echo ''; + echo 'Delete'; + echo '
+ + + + '; + if (substr($filename, -4) == '.enc') { + echo ''; + } + else { + $fp = my_fopen('logs/utdc/'.$filename, 'rb', $compression = NULL); + if (!$fp) die("Error opening file"); + + $i = 0; + echo ''; + */ + echo wordwrap(htmlentities($line), 80, '
', 1) ."
"; + } + echo ''; + my_fclose($fp, $compression); + + // look for a matching utdc screenshot + $logdir = opendir('logs/utdc'); + if (substr($filename, -4) == '.bz2') $extra = 4; + if (substr($filename, -3) == '.gz') $extra = 3; + while (false !== ($file = readdir($logdir))) { + if (!is_file('logs/utdc/'. $filename)) continue; + if ($filename == '.htaccess' or $filename == 'index.htm') continue; + if ((substr($file, -4) == '.enc') and + ((substr($filename, strlen($filename)-(23 + $extra), 19) == substr($file, strlen($file)-23, 19)) or ((substr($filename, strlen($filename)-(23 + $extra), 17) == substr($file, strlen($file)-23, 17)) and (abs(intval(substr($file, strlen($file)- 6, 2)) - intval(substr($filename, strlen($filename)-(6 + $extra), 17))) <=3)))) { + echo ' + + + '; + + echo ''; + } + } + closedir($logdir); + } +} + +echo ''; +if (!empty($filename)) echo''; +echo''; +echo '
'.$filename.''; + echo 'Delete'; + echo '
'; + echo ''; + echo '
'; + + while (($line = my_fgets($fp, 5000, $compression)) !== FALSE) { + /* + $i++; + $class = ($i%2) ? 'grey' : 'grey2'; + echo '
'; + echo ''; + echo htmlentities($line); + echo ''; + echo '
'.$file.''; + echo 'Delete'; + echo '
'; + echo ''; + echo '
Go Back To Logfile Overview
Go Back To Admin Page
'; + +?> diff --git a/html/pages/admin/utdcshot.php b/html/pages/admin/utdcshot.php new file mode 100755 index 0000000..24b21f7 --- /dev/null +++ b/html/pages/admin/utdcshot.php @@ -0,0 +1,22 @@ + \ No newline at end of file diff --git a/html/pages/credits.php b/html/pages/credits.php new file mode 100755 index 0000000..e27de84 --- /dev/null +++ b/html/pages/credits.php @@ -0,0 +1,311 @@ + +

Credits

+ +

+ 1. Developers
+ 2. Change Log
+ 3. To Do List
+ 4. Thanks
+ 5. Copyright Notices
+

+ +

Developers

+

UTStats was developed by azazel, )°DoE°(-AnthraX, PJMODOS and toa.
+All original pages are W3C HTML 4.01 and +CSS compliant

+ +
+ +

Change Log

+

+

+
beta 4.2.8 (23/7/2011 by Rork)
+
Bug Fixes:
+ Fixed explain rankings (reported by Letylove49)
+ Fixed delete player (reported by The Cowboy)
+ Fixed delete player from match
+ Fixed support for LMS++

+ +
beta 4.2.7 (24/4/2011 by Rork)
+
Added:
+ IP Information in extended player info
+ Possible fake nicks in extended player info
+ Added support for LMS+

+ +
Bug Fixes:
+ Fixed player deletion
+ Fixed DOM import with bots
+ Fixed player info BT records
+ Fixed order players in playersearch
+ Fixed player time on server longer then gametime
+ Fixed lms player sorting
+ Fixed lms ttl
+ Fixed SQL table creation (reported by PopCorn)

+ +
beta 4.2.6 (04/12/2010 by Rork)
+
Bug Fixes:
+ Fixed serveral vulnerabilities
+ Fixed DOM specific map page not showing
+ Fix Assault Match looks
+ Add support for new BT times
+ Fixed CTF Match Reports

+ +
beta 4.2.5 (23/10/2010 by Rork)
+
Added:
+ Game time in match stats
+ Added applicable totals per gametype on the mappage
+ Bunny Track stats, BT++ support only
+ Server configuration checker/database setup
+ UTDC Screenshots viewer
+ ACE Logviewer
+ Added out time in LMS
+ Added number of players to recent matches
+ Hide not applicable statistics from player pages
+ Various lay-out improvements
+ Filters in maplist
+ Show Score under Match Totals for teamgames
+ Added debug messages

+ +
Bug Fixes:
+ Fixed delete player from match
+ Fixed bug where players are spec after merging or teamchange
+ Fixed effective rank after merging players
+ Dirty fix for divide by zero bug on logimport (was line 47) (gametime = 0)
+ Fixed dodgy import log recognition
+ Fixed playerlink in explain ranking
+ Two bug fixes by Enakin reported in the 4.2.3 release thread
+ Fixed LMS ttl by using the time until the player is out.
+ Sorted LMS players by ttl, the winner on top
+ Fixed php shorttag in import_playerstuff.php
+ Prevent removing files from ftp after error
+ Prevent importing empty log after ftp error
+ Made the main pages W3C HTML 4.01 Compliant
+ Fixed some vulnerabilities

+ +
beta 4.2.4 (10/04/2010 by Loki)
+
Added:
+ Breakdown of server occupation per weekday (By Loki)
+ Breakdown of country of origin (By Loki)
+ Included IpToCountry patch into the release, added GeoIP.dat from March 2010 (By Loki)

+
Bug Fixes:
+ Fixed PHP opening tags (By Loki)

+ +
beta 4.2.3 (18/01/09 by 2399Skillz)
+
Bug Fixes:
+ Lots of bug fixes/database corrections (By Enakin)

+ +
beta 4.2.2 (30/12/08 by 2399Skillz)
+
Added:
+ Option to import AnthChecker logs (admin viewable only) (Added by Skillz)
+ New player merger page for admins(Added by killereye)

+
Bug Fixes:
+ UT Stats DOM fix (Edited by killereye)

+ +
beta 4.2 (20/10/2005 by Azazel)
+
Added:
+ Ranking re-calculation option added to admin section
+ Import and display player pings
+ Explain Ranking page
+ Added an option to the admin page to delete temporary tables (if any)

+ +
Bug Fixes:
+ Import fix for MySQL v3.x
+ Partial Import delete fix
+ bbcode and Clanbase Report Fix - not showing high score win reports.
+ Ranking fix (was more than 300 mins to get full ranking points)
+ Spectator fix (was logging players as spectators)
+ Efficiency on Players Total worked out as SUM rather than AVG
+ Clanbase report fixed
+ Totals on Totals Page fixed
+ Events on Totals Page only show if they really happened
+ Number of matches on Totals Page fixed
+ Fixed a crash when trying to import logs that didnt contain IP records
+ Maps sometimes appeared twice on the maps list / incorrect map statistics
+ First/Prev/Next/Last links on map stas page were not working correctly
+ Improved server actor version uploaded (old one may have caused some server lag at times)
+ Updated import.php for new server actor
+ Few actor fixes
+ Weapon stats for second attacking team in assault games were not correct (reported by wgray8231)
+ Delete player from match didn\'t correctly remove the player from the match (reported by wgray8231)

+ +
beta 4.0
+
Added:
+ Many pages overhauled
+ Database overhauled
+ Option to import bots or not (off by default)
+ Command Line Interface now outputs to text not html
+ Ranking stuff on match and player pages include gold/silver/bronze cups for each gametype
+ Rankings tweaked so new players get even less points
+ Maps page now sortable
+ Flag Assists now show, get the new Smart CTF
+ Report generator outputting to Clanbase and bbcode format
+ Support added for custom weapons and gametypes
+ Admin page including server/player merging, deletion of players/matches, renaming of "game types" etc
+ Option to compress logs when backing them up (requires bzip/gzip support in php)
+ More debugging stuff added
+ Accuracy package optimised and recoded for better performance (it will not lag the server in anyway now)
+ More detailed weapon statistics added
+ Totals page expanded with information like on the old NGStats
+ JailBreak should now display its statistics properly
+ Purge logs option added
+ Graphs now display better regardless of data used
+ CTF4 Compatibility
+ Date and Game Type filtering on Recent Matches page
+ Ability to Ban players
+ Ability to ignore matches < X minues in length
+ IP Search within Administration
+ Ability to ignore matches less than X minutes in length
+ Option to import UTDC logs (admin viewable only)

+ +
Bug Fixes:
+ Ranking overhauled to better reflect average game play of players
+ Cleaned up the importer
+ Teamscores now shown correctly regardless of player switching activity
+ Kills matrix is now created on combined player records
+ Kills against bots no longer counted if bots are not imported
+ Domination logs only log when players are in
+ Teamkills identified as kills in non-team games (gg Epic :/)
+ Eff etc fixed because of above Teamkills bug
+ Last line not logging of buffer fixed

+ +
beta 3.2
+
Added:
+ Debugging Option
+ Better FTP Capabilities
+ Filters carried over on next last etc on player page

+ +
Bug Fixes:
+ Imports failing on some versions of php 4.3.x
+ Totals page fixed
+ Totals info at the top of match pages fixed

+ +
beta 3.1
+
Added:
+ Kills Matchup Matrix + Country Flags for Players
+ Hover Hints over key parts of the page (eg. K F D S)
+ Some Graphs

+ +
Bug Fixes:
+ Importer can now import unlimited logs
+ Kills on match pages not listed
+ Games where nothing happens no longer imported
+ Players who have 0 kills & 0 deaths no longer get imported
+ FTP script re-written
+ Pickups removed from insta pages
+ Translocator entries removed from logs (throws not kills)
+ Multis & Sprees report correct player now
+ Kills correctly worked out on non-Team Games
+ + Frags correctly worked out on all games

+ +
beta 3.0
+
Added:
+ SmartCTF events
+ UTGL Compatibility

+ Updated:
+ UTStats actor re-written from scratch, it now uses NGLog files
+ Database re-written from scratch
+ PHP code re-written from scratch

+ +
Bug Fixes:
+ Too many to think about

+ +
beta 2.0
+
Code rewritten from ground up then lost :(

+ + +
beta 1.2
+
Added:
+ Accuracy Code (best in insta but works on all weapons)
+ UT2004 spree scheme
+ Who killed the Flag Carrier
+
+ Updated:
+ Complete overhaul of pages/theme to mimic closley UT2004 Stats by Epic
+ Cap times added to Clanbase Report
+ Stats database, now at least 10-20x smaller
+
+ Bug Fixes:
+ TeamKills no longer appear in DM
+ TeamKills no longer mess up overall stats
+ Bot kills etc no longer included in overall stats
+ Sprees are unique

+ +
beta 1.1
+
Added:
+ Clanbse Reports for CTF Match\'s
+ 30 Recent Match\'s to Player View

+ +
beta 1
+
Stats output for:
+ Player Joins/Leaves
+ Match Start/End
+ Frags and Item Pickups
+ Sprees (Doubles/Multis and Domination/Monster etc)
+ Events
+ +
+ +

To Do List

+
+ "Requests"
+ Centralise stats
+ Web based installer
+ Other Anticheat log parser. (UTPure, EUT, etc..)
+ Multi language support
+ Add sftp support
+ Add siege support
+ Wins/Losses to the Career summary
+ Killgraph as in utstatsdb
+
+
+ +

Thanks

+
+
+
Epic for making a game that we still play
+ kostaki for the database pointers, scoring system and the inzane public servers :)
+ Limited for the late night sesions, the linux script and the original zero_out function
+ L0cky and Flash for the original FTP Script
+ Loph for the 6 different reports o/
+ Rush for the improved linux script, testing, suggestions and bug finding
+ TNSe for being TNSe
+ Truff for testing, suggestions and constant bug finding
+ Truff Community for testing, suggestions and input
+ UnrealAdmin.org testers and suggesters
+ +

Copyright Notices

+
+
UTStats
+ Copyright (C) 2004/2005 UTStats
+
+ This program is free software; you can redistribute and/or modify
+ it under the terms of the Open Unreal Mod License.
+
+ If you do make any changes, fixes or updates posting them on the
+ forum would be appreciated.
+
+ UT Query PHP script v1.01 by Almar Joling, 2003
+ www.persistentrealities.com
+
+ pemftp Class by Alexey Dotsenko <alex at paneuromedia dot com>
+ http://www.phpclasses.org/browse/package/1743.html
+
+ GeoLite data created by MaxMind
+ Available from http://www.maxmind.com/app/geolitecountry
+
+ overLIB by Erik Bosrup
+ http://www.bosrup.com/web/overlib/ +
+
+ + + + + +
Back to Top 
+'; +?> \ No newline at end of file diff --git a/html/pages/dpmatch.php b/html/pages/dpmatch.php new file mode 100755 index 0000000..b563fa0 --- /dev/null +++ b/html/pages/dpmatch.php @@ -0,0 +1,102 @@ + + + +'; + +echo' + '; + +$q_radjust = small_query("SELECT pid, gid, rank FROM uts_player WHERE id = $pid"); +if (!$q_radjust) { + $sql_crank = false; +} else { + $rank_pid = $q_radjust[pid]; + $rank_gid = $q_radjust[gid]; + $rank = $q_radjust[rank]; + + $sql_crank = small_query("SELECT id, rank, matches FROM uts_rank WHERE pid = $rank_pid AND gid = '$rank_gid'"); +} +if (!$sql_crank) { + echo''; +} else { + $rid = $sql_crank[id]; + $newrank = $sql_crank[rank]-$rank; + $oldrank = $sql_crank[rank]; + $matchcount = $sql_crank[matches]-1; + + mysql_query("UPDATE uts_rank SET rank = $newrank, prevrank = $oldrank, matches = $matchcount WHERE id = $rid") or die(mysql_error()); + mysql_query("DELETE FROM uts_rank WHERE matches = 0") or die(mysql_error()); + + echo''; +} +echo' + + '; + $q_match = mysql_query("SELECT matchid, playerid FROM uts_player WHERE pid = '$pid' and matchid = '$matchid'") or die(mysql_error()); + while ($r_match = mysql_fetch_array($q_match)) { + mysql_query("DELETE FROM uts_killsmatrix WHERE matchid = '${r_match['matchid']}' AND (killer = '${r_match['playerid']}' OR victim = '${r_match['playerid']}')") or die(mysql_error()); + } + echo' + + + + + '; +mysql_query("DELETE FROM uts_weaponstats WHERE matchid = $matchid AND pid = $pid") or die(mysql_error()); + echo' + + + '; +mysql_query("DELETE FROM uts_player WHERE matchid = $matchid AND pid = $pid") or die(mysql_error()); + echo' + + + '; +mysql_query("DELETE FROM uts_weaponstats WHERE matchid IN ('$matchid','0') AND pid = '$pid'") or die(mysql_error()); + +$q_weaponstats = mysql_query("SELECT SUM(kills) AS kills, SUM(shots) AS shots, SUM(hits) as hits, SUM(damage) as damage, AVG(acc) AS acc FROM uts_weaponstats WHERE pid = '$pid' GROUP BY weapon") or die(mysql_error()); +while ($r_weaponstats = mysql_fetch_array($q_weaponstats)) { + mysql_query("INSERT INTO uts_weaponstats SET matchid='0', pid='$pid', kills='${r_weaponstats['kills']}', shots='${r_weaponstats['shots']}', hits='${r_weaponstats['hits']}', damage='${r_weaponstats['damage']}', acc='${r_weaponstats['acc']}'") or die(mysql_error()); +} + echo' + + + '; + mysql_query("DELETE FROM uts_weaponstats WHERE matchid='0' AND pid='0'") or die(mysql_error()); + + $q_weaponstats = mysql_query("SELECT weapon, SUM(kills) AS kills, SUM(shots) AS shots, SUM(hits) as hits, SUM(damage) as damage, AVG(acc) AS acc FROM uts_weaponstats WHERE matchid = '0' GROUP BY weapon") or die(mysql_error()); + while ($r_weaponstats = mysql_fetch_array($q_weaponstats)) { + mysql_query("INSERT INTO uts_weaponstats SET matchid='0', pid='0', weapon='${r_weaponstats['weapon']}', kills='${r_weaponstats['kills']}', shots='${r_weaponstats['shots']}', hits='${r_weaponstats['hits']}', damage='${r_weaponstats['damage']}', acc='${r_weaponstats['acc']}'") or die(mysql_error()); + } + + echo' + + + + +
Delete Player From Match ID '.$matchid.'
Amending Players Rank:Player not in rankingsDone
Removing Kill Matrix Entries:Done
Removing Player Weapon Stats:Done
Removing Player From Match:Done
Amending Player Weapon Stats:Done
Amending Global Weapon Stats:Done
Match Deleted - Go Back To Admin Page
'; + +?> diff --git a/html/pages/graph_mbreakdown.php b/html/pages/graph_mbreakdown.php new file mode 100755 index 0000000..44ef717 --- /dev/null +++ b/html/pages/graph_mbreakdown.php @@ -0,0 +1,229 @@ + $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"; +$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']; +} + +// Monthly Breakdown +$sql_gmonths = "SELECT MONTH(time) AS res_month, COUNT(*) AS res_count +FROM uts_match WHERE $bgwhere GROUP by res_month"; +$q_gmonths = mysql_query($sql_gmonths) or die(mysql_error()); +$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']; +} + +// very dirty hack, to deal with the $bgwhere containing an OR +// if it contains an OR, all literals should be prefixed with "m." +if (substr_count($bgwhere, ' or ') == 0){ + $bgwhere = 'm.' . $bgwhere; +} else { + $bgwhere = substr($bgwhere, 1, -1); + $part = explode(' or ', $bgwhere); + $bgwhere = ''; + foreach($part as $i){ + $bgwhere .= 'm.' . $i . ' OR '; + } + $bgwhere = '(' . substr($bgwhere, 0, -4) . ')'; +} + +// 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"; +$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++; +} + +echo' + + + + +
+ + + + + + + + + + '; + +// Hourly +for ($i = 0; $i <= 23; $i++) { + if (!isset($gb_hour[$i])) $gb_hour[$i] = 0; + $title = $gb_hour[$i] .' ('. get_dp($gb_hour[$i] / $hour_sum * 100) .' %)'; + echo ''; +} + +echo ''; + +// Daily +for ($i = 0; $i <= 6; $i++) { + if (!isset($gb_day[$i])) $gb_day[$i] = 0; + $title = $gb_day[$i] .' ('. get_dp($gb_day[$i] / $day_sum * 100) .' %)'; + echo ''; +} + +echo ''; + +// Monthly +for ($i = 1; $i <= 12; $i++) { + if (!isset($gb_month[$i])) $gb_month[$i] = 0; + $title = $gb_month[$i] .' ('. get_dp($gb_month[$i] / $month_sum * 100) .' %)'; + echo ''; +} +echo ''; +echo' + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Hourly, Daily and Monthly Activity '.$gtitle.'
'. $title .''. $title .''. $title .'
01234567891011121314151617181920212223MTWTFSSJFMAMJJASOND
+
+

'; + +global $a_countries; +// The number of different countries we want to display +$no_countries = 20; + +// Check if there are more countries then $no_countries; if so, we can have a "others" column +if ( count($gb_country) < $no_countries ){ + $max_cntry = count($gb_country); + $collspan = $max_cntry + 2; + $others = false; +} else { + $max_cntry = $no_countries; + $collspan = $max_cntry + 3; + $others = true; +} + +echo' + + + + +
+ + + + + + + + + '; + +// Countries +$x = 0; +for ($i = 0; $i < $max_cntry; $i++) { + if (!isset($gb_hour[$i])) $gb_hour[$i] = 0; + $country = explode(";",$gb_country[$i]); + $title = $a_countries[$country[0]] .': ' . $country[1] . ' ('. get_dp($country[1] / $country_sum * 100) .' %)'; + echo ''; + $x += $country[1]; +} +if($others){ + $countries_left = $country_sum - $x; + $title = 'Other Countries: ' . $countries_left . ' ('. get_dp($countries_left / $country_sum * 100) .' %)'; + echo ''; +}; + +echo ''; +echo' + '; + for ($i = 0; $i < $max_cntry; $i++) { + $country = explode(";",$gb_country[$i]); + $country = strtoupper($country[0]); + echo ''; + } +if($others){ + echo ''; +} +echo' + +
  Origin of Players  
'. $title .''. $title .'
' . $country . '--
+
+
'; +?> \ No newline at end of file diff --git a/html/pages/graph_pbreakdown.php b/html/pages/graph_pbreakdown.php new file mode 100755 index 0000000..808c7cb --- /dev/null +++ b/html/pages/graph_pbreakdown.php @@ -0,0 +1,137 @@ + $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 m, uts_player p WHERE $bgwhere AND m.id = p.matchid 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']; +} + +// Monthly Breakdown +$sql_gmonths = "SELECT MONTH(m.time) AS res_month, COUNT(p.id) AS res_count +FROM uts_match m, uts_player p WHERE $bgwhere AND m.id = p.matchid GROUP by res_month"; +$q_gmonths = mysql_query($sql_gmonths) or die(mysql_error()); +$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']; +} + + +echo' + + + + +
+ + + + + + + + + + '; + +// Hourly +for ($i = 0; $i <= 23; $i++) { + if (!isset($gb_hour[$i])) $gb_hour[$i] = 0; + $title = $gb_hour[$i] .' ('. get_dp($gb_hour[$i] / $hour_sum * 100) .' %)'; + echo ''; +} + +echo ''; + +// Daily +for ($i = 0; $i <= 6; $i++) { + if (!isset($gb_day[$i])) $gb_day[$i] = 0; + $title = $gb_day[$i] .' ('. get_dp($gb_day[$i] / $day_sum * 100) .' %)'; + echo ''; +} + +echo ''; + +// Monthly +for ($i = 1; $i <= 12; $i++) { + if (!isset($gb_month[$i])) $gb_month[$i] = 0; + $title = $gb_month[$i] .' ('. get_dp($gb_month[$i] / $month_sum * 100) .' %)'; + echo ''; +} +echo ''; +echo' + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Hourly, Daily and Monthly Activity '.$gtitle.'
'. $title .''. $title .''. $title .'
01234567891011121314151617181920212223MTWTFSSJFMAMJJASOND
+
+
'; +?> \ No newline at end of file diff --git a/html/pages/help.php b/html/pages/help.php new file mode 100755 index 0000000..fb7a923 --- /dev/null +++ b/html/pages/help.php @@ -0,0 +1,183 @@ + +

Frequently Asked Questions

+ +

+ 1. Stat Tracking Servers
+ 2. Enabling your personal stats tracking
+ 3. Information about how the stats work
+ 4. What are the \'official\' Unreal Tournament gametypes?
+ 5. How does ranking work?
+ 6. Scoring - Individual player points awarded?
+ 7. Team Scores?
+ 8. Glossary - Terms and abbreviations.
+ 9. Enabling Stats on a Server
+

+ +

Stat Tracking Servers

+

UTStats only does stats tracking for servers that have UTStats + installed.
+ To download and get the latest information, please click the forum link to + the left.

+ +

Enabling your personal stats tracking

+

Currently this is not possible, for now you need to use the same + nick for this group of servers.
+ If the server runs UTGL your stats nick always will be the one you registered + with so there are no stats tracking issues on UTGL servers.

+ +

Information about how the stats work

+

A server with stat tracking enabled will send information to the +stats server about the game - each frag, score, etc.  Once the game is +completed the match is processed and posted on the stats pages.  The best +way to look up a recent match you played is either by your stats ID or the +server ID.  You can search for your user ID or the server ID by name. +The user names used on the stats pages are based on the last player name you +used in a match - your stats user name you entered in the networking settings is +not displayed.

+

Bots are not logged, nor are any kills against them.

+
+ +

What are the \'official\' Unreal Tournament gametypes?

+

Out of the box Unreal Tournament features the gametypes +Deathmatch, Team Deathmatch, Capture the Flag, Assault and Domination.
+There are separate rankings for each of the official game types.

+ +

How does ranking work?

+

Ranking points are based on what you do in a game.
+Points are awarded for fragging and events (eg. flag captures).
+Points are deducted for deaths, suicides and teamkills

+Player ranking points are reduced until they have completed 300 minutes of games.

+ +

Scoring - Individual player points award:

+

These depend on the game type you are playing. There are +individual player scores awarded for special achievements, such as captures, +assists, etc.
+See the Score tables on the Players or Matches subpages to find +out how many points are actually awarded for each score type.

+ +

Team Scores?

+

Aside from the individual player scoring in team based gametypes +(CTF, AS, DOM), there are also Team Scores, that are awarded to +your team as a whole, for fulfilling a gametype specific objective:
+

    +
  • Capture the Flag - capturing, covering, killing and returning the flag.
  • +
  • Assault - achieving an objective.
  • +
  • Domination - \'holding\' domination points.
  • +
+Note: A team based game is won by the Team Score; the individual player score +sums do not matter!

+ +


Glossary

+
+ +

Abbreviations

+

Common abbreviations in UTStats.
+- K = Kills, S = Suicides, F = Frags, D = Deaths
+- E = Events, TK = Team Kills, TD = Team Deaths
+- DM = Deathmatch, TDM = Team Deathmatch, CTF = Capture the Flag,
+- AS = Assault, DOM = Domination
+- FPH = Frags per Hour, SPH = Score per Hour
+- [d] = Time in days, [h] = Time in hours,
+- [m],[min] = Time in minutes, [s],[sec] = Time in seconds

+ +

Deaths

+

Number of times a player gets killed by another player.
+- This does not include environment induced deaths, like trap doors. These and +self kills are counted separately, as suicides.
+- Team based deaths are counted as team deaths.
+- In tables with weapon specific information, deaths are the number of times a +player died holding that weapon.

+ +

Dodging

+

Special move in Unreal Tournament, that can be activated by +tapping any movement key twice.  Used by many good players to improve their +maneuverability.

+ +

Efficiency

+

A ratio that denotes the player\'s kill skill by comparing it with +his overall performance.  A perfect efficiency is equal to 1 (100%), +anything less than 0.5 (50%) is below average.
+Formula: Kills / (Kills + Deaths + Suicides [+Team Kills])

+ +

Events

+

Anything not related to frags, deaths, suicides or kills is +hereby defined as an event. Typical events would be a flag capture (score +related) or a flag drop (not score related). Events are mostly used to track all +the other things going on in a game, that are not frag-related.

+ +

First Blood

+

Special event awarded to the player who gets the first kill in a +newly started match.

+ +

Frags

+

A player\'s frag count is equal to their kills minus +suicides.  In team games team kills (not team suicides) are also subtracted +from the player\'s kills.

+ +

Frags Per Hour

+

A ratio between the number of frags a player scores per one +hour.  30 frags in 5 minutes will give you 360 FPH.
+Formula: Frags / (Time played in hours)

+ +

Kills

+

Number of times a player kills another player.
+Note: UTStats only tracks human vs. human kills. Bot kills and other bot +related events are tracked at the admins discretion.

+ +

Multi Kills

+

Special event awarded to the player for killing other players in +a certain time frame.  Every time a player scores a kill he has up to 3 +seconds to make another kill.  So 2 kills in 3 seconds gets you a Double +Kill, 3 kills within 3 seconds apart from another a Multi Kill and so on:
+- Double Kill = 2 kills
+- Multi Kill = 3 kills
+- Ultra Kill = 5 kills
+- Monster Kill = 6 kills

+ +

Ping

+

Measure of your connection quality.  Ping is the round trip +delay in milliseconds that your computer has to the game server.  Low +values are not important for a fun game, but it sure helps.

+ +

Killing Sprees

+

Special event: If you manage to kill 5 or more opponents without +dying yourself, you will be on a killing spree. If you kill more than 10 +opponents, you are on a rampage, etc.:
+- Killing Spree! 5 kills
+- Rampage! 10 kills
+- Dominating! 15 kills
+- Unstoppable! 20 kills
+- God Like! 25 kills

+ +

Suicides

+

Number of times a player dies due to action of their own cause. +Suicides can be environment induced (drowning, getting crushed, falling) or +weapon related (fatal splash damage from their own weapon).

+ +

Team Deaths

+

Number of times a player in a team based game is killed by +someone on their own team.

+ +

Team Kills

+

Number of times a player in a team based game kills someone on +their own team.
+Note: Team kills subtract from a player\'s personal frags and thus the team frags +as a whole.

+ +

TTL

+

TTL is Time to Live.
+Its the length of time you are in a game in seconds divided by how many times you die, +thus giving an average time of how long you will live.

+ +
+ +

Enabling Stats on a Server

+

Download and get the latest information on UTStats by clicking + the forum link to the left.

+ +
+Back to Top +'; +?> \ No newline at end of file diff --git a/html/pages/home.php b/html/pages/home.php new file mode 100755 index 0000000..3cb167d --- /dev/null +++ b/html/pages/home.php @@ -0,0 +1,100 @@ + + + UTStats Summary + + + Players + Servers + Maps + Matches Logged + Player Hours + '; + +// Get Summary Info +$r_playercount = small_query("SELECT COUNT(*) AS result FROM uts_pinfo"); +$playercount = $r_playercount['result']; +$servercount = small_count("SELECT DISTINCT servername FROM uts_match"); +$mapcount = small_count("SELECT COUNT(mapfile) AS result FROM uts_match GROUP BY mapfile"); +$r_matchcount = small_query("SELECT COUNT(*) AS result FROM uts_match"); +$matchcount= $r_matchcount['result']; +$hourscount = small_query("SELECT SUM(gametime) AS result FROM uts_player"); + +$gametime = sec2hour($hourscount[result]); + +echo' + + '.$playercount.' + '.$servercount.' + '.$mapcount.' + '.$matchcount.' + '.$gametime.' + + + + + +
+
+

Welcome to UTStats.
+ Here you can look up information on UT matches and players.
+ Select a category from the column on the left.

+
+ + + + + + + + + + + + + + '; + +$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"; +$q_gamesummary = mysql_query($sql_gamesummary) or die(mysql_error()); +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'"); + $gametime = sec2hour($q_gametime[gametime]); + + echo' + + + + + + '; +} + +$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"); + +$q_gametime = small_query("SELECT SUM(gametime) AS gametime FROM uts_match"); +$gametime = sec2hour($q_gametime[gametime]); + +echo' + + + + + + + + +
Game Summary
Match TypeFragsKillsSuicidesTeam KillsMatchesGame Hours
'.$r_gamesummary[gamename].''.$r_gamesummary[frags].''.$r_gamesummary[kills].''.$r_gamesummary[suicides].''.$r_gamesummary[teamkills].''.$r_gamesummary[matchcount].''.$gametime.'
Totals for All Players'.$totalsummary[frags].''.$totalsummary[kills].''.$totalsummary[suicides].''.$totalsummary[teamkills].''.$totalsummary[matchcount].''.$gametime.'
+

'; + +// Do graph stuff +$gtitle = "Across All Servers"; +$bgwhere = "id >= 0"; +include("pages/graph_mbreakdown.php"); +?> \ No newline at end of file diff --git a/html/pages/index.htm b/html/pages/index.htm new file mode 100755 index 0000000..e69de29 diff --git a/html/pages/maps.php b/html/pages/maps.php new file mode 100755 index 0000000..409398c --- /dev/null +++ b/html/pages/maps.php @@ -0,0 +1,143 @@ +'); +} + + +// Get filter and set sorting +$filter = my_addslashes($_GET[filter]); +$sort = my_addslashes($_GET[sort]); +$q = my_addslashes($_GET[q]); +$gid = preg_replace('/\D/', '', $_GET[gid]); + +IF (empty($filter) or (!in_array(strtolower($filter), array("mapfile", "matchcount", "frags", "matchscore", "gametime")))) { + $filter = "mapfile"; +} + +if (empty($sort) or ($sort != 'ASC' and $sort != 'DESC')) $sort = ($filter == "mapfile") ? "ASC" : "DESC"; + +if (isset($gid)) { + if ($gid != 0) { + $url_condition .= "&gid=".urlencode($gid); + $sql_condition = " WHERE gid = $gid"; + } +} +else { + $gid = 0; +} + +if (isset($q)) { + if ($gid != 0) { + $sql_condition .= ' AND mapfile LIKE "%' . $q . '%" '; + } + else { + $sql_condition .= ' WHERE mapfile LIKE "%' . $q . '%" '; + } + $url_condition .= "&q=".urlencode($q); +} + + +// Firstly we need to work out First Last Next Prev pages + +$mcount = small_count("SELECT mapfile FROM uts_match" . $sql_condition . " GROUP BY mapfile"); + +$ecount = $mcount/25; +$ecount2 = number_format($ecount, 0, '.', ''); + +IF($ecount > $ecount2) { + $ecount2 = $ecount2+1; +} + +$fpage = 0; +IF($ecount < 1) { $lpage = 0; } +else { $lpage = $ecount2-1; } + +$cpage = preg_replace('/\D/', '', $_GET["page"]); +IF ($cpage == "") { $cpage = "0"; } +$qpage = $cpage*25; + +$tfpage = $cpage+1; +$tlpage = $lpage+1; + +$ppage = $cpage-1; +$ppageurl = "[Previous]"; +IF ($ppage < "0") { $ppageurl = "[Previous]"; } + +$npage = $cpage+1; +$npageurl = "[Next]"; +IF ($npage >= "$ecount") { $npageurl = "[Next]"; } + +$fpageurl = "[First]"; +IF ($cpage == "0") { $fpageurl = "[First]"; } + +$lpageurl = "[Last]"; +IF ($cpage == "$lpage") { $lpageurl = "[Last]"; } + +echo' +
+
Page ['.$tfpage.'/'.$tlpage.'] Selection: '.$fpageurl.' / '.$ppageurl.' / '.$npageurl.' / '.$lpageurl.'
+ + + + + + + + + + + + + + '; + +$sql_maps = "SELECT IF(RIGHT(mapfile,4) LIKE '.unr', mapfile, CONCAT(mapfile, '.unr')) as mapfile, COUNT(id) AS matchcount, AVG(frags) AS frags, AVG(t0score+t1score+t2score+t3score) AS matchscore, SUM(gametime) AS gametime +FROM uts_match" . $sql_condition . " GROUP BY mapfile ORDER BY $filter $sort LIMIT $qpage,25"; +$q_maps = mysql_query($sql_maps) or die(mysql_error()); +while ($r_maps = mysql_fetch_array($q_maps)) { + + $r_mapfile = un_ut($r_maps[mapfile]); + $myurl = urlencode($r_mapfile); + $r_gametime = GetMinutes($r_maps[gametime]); + + echo' + + + + + + + '; +} + +echo' +
Unreal Tournament Maps List
+ + + + Filter: '; +echo ' '; +echo ' Search: '; +echo ' '; +echo ' +
Map Name'.SortPic('mapfile', $filter, $sort).'Matches'.SortPic('matchcount', $filter, $sort).'Avg. Frags'.SortPic('frags', $filter, $sort).'Avg. Score'.SortPic('matchscore', $filter, $sort).'Time'.SortPic('gametime', $filter, $sort).'
'.$r_mapfile.''.$r_maps[matchcount].''.get_dp($r_maps[frags]).''.get_dp($r_maps[matchscore]).''.$r_gametime.'
+
Page ['.$tfpage.'/'.$tlpage.'] Selection: '.$fpageurl.' / '.$ppageurl.' / '.$npageurl.' / '.$lpageurl.'
+
'; +?> \ No newline at end of file diff --git a/html/pages/maps_info.php b/html/pages/maps_info.php new file mode 100755 index 0000000..329fcce --- /dev/null +++ b/html/pages/maps_info.php @@ -0,0 +1,321 @@ + + + Statistics for '.htmlentities($map).' + + + Matches + '.$map_matches[matchcount].' + '.htmlentities($map).' + + + Total Time + '.$map_tottime.' minutes + '; +// Show some gametype specific stuff +if ((strtolower(substr($map, 0, 7)) == "ctf-bt-") or (strtolower(substr($map, 0, 3)) == "bt-")) { + // Bunny Track + $record = small_query("SELECT pi.id, pi.name AS name, pi.country, e.col3 AS time, e.col4 AS date FROM uts_events AS e, uts_pinfo AS pi, uts_player AS p, uts_match AS m WHERE m.id = e.matchid AND m.id = p.matchid AND p.playerid = e.playerid AND pi.id = p.pid AND (m.mapfile = '$realmap' OR m.mapfile = '$bugmap') AND e.col1 = 'btcap' GROUP BY pi.id ORDER BY (0 + e.col3) ASC, e.col4 ASC LIMIT 0,1"); + if (!empty($record['time'])) { + echo ' + + Fastest Capture + '.FormatPlayerName($record['country'], $record['id'], $record['name']).'
' . btcaptime($record['time']) . ' minutes
'.gmdate('d-m-Y h:i a', $record['date']).' + '; + } + else { + echo ' + + Fastest Capture + No record set! + '; + } + echo ' + + Total Flags Captured + '.$map_matches[gamescore].' + + + Total Suicides + '.$map_matches[suicides].' + '; +} +else if (strtolower(substr($map, 0, 4)) == "ctf-") { + // Capture the Flag + $totals = small_query("SELECT SUM(p.flag_taken) as flag_taken, SUM(p.flag_return) AS flag_return, SUM(p.flag_cover) AS flag_cover FROM uts_player AS p, uts_match AS m WHERE m.id = p.matchid AND (m.mapfile = '$realmap' OR m.mapfile = '$bugmap')"); + echo ' + + Total Flags Captured + '.$map_matches[gamescore].' + + + Total Flags Taken + '.$totals['flag_taken'].' + + + Total Covers + '.$totals['flag_cover'].' + + + Total Flags Returned + '.$totals['flag_return'].' + + + Total Kills + '.$map_matches[kills].' + + + Total Suicides + '.$map_matches[suicides].' + '; +} +else if (strtolower(substr($map, 0, 3)) == "as-") { + // Assault + $totals = small_query("SELECT SUM(p.ass_obj) as ass_obj FROM uts_player AS p, uts_match AS m WHERE m.id = p.matchid AND (m.mapfile = '$realmap' OR m.mapfile = '$bugmap')"); + echo ' + + Total Objectives Achieved + '.$totals[ass_obj].' + + + Total Kills + '.$map_matches[kills].' + + + Total Suicides + '.$map_matches[suicides].' + '; +} +else if (strtolower(substr($map, 0, 3)) == "jb-") { + // Assault + $totals = small_query("SELECT SUM(p.ass_obj) as ass_obj FROM uts_player AS p, uts_match AS m WHERE m.id = p.matchid AND (m.mapfile = '$realmap' OR m.mapfile = '$bugmap')"); + echo ' + + Team Releases + '.$totals[ass_obj].' + + + Total Kills + '.$map_matches[kills].' + + + Total Suicides + '.$map_matches[suicides].' + '; +} +else if (strtolower(substr($map, 0, 4)) == "dom-") { + // Assault + $totals = small_query("SELECT SUM(p.dom_cp) as dom_cp FROM uts_player AS p, uts_match AS m WHERE m.id = p.matchid AND (m.mapfile = '$realmap' OR m.mapfile = '$bugmap')"); + echo ' + + Total Control Points Captured + '.$totals['dom_cp'].' + + + Total Kills + '.$map_matches[kills].' + + + Total Suicides + '.$map_matches[suicides].' + '; +} +else { + echo ' + + Total Score + '.$map_matches[gamescore].' + + + Total Kills + '.$map_matches[kills].' + + + Total Teamkills + '.$map_matches[teamkills].' + + + Total Suicides + '.$map_matches[suicides].' + '; +} +echo ' + + Last Match + '.$map_lastmatch.' + + +
'; + +// Do graph stuff +$bgwhere = "(mapfile = '$realmap' or mapfile = '$bugmap')"; +include("pages/graph_mbreakdown.php"); + +// Show a list of BT records +if ((strtolower(substr($map, 0, 7)) == "ctf-bt-") or (strtolower(substr($map, 0, 3)) == "bt-")) { + $mcount = small_count("SELECT pi.id FROM uts_events AS e, uts_pinfo AS pi, uts_player AS p, uts_match AS m WHERE m.id = e.matchid AND m.id = p.matchid AND p.playerid = e.playerid AND pi.id = p.pid AND (m.mapfile = '$realmap' OR m.mapfile = '$bugmap') GROUP BY pi.id"); + + $ecount = $mcount/25; + $ecount2 = number_format($ecount, 0, '.', ''); + + IF($ecount > $ecount2) { + $ecount2 = $ecount2+1; + } + + $fpage = 0; + IF($ecount < 1) { $lpage = 0; } + else { $lpage = $ecount2-1; } + + $cpage = preg_replace('/\D/', '', $_GET["rpage"]); + $qpage = $cpage*25; + + IF ($cpage == "") { $cpage = "0"; } + + $tfpage = $cpage+1; + $tlpage = $lpage+1; + + $ppage = $cpage-1; + $ppageurl = "[Previous]"; + IF ($ppage < "0") { $ppageurl = "[Previous]"; } + + $npage = $cpage+1; + $npageurl = "[Next]"; + IF ($npage >= "$ecount") { $npageurl = "[Next]"; } + + $fpageurl = "[First]"; + IF ($cpage == "0") { $fpageurl = "[First]"; } + + $lpageurl = "[Last]"; + IF ($cpage == "$lpage") { $lpageurl = "[Last]"; } + + $sql_btrecords = "SELECT pi.id, pi.name AS name, pi.country, e.col3 AS time, e.col4 AS date FROM uts_events AS e, uts_pinfo AS pi, uts_player AS p, uts_match AS m WHERE m.id = e.matchid AND m.id = p.matchid AND p.playerid = e.playerid AND pi.id = p.pid AND (m.mapfile = '$realmap' OR m.mapfile = '$bugmap') AND e.col1 = 'btcap' GROUP BY pi.id ORDER BY (0 + e.col3) ASC, e.col4 ASC LIMIT $qpage,25"; + $q_btrecords = mysql_query($sql_btrecords) or die (mysql_error()); + if (mysql_num_rows($q_btrecords) > 0) { + echo ' +
Page ['.$tfpage.'/'.$tlpage.'] Selection: '.$fpageurl.' / '.$ppageurl.' / '.$npageurl.' / '.$lpageurl.'
+ + + + + + + + + + + '; + $i = $qpage; + $lasttime = -1; + while ($r_btrecords = mysql_fetch_array($q_btrecords)) { + $i++; + $class = ($i%2) ? 'grey' : 'grey2'; + echo ' + + + + '; + $lasttime = $r_btrecords['time']; + } + echo ' + +
Fastest captures
NameTimeDate
'.($lasttime == $r_btrecords['time'] ? '' : $i).' ', FormatPlayerName($r_btrecords['country'], $r_btrecords['id'], $r_btrecords['name']), '', btcaptime($r_btrecords['time']), '', gmdate('d-m-Y h:i a', $r_btrecords['date']), '
+
Page ['.$tfpage.'/'.$tlpage.'] Selection: '.$fpageurl.' / '.$ppageurl.' / '.$npageurl.' / '.$lpageurl.'

'; + } +} + + + +// Show a list of recent matches +$mcount = small_count("SELECT id FROM uts_match WHERE mapfile = '$realmap' OR mapfile = '$bugmap' GROUP BY id"); + +$ecount = $mcount/25; +$ecount2 = number_format($ecount, 0, '.', ''); + +IF($ecount > $ecount2) { + $ecount2 = $ecount2+1; +} + +$fpage = 0; +IF($ecount < 1) { $lpage = 0; } +else { $lpage = $ecount2-1; } + +$cpage = preg_replace('/\D/', '', $_GET["page"]); +$qpage = $cpage*25; + +IF ($cpage == "") { $cpage = "0"; } + +$tfpage = $cpage+1; +$tlpage = $lpage+1; + +$ppage = $cpage-1; +$ppageurl = "[Previous]"; +IF ($ppage < "0") { $ppageurl = "[Previous]"; } + +$npage = $cpage+1; +$npageurl = "[Next]"; +IF ($npage >= "$ecount") { $npageurl = "[Next]"; } + +$fpageurl = "[First]"; +IF ($cpage == "0") { $fpageurl = "[First]"; } + +$lpageurl = "[Last]"; +IF ($cpage == "$lpage") { $lpageurl = "[Last]"; } + +// list recent matches +echo' +
Page ['.$tfpage.'/'.$tlpage.'] Selection: '.$fpageurl.' / '.$ppageurl.' / '.$npageurl.' / '.$lpageurl.'
+ + + + + + + + + + '; + +$sql_maps = "SELECT m.id, m.time, g.name AS gamename, m.gametime +FROM uts_match AS m, uts_games AS g WHERE (m.mapfile = '$realmap' OR m.mapfile = '$bugmap') AND m.gid = g.id ORDER BY time DESC LIMIT $qpage,25"; +$q_maps = mysql_query($sql_maps) or die(mysql_error()); +while ($r_maps = mysql_fetch_array($q_maps)) { + + $r_mapfile = un_ut($r_maps[mapfile]); + $r_matchtime = mdate($r_maps[time]); + $r_gametime = GetMinutes($r_maps[gametime]); + + $map_pcount = small_count("SELECT id FROM uts_player WHERE matchid = $r_maps[id]"); + + echo' + + + + + + '; +} + +echo' +
Recent Matches
DateMatch TypePlayer CountTime
'.$r_matchtime.''.$r_maps[gamename].''.$map_pcount.''.$r_gametime.'
+
Page ['.$tfpage.'/'.$tlpage.'] Selection: '.$fpageurl.' / '.$ppageurl.' / '.$npageurl.' / '.$lpageurl.'
'; +?> diff --git a/html/pages/match.php b/html/pages/match.php new file mode 100755 index 0000000..22a0399 --- /dev/null +++ b/html/pages/match.php @@ -0,0 +1,10 @@ + \ No newline at end of file diff --git a/html/pages/match_info.php b/html/pages/match_info.php new file mode 100755 index 0000000..27b6669 --- /dev/null +++ b/html/pages/match_info.php @@ -0,0 +1,78 @@ + + + Unreal Tournament Match + + +
'; +include("pages/match_info_server.php"); + +$GLOBALS['gid'] = $gid; +$_GLOBALS['gid'] = $gid; +$GLOBALS['gamename'] = $gamename; +$_GLOBALS['gamename'] = $gamename; + +include('includes/teamstats.php'); +switch($real_gamename) { + case "Assault": + 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'); + break; + + case "Bunny Track": + include("pages/match_info_bt.php"); + break; + + case "Extended Last Man Standing": + case "Extended Last Man Standing (insta)": + case "Last Man Standing": + case "Last Man Standing (insta)": + case "Last Man Standing +": + case "Last Man Standing + (insta)": + case "Last Man Standing++": + case "Last Man Standing++ (insta)": + include("pages/match_info_lms.php"); + break; + + default: + if ($teamgame) { + teamstats($mid, 'Match Summary'); + } else { + teamstats($mid, 'Player Summary'); + } +} + + +if ($real_gamename == "Assault" or $real_gamename== "Assault (insta)") { + include("pages/match_info_other2.php"); +} +else if ($real_gamename != "Bunny Track") { + include("pages/match_info_other.php"); +} + +if ($real_gamename == "Capture the Flag" or $real_gamename== "Capture the Flag (insta)") { + include("pages/match_report.php"); +} + +?> \ No newline at end of file diff --git a/html/pages/match_info_ass.php b/html/pages/match_info_ass.php new file mode 100755 index 0000000..df968ec --- /dev/null +++ b/html/pages/match_info_ass.php @@ -0,0 +1,64 @@ + + + '.$asswin.' + + +
'; + +// The Other Game (if it happened) + +IF($mid2 != NULL) { + teamstats($mid2, 'Match Summary - '.$ass_att2.' Team Attacking', 'ass_obj', 'Ass Obj'); + + echo' + + + + +
'.$asswin2.'
+
'; +} +?> diff --git a/html/pages/match_info_bt.php b/html/pages/match_info_bt.php new file mode 100755 index 0000000..ed14e3d --- /dev/null +++ b/html/pages/match_info_bt.php @@ -0,0 +1,164 @@ + + + Game Summary + + + Team: Red + + + Player + Time + Score + Flag Captures + Fastest Capture + Suicides + + + Team + Player + '; + +$sql_msred = "SELECT p.playerid, pi.name, pi.banned, p.country, p.pid, p.gamescore, p.gametime, p.flag_capture, p.suicides, p.rank, MIN(e.col3) AS captime + FROM uts_pinfo AS pi, uts_player AS p + LEFT JOIN uts_events AS e + ON p.playerid = e.playerid AND p.matchid = e.matchid AND e.col1 = 'btcap' + WHERE p.pid = pi.id AND p.matchid = $mid AND team = 0 + GROUP BY p.playerid + ORDER BY e.col1 DESC, (0 + e.col3) ASC, gamescore DESC"; +$q_msred = mysql_query($sql_msred) or die(mysql_error()); +$i = 0; +while ($r_msred = zero_out(mysql_fetch_array($q_msred))) { + if (!$r_msred['playerid']) { + $r_msred['playerid'] = 0; + } + $i++; + $class = ($i % 2) ? 'grey' : 'grey2'; + + $redpname = $r_msred[name]; + $myurl = urlencode($r_msred[name]); + + + + echo''; + if ($r_msred['banned'] != 'Y') { + echo ''.FormatPlayerName($r_msred[country], $r_msred['pid'], $redpname, $gid, $gamename, true, $r_msred['rank']).''; + } else { + $r_msred ['gamescore'] = '-'; + $r_msred ['suicides'] = '-'; + $r_msred ['flag_capture'] = '-'; + echo ''.FormatPlayerName($r_msred[country], $r_msred['pid'], $redpname, $gid, $gamename, true, $r_msred['rank']).''; + } + + echo ' + '.GetMinutes($r_msred[gametime]).' + + '.$r_msred[gamescore].' + '.$r_msred[flag_capture].' + '.btcaptime($r_msred[captime]).' + '.$r_msred[suicides].' + '; +} + +$teamscore = small_query("SELECT t0score AS teamscore FROM uts_match WHERE id = $mid"); +$msredtot = small_query("SELECT SUM(gamescore) AS gamescore, SUM(suicides) AS suicides, SUM(flag_capture) AS flag_capture FROM uts_player WHERE matchid = $mid AND team = 0 ORDER BY gamescore DESC"); + + +echo' + + Totals + + '.$teamscore[teamscore].' + '.$msredtot[gamescore].' + '.$msredtot[flag_capture].' + + '.$msredtot[suicides].' + '; + +echo' + + Team: Blue + + + Player + Time + Score + Flag Captures + Fastest Capture + Suicides + + + Team + Player + '; + +$sql_msblue = "SELECT p.playerid, pi.name, pi.banned, p.country, p.pid, p.gamescore, p.gametime, p.flag_capture, p.suicides, p.rank, MIN(e.col3) AS captime + FROM uts_pinfo AS pi, uts_player AS p + LEFT JOIN uts_events AS e + ON p.playerid = e.playerid AND p.matchid = e.matchid AND e.col1 = 'btcap' + WHERE p.pid = pi.id AND p.matchid = $mid AND team = 1 + GROUP BY p.playerid + ORDER BY e.col1 DESC, (0 + e.col3) ASC, gamescore DESC"; +$q_msblue = mysql_query($sql_msblue) or die(mysql_error()); +$i = 0; +while ($r_msblue = zero_out(mysql_fetch_array($q_msblue))) { + if (!$r_msblue['playerid']) { + $r_msblue['playerid'] = 0; + } + $i++; + $class = ($i % 2) ? 'grey' : 'grey2'; + + $bluepname = $r_msblue[name]; + $myurl = urlencode($r_msblue[name]); + + + + echo''; + if ($r_msblue['banned'] != 'Y') { + echo ''.FormatPlayerName($r_msblue[country], $r_msblue['pid'], $bluepname, $gid, $gamename, true, $r_msblue['rank']).''; + } else { + $r_msblue ['gamescore'] = '-'; + $r_msblue ['suicides'] = '-'; + $r_msblue ['flag_capture'] = '-'; + echo ''.FormatPlayerName($r_msblue[country], $r_msblue['pid'], $bluepname, $gid, $gamename, true, $r_msblue['rank']).''; + } + + echo ' + '.GetMinutes($r_msblue[gametime]).' + + '.$r_msblue[gamescore].' + '.$r_msblue[flag_capture].' + '.btcaptime($r_msblue[captime]).' + '.$r_msblue[suicides].' + '; +} + +$teamscore = small_query("SELECT t1score AS teamscore FROM uts_match WHERE id = $mid"); +$msbluetot = small_query("SELECT SUM(gamescore) AS gamescore, SUM(suicides) AS suicides, SUM(flag_capture) AS flag_capture FROM uts_player WHERE matchid = $mid AND team = 1 ORDER BY gamescore DESC"); + + +echo' + + Totals + + '.$teamscore[teamscore].' + '.$msbluetot[gamescore].' + '.$msbluetot[flag_capture].' + + '.$msbluetot[suicides].' + '; + + +echo' +
'; + +?> diff --git a/html/pages/match_info_ctf.php b/html/pages/match_info_ctf.php new file mode 100755 index 0000000..7426a4e --- /dev/null +++ b/html/pages/match_info_ctf.php @@ -0,0 +1,362 @@ + + + Flag Event Summary + + + Team: Red + + + Player + Score + Flag Taken + Flag Pickup + Flag Drop + Flag Assist + Flag Cover + Flag Seal + Flag Capture + Flag Kill + Flag Return + + + Team + Player + '; + +$sql_msred = "SELECT p.playerid, pi.name, pi.banned, p.country, p.pid, p.gamescore, p.flag_taken, p.flag_pickedup, p.flag_dropped, p.flag_assist, p.flag_cover, p.flag_seal, p.flag_capture, p.flag_kill, p.flag_return, p.rank +FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND matchid = $mid AND team = 0 ORDER BY gamescore DESC"; +$q_msred = mysql_query($sql_msred) or die(mysql_error()); +$i = 0; +while ($r_msred = zero_out(mysql_fetch_array($q_msred))) { + $i++; + $class = ($i % 2) ? 'grey' : 'grey2'; + + $redpname = $r_msred[name]; + $myurl = urlencode($r_msred[name]); + + + + echo''; + if ($r_msred['banned'] != 'Y') { + echo ''.FormatPlayerName($r_msred[country], $r_msred['pid'], $redpname, $gid, $gamename, true, $r_msred['rank']).''; + } else { + $r_msred ['gamescore'] = '-'; + $r_msred ['flag_taken'] = '-'; + $r_msred ['flag_pickedup'] = '-'; + $r_msred ['flag_dropped'] = '-'; + $r_msred ['flag_assist'] = '-'; + $r_msred ['flag_cover'] = '-'; + $r_msred ['flag_seal'] = '-'; + $r_msred ['flag_capture'] = '-'; + $r_msred ['flag_kill'] = '-'; + $r_msred ['flag_return'] = '-'; + echo ''.FormatPlayerName($r_msred[country], $r_msred['pid'], $redpname, $gid, $gamename, true, $r_msred['rank']).''; + } + + echo ' + + '.$r_msred[gamescore].' + '.$r_msred[flag_taken].' + '.$r_msred[flag_pickedup].' + '.$r_msred[flag_dropped].' + '.$r_msred[flag_assist].' + '.$r_msred[flag_cover].' + '.$r_msred[flag_seal].' + '.$r_msred[flag_capture].' + '.$r_msred[flag_kill].' + '.$r_msred[flag_return].' + '; +} + +$teamscore = small_query("SELECT t0score AS teamscore FROM uts_match WHERE id = $mid"); +$msredtot = small_query("SELECT SUM(gamescore) AS gamescore, SUM(flag_taken) AS flag_taken, SUM(flag_pickedup) AS flag_pickedup, SUM(flag_dropped) AS flag_dropped, SUM(flag_assist) AS flag_assist, SUM(flag_cover) AS flag_cover, SUM(flag_seal) AS flag_seal, SUM(flag_capture) AS flag_capture, SUM(flag_kill)as flag_kill, SUM(flag_return) AS flag_return +FROM uts_player WHERE matchid = $mid AND team = 0 ORDER BY gamescore DESC"); + + +echo' + + Totals + '.$teamscore[teamscore].' + '.$msredtot[gamescore].' + '.$msredtot[flag_taken].' + '.$msredtot[flag_pickedup].' + '.$msredtot[flag_dropped].' + '.$msredtot[flag_assist].' + '.$msredtot[flag_cover].' + '.$msredtot[flag_seal].' + '.$msredtot[flag_capture].' + '.$msredtot[flag_kill].' + '.$msredtot[flag_return].' + + + + + Team: Blue + + + Player + Score + Flag Taken + Flag Pickup + Flag Drop + Flag Assist + Flag Cover + Flag Seal + Flag Capture + Flag Kill + Flag Return + + + Team + Player + '; + +$sql_msblue = "SELECT p.playerid, pi.name, pi.banned, p.country, p.pid, p.gamescore, p.flag_taken, p.flag_pickedup, p.flag_dropped, p.flag_assist, p.flag_cover, p.flag_seal, p.flag_capture, p.flag_kill, p.flag_return, p.rank +FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND matchid = $mid AND team = 1 ORDER BY gamescore DESC"; +$q_msblue = mysql_query($sql_msblue) or die(mysql_error()); +$i = 0; +while ($r_msblue = zero_out(mysql_fetch_array($q_msblue))) { + $i++; + $class = ($i % 2) ? 'grey' : 'grey2'; + + $bluepname = $r_msblue[name]; + $myurl = urlencode($r_msblue[name]); + + echo''; + if ($r_msblue['banned'] != 'Y') { + echo ''.FormatPlayerName($r_msblue[country], $r_msblue['pid'], $bluepname, $gid, $gamename, true, $r_msblue['rank']).''; + } else { + $r_msblue ['gamescore'] = '-'; + $r_msblue ['flag_taken'] = '-'; + $r_msblue ['flag_pickedup'] = '-'; + $r_msblue ['flag_dropped'] = '-'; + $r_msblue ['flag_assist'] = '-'; + $r_msblue ['flag_cover'] = '-'; + $r_msblue ['flag_seal'] = '-'; + $r_msblue ['flag_capture'] = '-'; + $r_msblue ['flag_kill'] = '-'; + $r_msblue ['flag_return'] = '-'; + echo ''.FormatPlayerName($r_msblue[country], $r_msblue['pid'], $bluepname, $gid, $gamename, true, $r_msblue['rank']).''; + } + + echo ' + + '.$r_msblue[gamescore].' + '.$r_msblue[flag_taken].' + '.$r_msblue[flag_pickedup].' + '.$r_msblue[flag_dropped].' + '.$r_msblue[flag_assist].' + '.$r_msblue[flag_cover].' + '.$r_msblue[flag_seal].' + '.$r_msblue[flag_capture].' + '.$r_msblue[flag_kill].' + '.$r_msblue[flag_return].' + '; +} + +$teamscore = small_query("SELECT t1score AS teamscore FROM uts_match WHERE id = $mid"); +$msbluetot = small_query("SELECT SUM(gamescore) AS gamescore, SUM(flag_taken) AS flag_taken, SUM(flag_pickedup) AS flag_pickedup, SUM(flag_dropped) AS flag_dropped, SUM(flag_assist) AS flag_assist, SUM(flag_cover) AS flag_cover, SUM(flag_seal) AS flag_seal, SUM(flag_capture) AS flag_capture, SUM(flag_kill)as flag_kill, SUM(flag_return) AS flag_return +FROM uts_player WHERE matchid = $mid AND team = 1 ORDER BY gamescore DESC"); + +echo' + + Totals + '.$teamscore[teamscore].' + '.$msbluetot[gamescore].' + '.$msbluetot[flag_taken].' + '.$msbluetot[flag_pickedup].' + '.$msbluetot[flag_dropped].' + '.$msbluetot[flag_assist].' + '.$msbluetot[flag_cover].' + '.$msbluetot[flag_seal].' + '.$msbluetot[flag_capture].' + '.$msbluetot[flag_kill].' + '.$msbluetot[flag_return].' + '; + +// Check If Green Team Were Used (CTF4 Compatibility) + +$greencheck = small_count("SELECT * FROM uts_player WHERE matchid = $mid AND team = 2"); +IF ($greencheck > 0) { + + echo' + Team: Green + + + Player + Score + Flag Taken + Flag Pickup + Flag Drop + Flag Assist + Flag Cover + Flag Seal + Flag Capture + Flag Kill + Flag Return + + + Team + Player + '; + + $sql_msgreen = "SELECT p.playerid, pi.name, pi.banned, p.country, p.pid, p.gamescore, p.flag_taken, p.flag_pickedup, p.flag_dropped, p.flag_assist, p.flag_cover, p.flag_seal, p.flag_capture, p.flag_kill, p.flag_return, p.rank + FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND matchid = $mid AND team = 2 ORDER BY gamescore DESC"; + $q_msgreen = mysql_query($sql_msgreen) or die(mysql_error()); + $i = 0; + while ($r_msgreen = zero_out(mysql_fetch_array($q_msgreen))) { + $i++; + $class = ($i % 2) ? 'grey' : 'grey2'; + + $greenpname = $r_msgreen[name]; + $myurl = urlencode($r_msgreen[name]); + + echo''; + if ($r_msgreen['banned'] != 'Y') { + echo ''.FormatPlayerName($r_msgreen[country], $r_msgreen['pid'], $greenpname, $gid, $gamename, true, $r_msgreen['rank']).''; + } else { + $r_msgreen ['gamescore'] = '-'; + $r_msgreen ['flag_taken'] = '-'; + $r_msgreen ['flag_pickedup'] = '-'; + $r_msgreen ['flag_dropped'] = '-'; + $r_msgreen ['flag_assist'] = '-'; + $r_msgreen ['flag_cover'] = '-'; + $r_msgreen ['flag_seal'] = '-'; + $r_msgreen ['flag_capture'] = '-'; + $r_msgreen ['flag_kill'] = '-'; + $r_msgreen ['flag_return'] = '-'; + echo ''.FormatPlayerName($r_msgreen[country], $r_msgreen['pid'], $greenpname, $gid, $gamename, true, $r_msgreen['rank']).''; + } + + echo ' + + '.$r_msgreen[gamescore].' + '.$r_msgreen[flag_taken].' + '.$r_msgreen[flag_pickedup].' + '.$r_msgreen[flag_dropped].' + '.$r_msgreen[flag_assist].' + '.$r_msgreen[flag_cover].' + '.$r_msgreen[flag_seal].' + '.$r_msgreen[flag_capture].' + '.$r_msgreen[flag_kill].' + '.$r_msgreen[flag_return].' + '; + } + + $teamscore = small_query("SELECT t1score AS teamscore FROM uts_match WHERE id = $mid"); + $msgreentot = small_query("SELECT SUM(gamescore) AS gamescore, SUM(flag_taken) AS flag_taken, SUM(flag_pickedup) AS flag_pickedup, SUM(flag_dropped) AS flag_dropped, SUM(flag_assist) AS flag_assist, SUM(flag_cover) AS flag_cover, SUM(flag_seal) AS flag_seal, SUM(flag_capture) AS flag_capture, SUM(flag_kill)as flag_kill, SUM(flag_return) AS flag_return + FROM uts_player WHERE matchid = $mid AND team = 2 ORDER BY gamescore DESC"); + + echo' + + Totals + '.$teamscore[teamscore].' + '.$msgreentot[gamescore].' + '.$msgreentot[flag_taken].' + '.$msgreentot[flag_pickedup].' + '.$msgreentot[flag_dropped].' + '.$msgreentot[flag_assist].' + '.$msgreentot[flag_cover].' + '.$msgreentot[flag_seal].' + '.$msgreentot[flag_capture].' + '.$msgreentot[flag_kill].' + '.$msgreentot[flag_return].' + '; +} + +// Check If Gold Team Were Used (CTF4 Compatibility) + +$goldcheck = small_count("SELECT * FROM uts_player WHERE matchid = $mid AND team = 3"); +IF ($goldcheck > 0) { + + echo' + Team: Gold + + + Player + Score + Flag Taken + Flag Pickup + Flag Drop + Flag Assist + Flag Cover + Flag Seal + Flag Capture + Flag Kill + Flag Return + + + Team + Player + '; + + $sql_msgold = "SELECT p.playerid, pi.name, pi.banned, p.country, p.pid, p.gamescore, p.flag_taken, p.flag_pickedup, p.flag_dropped, p.flag_assist, p.flag_cover, p.flag_seal, p.flag_capture, p.flag_kill, p.flag_return, p.rank + FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND matchid = $mid AND team = 3 ORDER BY gamescore DESC"; + $q_msgold = mysql_query($sql_msgold) or die(mysql_error()); + $i = 0; + while ($r_msgold = zero_out(mysql_fetch_array($q_msgold))) { + $i++; + $class = ($i % 2) ? 'grey' : 'grey2'; + + $goldpname = $r_msgold[name]; + $myurl = urlencode($r_msgold[name]); + + echo''; + if ($r_msgold['banned'] != 'Y') { + echo ''.FormatPlayerName($r_msgold[country], $r_msgold['pid'], $goldpname, $gid, $gamename, true, $r_msgold['rank']).''; + } else { + $r_msgold ['gamescore'] = '-'; + $r_msgold ['flag_taken'] = '-'; + $r_msgold ['flag_pickedup'] = '-'; + $r_msgold ['flag_dropped'] = '-'; + $r_msgold ['flag_assist'] = '-'; + $r_msgold ['flag_cover'] = '-'; + $r_msgold ['flag_seal'] = '-'; + $r_msgold ['flag_capture'] = '-'; + $r_msgold ['flag_kill'] = '-'; + $r_msgold ['flag_return'] = '-'; + echo ''.FormatPlayerName($r_msgold[country], $r_msgold['pid'], $goldpname, $gid, $gamename, true, $r_msgold['rank']).''; + } + + echo ' + + '.$r_msgold[gamescore].' + '.$r_msgold[flag_taken].' + '.$r_msgold[flag_pickedup].' + '.$r_msgold[flag_dropped].' + '.$r_msgold[flag_assist].' + '.$r_msgold[flag_cover].' + '.$r_msgold[flag_seal].' + '.$r_msgold[flag_capture].' + '.$r_msgold[flag_kill].' + '.$r_msgold[flag_return].' + '; + } + + $teamscore = small_query("SELECT t1score AS teamscore FROM uts_match WHERE id = $mid"); + $msgoldtot = small_query("SELECT SUM(gamescore) AS gamescore, SUM(flag_taken) AS flag_taken, SUM(flag_pickedup) AS flag_pickedup, SUM(flag_dropped) AS flag_dropped, SUM(flag_assist) AS flag_assist, SUM(flag_cover) AS flag_cover, SUM(flag_seal) AS flag_seal, SUM(flag_capture) AS flag_capture, SUM(flag_kill)as flag_kill, SUM(flag_return) AS flag_return + FROM uts_player WHERE matchid = $mid AND team = 3 ORDER BY gamescore DESC"); + + echo' + + Totals + '.$teamscore[teamscore].' + '.$msgoldtot[gamescore].' + '.$msgoldtot[flag_taken].' + '.$msgoldtot[flag_pickedup].' + '.$msgoldtot[flag_dropped].' + '.$msgoldtot[flag_assist].' + '.$msgoldtot[flag_cover].' + '.$msgoldtot[flag_seal].' + '.$msgoldtot[flag_capture].' + '.$msgoldtot[flag_kill].' + '.$msgoldtot[flag_return].' + '; +} + +echo' +
'; + +?> diff --git a/html/pages/match_info_killsmatrix.php b/html/pages/match_info_killsmatrix.php new file mode 100755 index 0000000..be16905 --- /dev/null +++ b/html/pages/match_info_killsmatrix.php @@ -0,0 +1,131 @@ +'; + } + return($ret); +} + +// Retrieve the killmatrix +$sql_km = " SELECT killer, + victim, + kills + FROM uts_killsmatrix + WHERE matchid = $mid;"; + +$q_km = mysql_query($sql_km) or die(mysql_error()); +while ($r_km = mysql_fetch_array($q_km)) { + $km[intval($r_km['killer'])][intval($r_km['victim'])] = $r_km['kills']; +} + +// No matrix: bye +if (!isset($km)) return; + +// Are we processing a teamgame? +$qm_teamgame = small_query("SELECT teamgame FROM uts_match WHERE id = '$mid';"); +$teamgame = $qm_teamgame['teamgame']; +$teamgame = ($teamgame == 'False') ? false : true; + +// Get the players of this match +$sql_players = " SELECT p.pid, + p.playerid, + pi.name, + pi.country, + pi.banned, + p.team, + p.suicides + FROM uts_player p, + uts_pinfo pi + WHERE (p.pid = pi.id) + AND matchid = '$mid' + ORDER BY team ASC, + gamescore DESC;"; +$q_players = mysql_query($sql_players) or die(mysql_error()); +while ($r_players = mysql_fetch_array($q_players)) { + $players[intval($r_players['playerid'])] = array( 'pid' => $r_players['pid'], + 'name' => $r_players['name'], + 'country' => $r_players['country'], + 'banned' => $r_players['banned'], + 'suicides' => intval($r_players['suicides']), + 'team' => intval($r_players['team'])); +} + + +// Table header +$extra = $teamgame ? 3 : 2; +echo ' + + + + + + + + '; + +// Victims +foreach($players as $player) { + + + echo ''; +} +echo ''; + +// Team colors victims +if ($teamgame) { + foreach($players as $player) { + switch($player['team']) { + case 0: $teamcolor = 'redteam'; break; + case 1: $teamcolor = 'blueteam'; break; + case 2: $teamcolor = 'greenteam'; break; + case 3: $teamcolor = 'goldteam'; break; + } + echo ''; + } + echo ''; +} + +// Killer rows +$first = true; +$i = 0; +foreach($players as $kid => $killer) { + if ($killer['banned'] == 'Y') continue; + $i++; + echo ''; + if ($first) echo''; + echo ''; + if ($teamgame) { + switch($killer['team']) { + case 0: $teamcolor = 'redteam'; break; + case 1: $teamcolor = 'blueteam'; break; + case 2: $teamcolor = 'greenteam'; break; + case 3: $teamcolor = 'goldteam'; break; + } + echo ''; + } + foreach($players as $vid => $victim) { + $class = ($kid == $vid) ? 'darkgrey' : 'grey'; + //if ($i % 2) $class .= '2'; + echo ''; + } + + $first = false; +} + +echo '
Kills Match Up
 Victim
+ '. + PrintVertical($player['name']) . + '
+  
K
i
l
l
e
r
'; + echo ''. + FormatPlayerName($killer['country'], $killer['pid'], $killer['name'], $gid, $gamename) .'  '; + if ($kid == $vid) { + $val = ($killer['suicides'] != 0) ? $killer['suicides'] : ' '; + } else { + $val = (isset($km[$kid][$vid])) ? $km[$kid][$vid] : ' '; + } + echo $val .'

'; +?> \ No newline at end of file diff --git a/html/pages/match_info_lms.php b/html/pages/match_info_lms.php new file mode 100755 index 0000000..1c6aa05 --- /dev/null +++ b/html/pages/match_info_lms.php @@ -0,0 +1,144 @@ + + + Player Summary + '; + + + $sql_players = "SELECT pi.name, pi.banned, p.playerid, p.pid, p.team, p.country, p.gametime, p.gamescore, p.frags, p.deaths, p.suicides, p.teamkills, p.eff, p.accuracy, p.ttl, p.rank, MAX(e.col2) + FROM uts_pinfo AS pi, uts_player AS p + LEFT JOIN uts_events AS e + ON p.playerid = e.playerid AND p.matchid = e.matchid AND e.col1 = 'out' AND p.gamescore = 0 + WHERE p.pid = pi.id AND p.matchid = $mid + GROUP BY p.playerid + ORDER BY p.gamescore DESC, (0+e.col2) DESC"; + + $q_players = mysql_query($sql_players) or die(mysql_error()); + $header = true; + + $totals['gamescore'] = 0; + if ($extra) $totals[$extra] = 0; + $totals['frags'] = 0; + $totals['kills'] = 0; + $totals['deaths'] = 0; + $totals['suicides'] = 0; + $totals['teamkills'] = 0; + $totals['eff'] = 0; + $totals['acc'] = 0; + $totals['ttl'] = 0; + $num = 0; + + while ($r_players = zero_out(mysql_fetch_array($q_players))) { + if ($header) { + $header = false; + echo ' + + Player + Time + Score + Out + F + K + D + S'; + if ($teams) echo 'TK'; + echo ' + Eff. + Acc. + Avg TTL + '; + } + + $eff = get_dp($r_players['eff']); + $acc = get_dp($r_players['accuracy']); + $ttl = GetMinutes($r_players['ttl']); + $kills = $r_players['frags'] + $r_players['suicides']; + $pname = $r_players['name']; + + $totals['gamescore'] += $r_players['gamescore']; + if ($extra) $totals[$extra] += $r_players[$extra]; + $totals['frags'] += $r_players['frags']; + $totals['kills'] += $kills; + $totals['deaths'] += $r_players['deaths']; + $totals['suicides'] += $r_players['suicides']; + $totals['teamkills'] += $r_players['teamkills']; + $totals['eff'] += $r_players['eff']; + $totals['acc'] += $r_players['accuracy']; + $totals['ttl'] += $r_players['ttl']; + $num++; + + if ($r_players['banned'] == 'Y') { + $eff = '-'; + $acc = '-'; + $ttl = '-'; + $kills = '-'; + $r_players['gamescore'] = '-'; + $r_players[$extra] = '-'; + $r_players['frags'] = '-'; + $r_players['deaths'] = '-'; + $r_players['suicides'] = '-'; + $r_players['teamkills'] = '-'; + } + + + $class = ($num % 2) ? 'grey' : 'grey2'; + echo ''; + if ($r_players['banned'] != 'Y') { + echo ''.FormatPlayerName($r_players['country'], $r_players['pid'], $r_players['name'], $gid, $gamename, true, $r_players['rank']).''; + } else { + echo ''.FormatPlayerName($r_players['country'], $r_players['pid'], $r_players['name'], $gid, $gamename, true, $r_players['rank']).''; + } + echo ''.GetMinutes($r_players[gametime]).''; + echo ''.$r_players[gamescore].''; + echo ''.(empty($r_players['MAX(e.col2)']) ? '' : GetMinutes($r_players['MAX(e.col2)'])).''; + + echo ''.$r_players[frags].''; + echo ''.$kills.''; + echo ''.$r_players[deaths].''; + echo ''.$r_players[suicides].''; + + echo ''.$eff.''; + echo ''.$acc.''; + echo ''.$ttl.''; + echo ''; + } + if ($num == 0) $num = 1; + $eff = get_dp($totals['eff'] / $num); + $acc = get_dp($totals['acc'] / $num); + $ttl = GetMinutes($totals['ttl'] / $num); + + + echo ''; + echo 'Totals'; + echo ''; + echo ''.$totals[gamescore].''; + echo ''; + echo ''.$totals[frags].''; + echo ''.$totals[kills].''; + echo ''.$totals[deaths].''; + echo ''.$totals[suicides].''; + + if ($teams) echo ''.$totals[teamkills].''; + + echo ''.$eff.''; + echo ''.$acc.''; + echo ''.$ttl.''; + echo ''; + echo '
'; diff --git a/html/pages/match_info_other.php b/html/pages/match_info_other.php new file mode 100755 index 0000000..d0a3527 --- /dev/null +++ b/html/pages/match_info_other.php @@ -0,0 +1,115 @@ + + + + + + + + + + + + + + + + + + + + + + '; +$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"; +$q_multis = mysql_query($sql_multis) or die(mysql_error()); +$i = 0; +while ($r_multis = zero_out(mysql_fetch_array($q_multis))) { + $i++; + $class = ($i % 2) ? 'grey' : 'grey2'; + $r_pname = $r_multis[name]; + $myurl = urlencode($r_pname); + + echo' + + + + + + + + + + + + + '; +} + +// No items in insta matches or lms +if ((strpos($gamename, '(insta)') === false) && (strpos($gamename, "Last Man Standing") === false)) { + echo'
Special Events
PlayerFirst BloodMultisSprees
DblMultiUltraMonsKillRamDomUnsGod
'.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].'

+ + + + + + + + + + + + + '; + + $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"; + $q_pickups = mysql_query($sql_pickups) or die(mysql_error()); + $i = 0; + while ($r_pickups = zero_out(mysql_fetch_array($q_pickups))) { + $i++; + $class = ($i % 2) ? 'grey' : 'grey2'; + $r_pname = $r_pickups[name]; + $myurl = urlencode($r_pname); + + echo' + + + + + + + + + '; + } +} +echo'
Pickups Summary
PlayerPadsArmourKegInvisibilityShield
Belt
Damage Amp
'.FormatPlayerName($r_pickups[country], $r_pickups[pid], $r_pname, $gid, $gamename).''.$r_pickups[pu_pads].''.$r_pickups[pu_armour].''.$r_pickups[pu_keg].''.$r_pickups[pu_invis].''.$r_pickups[pu_belt].''.$r_pickups[pu_amp].'
'; + +/* $sql_firstblood = small_query("SELECT pi.name, pi.country, m.firstblood FROM uts_match AS m, uts_pinfo AS pi WHERE m.firstblood = pi.id AND m.id = $mid"); +if (!$sql_firstblood) $sql_firstblood = array('country' => '', 'name' => '(unknown)', 'firstblood' => NULL); + +echo' +
+ + + + + + + + +
First Blood
'.FormatPlayerName($sql_firstblood[country], $sql_firstblood[firstblood], $sql_firstblood[name], $gid, $gamename).'
'; */ +?> diff --git a/html/pages/match_info_other2.php b/html/pages/match_info_other2.php new file mode 100755 index 0000000..1f72fdd --- /dev/null +++ b/html/pages/match_info_other2.php @@ -0,0 +1,143 @@ +'; + weaponstats($mid2, 0, 'Weapons Summary - '.$ass_att2.' Attacking'); +} + +echo' +
+ + + + + + + + + + + + + '; + +$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"; +$q_pickups = mysql_query($sql_pickups) or die(mysql_error()); +$i = 0; +while ($r_pickups = zero_out(mysql_fetch_array($q_pickups))) { + $i++; + $class = ($i % 2) ? 'grey' : 'grey2'; + + $r_pname = $r_pickups[name]; + $myurl = urlencode($r_pname); + + echo' + + + + + + + + + '; +} + +IF($mid2 == NULL) { +} else { + echo'
Pickups Summary - '.$ass_att.' Attacking
PlayerPadsArmourKegInvisibilityShield BeltDamage Amp
'.FormatPlayerName($r_pickups[country], $r_pickups[pid], $r_pname, $gid, $gamename).''.$r_pickups[pu_pads].''.$r_pickups[pu_armour].''.$r_pickups[pu_keg].''.$r_pickups[pu_invis].''.$r_pickups[pu_belt].''.$r_pickups[pu_amp].'
+
+ + + + + + + + + + + + + '; + + $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 = $mid2 GROUP BY pid 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))) { + $i++; + $class = ($i % 2) ? 'grey' : 'grey2'; + + $r_pname = $r_pickups[name]; + $myurl = urlencode($r_pname); + + echo' + + + + + + + + + '; + } +} + +$sql_firstblood = small_query("SELECT pi.name, pi.country, m.firstblood FROM uts_match AS m, uts_pinfo AS pi WHERE m.firstblood = pi.id AND m.id = $mid"); +if (!$sql_firstblood) $sql_firstblood = array('country' => '', 'name' => '(unknown)', 'firstblood' => NULL); +$sql_multis = small_query("SELECT SUM(spree_double) AS spree_double, SUM(spree_multi) AS spree_multi, SUM(spree_ultra) AS spree_ultra, SUM(spree_monster) AS spree_monster FROM uts_player WHERE matchid = $mid"); + +IF($mid2 == NULL) { +} else { +$sql_firstblood2 = small_query("SELECT pi.name, pi.country, m.firstblood FROM uts_match AS m, uts_pinfo AS pi WHERE m.firstblood = pi.id AND m.id = $mid2"); +if (!$sql_firstblood2) $sql_firstblood2 = array('country' => '', 'name' => '(unknown)', 'firstblood' => NULL); +$sql_multis2 = small_query("SELECT SUM(spree_double) AS spree_double, SUM(spree_multi) AS spree_multi, SUM(spree_ultra) AS spree_ultra, SUM(spree_monster) AS spree_monster FROM uts_player WHERE matchid = $mid2"); +} +echo'
Pickups Summary - '.$ass_att2.' Attacking
PlayerPadsArmourKegInvisibilityShield BeltDamage Amp
'.FormatPlayerName($r_pickups[country], $r_pickups[pid], $r_pname, $gid, $gamename).''.$r_pickups[pu_pads].''.$r_pickups[pu_armour].''.$r_pickups[pu_keg].''.$r_pickups[pu_invis].''.$r_pickups[pu_belt].''.$r_pickups[pu_amp].'
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Special Events - '.$ass_att.' AttackingSpecial Events - '.$ass_att2.' Attacking
First Blood'.FormatPlayerName($sql_firstblood[country], $sql_firstblood[firstblood], $sql_firstblood[name], $gid, $gamename).'First Blood'.FormatPlayerName($sql_firstblood2[country], $sql_firstblood[firstblood], $sql_firstblood2[name], $gid, $gamename).'
Double Kills'.$sql_multis[spree_double].'Double Kills'.$sql_multis2[spree_double].'
Multi Kills'.$sql_multis[spree_multi].'Multi Kills'.$sql_multis2[spree_multi].'
Ultra Kills'.$sql_multis[spree_ultra].'Ultra Kills'.$sql_multis2[spree_ultra].'
Monster Kills'.$sql_multis[spree_monster].'Monster Kills'.$sql_multis2[spree_monster].'
'; +?> diff --git a/html/pages/match_info_server.php b/html/pages/match_info_server.php new file mode 100755 index 0000000..fb92456 --- /dev/null +++ b/html/pages/match_info_server.php @@ -0,0 +1,114 @@ + + + Totals for This Match + + + Team Score + Player Score + Frags + Kills + Deaths + Suicides + '; + +// Get Summary Info +$teamscore = small_query("SELECT SUM(t0score + t1score + t2score + t3score) AS result FROM uts_match WHERE id = $mid"); +$playerscore = small_query("SELECT SUM(gamescore) AS result FROM uts_player WHERE matchid = $mid"); +$fragcount = small_query("SELECT SUM(frags) AS result FROM uts_match WHERE id = $mid"); +$killcount = small_query("SELECT SUM(kills) AS result FROM uts_match WHERE id = $mid"); +$deathcount = small_query("SELECT SUM(deaths) AS result FROM uts_match WHERE id = $mid"); +$suicidecount = small_query("SELECT SUM(suicides) AS result FROM uts_match WHERE id = $mid"); + +echo' + + '.$teamscore[result].' + '.$playerscore[result].' + '.$fragcount[result].' + '.$killcount[result].' + '.$deathcount[result].' + '.$suicidecount[result].' + '; + +// Teamgame? Then show score +if ($teamgame) { + echo ' + + '; + echo ' + Score:'; + if ($r_info[t0]) { + echo ' + '.$r_info[t0score]; + } + if ($r_info[t1]) { + echo ' + - '.$r_info[t1score]; + } + if ($r_info[t2]) { + echo ' + - '.$r_info[t2score]; + } + if ($r_info[t3]) { + echo ' + - '.$r_info[t3score]; + } + echo ' + + '; +} + +echo ' + +
+ + + + '; + +$matchinfo = small_query("SELECT m.time, m.servername, g.name AS gamename, m.gamename AS real_gamename, m.gid, m.mapname, m.mapfile, m.serverinfo, m.gameinfo, m.mutators, m.serverip FROM uts_match AS m, uts_games AS g WHERE m.gid = g.id AND m.id = $mid"); +$matchdate = mdate($matchinfo[time]); +$gamename = $matchinfo[gamename]; +$real_gamename = $matchinfo[real_gamename]; +$gid = $matchinfo[gid]; + +$mapname = un_ut($matchinfo[mapfile]); +$mappic = strtolower("images/maps/".$mapname.".jpg"); + +if (file_exists($mappic)) { +} else { + $mappic = ("images/maps/blank.jpg"); +} + + $myurl = urlencode($mapname); + + echo' + + + + + + + + + + + + + + + + + + + + + + + + + +
Unreal Tournament Match Stats
Match Date'.$matchdate.'Server'.$matchinfo[servername].'
Match Type'.$gamename.'Map Name'.$matchinfo[mapname].'
Server Info'.$matchinfo[serverinfo].''.$mapname.'
Game Info'.$matchinfo[gameinfo].'
Mutators'.$matchinfo[mutators].'
+
'; +?> diff --git a/html/pages/match_player.php b/html/pages/match_player.php new file mode 100755 index 0000000..4cc73a0 --- /dev/null +++ b/html/pages/match_player.php @@ -0,0 +1,151 @@ +"; + } 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']; +$gamename = $r_infos['gamename']; +$gid = $r_infos['gid']; + +echo' + + + + +
Individual Match Stats for '.FlagImage($country) .' '. htmlentities($playername) .' + '. RankImageOrText($pid, $playername, NULL, $gid, $gamename, true, '(%IT% in %GN% with %RP% ranking points)') .' +
+
'; + +// Get Summary Info +include("pages/match_info_server.php"); + +echo ' +
+ + + + + + + + + + + + + + '; + +$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")); + + echo' + + + + + + + + + + '; + +echo' +
Game Summary
FragsKillsDeathsSuicidesEfficiencyAccuracyAvg TTLTime
'.$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 = 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")); + +$sql_firstblood = small_query("SELECT firstblood FROM uts_match WHERE id = $mid"); + +IF ($sql_firstblood[firstblood] == $pid) { + $firstblood = "Yes"; +} else { + $firstblood = "No"; +} + + + echo' + + + + + + + + + + + + +
Special Events
First BloodMultisSprees
DblMultiUltraMonsKillRamDomUnsGod
'.$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].'
+
'; + +include('includes/weaponstats.php'); +weaponstats($mid, $pid); + +$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']).'
'; +} + +?> diff --git a/html/pages/match_report.php b/html/pages/match_report.php new file mode 100755 index 0000000..0f452ba --- /dev/null +++ b/html/pages/match_report.php @@ -0,0 +1,17 @@ + + + + + + + + + + + + +
Match Reports
Clanbase Cup Format
Forum BBCode Format
'; +?> \ No newline at end of file diff --git a/html/pages/players.php b/html/pages/players.php new file mode 100755 index 0000000..1d9788a --- /dev/null +++ b/html/pages/players.php @@ -0,0 +1,124 @@ +'); +} + + +// Get filter and set sorting +$filter = my_addslashes($_GET[filter]); +$sort = my_addslashes($_GET[sort]); + +IF (empty($filter) or (!in_array(strtolower($filter), array("name", "games", "gamescore", "frags", "kills", "deaths", "suicides", "eff", "accuracy", "ttl", "gametime")))) { + $filter = "name"; +} + +if (empty($sort) or ($sort != 'ASC' and $sort != 'DESC')) $sort = ($filter == "name") ? "ASC" : "DESC"; + + +// Work out Prev, Next, First, Last Stuff + +$r_pcount = small_query("SELECT COUNT(*) AS pcount FROM uts_pinfo"); +$pcount = $r_pcount['pcount']; + +$ecount = $pcount/50; +$ecount2 = number_format($ecount, 0, '.', ''); + +IF($ecount > $ecount2) { + $ecount2 = $ecount2+1; +} + +$fpage = 0; +IF($ecount < 1) { $lpage = 0; } +else { $lpage = $ecount2-1; } + +$cpage = preg_replace('/\D/', '', $_GET["page"]); +IF ($cpage == "") { $cpage = "0"; } +$qpage = $cpage*50; + +$tfpage = $cpage+1; +$tlpage = $lpage+1; + +$ppage = $cpage-1; +$ppageurl = "[Previous]"; +IF ($ppage < "0") { $ppageurl = "[Previous]"; } + +$npage = $cpage+1; +$npageurl = "[Next]"; +IF ($npage >= "$ecount") { $npageurl = "[Next]"; } + +$fpageurl = "[First]"; +IF ($cpage == "0") { $fpageurl = "[First]"; } + +$lpageurl = "[Last]"; +IF ($cpage == "$lpage") { $lpageurl = "[Last]"; } + +// Show information +echo' +
+
Page ['.$tfpage.'/'.$tlpage.'] Selection: '.$fpageurl.' / '.$ppageurl.' / '.$npageurl.' / '.$lpageurl.'
+
* Click headings to change Sorting *
+ + + + + + + + + + + + + + + + + + + + '; + +$sql_plist = "SELECT pi.name AS name, pi.country AS country, p.pid, COUNT(p.id) AS games, SUM(p.gamescore) as gamescore, SUM(p.frags) AS frags, SUM(p.kills) AS kills, +SUM(p.deaths) AS deaths, SUM(p.suicides) as suicides, AVG(p.eff) AS eff, AVG(p.accuracy) AS accuracy, AVG(p.ttl) AS ttl, SUM(gametime) as gametime +FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND pi.banned <> 'Y' GROUP BY p.pid ORDER BY $filter $sort LIMIT $qpage,50"; +$q_plist = mysql_query($sql_plist) or die(mysql_error()); +while ($r_plist = mysql_fetch_array($q_plist)) { + + $gametime = sec2hour($r_plist[gametime]); + $eff = get_dp($r_plist[eff]); + $acc = get_dp($r_plist[accuracy]); + $ttl = GetMinutes($r_plist[ttl]); + $r_pname = $r_plist[name]; + $myurl = urlencode($r_pname); + + echo' + + + + + + + + + + + + + '; +} +echo' +
Unreal Tournament Player List
Name Search: + +
Player Name'.SortPic('name', $filter, $sort).'Matches'.SortPic('games', $filter, $sort).'Score'.SortPic('gamescore', $filter, $sort).'Frags'.SortPic('frags', $filter, $sort).'Kills'.SortPic('kills', $filter, $sort).'Deaths'.SortPic('deaths', $filter, $sort).'Suicides'.SortPic('suicides', $filter, $sort).'Eff.'.SortPic('eff', $filter, $sort).'Acc.'.SortPic('accuracy', $filter, $sort).'TTL'.SortPic('ttl', $filter, $sort).'Hours'.SortPic('gametime', $filter, $sort).'
'.FormatPlayerName($r_plist[country], $r_plist['pid'], $r_pname).''.$r_plist[games].''.$r_plist[gamescore].''.$r_plist[frags].''.$r_plist[kills].''.$r_plist[deaths].''.$r_plist[suicides].''.$eff.''.$acc.''.$ttl.''.$gametime.'
+
Page ['.$tfpage.'/'.$tlpage.'] Selection: '.$fpageurl.' / '.$ppageurl.' / '.$npageurl.' / '.$lpageurl.'
+
'; +?> diff --git a/html/pages/players_explain_ranking.php b/html/pages/players_explain_ranking.php new file mode 100755 index 0000000..5930cfb --- /dev/null +++ b/html/pages/players_explain_ranking.php @@ -0,0 +1,190 @@ +'; + $i = 0; + return(0); + } + $i++; + $class = ($i%2) ? 'grey' : 'grey2'; + if ($extra_multiplier) $multiplier *= 600; + $points = $amount * $multiplier; + + $d_points = get_dp($points); + if ($points % 1 == 0) $d_points = ceil($points); + echo ''; + echo ''. htmlentities($name) .''; + echo ''. $amount .''; + echo ''. $multiplier .''; + echo ''. $d_points .''; + echo ''; + return($points); +} + +$pid = isset($pid) ? $pid : $_GET['pid']; +$gid = isset($gid) ? $gid : $_GET['gid']; + +$pid = preg_replace('/\D/', '', $pid); +$gid = preg_replace('/\D/', '', $gid); + +$r_info = small_query("SELECT name, country, banned FROM uts_pinfo WHERE id = '$pid'"); +if (!$r_info) { + echo "Player not found"; + include("includes/footer.php"); + exit; +} + +if ($r_info['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; + } +} + +$playername = $r_info['name']; + +$r_game = small_query("SELECT name, gamename FROM uts_games WHERE id = '$gid'"); +if (!$r_game) { + echo "Game ($gid) not found."; + include("includes/footer.php"); + exit; +} +$real_gamename = $r_game['gamename']; + + +$r_cnt = small_query("SELECT + SUM(frags) AS frags, SUM(deaths) AS deaths, SUM(suicides) AS suicides, SUM(teamkills) AS teamkills, + SUM(flag_taken) AS flag_taken, SUM(flag_pickedup) AS flag_pickedup, SUM(flag_return) AS flag_return, SUM(flag_capture) AS flag_capture, SUM(flag_cover) AS flag_cover, + SUM(flag_seal) AS flag_seal, SUM(flag_assist) AS flag_assist, SUM(flag_kill) AS flag_kill, + SUM(dom_cp) AS dom_cp, SUM(ass_obj) AS ass_obj, + 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, + SUM(gametime) AS gametime + FROM uts_player WHERE pid = $pid and gid = $gid"); + + + + +echo' + + + + +
'.FlagImage($r_info['country'], false).' '.htmlentities($playername).'\'s '. htmlentities($r_game['name']) .' ranking explained
'; +echo '

'; + + + + + +echo ' + + + + + + + '; + +if ($real_gamename == "Bunny Track") { + $sql_btmaprank = "SELECT e.col2 AS no, COUNT(e.col2) AS count FROM uts_events AS e, uts_player AS p WHERE p.pid = $pid AND p.gid = $gid AND p.playerid = e.playerid AND e.matchid = p.matchid AND e.col2 > 0 AND e.col2 <= 5 GROUP BY e.col2"; + $q_btmaprank = mysql_query($sql_btmaprank) or die ("Can't retrieve \$q_btmaprank: ". mysql_error()); + $mapranks = array(); + while($r_btmaprank = mysql_fetch_assoc($q_btmaprank)) { + $mapranks[$r_btmaprank[no]] = $r_btmaprank[count]; + } + + $t_points += row('First place', (!empty($mapranks[1]) ? $mapranks[1] : 0), 10); + $t_points += row('Second place', (!empty($mapranks[2]) ? $mapranks[2] : 0), 8); + $t_points += row('Third place', (!empty($mapranks[3]) ? $mapranks[3] : 0), 6); + $t_points += row('Fourth place', (!empty($mapranks[4]) ? $mapranks[4] : 0), 4); + $t_points += row('Fifth place', (!empty($mapranks[5]) ? $mapranks[5] : 0), 2); +} +else { + $t_points = 0; + $t_points += row('Frags', $r_cnt['frags'], 0.5); + $t_points += row('Deaths', $r_cnt['deaths'], -0.25); + $t_points += row('Suicides', $r_cnt['suicides'], -0.25 ); + $t_points += row('Teamkills', $r_cnt['teamkills'], -2); + row(); + $t_points += row('Flag Takes', $r_cnt['flag_taken'], 1); + $t_points += row('Flag Pickups', $r_cnt['flag_pickedup'], 1); + $t_points += row('Flag Returns', $r_cnt['flag_return'], 1); + $t_points += row('Flag Captures', $r_cnt['flag_capture'], 10); + $t_points += row('Flag Covers', $r_cnt['flag_cover'], 3); + $t_points += row('Flag Seals', $r_cnt['flag_seal'], 2); + $t_points += row('Flag Assists', $r_cnt['flag_assist'], 5); + $t_points += row('Flag Kills', $r_cnt['flag_kill'], 2); + row(); + $t_points += row('Controlpoint Captures', $r_cnt['dom_cp'], 10); + if (strpos($real_gamename, 'Assault') !== false) { + $t_points += row('Assault Objectives', $r_cnt['ass_obj'], 10); + } else { + $t_points += row('Assault Objectives', 0, 10); + } + if (strpos($real_gamename, 'JailBreak') !== false) { + $t_points += row('Team Releases', $r_cnt['ass_obj'], 1.5); + } else { + $t_points += row('Team Releases', 0, 1.5); + } + row(); + $t_points += row('Double Kills', $r_cnt['spree_double'], 1); + $t_points += row('Multi Kills', $r_cnt['spree_multi'], 1); + $t_points += row('Ultra Kills', $r_cnt['spree_ultra'], 1); + $t_points += row('Monster Kills', $r_cnt['spree_monster'], 2); + row(); + $t_points += row('Killing Sprees', $r_cnt['spree_kill'], 1); + $t_points += row('Rampages', $r_cnt['spree_rampage'], 1); + $t_points += row('Dominatings', $r_cnt['spree_dom'], 1.5); + $t_points += row('Unstoppables', $r_cnt['spree_uns'], 2); + $t_points += row('Godlikes', $r_cnt['spree_god'], 3); +} + +row(); +row(); +echo ' + + + + '; + +$gametime = ceil($r_cnt['gametime'] / 60); +$t_points = $t_points / $gametime; +echo ' + + + + '; + +IF ($gametime < 10) { + $t_points += row('Penalty for playing < 10 minutes', get_dp($t_points), 0, false); +} + +IF ($gametime >= 10 && $gametime < 50) { + $t_points += row('Penalty for playing < 50 minutes', get_dp($t_points), -0.75, false); +} + +IF ($gametime >= 50 && $gametime < 100) { + $t_points += row('Penalty for playing < 100 minutes', get_dp($t_points), -0.5, false); +} + +IF ($gametime >= 100 && $gametime < 200) { + $t_points += row('Penalty for playing < 200 minutes', get_dp($t_points), -0.3, false); +} + +IF ($gametime >= 200 && $gametime < 300) { + $t_points += row('Penalty for playing < 300 minutes', get_dp($t_points), -0.15, false); +} +row(); +echo ' + + + + '; +echo '
AmountMultiplierPoints +
Total'. ceil($t_points) .'
Divided by game minutes'.$gametime.''. get_dp($t_points) .'
Total'. get_dp($t_points) .'
'; +?> diff --git a/html/pages/players_info.php b/html/pages/players_info.php new file mode 100755 index 0000000..11064dc --- /dev/null +++ b/html/pages/players_info.php @@ -0,0 +1,442 @@ +"; + } else { + echo "Sorry, this player has been banned!"; + include("includes/footer.php"); + exit; + } +} + +$playername = $r_info['name']; + +if (isset($_GET['togglewatch'])) { + $status = ToggleWatchStatus($pid); + include('includes/header.php'); + if ($status == 1) { + echo htmlentities($playername) ." has been added to your watchlist"; + } else { + echo htmlentities($playername) ." has been removed from your watchlist"; + } + echo "
"; + $target = $PHP_SELF .'?p=pinfo&pid='. $pid; + echo 'You will be taken back to the '. htmlentities($playername) .'\'s page in a moment.'; + echo ''; + return; +} + + +if (isset($_GET['pics'])) { + $gid = $_GET['gid']; + $gid = preg_replace("/\D/", "", $gid); + if (!$pic_enable) { + echo "Sorry, pictures are disabled by the administrator"; + return; + } + $oururl = $_SERVER["HTTP_HOST"].$_SERVER["PHP_SELF"]; + $oururl = str_replace("index.php", "", $oururl); + + echo '
'; + require('includes/config_pic.php'); + $disp = false; + foreach($pic as $num => $options) { + if (!$options['enabled']) continue; + if ($options['gidrequired'] and empty($gid)) continue; + $disp = true; + $pinfourl = "http://${oururl}?p=pinfo&pid=$pid"; + $lgid = ($options['gidrequired']) ? $gid : 0; + $imgurl = "http://${oururl}pic.php/$num/$pid/$lgid/.".$options['output']['type']; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo '
BB Code:
HTML Code:


'; + } + if (!$disp) echo "Sorry, no pictures in this category"; + echo '
'; + return; +} + + + + + +echo' + + + + + + + + + + + + + + + + + + '; + +$sql_plist = "SELECT g.name AS gamename, SUM(p.gamescore) AS gamescore, SUM(p.frags) AS frags, SUM(p.kills) AS kills, SUM(p.deaths) AS deaths, +SUM(p.suicides) AS suicides, SUM(p.teamkills) AS teamkills, SUM(kills+deaths+suicides+teamkills) AS sumeff, AVG(p.accuracy) AS accuracy, AVG(p.ttl) AS ttl, +COUNT(p.id) AS games, SUM(p.gametime) as gametime +FROM uts_player AS p, uts_games AS g WHERE p.gid = g.id AND p.pid = '$pid' GROUP BY p.gid"; + +$q_plist = mysql_query($sql_plist) or die(mysql_error()); +while ($r_plist = mysql_fetch_array($q_plist)) { + + $gametime = sec2hour($r_plist[gametime]); + $eff = get_dp($r_plist[kills]/$r_plist[sumeff]*100); + $acc = get_dp($r_plist[accuracy]); + $ttl = GetMinutes($r_plist[ttl]); + + echo' + + + + + + + + + + + + + '; +} + +$r_sumplist = small_query("SELECT SUM(gamescore) AS gamescore, SUM(frags) AS frags, SUM(kills) AS kills, SUM(deaths) AS deaths, +SUM(suicides) AS suicides, SUM(teamkills) AS teamkills, SUM(kills+deaths+suicides+teamkills) AS sumeff, +AVG(accuracy) AS accuracy, AVG(ttl) AS ttl, COUNT(id) AS games, SUM(gametime) as gametime +FROM uts_player WHERE pid = '$pid'"); + +$gametime = sec2hour($r_sumplist[gametime]); +$eff = get_dp($r_sumplist[kills]/$r_sumplist[sumeff]*100); +$acc = get_dp($r_sumplist[accuracy]); +$ttl = GetMinutes($r_sumplist[ttl]); + + echo' + + + + + + + + + + + + + + +
Career Summary for '.FlagImage($r_info['country'], false).' '.htmlentities($playername).' '; + +if (PlayerOnWatchlist($pid)) { + echo ''; +} else { + echo ''; +} + +echo ' +
Match TypeScoreFKDSTKEff.Acc.Avg TTLMatchesHours
'.$r_plist[gamename].''.$r_plist[gamescore].''.$r_plist[frags].''.$r_plist[kills].''.$r_plist[deaths].''.$r_plist[suicides].''.$r_plist[teamkills].''.$eff.''.$acc.''.$ttl.''.$r_plist[games].''.$gametime.'
Totals'.$r_sumplist[gamescore].''.$r_sumplist[frags].''.$r_sumplist[kills].''.$r_sumplist[deaths].''.$r_sumplist[suicides].''.$r_sumplist[teamkills].''.$eff.''.$acc.''.$ttl.''.$r_sumplist[games].''.$gametime.'
+
'; + +$q_assgids = mysql_query("SELECT id FROM uts_games WHERE gamename LIKE '%Assault%';") or die(mysql_error()); +$assgids = array(); +while ($r_assgids = mysql_fetch_array($q_assgids)) { + $assgids[] = $r_assgids['id']; +} +$assquery = (count($assgids) > 0) ? 'SUM(IF (gid IN ('. implode(',', $assgids) .'), ass_obj, 0)) AS ass_obj' : '0 AS ass_obj'; + $sql_cdatot = zero_out(small_query("SELECT SUM(dom_cp) AS dom_cp, $assquery, SUM(flag_taken) AS flag_taken, +SUM(flag_pickedup) AS flag_pickedup, SUM(flag_dropped) AS flag_dropped, SUM(flag_assist) AS flag_assist, SUM(flag_cover) AS flag_cover, +SUM(flag_seal) AS flag_seal, SUM(flag_capture) AS flag_capture, SUM(flag_kill)as flag_kill, +SUM(flag_return) AS flag_return FROM uts_player WHERE pid = '$pid'")); + +if ($sql_cdatot[ass_obj] || $sql_cdatot[dom_cp] || $sql_cdatot[flag_taken] || $sql_cdatot[flag_pickedup] || $sql_cdatot[flag_dropped] || $sql_cdatot[flag_assist] || $sql_cdatot[flag_cover] || $sql_cdatot[flag_seal] || $sql_cdatot[flag_capture] || $sql_cdatot[flag_kill] || $sql_cdatot[flag_return]) { + echo ' + + + + + + + + + + + + + + + + + + + + '; + + echo' + + + + + + + + + + + + + +
Assault, Domination and CTF Events Summary
Assault ObjectivesControl Point CapturesCapture The Flag
Flag TakesFlag PickupsFlag DropsFlag AssistsFlag CoversFlag SealsFlag CapturesFlag KillsFlag Returns
'.$sql_cdatot[ass_obj].''.$sql_cdatot[dom_cp].''.$sql_cdatot[flag_taken].''.$sql_cdatot[flag_pickedup].''.$sql_cdatot[flag_dropped].''.$sql_cdatot[flag_assist].''.$sql_cdatot[flag_cover].''.$sql_cdatot[flag_seal].''.$sql_cdatot[flag_capture].''.$sql_cdatot[flag_kill].''.$sql_cdatot[flag_return].'
+
'; +} + +$sql_firstblood = zero_out(small_query("SELECT COUNT(id) AS fbcount FROM uts_match WHERE firstblood = '$pid'")); +$sql_multis = zero_out(small_query("SELECT 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 WHERE pid = '$pid'")); + +if ($sql_firstblood[fbcount] || $sql_multis[spree_double] || $sql_multis[spree_multi] || $sql_multis[spree_ultra] || $sql_multis[spree_monster] || $sql_multis[spree_kill] || $sql_multis[spree_rampage] || $sql_multis[spree_dom] || $sql_multis[spree_uns] || $sql_multis[spree_god] ) { + echo ' + + + + + + + + + + + + + + + + + + + + '; + + echo' + + + + + + + + + + + + +
Special Events
First BloodMultisSprees
DblMultiUltraMonsKillRamDomUnsGod
'.$sql_firstblood[fbcount].''.$sql_multis[spree_double].''.$sql_multis[spree_multi].''.$sql_multis[spree_ultra].''.$sql_multis[spree_monster].''.$sql_multis[spree_kill].''.$sql_multis[spree_rampage].''.$sql_multis[spree_dom].''.$sql_multis[spree_uns].''.$sql_multis[spree_god].'
+
'; +} + +$r_pickups = zero_out(small_query("SELECT SUM(pu_pads) AS pu_pads, SUM(pu_armour) AS pu_armour, SUM(pu_keg) AS pu_keg, +SUM(pu_invis) AS pu_invis, SUM(pu_belt) AS pu_belt, SUM(pu_amp) AS pu_amp +FROM uts_player WHERE pid = '$pid'")); + +if ($r_pickups[pu_pads] || $r_pickups[pu_armour] || $r_pickups[pu_keg] || $r_pickups[pu_invis] || $r_pickups[pu_belt] || $r_pickups[pu_amp] ) { + echo ' + + + + + + + + + + + + + + + + + + + + +
Pickups Summary
PadsArmourKegInvisibilityShield BeltDamage Amp
'.$r_pickups[pu_pads].''.$r_pickups[pu_armour].''.$r_pickups[pu_keg].''.$r_pickups[pu_invis].''.$r_pickups[pu_belt].''.$r_pickups[pu_amp].'
+
'; +} + +include('includes/weaponstats.php'); +weaponstats(0, $pid); + +echo '
'; + +// bt records +$sql_btrecords = " +SELECT + m.mapfile AS map, + e.col3 AS time, + e.col4 AS date +FROM + uts_match AS m, + uts_events AS e, + uts_player AS p +WHERE + p.pid = $pid AND + p.playerid = e.playerid AND + e.matchid = p.matchid AND + m.id = p.matchid AND + e.col1 = 'btcap' +GROUP BY + m.mapfile +ORDER BY + m.mapfile, + 0 + e.col3 ASC"; + +$q_btrecords = mysql_query($sql_btrecords) or die (mysql_error()); +if (mysql_num_rows($q_btrecords) > 0) { + echo ' + + + + + + + + + + '; + while ($r_btrecords = mysql_fetch_array($q_btrecords)) { + $map = un_ut($r_btrecords['map']); + $myurl = urlencode($map); + $maprank = 1 + small_count("SELECT DISTINCT p.pid AS rank FROM uts_player as p, uts_events AS e, uts_match as m WHERE (m.mapfile = '" . addslashes($map) . "' OR m.mapfile = '" . addslashes($map) . ".unr') AND m.id = e.matchid AND e.matchid = p.matchid AND e.playerid = p.playerid AND e.col3 < ".$r_btrecords['time'] . " AND e.col1 = 'btcap'"); + echo ' + + + + '; + } + echo ' +
Bunny Track Personal Records
MapTimeDate
 '.htmlentities($map).'', $maprank, '', btcaptime($r_btrecords['time']), '', gmdate('d-m-Y h:i a', $r_btrecords['date']), '
+
'; +} + +// Do graph stuff +$bgwhere = "pid = '$pid'"; +include("pages/graph_pbreakdown.php"); + + +// Player's ranks +echo' + + + + + + + + + '; + if ($pic_enable and basename($_SERVER['PATH_TRANSLATED']) != 'admin.php') echo ''; +echo ''; + +$sql_rank = "SELECT g.name AS gamename, r.rank, r.prevrank, r.matches, r.gid, r.pid FROM uts_rank AS r, uts_games AS g WHERE r.gid = g.id AND r.pid = '$pid';"; +$q_rank = mysql_query($sql_rank) or die(mysql_error()); +while ($r_rank = mysql_fetch_array($q_rank)) { + $r_no = small_query("SELECT (COUNT(*) + 1) AS no FROM uts_rank WHERE gid= '${r_rank['gid']}' and rank > ". get_dp($r_rank['rank']) ."9"); + echo' + + + + '; + echo ''; + if ($pic_enable and basename($_SERVER['PATH_TRANSLATED']) != 'admin.php') echo ''; + echo ''; +} + +echo '
Ranking
Match TypeRankMatchesExplainPics
'.RankImageOrText($r_rank['pid'], $name, $r_no['no'], $r_rank['gid'], $r_rank['gamename'], false, '%IT%').''.$r_rank['gamename'].''.get_dp($r_rank['rank']) .' '. RankMovement($r_rank['rank'] - $r_rank['prevrank']) . ''.$r_rank['matches'].'(Click)(Click)
'; + + +$r_pings = small_query("SELECT MIN(lowping * 1) AS lowping, AVG(avgping * 1) AS avgping, MAX(highping * 1) AS highping FROM uts_player WHERE pid = $pid 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'
+ + + + + + + + '; + if (isset($is_admin) and $is_admin) echo ''; + echo''; + +$sql_recent = "SELECT m.id, m.time, g.name AS gamename, m.mapfile, INET_NTOA(p.ip) AS ip FROM uts_match m, uts_player p, uts_games g +WHERE p.pid = '$pid' AND m.id = p.matchid AND m.gid = g.id ORDER BY time DESC LIMIT 0,50"; +$q_recent = mysql_query($sql_recent) or die(mysql_error()); +while ($r_recent = mysql_fetch_array($q_recent)) { + + $r_time = mdate($r_recent[time]); + $r_mapfile = un_ut($r_recent[mapfile]); + + echo' + + + + + '; + if (isset($is_admin) and $is_admin) echo ''; + + echo ''; +} + +echo' +
Last 50 Games
Match IDDate/TimeMatch TypeMapIP Used
'.$r_recent[id].''.$r_time.''.$r_recent[gamename].''.$r_mapfile.''. $r_recent[ip].'
+'; +?> diff --git a/html/pages/players_search.php b/html/pages/players_search.php new file mode 100755 index 0000000..1791393 --- /dev/null +++ b/html/pages/players_search.php @@ -0,0 +1,83 @@ +'); +} + +// Get filter and set sorting +$playername = my_stripslashes($_REQUEST[name]); +$playersearch = my_addslashes($_REQUEST[name]); +$filter = my_addslashes($_GET[filter]); +$sort = my_addslashes($_GET[sort]); + +IF (empty($filter) or (!in_array(strtolower($filter), array("name", "games", "gamescore", "frags", "kills", "deaths", "suicides", "eff", "accuracy", "ttl", "gametime")))) { + $filter = "name"; +} + +if (empty($sort) or ($sort != 'ASC' and $sort != 'DESC')) $sort = ($filter == "name") ? "ASC" : "DESC"; + +echo' +
+
* Click headings to change Sorting *
+ + + + + + + + + + + + + + + + + + + + '; + +$sql_plist = "SELECT pi.name AS name, pi.country AS country, p.pid, COUNT(p.id) AS games, SUM(p.gamescore) as gamescore, SUM(p.frags) AS frags, SUM(p.kills) AS kills, +SUM(p.deaths) AS deaths, SUM(p.suicides) as suicides, AVG(p.eff) AS eff, AVG(p.accuracy) AS accuracy, AVG(p.ttl) AS ttl, SUM(gametime) as gametime +FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND pi.name LIKE '%".$playersearch."%' AND pi.banned <> 'Y' GROUP BY name ORDER BY $filter $sort"; + +$q_plist = mysql_query($sql_plist) or die(mysql_error()); +while ($r_plist = mysql_fetch_array($q_plist)) { + + $gametime = sec2hour($r_plist[gametime]); + $eff = get_dp($r_plist[eff]); + $acc = get_dp($r_plist[accuracy]); + $ttl = GetMinutes($r_plist[ttl]); + + echo' + + + + + + + + + + + + + '; +} +echo' +
Player Search List
Name Search: + +
Player Name'.SortPic('name', $filter, $sort).'Matches'.SortPic('games', $filter, $sort).'Score'.SortPic('gamescore', $filter, $sort).'Frags'.SortPic('frags', $filter, $sort).'Kills'.SortPic('kills', $filter, $sort).'Deaths'.SortPic('deaths', $filter, $sort).'Suicides'.SortPic('suicides', $filter, $sort).'Eff.'.SortPic('eff', $filter, $sort).'Acc.'.SortPic('accuracy', $filter, $sort).'TTL'.SortPic('ttl', $filter, $sort).'Hours'.SortPic('gametime', $filter, $sort).'
'.FormatPlayerName($r_plist[country], $r_plist['pid'], $r_plist[name]).''.$r_plist[games].''.$r_plist[gamescore].''.$r_plist[frags].''.$r_plist[kills].''.$r_plist[deaths].''.$r_plist[suicides].''.$eff.''.$acc.''.$ttl.''.$gametime.'
'; +?> \ No newline at end of file diff --git a/html/pages/rank.php b/html/pages/rank.php new file mode 100755 index 0000000..6eacca0 --- /dev/null +++ b/html/pages/rank.php @@ -0,0 +1,56 @@ + + + + Top 10 '.$r_rgame['name'].' Players + + + N° + Player Name + Rank + Matches + + '; + + $ranking = 0; + + $sql_rplayer = "SELECT pi.id AS pid, pi.name, pi.country, r.rank, r.prevrank, r.matches FROM uts_rank AS r, uts_pinfo AS pi WHERE r.pid = pi.id AND r.gid = '$r_rgame[gid]' AND pi.banned <> 'Y' ORDER BY r.rank DESC LIMIT 0,10"; + $q_rplayer = mysql_query($sql_rplayer) or die(mysql_error()); + if (mysql_num_rows($q_rplayer) == 0) { + echo ' + + No players entered the rankings yet. + + +   + +
'; + + } + else { + while ($r_rplayer = mysql_fetch_array($q_rplayer)) { + + $ranking++; + $myurl = urlencode($r_rplayer[name]); + + echo' + + '.$ranking.' + '.FlagImage($r_rplayer[country]).' '.htmlspecialchars($r_rplayer[name], ENT_QUOTES) .' '. RankMovement($r_rplayer['rank'] - $r_rplayer['prevrank']).' + '.get_dp($r_rplayer[rank]).' + '.$r_rplayer[matches].' + '; + } + echo' + + Click Here To See All The Rankings + +
'; + } +} +?> \ No newline at end of file diff --git a/html/pages/rank_extended.php b/html/pages/rank_extended.php new file mode 100755 index 0000000..b41baf2 --- /dev/null +++ b/html/pages/rank_extended.php @@ -0,0 +1,75 @@ + $ecount2) { + $ecount2 = $ecount2+1; +} + +$fpage = 0; +IF($ecount < 1) { $lpage = 0; } +else { $lpage = $ecount2-1; } + +$cpage = $_GET["page"]; +IF ($cpage == "") { $cpage = "0"; } +$qpage = $cpage*25; + +$tfpage = $cpage+1; +$tlpage = $lpage+1; + +$ppage = $cpage-1; +$ppageurl = "[Previous]"; +IF ($ppage < "0") { $ppageurl = "[Previous]"; } + +$npage = $cpage+1; +$npageurl = "[Next]"; +IF ($npage >= "$ecount") { $npageurl = "[Next]"; } + +$fpageurl = "[First]"; +IF ($cpage == "0") { $fpageurl = "[First]"; } + +$lpageurl = "[Last]"; +IF ($cpage == "$lpage") { $lpageurl = "[Last]"; } + +echo' +
Page ['.$tfpage.'/'.$tlpage.'] Selection: '.$fpageurl.' / '.$ppageurl.' / '.$npageurl.' / '.$lpageurl.'
+ + + + + + + + + + + '; + + $ranking = $qpage; + + $sql_rplayer = "SELECT pi.name, pi.country, r.rank, r.prevrank, r.matches, r.pid FROM uts_rank AS r, uts_pinfo AS pi WHERE r.pid = pi.id AND r.gid = '$gid' AND pi.banned <> 'Y' ORDER BY rank DESC LIMIT $qpage,25"; + $q_rplayer = mysql_query($sql_rplayer) or die(mysql_error()); + while ($r_rplayer = mysql_fetch_array($q_rplayer)) { + + $ranking++; + echo' + + + + + + '; + +} +echo' +
'.$gamename.' Ranking Players
Player NameRankMatches
'.$ranking.''.FlagImage($r_rplayer[country]).' '.htmlspecialchars($r_rplayer[name]) .' '. RankMovement($r_rplayer['rank'] - $r_rplayer['prevrank']) .''.get_dp($r_rplayer[rank]).''.$r_rplayer[matches].'
+
Page ['.$tfpage.'/'.$tlpage.'] Selection: '.$fpageurl.' / '.$ppageurl.' / '.$npageurl.' / '.$lpageurl.'
'; +?> \ No newline at end of file diff --git a/html/pages/recent.php b/html/pages/recent.php new file mode 100755 index 0000000..92fafb7 --- /dev/null +++ b/html/pages/recent.php @@ -0,0 +1,137 @@ + $ecount2) { + $ecount2 = $ecount2+1; +} + +$fpage = 0; +IF($ecount < 1) { $lpage = 0; } +else { $lpage = $ecount2-1; } + +$cpage = preg_replace('/\D/', '', $_REQUEST["page"]); +IF ($cpage == "") { $cpage = "0"; } +$qpage = $cpage*25; + +$tfpage = $cpage+1; +$tlpage = $lpage+1; + +$ppage = $cpage-1; +$ppageurl = "[Previous]"; +IF ($ppage < "0") { $ppageurl = "[Previous]"; } + +$npage = $cpage+1; +$npageurl = "[Next]"; +IF ($npage >= "$ecount") { $npageurl = "[Next]"; } + +$fpageurl = "[First]"; +IF ($cpage == "0") { $fpageurl = "[First]"; } + +$lpageurl = "[Last]"; +IF ($cpage == "$lpage") { $lpageurl = "[Last]"; } + +echo ' +
+
Page ['.$tfpage.'/'.$tlpage.'] Selection: '.$fpageurl.' / '.$ppageurl.' / '.$npageurl.' / '.$lpageurl.'
+ + + + '; + +echo ' + + '; + +echo ' + + + + + + + + '; + +$sql_recent = "SELECT m.id, m.time, g.name AS gamename, m.mapfile, m.gametime, (SELECT count(p.id) FROM uts_player AS p WHERE m.id = p.matchid) as players FROM uts_match AS m, uts_games AS g WHERE g.id = m.gid $where ORDER BY m.time DESC LIMIT $qpage,25"; +$q_recent = mysql_query($sql_recent) or die(mysql_error()); +while ($r_recent = mysql_fetch_array($q_recent)) { + + $r_time = mdate($r_recent[time]); + $r_mapfile = un_ut($r_recent[mapfile]); + $r_gametime = GetMinutes($r_recent[gametime]); + + echo' + + + + + + + + '; +} + + + +echo ' +
Unreal Tournament Match List
'; +echo ''; +echo ''; +echo ''; +//echo ''; +echo ''; + +echo ''; +echo ''; +echo ''; +echo '
Filter:Date:'; +echo ' '; +echo ''; +echo ' '; +echo 'Gametype:
'; +echo '
Match IDDate/TimeMatch TypeMapTimePlayers
'.$r_recent[id].''.$r_time.''.$r_recent[gamename].''.$r_mapfile.''.$r_gametime.''.$r_recent[players].'
+
Page ['.$tfpage.'/'.$tlpage.'] Selection: '.$fpageurl.' / '.$ppageurl.' / '.$npageurl.' / '.$lpageurl.'
+
'; +?> \ No newline at end of file diff --git a/html/pages/report.php b/html/pages/report.php new file mode 100755 index 0000000..946b847 --- /dev/null +++ b/html/pages/report.php @@ -0,0 +1,24 @@ + \ No newline at end of file diff --git a/html/pages/report/bbcode.php b/html/pages/report/bbcode.php new file mode 100755 index 0000000..e07aa91 --- /dev/null +++ b/html/pages/report/bbcode.php @@ -0,0 +1,424 @@ +'; + +$id = preg_replace('/\D/', '', $_GET[id]); + +if (empty($id)) { + die("No ID given"); +} + +$sql_s = small_query("SELECT mapfile, gametime FROM uts_match WHERE id = '$id'"); + +$map = str_replace(".unr", "", "$sql_s[mapfile]"); +$mappic = strtolower("images/maps/".$map.".jpg"); +$actgamelength = $sql_s[gametime]; + +// Lets work out what kind of game this was from the scores + +$q_score = small_query("SELECT t0score, t1score FROM uts_match WHERE id = $id"); +$t0score = $q_score[t0score]; +$t1score = $q_score[t1score]; + +$teama = "Red Team"; +$teamb = "Blue Team"; + +IF ($t0score > $t1score) { + + $twin = 0; + $twin_team = $teama; + $twin_score = $t0score; + + $tlose = 1; + $tlose_team = $teamb; + $tdraw = "0"; + + $tdiff = $t0score+$t1score; + + IF ($tdiff <= 3) { + $reptype = "low"; + } elseIF ($tdiff >= 9) { + $reptype = "high"; + } else { + $reptype = "medium"; + } + +} elseIF ($t0score < $t1score) { + $twin = 1; + $twin_team = $teamb; + $twin_score = $t1score; + + $tlose = 0; + $tlose_team = $teama; + $tdraw = "0"; + + $tdiff = $t1score+$t0score; + + IF ($tdiff <= 2) { + $reptype = "low"; + } elseIF ($tdiff >= 9) { + $reptype = "high"; + } else { + $reptype = "medium"; + } + +} else { + $twin = "0"; + $tlose = "1"; + $tdraw = "1"; + + $tdiff = $t1score+$t0score; + $twin_team = $teama;; + $tlose_team = $teamb; + + IF ($tdiff <= 4) { + $reptype = "low"; + } elseIF ($tdiff >= 10) { + $reptype = "high"; + } else { + $reptype = "medium"; + } +} + +// Queries used within the report + +// First blood +$q_fblood = small_query("SELECT firstblood FROM uts_match WHERE id = $id"); + +// Player id of first blood +$t_fblood = small_query("SELECT name FROM uts_pinfo WHERE id = '".$q_fblood[firstblood]."'"); +$t_fbloodid = small_query("SELECT id FROM uts_player WHERE pid = '".$q_fblood[firstblood]."' AND matchid = $id"); +$r_fbloodid = $t_fbloodid[id]; +$r_fbloodname = $t_fblood[name]; + +// Belt count +$q_t0bcount = small_query("SELECT SUM(pu_belt) AS bcount FROM uts_player WHERE matchid = $id AND team = 0 AND pu_belt >0"); +$q_t1bcount = small_query("SELECT SUM(pu_belt) AS bcount FROM uts_player WHERE matchid = $id AND team = 1 AND pu_belt >0"); + +// Amp count +$q_t0acount = small_query("SELECT SUM(pu_amp) AS acount FROM uts_player WHERE matchid = $id AND team = 0 AND pu_amp >0"); +$q_t1acount = small_query("SELECT SUM(pu_amp) AS acount FROM uts_player WHERE matchid = $id AND team = 1 AND pu_amp >0"); + +// Cap count +$q_capsa = small_query("SELECT pi.name, SUM(p.flag_capture) AS flag_caps FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND matchid = $id AND team = 0 AND flag_capture >= 1 GROUP BY name"); +$q_capsb = small_query("SELECT pi.name, SUM(p.flag_capture) AS flag_caps FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND matchid = $id AND team = 1 AND flag_capture >= 1 GROUP BY name"); + +// Most Flag Grabs (W) +$q_topgrab = small_query("SELECT p.id, pi.name, p.flag_taken FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND matchid = $id AND team = $twin ORDER BY flag_taken DESC LIMIT 0,1"); +$r_topgrabid = $q_topgrab[id]; +$r_topgrabname = $q_topgrab[name]; + +// Most Flag Grabs (L) +$q_topgrabl = small_query("SELECT p.id, pi.name, p.flag_taken FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND matchid = $id AND team = $tlose ORDER BY flag_taken DESC LIMIT 0,1"); +$r_topgrabidl = $q_topgrabl[id]; +$r_topgrabnamel = $q_topgrabl[name]; + +// Most Flag Grabs (D) +$q_topgrabd = small_query("SELECT p.id, pi.name, p.flag_taken, team FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND matchid = $id ORDER BY flag_taken DESC LIMIT 0,1"); +$r_topgrabidd = $q_topgrabd[id]; +$r_topgrabnamed = $q_topgrabd[name]; + +IF ($redteam == $q_topgrabd[team]) { + $r_topgrabteamd = $warinfo[0][2]; + $r_topgrabteamdid = $warinfo[0][1]; +} else { + $r_topgrabteamd = $warinfo[1][2]; + $r_topgrabteamdid = $warinfo[1][1]; +} + + +// Most Flag Covers (W) +$q_topcover = small_query("SELECT p.id, pi.name, p.flag_cover FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND matchid = $id AND team = $twin ORDER BY flag_cover DESC LIMIT 0,1"); +$r_topcoverid = $q_topcover[id]; +$r_topcovername = $q_topcover[name]; + +// Most Flag Covers (L) +$q_topcoverl = small_query("SELECT p.id, pi.name, p.flag_cover FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND matchid = $id AND team = $tlose ORDER BY flag_cover DESC LIMIT 0,1"); +$r_topcoverlid = $q_topcoverl[id]; +$r_topcoverlname = $q_topcoverl[name]; + +// Most Flag Covers (R) +$q_topcoverr = small_query("SELECT p.id, pi.name, p.flag_cover FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND matchid = $id AND team = 0 ORDER BY flag_cover DESC LIMIT 0,1"); +$r_topcoverrid = $q_topcoverr[id]; +$r_topcoverrname = $q_topcoverr[name]; + +// Most Flag Covers (B) +$q_topcoverb = small_query("SELECT p.id, pi.name, p.flag_cover FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND matchid = $id AND team = 1 ORDER BY flag_cover DESC LIMIT 0,1"); +$r_topcoverbid = $q_topcoverb[id]; +$r_topcoverbname = $q_topcoverb[name]; + +// Most Flag Assists (D) +$q_topassistd = small_query("SELECT p.id, pi.name, p.flag_assist, team FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND matchid = $id ORDER BY flag_cover DESC LIMIT 0,1"); +$r_topassistdid = $q_topassistd[id]; +$r_topassistdname = $q_topassistd[name]; + +IF ($q_topassistd[team] == $redteam) { + $r_topassistdteam = $teamb; +} else { + $r_topassistdteam = $teama; +} + +// Most Flag Seals (W) +$q_topseal = small_query("SELECT p.id, pi.name, p.flag_seal FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND matchid = $id AND team = $twin ORDER BY flag_seal DESC LIMIT 0,1"); +$r_topsealid = $q_topseal[id]; +$r_topsealname = $q_topseal[name]; + +// Most Flag Seals (L) +$q_topseall = small_query("SELECT p.id, pi.name, p.flag_seal FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND matchid = $id AND team = $tlose ORDER BY flag_seal DESC LIMIT 0,1"); +$r_topseallid = $q_topseall[id]; +$r_topseallname = $q_topseall[name]; + +// Top Capper (W) +$q_topcap = small_query("SELECT p.id, pi.name, p.flag_capture FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND matchid = $id AND team = $twin ORDER BY flag_capture DESC LIMIT 0,1"); +$r_topcapid = $q_topcap[id]; +$r_topcapname = $q_topcap[name]; + +// Top Capper (D) +$q_topcapd = small_query("SELECT p.id, pi.name, p.flag_capture FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND matchid = $id ORDER BY flag_capture DESC LIMIT 0,1"); +$r_topcapdid = $q_topcap[id]; +$r_topcapdname = $q_topcap[name]; + +// Most Flag Kills (L) +$q_topdefl = small_query("SELECT p.id, pi.name, p.flag_kill FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND matchid = $id AND team = $tlose ORDER BY flag_kill DESC LIMIT 0,1"); +$r_topdeflid = $q_topdefl[id]; +$r_topdeflname = $q_topdefl[name]; + +// Most Flag Kills (W) +$q_topfkill = small_query("SELECT p.id, pi.name, p.flag_kill FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND matchid = $id AND team = $twin ORDER BY flag_kill DESC LIMIT 0,1"); +$r_topfkillid = $q_topfkill[id]; +$r_topfkillname = $q_topfkill[name]; + +// 2nd Most Flag Kills (W) +$q_topfkill2 = small_query("SELECT p.id, pi.name, p.flag_kill FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND matchid = $id AND team = $twin ORDER BY flag_kill DESC LIMIT 1,1"); +$r_topfkillid2 = $q_topfkill2[id]; +$r_topfkillname2 = $q_topfkill2[name]; + +// Most Frags (D) +$q_topfrag = small_query("SELECT p.id, pi.name, p.frags FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND matchid = $id ORDER BY frags DESC LIMIT 0,1"); +$r_topfragid = $q_topfrag[id]; +$r_topfragname = $q_topfrag[name]; + +// Most Frags (W) +$q_topfragw = small_query("SELECT p.id, pi.name, p.frags FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND matchid = $id AND team = $twin ORDER BY frags DESC LIMIT 0,1"); +$r_topfragwid = $q_topfkill2[id]; +$r_topfragwname = $q_topfkill2[name]; + +// Most Deaths (L) +$q_topdeath = small_query("SELECT p.id, pi.name, p.deaths FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND matchid = $id AND team = $tlose ORDER BY deaths DESC LIMIT 0,1"); +$r_topdeathid = $q_topdeath[id]; +$r_topdeathname = $q_topdeath[name]; + +// Player of the Match +$q_topstats = small_query("SELECT p.id, pi.name, p.rank AS prank FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND matchid = $id GROUP BY id, name ORDER BY prank DESC LIMIT 0,1"); +$r_topstatsid = $q_topstats[id]; +$r_topstatsname = $q_topstats[name]; + + +// Write the top of the report (non game specific) + +//Player List for Red Team +echo'[b]'.$teama.' Lineup[/b] +'; + +$sql_rplayer = "SELECT p.id, pi.name FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND matchid = $id AND team = 0 ORDER BY pi.name ASC"; +$q_rplayer = mysql_query($sql_rplayer); +while ($r_rplayer = mysql_fetch_array($q_rplayer)) { + + echo''.$r_rplayer[name].' +'; +} + +//Player List for Blue Team + +echo' +[b]'.$teamb.' Lineup[/b] +'; + +$sql_bplayer = "SELECT p.id, pi.name FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND matchid = $id AND team = 1 ORDER BY pi.name ASC"; +$q_bplayer = mysql_query($sql_bplayer); +while ($r_bplayer = mysql_fetch_array($q_bplayer)) { + + echo''.$r_bplayer[name].' +'; +} + +// Firstblood and Pickup stats + +echo ' +[b]Statistics[/b] +First Blood: '.$r_fbloodname.' +'.$teama.' Belts: '.$q_t0bcount[bcount].' +'.$teamb.' Belts: '.$q_t1bcount[bcount].' +'.$teama.' Amps: '.$q_t0acount[acount].' +'.$teamb.' Amps: '.$q_t1acount[acount].' + +[b]Match Report[/b] +'; + + +// Low Scores and a Draw +IF ($reptype == "low" && $tdraw == 1) { +echo'Neither team were better this map, scorline is proof of this. +[cl]'.$r_topgrabteamdid.','.$r_topgrabteamd.'[/cl] had the most chances to cap with '.$r_topgrabnamed.' taking the flag '.$q_topgrabd[flag_taken].' times, but unfortuantely couldnt cap as many as he took. + +Big credit to both teams defences; '; + +IF ($q_topdefl[flag_kill] >= $q_topfkill[flag_kill]) { + echo ''.$r_topdeflname.' defended the flag and got '.$q_topdefl[flag_kill].' flagkills while '.$r_topfkillname.' also had a pretty nice defensive game killing '.$q_topfkill[flag_kill].' flag carriers. + '; +} else { + echo ''.$r_topfkillname.' defended the flag and got '.$q_topfkill[flag_kill].' flagkills while '.$r_topdeflname.' also had a pretty nice defensive game killing '.$q_topdefl[flag_kill].' flag carriers. + '; +} + +echo'Seems the attackers had a frustrating game on this map, credit to '; + +IF ($q_topcover[flag_cover] >= $q_topcoverl[flag_cover]) { + echo ''.$r_topcovername.' for covering his flag carrier '.$q_topcover[flag_cover].' times and also '.$r_topcoverlname.' for covering '.$q_topcoverl[flag_cover].' times. + '; +} else { + echo ''.$r_topcoverlname.' for covering his flag carrier '.$q_topcoverl[flag_cover].' times and also '.$r_topcovername.' for covering '.$q_topcover[flag_cover].' times. + '; +} + +echo'Well done '.$r_topfragname.' for ensuring a tight scoreline with '.$q_topfrag[frags].' frags. +If this map would be played again between these two clans, we might see a change of strategy in the attacking play, but the defenders were strong on both sides this time. + +Good game. +Stats player of the map was '.$r_topstatsname.' with '.$q_topstats[prank].' stat points. +Well played both teams.'; +} + +// Medium Scores and a Draw +IF ($reptype == "medium" && $tdraw == 1) { +echo'An excitingly close game with neither side having the upper hand. +Both clans teamplay was about even and the result shows that it could have easily gone either way. + +Capping opportunities came along time after time, with [cl]'.$r_topgrabid.','.$r_topgrabname.'[/cl] taking the flag '.$q_topgrab[flag_taken].' times and at the other end [cl]'.$r_topgrabidl.','.$r_topgrabnamel.'[/cl] taking the flag '.$q_topgrabl[flag_taken].' times. + +Help was at hand for the flag runners with '.$teama.'\'s '.$r_topcoverrname.' covering '.$q_topcoverr[flag_cover].' times and '.$r_topcoverbname.' covering '.$q_topcoverb[flag_cover].' times for '.$teamb.'. + +Big credit to both teams defences; '; + +IF ($q_topdefl[flag_kill] >= $q_topfkill[flag_kill]) { + echo ''.$r_topdeflname.' defended the flag and got '.$q_topdefl[flag_kill].' flagkills while '.$r_topfkillname.' also had a pretty nice defensive game killing '.$q_topfkill[flag_kill].' flag carriers. + '; +} else { + echo ''.$r_topfkillname.' defended the flag and got '.$q_topfkill[flag_kill].' flagkills while '.$r_topdeflname.' also had a pretty nice defensive game killing '.$q_topdefl[flag_kill].' flag carriers. + '; +} + +echo'Both teams showed great teamplay and skill and the scoreline represents this. +Two even lineups for this map. + +Well done '.$r_topfragname.' who had '.$q_topfrag[frags].' frags. + +Good game. +Stats player of the map was '.$r_topstatsname.' with '.$q_topstats[prank].' stat points. +Well played both teams.'; +} + +// High Scores and a Draw +IF ($reptype == "high" && $tdraw == 1) { +echo'A very very exciting, close CTF game Im sure both clans will agree. +This high scoring draw proves that '.$teama.' and '.$teamb.' were evenly matched on this map. +Teamplay and strategy enabled both teams to cap quite a few times. +Well done to both teams attackers especially '.$r_topcapdname.' who capped '.$q_topcapd[flag_capture].' times. + +Capping opportunities came along time after time, with [cl]'.$r_topgrabid.','.$r_topgrabname.'[/cl] taking the flag '.$q_topgrab[flag_taken].' times and at the other end [cl]'.$r_topgrabidl.','.$r_topgrabnamel.'[/cl] taking the flag '.$q_topgrabl[flag_taken].' times. + +Help was at hand for the flag runners with '.$teama.'\'s '.$r_topcoverrname.' covering '.$q_topcoverr[flag_cover].' times and '.$r_topcoverbname.' covering '.$q_topcoverb[flag_cover].' times for '.$teamb.'. + +Although the defenders probably didnt have as good a game as the attackers on this map, credit should be awarded to '; + +IF ($q_topdefl[flag_kill] >= $q_topfkill[flag_kill]) { + echo ''.$r_topdeflname.' for killing '.$q_topdefl[flag_kill].' flag carriers and also to '; +} else { + echo ''.$r_topfkillname.' for killing '.$q_topfkill[flag_kill].' flag carriers and also to '; +} + +IF ($q_topseall[flag_seal] >= $q_topseal[flag_seal]) { + echo ''.$r_topseallname.' for sealing the base '.$q_topseall[flag_seal].' times for his flag carrier to cap. +
'; +} else { + echo ''.$r_topsealname.' for sealing the base '.$q_topseal[flag_seal].' times for his flag carrier to cap. +
'; +} + +echo' '.$r_topassistdname.' helped '.$r_topassistdteam.' get as many caps as they did by assisting '.$q_topassistd[flag_assist].' times in their caps. +This shows great teamplay and cover, well played. + +Both teams showed great teamplay and skill and the scoreline represents this. +Well done '.$r_topfragname.' who had '.$q_topfrag[frags].' frags. + +Good game. +Stats player of the map was '.$r_topstatsname.' with '.$q_topstats[prank].' stat points. +Well played both teams.'; +} + +// Low Scores and not a Draw +IF ($reptype == "low" && $tdraw == 0) { +echo 'Not very many caps in this close game, but '.$twin_team.' emerge victorious. + +Big credit to both teams defences; '; + +IF ($q_topdefl[flag_kill] >= $q_topfkill[flag_kill]) { + echo ''.$r_topdeflname.' defended the flag and got '.$q_topdefl[flag_kill].' flagkills while '.$r_topfkillname.' also had a pretty nice defensive game killing '.$q_topfkill[flag_kill].' flag carriers. + '; +} else { + echo ''.$r_topfkillname.' defended the flag and got '.$q_topfkill[flag_kill].' flagkills while '.$r_topdeflname.' also had a pretty nice defensive game killing '.$q_topdefl[flag_kill].' flag carriers. + '; +} + +echo 'Seems the attackers had a frustrating game on this map, especially [cl]'.$r_topgrabidl.','.$r_topgrabnamel.'[/cl] who took the flag '.$q_topgrabl[flag_taken].' and still lost the game :( + +Suportive play was made by '.$r_topcoverlname.' having '.$q_topcoverl[flag_cover].' covers, but even with covering play, the majority of the flags got returned and the game ended with '.$tlose_team.' losing out. + +Well done to '.$r_topcapname.' for capping '.$q_topcap[flag_capture].'. +On other days the outcome could have been different. + +Good game and congratulations '.$twin_team.'. +Stats player of the map was '.$r_topstatsname.' with '.$q_topstats[prank].' stat points. +Well played both teams.'; +} + +// Medium Scores and not a Draw +IF ($reptype == "medium" && $tdraw == 0) { +echo 'A nice game of Capture the Flag took place this map with both teams trying hard to get flags back but only occasionally succeeding. + +'.$twin_team.' however managed to succesfully cap more than '.$tlose_team.' with big help from '.$r_topcapname.' who capped '.$q_topcap[flag_capture].'. +'.$r_topgrabname.' made it hard for the '.$tlose_team.' defenders taking the flag a total of '.$q_topgrab[flag_taken].' times. +Not to say that the defence was bad at all, '.$r_topdeflname.' got '.$q_topdefl[flag_kill].' flag kills and this made attacking hard work for '.$twin_team.'. + +Sealing off the base for '.$twin_team.' was some nice defence including '.$r_topsealname.' who sealed the base '.$q_topseal[flag_seal].' times. +Covering the flag carrier for '.$twin_team.' mostly was '.$r_topcovername.' with '.$q_topcover[flag_cover].' covers. + +Attacking in vain at the other end of the map was '.$r_topgrabnamel.' who managed to take the '.$twin_team.' flag '.$q_topgrabl[flag_taken].' times, but unfortunately was unable to match the '.$twin_score.' caps made by '.$twin_team.'. +'.$r_topgrabnamel.' was also up against some heavy defence including '.$r_topfkillname.' with '.$q_topfkill[flag_kill].' flag kills and '.$r_topfkillname2.' with '.$q_topfkill2[flag_kill].' flag kills. + +Good game and congratulations '.$twin_team.'. +Stats player of the map was '.$r_topstatsname.' with '.$q_topstats[prank].' stat points. +Well played both teams.'; +} + +// High Scores and not a Draw +IF ($reptype == "high" && $tdraw == 0) { +echo ''.$twin_team.' were victorious thanks to some nice capping by '.$r_topcapname.' who capped '.$q_topcap[flag_capture].' and '.$r_topgrabname.' who took the flag'.$q_topgrab[flag_taken].' times. + +'.$r_topcapname.' probably could not have done it without the help of '.$r_topcovername.' who had '.$q_topcover[flag_cover].' covers and '.$r_topsealname.' for sealing the base off '.$q_topseal[flag_seal].' times. + +Although the '.$tlose_team.' defenders played well, the '.$q_topdefl[flag_kill].' flag kills by '.$r_topdeflname.' was just not enough to stop the '.$twin_team.' attackers succeeding. +Extra Credit should be given to '.$r_topfragwname.' for getting '.$q_topwfrag[frags].' frags. +Some sympathy should be given to '.$r_topdeathname.' who died a whopping '.$q_topdeath[deaths].' times - unlucky!. + +All in all, this was a great attacking game for '.$twin_team.', but all players deserve credit for playing well. + +Good game and congratulations '.$twin_team.'. +Stats player of the map was '.$r_topstatsname.' with '.$q_topstats[prank].' stat points.'; +} + +echo' + +This report was created with UTStats from the following game: +[url]http://'.$oururl.'?p=match&mid='.$id.'[/url] +'; +?> \ No newline at end of file diff --git a/html/pages/report/clanbase.php b/html/pages/report/clanbase.php new file mode 100755 index 0000000..6b7d412 --- /dev/null +++ b/html/pages/report/clanbase.php @@ -0,0 +1,530 @@ +'; + +$id = preg_replace('/\D/', '', $_GET[id]); + +if (empty($id)) { + die("No ID given"); +} + +function get_cbid($pid) { + $cbid = preg_replace('/\D/', '', $_GET[$pid]); + return $cbid; +} +$cbid = get_cbid; + +function get_cbnick($badtext) { + $badstuff = array("[","]"); + $goodtext = str_replace($badstuff, " ", $badtext); + return $goodtext; +} +$cbnick = get_cbnick; + +$warinfo = get_clans($wid); + +$redteam = $_GET["red"]; + +IF($redteam == $warinfo[0][1]) { + $teamaid = $warinfo[0][1]; + $teambid = $warinfo[1][1]; + $cbteama = $warinfo[0][2]; + $cbteamb = $warinfo[1][2]; + $redteam = 0; + $blueteam = 1; + +} else { + $teamaid = $warinfo[1][1]; + $teambid = $warinfo[0][1]; + $cbteama = $warinfo[1][2]; + $cbteamb = $warinfo[0][2]; + $redteam = 1; + $blueteam = 0; +} + +$teama = str_replace(" $t1score) { + + $twin = 0; + $twin_team = $teama; + $twin_score = $t0score; + + $tlose = 1; + $tlose_team = $teamb; + $tdraw = "0"; + + $tdiff = $t0score+$t1score; + + IF ($tdiff <= 3) { + $reptype = "low"; + } elseIF ($tdiff >= 9) { + $reptype = "high"; + } else { + $reptype = "medium"; + } + +} elseIF ($t0score < $t1score) { + $twin = 1; + $twin_team = $teamb; + $twin_score = $t1score; + + $tlose = 0; + $tlose_team = $teama; + $tdraw = "0"; + + $tdiff = $t1score+$t0score; + + IF ($tdiff <= 2) { + $reptype = "low"; + } elseIF ($tdiff >= 9) { + $reptype = "high"; + } else { + $reptype = "medium"; + } + +} else { + $twin = "0"; + $tlose = "1"; + $tdraw = "1"; + + $tdiff = $t1score+$t0score; + $twin_team = $teama; + $tlose_team = $teamb; + + IF ($tdiff <= 4) { + $reptype = "low"; + } elseIF ($tdiff >= 10) { + $reptype = "high"; + } else { + $reptype = "medium"; + } +} + +// Queries used within the report + +// First blood +$q_fblood = small_query("SELECT firstblood FROM uts_match WHERE id = $id"); + +// Player id of first blood +$t_fblood = small_query("SELECT name FROM uts_pinfo WHERE id = '".$q_fblood[firstblood]."'"); +$t_fbloodid = small_query("SELECT id FROM uts_player WHERE pid = '".$q_fblood[firstblood]."' AND matchid = $id"); +$r_fbloodid = $cbid($t_fbloodid[id]); +$r_fbloodname = $cbnick($t_fblood[name]); + +// Belt count +$q_t0bcount = small_query("SELECT SUM(pu_belt) AS bcount FROM uts_player WHERE matchid = $id AND team = 0 AND pu_belt >0"); +$q_t1bcount = small_query("SELECT SUM(pu_belt) AS bcount FROM uts_player WHERE matchid = $id AND team = 1 AND pu_belt >0"); + +// Amp count +$q_t0acount = small_query("SELECT SUM(pu_amp) AS acount FROM uts_player WHERE matchid = $id AND team = 0 AND pu_amp >0"); +$q_t1acount = small_query("SELECT SUM(pu_amp) AS acount FROM uts_player WHERE matchid = $id AND team = 1 AND pu_amp >0"); + +// Cap count +$q_capsa = small_query("SELECT pi.name, SUM(p.flag_capture) AS flag_caps FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND matchid = $id AND team = 0 AND flag_capture >= 1 GROUP BY name"); +$q_capsb = small_query("SELECT pi.name, SUM(p.flag_capture) AS flag_caps FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND matchid = $id AND team = 1 AND flag_capture >= 1 GROUP BY name"); + +// Most Flag Grabs (W) +$q_topgrab = small_query("SELECT p.id, pi.name, p.flag_taken FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND matchid = $id AND team = $twin ORDER BY flag_taken DESC LIMIT 0,1"); +$r_topgrabid = $cbid($q_topgrab[id]); +$r_topgrabname = $cbnick($q_topgrab[name]); + +// Most Flag Grabs (L) +$q_topgrabl = small_query("SELECT p.id, pi.name, p.flag_taken FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND matchid = $id AND team = $tlose ORDER BY flag_taken DESC LIMIT 0,1"); +$r_topgrabidl = $cbid($q_topgrabl[id]); +$r_topgrabnamel = $cbnick($q_topgrabl[name]); + +// Most Flag Grabs (D) +$q_topgrabd = small_query("SELECT p.id, pi.name, p.flag_taken, team FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND matchid = $id ORDER BY flag_taken DESC LIMIT 0,1"); +$r_topgrabidd = $cbid($q_topgrabd[id]); +$r_topgrabnamed = $cbnick($q_topgrabd[name]); + +IF ($redteam == $q_topgrabd[team]) { + $r_topgrabteamd = $warinfo[0][2]; + $r_topgrabteamdid = $warinfo[0][1]; +} else { + $r_topgrabteamd = $warinfo[1][2]; + $r_topgrabteamdid = $warinfo[1][1]; +} + + +// Most Flag Covers (W) +$q_topcover = small_query("SELECT p.id, pi.name, p.flag_cover FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND matchid = $id AND team = $twin ORDER BY flag_cover DESC LIMIT 0,1"); +$r_topcoverid = $cbid($q_topcover[id]); +$r_topcovername = $cbnick($q_topcover[name]); + +// Most Flag Covers (L) +$q_topcoverl = small_query("SELECT p.id, pi.name, p.flag_cover FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND matchid = $id AND team = $tlose ORDER BY flag_cover DESC LIMIT 0,1"); +$r_topcoverlid = $cbid($q_topcoverl[id]); +$r_topcoverlname = $cbnick($q_topcoverl[name]); + +// Most Flag Covers (R) +$q_topcoverr = small_query("SELECT p.id, pi.name, p.flag_cover FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND matchid = $id AND team = 0 ORDER BY flag_cover DESC LIMIT 0,1"); +$r_topcoverrid = $cbid($q_topcoverr[id]); +$r_topcoverrname = $cbnick($q_topcoverr[name]); + +// Most Flag Covers (B) +$q_topcoverb = small_query("SELECT p.id, pi.name, p.flag_cover FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND matchid = $id AND team = 1 ORDER BY flag_cover DESC LIMIT 0,1"); +$r_topcoverbid = $cbid($q_topcoverb[id]); +$r_topcoverbname = $cbnick($q_topcoverb[name]); + +// Most Flag Assists (D) +$q_topassistd = small_query("SELECT p.id, pi.name, p.flag_assist, team FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND matchid = $id ORDER BY flag_cover DESC LIMIT 0,1"); +$r_topassistdid = $cbid($q_topassistd[id]); +$r_topassistdname = $cbnick($q_topassistd[name]); + +IF ($q_topassistd[team] == $redteam) { + $r_topassistdteam = $teamb; +} else { + $r_topassistdteam = $teama; +} + +// Most Flag Seals (W) +$q_topseal = small_query("SELECT p.id, pi.name, p.flag_seal FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND matchid = $id AND team = $twin ORDER BY flag_seal DESC LIMIT 0,1"); +$r_topsealid = $cbid($q_topseal[id]); +$r_topsealname = $cbnick($q_topseal[name]); + +// Most Flag Seals (L) +$q_topseall = small_query("SELECT p.id, pi.name, p.flag_seal FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND matchid = $id AND team = $tlose ORDER BY flag_seal DESC LIMIT 0,1"); +$r_topseallid = $cbid($q_topseall[id]); +$r_topseallname = $cbnick($q_topseall[name]); + +// Top Capper (W) +$q_topcap = small_query("SELECT p.id, pi.name, p.flag_capture FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND matchid = $id AND team = $twin ORDER BY flag_capture DESC LIMIT 0,1"); +$r_topcapid = $cbid($q_topcap[id]); +$r_topcapname = $cbnick($q_topcap[name]); + +// Top Capper (D) +$q_topcapd = small_query("SELECT p.id, pi.name, p.flag_capture FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND matchid = $id ORDER BY flag_capture DESC LIMIT 0,1"); +$r_topcapdid = $cbid($q_topcap[id]); +$r_topcapdname = $cbnick($q_topcap[name]); + +// Most Flag Kills (L) +$q_topdefl = small_query("SELECT p.id, pi.name, p.flag_kill FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND matchid = $id AND team = $tlose ORDER BY flag_kill DESC LIMIT 0,1"); +$r_topdeflid = $cbid($q_topdefl[id]); +$r_topdeflname = $cbnick($q_topdefl[name]); + +// Most Flag Kills (W) +$q_topfkill = small_query("SELECT p.id, pi.name, p.flag_kill FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND matchid = $id AND team = $twin ORDER BY flag_kill DESC LIMIT 0,1"); +$r_topfkillid = $cbid($q_topfkill[id]); +$r_topfkillname = $cbnick($q_topfkill[name]); + +// 2nd Most Flag Kills (W) +$q_topfkill2 = small_query("SELECT p.id, pi.name, p.flag_kill FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND matchid = $id AND team = $twin ORDER BY flag_kill DESC LIMIT 1,1"); +$r_topfkillid2 = $cbid($q_topfkill2[id]); +$r_topfkillname2 = $cbnick($q_topfkill2[name]); + +// Most Frags (D) +$q_topfrag = small_query("SELECT p.id, pi.name, p.frags FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND matchid = $id ORDER BY frags DESC LIMIT 0,1"); +$r_topfragid = $cbid($q_topfrag[id]); +$r_topfragname = $cbnick($q_topfrag[name]); + +// Most Frags (W) +$q_topfragw = small_query("SELECT p.id, pi.name, p.frags FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND matchid = $id AND team = $twin ORDER BY frags DESC LIMIT 0,1"); +$r_topfragwid = $cbid($q_topfkill2[id]); +$r_topfragwname = $cbnick($q_topfkill2[name]); + +// Most Deaths (L) +$q_topdeath = small_query("SELECT p.id, pi.name, p.deaths FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND matchid = $id AND team = $tlose ORDER BY deaths DESC LIMIT 0,1"); +$r_topdeathid = $cbid($q_topdeath[id]); +$r_topdeathname = $cbnick($q_topdeath[name]); + +// Player of the Match +$q_topstats = small_query("SELECT p.id, pi.name, p.rank AS prank FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND matchid = $id GROUP BY id, name ORDER BY prank DESC LIMIT 0,1"); +$r_topstatsid = $cbid($q_topstats[id]); +$r_topstatsname = $cbnick($q_topstats[name]); + + +// Write the top of the report (non game specific) + +//Player List for Red Team +echo'_______________________________________________________________________
+'.$teama.' Lineup:
+'; + +$sql_rplayer = "SELECT p.id, pi.name FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND matchid = $id AND team = 0 ORDER BY pi.name ASC"; +$q_rplayer = mysql_query($sql_rplayer); +while ($r_rplayer = mysql_fetch_array($q_rplayer)) { + + echo'[pl]'.$cbid($r_rplayer[id]).','.$cbnick($r_rplayer[name]).'[/pl] '; +} + +//Player List for Blue Team + +echo'
_______________________________________________________________________
+'.$teamb.' Lineup:
+'; + +$sql_bplayer = "SELECT p.id, pi.name FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND matchid = $id AND team = 1 ORDER BY pi.name ASC"; +$q_bplayer = mysql_query($sql_bplayer); +while ($r_bplayer = mysql_fetch_array($q_bplayer)) { + + echo'[pl]'.$cbid($r_bplayer[id]).','.$cbnick($r_bplayer[name]).'[/pl] '; +} +echo '_______________________________________________________________________
+
'; + +// Firstblood and Pickup stats + +echo 'First Blood: [pl]'.$r_fbloodid.','.$r_fbloodname.'[/pl]
+'.$teama.' Belts: '.$q_t0bcount[bcount].'
+'.$teamb.' Belts: '.$q_t1bcount[bcount].'
+'.$teama.' Amps: '.$q_t0acount[acount].'
+'.$teamb.' Amps: '.$q_t1acount[acount].'
+'; + +echo '_______________________________________________________________________
+
+'; + +// Low Scores and a Draw +IF ($reptype == "low" && $tdraw == 1) { + echo'Neither team were better this map, scorline is proof of this.
+ [cl]'.$r_topgrabteamdid.','.$r_topgrabteamd.'[/cl] had the most chances to cap with [pl]'.$r_topgrabidd.','.$r_topgrabnamed.'[/pl] + taking the flag '.$q_topgrabd[flag_taken].' times, but unfortuantely couldnt cap as many as he took.
+
+ Big credit to both teams defences; '; + + IF ($q_topdefl[flag_kill] >= $q_topfkill[flag_kill]) { + echo '[pl]'.$r_topdeflid.','.$r_topdeflname.'[/pl] defended the flag + and got '.$q_topdefl[flag_kill].' flagkills while [pl]'.$r_topfkillid.','.$r_topfkillname.'[/pl] + also had a pretty nice defensive game killing '.$q_topfkill[flag_kill].' flag carriers.
+
'; + } else { + echo '[pl]'.$r_topfkillid.','.$r_topfkillname.'[/pl] defended the flag + and got '.$q_topfkill[flag_kill].' flagkills while [pl]'.$r_topdeflid.','.$r_topdeflname.'[/pl] + also had a pretty nice defensive game killing '.$q_topdefl[flag_kill].' flag carriers.
+
'; + } + + echo'Seems the attackers had a frustrating game on this map, credit to '; + + IF ($q_topcover[flag_cover] >= $q_topcoverl[flag_cover]) { + echo '[pl]'.$r_topcoverid.','.$r_topcovername.'[/pl] for covering his flag carrier + '.$q_topcover[flag_cover].' times and also [pl]'.$r_topcoverlid.','.$r_topcoverlname.'[/pl] + for covering '.$q_topcoverl[flag_cover].' times.
+
'; + } else { + echo '[pl]'.$r_topcoverlid.','.$r_topcoverlname.'[/pl] for covering his flag carrier + '.$q_topcoverl[flag_cover].' times and also [pl]'.$r_topcoverid.','.$r_topcovername.'[/pl] + for covering '.$q_topcover[flag_cover].' times.
+
'; + } + + echo'Well done [pl]'.$r_topfragid.','.$r_topfragname.'[/pl] for ensuring a tight scoreline with + '.$q_topfrag[frags].' frags.
+
+ If this map would be played again between these two clans, we might see a change of strategy + in the attacking play, but the defenders were strong on both sides this time.
+
+ Good game.
+ Stats player of the map was [pl]'.$r_topstatsid.','.$r_topstatsname.'[/pl] with '.$q_topstats[prank].' + stat points.
+ Well played both teams.'; +} + +// Medium Scores and a Draw +IF ($reptype == "medium" && $tdraw == 1) { + echo'An excitingly close game with neither side having the upper hand.
+ Both clans teamplay was about even and the result shows that it could have easily gone either way.
+
+ Capping opportunities came along time after time, with [cl]'.$r_topgrabid.','.$r_topgrabname.'[/cl] + taking the flag '.$q_topgrab[flag_taken].' times and at the other end [cl]'.$r_topgrabidl.','.$r_topgrabnamel.'[/cl] + taking the flag '.$q_topgrabl[flag_taken].' times. + + Help was at hand for the flag runners with '.$teama.'\'s [pl]'.$r_topcoverrid.','.$r_topcoverrname.'[/pl] + covering '.$q_topcoverr[flag_cover].' times and [pl]'.$r_topcoverbid.','.$r_topcoverbname.'[/pl] + covering '.$q_topcoverb[flag_cover].' times for '.$teamb.'.
+
+ Big credit to both teams defences; '; + + IF ($q_topdefl[flag_kill] >= $q_topfkill[flag_kill]) { + echo '[pl]'.$r_topdeflid.','.$r_topdeflname.'[/pl] defended the flag + and got '.$q_topdefl[flag_kill].' flagkills while [pl]'.$r_topfkillid.','.$r_topfkillname.'[/pl] + also had a pretty nice defensive game killing '.$q_topfkill[flag_kill].' flag carriers.
+
'; + } else { + echo '[pl]'.$r_topfkillid.','.$r_topfkillname.'[/pl] defended the flag + and got '.$q_topfkill[flag_kill].' flagkills while [pl]'.$r_topdeflid.','.$r_topdeflname.'[/pl] + also had a pretty nice defensive game killing '.$q_topdefl[flag_kill].' flag carriers.
+
'; + } + + echo'Both teams showed great teamplay and skill and the scoreline represents this. + Two even lineups for this map.
+
+ Well done [pl]'.$r_topfragid.','.$r_topfragname.'[/pl] who had '.$q_topfrag[frags].' frags.
+
+ Good game.
+ Stats player of the map was [pl]'.$r_topstatsid.','.$r_topstatsname.'[/pl] with '.$q_topstats[prank].' + stat points.
+ Well played both teams.'; +} + +// High Scores and a Draw +IF ($reptype == "high" && $tdraw == 1) { +echo' A very very exciting, close CTF game Im sure both clans will agree.
+This high scoring draw proves that '.$teama.' and '.$teamb.' were evenly matched on this map.
+Teamplay and strategy enabled both teams to cap quite a few times.
+Well done to both teams attackers especially [pl]'.$r_topcapdid.','.$r_topcapdname.'[/pl] +who capped '.$q_topcapd[flag_capture].' times.
+
+ Capping opportunities came along time after time, with [cl]'.$r_topgrabid.','.$r_topgrabname.'[/cl] + taking the flag '.$q_topgrab[flag_taken].' times and at the other end [cl]'.$r_topgrabidl.','.$r_topgrabnamel.'[/cl] + taking the flag '.$q_topgrabl[flag_taken].' times.
+
+ Help was at hand for the flag runners with '.$teama.'\'s [pl]'.$r_topcoverrid.','.$r_topcoverrname.'[/pl] + covering '.$q_topcoverr[flag_cover].' times and [pl]'.$r_topcoverbid.','.$r_topcoverbname.'[/pl] + covering '.$q_topcoverb[flag_cover].' times for '.$teamb.'.
+
+ Although the defenders probably didnt have as good a game as the attackers on this map, + credit should be awarded to '; + + IF ($q_topdefl[flag_kill] >= $q_topfkill[flag_kill]) { + echo '[pl]'.$r_topdeflid.','.$r_topdeflname.'[/pl] for killing '.$q_topdefl[flag_kill].' + flag carriers and also to '; + } else { + echo '[pl]'.$r_topfkillid.','.$r_topfkillname.'[/pl] for killing '.$q_topfkill[flag_kill].' + flag carriers and also to '; + } + + IF ($q_topseall[flag_seal] >= $q_topseal[flag_seal]) { + echo '[pl]'.$r_topseallid.','.$r_topseallname.'[/pl] for sealing the base '.$q_topseall[flag_seal].' + times for his flag carrier to cap.
+
'; + } else { + echo '[pl]'.$r_topsealid.','.$r_topsealname.'[/pl] for sealing the base '.$q_topseal[flag_seal].' + times for his flag carrier to cap.
+
'; + } + + echo' [pl]'.$r_topassistdid.','.$r_topassistdname.'[/pl] helped '.$r_topassistdteam.' get as many + caps as they did by assisting '.$q_topassistd[flag_assist].' times in their caps.
+ This shows great teamplay and cover, well played.
+
+ Both teams showed great teamplay and skill and the scoreline represents this.
+
+ Well done [pl]'.$r_topfragid.','.$r_topfragname.'[/pl] who had '.$q_topfrag[frags].' frags.
+
+ Good game.
+ Stats player of the map was [pl]'.$r_topstatsid.','.$r_topstatsname.'[/pl] with '.$q_topstats[prank].' + stat points.
+ Well played both teams.'; +} + +// Low Scores and not a Draw +IF ($reptype == "low" && $tdraw == 0) { + echo 'Not very many caps in this close game, but '.$twin_team.' emerge victorious.
+
+ Big credit to both teams defences; '; + + IF ($q_topdefl[flag_kill] >= $q_topfkill[flag_kill]) { + echo '[pl]'.$r_topdeflid.','.$r_topdeflname.'[/pl] defended the flag + and got '.$q_topdefl[flag_kill].' flagkills while [pl]'.$r_topfkillid.','.$r_topfkillname.'[/pl] + also had a pretty nice defensive game killing '.$q_topfkill[flag_kill].' flag carriers.
+
'; + } else { + echo '[pl]'.$r_topfkillid.','.$r_topfkillname.'[/pl] defended the flag + and got '.$q_topfkill[flag_kill].' flagkills while [pl]'.$r_topdeflid.','.$r_topdeflname.'[/pl] + also had a pretty nice defensive game killing '.$q_topdefl[flag_kill].' flag carriers.
+
'; + } + + echo 'Seems the attackers had a frustrating game on this map, + especially [cl]'.$r_topgrabidl.','.$r_topgrabnamel.'[/cl] who took the flag '.$q_topgrabl[flag_taken].' + and still lost the game :(
+
+ Suportive play was made by [pl]'.$r_topcoverlid.','.$r_topcoverlname.'[/pl] having + '.$q_topcoverl[flag_cover].' covers, but even with covering play, + the majority of the flags got returned and the game ended with '.$tlose_team.' losing out.
+
+ Well done to [pl]'.$r_topcapid.','.$r_topcapname.'[/pl] for capping '.$q_topcap[flag_capture].'.
+ On other days the outcome could have been different.
+
+ Good game and congratualtions '.$twin_team.'.
+ Stats player of the map was [pl]'.$r_topstatsid.','.$r_topstatsname.'[/pl] with '.$q_topstats[prank].' + stat points.
+ Well played both teams.'; +} + +// Medium Scores and not a Draw +IF ($reptype == "medium" && $tdraw == 0) { + echo 'A nice game of Capture the Flag took place this map with both teams trying + hard to get flags back but only occasionally succeeding.
+
+ '.$twin_team.' however managed to succesfully cap more than '.$tlose_team.' with big help + from [pl]'.$r_topcapid.','.$r_topcapname.'[/pl] who capped '.$q_topcap[flag_capture].'. + [pl]'.$r_topgrabid.','.$r_topgrabname.'[/pl] made it hard for the '.$tlose_team.' defenders taking the + flag a total of '.$q_topgrab[flag_taken].' times.
+ Not to say that the defence was bad at all, [pl]'.$r_topdeflid.','.$r_topdeflname.'[/pl] + got '.$q_topdefl[flag_kill].' flag kills and this made attacking hard work for '.$twin_team.'.
+
+ Sealing off the base for '.$twin_team.' was some nice defence including + [pl]'.$r_topsealid.','.$r_topsealname.'[/pl] who sealed the base '.$q_topseal[flag_seal].' times.
+ Covering the flag carrier for '.$twin_team.' mostly was [pl]'.$r_topcoverid.','.$r_topcovername.'[/pl] + with '.$q_topcover[flag_cover].' covers.
+
+ Attacking in vain at the other end of the map was [pl]'.$r_topgrabidl.','.$r_topgrabnamel.'[/pl] + who managed to take the '.$twin_team.' flag '.$q_topgrabl[flag_taken].' times, + but unfortunately was unable to match the '.$twin_score.' caps made by '.$twin_team.'.
+ [pl]'.$r_topgrabidl.','.$r_topgrabnamel.'[/pl] was also up against some heavy defence including + [pl]'.$r_topfkillid.','.$r_topfkillname.'[/pl] with '.$q_topfkill[flag_kill].' flag kills and + [pl]'.$r_topfkillid2.','.$r_topfkillname2.'[/pl] with '.$q_topfkill2[flag_kill].' flag kills.
+
+ Good game and congratualtions '.$twin_team.'.
+ Stats player of the map was [pl]'.$r_topstatsid.','.$r_topstatsname.'[/pl] with '.$q_topstats[prank].' + stat points.
+ Well played both teams.'; +} + +// High Scores and not a Draw +IF ($reptype == "high" && $tdraw == 0) { + echo ''.$twin_team.' were victorious thanks to some nice capping by + [pl]'.$r_topcapid.','.$r_topcapname.'[/pl] who capped '.$q_topcap[flag_capture].' and + [pl]'.$r_topgrabid.','.$r_topgrabname.'[/pl] who took the flag'.$q_topgrab[flag_taken].' times.
+
+ [pl]'.$r_topcapid.','.$r_topcapname.'[/pl] probably could not have done it without the help of + [pl]'.$r_topcoverid.','.$r_topcovername.'[/pl] who had '.$q_topcover[flag_cover].' covers and + [pl]'.$r_topsealid.','.$r_topsealname.'[/pl] for sealing the base off + '.$q_topseal[flag_seal].' times.
+
+ Although the '.$tlose_team.' defenders played well, the '.$q_topdefl[flag_kill].' flag kills by + [pl]'.$r_topdeflid.','.$r_topdeflname.'[/pl] was just not enough to stop the + '.$twin_team.' attackers succeeding. Extra Credit should be given to + [pl]'.$r_topfragwid.','.$r_topfragwname.'[/pl] for getting '.$q_topwfrag[frags].' frags.
+ Some sympathy should be given to [pl]'.$r_topdeathid.','.$r_topdeathname.'[/pl] + who died a whopping '.$q_topdeath[deaths].' times - unlucky!.
+
+ All in all, this was a great attacking game for '.$twin_team.', but all players deserve credit for + playing well.
+
+ Good game and congratualtions '.$twin_team.'.
+ Stats player of the map was [pl]'.$r_topstatsid.','.$r_topstatsname.'[/pl] with '.$q_topstats[prank].' + stat points.'; + +} + +echo'
+
+ This report was created with UTStats from the following game:
+ [el]http://'.$oururl.'?p=match&mid='.$id.',http://'.$oururl.'?p=match&mid='.$id.'[/el] + '; +?> \ No newline at end of file diff --git a/html/pages/report/index.htm b/html/pages/report/index.htm new file mode 100755 index 0000000..e69de29 diff --git a/html/pages/report_cb.php b/html/pages/report_cb.php new file mode 100755 index 0000000..ebde5a6 --- /dev/null +++ b/html/pages/report_cb.php @@ -0,0 +1,168 @@ + + + + + + + + + + + + +
Enter the Clanbase WarID
+ +
+'; + +echo' + + + + + + + + +
+ Team BreakDown of Match
Red TeamBlue Team
'; + +$sql_rteam = "SELECT p.id, pi.name FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND matchid = $id AND team = 0 ORDER BY pi.name ASC"; +$q_rteam = mysql_query($sql_rteam); +while ($r_rteam = mysql_fetch_array($q_rteam)) { + echo''.$r_rteam[name].'
'; + } +echo'
'; + +$sql_bteam = "SELECT p.id, pi.name FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND matchid = $id AND team = 1 ORDER BY pi.name ASC"; +$q_bteam = mysql_query($sql_bteam); +while ($r_bteam = mysql_fetch_array($q_bteam)) { + echo''.$r_bteam[name].'
'; + } +echo'

'; + +IF ($wid == "") { +} + +IF ($stage >= "1") { + include("includes/clanbase.php"); + $warinfo = get_clans($wid); +} + +IF ($stage == "1") { + $claninfo0 = get_players($warinfo[0][1]); + $claninfo1 = get_players($warinfo[1][1]); + + echo'
+ + + + + + + + + + + + + +
+ Who Played As Red Team?
+ +
+
'; +} + +IF ($stage == "2") { + $redteam = $_GET["red"]; + + IF($redteam == $warinfo[0][1]) { + $redcid = $warinfo[0][1]; + $redname = $warinfo[0][2]; + $redinfo = get_players($warinfo[0][1]); + $bluecid = $warinfo[1][1]; + $bluename = $warinfo[1][2]; + $blueinfo = get_players($warinfo[1][1]); + + } else { + $redcid = $warinfo[1][1]; + $redname = $warinfo[1][2]; + $redinfo = get_players($warinfo[1][1]); + $bluecid = $warinfo[0][1]; + $bluename = $warinfo[0][2]; + $blueinfo = get_players($warinfo[0][1]); + } + + echo'
+ + + + + + + + + + + + + '; + + $redcount = count($redinfo); + $bluecount = count($blueinfo); + + $sql_rteam = "SELECT p.id, pi.name FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND matchid = $id AND team = 0 ORDER BY pi.name ASC"; + + $q_rteam = mysql_query($sql_rteam); + while($r_rteam = mysql_fetch_array($q_rteam)) { + + echo' + + + '; + } + + echo''; + + + $sql_bteam = "SELECT p.id, pi.name FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND matchid = $id AND team = 1 ORDER BY pi.name ASC"; + + $q_bteam = mysql_query($sql_bteam); + while($r_bteam = mysql_fetch_array($q_bteam)) { + + echo' + + + '; + } + + echo' + + +
+ Clan and Player Info for Clanbase War ID '.$wid.'
+ '.$redname.'
'.$r_rteam[name].' +
+ '.$bluename.'
'.$r_bteam[name].' +
+ +
'; +} +?> \ No newline at end of file diff --git a/html/pages/servers.php b/html/pages/servers.php new file mode 100755 index 0000000..63d3721 --- /dev/null +++ b/html/pages/servers.php @@ -0,0 +1,74 @@ + $ecount2) { + $ecount2 = $ecount2+1; +} + +$fpage = 0; +IF($ecount < 1) { $lpage = 0; } +else { $lpage = $ecount2-1; } + +$cpage = preg_replace('/\D/', '', $_GET["page"]); +IF ($cpage == "") { $cpage = "0"; } +$qpage = $cpage*25; + +$tfpage = $cpage+1; +$tlpage = $lpage+1; + +$ppage = $cpage-1; +$ppageurl = "[Previous]"; +IF ($ppage < "0") { $ppageurl = "[Previous]"; } + +$npage = $cpage+1; +$npageurl = "[Next]"; +IF ($npage >= "$ecount") { $npageurl = "[Next]"; } + +$fpageurl = "[First]"; +IF ($cpage == "0") { $fpageurl = "[First]"; } + +$lpageurl = "[Last]"; +IF ($cpage == "$lpage") { $lpageurl = "[Last]"; } + +echo' +
Page ['.$tfpage.'/'.$tlpage.'] Selection: '.$fpageurl.' / '.$ppageurl.' / '.$npageurl.' / '.$lpageurl.'
+ + + + + + + + + + + + '; + +$sql_servers = "SELECT servername, serverip, COUNT(*) AS matchcount, SUM(frags) AS frags, SUM(t0score+t1score+t2score+t3score) AS matchscore, SUM(gametime) AS gametime +FROM uts_match GROUP BY servername, serverip ORDER BY servername ASC LIMIT $qpage,25"; +$q_servers = mysql_query($sql_servers) or die(mysql_error()); +while ($r_servers = mysql_fetch_array($q_servers)) { + + $r_gametime = sec2hour($r_servers[gametime]); + + echo' + + + + + + + + '; +} + +echo' +
Unreal Tournament Server List
Server NameStatusMatchesFragsTeamScoreHours
'.$r_servers[servername].'Server Status'.$r_servers[matchcount].''.$r_servers[frags].''.$r_servers[matchscore].''.$r_gametime.'
+
Page ['.$tfpage.'/'.$tlpage.'] Selection: '.$fpageurl.' / '.$ppageurl.' / '.$npageurl.' / '.$lpageurl.'
'; +?> \ No newline at end of file diff --git a/html/pages/servers_info.php b/html/pages/servers_info.php new file mode 100755 index 0000000..2548197 --- /dev/null +++ b/html/pages/servers_info.php @@ -0,0 +1,104 @@ + $ecount2) { + $ecount2 = $ecount2+1; +} + +$fpage = 0; +IF($ecount < 1) { $lpage = 0; } +else { $lpage = $ecount2-1; } + +$cpage = $_GET["page"]; +IF ($cpage == "") { $cpage = "0"; } +$qpage = $cpage*25; + +$tfpage = $cpage+1; +$tlpage = $lpage+1; + +$ppage = $cpage-1; +$ppageurl = "[Previous]"; +IF ($ppage < "0") { $ppageurl = "[Previous]"; } + +$npage = $cpage+1; +$npageurl = "[Next]"; +IF ($npage >= "$ecount") { $npageurl = "[Next]"; } + +$fpageurl = "[First]"; +IF ($cpage == "0") { $fpageurl = "[First]"; } + +$lpageurl = "[Last]"; +IF ($cpage == "$lpage") { $lpageurl = "[Last]"; } + + +// Get the last match entry for this server + +$serverinfo = small_query("SELECT time, servername, serverinfo, gameinfo, mutators FROM uts_match WHERE serverip = '$serverip' ORDER BY time DESC LIMIT 0,1"); +$matchdate = mdate($serverinfo[time]); + +echo' + + + + + + + + + + + + + + + + + + +
'.$serverinfo[servername].'
Last Match'.$matchdate.'Game Info
Server Info'.$serverinfo[serverinfo].''.$serverinfo[gameinfo].'
Mutators'.$serverinfo[mutators].'
+
'; + +// Do graph stuff +$bgwhere = "serverip = '$serverip'"; +include("pages/graph_mbreakdown.php"); + +echo'
Page ['.$tfpage.'/'.$tlpage.'] Selection: '.$fpageurl.' / '.$ppageurl.' / '.$npageurl.' / '.$lpageurl.'
+ + + + + + + + + + '; + +$sql_recent = "SELECT m.id, m.time, g.name AS gamename, m.mapfile, m.gametime FROM uts_match AS m, uts_games AS g WHERE g.id = m.gid AND m.serverip = '$serverip' ORDER BY m.time DESC LIMIT $qpage,25"; +$q_recent = mysql_query($sql_recent) or die(mysql_error()); +while ($r_recent = mysql_fetch_array($q_recent)) { + + $r_time = mdate($r_recent[time]); + $r_mapfile = un_ut($r_recent[mapfile]); + $r_gametime = sec2min($r_recent[gametime]); + $myurl = urlencode($r_mapfile); + + echo' + + + + + + '; +} + +echo' +
Unreal Tournament Match List
Date/TimeMatch TypeMapTime
'.$r_time.''.$r_recent[gamename].''.$r_mapfile.''.$r_gametime.'
+
Page ['.$tfpage.'/'.$tlpage.'] Selection: '.$fpageurl.' / '.$ppageurl.' / '.$npageurl.' / '.$lpageurl.'
'; +?> \ No newline at end of file diff --git a/html/pages/servers_query.php b/html/pages/servers_query.php new file mode 100755 index 0000000..95265c6 --- /dev/null +++ b/html/pages/servers_query.php @@ -0,0 +1,176 @@ +\n"; + exit; +} + +fputs($sock,"\\status\\\player_property\Health\\\game_property\ElapsedTime\\\game_property\RemainingTime\\"); + +$gotfinal = False; +$data = ""; + +//Set starttime, for possible loop expiration, so the server doesn't get too much work. +$starttime = Time(); + +//Loop until final packet has been received. +while(!($gotfinal == True || feof($sock))) { + + //Get data + if(($buf = fgetc($sock)) == FALSE) { + usleep(100); // wait for additional data? :S whatever + } + + //Add to databuffer + $data .= $buf; + + //Check if final item (queryid) has been received + if (strpos($data,"final\\") != False) { + $gotfinal = True; + } + + //Protect webserver against massive loop. + if ((Time() - $starttime) > 5) { + echo "Data receiving took too long. Cancelled.

"; + $gotfinal = True; + } +} + +//Close socket +fclose ($sock); + + +//Split chunks by \ +$chunks = split('[\]', $data); + +$mappic = strtolower("images/maps/".$map.".jpg"); + +if (file_exists($mappic)) { +} else { + $mappic = ("images/maps/blank.jpg"); +} + +$mapname = getiteminfo("mapname",$chunks); +$mappic = strtolower("images/maps/".$mapname.".jpg"); +IF (file_exists($mappic)) { + } else { + $mappic = "images/maps/blank.jpg"; +} + +$r_hostname = getiteminfo("hostname",$chunks); +$r_gametype = getiteminfo("gametype",$chunks); + +$r_adminname = getiteminfo("adminname",$chunks); +$r_adminemail = getiteminfo("adminemail",$chunks); + +$r_password = getiteminfo("password",$chunks); +$r_timelimit = getiteminfo("timelimit",$chunks); +$r_remainingtime = GetMinutes(getiteminfo("RemainingTime",$chunks)) . " mins"; +$r_elapsedtime = GetMinutes(getiteminfo("ElapsedTime",$chunks)) . " mins"; + +$r_goalteamscore = getiteminfo("goalteamscore",$chunks); +$r_numplayers = getiteminfo("numplayers",$chunks); +$r_minplayers = getiteminfo("minplayers",$chunks); +$r_maxplayers = getiteminfo("maxplayers",$chunks); +$r_maxteams = getiteminfo("maxteams",$chunks); + +$r_balanceteams = getiteminfo("balanceteams",$chunks); +$r_tournament = getiteminfo("tournament",$chunks); +$r_friendlyfire = getiteminfo("friendlyfire",$chunks); +$r_gamestyle = getiteminfo("gamestyle",$chunks); + +echo' + + + + + + + + + + + + + + + + + + + + + + + + + +
Server Status for '.$r_hostname.'
Server IP'.$serverip.':'.$serverport.''.$mapname.'
Map Name'.$mapname.'
Match Type'.$r_gametype.'
Server InfoAdmin: '.$r_adminname.'
Email: '.$r_adminemail.'
Game Info + Goal Team Score: '.$r_goalteamscore.'
+ Min Players: '.$r_minplayers.'
+ Max Players: '.$r_maxplayers.'
+ Max Teams: '.$r_maxteams.'
+ Balanced Teams: '.$r_balanceteams.'
+ Tournament Mode: '.$r_tournament.'
+ Friendly Fire: '.$r_friendlyfire.'
+ Game Style: '.$r_gamestyle.'

+ Time Limit: '.$r_timelimit.'
+ Time Remaining: '.$r_remainingtime.'
+ Time Elapsed: '.$r_elapsedtime.'
+ Password Required: '.$r_password.'
+
+
+ + + + + + + + + + + + + '; + +//Loop through all players +for ($i = 0; $i < $r_numplayers; $i++) { + $actualid = $i; + $itemx = $i+1; + + $r_playername = getiteminfo("player_" . $actualid,$chunks); + $r_playerfrags = getiteminfo("frags_" . $actualid,$chunks); + $r_playerteam = getiteminfo("team_" . $actualid,$chunks); + $r_playerping = getiteminfo("ping_" . $actualid,$chunks); + $r_playerhealth = getiteminfo("Health_" . $itemx,$chunks); + + echo' + + + + + + '; +} + +echo'
Player Information
PlayerFragsTeamPingHealth
'.$r_playername.''.$r_playerfrags.''.$r_playerteam.''.$r_playerping.''.$r_playerhealth.'
'; +?> \ No newline at end of file diff --git a/html/pages/totals.php b/html/pages/totals.php new file mode 100755 index 0000000..64acedd --- /dev/null +++ b/html/pages/totals.php @@ -0,0 +1,606 @@ + + + Totals Summary + + +
+ + + + + + + + + + + + + + '; + +$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"; +$q_totsumm = mysql_query($sql_totsumm) or die(mysql_error()); +while ($r_totsumm = zero_out(mysql_fetch_array($q_totsumm))) { + + $gametime = sec2hour($r_totsumm[sumgametime]); + + echo' + + + + + + + + + + '; +} + +$sql_summtot = zero_out(small_query("SELECT SUM(gamescore) AS gamescore, SUM(frags) AS frags, SUM(kills) AS kills, SUM(suicides) AS suicides, SUM(teamkills) AS teamkills, COUNT(DISTINCT matchid) AS matchcount, SUM(gametime) AS sumgametime +FROM uts_player")); + +$gametime2 = sec2hour($sql_summtot[sumgametime]); + +echo' + + + + + + + + + + +
Summary
Game TypeScoreFragsKillsSuicidesTeam KillsMatchesHours
'.$r_totsumm[gamename].''.$r_totsumm[gamescore].''.$r_totsumm[frags].''.$r_totsumm[kills].''.$r_totsumm[suicides].''.$r_totsumm[teamkills].''.$r_totsumm[matchcount].''.$gametime.'
Totals'.$sql_summtot[gamescore].''.$sql_summtot[frags].''.$sql_summtot[kills].''.$sql_summtot[suicides].''.$sql_summtot[teamkills].''.$sql_summtot[matchcount].''.$gametime2.'
+
+ + + + + + + + + + + + + + + + + + + + '; + + $q_assgids = mysql_query("SELECT id FROM uts_games WHERE gamename LIKE '%Assault%';") or die(mysql_error()); + $assgids = array(); + while ($r_assgids = mysql_fetch_array($q_assgids)) { + $assgids[] = $r_assgids['id']; + } + $assquery = (count($assgids) > 0) ? 'SUM(IF (gid IN ('. implode(',', $assgids) .'), ass_obj, 0)) AS ass_obj' : '0 AS ass_obj'; + + $sql_cdatot = zero_out(small_query("SELECT SUM(dom_cp) AS dom_cp, $assquery, SUM(flag_taken) AS flag_taken, + SUM(flag_pickedup) AS flag_pickedup, SUM(flag_dropped) AS flag_dropped, SUM(flag_assist) AS flag_assist, SUM(flag_cover) AS flag_cover, + SUM(flag_seal) AS flag_seal, SUM(flag_capture) AS flag_capture, SUM(flag_kill)as flag_kill, + SUM(flag_return) AS flag_return FROM uts_player")); + + echo' + + + + + + + + + + + + + +
Assault, Domination and CTF Events Summary
Assault ObjectivesControl Point CapturesCapture The Flag
Flag TakesFlag PickupsFlag DropsFlag AssistsFlag CoversFlag SealsFlag CapturesFlag KillsFlag Returns
'.$sql_cdatot[ass_obj].''.$sql_cdatot[dom_cp].''.$sql_cdatot[flag_taken].''.$sql_cdatot[flag_pickedup].''.$sql_cdatot[flag_dropped].''.$sql_cdatot[flag_assist].''.$sql_cdatot[flag_cover].''.$sql_cdatot[flag_seal].''.$sql_cdatot[flag_capture].''.$sql_cdatot[flag_kill].''.$sql_cdatot[flag_return].'
+
+ + + + '; + +$sql_firstblood = zero_out(small_count("SELECT firstblood FROM uts_match WHERE firstblood != ''")); +$sql_multis = zero_out(small_query("SELECT SUM(spree_double) AS spree_double, SUM(spree_multi) AS spree_multi, SUM(spree_ultra) AS spree_ultra, SUM(spree_monster) AS spree_monster FROM uts_player")); +$sql_sprees = zero_out(small_query("SELECT 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")); + + echo' + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Special Events
Special/MultisSprees
First Blood'.$sql_firstblood.'Killing Spree'.$sql_sprees[spree_kill].'
Double Kills'.$sql_multis[spree_double].'Rampage'.$sql_sprees[spree_rampage].'
Multi Kills'.$sql_multis[spree_multi].'Dominating'.$sql_sprees[spree_dom].'
Ultra Kills'.$sql_multis[spree_ultra].'Unstoppable'.$sql_sprees[spree_uns].'
Monster Kills'.$sql_multis[spree_monster].'Godlike'.$sql_sprees[spree_god].'
+
'; + +include('includes/weaponstats.php'); +weaponstats(0, 0); + +echo'
+ + + + +
Totals for Players
'; + +// 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"); + +$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_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"); + +echo'
+ + + + + + + + + + + + '; +if ($sql_chighfrags and $sql_chighfrags[frags]) { + echo ' + + + + + + + '; +} +if ($sql_chighdeaths and $sql_chighdeaths[deaths]) { + echo ' + + + + + + + '; +} +if ($sql_chighkills and $sql_chighkills[kills]) { + echo ' + + + + + + + '; +} +if ($sql_chighsuicides and $sql_chighsuicides[suicides]) { + echo ' + + + + + + + '; +} +if ($sql_chighteamkills and $sql_chighteamkills[teamkills]) { + echo ' + + + + + + + '; +} +if ($sql_chigheff and $sql_chigheff[eff]) { + echo ' + + + + + + + '; +} +if ($sql_chighaccuracy and $sql_chighaccuracy[accuracy]) { + echo ' + + + + + + + '; +} +if ($sql_chighttl and $sql_chighttl[ttl]) { + echo ' + + + + + + + '; +} +if ($sql_chighflag_capture and $sql_chighflag_capture[flag_capture]) { + echo ' + + + + + + + '; +} +if ($sql_chighflag_kill and $sql_chighflag_kill[flag_kill]) { + echo ' + + + + + + + '; +} +if ($sql_chighdom_cp and $sql_chighdom_cp[dom_cp]) { + echo ' + + + + + + + '; +} +if ($sql_chighass_obj and $sql_chighass_obj[ass_obj]) { + echo ' + + + + + + + '; +} +if ($sql_chighspree_monster and $sql_chighspree_monster[spree_monster]) { + echo ' + + + + + + + '; +} +if ($sql_chighspree_god and $sql_chighspree_god[spree_god]) { + echo ' + + + + + + + '; +} +if ($sql_chighrank and $sql_chighrank[rank]) { + echo ' + + + + + + + '; +} +echo ' +
Career Highs
CategoryPlayerAmountHoursMatches
Frags'.FlagImage($sql_chighfrags['country'], false).' '.$sql_chighfrags[name].''.$sql_chighfrags[frags].''.sec2hour($sql_chighfrags[sumgametime]).''.$sql_chighfrags[mcount].'
Deaths'.FlagImage($sql_chighdeaths['country'], false).' '.$sql_chighdeaths[name].''.$sql_chighdeaths[deaths].''.sec2hour($sql_chighdeaths[sumgametime]).''.$sql_chighdeaths[mcount].'
Kills'.FlagImage($sql_chighkills['country'], false).' '.$sql_chighkills[name].''.$sql_chighkills[kills].''.sec2hour($sql_chighkills[sumgametime]).''.$sql_chighkills[mcount].'
Suicides'.FlagImage($sql_chighsuicides['country'], false).' '.$sql_chighsuicides[name].''.$sql_chighsuicides[suicides].''.sec2hour($sql_chighsuicides[sumgametime]).''.$sql_chighsuicides[mcount].'
Team Kills'.FlagImage($sql_chighteamkills['country'], false).' '.$sql_chighteamkills[name].''.$sql_chighteamkills[teamkills].''.sec2hour($sql_chighteamkills[sumgametime]).''.$sql_chighteamkills[mcount].'
Efficiency'.FlagImage($sql_chigheff['country'], false).' '.$sql_chigheff[name].''.get_dp($sql_chigheff[eff]).''.sec2hour($sql_chigheff[sumgametime]).''.$sql_chigheff[mcount].'
Accuracy'.FlagImage($sql_chighaccuracy['country'], false).' '.$sql_chighaccuracy[name].''.get_dp($sql_chighaccuracy[accuracy]).''.sec2hour($sql_chighaccuracy[sumgametime]).''.$sql_chighaccuracy[mcount].'
TTL'.FlagImage($sql_chighttl['country'], false).' '.$sql_chighttl[name].''.get_dp($sql_chighttl[ttl]).''.sec2hour($sql_chighttl[sumgametime]).''.$sql_chighttl[mcount].'
Flag Caps'.FlagImage($sql_chighflag_capture['country'], false).' '.$sql_chighflag_capture[name].''.$sql_chighflag_capture[flag_capture].''.sec2hour($sql_chighflag_capture[sumgametime]).''.$sql_chighflag_capture[mcount].'
Flag Kills'.FlagImage($sql_chighflag_kill['country'], false).' '.$sql_chighflag_kill[name].''.$sql_chighflag_kill[flag_kill].''.sec2hour($sql_chighflag_kill[sumgametime]).''.$sql_chighflag_kill[mcount].'
Domination Control Points'.FlagImage($sql_chighdom_cp['country'], false).' '.$sql_chighdom_cp[name].''.$sql_chighdom_cp[dom_cp].''.sec2hour($sql_chighdom_cp[sumgametime]).''.$sql_chighdom_cp[mcount].'
Assault Objectives'.FlagImage($sql_chighass_obj['country'], false).' '.$sql_chighass_obj[name].''.$sql_chighass_obj[ass_obj].''.sec2hour($sql_chighass_obj[sumgametime]).''.$sql_chighass_obj[mcount].'
Monster Kills'.FlagImage($sql_chighspree_monster['country'], false).' '.$sql_chighspree_monster[name].''.$sql_chighspree_monster[spree_monster].''.sec2hour($sql_chighspree_monster[sumgametime]).''.$sql_chighspree_monster[mcount].'
Godlikes'.FlagImage($sql_chighspree_god['country'], false).' '.$sql_chighspree_god[name].''.$sql_chighspree_god[spree_god].''.sec2hour($sql_chighspree_god[sumgametime]).''.$sql_chighspree_god[mcount].'
Rank Points'.FlagImage($sql_chighrank['country'], false).' '.$sql_chighrank[name].''.get_dp($sql_chighrank[rank]).''.sec2hour($sql_chighrank[sumgametime]).''.$sql_chighrank[mcount].'
+
'; + + +// 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"); + +$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"); +} 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"); + +echo' + + + + + + + + + + '; + +if ($sql_mhighfrags) { + echo ' + + + + + + '; +} +if ($sql_mhighdeaths) { + echo ' + + + + + + '; +} +if ($sql_mhighkills) { + echo ' + + + + + + '; +} +if ($sql_mhighsuicides) { + echo ' + + + + + + '; +} +if ($sql_mhighteamkills) { + echo ' + + + + + + '; +} +if ($sql_mhigheff) { + echo ' + + + + + + '; +} +if ($sql_mhighaccuracy) { + echo ' + + + + + + '; +} +if ($sql_mhighttl) { + echo ' + + + + + + '; +} +if ($sql_mhighflag_capture) { + echo ' + + + + + + '; +} +if ($sql_mhighflag_kill) { + echo ' + + + + + + '; +} +if ($sql_mhighdom_cp) { + echo ' + + + + + + '; +} +if ($sql_mhighass_obj) { + echo ' + + + + + + '; +} +if ($sql_mhighspree_monster) { + echo ' + + + + + + '; +} +if ($sql_mhighspree_god) { + echo ' + + + + + + '; +} +if ($sql_mhighrank) { + echo ' + + + + + + '; +} +echo ' +
Match Highs
CategoryPlayerAmountMatch
Frags'.FlagImage($sql_mhighfrags['country'], false).' '.$sql_mhighfrags[name].''.$sql_mhighfrags[frags].'(click)
Deaths'.FlagImage($sql_mhighdeaths['country'], false).' '.$sql_mhighdeaths[name].''.$sql_mhighdeaths[deaths].'(click)
Kills'.FlagImage($sql_mhighkills['country'], false).' '.$sql_mhighkills[name].''.$sql_mhighkills[kills].'(click)
Suicides'.FlagImage($sql_mhighsuicides['country'], false).' '.$sql_mhighsuicides[name].''.$sql_mhighsuicides[suicides].'(click)
Team Kills'.FlagImage($sql_mhighteamkills['country'], false).' '.$sql_mhighteamkills[name].''.$sql_mhighteamkills[teamkills].'(click)
Efficiency'.FlagImage($sql_mhigheff['country'], false).' '.$sql_mhigheff[name].''.get_dp($sql_mhigheff[eff]).'(click)
Accuracy'.FlagImage($sql_mhighaccuracy['country'], false).' '.$sql_mhighaccuracy[name].''.get_dp($sql_mhighaccuracy[accuracy]).'(click)
TTL'.FlagImage($sql_mhighttl['country'], false).' '.$sql_mhighttl[name].''.get_dp($sql_mhighttl[ttl]).'(click)
Flag Caps'.FlagImage($sql_mhighflag_capture['country'], false).' '.$sql_mhighflag_capture[name].''.$sql_mhighflag_capture[flag_capture].'(click)
Flag Kills'.FlagImage($sql_mhighflag_kill['country'], false).' '.$sql_mhighflag_kill[name].''.$sql_mhighflag_kill[flag_kill].'(click)
Domination Control Points'.FlagImage($sql_mhighdom_cp['country'], false).' '.$sql_mhighdom_cp[name].''.$sql_mhighdom_cp[dom_cp].'(click)
Assault Objectives'.FlagImage($sql_mhighass_obj['country'], false).' '.$sql_mhighass_obj[name].''.$sql_mhighass_obj[ass_obj].'(click)
Monster Kills'.FlagImage($sql_mhighspree_monster['country'], false).' '.$sql_mhighspree_monster[name].''.$sql_mhighspree_monster[spree_monster].'(click)
Godlikes'.FlagImage($sql_mhighspree_god['country'], false).' '.$sql_mhighspree_god[name].''.$sql_mhighspree_god[spree_god].'(click)
Rank Points'.FlagImage($sql_mhighrank['country'], false).' '.$sql_mhighrank[name].''.get_dp($sql_mhighrank[rank]).'(click)
+
+ + + + + + + + + + + +'; + +$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)) { + + $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 ' + + + + + '; + + } +} + +echo '
Weapon Career Highs
CategoryPlayerKillsMatches
'.$r_mweapons[name].''.FlagImage($r_mweaponsl[country], false).' '.$r_mweaponsl[name].''.$r_mweaponsl[kills].''.$r_mweaponsl[mcount].'
+
'; + +// NGStats Style Weapon Highs (All Time) + +echo ' + + + + + + + + + + +'; + +$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)) { + + $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 ' + + + + + '; + } +} + +// NGStats Style Weapon Highs (Single Match) +echo'
Weapon Match Highs
CategoryPlayerKillsMatch
'.$r_mweapons[name].''.FlagImage($r_mweaponsl[country], false).' '.$r_mweaponsl[name].''.$r_mweaponsl[kills].'(click)
'; +?> diff --git a/html/pages/watchlist.php b/html/pages/watchlist.php new file mode 100755 index 0000000..bfc8512 --- /dev/null +++ b/html/pages/watchlist.php @@ -0,0 +1,106 @@ + + + Your Watchlist + +'; +echo '


'; + + +$watchlist = GetCurrentWatchlist(); +if (count($watchlist) > 25) $watchlist = array_slice($watchlist, 0, 25); +if (count($watchlist) == 0) { + echo "

Your watchlist is empty!

You can add players to your watchlist by clicking the appropriate icon on the header of their career summary page.

"; + return; +} + +echo ' + + + + + + + + + + + + + + + + '; + + +$i = 0; +foreach($watchlist as $pid) { + $sql_players = "SELECT pi.id AS pid, + pi.name, + pi.country, + m.time, + m.id AS mid + FROM uts_pinfo pi, + uts_match m, + uts_player p + WHERE pi.id = '$pid' + AND p.matchid = m.id + AND p.pid = pi.id + ORDER BY m.time DESC + LIMIT 0,1 + "; + + $sql_pinfo = " SELECT COUNT(*) AS games, + SUM(p.gamescore) as gamescore, + SUM(p.frags) AS frags, + SUM(p.kills) AS kills, + SUM(p.deaths) AS deaths, + SUM(p.suicides) as suicides, + AVG(p.eff) AS eff, + AVG(p.accuracy) AS accuracy, + AVG(p.ttl) AS ttl, + SUM(gametime) as gametime + FROM uts_player AS p + WHERE p.pid = '$pid' + GROUP BY p.pid"; + $r_pinfo = small_query($sql_pinfo); + + $q_players = mysql_query($sql_players) or die(mysql_error()); + + + while ($r_players = mysql_fetch_array($q_players)) { + $i++; + $new = (mtimestamp($r_players['time']) > $s_lastvisit) ? true : false; + $class = ($i % 2) ? 'grey' : 'grey2'; + echo ''; + echo ''; + echo ''; + + echo ' + + + + + + + + + + '; + + echo ''; + } +} + +echo '
Player NameLast MatchMatchesScoreFragsKillsDeathsSuicidesEffAccTTLHours
'; + echo FormatPlayerName($r_players['country'], $r_players['pid'], $r_players['name']); + echo '';; + if ($new) echo ""; + echo date("Y-m-d H:i", mtimestamp($r_players['time'])); + if ($new) echo ""; + echo ''.$r_pinfo['games'].''.$r_pinfo['gamescore'].''.$r_pinfo['frags'].''.$r_pinfo['kills'].''.$r_pinfo['deaths'].''.$r_pinfo['suicides'].''.get_dp($r_pinfo['eff']).''.get_dp($r_pinfo['accuracy']).''.GetMinutes($r_pinfo['ttl']).''.sec2hour($r_pinfo['gametime']).'
'; + + +?> -- cgit