• Resolved SJS719

    (@sjs719)


    Thank you for the very nice looking plugin! I know that it is new so you haven’t had a chance to work out all of the bugs, but upon setting it up there are a few things I need assistance with.

    First is that I need to move the “# Mutual Friends” link in the members loop from under the latest activity to under some custom profile data I am displaying per member. It appears that you have tied the mutual friends link to the latest activity link so I’m not sure I can easily re-position it.

    If the mutual friends link cannot be easily moved then is there a function or shortcode which will output the link so I can hide the first appearance (under activity) and echo the link in a later spot? Echoing “bp_mutual_friend_total_count” doesn’t appear to work.

    Secondly I think having the option to include the Mutual Friends Tab as a child tab underneath the “Friends” Tab in the user profile page would be very helpful. This way Mutual Friends doesn’t take up menu space with its own tab. If this cannot be easily accomplished then perhaps the ability to move and position the tab where it makes since? Currently it is 2 tabs away from my the main “Friends” Tab on my site.

    Thanks!

    https://www.ads-software.com/plugins/mutual-buddies/

Viewing 15 replies - 1 through 15 (of 15 total)
  • Plugin Author Paresh Radadiya

    (@pareshradadiya-1)

    Hi SJS719,

    Re Mutual Friends tab position. I’m agree it should be underneath the friends tab. Will fix it soon.

    Echoing “bp_mutual_friend_total_count” doesn’t appear to work

    Are you calling this function in members-loop?

    Re re-position mutual friends link. I actually like the idea of re-position ability. Need to work on this.

    Thanks.

    Thread Starter SJS719

    (@sjs719)

    Hey Paresh,

    Okay I look forward to these features being included! Yes I tried echoing “bp_mutual_friend_total_count” in the members loop but it always shows mutual friends as “0” even if there are mutual friends.

    While you are working on these features do you have any suggestions on how to unlink the mutual friends link from the recent activity link? I tried replacing the “bp_member_last_active” hook in the bp-mutual-friends-functions.php file (on line 115) but couldn’t get it to work. Any ideas?

    Thanks!

    Plugin Author Paresh Radadiya

    (@pareshradadiya-1)

    Hello SJS719

    Please first update the plugin.

    Add this filter to unlink the mutual friends link from the recent activity link
    add_filter('bmf_show_total_mutual_friend_count', '__return_false' )

    Use bmf_get_total_mutual_friend_count() inside members loop

    or you can use this snippets

    function test_bp_directory_members_item() {
    	echo bmf_get_total_mutual_friend_count();
    }
    add_action( 'bp_directory_members_item', 'test_bp_directory_members_item' );
    add_filter('bmf_show_total_mutual_friend_count', '__return_false' );
    Thread Starter SJS719

    (@sjs719)

    Hey Paresh,

    It seems that the new filter successfully unlinks the mutual friends link from latest activity. But echo bmf_get_total_mutual_friend_count() unfortunately doesn’t work correctly. It is strange, the mutual friends link correctly shows up on the first member in the loop but for all the rest of the members in the loop it displays total friends count instead of mutual friends count and the “Mutual Friends” text is missing.

    Also, the snippet returns an redeclare error.

    Any ideas?
    Thanks.

    Plugin Author Paresh Radadiya

    (@pareshradadiya-1)

    If members dose not have a mutual friends then it will show member’s friends.

    You can remove friends count using this filter if you want

    add_filter('bmf_show_friend_count', '__return_false' )

    Re redeclare error. Could you please give me an error log?

    Thread Starter SJS719

    (@sjs719)

    Okay that makes sense now, thanks for the great support!

    The error message says you cannot redeclare test_bp_directory_members_item on subsequent lines.

    Plugin Author Paresh Radadiya

    (@pareshradadiya-1)

    Please change the name of test_bp_directory_members_item function since it is already declared

    Thread Starter SJS719

    (@sjs719)

    Hi Paresh,

    Are you planning on either placing the mutual friends tab within the friends tab or creating the ability for the user to do so like we had discussed? If so, do you have any sort of a timeline on when to expect the update? It seems to make more sense to have the mutual friends tab as a child like the “Friendships” and “Requests” tabs under Friends.

    Thanks!

    Plugin Author Paresh Radadiya

    (@pareshradadiya-1)

    Yes! I want to move mutual friends tab under Friends but at present, BuddyPress doesn’t allow us to add new child tab under Friends while viewing members’s profile.

    Thread Starter SJS719

    (@sjs719)

    Oh that’s to bad, that would have been an awesome feature!

    Maybe instead of having a tab or child tab for mutual friends you could create the option to just show mutual friend count within the friends tab loop? I can do this myself pretty easily, but is there a certain filter or hook to use to remove the “Mutual Friends” tab?

    Plugin Author Paresh Radadiya

    (@pareshradadiya-1)

    Sorry We don’t have filter to remove the “Mutual Friends” tab. Yeah it would be awesome to have it!. Will start work on this soon.

    Thread Starter SJS719

    (@sjs719)

    Hey Paresh,

    I have removed the mutual friends tab and found a way to include it in the subnav of “Friends” but cannot get the link to work correctly.

    I am creating a new subnav item under friends using:

    bp_core_new_subnav_item( array(
        			'name' => __('Mutual Friends', 'buddypress'),
        			'slug' => 'mutual-friends',
        			'parent_slug' => 'friends',
        			'parent_url' => trailingslashit( bp_displayed_user_domain() . 'friends' . '/' ),
        			'screen_function' => 'mutual_friends_function',
        			'position' => 20,
        			'show_for_displayed_user' => true,
    				'user_has_access' => true
        	) );

    Then I am hiding the subnav item on the user’s own profile so they only see it on other’s profiles using:

    function remove_mutual_friends_subnav() {
      if (bp_is_my_profile()) {
    	bp_core_remove_subnav_item( $bp->friends->slug, 'mutual-friends' );

    The subnav item shows up correctly, but for some reason the linked URL created is always incorrect no matter what value is used for ‘parent_url’ and ‘slug’. Can you please try out the code and see if you can get the correct link? If we can figure out how to correctly link the URL then you will have the ability to place the mutual friends tab as a subnav tab under friends.

    Plugin Author Paresh Radadiya

    (@pareshradadiya-1)

    Hi SJS719.

    Thanks for suggestion. I’d tied this but wasn’t worked for me.

    Anyway I’ve reported bug here on buudypress trac https://buddypress.trac.www.ads-software.com/ticket/6593

    Thread Starter SJS719

    (@sjs719)

    Paresh,

    You also need to make a change to the Buddypress file which loads the nav bar. So in this case you need to open templates/legacy/bp/members/single/friends.php

    And edit:

    <?php if ( bp_is_my_profile() ) bp_get_options_nav(); ?>

    To:

    <?php bp_get_options_nav(); ?>

    Then the above method should work to create and display the mutual friends sub tab but when it is clicked the link is broken.

    Plugin Author Paresh Radadiya

    (@pareshradadiya-1)

    SJS719. I’ve submitted the patch for that.

    Thanks.

Viewing 15 replies - 1 through 15 (of 15 total)
  • The topic ‘A Few Things’ is closed to new replies.