function live_notifications_notifier() { global $CONFIG; if (elgg_is_logged_in()) { $user_guid = elgg_get_logged_in_user_guid(); $tooltip = elgg_echo("live_notifications"); //get unread messages $num_notifications = count_unread_notifications(25); $text = elgg_view('live_notifications/topbar_icon', array('num_notifications' => $num_notifications)); elgg_register_menu_item('topbar', array('name' => 'notification', 'href' => '#live_notifications', 'rel' => 'popup', 'text' => $text, 'priority' => 600, 'title' => $tooltip, 'id' => 'live_notifications_link')); } }
<?php gatekeeper(); echo count_unread_notifications(25);