From aa6e53812b0a1366de27c2cd9d9fa6d2965a5ba0 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Fri, 31 Oct 2014 07:08:57 +0100 Subject: [PATCH 1/9] [ticket/382] Fix inheritdoc and functions_upload docblock B3P-382 --- includes/functions_upload.php | 2 +- modules/announcements.php | 8 ++++---- modules/attachments.php | 10 +++++----- modules/birthday_list.php | 8 ++++---- modules/calendar.php | 8 ++++---- modules/clock.php | 4 ++-- modules/custom.php | 10 +++++----- modules/default.php | 10 +++++----- modules/donation.php | 10 +++++----- modules/forumlist.php | 4 ++-- modules/friends.php | 8 ++++---- modules/latest_bots.php | 8 ++++---- modules/latest_members.php | 8 ++++---- modules/leaders.php | 8 ++++---- modules/link_us.php | 4 ++-- modules/links.php | 8 ++++---- modules/main_menu.php | 8 ++++---- modules/module_base.php | 18 +++++++++--------- modules/news.php | 8 ++++---- modules/poll.php | 10 +++++----- modules/random_member.php | 4 ++-- modules/recent.php | 8 ++++---- modules/search.php | 4 ++-- modules/statistics.php | 4 ++-- modules/stylechanger.php | 4 ++-- modules/topposters.php | 8 ++++---- modules/user_menu.php | 8 ++++---- modules/welcome.php | 8 ++++---- modules/whois_online.php | 6 +++--- 29 files changed, 108 insertions(+), 108 deletions(-) diff --git a/includes/functions_upload.php b/includes/functions_upload.php index 9b9b6771..69da4dc1 100644 --- a/includes/functions_upload.php +++ b/includes/functions_upload.php @@ -266,7 +266,7 @@ class portal_upload * @param $from string Can be a file or a directory. Will move either the file or all files within the directory * @param $to string Where to move the file(s) to. If not specified then will get moved to the root folder * @param $strip Used for FTP only - * @return mixed: Bool true on success, error string on failure, NULL if no action was taken + * @return mixed Bool true on success, error string on failure, NULL if no action was taken * * NOTE: function should preferably not return in case of failure on only one file. * The current method makes error handling difficult diff --git a/modules/announcements.php b/modules/announcements.php index 5c31e7db..58283fe0 100644 --- a/modules/announcements.php +++ b/modules/announcements.php @@ -110,7 +110,7 @@ class announcements extends module_base } /** - * @inheritdoc + * {@inheritdoc} */ public function get_template_center($module_id) { @@ -445,7 +445,7 @@ class announcements extends module_base } /** - * @inheritdoc + * {@inheritdoc} */ public function get_template_acp($module_id) { @@ -467,7 +467,7 @@ class announcements extends module_base } /** - * @inheritdoc + * {@inheritdoc} */ public function install($module_id) { @@ -485,7 +485,7 @@ class announcements extends module_base } /** - * @inheritdoc + * {@inheritdoc} */ public function uninstall($module_id, $db) { diff --git a/modules/attachments.php b/modules/attachments.php index d8274e92..cc0ca551 100644 --- a/modules/attachments.php +++ b/modules/attachments.php @@ -95,7 +95,7 @@ class attachments extends module_base } /** - * @inheritdoc + * {@inheritdoc} */ public function get_template_center($module_id) { @@ -103,7 +103,7 @@ class attachments extends module_base } /** - * @inheritdoc + * {@inheritdoc} */ public function get_template_side($module_id) { @@ -111,7 +111,7 @@ class attachments extends module_base } /** - * @inheritdoc + * {@inheritdoc} */ public function get_template_acp($module_id) { @@ -130,7 +130,7 @@ class attachments extends module_base } /** - * @inheritdoc + * {@inheritdoc} */ public function install($module_id) { @@ -144,7 +144,7 @@ class attachments extends module_base } /** - * @inheritdoc + * {@inheritdoc} */ public function uninstall($module_id, $db) { diff --git a/modules/birthday_list.php b/modules/birthday_list.php index 03a78da0..f3c174ab 100644 --- a/modules/birthday_list.php +++ b/modules/birthday_list.php @@ -70,7 +70,7 @@ class birthday_list extends module_base } /** - * @inheritdoc + * {@inheritdoc} */ public function get_template_side($module_id) { @@ -158,7 +158,7 @@ class birthday_list extends module_base } /** - * @inheritdoc + * {@inheritdoc} */ public function get_template_acp($module_id) { @@ -172,7 +172,7 @@ class birthday_list extends module_base } /** - * @inheritdoc + * {@inheritdoc} */ public function install($module_id) { @@ -181,7 +181,7 @@ class birthday_list extends module_base } /** - * @inheritdoc + * {@inheritdoc} */ public function uninstall($module_id, $db) { diff --git a/modules/calendar.php b/modules/calendar.php index fd30400e..1869c0e2 100644 --- a/modules/calendar.php +++ b/modules/calendar.php @@ -143,7 +143,7 @@ class calendar extends module_base } /** - * @inheritdoc + * {@inheritdoc} */ public function get_template_side($module_id) { @@ -337,7 +337,7 @@ class calendar extends module_base } /** - * @inheritdoc + * {@inheritdoc} */ public function get_template_acp($module_id) { @@ -357,7 +357,7 @@ class calendar extends module_base } /** - * @inheritdoc + * {@inheritdoc} */ public function install($module_id) { @@ -374,7 +374,7 @@ class calendar extends module_base } /** - * @inheritdoc + * {@inheritdoc} */ public function uninstall($module_id, $db) { diff --git a/modules/clock.php b/modules/clock.php index c4c5678a..a0a74c3e 100644 --- a/modules/clock.php +++ b/modules/clock.php @@ -42,7 +42,7 @@ class clock extends module_base public $language = 'portal_clock_module'; /** - * @inheritdoc + * {@inheritdoc} */ public function get_template_side($module_id) { @@ -50,7 +50,7 @@ class clock extends module_base } /** - * @inheritdoc + * {@inheritdoc} */ public function get_template_acp($module_id) { diff --git a/modules/custom.php b/modules/custom.php index 068d68cd..3b81baeb 100644 --- a/modules/custom.php +++ b/modules/custom.php @@ -96,7 +96,7 @@ class custom extends module_base } /** - * @inheritdoc + * {@inheritdoc} */ public function get_template_center($module_id) { @@ -104,7 +104,7 @@ class custom extends module_base } /** - * @inheritdoc + * {@inheritdoc} */ public function get_template_side($module_id) { @@ -112,7 +112,7 @@ class custom extends module_base } /** - * @inheritdoc + * {@inheritdoc} */ public function get_template_acp($module_id) { @@ -126,7 +126,7 @@ class custom extends module_base } /** - * @inheritdoc + * {@inheritdoc} */ public function install($module_id) { @@ -142,7 +142,7 @@ class custom extends module_base } /** - * @inheritdoc + * {@inheritdoc} */ public function uninstall($module_id, $db) { diff --git a/modules/default.php b/modules/default.php index ba2b6412..867fd002 100644 --- a/modules/default.php +++ b/modules/default.php @@ -71,7 +71,7 @@ class modulename extends module_base } /** - * @inheritdoc + * {@inheritdoc} */ public function get_template_center($module_id) { @@ -83,7 +83,7 @@ class modulename extends module_base } /** - * @inheritdoc + * {@inheritdoc} */ public function get_template_side($module_id) { @@ -95,7 +95,7 @@ class modulename extends module_base } /** - * @inheritdoc + * {@inheritdoc} */ public function get_template_acp($module_id) { @@ -110,7 +110,7 @@ class modulename extends module_base } /** - * @inheritdoc + * {@inheritdoc} */ public function install($module_id) { @@ -120,7 +120,7 @@ class modulename extends module_base } /** - * @inheritdoc + * {@inheritdoc} */ public function uninstall($module_id, $db) { diff --git a/modules/donation.php b/modules/donation.php index e390a278..f15f4e09 100644 --- a/modules/donation.php +++ b/modules/donation.php @@ -65,7 +65,7 @@ class donation extends module_base } /** - * @inheritdoc + * {@inheritdoc} */ public function get_template_center($module_id) { @@ -78,7 +78,7 @@ class donation extends module_base } /** - * @inheritdoc + * {@inheritdoc} */ public function get_template_side($module_id) { @@ -91,7 +91,7 @@ class donation extends module_base } /** - * @inheritdoc + * {@inheritdoc} */ public function get_template_acp($module_id) { @@ -106,7 +106,7 @@ class donation extends module_base } /** - * @inheritdoc + * {@inheritdoc} */ public function install($module_id) { @@ -116,7 +116,7 @@ class donation extends module_base } /** - * @inheritdoc + * {@inheritdoc} */ public function uninstall($module_id, $db) { diff --git a/modules/forumlist.php b/modules/forumlist.php index 8065a4cd..da0a3e55 100644 --- a/modules/forumlist.php +++ b/modules/forumlist.php @@ -86,7 +86,7 @@ class forumlist extends module_base } /** - * @inheritdoc + * {@inheritdoc} */ public function get_template_center($module_id) { @@ -109,7 +109,7 @@ class forumlist extends module_base } /** - * @inheritdoc + * {@inheritdoc} */ public function get_template_acp($module_id) { diff --git a/modules/friends.php b/modules/friends.php index fa9b599d..b5b185b4 100644 --- a/modules/friends.php +++ b/modules/friends.php @@ -75,7 +75,7 @@ class friends extends module_base } /** - * @inheritdoc + * {@inheritdoc} */ public function get_template_side($module_id) { @@ -131,7 +131,7 @@ class friends extends module_base } /** - * @inheritdoc + * {@inheritdoc} */ public function get_template_acp($module_id) { @@ -145,7 +145,7 @@ class friends extends module_base } /** - * @inheritdoc + * {@inheritdoc} */ public function install($module_id) { @@ -154,7 +154,7 @@ class friends extends module_base } /** - * @inheritdoc + * {@inheritdoc} */ public function uninstall($module_id, $db) { diff --git a/modules/latest_bots.php b/modules/latest_bots.php index 1beeed94..a48d0094 100644 --- a/modules/latest_bots.php +++ b/modules/latest_bots.php @@ -75,7 +75,7 @@ class latest_bots extends module_base } /** - * @inheritdoc + * {@inheritdoc} */ public function get_template_side($module_id) { @@ -106,7 +106,7 @@ class latest_bots extends module_base } /** - * @inheritdoc + * {@inheritdoc} */ public function get_template_acp($module_id) { @@ -120,7 +120,7 @@ class latest_bots extends module_base } /** - * @inheritdoc + * {@inheritdoc} */ public function install($module_id) { @@ -129,7 +129,7 @@ class latest_bots extends module_base } /** - * @inheritdoc + * {@inheritdoc} */ public function uninstall($module_id, $db) { diff --git a/modules/latest_members.php b/modules/latest_members.php index 0f12f33b..8dc37de9 100644 --- a/modules/latest_members.php +++ b/modules/latest_members.php @@ -70,7 +70,7 @@ class latest_members extends module_base } /** - * @inheritdoc + * {@inheritdoc} */ public function get_template_side($module_id) { @@ -94,7 +94,7 @@ class latest_members extends module_base } /** - * @inheritdoc + * {@inheritdoc} */ public function get_template_acp($module_id) { @@ -108,7 +108,7 @@ class latest_members extends module_base } /** - * @inheritdoc + * {@inheritdoc} */ public function install($module_id) { @@ -117,7 +117,7 @@ class latest_members extends module_base } /** - * @inheritdoc + * {@inheritdoc} */ public function uninstall($module_id, $db) { diff --git a/modules/leaders.php b/modules/leaders.php index 6b61d9be..9bf48ebb 100644 --- a/modules/leaders.php +++ b/modules/leaders.php @@ -85,7 +85,7 @@ class leaders extends module_base } /** - * @inheritdoc + * {@inheritdoc} */ public function get_template_side($module_id) { @@ -244,7 +244,7 @@ class leaders extends module_base } /** - * @inheritdoc + * {@inheritdoc} */ public function get_template_acp($module_id) { @@ -258,7 +258,7 @@ class leaders extends module_base } /** - * @inheritdoc + * {@inheritdoc} */ public function install($module_id) { @@ -268,7 +268,7 @@ class leaders extends module_base } /** - * @inheritdoc + * {@inheritdoc} */ public function uninstall($module_id, $db) { diff --git a/modules/link_us.php b/modules/link_us.php index 070e3706..b52dbe2d 100644 --- a/modules/link_us.php +++ b/modules/link_us.php @@ -65,7 +65,7 @@ class link_us extends module_base } /** - * @inheritdoc + * {@inheritdoc} */ public function get_template_side($module_id) { @@ -82,7 +82,7 @@ class link_us extends module_base } /** - * @inheritdoc + * {@inheritdoc} */ public function get_template_acp($module_id) { diff --git a/modules/links.php b/modules/links.php index 04af91d9..144d0a7e 100644 --- a/modules/links.php +++ b/modules/links.php @@ -102,7 +102,7 @@ class links extends module_base } /** - * @inheritdoc + * {@inheritdoc} */ public function get_template_side($module_id) { @@ -144,7 +144,7 @@ class links extends module_base } /** - * @inheritdoc + * {@inheritdoc} */ public function get_template_acp($module_id) { @@ -160,7 +160,7 @@ class links extends module_base } /** - * @inheritdoc + * {@inheritdoc} */ public function install($module_id) { @@ -205,7 +205,7 @@ class links extends module_base } /** - * @inheritdoc + * {@inheritdoc} */ public function uninstall($module_id, $db) { diff --git a/modules/main_menu.php b/modules/main_menu.php index fbbdd5a2..28507cbb 100644 --- a/modules/main_menu.php +++ b/modules/main_menu.php @@ -103,7 +103,7 @@ class main_menu extends module_base } /** - * @inheritdoc + * {@inheritdoc} */ public function get_template_side($module_id) { @@ -154,7 +154,7 @@ class main_menu extends module_base } /** - * @inheritdoc + * {@inheritdoc} */ public function get_template_acp($module_id) { @@ -169,7 +169,7 @@ class main_menu extends module_base } /** - * @inheritdoc + * {@inheritdoc} */ public function install($module_id) { @@ -260,7 +260,7 @@ class main_menu extends module_base } /** - * @inheritdoc + * {@inheritdoc} */ public function uninstall($module_id, $db) { diff --git a/modules/module_base.php b/modules/module_base.php index f77b06ed..96270a4c 100644 --- a/modules/module_base.php +++ b/modules/module_base.php @@ -15,7 +15,7 @@ namespace board3\portal\modules; class module_base implements module_interface { /** - * @inheritdoc + * {@inheritdoc} */ public function get_allowed_columns() { @@ -23,7 +23,7 @@ class module_base implements module_interface } /** - * @inheritdoc + * {@inheritdoc} */ public function get_name() { @@ -31,7 +31,7 @@ class module_base implements module_interface } /** - * @inheritdoc + * {@inheritdoc} */ public function get_image() { @@ -39,7 +39,7 @@ class module_base implements module_interface } /** - * @inheritdoc + * {@inheritdoc} */ public function get_language() { @@ -47,7 +47,7 @@ class module_base implements module_interface } /** - * @inheritdoc + * {@inheritdoc} */ public function get_template_side($module_id) { @@ -55,7 +55,7 @@ class module_base implements module_interface } /** - * @inheritdoc + * {@inheritdoc} */ public function get_template_center($module_id) { @@ -63,7 +63,7 @@ class module_base implements module_interface } /** - * @inheritdoc + * {@inheritdoc} */ public function get_template_acp($module_id) { @@ -71,7 +71,7 @@ class module_base implements module_interface } /** - * @inheritdoc + * {@inheritdoc} */ public function install($module_id) { @@ -79,7 +79,7 @@ class module_base implements module_interface } /** - * @inheritdoc + * {@inheritdoc} */ public function uninstall($module_id, $db) { diff --git a/modules/news.php b/modules/news.php index 73bd95b1..0dcc7de1 100644 --- a/modules/news.php +++ b/modules/news.php @@ -110,7 +110,7 @@ class news extends module_base } /** - * @inheritdoc + * {@inheritdoc} */ public function get_template_center($module_id) { @@ -424,7 +424,7 @@ class news extends module_base } /** - * @inheritdoc + * {@inheritdoc} */ public function get_template_acp($module_id) { @@ -447,7 +447,7 @@ class news extends module_base } /** - * @inheritdoc + * {@inheritdoc} */ public function install($module_id) { @@ -465,7 +465,7 @@ class news extends module_base } /** - * @inheritdoc + * {@inheritdoc} */ public function uninstall($module_id, $db) { diff --git a/modules/poll.php b/modules/poll.php index 0b0b7a9b..1a6419a6 100644 --- a/modules/poll.php +++ b/modules/poll.php @@ -96,7 +96,7 @@ class poll extends module_base } /** - * @inheritdoc + * {@inheritdoc} */ public function get_template_center($module_id) { @@ -104,7 +104,7 @@ class poll extends module_base } /** - * @inheritdoc + * {@inheritdoc} */ public function get_template_side($module_id) { @@ -112,7 +112,7 @@ class poll extends module_base } /** - * @inheritdoc + * {@inheritdoc} */ public function get_template_acp($module_id) { @@ -130,7 +130,7 @@ class poll extends module_base } /** - * @inheritdoc + * {@inheritdoc} */ public function install($module_id) { @@ -143,7 +143,7 @@ class poll extends module_base } /** - * @inheritdoc + * {@inheritdoc} */ public function uninstall($module_id, $db) { diff --git a/modules/random_member.php b/modules/random_member.php index 5d96527b..6afe69eb 100644 --- a/modules/random_member.php +++ b/modules/random_member.php @@ -71,7 +71,7 @@ class random_member extends module_base } /** - * @inheritdoc + * {@inheritdoc} */ public function get_template_side($module_id) { @@ -138,7 +138,7 @@ class random_member extends module_base } /** - * @inheritdoc + * {@inheritdoc} */ public function get_template_acp($module_id) { diff --git a/modules/recent.php b/modules/recent.php index 6d49d96e..300da3a0 100644 --- a/modules/recent.php +++ b/modules/recent.php @@ -91,7 +91,7 @@ class recent extends module_base } /** - * @inheritdoc + * {@inheritdoc} */ public function get_template_center($module_id) { @@ -209,7 +209,7 @@ class recent extends module_base } /** - * @inheritdoc + * {@inheritdoc} */ public function get_template_acp($module_id) { @@ -226,7 +226,7 @@ class recent extends module_base } /** - * @inheritdoc + * {@inheritdoc} */ public function install($module_id) { @@ -238,7 +238,7 @@ class recent extends module_base } /** - * @inheritdoc + * {@inheritdoc} */ public function uninstall($module_id, $db) { diff --git a/modules/search.php b/modules/search.php index 9832d607..884a241a 100644 --- a/modules/search.php +++ b/modules/search.php @@ -71,7 +71,7 @@ class search extends module_base } /** - * @inheritdoc + * {@inheritdoc} */ public function get_template_side($module_id) { @@ -81,7 +81,7 @@ class search extends module_base } /** - * @inheritdoc + * {@inheritdoc} */ public function get_template_acp($module_id) { diff --git a/modules/statistics.php b/modules/statistics.php index af1de9cb..695ba543 100644 --- a/modules/statistics.php +++ b/modules/statistics.php @@ -81,7 +81,7 @@ class statistics extends module_base } /** - * @inheritdoc + * {@inheritdoc} */ public function get_template_side($module_id) { @@ -166,7 +166,7 @@ class statistics extends module_base } /** - * @inheritdoc + * {@inheritdoc} */ public function get_template_acp($module_id) { diff --git a/modules/stylechanger.php b/modules/stylechanger.php index cbadf6cd..162dad7c 100644 --- a/modules/stylechanger.php +++ b/modules/stylechanger.php @@ -85,7 +85,7 @@ class stylechanger extends module_base } /** - * @inheritdoc + * {@inheritdoc} */ public function get_template_side($module_id) { @@ -125,7 +125,7 @@ class stylechanger extends module_base } /** - * @inheritdoc + * {@inheritdoc} */ public function get_template_acp($module_id) { diff --git a/modules/topposters.php b/modules/topposters.php index 01922b08..66305e6f 100644 --- a/modules/topposters.php +++ b/modules/topposters.php @@ -75,7 +75,7 @@ class topposters extends module_base } /** - * @inheritdoc + * {@inheritdoc} */ public function get_template_side($module_id) { @@ -101,7 +101,7 @@ class topposters extends module_base } /** - * @inheritdoc + * {@inheritdoc} */ public function get_template_acp($module_id) { @@ -115,7 +115,7 @@ class topposters extends module_base } /** - * @inheritdoc + * {@inheritdoc} */ public function install($module_id) { @@ -124,7 +124,7 @@ class topposters extends module_base } /** - * @inheritdoc + * {@inheritdoc} */ public function uninstall($module_id, $db) { diff --git a/modules/user_menu.php b/modules/user_menu.php index 9b34394e..9dc91cda 100644 --- a/modules/user_menu.php +++ b/modules/user_menu.php @@ -95,7 +95,7 @@ class user_menu extends module_base } /** - * @inheritdoc + * {@inheritdoc} */ public function get_template_side($module_id) { @@ -198,7 +198,7 @@ class user_menu extends module_base } /** - * @inheritdoc + * {@inheritdoc} */ public function get_template_acp($module_id) { @@ -212,7 +212,7 @@ class user_menu extends module_base } /** - * @inheritdoc + * {@inheritdoc} */ public function install($module_id) { @@ -222,7 +222,7 @@ class user_menu extends module_base } /** - * @inheritdoc + * {@inheritdoc} */ public function uninstall($module_id, $db) { diff --git a/modules/welcome.php b/modules/welcome.php index 7a4924d3..08478cd6 100644 --- a/modules/welcome.php +++ b/modules/welcome.php @@ -86,7 +86,7 @@ class welcome extends module_base } /** - * @inheritdoc + * {@inheritdoc} */ public function get_template_center($module_id) { @@ -106,7 +106,7 @@ class welcome extends module_base } /** - * @inheritdoc + * {@inheritdoc} */ public function get_template_acp($module_id) { @@ -120,7 +120,7 @@ class welcome extends module_base } /** - * @inheritdoc + * {@inheritdoc} */ public function install($module_id) { @@ -132,7 +132,7 @@ class welcome extends module_base } /** - * @inheritdoc + * {@inheritdoc} */ public function uninstall($module_id, $db) { diff --git a/modules/whois_online.php b/modules/whois_online.php index 744f9c02..88a2af9a 100644 --- a/modules/whois_online.php +++ b/modules/whois_online.php @@ -86,7 +86,7 @@ class whois_online extends module_base } /** - * @inheritdoc + * {@inheritdoc} */ public function get_template_center($module_id) { @@ -139,7 +139,7 @@ class whois_online extends module_base } /** - * @inheritdoc + * {@inheritdoc} */ public function get_template_side($module_id) { @@ -147,7 +147,7 @@ class whois_online extends module_base } /** - * @inheritdoc + * {@inheritdoc} */ public function get_template_acp($module_id) { From 2c951d8c4bfdc0e662dbf574b91edc245a7bbc96 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Fri, 31 Oct 2014 07:13:16 +0100 Subject: [PATCH 2/9] [ticket/382] Correctly specfiy return types of get_template methods B3P-382 --- modules/module_interface.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/module_interface.php b/modules/module_interface.php index 786984ce..2570443a 100644 --- a/modules/module_interface.php +++ b/modules/module_interface.php @@ -56,7 +56,7 @@ interface module_interface * * @param int $module_id Module's ID * - * @return string Module template file + * @return string|array Module template file */ public function get_template_side($module_id); @@ -65,7 +65,7 @@ interface module_interface * * @param int $module_id Module's ID * - * @return string Module template file + * @return string|array Module template file */ public function get_template_center($module_id); From 361c0d9729abcd103244f3027008692ba73dea90 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Fri, 31 Oct 2014 07:25:04 +0100 Subject: [PATCH 3/9] [ticket/382] Remove unused code and fix logic issue B3P-382 --- modules/announcements.php | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/modules/announcements.php b/modules/announcements.php index 58283fe0..0a44a1bc 100644 --- a/modules/announcements.php +++ b/modules/announcements.php @@ -231,7 +231,7 @@ class announcements extends module_base // unread? $forum_id = $fetch_news[$i]['forum_id']; $topic_id = $fetch_news[$i]['topic_id']; - //$topic_tracking_info = get_complete_topic_tracking($forum_id, $topic_id, $global_announce_list = false); + $unread_topic = (isset($topic_tracking_info[$topic_id]) && $fetch_news[$i]['topic_last_post_time'] > $topic_tracking_info[$topic_id]) ? true : false; $real_forum_id = ($forum_id == 0) ? $fetch_news['global_id']: $forum_id; $read_full_url = ($this->request->is_set('ap')) ? 'ap='. $start . '&announcement=' . $i . '#a' . $i : 'announcement=' . $i . '#a' . $i; @@ -243,7 +243,7 @@ class announcements extends module_base } $replies = ($this->auth->acl_get('m_approve', $forum_id)) ? $fetch_news[$i]['topic_replies_real'] : $fetch_news[$i]['topic_replies']; - $folder_img = $folder_alt = $topic_type = $folder = $folder_new = ''; + switch ($fetch_news[$i]['topic_type']) { case POST_GLOBAL: @@ -270,10 +270,7 @@ class announcements extends module_base $folder .= '_locked'; $folder_new .= '_locked'; } - if ($fetch_news[$i]['topic_type'] == POST_GLOBAL) - { - $global_announce_list[$fetch_news[$i]['topic_id']] = true; - } + if ($fetch_news[$i]['topic_posted']) { $folder .= '_mine'; @@ -336,7 +333,7 @@ class announcements extends module_base if ($this->config['board3_number_of_announcements_' . $module_id] != 0 && $this->config['board3_announcements_archive_' . $module_id]) { $this->template->assign_vars(array( - 'AP_PAGINATION' => $pagination, + 'AP_PAGINATION' => (isset($pagination)) ? $pagination : '', 'TOTAL_ANNOUNCEMENTS' => ($total_announcements == 1) ? $this->user->lang['VIEW_LATEST_ANNOUNCEMENT'] : sprintf($this->user->lang['VIEW_LATEST_ANNOUNCEMENTS'], $total_announcements), 'AP_PAGE_NUMBER' => $this->pagination->on_page($total_announcements, $this->config['board3_number_of_announcements_' . $module_id], $start)) ); @@ -359,7 +356,7 @@ class announcements extends module_base $forum_id = $fetch_news[$i]['forum_id']; $topic_id = $fetch_news[$i]['topic_id']; - $topic_tracking_info = get_complete_topic_tracking($forum_id, $topic_id, $global_announce_list = false); + $topic_tracking_info = get_complete_topic_tracking($forum_id, $topic_id); $unread_topic = (isset($topic_tracking_info[$topic_id]) && $fetch_news[$i]['topic_last_post_time'] > $topic_tracking_info[$topic_id]) ? true : false; $open_bracket = '[ '; $close_bracket = ' ]'; From 51e94518f454524dbb255a9edc803f5bcd719488 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Fri, 31 Oct 2014 07:31:37 +0100 Subject: [PATCH 4/9] [ticket/382] Clean up calendar module B3P-382 --- modules/calendar.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/calendar.php b/modules/calendar.php index 1869c0e2..60589d79 100644 --- a/modules/calendar.php +++ b/modules/calendar.php @@ -51,6 +51,7 @@ class calendar extends module_base * additional variables */ protected $mini_cal_fdow; + protected $mini_cal_month; /** * User datetime object @@ -177,7 +178,6 @@ class calendar extends module_base $mini_cal_count = $this->mini_cal_fdow; $mini_cal_this_year = $this->dateYYYY; $mini_cal_this_month = $this->dateMM; - $mini_cal_this_day = $this->dateDD; $mini_cal_month_days = $this->daysMonth; // output our general calendar bits @@ -264,6 +264,7 @@ class calendar extends module_base if (!empty($events) && $this->config['board3_display_events_' . $module_id]) { + $time_ary = array(); // we sort the $events array by the start time foreach ($events as $key => $cur_event) { @@ -520,6 +521,7 @@ class calendar extends module_base $this->log->add('admin', $this->user->data['user_id'], $this->user->data['user_ip'], 'LOG_PORTAL_EVENT_ADDED', false, array($event_title)); } + $time_ary = array(); // we sort the $events array by the start time foreach ($events as $key => $cur_event) { @@ -601,8 +603,6 @@ class calendar extends module_base $this->db->sql_freeresult($result); return; - - break; } for ($i = 0; $i < sizeof($events); $i++) @@ -618,7 +618,7 @@ class calendar extends module_base 'EVENT_TITLE' => ($action != 'add') ? ((isset($this->user->lang[$events[$i]['title']])) ? $this->user->lang[$events[$i]['title']] : $events[$i]['title']) : '', 'EVENT_DESC' => ($action != 'add') ? $events[$i]['desc'] : '', 'EVENT_START' => ($action != 'add') ? $this->user->format_date($events[$i]['start_time'], $start_time_format) : '', - 'EVENT_END' => ($action != 'add' && !$event_all_day) ? $this->user->format_date($events[$i]['end_time'], $end_time_format) : '', + 'EVENT_END' => ($action != 'add' && !$event_all_day && !empty($end_time_format)) ? $this->user->format_date($events[$i]['end_time'], $end_time_format) : '', 'EVENT_URL' => ($action != 'add' && isset($events[$i]['url']) && !empty($events[$i]['url'])) ? $this->validate_url($events[$i]['url']) : '', 'EVENT_URL_RAW' => ($action != 'add' && isset($events[$i]['url']) && !empty($events[$i]['url'])) ? $events[$i]['url'] : '', 'U_EDIT' => $u_action . '&action=edit&id=' . $i, From 7e6ba60948065f05e47565eb16aea374307eeb30 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Fri, 31 Oct 2014 07:33:20 +0100 Subject: [PATCH 5/9] [ticket/382] Clean up custom module B3P-382 --- modules/custom.php | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/modules/custom.php b/modules/custom.php index 3b81baeb..2abe3f97 100644 --- a/modules/custom.php +++ b/modules/custom.php @@ -186,7 +186,7 @@ class custom extends module_base $u_action = append_sid('index.' . $this->php_ext, 'i=\board3\portal\acp\portal_module&mode=config&module_id=' . $module_id); - switch($action) + switch ($action) { // Save changes case 'save': @@ -202,14 +202,14 @@ class custom extends module_base $custom_image_src = $this->request->variable('module_image', '', true); $groups_ary = array(); $uid = $bitfield = $flags = ''; - $options = 7; - if($custom_bbcode) + + if ($custom_bbcode) { generate_text_for_storage($custom_code, $uid, $bitfield, $flags, true, true, true); } // first check for obvious errors, we don't want to waste server resources - if(empty($custom_code)) + if (empty($custom_code)) { trigger_error($this->user->lang['ACP_PORTAL_CUSTOM_CODE_SHORT']. adm_back_link($u_action), E_USER_WARNING); } @@ -219,7 +219,7 @@ class custom extends module_base FROM ' . GROUPS_TABLE . ' ORDER BY group_id ASC'; $result = $this->db->sql_query($sql); - while($row = $this->db->sql_fetchrow($result)) + while ($row = $this->db->sql_fetchrow($result)) { $groups_ary[] = $row['group_id']; } @@ -261,12 +261,12 @@ class custom extends module_base $groups_ary = array(); // first check for obvious errors, we don't want to waste server resources - if(empty($custom_code)) + if (empty($custom_code)) { trigger_error($this->user->lang['ACP_PORTAL_CUSTOM_CODE_SHORT']. adm_back_link($u_action), E_USER_WARNING); } - if($custom_bbcode) + if ($custom_bbcode) { $bbcode_options = OPTION_FLAG_BBCODE + OPTION_FLAG_SMILIES + OPTION_FLAG_LINKS; $uid = (isset($this->config['board3_custom_' . $module_id . '_uid'])) ? $this->config['board3_custom_' . $module_id . '_uid'] : ''; @@ -291,7 +291,7 @@ class custom extends module_base FROM ' . GROUPS_TABLE . ' ORDER BY group_id ASC'; $result = $this->db->sql_query($sql); - while($row = $this->db->sql_fetchrow($result)) + while ($row = $this->db->sql_fetchrow($result)) { $groups_ary[] = $row['group_id']; } @@ -302,7 +302,7 @@ class custom extends module_base // Edit or add menu item case 'reset': default: - if(!isset($custom_code)) + if (!isset($custom_code)) { $custom_code = generate_text_for_edit($portal_config['board3_custom_' . $module_id . '_code'], $this->config['board3_custom_' . $module_id . '_uid'], ''); } @@ -328,7 +328,7 @@ class custom extends module_base FROM ' . GROUPS_TABLE . ' ORDER BY group_id ASC'; $result = $this->db->sql_query($sql); - while($row = $this->db->sql_fetchrow($result)) + while ($row = $this->db->sql_fetchrow($result)) { $this->template->assign_block_vars('permission_setting', array( 'SELECTED' => (in_array($row['group_id'], $groups_ary)) ? true : false, @@ -338,7 +338,7 @@ class custom extends module_base } $this->db->sql_freeresult($result); - if(!function_exists('display_forums')) + if (!function_exists('display_forums')) { include($this->phpbb_root_path . 'includes/functions_display.' . $this->php_ext); } @@ -396,7 +396,7 @@ class custom extends module_base $title = (!empty($this->config['board3_custom_' . $module_id . '_title'])) ? ((isset($this->user->lang[$this->config['board3_custom_' . $module_id . '_title']])) ? $this->user->lang[$this->config['board3_custom_' . $module_id . '_title']] : $this->config['board3_custom_' . $module_id . '_title']) : $this->user->lang[$this->name]; - if(!empty($assign_code)) + if (!empty($assign_code)) { return array( 'template' => 'custom_' . $type . '.html', From b402df024d448c0cee8b15a3f4bdeb0dcf5b634f Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Fri, 31 Oct 2014 07:40:44 +0100 Subject: [PATCH 6/9] [ticket/382] More code clean up B3P-382 --- modules/leaders.php | 4 ++++ modules/links.php | 15 +++++---------- modules/main_menu.php | 20 ++++++++------------ 3 files changed, 17 insertions(+), 22 deletions(-) diff --git a/modules/leaders.php b/modules/leaders.php index 9bf48ebb..f3d208f5 100644 --- a/modules/leaders.php +++ b/modules/leaders.php @@ -213,6 +213,10 @@ class leaders extends module_base { $which_row = 'b3p_moderators'; } + else + { + continue; + } if ($row['group_type'] == GROUP_HIDDEN && !$this->auth->acl_gets('a_group', 'a_groupadd', 'a_groupdel') && $row['ug_user_id'] != $this->user->data['user_id']) { diff --git a/modules/links.php b/modules/links.php index 144d0a7e..8f929b3e 100644 --- a/modules/links.php +++ b/modules/links.php @@ -106,7 +106,6 @@ class links extends module_base */ public function get_template_side($module_id) { - $links = array(); $portal_config = obtain_portal_config(); $links = $this->utf_unserialize($portal_config['board3_links_array_' . $module_id]); @@ -116,7 +115,7 @@ class links extends module_base for ($i = 0; $i < sizeof($links); $i++) { - if($links[$i]['type'] == self::LINK_INT) + if ($links[$i]['type'] == self::LINK_INT) { $links[$i]['url'] = str_replace('&', '&', $links[$i]['url']); // we need to do this in order to prevent XHTML validation errors $cur_url = append_sid($this->phpbb_root_path . $links[$i]['url']); // the user should know what kind of file it is @@ -129,7 +128,7 @@ class links extends module_base $cur_permissions = explode(',', $links[$i]['permission']); $permission_check = array_intersect($groups_ary, $cur_permissions); - if(!empty($permission_check) || $links[$i]['permission'] == '') + if (!empty($permission_check) || $links[$i]['permission'] == '') { $this->template->assign_block_vars('portallinks', array( 'LINK_TITLE' => (isset($this->user->lang[$links[$i]['title']])) ? $this->user->lang[$links[$i]['title']] : $links[$i]['title'], @@ -186,7 +185,7 @@ class links extends module_base '', ); - foreach($links_urls as $i => $url) + foreach ($links_urls as $i => $url) { $links[] = array( 'title' => $links_titles[$i], @@ -243,8 +242,6 @@ class links extends module_base $link_id = $this->request->variable('id', 99999999); // 0 will trigger unwanted behavior, therefore we set a number we should never reach $portal_config = obtain_portal_config(); - $links = array(); - $links = $this->utf_unserialize($portal_config['board3_links_array_' . $module_id]); $u_action = append_sid('index.' . $this->php_ext, 'i=\board3\portal\acp\portal_module&mode=config&module_id=' . $module_id); @@ -270,7 +267,7 @@ class links extends module_base FROM ' . GROUPS_TABLE . ' ORDER BY group_id ASC'; $result = $this->db->sql_query($sql); - while($row = $this->db->sql_fetchrow($result)) + while ($row = $this->db->sql_fetchrow($result)) { $groups_ary[] = $row['group_id']; } @@ -419,7 +416,7 @@ class links extends module_base FROM ' . GROUPS_TABLE . ' ORDER BY group_id ASC'; $result = $this->db->sql_query($sql); - while($row = $this->db->sql_fetchrow($result)) + while ($row = $this->db->sql_fetchrow($result)) { $this->template->assign_block_vars('permission_setting_link', array( 'SELECTED' => (in_array($row['group_id'], $groups_ary)) ? true : false, @@ -430,8 +427,6 @@ class links extends module_base $this->db->sql_freeresult($result); return; - - break; } for ($i = 0; $i < sizeof($links); $i++) diff --git a/modules/main_menu.php b/modules/main_menu.php index 28507cbb..44752b08 100644 --- a/modules/main_menu.php +++ b/modules/main_menu.php @@ -107,7 +107,6 @@ class main_menu extends module_base */ public function get_template_side($module_id) { - $links = array(); $portal_config = obtain_portal_config(); $links = $this->utf_unserialize($portal_config['board3_menu_array_' . $module_id]); @@ -117,7 +116,7 @@ class main_menu extends module_base for ($i = 0; $i < sizeof($links); $i++) { - if($links[$i]['type'] == self::LINK_CAT) + if ($links[$i]['type'] == self::LINK_CAT) { $this->template->assign_block_vars('portalmenu', array( 'CAT_TITLE' => (isset($this->user->lang[$links[$i]['title']])) ? $this->user->lang[$links[$i]['title']] : $links[$i]['title'], @@ -126,7 +125,7 @@ class main_menu extends module_base } else { - if($links[$i]['type'] == self::LINK_INT) + if ($links[$i]['type'] == self::LINK_INT) { $links[$i]['url'] = str_replace('&', '&', $links[$i]['url']); // we need to do this in order to prevent XHTML validation errors $cur_url = append_sid($this->phpbb_root_path . $links[$i]['url']); // the user should know what kind of file it is @@ -139,7 +138,7 @@ class main_menu extends module_base $cur_permissions = explode(',', $links[$i]['permission']); $permission_check = array_intersect($groups_ary, $cur_permissions); - if(!empty($permission_check) || $links[$i]['permission'] == '') + if (!empty($permission_check) || $links[$i]['permission'] == '') { $this->template->assign_block_vars('portalmenu.links', array( 'LINK_TITLE' => (isset($this->user->lang[$links[$i]['title']])) ? $this->user->lang[$links[$i]['title']] : $links[$i]['title'], @@ -175,10 +174,11 @@ class main_menu extends module_base { // get the correct group IDs from the database $in_ary = array('GUESTS', 'REGISTERED', 'REGISTERED_COPPA'); + $groups_ary = array(); $sql = 'SELECT group_id, group_name FROM ' . GROUPS_TABLE . ' WHERE ' . $this->db->sql_in_set('group_name', $in_ary); $result = $this->db->sql_query($sql); - while($row = $this->db->sql_fetchrow($result)) + while ($row = $this->db->sql_fetchrow($result)) { $groups_ary[$row['group_name']] = $row['group_id']; } @@ -241,7 +241,7 @@ class main_menu extends module_base '', ); - foreach($links_urls as $i => $url) + foreach ($links_urls as $i => $url) { $links[] = array( 'title' => $links_titles[$i], @@ -298,8 +298,6 @@ class main_menu extends module_base $link_id = $this->request->variable('id', 99999999); // 0 will trigger unwanted behavior, therefore we set a number we should never reach $portal_config = obtain_portal_config(); - $links = array(); - $links = $this->utf_unserialize($portal_config['board3_menu_array_' . $module_id]); $u_action = append_sid('index.' . $this->php_ext, 'i=%5Cboard3%5Cportal%5Cacp%5Cportal_module&mode=config&module_id=' . $module_id); @@ -326,7 +324,7 @@ class main_menu extends module_base FROM ' . GROUPS_TABLE . ' ORDER BY group_id ASC'; $result = $this->db->sql_query($sql); - while($row = $this->db->sql_fetchrow($result)) + while ($row = $this->db->sql_fetchrow($result)) { $groups_ary[] = $row['group_id']; } @@ -481,7 +479,7 @@ class main_menu extends module_base FROM ' . GROUPS_TABLE . ' ORDER BY group_id ASC'; $result = $this->db->sql_query($sql); - while($row = $this->db->sql_fetchrow($result)) + while ($row = $this->db->sql_fetchrow($result)) { $this->template->assign_block_vars('permission_setting_menu', array( 'SELECTED' => (in_array($row['group_id'], $groups_ary)) ? true : false, @@ -492,8 +490,6 @@ class main_menu extends module_base $this->db->sql_freeresult($result); return; - - break; } for ($i = 0; $i < sizeof($links); $i++) From a4336cfff28027cebf0e2848f4452ed50f5f5b6b Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Fri, 31 Oct 2014 07:41:06 +0100 Subject: [PATCH 7/9] [ticket/382] Clean up in module base B3P-382 --- modules/module_base.php | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/modules/module_base.php b/modules/module_base.php index 96270a4c..beaa3b3f 100644 --- a/modules/module_base.php +++ b/modules/module_base.php @@ -14,6 +14,18 @@ namespace board3\portal\modules; */ class module_base implements module_interface { + /** @var int Module's allowed columns */ + protected $columns; + + /** @var string Module name */ + protected $name; + + /** @var string Module image source */ + protected $image_src; + + /** @var string Module language file */ + protected $language; + /** * {@inheritdoc} */ @@ -67,7 +79,7 @@ class module_base implements module_interface */ public function get_template_acp($module_id) { - return false; + return array(); } /** From 5f04c9a2bbd5f8ca9870984fd3d3c39ae83efe13 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Fri, 31 Oct 2014 07:49:46 +0100 Subject: [PATCH 8/9] [ticket/382] Code clean up in modules B3P-382 --- modules/news.php | 5 +++-- modules/poll.php | 5 +---- modules/random_member.php | 2 +- modules/user_menu.php | 5 +---- modules/welcome.php | 1 - 5 files changed, 6 insertions(+), 12 deletions(-) diff --git a/modules/news.php b/modules/news.php index 0dcc7de1..72668d93 100644 --- a/modules/news.php +++ b/modules/news.php @@ -119,6 +119,7 @@ class news extends module_base $this->user->add_lang('viewforum'); $start = $this->request->variable('np', 0); $start = ($start < 0) ? 0 : $start; + $total_news = 1; // Fetch news from portal functions.php with check if "read full" is requested. $portal_news_length = ($news < 0) ? $this->config['board3_news_length_' . $module_id] : 0; @@ -234,7 +235,7 @@ class news extends module_base } $replies = ($this->auth->acl_get('m_approve', $forum_id)) ? $fetch_news[$i]['topic_replies_real'] : $fetch_news[$i]['topic_replies']; - $folder_img = $folder_alt = $topic_type = $folder = $folder_new = ''; + switch ($fetch_news[$i]['topic_type']) { case POST_STICKY: @@ -325,7 +326,7 @@ class news extends module_base if ($this->config['board3_number_of_news_' . $module_id] <> 0 && $this->config['board3_news_archive_' . $module_id]) { $this->template->assign_vars(array( - 'NP_PAGINATION' => $pagination, + 'NP_PAGINATION' => (!empty($pagination)) ? $pagination : '', 'TOTAL_NEWS' => ($total_news == 1) ? sprintf($this->user->lang['VIEW_FORUM_TOPICS'][1], $total_news) : sprintf($this->user->lang['VIEW_FORUM_TOPICS'][2], $total_news), 'NP_PAGE_NUMBER' => $this->pagination->on_page($total_news, $this->config['board3_number_of_news_' . $module_id], $start)) ); diff --git a/modules/poll.php b/modules/poll.php index 1a6419a6..51495967 100644 --- a/modules/poll.php +++ b/modules/poll.php @@ -209,7 +209,7 @@ class poll extends module_base // Cookie based guest tracking ... I don't like this but hum ho // it's oft requested. This relies on "nice" users who don't feel // the need to delete cookies to mess with results. - if ($request->is_set($this->config['cookie_name'] . '_poll_' . $up_topic_id, \phpbb\request\request_interface::COOKIE)) + if ($this->request->is_set($this->config['cookie_name'] . '_poll_' . $up_topic_id, \phpbb\request\request_interface::COOKIE)) { $cur_voted_id = explode(',', $this->request->variable($this->config['cookie_name'] . '_poll_' . $up_topic_id, '', true, \phpbb\request\request_interface::COOKIE)); $cur_voted_id = array_map('intval', $cur_voted_id); @@ -317,12 +317,9 @@ class poll extends module_base } } - $where = ''; $poll_forums = false; // Get readable forums - $forum_list = array(); - $forum_list = array_unique(array_keys($this->auth->acl_getf('f_read', true))); if($this->config['board3_poll_topic_id_' . $module_id] !== '') diff --git a/modules/random_member.php b/modules/random_member.php index 6afe69eb..563c3be5 100644 --- a/modules/random_member.php +++ b/modules/random_member.php @@ -108,7 +108,7 @@ class random_member extends module_base $avatar_img = phpbb_get_avatar(\phpbb\avatar\manager::clean_row($row, 'user'), 'USER_AVATAR'); - $rank_title = $rank_img = ''; + $rank_title = $rank_img = $rank_img_src = ''; get_user_rank($row['user_rank'], $row['user_posts'], $rank_title, $rank_img, $rank_img_src); $username = $row['username']; diff --git a/modules/user_menu.php b/modules/user_menu.php index 9dc91cda..b29c0161 100644 --- a/modules/user_menu.php +++ b/modules/user_menu.php @@ -113,7 +113,6 @@ class user_menu extends module_base if ($this->auth->acl_get('m_approve')) { - $m_approve_fid_ary = array(-1); $m_approve_fid_sql = ''; } else if ($this->auth->acl_getf_global('m_approve')) @@ -123,7 +122,6 @@ class user_menu extends module_base } else { - $m_approve_fid_ary = array(); $m_approve_fid_sql = ' AND p.post_visibility = 1'; } @@ -141,7 +139,6 @@ class user_menu extends module_base $sql_where = 'AND t.topic_moved_id = 0 ' . str_replace(array('p.', 'post_'), array('t.', 'topic_'), $m_approve_fid_sql) . ' ' . ((sizeof($ex_fid_ary)) ? 'AND ' . $this->db->sql_in_set('t.forum_id', $ex_fid_ary, true) : ''); - $unread_list = array(); $unread_list = get_unread_topics($this->user->data['user_id'], $sql_where, 'ORDER BY t.topic_id DESC'); $unread_posts_count = sizeof($unread_list); @@ -150,7 +147,7 @@ class user_menu extends module_base $username = $this->user->data['username']; $colour = $this->user->data['user_colour']; $avatar_img = phpbb_get_avatar(\phpbb\avatar\manager::clean_row($this->user->data, 'user'), 'USER_AVATAR'); - $rank_title = $rank_img = ''; + $rank_title = $rank_img = $rank_img_src = ''; \get_user_rank($this->user->data['user_rank'], $this->user->data['user_posts'], $rank_title, $rank_img, $rank_img_src); // Assign specific vars diff --git a/modules/welcome.php b/modules/welcome.php index 08478cd6..d06b12df 100644 --- a/modules/welcome.php +++ b/modules/welcome.php @@ -184,7 +184,6 @@ class welcome extends module_base $welcome_message = $this->request->variable('welcome_message', '', true); $uid = $bitfield = $flags = ''; - $options = 7; generate_text_for_storage($welcome_message, $uid, $bitfield, $flags, true, true, true); // first check for obvious errors, we don't want to waste server resources From 29ebc6230b247e9ef3bb716f3030fd9c6c8b6f46 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Fri, 31 Oct 2014 07:55:29 +0100 Subject: [PATCH 9/9] [ticket/382] Check if pagination is not empty B3P-382 --- modules/announcements.php | 2 +- modules/news.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/announcements.php b/modules/announcements.php index 0a44a1bc..5bf1049c 100644 --- a/modules/announcements.php +++ b/modules/announcements.php @@ -409,7 +409,7 @@ class announcements extends module_base if ($this->config['board3_number_of_announcements_' . $module_id] <> 0 && $this->config['board3_announcements_archive_' . $module_id]) { $this->template->assign_vars(array( - 'AP_PAGINATION' => $pagination, + 'AP_PAGINATION' => (!empty($pagination)) ? $pagination : '', 'TOTAL_ANNOUNCEMENTS' => ($total_announcements == 1) ? $this->user->lang['VIEW_LATEST_ANNOUNCEMENT'] : sprintf($this->user->lang['VIEW_LATEST_ANNOUNCEMENTS'], $total_announcements), 'AP_PAGE_NUMBER' => $this->pagination->on_page($total_announcements, $this->config['board3_number_of_announcements_' . $module_id], $start)) ); diff --git a/modules/news.php b/modules/news.php index 72668d93..daa54a29 100644 --- a/modules/news.php +++ b/modules/news.php @@ -390,7 +390,7 @@ class news extends module_base if ($this->config['board3_number_of_news_' . $module_id] <> 0 && $this->config['board3_news_archive_' . $module_id]) { $this->template->assign_vars(array( - 'NP_PAGINATION' => $pagination, + 'NP_PAGINATION' => (!empty($pagination)) ? $pagination : '', 'TOTAL_NEWS' => ($total_news == 1) ? $this->user->lang['VIEW_FORUM_TOPIC'] : $this->user->lang('VIEW_FORUM_TOPICS', $total_news), 'NP_PAGE_NUMBER' => $this->pagination->on_page($total_news, $this->config['board3_number_of_news_' . $module_id], $start)) );