@yariplus said in requesting user reputation:
Sure.
Here's the custom-pages render function as an example.
https://github.com/psychobunny/nodebb-plugin-custom-pages/blob/master/library.js#L18-L23
You can modify it to add getUserUsers to the render vaiables, using the req.uid
var User = module.parent.require('./user');
function renderCustomPage(req, res) {
var path = req.path.replace(/\/(api\/)?/, '').replace(/\/$/, '');
User.getUserFields(req.uid, ['username', 'topiccount', 'reputation'], function (err, user) {
if (err || !user) user = null;
res.render(path, {
title: plugin.pagesHash[path].name,
user: user
});
});
}
Now on all the custom pages templates, the variable {user.reputation} will be available. (and undefined for guests)
works perfect
@yariplus 4 president