vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   How do I set up an Invitation Code field that modifies header depending on value(s) (https://vborg.vbsupport.ru/showthread.php?t=70719)

geoskep 10-18-2004 05:14 PM

How do I set up an Invitation Code field that modifies header depending on value(s)
 
I would like to set up and Invitation Code field in user profiles that could have different and multiple values. Depending on the value(s), the user would see various header menu selections.

For example if the invitation code is 'ABC', I would like to see an ABC menu selection, if 'DEF', a DEF menu selection and if 'ABC DEF', both the ABC and the DEF menu selections.

I know how to set up the field; but I don't know how to make the '<if condition ' routine work in the header template when the Invitation Code field can have multiple values.


Any ideas. :rolleyes:

Thanks

Colin F 10-18-2004 05:38 PM

Hi

Make a custom profile field with the value and then make conditionals like this:

Code:

<if condition="$bbuserinfo[fieldx] == abc">ABC</if>
<if condition="$bbuserinfo[fieldx] == def">DEF</if>


geoskep 10-18-2004 05:52 PM

Thanks, but that only works for single value codes.

If there are multiple codes in the field, I need to know which codes they are, so I can select the appropriate multiple menu selections.

Colin F 10-18-2004 06:03 PM

how are the multiple values stored? if they're stored seperated with commas, you can use array() and then in_array(), if they're in different profilefields, you can check each one individually.

geoskep 10-19-2004 08:06 PM

Thanks for the quick response. P.S. I changed my initial response to this new code.

I am using comma separated values. abc,def,ghi in [fieldx] and the following condition code. It doesn't work. I'm lost.

<if condition="in_array(def,array($bbuserinfo[fieldx]))">
TEXT FOR DEF
</if>

Thanks


All times are GMT. The time now is 09:21 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.01084 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_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete