Skip to:
Content
Pages
Categories
Search
Top
Bottom

Forum Replies Created

Viewing 18 replies - 1 through 18 (of 18 total)
  • @snarkypuppet

    Participant

    I’ll check it out – thanks for the suggestions!

    @snarkypuppet

    Participant

    Badass – thanks @danbp ! That code should get me in the right direction

    @snarkypuppet

    Participant

    I’ll check those out.

    Have you seen this done before @shanebp ?

    @snarkypuppet

    Participant

    I appreciate your suggestions – it seems as complicated as re-writing the bp_get_activities function itself though. Don’t you think? I’m really curious if anyone has ever done this thing before – Have you seen a site with this done out in the wild?

    @snarkypuppet

    Participant

    Ok great thanks for the clarification – What functions are you using to do that “seperate custom process”?

    @snarkypuppet

    Participant

    @shanebp

    Can you confirm?

    Your saying run bp_has_activities(with all my friend and I argument)

    Get the activity ID’s

    run bp_has_activities(with all my groups for the argument)

    Get the activity ID’s

    Combine/parse remove duplicate id’s from first and second and set to include arg

    run bp_had_activities(with the included id’s)

    @snarkypuppet

    Participant

    Are you using bp_has_activities to get them?

    @snarkypuppet

    Participant

    If I understand you correctly your saying run bp_has_activities with user_ids as a filter, then for group activities with your personal group ids, then parse all of the activity id’s together to finally run them through a third time with the include argument?

    Would this method have any issue with the default activivty template loader for load-more?

    @snarkypuppet

    Participant

    @shanebp – I dont think that’ll work – what your proposing would then include regular updates, comments, and whatever else from the group member id’s. If your not their friend you dont want to see that stuff.

    If you did do it this way you would probably have to write a function to then remove everything but group posts by group member id’s that are not your friends. Super awkward. :\

    @snarkypuppet

    Participant

    Oversight on my end again – @shanebp yes, what your saying is true it will show you group activity from you and your friends. Essentially this is just a friends feed, a copy of /activity/friends. However, it doesn’t show activity from your groups that have members which are not your friends, which was my original concern.

    So confusion aside, the issue is still unresolved, seems like there is no way to show group & friend activity combined.

    Has anyone successfully done this? Written a new bp_get_activities? I wouldn’t mind spending the time tearing apart that function if I knew it was possible – so even a nay or yay from someone who has done it would be fantastic.

    @snarkypuppet

    Participant

    Yeah that does work – my bad – thanks for pushing it back on me. Just checked private groups as well and everything seems good. I had given up, glad to have these merged, woo! 🙂

    @snarkypuppet

    Participant

    Because the groups you belong to are not included, just your friends ID’s. You’ll get some of your friends group activity – It won’t have your own groups in the activity.

    @snarkypuppet

    Participant

    Oh ok – would that include group activity though?

    @snarkypuppet

    Participant

    @shanebp Whats the thinking behind using the combination of user_ids and include? I want to show all friend and group activity, not just group activity from members that are my friends which is what would happen if you filter with user_ids using the group scope. The trick is that there are members of my groups that are not my friends, and there are friends that are not in my groups. Do I understand you correctly?

    @snarkypuppet

    Participant

    Hey @shanebp – thanks for sharing – I think this might only work if you are looking for friends + personal activity.

    I’ve been scouring the forums and wp stack exchange and haven’t found anyone that has got this setup working. I’m seeing a lot of people saying it can be done but no actual code examples or suggestions for how. I do see that personal + friends activity can be combined with the example given on the activity loop page.

    Is there anyone in the buddypress dev community that has, in practice, combined various scopes successfully?

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

    @snarkypuppet

    Participant

    Hey @danbp Thanks for the response. I looked into that thread and that led me to this:

    bp_has_activities to accept multi scope

    This is an enhancement marked for future review… 14 months ago :\ – Looks like the only way to do it is to write a new class/function.

    Is there anyone out there that has written something that includes multiple scopes? Is it possible?

    @snarkypuppet

    Participant

    @mika89 – were you able to figure something out?

Viewing 18 replies - 1 through 18 (of 18 total)
Skip to toolbar