Index: bp-blogs/bp-blogs-templatetags.php
===================================================================
--- bp-blogs/bp-blogs-templatetags.php	(revision 2578)
+++ bp-blogs/bp-blogs-templatetags.php	(working copy)
@@ -116,44 +116,34 @@
 	 */
 	$type = 'active';
 	$user_id = false;
-	$page = 1;
+	$search_terms = false;

 	/* User filtering */
-	if ( !empty( $bp->displayed_user->id ) || 'personal' == $_COOKIE['bp-blogs-scope'] )
-		$user_id = ( !empty( $bp->displayed_user->id ) ) ? $bp->displayed_user->id : $bp->loggedin_user->id;
+	if ( !empty( $bp->displayed_user->id ) )
+		$user_id = $bp->displayed_user->id;

-	/* Action filtering */
-	if ( !empty( $_COOKIE['bp-blogs-filter'] ) && '-1' != $_COOKIE['bp-blogs-filter'] )
-		$type = $_COOKIE['bp-blogs-filter'];
+	if ( !empty( $_REQUEST['s'] ) )
+		$search_terms = $_REQUEST['s'];

-	if ( !empty( $_COOKIE['bp-blogs-page'] ) && '-1' != $_COOKIE['bp-blogs-page'] )
-		$page = $_COOKIE['bp-blogs-page'];
-
 	$defaults = array(
 		'type' => $type,
-		'page' => $page,
+		'page' => 1,
 		'per_page' => 20,
 		'max' => false,

 		'user_id' => $user_id, // Pass a user_id to limit to only blogs this user has higher than subscriber access to
-		'search_terms' => false // Pass search terms to filter on the blog title or description.
+		'search_terms' => $search_terms // Pass search terms to filter on the blog title or description.
 	);

 	$r = wp_parse_args( $args, $defaults );
 	extract( $r );

-	// type: active ( default ) | random | newest | alphabetical
-
-	if ( !empty( $_REQUEST['s'] ) )
-		$search_terms = $_REQUEST['s'];
-
 	if ( $max ) {
 		if ( $per_page > $max )
 			$per_page = $max;
 	}

 	$blogs_template = new BP_Blogs_Template( $type, $page, $per_page, $max, $user_id, $search_terms );
-
 	return $blogs_template->has_blogs();
 }

Index: bp-themes/bp-default/groups/groups-loop.php
===================================================================
--- bp-themes/bp-default/groups/groups-loop.php	(revision 2578)
+++ bp-themes/bp-default/groups/groups-loop.php	(working copy)
@@ -2,7 +2,7 @@

 <?php do_action( 'bp_before_groups_loop' ) ?>

-<?php if ( bp_has_groups( bp_ajax_querystring() ) ) : ?>
+<?php if ( bp_has_groups( bp_dtheme_ajax_querystring( 'groups' ) ) ) : ?>

 	<div class="pagination">

Index: bp-themes/bp-default/members/members-loop.php
===================================================================
--- bp-themes/bp-default/members/members-loop.php	(revision 2578)
+++ bp-themes/bp-default/members/members-loop.php	(working copy)
@@ -2,7 +2,7 @@

 <?php do_action( 'bp_before_members_loop' ) ?>

-<?php if ( bp_has_members( bp_ajax_querystring() ) ) : ?>
+<?php if ( bp_has_members( bp_dtheme_ajax_querystring( 'members' ) ) ) : ?>

 	<div class="pagination">

Index: bp-themes/bp-default/activity/activity-loop.php
===================================================================
--- bp-themes/bp-default/activity/activity-loop.php	(revision 2578)
+++ bp-themes/bp-default/activity/activity-loop.php	(working copy)
@@ -2,7 +2,7 @@

 <?php do_action( 'bp_before_activity_loop' ) ?>

-<?php if ( bp_has_activities( bp_ajax_querystring() ) ) : ?>
+<?php if ( bp_has_activities( bp_dtheme_ajax_querystring( 'activity' ) ) ) : ?>

 	<?php /* Show pagination if JS is not enabled, since the "Load More" link will do nothing */ ?>
 	<noscript>
Index: bp-themes/bp-default/blogs/blogs-loop.php
===================================================================
--- bp-themes/bp-default/blogs/blogs-loop.php	(revision 2578)
+++ bp-themes/bp-default/blogs/blogs-loop.php	(working copy)
@@ -2,7 +2,7 @@

 <?php do_action( 'bp_before_blogs_loop' ) ?>

-<?php if ( bp_has_blogs( bp_ajax_querystring() ) ) : ?>
+<?php if ( bp_has_blogs( bp_dtheme_ajax_querystring( 'blogs' ) ) ) : ?>

 	<div class="pagination">

Index: bp-themes/bp-default/_inc/ajax.php
===================================================================
--- bp-themes/bp-default/_inc/ajax.php	(revision 2578)
+++ bp-themes/bp-default/_inc/ajax.php	(working copy)
@@ -9,48 +9,74 @@
  * your own _inc/ajax.php file and add/remove AJAX functionality as you see fit.
  */

