PDA

View Full Version : Need hook after setup/before header load


zivester
07-28-2008, 06:15 PM
I've done this before, but on my new plugin, the same hook location doesn't work.

I have a php file that I want to use to create a specific nav. I've put into my header a variable, $ppheader that gets filled by the following code:


ob_start();
include('/ma/path/header2.php');
global $ppheader = ob_get_contents();
ob_end_clean();


if I hook it on global_start, $ppheader gets the content from the file, but bbuserinfo has not been properly filled out for the user, so It doesn't output the right data (it outputs according to a visitor)

If I put it on global_setup_complete, the header isn't filled out (because ppheader is being filled after the header is sent I imagine?)


Where should I hook this?

Dismounted
07-29-2008, 06:46 AM
You don't need the global keyword.
ob_start();
include('/ma/path/header2.php');
$ppheader = ob_get_contents();
ob_end_clean();
In PHP files, use $vbulletin->userinfo, instead of $bbuserinfo.

zivester
07-29-2008, 02:48 PM
ahhh... that $vbulletin was it... thanks dismounted!