BuddyDev

Search

Replies

  • Keymaster
    (BuddyDev Team)
    Posts: 24741
    Brajesh Singh on in reply to: Unable to reply in the topic I created? #1362

    Hi Laurie,
    sorry about that topic issue. If that happens next time, please try refreshing browser. That hsould fix it.

    Now, about your question. Yes, you are right. The problem is it only looks for followers when friends is not active.

    Again, enabling followers is still not an issue, I ma posting modified code from my previous post to include following users with friends.

    
    
    add_filter( 'fblike_activity_get_friend_ids', 'fb_like_custom_include_folling_user_ids_with_friends', 10, 2 );
    function fb_like_custom_include_folling_user_ids_with_friends( $user_ids, $current_user_id ) {
    	
    		$following_ids = bp_follow_get_following ( array('user_id'=> $current_user_id ) );
    	
    		$all_ids =  array_merge( $user_ids, (array) $following_ids );
    		
    		return array_unique( $all_ids );
    }
    
    

    Can you please put it in your bp-custom.php or theme’s functions.php and check if it is working or not?

    Thank you
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 24741

    Hi George,
    sorry for missing it. Will look at it today and get back to you.

  • Keymaster
    (BuddyDev Team)
    Posts: 24741
    Brajesh Singh on in reply to: Happy Birthday Brajesh #1358

    Thank you Israel 🙂
    I appreciate the feelings 🙂

    Thank you
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 24741
    Brajesh Singh on in reply to: Followers are not showing in activity feed #1357

    Hi Laurie,
    My apologies for the inconvenience.

    Since most the users are only interested in seeing the activity of the users they follow, This plugin includes that by default.

    Still, It is very easy to make it include the activity of followers. You can add following line to your bp-custom.php or theme’s functions.php and It will include followers activity too

    
    add_filter( 'fblike_activity_get_friend_ids', 'fb_like_custom_include_follower_user_ids', 10, 2 );
    
    function fb_like_custom_include_follower_user_ids( $user_ids, $current_user_id ) {
    	
    	$follower_ids = bp_follow_get_followers( array( 'user_id' => $current_user_id ) );
    	
    	return array_merge( $user_ids, $follower_ids );
    }
    
    

    Hope that helps.

    Thank you
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 24741

    Hi Kristina,
    You are most welcome 🙂

    Should we mark it as resolved then?

  • Keymaster
    (BuddyDev Team)
    Posts: 24741
    Brajesh Singh on in reply to: [Resolved] Friends Only Activity Stream #1352

    Thank you Israel.
    I am glad that it is working. Appreciate your generosity 🙂

  • Keymaster
    (BuddyDev Team)
    Posts: 24741
    Brajesh Singh on in reply to: [Resolved] Friends Only Activity Stream #1350

    Hi,
    I have update the code in my 2nd post. I left a print_r there that was showing the output. Sorry about that.

  • Keymaster
    (BuddyDev Team)
    Posts: 24741
    Brajesh Singh on in reply to: [Resolved] Friends Only Activity Stream #1347

    Hi,
    Can you please post your bp-custom.php on pastebin? There seems to be some space before opening/after closing php tag causing it. There is an easy fix to remove the spaces.

  • Keymaster
    (BuddyDev Team)
    Posts: 24741
    Brajesh Singh on in reply to: [Resolved] Friends Only Activity Stream #1345

    Please put the following code in your bp-custom.php and it should work.

    
    
    function buddydev_friends_only_activity_args( $args ) {
    	
    	if( ! bp_is_activity_directory() || !  is_user_logged_in() ) {
    		return $args;
    	}
    	
    	$user_id = get_current_user_id();
    	
    	$user_ids = friends_get_friend_user_ids( $user_id );
    	
    	//include users own too?
    	array_push( $user_ids, $user_id );
    	
    	$args['user_id'] = $user_ids;
    	
    	//print_r($args);
    	return $args;
    
    }
    add_filter( 'bp_after_has_activities_parse_args', 'buddydev_friends_only_activity_args' );
    
    

    hope that helps.

  • Keymaster
    (BuddyDev Team)
    Posts: 24741
    Brajesh Singh on in reply to: [Resolved] Friends Only Activity Stream #1343

    Do you mean you want it on sitewide activity? It is very easy to do. Just need confirmation where you want it to be, on sitewide activity page or on user profile page?