Majidm
02-04-2011, 10:10 PM
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:
global $headerinclude;
ob_start();
require ('/web/includes/header.php');
$headerinclude = ob_get_contents();
ob_end_clean();
global $footerinclude;
ob_start();
require ('/web/includes/footer.php');
$footerinclude = ob_get_contents();
ob_end_clean();
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:
require_once("include_top.php"); //this file references forums/global.php and other files that let me access vBulletin resources
include "includes/header.php";
*page code here*
include "includes/footer.php";
This lets me reference variables from vBulletin like $vbulletin->userinfo etc in my forum-external page
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: array(11) { ["pmunread"]=> array(4) { ["phrase"]=> string(23) "Unread Private Messages" ["link"]=> string(11) "private.php" ["order"]=> int(10) ["total"]=> string(3) "438" } ["vmunreadcount"]=> array(4) { ["phrase"]=> string(23) "Unread Visitor Messages" ["link"]=> string(40) "member.php?u=2&tab=visitor_messaging" ["order"]=> int(20) ["total"]=> int(0) } ["vmmoderatedcount"]=> array(4) { ["phrase"]=> string(27) "Unapproved Visitor Messages" ["link"]=> string(40) "member.php?u=2&tab=visitor_messaging" ["order"]=> int(30) ["total"]=> int(0) } ["friendreqcount"]=> array(4) { ["phrase"]=> string(24) "Incoming Friend Requests" ["link"]=> string(28) "profile.php?do=buddylist#irc" ["order"]=> int(40) ["total"]=> int(0) } ["socgroupreqcount"]=> array(4) { ["phrase"]=> string(27) "Social Groups Join Requests" ["link"]=> string(21) "group.php?do=requests" ["order"]=> int(50) ["total"]=> int(0) } ["socgroupinvitecount"]=> array(4) { ["phrase"]=> string(24) "Social Group Invitations" ["link"]=> string(24) "group.php?do=invitations" ["order"]=> int(60) ["total"]=> int(0) } ["pcunreadcount"]=> array(4) { ["phrase"]=> string(23) "Unread Picture Comments" ["link"]=> string(19) "album.php?do=unread" ["order"]=> int(70) ["total"]=> int(0) } ["pcmoderatedcount"]=> array(4) { ["phrase"]=> string(34) "Picture Comments Awaiting Approval" ["link"]=> string(22) "album.php?do=moderated" ["order"]=> int(80) ["total"]=> int(0) } ["gmmoderatedcount"]=> array(4) { ["phrase"]=> string(25) "Unapproved Group Messages" ["link"]=> string(25) "group.php?do=moderatedgms" ["order"]=> int(90) ["total"]=> int(0) } ["dbtech_usertag_mentioncount"]=> array(4) { ["phrase"]=> string(12) "New Mentions" ["link"]=> string(31) "member.php?u=2&tab=mentions" ["order"]=> int(110) ["total"]=> int(0) } ["dbtech_usertag_tagcount"]=> &array(4) { ["phrase"]=> string(15) "New Thread Tags" ["link"]=> string(31) "member.php?u=2&tab=usertags" ["order"]=> int(110) ["total"]=> int(0) } }
The problem is when I go into the Forums (which loads the same header file) I just get a NULL value for the $notifications array
Any ideas?:confused:
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:
global $headerinclude;
ob_start();
require ('/web/includes/header.php');
$headerinclude = ob_get_contents();
ob_end_clean();
global $footerinclude;
ob_start();
require ('/web/includes/footer.php');
$footerinclude = ob_get_contents();
ob_end_clean();
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:
require_once("include_top.php"); //this file references forums/global.php and other files that let me access vBulletin resources
include "includes/header.php";
*page code here*
include "includes/footer.php";
This lets me reference variables from vBulletin like $vbulletin->userinfo etc in my forum-external page
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: array(11) { ["pmunread"]=> array(4) { ["phrase"]=> string(23) "Unread Private Messages" ["link"]=> string(11) "private.php" ["order"]=> int(10) ["total"]=> string(3) "438" } ["vmunreadcount"]=> array(4) { ["phrase"]=> string(23) "Unread Visitor Messages" ["link"]=> string(40) "member.php?u=2&tab=visitor_messaging" ["order"]=> int(20) ["total"]=> int(0) } ["vmmoderatedcount"]=> array(4) { ["phrase"]=> string(27) "Unapproved Visitor Messages" ["link"]=> string(40) "member.php?u=2&tab=visitor_messaging" ["order"]=> int(30) ["total"]=> int(0) } ["friendreqcount"]=> array(4) { ["phrase"]=> string(24) "Incoming Friend Requests" ["link"]=> string(28) "profile.php?do=buddylist#irc" ["order"]=> int(40) ["total"]=> int(0) } ["socgroupreqcount"]=> array(4) { ["phrase"]=> string(27) "Social Groups Join Requests" ["link"]=> string(21) "group.php?do=requests" ["order"]=> int(50) ["total"]=> int(0) } ["socgroupinvitecount"]=> array(4) { ["phrase"]=> string(24) "Social Group Invitations" ["link"]=> string(24) "group.php?do=invitations" ["order"]=> int(60) ["total"]=> int(0) } ["pcunreadcount"]=> array(4) { ["phrase"]=> string(23) "Unread Picture Comments" ["link"]=> string(19) "album.php?do=unread" ["order"]=> int(70) ["total"]=> int(0) } ["pcmoderatedcount"]=> array(4) { ["phrase"]=> string(34) "Picture Comments Awaiting Approval" ["link"]=> string(22) "album.php?do=moderated" ["order"]=> int(80) ["total"]=> int(0) } ["gmmoderatedcount"]=> array(4) { ["phrase"]=> string(25) "Unapproved Group Messages" ["link"]=> string(25) "group.php?do=moderatedgms" ["order"]=> int(90) ["total"]=> int(0) } ["dbtech_usertag_mentioncount"]=> array(4) { ["phrase"]=> string(12) "New Mentions" ["link"]=> string(31) "member.php?u=2&tab=mentions" ["order"]=> int(110) ["total"]=> int(0) } ["dbtech_usertag_tagcount"]=> &array(4) { ["phrase"]=> string(15) "New Thread Tags" ["link"]=> string(31) "member.php?u=2&tab=usertags" ["order"]=> int(110) ["total"]=> int(0) } }
The problem is when I go into the Forums (which loads the same header file) I just get a NULL value for the $notifications array
Any ideas?:confused: