';
_e( 'Notifications', 'buddypress' );
if ( $notifications = bp_core_get_notifications_for_user( $bp->loggedin_user->id ) ) { ?>
';
echo '';
if ( $notifications ) {
$counter = 0;
for ( $i = 0, $count = count( $notifications ); $i < $count; ++$i ) {
$alt = ( 0 == $counter % 2 ) ? ' class="alt"' : ''; ?>
- >
';
echo '';
}
add_action( 'bp_adminbar_menus', 'bp_adminbar_notifications_menu', 8 );
// **** "Blog Authors" Menu (visible when not logged in) ********
function bp_adminbar_authors_menu() {
global $bp, $wpdb;
// Only for multisite
if ( !is_multisite() )
return false;
// Hide on root blog
if ( $wpdb->blogid == bp_get_root_blog_id() || !bp_is_active( 'blogs' ) )
return false;
$blog_prefix = $wpdb->get_blog_prefix( $wpdb->blogid );
$authors = $wpdb->get_results( "SELECT user_id, user_login, user_nicename, display_name, user_email, meta_value as caps FROM $wpdb->users u, $wpdb->usermeta um WHERE u.ID = um.user_id AND meta_key = '{$blog_prefix}capabilities' ORDER BY um.user_id" );
if ( !empty( $authors ) ) {
// This is a blog, render a menu with links to all authors
echo '';
}
}
add_action( 'bp_adminbar_menus', 'bp_adminbar_authors_menu', 12 );
/**
* Adds an admin bar menu to any profile page providing site moderator actions
* that allow capable users to clean up a users account.
*
* @package BuddyPress XProfile
* @global $bp BuddyPress
*/
function bp_members_adminbar_admin_menu() {
global $bp;
// Only show if viewing a user
if ( !$bp->displayed_user->id )
return false;
// Don't show this menu to non site admins or if you're viewing your own profile
if ( !current_user_can( 'edit_users' ) || bp_is_my_profile() )
return false; ?>