From 5ca9698f652dda2f3ae682692876dbb174ebfd6d Mon Sep 17 00:00:00 2001 From: Mark Vincent Date: Fri, 28 Sep 2018 17:07:44 -0500 Subject: [PATCH 1/9] Fixes #329 --- Upload/inc/plugins/asb/functions_acp.php | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/Upload/inc/plugins/asb/functions_acp.php b/Upload/inc/plugins/asb/functions_acp.php index 4995f0f..01cc7fa 100644 --- a/Upload/inc/plugins/asb/functions_acp.php +++ b/Upload/inc/plugins/asb/functions_acp.php @@ -164,17 +164,12 @@ function asb_build_footer_menu($page_key = '') * @param int id * @return string html */ -function asb_build_permissions_table($id) +function asb_build_permissions_table($sidebox) { - if (!$id) { - return false; - } - global $lang, $all_scripts; - $sidebox = new SideboxObject($id); - - if (!$sidebox->isValid()) { + if ($sidebox instanceof SideboxObject == false || + !$sidebox->isValid()) { return $lang->asb_invalid_sidebox; } @@ -367,7 +362,8 @@ function asb_build_theme_visibility_list($sidebox, $colspan, $global) function asb_build_sidebox_info($sidebox, $wrap = true, $ajax = false) { // must be a valid object - if ($sidebox instanceof SideboxObject == false) { + if ($sidebox instanceof SideboxObject == false || + !$sidebox->isValid()) { return false; } @@ -379,7 +375,7 @@ function asb_build_sidebox_info($sidebox, $wrap = true, $ajax = false) $module = $sidebox->get('box_type'); // visibility table - $visibility = '' . asb_build_permissions_table($id) . ''; + $visibility = '' . asb_build_permissions_table($sidebox) . ''; // edit link $edit_link = $html->url(array("action" => 'edit_box', "id" => $id, "addon" => $module, "pos" => $pos)); From d1c4025ec65f52309cc390cc41215990a2b66203 Mon Sep 17 00:00:00 2001 From: Mark Vincent Date: Fri, 28 Sep 2018 17:20:13 -0500 Subject: [PATCH 2/9] Fixes #330 --- Upload/inc/plugins/asb/functions_acp.php | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/Upload/inc/plugins/asb/functions_acp.php b/Upload/inc/plugins/asb/functions_acp.php index 01cc7fa..1f947d8 100644 --- a/Upload/inc/plugins/asb/functions_acp.php +++ b/Upload/inc/plugins/asb/functions_acp.php @@ -198,21 +198,25 @@ function asb_build_visibility_rows($sidebox, &$group_count, &$global) { global $db, $lang, $all_scripts; + static $options; + if (!is_array($all_scripts) || empty($all_scripts)) { return $lang->asb_no_active_scripts; } - // prepare options for which groups - $options = array($lang->asb_guests); - $groups = array(); + if (!is_array($options)) { + // prepare options for which groups + $options = array($lang->asb_guests); - // look for all groups except Super Admins - $query = $db->simple_select('usergroups', 'gid, title', "gid != '1'", array('order_by' => 'gid')); - while ($usergroup = $db->fetch_array($query)) { - // store the titles by group id - $options[(int)$usergroup['gid']] = $usergroup['title']; + // look for all groups except Super Admins + $query = $db->simple_select('usergroups', 'gid, title', "gid != '1'", array('order_by' => 'gid')); + while ($usergroup = $db->fetch_array($query)) { + // store the titles by group id + $options[(int)$usergroup['gid']] = $usergroup['title']; + } } + $group_count = $all_group_count = count($options); $groups = $sidebox->get('groups'); From 7ce3718423ecf22cda9ba8f416a01c9154683860 Mon Sep 17 00:00:00 2001 From: Mark Vincent Date: Fri, 28 Sep 2018 17:32:37 -0500 Subject: [PATCH 3/9] Fixes #331 --- Upload/inc/plugins/asb/functions.php | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/Upload/inc/plugins/asb/functions.php b/Upload/inc/plugins/asb/functions.php index 15de4c2..fb5beb7 100644 --- a/Upload/inc/plugins/asb/functions.php +++ b/Upload/inc/plugins/asb/functions.php @@ -579,22 +579,23 @@ function asb_get_all_themes($full = false) { global $db; - if ($full != true) { - $excluded_themes = asb_get_excluded_themes(true); - } + static $themeList; - // get all the themes that are not MasterStyles - $query = $db->simple_select('themes', 'tid, name', "NOT pid='0'{$excluded_themes}"); + if (!is_array($themeList)) { + if ($full != true) { + $excluded_themes = asb_get_excluded_themes(true); + } - $return_array = array(); - if ($db->num_rows($query) == 0) { - return $return_array; - } + // get all the themes that are not MasterStyles + $query = $db->simple_select('themes', 'tid, name', "NOT pid='0'{$excluded_themes}"); - while ($this_theme = $db->fetch_array($query)) { - $return_array[$this_theme['tid']] = $this_theme['name']; + $themeList = array(); + while ($thisTheme = $db->fetch_array($query)) { + $themeList[$thisTheme['tid']] = $thisTheme['name']; + } } - return $return_array; + + return $themeList; } ?> From c9e63fbd77710a842e05996da5ef3d7ea3ccec1e Mon Sep 17 00:00:00 2001 From: Mark Vincent Date: Fri, 28 Sep 2018 17:41:11 -0500 Subject: [PATCH 4/9] Fixes #326 --- Upload/inc/plugins/asb/modules/welcome_box.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Upload/inc/plugins/asb/modules/welcome_box.php b/Upload/inc/plugins/asb/modules/welcome_box.php index a8ece50..ab85ad8 100644 --- a/Upload/inc/plugins/asb/modules/welcome_box.php +++ b/Upload/inc/plugins/asb/modules/welcome_box.php @@ -30,7 +30,7 @@ function asb_welcome_box_info() 'title' => $lang->asb_welcome, 'description' => $lang->asb_welcome_desc, 'wrap_content' => true, - 'version' => '1.3.2', + 'version' => '1.3.3', 'compatibility' => '2.1', 'templates' => array( array( @@ -62,9 +62,9 @@ function asb_welcome_box_info()
- {\$username}
  

