Plugin: BuddyPress Followers

Join this plugin group to follow comments, support topics and reviews.

How to add follow button to activity stream ? (9 posts)

Started 1 year, 5 months ago by: anindyaray

  • Profile picture of anindyaray anindyaray said 1 year, 5 months ago:

    Like in bp-tricks.com , how to add a “Follow” button on the activity stream ?

  • Profile picture of anindyaray anindyaray said 1 year, 4 months ago:

    any help ?

  • i think this forum is dead…no one wants to reply no one wants to code..

  • Profile picture of refigacan refigacan said 5 months, 2 weeks ago:

    Every tub must stand on its own bottom.

  • Profile picture of tasimastlio tasimastlio said 5 months, 2 weeks ago:

    The possession of unlimited power will make a despot of almost any man. There is a possible Nero in the gentlest human creature that walks.

  • Profile picture of enliniweeb enliniweeb said 4 months, 3 weeks ago:

    How do you tell a communist? Well, it’s someone who reads Marx and Lenin. And how do you tell an anti-communist? It’s someone who understands Marx and Lenin

  • Profile picture of stoi2m1 stoi2m1 said 4 months, 2 weeks ago:

    damn the spammers.

    Use the following function
    bp_follow_add_follow_button(array('leader_id'=>$displayed_userID, 'follower_id'=>$current_userID))

    Here is how i added the follow link to the activity stream.

    you have to add two lines of code to two template files. /your_theme/activity/entry.php and /your_theme/activity/comment.php

    This is the first line of code needed in both files, place it towards the top of the file, this is to make the buddypress object available in the file
    <?php global $bp ?>

    This line of code is used in the entry.php file
    <?php bp_follow_add_follow_button( array('leader_id'=>bp_get_activity_user_id(),'follower_id'=>$bp->loggedin_user->id)) ?>

    This line of code is used in the comment.php file
    <?php bp_follow_add_follow_button( array('leader_id'=>bp_get_activity_comment_user_id(),'follower_id'=>$bp->loggedin_user->id)) ?>

    Let me know if you need any more info, good luck,
    Jesse

  • Profile picture of r-a-y r-a-y said 4 months, 2 weeks ago:

    Thanks for providing support, Jesse!

    To get rid of the global $bp declaration, you can use bp_loggedin_user_id() in place of $bp->loggedin_user->id.

  • Profile picture of trofesbatrev trofesbatrev said 4 months ago:

    Abortion is advocated only by persons who have themselves been born