如何使用插件自定义热门话题得分算法?

最简单,但根据您想做的事情,可能会有所限制。

可行,但更复杂。请查看 TopicQuery 如何实现列表

特别是

  def list_hot
    create_list(:hot, unordered: true, prioritize_pinned: true) do |topics|
      topics = remove_muted(topics, user, options)
      topics.joins("JOIN topic_hot_scores on topics.id = topic_hot_scores.topic_id").order(
        "topic_hot_scores.score DESC",
      )
    end
  end

您可以相对容易地添加一个额外的列表,尽管您需要考虑相当多的变动部分。我在我的 ‘homepage-filter’ 插件中这样做了,那可能是一个很好的起点。