Firefox PHP

How to edit register form

Posted by yuri80 
How to edit register form
April 29, 2008 05:08PM
Hi guys, for first sorry for my english.

I've got a simple question for you: is it possible to edit the register form adding some input fields like:

- date of birth
- job
- city/town
- etc.

How can i do this?

Thanks.
Re: How to edit register form
April 29, 2008 05:17PM
First create some custom profile fields in the admin interface for storing the data. Then edit register.tpl to add the fields to the input form. That is what is needed to store this data with the user. Additionally, you'll need to edit profile.tpl to display the fields in the profile page.


Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce
Re: How to edit register form
April 29, 2008 06:00PM
I've created a new input field from the Users/Groups -> Custom profile panel in the admin interface then i edited the register.tpl adding the new input field in the HTML code.

The input field was created but i can't see its label in the register form!

Is it necessary to edit a database table?

I've added the input field from the admin interface but the "phorum_users" and "phorum_user_custom_fields" database tables were not modified.

A last question: is it possible to add also a radio button group, checkboxes, drop-down menu (select) etc?

Thanks again.
Re: How to edit register form
April 29, 2008 06:27PM
Quote
yuri80
The input field was created but i can't see its label in the register form!

Did you use something like {LANG->labelname} for that? You should simply put the string in the register form that you need. If you use {LANG->labelname}, then you need to add "labelname" to the language file that you are using.

Quote
yuri80
Is it necessary to edit a database table?

No.

Quote

I've added the input field from the admin interface but the "phorum_users" and "phorum_user_custom_fields" database tables were not modified.

That's correct. The phorum_user_custom_fields table will retrieve data when custom fields are filled. You'll see no changes on beforehhand.

Quote

A last question: is it possible to add also a radio button group, checkboxes, drop-down menu (select) etc?

It's possible to use any kind of HTML form field in there. Only checkboxes are special, because for checkboxes there will be no form field posted at all when the checkbox is unchecked at post. There are several options for working around that, but some coding skills are needed. You could:
  • add a hidden field with the real field name to the form. Then add a checkbox, which changes the value of the hidden field based on its check status.
  • Write a module that hooks into the before_register hook to fill the user data field based on the checkbox status.


Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce
Re: How to edit register form
April 30, 2008 09:34AM
Thank you very much ;-)
Sorry, only registered users may post in this forum.

Click here to login