4images Forum & Community

4images Modifications / Modifikationen => Mods & Plugins (Requests & Discussions) => Topic started by: loz on Nisan 27, 2005, 10:20:45 ÖÖ

Title: Additional text boxes in registration
Post by: loz on Nisan 27, 2005, 10:20:45 ÖÖ
Hi,

I need to know a little more about the people who want to register on my site before I accept their registration.

Is it possible to add extra required text fields to the registration form (address, postcode, name, occupation, telephone & fax) which will also be included in the database and then allow them to update these details through their control panel once registered?

I've made several searches and browsed the forum for a solution to this problem. Please help.

Thanks, Loz.
Title: Re: Additional text boxes in registration
Post by: Vincent on Nisan 27, 2005, 10:54:53 ÖÖ
also interested to know!
vincent
Title: Re: Additional text boxes in registration
Post by: V@no on Nisan 27, 2005, 02:35:58 ÖS
yes u can, u'll need manualy add new fields into 4images_users table and update includes/db_field_definitions.php with the info about your new fields.
Title: Re: Additional text boxes in registration
Post by: Chris on Nisan 28, 2005, 01:00:44 ÖÖ
There are also comments in that file that explain what to edit.  Don't worry about anything else.  4images automatically takes care of outputting the custom fields in the admin ACP and member pages
Title: Re: Additional text boxes in registration
Post by: loz on Mayýs 03, 2005, 10:32:34 ÖÖ
Hi,

I've made all the changes to the 4images_users table in my database and updated includes/db_field_definitions.php with the info about my new fields. The fields appear in the admin control panel when you visit 'Users/Add user' but I really want the new fields to appear in the registration page, the user details approval page (before I approve a user) and in the user's control panel once they've been approved (enabling them to change the field values).

Can someone please tell me how to achieve this?

Thanks, Loz.
Title: Re: Additional text boxes in registration
Post by: loz on Mayýs 05, 2005, 09:45:42 ÖÖ
Please help me with this one, I need to know the extra field information about the users before I can approve them to use the forum. The comments in the db_field_definitions.php file don't tell how to add the extra fields to the registration form and users control panel.
Title: Re: Additional text boxes in registration
Post by: loz on Mayýs 05, 2005, 10:50:57 ÖÖ
Don't worry, I've figured it out now.
Title: Re: Additional text boxes in registration
Post by: utbusta on Haziran 20, 2005, 05:54:20 ÖS
Don't worry, I've figured it out now.

Would it be possible to list how you did this?  I too am wanting to add a few fields like address, what college they attend etc..  I am a total newb and some sort of details would be very helpful.  Thanks!

I added the fields in my database, i didnt know what ot modify in the DB-Field_Definitions.php file, how can one get it to show up on the registration form and to get the info to show up in the admin/edit users list etc... and to show up in the users profile.  From the looks of mine its not uploading the new data into the database  :cry:
Title: Re: Additional text boxes in registration
Post by: loz on Haziran 21, 2005, 09:36:33 ÖÖ
Here's the instructions. If I were you, I'd copy and paste this into a word editor because this code view on the bulletin board doesn't help.

Code: [Select]
To add new user text fields to the database so that you know more details about who is registering please follow these instructions.

----------------------------------

Step 1
Open: includes/db_field_definitions.php

----------------------------------

##### Find code:

// Example for additional user fields

##### After, unquote the following (just remove '//' from the beginning of the line):

//$additional_user_fields['user_adress'] = array($lang['user_adress'], "text", 1);

##### To add more fields just copy and paste this line you've edited without the // at the beginning and then change the name of 'user_adress' to something relevant you want to have as a field i.e. 'user_telephone'. To not make this field required change the 1 near the end of the line to 0.######


----------------------------------

Step 2
Open: lang/english/main.php

----------------------------------


##### Find code:

$lang['lost_password_msg'] = "In case you forgot your password, enter the email address you have used for registration.";

##### After, add:

$lang['user_adress'] = "Address:";

##### If you have included any more fields in the previous step repeat adding this line, replacing 'user_adress' with your field(s) name i.e. 'user_telephone'. Also change the "Address:" to the field(s) name i.e. "Telephone:" ######


----------------------------------

Step 3
Open: templates/default/register_form.html

----------------------------------

##### Find Code:

          <tr>
            <td class="row1"><b>{lang_email}</b></td>
            <td class="row1"><input type="text" name="user_email" size="30" class="input" value="{user_email}" /></td>
          </tr>

##### After, add:

          <tr>
            <td class="row2"><b>{lang_user_adress}</b></td>
            <td class="row2"><input type="text" name="user_adress" size="30" value="{user_adress}" class="input" /></td>
          </tr>

##### If you have included any more fields in the previous steps repeat adding this line, replacing user_adress with your field(s) name i.e. user_telephone. Please note there are three instances of user_adress you will need to change. Also, remember to change both <td class="row2"> to <td class="row1"> and alternate each time you need to repeat step 3 so that your background table cells alternate in colour. ######


----------------------------------

Step 4
Open: templates/default/member_edit_profile.html

----------------------------------

##### Find code:

          <tr>
            <td class="row1"><b>{lang_invisible}</b></td>
            <td class="row1">
              <input type="radio" name="user_invisible" value="1"{user_invisible_yes} />
              {lang_yes}&nbsp;&nbsp;&nbsp;
              <input type="radio" name="user_invisible" value="0"{user_invisible_no} />
              {lang_no}
</td>
          </tr>

