Skip to content

Commit 48c97b6

Browse files
author
Mark Vincent
authored
Merge pull request #334 from WildcardSearch/maintenance
3.1.14 Release
2 parents 27931b4 + 8f72de8 commit 48c97b6

File tree

8 files changed

+107
-65
lines changed

8 files changed

+107
-65
lines changed

README.md

Lines changed: 49 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,54 @@
1-
## Advanced-Sidebox 3.1.13
1+
## Advanced-Sidebox 3.1.14
22

33
<p align="center">
44
<img title="Advanced Sidebox Logo" alt="Advanced Sidebox Logo" src="http://i.imgur.com/4QWLq5V.png" />
55
</p>
66

7-
*A plugin for MyBB forums that displays custom boxes on various forum pages.*
8-
9-
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.
10-
11-
## Features
12-
13-
* Now add and edit script definitions to further customize ASB! Also now compatible with Page Manager scripts.
14-
* New add-on module added to the core: Recent Posts (AJAX Ready)
15-
* 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)!
16-
* New Improved Drag and Drop Interface!
17-
* Admin can control many settings for where and how side boxes display
18-
* Eight scripts available! (Index, Forum, Thread, Member Profiles, Member List, Forum Team, Statistics and Portal)
19-
* Choose one of many default presets with updated content or create semi-static custom boxes with HTML and template variables
20-
* Import/Export custom boxes to share and backup your work
21-
* Control which scripts side boxes display on
22-
* Individual side box settings
23-
* Extensive user group permissions for side boxes
24-
* Now supports CodePress
25-
* Newly redesigned On-line Staff module
26-
* Context-sensitive help for ACP pages
7+
<p align="center">
8+
A plugin for MyBB forums that displays custom boxes on various forum pages.
9+
</p>
10+
11+
ASB is ***the*** side box plugin for MyBB forums. It is versatile, powerful, and built using the advice of its users.
12+
13+
## Features:
14+
15+
* create an **unlimited** amount of side **boxes** on the left, right or both
16+
* **add** side boxes **to** almost **any page**
17+
* side boxes can be create**d using core modules** (listed below) or **static HTML** created by the admin
18+
* static HTML (termed **custom** side **boxes**) may be **imported**/**exported** to XML to backup, restore and share
19+
* side boxes expand/collapse just like the MyBB core windows
20+
* JavaScript **visibility toggle** icons for columns (uses **cookies** to remember states)
21+
* intuitive, **drag and drop**, side box management interface in ACP
22+
* context-sensitive **help pages** in ACP
23+
* easily **extensible** from single file modules for **third-party** developers and the hobbyist admin
24+
* **CodeMirror** supported when editing custom side boxes (if enabled in ACP)
25+
* compatible with **Page Manager** pages and custom scripts
26+
* **AJAX Update** integrated into the core and eight of the core modules! (listed below)
27+
28+
29+
## Controls:
30+
31+
* which user **group(s)** the side boxes display for
32+
* which **script(s)** the side boxes display in
33+
* which **theme(s)** the side boxes display on
34+
* disable the plugin for **specific themes**
35+
* admin **option to allow users to disable side boxes** globally from usercp.php
36+
37+
38+
## Current default side box types available:
39+
40+
* ![New](https://i.imgur.com/FMH0S6f.png) Birthdays
41+
* ![New](https://i.imgur.com/FMH0S6f.png) Forum Age ![AJAX-ready](http://i.imgur.com/nw832ed.png)
42+
* Forum Goals ![AJAX-ready](http://i.imgur.com/nw832ed.png)
43+
* Top Poster
44+
* Slideshow
45+
* Recent Posts ![AJAX-ready](http://i.imgur.com/nw832ed.png)
46+
* Who's Online ![AJAX-ready](http://i.imgur.com/nw832ed.png)
47+
* Latest Threads ![AJAX-ready](http://i.imgur.com/nw832ed.png)
48+
* Welcome
49+
* Statistics
50+
* Private Messages ![AJAX-ready](http://i.imgur.com/nw832ed.png)
51+
* Search
52+
* Random Quotes ![AJAX-ready](http://i.imgur.com/nw832ed.png)
53+
* Staff Online ![AJAX-ready](http://i.imgur.com/nw832ed.png)
54+
* You can also create your own custom box types with static content

Upload/inc/plugins/asb.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
// for modules
1616
define('IN_ASB', true);
1717
define('ASB_MODULES_DIR', MYBB_ROOT . 'inc/plugins/asb/modules');
18-
define('ASB_VERSION', '3.1.13');
18+
define('ASB_VERSION', '3.1.14');
1919
define('ASB_CUSTOM_VERSION', '2.0');
2020
define('ASB_SCRIPT_VERSION', '2.0');
2121

Upload/inc/plugins/asb/functions.php

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -579,22 +579,23 @@ function asb_get_all_themes($full = false)
579579
{
580580
global $db;
581581

582-
if ($full != true) {
583-
$excluded_themes = asb_get_excluded_themes(true);
584-
}
582+
static $themeList;
585583

586-
// get all the themes that are not MasterStyles
587-
$query = $db->simple_select('themes', 'tid, name', "NOT pid='0'{$excluded_themes}");
584+
if (!is_array($themeList)) {
585+
if ($full != true) {
586+
$excluded_themes = asb_get_excluded_themes(true);
587+
}
588588

589-
$return_array = array();
590-
if ($db->num_rows($query) == 0) {
591-
return $return_array;
592-
}
589+
// get all the themes that are not MasterStyles
590+
$query = $db->simple_select('themes', 'tid, name', "NOT pid='0'{$excluded_themes}");
593591

594-
while ($this_theme = $db->fetch_array($query)) {
595-
$return_array[$this_theme['tid']] = $this_theme['name'];
592+
$themeList = array();
593+
while ($thisTheme = $db->fetch_array($query)) {
594+
$themeList[$thisTheme['tid']] = $thisTheme['name'];
595+
}
596596
}
597-
return $return_array;
597+
598+
return $themeList;
598599
}
599600

600601
?>

Upload/inc/plugins/asb/functions_acp.php

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -164,17 +164,12 @@ function asb_build_footer_menu($page_key = '')
164164
* @param int id
165165
* @return string html
166166
*/
167-
function asb_build_permissions_table($id)
167+
function asb_build_permissions_table($sidebox)
168168
{
169-
if (!$id) {
170-
return false;
171-
}
172-
173169
global $lang, $all_scripts;
174170

175-
$sidebox = new SideboxObject($id);
176-
177-
if (!$sidebox->isValid()) {
171+
if ($sidebox instanceof SideboxObject == false ||
172+
!$sidebox->isValid()) {
178173
return $lang->asb_invalid_sidebox;
179174
}
180175

@@ -203,21 +198,25 @@ function asb_build_visibility_rows($sidebox, &$group_count, &$global)
203198
{
204199
global $db, $lang, $all_scripts;
205200

201+
static $options;
202+
206203
if (!is_array($all_scripts) ||
207204
empty($all_scripts)) {
208205
return $lang->asb_no_active_scripts;
209206
}
210207

211-
// prepare options for which groups
212-
$options = array($lang->asb_guests);
213-
$groups = array();
208+
if (!is_array($options)) {
209+
// prepare options for which groups
210+
$options = array($lang->asb_guests);
214211

215-
// look for all groups except Super Admins
216-
$query = $db->simple_select('usergroups', 'gid, title', "gid != '1'", array('order_by' => 'gid'));
217-
while ($usergroup = $db->fetch_array($query)) {
218-
// store the titles by group id
219-
$options[(int)$usergroup['gid']] = $usergroup['title'];
212+
// look for all groups except Super Admins
213+
$query = $db->simple_select('usergroups', 'gid, title', "gid != '1'", array('order_by' => 'gid'));
214+
while ($usergroup = $db->fetch_array($query)) {
215+
// store the titles by group id
216+
$options[(int)$usergroup['gid']] = $usergroup['title'];
217+
}
220218
}
219+
221220
$group_count = $all_group_count = count($options);
222221

223222
$groups = $sidebox->get('groups');
@@ -367,7 +366,8 @@ function asb_build_theme_visibility_list($sidebox, $colspan, $global)
367366
function asb_build_sidebox_info($sidebox, $wrap = true, $ajax = false)
368367
{
369368
// must be a valid object
370-
if ($sidebox instanceof SideboxObject == false) {
369+
if ($sidebox instanceof SideboxObject == false ||
370+
!$sidebox->isValid()) {
371371
return false;
372372
}
373373

@@ -379,7 +379,7 @@ function asb_build_sidebox_info($sidebox, $wrap = true, $ajax = false)
379379
$module = $sidebox->get('box_type');
380380

381381
// visibility table
382-
$visibility = '<span class="custom info">' . asb_build_permissions_table($id) . '</span>';
382+
$visibility = '<span class="custom info">' . asb_build_permissions_table($sidebox) . '</span>';
383383

384384
// edit link
385385
$edit_link = $html->url(array("action" => 'edit_box', "id" => $id, "addon" => $module, "pos" => $pos));

Upload/inc/plugins/asb/functions_addon.php

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ function asb_strip_quotes($message)
1717
{
1818
// Assign pattern and replace values.
1919
$pattern = array(
20-
"#\[quote=([\"']|&quot;|)(.*?)(?:\\1)(.*?)(?:[\"']|&quot;)?\](.*?)\[/quote\](\r\n?|\n?)#esi",
20+
"#\[quote=([\"']|&quot;|)(.*?)(?:\\1)(.*?)(?:[\"']|&quot;)?\](.*?)\[/quote\](\r\n?|\n?)#si",
2121
"#\[quote\](.*?)\[\/quote\](\r\n?|\n?)#si",
2222
"#\[\/quote\](\r\n?|\n?)#si"
2323
);
@@ -26,11 +26,7 @@ function asb_strip_quotes($message)
2626
$message = preg_replace($pattern, '', $message, -1, $count);
2727
} while($count);
2828

29-
$find = array(
30-
"#(\r\n*|\n*)<\/cite>(\r\n*|\n*)#",
31-
"#(\r\n*|\n*)<\/blockquote>#"
32-
);
33-
return preg_replace($find, '', $message);
29+
return $message;
3430
}
3531

3632
/**

Upload/inc/plugins/asb/modules/birthdays.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -138,9 +138,12 @@ function asb_birthdays_get_birthdays($args)
138138
}
139139

140140
$userAvatarList = implode(',', $userAvatarList);
141-
$query = $db->simple_select('users', 'uid, avatar, avatardimensions', "uid IN({$userAvatarList})");
142-
while ($user = $db->fetch_array($query)) {
143-
$userAvatars[$user['uid']] = format_avatar($user['avatar'], $user['avatardimensions'], '20x20');
141+
if (!empty($userAvatarList)) {
142+
$query = $db->simple_select('users', 'uid, avatar, avatardimensions', "uid IN({$userAvatarList})");
143+
144+
while ($user = $db->fetch_array($query)) {
145+
$userAvatars[$user['uid']] = format_avatar($user['avatar'], $user['avatardimensions'], '20x20');
146+
}
144147
}
145148

146149
$alreadyDone = array();

Upload/inc/plugins/asb/modules/welcome_box.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ function asb_welcome_box_info()
3030
'title' => $lang->asb_welcome,
3131
'description' => $lang->asb_welcome_desc,
3232
'wrap_content' => true,
33-
'version' => '1.3.2',
33+
'version' => '1.3.4',
3434
'compatibility' => '2.1',
3535
'templates' => array(
3636
array(
@@ -61,10 +61,11 @@ function asb_welcome_box_info()
6161
<span class="smalltext">{\$lang->asb_welcome_guest_welcome_registration}</span><br />
6262
<br />
6363
<form method="post" action="{\$mybb->settings[\'bburl\']}/member.php"><input type="hidden" name="action" value="do_login"/>
64+
<input name="my_post_key" type="hidden" value="{\$mybb->post_code}" />
6465
<input type="hidden" name="url" value="member.php"/>
65-
{\$username}<br />&nbsp;&nbsp;<input style="width: 95%;" type="text" class="textbox" name="username"/><br /><br />
66-
{\$lang->password}<br />&nbsp;&nbsp;<input style="width: 95%;" type="password" class="textbox" name="password"/><br /><br />
67-
<label title="{\$lang->remember_me_desc}"><input type="checkbox" class="checkbox" name="remember" value="yes"/> {\$lang->asb_welcome_remember_me}</label><br /><br />
66+
{\$username}<br /><input style="width: 95%;" type="text" class="textbox" name="username"/><br /><br />
67+
{\$lang->password}<br /><input style="width: 95%;" type="password" class="textbox" name="password"/><br /><br />
68+
<label title="{\$lang->remember_me_desc}"><input type="checkbox" class="checkbox" name="remember" value="yes"/> {\$lang->remember_me}</label><br /><br />
6869
<input type="submit" class="button" name="loginsubmit" value="{\$lang->login}"/>
6970
</form>
7071
EOF

Upload/inc/plugins/asb/upgrade.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,19 @@
113113
));
114114
}
115115

116+
/* < 3.1.12 */
117+
if (version_compare($asbOldVersion, '3.1.12', '<')) {
118+
$removedForumFiles = array_merge($removedForumFiles, array(
119+
'inc/plugins/asb/classes/WildcardPluginInstaller010202.php',
120+
'inc/plugins/asb/classes/PortableObject010000.php',
121+
));
122+
}
123+
124+
/* < 3.1.13 */
125+
if (version_compare($asbOldVersion, '3.1.13', '<')) {
126+
$removedForumFiles[] = 'inc/plugins/asb/classes/WildcardPluginInstaller010302.php';
127+
}
128+
116129
if (!empty($removedForumFiles)) {
117130
foreach ($removedForumFiles as $file) {
118131
@unlink(MYBB_ROOT . $file);

0 commit comments

Comments
 (0)