bp_adminbar_notifications_menu() is the function to call for creating the notifications menu… you will have to play with that.
oh, i thought there might be an easier way. like <?php bp_show_unread_count() ?>
you can easily recreate a new function with the one i provided, so instead of creating a dropdown menu it would simply show a count…
thanks nexia, i will checkout the docu.
<?php bp_total_unread_messages_count() ?>
Here’s what I use:
<?php
global $bp;
$hmag_inbox_count = messages_get_unread_count();
if ($hmag_inbox_count > ‘9’) {
$hmag_inbox_count = ‘9+’;
}
echo ‘<span class=”your-style”>’.$hmag_inbox_count.'</span>’;
?>
Displays a number for # of unread. If the count is greater then 9, it displays 9+
i want my personal andy peatling right beside me when i play with buddypress.
thanks a lot everyone!
even tho the code doesn’t check for »pendig friendships« it’s pretty cool!
<?php bp_total_unread_messages_count() ?>
having a Andy Peatling in my living room when i code, would be really annoying… sorry but we would have to debate the usage of each function… not good.
ROFL!
i thought <?php bp_core_get_notifications_for_user() ?>
might get all notifications, but that’s just empty. hmm
Just a note “ echos the count.
If you want to return the count without the echo use “
Bumping to re-post the information that @drebabels posted but looks to have been lost due to use of quotes
bp_total_unread_messages_count() uses echo. So if you use this within an ‘echo’ you’ll get unexpected results (value doesn’t print where you expect it to in the DOM, in my experience)
add ‘get’, e.g. bp_get_total_unread_messages_count() to simply return the # of messages for the logged-in user in your code