Changed postbit layout of badges to a 3xN border-less layout.

This commit is contained in:
Anthony Calandra 2014-07-24 18:18:14 -04:00 committed by Anthony Calandra
parent 61d12521a8
commit d0fd6945d5

View File

@ -1129,33 +1129,36 @@ function loadMemberContext($user, $display_custom_fields = false)
$profile['signature'] = parse_bbc($profile['signature'], true, 'sig' . $profile['id_member']);
$profile['is_online'] = (!empty($profile['show_online']) || allowedTo('moderate_forum')) && $profile['is_online'] > 0;
// xxx changed for awards
// orig:
// $profile['stars'] = empty($profile['stars']) ? array('', '') : explode('#', $profile['stars']);
if(empty($profile['stars'])){
if (empty($profile['stars'])) {
$group_stars = '';
}else{
$stars = array();
$count = 0;
foreach (explode(';', $profile['stars']) as $star){
$star = explode('#', $star);
if($count == 0){ // original stars
$group_stars = str_repeat('<img src="' . str_replace('$language', $context['user']['language'], isset($star[1]) ? $settings['images_url'] . '/' . $star[1] : '') . '" alt="*" border="0" />', empty($star[0]) || empty($star[1]) ? 0 : $star[0]);
}else{ // awards
// # $star[0] is number of images
// but in this case, it specifies whether the award is to be shown
// on mitb.com, mscp.org, or both
// 1 = both, 2 = mscp, 3 = mitb
// otherwise it will be equal to $award_id
//if( ($star[0] == 1) || ($star[0] == 2 && defined('MSCP')) || ($star[0] == 3 && !defined('MSCP')) || $star[0] == $award_id)
$group_stars .= "</li>\n\t\t\t\t\t\t".'<li><img src="' . str_replace('$language', $context['user']['language'], isset($star[1]) ? $settings['images_url'] . '/' . $star[1] : '') . '" alt="*" border="0" />';
}
++$count;
} else {
$stars = explode(';', $profile['stars']);
$star = explode('#', $stars[0]);
$group_stars = str_repeat('<img src="' . str_replace('$language', $context['user']['language'], isset($star[1]) ? $settings['images_url'] . '/' . $star[1] : '') . '" alt="*" border="0" />', empty($star[0]) || empty($star[1]) ? 0 : $star[0]);
$badges = array_shift($stars);
if (count($stars) > 0) {
$group_stars .= '</li><li><table>';
$count = 0;
foreach ($stars as $badge) {
$badge = explode('#', $badge);
if ($count % 3 == 0)
$group_stars .= '<tr>';
$group_stars .= '<td><img src="' . str_replace('$language', $context['user']['language'], isset($badge[1]) ? $settings['images_url'] . '/' . $badge[1] : '') . '" alt="*" border="0" /></td>';
$count++;
if ($count % 3 == 0)
$group_stars .= '</tr>';
}
$group_stars .= '</table></li>';
}
}
// xxx end changed for awards
// Setup the buddy status here (One whole in_array call saved :P)
$profile['buddy'] = in_array($profile['id_member'], $user_info['buddies']);
$buddy_list = !empty($profile['buddy_list']) ? explode(',', $profile['buddy_list']) : array();
@ -2817,4 +2820,4 @@ function get_memcached_server($level = 3)
get_memcached_server($level - 1);
}
?>
?>