REPUTATION PLUGIN
this plugin shows a reputation for each user in user’s card:
For now this is showing just the received like but I will improve the rules for giving reputation and make some more complex algorithm than counting just received likes for reputation
This is my first plugin for discourse and this is the 0.1 version of this pluing and I hope I can develope this plugin with your helps.
I’m trying to develope this plugin to get the reputation calculation rules from admin in admin pannel
v0.2:
Outlet text conflict SOLVED
Showing s start image with “Your reputation” tooltip
special thanks from cakeday’s author. I learned many things from his plugin.
I would look into getting the Likes Given count from one of the tables instead of an AJAX request. If for only your own site, it might not be a problem. But it is possible for a site to set the Summary page to logged in only, which could cause a problem.
AFAICT there are 3 tables that have Likes Given counts.
One is directory_items.likes_received (the Users page) but that can also be logged in only, and it has various period_type’s
Another is user_stats.likes_received (the Summary page)
The other is user_actions.action_type where user_actions.action_type = 2
and it would need to do a COUNT query.
I used the helper file to read the DOM. I guess it could do AJAX as well, but if a site required being logged in you would need to pass that along somehow.
Offhand I know of three plugins that work with he database. Each has SQL stuff in its the top level plugin.rb file in heredoc syntax.
Having h tags inside of span tags is not valid HTML so it seems senseless to try and apply CSS fixes to it. Though perhaps changing the plugin template divs to spans might improve the display as div tags inside of span tags is not valid HTML either.
I know work is being done with how plugin-outlets will work so probably best to wait until that settles down and concentrate on other areas of your plugin for the time being.
If you have your template output an element with a class value, you can use CSS in your assets/stylesheets folder to get it to the far right side of the card.
Not the best solution and it will likely break at some time in the future, but you should be able to see at least some of it without it being obscured or needing to look in view-source.