Skip to:
Content
Pages
Categories
Search
Top
Bottom

Display Followers/Following Count

Viewing 10 replies - 1 through 10 (of 10 total)
  • function follow_deleted( $user_id ) {
    global $wpdb, $bp;

    $wpdb->query( $wpdb->prepare( “DELETE FROM {$bp->follow->table_name} WHERE leader_id = %d”, user_id ) );
    $wpdb->query( $wpdb->prepare( “DELETE FROM {$bp->follow->table_name} WHERE follower_id = %d”, user_id ) );

    }

    add_action( ‘wpmu_delete_user’, ‘follow_deleted’ );
    add_action( ‘delete_user’, ‘follow_deleted’ );
    add_action( ‘make_spam_user’, ‘follow_deleted’ )

    Avatar of ryanITLab
    ryanITLab
    Member

    @ryanitlab

    I am trying to do the same thing as @iintense
    @phartes – I don’t understand your reply

    I am just trying to get a list of the names of the people a user is following / is followed by

    Avatar of drebabels
    drebabels
    Member

    @drebabels

    Basically what you need to do is create a new BP members loop using bp_has_members(), and filter it so that it returns only the followers / following members. Below is what I am using on my site to return user following avatars.

    `

    <?php

    echo ‘

    Following ‘.$counts.’

    ‘;

    ?>

    • <a href="” title=””>

      <!– –>

    `

    Avatar of Henry
    Henry
    Member

    @henrypwmoulton

    @drebabels could you walk me through which files to edit etc?

    Avatar of drebabels
    drebabels
    Member

    @drebabels

    @henry the code should go into one of your template files (i.e. if you want the followers to appear in your sidebar then you should add the code to sidebar.php). This Buddypress Follower Loop work the same way as WordPress ones do.

    Avatar of drebabels
    drebabels
    Member

    @drebabels

    @henrypwmoulton the code should go into one of your template files (i.e. if you want the followers to appear in your sidebar then you should add the code to sidebar.php). This Buddypress Follower Loop work the same way as WordPress ones do.

    Avatar of Henry
    Henry
    Member

    @henrypwmoulton

    @drebabels, on your site where exactly do you use that on your site?

    Avatar of alatrawlo
    alatrawlo
    Member

    @alatrawlo

    It is not possible for civilization to flow backward while there is youth in the world

    Avatar of siwangnviges
    siwangnviges
    Member

    @siwangnviges

    The very first law in advertising is to avoid the concrete promise and cultivate the delightfully vague :))

    Avatar of matiou34
    matiou34
    Participant

    @matiou34

    @drebabels Hello !
    Everything works well but I can’t get the number of followers or following…
    Is there something wrong ?

    Thanks for your help !

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

You must be logged in to reply to this topic.