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’ )

    Profile photo 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

    Profile photo 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=””>

      <!– –>

    `

    Profile photo of Henry
    Henry
    Member

    @henrypwmoulton

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

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

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

    Profile photo of Henry
    Henry
    Member

    @henrypwmoulton

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

    Profile photo of alatrawlo
    alatrawlo
    Member

    @alatrawlo

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

    Profile photo of siwangnviges
    siwangnviges
    Member

    @siwangnviges

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

    Profile photo 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)
  • The topic ‘Display Followers/Following Count’ is closed to new replies.
Skip to toolbar