Is there a plugin that can be used to calculate the total number of upvotes received by users?
-
There is no plugin that does that as far as I know, but it can be built using the below function.
async function getUpVoteCountOfUser(uid) { const pids = await db.getSortedSetMembers(`uid:${uid}:posts`); const postData = await posts.getPostsFields(pids, ['upvotes']); return postData.reduce((accumulator, post) => accumulator + post.upvotes, 0); }
-
@baris Sorry, I have another question. What should I do if I want to display a upvotes card similar to reputation in the About Me section under the Harmony theme(As shown in the figure)? Can it only be achieved through writing plugins? Is there a simpler method?
Copyright © 2025 NodeBB | Contributors