Skip to:
Content
Pages
Categories
Search
Top
Bottom

New user to become member of all blogs


  • sguzen
    Participant

    @sguzen

    Hello everyone,

    I have setup a multiblog network with BP. Every single blog has its own activity.

    I have external database with users and have wrote a plugin to pull the data, create blogs for them (and users of course). I want other users to be able to register (I do authenticate them against another system and table) but I don’t want them to have their own activity, they r just visitors and should be registered to the entire network. Is that possible? Can I have the new user register on the entire network of blogs?

    Thanks in advance

Viewing 1 replies (of 1 total)

  • danbp
    Moderator

    @danbp

    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');
Viewing 1 replies (of 1 total)
  • The topic ‘New user to become member of all blogs’ is closed to new replies.
Skip to toolbar