MyBB Community Forums

Full Version: check custom profile field
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
hi,
i want to create code into templates to check a custom profile field selection

for example there is a custom profile field with options: red,green,blue

i want to add code into a template to check the option and show a message like this:

if custom profile field selection is red the message is "hi, your's choice is red"
if custom profile field selection is green the message is "hi, your's choice is green"
if custom profile field selection is blue the message is "hi, your's choice is blue"
Were this message will be displayed?
showthread template...
any idea???
I don't know if it works but in Italy we say "Tentar non nuoce", 'there's no harm in trying idiom' with google translate so you can try.

1. Add new profile field and set this 2 settings:
-Display on profile? No
-Display on postbit? No
2. Go in your template set -> Post Bit Templates -> postbit_author_user
3. At the and add {$custom_profile}
4. Open inc/functions_post.php file
5. search
eval("\$post['user_details'] = \"".$templates->get("postbit_author_user")."\";");
6. add before
$custom_profile = sprintf("hi, your choise is %s", $mybb->user['your custom profile fid (if 3 write fid3)']);