Hi,

i have installed the user badges module, and put the code in the node.tpl.php file and the badges show up fine for nodes.
However when i put the same code in the comment.tpl.php file the badges do not show up at all in the comment (thats for the same users that have badges when posting a node)

(if this helps, I put quotes around the function like this: print "user_badges_for_uid()", and it printed user_badges_for_uid() on the screen in the comment)

Does anyone know what could be happening?

Thanks,
-S

Comments

heine’s picture

What code did you use? Paste between <?php ?> tags

user_badges_for_uid doesn't automagically know what comment you are looking at. You need to pass the user id of the comment owner. For example: user_badges_for_uid($comment->uid).
--
The Manual | Troubleshooting FAQ | Tips for posting | Make Backups! | Consider creating a Test site.

reqIUm’s picture

I was using what was in the documentation:

print user_badges_for_uid($uid);

but now it works with the code you gave me. Thankyou very much!

-S

netceo’s picture

same problem, can u pls let me know the modified code?

NetCEO

reqIUm’s picture

Just put this line into your comment.tpl.php:

echo user_badges_for_uid($comment->uid);