MyBB Community Forums

Full Version: If statement
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I need a simple If statement.

<span style="color: ? >(word)</span>

the ? should be an IF statement.

I'm using a custom profile field in which members can note down a color code, then the word should be displayed in that color they specified in the custom profile field, but if they don't put anything in the profile field and it is thus empty, the word should be displayed in green automatically.

Can you guys help me with finding the right IF-statement for this?

The name of the custom profile field btw is {$post['fid4']}

Thanks in advance Smile
Never mind, already solved without the use of an IF-statement, just put:

<span style="color: green; color: {$post['fid4']};">(word)</span>