Register Members List Search Today's Posts Mark Forums Read

Reply
 
Article Options
Using VBulletin 3.7.x notifications engine
FractalizeR
Join Date: Oct 2005
Posts: 368

Russia, Moscow
by FractalizeR FractalizeR is offline 30 May 2008

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:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

  • 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?

Last edited by Princeton; 30 May 2008 at 14:23.. Reason: fixed error in code
Views: 3404
Reply With Quote
Comments
  #2  
Old 30 May 2008, 13:30
Opserty Opserty is offline
 
Join Date: Apr 2007
There was an error in your PHP Code (2nd from last line of array):

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Reply With Quote
  #3  
Old 30 May 2008, 14:23
Princeton's Avatar
Princeton Princeton is offline
 
Join Date: Nov 2001
Real name: Joe Velez
thank you!

you should have released this 2 weeks ago - would have come in handy
__________________
Former vBulletin.org Staff Member

Latest Articles:
Liquid Layout = Less Ad Revenue?
How to Monetize Your Site
Improve Web Page Performance
How To Write For The Web


If it needs instructions, there's room for improvement.
Give users what they actually want, not what they say they want. And whatever you do, don't give them new features just because your competitors have them!
Reply With Quote
  #4  
Old 30 May 2008, 14:49
FractalizeR's Avatar
FractalizeR FractalizeR is offline
 
Join Date: Oct 2005
Real name: Vladislav
Thanks for fixing my error.

you should have released this 2 weeks ago - would have come in handy
Yes Just started coded some things for myself and found this nice feature.
Reply With Quote
  #5  
Old 21 Jun 2008, 00:47
silly rabbit silly rabbit is offline
 
Join Date: Oct 2005
Real name: Kiera
Originally Posted by FractalizeR View Post
Thanks for fixing my error.
Thanks Fract, I guessed right (see here). Want to change the way vbms email notifies me but still haven't decided what to do for a access menu.

EDIT: It works! Not knowing how to write an xml plugin (yet) I simply edited the "global.php" adding what you see below . . . wrong, I used the plugin manager and imported exact same code as a product ( hehe first time!)

I left the navbar template alone and the very last line "$vbms_newmessages['newcount'] = 0" stops the original "Email" count display.

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Works perfect! If I "read" then "mark as unread" the notification indeed comes back.

Will do an xml plugin next, what else can we hide, use this for? Oh, also, the sound notification hack "you got mail" makes me jump, can anybody point me toward a simple ding/dong chime.wav?

"Your inbox has VBMS email waiting. 1"

Cheers & thanks again, Rabbit

Last edited by silly rabbit; 21 Jun 2008 at 05:02.
Reply With Quote
  #6  
Old 21 Jun 2008, 11:50
FractalizeR's Avatar
FractalizeR FractalizeR is offline
 
Join Date: Oct 2005
Real name: Vladislav
\WINDOWS\Media\chimes.wav
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Article Options

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


New To Site? Need Help?

All times are GMT. The time now is 23:29.

Layout Options | Width: Wide Color: