热门话题的徽章

有没有办法授予创建主题的人徽章,该主题随后获得了许多回复?比如 100 个回复?

我称之为“热门主题”,它将鼓励人们思考能够产生大量讨论的新主题创意。

3 个赞

我认为一个简单的版本可能是这样的:

SELECT 
    t.user_id,
    CURRENT_TIMESTAMP AS granted_at,
    p.id AS post_id
FROM topics t
  JOIN posts p ON p.topic_id = t.id AND p.post_number = 1
WHERE t.posts_count >= 100
  AND t.archetype = 'regular'
  AND t.deleted_at ISNULL
  AND t.user_id > 0

使用 t.post_counts 目前还将包括小的操作帖子(已关闭、未列出等),因此这取决于您希望它有多准确。

您可以通过在查询中计算“符合条件”的帖子来使其更具体。例如:

SELECT 
    t.user_id,
    CURRENT_TIMESTAMP AS granted_at,
    p.id AS post_id
FROM topics t
  JOIN posts p ON p.topic_id = t.id AND p.post_number = 1
WHERE t.id IN ( 
    SELECT 
        p.topic_id
    FROM posts p
      JOIN topics t ON t.id = p.topic_id
    WHERE t.archetype = 'regular'
      AND t.deleted_at IS NULL
      AND p.deleted_at IS NULL
      AND p.post_number <> 1
      AND p.post_type = 1
      AND p.hidden IS FALSE
     GROUP BY 1
     HAVING COUNT(*) >= 100
     )
5 个赞

太棒了,Jam!

发帖人还可以将帖子数设置为三个级别:青铜(50)、白银(100)、黄金(200)。

感谢您的教程,也感谢 @Shauny 的想法。

3 个赞

好的,我会试试看,然后回复你!

3 个赞

我已经设置好了,但我想它应该设置为每天更新?我明天看看是否有效。“目标帖子”需要勾选吗?

1 个赞

太棒了,谢谢!!

2 个赞

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.