Discourse Voting

This plugin is the result of the spec put together by @erlend_sh.

It gives you the ability to vote on topics in a specified category. To enable it, edit any category, look on the settings tab for the “Allow users to vote on topics in this category” checkbox:

Once enabled, the topics in that category can be voted on with the count of votes added next to the topic title.

The vote count is also included next to the title when scrolled.

To make it easier to see vote counts from a topic list, the vote count is also added under the topic titles.

Here are the views you’ll see given different states of the user and topic:

There is also a section in the user’s profile page that displays their active votes:

A few points about the backend:

  • The number of active votes is configurable and defaults to 10.
  • If the topic is closed or archived, the votes are released to the users and can be applied to other topics but the vote count on the topic remains.
  • If a topic is re-opened or unarchived, the votes are reclaimed and applied back to the users active vote count.
  • If a topic reclaims the votes of a user and they go over their limit, they simply need to wait until topics are closed or archived to allow them to vote again.

You can find the repo here:

A couple things I’m interested in as next steps:

  • Create a section for the user to see their active and archived votes.
  • Allow moderators/staff/admins to see who has voted on a topic.

Data Explorer Queries

List people who voted for a topic along with their email addresses:

-- [params]
-- int :topic_id = 1

SELECT user_custom_fields.user_id, email FROM user_custom_fields 
LEFT JOIN user_emails 
ON user_custom_fields.user_id = user_emails.user_id
WHERE name IN ('votes', 'votes_archive') 
AND value = (:topic_id)::text
Suggestion: display vote/like counter in main page
Displaying "Likes" more prominently
Building an Amazon Discourse pilot, planning for scale
Plugin: Feature voting separated from Likes
Two new plugin outlets - user_activity_bottom and user_menu_glyphs
Overwriting controllers in plugin
Are there Upvotes/Downvotes, Score for the Posts?
Mounting widget in raw template?
Alternative Voting Category Style
Poll in restricted topic where users can’t reply
Question Answer Plugin
Thoughts on a plugin which turns discourse into stackoverflow
Ratings instead of Hearts for Likes
Topics that were voted on disappear from user profile after being closed
Question Answer Plugin
ProCourse Support
Is it possible to do Uservoice style voting with the voting plugin
Advice for getting my little game dev community "out there?"
I need someone who can install a voting plugin
Multiple Choice Poll questions
Is there any plugin for downvoting questions and replies in Discourse
Comment on a question instead of answering it
Voting vs Likes for feature requests
Votes not being released after close
UserVoice vs Discourse
Rake task for merging users
Some things I've built which you can use
Introducing ProCourse
Feature request: Poll with ability for user to add their own options
Approach to a Nominate Post Button?
Promote or demote suggestions
About the voting category
Muted topics still notifying me on Meta
Hook for a topic's category id?
A new versioned API for client side plugins
Multiple topics in single API request
Some plugins not working after upgrade
A tour of how the Widget (Virtual DOM) code in Discourse works
Liking own posts — a specific use case of discourse
Plugin: Feature voting separated from Likes
Wanted: Discourse Hacker News Plugin
Excluding Suspended, Silenced and Suspect Users When Exporting
Voting/ideation feature
Restricting poll creation to Trust Levels
Prospective Feature: Highlight Posts That Surpass Defined "Likes" Threshold
Looking to switch from Vanilla, and have a few questions
Ranking of post, based on user upvotes
Show votes in post list "totals" columns

All discussion relating to the voting plugin belongs at #plugin:voting category.

Please do not reply here, leaving this open so “voting” plugin does not appear to be closed.