vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   IF conditional Question about radio buttons (https://vborg.vbsupport.ru/showthread.php?t=139541)

mac27 02-16-2007 02:13 AM

IF conditional Question about radio buttons
 
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

Quote:

Originally Posted by KiraLove (Post 1204781)
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. ;)


All times are GMT. The time now is 04:52 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01439 seconds
  • Memory Usage 1,711KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (3)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete