Skip to:
Content
Pages
Categories
Search
Top
Bottom

Trying to do a notification check

  • Avatar of Kenneth Jensen
    Kenneth Jensen
    Participant

    @kennethj

    Hi there

    Im trying to make a check for new notifications, but how do I do that?

    I need a simple if else statement like this:

    If unread notifications = 0 then

    // something

    Else

    //something else

    End if

    How do I do that?

Viewing 1 replies (of 1 total)
  • I assume you are having issues getting the count of unread notifications a user has. Try this:

    if ( $notifications = bp_core_get_notifications_for_user( $bp->loggedin_user->id ) ) { ?>

    <span><?php echo count($notifications) ?></span>

    <?php

    }

Viewing 1 replies (of 1 total)

You must be logged in to reply to this topic.