From b587e265913a1fe9cc21fd24a0d4fa9ed6cbd404 Mon Sep 17 00:00:00 2001 From: novgorodschi catalin Date: Tue, 23 Jun 2026 09:09:21 +0300 Subject: [PATCH] Fix map view in Admin Panel Fix map view in Admin Panel --- Admin/Templates/editServerSet.tpl | 618 ++++++++++++++++-------------- Admin/Templates/map.tpl | 176 ++++----- 2 files changed, 419 insertions(+), 375 deletions(-) diff --git a/Admin/Templates/editServerSet.tpl b/Admin/Templates/editServerSet.tpl index c2233113..96d8f8e7 100644 --- a/Admin/Templates/editServerSet.tpl +++ b/Admin/Templates/editServerSet.tpl @@ -22,295 +22,339 @@ if (!isset($_SESSION)) { } if($_SESSION['access'] < 9) die(ACCESS_DENIED_ADMIN); ?> + + -

-
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
?
?
? - - -
? - -
?
?
?
?
?
?
?
?
?
?
?
?x
? - -
? - -
? - -
? - -
? - -
? - -
? - -
? - -
? - -
?
?
?
?
? - -
?
? - -
? - -
? - -
? - -
? -
-
- - - - -
<<
-
+ +
+
+ +
+ + +
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
?
?
? + + +
? + +
?
?
?
?
?
?
?
?
?
?
?
?x
? + +
? + +
? + +
? + +
? + +
? + +
? + +
? + +
? + +
?
?
?
?
? + +
?
? + +
? + +
? + +
? + +
? + +
+
+
+ + ‹ + + +
+
+
\ No newline at end of file diff --git a/Admin/Templates/map.tpl b/Admin/Templates/map.tpl index 5ecfe00d..ebc9987e 100644 --- a/Admin/Templates/map.tpl +++ b/Admin/Templates/map.tpl @@ -73,8 +73,13 @@ body{margin:0;background:#f1f5f9;font-family:system-ui,-apple-system,Segoe UI,Ro .btn-show{background:#0f172a;color:#fff;border:0;padding:7px 14px;border-radius:8px;font-size:13px;font-weight:600;cursor:pointer;transition:.2s} .btn-show:hover{background:#1e293b;transform:translateY(-1px)} -.map-layout{display:grid;grid-template-columns:1fr 240px;gap:14px;align-items:start} -@media(max-width:900px){.map-layout{grid-template-columns:1fr}} +/* MAP + LEGEND COLUMN - centered as a whole, like the header/filters above */ +.map-layout{display:flex;flex-direction:column;align-items:center} + +/* Legend row - Tribes + Artifacts side by side, same width as the map */ +.legend-row{display:flex;gap:14px;width:100%;max-width:510px;margin:14px auto 0} +.legend-row .legend-card{flex:1;margin:0;min-width:0} +@media(max-width:480px){.legend-row{flex-direction:column}} /* MAP CONTAINER - untouched logic */ #map {width:510px;height:510px;position:relative;overflow:hidden;border:1px solid #cbd5e1;background:#f8fafc;border-radius:12px;box-shadow:0 4px 12px rgba(0,0,0,.08)} @@ -103,12 +108,12 @@ body{margin:0;background:#f1f5f9;font-family:system-ui,-apple-system,Segoe UI,Ro /* Legend cards */ .legend-card{background:#fff;border:1px solid #e5e7eb;border-radius:12px;overflow:hidden;margin-bottom:12px;box-shadow:0 1px 3px rgba(0,0,0,.05);color:#0f172a} -.legend-head{background:#0f172a;color:#fff;padding:8px 12px;font-size:13px;font-weight:700} -.legend-body{padding:10px 12px} +.legend-head{background:#0f172a;color:#fff;padding:9px 14px;font-size:13px;font-weight:700} +.legend-body{padding:12px 14px} .legend-body table{width:100%;border-collapse:collapse} -.legend-body td{padding:4px 0;font-size:12px;color:#334155} -.legend-body td:first-child{width:20px} -.legend-body img{width:11px;height:11px;display:block} +.legend-body td{padding:5px 0;font-size:12.5px;color:#334155} +.legend-body td:first-child{width:22px} +.legend-body img{width:13px;height:13px;display:block} /* Tooltip */ .p_info{list-style:none;margin:0;padding:0;color:#0f172a} @@ -147,83 +152,83 @@ body{margin:0;background:#f1f5f9;font-family:system-ui,-apple-system,Segoe UI,Ro
-
-
-
- - 100% - - -
-
- - - - - - - (0,0) -
-
-
-
- - query_return($q); - foreach ($player_info as $p_array) { - $p_name = htmlspecialchars($p_array['username'], ENT_QUOTES); - $p_village = htmlspecialchars($p_array['name'], ENT_QUOTES); - $p_pop = (int)$p_array['pop']; - $p_tribe = $array_tribe[$p_array['tribe']]; - $did = (int)$p_array['wref']; - $uid = (int)$p_array['owner']; - $x = (int)$p_array['x']; - $y = (int)$p_array['y']; - $imgName = "../img/admin/map_".(isset($p_array['size'])? "1".$p_array['size'] : ($p_array['access']!= ADMIN? $p_array['tribe'] : 0)).".gif"; - $pixelDiv = 255; - $xdiv = $pixelDiv / WORLD_MAX; - $p_x = $pixelDiv + ($x * $xdiv); - $p_y = $pixelDiv - ($y * $xdiv); - $tooltip = "
    "; - $tooltip.= "
  • Player: {$p_name}
  • "; - $tooltip.= "
  • Village: {$p_village}
  • "; - $tooltip.= "
  • Coord: ({$x}|{$y})
  • "; - $tooltip.= "
  • Pop: {$p_pop}
  • "; - $tooltip.= "
  • Tribe: {$p_tribe}
  • "; - if ($check3!= "" && isset($p_array['size'])) { - $tooltip.= "
  • Artifact: ".$artifactsEffect[$p_array['size']]."
  • "; - } - $tooltip.= "
"; - $tooltip.= "
" - . "Village" - . "Profile" - . "
"; - $tooltipHover = str_replace(["\\", "'"], ["\\\\", "\\'"], $tooltip); - $tooltipAttr = htmlspecialchars($tooltip, ENT_QUOTES); - echo '
' - . '' - . '
'; +
+
+ + 100% + + +
+
+ - + + + - + (0,0) +
+
+
+
+ + query_return($q); + foreach ($player_info as $p_array) { + $p_name = htmlspecialchars($p_array['username'], ENT_QUOTES); + $p_village = htmlspecialchars($p_array['name'], ENT_QUOTES); + $p_pop = (int)$p_array['pop']; + $p_tribe = $array_tribe[$p_array['tribe']]; + $did = (int)$p_array['wref']; + $uid = (int)$p_array['owner']; + $x = (int)$p_array['x']; + $y = (int)$p_array['y']; + $imgName = "../img/admin/map_".(isset($p_array['size'])? "1".$p_array['size'] : ($p_array['access']!= ADMIN? $p_array['tribe'] : 0)).".gif"; + $pixelDiv = 255; + $xdiv = $pixelDiv / WORLD_MAX; + $p_x = $pixelDiv + ($x * $xdiv); + $p_y = $pixelDiv - ($y * $xdiv); + $tooltip = "
    "; + $tooltip.= "
  • Player: {$p_name}
  • "; + $tooltip.= "
  • Village: {$p_village}
  • "; + $tooltip.= "
  • Coord: ({$x}|{$y})
  • "; + $tooltip.= "
  • Pop: {$p_pop}
  • "; + $tooltip.= "
  • Tribe: {$p_tribe}
  • "; + if ($check3!= "" && isset($p_array['size'])) { + $tooltip.= "
  • Artifact: ".$artifactsEffect[$p_array['size']]."
  • "; } -} - ?> -
- -
-
+ $tooltip.= ""; + $tooltip.= "
" + . "Village" + . "Profile" + . "
"; + $tooltipHover = str_replace(["\\", "'"], ["\\\\", "\\'"], $tooltip); + $tooltipAttr = htmlspecialchars($tooltip, ENT_QUOTES); + echo '
' + . '' + . '
'; + } + } + ?>
- -
+
+
+
+ + +
+
Tribes
@@ -235,7 +240,7 @@ body{margin:0;background:#f1f5f9;font-family:system-ui,-apple-system,Segoe UI,Ro
-
+
Artifacts
@@ -245,11 +250,6 @@ body{margin:0;background:#f1f5f9;font-family:system-ui,-apple-system,Segoe UI,Ro
- -
- -
-
@@ -451,4 +451,4 @@ body{margin:0;background:#f1f5f9;font-family:system-ui,-apple-system,Segoe UI,Ro - \ No newline at end of file +