Skip to:
Content
Pages
Categories
Search
Top
Bottom

Reply To: Combining activities for ‘/user/activity/groups’ & ‘/user/activity/friends’

@snarkypuppet

Participant

Just did a quick test in bp-activity-template.php. This isn’t any kind of solution as i’m editing core files.

As suggested in another thread I created an additional ‘case’ in bp_has_activities(). This code does not work and is a pretty basic attempt. Note that I only included the case here, there are a few other edits required in the function. This will return posts by friends in groups you belong to.

The issue seems to be that we want $primary_id OR $user_id below, not BOTH. Does someone have some insight into a way around this? Or can someone confirm that this is in fact the issue?

case 'groupsfriends':

if ( bp_is_active( 'groups' ) ) {

	$groups = groups_get_user_groups( $user_id );
	
	if ( !empty( $groups['groups'] ) ) {
		$object = $bp->groups->id;
		$primary_id = implode( ',', (array) $groups['groups'] );
	}
	
	//$user_id = 0;

}

if ( bp_is_active( 'friends' ) )
	$friends = friends_get_friend_user_ids( $user_id );
	if ( empty( $friends ) && empty( $groups['groups'] ) )
		return false;
	$user_id = implode( ',', (array) $friends );
	
break;
Skip to toolbar