How to re-produce Notifications in a Custom Admin bar?
-
For Cureuphoria (http://cureuphoria.com) I disabled the default admin bar and decided to design a custom one that would fit the design better.
define('BP_DISABLE_ADMIN_BAR', true);
When you’re not logged in, the bar displays the login fields, and a link to create an account if you don’t have one.
When you are logged in, the bar displays the member avatar, and links such as: My profile – My messages – My friends – My groups – Settings – Logout.
Now, I’d like to have the notifications system in that bar, like for the default bar I desabled.
First question is: can I do that?
Second question is: if I can, how?
Here’s my code:
<div id="curemates-bar">
<?php if ( is_user_logged_in() ) : //logged in ?>
<?php do_action( 'bp_before_sidebar_me' ) ?>
<a href="<?php echo bp_loggedin_user_domain() ?>"><?php bp_loggedin_user_avatar( 'type=thumb&width=30&height=30' ) ?></a>
<ul id="user-menu">
<li><a href="<?php echo bp_loggedin_user_domain() ?>/profile/edit/">My profile</a></li>
<li>| <a href="<?php echo bp_loggedin_user_domain() ?>/messages/">My messages</a></li>
<li>| <a href="<?php echo bp_loggedin_user_domain() ?>/groups/">My groups</a></li>
<li>| <a href="<?php echo bp_loggedin_user_domain() ?>/friends/">My friends</a></li>
<li>| <a href="<?php echo bp_loggedin_user_domain() ?>/photos/">My photos</a></li>
<li>| <a href="<?php echo bp_loggedin_user_domain() ?>/settings/">Settings</a></li>
<li>| <a id="logout" href="<?php echo wp_logout_url( get_option('home') ) ?>"><?php _e( 'Log Out', 'buddypress' ) ?></a></li>
</ul>
<?php do_action( 'bp_sidebar_me' ) ?>
<?php do_action( 'bp_after_sidebar_me' ) ?>
<?php if ( function_exists( 'bp_message_get_notices' ) ) : ?>
<?php bp_message_get_notices(); /* Site wide notices to all users */ ?>
<?php endif; ?>
<?php else : //not logged in ?>
...stuff...
<?php endif; ?>
</div><!-- end "curemates-bar" -->Now, I now that the code I am looking for is in the “bp-core-adminbar.php” file, and I’ve made a few attempts to extract what needed to re-create the notifications menu, but obviously without success.
Can anybody help me out with this?
Thanks.
- The topic ‘How to re-produce Notifications in a Custom Admin bar?’ is closed to new replies.