From db554df0416ca34daa1fad56804c4751eaf253b4 Mon Sep 17 00:00:00 2001 From: slawkens Date: Tue, 8 Jun 2021 18:37:00 +0200 Subject: [PATCH 1/7] 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 2/7] 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 ''; + 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 3/7] 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 4/7] 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 5/7] 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 6/7] 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 7/7] 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