Skip to content

Plugin Development

Have a question about building a plugin? Ask here
427 Topics 1.9k Posts
  • 0 Votes
    3 Posts
    2k Views
    P

    Off course, tha'll work!
    Thanks heaps for that!

  • find objects with wildcard

    Solved
    6
    2 Votes
    6 Posts
    3k Views
    T

    In case someone comes to this thread in the future, here is the solution I came up with: https://github.com/exo-do/nodebb-plugin-reputation-rules/blob/master/ReputationManager.js

    A main object and 3 sets as I said, nothing complex (in fact working with sets is pretty easy) but a bit confusing.
    When I save or update the main object I have to also call 3 times db.setAdd() or db.setRemove() depending on vote type (upvote, downvote or undo) but thats all.

    Thanks again for your help guys ๐Ÿ˜„

  • 2 Votes
    2 Posts
    3k Views
    ogerlyO

    i have added Dailymotion and Vine

    Link Preview Image GitHub - ogerly/nodebb-plugin-embed-videos: youtube, vimeo, facebook, dailymotion, vine

    youtube, vimeo, facebook, dailymotion, vine. Contribute to ogerly/nodebb-plugin-embed-videos development by creating an account on GitHub.

    favicon

    GitHub (github.com)

  • Custom PHP Page

    30
    0 Votes
    30 Posts
    15k Views
    yariplusY

    Sure, you do that where you declare your custom route.

    function renderSink(req, res, next) { if (!req.uid) return res.redirect('/login'); // Do normal stuff. res.render('demo', someData); } module.exports = function(app, middleware, controllers) { app.get('/demo', middleware.buildHeader, renderSink); app.get('/api/demo', renderSink); };

    More info here: http://expressjs.com/4x/api.html#res.redirect

  • nodebb-plugin-youtube-lite

    4
    0 Votes
    4 Posts
    2k Views
    ogerlyO

    @ogerly said:

    <a href="http.?:.*(youtube.com|.*be/|.*embed/|watch?. v=|(\w{11})). ?</a>

    Link Preview Image regex101: youtube link + id +

    Regular expression tester with syntax highlighting, explanation, cheat sheet for PHP/PCRE, Python, GO, JavaScript, Java, C#/.NET, Rust.

    favicon

    regex101 (regex101.com)

  • nodebb-plugin-fb-video

    1
    0 Votes
    1 Posts
    1k Views
    ogerlyO

    with the plugin you can videos of facebook
    display in NodeBB.

    Example URL:
    https://www.facebook.com/zuck/videos/vb.4/10101993274698321/?type=2&theater

    ! it loads very slow for large videos!

    Bildschirmfoto vom 2015-07-31 14:44:05.png

  • nodebb-plugin-prezi

    1
    2 Votes
    1 Posts
    1k Views
    ogerlyO

    Hello
    I made my first plugin.

    I have a youtube-lite plugin taken as a basis.

    with the nodebb plugin Prezi presentations can be integrated by http://prezi.com.

    git: https://github.com/ogerly/nodebb-plugin-prezi.git

    npm : https://www.npmjs.com/package/nodebb-plugin-prezi

    Bildschirmfoto vom 2015-07-31 13:52:30.png

  • Send attachments through Chat

    2
    1 Votes
    2 Posts
    2k Views
    agd1A

    Still new to NodeBB, but I think the chat is handled by Redis/MongoDB. While you can store files in MongoDB using GridFS, I would think a great way to tackle that would be to have the plugin upload the file to storage (like AWS S3) and then include in the body of the message a link to the downloaded file. Permissions could be set at upload to only allow members of the chat access to the file.

    I would also be very interested in this feature!

  • 0 Votes
    7 Posts
    2k Views
    epidemiya30E

    I mean exclude from excluding the plugin folder ๐Ÿ™‚

  • Different entity for "Topic"

    Unsolved
    2
    0 Votes
    2 Posts
    2k Views
    julianJ

    Would the Q&A plugin be closer to what you want?

  • Retrieve setting value from the client side

    4
    0 Votes
    4 Posts
    2k Views
    R

    Always makes me smile when I can help.
    Your plugin also opened nodeBB to a more scientific audience, which I personaly find extra apealing. ๐Ÿ™‚

  • Refresh Required when Posting to /login

    6
    0 Votes
    6 Posts
    2k Views
    O

    Yep, and that's indeed what I've ended up doing. It doesn't feel as nice as it could be but it will do.

  • Bootstrap widget render with data

    4
    0 Votes
    4 Posts
    3k Views
    P

    Like this?

    Link Preview Image nodebb-widget-essentials/public/templates/widgets/activeusers.tpl at master ยท NodeBB/nodebb-widget-essentials

    Several basic widgets bundled together in one package including 'HTML', 'Markdown', 'Recent Replies', 'Active Users', and 'Moderators' - nodebb-widget-essentials/public/templates/widgets/activeusers.tpl at master ยท NodeBB/nodebb-widget-essentials

    favicon

    GitHub (github.com)

    This pre-renders the list of active users from server data. And then has some inline JS with socket call to update the list as new users become active

  • How to update each X seconds a widget?

    6
    0 Votes
    6 Posts
    2k Views
    yariplusY

    @Fez-Vrasta You have to include it. e.g. var SocketIO = require('./socket.io');

    I'm not sure if there is an option for per widget client js. I put it in my main client.js in my plugin.json.

  • How to debug a plugin in nodebb

    3
    0 Votes
    3 Posts
    2k Views
    xinshoukeX

    https://github.com/justmepzy/nodebb-plugin-aliyun-oss, this plugin doesn't work totally.

  • Fill missing user fields on SSO login

    1
    0 Votes
    1 Posts
    980 Views
    A

    Hi! I'm trying to make another SSO plugin, but the difference is: i want user to fill missing fields (like email) after external authentication but before user is created in the forum.

    The only good solution i see is to override successReturnToOrRedirect andfailureRedirect fields to custom routes (https://github.com/NodeBB/NodeBB/blob/master/src/routes/authentication.js#L60), which are handled by plugin itself, to render input forms and logic. So i think it would be nice to extend login strategy with success/fail routes and use them if specified.

    I would like to hear opinion about my idea. If it is good enough i think i can create pull request.

  • Widget doesn't render

    5
    0 Votes
    5 Posts
    2k Views
    Fez VrastaF

    AHHH!!!! THANK YOUUU!!!!

    What a stupid error ๐Ÿ˜ž

    thanks!

  • Share information between plugins

    8
    0 Votes
    8 Posts
    3k Views
    A

    I've used hook method in my bbcode plugin (watch Extension block here - http://forum.apxeolog.com/topic/8/nodebb-bbcode-plugin)
    It is greate since:

    If there is no 'parent' plugin there will be no errors (noone call the hook) Plugin priority dosn't matter because hooks should be called after all plugins are loaded
  • Plugins not displaying in Admin console

    10
    1 Votes
    10 Posts
    5k Views
    barisB

    Yeah nodebb plugins are npm modules so they need to have a package.json file. The plugin.json file is just for nodebb.

  • User Permissions

    4
    0 Votes
    4 Posts
    2k Views
    snodejokeS

    Thanks a lot @baris.

    I'll investigate this route.