From e03da2876cd7556373ace0d16c4ae3da793002a2 Mon Sep 17 00:00:00 2001 From: slawkens Date: Sun, 23 May 2021 02:53:57 +0200 Subject: [PATCH 01/17] Fix forum boards white color style So it works on all templates --- system/templates/forum.boards.html.twig | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/system/templates/forum.boards.html.twig b/system/templates/forum.boards.html.twig index 51198f6b..ffaadc51 100644 --- a/system/templates/forum.boards.html.twig +++ b/system/templates/forum.boards.html.twig @@ -1,21 +1,21 @@ Boards - + {% if canEdit %} {% endif %} From 135f393fc4e8486e13888d7b6ea25ae6b0345fc4 Mon Sep 17 00:00:00 2001 From: slawkens Date: Sun, 23 May 2021 02:54:33 +0200 Subject: [PATCH 02/17] Change team page title --- system/pages/team.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/pages/team.php b/system/pages/team.php index d3c92f22..2e410e12 100644 --- a/system/pages/team.php +++ b/system/pages/team.php @@ -9,7 +9,7 @@ * @link https://my-aac.org */ defined('MYAAC') or die('Direct access not allowed!'); -$title = 'Gamemasters List'; +$title = 'Support in game'; if($config['account_country']) require SYSTEM . 'countries.conf.php'; From 80623580f24eaeab060b7ec9fcdfe792b2983a09 Mon Sep 17 00:00:00 2001 From: slawkens Date: Sun, 23 May 2021 02:55:27 +0200 Subject: [PATCH 03/17] Fix creating account if $npcCheck is enabled --- system/libs/DataLoader.php | 2 +- system/libs/validator.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/system/libs/DataLoader.php b/system/libs/DataLoader.php index 4ca934e4..66b4ed27 100644 --- a/system/libs/DataLoader.php +++ b/system/libs/DataLoader.php @@ -63,7 +63,7 @@ class DataLoader self::$startTime = microtime(true); - require LIBS . 'npc.php'; + require_once LIBS . 'npc.php'; if(NPCs::loadFromXML()) { success(self::$locale['step_database_loaded_npcs'] . self::getLoadedTime()); } diff --git a/system/libs/validator.php b/system/libs/validator.php index 450c2573..c69f0039 100644 --- a/system/libs/validator.php +++ b/system/libs/validator.php @@ -223,7 +223,7 @@ class Validator $npcCheck = config('character_name_npc_check'); if ($npcCheck) { - require LIBS . 'npc.php'; + require_once LIBS . 'npc.php'; NPCS::load(); if(NPCS::$npcs && in_array(strtolower($name), NPCS::$npcs)) { self::$lastError = "Invalid name format. Do not use NPC Names"; @@ -346,7 +346,7 @@ class Validator $npcCheck = config('character_name_npc_check'); if ($npcCheck) { - require LIBS . 'npc.php'; + require_once LIBS . 'npc.php'; NPCS::load(); if(NPCS::$npcs && in_array($name_lower, NPCS::$npcs)) { self::$lastError = "Invalid name format. Do not use NPC Names"; From c687f64cedeb1f2c1f1c6801752ab9922e78138b Mon Sep 17 00:00:00 2001 From: slawkens Date: Sun, 23 May 2021 03:14:17 +0200 Subject: [PATCH 04/17] Fix color style for different templates --- system/templates/spells.html.twig | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/system/templates/spells.html.twig b/system/templates/spells.html.twig index 33aa3432..cfcb4864 100644 --- a/system/templates/spells.html.twig +++ b/system/templates/spells.html.twig @@ -28,7 +28,6 @@ cursor: pointer; font-weight: 600; background-color: {{ config.vdarkborder }}; - color: #fff; } @@ -61,13 +60,13 @@
- + - + - +
From 454e09ec3ded1e4dfb2bf288bbc271968f72e8b8 Mon Sep 17 00:00:00 2001 From: slawkens Date: Sun, 23 May 2021 22:59:49 +0200 Subject: [PATCH 05/17] Use reference instead of new array --- system/pages/creatures.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/system/pages/creatures.php b/system/pages/creatures.php index 3c69c4ad..c019fbe2 100644 --- a/system/pages/creatures.php +++ b/system/pages/creatures.php @@ -54,16 +54,14 @@ if (empty($_REQUEST['creature'])) { $loot = json_decode($creature['loot'], true); usort($loot, 'sort_by_chance'); - $loot_list = []; - foreach ($loot as $item) { + foreach ($loot as &$item) { $item['name'] = getItemNameById($item['id']); $item['rarity_chance'] = round($item['chance'] / 1000, 2); $item['rarity'] = getItemRarity($item['chance']); $item['tooltip'] = ucfirst($item['name']) . '
Chance: ' . $item['rarity'] . (config('creatures_loot_percentage') ? ' ('. $item['rarity_chance'] .'%)' : '') . '
Max count: ' . $item['count']; - $loot_list[] = $item; } - $creature['loot'] = isset($loot_list) ? $loot_list : null; + $creature['loot'] = isset($loot) ? $loot : null; $creature['voices'] = isset($voices) ? $voices : null; $creature['summons'] = isset($summons) ? $summons : null; $creature['elements'] = isset($elements) ? $elements : null; From d9526d4021dcd322f697763a154db6914014e865 Mon Sep 17 00:00:00 2001 From: anyeor Date: Sat, 5 Jun 2021 05:17:51 +0200 Subject: [PATCH 06/17] Update 404 response (#163) Updating for new SPL standard. --- index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.php b/index.php index 8084fc83..71ca4743 100644 --- a/index.php +++ b/index.php @@ -48,7 +48,7 @@ if(preg_match("/^[A-Za-z0-9-_%\'+]+\.png$/i", $uri)) { } if(preg_match("/^(.*)\.(gif|jpg|png|jpeg|tiff|bmp|css|js|less|map|html|php|zip|rar|gz|ttf|woff|ico)$/i", $_SERVER['REQUEST_URI'])) { - header('HTTP/1.0 404 Not Found'); + http_response_code(404); exit; } From 9c7794fe1388d54d4ca7048afd657b4e9782f322 Mon Sep 17 00:00:00 2001 From: slawkens Date: Tue, 8 Jun 2021 07:29:04 +0200 Subject: [PATCH 07/17] Reformatting code --- templates/kathrine/template.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/templates/kathrine/template.php b/templates/kathrine/template.php index 063b0648..fb634a92 100644 --- a/templates/kathrine/template.php +++ b/templates/kathrine/template.php @@ -28,7 +28,7 @@ defined('MYAAC') or die('Direct access not allowed!'); } ?> var category = ''; From 14870d74df8d48ab4d086f8ffff82bc9e4f24002 Mon Sep 17 00:00:00 2001 From: slawkens Date: Tue, 8 Jun 2021 07:41:28 +0200 Subject: [PATCH 08/17] This was wrong.. --- templates/kathrine/template.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/kathrine/template.php b/templates/kathrine/template.php index fb634a92..38f17cd1 100644 --- a/templates/kathrine/template.php +++ b/templates/kathrine/template.php @@ -28,7 +28,7 @@ defined('MYAAC') or die('Direct access not allowed!'); } ?> var category = ' Date: Tue, 8 Jun 2021 07:43:06 +0200 Subject: [PATCH 09/17] Reformatting code (moving javascript to own file) --- templates/kathrine/javascript.php | 42 ++++++++++++++++++++++++++++++ templates/kathrine/template.php | 43 +------------------------------ 2 files changed, 43 insertions(+), 42 deletions(-) create mode 100644 templates/kathrine/javascript.php diff --git a/templates/kathrine/javascript.php b/templates/kathrine/javascript.php new file mode 100644 index 00000000..a092b7c2 --- /dev/null +++ b/templates/kathrine/javascript.php @@ -0,0 +1,42 @@ + +var category = ''; diff --git a/templates/kathrine/template.php b/templates/kathrine/template.php index 38f17cd1..8cbc945f 100644 --- a/templates/kathrine/template.php +++ b/templates/kathrine/template.php @@ -13,48 +13,7 @@ defined('MYAAC') or die('Direct access not allowed!'); From 7300e4f1add2e941a73e97aaa99b2ce44be3840e Mon Sep 17 00:00:00 2001 From: slawkens Date: Tue, 8 Jun 2021 07:44:16 +0200 Subject: [PATCH 10/17] Cleaning unused variable --- system/template.php | 1 + 1 file changed, 1 insertion(+) diff --git a/system/template.php b/system/template.php index 2b38045a..72ae3792 100644 --- a/system/template.php +++ b/system/template.php @@ -80,6 +80,7 @@ else { } $template_ini = parse_ini_file($file); + unset($file); if ($cache->enabled()) { $cache->set('template_ini_' . $template_name, serialize($template_ini)); From db554df0416ca34daa1fad56804c4751eaf253b4 Mon Sep 17 00:00:00 2001 From: slawkens Date: Tue, 8 Jun 2021 18:37:00 +0200 Subject: [PATCH 11/17] Small improvement to plugins.enabled check --- system/libs/plugins.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/libs/plugins.php b/system/libs/plugins.php index 939cff4b..57507aae 100644 --- a/system/libs/plugins.php +++ b/system/libs/plugins.php @@ -66,7 +66,7 @@ class Plugins { continue; } - if(isset($plugin['enabled']) && $plugin['enabled'] === 0) { + if(isset($plugin['enabled']) && !getBoolean($plugin['enabled'])) { self::$warnings[] = 'Skipping ' . $filename . '... The plugin is disabled.'; continue; } From 632ecb6d20a8830e10648ee061a0ca31c88f62eb Mon Sep 17 00:00:00 2001 From: slawkens Date: Tue, 8 Jun 2021 18:14:02 +0200 Subject: [PATCH 12/17] Fix forum table style (boards & thread view) --- system/pages/forum/show_board.php | 12 ++++++++++-- system/templates/forum.show_thread.html.twig | 4 ++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/system/pages/forum/show_board.php b/system/pages/forum/show_board.php index 2ead991d..2828f8f0 100644 --- a/system/pages/forum/show_board.php +++ b/system/pages/forum/show_board.php @@ -43,7 +43,15 @@ echo '

Page: '.$links_to_pages.'
'; $last_threads = $db->query("SELECT `players`.`id` as `player_id`, `players`.`name`, `" . FORUM_TABLE_PREFIX . "forum`.`post_text`, `" . FORUM_TABLE_PREFIX . "forum`.`post_topic`, `" . FORUM_TABLE_PREFIX . "forum`.`id`, `" . FORUM_TABLE_PREFIX . "forum`.`last_post`, `" . FORUM_TABLE_PREFIX . "forum`.`replies`, `" . FORUM_TABLE_PREFIX . "forum`.`views`, `" . FORUM_TABLE_PREFIX . "forum`.`post_date` FROM `players`, `" . FORUM_TABLE_PREFIX . "forum` WHERE `players`.`id` = `" . FORUM_TABLE_PREFIX . "forum`.`author_guid` AND `" . FORUM_TABLE_PREFIX . "forum`.`section` = ".(int) $section_id." AND `" . FORUM_TABLE_PREFIX . "forum`.`first_post` = `" . FORUM_TABLE_PREFIX . "forum`.`id` ORDER BY `" . FORUM_TABLE_PREFIX . "forum`.`last_post` DESC LIMIT ".$config['forum_threads_per_page']." OFFSET ".($_page * $config['forum_threads_per_page']))->fetchAll(); if(isset($last_threads[0])) { - echo '
- Board + Board - Posts + Posts - Threads + Threads - Last Post + Last Post - Options + Options
'; + echo '
ThreadThread StarterRepliesViewsLast Post
+ + + + + + +'; $player = new OTS_Player(); foreach($last_threads as $thread) @@ -83,4 +91,4 @@ if(isset($last_threads[0])) else echo '

No threads in this board.

'; -?> \ No newline at end of file +?> diff --git a/system/templates/forum.show_thread.html.twig b/system/templates/forum.show_thread.html.twig index ade8070a..f96d669f 100644 --- a/system/templates/forum.show_thread.html.twig +++ b/system/templates/forum.show_thread.html.twig @@ -12,8 +12,8 @@ Page: {{ links_to_pages|raw }}
- From f9abe9a8e3af1a82cdf803249ea76388fc7e7850 Mon Sep 17 00:00:00 2001 From: slawkens Date: Tue, 8 Jun 2021 12:49:31 +0200 Subject: [PATCH 13/17] Fix create character when admin (any case is allowed now) --- system/pages/account/create_character.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/system/pages/account/create_character.php b/system/pages/account/create_character.php index c25b8ea6..7c148966 100644 --- a/system/pages/account/create_character.php +++ b/system/pages/account/create_character.php @@ -10,7 +10,7 @@ */ defined('MYAAC') or die('Direct access not allowed!'); -$character_name = isset($_POST['name']) ? stripslashes(ucwords(strtolower($_POST['name']))) : null; +$character_name = isset($_POST['name']) ? stripslashes($_POST['name']) : null; $character_sex = isset($_POST['sex']) ? (int)$_POST['sex'] : null; $character_vocation = isset($_POST['vocation']) ? (int)$_POST['vocation'] : null; $character_town = isset($_POST['town']) ? (int)$_POST['town'] : null; @@ -42,4 +42,4 @@ if(!$character_created) { 'save' => $save, 'errors' => $errors )); -} \ No newline at end of file +} From be1086bcbaeba4795e0e836f934f73da51787087 Mon Sep 17 00:00:00 2001 From: slawkens Date: Tue, 8 Jun 2021 11:49:17 +0200 Subject: [PATCH 14/17] small adjustment in news.php --- system/pages/news.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/system/pages/news.php b/system/pages/news.php index e48e1382..30e00b54 100644 --- a/system/pages/news.php +++ b/system/pages/news.php @@ -29,11 +29,13 @@ if(isset($_GET['archive'])) // display big news by id if(isset($_GET['id'])) { + $id = (int)$_GET['id']; + $field_name = 'date'; - if($_REQUEST['id'] < 100000) + if($id < 100000) $field_name = 'id'; - $news = $db->query('SELECT * FROM `'.TABLE_PREFIX . 'news` WHERE `hidden` != 1 AND `' . $field_name . '` = ' . (int)$_REQUEST['id'] . ''); + $news = $db->query('SELECT * FROM `'.TABLE_PREFIX . 'news` WHERE `hidden` != 1 AND `' . $field_name . '` = ' . $id . ''); if($news->rowCount() == 1) { $news = $news->fetch(); @@ -227,4 +229,4 @@ if(!$news_cached) echo $tmp_content; } else - echo $news_cached; \ No newline at end of file + echo $news_cached; From 3cc3e3a8e9406df193983f880654708030d216f9 Mon Sep 17 00:00:00 2001 From: slawkens Date: Tue, 8 Jun 2021 11:26:06 +0200 Subject: [PATCH 15/17] Fix guild back buttons (change logo & motd) --- system/templates/guilds.change_logo.html.twig | 8 ++------ system/templates/guilds.change_motd.html.twig | 6 +----- 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/system/templates/guilds.change_logo.html.twig b/system/templates/guilds.change_logo.html.twig index 6336480f..9205b7a0 100644 --- a/system/templates/guilds.change_logo.html.twig +++ b/system/templates/guilds.change_logo.html.twig @@ -8,15 +8,11 @@ Here you can change logo of your guild.
Actuall logo:
-
- {{ include('buttons.back.html.twig') }} -
+ {{ include('buttons.back.html.twig') }} -{% endspaceless %} \ No newline at end of file + diff --git a/system/templates/guilds.change_motd.html.twig b/system/templates/guilds.change_motd.html.twig index cbc267a9..89d7829f 100644 --- a/system/templates/guilds.change_motd.html.twig +++ b/system/templates/guilds.change_motd.html.twig @@ -5,12 +5,8 @@ Here you can change MOTD (Message of the Day, showed in game!) of your guild.
{{ guild.getCustomField('motd')|raw }}
(max. {{ config.guild_motd_chars_limit }} chars)

-{% spaceless %}
-
- {{ include('buttons.back.html.twig') }} -
+ {{ include('buttons.back.html.twig') }}
-{% endspaceless %} \ No newline at end of file From 8ecd8a10c057e808f3c74bf6f629369d3c01ed41 Mon Sep 17 00:00:00 2001 From: slawkens Date: Tue, 8 Jun 2021 11:25:11 +0200 Subject: [PATCH 16/17] Remove unneeded escape --- index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.php b/index.php index 71ca4743..1c47f2e8 100644 --- a/index.php +++ b/index.php @@ -38,7 +38,7 @@ else $uri = str_replace(array('index.php/', '?'), '', $uri); define('URI', $uri); -if(preg_match("/^[A-Za-z0-9-_%\'+]+\.png$/i", $uri)) { +if(preg_match("/^[A-Za-z0-9-_%'+]+\.png$/i", $uri)) { $tmp = explode('.', $uri); $_REQUEST['name'] = urldecode($tmp[0]); From 0f3d2424ceb2183722c8a7078a0d195d1ed37aee Mon Sep 17 00:00:00 2001 From: slawkens Date: Tue, 8 Jun 2021 23:18:24 +0200 Subject: [PATCH 17/17] Fix release.sh (some warning) --- release.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/release.sh b/release.sh index 6578481b..6bf99385 100644 --- a/release.sh +++ b/release.sh @@ -17,12 +17,14 @@ if [ $1 = "prepare" ]; then echo "Preparing to release version $version of the MyAAC Project!" + # make required directories + mkdir -p releases + mkdir -p tmp + # get myaac from git archive git archive --format zip --output tmp/myaac.zip master - # make required directories - mkdir -p releases - mkdir -p tmp && cd tmp + cd tmp/ dir="myaac-$version" if [ -d "$dir" ] ; then
+ThreadThread StarterRepliesViewsLast Post
- Author + + Author