From fdd379c949056fb3a2198039e452f6aae600ef35 Mon Sep 17 00:00:00 2001 From: Matthijs Kuiper Date: Wed, 10 Jan 2018 03:13:17 +0100 Subject: Cleanup images and markup --- html/pages/help.php | 14 ++- html/pages/home.php | 2 - html/pages/maps.php | 2 +- html/pages/maps_info.php | 220 ++++++++++++++++++---------------- html/pages/match_info_killsmatrix.php | 169 +++++++++++++------------- html/pages/match_info_other.php | 11 -- html/pages/servers.php | 2 +- html/pages/servers_query.php | 4 +- 8 files changed, 211 insertions(+), 213 deletions(-) (limited to 'html/pages') diff --git a/html/pages/help.php b/html/pages/help.php index c156eae..51186c6 100755 --- a/html/pages/help.php +++ b/html/pages/help.php @@ -7,11 +7,17 @@

- For help and documentation please visit + For installation instrcutions and documentation please visit https://github.com/sn3p/utstats. -
- Please report issues and feature requests in the - issue tracker. +

+

+ Still havind problems? Check out the + Troubleshooting + page. +

+

+ UTStats is getting pretty old so errors or warnings you'll encounter are most likely caused by deprecated or functions that are not supported any more. + Please report issues and feature requests in the issue tracker.

