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
    425 Topics
    2k Posts
    barisB

    https://community.nodebb.org/post/88242 I think this answers your question. Let me know if it doesn't work.

  • 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 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
    824 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'

  • 0 Votes
    2 Posts
    1k Views
    MegaM

    It's not an answer to your question but, just in case, for researching hooks better to use Github wiki
    https://github.com/NodeBB/NodeBB/wiki