vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Plugin Variables, and Templates Help (https://vborg.vbsupport.ru/showthread.php?t=129386)

C Braithwaite 10-18-2006 08:44 AM

Plugin Variables, and Templates Help
 
Hiya, i was trying to make a plugin which would display in any template on my site. i simplified the plugin to:

vBulletin
global_start

$mytestvariable = "Hello World";

and then placed the $mytestvariable variable into my template, but it would not show.

Anyone know how i can create a variable that i can use on any page?

Thanks in advance

Adrian. 10-18-2006 11:18 AM

I put the PHP in the hook location, to where i want my variable.

If that makes sense, for example, if i wanted to display the variable on the forum home, i would choose the location "forumhome_start".

That should work.

C Braithwaite 10-18-2006 11:46 AM

Quote:

Originally Posted by Adrian.
I put the PHP in the hook location, to where i want my variable.

If that makes sense, for example, if i wanted to display the variable on the forum home, i would choose the location "forumhome_start".

That should work.


Yep that makes sense, however what i need is the variable to be available on all pages, including my custom pages (well, page) - is that possable?

if not, i could code the plugin into my custom page - where would i put the hook for displaying threads?

ps, cheers for the reply :)

Kirk Y 10-18-2006 04:13 PM

Try hook location 'global_start'.

C Braithwaite 10-18-2006 09:48 PM

Quote:

Originally Posted by acidburn0520
Try hook location 'global_start'.

yeh i tried that after reading another one of your posts, but it wouldnt work for me. :S

Kirk Y 10-18-2006 10:02 PM

What template are you trying to access the variable in? Because it should work.

C Braithwaite 10-19-2006 07:56 AM

Quote:

Originally Posted by acidburn0520
What template are you trying to access the variable in? Because it should work.


POSTBIT, and a custom one.

for postbit, it works in postbit_display_complete, but not global_start

Kirk Y 10-19-2006 11:00 AM

What version of vBulletin are you using?

C Braithwaite 10-19-2006 11:57 AM

Quote:

Originally Posted by acidburn0520
What version of vBulletin are you using?

Powered by vBulletin Version 3.6.2

Kirk Y 10-19-2006 04:00 PM

Weird. I always assumed that global_start was... well, global.

I guess you'll just have to use postbit_display_start. For your Custom Page, it'd probably be simpler to just include the PHP code within the file itself, rather than using hooks.


All times are GMT. The time now is 10:34 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.01535 seconds
  • Memory Usage 1,727KB
  • 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
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)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