Aug 07 2008

[VBulletin] Using VBulletin 3.7.x notifications engine

Category: Articles,VBulletinFractalizeR @ 7:51 pm

Everyone saw a nice drop-down list with all notifications you have at the top-right corner of every page. Let’s look, how to add our own notifications to this list. It is very easy!

1. Create a GLOBAL phrase, that will be displayed as a text for your notification. Let’s consider it’s name to be MyNotificationName.
2. Create plugin for hook notifications_list with the following code:

if($MyNotificationNeedsToBeShown) {
	$notifications['MyNotificationName'] = array(
		'phrase' => $vbphrase['MyNotificationName'],
		'link'   => 'mylinkpage.php',
		'order'  => 100
	);
	$vbulletin->userinfo['MyNotificationName'] = $MyNotificationCount;
}
  • MyNotificationName – is just a string, a unique name of your notification.
  • $MyNotificationNeedsToBeShown – you can insert here any condition, that evaluates to true, then your notification needs to be shown
  • mylinkpage.php – is the name of the page, user will be redirected to, when he clicks your notification in menu. Page name should be relative to VB root or absolute (http://…)
  • $MyNotificationCount – a number, that will be shown near your notification. This number will be added to a total notifications number displayed by VB.

That’s all 🙂 Really simple, eh?

Article published at official VBulletin Community site: http://www.vbulletin.org/forum/showthread.php?t=181007

Tags: ,

Leave a Reply

You must be logged in to post a comment. Login now.