function user_badges_for_uid in User Badges 5
Same name and namespace in other branches
- 6.2 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
File
- ./
user_badges.module, line 793 - @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);
}
$cache[$uid] = isset($badges) ? theme('user_badge_group', $badges) : '';
return $cache[$uid];
}
}
}