vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Hook & Variable Question (https://vborg.vbsupport.ru/showthread.php?t=156040)

kirstyd 08-23-2007 11:09 AM

Hook & Variable Question
 
I feel like I'm missing something *very* obvious here.

I have some extra user variables I want to be able to access from any page on the site, so I'm trying to set them in the global_start hook on v3.6.5. But no matter what I do I can't see the variables later on.

E.g. if I just add a very basic plugin on the global_start hook:

Code:

global $myvariable;
$myvariable = "boo!";

then later on my vbulletin page $myvariable is not set.

Any ideas?

thanks
kirsty

SDB 08-23-2007 12:41 PM

Hi Kirsty

I've had this happen a number of times and muddled through until i've sorted it.

Which template are you trying to access the variable from?

Try accessing it from a really basic template like header first.

Paul M 08-23-2007 04:18 PM

Where [later on] are you trying to use it ?

kirstyd 08-24-2007 08:35 AM

I got it all to work in the end.

I think it wasn't working because one of the lines I'd commented out hadn't been fully commented out so there was half a line of PHP causing an error, which just seemed to stop the hook from being run whilst everything else carried on regardless. I knew it would end up being something silly.

If this should have produced an error message somewhere let me know so I'll know next time :D

thanks
kirsty


All times are GMT. The time now is 07:27 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.01135 seconds
  • Memory Usage 1,710KB
  • 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
  • (4)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