PDA

View Full Version : Adding notification to notifications popup


Pedro!
01-19-2009, 09:58 PM
Edit: I found the </table> tag which should do it, it's after $notifications_menubits in the navbar template.

I want to add a notification to the notifications pop-up menu. Trouble is I can't append it to to navbar_notifications_menubit because then it will repeat after ever menu item. Can anyone help me figure out a way to either:


append this to the menu after it has been parsed
or enter it in the array that the template parses the menu items from


I've been looking at global.php trynna figure it out but I'm a bit lost, lol. I can write plug-ins to include custom templates just fine so if someone could figure out where the closing </table> tag is kept for the navbar_notification_menubit then hopefully I could just sneak it in before there. I have a nasty feeling it'll be in the JavaScript though :erm:

Any help would be much appreciated!

Dismounted
01-20-2009, 05:03 AM
You can add a notification from just one single plugin. Look at the hook notifications_list.

Pedro!
01-20-2009, 08:16 AM
Thanks for the reply man, I spotted that bad-boy when scouting out the code, trouble is I couldn't figure out where I put the variable for the outstanding number of items in the notification - any ideas?

Thanks for your help so far.

Dismounted
01-20-2009, 08:44 AM
Here is an example:
// add notification
$notifications['random_notification_count'] = array(
'phrase' => $vbphrase['random_notification'],
'link' => 'random.php?' . $vbulletin->session->vars['sessionurl'] . 'do=notifications',
'order' => 11
);

// the amount of notifications
$vbulletin->userinfo['random_notification_count'] = 20;

Pedro!
01-20-2009, 09:02 AM
Worked a charm, thanks a bunch :up: