Skip to content
This repository has been archived by the owner on Jul 26, 2019. It is now read-only.

Adds ability to sort topic by votes within a category to your NodeBB.

Notifications You must be signed in to change notification settings

leetcode/nodebb-plugin-category-sort-by-votes

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Nodebb-Plugin-Category-Sort-By-Votes

License Version Downloads

Adds ability to sort topic by votes within a category to your NodeBB.

image

Installation

  • Install it from NodeBB Admin Panel, or

      npm install nodebb-plugin-category-sort-by-votes
    

Usage

  1. Go to the ACP (Admin Control Panel).
  2. Activate plugin and reload NodeBB.
  3. Click Plugins -> Category Sort to go to the Plugin's settings.
  4. Click "Re Index" to index all topics (see below screenshot).

image

  1. Go to any category, select "Most votes" from the "Sort by" dropdown and it should work!

Notes

Feature of sorting by votes use cid:[cid]:tids:votes as key, while it is not supported by NodeBB.So we must recreate the index to make it work. If "reindex" is not applied before you use "Sort By Votes" option in the category page, the category page will be blank.

We also use action:post.downvote, action:post.unvote, action:post.upvote hook to listen user actions and dynamically update the sortedSet which use cid:[cid]:tids:votes as key.

About

Adds ability to sort topic by votes within a category to your NodeBB.

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •