View Full Version : User Notifications
dfc005
02-09-2009, 03:00 AM
I'd like to write a hack that allows me to put the user notifications (currently found in the navbar IE vBmenu.register("notifications")) outside of vBulletin and into my header which is shown across my site.
Are there functions in the global.php/includes directory that I can call that tell me if a user has new notifications? For instance does the $vbulletin->userinfo contain anything that alerts me to this fact?
Or will I need to do a few queries to check if the user has any unread PMs, outstanding friend requests or new visitor messages?
snakes1100
02-09-2009, 03:41 AM
Read this article.
https://vborg.vbsupport.ru/showthread.php?t=62164
dfc005
02-09-2009, 04:06 AM
Not really want I need. I have hundreds of pages that would require me to convert to templates using that method.
Any other ideas?
snakes1100
02-09-2009, 04:17 AM
Well, as the article is explaining to you, you can follow the basic concept, you do not need to use his entire setup to get your desired effects.
dfc005
02-09-2009, 04:29 AM
I have a default header that I include on all pages of my site (be they vBulletin related or not). I appreciate that you're trying to help but I don't really see how that article helps me in any way to get the desired effect I'm after.
If you think the article is helpful would you be able to explain how you think I would go about implementing the idea?
snakes1100
02-09-2009, 04:39 AM
The code in the first box of his article is what you actually need, yo udont need to convert your pages over, review the first box in his article.
It even have the navbar coding in it already.
Create a new template based off of navbar tempalte, strip what you dont want from it and call the new template name instead.
dfc005
02-09-2009, 05:25 AM
You're absolutely right! Wow, sorry mate, that's great. Almost there.
Calling the template I created works great on non vB pages but that same code doesn't work on vB pages. Very odd.
I'm doing this at the top of my header.php which is included on every page, vB or not.
eval('$nav_notify = "'.fetch_template('SS_NOTIFICATIONS').'";');
Now that works on the non vB pages but if it's a vB page, when I output $nav_notify it's blank. Any ideas?
Dismounted
02-10-2009, 05:49 AM
What hook is it included in?
dfc005
02-10-2009, 07:01 AM
Hey, got it all working. I was using global_start as the hook and that didn't work. Am now using parse_templates and that's working much better.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.