quick fix to add support for notifications
-
this plug in is great, but lacked notifications support… it was simple to add, and i added support for another tag.
to do:
1.
find
$groupcount = groups_get_total_group_count();
under that add
$notificationscount = bp_notifications_get_unread_notification_count();
OPTIONAL add
$totalunread = $msgcount + $notificationscount;
2.
a few lines down find
$item->title = str_ireplace("%groupcount%", $friendcount, $item->title);
under that add
$item->title = str_ireplace("%notificationscount%", $notificationscount, $item->title);
OPTIONAL add
$item->title = str_ireplace("%totalunread%", $totalunread, $item->title);
3.
a few lines down find
$item->title = str_ireplace("%(groupcount)%", ($groupcount > 0) ? '('.$groupcount.')' : '', $item->title);
under that add
$item->title = str_ireplace("%(notificationscount)%", ($notificationscount > 0) ? '('.$notificationscount.')' : '', $item->title);
OPTIONAL add
$item->title = str_ireplace("%(totalunread)%", ($totalunread > 0) ? '('.$totalunread.')' : '', $item->title);
this will add support for
%notificationscount%
%(notificationscount)%and optionally, i made this feature to support a total of unread messages and notifications using these tags
%totalunread%
%(totalunread)%
- The topic ‘quick fix to add support for notifications’ is closed to new replies.