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: 25275
    Brajesh Singh on in reply to: [Resolved] AutoActivate AutoLogin Not working #8309

    Hi Brett,
    Thank you for the update. I am glad it is resolved 🙂

  • Keymaster
    (BuddyDev Team)
    Posts: 25275
    Brajesh Singh on in reply to: Can't Delete Gallery #8303

    Hi Malachi,
    Thank you for posting.
    It’s a bug with the theme as it seems. your theme is somehow disabling/hiding the checkbox. Please contact the theme author and let them know about the issue.

    they should be able to fix it.

    Regards
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25275
    Brajesh Singh on in reply to: [Resolved] Limit the searching range of members #8299

    Hi Dandy,
    Please put the following code in your bp-custom.php

    
    /**
     * Limit BP profile search plugin to user who are members of the current user's group
     * @param $users
     *
     * @return array
     */
    function buddydev_limit_users_search_to_group_members( $users ) {
    	// Do not check for non logged in or the site admin.
    	if ( ! is_user_logged_in() || is_super_admin() ) {
    		return $users;
    	}
    
    	$logged_id = get_current_user_id();
    	$groups = groups_get_user_groups( $logged_id );
    	// If the user does not belong to any group, the result should be empty.
    	if ( empty( $groups['groups'] ) ) {
    		//this user does not belong to any group
    		$users = array();//array( 0, 0 ); // Limit to invalid user.
    		return $users;
    	}
    
    	// if we are here, the user has some groups, let us find out the members of those groups.
    	global $wpdb;
    	$bp = buddypress();
    
    	$list = '(' . join( ',', $groups['groups'] ) . ')';
    
    	$member_ids =  $wpdb->get_col( $wpdb->prepare( "SELECT user_id FROM {$bp->groups->table_name_members} WHERE group_id IN {$list} AND is_confirmed = 1 AND is_banned = 0 AND user_id != %d",$logged_id ) );
    
    	if ( ! empty( $member_ids ) ) {
    		$users = array_intersect( $users, $member_ids ); // set intersection.
    	} else {
    		$users = array();
    	}
    
    	return $users;
    }
    add_filter( 'bps_filter_members', 'buddydev_limit_users_search_to_group_members' );
    
    

    It will limit the BP profile search to only look for the Group members.
    Thank you
    Brajesh

    • This reply was modified 8 years, 10 months ago by Brajesh Singh.
  • Keymaster
    (BuddyDev Team)
    Posts: 25275
    Brajesh Singh on in reply to: [Resolved] Conditional Profile Fields #8296

    Thank you Dennis. That’s good to know 🙂
    Marking it as resolved.

  • Keymaster
    (BuddyDev Team)
    Posts: 25275
    Brajesh Singh on in reply to: [Resolved] Media in comments #8289

    Hi Ben,
    I am sorry to keep you waiting. I am experimenting today and will have some definite results four sure today.

    Thank you
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25275
    Brajesh Singh on in reply to: [Resolved] Mailchimp list #8287

    That’s a great news.
    Thank you for marking it as resolved.

  • Keymaster
    (BuddyDev Team)
    Posts: 25275
    Brajesh Singh on in reply to: [Resolved] Limit the searching range of members #8284
    This reply has been marked as private.
  • Keymaster
    (BuddyDev Team)
    Posts: 25275
    Brajesh Singh on in reply to: [Resolved] MediaPress problem with PHP 7.0. #8283

    Thank you for reporting Jaume.
    It is fixed. It was coming from 3rd party library class we had included. I have added the fix in the 1.0.8 and is available from wp.org now.

    Regards
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25275

    Hi Christian,
    thank you for posting.

    1. The functionality is not available directly in MediaPress. you can easily add it. Please see
    https://github.com/buddydev/mediapress/blob/master/core/mpp-permissions.php#L39

    All you need to do is check if the current logged in user is the user you want to allow private access and add “private” to the returned status array.

    2. We don’t have an ui for this. you can do it if you want. All you need to do is it set the post_author to the user for which the gallery needs to be created.

    Regards
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25275
    Brajesh Singh on in reply to: Sticky navigation bar (like as buddydev) #8215

    Hi Nana,
    I am about to do it for a project of mine with Community Builder. I will share the code as a blog post next week.

    Thank you
    Brajesh