Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 Programming Discussions

Reply
 
Thread Tools Display Modes
  #11  
Old 11-28-2011, 04:17 AM
AFemaleProdigy's Avatar
AFemaleProdigy AFemaleProdigy is offline
 
Join Date: Mar 2006
Location: Murrells Inlet, SC
Posts: 216
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Okay, you were right about the numbers. Some were wrong. I updated the numbers though and it still didn't do anything. I tried using == like you said and that didn't work. Did I do it like you were thinking... ?

Code:
<vb:if condition="$userfield['field23'] == 1">
                            Unknown
                            <vb:elseif condition="$userfield['field23'] == 2" />
                            No Food
                            <vb:elseif condition="$userfield['field23'] == 4" />
                            Breakfast
                            <vb:elseif condition="$userfield['field23'] == 8" />
                            Lunch
                            <vb:elseif condition="$userfield['field23'] == 16" />
                            Dinner
                            <vb:elseif condition="$userfield['field23'] == 32" />
                            Snacks
                            </vb:if>
Reply With Quote
  #12  
Old 11-28-2011, 05:25 AM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

OK, I went back and read the above posts again, and since it's multiple selection, I think you do want to use '&'. And are you sure $userfield is what you want to check? You might want $bbuserinfo[field23] (assuming this is displaying the data to the user who selected it, and not to another user (like an admin or someone).

Also, like you mentioned in an earlier post, since it's possible to have multiple options selected you don't want to use elseif, you would just want a bunch of if statements, like:

Code:
<vb:if condition="$bbuserinfo['field23'] & 1">Unknown </vb:if>
<vb:if condition="$bbuserinfo['field23'] & 2">No Food </vb:if>
<vb:if condition="$bbuserinfo['field23'] & 4">Breakfast </vb:if>
etc.
Reply With Quote
  #13  
Old 11-28-2011, 09:18 PM
AFemaleProdigy's Avatar
AFemaleProdigy AFemaleProdigy is offline
 
Join Date: Mar 2006
Location: Murrells Inlet, SC
Posts: 216
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This output will be shown to any usergroup type viewing it on a public profile and also in the custom member list I created. It is not meant to show the viewer their own personal selections, but to show the viewer the selection of whoever's profile they are viewing.
Reply With Quote
  #14  
Old 11-28-2011, 09:25 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

In that case you don't want to use $bbuserinfo, of course.
Reply With Quote
  #15  
Old 11-28-2011, 09:54 PM
AFemaleProdigy's Avatar
AFemaleProdigy AFemaleProdigy is offline
 
Join Date: Mar 2006
Location: Murrells Inlet, SC
Posts: 216
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

So this does not work either. Any ideas?

Code:
<vb:if condition="$userfield['field23'] & 1">
                            Unknown
                            <vb:elseif condition="$userfield['field23'] & 2" />
                            No Food
                            <vb:elseif condition="$userfield['field23'] & 4" />
                            Breakfast
                            <vb:elseif condition="$userfield['field23'] & 8" />
                            Lunch
                            <vb:elseif condition="$userfield['field23'] & 16" />
                            Dinner
                            <vb:elseif condition="$userfield['field23'] & 32" />
                            Snacks
                            </vb:if>
Reply With Quote
  #16  
Old 11-28-2011, 10:06 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Should have asked this from the start, but which template are you putting that in?
Reply With Quote
  #17  
Old 11-29-2011, 02:51 AM
AFemaleProdigy's Avatar
AFemaleProdigy AFemaleProdigy is offline
 
Join Date: Mar 2006
Location: Murrells Inlet, SC
Posts: 216
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It is going in the template memberinfo_block_aboutme
Reply With Quote
  #18  
Old 11-29-2011, 03:09 AM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Then I think you want this:

Code:
<vb:if condition="$userinfo['field23'] & 1">Unknown </vb:if>
<vb:if condition="$userinfo['field23'] & 2">No Food </vb:if>
<vb:if condition="$userinfo['field23'] & 4">Breakfast </vb:if>
etc
Reply With Quote
  #19  
Old 11-29-2011, 12:54 PM
AFemaleProdigy's Avatar
AFemaleProdigy AFemaleProdigy is offline
 
Join Date: Mar 2006
Location: Murrells Inlet, SC
Posts: 216
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

When I try to save the template with that, I get an error that says "adding child to non-existent node!".

Code:
<vb:if condition="$userinfo['field23'] & 1">
                            Unknown</vb:if>
                            <vb:if condition="$userinfo['field23'] & 2" />
                            No Food</vb:if>
                            <vb:if condition="$userinfo['field23'] & 4" />
                            Breakfast</vb:if>
                            <vb:if condition="$userinfo['field23'] & 8" />
                            Lunch</vb:if>
                            <vb:if condition="$userinfo['field23'] & 16" />
                            Dinner</vb:if>
                            <vb:if condition="$userinfo['field23'] & 32" />
                            Snacks</vb:if>
Reply With Quote
  #20  
Old 11-29-2011, 01:05 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I think you need to take the '/'s out of the <vb:if... tags, like this:

Code:
<vb:if condition="$userinfo['field23'] & 1">
                            Unknown</vb:if>
                            <vb:if condition="$userinfo['field23'] & 2" >
                            No Food</vb:if>
                            <vb:if condition="$userinfo['field23'] & 4" >
                            Breakfast</vb:if>
                            <vb:if condition="$userinfo['field23'] & 8" >
                            Lunch</vb:if>
                            <vb:if condition="$userinfo['field23'] & 16" >
                            Dinner</vb:if>
                            <vb:if condition="$userinfo['field23'] & 32" >
                            Snacks</vb:if>
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 04:58 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.19072 seconds
  • Memory Usage 2,256KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (6)bbcode_code
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete