function user_badges_for_uid in User Badges 6.2
Same name and namespace in other branches
- 5 user_badges.module \user_badges_for_uid()
- 6 user_badges.module \user_badges_for_uid()
- 7 user_badges.module \user_badges_for_uid()
- 7.2 user_badges.module \user_badges_for_uid()
- 7.3 user_badges.module \user_badges_for_uid()
Returns HTML representation of user badges for given uid
Parameters
$uid the user id: @param $refresh (FALSE) when TRUE, refreshes the cache for $uid
@return string html representation of userbadges
1 call to user_badges_for_uid()
File
- ./
user_badges.module, line 1002 - @brief User Badges module file
Code
function user_badges_for_uid($uid, $refresh = FALSE) {
static $cache;
if ($uid) {
if (isset($cache[$uid]) && !$refresh) {
return $cache[$uid];
}
else {
$user_badges = user_badges_get_badges($uid);
foreach ((array) $user_badges as $badge) {
$badges[] = theme('user_badge', $badge, user_load($uid));
}
$cache[$uid] = isset($badges) ? theme('user_badge_group', $badges) : '';
return $cache[$uid];
}
}
}