BuddyDev

Search

[Resolved] Buddypress Notification

  • Participant
    Level: Enlightened
    Posts: 118
    Erich199 on #1432

    @sbrajesh,

    Is it possible to get a buddypress notification in a current theme?

    In my current theme, I would like the little bubble icon button, to change colors, maybe yellow if the user gets an alert. Then they would be able to click on that button, and be taken to their profile page where alerts are.

    Is this possible? I’ve done it before with an alert count, but I don’t need a count I need just the alert.

    Also, is it possible for buddypress alerts to notify a user when they are tagged in bbpress?

    Thanks for your help as always.

    • This topic was modified 8 years, 5 months ago by Erich199.
    • This topic was modified 8 years, 5 months ago by Erich199.
  • Participant
    Level: Enlightened
    Posts: 118
    Erich199 on #1435

    Ok scratch the @ mentions in bbpress. I did some digging around.

    It seems if you have “Discourage search engines from indexing this site” checked under “reading setting” then the bbpress @ mentions will not send an alert to buddypress. Very strange, but when I unchecked it , it worked just fine.

  • Keymaster
    (BuddyDev Team)
    Posts: 24210
    Brajesh Singh on #1437

    Hi Joshua,
    Apologies for delayed reply.

    Please give the following code a spin.

    
    <?php 
    $css_class = '';
    $unread_notifications = bp_notifications_get_unread_notification_count( get_current_user_id() );
    
    if( $unread_notifications ){
    	$css_class = 'has-new-notifications';
    }
    
    ?>
    <a href="<?php bp_notifications_permalink();?>" class="someclass <?php echo $css_class;?>"> Notification</a>
    
    

    You will need to modify it for the icons or update for your theme but it shows how to add extra class when there are new notifications and link to the notifications page.

    If you want to link to unread notifications, you may update the bp_notifications_permalink() with bp_notifications_unread_permalink()

    Hope that helps.

The topic ‘ [Resolved] Buddypress Notification’ is closed to new replies.

This topic is: resolved