From 30fc76e85bc3a3384b63b9877a76b561adcaa9e6 Mon Sep 17 00:00:00 2001 From: Martin Ambrus Date: Wed, 22 Nov 2017 12:20:05 +0100 Subject: [PATCH] fix: old version cannot save config data anymore --- GameEngine/Admin/Mods/editAdminInfo.php | 25 +++++++++++++++------- GameEngine/Admin/Mods/editExtraSet.php | 17 +++++++++++---- GameEngine/Admin/Mods/editLogSet.php | 27 ++++++++++++++++-------- GameEngine/Admin/Mods/editNewsboxSet.php | 27 ++++++++++++++++-------- GameEngine/Admin/Mods/editPlusSet.php | 11 +++++++++- GameEngine/Admin/Mods/editServerSet.php | 25 +++++++++++++++------- 6 files changed, 93 insertions(+), 39 deletions(-) diff --git a/GameEngine/Admin/Mods/editAdminInfo.php b/GameEngine/Admin/Mods/editAdminInfo.php index 8e66d6b2..747c02dd 100755 --- a/GameEngine/Admin/Mods/editAdminInfo.php +++ b/GameEngine/Admin/Mods/editAdminInfo.php @@ -14,9 +14,18 @@ if($_SESSION['access'] < 9) die(ACCESS_DENIED_ADMIN); include_once("../../Database.php"); $id = (int) $_POST['id']; +if (file_exists('constant_format.tpl')) { + die( + 'You seem to be running a new version of TravianZ which was installed using an old installer.
' . + 'Please download constant_format.tpl file and copy it into the GameEngine/Admin/Mods ' . + 'directory - otherwise saving configuration won\'t work.

' . + 'The constant_format.tpl file can be downloaded at ' . + 'https://raw.githubusercontent.com/Shadowss/TravianZ/master/install/data/constant_format.tpl'); +} + $myFile = "../../config.php"; $fh = fopen($myFile, 'w') or die("


Can't open file: GameEngine\config.php"); - + $ERRORREPORT=ERROR_REPORT; $T4=(T4_COMING==false)? "false":"true"; $GP_ENABLE=(GP_ENABLE==false)? "false":"true"; @@ -39,7 +48,7 @@ $fh = fopen($myFile, 'w') or die("


Can't open file: GameEngine\con $NEWSBOX2=(NEWSBOX2==false)? "false":"true"; $NEWSBOX3=(NEWSBOX3==false)? "false":"true"; $LIMIT_MAILBOX=(LIMIT_MAILBOX==false)? "false":"true"; - + $text = file_get_contents("constant_format.tpl"); $text = preg_replace("'%ERRORREPORT%'", $ERRORREPORT, $text); $text = preg_replace("'%ERROR%'", $ERRORREPORT, $text); @@ -60,7 +69,7 @@ $fh = fopen($myFile, 'w') or die("


Can't open file: GameEngine\con $text = preg_replace("'%TRAPPERCAP%'", TRAPPER_CAPACITY, $text); $text = preg_replace("'%VILLAGE_EXPAND%'", CP, $text); $text = preg_replace("'%DEMOLISH%'", DEMOLISH_LEVEL_REQ, $text); - $text = preg_replace("'%STORAGE_MULTIPLIER%'", STORAGE_MULTIPLIER, $text); + $text = preg_replace("'%STORAGE_MULTIPLIER%'", STORAGE_MULTIPLIER, $text); $text = preg_replace("'%QUEST%'", $QUEST, $text); $text = preg_replace("'%QTYPE%'", QTYPE, $text); $text = preg_replace("'%BEGINNER%'", PROTECTION, $text); @@ -84,7 +93,7 @@ $fh = fopen($myFile, 'w') or die("


Can't open file: GameEngine\con $text = preg_replace("'%LOGADMIN%'", $LOG_ADMIN, $text); $text = preg_replace("'%LOGWAR%'", $LOG_WAR, $text); $text = preg_replace("'%LOGMARKET%'", $LOG_MARKET, $text); - $text = preg_replace("'%LOGILLEGAL%'", $LOG_ILLEGAL, $text); + $text = preg_replace("'%LOGILLEGAL%'", $LOG_ILLEGAL, $text); $text = preg_replace("'%BOX1%'", $NEWSBOX1, $text); $text = preg_replace("'%BOX2%'", $NEWSBOX2, $text); $text = preg_replace("'%BOX3%'", $NEWSBOX3, $text); @@ -94,10 +103,10 @@ $fh = fopen($myFile, 'w') or die("


Can't open file: GameEngine\con $text = preg_replace("'%SPASS%'", SQL_PASS, $text); $text = preg_replace("'%SDB%'", SQL_DB, $text); $text = preg_replace("'%PREFIX%'", TB_PREFIX, $text); - $text = preg_replace("'%CONNECTT%'", DB_TYPE, $text); + $text = preg_replace("'%CONNECTT%'", DB_TYPE, $text); $text = preg_replace("'%LIMIT_MAILBOX%'", $LIMIT_MAILBOX, $text); $text = preg_replace("'%MAX_MAILS%'", MAX_MAIL, $text); - $text = preg_replace("'%ARANK%'", $_POST['admin_rank'], $text); + $text = preg_replace("'%ARANK%'", $_POST['admin_rank'], $text); $text = preg_replace("'%AEMAIL%'", $_POST['aemail'], $text); $text = preg_replace("'%ANAME%'", $_POST['aname'], $text); $text = preg_replace("'%ASUPPMSGS%'", ($_POST['admin_support_msgs'] == 'True' ? 'true' : 'false'), $text); @@ -107,7 +116,7 @@ $fh = fopen($myFile, 'w') or die("


Can't open file: GameEngine\con $text = preg_replace("'%DOMAIN%'", DOMAIN, $text); $text = preg_replace("'%HOMEPAGE%'", HOMEPAGE, $text); $text = preg_replace("'%SERVER%'", SERVER, $text); - + // PLUS settings need to be kept intact $text = preg_replace("'%PLUS_TIME%'", PLUS_TIME, $text); $text = preg_replace("'%PLUS_PRODUCTION%'", PLUS_PRODUCTION, $text); @@ -123,7 +132,7 @@ $fh = fopen($myFile, 'w') or die("


Can't open file: GameEngine\con $text = preg_replace("'%PLUS_PACKAGE_D_GOLD%'", (defined('PLUS_PACKAGE_D_GOLD') ? PLUS_PACKAGE_D_GOLD : '1000'), $text); $text = preg_replace("'%PLUS_PACKAGE_E_PRICE%'", (defined('PLUS_PACKAGE_E_PRICE') ? PLUS_PACKAGE_E_PRICE : '49,99'), $text); $text = preg_replace("'%PLUS_PACKAGE_E_GOLD%'", (defined('PLUS_PACKAGE_E_GOLD') ? PLUS_PACKAGE_E_GOLD : '2000'), $text); - + fwrite($fh, $text); fclose($fh); diff --git a/GameEngine/Admin/Mods/editExtraSet.php b/GameEngine/Admin/Mods/editExtraSet.php index 7183a27a..e4b4cdc1 100755 --- a/GameEngine/Admin/Mods/editExtraSet.php +++ b/GameEngine/Admin/Mods/editExtraSet.php @@ -14,9 +14,18 @@ if($_SESSION['access'] < 9) die(ACCESS_DENIED_ADMIN); include_once("../../Database.php"); $id = (int) $_POST['id']; +if (file_exists('constant_format.tpl')) { + die( + 'You seem to be running a new version of TravianZ which was installed using an old installer.
' . + 'Please download constant_format.tpl file and copy it into the GameEngine/Admin/Mods ' . + 'directory - otherwise saving configuration won\'t work.

' . + 'The constant_format.tpl file can be downloaded at ' . + 'https://raw.githubusercontent.com/Shadowss/TravianZ/master/install/data/constant_format.tpl'); +} + $myFile = "../../config.php"; $fh = fopen($myFile, 'w') or die("


Can't open file: GameEngine\config.php"); - + $ERRORREPORT=ERROR_REPORT; $T4=(T4_COMING==false)? "false":"true"; $GP_ENABLE=(GP_ENABLE==false)? "false":"true"; @@ -38,7 +47,7 @@ $fh = fopen($myFile, 'w') or die("


Can't open file: GameEngine\con $INCLUDE_ADMIN=(INCLUDE_ADMIN==false)? "false":"true"; $SUPPORT_MSGS_IN_ADMIN = (ADMIN_RECEIVE_SUPPORT_MESSAGES == false ? 'false' : 'true'); $ADMINS_RAIDABLE = (ADMIN_ALLOW_INCOMING_RAIDS == false ? 'false' : 'true'); - + $text = file_get_contents("constant_format.tpl"); $text = preg_replace("'%ERRORREPORT%'", ERROR_REPORT, $text); $text = preg_replace("'%ERROR%'", ERROR_REPORT, $text); @@ -104,7 +113,7 @@ $fh = fopen($myFile, 'w') or die("


Can't open file: GameEngine\con $text = preg_replace("'%DOMAIN%'", DOMAIN, $text); $text = preg_replace("'%HOMEPAGE%'", HOMEPAGE, $text); $text = preg_replace("'%SERVER%'", SERVER, $text); - + // PLUS settings need to be kept intact $text = preg_replace("'%PLUS_TIME%'", PLUS_TIME, $text); $text = preg_replace("'%PLUS_PRODUCTION%'", PLUS_PRODUCTION, $text); @@ -120,7 +129,7 @@ $fh = fopen($myFile, 'w') or die("


Can't open file: GameEngine\con $text = preg_replace("'%PLUS_PACKAGE_D_GOLD%'", (defined('PLUS_PACKAGE_D_GOLD') ? PLUS_PACKAGE_D_GOLD : '1000'), $text); $text = preg_replace("'%PLUS_PACKAGE_E_PRICE%'", (defined('PLUS_PACKAGE_E_PRICE') ? PLUS_PACKAGE_E_PRICE : '49,99'), $text); $text = preg_replace("'%PLUS_PACKAGE_E_GOLD%'", (defined('PLUS_PACKAGE_E_GOLD') ? PLUS_PACKAGE_E_GOLD : '2000'), $text); - + fwrite($fh, $text); fclose($fh); diff --git a/GameEngine/Admin/Mods/editLogSet.php b/GameEngine/Admin/Mods/editLogSet.php index 35137df3..14b801b2 100755 --- a/GameEngine/Admin/Mods/editLogSet.php +++ b/GameEngine/Admin/Mods/editLogSet.php @@ -14,9 +14,18 @@ if($_SESSION['access'] < 9) die(ACCESS_DENIED_ADMIN); include_once("../../Database.php"); $id = (int) $_POST['id']; +if (file_exists('constant_format.tpl')) { + die( + 'You seem to be running a new version of TravianZ which was installed using an old installer.
' . + 'Please download constant_format.tpl file and copy it into the GameEngine/Admin/Mods ' . + 'directory - otherwise saving configuration won\'t work.

' . + 'The constant_format.tpl file can be downloaded at ' . + 'https://raw.githubusercontent.com/Shadowss/TravianZ/master/install/data/constant_format.tpl'); +} + $myFile = "../../config.php"; $fh = fopen($myFile, 'w') or die("


Can't open file: GameEngine\config.php"); - + $ERRORREPORT=ERROR_REPORT; $T4=(T4_COMING==false)? "false":"true"; $GP_ENABLE=(GP_ENABLE==false)? "false":"true"; @@ -26,7 +35,7 @@ $fh = fopen($myFile, 'w') or die("


Can't open file: GameEngine\con $AUTH_EMAIL=(AUTH_EMAIL==false)? "false":"true"; $GREAT_WKS=(GREAT_WKS==false)? "false":"true"; $REG_OPEN=(REG_OPEN==false)? "false":"true"; - + $NEWSBOX1=(NEWSBOX1==false)? "false":"true"; $NEWSBOX2=(NEWSBOX2==false)? "false":"true"; $NEWSBOX3=(NEWSBOX3==false)? "false":"true"; @@ -34,7 +43,7 @@ $fh = fopen($myFile, 'w') or die("


Can't open file: GameEngine\con $INCLUDE_ADMIN=(INCLUDE_ADMIN==false)? "false":"true"; $SUPPORT_MSGS_IN_ADMIN = (ADMIN_RECEIVE_SUPPORT_MESSAGES == false ? 'false' : 'true'); $ADMINS_RAIDABLE = (ADMIN_ALLOW_INCOMING_RAIDS == false ? 'false' : 'true'); - + $text = file_get_contents("constant_format.tpl"); $text = preg_replace("'%ERRORREPORT%'", $ERRORREPORT, $text); $text = preg_replace("'%ERROR%'", $ERRORREPORT, $text); @@ -55,7 +64,7 @@ $fh = fopen($myFile, 'w') or die("


Can't open file: GameEngine\con $text = preg_replace("'%TRAPPERCAP%'", TRAPPER_CAPACITY, $text); $text = preg_replace("'%VILLAGE_EXPAND%'", CP, $text); $text = preg_replace("'%DEMOLISH%'", DEMOLISH_LEVEL_REQ, $text); - $text = preg_replace("'%STORAGE_MULTIPLIER%'", STORAGE_MULTIPLIER, $text); + $text = preg_replace("'%STORAGE_MULTIPLIER%'", STORAGE_MULTIPLIER, $text); $text = preg_replace("'%QUEST%'", $QUEST, $text); $text = preg_replace("'%QTYPE%'", QTYPE, $text); $text = preg_replace("'%BEGINNER%'", PROTECTION, $text); @@ -80,7 +89,7 @@ $fh = fopen($myFile, 'w') or die("


Can't open file: GameEngine\con $text = preg_replace("'%LOGADMIN%'", $_POST['log_admin'], $text); $text = preg_replace("'%LOGWAR%'", $_POST['log_war'], $text); $text = preg_replace("'%LOGMARKET%'", $_POST['log_market'], $text); - $text = preg_replace("'%LOGILLEGAL%'", $_POST['log_illegal'], $text); + $text = preg_replace("'%LOGILLEGAL%'", $_POST['log_illegal'], $text); //end update $text = preg_replace("'%BOX1%'", $NEWSBOX1, $text); $text = preg_replace("'%BOX2%'", $NEWSBOX2, $text); @@ -91,10 +100,10 @@ $fh = fopen($myFile, 'w') or die("


Can't open file: GameEngine\con $text = preg_replace("'%SPASS%'", SQL_PASS, $text); $text = preg_replace("'%SDB%'", SQL_DB, $text); $text = preg_replace("'%PREFIX%'", TB_PREFIX, $text); - $text = preg_replace("'%CONNECTT%'", DB_TYPE, $text); + $text = preg_replace("'%CONNECTT%'", DB_TYPE, $text); $text = preg_replace("'%LIMIT_MAILBOX%'", $LIMIT_MAILBOX, $text); $text = preg_replace("'%MAX_MAILS%'", MAX_MAIL, $text); - $text = preg_replace("'%ARANK%'", $INCLUDE_ADMIN, $text); + $text = preg_replace("'%ARANK%'", $INCLUDE_ADMIN, $text); $text = preg_replace("'%AEMAIL%'", ADMIN_EMAIL, $text); $text = preg_replace("'%ANAME%'", ADMIN_NAME, $text); $text = preg_replace("'%ASUPPMSGS%'", $SUPPORT_MSGS_IN_ADMIN, $text); @@ -104,7 +113,7 @@ $fh = fopen($myFile, 'w') or die("


Can't open file: GameEngine\con $text = preg_replace("'%DOMAIN%'", DOMAIN, $text); $text = preg_replace("'%HOMEPAGE%'", HOMEPAGE, $text); $text = preg_replace("'%SERVER%'", SERVER, $text); - + // PLUS settings need to be kept intact $text = preg_replace("'%PLUS_TIME%'", PLUS_TIME, $text); $text = preg_replace("'%PLUS_PRODUCTION%'", PLUS_PRODUCTION, $text); @@ -120,7 +129,7 @@ $fh = fopen($myFile, 'w') or die("


Can't open file: GameEngine\con $text = preg_replace("'%PLUS_PACKAGE_D_GOLD%'", (defined('PLUS_PACKAGE_D_GOLD') ? PLUS_PACKAGE_D_GOLD : '1000'), $text); $text = preg_replace("'%PLUS_PACKAGE_E_PRICE%'", (defined('PLUS_PACKAGE_E_PRICE') ? PLUS_PACKAGE_E_PRICE : '49,99'), $text); $text = preg_replace("'%PLUS_PACKAGE_E_GOLD%'", (defined('PLUS_PACKAGE_E_GOLD') ? PLUS_PACKAGE_E_GOLD : '2000'), $text); - + fwrite($fh, $text); fclose($fh); diff --git a/GameEngine/Admin/Mods/editNewsboxSet.php b/GameEngine/Admin/Mods/editNewsboxSet.php index eba2c130..10a2fc9c 100755 --- a/GameEngine/Admin/Mods/editNewsboxSet.php +++ b/GameEngine/Admin/Mods/editNewsboxSet.php @@ -14,9 +14,18 @@ if($_SESSION['access'] < 9) die(ACCESS_DENIED_ADMIN); include_once("../../Database.php"); $id = (int) $_POST['id']; +if (file_exists('constant_format.tpl')) { + die( + 'You seem to be running a new version of TravianZ which was installed using an old installer.
' . + 'Please download constant_format.tpl file and copy it into the GameEngine/Admin/Mods ' . + 'directory - otherwise saving configuration won\'t work.

' . + 'The constant_format.tpl file can be downloaded at ' . + 'https://raw.githubusercontent.com/Shadowss/TravianZ/master/install/data/constant_format.tpl'); +} + $myFile = "../../config.php"; $fh = fopen($myFile, 'w') or die("


Can't open file: GameEngine\config.php"); - + $ERRORREPORT=ERROR_REPORT; $T4=(T4_COMING==false)? "false":"true"; $GP_ENABLE=(GP_ENABLE==false)? "false":"true"; @@ -35,13 +44,13 @@ $fh = fopen($myFile, 'w') or die("


Can't open file: GameEngine\con $LOG_WAR=(LOG_WAR==false)? "false":"true"; $LOG_MARKET=(LOG_MARKET==false)? "false":"true"; $LOG_ILLEGAL=(LOG_ILLEGAL==false)? "false":"true"; - + $LIMIT_MAILBOX=(LIMIT_MAILBOX==false)? "false":"true"; $INCLUDE_ADMIN=(INCLUDE_ADMIN==false)? "false":"true"; $SUPPORT_MSGS_IN_ADMIN = (ADMIN_RECEIVE_SUPPORT_MESSAGES == false ? 'false' : 'true'); $ADMINS_RAIDABLE = (ADMIN_ALLOW_INCOMING_RAIDS == false ? 'false' : 'true'); - + $text = file_get_contents("constant_format.tpl"); $text = preg_replace("'%ERRORREPORT%'", $ERRORREPORT, $text); $text = preg_replace("'%ERROR%'", $ERRORREPORT, $text); @@ -62,7 +71,7 @@ $fh = fopen($myFile, 'w') or die("


Can't open file: GameEngine\con $text = preg_replace("'%TRAPPERCAP%'", TRAPPER_CAPACITY, $text); $text = preg_replace("'%VILLAGE_EXPAND%'", CP, $text); $text = preg_replace("'%DEMOLISH%'", DEMOLISH_LEVEL_REQ, $text); - $text = preg_replace("'%STORAGE_MULTIPLIER%'", STORAGE_MULTIPLIER, $text); + $text = preg_replace("'%STORAGE_MULTIPLIER%'", STORAGE_MULTIPLIER, $text); $text = preg_replace("'%QUEST%'", $QUEST, $text); $text = preg_replace("'%QTYPE%'", QTYPE, $text); $text = preg_replace("'%BEGINNER%'", PROTECTION, $text); @@ -86,7 +95,7 @@ $fh = fopen($myFile, 'w') or die("


Can't open file: GameEngine\con $text = preg_replace("'%LOGADMIN%'", $LOG_ADMIN, $text); $text = preg_replace("'%LOGWAR%'", $LOG_WAR, $text); $text = preg_replace("'%LOGMARKET%'", $LOG_MARKET, $text); - $text = preg_replace("'%LOGILLEGAL%'", $LOG_ILLEGAL, $text); + $text = preg_replace("'%LOGILLEGAL%'", $LOG_ILLEGAL, $text); //update $text = preg_replace("'%BOX1%'", $_POST['box1'], $text); $text = preg_replace("'%BOX2%'", $_POST['box2'], $text); @@ -98,10 +107,10 @@ $fh = fopen($myFile, 'w') or die("


Can't open file: GameEngine\con $text = preg_replace("'%SPASS%'", SQL_PASS, $text); $text = preg_replace("'%SDB%'", SQL_DB, $text); $text = preg_replace("'%PREFIX%'", TB_PREFIX, $text); - $text = preg_replace("'%CONNECTT%'", DB_TYPE, $text); + $text = preg_replace("'%CONNECTT%'", DB_TYPE, $text); $text = preg_replace("'%LIMIT_MAILBOX%'", $LIMIT_MAILBOX, $text); $text = preg_replace("'%MAX_MAILS%'", MAX_MAIL, $text); - $text = preg_replace("'%ARANK%'", $INCLUDE_ADMIN, $text); + $text = preg_replace("'%ARANK%'", $INCLUDE_ADMIN, $text); $text = preg_replace("'%AEMAIL%'", ADMIN_EMAIL, $text); $text = preg_replace("'%ANAME%'", ADMIN_NAME, $text); $text = preg_replace("'%ASUPPMSGS%'", $SUPPORT_MSGS_IN_ADMIN, $text); @@ -111,7 +120,7 @@ $fh = fopen($myFile, 'w') or die("


Can't open file: GameEngine\con $text = preg_replace("'%DOMAIN%'", DOMAIN, $text); $text = preg_replace("'%HOMEPAGE%'", HOMEPAGE, $text); $text = preg_replace("'%SERVER%'", SERVER, $text); - + // PLUS settings need to be kept intact $text = preg_replace("'%PLUS_TIME%'", PLUS_TIME, $text); $text = preg_replace("'%PLUS_PRODUCTION%'", PLUS_PRODUCTION, $text); @@ -127,7 +136,7 @@ $fh = fopen($myFile, 'w') or die("


Can't open file: GameEngine\con $text = preg_replace("'%PLUS_PACKAGE_D_GOLD%'", (defined('PLUS_PACKAGE_D_GOLD') ? PLUS_PACKAGE_D_GOLD : '1000'), $text); $text = preg_replace("'%PLUS_PACKAGE_E_PRICE%'", (defined('PLUS_PACKAGE_E_PRICE') ? PLUS_PACKAGE_E_PRICE : '49,99'), $text); $text = preg_replace("'%PLUS_PACKAGE_E_GOLD%'", (defined('PLUS_PACKAGE_E_GOLD') ? PLUS_PACKAGE_E_GOLD : '2000'), $text); - + fwrite($fh, $text); fclose($fh); diff --git a/GameEngine/Admin/Mods/editPlusSet.php b/GameEngine/Admin/Mods/editPlusSet.php index 798646d0..1ff28834 100644 --- a/GameEngine/Admin/Mods/editPlusSet.php +++ b/GameEngine/Admin/Mods/editPlusSet.php @@ -15,11 +15,20 @@ include_once("../../Database.php"); include_once("../../config.php"); $id = (int) $_POST['id']; +if (file_exists('constant_format.tpl')) { + die( + 'You seem to be running a new version of TravianZ which was installed using an old installer.
' . + 'Please download constant_format.tpl file and copy it into the GameEngine/Admin/Mods ' . + 'directory - otherwise saving configuration won\'t work.

' . + 'The constant_format.tpl file can be downloaded at ' . + 'https://raw.githubusercontent.com/Shadowss/TravianZ/master/install/data/constant_format.tpl'); +} + $myFile = "../../config.php"; $fh = fopen($myFile, 'w') or die("


Can't open file: GameEngine\config.php"); $text = file_get_contents("constant_format.tpl"); - + $SUPPORT_MSGS_IN_ADMIN = (ADMIN_RECEIVE_SUPPORT_MESSAGES == false ? 'false' : 'true'); $ADMINS_RAIDABLE = (ADMIN_ALLOW_INCOMING_RAIDS == false ? 'false' : 'true'); diff --git a/GameEngine/Admin/Mods/editServerSet.php b/GameEngine/Admin/Mods/editServerSet.php index f20ebb1d..78838fa4 100755 --- a/GameEngine/Admin/Mods/editServerSet.php +++ b/GameEngine/Admin/Mods/editServerSet.php @@ -14,9 +14,18 @@ if($_SESSION['access'] < 9) die(ACCESS_DENIED_ADMIN); include_once("../../Database.php"); $id = (int) $_POST['id']; +if (file_exists('constant_format.tpl')) { + die( + 'You seem to be running a new version of TravianZ which was installed using an old installer.
' . + 'Please download constant_format.tpl file and copy it into the GameEngine/Admin/Mods ' . + 'directory - otherwise saving configuration won\'t work.

' . + 'The constant_format.tpl file can be downloaded at ' . + 'https://raw.githubusercontent.com/Shadowss/TravianZ/master/install/data/constant_format.tpl'); +} + $myFile = "../../config.php"; $fh = fopen($myFile, 'w') or die("


Can't open file: GameEngine\config.php"); - + $T4=(T4_COMING==false)? "false":"true"; $LOG_BUILD=(LOG_BUILD==false)? "false":"true"; $LOG_TECH=(LOG_TECH==false)? "false":"true"; @@ -33,7 +42,7 @@ $fh = fopen($myFile, 'w') or die("


Can't open file: GameEngine\con $INCLUDE_ADMIN=(INCLUDE_ADMIN==false)? "false":"true"; $SUPPORT_MSGS_IN_ADMIN = (ADMIN_RECEIVE_SUPPORT_MESSAGES == false ? 'false' : 'true'); $ADMINS_RAIDABLE = (ADMIN_ALLOW_INCOMING_RAIDS == false ? 'false' : 'true'); - + $text = file_get_contents("constant_format.tpl"); $text = preg_replace("'%ERRORREPORT%'", $_POST['error'], $text); $text = preg_replace("'%ERROR%'", $_POST['error'], $text); @@ -54,7 +63,7 @@ $fh = fopen($myFile, 'w') or die("


Can't open file: GameEngine\con $text = preg_replace("'%TRAPPERCAP%'", $_POST['trappercap'], $text); $text = preg_replace("'%VILLAGE_EXPAND%'", $_POST['village_expand'], $text); $text = preg_replace("'%DEMOLISH%'", $_POST['demolish'], $text); - $text = preg_replace("'%STORAGE_MULTIPLIER%'", $_POST['storage_multiplier'], $text); + $text = preg_replace("'%STORAGE_MULTIPLIER%'", $_POST['storage_multiplier'], $text); $text = preg_replace("'%QUEST%'", $_POST['quest'], $text); $text = preg_replace("'%QTYPE%'", $_POST['qtype'], $text); $text = preg_replace("'%BEGINNER%'", $_POST['beginner'], $text); @@ -76,7 +85,7 @@ $fh = fopen($myFile, 'w') or die("


Can't open file: GameEngine\con $text = preg_replace("'%LOGADMIN%'", $LOG_ADMIN, $text); $text = preg_replace("'%LOGWAR%'", $LOG_WAR, $text); $text = preg_replace("'%LOGMARKET%'", $LOG_MARKET, $text); - $text = preg_replace("'%LOGILLEGAL%'", $LOG_ILLEGAL, $text); + $text = preg_replace("'%LOGILLEGAL%'", $LOG_ILLEGAL, $text); $text = preg_replace("'%BOX1%'", $NEWSBOX1, $text); $text = preg_replace("'%BOX2%'", $NEWSBOX2, $text); $text = preg_replace("'%BOX3%'", $NEWSBOX3, $text); @@ -86,10 +95,10 @@ $fh = fopen($myFile, 'w') or die("


Can't open file: GameEngine\con $text = preg_replace("'%SPASS%'", SQL_PASS, $text); $text = preg_replace("'%SDB%'", SQL_DB, $text); $text = preg_replace("'%PREFIX%'", TB_PREFIX, $text); - $text = preg_replace("'%CONNECTT%'", DB_TYPE, $text); + $text = preg_replace("'%CONNECTT%'", DB_TYPE, $text); $text = preg_replace("'%LIMIT_MAILBOX%'", $LIMIT_MAILBOX, $text); $text = preg_replace("'%MAX_MAILS%'", MAX_MAIL, $text); - $text = preg_replace("'%ARANK%'", $INCLUDE_ADMIN, $text); + $text = preg_replace("'%ARANK%'", $INCLUDE_ADMIN, $text); $text = preg_replace("'%AEMAIL%'", ADMIN_EMAIL, $text); $text = preg_replace("'%ASUPPMSGS%'", $SUPPORT_MSGS_IN_ADMIN, $text); $text = preg_replace("'%ARAIDS%'", $ADMINS_RAIDABLE, $text); @@ -99,7 +108,7 @@ $fh = fopen($myFile, 'w') or die("


Can't open file: GameEngine\con $text = preg_replace("'%DOMAIN%'", DOMAIN, $text); $text = preg_replace("'%HOMEPAGE%'", HOMEPAGE, $text); $text = preg_replace("'%SERVER%'", SERVER, $text); - + // PLUS settings need to be kept intact $text = preg_replace("'%PLUS_TIME%'", PLUS_TIME, $text); $text = preg_replace("'%PLUS_PRODUCTION%'", PLUS_PRODUCTION, $text); @@ -115,7 +124,7 @@ $fh = fopen($myFile, 'w') or die("


Can't open file: GameEngine\con $text = preg_replace("'%PLUS_PACKAGE_D_GOLD%'", (defined('PLUS_PACKAGE_D_GOLD') ? PLUS_PACKAGE_D_GOLD : '1000'), $text); $text = preg_replace("'%PLUS_PACKAGE_E_PRICE%'", (defined('PLUS_PACKAGE_E_PRICE') ? PLUS_PACKAGE_E_PRICE : '49,99'), $text); $text = preg_replace("'%PLUS_PACKAGE_E_GOLD%'", (defined('PLUS_PACKAGE_E_GOLD') ? PLUS_PACKAGE_E_GOLD : '2000'), $text); - + fwrite($fh, $text); fclose($fh);