Skip to:
Content
Pages
Categories
Search
Top
Bottom

Buddypress followers plugin

  • @antonrsa

    Participant

    How can I include the number of followers and following on my profile header such as Twitter? I know the number is displayed on the tags Followers(*) and Following(*) but is there a way to display those for example underneath your Profile name?

Viewing 20 replies - 1 through 20 (of 20 total)
  • @nuprn1

    Participant

    bp_follow_total_follow_counts ( ) – where default arg ‘user_id’ => $bp->loggedin_user->id

    returns an array with followers and following

    @antonrsa

    Participant

    thanks @nuprn1 but how will I place it underneath my name in my profile?

    @nuprn1

    Participant

    couple of action hooks on member-header.php

    bp_before_member_header_meta is underneath the name/last active

    @antonrsa

    Participant

    @nuprn1 – I have placed bp_follow_total_follow_counts ($bp->loggedin_user->id); underneath bp_before_member_header_meta but it doesn’t display anything

    @hnla

    Participant

    I wanted something similar, this works for me (rich may have better take on it though also didn’t someone write a stats plugin :) , seems these following items would sit nicely in that output?)

    Dropped into functions.php:

    http://pastebin.com/q4mNZ3KR

    @nuprn1

    Participant

    oh right member profile stats plugin :P i could add following/er/friends to the mix (think i left it off since the info is duplicated on the nav items)

    @hnla

    Participant

    😆 I just tried :(

    I did hesitate wondering if it was useful to have it in stats block in header as well as the nav items below. at the moment that little functions squirts followers/following directly beneath the stats output for me.

    @antonrsa

    Participant

    @hnla and @nuprn1 can you guys help me here? Is this the right way to place it in the member header? bp_follow_total_follow_counts ($bp->loggedin_user->id);

    I just want the total count follwers = count and following = count

    @hnla

    Participant

    Can you not use that function I posted up to help out? If not @nuprn1 will have an alternative and probably better approach.

    @r-a-y

    Keymaster

    It has to be this:

    bp_follow_total_follow_counts( array( ‘user_id’ => $id ) );

    Change $id to whatever.

    @antonrsa

    Participant

    Thanks for the code snippet @hnla and @r-a-y

    It works if you are logged in but then it only displays your data – following and followers. When browsing to another member’s profile, your count is displayed and not theirs. If you are not logged in, it shows 0 for both following and followers

    @hnla

    Participant

    Change ‘loggedin_user’ to ‘displayed_user’

    I was originally using displayed_user changed to loggedin_user but realised it wasn’t the result I wanted.

    @antonrsa

    Participant

    Thanks for all the help guys. It works @hnla

    @antonrsa

    Participant

    @hnla, @nuprn1 – when this plugin is active, when users reply to any group activity, they are not added to the group. Is there a way to add them to the group when this plugin is activated?

    @nuprn1

    Participant

    i would contact Andy if his plugin is causing a conflict.

    @antonrsa

    Participant

    @nuprn1, @r-a-y, @hnla – another problem. If you were following a member and they were marked as a spammer by the admin of the site, your following count still displays the same number but when viewing the “following” page it only displays the ones that are not marked as spam. To give you an example. I were following 23 people. I marked one of those as a spammer. It still displays 23 on my following count but when I view the “following” page it displays – “
    Viewing member 1 to 20 (of 22 active members)” Is there anyway that the count following and followers will not take spammers?

    @hnla

    Participant

    In a word? Yes! Doing so is really the purview of the plugin developer? I would have though it’s a simple check that a member is not equal to whatever the field is that marks someone as a spammer however and not having looked at the plugin it sounds as though a table is built up of follwers but that isn’t rechecked against possible changes to those members, essentially you add a member as a follower and remove a member as a follower but nothing happens in-between.

    @antonrsa

    Participant

    I deleted those users id’s manually out of the bp_follow table

    @nuprn1

    Participant

    quickly glancing over the follower’s plugin code – i don’t see anything that hooks like how the friends component does


    add_action( 'wpmu_delete_user', 'friends_remove_data' );
    add_action( 'delete_user', 'friends_remove_data' );
    add_action( 'make_spam_user', 'friends_remove_data' );

    @r-a-y

    Keymaster

    Maybe someone should provide an alternative version for this plugin as a stop-gap until Andy is ready to resume duties with BP-related matters?

Viewing 20 replies - 1 through 20 (of 20 total)
  • The topic ‘Buddypress followers plugin’ is closed to new replies.
Skip to toolbar