Skip to:
Content
Pages
Categories
Search
Top
Bottom

Need help with notifications function


  • modemlooper
    Moderator

    @modemlooper

    I basically just want the notification to show an “button” instead of all the text. So if it’s a message it will have [1] <– The number only

    I copied the function over and renamed it.

    function bp_notifications_menu() {
    global $bp;

    if ( !is_user_logged_in() )
    return false;

    echo '<li id="bp-adminbar-notifications-menu"><a href="' . $bp->loggedin_user->domain . '">';
    _e( '', '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 ) { ?>
    <?php $counter = 0; ?>
    <?php for ( $i = 0; $i < count($notifications); $i++ ) { ?>
    <?php $alt = ( 0 == $counter % 2 ) ? ' class="alt"' : ''; ?>
    <li<?php echo $alt ?>><?php echo $notifications[$i] ?></li>
    <?php $counter++; ?>
    <?php } ?>
    <?php } else { ?>
    <li><a href="<?php echo $bp->loggedin_user->domain ?>"><?php _e( '', 'buddypress' ); ?></a></li>
    <?php
    }

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

    ?>

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Need help with notifications function’ is closed to new replies.
Skip to toolbar