Skip to:
Content
Pages
Categories
Search
Top
Bottom

[Resolved] Disable Groups Activity Stream, direct to members page instead


  • Simon Bame
    Participant

    @sbampfylde

    Hello,
    Wordpress Version – 3.9.1
    Buddypress Version – 2.0.1
    Website – http://www.britishparanormal.org.uk

    I run a website which lists event companies who some do public events and the other privates ones so I wish to split them into 2 groups – one group called “Public Events” & The other group called “Private Investigations”. I have created the groups correctly.

    However I wish to disable the activity stream for the groups and when you click on one of the groups above you get directed to the “members” list page for that group instead of home which shows the activity stream.

    Also I notice on the groups page the search is to search for the name of the groups however I wish to change this to search for the members name instead.

    Can this be done? I am not very good with php coding however am confident in inserting code into my child theme. I have a functions.php in my child theme and can create a bp-custom.php in the plugins directory but don’t know the coding.

    Hope someone can help me with the above, I will really appreciate it.

    Thank you,
    Simon Bampfylde

Viewing 2 replies - 1 through 2 (of 2 total)

  • danbp
    Participant

    @danbp

    @sbampfylde,

    in other words, you want to change the landing tab when visiting one of these groups.

    Each group screen as his own search filter. So if you are on the group forum screen, you see the forum activity filter. When you are on the group members screen, you see the group members search filter. And so on…

    So no matter about filtering, if you bring the visitors to the right screen as soon as they arrive on the group, they get the correct filter.

    FYI function is theme dependant and bp-custom is completely independant from bp updates and will work even if you change your theme.
    Here’s the code you can use (in functions.php or bp-custom.php)

    function bpfr_custom_group_default_tab($default_tab){
    	/**
    	 * class_exists() is recommanded to avoid problems during updates 
    	 * or when Groups Component is deactivated
    	 */
    	if ( class_exists( 'BP_Group_Extension' ) ) : // 
    	
    	$group=groups_get_current_group();//get the current group
    	
    	if(empty($group))
    	return $default_tab;
    	
    	switch($group->slug){
    		
    		case 'Public Events': // group name (slug format)
    		$default_tab='members';
    		break;
    		
    		case 'Private Investigations':
    		$default_tab='members';
    		break;
    		
    		case 'another group':
    		$default_tab='admin';
    		break;
    		
    		default:		
    		$default_tab='home';// the original default landing tab
    		break;
    		
    	}
    	
    	return $default_tab;
    	
    	endif; // end if ( class_exists( 'BP_Group_Extension' ) )
    }
    add_filter('bp_groups_default_extension','bpfr_custom_group_default_tab');

    Add or remove the “case” part into the switch to your needs. Don’t forget to modify the groups name to yours.


    Simon Bame
    Participant

    @sbampfylde

    Thank you @dandp,
    I managed to get that working now, thank you so much for your help and it is really appreciated.

    I just had one more enquiry.

    The search thing I was asking about was when you enter the groups page so you have a list of the groups in my case the Public Events and Private Investigations there is a search box, if I type the name of the company it says there were no groups found, is there a way to get this to search inside the groups for the name of the company instead.

    Thank you
    Simon Bampfylde

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Resolved] Disable Groups Activity Stream, direct to members page instead’ is closed to new replies.
Skip to toolbar