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
    427 Topics
    2k Posts
    traarrrT

    Hi all,
    Well this is my first time writing a plugin which involves using client side hooks...
    For a start, i would want my plugin to listen to a hook which activates when the topic page is completely loaded and topic tools are loaded too.

    For which I wrote this function:

    'use strict'; /* globals document, $ */ $(document).ready(function () { function alertType(type, message) { require(['alerts'], function (alerts) { alerts[type](message); }); } console.log('nodebb-plugin-quickstart: loaded'); $(window).on('action:topic.loaded', notifyBox); function notifyBox() { console.log("in notify box"); alertType('success', "done") } });

    but this is not working... I can only see "nodebb-plugin-quickstart: loaded" on the console.

    Where am i going wrong here??

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

    Thank you!

  • Emaze Plugin Help

    14
    0 Votes
    14 Posts
    10k Views
    JonDoe12J

    I was just going to let you take most of the credit. It's still your plugin, and you helped me make the modifications. I'm working on a new modification now, though. I'm trying to get the presentations to embed into an area of the user's profile.

    Right now, I'm testing it with the Fullname field on the profile, by entering the URL of the presentations (instead of a human name) and seeing if it parses into an embedded slide show.

    Would this be easy to accomplish? If not, are there any hints you could give me @a_5mith ?

    So far, I've edited the library.js file and replaced data.post and data.post.conent with data.fullname and data.fullname.content. I've also tried changing the hook in plugin.js from:

    { "hook": "filter:parse.post", "method": "parse", "callbacked": true } ]

    to

    { "hook": "action:user.set", "method": "parse", "callbacked": true } ]

    I feel like I'm missing something, though. If you're up to it, I'd like to collaborate with you further.

  • 0 Votes
    2 Posts
    1k Views
    MegaM

    related https://community.nodebb.org/topic/3876/nodebb-plugin-facebook-facebook-posts/11

  • 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
    3k 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!