##### After, add:

          <tr>
            <td class="row2"><b>{lang_user_adress}</b></td>
            <td class="row2"><input type="text" name="user_adress"  size="30" value="{user_adress}" class="input" /></td>
          </tr>

##### As like the previous steps, if you have any other fields replace the user_adress with the relevant field name. Same with the row2 information found in step 3. ######


----------------------------------

Step 5
Add database fields via 'PHPMyAdmin' tool or similar database admin program.

----------------------------------

Visit your database and locate "4images_users" table in your database. Open this table and after user_email add a new column for every field you want naming the field user_adress or whatever you've named the previous fields in the last few steps.

----------------------------------

Step 6
Save all changes to the files in steps 1-4 and then upload them to the correct directories.

----------------------------------

 
Title: Re: Additional text boxes in registration
Post by: utbusta on Haziran 21, 2005, 05:09:20 ÖS
That's Great!  Thanks.

Is there a way to display that info, like in the user profile and the Admin/Edit Users area?  Whats another or the best way to display that info?

Much Appreciated, Thanks

Title: Re: Additional text boxes in registration
Post by: commy on Ekim 25, 2005, 08:40:44 ÖS
Thanks, that worked for me aswell.

The only problem is that when I have go to register, the fields are not required. Is there a way to make this so?

Also, I am know trying to add some of those extra fields to my contol panel so that when I can search my users by state for example. I am having problems with this. Is there a way to do this?

 
Title: Re: Additional text boxes in registration
Post by: loz on Kasým 07, 2005, 11:16:42 ÖÖ
Hi Sorry it's taken a while to reply. If you want to make some fields required and some not, change the last editable in the includes/db_fields_definitions.php

i.e.

If I want to make the photographer field required, use this like so:

$additional_user_fields['user_firstname'] = array($lang['user_firstname'], "text", 1);

If you don't want it required change the 1 to a 0 like so:

$additional_user_fields['user_firstname'] = array($lang['user_firstname'], "text", 0);


I hope this helps.

By the way, depending on the version of 4images you have, the script should automatically add the fields into the admin section. I'll try and have a look into the searching for users using the new fields - should be something in admin/users.php
Title: Re: Additional text boxes in registration
Post by: DarkNeo on Ocak 29, 2006, 10:21:18 ÖS
Hi there,

Cool script but can you help me with adding info into the MYsql?? i dont know how to do that.

Im new with Databases.

Thx
Title: Re: Additional text boxes in registration
Post by: DarkNeo on Ocak 31, 2006, 09:57:39 ÖS
Hi there,

Cool script but can you help me with adding info into the MYsql?? i dont know how to do that.

Im new with Databases.

Thx

Please anybody?? help me please
Title: Re: Additional text boxes in registration
Post by: TheOracle on Ocak 31, 2006, 10:18:11 ÖS
@DarkNeo:

Quote

Visit your database and locate "4images_users" table in your database. Open this table and after user_email add a new column for every field you want naming the field user_adress or whatever you've named the previous fields in the last few steps.


This part is also indicated on how to implement within in your PHPMyAdmin (or to your relative software tool you might be currently using). How better do you want it to be ? ;)

If you do not know how to operate mySQL at all, I'd suggest seeking on Google and read free tutorials from results.
Title: Re: Additional text boxes in registration
Post by: DarkNeo on Ocak 31, 2006, 10:32:32 ÖS
@DarkNeo:

Quote

Visit your database and locate "4images_users" table in your database. Open this table and after user_email add a new column for every field you want naming the field user_adress or whatever you've named the previous fields in the last few steps.


This part is also indicated on how to implement within in your PHPMyAdmin (or to your relative software tool you might be currently using). How better do you want it to be ? ;)

If you do not know how to operate mySQL at all, I'd suggest seeking on Google and read free tutorials from results.

That part i know but what about vchar and so on like the codes what u have to put all in the fields.
Title: Re: Additional text boxes in registration
Post by: TheOracle on Ocak 31, 2006, 10:40:30 ÖS
Ok, so :

Quote

user_adress, VARCHAR 255, NOT NULL

Title: Re: Additional text boxes in registration
Post by: DarkNeo on Þubat 01, 2006, 04:58:11 ÖS
He man Thx that what im talking about.

Thx  :wink:
Title: Re: Additional text boxes in registration
Post by: sajwal on Haziran 11, 2006, 09:49:54 ÖS
This was a great tutorial for newbies like us...but when a user tries to change his profile he gets the following error:

Parse error: parse error, unexpected $ in /home/vsajwal/public_html/gallery/member.php on line 1148 I think some changes are to be made in this page too perhaps...i am really new to php... :roll:
Title: Re: Additional text boxes in registration
Post by: V@no on Haziran 11, 2006, 10:14:23 ÖS
restore member.php from backup and try again

P.S. make sure you upload .php and .html files in ASCII mode and not BINARY
Title: Re: Additional text boxes in registration
Post by: sajwal on Haziran 13, 2006, 01:33:36 ÖÖ
Thankyou V@no...its done....u ppl are really made of some different clay.. :P
Title: Re: Additional text boxes in registration
Post by: Lysander on Ocak 30, 2007, 02:15:29 ÖS
Guys i can't show under templates/defult/details.html

When i'm put like that for example;

Code: [Select]
<td valign="top" class="row1"><b>{lang_user_lens}</b></td>
<td valign="top" class="row1">{user_lens}</td>

But its look blank  :(
Title: Re: Additional text boxes in registration
Post by: Lysander on Ocak 31, 2007, 08:24:37 ÖÖ
Can someone help me plz ????  :roll: