diff options
author | Matthijs Kuiper <info@matthijskuiper.nl> | 2018-01-09 00:43:43 +0100 |
---|---|---|
committer | Matthijs Kuiper <info@matthijskuiper.nl> | 2018-01-09 00:44:09 +0100 |
commit | 3a58cb2802c8be14f78015105afe759b1c7ce692 (patch) | |
tree | 40781feb2f25ae378bb5362e4295b7006f28054c /html/includes | |
parent | d0102c6fd4b188b0a1c5ffd3bf9a834a64a5c709 (diff) |
Implement design for pages and update includes
Diffstat (limited to 'html/includes')
-rw-r--r--[-rwxr-xr-x] | html/includes/clanbase.php | 0 | ||||
-rwxr-xr-x | html/includes/config.php | 6 | ||||
-rw-r--r--[-rwxr-xr-x] | html/includes/config_pic.php | 0 | ||||
-rw-r--r--[-rwxr-xr-x] | html/includes/countries.php | 0 | ||||
-rw-r--r--[-rwxr-xr-x] | html/includes/ftp.php | 2 | ||||
-rw-r--r--[-rwxr-xr-x] | html/includes/ftp_class.php | 0 | ||||
-rw-r--r--[-rwxr-xr-x] | html/includes/ftp_class_native.php | 0 | ||||
-rw-r--r--[-rwxr-xr-x] | html/includes/ftp_class_pure.php | 0 | ||||
-rw-r--r--[-rwxr-xr-x] | html/includes/ftp_class_sockets.php | 0 | ||||
-rw-r--r--[-rwxr-xr-x] | html/includes/geoip.inc | 0 | ||||
-rw-r--r--[-rwxr-xr-x] | html/includes/hints.php | 6 | ||||
-rwxr-xr-x | html/includes/teamstats.php | 338 | ||||
-rw-r--r--[-rwxr-xr-x] | html/includes/weaponstats.php | 48 |
13 files changed, 193 insertions, 207 deletions
diff --git a/html/includes/clanbase.php b/html/includes/clanbase.php index 5ad7640..5ad7640 100755..100644 --- a/html/includes/clanbase.php +++ b/html/includes/clanbase.php diff --git a/html/includes/config.php b/html/includes/config.php index 55b9ffe..77d42fa 100755 --- a/html/includes/config.php +++ b/html/includes/config.php @@ -1,9 +1,9 @@ <?php
// Database connection details
-$dbname = "utstats";
-$hostname = "localhost";
-$uname = "root";
+$dbname = "";
+$hostname = "";
+$uname = "";
$upass = "";
// The key needed to run the import script
diff --git a/html/includes/config_pic.php b/html/includes/config_pic.php index e70aee5..e70aee5 100755..100644 --- a/html/includes/config_pic.php +++ b/html/includes/config_pic.php diff --git a/html/includes/countries.php b/html/includes/countries.php index 4de8dde..4de8dde 100755..100644 --- a/html/includes/countries.php +++ b/html/includes/countries.php diff --git a/html/includes/ftp.php b/html/includes/ftp.php index 7e058a3..1a6e7ee 100755..100644 --- a/html/includes/ftp.php +++ b/html/includes/ftp.php @@ -109,7 +109,7 @@ function ftpupdate() if (!$ftp_debug) {
- if ($html) echo'<table class="box" border="0" cellpadding="1" cellspacing="2" style="table-layout:fixed"><tr><td class="smheading" align="center" height="25" width="550" colspan="2">';
+ if ($html) echo'<table class="zebra box" border="0" cellpadding="0" cellspacing="0" style="table-layout:fixed"><tr><td class="smheading" align="center" height="25" width="550" colspan="2">';
echo "FTP Transferring Log Files...\n";
diff --git a/html/includes/ftp_class.php b/html/includes/ftp_class.php index 5281379..5281379 100755..100644 --- a/html/includes/ftp_class.php +++ b/html/includes/ftp_class.php diff --git a/html/includes/ftp_class_native.php b/html/includes/ftp_class_native.php index 4f7f1df..4f7f1df 100755..100644 --- a/html/includes/ftp_class_native.php +++ b/html/includes/ftp_class_native.php diff --git a/html/includes/ftp_class_pure.php b/html/includes/ftp_class_pure.php index e7806db..e7806db 100755..100644 --- a/html/includes/ftp_class_pure.php +++ b/html/includes/ftp_class_pure.php diff --git a/html/includes/ftp_class_sockets.php b/html/includes/ftp_class_sockets.php index 8cfd27f..8cfd27f 100755..100644 --- a/html/includes/ftp_class_sockets.php +++ b/html/includes/ftp_class_sockets.php diff --git a/html/includes/geoip.inc b/html/includes/geoip.inc index a095469..a095469 100755..100644 --- a/html/includes/geoip.inc +++ b/html/includes/geoip.inc diff --git a/html/includes/hints.php b/html/includes/hints.php index b8da8de..7ba11a3 100755..100644 --- a/html/includes/hints.php +++ b/html/includes/hints.php @@ -24,10 +24,8 @@ $hint['Multis'] = "text" => "Special event: If you manage to kill more 2 than people within a short space of time you get a Double Kill, 3 is a Multi Kill etc" ); -$hint['Sprees'] = - array ( "caption" => "Killing Sprees", - "text" => "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." - ); +$hint['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." + ; $hint['EFF'] = array ( "caption" => "Efficiency", "text" => "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.<br>Formula: Kills / (Kills + Deaths + Suicides [+Team Kills])" diff --git a/html/includes/teamstats.php b/html/includes/teamstats.php index b2116b9..d0b1b58 100755 --- a/html/includes/teamstats.php +++ b/html/includes/teamstats.php @@ -1,182 +1,176 @@ <?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'];
- $teamscore[1] = $r_info['t1score'];
- $teamscore[2] = $r_info['t2score'];
- $teamscore[3] = $r_info['t3score'];
-
- $cols = 10;
- if ($teams) $cols++;
- if ($extra) $cols++;
- $oldteam = -1;
-
- echo'
- <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";
- $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'];
- teamstats_init_totals($totals, $num, $extra);
-
- switch(intval($r_players['team'])) {
- case 0: $teamname = 'Red'; break;
- case 1: $teamname = 'Blue'; break;
- case 2: $teamname = 'Green'; break;
- case 3: $teamname = 'Gold'; break;
- }
-
- echo'<tr><td class="'.$teamname.'" colspan="'.$cols.'" align="center">Team: '.$teamname.'</td></tr>';
- $header = true;
- }
-
- if ($header) {
- $header = false;
- echo '
- <tr>
- <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'
- <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 '
- <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>';
- }
-
- $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 '<tr class="clickableRow" href="./?p=matchp&mid='.$mid.'&pid='.$r_players['pid'].'">';
-
- if ($r_players['banned'] != 'Y') {
- echo '<td nowrap align="left"><a href="./?p=matchp&mid='.$mid.'&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 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">'.$r_players['gamescore'].'</td>';
-
- if ($extra) echo '<td class="'.$class.'" align="center">'.$r_players[$extra].'</td>';
-
- echo '<td class="'.$class.'" align="center">'.$r_players['frags'].'</td>';
- echo '<td class="'.$class.'" align="center">'.$kills.'</td>';
- echo '<td class="'.$class.'" align="center">'.$r_players['deaths'].'</td>';
- echo '<td class="'.$class.'" align="center">'.$r_players['suicides'].'</td>';
-
- if ($teams) echo '<td class="'.$class.'" align="center">'.$r_players['teamkills'].'</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>';
+ 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'];
+ $teamscore[1] = $r_info['t1score'];
+ $teamscore[2] = $r_info['t2score'];
+ $teamscore[3] = $r_info['t3score'];
+
+ $cols = 10;
+ if ($teams) $cols++;
+ if ($extra) $cols++;
+
+ $oldteam = -1;
+
+ echo'
+ <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";
+ $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'];
+ teamstats_init_totals($totals, $num, $extra);
+
+ switch(intval($r_players['team'])) {
+ case 0: $teamname = 'Red'; break;
+ case 1: $teamname = 'Blue'; break;
+ case 2: $teamname = 'Green'; break;
+ case 3: $teamname = 'Gold'; break;
+ }
+
+ echo'<tr><td class="'.$teamname.'" colspan="'.$cols.'" align="center">Team: '.$teamname.'</td></tr>';
+ $header = true;
+ }
+ if ($header) {
+ $header = false;
+ echo '
+ <tr>
+ <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 '
+ <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 '
+ <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>';
+ }
+
+ $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 '<tr class="clickableRow" href="./?p=matchp&mid='.$mid.'&pid='.$r_players['pid'].'">';
+ if ($r_players['banned'] != 'Y') {
+ echo '<td nowrap align="left"><a href="./?p=matchp&mid='.$mid.'&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 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 align="center">'.GetMinutes($r_players['gametime'] / TIMERATIO).'</td>';
+ echo '<td align="center">'.$r_players['gamescore'].'</td>';
+
+ if ($extra) echo '<td align="center">'.$r_players[$extra].'</td>';
+
+ echo '<td align="center">'.$r_players['frags'].'</td>';
+ echo '<td align="center">'.$kills.'</td>';
+ echo '<td align="center">'.$r_players['deaths'].'</td>';
+ echo '<td align="center">'.$r_players['suicides'].'</td>';
+
+ if ($teams) echo '<td align="center">'.$r_players['teamkills'].'</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>';
}
function teamstats_init_totals(&$totals, &$num, $extra = null) {
- $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;
+ $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;
}
function teamstats_team_totals(&$totals, $num, $teams, $extra, $teamscore) {
- if ($num == 0) $num = 1;
- $eff = get_dp($totals['eff'] / $num);
- $acc = get_dp($totals['acc'] / $num);
- $ttl = GetMinutes($totals['ttl'] / $num);
-
- echo '<tr>';
- echo '<td nowrap class="totals" align="center">Totals</td>';
- echo '<td class="totals" align="center"></td>';
-
- if ($teams) {
- echo '<td class="totals" align="center"><strong>'.$teamscore.'</strong> ('.$totals[gamescore].')</td>';
- } else {
- echo '<td class="totals" align="center">'.$totals[gamescore].'</td>';
- }
- if ($extra) echo '<td class="totals" align="center">'.$totals[$extra].'</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="totals" align="center">'.$totals[teamkills].'</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>';
+ if ($num == 0) $num = 1;
+ $eff = get_dp($totals['eff'] / $num);
+ $acc = get_dp($totals['acc'] / $num);
+ $ttl = GetMinutes($totals['ttl'] / $num);
+
+ echo '<tr>';
+ echo '<td nowrap class="totals" align="center">Totals</td>';
+ echo '<td class="totals" align="center"></td>';
+ if ($teams) {
+ echo '<td class="totals" align="center"><strong>'.$teamscore.'</strong> ('.$totals[gamescore].')</td>';
+ } else {
+ echo '<td class="totals" align="center">'.$totals[gamescore].'</td>';
+ }
+ if ($extra) echo '<td class="totals" align="center">'.$totals[$extra].'</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="totals" align="center">'.$totals[teamkills].'</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/includes/weaponstats.php b/html/includes/weaponstats.php index 872fa5a..bccdd6d 100755..100644 --- a/html/includes/weaponstats.php +++ b/html/includes/weaponstats.php @@ -26,7 +26,6 @@ function weaponstats($_mid, $_pid, $title = 'Weapons Summary') { AND (wn.id = w.weapon)
AND wn.hide <> 'Y'";
-
if ($_pid == 0 and $_mid != 0) {
$sql_weapons = "SELECT w.matchid,
w.pid AS playerid,
@@ -99,15 +98,15 @@ uts_weaponstats AS w }
echo'
- <table class = "box" border="0" cellpadding="0" cellspacing="2">
- <tbody>
- <tr>
- <td class="heading" colspan="'. ((count($wsort) * $colspan) + $playercol) .'" align="center">'.htmlentities($title).'</td>
- </tr>';
-
+ <table class = "box zebra" border="0" cellpadding="0" cellspacing="0" width="700">
+ <tbody>
+ <tr>
+ <th class="heading" colspan="'. ((count($wsort) * $colspan) + $playercol) .'" align="center">'.htmlentities($title).'</th>
+ </tr>';
if ($one) {
ws_header($wsort, $weapons, $colspan, $one, $playercol);
+
echo '<tr>';
foreach($wsort as $wid => $bar) {
for ($i = 1; $i <= $colspan; $i++) {
@@ -119,8 +118,7 @@ uts_weaponstats AS w case 5: $extra = 'Dmg'; break;
}
$extra = '<span style="font-size: 100%">'. $extra .'</span>';
- echo '
- <td class="smheading" align="center" width="35">'.$extra.'</td>';
+ echo '<th class="smheading" align="center" width="35">'.$extra.'</th>';
}
}
echo '</tr>';
@@ -128,10 +126,10 @@ uts_weaponstats AS w $i = 0;
foreach($psort as $pid => $foo) {
$i++;
- echo '<tr>';
+ echo '<tr class="clickableRow" href="./?p=matchp&mid='.$_mid.'&pid='.urlencode($pid).'">';
if ($playercol) {
echo '
- <td nowrap class="darkhuman" align="left"><a class="darkhuman" href="./?p=matchp&mid='.$_mid.'&pid='.urlencode($pid).'">'.FormatPlayerName($wd[$pid]['country'], $pid, $wd[$pid]['playername'], $gid, $gamename).'</a></td>';
+ <td nowrap align="left"><a href="./?p=matchp&mid='.$_mid.'&pid='.urlencode($pid).'">'.FormatPlayerName($wd[$pid]['country'], $pid, $wd[$pid]['playername'], $gid, $gamename).'</a></td>';
}
foreach($wsort as $wid => $bar) {
ws_cell($wd, $pid, $wid, 'kills', $i);
@@ -146,23 +144,22 @@ uts_weaponstats AS w if (!$one) {
ws_block($wd, $weapons, $wsort, $psort, $colspan, $playercol, $one, $_mid, $gamename, 'Kills', 'kills');
- ws_block($wd, $weapons, $wsort, $psort, $colspan, $playercol, $one, $_mid, $gamename, 'Shots', 'shots');
- ws_block($wd, $weapons, $wsort, $psort, $colspan, $playercol, $one, $_mid, $gamename, 'Hits', 'hits');
+ //ws_block($wd, $weapons, $wsort, $psort, $colspan, $playercol, $one, $_mid, $gamename, 'Shots', 'shots');
+ //ws_block($wd, $weapons, $wsort, $psort, $colspan, $playercol, $one, $_mid, $gamename, 'Hits', 'hits');
ws_block($wd, $weapons, $wsort, $psort, $colspan, $playercol, $one, $_mid, $gamename, 'Damage', 'damage');
ws_block($wd, $weapons, $wsort, $psort, $colspan, $playercol, $one, $_mid, $gamename, 'Accuracy', 'acc');
}
-
echo '</tbody></table>';
}
function ws_header(&$wsort, &$weapons, $colspan, $one, $playercol) {
echo '<tr>';
- if ($playercol and $playercol != -1) echo '<td class="smheading" align="center" width="150" '.(($one) ? 'rowspan="2"' : '') .'>Player</td>';
- if ($playercol == -1) echo '<td class="smheading" align="center" width="150"> </td>';
+ if ($playercol and $playercol != -1) echo '<td class="smheading" align="center" width="220" '.(($one) ? 'rowspan="2"' : '') .'><img src="images/playersmall.png" style="max-width:50px; max-height:50px;"></td>';
+ if ($playercol == -1) echo '<td class="smheading" align="center" width="220"> </td>';
foreach($wsort as $wid => $bar) {
if (!empty($weapons[$wid]['image'])) {
- $content = '<img border="0" src="images/weapons/'.$weapons[$wid]['image'].'" alt="'.$weapons[$wid]['name'].'" title="'.$weapons[$wid]['name'].'">';
+ $content = '<img border="0" class="tooltip" style="min-width: 15px; max-width:40px; max-height:50px;" src="images/weapons/'.$weapons[$wid]['image'].'" alt="'.$weapons[$wid]['name'].'" title="'.$weapons[$wid]['name'].'"></a>';
} else {
$content = '<span style="font-size: 60%;">'.$weapons[$wid]['name'].'</span>';
}
@@ -172,27 +169,23 @@ function ws_header(&$wsort, &$weapons, $colspan, $one, $playercol) { echo '</tr>';
}
-
function ws_cell(&$wd, $pid, $wid, $field, $i) {
$content = '';
if (isset($wd[$pid][$wid][$field])) $content = $wd[$pid][$wid][$field];
$class = ($i % 2) ? 'grey' : 'grey2';
echo '
- <td class="'.$class.'" align="center">'.$content.'</td>';
+ <td align="center">'.$content.'</td>';
}
-
-
-
function ws_block(&$wd, &$weapons, &$wsort, &$psort, &$colspan, $playercol, $one,$_mid, $gamename, $caption, $field) {
global $gamename, $gid;
if (count($psort) != 1) {
echo '
<tr>
- <td height="5" colspan="'. ((count($wsort) * $colspan) + $playercol) .'" align="center"></td>
+ <td class="weapspacer" height="5" colspan="'. ((count($wsort) * $colspan) + $playercol) .'" align="center"></td>
</tr>
<tr>
- <td class="smheading" height="20" colspan="'. ((count($wsort) * $colspan) + $playercol) .'" align="center">'.$caption.'</td>
+ <th class="smheading" height="20" colspan="'. ((count($wsort) * $colspan) + $playercol) .'" align="center">'.$caption.'</th>
</tr>';
ws_header($wsort, $weapons, $colspan, $one, $playercol);
}
@@ -204,8 +197,8 @@ function ws_block(&$wd, &$weapons, &$wsort, &$psort, &$colspan, $playercol, $one $i = 0;
foreach($psort as $pid => $foo) {
$i++;
- echo '<tr>';
- if ($playercol and $playercol != -1) echo '<td nowrap class="darkhuman" align="left"><a class="darkhuman" href="./?p=matchp&mid='.$_mid.'&pid='.urlencode($pid).'">'.FormatPlayerName($wd[$pid]['country'], $pid, $wd[$pid]['playername'], $gid, $gamename).'</a></td>';
+ echo '<tr class="clickableRow" href="./?p=matchp&mid='.$_mid.'&pid='.urlencode($pid).'">';
+ if ($playercol and $playercol != -1) echo '<td nowrap align="left"><a href="./?p=matchp&mid='.$_mid.'&pid='.urlencode($pid).'">'.FormatPlayerName($wd[$pid]['country'], $pid, $wd[$pid]['playername'], $gid, $gamename).'</a></td>';
if ($playercol == -1) echo '<td nowrap class="dark" align="center">'.$caption.'</td>';
foreach($wsort as $wid => $bar) {
ws_cell($wd, $pid, $wid, $field, $i);
@@ -213,4 +206,5 @@ function ws_block(&$wd, &$weapons, &$wsort, &$psort, &$colspan, $playercol, $one echo '</tr>';
}
}
-?>
\ No newline at end of file +
+?>
|