- {\$lang->password}
  

-

+ {\$username}


+ {\$lang->password}


+

EOF From 30a967aa7a411497bf44b982df41732781a801d1 Mon Sep 17 00:00:00 2001 From: Mark Vincent Date: Fri, 28 Sep 2018 17:46:33 -0500 Subject: [PATCH 5/9] Fixes #325 --- Upload/inc/plugins/asb/modules/welcome_box.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Upload/inc/plugins/asb/modules/welcome_box.php b/Upload/inc/plugins/asb/modules/welcome_box.php index ab85ad8..c4fd4ec 100644 --- a/Upload/inc/plugins/asb/modules/welcome_box.php +++ b/Upload/inc/plugins/asb/modules/welcome_box.php @@ -30,7 +30,7 @@ function asb_welcome_box_info() 'title' => $lang->asb_welcome, 'description' => $lang->asb_welcome_desc, 'wrap_content' => true, - 'version' => '1.3.3', + 'version' => '1.3.4', 'compatibility' => '2.1', 'templates' => array( array( @@ -61,6 +61,7 @@ function asb_welcome_box_info() {\$lang->asb_welcome_guest_welcome_registration}

+ {\$username}


{\$lang->password}


From a91288f9514506910ebbd63dfaf3fc0fc9d45e85 Mon Sep 17 00:00:00 2001 From: Mark Vincent Date: Fri, 28 Sep 2018 17:55:24 -0500 Subject: [PATCH 6/9] Fixes #324 --- Upload/inc/plugins/asb/modules/birthdays.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Upload/inc/plugins/asb/modules/birthdays.php b/Upload/inc/plugins/asb/modules/birthdays.php index fb4ef0e..5b2c3b5 100644 --- a/Upload/inc/plugins/asb/modules/birthdays.php +++ b/Upload/inc/plugins/asb/modules/birthdays.php @@ -138,9 +138,12 @@ function asb_birthdays_get_birthdays($args) } $userAvatarList = implode(',', $userAvatarList); - $query = $db->simple_select('users', 'uid, avatar, avatardimensions', "uid IN({$userAvatarList})"); - while ($user = $db->fetch_array($query)) { - $userAvatars[$user['uid']] = format_avatar($user['avatar'], $user['avatardimensions'], '20x20'); + if (!empty($userAvatarList)) { + $query = $db->simple_select('users', 'uid, avatar, avatardimensions', "uid IN({$userAvatarList})"); + + while ($user = $db->fetch_array($query)) { + $userAvatars[$user['uid']] = format_avatar($user['avatar'], $user['avatardimensions'], '20x20'); + } } $alreadyDone = array(); From 1e0a2aa751d16f3bb731cac78b9021a274f1f049 Mon Sep 17 00:00:00 2001 From: Mark Vincent Date: Fri, 28 Sep 2018 20:50:06 -0500 Subject: [PATCH 7/9] Fixes #332 --- Upload/inc/plugins/asb/functions_addon.php | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/Upload/inc/plugins/asb/functions_addon.php b/Upload/inc/plugins/asb/functions_addon.php index c3d4f2c..e904ed2 100644 --- a/Upload/inc/plugins/asb/functions_addon.php +++ b/Upload/inc/plugins/asb/functions_addon.php @@ -17,7 +17,7 @@ function asb_strip_quotes($message) { // Assign pattern and replace values. $pattern = array( - "#\[quote=([\"']|"|)(.*?)(?:\\1)(.*?)(?:[\"']|")?\](.*?)\[/quote\](\r\n?|\n?)#esi", + "#\[quote=([\"']|"|)(.*?)(?:\\1)(.*?)(?:[\"']|")?\](.*?)\[/quote\](\r\n?|\n?)#si", "#\[quote\](.*?)\[\/quote\](\r\n?|\n?)#si", "#\[\/quote\](\r\n?|\n?)#si" ); @@ -26,11 +26,7 @@ function asb_strip_quotes($message) $message = preg_replace($pattern, '', $message, -1, $count); } while($count); - $find = array( - "#(\r\n*|\n*)<\/cite>(\r\n*|\n*)#", - "#(\r\n*|\n*)<\/blockquote>#" - ); - return preg_replace($find, '', $message); + return $message; } /** From c9e04498e32061f9f1b4b5685617eaab2691d325 Mon Sep 17 00:00:00 2001 From: Mark Vincent Date: Sat, 29 Sep 2018 11:15:15 -0500 Subject: [PATCH 8/9] Fixes #333 --- Upload/inc/plugins/asb/upgrade.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Upload/inc/plugins/asb/upgrade.php b/Upload/inc/plugins/asb/upgrade.php index 17a2050..fc66c81 100644 --- a/Upload/inc/plugins/asb/upgrade.php +++ b/Upload/inc/plugins/asb/upgrade.php @@ -113,6 +113,19 @@ )); } +/* < 3.1.12 */ +if (version_compare($asbOldVersion, '3.1.12', '<')) { + $removedForumFiles = array_merge($removedForumFiles, array( + 'inc/plugins/asb/classes/WildcardPluginInstaller010202.php', + 'inc/plugins/asb/classes/PortableObject010000.php', + )); +} + +/* < 3.1.13 */ +if (version_compare($asbOldVersion, '3.1.13', '<')) { + $removedForumFiles[] = 'inc/plugins/asb/classes/WildcardPluginInstaller010302.php'; +} + if (!empty($removedForumFiles)) { foreach ($removedForumFiles as $file) { @unlink(MYBB_ROOT . $file); From 8f72de8c6335c2b070c0ba0d6f6e32671944abe5 Mon Sep 17 00:00:00 2001 From: Mark Vincent Date: Sat, 29 Sep 2018 11:31:09 -0500 Subject: [PATCH 9/9] 3.1.14 Pre-release --- README.md | 70 ++++++++++++++++++++++++++------------ Upload/inc/plugins/asb.php | 2 +- 2 files changed, 50 insertions(+), 22 deletions(-) diff --git a/README.md b/README.md index 76fee6d..3fb92f2 100644 --- a/README.md +++ b/README.md @@ -1,26 +1,54 @@ -## Advanced-Sidebox 3.1.13 +## Advanced-Sidebox 3.1.14

