mirror of
https://github.com/Shadowss/TravianZ.git
synced 2026-07-25 05:56:13 +00:00
Fix + Redesign
Fix some error programing code and redesign special medals, tribe medals, mh medals, taskmaster medals, natars medals, nature medals, protection medals, etc. Add some language code in Profile.php and preference.tpl. Change some description in struct database for Nature and Taskmaster
This commit is contained in:
@@ -45,6 +45,14 @@ class Artifacts
|
||||
NATARS_DESC = "**************************
|
||||
[#natars]
|
||||
**************************",
|
||||
|
||||
/**
|
||||
* @var string Default Natars' description 2
|
||||
*/
|
||||
|
||||
NATARS_DESC2 = "**************************
|
||||
[#WW]
|
||||
**************************",
|
||||
|
||||
/**
|
||||
* @var array Possible Natars' capital locations
|
||||
@@ -204,7 +212,7 @@ class Artifacts
|
||||
|
||||
//Register the Natars account, the Natars' password is the same as the MH's one
|
||||
$password = $database->getUserField(5, 'password', 0);
|
||||
$database->register(TRIBE5, $password, self::NATARS_EMAIL, self::NATARS_TRIBE, null, self::NATARS_UID, self::NATARS_DESC);
|
||||
$database->register(TRIBE5, $password, self::NATARS_EMAIL, self::NATARS_TRIBE, null, self::NATARS_UID, self::NATARS_DESC, self::NATARS_DESC2);
|
||||
|
||||
//Convert from coordinates to village IDs
|
||||
$possibleWids = $database->getVilWrefs(self::NATARS_CAPITAL_COORDINATES);
|
||||
|
||||
@@ -219,6 +219,21 @@ class Profile {
|
||||
$form->addError("email", EMAIL_ERROR);
|
||||
}
|
||||
}
|
||||
|
||||
// Language change
|
||||
if (!empty($post['sprache'])) {
|
||||
// whitelist – pune aici limbile pe care le ai în /lang/
|
||||
$allowed = ['en','ro','de','it','fr','es'];
|
||||
$lang = strtolower(trim($post['sprache']));
|
||||
|
||||
if (in_array($lang, $allowed, true)) {
|
||||
$database->updateUserField($session->uid, "language", $lang, 1);
|
||||
|
||||
// update sesiunea ca să se vadă imediat, fără relog
|
||||
$_SESSION['lang'] = $lang;
|
||||
$session->userinfo['language'] = $lang;
|
||||
}
|
||||
}
|
||||
|
||||
// Delete request cancel
|
||||
if (!empty($post['del_pw']) && !empty($post['del'])) {
|
||||
|
||||
Reference in New Issue
Block a user