Skip to:
Content
Pages
Categories
Search
Top
Bottom

How to filter members by blog/site in multisite installation


  • RickHN
    Participant

    @rchinchilla

    Hi…

    PROBLEM:
    How to filter members directory by site/blog id?, so in a multisite installation with one BP instance were possible to filter only the registered member in the current blog/site directory members.

    SOLUTION:
    In bp-custom.php:
    ————————————
    function include_users() {
    $sitio_id = get_current_blog_id();
    $included_users = implode(‘,’,get_users(‘blog_id=’.$sitio_id.’&fields=ID’));
    return $included_users;
    }

    In members-loop.php (about line #50, find and modify):
    ————————————
    $members_loop_query = apply_filters(‘woffice_members_loop_query’, bp_ajax_querystring( ‘members’ ).’&exclude=’.$exclude_members.’&include=’.include_users() );

    I take this idea from:
    http://twentythreedegrees.co.uk/exclude-include-members-by-user-role-in-a-buddypress-members-loop/

    BUT….

    Still have not found how to filter (or where to do that) for the member widget or even better, sitewide? (whereever a member list, plugin or widget need to list BP members).

    ¿Someone can give me some help with this??

Viewing 1 replies (of 1 total)

  • Hugo64
    Participant

    @hugobernard

    Hello,

    I tried it and returned
    Parse error: syntax error, unexpected ‘=’ in /home/…/public_html/wp-content/plugins/bp-custom.php on line 60, which is the line $included_users = implode(‘,’,get_users(‘blog_id=’.$sitio_id.’&fields=ID’));

    Thanks for your work

Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.
Skip to toolbar