From ff8f71fc6088929b2615562172e00a7b0eb60469 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Tue, 19 Apr 2011 13:02:34 +0200 Subject: [PATCH 1/2] Modified class files for PHP5 --- root/adm/mods/board3_portal_check_version.php | 2 +- root/includes/acp/acp_portal.php | 6 +-- root/includes/acp/info/acp_portal.php | 2 +- root/portal/modules/portal_announcements.php | 20 ++++---- root/portal/modules/portal_attachments.php | 26 +++++------ root/portal/modules/portal_birthday_list.php | 16 +++---- root/portal/modules/portal_calendar.php | 46 +++++++++---------- root/portal/modules/portal_clock.php | 16 +++---- root/portal/modules/portal_custom.php | 24 +++++----- root/portal/modules/portal_default.php | 20 ++++---- root/portal/modules/portal_donation.php | 18 ++++---- root/portal/modules/portal_forumlist.php | 18 ++++---- root/portal/modules/portal_friends.php | 16 +++---- root/portal/modules/portal_latest_bots.php | 16 +++---- root/portal/modules/portal_latest_members.php | 16 +++---- root/portal/modules/portal_leaders.php | 16 +++---- root/portal/modules/portal_link_us.php | 16 +++---- root/portal/modules/portal_links.php | 24 +++++----- root/portal/modules/portal_main_menu.php | 24 +++++----- root/portal/modules/portal_news.php | 20 ++++---- root/portal/modules/portal_poll.php | 24 +++++----- root/portal/modules/portal_random_member.php | 18 ++++---- root/portal/modules/portal_recent.php | 22 ++++----- root/portal/modules/portal_search.php | 18 ++++---- root/portal/modules/portal_statistics.php | 20 ++++---- root/portal/modules/portal_stylechanger.php | 16 +++---- root/portal/modules/portal_topposters.php | 18 ++++---- root/portal/modules/portal_user_menu.php | 16 +++---- root/portal/modules/portal_welcome.php | 22 ++++----- root/portal/modules/portal_whois_online.php | 18 ++++---- 30 files changed, 277 insertions(+), 277 deletions(-) diff --git a/root/adm/mods/board3_portal_check_version.php b/root/adm/mods/board3_portal_check_version.php index fbc74f9e..68eca8ea 100644 --- a/root/adm/mods/board3_portal_check_version.php +++ b/root/adm/mods/board3_portal_check_version.php @@ -18,7 +18,7 @@ if (!defined('IN_PHPBB')) class board3_portal_check_version { - function version() + public function version() { global $config, $phpbb_root_path, $phpEx; diff --git a/root/includes/acp/acp_portal.php b/root/includes/acp/acp_portal.php index b4729682..b6cbf96a 100644 --- a/root/includes/acp/acp_portal.php +++ b/root/includes/acp/acp_portal.php @@ -17,10 +17,10 @@ if (!defined('IN_PHPBB')) class acp_portal { - var $u_action; - var $new_config = array(); + public $u_action; + public $new_config = array(); - function main($id, $mode) + public function main($id, $mode) { global $db, $user, $cache, $template, $display_vars; global $config, $phpbb_root_path, $portal_root_path, $phpbb_admin_path, $phpEx; diff --git a/root/includes/acp/info/acp_portal.php b/root/includes/acp/info/acp_portal.php index c0cbfe7c..304b7d03 100644 --- a/root/includes/acp/info/acp_portal.php +++ b/root/includes/acp/info/acp_portal.php @@ -17,7 +17,7 @@ if (!defined('IN_PHPBB')) */ class acp_portal_info { - function module() + public function module() { return array( 'filename' => 'acp_portal', diff --git a/root/portal/modules/portal_announcements.php b/root/portal/modules/portal_announcements.php index 9845c807..7f842f16 100644 --- a/root/portal/modules/portal_announcements.php +++ b/root/portal/modules/portal_announcements.php @@ -28,26 +28,26 @@ class portal_announcements_module * right 8 * bottom 16 */ - var $columns = 21; + public $columns = 21; /** * Default modulename */ - var $name = 'GLOBAL_ANNOUNCEMENTS'; + public $name = 'GLOBAL_ANNOUNCEMENTS'; /** * Default module-image: * file must be in "{T_THEME_PATH}/images/portal/" */ - var $image_src = ''; + public $image_src = ''; /** * module-language file * file must be in "language/{$user->lang}/mods/portal/" */ - var $language = 'portal_announcements_module'; + public $language = 'portal_announcements_module'; - function get_template_center($module_id) + public function get_template_center($module_id) { global $config, $template, $db, $user, $auth, $cache, $phpEx, $phpbb_root_path; @@ -367,7 +367,7 @@ class portal_announcements_module } } - function get_template_acp($module_id) + public function get_template_acp($module_id) { return array( 'title' => 'ACP_PORTAL_ANNOUNCE_SETTINGS', @@ -389,7 +389,7 @@ class portal_announcements_module /** * API functions */ - function install($module_id) + public function install($module_id) { set_config('board3_announcements_style_' . $module_id, 0); set_config('board3_number_of_announcements_' . $module_id, 1); @@ -404,7 +404,7 @@ class portal_announcements_module return true; } - function uninstall($module_id) + public function uninstall($module_id) { global $db; @@ -425,7 +425,7 @@ class portal_announcements_module } // Create forum select box - function select_forums($value, $key, $module_id) + public function select_forums($value, $key, $module_id) { global $user, $config; @@ -449,7 +449,7 @@ class portal_announcements_module } // Store selected forums - function store_selected_forums($key, $module_id) + public function store_selected_forums($key, $module_id) { global $db, $cache; diff --git a/root/portal/modules/portal_attachments.php b/root/portal/modules/portal_attachments.php index 5b39e74f..e08a878d 100644 --- a/root/portal/modules/portal_attachments.php +++ b/root/portal/modules/portal_attachments.php @@ -28,26 +28,26 @@ class portal_attachments_module * right 8 * bottom 16 */ - var $columns = 31; + public $columns = 31; /** * Default modulename */ - var $name = 'PORTAL_ATTACHMENTS'; + public $name = 'PORTAL_ATTACHMENTS'; /** * Default module-image: * file must be in "{T_THEME_PATH}/images/portal/" */ - var $image_src = 'portal_attach.png'; + public $image_src = 'portal_attach.png'; /** * module-language file * file must be in "language/{$user->lang}/mods/portal/" */ - var $language = 'portal_attachments_module'; + public $language = 'portal_attachments_module'; - function get_template_center($module_id) + public function get_template_center($module_id) { global $config, $template, $db, $user, $auth, $phpEx, $phpbb_root_path; @@ -148,7 +148,7 @@ class portal_attachments_module return 'attachments_center.html'; } - function get_template_side($module_id) + public function get_template_side($module_id) { global $config, $template, $db, $user, $auth, $phpEx, $phpbb_root_path; @@ -249,7 +249,7 @@ class portal_attachments_module return 'attachments_side.html'; } - function get_template_acp($module_id) + public function get_template_acp($module_id) { return array( 'title' => 'ACP_PORTAL_ATTACHMENTS_NUMBER_SETTINGS', @@ -268,7 +268,7 @@ class portal_attachments_module /** * API functions */ - function install($module_id) + public function install($module_id) { set_config('board3_attachments_number_' . $module_id, 8); set_config('board3_attach_max_length_' . $module_id, 15); @@ -279,7 +279,7 @@ class portal_attachments_module return true; } - function uninstall($module_id) + public function uninstall($module_id) { global $db; @@ -297,7 +297,7 @@ class portal_attachments_module } // Create select box for attachment filetype - function select_filetype($value, $key, $module_id) + public function select_filetype($value, $key, $module_id) { global $db, $user, $config; @@ -330,7 +330,7 @@ class portal_attachments_module } // Store selected filetypes - function store_filetypes($key, $module_id) + public function store_filetypes($key, $module_id) { global $db, $cache; @@ -344,7 +344,7 @@ class portal_attachments_module } // Create forum select box - function select_forums($value, $key) + public function select_forums($value, $key) { global $user, $config; @@ -368,7 +368,7 @@ class portal_attachments_module } // Store selected forums - function store_selected_forums($key) + public function store_selected_forums($key) { global $db, $cache; diff --git a/root/portal/modules/portal_birthday_list.php b/root/portal/modules/portal_birthday_list.php index 8a2a9a62..9a2e5a45 100644 --- a/root/portal/modules/portal_birthday_list.php +++ b/root/portal/modules/portal_birthday_list.php @@ -28,26 +28,26 @@ class portal_birthday_list_module * right 8 * bottom 16 */ - var $columns = 10; + public $columns = 10; /** * Default modulename */ - var $name = 'BIRTHDAYS'; + public $name = 'BIRTHDAYS'; /** * Default module-image: * file must be in "{T_THEME_PATH}/images/portal/" */ - var $image_src = 'portal_birthday.png'; + public $image_src = 'portal_birthday.png'; /** * module-language file * file must be in "language/{$user->lang}/mods/portal/" */ - var $language = 'portal_birthday_list_module'; + public $language = 'portal_birthday_list_module'; - function get_template_side($module_id) + public function get_template_side($module_id) { global $config, $template, $db, $user, $phpbb_root_path; @@ -124,7 +124,7 @@ class portal_birthday_list_module return 'birthdays_side.html'; } - function get_template_acp($module_id) + public function get_template_acp($module_id) { return array( 'title' => 'ACP_PORTAL_BIRTHDAYS_SETTINGS', @@ -138,13 +138,13 @@ class portal_birthday_list_module /** * API functions */ - function install($module_id) + public function install($module_id) { set_config('board3_birthdays_ahead_' . $module_id, 30); return true; } - function uninstall($module_id) + public function uninstall($module_id) { global $db; diff --git a/root/portal/modules/portal_calendar.php b/root/portal/modules/portal_calendar.php index d0b0487f..bb40bbdb 100644 --- a/root/portal/modules/portal_calendar.php +++ b/root/portal/modules/portal_calendar.php @@ -28,37 +28,37 @@ class portal_calendar_module * right 8 * bottom 16 */ - var $columns = 10; + public $columns = 10; /** * Default modulename */ - var $name = 'PORTAL_CALENDAR'; + public $name = 'PORTAL_CALENDAR'; /** * Default module-image: * file must be in "{T_THEME_PATH}/images/portal/" */ - var $image_src = 'portal_calendar.png'; + public $image_src = 'portal_calendar.png'; /** * module-language file * file must be in "language/{$user->lang}/mods/portal/" */ - var $language = 'portal_calendar_module'; + public $language = 'portal_calendar_module'; /** * custom acp template * file must be in "adm/style/portal/" */ - var $custom_acp_tpl = 'acp_portal_calendar'; + public $custom_acp_tpl = 'acp_portal_calendar'; /** * additional variables */ - var $mini_cal_fdow; + private $mini_cal_fdow; - function get_template_side($module_id) + public function get_template_side($module_id) { global $config, $template, $user, $phpbb_root_path, $phpEx; @@ -210,7 +210,7 @@ class portal_calendar_module return 'calendar_side.html'; } - function get_template_acp($module_id) + public function get_template_acp($module_id) { return array( 'title' => 'ACP_PORTAL_CALENDAR', @@ -229,7 +229,7 @@ class portal_calendar_module /** * API functions */ - function install($module_id) + public function install($module_id) { set_config('board3_sunday_first_' . $module_id, 1); set_config('board3_calendar_today_color_' . $module_id, '#000000'); @@ -242,7 +242,7 @@ class portal_calendar_module return true; } - function uninstall($module_id) + public function uninstall($module_id) { global $db; @@ -267,7 +267,7 @@ class portal_calendar_module return $db->sql_query($sql); } - function manage_events($value, $key, $module_id) + public function manage_events($value, $key, $module_id) { global $db, $portal_config, $config, $template, $user, $phpEx, $phpbb_admin_path; @@ -517,23 +517,23 @@ class portal_calendar_module } - function update_events($key, $module_id) + public function update_events($key, $module_id) { $this->manage_events('', $key, $module_id); } - var $dateYYY; // year in numeric format (YYYY) - var $dateMM; // month in numeric format (MM) - var $dateDD; // day in numeric format (DD) - var $ext_dateMM; // extended month (e.g. February) - var $daysMonth; // count of days in month - var $stamp; // timestamp - var $day; // return array s.a. + private $dateYYY; // year in numeric format (YYYY) + private $dateMM; // month in numeric format (MM) + private $dateDD; // day in numeric format (DD) + private $ext_dateMM; // extended month (e.g. February) + private $daysMonth; // count of days in month + private $stamp; // timestamp + private $day; // return array s.a. /** * convert date->timestamp **/ - function makeTimestamp($date) + private function makeTimestamp($date) { $this->stamp = strtotime($date); return ($this->stamp); @@ -542,7 +542,7 @@ class portal_calendar_module /** * get date listed in array **/ - function getMonth($callDate) + private function getMonth($callDate) { $this->makeTimestamp($callDate); @@ -565,7 +565,7 @@ class portal_calendar_module } // Unserialize links array - function utf_unserialize($serial_str) + private function utf_unserialize($serial_str) { $out = preg_replace('!s:(\d+):"(.*?)";!se', "'s:'.strlen('$2').':\"$2\";'", $serial_str ); return unserialize($out); @@ -574,7 +574,7 @@ class portal_calendar_module /** * validate URLs and execute apppend_sid if necessary */ - function validate_url($url) + private function validate_url($url) { global $config; diff --git a/root/portal/modules/portal_clock.php b/root/portal/modules/portal_clock.php index 6b336220..9c8438b8 100644 --- a/root/portal/modules/portal_clock.php +++ b/root/portal/modules/portal_clock.php @@ -28,26 +28,26 @@ class portal_clock_module * right 8 * bottom 16 */ - var $columns = 10; + public $columns = 10; /** * Default modulename */ - var $name = 'CLOCK'; + public $name = 'CLOCK'; /** * Default module-image: * file must be in "{T_THEME_PATH}/images/portal/" */ - var $image_src = 'portal_clock.png'; + public $image_src = 'portal_clock.png'; /** * module-language file * file must be in "language/{$user->lang}/mods/portal/" */ - var $language = 'portal_clock_module'; + public $language = 'portal_clock_module'; - function get_template_side($module_id) + public function get_template_side($module_id) { global $config, $template; @@ -58,7 +58,7 @@ class portal_clock_module return 'clock_side.html'; } - function get_template_acp($module_id) + public function get_template_acp($module_id) { return array( 'title' => 'ACP_PORTAL_CLOCK_SETTINGS', @@ -72,13 +72,13 @@ class portal_clock_module /** * API functions */ - function install($module_id) + public function install($module_id) { set_config('board3_clock_src_' . $module_id, 'board3clock.swf'); return true; } - function uninstall($module_id) + public function uninstall($module_id) { global $db; diff --git a/root/portal/modules/portal_custom.php b/root/portal/modules/portal_custom.php index 946dc51a..7df0054c 100644 --- a/root/portal/modules/portal_custom.php +++ b/root/portal/modules/portal_custom.php @@ -28,32 +28,32 @@ class portal_custom_module * right 8 * bottom 16 */ - var $columns = 31; + public $columns = 31; /** * Default modulename */ - var $name = 'PORTAL_CUSTOM'; + public $name = 'PORTAL_CUSTOM'; /** * Default module-image: * file must be in "{T_THEME_PATH}/images/portal/" */ - var $image_src = 'portal_custom.png'; + public $image_src = 'portal_custom.png'; /** * module-language file * file must be in "language/{$user->lang}/mods/portal/" */ - var $language = 'portal_custom_module'; + public $language = 'portal_custom_module'; /** * custom acp template * file must be in "adm/style/portal/" */ - var $custom_acp_tpl = 'acp_portal_custom'; + public $custom_acp_tpl = 'acp_portal_custom'; - function get_template_center($module_id) + public function get_template_center($module_id) { global $config, $template, $portal_config, $user; @@ -88,7 +88,7 @@ class portal_custom_module } } - function get_template_side($module_id) + public function get_template_side($module_id) { global $config, $template, $portal_config, $user; @@ -123,7 +123,7 @@ class portal_custom_module } } - function get_template_acp($module_id) + public function get_template_acp($module_id) { return array( 'title' => 'PORTAL_CUSTOM', @@ -137,7 +137,7 @@ class portal_custom_module /** * API functions */ - function install($module_id) + public function install($module_id) { set_portal_config('board3_custom_' . $module_id . '_code', ''); set_config('board3_custom_' . $module_id . '_code', ''); @@ -150,7 +150,7 @@ class portal_custom_module return true; } - function uninstall($module_id) + public function uninstall($module_id) { global $db; @@ -175,7 +175,7 @@ class portal_custom_module return ((!$check) ? $check : $db->sql_query($sql)); // if something went wrong, make sure we are aware of the first query } - function manage_custom($value, $key, $module_id) + public function manage_custom($value, $key, $module_id) { global $db, $portal_config, $config, $template, $user, $phpEx, $phpbb_admin_path, $phpbb_root_path; @@ -348,7 +348,7 @@ class portal_custom_module } } - function update_custom($key, $module_id) + public function update_custom($key, $module_id) { $this->manage_custom('', $key, $module_id); } diff --git a/root/portal/modules/portal_default.php b/root/portal/modules/portal_default.php index 0192a6ba..a879bcea 100644 --- a/root/portal/modules/portal_default.php +++ b/root/portal/modules/portal_default.php @@ -28,32 +28,32 @@ class portal_modulename_module * right 8 * bottom 16 */ - var $columns = 0; + public $columns = 0; /** * Default modulename */ - var $name = 'MODULENAME'; + public $name = 'MODULENAME'; /** * Default module-image: * file must be in "{T_THEME_PATH}/images/portal/" */ - var $image_src = 'modulename.png'; + public $image_src = 'modulename.png'; /** * module-language file * file must be in "language/{$user->lang}/mods/portal/" */ - var $language = ''; + public $language = ''; /** * custom acp template * file must be in "adm/style/portal/" */ - var $custom_acp_tpl = ''; + public $custom_acp_tpl = ''; - function get_template_center($module_id) + public function get_template_center($module_id) { global $config, $template; @@ -64,7 +64,7 @@ class portal_modulename_module return 'modulename_center.html'; } - function get_template_side($module_id) + public function get_template_side($module_id) { global $config, $template; @@ -75,7 +75,7 @@ class portal_modulename_module return 'modulename_side.html'; } - function get_template_acp($module_id) + public function get_template_acp($module_id) { return array( 'title' => 'ACP_CONFIG_MODULENAME', @@ -90,14 +90,14 @@ class portal_modulename_module /** * API functions */ - function install($module_id) + public function install($module_id) { set_config('board3_configname_' . $module_id, 'Hello World!'); set_config('board3_configname2_' . $module_id, 1337); return true; } - function uninstall($module_id) + public function uninstall($module_id) { global $db; diff --git a/root/portal/modules/portal_donation.php b/root/portal/modules/portal_donation.php index 39e0607a..4e7dec15 100644 --- a/root/portal/modules/portal_donation.php +++ b/root/portal/modules/portal_donation.php @@ -28,26 +28,26 @@ class portal_donation_module * right 8 * bottom 16 */ - var $columns = 31; + public $columns = 31; /** * Default modulename */ - var $name = 'DONATION'; + public $name = 'DONATION'; /** * Default module-image: * file must be in "{T_THEME_PATH}/images/portal/" */ - var $image_src = 'portal_donation.png'; + public $image_src = 'portal_donation.png'; /** * module-language file * file must be in "language/{$user->lang}/mods/portal/" */ - var $language = 'portal_donation_module'; + public $language = 'portal_donation_module'; - function get_template_center($module_id) + public function get_template_center($module_id) { global $config, $template; @@ -56,7 +56,7 @@ class portal_donation_module return 'donation_center.html'; } - function get_template_side($module_id) + public function get_template_side($module_id) { global $config, $template; @@ -65,7 +65,7 @@ class portal_donation_module return 'donation_side.html'; } - function get_template_acp($module_id) + public function get_template_acp($module_id) { return array( 'title' => 'ACP_PORTAL_PAYPAL_SETTINGS', @@ -79,13 +79,13 @@ class portal_donation_module /** * API functions */ - function install($module_id) + public function install($module_id) { set_config('board3_pay_acc_' . $module_id, 'your@paypal.com'); return true; } - function uninstall($module_id) + public function uninstall($module_id) { global $db; diff --git a/root/portal/modules/portal_forumlist.php b/root/portal/modules/portal_forumlist.php index cbe8ce3f..3a4ae332 100644 --- a/root/portal/modules/portal_forumlist.php +++ b/root/portal/modules/portal_forumlist.php @@ -28,32 +28,32 @@ class portal_forumlist_module * right 8 * bottom 16 */ - var $columns = 21; + public $columns = 21; /** * Default modulename */ - var $name = 'PORTAL_FORUMLIST'; + public $name = 'PORTAL_FORUMLIST'; /** * Default module-image: * file must be in "{T_THEME_PATH}/images/portal/" */ - var $image_src = ''; + public $image_src = ''; /** * module-language file * file must be in "language/{$user->lang}/mods/portal/" */ - var $language = 'portal_forumlist_module'; + public $language = 'portal_forumlist_module'; /** * custom acp template * file must be in "adm/style/portal/" */ - var $custom_acp_tpl = ''; + public $custom_acp_tpl = ''; - function get_template_center($module_id) + public function get_template_center($module_id) { global $config, $template, $user, $auth, $phpbb_root_path, $phpEx; @@ -72,7 +72,7 @@ class portal_forumlist_module return 'forumlist.html'; } - function get_template_acp($module_id) + public function get_template_acp($module_id) { return array( 'title' => 'PORTAL_FORUMLIST', @@ -83,12 +83,12 @@ class portal_forumlist_module /** * API functions */ - function install($module_id) + public function install($module_id) { return true; } - function uninstall($module_id) + public function uninstall($module_id) { return true; } diff --git a/root/portal/modules/portal_friends.php b/root/portal/modules/portal_friends.php index c031bf5d..1dff111d 100644 --- a/root/portal/modules/portal_friends.php +++ b/root/portal/modules/portal_friends.php @@ -28,26 +28,26 @@ class portal_friends_module * right 8 * bottom 16 */ - var $columns = 10; + public $columns = 10; /** * Default modulename */ - var $name = 'FRIENDS'; + public $name = 'FRIENDS'; /** * Default module-image: * file must be in "{T_THEME_PATH}/images/portal/" */ - var $image_src = 'portal_friends.png'; + public $image_src = 'portal_friends.png'; /** * module-language file * file must be in "language/{$user->lang}/mods/portal/" */ - var $language = 'portal_friends_module'; + public $language = 'portal_friends_module'; - function get_template_side($module_id) + public function get_template_side($module_id) { global $config, $template, $db, $user; @@ -103,7 +103,7 @@ class portal_friends_module return 'friends_side.html'; } - function get_template_acp($module_id) + public function get_template_acp($module_id) { return array( 'title' => 'ACP_PORTAL_FRIENDS_SETTINGS', @@ -117,13 +117,13 @@ class portal_friends_module /** * API functions */ - function install($module_id) + public function install($module_id) { set_config('board3_max_online_friends_' . $module_id, 8); return true; } - function uninstall($module_id) + public function uninstall($module_id) { global $db; diff --git a/root/portal/modules/portal_latest_bots.php b/root/portal/modules/portal_latest_bots.php index 5b612f52..dd405cf8 100755 --- a/root/portal/modules/portal_latest_bots.php +++ b/root/portal/modules/portal_latest_bots.php @@ -28,26 +28,26 @@ class portal_latest_bots_module * right 8 * bottom 16 */ - var $columns = 10; + public $columns = 10; /** * Default modulename */ - var $name = 'LATEST_BOTS'; + public $name = 'LATEST_BOTS'; /** * Default module-image: * file must be in "{T_THEME_PATH}/images/portal/" */ - var $image_src = 'portal_bots.png'; + public $image_src = 'portal_bots.png'; /** * module-language file * file must be in "language/{$user->lang}/mods/portal/" */ - var $language = 'portal_latest_bots_module'; + public $language = 'portal_latest_bots_module'; - function get_template_side($module_id) + public function get_template_side($module_id) { global $config, $template, $db, $user; @@ -93,7 +93,7 @@ class portal_latest_bots_module } } - function get_template_acp($module_id) + public function get_template_acp($module_id) { return array( 'title' => 'ACP_PORTAL_BOTS_SETTINGS', @@ -107,13 +107,13 @@ class portal_latest_bots_module /** * API functions */ - function install($module_id) + public function install($module_id) { set_config('board3_last_visited_bots_number_' . $module_id, 1); return true; } - function uninstall($module_id) + public function uninstall($module_id) { global $db; diff --git a/root/portal/modules/portal_latest_members.php b/root/portal/modules/portal_latest_members.php index 450bf6b2..501a8970 100644 --- a/root/portal/modules/portal_latest_members.php +++ b/root/portal/modules/portal_latest_members.php @@ -28,26 +28,26 @@ class portal_latest_members_module * right 8 * bottom 16 */ - var $columns = 10; + public $columns = 10; /** * Default modulename */ - var $name = 'LATEST_MEMBERS'; + public $name = 'LATEST_MEMBERS'; /** * Default module-image: * file must be in "{T_THEME_PATH}/images/portal/" */ - var $image_src = 'portal_members.png'; + public $image_src = 'portal_members.png'; /** * module-language file * file must be in "language/{$user->lang}/mods/portal/" */ - var $language = 'portal_latest_members_module'; + public $language = 'portal_latest_members_module'; - function get_template_side($module_id) + public function get_template_side($module_id) { global $config, $template, $db, $user; @@ -70,7 +70,7 @@ class portal_latest_members_module return 'latest_members_side.html'; } - function get_template_acp($module_id) + public function get_template_acp($module_id) { return array( 'title' => 'ACP_PORTAL_MEMBERS_SETTINGS', @@ -84,13 +84,13 @@ class portal_latest_members_module /** * API functions */ - function install($module_id) + public function install($module_id) { set_config('board3_max_last_member_' . $module_id, 8); return true; } - function uninstall($module_id) + public function uninstall($module_id) { global $db; diff --git a/root/portal/modules/portal_leaders.php b/root/portal/modules/portal_leaders.php index f428aa06..45bec958 100644 --- a/root/portal/modules/portal_leaders.php +++ b/root/portal/modules/portal_leaders.php @@ -28,26 +28,26 @@ class portal_leaders_module * right 8 * bottom 16 */ - var $columns = 10; + public $columns = 10; /** * Default modulename */ - var $name = 'THE_TEAM'; + public $name = 'THE_TEAM'; /** * Default module-image: * file must be in "{T_THEME_PATH}/images/portal/" */ - var $image_src = 'portal_team.png'; + public $image_src = 'portal_team.png'; /** * module-language file * file must be in "language/{$user->lang}/mods/portal/" */ - var $language = 'portal_leaders_module'; + public $language = 'portal_leaders_module'; - function get_template_side($module_id) + public function get_template_side($module_id) { global $config, $template, $user, $auth, $db, $phpEx, $phpbb_root_path; @@ -204,7 +204,7 @@ class portal_leaders_module } } - function get_template_acp($module_id) + public function get_template_acp($module_id) { return array( 'title' => 'ACP_PORTAL_LEADERS', @@ -218,14 +218,14 @@ class portal_leaders_module /** * API functions */ - function install($module_id) + public function install($module_id) { // Show normal team block by default set_config('board3_leaders_ext_' . $module_id, 0); return true; } - function uninstall($module_id) + public function uninstall($module_id) { global $db; diff --git a/root/portal/modules/portal_link_us.php b/root/portal/modules/portal_link_us.php index 2229e1fb..2f16e488 100644 --- a/root/portal/modules/portal_link_us.php +++ b/root/portal/modules/portal_link_us.php @@ -28,26 +28,26 @@ class portal_link_us_module * right 8 * bottom 16 */ - var $columns = 10; + public $columns = 10; /** * Default modulename */ - var $name = 'LINK_US'; + public $name = 'LINK_US'; /** * Default module-image: * file must be in "{T_THEME_PATH}/images/portal/" */ - var $image_src = 'portal_link_us.png'; + public $image_src = 'portal_link_us.png'; /** * module-language file * file must be in "language/{$user->lang}/mods/portal/" */ - var $language = 'portal_link_us_module'; + public $language = 'portal_link_us_module'; - function get_template_side($module_id) + public function get_template_side($module_id) { global $config, $template, $user; @@ -63,7 +63,7 @@ class portal_link_us_module return 'link_us_side.html'; } - function get_template_acp($module_id) + public function get_template_acp($module_id) { return array( 'title' => 'LINK_US', @@ -74,12 +74,12 @@ class portal_link_us_module /** * API functions */ - function install($module_id) + public function install($module_id) { return true; } - function uninstall($module_id) + public function uninstall($module_id) { return true; } diff --git a/root/portal/modules/portal_links.php b/root/portal/modules/portal_links.php index cb790588..171581a6 100644 --- a/root/portal/modules/portal_links.php +++ b/root/portal/modules/portal_links.php @@ -28,30 +28,30 @@ class portal_links_module * right 8 * bottom 16 */ - var $columns = 10; + public $columns = 10; /** * Default modulename */ - var $name = 'PORTAL_LINKS'; + public $name = 'PORTAL_LINKS'; /** * Default module-image: * file must be in "{T_THEME_PATH}/images/portal/" */ - var $image_src = 'portal_links.png'; + public $image_src = 'portal_links.png'; /** * module-language file * file must be in "language/{$user->lang}/mods/portal/" */ - var $language = 'portal_links_module'; + public $language = 'portal_links_module'; /** * custom acp template * file must be in "adm/style/portal/" */ - var $custom_acp_tpl = 'acp_portal_links'; + public $custom_acp_tpl = 'acp_portal_links'; /** * constants @@ -59,7 +59,7 @@ class portal_links_module const LINK_INT = 1; const LINK_EXT = 2; - function get_template_side($module_id) + public function get_template_side($module_id) { global $config, $template, $phpEx, $phpbb_root_path, $user, $db; @@ -109,7 +109,7 @@ class portal_links_module return 'links_side.html'; } - function get_template_acp($module_id) + public function get_template_acp($module_id) { // do not remove this as it is needed in order to run manage_links return array( @@ -124,7 +124,7 @@ class portal_links_module /** * API functions */ - function install($module_id) + public function install($module_id) { global $phpbb_root_path, $db; @@ -167,7 +167,7 @@ class portal_links_module return true; } - function uninstall($module_id) + public function uninstall($module_id) { global $db; @@ -188,7 +188,7 @@ class portal_links_module } // Manage the menu links - function manage_links($value, $key, $module_id) + public function manage_links($value, $key, $module_id) { global $config, $phpbb_admin_path, $user, $phpEx, $db, $template; @@ -405,13 +405,13 @@ class portal_links_module } } - function update_links($key, $module_id) + public function update_links($key, $module_id) { $this->manage_links('', $key, $module_id); } // Unserialize links array - function utf_unserialize($serial_str) + private function utf_unserialize($serial_str) { $out = preg_replace('!s:(\d+):"(.*?)";!se', "'s:'.strlen('$2').':\"$2\";'", $serial_str ); return unserialize($out); diff --git a/root/portal/modules/portal_main_menu.php b/root/portal/modules/portal_main_menu.php index 4bc6b092..378249d9 100644 --- a/root/portal/modules/portal_main_menu.php +++ b/root/portal/modules/portal_main_menu.php @@ -28,30 +28,30 @@ class portal_main_menu_module * right 8 * bottom 16 */ - var $columns = 10; + public $columns = 10; /** * Default modulename */ - var $name = 'M_MENU'; + public $name = 'M_MENU'; /** * Default module-image: * file must be in "{T_THEME_PATH}/images/portal/" */ - var $image_src = 'portal_menu.png'; + public $image_src = 'portal_menu.png'; /** * module-language file * file must be in "language/{$user->lang}/mods/portal/" */ - var $language = 'portal_main_menu_module'; + public $language = 'portal_main_menu_module'; /** * custom acp template * file must be in "adm/style/portal/" */ - var $custom_acp_tpl = 'acp_portal_menu'; + public $custom_acp_tpl = 'acp_portal_menu'; /** * constants @@ -60,7 +60,7 @@ class portal_main_menu_module const LINK_INT = 1; const LINK_EXT = 2; - function get_template_side($module_id) + public function get_template_side($module_id) { global $config, $template, $phpEx, $phpbb_root_path, $user, $db; @@ -119,7 +119,7 @@ class portal_main_menu_module return 'main_menu_side.html'; } - function get_template_acp($module_id) + public function get_template_acp($module_id) { // do not remove this as it is needed in order to run manage_links return array( @@ -134,7 +134,7 @@ class portal_main_menu_module /** * API functions */ - function install($module_id) + public function install($module_id) { global $phpbb_root_path, $phpEx, $db; @@ -223,7 +223,7 @@ class portal_main_menu_module return true; } - function uninstall($module_id) + public function uninstall($module_id) { global $db; @@ -244,7 +244,7 @@ class portal_main_menu_module } // Manage the menu links - function manage_links($value, $key, $module_id) + public function manage_links($value, $key, $module_id) { global $config, $phpbb_admin_path, $user, $phpEx, $db, $template; @@ -469,13 +469,13 @@ class portal_main_menu_module } } - function update_links($key, $module_id) + public function update_links($key, $module_id) { $this->manage_links('', $key, $module_id); } // Unserialize links array - function utf_unserialize($serial_str) + private function utf_unserialize($serial_str) { $out = preg_replace('!s:(\d+):"(.*?)";!se', "'s:'.strlen('$2').':\"$2\";'", $serial_str ); return unserialize($out); diff --git a/root/portal/modules/portal_news.php b/root/portal/modules/portal_news.php index aced553b..a5496ac5 100644 --- a/root/portal/modules/portal_news.php +++ b/root/portal/modules/portal_news.php @@ -28,26 +28,26 @@ class portal_news_module * right 8 * bottom 16 */ - var $columns = 21; + public $columns = 21; /** * Default modulename */ - var $name = 'LATEST_NEWS'; + public $name = 'LATEST_NEWS'; /** * Default module-image: * file must be in "{T_THEME_PATH}/images/portal/" */ - var $image_src = ''; + public $image_src = ''; /** * module-language file * file must be in "language/{$user->lang}/mods/portal/" */ - var $language = 'portal_news_module'; + public $language = 'portal_news_module'; - function get_template_center($module_id) + public function get_template_center($module_id) { global $config, $template, $db, $user, $auth, $cache, $phpEx, $phpbb_root_path; @@ -355,7 +355,7 @@ class portal_news_module } } - function get_template_acp($module_id) + public function get_template_acp($module_id) { return array( 'title' => 'ACP_PORTAL_NEWS_SETTINGS', @@ -378,7 +378,7 @@ class portal_news_module /** * API functions */ - function install($module_id) + public function install($module_id) { set_config('board3_news_length_' . $module_id, 250); set_config('board3_news_forum_' . $module_id, ''); @@ -393,7 +393,7 @@ class portal_news_module return true; } - function uninstall($module_id) + public function uninstall($module_id) { global $db; @@ -415,7 +415,7 @@ class portal_news_module } // Create forum select box - function select_forums($value, $key, $module_id) + public function select_forums($value, $key, $module_id) { global $user, $config; @@ -439,7 +439,7 @@ class portal_news_module } // Store selected forums - function store_selected_forums($key, $module_id) + public function store_selected_forums($key, $module_id) { global $db, $cache; diff --git a/root/portal/modules/portal_poll.php b/root/portal/modules/portal_poll.php index 8c8c80bf..d2f8d74f 100644 --- a/root/portal/modules/portal_poll.php +++ b/root/portal/modules/portal_poll.php @@ -28,32 +28,32 @@ class portal_poll_module * right 8 * bottom 16 */ - var $columns = 31; + public $columns = 31; /** * Default modulename */ - var $name = 'PORTAL_POLL'; + public $name = 'PORTAL_POLL'; /** * Default module-image: * file must be in "{T_THEME_PATH}/images/portal/" */ - var $image_src = 'portal_poll.png'; + public $image_src = 'portal_poll.png'; /** * module-language file * file must be in "language/{$user->lang}/mods/portal/" */ - var $language = 'portal_poll_module'; + public $language = 'portal_poll_module'; /** * custom acp template * file must be in "adm/style/portal/" */ - var $custom_acp_tpl = ''; + public $custom_acp_tpl = ''; - function get_template_center($module_id) + public function get_template_center($module_id) { global $config, $template, $db, $user, $auth, $phpbb_root_path, $phpEx; @@ -430,7 +430,7 @@ class portal_poll_module return 'poll_center.html'; } - function get_template_side($module_id) + public function get_template_side($module_id) { global $config, $template, $db, $user, $auth, $phpbb_root_path, $phpEx; @@ -807,7 +807,7 @@ class portal_poll_module return 'poll_side.html'; } - function get_template_acp($module_id) + public function get_template_acp($module_id) { return array( 'title' => 'ACP_PORTAL_POLLS_SETTINGS', @@ -825,7 +825,7 @@ class portal_poll_module /** * API functions */ - function install($module_id) + public function install($module_id) { set_config('board3_poll_allow_vote_' . $module_id, 1); set_config('board3_poll_topic_id_' . $module_id, ''); @@ -835,7 +835,7 @@ class portal_poll_module return true; } - function uninstall($module_id) + public function uninstall($module_id) { global $db; @@ -852,7 +852,7 @@ class portal_poll_module } // Create forum select box - function select_forums($value, $key, $module_id) + public function select_forums($value, $key, $module_id) { global $user, $config; @@ -876,7 +876,7 @@ class portal_poll_module } // Store selected forums - function store_selected_forums($key, $module_id) + public function store_selected_forums($key, $module_id) { global $db, $cache; diff --git a/root/portal/modules/portal_random_member.php b/root/portal/modules/portal_random_member.php index d1a52e46..0aa574b4 100644 --- a/root/portal/modules/portal_random_member.php +++ b/root/portal/modules/portal_random_member.php @@ -28,32 +28,32 @@ class portal_random_member_module * right 8 * bottom 16 */ - var $columns = 10; + public $columns = 10; /** * Default modulename */ - var $name = 'PORTAL_RANDOM_MEMBER'; + public $name = 'PORTAL_RANDOM_MEMBER'; /** * Default module-image: * file must be in "{T_THEME_PATH}/images/portal/" */ - var $image_src = 'portal_random_member.png'; + public $image_src = 'portal_random_member.png'; /** * module-language file * file must be in "language/{$user->lang}/mods/portal/" */ - var $language = 'portal_random_member_module'; + public $language = 'portal_random_member_module'; /** * custom acp template * file must be in "adm/style/portal/" */ - var $custom_acp_tpl = ''; + public $custom_acp_tpl = ''; - function get_template_side($module_id) + public function get_template_side($module_id) { global $config, $template, $db, $user; @@ -119,7 +119,7 @@ class portal_random_member_module return 'random_member_side.html'; } - function get_template_acp($module_id) + public function get_template_acp($module_id) { return array( 'title' => 'PORTAL_RANDOM_MEMBER', @@ -130,12 +130,12 @@ class portal_random_member_module /** * API functions */ - function install($module_id) + public function install($module_id) { return true; } - function uninstall($module_id) + public function uninstall($module_id) { return true; } diff --git a/root/portal/modules/portal_recent.php b/root/portal/modules/portal_recent.php index 87226127..9eb75107 100644 --- a/root/portal/modules/portal_recent.php +++ b/root/portal/modules/portal_recent.php @@ -28,32 +28,32 @@ class portal_recent_module * right 8 * bottom 16 */ - var $columns = 21; + public $columns = 21; /** * Default modulename */ - var $name = 'PORTAL_RECENT'; + public $name = 'PORTAL_RECENT'; /** * Default module-image: * file must be in "{T_THEME_PATH}/images/portal/" */ - var $image_src = ''; + public $image_src = ''; /** * module-language file * file must be in "language/{$user->lang}/mods/portal/" */ - var $language = 'portal_recent_module'; + public $language = 'portal_recent_module'; /** * custom acp template * file must be in "adm/style/portal/" */ - var $custom_acp_tpl = ''; + public $custom_acp_tpl = ''; - function get_template_center($module_id) + public function get_template_center($module_id) { global $config, $template, $db, $auth, $phpbb_root_path, $phpEx; @@ -170,7 +170,7 @@ class portal_recent_module return 'recent_center.html'; } - function get_template_acp($module_id) + public function get_template_acp($module_id) { return array( 'title' => 'ACP_PORTAL_RECENT_SETTINGS', @@ -187,7 +187,7 @@ class portal_recent_module /** * API functions */ - function install($module_id) + public function install($module_id) { set_config('board3_max_topics_' . $module_id, 10); set_config('board3_recent_title_limit_' . $module_id, 100); @@ -196,7 +196,7 @@ class portal_recent_module return true; } - function uninstall($module_id) + public function uninstall($module_id) { global $db; @@ -212,7 +212,7 @@ class portal_recent_module } // Create forum select box - function select_forums($value, $key, $module_id) + public function select_forums($value, $key, $module_id) { global $user, $config; @@ -236,7 +236,7 @@ class portal_recent_module } // Store selected forums - function store_selected_forums($key, $module_id) + public function store_selected_forums($key, $module_id) { global $db, $cache; diff --git a/root/portal/modules/portal_search.php b/root/portal/modules/portal_search.php index c0e62338..1f4b9b43 100644 --- a/root/portal/modules/portal_search.php +++ b/root/portal/modules/portal_search.php @@ -28,32 +28,32 @@ class portal_search_module * right 8 * bottom 16 */ - var $columns = 10; + public $columns = 10; /** * Default modulename */ - var $name = 'PORTAL_SEARCH'; + public $name = 'PORTAL_SEARCH'; /** * Default module-image: * file must be in "{T_THEME_PATH}/images/portal/" */ - var $image_src = 'portal_search.png'; + public $image_src = 'portal_search.png'; /** * module-language file * file must be in "language/{$user->lang}/mods/portal/" */ - var $language = 'portal_search_module'; + public $language = 'portal_search_module'; /** * custom acp template * file must be in "adm/style/portal/" */ - var $custom_acp_tpl = ''; + public $custom_acp_tpl = ''; - function get_template_side($module_id) + public function get_template_side($module_id) { global $template, $phpbb_root_path, $phpEx; @@ -62,7 +62,7 @@ class portal_search_module return 'search_side.html'; } - function get_template_acp($module_id) + public function get_template_acp($module_id) { return array( 'title' => 'PORTAL_SEARCH', @@ -73,12 +73,12 @@ class portal_search_module /** * API functions */ - function install($module_id) + public function install($module_id) { return true; } - function uninstall($module_id) + public function uninstall($module_id) { return true; } diff --git a/root/portal/modules/portal_statistics.php b/root/portal/modules/portal_statistics.php index 7a72b5e8..7a3957b5 100644 --- a/root/portal/modules/portal_statistics.php +++ b/root/portal/modules/portal_statistics.php @@ -28,32 +28,32 @@ class portal_statistics_module * right 8 * bottom 16 */ - var $columns = 10; + public $columns = 10; /** * Default modulename */ - var $name = 'STATISTICS'; + public $name = 'STATISTICS'; /** * Default module-image: * file must be in "{T_THEME_PATH}/images/portal/" */ - var $image_src = 'portal_statistics.png'; + public $image_src = 'portal_statistics.png'; /** * module-language file * file must be in "language/{$user->lang}/mods/portal/" */ - var $language = 'portal_statistics_module'; + public $language = 'portal_statistics_module'; /** * custom acp template * file must be in "adm/style/portal/" */ - var $custom_acp_tpl = ''; + public $custom_acp_tpl = ''; - function get_template_side($module_id) + public function get_template_side($module_id) { global $config, $template, $user; @@ -139,7 +139,7 @@ class portal_statistics_module return 'statistics_side.html'; } - function get_template_acp($module_id) + public function get_template_acp($module_id) { return array( 'title' => 'STATISTICS', @@ -150,18 +150,18 @@ class portal_statistics_module /** * API functions */ - function install($module_id) + public function install($module_id) { return true; } - function uninstall($module_id) + public function uninstall($module_id) { return true; } // Better function with only one query - function get_topics_count() + public function get_topics_count() { global $db, $user; diff --git a/root/portal/modules/portal_stylechanger.php b/root/portal/modules/portal_stylechanger.php index 1e6cfc1a..62434e6f 100644 --- a/root/portal/modules/portal_stylechanger.php +++ b/root/portal/modules/portal_stylechanger.php @@ -28,26 +28,26 @@ class portal_stylechanger_module * right 8 * bottom 16 */ - var $columns = 10; + public $columns = 10; /** * Default modulename */ - var $name = 'BOARD_STYLE'; + public $name = 'BOARD_STYLE'; /** * Default module-image: * file must be in "{T_THEME_PATH}/images/portal/" */ - var $image_src = 'portal_style.png'; + public $image_src = 'portal_style.png'; /** * module-language file * file must be in "language/{$user->lang}/mods/portal/" */ - var $language = 'portal_stylechanger_module'; + public $language = 'portal_stylechanger_module'; - function get_template_side($module_id) + public function get_template_side($module_id) { global $config, $template, $db, $phpEx, $phpbb_root_path, $user; @@ -88,7 +88,7 @@ class portal_stylechanger_module return 'stylechanger_side.html'; } - function get_template_acp($module_id) + public function get_template_acp($module_id) { return array( 'title' => 'BOARD_STYLE', @@ -99,12 +99,12 @@ class portal_stylechanger_module /** * API functions */ - function install($module_id) + public function install($module_id) { return true; } - function uninstall($module_id) + public function uninstall($module_id) { return true; } diff --git a/root/portal/modules/portal_topposters.php b/root/portal/modules/portal_topposters.php index b1fc9aa5..086749c2 100644 --- a/root/portal/modules/portal_topposters.php +++ b/root/portal/modules/portal_topposters.php @@ -28,31 +28,31 @@ class portal_topposters_module * right 8 * bottom 16 */ - var $columns = 10; + public $columns = 10; /** * Default modulename */ - var $name = 'TOPPOSTERS'; + public $name = 'TOPPOSTERS'; /** * Default module-image: * file must be in "{T_THEME_PATH}/images/portal/" */ - var $image_src = 'portal_top_poster.png'; + public $image_src = 'portal_top_poster.png'; /** * module-language file * file must be in "language/{$user->lang}/mods/portal/" */ - var $language = 'portal_topposters_module'; + public $language = 'portal_topposters_module'; - function get_template_center($module_id) + public function get_template_center($module_id) { return false; } - function get_template_side($module_id) + public function get_template_side($module_id) { global $config, $db, $template; global $phpbb_root_path, $phpEx; @@ -78,7 +78,7 @@ class portal_topposters_module return 'topposters_side.html'; } - function get_template_acp($module_id) + public function get_template_acp($module_id) { return array( 'title' => 'TOPPOSTERS_CONFIG', @@ -92,13 +92,13 @@ class portal_topposters_module /** * API functions */ - function install($module_id) + public function install($module_id) { set_config('board3_topposters_' . $module_id, 5); return true; } - function uninstall($module_id) + public function uninstall($module_id) { global $db; diff --git a/root/portal/modules/portal_user_menu.php b/root/portal/modules/portal_user_menu.php index 8943e3d4..47d31f69 100644 --- a/root/portal/modules/portal_user_menu.php +++ b/root/portal/modules/portal_user_menu.php @@ -28,26 +28,26 @@ class portal_user_menu_module * right 8 * bottom 16 */ - var $columns = 10; + public $columns = 10; /** * Default modulename */ - var $name = 'USER_MENU'; + public $name = 'USER_MENU'; /** * Default module-image: * file must be in "{T_THEME_PATH}/images/portal/" */ - var $image_src = 'portal_user.png'; + public $image_src = 'portal_user.png'; /** * module-language file * file must be in "language/{$user->lang}/mods/portal/" */ - var $language = 'portal_user_menu_module'; + public $language = 'portal_user_menu_module'; - function get_template_side($module_id) + public function get_template_side($module_id) { global $config, $template, $user, $auth, $db, $phpEx, $phpbb_root_path; @@ -146,7 +146,7 @@ class portal_user_menu_module } } - function get_template_acp($module_id) + public function get_template_acp($module_id) { return array( 'title' => 'USER_MENU', @@ -160,14 +160,14 @@ class portal_user_menu_module /** * API functions */ - function install($module_id) + public function install($module_id) { set_config('board3_user_menu_register_' . $module_id, 1); return true; } - function uninstall($module_id) + public function uninstall($module_id) { global $db; diff --git a/root/portal/modules/portal_welcome.php b/root/portal/modules/portal_welcome.php index 939f0bed..737cb134 100644 --- a/root/portal/modules/portal_welcome.php +++ b/root/portal/modules/portal_welcome.php @@ -28,32 +28,32 @@ class portal_welcome_module * right 8 * bottom 16 */ - var $columns = 21; + public $columns = 21; /** * Default modulename */ - var $name = 'PORTAL_WELCOME'; + public $name = 'PORTAL_WELCOME'; /** * Default module-image: * file must be in "{T_THEME_PATH}/images/portal/" */ - var $image_src = ''; + public $image_src = ''; /** * module-language file * file must be in "language/{$user->lang}/mods/portal/" */ - var $language = 'portal_welcome_module'; + public $language = 'portal_welcome_module'; /** * custom acp template * file must be in "adm/style/portal/" */ - var $custom_acp_tpl = 'acp_portal_welcome'; + public $custom_acp_tpl = 'acp_portal_welcome'; - function get_template_center($module_id) + public function get_template_center($module_id) { global $config, $template, $portal_config, $phpEx; @@ -70,7 +70,7 @@ class portal_welcome_module return 'welcome_center.html'; } - function get_template_acp($module_id) + public function get_template_acp($module_id) { return array( 'title' => 'ACP_PORTAL_WELCOME_SETTINGS', @@ -84,7 +84,7 @@ class portal_welcome_module /** * API functions */ - function install($module_id) + public function install($module_id) { set_portal_config('board3_welcome_message_' . $module_id, 'Welcome to my Community!'); set_config('board3_welcome_message_' . $module_id, ''); @@ -93,7 +93,7 @@ class portal_welcome_module return true; } - function uninstall($module_id) + public function uninstall($module_id) { global $db; @@ -115,7 +115,7 @@ class portal_welcome_module return ((!$check) ? $check : $db->sql_query($sql)); // if something went wrong, make sure we are aware of the first query } - function manage_welcome($value, $key, $module_id) + public function manage_welcome($value, $key, $module_id) { global $db, $portal_config, $config, $template, $user, $phpEx, $phpbb_admin_path, $phpbb_root_path; @@ -211,7 +211,7 @@ class portal_welcome_module } } - function update_welcome($key, $module_id) + public function update_welcome($key, $module_id) { $this->manage_welcome('', $key, $module_id); } diff --git a/root/portal/modules/portal_whois_online.php b/root/portal/modules/portal_whois_online.php index e361c78a..3094ec79 100644 --- a/root/portal/modules/portal_whois_online.php +++ b/root/portal/modules/portal_whois_online.php @@ -28,32 +28,32 @@ class portal_whois_online_module * right 8 * bottom 16 */ - var $columns = 21; + public $columns = 21; /** * Default modulename */ - var $name = 'PORTAL_WHOIS_ONLINE'; + public $name = 'PORTAL_WHOIS_ONLINE'; /** * Default module-image: * file must be in "{T_THEME_PATH}/images/portal/" */ - var $image_src = ''; + public $image_src = ''; /** * module-language file * file must be in "language/{$user->lang}/mods/portal/" */ - var $language = 'portal_whois_online_module'; + public $language = 'portal_whois_online_module'; /** * custom acp template * file must be in "adm/style/portal/" */ - var $custom_acp_tpl = ''; + public $custom_acp_tpl = ''; - function get_template_center($module_id) + public function get_template_center($module_id) { global $config, $template, $user, $auth, $db, $phpbb_root_path, $phpEx; @@ -105,7 +105,7 @@ class portal_whois_online_module return 'whois_online_center.html'; } - function get_template_acp($module_id) + public function get_template_acp($module_id) { return array( 'title' => 'PORTAL_WHOIS_ONLINE', @@ -116,12 +116,12 @@ class portal_whois_online_module /** * API functions */ - function install($module_id) + public function install($module_id) { return true; } - function uninstall($module_id) + public function uninstall($module_id) { return true; } From a3c23052bf48b3655fb7d58d1318e4a948372bbc Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Sat, 23 Apr 2011 18:48:56 +0200 Subject: [PATCH 2/2] Added check to prevent adding a module more than once Few small bugfixes --- root/includes/acp/acp_portal.php | 26 +++++++++++++++++- root/language/de/mods/info_acp_portal.php | 1 + .../mods/portal/portal_latest_bots_module.php | 3 +- root/language/en/mods/info_acp_portal.php | 1 + .../mods/portal/portal_latest_bots_module.php | 3 +- root/portal/modules/portal_announcements.php | 1 - root/portal/modules/portal_forumlist.php | 1 - root/portal/modules/portal_friends.php | 1 - root/portal/modules/portal_latest_bots.php | 26 ++++-------------- root/portal/modules/portal_news.php | 1 - root/portal/modules/portal_poll.php | 4 +-- root/portal/modules/portal_statistics.php | 1 - root/portal/modules/portal_stylechanger.php | 1 - .../template/portal/modules/news_center.html | 2 +- .../portal/modules/stylechanger_side.html | 2 +- .../theme/images/portal/portal_poll.png | Bin 0 -> 3530 bytes 16 files changed, 40 insertions(+), 34 deletions(-) create mode 100644 root/styles/subsilver2/theme/images/portal/portal_poll.png diff --git a/root/includes/acp/acp_portal.php b/root/includes/acp/acp_portal.php index b6cbf96a..d3d92828 100644 --- a/root/includes/acp/acp_portal.php +++ b/root/includes/acp/acp_portal.php @@ -261,13 +261,17 @@ class acp_portal $sql_ary = array( 'module_image_src' => request_var('module_image', ''), - 'module_name' => request_var('module_name', '', true), 'module_image_width' => request_var('module_img_width', 0), 'module_image_height' => request_var('module_img_height', 0), 'module_group_ids' => $module_permission, 'module_status' => request_var('module_status', B3_MODULE_ENABLED), ); + if($module_data['module_classname'] != 'latest_bots') + { + $sql_ary['module_name'] = utf8_normalize_nfc(request_var('module_name', '', true)); + } + // check if module image file actually exists check_file_src($sql_ary['module_image_src'], '', $module_id); @@ -704,11 +708,26 @@ class acp_portal { $submit = (isset($_POST['submit'])) ? true : false; $directory = $phpbb_root_path . 'portal/modules/'; + + // Create an array of already installed modules + $portal_modules = obtain_portal_modules(); + $installed_modules = array(); + + foreach($portal_modules as $cur_module) + { + $installed_modules[] = $cur_module['module_classname']; + } if ($submit) { $module_classname = request_var('module_classname', ''); $class = 'portal_' . $module_classname . '_module'; + + if(in_array($module_classname, $installed_modules) && $module_classname != 'custom') + { + trigger_error($user->lang['MODULE_ADD_ONCE'] . adm_back_link($this->u_action), E_USER_WARNING); + } + if (!class_exists($class)) { include($directory . 'portal_' . $module_classname . '.' . $phpEx); @@ -788,6 +807,11 @@ class acp_portal if (preg_match('/^portal_.+\.' . $phpEx . '$/', $file)) { $class = str_replace(".$phpEx", '', $file) . '_module'; + if(in_array(str_replace(array('portal_', '_module'), '', $class), $installed_modules)) + { + continue; + } + if (!class_exists($class)) { include($directory . $file); diff --git a/root/language/de/mods/info_acp_portal.php b/root/language/de/mods/info_acp_portal.php index 5cbb6857..0e08c36a 100644 --- a/root/language/de/mods/info_acp_portal.php +++ b/root/language/de/mods/info_acp_portal.php @@ -71,6 +71,7 @@ $lang = array_merge($lang, array( 'MODULE_RESET' => 'Modul Einstellungen zurücksetzen', 'MODULE_RESET_EXP' => 'Dies wird alle Einstellungen des Moduls auf die Standardeinstellungen zurücksetzen!', 'MODULE_STATUS' => 'Aktiviere Modul', + 'MODULE_ADD_ONCE' => 'Diese Modul kann nur ein Mal hinzugefügt werden.', // general 'ACP_PORTAL' => 'Portal', diff --git a/root/language/de/mods/portal/portal_latest_bots_module.php b/root/language/de/mods/portal/portal_latest_bots_module.php index bf84dc0f..ca89d4bb 100644 --- a/root/language/de/mods/portal/portal_latest_bots_module.php +++ b/root/language/de/mods/portal/portal_latest_bots_module.php @@ -33,7 +33,8 @@ if (empty($lang) || !is_array($lang)) // in a url you again do not need to specify an order e.g., 'Click %sHERE%s' is fine $lang = array_merge($lang, array( 'LATEST_BOTS' => 'Letzte Bots', - 'LAST_VISITED_BOTS' => 'Die letzten %s Bots', + 'LAST_VISITED_BOTS' => 'Die letzten Bots', + 'LAST_VISITED_BOTS_CNT' => 'Die letzten %s Bots', // ACP 'ACP_PORTAL_BOTS_SETTINGS' => 'Einstellungen für Bot-Besuche', diff --git a/root/language/en/mods/info_acp_portal.php b/root/language/en/mods/info_acp_portal.php index 2249a3a1..3377a0fc 100755 --- a/root/language/en/mods/info_acp_portal.php +++ b/root/language/en/mods/info_acp_portal.php @@ -70,6 +70,7 @@ $lang = array_merge($lang, array( 'MODULE_RESET' => 'Reset module configuration', 'MODULE_RESET_EXP' => 'This will reset all settings to the default!', 'MODULE_STATUS' => 'Enable module', + 'MODULE_ADD_ONCE' => 'This module can only be added once.', // general 'ACP_PORTAL' => 'Portal', diff --git a/root/language/en/mods/portal/portal_latest_bots_module.php b/root/language/en/mods/portal/portal_latest_bots_module.php index 8eb9d290..22642d40 100644 --- a/root/language/en/mods/portal/portal_latest_bots_module.php +++ b/root/language/en/mods/portal/portal_latest_bots_module.php @@ -33,7 +33,8 @@ if (empty($lang) || !is_array($lang)) // in a url you again do not need to specify an order e.g., 'Click %sHERE%s' is fine $lang = array_merge($lang, array( 'LATEST_BOTS' => 'Latest Bots', - 'LAST_VISITED_BOTS' => 'Last %s visited bots', + 'LAST_VISITED_BOTS' => 'Last visited bots', + 'LAST_VISITED_BOTS_CNT' => 'Last %s visited bots', // ACP 'ACP_PORTAL_BOTS_SETTINGS' => 'Visiting bots settings', diff --git a/root/portal/modules/portal_announcements.php b/root/portal/modules/portal_announcements.php index 7f842f16..a8862893 100644 --- a/root/portal/modules/portal_announcements.php +++ b/root/portal/modules/portal_announcements.php @@ -352,7 +352,6 @@ class portal_announcements_module 'NEWEST_POST_IMG' => $user->img('icon_topic_newest', 'VIEW_NEWEST_POST'), 'READ_POST_IMG' => $user->img('icon_topic_latest', 'VIEW_LATEST_POST'), 'GOTO_PAGE_IMG' => $user->img('icon_post_target', 'GOTO_PAGE'), - 'S_DISPLAY_ANNOUNCEMENTS' => true, 'S_DISPLAY_ANNOUNCEMENTS_RVS' => ($config['board3_show_announcements_replies_views_' . $module_id]) ? true : false, 'S_TOPIC_ICONS' => $topic_icons, )); diff --git a/root/portal/modules/portal_forumlist.php b/root/portal/modules/portal_forumlist.php index 3a4ae332..ddb8fc10 100644 --- a/root/portal/modules/portal_forumlist.php +++ b/root/portal/modules/portal_forumlist.php @@ -64,7 +64,6 @@ class portal_forumlist_module 'FORUM_NEW_IMG' => $user->img('forum_unread', 'NEW_POSTS'), 'FORUM_LOCKED_IMG' => $user->img('forum_read_locked', 'NO_NEW_POSTS_LOCKED'), 'FORUM_NEW_LOCKED_IMG' => $user->img('forum_unread_locked', 'NO_NEW_POSTS_LOCKED'), - 'S_DISPLAY_PORTAL_FORUM_INDEX' => true, 'U_MARK_FORUMS' => ($user->data['is_registered'] || $config['load_anon_lastread']) ? append_sid("{$phpbb_root_path}index.$phpEx", 'hash=' . generate_link_hash('global') . '&mark=forums') : '', 'U_MCP' => ($auth->acl_get('m_') || $auth->acl_getf_global('m_')) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=main&mode=front', true, $user->session_id) : '', )); diff --git a/root/portal/modules/portal_friends.php b/root/portal/modules/portal_friends.php index 1dff111d..d244350f 100644 --- a/root/portal/modules/portal_friends.php +++ b/root/portal/modules/portal_friends.php @@ -97,7 +97,6 @@ class portal_friends_module // Assign specific vars $template->assign_vars(array( 'S_DISPLAY_FRIENDS' => $s_display_friends, - 'S_ZEBRA_ENABLED' => true, )); return 'friends_side.html'; diff --git a/root/portal/modules/portal_latest_bots.php b/root/portal/modules/portal_latest_bots.php index dd405cf8..f83d5ef5 100755 --- a/root/portal/modules/portal_latest_bots.php +++ b/root/portal/modules/portal_latest_bots.php @@ -55,36 +55,22 @@ class portal_latest_bots_module $sql = 'SELECT username, user_colour, user_lastvisit FROM ' . USERS_TABLE . ' WHERE user_type = ' . USER_IGNORE . ' + AND user_lastvisit > 0 ORDER BY user_lastvisit DESC'; $result = $db->sql_query_limit($sql, $config['board3_last_visited_bots_number_' . $module_id]); - $first = true; + while ($row = $db->sql_fetchrow($result)) { - if (!$row['user_lastvisit'] && $first == true) - { - $template->assign_vars(array( - 'S_DISPLAY_LAST_BOTS' => false, + $template->assign_block_vars('last_visited_bots', array( + 'BOT_NAME' => get_username_string('full', '', $row['username'], $row['user_colour']), + 'LAST_VISIT_DATE' => $user->format_date($row['user_lastvisit']), )); - } - else - { - $template->assign_var('S_DISPLAY_LAST_BOTS', true); - - if($row['user_lastvisit'] > 0) - { - $template->assign_block_vars('last_visited_bots', array( - 'BOT_NAME' => get_username_string('full', '', $row['username'], $row['user_colour']), - 'LAST_VISIT_DATE' => $user->format_date($row['user_lastvisit']), - )); - } - } - $first = false; } $db->sql_freeresult($result); // Assign specific vars $template->assign_vars(array( - 'LAST_VISITED_BOTS' => sprintf($user->lang['LAST_VISITED_BOTS'], $config['board3_last_visited_bots_number_' . $module_id]), + 'LAST_VISITED_BOTS' => ($config['board3_last_visited_bots_number_' . $module_id] != 0) ? sprintf($user->lang['LAST_VISITED_BOTS_CNT'], $config['board3_last_visited_bots_number_' . $module_id]) : $user->lang['LAST_VISITED_BOTS'], )); if(!empty($row)) diff --git a/root/portal/modules/portal_news.php b/root/portal/modules/portal_news.php index a5496ac5..00903562 100644 --- a/root/portal/modules/portal_news.php +++ b/root/portal/modules/portal_news.php @@ -340,7 +340,6 @@ class portal_news_module 'GOTO_PAGE_IMG' => $user->img('icon_post_target', 'GOTO_PAGE'), 'S_NEWEST_OR_FIRST' => ($config['board3_news_show_last_' . $module_id]) ? $user->lang['JUMP_NEWEST'] : $user->lang['JUMP_FIRST'], 'POSTED_BY_TEXT' => ($config['board3_news_show_last_' . $module_id]) ? $user->lang['LAST_POST'] : $user->lang['POSTED'], - 'S_DISPLAY_NEWS' => true, 'S_DISPLAY_NEWS_RVS' => ($config['board3_show_news_replies_views_' . $module_id]) ? true : false, 'S_TOPIC_ICONS' => $topic_icons, )); diff --git a/root/portal/modules/portal_poll.php b/root/portal/modules/portal_poll.php index d2f8d74f..ddbc2e22 100644 --- a/root/portal/modules/portal_poll.php +++ b/root/portal/modules/portal_poll.php @@ -421,7 +421,6 @@ class portal_poll_module $db->sql_freeresult($result); $template->assign_vars(array( - 'S_DISPLAY_POLL' => true, 'S_HAS_POLL' => $has_poll, 'POLL_LEFT_CAP_IMG' => $user->img('poll_left'), 'POLL_RIGHT_CAP_IMG' => $user->img('poll_right'), @@ -789,7 +788,7 @@ class portal_poll_module 'POLL_OPTION_RESULT' => $pd['poll_option_total'], 'POLL_OPTION_PERCENT' => $option_pct_txt, 'POLL_OPTION_PCT' => round($option_pct * 100), - 'POLL_OPTION_IMG' => $user->img('poll_center', $option_pct_txt, round($option_pct * 250)), + 'POLL_OPTION_IMG' => $user->img('poll_center', $option_pct_txt, round($option_pct * 35) . 'px'), 'POLL_OPTION_VOTED' => (in_array($pd['poll_option_id'], $cur_voted_id)) ? true : false )); } @@ -798,7 +797,6 @@ class portal_poll_module $db->sql_freeresult($result); $template->assign_vars(array( - 'S_DISPLAY_POLL' => true, 'S_HAS_POLL' => $has_poll, 'POLL_LEFT_CAP_IMG' => $user->img('poll_left'), 'POLL_RIGHT_CAP_IMG' => $user->img('poll_right'), diff --git a/root/portal/modules/portal_statistics.php b/root/portal/modules/portal_statistics.php index 7a3957b5..e4bdba18 100644 --- a/root/portal/modules/portal_statistics.php +++ b/root/portal/modules/portal_statistics.php @@ -119,7 +119,6 @@ class portal_statistics_module // Assign specific vars $template->assign_vars(array( - 'S_DISPLAY_ADVANCED_STAT' => true, 'B3_TOTAL_POSTS' => sprintf($user->lang[$l_total_post_s], $total_posts), 'B3_TOTAL_TOPICS' => sprintf($user->lang[$l_total_topic_s], $total_topics), 'B3_TOTAL_USERS' => sprintf($user->lang[$l_total_user_s], $total_users), diff --git a/root/portal/modules/portal_stylechanger.php b/root/portal/modules/portal_stylechanger.php index 62434e6f..cb933b90 100644 --- a/root/portal/modules/portal_stylechanger.php +++ b/root/portal/modules/portal_stylechanger.php @@ -82,7 +82,6 @@ class portal_stylechanger_module // Assign specific vars $template->assign_vars(array( 'S_STYLE_OPTIONS' => ($config['override_user_style'] || $style_count < 2) ? '' : style_select($user->data['user_style']), - 'S_DISPLAY_CHANGE_STYLE' => true, )); return 'stylechanger_side.html'; diff --git a/root/styles/prosilver/template/portal/modules/news_center.html b/root/styles/prosilver/template/portal/modules/news_center.html index 4cf4d5df..4f8dfc62 100644 --- a/root/styles/prosilver/template/portal/modules/news_center.html +++ b/root/styles/prosilver/template/portal/modules/news_center.html @@ -8,7 +8,7 @@ -
+

{NEWEST_POST_IMG}{READ_POST_IMG} {news_row.ATTACH_ICON_IMG} {L_VIEW_TOPIC_POLL} {news_row.TITLE}

{news_row.PAGINATION} diff --git a/root/styles/prosilver/template/portal/modules/stylechanger_side.html b/root/styles/prosilver/template/portal/modules/stylechanger_side.html index 3c23b993..3583b4a2 100644 --- a/root/styles/prosilver/template/portal/modules/stylechanger_side.html +++ b/root/styles/prosilver/template/portal/modules/stylechanger_side.html @@ -1,4 +1,4 @@ - + {$LR_BLOCK_H_L} {$TITLE}{$LR_BLOCK_H_R}