users reputation
-
Hi guys, me again!
Can someone tell me how reputation system works ? Is it "just" related to upvote/downvote ? Something else ?
Also how can i do to give members XX reputation when joining a group ? I wanted to do it through rewards but there is no "If user's group", is there any way to add it ?
-
@jeff said in users reputation:
Is it "just" related to upvote/downvote ?
Yes, users earn/lose reputation by up votes/downvotes.
It's not available in rewards plugin. You can create a plugin to give reputation when user joins a group.
Make the plugin listen to hook
action:group.join
. Check for the group name and use the uid passed in the hook to give reputation using this...user.incrementUserFieldBy(uid, 'reputation', xx);
-
To complete @pichalite 's answer, you have to update the value in the
users:reputation
sorted set as well. So you would douser.incrementUserFieldBy(uid, 'reputation', 1, function (err, newreputation) { if (err) { return callback(err); } db.sortedSetAdd('users:reputation', newreputation, uid, callback); });
-
@baris so, is this a bug?
nodebb-rewards-essentials/lib/rewards.js at master · NodeBB/nodebb-rewards-essentials
Essential Rewards Starter Pack for NodeBB. Contribute to NodeBB/nodebb-rewards-essentials development by creating an account on GitHub.
GitHub (github.com)