Reply To: New user to become member of all blogs
hi @sguzen,
On a MS install, the default behaviour for a new user is:
– once register approved
– automatically member of the main site – by default this is the “network”.
You simply disallow registering on the sub blogs, by uncheking Allow user to register. This will force any new user to use the netwwork register page.
And you add a function to exclude the subscriber role to appear on activities and a recount on the member directory, so subscriber won’t be counted in the members list.
function bpdev_exclude_users($qs=false,$object=false){
if ($object != 'members') {
return $qs;
}
$subscribers = get_users('role=subscriber');
$exclude = "";
foreach ($subscribers as $subscriber) {
if (trim($exclude) != "") {
$exclude = $exclude . ",";
}
$exclude = $exclude . $subscriber -> ID;
}
$args['exclude'] = $exclude;
$qs = build_query($args);
return $qs;
}
add_action('bp_ajax_querystring','bpdev_exclude_users', 20, 2 );
function bpfr_hide_get_total_filter($count){
return $count-1;
}
add_filter('bp_get_total_member_count','bpfr_hide_get_total_filter');