Skip to:
Content
Pages
Categories
Search
Top
Bottom

How to split out BuddyPress notifications drop down items to their own top level


  • bp-help
    Participant

    @bphelp

    I would like to know how to do this, I am not a buddypress expert so It will take some explaining and even better some code on a github link. I would like to add this to my header and get rid of the toolbar, I would also like to add the BP links that is usually in the right of the toolbar into the the header. Reason being I don’t want that bar up there and it would make it look more custom without the toolbar that gives it away that it is a WP/BP social network. I like how facebook has their notifications, messages, and friend request split out. This is what I am trying to do. I got a little info on this link but not enough to do anything with : http://wordpress.stackexchange.com/questions/27888/how-to-split-out-buddypress-notifications-drop-down-items-to-their-own-top-level @boonebgorges explains it but not in much detail. I would appreciate any guidance on how to get this done. Thanks!

Viewing 11 replies - 26 through 36 (of 36 total)

  • bp-help
    Participant

    @bphelp

    Anyone who can help please? Thank you!

    Are that tricky to sort out these notifications? I’m not sure what to suggest without running code and playing around with it which I’m not sure I have time for at the moment, but try and get your working code up in a copyable form on pastebin/github so we can, if necessary, download and play around with.


    bp-help
    Participant

    @bphelp

    @hnla Here is the link to it on github:
    https://github.com/bphelp/custom_toolbar
    Thanks in advanced for any help or time you may be able to spare.


    bp-help
    Participant

    @bphelp

    If anyone else out there can offer advice in how to do this it will be appreciated! Thanks everyone! 🙂


    bp-help
    Participant

    @bphelp

    I really could use some help on this so if you can please help! Thanks folks!

    now having to write this a second time as bp decided I wasn’t logged in for some odd reason after I submitted so this is brief.

    Watch your syntax, don’t wrap those functions in strings, ‘;’ line terminations in an array ought not to be there. You don’t need or want to echo out those functions at this point simply pass the function through so simply the ‘get’ function.

     

    This is a working example  of two:

    <code>

    $wp_toolbar->add_node(array(
    ‘parent’ => ‘user-friends’,
    ‘id’ => ‘friend-requests’,
    ‘title’ => ‘ Friend Requests ‘,
    ‘href’  => bp_loggedin_user_domain() . bp_get_friends_slug() . ‘/requests/’,
    ‘meta’ => array(‘html’ => ‘<span>’ . bp_friend_get_total_requests_count( bp_loggedin_user_id() ) . ‘</span>’ )
    ));

    </code>

    <code>

    $wp_toolbar->add_node(array(
    ‘parent’ => ‘user-messages’,
    ‘id’ => ‘messages’,
    ‘title’ => ‘ Messages ‘,
    ‘href’  => bp_loggedin_user_domain() .  bp_get_messages_slug() . ‘/view/’,
    ‘meta’ => array(‘html’ => ‘<span>’ . bp_get_total_unread_messages_count(bp_loggedin_user_id() . ‘</span>’ ) )
    ));

     

    </code>
    This isn’t ideal but all I can see to work with in add_node() but there may be better approaches, and to get this working I mainly had to study the code page to see how the ‘meta’ was handled.


    bp-help
    Participant

    @bphelp

    @hnla Okay I added this and it places the count under the title. Now all I need to do is:
    1.) Add name of person sending friend request and messages beside the count as well as the greeting.
    Example: You have 1 friend request from USER1, You have 2 messages from USER2

    2.) Add avatar of person sending the friend request or message to to left in the drop-down notification.

    If you or anyone else can help on that it will be great.
    For anyone who would like to use this I packaged it as a plugin here:
    https://github.com/bphelp/custom_toolbar
    If you would like to help with the code I can add you as a contributor. Thanks everyone!


    bp-help
    Participant

    @bphelp

    Just seeing if anyone has anything to add to this plugin which is free of charge. I really would appreciate some experienced buddypress developers helping out. And no I do not have money to hire a developer. Due to NAFTA I have not been able to find work in 2.6 years so if money is your agenda, I don’t have it but contribute if you can because it will be appreciated. Thanks everyone!

    @bphelp all the further requirements you want to add can be found in the various core files, I know no better than you at this stage and would have to be reading through those files to identify what functions, variables etc I had to work with to achieve what I wanted, I did something similar to this  a while back for  custom WP pages dragging user data out, the only way I managed that was by studying the core files.

    Without wanting to sound harsh 🙂  it’s down to you to finish now, the bits like avatars shouldn’t be too hard to figure now you’ve got this far.

    When it’s finished  get it placed on the WP plugin repo.


    bp-help
    Participant

    @bphelp

    @hnla Thanks for the advice and encouragement! I will do my best and when it is ready I will release it to the repository for others to use. Thanks for everything, I really appreciate it!


    shubh14
    Participant

    @shubh14

    @bphelp were you able to figure out the dropdown? I am making the same thing and have added the count, however I need help how to show a details dropdown to each

Viewing 11 replies - 26 through 36 (of 36 total)
  • The topic ‘How to split out BuddyPress notifications drop down items to their own top level’ is closed to new replies.
Skip to toolbar