Joomla implements the method for registering users to add new fields. joomla registers users.
This example describes how to add a new field to a registered user in joomla. We will share this with you for your reference. The details are as follows:
The original registration of joomla is very simple. To add the desired field, such as the phone number.
Add this field "telphone" to the database"
Modify libraries \ joomla \ database \ table \ user. php
Add a new variable in the JTableUser class:
Var $ telphone = null;
Page Modification
Modify components \ com_user \ views \ register \ tmpl \ default. php
Add the input field here. The name must be the same as the field defined by your database.
Copy codeThe Code is as follows: <input type = "text" name = "telphone" id = "telphone" size = "40" val = "<? Php echo $ this-> escape ($ this-> user-> get ('telphone');?> "Class =" inputbox required "maxlength =" 50 "/>
After all, it is not good to directly modify the source code. Therefore, we recommend that you modify the Page code of the component in your own templates folder to minimize the modification of the source code.
Finally, you do not want to send an email to the user. The new user can only take effect after being reviewed by the background administrator. comment out the following code components \ com_user \ controller. php:
// UserController: _ sendMail ($ user, $ password );