Skip to:
Content
Pages
Categories
Search
Top
Bottom

Buddypress followers plugin


  • Anton
    Participant

    @antonrsa

    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)
  • bp_follow_total_follow_counts ( ) – where default arg ‘user_id’ => $bp->loggedin_user->id

    returns an array with followers and following


    Anton
    Participant

    @antonrsa

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

    couple of action hooks on member-header.php

    bp_before_member_header_meta is underneath the name/last active


    Anton
    Participant

    @antonrsa

    @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

    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

    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)

    😆 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.


    Anton
    Participant

    @antonrsa

    @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

    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

    @r-a-y

    It has to be this:

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

    Change $id to whatever.


    Anton
    Participant

    @antonrsa

    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

    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.


    Anton
    Participant

    @antonrsa

    Thanks for all the help guys. It works @hnla


    Anton
    Participant

    @antonrsa

    @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?

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


    Anton
    Participant

    @antonrsa

    @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?

    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.


    Anton
    Participant

    @antonrsa

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

    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

    @r-a-y

    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