Support » Plugin: BP Multi Network » Doesn't list members properly

  • Hello,

    then using the standard BuddyPress list of members, it lists all the wp_users regardless of what subsite they have access to. Since this plugin is about creating different groups for each subsite I think it makes sense to separate this.

    I added this code to get it done:

    add_action( 'bp_pre_user_query', 'fv_bp_pre_user_query' );
    
    function fv_bp_pre_user_query( $buddypress ) {
      global $wpdb;
      $buddypress->uid_clauses['where'] = "WHERE u.ID IN ( SELECT ID FROM {$wpdb->users} AS u JOIN {$wpdb->usermeta} AS m ON u.ID = m.user_id WHERE meta_key = '{$wpdb->prefix}user_level' AND spam = 0 AND deleted = 0 AND user_status = 0 )";
    }

    Next I had to also fix the total user count as that’s determined by a different query which is not filtered by above:

    add_action( 'bp_user_query_populate_extras', 'fv_bp_fix_total_users' );
    
    function fv_bp_fix_total_users( $buddypress ) {
      if( $buddypress->query_vars['user_id'] == 0 && !$buddypress->query_vars['exclude'] && !$buddypress->query_vars['search_terms'] && !$buddypress->query_vars['meta_key'] && !$buddypress->query_vars['meta_value'] && !$buddypress->query_vars['include'] ) {
        set_transient( 'bp_active_member_count', $buddypress->total_users );
      }
    }

    If you could test this and include in next release, that would be great as we wouln’t have to maintain this fix and your plugin would benefit from it.

    Thanks!

    Martin

    https://wordpress.org/plugins/bp-multi-network/

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Ron Rennick

    (@wpmuguru)

    MultiSite Guru

    Thanks for posting this. Other than 1 bug fix 3 years ago, this plugin has not changed since it was originally released 4 years ago. I currently don’t have any plans for a next release.

    Hi Ron,

    Is there any chance you could add us as a contributor so we could add some fixes as we are using BP Multinetwork actively?

    Thanks!

    Alec

    Plugin Author Ron Rennick

    (@wpmuguru)

    MultiSite Guru

    I appreciate the offer. However, I explicitly explained in the plugin description that it works as you described:

    The user base is still shared across the WP install.

    Secondly, you are not the only site using the plugin. If that change was made and a new version was released it would change how the plugin worked for every site using it (whether or not those sites wanted the functionality change).

    Hi Ron & Foliovision(didn’t get your name bro).

    Does any of this makes sense what I said here??

    Buddypress Multisite/Multinetwork.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Doesn't list members properly’ is closed to new replies.