vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=251)
-   -   Plugin Variable Not Displaying (https://vborg.vbsupport.ru/showthread.php?t=266771)

FireFeather 07-13-2011 09:45 PM

Plugin Variable Not Displaying
 
I've been searching for a solution for this for several hours and I haven't been able to resolve my issue though I've implemented exactly as quite a few tutorials have shown.

I'm trying to include a PHP file (ultimately) in the header, but have simplified the process just to test the variables at this time.
I've created a new plug in with the follow fields set:

Product: vBulletin
Hook Location: global_start
Title: Include CC Site Banner/Menu
Execution Order: 1
Plugin PHP Code:
ob_start();
include(DIR.'/../library/header.php');
$includedphp = ob_get_contents();
ob_end_clean();
$includedphp = 'julie is testing the header';
vB_Template::preRegister('header',array('includedp hp ' => $includedphp));
Plugin is Active: Yes

In the "header" template, at the very top, I have added:
{vb:raw includedphp} testing

The location of this forum is at:
http://www.centercross.com/forum/
I can view the "testing" output that was put into the header template directly, but I cannot for the life of me get the "julie is testing the header" to appear before it.

Any suggestions anyone has would be greatly appreciated.

-Julie
Texas

--------------- Added [DATE]1310601479[/DATE] at [TIME]1310601479[/TIME] ---------------

Also, as a side note, the master plugin system is indeed turned on:
Enable Plugin/Hook System: Yes

kh99 07-13-2011 09:59 PM

This line:

Code:

vB_Template:PreRegister('header',array('includedphp ' => $includedphp));
has a space after the first includephp (inside the quotes). I don't know if that's just a typo in the post or what.

FireFeather 07-13-2011 10:03 PM

SOLVED
I have identified the issue. The code I copied from the documentation on including external files has an extra "space" character after the array key definition. Upon deleting that white space, it all worked fine.

Sorry for not noticing before I posted!

--------------- Added [DATE]1310601820[/DATE] at [TIME]1310601820[/TIME] ---------------

Quote:

Originally Posted by kh99 (Post 2220242)
This line:

Code:

vB_Template:PreRegister('header',array('includedphp ' => $includedphp));
has a space after the first includephp (inside the quotes). I don't know if that's just a typo in the post or what.

Thank you KH99, I noticed this myself just minutes ago. Thank you for your input!


All times are GMT. The time now is 11:54 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.01385 seconds
  • Memory Usage 1,717KB
  • 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_code_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (3)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