MyBB Community Forums

Full Version: How to add custom profile fields in "edit profile" manually?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello guys,

I added some custom profile fields to my board. I wanted to sort them by categories so I made tabs in "edit profile" in UCP.
In this case I have to add all these fields manually. I used this code (example):

<td><input class="textbox" type="text" value="" size="0" name="profile_fields[fid8]" style="width:230px;"></input></td>

It works but when I refresh "edit profile" page the field is empty. I thought it is something wrong with value so I checked in usercp.php how custom fields are being added. So I added {$val} to value:

<td><input class="textbox" type="text" value="{$val}" size="0" name="profile_fields[fid8]" style="width:230px;"></input></td>

Unfortulately this hasn't solved my problem. How to add custom profile fields in "edit profile" in UCP manually?

Btw. Happy new year! Smile
Any ideas?
I don't think you can achieve it without core changes or this plugin: http://mybbhacks.zingaburga.com/showthread.php?tid=1271 It allows you to use custom inputs like this: {$xtpf_inp['fidX']}. You can read more in that topic.
One more question:

Is there any possibility to rewrite this to be shorter?

<if $xtpf['fid33'] || $xtpf['fid34'] || $xtpf['fid35'] || $xtpf['fid36'] || $xtpf['fid37'] || $xtpf['fid38'] || $xtpf['fid39'] || $xtpf['fid40'] || $xtpf['fid41'] || $xtpf['fid42'] then> group of fields </if>

For example by using an array?