-function bp_dtheme_object_filter() {
+/***
+ * Each object loop (activity/members/groups/blogs/forums) contains parameters to
+ * show specific information based on the page we are currently looking at.
+ * The following function will take into account any cookies set in the JS and allow us
+ * to override the parameters sent. That way we can change the results returned without reloading the page.
+ */
+function bp_dtheme_ajax_querystring( $object = false ) {
 	global $bp;

-	$object = esc_attr( $_POST['object'] );
-	$filter = esc_attr( $_POST['filter'] );
-	$page = esc_attr( $_POST['page'] );
-	$search_terms = esc_attr( $_POST['search_terms'] );
+	if ( empty( $object ) )
+		return false;

-	/**
-	 * Scope is the scope of results to use, either all (everything) or personal (just mine).
-	 * For example if the object is groups, it would be all groups, or just groups I belong to.
+	/* Set up the cookies passed on this AJAX request. */
+	if ( !empty( $_POST['cookie'] ) )
+		$_COOKIE = wp_parse_args( str_replace( '; ', '&', urldecode( $_POST['cookie'] ) ) );
+
+	$qs = false;
+
+	/***
+	 * Check if any cookie values are set. If there are then override the default params passed to the
+	 * template loop
 	 */
-	$scope = esc_attr( $_POST['scope'] );
+	if ( !empty( $_COOKIE['bp-' . $object . '-filter'] ) && '-1' != $_COOKIE['bp-' . $object . '-filter'] ) {
+		$qs[] = 'type=' . $_COOKIE['bp-' . $object . '-filter'];
+		$qs[] = 'action=' . $_COOKIE['bp-' . $object . '-filter']; // Activity stream filtering on action
+	}

-	/* Plugins can pass extra parameters and use the bp_dtheme_ajax_querystring_content_filter filter to parse them */
-	$extras = esc_attr( $_POST['extras'] );
+	if ( !empty( $_COOKIE['bp-' . $object . '-scope'] ) ) {
+		if ( 'personal' == $_COOKIE['bp-' . $object . '-scope'] ) {
+			$user_id = ( $bp->displayed_user->id ) ? $bp->displayed_user->id : $bp->loggedin_user->id;
+			$qs[] = 'user_id=' . $user_id;
+		}
+		$qs[] = 'scope=' . $_COOKIE['bp-' . $object . '-scope']; // Activity stream scope
+	}

-	if ( __( 'Search anything...', 'buddypress' ) == $search_terms || 'false' == $search_terms )
-		$search_terms = false;
+	if ( !empty( $_COOKIE['bp-' . $object . '-page'] ) && '-1' != $_COOKIE['bp-' . $object . '-page'] )
+		$qs[] = 'page=' . $_COOKIE['bp-' . $object . '-page'];

-	/* Build the querystring */
-	if ( empty( $filter ) )
-		$filter = 'active';
+	if ( !empty( $_COOKIE['bp-' . $object . '-search-terms'] ) && __( 'Search anything...', 'buddypress' ) != $_COOKIE['bp-' . $object . '-search-terms'] && 'false' != $_COOKIE['bp-' . $object . '-search-terms'] )
+		$qs[] = 'search_terms=' . $_COOKIE['bp-' . $object . '-search-terms'];

-	$bp->ajax_querystring = 'type=' . $filter . '&page=' . $page;
+	/* Now pass the querystring to override default values. */
+	if ( !empty( $qs ) )
+		return apply_filters( 'bp_dtheme_ajax_querystring', join( '&', (array)$qs ), $object, $_COOKIE['bp-' . $object . '-filter'], $_COOKIE['bp-' . $object . '-scope'], $_COOKIE['bp-' . $object . '-page'], $_COOKIE['bp-' . $object . '-search-terms'], $_COOKIE['bp-' . $object . '-extras'] );
+}

-	if ( !empty( $search_terms ) )
-		$bp->ajax_querystring .= '&search_terms=' . $search_terms;
+function bp_dtheme_object_template_loader() {
+	$object = esc_attr( $_POST['object'] );
+	locate_template( array( "$object/$object-loop.php" ), true );
+}
+add_action( 'wp_ajax_members_filter', 'bp_dtheme_object_template_loader' );
+add_action( 'wp_ajax_groups_filter', 'bp_dtheme_object_template_loader' );
+add_action( 'wp_ajax_blogs_filter', 'bp_dtheme_object_template_loader' );
+add_action( 'wp_ajax_forums_filter', 'bp_dtheme_object_template_loader' );

-	if ( $scope == 'personal' || $bp->displayed_user->id ) {
-		$user_id = ( $bp->displayed_user->id ) ? $bp->displayed_user->id : $bp->loggedin_user->id;
-		$bp->ajax_querystring .= '&user_id=' . $user_id;
-	}
+function bp_dtheme_activity_template_loader() {
+	global $bp;

-	$bp->ajax_querystring = apply_filters( 'bp_dtheme_ajax_querystring_content_filter', $bp->ajax_querystring, $extras );
+	/* Buffer the loop in the template to a var for JS to spit out. */
+	ob_start();
+	locate_template( array( 'activity/activity-loop.php' ), true );
+	$result['contents'] = ob_get_contents();
+	ob_end_clean();

-	locate_template( array( "$object/$object-loop.php" ), true );
+	echo json_encode( $result );
 }
-add_action( 'wp_ajax_members_filter', 'bp_dtheme_object_filter' );
-add_action( 'wp_ajax_groups_filter', 'bp_dtheme_object_filter' );
-add_action( 'wp_ajax_blogs_filter', 'bp_dtheme_object_filter' );
-add_action( 'wp_ajax_forums_filter', 'bp_dtheme_object_filter' );
+add_action( 'wp_ajax_activity_widget_filter', 'bp_dtheme_activity_template_loader' );
+add_action( 'wp_ajax_activity_get_older_updates', 'bp_dtheme_activity_template_loader' );

 function bp_dtheme_post_update() {
 	global $bp;
@@ -177,103 +203,6 @@
 add_action( 'wp_ajax_delete_activity_comment', 'bp_dtheme_delete_activity' );
 add_action( 'wp_ajax_delete_activity', 'bp_dtheme_delete_activity' );

-function bp_dtheme_activity_loop( $scope = false, $filter = false, $per_page = 20, $page = 1 ) {
-	global $bp;
-
-	/* If we are on a profile page we only want to show that users activity */
-	if ( $bp->displayed_user->id ) {
-		$query_string = 'user_id=' . $bp->displayed_user->id;
-	} else {
-		if ( !empty( $bp->groups->current_group ) )
-			$scope = 'all';
-
-		$feed_url = site_url( BP_ACTIVITY_SLUG . '/feed/' );
-
-		switch ( $scope ) {
-			case BP_FRIENDS_SLUG:
-				$friend_ids = implode( ',', friends_get_friend_user_ids( $bp->loggedin_user->id ) );
-				$query_string = 'user_id=' . $friend_ids;
-				$feed_url = $bp->loggedin_user->domain . BP_ACTIVITY_SLUG . '/' . BP_FRIENDS_SLUG . '/feed/';
-				break;
-			case BP_GROUPS_SLUG:
-				$groups = groups_get_user_groups( $bp->loggedin_user->id );
-				$group_ids = implode( ',', $groups['groups'] );
-				$query_string = 'object=groups&primary_id=' . $group_ids . '&show_hidden=1';
-				$feed_url = $bp->loggedin_user->domain . BP_ACTIVITY_SLUG . '/' . BP_GROUPS_SLUG . '/feed/';
-				break;
-			case 'favorites':
-				$favs = bp_activity_get_user_favorites( $bp->loggedin_user->id );
-
-				if ( empty( $favs ) )
-					$favorite_ids = false;
-
-				$favorite_ids = implode( ',', (array)$favs );
-				$query_string = 'include=' . $favorite_ids;
-				$feed_url = $bp->loggedin_user->domain  . BP_ACTIVITY_SLUG . '/favorites/feed/';
-				break;
-			case 'mentions':
-				$query_string = 'show_hidden=1&search_terms=@' . bp_core_get_username( $bp->loggedin_user->id, $bp->loggedin_user->userdata->user_nicename, $bp->loggedin_user->userdata->user_login );
-				$feed_url = $bp->loggedin_user->domain . BP_ACTIVITY_SLUG . '/mentions/feed/';
-
-				/* Reset the number of new @ mentions for the user */
-				delete_usermeta( $bp->loggedin_user->id, 'bp_new_mention_count' );
-				break;
-		}
-	}
-
-	/* Build the filter */
-	if ( $filter && $filter != '-1' )
-		$query_string .= '&action=' . $filter;
-
-	/* If we are viewing a group then filter the activity just for this group */
-	if ( !empty( $bp->groups->current_group ) ) {
-		$query_string .= '&object=' . $bp->groups->id . '&primary_id=' . $bp->groups->current_group->id;
-
-		/* If we're viewing a non-private group and the user is a member, show the hidden activity for the group */
-		if ( 'public' != $bp->groups->current_group->status && groups_is_user_member( $bp->loggedin_user->id, $bp->groups->current_group->id ) )
-			$query_string .= '&show_hidden=1';
-	}
-
-	/* Add the per_page param */
-	$query_string .= '&per_page=' . $per_page;
-
-	/* Add the comments param */
-	if ( $bp->displayed_user->id || 'mentions' == $scope )
-		$query_string .= '&display_comments=stream';
-	else
-		$query_string .= '&display_comments=threaded';
-
-	/* Add the new page param */
-	$args = explode( '&', trim( $query_string ) );
-	foreach( (array)$args as $arg ) {
-		if ( false === strpos( $arg, 'page' ) )
-			$new_args[] = $arg;
-	}
-	$query_string = implode( '&', $new_args ) . '&page=' . $page;
-
-	$bp->ajax_querystring = apply_filters( 'bp_dtheme_ajax_querystring_activity_filter', $query_string, $scope );
-	$result['query_string'] = $bp->ajax_querystring;
-	$result['feed_url'] = apply_filters( 'bp_dtheme_ajax_feed_url', $feed_url );
-
-	/* Buffer the loop in the template to a var for JS to spit out. */
-	ob_start();
-	locate_template( array( 'activity/activity-loop.php' ), true );
-	$result['contents'] = ob_get_contents();
-	ob_end_clean();
-
-	echo json_encode( $result );
-}
-
-function bp_dtheme_ajax_widget_filter() {
-	bp_dtheme_activity_loop( $_POST['scope'], $_POST['filter'] );
-}
-add_action( 'wp_ajax_activity_widget_filter', 'bp_dtheme_ajax_widget_filter' );
-
-function bp_dtheme_ajax_load_older_updates() {
-	bp_dtheme_activity_loop( false, false, 20, $_POST['page'] );
-}
-add_action( 'wp_ajax_activity_get_older_updates', 'bp_dtheme_ajax_load_older_updates' );
-
 function bp_dtheme_mark_activity_favorite() {
 	global $bp;

Index: bp-themes/bp-default/_inc/global.js
===================================================================
--- bp-themes/bp-default/_inc/global.js	(revision 2578)
+++ bp-themes/bp-default/_inc/global.js	(working copy)
@@ -2,7 +2,7 @@
 var j = jQuery;

 // Global variable to prevent multiple AJAX requests
-var activity_request = null;
+var bp_ajax_request = null;

 j(document).ready( function() {
 	/**** Page Load Actions *******************************************************/
@@ -111,7 +111,7 @@
 			return false;

 		/* Reset the page */
-		j.cookie( 'bp-activity-oldestpage', 1 );
+		j.cookie( 'bp-activity-oldestpage', 1, {path: '/'} );

 		/* Activity Stream Tabs */
 		var scope = target.attr('id').substr( 9, target.attr('id').length );
@@ -130,7 +130,7 @@
 		var selected_tab = j( 'div.activity-type-tabs li.selected' );

 		if ( !selected_tab.length )
-			var scope = 'all';
+			var scope = null;
 		else
 			var scope = selected_tab.attr('id').substr( 9, selected_tab.attr('id').length );

@@ -231,7 +231,7 @@
 			j("li.load-more").addClass('loading');

 			if ( null == j.cookie('bp-activity-oldestpage') )
-				j.cookie('bp-activity-oldestpage', 1 );
+				j.cookie('bp-activity-oldestpage', 1, {path: '/'} );

 			var oldest_page = ( j.cookie('bp-activity-oldestpage') * 1 ) + 1;

@@ -243,7 +243,7 @@
 			function(response)
 			{
 				j("li.load-more").removeClass('loading');
-				j.cookie( 'bp-activity-oldestpage', oldest_page );
+				j.cookie( 'bp-activity-oldestpage', oldest_page, {path: '/'} );
 				j("ul.activity-list").append(response.contents);

 				target.parent().hide();
@@ -1031,7 +1031,7 @@
 /* Setup activity scope and filter based on the current cookie settings. */
 function bp_init_activity() {
 	/* Reset the page */
-	j.cookie( 'bp-activity-oldestpage', 1 );
+	j.cookie( 'bp-activity-oldestpage', 1, {path: '/'} );

 	if ( null != j.cookie('bp-activity-filter') && j('#activity-filter-select').length )
 		j('#activity-filter-select select option[value=' + j.cookie('bp-activity-filter') + ']').attr( 'selected', 'selected' );
@@ -1070,21 +1070,6 @@
 	if ( 'activity' == object )
 		return false;

-	if ( null == scope )
-		var scope = 'all';
-
-	if ( null == filter )
-		var filter = 'active';
-
-	if ( null == page )
-		var page = 1;
-
-	if ( null == search_terms )
-		var search_terms = false;
-
-	if ( null == extras )
-		var extras = false;
-
 	if ( j.query.get('s') )
 		search_terms = j.query.get('s');

@@ -1096,10 +1081,12 @@
 	j.cookie( 'bp-' + object + '-extras', extras, null );

 	/* Set the correct selected nav and filter */
-	j('div.item-list-tabs li').each( function() {
-		j(this).removeClass('selected');
-	});
-	j('div.item-list-tabs li#' + object + '-' + scope + ', div.item-list-tabs#object-nav li.current').addClass('selected');
+	if ( null != scope ) {
+		j('div.item-list-tabs li').each( function() {
+			j(this).removeClass('selected');
+		});
+		j('div.item-list-tabs li#' + object + '-' + scope + ', div.item-list-tabs#object-nav li.current').addClass('selected');
+	}
 	j('div.item-list-tabs li.selected').addClass('loading');
 	j('div.item-list-tabs select option[value=' + filter + ']').attr( 'selected', 'selected' );

@@ -1128,34 +1115,29 @@

 /* Activity Loop Requesting */
 function bp_activity_request(scope, filter) {
-	if ( null == scope )
-		var scope = 'all';
-
-	if ( null == filter )
-		var filter = '-1';
-
 	/* Save the type and filter to a session cookie */
-	j.cookie( 'bp-activity-scope', scope, null );
-	j.cookie( 'bp-activity-filter', filter, null );
-	j.cookie( 'bp-activity-oldestpage', 1 );
+	j.cookie( 'bp-activity-scope', scope );
+	j.cookie( 'bp-activity-filter', filter );
+	j.cookie( 'bp-activity-oldestpage', 1, {path: '/'} );

 	/* Remove selected and loading classes from tabs */
-	j('div.item-list-tabs li').each( function() {
-		j(this).removeClass('selected loading');
-	});
-
-	/* Set the correct selected nav and filter */
-	j('li#activity-' + scope + ', div.item-list-tabs li.current').addClass('selected');
+	if ( null != scope ) {
+		j('div.item-list-tabs li').each( function() {
+			j(this).removeClass('selected loading');
+		});
+		/* Set the correct selected nav and filter */
+		j('li#activity-' + scope + ', div.item-list-tabs li.current').addClass('selected');
+	}
 	j('div#object-nav.item-list-tabs li.selected, div.activity-type-tabs li.selected').addClass('loading');
 	j('#activity-filter-select select option[value=' + filter + ']').attr( 'selected', 'selected' );

 	/* Reload the activity stream based on the selection */
 	j('.widget_bp_activity_widget h2 span.ajax-loader').show();

-	if ( activity_request )
-		activity_request.abort();
+	if ( bp_ajax_request )
+		bp_ajax_request.abort();

-	activity_request = j.post( ajaxurl, {
+	bp_ajax_request = j.post( ajaxurl, {
 		action: 'activity_widget_filter',
 		'cookie': encodeURIComponent(document.cookie),
 		'_wpnonce_activity_filter': j("input#_wpnonce_activity_filter").val(),
@@ -1250,7 +1232,7 @@
 jQuery.extend({easing:{easein:function(x,t,b,c,d){return c*(t/=d)*t+b},easeinout:function(x,t,b,c,d){if(t<d/2)return 2*c*t*t/(d*d)+b;var ts=t-d/2;return-2*c*ts*ts/(d*d)+2*c*ts/d+c/2+b},easeout:function(x,t,b,c,d){return-c*t*t/(d*d)+2*c*t/d+b},expoin:function(x,t,b,c,d){var flip=1;if(c<0){flip*=-1;c*=-1}return flip*(Math.exp(Math.log(c)/d*t))+b},expoout:function(x,t,b,c,d){var flip=1;if(c<0){flip*=-1;c*=-1}return flip*(-Math.exp(-Math.log(c)/d*(t-d))+c+1)+b},expoinout:function(x,t,b,c,d){var flip=1;if(c<0){flip*=-1;c*=-1}if(t<d/2)return flip*(Math.exp(Math.log(c/2)/(d/2)*t))+b;return flip*(-Math.exp(-2*Math.log(c/2)/d*(t-d))+c+1)+b},bouncein:function(x,t,b,c,d){return c-jQuery.easing['bounceout'](x,d-t,0,c,d)+b},bounceout:function(x,t,b,c,d){if((t/=d)<(1/2.75)){return c*(7.5625*t*t)+b}else if(t<(2/2.75)){return c*(7.5625*(t-=(1.5/2.75))*t+.75)+b}else if(t<(2.5/2.75)){return c*(7.5625*(t-=(2.25/2.75))*t+.9375)+b}else{return c*(7.5625*(t-=(2.625/2.75))*t+.984375)+b}},bounceinout:function(x,t,b,c,d){if(t<d/2)return jQuery.easing['bouncein'](x,t*2,0,c,d)*.5+b;return jQuery.easing['bounceout'](x,t*2-d,0,c,d)*.5+c*.5+b},elasin:function(x,t,b,c,d){var s=1.70158;var p=0;var a=c;if(t==0)return b;if((t/=d)==1)return b+c;if(!p)p=d*.3;if(a<Math.abs(c)){a=c;var s=p/4}else var s=p/(2*Math.PI)*Math.asin(c/a);return-(a*Math.pow(2,10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p))+b},elasout:function(x,t,b,c,d){var s=1.70158;var p=0;var a=c;if(t==0)return b;if((t/=d)==1)return b+c;if(!p)p=d*.3;if(a<Math.abs(c)){a=c;var s=p/4}else var s=p/(2*Math.PI)*Math.asin(c/a);return a*Math.pow(2,-10*t)*Math.sin((t*d-s)*(2*Math.PI)/p)+c+b},elasinout:function(x,t,b,c,d){var s=1.70158;var p=0;var a=c;if(t==0)return b;if((t/=d/2)==2)return b+c;if(!p)p=d*(.3*1.5);if(a<Math.abs(c)){a=c;var s=p/4}else var s=p/(2*Math.PI)*Math.asin(c/a);if(t<1)return-.5*(a*Math.pow(2,10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p))+b;return a*Math.pow(2,-10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p)*.5+c+b},backin:function(x,t,b,c,d){var s=1.70158;return c*(t/=d)*t*((s+1)*t-s)+b},backout:function(x,t,b,c,d){var s=1.70158;return c*((t=t/d-1)*t*((s+1)*t+s)+1)+b},backinout:function(x,t,b,c,d){var s=1.70158;if((t/=d/2)<1)return c/2*(t*t*(((s*=(1.525))+1)*t-s))+b;return c/2*((t-=2)*t*(((s*=(1.525))+1)*t+s)+2)+b},linear:function(x,t,b,c,d){return c*t/d+b}}});

 /* jQuery Cookie plugin */
-eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('o.5=B(9,b,2){6(h b!=\'E\'){2=2||{};6(b===n){b=\'\';2.3=-1}4 3=\'\';6(2.3&&(h 2.3==\'j\'||2.3.k)){4 7;6(h 2.3==\'j\'){7=w u();7.t(7.q()+(2.3*r*l*l*x))}m{7=2.3}3=\'; 3=\'+7.k()}4 8=2.8?\'; 8=\'+(2.8):\'\';4 a=2.a?\'; a=\'+(2.a):\'\';4 c=2.c?\'; c\':\'\';d.5=[9,\'=\',C(b),3,8,a,c].y(\'\')}m{4 e=n;6(d.5&&d.5!=\'\'){4 g=d.5.A(\';\');s(4 i=0;i<g.f;i++){4 5=o.z(g[i]);6(5.p(0,9.f+1)==(9+\'=\')){e=D(5.p(9.f+1));v}}}F e}};',42,42,'||options|expires|var|cookie|if|date|path|name|domain|value|secure|document|cookieValue|length|cookies|typeof||number|toUTCString|60|else|null|jQuery|substring|getTime|24|for|setTime|Date|break|new|1000|join|trim|split|function|encodeURIComponent|decodeURIComponent|undefined|return'.split('|'),0,{}))
+jQuery.cookie=function(name,value,options){if(typeof value!='undefined'){options=options||{};if(value===null){value='';options.expires=-1;}var expires='';if(options.expires&&(typeof options.expires=='number'||options.expires.toUTCString)){var date;if(typeof options.expires=='number'){date=new Date();date.setTime(date.getTime()+(options.expires*24*60*60*1000));}else{date=options.expires;}expires='; expires='+date.toUTCString();}var path=options.path?'; path='+(options.path):'';var domain=options.domain?'; domain='+(options.domain):'';var secure=options.secure?'; secure':'';document.cookie=[name,'=',encodeURIComponent(value),expires,path,domain,secure].join('');}else{var cookieValue=null;if(document.cookie&&document.cookie!=''){var cookies=document.cookie.split(';');for(var i=0;i<cookies.length;i++){var cookie=jQuery.trim(cookies[i]);if(cookie.substring(0,name.length+1)==(name+'=')){cookieValue=decodeURIComponent(cookie.substring(name.length+1));break;}}}return cookieValue;}};

 /* jQuery querystring plugin */
 eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('M 6(A){4 $11=A.11||\'&\';4 $V=A.V===r?r:j;4 $1p=A.1p===r?\'\':\'[]\';4 $13=A.13===r?r:j;4 $D=$13?A.D===j?"#":"?":"";4 $15=A.15===r?r:j;v.1o=M 6(){4 f=6(o,t){8 o!=1v&&o!==x&&(!!t?o.1t==t:j)};4 14=6(1m){4 m,1l=/\\[([^[]*)\\]/g,T=/^([^[]+)(\\[.*\\])?$/.1r(1m),k=T[1],e=[];19(m=1l.1r(T[2]))e.u(m[1]);8[k,e]};4 w=6(3,e,7){4 o,y=e.1b();b(I 3!=\'X\')3=x;b(y===""){b(!3)3=[];b(f(3,L)){3.u(e.h==0?7:w(x,e.z(0),7))}n b(f(3,1a)){4 i=0;19(3[i++]!=x);3[--i]=e.h==0?7:w(3[i],e.z(0),7)}n{3=[];3.u(e.h==0?7:w(x,e.z(0),7))}}n b(y&&y.T(/^\\s*[0-9]+\\s*$/)){4 H=1c(y,10);b(!3)3=[];3[H]=e.h==0?7:w(3[H],e.z(0),7)}n b(y){4 H=y.B(/^\\s*|\\s*$/g,"");b(!3)3={};b(f(3,L)){4 18={};1w(4 i=0;i<3.h;++i){18[i]=3[i]}3=18}3[H]=e.h==0?7:w(3[H],e.z(0),7)}n{8 7}8 3};4 C=6(a){4 p=d;p.l={};b(a.C){v.J(a.Z(),6(5,c){p.O(5,c)})}n{v.J(1u,6(){4 q=""+d;q=q.B(/^[?#]/,\'\');q=q.B(/[;&]$/,\'\');b($V)q=q.B(/[+]/g,\' \');v.J(q.Y(/[&;]/),6(){4 5=1e(d.Y(\'=\')[0]||"");4 c=1e(d.Y(\'=\')[1]||"");b(!5)8;b($15){b(/^[+-]?[0-9]+\\.[0-9]*$/.1d(c))c=1A(c);n b(/^[+-]?[0-9]+$/.1d(c))c=1c(c,10)}c=(!c&&c!==0)?j:c;b(c!==r&&c!==j&&I c!=\'1g\')c=c;p.O(5,c)})})}8 p};C.1H={C:j,1G:6(5,1f){4 7=d.Z(5);8 f(7,1f)},1h:6(5){b(!f(5))8 d.l;4 K=14(5),k=K[0],e=K[1];4 3=d.l[k];19(3!=x&&e.h!=0){3=3[e.1b()]}8 I 3==\'1g\'?3:3||""},Z:6(5){4 3=d.1h(5);b(f(3,1a))8 v.1E(j,{},3);n b(f(3,L))8 3.z(0);8 3},O:6(5,c){4 7=!f(c)?x:c;4 K=14(5),k=K[0],e=K[1];4 3=d.l[k];d.l[k]=w(3,e.z(0),7);8 d},w:6(5,c){8 d.N().O(5,c)},1s:6(5){8 d.O(5,x).17()},1z:6(5){8 d.N().1s(5)},1j:6(){4 p=d;v.J(p.l,6(5,7){1y p.l[5]});8 p},1F:6(Q){4 D=Q.B(/^.*?[#](.+?)(?:\\?.+)?$/,"$1");4 S=Q.B(/^.*?[?](.+?)(?:#.+)?$/,"$1");8 M C(Q.h==S.h?\'\':S,Q.h==D.h?\'\':D)},1x:6(){8 d.N().1j()},N:6(){8 M C(d)},17:6(){6 F(G){4 R=I G=="X"?f(G,L)?[]:{}:G;b(I G==\'X\'){6 1k(o,5,7){b(f(o,L))o.u(7);n o[5]=7}v.J(G,6(5,7){b(!f(7))8 j;1k(R,5,F(7))})}8 R}d.l=F(d.l);8 d},1B:6(){8 d.N().17()},1D:6(){4 i=0,U=[],W=[],p=d;4 16=6(E){E=E+"";b($V)E=E.B(/ /g,"+");8 1C(E)};4 1n=6(1i,5,7){b(!f(7)||7===r)8;4 o=[16(5)];b(7!==j){o.u("=");o.u(16(7))}1i.u(o.P(""))};4 F=6(R,k){4 12=6(5){8!k||k==""?[5].P(""):[k,"[",5,"]"].P("")};v.J(R,6(5,7){b(I 7==\'X\')F(7,12(5));n 1n(W,12(5),7)})};F(d.l);b(W.h>0)U.u($D);U.u(W.P($11));8 U.P("")}};8 M C(1q.S,1q.D)}}(v.1o||{});',62,106,'|||target|var|key|function|value|return|||if|val|this|tokens|is||length||true|base|keys||else||self||false|||push|jQuery|set|null|token|slice|settings|replace|queryObject|hash|str|build|orig|index|typeof|each|parsed|Array|new|copy|SET|join|url|obj|search|match|queryString|spaces|chunks|object|split|get||separator|newKey|prefix|parse|numbers|encode|COMPACT|temp|while|Object|shift|parseInt|test|decodeURIComponent|type|number|GET|arr|EMPTY|add|rx|path|addFields|query|suffix|location|exec|REMOVE|constructor|arguments|undefined|for|empty|delete|remove|parseFloat|compact|encodeURIComponent|toString|extend|load|has|prototype'.split('|'),0,{}))
Index: bp-themes/bp-default/forums/forums-loop.php
===================================================================
--- bp-themes/bp-default/forums/forums-loop.php	(revision 2578)
+++ bp-themes/bp-default/forums/forums-loop.php	(working copy)
@@ -1,4 +1,4 @@
-<?php if ( bp_has_forum_topics( bp_ajax_querystring() ) ) : ?>
+<?php if ( bp_has_forum_topics( bp_dtheme_ajax_querystring( 'forums' ) ) ) : ?>

 	<div class="pagination">

Index: bp-core/bp-core-templatetags.php
===================================================================
--- bp-core/bp-core-templatetags.php	(revision 2578)
+++ bp-core/bp-core-templatetags.php	(working copy)
@@ -125,18 +125,16 @@
 	$type = 'active';
 	$user_id = false;
 	$page = 1;
+	$search_terms = false;

 	/* User filtering */
-	if ( !empty( $bp->displayed_user->id ) || 'personal' == $_COOKIE['bp-members-scope'] )
-		$user_id = ( !empty( $bp->displayed_user->id ) ) ? $bp->displayed_user->id : $bp->loggedin_user->id;
+	if ( !empty( $bp->displayed_user->id ) )
+		$user_id = $bp->displayed_user->id;

-	/* Action filtering */
-	if ( !empty( $_COOKIE['bp-members-filter'] ) && '-1' != $_COOKIE['bp-members-filter'] )
-		$type = $_COOKIE['bp-members-filter'];
+	/* Pass a filter if ?s= is set. */
+	if ( $_REQUEST['s'] )
+		$search_terms = $_REQUEST['s'];

-	if ( !empty( $_COOKIE['bp-members-page'] ) && '-1' != $_COOKIE['bp-members-page'] )
-		$page = $_COOKIE['bp-members-page'];
-
 	// type: active ( default ) | random | newest | popular | online | alphabetical
 	$defaults = array(
 		'type' => $type,
@@ -147,7 +145,7 @@
 		'include' => false, // Pass a user_id or comma separated list of user_ids to only show these users

 		'user_id' => $user_id, // Pass a user_id to only show friends of this user
-		'search_terms' => false, // Pass search_terms to filter users by their profile data
+		'search_terms' => $search_terms, // Pass search_terms to filter users by their profile data

 		'populate_extras' => true // Fetch usermeta? Friend count, last active etc.
 	);
@@ -160,13 +158,6 @@
 			$per_page = $max;
 	}

-	/* Pass a filter if ?s= is set. */
-	if ( $_REQUEST['s'] )
-		$search_terms = $_REQUEST['s'];
-
-	if ( false === $user_id && $bp->displayed_user->id )
-		$user_id = $bp->displayed_user->id;
-
 	$members_template = new BP_Core_Members_Template( $type, $page, $per_page, $max, $user_id, $search_terms, $include, (bool)$populate_extras );

 	return $members_template->has_members();
@@ -1392,13 +1383,6 @@
 		return $bp->root_domain;
 	}

-/* This function will pass a AJAX built querystring to a loop in the template */
-function bp_ajax_querystring() {
-	global $bp;
-
-	return apply_filters( 'bp_ajax_querystring', $bp->ajax_querystring );
-}
-
 /* Template is_() functions to determine the current page */

 function bp_is_active( $component ) {
Index: bp-activity/bp-activity-templatetags.php
===================================================================
--- bp-activity/bp-activity-templatetags.php	(revision 2578)
+++ bp-activity/bp-activity-templatetags.php	(working copy)
@@ -124,58 +124,13 @@
 	$user_id = false;
 	$include = false;
 	$show_hidden = false;
-	$search_terms = false;
 	$object = false;
-	$action = false;
 	$primary_id = false;
-	$display_comments = 'threaded';

 	/* User filtering */
 	if ( !empty( $bp->displayed_user->id ) )
 		$user_id = $bp->displayed_user->id;

-	/* Action filtering */
-	if ( !empty( $_COOKIE['bp-activity-filter'] ) && '-1' != $_COOKIE['bp-activity-filter'] )
-		$action = $_COOKIE['bp-activity-filter'];
-
-	/* User activity scope filtering */
-	if ( !empty( $user_id ) || !empty( $_COOKIE['bp-activity-scope'] ) ) {
-		$scope = ( !empty( $bp->current_action ) ) ? $bp->current_action : $_COOKIE['bp-activity-scope'];
-		$current_user_id = ( !empty( $bp->displayed_user->id ) ) ? $bp->displayed_user->id : $bp->loggedin_user->id;
-
-		if ( empty( $scope ) || 'just-me' == $scope )
-			$display_comments = 'stream';
-
-		switch ( $scope ) {
-			case 'friends':
-				if ( function_exists( 'friends_get_friend_user_ids' ) )
-					$user_id = implode( ',', (array)friends_get_friend_user_ids( $current_user_id ) );
-				break;
-			case 'groups':
-				if ( function_exists( 'groups_get_user_groups' ) ) {
-					$groups = groups_get_user_groups( $current_user_id );
-					$object = $bp->groups->id;
-					$primary_id = implode( ',', (array)$groups['groups'] );
-					$show_hidden = ( $current_user_id == $bp->loggedin_user->id ) ? 1 : 0;
-					$user_id = false;
-				}
-				break;
-			case 'favorites':
-				$favs = bp_activity_get_user_favorites( $current_user_id );
-				$include = implode( ',', (array)$favs );
-				$show_hidden = ( $current_user_id == $bp->loggedin_user->id ) ? 1 : 0;
-				break;
-			case 'mentions':
-				$user_nicename = ( !empty( $bp->displayed_user->id ) ) ? $bp->displayed_user->userdata->user_nicename : $bp->loggedin_user->userdata->user_nicename;
-				$user_login = ( !empty( $bp->displayed_user->id ) ) ? $bp->displayed_user->userdata->user_login : $bp->loggedin_user->userdata->user_login;
-				$search_terms = '@' . bp_core_get_username( $current_user_id, $user_nicename, $user_login );
-				$show_hidden = ( $current_user_id == $bp->loggedin_user->id ) ? 1 : 0;
-				$display_comments = 'stream';
-				$user_id = false;
-				break;
-		}
-	}
-
 	/* Group filtering */
 	if ( !empty( $bp->groups->current_group ) ) {
 		$object = $bp->groups->id;
@@ -191,7 +146,7 @@

 	/* Note: any params used for filtering can be a single value, or multiple values comma separated. */
 	$defaults = array(
-		'display_comments' => $display_comments, // false for none, stream/threaded - show comments in the stream or threaded under items
+		'display_comments' => 'threaded', // false for none, stream/threaded - show comments in the stream or threaded under items
 		'include' => $include, // pass an activity_id or string of ID's comma separated
 		'sort' => 'DESC', // sort DESC or ASC
 		'page' => 1, // which page to load
@@ -199,20 +154,63 @@
 		'max' => false, // max number to return
 		'show_hidden' => $show_hidden, // Show activity items that are hidden site-wide?

+		/* Scope - pre-built activity filters for a user (friends/groups/favorites/mentions) */
+		'scope' => $bp->current_action,
+
 		/* Filtering */
 		'user_id' => $user_id, // user_id to filter on
 		'object' => $object, // object to filter on e.g. groups, profile, status, friends
-		'action' => $action, // action to filter on e.g. activity_update, new_forum_post, profile_updated
+		'action' => false, // action to filter on e.g. activity_update, new_forum_post, profile_updated
 		'primary_id' => $primary_id, // object ID to filter on e.g. a group_id or forum_id or blog_id etc.
 		'secondary_id' => false, // secondary object ID to filter on e.g. a post_id

 		/* Searching */
-		'search_terms' => $search_terms // specify terms to search on
+		'search_terms' => false // specify terms to search on
 	);

 	$r = wp_parse_args( $args, $defaults );
 	extract( $r );

+	/* If you have passed a "scope" then this will override any filters you have passed. */
+	if ( !empty( $scope ) ) {
+		if ( 'just-me' == $scope )
+			$display_comments = 'stream';
+
+		if ( $user_id = ( !empty( $bp->displayed_user->id ) ) ? $bp->displayed_user->id : $bp->loggedin_user->id ) {
+			switch ( $scope ) {
+				case 'friends':
+					if ( function_exists( 'friends_get_friend_user_ids' ) )
+						$user_id = implode( ',', (array)friends_get_friend_user_ids( $user_id ) );
+					break;
+				case 'groups':
+					if ( function_exists( 'groups_get_user_groups' ) ) {
+						$groups = groups_get_user_groups( $user_id );
+						$object = $bp->groups->id;
+						$primary_id = implode( ',', (array)$groups['groups'] );
+						$show_hidden = ( $user_id == $bp->loggedin_user->id ) ? 1 : 0;
+						$user_id = false;
+					}
+					break;
+				case 'favorites':
+					$favs = bp_activity_get_user_favorites( $user_id );
+					if ( empty( $favs ) )
+						return false;
+
+					$include = implode( ',', (array)$favs );
+					$show_hidden = ( $user_id == $bp->loggedin_user->id ) ? 1 : 0;
+					break;
+				case 'mentions':
+					$user_nicename = ( !empty( $bp->displayed_user->id ) ) ? $bp->displayed_user->userdata->user_nicename : $bp->loggedin_user->userdata->user_nicename;
+					$user_login = ( !empty( $bp->displayed_user->id ) ) ? $bp->displayed_user->userdata->user_login : $bp->loggedin_user->userdata->user_login;
+					$search_terms = '@' . bp_core_get_username( $user_id, $user_nicename, $user_login );
+					$show_hidden = ( $user_id == $bp->loggedin_user->id ) ? 1 : 0;
+					$display_comments = 'stream';
+					$user_id = false;
+					break;
+			}
+		}
+	}
+
 	if ( $max ) {
 		if ( $per_page > $max )
 			$per_page = $max;
Index: bp-forums/bp-forums-templatetags.php
===================================================================
--- bp-forums/bp-forums-templatetags.php	(revision 2578)
+++ bp-forums/bp-forums-templatetags.php	(working copy)
@@ -162,33 +162,13 @@
 	 */
 	$type = 'newest';
 	$user_id = false;
-	$page = 1;
+	$forum_id = false;
+	$search_terms = false;

 	/* User filtering */
-	if ( !empty( $bp->displayed_user->id ) || 'personal' == $_COOKIE['bp-forums-scope'] )
-		$user_id = ( !empty( $bp->displayed_user->id ) ) ? $bp->displayed_user->id : $bp->loggedin_user->id;
+	if ( !empty( $bp->displayed_user->id ) )
+		$user_id = $bp->displayed_user->id;

-	/* Action filtering */
-	if ( !empty( $_COOKIE['bp-forums-filter'] ) && '-1' != $_COOKIE['bp-forums-filter'] )
-		$type = $_COOKIE['bp-forums-filter'];
-
-	if ( !empty( $_COOKIE['bp-forums-page'] ) && '-1' != $_COOKIE['bp-forums-page'] )
-		$page = $_COOKIE['bp-forums-page'];
-
-	$defaults = array(
-		'type' => $type,
-		'forum_id' => false,
-		'user_id' => $user_id,
-		'page' => $page,
-		'per_page' => 20,
-		'max' => false,
-		'no_stickies' => false,
-		'search_terms' => false
-	);
-
-	$r = wp_parse_args( $args, $defaults );
-	extract( $r );
-
 	/* If we're in a single group, set this group's forum_id */
 	if ( !$forum_id && $bp->groups->current_group ) {
 		$bp->groups->current_group->forum_id = groups_get_groupmeta( $bp->groups->current_group->id, 'forum_id' );
@@ -210,8 +190,21 @@
 	if ( $bp->is_directory && !empty( $_GET['fs'] ) )
 		$search_terms = $_GET['fs'];

-	$forum_template = new BP_Forums_Template_Forum( $type, $forum_id, $user_id, $page, $per_page, $max, $no_stickies, $search_terms );
+	$defaults = array(
+		'type' => $type,
+		'forum_id' => $forum_id,
+		'user_id' => $user_id,
+		'page' => 1,
+		'per_page' => 20,
+		'max' => false,
+		'no_stickies' => false,
+		'search_terms' => $search_terms
+	);

+	$r = wp_parse_args( $args, $defaults );
+	extract( $r );
+
+	$forum_template = new BP_Forums_Template_Forum( $type, $forum_id, $user_id, $page, $per_page, $max, $no_stickies, $search_terms );
 	return apply_filters( 'bp_has_topics', $forum_template->has_topics(), &$forum_template );
 }
 	/* DEPRECATED use bp_has_forum_topics() */
Index: bp-groups/bp-groups-templatetags.php
===================================================================
--- bp-groups/bp-groups-templatetags.php	(revision 2578)
+++ bp-groups/bp-groups-templatetags.php	(working copy)
@@ -177,63 +177,49 @@
 	 */
 	$type = 'active';
 	$user_id = false;
-	$page = 1;
+	$search_terms = false;
+	$slug = false;

 	/* User filtering */
-	if ( !empty( $bp->displayed_user->id ) || 'personal' == $_COOKIE['bp-groups-scope'] )
-		$user_id = ( !empty( $bp->displayed_user->id ) ) ? $bp->displayed_user->id : $bp->loggedin_user->id;
+	if ( !empty( $bp->displayed_user->id ) )
+		$user_id = $bp->displayed_user->id;

-	/* Action filtering */
-	if ( !empty( $_COOKIE['bp-groups-filter'] ) && '-1' != $_COOKIE['bp-groups-filter'] )
-		$type = $_COOKIE['bp-groups-filter'];
+	/* Type */
+	if ( 'my-groups' == $bp->current_action ) {
+		if ( 'recently-joined' == $order )
+			$type = 'recently-joined';
+		else if ( 'most-popular' == $order )
+			$type = 'popular';
+		else if ( 'admin-of' == $order ) {
+			$type = 'admin-of';
+		} else if ( 'mod-of' == $order ) {
+			$type = 'mod-of';
+		} else if ( 'alphabetically' == $order )
+			$type = 'alphabetical';
+	} else if ( 'invites' == $bp->current_action ) {
+		$type = 'invites';
+	} else if ( $bp->groups->current_group->slug ) {
+		$type = 'single-group';
+		$slug = $bp->groups->current_group->slug;
+	}

-	if ( !empty( $_COOKIE['bp-groups-page'] ) && '-1' != $_COOKIE['bp-groups-page'] )
-		$page = $_COOKIE['bp-groups-page'];
+	if ( isset( $_REQUEST['group-filter-box'] ) || isset( $_REQUEST['s'] ) )
+		$search_terms = ( isset( $_REQUEST['group-filter-box'] ) ) ? $_REQUEST['group-filter-box'] : $_REQUEST['s'];

 	$defaults = array(
 		'type' => $type,
-		'page' => $page,
+		'page' => 1,
 		'per_page' => 20,
 		'max' => false,

 		'user_id' => $user_id, // Pass a user ID to limit to groups this user has joined
-		'slug' => false, // Pass a group slug to only return that group
-		'search_terms' => false // Pass search terms to return only matching groups
+		'slug' => $slug, // Pass a group slug to only return that group
+		'search_terms' => $search_terms // Pass search terms to return only matching groups
 	);

 	$r = wp_parse_args( $args, $defaults );
 	extract( $r );

-	if ( '' == $args ) {
-		/* The following code will auto set parameters based on the page being viewed.
-		 * for example on example.com/members/andy/groups/my-groups/most-popular/
-		 * $type = 'most-popular'
-		 */
-		if ( 'my-groups' == $bp->current_action ) {
-			$order = $bp->action_variables[0];
-			if ( 'recently-joined' == $order )
-				$type = 'recently-joined';
-			else if ( 'most-popular' == $order )
-				$type = 'popular';
-			else if ( 'admin-of' == $order ) {
-				$type = 'admin-of';
-				$user_id = $bp->displayed_user->id;
-			} else if ( 'mod-of' == $order ) {
-				$type = 'mod-of';
-				$user_id = $bp->displayed_user->id;
-			} else if ( 'alphabetically' == $order )
-				$type = 'alphabetical';
-		} else if ( 'invites' == $bp->current_action ) {
-			$type = 'invites';
-		} else if ( $bp->groups->current_group->slug ) {
-			$type = 'single-group';
-			$slug = $bp->groups->current_group->slug;
-		}
-	}
-
-	if ( isset( $_REQUEST['group-filter-box'] ) || isset( $_REQUEST['s'] ) )
-		$search_terms = ( isset( $_REQUEST['group-filter-box'] ) ) ? $_REQUEST['group-filter-box'] : $_REQUEST['s'];
-
 	$groups_template = new BP_Groups_Template( $user_id, $type, $page, $per_page, $max, $slug, $search_terms );
 	return apply_filters( 'bp_has_groups', $groups_template->has_groups(), &$groups_template );
 }
