The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Accessing notifications on an external forum page
Here is my set up...
1) I have a header.php and footer.php file outside of vBulletin that defines the style of my entire site 2) I include these files into vBulletin via a custom plugin hooked into global_start: PHP Code:
Same for footer, this lets me reference my header.php file (which has a lot of custom PHP code in it) inside a vBulletin template using: $headerinclude and footer with $footerinclude 3) To make pages outside of vBulletin that can access it's resources, I do something like this: PHP Code:
4) Everything works fine, I figured out that the array is called $notifications.. if I do a var_dump($notifications) in my header.php file and load my external page I get: PHP Code:
Any ideas? |
#2
|
|||
|
|||
I think the problem is that the global_start hook code is called before the $notifications array is created. Maybe try a hook location that's called later on global.php, like global_setup_complete.
|
#3
|
|||
|
|||
Quote:
Seems like the reasoning is on the right track though... just gotta figure out how to parse it in the right location |
#4
|
|||
|
|||
Oh, right...should have thought of that. Unfortunately there's no hook between creating the notifications array and evaling the header and footer. But the html for the header and footer is stored in $header and $footer, so maybe you can modify that after the fact (like put in place holders and do a str_replace on them later).
|
#5
|
|||
|
|||
Not sure what you mean, can you give me an example?
|
#6
|
|||
|
|||
Sorry - yeah, I might be wrong. After reading your OP I should have asked, what template are you putting $headerinclude and $footerinclude in? I guess I was assuming that it was the header, navbar, and/or footer templates.
ETA: ...but assuming I guessed right and you are using the "header" and "footer" templates, what I was suggesting is that instead of inserting $headerinclude and $footerinclude in the templates, change it to something like <!-- Custom Header -->, etc. Then move your plugin to global_setup_complete (where the header and footer templates will have already been processed and the $notifications array created), and add this to the end of your plugin code: Code:
$header = str_replace('<!-- Custom Header -->', $headerinclude, $header); $footer = str_replace('<!-- Custom Footer -->', $footerinclude, $footer); Also, I think the way you have things set up, on your custom pages your header and footer php files will be read in the plugin and then again in your page code, so for efficiency you could surround the plugin code by an "if" statement that checks THIS_SCRIPT and doesn't do the include if it's your custom script. (BTW, I haven't tried this code). |
#7
|
|||
|
|||
Quote:
--------------- Added [DATE]1297014391[/DATE] at [TIME]1297014391[/TIME] --------------- It worked!!! Thank you so much |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|