BuddyDev

Search

[Resolved] Profile Tabs Pro and Friends/Activity Visibility Setting

  • Participant
    Level: Enlightened
    Posts: 90
    Sujee Kulendran on #15314

    Hi Brajesh,

    I have the Friends and Activity Tab activated and added to all members, however the visibility is set ONLY to both the profile owner and friends only. Although the tabs are visible to profile owner, when they become friends, they can’t view each others friends or chat tabs even though I had set the tab visibility as such. Any idea why?

    Thanks!
    Sujee

  • Keymaster
    (BuddyDev Team)
    Posts: 24212
    Brajesh Singh on #15344

    Hi Sujee,
    I am looking at it . Will get back to you in 30 mins.

    Regards
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 24212
    Brajesh Singh on #15348

    HI Sujee,
    There was a small issue with the ‘self’ privacy overriding others. Please upgrade to 1.0.9 and it will be fixed. No changes needed on your end.

    https://buddydev.com/plugins/buddypress-user-profile-tabs-creator-pro/

    Thank you
    Brajesh

  • Participant
    Level: Enlightened
    Posts: 90
    Sujee Kulendran on #15352

    Thank you!

  • Keymaster
    (BuddyDev Team)
    Posts: 24212
    Brajesh Singh on #15359

    Hi Sujee,
    Did it work for you?

    Thank you
    Brajesh

  • Participant
    Level: Enlightened
    Posts: 90
    Sujee Kulendran on #15387

    Sorry for the late reply – I didn’t turn on notifications for this thread.

    Wonderfully! Everything works! Many thanks.

    I have a quick question. Not directly related to this but I had used a code as per buddypress documents to remove the ‘all members’ tab by inserting the following code into the members-loop.php file of my buddypress directory in the theme:

    <?php if ( bp_has_members( ‘user_id=’ . bp_loggedin_user_id() ) ) : ?>

    Problem is that it works only for logged-in users so they are only able to see their friends when logged in but logged out, the site actually breaks and all members can be seen.

    I guess my question would be – is there an alternative way to completely remove the all members tab?

    Thanks in advance!

    Sujee

  • Keymaster
    (BuddyDev Team)
    Posts: 24212
    Brajesh Singh on #15389

    Hi Sujee,
    Thank you for confirming.

    For the assistance with the other topic:-

    Please leave the members loop intact and you can put this in the functions.php/bp-custom.php

    
    
    /**
     * Filter members loop args.
     *
     * @param array $args
     *
     * @return array
     */
    function buddydev_filter_all_members_list_for_members_dir( $args = array() ) {
    
    	if ( ! bp_is_members_directory() ) {
    		return $args;
    	}
    
    	if ( ! is_user_logged_in() ) {
    		$args['include'] = array( 0, 0 );// invalid
    	} else {
    		$args['user_id'] = get_current_user_id();
    	}
    
    	return $args;
    
    }
    
    add_filter( 'bp_after_has_members_parse_args', 'buddydev_filter_all_members_list_for_members_dir' );
    
    

    That will hide the list for non logged in users and for logged in, only their friends will be visible.

    The script does have following side effects:-
    1. The total members count is still visible in the tab
    2. It affects search.

    PS:- In future, if possible, please open a new topic for new issues. That way, the topic becomes useful for other members having similar issues. I hope you won’t mind that.

    Thank you
    Brajesh

  • Participant
    Level: Enlightened
    Posts: 90
    Sujee Kulendran on #15392

    Thank you and Yes I completely understand. Sorry about that! Once again, you’ve been very helpful.

  • Keymaster
    (BuddyDev Team)
    Posts: 24212
    Brajesh Singh on #15393

    Hi Sujee,

    There is nothing to be sorry. It was just a request from my end 🙂

    Tank you
    Brajesh

You must be logged in to reply to this topic.

This topic is: resolved