saqibhassan96
Forum Replies Created
Viewing 1 replies (of 1 total)
-
Unfortunately i cant, im running it local for dev purposes.
Anyways, I did manage to show the member of only the current blog with the help a plugin I made, thanks for the reply too.. Now the only issue is that when the site load, by default it shows only the last active member, i.e. type=’alphabetical’ instead of last active. I tried to configure this functionality in the same plugin but no luck. This is the code for it incase someone else ever faces the same issue:
<?php /** * @package buddypress-multisite-membercounts */ /* Plugin Name: Correct Member Counts For BP on MS Plugin URI: N/A Description: This plugin had been desgined to optimize buddypress for use in WP Multisites. It corrects the total member count, giving total number of users of the CURRENT blog only. It also corrects the list of members shown on the members page such that only the members of CURRENT blog are shown. * */ /* * Correcting Total Number Count: */ function bp_total_member( $bp_total_member ){ $member_total_array = get_users ( array( 'blog_id' => get_current_blog_id() )); $member_total = count($member_total_array); return $member_total; } add_filter( 'bp_get_total_member_count', 'bp_total_member' ); /* * Correcting arrangement type */ function filtering_members_list( $query ) { if ( empty( $query ) && empty( $_POST ) ) { $query['type'] = 'alphabetical'; $query['orderby'] = 'alphabetical'; }; return $query; } add_filter( 'bp_ajax_querystring', 'filtering_members_list' ); /* * Showing member of current blog only */ add_action('bp_ajax_querystring','bpdev_include_users',20,2); function bpdev_include_users($qs=false,$object=false){ //list of users to include $blogid = get_current_blog_id(); $wp_user_query = new wp_user_query( array( 'blog_id' => $blogid ) ); foreach( $wp_user_query->results as $users_list ): $included_user.=$users_list->ID.",";;//comma separated ids of users whom you want to include endforeach; if($object!='members')//hide for members only return $qs; $args=wp_parse_args($qs); //check if we are listing friends?, if(!empty($args['user_id'])) return $qs; if(!empty($args['include'])) $args['include']=$args['include'].','.$included_user; else $args['include']=$included_user; $qs=build_query($args); return $qs; }the
filtering_members_listfunction does not seem to be working well…
Viewing 1 replies (of 1 total)