diff --git a/html/pages/home.php b/html/pages/home.php index d2d90cf..a61d7f9 100755 --- a/html/pages/home.php +++ b/html/pages/home.php @@ -1,7 +1,5 @@ Page ['.$tfpage.'/'.$tlpage.'] Selection: '.$fpageurl.' / '.$ppageurl.' / '.$npageurl.' / '.$lpageurl.' - + +
Maps ListUnreal Tournament Maps List
diff --git a/html/pages/maps_info.php b/html/pages/maps_info.php index a7c355e..fc0a9e3 100644 --- a/html/pages/maps_info.php +++ b/html/pages/maps_info.php @@ -19,19 +19,24 @@ if($map_matches[gametime]<= 0) { // Map pic code $mappic = getMapImageName($map); - echo' - - - - - + echo ' +
Statistics for '.htmlentities($map).'
'.$mapname.'
+ + + + + + + - - + + - - + + '; // Show some gametype specific stuff if ((strtolower(substr($map, 0, 7)) == "ctf-bt-") or (strtolower(substr($map, 0, 3)) == "bt-")) { @@ -40,25 +45,25 @@ if($map_matches[gametime]<= 0) { if (!empty($record['time'])) { echo ' - - + + '; } else { echo ' - - + + '; } echo ' - - + + - - + + '; } else if (strtolower(substr($map, 0, 4)) == "ctf-") { @@ -66,28 +71,28 @@ if($map_matches[gametime]<= 0) { $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 ' - - + + - - + + - - + + - - + + - - + + - - + + '; } else if (strtolower(substr($map, 0, 3)) == "as-") { @@ -95,16 +100,16 @@ if($map_matches[gametime]<= 0) { $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 ' - - + + - - + + - - + + '; } else if (strtolower(substr($map, 0, 3)) == "jb-") { @@ -112,16 +117,16 @@ if($map_matches[gametime]<= 0) { $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 ' - - + + - - + + - - + + '; } else if (strtolower(substr($map, 0, 4)) == "dom-") { @@ -129,118 +134,119 @@ if($map_matches[gametime]<= 0) { $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 ' - - + + - - + + - - + + '; } else { echo ' - - + + - - + + - - + + - - + + '; } echo ' - - + +
Statistics for '.htmlentities($map).'
+ '.$map.' +
Matches'.$map_matches[matchcount].'Matches'.$map_matches[matchcount].'
Total Time'.$map_tottime.' minutesTotal Time'.$map_tottime.' minutes
Fastest Capture'.FormatPlayerName($record['country'], $record['id'], $record['name']).'
' . btcaptime($record['time']) . ' minutes
'.gmdate('d-m-Y h:i a', $record['date']).'
Fastest Capture'.FormatPlayerName($record['country'], $record['id'], $record['name']).'
' . btcaptime($record['time']) . ' minutes
'.gmdate('d-m-Y h:i a', $record['date']).'
Fastest CaptureNo record set!Fastest CaptureNo record set!
Total Flags Captured'.$map_matches[gamescore].'Total Flags Captured'.$map_matches[gamescore].'
Total Suicides'.$map_matches[suicides].'Total Suicides'.$map_matches[suicides].'
Total Flags Captured'.$map_matches[gamescore].'Total Flags Captured'.$map_matches[gamescore].'
Total Flags Taken'.$totals['flag_taken'].'Total Flags Taken'.$totals['flag_taken'].'
Total Covers'.$totals['flag_cover'].'Total Covers'.$totals['flag_cover'].'
Total Flags Returned'.$totals['flag_return'].'Total Flags Returned'.$totals['flag_return'].'
Total Kills'.$map_matches[kills].'Total Kills'.$map_matches[kills].'
Total Suicides'.$map_matches[suicides].'Total Suicides'.$map_matches[suicides].'
Total Objectives Achieved'.$totals[ass_obj].'Total Objectives Achieved'.$totals[ass_obj].'
Total Kills'.$map_matches[kills].'Total Kills'.$map_matches[kills].'
Total Suicides'.$map_matches[suicides].'Total Suicides'.$map_matches[suicides].'
Team Releases'.$totals[ass_obj].'Team Releases'.$totals[ass_obj].'
Total Kills'.$map_matches[kills].'Total Kills'.$map_matches[kills].'
Total Suicides'.$map_matches[suicides].'Total Suicides'.$map_matches[suicides].'
Total Control Points Captured'.$totals['dom_cp'].'Total Control Points Captured'.$totals['dom_cp'].'
Total Kills'.$map_matches[kills].'Total Kills'.$map_matches[kills].'
Total Suicides'.$map_matches[suicides].'Total Suicides'.$map_matches[suicides].'
Total Score'.$map_matches[gamescore].'Total Score'.$map_matches[gamescore].'
Total Kills'.$map_matches[kills].'Total Kills'.$map_matches[kills].'
Total Teamkills'.$map_matches[teamkills].'Total Teamkills'.$map_matches[teamkills].'
Total Suicides'.$map_matches[suicides].'Total Suicides'.$map_matches[suicides].'
Last Match'.$map_lastmatch.'Last Match'.$map_lastmatch.'

'; - // 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) { + if ($ecount > $ecount2) { $ecount2 = $ecount2+1; } $fpage = 0; - IF($ecount < 1) { $lpage = 0; } + if ($ecount < 1) { $lpage = 0; } else { $lpage = $ecount2-1; } $cpage = preg_replace('/\D/', '', $_GET["page"]); $qpage = $cpage*25; - IF ($cpage == "") { $cpage = "0"; } + if ($cpage == "") { $cpage = "0"; } $tfpage = $cpage+1; $tlpage = $lpage+1; $ppage = $cpage-1; $ppageurl = "[Previous]"; - IF ($ppage < "0") { $ppageurl = "[Previous]"; } + if ($ppage < "0") { $ppageurl = "[Previous]"; } $npage = $cpage+1; $npageurl = "[Next]"; - IF ($npage >= "$ecount") { $npageurl = "[Next]"; } + if ($npage >= "$ecount") { $npageurl = "[Next]"; } $fpageurl = "[First]"; - IF ($cpage == "0") { $fpageurl = "[First]"; } + if ($cpage == "0") { $fpageurl = "[First]"; } $lpageurl = "[Last]"; - IF ($cpage == "$lpage") { $lpageurl = "[Last]"; } + if ($cpage == "$lpage") { $lpageurl = "[Last]"; } // list recent matches - echo' + 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"; + 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]); + 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]"); + $map_pcount = small_count("SELECT id FROM uts_player WHERE matchid = $r_maps[id]"); - echo' - + echo ' + - '; + '; } - echo' -
Recent Matches
Recent Matches
DateMatch TypePlayer CountTimeDateMatch TypePlayer CountTime
'.$r_matchtime.' '.$r_maps[gamename].' '.$map_pcount.' '.$r_gametime.'
+ echo ' +
Page ['.$tfpage.'/'.$tlpage.'] Selection: '.$fpageurl.' / '.$ppageurl.' / '.$npageurl.' / '.$lpageurl.'
'; // Do graph stuff @@ -254,71 +260,73 @@ if($map_matches[gametime]<= 0) { $ecount = $mcount/25; $ecount2 = number_format($ecount, 0, '.', ''); - IF($ecount > $ecount2) { + if ($ecount > $ecount2) { $ecount2 = $ecount2+1; } $fpage = 0; - IF($ecount < 1) { $lpage = 0; } + if ($ecount < 1) { $lpage = 0; } else { $lpage = $ecount2-1; } $cpage = preg_replace('/\D/', '', $_GET["rpage"]); $qpage = $cpage*25; - IF ($cpage == "") { $cpage = "0"; } + if ($cpage == "") { $cpage = "0"; } $tfpage = $cpage+1; $tlpage = $lpage+1; $ppage = $cpage-1; $ppageurl = "[Previous]"; - IF ($ppage < "0") { $ppageurl = "[Previous]"; } + if ($ppage < "0") { $ppageurl = "[Previous]"; } $npage = $cpage+1; $npageurl = "[Next]"; - IF ($npage >= "$ecount") { $npageurl = "[Next]"; } + if ($npage >= "$ecount") { $npageurl = "[Next]"; } $fpageurl = "[First]"; - IF ($cpage == "0") { $fpageurl = "[First]"; } + if ($cpage == "0") { $fpageurl = "[First]"; } $lpageurl = "[Last]"; - IF ($cpage == "$lpage") { $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"; + $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 ' - + + echo '
Fastest capturesFastest captures
NameTimeDate
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']), '
', 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.'

