BuddyDev

Search

Profile visibility last activity

  • Participant
    Level: Initiated
    Posts: 15
    Matthias Englert on #10900

    Hi,
    is it possible to hide the last activitys in the activity stream?
    Regards

  • Keymaster
    (BuddyDev Team)
    Posts: 24593
    Brajesh Singh on #10925

    Hi Matthias,
    Do you want to hide user activities from the activity directory based on their profile privacy?

    We can easily allow hiding activity from the directory, the only issue will be hiding based on context(Friend/non friends etc).

    If you can help me understand it better, I will like to add it(If feasible).

    Thank you
    Brajesh

  • Participant
    Level: Initiated
    Posts: 15
    Matthias Englert on #10940

    Hi Brajesh, thanks for your reply.
    Yes, I meant an option to hide all activities (changed profil, posted a comment, and so on)
    Regards

  • Keymaster
    (BuddyDev Team)
    Posts: 24593
    Brajesh Singh on #10943

    Hi Matthias,
    I am going to explore it a little more and will report back. It is doable(for total exclusion of the user activity).

    Regards
    Brajesh

  • Participant
    Level: Initiated
    Posts: 15
    Matthias Englert on #11015

    thank you

  • Keymaster
    (BuddyDev Team)
    Posts: 24593
    Brajesh Singh on #11043

    Hi,
    I am sorry I forgot to reply.

    Please put this code in your bp-custom.php

    
    // Hide activity of the user from directory, and single
    function buddydev_hide_activity_conditions( $where_conditions, $args ) {
    
    	if ( ! function_exists( 'bp_profile_visibility_manager' ) ) {
    		return $where_conditions;
    	}
    
    	// Do not hide on user profile.
    	if ( ! bp_is_user() ) { // change it to bp_is_my_profile() to only show for the user.
    		$sql_hidden         = bp_profile_visibility_manager()->get_users_sql( 'bp_profile_visibility', 'self' );
    		$where_conditions[] = "a.user_id NOT IN ({$sql_hidden})";
    	}
    
    	return $where_conditions;
    }
    
    add_filter( 'bp_activity_get_where_conditions', 'buddydev_hide_activity_conditions', 10, 2 );
    
    

    Please feel free to customize it as needed.

    Hope it helps.
    Regards
    Brajesh

You must be logged in to reply to this topic.

This topic is: not resolved