Advanced Sidebox Logo

-*A plugin for MyBB forums that displays custom boxes on various forum pages.* - -This plugin seeks to give the admin more options when adding side boxes to the forum and allow control in a more intuitive way. This plugin edits the template cache and does not modify your forum's templates-- therefore it does not work with every theme but *is* designed to work with most. - -## Features - -* Now add and edit script definitions to further customize ASB! Also now compatible with Page Manager scripts. -* New add-on module added to the core: Recent Posts (AJAX Ready) -* AJAX Refresh now integrated into the core and five of the core modules (latest threads, PMs, random quotes, staff on-line and who's on-line avatar lists)! -* New Improved Drag and Drop Interface! -* Admin can control many settings for where and how side boxes display -* Eight scripts available! (Index, Forum, Thread, Member Profiles, Member List, Forum Team, Statistics and Portal) -* Choose one of many default presets with updated content or create semi-static custom boxes with HTML and template variables -* Import/Export custom boxes to share and backup your work -* Control which scripts side boxes display on -* Individual side box settings -* Extensive user group permissions for side boxes -* Now supports CodePress -* Newly redesigned On-line Staff module -* Context-sensitive help for ACP pages +

+A plugin for MyBB forums that displays custom boxes on various forum pages. +

+ +ASB is ***the*** side box plugin for MyBB forums. It is versatile, powerful, and built using the advice of its users. + +## Features: + +* create an **unlimited** amount of side **boxes** on the left, right or both +* **add** side boxes **to** almost **any page** +* side boxes can be create**d using core modules** (listed below) or **static HTML** created by the admin +* static HTML (termed **custom** side **boxes**) may be **imported**/**exported** to XML to backup, restore and share +* side boxes expand/collapse just like the MyBB core windows +* JavaScript **visibility toggle** icons for columns (uses **cookies** to remember states) +* intuitive, **drag and drop**, side box management interface in ACP +* context-sensitive **help pages** in ACP +* easily **extensible** from single file modules for **third-party** developers and the hobbyist admin +* **CodeMirror** supported when editing custom side boxes (if enabled in ACP) +* compatible with **Page Manager** pages and custom scripts +* **AJAX Update** integrated into the core and eight of the core modules! (listed below) + + +## Controls: + +* which user **group(s)** the side boxes display for +* which **script(s)** the side boxes display in +* which **theme(s)** the side boxes display on +* disable the plugin for **specific themes** +* admin **option to allow users to disable side boxes** globally from usercp.php + + +## Current default side box types available: + +* ![New](https://i.imgur.com/FMH0S6f.png) Birthdays +* ![New](https://i.imgur.com/FMH0S6f.png) Forum Age ![AJAX-ready](http://i.imgur.com/nw832ed.png) +* Forum Goals ![AJAX-ready](http://i.imgur.com/nw832ed.png) +* Top Poster +* Slideshow +* Recent Posts ![AJAX-ready](http://i.imgur.com/nw832ed.png) +* Who's Online ![AJAX-ready](http://i.imgur.com/nw832ed.png) +* Latest Threads ![AJAX-ready](http://i.imgur.com/nw832ed.png) +* Welcome +* Statistics +* Private Messages ![AJAX-ready](http://i.imgur.com/nw832ed.png) +* Search +* Random Quotes ![AJAX-ready](http://i.imgur.com/nw832ed.png) +* Staff Online ![AJAX-ready](http://i.imgur.com/nw832ed.png) +* You can also create your own custom box types with static content \ No newline at end of file diff --git a/Upload/inc/plugins/asb.php b/Upload/inc/plugins/asb.php index 97abf00..b889025 100644 --- a/Upload/inc/plugins/asb.php +++ b/Upload/inc/plugins/asb.php @@ -15,7 +15,7 @@ // for modules define('IN_ASB', true); define('ASB_MODULES_DIR', MYBB_ROOT . 'inc/plugins/asb/modules'); -define('ASB_VERSION', '3.1.13'); +define('ASB_VERSION', '3.1.14'); define('ASB_CUSTOM_VERSION', '2.0'); define('ASB_SCRIPT_VERSION', '2.0');