How to get user data in partials/topic/post.tpl ?
-
Hello there!
I want to hide arrows up and down from users, which have reputation less than x.
How to get logged in user object with his reputation in partials/topic/post.tpl? -
I think to do this, you'd better hook "filter:post.upvote", check user's reputation, then return error info if not satisfied.
This hook source code is at filesocket.io/posts/helpers.js
.See NodeBB how to do this for
not-enough-reputation-to-downvote
insrc/posts/votes.js
:if (command === 'downvote' && parseInt(results.reputation) < parseInt(meta.config['privileges:downvote'], 10)) { return callback(new Error('[[error:not-enough-reputation-to-downvote]]')); }
Copyright © 2024 NodeBB | Contributors