After days of messing around I´ve finally got our first vBulleting powered forum up and running. The NHS Forum needed a bit of tweaking to get it running so I had to start messing around with the code before we could launch it.
The main reason was that we wanted it to be for NHS staff only. This was "easy" to do since they all have an email address with the .nhs TLD, so if I could get the registration process to make sure that they signed up and activated their account using a .nhs email address they were definately NHS staff. The other thing was to get some additional information during the registration process (such as the specialty they work in, and region of the country) and remove some of the other fields I didn´t want (such as time zone).
The first thing I did was load up the register.php file hoping that it might be a simple case of editing this. How wrong I was. After a couple of hours of messing around and looking through all the files and the database I managed to get a good understanding of how it all worked and found some features in the admin panel that I could use to cut some corners. I´ll put a breif account of what I did here in case anyone else is trying to do something similar.
The PHP files that make up vBulletin are mainly functions that access various areas of the database to construct a given page. In the case of the registration page they do various things such as error checking on the form, inserting the deatils into the database and displaying the next page in the registration. For a given page the database contains the template information in one table so altering this was just a case of finding the right entry in the table and editing it to do what I wanted.
This meant that I could remove areas of the registration form that I didn´t want just by editing this entry. The next step was to add field where I wanted them. Since I didn´t fancy going through all the files to find out where I would need to add my code or alter sql queries I headed for t´interweb to see if there was an easier way. This is where the Custom User Fields comes in. This lets you specify additional user fields that can be enforced during the registration process and can be edited in the admin panel so that you don´t have to go messing around with code. This made it very easy to get the redistration form just the way I wanted it.
The last bit was to make sure email address was a .nhs one. I found the function that verifies the email addresses and just edited this to throw up an error if the last part of the address wasn´t right. With the other varification vBulletin does as standard and the confirmation email to activate the account, it now does everything I need it to.
I finished it off by finding the "posts" template and editing this to include my custom user fields and then it was all done. We´ll be launching next week so I´ll see how it goes and get to grips with all the moderation stuff.