vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Variables for conditionals (https://vborg.vbsupport.ru/showthread.php?t=64118)

AshAbed 02-24-2005 03:33 PM

How about this...
I have a profile field with a dropdown list where a member chooses the state they live in. I want a conditional that says 'if user selected choice #__ in profile field #__.'

Thanks.

kall 02-24-2005 03:37 PM

Quote:

Originally Posted by AshAbed
How about this...
I have a profile field with a dropdown list where a member chooses the state they live in. I want a conditional that says 'if user selected choice #__ in profile field #__.'

Thanks.

Code:

<if condition="$var[fieldX]">do stuff</if>
I think.

$var would be $post or $bbuserinfo or whatever.

neocorteqz 02-24-2005 10:35 PM

Quote:

Originally Posted by kall
Code:

<if condition="$var[fieldX]">do stuff</if>
I think.

$var would be $post or $bbuserinfo or whatever.

For fields in profile it's $bbuserinfo.

and yes that is the conditional

HTML Code:

<if condition="$bbuserinfo[fieldX]">Some code here </if>
If the user didn't selct a certain choice you don't want displayed, I'mnot exactly sure what you do. I know you can exlude code by != But I'mnot exactly sure how one would excluse a profile field that is notstatic.

AshAbed 02-24-2005 11:36 PM

I made it so the users must select a choice upon registration. Lets say they chose '7' and the field's ID is '15'... what would be the code to display something for a user with that selected?

T3MEDIA 02-25-2005 03:06 AM

Quote:

Originally Posted by neocorteqz
$bbuserinfo[field20]

This only works on areas where the logged in user is. I want a varable. say userid 2555 field 20 this is what I mean. How can you do that?

DavidatMPA 04-18-2005 01:20 AM

Yep, gotta love the search, GREAT thread!

dutchbb 09-23-2005 12:38 PM

Sorry to bump this but:

I want to show code in a certain thread. So I use the threadID

How do I define the conditional for a threadid?

T3MEDIA 10-06-2005 11:38 AM

Quote:

Originally Posted by T3MEDIA
This only works on areas where the logged in user is. I want a varable. say userid 2555 field 20 this is what I mean. How can you do that?

light bump to refresh my first question.

SO if say YOU are looking at my page you can see visually my field 20.
So I am asking how to pull up.... say... my userid... not yours... (as in bbuser) and find field 20

Yorixz 10-23-2005 01:13 PM

Might be a little late for a reaction but still; I'm wondering if there's also a $post variable available that contains the name of the usergroup as person is in. In fact it would be similar to the "Group:" you got with IPB, I just don't feel like putting up 10 conditionals for every usergroup I've got...
I want to be able to let people edit their usertitle without having trouble with users acting like they're a staffmember.

perju 04-07-2007 11:17 PM

This thread is great. Can somone provide a list for the $post array?


All times are GMT. The time now is 06:21 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.01245 seconds
  • Memory Usage 1,740KB
  • 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
  • (2)bbcode_code_printable
  • (1)bbcode_html_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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