Skip to:
Content
Pages
Categories
Search
Top
Bottom

[Resolved] Notifications Include

  • Avatar of Famous
    Famous
    Participant

    @famous

    Is there a way for me to include a notifications chunk of code into the header or sidebar to see if someone has a new notification?

    Thanks

Viewing 2 replies - 1 through 2 (of 2 total)
  • Avatar of @modemlooper
    @modemlooper
    Moderator

    @modemlooper

    You would need to add some sort of css to style the output

    <?php 
        if ( $notifications = bp_core_get_notifications_for_user( bp_loggedin_user_id() ) ) {
    
            if ( $notifications ) {
                echo '<div id="notifications-header"><ul>';
                for ( $i = 0; $i < count($notifications); $i++ ) {
                    $badge = count($notifications);
                    echo '<li>'.$notifications[$i].'</li>';
                }
                echo '</ul></div>';
                echo '<span id="notifications-badge">'.$badge.'</span>';
            }
    
        } 
    ?>
    Avatar of Famous
    Famous
    Participant

    @famous

    Thanks @modemlooper case closed.

Viewing 2 replies - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.