vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   Display custom field in memberlist that contains multiple selections. (https://vborg.vbsupport.ru/showthread.php?t=260867)

AFemaleProdigy 11-29-2011 01:12 PM

I had just now figured that out and came back to tell you. Lol! BUT... IT ALL WORKS NOW!! Yeay!!!!

Thanks sooooo much for your help!! I really appreciate it! :D

For anyone that wants to know, the final working code to display a custom user profile field variable (multiple selection checkbox values) in a template is:

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>

Edit the numbers accordingly, of course. ;)

TheLastSuperman 11-29-2011 07:26 PM

Edit: Nevermind I just saw your post after refreshing :cool:.

What template are you including this in?

*You can view the current usergroups in the Usergroup Manager, hover over the usefield link to see a URL displayed in your browser and note the id# ;).

Simon Lloyd 11-29-2011 07:39 PM

I don't know much but shouldn't it be something like this:
HTML Code:

<vb:if condition="$vbulletin->userinfo['field23'] == '1'">

kh99 11-29-2011 07:52 PM

Quote:

Originally Posted by Simon Lloyd (Post 2273130)
I don't know much but shouldn't it be something like this:
HTML Code:

<vb:if condition="$vbulletin->userinfo['field23'] == '1'">

It's a multiple selection profile field, so you can think of the value as a binary number where each possible selection is represented by one of the bits. The '&' operator can be used to test one bit at a time.

AFemaleProdigy 12-09-2011 02:06 PM

What I posted last does work. I am going to attempt to put this together as a mod. I will reference it here when I am done. Wish me luck! I've never posted a mod before!

@KH99 and @OcR Envy, I will include you for helping me! :)


All times are GMT. The time now is 01:53 PM.

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.01100 seconds
  • Memory Usage 1,728KB
  • 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_code_printable
  • (2)bbcode_html_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (5)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete