Ok, I am not a big coder so this may be obvious for some.
I am having problems trying to get user's badges displayed elsewhere on the site (ie. Forum topics & comments)
I have found out that the following code displays badges but only for a specified user:
print user_badges_for_user(array('uid'=>$accountid));
How do I make this dynamic and place it in my PHPTemplate theme files to display where I want it (ie. Forum topics & comments)?
Any help is much appreciated!
-- Marand B.
Comments
Comment #1
Marandb commentedHmmm... No one?
-- Marand B.
Comment #2
heine commentedFor example
Comment #3
heine commentedThat last comment should have been // in comment.tpl.php uid of comment owner.
BTW: The new version of user_badges will have a user_badges_for_uid() that is much lighter on the database because:
1. It doesn't load the user object
2. It caches retrieved badges
Comment #4
Marandb commentedThank you. I will check out the newer version as well.
This should really help out my site.
-- Marand B.
Comment #5
theunraveler commentedHow do I get the user badges to appear next to the names of the users that are online in the "Who's Online" module? I tried to do it using modified versions of the code pasted above, but to no avail. Can anyone help me out?
Comment #6
heine commentedI've no idea what the 'who's online' module is. 4.6 just had the bugfixes from 4.7 applied and only just now has the user_badges_for_uid function (see http://drupal.org/node/28083#comment-118908. Remember that this was an issue against CVS, not 4.6!).
Please open new issues, instead of attaching to this one.
Comment #7
(not verified) commented