MyBB Community Forums

Full Version: custom profile field button
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
<form action="usercp.php" method="post">
<input type="hidden" name="my_post_key" value="{$mybb->post_code}" />
<input type="text" name="profile_fields[fid6]" class="textbox" size="0" maxlength="500" value="{$user['fid6']}" autocomplete="off">
<input type="hidden" name="action" value="do_profile" />
<input type="submit" class="button" value="Update Profile" />
</form>

I'm trying to have people to edit this custom profile field in their profile page. This is the current code that I have, is there anyway to change only fid6 and leaving all the other settings default in ucercp?
I had a quick look and I would say it is not. But please confirm the error or difficulties you are encountering.
https://github.com/mybb/mybb/blob/featur...r.php#L526
<form action="usercp.php?action=profile" method="post">
<input type="hidden" name="my_post_key" value="{$mybb->post_code}" />
<input type="text" name="profile_fields[fid6]" class="textbox" size="0" maxlength="500" value="{$userfields['fid6']}" autocomplete="off">
<input type="hidden" name="profile_fields[fid5]" value="{$userfields['fid5']}" />
<input type="hidden" name="profile_fields[fid1]" value="{$userfields['fid1']}" />
<input type="hidden" name="profile_fields[fid2]" value="{$userfields['fid2']}" />
<input type="hidden" name="profile_fields[fid3]" value="{$userfields['fid3']}" />
<input type="hidden" name="profile_fields[fid4]" value="{$userfields['fid4']}" />
<input type="hidden" name="skype" value="{$skype}" />
<input type="hidden" name="website" value="{$website}" />
<input type="hidden" name="website" value="{$website}" />
<input type="hidden" name="birthdayprivacy" checked="checked" value="1">
<input type="hidden" name="action" value="do_profile" />
<input type="submit" class="button" value="Update Profile" />
</form>
Since you say it's not possible, so the only option is to fill every input. This is what I came up with so far, I'm not sure value="{$skype}", value="{website}" is correct or not, but those aren't important for now. So, the problem now is I'm not sure how to select Date of Birth and Date of Birth Privacy with input. I'm getting this error "Please choose a valid birthday privacy option." whenever I submit.
You can find valid values for the privacy field in the following code:
https://github.com/mybb/mybb/blob/master...r.php#L431

To keep the current user setting I think you will need to use {$mybb->user['birthdayprivacy']} for value.