Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

3.1.11 Release #296

Merged
merged 2 commits into from Jan 17, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
@@ -1,4 +1,4 @@
## Advanced-Sidebox 3.1.10
## Advanced-Sidebox 3.1.11

<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
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.10');
define('ASB_VERSION', '3.1.11');
define('ASB_CUSTOM_VERSION', '2.0');
define('ASB_SCRIPT_VERSION', '2.0');

Expand Down
9 changes: 4 additions & 5 deletions Upload/inc/plugins/asb/modules/latest_threads.php
Expand Up @@ -326,17 +326,16 @@ function asb_latest_threads_get_threadlist($settings, $width)
$lastpostdate = my_date($mybb->settings['dateformat'], $thread['lastpost']);
$lastposttime = my_date($mybb->settings['timeformat'], $thread['lastpost']);

if (strlen(trim($thread['avatar'])) == 0) {
$thread['avatar'] = "{$theme['imgdir']}/default_avatar.png";
}

$settings['avatar_width'] = trim($settings['avatar_width']);
if (my_strpos($settings['avatar_width'], '%') == my_strlen($settings['avatar_width']) - 1) {
$settings['avatar_width'] = (int) $width * (my_substr($settings['avatar_width'], 0, my_strlen($settings['avatar_width']) - 1) / 100);
}
$avatar_width = (int) min($width / 2, max($width / 8, $settings['avatar_width']));

$avatarInfo = format_avatar($thread['avatar']);

$avatar = <<<EOF
<img src="{$thread['avatar']}" alt="{$thread['last_post']}" title="{$thread['lastposter']}'s profile" style="width: {$avatar_width}px;"/>
<img src="{$avatarInfo['image']}" alt="{$thread['last_post']}" title="{$thread['lastposter']}'s profile" style="width: {$avatar_width}px;"/>
EOF;

$formatted_name = format_name($thread['lastposter'], $thread['usergroup'], $thread['displaygroup']);
Expand Down
6 changes: 1 addition & 5 deletions Upload/inc/plugins/asb/modules/rand_quote.php
Expand Up @@ -303,11 +303,7 @@ function asb_rand_quote_get_quote($settings, $width)
$parser_options = array('allow_smilies' => 1);
$new_message = str_replace(array('<br />', '/me'), array('', " * {$plain_text_username}"), $parser->parse_message($new_message . ' ', $parser_options));

// if the user has an avatar then display it, otherwise force the default avatar.
$avatar_filename = "{$theme['imgdir']}/default_avatar.png";
if ($rand_post['avatar'] != '') {
$avatar_filename = $rand_post['avatar'];
}
$avatar_filename = format_avatar($rand_post['avatar'])['image'];

$avatar_alt = $lang->sprintf($lang->asb_random_quote_users_profile, $plain_text_username);

Expand Down
5 changes: 1 addition & 4 deletions Upload/inc/plugins/asb/modules/staff_online_box.php
Expand Up @@ -253,10 +253,7 @@ function asb_staff_online_box_get_online_staff($settings, $width)
$staff_avatar_alt = $staff_avatar_title = $user['username'] . '\'s profile';

// if the user has an avatar then display it, otherwise force the default avatar.
$staff_avatar_filename = "{$theme['imgdir']}/default_avatar.png";
if ($user['avatar'] != '') {
$staff_avatar_filename = $user['avatar'];
}
$staff_avatar_filename = format_avatar($user['avatar'])['image'];

// avatar properties
$staff_avatar_dimensions = '100%';
Expand Down
5 changes: 1 addition & 4 deletions Upload/inc/plugins/asb/modules/top_poster.php
Expand Up @@ -329,10 +329,7 @@ function asb_top_poster_build_template($args)
}
}

$top_poster_avatar_src = "{$theme['imgdir']}/default_avatar.png";
if ($user['avatar'] != '') {
$top_poster_avatar_src = $user['avatar'];
}
$top_poster_avatar_src = format_avatar($user['avatar'])['image'];

$settings['avatar_size'] = trim($settings['avatar_size']);
if (my_strpos($settings['avatar_size'], '%') == my_strlen($settings['avatar_size']) - 1) {
Expand Down
6 changes: 1 addition & 5 deletions Upload/inc/plugins/asb/modules/welcome_box.php
Expand Up @@ -141,11 +141,7 @@ function asb_welcome_box_build_template($args)

$avatar_width = (int) ($width / 5);

// if the user has an avatar then display it, otherwise force the default avatar.
$avatar_filename = "{$theme['imgdir']}/default_avatar.png";
if ($mybb->user['avatar'] != '') {
$avatar_filename = $mybb->user['avatar'];
}
$avatar_filename = format_avatar($mybb->user['avatar'])['image'];

$user_avatar = <<<EOF
<span style="float: right;"><img src="{$avatar_filename}" width="{$avatar_width}" alt="{$mybb->user['username']}'s profile"/>&nbsp;</span>
Expand Down
8 changes: 1 addition & 7 deletions Upload/inc/plugins/asb/modules/whosonline.php
Expand Up @@ -242,13 +242,7 @@ function asb_whosonline_get_online_members($settings, $width)
$user['profilelink'] = get_profile_link($user['uid']);

if ($settings['show_avatars']) {
// If the user has an avatar then display it . . .
if ($user['avatar'] != '') {
$avatar_filename = $user['avatar'];
} else {
// . . . otherwise force the default avatar.
$avatar_filename = "{$theme['imgdir']}/default_avatar.png";
}
$avatar_filename = format_avatar($user['avatar'])['image'];

$avatar_height_style = " min-height: {$avatar_height}px; max-height: {$avatar_height}px;";
$avatar_width_style = " min-width: {$avatar_width}px; max-width: {$avatar_width}px;";
Expand Down