vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   User Notifications (https://vborg.vbsupport.ru/showthread.php?t=204710)

dfc005 02-09-2009 03:00 AM

User Notifications
 
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.

PHP Code:

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.


All times are GMT. The time now is 12:23 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.01563 seconds
  • Memory Usage 1,723KB
  • 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
  • (1)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (9)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