discourse-post-sorting-customizer 允许用户根据 3 种变体对主题帖子进行排序:活跃、最旧和点赞。
安装
按照 安装插件 的说明安装该插件。插件的代码库地址为:
https://github.com/jahan-ggn/discourse-post-sorting-customizer
关于
- 活跃:允许用户按最近有回复的帖子进行排序
- 最旧:允许用户按很久以前有回复的帖子进行排序
- 点赞:允许用户根据帖子上的点赞数进行排序
注意
默认情况下,该插件处于禁用状态。要使用该插件,站点管理员必须通过名为 discourse_post_sorting_customizer_enabled 的站点设置来启用该插件。
12 个赞
@angus 对于在问答插件中使用它,你有什么想法吗?
2 个赞
angus
(Angus McLeod)
3
干得漂亮!是的,我想你可以把它和问答插件一起使用。我猜你列表中的“活跃”、“最旧”和“点赞”是参考了 StackOverflow 中类似帖子列表的排序选项?你用问答插件测试过吗?目前有没有社区需要这个功能?最好能先在一个真实的社区里看到它的实际应用。
7 个赞
是的,我已使用 QnA 插件进行了测试,功能运行正常。但为了达到理想的显示效果,需要单独对 answer count 进行样式美化,仅此而已。
3 个赞
现在该插件已与 discourse-solved 插件兼容。当用户选择帖子排序方式,且主题中包含已标记为解决方案的帖子时,该解决方案帖子将优先显示,其余帖子则按用户选择的排序方式进行排序。
5 个赞
@jahan_gagan 感谢这个优秀的插件。它非常有助于用户整理大量回复并快速找到所需内容。
是否有可能让插件仅针对特定分类生效?即在某些分类中才可用?
另外,增加按“我点赞的用户”或“我关注的用户”来排序帖子的功能是否有意义?
“用户关注”是 angus 开发的一个插件。我认为“我点赞的用户”这一功能已经足够。谢谢。
1 个赞
oshyan
(Oshyan Greene)
7
这似乎是一组非常有用的选项,特别是按最旧排序。我真的很希望能在核心中看到这一点。
与此同时,在我采用并开始依赖此插件之前,我想问一下核心中正在进行的任何布局更改是否可能会影响此插件。我之所以这样问,是因为它已经一年多没有更新了,所以我只想确保在出现任何问题时它都会得到更新/修复。
2 个赞
我很期待尝试一下。我也很好奇,你认为添加按字母顺序排序主题的功能有多容易,包括升序和降序,因为这方面有很多请求:Sort display of topics Alphabetically, Sort topics in user-defined/alphabetical order, Sort topics (within category) in alphabetical order by default, https://meta.discourse.org/t/call-me-stupid-how-do-i-sort-topics-by-created-date-or-by-title/83684,可能还有更多。
你认为添加按字母顺序排序的选项容易吗?
另外,提醒一下,我刚尝试安装它时收到一个错误,提示 Gem::LoadError: can't activate request_store-1.5.0, already activated request_store-1.5.1。我安装了很多插件,不确定是哪个插件可能已经激活了它,只是想告诉你。
这是完整的消息:
I, [2022-05-18T19:22:03.185295 #1] INFO -- : > cd /var/www/discourse & su discourse -c 'bundle exec rake db:migrate'
rake aborted!
Gem::LoadError: can't activate request_store-1.5.0, already activated request_store-1.5.1
/var/www/discourse/lib/plugin_gem.rb:27:in `load'
/var/www/discourse/lib/plugin/instance.rb:773:in `gem'
/var/www/discourse/plugins/discourse-post-sorting-customizer/plugin.rb:14:in `activate!'
/var/www/discourse/lib/plugin/instance.rb:679:in `instance_eval'
/var/www/discourse/lib/plugin/instance.rb:679:in `activate!'
/var/www/discourse/lib/discourse.rb:279:in `block in activate_plugins!'
/var/www/discourse/lib/discourse.rb:276:in `each'
/var/www/discourse/lib/discourse.rb:276:in `activate_plugins!'
/var/www/discourse/config/application.rb:222:in `block in <class:Application>'
/var/www/discourse/lib/plugin.rb:6:in `initialization_guard'
/var/www/discourse/config/application.rb:221:in `<class:Application>'
/var/www/discourse/config/application.rb:81:in `<module:Discourse>'
/var/www/discourse/config/application.rb:80:in `<top (required)>'
/var/www/discourse/Rakefile:7:in `require'
/var/www/discourse/Rakefile:7:in `<top (required)>'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/exe/rake:27:in `<top (required)>'
/usr/local/bin/bundle:25:in `load'
/usr/local/bin/bundle:25:in `<main>'
1 个赞
sudoanand
(Anand Singh)
9
遇到同样的错误:
Gem::LoadError:无法激活 request_store-1.5.0,已激活 request_store-1.5.1
你好,欢迎你 @sudoanand 
此插件带有 broken 标签,恐怕它目前无法正常工作。
1 个赞