diff --git a/Admin/Templates/config.tpl b/Admin/Templates/config.tpl index 3d501554..e85e58ce 100644 --- a/Admin/Templates/config.tpl +++ b/Admin/Templates/config.tpl @@ -92,6 +92,26 @@ $editIcon = ' ? ?Enabled" : "Disabled"; ?> ? + + Server graphic pack ?The graphic pack every player sees by default, read from the gpack/ folder. + + + + Player graphic packs ?When enabled, players can point their profile at their own graphic pack (Profile → Graphics). When disabled, everyone sees the server pack. + + + + ? + + + + ? + + + + ? + + @@ -220,18 +240,6 @@ $cronKeyMasked = ($cronKey === '')
- - - - - - - - - - - - diff --git a/Admin/Templates/editServerSet.tpl b/Admin/Templates/editServerSet.tpl index 58189150..4b198681 100644 --- a/Admin/Templates/editServerSet.tpl +++ b/Admin/Templates/editServerSet.tpl @@ -369,6 +369,33 @@ function refresh(tz) { + + + + - - - - - - + 'Travian Default'); + + $gpActive = rtrim((string) $session->gpack, '/') . '/'; + + foreach ($gpPacks as $gpPath => $gpLabel) { + $gpIsActive = (rtrim($gpPath, '/') . '/') === $gpActive; + $gpZip = 'gpack/download/' . basename(rtrim($gpPath, '/')) . '.zip'; + ?> - + + diff --git a/install/data/constant_format.tpl b/install/data/constant_format.tpl index 6ea92c7a..4bc0ed0d 100644 --- a/install/data/constant_format.tpl +++ b/install/data/constant_format.tpl @@ -147,9 +147,9 @@ define("WORLD_MAX", "%MAX%"); // ***** Graphic Pack // true = enabled, false = disabled //!!!!!!!!!!!! DO NOT ENABLE !!!!!!!!!!!! -define("GP_ENABLE",false); +define("GP_ENABLE",%GP%); // Graphic pack location (default: gpack/travian_default/) -define("GP_LOCATE", "gpack/travian_default/"); +define("GP_LOCATE", "%GP_LOCATE%"); // ***** Troop Speed // Values: 1 (normal), 3 (3x speed) etc... @@ -481,4 +481,4 @@ $requse = 0; ## ## ################################################################################# -?> +?> \ No newline at end of file diff --git a/install/process.php b/install/process.php index 96fe44ab..e76a378f 100644 --- a/install/process.php +++ b/install/process.php @@ -191,7 +191,17 @@ class Process { $findReplace["%VILLAGE_EXPAND%"] = $_POST['village_expand']; $findReplace["%ERRORREPORT%"] = $_POST['error']; $findReplace["%ERROR%"] = $_POST['error']; - //$findReplace["%GP_LOCATE%"] = $_POST['gp_locate']; + // Pachetul grafic al serverului. Linia era comentata, deci %GP_LOCATE% + // ramanea neinlocuit in config.php. Validam ca directorul chiar exista si + // contine travian.css, altfel jocul ar porni fara stiluri. + $gpLocate = isset($_POST['gp_locate']) ? (string) $_POST['gp_locate'] : 'gpack/travian_default/'; + + if (!preg_match('#^gpack/[A-Za-z0-9_\-]+/$#', $gpLocate) + || !is_file('../' . $gpLocate . 'travian.css')) { + $gpLocate = 'gpack/travian_default/'; + } + + $findReplace["%GP_LOCATE%"] = $gpLocate; $findReplace["%PLUS_TIME%"] = $_POST['plus_time']; $findReplace["%PLUS_PRODUCTION%"] = $_POST['plus_production']; $findReplace["%PAYPAL_EMAIL%"] = $_POST['paypal-email']; diff --git a/install/templates/config.tpl b/install/templates/config.tpl index 754dc79e..d0c33c50 100644 --- a/install/templates/config.tpl +++ b/install/templates/config.tpl @@ -312,6 +312,10 @@ foreach($mechs as $k => $l){
+
?
?
?
?Enabled" : "Disabled"; ?>
?Enabled" : "Disabled"; ?>
Server graphic pack ?The graphic pack every player sees by default. Packs are read from the gpack/ folder — a folder counts as a pack when it contains travian.css. Changing this switches the whole server's look. + +
? diff --git a/GameEngine/Admin/Mods/config_template.php b/GameEngine/Admin/Mods/config_template.php index abeb84de..32008ba9 100644 --- a/GameEngine/Admin/Mods/config_template.php +++ b/GameEngine/Admin/Mods/config_template.php @@ -1,4 +1,152 @@ string, altfel => bare). + */ +if (!function_exists('tz_config_set')) { + + function tz_config_detect_type($text, $placeholder) + { + $q = preg_quote($placeholder, '/'); + + // %X% intre ghilimele simple sau duble => context de sir + if (preg_match('/["\']\s*' . $q . '\s*["\']/', $text)) { + return 'string'; + } + + return 'bare'; + } + + function tz_config_sanitize($value, $type) + { + if ($type === 'bare') { + if (is_bool($value)) { + return $value ? 'true' : 'false'; + } + + $v = trim((string) $value); + + // Booleeni. Formularele din panou trimit "True"/"False" cu majuscula + // (asa sunt scrise
4 - - Activate - - - - - -
4 - - Activate - + + + + + + + - - - + + + + – +