Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
  #1  
Old 04-19-2004, 10:38 PM
JohnK JohnK is offline
 
Join Date: Nov 2001
Posts: 30
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Variables for conditionals

I am just starting to look at using conditionals, and they look like a simple but powerful tool. However you need to know what variables are available and what they do.

Is this documented anywhere? I've looked through the manual and searched on vbulletin.com and here but can't find anything -- have I missed it?

Thanks
John
Reply With Quote
  #2  
Old 04-19-2004, 10:43 PM
assassingod's Avatar
assassingod assassingod is offline
 
Join Date: Jul 2002
Posts: 3,337
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It really depeds on what you want to do. There isn't a list of what variable you can use because you can use anything.
Reply With Quote
  #3  
Old 04-19-2004, 11:24 PM
SVTBlackLight01's Avatar
SVTBlackLight01 SVTBlackLight01 is offline
 
Join Date: Jan 2003
Location: Texas
Posts: 504
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

As far as I know (which isn't much ), there isn't a list of the variables anywhere. Although a single searchable location of all the variables and what they do would be great.
Reply With Quote
  #4  
Old 04-19-2004, 11:42 PM
filburt1 filburt1 is offline
 
Join Date: Feb 2002
Location: Maryland, US
Posts: 6,144
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by JohnK
I am just starting to look at using conditionals, and they look like a simple but powerful tool. However you need to know what variables are available and what they do.

Is this documented anywhere? I've looked through the manual and searched on vbulletin.com and here but can't find anything -- have I missed it?

Thanks
John
I very strongly agree with you that there needs to be a great deal of documentation available on what variables can be used (for example; what keys are in the $post array for postbits, $bbuserinfo everywhere, etc.).
Reply With Quote
  #5  
Old 04-20-2004, 12:13 AM
JohnK JohnK is offline
 
Join Date: Nov 2001
Posts: 30
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

OK, how about something really basic

The variables appear to be in two parts eg $bbuserinfo['userid'] there are also $show $post etc

Can anyone start by explaining how this works?

Thanks
John
Reply With Quote
  #6  
Old 06-18-2004, 03:28 PM
zetetic's Avatar
zetetic zetetic is offline
 
Join Date: Apr 2004
Posts: 338
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by JohnK
OK, how about something really basic

The variables appear to be in two parts eg $bbuserinfo['userid'] there are also $show $post etc

Can anyone start by explaining how this works?
I assume you've figured this out by now, but in case anyone else stumbles on this thread and is wondering the same thing...

$bbuserinfo is a variable array: A variable that can hold multiple values, as opposed to a standard variable that holds only one value.

'userid' is one value in the $bbuserinfo array that is only set if the user is a registered member.

So basically "if $bbuserinfo['userid']" is equivelant to saying, "Is the 'userid' value in the $bbuserinfo array set? If yes, then the user is registered".

To the best of my knowledge there is no one location where all the standard conditionals are documented here. One developer said it's because there are dozens of variable arrays with hundreds of values each, and as such making a list is just too time consuming for anyone to get to it right now.

Or something.
Reply With Quote
  #7  
Old 06-18-2004, 03:38 PM
Zachery's Avatar
Zachery Zachery is offline
 
Join Date: Jul 2002
Location: Ontario, Canada
Posts: 11,440
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by tmhall
I assume you've figured this out by now, but in case anyone else stumbles on this thread and is wondering the same thing...

$bbuserinfo is a variable array: A variable that can hold multiple values, as opposed to a standard variable that holds only one value.

'userid' is one value in the $bbuserinfo array that is only set if the user is a registered member.

So basically "if $bbuserinfo['userid']" is equivelant to saying, "Is the 'userid' value in the $bbuserinfo array set? If yes, then the user is registered".

To the best of my knowledge there is no one location where all the standard conditionals are documented here. One developer said it's because there are dozens of variable arrays with hundreds of values each, and as such making a list is just too time consuming for anyone to get to it right now.

Or something.
there are only a speciric ammount of $show varibles and for the most part they are not global

$bbuserinfo
$vboptions
$stylevar
Are the 3 globals that i am aware about besides $GLOBAL

$bbuserinfo can show anything that is stored in the usertable field for the specific person who is online: IE $bbuserinfo[posts] will show the amount of posts, $bbuserinfo[username] will show a users, username.

$vboptions are all the options that are stored in the settings table like to show DHTML or the name of your board or even your bulletin boards url
$vboptions[bburl] $vboptions[homeurl]

$stylevar holds all the non css style settings, like the image directorys.

The problem with the documentation is there are so many vairbles that are possible for all thoughs said templates its hard to just document them.
Reply With Quote
  #8  
Old 06-18-2004, 03:40 PM
vbmechanic vbmechanic is offline
 
Join Date: Jan 2004
Posts: 104
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

A comprehensive list of $vboptions and $stylevar would be dandy.
Reply With Quote
  #9  
Old 06-18-2004, 03:42 PM
Zachery's Avatar
Zachery Zachery is offline
 
Join Date: Jul 2002
Location: Ontario, Canada
Posts: 11,440
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by vbmechanic
A comprehensive list of $vboptions and $stylevar would be dandy.
Ill see about getting a list out for thoughs two later today,
Reply With Quote
  #10  
Old 06-18-2004, 03:47 PM
zetetic's Avatar
zetetic zetetic is offline
 
Join Date: Apr 2004
Posts: 338
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

There's a post here that suggests one way of finding out what is stored in a particular array. As mentioned in that thread, though, you'll only see the output relevant to the current user.
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 03:44 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.04458 seconds
  • Memory Usage 2,248KB
  • 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
  • (4)bbcode_quote
  • (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