MyBB Community Forums

Full Version: Custom profile fields
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello,

I am trying to work my head around the profile field system, is there a way to hide the field if not filled or even just make it say "Not specified" if not filled in?

Thanks

[Image: 923231bace9e.png]
(2014-02-24, 12:51 PM).m. Wrote: [ -> ]see Hide empty profile fields in profiles

Thanks, I tried doing the method someone in that thread provided with PHP Template Conditionals however I get "Parse error: syntax error, unexpected '' (T_ENCAPSED_AND_WHITESPACE), expecting identifier (T_STRING) or variable (T_VARIABLE) or number (T_NUM_STRING)" when I use it.

<?php
if(!empty($post['fid1']))
{
echo "<p>Location: " . $post['fid1'] . "</p>";
}
?>
^ PHP in Templates plugin should be installed to use that code
(2014-02-24, 01:14 PM).m. Wrote: [ -> ]^ PHP in Templates plugin should be installed to use that code

Does it not work with the Template Conditionals or did you just miss that bit of my message? Confused
^ php code (used with <?php ?> tags) does not work with template conditionals plugin
(2014-02-24, 01:25 PM).m. Wrote: [ -> ]^ php code (used with <?php ?> tags) does not work with template conditionals plugin
Oh?

Any other to do it via templates with conditionals?

I would prefer it to say not specified rather than completely disappear
I think it can be done with template conditionals please check

<if (!empty($customfield['fid1'])) then>Something<else>something</if>
(2014-02-24, 02:30 PM)marcus123 Wrote: [ -> ]I think it can be done with template conditionals please check

<if (!empty($customfield['fid1'])) then>Something<else>something</if>

Thanks a lot.

<if (!empty($userfields['fid1'])) then>{$userfields['fid3']}<else>Not Specified</if>

Worked a treat