Skip to:
Content
Pages
Categories
Search
Top
Bottom

Display notifications


  • sumierm
    Participant

    @sumierm

    Im am using buddypress version 2.5.1
    I would like to show the number of notifications and messages next to the menu tab. See what I mean:
    http://connectioninterface.com/
    Username: test
    Password: test
    Select the drop down button in the upper left corner to display the menu.
    Thanks

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

  • neijisly
    Participant

    @neijisly

    Hi, I display the number of notifications and messages to the menu navigation. Look if is what you want http://neijisite.xyz
    login: moi-moi
    pass: moi-moi
    thanks


    sumierm
    Participant

    @sumierm

    Im sorry, it wont let me log in.


    sumierm
    Participant

    @sumierm

    Ok i logged in, yes something like that. My menus are in a different way though.


    neijisly
    Participant

    @neijisly

    Here is the code

    <?php if(bp_notifications_get_unread_notification_count( bp_loggedin_user_id() ) > 0 ) { ?>
    <~li>
    <~a><?php echo BP_NOTIFICATIONS_SLUG ?>”>
    <?php echo bp_notifications_get_unread_notification_count( bp_loggedin_user_id() );
    ?> Notifications</~a>
    </li~>
    <?php } ?>
    <~li>
    <~a><?php echo BP_MESSAGES_SLUG ?>”><?php if(messages_get_unread_count() > 0 ) { ?>
    <?php echo messages_get_unread_count();
    ?>
    <?php } ?> Messages<~/a>
    <~/li>

    put in your php menu file
    ( delete all ~ in the code )


    sumierm
    Participant

    @sumierm

    Where can i find that file?


    neijisly
    Participant

    @neijisly

    What theme are you using? And how are you building your actual menu?


    sumierm
    Participant

    @sumierm

    I am using ribosome theme. You can log in to the site using the info above to see how the menu is set up, it is a bit hard to explain.


    neijisly
    Participant

    @neijisly

    Ok go in editor theme, click in header.php and try to ad this code just before </nav><!– #site-navigation –>

    <?php if(bp_notifications_get_unread_notification_count( bp_loggedin_user_id() ) > 0 ) { ?>

      <#li>
      <#a href=”<?php echo bp_loggedin_user_domain() ?><?php echo BP_NOTIFICATIONS_SLUG ?>”><span style=”font-weight: bold; background: #37b5e4; padding: 2px 2px 2px 2px;”><?php echo bp_notifications_get_unread_notification_count( bp_loggedin_user_id() );
      ?></span> Notifications<#/a>
      <#/li>
      <?php } ?>
      <#li>
      <#a href=”<?php echo bp_loggedin_user_domain() ?><?php echo BP_MESSAGES_SLUG ?>”><?php if(messages_get_unread_count() > 0 ) { ?><span style=”font-weight: bold; background: #37b5e4; padding: 2px 2px 2px 2px;”><?php echo messages_get_unread_count();
      ?></span><?php } ?> Messages<#/a>
      <#/li>
      <#/ul>
      ( please delete all # symbol in this code )

    sumierm
    Participant

    @sumierm

    It displays the numbers of notifications and messages but when i click on them, it takes me to a page that does not exist. Also is it possible to just have a number in a bubble next to the tab in the menu, not the header.


    neijisly
    Participant

    @neijisly

    I am installing ribosome theme and do the same thing, work fine. Login for see. For you: try to desactive all plugins without buddypress if no work send me the code that you have put in header


    sumierm
    Participant

    @sumierm

    It works but in the wrong place. I would like the header clear. I want it to just show the number next to the tab in the drop down menu. It also shows when you are logged out.


    sumierm
    Participant

    @sumierm


    neijisly
    Participant

    @neijisly

    It is not possible with wordpress core. I suggest to deactivated your menu and add all page manually like you had do. You can style them properly in the future.


    sumierm
    Participant

    @sumierm

    How will you navigate to pages if the menu is disabled?


    neijisly
    Participant

    @neijisly

    Reproduce all your link navigation.
    Add this code between <#/li> and <#li> in header.php. <#li>name of page<#/a><#/li> you can create many link you want in menu.


    neijisly
    Participant

    @neijisly

    Add this code between <#/li> and <#li> in header.php. <#li><#a href=”page url(eg: contact)”>name of page<#/a><#/li> you can create many link you want in menu.
    ( delete all # in the code )


    @mcuk
    Participant

    @mcuk

    May be what you are looking for:

    https://buddypress.org/support/topic/position-notification-counter-bubble-after-specific-navigation-tab-id/

    (See the later posts in the feed starting around 2-3 weeks ago)


    sumierm
    Participant

    @sumierm

    Ok, thanks, will try

Viewing 18 replies - 1 through 18 (of 18 total)
  • You must be logged in to reply to this topic.
Skip to toolbar