Shape the future of Social networking with WordPress: Join Project Midnight Sun! The next generation platform for community building with WordPress!

BuddyDev

Search

Replies

  • Keymaster
    (BuddyDev Team)
    Posts: 25348
    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: 25348

    Hi Kristina,
    You are most welcome 🙂

    Should we mark it as resolved then?

  • Keymaster
    (BuddyDev Team)
    Posts: 25348
    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: 25348
    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: 25348
    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: 25348
    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.

    • This reply was modified 10 years, 4 months ago by Brajesh Singh.
  • Keymaster
    (BuddyDev Team)
    Posts: 25348
    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?

  • Keymaster
    (BuddyDev Team)
    Posts: 25348

    Hi Kristina,
    Thank you.

    1. Please upgrade to blog categories for groups 1.2.1(It is required only if you want to disable the create step category selection screen & group admin manage screen for category selection)

    2. Please put the following code in your bp-custom.php

    https://gist.github.com/sbrajesh/186460e14bbd1f9e5910

    I have left the top ‘

  • Keymaster
    (BuddyDev Team)
    Posts: 25348

    Hi Kristina,
    I have managed to write some code that creates a category with group name when group is created.

    What do you suggest for already existing group? should we check and create for them when user visits the blog tab?

  • Keymaster
    (BuddyDev Team)
    Posts: 25348
    Brajesh Singh on in reply to: Mediapress – No upload in activity or gallery #1337

    Hi JC,
    Thank you. I have got the idea what is happening.

    The image is uploading but the response that is coming from server is not properly JSON formatted causing the issue(not being attached to the activity).

    Are you familiar with firebug addon? if yes, I will need one more help from you. Please click on console before uploading image.
    Then select image and you will see a post request. Click on response tab of that request and take a screenshot and post me.
    here is a screenshot to show it.

    http://i.imgur.com/PI32Aci.png

    That ill give us the complete idea of what is going on.

    Thank you for all your help so far in troubleshooting it.

    Thank you
    Brajesh