Mind blowing SEO improving and Google rank increasing Signature Rotator SEO Tool.

Thread: 

default value for a custom profile field in mybb

Ads
lion Offline referral

Posts: 122
Joined: May 2014
Reputation: 0

#1
Member
Hello
How can I define a default a value for a custom profile field in mybb ?

would you help me ?
Heart
marcus_avrelius Offline referral

Posts: 2,424
Joined: May 2013
Reputation: 102

#2
Support Team
I recommend you to install XThreads plugin and then use: "Additional Settings For Custom Profile Fields [1.2]" add-on to that plugin.

What custom field are we talking about here?
lion Offline referral

Posts: 122
Joined: May 2014
Reputation: 0

#3
Member
Thanks
I found the way, solved it with using php template
Heart
marcus_avrelius Offline referral

Posts: 2,424
Joined: May 2013
Reputation: 102

#4
Support Team
Open member_profile_customfields_field template and use this template conditional:

PHP Code:
<if ($customfield['fid'] == X) && !$customfield['fidX'then>default value<else>{$customfieldval}</if> 

The complate code should look like this:

PHP Code:
<tr>
<
td class="{$bgcolor}width="40%"><strong>{$customfield['name']}:</strong></td>
<
td class="{$bgcolor}width="60%"><if ($customfield['fid'] == X) && !$customfield['fidX'then>default value<else>{$customfieldval}</if></td>
</
tr

In this cede replace X with custom filed ID and replace default value text also.

This conditional will show in this case default value if the field is empty.

This method will work will all types of fields doesn't matter as long as it is empty, textbox, textarea, select box, multiple option select box, radio buttons, and checkboxes.





User(s) browsing this thread: 1 Guest(s)