From 7b411e908cd27f50554ed80bb83932bece8bcbaa Mon Sep 17 00:00:00 2001
From: lietuvis10 <50807912+lietuvis10@users.noreply.github.com>
Date: Sun, 2 Nov 2025 23:41:12 +0200
Subject: [PATCH] Update map.tpl
Updated map UI, allows to scroll in, scroll out, move around map and click on user to open either village or his profile.
---
Admin/Templates/map.tpl | 526 +++++++++++++++++++++++++++++++---------
1 file changed, 410 insertions(+), 116 deletions(-)
diff --git a/Admin/Templates/map.tpl b/Admin/Templates/map.tpl
index d320c8ac..a3ff13a4 100644
--- a/Admin/Templates/map.tpl
+++ b/Admin/Templates/map.tpl
@@ -10,8 +10,10 @@
## ##
#################################################################################
+// ----------------- PHP (logic unchanged, except $pixelDiv = 255) -----------------
$check1 = $check2 = $check3 = "";
$includeSize = true;
+$criteria = "";
if (isset($_POST['show1']) || isset($_POST['show2']) || isset($_POST['show3'])) {
$check1 = isset($_POST['show1']) ? "checked " : "";
@@ -44,127 +46,419 @@ if (isset($_POST['show1']) || isset($_POST['show2']) || isset($_POST['show3']))
}
}
if ($check1 == "" && $check2 == "" && $check3 == "") $criteria = "";
-
?>
+
+
+
+
+ Map
-
-
-
Map!
-
-
This is the map of . Search and find players.
-
Show Option
-
-
+
+
+
+
+
+
Map!
+
This is the map of . Search and find players.
+
+
Show Option
+
+
+
+
+
+
+
+
+ 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";
+
+ // world to pixels (510x510 world; center 255,255)
+ $pixelDiv = 255;
+ $xdiv = $pixelDiv / WORLD_MAX;
+ $p_x = $pixelDiv + ($x * $xdiv);
+ $p_y = $pixelDiv - ($y * $xdiv);
+
+ // Tooltip HTML (shared by hover & sticky)
+ $tooltip = "
";
+ $tooltip .= "- Player name: {$p_name}
";
+ $tooltip .= "- Village name : {$p_village}
";
+ $tooltip .= "- Coordinate: ({$x}|{$y})
";
+ $tooltip .= "- Population: {$p_pop}
";
+ $tooltip .= "- Tribe: {$p_tribe}
";
+ if ($check3 != "" && isset($p_array['size'])) {
+ $tooltip .= "- Artifact effect: ".$artifactsEffect[$p_array['size']]."
";
+ }
+ $tooltip .= "
";
+ $tooltip .= "
";
+
+ // JS string version for hover (escape quotes and backslashes)
+ $tooltipHover = str_replace(["\\", "'"], ["\\\\", "\\'"], $tooltip);
+ // Attribute version for sticky (HTML-encode quotes)
+ $tooltipAttr = htmlspecialchars($tooltip, ENT_QUOTES);
+
+ echo '
'
+ . '

'
+ . '
';
+ }
+ }
+ ?>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+