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
// 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
} 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]);
}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" />';
$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>';
}
++$count;
$group_stars .= '</table></li>';
}
}
// xxx end changed for awards