• jomo

    (@jonathanmoorebcsorg)


    I would like to use advanced search on other screens, especially for searching for users to invite to groups etc.

    Do you have a GitHub for submitting proposals?

    I found these changes were needed to allow search to filter group member query
    in bp-profile-search:
    bps-templates47.php actions ll17-18:

    `
    $dirs = bps_directories ();
    $F->action = $dirs[$meta[‘action’]]->link;
    `
    change to:

    `
    if (bp_is_group_members()){
    $F->action = “?”;
    }else{
    $F->action = $dirs[$meta[‘action’]]->link;
    }
    `

    bps-search.php l.50 change from:

    `
    if ($object != ‘members’ && $object != ”) return $qs;
    if (bps_active_form () === false) return $qs;
    `

    to:

    `
    //allow the filter to apply to certain forms..
    switch ($object) {
    case ‘members’ :
    case ‘group_members’ :
    case ‘my-invite-form’ : //etc
    if (bps_active_form () === false) return $qs;
    break;
    default:
    return $qs;
    }
    `

    and add to top of bps-form.php:

    `
    /* add also to group member directory */
    add_action (‘bp_before_group_members_content’, ‘bps_add_form’);
    add_action (‘bp_before_group_members_content’, ‘bps_display_filters’);
    `

    Also BuddyPress bp-groups-functions.php l.658 change to:

    `
    $members = new BP_Group_Member_Query( $r);
    `
    otherwise ‘include’ filter is lost.
    Yes that would need proposing back to BuddyPress unless there is another way to do it..

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Andrea Tarantini

    (@dontdream)

    Hello jonmoore,

    Sorry I’m still using SVN, but thanks for your patch anyway!

    Please allow me a few days to look into it, and I’ll get back to you as soon as possible.

    Thread Starter jomo

    (@jonathanmoorebcsorg)

    sure ok… if it was on Github I’d do a pull request.

    Actually the Group Member search is just the first step.
    The next step I am thinking is the BP Nouveau, Next Generation template pack, which has the ability to search all users to invite to a group, with a better interface than Invite Anyone.
    Of course such as search needs the advanced search filter..

    Plugin Author Andrea Tarantini

    (@dontdream)

    Hello jonmoore,

    I did some testing and your patch looks good. I’ll release your changes in the next plugin version, but the feature won’t be made public until a patched BuddyPress release is available.

    To enable the feature, you’ll need to patch BuddyPress as you explained, and add these lines to your bp-custom.php file:

    add_action ('bp_before_group_members_content', 'bps_display_filters', 10);
    add_action ('bp_before_group_members_content', 'bps_add_form', 20);

    Thank you for your contribution, and please feel free to suggest more changes if needed.

    Thread Starter jomo

    (@jonathanmoorebcsorg)

    thanks – I haven’t requested a patch to BuddyPress as I wondered whether you might think of alternative workaround. Can you request to BuddyPress? (I’m not sure what their process is)

    Plugin Author Andrea Tarantini

    (@dontdream)

    Ok, I’ll try to submit a patch this weekend.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Advanced search in other screens’ is closed to new replies.