minibb®
Fight the automated spam - protect your miniBB-forums,
getting the Captcha addon! Click here to read more.
Captcha Addon for miniBB
Community Forum
 | Forums | File Bank | Sign Up | Reply | Search | Statistics | Manual |
Master Class miniBB Community Forum / Master Class /

Adding new user profile field (Full name)

 Page:  1  2  3  4  »» 
Anonymous
Guest
#1 | Posted: 2 Mar 2005 20:35
Reply 
I want to add full name form in my miniBB. Anyone here can help me how to do that ?

thanks
Team
8-)
#2 | Posted: 3 Mar 2005 11:19
Reply 
You may use one of the "user_custom" fields defined in $dbUserSheme (setup_options.php) or create and define some special field, for example, "user_custom_fullname" (second is recommended). So, procedure is the following:

1) In your mySQL manager, execute the following command for minibb database:

ALTER TABLE minibbtable_users ADD user_custom_fullname VARCHAR(254) NOT NULL;

where "minibbtable_users" is your users table name.

2) Look at the FIELDS of this database, and calculate manually NUMERICAL INDEX of the new field. For example, your fields look like this, and have these indexes (beginning from top):

user_id - 0 (begin from zero!)
username - 1
user_regdate - 2
user_password - 3
user_email - 4
user_icq - 5
user_website - 6
user_occ - 7
user_from - 8
user_interest - 9
user_viewemail - 10
user_sorttopics - 11
user_newpwdkey - 12
user_newpasswd - 13
language - 14
activity - 15
user_custom1 - 16
user_custom2 - 17
user_custom3 - 18
user_custom_fullname - 19

3) Open setup_options.php, find $dbUserSheme and at the very END of this array add new line for "fullname":

...
'language'=>array(14,'language','language'),
'user_custom1'=>array(16,'user_custom1','user_custom1'),
'user_custom2'=>array(17,'user_custom2','user_custom2'),
'user_custom3'=>array(18,'user_custom3','user_custom3'),
'user_custom_fullname'=>array(19,'user_custom_fullname', 'user_custom_fullname')
);

(notice: no comma after last element in array before ); )

4) Open your language file (f.e., eng.php), look up for $l_usrInfo and add:

$l_usrInfo[14]='Fullname';

4) Open templates/user_dataform.html and add the new input text code for that field:

<tr>
<td class=caption4 align=right valign=top>{$l_usrInfo[14]}</td>
<td class=caption5><input type=text name=user_custom_fullname maxlength=100 size=20 value="{$user_custom_fullname}" class=textForm style="width:200px;">&nbsp;<span class=txtSm>({$l_max} 254 {$l_symbols})</span></td>
</tr>


And that check how it works:
1) Register new user with this new field
2) Edit user preferences with this field
3) View user info with this field

Please, use miniBB 2.0 RC2a (not RC2) because we have fixed important issue regarding described method.
Anonymous
Guest
#3 | Posted: 6 Mar 2005 13:52
Reply 
user_custom_fullname dont save to the database, where is the scripts to insert it into the database ?

thanks
Team
8-)
#4 | Posted: 7 Mar 2005 10:28
Reply 
What do you mean by "doesn't" save? It doesn't save when you are doing what?
zorglub
Forums Member
#5 | Posted: 12 Mar 2005 20:05
Reply 
well, I mean the same : it doesn't save the datas in the database...
I'm using the RC2a...
zorglub
Forums Member
#6 | Posted: 12 Mar 2005 20:18
Reply 
in fact you have to add something in bb_func_regusr.php. For me for instance, I added something for the sighature...

$ins=insertArray(array($dbUserSheme['username'][1], $dbUserDate, $dbUserSheme['user_password'][1], $dbUserSheme['user_email'][1], $dbUserSheme['user_icq'][1], $dbUserSheme['user_website'][1], $dbUserSheme['user_occ'][1], $dbUserSheme['user_from'][1], $dbUserSheme['user_interest'][1], $dbUserSheme['user_viewemail'][1], $dbUserSheme['user_sorttopics'][1], $dbUserSheme['language'][1], $dbUserAct, $dbUserSheme['user_custom1'][1], $dbUserSheme['user_custom2'][1], $dbUserSheme['user_custom3'][1], $dbUserSheme['signature'][1]),$Tu);
if ($ins==0) {
zorglub
Forums Member
#7 | Posted: 12 Mar 2005 20:19
Reply 
Did I miss a simpler solution ?
zorglub
Forums Member
#8 | Posted: 12 Mar 2005 23:10
Reply 
in bb_funct_editprf.php, the $userData[XX] things have to be changed if you use another database...
according to the new database. Like
${$dbUserSheme['username'][1]}=$userData[2];
${$dbUserSheme['username'][2]}=$userData[2];
if the nicknae s in second position for instance...
Team
8-)
#9 | Posted: 14 Mar 2005 11:02
Reply 
Well, we know that it doesn't save when you registering, but it must save when you editing profile. Registering will be fixed in the next ver. All another things I've suggested ARE working except for registration, I've checked it twice. If it doesn't work, you did something wrong.
Team
8-)
#10 | Posted: 14 Mar 2005 11:04
Reply 
zorglub
It is not necessary to add something in general scripts; we are trying to make this thing, so it is not needed to edit them again when upgrading... if it would be so complicated like you suggested, why do we need $dbUserSheme at all??
zorglub
Forums Member
#11 | Posted: 14 Mar 2005 12:30
Reply 
I know, but the $userData[2] value has to be changed anyway according to the position of the nickname in the database...
Team
8-)
#12 | Posted: 14 Mar 2005 12:52
Reply 
zorglub
Changed - WHERE? I did not understand. I could send you 2 updated files from the new version so you can check it out - it should work w/o changing main scripts.
zorglub
Forums Member
#13 | Posted: 14 Mar 2005 18:17
Reply 
all right, go for the test...
But I had quite many modifications to do...

I also had to add 'radio forms'. I did something 'as I could', but what would be the 'pretty way of doing it' ? I mean like making a function for the forum language... ?
Pille
Forums Member
#14 | Posted: 14 Mar 2005 19:55
Reply 
I'm still using the older version of miniBB - I chose an easy way out and just turned the ICQ field into fullname field.
Team
8-)
#15 | Posted: 15 Mar 2005 10:03
Reply 
Pille
And you did it right... older version doesn't containt this feature.

zorglub
I'm completely lost trying to understand what you are going to say :) I think, the best way is to way for the newest release where we'll fix this error, and we will write complete manual of how to custom fields in user's profile.
 Page:  1  2  3  4  »» 
Your reply
Bold Style  Italic Style  Image Link  URL Link 


» Username  » Password 
You are welcome to post anonymously by entering a nickname with no password (if that nickname has not been taken by another member) or by leaving both fields empty. If you have a forums membership account, you can also sign in from this page without posting a message, or sign in and post at once.

Before posting, be sure your message is compliant with our forum posting rules. If not, it may be locked or deleted with no explanation.

 
Online now: Guests - 36
Members - 0
Most users ever online: 191 [24 Dec 2007 14:33]
Guests - 191 / Members - 0

Forums are powered by miniBB®