Redesign install system & New Medal System

Redesign install system & New Medal System

Artefact Holder			[#ARTEFACT]
WW Builder			[#WWBUILDER]
Great Store			[#GREATSTORE]
Wall Master			[#WALLMASTER]
Hero 99+			[#HERO100]
This commit is contained in:
novgorodschi catalin
2026-05-26 10:42:28 +03:00
parent 8c3ab3e5eb
commit fe19587c90
21 changed files with 907 additions and 1389 deletions
+58 -24
View File
@@ -19,44 +19,78 @@
#################################################################################
?>
<style>
.addv-box{width:100%;max-width:220px;border-collapse:separate;border-spacing:0;background:#fff;border:1px solid #e5e7eb;border-radius:10px;overflow:hidden;box-shadow:0 2px 8px rgba(0,0,0,.04);font-family:system-ui}
.addv-box th{background:linear-gradient(135deg,#0f172a,#1e293b);color:#fff;padding:6px 10px;font-weight:600;text-align:center;font-size:13px}
.addv-box td{padding:6px 8px;border-bottom:1px solid #f1f5f9;font-size:12px;color:#334155}
.addv-box tr:last-child td{border-bottom:0;text-align:center}
.addv-sub{font-size:11px;color:#64748b;text-align:center;padding:4px 8px !important;border-bottom:0 !important}
.addv-box td:first-child{width:25%;color:#64748b;font-weight:500}
.addv-box input.fm{width:100%;padding:3px 6px;font-size:12px;border:1px solid #cbd5e1;border-radius:5px;box-sizing:border-box}
.addv-box input.fm:focus{outline:none;border-color:#3b82f6;box-shadow:0 0 0 1px #3b82f6}
.btn-add{display:inline-block;padding:4px 14px;font-size:11px;font-weight:600;color:#fff;background:linear-gradient(180deg,#3b82f6,#2563eb);border:0;border-radius:5px;cursor:pointer;box-shadow:0 1px 2px rgba(0,0,0,.1);text-transform:uppercase;letter-spacing:.3px}
.punish-box{
width:100%;
max-width:none;
border-collapse:separate;
border-spacing:0;
background:#fff;
border:1px solid #e5e7eb;
border-radius:10px;
overflow:hidden;
box-shadow:0 2px 8px rgba(0,0,0,.04);
font-family:system-ui;
margin-bottom:12px;
}
.punish-box th{
background:linear-gradient(135deg,#0f172a,#1e293b);
color:#fff;
padding:8px 12px;
font-weight:600;
text-align:center;
font-size:14px
}
.punish-box td{padding:8px 10px;border-bottom:1px solid #f1f5f9;font-size:13px}
.punish-box tr:last-child td{border-bottom:0}
.punish-row{display:flex;align-items:center;justify-content:space-between;gap:8px}
.fm{padding:4px 8px;font-size:13px;border:1px solid #cbd5e1;border-radius:6px;background:#fff;width:100%}
.fm:disabled{background:#f1f5f9;color:#94a3b8}
.btn-add{
padding:4px 14px;font-size:12px;font-weight:600;color:#fff;
background:linear-gradient(180deg,#3b82f6,#2563eb);
border:0;border-radius:6px;cursor:pointer;
box-shadow:0 1px 2px rgba(0,0,0,.1);text-transform:uppercase
}
.btn-add:hover{filter:brightness(1.05)}
.btn-add:disabled{opacity:.5;cursor:not-allowed}
.btn-add:disabled{opacity:.6;cursor:not-allowed}
.addv-label{color:#64748b;font-size:12px;text-align:center;display:block;margin-bottom:2px}
</style>
<form method="post" action="admin.php" style="margin:0">
<input name="action" type="hidden" value="addVillage">
<input name="uid" type="hidden" value="<?php echo $user['id'];?>">
<table class="addv-box">
<table class="punish-box">
<thead>
<tr><th>Add Village</th></tr>
</thead>
<tbody>
<tr><td class="addv-sub">Coordinates (X|Y)</td></tr>
<tr>
<td style="display:flex;align-items:center;gap:6px;border-bottom:0">
<span style="width:15px">X:</span>
<input name="x" class="fm" type="text" <?php if($_SESSION['access'] != ADMIN){ echo 'disabled'; } ?>>
</td>
<tr>
<td style="padding-bottom:4px;border-bottom:0">
<span class="addv-label">Coordinates (X|Y)</span>
</td>
</tr>
<tr>
<td style="display:flex;align-items:center;gap:6px;border-bottom:0;padding-top:0">
<span style="width:15px">Y:</span>
<input name="y" class="fm" type="text" <?php if($_SESSION['access'] != ADMIN){ echo 'disabled'; } ?>>
</td>
<td style="border-bottom:0;padding-top:0;padding-bottom:4px">
<div class="punish-row">
<label style="width:18px">X:</label>
<input name="x" class="fm" type="text" <?php if($_SESSION['access'] != ADMIN){ echo 'disabled'; } ?>>
</div>
</td>
</tr>
<tr>
<td style="padding-top:8px">
<button type="submit" class="btn-add" <?php if($_SESSION['access'] != ADMIN){ echo 'disabled'; } ?>>Add Village</button>
</td>
<td style="border-bottom:0;padding-top:0">
<div class="punish-row">
<label style="width:18px">Y:</label>
<input name="y" class="fm" type="text" <?php if($_SESSION['access'] != ADMIN){ echo 'disabled'; } ?>>
</div>
</td>
</tr>
<tr>
<td style="padding-top:8px">
<div class="punish-row" style="justify-content:center">
<button type="submit" class="btn-add" <?php if($_SESSION['access'] != ADMIN){ echo 'disabled'; } ?>>ADD VILLAGE</button>
</div>
</td>
</tr>
</tbody>
</table>
+8 -4
View File
@@ -97,10 +97,14 @@ if($deletion){
include("playermedals.tpl");
include ("villages.tpl"); ?>
<div class="player-bottom">
<div><?php include ('punish.tpl'); ?></div>
<div><?php include ('add_village.tpl'); ?></div>
</div>
<div style="display:grid;grid-template-columns:1fr;gap:12px;margin-top:12px;width:100%">
<div>
<?php include "punish.tpl"; ?>
</div>
<div>
<?php include "add_village.tpl"; ?>
</div>
</div>
<?php
$sql = "SELECT * FROM ".TB_PREFIX."banlist WHERE uid = ".(int) $id."";
+26 -7
View File
@@ -22,14 +22,33 @@
$active = $admin->getUserActive();
?>
<style>
.punish-box{width:100%;max-width:220px;border-collapse:separate;border-spacing:0;background:#fff;border:1px solid #e5e7eb;border-radius:10px;overflow:hidden;box-shadow:0 2px 8px rgba(0,0,0,.04);font-family:system-ui}
.punish-box th{background:linear-gradient(135deg,#0f172a,#1e293b);color:#fff;padding:6px 10px;font-weight:600;text-align:center;font-size:13px}
.punish-box td{padding:6px 8px;border-bottom:1px solid #f1f5f9;font-size:12px}
.punish-box{
width:100%;
max-width:none; /* asta era problema */
border-collapse:separate;
border-spacing:0;
background:#fff;
border:1px solid #e5e7eb;
border-radius:10px;
overflow:hidden;
box-shadow:0 2px 8px rgba(0,0,0,.04);
font-family:system-ui;
margin-bottom:12px; /* spațiu între ele */
}
.punish-box th{
background:linear-gradient(135deg,#0f172a,#1e293b);
color:#fff;
padding:8px 12px;
font-weight:600;
text-align:center;
font-size:14px
}
.punish-box td{padding:8px 10px;border-bottom:1px solid #f1f5f9;font-size:13px}
.punish-box tr:last-child td{border-bottom:0}
.punish-row{display:flex;align-items:center;justify-content:space-between;gap:6px}
.punish-box select{padding:3px 6px;font-size:12px;border:1px solid #cbd5e1;border-radius:5px;background:#fff}
.punish-box label{display:flex;align-items:center;gap:5px;cursor:pointer}
.btn-ok{padding:3px 10px;font-size:11px;font-weight:600;color:#fff;background:linear-gradient(180deg,#22c55e,#16a34a);border:0;border-radius:5px;cursor:pointer;box-shadow:0 1px 2px rgba(0,0,0,.1);text-transform:uppercase}
.punish-row{display:flex;align-items:center;justify-content:space-between;gap:8px}
.punish-box select{padding:4px 8px;font-size:13px;border:1px solid #cbd5e1;border-radius:6px;background:#fff;flex:1}
.punish-box label{display:flex;align-items:center;gap:6px;cursor:pointer;flex:1}
.btn-ok{padding:4px 12px;font-size:12px;font-weight:600;color:#fff;background:linear-gradient(180deg,#22c55e,#16a34a);border:0;border-radius:6px;cursor:pointer;box-shadow:0 1px 2px rgba(0,0,0,.1);text-transform:uppercase}
.btn-ok:hover{filter:brightness(1.05)}
</style>
+129 -8
View File
@@ -64,14 +64,135 @@ $profiel = preg_replace("/\[#TEAM]/is",'<img src="'.$gpack.'img/t/team.png" bord
$profiel = preg_replace("/\[#EVENT]/is",'<img src="'.$gpack.'img/t/t10_1.jpg" border="0" onmouseout="med_closeDescription()" onmousemove="med_mouseMoveHandler(arguments[0],\'<table><tr><td>You played on Travian Hammelburg Event. Congrats !</td></tr></table>\')">', $profiel, 1);
}
// WW Winner IMAGES - MUST TO BE SET FROM ADMIN PANEL @iopietro must code
// Added by Shadow - cata7007@gmail.com / Skype : cata7007
if($displayarray['username'] == "Shadow"){
$profiel = preg_replace("/\[#WWBUILDER]/is",'<img src="'.$gpack.'img/t/builderWW.png" border="0" onmouseout="med_closeDescription()" onmousemove="med_mouseMoveHandler(arguments[0],\'<table><tr><td>Country:</td><td>Romania</td></tr><tr><td>Category:</td><td>World of Wonder</td></tr><tr><td>Name:</td><td>Shadow</td></tr><tr><td>Tribe:</td><td>Romans</td></tr><tr><td>WW LEVEL:</td><td>80</td></tr></table>\')">', $profiel, 1);
$profiel = preg_replace("/\[#WINNERWW]/is",'<img src="'.$gpack.'img/t/winnerww.png" border="0" onmouseout="med_closeDescription()" onmousemove="med_mouseMoveHandler(arguments[0],\'<table><tr><td>Country:</td><td>Romania</td></tr><tr><td>Category:</td><td>World of Wonder</td></tr><tr><td>Name:</td><td>Shadow</td></tr><tr><td>Tribe:</td><td>Romans</td></tr><tr><td>WW LEVEL:</td><td>100</td></tr></table>\')">', $profiel, 1);
$profiel = preg_replace("/\[#OFFENSIVE]/is",'<img src="'.$gpack.'img/t/Offensive_1.png" border="0" onmouseout="med_closeDescription()" onmousemove="med_mouseMoveHandler(arguments[0],\'<table><tr><td>Country:</td><td>Romania</td></tr><tr><td>Category:</td><td>Offensive</td></tr><tr><td>Name:</td><td>Shadow</td></tr><tr><td>Tribe:</td><td>Romans</td></tr><tr><td>Rank:</td><td>1</td></tr></table>\')">', $profiel, 1);
$profiel = preg_replace("/\[#DEFENSIVE]/is",'<img src="'.$gpack.'img/t/Defensive_1.png" border="0" onmouseout="med_closeDescription()" onmousemove="med_mouseMoveHandler(arguments[0],\'<table><tr><td>Country:</td><td>Romania</td></tr><tr><td>Category:</td><td>Defensive</td></tr><tr><td>Name:</td><td>Shadow</td></tr><tr><td>Tribe:</td><td>Romans</td></tr><tr><td>Rank:</td><td>1</td></tr></table>\')">', $profiel, 1);
$profiel = preg_replace("/\[#POPULATION]/is",'<img src="'.$gpack.'img/t/Population_1.png" border="0" onmouseout="med_closeDescription()" onmousemove="med_mouseMoveHandler(arguments[0],\'<table><tr><td>Country:</td><td>Romania</td></tr><tr><td>Category:</td><td>Population</td></tr><tr><td>Name:</td><td>Shadow</td></tr><tr><td>Tribe:</td><td>Romans</td></tr><tr><td>Rank:</td><td>1</td></tr></table>\')">', $profiel, 1);
// =========================
// NEW_FUNCTIONS_SPECIAL_MEDALS_SYSTEM - DYNAMIC
// =========================
if(defined('NEW_FUNCTIONS_SPECIAL_MEDALS_SYSTEM') && NEW_FUNCTIONS_SPECIAL_MEDALS_SYSTEM){
$uid = (int)$displayarray['id'];
$username = htmlspecialchars($displayarray['username'], ENT_QUOTES);
$tribeMap = [1=>'Romans',2=>'Teutons',3=>'Gauls'];
$tribeName = $tribeMap[$displayarray['tribe']??0]?? 'Unknown';
// luam WW real
$wwLevel = 0;
$wwName = 'N/A';
$qww = $database->query("
SELECT v.name AS village, f.f99 AS lvl
FROM ".TB_PREFIX."vdata v
INNER JOIN ".TB_PREFIX."fdata f ON f.vref = v.wref
WHERE v.owner = $uid
AND f.f99t = 40 -- tipul 40 = Wonder
AND f.f99 > 0 -- nivel real
ORDER BY f.f99 DESC
LIMIT 1
");
if($qww && $row = $qww->fetch_assoc()){
$wwLevel = (int)$row['lvl'];
$wwName = htmlspecialchars($row['village'], ENT_QUOTES);
}
// [#ARTEFACT]
$profiel = preg_replace_callback("/\[#ARTEFACT\]/is", function($m) use ($database,$uid,$username,$tribeName,$gpack){
$q = $database->query("SELECT size, name FROM ".TB_PREFIX."artefacts WHERE owner=$uid");
if(!$q || !$q->num_rows) return '';
$sizeMap = [
1 => 'Small (Village Effect)',
2 => 'Large (Account Effect)',
3 => 'Unique (Account Effect)'
];
$arts = '';
while($a = $q->fetch_assoc()){
$type = $sizeMap[(int)$a['size']] ?? 'Unknown';
$aname = htmlspecialchars($a['name'], ENT_QUOTES);
$arts .= "<tr><td>Type:</td><td>{$type}</td></tr><tr><td>Artefact:</td><td>{$aname}</td></tr>";
}
$tip = "<table><tr><td>Name:</td><td>{$username}</td></tr><tr><td>Tribe:</td><td>{$tribeName}</td></tr><tr><td>Category:</td><td>Artefact Holder</td></tr>{$arts}</table>";
return "<img src='{$gpack}img/gloriamedals/artifact.png' border='0' onmouseout='med_closeDescription()' onmousemove=\"med_mouseMoveHandler(arguments[0],'{$tip}')\">";
}, $profiel);
// [#WWBUILDER]
if($wwLevel > 0){
$tip = "<table <tr><td>Name:</td><td>{$username}</td></tr><tr><td>Tribe:</td><td>{$tribeName}</td></tr><tr><td>Category:</td><td>World Wonder</td></tr><tr><td>Village:</td><td>{$wwName}</td></tr><tr><td>WW Level:</td><td>{$wwLevel}</td></tr></table>";
$profiel = preg_replace("/\[#WWBUILDER\]/is","<img src='{$gpack}img/gloriamedals/ww_builder.png' border='0' onmouseout='med_closeDescription()' onmousemove=\"med_mouseMoveHandler(arguments[0],'{$tip}')\">",
$profiel);
} else {
$profiel = str_replace("[#WWBUILDER]", "", $profiel);
}
// [#WINNERWW]
if($wwLevel >= 100){
$tip = "<table><tr><td>Name:</td><td>{$username}</td></tr><tr><td>Tribe:</td><td>{$tribeName}</td></tr><tr><td>Category:</td><td>Winner</td></tr><tr><td>WW Level:</td><td>100</td></tr></table>";
$profiel = preg_replace("/\[#WINNERWW\]/is",
"<img src='{$gpack}img/gloriamedals/ww_winner.png' border='0' onmouseout='med_closeDescription()' onmousemove=\"med_mouseMoveHandler(arguments[0],'{$tip}')\">",
$profiel);
}
//[#GREATSTORE] - DOAR Great Warehouse (38) si Great Granary (39) nivel 20
$hasGreatStore = false;
$gsVillage = '';
$q = $database->query("SELECT v.name, f.* FROM ".TB_PREFIX."fdata f JOIN ".TB_PREFIX."vdata v ON v.wref=f.vref WHERE v.owner=$uid");
if($q){
while($f = $q->fetch_assoc()){
$wh = $gr = false;
for($i=1; $i<=99; $i++){
if(!isset($f["f{$i}t"])) continue;
$t = (int)$f["f{$i}t"];
$l = (int)$f["f{$i}"];
if($l == 20 && $t == 38) $wh = true; // Great Warehouse
if($l == 20 && $t == 39) $gr = true; // Great Granary
}
if($wh && $gr){
$hasGreatStore = true;
$gsVillage = htmlspecialchars($f['name'], ENT_QUOTES);
break;
}
}
}
if($hasGreatStore){
$tip = "<table><tr><td>Name:</td><td>{$username}</td></tr><tr><td>Tribe:</td><td>{$tribeName}</td></tr><tr><td>Category:</td><td>Great Store</td></tr><tr><td>Village:</td><td>{$gsVillage}</td></tr><tr><td>Great Warehouse:</td><td>20</td></tr><tr><td>Great Granary:</td><td>20</td></tr></table>";
$profiel = str_replace("[#GREATSTORE]", "<img src='{$gpack}img/gloriamedals/greatstore.png' border='0' onmouseout='med_closeDescription()' onmousemove=\"med_mouseMoveHandler(arguments[0],'{$tip}')\">", $profiel);
} else {
$profiel = str_replace("[#GREATSTORE]", "", $profiel);
}
// [#HERO100]
$q = $database->query("SELECT level FROM ".TB_PREFIX."hero WHERE uid=$uid AND level>=99 LIMIT 1");
if($q && $q->num_rows){
$heroLvl = (int)$q->fetch_assoc()['level'];
$tip = "<table><tr><td>Name:</td><td>{$username}</td></tr><tr><td>Tribe:</td><td>{$tribeName}</td></tr><tr><td>Category:</td><td>Hero Level</td></tr><tr><td>Level:</td><td>{$heroLvl}</td></tr></table>";
$profiel = str_replace("[#HERO100]", "<img src='{$gpack}img/gloriamedals/hero.png' border='0' onmouseout='med_closeDescription()' onmousemove=\"med_mouseMoveHandler(arguments[0],'{$tip}')\">", $profiel);
} else {
$profiel = str_replace("[#HERO100]", "", $profiel);
}
// [#WALLMASTER] - 3 sate cu zid (31/32/33) nivel 20 in slotul 40
$wallCount = 0;
$q = $database->query("SELECT f.f40, f.f40t FROM ".TB_PREFIX."fdata f
JOIN ".TB_PREFIX."vdata v ON v.wref=f.vref
WHERE v.owner=$uid");
if($q){
while($r = $q->fetch_assoc()){
if((int)$r['f40'] == 20 && in_array((int)$r['f40t'], [31,32,33])){
$wallCount++;
}
}
}
if($wallCount >= 3){
$tip = "<table><tr><td>Name:</td><td>{$username}</td></tr><tr><td>Tribe:</td><td>{$tribeName}</td></tr><tr><td>Category:</td><td>Wall Master</td></tr><tr><td>Walls level 20:</td><td>{$wallCount}</td></tr></table>";
$profiel = str_replace("[#WALLMASTER]", "<img src='{$gpack}img/gloriamedals/wallmaster.png' border='0' onmouseout='med_closeDescription()' onmousemove=\"med_mouseMoveHandler(arguments[0],'{$tip}')\">", $profiel);
} else {
$profiel = str_replace("[#WALLMASTER]", "", $profiel);
}
}
// Added by Shadow - cata7007@gmail.com / Skype : cata7007
+101
View File
@@ -291,6 +291,107 @@ if(($session->userinfo['username'] ?? '') == "Shadow"){
echo "<tr><td>Shadow</td><td></td><td></td>
<td><a href='#' onclick=\"insertMedal('[#EVENT]'); return false;\">[#EVENT]</a></td></tr>";
}
// =========================
// SPECIAL MEDALS
// =========================
if(defined('NEW_FUNCTIONS_SPECIAL_MEDALS_SYSTEM') && NEW_FUNCTIONS_SPECIAL_MEDALS_SYSTEM){
$uid = (int)$session->uid;
// 1. Artefact - CORECTAT coloanele (4 td-uri)
$arte = $database->query("SELECT 1 FROM ".TB_PREFIX."artefacts WHERE owner = $uid LIMIT 1");
if($arte && $arte->num_rows > 0){
echo "<tr>
<td>Artefact Holder</td>
<td></td>
<td></td>
<td><a href='#' onclick=\"insertMedal('[#ARTEFACT]'); return false;\">[#ARTEFACT]</a></td>
</tr>";
}
// 2. WW - CORECTAT la f99 (la tine WW e in f99, nu f40)
$ww = $database->query("SELECT f.f99 FROM ".TB_PREFIX."vdata v
INNER JOIN ".TB_PREFIX."fdata f ON f.vref = v.wref
WHERE v.owner = $uid AND f.f99t = 40 AND f.f99 > 0 LIMIT 1");
if($ww && $ww->num_rows > 0){
echo "<tr>
<td>WW Builder</td>
<td></td>
<td></td>
<td><a href='#' onclick=\"insertMedal('[#WWBUILDER]'); return false;\">[#WWBUILDER]</a></td>
</tr>";
$lvl = (int)$ww->fetch_assoc()['f99'];
if($lvl >= 100){
echo "<tr>
<td>WW Winner</td>
<td></td>
<td></td>
<td><a href='#' onclick=\"insertMedal('[#WINNERWW]'); return false;\">[#WINNERWW]</a></td>
</tr>";
}
}
// 3. GREATSTORE - DOAR 38 si 39 nivel 20
$hasGreatStore = false;
$qgs = $database->query("SELECT f.* FROM ".TB_PREFIX."fdata f
JOIN ".TB_PREFIX."vdata v ON v.wref=f.vref
WHERE v.owner=$uid");
if($qgs){
while($f = $qgs->fetch_assoc()){
$hasWh = $hasGr = false;
for($i=1; $i<=99; $i++){
if(!isset($f["f{$i}t"])) continue;
$type = (int)$f["f{$i}t"];
$lvl = (int)$f["f{$i}"];
if($type == 38 && $lvl == 20) $hasWh = true; // Great Warehouse
if($type == 39 && $lvl == 20) $hasGr = true; // Great Granary
}
if($hasWh && $hasGr){ $hasGreatStore = true; break; }
}
}
if($hasGreatStore){
echo "<tr>
<td>Great Store</td>
<td></td>
<td></td>
<td><a href='#' onclick=\"insertMedal('[#GREATSTORE]'); return false;\">[#GREATSTORE]</a></td>
</tr>";
}
// 4. WALLMASTER - 5 sate cu zid 20 (31/32/33), fara f40/f99
$wallCount = 0;
$qw = $database->query("SELECT f.f40, f.f40t FROM ".TB_PREFIX."fdata f
JOIN ".TB_PREFIX."vdata v ON v.wref=f.vref
WHERE v.owner=$uid");
if($qw){
while($r = $qw->fetch_assoc()){
if((int)$r['f40'] == 20 && in_array((int)$r['f40t'], [31,32,33])){
$wallCount++;
}
}
}
if($wallCount >= 3){
echo "<tr>
<td>Wall Master</td>
<td></td>
<td></td>
<td><a href='#' onclick=\"insertMedal('[#WALLMASTER]'); return false;\">[#WALLMASTER]</a></td>
</tr>";
}
// 5. HERO100 - erou nivel 99+
$h100 = $database->query("SELECT 1 FROM ".TB_PREFIX."hero WHERE uid=$uid AND level>=99 LIMIT 1");
if($h100 && $h100->num_rows){
echo "<tr>
<td>Hero 99+</td>
<td></td>
<td></td>
<td><a href='#' onclick=\"insertMedal('[#HERO100]'); return false;\">[#HERO100]</a></td>
</tr>";
}
}
?>
</table>
Binary file not shown.

After

Width:  |  Height:  |  Size: 7.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

+1
View File
@@ -318,6 +318,7 @@ define("NEW_FUNCTIONS_DISPLAY_LINKS", %NEW_FUNCTIONS_DISPLAY_LINKS%);
define("NEW_FUNCTIONS_MEDAL_3YEAR", %NEW_FUNCTIONS_MEDAL_3YEAR%);
define("NEW_FUNCTIONS_MEDAL_5YEAR", %NEW_FUNCTIONS_MEDAL_5YEAR%);
define("NEW_FUNCTIONS_MEDAL_10YEAR", %NEW_FUNCTIONS_MEDAL_10YEAR%);
define("NEW_FUNCTIONS_SPECIAL_MEDALS_SYSTEM", %NEW_FUNCTIONS_SPECIAL_MEDALS_SYSTEM%);
//////////////////////////////////////////
+1
View File
@@ -168,6 +168,7 @@ class Process {
$findReplace["%NEW_FUNCTIONS_MEDAL_3YEAR%"] = $_POST['new_functions_medal_3year'];
$findReplace["%NEW_FUNCTIONS_MEDAL_5YEAR%"] = $_POST['new_functions_medal_5year'];
$findReplace["%NEW_FUNCTIONS_MEDAL_10YEAR%"] = $_POST['new_functions_medal_10year'];
$findReplace["%NEW_FUNCTIONS_SPECIAL_MEDALS_SYSTEM%"] = $_POST['new_functions_special_medals_system'];
fwrite($gameConfig, str_replace(array_keys($findReplace), array_values($findReplace), $text));
+71 -93
View File
@@ -1,106 +1,84 @@
<?php
#################################################################################
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
## --------------------------------------------------------------------------- ##
## Project: TravianZ ##
## Filename accounts.php ##
## Developed by: Dzoki ##
## License: TravianZ Project ##
## Copyright: TravianZ (c) 2010-2026. All rights reserved. ##
## URLs: https://travianz.org ##
## https://github.com/Shadowss/TravianZ ##
## ##
## Filename : accounts.tpl ##
## Type : Install Panel Frontend & Backend ##
## --------------------------------------------------------------------------- ##
## Developed by : Dzoki (Original) ##
## Refactored by : Shadow ##
## Redesign by : Shadow ##
## --------------------------------------------------------------------------- ##
## Contact : cata7007@gmail.com ##
## Project : TravianZ ##
## GitHub : https://github.com/Shadowss/TravianZ ##
## --------------------------------------------------------------------------- ##
## License : TravianZ Project ##
## Copyright : TravianZ (c) 2010-2025. All rights reserved. ##
## --------------------------------------------------------------------------- ##
#################################################################################
if(isset($_GET['err']) && $_GET['err'] == 1) {
echo "<br /><hr /><br /><div class=\"headline\"><span class=\"f10 c5\">At least Multihunter &amp; Support password are required in this form.</span></div><br /><br />";
echo '<div class="card" style="background:#fef2f2;border-color:#fecaca;color:#991b1b;margin-bottom:14px;">At least Multihunter & Support password are required.</div>';
}
if(isset($_GET['err']) && $_GET['err'] == 2) {
echo "<br /><hr /><br /><div class=\"headline\"><span class=\"f10 c5\">Natars is a reserved username for an in-game NPC tribe. Please choose a different admin username.</span></div><br /><br />";
echo '<div class="card" style="background:#fef2f2;border-color:#fecaca;color:#991b1b;margin-bottom:14px;">Natars is reserved. Choose different admin username.</div>';
}
?>
<form action="include/accounts.php" method="post" id="dataform">
<div class="grid-2">
<div class="card">
<span class="f10 c">Multihunter account</span>
<div style="margin-top:12px;display:grid;gap:10px;">
<div><label>Name</label><input class="input" type="text" value="Multihunter" disabled></div>
<div><label>Password</label><input class="input" type="password" name="mhpw" required></div>
</div>
</div>
<div class="card">
<span class="f10 c">Support account</span>
<div style="margin-top:12px;display:grid;gap:10px;">
<div><label>Name</label><input class="input" type="text" value="Support" disabled></div>
<div><label>Password</label><input class="input" type="password" name="spw" required></div>
</div>
</div>
</div>
<p>
<span class="f10 c">Multihunter account</span>
<table>
<tr><td>Name:</td><td><input type="text" name="mhuser" id="mhuser" value="Multihunter" disabled="disabled"></td></tr>
<tr><td>Password:</td><td><input type="password" name="mhpw" id="mhpw" value=""></td></tr>
<tr><td>Note: Rember this password! You need it for the Admin</td><td></td></tr>
</table>
</p>
<p>
<span class="f10 c">Support account</span>
<table>
<tr><td>Name:</td><td><input type="text" name="suser" id="suser" value="Support" disabled="disabled"></td></tr>
<tr><td>Password:</td><td><input type="password" name="spw" id="spw" value=""></td></tr>
<tr><td>Note: Rember this password! You need it for the Admin</td><td></td></tr>
</table>
</p>
<p>
<span class="f10 c">Admin account</span>
<table>
<tr>
<td><span class="f9 c6">Admin name:</span></td>
<td><input type="text" name="aname" id="aname" value=""></td>
</tr>
<tr>
<td><span class="f9 c6">Admin email:</span></td>
<td><input type="text" name="aemail" id="aemail" value=""></td>
</tr>
<tr>
<td><span class="f9 c6">Admin password:</span></td>
<td><input type="password" name="apass" id="apass" value=""></td>
</tr>
<tr>
<td><span class="f9 c6">Admin tribe:</span></td>
<td>
<select name="atribe" id="atribe">
<option value="1" selected="selected">Romans</option>
<option value="2">Teutons</option>
<option value="3">Gauls</option>
</select>
</td>
</tr>
<tr>
<td><span class="f9 c6">Show admin in stats:</span></td>
<td>
<select name="admin_rank">
<option value="true">true</option>
<option value="false" selected="selected">false</option>
</select>
</td>
</tr>
<tr>
<td><span class="f9 c6">Include Support Messages in Admin Mailbox:</span></td>
<td>
<select name="admin_support_msgs">
<option value="true" selected="selected">true</option>
<option value="false">false</option>
</select>
</td>
</tr>
<tr>
<td><span class="f9 c6">Allow Administrative Accounts to be Raided and Attacked:</span></td>
<td>
<select name="admin_raidable">
<option value="true" selected="selected">true</option>
<option value="false">false</option>
</select>
</td>
</tr>
<tr><td colspan="2">Note: this will add a first user and will set them up as an Admin</td><td></td></tr>
<tr><td colspan="2">Note: you can leave this section empty, if you want</td><td></td></tr>
</table>
</p>
<center>
<input type="submit" name="Submit" id="Submit" value="Submit"></center>
</form>
</div>
<div class="card">
<span class="f10 c">Admin account</span>
<div class="grid-2" style="margin-top:12px;">
<div><label>Admin name</label><input class="input" name="aname"></div>
<div><label>Admin email</label><input class="input" name="aemail" type="email"></div>
<div><label>Admin password</label><input class="input" name="apass" type="password"></div>
<div><label>Tribe</label>
<select class="input" name="atribe">
<option value="1" selected>Romans</option>
<option value="2">Teutons</option>
<option value="3">Gauls</option>
</select>
</div>
<div><label>Show in stats</label>
<select class="input" name="admin_rank">
<option value="true">true</option>
<option value="false" selected>false</option>
</select>
</div>
<div><label>Include Support Msgs</label>
<select class="input" name="admin_support_msgs">
<option value="true" selected>true</option>
<option value="false">false</option>
</select>
</div>
<div><label>Allow Raidable</label>
<select class="input" name="admin_raidable">
<option value="true" selected>true</option>
<option value="false">false</option>
</select>
</div>
</div>
<p style="color:#64748b;font-size:12px;margin-top:12px;">Note: leave empty if you want to skip admin creation.</p>
<div style="text-align:center;margin-top:12px;">
<button class="btn" type="submit">Create Accounts</button>
</div>
</div>
</form>
File diff suppressed because it is too large Load Diff
+25 -38
View File
@@ -3,50 +3,37 @@
#################################################################################
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
## --------------------------------------------------------------------------- ##
## Project: TravianZ ##
## Filename dataform.php ##
## Developed by: Dzoki ##
## License: TravianZ Project ##
## Copyright: TravianZ (c) 2010-2026. All rights reserved. ##
## URLs: https://travianz.org ##
## https://github.com/Shadowss/TravianZ ##
## ##
## Filename : dataform.tpl ##
## Type : Install Panel Frontend & Backend ##
## --------------------------------------------------------------------------- ##
## Developed by : Dzoki (Original) ##
## Refactored by : Shadow ##
## Redesign by : Shadow ##
## --------------------------------------------------------------------------- ##
## Contact : cata7007@gmail.com ##
## Project : TravianZ ##
## GitHub : https://github.com/Shadowss/TravianZ ##
## --------------------------------------------------------------------------- ##
## License : TravianZ Project ##
## Copyright : TravianZ (c) 2010-2025. All rights reserved. ##
## --------------------------------------------------------------------------- ##
#################################################################################
include_once('../GameEngine/config.php');
if(isset($_GET['c']) && $_GET['c'] == 1) {
echo "<div class=\"headline\"><span class=\"f10 c5\">Error importing database. Check configuration.</span></div><br>";
echo '<div class="card" style="border-color:#fecaca;background:#fef2f2;color:#991b1b;"><b>Error importing database. Check configuration.</b></div>';
}
if(isset($_GET['err']) && $_GET['err'] == 1) {
echo "<br /><hr /><br /><div class=\"headline\"><span class=\"f10 c5\">Existing structure was found in the database! Please remove old game tables with the <i>".TB_PREFIX."</i> prefix from the '<strong>".SQL_DB."</strong>' database before continuing.</span></div><br /><br />";
echo '<div class="card" style="border-color:#fecaca;background:#fef2f2;color:#991b1b;">Existing structure found! Please remove tables with prefix <b>'.TB_PREFIX.'</b> from database <b>'.SQL_DB.'</b>.</div>';
}
?>
<form action="process.php" method="post" id="dataform">
<input type="hidden" name="substruc" value="1">
<p>
<span class="f10 c">Create Database Structure</span>
<table>
<tr>
<td>
<b>Warning</b>: This can take some time. Please wait until the next page has been loaded. Click Create to proceed...
<br>
<br>
</td>
</tr>
<tr>
<td>
<center>
<input type="submit" name="Submit" id="Submit" value="Create..." onClick="return proceed()">
<br>
<br>
</center>
</td>
</tr>
</table>
</p>
</form>
</div>
<input type="hidden" name="substruc" value="1">
<div class="card">
<span class="f10 c">Create Database Structure</span>
<p style="color:#475569;"><b>Warning</b>: This can take some time. Please wait until the next page loads.</p>
<div style="text-align:center;margin-top:12px;">
<button class="btn" id="Submit" onclick="return proceed()">Create Database...</button>
</div>
</div>
</form>
+54 -50
View File
@@ -1,57 +1,61 @@
<?php
<?php
#################################################################################
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
## --------------------------------------------------------------------------- ##
## Project: TravianZ ##
## Filename end.php ##
## Developed by: Dzoki ##
## License: TravianZ Project ##
## Copyright: TravianZ (c) 2010-2026. All rights reserved. ##
## URLs: https://travianz.org ##
## https://github.com/Shadowss/TravianZ ##
## ##
## Filename : end.tpl ##
## Type : Install Panel Frontend & Backend ##
## --------------------------------------------------------------------------- ##
## Developed by : Dzoki (Original) ##
## Refactored by : Shadow ##
## Redesign by : Shadow ##
## --------------------------------------------------------------------------- ##
## Contact : cata7007@gmail.com ##
## Project : TravianZ ##
## GitHub : https://github.com/Shadowss/TravianZ ##
## --------------------------------------------------------------------------- ##
## License : TravianZ Project ##
## Copyright : TravianZ (c) 2010-2025. All rights reserved. ##
## --------------------------------------------------------------------------- ##
#################################################################################
?>
<p>
Thanks for installing TravianZ.
<h4>Please remove/rename the installation folder.</h4>
All the files are placed. The database is created, so you can now start playing on your own Travian.
</p>
<ul>
<li><h4>After Installation</h4></li>
<li>Delete install folder (sudo rm -R install)</li>
<li>CHMOD GameEngine back to 755 (sudo chmod -R 755 GameEngine)</li>
<li>CHMOD Prevention to 777 (sudo chmod -R 777 GameEngine/Prevention)</li>
<li>CHMOD Notes to 777 (sudo chmod -R 777 GameEngine/Notes)</li>
<li>CHMOD var/log to 777 (sudo chmod -R 777 var/log)</li>
</ul>
<ul>
<li><h4>After Installation</h4></li>
<li>Protect folder /Admin with password protect directory</li>
</ul>
<?php include("../GameEngine/config.php");
$time = time();
rename("../install/","../installed_".$time);
touch('../var/installed');
?>
<p>
<center><font size="4"><a href="<?php echo HOMEPAGE; ?>">> My TravianZ homepage <</font></a></center>
</p>
</br>
<center>
<h2>Please support our developers and donate.</h2>
</br>
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="hosted_button_id" value="QHUTVY5MLECFQ">
<input type="image" src="https://www.paypalobjects.com/en_US/GB/i/btn/btn_donateCC_LG.gif" border="0" name="submit" alt="PayPal The safer, easier way to pay online!">
<img alt="" border="0" src="https://www.paypalobjects.com/en_GB/i/scr/pixel.gif" width="1" height="1">
</form>
</center>
include("../GameEngine/config.php"); $time=time(); @rename("../install/","../installed_".$time); @touch('../var/installed'); ?>
<div class="card" style="text-align:center;">
<h2 style="margin:0 0 8px;">🎉 Installation Complete!</h2>
<p style="color:#475569;">Thanks for installing TravianZ. Please remove the install folder.</p>
<div style="display:inline-block;text-align:left;background:#0f172a;color:#e2e8f0;border-radius:10px;padding:12px 16px;font-family:ui-monospace;font-size:13px;line-height:1.6;">
rm -R install<br>
chmod -R 755 GameEngine<br>
chmod -R 777 GameEngine/Prevention<br>
chmod -R 777 GameEngine/Notes<br>
chmod -R 777 var/log
</div>
<div style="margin-top:16px;"><a class="btn" href="<?php echo HOMEPAGE; ?>">Go to Homepage →</a></div>
</div>
<div class="card">
<h3 style="margin:0 0 12px;text-align:center;">🚀 Next Steps</h3>
<div class="grid-2" style="gap:14px;">
<div style="background:#f8fafc;border:1px solid #e5e7eb;border-radius:12px;padding:14px;">
<b>🔒 Secure Your Server</b>
<p style="margin:6px 0 0;color:#475569;font-size:14px;">Protect /Admin with .htpasswd, enable HTTPS, and set cronjobs for automated tasks.</p>
</div>
<div style="background:#f8fafc;border:1px solid #e5e7eb;border-radius:12px;padding:14px;">
<b>📖 Read the Docs</b>
<p style="margin:6px 0 0;color:#475569;font-size:14px;">Learn about speed settings, Natars, and world configuration in the GitHub Wiki.</p>
</div>
<div style="background:#f8fafc;border:1px solid #e5e7eb;border-radius:12px;padding:14px;">
<b>💬 Join Community</b>
<p style="margin:6px 0 0;color:#475569;font-size:14px;">Get help, share mods, and report bugs on GitHub Discussions.</p>
</div>
<div style="background:#f8fafc;border:1px solid #e5e7eb;border-radius:12px;padding:14px;">
<b>⭐ Star on GitHub</b>
<p style="margin:6px 0 0;color:#475569;font-size:14px;">If you like TravianZ, star the repo to support the project.</p>
</div>
</div>
<div style="text-align:center;margin-top:16px;display:flex;gap:10px;justify-content:center;flex-wrap:wrap;">
<a class="btn" style="background:#0f172a;" href="https://github.com/Shadowss/TravianZ" target="_blank">GitHub</a>
<a class="btn" style="background:#16a34a;" href="https://github.com/Shadowss/TravianZ/wiki" target="_blank">Documentation</a>
<a class="btn" style="background:#64748b;" href="mailto:cata7007@gmail.com">Contact Support</a>
</div>
</div>
+39 -50
View File
@@ -1,51 +1,40 @@
<br>
<h4>&nbsp;&nbsp;Disclaimer</h4>
<ul>
<li>Along with the installation/usage of this game, you shall be fully responsible for any legal results that may raised initiated by the owners of any unlicensed content you permit your copy of this game to publish.</li>
<li>Neither the team that created this script nor the team that customised it to create this distribution/release shall be responsible for any damage done to your computer/server system.</li>
<li>All code was confirmed to be running correctly by the creation team without any visible security risk they were aware of at the time the released it. Similarly for the customisation team who customised it to create this distribution/release.</li>
<li>Users are asked to review the code on their own accord and behalf.</li>
<li>Any customization to the source code are the property of each customisation's author, it is up to each author's discretion whether to share it by including it in free open source distributions such as this one.</li>
<li><b>You have no rights to edit copyright notices or/and claim this script as your own.</b></li>
<li>Last but not least, Enjoy.</li>
</ul>
<br>
<ul>
<li><h4>Before Installation (Linux):</h4></li>
<li>CHMOD install to 777 (chmod -R 777 install)</li>
<li>CHMOD GameEngine to 777 (chmod -R 777 GameEngine)</li>
<li><h4>After Installation</h4></li>
<li>Delete install folder (sudo rm -R install)</li>
<li>CHMOD GameEngine back to 755 (sudo chmod -R 755 GameEngine)</li>
<li>CHMOD Prevention to 777 (sudo chmod -R 777 GameEngine/Prevention)</li>
<li>CHMOD Notes to 777 (sudo chmod -R 777 GameEngine/Notes)</li>
<li>CHMOD var/log to 777 (sudo chmod -R 777 var/log)</li>
</ul>
<ul>
<li><h4>After Installation</h4></li>
<li>Protect folder /Admin with password protect directory</li>
</ul>
<div class="lbox">
TravianZ Team
</div>
<br>
<center>
<form>
<input type="button" name="next" value="Next" onclick="location.href='?s=1'">
</form>
</center>
<div class="card">
<h3 style="margin:0 0 8px;font-size:16px;">⚠️ Disclaimer</h3>
<ul style="margin:0;padding-left:18px;line-height:1.6;color:#334155;">
<li>Along with the installation/usage of this game, you shall be fully responsible for any legal results...</li>
<li>Neither the team that created this script nor the team that customised it shall be responsible for any damage...</li>
<li>All code was confirmed to be running correctly by the creation team...</li>
<li>Users are asked to review the code on their own accord.</li>
<li>Any customization to the source code are the property of each author's discretion.</li>
<li><b>You have no rights to edit copyright notices or/and claim this script as your own.</b></li>
<li>Last but not least, Enjoy.</li>
</ul>
</div>
<div class="grid-2">
<div class="card">
<h3 style="margin:0 0 8px;">🐧 Before Installation (Linux)</h3>
<div style="font-family:ui-monospace;background:#0f172a;color:#e2e8f0;padding:10px;border-radius:8px;font-size:13px;">
chmod -R 777 install<br>chmod -R 777 GameEngine
</div>
</div>
<div class="card">
<h3 style="margin:0 0 8px;">✅ After Installation</h3>
<div style="font-family:ui-monospace;background:#0f172a;color:#e2e8f0;padding:10px;border-radius:8px;font-size:13px;">
rm -R install<br>
chmod -R 755 GameEngine<br>
chmod -R 777 GameEngine/Prevention<br>
chmod -R 777 GameEngine/Notes<br>
chmod -R 777 var/log
</div>
</div>
</div>
<div class="card">
<b>🔒 Protect /Admin</b> with password protect directory (.htaccess).
</div>
<div style="text-align:center;margin-top:16px;">
<a class="btn" href="?s=1">Next →</a>
<div style="margin-top:8px;color:#64748b;font-size:12px;">TravianZ Team</div>
</div>
+23 -31
View File
@@ -1,38 +1,30 @@
<div class="menu">
<div class="stepper">
<?php
#################################################################################
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
## --------------------------------------------------------------------------- ##
## Project: TravianZ ##
## Filename menu.php ##
## Developed by: Dzoki ##
## License: TravianZ Project ##
## Copyright: TravianZ (c) 2010-2026. All rights reserved. ##
## URLs: http://travian.shadowss.ro ##
## Source code: https://github.com/Shadowss/TravianZ ##
## ##
## Filename : menu.tpl ##
## Type : Install Panel Frontend & Backend ##
## --------------------------------------------------------------------------- ##
## Developed by : Dzoki (Original) ##
## Refactored by : Shadow ##
## Redesign by : Shadow ##
## --------------------------------------------------------------------------- ##
## Contact : cata7007@gmail.com ##
## Project : TravianZ ##
## GitHub : https://github.com/Shadowss/TravianZ ##
## --------------------------------------------------------------------------- ##
## License : TravianZ Project ##
## Copyright : TravianZ (c) 2010-2025. All rights reserved. ##
## --------------------------------------------------------------------------- ##
#################################################################################
switch($_GET['s']) {
case 0:
echo "<li class=\"c2 f9\">Intro</li><li class=\"c1 f9\">Configuration</li><li class=\"c1 f9\">Database</li><li class= \"c1 f9\">World Data</li><li class=\"c1 f9\">Accounts</li><li class=\"c1 f9\">End</li>";
break;
case 1:
echo "<li class=\"c3 f9\">Intro</li><li class=\"c2 f9\">Configuration</li><li class=\"c1 f9\">Database</li><li class= \"c1 f9\">World Data</li><li class=\"c1 f9\">Accounts</li><li class=\"c1 f9\">End</li>";
break;
case 2:
echo "<li class=\"c3 f9\">Intro</li><li class=\"c3 f9\">Configuration</li><li class=\"c2 f9\">Database</li><li class= \"c1 f9\">World Data</li><li class=\"c1 f9\">Accounts</li><li class=\"c1 f9\">End</li>";
break;
case 3:
echo "<li class=\"c3 f9\">Intro</li><li class=\"c3 f9\">Configuration</li><li class=\"c3 f9\">Database</li><li class= \"c2 f9\">World Data</li><li class=\"c1 f9\">Accounts</li><li class=\"c1 f9\">End</li>";
break;
case 4:
echo "<li class=\"c3 f9\">Intro</li><li class=\"c3 f9\">Configuration</li><li class=\"c3 f9\">Database</li><li class= \"c3 f9\">World Data</li><li class=\"c2 f9\">Accounts</li><li class=\"c1 f9\">End</li>";
break;
case 5:
echo "<li class=\"c3 f9\">Intro</li><li class=\"c3 f9\">Configuration</li><li class=\"c3 f9\">Database</li><li class= \"c3 f9\">World Data</li><li class=\"c3 f9\">Accounts</li><li class=\"c2 f9\">End</li>";
break;
}
?></div>
$steps = ['Intro','Configuration','Database','World Data','Accounts','End'];
$cur = (int)($_GET['s'] ?? 0);
foreach($steps as $i=>$name){
$state = $i < $cur ? 'done' : ($i == $cur ? 'active' : '');
echo "<div class='step $state'><span class='num'>".($i+1)."</span><span>$name</span></div>";
}
?>
</div>
+105 -137
View File
@@ -1,145 +1,113 @@
<style type="text/css">
.menu{
margin-left: 23px;
margin-top: 50px;
}
.f18 {
font-size: 18pt;
}
span.cc3 {position: absolute;right:10%}
span.cc2 {position: absolute;left:10%}
<style>
:root{
--bg:#0f172a; --bg2:#1e293b; --card:#ffffff; --muted:#64748b;
--text:#0f172a; --border:#e5e7eb; --primary:#16a34a; --radius:14px;
}
*{box-sizing:border-box}
body{margin:0;background:#f1f5f9!important;font-family:system-ui,-apple-system,Segoe UI,Roboto,Arial;color:var(--text);}
div.lbox {width: 280px; padding-left: 29px; padding-bottom: 15px;}
div.rbox {width: 196px; padding-left: 10px; padding-bottom: 15px;}
div.wholebox {width: 494px; padding-left: 29px; padding-bottom: 15px;}
div.wholebox div {float:none;}
div.lbox ul, div.rbox ul {margin: 0 0 0 15px; padding: 0 15px 0 0;}
/* ASCUNDE VECHIUL */
#header, #mtop, #dynamic_header, img#msfilter, .footer-stopper, #side_info,
#footer, .footer, #ce, div[style*="TRAVIANGAMES"], .copyright {display:none !important;}
.wrapper{max-width:1100px;margin:0 auto!important;padding:0 16px 20px!important;background:transparent!important;box-shadow:none!important;}
/* HEADER */
.tz-header{
max-width:1100px;margin:20px auto 0;padding:22px 24px;
background:linear-gradient(135deg,var(--bg),var(--bg2));
border-radius:18px;color:#fff;display:flex;align-items:center;gap:16px;
box-shadow:0 12px 30px rgba(2,6,23,.25);
}
.tz-header svg{width:42px;height:42px;flex-shrink:0;}
.tz-header h1{margin:0;font-size:24px;letter-spacing:.3px;}
.tz-header p{margin:2px 0 0;color:#cbd5e1;font-size:13px;}
/* FOOTER NOU */
.tz-footer{
max-width:1100px;margin:30px auto 30px;padding:16px 20px;
background:#fff;border:1px solid var(--border);border-radius:14px;
display:flex;justify-content:space-between;align-items:center;gap:12px;
color:#64748b;font-size:13px;box-shadow:0 4px 14px rgba(0,0,0,.04);
}
.tz-footer b{color:#0f172a;}
@media(max-width:700px){.tz-footer{flex-direction:column;text-align:center;}}
#mid{display:grid!important;grid-template-columns:260px 1fr!important;gap:18px!important;margin:18px 0 0!important;background:transparent!important;}
#side_navi{background:var(--card)!important;border:1px solid var(--border)!important;border-radius:var(--radius)!important;padding:14px!important;height:fit-content!important;box-shadow:0 4px 14px rgba(0,0,0,.04)!important;}
#content.login{background:var(--card)!important;border:1px solid var(--border)!important;border-radius:var(--radius)!important;padding:22px!important;box-shadow:0 4px 14px rgba(0,0,0,.04)!important;float:none!important;width:auto!important;margin:0!important;}
.headline{text-align:center;margin:8px 0 18px;}
.headline .f18{font-size:22px!important;font-weight:700!important;color:#dc2626!important;}
.card{background:#fff;border:1px solid var(--border);border-radius:12px;padding:16px;margin-bottom:14px;}
.btn{display:inline-block;background:var(--primary);color:#fff;border:0;padding:10px 18px;border-radius:10px;font-weight:600;cursor:pointer;text-decoration:none;box-shadow:0 6px 16px rgba(22,163,74,.2);}
.btn:hover{filter:brightness(1.05);}
.input{width:100%;padding:10px 12px;border:1px solid var(--border);border-radius:10px;font-size:14px;background:#fff;}
.grid-2{display:grid;grid-template-columns:1fr 1fr;gap:14px;}
@media(max-width:900px){#mid{grid-template-columns:1fr!important;}.tz-header{margin:12px 16px 0;}}
/* STEPPER */
.stepper{display:flex;flex-direction:column;gap:8px;}
.step{display:flex!important;align-items:center!important;gap:10px!important;padding:8px 10px!important;border-radius:10px!important;color:#334155!important;position:static!important;}
.step .num{width:28px!important;height:28px!important;min-width:28px!important;border-radius:50%!important;display:flex!important;align-items:center!important;justify-content:center!important;background:#e2e8f0!important;color:#334155!important;font-weight:700!important;font-size:13px!important;position:static!important;}
.step.active{background:#ecfdf5!important;color:#065f46!important;}
.step.active .num{background:#16a34a!important;color:#fff!important;}
.step.done{color:#166534!important;}
.step.done .num{background:#bbf7d0!important;color:#166534!important;}
</style>
<script>
document.addEventListener('DOMContentLoaded',function(){
// HEADER
var h = document.createElement('div');
h.className = 'tz-header';
h.innerHTML = `
<svg viewBox="0 0 64 64" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M32 4L8 14v14c0 13.5 9.3 26.1 24 30 14.7-3.9 24-16.5 24-30V14L32 4z" fill="url(#g)"/>
<path d="M32 8l20 8v12c0 11.2-7.7 21.7-20 25-12.3-3.3-20-13.8-20-25V16l20-8z" fill="#16a34a" opacity=".9"/>
<path d="M26 32l5 5 11-11" stroke="white" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"/>
<defs><linearGradient id="g" x1="8" y1="4" x2="56" y2="58"><stop stop-color="#22c55e"/><stop offset="1" stop-color="#0f172a"/></linearGradient></defs>
</svg>
<div><h1>TravianZ Installation</h1><p>Setup wizard v.9.0 Incremental Refactor</p></div>
`;
var wrap = document.querySelector('.wrapper');
if(wrap) wrap.parentNode.insertBefore(h, wrap);
// FOOTER
var f = document.createElement('div');
f.className = 'tz-footer';
f.innerHTML = `<div>© 2010 - 2026 TravianZ All rights reserved</div><div>Server running on <b>v.9.0 Incremental Refactor</b></div>`;
document.body.appendChild(f);
// curăță resturi vechi
document.querySelectorAll('img, div, footer').forEach(el=>{
if(el.textContent && el.textContent.includes('TRAVIANGAMES')) el.style.display='none';
});
});
</script>
<?php
class IHG_Progressbar {
protected $bar_id;
protected $max_ticks;
protected $ticks;
protected $label;
public function __construct($max_ticks, $label = '%d van %d') {
$this->bar_id = uniqid('progressbar');
$this->label = $label;
$this->max_ticks = $max_ticks;
$this->ticks = 0;
}
public function tick() {
$this->ticks++;
$this->draw_progress();
}
public function draw() {
$this->draw_bar();
$this->draw_progress();
}
static public function draw_css() {
echo '
<style type="text/css">
.ihg_progress_bar {
display: block;
width: 500px;
height: 20px;
border: 1px solid gray;
padding: 1px;
margin: 3px auto;
position: relative;
}
.ihg_progress_ticks {
display: block;
position: absolute;
background-color: orange;
width: 0;
height: 20px;
overflow: hidden;
}
.ihg_progress_label_a,
.ihg_progress_label_b {
display: block;
position: absolute;
width: 500px;
height: 20px;
text-align: center;
}
.ihg_progress_label_a {
color: black;
}
.ihg_progress_label_b {
color: white;
}
</style>
';
}
protected function draw_bar() {
echo '
<div class="ihg_progress_bar">
<span class="ihg_progress_label_a" id="' . $this->bar_id . '_label_a"></span>
<div class="ihg_progress_ticks" id="' . $this->bar_id . '">
<span class="ihg_progress_label_b" id="' . $this->bar_id . '_label_b"></span>
</div>
</div>
';
echo '
<script type="text/javascript">
(function() {
var bar = document.getElementById("' . $this->bar_id . '");
var label_a = document.getElementById("' . $this->bar_id . '_label_a");
var label_b = document.getElementById("' . $this->bar_id . '_label_b");
window["' . $this->bar_id . '"] = function(width, label) {
bar.style.width = width + "%";
label_a.innerHTML = label;
label_b.innerHTML = label;
}
})();
</script>
';
$this->flush();
}
protected function draw_progress() {
$width = round($this->ticks / $this->max_ticks * 100, 2);
$label = sprintf($this->label, $this->ticks, $this->max_ticks);
echo '
<script type="text/javascript">
window["' . $this->bar_id . '"]("' . $width . '", "' . addslashes($label) . '");
</script>
';
$this->flush();
}
protected function flush() {
while(ob_get_level() > 0) {
ob_end_flush();
}
flush();
}
protected $bar_id; protected $max_ticks; protected $ticks; protected $label;
public function __construct($max_ticks, $label = 'Step %d from %d') {
$this->bar_id = uniqid('pb'); $this->label = $label;
$this->max_ticks = $max_ticks; $this->ticks = 0;
}
public function tick(){ $this->ticks++; $this->draw_progress(); }
public function draw(){ $this->draw_bar(); $this->draw_progress(); }
static public function draw_css(){
echo '<style>.ihg_wrap{margin:8px 0 18px}.ihg_bar{height:10px;background:#e5e7eb;border-radius:999px;overflow:hidden}.ihg_fill{height:100%;width:0;background:linear-gradient(90deg,#22c55e,#16a34a);transition:width .3s}.ihg_lab{font-size:12px;color:#64748b;margin-top:6px;text-align:center}</style>';
}
protected function draw_bar(){
echo '<div class="ihg_wrap"><div class="ihg_bar"><div class="ihg_fill" id="'.$this->bar_id.'"></div></div><div class="ihg_lab" id="'.$this->bar_id.'_l"></div></div>';
echo '<script>(function(){var b=document.getElementById("'.$this->bar_id.'"),l=document.getElementById("'.$this->bar_id.'_l");window["'.$this->bar_id.'"]=function(w,t){b.style.width=w+"%";l.textContent=t}})();</script>';
$this->flush();
}
protected function draw_progress(){
$w = round($this->ticks/$this->max_ticks*100,2);
$t = sprintf($this->label,$this->ticks,$this->max_ticks);
echo '<script>window["'.$this->bar_id.'"]("'.$w.'","'.addslashes($t).'");</script>'; $this->flush();
}
protected function flush(){ while(ob_get_level()>0){ob_end_flush();} flush(); }
}
?>
+43 -184
View File
@@ -1,202 +1,61 @@
<?php
<?php
#################################################################################
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
## --------------------------------------------------------------------------- ##
## Project: TravianZ ##
## Filename dataform.php ##
## Developed by: Dzoki ##
## License: TravianZ Project ##
## Copyright: TravianZ (c) 2010-2026. All rights reserved. ##
## URLs: https://travianz.org ##
## https://github.com/Shadowss/TravianZ ##
## ##
## Filename : wdata.tpl ##
## Type : Install Panel Frontend & Backend ##
## --------------------------------------------------------------------------- ##
## Developed by : Dzoki (Original) ##
## Refactored by : Shadow ##
## Redesign by : Shadow ##
## --------------------------------------------------------------------------- ##
## Contact : cata7007@gmail.com ##
## Project : TravianZ ##
## GitHub : https://github.com/Shadowss/TravianZ ##
## --------------------------------------------------------------------------- ##
## License : TravianZ Project ##
## Copyright : TravianZ (c) 2010-2025. All rights reserved. ##
## --------------------------------------------------------------------------- ##
#################################################################################
?>
<?php
// install/wdata.tpl
include_once('../GameEngine/config.php');
if (isset($_GET['c']) && $_GET['c'] == '1') {
echo '<br /><hr /><br /><div class="headline"><span class="f10 c5">Error creating wdata. Check configuration or file.</span></div><br><br>';
echo '<div class="card" style="background:#fef2f2;border-color:#fecaca;color:#991b1b;">Error creating wdata. Check configuration or file.</div>';
}
if (isset($_GET['err']) && $_GET['err'] == '1') {
echo '<br /><hr /><br /><div class="headline"><span class="f10 c5">Existing World Data found in the database! Please empty tables <i>'
. TB_PREFIX . 'odata, ' . TB_PREFIX . 'units, ' . TB_PREFIX . 'vdata, ' . TB_PREFIX . 'wdata</i> before continuing.</span></div><br /><br />';
echo '<div class="card" style="background:#fef2f2;border-color:#fecaca;color:#991b1b;">Existing World Data found! Empty tables <i>'.TB_PREFIX.'odata, '.TB_PREFIX.'units, '.TB_PREFIX.'vdata, '.TB_PREFIX.'wdata</i>.</div>';
}
$autoStartCroppers = isset($_GET['startCroppers']) && $_GET['startCroppers'] === '1';
?>
<form action="process.php" method="post" id="dataform">
<input type="hidden" name="subwdata" value="1" />
<p>
<span class="f10 c">Create World Data</span>
<table>
<tr>
<td>
<b>Warning</b>: This can take some time. Please wait until the next page has been loaded.
Click Create to proceed...
<br /><br />
<!-- Submit block (hidden when autoStartCroppers=1) -->
<div id="submitWrap" style="display:<?php echo $autoStartCroppers ? 'none' : 'block'; ?>;">
<center>
<input type="submit" name="Submit" id="Submit" value="Create..." onClick="return proceed()" />
<br /><br />
</center>
</div>
<!-- Progress UI (shown when startCroppers=1) -->
<div id="progressBox" style="display:<?php echo $autoStartCroppers ? 'block' : 'none'; ?>; margin-top:20px;">
<div style="font-weight:bold;margin-bottom:6px;">Building croppers…</div>
<div style="background:#ddd;border-radius:8px;overflow:hidden;height:20px;max-width:500px;">
<!-- Orange bar to match Travian vibes -->
<div id="pbar" style="background:#f6a21a;height:100%;width:0%;transition:width .2s;"></div>
</div>
<div id="pinfo" style="margin-top:6px;font-size:13px;color:#333;">Starting…</div>
<pre id="plog" style="margin-top:10px;background:#f9f9f9;border:1px solid #ddd;border-radius:8px;padding:8px;font-size:12px;max-height:200px;overflow:auto;"></pre>
<!-- Continue button appears on completion -->
<div id="autoNext" style="display:none;margin-top:10px;">
Proceeding to next step in <b id="cd">3</b>…
</div>
</div>
<input type="hidden" name="subwdata" value="1" />
<div class="card">
<span class="f10 c">Create World Data</span>
<p style="color:#475569;"><b>Warning</b>: This can take some time. Please wait until the next page has been loaded.</p>
<div id="submitWrap" style="display:<?php echo $autoStartCroppers?'none':'block';?>;text-align:center;">
<button class="btn" id="Submit" onclick="return proceed()">Create World...</button>
</div>
<div id="progressBox" style="display:<?php echo $autoStartCroppers?'block':'none';?>;">
<div style="font-weight:600;margin:10px 0;">Building croppers…</div>
<div style="background:#e5e7eb;border-radius:999px;overflow:hidden;height:12px;max-width:600px;">
<div id="pbar" style="background:linear-gradient(90deg,#f59e0b,#f97316);height:100%;width:0%;transition:width .2s;"></div>
</div>
<div id="pinfo" style="margin-top:6px;font-size:13px;color:#475569;">Starting…</div>
<pre id="plog" style="margin-top:10px;background:#0f172a;color:#e2e8f0;border-radius:10px;padding:10px;font-size:12px;max-height:200px;overflow:auto;"></pre>
<div id="autoNext" style="display:none;margin-top:10px;color:#166534;font-weight:600;">Proceeding to next step in <b id="cd">3</b>…</div>
</div>
</div>
</form>
<script><?php include('wdata_js_here_if_needed'); ?></script>
<!-- păstrezi scriptul tău JS de mai jos exact cum era -->
<script>
(function () {
var NEXT_URL = 'index.php?s=4'; // your next step
var COUNTDOWN_SECS = 3;
var finished = false;
function startCountdown() {
var box = document.getElementById('autoNext');
var cdEl = document.getElementById('cd');
var left = COUNTDOWN_SECS;
box.style.display = 'block';
cdEl.textContent = left;
var t = setInterval(function () {
left--;
cdEl.textContent = left;
if (left <= 0) {
clearInterval(t);
window.location.href = NEXT_URL;
}
}, 1000);
}
function startCroppersBuild() {
var box = document.getElementById('progressBox');
var pbar = document.getElementById('pbar');
var pinfo= document.getElementById('pinfo');
var plog = document.getElementById('plog');
var submitWrap = document.getElementById('submitWrap');
if (submitWrap) submitWrap.style.display = 'none';
box.style.display = 'block';
if (!('EventSource' in window)) {
plog.textContent += "Your browser does not support live progress.\n";
return;
}
var MAX_RETRIES = 3;
var retries = 0;
var es = new EventSource('ajax_croppers.php');
es.onopen = function () {
// When a connection (re)opens and we had errors before, log a small note
if (!finished && retries > 0) {
plog.textContent += "Reconnected to server.\n";
plog.scrollTop = plog.scrollHeight;
}
};
es.onmessage = function (e) {
// Ignore non-JSON messages (pings / blanks)
if (!e.data || e.data.charCodeAt(0) !== 123 /* '{' */) return;
try {
var d = JSON.parse(e.data);
var pct = (d.pct || 0) | 0;
var done = (d.done || 0) | 0;
var total = (d.total|| 0) | 0;
// If we've already finished, ignore further events
if (finished) return;
// Valid data received -> reset retry counter
retries = 0;
pbar.style.width = pct + '%';
pinfo.textContent = done + ' / ' + total + ' (' + pct + '%)';
if (d.msg) {
plog.textContent += d.msg + "\n";
plog.scrollTop = plog.scrollHeight;
}
if (pct >= 100) {
finished = true;
plog.textContent += "✅ Completed!\n";
plog.scrollTop = plog.scrollHeight;
es.close();
startCountdown();
}
// Optional: handle explicit error flag from server if you ever send it
if (d.error) {
finished = true;
plog.textContent += "❌ " + (d.msg || "Server reported an error.") + "\n";
plog.scrollTop = plog.scrollHeight;
es.close();
startCountdown();
}
} catch (err) {
// Silently ignore parsing problems now that we guard by '{'
// plog.textContent += "Parse error.\n";
}
};
es.onerror = function () {
// Dont spam after were done
if (finished) return;
retries++;
plog.textContent += "⚠ Connection hiccup (" + retries + "/" + MAX_RETRIES + "), retrying…\n";
plog.scrollTop = plog.scrollHeight;
// EventSource will auto-reconnect by itself; we just decide when to give up
if (retries >= MAX_RETRIES) {
finished = true;
plog.textContent += "❌ Too many connection failures — skipping croppers build.\n";
plog.scrollTop = plog.scrollHeight;
es.close();
// Reuse the same countdown UI to move on
startCountdown();
}
};
}
document.addEventListener('DOMContentLoaded', function () {
<?php if ($autoStartCroppers) { echo 'startCroppersBuild();'; } ?>
});
var NEXT_URL = 'index.php?s=4'; var COUNTDOWN_SECS = 3; var finished = false;
function startCountdown(){var box=document.getElementById('autoNext'),cd=document.getElementById('cd'),left=COUNTDOWN_SECS;box.style.display='block';cd.textContent=left;var t=setInterval(function(){left--;cd.textContent=left;if(left<=0){clearInterval(t);window.location.href=NEXT_URL}},1000)}
function startCroppersBuild(){var box=document.getElementById('progressBox'),pbar=document.getElementById('pbar'),pinfo=document.getElementById('pinfo'),plog=document.getElementById('plog'),submitWrap=document.getElementById('submitWrap');if(submitWrap)submitWrap.style.display='none';box.style.display='block';if(!('EventSource'in window)){plog.textContent+="Browser no SSE\n";return}var MAX=3,retries=0,es=new EventSource('ajax_croppers.php');es.onopen=function(){if(!finished&&retries>0){plog.textContent+="Reconnected\n"}};es.onmessage=function(e){if(!e.data||e.data.charCodeAt(0)!==123)return;try{var d=JSON.parse(e.data),pct=d.pct|0,done=d.done|0,total=d.total|0;if(finished)return;retries=0;pbar.style.width=pct+'%';pinfo.textContent=done+' / '+total+' ('+pct+'%)';if(d.msg){plog.textContent+=d.msg+"\n";plog.scrollTop=plog.scrollHeight}if(pct>=100){finished=true;plog.textContent+="✅ Completed!\n";es.close();startCountdown()}if(d.error){finished=true;plog.textContent+="❌ "+(d.msg||"Error")+"\n";es.close();startCountdown()}}catch(err){}};es.onerror=function(){if(finished)return;retries++;plog.textContent+="⚠ hiccup ("+retries+"/"+MAX+")\n";if(retries>=MAX){finished=true;plog.textContent+="❌ Too many failures\n";es.close();startCountdown()}}}
document.addEventListener('DOMContentLoaded',function(){<?php if($autoStartCroppers){echo 'startCroppersBuild();';} ?>});
})();
</script>
</td>
</tr>
</table>
</p>
</form>
</div>
</script>