Plugin Development

Suggested Topics

  • nodebb-plugin-question-and-answer

    Unsolved Plugin Development
    0 Votes
    1 Posts

    I have installed nodebb-plugin-question-and-answer v0.7.7 on nodebb v1.13.3. but when I post a topic as question, "mark this post as correct answer" is not available. "unsolved" tag is not appearing for topic which is posted as question. Please help me with this.

  • 0 Votes
    18 Posts

    Yes you can use them inside the AMD module but keep in mind once you add an event listener on the window object it will be called everytime there is an action:ajaxify.end. If you don't want it triggered after you leave that page you need to turn it off with $(window).off('eventName', myMethod)

  • 3 Votes
    8 Posts

    There are a few methodology issue I have here right now. The biggest being that the upload hook fires before a post is posted. This means files that aren't uploaded ( edited out after uploading ) with the post get stored.

    I need to sort out how to move this to the post hook and process that instead. Learning curve and all.

    For the moment, this works well enough for the other work I need so I'll be more focused that way for a bit, but I expect to come back to this for enhancement shortly.

    If you have requests/feature ideas Add it to the issue tracker on bitbucket.

    abquintic / nodebb-plugin-fileownership / issues — Bitbucket



  • 1 Votes
    1 Posts

    I'm thinking it would be good if we establish some best practices for NodeBB plugin development.

    Feel free to contribute by replying and I'll add it to the list.

    Database keys should start with plugin:[your-plugin-name]: ex: if the plugin is nodebb-plugin-mentions then the database keys would start with plugin:mentions: Use sockets instead of ajax Use CSS transitions instead of jQuery animations, trigger them by toggling classes on the elements Use Bootstrap elements as much as possible or not at all your suggestion here
  • 0 Votes
    2 Posts

    What I do sometimes is create a new db entry, with the key prefixed by the user object key. The core never knows it exists, so it should always be forward compatible.

    db.set('user:' + uid + ':something', "somevalue"); db.setObject('user:' + uid + ':someobject', {one: "thingone", two: "thingtwo"});

    You just have to make sure to delete it if the user is deleted, so there's not an orphan key left behind.

    db.delete('user:' + uid + ':something');