MyBB Community Forums

Full Version: Custom Profile fields help?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
I have done a load of Custom Profile fields but the problem now is now customizing the layout of them. On the Custom Profile Template it said;

{$customfields}

But I was wondering, is it possible to request a SINGLE Custom profile option? e.g I have Personality and I would like to make that as a single.

e.g {$personality}

Is it possible to request a single variable (if you can call it that?)

Sorry for any confusion.
You can hide some custom fields from the ACP and show them in member_profile or postbit/postbit_classic using the tutorial (or one similar to that one) provides.
(2011-10-31, 01:27 PM)Chrome Wrote: [ -> ][align=justify]I have done a load of Custom Profile fields but the problem now is now customizing the layout of them. On the Custom Profile Template it said;

{$customfields}

But I was wondering, is it possible to request a SINGLE Custom profile option? e.g I have Personality and I would like to make that as a single.

e.g {$personality}

Is it possible to request a single variable (if you can call it that?)

If you mean in profile page, I think you need a plugin, at least to sanitize it.
You can use this kinds of variable directly in your profile page (member_profile) template:
{$userfields['fidx']}
Replacing the x with a custom profile fields id will call the value.

But still, you need to sanitize it (if you care about your forum security).
I'm pretty sure MyBB sanitizes it on insertion.
I'm not talking about the insertion, I'm talking about the output (that's what the OP want to do).
Data from the $userfields array doesn't need to be sanitized when you output it..
Really? Then, try it.
Hmm... I thought this was fixed in one of the last few releases. I must have been mistaken.
Just add:
$post['fidX'] = htmlspecialchars_uni($post['fidX']);
where you need it to sanitize.
Pages: 1 2