adding a `filter:user.create` hook, I have some uncertainties

NodeBB Development

Suggested Topics

  • 0 Votes
    1 Posts

    I have the write api plugin installed as well as the question and answer plugin. We are successfully creating topics and posts. Is it possible to create a topic as a question? I tried adding isQuestion (equals 1) to the POST body when creating the topic but it was ignored. Would the write-api have to be forked and updated to support the optional value of isQuestion? It seems clear in the question and answer plugin that it doesn't create/expose any write api of its own.

  • 0 Votes
    9 Posts

    @yariplus said in requesting user reputation:


    Here's the custom-pages render function as an example.

    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

  • 0 Votes
    3 Posts

    Those userrs are stored in groups with special names, here are the names assuming the category id is 1.


    You can get the user ids from these groups by.

    Groups.getMembers('cid:1:privileges:find', 0, -1, callback); This will give you all the user ids that have the find permission for category 1.

    If you want to get their basic info like username picture slug so you can show user icons you can just use Groups.getMemberUsers('cid:1:privileges:find', 0, -1, calllback);

  • 2 Votes
    10 Posts

    Does it still work? My helper functions don't seem to be recognize in my template files.

  • 1 Votes
    11 Posts

    @frissdiegurke Knowing what I know now, @julian post can be construed to contain all the information :). I would word it differently though as SSO is probably veyr widely used. And if so, then calling port optional is...well, still technically correct.