Viewing 11 replies - 1 through 11 (of 11 total)
  • Plugin Author r-a-y

    (@r-a-y)

    Using the activity scope does not work as expected in BP because it is very restricting.

    Instead, pass the user IDs in the activity loop using bp_get_following_ids().

    Like this:

    if ( bp_has_activities( array(
    	// change the user ID below to whatever
    	'user_id' => bp_get_following_ids( 'user_id=3' )
    ) ) ) :

    Update: There was a bug in the code. Should work now.

    Also posted a wiki item about this:
    https://github.com/r-a-y/buddypress-followers/wiki/Create-your-own-follow-activity-loop

    Thread Starter jgadsby

    (@jgadsby)

    Hey, thanks for the reply! How would I edit the loop so that it shows the activity from users the currently logged in user is following?

    So that if user A who is following B and C logs in, he sees activity from B and C, and

    If user B is just following C, she logs in and just sees activity from user C?

    Would it be something involving wp_get_current_user()?

    Thanks so much for your help!

    Thread Starter jgadsby

    (@jgadsby)

    Tried

    if ( bp_has_activities( array(
    	// change the user ID below to whatever
    	'user_id' => bp_get_following_ids()
    ) ) ) :

    In the hope that this just grabs all the IDs being followed, but that doesn’t work.

    Plugin Author r-a-y

    (@r-a-y)

    Try:

    if ( bp_has_activities( array(
    	// change the user ID below to whatever
    	'user_id' => bp_get_following_ids( 'user_id=' . bp_loggedin_user_id() )
    ) ) ) :

    @r-a-y
    when I use your code above I loose my favorites feed. What can I do to get Favorites back to Favorite’s tab and Followers activity to Followers Tab?
    Thanks.

    Even after reading and testing a lot of things about activity-loop I can’t get my favorites back… and now my feed shows ‘Everything’ and not only the ‘Updates’ in both tabs (Following Tab and Favorites Tab)
    can you help me please?

    I’m using BP 1.7

    Plugin Author r-a-y

    (@r-a-y)

    Where are you adding your loop? Are you adding your loop on a page that already has an activity loop? If so, that’s probably where you are running into problems.

    Adding to the activity-loop.php in my child theme. I’m confused right now. Do I have to add to the code to the bp-activity-template?

    Plugin Author r-a-y

    (@r-a-y)

    @pampamtum – Do not edit the activity-loop.php template. That’s the main loop for all activity stream items in BuddyPress.

    The examples above are for people wanting to add their own loop on a separate page template.

    What are you trying to achieve?

    Sorry about my naive @r-a-y… Yesterday, I was wondering your code was to add to the activity-loop or something related with. But, after sleeping a few hours I’ve found functions in my live and they made my day. Huge Thanks for your time @r-a-y

    Since this thread is alive and the Plugin Author is here. Ill post it here ??

    I’m trying to get a list of IDs of all the followers and then all the followers, of a particular user

    I don’t understand how to get that.

    (Yes I read above already, but I don’t really understand what ‘user_id’ => bp_get_following_ids( ‘user_id=’ . bp_loggedin_user_id() does

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Show just the activity of those you're following in the activity loop?’ is closed to new replies.