Log in

View Full Version : Help with this" if conditional"


Scandal
12-12-2010, 06:21 AM
Hello!
In postbit_legacy template I have put the following code to display a custom profile field.
<if condition="$post['field6']"><div><strong>Job:</strong> $post[field6]</div></if>

I don't want to display the "Job: fieldvalue" if the fieldvalue is "example".
How should I change the conditional to achieve it?

Sorry for my bad english..

kh99
12-12-2010, 07:33 AM
Try

<if condition="$post['field6'] AND $post['field6'] != 'Example'"><div><strong>Job:</strong> $post[field6]</div></if>

Scandal
12-12-2010, 10:39 AM
I get the error:
The following error occurred when attempting to evaluate this template:

Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in C:\AppServ\www\forum\includes\adminfunctions_templ ate.php(3939) : eval()'d code on line 56

:(

kh99
12-12-2010, 11:11 AM
Hmm...it works for me. Are you sure you don't have single quotes (like in $post['field6']) somewhere outside the if condition?