MyBB Community Forums

Full Version: Using if blocks to evaluate custom fields
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I would like to put a specific image in my forums, but only if a custom field is filled out AND another field is checked.

I have tried using a
if $post{'fid3'} && $post{'fid2'} :
block, but it doesn't seem to work, it always evaluates true. Same as breaking up the 2 if blocks into nested blocks. Is there any way to do this?
Firstly, braces aren't the correct syntax to index into arrays (you should check the PHP documentation).

Otherwise, what are $post['fid3'] and $post['fid2'] ?
I used the array brackets, i just mistyped it when i posted here.

The 2 fields i am using are a checkbox (precedence) and a text box. I am trying to display a gamercard.
Try displaying the values of those fields. If it's evaluating to true, when it should be false, you should change your conditional.