From 3a58cb2802c8be14f78015105afe759b1c7ce692 Mon Sep 17 00:00:00 2001 From: Matthijs Kuiper Date: Tue, 9 Jan 2018 00:43:43 +0100 Subject: Implement design for pages and update includes --- html/pages/maps.php | 42 ++++++++++++++++++++++-------------------- 1 file changed, 22 insertions(+), 20 deletions(-) mode change 100755 => 100644 html/pages/maps.php (limited to 'html/pages/maps.php') diff --git a/html/pages/maps.php b/html/pages/maps.php old mode 100755 new mode 100644 index 409398c..9d30179 --- a/html/pages/maps.php +++ b/html/pages/maps.php @@ -9,7 +9,7 @@ function SortPic($curr_field, $filter, $sort) { if ($curr_field != $filter) return; $fname = 'images/s_'. strtolower($sort) .'.png'; if (!file_exists($fname)) return; - return(' '); + return(' '); } @@ -84,13 +84,13 @@ IF ($cpage == "$lpage") { $lpageurl = "[Last]"; } echo'
-
Page ['.$tfpage.'/'.$tlpage.'] Selection: '.$fpageurl.' / '.$ppageurl.' / '.$npageurl.' / '.$lpageurl.'
- +
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 @@ -127,17 +129,17 @@ while ($r_maps = mysql_fetch_array($q_maps)) { $r_gametime = GetMinutes($r_maps[gametime]); echo' - - - - - - + + + + + + '; } echo'
Unreal Tournament Maps ListUnreal Tournament Maps List
+ @@ -104,17 +104,19 @@ while ($r_game = mysql_fetch_array($q_game)) { echo ''; } echo ' '; -echo ' Search: '; -echo ' '; + +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).'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.'
'.$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.'
+
Page ['.$tfpage.'/'.$tlpage.'] Selection: '.$fpageurl.' / '.$ppageurl.' / '.$npageurl.' / '.$lpageurl.'
'; ?> \ No newline at end of file -- cgit From cf540de5d3229941e4104e4d5b6b66681f97f4d3 Mon Sep 17 00:00:00 2001 From: Matthijs Kuiper Date: Wed, 10 Jan 2018 02:08:58 +0100 Subject: Server list layout and link --- html/pages/maps.php | 89 ++++++++++++++++++++++++++--------------------------- 1 file changed, 44 insertions(+), 45 deletions(-) (limited to 'html/pages/maps.php') diff --git a/html/pages/maps.php b/html/pages/maps.php index 9d30179..69c8785 100644 --- a/html/pages/maps.php +++ b/html/pages/maps.php @@ -12,14 +12,13 @@ function SortPic($curr_field, $filter, $sort) { return(' '); } - // 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")))) { +if (empty($filter) or (!in_array(strtolower($filter), array("mapfile", "matchcount", "frags", "matchscore", "gametime")))) { $filter = "mapfile"; } @@ -37,32 +36,29 @@ else { if (isset($q)) { if ($gid != 0) { - $sql_condition .= ' AND mapfile LIKE "%' . $q . '%" '; + $sql_condition .= ' AND mapfile LIKE "%' . $q . '%" '; } else { - $sql_condition .= ' WHERE mapfile LIKE "%' . $q . '%" '; + $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; +$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"]); -IF ($cpage == "") { $cpage = "0"; } +if ($cpage == "") { $cpage = "0"; } $qpage = $cpage*25; $tfpage = $cpage+1; @@ -70,46 +66,49 @@ $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]"; } echo'
Page ['.$tfpage.'/'.$tlpage.'] Selection: '.$fpageurl.' / '.$ppageurl.' / '.$npageurl.' / '.$lpageurl.'
- + + + + + Filter: + +
+ + + + +
+ @@ -120,26 +119,26 @@ echo ' '; $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"; + 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)) { +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 ' - - - - - + + + + + '; } -echo' +echo '
Unreal Tournament Maps ListMaps List
- - - - Filter: '; -echo ' '; - -echo '
-
'; - -echo ' -
Map Name'.SortPic('mapfile', $filter, $sort).'
'.$r_mapfile.''.$r_maps[matchcount].''.get_dp($r_maps[frags]).''.get_dp($r_maps[matchscore]).''.$r_gametime.''.$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 +?> -- cgit 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/maps.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'html/pages/maps.php') diff --git a/html/pages/maps.php b/html/pages/maps.php index 69c8785..1959085 100644 --- a/html/pages/maps.php +++ b/html/pages/maps.php @@ -83,7 +83,7 @@ echo'
Page ['.$tfpage.'/'.$tlpage.'] Selection: '.$fpageurl.' / '.$ppageurl.' / '.$npageurl.' / '.$lpageurl.'
- +
Maps ListUnreal Tournament Maps List
-- cgit From 861e3230f0154e6a5942698adedf18d5eb0e0b8a Mon Sep 17 00:00:00 2001 From: Matthijs Kuiper Date: Wed, 10 Jan 2018 20:08:33 +0100 Subject: Move imaegs to assets folder --- html/pages/maps.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'html/pages/maps.php') diff --git a/html/pages/maps.php b/html/pages/maps.php index 1959085..bd1106e 100644 --- a/html/pages/maps.php +++ b/html/pages/maps.php @@ -7,7 +7,7 @@ function InvertSort($curr_field, $filter, $sort) { function SortPic($curr_field, $filter, $sort) { if ($curr_field != $filter) return; - $fname = 'images/s_'. strtolower($sort) .'.png'; + $fname = 'assets/images/s_'. strtolower($sort) .'.png'; if (!file_exists($fname)) return; return(' '); } -- cgit