Posted by Ayesh on February 3, 2011 at 12:11am
2 followers
Jump to:
| Project: | User Badges |
| Version: | 6.x-1.6 |
| Component: | Documentation |
| Category: | feature request |
| Priority: | minor |
| Assigned: | Unassigned |
| Status: | active |
Issue Summary
I'm planning to add badges of users with their signature using Signture Forum module.
SF module gives a php-enabled text area to put any code. So I will use that box to put the code.
How do I show badge of current piece of content ?
To explain more,
I want to show node author's badge below the node, and commenters' badges below their comment.
I read the documentation. It says use $node->$uid or $comment->$uid. But how do I put the badge regardless of the contents' type ?(regardless of it's a node or comment)
Comments
#1
Currently, this module doesn't show the badges in content; you have to do it. For nodes, that would be in hook_nodeapi() and for comments you would do it in hook_comment(). Just call
user_badges_for_user(array('uid' => $node->uid))(or $comment).So, now I expect you to come back with changing this to a "feature request?"
#2
And I came with requesting this feature.
I added the 2 lines of code to node.tpl.php with $node->uid and it worked!
Also, I could do the exact thing with Views+arguments.
My feature request is, enable admins to print the badge in content through php code or filter.
If the php code is the best way, those who want to use it with signature or where signature appear can use Signature Forum.
If filter method is better, something like [uid:badge] in content would print the badge in content.
#3
I think it is perfectly reasonable for me to add a hook_nodeapi() implementation to show the author's badges in the content (with a configurable weight). I just want to figure out how to not overload the module with things most people don't want/need. The filter method is interesting as well, but I suspect even fewer people would use it.
I am not familiar with Signature Forum itself, but I can probably make a reasonable assumption about how it is used, and that may be where the filter method works best.
I also maintain the Submitted By module; providing tokens for that module makes a lot of sense and shouldn't be much overhead. It may also be a better solution than Signature Forum for most who are looking at that.
#4
Yes, I agree that most users need the normal badge display in user profile and author pane.
The actual use case is, I wanted to add some "company reply" text in an image for some users of role. I found that Badges is the best way do it.
Yes, you are genious! "Submited By" could do the trick. Providing a token is the best way to do this!
#5
I changed the priority to low because we guessed that the number of users who like this request is low. But I really encourage and hoping to help you to do this.
Thanks for your contributions..