PDA

View Full Version : Simple Conditional


Nination
12-19-2005, 08:35 PM
Well, I asked for vB support, but didn't work out. Can you guys help?


Hello, I had a brief question about forum conditionals.

This is my conditional:
<if condition="$post[field7]">
<!-- java decoration -->
<else />
<!-- no decoration -->
</if>

I have 2 radio buttons (yes and no). Yes for show decoration, and no to not show the decoration. I am trying to place this in the header.

Adrian Schneider
12-19-2005, 08:48 PM
$post isn't available in the header...

Is field7 what the current user selected?

If so, try

<if condition="$vbulletin->userinfo['field7'] == 'Yes'">java decoration<else />no java decoration</if>

Nination
12-19-2005, 08:57 PM
Thanks man. =) Here is the full code for anyone who wants it (may release a product later). It installs a nice little snow effect on your board, I'm sure you can figure out the check box as a custom profile field your self.

<if condition="$vbulletin->userinfo['field7'] == 'Yes'">
<!-- Snow Effect(Small SnowFlakes) by Blackpheonix ? to Dynamic Drive -->
<script type="text/javascript" src="/board/images/misc/snow.js">
</script>
<!-- /Snow Effect(Small SnowFlakes) by Blackpheonix ? to Dynamic Drive -->
<else />
<!-- no snow decoration -->
</if>

Use with this hack. :nervous: (https://vborg.vbsupport.ru/showthread.php?t=99991&highlight=snow)

noppid
12-19-2005, 08:59 PM
Aren't yes/no fields boolean?

Adrian Schneider
12-19-2005, 09:57 PM
Aren't yes/no fields boolean?

If the radio value is "Yes" then no, it is a string and then both "Yes" and "No" will be true.