I am looking to have badges similar to the site:
http://www.gotfrag.com/cs/story/33702/?cpage=1
If you scroll down you will notice that the users that have the "Prime" membership, get a "P" next to their name when they post. I would a similar thing on my site. Any suggestions on the code to use, and where I should put it?
Thanks,
Nick
Comments
Comment #1
heine commented- A fully loaded user object ($account = user_load(array('uid' => $uid))) will give you access to the badges via $account->badges[], indexed on badge id (so if you know what id the 'p' has you can use that.
- A faster alternative is user_badges_get_badges($uid) that gives you an array of badges for $uid.
- Both user_badges_for_uid and user_badges_for_user return an html representation of all badges
You can theme badges via theme('user_badge', $badge).
Comment #2
heine commentedlet's try that again
.
- A fully loaded user object ($account = user_load(array('uid' => $uid))) will give you access to the badges via $account->badges[], indexed on badge id (so if you know what id the 'p' has you can use that.
- A faster alternative is user_badges_get_badges($uid) that gives you an array of badges for $uid.
- Both user_badges_for_uid and user_badges_for_user return an html representation of all badges
You can theme badges via theme('user_badge', $badge).
Comment #3
heine commentedComment #4
(not verified) commented