PDA

View Full Version : IF conditional Question about radio buttons


mac27
02-16-2007, 02:13 AM
I have a hack and I am wanting a custom user field(uses Radio Buttons) to only show up in postbit if the user selects yes in their profile. I have tried this:

<if condition="$post['fieldX]">

This does not work for me. It works for text input fields but not radio buttons.

I know this is probably simple but could someone shed some light on this for me?


Oh and this question is just for my own fyi. Can custom user fields be created automatically when a hack is installed?

Thanks for any input.

Never mind I figured it out. I forgot the =='Yes' on the end.

KiraLove
03-16-2007, 11:17 AM
This didn't work for me.

<if condition="$post['fieldX] == 'Yes'">
it was yes
</if>

never prints "it was yes" no matter the setting.

AHA! I found the problem. Everyone always uses $post in your examples but that is WRONG. it's bbuserinfo.

this works:

<if condition="$bbuserinfo[field25]=='Yes'">Code</if>

Thank you vbulletin.org!

Gray Matter
03-16-2007, 05:00 PM
This didn't work for me.

<if condition="$post['fieldX] == 'Yes'">
it was yes
</if>

never prints "it was yes" no matter the setting.

AHA! I found the problem. Everyone always uses $post in your examples but that is WRONG. it's bbuserinfo.

this works:

<if condition="$bbuserinfo[field25]=='Yes'">Code</if>

Thank you vbulletin.org!

No, $post is correct here because $post will check the profile field of the user posting the message, $bbuserinfo checks that profile field of the user viewing it. ;)