From ebbf5165aa26f7752c14ca0b60951ac8ca662d8f Mon Sep 17 00:00:00 2001 From: Catalin Novgorodschi <1140613+Shadowss@users.noreply.github.com> Date: Mon, 27 Apr 2026 15:04:44 +0300 Subject: [PATCH] Code for preference (just logic not operational) Code for preference (just logic not operational) --- Templates/Profile/preference.tpl | 315 +++++++++++++++++++------------ var/db/struct.sql | 9 + 2 files changed, 206 insertions(+), 118 deletions(-) diff --git a/Templates/Profile/preference.tpl b/Templates/Profile/preference.tpl index 77922600..61edeb4b 100644 --- a/Templates/Profile/preference.tpl +++ b/Templates/Profile/preference.tpl @@ -13,13 +13,17 @@ if(isset($_GET['del']) && is_numeric($_GET['del'])){ ## Developed by: Dzoki ## ## Fixed by: Shadow / Skype : cata7007 ## ## License: TravianZ Project ## -## Copyright: TravianZ (c) 2010-2013. All rights reserved. ## +## Copyright: TravianZ (c) 2010-2026. All rights reserved. ## ## URLs: http://travian.shadowss.ro ## ## Source code: http://github.com/Shadowss/TravianZ/ ## ## ## ################################################################################# // Save new link or just edit a link -if($_POST) { +if(isset($_POST['ft']) && $_POST['ft'] == 'p3'){ + return; +} + +if(isset($_POST['nr0']) || isset($_POST['id0']) || isset($_POST['linkname0']) || isset($_POST['linkziel0'])) { $links = []; // let's do some complicated code x'D @@ -82,13 +86,46 @@ if($_POST) { $query = mysqli_query($database->dblink,'SELECT * FROM `' . TB_PREFIX . 'links` WHERE `userid` = ' . (int) $session->uid . ' ORDER BY `pos` ASC') or die(mysqli_error($database->dblink)); $links = []; while($data = mysqli_fetch_assoc($query)) $links[] = $data; + +//Code for preference (map,timezone,timeformat,etc.) + +if(isset($_POST['v1']) || isset($_POST['v2']) || isset($_POST['timezone'])) { + + $v1 = isset($_POST['v1']) ? 1 : 0; + $v2 = isset($_POST['v2']) ? 1 : 0; + $v3 = isset($_POST['v3']) ? 1 : 0; + $map = isset($_POST['map']) ? 1 : 0; + $v4 = isset($_POST['v4']) ? 1 : 0; + $v5 = isset($_POST['v5']) ? 1 : 0; + $v6 = isset($_POST['v6']) ? 1 : 0; + + $timezone = isset($_POST['timezone']) ? intval($_POST['timezone']) : 1; + $tformat = isset($_POST['tformat']) ? intval($_POST['tformat']) : 0; + + $database->query(" + UPDATE ".TB_PREFIX."users SET + v1 = $v1, + v2 = $v2, + v3 = $v3, + map = $map, + v4 = $v4, + v5 = $v5, + v6 = $v6, + timezone = $timezone, + tformat = $tformat + WHERE id = ".$session->uid." + "); + + header("Location: spieler.php?s=2"); + exit; +} ?>

Player profile

- + @@ -118,131 +155,173 @@ while($data = mysqli_fetch_assoc($query)) $links[] = $data; - - - -
- - - - - - - - - - - - - - - - - - - - - - -
Auto completion
Used for rally point and marketplace:
own villages
villages of the surroundings
villages from players of the alliance
- - - - - - - - - - - -
Large map
Show the large map in an extra window.
- - - - - - - - - - - - - - - - - - - -
Report filter
No reports for transfers to own villages.
No reports for transfers to foreign villages.
No reports for transfers from foreign villages.
+
+ + + + + - + + + - + + - - - - - - + + -
Auto completion
Used for rally point and marketplace:
Time preferences +userinfo['v1']) echo 'checked'; ?>> +own villages
Here you can change Travian's displayed time to fit your time zone. +userinfo['v2']) echo 'checked'; ?>> +villages of the surroundings
Time zones - -
Date -
- -
-
- -
+userinfo['v3']) echo 'checked'; ?>> +villages from players of the alliance

+ - + + + + + + + + + + + +
Large map
+userinfo['map']) echo 'checked'; ?>> +Show the large map in an extra window.
+ + + + + + + + + + + + + + + + + + + + + + + + +
Report filter
+userinfo['v4']) echo 'checked'; ?>> +No reports for transfers to own villages.
+userinfo['v5']) echo 'checked'; ?>> +No reports for transfers to foreign villages.
+userinfo['v6']) echo 'checked'; ?>> +No reports for transfers from foreign villages.
+ + + + + + + + + + + + + + + + + + + + + +
Time preferences
Here you can change Travian's displayed time to fit your time zone.
Time zones + +
Date + +
+ +
+ +
+ + + +
+ + +

+ +

+ diff --git a/var/db/struct.sql b/var/db/struct.sql index b6bd1991..a9194140 100644 --- a/var/db/struct.sql +++ b/var/db/struct.sql @@ -1604,6 +1604,15 @@ CREATE TABLE IF NOT EXISTS `%PREFIX%users` ( `vac_mode` int(2) DEFAULT '0', `vactwoweeks` varchar(255) DEFAULT '0', `is_bcrypt` tinyint(1) NOT NULL DEFAULT '0', + `v1` TINYINT(1) DEFAULT '1', + `v2` TINYINT(1) DEFAULT '0', + `v3` TINYINT(1) DEFAULT '0', + `map` TINYINT(1) DEFAULT '0', + `v4` TINYINT(1) DEFAULT '0', + `v5` TINYINT(1) DEFAULT '0', + `v6` TINYINT(1) DEFAULT '0', + `timezone` INT DEFAULT '1', + `tformat` INT DEFAULT '0', PRIMARY KEY (`id`), UNIQUE KEY `email` (`email`), UNIQUE KEY `username` (`username`),