miniBB ® 

miniBB

®
Support Forums
  
 | Start | Register | Search | Statistics | File Bank | Manual |
Master Class miniBB Support Forums / Master Class /  
 

Adding new user profile field (Full name)

 
 
Page  Page 1 of 4:  1  2  3  4  Next »

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

thanks

Author Team
8-)
#2 | Posted: 3 Mar 2005 11:19 
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.

Author Anonymous
Guest
#3 | Posted: 6 Mar 2005 13:52 
user_custom_fullname dont save to the database, where is the scripts to insert it into the database ?

thanks

Author Team
8-)
#4 | Posted: 7 Mar 2005 10:28 
What do you mean by "doesn't" save? It doesn't save when you are doing what?

Author zorglub
Partaker
#5 | Posted: 12 Mar 2005 20:05 
well, I mean the same : it doesn't save the datas in the database...
I'm using the RC2a...

Author zorglub
Partaker
#6 | Posted: 12 Mar 2005 20:18 
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) {

Author zorglub
Partaker
#7 | Posted: 12 Mar 2005 20:19 
Did I miss a simpler solution ?

Author zorglub
Partaker
#8 | Posted: 12 Mar 2005 23:10 
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...

Author Team
8-)
#9 | Posted: 14 Mar 2005 11:02 
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.

Author Team
8-)
#10 | Posted: 14 Mar 2005 11:04 
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??

Author zorglub
Partaker
#11 | Posted: 14 Mar 2005 12:30 
I know, but the $userData[2] value has to be changed anyway according to the position of the nickname in the database...

Author Team
8-)
#12 | Posted: 14 Mar 2005 12:52 
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.

Author zorglub
Partaker
#13 | Posted: 14 Mar 2005 18:17 
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... ?

Author Pille
Partaker
#14 | Posted: 14 Mar 2005 19:55 
I'm still using the older version of miniBB - I chose an easy way out and just turned the ICQ field into fullname field.

Author Team
8-)
#15 | Posted: 15 Mar 2005 10:03 
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  Page 1 of 4:  1  2  3  4  Next » 
Master Class miniBB Support Forums / Master Class /
 Adding new user profile field (Full name)
 Share Topic's Link

Your Reply Click this icon to move up to the quoted message


  ?
Post as a Guest, leaving the Password field blank. You could also enter a Guest name, if it's not taken by a member yet. Sign-in and post at once, or just sign-in, bypassing the message's text.


Before posting, make sure your message is compliant with forum rules; otherwise it could be locked or removed with no explanation.

 

 
 
miniBB Support Forums Powered by Forum Software miniBB ® Home  Features  Requirements  Demo  Download  Showcase  Gallery of Arts
Compiler  Premium Extensions  Premium Support  License  Contact Us
Get the Private Messaging add-on: allow your miniBB-forums members to communicate with each other.


  ⇑