View Full Version : Using IF condition
Haltech
03-31-2008, 10:12 PM
This doesn't work, but is there a way to do something equivalent to this:
<if condition="$post['field70']" == "Yes">
<script language="javascript"><!--
location.replace("banned.html")
//-->
</script></if>
Opserty
03-31-2008, 10:35 PM
<if condition="$post['field70'] == Yes">
Dismounted
04-01-2008, 04:45 AM
<if condition="$post['field70'] == 'Yes'">
Strings must always be enclosed with quotes ;).
Haltech
04-01-2008, 05:44 AM
Thanks. How would I be able to put the javascript into effect, because for some reason for people who say Yes to that field, it does nothing,
Dismounted
04-01-2008, 08:06 AM
<if condition="$vbulletin->userinfo['field70']" == "Yes">
<script type="text/javascript">
<!--
location.replace("banned.html");
//-->
</script>
</if>
Boofo
04-01-2008, 08:12 AM
Shouldn't it be:
<if condition="$vbulletin->userinfo['field70'] == 'Yes'">
<script type="text/javascript">
<!--
location.replace("banned.html");
//-->
</script>
</if>
Adrian Schneider
04-01-2008, 08:14 AM
Right -- the whole condition should be enclosed within double quotes. $vbulletin->userinfo['field70'] == 'Yes'
Opserty
04-01-2008, 11:43 AM
Whoops my bad, forgot about those ones. :D
Boofo
04-01-2008, 12:11 PM
We had you covered, sir. ;)
Haltech
04-02-2008, 10:44 PM
Thanks guys. .Works perfect.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.