Skip to content

NodeBB Plugins

Discussion regarding NodeBB Plugin development.

1.8k Topics 15.0k Posts
Most Voted Plugins

Subcategories


  • Have a question about building a plugin? Ask here
    426 Topics
    2k Posts
    starkorebaS

    Hello, first of' thanks for the amazing work !
    For the context: I'm a junior developer from France, so excuse my english (and my limited understanding of everything lol). I was looking for a software alternative to build a forum RPG. I just installed NodeBB on Ubuntu 20 (Focal) working on WSL 2. I'm using redis and want to write plugin using typescript.

    It would be great to have a guide version of the Quickstart plugin in typescript !
    I know its possible to write plugin in typescript, the emoji plugin does that. But it would save me so much time to have a guide that explain the extra step we need to do in order of compiler and make it work on NodeBB.

    Here's my questions tho:

    Is it in the roadmap team of NodeBB to document how to write plugin in typescript? Did the team plan to write a typescript version of NodeBB?

    Although it would be great to have some more advanced example right in the documentation on how to do something and what are the step to make it work.
    Like here : https://community.nodebb.org/topic/16994/how-do-i-add-custom-user-fields-to-my-theme

    Like "if I want to add/ change something, I have to think of the scope of this features and what's need to be modify in other file to be working properly". Or at least, say it in the documentation a little bit more straightforward. So that beginner will understand that first sight. But I think examples are more worthy than tons of words.

    Is it possible for beginner to contribute on the documentation to make it more specific and understandable for beginners, or is it a documentation for more experienced developers and a choice of the team (and don't want to change that)?

    Is it because from a plugin to another, things might be working so differently that it's not worthy to do a more detailed documentation ?

    Because people might be wanted to write plugin over time, mutualisation of knowledge would be great, so that might simplified the process of each developer trying to write plugin have to go throw investigations to understand how NodeBB works before even start to develop the actual plugin.

    For example: How to interact with the database explain in this answer: https://community.nodebb.org/topic/17657/best-way-to-store-plugin-data-in-database-in-context-of-compatibility/2?_=1714543873650 for me this should be in the documentation.

    In conclusion, I feel like in general people agree that it's difficult to start writting plugin without investigate and dive in the structure file of the source code. I'm willing to help on that make it easier to really understand how NodeBB works for developer. So that anyone not familiar with the source code can start almost immediately customization. :emo:

  • Need a plugin developed? Ask here!
    222 Topics
    1k Posts
    barisB

    Plugin doesn't show usernames if they set their status to offline AFAIK

  • Plugin Instagram Embed

    3
    4 Votes
    3 Posts
    2k Views
    S

    Yes, please. This is a good plugin 👍

  • plugin Facebook Embeds

    6
    0 Votes
    6 Posts
    2k Views
    MegaM

    I'm sorry @Codejet I completely don't understand you

  • 0 Votes
    1 Posts
    1k Views
    codejetC

    nodebb-plugin-twitter/library.js

    (function(module) { "use strict"; var Twitter = {}, embed = '<blockquote class="content twitter-tweet" lang="en"><a href="https://twitter.com/$1/status/$2"></a></blockquote><script async src="//platform.twitter.com/widgets.js" charset="utf-8"></script>'; Twitter.parse = function(data, callback) { var regularUrl = /<a href="(?:https?:\/\/)?(?:twitter\.com)\/([^\/"\s]*)\/statuse?s?\/([^\/"\s]*)(\/photo\/1|)">.+?<\/a>/g var postContent = data && data.postData && data.postData.content; if (postContent && postContent.match(regularUrl)) { data.postData.content = postContent.replace(regularUrl, embed); } callback(null, data); }; Twitter.init = { global: { addNavigation: function(custom_header, callback) { custom_header.navigation.push({ class: 'hidden', route: "", text: '<script async src="//platform.twitter.com/widgets.js" charset="utf-8"></script>' }); callback(null, custom_header); } } }, module.exports = Twitter; }(module));

    nodebb-plugin-twitter-hastag/index.js

    'use strict'; (function(module) { var regex = /(?:\s|^)#(\w*[A-Za-z_]+\w*)\s?(?!\w\d\s)/gi; module.parse = function(data, callback) { if (!data || !data.postData || !data.postData.content) { return callback(null, data); } var matches = data.postData.content.match(regex); if(!matches || !matches.length) { return callback(null, data); } for(var i=0; i<matches.length; ++i) { var match = matches[i].replace('</p>', '').trim(); data.postData.content = data.postData.content.replace(match, '<a href="https://twitter.com/search?q=%23'+ match.slice(1) +'" target="_blank">' + match + '</a>'); } callback(null, data); }; }(module.exports));
  • Twitter embed plugin

    1
    0 Votes
    1 Posts
    825 Views
    codejetC

    I just started playing with this because I noticed it wasn't working... had a look at the code and @ the twitter url that the embed plugin uses.

    Noticed that there are 2 different url links with the words 'status' and 'statuses'.

    On seeing this I decided to change the word in the main regexp for this program.

    For some unexpected reason, after having so many problems trying to get this working again, changing the regexp and reloading NodeBB seemed to get the plugin displaying twitter embed's again. Can the plugin developer look at why this is working sometimes and not other times.

    After mucking around with it I decided to change this line to:

    var regularUrl = /<a href="(http|https):\/\/twitter.com\/([^\/"\s]*)\/statuse?s?\/([^\/"\s]*)(\/photo\/1|)">.+?<\/a>/g

    note the ' statuse?s? ' (this matches either statuses or status in the url link)

    I know this probably worked correct before but for some strange reason altering this regexp seemed to kick start the plugin again and now it works.

  • 0 Votes
    7 Posts
    2k Views
    julianJ

    Best commit message ever 😆

    Thanks @pitaj!

  • 0 Votes
    11 Posts
    4k Views
    A

    Hi,
    Can you point me to that location, where I can find and extend the USER model, to include the USER EMAIL ADDRESS ?
    The expectation is that the EMAIL ADDRESS should be persisted in the DB and be available across USER login sessions.

  • 6 Votes
    13 Posts
    7k Views
    S

    Updated to support the filter:parse.raw hook. New version is 0.0.5.

  • [nodebb-plugin-imdb] Popover IMDB information

    6
    3 Votes
    6 Posts
    3k Views
    S

    Just noticed that this also works for TV shows 🙂
    I can include the RT rating @julian

  • SEO plugin needed

    13
    1 Votes
    13 Posts
    6k Views
    BobberB

    @Baerrus Where you at with SEO so far?

  • 0 Votes
    4 Posts
    2k Views
    barisB

    This is now on master. The data that is passed to the filter includes the topic, the uid of the current user and an empty tools array.

  • 0 Votes
    5 Posts
    2k Views
    rchowellR

    @julian I've done both. Thanks for the response.

  • Header that recedes as you scroll

    1
    0 Votes
    1 Posts
    759 Views
    JonDoe12J

    This would be a great plugin to have for Nodebb. It would enable to header of the forum to recede as you scroll down, then reappear when you go back to the top:
    http://wicky.nillia.ms/headroom.js/

  • This topic is deleted!

    Locked
    1
    0 Votes
    1 Posts
    16 Views
  • 3 Votes
    18 Posts
    9k Views
    PitaJP

    @ffmad I'm working on a huge refactor and upgrade right now. See this post for more information.

  • Thread Prefix Plugin

    7
    0 Votes
    7 Posts
    4k Views
    J

    @a_5mith Thats what I was thinking. Thanks! I might get something together for it.

  • 3 Votes
    25 Posts
    10k Views
    drewD

    @a_5mith okey dokes. I'll try some manual jiggery pokery.

  • action:ajaxify.end only in frontend

    3
    0 Votes
    3 Posts
    2k Views
    Andrea CardinaleA

    Thanks @psychobunny .
    I take this opportunity to congratulate you for NodeBB: really cool!

  • Who is in? Plugin

    23
    13 Votes
    23 Posts
    13k Views
    A

    @zero thanks for the feedback! I'll try to add the features you requested and also will see what that bug is all about.

    If we add a feature like limiting the number of avatars that are displayed by default, I would rather it be customizable with a default parameter.

    I likely wont have time to work on this until next weekend. If you want anything changed quickly feel free to send a PR 😄

    Cheers!

  • 0 Votes
    1 Posts
    1k Views
    A

    Hi,

    Please provide enough details to implement below functionality :

    I want to write one plugin which provides following functionality :
    -Admin can assign user role as MODERATOR to any user, and Only User who have moderator role can approve Topic Creation and Comments/Reply.
    -Any new Topic created by registered/guest user should not be visible on the website till MODERATOR User approved it.
    -MODERATOR User will be able to see all the unapproved topics, reply/comments and approves it.
    -How to implementing email notification functionality for MODERATOR User on New Topic Creation and on Replies/Comments ?

    Any help would be greatly appreciated.
    Thanks!!!

  • How to get locale?

    3
    0 Votes
    3 Posts
    1k Views
    julianJ

    As for server-side, you'll want language, I believe, from inside the user set. This is what we use:

    user.settings.language || meta.config.defaultLang || 'en_GB'