Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Displaying Ranks in Posts & User Profile
phyroxis
New
Before my question: Yaga is awesome. It is a dealmaker for my site deploying Vanilla. Thank you so much for this addon! I really like Ranks, and will be using them to structure our guild.
The Question: How can we display ranks on user profiles and, more importantly, posts (similar to the MyYagaPoints or YagaDiscussionHeaderBadges plugins)?
Tagged:
0
Comments
Thanks for trying my addon!
You can get the RankID from the User object. From there, you can get a list of the ranks from the rank model. A rough sketch of how to do this via a plugin would be as follows:
It would probably be a good idea to cache the rank list locally and just traverse the dataset to reduce db reads per page.
Search first
Check out the Documentation! We are always looking for new content and pull requests.
Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.
an example is worth a thousand words if you got the time
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
I actually misspoke slightly. I meant use the cached rank list and traverse locally. Something like the following:
I might add a method returning a cached array indexed by ID of badges, ranks, and actions in their respective models. Definitely make writing plugins easier. Any DB gurus want to chime in?
Search first
Check out the Documentation! We are always looking for new content and pull requests.
Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.
@hgtonight how i cant show the ranks in the comments too, becouse i can only see in the 1st post
@multplaneta I am seeing ranks on all comments and in the first post.
Search first
Check out the Documentation! We are always looking for new content and pull requests.
Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.
@phyroxis Just wanted to let you know that I packaged this as a plugin here: http://vanillaforums.org/addon/yagarankinmeta-plugin
Search first
Check out the Documentation! We are always looking for new content and pull requests.
Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.
@hgtonight Thanks for the quick reply, for my only show in the first post, maybe i do something wrong, i will try your Rank in Meta Plugin.
What theme are you using?
Search first
Check out the Documentation! We are always looking for new content and pull requests.
Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.
@hgtonight iam using Bootstrap version 2.2.2
@hgtonight I test your plugin and work, now i can see in all posts, thanks!