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

@ -1133,25 +1133,28 @@ function loadMemberContext($user, $display_custom_fields = false)
// xxx changed for awards // xxx changed for awards
// orig: // orig:
// $profile['stars'] = empty($profile['stars']) ? array('', '') : explode('#', $profile['stars']); // $profile['stars'] = empty($profile['stars']) ? array('', '') : explode('#', $profile['stars']);
if(empty($profile['stars'])){ if (empty($profile['stars'])) {
$group_stars = ''; $group_stars = '';
}else{ } else {
$stars = array(); $stars = explode(';', $profile['stars']);
$count = 0; $star = explode('#', $stars[0]);
foreach (explode(';', $profile['stars']) as $star){ $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]);
$star = explode('#', $star); $badges = array_shift($stars);
if($count == 0){ // original stars if (count($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]); $group_stars .= '</li><li><table>';
}else{ // awards $count = 0;
// # $star[0] is number of images foreach ($stars as $badge) {
// but in this case, it specifies whether the award is to be shown $badge = explode('#', $badge);
// on mitb.com, mscp.org, or both if ($count % 3 == 0)
// 1 = both, 2 = mscp, 3 = mitb $group_stars .= '<tr>';
// 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 .= '<td><img src="' . str_replace('$language', $context['user']['language'], isset($badge[1]) ? $settings['images_url'] . '/' . $badge[1] : '') . '" alt="*" border="0" /></td>';
$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++;
} if ($count % 3 == 0)
++$count; $group_stars .= '</tr>';
}
$group_stars .= '</table></li>';
} }
} }
// xxx end changed for awards // xxx end changed for awards