Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 12-17-2009, 07:06 AM
muratmunich muratmunich is offline
 
Join Date: Oct 2005
Location: Germany
Posts: 329
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Register Option Variables

How to register vbulletin option variables ?

PHP Code:
$myvar=&$vbulletin->options['top_count'];
$templater->register('myvar'$myvar); 
Is there a better way without making a reference to $myvar ?

Maybe Global Product Option Variable Registration ?

Or
PHP Code:
{vb:optionvar top_count
Reply With Quote
  #2  
Old 12-17-2009, 02:08 PM
James Birkett James Birkett is offline
 
Join Date: Jun 2009
Posts: 633
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You'd think there would be. I'd expect global template variables for $vbulletin->options, vboptions and stylevar at least. I would also expect {vb:user } too.

Do you have to register $vbulletin->options? I would've thought you'd only need to register $vbulletin then any property under it is automatically registered, like with arrays.
Reply With Quote
  #3  
Old 12-17-2009, 03:11 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I don't know that you have to register options. Did you try it without registering it?
Reply With Quote
  #4  
Old 12-17-2009, 05:54 PM
consolegaming consolegaming is offline
 
Join Date: Jan 2007
Posts: 168
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Nah you don't need to register options, stylevar or user variables. I've used them fine in my custom template without any issues. I'm not sure which others are registered globally but I've used those arrays already in my custom templates. So I know for sure they're already globally registered.

Examples of userinfo, options and stylevar variables:

{vb:raw bbuserinfo.username}
{vb:raw vboptions.bburl}
{vb:stylevar imgdir_misc}
Reply With Quote
  #5  
Old 12-17-2009, 06:01 PM
muratmunich muratmunich is offline
 
Join Date: Oct 2005
Location: Germany
Posts: 329
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I am now at work and can't test, but i'll do when i am back at home and tell you then Results.

But what i mean is option variables from other Products and not vbulletin.

Example:
PHP Code:
$vbulletin->options['vbtube_show_lposts'
The Reason i am asking is, i don't want to reference to another Variable if it's possible.
Thought somebody has the same issue and already know a Solution..

This is what i want if possible:
PHP Code:
{vb:raw vboptions.vbtube_show_lposts
Reply With Quote
  #6  
Old 12-17-2009, 06:13 PM
consolegaming consolegaming is offline
 
Join Date: Jan 2007
Posts: 168
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

That should be possible I'd have thought. As what it'll do is select all the same (presumably) options and just load them that way instead so yeah if that was how it was referred to before hand even if it's a custom product I'd say that it should work.

A custom field I added to the user table for example was still stored in the bbuserinfo array.

Hope it works for ya, though it should do.
Reply With Quote
  #7  
Old 12-17-2009, 06:19 PM
muratmunich muratmunich is offline
 
Join Date: Oct 2005
Location: Germany
Posts: 329
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Code is working without a Reference and no Registration.

PHP Code:
{vb:raw vboptions.vbtube_show_lposts
Fine - Thanks...
Reply With Quote
  #8  
Old 12-17-2009, 07:02 PM
James Birkett James Birkett is offline
 
Join Date: Jun 2009
Posts: 633
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by consolegaming View Post
Nah you don't need to register options, stylevar or user variables. I've used them fine in my custom template without any issues. I'm not sure which others are registered globally but I've used those arrays already in my custom templates. So I know for sure they're already globally registered.

Examples of userinfo, options and stylevar variables:

{vb:raw bbuserinfo.username}
{vb:raw vboptions.bburl}
{vb:stylevar imgdir_misc}
I thought bbuserinfo could be used as a :var rather than a :raw?
Reply With Quote
  #9  
Old 12-17-2009, 07:05 PM
consolegaming consolegaming is offline
 
Join Date: Jan 2007
Posts: 168
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Not sure. I just know using it like that worked for me lol. I wasn't even aware of a :var I just copied how they did it in their own templates i.e. in the header template.
Reply With Quote
Reply


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 10:51 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.04213 seconds
  • Memory Usage 2,242KB
  • Queries Executed 13 (?)
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
  • (5)bbcode_php
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (9)post_thanks_box
  • (9)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (9)post_thanks_postbit_info
  • (9)postbit
  • (9)postbit_onlinestatus
  • (9)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
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete