Skip to:
Content
Pages
Categories
Search
Top
Bottom

How to show a number next to a profile item


  • mushfick
    Participant

    @mushfick

    Hi,

    I’m just wondering how would I go on about showing a number next to the “Feedback” profile item that I’ve added?

    The basic idea is to let people post either negative or postive feedbacks and then like ebay show the positive number of feedback left next to “Feedback”, just like the number of messages or the number of friends is displayed next to “Messages” or “Friends”.

    I’m also going to add sub nav items below Feedback, like “Summary”, “Postive Feedback” and “Negative Feedback”
    but for now I’m just wondering how to show a dynamically generated number next to “Feedback”

    This is how it is right now:

    The idea is to have it like this:

    Hope the image helps.
    Any help would be appreciated.

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

  • mushfick
    Participant

    @mushfick

    Oh and btw I’m using WordPress 3.5.1 and BuddyPress 1.7
    Thanks.


    danbpfr
    Participant

    @chouf1

    @mushfick,

    the menu title should use at least a span id + $count

    take inspiration within ie.  bp-members/bp-mebers-adminbar.php

    and see the function bp_members_admin_bar_notifications_menu


    mushfick
    Participant

    @mushfick

    Thanks chouf1 for your suggestions,

    I found what I was actually looking for in buddypress/bp-friends/bp-friends-loader.php

    Line 97:

    `

    $main_nav = array(
    ‘name’                => sprintf( __( ‘Friends %d’, ‘buddypress’ ), friends_get_total_friend_count() ),
    ‘slug’                => $this->slug,
    ‘position’            => 60,
    ‘screen_function’     => ‘friends_screen_my_friends’,
    ‘default_subnav_slug’ => ‘my-friends’,
    ‘item_css_id’         => $bp->friends->id
    );

    `

    `‘name’                => sprintf( __( ‘Friends %d’, ‘buddypress’ ), friends_get_total_friend_count() )`

    So I’m just going to substitute my function for friends_get_total_friend_count().

    Leaving this here in case somebody else ever wants to find this out as well.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How to show a number next to a profile item’ is closed to new replies.
Skip to toolbar