Skip to content

Commit

Permalink
Merge pull request #349 from WildcardSearch/maintenance
Browse files Browse the repository at this point in the history
3.1.16 Release
  • Loading branch information
Mark Vincent authored Oct 14, 2018
2 parents e94ec9c + bac11a3 commit 42a0ea2
Show file tree
Hide file tree
Showing 13 changed files with 68 additions and 68 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Advanced-Sidebox 3.1.15
## Advanced-Sidebox 3.1.16

<p align="center">
<img title="Advanced Sidebox Logo" alt="Advanced Sidebox Logo" src="http://i.imgur.com/4QWLq5V.png" />
Expand Down
2 changes: 1 addition & 1 deletion Upload/inc/plugins/asb.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.15');
define('ASB_VERSION', '3.1.16');
define('ASB_CUSTOM_VERSION', '2.0');
define('ASB_SCRIPT_VERSION', '2.0');

Expand Down
16 changes: 8 additions & 8 deletions Upload/inc/plugins/asb/classes/AdvancedSideboxCache.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,28 +72,28 @@ public function buildCache(&$data)
$data['has_changed'] = false;

// get all the active scripts' info
$all_scripts = asb_get_all_scripts();
$allScripts = asbGetAllScripts();

// no scripts, no work to do
if (!is_array($all_scripts) ||
empty($all_scripts)) {
if (!is_array($allScripts) ||
empty($allScripts)) {
return;
}

// store the script definitions and a master list
foreach ($all_scripts as $filename => $script) {
foreach ($allScripts as $filename => $script) {
$data['scripts'][$filename] = $script;
}
$data['all_scripts'] = array_keys($all_scripts);
$data['all_scripts'] = array_keys($allScripts);

// load all detected modules
$addons = asb_get_all_modules();
$addons = asbGetAllModules();

// get any custom boxes
$custom = asb_get_all_custom();
$custom = asbGetAllCustomBoxes();

// get any sideboxes
$sideboxes = asb_get_all_sideboxes();
$sideboxes = asbGetAllSideBoxes();

if (!is_array($sideboxes) ||
empty($sideboxes)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ static public function getInstance()
* @param string path to the install data
* @return void
*/
public function __construct($path = '')
public function __construct($path='')
{
parent::__construct(MYBB_ROOT.'inc/plugins/asb/install_data.php');
}
Expand Down
10 changes: 5 additions & 5 deletions Upload/inc/plugins/asb/classes/CustomSidebox.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class CustomSidebox extends PortableObject010001
* @param array|int data or id
* @return void
*/
public function __construct($data = '')
public function __construct($data='')
{
$this->noStore[] = 'baseName';
parent::__construct($data);
Expand All @@ -72,7 +72,7 @@ public function load($data)
* @param bool prevent removal of sideboxes of this type?
* @return bool success/fail
*/
public function remove($noCleanup = false)
public function remove($noCleanup=false)
{
// unless specifically requested otherwise clean up
if (!$noCleanup) {
Expand Down Expand Up @@ -106,11 +106,11 @@ public function buildTemplate($template_variable)
global $$template_variable, $mybb, $lang;

$content = $this->content;
$ret_val = true;
$returnVal = true;

// if the user doesn't want content then at least make it validate
if (strlen($content) == 0) {
$ret_val = false;
$returnVal = false;
$content = '
<tr>
<td></td>
Expand All @@ -119,7 +119,7 @@ public function buildTemplate($template_variable)
$content = str_replace("\\'", "'", addslashes($content));
eval("\${$template_variable} = \"{$content}\";");
}
return $ret_val;
return $returnVal;
}
}

Expand Down
34 changes: 17 additions & 17 deletions Upload/inc/plugins/asb/classes/SideboxExternalModule.php
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ public function load($module)
* @param bool remove install data before beginning?
* @return void
*/
public function install($cleanup = true)
public function install($cleanup=true)
{
global $db;

Expand All @@ -162,7 +162,7 @@ public function install($cleanup = true)
return;
}

$insert_array = array();
$insertArray = array();
foreach ($this->templates as $template) {
$template['sid'] = -2;
$query = $db->simple_select('templates', '*', "title='{$template['title']}' AND sid IN('-2', '-1')");
Expand All @@ -172,12 +172,12 @@ public function install($cleanup = true)
$db->update_query('templates', $template, "title='{$template['title']}' AND sid IN('-2', '-1')");
} else {
// if not, create a new template
$insert_array[] = $template;
$insertArray[] = $template;
}
}

if (!empty($insert_array)) {
$db->insert_query_multiple('templates', $insert_array);
if (!empty($insertArray)) {
$db->insert_query_multiple('templates', $insertArray);
}
}

Expand All @@ -188,7 +188,7 @@ public function install($cleanup = true)
* @param bool remove children
* @return void
*/
public function uninstall($cleanup = true)
public function uninstall($cleanup=true)
{
$this->unsetCacheVersion();

Expand All @@ -203,15 +203,15 @@ public function uninstall($cleanup = true)
}

// remove them all
$delete_list = $sep = '';
$deleteList = $sep = '';
foreach ($this->templates as $template) {
$delete_list .= "{$sep}'{$template['title']}'";
$deleteList .= "{$sep}'{$template['title']}'";
$sep = ',';
}

if ($delete_list) {
if ($deleteList) {
global $db;
$db->delete_query('templates', "title IN({$delete_list})");
$db->delete_query('templates', "title IN({$deleteList})");
}
}

Expand All @@ -232,14 +232,14 @@ protected function upgrade()
// if any templates were dropped in this version
if (is_array($this->discarded_templates)) {
// delete them
$delete_list = $sep = '';
$deleteList = $sep = '';
foreach ($this->discarded_templates as $template) {
$delete_list .= "{$sep}'{$template}'";
$deleteList .= "{$sep}'{$template}'";
$sep = ',';
}

if ($delete_list) {
$db->delete_query('templates', "title IN({$delete_list})");
if ($deleteList) {
$db->delete_query('templates', "title IN({$deleteList})");
}
}

Expand Down Expand Up @@ -438,9 +438,9 @@ public function doSettingsLoad()
*/
public function doSettingsSave($settings)
{
$retval = $this->run('settings_save', $settings);
if ($retval) {
return $retval;
$returnVal = $this->run('settings_save', $settings);
if ($returnVal) {
return $returnVal;
}
return $settings;
}
Expand Down
2 changes: 1 addition & 1 deletion Upload/inc/plugins/asb/classes/SideboxObject.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ class SideboxObject extends StorableObject010000
* @param array|int data or id
* @return void
*/
function __construct($data = '')
function __construct($data='')
{
$this->noStore[] = 'hasSettings';
parent::__construct($data);
Expand Down
14 changes: 7 additions & 7 deletions Upload/inc/plugins/asb/modules/latest_threads.php
Original file line number Diff line number Diff line change
Expand Up @@ -275,13 +275,13 @@ function asb_latest_threads_get_threadlist($settings, $width)
}

// build the exclude conditions
$show['fids'] = asb_build_id_list($settings['forum_show_list'], 't.fid');
$show['tids'] = asb_build_id_list($settings['thread_show_list'], 't.tid');
$hide['fids'] = asb_build_id_list($settings['forum_hide_list'], 't.fid');
$hide['tids'] = asb_build_id_list($settings['thread_hide_list'], 't.tid');
$where['show'] = asb_build_SQL_where($show, ' OR ');
$where['hide'] = asb_build_SQL_where($hide, ' OR ', ' NOT ');
$query_where = $new_threads.$important_threads.$unviewwhere.$inactivewhere.asb_build_SQL_where($where, ' AND ', ' AND ');
$show['fids'] = asbBuildIdList($settings['forum_show_list'], 't.fid');
$show['tids'] = asbBuildIdList($settings['thread_show_list'], 't.tid');
$hide['fids'] = asbBuildIdList($settings['forum_hide_list'], 't.fid');
$hide['tids'] = asbBuildIdList($settings['thread_hide_list'], 't.tid');
$where['show'] = asbBuildSqlWhere($show, ' OR ');
$where['hide'] = asbBuildSqlWhere($hide, ' OR ', ' NOT ');
$query_where = $new_threads.$important_threads.$unviewwhere.$inactivewhere.asbBuildSqlWhere($where, ' AND ', ' AND ');

$altbg = alt_trow();
$threadlist = '';
Expand Down
16 changes: 8 additions & 8 deletions Upload/inc/plugins/asb/modules/rand_quote.php
Original file line number Diff line number Diff line change
Expand Up @@ -229,13 +229,13 @@ function asb_rand_quote_get_quote($settings, $width)
}

// build the exclude conditions
$show['fids'] = asb_build_id_list($settings['forum_show_list'], 'p.fid');
$show['tids'] = asb_build_id_list($settings['thread_show_list'], 'p.tid');
$hide['fids'] = asb_build_id_list($settings['forum_hide_list'], 'p.fid');
$hide['tids'] = asb_build_id_list($settings['thread_hide_list'], 'p.tid');
$where['show'] = asb_build_SQL_where($show, ' OR ');
$where['hide'] = asb_build_SQL_where($hide, ' OR ', ' NOT ');
$query_where = $important_threads.$unviewwhere.$inactivewhere.asb_build_SQL_where($where, ' AND ', ' AND ');
$show['fids'] = asbBuildIdList($settings['forum_show_list'], 'p.fid');
$show['tids'] = asbBuildIdList($settings['thread_show_list'], 'p.tid');
$hide['fids'] = asbBuildIdList($settings['forum_hide_list'], 'p.fid');
$hide['tids'] = asbBuildIdList($settings['thread_hide_list'], 'p.tid');
$where['show'] = asbBuildSqlWhere($show, ' OR ');
$where['hide'] = asbBuildSqlWhere($hide, ' OR ', ' NOT ');
$query_where = $important_threads.$unviewwhere.$inactivewhere.asbBuildSqlWhere($where, ' AND ', ' AND ');

$post_query = $db->query("
SELECT
Expand Down Expand Up @@ -265,7 +265,7 @@ function asb_rand_quote_get_quote($settings, $width)

// we just need the text and smilies (we'll parse them after we check length)
$pattern = "|[[\/\!]*?[^\[\]]*?]|si";
$new_message = asb_strip_url(preg_replace($pattern, '$1', $rand_post['message']));
$new_message = asbStripUrls(preg_replace($pattern, '$1', $rand_post['message']));

// get some dimensions that make sense in relation to column width
$asb_width = (int) $width;
Expand Down
16 changes: 8 additions & 8 deletions Upload/inc/plugins/asb/modules/recent_posts.php
Original file line number Diff line number Diff line change
Expand Up @@ -196,13 +196,13 @@ function recent_posts_get_postlist($settings)
}

// build the exclude conditions
$show['fids'] = asb_build_id_list($settings['forum_show_list'], 'p.fid');
$show['tids'] = asb_build_id_list($settings['thread_show_list'], 'p.tid');
$hide['fids'] = asb_build_id_list($settings['forum_hide_list'], 'p.fid');
$hide['tids'] = asb_build_id_list($settings['thread_hide_list'], 'p.tid');
$where['show'] = asb_build_SQL_where($show, ' OR ');
$where['hide'] = asb_build_SQL_where($hide, ' OR ', ' NOT ');
$query_where = $important_threads.$unviewwhere.$inactivewhere.asb_build_SQL_where($where, ' AND ', ' AND ');
$show['fids'] = asbBuildIdList($settings['forum_show_list'], 'p.fid');
$show['tids'] = asbBuildIdList($settings['thread_show_list'], 'p.tid');
$hide['fids'] = asbBuildIdList($settings['forum_hide_list'], 'p.fid');
$hide['tids'] = asbBuildIdList($settings['thread_hide_list'], 'p.tid');
$where['show'] = asbBuildSqlWhere($show, ' OR ');
$where['hide'] = asbBuildSqlWhere($hide, ' OR ', ' NOT ');
$query_where = $important_threads.$unviewwhere.$inactivewhere.asbBuildSqlWhere($where, ' AND ', ' AND ');

$altbg = alt_trow();
$maxtitlelen = 48;
Expand Down Expand Up @@ -272,7 +272,7 @@ function recent_posts_get_postlist($settings)

// we just need the text and smilies (we'll parse them after we check length)
$pattern = "|[[\/\!]*?[^\[\]]*?]|si";
$post_excerpt = strip_tags(str_replace('<br />', '', asb_strip_url(preg_replace($pattern, '$1', $post['message']))));
$post_excerpt = strip_tags(str_replace('<br />', '', asbStripUrls(preg_replace($pattern, '$1', $post['message']))));

if ($settings['max_length'] &&
strlen($post_excerpt) > $settings['max_length']) {
Expand Down
2 changes: 1 addition & 1 deletion Upload/inc/plugins/asb/modules/slideshow.php
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ function asb_slideshow_build_template($args)
$rate = (int) $settings['rate'] ? (int) $settings['rate'] : 10;
$fade_rate = (float) $settings['fade_rate'] ? (int) ($settings['fade_rate'] * 1000) : 400;

$filenames = asb_get_folder_images($folder, '', $settings['recursive']);
$filenames = asbGetImagesFromPath($folder, '', $settings['recursive']);
if (!$filenames) {
$$template_var = <<<EOF
<tr>
Expand Down
10 changes: 5 additions & 5 deletions Upload/inc/plugins/asb/modules/staff_online_box.php
Original file line number Diff line number Diff line change
Expand Up @@ -170,11 +170,11 @@ function asb_staff_online_box_get_online_staff($settings, $width)
$users = array();

// build user group exclusions (if any)
$show = asb_build_id_list($settings['group_show_list'], 'gid');
$hide = asb_build_id_list($settings['group_hide_list'], 'gid');
$where['show'] = asb_build_SQL_where($show, ' OR ');
$where['hide'] = asb_build_SQL_where($hide, ' OR ', ' NOT ');
$group_where = asb_build_SQL_where($where, ' AND ', ' AND ');
$show = asbBuildIdList($settings['group_show_list'], 'gid');
$hide = asbBuildIdList($settings['group_hide_list'], 'gid');
$where['show'] = asbBuildSqlWhere($show, ' OR ');
$where['hide'] = asbBuildSqlWhere($hide, ' OR ', ' NOT ');
$group_where = asbBuildSqlWhere($where, ' AND ', ' AND ');

// get all the groups admin has specified should be shown on showteam.php
$query = $db->simple_select('usergroups', 'gid, title, usertitle, image', "showforumteam=1{$group_where}", array('order_by' => 'disporder'));
Expand Down
10 changes: 5 additions & 5 deletions Upload/inc/plugins/asb/modules/top_poster.php
Original file line number Diff line number Diff line change
Expand Up @@ -211,11 +211,11 @@ function asb_top_poster_build_template($args)
}

// build user group exclusions (if any)
$show = asb_build_id_list($settings['group_show_list'], 'u.usergroup');
$hide = asb_build_id_list($settings['group_hide_list'], 'u.usergroup');
$where['show'] = asb_build_SQL_where($show, ' OR ');
$where['hide'] = asb_build_SQL_where($hide, ' OR ', ' NOT ');
$group_where = asb_build_SQL_where($where, ' AND ', ' AND ');
$show = asbBuildIdList($settings['group_show_list'], 'u.usergroup');
$hide = asbBuildIdList($settings['group_hide_list'], 'u.usergroup');
$where['show'] = asbBuildSqlWhere($show, ' OR ');
$where['hide'] = asbBuildSqlWhere($hide, ' OR ', ' NOT ');
$group_where = asbBuildSqlWhere($where, ' AND ', ' AND ');

$forum_where = $thread_where = $extraCongrats = '';
$tid = (int) $settings['tid'];
Expand Down

0 comments on commit 42a0ea2

Please sign in to comment.