summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthijs Kuiper <info@matthijskuiper.nl>2018-01-08 16:30:56 +0100
committerMatthijs Kuiper <info@matthijskuiper.nl>2018-01-09 00:44:09 +0100
commitd0102c6fd4b188b0a1c5ffd3bf9a834a64a5c709 (patch)
treeeb8a66085ca7cd2b994497c1d14a6dded7dbf59f
parent790d93b495ecc375ea0518a5f43f2944daa9720b (diff)
Match info
-rwxr-xr-xhtml/includes/config.php6
-rwxr-xr-xhtml/includes/functions.php138
-rwxr-xr-xhtml/includes/teamstats.php101
-rwxr-xr-xhtml/pages/match_info.php48
-rw-r--r--html/pages/match_info_charts.php65
-rwxr-xr-xhtml/pages/match_info_server.php162
6 files changed, 249 insertions, 271 deletions
diff --git a/html/includes/config.php b/html/includes/config.php
index 77d42fa..55b9ffe 100755
--- a/html/includes/config.php
+++ b/html/includes/config.php
@@ -1,9 +1,9 @@
<?php
// Database connection details
-$dbname = "";
-$hostname = "";
-$uname = "";
+$dbname = "utstats";
+$hostname = "localhost";
+$uname = "root";
$upass = "";
// The key needed to run the import script
diff --git a/html/includes/functions.php b/html/includes/functions.php
index b8cab68..005a3c1 100755
--- a/html/includes/functions.php
+++ b/html/includes/functions.php
@@ -34,16 +34,16 @@ require_once(dirname(__FILE__) .'/countries.php');
// Addslashes if magic_quotes are off
function my_addslashes($data) {
if (!get_magic_quotes_gpc()) {
- $data = addslashes($data);
+ $data = addslashes($data);
}
return $data;
}
function my_stripslashes($data) {
if (!get_magic_quotes_gpc()) {
- $data = $data;
+ $data = $data;
} else {
- $data = stripslashes($data);
+ $data = stripslashes($data);
}
return $data;
}
@@ -84,14 +84,14 @@ function my_fopen($filename, $mode, &$compression) {
if (substr($filename, -4) == '.bz2') {
if (check_extension('bz2')) {
$compression = 'bz2';
- } else {
+ } else {
return(false);
}
}
if (substr($filename, -3) == '.gz') {
if (check_extension('zlib')) {
$compression = 'zlib';
- } else {
+ } else {
return(false);
}
}
@@ -162,14 +162,12 @@ function get_dp($number) {
function sec2min($number) {
$dp = $number/60;
-
$dp = number_format($dp, 2, '.', '');
return ($dp);
}
function sec2hour($number) {
$dp = $number/3600;
-
$dp = number_format($dp, 2, '.', '');
return ($dp);
}
@@ -250,13 +248,12 @@ function btcaptime($time) {
function GetItemInfo ($itemname, $itemchunks) {
$retval = "N/A";
for ($i = 0; $i < count($itemchunks); $i++) {
- //Found this item
- if (strcasecmp($itemchunks[$i], $itemname) == 0) {
- $retval = $itemchunks[$i+1];
- }
+ //Found this item
+ if (strcasecmp($itemchunks[$i], $itemname) == 0) {
+ $retval = $itemchunks[$i+1];
+ }
}
-
- return $retval;
+ return $retval;
}
function GetMinutes($seconds) {
@@ -271,8 +268,8 @@ function GetMinutes($seconds) {
function FlagImage($country, $mini = true) {
global $a_countries;
- $width = ($mini) ? 15 : 18;
- $height = ($mini) ? 10 : 12;
+ $width = ($mini) ? 20 : 20;
+ $height = ($mini) ? 14 : 14;
if (empty($country)) return('');
if (!file_exists("images/flags/$country.png")) return(''); //18*12
$countryname = (isset($a_countries[$country])) ? $a_countries[$country] : '';
@@ -304,43 +301,39 @@ function RankMovement($diff) {
}
function ordinal($number) {
- // when fed a number, adds the English ordinal suffix. Works for any
- // number, even negatives
-
- if ($number % 100 > 10 && $number %100 < 14):
+ // when fed a number, adds the English ordinal suffix. Works for any number, even negatives
+ if ($number % 100 > 10 && $number %100 < 14) {
+ $suffix = "th";
+ } else {
+ switch($number % 10) {
+ case 0:
$suffix = "th";
- else:
- switch($number % 10) {
-
- case 0:
- $suffix = "th";
- break;
-
- case 1:
- $suffix = "st";
- break;
+ break;
- case 2:
- $suffix = "nd";
- break;
+ case 1:
+ $suffix = "st";
+ break;
- case 3:
- $suffix = "rd";
- break;
+ case 2:
+ $suffix = "nd";
+ break;
- default:
- $suffix = "th";
- break;
- }
+ case 3:
+ $suffix = "rd";
+ break;
- endif;
+ default:
+ $suffix = "th";
+ break;
+ }
+ }
- return $suffix;
+ return $suffix;
}
function RankImageOrText($pid, $name, $rank, $gid, $gamename, $mini = true, $format = NULL, $rankchange = NULL) {
-
$points = 0;
+
if (empty($rank)) {
$r_rank = small_query("SELECT rank FROM uts_rank WHERE pid = '$pid' AND gid= '$gid';");
if (!$r_rank) return('');
@@ -351,12 +344,13 @@ function RankImageOrText($pid, $name, $rank, $gid, $gamename, $mini = true, $for
$ranktext = $rank.ordinal($rank);
if (file_exists("images/ranks/$rank.png")) {
- $width = ($mini) ? 14 : 16;
- $height = ($mini) ? 10 : 13;
- $img = '<img src="images/ranks/'. $rank .'.png" width="'.$width.'" height="'.$height.'" style="border:0;" alt="'. $rank .'" title="'. $ranktext .' in '. $gamename .'">';
+ $width = ($mini) ? 15 : 15;
+ $height = ($mini) ? 12 : 12;
+ $img = '<img class="tooltip" src="images/ranks/'. $rank .'.png" width="17" height="17" style="border:0; margin-bottom: -4px;" alt="'. $rank .'" title="'. $ranktext .' in '. $gamename .'">';
} else {
$img = '';
}
+
$moveimg = '';
if ($rankchange !== NULL) {
$moveimg = ' '. RankMovement($rankchange);
@@ -369,6 +363,7 @@ function RankImageOrText($pid, $name, $rank, $gid, $gamename, $mini = true, $for
return('<span class="rangtext">('.$ranktext.$moveimg.')</span>');
}
}
+
$imageortext = ($img) ? $img : $ranktext;
$search = array('%RT%', '%RN%', '%RP%', '%RI%', '%GN%', '%PN%', '%IT%');
$replace = array($ranktext, $rank, $points, $img, $gamename, $name, $imageortext);
@@ -418,8 +413,10 @@ function debug_output($desc, $data) {
for ($i = 0; $i < $len; $i++) {
echo substr($data, $i, 1) .' ';
}
+
echo "\n";
echo str_repeat(' ', (strlen($desc) + 2));
+
for ($i = 0; $i < $len; $i++) {
echo ord(substr($data, $i, 1)) .' ';
}
@@ -433,7 +430,6 @@ function check_extension($name) {
return(@dl($prefix . $name . PHP_SHLIB_SUFFIX));
}
-
function compress_file($method, $in, $out, $stripx00) {
if ((!file_exists($out) and !is_writeable(dirname($out))) or (file_exists($out) and !is_writable($out))) return(false);
$blocksize = 8192;
@@ -469,16 +465,18 @@ function compress_file($method, $in, $out, $stripx00) {
}
@fclose($fp_in);
+
switch($method) {
case 'bz2': @bzclose($fp_out); break;
case 'zlib': @gzclose($fp_out); break;
- case 'none': @fclose($fp_out); break;
+ case 'none': @fclose($fp_out); break;
}
+
return(true);
}
function backup_logfile($method, $filename, $backupfilename, $stripx00) {
- switch($method) {
+ switch ($method) {
case 'compress':
if (!check_extension('bz2') or !compress_file('bz2', $filename, $backupfilename, $stripx00)) {
return(backup_logfile('gzip', $filename, $backupfilename, $stripx00));
@@ -528,11 +526,10 @@ function purge_backups($dir, $maxage) {
unlink($cna);
$deleted++;
}
-
}
closedir($dh);
- return($deleted);
+ return $deleted;
}
function file_size_info($filesize) {
@@ -551,12 +548,12 @@ function GetCurrentWatchlist() {
foreach($watchlist as $key => $value) {
$watchlist[$key] = addslashes($value);
}
- return($watchlist);
+ return $watchlist;
}
function PlayerOnWatchlist($pid) {
$watchlist = GetCurrentWatchlist();
- return(in_array($pid, $watchlist));
+ return in_array($pid, $watchlist);
}
function ToggleWatchStatus($pid) {
@@ -570,21 +567,48 @@ function ToggleWatchStatus($pid) {
$watchlist[] = $pid;
$status = 1;
}
- setcookie('uts_watchlist', implode(',',$watchlist), time()+60*60*24*30*365*5);
- return($status);
+
+ setcookie('uts_watchlist', implode(',', $watchlist), time() + 60*60*24*30*365*5);
+ return $status;
}
function DeBugMessage($message) {
global $debug, $html;
- if(!$debug) {
+
+ if (!$debug) {
return;
}
- if ($html) echo '<table class="box" border="0"><tr><td class="smheading" width="550">';
+ if ($html) echo '<table class="zebra box" border="0"><tr><th class="smheading" width="550">';
echo "Debugging Output:\n";
- if ($html) echo '</td></tr><tr><td width="550" align="left"><pre>';
+ if ($html) echo '</th></tr><tr><td width="550" align="left"><pre>';
echo $message . "\n";
if ($html) echo '</pre></td></tr></table><br><br>';
}
+function getMapImageName($mapname) {
+ for ($i=0; $i<3; $i++) {
+ // try substracting modname from map
+ if ($i == 1) {
+ if(($x_pos = strpos($mapname, '-')) !== false) {
+ $mapname = substr($mapname, $x_pos + 1);
+ }
+ }
+
+ // try also substracting league names from map
+ if ($i==2) {
+ $mapVersions = array('CB1','CB2','CB3','CB4','CB5','CB6','CB7','CB','LE13','LE14','LE15','LE16','LE17','LE18','LE19','LE','-DE13','-DE14','-DE15','-DE16','-DE17','-DE18','-DE19','v2','v3','v4','v5','-MLIG','-GU','-SDOM','-][ugn','-ugn','ALT2lightedit','-LE102','-','LE100','LE101','LE102','LE103','LE104','LE105','-v17','test3C','Fixed','XL','DM','MLTDM');
+ $mapname = str_replace($mapVersions, "", $mapname);
+ }
+
+ $mappic = strtolower("images/maps/" . $mapname . "_large.jpg");
+
+ if(file_exists(dirname(dirname(__FILE__)) . "/" . $mappic)) {
+ return $mappic;
+ }
+ }
+
+ return "images/maps/blank_large.jpg";
+}
+
?>
diff --git a/html/includes/teamstats.php b/html/includes/teamstats.php
index fd06ead..b2116b9 100755
--- a/html/includes/teamstats.php
+++ b/html/includes/teamstats.php
@@ -1,8 +1,10 @@
<?php
function teamstats($mid, $title, $extra = NULL, $extratitle = NULL, $order = 'gamescore DESC') {
global $gamename, $gid;
+
$r_info = small_query("SELECT teamgame, t0score, t1score, t2score, t3score FROM uts_match WHERE id = '$mid'");
if (!$r_info) die("Match not found");
+
$teams = ($r_info['teamgame'] == 'True') ? true : false;
$teamscore[-1] = 0;
$teamscore[0] = $r_info['t0score'];
@@ -10,31 +12,29 @@ function teamstats($mid, $title, $extra = NULL, $extratitle = NULL, $order = 'ga
$teamscore[2] = $r_info['t2score'];
$teamscore[3] = $r_info['t3score'];
-
$cols = 10;
if ($teams) $cols++;
if ($extra) $cols++;
-
$oldteam = -1;
-
echo'
- <table class = "box" border="0" cellpadding="0" cellspacing="2" width="600">
- <tbody><tr>
- <td class="heading" colspan="'.$cols.'" align="center">'.htmlentities($title).'</td>
- </tr>';
-
+ <table class="box zebra" border="0" cellpadding="0" cellspacing="0" width="700">
+ <tbody>
+ <tr>
+ <th class="heading" colspan="'.$cols.'" align="center">'.htmlentities($title).'</th>
+ </tr>';
$sql_players = "SELECT pi.name, pi.banned, 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".(($extra) ? ', p.'.$extra.' AS '.$extra : '')."
- FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND matchid = $mid
- ORDER BY".(($teams) ? ' team ASC,' : '')." $order";
+ FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND matchid = $mid
+ ORDER BY".(($teams) ? ' team ASC,' : '')." $order";
$q_players = mysql_query($sql_players) or die(mysql_error());
$header = true;
teamstats_init_totals($totals, $num);
+
while ($r_players = zero_out(mysql_fetch_array($q_players))) {
$r_players['dom_cp'] = $r_players['gamescore'] - $r_players['frags'];
-
$r_players['team'] = intval($r_players['team']);
+
if ($teams and $oldteam != $r_players['team']) {
if ($r_players['team'] != 0) teamstats_team_totals($totals, $num, $teams, $extra, $teamscore[$oldteam]);
$oldteam = $r_players['team'];
@@ -46,27 +46,29 @@ function teamstats($mid, $title, $extra = NULL, $extratitle = NULL, $order = 'ga
case 2: $teamname = 'Green'; break;
case 3: $teamname = 'Gold'; break;
}
- echo'<tr><td class="hlheading" colspan="'.$cols.'" align="center">Team: '.$teamname.'</td></tr>';
+
+ echo'<tr><td class="'.$teamname.'" colspan="'.$cols.'" align="center">Team: '.$teamname.'</td></tr>';
$header = true;
}
+
if ($header) {
$header = false;
echo '
<tr>
- <td class="smheading" align="center">Player</td>
- <td class="smheading" align="center" width="50">Time</td>
- <td class="smheading" align="center" width="50">Score</td>';
- if ($extra) echo' <td class="smheading" align="center" width="50">'.htmlentities($extratitle).'</td>';
+ <th class="smheading" align="center">Player</th>
+ <th class="smheading" align="center" width="50">Time</th>
+ <th class="smheading" align="center" width="50">Score</th>';
+ if ($extra) echo '<th class="smheading" align="center" width="50">'.htmlentities($extratitle).'</th>';
echo'
- <td class="smheading" align="center" width="40" '.OverlibPrintHint('F').'>F</td>
- <td class="smheading" align="center" width="40" '.OverlibPrintHint('K').'>K</td>
- <td class="smheading" align="center" width="40" '.OverlibPrintHint('D').'>D</td>
- <td class="smheading" align="center" width="40" '.OverlibPrintHint('S').'>S</td>';
- if ($teams) echo '<td class="smheading" align="center" width="40" '.OverlibPrintHint('TK').'>TK</td>';
+ <th class="smheading tooltip" align="center" width="40" title="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.">F</th>
+ <th class="smheading tooltip" align="center" width="40" title="Kills: Number of times a player kills another player.">K</th>
+ <th class="smheading tooltip" align="center" width="40" title="Deaths: Number of times a player gets killed by another player.">D</th>
+ <th class="smheading tooltip" align="center" width="40" title="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).">S</th>';
+ if ($teams) echo '<th class="smheading tooltip" align="center" width="40" title="Team Kills: Number of times a player in a team based game kills someone on their own team.">TK</th>';
echo '
- <td class="smheading" align="center" width="55" '.OverlibPrintHint('EFF').'>Eff.</td>
- <td class="smheading" align="center" width="55" '.OverlibPrintHint('ACC').'>Acc.</td>
- <td class="smheading" align="center" width="50" '.OverlibPrintHint('TTL').'>Avg TTL</td>
+ <th class="smheading tooltip" align="center" width="55" title="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])">Eff.</th>
+ <th class="smheading tooltip" align="center" width="55" title="Accuracy: Overall accuracy when using all weapons. Most accurate in insta but also very accurate in normal weapons.">Acc.</th>
+ <th class="smheading tooltip" align="center" width="50" title="Average Time to Live: The length of time a player is in a game in seconds divided by how many times he/she dies, thus giving an average time of how long he/she will live.">Avg TTL</th>
</tr>';
}
@@ -87,7 +89,7 @@ function teamstats($mid, $title, $extra = NULL, $extratitle = NULL, $order = 'ga
$totals['acc'] += $r_players['accuracy'];
$totals['ttl'] += $r_players['ttl'];
$num++;
-
+
if ($r_players['banned'] == 'Y') {
$eff = '-';
$acc = '-';
@@ -101,15 +103,16 @@ function teamstats($mid, $title, $extra = NULL, $extratitle = NULL, $order = 'ga
$r_players['teamkills'] = '-';
}
-
$class = ($num % 2) ? 'grey' : 'grey2';
- echo '<tr>';
+ echo '<tr class="clickableRow" href="./?p=matchp&amp;mid='.$mid.'&amp;pid='.$r_players['pid'].'">';
+
if ($r_players['banned'] != 'Y') {
- echo '<td nowrap class="darkhuman" align="left"><a class="darkhuman" href="./?p=matchp&amp;mid='.$mid.'&amp;pid='.$r_players['pid'].'">'.FormatPlayerName($r_players['country'], $r_players['pid'], $r_players['name'], $gid, $gamename, true, $r_players['rank']).'</a></td>';
+ echo '<td nowrap align="left"><a href="./?p=matchp&amp;mid='.$mid.'&amp;pid='.$r_players['pid'].'">'.FormatPlayerName($r_players['country'], $r_players['pid'], $r_players['name'], $gid, $gamename, true, $r_players['rank']).'</a></td>';
} else {
- echo '<td nowrap class="darkhuman" align="left"><span style="text-decoration: line-through;">'.FormatPlayerName($r_players['country'], $r_players['pid'], $r_players['name'], $gid, $gamename, true, $r_players['rank']).'</span></td>';
+ echo '<td nowrap align="left"><span style="text-decoration: line-through;">'.FormatPlayerName($r_players['country'], $r_players['pid'], $r_players['name'], $gid, $gamename, true, $r_players['rank']).'</span></td>';
}
- echo '<td class="'.$class.'" align="center">'.GetMinutes($r_players['gametime']/TIMERATIO).'</td>';
+
+ echo '<td class="'.$class.'" align="center">'.GetMinutes($r_players['gametime'] / TIMERATIO).'</td>';
echo '<td class="'.$class.'" align="center">'.$r_players['gamescore'].'</td>';
if ($extra) echo '<td class="'.$class.'" align="center">'.$r_players[$extra].'</td>';
@@ -121,14 +124,15 @@ function teamstats($mid, $title, $extra = NULL, $extratitle = NULL, $order = 'ga
if ($teams) echo '<td class="'.$class.'" align="center">'.$r_players['teamkills'].'</td>';
- echo '<td class="'.$class.'" align="center">'.$eff.'</td>';
- echo '<td class="'.$class.'" align="center">'.$acc.'</td>';
- echo '<td class="'.$class.'" align="center">'.$ttl.'</td>';
+ echo '<td align="center">'.$eff.'</td>';
+ echo '<td align="center">'.$acc.'</td>';
+ echo '<td align="center">'.$ttl.'</td>';
echo '</tr>';
}
+
teamstats_team_totals($totals, $num, $teams, $extra, $teamscore[$oldteam]);
- echo '</tbody></table><br>';
+ echo '</tbody></table><br>';
}
function teamstats_init_totals(&$totals, &$num, $extra = null) {
@@ -151,27 +155,28 @@ function teamstats_team_totals(&$totals, $num, $teams, $extra, $teamscore) {
$acc = get_dp($totals['acc'] / $num);
$ttl = GetMinutes($totals['ttl'] / $num);
-
echo '<tr>';
- echo '<td nowrap class="dark" align="center">Totals</td>';
- echo '<td class="darkgrey" align="center"></td>';
+ echo '<td nowrap class="totals" align="center">Totals</td>';
+ echo '<td class="totals" align="center"></td>';
+
if ($teams) {
- echo '<td class="darkgrey" align="center"><strong>'.$teamscore.'</strong> ('.$totals[gamescore].')</td>';
+ echo '<td class="totals" align="center"><strong>'.$teamscore.'</strong> ('.$totals[gamescore].')</td>';
} else {
- echo '<td class="darkgrey" align="center">'.$totals[gamescore].'</td>';
+ echo '<td class="totals" align="center">'.$totals[gamescore].'</td>';
}
- if ($extra) echo '<td class="darkgrey" align="center">'.$totals[$extra].'</td>';
+ if ($extra) echo '<td class="totals" align="center">'.$totals[$extra].'</td>';
- echo '<td class="darkgrey" align="center">'.$totals[frags].'</td>';
- echo '<td class="darkgrey" align="center">'.$totals[kills].'</td>';
- echo '<td class="darkgrey" align="center">'.$totals[deaths].'</td>';
- echo '<td class="darkgrey" align="center">'.$totals[suicides].'</td>';
+ echo '<td class="totals" align="center">'.$totals[frags].'</td>';
+ echo '<td class="totals" align="center">'.$totals[kills].'</td>';
+ echo '<td class="totals" align="center">'.$totals[deaths].'</td>';
+ echo '<td class="totals" align="center">'.$totals[suicides].'</td>';
- if ($teams) echo '<td class="darkgrey" align="center">'.$totals[teamkills].'</td>';
+ if ($teams) echo '<td class="totals" align="center">'.$totals[teamkills].'</td>';
- echo '<td class="darkgrey" align="center">'.$eff.'</td>';
- echo '<td class="darkgrey" align="center">'.$acc.'</td>';
- echo '<td class="darkgrey" align="center">'.$ttl.'</td>';
+ echo '<td class="totals" align="center">'.$eff.'</td>';
+ echo '<td class="totals" align="center">'.$acc.'</td>';
+ echo '<td class="totals" align="center">'.$ttl.'</td>';
echo '</tr>';
}
+
?>
diff --git a/html/pages/match_info.php b/html/pages/match_info.php
index 31edc2d..8d77186 100755
--- a/html/pages/match_info.php
+++ b/html/pages/match_info.php
@@ -3,39 +3,46 @@ $r_info = small_query("SELECT teamgame, t0, t1, t2, t3, t0score, t1score, t2scor
if (!$r_info) die("Match not found");
$teamgame = ($r_info['teamgame'] == 'True') ? true : false;
-echo '
-<table class = "box" border="0" cellpadding="1" cellspacing="2" width="720">
- <tbody><tr>
- <td class="heading" align="center">Unreal Tournament Match</td>
- </tr>
-</tbody></table>
-<br>';
include("pages/match_info_server.php");
-include("pages/match_info_charts.php");
$GLOBALS['gid'] = $gid;
$_GLOBALS['gid'] = $gid;
$GLOBALS['gamename'] = $gamename;
$_GLOBALS['gamename'] = $gamename;
-include('includes/teamstats.php');
+include("includes/teamstats.php");
+include("pages/match_info_charts.php");
+echo "<h1>WOOOt<h1>";
+
switch($real_gamename) {
+
case "Assault":
case "Assault (insta)":
include("pages/match_info_ass.php");
break;
-
+
case "Capture the Flag":
case "Capture the Flag (insta)":
+ case "5v5 iCTF":
+ case "1v1 iCTF":
+ case "2v2 iCTF":
+ case "3v3 iCTF":
+ case "5v5 teleCTF":
+ case "5v5 saCTF":
+ case "5v5 nwCTF":
+ case "3v3 nwCTF":
include("pages/match_info_ctf.php");
teamstats($mid, 'Match Summary');
- break;
-
+ break;
+
case "Domination":
case "Domination (insta)":
+ case "4v4 iDOM":
+ case "4v4 sDOM":
+ case "4v4 nwDOM":
teamstats($mid, 'Match Summary', 'dom_cp', 'Dom Pts');
break;
-
+
case "JailBreak":
case "JailBreak (insta)":
teamstats($mid, 'Match Summary', 'ass_obj', 'Team Releases');
@@ -44,11 +51,13 @@ switch($real_gamename) {
case "Bunny Track":
include("pages/match_info_bt.php");
break;
-
+
case "Tournament DeathMatch":
case "Tournament Team Game":
case "Tournament DeathMatch (insta)":
case "Tournament Team Game (insta)":
+ case "FFA iDM":
+ case "2v2v2v2 iTDM":
teamstats($mid, 'Match Summary');
break;
@@ -66,21 +75,20 @@ switch($real_gamename) {
default:
if ($teamgame) {
teamstats($mid, 'Match Summary');
- } else {
+ } else {
teamstats($mid, 'Player Summary');
}
}
-
-if ($real_gamename == "Assault" or $real_gamename== "Assault (insta)") {
+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");
+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_charts.php b/html/pages/match_info_charts.php
index a6170e7..ed62fe5 100644
--- a/html/pages/match_info_charts.php
+++ b/html/pages/match_info_charts.php
@@ -11,15 +11,15 @@ $chartOutput = "";
$prevRenderedChart = "";
// get all charts for this match
-$charts = mysql_query("SELECT d.* , t.charttype, t.category, t.type, t.color, t.layout,t.columns
-FROM uts_chartdata d
-JOIN uts_charttypes t ON d.chartid = t.id
-WHERE d.mid = $mid
-ORDER BY d.id ASC") or die(mysql_error());
+$charts = mysql_query("SELECT d.* , t.charttype, t.category, t.type, t.color, t.layout,t.columns
+ FROM uts_chartdata d
+ JOIN uts_charttypes t ON d.chartid = t.id
+ WHERE d.mid = $mid
+ ORDER BY d.id ASC") or die(mysql_error());
$chartCount = mysql_num_rows($charts);
-if($chartCount >0) {
+if ($chartCount >0) {
$i = 0;
// cycle over charts
@@ -36,50 +36,47 @@ if($chartCount >0) {
$data = unserialize(gzdecode($chart['data']));
$labels = unserialize(gzdecode($chart['labels']));
$categories = unserialize(gzdecode($chart['categories']));
-
+
// append previous chart - this is done to ensure proper outlining (can only know in +1 round)
$chartOutput .= $prevRenderedChart;
-
+
// print a new section if we're now in a different category
- if($category != $prevCategory) {
-
- if(strlen($prevCategory)>0)
+ if ($category != $prevCategory) {
+
+ if(strlen($prevCategory) > 0)
$chartOutput .= renderFootBlock();
-
+
$chartOutput .= renderHeaderBlock($category);
$prevCategory = $category;
-
+
} else {
- if($i>1 && $i%2 == 0)
- $chartOutput .= "</td></tr><tr><td>";
+ if ($i>1 && $i%2 == 0)
+ $chartOutput .= "</td></tr><tr><td>";
else
- $chartOutput .= "</td><td>";
- }
-
+ $chartOutput .= "</td><td>";
+ }
+
$prevRenderedChart = renderChart($mid."-".$i,$layout,$color,$title,$data,$labels,$categories,$renderer_width*$columns,$renderer_heigth,$charttype);
$i++;
}
-
+
// finishing up
$chartOutput .= $prevRenderedChart;
$chartOutput .= renderFootBlock();
- echo "
- <script type='text/javascript'>
- function toggle_visibility(id) {
- var e = document.getElementById(id);
- if(e.style.display != 'none')
- e.style.display = 'none';
- else
- e.style.display = '';
- }
- </script>
- ";
-
+ echo '
+ <script type="text/javascript">
+ function toggle_visibility(id) {
+ var e = document.getElementById(id);
+ if (e.style.display != "none")
+ e.style.display = "none";
+ else
+ e.style.display = "";
+ }
+ </script>';
+
echo $chartOutput;
}
-
-
-?> \ No newline at end of file
+?>
diff --git a/html/pages/match_info_server.php b/html/pages/match_info_server.php
index b3c6f40..b2d9a57 100755
--- a/html/pages/match_info_server.php
+++ b/html/pages/match_info_server.php
@@ -1,71 +1,4 @@
<?php
-echo'
-<table class="box" border="0" cellpadding="1" cellspacing="2">
- <tbody><tr>
- <td class="heading" colspan="6" align="center">Totals for This Match</td>
- </tr>
- <tr>
- <td class="smheading" align="center" width="45">Team Score</td>
- <td class="smheading" align="center" width="50">Player Score</td>
- <td class="smheading" align="center" width="45">Frags</td>
- <td class="smheading" align="center" width="45">Kills</td>
- <td class="smheading" align="center" width="50">Deaths</td>
- <td class="smheading" align="center" width="60">Suicides</td>
- </tr>';
-
-// 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'
- <tr>
- <td class="smheading" align="center" width="45">'.$teamscore[result].'</td>
- <td class="smheading" align="center" width="50">'.$playerscore[result].'</td>
- <td class="smheading" align="center" width="45">'.$fragcount[result].'</td>
- <td class="smheading" align="center" width="45">'.$killcount[result].'</td>
- <td class="smheading" align="center" width="50">'.$deathcount[result].'</td>
- <td class="smheading" align="center" width="60">'.$suicidecount[result].'</td>
- </tr>';
-
-// Teamgame? Then show score
-if ($teamgame) {
- echo '
- <tr>
- <td class="heading" align="center" valign="middle" colspan="6">';
- 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 '
- </td>
- </tr>';
-}
-
-echo '
-</tbody></table>
-<br>
-<table class = "box" border="0" cellpadding="1" cellspacing="2" width="720">
- <tbody><tr>
- <td class="heading" colspan="4" align="center">Unreal Tournament Match Stats</td>
- </tr>';
$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]);
@@ -74,56 +7,67 @@ $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");
-}
-
+$mappic = getMapImageName($mapname);
$myurl = urlencode($mapname);
-$mapnameToPrint = $matchinfo['mapname'];
-if($mapnameToPrint == "Untitled")
- $mapnameToPrint = $mapname;
+$mapnameToPrint = $matchinfo[mapname];
+if ($mapnameToPrint == "Untitled") {
+ $mapnameToPrint = $mapname;
+}
- echo'
- <tr>
- <td class="dark" align="center" width="110">Match Date</td>
- <td class="grey" align="center">'.$matchdate.'</td>
- <td class="dark" align="center" width="110">Server</td>
- <td class="grey" align="center" width="146"><a class="grey" href="./?p=sinfo&amp;serverip='.$matchinfo[serverip].'">'.$matchinfo[servername].'</a></td>
- </tr>
- <tr>
- <td class="dark" align="center">Match Type</td>
- <td class="grey" align="center">'.$gamename.'</td>
- <td class="dark" align="center">Map Name</td>
- <td class="greyhuman" align="center"><a class="grey" href="./?p=minfo&amp;map='.$myurl.'">'.$mapnameToPrint.'</a></td>
- </tr>
- <tr>
- <td class="dark" align="center">Server Info</td>
- <td class="grey" align="center">'.$matchinfo[serverinfo].'</td>
- <td class="dark" align="center" rowspan="4" colspan="2"><img border="0" alt="'.$mapname.'" title="'.$mapname.'" src="'.$mappic.'"></td>
- </tr>
+echo'
+<table width="700" cellpadding="0" cellspacing="0" class="box matchtop">
+<tbody>
<tr>
- <td class="dark" align="center">Game Info</td>
- <td class="grey" align="center">'.$matchinfo[gameinfo].'</td>
+ <th class="heading"><center>Match Stats</center></th>
</tr>
+</tbody>
+</table>
+
+<div class="matchheader" style="background-image: url(\''.$mappic.'\');background-size: 100% 100%;"></div>
+
+<table class="zebra box" border="0" cellpadding="0" cellspacing="0" width="700">
+<tbody>
+';
+
+if ($r_info[t0score] > 0 || $r_info[t1score] > 0) {
+ echo '
<tr>
- <td class="dark" align="center">Mutators</td>
- <td class="grey" align="center">'.$matchinfo[mutators].'</td>
- </tr>
-</tbody></table>
-<br>';
+ <th colspan="2" class="red score" width="50%">'.$r_info[t0score].'</th>
+ <th colspan="2" class="blue score" width="50%">'.$r_info[t1score].'</th>
+ </tr>';
+ if ($r_info[t2score] > 0 || $r_info[t3score] > 0) {
+ echo'
+ <tr>
+ <th colspan="2" class="green score" width="50%">'.$r_info[t2score].'</th>
+ <th colspan="2" class="yellow score" width="50%">'.$r_info[t3score].'</th>
+ </tr>';
+ }
+}
-// 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 '
+<tr>
+ <td class="smheading" align="center" width="auto">Match Date</td>
+ <td class="grey" align="center">'.$matchdate.'</td>
+ <td class="smheading" align="center">Server</td>
+ <td class="grey" align="center"><a class="grey" href="./?p=sinfo&amp;serverip='.$matchinfo[serverip].'">'.$matchinfo[servername].'</a></td>
+</tr>
+<tr>
+ <td class="smheading" align="center">Mutators</td>
+ <td class="grey" align="center">'.$matchinfo[mutators].'</td>
+ <td class="smheading" align="center">Map Name</td>
+ <td class="grey" align="center"><a class="grey" href="./?p=minfo&amp;map='.$myurl.'">'.$mapnameToPrint.'</a></td>
+</tr>
+<tr>
+ <td class="smheading" align="center">Server Info</td>
+ <td class="grey" align="center">'.$matchinfo[serverinfo].'</td>
+ <td class="smheading" align="center">Game Info</td>
+ <td class="grey" align="center">'.$matchinfo[gameinfo].'</td>
+</tr>
+</tbody>
+</table>
+<br>';
?>