Skip to content

Plugin Development

Have a question about building a plugin? Ask here
437 Topics 1.9k Posts
  • Share your opinion on my unique user registration process, please?

    9
    0 Votes
    9 Posts
    529 Views
    S
    @julian, I am trying to implement your suggestion. @julian said in Share your opinion on my unique user registration process, please?: As long as those form fields have name, then it is added to the form data, and sent to the backend. So, I would still need to implement some backend code to save this to the user object, right? using the setter here: https://community.nodebb.org/topic/16994/how-do-i-add-custom-user-fields-to-my-theme Because, doing db.objects.find({username: "test"}) doesn't include the custom fields. @julian said in Share your opinion on my unique user registration process, please?: You probably can't see the additional info in the registration queue template, so you may have to modify that one too. The API response for /api/admin/manage/registration does not contain the custom fields. Am I doing something wrong, or is this expected? What is the easiest way to add these fields to the API response? Thank you.
  • nodebb-plugin-audioplayer

    16
    4 Votes
    16 Posts
    7k Views
    DownPWD
    UP UP yep very cool to update it for V3 with a possibility to add flac and a playlist or several style of music
  • Is there a way to only listen for certain events through hooks?

    Solved
    2
    0 Votes
    2 Posts
    173 Views
    julianJ
    Most likely all server-side hooks are not specific to users (unless the UID is in the hook name, but I doubt we have any), so you'll have to just do an early-return if the condition doesn't match. It is likely not going to cause issues with the server. There are a thousand things that would need to be optimized before something like this causes a slowdown
  • Overwriting the composer template by theme if it comes from a plugin

    7
    0 Votes
    7 Posts
    340 Views
    julianJ
    @baris perhaps it shouldn't be .btn-primary as it doesn't often get clicked
  • Uploading user profile picture via CSV user importing

    4
    0 Votes
    4 Posts
    271 Views
    Eduardo SilvaE
    Tks so much, @baris and @julian! The await User.setUserField(user.uid, 'picture', user.profile_picture_url) approach worked! Yes, @julian, it's listening to the import-users-csv plugin hook. As soon as I finish the plugin I'll make a proper post announcing and explaining it.
  • Will I be able to install scoped plugins in a hosted NodeBB instance?

    3
    0 Votes
    3 Posts
    237 Views
    Eduardo SilvaE
    Great, tks! Just sent an e-mail :))
  • User avatar occurred error via sso

    1
    0 Votes
    1 Posts
    116 Views
    Sky凌空S
    I write a sso plugin,but when user loading their sso avatar,the error occurred [image: 1697272210455-%E5%B1%8F%E5%B9%95%E6%88%AA%E5%9B%BE-2023-10-14-162931.png] And the server can get this url. This is code screenshot: [image: 1697270194345-%E5%B1%8F%E5%B9%95%E6%88%AA%E5%9B%BE-2023-10-14-154845.png] How could i fix it?
  • How to export files uploaded when they are not stored locally?

    1
    0 Votes
    1 Posts
    122 Views
    T
    A new question concerning the development of my Backblaze B2 storage plugin: I kind of have it working now, where files are uploaded and filenames returned properly, though it's lacking the sophisticated ways of setting host, bucket and credentials as the old s3 plugins (I'm still struggling figuring out what the hooks and functions are available to a plugin developer, since the documentation doesn't seem to be very updated and detailed). I noticed there is this button to export personal data, including uploaded files. How should I possibly integrate this functionality into my plugin? Thom
  • Convenient way for plugin test

    3
    0 Votes
    3 Posts
    259 Views
    T
    @josef Thank you. I'll give it a try.
  • Is it possible to customize the footer of a post via a plugin?

    9
    0 Votes
    9 Posts
    511 Views
    oplik0O
    @eeeee Probably local to the user computer You can generally use non-http URIs for launching different applications. If you were ever redirected from a desktop or mobile app to a browser to log in you've probably seen this in action. Windows actually uses some internally and usually transparently for the user (for example, to abuse their monopoly, MS started using microsoft-edge: scheme instead of https: in some links in Windows to only allow opening them in Edge. They didn't have to build some highly custom mechanism, just restrict other apps from registering this scheme), but usually can be just registered by applications you install. What they do also depends on the application - for example, I think calculator: only launches the calculator app (or at least the obvious way to write math doesn't work), but others can launch specific actions and even pass some information (for example, authentication token for the web login use case I mentioned). For example Spotify allows linking to artists, playlists, albums etc. via spotify: scheme and steam supports doing a ton of things via URI, including launching and even installing/uninstalling games. All you need is an <a> tag with the right href= set. So yeah, you can put that kind of a link in a widget, but if they wanted to have it be an action under a post, especially if it was supposed to include some information from the post, it wouldn't be that simple. (side note: NodeBB doesn't allow links using non-standard schemes in markdown, so you can't just put something like this in a post or signature)
  • Child theme from Harmony theme - build problem

    4
    0 Votes
    4 Posts
    344 Views
    barisB
    It is actually something nodebb specific, when building the active theme nodebb core looks for the overrides.scss file. This file needs to be imported in a specific order for it to work.
  • Overriding client-side js

    6
    0 Votes
    6 Posts
    406 Views
    R
    @baris That should work, I'll give it a shot. I love the customizability of nodeBB. Particularly the ability to override templates and language files in the custom themes. It would be amazing if that capability could be extended to other file types as well just by placing the customized files in a folder structure that mimics the structure of the core files.
  • How to output logs in plugins?

    Solved
    3
    0 Votes
    3 Posts
    207 Views
    jszsjJ
    @baris Thanks, I figured out that the code wasn't being triggered, just as you said. I'm getting output now!
  • Hook for infinite scroll

    6
    0 Votes
    6 Posts
    324 Views
    R
    @baris Thanks for the confirmation
  • Redirect to login

    Solved
    16
    0 Votes
    16 Posts
    2k Views
    F
    Hello @jalathpc_demo I tried to create a patch: https://github.com/LM1LC3N7/nodebb-plugin-private-forum/releases/tag/v1.3.1 I no longer have a NodeBB instance, so let me know if it works (I am honestly not sure, as /logout should be allowed as you are logged in. It would be interesting to check if req.loggedIn is correctly set when using SSO. This could be why the plugin is not working as you need. NPM link: https://www.npmjs.com/package/nodebb-plugin-private-forum/v/1.3.1
  • Tipping plugin

    2
    0 Votes
    2 Posts
    186 Views
    phenomlabP
    @julia123 Hi, and welcome. As far as I know, there is no existing plugin that does this natively, so one would need to be developed. However, there are some plugins that come "close" such as @nodebb/nodebb-plugin-user-level which could be forked and modified to suit. It might be best for the devs themselves to respond here, as this will likely be custom work. Regds
  • scheduling topics

    6
    0 Votes
    6 Posts
    356 Views
    R
    @baris Thanks much, your help is always appreciated.
  • Username restrictions (Characters)

    4
    0 Votes
    4 Posts
    581 Views
    B
    @baris said in Username restrictions (Characters): This is the function limiting usernames https://github.com/NodeBB/NodeBB/blob/master/public/src/utils.js#L394 Would anyone happen to know where this function got moved to in the intervening years? Edit: I think I found it, here: https://github.com/NodeBB/NodeBB/blob/master/public/src/utils.common.js#L330
  • Return a custom HTML element when Regex is match

    Solved
    8
    0 Votes
    8 Posts
    644 Views
    B
    @baris this is work! Thank you! [image: 1686585959191-st_small_507x507-pad_600x600_f8f8f8-removebg-preview.png]
  • Custom Category with private topics

    2
    1 Votes
    2 Posts
    244 Views
    R
    I was able to achieve the desired functionality by adding a custom "Share" button to the template for the private topics. This button triggers the move to predesignated categories based on the type of post. Cheers