Discourse Topic Voting

:discourse2: Summary Discourse Topic Voting gives the ability to vote on topics in a specified category.[1]
:open_book: Install Guide This plugin is bundled with Discourse core. There is no need to install the plugin separately.

Features

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, a “Votes” item is available in the top menu. 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 a user will see before and after voting in a topic:

Screenshot 2024-05-13 at 10.08.17 AM Screenshot 2024-05-13 at 10.10.13 AM

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

Active Votes

The term Active Votes refers to the votes a user has cast in topics that are currently available for voting. Limiting Active Votes encourages users to vote thoughtfully for the topics that matter most to them.

  • The number of Active Votes available to each user is configurable by Trust Level. Default values:

    • TL0: 2
    • TL1: 4
    • TL2: 6
    • TL3: 8
    • TL4: 10
  • Each user may cast only one vote per topic.

  • When a topic is closed or archived, the vote count on the topic remains unchanged. These votes are no longer considered Active. The users who cast these votes will have their one vote from that topic restored to their pool of available votes.

  • 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, causing them to exceed their Active Vote limit, they simply need to wait until topics are closed or archived to allow them to vote again.

  • If an entire topic (Topic A) is merged into another Topic-Voting topic (Topic B), all the the following takes place:

    1. Unique votes from Topic A are added to Topic B.
    2. Duplicated votes (the same user voted in both topics) from Topic A will not be added to Topic B. Instead, the vote from Topic A will be restored to the user’s pool of available votes.
    3. Topic A’s vote count is set to zero and the topic is closed so that no further voting can take place in Topic A.

Settings

Name Description
topic voting alert votes left Alert user when this many votes are left
topic voting enabled Allow users to vote on topics?
topic voting show who voted Allow users to see who voted?
topic voting show votes on profile Allow users to see their votes in their activity feed?
topic voting tl0 vote limit How many active votes are TL0 users allowed?
topic voting tl1 vote limit How many active votes are TL1 users allowed?
topic voting tl2 vote limit How many active votes are TL2 users allowed?
topic voting tl3 vote limit How many active votes are TL3 users allowed?
topic voting tl4 vote limit How many active votes are TL4 users allowed?

Category Setting

topic voting category setting

EXTRAS

:information_source: In the categories where the Voting plugin is activated, Likes are automatically deactivated. Some sites may want to use both functions at the same time to like replies, see how to re-enable Likes.

Data Explorer Queries

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

--[params]
-- int :topic_id

SELECT
tvv.user_id,
email
FROM topic_voting_votes tvv
JOIN user_emails ue ON ue.user_id = tvv.user_id
WHERE topic_id = :topic_id
AND ue.primary = true

More explorer queries can be found in Data & reporting - Topics tagged topic-voting

:discourse2: Hosted by us? This plugin is available on our Business and Enterprise plans Topic Voting | Discourse - Civilized Discussion


  1. and is the result of this spec put together by @erlend_sh ↩︎

Last edited by @southpaw 2025-07-25T02:39:13Z

Check documentPerform check on document:
128 个赞

作为 Discourse Post Voting 插件重命名的一部分,我们也将其重命名以与之配套。 :partying_face: :slightly_smiling_face:

因此,我在此正式欢迎大家来到 Discourse Topic Voting 插件。:tada::balloon::champagne:

14 个赞

非常喜欢这个插件。我用它来管理一个专门用于博客文章的分类。启用此插件的分类时,是否可以按得票数降序对主题列表进行排序?

再次感谢!

1 个赞

2 篇帖子被拆分到一个新主题:关闭主题时未返回投票

我注意到在以下动画中

用户在点击投票后才发现

  • 他实际上只有有限数量的投票
  • 而且他现在只剩下 xx 张选票了

也许他应该在点击投票按钮之前的鼠标悬停提示中了解所有这些信息。

3 个赞

2 篇帖子已拆分为新主题:“查看投票者”显示问题](/t/see-who-voted-display-issue/306641)

为了使其更加正式,此插件的数据库表已迁移到 topic_voting_,以匹配 post_voting_ 中的表以及站点设置。

当站点所有者更新此插件时,使用旧表名的现有数据浏览器查询将自动更新以使用新表名。

6 个赞

如何重新启用投票主题的第一个帖子的 Discourse Reactions?

你尝试过重新启用点赞的技巧吗?

2 个赞

啊抱歉,我确实这样做了,但以为它不起作用,直到我意识到我正在查看自己的帖子,所以我不应该期望看到点赞按钮 :laughing:

2 个赞

有没有办法将投票按钮直接添加到主题列表中?

1 个赞

这可能就是您要找的:

3 个赞

有没有办法让主题的创建者自动为他们的帖子投第一票?我们有很多用户创建了这些主题但忘记投票,每次都要提醒他们很麻烦。只是想问一下 :slight_smile:

感谢这个插件!

1 个赞

我也同意。如果用户不知道投票数量有限,他们就无法调整自己的行为,因此最初鼓励用户深思熟虑地投票的目标就无法有效实现。

是否可以在分类中禁用主题投票?我们希望该分类中的大多数主题都可投票,但有时也希望发布不可投票的主题。我看到主题有一个 can_vote 属性,但似乎在界面或任何 API 调用中都找不到可以更新它的地方。似乎是可能的,因为最初创建的 “关于 XYZ 分类” 的主题是不可投票的。

@tyler.lamparter 也许是分类设置中的这个选项?

@NateDhaliwal 我们已经启用了这个功能,但我在想是否有些放在那一类别的话题可以禁用它。因此,99%的放在我们类别中的话题应该具有话题投票功能,但少数几个不应该。

对,我认为那不可能。你可能可以用CSS隐藏它,但这会很困难,因为这些更改会影响整个网站,而不是每个主题单独处理……

原因似乎是每个主题都有一个 can_vote 标志,它已经驱动着 UI 显示的内容。我只是看不到任何可以通过 API 更新或通过 UI 设置此标志的方法。

创建新类别时生成的“关于此类别的主题”:

我们的一位用户在该类别中发布的一个主题:

1 个赞

对于 Feature 类别,这里的投票选项和信息是基于 feedback 主题的标签,用一些 CSS 隐藏的。

2 个赞