I am wanting to add some fields to the registration page, so I thought I'd write a plugin for it.
It looks like the process would be:
Add a 'filter:register.build' hook function to insert the html for the extra form inputs.
Add a 'filter:user.custom_fields' function to insert the key/value to the userData object.
I looked at the spam-be-gone plugin to get an understanding of how to go about it, but my question is: Is it possible to place my added field(s) at the top of the form -- or anywhere else -- rather than the bottom?
I can also do this by adding my additional html into the register.tpl file and then adding the key/value to the userData object in /src/user/create.js, but I'd rather do it via a plugin as it seems cleaner. I don't need the data to appear on the site (i.e. the user's profile) so just these two things work fine.
The problem is I believe I'd have to do a 'git pull --rebase' each time I wanted to get updates for nodebb which could break things over time. Seems hacky. Plus, it is more maintainable to keep my modifications modular.
So, is there a better way? What's the best way to go about doing something like this? I'm just assuming that doing it via a plugin would be ideal, but if there are better options that are clean, then please let me know.
Lastly, if I wanted to have a function run a check on this info for duplicates during the registration (exactly like the one for username) can you steer me in the right direction on how I'd go about it?
I am using the latest version of the beep plugin 0.4.2 on the latest version of NodeBB 1.12.2. I have one issue with the beep plugin regarding old topics which were created before I migrated my site to NodeBB which have words which should be censored.
Newly created topics are censored with the beep plugin just fine. In the MongoDB the beep plugin actually saves topics with the censored words, so e.g. "title" : "Ps test censor" or "slug" : "123/ps-test-censor" is persisted in the database. Posts are obviously not modified by the beep plugin in the database but on the fly. Queries on the DB show the full non censored words in all posts be it old or new posts. Old and new posts are correctly censored by the beep plugin on the fly during browsing of NodeBB forum.
To fix this, post processing must be run on all topics in mongodb to modify "title" and "slug" applying the current beep censor rules.
Fortunately, I did not have that many topics to fix, so a quick manual fix is to just open each offending topic once, editing the topic as admin and saving it.
As a future improvement of this plugin, it would be very nice to have a simple button in the admin panel which runs a post-processing script for the above issue. This would be especially helpful on any change of the censor words down the line.
I am trying to follow the directions here:
Does anyone know how and where to set the "redirect_url" on this plugin?
Do I need to install another plugin to make this one work?
meta.config contains settings from NodeBB itself. Plugins retrieve their own settings via the settings module on the client side.