View Full Version : Id appreciate it if anyone could answer this..
ZombieAndy
07-10-2006, 01:52 PM
ive just added this code in
<div>Style: <if condition="$post['styleid']==2"><a href="http://www.xample.com/forum/index.php?styleid=2">Blue</a></if></div>
to my users postbit's to allow them to see which styles other members are using. all is going well except it is showing blank for the Default style.. for members who havn't changed it all, its just showing
Style:
in the postbit.
i already have the style name and colour in, so i know its not that, can anyone tell me how to get it to recognise the default style?
peterska2
07-10-2006, 02:05 PM
use an if as above but leave the end me it blank ie ' '
ZombieAndy
07-10-2006, 02:18 PM
use an if as above but leave the end me it blank ie ' '
like this?
<if condition="$post['styleid']=="><a href="http://www.example.com/forums/index.php?styleid=2">Blue</a></if></div>
becuase my forums wont let me do that, when i try to save the template it says
The following error occurred when attempting to evaluate this template:
Parse error: syntax error, unexpected ')' in /includes/adminfunctions_template.php(3537) : eval()'d code on line 68
This is likely caused by a malformed conditional statement. It is highly recommended that you fix this error before continuing, but you may continue as-is if you wish.
peterska2
07-10-2006, 07:44 PM
<if condition="$post['styleid']==''"><a href="http://www.example.com/forums/index.php?styleid=2">Blue</a></if>
Thats ' ' " with no spaces
ZombieAndy
07-10-2006, 08:27 PM
still no :(
im not missing something really obvious am i? like rebuilding update counters?
tehste
07-10-2006, 08:37 PM
<div>Style: <if condition="$post['styleid']==2"><a href="http://www.xample.com/forum/index.php?styleid=2">Blue</a><else /><a href="http://www.xample.com/forum/index.php?styleid=1">Default</if></div>
If you have lots of styles then do something like:
<if condition="$post['styleid']==2">
1
<else />
<if condition="$post['styleid']==3">
2
<else />
<if condition="$post['styleid']==4">
3
<else />
default
</if>
</if>
</if>
ZombieAndy
07-10-2006, 08:52 PM
thanks alot man thats working :)
thanks alot for your help, both of ye :)
tehste
07-10-2006, 09:09 PM
of course it is!
it's all about the if structure!!!
Fastest form of flow controll in any environment! (I can't substantiate that)
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.