vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Fed up! Why isn't this working? $vbulletin->options['hiddensigson'] (https://vborg.vbsupport.ru/showthread.php?t=246929)

BirdOPrey5 07-20-2010 02:08 AM

Fed up! Why isn't this working? $vbulletin->options['hiddensigson']
 
OK I made a new option, var name: hiddensigon
yesno type
default: 0
I double checked all the settings from a working mod and they are indentical besides the var name...

Then in my plugin I use an if statement:
PHP Code:

if ($vbulletin->options['hiddensigson'])
{
//code


But even when I turn the option to "Yes" it never executes the code... when I try to output the variable just to see what it is, I get nothing at all... $vbulletin->options['hiddensigson'] resolves to nothing...

can't figure out what is wrong.:confused:

Guest190829 07-20-2010 02:14 AM

But output, do you mean a proper var_dump() or are you just echoing it? If the latter, try the former. This is most likely a scope issue, what hook are you using?

BirdOPrey5 07-20-2010 10:46 AM

postbit_display_start

and I was just adding it on to the end of a template... I just added it like ".$hiddensigon" I tried ".'test'" and "test" showed up so the value of "$hiddensigon" should also show.

I'm guessing it's a scope issue too... do I need to include something then?

kh99 07-20-2010 01:18 PM

You probably need to add "global $vbulletin;" before your code. I think that's what Danny was thinking.

borbole 07-20-2010 01:35 PM

If the globalizing of $vbulletin won''t either, then try to use
PHP Code:

$this->registry->options['hiddensigson'


BirdOPrey5 07-20-2010 01:39 PM

thanks, (global $vbulletin;) that did it... is there any way to know ahead of time if that line is needed depending on the hook b/c the working mod I looked at didn't need it for the hook it used.

kh99 07-20-2010 01:47 PM

As far as I know, the only way is to look at the source code. For instance if you look at includes/class_postbit.php around line 265 you can see where the postbit_display_start
hook is called.

BirdOPrey5 07-20-2010 01:56 PM

thnx.


All times are GMT. The time now is 06:01 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.01031 seconds
  • Memory Usage 1,722KB
  • 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_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (8)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