'; } } - } ?> diff --git a/html/pages/match_info_killsmatrix.php b/html/pages/match_info_killsmatrix.php index 3b425e5..0ace5ac 100644 --- a/html/pages/match_info_killsmatrix.php +++ b/html/pages/match_info_killsmatrix.php @@ -1,23 +1,23 @@ '; - } - return($ret); + $len = strlen($text); + $ret = ''; + for ($i = 0; $i < $len; $i++) { + $ret .= substr($text, $i, 1) .'
'; + } + return($ret); } // Retrieve the killmatrix -$sql_km = " SELECT killer, - victim, - kills - FROM uts_killsmatrix - WHERE matchid = $mid;"; - +$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']; + $km[intval($r_km['killer'])][intval($r_km['victim'])] = $r_km['kills']; } // No matrix: bye @@ -29,27 +29,27 @@ $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;"; +$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'])); + $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'])); } @@ -58,7 +58,7 @@ $extra = $teamgame ? 3 : 2; echo ' - + @@ -69,69 +69,66 @@ echo ' // Victims foreach($players as $player) { - - - - echo ''; -} + echo ''; +} echo ''; // Team colors victims if ($teamgame) { - foreach($players as $player) { - switch($player['team']) { - case 0: $teamcolor = 'redteamb'; break; - case 1: $teamcolor = 'blueteamb'; break; - case 2: $teamcolor = 'greenteamb'; break; - case 3: $teamcolor = 'goldteamb'; break; - } - echo ''; - } - echo ''; + foreach($players as $player) { + switch($player['team']) { + case 0: $teamcolor = 'redteamb'; break; + case 1: $teamcolor = 'blueteamb'; break; + case 2: $teamcolor = 'greenteamb'; break; + case 3: $teamcolor = 'goldteamb'; 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 = 'redteamb'; break; - case 1: $teamcolor = 'blueteamb'; break; - case 2: $teamcolor = 'greenteamb'; break; - case 3: $teamcolor = 'goldteamb'; break; - } - echo ''; - } - foreach($players as $vid => $victim) { - $class = ($kid == $vid) ? 'suicide' : 'killCell'; - //if ($i % 2) $class .= '2'; - echo ''; - } + if ($killer['banned'] == 'Y') continue; + $i++; + echo ''; + if ($first) echo''; + echo ''; + if ($teamgame) { + switch($killer['team']) { + case 0: $teamcolor = 'redteamb'; break; + case 1: $teamcolor = 'blueteamb'; break; + case 2: $teamcolor = 'greenteamb'; break; + case 3: $teamcolor = 'goldteamb'; break; + } + echo ''; + } + foreach($players as $vid => $victim) { + $class = ($kid == $vid) ? 'suicide' : 'killCell'; + //if ($i % 2) $class .= '2'; + echo ''; + } - $first = false; -} + $first = false; +} echo '
Kills Match Up
-
'; - if (strlen($player['name']) > 10) { -echo substr($player['name'],0,10); -} else { -echo $player['name'] ; -}; -'
+
'; + if (strlen($player['name']) > 10) { + echo substr($player['name'],0,10); + } else { + echo $player['name'] ; + }; + '
-
+
'; - 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 .'
'; + 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_other.php b/html/pages/match_info_other.php index b92ae74..6547637 100755 --- a/html/pages/match_info_other.php +++ b/html/pages/match_info_other.php @@ -123,15 +123,4 @@ if ((strpos($gamename, '(insta)') === false) && (strpos($gamename, "Last Man Sta echo ''; -/* -// To add when forum widget is available - -echo ' -
- -
'; -*/ - ?> diff --git a/html/pages/servers.php b/html/pages/servers.php index 770796b..bb54d75 100644 --- a/html/pages/servers.php +++ b/html/pages/servers.php @@ -39,7 +39,7 @@ echo ' - + diff --git a/html/pages/servers_query.php b/html/pages/servers_query.php index c44a718..d6228a6 100644 --- a/html/pages/servers_query.php +++ b/html/pages/servers_query.php @@ -70,7 +70,7 @@ if (file_exists($mappic)) { $mapname = getiteminfo("mapname",$chunks); $mappic = strtolower("images/maps/".$mapname.".jpg"); -IF (file_exists($mappic)) { +if (file_exists($mappic)) { } else { $mappic = "images/maps/blank.jpg"; } @@ -173,4 +173,4 @@ for ($i = 0; $i < $r_numplayers; $i++) { } echo'
Server ListUnreal Tournament Server List
Server Name
'; -?> \ No newline at end of file +?> -- cgit