Skip to content

Plugin Development

Have a question about building a plugin? Ask here
444 Topics 1.9k Posts
  • This topic is deleted!

    5
    0 Votes
    5 Posts
    98 Views
  • This topic is deleted!

    2
    0 Votes
    2 Posts
    79 Views
  • How I log out

    1
    0 Votes
    1 Posts
    943 Views
    D
    Anyone can suggest me how I can log out in the forum? what code or what file.js can I wacth to create a log out ? For now I do this: (library.js) router.get('/client/pagina-utente-cancellato',hostMiddleware.buildHeader,controllers.caricaPaginaUtenteCancellato); (controllers.js) Controllers.caricaPaginaUtenteCancellato=function(req,res,callback){ //delete req.session; //console.log(req); req.logout(); res.render('client/pagina-utente-cancellato', {}); }; Buw when I go in /client/pagina-utente-cancellato I must reload to see that the user is not logged. I need that in the header I can see "register" and "login" and not the value of current logged user. Anyone can help me?
  • number is not a function in async

    7
    0 Votes
    7 Posts
    2k Views
    D
    @julian and @baris I resolve thanks for your support and your advice! The problem is that I put in my code an username too long!
  • This topic is deleted!

    1
    0 Votes
    1 Posts
    22 Views
  • Using a hook to pass variables between client and server

    3
    0 Votes
    3 Posts
    2k Views
    G
    @yariplus Thanks!
  • Key-value tags for topics or posts

    4
    0 Votes
    4 Posts
    2k Views
    I
    Thanks, this is useful. I only posted under feature requests because I'm new and don't yet know how things work around here. I now know that this would have to be implemented as a plugin, and I suspect that it will not be too difficult. That is a lot more than I knew yesterday!
  • Custom content from separate database

    4
    0 Votes
    4 Posts
    2k Views
    D
    @jiangcaiyang MySQL. I guess I need to read some articles on how MongoDB is different to get started on this.
  • Translator ignoring entries that don't pass a parameter to it

    7
    0 Votes
    7 Posts
    3k Views
    LukeLaupheimerL
    @julian I've made a pull request that creates a test and actually addresses the underlying problem on top of it! https://github.com/NodeBB/NodeBB/pull/4796 If there's something messed up about it feel free to tell me. Like I said, I'm new to the NodeJS world so I wouldn't be surprised if I did something incorrectly.
  • How change sending domain ?

    4
    0 Votes
    4 Posts
    2k Views
    julianJ
    Have you set the email settings in the admin panel?
  • This topic is deleted!

    8
    0 Votes
    8 Posts
    114 Views
  • How can I make my own plugin which has a setting page?

    3
    0 Votes
    3 Posts
    2k Views
    xiduiX
    @yariplus Thanks your tips works for me.
  • how to intercept upload

    1
    0 Votes
    1 Posts
    917 Views
    C
    how can one intercept the upload so the data sent to the editor is something other than the default markup. of filename and description.
  • Error when I install sparkpost plugin

    1
    0 Votes
    1 Posts
    755 Views
    D
    I must install this https://github.com/SparkPost/node-sparkpost but when I do npm install sparkpost I obtain this error: npm ERR! Linux 2.6.32-573.12.1.el6.x86_64 npm ERR! argv "node" "/usr/bin/npm" "install" "sparkpost" npm ERR! node v0.10.36 npm ERR! npm v3.9.5 npm ERR! path /vagrant/nodebb/node_modules/bootstrap-colorpicker npm ERR! code EISGIT npm ERR! git /vagrant/nodebb/node_modules/bootstrap-colorpicker: Appears to be a git repo or submodule. npm ERR! git /vagrant/nodebb/node_modules/bootstrap-colorpicker npm ERR! git Refusing to remove it. Update manually, npm ERR! git or move it out of the way first. npm ERR! Please include the following file with any support request: npm ERR! /vagrant/nodebb/node_modules/npm-debug.log Anyone can help me ?
  • This topic is deleted!

    1
    0 Votes
    1 Posts
    20 Views
  • This topic is deleted!

    7
    0 Votes
    7 Posts
    101 Views
  • This topic is deleted!

    5
    0 Votes
    5 Posts
    68 Views
  • Hook for when chat message is sent

    5
    0 Votes
    5 Posts
    2k Views
    LukeLaupheimerL
    @pichalite I just tried it. Unfortunately, it didn't activate when I sent a message to my test account. (I had console.log dump out whatever the first param was) This would've been great if it solved the problem, too.
  • Recent cards localization

    6
    0 Votes
    6 Posts
    2k Views
    yariplusY
    @julian said in Recent cards localization: @yariplus It's just the one string, isn't it? Well, yes, and a few strings in the acp page. I just don't want to encourage the habit of manually editing strings in the template.
  • Database integration, permissions and custom routes in plugin

    2
    0 Votes
    2 Posts
    1k Views
    yariplusY
    Using only the currently logged in nodebb user and minecraft player. Two routes needed: Server-only route: POST route. Requires a unique key parameter. Only the forum and the minecraft server know the key. e.g. /mc/link?key=key User route: GET route. Used to link accounts, requires a UUID and a unique player key. e.g. /mc/link/:uuid/:key Minimum two DB keys need: {uuid}:key String key, stores the unique player key for the UUID. (Could also be a hash to store additional data.) user:{uid}:uuid String key, stores the UUID linked to the user. (Could also be stored on the user hash, or made into a set for multiple linkings.) Process: https://www.lucidchart.com/documents/view/382333e7-c772-43b7-8061-57b3bbd83e97 Minecraft player types a command. Server users server-only route to tell the forum it needs a registration link. Sending the unique key to verify the request is valid. Forum creates a unique player key and stores it in the DB, then sends the player key to the server. Server gives a link to the player, using the unique player key and the players' UUID. User visits link, if the user is logged in, and the uuid-key pair matches what is already in the DB, then the accounts are linked, using additional DB entries. The player key is deleted. Concerns: The player key should expire relatively quickly, like 5 minutes. Invalid requests to the user route should be monitored and blocked after a low threshold, like 3 tries. NodeBB middleware already validates the logged in user, which is why we do no additional checks. Note: On the last line in the diagram, I send a confirmation message, but we can't actually do this because we have not established a persistent connection. You could solve this by either having an http server on the server, or creating a socket connection to the forum. Or you could use Minecraft-Integration