From 7776ffa64c8f5093592ecee770174ca3a6b6fe43 Mon Sep 17 00:00:00 2001 From: Pedro Henrique Alves Cruz Date: Sun, 18 Aug 2024 09:35:37 -0300 Subject: [PATCH 01/42] feat: multiworld system --- login.php | 72 ++++++++++++++++++++++++++++++++++++++----------------- 1 file changed, 50 insertions(+), 22 deletions(-) diff --git a/login.php b/login.php index 40b00227a..21f137d6c 100644 --- a/login.php +++ b/login.php @@ -120,27 +120,56 @@ function jsonCompendium() ])); case 'login': - $ip = configLua('ip'); - $port = configLua('gameProtocolPort'); + $worldsFetched = $db->query("SELECT * FROM worlds"); + $worlds = []; + if ($worldsFetched && $worldsFetched->rowCount() > 0) { + $worldsFetched = $worldsFetched->fetchAll(); + foreach ($worldsFetched as $world) { + $worldInfo = [ + 'id' => $world['id'], + 'name' => $world['name'], + 'externaladdress' => $world['ip'], + 'externaladdressprotected' => $world['ip'], + 'externaladdressunprotected' => $world['ip'], + 'externalport' => $world['port'], + 'externalportprotected' => $world['port'], + 'externalportunprotected' => $world['port'], + 'previewstate' => 0, + 'location' => 'BRA', // BRA, EUR, USA + 'anticheatprotection' => false, + 'pvptype' => array_search($world['worldType'], ['pvp', 'no-pvp', 'pvp-enforced']), + 'istournamentworld' => false, + 'restrictedstore' => false, + 'currenttournamentphase' => 2 + ]; + array_push($worlds, $worldInfo); + } + } else { + // default world - // default world info - $world = [ - 'id' => 0, - 'name' => configLua('serverName'), - 'externaladdress' => $ip, - 'externaladdressprotected' => $ip, - 'externaladdressunprotected' => $ip, - 'externalport' => $port, - 'externalportprotected' => $port, - 'externalportunprotected' => $port, - 'previewstate' => 0, - 'location' => 'BRA', // BRA, EUR, USA - 'anticheatprotection' => false, - 'pvptype' => array_search(configLua('worldType'), ['pvp', 'no-pvp', 'pvp-enforced']), - 'istournamentworld' => false, - 'restrictedstore' => false, - 'currenttournamentphase' => 2 - ]; + $ip = configLua('ip'); + $port = configLua('gameProtocolPort'); + + $world = [ + 'id' => 0, + 'name' => configLua('serverName'), + 'externaladdress' => $ip, + 'externaladdressprotected' => $ip, + 'externaladdressunprotected' => $ip, + 'externalport' => $port, + 'externalportprotected' => $port, + 'externalportunprotected' => $port, + 'previewstate' => 0, + 'location' => 'BRA', // BRA, EUR, USA + 'anticheatprotection' => false, + 'pvptype' => array_search(configLua('worldType'), ['pvp', 'no-pvp', 'pvp-enforced']), + 'istournamentworld' => false, + 'restrictedstore' => false, + 'currenttournamentphase' => 2 + ]; + + $worlds = [$world]; + } $account = new OTS_Account(); $account->findByEmail($result->email); @@ -174,7 +203,6 @@ function jsonCompendium() sendError("Error while fetching your account data. Please contact admin."); } - $worlds = [$world]; $playdata = compact('worlds', 'characters'); $session = [ 'sessionkey' => "$result->email\n$result->password", @@ -206,7 +234,7 @@ function jsonCompendium() function createChar($config, $player) { return [ - 'worldid' => 0, + 'worldid' => $player['worldId'], 'name' => $player['name'], 'ismale' => intval($player['sex']) === 1, 'tutorial' => (bool)$player['istutorial'], From 93ca9d8d9f84ced29b6cc7be1185c6cdb1ed612c Mon Sep 17 00:00:00 2001 From: Pedro Henrique Alves Cruz Date: Sun, 18 Aug 2024 14:13:45 -0300 Subject: [PATCH 02/42] fix: worldtype name --- login.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/login.php b/login.php index 21f137d6c..3a7be4a0d 100644 --- a/login.php +++ b/login.php @@ -137,7 +137,7 @@ function jsonCompendium() 'previewstate' => 0, 'location' => 'BRA', // BRA, EUR, USA 'anticheatprotection' => false, - 'pvptype' => array_search($world['worldType'], ['pvp', 'no-pvp', 'pvp-enforced']), + 'pvptype' => array_search($world['type'], ['pvp', 'no-pvp', 'pvp-enforced']), 'istournamentworld' => false, 'restrictedstore' => false, 'currenttournamentphase' => 2 From d7aae9566dbbe7efbb464841104be4de609fb18f Mon Sep 17 00:00:00 2001 From: Pedro Henrique Alves Cruz Date: Mon, 19 Aug 2024 06:35:05 -0300 Subject: [PATCH 03/42] fix: login not woring properly --- login.php | 27 +-------------------------- 1 file changed, 1 insertion(+), 26 deletions(-) diff --git a/login.php b/login.php index 3a7be4a0d..f2876c30a 100644 --- a/login.php +++ b/login.php @@ -144,31 +144,6 @@ function jsonCompendium() ]; array_push($worlds, $worldInfo); } - } else { - // default world - - $ip = configLua('ip'); - $port = configLua('gameProtocolPort'); - - $world = [ - 'id' => 0, - 'name' => configLua('serverName'), - 'externaladdress' => $ip, - 'externaladdressprotected' => $ip, - 'externaladdressunprotected' => $ip, - 'externalport' => $port, - 'externalportprotected' => $port, - 'externalportunprotected' => $port, - 'previewstate' => 0, - 'location' => 'BRA', // BRA, EUR, USA - 'anticheatprotection' => false, - 'pvptype' => array_search(configLua('worldType'), ['pvp', 'no-pvp', 'pvp-enforced']), - 'istournamentworld' => false, - 'restrictedstore' => false, - 'currenttournamentphase' => 2 - ]; - - $worlds = [$world]; } $account = new OTS_Account(); @@ -185,7 +160,7 @@ function jsonCompendium() } // common columns - $columns = 'name, level, sex, vocation, looktype, lookhead, lookbody, looklegs, lookfeet, lookaddons, lastlogin, isreward, istutorial, ismain, hidden'; + $columns = 'name, level, sex, vocation, looktype, lookhead, lookbody, looklegs, lookfeet, lookaddons, lastlogin, isreward, istutorial, ismain, hidden, worldId'; $players = $db->query("SELECT {$columns} FROM players WHERE account_id = {$account->getId()} AND deletion = 0"); $characters = []; if ($players && $players->rowCount() > 0) { From 8c77a735f49e1680fe7f69d2ee15613583884859 Mon Sep 17 00:00:00 2001 From: Elson Costa Date: Thu, 22 Aug 2024 18:38:15 -0300 Subject: [PATCH 04/42] world: wip crud worlds. --- admin/pages/worlds.php | 100 +++++++++ admin/template/template.php | 435 ++++++++++++++++++------------------ 2 files changed, 313 insertions(+), 222 deletions(-) create mode 100644 admin/pages/worlds.php diff --git a/admin/pages/worlds.php b/admin/pages/worlds.php new file mode 100644 index 000000000..897bc244f --- /dev/null +++ b/admin/pages/worlds.php @@ -0,0 +1,100 @@ +hasTable('worlds')) { + die("worlds table doesn't exists!"); +} + +$title = 'Worlds'; +$base = BASE_URL . 'admin/?p=worlds'; + +function echo_success($message) +{ + echo '

' . $message . '

'; +} + +function echo_error($message) +{ + global $error; + echo '

' . $message . '

'; + $error = true; +} + +$id = $_REQUEST['id'] ?? 0; + +if ($id > 0) { + $world = $db->query("SELECT * FROM `worlds` WHERE `id` = {$id}")->fetch(); + ?> +
+
+
+
+
+
+ + +
+
+ + + + +
+
+ +query("SELECT * FROM `worlds` ORDER BY `id` ASC")->fetchAll(); + ?> +
+
+
+
+ + + + + + + + + + + + $world) { ?> + + + + + + + + + + + +
#IDNameServer TypeIPPort
+ + + +
+
+
+
+
+ diff --git a/admin/template/template.php b/admin/template/template.php index fec39de91..11db09a05 100644 --- a/admin/template/template.php +++ b/admin/template/template.php @@ -1,241 +1,232 @@ ['Dashboard', 'dashboard'], + 'news' => ['News', 'newspaper'], + 'mailer' => ['Mailer', 'envelope'], + 'pages' => ['Pages', 'book'], + 'modifiers' => ['Modifiers', 'user'], + 'menus' => ['Menus', 'list'], + 'plugins' => ['Plugins', 'plug'], + 'visitors' => ['Visitors', 'users'], + 'worlds' => ['Worlds', 'globe'], + 'editor' => ['Editor', 'edit', + 'children' => [ + 'accounts' => 'Accounts', + 'players' => 'Players', + ] + ], + 'items' => ['Items', 'gavel'], + 'tools' => ['Tools', 'wrench', + 'children' => [ + 'pag_transactions' => 'Donates', + 'premiumvipupdater' => 'Premium/VIP Updater', + 'notepad' => 'Notepad', + 'phpinfo' => 'phpinfo', + //'Premium/VIP Fixer' => 'fixvippremiumnewsystem', //Unused function (used to fix new vip/premium) system + ] + ], + 'logs' => ['Logs', 'edit', + 'children' => [ + 'logs' => 'Logs', + 'reports' => 'Reports', + ] + ], +]; + defined('MYAAC') or die('Direct access not allowed!'); ?> - - - <?= $title_full ?> - - - - - - - - - - - - - - - - - - + + + <?= $title_full ?> + + + + + + + + + + + + + + + + + +
- -
- - - -
- - -
-
-

- - Admin Panel -
- -
-

-
-
- -
- + + + +

Site

+ + +

Version

+ +
- -
- - - -
- - -
+ +
- - - - - + + + + + From 9c156f3fa9a48da7a9b0d70939ead981446f6304 Mon Sep 17 00:00:00 2001 From: Elson Costa Date: Fri, 23 Aug 2024 11:05:39 -0300 Subject: [PATCH 05/42] world: crud. adm template menu: improvements. --- admin/pages/worlds.php | 119 ++++++++++++++++++++++++++++++------ admin/template/template.php | 13 ++-- tools/css/AdminLTE.min.css | 2 +- 3 files changed, 106 insertions(+), 28 deletions(-) diff --git a/admin/pages/worlds.php b/admin/pages/worlds.php index 897bc244f..a8840b831 100644 --- a/admin/pages/worlds.php +++ b/admin/pages/worlds.php @@ -1,5 +1,5 @@ hasTable('worlds')) { - die("worlds table doesn't exists!"); + echo "worlds table doesn't exists!"; + return; +} + +if (!superAdmin()) { + echo 'Access denied.'; + return; } $title = 'Worlds'; @@ -28,58 +34,131 @@ function echo_error($message) $error = true; } +if (isset($_POST['save'])) { + $error = false; + + $_error = ''; + + if (!$name = $_POST['name']) { + echo_error("World name is required!"); + } + if (!$type = $_POST['type']) { + echo_error("Server type is required!"); + } + if (!$ip = $_POST['ip']) { + echo_error("IP is required!"); + } + if (!$port = $_POST['port']) { + echo_error("Port is required!"); + } + + if ($id = $_POST['world_id'] ?? null) { + $world = $id > 0 ? $db->query("SELECT * FROM `worlds` WHERE `id` = {$id}")->fetch() : null; + if (!$world) { + echo_error("World with this id doesn't exist."); + } + + if (!$error) { + $db->exec("UPDATE `worlds` SET `name` = {$db->quote($name)}, `type` = {$db->quote($type)}, `ip` = {$db->quote($ip)}, `port` = {$port} WHERE `id` = {$id}"); + echo_success("World {$name} saved at: " . date('G:i')); + } + } else { + if (!$error) { + $db->exec("INSERT INTO `worlds` (`name`, `type`, `ip`, `port`) VALUES ({$db->quote($name)}, {$db->quote($type)}, {$db->quote($ip)}, {$port});"); + echo_success("World {$name} created at: " . date('G:i')); + } + } +} + $id = $_REQUEST['id'] ?? 0; -if ($id > 0) { - $world = $db->query("SELECT * FROM `worlds` WHERE `id` = {$id}")->fetch(); +if ($id > 0 || $action === 'add') { + $world = $id > 0 ? $db->query("SELECT * FROM `worlds` WHERE `id` = {$id}")->fetch() : null; ?> -
-
+ +
+ +
+
+ + +
+
+
-
- - +
+ + +
+
+ + +
+
+ + +
+
+ +
- +
+
query("SELECT * FROM `worlds` ORDER BY `id` ASC")->fetchAll(); ?>
-
+
+
+

Worlds found on your server

+
+ New +
+
- +
- - + - $world) { ?> + - - + diff --git a/admin/template/template.php b/admin/template/template.php index 11db09a05..0328056e5 100644 --- a/admin/template/template.php +++ b/admin/template/template.php @@ -1,5 +1,5 @@ ['Dashboard', 'dashboard'], @@ -99,7 +99,7 @@ $icon = $item[1] ?? 'link'; if (!$children = $item['children'] ?? null) { echo '"; - echo " {$item[0]}"; + echo " {$item[0]}"; } if ($children) { @@ -111,12 +111,12 @@ $nav_construct = $nav_construct . ' class="active"'; $used_menu = true; } - $nav_construct = "$nav_construct> {$child}"; + $nav_construct = "$nav_construct> {$child}"; } $m = $used_menu ? ' menu-open' : ''; $m2 = $used_menu ? ' display: block' : ' display: none'; - echo "
  • {$item[0]} + echo "
  • {$item[0]}
      "; echo $nav_construct; @@ -124,12 +124,11 @@ } } - $query = $db->query('SELECT `name`, `page`, `flags` FROM `' . TABLE_PREFIX . 'admin_menu` ORDER BY `ordering`'); - $menu_db = $query->fetchAll(); + $menu_db = $db->query('SELECT `name`, `page`, `flags` FROM `' . TABLE_PREFIX . 'admin_menu` ORDER BY `ordering`')->fetchAll(); foreach ($menu_db as $item) { if ($item['flags'] == 0 || hasFlag($item['flags'])) { echo '"; - echo ' ' . $item['name'] . ''; + echo " {$item['name']}"; } } ?> diff --git a/tools/css/AdminLTE.min.css b/tools/css/AdminLTE.min.css index e2f10630c..aef78d5fb 100644 --- a/tools/css/AdminLTE.min.css +++ b/tools/css/AdminLTE.min.css @@ -1491,7 +1491,7 @@ button, input, select, textarea { color: #fff; font-weight: bold; display: block; - padding: 10px; + padding: 14px; position: relative; background-color: #202634; } From bad42a8a27a2d206b66eefa87b2abd3e2e39c308 Mon Sep 17 00:00:00 2001 From: Elson Costa Date: Fri, 23 Aug 2024 11:35:55 -0300 Subject: [PATCH 06/42] login: improvements, removed redundant variables. --- login.php | 36 +++++++++++++++++------------------- 1 file changed, 17 insertions(+), 19 deletions(-) diff --git a/login.php b/login.php index f2876c30a..7c6705507 100644 --- a/login.php +++ b/login.php @@ -84,7 +84,6 @@ function jsonCompendium() ])); case 'eventschedule': - $eventlist = []; $file_path = config('server_path') . 'data/XML/events.xml'; if (!file_exists($file_path)) { die(json_encode([])); @@ -93,6 +92,7 @@ function jsonCompendium() $xml->load($file_path); $tableevent = $xml->getElementsByTagName('event'); + $eventlist = []; foreach ($tableevent as $event) { if ($event) { $eventlist[] = [ @@ -120,12 +120,11 @@ function jsonCompendium() ])); case 'login': - $worldsFetched = $db->query("SELECT * FROM worlds"); + $queryW = $db->query("SELECT * FROM worlds"); $worlds = []; - if ($worldsFetched && $worldsFetched->rowCount() > 0) { - $worldsFetched = $worldsFetched->fetchAll(); - foreach ($worldsFetched as $world) { - $worldInfo = [ + if ($queryW && $queryW->rowCount() > 0) { + foreach ($queryW->fetchAll() as $world) { + $worlds[] = [ 'id' => $world['id'], 'name' => $world['name'], 'externaladdress' => $world['ip'], @@ -142,7 +141,6 @@ function jsonCompendium() 'restrictedstore' => false, 'currenttournamentphase' => 2 ]; - array_push($worlds, $worldInfo); } } @@ -160,20 +158,20 @@ function jsonCompendium() } // common columns + $accId = $account->getId(); $columns = 'name, level, sex, vocation, looktype, lookhead, lookbody, looklegs, lookfeet, lookaddons, lastlogin, isreward, istutorial, ismain, hidden, worldId'; - $players = $db->query("SELECT {$columns} FROM players WHERE account_id = {$account->getId()} AND deletion = 0"); + $queryP = $db->query("SELECT {$columns} FROM players WHERE account_id = {$accId} AND deletion = 0"); $characters = []; - if ($players && $players->rowCount() > 0) { - $players = $players->fetchAll(); - foreach ($players as $player) { + if ($queryP && $queryP->rowCount() > 0) { + foreach ($queryP->fetchAll() as $player) { $characters[] = createChar($config, $player); } } - $query = $db->query("SELECT `premdays`, `lastday` FROM `accounts` WHERE `id` = {$account->getId()}"); + $query = $db->query("SELECT `premdays`, `lastday` FROM `accounts` WHERE `id` = {$accId}")->fetch(); $premU = 0; - if ($query->rowCount() > 0) { - $premU = checkPremium($db, $query->fetch(), $account); + if ($account) { + $premU = checkPremium($query, $accId); } else { sendError("Error while fetching your account data. Please contact admin."); } @@ -231,13 +229,13 @@ function createChar($config, $player) /** * Function to check account has premium time and update days - * @param $db - * @param $query - * @param $account + * @param array $query + * @param int $accId * @return float|int */ -function checkPremium($db, $query, $account) +function checkPremium(array $query, int $accId) { + global $db; $lastDay = (int)$query['lastday']; $timeNow = time(); @@ -259,6 +257,6 @@ function checkPremium($db, $query, $account) } } - $db->query("UPDATE `accounts` SET `premdays` = {$premDays}, `lastday` = {$lastDay} WHERE `id` = {$account->getId()}"); + $db->query("UPDATE `accounts` SET `premdays` = {$premDays}, `lastday` = {$lastDay} WHERE `id` = {$accId}"); return $lastDay; } From b63d4cf121461cdb0444343cf5506bf3985b2686 Mon Sep 17 00:00:00 2001 From: Elson Costa Date: Fri, 23 Aug 2024 11:38:16 -0300 Subject: [PATCH 07/42] highscores.php: reindent. --- system/pages/highscores.php | 710 ++++++++++++++++++------------------ 1 file changed, 356 insertions(+), 354 deletions(-) diff --git a/system/pages/highscores.php b/system/pages/highscores.php index f7e7442a1..d4d635a28 100644 --- a/system/pages/highscores.php +++ b/system/pages/highscores.php @@ -13,37 +13,37 @@ $title = 'Highscores'; if ($config['account_country'] && $config['highscores_country_box']) - require SYSTEM . 'countries.conf.php'; + require SYSTEM . 'countries.conf.php'; $list = $_GET['list'] ?? ''; $_page = $_GET['page'] ?? 0; $vocation = $_GET['vocation'] ?? null; if (!is_numeric($_page) || $_page < 0 || $_page > PHP_INT_MAX) { - $_page = 0; + $_page = 0; } $add_sql = ''; $config_vocations = $config['vocations']; $normalized_vocations = array_map('strtolower', $config_vocations); -if (!array_search(strtolower($vocation), $normalized_vocations)) $vocation = "None"; +if (!array_search(@strtolower($vocation), $normalized_vocations)) $vocation = "None"; if ($config['highscores_vocation_box'] && isset($vocation)) { - foreach ($config['vocations'] as $id => $name) { - if (strtolower($name) == $vocation) { - $add_vocs = array($id); - - $i = $id + $config['vocations_amount']; - while (isset($config['vocations'][$i])) { - $add_vocs[] = $i; - $i += $config['vocations_amount']; - } - - $add_sql = 'AND `vocation` IN (' . implode(', ', $add_vocs) . ')'; - break; - } + foreach ($config['vocations'] as $id => $name) { + if (strtolower($name) == $vocation) { + $add_vocs = array($id); + + $i = $id + $config['vocations_amount']; + while (isset($config['vocations'][$i])) { + $add_vocs[] = $i; + $i += $config['vocations_amount']; + } + + $add_sql = 'AND `vocation` IN (' . implode(', ', $add_vocs) . ')'; + break; } + } } define('SKILL_FRAGS', -1); @@ -51,233 +51,233 @@ $skill = POT::SKILL_LEVEL; if (is_numeric($list)) { - $list = (int)$list; - if ($list >= POT::SKILL_FIRST && $list <= POT::SKILL__LAST) - $skill = $list; + $list = (int)$list; + if ($list >= POT::SKILL_FIRST && $list <= POT::SKILL__LAST) + $skill = $list; } else { - switch ($list) { - case 'fist': - $skill = POT::SKILL_FIST; - break; - - case 'club': - $skill = POT::SKILL_CLUB; - break; - - case 'sword': - $skill = POT::SKILL_SWORD; - break; - - case 'axe': - $skill = POT::SKILL_AXE; - break; - - case 'distance': - $skill = POT::SKILL_DIST; - break; - - case 'shield': - $skill = POT::SKILL_SHIELD; - break; - - case 'fishing': - $skill = POT::SKILL_FISH; - break; - - case 'level': - case 'experience': - $skill = POT::SKILL_LEVEL; - break; - - case 'magic': - $skill = POT::SKILL_MAGLEVEL; - break; - - case 'frags': - if ($config['highscores_frags'] && $config['otserv_version'] == TFS_03) - $skill = SKILL_FRAGS; - break; - - case 'balance': - if ($config['highscores_balance']) - $skill = SKILL_BALANCE; - break; - } + switch ($list) { + case 'fist': + $skill = POT::SKILL_FIST; + break; + + case 'club': + $skill = POT::SKILL_CLUB; + break; + + case 'sword': + $skill = POT::SKILL_SWORD; + break; + + case 'axe': + $skill = POT::SKILL_AXE; + break; + + case 'distance': + $skill = POT::SKILL_DIST; + break; + + case 'shield': + $skill = POT::SKILL_SHIELD; + break; + + case 'fishing': + $skill = POT::SKILL_FISH; + break; + + case 'level': + case 'experience': + $skill = POT::SKILL_LEVEL; + break; + + case 'magic': + $skill = POT::SKILL_MAGLEVEL; + break; + + case 'frags': + if ($config['highscores_frags'] && $config['otserv_version'] == TFS_03) + $skill = SKILL_FRAGS; + break; + + case 'balance': + if ($config['highscores_balance']) + $skill = SKILL_BALANCE; + break; + } } $promotion = ''; if ($db->hasColumn('players', 'promotion')) - $promotion = ',promotion'; + $promotion = ',promotion'; $online = ''; if ($db->hasColumn('players', 'online')) - $online = ',online'; + $online = ',online'; $deleted = 'deleted'; if ($db->hasColumn('players', 'deletion')) - $deleted = 'deletion'; + $deleted = 'deletion'; $outfit_addons = false; $outfit = ''; if ($config['highscores_outfit']) { - $outfit = ', lookbody, lookfeet, lookhead, looklegs, looktype'; - if ($db->hasColumn('players', 'lookaddons')) { - $outfit .= ', lookaddons'; - $outfit_addons = true; - } + $outfit = ', lookbody, lookfeet, lookhead, looklegs, looktype'; + if ($db->hasColumn('players', 'lookaddons')) { + $outfit .= ', lookaddons'; + $outfit_addons = true; + } } $limit = $config['highscores_length'] ?? 30; $limit_ = $limit + 1; $offset = $_page * $limit; if ($skill >= POT::SKILL_FIRST && $skill <= POT::SKILL_LAST) { // skills - if ($db->hasColumn('players', 'skill_fist')) {// tfs 1.0 - $skill_ids = array( - POT::SKILL_FIST => 'skill_fist', - POT::SKILL_CLUB => 'skill_club', - POT::SKILL_SWORD => 'skill_sword', - POT::SKILL_AXE => 'skill_axe', - POT::SKILL_DIST => 'skill_dist', - POT::SKILL_SHIELD => 'skill_shielding', - POT::SKILL_FISH => 'skill_fishing', - ); - - $skills = $db->query('SELECT accounts.country,players.id,players.name' . $online . ',level,vocation' . $promotion . $outfit . ', ' . $skill_ids[$skill] . ' as value FROM accounts,players WHERE players.id NOT IN (' . implode(', ', $config['highscores_ids_hidden']) . ') AND players.' . $deleted . ' = 0 AND players.group_id < ' . $config['highscores_groups_hidden'] . ' ' . $add_sql . ' AND accounts.id = players.account_id ORDER BY ' . $skill_ids[$skill] . ' DESC, players.name ASC LIMIT ' . $limit_ . ' OFFSET ' . $offset)->fetchAll(); - } else - $skills = $db->query('SELECT accounts.country,players.id,players.name' . $online . ',value,level,vocation' . $promotion . $outfit . ' FROM accounts,players,player_skills WHERE players.id NOT IN (' . implode(', ', $config['highscores_ids_hidden']) . ') AND players.' . $deleted . ' = 0 AND players.group_id < ' . $config['highscores_groups_hidden'] . ' ' . $add_sql . ' AND players.id = player_skills.player_id AND player_skills.skillid = ' . $skill . ' AND accounts.id = players.account_id ORDER BY value DESC, count DESC, players.name ASC LIMIT ' . $limit_ . ' OFFSET ' . $offset)->fetchAll(); + if ($db->hasColumn('players', 'skill_fist')) {// tfs 1.0 + $skill_ids = array( + POT::SKILL_FIST => 'skill_fist', + POT::SKILL_CLUB => 'skill_club', + POT::SKILL_SWORD => 'skill_sword', + POT::SKILL_AXE => 'skill_axe', + POT::SKILL_DIST => 'skill_dist', + POT::SKILL_SHIELD => 'skill_shielding', + POT::SKILL_FISH => 'skill_fishing', + ); + + $skills = $db->query('SELECT accounts.country,players.id,players.name' . $online . ',level,vocation' . $promotion . $outfit . ', ' . $skill_ids[$skill] . ' as value FROM accounts,players WHERE players.id NOT IN (' . implode(', ', $config['highscores_ids_hidden']) . ') AND players.' . $deleted . ' = 0 AND players.group_id < ' . $config['highscores_groups_hidden'] . ' ' . $add_sql . ' AND accounts.id = players.account_id ORDER BY ' . $skill_ids[$skill] . ' DESC, players.name ASC LIMIT ' . $limit_ . ' OFFSET ' . $offset)->fetchAll(); + } else + $skills = $db->query('SELECT accounts.country,players.id,players.name' . $online . ',value,level,vocation' . $promotion . $outfit . ' FROM accounts,players,player_skills WHERE players.id NOT IN (' . implode(', ', $config['highscores_ids_hidden']) . ') AND players.' . $deleted . ' = 0 AND players.group_id < ' . $config['highscores_groups_hidden'] . ' ' . $add_sql . ' AND players.id = player_skills.player_id AND player_skills.skillid = ' . $skill . ' AND accounts.id = players.account_id ORDER BY value DESC, count DESC, players.name ASC LIMIT ' . $limit_ . ' OFFSET ' . $offset)->fetchAll(); } else if ($skill == SKILL_FRAGS && $config['otserv_version'] == TFS_03) // frags { - $skills = $db->query('SELECT accounts.country, players.id,players.name' . $online . ',level,vocation' . $promotion . $outfit . ',COUNT(`player_killers`.`player_id`) as value' . - ' FROM `accounts`, `players`, `player_killers` ' . - ' WHERE players.id NOT IN (' . implode(', ', $config['highscores_ids_hidden']) . ') AND players.' . $deleted . ' = 0 AND players.group_id < ' . $config['highscores_groups_hidden'] . ' ' . $add_sql . ' AND players.id = player_killers.player_id AND accounts.id = players.account_id' . - ' GROUP BY `player_id`' . - ' ORDER BY value DESC' . - ' LIMIT ' . $limit_ . ' OFFSET ' . $offset)->fetchAll(); + $skills = $db->query('SELECT accounts.country, players.id,players.name' . $online . ',level,vocation' . $promotion . $outfit . ',COUNT(`player_killers`.`player_id`) as value' . + ' FROM `accounts`, `players`, `player_killers` ' . + ' WHERE players.id NOT IN (' . implode(', ', $config['highscores_ids_hidden']) . ') AND players.' . $deleted . ' = 0 AND players.group_id < ' . $config['highscores_groups_hidden'] . ' ' . $add_sql . ' AND players.id = player_killers.player_id AND accounts.id = players.account_id' . + ' GROUP BY `player_id`' . + ' ORDER BY value DESC' . + ' LIMIT ' . $limit_ . ' OFFSET ' . $offset)->fetchAll(); } else if ($skill == SKILL_BALANCE) // balance { - $skills = $db->query('SELECT accounts.country, players.id,players.name' . $online . ',level,balance as value,vocation' . $promotion . $outfit . ' FROM accounts,players WHERE players.id NOT IN (' . implode(', ', $config['highscores_ids_hidden']) . ') AND players.' . $deleted . ' = 0 AND players.group_id < ' . $config['highscores_groups_hidden'] . ' ' . $add_sql . ' AND accounts.id = players.account_id ORDER BY value DESC, name ASC LIMIT ' . $limit_ . ' OFFSET ' . $offset)->fetchAll(); + $skills = $db->query('SELECT accounts.country, players.id,players.name' . $online . ',level,balance as value,vocation' . $promotion . $outfit . ' FROM accounts,players WHERE players.id NOT IN (' . implode(', ', $config['highscores_ids_hidden']) . ') AND players.' . $deleted . ' = 0 AND players.group_id < ' . $config['highscores_groups_hidden'] . ' ' . $add_sql . ' AND accounts.id = players.account_id ORDER BY value DESC, name ASC LIMIT ' . $limit_ . ' OFFSET ' . $offset)->fetchAll(); } else { - if ($skill == POT::SKILL_MAGLEVEL) { - $skills = $db->query('SELECT accounts.country, players.id,players.name' . $online . ',maglevel,level,vocation' . $promotion . $outfit . ' FROM accounts, players WHERE players.id NOT IN (' . implode(', ', $config['highscores_ids_hidden']) . ') AND players.' . $deleted . ' = 0 ' . $add_sql . ' AND players.group_id < ' . $config['highscores_groups_hidden'] . ' AND accounts.id = players.account_id ORDER BY maglevel DESC, manaspent DESC, players.name ASC LIMIT ' . $limit_ . ' OFFSET ' . $offset)->fetchAll(); - } else { // level - $skills = $db->query('SELECT accounts.country, players.id,players.name' . $online . ',level,experience,vocation' . $promotion . $outfit . ' FROM accounts, players WHERE players.id NOT IN (' . implode(', ', $config['highscores_ids_hidden']) . ') AND players.' . $deleted . ' = 0 ' . $add_sql . ' AND players.group_id < ' . $config['highscores_groups_hidden'] . ' AND accounts.id = players.account_id ORDER BY level DESC, experience DESC, players.name ASC LIMIT ' . $limit_ . ' OFFSET ' . $offset)->fetchAll(); - $list = 'experience'; - } + if ($skill == POT::SKILL_MAGLEVEL) { + $skills = $db->query('SELECT accounts.country, players.id,players.name' . $online . ',maglevel,level,vocation' . $promotion . $outfit . ' FROM accounts, players WHERE players.id NOT IN (' . implode(', ', $config['highscores_ids_hidden']) . ') AND players.' . $deleted . ' = 0 ' . $add_sql . ' AND players.group_id < ' . $config['highscores_groups_hidden'] . ' AND accounts.id = players.account_id ORDER BY maglevel DESC, manaspent DESC, players.name ASC LIMIT ' . $limit_ . ' OFFSET ' . $offset)->fetchAll(); + } else { // level + $skills = $db->query('SELECT accounts.country, players.id,players.name' . $online . ',level,experience,vocation' . $promotion . $outfit . ' FROM accounts, players WHERE players.id NOT IN (' . implode(', ', $config['highscores_ids_hidden']) . ') AND players.' . $deleted . ' = 0 ' . $add_sql . ' AND players.group_id < ' . $config['highscores_groups_hidden'] . ' AND accounts.id = players.account_id ORDER BY level DESC, experience DESC, players.name ASC LIMIT ' . $limit_ . ' OFFSET ' . $offset)->fetchAll(); + $list = 'experience'; + } } ?>
      -
      -
      - - - -
      Highscores Filter
      - - - - -
      +
      +
      + + + +
      Highscores Filter
      + + + +
      -
  • #IDID Name Server Type IP Port
    - - - - - -
    -
    - - - - - - - - - - - - - - - - - - -
    World:
    Vocation: - - -
    -
    -
    -
    -
    -
    Category: - -
    -
    -
    +
    + + + + + + +
    +
    + + + + + + + + + + + + + + + + + + +
    World:
    Vocation: + + +
    +
    +
    +
    +
    +
    Category: + +
    +
    +
    @@ -285,167 +285,169 @@
    -
    -
    +
    +
    - - - -
    Highscores
    - - - - -
    + + + +
    Highscores
    + + + +
    - - - - + + +
    -
    - - - - - - -
    -
    - - - - - - - - - - - - - - - hasColumn('players', 'online')) - $online_exist = true; - - $players = array(); - foreach ($skills as $player) { - $players[] = $player['id']; - } - - if ($db->hasTable('players_online') && count($players) > 0) { - $query = $db->query('SELECT `player_id`, 1 FROM `players_online` WHERE `player_id` IN (' . implode(', ', $players) . ')')->fetchAll(); - foreach ($query as $t) { - $is_online[$t['player_id']] = true; - } - } - - foreach ($skills as $player) { - if (isset($is_online)) { - $player['online'] = (isset($is_online[$player['id']]) ? 1 : 0); - } else { - if (!isset($player['online'])) { - $player['online'] = 0; - } - } - - if (++$i <= $limit) { - if ($skill == POT::SKILL_MAGLEVEL) - $player['value'] = $player['maglevel']; - else if ($skill == POT::SKILL_LEVEL) - $player['value'] = $player['level']; - echo ' + +
    RankOutfitNameVocation - - Points
    + + + '; + + echo ''; + } else + $show_link_to_next_page = true; + } + + if (!$i) { + $extra = ($config['highscores_outfit'] ? 1 : 0); + ?> + + + + 0) { + ?> + + + + + + + + + +
    +
    + + + + - - -
    +
    + + + + + + + + + + + + + + + hasColumn('players', 'online')) + $online_exist = true; + + $players = array(); + foreach ($skills as $player) { + $players[] = $player['id']; + } + + if ($db->hasTable('players_online') && count($players) > 0) { + $query = $db->query('SELECT `player_id`, 1 FROM `players_online` WHERE `player_id` IN (' . implode(', ', $players) . ')')->fetchAll(); + foreach ($query as $t) { + $is_online[$t['player_id']] = true; + } + } + + foreach ($skills as $player) { + if (isset($is_online)) { + $player['online'] = (isset($is_online[$player['id']]) ? 1 : 0); + } else { + if (!isset($player['online'])) { + $player['online'] = 0; + } + } + + if (++$i <= $limit) { + if ($skill == POT::SKILL_MAGLEVEL) + $player['value'] = $player['maglevel']; + else if ($skill == POT::SKILL_LEVEL) + $player['value'] = $player['level']; + echo ' '; - if ($config['highscores_outfit']) - echo ''; + if ($config['highscores_outfit']) + echo ''; - echo ' + echo ' '; - if ($skill == POT::SKILL_LEVEL) - echo ''; - - echo ''; - } else - $show_link_to_next_page = true; - } - - if (!$i) { - $extra = ($config['highscores_outfit'] ? 1 : 0); - ?> - - - - 0) { - ?> - - - - - - - - - -
    RankOutfitNameVocation + + Points
    ' . ($offset + $i) . '. ' . $player['name'] . ' '; - if ($config['highscores_vocation']) { - if (isset($player['promotion'])) { - if ((int)$player['promotion'] > 0) - $player['vocation'] += ($player['promotion'] * $config['vocations_amount']); - } - - $tmp = 'Unknown'; - if (isset($config['vocations'][$player['vocation']])) { - $tmp = $config['vocations'][$player['vocation']]; - } - - } - echo ' + if ($config['highscores_vocation']) { + if (isset($player['promotion'])) { + if ((int)$player['promotion'] > 0) + $player['vocation'] += ($player['promotion'] * $config['vocations_amount']); + } + + $tmp = 'Unknown'; + if (isset($config['vocations'][$player['vocation']])) { + $tmp = $config['vocations'][$player['vocation']]; + } + + } + echo ' ' . $tmp . '
    ' . $player['value'] . '
    ' . number_format($player['experience']) . '
    - No records yet. -
    - Previous Page -
    - Next Page -
    -
    -
    + if ($skill == POT::SKILL_LEVEL) + echo '
    ' . number_format($player['experience']) . '
    + No records yet. +
    + Previous Page +
    + Next Page +
    -
    +
    +
    + + + +
    From 7c51599c81ea847e9453ab8fb1d781b64b8f435d Mon Sep 17 00:00:00 2001 From: Elson Costa Date: Fri, 23 Aug 2024 15:30:17 -0300 Subject: [PATCH 08/42] highscores: enabled world filter. --- index.php | 8 ++- system/pages/highscores.php | 120 +++++++++++++++++++++--------------- 2 files changed, 74 insertions(+), 54 deletions(-) diff --git a/index.php b/index.php index b174fd7a1..0984a9013 100644 --- a/index.php +++ b/index.php @@ -120,10 +120,12 @@ '/^gallery\/[0-9]+\/?$/' => array('subtopic' => 'gallery', 'image' => '$1'), '/^gifts\/history\/?$/' => array('subtopic' => 'gifts', 'action' => 'show_history'), '/^guilds\/[A-Za-z0-9-_%+\']+$/' => array('subtopic' => 'guilds', 'action' => 'show', 'guild' => '$1'), - '/^highscores\/[A-Za-z0-9-_]+\/[A-Za-z0-9-_]+\/[0-9]+\/?$/' => array('subtopic' => 'highscores', 'list' => '$1', 'vocation' => '$2', 'page' => '$3'), - '/^highscores\/[A-Za-z0-9-_]+\/[0-9]+\/?$/' => array('subtopic' => 'highscores', 'list' => '$1', 'page' => '$2'), + '/^highscores\/[A-Za-z0-9-_]+\/[0-9]+\/[A-Za-z0-9-_]+\/[0-9]+\/?$/' => array('subtopic' => 'highscores', 'list' => '$1', 'world' => '$2', 'vocation' => '$3', 'page' => '$4'), + '/^highscores\/[A-Za-z0-9-_]+\/[0-9]+\/[0-9]+\/?$/' => array('subtopic' => 'highscores', 'list' => '$1', 'world' => '$2', 'page' => '$3'), + '/^highscores\/[A-Za-z0-9-_]+\/[0-9]+\/[A-Za-z0-9-_]+\/?$/' => array('subtopic' => 'highscores', 'list' => '$1', 'world' => '$2', 'vocation' => '$3'), '/^highscores\/[A-Za-z0-9-_]+\/[A-Za-z0-9-_]+\/?$/' => array('subtopic' => 'highscores', 'list' => '$1', 'vocation' => '$2'), - '/^highscores\/[A-Za-z0-9-_\']+\/?$/' => array('subtopic' => 'highscores', 'list' => '$1'), + '/^highscores\/[A-Za-z0-9-_]+\/[0-9]+\/?$/' => array('subtopic' => 'highscores', 'list' => '$1', 'world' => '$2'), + '/^highscores\/[A-Za-z0-9-_]+\/?$/' => array('subtopic' => 'highscores', 'list' => '$1'), '/^news\/add\/?$/' => array('subtopic' => 'news', 'action' => 'add'), '/^news\/edit\/?$/' => array('subtopic' => 'news', 'action' => 'edit'), '/^news\/archive\/?$/' => array('subtopic' => 'newsarchive'), diff --git a/system/pages/highscores.php b/system/pages/highscores.php index d4d635a28..0acc5af33 100644 --- a/system/pages/highscores.php +++ b/system/pages/highscores.php @@ -16,8 +16,9 @@ require SYSTEM . 'countries.conf.php'; $list = $_GET['list'] ?? ''; +$world = $_GET['world'] ?? 0; +$vocation = $_GET['vocation'] ?? ""; $_page = $_GET['page'] ?? 0; -$vocation = $_GET['vocation'] ?? null; if (!is_numeric($_page) || $_page < 0 || $_page > PHP_INT_MAX) { $_page = 0; @@ -25,27 +26,40 @@ $add_sql = ''; $config_vocations = $config['vocations']; +$worlds = $db->query("SELECT `id`, `name` FROM `worlds` ORDER BY `name` ASC;")->fetchAll(); $normalized_vocations = array_map('strtolower', $config_vocations); -if (!array_search(@strtolower($vocation), $normalized_vocations)) $vocation = "None"; +if (strtolower($vocation) != 'none' && !array_search(strtolower($vocation), $normalized_vocations)) $vocation = ""; if ($config['highscores_vocation_box'] && isset($vocation)) { - foreach ($config['vocations'] as $id => $name) { - if (strtolower($name) == $vocation) { - $add_vocs = array($id); - - $i = $id + $config['vocations_amount']; - while (isset($config['vocations'][$i])) { - $add_vocs[] = $i; - $i += $config['vocations_amount']; + if (strtolower($vocation) == 'none') { + $add_sql = ' AND `vocation` = 0 '; + } else { + foreach ($config_vocations as $id => $name) { + if (strtolower($name) == $vocation) { + $add_vocs = array($id); + + $i = $id + $config['vocations_amount']; + while (isset($config_vocations[$i])) { + $add_vocs[] = $i; + $i += $config['vocations_amount']; + } + + $add_sql = 'AND `vocation` IN (' . implode(', ', $add_vocs) . ')'; + break; } - - $add_sql = 'AND `vocation` IN (' . implode(', ', $add_vocs) . ')'; - break; } } } +if ($world > 0) { + if (!$w = $db->query("SELECT `id` FROM `worlds` WHERE `id` = {$world}")->fetch()['id'] ?? null) { + header('Location: ' . "?highscores"); + return; + } + $add_sql .= " AND `worldId` = {$world} "; +} + define('SKILL_FRAGS', -1); define('SKILL_BALANCE', -2); @@ -164,11 +178,30 @@ $list = 'experience'; } } + +$rank_category = $_POST['category'] ?? null; +$rank_world = $_POST['world'] ?? null; +$rank_vocation = $_POST['profession'] ?? null; + +if ($rank_category) { + $url = "?highscores/$rank_category"; + + if ($rank_world) { + $url .= "/$rank_world"; + } + + if ($rank_vocation) { + $url .= "/$rank_vocation"; + } + + header('Location: ' . $url); +} ?>
    -
    +
    + World: - + + + Vocation: + value="" required />
    @@ -109,13 +131,13 @@ function echo_error($message) + value="" required />
    - + value="" required />
    From 005bcc5895a87db295421c955ebf3f527d344d3f Mon Sep 17 00:00:00 2001 From: Elson Costa Date: Tue, 27 Aug 2024 16:07:48 -0300 Subject: [PATCH 10/42] team: reindent. --- system/pages/team.php | 75 +-- system/templates/team.html.twig | 1124 +++++++++++++++++-------------- 2 files changed, 655 insertions(+), 544 deletions(-) diff --git a/system/pages/team.php b/system/pages/team.php index 3441ab1f3..6cd1c579c 100644 --- a/system/pages/team.php +++ b/system/pages/team.php @@ -13,63 +13,62 @@ $title = 'Support in Game'; if ($config['account_country']) - require SYSTEM . 'countries.conf.php'; + require SYSTEM . 'countries.conf.php'; $groups = new OTS_Groups_List(); if (!$groups->count()) { - echo 'Error while reading groups.xml'; - return; + echo 'Error while reading groups.xml'; + return; } $outfit_addons = false; $outfit = ''; if ($config['team_display_outfit']) { - $outfit = ', lookbody, lookfeet, lookhead, looklegs, looktype'; - if ($db->hasColumn('players', 'lookaddons')) { - $outfit .= ', lookaddons'; - $outfit_addons = true; - } + $outfit = ', lookbody, lookfeet, lookhead, looklegs, looktype'; + if ($db->hasColumn('players', 'lookaddons')) { + $outfit .= ', lookaddons'; + $outfit_addons = true; + } } $groupMember = array(); $groupList = $groups->getGroups(); foreach ($groupList as $id => $group) { - if ($id <= 1) - continue; + if ($id <= 1) + continue; - $group_members = $group->getPlayersList(); - if (!count($group_members)) - continue; + $group_members = $group->getPlayersList(); + if (!count($group_members)) + continue; - $members = array(); - foreach ($group_members as $member) { - /** @var OTS_Player $member */ - if (!admin() && $member->isHidden()) - continue; + $members = array(); + foreach ($group_members as $member) { + /** @var OTS_Player $member */ + if (!admin() && $member->isHidden()) + continue; - $lastLogin = 'Never.'; - if ($member->getLastLogin() > 0) - $lastLogin = date("j F Y, g:i a", $member->getLastLogin()); + $lastLogin = 'Never.'; + if ($member->getLastLogin() > 0) + $lastLogin = date("j F Y, g:i a", $member->getLastLogin()); - $members[] = array( - 'group_name' => $group->getName(), - 'player' => $member, - 'outfit' => $config['team_display_outfit'] ? $config['outfit_images_url'] . '?id=' . $member->getLookType() . ($outfit_addons ? '&addons=' . $member->getLookAddons() : '') . '&head=' . $member->getLookHead() . '&body=' . $member->getLookBody() . '&legs=' . $member->getLookLegs() . '&feet=' . $member->getLookFeet() : null, - 'status' => $config['team_display_status'] ? $member->isOnline() : null, - 'link' => getPlayerLink($member->getName()), - 'flag_image' => $config['account_country'] ? getFlagImage($member->getAccount()->getCountry()) : null, - 'world_name' => ($config['multiworld'] || $config['team_display_world']) ? getWorldName($member->getWorldId()) : null, - 'last_login' => $config['team_display_lastlogin'] ? $lastLogin : null - ); - } - - $groupMember[] = array( - 'group_name' => $group->getName(), - 'members' => $members + $members[] = array( + 'group_name' => $group->getName(), + 'player' => $member, + 'outfit' => $config['team_display_outfit'] ? $config['outfit_images_url'] . '?id=' . $member->getLookType() . ($outfit_addons ? '&addons=' . $member->getLookAddons() : '') . '&head=' . $member->getLookHead() . '&body=' . $member->getLookBody() . '&legs=' . $member->getLookLegs() . '&feet=' . $member->getLookFeet() : null, + 'status' => $config['team_display_status'] ? $member->isOnline() : null, + 'link' => getPlayerLink($member->getName()), + 'flag_image' => $config['account_country'] ? getFlagImage($member->getAccount()->getCountry()) : null, + 'world_name' => getWorldName($member->getWorldId()), + 'last_login' => $config['team_display_lastlogin'] ? $lastLogin : null ); + } + + $groupMember[] = array( + 'group_name' => $group->getName(), + 'members' => $members + ); } $twig->display('team.html.twig', array( - 'groupmember' => $groupMember + 'groupmember' => $groupMember )); -?> diff --git a/system/templates/team.html.twig b/system/templates/team.html.twig index 2f4f3272e..baf260de2 100644 --- a/system/templates/team.html.twig +++ b/system/templates/team.html.twig @@ -1,560 +1,672 @@
    - - - - - - - - -
    Staff Team
    + + + + + + + + +
    Staff + Team +

    {% set godMembersExist = false %} {% for group in groupmember|reverse %} - {% if not godMembersExist %} - {% if group.members is not empty and group.group_name == 'god' %} - {% set godMembersExist = true %} - {% endif %} + {% if not godMembersExist %} + {% if group.members is not empty and group.group_name == 'god' %} + {% set godMembersExist = true %} {% endif %} + {% endif %} {% endfor %} {% if godMembersExist %} -
    -
    -
    - - - - - - -
    Administrator
    - - - - -
    -
    - - - - - + + +
    -
    - - - - + + + + {% endfor %} + {% endif %} + {% endfor %} + +
    -
    -
    - - - - {% if config.team_display_outfit %}{% endif %} - - - - - - - - {% for group in groupmember|reverse %} - {% if group.members is not empty and group.group_name == 'god' %} - {% for member in group.members|reverse %} - {% set i = i + 1 %} - - {% if config.team_display_outfit %} - - {% endif %} +
    +
    +
    + + + + + + +
    +
    Administrator
    +
    + + + + +
    +
    + +
    #GroupNameStatusLast LoginWorldCountry
    player outfit
    + + + - - -
    +
    + + + + - - -
    +
    +
    + + + + {% if config.team_display_outfit %} + {% endif %} + + + + + + + + {% for group in groupmember|reverse %} + {% if group.members is not empty and group.group_name == 'god' %} + {% for member in group.members|reverse %} + {% set i = i + 1 %} + + {% if config.team_display_outfit %} + + {% endif %} - - - + + + - - - - - {% endfor %} - {% endif %} - {% endfor %} - -
    #GroupNameStatusLast LoginWorldCountry
    player outfitAdministrator{{ member.link|raw }} - {% if member.status %} - Online - {% else %} - Offline - {% endif %} - Administrator{{ member.link|raw }} + {% if member.status %} + Online + {% else %} + Offline + {% endif %} + - {% if member.last_login %} - {{ member.last_login }} -
    - {% else %} - Not connected yet - {% endif %} -
    - {% if member.world_name %} - {{ member.world_name }} - {% else %} - {{ config['lua']['serverName'] }} - {% endif %} - - {% if member.flag_image %} - {{ member.flag_image|raw }} - {% else %} - No Flag - {% endif %} -
    -
    -
    -
    -
    -
    -

    +
    + {% if member.last_login %} + {{ member.last_login }} +
    + {% else %} + Not connected yet + {% endif %} +
    + {% if member.world_name %} + {{ member.world_name }} + {% else %} + {{ config['lua']['serverName'] }} + {% endif %} + + {% if member.flag_image %} + {{ member.flag_image|raw }} + {% else %} + No Flag + {% endif %} +
    +
    + +
    +
    + + + + +
    +

    {% endif %} {% set cmMembersExist = false %} {% for group in groupmember|reverse %} - {% if not cmMembersExist %} - {% if group.members is not empty and group.group_name == 'community manager' %} - {% set cmMembersExist = true %} - {% endif %} + {% if not cmMembersExist %} + {% if group.members is not empty and group.group_name == 'community manager' %} + {% set cmMembersExist = true %} {% endif %} + {% endif %} {% endfor %} {% if cmMembersExist %} -
    -
    -
    - - - - - - -
    Community Manager
    - - - - -
    -
    - - - - + + +
    -
    - - - - + + + + {% endfor %} + {% endif %} + {% endfor %} + +
    -
    -
    - - - - {% if config.team_display_outfit %}{% endif %} - - - - - - - - {% for group in groupmember|reverse %} - {% if group.members is not empty and group.group_name == 'community manager' %} - {% for member in group.members|reverse %} - {% set i = i + 1 %} - - {% if config.team_display_outfit %} - - {% endif %} +
    +
    +
    + + + + + + +
    +
    Community Manager
    +
    + + + + +
    +
    +
    #GroupNameStatusLast LoginWorldCountry
    player outfit
    + + + - - -
    +
    + + + + - - -
    +
    +
    + + + + {% if config.team_display_outfit %} + {% endif %} + + + + + + + + {% for group in groupmember|reverse %} + {% if group.members is not empty and group.group_name == 'community manager' %} + {% for member in group.members|reverse %} + {% set i = i + 1 %} + + {% if config.team_display_outfit %} + + {% endif %} - - - + + + - - - - - {% endfor %} - {% endif %} - {% endfor %} - -
    #GroupNameStatusLast LoginWorldCountry
    player outfitCommunity Manager{{ member.link|raw }} - {% if member.status %} - Online - {% else %} - Offline - {% endif %} - Community Manager{{ member.link|raw }} + {% if member.status %} + Online + {% else %} + Offline + {% endif %} + - {% if member.last_login %} - {{ member.last_login }} -
    - {% else %} - Not connected yet - {% endif %} -
    - {% if member.world_name %} - {{ member.world_name }} - {% else %} - {{ config['lua']['serverName'] }} - {% endif %} - - {% if member.flag_image %} - {{ member.flag_image|raw }} - {% else %} - No Flag - {% endif %} -
    -
    -
    -
    -
    -
    -

    +
    + {% if member.last_login %} + {{ member.last_login }} +
    + {% else %} + Not connected yet + {% endif %} +
    + {% if member.world_name %} + {{ member.world_name }} + {% else %} + {{ config['lua']['serverName'] }} + {% endif %} + + {% if member.flag_image %} + {{ member.flag_image|raw }} + {% else %} + No Flag + {% endif %} +
    +
    + +
    +
    + + + + +
    +

    {% endif %} {% set gmMembersExist = false %} {% for group in groupmember|reverse %} - {% if not gmMembersExist %} - {% if group.members is not empty and group.group_name == 'gamemaster' %} - {% set gmMembersExist = true %} - {% endif %} + {% if not gmMembersExist %} + {% if group.members is not empty and group.group_name == 'gamemaster' %} + {% set gmMembersExist = true %} {% endif %} + {% endif %} {% endfor %} {% if gmMembersExist %} -
    -
    -
    - - - - - - -
    GameMaster
    - - - - -
    -
    - - - - + + +
    -
    - - - - + + + + {% endfor %} + {% endif %} + {% endfor %} + +
    -
    -
    - - - - {% if config.team_display_outfit %}{% endif %} - - - - - - - - {% for group in groupmember|reverse %} - {% if group.members is not empty and group.group_name == 'gamemaster' %} - {% for member in group.members|reverse %} - {% set i = i + 1 %} - - {% if config.team_display_outfit %} - - {% endif %} +
    +
    +
    + + + + + + +
    +
    GameMaster
    +
    + + + + +
    +
    +
    #GroupNameStatusLast LoginWorldCountry
    player outfit
    + + + - - -
    +
    + + + + - - -
    +
    +
    + + + + {% if config.team_display_outfit %} + {% endif %} + + + + + + + + {% for group in groupmember|reverse %} + {% if group.members is not empty and group.group_name == 'gamemaster' %} + {% for member in group.members|reverse %} + {% set i = i + 1 %} + + {% if config.team_display_outfit %} + + {% endif %} - - - + + + - - - - - {% endfor %} - {% endif %} - {% endfor %} - -
    #GroupNameStatusLast LoginWorldCountry
    player outfitGameMaster{{ member.link|raw }} - {% if member.status %} - Online - {% else %} - Offline - {% endif %} - GameMaster{{ member.link|raw }} + {% if member.status %} + Online + {% else %} + Offline + {% endif %} + - {% if member.last_login %} - {{ member.last_login }} -
    - {% else %} - Not connected yet - {% endif %} -
    - {% if member.world_name %} - {{ member.world_name }} - {% else %} - {{ config['lua']['serverName'] }} - {% endif %} - - {% if member.flag_image %} - {{ member.flag_image|raw }} - {% else %} - No Flag - {% endif %} -
    -
    -
    -
    -
    -
    -

    +
    + {% if member.last_login %} + {{ member.last_login }} +
    + {% else %} + Not connected yet + {% endif %} +
    + {% if member.world_name %} + {{ member.world_name }} + {% else %} + {{ config['lua']['serverName'] }} + {% endif %} + + {% if member.flag_image %} + {{ member.flag_image|raw }} + {% else %} + No Flag + {% endif %} +
    +
    + +
    +
    + + + + +
    +

    {% endif %} {% set seniorMembersExist = false %} {% for group in groupmember|reverse %} - {% if not seniorMembersExist %} - {% if group.members is not empty and group.group_name == 'senior tutor' %} - {% set seniorMembersExist = true %} - {% endif %} + {% if not seniorMembersExist %} + {% if group.members is not empty and group.group_name == 'senior tutor' %} + {% set seniorMembersExist = true %} {% endif %} + {% endif %} {% endfor %} {% if seniorMembersExist %} -
    -
    -
    - - - - - - -
    Senior Tutor
    - - - - -
    -
    - - - - + + +
    -
    - - - - + + + + {% endfor %} + {% endif %} + {% endfor %} + +
    -
    -
    - - - - {% if config.team_display_outfit %}{% endif %} - - - - - - - - {% for group in groupmember|reverse %} - {% if group.members is not empty and group.group_name == 'senior tutor' %} - {% for member in group.members|reverse %} - {% set i = i + 1 %} - - {% if config.team_display_outfit %} - - {% endif %} +
    +
    +
    + + + + + + +
    +
    Senior Tutor
    +
    + + + + +
    +
    +
    #GroupNameStatusLast LoginWorldCountry
    player outfit
    + + + - - -
    +
    + + + + - - -
    +
    +
    + + + + {% if config.team_display_outfit %} + {% endif %} + + + + + + + + {% for group in groupmember|reverse %} + {% if group.members is not empty and group.group_name == 'senior tutor' %} + {% for member in group.members|reverse %} + {% set i = i + 1 %} + + {% if config.team_display_outfit %} + + {% endif %} - - - + + + - - - - - {% endfor %} - {% endif %} - {% endfor %} - -
    #GroupNameStatusLast LoginWorldCountry
    player outfitSenior Tutor{{ member.link|raw }} - {% if member.status %} - Online - {% else %} - Offline - {% endif %} - Senior Tutor{{ member.link|raw }} + {% if member.status %} + Online + {% else %} + Offline + {% endif %} + - {% if member.last_login %} - {{ member.last_login }} -
    - {% else %} - Not connected yet - {% endif %} -
    - {% if member.world_name %} - {{ member.world_name }} - {% else %} - {{ config['lua']['serverName'] }} - {% endif %} - - {% if member.flag_image %} - {{ member.flag_image|raw }} - {% else %} - No Flag - {% endif %} -
    -
    -
    -
    -
    -
    -

    +
    + {% if member.last_login %} + {{ member.last_login }} +
    + {% else %} + Not connected yet + {% endif %} +
    + {% if member.world_name %} + {{ member.world_name }} + {% else %} + {{ config['lua']['serverName'] }} + {% endif %} + + {% if member.flag_image %} + {{ member.flag_image|raw }} + {% else %} + No Flag + {% endif %} +
    +
    + +
    +
    + + + + +
    +

    {% endif %} {% set tutorMembersExist = false %} {% for group in groupmember|reverse %} - {% if not tutorMembersExist %} - {% if group.members is not empty and group.group_name == 'tutor' %} - {% set tutorMembersExist = true %} - {% endif %} + {% if not tutorMembersExist %} + {% if group.members is not empty and group.group_name == 'tutor' %} + {% set tutorMembersExist = true %} {% endif %} + {% endif %} {% endfor %} {% if tutorMembersExist %} -
    -
    -
    - - - - - - -
    Tutor
    - - - - -
    -
    - - - - + + +
    -
    - - - - + + + + {% endfor %} + {% endif %} + {% endfor %} + +
    -
    -
    - - - - {% if config.team_display_outfit %}{% endif %} - - - - - - - - {% for group in groupmember|reverse %} - {% if group.members is not empty and group.group_name == 'tutor' %} - {% for member in group.members|reverse %} - {% set i = i + 1 %} - - {% if config.team_display_outfit %} - - {% endif %} +
    +
    +
    + + + + + + +
    +
    Tutor
    +
    + + + + +
    +
    +
    #GroupNameStatusLast LoginWorldCountry
    player outfit
    + + + - - -
    +
    + + + + - - -
    +
    +
    + + + + {% if config.team_display_outfit %} + {% endif %} + + + + + + + + {% for group in groupmember|reverse %} + {% if group.members is not empty and group.group_name == 'tutor' %} + {% for member in group.members|reverse %} + {% set i = i + 1 %} + + {% if config.team_display_outfit %} + + {% endif %} - - - + + + - - - - - {% endfor %} - {% endif %} - {% endfor %} - -
    #GroupNameStatusLast LoginWorldCountry
    player outfitTutor{{ member.link|raw }} - {% if member.status %} - Online - {% else %} - Offline - {% endif %} - Tutor{{ member.link|raw }} + {% if member.status %} + Online + {% else %} + Offline + {% endif %} + - {% if member.last_login %} - {{ member.last_login }} -
    - {% else %} - Not connected yet - {% endif %} -
    - {% if member.world_name %} - {{ member.world_name }} - {% else %} - {{ config['lua']['serverName'] }} - {% endif %} - - {% if member.flag_image %} - {{ member.flag_image|raw }} - {% else %} - No Flag - {% endif %} -
    -
    -
    -
    -
    -
    -

    -{% endif %} \ No newline at end of file +
    + {% if member.last_login %} + {{ member.last_login }} +
    + {% else %} + Not connected yet + {% endif %} +
    + {% if member.world_name %} + {{ member.world_name }} + {% else %} + {{ config['lua']['serverName'] }} + {% endif %} + + {% if member.flag_image %} + {{ member.flag_image|raw }} + {% else %} + No Flag + {% endif %} +
    +
    + +
    +
    + + + + +
    +

    +{% endif %} From 6e4cbe2e51df4e7767f264218528fed4518589fa Mon Sep 17 00:00:00 2001 From: Elson Costa Date: Tue, 27 Aug 2024 16:29:46 -0300 Subject: [PATCH 11/42] team: fixes. --- system/templates/team.html.twig | 55 ++++++++++++++++++++------------- 1 file changed, 34 insertions(+), 21 deletions(-) diff --git a/system/templates/team.html.twig b/system/templates/team.html.twig index baf260de2..a760381fa 100644 --- a/system/templates/team.html.twig +++ b/system/templates/team.html.twig @@ -1,10 +1,21 @@ +
    - @@ -68,7 +79,7 @@ {% if config.team_display_outfit %} - {% endif %} + {% endif %} @@ -83,23 +94,24 @@ {% if config.team_display_outfit %} {% endif %} + style="font-family: Verdana; text-shadow: 0 1px 1px rgba(0, 0, 0, 0.3);" + color="red">Administrator + {% if config.team_display_outfit %} - {% endif %} + + {% endif %} @@ -215,7 +228,7 @@ {% if config.team_display_outfit %} {% endif %} @@ -331,7 +344,7 @@ {% if config.team_display_outfit %} - {% endif %} + {% endif %} @@ -346,7 +359,7 @@ {% if config.team_display_outfit %} {% endif %} @@ -462,7 +475,7 @@ {% if config.team_display_outfit %} - {% endif %} + {% endif %} @@ -477,7 +490,7 @@ {% if config.team_display_outfit %} {% endif %} @@ -593,7 +606,7 @@ {% if config.team_display_outfit %} - {% endif %} + {% endif %} @@ -608,7 +621,7 @@ {% if config.team_display_outfit %} {% endif %} From 814a31c0f9297e3e3da90d40ffeee434b7453284 Mon Sep 17 00:00:00 2001 From: Elson Costa Date: Tue, 27 Aug 2024 16:30:20 -0300 Subject: [PATCH 12/42] function: fix on getWorldName(). --- system/functions.php | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/system/functions.php b/system/functions.php index 48058c245..2690b9ee7 100644 --- a/system/functions.php +++ b/system/functions.php @@ -1004,14 +1004,22 @@ function get_plugins() return $ret; } +/** + * Returning world name by ID + * + * @param $id + * @return mixed|null + */ function getWorldName($id) { - global $config; - if (isset($config['worlds'][$id])) { - return $config['worlds'][$id]; + global $db; + if ($db->hasTable('worlds')) { + $world = $db->query("SELECT `name` FROM `worlds` WHERE `id` = {$id}")->fetch(); + if ($world) { + return $world['name']; + } } - - return $config['lua']['serverName']; + return configLua('serverName'); } /** From e792783462f7aed384e56bce0461410561d1dee8 Mon Sep 17 00:00:00 2001 From: Elson Costa Date: Tue, 27 Aug 2024 16:31:36 -0300 Subject: [PATCH 13/42] world_id: fixed column name. --- login.php | 4 ++-- system/pages/highscores.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/login.php b/login.php index 7c6705507..0f250fc21 100644 --- a/login.php +++ b/login.php @@ -159,7 +159,7 @@ function jsonCompendium() // common columns $accId = $account->getId(); - $columns = 'name, level, sex, vocation, looktype, lookhead, lookbody, looklegs, lookfeet, lookaddons, lastlogin, isreward, istutorial, ismain, hidden, worldId'; + $columns = 'name, level, sex, vocation, looktype, lookhead, lookbody, looklegs, lookfeet, lookaddons, lastlogin, isreward, istutorial, ismain, hidden, world_id'; $queryP = $db->query("SELECT {$columns} FROM players WHERE account_id = {$accId} AND deletion = 0"); $characters = []; if ($queryP && $queryP->rowCount() > 0) { @@ -207,7 +207,7 @@ function jsonCompendium() function createChar($config, $player) { return [ - 'worldid' => $player['worldId'], + 'worldid' => $player['world_id'], 'name' => $player['name'], 'ismale' => intval($player['sex']) === 1, 'tutorial' => (bool)$player['istutorial'], diff --git a/system/pages/highscores.php b/system/pages/highscores.php index 0acc5af33..0bf4edd2b 100644 --- a/system/pages/highscores.php +++ b/system/pages/highscores.php @@ -57,7 +57,7 @@ header('Location: ' . "?highscores"); return; } - $add_sql .= " AND `worldId` = {$world} "; + $add_sql .= " AND `world_id` = {$world} "; } define('SKILL_FRAGS', -1); From 14d33d775ce75bff6835b63db4a81fc953a3d01b Mon Sep 17 00:00:00 2001 From: Elson Costa Date: Tue, 27 Aug 2024 17:28:30 -0300 Subject: [PATCH 14/42] lastkills: enabled world filter. removed multiworld flag config. --- config.php | 8 -- system/functions.php | 3 +- system/pages/lastkills.php | 131 +++++------------- system/templates/lastkills.html.twig | 199 ++++++++++++++++++--------- 4 files changed, 173 insertions(+), 168 deletions(-) diff --git a/config.php b/config.php index 0b2196a59..6d3b5fa2b 100644 --- a/config.php +++ b/config.php @@ -79,13 +79,6 @@ 'database_socket' => '', // set if you want to connect to database through socket (example: /var/run/mysqld/mysqld.sock) 'database_persistent' => false, // use database permanent connection (like server), may speed up your site - // multiworld system (only TFS 0.3) - 'multiworld' => false, // use multiworld system? - 'worlds' => array( // list of worlds - //'1' => 'Your World Name', - //'2' => 'Your Second World Name' - ), - // images 'outfit_images_url' => './outfit/animoutfit.php', // set to animoutfit.php for animated outfit 'item_images_url' => 'images/items/', // set to images/items if you host your own items in images folder @@ -240,7 +233,6 @@ 'team_style' => 2, // 1/2 (1 - normal table, 2 - in boxes, grouped by group id) 'team_display_status' => true, 'team_display_lastlogin' => true, - 'team_display_world' => false, 'team_display_outfit' => true, // bans page diff --git a/system/functions.php b/system/functions.php index 2690b9ee7..5e8bf112a 100644 --- a/system/functions.php +++ b/system/functions.php @@ -1014,8 +1014,7 @@ function getWorldName($id) { global $db; if ($db->hasTable('worlds')) { - $world = $db->query("SELECT `name` FROM `worlds` WHERE `id` = {$id}")->fetch(); - if ($world) { + if ($world = $db->query("SELECT `name` FROM `worlds` WHERE `id` = {$id}")->fetch()) { return $world['name']; } } diff --git a/system/pages/lastkills.php b/system/pages/lastkills.php index 8d7ff66ec..c4d540b29 100644 --- a/system/pages/lastkills.php +++ b/system/pages/lastkills.php @@ -1,4 +1,5 @@ enabled() && $cache->fetch('last_kills', $tmp)) { - $last_kills = unserialize($tmp); +if ($w = $_POST['world'] ?? null) { + header("Location: ?p=lastkills&world=$w"); } -else { - if($db->hasTable('player_killers')) // tfs 0.3 - { - $players_deaths = $db->query('SELECT `player_deaths`.`id`, `player_deaths`.`date`, `player_deaths`.`level`, `players`.`name`' . ($db->hasColumn('players', 'world_id') ? ', `players`.`world_id`' : '') . ' FROM `player_deaths` LEFT JOIN `players` ON `player_deaths`.`player_id` = `players`.`id` ORDER BY `date` DESC LIMIT 0, ' . $config['last_kills_limit']); - - if(!empty($players_deaths)) { - foreach($players_deaths as $death) { - $players_deaths_count++; - $killers_string = getPlayerLink($death['name']) . ' '; - $killer_name = ''; - - $killers = $db->query("SELECT environment_killers.name AS monster_name, players.name AS player_name, players.deleted AS player_exists FROM killers LEFT JOIN environment_killers ON killers.id = environment_killers.kill_id LEFT JOIN player_killers ON killers.id = player_killers.kill_id LEFT JOIN players ON players.id = player_killers.player_id WHERE killers.death_id = '" . $death['id'] . "' ORDER BY killers.final_hit DESC, killers.id ASC")->fetchAll(); - - $i = 0; - $count = count($killers); - foreach($killers as $killer) { - $i++; - if($killer['player_name'] != "") { - if($i == 1) { - if($count <= 4) - $killers_string .= 'killed'; - else if($count > 4 and $count < 10) - $killers_string .= 'slain'; - else if($count > 9 and $count < 15) - $killers_string .= 'crushed'; - else if($count > 14 and $count < 20) - $killers_string .= 'eliminated'; - else if($count > 19) - $killers_string .= 'annihilated'; - $killers_string .= ' at level ' . $death['level'] . ' '; - } else if($i == $count) - $killers_string .= ' and'; - else - $killers_string .= ','; - - $killers_string .= ' by '; - if($killer['monster_name'] != '') - $killers_string .= $killer['monster_name'] . ' summoned by '; - - if($killer['player_exists'] == 0) - $killers_string .= getPlayerLink($killer['player_name']); - } else { - if($i == 1) - $killers_string .= 'died at level ' . $death['level'] . ''; - else if($i == $count) - $killers_string .= ' and'; - else - $killers_string .= ','; - $killers_string .= ' by ' . $killer['monster_name']; - } - } - - $killers_string .= '.'; - - $last_kills[] = array( - 'id' => $players_deaths_count, - 'time' => $death['date'], - 'killers_string' => $killers_string, - 'world_id' => isset($config['worlds'][(int)$death['world_id']]) ? $config['worlds'][(int)$death['world_id']] : null, - ); - } - } - } else { - //$players_deaths = $db->query("SELECT `p`.`name` AS `victim`, `player_deaths`.`killed_by` as `killed_by`, `player_deaths`.`time` as `time`, `player_deaths`.`is_player` as `is_player`, `player_deaths`.`level` as `level` FROM `player_deaths`, `players` as `d` INNER JOIN `players` as `p` ON player_deaths.player_id = p.id WHERE player_deaths.`is_player`='1' ORDER BY `time` DESC LIMIT " . $config['last_kills_limit'] . ";"); - - $players_deaths = $db->query("SELECT `p`.`name` AS `victim`, `d`.`killed_by` as `killed_by`, `d`.`time` as `time`, `d`.`level`, `d`.`is_player` FROM `player_deaths` as `d` INNER JOIN `players` as `p` ON d.player_id = p.id ORDER BY `time` DESC LIMIT " . $config['last_kills_limit'] . ";"); - if(!empty($players_deaths)) { - foreach($players_deaths as $death) { - $players_deaths_count++; - $killers_string = ''; - - $killers_string .= getPlayerLink($death['victim']) . ' died at level ' . $death['level'] . ' by '; - if($death['is_player'] == '1') - $killers_string .= getPlayerLink($death['killed_by']); - else - $killers_string .= $death['killed_by']; +$worlds = $db->query("SELECT `id`, `name` FROM `worlds` ORDER BY `id` ASC")->fetchAll(); +if ($world = $_GET['world'] ?? null) { + $world = $db->query("SELECT `id`, `name` FROM `worlds` WHERE `name` = {$db->quote(escapeHtml($world))}")->fetch() ?? null; +} else { + $world = count($worlds) == 1 ? $worlds[0]['id'] : $world; +} - $killers_string .= '.'; +$w_sql = $world ? " AND `p`.`world_id` = {$world['id']} " : ""; - $last_kills[] = array( - 'id' => $players_deaths_count, - 'time' => $death['time'], - 'killers_string' => $killers_string, - ); - } - } - } +$last_kills = []; +$players_deaths_count = 0; - if($cache->enabled()) { - $cache->set('last_kills', serialize($last_kills), 120); - } +$tmp = null; +if ($cache->enabled() && $cache->fetch('last_kills', $tmp)) { + $last_kills = unserialize($tmp); +} else { + $players_deaths = $db->query("SELECT `p`.`name` AS `victim`, `d`.`killed_by` as `killed_by`, `d`.`time` as `time`, `d`.`level`, `d`.`is_player`, `w`.`name` as `world_name` FROM `player_deaths` as `d` INNER JOIN `players` as `p` ON d.player_id = p.id INNER JOIN `worlds` as `w` ON w.id = p.world_id $w_sql ORDER BY `time` DESC LIMIT {$config['last_kills_limit']};"); + if (!empty($players_deaths)) { + foreach ($players_deaths as $k => $death) { + $killers_string = getPlayerLink($death['victim']) . ' died at level ' . $death['level'] . ' by '; + $killers_string .= ($death['is_player'] == '1' ? getPlayerLink($death['killed_by']) : $death['killed_by']) . '.'; + $last_kills[] = array( + 'id' => $k + 1, + 'time' => $death['time'], + 'killers_string' => $killers_string, + 'world' => $death['world_name'], + ); + } + } + + if ($cache->enabled()) { + $cache->set('last_kills', serialize($last_kills), 120); + } } $twig->display('lastkills.html.twig', array( - 'lastkills' => $last_kills + 'lastkills' => $last_kills, + 'worlds' => $worlds, + 'world' => $world, )); diff --git a/system/templates/lastkills.html.twig b/system/templates/lastkills.html.twig index b17dab7bc..2cadf75e8 100644 --- a/system/templates/lastkills.html.twig +++ b/system/templates/lastkills.html.twig @@ -1,63 +1,136 @@ -
    -
    Staff - Team + + Our Team
    ##Group Name Status
    player outfitAdministrator {{ member.link|raw }} {% if member.status %} - Online - {% else %} - Offline - {% endif %} + Online + {% else %} + Offline + {% endif %} @@ -200,7 +212,8 @@
    ##Group Name Status
    player outfit
    ##Group Name Status
    player outfit
    ##Group Name Status
    player outfit
    ##Group Name Status
    player outfit
    -
    -
    - - - - -
    Last Kills
    - - - - -
    -
    - - - -
    -
    - - - - - - -
    - -
    - - {% if lastkills|length <= 0 %} - - - - {% else %} - {% for lastkill in lastkills %} - - - - - {% if config.multiworld %} - - {% endif %} - - {% endfor %} - {% endif %} -
    - No one died on {{ config.lua.serverName }} -
    - {{ lastkill.id }}. - - {{ lastkill.time|date("j.m.Y, G:i:s") }} - - {{ lastkill.killers_string|raw }} - - {{ lastkill.world_id }} -
    -
    - -
    -
    -
    -
    \ No newline at end of file +{% if worlds|length > 1 %} + + + + + + +
    +
    +
    +
    + + + + +
    World Selection
    + + + + +
    +
    + + + + + + +
    +
    + + + + + + + + + + +
    World Name: + + {% set button_name = 'Submit' %} + {% include('buttons.base.html.twig') %}
    +
    +
    +
    +
    +
    +{% endif %} + +
    + +
    +
    + + + + +
    Last Kills
    + + + + +
    +
    + + + +
    +
    + {% if lastkills|length <= 0 %} + + + + + + +
    + No one died on {{ world.name }} +
    + {% else %} + + + + + + + + + + + {% for lastkill in lastkills %} + + + + + + + {% endfor %} + +
    #TimeDescriptionWorld
    + {{ lastkill.id }}. + + {{ lastkill.time|date("j.m.Y, G:i:s") }} + + {{ lastkill.killers_string|raw }} + + {{ lastkill.world }} +
    + {% endif %} +
    +
    +
    From 561e0277aec0d6528213e229e1cc7939f11f454e Mon Sep 17 00:00:00 2001 From: Elson Costa Date: Tue, 27 Aug 2024 17:43:32 -0300 Subject: [PATCH 15/42] online: enabled world filter. (indented code) --- index.php | 1 + system/pages/online.php | 182 ++++---- system/templates/online.form.html.twig | 75 ++-- system/templates/online.html.twig | 591 +++++++++++++++---------- 4 files changed, 478 insertions(+), 371 deletions(-) diff --git a/index.php b/index.php index 0984a9013..1e09b42b2 100644 --- a/index.php +++ b/index.php @@ -120,6 +120,7 @@ '/^gallery\/[0-9]+\/?$/' => array('subtopic' => 'gallery', 'image' => '$1'), '/^gifts\/history\/?$/' => array('subtopic' => 'gifts', 'action' => 'show_history'), '/^guilds\/[A-Za-z0-9-_%+\']+$/' => array('subtopic' => 'guilds', 'action' => 'show', 'guild' => '$1'), + '/^online\/[0-9]+\/?$/' => array('subtopic' => 'online', 'world' => '$1'), '/^highscores\/[A-Za-z0-9-_]+\/[0-9]+\/[A-Za-z0-9-_]+\/[0-9]+\/?$/' => array('subtopic' => 'highscores', 'list' => '$1', 'world' => '$2', 'vocation' => '$3', 'page' => '$4'), '/^highscores\/[A-Za-z0-9-_]+\/[0-9]+\/[0-9]+\/?$/' => array('subtopic' => 'highscores', 'list' => '$1', 'world' => '$2', 'page' => '$3'), '/^highscores\/[A-Za-z0-9-_]+\/[0-9]+\/[A-Za-z0-9-_]+\/?$/' => array('subtopic' => 'highscores', 'list' => '$1', 'world' => '$2', 'vocation' => '$3'), diff --git a/system/pages/online.php b/system/pages/online.php index 324cada3a..38a30d88b 100644 --- a/system/pages/online.php +++ b/system/pages/online.php @@ -1,4 +1,4 @@ -hasColumn('players', 'promotion')) - $promotion = '`promotion`,'; -$order = isset($_GET['order']) ? $_GET['order'] : 'name'; -if(!in_array($order, array('country', 'name', 'level', 'vocation'))) - $order = $db->fieldName('name'); -else if($order == 'country') - $order = $db->tableName('accounts') . '.' . $db->fieldName('country'); -else if($order == 'vocation') - $order = $promotion . 'vocation ASC'; - -$skull_type = 'skull'; -if($db->hasColumn('players', 'skull_type')) { - $skull_type = 'skull_type'; +if ($w = $_POST['world'] ?? null) { + header("Location: ?p=online&world=$w"); } - -$skull_time = 'skulltime'; -if($db->hasColumn('players', 'skull_time')) { - $skull_time = 'skull_time'; +$worlds = $db->query("SELECT `id`, `name` FROM `worlds` ORDER BY `id` ASC")->fetchAll(); +if ($world = $_GET['world'] ?? null) { + $world = $db->query("SELECT `id`, `name` FROM `worlds` WHERE `name` = {$db->quote(escapeHtml($world))}")->fetch() ?? null; +} else { + $world = count($worlds) == 1 ? $worlds[0]['id'] : $world; } +$w_sql = $world ? " AND `players`.`world_id` = {$world['id']} " : ""; + +if ($config['account_country']) + require SYSTEM . 'countries.conf.php'; + +$promotion = $db->hasColumn('players', 'promotion') ? '`promotion`, ' : ''; + +$order = $_GET['order'] ?? 'name'; +if (!in_array($order, array('country', 'name', 'level', 'vocation'))) + $order = $db->fieldName('name'); +else if ($order == 'country') + $order = $db->tableName('accounts') . '.' . $db->fieldName('country'); +else if ($order == 'vocation') + $order = $promotion . 'vocation ASC'; + +$skull_type = $db->hasColumn('players', 'skull_type') ? 'skull_type' : 'skull'; +$skull_time = $db->hasColumn('players', 'skull_time') ? 'skull_time' : 'skulltime'; $outfit_addons = false; $outfit = ''; -if($config['online_outfit']) { - $outfit = ', lookbody, lookfeet, lookhead, looklegs, looktype'; - if($db->hasColumn('players', 'lookaddons')) { - $outfit .= ', lookaddons'; - $outfit_addons = true; - } +if ($config['online_outfit']) { + $outfit = ', lookbody, lookfeet, lookhead, looklegs, looktype'; + if ($db->hasColumn('players', 'lookaddons')) { + $outfit .= ', lookaddons'; + $outfit_addons = true; + } } -if($config['online_vocations']) { - $vocs = array(); - foreach($config['vocations'] as $id => $name) { - $vocs[$id] = 0; - } +$vocations = []; +if ($config['online_vocations']) { + foreach ($config['vocations'] as $id => $name) { + $vocations[$id] = 0; + } } -if($db->hasTable('players_online')) // tfs 1.0 - $playersOnline = $db->query('SELECT `accounts`.`country`, `players`.`name`, `players`.`level`, `players`.`vocation`' . $outfit . ', `' . $skull_time . '` as `skulltime`, `' . $skull_type . '` as `skull` FROM `accounts`, `players`, `players_online` WHERE `players`.`id` = `players_online`.`player_id` AND `accounts`.`id` = `players`.`account_id` ORDER BY ' . $order); +if ($db->hasTable('players_online')) // tfs 1.0 + $playersOnline = $db->query("SELECT `accounts`.`country`, `players`.`name`, `players`.`level`, `players`.`vocation`, `players`.`world_id` $outfit, `$skull_time` as `skulltime`, `$skull_type` as `skull` FROM `accounts`, `players`, `players_online` WHERE `players`.`id` = `players_online`.`player_id` AND `accounts`.`id` = `players`.`account_id` $w_sql ORDER BY $order"); else - $playersOnline = $db->query('SELECT `accounts`.`country`, `players`.`name`, `players`.`level`, `players`.`vocation`' . $outfit . ', ' . $promotion . ' `' . $skull_time . '` as `skulltime`, `' . $skull_type . '` as `skull` FROM `accounts`, `players` WHERE `players`.`online` > 0 AND `accounts`.`id` = `players`.`account_id` ORDER BY ' . $order); - -$players_data = array(); -$explodeFlags = array(); -$players = 0; -$data = ''; -foreach($playersOnline as $player){ - $skull = ''; - if($config['online_skulls']) - { - if($player['skulltime'] > 0) - { - if($player['skull'] == 3) - $skull = ' '; - elseif($player['skull'] == 4) - $skull = ' '; - elseif($player['skull'] == 5) - $skull = ' '; - } - } - - if(isset($player['promotion'])) { - if((int)$player['promotion'] > 0) - $player['vocation'] += ($player['promotion'] * $config['vocations_amount']); - } - - $players_data[] = array( - 'name' => getPlayerLink($player['name']), - 'player' => $player, - 'level' => $player['level'], - 'vocation' => $config['vocations'][$player['vocation']], - 'country_image' => $config['account_country'] ? getFlagImage($player['country']) : null, - 'outfit' => $config['online_outfit'] ? $config['outfit_images_url'] . '?id=' . $player['looktype'] . ($outfit_addons ? '&addons=' . $player['lookaddons'] : '') . '&head=' . $player['lookhead'] . '&body=' . $player['lookbody'] . '&legs=' . $player['looklegs'] . '&feet=' . $player['lookfeet'] : null - ); - - if($config['online_vocations']) { - $vocs[($player['vocation'] > $config['vocations_amount'] ? $player['vocation'] - $config['vocations_amount'] : $player['vocation'])]++; - } + $playersOnline = $db->query("SELECT `accounts`.`country`, `players`.`name`, `players`.`level`, `players`.`vocation`, `players`.`world_id` $outfit, $promotion `$skull_time` as `skulltime`, `$skull_type` as `skull` FROM `accounts`, `players` WHERE `players`.`online` > 0 AND `accounts`.`id` = `players`.`account_id` $w_sql ORDER BY $order"); + +$players_data = []; +foreach ($playersOnline as $player) { + $skull = ''; + if ($config['online_skulls']) { + if ($player['skulltime'] > 0) { + if ($player['skull'] == 3) + $skull = ' '; + elseif ($player['skull'] == 4) + $skull = ' '; + elseif ($player['skull'] == 5) + $skull = ' '; + } + } + + if ($pPromotion = $player['promotion'] ?? null) { + if ((int)$pPromotion > 0) $player['vocation'] += ($pPromotion * $config['vocations_amount']); + } + + $players_data[] = array( + 'name' => getPlayerLink($player['name']), + 'player' => $player, + 'level' => $player['level'], + 'vocation' => $config['vocations'][$player['vocation']], + 'country_image' => $config['account_country'] ? getFlagImage($player['country']) : null, + 'outfit' => $config['online_outfit'] ? $config['outfit_images_url'] . '?id=' . $player['looktype'] . ($outfit_addons ? '&addons=' . $player['lookaddons'] : '') . '&head=' . $player['lookhead'] . '&body=' . $player['lookbody'] . '&legs=' . $player['looklegs'] . '&feet=' . $player['lookfeet'] : null + ); + + if ($config['online_vocations']) { + $vocations[($player['vocation'] > $config['vocations_amount'] ? $player['vocation'] - $config['vocations_amount'] : $player['vocation'])]++; + } } $record = ''; -if($config['online_record']){ - $timestamp = false; - if($db->hasTable('server_record')) { - $query = - $db->query( - 'SELECT `record`, `timestamp` FROM `server_record` WHERE `world_id` = ' . (int)$config['lua']['worldId'] . - ' ORDER BY `record` DESC LIMIT 1'); - $timestamp = true; - }else if($db->hasTable('server_config')) { // tfs 1.0 - $query = $db->query('SELECT `timestamp`, `value` as `record` FROM `server_config` WHERE `config` = ' . $db->quote('players_record')); - }else{ - $query = NULL; - } - - if(isset($query) && $query->rowCount() > 0){ - $result = $query->fetch(); - $record = '' . $result['record'] . ' players
    '.date('d/m/Y, H:i:s', strtotime($result['timestamp'])).''; - } +if ($config['online_record']) { + $timestamp = false; + $query = null; + if ($db->hasTable('server_config')) { + $query = $db->query("SELECT `timestamp`, `value` as `record` FROM `server_config` WHERE `config` = {$db->quote('players_record')}"); + } + + if ($query && $query->rowCount() > 0) { + $result = $query->fetch(); + $record = "{$result['record']} players
    " . date('d/m/Y, H:i:s', strtotime($result['timestamp'])) . ''; + } } $twig->display('online.html.twig', array( - 'players' => $players_data, - 'record' => $record, - 'current_date' => date('d/m/Y'), - 'vocs' => $vocs, + 'players' => $players_data, + 'record' => $record, + 'current_date' => date('d/m/Y'), + 'vocations' => $vocations, + 'worlds' => $worlds, + 'world' => $world, )); //search bar diff --git a/system/templates/online.form.html.twig b/system/templates/online.form.html.twig index 14659a7ab..f27a0c2d0 100644 --- a/system/templates/online.form.html.twig +++ b/system/templates/online.form.html.twig @@ -1,34 +1,45 @@
    -
    -
    - - - - -
    Search Character
    - - - - -
    - - - - -
    -
    - - - - - - - - - - -
    Character Name:{% set button_name = 'Submit' %} - {% include('buttons.base.html.twig') %}
    -
    -
    +
    +
    + + + + +
    Search Character
    + + + + +
    +
    + + + + + + +
    +
    + + + + + + + + + + +
    Character Name:{% set button_name = 'Submit' %} + {% include('buttons.base.html.twig') %}
    +
    +
    diff --git a/system/templates/online.html.twig b/system/templates/online.html.twig index fd45a1827..b62cbef19 100644 --- a/system/templates/online.html.twig +++ b/system/templates/online.html.twig @@ -1,246 +1,349 @@ - - - - - - - -
    -
    -
    -
    - - - - -
    World Information
    - - - - -
    - - - - -
    -
    - - - {% if not status.online %} - - - - {% else %} - - - - - - - - - - - - - - - - - {% endif %} - -
    {{ config.lua.serverName }} Server is offline.
    Status: Online
    Players Online:{{ players|length }} Players Online
    Online Record:{{ record|raw }}
    Location Datacenter:Brasil
    (Server Date: UTC - {{ current_date }})
    -
    -
    -
    -
    -
    -
    -
    - - - - -
    Frags
    - - - - -
    - - - - -
    -
    - - - - - - -
    - 1 - 6 Frags
    - 6+ Frags or Red Skull
    - 10+ Frags or Black Skull
    -
    -
    -
    -
    +{% if worlds|length > 1 %} + + + + + + +
    +
    +
    +
    + + + + +
    World Selection
    + + + + +
    +
    + + + + + + +
    +
    + + + + + + + + + + +
    World Name: + + {% set button_name = 'Submit' %} + {% include('buttons.base.html.twig') %}
    +
    +
    +
    +
    +
    +{% endif %} - - - - -
    -
    -
    -
    - - - - -
    Vocations Status
    - - - - -
    - - - - -
    -
    - - - - - -
    -
    - - - - - - - - - -
    Sorcerers
    {{ vocs[1] }}
    -
    -
    -
    - - - - - - - - - -
    Druids
    {{ vocs[2] }}
    -
    -
    -
    - - - - - - - - - -
    Paladins
    {{ vocs[3] }}
    -
    -
    -
    - - - - - - - - - -
    Knights
    {{ vocs[4] }}
    -
    -
    -
    -
    -
    -
    -
    +{% if world %} + + + + + + +
    +
    +
    +
    + + + + +
    World Information
    + + + + +
    +
    + + + + + + +
    +
    + + + + + + + {% if status.online %} + + + + + + + + + + + + + {% endif %} + + + + + +
    Status: + {{ world.name }} Server is {% if status.online %}Online{% else %} Offline{% endif %} +
    Players Online:{{ players|length }} Players Online
    Online Record:{{ record|raw }}
    Location:Brasil
    (Server Date: UTC - {{ current_date }})
    Frags: + + + + + + + + + + + + +
    - 1 - 6 Frags
    - 6+ Frags or Red Skull
    - 10+ Frags or Black Skull
    +
    +
    +
    +
    +
    +
    - - - - -
    -
    -
    -
    - - - - -
    Players Online
    - - - - -
    - - - - -
    -
    - -
    -
    - - - {% if players|length == 0 %} - - - - {% else %} - - {% if config.account_country %} - - {% endif %} - {% if config.online_outfit %} - - {% endif %} - - - - - {% set i = 0 %} - {% for player in players %} - {% set i = i + 1 %} - - {% if config.account_country %} - - {% endif %} - {% if config.online_outfit %} - - {% endif %} - - - - - {% endfor %} - {% endif %} - -
    Currently no one is playing on {{ config.lua.serverName }}.
    #OutfitNameLevelVocation
    {{ player.country_image|raw }}player outfit{{ player.name|raw }}{{ player.skull }}{{ player.level }}{{ player.vocation }}
    -
    -
    -
    -
    -
    -
    -
    + + + + + + +
    +
    +
    +
    + + + + +
    Vocations Status
    + + + + +
    +
    + + + + + + +
    +
    + + + + + + + + + +
    +
    + + + + + + + + + +
    Sorcerers
    {{ vocations[1] }}
    +
    +
    +
    + + + + + + + + + +
    Druids
    {{ vocations[2] }}
    +
    +
    +
    + + + + + + + + + +
    Paladins
    {{ vocations[3] }}
    +
    +
    +
    + + + + + + + + + +
    Knights
    {{ vocations[4] }}
    +
    +
    +
    +
    +
    +
    +
    + + + + + + + +
    +
    +
    +
    + + + + +
    Players Online
    + + + + +
    +
    + + + + + + +
    +
    + + + + + + +
    +
    + + + {% if players|length == 0 %} + + + + {% else %} + + {% if config.account_country %} + + {% endif %} + {% if config.online_outfit %} + + {% endif %} + + + + + {% set i = 0 %} + {% for player in players %} + {% set i = i + 1 %} + + {% if config.account_country %} + + {% endif %} + {% if config.online_outfit %} + + {% endif %} + + + + + {% endfor %} + {% endif %} + +
    Currently, no one is playing on {{ config.lua.serverName }}.
    #OutfitNameLevelVocation
    {{ player.country_image|raw }}player outfit{{ player.name|raw }}{{ player.skull }}{{ player.level }}{{ player.vocation }}
    +
    +
    +
    +
    +
    +
    +
    +{% endif %} From aaf07fc628aa1edf575d3919848e74b471a8a125 Mon Sep 17 00:00:00 2001 From: Elson Costa Date: Tue, 27 Aug 2024 17:44:08 -0300 Subject: [PATCH 16/42] lastkills: fix world filter. --- system/pages/lastkills.php | 3 +++ system/templates/lastkills.html.twig | 4 ++-- tools/signature/mango.php | 6 ++---- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/system/pages/lastkills.php b/system/pages/lastkills.php index c4d540b29..f4ce7573b 100644 --- a/system/pages/lastkills.php +++ b/system/pages/lastkills.php @@ -57,3 +57,6 @@ 'worlds' => $worlds, 'world' => $world, )); + +//search bar +$twig->display('online.form.html.twig'); diff --git a/system/templates/lastkills.html.twig b/system/templates/lastkills.html.twig index 2cadf75e8..5b4902893 100644 --- a/system/templates/lastkills.html.twig +++ b/system/templates/lastkills.html.twig @@ -37,10 +37,10 @@ World Name: diff --git a/tools/signature/mango.php b/tools/signature/mango.php index acdf37b3a..6cdf037c1 100644 --- a/tools/signature/mango.php +++ b/tools/signature/mango.php @@ -54,10 +54,8 @@ function getExpToLevel( $level ) $MadGD->addText( 'Level:', $MadGD->textBold )->setPosition( 10, $i * $eachRow ); $MadGD->addText( $player->getLevel() )->setPosition( ); $i++; /** WORLD **/ - if($config['multiworld']) { - $MadGD->addText( 'World:', $MadGD->textBold )->setPosition( 10, $i * $eachRow ); - $MadGD->addText( $config['worlds'][$player->getWorldId()] )->setPosition( ); $i++; - } + $MadGD->addText( 'World:', $MadGD->textBold )->setPosition( 10, $i * $eachRow ); + $MadGD->addText( $config['worlds'][$player->getWorldId()] )->setPosition( ); $i++; /** RESIDENCE **/ $MadGD->addText( 'Residence:', $MadGD->textBold )->setPosition( 10, $i * $eachRow ); From fe48561cfa47b3fdaed2efbe8da79ae74fb4eb30 Mon Sep 17 00:00:00 2001 From: Elson Costa Date: Tue, 27 Aug 2024 17:44:55 -0300 Subject: [PATCH 17/42] lastkills: fix. --- system/templates/lastkills.html.twig | 1 + 1 file changed, 1 insertion(+) diff --git a/system/templates/lastkills.html.twig b/system/templates/lastkills.html.twig index 5b4902893..ae9660b24 100644 --- a/system/templates/lastkills.html.twig +++ b/system/templates/lastkills.html.twig @@ -134,3 +134,4 @@
    +
    From 6a50bf3d44974c06e9732bd70b2b3285ed8b710d Mon Sep 17 00:00:00 2001 From: Elson Costa Date: Wed, 28 Aug 2024 11:10:56 -0300 Subject: [PATCH 18/42] lastkills & online: fixes routes. online: improvement on information. --- index.php | 3 ++- system/functions.php | 21 +++++++++++++++++++++ system/pages/lastkills.php | 2 +- system/pages/online.php | 8 ++++---- system/templates/online.html.twig | 22 +++++++++++++--------- system/twig.php | 5 +++++ 6 files changed, 46 insertions(+), 15 deletions(-) diff --git a/index.php b/index.php index 1e09b42b2..cbc8c3673 100644 --- a/index.php +++ b/index.php @@ -120,13 +120,14 @@ '/^gallery\/[0-9]+\/?$/' => array('subtopic' => 'gallery', 'image' => '$1'), '/^gifts\/history\/?$/' => array('subtopic' => 'gifts', 'action' => 'show_history'), '/^guilds\/[A-Za-z0-9-_%+\']+$/' => array('subtopic' => 'guilds', 'action' => 'show', 'guild' => '$1'), - '/^online\/[0-9]+\/?$/' => array('subtopic' => 'online', 'world' => '$1'), + '/^online\/[A-Za-z0-9-_%+\']+$/' => array('subtopic' => 'online', 'world' => '$1'), '/^highscores\/[A-Za-z0-9-_]+\/[0-9]+\/[A-Za-z0-9-_]+\/[0-9]+\/?$/' => array('subtopic' => 'highscores', 'list' => '$1', 'world' => '$2', 'vocation' => '$3', 'page' => '$4'), '/^highscores\/[A-Za-z0-9-_]+\/[0-9]+\/[0-9]+\/?$/' => array('subtopic' => 'highscores', 'list' => '$1', 'world' => '$2', 'page' => '$3'), '/^highscores\/[A-Za-z0-9-_]+\/[0-9]+\/[A-Za-z0-9-_]+\/?$/' => array('subtopic' => 'highscores', 'list' => '$1', 'world' => '$2', 'vocation' => '$3'), '/^highscores\/[A-Za-z0-9-_]+\/[A-Za-z0-9-_]+\/?$/' => array('subtopic' => 'highscores', 'list' => '$1', 'vocation' => '$2'), '/^highscores\/[A-Za-z0-9-_]+\/[0-9]+\/?$/' => array('subtopic' => 'highscores', 'list' => '$1', 'world' => '$2'), '/^highscores\/[A-Za-z0-9-_]+\/?$/' => array('subtopic' => 'highscores', 'list' => '$1'), + '/^lastkills\/[A-Za-z0-9-_%+\']+$/' => array('subtopic' => 'lastkills', 'world' => '$1'), '/^news\/add\/?$/' => array('subtopic' => 'news', 'action' => 'add'), '/^news\/edit\/?$/' => array('subtopic' => 'news', 'action' => 'edit'), '/^news\/archive\/?$/' => array('subtopic' => 'newsarchive'), diff --git a/system/functions.php b/system/functions.php index 5e8bf112a..0f633458f 100644 --- a/system/functions.php +++ b/system/functions.php @@ -1021,6 +1021,27 @@ function getWorldName($id) return configLua('serverName'); } +/** + * @param string $type + * @return string + */ +function getWorldType(string $type): string +{ + $retro = configLua('toggleServerIsRetroPVP') ? 'Retro ' : ''; + switch ($type) { + case 'pvp': + return "{$retro}Open PvP"; + case 'no-pvp': + case 'non-pvp': + return 'Optional PvP'; + case 'pvp-enforced': + case 'enforced': + return "{$retro}Hardcore PvP"; + default: + return $type; + } +} + /** * Mailing users. * $config['mail_enabled'] have to be enabled. diff --git a/system/pages/lastkills.php b/system/pages/lastkills.php index f4ce7573b..c81b4cc72 100644 --- a/system/pages/lastkills.php +++ b/system/pages/lastkills.php @@ -14,7 +14,7 @@ $title = 'Last Kills'; if ($w = $_POST['world'] ?? null) { - header("Location: ?p=lastkills&world=$w"); + header("Location: ?lastkills/$w"); } $worlds = $db->query("SELECT `id`, `name` FROM `worlds` ORDER BY `id` ASC")->fetchAll(); diff --git a/system/pages/online.php b/system/pages/online.php index 38a30d88b..82ef844b3 100644 --- a/system/pages/online.php +++ b/system/pages/online.php @@ -13,11 +13,11 @@ $title = 'Who is online?'; if ($w = $_POST['world'] ?? null) { - header("Location: ?p=online&world=$w"); + header("Location: ?online/$w"); } $worlds = $db->query("SELECT `id`, `name` FROM `worlds` ORDER BY `id` ASC")->fetchAll(); if ($world = $_GET['world'] ?? null) { - $world = $db->query("SELECT `id`, `name` FROM `worlds` WHERE `name` = {$db->quote(escapeHtml($world))}")->fetch() ?? null; + $world = $db->query("SELECT * FROM `worlds` WHERE `name` = {$db->quote(escapeHtml($world))}")->fetch() ?? null; } else { $world = count($worlds) == 1 ? $worlds[0]['id'] : $world; } @@ -103,14 +103,14 @@ if ($query && $query->rowCount() > 0) { $result = $query->fetch(); - $record = "{$result['record']} players
    " . date('d/m/Y, H:i:s', strtotime($result['timestamp'])) . ''; + $d = date('M d Y, H:i:s', strtotime($result['timestamp'])); + $record = number_format($result['record'] ?? 0) . " players (on $d)"; } } $twig->display('online.html.twig', array( 'players' => $players_data, 'record' => $record, - 'current_date' => date('d/m/Y'), 'vocations' => $vocations, 'worlds' => $worlds, 'world' => $world, diff --git a/system/templates/online.html.twig b/system/templates/online.html.twig index b62cbef19..a309160ae 100644 --- a/system/templates/online.html.twig +++ b/system/templates/online.html.twig @@ -110,15 +110,19 @@ Players Online: {{ players|length }} Players Online - - Online Record: - {{ record|raw }} - - - Location: - Brasil
    (Server Date: UTC - {{ current_date }}) - {% endif %} + + Online Record: + {{ record|raw }} + + + Location: + {{ config.lua.location }} + + + PvP Type: + {{ getWorldType(world.type) }} + Frags: @@ -296,7 +300,7 @@ {% if players|length == 0 %} - Currently, no one is playing on {{ config.lua.serverName }}. + Currently, no one is playing on {{ world.name }} Server. {% else %} diff --git a/system/twig.php b/system/twig.php index c6b3ef322..0f5041def 100644 --- a/system/twig.php +++ b/system/twig.php @@ -77,6 +77,11 @@ function ($context, $hook, array $params = []) { }); $twig->addFunction($function); +$function = new TwigFunction('getWorldType', function ($type) { + return getWorldType($type); +}); +$twig->addFunction($function); + $filter = new TwigFilter('urlencode', function ($s) { return urlencode($s); }); From c49af4889c6652cd82956d8e0fa9687d50b8ddaa Mon Sep 17 00:00:00 2001 From: Elson Costa Date: Wed, 28 Aug 2024 11:40:10 -0300 Subject: [PATCH 19/42] houses: reindent. --- system/pages/houses.php | 305 ++++++++++++------------- system/templates/houses.html.twig | 355 ++++++++++++++++-------------- 2 files changed, 330 insertions(+), 330 deletions(-) diff --git a/system/pages/houses.php b/system/pages/houses.php index 6858cf087..585303699 100644 --- a/system/pages/houses.php +++ b/system/pages/houses.php @@ -14,194 +14,177 @@ $title = 'Houses'; $errors = array(); -if(!$db->hasColumn('houses', 'name')) { - $errors[] = 'Houses list is not available on this server.'; +if (!$db->hasColumn('houses', 'name')) { + $errors[] = 'Houses list is not available on this server.'; - $twig->display('houses.html.twig', array( - 'errors' => $errors - )); - return; + $twig->display('houses.html.twig', array( + 'errors' => $errors + )); + return; } $rentType = trim(strtolower($config['lua']['houseRentPeriod'])); -if($rentType != 'yearly' && $rentType != 'monthly' && $rentType != 'weekly' && $rentType != 'daily') - $rentType = 'never'; +if ($rentType != 'yearly' && $rentType != 'monthly' && $rentType != 'weekly' && $rentType != 'daily') + $rentType = 'never'; $state = ''; $order = ''; $type = ''; -if(isset($_GET['page']) && $_GET['page'] == 'view' && isset($_REQUEST['house'])) -{ - $beds = array("", "one", "two", "three", "fourth", "fifth"); - $houseName = $_REQUEST['house']; - $houseId = (Validator::number($_REQUEST['house']) ? $_REQUEST['house'] : -1); - $selectHouse = $db->query('SELECT * FROM ' . $db->tableName('houses') . ' WHERE ' . $db->fieldName('name') . ' LIKE ' . $db->quote($houseName) . ' OR `id` = ' . $db->quote($houseId)); +if (isset($_GET['page']) && $_GET['page'] == 'view' && isset($_REQUEST['house'])) { + $beds = array("", "one", "two", "three", "fourth", "fifth"); + $houseName = $_REQUEST['house']; + $houseId = (Validator::number($_REQUEST['house']) ? $_REQUEST['house'] : -1); + $selectHouse = $db->query('SELECT * FROM ' . $db->tableName('houses') . ' WHERE ' . $db->fieldName('name') . ' LIKE ' . $db->quote($houseName) . ' OR `id` = ' . $db->quote($houseId)); - $house = array(); - if($selectHouse->rowCount() > 0) - { - $house = $selectHouse->fetch(); - $houseId = $house['id']; + $house = array(); + if ($selectHouse->rowCount() > 0) { + $house = $selectHouse->fetch(); + $houseId = $house['id']; - $title = $house['name'] . ' - ' . $title; + $title = $house['name'] . ' - ' . $title; - $imgPath = 'images/houses/' . $houseId . '.gif'; - if(!file_exists($imgPath)) { - $imgPath = 'images/houses/default.jpg'; - } - - $bedsMessage = null; - $houseBeds = $house['beds']; - if($houseBeds > 0) - $bedsMessage = 'House have ' . (isset($beds[$houseBeds]) ? $beds[$houseBeds] : $houseBeds) . ' bed' . ($houseBeds > 1 ? 's' : ''); - else - $bedsMessage = 'This house dont have any beds'; - - $houseOwner = $house['owner']; - if($houseOwner > 0) - { - $guild = NULL; - $owner = null; - if(isset($house['guild']) && $house['guild'] == 1) - { - $guild = new OTS_Guild(); - $guild->load($houseOwner); - $owner = getGuildLink($guild->getName()); - } - else - $owner = getCreatureName($houseOwner); - - if($rentType != 'never' && $house['paid'] > 0) - { - $who = ''; - if($guild) - $who = $guild->getName(); - else - { - $player = new OTS_Player(); - $player->load($houseOwner); - if($player->isLoaded()) - { - $sexs = array('She', 'He'); - $who = $sexs[$player->getSex()]; - } - } - $owner .= ' ' . $who . ' has paid the rent until ' . date("M d Y, H:i:s", $house['paid']) . ' CEST.'; - } - } + $imgPath = 'images/houses/' . $houseId . '.gif'; + if (!file_exists($imgPath)) { + $imgPath = 'images/houses/default.jpg'; } + + $bedsMessage = null; + $houseBeds = $house['beds']; + if ($houseBeds > 0) + $bedsMessage = 'House have ' . (isset($beds[$houseBeds]) ? $beds[$houseBeds] : $houseBeds) . ' bed' . ($houseBeds > 1 ? 's' : ''); else - $errors[] = 'House with name ' . $houseName . ' does not exists.'; - - $twig->display('houses.view.html.twig', array( - 'errors' => $errors, - 'imgPath' => isset($imgPath) ? $imgPath : null, - 'houseName' => isset($house['name']) ? $house['name'] : null, - 'bedsMessage' => isset($bedsMessage) ? $bedsMessage : null, - 'houseSize' => isset($house['size']) ? $house['size'] : null, - 'houseRent' => isset($house['rent']) ? $house['rent'] : null, - 'owner' => isset($owner) ? $owner : null, - 'rentType' => isset($rentType) ? $rentType : null - )); - - if (count($errors) > 0) { - return; + $bedsMessage = 'This house dont have any beds'; + + $houseOwner = $house['owner']; + if ($houseOwner > 0) { + $guild = NULL; + $owner = null; + if (isset($house['guild']) && $house['guild'] == 1) { + $guild = new OTS_Guild(); + $guild->load($houseOwner); + $owner = getGuildLink($guild->getName()); + } else + $owner = getCreatureName($houseOwner); + + if ($rentType != 'never' && $house['paid'] > 0) { + $who = ''; + if ($guild) + $who = $guild->getName(); + else { + $player = new OTS_Player(); + $player->load($houseOwner); + if ($player->isLoaded()) { + $sexs = array('She', 'He'); + $who = $sexs[$player->getSex()]; + } + } + $owner .= ' ' . $who . ' has paid the rent until ' . date("M d Y, H:i:s", $house['paid']) . ' CEST.'; + } } + } else + $errors[] = 'House with name ' . $houseName . ' does not exists.'; + + $twig->display('houses.view.html.twig', array( + 'errors' => $errors, + 'imgPath' => isset($imgPath) ? $imgPath : null, + 'houseName' => isset($house['name']) ? $house['name'] : null, + 'bedsMessage' => isset($bedsMessage) ? $bedsMessage : null, + 'houseSize' => isset($house['size']) ? $house['size'] : null, + 'houseRent' => isset($house['rent']) ? $house['rent'] : null, + 'owner' => isset($owner) ? $owner : null, + 'rentType' => isset($rentType) ? $rentType : null + )); + + if (count($errors) > 0) { + return; + } } $cleanOldHouse = null; -if(isset($config['lua']['houseCleanOld'])) { - $cleanOldHouse = (int)(eval('return ' . $config['lua']['houseCleanOld'] . ';') / (24 * 60 * 60)); +if (isset($config['lua']['houseCleanOld'])) { + $cleanOldHouse = (int)(eval('return ' . $config['lua']['houseCleanOld'] . ';') / (24 * 60 * 60)); } $housesSearch = false; -if(isset($_POST['town']) && isset($_POST['state']) && isset($_POST['order']) && (isset($_POST['type']) || !$db->hasColumn('houses', 'guild'))) -{ - $townName = $config['towns'][$_POST['town']]; - $order = $_POST['order']; - $orderby = '`name`'; - if(!empty($order)) - { - if($order == 'size') - $orderby = '`size`'; - else if($order == 'rent') - $orderby = '`rent`'; +if (isset($_POST['town']) && isset($_POST['state']) && isset($_POST['order']) && (isset($_POST['type']) || !$db->hasColumn('houses', 'guild'))) { + $townName = $config['towns'][$_POST['town']]; + $order = $_POST['order']; + $orderby = '`name`'; + if (!empty($order)) { + if ($order == 'size') + $orderby = '`size`'; + else if ($order == 'rent') + $orderby = '`rent`'; + } + + $town = 'town'; + if ($db->hasColumn('houses', 'town_id')) + $town = 'town_id'; + else if ($db->hasColumn('houses', 'townid')) + $town = 'townid'; + + $whereby = '`' . $town . '` = ' . (int)$_POST['town']; + $state = $_POST['state']; + if (!empty($state)) + $whereby .= ' AND `owner` ' . ($state == 'free' ? '' : '!') . '= 0'; + + $type = isset($_POST['type']) ? $_POST['type'] : NULL; + if ($type == 'guildhalls' && !$db->hasColumn('houses', 'guild')) + $type = 'all'; + + if (!empty($type) && $type != 'all') { + $guildColumn = ''; + if ($db->hasColumn('houses', 'guild')) { + $guildColumn = 'guild'; + } else if ($db->hasColumn('houses', 'guildid')) { + $guildColumn = 'guildid'; } - $town = 'town'; - if($db->hasColumn('houses', 'town_id')) - $town = 'town_id'; - else if($db->hasColumn('houses', 'townid')) - $town = 'townid'; - - $whereby = '`' . $town . '` = ' .(int)$_POST['town']; - $state = $_POST['state']; - if(!empty($state)) - $whereby .= ' AND `owner` ' . ($state == 'free' ? '' : '!'). '= 0'; - - $type = isset($_POST['type']) ? $_POST['type'] : NULL; - if($type == 'guildhalls' && !$db->hasColumn('houses', 'guild')) - $type = 'all'; - - if (!empty($type) && $type != 'all') - { - $guildColumn = ''; - if ($db->hasColumn('houses', 'guild')) { - $guildColumn = 'guild'; - } - else if ($db->hasColumn('houses', 'guildid')) { - $guildColumn = 'guildid'; - } - - if($guildColumn !== '') { - $whereby .= ' AND `' . $guildColumn . '` ' . ($type == 'guildhalls' ? '!' : '') . '= 0'; - } - } - - $houses_info = $db->query('SELECT * FROM `houses` WHERE ' . $whereby. ' ORDER BY ' . $orderby); - - $players_info = $db->query("SELECT `houses`.`id` AS `houseid` , `players`.`name` AS `ownername` FROM `houses` , `players` , `accounts` WHERE `players`.`id` = `houses`.`owner` AND `accounts`.`id` = `players`.`account_id`"); - $players = array(); - foreach($players_info->fetchAll() as $player) - $players[$player['houseid']] = array('name' => $player['ownername']); - - $houses = array(); - foreach($houses_info->fetchAll() as $house) - { - $owner = isset($players[$house['id']]) ? $players[$house['id']] : array(); - - $houseRent = null; - if($db->hasColumn('houses', 'guild') && $house['guild'] == 1 && $house['owner'] != 0) - { - $guild = new OTS_Guild(); - $guild->load($house['owner']); - $houseRent = 'Rented by ' . getGuildLink($guild->getName()); - } - else - { - if(!empty($owner['name'])) - $houseRent = 'Rented by ' . getPlayerLink($owner['name']); - else - $houseRent = 'Free'; - } - - $houses[] = array('owner' => $owner, 'name' => $house['name'], 'size' => $house['size'], 'rent' => $house['rent'], 'rentedBy' => $houseRent); + if ($guildColumn !== '') { + $whereby .= ' AND `' . $guildColumn . '` ' . ($type == 'guildhalls' ? '!' : '') . '= 0'; } + } + + $houses_info = $db->query('SELECT * FROM `houses` WHERE ' . $whereby . ' ORDER BY ' . $orderby); + + $players_info = $db->query("SELECT `houses`.`id` AS `houseid` , `players`.`name` AS `ownername` FROM `houses` , `players` , `accounts` WHERE `players`.`id` = `houses`.`owner` AND `accounts`.`id` = `players`.`account_id`"); + $players = array(); + foreach ($players_info->fetchAll() as $player) + $players[$player['houseid']] = array('name' => $player['ownername']); + + $houses = array(); + foreach ($houses_info->fetchAll() as $house) { + $owner = isset($players[$house['id']]) ? $players[$house['id']] : array(); + + $houseRent = null; + if ($db->hasColumn('houses', 'guild') && $house['guild'] == 1 && $house['owner'] != 0) { + $guild = new OTS_Guild(); + $guild->load($house['owner']); + $houseRent = 'Rented by ' . getGuildLink($guild->getName()); + } else { + if (!empty($owner['name'])) + $houseRent = 'Rented by ' . getPlayerLink($owner['name']); + else + $houseRent = 'Free'; + } + + $houses[] = array('owner' => $owner, 'name' => $house['name'], 'size' => $house['size'], 'rent' => $house['rent'], 'rentedBy' => $houseRent); + } - $housesSearch = true; + $housesSearch = true; } $guild = $db->hasColumn('houses', 'guild') ? ' or guildhall' : ''; $twig->display('houses.html.twig', array( - 'state' => $state, - 'order' => $order, - 'type' => $type, - 'houseType' => $type == 'guildhalls' ? 'Guildhalls' : 'Houses and Flats', - 'townName' => isset($townName) ? $townName : null, - 'townId' => isset($_POST['town']) ? $_POST['town'] : null, - 'guild' => $guild, - 'cleanOldHouse' => isset($cleanOld) ? $cleanOld : null, - 'housesSearch' => $housesSearch, - 'houses' => isset($houses) ? $houses : null + 'state' => $state, + 'order' => $order, + 'type' => $type, + 'houseType' => $type == 'guildhalls' ? 'Guildhalls' : 'Houses and Flats', + 'townName' => isset($townName) ? $townName : null, + 'townId' => isset($_POST['town']) ? $_POST['town'] : null, + 'guild' => $guild, + 'cleanOldHouse' => isset($cleanOld) ? $cleanOld : null, + 'housesSearch' => $housesSearch, + 'houses' => isset($houses) ? $houses : null )); diff --git a/system/templates/houses.html.twig b/system/templates/houses.html.twig index 4e75942c9..3d1945987 100644 --- a/system/templates/houses.html.twig +++ b/system/templates/houses.html.twig @@ -1,171 +1,188 @@
    - {% if errors is not empty %} - {% for error in errors %} -

    {{ error }}

    - {% endfor %} - {% else %} - -
    -
    - - - - -
    House Search
    - - - - -
    -
    - - - + +
    -
    - Here you can see the list of all available houses, flats{{ guildString }}. - Click on any view button to get more information about a house or adjust - the search criteria and start a new search. -

    - {% if cleanOldHouse is not empty or rentType != 'never' %} - Every morning during global server save there is automatic house cleaning. Server delete house owners who have not logged in last {{ cleanOldHouse }} days{% if rentType != 'never' %} or have not paid {{ rentType }} house rent. Remember to leave money for a rent in {% if config.lua.bankSystem is not empty %}your house bank or {% else %}depo in same city where you have house!{% endif %}{% else %}.{% endif %} -

    - {% endif %} - - {% if houses is not empty or housesSearch %} - - - - - - - - {% if houses is not empty %} - - - - - - - {% elseif housesSearch %} - - {% endif %} - - - {% if houses is not empty %} - {% set i = 0 %} - {% for house in houses %} - {% set i = i + 1 %} - - - - - - - - - - - - {% endfor %} - {% endif %} - -
    Available {{ houseType }}{% if townName is not empty %} in {{ townName }}{% endif %} on {{ config.lua.serverName }}
    NameSizeRentStatus No {{ houseType }} with specified criterias.
    - {{ house.name }} - - {{ house.size }} - - {{ house.rent }} golds - - {{ house.rentedBy|raw }} - -
    - - {{ include('buttons.view.html.twig') }} -
    -
    -
    - {% endif %} - -
    - - - - - - - - - - - - - - - - - - - - - - - - -
    House Search
    TownStatusOrder
    - {% set checked = false %} - {% for id, name in config.towns if id > 0 %} - {% if ((townId is empty and name is not empty) or id == townId) and not checked %} - {% set variable = "checked" %} - {% set checked = true %} - {% else %} - {% set variable = "" %} - {% endif %} - - - -
    - {% endfor %} -
    - -
    - - -
    - - -
    -
    - -
    - - -
    - - -
    -
    - -
    - -
    - -
    -
    -
    - - - - - - - -
    - {{ include('buttons.submit.html.twig') }} -
    + {% if errors is not empty %} + {% for error in errors %} +

    {{ error }}

    + {% endfor %} + {% else %} + +
    +
    + + + + +
    House Search
    + + + + +
    +
    + + + + + {% endfor %} + {% endif %} + +
    +
    + Here you can see the list of all available houses, flats{{ guildString }}. + Click on any view button to get more information about a house or adjust + the search criteria and start a new search. +

    + {% if cleanOldHouse is not empty or rentType != 'never' %} + Every morning during global server save there is automatic house cleaning. Server delete house owners who have not logged in last {{ cleanOldHouse }} days{% if rentType != 'never' %} or have not paid {{ rentType }} house rent. Remember to leave money for a rent in {% if config.lua.bankSystem is not empty %}your house bank or {% else %}depo in same city where you have house!{% endif %}{% else %}.{% endif %} +

    + {% endif %} + + {% if houses is not empty or housesSearch %} + + + + + + + + {% if houses is not empty %} + + + + + + + {% elseif housesSearch %} + + {% endif %} + + + {% if houses is not empty %} + {% set i = 0 %} + {% for house in houses %} + {% set i = i + 1 %} + + + + + + + + + + - -
    + Available {{ houseType }}{% if townName is not empty %} in {{ townName }}{% endif %} on + {{ config.lua.serverName }}
    NameSizeRentStatus No {{ houseType }} with specified criterias.
    + {{ house.name }} + + {{ house.size }} + + {{ house.rent }} golds + + {{ house.rentedBy|raw }} + + + + {{ include('buttons.view.html.twig') }} - -
    - {% endif %} -
    \ No newline at end of file +
    +
    + {% endif %} + +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    House Search
    TownStatusOrder
    + {% set checked = false %} + {% for id, name in config.towns if id > 0 %} + {% if ((townId is empty and name is not empty) or id == townId) and not checked %} + {% set variable = "checked" %} + {% set checked = true %} + {% else %} + {% set variable = "" %} + {% endif %} + + + +
    + {% endfor %} +
    + +
    + + +
    + + +
    +
    + +
    + + +
    + + +
    +
    + +
    + +
    + +
    +
    +
    + + + + + + + +
    + {{ include('buttons.submit.html.twig') }} +
    +
    +
    +
    + {% endif %} +
    From 5a010aea6ffe3e3aa4dfb5b8320c1fc3fa1663e8 Mon Sep 17 00:00:00 2001 From: Elson Costa Date: Wed, 28 Aug 2024 15:26:39 -0300 Subject: [PATCH 20/42] houses: enabled world filter. --- system/pages/houses.php | 71 ++--- system/templates/houses.html.twig | 416 +++++++++++++++++------------- 2 files changed, 279 insertions(+), 208 deletions(-) diff --git a/system/pages/houses.php b/system/pages/houses.php index 585303699..2f1090435 100644 --- a/system/pages/houses.php +++ b/system/pages/houses.php @@ -1,4 +1,4 @@ -query("SELECT `id`, `name` FROM `worlds` ORDER BY `name` ASC")->fetchAll(); + $errors = array(); if (!$db->hasColumn('houses', 'name')) { $errors[] = 'Houses list is not available on this server.'; @@ -23,9 +25,10 @@ return; } -$rentType = trim(strtolower($config['lua']['houseRentPeriod'])); -if ($rentType != 'yearly' && $rentType != 'monthly' && $rentType != 'weekly' && $rentType != 'daily') +$rentType = trim(strtolower(configLua('houseRentPeriod'))); +if (!in_array($rentType, ['yearly', 'monthly', 'weekly', 'daily'])) { $rentType = 'never'; +} $state = ''; $order = ''; @@ -35,7 +38,7 @@ $beds = array("", "one", "two", "three", "fourth", "fifth"); $houseName = $_REQUEST['house']; $houseId = (Validator::number($_REQUEST['house']) ? $_REQUEST['house'] : -1); - $selectHouse = $db->query('SELECT * FROM ' . $db->tableName('houses') . ' WHERE ' . $db->fieldName('name') . ' LIKE ' . $db->quote($houseName) . ' OR `id` = ' . $db->quote($houseId)); + $selectHouse = $db->query("SELECT * FROM {$db->tableName('houses')} WHERE {$db->fieldName('name')} LIKE {$db->quote($houseName)} OR `id` = {$houseId}"); $house = array(); if ($selectHouse->rowCount() > 0) { @@ -52,7 +55,7 @@ $bedsMessage = null; $houseBeds = $house['beds']; if ($houseBeds > 0) - $bedsMessage = 'House have ' . (isset($beds[$houseBeds]) ? $beds[$houseBeds] : $houseBeds) . ' bed' . ($houseBeds > 1 ? 's' : ''); + $bedsMessage = 'House have ' . ($beds[$houseBeds] ?? $houseBeds) . ' bed' . ($houseBeds > 1 ? 's' : ''); else $bedsMessage = 'This house dont have any beds'; @@ -87,13 +90,14 @@ $twig->display('houses.view.html.twig', array( 'errors' => $errors, - 'imgPath' => isset($imgPath) ? $imgPath : null, - 'houseName' => isset($house['name']) ? $house['name'] : null, - 'bedsMessage' => isset($bedsMessage) ? $bedsMessage : null, - 'houseSize' => isset($house['size']) ? $house['size'] : null, - 'houseRent' => isset($house['rent']) ? $house['rent'] : null, - 'owner' => isset($owner) ? $owner : null, - 'rentType' => isset($rentType) ? $rentType : null + 'imgPath' => $imgPath ?? null, + 'houseName' => $house['name'] ?? null, + 'bedsMessage' => $bedsMessage ?? null, + 'houseSize' => $house['size'] ?? null, + 'houseRent' => $house['rent'] ?? null, + 'owner' => $owner ?? null, + 'rentType' => $rentType ?? null, + 'worlds' => $worlds, )); if (count($errors) > 0) { @@ -101,21 +105,26 @@ } } -$cleanOldHouse = null; -if (isset($config['lua']['houseCleanOld'])) { - $cleanOldHouse = (int)(eval('return ' . $config['lua']['houseCleanOld'] . ';') / (24 * 60 * 60)); +if ($cleanOldHouse = configLua('houseLoseAfterInactivity')) { + $days = 0; + if (in_array($rentType, ['yearly', 'monthly', 'weekly', 'daily'])) { + $days = ['yearly' => 360, 'monthly' => 30, 'weekly' => 7, 'daily' => 1]; + $cleanOldHouse = (int)$cleanOldHouse * $days[$rentType]; + } } $housesSearch = false; -if (isset($_POST['town']) && isset($_POST['state']) && isset($_POST['order']) && (isset($_POST['type']) || !$db->hasColumn('houses', 'guild'))) { - $townName = $config['towns'][$_POST['town']]; +$houses = []; +if (!empty($_POST['world']) && isset($_POST['town']) && isset($_POST['state']) && isset($_POST['order']) && (isset($_POST['type']) || !$db->hasColumn('houses', 'guild'))) { + $townName = $db->query("SELECT `id`, `name` FROM `towns` WHERE `id` = {$_POST['town']};")->fetch()['name']; + $order = $_POST['order']; - $orderby = '`name`'; + $orderBy = '`name`'; if (!empty($order)) { if ($order == 'size') - $orderby = '`size`'; + $orderBy = '`size`'; else if ($order == 'rent') - $orderby = '`rent`'; + $orderBy = '`rent`'; } $town = 'town'; @@ -124,12 +133,14 @@ else if ($db->hasColumn('houses', 'townid')) $town = 'townid'; - $whereby = '`' . $town . '` = ' . (int)$_POST['town']; + $worldName = $db->query("SELECT `name` FROM `worlds` WHERE id = {$_POST['world']}")->fetch()['name']; + + $whereby = "`world_id` = {$_POST['world']} AND `$town` = {$_POST['town']}"; $state = $_POST['state']; if (!empty($state)) $whereby .= ' AND `owner` ' . ($state == 'free' ? '' : '!') . '= 0'; - $type = isset($_POST['type']) ? $_POST['type'] : NULL; + $type = $_POST['type'] ?? NULL; if ($type == 'guildhalls' && !$db->hasColumn('houses', 'guild')) $type = 'all'; @@ -146,16 +157,15 @@ } } - $houses_info = $db->query('SELECT * FROM `houses` WHERE ' . $whereby . ' ORDER BY ' . $orderby); + $houses_info = $db->query('SELECT * FROM `houses` WHERE ' . $whereby . ' ORDER BY ' . $orderBy); $players_info = $db->query("SELECT `houses`.`id` AS `houseid` , `players`.`name` AS `ownername` FROM `houses` , `players` , `accounts` WHERE `players`.`id` = `houses`.`owner` AND `accounts`.`id` = `players`.`account_id`"); $players = array(); foreach ($players_info->fetchAll() as $player) $players[$player['houseid']] = array('name' => $player['ownername']); - $houses = array(); foreach ($houses_info->fetchAll() as $house) { - $owner = isset($players[$house['id']]) ? $players[$house['id']] : array(); + $owner = $players[$house['id']] ?? array(); $houseRent = null; if ($db->hasColumn('houses', 'guild') && $house['guild'] == 1 && $house['owner'] != 0) { @@ -181,10 +191,13 @@ 'order' => $order, 'type' => $type, 'houseType' => $type == 'guildhalls' ? 'Guildhalls' : 'Houses and Flats', - 'townName' => isset($townName) ? $townName : null, - 'townId' => isset($_POST['town']) ? $_POST['town'] : null, + 'townName' => $townName ?? null, + 'townId' => $_POST['town'] ?? null, 'guild' => $guild, - 'cleanOldHouse' => isset($cleanOld) ? $cleanOld : null, + 'rentType' => $rentType ?? null, + 'cleanOldHouse' => $cleanOldHouse, + 'houses' => $houses ?? [], 'housesSearch' => $housesSearch, - 'houses' => isset($houses) ? $houses : null + 'worlds' => $worlds, + 'worldName' => $worldName ?? null, )); diff --git a/system/templates/houses.html.twig b/system/templates/houses.html.twig index 3d1945987..c4096cf63 100644 --- a/system/templates/houses.html.twig +++ b/system/templates/houses.html.twig @@ -1,188 +1,246 @@ -
    - {% if errors is not empty %} - {% for error in errors %} -

    {{ error }}

    - {% endfor %} - {% else %} - -
    -
    - - - - -
    House Search
    - - - - -
    -
    - +Here you can see the list of all available houses, flats or guildhalls. Please select the game world of your choice. Click on any view button to get more information about a house or adjust the search criteria and start a new search. See the manual for a detailed description about renting houses. +

    +{% if rentType != 'never' %} + Every morning during global server save there is automatic house cleaning. Server delete house owners who have not logged in last {{ cleanOldHouse }} days{% if rentType != 'never' %} or have not paid {{ rentType }} house rent. Remember to leave money for a rent in your bank.{% endif %} +

    +{% endif %} + +
    +{% if errors is not empty %} + {% for error in errors %} +

    {{ error }}

    + {% endfor %} +{% else %} + {% if housesSearch %} +
    + +
    -
    - Here you can see the list of all available houses, flats{{ guildString }}. - Click on any view button to get more information about a house or adjust - the search criteria and start a new search. -

    - {% if cleanOldHouse is not empty or rentType != 'never' %} - Every morning during global server save there is automatic house cleaning. Server delete house owners who have not logged in last {{ cleanOldHouse }} days{% if rentType != 'never' %} or have not paid {{ rentType }} house rent. Remember to leave money for a rent in {% if config.lua.bankSystem is not empty %}your house bank or {% else %}depo in same city where you have house!{% endif %}{% else %}.{% endif %} -

    - {% endif %} - - {% if houses is not empty or housesSearch %} - - - - - - - - {% if houses is not empty %} - - - - - - - {% elseif housesSearch %} - - {% endif %} - - - {% if houses is not empty %} - {% set i = 0 %} - {% for house in houses %} - {% set i = i + 1 %} - - - - - - - - - - - - {% endfor %} - {% endif %} - -
    - Available {{ houseType }}{% if townName is not empty %} in {{ townName }}{% endif %} on - {{ config.lua.serverName }}
    NameSizeRentStatus No {{ houseType }} with specified criterias.
    - {{ house.name }} - - {{ house.size }} - - {{ house.rent }} golds - - {{ house.rentedBy|raw }} - -
    - - {{ include('buttons.view.html.twig') }} -
    -
    -
    - {% endif %} - -
    - - - - - - - - - - - - - - + + +
    House Search
    TownStatusOrder
    - {% set checked = false %} - {% for id, name in config.towns if id > 0 %} - {% if ((townId is empty and name is not empty) or id == townId) and not checked %} - {% set variable = "checked" %} - {% set checked = true %} +
    +
    +
    + + + + +
    + Available {{ houseType }}{% if townName is not empty %} in {{ townName }}{% endif %} + {% if worldName is not empty %} on {{ worldName }}{% endif %} +
    + + + + +
    +
    + + + + +
    +
    + + + + + + + + + + {% if houses is not empty %} + {% set i = 0 %} + {% for house in houses %} + {% set i = i + 1 %} + + + + + + + + + + + + {% endfor %} {% else %} - {% set variable = "" %} + {% endif %} - - - -
    - {% endfor %} - - - - - - - - - - - -
    NameSizeRentStatus 
    + {{ house.name }} + + {{ house.size }} + + {{ house.rent }} golds + + {{ house.rentedBy|raw }} + + + + {{ include('buttons.view.html.twig') }} + +
    No {{ houseType|replace({'and': 'or'}) }} found. - -
    - - -
    - - -
    -
    - -
    - - -
    - - -
    -
    - -
    - -
    - -
    -
    -
    - - - - - - - -
    - {{ include('buttons.submit.html.twig') }} -
    - +
    +
    +
    +

    {% endif %} -
    + + + + + + + +
    +
    +
    +
    + + + + +
    + House Search +
    + + + + +
    +
    + + + + + +
    +
    +
    + + + + + + + +
    World + +
    + + + + + + + + + + + + + + + + + + + + + +
    TownStatusOrder
    + {% set checked = false %} + {% for id, name in config.towns if id > 0 %} + {% if ((townId is empty and name is not empty) or id == townId) and not checked %} + {% set variable = "checked" %} + {% set checked = true %} + {% else %} + {% set variable = "" %} + {% endif %} + + + +
    + {% endfor %} +
    + +
    + + +
    + + +
    +
    + +
    + + +
    + + +
    +
    + +
    + +
    + +
    +
    +
    + + + + + + + +
    + {{ include('buttons.submit.html.twig') }} +
    +
    +
    +
    +
    +
    +{% endif %} From 7e8376adc66fb2c1f9f61c9335bfec38b3ee572e Mon Sep 17 00:00:00 2001 From: Elson Costa Date: Wed, 28 Aug 2024 15:54:12 -0300 Subject: [PATCH 21/42] houses: fixes on house viewer. --- system/pages/houses.php | 17 ++--- system/templates/houses.html.twig | 4 +- system/templates/houses.view.html.twig | 99 ++++++++++++++------------ 3 files changed, 61 insertions(+), 59 deletions(-) diff --git a/system/pages/houses.php b/system/pages/houses.php index 2f1090435..6c126b399 100644 --- a/system/pages/houses.php +++ b/system/pages/houses.php @@ -40,7 +40,7 @@ $houseId = (Validator::number($_REQUEST['house']) ? $_REQUEST['house'] : -1); $selectHouse = $db->query("SELECT * FROM {$db->tableName('houses')} WHERE {$db->fieldName('name')} LIKE {$db->quote($houseName)} OR `id` = {$houseId}"); - $house = array(); + $house = []; if ($selectHouse->rowCount() > 0) { $house = $selectHouse->fetch(); $houseId = $house['id']; @@ -55,9 +55,9 @@ $bedsMessage = null; $houseBeds = $house['beds']; if ($houseBeds > 0) - $bedsMessage = 'House have ' . ($beds[$houseBeds] ?? $houseBeds) . ' bed' . ($houseBeds > 1 ? 's' : ''); + $bedsMessage = 'House have ' . ($beds[$houseBeds] ?? $houseBeds) . ' bed' . ($houseBeds > 1 ? 's' : '') . "."; else - $bedsMessage = 'This house dont have any beds'; + $bedsMessage = 'This house dont have any beds.'; $houseOwner = $house['owner']; if ($houseOwner > 0) { @@ -94,15 +94,14 @@ 'houseName' => $house['name'] ?? null, 'bedsMessage' => $bedsMessage ?? null, 'houseSize' => $house['size'] ?? null, - 'houseRent' => $house['rent'] ?? null, + 'houseRent' => isset($house['rent']) ? $house['rent'] / 1000 : 0, 'owner' => $owner ?? null, 'rentType' => $rentType ?? null, 'worlds' => $worlds, + 'worldName' => getWorldName($house['world_id']), )); - if (count($errors) > 0) { - return; - } + return; } if ($cleanOldHouse = configLua('houseLoseAfterInactivity')) { @@ -133,8 +132,6 @@ else if ($db->hasColumn('houses', 'townid')) $town = 'townid'; - $worldName = $db->query("SELECT `name` FROM `worlds` WHERE id = {$_POST['world']}")->fetch()['name']; - $whereby = "`world_id` = {$_POST['world']} AND `$town` = {$_POST['town']}"; $state = $_POST['state']; if (!empty($state)) @@ -199,5 +196,5 @@ 'houses' => $houses ?? [], 'housesSearch' => $housesSearch, 'worlds' => $worlds, - 'worldName' => $worldName ?? null, + 'worldName' => getWorldName($_POST['world'] ?? 0), )); diff --git a/system/templates/houses.html.twig b/system/templates/houses.html.twig index c4096cf63..e6dc2fbc4 100644 --- a/system/templates/houses.html.twig +++ b/system/templates/houses.html.twig @@ -19,8 +19,8 @@ Here you can see the list of all available houses, flats or guildhalls. Please s
    - + - {% if errors is not empty %} - {% for error in errors %} -

    {{ error }}

    - {% endfor %} - {% else %} - -
    -
    - - - - -
    {{ houseName }}
    - - - - -
    -
    - +{% if errors is not empty %} + {% for error in errors %} +

    {{ error }}

    + {% endfor %} +{% else %} +
    + + + + +
    +
    + - + - -

    \ No newline at end of file + + + + + +
    -
    - - - - - -
    - {{ bedsMessage }} and has a size of {{ houseSize }} square meters. + +
    + + + + - -
    {{ houseName }} + {{ houseName }}
    - {% if rentType != 'never' %} - The {{ rentType }} is {{ houseRent }} gold and will be debited to the bank account on {{ config.lua.serverName }}. - {% endif %} -
    + {{ bedsMessage }}

    + The house has a size of {{ houseSize }} square meters. + {% if rentType != 'never' and houseRent > 0 %} + The {{ rentType }} rent is {{ houseRent }}k + gold and will be debited to the bank account on + {{ worldName }}. + {% endif %} +

    - {% if owner is not empty %} - The house has been rented by {{ owner|raw }}. - {% else %} - No one has bought this house yet. - {% endif %} -
    -
    -
    - {% endif %} + {% if owner is not empty %} + The house has been rented by {{ owner|raw }}. + {% else %} + No one has bought this house yet. + {% endif %} +
    + {{ include('buttons.back.html.twig') }} +
    +
    +
    +
    + + + +

    +{% endif %} From 8dbcf22c2fdb2098731addf01b64aba28bf2ef4c Mon Sep 17 00:00:00 2001 From: Elson Costa Date: Wed, 28 Aug 2024 17:20:27 -0300 Subject: [PATCH 22/42] guilds: enabled world filter. --- system/pages/guilds.php | 36 +-- system/pages/guilds/list_of_guilds.php | 46 ++-- system/templates/guilds.list.html.twig | 365 +++++++++++++++---------- 3 files changed, 265 insertions(+), 182 deletions(-) diff --git a/system/pages/guilds.php b/system/pages/guilds.php index 95e0e6d69..3999ae5ec 100644 --- a/system/pages/guilds.php +++ b/system/pages/guilds.php @@ -1,4 +1,5 @@ hasTable('guild_members')) - define('GUILD_MEMBERS_TABLE', 'guild_members'); +if ($db->hasTable('guild_members')) + define('GUILD_MEMBERS_TABLE', 'guild_members'); else - define('GUILD_MEMBERS_TABLE', 'guild_membership'); + define('GUILD_MEMBERS_TABLE', 'guild_membership'); define('MOTD_EXISTS', $db->hasColumn('guilds', 'motd')); -//show list of guilds -if(empty($action)) { - require PAGES . 'guilds/list_of_guilds.php'; +$world = null; +$worlds = $db->query("SELECT `id`, `name` FROM `worlds` ORDER BY `name` ASC")->fetchAll(); +if ($worldId = $_POST['world'] ?? null) { + $world = $db->query("SELECT `id`, `name` FROM `worlds` WHERE `id` = $worldId")->fetch(); } -else { - if(!ctype_alnum(str_replace(array('-', '_'), '', $action))) { - error('Error: Action contains illegal characters.'); - } - else if(file_exists(PAGES . 'guilds/' . $action . '.php')) { - require PAGES . 'guilds/' . $action . '.php'; - } - else { - error('This page does not exists.'); - } + +//show list of guilds +if (empty($action)) { + require PAGES . 'guilds/list_of_guilds.php'; +} else { + if (!ctype_alnum(str_replace(array('-', '_'), '', $action))) { + error('Error: Action contains illegal characters.'); + } else if (file_exists(PAGES . "guilds/{$action}.php")) { + require PAGES . "guilds/{$action}.php"; + } else { + error('This page does not exists.'); + } } diff --git a/system/pages/guilds/list_of_guilds.php b/system/pages/guilds/list_of_guilds.php index 4da525f04..41d408611 100644 --- a/system/pages/guilds/list_of_guilds.php +++ b/system/pages/guilds/list_of_guilds.php @@ -1,4 +1,4 @@ -orderBy("name"); +$guilds = []; +if ($world) { + $guildList = new OTS_Guilds_List(); + $filter = new OTS_SQLFilter(); + $filter->compareField('world_id', (int)$world['id']); + $guildList->setFilter($filter); + $guildList->orderBy("name"); -$guilds = array(); -if(count($guilds_list) > 0) -{ - foreach ($guilds_list as $guild) { - $guild_logo = $guild->getCustomField('logo_name'); - if (empty($guild_logo) || !file_exists('images/guilds/' . $guild_logo)) - $guild_logo = "default.gif"; + foreach ($guildList as $guild) { + $guild_logo = $guild->getCustomField('logo_name'); + if (empty($guild_logo) || !file_exists('images/guilds/' . $guild_logo)) + $guild_logo = "default.gif"; - $description = $guild->getCustomField('description'); - $description_with_lines = str_replace(array("\r\n", "\n", "\r"), '
    ', $description, $count); - if ($count < $config['guild_description_lines_limit']) - $description = nl2br($description); + $description = $guild->getCustomField('description'); + $description_with_lines = str_replace(array("\r\n", "\n", "\r"), '
    ', $description, $count); + if ($count < $config['guild_description_lines_limit']) + $description = nl2br($description); - $guildName = $guild->getName(); - $guilds[] = array('name' => $guildName, 'logo' => $guild_logo, 'link' => getGuildLink($guildName, false), 'description' => $description); - } -}; + $guildName = $guild->getName(); + $guilds[] = ['name' => $guildName, 'logo' => $guild_logo, 'link' => getGuildLink($guildName, false), 'description' => $description]; + } +} $twig->display('guilds.list.html.twig', array( - 'guilds' => $guilds, - 'logged' => isset($logged) ? $logged : false, - 'isAdmin' => admin(), + 'guilds' => $guilds, + 'logged' => $logged ?? false, + 'isAdmin' => admin(), + 'worlds' => $worlds, + 'world' => $world ?? null, )); diff --git a/system/templates/guilds.list.html.twig b/system/templates/guilds.list.html.twig index bd445db49..ec954665f 100644 --- a/system/templates/guilds.list.html.twig +++ b/system/templates/guilds.list.html.twig @@ -2,160 +2,235 @@ Please select the game world of your choice to see the list of all existing guil


    -
    -
    -
    - - - - -
    Active Guilds on {{ config.lua.serverName }}
    - - - - +{% if worlds|length > 1 %} + + + + + + +
    +
    +
    +
    + + + + +
    World Selection
    + + + + +
    +
    + + + + + + +
    +
    + + + + + + + + + + +
    World Name: + + {% set button_name = 'Submit' %} + {% include('buttons.base.html.twig') %}
    +
    +
    +
    +

    +{% endif %} + +{% if world %} +
    +
    +
    + + + + +
    Active Guilds on {{ world.name }}
    + + + + +
    - - + + + + +
    +
    + + + - - + + +
    -
    - - - - + + {% endfor %} + {% else %} + + + + {% if logged %} + + {% endif %} + + {% endif %} + +
    - -
    -
    - - - {% if guilds|length > 0 %} - - - - - - - {% set i = 0 %} - {% for guild in guilds %} - {% set i = i + 1 %} - - - - - - - - {% endfor %} - {% else %} - - - - {% if logged %} - - {% endif %} - - {% endif %} - -
    LogoDescription 
    - - - - {{ guild.name }}{% if isAdmin %} [DELETE]{% endif %} - - - {% if guild.description is not empty %} -
    - {{ guild.description|raw }} - {% endif %} -
    - - - - - - -
    -
    - {{ include('buttons.view.html.twig') }} -
    -
    -
    - Create Guild -
    - Actually there is no guild on server.{% if logged %} Create first! Press button "Create Guild"{% endif %} -
    - - - - {% set button_name = 'Found Guild' %} - {% set button_image = '_sbutton_foundguild' %} - {% include('buttons.base.html.twig') %} - - -
    -
    -
    -
    - +
    +
    + + + {% if guilds|length > 0 %} + + + + + + + {% set i = 0 %} + {% for guild in guilds %} + {% set i = i + 1 %} + + + + + + + +
    LogoDescription 
    + + + + {{ guild.name }}{% if isAdmin %} [DELETE]{% endif %} + + + {% if guild.description is not empty %} +
    + {{ guild.description|raw }} + {% endif %} +
    + + + + - - -
    +
    + {{ include('buttons.view.html.twig') }} +
    +
    +
    + Create Guild +
    + Actually there is no guild on + server.{% if logged %} Create first! Press button "Create Guild"{% endif %} +
    + + + + {% set button_name = 'Found Guild' %} + {% set button_image = '_sbutton_foundguild' %} + {% include('buttons.base.html.twig') %} + + +
    +
    + +
    +
    +
    -
    -
    +
    +
    - +
    - - - - - - - + + + + + + + -
    - - - - - {% if logged %} - No guild found that suits your needs? - - {% set button_name = 'Found Guild' %} - {% set button_image = '_sbutton_foundguild' %} - {% include('buttons.base.html.twig') %} - - {% else %} - Before you can create a guild you must login. -
    - - {% include('buttons.login.html.twig') %} - - {% endif %} - -
    - - {% if logged %} -
    - If you have any problem with guilds try: -
    - Cleanup players - can't join guild/be invited? Can't create guild? Try cleanup players. -
    - Cleanup guilds - made guild, you are a leader, but you are not on players list? Cleanup guilds! - {% endif %} -
    - -
    + + + + + {% if logged %} + No guild found that suits your needs? +
    + + {% set button_name = 'Found Guild' %} + {% set button_image = '_sbutton_foundguild' %} + {% include('buttons.base.html.twig') %} + + {% else %} + Before you can create a guild you must login. +
    + + {% include('buttons.login.html.twig') %} + + {% endif %} + +
    + + {% if logged %} +
    + If you have any problem with guilds try: +
    + Cleanup + players - can't join guild/be invited? Can't create guild? Try cleanup players. +
    + Cleanup + guilds - made guild, you are a leader, but you are not on players list? Cleanup guilds! + {% endif %} +
    + +
    - - - - + +{% endif %} From 53dae6b4182c9b2411f9cd020c605f3dba859ad7 Mon Sep 17 00:00:00 2001 From: Elson Costa Date: Thu, 29 Aug 2024 11:19:24 -0300 Subject: [PATCH 23/42] guilds: adjusted world filter on subpages. --- admin/pages/worlds.php | 5 +- system/libs/pot/OTS_Account.php | 6 +- system/libs/pot/OTS_Guild.php | 69 ++++-- system/pages/guilds.php | 10 +- system/pages/guilds/create.php | 165 ++++++------- system/pages/guilds/manager.php | 75 +++--- system/pages/guilds/show.php | 228 ++++++++---------- system/templates/guilds.create.html.twig | 140 ++++++----- .../templates/guilds.create.success.html.twig | 29 +-- system/templates/guilds.list.html.twig | 14 +- system/templates/guilds.manager.html.twig | 220 +++++++++-------- system/templates/guilds.view.html.twig | 12 +- system/templates/online.html.twig | 4 +- templates/tibiacom/buttons.back.html.twig | 5 +- templates/tibiacom/buttons.base.html.twig | 3 + templates/tibiacom/buttons.submit.html.twig | 5 +- 16 files changed, 523 insertions(+), 467 deletions(-) diff --git a/admin/pages/worlds.php b/admin/pages/worlds.php index 4af53fbfd..9606c3d4b 100644 --- a/admin/pages/worlds.php +++ b/admin/pages/worlds.php @@ -71,10 +71,11 @@ function echo_error($message) if (!$error) { try { + $godName = "GOD on {$name}"; $db->exec("INSERT INTO `worlds` (`name`, `type`, `ip`, `port`) VALUES ({$db->quote($name)}, {$db->quote($type)}, {$db->quote($ip)}, {$port});"); - $sql = "INSERT INTO `players` (`name`, `group_id`, `account_id`, `level`, `vocation`, `health`, `healthmax`, `experience`, `lookbody`, `lookfeet`, `lookhead`, `looklegs`, `looktype`, `maglevel`, `mana`, `manamax`, `manaspent`, `town_id`, `conditions`, `cap`, `sex`, `skill_club`, `skill_club_tries`, `skill_sword`, `skill_sword_tries`, `skill_axe`, `skill_axe_tries`, `skill_dist`, `skill_dist_tries`, `world_id`) VALUES ('GOD {$name}', 6, {$account_logged->getId()}, 2, 0, 155, 155, 100, 113, 115, 95, 39, 75, 0, 60, 60, 0, 8, '', 410, 1, 10, 0, 10, 0, 10, 0, 10, 0, {$db->lastInsertId()})"; + $sql = "INSERT INTO `players` (`name`, `group_id`, `account_id`, `level`, `vocation`, `health`, `healthmax`, `experience`, `lookbody`, `lookfeet`, `lookhead`, `looklegs`, `looktype`, `maglevel`, `mana`, `manamax`, `manaspent`, `town_id`, `conditions`, `cap`, `sex`, `skill_club`, `skill_club_tries`, `skill_sword`, `skill_sword_tries`, `skill_axe`, `skill_axe_tries`, `skill_dist`, `skill_dist_tries`, `world_id`) VALUES ('{$godName}', 6, {$account_logged->getId()}, 2, 0, 155, 155, 100, 113, 115, 95, 39, 75, 0, 60, 60, 0, 8, '', 410, 1, 10, 0, 10, 0, 10, 0, 10, 0, {$db->lastInsertId()})"; $db->query($sql); - echo_success("World {$name} and 'GOD {$name}' created at: " . date('G:i')); + echo_success("World {$name} and '{$godName}' created at: " . date('G:i')); $action = "list"; // header("Location: $base"); // $twig->display('success.html.twig', array( diff --git a/system/libs/pot/OTS_Account.php b/system/libs/pot/OTS_Account.php index b2b424b84..c4d5a3866 100644 --- a/system/libs/pot/OTS_Account.php +++ b/system/libs/pot/OTS_Account.php @@ -740,7 +740,7 @@ public function getPlayers() * @version 0.1.4 * @since 0.0.5 */ - public function getPlayersList($withDeleted = true) + public function getPlayersList($withDeleted = true, $worldId = null) { if (!isset($this->data['id'])) { throw new E_OTS_NotLoaded(); @@ -759,6 +759,10 @@ public function getPlayersList($withDeleted = true) } } + if ($worldId) { + $filter->compareField('world_id', $worldId); + } + // creates list object $list = new OTS_Players_List(); $list->setFilter($filter); diff --git a/system/libs/pot/OTS_Guild.php b/system/libs/pot/OTS_Guild.php index d4e01b6e8..f546d94c2 100644 --- a/system/libs/pot/OTS_Guild.php +++ b/system/libs/pot/OTS_Guild.php @@ -132,7 +132,7 @@ public function load($id) $creationdata = 'creation_time'; // SELECT query on database - $this->data = $this->db->query('SELECT `id`, `name`, `' . $ownerid . '` as `ownerid`, `' . $creationdata . '` as `creationdata` FROM `guilds` WHERE `id` = ' . (int) $id)->fetch(); + $this->data = $this->db->query('SELECT `id`, `name`, `' . $ownerid . '` as `ownerid`, `' . $creationdata . '` as `creationdata`, `world_id` FROM `guilds` WHERE `id` = ' . (int) $id)->fetch(); } /** @@ -174,33 +174,30 @@ public function isLoaded() * @version 0.0.5 * @throws PDOException On PDO operation error. */ - public function save() - { - $ownerid = 'ownerid'; - if($this->db->hasColumn('guilds', 'owner_id')) - $ownerid = 'owner_id'; + public function save() + { + $ownerid = 'ownerid'; + if ($this->db->hasColumn('guilds', 'owner_id')) + $ownerid = 'owner_id'; - $creationdata = 'creationdata'; - if($this->db->hasColumn('guilds', 'creationdate')) - $creationdata = 'creationdate'; - else if($this->db->hasColumn('guilds', 'creation_time')) - $creationdata = 'creation_time'; + $creationdata = 'creationdata'; + if ($this->db->hasColumn('guilds', 'creationdate')) + $creationdata = 'creationdate'; + else if ($this->db->hasColumn('guilds', 'creation_time')) + $creationdata = 'creation_time'; - // updates existing guild - if( isset($this->data['id']) ) - { - // UPDATE query on database - $this->db->exec('UPDATE `guilds` SET `name` = ' . $this->db->quote($this->data['name']) . ', `' . $ownerid . '` = ' . $this->data['ownerid'] . ', `' . $creationdata . '` = ' . $this->data['creationdata'] . ' WHERE `id` = ' . $this->data['id']); - } - // creates new guild - else - { - // INSERT query on database - $this->db->exec("INSERT INTO `guilds` (`name`, `" . $ownerid . "`, `" . $creationdata . "`, `description`) VALUES (" . $this->db->quote($this->data['name']) . ", " . $this->data['ownerid'] . ", " . $this->data['creationdata'] . ", '')"); - // ID of new group - $this->data['id'] = $this->db->lastInsertId(); - } + // updates existing guild + if (isset($this->data['id'])) { + // UPDATE query on database + $this->db->exec('UPDATE `guilds` SET `name` = ' . $this->db->quote($this->data['name']) . ', `' . $ownerid . '` = ' . $this->data['ownerid'] . ', `' . $creationdata . '` = ' . $this->data['creationdata'] . ' WHERE `id` = ' . $this->data['id']); + } // creates new guild + else { + // INSERT query on database + $this->db->exec("INSERT INTO `guilds` (`name`, `$ownerid`, `$creationdata`, `description`, `world_id`) VALUES ({$this->db->quote($this->data['name'])}, {$this->data['ownerid']}, {$this->data['creationdata']}, '', {$this->data['world_id']})"); + // ID of new group + $this->data['id'] = $this->db->lastInsertId(); } + } /** * Guild ID. @@ -283,6 +280,21 @@ public function setOwner(OTS_Player $owner) $this->data['ownerid'] = $owner->getId(); } + public function getWorldId() + { + if( !isset($this->data['world_id']) ) + { + throw new E_OTS_NotLoaded(); + } + + return $this->data['world_id']; + } + + public function setWorldId(int $worldId) + { + $this->data['world_id'] = $worldId; + } + public function hasMember(OTS_Player $player) { global $db; @@ -767,6 +779,9 @@ public function __get($name) case 'requests': return $this->listRequests(); + case 'worldId': + return $this->getWorldId(); + default: throw new OutOfBoundsException(); } @@ -806,6 +821,10 @@ public function __set($name, $value) $this->setRequestsDriver($value); break; + case 'worldId': + $this->setWorldId($value); + break; + default: throw new OutOfBoundsException(); } diff --git a/system/pages/guilds.php b/system/pages/guilds.php index 3999ae5ec..02d203820 100644 --- a/system/pages/guilds.php +++ b/system/pages/guilds.php @@ -1,5 +1,4 @@ -query("SELECT `id`, `name` FROM `worlds` ORDER BY `name` ASC")->fetchAll(); -if ($worldId = $_POST['world'] ?? null) { +if ($worldId = $_POST['world_id'] ?? null) { $world = $db->query("SELECT `id`, `name` FROM `worlds` WHERE `id` = $worldId")->fetch(); } +if (!empty($action) && in_array($action, ['create']) && !$world) { + header('Location: ' . BASE_URL . '?subtopic=guilds'); + return; +} + //show list of guilds if (empty($action)) { require PAGES . 'guilds/list_of_guilds.php'; diff --git a/system/pages/guilds/create.php b/system/pages/guilds/create.php index f8ecbc583..19464cc32 100644 --- a/system/pages/guilds/create.php +++ b/system/pages/guilds/create.php @@ -1,4 +1,4 @@ -getPlayersList(false); - foreach ($account_players as $player) { - $player_rank = $player->getRank(); - if (!$player_rank->isLoaded()) { - if ($player->getLevel() >= $config['guild_need_level']) { - if (!$config['guild_need_premium'] || $account_logged->isPremium()) { - $array_of_player_nig[] = $player->getName(); - } - } + $account_players = $account_logged->getPlayersList(false, $world['id']); + foreach ($account_players as $player) { + $player_rank = $player->getRank(); + if (!$player_rank->isLoaded()) { + if ($player->getLevel() >= $config['guild_need_level']) { + if (!$config['guild_need_premium'] || $account_logged->isPremium()) { + $array_of_player_nig[] = $player->getName(); } + } } + } } if (empty($todo)) { - if (count($array_of_player_nig) == 0) { - $guild_errors[] = 'On your account all characters are in guilds, have too low level to create new guild' . ($config['guild_need_premium'] ? ' or you don\' have a premium account' : '') . '.'; - } + if (count($array_of_player_nig) == 0) { + $guild_errors[] = 'On your account all characters are in guilds, have too low level to create new guild' . ($config['guild_need_premium'] ? ' or you don\' have a premium account' : '') . '.'; + } } if ($todo == 'save') { - if (!Validator::guildName($guild_name)) { - $guild_errors[] = Validator::getLastError(); - $guild_name = ''; - } + if (!Validator::guildName($guild_name)) { + $guild_errors[] = Validator::getLastError(); + $guild_name = ''; + } - if (!Validator::characterName($name)) { - $guild_errors[] = 'Invalid character name format.'; - $name = ''; - } + if (!Validator::characterName($name)) { + $guild_errors[] = 'Invalid character name format.'; + $name = ''; + } - if (empty($guild_errors)) { - $player = new OTS_Player(); - $player->find($name); - if (!$player->isLoaded()) { - $guild_errors[] = 'Character ' . $name . ' doesn\'t exist.'; - } + if (empty($guild_errors)) { + $player = new OTS_Player(); + $player->find($name); + if (!$player->isLoaded()) { + $guild_errors[] = 'Character ' . $name . ' doesn\'t exist.'; } + } - if (empty($guild_errors)) { - $guild = new OTS_Guild(); - $guild->find($guild_name); - if ($guild->isLoaded()) { - $guild_errors[] = 'Guild ' . $guild_name . ' already exist. Select other name.'; - } + if (empty($guild_errors)) { + $guild = new OTS_Guild(); + $guild->find($guild_name); + if ($guild->isLoaded()) { + $guild_errors[] = 'Guild ' . $guild_name . ' already exist. Select other name.'; } + } - if (empty($guild_errors) && $player->isDeleted()) { - $guild_errors[] = "Character $name has been deleted."; - } + if (empty($guild_errors) && $player->isDeleted()) { + $guild_errors[] = "Character $name has been deleted."; + } - if (empty($guild_errors)) { - $bad_char = true; - foreach ($array_of_player_nig as $nick_from_list) { - if ($nick_from_list == $player->getName()) { - $bad_char = false; - } - } - if ($bad_char) { - $guild_errors[] = 'Character ' . $name . ' isn\'t on your account or is already in guild.'; - } + if (empty($guild_errors)) { + $bad_char = true; + foreach ($array_of_player_nig as $nick_from_list) { + if ($nick_from_list == $player->getName()) { + $bad_char = false; + } + } + if ($bad_char) { + $guild_errors[] = 'Character ' . $name . ' isn\'t on your account or is already in guild.'; } + } - if (empty($guild_errors)) { - if ($player->getLevel() < $config['guild_need_level']) { - $guild_errors[] = 'Character ' . $name . ' has too low level. To create guild you need character with level ' . $config['guild_need_level'] . '.'; - } - if ($config['guild_need_premium'] && !$account_logged->isPremium()) { - $guild_errors[] = 'Character ' . $name . ' is on FREE account. To create guild you need PREMIUM account.'; - } + if (empty($guild_errors)) { + if ($player->getLevel() < $config['guild_need_level']) { + $guild_errors[] = 'Character ' . $name . ' has too low level. To create guild you need character with level ' . $config['guild_need_level'] . '.'; + } + if ($config['guild_need_premium'] && !$account_logged->isPremium()) { + $guild_errors[] = 'Character ' . $name . ' is on FREE account. To create guild you need PREMIUM account.'; } + } } if (!empty($guild_errors)) { - $twig->display('error_box.html.twig', array('errors' => $guild_errors)); - unset($todo); + $twig->display('error_box.html.twig', array('errors' => $guild_errors)); + unset($todo); } if (isset($todo) && $todo == 'save') { - $new_guild = new OTS_Guild(); - $new_guild->setCreationData(time()); - $new_guild->setName($guild_name); - $new_guild->setOwner($player); - $new_guild->save(); - $new_guild->setCustomField('description', 'New guild. Leader must edit this text :)'); - //$new_guild->setCustomField('creationdata', time()); - $ranks = $new_guild->getGuildRanksList(); - $ranks->orderBy('level', POT::ORDER_DESC); - foreach ($ranks as $rank) { - if ($rank->getLevel() == 3) { - $player->setRank($rank); - } + $new_guild = new OTS_Guild(); + $new_guild->setCreationData(time()); + $new_guild->setName($guild_name); + $new_guild->setOwner($player); + $new_guild->setWorldId($world['id'] ?? $_POST['world_id']); + $new_guild->save(); + $new_guild->setCustomField('description', 'New guild. Leader must edit this text :)'); + //$new_guild->setCustomField('creationdata', time()); + $ranks = $new_guild->getGuildRanksList(); + $ranks->orderBy('level', POT::ORDER_DESC); + foreach ($ranks as $rank) { + if ($rank->getLevel() == 3) { + $player->setRank($rank); } - $twig->display('guilds.create.success.html.twig', array( - 'guild_name' => $guild_name, - 'leader_name' => $player->getName() - )); + } + $twig->display('guilds.create.success.html.twig', array( + 'guild_name' => $guild_name, + 'leader_name' => $player->getName(), + 'world' => $world, + )); - /*$db->exec('INSERT INTO `guild_ranks` (`id`, `guild_id`, `name`, `level`) VALUES (null, '.$new_guild->getId().', "the Leader", 3)'); - $db->exec('INSERT INTO `guild_ranks` (`id`, `guild_id`, `name`, `level`) VALUES (null, '.$new_guild->getId().', "a Vice-Leader", 2)'); - $db->exec('INSERT INTO `guild_ranks` (`id`, `guild_id`, `name`, `level`) VALUES (null, '.$new_guild->getId().', "a Member", 1)');*/ + /*$db->exec('INSERT INTO `guild_ranks` (`id`, `guild_id`, `name`, `level`) VALUES (null, '.$new_guild->getId().', "the Leader", 3)'); + $db->exec('INSERT INTO `guild_ranks` (`id`, `guild_id`, `name`, `level`) VALUES (null, '.$new_guild->getId().', "a Vice-Leader", 2)'); + $db->exec('INSERT INTO `guild_ranks` (`id`, `guild_id`, `name`, `level`) VALUES (null, '.$new_guild->getId().', "a Member", 1)');*/ } else { - sort($array_of_player_nig); - $twig->display('guilds.create.html.twig', array( - 'players' => $array_of_player_nig - )); + sort($array_of_player_nig); + $twig->display('guilds.create.html.twig', array( + 'players' => $array_of_player_nig, + 'world' => $world, + )); } diff --git a/system/pages/guilds/manager.php b/system/pages/guilds/manager.php index a073fe9d9..74a898695 100644 --- a/system/pages/guilds/manager.php +++ b/system/pages/guilds/manager.php @@ -1,4 +1,5 @@ find($guild_name); - if(!$guild->isLoaded()) { - $errors[] = 'Guild with name '.$guild_name.' doesn\'t exist.'; - } +if (empty($errors)) { + $guild = new OTS_Guild(); + $guild->find($guild_name); + if (!$guild->isLoaded()) { + $errors[] = 'Guild with name ' . $guild_name . ' doesn\'t exist.'; + } } -if(empty($errors)) { - if($logged) { - $guild_leader_char = $guild->getOwner(); - $rank_list = $guild->getGuildRanksList(); - $rank_list->orderBy('level', POT::ORDER_DESC); - $guild_leader = false; - $account_players = $account_logged->getPlayers(); - foreach($account_players as $player) { - if($guild_leader_char->getId() == $player->getId()) { - $guild_vice = true; - $guild_leader = true; - $level_in_guild = 3; - } - } - if($guild_leader) { - $twig->display('guilds.manager.html.twig', array( - 'guild' => $guild, - 'rank_list' => $rank_list - )); - } - else - { - $errors[] = 'You are not a leader of guild!'; - } - } - else - { - $errors[] = 'You are not logged. You can\'t manage guild.'; - } +if (empty($errors)) { + if ($logged) { + $guild_leader_char = $guild->getOwner(); + $rank_list = $guild->getGuildRanksList(); + $rank_list->orderBy('level', POT::ORDER_DESC); + $guild_leader = false; + $account_players = $account_logged->getPlayers(); + foreach ($account_players as $player) { + if ($guild_leader_char->getId() == $player->getId()) { + $guild_vice = true; + $guild_leader = true; + $level_in_guild = 3; + } + } + if ($guild_leader) { + $twig->display('guilds.manager.html.twig', array( + 'guild' => $guild, + 'rank_list' => $rank_list + )); + } else { + $errors[] = 'You are not a leader of guild!'; + } + } else { + $errors[] = 'You are not logged. You can\'t manage guild.'; + } } -if(!empty($errors)) { - $twig->display('error_box.html.twig', array('errors' => $errors)); +if (!empty($errors)) { + $twig->display('error_box.html.twig', array('errors' => $errors)); } diff --git a/system/pages/guilds/show.php b/system/pages/guilds/show.php index a620a615b..4a1a62e84 100644 --- a/system/pages/guilds/show.php +++ b/system/pages/guilds/show.php @@ -1,21 +1,23 @@ -find($guild_name); - if(!$guild->isLoaded()) - $errors[] = 'Guild with name '.$guild_name.' doesn\'t exist.'; +if (!Validator::guildName($guild_name)) + $errors[] = Validator::getLastError(); + +if (empty($errors)) { + $guild = new OTS_Guild(); + $guild->find($guild_name); + if (!$guild->isLoaded()) + $errors[] = 'Guild with name ' . $guild_name . ' doesn\'t exist.'; } -if(!empty($errors)) -{ - $twig->display('error_box.html.twig', array('errors' => $errors)); - $twig->display('guilds.back_button.html.twig'); - return; +if (!empty($errors)) { + $twig->display('error_box.html.twig', array('errors' => $errors)); + $twig->display('guilds.back_button.html.twig'); + return; } $guild_name = $guild->getName(); @@ -62,135 +62,121 @@ $players_from_account_in_guild = array(); $players_from_account_ids = array(); -if($logged) -{ - $account_players = $account_logged->getPlayers(); - foreach($account_players as $player) - { - $players_from_account_ids[] = $player->getId(); - $player_rank = $player->getRank(); - if($player_rank->isLoaded()) - { - foreach($rank_list as $rank_in_guild) - { - if($guild_owner->isLoaded() && $rank_in_guild->isLoaded() && $player_rank->isLoaded() && - $rank_in_guild->getId() == $player_rank->getId()) - { - $players_from_account_in_guild[] = $player->getName(); - if($guild_owner->getId() == $player->getId()) - { - $guild_vice = true; - $guild_leader = true; - } - else if($player_rank->getLevel() > 1) - { - $guild_vice = true; - $level_in_guild = $player_rank->getLevel(); - } - } - } +if ($logged) { + $account_players = $account_logged->getPlayers(); + foreach ($account_players as $player) { + $players_from_account_ids[] = $player->getId(); + $player_rank = $player->getRank(); + if ($player_rank->isLoaded()) { + foreach ($rank_list as $rank_in_guild) { + if ($guild_owner->isLoaded() && $rank_in_guild->isLoaded() && $player_rank->isLoaded() && + $rank_in_guild->getId() == $player_rank->getId()) { + $players_from_account_in_guild[] = $player->getName(); + if ($guild_owner->getId() == $player->getId()) { + $guild_vice = true; + $guild_leader = true; + } else if ($player_rank->getLevel() > 1) { + $guild_vice = true; + $level_in_guild = $player_rank->getLevel(); + } } + } } + } } //show guild page $guild_logo = $guild->getCustomField('logo_name'); -if(empty($guild_logo) || !file_exists('images/guilds/' . $guild_logo)) - $guild_logo = "default.gif"; +if (empty($guild_logo) || !file_exists('images/guilds/' . $guild_logo)) + $guild_logo = "default.gif"; $description = $guild->getCustomField('description'); $description_with_lines = str_replace(array("\r\n", "\n", "\r"), '
    ', $description, $count); -if($count < $config['guild_description_lines_limit']) - $description = nl2br($description); +if ($count < $config['guild_description_lines_limit']) + $description = nl2br($description); //$description = $description_with_lines; $guild_owner = $guild->getOwner(); -if($guild_owner->isLoaded()) - $guild_owner_name = $guild_owner->getName(); +if ($guild_owner->isLoaded()) + $guild_owner_name = $guild_owner->getName(); // GUILD BANK $guild_balance = $guild->getCustomField('balance'); // RESIDENCE $guild_residence = $guild->getCustomField('residence'); -$select_guildhouse = $db->query('SELECT `house_id`, `listid`, `list` FROM `house_lists` WHERE `house_id` = '.$guild_residence.''); +$select_guildhouse = $db->query('SELECT `house_id`, `listid`, `list` FROM `house_lists` WHERE `house_id` = ' . $guild_residence . ''); $get_guildhouse = $select_guildhouse->fetch(); $count_guildhouse = $select_guildhouse->rowCount(); -if($count_guildhouse > 0){ - $get_house = $db->query('SELECT `id`, `owner`, `paid`, `name`, `town_id` FROM `houses` WHERE `id` = '.$get_guildhouse['house_id'].'')->fetch(); - $house_name = $get_house['name']; +$house_name = null; +if ($count_guildhouse > 0) { + $get_house = $db->query('SELECT `id`, `owner`, `paid`, `name`, `town_id` FROM `houses` WHERE `id` = ' . $get_guildhouse['house_id'] . '')->fetch(); + $house_name = $get_house['name']; } - $guild_members = array(); -foreach($rank_list as $rank) -{ - if($db->hasTable(GUILD_MEMBERS_TABLE)) - $players_with_rank = $db->query('SELECT `players`.`id` as `id`, `' . GUILD_MEMBERS_TABLE . '`.`rank_id` as `rank_id` FROM `players`, `' . GUILD_MEMBERS_TABLE . '` WHERE `' . GUILD_MEMBERS_TABLE . '`.`rank_id` = ' . $rank->getId() . ' AND `players`.`id` = `' . GUILD_MEMBERS_TABLE . '`.`player_id` ORDER BY `name`;'); - else if($db->hasColumn('players', 'rank_id')) - $players_with_rank = $db->query('SELECT `id`, `rank_id` FROM `players` WHERE `rank_id` = ' . $rank->getId() . ' AND `deleted` = 0;'); - - $players_with_rank_number = $players_with_rank->rowCount(); - if($players_with_rank_number > 0) - { - $members = array(); - foreach($players_with_rank as $result) - { - $player = new OTS_Player(); - $player->load($result['id']); - if(!$player->isLoaded()) - continue; - - $members[] = $player; - } - - $guild_members[] = array( - 'rank_name' => $rank->getName(), - 'rank_level' => $rank->getLevel(), - 'members' => $members - ); +foreach ($rank_list as $rank) { + if ($db->hasTable(GUILD_MEMBERS_TABLE)) + $players_with_rank = $db->query('SELECT `players`.`id` as `id`, `' . GUILD_MEMBERS_TABLE . '`.`rank_id` as `rank_id` FROM `players`, `' . GUILD_MEMBERS_TABLE . '` WHERE `' . GUILD_MEMBERS_TABLE . '`.`rank_id` = ' . $rank->getId() . ' AND `players`.`id` = `' . GUILD_MEMBERS_TABLE . '`.`player_id` ORDER BY `name`;'); + else if ($db->hasColumn('players', 'rank_id')) + $players_with_rank = $db->query('SELECT `id`, `rank_id` FROM `players` WHERE `rank_id` = ' . $rank->getId() . ' AND `deleted` = 0;'); + + $players_with_rank_number = $players_with_rank->rowCount(); + if ($players_with_rank_number > 0) { + $members = array(); + foreach ($players_with_rank as $result) { + $player = new OTS_Player(); + $player->load($result['id']); + if (!$player->isLoaded()) + continue; + + $members[] = $player; } + + $guild_members[] = array( + 'rank_name' => $rank->getName(), + 'rank_level' => $rank->getLevel(), + 'members' => $members + ); + } } include(SYSTEM . 'libs/pot/InvitesDriver.php'); new InvitesDriver($guild); $invited_list = $guild->listInvites(); $show_accept_invite = 0; -if($logged && count($invited_list) > 0) -{ - foreach($invited_list as $invited_player) - { - if(count($account_players) > 0) - { - foreach($account_players as $player_from_acc) - { - if($player_from_acc->isLoaded() && $invited_player->isLoaded() && $player_from_acc->getName() == $invited_player->getName()) - $show_accept_invite++; - } - } +if ($logged && count($invited_list) > 0) { + foreach ($invited_list as $invited_player) { + if (count($account_players) > 0) { + foreach ($account_players as $player_from_acc) { + if ($player_from_acc->isLoaded() && $invited_player->isLoaded() && $player_from_acc->getName() == $invited_player->getName()) + $show_accept_invite++; + } } + } } $useGuildNick = false; -if($db->hasColumn('players', 'guildnick')) - $useGuildNick = true; +if ($db->hasColumn('players', 'guildnick')) + $useGuildNick = true; $twig->display('guilds.view.html.twig', array( - 'logo' => $guild_logo, - 'guild_name' => $guild_name, - 'description' => $description, - 'guild_balance' => $guild_balance, - 'guild_house' => $house_name, - 'guild_owner' => $guild_owner->isLoaded() ? $guild_owner : null, - 'guild_creation_date' => $guild->getCreationData(), - 'guild_members' => $guild_members, - 'players_from_account_ids' => $players_from_account_ids, - 'players_from_account_in_guild' => $players_from_account_in_guild, - 'level_in_guild' => $level_in_guild, - 'isLeader' => $guild_leader, - 'isVice' => $guild_vice, - 'logged' => $logged, - 'invited_list' => $invited_list, - 'show_accept_invite' => $show_accept_invite, - 'useGuildNick' => $useGuildNick + 'logo' => $guild_logo, + 'guild_name' => $guild_name, + 'description' => $description, + 'guild_balance' => $guild_balance, + 'guild_house' => $house_name, + 'guild_owner' => $guild_owner->isLoaded() ? $guild_owner : null, + 'guild_creation_date' => $guild->getCreationData(), + 'guild_members' => $guild_members, + 'players_from_account_ids' => $players_from_account_ids, + 'players_from_account_in_guild' => $players_from_account_in_guild, + 'level_in_guild' => $level_in_guild, + 'isLeader' => $guild_leader, + 'isVice' => $guild_vice, + 'logged' => $logged, + 'invited_list' => $invited_list, + 'show_accept_invite' => $show_accept_invite, + 'useGuildNick' => $useGuildNick, + 'world_id' => $guild->getWorldId(), )); diff --git a/system/templates/guilds.create.html.twig b/system/templates/guilds.create.html.twig index 99bb08169..f15e7a980 100644 --- a/system/templates/guilds.create.html.twig +++ b/system/templates/guilds.create.html.twig @@ -1,65 +1,79 @@
    -
    -
    -
    - - - - -
    Create a {{ config.lua.serverName }} Guild
    - - - - -
    -
    - - - - -
    -
    - - - - - - - - - -
    - Leader: - -
    - (Name of leader of new guild.) -
    Guild name: -
    - (Here write name of your new guild.)
    -
    -
    -
    -
    - - - - - - - -
    -
    -
    - {{ include('buttons.submit.html.twig') }} +
    +
    +
    + + + + +
    Create a Guild on {{ world.name }} World
    + + + + +
    +
    + + + + + + +
    +
    + + + + + + + + + + + +
    + Leader: + +
    + (Name of leader of new guild.) +
    Guild name: +
    + (Here write name of your new guild.)
    +
    +
    +
    +
    + + + + + + + +
    +
    +
    + {% set world_id = world.id %} + {{ include('buttons.submit.html.twig') }} + + + {% set world_id = world.id %} + {{ include('buttons.back.html.twig') }} + + +
    +
    -
    -
    - {{ include('buttons.back.html.twig') }} -
    -
    -
    -
    \ No newline at end of file diff --git a/system/templates/guilds.create.success.html.twig b/system/templates/guilds.create.success.html.twig index 354a0300f..55f54b17f 100644 --- a/system/templates/guilds.create.success.html.twig +++ b/system/templates/guilds.create.success.html.twig @@ -1,22 +1,23 @@ -{% set title = 'Created guild' %} +{% set title = 'Created guild on ' ~ world.name ~ ' world' %} {% set motd = '' %} {% if constant('MOTD_EXISTS') %} -{% set motd = ' and motd' %} + {% set motd = ' and motd' %} {% endif %} -{% set description = 'Congratulations!
    You have created guild ' ~ guild_name ~ '. ' ~ leader_name ~ ' is leader of this guild. Now you can invite players, change picture, description' ~ motd ~ ' of guild. Press submit to open guild manager.' %} +{% set description = 'Congratulations!
    You have created guild ' ~ guild_name ~ ' on ' ~ world.name ~' world. ' ~ leader_name ~ ' is leader of this guild. Now you can invite players, change picture, description' ~ motd ~ ' of guild. Press submit to open guild manager.' %} {% set custom_buttons = '' %} {{ include('success.html.twig') }} -
    +
    - - - -
    -
    -
    - {{ include('buttons.submit.html.twig') }} -
    -
    -
    \ No newline at end of file + + +
    +
    + + {{ include('buttons.submit.html.twig') }} +
    +
    + + + diff --git a/system/templates/guilds.list.html.twig b/system/templates/guilds.list.html.twig index ec954665f..7c748ba93 100644 --- a/system/templates/guilds.list.html.twig +++ b/system/templates/guilds.list.html.twig @@ -40,7 +40,7 @@ Please select the game world of your choice to see the list of all existing guil
    World Name: - {% for item in worlds %}
    diff --git a/templates/tibiacom/buttons.submit.html.twig b/templates/tibiacom/buttons.submit.html.twig index 25bf7d843..8c422a413 100644 --- a/templates/tibiacom/buttons.submit.html.twig +++ b/templates/tibiacom/buttons.submit.html.twig @@ -1,3 +1,6 @@ {% set button_name = 'Submit' %} {% set button_image = '_sbutton_submit' %} -{% include('buttons.base.html.twig') %} \ No newline at end of file +{% if world_id is not empty %} + {% set world_id = world_id %} +{% endif %} +{% include('buttons.base.html.twig') %} From 983fb3f100048dfdd21996f0cb22157b2e23a6a1 Mon Sep 17 00:00:00 2001 From: Elson Costa Date: Thu, 29 Aug 2024 12:13:59 -0300 Subject: [PATCH 24/42] highscore: fixes. --- index.php | 9 ++++----- system/pages/highscores.php | 12 ++++++------ system/templates/guilds.list.html.twig | 2 +- system/templates/lastkills.html.twig | 2 +- system/templates/online.html.twig | 2 +- 5 files changed, 13 insertions(+), 14 deletions(-) diff --git a/index.php b/index.php index cbc8c3673..78d0dfd24 100644 --- a/index.php +++ b/index.php @@ -121,11 +121,10 @@ '/^gifts\/history\/?$/' => array('subtopic' => 'gifts', 'action' => 'show_history'), '/^guilds\/[A-Za-z0-9-_%+\']+$/' => array('subtopic' => 'guilds', 'action' => 'show', 'guild' => '$1'), '/^online\/[A-Za-z0-9-_%+\']+$/' => array('subtopic' => 'online', 'world' => '$1'), - '/^highscores\/[A-Za-z0-9-_]+\/[0-9]+\/[A-Za-z0-9-_]+\/[0-9]+\/?$/' => array('subtopic' => 'highscores', 'list' => '$1', 'world' => '$2', 'vocation' => '$3', 'page' => '$4'), - '/^highscores\/[A-Za-z0-9-_]+\/[0-9]+\/[0-9]+\/?$/' => array('subtopic' => 'highscores', 'list' => '$1', 'world' => '$2', 'page' => '$3'), - '/^highscores\/[A-Za-z0-9-_]+\/[0-9]+\/[A-Za-z0-9-_]+\/?$/' => array('subtopic' => 'highscores', 'list' => '$1', 'world' => '$2', 'vocation' => '$3'), - '/^highscores\/[A-Za-z0-9-_]+\/[A-Za-z0-9-_]+\/?$/' => array('subtopic' => 'highscores', 'list' => '$1', 'vocation' => '$2'), - '/^highscores\/[A-Za-z0-9-_]+\/[0-9]+\/?$/' => array('subtopic' => 'highscores', 'list' => '$1', 'world' => '$2'), + '/^highscores\/[A-Za-z0-9-_]+\/[A-Za-z0-9-_]+\/[A-Za-z0-9-_]+\/[0-9]+\/?$/' => array('subtopic' => 'highscores', 'list' => '$1', 'world' => '$2', 'vocation' => '$3', 'page' => '$4'), + '/^highscores\/[A-Za-z0-9-_]+\/[A-Za-z0-9-_]+\/[0-9]+\/?$/' => array('subtopic' => 'highscores', 'list' => '$1', 'world' => '$2', 'page' => '$3'), + '/^highscores\/[A-Za-z0-9-_]+\/[A-Za-z0-9-_]+\/[A-Za-z0-9-_]+\/?$/' => array('subtopic' => 'highscores', 'list' => '$1', 'world' => '$2', 'vocation' => '$3'), + '/^highscores\/[A-Za-z0-9-_]+\/[A-Za-z0-9-_]+\/?$/' => array('subtopic' => 'highscores', 'list' => '$1', 'world' => '$2'), '/^highscores\/[A-Za-z0-9-_]+\/?$/' => array('subtopic' => 'highscores', 'list' => '$1'), '/^lastkills\/[A-Za-z0-9-_%+\']+$/' => array('subtopic' => 'lastkills', 'world' => '$1'), '/^news\/add\/?$/' => array('subtopic' => 'news', 'action' => 'add'), diff --git a/system/pages/highscores.php b/system/pages/highscores.php index 0bf4edd2b..391921aed 100644 --- a/system/pages/highscores.php +++ b/system/pages/highscores.php @@ -16,7 +16,7 @@ require SYSTEM . 'countries.conf.php'; $list = $_GET['list'] ?? ''; -$world = $_GET['world'] ?? 0; +$world = $_GET['world'] ?? ''; $vocation = $_GET['vocation'] ?? ""; $_page = $_GET['page'] ?? 0; @@ -52,12 +52,12 @@ } } -if ($world > 0) { - if (!$w = $db->query("SELECT `id` FROM `worlds` WHERE `id` = {$world}")->fetch()['id'] ?? null) { +if (!empty($world)) { + if (!$world = $db->query("SELECT * FROM `worlds` WHERE `name` = {$db->quote(escapeHtml($world))}")->fetch() ?? null) { header('Location: ' . "?highscores"); return; } - $add_sql .= " AND `world_id` = {$world} "; + $add_sql .= " AND `world_id` = {$world['id']} "; } define('SKILL_FRAGS', -1); @@ -231,10 +231,10 @@ World: diff --git a/system/templates/guilds.list.html.twig b/system/templates/guilds.list.html.twig index 7c748ba93..80acf2deb 100644 --- a/system/templates/guilds.list.html.twig +++ b/system/templates/guilds.list.html.twig @@ -41,7 +41,7 @@ Please select the game world of your choice to see the list of all existing guil World Name: - + {% for item in worlds %} diff --git a/system/templates/online.html.twig b/system/templates/online.html.twig index fabebd2d0..24a6be8a4 100644 --- a/system/templates/online.html.twig +++ b/system/templates/online.html.twig @@ -37,7 +37,7 @@ World Name: - Regular Game World -
    - - - - -
    - - - - Filter by game world location
    -
    For a good connection and with this the best possible gaming - experience, please select a game world that is situated nearest your own location. -
    -
    -
    - - - - {% if config.lua.location == 'Europe' %} - - {% endif %} - {% if config.lua.location == 'North America' %} - + + + + - - - - - +    + + {% endfor %} + + +
    -
    - -
    -    -
    + {% if config.show_filters %} +
    Filter by game world category
    +
    There are different game world categories to choose from. + Regular game worlds are the default category, where all game features work as described in + the manual.
    + Experimental game worlds are special game worlds, which are sometimes used to test new + features. Characters on these game worlds can be played normally, though they may be + affected by restrictions during tests.
    For details on experimental worlds, please see + the corresponding manual + section.
    Finally, you can choose if you like to play on a game world which has been + protected by BattlEye from the start. BattlEye is a software that prevents the use of + cheat software. It is running in the background while you are playing Tibia. For more + information, please have a look at our FAQ.
    +
    +
    +
    + + + + - {% endif %} - {% if config.lua.location == 'South America' %} - + +
    +
    - +
    -   
    +
    +
    +
    Filter by game world location
    +
    For a good connection and with this the best possible + gaming + experience, please select a game world that is situated nearest your own location. +
    +
    +
    + + + + - {% endif %} - - -
    - +
      
    -
    -
    Filter by game world PvP type
    -
    There are five different game world types that differ in the - strictness of PvP rules. For a detailed description, please have a look at our manual. - If you cannot decide for a game world type, we recommend playing on optional PvP. -
    -
    -
    - - - - {% if config.lua.worldType == 'no-pvp' %} - - {% endif %} - {% if config.lua.worldType == 'pvp' %} - - {% endif %} - {% if config.lua.worldType == 'pvp-enforced' %} - - {% endif %} - - - {% if config.lua.worldType == 'retro' %} - - - - {% endif %} - {% if config.lua.worldType == 'retro-enforced' %} - - {% endif %} - - -
    -
    - -
    -
      Only if both sides agree, characters can be fought
    + {% set i = 0 %} + {% for location in locations %} + {% set i = i + 1 %} +
    - +
    -   Killing other characters is possible, but restricted
    -
    - -
    -
      Killing other characters is not restricted at all
    -
    - -
    -
      Killing other characters is possible, but restricted (old PvP - rules)
    -
    - -
    -
      Killing other characters is not restricted at all (old PvP - rules)
    -
    -
    +
    + + + + Filter by game world PvP type
    +
    There are {{ world_types|length }} different game world + types + that differ in the strictness of PvP rules. For a detailed description, please have a look + at our manual. If you cannot decide for a game world type, we recommend + playing on optional PvP. +
    +
    +
    + + + + + + +
    +
    + {% set y = 0 %} + {% for type in world_types %} + {% set y = y + 1 %} +
    +
    + +
    + {{ type.desc }}
    +
    + {% endfor %} +
    +
    +
    + + + {% endif %} + - +
    -
    - - - special offer
    -  
    + {% set z = 0 %} + {% for world in worlds %} + {% set z = z + 1 %} +
    + + + + + + special offer + + + +
    + {% endfor %} +
    @@ -366,7 +309,7 @@ In any case the name must not violate the naming conventions stated in the -
    +
    @@ -393,3 +336,4 @@ In any case the name must not violate the naming conventions stated in the
    +{# #} diff --git a/system/twig.php b/system/twig.php index 0f5041def..2ae83d267 100644 --- a/system/twig.php +++ b/system/twig.php @@ -82,6 +82,11 @@ function ($context, $hook, array $params = []) { }); $twig->addFunction($function); +$function = new TwigFunction('getWorldName', function ($id) { + return getWorldName($id); +}); +$twig->addFunction($function); + $filter = new TwigFilter('urlencode', function ($s) { return urlencode($s); }); From 27a1e62238f618c562bbdc75d2a43747371d491f Mon Sep 17 00:00:00 2001 From: Elson Costa Date: Fri, 30 Aug 2024 03:38:58 -0300 Subject: [PATCH 26/42] improvement of code and adjusted information on accountmanagement. --- admin/pages/worlds.php | 2 + system/libs/CreateCharacter.php | 26 +- system/libs/pot/OTS_Guild.php | 2 +- system/pages/accountmanagement.php | 6 +- system/pages/highscores.php | 2 +- system/pages/lastkills.php | 2 +- system/pages/online.php | 2 +- .../tibiacom/account.management.html.twig | 43 +- .../account/option_server_location_all.png | Bin 6601 -> 0 bytes .../account/option_server_location_eur.png | Bin 5679 -> 0 bytes .../option_server_pvp_type_hardcore.gif | Bin 2755 -> 0 bytes .../account/option_server_pvp_type_open.gif | Bin 2805 -> 0 bytes .../option_server_pvp_type_optional.gif | Bin 2665 -> 0 bytes .../account/option_server_pvp_type_retro.gif | Bin 3191 -> 0 bytes .../content/option_server_location_bra.png | Bin 5242 -> 0 bytes .../content/option_server_location_na.png} | Bin .../content/option_server_location_oce.png | Bin 0 -> 6582 bytes .../content/option_server_location_sa.png} | Bin .../content/option_server_location_usa.png | Bin 5543 -> 0 bytes .../option_server_pvp_type_retrohardcore.gif | Bin .../option_server_pvp_type_retrohardcore.png | Bin 7158 -> 0 bytes templates/tibiacom/index.php | 1 + tools/css/custom.css | 846 ++++++++++++++++++ 23 files changed, 900 insertions(+), 32 deletions(-) delete mode 100644 templates/tibiacom/images/account/option_server_location_all.png delete mode 100644 templates/tibiacom/images/account/option_server_location_eur.png delete mode 100644 templates/tibiacom/images/account/option_server_pvp_type_hardcore.gif delete mode 100644 templates/tibiacom/images/account/option_server_pvp_type_open.gif delete mode 100644 templates/tibiacom/images/account/option_server_pvp_type_optional.gif delete mode 100644 templates/tibiacom/images/account/option_server_pvp_type_retro.gif delete mode 100644 templates/tibiacom/images/global/content/option_server_location_bra.png rename templates/tibiacom/images/{account/option_server_location_usa.png => global/content/option_server_location_na.png} (100%) create mode 100644 templates/tibiacom/images/global/content/option_server_location_oce.png rename templates/tibiacom/images/{account/option_server_location_bra.png => global/content/option_server_location_sa.png} (100%) delete mode 100644 templates/tibiacom/images/global/content/option_server_location_usa.png rename templates/tibiacom/images/{account => global/content}/option_server_pvp_type_retrohardcore.gif (100%) delete mode 100644 templates/tibiacom/images/global/content/option_server_pvp_type_retrohardcore.png create mode 100644 tools/css/custom.css diff --git a/admin/pages/worlds.php b/admin/pages/worlds.php index 9606c3d4b..8263b5886 100644 --- a/admin/pages/worlds.php +++ b/admin/pages/worlds.php @@ -42,6 +42,8 @@ function echo_error($message) if (!$name = $_POST['name']) { echo_error("World name is required!"); } + $name = stripslashes(ucwords(strtolower($name))); + if (!$type = $_POST['type']) { echo_error("Server type is required!"); } diff --git a/system/libs/CreateCharacter.php b/system/libs/CreateCharacter.php index fce7943d6..6ede61940 100644 --- a/system/libs/CreateCharacter.php +++ b/system/libs/CreateCharacter.php @@ -107,6 +107,7 @@ public function check($name, $sex, &$vocation, &$town, &$errors) } /** + * @param string $worldName * @param string $name * @param int $sex * @param int $vocation @@ -119,12 +120,18 @@ public function check($name, $sex, &$vocation, &$town, &$errors) * @throws Twig_Error_Runtime * @throws Twig_Error_Syntax */ - public function doCreate($name, $sex, $vocation, $town, $account, &$errors) + public function doCreate($worldName, $name, $sex, $vocation, $town, $account, &$errors) { + global $db; + if (!$this->check($name, $sex, $vocation, $town, $errors)) { return false; } + if (!$worldId = $db->query("SELECT `id` FROM `worlds` WHERE `name` = {$db->quote($worldName)}")->fetch()['id'] ?? null) { + return false; + } + if (empty($errors)) { $number_of_players_on_account = $account->getPlayersList()->count(); if ($number_of_players_on_account >= config('characters_per_account')) @@ -143,8 +150,6 @@ public function doCreate($name, $sex, $vocation, $town, $account, &$errors) return false; } - global $db; - if ($sex == "0") $char_to_copy->setLookType(136); @@ -213,6 +218,7 @@ public function doCreate($name, $sex, $vocation, $town, $account, &$errors) $player->setMain($number_of_players_on_account == 0); } + $player->setWorldId($worldId); $player->save(); $player->setCustomField('created', time()); @@ -241,15 +247,15 @@ public function doCreate($name, $sex, $vocation, $town, $account, &$errors) } } - global $twig; - $twig->display('success.html.twig', array( - 'title' => 'Character Created', - 'description' => 'The character ' . $name . ' has been created.
    + global $twig; + $twig->display('success.html.twig', array( + 'title' => 'Character Created', + 'description' => "The character {$name} has been created on {$worldName} world.
    Please select the outfit when you log in for the first time.

    - See you on ' . configLua('serverName') . '!' - )); + See you on {$worldName}!" + )); - $account->logAction('Created character ' . $name . '.'); + $account->logAction("Created character $name on $worldName world."); return true; } } diff --git a/system/libs/pot/OTS_Guild.php b/system/libs/pot/OTS_Guild.php index f546d94c2..d52ab1e5a 100644 --- a/system/libs/pot/OTS_Guild.php +++ b/system/libs/pot/OTS_Guild.php @@ -194,7 +194,7 @@ public function save() else { // INSERT query on database $this->db->exec("INSERT INTO `guilds` (`name`, `$ownerid`, `$creationdata`, `description`, `world_id`) VALUES ({$this->db->quote($this->data['name'])}, {$this->data['ownerid']}, {$this->data['creationdata']}, '', {$this->data['world_id']})"); - // ID of new group + // ID of new guild $this->data['id'] = $this->db->lastInsertId(); } } diff --git a/system/pages/accountmanagement.php b/system/pages/accountmanagement.php index 0bd7b45c4..8a837d5ed 100644 --- a/system/pages/accountmanagement.php +++ b/system/pages/accountmanagement.php @@ -98,8 +98,10 @@ $welcome_message = 'Your account is banished until ' . date("j F Y, G:i:s", $account_logged->getBanTime()) . '!'; else $welcome_message = 'Your account is banished FOREVER!'; - else - $welcome_message = 'Welcome to your ' . configLua('serverName') . ' account!'; + else { + $first_name = $account_rlname ? ucwords(strtolower(@explode(" ", $account_rlname)[0])) : ""; + $welcome_message = "Welcome to your account {$first_name}!"; + } $verify_message = ""; if ($config['mail_enabled'] && $config['account_mail_verify'] && $account_logged->getCustomField('email_verified') != '1') { diff --git a/system/pages/highscores.php b/system/pages/highscores.php index 391921aed..959e27fab 100644 --- a/system/pages/highscores.php +++ b/system/pages/highscores.php @@ -53,7 +53,7 @@ } if (!empty($world)) { - if (!$world = $db->query("SELECT * FROM `worlds` WHERE `name` = {$db->quote(escapeHtml($world))}")->fetch() ?? null) { + if (!$world = $db->query("SELECT * FROM `worlds` WHERE `name` = {$db->quote($world)}")->fetch() ?? null) { header('Location: ' . "?highscores"); return; } diff --git a/system/pages/lastkills.php b/system/pages/lastkills.php index c81b4cc72..34189a889 100644 --- a/system/pages/lastkills.php +++ b/system/pages/lastkills.php @@ -19,7 +19,7 @@ $worlds = $db->query("SELECT `id`, `name` FROM `worlds` ORDER BY `id` ASC")->fetchAll(); if ($world = $_GET['world'] ?? null) { - $world = $db->query("SELECT `id`, `name` FROM `worlds` WHERE `name` = {$db->quote(escapeHtml($world))}")->fetch() ?? null; + $world = $db->query("SELECT `id`, `name` FROM `worlds` WHERE `name` = {$db->quote($world)}")->fetch() ?? null; } else { $world = count($worlds) == 1 ? $worlds[0]['id'] : $world; } diff --git a/system/pages/online.php b/system/pages/online.php index 82ef844b3..600735221 100644 --- a/system/pages/online.php +++ b/system/pages/online.php @@ -17,7 +17,7 @@ } $worlds = $db->query("SELECT `id`, `name` FROM `worlds` ORDER BY `id` ASC")->fetchAll(); if ($world = $_GET['world'] ?? null) { - $world = $db->query("SELECT * FROM `worlds` WHERE `name` = {$db->quote(escapeHtml($world))}")->fetch() ?? null; + $world = $db->query("SELECT * FROM `worlds` WHERE `name` = {$db->quote($world)}")->fetch() ?? null; } else { $world = count($worlds) == 1 ? $worlds[0]['id'] : $world; } diff --git a/templates/tibiacom/account.management.html.twig b/templates/tibiacom/account.management.html.twig index 713c92148..c61d42ea1 100644 --- a/templates/tibiacom/account.management.html.twig +++ b/templates/tibiacom/account.management.html.twig @@ -351,28 +351,39 @@
    {{ config.vocations[player.getVocation()] }} - Level {{ player.getLevel() }} - On {{ config['lua']['serverName'] }} - - - + id="CharacterNameOf_0">{{ config.vocations[player.getVocation()] }} - Level {{ player.getLevel() }} - On {{ getWorldName(player.getWorldId()) }} + + + + - - {% if guild.rank is not null %} -
    - Guild Membership: {{ guild.rank }} of the
    {{ guild.link|raw }} - {% endif %} + {% if guild.rank is not null %} +
    + Guild Membership: {{ guild.rank }} of the {{ guild.link|raw }} + {% endif %}
    - Daily Reward collected + {% if player.rewardCollected() %} + Daily Reward collected + {% else %} + Daily Reward not collected + {% endif %} + {% if player.isHidden() %} + hidden + {% endif %} {% if player.isOnline() %} {% else %} diff --git a/templates/tibiacom/images/account/option_server_location_all.png b/templates/tibiacom/images/account/option_server_location_all.png deleted file mode 100644 index 152122ec108dffdbcfe922c1593792d1c6de7fd6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6601 zcmbVRWmuHmx+bJUKvH^WBxZ)3p<^g1X^%O0Ue!a1}+Nxy4_ldEvu*lTal=W^`;GdTe|MqK) z^DFvxVZgvlF#0a`7;hVQ1eSuGi!Fjp9cANy&_meR`MM1wq_MDY(MSUmjER;e6z+l& zviXA%@j8EwOo}Djz~2>cZ9y5 zwgKGl2^?YvkdtMT_JQ6iKp`+TY(6Mwvh(Eh6ON?jQ_;Kp?_EurL@bc#9D9@I_;6d<4-R9RFxg zMtH#8k**k|3!3eZMjKlfPmB!U*3*B5fO6H+`nO`V$KQ#%O_{KdjjJ$72q=s~{fX-@ zvhB=?=fGhdswXy6Mv2j**fqSA5 zXpFkD4B+-g$PQ@-g^4M^#6^@PK;jUfvI+f%~krZT&R*e!Up5w zZs6kL{7(nyI=Wz7JRDtI*_4$2R2;&_Ym7wOxp;f<{VCDEB34GYBfSuID()^Qw!d-= zMg9jL>_mZLU?3bW2o^=y3yO)0N(w?GZ6JcSA|m#11W+7^un__L&A0piltw z@_(AWrN92`na4!}X&5^pYf`QLmnwhT;lY{T?v3e2z z+QzC+?^~T88UcngnCI2^D55#(H`(Yu65xQ3TO~IR ziIP`bNWphyGA~RH82*eHel4(@;Z@#Y@3pye8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16 z2aT-ms!Fy&K&p@Uz`dyEei4qWqifs*-Uk#$p3*%Zs?wc&?+7{+<>3_&DYy=YuH*pr z{O!mtgM8?maPFNSM6(QR)lFSq=br9u@E*3z{JdDU_BJy(s+n#nP)0N5OQ3q%I-=`1 z+|wTG^QuYu_%OQ*+;jHg<=yfvPY}^DRnH(`rURhG_rM14TfEtI~SS5*avLtAIAL+pX3NMfmU(1*-#pQ+#(0KtUBktqR7 zPDlQ-W4W^l{=L9;OH$dNg3?X9`jV%LLE=ok^F!xT4^aBJR|VLG@%<8Q`M*v}{V#St ze|;Z|eK~u=D^>*@Hid)}I0Z-g-w%p)bdCCMwAFe?D^+dg;n0*vao1BSAG`RIR(brL zlj;fE<;@{SEsuQrYOg6zK8&0P!$I)bPsyum)uV;d-?)Ro)>0z#pRDtiC~5ybssll8 zBi!I0+SecMr9p+8WGrW|zirEIVq4JZ>OcQ_&|KS%y7#WDQ6la;`K!T?7%Ac?R-=iq zdK~_5kZ%6P7Z_Mc$VHT>EG9lur&I1u;pY$zIoXKip#7;VNu7yT1MtFUzjqxdf&+7< zUq7UE_P-Wf+zN6=pC#BW_jV@v?Du7n^{bLq;5yD%0_gQYf?{6{T4_6mdAU>AcNPvD z8FWR@!&scn9<1z;V@o&}cP|)$g4q)~Gx3jp+)Z4wmDBR2Y^O?CJ+_*w+w^v^AJo5D zbS&SkSvLalZoY^iA)JY-13oBr(xPY1txC!sWzfemYYyJex%9rf zMBx`m*}ihTW=g!kK4O-EpYo>K;LARLMHT~l-)?BeNJt_|ejoap<2RJNrOh2p>qo9f ztJa$H3&A3>y^asj7ijtNRSUK%vG8)Vq%OS``MBP?_UA>JvN(!wlyFiA`e}y==8@Lo zl_juS>{0F<#ELT2j@R2B_a0JM(lBYJSzLj=46WkZd6oMjW+sUlcBX^A(FwuE+7h{6 VIoZ1O>(9>>b(pqtjiPnf{{XEd`V9a8 diff --git a/templates/tibiacom/images/account/option_server_location_eur.png b/templates/tibiacom/images/account/option_server_location_eur.png deleted file mode 100644 index d0132c3fb88ead169bfe92302a262642905e80c5..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 5679 zcmV+~7SQR5P)ra~i&5 zE_kJ>8Ea{F%xc&tHJuAa6bc<60&v|MD0Bk?4;m$~t=4-QB+`&-3;$n!F26hSfx!z9 zO%OUnH+=fe*y@jeIuH|&!li9`Lcmf9t6IX)ee`Gq;d^MhkCE{(;ySa_1_Qh9!Jaub ze(jR^%Jdj7boTK^_dsX}E&tRO!D@o0w*UjxrO?nqH|P-veE2{S5YihyL^poq7o%Ih z_^W91_c8b9%%3>J+{6-7XB%9-D6njZ#vv99y%~u@A{TnFePDpKLrdh^vWy;%)4Qn$ zzkKGPS!w=pp_}L0JD^#G%C!)DBo_YkJrDwX2eKVdSOu%7}?|EYIF!6{@ItR@%oO+W}u^6BHd}RN`&6xf&HcT`I zZC(F_0j1%uZcRS;{R6mvRebHg|2}{Ay(DF)o3Z4b%%`?<$G%-W@W46@UB~lvD$M}T z*VONh%vS-LrYWX~>Ket2&-#9cY(l4LMyWP5UOZUh)SF{Of=m2|?Jw|P&lz=}Rfls& zsCW(^{$l(77ef;mG8jfc)R0k1F)|VG z{C6gqow>x`zC%2@^ScTc-21;a?LV=C?JuIC0lp9V`{mg3=YF%8eE7^8 zcrSGP&3}1{7Y_7r*%;zj<`We9*7J)`+{vx$qD)R#SSs5%wvTCgG)$Lz!=u*pshb`# z&1Q3NmFQk?k-0P0c17UPLyQaRV~yNvhX9gK@?X+Idn3w zayn+jF)KD_PadaU*V);7l+Sj26D_)lx%2ZhOQpNxF%G7sNb%k!C4>X7*4(5)t9*VjFLt=)m=4W&1#rOeV&rp%~*MWlqiR;I-5~erf$# z&b?8UUVoN6JM;ju*;Wck@OoRv<7^zGZp*3-R3&*yxtp<)$!EvhCW}OS~!1%aMD!qVX*En=2h3!_b+zNhB zVszBNZaP@G3Lv0I{IL6m$sdNpO<1zMnGRlpTx%D zFST#Fiwg(7OQd}pQ>jhrQzH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e|&xlBM|^Bd6D>=BJvYud%kj!ry-Fak>f)fAq%7DgIR4+rYC1w zKGkgUS;yreUxUt7G1lI?8sAz(6E?Z7EKBnSg|#_`b{DA4H)+%aS|X3t2$(rD!^E-6 zl&(On0Kg*mu9 z3G)-+mcg=G0?q~7ZYk1$I~|`-nKq9^Q>mSqVv(7VDFS(_6xX=p6RSD)!x?-}5XhS) z$D85bJtVT6N#=Pund1Ap&OyaOEyglh1}IuKKq_XLmc?Ee+yp~+K-UJa?K9=<>w{|{*Lo^ivZ;ueI&dp^j&`drw2h7(tV<+~?t0aaNf5Cp zmJzU^2_`VOfW|Q)D9K4vVQo!*60BOG$deb<%0qgV&XbID`+cx}H*~B8&w;>${|^)8 Vk5c!BkxT#p002ovPDHLkV1nm`Gpqmr diff --git a/templates/tibiacom/images/account/option_server_pvp_type_hardcore.gif b/templates/tibiacom/images/account/option_server_pvp_type_hardcore.gif deleted file mode 100644 index 4d49c1186b8c7b2ef870c27dc5a905aba278099f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2755 zcmWNR{Ug(f1Asp-doi2&*yers%U0Smb#-m?ws57lFG<~2DwVq=SGp_v_S^FZJkJvo8_fs+Yg z#jY%>$-8U3-e61{6RM8}FG)Om1eX2lty=sDlPAHhjp#@|^OY<1cnE$x#OTXE{Uf)A zKRrq7aW-1|d}Y!C|I!b;Hq!4Um!NgWD%U{|w%goGH9w9*Y=&*#xAC9HV;)8l3SIHn z4}iUP_^xc|`?#3r*0@?b?3Wh_x-5$ieWu@8gP{Q)2E(7({=SA!g@bJ4+4IXn!vcOv zhqV^Qx4Jr_?M(iClWzFu>_$P%J$ZmuXcI12sZj(TTpK^xm7KtG9f+j#CeaQ0#Is?P z!DI1dJJ^#-_U?-P)5m=lU)5FlgKaV3(t>z*ETbXFtSBO+zYrd0VqRWec67bpRUYAa zgTLY5W0e6cu_F}Z$tcg>&_IR%om$bHZ2#gcZt5KC^R&Fe9iybdBRd_R91r@*0rR-R z>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b/templates/tibiacom/images/account/option_server_pvp_type_open.gif deleted file mode 100644 index a7de8322ff5d4317b91e156e290ac9f2f37012a9..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2805 zcmWO6|0C1+1Hkdud*5ufvH7xAzBFHINQ~k{WwT+aSfZrTP>c{M5oxn8%|@rxaglr} z(Mfc=d`XS@9z|cY`bZ-kR}yidlYRQ_`42oF-rKxfHigmv4a{pm?j}TS#=4%K?#e%I z4!#;}Z_J&1m6UfS@4O@I$`vUDgKh*xVije z+u&a)iR|?Jm#F=baj{7!o0DK(+dMU6;umEHmR@-)MXsslu(1zgh1Ux1CpzZ@+q9g8 z@7TU+emtn|D13SG*7&;{v59e-`IJ5T_Lgra9*&MUof77^29qj0`|>t#c06Xdac@hq z{e$M_fx@7=eL9Q7T+Nu@)KGX?iM;C~wdL|2xjpo0a`J7{(M%?4c~0=50rh=B^}aP~ zqHFJuZ&A$&R%vIC%}(6N3xvLYINWo=TeEPnDVfwEGrSdUGV;9O^XsSr4}_S#YGPFR z@kR9G-(7xVL4DUFBak5P@@b96ap7H>*arGsKOo4(%hla-B8tTog=YP7o*(n zq@xH{w z6;NO9sw+p(2LkEWcj4zBBFhdy8jak=adYxC1Q&SrNv5=nn* zylHl_DKwNbJ2O&py>zfPp)JGqT9N4Ct@MfhLsL&Ui|S*`AH(CEEV9p^9PiH>8Xo@m zY3$3eY-;+;!s4Rl3-8h{aGXn5wzbICW6BTem+u7^bAKKD!~1ou|3?M&`%??eTZ@pj z#87vfAOy($jT-73XU5iPMxAEfU7VdTecIn27as-yFk3`G0BC^i&;EG?4FI$TXfVd? zn&OtVJGqvk(3%qEIedFiLwG61#Fg~VM8V#3Pbypq%&ki`W!>xX_a+0PgecvjVAq(o3SBaJSIK6co!LgK;_4FC<%o1i zbCT|b=lplW2KkAh!-Zk;OcpihBd?!cyPvW3VMT_xr0=qewW7<}qsck;HTU@M>YH$= z2xS{&OR{F~SRYceEbTef+3ig2zgn1beaGuE?}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0$78qqEBcLob?0>7#bbzR!z=gI#m~FqnU~mSMSBAl}c?jbJkWRFE z1Bu0#_;{*O6-kQf?On0BBm&HDBMV-zATk-O)rzd5>+6z7?f1x^@=c1PM~_RK*QV~5 zm@5o2Y7mF8ceC~fQBZ+wCF<@B)(Dv6Q`JlhSJ~zTFDBYFxrK43Y5U{S5rdw5Wdz<| z3vWDvl`VAqf-97ys)|>nsoM4TaM=I+#f1fMJkT+6jM&)#gs33kJVYSTGVp;F9vsmw zqz|VQ=akGhLXDsaZD9mrdWT3~w%09r#2`ss%M6Ma?o*9mTXO_7z?C_k02nh)tKH`K z>=j+)XBc#!LeEwXlE#Acg45B~UNpIVPDYaJd%m@+LQEE^`yKeRCuixAU^5dRBV`qt zJwv(mW*A)OX>Ce;jPcpg+G~>EX31Azz!(XF*zFs`)R}Br1SN?F2P`7Y?!NK`=yI|< zekK|r&A>NQuna^qsIKNK6cBWimR=@^NNY_f=Xs+#0MctrVHC{IkWkOWB=yjV&1A?e z4#)tlRgc4k8}v|+eh)$)btZKgw-uuNC`$b^(;}*5Mv`s;C(UgAD}Rf_C0FET3UK>B D12Mv! diff --git a/templates/tibiacom/images/account/option_server_pvp_type_optional.gif b/templates/tibiacom/images/account/option_server_pvp_type_optional.gif deleted file mode 100644 index 05fd5ad775f08e05d3e876e3dfb6d64eac2f70e0..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2665 zcmV-v3YPUpNk%w1VK4wN0Qdg@N^OE{3jpi!^~u@ic6@iXxU;dc*tLT(Ni140Gcv}L zGRKGtg|*0$#@FQP@#N>|(yL0^sxQdP$kyWQ`Qv${R|9K#xUJdobEv}j;BRU_A(Db` zI6Rb=e_cCDO=Ow1jH$bEqP!9~R#|NlEemHhh1r^L`x zhpJ3eqj($vJaMA`{=ZgQRfdX&ZF6q?*hph(WUg^5ymkaBTb11A?*93zN`R#Q|K;|> z4=IGR)s_R<>hb>gdo@y&Sx|WS>10@qv{EKM|KU)Wo0n*vykt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K_W%B78ytx_vR3v+#l}Y~lvbIKv)paDXpBKmmw815g5>XEF~2C|j__3j*+h X8w6$2jHa}s$@~JK@OjKk4hR4{s;-z8 diff --git a/templates/tibiacom/images/account/option_server_pvp_type_retro.gif b/templates/tibiacom/images/account/option_server_pvp_type_retro.gif deleted file mode 100644 index 9c8f08c376e6f24e16924b96ec1b734ac7b2e329..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3191 zcmaJ>cR*9;7QZ(;5FlZM01+<10T{9%KqApVLcoD+K?O{J$R>j@q$o*%fCvJjf)y%M zpoj}wo+7S*hzl($Ds{cMaa3`%j;g%i)As$**Zar4-*@isch2v8=X@tHf>GcDkeGpu&!1iyTK!;?Pq$(;T0=PG6L((5}s`gAj^_BK5~ z8@eS3rUz$yT*z6P{>YbwXfmJg~QNIRF68lcupDVUSRwk{G{!^9tmWqztJFN|dIg zW%DS{4;`aGX~{fF3_FAoA{R(g(}D|?(#XQaQAvdvNt|TLyt$BH0k>O?Zk0MEyB}%!*^^}=Tfj&c289a*r)DLJXra-2YLTnn_BZrN)lzcDjvnC^uH-&$wNZ^ zbex?-`(AbdD-Q`j?EqMdw7Vl1u3k(i~Z?GD&KLyL=@Z z&+eZCO#zK+xI$S{Zk9A#HDAc17%jBqv}CT2knQ8?70B}PWHOk{Krer`w@;uz$noSb z133Yntgqbp**Pjnc9QffH|;Mj^B=iffl?|_$&^ttS?1U3g{8_=vYb?z91;kos^tZ_ z#-wE@%kp#FrjGZETB$NEPns-J%Cex(=fh3=8w~+S6s$l>_- zv)JCAY>t5Pg`500xqsn`{x6qq6hogX?*A0~tI60wQ_DYF*SPt!`K8&$j#nC68=U;~ z@xveQ-@SeF`){vby?in8{MoNhpFDmv{_w&5dw1{LHvIe6%^TOR{W5m-%H`2Z7cY$b zeE!_<*)yk4og6wbczmE=f9&Xy!-x6~_8!>(ub!WN+}FK#&+c72yLNQ`(9zzu{rlFI zZQnIFZT)sjW5ec68|ydJ)z+-9u3A^Q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z{!b8U5Q0D8b&5p<+}nPnkO-2U0Z^gWn+!o^FKsj?eAkG!j)&9DTL2`QB*fwLB{ywa z5GyMJ?ADB^iDMcRp<7@}@qsN3v>AjTU3vuDVUD$doIpcn%m5&r8EeGWc|efqP-k#c28|)`R(@g1_opK zIS^!s0bCTLoD$tViLr7Wu)u1xRu}*m4T##b3>_-d-!xCIH!n1xxyt}^_e&Ah{3UP) zd4K(#+kE@EBW?oRMRe#y%lX(FH ZG$>>13>w$53ki#jF?~$Qh5%sBe*nU7w(0-? diff --git a/templates/tibiacom/images/global/content/option_server_location_bra.png b/templates/tibiacom/images/global/content/option_server_location_bra.png deleted file mode 100644 index a8904c73066461c2a1eb9fba29d8c07d1e00eca4..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 5242 zcmV-=6ou=FP)Gb-#-@EtS<@cNV{qB3OLke_wRX4BiTkiXw zbH3-C?>RT3^fYh%Api-g9RF?A)nhfUUL-QDYn`N8C6b9Aq-Y~jb)W>HUyOYBOgK3( z=#38@@QUSEgvAj%0gWx7Bm}`63d;r=LU9txUgb3b={m?Z#pn8c{oBr42CqPsKv|Gj z`hktf`S1FGRL5?DqpPj7g7Hbb!X&m8VI>??6e6q$I~QW7EQU_l^j>%+<-r{XPak!k zK5>A@TIaF3qc=8$ihpLtz$<~UDu98)cx-562Urfs2;Nczl=emhiDkF^ZDQ5kpGJ(n zjo}|Mx@#}P$Hp0Wwa7@n!Ye}}1<7RWO(y~AeC)yI-d+~294FsY&;G3`x|eqnP3_&{ zPM5yj*uf*sEl?`J^ywJ9lZ>CE5R`(*hx!(1?1G?tjsZ>o+4mO>n7aF+Ym+P9^)FE= zx+<{Ou;-DxIIwey6a9+WaTtyA45oXTPP8*i6M` zxF*N4^{xSUWw{83@G|{t8cZnap&zbec>Bnd3xR^vW?KQ>i=QD{b`UdGZji#dO77x}s*Ho_#FB_yE|hPw(#Xl4tr zfgqH;yl;vlJBOK>*u%|Bf5+{Mw~}(o)a9Wx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Kuuv z=WJ}LI&;s!%*B88Cf^^{ZR+0hBEL%H#3ju=g0QGvrg*Wui2p5I&Y77m6H=pBEQRf8 znGh$h=5=$|sM+a^p6oFDP;-Z0&B+ZdAFjK+zyo)$C8sXrnXi7C=f3eY-AnV^M~)ZX z-*<7}iE}aisBROjozUF+7H+dX6m7acD07$R30gaoEWi44W(T)0l5Xa^hgNfFWCi6Q zYld)fmW-$>)yVK&R79endtQN$-W>6n57v`$vuypvA%6eh&lx|E7Og$U0Ns%_9ST!0I}Kx_Fm(n-4uV^VlSl95U6=QjO5EWGTptN&?Mkw6!+aud z457;8+v^!0wP{?KXXUy^W=2aCXA~mcfLD|Z?j7XVj+0EDf|+SZW_hl;ov%9%ztGng zRf!@h(#e8U2AbNSz5%-C!J4;0zUvMCuY_%b=fas`IC&gKk3ld6o`>1*$N z25Y2v7;h9!x3yyDH8jB`Z-XW4pk*P1KFARM59O8PVWK&e_W%F@07*qoM6N<$g4VJ* A1ONa4 diff --git a/templates/tibiacom/images/account/option_server_location_usa.png b/templates/tibiacom/images/global/content/option_server_location_na.png similarity index 100% rename from templates/tibiacom/images/account/option_server_location_usa.png rename to templates/tibiacom/images/global/content/option_server_location_na.png diff --git a/templates/tibiacom/images/global/content/option_server_location_oce.png b/templates/tibiacom/images/global/content/option_server_location_oce.png new file mode 100644 index 0000000000000000000000000000000000000000..731ae1adad903d33f5d8c051c4d39636f30c314c GIT binary patch literal 6582 zcmbVxbyQUS+BPXIUD92`3G*51Fmulv64T6?dx6HJV>X((?|5)cs3=;~;iU5~&&H~Ee0 zr!~d}r2rP;~4T*6<@#^{@+)-vI1Tw^L1f@toK4D)C!`4S|Nf8YmA>olq>w zJk-d-HPp)$g5+0G=2Z-aUMuiH`6GCPeZ0{)Xs{Chzw|<{=YO^V{Jj4X@%K{V|2HYP zp$V@B28-f_NJ&e&0)Zf2d5Dyo3|JQB<|+@o%?kp8WB}6A03bwC8UzJ`pvoU zaSiZ6q5X9=mH4kuq>!FSC=9FylatYum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O) zWl}$fyUF8qMfjpVC?S$ibu;4AB+wh#5-|ht9Yxc=8n4GrZvsrHncLI+wK3 zz-<=KpnTa)Ufh1Aq;PREyFXZEz9 z$sb`J{u&BY)^uSJE}D^Pt=!6K#Z3dI=n7Nm;HiloZ@vzA3G734159H3vJ+oy(^4wl z;#>($QKuS=dv{A>dwiZz;pi}{^(=+s$9W6S>sp=@9;>B;vIlPV7g=6T;+-d&1x3eG z{A8DFULUx$x1fNUh}PD_-hK05N^#NALoBq50T&DlELZG9T{I`_OSaT0wOaMtcpH$Z z)%wfouF|NMm(MB~%;#Au_IK?J7k*CAg%9y>UtKDnUzR=My;uC9dYE)0Mv_W=*@#!ubNc!aqhAC|#tZod=oM&P-{C!0N8;6e4aMbRw7T zhuPF+k@Jy&O?Bg(Xs>qWh1Rr(ZC`tj;$)4KaJMG!ZIEl}m=Omke54!fDsh@UJMtRY zZ@n*)z2D}bbTz30K6!NRzF0iDs!;)2fT^mR>JQXXZ{u`lhR+)a9+wAaNVdR*2odQcRPajB~*74Y*#M4>1S?m7Hp-paKIL} z56;4(>)BQ!`s?)g-!s{tW#8ny2by?-(iTFmccJ<{4ZHXXf6O3qCLcM~_w8jYjHWT? zL!5R7zu1xw-6r7saO1WEg})P(tYjtUskMo!0h8h#!!lYGGJ}lv#1 zW_L`;DJ_8&ou;STmgw7FZqeA@say>yko&Aoj?E#$1tfmpbRkue_~c%bMdyriA*86< z&3Vr3u5D^%HzV!Hwbc)9{M|rfup*TCc

    -{E7ldknfPz08kiB`tv767iOecqwXC2 F{{Yv->U#hH literal 0 HcmV?d00001 diff --git a/templates/tibiacom/images/account/option_server_location_bra.png b/templates/tibiacom/images/global/content/option_server_location_sa.png similarity index 100% rename from templates/tibiacom/images/account/option_server_location_bra.png rename to templates/tibiacom/images/global/content/option_server_location_sa.png diff --git a/templates/tibiacom/images/global/content/option_server_location_usa.png b/templates/tibiacom/images/global/content/option_server_location_usa.png deleted file mode 100644 index 42bb38d082aee8dfb7841d37e6fc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WweXQ z@iMcM#n6(exW#XOtdD z>4)x~H?hrnzrX)WuFZXFyx7wpXVcqmp;39Bsbn`_JHMUtQ(LgzbjZ3oRhZ>DQPlX$ zAUap6cyOr3$L{g@&%^P}^nTWFg|)k0U&yp5 z!fRD%EGc>n)mfN22WBk_9yOCUO+M6W@d?M}9f}e348&P;!zz4h4k2ywy*cJ*bc$>8 zY~5X?KGULEmxyE`+&inBtT1}y3X4~vz69|!Pj~n7Cx*dy)bFdUg$|_RA)cklzIbv9Pz^ssrqH_Vk5h+USN+_L}x002ovPDHLkV1jvM<0Jq8 diff --git a/templates/tibiacom/images/account/option_server_pvp_type_retrohardcore.gif b/templates/tibiacom/images/global/content/option_server_pvp_type_retrohardcore.gif similarity index 100% rename from templates/tibiacom/images/account/option_server_pvp_type_retrohardcore.gif rename to templates/tibiacom/images/global/content/option_server_pvp_type_retrohardcore.gif diff --git a/templates/tibiacom/images/global/content/option_server_pvp_type_retrohardcore.png b/templates/tibiacom/images/global/content/option_server_pvp_type_retrohardcore.png deleted file mode 100644 index 637bc672b885f5e22a09108c8f361512b3a0cffd..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 7158 zcmbVxWn5J6+Ac~rigbg7^bErQBON0t9nu2~Jq$2IBPcM0gtQ3F9hlJ?n zZF>7W>SkaJu1@V{T{+C_I&HV4S7&qs?AZRx^?thCi z)6wHpL3+bEB}Ks^_5cYWr<9B+KvD)M4HD)AiUYu6;vg}Aj0ivia&v>kIsbEU-+1$O zaD*7BLjU9IW+lh%j7EDx#Kipk{6zgEM3LT3H(VJRF>#<65GZnk5J3fapke+Z9w?rF zEU3a!_TDa@Xcwdh=U+$06&u8Oqx zLBKuG8me;KH(x{@TpS>3l1ge|2~{ZoSVmkG3INCefIuizRYpQwMjQ-OQvJuq|HPF7 zC;`~ER;KV|dJ)=e$`o&L88ZWjM-Be=&+?|9!diK?8oD;^#rtA?tQk^i?;bJA2x zcxDT-?CEZ8pay?VtqRE#&gTS)yox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;=ByLNsTKG3#>OA zFm@w zcLZ~99?uVm4S%z@@O+94`RKEb4mf?6u&TZk9rTkD&V5+dPC2AMj1NAY6@W=?J3>lv zUk!cVAHcWiTI>p!K600&Mf9X&ZY^9NA`UUl!xS`+n-lQ=>}PEr>av+%grKgj8M32l zE6^HMSv>by;zH@hvw7BEdaVk#TZBFvQ_<57UwV*nH$J_k?LE}cG%#{7Lt$n?9qJQ%2Yn?}50*A+=Krgg7E}`!9ESRUf7BD$~nXyUfws@KQYIk3!dHw1a zO9(*vAikLEv^tV2?|oO){FazXz-54No@~Z9Aub7MRB1KjjlZMW`v5M!H?+Z`Pjr~m z9>|zKL<=`I5NpZ%@~%Spedj_6+OCJ%Y%lK>WVP2Rcv@YKE3zsyIsK+~KOhpzuCxAQ z7&715dWxcU=Lk@)oGWKM?=9qSy{KWN9;pkXK;iq3`C~YwgaQHz!8xu*9DLD$W_v zpVSfu1)@*YD#OUCQj7BqxZN)SjC8~+#JzxKr+Wd8I!Dq|7gRs{Ic87Z%tu+fZMXeF zcZcW92;DblI?fP4+fJqluMSP0VMjEJPy=(efDnCc7@WCw?UeoU4l7Cb-u=llo?L&w-9zNP zUmRD{(bF{qtUXbSvFTNgU_3-DDemW%^djZ4s|0z_8+-c4ofp>Ob?ygXXHe(fRG{@I zRl__x8jh>(vc{Sr-}k&e<4-oI1%Ca=FC#BCXkvU3E==y1A?X!{H{a#<1Jhf#zPst; z3cucZm~OgmeI-yO703haZHUm{wNcqP8chg16q5SG-;P(>+ez`KOiBCipEwP*$EsLm H+pzxwyX8G4 diff --git a/templates/tibiacom/index.php b/templates/tibiacom/index.php index e911152ab..89f0c8876 100644 --- a/templates/tibiacom/index.php +++ b/templates/tibiacom/index.php @@ -13,6 +13,7 @@ + diff --git a/tools/css/custom.css b/tools/css/custom.css new file mode 100644 index 000000000..8d75a18fd --- /dev/null +++ b/tools/css/custom.css @@ -0,0 +1,846 @@ +:root { + --columnWidth: calc(100% / 12) +} + +.row { + display: flex; + flex-direction: row; + flex-wrap: wrap; + box-sizing: border-box +} + +.col-1, .col-10, .col-11, .col-12, .col-2, .col-3, .col-4, .col-5, .col-6, .col-7, .col-8, .col-9, .col-lg-1, .col-lg-10, .col-lg-11, .col-lg-12, .col-lg-2, .col-lg-3, .col-lg-4, .col-lg-5, .col-lg-6, .col-lg-7, .col-lg-8, .col-lg-9, .col-md-1, .col-md-10, .col-md-11, .col-md-12, .col-md-2, .col-md-3, .col-md-4, .col-md-5, .col-md-6, .col-md-7, .col-md-8, .col-md-9, .col-sm-1, .col-sm-10, .col-sm-11, .col-sm-12, .col-sm-2, .col-sm-3, .col-sm-4, .col-sm-5, .col-sm-6, .col-sm-7, .col-sm-8, .col-sm-9 { + display: flex; + flex-direction: column; + flex-wrap: wrap; + padding-left: .8rem; + padding-right: .8rem; + box-sizing: border-box; + width: calc(var(--columnWidth) * 12) +} + +@media (min-width: 0px) { + .col-1 { + width: calc(var(--columnWidth) * 1) + } + + .col-2 { + width: calc(var(--columnWidth) * 2) + } + + .col-3 { + width: calc(var(--columnWidth) * 3) + } + + .col-4 { + width: calc(var(--columnWidth) * 4) + } + + .col-5 { + width: calc(var(--columnWidth) * 5) + } + + .col-6 { + width: calc(var(--columnWidth) * 6) + } + + .col-7 { + width: calc(var(--columnWidth) * 7) + } + + .col-8 { + width: calc(var(--columnWidth) * 8) + } + + .col-9 { + width: calc(var(--columnWidth) * 9) + } + + .col-10 { + width: calc(var(--columnWidth) * 10) + } + + .col-11 { + width: calc(var(--columnWidth) * 11) + } + + .col-12 { + width: calc(var(--columnWidth) * 12) + } +} + +@media (min-width: 767px) { + .col-sm-1 { + width: calc(var(--columnWidth) * 1) + } + + .col-sm-2 { + width: calc(var(--columnWidth) * 2) + } + + .col-sm-3 { + width: calc(var(--columnWidth) * 3) + } + + .col-sm-4 { + width: calc(var(--columnWidth) * 4) + } + + .col-sm-5 { + width: calc(var(--columnWidth) * 5) + } + + .col-sm-6 { + width: calc(var(--columnWidth) * 6) + } + + .col-sm-7 { + width: calc(var(--columnWidth) * 7) + } + + .col-sm-8 { + width: calc(var(--columnWidth) * 8) + } + + .col-sm-9 { + width: calc(var(--columnWidth) * 9) + } + + .col-sm-10 { + width: calc(var(--columnWidth) * 10) + } + + .col-sm-11 { + width: calc(var(--columnWidth) * 11) + } + + .col-sm-12 { + width: calc(var(--columnWidth) * 12) + } +} + +@media (min-width: 991px) { + .col-md-1 { + width: calc(var(--columnWidth) * 1) + } + + .col-md-2 { + width: calc(var(--columnWidth) * 2) + } + + .col-md-3 { + width: calc(var(--columnWidth) * 3) + } + + .col-md-4 { + width: calc(var(--columnWidth) * 4) + } + + .col-md-5 { + width: calc(var(--columnWidth) * 5) + } + + .col-md-6 { + width: calc(var(--columnWidth) * 6) + } + + .col-md-7 { + width: calc(var(--columnWidth) * 7) + } + + .col-md-8 { + width: calc(var(--columnWidth) * 8) + } + + .col-md-9 { + width: calc(var(--columnWidth) * 9) + } + + .col-md-10 { + width: calc(var(--columnWidth) * 10) + } + + .col-md-11 { + width: calc(var(--columnWidth) * 11) + } + + .col-md-12 { + width: calc(var(--columnWidth) * 12) + } +} + +@media (min-width: 1200px) { + .col-lg-1 { + width: calc(var(--columnWidth) * 1) + } + + .col-lg-2 { + width: calc(var(--columnWidth) * 2) + } + + .col-lg-3 { + width: calc(var(--columnWidth) * 3) + } + + .col-lg-4 { + width: calc(var(--columnWidth) * 4) + } + + .col-lg-5 { + width: calc(var(--columnWidth) * 5) + } + + .col-lg-6 { + width: calc(var(--columnWidth) * 6) + } + + .col-lg-7 { + width: calc(var(--columnWidth) * 7) + } + + .col-lg-8 { + width: calc(var(--columnWidth) * 8) + } + + .col-lg-9 { + width: calc(var(--columnWidth) * 9) + } + + .col-lg-10 { + width: calc(var(--columnWidth) * 10) + } + + .col-lg-11 { + width: calc(var(--columnWidth) * 11) + } + + .col-lg-12 { + width: calc(var(--columnWidth) * 12) + } +} + +.flex-row { + flex-direction: row !important; +} + +.flex-column { + flex-direction: column !important; +} + +.flex-row-reverse { + flex-direction: row-reverse !important; +} + +.flex-column-reverse { + flex-direction: column-reverse !important; +} + +.flex-grow-0 { + flex-grow: 0 !important; +} + +.flex-grow-1 { + flex-grow: 1 !important; +} + +.flex-shrink-0 { + flex-shrink: 0 !important; +} + +.flex-shrink-1 { + flex-shrink: 1 !important; +} + +.flex-wrap { + flex-wrap: wrap !important; +} + +.flex-nowrap { + flex-wrap: nowrap !important; +} + +.flex-wrap-reverse { + flex-wrap: wrap-reverse !important; +} + +.gap-0 { + gap: 0 !important; +} + +.gap-1 { + gap: 0.25rem !important; +} + +.gap-2 { + gap: 0.5rem !important; +} + +.gap-3 { + gap: 1rem !important; +} + +.gap-4 { + gap: 1.5rem !important; +} + +.gap-5 { + gap: 3rem !important; +} + +.justify-content-start { + justify-content: flex-start !important; +} + +.justify-content-end { + justify-content: flex-end !important; +} + +.justify-content-center { + justify-content: center !important; +} + +.justify-content-between { + justify-content: space-between !important; +} + +.justify-content-around { + justify-content: space-around !important; +} + +.justify-content-evenly { + justify-content: space-evenly !important; +} + +.align-items-start { + align-items: flex-start !important; +} + +.align-items-end { + align-items: flex-end !important; +} + +.align-items-center { + align-items: center !important; +} + +.align-items-baseline { + align-items: baseline !important; +} + +.align-items-stretch { + align-items: stretch !important; +} + +.align-content-start { + align-content: flex-start !important; +} + +.align-content-end { + align-content: flex-end !important; +} + +.align-content-center { + align-content: center !important; +} + +.align-content-between { + align-content: space-between !important; +} + +.align-content-around { + align-content: space-around !important; +} + +.align-content-stretch { + align-content: stretch !important; +} + +.align-self-auto { + align-self: auto !important; +} + +.align-self-start { + align-self: flex-start !important; +} + +.align-self-end { + align-self: flex-end !important; +} + +.align-self-center { + align-self: center !important; +} + +.align-self-baseline { + align-self: baseline !important; +} + +.align-self-stretch { + align-self: stretch !important; +} + +.order-first { + order: -1 !important; +} + +.order-0 { + order: 0 !important; +} + +.order-1 { + order: 1 !important; +} + +.order-2 { + order: 2 !important; +} + +.order-3 { + order: 3 !important; +} + +.order-4 { + order: 4 !important; +} + +.order-5 { + order: 5 !important; +} + +.order-last { + order: 6 !important; +} + +.m-0 { + margin: 0 !important; +} + +.m-1 { + margin: 0.25rem !important; +} + +.m-2 { + margin: 0.5rem !important; +} + +.m-3 { + margin: 1rem !important; +} + +.m-4 { + margin: 1.5rem !important; +} + +.m-5 { + margin: 3rem !important; +} + +.m-auto { + margin: auto !important; +} + +.mx-0 { + margin-right: 0 !important; + margin-left: 0 !important; +} + +.mx-1 { + margin-right: 0.25rem !important; + margin-left: 0.25rem !important; +} + +.mx-2 { + margin-right: 0.5rem !important; + margin-left: 0.5rem !important; +} + +.mx-3 { + margin-right: 1rem !important; + margin-left: 1rem !important; +} + +.mx-4 { + margin-right: 1.5rem !important; + margin-left: 1.5rem !important; +} + +.mx-5 { + margin-right: 3rem !important; + margin-left: 3rem !important; +} + +.mx-auto { + margin-right: auto !important; + margin-left: auto !important; +} + +.my-0 { + margin-top: 0 !important; + margin-bottom: 0 !important; +} + +.my-1 { + margin-top: 0.25rem !important; + margin-bottom: 0.25rem !important; +} + +.my-2 { + margin-top: 0.5rem !important; + margin-bottom: 0.5rem !important; +} + +.my-3 { + margin-top: 1rem !important; + margin-bottom: 1rem !important; +} + +.my-4 { + margin-top: 1.5rem !important; + margin-bottom: 1.5rem !important; +} + +.my-5 { + margin-top: 3rem !important; + margin-bottom: 3rem !important; +} + +.my-auto { + margin-top: auto !important; + margin-bottom: auto !important; +} + +.mt-0 { + margin-top: 0 !important; +} + +.mt-1 { + margin-top: 0.25rem !important; +} + +.mt-2 { + margin-top: 0.5rem !important; +} + +.mt-3 { + margin-top: 1rem !important; +} + +.mt-4 { + margin-top: 1.5rem !important; +} + +.mt-5 { + margin-top: 3rem !important; +} + +.mt-auto { + margin-top: auto !important; +} + +.me-0 { + margin-right: 0 !important; +} + +.me-1 { + margin-right: 0.25rem !important; +} + +.me-2 { + margin-right: 0.5rem !important; +} + +.me-3 { + margin-right: 1rem !important; +} + +.me-4 { + margin-right: 1.5rem !important; +} + +.me-5 { + margin-right: 3rem !important; +} + +.me-auto { + margin-right: auto !important; +} + +.mb-0 { + margin-bottom: 0 !important; +} + +.mb-1 { + margin-bottom: 0.25rem !important; +} + +.mb-2 { + margin-bottom: 0.5rem !important; +} + +.mb-3 { + margin-bottom: 1rem !important; +} + +.mb-4 { + margin-bottom: 1.5rem !important; +} + +.mb-5 { + margin-bottom: 3rem !important; +} + +.mb-auto { + margin-bottom: auto !important; +} + +.ms-0 { + margin-left: 0 !important; +} + +.ms-1 { + margin-left: 0.25rem !important; +} + +.ms-2 { + margin-left: 0.5rem !important; +} + +.ms-3 { + margin-left: 1rem !important; +} + +.ms-4 { + margin-left: 1.5rem !important; +} + +.ms-5 { + margin-left: 3rem !important; +} + +.ms-auto { + margin-left: auto !important; +} + +.p-0 { + padding: 0 !important; +} + +.p-1 { + padding: 0.25rem !important; +} + +.p-2 { + padding: 0.5rem !important; +} + +.p-3 { + padding: 1rem !important; +} + +.p-4 { + padding: 1.5rem !important; +} + +.p-5 { + padding: 3rem !important; +} + +.px-0 { + padding-right: 0 !important; + padding-left: 0 !important; +} + +.px-1 { + padding-right: 0.25rem !important; + padding-left: 0.25rem !important; +} + +.px-2 { + padding-right: 0.5rem !important; + padding-left: 0.5rem !important; +} + +.px-3 { + padding-right: 1rem !important; + padding-left: 1rem !important; +} + +.px-4 { + padding-right: 1.5rem !important; + padding-left: 1.5rem !important; +} + +.px-5 { + padding-right: 3rem !important; + padding-left: 3rem !important; +} + +.py-0 { + padding-top: 0 !important; + padding-bottom: 0 !important; +} + +.py-1 { + padding-top: 0.25rem !important; + padding-bottom: 0.25rem !important; +} + +.py-2 { + padding-top: 0.5rem !important; + padding-bottom: 0.5rem !important; +} + +.py-3 { + padding-top: 1rem !important; + padding-bottom: 1rem !important; +} + +.py-4 { + padding-top: 1.5rem !important; + padding-bottom: 1.5rem !important; +} + +.py-5 { + padding-top: 3rem !important; + padding-bottom: 3rem !important; +} + +.pt-0 { + padding-top: 0 !important; +} + +.pt-1 { + padding-top: 0.25rem !important; +} + +.pt-2 { + padding-top: 0.5rem !important; +} + +.pt-3 { + padding-top: 1rem !important; +} + +.pt-4 { + padding-top: 1.5rem !important; +} + +.pt-5 { + padding-top: 3rem !important; +} + +.pe-0 { + padding-right: 0 !important; +} + +.pe-1 { + padding-right: 0.25rem !important; +} + +.pe-2 { + padding-right: 0.5rem !important; +} + +.pe-3 { + padding-right: 1rem !important; +} + +.pe-4 { + padding-right: 1.5rem !important; +} + +.pe-5 { + padding-right: 3rem !important; +} + +.pb-0 { + padding-bottom: 0 !important; +} + +.pb-1 { + padding-bottom: 0.25rem !important; +} + +.pb-2 { + padding-bottom: 0.5rem !important; +} + +.pb-3 { + padding-bottom: 1rem !important; +} + +.pb-4 { + padding-bottom: 1.5rem !important; +} + +.pb-5 { + padding-bottom: 3rem !important; +} + +.ps-0 { + padding-left: 0 !important; +} + +.ps-1 { + padding-left: 0.25rem !important; +} + +.ps-2 { + padding-left: 0.5rem !important; +} + +.ps-3 { + padding-left: 1rem !important; +} + +.ps-4 { + padding-left: 1.5rem !important; +} + +.ps-5 { + padding-left: 3rem !important; +} + +.text-start { + text-align: left !important; +} + +.text-end { + text-align: right !important; +} + +.text-center { + text-align: center !important; +} + +.text-decoration-none { + text-decoration: none !important; +} + +.text-decoration-underline { + text-decoration: underline !important; +} + +.text-decoration-line-through { + text-decoration: line-through !important; +} + +.text-lowercase { + text-transform: lowercase !important; +} + +.text-uppercase { + text-transform: uppercase !important; +} + +.text-capitalize { + text-transform: capitalize !important; +} + +.text-wrap { + white-space: normal !important; +} + +.text-nowrap { + white-space: nowrap !important; +} From 093f026e3131f3fc764ca276e138da71f5e14108 Mon Sep 17 00:00:00 2001 From: Elson Costa Date: Fri, 30 Aug 2024 15:07:51 -0300 Subject: [PATCH 27/42] worlds: added needed columns. functions: created a function that generates queries to facilitate data insertion. clientcreateaccount & login: improvements. --- admin/pages/worlds.php | 59 +++++++++++++++++++++++++++------- clientcreateaccount.php | 21 ++++++------ login.php | 12 +++---- system/functions.php | 34 +++++++++++++++++--- system/libs/pot/OTS_Player.php | 7 +--- 5 files changed, 95 insertions(+), 38 deletions(-) diff --git a/admin/pages/worlds.php b/admin/pages/worlds.php index 8263b5886..159838a2f 100644 --- a/admin/pages/worlds.php +++ b/admin/pages/worlds.php @@ -53,6 +53,10 @@ function echo_error($message) if (!$port = $_POST['port']) { echo_error("Port is required!"); } + if (!$location = $_POST['location']) { + echo_error("Location is required!"); + } + $motd = $_POST['motd'] ?? ''; if ($id = $_POST['world_id'] ?? null) { $world = $id > 0 ? $db->query("SELECT * FROM `worlds` WHERE `id` = {$id}")->fetch() : null; @@ -61,23 +65,34 @@ function echo_error($message) } if (!$error) { - $db->exec("UPDATE `worlds` SET `name` = {$db->quote($name)}, `type` = {$db->quote($type)}, `ip` = {$db->quote($ip)}, `port` = {$port} WHERE `id` = {$id}"); + $db->exec("UPDATE `worlds` SET `name` = {$db->quote($name)}, `type` = {$db->quote($type)}, `motd` = {$db->quote($motd)}, `location` = {$db->quote($location)}, `ip` = {$db->quote($ip)}, `port` = {$port} WHERE `id` = {$id}"); echo_success("World {$name} saved at: " . date('G:i')); } } else { if ($db->query("SELECT `id` FROM `worlds` WHERE `name` = {$db->quote($name)}")->fetch()) { echo_error("World name is already in use!"); + } else if ($port == 7171) { + echo_error("World port is unavailable!"); } else if ($db->query("SELECT `id` FROM `worlds` WHERE `port` = {$port}")->fetch()) { echo_error("World port is already in use!"); } if (!$error) { try { - $godName = "GOD on {$name}"; - $db->exec("INSERT INTO `worlds` (`name`, `type`, `ip`, `port`) VALUES ({$db->quote($name)}, {$db->quote($type)}, {$db->quote($ip)}, {$port});"); - $sql = "INSERT INTO `players` (`name`, `group_id`, `account_id`, `level`, `vocation`, `health`, `healthmax`, `experience`, `lookbody`, `lookfeet`, `lookhead`, `looklegs`, `looktype`, `maglevel`, `mana`, `manamax`, `manaspent`, `town_id`, `conditions`, `cap`, `sex`, `skill_club`, `skill_club_tries`, `skill_sword`, `skill_sword_tries`, `skill_axe`, `skill_axe_tries`, `skill_dist`, `skill_dist_tries`, `world_id`) VALUES ('{$godName}', 6, {$account_logged->getId()}, 2, 0, 155, 155, 100, 113, 115, 95, 39, 75, 0, 60, 60, 0, 8, '', 410, 1, 10, 0, 10, 0, 10, 0, 10, 0, {$db->lastInsertId()})"; - $db->query($sql); - echo_success("World {$name} and '{$godName}' created at: " . date('G:i')); + generateQueryBuild('worlds', [ + 'name' => $db->quote($name), 'type' => $db->quote($type), 'ip' => $db->quote($ip), + 'port' => $port, 'location' => $location, 'motd' => $motd, 'creation' => time() + ]); + + generateQueryBuild('players', [ + 'name' => $godName = "GOD on {$name}", 'group_id' => 6, 'account_id' => $account_logged->getId(), + 'level' => 2, 'vocation' => 0, 'health' => 155, 'healthmax' => 155, 'experience' => 100, 'lookbody' => 113, + 'lookfeet' => 115, 'lookhead' => 95, 'looklegs' => 39, 'looktype' => 75, 'maglevel' => 0, 'mana' => 60, + 'manamax' => 60, 'manaspent' => 0, 'town_id' => 8, 'conditions' => '', 'cap' => 410, 'sex' => 1, + 'skill_club' => 10, 'skill_club_tries' => 0, 'skill_sword' => 10, 'skill_sword_tries' => 0, 'skill_axe' => 10, + 'skill_axe_tries' => 0, 'skill_dist' => 10, 'skill_dist_tries' => 0, 'world_id' => $db->lastInsertId() + ]); + echo_success("World {$name} and '{$godName}' created at: " . date('H:i')); $action = "list"; // header("Location: $base"); // $twig->display('success.html.twig', array( @@ -122,11 +137,11 @@ function echo_error($message)

    @@ -142,6 +157,24 @@ function echo_error($message) autocomplete="off" style="cursor: auto;" maxlength="5" value="" required />
    +
    + + +
    +
    + + +
    @@ -161,7 +194,7 @@ class="fa fa-remove"> Cancel $worlds = $db->query("SELECT * FROM `worlds` ORDER BY `id` ASC")->fetchAll(); ?>
    -
    +

    Worlds found on your server

    @@ -176,18 +209,22 @@ class="fa fa-plus-circle"> New ID Name - Server Type + Server Type + Location IP Port + Created at - + + + diff --git a/clientcreateaccount.php b/clientcreateaccount.php index 87532c19f..1c1b01b7b 100644 --- a/clientcreateaccount.php +++ b/clientcreateaccount.php @@ -30,9 +30,10 @@ switch ($action) { case 'getaccountcreationstatus': + $data = getWorldsData(); $response = json_encode([ - "Worlds" => getWorlds(), - "RecommendedWorld" => configLua('serverName'), + "Worlds" => $data['data'], + "RecommendedWorld" => $data['recommended'], "IsCaptchaDeactivated" => true ]); break; @@ -124,7 +125,7 @@ * * @return array */ -function getWorlds() +function getWorldsData(): array { global $db; $response = []; @@ -134,15 +135,15 @@ function getWorlds() "Name" => $world['name'], "PlayersOnline" => intval($playersOnline), "CreationDate" => intval($world['creation'] ?? 0), - "Region" => $world['location'] ?? "America", + "Region" => $world['location'], "PvPType" => getWorldType($world['type']), "PremiumOnly" => configLua('onlyPremiumAccount'), - "TransferType" => "Blocked", + "TransferType" => "Blocked", //or "Available" "BattlEyeActivationTimestamp" => intval($world['creation'] ?? 0), - "BattlEyeInitiallyActive" => 0 + "BattlEyeInitiallyActive" => 1 ]; } - return $response; + return ['data' => $response, 'recommended' => $response[array_rand($response)]['Name']]; } /** @@ -171,7 +172,7 @@ function validatePassword($password): array * Function to create account * * @param array $data - * @return false|string + * @return string * @throws Exception */ function createAccount(array $data) @@ -238,13 +239,13 @@ function createAccount(array $data) 'verify_url' => generateLink($verify_url, $verify_url, true) )); - if (!_mail($data['email'], 'New account on ' . configLua('serverName'), $body_html)) { + if (!_mail($data['email'], 'New account on ' . $data['selectedWorld'], $body_html)) { $new_account->delete(); throw new Exception('An error occurred while sending email! Account not created. Try again. For Admin: More info can be found in system/logs/mailer-error.log'); } } else if ($config['mail_enabled'] && $config['account_welcome_mail']) { $mailBody = $twig->render('account.welcome_mail.html.twig', ['account' => $account_name]); - if (!_mail($data['email'], 'Your account on ' . configLua('serverName'), $mailBody)) { + if (!_mail($data['email'], 'Your account on ' . $data['selectedWorld'], $mailBody)) { throw new Exception('An error occurred while sending email. For Admin: More info can be found in system/logs/mailer-error.log'); } } diff --git a/login.php b/login.php index 0f250fc21..995c1fc99 100644 --- a/login.php +++ b/login.php @@ -115,8 +115,8 @@ function jsonCompendium() $bossBoost = $db->query("SELECT * FROM " . $db->tableName('boosted_boss'))->fetchAll(); die(json_encode([ 'boostedcreature' => true, - 'creatureraceid' => intval($creatureBoost[0]['raceid']), - 'bossraceid' => intval($bossBoost[0]['raceid']) + 'creatureraceid' => intval($creatureBoost[0]['raceid'] ?? 0), + 'bossraceid' => intval($bossBoost[0]['raceid'] ?? 0) ])); case 'login': @@ -133,13 +133,13 @@ function jsonCompendium() 'externalport' => $world['port'], 'externalportprotected' => $world['port'], 'externalportunprotected' => $world['port'], - 'previewstate' => 0, - 'location' => 'BRA', // BRA, EUR, USA + 'previewstate' => 0, // 0 => regular or 1 => experimental + 'location' => $world['location'], 'anticheatprotection' => false, - 'pvptype' => array_search($world['type'], ['pvp', 'no-pvp', 'pvp-enforced']), + 'pvptype' => array_search($world['type'], ['pvp', 'no-pvp', 'pvp-enforced', 'retro-pvp', 'retro-pvp-enforced']), 'istournamentworld' => false, 'restrictedstore' => false, - 'currenttournamentphase' => 2 + 'currenttournamentphase' => 0 ]; } } diff --git a/system/functions.php b/system/functions.php index 277bba0ce..00e1607be 100644 --- a/system/functions.php +++ b/system/functions.php @@ -1027,16 +1027,17 @@ function getWorldName($id): string */ function getWorldType(string $type): string { - $retro = configLua('toggleServerIsRetroPVP') ? 'Retro ' : ''; switch ($type) { case 'pvp': - return "{$retro}Open PvP"; + return "Open PvP"; case 'no-pvp': - case 'non-pvp': return 'Optional PvP'; case 'pvp-enforced': - case 'enforced': - return "{$retro}Hardcore PvP"; + return "Hardcore PvP"; + case 'retro-pvp': + return "Retro Open PvP"; + case 'retro-pvp-enforced': + return "Retro Hardcore PvP"; default: return $type; } @@ -1774,6 +1775,29 @@ function getPlayerNameByAccount($id, $name = null, $only = true, $orderBy = 'id' return ''; } +function generateQueryBuild(string $tableName, array $fields = [], $exec = true, $update = false) +{ + global $db; + + $columns = implode(', ', array_keys($fields)); + $values = implode(', ', array_map(function ($value) use ($db) { + if (is_string($value)) { + return preg_match('/^\'[^\']*\'$/', $value) || preg_match('/^\"[^\"]*\"$/', $value) ? + $value : $db->quote($value); + } + return $value; + }, array_values($fields))); + + // INSERT query on database + $sql = "INSERT INTO `$tableName` ($columns) VALUES ($values)"; + try { + if (!$exec) return $sql; + $db->exec($sql); + } catch (Exception $e) { + log_append('query_build.log', "Error on query: ['$sql'] -> {$e->getMessage()}"); + } +} + // validator functions require_once LIBS . 'validator.php'; require_once SYSTEM . 'compat/base.php'; diff --git a/system/libs/pot/OTS_Player.php b/system/libs/pot/OTS_Player.php index 5d00e3bed..473a44606 100644 --- a/system/libs/pot/OTS_Player.php +++ b/system/libs/pot/OTS_Player.php @@ -468,13 +468,8 @@ public function save() } } - $columns = implode(', ', array_keys($fields)); - $values = implode(', ', array_values($fields)); - // INSERT query on database - log_append('test.log', "query: INSERT INTO `players` ($columns) VALUES ($values)"); - - $this->db->query("INSERT INTO `players` ($columns) VALUES ($values)"); + $this->db->query(generateQueryBuild('players', $fields, false)); // ID of new player $this->data['id'] = $this->db->lastInsertId(); } From 6f9a11bb9726cbe340e4f4767f390646e8d3f762 Mon Sep 17 00:00:00 2001 From: GitHub Actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 30 Aug 2024 18:08:46 +0000 Subject: [PATCH 28/42] PHP code format - (prettier) --- system/functions.php | 30 +++++---- tools/css/custom.css | 155 ++++++++++++++++++++++++++++--------------- 2 files changed, 119 insertions(+), 66 deletions(-) diff --git a/system/functions.php b/system/functions.php index 00e1607be..a3a9f66b4 100644 --- a/system/functions.php +++ b/system/functions.php @@ -1029,15 +1029,15 @@ function getWorldType(string $type): string { switch ($type) { case 'pvp': - return "Open PvP"; + return 'Open PvP'; case 'no-pvp': return 'Optional PvP'; case 'pvp-enforced': - return "Hardcore PvP"; + return 'Hardcore PvP'; case 'retro-pvp': - return "Retro Open PvP"; + return 'Retro Open PvP'; case 'retro-pvp-enforced': - return "Retro Hardcore PvP"; + return 'Retro Hardcore PvP'; default: return $type; } @@ -1780,18 +1780,24 @@ function generateQueryBuild(string $tableName, array $fields = [], $exec = true, global $db; $columns = implode(', ', array_keys($fields)); - $values = implode(', ', array_map(function ($value) use ($db) { - if (is_string($value)) { - return preg_match('/^\'[^\']*\'$/', $value) || preg_match('/^\"[^\"]*\"$/', $value) ? - $value : $db->quote($value); - } - return $value; - }, array_values($fields))); + $values = implode( + ', ', + array_map(function ($value) use ($db) { + if (is_string($value)) { + return preg_match('/^\'[^\']*\'$/', $value) || preg_match('/^\"[^\"]*\"$/', $value) + ? $value + : $db->quote($value); + } + return $value; + }, array_values($fields)) + ); // INSERT query on database $sql = "INSERT INTO `$tableName` ($columns) VALUES ($values)"; try { - if (!$exec) return $sql; + if (!$exec) { + return $sql; + } $db->exec($sql); } catch (Exception $e) { log_append('query_build.log', "Error on query: ['$sql'] -> {$e->getMessage()}"); diff --git a/tools/css/custom.css b/tools/css/custom.css index 8d75a18fd..66b646cd7 100644 --- a/tools/css/custom.css +++ b/tools/css/custom.css @@ -1,221 +1,268 @@ :root { - --columnWidth: calc(100% / 12) + --columnWidth: calc(100% / 12); } .row { display: flex; flex-direction: row; flex-wrap: wrap; - box-sizing: border-box + box-sizing: border-box; } -.col-1, .col-10, .col-11, .col-12, .col-2, .col-3, .col-4, .col-5, .col-6, .col-7, .col-8, .col-9, .col-lg-1, .col-lg-10, .col-lg-11, .col-lg-12, .col-lg-2, .col-lg-3, .col-lg-4, .col-lg-5, .col-lg-6, .col-lg-7, .col-lg-8, .col-lg-9, .col-md-1, .col-md-10, .col-md-11, .col-md-12, .col-md-2, .col-md-3, .col-md-4, .col-md-5, .col-md-6, .col-md-7, .col-md-8, .col-md-9, .col-sm-1, .col-sm-10, .col-sm-11, .col-sm-12, .col-sm-2, .col-sm-3, .col-sm-4, .col-sm-5, .col-sm-6, .col-sm-7, .col-sm-8, .col-sm-9 { +.col-1, +.col-10, +.col-11, +.col-12, +.col-2, +.col-3, +.col-4, +.col-5, +.col-6, +.col-7, +.col-8, +.col-9, +.col-lg-1, +.col-lg-10, +.col-lg-11, +.col-lg-12, +.col-lg-2, +.col-lg-3, +.col-lg-4, +.col-lg-5, +.col-lg-6, +.col-lg-7, +.col-lg-8, +.col-lg-9, +.col-md-1, +.col-md-10, +.col-md-11, +.col-md-12, +.col-md-2, +.col-md-3, +.col-md-4, +.col-md-5, +.col-md-6, +.col-md-7, +.col-md-8, +.col-md-9, +.col-sm-1, +.col-sm-10, +.col-sm-11, +.col-sm-12, +.col-sm-2, +.col-sm-3, +.col-sm-4, +.col-sm-5, +.col-sm-6, +.col-sm-7, +.col-sm-8, +.col-sm-9 { display: flex; flex-direction: column; flex-wrap: wrap; - padding-left: .8rem; - padding-right: .8rem; + padding-left: 0.8rem; + padding-right: 0.8rem; box-sizing: border-box; - width: calc(var(--columnWidth) * 12) + width: calc(var(--columnWidth) * 12); } @media (min-width: 0px) { .col-1 { - width: calc(var(--columnWidth) * 1) + width: calc(var(--columnWidth) * 1); } .col-2 { - width: calc(var(--columnWidth) * 2) + width: calc(var(--columnWidth) * 2); } .col-3 { - width: calc(var(--columnWidth) * 3) + width: calc(var(--columnWidth) * 3); } .col-4 { - width: calc(var(--columnWidth) * 4) + width: calc(var(--columnWidth) * 4); } .col-5 { - width: calc(var(--columnWidth) * 5) + width: calc(var(--columnWidth) * 5); } .col-6 { - width: calc(var(--columnWidth) * 6) + width: calc(var(--columnWidth) * 6); } .col-7 { - width: calc(var(--columnWidth) * 7) + width: calc(var(--columnWidth) * 7); } .col-8 { - width: calc(var(--columnWidth) * 8) + width: calc(var(--columnWidth) * 8); } .col-9 { - width: calc(var(--columnWidth) * 9) + width: calc(var(--columnWidth) * 9); } .col-10 { - width: calc(var(--columnWidth) * 10) + width: calc(var(--columnWidth) * 10); } .col-11 { - width: calc(var(--columnWidth) * 11) + width: calc(var(--columnWidth) * 11); } .col-12 { - width: calc(var(--columnWidth) * 12) + width: calc(var(--columnWidth) * 12); } } @media (min-width: 767px) { .col-sm-1 { - width: calc(var(--columnWidth) * 1) + width: calc(var(--columnWidth) * 1); } .col-sm-2 { - width: calc(var(--columnWidth) * 2) + width: calc(var(--columnWidth) * 2); } .col-sm-3 { - width: calc(var(--columnWidth) * 3) + width: calc(var(--columnWidth) * 3); } .col-sm-4 { - width: calc(var(--columnWidth) * 4) + width: calc(var(--columnWidth) * 4); } .col-sm-5 { - width: calc(var(--columnWidth) * 5) + width: calc(var(--columnWidth) * 5); } .col-sm-6 { - width: calc(var(--columnWidth) * 6) + width: calc(var(--columnWidth) * 6); } .col-sm-7 { - width: calc(var(--columnWidth) * 7) + width: calc(var(--columnWidth) * 7); } .col-sm-8 { - width: calc(var(--columnWidth) * 8) + width: calc(var(--columnWidth) * 8); } .col-sm-9 { - width: calc(var(--columnWidth) * 9) + width: calc(var(--columnWidth) * 9); } .col-sm-10 { - width: calc(var(--columnWidth) * 10) + width: calc(var(--columnWidth) * 10); } .col-sm-11 { - width: calc(var(--columnWidth) * 11) + width: calc(var(--columnWidth) * 11); } .col-sm-12 { - width: calc(var(--columnWidth) * 12) + width: calc(var(--columnWidth) * 12); } } @media (min-width: 991px) { .col-md-1 { - width: calc(var(--columnWidth) * 1) + width: calc(var(--columnWidth) * 1); } .col-md-2 { - width: calc(var(--columnWidth) * 2) + width: calc(var(--columnWidth) * 2); } .col-md-3 { - width: calc(var(--columnWidth) * 3) + width: calc(var(--columnWidth) * 3); } .col-md-4 { - width: calc(var(--columnWidth) * 4) + width: calc(var(--columnWidth) * 4); } .col-md-5 { - width: calc(var(--columnWidth) * 5) + width: calc(var(--columnWidth) * 5); } .col-md-6 { - width: calc(var(--columnWidth) * 6) + width: calc(var(--columnWidth) * 6); } .col-md-7 { - width: calc(var(--columnWidth) * 7) + width: calc(var(--columnWidth) * 7); } .col-md-8 { - width: calc(var(--columnWidth) * 8) + width: calc(var(--columnWidth) * 8); } .col-md-9 { - width: calc(var(--columnWidth) * 9) + width: calc(var(--columnWidth) * 9); } .col-md-10 { - width: calc(var(--columnWidth) * 10) + width: calc(var(--columnWidth) * 10); } .col-md-11 { - width: calc(var(--columnWidth) * 11) + width: calc(var(--columnWidth) * 11); } .col-md-12 { - width: calc(var(--columnWidth) * 12) + width: calc(var(--columnWidth) * 12); } } @media (min-width: 1200px) { .col-lg-1 { - width: calc(var(--columnWidth) * 1) + width: calc(var(--columnWidth) * 1); } .col-lg-2 { - width: calc(var(--columnWidth) * 2) + width: calc(var(--columnWidth) * 2); } .col-lg-3 { - width: calc(var(--columnWidth) * 3) + width: calc(var(--columnWidth) * 3); } .col-lg-4 { - width: calc(var(--columnWidth) * 4) + width: calc(var(--columnWidth) * 4); } .col-lg-5 { - width: calc(var(--columnWidth) * 5) + width: calc(var(--columnWidth) * 5); } .col-lg-6 { - width: calc(var(--columnWidth) * 6) + width: calc(var(--columnWidth) * 6); } .col-lg-7 { - width: calc(var(--columnWidth) * 7) + width: calc(var(--columnWidth) * 7); } .col-lg-8 { - width: calc(var(--columnWidth) * 8) + width: calc(var(--columnWidth) * 8); } .col-lg-9 { - width: calc(var(--columnWidth) * 9) + width: calc(var(--columnWidth) * 9); } .col-lg-10 { - width: calc(var(--columnWidth) * 10) + width: calc(var(--columnWidth) * 10); } .col-lg-11 { - width: calc(var(--columnWidth) * 11) + width: calc(var(--columnWidth) * 11); } .col-lg-12 { - width: calc(var(--columnWidth) * 12) + width: calc(var(--columnWidth) * 12); } } From 67316d1f9ac57d2eea2d2bbdc82d76f3354b3837 Mon Sep 17 00:00:00 2001 From: Elson Costa Date: Fri, 30 Aug 2024 15:25:07 -0300 Subject: [PATCH 29/42] worlds: fixes on location select. --- admin/pages/worlds.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/admin/pages/worlds.php b/admin/pages/worlds.php index 159838a2f..d75ec2640 100644 --- a/admin/pages/worlds.php +++ b/admin/pages/worlds.php @@ -160,12 +160,11 @@ function echo_error($message)
    From 5bd99ab1808ced63e494ce49bcc6da78d968b66a Mon Sep 17 00:00:00 2001 From: Elson Costa Date: Tue, 3 Sep 2024 17:27:30 -0300 Subject: [PATCH 30/42] changed usage of $config['lua'] to configLua(); --- admin/template/template.php | 4 +- index.php | 2 +- install/includes/config.php | 8 +- system/database.php | 80 +++++++++---------- system/functions.php | 2 +- system/init.php | 6 +- system/libs/validator.php | 2 +- system/pages/account/change_password.php | 2 +- system/pages/account/register_new.php | 2 +- system/pages/char_bazaar/details.php | 2 +- system/pages/char_bazaar/list_auctions.php | 2 +- system/pages/createaccount.php | 6 +- system/pages/lostaccount.php | 12 +-- system/pages/lostaccount/step3.php | 4 +- system/pages/records.php | 7 +- system/pages/serverinfo.php | 2 +- system/status.php | 36 +++------ .../account.create_character.html.twig | 2 +- templates/tibiacom/basic.css | 2 +- templates/tibiacom/news.tickers.html.twig | 2 +- tools/css/custom.css | 5 +- 21 files changed, 91 insertions(+), 99 deletions(-) diff --git a/admin/template/template.php b/admin/template/template.php index 0328056e5..6b90ece48 100644 --- a/admin/template/template.php +++ b/admin/template/template.php @@ -41,7 +41,7 @@ <?= $title_full ?> @@ -145,7 +145,7 @@ - Admin Panel
    + class="badge bg-">
    diff --git a/index.php b/index.php index 78d0dfd24..70bc2640b 100644 --- a/index.php +++ b/index.php @@ -331,7 +331,7 @@ $topic = $title; } -$title_full = (isset($title) ? $title . $config['title_separator'] : '') . $config['lua']['serverName']; +$title_full = (isset($title) ? $title . $config['title_separator'] : '') . configLua('serverName'); require $template_path . '/' . $template_index; echo base64_decode('PCEtLSBQb3dlcmVkIGJ5IE9wZW5UaWJpYUJSIE15QUFDIDo6IGh0dHBzOi8vZ2l0aHViLmNvbS9vcGVudGliaWFici9teWFhYyAtLT4=') . PHP_EOL; diff --git a/install/includes/config.php b/install/includes/config.php index 380fff7df..2f6f068ae 100644 --- a/install/includes/config.php +++ b/install/includes/config.php @@ -19,13 +19,13 @@ if(!isset($error) || !$error) { $config['lua'] = load_config_lua($config['server_path'] . 'config.lua'); if(isset($config['lua']['sqlType'])) // tfs 0.3 - $config['database_type'] = $config['lua']['sqlType']; + $config['database_type'] = configLua('sqlType'); else if(isset($config['lua']['mysqlHost'])) // tfs 0.2/1.0 $config['database_type'] = 'mysql'; else if(isset($config['lua']['database_type'])) // otserv - $config['database_type'] = $config['lua']['database_type']; + $config['database_type'] = configLua('database_type'); else if(isset($config['lua']['sql_type'])) // otserv - $config['database_type'] = $config['lua']['sql_type']; + $config['database_type'] = configLua('sql_type'); $config['database_type'] = strtolower($config['database_type']); if(empty($config['database_type'])) { @@ -38,4 +38,4 @@ $error = true; } } -?> \ No newline at end of file +?> diff --git a/system/database.php b/system/database.php index 7ef2261aa..b002fa15f 100644 --- a/system/database.php +++ b/system/database.php @@ -19,72 +19,72 @@ // tfs 0.2 $config['otserv_version'] = TFS_02; $config['database_type'] = 'mysql'; - $config['database_host'] = $config['lua']['mysqlHost']; - $config['database_port'] = $config['lua']['mysqlPort']; - $config['database_user'] = $config['lua']['mysqlUser']; - $config['database_password'] = $config['lua']['mysqlPass']; - $config['database_name'] = $config['lua']['mysqlDatabase']; - $config['database_encryption'] = $config['lua']['passwordType']; + $config['database_host'] = configLua('mysqlHost'); + $config['database_port'] = configLua('mysqlPort'); + $config['database_user'] = configLua('mysqlUser'); + $config['database_password'] = configLua('mysqlPass'); + $config['database_name'] = configLua('mysqlDatabase'); + $config['database_encryption'] = configLua('passwordType'); } else { $config['otserv_version'] = TFS_03; - $config['database_type'] = $config['lua']['sqlType']; - $config['database_host'] = $config['lua']['sqlHost']; - $config['database_port'] = $config['lua']['sqlPort']; - $config['database_user'] = $config['lua']['sqlUser']; - $config['database_password'] = $config['lua']['sqlPass']; - $config['database_name'] = $config['lua']['sqlDatabase']; + $config['database_type'] = configLua('sqlType'); + $config['database_host'] = configLua('sqlHost'); + $config['database_port'] = configLua('sqlPort'); + $config['database_user'] = configLua('sqlUser'); + $config['database_password'] = configLua('sqlPass'); + $config['database_name'] = configLua('sqlDatabase'); - $config['database_encryption'] = $config['lua']['encryptionType']; + $config['database_encryption'] = configLua('encryptionType'); if (!isset($config['database_encryption']) || empty($config['database_encryption'])) { // before 0.3.6 - $config['database_encryption'] = $config['lua']['passwordType']; + $config['database_encryption'] = configLua('passwordType'); } } } elseif (isset($config['lua']['mysqlHost'])) { // tfs 1.0 $config['otserv_version'] = TFS_02; $config['database_type'] = 'mysql'; - $config['database_host'] = $config['lua']['mysqlHost']; - $config['database_port'] = $config['lua']['mysqlPort']; - $config['database_user'] = $config['lua']['mysqlUser']; - $config['database_password'] = $config['lua']['mysqlPass']; - $config['database_name'] = $config['lua']['mysqlDatabase']; + $config['database_host'] = configLua('mysqlHost'); + $config['database_port'] = configLua('mysqlPort'); + $config['database_user'] = configLua('mysqlUser'); + $config['database_password'] = configLua('mysqlPass'); + $config['database_name'] = configLua('mysqlDatabase'); if (!isset($config['database_socket'][0])) { $config['database_socket'] = isset($config['lua']['mysqlSock']) - ? trim($config['lua']['mysqlSock']) + ? trim(configLua('mysqlSock')) : ''; } $config['database_encryption'] = 'sha1'; } elseif (isset($config['lua']['database_type'])) { // otserv $config['otserv_version'] = OTSERV; - $config['database_type'] = $config['lua']['database_type']; - $config['database_host'] = $config['lua']['database_host']; - $config['database_port'] = $config['lua']['database_port']; - $config['database_user'] = $config['lua']['database_username']; - $config['database_password'] = $config['lua']['database_password']; - $config['database_name'] = $config['lua']['database_schema']; + $config['database_type'] = configLua('database_type'); + $config['database_host'] = configLua('database_host'); + $config['database_port'] = configLua('database_port'); + $config['database_user'] = configLua('database_username'); + $config['database_password'] = configLua('database_password'); + $config['database_name'] = configLua('database_schema'); $config['database_encryption'] = isset($config['lua']['passwordtype']) - ? $config['lua']['passwordtype'] - : $config['lua']['password_type']; + ? configLua('passwordtype') + : configLua('password_type'); $config['database_salt'] = isset($config['lua']['passwordsalt']) - ? $config['lua']['passwordsalt'] - : $config['lua']['password_salt']; + ? configLua('passwordsalt') + : configLua('password_salt'); } elseif (isset($config['lua']['sql_host'])) { // otserv 0.6.3 / 0.6.4 $config['otserv_version'] = OTSERV_06; - $config['database_type'] = $config['lua']['sql_type']; - $config['database_host'] = $config['lua']['sql_host']; - $config['database_port'] = $config['lua']['sql_port']; - $config['database_user'] = $config['lua']['sql_user']; - $config['database_password'] = $config['lua']['sql_pass']; - $config['database_name'] = $config['lua']['sql_db']; + $config['database_type'] = configLua('sql_type'); + $config['database_host'] = configLua('sql_host'); + $config['database_port'] = configLua('sql_port'); + $config['database_user'] = configLua('sql_user'); + $config['database_password'] = configLua('sql_pass'); + $config['database_name'] = configLua('sql_db'); $config['database_encryption'] = isset($config['lua']['passwordtype']) - ? $config['lua']['passwordtype'] - : $config['lua']['password_type']; + ? configLua('passwordtype') + : configLua('password_type'); $config['database_salt'] = isset($config['lua']['passwordsalt']) - ? $config['lua']['passwordsalt'] - : $config['lua']['password_salt']; + ? configLua('passwordsalt') + : configLua('password_salt'); } } diff --git a/system/functions.php b/system/functions.php index a3a9f66b4..fffbe30f6 100644 --- a/system/functions.php +++ b/system/functions.php @@ -1093,7 +1093,7 @@ function _mail($to, $subject, $body, $altBody = '', $add_html_tags = true) $mailer->From = $config['mail_address']; $mailer->Sender = $config['mail_address']; $mailer->CharSet = 'utf-8'; - $mailer->FromName = $config['lua']['serverName']; + $mailer->FromName = configLua('serverName'); $mailer->Subject = $subject; $mailer->addAddress($to); $mailer->Body = $tmp_body; diff --git a/system/init.php b/system/init.php index efda176d8..75e2c472a 100644 --- a/system/init.php +++ b/system/init.php @@ -91,11 +91,11 @@ function_exists('ob_gzhandler') unset($tmp); if (isset($config['lua']['servername'])) { - $config['lua']['serverName'] = $config['lua']['servername']; + $config['lua']['serverName'] = configLua('servername'); } if (isset($config['lua']['houserentperiod'])) { - $config['lua']['houseRentPeriod'] = $config['lua']['houserentperiod']; + $config['lua']['houseRentPeriod'] = configLua('houserentperiod'); } if ($config['item_images_url'][strlen($config['item_images_url']) - 1] !== '/') { @@ -108,7 +108,7 @@ function_exists('ob_gzhandler') break; } - $foundValue = $config['lua'][$key]; + $foundValue = configLua($key); if ($foundValue[0] !== '/') { $foundValue = $config['server_path'] . $foundValue; } diff --git a/system/libs/validator.php b/system/libs/validator.php index e99a9d7a5..9fd6e1a17 100644 --- a/system/libs/validator.php +++ b/system/libs/validator.php @@ -251,7 +251,7 @@ public static function newCharacterName($name) return false; } - if(strtolower($config['lua']['serverName']) == $name_lower) { + if(strtolower(configLua('serverName')) == $name_lower) { self::$lastError = 'Your name cannot be same as server name.'; return false; } diff --git a/system/pages/account/change_password.php b/system/pages/account/change_password.php index 4ccfa9316..d0aa57e2a 100644 --- a/system/pages/account/change_password.php +++ b/system/pages/account/change_password.php @@ -62,7 +62,7 @@ 'new_password' => $org_pass )); - if (_mail($account_logged->getEMail(), $config['lua']['serverName'] . " - Changed password", $mailBody)) + if (_mail($account_logged->getEMail(), configLua('serverName') . " - Changed password", $mailBody)) $message = '
    Your new password were send on email address ' . $account_logged->getEMail() . '.'; else $message = '

    An error occurred while sending email. For Admin: More info can be found in system/logs/mailer-error.log

    '; diff --git a/system/pages/account/register_new.php b/system/pages/account/register_new.php index 72b7b8a41..fa7c82d4e 100644 --- a/system/pages/account/register_new.php +++ b/system/pages/account/register_new.php @@ -35,7 +35,7 @@ 'recovery_key' => $new_rec_key )); - if (_mail($account_logged->getEMail(), $config['lua']['serverName'] . " - new recovery key", $mailBody)) { + if (_mail($account_logged->getEMail(), configLua('serverName') . " - new recovery key", $mailBody)) { $account_logged->setCustomField("key", $new_rec_key); $account_logged->setCustomField($coinType, $account_logged->getCustomField($coinType) - $needCoins); $account_logged->logAction("Generated new recovery key for {$needCoins} {$coinName}"); diff --git a/system/pages/char_bazaar/details.php b/system/pages/char_bazaar/details.php index 36fc2adbe..cd4203523 100644 --- a/system/pages/char_bazaar/details.php +++ b/system/pages/char_bazaar/details.php @@ -193,7 +193,7 @@ class="AuctionCharacterName">
    Level: | Vocation: | | - World: + World:
    diff --git a/system/pages/char_bazaar/list_auctions.php b/system/pages/char_bazaar/list_auctions.php index 703628d1c..f4ba75799 100644 --- a/system/pages/char_bazaar/list_auctions.php +++ b/system/pages/char_bazaar/list_auctions.php @@ -125,7 +125,7 @@
    Level: | Vocation: | | - World: + World:
    diff --git a/system/pages/createaccount.php b/system/pages/createaccount.php index 846d6de13..4b29ce093 100644 --- a/system/pages/createaccount.php +++ b/system/pages/createaccount.php @@ -165,7 +165,7 @@ } if (!isset($_POST['accept_rules']) || $_POST['accept_rules'] !== 'true') - $errors['accept_rules'] = 'You have to agree to the ' . $config['lua']['serverName'] . ' Rules in order to create an account!'; + $errors['accept_rules'] = 'You have to agree to the ' . configLua('serverName') . ' Rules in order to create an account!'; $params = array( 'account' => $account_db, @@ -247,7 +247,7 @@ 'verify_url' => generateLink($verify_url, $verify_url, true) )); - if (_mail($email, 'New account on ' . $config['lua']['serverName'], $body_html)) { + if (_mail($email, 'New account on ' . configLua('serverName'), $body_html)) { echo 'Your account has been created.

    '; $twig->display('success.html.twig', array( 'title' => 'Account Created', @@ -306,7 +306,7 @@ 'password' => $password ?? null )); - if (_mail($email, 'Your account on ' . $config['lua']['serverName'], $mailBody)) + if (_mail($email, 'Your account on ' . configLua('serverName'), $mailBody)) echo '
    This information was sent on email address ' . $email . '.'; else { error('An error occurred while sending email. For Admin: More info can be found in system/logs/mailer-error.log'); diff --git a/system/pages/lostaccount.php b/system/pages/lostaccount.php index 6221cd9d1..9e0cc967d 100644 --- a/system/pages/lostaccount.php +++ b/system/pages/lostaccount.php @@ -50,7 +50,7 @@ if ($account->getEMail() == $email_rcv) { $newcode = generateRandomString(30, true, false, true); $mailBody = " - You asked to reset your {$config['lua']['serverName']} password.
    + You asked to reset your {configLua('serverName')} password.

    Account name: {$account->getCustomField('name')}


    To do so, please click this link: @@ -59,7 +59,7 @@

    If you did not request a password change, you may ignore this message and your password will remain unchanged."; $account_mail = $account->getCustomField('email'); - if (_mail($account_mail, $config['lua']['serverName'] . ' - Recover your account', $mailBody)) { + if (_mail($account_mail, configLua('serverName') . ' - Recover your account', $mailBody)) { $account->setCustomField('email_code', $newcode); $account->setCustomField('email_next', (time() + $config['email_lai_sec_interval'])); echo '
    Details about steps required to recover your account has been sent to ' . $account_mail . '. You should receive this email within 15 minutes. Please check your inbox/spam directory.'; @@ -98,7 +98,7 @@ if ($account->getEMail() == $email) { $newcode = generateRandomString(30, true, false, true); $mailBody = ' - You asked to reset your ' . $config['lua']['serverName'] . ' password.
    + You asked to reset your ' . configLua('serverName') . ' password.

    Account name: ' . $account->getCustomField('name') . '


    To do so, please click this link: @@ -108,7 +108,7 @@

    If you did not request a password change, you may ignore this message and your password will remain unchanged.'; $account_mail = $account->getCustomField('email'); - if (_mail($account_mail, $config['lua']['serverName'] . ' - Recover your account', $mailBody)) { + if (_mail($account_mail, configLua('serverName') . ' - Recover your account', $mailBody)) { $account->setCustomField('email_code', $newcode); $account->setCustomField('email_next', (time() + $config['email_lai_sec_interval'])); echo '
    Details about steps required to recover your account has been sent to ' . $account_mail . '. You should receive this email within 15 minutes. Please check your inbox/spam directory.'; @@ -258,13 +258,13 @@ function validate_form(thisform) { $mailBody = '

    Your account name and password!

    -

    Changed password to your account in Lost Account Interface on server ' . $config['lua']['serverName'] . '

    +

    Changed password to your account in Lost Account Interface on server ' . configLua('serverName') . '

    Account name: ' . $account->getName() . '

    New password: ' . $newpassword . '


    It\'s automatic e-mail from OTS Lost Account System. Do not reply!

    '; - if (_mail($account->getCustomField('email'), $config['lua']['serverName'] . " - Your new password", $mailBody)) { + if (_mail($account->getCustomField('email'), configLua('serverName') . " - Your new password", $mailBody)) { echo '
    New password work! Sent e-mail with your password and account name. You should receive this e-mail in 15 minutes. You can login now with new password!'; } else { echo '

    New password work! An error occurred while sending email! You will not receive e-mail with new password. For Admin: More info can be found in system/logs/mailer-error.log'; diff --git a/system/pages/lostaccount/step3.php b/system/pages/lostaccount/step3.php index bccc082f0..52b02e517 100644 --- a/system/pages/lostaccount/step3.php +++ b/system/pages/lostaccount/step3.php @@ -44,14 +44,14 @@ if ($account->getCustomField('email_next') < time()) { $mailBody = '

    Your account name and new password!

    -

    Changed password and e-mail to your account in Lost Account Interface on server ' . $config['lua']['serverName'] . '

    +

    Changed password and e-mail to your account in Lost Account Interface on server ' . configLua('serverName') . '

    Account name: ' . $account->getCustomField('name') . '

    New password: ' . $new_pass . '

    E-mail: ' . $new_email . ' (this e-mail)


    It\'s automatic e-mail from OTS Lost Account System. Do not reply!

    '; - if (_mail($account->getCustomField('email'), $config['lua']['serverName'] . " - New password to your account", $mailBody)) { + if (_mail($account->getCustomField('email'), configLua('serverName') . " - New password to your account", $mailBody)) { echo '
    Sent e-mail with your account name and password to new e-mail. You should receive this e-mail in 15 minutes. You can login now with new password!'; } else { echo '

    An error occurred while sending email! You will not receive e-mail with this informations. For Admin: More info can be found in system/logs/mailer-error.log

    '; diff --git a/system/pages/records.php b/system/pages/records.php index a49c88ef8..1ce443802 100644 --- a/system/pages/records.php +++ b/system/pages/records.php @@ -13,8 +13,13 @@ $title = "Players Online Records"; +if (!$db->hasTable('server_record')) { + echo "Table 'server_record' not found!"; + return; +} + echo ' -
    Players online records on '.$config['lua']['serverName'].'
    +
    Players online records on '.configLua('serverName').'
    diff --git a/system/pages/serverinfo.php b/system/pages/serverinfo.php index bcef0be38..38f1e3f56 100644 --- a/system/pages/serverinfo.php +++ b/system/pages/serverinfo.php @@ -49,7 +49,7 @@ 'serverSave' => $explodeServerSave, 'serverSaveTime' => $serverSaveTime->format('Y, n-1, j, G, i, s'), 'rateUseStages' => $rateUseStages = getBoolean(configLua('rateUseStages')), - 'rateStages' => $rateUseStages && isset($config['lua']['rateStages']) ? $config['lua']['rateStages'] : [], + 'rateStages' => $rateUseStages && isset($config['lua']['rateStages']) ? configLua('rateStages') : [], 'serverIp' => str_replace(['http://', 'https://', '/'], '', configLua('url')), 'clientVersion' => $status['clientVersion'] ?? null, 'protectionLevel' => configLua('protectionLevel'), diff --git a/system/status.php b/system/status.php index 7604f1939..e8003219c 100644 --- a/system/status.php +++ b/system/status.php @@ -24,33 +24,17 @@ } /** @var array $config */ -$status_ip = $config['lua']['ip']; -if ($statusProtocolPort = $config['lua']['statusProtocolPort'] ?? null) { +$statusIp = configLua('ip'); +if ($statusProtocolPort = configLua('statusProtocolPort')) { $config['lua']['loginPort'] = $statusProtocolPort; $config['lua']['statusPort'] = $statusProtocolPort; - $status_port = $statusProtocolPort; -} elseif ($statusPort = $config['lua']['status_port'] ?? null) { - $config['lua']['loginPort'] = $statusPort; - $config['lua']['statusPort'] = $statusPort; - $status_port = $statusPort; } // ip check -if (isset($config['status_ip'][0])) { - $status_ip = $config['status_ip']; -} elseif (!isset($status_ip[0])) { - // try localhost if no ip specified - $status_ip = '127.0.0.1'; -} +$statusIp = !empty($config['status_ip'] ?? '') ? $config['status_ip'] : $statusIp; // port check -$status_port = $config['lua']['statusPort']; -if (isset($config['status_port'][0])) { - $status_port = $config['status_port']; -} elseif (!isset($status_port[0])) { - // try 7171 if no ip specified - $status_port = 7171; -} +$statusProtocolPort = !empty($config['status_port'] ?? '') ? $config['status_port'] : $statusProtocolPort; $fetch_from_db = true; /** @var Cache $cache */ @@ -83,26 +67,26 @@ } if (isset($config['lua']['statustimeout'])) { - $config['lua']['statusTimeout'] = $config['lua']['statustimeout']; + $config['lua']['statusTimeout'] = configLua('statustimeout'); } // get status timeout from server config -$status_timeout = eval('return ' . $config['lua']['statusTimeout'] . ';') / 1000 + 1; +$status_timeout = eval('return ' . configLua('statusTimeout') . ';') / 1000 + 1; $status_interval = @$config['status_interval']; if ($status_interval && $status_timeout < $config['status_interval']) { $status_timeout = $config['status_interval']; } if ($status['lastCheck'] + $status_timeout < time()) { - updateStatus(); + updateStatus($statusIp, $statusProtocolPort); } -function updateStatus() +function updateStatus($statusIp, $statusPort): void { - global $db, $cache, $config, $status, $status_ip, $status_port; + global $db, $cache, $config, $status; // get server status and save it to database - $serverInfo = new OTS_ServerInfo($status_ip, $status_port); + $serverInfo = new OTS_ServerInfo($statusIp, $statusPort); $serverStatus = $serverInfo->status(); if (!$serverStatus) { $status['online'] = false; diff --git a/system/templates/account.create_character.html.twig b/system/templates/account.create_character.html.twig index 3555070c0..6dd3e0754 100644 --- a/system/templates/account.create_character.html.twig +++ b/system/templates/account.create_character.html.twig @@ -184,7 +184,7 @@ In any case the name must not violate the naming conventions stated in the {% if status.online %} @@ -117,7 +117,7 @@ - + @@ -129,13 +129,13 @@
    Players
    -
    +
    {% set y = 0 %} {% for type in world_types %} {% set y = y + 1 %} diff --git a/templates/tibiacom/basic.css b/templates/tibiacom/basic.css index 5828a6df6..ecf2b8e7d 100644 --- a/templates/tibiacom/basic.css +++ b/templates/tibiacom/basic.css @@ -2058,7 +2058,7 @@ img { .Content #NewsTicker .NewsTickerDate { font-size: 7pt; position: absolute; - top: 0px; + top: 2px; float: left; } diff --git a/templates/tibiacom/news.tickers.html.twig b/templates/tibiacom/news.tickers.html.twig index ab5139f7a..d57fc8cdb 100644 --- a/templates/tibiacom/news.tickers.html.twig +++ b/templates/tibiacom/news.tickers.html.twig @@ -45,4 +45,4 @@
    -
    \ No newline at end of file +
    diff --git a/tools/css/custom.css b/tools/css/custom.css index 66b646cd7..eddaea84b 100644 --- a/tools/css/custom.css +++ b/tools/css/custom.css @@ -2,8 +2,11 @@ --columnWidth: calc(100% / 12); } -.row { +.d-flex { display: flex; +} + +.row { flex-direction: row; flex-wrap: wrap; box-sizing: border-box; From a33a3ab89ea51614122aa2efdda047e5d300631c Mon Sep 17 00:00:00 2001 From: Elson Costa Date: Thu, 5 Sep 2024 12:41:30 -0300 Subject: [PATCH 31/42] fixes. banner and carousel improvements. removed unnecessary require from login.php --- config.php | 21 ++++----- login.php | 1 - system/pages/lastkills.php | 2 +- system/pages/news.php | 31 +++++++------ system/pages/online.php | 5 ++- system/templates/online.html.twig | 14 +++--- .../images/{carousel => banners}/500x660.png | Bin templates/tibiacom/index.php | 41 +++++------------- tools/css/custom.css | 12 +++++ 9 files changed, 60 insertions(+), 67 deletions(-) rename templates/tibiacom/images/{carousel => banners}/500x660.png (100%) diff --git a/config.php b/config.php index 091614ff1..c2ea40fa7 100644 --- a/config.php +++ b/config.php @@ -297,8 +297,8 @@ // banner home 'banner_status' => false, - 'banner_image' => '500x660.png', // templates->tibiacom->images->carousel - 'banner_link' => 'www.instagram.com', + 'banner_image' => '500x660.png', // templates->tibiacom->images->banners + 'banner_link' => 'http://your-url.com', // or set empty '' // status bar 'status_bar' => true, @@ -307,18 +307,19 @@ 'whatsapp_link' => '5511912345678', // wa.me/5511912345678 'instagram_link' => 'profile', // www.instagram.com/profile 'facebook_link' => 'page', // www.facebook.com/page - 'collapse_status' => true, + 'collapse_status' => false, + + // slide + 'carousel' => array( + 'runemaster_small.jpg', + 'merrygarb_small.jpg', + 'mothcape_small.jpg', + ), // events 'events_xml' => 'data/xml/events.xml', - // slide - 'carousel_status' => true, - 'carousel' => array( - 'carousel_1' => 'runemaster_small.jpg', - 'carousel_2' => 'merrygarb_small.jpg', - 'carousel_3' => 'mothcape_small.jpg', - ), + // load page 'pace_load' => true, // load page top bar diff --git a/login.php b/login.php index 995c1fc99..daa4dfe2f 100644 --- a/login.php +++ b/login.php @@ -5,7 +5,6 @@ require_once 'config.local.php'; require_once SYSTEM . 'functions.php'; require_once SYSTEM . 'init.php'; -require_once SYSTEM . 'status.php'; // error function function sendError($msg) diff --git a/system/pages/lastkills.php b/system/pages/lastkills.php index 34189a889..72ddb2025 100644 --- a/system/pages/lastkills.php +++ b/system/pages/lastkills.php @@ -21,7 +21,7 @@ if ($world = $_GET['world'] ?? null) { $world = $db->query("SELECT `id`, `name` FROM `worlds` WHERE `name` = {$db->quote($world)}")->fetch() ?? null; } else { - $world = count($worlds) == 1 ? $worlds[0]['id'] : $world; + $world = count($worlds) == 1 ? $worlds[0] : $world; } $w_sql = $world ? " AND `p`.`world_id` = {$world['id']} " : ""; diff --git a/system/pages/news.php b/system/pages/news.php index 4fa023941..452eac215 100644 --- a/system/pages/news.php +++ b/system/pages/news.php @@ -1,22 +1,21 @@ - -
    Status: - {{ world.name }} World is {% if status.online %}Online{% else %} Offline{% endif %} + {{ world.name }} World is {% if status.online %}Online{% else %} Offline{% endif %}
    Location:{{ config.lua.location }}{{ world.location }}
    PvP Type:
    - + - + - +
    - 1 - 6 Frags : 1 - 6 Frags
    - 6+ Frags or Red Skull : 6+ Frags or Red Skull
    - 10+ Frags or Black Skull : 10+ Frags or Black Skull
    diff --git a/templates/tibiacom/images/carousel/500x660.png b/templates/tibiacom/images/banners/500x660.png similarity index 100% rename from templates/tibiacom/images/carousel/500x660.png rename to templates/tibiacom/images/banners/500x660.png diff --git a/templates/tibiacom/index.php b/templates/tibiacom/index.php index 89f0c8876..c6ae8cb41 100644 --- a/templates/tibiacom/index.php +++ b/templates/tibiacom/index.php @@ -527,13 +527,13 @@ class="InfoBarSmallElement">Discord target="new">Facebook - + - - + @@ -553,7 +553,6 @@ class="InfoBarSmallElement">Discord
    - @@ -570,31 +569,14 @@ class="InfoBarSmallElement">Discord class="carousel slide" data-bs-ride="carousel">
    -
    diff --git a/tools/css/custom.css b/tools/css/custom.css index eddaea84b..92f586572 100644 --- a/tools/css/custom.css +++ b/tools/css/custom.css @@ -894,3 +894,15 @@ .text-nowrap { white-space: nowrap !important; } + +.stronger { + font-weight: bold !important; +} + +.text-green { + color: #00a65a !important +} + +.text-red { + color: #dd4b39 !important +} From 149356f02cba9e7e8b2ba402b022692405cbe5d8 Mon Sep 17 00:00:00 2001 From: GitHub Actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 5 Sep 2024 15:42:12 +0000 Subject: [PATCH 32/42] PHP code format - (prettier) --- system/status.php | 4 +++- tools/css/custom.css | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/system/status.php b/system/status.php index e8003219c..267b14465 100644 --- a/system/status.php +++ b/system/status.php @@ -34,7 +34,9 @@ $statusIp = !empty($config['status_ip'] ?? '') ? $config['status_ip'] : $statusIp; // port check -$statusProtocolPort = !empty($config['status_port'] ?? '') ? $config['status_port'] : $statusProtocolPort; +$statusProtocolPort = !empty($config['status_port'] ?? '') + ? $config['status_port'] + : $statusProtocolPort; $fetch_from_db = true; /** @var Cache $cache */ diff --git a/tools/css/custom.css b/tools/css/custom.css index 92f586572..ffd57dfb3 100644 --- a/tools/css/custom.css +++ b/tools/css/custom.css @@ -900,9 +900,9 @@ } .text-green { - color: #00a65a !important + color: #00a65a !important; } .text-red { - color: #dd4b39 !important + color: #dd4b39 !important; } From 1541bdc0a6144ac8602ab989095eb39d282ebeb5 Mon Sep 17 00:00:00 2001 From: Elson Costa Date: Thu, 5 Sep 2024 14:34:49 -0300 Subject: [PATCH 33/42] setting variable worlds as globally. --- index.php | 7 ++++++- system/pages/account/create_character.php | 1 - system/pages/guilds.php | 1 - system/pages/guilds/list_of_guilds.php | 3 +-- system/pages/highscores.php | 3 +-- system/pages/houses.php | 4 ---- system/pages/lastkills.php | 4 +--- system/pages/online.php | 5 ++--- 8 files changed, 11 insertions(+), 17 deletions(-) diff --git a/index.php b/index.php index 70bc2640b..465efb67b 100644 --- a/index.php +++ b/index.php @@ -1,5 +1,5 @@ myaac_account_actions of MyAAC doesn\'t exist in the database. This is a fatal error. You can try to reinstall MyAAC by visiting this url.'); } +// set worlds in global php and twig +$worlds = $db->hasTable('worlds') ? $db->query("SELECT `id`, `name` FROM `worlds` ORDER BY `name` ASC")->fetchAll() : []; +define('WORLDS', $worlds); +$twig->addGlobal('worlds', $worlds); + // event system require_once SYSTEM . 'hooks.php'; $hooks = new Hooks(); diff --git a/system/pages/account/create_character.php b/system/pages/account/create_character.php index 061bed35e..608e95b5d 100644 --- a/system/pages/account/create_character.php +++ b/system/pages/account/create_character.php @@ -52,6 +52,5 @@ ['name' => 'Retro Open PvP', 'value' => 'retro', 'desc' => 'Killing other characters is possible, but restricted (old PvP rules)'], ['name' => 'Retro Hardcore PvP', 'value' => 'retrohardcore', 'desc' => 'Killing other characters is not restricted at all (old PvP rules)'], ], - 'worlds' => $db->query("SELECT `id`, `name` FROM `worlds` ORDER BY `id` ASC")->fetchAll() )); } diff --git a/system/pages/guilds.php b/system/pages/guilds.php index 02d203820..2e949c3c1 100644 --- a/system/pages/guilds.php +++ b/system/pages/guilds.php @@ -20,7 +20,6 @@ define('MOTD_EXISTS', $db->hasColumn('guilds', 'motd')); $world = null; -$worlds = $db->query("SELECT `id`, `name` FROM `worlds` ORDER BY `name` ASC")->fetchAll(); if ($worldId = $_POST['world_id'] ?? null) { $world = $db->query("SELECT `id`, `name` FROM `worlds` WHERE `id` = $worldId")->fetch(); } diff --git a/system/pages/guilds/list_of_guilds.php b/system/pages/guilds/list_of_guilds.php index 41d408611..eb04b68a0 100644 --- a/system/pages/guilds/list_of_guilds.php +++ b/system/pages/guilds/list_of_guilds.php @@ -1,4 +1,4 @@ - $guilds, 'logged' => $logged ?? false, 'isAdmin' => admin(), - 'worlds' => $worlds, 'world' => $world ?? null, )); diff --git a/system/pages/highscores.php b/system/pages/highscores.php index 959e27fab..9287e6dd6 100644 --- a/system/pages/highscores.php +++ b/system/pages/highscores.php @@ -26,7 +26,6 @@ $add_sql = ''; $config_vocations = $config['vocations']; -$worlds = $db->query("SELECT `id`, `name` FROM `worlds` ORDER BY `name` ASC;")->fetchAll(); $normalized_vocations = array_map('strtolower', $config_vocations); if (strtolower($vocation) != 'none' && !array_search(strtolower($vocation), $normalized_vocations)) $vocation = ""; @@ -232,7 +231,7 @@ + + {% for item in worlds %} + + {% endfor %} + + + {% set button_name = 'Submit' %} + {% include('buttons.base.html.twig') %} + + + + +
    + + + + +
    + + + + +
    + {% endif %} + + + + + + + +
    +
    +
    +
    + + + + +
    World Information
    + + + + +
    +
    + + + + + + +
    +
    + + + + + + + {% if status.online %} + + + + + {% endif %} + + + + + + + + + + + + + + + + + + + + + +
    Status: + {{ world.name }} World is {% if status.online %}Online{% else %} Offline{% endif %} +
    Players Online:{{ players|length }} Players Online
    Online Record:{{ record|raw }}
    Creation Date:{{ world.creation|date('F Y') }}
    Location:{{ world.location }}
    PvP Type:{{ getWorldType(world.type) }}
    Frags: + + + + + + + + + + + + +
    : 1 - 6 Frags
    : 6+ Frags or Red Skull
    : 10+ Frags or Black Skull
    +
    +
    +
    +
    +
    +
    + + + + + + + +
    +
    +
    +
    + + + + +
    Players Online
    + + + + +
    +
    + + + + + + +
    +
    + + + + + + +
    +
    + + + {% if players|length == 0 %} + + + + {% else %} + + {% if config.account_country %} + + {% endif %} + {% if config.online_outfit %} + + {% endif %} + + + + + {% set i = 0 %} + {% for player in players %} + {% set i = i + 1 %} + + {% if config.account_country %} + + {% endif %} + {% if config.online_outfit %} + + {% endif %} + + + + + {% endfor %} + {% endif %} + +
    Currently, no one is playing on {{ world.name }}.
    #OutfitNameLevelVocation
    {{ player.country_image|raw }}player outfit{{ player.name|raw }}{{ player.skull }}{{ player.level }}{{ player.vocation }}
    +
    +
    +
    +
    +
    +
    +
    +{% endif %} diff --git a/templates/tibiacom/images/header/headline-worlds.gif b/templates/tibiacom/images/header/headline-worlds.gif new file mode 100644 index 0000000000000000000000000000000000000000..34716b8ac8905faa9193524563a30c8156f50a49 GIT binary patch literal 1235 zcmd6k|4$nQ0L8E0;Gm@(Z31?S!N#!Kpj&V$ z?Uk=xX|a46)LEd8fgJ%P%qT-B9TY6sD3Qg0ArTcL$u{7J=?_HqU-*80@AF>rii(x8 z+^T;8KJW(sFzL+t4>b50bb6p3IRU#`b=tS^jTxu)rdCrTm!=^wj}x4*dbeBEVY!{>C~)XFmu{*iggI@w#lyX@j{IU1!jIBJ!q zA|9L0aFwv$Aemvz>7&#MzV;$cmdW{XaB#}%?XBlTatNi=KT4sg2w9F(dJ@ln&Tm-O=%> zv$Lza=XP(O>$5wbyZZ+QJzv}%x;H%XrT4z$Wg$18f{U}_iV|KOoqjlT|D;HiW1&Y8 zB0~7ucPp#?yZ{ktP9xUYmeXijpK3j+30@T8;vaVY>OLb0l$in4cY*@Ki-A7a2ezCJ zxVS_%tO}z!*irHJ7N}xua8bdw=LS;1a}y4;-ufI9!p!VeVrqsLQ?C@mw5hODiX9y%@BZ?}2Mh528NiliPi2d?(h z7y%|U(GWDb*F>6Z6-$IvHAgQ&p*|@gwU=IpT01sD6YZLjn(R6=P}b_YinJqQJ;}mag!(>-5P58KoHvqir72hrr9cWP0pb z`@*rdYMzOZnUO{Oy!m6hpU$pDn!|-tr%s6xX1rfeRNIN2%|rIF*PDKEaw27_L4TKt zJdX*}1%;ggfP-C#&XR+VE;W~pypO~R_lE@uDsw8#h8#pVb4M^sJGou>7(9nPo1^(8 zRkWxGuyPYb->Wsp(pM^XS@}Ee0@f3(zoD1D<2LisgJXYBJG?RDiscord - + From f36ee60a6c675c77a912c2e84bfe7e1cb0dab46f Mon Sep 17 00:00:00 2001 From: Elson Costa Date: Sat, 7 Sep 2024 00:04:24 -0300 Subject: [PATCH 42/42] updated schema changing url who is online to Worlds. --- install/includes/schema.sql | 2 +- system/migrations/17.php | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/install/includes/schema.sql b/install/includes/schema.sql index e405b13c8..896960bfd 100644 --- a/install/includes/schema.sql +++ b/install/includes/schema.sql @@ -163,7 +163,7 @@ INSERT INTO `myaac_menu` (`template`, `name`, `link`, `category`, `ordering`) VA INSERT INTO `myaac_menu` (`template`, `name`, `link`, `category`, `ordering`) VALUES ('tibiacom', 'Report Bug', 'bugtracker', 2, 5); /* MENU_CATEGORY_COMMUNITY tibiacom */ INSERT INTO `myaac_menu` (`template`, `name`, `link`, `category`, `ordering`) VALUES ('tibiacom', 'Characters', 'characters', 3, 0); -INSERT INTO `myaac_menu` (`template`, `name`, `link`, `category`, `ordering`) VALUES ('tibiacom', 'Who Is Online?', 'online', 3, 1); +INSERT INTO `myaac_menu` (`template`, `name`, `link`, `category`, `ordering`) VALUES ('tibiacom', 'Worlds', 'worlds', 3, 1); INSERT INTO `myaac_menu` (`template`, `name`, `link`, `category`, `ordering`) VALUES ('tibiacom', 'Highscores', 'highscores', 3, 2); INSERT INTO `myaac_menu` (`template`, `name`, `link`, `category`, `ordering`) VALUES ('tibiacom', 'Last Kills', 'lastkills', 3, 3); INSERT INTO `myaac_menu` (`template`, `name`, `link`, `category`, `ordering`) VALUES ('tibiacom', 'Houses', 'houses', 3, 4); diff --git a/system/migrations/17.php b/system/migrations/17.php index 027219a56..dae257276 100644 --- a/system/migrations/17.php +++ b/system/migrations/17.php @@ -28,8 +28,8 @@ INSERT INTO `myaac_menu` (`template`, `name`, `link`, `category`, `ordering`) VALUES ('kathrine', 'Downloads', 'downloads', 5, 4); INSERT INTO `myaac_menu` (`template`, `name`, `link`, `category`, `ordering`) VALUES ('kathrine', 'Report Bug', 'bugtracker', 2, 5); /* MENU_CATEGORY_COMMUNITY kathrine */ -INSERT INTO `myaac_menu` (`template`, `name`, `link`, `category`, `ordering`) VALUES ('kathrine', 'Who is Online?', 'online', 3, 0); -INSERT INTO `myaac_menu` (`template`, `name`, `link`, `category`, `ordering`) VALUES ('kathrine', 'Characters', 'characters', 3, 1); +INSERT INTO `myaac_menu` (`template`, `name`, `link`, `category`, `ordering`) VALUES ('kathrine', 'Characters', 'characters', 3, 0); +INSERT INTO `myaac_menu` (`template`, `name`, `link`, `category`, `ordering`) VALUES ('kathrine', 'Worlds', 'worlds', 3, 1); INSERT INTO `myaac_menu` (`template`, `name`, `link`, `category`, `ordering`) VALUES ('kathrine', 'Guilds', 'guilds', 3, 2); INSERT INTO `myaac_menu` (`template`, `name`, `link`, `category`, `ordering`) VALUES ('kathrine', 'Highscores', 'highscores', 3, 3); INSERT INTO `myaac_menu` (`template`, `name`, `link`, `category`, `ordering`) VALUES ('kathrine', 'Last Deaths', 'lastkills', 3, 4); @@ -63,7 +63,7 @@ INSERT INTO `myaac_menu` (`template`, `name`, `link`, `category`, `ordering`) VALUES ('tibiacom', 'Report Bug', 'bugtracker', 2, 5); /* MENU_CATEGORY_COMMUNITY tibiacom */ INSERT INTO `myaac_menu` (`template`, `name`, `link`, `category`, `ordering`) VALUES ('tibiacom', 'Characters', 'characters', 3, 0); -INSERT INTO `myaac_menu` (`template`, `name`, `link`, `category`, `ordering`) VALUES ('tibiacom', 'Who Is Online?', 'online', 3, 1); +INSERT INTO `myaac_menu` (`template`, `name`, `link`, `category`, `ordering`) VALUES ('tibiacom', 'Worlds', 'worlds', 3, 1); INSERT INTO `myaac_menu` (`template`, `name`, `link`, `category`, `ordering`) VALUES ('tibiacom', 'Highscores', 'highscores', 3, 2); INSERT INTO `myaac_menu` (`template`, `name`, `link`, `category`, `ordering`) VALUES ('tibiacom', 'Last Kills', 'lastkills', 3, 3); INSERT INTO `myaac_menu` (`template`, `name`, `link`, `category`, `ordering`) VALUES ('tibiacom', 'Houses', 'houses', 3, 4);