Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I've a buddypress website and what I want is to show in the frontend the notification that buddybar have in the backend, but only the notification not all the buddybar.

basically set the notification like facebook....

how can I do that?

share|improve this question
    
Hi, Manuele, welcome to WPSE! Please, try to add more details to your Question, a screenshot, relevant code (if you can locate it). Take a look at this guide: How to Ask. –  brasofilo Feb 1 '13 at 12:18
add comment

2 Answers

Put the following code in your functions.php. If you want a demo i can show you.

// my custom notification menu www.cityflavourmagazine.com

function my_bp_adminbar_notifications_menu() {
global $bp;

if ( !is_user_logged_in() )
    return false;

echo '<li id="top-notification">';
_e( 'Alerts', 'buddypress' );

if ( $notifications = bp_core_get_notifications_for_user( $bp->loggedin_user->id ) ) { ?>
    <span><?php echo count( $notifications ) ?></span>
<?php
}

echo '</a>';
echo '<ul>';

if ( $notifications ) {
    $counter = 0;
    for ( $i = 0; $i < count($notifications); $i++ ) {
        $alt = ( 0 == $counter % 2 ) ? ' class="alt"' : ''; ?>

        <li<?php echo $alt ?>><?php echo $notifications[$i] ?></li>

        <?php $counter++;
    }
} else { ?>

    <li><a href="<?php echo $bp->loggedin_user->domain ?>"><?php _e( 'You have no new alerts.', 'buddypress' ); ?></a></li>

<?php
}

echo '</ul>';
echo '</li>';
}

Use the following code to call it anywhere you like. Note: you can amend the above code as you like

<?php my_bp_adminbar_notifications_menu()?>

share|improve this answer
add comment

Hi not sure if this is what you are trying to do, if you go to http://smeak.com you can see it at work, we split the notifications intro 3, and into a custom toolbar we built for the network. Let me know to see if we can help

share|improve this answer
    
This doesn't explain how it should be done. Please add a solution, not a link. –  toscho Mar 14 '13 at 20:55
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.