Skip to:
Content
Pages
Categories
Search
Top
Bottom

[Resolved] Notifications Include


  • 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)

  • 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>';
            }
    
        } 
    ?>

    Famous
    Participant

    @famous

    Thanks @modemlooper case closed.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Resolved] Notifications Include’ is closed to new replies.
Skip to toolbar