MyBB Community Forums

Full Version: Need guidance on modding registration process/profile
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi guys,

i'm trying to write a plugin to do the following:

1) collect additional information during registration (like telephone numbers, mailing address and gender).

2) plugin must do some basic error checking for these additional fields (i wanna make them complusary as well)

3) allow user to change them on their profile page later

i've looked around and can't find any mods/plugin to do this. so i'm gonna try to attempt this myself.

i do know php and mysql on a novice level (done some mimi-projects on them myself). but i'm completely new to myBB (just downloaded and installed yesterday) and need some quick pointers on this.

i'm not gonna make it all nice and perfect (like using text from the language tables or adding new settings on plugin activation.)


but anyways, this is my work plan for phase 1 (to get the registration form to accept my additional inputs first)...

===step 1=====
change the template for "member_register".
must include the new fields i want.

question:
on the template, i'm seeing text inputs with their tags stated as
value="{$email}"
how does the "{$email}" work here ?
i'm probably gonna leave my input values blank on the registration form, but i'll need to know how they work when i mod the profile area.


====step 2=====
probably go to phpMyAdmin and add in new fields to the "users" table.


====step 3=====
to get my plugin to process the mew fields when user submits the registration form.

i've read the article on the plugin hooks system.
http://wiki.mybboard.com/index.php/MyBB_Plugin_Hooks
(its a little outdated ain't it ?)

i'll probably be looking at hooks in the members.php registration area.

85 member_do_register_start
432 member_do_register_process (can't find this in members.php)
469 member_do_register_end
479 member_do_register_end
487 member_do_register_end
495 member_do_register_end

its probably at "member_do_register_end", since i can't find "member_do_register_process" anymore in members.php

anyone care to give me a hint on whether i've got it right ?

===============

lastly, can someone show me a sample plugin where the author attempts to add new input fields to a existing page ?

it would really help me if i can refer to a similar sample.

(thanks for reading this long long post - if you actually read it Toungue)
Correct me if I'm wrong, but I think all this can be done in the Admin CP under "Custom Profile Fields" ?
oh boy... really ?
man, if that is true, i feel so stupid.
i'll go check that out now.
by golly, you're right davesgirl.
thanks !

(will someone please smack me on my head ? or just delete this embarassing thread for me)

now i'll have to go undo all the mess i've done with my tinkering.
* Galen smacks danchen in the head Toungue
Should I smack it once more? Toungue
* danchen decides to put on his crash helmet.
ok. sure... smack all you want. Toungue i deserve it. Sad

but on a serious note. i'm pretty happy that i didn't have to go through all that trouble. Many thanks to the designers of MyBB for including the custom profile field feature.
It pays of looking through the admin CP, you'll find something new ones in a while I guess. There are by default 3 custom profile fields. Sex, Location, Bio