diff --git a/wp-content/plugins/buddypress/bp-activity/admin/css/admin.css b/wp-content/plugins/buddypress/bp-activity/admin/css/admin.css
new file mode 100644
index 0000000000000000000000000000000000000000..8b5ac3dc2606713df4aafdd2316b6300cfce3fa4
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-activity/admin/css/admin.css
@@ -0,0 +1 @@
+.akismet-status{float:right}.akismet-status a{color:#AAA;font-style:italic}.akismet-history{margin:13px}.akismet-history div{margin-bottom:13px}.akismet-history span{color:#999}#wp-bp-activities-wrap{padding:5px 0}#bp-activities{height:120px}#bp-replyhead{font-size:1em;line-height:1.4em;margin:0}#bp-replysubmit{margin:0;padding:0 0 3px;text-align:center}#bp-replysubmit .error{color:red;line-height:21px;text-align:center;vertical-align:center}#bp-replysubmit img.waiting{float:right;padding:4px 10px 0;vertical-align:top}#bp-activities-form .column-response img{float:left;margin-right:10px;margin-top:1px}.activity-errors{list-style-type:disc;margin-left:2em}#bp_activity_action div.inside,#bp_activity_content div.inside{line-height:0}#bp_activity_action h3,#bp_activity_content h3{cursor:auto}#bp_activity_action td.mceIframeContainer,#bp_activity_content td.mceIframeContainer{background-color:white}#post-body #bp-activities-action_resize,#post-body #bp-activities-content_resize{position:inherit;margin-top:-2px}#bp_activity_link input{width:99%}#bp-activities-primaryid{margin-bottom:1em}
\ No newline at end of file
diff --git a/wp-content/plugins/buddypress/bp-activity/admin/css/admin.dev.css b/wp-content/plugins/buddypress/bp-activity/admin/css/admin.dev.css
new file mode 100644
index 0000000000000000000000000000000000000000..bf770824eeff1dc5f7ee44b6eff46e53c15e723d
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-activity/admin/css/admin.dev.css
@@ -0,0 +1,77 @@
+.akismet-status {
+	float: right;
+}
+.akismet-status a {
+	color: #AAA;
+	font-style: italic;
+}
+.akismet-history {
+	margin: 13px;
+}
+.akismet-history div {
+	margin-bottom: 13px;
+}
+.akismet-history span {
+	color: #999;
+}
+
+#wp-bp-activities-wrap {
+	padding: 5px 0;
+}
+#bp-activities {
+	height: 120px;
+}
+#bp-replyhead {
+	font-size: 1em;
+	line-height: 1.4em;
+	margin: 0;
+}
+#bp-replysubmit {
+	margin: 0;
+	padding: 0 0 3px;
+	text-align: center;
+}
+#bp-replysubmit .error {
+	color: red;
+	line-height: 21px;
+	text-align: center;
+	vertical-align: center;
+}
+#bp-replysubmit img.waiting {
+	float: right;
+	padding: 4px 10px 0;
+	vertical-align: top;
+}
+#bp-activities-form .column-response img {
+	float: left;
+	margin-right: 10px;
+	margin-top: 1px;
+}
+.activity-errors {
+	list-style-type: disc;
+	margin-left: 2em;
+}
+
+#bp_activity_action div.inside,
+#bp_activity_content div.inside {
+	line-height: 0;
+}
+#bp_activity_action h3,
+#bp_activity_content h3 {
+	cursor: auto;
+}
+#bp_activity_action td.mceIframeContainer,
+#bp_activity_content td.mceIframeContainer {
+	background-color: white;
+}
+#post-body #bp-activities-action_resize,
+#post-body #bp-activities-content_resize {
+	position: inherit;
+	margin-top: -2px;
+}
+#bp_activity_link input {
+	width: 99%;
+}
+#bp-activities-primaryid {
+	margin-bottom: 1em;
+}
\ No newline at end of file
diff --git a/wp-content/plugins/buddypress/bp-activity/admin/js/admin.dev.js b/wp-content/plugins/buddypress/bp-activity/admin/js/admin.dev.js
new file mode 100644
index 0000000000000000000000000000000000000000..591d58554c66c5f62998763eabf0ab846caf4192
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-activity/admin/js/admin.dev.js
@@ -0,0 +1,167 @@
+(function( $ ) {
+
+/**
+ * Activity reply object for the activity index screen
+ *
+ * @since 1.6
+ */
+var activityReply = {
+
+	/**
+	 * Attach event handler functions to the relevant elements.
+	 *
+	 * @since 1.6
+	 */
+	init : function() {
+		$(document).on( 'click', '.row-actions a.reply',              activityReply.open );
+		$(document).on( 'click', '#bp-activities-container a.cancel', activityReply.close );
+		$(document).on( 'click', '#bp-activities-container a.save',   activityReply.send );
+
+		// Close textarea on escape
+		$(document).on( 'keyup', '#bp-activities:visible', function( e ) {
+			if ( 27 == e.which ) {
+				activityReply.close();
+			}
+		});
+	},
+
+	/**
+	 * Reveals the entire row when "reply" is pressed.
+	 *
+	 * @since 1.6
+	 */
+	open : function( e ) {
+		// Hide the container row, and move it to the new location
+		var box = $( '#bp-activities-container' ).hide();
+		$( this ).parents( 'tr' ).after( box );
+
+		// Fade the whole row in, and set focus on the text area.
+		box.fadeIn( '300' );
+		$( '#bp-activities' ).focus();
+
+		return false;
+	},
+
+	/**
+	 * Hide and reset the entire row when "cancel", or escape, are pressed.
+	 *
+	 * @since 1.6
+	 */
+	close : function( e ) {
+		// Hide the container row
+		$('#bp-activities-container').fadeOut( '200', function () { 
+
+			// Empty and unfocus the text area
+			$( '#bp-activities' ).val( '' ).blur();
+
+			// Remove any error message and disable the spinner
+			$( '#bp-replysubmit .error' ).html( '' ).hide();
+			$( '#bp-replysubmit .waiting' ).hide();
+		});
+
+		return false;
+	},
+
+	/**
+	 * Submits "form" via AJAX back to WordPress.
+	 *
+	 * @since 1.6
+	 */
+	send : function( e ) {
+		// Hide any existing error message, and show the loading spinner
+		$( '#bp-replysubmit .error' ).hide();
+		$( '#bp-replysubmit .waiting' ).show();
+
+		// Grab the nonce
+		var reply = {};
+		reply['_ajax_nonce-bp-activity-admin-reply'] = $( '#bp-activities-container input[name="_ajax_nonce-bp-activity-admin-reply"]' ).val();
+
+		// Get the rest of the data
+		reply.action    = 'bp-activity-admin-reply';
+		reply.content   = $( '#bp-activities' ).val();
+		reply.parent_id = $( '#bp-activities-container' ).prev().data( 'parent_id' );
+		reply.root_id   = $( '#bp-activities-container' ).prev().data( 'root_id' );
+
+		// Make the AJAX call
+		$.ajax({
+			data    : reply,
+			type    : 'POST',
+			url     : ajaxurl,
+
+			// Callbacks
+			error   : function( r ) { activityReply.error( r ); },
+			success : function( r ) { activityReply.show( r ); }
+		});
+
+		return false;
+	},
+
+	/**
+	 * send() error message handler
+	 *
+	 * @since 1.6
+	 */
+	error : function( r ) {
+		var er = r.statusText;
+		$('#bp-replysubmit .waiting').hide();
+
+		if ( r.responseText ) {
+			er = r.responseText.replace( /<.[^<>]*?>/g, '' );
+		}
+
+		if ( er ) {
+			$('#bp-replysubmit .error').html( er ).show();
+		}
+	},
+
+	/**
+	 * send() success handler
+	 *
+	 * @since 1.6
+	 */
+	show : function ( xml ) {
+		var bg, id, response;
+
+		// Handle any errors in the response
+		if ( typeof( xml ) == 'string' ) {
+			activityReply.error( { 'responseText': xml } );
+			return false;
+		}
+
+		response = wpAjax.parseAjaxResponse( xml );
+		if ( response.errors ) {
+			activityReply.error( { 'responseText': wpAjax.broken } );
+			return false;
+		}
+		response = response.responses[0];
+
+		// Close and reset the reply row, and add the new Activity item into the list.
+		$('#bp-activities-container').fadeOut( '200', function () { 
+
+			// Empty and unfocus the text area
+			$( '#bp-activities' ).val( '' ).blur();
+
+			// Remove any error message and disable the spinner
+			$( '#bp-replysubmit .error' ).html( '' ).hide();
+			$( '#bp-replysubmit .waiting' ).hide();
+
+			// Insert new activity item
+			$( '#bp-activities-container' ).before( response.data );
+
+			// Get background colour and animate the flash
+			id = $( '#activity-' + response.id );
+			bg = id.closest( '.widefat' ).css( 'backgroundColor' );
+			id.animate( { 'backgroundColor': '#CEB' }, 300 ).animate( { 'backgroundColor': bg }, 300 );
+		});
+	}
+};
+
+$(document).ready( function () {
+	// Create the Activity reply object after domready event
+	activityReply.init();
+
+	// On the edit screen, unload the close/open toggle js for the action & content metaboxes
+	$( '#bp_activity_action h3, #bp_activity_content h3' ).unbind( 'click' );
+});
+
+})(jQuery);
\ No newline at end of file
diff --git a/wp-content/plugins/buddypress/bp-activity/admin/js/admin.js b/wp-content/plugins/buddypress/bp-activity/admin/js/admin.js
new file mode 100644
index 0000000000000000000000000000000000000000..53c59ef39adf411fe34a9ec8646974d73fe78c98
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-activity/admin/js/admin.js
@@ -0,0 +1 @@
+(function(b){var a={init:function(){b(document).on("click",".row-actions a.reply",a.open);b(document).on("click","#bp-activities-container a.cancel",a.close);b(document).on("click","#bp-activities-container a.save",a.send);b(document).on("keyup","#bp-activities:visible",function(c){if(27==c.which){a.close()}})},open:function(d){var c=b("#bp-activities-container").hide();b(this).parents("tr").after(c);c.fadeIn("300");b("#bp-activities").focus();return false},close:function(c){b("#bp-activities-container").fadeOut("200",function(){b("#bp-activities").val("").blur();b("#bp-replysubmit .error").html("").hide();b("#bp-replysubmit .waiting").hide()});return false},send:function(d){b("#bp-replysubmit .error").hide();b("#bp-replysubmit .waiting").show();var c={};c["_ajax_nonce-bp-activity-admin-reply"]=b('#bp-activities-container input[name="_ajax_nonce-bp-activity-admin-reply"]').val();c.action="bp-activity-admin-reply";c.content=b("#bp-activities").val();c.parent_id=b("#bp-activities-container").prev().data("parent_id");c.root_id=b("#bp-activities-container").prev().data("root_id");b.ajax({data:c,type:"POST",url:ajaxurl,error:function(e){a.error(e)},success:function(e){a.show(e)}});return false},error:function(c){var d=c.statusText;b("#bp-replysubmit .waiting").hide();if(c.responseText){d=c.responseText.replace(/<.[^<>]*?>/g,"")}if(d){b("#bp-replysubmit .error").html(d).show()}},show:function(d){var e,f,c;if(typeof(d)=="string"){a.error({responseText:d});return false}c=wpAjax.parseAjaxResponse(d);if(c.errors){a.error({responseText:wpAjax.broken});return false}c=c.responses[0];b("#bp-activities-container").fadeOut("200",function(){b("#bp-activities").val("").blur();b("#bp-replysubmit .error").html("").hide();b("#bp-replysubmit .waiting").hide();b("#bp-activities-container").before(c.data);f=b("#activity-"+c.id);e=f.closest(".widefat").css("backgroundColor");f.animate({backgroundColor:"#CEB"},300).animate({backgroundColor:e},300)})}};b(document).ready(function(){a.init();b("#bp_activity_action h3, #bp_activity_content h3").unbind("click")})})(jQuery);
\ No newline at end of file
diff --git a/wp-content/plugins/buddypress/bp-activity/bp-activity-actions.php b/wp-content/plugins/buddypress/bp-activity/bp-activity-actions.php
index fa0e23e55c025a0a7bfc499157992632feefdd86..23b09f6b78dab09185af796742247969c467a77d 100644
--- a/wp-content/plugins/buddypress/bp-activity/bp-activity-actions.php
+++ b/wp-content/plugins/buddypress/bp-activity/bp-activity-actions.php
@@ -15,7 +15,7 @@ if ( !defined( 'ABSPATH' ) ) exit;
 /**
  * Allow core components and dependent plugins to register activity actions
  *
- * @since 1.2.0
+ * @since BuddyPress (1.2)
  *
  * @uses do_action() To call 'bp_register_activity_actions' hook.
  */
@@ -27,7 +27,7 @@ add_action( 'bp_init', 'bp_register_activity_actions', 8 );
 /**
  * Allow core components and dependent plugins to register activity actions
  *
- * @since 1.2.0
+ * @since BuddyPress (1.2)
  *
  * @global object $bp BuddyPress global settings
  * @uses bp_is_activity_component()
@@ -88,7 +88,14 @@ function bp_activity_action_permalink_router() {
 
 	// Set redirect to users' activity stream
 	} else {
-		$redirect = bp_core_get_user_domain( $activity->user_id, $activity->user_nicename, $activity->user_login ) . bp_get_activity_slug() . '/' . $activity->id;
+		$redirect = bp_core_get_user_domain( $activity->user_id, $activity->user_nicename, $activity->user_login ) . bp_get_activity_slug() . '/' . $activity->id . '/';
+	}
+
+	// If set, add the original query string back onto the redirect URL
+	if ( !empty( $_SERVER['QUERY_STRING'] ) ) {
+		$query_frags = array();
+		wp_parse_str( $_SERVER['QUERY_STRING'], $query_frags );
+		$redirect = add_query_arg( urlencode_deep( $query_frags ), $redirect );
 	}
 
 	// Allow redirect to be filtered
@@ -103,11 +110,10 @@ add_action( 'bp_actions', 'bp_activity_action_permalink_router' );
 /**
  * Delete specific activity item and redirect to previous page.
  *
- * @since 1.1.0
+ * @since BuddyPress (1.1)
  *
  * @param int $activity_id Activity id to be deleted. Defaults to 0.
  *
- * @global object $bp BuddyPress global settings
  * @uses bp_is_activity_component()
  * @uses bp_is_current_action()
  * @uses bp_action_variable()
@@ -122,7 +128,6 @@ add_action( 'bp_actions', 'bp_activity_action_permalink_router' );
  * @return bool False on failure
  */
 function bp_activity_action_delete_activity( $activity_id = 0 ) {
-	global $bp;
 
 	// Not viewing activity or action is not delete
 	if ( !bp_is_activity_component() || !bp_is_current_action( 'delete' ) )
@@ -164,12 +169,65 @@ function bp_activity_action_delete_activity( $activity_id = 0 ) {
 }
 add_action( 'bp_actions', 'bp_activity_action_delete_activity' );
 
+/**
+ * Mark specific activity item as spam and redirect to previous page
+ *
+ * @global object $bp BuddyPress global settings
+ * @param int $activity_id Activity id to be deleted. Defaults to 0.
+ * @return bool False on failure
+ * @since 1.6
+ */
+function bp_activity_action_spam_activity( $activity_id = 0 ) {
+	global $bp;
+
+	// Not viewing activity, or action is not spam, or Akismet isn't present
+	if ( !bp_is_activity_component() || !bp_is_current_action( 'spam' ) || empty( $bp->activity->akismet ) )
+		return false;
+
+	if ( empty( $activity_id ) && bp_action_variable( 0 ) )
+		$activity_id = (int) bp_action_variable( 0 );
+
+	// Not viewing a specific activity item
+	if ( empty( $activity_id ) )
+		return false;
+
+	// Is the current user allowed to spam items?
+	if ( !bp_activity_user_can_mark_spam() )
+		return false;
+
+	// Load up the activity item
+	$activity = new BP_Activity_Activity( $activity_id );
+	if ( empty( $activity->id ) )
+		return false;
+
+	// Check nonce
+	check_admin_referer( 'bp_activity_akismet_spam_' . $activity->id );
+
+	// Call an action before the spamming so plugins can modify things if they want to
+	do_action( 'bp_activity_before_action_spam_activity', $activity->id, $activity );
+
+	// Mark as spam
+	bp_activity_mark_as_spam( $activity );
+	$activity->save();
+
+	// Tell the user the spamming has been succesful
+	bp_core_add_message( __( 'The activity item has been marked as spam and is no longer visible.', 'buddypress' ) );
+
+	do_action( 'bp_activity_action_spam_activity', $activity_id, $activity->user_id );
+
+	// Check for the redirect query arg, otherwise let WP handle things
+ 	if ( !empty( $_GET['redirect_to'] ) )
+		bp_core_redirect( esc_url( $_GET['redirect_to'] ) );
+	else
+		bp_core_redirect( wp_get_referer() );
+}
+add_action( 'bp_actions', 'bp_activity_action_spam_activity' );
+
 /**
  * Post user/group activity update.
  *
- * @since 1.2.0
+ * @since BuddyPress (1.2)
  *
- * @global object $bp BuddyPress global settings
  * @uses is_user_logged_in()
  * @uses bp_is_activity_component()
  * @uses bp_is_current_action()
@@ -187,7 +245,6 @@ add_action( 'bp_actions', 'bp_activity_action_delete_activity' );
  * @return bool False on failure
  */
 function bp_activity_action_post_update() {
-	global $bp;
 
 	// Do not proceed if user is not logged in, not viewing activity, or not posting
 	if ( !is_user_logged_in() || !bp_is_activity_component() || !bp_is_current_action( 'post' ) )
@@ -213,7 +270,7 @@ function bp_activity_action_post_update() {
 
 	// Post to groups object
 	} else if ( 'groups' == $object && bp_is_active( 'groups' ) ) {
-		if ( (int)$item_id ) {
+		if ( (int) $item_id ) {
 			$activity_id = groups_post_update( array( 'content' => $content, 'group_id' => $item_id ) );
 		}
 
@@ -236,9 +293,8 @@ add_action( 'bp_actions', 'bp_activity_action_post_update' );
 /**
  * Post new activity comment.
  *
- * @since 1.2.0
+ * @since BuddyPress (1.2)
  *
- * @global object $bp BuddyPress global settings
  * @uses is_user_logged_in()
  * @uses bp_is_activity_component()
  * @uses bp_is_current_action()
@@ -253,9 +309,8 @@ add_action( 'bp_actions', 'bp_activity_action_post_update' );
  * @return bool False on failure
  */
 function bp_activity_action_post_comment() {
-	global $bp;
 
-	if ( !is_user_logged_in() || ( bp_is_activity_component() ) || !bp_is_current_action( 'reply' ) )
+	if ( !is_user_logged_in() || !bp_is_activity_component() || !bp_is_current_action( 'reply' ) )
 		return false;
 
 	// Check the nonce
@@ -287,9 +342,8 @@ add_action( 'bp_actions', 'bp_activity_action_post_comment' );
 /**
  * Mark activity as favorite.
  *
- * @since 1.2.0
+ * @since BuddyPress (1.2)
  *
- * @global object $bp BuddyPress global settings
  * @uses is_user_logged_in()
  * @uses bp_is_activity_component()
  * @uses bp_is_current_action()
@@ -303,9 +357,8 @@ add_action( 'bp_actions', 'bp_activity_action_post_comment' );
  * @return bool False on failure
  */
 function bp_activity_action_mark_favorite() {
-	global $bp;
 
-	if ( !is_user_logged_in() || ( bp_is_activity_component() ) || !bp_is_current_action( 'favorite' ) )
+	if ( !is_user_logged_in() || !bp_is_activity_component() || !bp_is_current_action( 'favorite' ) )
 		return false;
 
 	// Check the nonce
@@ -323,9 +376,8 @@ add_action( 'bp_actions', 'bp_activity_action_mark_favorite' );
 /**
  * Remove activity from favorites.
  *
- * @since 1.2.0
+ * @since BuddyPress (1.2)
  *
- * @global object $bp BuddyPress global settings
  * @uses is_user_logged_in()
  * @uses bp_is_activity_component()
  * @uses bp_is_current_action()
@@ -339,9 +391,8 @@ add_action( 'bp_actions', 'bp_activity_action_mark_favorite' );
  * @return bool False on failure
  */
 function bp_activity_action_remove_favorite() {
-	global $bp;
 
-	if ( !is_user_logged_in() || ( bp_is_activity_component() ) || !bp_is_current_action( 'unfavorite' ) )
+	if ( ! is_user_logged_in() || ! bp_is_activity_component() || ! bp_is_current_action( 'unfavorite' ) )
 		return false;
 
 	// Check the nonce
@@ -359,7 +410,7 @@ add_action( 'bp_actions', 'bp_activity_action_remove_favorite' );
 /**
  * Load the sitewide feed.
  *
- * @since 1.0.0
+ * @since BuddyPress (1.0)
  *
  * @global object $bp BuddyPress global settings
  * @global object $wp_query
@@ -387,9 +438,8 @@ add_action( 'bp_actions', 'bp_activity_action_sitewide_feed' );
 /**
  * Load a user's personal feed.
  *
- * @since 1.0.0
+ * @since BuddyPress (1.0)
  *
- * @global object $bp BuddyPress global settings
  * @global object $wp_query
  * @uses bp_is_user_activity()
  * @uses bp_is_current_action()
@@ -398,7 +448,7 @@ add_action( 'bp_actions', 'bp_activity_action_sitewide_feed' );
  * @return bool False on failure
  */
 function bp_activity_action_personal_feed() {
-	global $bp, $wp_query;
+	global $wp_query;
 
 	if ( !bp_is_user_activity() || !bp_is_current_action( 'feed' ) )
 		return false;
@@ -414,9 +464,8 @@ add_action( 'bp_actions', 'bp_activity_action_personal_feed' );
 /**
  * Load a user's friends feed.
  *
- * @since 1.0.0
+ * @since BuddyPress (1.0)
  *
- * @global object $bp BuddyPress global settings
  * @global object $wp_query
  * @uses bp_is_active()
  * @uses bp_is_user_activity()
@@ -428,7 +477,7 @@ add_action( 'bp_actions', 'bp_activity_action_personal_feed' );
  * @return bool False on failure
  */
 function bp_activity_action_friends_feed() {
-	global $bp, $wp_query;
+	global $wp_query;
 
 	if ( !bp_is_active( 'friends' ) || !bp_is_user_activity() || !bp_is_current_action( bp_get_friends_slug() ) || !bp_is_action_variable( 'feed', 0 ) )
 		return false;
@@ -444,9 +493,8 @@ add_action( 'bp_actions', 'bp_activity_action_friends_feed' );
 /**
  * Load a user's my groups feed.
  *
- * @since 1.2.0
+ * @since BuddyPress (1.2)
  *
- * @global object $bp BuddyPress global settings
  * @global object $wp_query
  * @uses bp_is_active()
  * @uses bp_is_user_activity()
@@ -458,7 +506,7 @@ add_action( 'bp_actions', 'bp_activity_action_friends_feed' );
  * @return bool False on failure
  */
 function bp_activity_action_my_groups_feed() {
-	global $bp, $wp_query;
+	global $wp_query;
 
 	if ( !bp_is_active( 'groups' ) || !bp_is_user_activity() || !bp_is_current_action( bp_get_groups_slug() ) || !bp_is_action_variable( 'feed', 0 ) )
 		return false;
@@ -474,9 +522,8 @@ add_action( 'bp_actions', 'bp_activity_action_my_groups_feed' );
 /**
  * Load a user's @mentions feed.
  *
- * @since 1.2.0
+ * @since BuddyPress (1.2)
  *
- * @global object $bp BuddyPress global settings
  * @global object $wp_query
  * @uses bp_is_user_activity()
  * @uses bp_is_current_action()
@@ -486,7 +533,7 @@ add_action( 'bp_actions', 'bp_activity_action_my_groups_feed' );
  * @return bool False on failure
  */
 function bp_activity_action_mentions_feed() {
-	global $bp, $wp_query;
+	global $wp_query;
 
 	if ( !bp_is_user_activity() || !bp_is_current_action( 'mentions' ) || !bp_is_action_variable( 'feed', 0 ) )
 		return false;
@@ -502,9 +549,8 @@ add_action( 'bp_actions', 'bp_activity_action_mentions_feed' );
 /**
  * Load a user's favorites feed.
  *
- * @since 1.2.0
+ * @since BuddyPress (1.2)
  *
- * @global object $bp BuddyPress global settings
  * @global object $wp_query
  * @uses bp_is_user_activity()
  * @uses bp_is_current_action()
@@ -514,7 +560,7 @@ add_action( 'bp_actions', 'bp_activity_action_mentions_feed' );
  * @return bool False on failure
  */
 function bp_activity_action_favorites_feed() {
-	global $bp, $wp_query;
+	global $wp_query;
 
 	if ( !bp_is_user_activity() || !bp_is_current_action( 'favorites' ) || !bp_is_action_variable( 'feed', 0 ) )
 		return false;
@@ -527,4 +573,29 @@ function bp_activity_action_favorites_feed() {
 }
 add_action( 'bp_actions', 'bp_activity_action_favorites_feed' );
 
+/**
+ * Loads Akismet
+ *
+ * @global object $bp BuddyPress global settings
+ * @since 1.6
+ */
+function bp_activity_setup_akismet() {
+	global $bp;
+
+	// Bail if Akismet is not active
+	if ( ! defined( 'AKISMET_VERSION' ) )
+		return;
+
+	// Bail if no Akismet key is set
+	if ( ! bp_get_option( 'wordpress_api_key' ) && ! defined( 'WPCOM_API_KEY' ) )
+		return;
+
+	// Bail if BuddyPress Activity Akismet support has been disabled by another plugin
+	if ( ! apply_filters( 'bp_activity_use_akismet', true ) )
+		return;
+
+	// Instantiate Akismet for BuddyPress
+	$bp->activity->akismet = new BP_Akismet();
+}
+
 ?>
diff --git a/wp-content/plugins/buddypress/bp-activity/bp-activity-admin.php b/wp-content/plugins/buddypress/bp-activity/bp-activity-admin.php
new file mode 100644
index 0000000000000000000000000000000000000000..47e9ca32b7ef172824f2241c25140c5e3525bb4d
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-activity/bp-activity-admin.php
@@ -0,0 +1,1393 @@
+<?php
+/**
+ * BuddyPress Activity component admin screen
+ *
+ * Props to WordPress core for the Comments admin screen, and its contextual help text,
+ * on which this implementation is heavily based.
+ *
+ * @package BuddyPress
+ * @since 1.6
+ * @subpackage Activity
+ */
+
+// Exit if accessed directly
+if ( !defined( 'ABSPATH' ) ) exit;
+
+// Include WP's list table class
+if ( !class_exists( 'WP_List_Table' ) ) require( ABSPATH . 'wp-admin/includes/class-wp-list-table.php' );
+
+// per_page screen option. Has to be hooked in extremely early.
+if ( is_admin() && ! empty( $_REQUEST['page'] ) && 'bp-activity' == $_REQUEST['page'] )
+	add_filter( 'set-screen-option', 'bp_activity_admin_screen_options', 10, 3 );
+
+/**
+ * Registers the Activity component admin screen
+ *
+ * @since 1.6
+ */
+function bp_activity_add_admin_menu() {
+
+	if ( ! bp_current_user_can( 'bp_moderate' ) )
+		return;
+
+	// Add our screen
+	$hook = add_menu_page( __( 'Activity', 'buddypress' ), __( 'Activity', 'buddypress' ), 'manage_options', 'bp-activity', 'bp_activity_admin' );
+
+	// Hook into early actions to load custom CSS and our init handler.
+	add_action( "load-$hook", 'bp_activity_admin_load' );
+}
+add_action( bp_core_admin_hook(), 'bp_activity_add_admin_menu' );
+
+/**
+ * AJAX receiver for Activity replies via the admin screen. Adds a new activity
+ * comment, and returns HTML for a new table row.
+ *
+ * @since 1.6
+ */
+function bp_activity_admin_reply() {
+	// Check nonce
+	check_ajax_referer( 'bp-activity-admin-reply', '_ajax_nonce-bp-activity-admin-reply' );
+
+	$parent_id = ! empty( $_REQUEST['parent_id'] ) ? (int) $_REQUEST['parent_id'] : 0;
+	$root_id   = ! empty( $_REQUEST['root_id'] )   ? (int) $_REQUEST['root_id']   : 0;
+
+	// $parent_id is required
+	if ( empty( $parent_id ) )
+		die( '-1' );
+
+	// If $root_id not set (e.g. for root items), use $parent_id
+	if ( empty( $root_id ) )
+		$root_id = $parent_id;
+
+	// Check that a reply has been entered
+	if ( empty( $_REQUEST['content'] ) )
+		die( __( 'ERROR: Please type a reply.', 'buddypress' ) );
+
+	// Check parent activity exists
+	$parent_activity = new BP_Activity_Activity( $parent_id );
+	if ( empty( $parent_activity->component ) )
+		die( __( 'ERROR: The item you are trying to reply to cannot be found, or it has been deleted.', 'buddypress' ) );
+
+	// @todo: Check if user is allowed to create new activity items
+	// if ( ! current_user_can( 'bp_new_activity' ) )
+	if ( ! is_super_admin() )
+		die( '-1' );
+
+	// Add new activity comment
+	$new_activity_id = bp_activity_new_comment( array(
+		'activity_id' => $root_id,              // ID of the root activity item
+		'content'     => $_REQUEST['content'],
+		'parent_id'   => $parent_id,            // ID of a parent comment
+	) );
+
+	// Fetch the new activity item, as we need it to create table markup to return
+	$new_activity = new BP_Activity_Activity( $new_activity_id );
+
+	// This needs to be set for the BP_Activity_List_Table constructor to work
+	set_current_screen( 'toplevel_page_bp-activity' );
+
+	// Set up an output buffer
+	ob_start();
+	$list_table = new BP_Activity_List_Table();
+	$list_table->single_row( (array) $new_activity );
+
+	// Get table markup
+	$response =  array(
+		'data'     => ob_get_contents(),
+		'id'       => $new_activity_id,
+		'position' => -1,
+		'what'     => 'bp_activity',
+	);
+	ob_end_clean();
+
+	// Send response
+	$r = new WP_Ajax_Response();
+	$r->add( $response );
+	$r->send();
+
+	exit();
+}
+add_action( 'wp_ajax_bp-activity-admin-reply', 'bp_activity_admin_reply' );
+
+/**
+ * Handle save/update of screen options for the Activity component admin screen
+ *
+ * @param string $value Will always be false unless another plugin filters it first.
+ * @param string $option Screen option name
+ * @param string $new_value Screen option form value
+ * @return string Option value. False to abandon update.
+ * @since 1.6
+ */
+function bp_activity_admin_screen_options( $value, $option, $new_value ) {
+	if ( 'toplevel_page_bp_activity_per_page' != $option && 'toplevel_page_bp_activity_network_per_page' != $option )
+		return $value;
+
+	// Per page
+	$new_value = (int) $new_value;
+	if ( $new_value < 1 || $new_value > 999 )
+		return $value;
+
+	return $new_value;
+}
+
+/**
+ * Hide the advanced edit meta boxes by default, so we don't clutter the scren.
+ *
+ * @param WP_Screen $screen Screen identifier
+ * @return array Hidden Meta Boxes
+ * @since 1.0
+ */
+function bp_activity_admin_edit_hidden_metaboxes( $hidden, $screen ) {
+	if ( empty( $screen->id ) || 'toplevel_page_bp-activity' != $screen->id && 'toplevel_page_bp-activity_network' != $screen->id )
+		return $hidden;
+
+	// Hide the primary link meta box by default
+	$hidden  = array_merge( (array) $hidden, array( 'bp_activity_itemids', 'bp_activity_link', 'bp_activity_type', 'bp_activity_userid', ) );
+
+	return apply_filters( 'bp_hide_meta_boxes', array_unique( $hidden ), $screen );
+}
+add_filter( 'default_hidden_meta_boxes', 'bp_activity_admin_edit_hidden_metaboxes', 10, 2 );
+
+/**
+ * Set up the admin page before any output is sent. Register contextual help and screen options for this admin page.
+ *
+ * @global object $bp BuddyPress global settings
+ * @global BP_Activity_List_Table $bp_activity_list_table Activity screen list table
+ * @since 1.6
+ */
+function bp_activity_admin_load() {
+	global $bp, $bp_activity_list_table;
+
+	// Decide whether to load the dev version of the CSS and JavaScript
+	$dev = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? 'dev.' : '';
+
+	// Decide whether to load the index or edit screen
+	$doaction = ! empty( $_REQUEST['action'] ) ? $_REQUEST['action'] : '';
+
+	// Call an action for plugins to hook in early
+	do_action( 'bp_activity_admin_load', $doaction );
+
+	// Edit screen
+	if ( 'edit' == $doaction && ! empty( $_GET['aid'] ) ) {
+		// columns screen option
+		add_screen_option( 'layout_columns', array( 'default' => 2, 'max' => 2, ) );
+
+		get_current_screen()->add_help_tab( array(
+			'id'      => 'bp-activity-edit-overview',
+			'title'   => __( 'Overview', 'buddypress' ),
+			'content' =>
+				'<p>' . __( 'You edit activities made on your site similar to the way you edit a comment. This is useful if you need to change which page the activity links to, or when you notice that the author has made a typographical error.', 'buddypress' ) . '</p>' .
+				'<p>' . __( 'The two big editing areas for the activity title and content are fixed in place, but you can reposition all the other boxes using drag and drop, and can minimize or expand them by clicking the title bar of each box. Use the Screen Options tab to unhide more boxes (Primary Item/Secondary Item, Link, Type, Author ID) or to choose a 1- or 2-column layout for this screen.', 'buddypress' ) . '</p>' .
+				'<p>' . __( 'You can also moderate the activity from this screen using the Status box, where you can also change the timestamp of the activity.', 'buddypress' ) . '</p>'
+		) );
+
+		get_current_screen()->add_help_tab( array(
+			'id'      => 'bp-activity-edit-advanced',
+			'title'   => __( 'Item, Link, Type', 'buddypress' ),
+			'content' =>
+				'<p>' . __( '<strong>Primary Item/Secondary Item</strong> - These identify the object that created the activity. For example, the fields could reference a comment left on a specific site. Some types of activity may only use one, or none, of these fields.', 'buddypress' ) . '</p>' .
+				'<p>' . __( '<strong>Link</strong> - Activity generated by blog posts and comments, forum topics and replies, and some plugins, uses the link field for a permalink back to the content item. Some types of activity may not use this field, even if it has been set.', 'buddypress' ) . '</p>' .
+				'<p>' . __( '<strong>Type</strong> - Each distinct kind of activity has its own type. For example, <code>created_group</code> is used when a group is created and <code>joined_group</code> is used when a user joins a group.', 'buddypress' ) . '</p>' .
+				'<p>' . __( 'For information about when and how BuddyPress uses all of these settings, see the Managing Activity link in the panel to the side.', 'buddypress' ) . '</p>'
+		) );
+
+		// Help panel - sidebar links
+		get_current_screen()->set_help_sidebar(
+			'<p><strong>' . __( 'For more information:', 'buddypress' ) . '</strong></p>' .
+			'<p>' . __( '<a href="http://codex.buddypress.org/buddypress-site-administration/managing-activity/">Managing Activity</a>', 'buddypress' ) . '</p>' .
+			'<p>' . __( '<a href="http://buddypress.org/support/">Support Forums</a>', 'buddypress' ) . '</p>'
+		);
+
+		// Register metaboxes for the edit screen.
+		add_meta_box( 'submitdiv',           _x( 'Status', 'activity admin edit screen', 'buddypress' ), 'bp_activity_admin_edit_metabox_status', get_current_screen()->id, 'side', 'core' );
+		add_meta_box( 'bp_activity_itemids', _x( 'Primary Item/Secondary Item', 'activity admin edit screen', 'buddypress' ), 'bp_activity_admin_edit_metabox_itemids', get_current_screen()->id, 'normal', 'core' );
+		add_meta_box( 'bp_activity_link',    _x( 'Link', 'activity admin edit screen', 'buddypress' ), 'bp_activity_admin_edit_metabox_link', get_current_screen()->id, 'normal', 'core' );
+		add_meta_box( 'bp_activity_type',    _x( 'Type', 'activity admin edit screen', 'buddypress' ), 'bp_activity_admin_edit_metabox_type', get_current_screen()->id, 'normal', 'core' );
+		add_meta_box( 'bp_activity_userid',  _x( 'Author ID', 'activity admin edit screen', 'buddypress' ), 'bp_activity_admin_edit_metabox_userid', get_current_screen()->id, 'normal', 'core' );
+
+		// Enqueue javascripts
+		wp_enqueue_script( 'postbox' );
+		wp_enqueue_script( 'dashboard' );
+		wp_enqueue_script( 'comment' );
+
+	// Index screen
+	} else {
+		// Create the Activity screen list table
+		$bp_activity_list_table = new BP_Activity_List_Table();
+
+		// per_page screen option
+		add_screen_option( 'per_page', array( 'label' => _x( 'Activity', 'Activity items per page (screen options)', 'buddypress' )) );
+
+		// Help panel - overview text
+		get_current_screen()->add_help_tab( array(
+			'id'      => 'bp-activity-overview',
+			'title'   => __( 'Overview', 'buddypress' ),
+			'content' =>
+				'<p>' . __( 'You can manage activities made on your site similar to the way you manage comments and other content. This screen is customizable in the same ways as other management screens, and you can act on activities using the on-hover action links or the Bulk Actions.', 'buddypress' ) . '</p>' .
+				'<p>' . __( 'There are many different types of activities. Some are generated automatically by BuddyPress and other plugins, and some are entered directly by a user in the form of status update. To help manage the different activity types, use the filter dropdown box to switch between them.', 'buddypress' ) . '</p>'
+		) );
+
+		// Help panel - moderation text
+		get_current_screen()->add_help_tab( array(
+			'id'		=> 'bp-activity-moderating',
+			'title'		=> __( 'Moderating Activity', 'buddypress' ),
+			'content'	=>
+				'<p>' . __( 'In the <strong>Activity</strong> column, above each activity it says &#8220;Submitted on,&#8221; followed by the date and time the activity item was generated on your site. Clicking on the date/time link will take you to that activity on your live site. Hovering over any activity gives you options to reply, edit, spam mark, or delete that activity.', 'buddypress' ) . '</p>' .
+				'<p>' . __( "In the <strong>In Response To</strong> column, if the activity was in reply to another activity, it shows that activity's author's picture and name, and a link to that activity on your live site. If there is a small bubble, the number in it shows how many other activities are related to this one; these are usually comments. Clicking the bubble will filter the activity screen to show only related activity items.", 'buddypress' ) . '</p>'
+		) );
+
+		// Help panel - sidebar links
+		get_current_screen()->set_help_sidebar(
+			'<p><strong>' . __( 'For more information:', 'buddypress' ) . '</strong></p>' .
+			'<p>' . __( '<a href="http://buddypress.org/support/">Support Forums</a>', 'buddypress' ) . '</p>'
+		);
+	}
+
+	// Enqueue CSS and JavaScript
+	wp_enqueue_script( 'bp_activity_admin_js', BP_PLUGIN_URL . "bp-activity/admin/js/admin.{$dev}js",   array( 'jquery', 'wp-ajax-response' ), bp_get_version(), true );
+	wp_enqueue_style( 'bp_activity_admin_css', BP_PLUGIN_URL . "bp-activity/admin/css/admin.{$dev}css", array(),                               bp_get_version()       );
+
+	// Handle spam/un-spam/delete of activities
+	if ( !empty( $doaction ) && ! in_array( $doaction, array( '-1', 'edit', 'save', ) ) ) {
+
+		// Build redirection URL
+		$redirect_to = remove_query_arg( array( 'aid', 'deleted', 'error', 'spammed', 'unspammed', ), wp_get_referer() );
+		$redirect_to = add_query_arg( 'paged', $bp_activity_list_table->get_pagenum(), $redirect_to );
+
+		// Get activity IDs
+		$activity_ids = array_map( 'absint', (array) $_REQUEST['aid'] );
+
+		// Call a filter for plugins to modify the requested activities to load
+		$activity_ids = apply_filters( 'bp_activity_admin_action_activity_ids', $activity_ids );
+
+		// Is this a bulk request?
+		if ( 'bulk_' == substr( $doaction, 0, 5 ) && ! empty( $_REQUEST['aid'] ) ) {
+			// Check this is a valid form submission
+			check_admin_referer( 'bulk-activities' );
+
+			// Trim 'bulk_' off the action name to avoid duplicating a ton of code
+			$doaction = substr( $doaction, 5 );
+
+		// This is a request to delete, spam, or un-spam, a single item.
+		} elseif ( !empty( $_REQUEST['aid'] ) ) {
+
+			// Check this is a valid form submission
+			check_admin_referer( 'spam-activity_' . $activity_ids[0] );
+		}
+
+		// Initialise counters for how many of each type of item we perform an action on
+		$deleted = $spammed = $unspammed = 0;
+
+		// Store any errors that occurs when updating the database items
+		$errors = array();
+
+		// "We'd like to shoot the monster, could you move, please?"
+		foreach ( $activity_ids as $activity_id ) {
+			// @todo: Check the permissions on each
+			//if ( ! current_user_can( 'bp_edit_activity', $activity_id ) )
+			//	continue;
+
+			// Get the activity from the database
+			$activity = new BP_Activity_Activity( $activity_id );
+			if ( empty( $activity->component ) ) {
+				$errors[] = $activity_id;
+				continue;
+			}
+
+			switch ( $doaction ) {
+				case 'delete' :
+					if ( 'activity_comment' == $activity->type )
+						bp_activity_delete_comment( $activity->item_id, $activity->id );
+					else
+						bp_activity_delete( array( 'id' => $activity->id ) );
+
+					$deleted++;
+					break;
+
+				case 'ham' :
+					/**
+					 * Remove moderation and blacklist checks in case we want to ham an activity
+					 * which contains one of these listed keys.
+					 */
+					remove_action( 'bp_activity_before_save', 'bp_activity_check_moderation_keys', 2, 1 );
+					remove_action( 'bp_activity_before_save', 'bp_activity_check_blacklist_keys',  2, 1 );
+
+					bp_activity_mark_as_ham( $activity );
+					$result = $activity->save();
+
+					// Check for any error during activity save
+					if ( ! $result )
+						$errors[] = $activity->id;
+					else
+						$unspammed++;
+					break;
+
+				case 'spam' :
+					bp_activity_mark_as_spam( $activity );
+					$result = $activity->save();
+
+					// Check for any error during activity save
+					if ( ! $result )
+						$errors[] = $activity->id;
+					else
+						$spammed++;
+					break;
+
+				default:
+					break;
+			}
+
+			// Release memory
+			unset( $activity );
+		}
+
+		// Call actions for plugins to do something before we redirect
+		do_action( 'bp_activity_admin_action_after', array( $spammed, $unspammed, $deleted, $errors ), $redirect_to, $activity_ids );
+
+		// Add arguments to the redirect URL so that on page reload, we can easily display what we've just done.
+		if ( $spammed )
+			$redirect_to = add_query_arg( 'spammed', $spammed, $redirect_to );
+
+		if ( $unspammed )
+			$redirect_to = add_query_arg( 'unspammed', $unspammed, $redirect_to );
+
+		if ( $deleted )
+			$redirect_to = add_query_arg( 'deleted', $deleted, $redirect_to );
+
+		// If an error occurred, pass back the activity ID that failed
+		if ( ! empty( $errors ) )
+			$redirect_to = add_query_arg( 'error', implode ( ',', array_map( 'absint', $errors ) ), $redirect_to );
+
+		// Redirect
+		wp_redirect( apply_filters( 'bp_activity_admin_action_redirect', $redirect_to ) );
+		exit;
+
+
+	// Save the edit
+	} elseif ( $doaction && 'save' == $doaction ) {
+		// Build redirection URL
+		$redirect_to = remove_query_arg( array( 'action', 'aid', 'deleted', 'error', 'spammed', 'unspammed', ), $_SERVER['REQUEST_URI'] );
+
+		// Get activity ID
+		$activity_id = (int) $_REQUEST['aid'];
+
+		// Check this is a valid form submission
+		check_admin_referer( 'edit-activity_' . $activity_id );
+
+		// Get the activity from the database
+		$activity = new BP_Activity_Activity( $activity_id );
+
+		// If the activity doesn't exist, just redirect back to the index
+		if ( empty( $activity->component ) ) {
+			wp_redirect( $redirect_to );
+			exit;
+		}
+
+		// Check the form for the updated properties
+
+		// Store any error that occurs when updating the database item
+		$error = 0;
+
+		// Activity spam status
+		$prev_spam_status = $new_spam_status = false;
+		if ( ! empty( $_POST['activity_status'] ) ) {
+			$prev_spam_status = $activity->is_spam;
+			$new_spam_status  = ( 'spam' == $_POST['activity_status'] ) ? true : false;
+		}
+
+		// Activity action
+		if ( isset( $_POST['bp-activities-action'] ) )
+			$activity->action = $_POST['bp-activities-action'];
+
+		// Activity content
+		if ( isset( $_POST['bp-activities-content'] ) )
+			$activity->content = $_POST['bp-activities-content'];
+
+		// Activity primary link
+		if ( ! empty( $_POST['bp-activities-link'] ) )
+			$activity->primary_link = $_POST['bp-activities-link'];
+
+		// Activity user ID
+		if ( ! empty( $_POST['bp-activities-userid'] ) )
+			$activity->user_id = (int) $_POST['bp-activities-userid'];
+
+		// Activity item primary ID
+		if ( isset( $_POST['bp-activities-primaryid'] ) )
+			$activity->item_id = (int) $_POST['bp-activities-primaryid'];
+
+		// Activity item secondary ID
+		if ( isset( $_POST['bp-activities-secondaryid'] ) )
+			$activity->secondary_item_id = (int) $_POST['bp-activities-secondaryid'];
+
+		// Activity type
+		if ( ! empty( $_POST['bp-activities-type'] ) ) {
+			$actions  = array();
+
+			// Walk through the registered actions, and build an array of actions/values.
+			foreach ( $bp->activity->actions as $action ) {
+				$action = array_values( (array) $action );
+
+				for ( $i = 0, $i_count = count( $action ); $i < $i_count; $i++ )
+					$actions[] = $action[$i]['key'];
+			}
+
+			// This was a mis-named activity type from before BP 1.6
+			unset( $actions['friends_register_activity_action'] );
+
+			// Check that the new type is a registered activity type
+			if ( in_array( $_POST['bp-activities-type'], $actions ) )
+				$activity->type = $_POST['bp-activities-type'];
+		}
+
+		// Activity timestamp
+		if ( ! empty( $_POST['aa'] ) && ! empty( $_POST['mm'] ) && ! empty( $_POST['jj'] ) && ! empty( $_POST['hh'] ) && ! empty( $_POST['mn'] ) && ! empty( $_POST['ss'] ) ) {
+			$aa = $_POST['aa'];
+			$mm = $_POST['mm'];
+			$jj = $_POST['jj'];
+			$hh = $_POST['hh'];
+			$mn = $_POST['mn'];
+			$ss = $_POST['ss'];
+			$aa = ( $aa <= 0 ) ? date( 'Y' ) : $aa;
+			$mm = ( $mm <= 0 ) ? date( 'n' ) : $mm;
+			$jj = ( $jj > 31 ) ? 31 : $jj;
+			$jj = ( $jj <= 0 ) ? date( 'j' ) : $jj;
+			$hh = ( $hh > 23 ) ? $hh -24 : $hh;
+			$mn = ( $mn > 59 ) ? $mn -60 : $mn;
+			$ss = ( $ss > 59 ) ? $ss -60 : $ss;
+
+			// Reconstruct the date into a timestamp
+			$gmt_date = sprintf( "%04d-%02d-%02d %02d:%02d:%02d", $aa, $mm, $jj, $hh, $mn, $ss );
+
+			$activity->date_recorded = $gmt_date;
+		}
+
+		// Has the spam status has changed?
+		if ( $new_spam_status != $prev_spam_status ) {
+			if ( $new_spam_status )
+				bp_activity_mark_as_spam( $activity );
+			else
+				bp_activity_mark_as_ham( $activity );
+		}
+
+		// Save
+		$result = $activity->save();
+
+		// Clear the activity stream first page cache, in case this activity's timestamp was changed
+		wp_cache_delete( 'bp_activity_sitewide_front', 'bp' );
+
+		// Check for any error during activity save
+		if ( false === $result )
+			$error = $activity->id;
+
+		// Call actions for plugins to do something before we redirect
+		do_action_ref_array( 'bp_activity_admin_edit_after', array( &$activity, $error ) );
+
+		// If an error occurred, pass back the activity ID that failed
+		if ( $error )
+			$redirect_to = add_query_arg( 'error', (int) $error, $redirect_to );
+		else
+			$redirect_to = add_query_arg( 'updated', (int) $activity->id, $redirect_to );
+
+		// Redirect
+		wp_redirect( apply_filters( 'bp_activity_admin_edit_redirect', $redirect_to ) );
+		exit;
+
+
+	// If a referrer and a nonce is supplied, but no action, redirect back.
+	} elseif ( ! empty( $_GET['_wp_http_referer'] ) ) {
+		wp_redirect( remove_query_arg( array( '_wp_http_referer', '_wpnonce' ), stripslashes( $_SERVER['REQUEST_URI'] ) ) );
+		exit;
+	}
+}
+
+/**
+ * Outputs the Activity component admin screens
+ *
+ * @since 1.6
+ */
+function bp_activity_admin() {
+	// Decide whether to load the index or edit screen
+	$doaction = ! empty( $_REQUEST['action'] ) ? $_REQUEST['action'] : '';
+
+	// Display the single activity edit screen
+	if ( 'edit' == $doaction && ! empty( $_GET['aid'] ) )
+		bp_activity_admin_edit();
+
+	// Otherwise, display the Activity index screen
+	else
+		bp_activity_admin_index();
+}
+
+/**
+ * Display the single activity edit screen
+ *
+ * @global int $screen_layout_columns Number of columns shown on this admin page
+ * @since 1.6
+ */
+function bp_activity_admin_edit() {
+	global $screen_layout_columns;
+
+	// @todo: Check if user is allowed to edit activity items
+	// if ( ! current_user_can( 'bp_edit_activity' ) )
+	if ( ! is_super_admin() )
+		die( '-1' );
+
+	// Get the activity from the database
+	$activity = bp_activity_get( array(
+		'in'               => ! empty( $_REQUEST['aid'] ) ? (int) $_REQUEST['aid'] : 0,
+		'max'              => 1,
+		'show_hidden'      => true,
+		'spam'             => 'all',
+		'display_comments' => 0
+	) );
+
+	if ( ! empty( $activity['activities'][0] ) ) {
+		$activity = $activity['activities'][0];
+
+		// Workaround to use WP's touch_time() without duplicating that function
+		$GLOBALS['comment'] = new stdClass;
+		$GLOBALS['comment']->comment_date = $activity->date_recorded;
+	} else {
+		$activity = '';
+	}
+
+	// Construct URL for form
+	$form_url = remove_query_arg( array( 'action', 'deleted', 'error', 'spammed', 'unspammed', ), $_SERVER['REQUEST_URI'] );
+	$form_url = add_query_arg( 'action', 'save', $form_url );
+
+	// Call an action for plugins to modify the activity before we display the edit form
+	do_action_ref_array( 'bp_activity_admin_edit', array( &$activity ) );
+?>
+
+	<div class="wrap">
+		<?php screen_icon( 'buddypress-activity' ); ?>
+		<h2><?php printf( __( 'Editing Activity (ID #%s)', 'buddypress' ), number_format_i18n( (int) $_REQUEST['aid'] ) ); ?></h2>
+
+		<?php if ( ! empty( $activity ) ) : ?>
+
+			<form action="<?php echo esc_attr( $form_url ); ?>" id="bp-activities-edit-form" method="post">
+				<div id="poststuff">
+
+					<div id="post-body" class="metabox-holder columns-<?php echo 1 == get_current_screen()->get_columns() ? '1' : '2'; ?>"> 
+						<div id="post-body-content">
+							<div id="postdiv" class="postarea">
+								<div id="bp_activity_action" class="postbox">
+									<h3><?php _e( 'Action', 'buddypress' ); ?></h3>
+									<div class="inside">
+										<?php wp_editor( stripslashes( $activity->action ), 'bp-activities-action', array( 'media_buttons' => false, 'textarea_rows' => 7, 'teeny' => true, 'quicktags' => array( 'buttons' => 'strong,em,link,block,del,ins,img,code,spell,close' ) ) ); ?>
+									</div>
+								</div>
+
+								<div id="bp_activity_content" class="postbox">
+									<h3><?php _e( 'Content', 'buddypress' ); ?></h3>
+									<div class="inside">
+										<?php wp_editor( stripslashes( $activity->content ), 'bp-activities-content', array( 'media_buttons' => false, 'teeny' => true, 'quicktags' => array( 'buttons' => 'strong,em,link,block,del,ins,img,code,spell,close' ) ) ); ?>
+									</div>
+								</div>
+							</div>
+						</div><!-- #post-body-content -->
+
+						<div id="postbox-container-1" class="postbox-container">
+							<?php do_meta_boxes( get_current_screen()->id, 'side', $activity ); ?>
+						</div>
+
+						<div id="postbox-container-2" class="postbox-container">
+							<?php do_meta_boxes( get_current_screen()->id, 'normal', $activity ); ?>
+							<?php do_meta_boxes( get_current_screen()->id, 'advanced', $activity ); ?>
+						</div>
+					</div><!-- #post-body -->
+
+				</div><!-- #poststuff -->
+				<?php wp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false ); ?>
+				<?php wp_nonce_field( 'meta-box-order', 'meta-box-order-nonce', false ); ?>
+				<?php wp_nonce_field( 'edit-activity_' . $activity->id ); ?>
+			</form>
+
+		<?php else : ?>
+			<p><?php printf( __( 'No activity found with this ID. <a href="%s">Go back and try again</a>.', 'buddypress' ), network_admin_url( 'admin.php?page=bp-activity' ) ); ?></p>
+		<?php endif; ?>
+
+	</div><!-- .wrap -->
+
+<?php
+}
+
+/**
+ * Status metabox for the Activity admin edit screen
+ *
+ * @param object $item Activity item
+ * @since 1.6
+ */
+function bp_activity_admin_edit_metabox_status( $item ) {
+?>
+
+	<div class="submitbox" id="submitcomment">
+
+		<div id="minor-publishing">
+			<div id="minor-publishing-actions">
+				<div id="preview-action">
+					<a class="button preview" href="<?php echo esc_attr( bp_activity_get_permalink( $item->id, $item ) ); ?>" target="_blank"><?php _e( 'View Activity', 'buddypress' ); ?></a>
+				</div>
+
+				<div class="clear"></div>
+			</div><!-- #minor-publishing-actions -->
+
+			<div id="misc-publishing-actions">
+				<div class="misc-pub-section" id="comment-status-radio">
+					<label class="approved"><input type="radio" name="activity_status" value="ham" <?php checked( $item->is_spam, 0 ); ?>><?php _e( 'Approved', 'buddypress' ); ?></label><br />
+					<label class="spam"><input type="radio" name="activity_status" value="spam" <?php checked( $item->is_spam, 1 ); ?>><?php _e( 'Spam', 'buddypress' ); ?></label>
+				</div>
+
+				<div class="misc-pub-section curtime misc-pub-section-last">
+					<?php
+					// translators: Publish box date format, see http://php.net/date
+					$datef = __( 'M j, Y @ G:i', 'buddypress' );
+					$date  = date_i18n( $datef, strtotime( $item->date_recorded ) );
+					?>
+					<span id="timestamp"><?php printf( __( 'Submitted on: <strong>%1$s</strong>', 'buddypress' ), $date ); ?></span>&nbsp;<a href="#edit_timestamp" class="edit-timestamp hide-if-no-js" tabindex='4'><?php _e( 'Edit', 'buddypress' ); ?></a>
+
+					<div id='timestampdiv' class='hide-if-js'>
+						<?php touch_time( 1, 0, 5 ); ?>
+					</div><!-- #timestampdiv -->
+				</div>
+			</div> <!-- #misc-publishing-actions -->
+
+			<div class="clear"></div>
+		</div><!-- #minor-publishing -->
+
+		<div id="major-publishing-actions">
+			<div id="publishing-action">
+				<?php submit_button( __( 'Update', 'buddypress' ), 'primary', 'save', false, array( 'tabindex' => '4' ) ); ?>
+			</div>
+			<div class="clear"></div>
+		</div><!-- #major-publishing-actions -->
+
+	</div><!-- #submitcomment -->
+
+<?php
+}
+
+/**
+ * Primary link metabox for the Activity admin edit screen
+ *
+ * @param object $item Activity item
+ * @since 1.6
+ */
+function bp_activity_admin_edit_metabox_link( $item ) {
+?>
+
+	<label class="screen-reader-text" for="bp-activities-link"><?php _e( 'Link', 'buddypress' ); ?></label>
+	<input type="url" name="bp-activities-link" value="<?php echo esc_url( $item->primary_link ); ?>" />
+	<p><?php _e( 'Activity generated by blog posts and comments, forum topics and replies, and some plugins, uses the link field for a permalink back to the content item.', 'buddypress' ); ?></p>
+
+<?php
+}
+
+/**
+ * User ID metabox for the Activity admin edit screen
+ *
+ * @param object $item Activity item
+ * @since 1.6
+ */
+function bp_activity_admin_edit_metabox_userid( $item ) {
+?>
+
+	<label class="screen-reader-text" for="bp-activities-userid"><?php _e( 'Author ID', 'buddypress' ); ?></label>
+	<input type="number" name="bp-activities-userid" value="<?php echo esc_attr( $item->user_id ); ?>" min="1" />
+
+<?php
+}
+
+/**
+ * Activity type metabox for the Activity admin edit screen
+ *
+ * @global object $bp BuddyPress global settings
+ * @param object $item Activity item
+ * @since 1.6
+ */
+function bp_activity_admin_edit_metabox_type( $item ) {
+	global $bp;
+
+	$actions  = array();
+	$selected = $item->type;
+
+	// Walk through the registered actions, and build an array of actions/values.
+	foreach ( $bp->activity->actions as $action ) {
+		$action = array_values( (array) $action );
+
+		for ( $i = 0, $i_count = count( $action ); $i < $i_count; $i++ )
+			$actions[ $action[$i]['key'] ] = $action[$i]['value'];
+	}
+
+	// This was a mis-named activity type from before BP 1.6
+	unset( $actions['friends_register_activity_action'] );
+
+	// Sort array by the human-readable value
+	natsort( $actions );
+?>
+
+	<select name="bp-activities-type">
+		<?php foreach ( $actions as $k => $v ) : ?>
+			<option value="<?php echo esc_attr( $k ); ?>" <?php selected( $k,  $selected ); ?>><?php echo esc_html( $v ); ?></option>
+		<?php endforeach; ?>
+	</select>
+
+<?php
+}
+
+/**
+ * Primary item ID/Secondary item ID metabox for the Activity admin edit screen
+ *
+ * @param object $item Activity item
+ * @since 1.6
+ */
+function bp_activity_admin_edit_metabox_itemids( $item ) {
+?>
+
+	<label for="bp-activities-primaryid"><?php _e( 'Primary Item ID', 'buddypress' ); ?></label>
+	<input type="number" name="bp-activities-primaryid" id="bp-activities-primaryid" value="<?php echo esc_attr( $item->item_id ); ?>" min="0" />
+	<br />
+
+	<label for="bp-activities-secondaryid"><?php _e( 'Secondary Item ID', 'buddypress' ); ?></label>
+	<input type="number" name="bp-activities-secondaryid" id="bp-activities-secondaryid" value="<?php echo esc_attr( $item->secondary_item_id ); ?>" min="0" />
+
+	<p><?php _e( 'These identify the object that created this activity. For example, the fields could reference a pair of site and comment IDs.', 'buddypress' ); ?></p>
+
+<?php
+}
+
+/**
+ * Display the Activity admin index screen, which contains a list of all the activities.
+ *
+ * @global BP_Activity_List_Table $bp_activity_list_table Activity screen list table
+ * @global string $plugin_page
+ * @since 1.6
+ */
+function bp_activity_admin_index() {
+	global $bp_activity_list_table, $plugin_page;
+
+	$messages = array();
+
+	// If the user has just made a change to an activity item, build status messages
+	if ( ! empty( $_REQUEST['deleted'] ) || ! empty( $_REQUEST['spammed'] ) || ! empty( $_REQUEST['unspammed'] ) || ! empty( $_REQUEST['error'] ) || ! empty( $_REQUEST['updated'] ) ) {
+		$deleted   = ! empty( $_REQUEST['deleted']   ) ? (int) $_REQUEST['deleted']   : 0;
+		$errors    = ! empty( $_REQUEST['error']     ) ? $_REQUEST['error']           : '';
+		$spammed   = ! empty( $_REQUEST['spammed']   ) ? (int) $_REQUEST['spammed']   : 0;
+		$unspammed = ! empty( $_REQUEST['unspammed'] ) ? (int) $_REQUEST['unspammed'] : 0;
+		$updated   = ! empty( $_REQUEST['updated']   ) ? (int) $_REQUEST['updated']   : 0;
+
+		$errors = array_map( 'absint', explode( ',', $errors ) );
+
+		// Make sure we don't get any empty values in $errors
+		for ( $i = 0, $errors_count = count( $errors ); $i < $errors_count; $i++ ) {
+			if ( 0 === $errors[$i] )
+				unset( $errors[$i] );
+		}
+
+		// Reindex array
+		$errors = array_values( $errors );
+
+		if ( $deleted > 0 )
+			$messages[] = sprintf( _n( '%s activity has been permanently deleted.', '%s activity items have been permanently deleted.', $deleted, 'buddypress' ), number_format_i18n( $deleted ) );
+
+		if ( ! empty( $errors ) ) {
+			if ( 1 == count( $errors ) ) {
+				$messages[] = sprintf( __( 'An error occurred when trying to update activity ID #%s.', 'buddypress' ), number_format_i18n( $errors[0] ) );
+
+			} else {
+				$error_msg  = __( 'Errors occurred when trying to update these activity items:', 'buddypress' );
+				$error_msg .= '<ul class="activity-errors">';
+
+				// Display each error as a list item
+				foreach ( $errors as $error ) {
+					// Translators: This is a bulleted list of item IDs
+					$error_msg .= '<li>' . sprintf( __( '#%s', 'buddypress' ), number_format_i18n( $error ) ) . '</li>';
+				}
+
+				$error_msg  .= '</ul>';
+				$messages[] = $error_msg;
+			}
+		}
+
+		if ( $spammed > 0 )
+			$messages[] = sprintf( _n( '%s activity has been successfully spammed.', '%s activity items have been successfully spammed.', $spammed, 'buddypress' ), number_format_i18n( $spammed ) );
+
+		if ( $unspammed > 0 )
+			$messages[] = sprintf( _n( '%s activity has been successfully unspammed.', '%s activity items have been successfully unspammed.', $unspammed, 'buddypress' ), number_format_i18n( $unspammed ) );
+
+		if ( $updated > 0 )
+			$messages[] = __( 'The activity has been updated succesfully.', 'buddypress' );
+	}
+
+	// Prepare the activity items for display
+	$bp_activity_list_table->prepare_items();
+
+	// Call an action for plugins to modify the activity before we display the edit form
+	do_action( 'bp_activity_admin_index', $messages );
+?>
+
+	<div class="wrap">
+		<?php screen_icon( 'buddypress-activity' ); ?>
+		<h2>
+			<?php if ( !empty( $_REQUEST['aid'] ) ) : ?>
+				<?php printf( __( 'Activity related to ID #%s', 'buddypress' ), number_format_i18n( (int) $_REQUEST['aid'] ) ); ?>
+			<?php else : ?>
+				<?php _e( 'Activity', 'buddypress' ); ?>
+			<?php endif; ?>
+
+			<?php if ( !empty( $_REQUEST['s'] ) ) : ?>
+				<span class="subtitle"><?php printf( __( 'Search results for &#8220;%s&#8221;', 'buddypress' ), wp_html_excerpt( esc_html( stripslashes( $_REQUEST['s'] ) ), 50 ) ); ?></span>
+			<?php endif; ?>
+		</h2>
+
+		<?php // If the user has just made a change to an activity item, display the status messages ?>
+		<?php if ( !empty( $messages ) ) : ?>
+			<div id="moderated" class="<?php echo ( ! empty( $_REQUEST['error'] ) ) ? 'error' : 'updated'; ?>"><p><?php echo implode( "<br/>\n", $messages ); ?></p></div>
+		<?php endif; ?>
+
+		<?php // Display each activity on its own row ?>
+		<?php $bp_activity_list_table->views(); ?>
+
+		<form id="bp-activities-form" action="" method="get">
+			<?php $bp_activity_list_table->search_box( __( 'Search all Activity', 'buddypress' ), 'bp-activity' ); ?>
+			<input type="hidden" name="page" value="<?php echo esc_attr( $plugin_page ); ?>" />
+			<?php $bp_activity_list_table->display(); ?>
+		</form>
+
+		<?php // This markup is used for the reply form ?>
+		<table style="display: none;">
+			<tr id="bp-activities-container" style="display: none;">
+				<td colspan="4">
+					<form method="get" action="">
+
+						<h5 id="bp-replyhead"><?php _e( 'Reply to Activity', 'buddypress' ); ?></h5>
+						<?php wp_editor( '', 'bp-activities', array( 'dfw' => false, 'media_buttons' => false, 'quicktags' => array( 'buttons' => 'strong,em,link,block,del,ins,img,code,spell,close' ), 'tinymce' => false, ) ); ?>
+
+						<p id="bp-replysubmit" class="submit">
+							<a href="#" class="cancel button-secondary alignleft"><?php _e( 'Cancel', 'buddypress' ); ?></a>
+							<a href="#" class="save button-primary alignright"><?php _e( 'Reply', 'buddypress' ); ?></a>
+
+							<img class="waiting" style="display:none;" src="<?php echo esc_url( network_admin_url( 'images/wpspin_light.gif' ) ); ?>" alt="" />
+							<span class="error" style="display:none;"></span>
+							<br class="clear" />
+						</p>
+
+						<?php wp_nonce_field( 'bp-activity-admin-reply', '_ajax_nonce-bp-activity-admin-reply', false ); ?>
+
+					</form>
+				</td>
+			</tr>
+		</table>
+	</div>
+
+<?php
+}
+
+/**
+ * List table class for the Activity component admin page.
+ *
+ * @since 1.6
+ */
+class BP_Activity_List_Table extends WP_List_Table {
+	/**
+	 * What type of view is being displayed? e.g. "All", "Pending", "Approved", "Spam"...
+	 *
+	 * @since 1.6
+	*/
+	public $view = 'all';
+
+	/**
+	 * How many activity items have been marked as spam.
+	 *
+	 * @since 1.6
+	 */
+	public $spam_count = 0;
+
+	/**
+	 * Store activity-to-user-ID mappings for use in the In Response To column.
+	 *
+	 * @since 1.6
+	 */
+	protected $activity_user_id = array();
+
+	/**
+	 * Constructor
+	 *
+	 * @since 1.6
+	 */
+	public function __construct() {
+
+		// Define singular and plural labels, as well as whether we support AJAX.
+		parent::__construct( array(
+			'ajax'     => false,
+			'plural'   => 'activities',
+			'singular' => 'activity',
+		) );
+	}
+
+	/**
+	 * Handle filtering of data, sorting, pagination, and any other data-manipulation required prior to rendering.
+	 *
+	 * @since 1.6
+	 */
+	function prepare_items() {
+		$screen = get_current_screen();
+
+		// Option defaults
+		$filter           = array();
+		$include_id       = false;
+		$search_terms     = false;
+		$sort             = 'DESC';
+		$spam             = 'ham_only';
+
+		// Set current page
+		$page = $this->get_pagenum();
+
+		// Set per page from the screen options
+		$per_page = $this->get_items_per_page( str_replace( '-', '_', "{$screen->id}_per_page" ) );
+
+		// Check if we're on the "Spam" view
+		if ( !empty( $_REQUEST['activity_status'] ) && 'spam' == $_REQUEST['activity_status'] ) {
+			$spam       = 'spam_only';
+			$this->view = 'spam';
+		}
+
+		// Sort order
+		if ( !empty( $_REQUEST['order'] ) && 'desc' != $_REQUEST['order'] )
+			$sort = 'ASC';
+
+		// Order by
+		/*if ( !empty( $_REQUEST['orderby'] ) ) {
+		}*/
+
+		// Filter
+		if ( !empty( $_REQUEST['activity_type'] ) )
+			$filter = array( 'action' => $_REQUEST['activity_type'] );
+
+		// Are we doing a search?
+		if ( !empty( $_REQUEST['s'] ) )
+			$search_terms = $_REQUEST['s'];
+
+		// Check if user has clicked on a specific activity (if so, fetch only that, and any related, activity).
+		if ( !empty( $_REQUEST['aid'] ) )
+			$include_id = (int) $_REQUEST['aid'];
+
+		// Get the spam total (ignoring any search query or filter)
+		$spams = bp_activity_get( array(
+			'display_comments' => 'stream',
+			'show_hidden'      => true,
+			'spam'             => 'spam_only',
+		) );
+		$this->spam_count = $spams['total'];
+		unset( $spams );
+
+		// Get the activities from the database
+		$activities = bp_activity_get( array(
+			'display_comments' => 'stream',
+			'filter'           => $filter,
+			'in'               => $include_id,
+			'page'             => $page,
+			'per_page'         => $per_page,
+			'search_terms'     => $search_terms,
+			'show_hidden'      => true,
+			//'sort'             => $sort,
+			'spam'             => $spam,
+		) );
+
+		// If we're viewing a specific activity, flatten all activites into a single array.
+		if ( $include_id ) {
+			$activities['activities'] = BP_Activity_List_Table::flatten_activity_array( $activities['activities'] );
+			$activities['total']      = count( $activities['activities'] );
+
+			// Sort the array by the activity object's date_recorded value
+			usort( $activities['activities'], create_function( '$a, $b', 'return $a->date_recorded > $b->date_recorded;' ) );
+		}
+
+		// bp_activity_get returns an array of objects; cast these to arrays for WP_List_Table.
+		$new_activities = array();
+		foreach ( $activities['activities'] as $activity_item ) {
+			$new_activities[] = (array) $activity_item;
+
+			// Build an array of activity-to-user ID mappings for better efficency in the In Response To column
+			$this->activity_user_id[$activity_item->id] = $activity_item->user_id;
+		}
+
+		// Set raw data to display
+		$this->items       = $new_activities;
+
+		// Store information needed for handling table pagination
+		$this->set_pagination_args( array(
+			'per_page'    => $per_page,
+			'total_items' => $activities['total'],
+			'total_pages' => ceil( $activities['total'] / $per_page )
+		) );
+
+		// Don't truncate activity items; bp_activity_truncate_entry() needs to be used inside a BP_Activity_Template loop.
+		remove_filter( 'bp_get_activity_content_body', 'bp_activity_truncate_entry', 5 );
+	}
+
+	/**
+	 * Get an array of all the columns on the page
+	 *
+	 * @return array
+	 * @since 1.6
+	 */
+	function get_column_info() {
+		$this->_column_headers = array(
+			$this->get_columns(),
+			array(),
+			$this->get_sortable_columns(),
+		);
+
+		return $this->_column_headers;
+	}
+
+	/**
+	 * Displays a message on screen when no items are found (e.g. no search matches)
+	 *
+	 * @since 1.6
+	 */
+	function no_items() {
+		_e( 'No activities found.', 'buddypress' );
+	}
+
+	/**
+	 * Outputs the Activity data table
+	 *
+	 * @since 1.6
+	*/
+	function display() {
+		extract( $this->_args );
+
+		$this->display_tablenav( 'top' );
+	?>
+
+		<table class="<?php echo implode( ' ', $this->get_table_classes() ); ?>" cellspacing="0">
+			<thead>
+				<tr>
+					<?php $this->print_column_headers(); ?>
+				</tr>
+			</thead>
+
+			<tfoot>
+				<tr>
+					<?php $this->print_column_headers( false ); ?>
+				</tr>
+			</tfoot>
+
+			<tbody id="the-comment-list">
+				<?php $this->display_rows_or_placeholder(); ?>
+			</tbody>
+		</table>
+		<?php
+
+		$this->display_tablenav( 'bottom' );
+	}
+
+	/**
+	 * Generates content for a single row of the table
+	 *
+	 * @param object $item The current item
+	 * @since 1.6
+	 */
+	function single_row( $item ) {
+		static $row_class = '';
+		$row_class = ( $row_class == '' ? ' class="alternate"' : '' );
+
+		echo '<tr' . $row_class . ' id="activity-' . esc_attr( $item['id'] ) . '" data-parent_id="' . esc_attr( $item['id'] ) . '" data-root_id="' . esc_attr( $item['item_id'] ) . '">';
+		echo $this->single_row_columns( $item );
+		echo '</tr>';
+	}
+
+	/**
+	 * Get the list of views available on this table (e.g. "all", "spam").
+	 *
+	 * @since 1.6
+	 */
+	function get_views() {
+		$redirect_to = remove_query_arg( array( 'activity_status', 'aid', 'deleted', 'error', 'spammed', 'unspammed', 'updated', ), $_SERVER['REQUEST_URI'] );
+	?>
+		<ul class="subsubsub">
+			<li class="all"><a href="<?php echo esc_attr( esc_url( $redirect_to ) ); ?>" class="<?php if ( 'spam' != $this->view ) echo 'current'; ?>"><?php _e( 'All', 'buddypress' ); ?></a> |</li>
+			<li class="spam"><a href="<?php echo esc_attr( esc_url( add_query_arg( 'activity_status', 'spam', $redirect_to ) ) ); ?>" class="<?php if ( 'spam' == $this->view ) echo 'current'; ?>"><?php printf( __( 'Spam <span class="count">(%s)</span>', 'buddypress' ), number_format_i18n( $this->spam_count ) ); ?></a></li>
+
+			<?php do_action( 'bp_activity_list_table_get_views', $redirect_to, $this->view ); ?>
+		</ul>
+	<?php
+	}
+
+		/**
+	 * Get bulk actions
+	 *
+	 * @return array Key/value pairs for the bulk actions dropdown
+	 * @since 1.6
+	 */
+	function get_bulk_actions() {
+		$actions = array();
+		$actions['bulk_spam']   = __( 'Mark as Spam', 'buddypress' );
+		$actions['bulk_ham']    = __( 'Not Spam', 'buddypress' );
+		$actions['bulk_delete'] = __( 'Delete Permanently', 'buddypress' );
+
+		return apply_filters( 'bp_activity_list_table_get_bulk_actions', $actions );
+	}
+
+	/**
+	 * Get the table column titles.
+	 *
+	 * @see WP_List_Table::single_row_columns()
+	 * @return array
+	 * @since 1.6
+	 */
+	function get_columns() {
+		return array(
+			'cb'       => '<input name type="checkbox" />',
+			'author'   => __( 'Author', 'buddypress' ),
+			'comment'  => __( 'Activity', 'buddypress' ),
+			'response' => __( 'In Response To', 'buddypress' ),
+		);
+	}
+
+	/**
+	 * Get the column names for sortable columns
+	 *
+	 * @return array
+	 * @since 1.6
+	 * @todo For this to work, BP_Activity_Activity::get() needs updating to supporting ordering by specific fields
+	 */
+	function get_sortable_columns() {
+		return array();
+
+		/*return array(
+			'author' => array( 'activity_author', false ),  // Intentionally not using "=>"
+		);*/
+	}
+
+	/**
+	 * Markup for the "filter" part of the form (i.e. which activity type to display)
+	 *
+	 * @global object $bp BuddyPress global settings
+	 * @param string $which 'top' or 'bottom'
+	 * @since 1.6
+	 */
+	function extra_tablenav( $which ) {
+		global $bp;
+
+		if ( 'bottom' == $which )
+			return;
+
+		$actions  = array();
+		$selected = !empty( $_REQUEST['activity_type'] ) ? $_REQUEST['activity_type'] : '';
+
+		// Walk through the registered actions, and build an array of actions/values.
+		foreach ( $bp->activity->actions as $action ) {
+			$action = array_values( (array) $action );
+
+			for ( $i = 0, $i_count = count( $action ); $i < $i_count; $i++ )
+				$actions[ $action[$i]['key'] ] = $action[$i]['value'];
+		}
+
+		// This was a mis-named activity type from before BP 1.6
+		unset( $actions['friends_register_activity_action'] );
+
+		// This type has not been used since BP 1.0.3. It will be re-instated in a future version.
+		unset( $actions['updated_profile'] );
+
+		// Sort array by the human-readable value
+		natsort( $actions );
+	?>
+
+		<div class="alignleft actions">
+			<select name="activity_type">
+				<option value="" <?php selected( !$selected ); ?>><?php _e( 'Show all activity types', 'buddypress' ); ?></option>
+
+				<?php foreach ( $actions as $k => $v ) : ?>
+					<option value="<?php echo esc_attr( $k ); ?>" <?php selected( $k,  $selected ); ?>><?php echo esc_html( $v ); ?></option>
+				<?php endforeach; ?>
+			</select>
+
+			<?php submit_button( __( 'Filter', 'buddypress' ), 'secondary', false, false, array( 'id' => 'post-query-submit' ) ); ?>
+		</div>
+
+	<?php
+	}
+
+	/**
+	 * Checkbox column
+	 *
+	 * @param array $item A singular item (one full row)
+	 * @see WP_List_Table::single_row_columns()
+	 * @since 1.6
+	 */
+	function column_cb( $item ) {
+		printf( '<input type="checkbox" name="aid[]" value="%d" />', (int) $item['id'] );
+	}
+
+	/**
+	 * Author column
+	 *
+	 * @param array $item A singular item (one full row)
+	 * @see WP_List_Table::single_row_columns()
+	 * @since 1.6
+	 */
+	function column_author( $item ) {
+		echo '<strong>' . get_avatar( $item['user_id'], '32' ) . ' ' . bp_core_get_userlink( $item['user_id'] ) . '</strong>';
+	}
+
+	/**
+	 * Content column, and "quick admin" rollover actions.
+	 *
+	 * Called "comment" in the CSS so we can re-use some WP core CSS.
+	 *
+	 * @param array $item A singular item (one full row)
+	 * @see WP_List_Table::single_row_columns()
+	 * @since 1.6
+	 */
+	function column_comment( $item ) {
+		// Determine what type of item (row) we're dealing with
+		if ( $item['is_spam'] )
+			$item_status = 'spam';
+		else
+			$item_status = 'all';
+
+		// Preorder items: Reply | Edit | Spam | Delete Permanently
+		$actions = array(
+			'reply'  => '',
+			'edit'   => '',
+			'spam'   => '', 'unspam' => '',
+			'delete' => '',
+		);
+
+		// Build actions URLs
+		$base_url   = network_admin_url( 'admin.php?page=bp-activity&amp;aid=' . $item['id'] );
+		$spam_nonce = esc_html( '_wpnonce=' . wp_create_nonce( 'spam-activity_' . $item['id'] ) );
+
+		$delete_url = $base_url . "&amp;action=delete&amp;$spam_nonce";
+		$edit_url   = $base_url . '&amp;action=edit';
+		$ham_url    = $base_url . "&amp;action=ham&amp;$spam_nonce";
+		$spam_url   = $base_url . "&amp;action=spam&amp;$spam_nonce";
+
+		// Rollover actions
+
+		// Reply - javascript only; implemented by AJAX.
+		if ( 'spam' != $item_status ) {
+			$actions['reply'] = sprintf( '<a href="#" class="reply hide-if-no-js">%s</a>', __( 'Reply', 'buddypress' ) );
+
+			// Edit
+			$actions['edit'] = sprintf( '<a href="%s">%s</a>', $edit_url, __( 'Edit', 'buddypress' ) );
+		}
+
+		// Spam/unspam
+		if ( 'spam' == $item_status )
+			$actions['unspam'] = sprintf( '<a href="%s">%s</a>', $ham_url, __( 'Not Spam', 'buddypress' ) );
+		else
+			$actions['spam'] = sprintf( '<a href="%s">%s</a>', $spam_url, __( 'Spam', 'buddypress' ) );
+
+		// Delete
+		$actions['delete'] = sprintf( '<a href="%s" onclick="%s">%s</a>', $delete_url, "javascript:return confirm('" . esc_js( __( 'Are you sure?', 'buddypress' ) ) . "'); ", __( 'Delete Permanently', 'buddypress' ) );
+
+		// Start timestamp
+		echo '<div class="submitted-on">';
+
+		// Other plugins can filter which actions are shown
+		$actions = apply_filters( 'bp_activity_admin_comment_row_actions', array_filter( $actions ), $item );
+
+		/* translators: 2: activity admin ui date/time */
+		printf( __( 'Submitted on <a href="%1$s">%2$s at %3$s</a>', 'buddypress' ), bp_get_root_domain() . '/' . bp_get_activity_root_slug() . '/p/' . $item['id'] . '/', date_i18n( get_option( 'date_format' ), strtotime( $item['date_recorded'] ) ), date_i18n( get_option( 'time_format' ), strtotime( $item['date_recorded'] ) ) );
+
+		// End timestamp
+		echo '</div>';
+
+		// Get activity content - if not set, use the action
+		if ( ! empty( $item['content'] ) )
+			$content = apply_filters_ref_array( 'bp_get_activity_content_body', array( $item['content'] ) );
+		else
+			$content = apply_filters_ref_array( 'bp_get_activity_action', array( $item['action'] ) );
+
+		echo $content . ' ' . $this->row_actions( $actions );
+	}
+
+	/**
+	 * "In response to" column
+	 *
+	 * @param array $item A singular item (one full row)
+	 * @see WP_List_Table::single_row_columns()
+	 * @since 1.6
+	 */
+	function column_response( $item ) {
+		// Is $item is a root activity?
+		if ( empty( $item['item_id'] ) || ! in_array( $item['type'], apply_filters( 'bp_activity_admin_root_activity_types', array( 'activity_comment' ), $item ) ) ) {
+			$comment_count     = !empty( $item['children'] ) ? bp_activity_recurse_comment_count( (object) $item ) : 0;
+			$root_activity_url = network_admin_url( 'admin.php?page=bp-activity&amp;aid=' . $item['id'] );
+
+			// If the activity has comments, display a link to the activity's permalink, with its comment count in a speech bubble
+			if ( $comment_count ) {
+				$title_attr = sprintf( _n( '%s related activity', '%s related activities', $comment_count, 'buddypress' ), number_format_i18n( $comment_count ) );
+				printf( '<a href="%1$s" title="%2$s" class="post-com-count"><span class="comment-count">%3$s</span></a>', esc_attr( $root_activity_url ), esc_attr( $title_attr ), number_format_i18n( $comment_count ) );
+			}
+
+		// For non-root activities, display a link to the replied-to activity's author's profile
+		} else {
+			echo '<strong>' . get_avatar( $this->get_activity_user_id( $item['item_id'] ), '32' ) . ' ' . bp_core_get_userlink( $this->get_activity_user_id( $item['item_id'] ) ) . '</strong><br />';
+		}
+
+		// Activity permalink
+		if ( ! $item['is_spam'] )
+			printf( __( '<a href="%1$s">View Activity</a>', 'buddypress' ), bp_activity_get_permalink( $item['id'], (object) $item ) );
+	}
+
+	/**
+	 * A wrapper function for the BP_Activity_List_Table to get the specified activity's user ID.
+	 *
+	 * @param int $activity_id Activity ID to retrieve User ID for
+	 * @since 1.6
+	 */
+	protected function get_activity_user_id( $activity_id ) {
+		// If there is an existing activity/user ID mapping, just return the user ID.
+		if ( ! empty( $this->activity_user_id[$activity_id] ) ) {
+			return $this->activity_user_id[$activity_id];
+
+		/**
+		 * We don't have a mapping. This means the $activity_id is not on the current
+		 * page of results, so fetch its details from the database.
+		 */
+		} else {
+			$activity = bp_activity_get_specific( array( 'activity_ids' => $activity_id, 'show_hidden' => true, 'spam' => 'all', ) );
+
+			/**
+			 * If, somehow, the referenced activity has been deleted, leaving its associated
+			 * activites as orphans, use the logged in user's ID to avoid errors.
+			 */
+			if ( empty( $activity['activities'] ) )
+				return bp_loggedin_user_id();
+
+			// Store the new activity/user ID mapping for any later re-use
+			$this->activity_user_id[ $activity['activities'][0]->id ] = $activity['activities'][0]->user_id;
+
+			// Return the user ID
+			return $activity['activities'][0]->user_id;
+		}
+	}
+
+	/**
+	 * Helper function to flatten all activites returned from bp_activity_get() into a single array.
+	 *
+	 * @param array $tree Source array
+	 * @return array Flattened array
+	 * @since 1.6
+	 */
+	public static function flatten_activity_array( $tree ){
+		foreach ( (array) $tree as $node ) {
+			if ( isset( $node->children ) ) {
+
+				foreach ( BP_Activity_List_Table::flatten_activity_array( $node->children ) as $child ) {
+					$tree[] = $child;
+				}
+
+				unset( $node->children );
+			}
+		}
+
+		return $tree;
+	}
+}
+?>
\ No newline at end of file
diff --git a/wp-content/plugins/buddypress/bp-activity/bp-activity-akismet.php b/wp-content/plugins/buddypress/bp-activity/bp-activity-akismet.php
new file mode 100644
index 0000000000000000000000000000000000000000..c78ffe41dd77896f0a221cc6f5060111a7598acf
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-activity/bp-activity-akismet.php
@@ -0,0 +1,587 @@
+<?php
+/**
+ * Akismet support for BuddyPress' Activity Stream
+ *
+ * @package BuddyPress
+ * @since 1.6
+ * @subpackage Activity
+ */
+
+// Exit if accessed directly
+if ( !defined( 'ABSPATH' ) ) exit;
+
+class BP_Akismet {
+	/**
+	 * The activity last marked as spam
+	 *
+	 * @access protected
+	 * @var BP_Activity_Activity
+	 * @since 1.6
+	 */
+	protected $last_activity = null;
+
+	/**
+	 * Constructor
+	 *
+	 * @since 1.6
+	 */
+	public function __construct() {
+		$this->setup_actions();
+	}
+
+	/**
+	 * Hook Akismet into the activity stream
+	 *
+	 * @since 1.6
+	 */
+	protected function setup_actions() {
+		// Add nonces to activity stream lists
+		add_action( 'bp_after_activity_post_form', array( $this, 'add_activity_stream_nonce' ) );
+		add_action( 'bp_activity_entry_comments',  array( $this, 'add_activity_stream_nonce' ) );
+
+		// Add a "mark as spam" button to individual activity items
+		add_action( 'bp_activity_entry_meta',      array( $this, 'add_activity_spam_button' ) );
+		add_action( 'bp_activity_comment_options', array( $this, 'add_activity_comment_spam_button' ) );
+
+		// Check activity for spam
+		add_action( 'bp_activity_before_save',     array( $this, 'check_activity' ), 4, 1 );
+
+		// Tidy up member's latest (activity) update
+		add_action( 'bp_activity_posted_update',   array( $this, 'check_member_activity_update' ), 1, 3 );
+
+		// Hooks to extend Activity core spam/ham functions for Akismet
+		add_action( 'bp_activity_mark_as_spam',    array( $this, 'mark_as_spam' ), 10, 2 );
+		add_action( 'bp_activity_mark_as_ham',     array( $this, 'mark_as_ham' ),  10, 2 );
+
+		// Hook into the Activity wp-admin screen
+		add_action( 'bp_activity_admin_comment_row_actions', array( $this, 'comment_row_action' ), 10, 2 );
+		add_action( 'bp_activity_admin_load',                array( $this, 'add_history_metabox' ) );
+	}
+
+	/**
+	 * Add a history item to the hover links in an activity's row.
+	 *
+	 * This function lifted with love from the Akismet WordPress plugin's
+	 * akismet_comment_row_action() function. Thanks!
+	 *
+	 * @param array $actions The hover links
+	 * @param array $activity The activity for the current row being processed
+	 * @return array The hover links
+	 * @since 1.6
+	 */
+	function comment_row_action( $actions, $activity ) {
+		$akismet_result = bp_activity_get_meta( $activity['id'], '_bp_akismet_result' );
+		$user_result    = bp_activity_get_meta( $activity['id'], '_bp_akismet_user_result' );
+		$desc           = '';
+
+		if ( !$user_result || $user_result == $akismet_result ) {
+			// Show the original Akismet result if the user hasn't overridden it, or if their decision was the same
+			if ( 'true' == $akismet_result && $activity['is_spam'] )
+				$desc = __( 'Flagged as spam by Akismet', 'buddypress' );
+
+			elseif ( 'false' == $akismet_result && !$activity['is_spam'] )
+				$desc = __( 'Cleared by Akismet', 'buddypress' );
+
+		} else {
+			$who = bp_activity_get_meta( $activity['id'], '_bp_akismet_user' );
+
+			if ( 'true' == $user_result )
+				$desc = sprintf( __( 'Flagged as spam by %s', 'buddypress' ), $who );
+			else
+				$desc = sprintf( __( 'Un-spammed by %s', 'buddypress' ), $who );
+		}
+
+		// add a History item to the hover links, just after Edit
+		if ( $akismet_result ) {
+			$b = array();
+			foreach ( $actions as $k => $item ) {
+				$b[ $k ] = $item;
+				if ( $k == 'edit' )
+					$b['history'] = '<a href="' . network_admin_url( 'admin.php?page=bp-activity&amp;action=edit&aid=' . $activity['id'] ) . '#bp_activity_history"> '. __( 'History', 'buddypress' ) . '</a>';
+			}
+
+			$actions = $b;
+		}
+
+		if ( $desc )
+			echo '<span class="akismet-status"><a href="' . network_admin_url( 'admin.php?page=bp-activity&amp;action=edit&aid=' . $activity['id'] ) . '#bp_activity_history">' . htmlspecialchars( $desc ) . '</a></span>';
+
+		return apply_filters( 'bp_akismet_comment_row_action', $actions );
+	}
+
+	/**
+	 * Adds a nonce to the member profile status form, and to the reply form of each activity stream item.
+	 * This is used by Akismet to help detect spam activity.
+	 *
+	 * @see http://plugins.trac.wordpress.org/ticket/1232
+	 * @since 1.6
+	 */
+	public function add_activity_stream_nonce() {
+		$form_id = '_bp_as_nonce'; 
+		$value   = '_bp_as_nonce_' . bp_loggedin_user_id();
+
+		// If we're in the activity stream loop, we can use the current item's ID to make the nonce unique
+		if ( 'bp_activity_entry_comments' == current_filter() ) {
+			$form_id .= '_' . bp_get_activity_id();
+			$value   .= '_' . bp_get_activity_id();
+		}
+
+		wp_nonce_field( $value, $form_id, false );
+	}
+
+	/**
+	 * Check the member's latest (activity) update to see if it's the item that was (just) marked as spam.
+	 *
+	 * This can't be done in BP_Akismet::check_activity() due to BP-Default's AJAX implementation; see bp_dtheme_post_update().
+	 *
+	 * @param string $content Activity update text
+	 * @param int $user_id User ID
+	 * @param int $activity_id Activity ID
+	 * @see bp_dtheme_post_update()
+	 * @since 1.6
+	 */
+	public function check_member_activity_update( $content, $user_id, $activity_id ) {
+		// By default, only handle activity updates and activity comments.
+		if ( empty( $this->last_activity ) || !in_array( $this->last_activity->type, BP_Akismet::get_activity_types() ) )
+			return;
+
+		// Was this $activity_id just marked as spam? If not, bail out.
+		if ( !$this->last_activity->id || $activity_id != $this->last_activity->id || 'false' == $this->last_activity->akismet_submission['bp_as_result'] )
+			return;
+
+		// It was, so delete the member's latest activity update.
+		bp_delete_user_meta( $user_id, 'bp_latest_update' );
+	}
+
+	/**
+	 * Adds a "mark as spam" button to each activity item for site admins.
+	 *
+	 * This function is intended to be used inside the activity stream loop.
+	 *
+	 * @since 1.6
+	 */
+	public function add_activity_spam_button() {
+		if ( !bp_activity_user_can_mark_spam() )
+			return;
+
+		// By default, only handle activity updates and activity comments.
+		if ( !in_array( bp_get_activity_type(), BP_Akismet::get_activity_types() ) )
+			return;
+
+		bp_button(
+			array(
+				'block_self' => false,
+				'component'  => 'activity',
+				'id'         => 'activity_make_spam_' . bp_get_activity_id(),
+				'link_class' => 'bp-secondary-action spam-activity confirm button item-button',
+				'link_href'  => wp_nonce_url( bp_get_root_domain() . '/' . bp_get_activity_slug() . '/spam/' . bp_get_activity_id() . '/', 'bp_activity_akismet_spam_' . bp_get_activity_id() ),
+				'link_text'  => __( 'Spam', 'buddypress' ),
+				'wrapper'    => false,
+			)
+		);
+	}
+
+	/**
+	 * Adds a "mark as spam" button to each activity COMMENT item for site admins.
+	 *
+	 * This function is intended to be used inside the activity stream loop.
+	 *
+	 * @since 1.6
+	 */
+	public function add_activity_comment_spam_button() {
+		if ( !bp_activity_user_can_mark_spam() )
+			return;
+
+		// By default, only handle activity updates and activity comments.
+		$current_comment = bp_activity_current_comment();
+		if ( empty( $current_comment ) || !in_array( $current_comment->type, BP_Akismet::get_activity_types() ) )
+			return;
+
+		bp_button(
+			array(
+				'block_self' => false,
+				'component'  => 'activity',
+				'id'         => 'activity_make_spam_' . bp_get_activity_comment_id(),
+				'link_class' => 'bp-secondary-action spam-activity-comment confirm',
+				'link_href'  => wp_nonce_url( bp_get_root_domain() . '/' . bp_get_activity_slug() . '/spam/' . bp_get_activity_comment_id() . '/?cid=' . bp_get_activity_comment_id(), 'bp_activity_akismet_spam_' . bp_get_activity_comment_id() ),
+				'link_text'  => __( 'Spam', 'buddypress' ),
+				'wrapper'    => false,
+			)
+		);
+	}
+
+	/**
+	 * Get a list of filterable types of activity item that we want Akismet to automatically check for spam.
+	 *
+	 * @return array List of activity types
+	 * @since 1.6
+	 * @static
+	 */
+	public static function get_activity_types() {
+		return apply_filters( 'bp_akismet_get_activity_types', array( 'activity_comment', 'activity_update' ) );
+	}
+
+	/**
+	 * Mark activity item as spam
+	 *
+	 * @param BP_Activity_Activity $activity
+	 * @param string $source Either "by_a_person" (e.g. a person has manually marked the activity as spam) or "by_akismet" (automatically spammed).
+	 * @since 1.6
+	 */
+	public function mark_as_spam( $activity, $source ) {
+		// Record this item so we can do some tidyup in BP_Akismet::check_member_activity_update()
+		$this->last_activity = $activity;
+
+		do_action( 'bp_activity_akismet_mark_as_spam', $activity, $source );
+	}
+
+	/**
+	 * Mark activity item as ham
+	 *
+	 * @param BP_Activity_Activity $activity
+	 * @param string $source Either "by_a_person" (e.g. a person has manually marked the activity as ham) or "by_akismet" (automatically hammed).
+	 * @since 1.6
+	 */
+	public function mark_as_ham( $activity, $source ) {
+		// If the activity was, originally, automatically marked as spam by Akismet, run the @mentions filter as it would have been skipped.
+		if ( 'true' == bp_activity_get_meta( $activity->id, '_bp_akismet_result' ) && !bp_activity_get_meta( $activity->id, '_bp_akismet_user_result' ) )
+			$activity->content = bp_activity_at_name_filter( $activity->content, $activity->id );
+
+		do_action( 'bp_activity_akismet_mark_as_ham', $activity, $source );
+	} 
+
+	/**
+	 * Build a data package for the Akismet service to inspect
+	 *
+	 * @param BP_Activity_Activity $activity
+	 * @see http://akismet.com/development/api/#comment-check
+	 * @since 1.6
+	 * @static
+	 */
+	public static function build_akismet_data_package( $activity ) {
+		$userdata = get_userdata( $activity->user_id );
+
+		$activity_data                          = array();
+		$activity_data['akismet_comment_nonce'] = 'inactive';
+		$activity_data['comment_author']        = $userdata->display_name;
+		$activity_data['comment_author_email']  = $userdata->user_email;
+		$activity_data['comment_author_url']    = bp_core_get_userlink( $userdata->ID, false, true);
+		$activity_data['comment_content']       = $activity->content;
+		$activity_data['comment_type']          = $activity->type;
+		$activity_data['permalink']             = bp_activity_get_permalink( $activity->id, $activity );
+		$activity_data['user_ID']               = $userdata->ID;
+		$activity_data['user_role']             = akismet_get_user_roles( $userdata->ID );
+
+		/**
+		 * Get the nonce if the new activity was submitted through the "what's up, Paul?" form.
+		 * This helps Akismet ensure that the update was a valid form submission.
+		 */
+		if ( !empty( $_POST['_bp_as_nonce'] ) )
+			$activity_data['akismet_comment_nonce'] = wp_verify_nonce( $_POST['_bp_as_nonce'], "_bp_as_nonce_{$userdata->ID}" ) ? 'passed' : 'failed';
+
+		/**
+		 * If the new activity was a reply to an existing item, check the nonce with the activity parent ID.
+		 * This helps Akismet ensure that the update was a valid form submission.
+		 */
+		elseif ( !empty( $activity->secondary_item_id ) && !empty( $_POST['_bp_as_nonce_' . $activity->secondary_item_id] ) )
+			$activity_data['akismet_comment_nonce'] = wp_verify_nonce( $_POST["_bp_as_nonce_{$activity->secondary_item_id}"], "_bp_as_nonce_{$userdata->ID}_{$activity->secondary_item_id}" ) ? 'passed' : 'failed';
+
+		return apply_filters( 'bp_akismet_build_akismet_data_package', $activity_data, $activity );
+	}
+
+	/**
+	 * Check if the activity item is spam or ham
+	 *
+	 * @param BP_Activity_Activity $activity The activity item to check
+	 * @see http://akismet.com/development/api/
+	 * @since 1.6
+	 * @todo Spam counter?
+	 * @todo Auto-delete old spam?
+	 */
+	public function check_activity( $activity ) {
+		// By default, only handle activity updates and activity comments.
+		if ( !in_array( $activity->type, BP_Akismet::get_activity_types() ) )
+			return;
+
+		// Make sure last_activity is clear to avoid any confusion
+		$this->last_activity = null;
+
+		// Build data package for Akismet
+		$activity_data = BP_Akismet::build_akismet_data_package( $activity );
+
+		// Check with Akismet to see if this is spam
+		$activity_data = $this->send_akismet_request( $activity_data, 'check', 'spam' );
+
+		// Record this item
+		$this->last_activity = $activity;
+
+		// Store a copy of the data that was submitted to Akismet
+		$this->last_activity->akismet_submission = $activity_data;
+
+		// Spam
+		if ( 'true' == $activity_data['bp_as_result'] ) {
+			// Action for plugin authors
+			do_action_ref_array( 'bp_activity_akismet_spam_caught', array( &$activity, $activity_data ) );
+
+			// Mark as spam
+			bp_activity_mark_as_spam( $activity, 'by_akismet' );
+		}
+
+		// Update activity meta after a spam check
+		add_action( 'bp_activity_after_save', array( $this, 'update_activity_akismet_meta' ), 1, 1 );
+	}
+
+	/**
+	 * Update activity meta after a manual spam change (user initiated)
+	 *
+	 * @param BP_Activity_Activity $activity The activity to check
+	 * @since 1.6
+	 */
+	public function update_activity_spam_meta( $activity ) {
+		// By default, only handle activity updates and activity comments.
+		if ( !in_array( $activity->type, BP_Akismet::get_activity_types() ) )
+			return;
+
+		$this->update_activity_history( $activity->id, sprintf( __( '%s reported this activity as spam', 'buddypress' ), bp_get_loggedin_user_username() ), 'report-spam' );
+		bp_activity_update_meta( $activity->id, '_bp_akismet_user_result', 'true' );
+		bp_activity_update_meta( $activity->id, '_bp_akismet_user', bp_get_loggedin_user_username() );
+	}
+
+	/**
+	 * Update activity meta after a manual ham change (user initiated)
+	 *
+	 * @param BP_Activity_Activity $activity The activity to check
+	 * @since 1.6
+	 */
+	public function update_activity_ham_meta( $activity ) {
+		// By default, only handle activity updates and activity comments.
+		if ( !in_array( $activity->type, BP_Akismet::get_activity_types() ) )
+			return;
+
+		$this->update_activity_history( $activity->id, sprintf( __( '%s reported this activity as not spam', 'buddypress' ), bp_get_loggedin_user_username() ), 'report-ham' );
+		bp_activity_update_meta( $activity->id, '_bp_akismet_user_result', 'false' );
+		bp_activity_update_meta( $activity->id, '_bp_akismet_user', bp_get_loggedin_user_username() );
+	}
+
+	/**
+	 * Update activity meta after an automatic spam check (not user initiated)
+	 *
+	 * @param BP_Activity_Activity $activity The activity to check
+	 * @since 1.6
+	 */
+	public function update_activity_akismet_meta( $activity ) {
+		// Check we're dealing with what was last updated by Akismet
+		if ( empty( $this->last_activity ) || !empty( $this->last_activity ) && $activity->id != $this->last_activity->id )
+			return;
+
+		// By default, only handle activity updates and activity comments.
+		if ( !in_array( $this->last_activity->type, BP_Akismet::get_activity_types() ) )
+			return;
+
+		// Spam
+		if ( 'true' == $this->last_activity->akismet_submission['bp_as_result'] ) {
+			bp_activity_update_meta( $activity->id, '_bp_akismet_result', 'true' );
+			$this->update_activity_history( $activity->id, __( 'Akismet caught this item as spam', 'buddypress' ), 'check-spam' );
+
+		// Not spam
+		} elseif ( 'false' == $this->last_activity->akismet_submission['bp_as_result'] ) {
+			bp_activity_update_meta( $activity->id, '_bp_akismet_result', 'false' );
+			$this->update_activity_history( $activity->id, __( 'Akismet cleared this item', 'buddypress' ), 'check-ham' );
+
+		// Uh oh, something's gone horribly wrong. Unexpected result.
+		} else {
+			bp_activity_update_meta( $activity->id, '_bp_akismet_error', bp_core_current_time() );
+			$this->update_activity_history( $activity->id, sprintf( __( 'Akismet was unable to check this item (response: %s), will automatically retry again later.', 'buddypress' ), $this->last_activity->akismet_submission['bp_as_result'] ), 'check-error' );
+		}
+
+		// Record the original data which was submitted to Akismet for checking
+		bp_activity_update_meta( $activity->id, '_bp_akismet_submission', $this->last_activity->akismet_submission );
+	}
+
+	/**
+	 * Contact Akismet to check if this is spam or ham
+	 *
+	 * Props to WordPress core Akismet plugin for alot of this
+	 *
+	 * @global string $akismet_api_host
+	 * @global string $akismet_api_port
+	 * @param array $activity_data Packet of information to submit to Akismet
+	 * @param string $check "check" or "submit"
+	 * @param string $spam "spam" or "ham"
+	 * @since 1.6
+	 */
+	public function send_akismet_request( $activity_data, $check = 'check', $spam = 'spam' ) {
+		global $akismet_api_host, $akismet_api_port;
+
+		// Check that host and port are set, if not, set them
+		if ( function_exists( 'akismet_init' ) && ( empty( $akismet_api_host ) || empty( $akismet_api_port ) ) )
+			akismet_init();
+
+		$query_string = $path = $response = '';
+
+		$activity_data['blog']         = bp_get_option( 'home' );
+		$activity_data['blog_charset'] = bp_get_option( 'blog_charset' );
+		$activity_data['blog_lang']    = get_locale();
+		$activity_data['referrer']     = $_SERVER['HTTP_REFERER'];
+		$activity_data['user_agent']   = bp_core_current_user_ua();
+		$activity_data['user_ip']      = bp_core_current_user_ip();
+
+		if ( akismet_test_mode() )
+			$activity_data['is_test'] = 'true';
+
+		// Loop through _POST args and rekey strings
+		foreach ( $_POST as $key => $value )
+			if ( is_string( $value ) && 'cookie' != $key )
+				$activity_data['POST_' . $key] = $value;
+
+		// Keys to ignore
+		$ignore = array( 'HTTP_COOKIE', 'HTTP_COOKIE2', 'PHP_AUTH_PW' );
+
+		// Loop through _SERVER args and remove whitelisted keys
+		foreach ( $_SERVER as $key => $value ) {
+
+			// Key should not be ignored
+			if ( !in_array( $key, $ignore ) && is_string( $value ) ) {
+				$activity_data[$key] = $value;
+
+			// Key should be ignored
+			} else {
+				$activity_data[$key] = '';
+			}
+		}
+
+		foreach ( $activity_data as $key => $data )
+			$query_string .= $key . '=' . urlencode( stripslashes( $data ) ) . '&';
+
+		if ( 'check' == $check )
+			$path = '/1.1/comment-check';
+		elseif ( 'submit' == $check )
+			$path = '/1.1/submit-' . $spam;
+
+		// Send to Akismet
+		add_filter( 'akismet_ua', array( $this, 'buddypress_ua' ) );
+		$response = akismet_http_post( $query_string, $akismet_api_host, $path, $akismet_api_port );
+		remove_filter( 'akismet_ua', array( $this, 'buddypress_ua' ) );
+
+		// Get the response
+		if ( ! empty( $response[1] ) && ! is_wp_error( $response[1] ) )
+			$activity_data['bp_as_result'] = $response[1];
+		else
+			$activity_data['bp_as_result'] = false;
+
+		// Perform a daily tidy up
+		if ( ! wp_next_scheduled( 'bp_activity_akismet_delete_old_metadata' ) )
+			wp_schedule_event( time(), 'daily', 'bp_activity_akismet_delete_old_metadata' );
+
+		return $activity_data;
+	}
+
+	/**
+	 * Filters user agent when sending to Akismet.
+	 *
+	 * @param string $user_agent
+	 * @since 1.6
+	 */
+	public function buddypress_ua( $user_agent ) {
+		$user_agent = 'BuddyPress/' . bp_get_version() . ' | Akismet/'. constant( 'AKISMET_VERSION' );
+		return $user_agent;
+	}
+
+	/**
+	 * Adds a "History" meta box to the activity edit screen.
+	 *
+	 * @param string $screen_action The type of screen that has been requested
+	 * @since 1.6
+	 */
+	function add_history_metabox( $screen_action ) {
+		// Only proceed if we're on the edit screen
+		if ( 'edit' != $screen_action )
+			return;
+
+		// Display meta box with a low priority (low position on screen by default)
+		add_meta_box( 'bp_activity_history',  __( 'Activity History', 'buddypress' ), array( $this, 'history_metabox' ), get_current_screen()->id, 'normal', 'low' );
+	}
+
+	/**
+	 * History meta box for the Activity admin edit screen
+	 *
+	 * @param object $item Activity item
+	 * @since 1.6
+	 * @todo Update activity meta to allow >1 record with the same key (iterate through $history).
+	 * @see http://buddypress.trac.wordpress.org/ticket/3907
+	 */
+	function history_metabox( $item ) {
+		$history = BP_Akismet::get_activity_history( $item->id );
+
+		if ( empty( $history ) )
+			return;
+
+		echo '<div class="akismet-history"><div>';
+		printf( _x( '<span>%1$s</span> &mdash; %2$s', 'x hours ago - akismet cleared this item', 'buddypress' ), bp_core_time_since( $history[2] ), esc_html( $history[1] ) );
+		echo '</div></div>';
+	}
+
+	/**
+	 * Update an activity item's Akismet history
+	 *
+	 * @param int $activity_id Activity item ID
+	 * @param string $message Human-readable description of what's changed
+	 * @param string $event The type of check we were carrying out
+	 * @since 1.6
+	 */
+	public function update_activity_history( $activity_id = 0, $message = '', $event = '' ) {
+		$event = array(
+			'event'   => $event,
+			'message' => $message,
+			'time'    => akismet_microtime(),
+			'user'    => bp_loggedin_user_id(),
+		);
+
+		// Save the history data
+		bp_activity_update_meta( $activity_id, '_bp_akismet_history', $event );
+	}
+
+	/**
+	 * Get an activity item's Akismet history
+	 *
+	 * @param int $activity_id Activity item ID
+	 * @return array The activity item's Akismet history
+	 * @since 1.6
+	 */
+	public function get_activity_history( $activity_id = 0 ) {
+		$history = bp_activity_get_meta( $activity_id, '_bp_akismet_history' );
+		if ( $history === false )
+			$history = array();
+
+		// Sort it by the time recorded
+		usort( $history, 'akismet_cmp_time' );
+
+		return $history;
+	}
+}
+
+/**
+ * Deletes old spam activity meta data, as _bp_akismet_submission meta can be large.
+ *
+ * @global object $bp BuddyPress global settings
+ * @global wpdb $wpdb WordPress database object
+ * @since 1.6
+ */
+function bp_activity_akismet_delete_old_metadata() {
+	global $bp, $wpdb;
+
+	$interval = apply_filters( 'bp_activity_akismet_delete_meta_interval', 15 );
+
+	// Enforce a minimum of 1 day
+	$interval = max( 1, absint( $interval ) );
+
+	// _bp_akismet_submission meta values are large, so expire them after $interval days regardless of the activity status 
+	$sql          = $wpdb->prepare( "SELECT a.id FROM {$bp->activity->table_name} a LEFT JOIN {$bp->activity->table_name_meta} m ON a.id = m.activity_id WHERE m.meta_key = %s AND DATE_SUB(%s, INTERVAL {$interval} DAY) > a.date_recorded LIMIT 10000", '_bp_akismet_submission', current_time( 'mysql', 1 ) );
+	$activity_ids = $wpdb->get_col( $sql );
+
+	if ( ! empty( $activity_ids ) ) {
+		foreach ( $activity_ids as $activity_id )
+			bp_activity_delete_meta( $activity_id, '_bp_akismet_submission' );
+	}
+}
+?>
\ No newline at end of file
diff --git a/wp-content/plugins/buddypress/bp-activity/bp-activity-cache.php b/wp-content/plugins/buddypress/bp-activity/bp-activity-cache.php
new file mode 100644
index 0000000000000000000000000000000000000000..6c7f43d90a88b8e758ab851d45e936d5c08828d8
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-activity/bp-activity-cache.php
@@ -0,0 +1,39 @@
+<?php
+
+/**
+ * Functions related to the BuddyPress Activity component and the WP Cache
+ *
+ * @since 1.6
+ */
+
+// Exit if accessed directly
+if ( !defined( 'ABSPATH' ) ) exit;
+
+/**
+ * Slurps up activitymeta
+ *
+ * This function is called in two places in the BP_Groups_Group class:
+ *   - in the populate() method, when single group objects are populated
+ *   - in the get() method, when multiple groups are queried
+ *
+ * It grabs all groupmeta associated with all of the groups passed in $group_ids and adds it to
+ * the WP cache. This improves efficiency when using groupmeta inline
+ *
+ * @param int|str|array $group_ids Accepts a single group_id, or a comma-separated list or array of
+ *    group ids
+ */
+function bp_activity_update_meta_cache( $activity_ids = false ) {
+	global $bp;
+
+	$cache_args = array(
+		'object_ids' 	   => $activity_ids,
+		'object_type' 	   => $bp->activity->id,
+		'object_column'    => 'activity_id',
+		'meta_table' 	   => $bp->activity->table_name_meta,
+		'cache_key_prefix' => 'bp_activity_meta'
+	);
+	
+	bp_update_meta_cache( $cache_args );
+}
+
+?>
\ No newline at end of file
diff --git a/wp-content/plugins/buddypress/bp-activity/bp-activity-classes.php b/wp-content/plugins/buddypress/bp-activity/bp-activity-classes.php
index bba59089efb5957082ade89fdba7a7f9ffe4e480..63645cf08f98accc4cf675fea457e2d4d75e56bd 100644
--- a/wp-content/plugins/buddypress/bp-activity/bp-activity-classes.php
+++ b/wp-content/plugins/buddypress/bp-activity/bp-activity-classes.php
@@ -1,16 +1,15 @@
 <?php
-
 /**
  * BuddyPress Activity Classes
  *
  * @package BuddyPress
- * @subpackage ActivityClasses
+ * @subpackage Activity
  */
 
 // Exit if accessed directly
 if ( !defined( 'ABSPATH' ) ) exit;
 
-Class BP_Activity_Activity {
+class BP_Activity_Activity {
 	var $id;
 	var $item_id;
 	var $secondary_item_id;
@@ -24,14 +23,9 @@ Class BP_Activity_Activity {
 	var $hide_sitewide = false;
 	var $mptt_left;
 	var $mptt_right;
-
-	function bp_activity_activity( $id = false ) {
-		$this->__construct( $id );
-	}
+	var $is_spam;
 
 	function __construct( $id = false ) {
-		global $bp;
-
 		if ( !empty( $id ) ) {
 			$this->id = $id;
 			$this->populate();
@@ -55,11 +49,14 @@ Class BP_Activity_Activity {
 			$this->hide_sitewide     = $row->hide_sitewide;
 			$this->mptt_left         = $row->mptt_left;
 			$this->mptt_right        = $row->mptt_right;
+			$this->is_spam           = $row->is_spam;
+			
+			bp_activity_update_meta_cache( $this->id );
 		}
 	}
 
 	function save() {
-		global $wpdb, $bp, $current_user;
+		global $wpdb, $bp;
 
 		$this->id                = apply_filters_ref_array( 'bp_activity_id_before_save',                array( $this->id,                &$this ) );
 		$this->item_id           = apply_filters_ref_array( 'bp_activity_item_id_before_save',           array( $this->item_id,           &$this ) );
@@ -74,6 +71,7 @@ Class BP_Activity_Activity {
 		$this->hide_sitewide     = apply_filters_ref_array( 'bp_activity_hide_sitewide_before_save',     array( $this->hide_sitewide,     &$this ) );
 		$this->mptt_left         = apply_filters_ref_array( 'bp_activity_mptt_left_before_save',         array( $this->mptt_left,         &$this ) );
 		$this->mptt_right        = apply_filters_ref_array( 'bp_activity_mptt_right_before_save',        array( $this->mptt_right,        &$this ) );
+		$this->is_spam           = apply_filters_ref_array( 'bp_activity_is_spam_before_save',           array( $this->is_spam,           &$this ) );
 
 		// Use this, not the filters above
 		do_action_ref_array( 'bp_activity_before_save', array( &$this ) );
@@ -82,20 +80,27 @@ Class BP_Activity_Activity {
 			return false;
 
 		if ( !$this->primary_link )
-			$this->primary_link = $bp->loggedin_user->domain;
+			$this->primary_link = bp_loggedin_user_domain();
 
 		// If we have an existing ID, update the activity item, otherwise insert it.
-		if ( $this->id )
-			$q = $wpdb->prepare( "UPDATE {$bp->activity->table_name} SET user_id = %d, component = %s, type = %s, action = %s, content = %s, primary_link = %s, date_recorded = %s, item_id = %s, secondary_item_id = %s, hide_sitewide = %d WHERE id = %d", $this->user_id, $this->component, $this->type, $this->action, $this->content, $this->primary_link, $this->date_recorded, $this->item_id, $this->secondary_item_id, $this->hide_sitewide, $this->id );
-		else
-			$q = $wpdb->prepare( "INSERT INTO {$bp->activity->table_name} ( user_id, component, type, action, content, primary_link, date_recorded, item_id, secondary_item_id, hide_sitewide ) VALUES ( %d, %s, %s, %s, %s, %s, %s, %s, %s, %d )", $this->user_id, $this->component, $this->type, $this->action, $this->content, $this->primary_link, $this->date_recorded, $this->item_id, $this->secondary_item_id, $this->hide_sitewide );
+		if ( $this->id ) {
+			$q = $wpdb->prepare( "UPDATE {$bp->activity->table_name} SET user_id = %d, component = %s, type = %s, action = %s, content = %s, primary_link = %s, date_recorded = %s, item_id = %d, secondary_item_id = %d, hide_sitewide = %d, is_spam = %d WHERE id = %d", $this->user_id, $this->component, $this->type, $this->action, $this->content, $this->primary_link, $this->date_recorded, $this->item_id, $this->secondary_item_id, $this->hide_sitewide, $this->is_spam, $this->id );
+		} else {
+			$q = $wpdb->prepare( "INSERT INTO {$bp->activity->table_name} ( user_id, component, type, action, content, primary_link, date_recorded, item_id, secondary_item_id, hide_sitewide, is_spam ) VALUES ( %d, %s, %s, %s, %s, %s, %s, %d, %d, %d, %d )", $this->user_id, $this->component, $this->type, $this->action, $this->content, $this->primary_link, $this->date_recorded, $this->item_id, $this->secondary_item_id, $this->hide_sitewide, $this->is_spam );
+		}
 
-		if ( !$wpdb->query( $q ) )
+		if ( false === $wpdb->query( $q ) )
 			return false;
 
-		if ( empty( $this->id ) )
+		// If this is a new activity item, set the $id property
+		if ( empty( $this->id ) ) {
 			$this->id = $wpdb->insert_id;
 
+		// If an existing activity item, prevent any changes to the content generating new @mention notifications.
+		} else {
+			add_filter( 'bp_activity_at_name_do_notifications', '__return_false' );
+		}
+
 		do_action_ref_array( 'bp_activity_after_save', array( &$this ) );
 
 		return true;
@@ -103,9 +108,53 @@ Class BP_Activity_Activity {
 
 	// Static Functions
 
-	function get( $max = false, $page = 1, $per_page = 25, $sort = 'DESC', $search_terms = false, $filter = false, $display_comments = false, $show_hidden = false, $exclude = false, $in = false ) {
+	/**
+	 * Get activity items, as specified by parameters
+	 *
+	 * @param array $args See $defaults for explanation of arguments
+	 * @return array
+	 */
+	function get( $args = array() ) {
 		global $wpdb, $bp;
 
+		// Backward compatibility with old method of passing arguments
+		if ( !is_array( $args ) || func_num_args() > 1 ) {
+			_deprecated_argument( __METHOD__, '1.6', sprintf( __( 'Arguments passed to %1$s should be in an associative array. See the inline documentation at %2$s for more details.', 'buddypress' ), __METHOD__, __FILE__ ) );
+
+			$old_args_keys = array(
+				0 => 'max',
+				1 => 'page',
+				2 => 'per_page',
+				3 => 'sort',
+				4 => 'search_terms',
+				5 => 'filter',
+				6 => 'display_comments',
+				7 => 'show_hidden',
+				8 => 'exclude',
+				9 => 'in',
+				10 => 'spam'
+			);
+
+			$func_args = func_get_args();
+			$args      = bp_core_parse_args_array( $old_args_keys, $func_args );
+		}
+
+		$defaults = array(
+			'page'             => 1,          // The current page
+			'per_page'         => 25,         // Activity items per page
+			'max'              => false,      // Max number of items to return
+			'sort'             => 'DESC',     // ASC or DESC
+			'exclude'          => false,      // Array of ids to exclude
+			'in'               => false,      // Array of ids to limit query by (IN)
+			'filter'           => false,      // See self::get_filter_sql()
+			'search_terms'     => false,      // Terms to search by
+			'display_comments' => false,      // Whether to include activity comments
+			'show_hidden'      => false,      // Show items marked hide_sitewide
+			'spam'             => 'ham_only', // Spam status
+		);
+		$r = wp_parse_args( $args, $defaults );
+		extract( $r );
+
 		// Select conditions
 		$select_sql = "SELECT a.*, u.user_email, u.user_nicename, u.user_login, u.display_name";
 
@@ -114,6 +163,12 @@ Class BP_Activity_Activity {
 		// Where conditions
 		$where_conditions = array();
 
+		// Spam
+		if ( 'ham_only' == $spam )
+			$where_conditions['spam_sql'] = 'a.is_spam = 0';
+		elseif ( 'spam_only' == $spam )
+			$where_conditions['spam_sql'] = 'a.is_spam = 1';
+
 		// Searching
 		if ( $search_terms ) {
 			$search_terms = $wpdb->escape( $search_terms );
@@ -133,17 +188,14 @@ Class BP_Activity_Activity {
 			$where_conditions['hidden_sql'] = "a.hide_sitewide = 0";
 
 		// Exclude specified items
-		if ( $exclude )
+		if ( !empty( $exclude ) ) {
+			$exclude = implode( ',', wp_parse_id_list( $exclude ) );
 			$where_conditions['exclude'] = "a.id NOT IN ({$exclude})";
+		}
 
 		// The specific ids to which you want to limit the query
 		if ( !empty( $in ) ) {
-			if ( is_array( $in ) ) {
-				$in = implode ( ',', array_map( 'absint', $in ) );
-			} else {
-				$in = implode ( ',', array_map( 'absint', explode ( ',', $in ) ) );
-			}
-
+			$in = implode( ',', wp_parse_id_list( $in ) );
 			$where_conditions['in'] = "a.id IN ({$in})";
 		}
 
@@ -155,31 +207,53 @@ Class BP_Activity_Activity {
 
 		$where_sql = 'WHERE ' . join( ' AND ', $where_conditions );
 
-		if ( $per_page && $page ) {
-			$pag_sql = $wpdb->prepare( "LIMIT %d, %d", intval( ( $page - 1 ) * $per_page ), intval( $per_page ) );
-			$activities = $wpdb->get_results( apply_filters( 'bp_activity_get_user_join_filter', $wpdb->prepare( "{$select_sql} {$from_sql} {$where_sql} ORDER BY a.date_recorded {$sort} {$pag_sql}" ), $select_sql, $from_sql, $where_sql, $sort, $pag_sql ) );
+		// Define the preferred order for indexes
+		$indexes = apply_filters( 'bp_activity_preferred_index_order', array( 'user_id', 'item_id', 'secondary_item_id', 'date_recorded', 'component', 'type', 'hide_sitewide', 'is_spam' ) );
+		
+		foreach( $indexes as $key => $index ) {
+			if ( false !== strpos( $where_sql, $index ) ) {
+				$the_index = $index;
+				break; // Take the first one we find
+			}
+		}
+
+		if ( !empty( $the_index ) ) {
+			$index_hint_sql = "USE INDEX ({$the_index})";
+		} else {
+			$index_hint_sql = '';
+		}
+
+		if ( !empty( $per_page ) && !empty( $page ) ) {
+
+			// Make sure page values are absolute integers
+			$page     = absint( $page     );
+			$per_page = absint( $per_page );
+
+			$pag_sql    = $wpdb->prepare( "LIMIT %d, %d", absint( ( $page - 1 ) * $per_page ), $per_page );
+			$activities = $wpdb->get_results( apply_filters( 'bp_activity_get_user_join_filter', "{$select_sql} {$from_sql} {$where_sql} ORDER BY a.date_recorded {$sort} {$pag_sql}", $select_sql, $from_sql, $where_sql, $sort, $pag_sql ) );
 		} else {
-			$activities = $wpdb->get_results( apply_filters( 'bp_activity_get_user_join_filter', $wpdb->prepare( "{$select_sql} {$from_sql} {$where_sql} ORDER BY a.date_recorded {$sort}" ), $select_sql, $from_sql, $where_sql, $sort ) );
+			$activities = $wpdb->get_results( apply_filters( 'bp_activity_get_user_join_filter', "{$select_sql} {$from_sql} {$where_sql} ORDER BY a.date_recorded {$sort}", $select_sql, $from_sql, $where_sql, $sort ) );
 		}
 
-		$total_activities_sql = apply_filters( 'bp_activity_total_activities_sql', $wpdb->prepare( "SELECT count(a.id) FROM {$bp->activity->table_name} a {$where_sql} ORDER BY a.date_recorded {$sort}" ), $where_sql, $sort );
+		$total_activities_sql = apply_filters( 'bp_activity_total_activities_sql', "SELECT count(a.id) FROM {$bp->activity->table_name} a {$index_hint_sql} {$where_sql} ORDER BY a.date_recorded {$sort}", $where_sql, $sort );
 
 		$total_activities = $wpdb->get_var( $total_activities_sql );
 
 		// Get the fullnames of users so we don't have to query in the loop
+		$activity_user_ids = array();
 		if ( bp_is_active( 'xprofile' ) && $activities ) {
-			foreach ( (array)$activities as $activity ) {
-				if ( (int)$activity->user_id )
+			foreach ( (array) $activities as $activity ) {
+				if ( (int) $activity->user_id )
 					$activity_user_ids[] = $activity->user_id;
 			}
 
-			$activity_user_ids = implode( ',', array_unique( (array)$activity_user_ids ) );
+			$activity_user_ids = implode( ',', array_unique( (array) $activity_user_ids ) );
 			if ( !empty( $activity_user_ids ) ) {
-				if ( $names = $wpdb->get_results( $wpdb->prepare( "SELECT user_id, value AS user_fullname FROM {$bp->profile->table_name_data} WHERE field_id = 1 AND user_id IN ({$activity_user_ids})" ) ) ) {
-					foreach ( (array)$names as $name )
+				if ( $names = $wpdb->get_results( "SELECT user_id, value AS user_fullname FROM {$bp->profile->table_name_data} WHERE field_id = 1 AND user_id IN ({$activity_user_ids})" ) ) {
+					foreach ( (array) $names as $name )
 						$tmp_names[$name->user_id] = $name->user_fullname;
 
-					foreach ( (array)$activities as $i => $activity ) {
+					foreach ( (array) $activities as $i => $activity ) {
 						if ( !empty( $tmp_names[$activity->user_id] ) )
 							$activities[$i]->user_fullname = $tmp_names[$activity->user_id];
 					}
@@ -189,25 +263,35 @@ Class BP_Activity_Activity {
 				}
 			}
 		}
+		
+		// Get activity meta
+		$activity_ids = array();
+		foreach ( (array) $activities as $activity ) {
+			$activity_ids[] = $activity->id;
+		}
+		
+		if ( !empty( $activity_ids ) ) {
+			bp_activity_update_meta_cache( $activity_ids );
+		}
 
 		if ( $activities && $display_comments )
-			$activities = BP_Activity_Activity::append_comments( $activities );
+			$activities = BP_Activity_Activity::append_comments( $activities, $spam );
 
 		// If $max is set, only return up to the max results
 		if ( !empty( $max ) ) {
-			if ( (int)$total_activities > (int)$max )
+			if ( (int) $total_activities > (int) $max )
 				$total_activities = $max;
 		}
 
-		return array( 'activities' => $activities, 'total' => (int)$total_activities );
+		return array( 'activities' => $activities, 'total' => (int) $total_activities );
 	}
 
 	/**
 	 * In BuddyPress 1.2.x, this was used to retrieve specific activity stream items (for example, on an activity's permalink page).
-	 * As of 1.5.x, use BP_Activity_Activity::get( ..., $in ) instead.
+	 * As of 1.5.x, use BP_Activity_Activity::get() with an 'in' parameter instead.
 	 *
 	 * @deprecated 1.5
-	 * @deprecated Use BP_Activity_Activity::get( ..., $in ) instead.
+	 * @deprecated Use BP_Activity_Activity::get() with an 'in' parameter instead.
 	 * @param mixed $activity_ids Array or comma-separated string of activity IDs to retrieve
 	 * @param int $max Maximum number of results to return. (Optional; default is no maximum)
 	 * @param int $page The set of results that the user is viewing. Used in pagination. (Optional; default is 1)
@@ -218,7 +302,7 @@ Class BP_Activity_Activity {
 	 * @since 1.2
 	 */
 	function get_specific( $activity_ids, $max = false, $page = 1, $per_page = 25, $sort = 'DESC', $display_comments = false ) {
-		_deprecated_function( __FUNCTION__, '1.5', 'Use BP_Activity_Activity::get( ..., $in ) instead.' );
+		_deprecated_function( __FUNCTION__, '1.5', 'Use BP_Activity_Activity::get() with the "in" parameter instead.' );
 		return BP_Activity_Activity::get( $max, $page, $per_page, $sort, false, false, $display_comments, false, false, $activity_ids );
 	}
 
@@ -319,9 +403,9 @@ Class BP_Activity_Activity {
 			return false;
 
 		// Fetch the activity IDs so we can delete any comments for this activity item
-		$activity_ids = $wpdb->get_col( $wpdb->prepare( "SELECT id FROM {$bp->activity->table_name} {$where_sql}" ) );
+		$activity_ids = $wpdb->get_col( "SELECT id FROM {$bp->activity->table_name} {$where_sql}" );
 
-		if ( !$wpdb->query( $wpdb->prepare( "DELETE FROM {$bp->activity->table_name} {$where_sql}" ) ) )
+		if ( !$wpdb->query( "DELETE FROM {$bp->activity->table_name} {$where_sql}" ) )
 			return false;
 
 		if ( $activity_ids ) {
@@ -342,7 +426,7 @@ Class BP_Activity_Activity {
 		else
 			$activity_ids = implode ( ',', array_map( 'absint', explode ( ',', $activity_ids ) ) );
 
-		return $wpdb->query( $wpdb->prepare( "DELETE FROM {$bp->activity->table_name} WHERE type = 'activity_comment' AND item_id IN ({$activity_ids})" ) );
+		return $wpdb->query( "DELETE FROM {$bp->activity->table_name} WHERE type = 'activity_comment' AND item_id IN ({$activity_ids})" );
 	}
 
 	function delete_activity_meta_entries( $activity_ids ) {
@@ -353,29 +437,50 @@ Class BP_Activity_Activity {
 		else
 			$activity_ids = implode ( ',', array_map( 'absint', explode ( ',', $activity_ids ) ) );
 
-		return $wpdb->query( $wpdb->prepare( "DELETE FROM {$bp->activity->table_name_meta} WHERE activity_id IN ({$activity_ids})" ) );
+		return $wpdb->query( "DELETE FROM {$bp->activity->table_name_meta} WHERE activity_id IN ({$activity_ids})" );
 	}
 
-	function append_comments( $activities ) {
-		global $bp, $wpdb;
+	/**
+	 * Append activity comments to their associated activity items
+	 *
+	 * @global wpdb $wpdb WordPress database object
+	 * @param array $activities
+	 * @param bool $spam Optional; 'ham_only' (default), 'spam_only' or 'all'.
+	 * @return array The updated activities with nested comments
+	 * @since 1.2
+	 */
+	function append_comments( $activities, $spam = 'ham_only' ) {
+		global $wpdb;
 
 		$activity_comments = array();
 
 		/* Now fetch the activity comments and parse them into the correct position in the activities array. */
-		foreach( (array)$activities as $activity ) {
+		foreach( (array) $activities as $activity ) {
 			if ( 'activity_comment' != $activity->type && $activity->mptt_left && $activity->mptt_right )
-				$activity_comments[$activity->id] = BP_Activity_Activity::get_activity_comments( $activity->id, $activity->mptt_left, $activity->mptt_right );
+				$activity_comments[$activity->id] = BP_Activity_Activity::get_activity_comments( $activity->id, $activity->mptt_left, $activity->mptt_right, $spam );
 		}
 
 		/* Merge the comments with the activity items */
-		foreach( (array)$activities as $key => $activity )
+		foreach( (array) $activities as $key => $activity )
 			if ( isset( $activity_comments[$activity->id] ) )
 				$activities[$key]->children = $activity_comments[$activity->id];
 
 		return $activities;
 	}
 
-	function get_activity_comments( $activity_id, $left, $right ) {
+	/**
+	 * Get activity comments that are associated with a specific activity ID
+	 *
+	 * @global BuddyPress $bp The one true BuddyPress instance
+	 * @global wpdb $wpdb WordPress database object
+	 * @param int $activity_id Activity ID to fetch comments for
+	 * @param int $left Left-most node boundary
+	 * @param into $right Right-most node boundary
+	 * @param bool $spam Optional; 'ham_only' (default), 'spam_only' or 'all'.
+	 * @return array The updated activities with nested comments
+	 * @since 1.2
+	 */
+	function get_activity_comments( $activity_id, $left, $right, $spam = 'ham_only' ) {
 		global $wpdb, $bp;
 
 		if ( !$comments = wp_cache_get( 'bp_activity_comments_' . $activity_id ) ) {
@@ -390,11 +495,21 @@ Class BP_Activity_Activity {
 				$fullname_select = $fullname_from = $fullname_where = '';
 			}
 
+			// Don't retrieve activity comments marked as spam
+			if ( 'ham_only' == $spam )
+				$spam_sql = 'AND a.is_spam = 0';
+			elseif ( 'spam_only' == $spam )
+				$spam_sql = 'AND a.is_spam = 1';
+			else
+				$spam_sql = '';
+
+			$sql = apply_filters( 'bp_activity_comments_user_join_filter', $wpdb->prepare( "SELECT a.*, u.user_email, u.user_nicename, u.user_login, u.display_name{$fullname_select} FROM {$bp->activity->table_name} a, {$wpdb->users} u{$fullname_from} WHERE u.ID = a.user_id {$fullname_where} AND a.type = 'activity_comment' ${spam_sql} AND a.item_id = %d AND a.mptt_left BETWEEN %d AND %d ORDER BY a.date_recorded ASC", $activity_id, $left, $right ), $activity_id, $left, $right, $spam_sql );
+
 			// Retrieve all descendants of the $root node
-			$descendants = $wpdb->get_results( apply_filters( 'bp_activity_comments_user_join_filter', $wpdb->prepare( "SELECT a.*, u.user_email, u.user_nicename, u.user_login, u.display_name{$fullname_select} FROM {$bp->activity->table_name} a, {$wpdb->users} u{$fullname_from} WHERE u.ID = a.user_id {$fullname_where} AND a.type = 'activity_comment' AND a.item_id = %d AND a.mptt_left BETWEEN %d AND %d ORDER BY a.date_recorded ASC", $activity_id, $left, $right ), $activity_id, $left, $right ) );
+			$descendants = $wpdb->get_results( $sql );
 
 			// Loop descendants and build an assoc array
-			foreach ( (array)$descendants as $d ) {
+			foreach ( (array) $descendants as $d ) {
 				$d->children = array();
 
 				// If we have a reference on the parent
@@ -424,7 +539,7 @@ Class BP_Activity_Activity {
 		$descendants = BP_Activity_Activity::get_child_comments( $parent_id );
 
 		// Loop the descendants and recalculate the left and right values
-		foreach ( (array)$descendants as $descendant )
+		foreach ( (array) $descendants as $descendant )
 			$right = BP_Activity_Activity::rebuild_activity_comment_tree( $descendant->id, $right );
 
 		// We've got the left value, and now that we've processed the children
@@ -447,21 +562,21 @@ Class BP_Activity_Activity {
 	function get_recorded_components() {
 		global $wpdb, $bp;
 
-		return $wpdb->get_col( $wpdb->prepare( "SELECT DISTINCT component FROM {$bp->activity->table_name} ORDER BY component ASC" ) );
+		return $wpdb->get_col( "SELECT DISTINCT component FROM {$bp->activity->table_name} ORDER BY component ASC" );
 	}
 
 	function get_sitewide_items_for_feed( $limit = 35 ) {
-		global $wpdb, $bp;
+		global $bp;
 
-		$activities = bp_activity_get_sitewide( array( 'max' => $limit ) );
+		$activities    = bp_activity_get_sitewide( array( 'max' => $limit ) );
+		$activity_feed = array();
 
 		for ( $i = 0, $count = count( $activities ); $i < $count; ++$i ) {
-				$title = explode( '<span', $activities[$i]['content'] );
-
-				$activity_feed[$i]['title'] = trim( strip_tags( $title[0] ) );
-				$activity_feed[$i]['link'] = $activities[$i]['primary_link'];
+				$title                            = explode( '<span', $activities[$i]['content'] );
+				$activity_feed[$i]['title']       = trim( strip_tags( $title[0] ) );
+				$activity_feed[$i]['link']        = $activities[$i]['primary_link'];
 				$activity_feed[$i]['description'] = @sprintf( $activities[$i]['content'], '' );
-				$activity_feed[$i]['pubdate'] = $activities[$i]['date_recorded'];
+				$activity_feed[$i]['pubdate']     = $activities[$i]['date_recorded'];
 		}
 
 		return $activity_feed;
@@ -492,7 +607,8 @@ Class BP_Activity_Activity {
 	}
 
 	function get_filter_sql( $filter_array ) {
-		global $wpdb;
+
+		$filter_sql = array();
 
 		if ( !empty( $filter_array['user_id'] ) ) {
 			$user_sql = BP_Activity_Activity::get_in_operator_sql( 'a.user_id', $filter_array['user_id'] );
@@ -524,7 +640,7 @@ Class BP_Activity_Activity {
 				$filter_sql[] = $sid_sql;
 		}
 
-		if ( empty($filter_sql) )
+		if ( empty( $filter_sql ) )
 			return false;
 
 		return join( ' AND ', $filter_sql );
@@ -533,7 +649,7 @@ Class BP_Activity_Activity {
 	function get_last_updated() {
 		global $bp, $wpdb;
 
-		return $wpdb->get_var( $wpdb->prepare( "SELECT date_recorded FROM {$bp->activity->table_name} ORDER BY date_recorded DESC LIMIT 1" ) );
+		return $wpdb->get_var( "SELECT date_recorded FROM {$bp->activity->table_name} ORDER BY date_recorded DESC LIMIT 1" );
 	}
 
 	function total_favorite_count( $user_id ) {
diff --git a/wp-content/plugins/buddypress/bp-activity/bp-activity-filters.php b/wp-content/plugins/buddypress/bp-activity/bp-activity-filters.php
index 5e207cfb855bc40dac75760e4068e93516396c9a..3bf5ba5ce5ddeb812f4b4efd2445697719c54424 100644
--- a/wp-content/plugins/buddypress/bp-activity/bp-activity-filters.php
+++ b/wp-content/plugins/buddypress/bp-activity/bp-activity-filters.php
@@ -10,6 +10,8 @@
 // Exit if accessed directly
 if ( !defined( 'ABSPATH' ) ) exit;
 
+/** Filters *******************************************************************/
+
 // Apply WordPress defined filters
 add_filter( 'bp_get_activity_action',                'bp_activity_filter_kses', 1 );
 add_filter( 'bp_get_activity_content_body',          'bp_activity_filter_kses', 1 );
@@ -20,6 +22,7 @@ add_filter( 'bp_get_activity_latest_update_excerpt', 'bp_activity_filter_kses',
 add_filter( 'bp_get_activity_feed_item_description', 'bp_activity_filter_kses', 1 );
 add_filter( 'bp_activity_content_before_save',       'bp_activity_filter_kses', 1 );
 add_filter( 'bp_activity_action_before_save',        'bp_activity_filter_kses', 1 );
+add_filter( 'bp_activity_latest_update_content',     'wp_filter_kses', 1 );
 
 add_filter( 'bp_get_activity_action',                'force_balance_tags' );
 add_filter( 'bp_get_activity_content_body',          'force_balance_tags' );
@@ -73,6 +76,8 @@ add_filter( 'bp_get_activity_latest_update',         'stripslashes_deep' );
 add_filter( 'bp_get_activity_latest_update_excerpt', 'stripslashes_deep' );
 add_filter( 'bp_get_activity_feed_item_description', 'stripslashes_deep' );
 
+add_filter( 'bp_activity_primary_link_before_save',  'esc_url_raw' );
+
 // Apply BuddyPress defined filters
 add_filter( 'bp_get_activity_content',               'bp_activity_make_nofollow_filter' );
 add_filter( 'bp_get_activity_content_body',          'bp_activity_make_nofollow_filter' );
@@ -84,13 +89,78 @@ add_filter( 'bp_get_activity_feed_item_description', 'bp_activity_make_nofollow_
 add_filter( 'pre_comment_content',                   'bp_activity_at_name_filter' );
 add_filter( 'group_forum_topic_text_before_save',    'bp_activity_at_name_filter' );
 add_filter( 'group_forum_post_text_before_save',     'bp_activity_at_name_filter' );
+add_filter( 'the_content', 			     'bp_activity_at_name_filter' );
 
 add_filter( 'bp_get_activity_parent_content',        'bp_create_excerpt' );
 
+add_filter( 'bp_get_activity_content_body', 'bp_activity_truncate_entry', 5 );
+add_filter( 'bp_get_activity_content',      'bp_activity_truncate_entry', 5 );
+
+/** Actions *******************************************************************/
+
+// At-name filter
+add_action( 'bp_activity_after_save', 'bp_activity_at_name_filter_updates' );
+
+// Activity stream moderation
+add_action( 'bp_activity_before_save', 'bp_activity_check_moderation_keys', 2, 1 );
+add_action( 'bp_activity_before_save', 'bp_activity_check_blacklist_keys',  2, 1 );
+
+/** Functions *****************************************************************/
+
+/**
+ * Types of activity stream items to check against
+ *
+ * @since BuddyPress (1.6)
+ */
+function bp_activity_get_moderated_activity_types() {
+	$types = array(
+		'activity_comment',
+		'activity_update'
+	);
+	return apply_filters( 'bp_activity_check_activity_types', $types );
+}
+
+/**
+ * Check activity stream for moderation keys
+ *
+ * @since BuddyPress (1.6)
+ * @param BP_Activity_Activity $activity
+ * @return If activity type is not an update or comment
+ */
+function bp_activity_check_moderation_keys( $activity ) {
+
+	// Only check specific types of activity updates
+	if ( !in_array( $activity->type, bp_activity_get_moderated_activity_types() ) )
+		return;
+
+	// Unset the activity component so activity stream update fails
+	// @todo This is temporary until some kind of moderation is built
+	if ( !bp_core_check_for_moderation( $activity->user_id, '', $activity->content ) )
+		$activity->component = false;
+}
+
+/**
+ * Check activity stream for blacklisted keys
+ *
+ * @since BuddyPress (1.6)
+ * @param BP_Activity_Activity $activity
+ * @return If activity type is not an update or comment
+ */
+function bp_activity_check_blacklist_keys( $activity ) {
+
+	// Only check specific types of activity updates
+	if ( ! in_array( $activity->type, bp_activity_get_moderated_activity_types() ) )
+		return;
+
+	// Mark as spam
+	if ( ! bp_core_check_for_blacklist( $activity->user_id, '', $activity->content ) )
+		bp_activity_mark_as_spam( $activity, 'by_blacklist' );
+}
+
 /**
  * Custom kses filtering for activity content
  *
- * @since 1.1.0
+ * @since BuddyPress (1.1)
  *
  * @param string $content The activity content
  *
@@ -105,9 +175,6 @@ function bp_activity_filter_kses( $content ) {
 	$activity_allowedtags = $allowedtags;
 	$activity_allowedtags['span']          = array();
 	$activity_allowedtags['span']['class'] = array();
-	$activity_allowedtags['div']           = array();
-	$activity_allowedtags['div']['class']  = array();
-	$activity_allowedtags['div']['id']     = array();
 	$activity_allowedtags['a']['class']    = array();
 	$activity_allowedtags['a']['id']       = array();
 	$activity_allowedtags['a']['rel']      = array();
@@ -129,7 +196,7 @@ function bp_activity_filter_kses( $content ) {
 /**
  * Finds and links @-mentioned users in the contents of activity items
  *
- * @since 1.2.0
+ * @since BuddyPress (1.2)
  *
  * @param string $content The activity content
  * @param int $activity_id The activity id
@@ -144,9 +211,16 @@ function bp_activity_filter_kses( $content ) {
  * @return string $content Content filtered for mentions
  */
 function bp_activity_at_name_filter( $content, $activity_id = 0 ) {
-	$usernames = bp_activity_find_mentions( $content );
+	if ( $activity_id & bp_is_active( 'activity' ) ) {
+		$activity = new BP_Activity_Activity( $activity_id );
+		
+		// If this activity has been marked as spam, don't do anything. This prevents @notifications being sent.
+		if ( !empty( $activity ) && $activity->is_spam )
+			return $content;
+	}
 
-	foreach( (array)$usernames as $username ) {
+	$usernames = bp_activity_find_mentions( $content );
+	foreach( (array) $usernames as $username ) {
 		if ( bp_is_username_compatibility_mode() )
 			$user_id = username_exists( $username );
 		else
@@ -156,7 +230,7 @@ function bp_activity_at_name_filter( $content, $activity_id = 0 ) {
 			continue;
 
 		// If an activity_id is provided, we can send email and BP notifications
-		if ( $activity_id ) {
+		if ( $activity_id && apply_filters( 'bp_activity_at_name_do_notifications', true ) ) {
 			bp_activity_at_message_notification( $activity_id, $user_id );
 		}
 
@@ -173,7 +247,7 @@ function bp_activity_at_name_filter( $content, $activity_id = 0 ) {
 /**
  * Catch mentions in saved activity items
  *
- * @since 1.5.0
+ * @since BuddyPress (1.5)
  *
  * @param obj $activity
  *
@@ -191,12 +265,11 @@ function bp_activity_at_name_filter_updates( $activity ) {
 	// Resave the activity with the new content
 	$activity->save();
 }
-add_filter( 'bp_activity_after_save', 'bp_activity_at_name_filter_updates' );
 
 /**
  * Catches links in activity text so rel=nofollow can be added
  *
- * @since 1.2.0
+ * @since BuddyPress (1.2)
  *
  * @param string $text Activity text
  *
@@ -209,7 +282,7 @@ function bp_activity_make_nofollow_filter( $text ) {
 	/**
 	 * Adds rel=nofollow to a link
 	 *
-	 * @since 1.2.0
+	 * @since BuddyPress (1.2)
 	 *
 	 * @param array $matches
 	 *
@@ -224,7 +297,7 @@ function bp_activity_make_nofollow_filter( $text ) {
 /**
  * Truncates long activity entries when viewed in activity streams
  *
- * @since 1.5.0
+ * @since BuddyPress (1.5)
  *
  * @param $text The original activity entry text
  *
@@ -253,8 +326,9 @@ function bp_activity_truncate_entry( $text ) {
 	$excerpt        = bp_create_excerpt( $text, $excerpt_length, array( 'ending' => __( '&hellip;', 'buddypress' ) ) );
 
 	// If the text returned by bp_create_excerpt() is different from the original text (ie it's
-	// been truncated), add the "Read More" link.
-	if ( $excerpt != $text ) {
+	// been truncated), add the "Read More" link. Note that bp_create_excerpt() is stripping
+	// shortcodes, so we have strip them from the $text before the comparison
+	if ( $excerpt != strip_shortcodes( $text ) ) {
 		$id = !empty( $activities_template->activity->current_comment->id ) ? 'acomment-read-more-' . $activities_template->activity->current_comment->id : 'activity-read-more-' . bp_get_activity_id();
 
 		$excerpt = sprintf( '%1$s<span class="activity-read-more" id="%2$s"><a href="%3$s" rel="nofollow">%4$s</a></span>', $excerpt, $id, bp_get_activity_thread_permalink(), $append_text );
@@ -262,7 +336,5 @@ function bp_activity_truncate_entry( $text ) {
 
 	return apply_filters( 'bp_activity_truncate_entry', $excerpt, $text, $append_text );
 }
-add_filter( 'bp_get_activity_content_body', 'bp_activity_truncate_entry', 5 );
-add_filter( 'bp_get_activity_content', 'bp_activity_truncate_entry', 5 );
 
 ?>
\ No newline at end of file
diff --git a/wp-content/plugins/buddypress/bp-activity/bp-activity-functions.php b/wp-content/plugins/buddypress/bp-activity/bp-activity-functions.php
index 519d00422b01416a794e94bc2e5af4cb83b650de..172b106e10ba3d48399d69dff3c27ed55e853af9 100644
--- a/wp-content/plugins/buddypress/bp-activity/bp-activity-functions.php
+++ b/wp-content/plugins/buddypress/bp-activity/bp-activity-functions.php
@@ -15,7 +15,7 @@ if ( !defined( 'ABSPATH' ) ) exit;
 /**
  * Checks $bp pages global and looks for directory page
  *
- * @since 1.5.0
+ * @since BuddyPress (1.5)
  *
  * @global object $bp BuddyPress global settings
  *
@@ -30,14 +30,14 @@ function bp_activity_has_directory() {
 /**
  * Searches through the content of an activity item to locate usernames, designated by an @ sign
  *
- * @since 1.5.0
+ * @since BuddyPress (1.5)
  *
  * @param string $content The content of the activity, usually found in $activity->content
  *
  * @return bool|array $usernames Array of the found usernames that match existing users. False if no matches
  */
 function bp_activity_find_mentions( $content ) {
-	$pattern = '/[@]+([A-Za-z0-9-_\.@]+)/';
+	$pattern = '/[@]+([A-Za-z0-9-_\.@]+)\b/';
 	preg_match_all( $pattern, $content, $usernames );
 
 	// Make sure there's only one instance of each username
@@ -50,7 +50,7 @@ function bp_activity_find_mentions( $content ) {
 /**
  * Resets a user's unread mentions list and count
  *
- * @since 1.5.0
+ * @since BuddyPress (1.5)
  *
  * @param int $user_id The id of the user whose unread mentions are being reset
  * @uses bp_delete_user_meta()
@@ -63,7 +63,7 @@ function bp_activity_clear_new_mentions( $user_id ) {
 /**
  * Adjusts new mention count for mentioned users when activity items are deleted or created
  *
- * @since 1.5.0
+ * @since BuddyPress (1.5)
  *
  * @param int $activity_id The unique id for the activity item
  * @param string $action Can be 'delete' or 'add'. Defaults to 'add'
@@ -79,7 +79,7 @@ function bp_activity_adjust_mention_count( $activity_id, $action = 'add' ) {
 	$activity = new BP_Activity_Activity( $activity_id );
 
 	if ( $usernames = bp_activity_find_mentions( strip_tags( $activity->content ) ) ) {
-		foreach( (array)$usernames as $username ) {
+		foreach( (array) $usernames as $username ) {
 			if ( bp_is_username_compatibility_mode() )
 				$user_id = username_exists( $username );
 			else
@@ -104,7 +104,7 @@ function bp_activity_adjust_mention_count( $activity_id, $action = 'add' ) {
 				case 'add' :
 				default :
 					if ( !in_array( $activity_id, $new_mentions ) ) {
-						$new_mentions[] = (int)$activity_id;
+						$new_mentions[] = (int) $activity_id;
 					}
 					break;
 			}
@@ -122,7 +122,7 @@ function bp_activity_adjust_mention_count( $activity_id, $action = 'add' ) {
 /**
  * Formats notifications related to activity
  *
- * @since 1.5.0
+ * @since BuddyPress (1.5)
  *
  * @param string $action The type of activity item. Just 'new_at_mention' for now
  * @param int $item_id The activity id
@@ -130,7 +130,6 @@ function bp_activity_adjust_mention_count( $activity_id, $action = 'add' ) {
  * @param int $total_items The total number of notifications to format
  * @param string $format 'string' to get a BuddyBar-compatible notification, 'array' otherwise
  *
- * @global object $bp BuddyPress global settings
  * @uses bp_loggedin_user_domain()
  * @uses bp_get_activity_slug()
  * @uses bp_core_get_user_displayname()
@@ -141,33 +140,32 @@ function bp_activity_adjust_mention_count( $activity_id, $action = 'add' ) {
  * @return string $return Formatted @mention notification
  */
 function bp_activity_format_notifications( $action, $item_id, $secondary_item_id, $total_items, $format = 'string' ) {
-	global $bp;
 
 	switch ( $action ) {
 		case 'new_at_mention':
 			$activity_id      = $item_id;
 			$poster_user_id   = $secondary_item_id;
 			$at_mention_link  = bp_loggedin_user_domain() . bp_get_activity_slug() . '/mentions/';
-			$at_mention_title = sprintf( __( '@%s Mentions', 'buddypress' ), $bp->loggedin_user->userdata->user_nicename );
+			$at_mention_title = sprintf( __( '@%s Mentions', 'buddypress' ), bp_get_loggedin_user_username() );
 
-			if ( (int)$total_items > 1 ) {
-				$text = sprintf( __( 'You have %1$d new activity mentions', 'buddypress' ), (int)$total_items );
+			if ( (int) $total_items > 1 ) {
+				$text = sprintf( __( 'You have %1$d new mentions', 'buddypress' ), (int) $total_items );
 				$filter = 'bp_activity_multiple_at_mentions_notification';
 			} else {
 				$user_fullname = bp_core_get_user_displayname( $poster_user_id );
-				$text =  sprintf( __( '%1$s mentioned you in an activity update', 'buddypress' ), $user_fullname );
+				$text =  sprintf( __( '%1$s mentioned you', 'buddypress' ), $user_fullname );
 				$filter = 'bp_activity_single_at_mentions_notification';
 			}
 		break;
 	}
 
 	if ( 'string' == $format ) {
-		$return = apply_filters( $filter, '<a href="' . $at_mention_link . '" title="' . $at_mention_title . '">' . $text . '</a>', $at_mention_link, (int)$total_items, $activity_id, $poster_user_id );
+		$return = apply_filters( $filter, '<a href="' . $at_mention_link . '" title="' . $at_mention_title . '">' . $text . '</a>', $at_mention_link, (int) $total_items, $activity_id, $poster_user_id );
 	} else {
 		$return = apply_filters( $filter, array(
 			'text' => $text,
 			'link' => $at_mention_link
-		), $at_mention_link, (int)$total_items, $activity_id, $poster_user_id );
+		), $at_mention_link, (int) $total_items, $activity_id, $poster_user_id );
 	}
 
 	do_action( 'activity_format_notifications', $action, $item_id, $secondary_item_id, $total_items );
@@ -180,7 +178,7 @@ function bp_activity_format_notifications( $action, $item_id, $secondary_item_id
 /**
  * Sets the current action for a given activity stream location
  *
- * @since 1.1.0
+ * @since BuddyPress (1.1)
  *
  * @param string $component_id
  * @param string $key
@@ -199,6 +197,14 @@ function bp_activity_set_action( $component_id, $key, $value ) {
 		return false;
 
 	// Set activity action
+	if ( !isset( $bp->activity->actions ) || !is_object( $bp->activity->actions ) ) {
+		$bp->activity->actions = new stdClass;
+	}
+
+	if ( !isset( $bp->activity->actions->{$component_id} ) || !is_object( $bp->activity->actions->{$component_id} ) ) {
+		$bp->activity->actions->{$component_id} = new stdClass;
+	}
+
 	$bp->activity->actions->{$component_id}->{$key} = apply_filters( 'bp_activity_set_action', array(
 		'key'   => $key,
 		'value' => $value
@@ -210,7 +216,7 @@ function bp_activity_set_action( $component_id, $key, $value ) {
 /**
  * Retreives the current action from a component and key
  *
- * @since 1.1.0
+ * @since BuddyPress (1.1)
  *
  * @param string $component_id
  * @param string $key
@@ -235,22 +241,20 @@ function bp_activity_get_action( $component_id, $key ) {
 /**
  * Get a users favorite activity stream items
  *
- * @since 1.2.0
+ * @since BuddyPress (1.2)
  *
  * @param int $user_id
  *
- * @global object $bp BuddyPress global settings
  * @uses bp_get_user_meta()
  * @uses apply_filters() To call the 'bp_activity_get_user_favorites' hook
  *
  * @return array Array of users favorite activity stream ID's
  */
 function bp_activity_get_user_favorites( $user_id = 0 ) {
-	global $bp;
 
 	// Fallback to logged in user if no user_id is passed
 	if ( empty( $user_id ) )
-		$user_id = $bp->displayed_user->id;
+		$user_id = bp_displayed_user_id();
 
 	// Get favorites for user
 	$favs = bp_get_user_meta( $user_id, 'bp_favorite_activities', true );
@@ -261,12 +265,11 @@ function bp_activity_get_user_favorites( $user_id = 0 ) {
 /**
  * Add an activity stream item as a favorite for a user
  *
- * @since 1.2.0
+ * @since BuddyPress (1.2)
  *
  * @param int $activity_id
  * @param int $user_id
  *
- * @global object $bp BuddyPress global settings
  * @uses is_user_logged_in()
  * @uses bp_get_user_meta()
  * @uses bp_activity_get_meta()
@@ -278,7 +281,6 @@ function bp_activity_get_user_favorites( $user_id = 0 ) {
  * @return bool True on success, false on failure
  */
 function bp_activity_add_user_favorite( $activity_id, $user_id = 0 ) {
-	global $bp;
 
 	// Favorite activity stream items are for logged in users only
 	if ( !is_user_logged_in() )
@@ -286,18 +288,18 @@ function bp_activity_add_user_favorite( $activity_id, $user_id = 0 ) {
 
 	// Fallback to logged in user if no user_id is passed
 	if ( empty( $user_id ) )
-		$user_id = $bp->loggedin_user->id;
+		$user_id = bp_loggedin_user_id();
 
 	// Update the user's personal favorites
-	$my_favs   = bp_get_user_meta( $bp->loggedin_user->id, 'bp_favorite_activities', true );
+	$my_favs   = bp_get_user_meta( bp_loggedin_user_id(), 'bp_favorite_activities', true );
 	$my_favs[] = $activity_id;
 
 	// Update the total number of users who have favorited this activity
 	$fav_count = bp_activity_get_meta( $activity_id, 'favorite_count' );
-	$fav_count = !empty( $fav_count ) ? (int)$fav_count + 1 : 1;
+	$fav_count = !empty( $fav_count ) ? (int) $fav_count + 1 : 1;
 
 	// Update user meta
-	bp_update_user_meta( $bp->loggedin_user->id, 'bp_favorite_activities', $my_favs );
+	bp_update_user_meta( bp_loggedin_user_id(), 'bp_favorite_activities', $my_favs );
 
 	// Update activity meta counts
 	if ( true === bp_activity_update_meta( $activity_id, 'favorite_count', $fav_count ) ) {
@@ -320,12 +322,11 @@ function bp_activity_add_user_favorite( $activity_id, $user_id = 0 ) {
 /**
  * Remove an activity stream item as a favorite for a user
  *
- * @since 1.2.0
+ * @since BuddyPress (1.2)
  *
  * @param int $activity_id
  * @param int $user_id
  *
- * @global object $bp BuddyPress global settings
  * @uses is_user_logged_in()
  * @uses bp_get_user_meta()
  * @uses bp_activity_get_meta()
@@ -336,7 +337,6 @@ function bp_activity_add_user_favorite( $activity_id, $user_id = 0 ) {
  * @return bool True on success, false on failure
  */
 function bp_activity_remove_user_favorite( $activity_id, $user_id = 0 ) {
-	global $bp;
 
 	// Favorite activity stream items are for logged in users only
 	if ( !is_user_logged_in() )
@@ -344,7 +344,7 @@ function bp_activity_remove_user_favorite( $activity_id, $user_id = 0 ) {
 
 	// Fallback to logged in user if no user_id is passed
 	if ( empty( $user_id ) )
-		$user_id = $bp->loggedin_user->id;
+		$user_id = bp_loggedin_user_id();
 
 	// Remove the fav from the user's favs
 	$my_favs = bp_get_user_meta( $user_id, 'bp_favorite_activities', true );
@@ -356,7 +356,7 @@ function bp_activity_remove_user_favorite( $activity_id, $user_id = 0 ) {
 	if ( $fav_count = bp_activity_get_meta( $activity_id, 'favorite_count' ) ) {
 
 		// Deduct from total favorites
-		if ( bp_activity_update_meta( $activity_id, 'favorite_count', (int)$fav_count - 1 ) ) {
+		if ( bp_activity_update_meta( $activity_id, 'favorite_count', (int) $fav_count - 1 ) ) {
 
 			// Update users favorites
 			if ( bp_update_user_meta( $user_id, 'bp_favorite_activities', $my_favs ) ) {
@@ -386,7 +386,7 @@ function bp_activity_remove_user_favorite( $activity_id, $user_id = 0 ) {
 /**
  * Check if activity exists by scanning content
  *
- * @since 1.1.0
+ * @since BuddyPress (1.1)
  *
  * @param string $content
  *
@@ -402,7 +402,7 @@ function bp_activity_check_exists_by_content( $content ) {
 /**
  * Retrieve the last time activity was updated
  *
- * @since 1.0.0
+ * @since BuddyPress (1.0)
  *
  * @uses BP_Activity_Activity::get_last_updated() {@link BP_Activity_Activity}
  * @uses apply_filters() To call the 'bp_activity_get_last_updated' hook
@@ -416,21 +416,19 @@ function bp_activity_get_last_updated() {
 /**
  * Retrieve the number of favorite activity stream items a user has
  *
- * @since 1.2.0
+ * @since BuddyPress (1.2)
  *
  * @param int $user_id
  *
- * @global object $bp BuddyPress global settings
  * @uses BP_Activity_Activity::total_favorite_count() {@link BP_Activity_Activity}
  *
  * @return int Total favorite count
  */
 function bp_activity_total_favorites_for_user( $user_id = 0 ) {
-	global $bp;
 
 	// Fallback on displayed user, and then logged in user
 	if ( empty( $user_id ) )
-		$user_id = ( $bp->displayed_user->id ) ? $bp->displayed_user->id : $bp->loggedin_user->id;
+		$user_id = ( bp_displayed_user_id() ) ? bp_displayed_user_id() : bp_loggedin_user_id();
 
 	return BP_Activity_Activity::total_favorite_count( $user_id );
 }
@@ -440,7 +438,7 @@ function bp_activity_total_favorites_for_user( $user_id = 0 ) {
 /**
  * Delete a meta entry from the DB for an activity stream item
  *
- * @since 1.2.0
+ * @since BuddyPress (1.2)
  *
  * @param int $activity_id
  * @param string $meta_key
@@ -482,7 +480,7 @@ function bp_activity_delete_meta( $activity_id, $meta_key = '', $meta_value = ''
 		$retval = $wpdb->query( $wpdb->prepare( "DELETE FROM {$bp->activity->table_name_meta} WHERE activity_id = %d AND meta_key = %s", $activity_id, $meta_key ) );
 
 	// Delete cache entry
-	wp_cache_delete( 'bp_activity_meta_' . $meta_key . '_' . $activity_id, 'bp' );
+	wp_cache_delete( 'bp_activity_meta_' . $activity_id . '_' . $meta_key, 'bp' );
 
 	// Success
 	if ( !is_wp_error( $retval ) )
@@ -496,7 +494,7 @@ function bp_activity_delete_meta( $activity_id, $meta_key = '', $meta_value = ''
 /**
  * Get activity meta
  *
- * @since 1.2.0
+ * @since BuddyPress (1.2)
  *
  * @param int $activity_id
  * @param string $meta_key
@@ -523,26 +521,33 @@ function bp_activity_get_meta( $activity_id = 0, $meta_key = '' ) {
 		$meta_key = preg_replace( '|[^a-z0-9_]|i', '', $meta_key );
 
 		// Check cache
-		if ( !$metas = wp_cache_get( 'bp_activity_meta_' . $meta_key . '_' . $activity_id, 'bp' ) ) {
-
+		if ( !$metas = wp_cache_get( 'bp_activity_meta_' . $activity_id . '_' . $meta_key, 'bp' ) ) {
 			// No cache so hit the DB
 			$metas = $wpdb->get_col( $wpdb->prepare("SELECT meta_value FROM {$bp->activity->table_name_meta} WHERE activity_id = %d AND meta_key = %s", $activity_id, $meta_key ) );
 
 			// Set cache
-			wp_cache_set( 'bp_activity_meta_' . $meta_key . '_' . $activity_id, $metas, 'bp' );
+			wp_cache_set( 'bp_activity_meta_' . $activity_id . '_' . $meta_key, $metas, 'bp' );
 		}
 
 	// No key so get all for activity_id
 	} else {
-		$metas = $wpdb->get_col( $wpdb->prepare( "SELECT meta_value FROM {$bp->activity->table_name_meta} WHERE activity_id = %d", $activity_id ) );
+		$metas = $wpdb->get_results( $wpdb->prepare( "SELECT meta_key, meta_value FROM {$bp->activity->table_name_meta} WHERE activity_id = %d", $activity_id ) );
+				
+		if ( !empty( $metas ) ) {
+			$metas = array_map( 'maybe_unserialize', (array) $metas );
+			
+			foreach( $metas as $mkey => $mvalue ) {
+				wp_cache_set( 'bp_activity_meta_' . $activity_id . '_' . $mkey, $mvalue, 'bp' );
+			}
+		}
 	}
-
+	
 	// No result so return false
 	if ( empty( $metas ) )
 		return false;
 
 	// Maybe, just maybe... unserialize
-	$metas = array_map( 'maybe_unserialize', (array)$metas );
+	$metas = array_map( 'maybe_unserialize', (array) $metas );
 
 	// Return first item in array if only 1, else return all metas found
 	$retval = ( 1 == count( $metas ) ? $metas[0] : $metas );
@@ -554,7 +559,7 @@ function bp_activity_get_meta( $activity_id = 0, $meta_key = '' ) {
 /**
  * Update activity meta
  *
- * @since 1.2.0
+ * @since BuddyPress (1.2)
  *
  * @param int $activity_id
  * @param string $meta_key
@@ -605,7 +610,7 @@ function bp_activity_update_meta( $activity_id, $meta_key, $meta_value ) {
 		return false;
 
 	// Set cache
-	wp_cache_set( 'bp_activity_meta_' . $meta_key . '_' . $activity_id, $meta_value, 'bp' );
+	wp_cache_set( 'bp_activity_meta_' . $activity_id . '_' . $meta_key, $meta_value, 'bp' );
 
 	// Victory is ours!
 	return true;
@@ -616,7 +621,7 @@ function bp_activity_update_meta( $activity_id, $meta_key, $meta_value ) {
 /**
  * Completely remove a user's activity data
  *
- * @since 1.5.0
+ * @since BuddyPress (1.5)
  *
  * @param int $user_id
  *
@@ -647,25 +652,127 @@ function bp_activity_remove_all_user_data( $user_id = 0 ) {
 }
 add_action( 'wpmu_delete_user',  'bp_activity_remove_all_user_data' );
 add_action( 'delete_user',       'bp_activity_remove_all_user_data' );
-add_action( 'bp_make_spam_user', 'bp_activity_remove_all_user_data' );
 
 /**
- * Register the activity stream actions for updates
+ * Mark all of the user's activity as spam
+ *
+ * @global object $wpdb
+ * @global object $bp BuddyPress global settings
+ * @param int $user_id
+ * @since 1.6
+ */
+function bp_activity_spam_all_user_data( $user_id = 0 ) {
+	global $bp, $wpdb;
+
+	// Do not delete user data unless a logged in user says so
+	if ( empty( $user_id ) || ! is_user_logged_in() )
+		return false;
+
+	// Get all the user's activities.
+	$activities = bp_activity_get( array( 'display_comments' => 'stream', 'filter' => array( 'user_id' => $user_id ), 'show_hidden' => true, ) );
+
+	// Mark each as spam
+	foreach ( (array) $activities['activities'] as $activity ) {
+
+		// Create an activity object
+		$activity_obj = new BP_Activity_Activity;
+		foreach ( $activity as $k => $v )
+			$activity_obj->$k = $v;
+
+		// Mark as spam
+		bp_activity_mark_as_spam( $activity_obj );
+
+		/*
+		 * If Akismet is present, update the activity history meta.
+		 *
+		 * This is usually taken care of when BP_Activity_Activity::save() happens, but
+		 * as we're going to be updating all the activity statuses directly, for efficency,
+		 * we need to update manually.
+		 */
+		if ( ! empty( $bp->activity->akismet ) )
+			$bp->activity->akismet->update_activity_spam_meta( $activity_obj );
+
+		// Tidy up
+		unset( $activity_obj );
+	}
+
+	// Mark all of this user's activities as spam
+	$wpdb->query( $wpdb->prepare( "UPDATE {$bp->activity->table_name} SET is_spam = 1 WHERE user_id = %d", $user_id ) );
+
+	// Call an action for plugins to use
+	do_action( 'bp_activity_spam_all_user_data', $user_id, $activities['activities'] );
+}
+add_action( 'bp_make_spam_user', 'bp_activity_spam_all_user_data' );
+
+/**
+ * Mark all of the user's activity as ham (not spam)
  *
- * @since 1.2.0
+ * @global object $wpdb
+ * @global object $bp BuddyPress global settings
+ * @param int $user_id
+ * @since 1.6
+ */
+function bp_activity_ham_all_user_data( $user_id = 0 ) {
+	global $bp, $wpdb;
+
+	// Do not delete user data unless a logged in user says so
+	if ( empty( $user_id ) || ! is_user_logged_in() )
+		return false;
+
+	// Get all the user's activities.
+	$activities = bp_activity_get( array( 'display_comments' => 'stream', 'filter' => array( 'user_id' => $user_id ), 'show_hidden' => true, 'spam' => 'all', ) );
+
+	// Mark each as not spam
+	foreach ( (array) $activities['activities'] as $activity ) {
+
+		// Create an activity object
+		$activity_obj = new BP_Activity_Activity;
+		foreach ( $activity as $k => $v )
+			$activity_obj->$k = $v;
+
+		// Mark as not spam	
+		bp_activity_mark_as_ham( $activity_obj );
+
+		/*
+		 * If Akismet is present, update the activity history meta.
+		 *
+		 * This is usually taken care of when BP_Activity_Activity::save() happens, but
+		 * as we're going to be updating all the activity statuses directly, for efficency,
+		 * we need to update manually.
+		 */
+		if ( ! empty( $bp->activity->akismet ) )
+			$bp->activity->akismet->update_activity_ham_meta( $activity_obj );
+
+		// Tidy up
+		unset( $activity_obj );
+	}
+
+	// Mark all of this user's activities as spam
+	$wpdb->query( $wpdb->prepare( "UPDATE {$bp->activity->table_name} SET is_spam = 0 WHERE user_id = %d", $user_id ) );
+
+	// Call an action for plugins to use
+	do_action( 'bp_activity_ham_all_user_data', $user_id, $activities['activities'] );
+}
+add_action( 'bp_make_ham_user', 'bp_activity_ham_all_user_data' );
+
+/**
+ * Register the activity stream actions for updates
  *
  * @global object $bp BuddyPress global settings
- * @uses bp_activity_set_action()
- * @uses do_action() To call the 'updates_register_activity_actions' hook
+ * @since 1.6
  */
-function updates_register_activity_actions() {
+function bp_activity_register_activity_actions() {
 	global $bp;
 
-	bp_activity_set_action( $bp->activity->id, 'activity_update', __( 'Posted an update', 'buddypress' ) );
+	bp_activity_set_action( $bp->activity->id, 'activity_update', __( 'Posted a status update', 'buddypress' ) );
+	bp_activity_set_action( $bp->activity->id, 'activity_comment', __( 'Replied to a status update', 'buddypress' ) );
+
+	do_action( 'bp_activity_register_activity_actions' );
 
+	// Backpat. Don't use this.
 	do_action( 'updates_register_activity_actions' );
 }
-add_action( 'bp_register_activity_actions', 'updates_register_activity_actions' );
+add_action( 'bp_register_activity_actions', 'bp_activity_register_activity_actions' );
 
 /******************************************************************************
  * Business functions are where all the magic happens in BuddyPress. They will
@@ -677,7 +784,7 @@ add_action( 'bp_register_activity_actions', 'updates_register_activity_actions'
 /**
  * Retrieve an activity or activities
  *
- * @since 1.2.0
+ * @since BuddyPress (1.2)
  *
  * @param array $args
  *
@@ -691,16 +798,17 @@ add_action( 'bp_register_activity_actions', 'updates_register_activity_actions'
  */
 function bp_activity_get( $args = '' ) {
 	$defaults = array(
-		'max'              => false,  // Maximum number of results to return
-		'page'             => 1,      // page 1 without a per_page will result in no pagination.
-		'per_page'         => false,  // results per page
-		'sort'             => 'DESC', // sort ASC or DESC
-		'display_comments' => false,  // false for no comments. 'stream' for within stream display, 'threaded' for below each activity item
-
-		'search_terms'     => false,  // Pass search terms as a string
-		'show_hidden'      => false,  // Show activity items that are hidden site-wide?
-		'exclude'          => false,  // Comma-separated list of activity IDs to exclude
-		'in'               => false,  // Comma-separated list or array of activity IDs to which you want to limit the query
+		'max'              => false,        // Maximum number of results to return
+		'page'             => 1,            // page 1 without a per_page will result in no pagination.
+		'per_page'         => false,        // results per page
+		'sort'             => 'DESC',       // sort ASC or DESC
+		'display_comments' => false,        // false for no comments. 'stream' for within stream display, 'threaded' for below each activity item
+
+		'search_terms'     => false,        // Pass search terms as a string
+		'show_hidden'      => false,        // Show activity items that are hidden site-wide?
+		'exclude'          => false,        // Comma-separated list of activity IDs to exclude
+		'in'               => false,        // Comma-separated list or array of activity IDs to which you want to limit the query
+		'spam'             => 'ham_only',   // 'ham_only' (default), 'spam_only' or 'all'.
 
 		/**
 		 * Pass filters as an array -- all filter items can be multiple values comma separated:
@@ -718,13 +826,39 @@ function bp_activity_get( $args = '' ) {
 	extract( $r, EXTR_SKIP );
 
 	// Attempt to return a cached copy of the first page of sitewide activity.
-	if ( 1 == (int)$page && empty( $max ) && empty( $search_terms ) && empty( $filter ) && 'DESC' == $sort && empty( $exclude ) ) {
+	if ( 1 == (int) $page && empty( $max ) && empty( $search_terms ) && empty( $filter ) && empty( $exclude ) && empty( $in ) && 'DESC' == $sort && empty( $exclude ) && 'ham_only' == $spam ) {
 		if ( !$activity = wp_cache_get( 'bp_activity_sitewide_front', 'bp' ) ) {
-			$activity = BP_Activity_Activity::get( $max, $page, $per_page, $sort, $search_terms, $filter, $display_comments, $show_hidden );
+			$args = array(
+				'page'             => $page,
+				'per_page'         => $per_page,
+				'max'              => $max,
+				'sort'             => $sort,
+				'search_terms'     => $search_terms,
+				'filter'           => $filter,
+				'display_comments' => $display_comments,
+				'show_hidden'      => $show_hidden,
+				'spam'             => $spam
+			);
+			$activity = BP_Activity_Activity::get( $args );
 			wp_cache_set( 'bp_activity_sitewide_front', $activity, 'bp' );
 		}
-	} else
-		$activity = BP_Activity_Activity::get( $max, $page, $per_page, $sort, $search_terms, $filter, $display_comments, $show_hidden, $exclude, $in );
+
+	} else {
+		$args = array(
+			'page'             => $page,
+			'per_page'         => $per_page,
+			'max'              => $max,
+			'sort'             => $sort,
+			'search_terms'     => $search_terms,
+			'filter'           => $filter,
+			'display_comments' => $display_comments,
+			'show_hidden'      => $show_hidden,
+			'exclude'          => $exclude,
+			'in'               => $in,
+			'spam'             => $spam
+		);
+		$activity = BP_Activity_Activity::get( $args );
+	}
 
 	return apply_filters_ref_array( 'bp_activity_get', array( &$activity, &$r ) );
 }
@@ -732,7 +866,7 @@ function bp_activity_get( $args = '' ) {
 /**
  * Fetch specific activity items
  *
- * @since 1.2.0
+ * @since BuddyPress (1.2)
  *
  * @param array $args See docs for $defaults for details
  *
@@ -744,28 +878,38 @@ function bp_activity_get( $args = '' ) {
  */
 function bp_activity_get_specific( $args = '' ) {
 	$defaults = array(
-		'activity_ids'     => false,  // A single activity_id or array of IDs.
-		'page'             => 1,      // page 1 without a per_page will result in no pagination.
-		'per_page'         => false,  // results per page
-		'max'              => false,  // Maximum number of results to return
-		'sort'             => 'DESC', // sort ASC or DESC
-		'display_comments' => false,  // true or false to display threaded comments for these specific activity items
-		'show_hidden'      => true    // When fetching specific items, show all
+		'activity_ids'     => false,       // A single activity_id or array of IDs.
+		'display_comments' => false,       // true or false to display threaded comments for these specific activity items
+		'max'              => false,       // Maximum number of results to return
+		'page'             => 1,           // page 1 without a per_page will result in no pagination.
+		'per_page'         => false,       // results per page
+		'show_hidden'      => true,        // When fetching specific items, show all
+		'sort'             => 'DESC',      // sort ASC or DESC
+		'spam'             => 'ham_only',  // Retrieve items marked as spam
 	);
 	$r = wp_parse_args( $args, $defaults );
 	extract( $r, EXTR_SKIP );
 
-	return apply_filters( 'bp_activity_get_specific', BP_Activity_Activity::get( $max, $page, $per_page, $sort, false, false, $display_comments, $show_hidden, false, $activity_ids ) );
+	$get_args = array(
+		'page'             => $page,
+		'per_page'         => $per_page,
+		'max'              => $max,
+		'sort'             => $sort,
+		'display_comments' => $display_comments,
+		'show_hidden'      => $show_hidden,
+		'in'               => $activity_ids,
+		'spam'             => $spam
+	);
+	return apply_filters( 'bp_activity_get_specific', BP_Activity_Activity::get( $get_args ), $args, $get_args );
 }
 
 /**
  * Add an activity item
  *
- * @since 1.1.0
+ * @since BuddyPress (1.1)
  *
  * @param array $args See docs for $defaults for details
  *
- * @global object $bp BuddyPress global settings
  * @uses wp_parse_args()
  * @uses BP_Activity_Activity::save() {@link BP_Activity_Activity}
  * @uses BP_Activity_Activity::rebuild_activity_comment_tree() {@link BP_Activity_Activity}
@@ -775,7 +919,6 @@ function bp_activity_get_specific( $args = '' ) {
  * @return int The activity id
  */
 function bp_activity_add( $args = '' ) {
-	global $bp;
 
 	$defaults = array(
 		'id'                => false, // Pass an existing activity ID to update an existing entry.
@@ -787,11 +930,12 @@ function bp_activity_add( $args = '' ) {
 		'type'              => false, // The activity type e.g. activity_update, profile_updated
 		'primary_link'      => '',    // Optional: The primary URL for this item in RSS feeds (defaults to activity permalink)
 
-		'user_id'           => $bp->loggedin_user->id, // Optional: The user to record the activity for, can be false if this activity is not for a user.
+		'user_id'           => bp_loggedin_user_id(), // Optional: The user to record the activity for, can be false if this activity is not for a user.
 		'item_id'           => false, // Optional: The ID of the specific item being recorded, e.g. a blog_id
 		'secondary_item_id' => false, // Optional: A second ID used to further filter e.g. a comment_id
 		'recorded_time'     => bp_core_current_time(), // The GMT time that this activity was recorded
-		'hide_sitewide'     => false  // Should this be hidden on the sitewide activity stream?
+		'hide_sitewide'     => false, // Should this be hidden on the sitewide activity stream?
+		'is_spam'           => false, // Is this activity item to be marked as spam?
 	);
 	$params = wp_parse_args( $args, $defaults );
 	extract( $params, EXTR_SKIP );
@@ -815,6 +959,7 @@ function bp_activity_add( $args = '' ) {
 	$activity->secondary_item_id = $secondary_item_id;
 	$activity->date_recorded     = $recorded_time;
 	$activity->hide_sitewide     = $hide_sitewide;
+	$activity->is_spam           = $is_spam;
 
 	if ( !$activity->save() )
 		return false;
@@ -832,14 +977,13 @@ function bp_activity_add( $args = '' ) {
 /**
  * Post an activity update
  *
- * @since 1.2.0
+ * @since BuddyPress (1.2)
  *
  * @param array $args See docs for $defaults for details
  *
  * @global object $bp BuddyPress global settings
  * @uses wp_parse_args()
- * @uses bp_core_is_user_spammer()
- * @uses bp_core_is_user_deleted()
+ * @uses bp_is_user_inactive()
  * @uses bp_core_get_userlink()
  * @uses bp_activity_add()
  * @uses apply_filters() To call the 'bp_activity_new_update_action' hook
@@ -856,7 +1000,7 @@ function bp_activity_post_update( $args = '' ) {
 
 	$defaults = array(
 		'content' => false,
-		'user_id' => $bp->loggedin_user->id
+		'user_id' => bp_loggedin_user_id()
 	);
 	$r = wp_parse_args( $args, $defaults );
 	extract( $r, EXTR_SKIP );
@@ -864,7 +1008,7 @@ function bp_activity_post_update( $args = '' ) {
 	if ( empty( $content ) || !strlen( trim( $content ) ) )
 		return false;
 
-	if ( bp_core_is_user_spammer( $user_id ) || bp_core_is_user_deleted( $user_id ) )
+	if ( bp_is_user_inactive( $user_id ) )
 		return false;
 
 	// Record this on the user's profile
@@ -883,8 +1027,10 @@ function bp_activity_post_update( $args = '' ) {
 		'type'         => 'activity_update'
 	) );
 
+	$activity_content = apply_filters( 'bp_activity_latest_update_content', $content ); 
+
 	// Add this update to the "latest update" usermeta so it can be fetched anywhere.
-	bp_update_user_meta( $bp->loggedin_user->id, 'bp_latest_update', array( 'id' => $activity_id, 'content' => wp_filter_kses( $content ) ) );
+	bp_update_user_meta( bp_loggedin_user_id(), 'bp_latest_update', array( 'id' => $activity_id, 'content' => $content ) );
 
 	do_action( 'bp_activity_posted_update', $content, $user_id, $activity_id );
 
@@ -894,7 +1040,7 @@ function bp_activity_post_update( $args = '' ) {
 /**
  * Add an activity comment
  *
- * @since 1.2.0
+ * @since BuddyPress (1.2)
  *
  * @param array $args See docs for $defaults for details
  *
@@ -915,7 +1061,7 @@ function bp_activity_new_comment( $args = '' ) {
 	$defaults = array(
 		'id'          => false,
 		'content'     => false,
-		'user_id'     => $bp->loggedin_user->id,
+		'user_id'     => bp_loggedin_user_id(),
 		'activity_id' => false, // ID of the root activity item
 		'parent_id'   => false  // ID of a parent comment (optional)
 	);
@@ -923,27 +1069,27 @@ function bp_activity_new_comment( $args = '' ) {
 	$params = wp_parse_args( $args, $defaults );
 	extract( $params, EXTR_SKIP );
 
-	if ( empty($content) || empty($user_id) || empty($activity_id) )
+	if ( empty( $content ) || empty( $user_id ) || empty( $activity_id ) )
 		return false;
 
-	if ( empty($parent_id) )
+	if ( empty( $parent_id ) )
 		$parent_id = $activity_id;
 
 	// Check to see if the parent activity is hidden, and if so, hide this comment publically.
 	$activity = new BP_Activity_Activity( $activity_id );
-	$is_hidden = ( (int)$activity->hide_sitewide ) ? 1 : 0;
+	$is_hidden = ( (int) $activity->hide_sitewide ) ? 1 : 0;
 
 	// Insert the activity comment
 	$comment_id = bp_activity_add( array(
-		'id' => $id,
-		'action' => apply_filters( 'bp_activity_comment_action', sprintf( __( '%s posted a new activity comment', 'buddypress' ), bp_core_get_userlink( $user_id ) ) ),
-		'content' => apply_filters( 'bp_activity_comment_content', $content ),
-		'component' => $bp->activity->id,
-		'type' => 'activity_comment',
-		'user_id' => $user_id,
-		'item_id' => $activity_id,
+		'id'                => $id,
+		'action'            => apply_filters( 'bp_activity_comment_action', sprintf( __( '%s posted a new activity comment', 'buddypress' ), bp_core_get_userlink( $user_id ) ) ),
+		'content'           => apply_filters( 'bp_activity_comment_content', $content ),
+		'component'         => $bp->activity->id,
+		'type'              => 'activity_comment',
+		'user_id'           => $user_id,
+		'item_id'           => $activity_id,
 		'secondary_item_id' => $parent_id,
-		'hide_sitewide' => $is_hidden
+		'hide_sitewide'     => $is_hidden
 	) );
 
 	// Send an email notification if settings allow
@@ -960,7 +1106,7 @@ function bp_activity_new_comment( $args = '' ) {
 /**
  * Fetch the activity_id for an existing activity entry in the DB.
  *
- * @since 1.2.0
+ * @since BuddyPress (1.2)
  *
  * @param array $args See docs for $defaults for details
  *
@@ -1001,11 +1147,10 @@ function bp_activity_get_activity_id( $args = '' ) {
  *
  * If you are deleting an activity comment please use bp_activity_delete_comment();
  *
- * @since 1.0.0
+ * @since BuddyPress (1.0)
  *
  * @param array $args See docs for $defaults for details
  *
- * @global object $bp BuddyPress global settings
  * @uses wp_parse_args()
  * @uses bp_activity_adjust_mention_count()
  * @uses BP_Activity_Activity::delete() {@link BP_Activity_Activity}
@@ -1019,7 +1164,6 @@ function bp_activity_get_activity_id( $args = '' ) {
  * @return bool True on success, false on failure
  */
 function bp_activity_delete( $args = '' ) {
-	global $bp;
 
 	// Pass one or more the of following variables to delete by those variables
 	$defaults = array(
@@ -1038,6 +1182,8 @@ function bp_activity_delete( $args = '' ) {
 
 	$args = wp_parse_args( $args, $defaults );
 
+	do_action( 'bp_before_activity_delete', $args );
+
 	// Adjust the new mention count of any mentioned member
 	bp_activity_adjust_mention_count( $args['id'], 'delete' );
 
@@ -1046,16 +1192,15 @@ function bp_activity_delete( $args = '' ) {
 
 	// Check if the user's latest update has been deleted
 	if ( empty( $args['user_id'] ) )
-		$user_id = $bp->loggedin_user->id;
+		$user_id = bp_loggedin_user_id();
 	else
 		$user_id = $args['user_id'];
 
-	do_action( 'bp_before_activity_delete', $args );
-
 	$latest_update = bp_get_user_meta( $user_id, 'bp_latest_update', true );
 	if ( !empty( $latest_update ) ) {
-		if ( in_array( (int)$latest_update['id'], (array)$activity_ids_deleted ) )
+		if ( in_array( (int) $latest_update['id'], (array) $activity_ids_deleted ) ) {
 			bp_delete_user_meta( $user_id, 'bp_latest_update' );
+		}
 	}
 
 	do_action( 'bp_activity_delete', $args );
@@ -1071,21 +1216,25 @@ function bp_activity_delete( $args = '' ) {
 	 *
 	 * You should use bp_activity_delete() instead
 	 *
-	 * @since 1.1.0
-	 * @deprecated 1.2.0
+	 * @since BuddyPress (1.1)
+	 * @deprecated BuddyPress (1.2)
 	 *
 	 * @param array $args See docs for $defaults for details
 	 *
-	 * @global object $bp BuddyPress global settings
 	 * @uses wp_parse_args()
 	 * @uses bp_activity_delete()
 	 *
 	 * @return bool True on success, false on failure
 	 */
 	function bp_activity_delete_by_item_id( $args = '' ) {
-		global $bp;
 
-		$defaults = array( 'item_id' => false, 'component' => false, 'type' => false, 'user_id' => false, 'secondary_item_id' => false );
+		$defaults = array(
+			'item_id'           => false,
+			'component'         => false,
+			'type'              => false,
+			'user_id'           => false,
+			'secondary_item_id' => false
+		);
 		$r = wp_parse_args( $args, $defaults );
 		extract( $r, EXTR_SKIP );
 
@@ -1097,8 +1246,8 @@ function bp_activity_delete( $args = '' ) {
 	 *
 	 * You should use bp_activity_delete() instead
 	 *
-	 * @since 1.1.0
-	 * @deprecated 1.2.0
+	 * @since BuddyPress (1.1)
+	 * @deprecated BuddyPress (1.2)
 	 *
 	 * @param int $activity_id The activity id
 	 *
@@ -1115,8 +1264,8 @@ function bp_activity_delete( $args = '' ) {
 	 *
 	 * You should use bp_activity_delete() instead
 	 *
-	 * @since 1.1.0
-	 * @deprecated 1.2.0
+	 * @since BuddyPress (1.1)
+	 * @deprecated BuddyPress (1.2)
 	 *
 	 * @param int $user_id The user id
 	 * @param string $content The activity id
@@ -1136,8 +1285,8 @@ function bp_activity_delete( $args = '' ) {
 	 *
 	 * You should use bp_activity_delete() instead
 	 *
-	 * @since 1.1.0
-	 * @deprecated 1.2.0
+	 * @since BuddyPress (1.1)
+	 * @deprecated BuddyPress (1.2)
 	 *
 	 * @param int $user_id The user id
 	 * @param string $component The activity component
@@ -1153,7 +1302,7 @@ function bp_activity_delete( $args = '' ) {
 /**
  * Delete an activity comment
  *
- * @since 1.2.0
+ * @since BuddyPress (1.2)
  *
  * @param int $activity_id The activity id
  * @param int $comment_id The activity comment id
@@ -1192,7 +1341,7 @@ function bp_activity_delete_comment( $activity_id, $comment_id ) {
 	/**
 	 * Delete an activity comment's children
 	 *
-	 * @since 1.2.0
+	 * @since BuddyPress (1.2)
 	 *
 	 * @param int $activity_id The activity id
 	 * @param int $comment_id The activity comment id
@@ -1204,8 +1353,9 @@ function bp_activity_delete_comment( $activity_id, $comment_id ) {
 	function bp_activity_delete_children( $activity_id, $comment_id) {
 		// Recursively delete all children of this comment.
 		if ( $children = BP_Activity_Activity::get_child_comments( $comment_id ) ) {
-			foreach( (array)$children as $child )
+			foreach( (array) $children as $child ) {
 				bp_activity_delete_children( $activity_id, $child->id );
+			}
 		}
 		bp_activity_delete( array( 'secondary_item_id' => $comment_id, 'type' => 'activity_comment', 'item_id' => $activity_id ) );
 	}
@@ -1217,12 +1367,11 @@ function bp_activity_delete_comment( $activity_id, $comment_id ) {
  * object. To save yourself some processing overhead, be sure to pass the full $activity_obj param
  * as well, if you already have it available.
  *
- * @since 1.2.0
+ * @since BuddyPress (1.2)
  *
  * @param int $activity_id The unique id of the activity object
  * @param object $activity_obj (optional) The activity object
  *
- * @global object $bp BuddyPress global settings
  * @uses bp_get_root_domain()
  * @uses bp_get_activity_root_slug()
  * @uses apply_filters_ref_array() To call the 'bp_activity_get_permalink' hook
@@ -1230,22 +1379,22 @@ function bp_activity_delete_comment( $activity_id, $comment_id ) {
  * @return string $link Permalink for the activity item
  */
 function bp_activity_get_permalink( $activity_id, $activity_obj = false ) {
-	global $bp;
 
-	if ( !$activity_obj )
+	if ( empty( $activity_obj ) )
 		$activity_obj = new BP_Activity_Activity( $activity_id );
 
 	if ( isset( $activity_obj->current_comment ) ) {
 		$activity_obj = $activity_obj->current_comment;
 	}
 
-	if ( 'new_blog_post' == $activity_obj->type || 'new_blog_comment' == $activity_obj->type || 'new_forum_topic' == $activity_obj->type || 'new_forum_post' == $activity_obj->type )
+	if ( 'new_blog_post' == $activity_obj->type || 'new_blog_comment' == $activity_obj->type || 'new_forum_topic' == $activity_obj->type || 'new_forum_post' == $activity_obj->type ) {
 		$link = $activity_obj->primary_link;
-	else {
-		if ( 'activity_comment' == $activity_obj->type )
+	} else {
+		if ( 'activity_comment' == $activity_obj->type ) {
 			$link = bp_get_root_domain() . '/' . bp_get_activity_root_slug() . '/p/' . $activity_obj->item_id . '/';
-		else
+		} else {
 			$link = bp_get_root_domain() . '/' . bp_get_activity_root_slug() . '/p/' . $activity_obj->id . '/';
+		}
 	}
 
 	return apply_filters_ref_array( 'bp_activity_get_permalink', array( $link, &$activity_obj ) );
@@ -1254,7 +1403,7 @@ function bp_activity_get_permalink( $activity_id, $activity_obj = false ) {
 /**
  * Hide a user's activity
  *
- * @since 1.2.0
+ * @since BuddyPress (1.2)
  *
  * @param int $user_id The user id
  *
@@ -1269,7 +1418,7 @@ function bp_activity_hide_user_activity( $user_id ) {
 /**
  * Take content, remove all images and replace them with one thumbnail image.
  *
- * @since 1.2.0
+ * @since BuddyPress (1.2)
  *
  * @param string $content The content to work with
  * @param string $link Optional. The URL that the image should link to
@@ -1280,32 +1429,31 @@ function bp_activity_hide_user_activity( $user_id ) {
  * @return string $content The content with images stripped and replaced with a single thumb.
  */
 function bp_activity_thumbnail_content_images( $content, $link = false ) {
-	global $post;
 
 	preg_match_all( '/<img[^>]*>/Ui', $content, $matches );
-	$content = preg_replace('/<img[^>]*>/Ui', '', $content );
-
+	$content = preg_replace('|(\[caption(.*?)\])?<img[^>]*>(\[/caption\])?|', '', $content );
+	
 	if ( !empty( $matches ) && !empty( $matches[0] ) ) {
 		// Get the SRC value
 		preg_match( '/<img.*?(src\=[\'|"]{0,1}.*?[\'|"]{0,1})[\s|>]{1}/i', $matches[0][0], $src );
 
 		// Get the width and height
 		preg_match( '/<img.*?(height\=[\'|"]{0,1}.*?[\'|"]{0,1})[\s|>]{1}/i', $matches[0][0], $height );
-		preg_match( '/<img.*?(width\=[\'|"]{0,1}.*?[\'|"]{0,1})[\s|>]{1}/i', $matches[0][0], $width );
+		preg_match( '/<img.*?(width\=[\'|"]{0,1}.*?[\'|"]{0,1})[\s|>]{1}/i',  $matches[0][0], $width  );
 
 		if ( !empty( $src ) ) {
-			$src = substr( substr( str_replace( 'src=', '', $src[1] ), 0, -1 ), 1 );
+			$src    = substr( substr( str_replace( 'src=', '', $src[1] ), 0, -1 ), 1 );
 			$height = substr( substr( str_replace( 'height=', '', $height[1] ), 0, -1 ), 1 );
-			$width = substr( substr( str_replace( 'width=', '', $width[1] ), 0, -1 ), 1 );
+			$width  = substr( substr( str_replace( 'width=', '', $width[1] ), 0, -1 ), 1 );
 
 			if ( empty( $width ) || empty( $height ) ) {
-				$width = 100;
+				$width  = 100;
 				$height = 100;
 			}
 
-			$ratio = (int)$width / (int)$height;
-			$new_height = (int)$height >= 100 ? 100 : $height;
-			$new_width = $new_height * $ratio;
+			$ratio      = (int) $width / (int) $height;
+			$new_height = (int) $height >= 100 ? 100 : $height;
+			$new_width  = $new_height * $ratio;
 
 			$image = '<img src="' . esc_attr( $src ) . '" width="' . $new_width . '" height="' . $new_height . '" alt="' . __( 'Thumbnail', 'buddypress' ) . '" class="align-left thumbnail" />';
 
@@ -1320,6 +1468,90 @@ function bp_activity_thumbnail_content_images( $content, $link = false ) {
 	return apply_filters( 'bp_activity_thumbnail_content_images', $content, $matches );
 }
 
+/**
+ * Convenience function to control whether the current user is allowed to mark activity items as spam
+ *
+ * @return bool True if user is allowed to mark activity items as spam
+ * @since 1.6
+ * @static
+ */
+function bp_activity_user_can_mark_spam() {
+	return apply_filters( 'bp_activity_user_can_mark_spam', bp_current_user_can( 'bp_moderate' ) );
+}
+
+/**
+ * Mark activity item as spam
+ *
+ * @global object $bp BuddyPress global settings
+ * @param BP_Activity_Activity $activity
+ * @param string $source Optional; default is "by_a_person" (e.g. a person has manually marked the activity as spam).
+ * @since 1.6
+ */
+function bp_activity_mark_as_spam( &$activity, $source = 'by_a_person' ) {
+	global $bp;
+
+	$activity->is_spam = 1;
+
+	// Clear the activity stream first page cache
+	wp_cache_delete( 'bp_activity_sitewide_front', 'bp' );
+
+	// Clear the activity comment cache for this activity item
+	wp_cache_delete( 'bp_activity_comments_' . $activity->id, 'bp' );
+
+	// If Akismet is active, and this was a manual spam/ham request, stop Akismet checking the activity
+	if ( 'by_a_person' == $source && !empty( $bp->activity->akismet ) ) {
+		remove_action( 'bp_activity_before_save', array( $bp->activity->akismet, 'check_activity' ), 4, 1 );
+
+		// Build data package for Akismet
+		$activity_data = BP_Akismet::build_akismet_data_package( $activity );
+
+		// Tell Akismet this is spam
+		$activity_data = $bp->activity->akismet->send_akismet_request( $activity_data, 'submit', 'spam' );
+
+		// Update meta
+		add_action( 'bp_activity_after_save', array( $bp->activity->akismet, 'update_activity_spam_meta' ), 1, 1 );
+	}
+
+	do_action( 'bp_activity_mark_as_spam', $activity, $source );
+}
+
+/**
+ * Mark activity item as ham
+ *
+ * @global object $bp BuddyPress global settings
+ * @param BP_Activity_Activity $activity
+ * @param string $source Optional; default is "by_a_person" (e.g. a person has manually marked the activity as spam).
+ * @since 1.6
+ */
+function bp_activity_mark_as_ham( &$activity, $source = 'by_a_person' ) {
+	global $bp;
+
+	$activity->is_spam = 0;
+
+	// Clear the activity stream first page cache
+	wp_cache_delete( 'bp_activity_sitewide_front', 'bp' );
+
+	// Clear the activity comment cache for this activity item
+	wp_cache_delete( 'bp_activity_comments_' . $activity->id, 'bp' );
+
+	// If Akismet is active, and this was a manual spam/ham request, stop Akismet checking the activity
+	if ( 'by_a_person' == $source && !empty( $bp->activity->akismet ) ) {
+		remove_action( 'bp_activity_before_save', array( $bp->activity->akismet, 'check_activity' ), 4, 1 );
+
+		// Build data package for Akismet
+		$activity_data = BP_Akismet::build_akismet_data_package( $activity );
+
+		// Tell Akismet this is spam
+		$activity_data = $bp->activity->akismet->send_akismet_request( $activity_data, 'submit', 'ham' );
+
+		// Update meta
+		add_action( 'bp_activity_after_save', array( $bp->activity->akismet, 'update_activity_ham_meta' ), 1, 1 );
+	}
+
+	do_action( 'bp_activity_mark_as_ham', $activity, $source );
+} 
+
+
 /** Embeds *******************************************************************/
 
 /**
@@ -1329,7 +1561,7 @@ function bp_activity_thumbnail_content_images( $content, $link = false ) {
  * This does not cover recursive activity comments, as they do not use a real loop.
  * For that, see {@link bp_activity_comment_embed()}.
  *
- * @since 1.5
+ * @since BuddyPress (1.5)
  *
  * @see BP_Embed
  * @see bp_embed_activity_cache()
@@ -1351,7 +1583,7 @@ add_action( 'activity_loop_start', 'bp_activity_embed' );
  * when BP is recursing through activity comments {@link bp_activity_recurse_comments()}.
  * If no cache and link is embeddable, cache it.
  *
- * @since 1.5
+ * @since BuddyPress (1.5)
  *
  * @see BP_Embed
  * @see bp_embed_activity_cache()
@@ -1371,7 +1603,7 @@ add_action( 'bp_before_activity_comment', 'bp_activity_comment_embed' );
 /**
  * When a user clicks on a "Read More" item, make sure embeds are correctly parsed and shown for the expanded content.
  *
- * @since 1.5
+ * @since BuddyPress (1.5)
  *
  * @see BP_Embed
  *
@@ -1398,7 +1630,7 @@ add_action( 'bp_dtheme_get_single_activity_content', 'bp_dtheme_embed_read_more'
  * is rendered to avoid conflict with the 'embed_post_id' filter in
  * {@link bp_activity_embed()} or any other component embeds.
  *
- * @since 1.5
+ * @since BuddyPress (1.5)
  *
  * @see bp_activity_comment_embed()
  *
@@ -1413,7 +1645,7 @@ add_action( 'bp_after_activity_comment', 'bp_activity_comment_embed_after_recurs
  * Wrapper function for {@link bp_activity_get_meta()}.
  * Used during {@link BP_Embed::parse_oembed()} via {@link bp_activity_embed()}.
  *
- * @since 1.5
+ * @since BuddyPress (1.5)
  *
  * @uses bp_activity_get_meta()
  *
@@ -1427,11 +1659,12 @@ function bp_embed_activity_cache( $cache, $id, $cachekey ) {
  * Wrapper function for {@link bp_activity_update_meta()}.
  * Used during {@link BP_Embed::parse_oembed()} via {@link bp_activity_embed()}.
  *
- * @since 1.5
+ * @since BuddyPress (1.5)
  *
  * @uses bp_activity_update_meta()
  */
 function bp_embed_activity_save_cache( $cache, $cachekey, $id ) {
 	bp_activity_update_meta( $id, $cachekey, $cache );
 }
-?>
\ No newline at end of file
+
+?>
diff --git a/wp-content/plugins/buddypress/bp-activity/bp-activity-loader.php b/wp-content/plugins/buddypress/bp-activity/bp-activity-loader.php
index a31b777c6353dc462d897466d82d0ce2e00dc1a8..90e0940ccf90afda9bf55daee0eedf63d0df4de3 100644
--- a/wp-content/plugins/buddypress/bp-activity/bp-activity-loader.php
+++ b/wp-content/plugins/buddypress/bp-activity/bp-activity-loader.php
@@ -15,19 +15,15 @@ if ( !defined( 'ABSPATH' ) ) exit;
 /**
  * Main Activity Class
  *
- * @since 1.5.0
+ * @since BuddyPress (1.5)
  */
 class BP_Activity_Component extends BP_Component {
 
 	/**
 	 * Start the activity component creation process
 	 *
-	 * @since 1.5.0
+	 * @since BuddyPress (1.5)
 	 */
-	function BP_Activity_Component() {
-		$this->__construct();
-	}
-
 	function __construct() {
 		parent::start(
 			'activity',
@@ -39,7 +35,7 @@ class BP_Activity_Component extends BP_Component {
 	/**
 	 * Include files
 	 *
-	 * @since 1.5.0
+	 * @since BuddyPress (1.5)
 	 */
 	function includes() {
 		// Files to include
@@ -51,8 +47,17 @@ class BP_Activity_Component extends BP_Component {
 			'template',
 			'functions',
 			'notifications',
+			'cache'
 		);
 
+		// Load Akismet support if Akismet is configured
+		$akismet_key = bp_get_option( 'wordpress_api_key' );
+		if ( defined( 'AKISMET_VERSION' ) && ( !empty( $akismet_key ) || defined( 'WPCOM_API_KEY' ) ) && apply_filters( 'bp_activity_use_akismet', true ) )
+			$includes[] = 'akismet';
+
+		if ( is_admin() )
+			$includes[] = 'admin';
+
 		parent::includes( $includes );
 	}
 
@@ -62,7 +67,7 @@ class BP_Activity_Component extends BP_Component {
 	 * The BP_ACTIVITY_SLUG constant is deprecated, and only used here for
 	 * backwards compatibility.
 	 *
-	 * @since 1.5.0
+	 * @since BuddyPress (1.5)
 	 *
 	 * @global object $bp BuddyPress global settings
 	 */
@@ -82,7 +87,6 @@ class BP_Activity_Component extends BP_Component {
 		// All globals for activity component.
 		// Note that global_tables is included in this array.
 		$globals = array(
-			'path'                  => BP_PLUGIN_DIR,
 			'slug'                  => BP_ACTIVITY_SLUG,
 			'root_slug'             => isset( $bp->pages->activity->slug ) ? $bp->pages->activity->slug : BP_ACTIVITY_SLUG,
 			'has_directory'         => true,
@@ -97,7 +101,7 @@ class BP_Activity_Component extends BP_Component {
 	/**
 	 * Setup BuddyBar navigation
 	 *
-	 * @since 1.5.0
+	 * @since BuddyPress (1.5)
 	 *
 	 * @global object $bp BuddyPress global settings
 	 * @uses bp_is_active()
@@ -106,7 +110,8 @@ class BP_Activity_Component extends BP_Component {
 	 * @uses bp_get_groups_slug()
 	 */
 	function setup_nav() {
-		global $bp;
+
+		$sub_nav = array();
 
 		// Add 'Activity' to the main navigation
 		$main_nav = array(
@@ -119,14 +124,14 @@ class BP_Activity_Component extends BP_Component {
 		);
 
 		// Stop if there is no user displayed or logged in
-		if ( !is_user_logged_in() && !isset( $bp->displayed_user->id ) )
+		if ( !is_user_logged_in() && !bp_displayed_user_id() )
 			return;
 
 		// Determine user to use
-		if ( isset( $bp->displayed_user->domain ) )
-			$user_domain = $bp->displayed_user->domain;
-		elseif ( isset( $bp->loggedin_user->domain ) )
-			$user_domain = $bp->loggedin_user->domain;
+		if ( bp_displayed_user_domain() )
+			$user_domain = bp_displayed_user_domain();
+		elseif ( bp_loggedin_user_domain() )
+			$user_domain = bp_loggedin_user_domain();
 		else
 			return;
 
@@ -195,9 +200,9 @@ class BP_Activity_Component extends BP_Component {
 	}
 
 	/**
-	 * Set up the admin bar
+	 * Set up the Toolbar
 	 *
-	 * @since 1.5.0
+	 * @since BuddyPress (1.5)
 	 *
 	 * @global object $bp BuddyPress global settings
 	 * @uses is_user_logged_in()
@@ -218,12 +223,13 @@ class BP_Activity_Component extends BP_Component {
 		if ( is_user_logged_in() ) {
 
 			// Setup the logged in user variables
-			$user_domain   = $bp->loggedin_user->domain;
+			$user_domain   = bp_loggedin_user_domain();
 			$activity_link = trailingslashit( $user_domain . $this->slug );
 
 			// Unread message count
-			if ( $count = bp_get_total_mention_count_for_user( bp_loggedin_user_id() ) ) {
-				$title = sprintf( __( 'Mentions <span class="count">%s</span>', 'buddypress' ), $count );
+			$count = bp_get_total_mention_count_for_user( bp_loggedin_user_id() );
+			if ( !empty( $count ) ) {
+				$title = sprintf( __( 'Mentions <span class="count">%s</span>', 'buddypress' ), number_format_i18n( $count ) );
 			} else {
 				$title = __( 'Mentions', 'buddypress' );
 			}
@@ -287,7 +293,7 @@ class BP_Activity_Component extends BP_Component {
 	/**
 	 * Sets up the title for pages and <title>
 	 *
-	 * @since 1.5.0
+	 * @since BuddyPress (1.5)
 	 *
 	 * @global object $bp BuddyPress global settings
 	 * @uses bp_is_activity_component()
@@ -303,18 +309,35 @@ class BP_Activity_Component extends BP_Component {
 				$bp->bp_options_title = __( 'My Activity', 'buddypress' );
 			} else {
 				$bp->bp_options_avatar = bp_core_fetch_avatar( array(
-					'item_id' => $bp->displayed_user->id,
-					'type'    => 'thumb'
+					'item_id' => bp_displayed_user_id(),
+					'type'    => 'thumb',
+					'alt'	  => sprintf( __( 'Profile picture of %s', 'buddypress' ), bp_get_displayed_user_fullname() )
 				) );
-				$bp->bp_options_title  = $bp->displayed_user->fullname;
+				$bp->bp_options_title  = bp_get_displayed_user_fullname();
 			}
 		}
 
 		parent::setup_title();
 	}
+
+	/**
+	 * Setup the actions
+	 *
+	 * @since 1.6
+	 */
+	 function setup_actions() {
+		// Spam prevention
+		add_action( 'bp_include', 'bp_activity_setup_akismet' );
+
+		parent::setup_actions();
+	}
 }
 
-// Create the activity component
-$bp->activity = new BP_Activity_Component();
+function bp_setup_activity() {
+	global $bp;
+
+	$bp->activity = new BP_Activity_Component();
+}
+add_action( 'bp_setup_components', 'bp_setup_activity', 6 );
 
-?>
\ No newline at end of file
+?>
diff --git a/wp-content/plugins/buddypress/bp-activity/bp-activity-notifications.php b/wp-content/plugins/buddypress/bp-activity/bp-activity-notifications.php
index 0c27c53537ebe56a4fecc191e97e6f46d360746d..faa3b0f7f96b21ba3051a95cea5d9a0efb6a658e 100644
--- a/wp-content/plugins/buddypress/bp-activity/bp-activity-notifications.php
+++ b/wp-content/plugins/buddypress/bp-activity/bp-activity-notifications.php
@@ -13,12 +13,11 @@ if ( !defined( 'ABSPATH' ) ) exit;
 /**
  * Sends an email notification and a BP notification when someone mentions you in an update
  *
- * @since 1.2.0
+ * @since BuddyPress (1.2)
  *
  * @param int $activity_id The id of the activity update
  * @param int $receiver_user_id The unique user_id of the user who is receiving the update
  *
- * @global object $bp BuddyPress global settings
  * @uses bp_core_add_notification()
  * @uses bp_get_user_meta()
  * @uses bp_core_get_user_displayname()
@@ -39,7 +38,15 @@ if ( !defined( 'ABSPATH' ) ) exit;
  * @uses do_action() To call the 'bp_activity_sent_mention_email' hook
  */
 function bp_activity_at_message_notification( $activity_id, $receiver_user_id ) {
-	global $bp;
+	
+	// Don't leave multiple notifications for the same activity item
+	$notifications = BP_Core_Notification::get_all_for_user( $receiver_user_id, 'all' );
+	
+	foreach( $notifications as $notification ) {
+		if ( $activity_id == $notification->item_id ) {
+			return;
+		}
+	}
 
 	$activity = new BP_Activity_Activity( $activity_id );
 
@@ -53,8 +60,9 @@ function bp_activity_at_message_notification( $activity_id, $receiver_user_id )
 	if ( 'no' != bp_get_user_meta( $receiver_user_id, 'notification_activity_new_mention', true ) ) {
 		$poster_name = bp_core_get_user_displayname( $activity->user_id );
 
-		$message_link = bp_activity_get_permalink( $activity_id );
-		$settings_link = bp_core_get_user_domain( $receiver_user_id ) . bp_get_settings_slug() . '/notifications/';
+		$message_link  = bp_activity_get_permalink( $activity_id );
+		$settings_slug = function_exists( 'bp_get_settings_slug' ) ? bp_get_settings_slug() : 'settings';
+		$settings_link = bp_core_get_user_domain( $receiver_user_id ) . $settings_slug . '/notifications/';
 
 		$poster_name = stripslashes( $poster_name );
 		$content = bp_activity_filter_kses( strip_tags( stripslashes( $activity->content ) ) );
@@ -103,13 +111,12 @@ To view and respond to the message, log in and visit: %3$s
 /**
  * Sends an email notification and a BP notification when someone mentions you in an update
  *
- * @since 1.2.0
+ * @since BuddyPress (1.2)
  *
  * @param int $comment_id The comment id
  * @param int $commenter_id The unique user_id of the user who posted the comment
  * @param array $params {@link bp_activity_new_comment()}
  *
- * @global object $bp BuddyPress global settings
  * @uses bp_get_user_meta()
  * @uses bp_core_get_user_displayname()
  * @uses bp_activity_get_permalink()
@@ -131,16 +138,20 @@ To view and respond to the message, log in and visit: %3$s
  * @uses do_action() To call the 'bp_activity_sent_reply_to_reply_email' hook
  */
 function bp_activity_new_comment_notification( $comment_id, $commenter_id, $params ) {
-	global $bp;
+
+	// Set some default parameters
+	$activity_id = 0;
+	$parent_id   = 0;
 
 	extract( $params );
 
 	$original_activity = new BP_Activity_Activity( $activity_id );
 
 	if ( $original_activity->user_id != $commenter_id && 'no' != bp_get_user_meta( $original_activity->user_id, 'notification_activity_new_reply', true ) ) {
-		$poster_name = bp_core_get_user_displayname( $commenter_id );
-		$thread_link = bp_activity_get_permalink( $activity_id );
-		$settings_link = bp_core_get_user_domain( $original_activity->user_id ) . bp_get_settings_slug() . '/notifications/';
+		$poster_name   = bp_core_get_user_displayname( $commenter_id );
+		$thread_link   = bp_activity_get_permalink( $activity_id );
+		$settings_slug = function_exists( 'bp_get_settings_slug' ) ? bp_get_settings_slug() : 'settings';
+		$settings_link = bp_core_get_user_domain( $original_activity->user_id ) . $settings_slug . '/notifications/';
 
 		$poster_name = stripslashes( $poster_name );
 		$content = bp_activity_filter_kses( stripslashes($content) );
@@ -183,9 +194,10 @@ To view your original update and all comments, log in and visit: %3$s
 	$parent_comment = new BP_Activity_Activity( $parent_id );
 
 	if ( $parent_comment->user_id != $commenter_id && $original_activity->user_id != $parent_comment->user_id && 'no' != bp_get_user_meta( $parent_comment->user_id, 'notification_activity_new_reply', true ) ) {
-		$poster_name = bp_core_get_user_displayname( $commenter_id );
-		$thread_link = bp_activity_get_permalink( $activity_id );
-		$settings_link = bp_core_get_user_domain( $parent_comment->user_id ) . bp_get_settings_slug() . '/notifications/';
+		$poster_name   = bp_core_get_user_displayname( $commenter_id );
+		$thread_link   = bp_activity_get_permalink( $activity_id );
+		$settings_slug = function_exists( 'bp_get_settings_slug' ) ? bp_get_settings_slug() : 'settings';
+		$settings_link = bp_core_get_user_domain( $parent_comment->user_id ) . $settings_slug . '/notifications/';
 
 		// Set up and send the message
 		$ud       = bp_core_get_core_userdata( $parent_comment->user_id );
diff --git a/wp-content/plugins/buddypress/bp-activity/bp-activity-screens.php b/wp-content/plugins/buddypress/bp-activity/bp-activity-screens.php
index ff40b5be70c32b308625d21a9612f1eec63226be..69687aa9f7558f907761085fdba699451745342f 100644
--- a/wp-content/plugins/buddypress/bp-activity/bp-activity-screens.php
+++ b/wp-content/plugins/buddypress/bp-activity/bp-activity-screens.php
@@ -13,7 +13,7 @@ if ( !defined( 'ABSPATH' ) ) exit;
 /**
  * Activity screen index
  *
- * @since 1.5.0
+ * @since BuddyPress (1.5)
  *
  * @uses bp_displayed_user_id()
  * @uses bp_is_activity_component()
@@ -37,7 +37,7 @@ add_action( 'bp_screens', 'bp_activity_screen_index' );
 /**
  * Activity screen 'my activity' index
  *
- * @since 1.0.0
+ * @since BuddyPress (1.0)
  *
  * @uses do_action() To call the 'bp_activity_screen_my_activity' hook
  * @uses bp_core_load_template()
@@ -51,11 +51,11 @@ function bp_activity_screen_my_activity() {
 /**
  * Activity screen 'friends' index
  *
- * @since 1.0.0
+ * @since BuddyPress (1.0)
  *
  * @uses bp_is_active()
  * @uses bp_update_is_item_admin()
- * @uses is_super_admin()
+ * @uses bp_current_user_can()
  * @uses do_action() To call the 'bp_activity_screen_friends' hook
  * @uses bp_core_load_template()
  * @uses apply_filters() To call the 'bp_activity_template_friends_activity' hook
@@ -64,7 +64,7 @@ function bp_activity_screen_friends() {
 	if ( !bp_is_active( 'friends' ) )
 		return false;
 
-	bp_update_is_item_admin( is_super_admin(), 'activity' );
+	bp_update_is_item_admin( bp_current_user_can( 'bp_moderate' ), 'activity' );
 	do_action( 'bp_activity_screen_friends' );
 	bp_core_load_template( apply_filters( 'bp_activity_template_friends_activity', 'members/single/home' ) );
 }
@@ -72,11 +72,11 @@ function bp_activity_screen_friends() {
 /**
  * Activity screen 'groups' index
  *
- * @since 1.2.0
+ * @since BuddyPress (1.2)
  *
  * @uses bp_is_active()
  * @uses bp_update_is_item_admin()
- * @uses is_super_admin()
+ * @uses bp_current_user_can()
  * @uses do_action() To call the 'bp_activity_screen_groups' hook
  * @uses bp_core_load_template()
  * @uses apply_filters() To call the 'bp_activity_template_groups_activity' hook
@@ -85,7 +85,7 @@ function bp_activity_screen_groups() {
 	if ( !bp_is_active( 'groups' ) )
 		return false;
 
-	bp_update_is_item_admin( is_super_admin(), 'activity' );
+	bp_update_is_item_admin( bp_current_user_can( 'bp_moderate' ), 'activity' );
 	do_action( 'bp_activity_screen_groups' );
 	bp_core_load_template( apply_filters( 'bp_activity_template_groups_activity', 'members/single/home' ) );
 }
@@ -93,16 +93,16 @@ function bp_activity_screen_groups() {
 /**
  * Activity screen 'favorites' index
  *
- * @since 1.2.0
+ * @since BuddyPress (1.2)
  *
  * @uses bp_update_is_item_admin()
- * @uses is_super_admin()
+ * @uses bp_current_user_can()
  * @uses do_action() To call the 'bp_activity_screen_favorites' hook
  * @uses bp_core_load_template()
  * @uses apply_filters() To call the 'bp_activity_template_favorite_activity' hook
  */
 function bp_activity_screen_favorites() {
-	bp_update_is_item_admin( is_super_admin(), 'activity' );
+	bp_update_is_item_admin( bp_current_user_can( 'bp_moderate' ), 'activity' );
 	do_action( 'bp_activity_screen_favorites' );
 	bp_core_load_template( apply_filters( 'bp_activity_template_favorite_activity', 'members/single/home' ) );
 }
@@ -110,16 +110,16 @@ function bp_activity_screen_favorites() {
 /**
  * Activity screen 'mentions' index
  *
- * @since 1.2.0
+ * @since BuddyPress (1.2)
  *
  * @uses bp_update_is_item_admin()
- * @uses is_super_admin()
+ * @uses bp_current_user_can()
  * @uses do_action() To call the 'bp_activity_screen_mentions' hook
  * @uses bp_core_load_template()
  * @uses apply_filters() To call the 'bp_activity_template_mention_activity' hook
  */
 function bp_activity_screen_mentions() {
-	bp_update_is_item_admin( is_super_admin(), 'activity' );
+	bp_update_is_item_admin( bp_current_user_can( 'bp_moderate' ), 'activity' );
 	do_action( 'bp_activity_screen_mentions' );
 	bp_core_load_template( apply_filters( 'bp_activity_template_mention_activity', 'members/single/home' ) );
 }
@@ -128,7 +128,7 @@ function bp_activity_screen_mentions() {
  * Removes activity notifications from the notification menu when a user clicks on them and
  * is taken to a specific screen.
  *
- * @since 1.5.0
+ * @since BuddyPress (1.5)
  *
  * @global object $bp BuddyPress global settings
  * @uses bp_core_delete_notifications_by_type()
@@ -136,7 +136,7 @@ function bp_activity_screen_mentions() {
 function bp_activity_remove_screen_notifications() {
 	global $bp;
 
-	bp_core_delete_notifications_by_type( $bp->loggedin_user->id, $bp->activity->id, 'new_at_mention' );
+	bp_core_delete_notifications_by_type( bp_loggedin_user_id(), $bp->activity->id, 'new_at_mention' );
 }
 add_action( 'bp_activity_screen_my_activity',               'bp_activity_remove_screen_notifications' );
 add_action( 'bp_activity_screen_single_activity_permalink', 'bp_activity_remove_screen_notifications' );
@@ -145,7 +145,7 @@ add_action( 'bp_activity_screen_mentions',                  'bp_activity_remove_
 /**
  * Reset the logged-in user's new mentions data when he visits his mentions screen
  *
- * @since 1.5.0
+ * @since BuddyPress (1.5)
  *
  * @uses bp_is_my_profile()
  * @uses bp_activity_clear_new_mentions()
@@ -160,7 +160,7 @@ add_action( 'bp_activity_screen_mentions', 'bp_activity_reset_my_new_mentions' )
 /**
  * Reset the logged-in user's new mentions data when he visits his mentions screen
  *
- * @since 1.2.0
+ * @since BuddyPress (1.2)
  *
  * @global object $bp BuddyPress global settings
  * @uses bp_is_activity_component()
@@ -190,11 +190,11 @@ function bp_activity_screen_single_activity_permalink() {
 	if ( !bp_is_activity_component() )
 		return false;
 
-	if ( empty( $bp->current_action ) || !is_numeric( $bp->current_action ) )
+	if ( ! bp_current_action() || !is_numeric( bp_current_action() ) )
 		return false;
 
 	// Get the activity details
-	$activity = bp_activity_get_specific( array( 'activity_ids' => bp_current_action(), 'show_hidden' => true ) );
+	$activity = bp_activity_get_specific( array( 'activity_ids' => bp_current_action(), 'show_hidden' => true, 'spam' => 'ham_only', ) );
 
 	// 404 if activity does not exist
 	if ( empty( $activity['activities'][0] ) || bp_action_variables() ) {
@@ -225,7 +225,7 @@ function bp_activity_screen_single_activity_permalink() {
 			if ( 'public' != $group->status ) {
 
 				// User is not a member of group
-				if ( !groups_is_user_member( $bp->loggedin_user->id, $group->id ) ) {
+				if ( !groups_is_user_member( bp_loggedin_user_id(), $group->id ) ) {
 					$has_access = false;
 				}
 			}
@@ -246,8 +246,8 @@ function bp_activity_screen_single_activity_permalink() {
 
 		// Redirect based on logged in status
 		is_user_logged_in() ?
-			bp_core_redirect( $bp->loggedin_user->domain ) :
-			bp_core_redirect( site_url( 'wp-login.php?redirect_to=' . esc_url( bp_get_root_domain() . '/' . bp_get_activity_root_slug() . '/p/' . $bp->current_action ) ) );
+			bp_core_redirect( bp_loggedin_user_domain() ) :
+			bp_core_redirect( site_url( 'wp-login.php?redirect_to=' . esc_url( bp_get_root_domain() . '/' . bp_get_activity_root_slug() . '/p/' . bp_current_action() . '/' ) ) );
 	}
 
 	bp_core_load_template( apply_filters( 'bp_activity_template_profile_activity_permalink', 'members/single/activity/permalink' ) );
@@ -257,20 +257,18 @@ add_action( 'bp_screens', 'bp_activity_screen_single_activity_permalink' );
 /**
  * Add activity notifications settings to the notifications settings page
  *
- * @since 1.2.0
+ * @since BuddyPress (1.2)
  *
- * @global object $bp BuddyPress global settings
  * @uses bp_get_user_meta()
  * @uses bp_core_get_username()
  * @uses do_action() To call the 'bp_activity_screen_notification_settings' hook
  */
 function bp_activity_screen_notification_settings() {
-	global $bp;
 
-	if ( !$mention = bp_get_user_meta( $bp->displayed_user->id, 'notification_activity_new_mention', true ) )
+	if ( !$mention = bp_get_user_meta( bp_displayed_user_id(), 'notification_activity_new_mention', true ) )
 		$mention = 'yes';
 
-	if ( !$reply = bp_get_user_meta( $bp->displayed_user->id, 'notification_activity_new_reply', true ) )
+	if ( !$reply = bp_get_user_meta( bp_displayed_user_id(), 'notification_activity_new_reply', true ) )
 		$reply = 'yes'; ?>
 
 	<table class="notification-settings" id="activity-notification-settings">
@@ -286,7 +284,7 @@ function bp_activity_screen_notification_settings() {
 		<tbody>
 			<tr id="activity-notification-settings-mentions">
 				<td>&nbsp;</td>
-				<td><?php printf( __( 'A member mentions you in an update using "@%s"', 'buddypress' ), bp_core_get_username( $bp->displayed_user->id, $bp->displayed_user->userdata->user_nicename, $bp->displayed_user->userdata->user_login ) ) ?></td>
+				<td><?php printf( __( 'A member mentions you in an update using "@%s"', 'buddypress' ), bp_core_get_username( bp_displayed_user_id() ) ) ?></td>
 				<td class="yes"><input type="radio" name="notifications[notification_activity_new_mention]" value="yes" <?php checked( $mention, 'yes', true ) ?>/></td>
 				<td class="no"><input type="radio" name="notifications[notification_activity_new_mention]" value="no" <?php checked( $mention, 'no', true ) ?>/></td>
 			</tr>
@@ -305,4 +303,4 @@ function bp_activity_screen_notification_settings() {
 }
 add_action( 'bp_notification_settings', 'bp_activity_screen_notification_settings', 1 );
 
-?>
\ No newline at end of file
+?>
diff --git a/wp-content/plugins/buddypress/bp-activity/bp-activity-template.php b/wp-content/plugins/buddypress/bp-activity/bp-activity-template.php
index 9e8128c271f99e0cfb78d4560cd36cc7eb30fb8b..129a7b0f05d64e395392f181a9cf29cd0a879011 100644
--- a/wp-content/plugins/buddypress/bp-activity/bp-activity-template.php
+++ b/wp-content/plugins/buddypress/bp-activity/bp-activity-template.php
@@ -13,7 +13,7 @@ if ( !defined( 'ABSPATH' ) ) exit;
 /**
  * Output the activity component slug
  *
- * @since 1.5.0
+ * @since BuddyPress (1.5)
  *
  * @uses bp_get_activity_slug()
  */
@@ -23,7 +23,7 @@ function bp_activity_slug() {
 	/**
 	 * Return the activity component slug
 	 *
-	 * @since 1.5.0
+	 * @since BuddyPress (1.5)
 	 *
 	 * @global object $bp BuddyPress global settings
 	 * @uses apply_filters() To call the 'bp_get_activity_slug' hook
@@ -36,7 +36,7 @@ function bp_activity_slug() {
 /**
  * Output the activity component root slug
  *
- * @since 1.5.0
+ * @since BuddyPress (1.5)
  *
  * @uses bp_get_activity_root_slug()
  */
@@ -46,7 +46,7 @@ function bp_activity_root_slug() {
 	/**
 	 * Return the activity component root slug
 	 *
-	 * @since 1.5.0
+	 * @since BuddyPress (1.5)
 	 *
 	 * @global object $bp BuddyPress global settings
 	 * @uses apply_filters() To call the 'bp_get_activity_root_slug' hook
@@ -59,7 +59,7 @@ function bp_activity_root_slug() {
 /**
  * Output member directory permalink
  *
- * @since 1.5.0
+ * @since BuddyPress (1.5)
  *
  * @uses bp_get_activity_directory_permalink()
  */
@@ -69,7 +69,7 @@ function bp_activity_directory_permalink() {
 	/**
 	 * Return member directory permalink
 	 *
-	 * @since 1.5.0
+	 * @since BuddyPress (1.5)
 	 *
 	 * @uses traisingslashit()
 	 * @uses bp_get_root_domain()
@@ -87,7 +87,7 @@ function bp_activity_directory_permalink() {
  *
  * This is responsible for loading a group of activity items and displaying them
  *
- * @since 1.0.0
+ * @since BuddyPress (1.0)
  */
 class BP_Activity_Template {
 	var $current_activity = -1;
@@ -104,33 +104,80 @@ class BP_Activity_Template {
 
 	var $full_name;
 
-	function bp_activity_template( $page, $per_page, $max, $include, $sort, $filter, $search_terms, $display_comments, $show_hidden, $exclude = false, $in = false ) {
-		$this->__construct( $page, $per_page, $max, $include, $sort, $filter, $search_terms, $display_comments, $show_hidden, $exclude, $in );
-	}
-
-	function __construct( $page, $per_page, $max, $include, $sort, $filter, $search_terms, $display_comments, $show_hidden, $exclude = false, $in = false ) {
+	/**
+	 * Constructor method
+	 *
+	 * See definition of $defaults below, as well as $defaults in bp_has_activities(), for 
+	 * description of $args array
+	 *
+	 * @param array $args
+	 */
+	function __construct( $args ) {
 		global $bp;
 
-		$this->pag_page = isset( $_REQUEST['acpage'] ) ? intval( $_REQUEST['acpage'] ) : $page;
+		// Backward compatibility with old method of passing arguments
+		if ( !is_array( $args ) || func_num_args() > 1 ) {
+			_deprecated_argument( __METHOD__, '1.6', sprintf( __( 'Arguments passed to %1$s should be in an associative array. See the inline documentation at %2$s for more details.', 'buddypress' ), __METHOD__, __FILE__ ) );
+
+			$old_args_keys = array(
+				0 => 'page',
+				1 => 'per_page',
+				2 => 'max',
+				3 => 'include',
+				4 => 'sort',
+				5 => 'filter',
+				6 => 'search_terms',
+				7 => 'display_comments',
+				8 => 'show_hidden',
+				9 => 'exclude',
+				10 => 'in',
+				11 => 'spam',
+				12 => 'page_arg'
+			);
+
+			$func_args = func_get_args();
+			$args = bp_core_parse_args_array( $old_args_keys, $func_args );
+		}
+		
+		$defaults = array(
+			'page'             => 1,
+			'per_page'         => 20,
+			'page_arg'         => 'acpage',
+			'max'              => false,
+			'sort'             => false,
+			'include'          => false,
+			'exclude'          => false,
+			'in'               => false,
+			'filter'           => false,
+			'search_terms'     => false,
+			'display_comments' => 'threaded',
+			'show_hidden'      => false,
+			'spam'             => 'ham_only',
+		);
+		$r = wp_parse_args( $args, $defaults );
+		extract( $r );
+		
+		$this->pag_page = isset( $_REQUEST[$page_arg] ) ? intval( $_REQUEST[$page_arg] ) : $page;
 		$this->pag_num  = isset( $_REQUEST['num'] ) ? intval( $_REQUEST['num'] ) : $per_page;
 
 		// Check if blog/forum replies are disabled
 		$this->disable_blogforum_replies = isset( $bp->site_options['bp-disable-blogforum-comments'] ) ? $bp->site_options['bp-disable-blogforum-comments'] : false;
 
 		// Get an array of the logged in user's favorite activities
-		$this->my_favs = maybe_unserialize( bp_get_user_meta( $bp->loggedin_user->id, 'bp_favorite_activities', true ) );
+		$this->my_favs = maybe_unserialize( bp_get_user_meta( bp_loggedin_user_id(), 'bp_favorite_activities', true ) );
 
 		// Fetch specific activity items based on ID's
 		if ( !empty( $include ) )
-			$this->activities = bp_activity_get_specific( array( 'activity_ids' => explode( ',', $include ), 'max' => $max, 'page' => $this->pag_page, 'per_page' => $this->pag_num, 'sort' => $sort, 'display_comments' => $display_comments, 'show_hidden' => $show_hidden ) );
+			$this->activities = bp_activity_get_specific( array( 'activity_ids' => explode( ',', $include ), 'max' => $max, 'page' => $this->pag_page, 'per_page' => $this->pag_num, 'sort' => $sort, 'display_comments' => $display_comments, 'show_hidden' => $show_hidden, 'spam' => $spam ) );
+
 		// Fetch all activity items
 		else
-			$this->activities = bp_activity_get( array( 'display_comments' => $display_comments, 'max' => $max, 'per_page' => $this->pag_num, 'page' => $this->pag_page, 'sort' => $sort, 'search_terms' => $search_terms, 'filter' => $filter, 'show_hidden' => $show_hidden, 'exclude' => $exclude, 'in' => $in ) );
+			$this->activities = bp_activity_get( array( 'display_comments' => $display_comments, 'max' => $max, 'per_page' => $this->pag_num, 'page' => $this->pag_page, 'sort' => $sort, 'search_terms' => $search_terms, 'filter' => $filter, 'show_hidden' => $show_hidden, 'exclude' => $exclude, 'in' => $in, 'spam' => $spam ) );
 
-		if ( !$max || $max >= (int)$this->activities['total'] )
-			$this->total_activity_count = (int)$this->activities['total'];
+		if ( !$max || $max >= (int) $this->activities['total'] )
+			$this->total_activity_count = (int) $this->activities['total'];
 		else
-			$this->total_activity_count = (int)$max;
+			$this->total_activity_count = (int) $max;
 
 		$this->activities = $this->activities['activities'];
 
@@ -138,16 +185,16 @@ class BP_Activity_Template {
 			if ( $max >= count($this->activities) ) {
 				$this->activity_count = count( $this->activities );
 			} else {
-				$this->activity_count = (int)$max;
+				$this->activity_count = (int) $max;
 			}
 		} else {
 			$this->activity_count = count( $this->activities );
 		}
 
-		$this->full_name = $bp->displayed_user->fullname;
+		$this->full_name = bp_get_displayed_user_fullname();
 
 		// Fetch parent content for activity comments so we do not have to query in the loop
-		foreach ( (array)$this->activities as $activity ) {
+		foreach ( (array) $this->activities as $activity ) {
 			if ( 'activity_comment' != $activity->type )
 				continue;
 
@@ -164,12 +211,12 @@ class BP_Activity_Template {
 			unset( $activity_parents );
 		}
 
-		if ( (int)$this->total_activity_count && (int)$this->pag_num ) {
+		if ( (int) $this->total_activity_count && (int) $this->pag_num ) {
 			$this->pag_links = paginate_links( array(
-				'base'      => add_query_arg( 'acpage', '%#%' ),
+				'base'      => add_query_arg( $page_arg, '%#%' ),
 				'format'    => '',
-				'total'     => ceil( (int)$this->total_activity_count / (int)$this->pag_num ),
-				'current'   => (int)$this->pag_page,
+				'total'     => ceil( (int) $this->total_activity_count / (int) $this->pag_num ),
+				'current'   => (int) $this->pag_page,
 				'prev_text' => _x( '&larr;', 'Activity pagination previous text', 'buddypress' ),
 				'next_text' => _x( '&rarr;', 'Activity pagination next text', 'buddypress' ),
 				'mid_size'  => 1
@@ -212,10 +259,9 @@ class BP_Activity_Template {
 	}
 
 	function the_activity() {
-		global $activity;
 
 		$this->in_the_loop = true;
-		$this->activity = $this->next_activity();
+		$this->activity    = $this->next_activity();
 
 		if ( is_array( $this->activity ) )
 			$this->activity = (object) $this->activity;
@@ -230,7 +276,7 @@ class BP_Activity_Template {
  *
  * Based on the $args passed, bp_has_activities() populates the $activities_template global.
  *
- * @since 1.0.0
+ * @since BuddyPress (1.0)
  *
  * @param array $args Arguments for limiting the contents of the activity loop. Can be passed as an associative array or as a URL argument string
  *
@@ -267,21 +313,21 @@ function bp_has_activities( $args = '' ) {
 	$primary_id  = false;
 
 	// User filtering
-	if ( !empty( $bp->displayed_user->id ) )
-		$user_id = $bp->displayed_user->id;
+	if ( bp_displayed_user_id() )
+		$user_id = bp_displayed_user_id();
 
 	// Group filtering
 	if ( !empty( $bp->groups->current_group ) ) {
 		$object = $bp->groups->id;
 		$primary_id = $bp->groups->current_group->id;
 
-		if ( 'public' != $bp->groups->current_group->status && ( groups_is_user_member( $bp->loggedin_user->id, $bp->groups->current_group->id ) || $bp->loggedin_user->is_super_admin ) )
+		if ( ( 'public' != $bp->groups->current_group->status ) && ( groups_is_user_member( bp_loggedin_user_id(), $bp->groups->current_group->id ) || bp_current_user_can( 'bp_moderate' ) ) )
 			$show_hidden = true;
 	}
 
 	// The default scope should recognize custom slugs
-	if ( array_key_exists( $bp->current_action, (array)$bp->loaded_components ) ) {
-		$scope = $bp->loaded_components[$bp->current_action];
+	if ( array_key_exists( bp_current_action(), (array) $bp->loaded_components ) ) {
+		$scope = $bp->loaded_components[bp_current_action()];
 	}
 	else
 		$scope = bp_current_action();
@@ -301,6 +347,9 @@ function bp_has_activities( $args = '' ) {
 		'per_page'         => 20,           // number of items per page
 		'max'              => false,        // max number to return
 		'show_hidden'      => $show_hidden, // Show activity items that are hidden site-wide?
+		'spam'             => 'ham_only',   // Hide spammed items
+
+		'page_arg'         => 'acpage',     // See https://buddypress.trac.wordpress.org/ticket/3679
 
 		// Scope - pre-built activity filters for a user (friends/groups/favorites/mentions)
 		'scope'            => $scope,
@@ -326,11 +375,11 @@ function bp_has_activities( $args = '' ) {
 
 		// determine which user_id applies
 		if ( empty( $user_id ) )
-			$user_id = ( !empty( $bp->displayed_user->id ) ) ? $bp->displayed_user->id : $bp->loggedin_user->id;
+			$user_id = bp_displayed_user_id() ? bp_displayed_user_id() : bp_loggedin_user_id();
 
 		// are we displaying user specific activity?
 		if ( is_numeric( $user_id ) ) {
-			$show_hidden = ( $user_id == $bp->loggedin_user->id && $scope != 'friends' ) ? 1 : 0;
+			$show_hidden = ( $user_id == bp_loggedin_user_id() && $scope != 'friends' ) ? 1 : 0;
 
 			switch ( $scope ) {
 				case 'friends':
@@ -339,7 +388,7 @@ function bp_has_activities( $args = '' ) {
 						if ( empty( $friends ) )
 							return false;
 
-						$user_id = implode( ',', (array)$friends );
+						$user_id = implode( ',', (array) $friends );
 					break;
 				case 'groups':
 					if ( bp_is_active( 'groups' ) ) {
@@ -348,7 +397,7 @@ function bp_has_activities( $args = '' ) {
 							return false;
 
 						$object = $bp->groups->id;
-						$primary_id = implode( ',', (array)$groups['groups'] );
+						$primary_id = implode( ',', (array) $groups['groups'] );
 
 						$user_id = 0;
 					}
@@ -358,13 +407,13 @@ function bp_has_activities( $args = '' ) {
 					if ( empty( $favs ) )
 						return false;
 
-					$include          = implode( ',', (array)$favs );
+					$include          = implode( ',', (array) $favs );
 					$display_comments = true;
 					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 ) . '<'; // Start search at @ symbol and stop search at closing tag delimiter.
+
+					// Start search at @ symbol and stop search at closing tag delimiter.
+					$search_terms     = '@' . bp_core_get_username( $user_id ) . '<';
 					$display_comments = 'stream';
 					$user_id = 0;
 					break;
@@ -373,26 +422,48 @@ function bp_has_activities( $args = '' ) {
 	}
 
 	// Do not exceed the maximum per page
-	if ( !empty( $max ) && ( (int)$per_page > (int)$max ) )
+	if ( !empty( $max ) && ( (int) $per_page > (int) $max ) )
 		$per_page = $max;
 
-	// Support for basic filters in earlier BP versions.
-	if ( isset( $_GET['afilter'] ) )
+	// Support for basic filters in earlier BP versions is disabled by default. To enable, put
+	//   add_filter( 'bp_activity_enable_afilter_support', '__return_true' );
+	// into bp-custom.php or your theme's functions.php
+	if ( isset( $_GET['afilter'] ) && apply_filters( 'bp_activity_enable_afilter_support', false ) )
 		$filter = array( 'object' => $_GET['afilter'] );
 	else if ( !empty( $user_id ) || !empty( $object ) || !empty( $action ) || !empty( $primary_id ) || !empty( $secondary_id ) )
 		$filter = array( 'user_id' => $user_id, 'object' => $object, 'action' => $action, 'primary_id' => $primary_id, 'secondary_id' => $secondary_id );
 	else
 		$filter = false;
 
-	$activities_template = new BP_Activity_Template( $page, $per_page, $max, $include, $sort, $filter, $search_terms, $display_comments, $show_hidden, $exclude, $in );
+	// If specific activity items have been requested, override the $hide_spam argument. This prevents backpat errors with AJAX.
+	if ( !empty( $include ) && ( 'ham_only' == $spam ) )
+		$spam = 'all';
+
+	$template_args = array(
+		'page'             => $page,
+		'per_page'         => $per_page,
+		'page_arg'         => $page_arg,
+		'max'              => $max,
+		'sort'             => $sort,
+		'include'          => $include,
+		'exclude'          => $exclude,
+		'in'               => $in,
+		'filter'           => $filter,
+		'search_terms'     => $search_terms,
+		'display_comments' => $display_comments,
+		'show_hidden'      => $show_hidden,
+		'spam'             => $spam
+	);
+
+	$activities_template = new BP_Activity_Template( $template_args );
 
-	return apply_filters( 'bp_has_activities', $activities_template->has_activities(), $activities_template );
+	return apply_filters( 'bp_has_activities', $activities_template->has_activities(), $activities_template, $template_args );
 }
 
 /**
  * Determines if there are still activities left in the loop.
  *
- * @since 1.0.0
+ * @since BuddyPress (1.0)
  *
  * @global object $activities_template {@link BP_Activity_Template}
  * @uses BP_Activity_Template::user_activities() {@link BP_Activity_Template::user_activities()}
@@ -407,7 +478,7 @@ function bp_activities() {
 /**
  * Gets the current activity object in the loop
  *
- * @since 1.0.0
+ * @since BuddyPress (1.0)
  *
  * @global object $activities_template {@link BP_Activity_Template}
  * @uses BP_Activity_Template::the_activity() {@link BP_Activity_Template::the_activity()}
@@ -422,7 +493,7 @@ function bp_the_activity() {
 /**
  * Outputs the activity pagination count
  *
- * @since 1.0.0
+ * @since BuddyPress (1.0)
  *
  * @global object $activities_template {@link BP_Activity_Template}
  * @uses BP_Activity_Template::the_activity() {@link BP_Activity_Template::the_activity()}
@@ -434,16 +505,15 @@ function bp_activity_pagination_count() {
 	/**
 	 * Returns the activity pagination count
 	 *
-	 * @since 1.2.0
+	 * @since BuddyPress (1.2)
 	 *
-	 * @global object $bp BuddyPress global settings
 	 * @global object $activities_template {@link BP_Activity_Template}
 	 * @uses bp_core_number_format()
 	 *
 	 * @return string The pagination text
 	 */
 	function bp_get_activity_pagination_count() {
-		global $bp, $activities_template;
+		global $activities_template;
 
 		$start_num = intval( ( $activities_template->pag_page - 1 ) * $activities_template->pag_num ) + 1;
 		$from_num  = bp_core_number_format( $start_num );
@@ -456,7 +526,7 @@ function bp_activity_pagination_count() {
 /**
  * Outputs the activity pagination links
  *
- * @since 1.0.0
+ * @since BuddyPress (1.0)
  *
  * @uses bp_get_activity_pagination_links()
  */
@@ -467,7 +537,7 @@ function bp_activity_pagination_links() {
 	/**
 	 * Outputs the activity pagination links
 	 *
-	 * @since 1.0.0
+	 * @since BuddyPress (1.0)
 	 *
 	 * @global object $activities_template {@link BP_Activity_Template}
 	 * @uses apply_filters() To call the 'bp_get_activity_pagination_links' hook
@@ -483,7 +553,7 @@ function bp_activity_pagination_links() {
 /**
  * Returns true when there are more activity items to be shown than currently appear
  *
- * @since 1.5.0
+ * @since BuddyPress (1.5)
  *
  * @global object $activities_template {@link BP_Activity_Template}
  * @uses apply_filters() To call the 'bp_activity_has_more_items' hook
@@ -494,7 +564,7 @@ function bp_activity_has_more_items() {
 	global $activities_template;
 
 	$remaining_pages = floor( ( $activities_template->total_activity_count - 1 ) / ( $activities_template->pag_num * $activities_template->pag_page ) );
-	$has_more_items  = (int)$remaining_pages ? true : false;
+	$has_more_items  = (int) $remaining_pages ? true : false;
 
 	return apply_filters( 'bp_activity_has_more_items', $has_more_items );
 }
@@ -502,7 +572,7 @@ function bp_activity_has_more_items() {
 /**
  * Outputs the activity count
  *
- * @since 1.2.0
+ * @since BuddyPress (1.2)
  *
  * @uses bp_get_activity_count()
  */
@@ -513,7 +583,7 @@ function bp_activity_count() {
 	/**
 	 * Returns the activity count
 	 *
-	 * @since 1.2.0
+	 * @since BuddyPress (1.2)
 	 *
 	 * @global object $activities_template {@link BP_Activity_Template}
 	 * @uses apply_filters() To call the 'bp_get_activity_count' hook
@@ -523,13 +593,13 @@ function bp_activity_count() {
 	function bp_get_activity_count() {
 		global $activities_template;
 
-		return apply_filters( 'bp_get_activity_count', (int)$activities_template->activity_count );
+		return apply_filters( 'bp_get_activity_count', (int) $activities_template->activity_count );
 	}
 
 /**
  * Outputs the number of activities per page
  *
- * @since 1.2.0
+ * @since BuddyPress (1.2)
  *
  * @uses bp_get_activity_per_page()
  */
@@ -540,7 +610,7 @@ function bp_activity_per_page() {
 	/**
 	 * Returns the number of activities per page
 	 *
-	 * @since 1.2.0
+	 * @since BuddyPress (1.2)
 	 *
 	 * @global object $activities_template {@link BP_Activity_Template}
 	 * @uses apply_filters() To call the 'bp_get_activity_per_page' hook
@@ -550,26 +620,24 @@ function bp_activity_per_page() {
 	function bp_get_activity_per_page() {
 		global $activities_template;
 
-		return apply_filters( 'bp_get_activity_per_page', (int)$activities_template->pag_num );
+		return apply_filters( 'bp_get_activity_per_page', (int) $activities_template->pag_num );
 	}
 
 /**
  * Outputs the activities title
  *
- * @since 1.0.0
+ * @since BuddyPress (1.0)
  *
  * @uses bp_get_activities_title()
  */
 function bp_activities_title() {
-	global $bp_activity_title;
-
 	echo bp_get_activities_title();
 }
 
 	/**
 	 * Returns the activities title
 	 *
-	 * @since 1.0.0
+	 * @since BuddyPress (1.0)
 	 *
 	 * @global string $bp_activity_title
 	 * @uses apply_filters() To call the 'bp_get_activities_title' hook
@@ -585,20 +653,18 @@ function bp_activities_title() {
 /**
  * {@internal Missing Description}
  *
- * @since 1.0.0
+ * @since BuddyPress (1.0)
  *
  * @uses bp_get_activities_no_activity()
  */
 function bp_activities_no_activity() {
-	global $bp_activity_no_activity;
-
 	echo bp_get_activities_no_activity();
 }
 
 	/**
 	 * {@internal Missing Description}
 	 *
-	 * @since 1.0.0
+	 * @since BuddyPress (1.0)
 	 *
 	 * @global string $bp_activity_no_activity
 	 * @uses apply_filters() To call the 'bp_get_activities_no_activity' hook
@@ -614,7 +680,7 @@ function bp_activities_no_activity() {
 /**
  * Outputs the activity id
  *
- * @since 1.2.0
+ * @since BuddyPress (1.2)
  *
  * @uses bp_get_activity_id()
  */
@@ -625,7 +691,7 @@ function bp_activity_id() {
 	/**
 	 * Returns the activity id
 	 *
-	 * @since 1.2.0
+	 * @since BuddyPress (1.2)
 	 *
 	 * @global object $activities_template {@link BP_Activity_Template}
 	 * @uses apply_filters() To call the 'bp_get_activity_id' hook
@@ -640,7 +706,7 @@ function bp_activity_id() {
 /**
  * Outputs the activity item id
  *
- * @since 1.2.0
+ * @since BuddyPress (1.2)
  *
  * @uses bp_get_activity_item_id()
  */
@@ -651,7 +717,7 @@ function bp_activity_item_id() {
 	/**
 	 * Returns the activity item id
 	 *
-	 * @since 1.2.0
+	 * @since BuddyPress (1.2)
 	 *
 	 * @global object $activities_template {@link BP_Activity_Template}
 	 * @uses apply_filters() To call the 'bp_get_activity_item_id' hook
@@ -666,7 +732,7 @@ function bp_activity_item_id() {
 /**
  * Outputs the activity secondary item id
  *
- * @since 1.2.0
+ * @since BuddyPress (1.2)
  *
  * @uses bp_get_activity_secondary_item_id()
  */
@@ -677,7 +743,7 @@ function bp_activity_secondary_item_id() {
 	/**
 	 * Returns the activity secondary item id
 	 *
-	 * @since 1.2.0
+	 * @since BuddyPress (1.2)
 	 *
 	 * @global object $activities_template {@link BP_Activity_Template}
 	 * @uses apply_filters() To call the 'bp_get_activity_secondary_item_id' hook
@@ -692,7 +758,7 @@ function bp_activity_secondary_item_id() {
 /**
  * Outputs the date the activity was recorded
  *
- * @since 1.2.0
+ * @since BuddyPress (1.2)
  *
  * @uses bp_get_activity_date_recorded()
  */
@@ -703,7 +769,7 @@ function bp_activity_date_recorded() {
 	/**
 	 * Returns the date the activity was recorded
 	 *
-	 * @since 1.2.0
+	 * @since BuddyPress (1.2)
 	 *
 	 * @global object $activities_template {@link BP_Activity_Template}
 	 * @uses apply_filters() To call the 'bp_get_activity_date_recorded' hook
@@ -718,7 +784,7 @@ function bp_activity_date_recorded() {
 /**
  * Outputs the activity object name
  *
- * @since 1.2.0
+ * @since BuddyPress (1.2)
  *
  * @uses bp_get_activity_object_name()
  */
@@ -729,7 +795,7 @@ function bp_activity_object_name() {
 	/**
 	 * Returns the activity object name
 	 *
-	 * @since 1.2.0
+	 * @since BuddyPress (1.2)
 	 *
 	 * @global object $activities_template {@link BP_Activity_Template}
 	 * @uses apply_filters() To call the 'bp_get_activity_object_name' hook
@@ -744,7 +810,7 @@ function bp_activity_object_name() {
 /**
  * Outputs the activity type
  *
- * @since 1.2.0
+ * @since BuddyPress (1.2)
  *
  * @uses bp_get_activity_type()
  */
@@ -755,7 +821,7 @@ function bp_activity_type() {
 	/**
 	 * Returns the activity type
 	 *
-	 * @since 1.2.0
+	 * @since BuddyPress (1.2)
 	 *
 	 * @global object $activities_template {@link BP_Activity_Template}
 	 * @uses apply_filters() To call the 'bp_get_activity_type' hook
@@ -772,8 +838,8 @@ function bp_activity_type() {
 	 *
 	 * Just a wrapper for bp_activity_type()
 	 *
-	 * @since 1.2.0
-	 * @deprecated 1.5.0
+	 * @since BuddyPress (1.2)
+	 * @deprecated BuddyPress (1.5)
 	 *
 	 * @todo Properly deprecate in favor of bp_activity_type() and
 	 *		 remove redundant echo
@@ -787,8 +853,8 @@ function bp_activity_type() {
 	 *
 	 * Just a wrapper for bp_get_activity_type()
 	 *
-	 * @since 1.2.0
-	 * @deprecated 1.5.0
+	 * @since BuddyPress (1.2)
+	 * @deprecated BuddyPress (1.5)
 	 *
 	 * @todo Properly deprecate in favor of bp_get_activity_type()
 	 *
@@ -801,7 +867,7 @@ function bp_activity_type() {
 /**
  * Outputs the activity user id
  *
- * @since 1.1.0
+ * @since BuddyPress (1.1)
  *
  * @uses bp_get_activity_user_id()
  */
@@ -812,7 +878,7 @@ function bp_activity_user_id() {
 	/**
 	 * Returns the activity user id
 	 *
-	 * @since 1.1.0
+	 * @since BuddyPress (1.1)
 	 *
 	 * @global object $activities_template {@link BP_Activity_Template}
 	 * @uses apply_filters() To call the 'bp_get_activity_user_id' hook
@@ -827,7 +893,7 @@ function bp_activity_user_id() {
 /**
  * Outputs the activity user link
  *
- * @since 1.2.0
+ * @since BuddyPress (1.2)
  *
  * @uses bp_get_activity_user_link()
  */
@@ -838,7 +904,7 @@ function bp_activity_user_link() {
 	/**
 	 * Returns the activity user link
 	 *
-	 * @since 1.2.0
+	 * @since BuddyPress (1.2)
 	 *
 	 * @global object $activities_template {@link BP_Activity_Template}
 	 * @uses bp_core_get_user_domain()
@@ -860,7 +926,7 @@ function bp_activity_user_link() {
 /**
  * Output the avatar of the user that performed the action
  *
- * @since 1.1.0
+ * @since BuddyPress (1.1)
  *
  * @param array $args
  *
@@ -872,7 +938,7 @@ function bp_activity_avatar( $args = '' ) {
 	/**
 	 * Return the avatar of the user that performed the action
 	 *
-	 * @since 1.1.0
+	 * @since BuddyPress (1.1)
 	 *
 	 * @param array $args optional
 	 *
@@ -893,8 +959,16 @@ function bp_activity_avatar( $args = '' ) {
 		// On activity permalink pages, default to the full-size avatar
 		$type_default = bp_is_single_activity() ? 'full' : 'thumb';
 
+		if ( !empty( $activities_template->activity->display_name ) ) {
+			$dn_default = $activities_template->activity->display_name;
+		} else if ( !empty( $activities_template->current_comment->display_name ) ) {
+			$dn_default = $activities_template->current_comment->display_name;
+		}
+
+		$alt_default = isset( $dn_default ) ? sprintf( __( 'Profile picture of %s', 'buddypress' ), $activities_template->activity->display_name ) : __( 'Profile picture', 'buddypress' );
+
 		$defaults = array(
-			'alt'     => __( 'Profile picture of %s', 'buddypress' ),
+			'alt'     => $alt_default,
 			'class'   => 'avatar',
 			'email'   => false,
 			'type'    => $type_default,
@@ -940,7 +1014,7 @@ function bp_activity_avatar( $args = '' ) {
 /**
  * Output the avatar of the object that action was performed on
  *
- * @since 1.2.0
+ * @since BuddyPress (1.2)
  *
  * @param array $args optional
  *
@@ -953,11 +1027,10 @@ function bp_activity_secondary_avatar( $args = '' ) {
 	/**
 	 * Return the avatar of the object that action was performed on
 	 *
-	 * @since 1.2.0
+	 * @since BuddyPress (1.2)
 	 *
 	 * @param array $args optional
 	 *
-	 * @global object $bp BuddyPress global settings
 	 * @global object $activities_template {@link BP_Activity_Template}
 	 * @uses wp_parse_args()
 	 * @uses get_blog_option()
@@ -969,7 +1042,7 @@ function bp_activity_secondary_avatar( $args = '' ) {
 	 * @return string The secondary avatar
 	 */
 	function bp_get_activity_secondary_avatar( $args = '' ) {
-		global $bp, $activities_template;
+		global $activities_template;
 
 		$defaults = array(
 			'type'   => 'thumb',
@@ -985,36 +1058,46 @@ function bp_activity_secondary_avatar( $args = '' ) {
 		// Set item_id and object (default to user)
 		switch ( $activities_template->activity->component ) {
 			case 'groups' :
-				$object = 'group';
+				$object  = 'group';
 				$item_id = $activities_template->activity->item_id;
 
-				if ( empty( $alt ) )
-					$alt = __( 'Group logo of %s', 'buddypress' );
+				if ( empty( $alt ) ) {
+					$alt = __( 'Group logo', 'buddypress' );
+
+					if ( bp_is_active( 'groups' ) ) {
+						$group = groups_get_group( $item_id );
+						if ( isset( $group->name ) )
+							$alt = sprintf( __( 'Group logo of %s', 'buddypress' ), $group->name );
+					}
+				}
 
 				break;
 			case 'blogs' :
-				$object = 'blog';
+				$object  = 'blog';
 				$item_id = $activities_template->activity->item_id;
 
-				if ( !$alt )
-					$alt = sprintf( __( 'Site authored by %s', 'buddypress' ), get_blog_option( $item_id, 'blogname' ) );
+				if ( !$alt ) {
+					$alt = sprintf( __( 'Profile picture of the author of the site %s', 'buddypress' ), get_blog_option( $item_id, 'blogname' ) );
+				}
 
 				break;
 			case 'friends' :
 				$object  = 'user';
 				$item_id = $activities_template->activity->secondary_item_id;
 
-				if ( empty( $alt ) )
-					$alt = __( 'Profile picture of %s', 'buddypress' );
+				if ( empty( $alt ) ) {
+					$alt = sprintf( __( 'Profile picture of %s', 'buddypress' ), bp_core_get_user_displayname( $activities_template->activity->secondary_item_id ) );
+				}
 
 				break;
 			default :
 				$object  = 'user';
 				$item_id = $activities_template->activity->user_id;
-				$email = $activities_template->activity->user_email;
+				$email   = $activities_template->activity->user_email;
 
-				if ( !$alt )
-					$alt = __( 'Profile picture of %s', 'buddypress' );
+				if ( !$alt ) {
+					$alt = sprintf( __( 'Profile picture of %s', 'buddypress' ), $activities_template->activity->display_name );
+				}
 
 				break;
 		}
@@ -1033,7 +1116,7 @@ function bp_activity_secondary_avatar( $args = '' ) {
 /**
  * Output the activity action
  *
- * @since 1.2.0
+ * @since BuddyPress (1.2)
  *
  * @uses bp_get_activity_action()
  */
@@ -1044,7 +1127,7 @@ function bp_activity_action() {
 	/**
 	 * Return the activity action
 	 *
-	 * @since 1.2.0
+	 * @since BuddyPress (1.2)
 	 *
 	 * @global object $activities_template {@link BP_Activity_Template}
 	 * @uses apply_filters_ref_array() To call the 'bp_get_activity_action_pre_meta' hook
@@ -1068,7 +1151,7 @@ function bp_activity_action() {
 /**
  * Output the activity content body
  *
- * @since 1.2.0
+ * @since BuddyPress (1.2)
  *
  * @uses bp_get_activity_content_body()
  */
@@ -1079,7 +1162,7 @@ function bp_activity_content_body() {
 	/**
 	 * Return the activity content body
 	 *
-	 * @since 1.2.0
+	 * @since BuddyPress (1.2)
 	 *
 	 * @global object $activities_template {@link BP_Activity_Template}
 	 * @uses bp_insert_activity_meta()
@@ -1100,7 +1183,7 @@ function bp_activity_content_body() {
 /**
  * Does the activity have content?
  *
- * @since 1.2.0
+ * @since BuddyPress (1.2)
  *
  * @global object $activities_template {@link BP_Activity_Template}
  *
@@ -1118,8 +1201,8 @@ function bp_activity_has_content() {
 /**
  * Output the activity content
  *
- * @since 1.0.0
- * @deprecated 1.5.0
+ * @since BuddyPress (1.0)
+ * @deprecated BuddyPress (1.5)
  *
  * @todo properly deprecate this function
  *
@@ -1132,12 +1215,11 @@ function bp_activity_content() {
 	/**
 	 * Return the activity content
 	 *
-	 * @since 1.0.0
-	 * @deprecated 1.5.0
+	 * @since BuddyPress (1.0)
+	 * @deprecated BuddyPress (1.5)
 	 *
 	 * @todo properly deprecate this function
 	 *
-	 * @global object $activities_template {@link BP_Activity_Template}
 	 * @uses bp_get_activity_action()
 	 * @uses bp_get_activity_content_body()
 	 * @uses apply_filters() To call the 'bp_get_activity_content' hook
@@ -1145,8 +1227,6 @@ function bp_activity_content() {
 	 * @return string The activity content
 	 */
 	function bp_get_activity_content() {
-		global $activities_template;
-
 		/**
 		 * If you want to filter activity update content, please use
 		 * the filter 'bp_get_activity_content_body'
@@ -1161,12 +1241,11 @@ function bp_activity_content() {
 /**
  * Insert activity meta
  *
- * @since 1.2.0
+ * @since BuddyPress (1.2)
  *
  * @param string $content
  *
  * @global object $activities_template {@link BP_Activity_Template}
- * @global object $bp BuddyPress global settings
  * @uses bp_core_time_since()
  * @uses apply_filters_ref_array() To call the 'bp_activity_time_since' hook
  * @uses bp_is_single_activity()
@@ -1178,7 +1257,7 @@ function bp_activity_content() {
  * @return string The activity content
  */
 function bp_insert_activity_meta( $content ) {
-	global $activities_template, $bp;
+	global $activities_template;
 
 	// Strip any legacy time since placeholders from BP 1.0-1.1
 	$content = str_replace( '<span class="time-since">%s</span>', '', $content );
@@ -1198,18 +1277,17 @@ function bp_insert_activity_meta( $content ) {
 /**
  * Determine if the current user can delete an activity item
  *
- * @since 1.2.0
+ * @since BuddyPress (1.2)
  *
  * @param object $activity Optional
  *
  * @global object $activities_template {@link BP_Activity_Template}
- * @global object $bp BuddyPress global settings
  * @uses apply_filters() To call the 'bp_activity_user_can_delete' hook
  *
  * @return bool True if can delete, false otherwise
  */
 function bp_activity_user_can_delete( $activity = false ) {
-	global $activities_template, $bp;
+	global $activities_template;
 
 	if ( !$activity )
 		$activity = $activities_template->activity;
@@ -1219,13 +1297,13 @@ function bp_activity_user_can_delete( $activity = false ) {
 
 	$can_delete = false;
 
-	if ( $bp->loggedin_user->is_super_admin )
+	if ( bp_current_user_can( 'bp_moderate' ) )
 		$can_delete = true;
 
-	if ( $activity->user_id == $bp->loggedin_user->id )
+	if ( $activity->user_id == bp_loggedin_user_id() )
 		$can_delete = true;
 
-	if ( $bp->is_item_admin && $bp->is_single_item )
+	if ( bp_is_item_admin() && bp_is_single_item() )
 		$can_delete = true;
 
 	return apply_filters( 'bp_activity_user_can_delete', $can_delete );
@@ -1234,7 +1312,7 @@ function bp_activity_user_can_delete( $activity = false ) {
 /**
  * Output the activity parent content
  *
- * @since 1.2.0
+ * @since BuddyPress (1.2)
  *
  * @param array $args Optional
  *
@@ -1247,11 +1325,10 @@ function bp_activity_parent_content( $args = '' ) {
 	/**
 	 * Return the activity content
 	 *
-	 * @since 1.2.0
+	 * @since BuddyPress (1.2)
 	 *
 	 * @param array $args Optional
 	 *
-	 * @global object $bp BuddyPress global settings
 	 * @global object $activities_template {@link BP_Activity_Template}
 	 * @uses wp_parse_args()
 	 * @uses apply_filters() To call the 'bp_get_activity_parent_content' hook
@@ -1259,7 +1336,7 @@ function bp_activity_parent_content( $args = '' ) {
 	 * @return mixed False on failure, otherwise the activity parent content
 	 */
 	function bp_get_activity_parent_content( $args = '' ) {
-		global $bp, $activities_template;
+		global $activities_template;
 
 		$defaults = array(
 			'hide_user' => false
@@ -1293,7 +1370,7 @@ function bp_activity_parent_content( $args = '' ) {
 /**
  * Output whether or not the current activity is in a current user's favorites
  *
- * @since 1.2.0
+ * @since BuddyPress (1.2)
  *
  * @uses bp_get_activity_is_favorite()
  */
@@ -1304,24 +1381,23 @@ function bp_activity_is_favorite() {
 	/**
 	 * Return whether or not the current activity is in a current user's favorites
 	 *
-	 * @since 1.2.0
+	 * @since BuddyPress (1.2)
 	 *
-	 * @global object $bp BuddyPress global settings
 	 * @global object $activities_template {@link BP_Activity_Template}
 	 * @uses apply_filters() To call the 'bp_get_activity_is_favorite' hook
 	 *
 	 * @return bool True if user favorite, false otherwise
 	 */
 	function bp_get_activity_is_favorite() {
-		global $bp, $activities_template;
+		global $activities_template;
 
- 		return apply_filters( 'bp_get_activity_is_favorite', in_array( $activities_template->activity->id, (array)$activities_template->my_favs ) );
+ 		return apply_filters( 'bp_get_activity_is_favorite', in_array( $activities_template->activity->id, (array) $activities_template->my_favs ) );
 	}
 
 /**
  * Echoes the comment markup for an activity item
  *
- * @since 1.2.0
+ * @since BuddyPress (1.2)
  *
  * @todo deprecate $args param
  *
@@ -1334,7 +1410,7 @@ function bp_activity_comments( $args = '' ) {
 	/**
 	 * Gets the comment markup for an activity item
 	 *
-	 * @since 1.2.0
+	 * @since BuddyPress (1.2)
 	 *
 	 * @todo deprecate $args param
 	 *
@@ -1344,11 +1420,10 @@ function bp_activity_comments( $args = '' ) {
 	 * @param string $args Unused. Appears to be left over from an earlier implementation.
 	 *
 	 * @global object $activities_template {@link BP_Activity_Template}
-	 * @global object $bp BuddyPress global settings
 	 * @uses bp_activity_recurse_comments()
 	 */
 	function bp_activity_get_comments( $args = '' ) {
-		global $activities_template, $bp;
+		global $activities_template;
 
 		if ( !isset( $activities_template->activity->children ) || !$activities_template->activity->children )
 			return false;
@@ -1362,27 +1437,26 @@ function bp_activity_comments( $args = '' ) {
 		 * Note: The recursion itself used to happen entirely in this function. Now it is
 		 * split between here and the comment.php template.
 		 *
-		 * @since 1.2.0
+		 * @since BuddyPress (1.2)
 		 *
 		 * @todo remove $counter global
 		 *
 		 * @param object $comment The activity object currently being recursed
 		 *
 		 * @global object $activities_template {@link BP_Activity_Template}
-		 * @global object $bp BuddyPress global settings
 		 * @uses locate_template()
 		 */
 		function bp_activity_recurse_comments( $comment ) {
-			global $activities_template, $bp, $counter;
+			global $activities_template;
 
-			if ( !$comment )
+			if ( empty( $comment ) )
 				return false;
 
 			if ( empty( $comment->children ) )
 				return false;
 
-			echo '<ul>';
-			foreach ( (array)$comment->children as $comment_child ) {
+			echo apply_filters( 'bp_activity_recurse_comments_start_ul', '<ul>');
+			foreach ( (array) $comment->children as $comment_child ) {
 				// Put the comment into the global so it's available to filters
 				$activities_template->activity->current_comment = $comment_child;
 
@@ -1400,13 +1474,13 @@ function bp_activity_comments( $args = '' ) {
 
 				unset( $activities_template->activity->current_comment );
 			}
-			echo '</ul>';
+			echo apply_filters( 'bp_activity_recurse_comments_end_ul', '</ul>');
 		}
 
 /**
  * Utility function that returns the comment currently being recursed
  *
- * @since 1.5.0
+ * @since BuddyPress (1.5)
  *
  * @global object $activities_template {@link BP_Activity_Template}
  * @uses apply_filters() To call the 'bp_activity_current_comment' hook
@@ -1425,7 +1499,7 @@ function bp_activity_current_comment() {
 /**
  * Echoes the id of the activity comment currently being displayed
  *
- * @since 1.5.0
+ * @since BuddyPress (1.5)
  *
  * @uses bp_get_activity_comment_id()
  */
@@ -1436,7 +1510,7 @@ function bp_activity_comment_id() {
 	/**
 	 * Gets the id of the activity comment currently being displayed
 	 *
-	 * @since 1.5.0
+	 * @since BuddyPress (1.5)
 	 *
 	 * @global object $activities_template {@link BP_Activity_Template}
 	 * @uses apply_filters() To call the 'bp_activity_comment_id' hook
@@ -1454,7 +1528,7 @@ function bp_activity_comment_id() {
 /**
  * Echoes the user_id of the author of the activity comment currently being displayed
  *
- * @since 1.5.0
+ * @since BuddyPress (1.5)
  *
  * @uses bp_get_activity_comment_user_id()
  */
@@ -1465,7 +1539,7 @@ function bp_activity_comment_user_id() {
 	/**
 	 * Gets the user_id of the author of the activity comment currently being displayed
 	 *
-	 * @since 1.5.0
+	 * @since BuddyPress (1.5)
 	 *
 	 * @global object $activities_template {@link BP_Activity_Template}
 	 * @uses apply_filters() To call the 'bp_activity_comment_user_id' hook
@@ -1483,7 +1557,7 @@ function bp_activity_comment_user_id() {
 /**
  * Echoes the author link for the activity comment currently being displayed
  *
- * @since 1.5.0
+ * @since BuddyPress (1.5)
  *
  * @uses bp_get_activity_comment_user_link()
  */
@@ -1494,7 +1568,7 @@ function bp_activity_comment_user_link() {
 	/**
 	 * Gets the author link for the activity comment currently being displayed
 	 *
-	 * @since 1.5.0
+	 * @since BuddyPress (1.5)
 	 *
 	 * @uses bp_core_get_user_domain()
 	 * @uses bp_get_activity_comment_user_id()
@@ -1511,7 +1585,7 @@ function bp_activity_comment_user_link() {
 /**
  * Echoes the author name for the activity comment currently being displayed
  *
- * @since 1.5.0
+ * @since BuddyPress (1.5)
  *
  * @uses bp_get_activity_comment_name()
  */
@@ -1524,7 +1598,7 @@ function bp_activity_comment_name() {
 	 *
 	 * The use of the bp_acomment_name filter is deprecated. Please use bp_activity_comment_name
 	 *
-	 * @since 1.5.0
+	 * @since BuddyPress (1.5)
 	 *
 	 * @global object $activities_template {@link BP_Activity_Template}
 	 * @uses apply_filters() To call the 'bp_acomment_name' hook
@@ -1535,7 +1609,10 @@ function bp_activity_comment_name() {
 	function bp_get_activity_comment_name() {
 		global $activities_template;
 
-		$name = apply_filters( 'bp_acomment_name', $activities_template->activity->current_comment->user_fullname, $activities_template->activity->current_comment ); // backward compatibility
+		if ( isset( $activities_template->activity->current_comment->user_fullname ) )
+			$name = apply_filters( 'bp_acomment_name', $activities_template->activity->current_comment->user_fullname, $activities_template->activity->current_comment );  // backward compatibility
+		else
+			$name = $activities_template->activity->current_comment->display_name;
 
 		return apply_filters( 'bp_activity_comment_name', $name );
 	}
@@ -1543,7 +1620,7 @@ function bp_activity_comment_name() {
 /**
  * Echoes the date_recorded of the activity comment currently being displayed
  *
- * @since 1.5.0
+ * @since BuddyPress (1.5)
  *
  * @uses bp_get_activity_comment_date_recorded()
  */
@@ -1554,7 +1631,7 @@ function bp_activity_comment_date_recorded() {
 	/**
 	 * Gets the date_recorded for the activity comment currently being displayed
 	 *
-	 * @since 1.5.0
+	 * @since BuddyPress (1.5)
 	 *
 	 * @global object $activities_template {@link BP_Activity_Template}
 	 * @uses bp_core_time_since()
@@ -1576,7 +1653,7 @@ function bp_activity_comment_date_recorded() {
 /**
  * Echoes the 'delete' URL for the activity comment currently being displayed
  *
- * @since 1.5.0
+ * @since BuddyPress (1.5)
  *
  * @uses bp_get_activity_comment_delete_link()
  */
@@ -1587,9 +1664,8 @@ function bp_activity_comment_delete_link() {
 	/**
 	 * Gets the 'delete' URL for the activity comment currently being displayed
 	 *
-	 * @since 1.5.0
+	 * @since BuddyPress (1.5)
 	 *
-	 * @global object $bp BuddyPress global settings
 	 * @uses wp_nonce_url()
 	 * @uses bp_get_root_domain()
 	 * @uses bp_get_activity_slug()
@@ -1599,9 +1675,7 @@ function bp_activity_comment_delete_link() {
 	 * @return string $link The nonced URL for deleting the current activity comment
 	 */
 	function bp_get_activity_comment_delete_link() {
-		global $bp;
-
-		$link = wp_nonce_url( bp_get_root_domain() . '/' . bp_get_activity_slug() . '/delete/?cid=' . bp_get_activity_comment_id(), 'bp_activity_delete_link' );
+		$link = wp_nonce_url( bp_get_root_domain() . '/' . bp_get_activity_slug() . '/delete/' . bp_get_activity_comment_id() . '?cid=' . bp_get_activity_comment_id(), 'bp_activity_delete_link' );
 
 		return apply_filters( 'bp_activity_comment_delete_link', $link );
 	}
@@ -1609,7 +1683,7 @@ function bp_activity_comment_delete_link() {
 /**
  * Echoes the content of the activity comment currently being displayed
  *
- * @since 1.5.0
+ * @since BuddyPress (1.5)
  *
  * @uses bp_get_activity_comment_content()
  */
@@ -1624,7 +1698,7 @@ function bp_activity_comment_content() {
 	 * applied to activity items in general. Use bp_activity_comment_content to modify the
 	 * content of activity comments only.
 	 *
-	 * @since 1.5.0
+	 * @since BuddyPress (1.5)
 	 *
 	 * @global object $activities_template {@link BP_Activity_Template}
 	 * @uses apply_filters() To call the 'bp_get_activity_content' hook
@@ -1643,7 +1717,7 @@ function bp_activity_comment_content() {
 /**
  * Echoes the activity comment count
  *
- * @since 1.2.0
+ * @since BuddyPress (1.2)
  *
  * @uses bp_activity_get_comment_count()
  */
@@ -1658,26 +1732,25 @@ function bp_activity_comment_count() {
 	 * applied to activity items in general. Use bp_activity_comment_content to modify the
 	 * content of activity comments only.
 	 *
-	 * @since 1.2.0
+	 * @since BuddyPress (1.2)
 	 *
 	 * @todo deprecate $args
 	 *
 	 * @global object $activities_template {@link BP_Activity_Template}
-	 * @global object $bp BuddyPress global settings
 	 * @uses bp_activity_recurse_comment_count()
 	 * @uses apply_filters() To call the 'bp_activity_get_comment_count' hook
 	 *
 	 * @return int $count The activity comment count. Defaults to zero
 	 */
 	function bp_activity_get_comment_count( $args = '' ) {
-		global $activities_template, $bp;
+		global $activities_template;
 
 		if ( !isset( $activities_template->activity->children ) || !$activities_template->activity->children )
 			return 0;
 
 		$count = bp_activity_recurse_comment_count( $activities_template->activity );
 
-		return apply_filters( 'bp_activity_get_comment_count', (int)$count );
+		return apply_filters( 'bp_activity_get_comment_count', (int) $count );
 	}
 
 		/**
@@ -1687,26 +1760,23 @@ function bp_activity_comment_count() {
 		 * applied to activity items in general. Use bp_activity_comment_content to modify the
 		 * content of activity comments only.
 		 *
-		 * @since 1.2.0
+		 * @since BuddyPress (1.2)
 		 *
 		 * @todo investigate why bp_activity_recurse_comment_count() is used while being declared
 		 *
 		 * @param object $comment Activity comments object
 		 *
-		 * @global object $activities_template {@link BP_Activity_Template}
-		 * @global object $bp BuddyPress global settings
 		 * @uses bp_activity_recurse_comment_count()
 		 * @uses apply_filters() To call the 'bp_activity_get_comment_count' hook
 		 *
 		 * @return int $count The activity comment count.
 		 */
 		function bp_activity_recurse_comment_count( $comment, $count = 0 ) {
-			global $activities_template, $bp;
 
-			if ( !$comment->children )
+			if ( empty( $comment->children ) )
 				return $count;
 
-			foreach ( (array)$comment->children as $comment ) {
+			foreach ( (array) $comment->children as $comment ) {
 				$count++;
 				$count = bp_activity_recurse_comment_count( $comment, $count );
 			}
@@ -1717,7 +1787,7 @@ function bp_activity_comment_count() {
 /**
  * Echoes the activity comment link
  *
- * @since 1.2.0
+ * @since BuddyPress (1.2)
  *
  * @uses bp_get_activity_comment_link()
  */
@@ -1728,7 +1798,7 @@ function bp_activity_comment_link() {
 	/**
 	 * Gets the activity comment link
 	 *
-	 * @since 1.2.0
+	 * @since BuddyPress (1.2)
 	 *
 	 * @global object $activities_template {@link BP_Activity_Template}
 	 * @uses apply_filters() To call the 'bp_get_activity_comment_link' hook
@@ -1743,7 +1813,7 @@ function bp_activity_comment_link() {
 /**
  * Echoes the activity comment form no javascript display CSS
  *
- * @since 1.2.0
+ * @since BuddyPress (1.2)
  *
  * @uses bp_get_activity_comment_form_nojs_display()
  */
@@ -1754,7 +1824,7 @@ function bp_activity_comment_form_nojs_display() {
 	/**
 	 * Gets the activity comment form no javascript display CSS
 	 *
-	 * @since 1.2.0
+	 * @since BuddyPress (1.2)
 	 *
 	 * @global object $activities_template {@link BP_Activity_Template}
 	 *
@@ -1771,7 +1841,7 @@ function bp_activity_comment_form_nojs_display() {
 /**
  * Echoes the activity comment form action
  *
- * @since 1.2.0
+ * @since BuddyPress (1.2)
  *
  * @uses bp_get_activity_comment_form_action()
  */
@@ -1782,9 +1852,8 @@ function bp_activity_comment_form_action() {
 	/**
 	 * Gets the activity comment form action
 	 *
-	 * @since 1.2.0
+	 * @since BuddyPress (1.2)
 	 *
-	 * @global object $bp BuddyPress global settings
 	 * @uses home_url()
 	 * @uses bp_get_activity_root_slug()
 	 * @uses apply_filters() To call the 'bp_get_activity_comment_form_action' hook
@@ -1792,15 +1861,13 @@ function bp_activity_comment_form_action() {
 	 * @return string The activity comment form action
 	 */
 	function bp_get_activity_comment_form_action() {
-		global $bp;
-
 		return apply_filters( 'bp_get_activity_comment_form_action', home_url( bp_get_activity_root_slug() . '/reply/' ) );
 	}
 
 /**
  * Echoes the activity permalink id
  *
- * @since 1.2.0
+ * @since BuddyPress (1.2)
  *
  * @uses bp_get_activity_permalink_id()
  */
@@ -1811,23 +1878,20 @@ function bp_activity_permalink_id() {
 	/**
 	 * Gets the activity permalink id
 	 *
-	 * @since 1.2.0
+	 * @since BuddyPress (1.2)
 	 *
-	 * @global object $bp BuddyPress global settings
 	 * @uses apply_filters() To call the 'bp_get_activity_permalink_id' hook
 	 *
 	 * @return string The activity permalink id
 	 */
 	function bp_get_activity_permalink_id() {
-		global $bp;
-
-		return apply_filters( 'bp_get_activity_permalink_id', $bp->current_action );
+		return apply_filters( 'bp_get_activity_permalink_id', bp_current_action() );
 	}
 
 /**
  * Echoes the activity thread permalink
  *
- * @since 1.2.0
+ * @since BuddyPress (1.2)
  *
  * @uses bp_get_activity_permalink_id()
  */
@@ -1838,16 +1902,15 @@ function bp_activity_thread_permalink() {
 	/**
 	 * Gets the activity thread permalink
 	 *
-	 * @since 1.2.0
+	 * @since BuddyPress (1.2)
 	 *
-	 * @global object $bp BuddyPress global settings
 	 * @uses bp_activity_get_permalink()
 	 * @uses apply_filters() To call the 'bp_get_activity_thread_permalink' hook
 	 *
 	 * @return string $link The activity thread permalink
 	 */
 	function bp_get_activity_thread_permalink() {
-		global $bp, $activities_template;
+		global $activities_template;
 
 		$link = bp_activity_get_permalink( $activities_template->activity->id, $activities_template->activity );
 
@@ -1857,7 +1920,7 @@ function bp_activity_thread_permalink() {
 /**
  * Echoes the activity favorite link
  *
- * @since 1.2.0
+ * @since BuddyPress (1.2)
  *
  * @uses bp_get_activity_favorite_link()
  */
@@ -1868,9 +1931,8 @@ function bp_activity_favorite_link() {
 	/**
 	 * Gets the activity favorite link
 	 *
-	 * @since 1.2.0
+	 * @since BuddyPress (1.2)
 	 *
-	 * @global object $bp BuddyPress global settings
 	 * @global object $activities_template {@link BP_Activity_Template}
 	 * @uses wp_nonce_url()
 	 * @uses home_url()
@@ -1880,14 +1942,14 @@ function bp_activity_favorite_link() {
 	 * @return string The activity favorite link
 	 */
 	function bp_get_activity_favorite_link() {
-		global $bp, $activities_template;
+		global $activities_template;
 		return apply_filters( 'bp_get_activity_favorite_link', wp_nonce_url( home_url( bp_get_activity_root_slug() . '/favorite/' . $activities_template->activity->id . '/' ), 'mark_favorite' ) );
 	}
 
 /**
  * Echoes the activity unfavorite link
  *
- * @since 1.2.0
+ * @since BuddyPress (1.2)
  *
  * @uses bp_get_activity_unfavorite_link()
  */
@@ -1898,9 +1960,8 @@ function bp_activity_unfavorite_link() {
 	/**
 	 * Gets the activity unfavorite link
 	 *
-	 * @since 1.2.0
+	 * @since BuddyPress (1.2)
 	 *
-	 * @global object $bp BuddyPress global settings
 	 * @global object $activities_template {@link BP_Activity_Template}
 	 * @uses wp_nonce_url()
 	 * @uses home_url()
@@ -1910,14 +1971,14 @@ function bp_activity_unfavorite_link() {
 	 * @return string The activity unfavorite link
 	 */
 	function bp_get_activity_unfavorite_link() {
-		global $bp, $activities_template;
+		global $activities_template;
 		return apply_filters( 'bp_get_activity_unfavorite_link', wp_nonce_url( home_url( bp_get_activity_root_slug() . '/unfavorite/' . $activities_template->activity->id . '/' ), 'unmark_favorite' ) );
 	}
 
 /**
  * Echoes the activity CSS class
  *
- * @since 1.0.0
+ * @since BuddyPress (1.0)
  *
  * @uses bp_get_activity_css_class()
  */
@@ -1928,7 +1989,7 @@ function bp_activity_css_class() {
 	/**
 	 * Gets the activity CSS class
 	 *
-	 * @since 1.0.0
+	 * @since BuddyPress (1.0)
 	 *
 	 * @global object $activities_template {@link BP_Activity_Template}
 	 * @uses apply_filters() To call the 'bp_activity_mini_activity_types' hook
@@ -1950,9 +2011,10 @@ function bp_activity_css_class() {
 			'new_member'
 		) );
 
-		$class = '';
-		if ( in_array( $activities_template->activity->type, (array)$mini_activity_actions ) || empty( $activities_template->activity->content ) )
-			$class = ' mini';
+		$class = ' activity-item';
+
+		if ( in_array( $activities_template->activity->type, (array) $mini_activity_actions ) || empty( $activities_template->activity->content ) )
+			$class .= ' mini';
 
 		if ( bp_activity_get_comment_count() && bp_activity_can_comment() )
 			$class .= ' has-comments';
@@ -1963,7 +2025,7 @@ function bp_activity_css_class() {
 /**
  * Display the activity delete link.
  *
- * @since 1.1.0
+ * @since BuddyPress (1.1)
  *
  * @uses bp_get_activity_delete_link()
  */
@@ -1974,10 +2036,9 @@ function bp_activity_delete_link() {
 	/**
 	 * Return the activity delete link.
 	 *
-	 * @since 1.1.0
+	 * @since BuddyPress (1.1)
 	 *
 	 * @global object $activities_template {@link BP_Activity_Template}
-	 * @global object $bp BuddyPress global settings
 	 * @uses bp_get_root_domain()
 	 * @uses bp_get_activity_root_slug()
 	 * @uses bp_is_activity_component()
@@ -1990,7 +2051,7 @@ function bp_activity_delete_link() {
 	 * @return string $link Activity delete link. Contains $redirect_to arg if on single activity page.
 	 */
 	function bp_get_activity_delete_link() {
-		global $activities_template, $bp;
+		global $activities_template;
 
 		$url   = bp_get_root_domain() . '/' . bp_get_activity_root_slug() . '/delete/' . $activities_template->activity->id;
 		$class = 'delete-activity';
@@ -2008,7 +2069,7 @@ function bp_activity_delete_link() {
 /**
  * Display the activity latest update link.
  *
- * @since 1.2.0
+ * @since BuddyPress (1.2)
  *
  * @param int $user_id Defaults to 0
  *
@@ -2021,12 +2082,11 @@ function bp_activity_latest_update( $user_id = 0 ) {
 	/**
 	 * Return the activity latest update link.
 	 *
-	 * @since 1.2.0
+	 * @since BuddyPress (1.2)
 	 *
 	 * @param int $user_id Defaults to 0
 	 *
-	 * @global object $bp BuddyPress global settings
-	 * @uses bp_core_is_user_spammer()
+	 * @uses bp_is_user_inactive()
 	 * @uses bp_core_is_user_deleted()
 	 * @uses bp_get_user_meta()
 	 * @uses apply_filters() To call the 'bp_get_activity_latest_update_excerpt' hook
@@ -2038,12 +2098,11 @@ function bp_activity_latest_update( $user_id = 0 ) {
 	 * @return string|bool $latest_update The activity latest update link. False on failure
 	 */
 	function bp_get_activity_latest_update( $user_id = 0 ) {
-		global $bp;
 
-		if ( !$user_id )
-			$user_id = $bp->displayed_user->id;
+		if ( empty( $user_id ) )
+			$user_id = bp_displayed_user_id();
 
-		if ( bp_core_is_user_spammer( $user_id ) || bp_core_is_user_deleted( $user_id ) )
+		if ( bp_is_user_inactive( $user_id ) )
 			return false;
 
 		if ( !$update = bp_get_user_meta( $user_id, 'bp_latest_update', true ) )
@@ -2058,7 +2117,7 @@ function bp_activity_latest_update( $user_id = 0 ) {
 /**
  * Display the activity filter links.
  *
- * @since 1.1.0
+ * @since BuddyPress (1.1)
  *
  * @param array $args Defaults to false
  *
@@ -2071,12 +2130,10 @@ function bp_activity_filter_links( $args = false ) {
 	/**
 	 * Return the activity filter links.
 	 *
-	 * @since 1.1.0
+	 * @since BuddyPress (1.1)
 	 *
 	 * @param array $args Defaults to false
 	 *
-	 * @global object $activities_template {@link BP_Activity_Template}
-	 * @global object $bp BuddyPress global settings
 	 * @uses wp_parse_args()
 	 * @uses BP_Activity_Activity::get_recorded_components() {@link BP_Activity_Activity}
 	 * @uses esc_attr()
@@ -2088,7 +2145,6 @@ function bp_activity_filter_links( $args = false ) {
 	 * @return string|bool $component_links The activity filter links. False on failure
 	 */
 	function bp_get_activity_filter_links( $args = false ) {
-		global $activities_template, $bp;
 
 		$defaults = array(
 			'style' => 'list'
@@ -2097,14 +2153,18 @@ function bp_activity_filter_links( $args = false ) {
 		$r = wp_parse_args( $args, $defaults );
 		extract( $r, EXTR_SKIP );
 
+		// Define local variable
+		$component_links = array();
+
 		// Fetch the names of components that have activity recorded in the DB
 		$components = BP_Activity_Activity::get_recorded_components();
 
-		if ( !$components )
+		if ( empty( $components ) )
 			return false;
 
 		foreach ( (array) $components as $component ) {
-			/* Skip the activity comment filter */
+
+			// Skip the activity comment filter
 			if ( 'activity' == $component )
 				continue;
 
@@ -2135,13 +2195,9 @@ function bp_activity_filter_links( $args = false ) {
 
 			$link = add_query_arg( 'afilter', $component );
 			$link = remove_query_arg( 'acpage' , $link );
-
 			$link = apply_filters( 'bp_get_activity_filter_link_href', $link, $component );
 
-			// Make sure all core internal component names are translatable
-			$translatable_components = array( __( 'xprofile', 'buddypress'), __( 'friends', 'buddypress' ), __( 'groups', 'buddypress' ), __( 'status', 'buddypress' ), __( 'sites', 'buddypress' ) );
-
-			$component_links[] = $before . '<a href="' . esc_attr( $link ) . '">' . ucwords( __( $component, 'buddypress' ) ) . '</a>' . $after;
+			$component_links[] = $before . '<a href="' . esc_attr( $link ) . '">' . ucwords( $component ) . '</a>' . $after;
 		}
 
 		$link = remove_query_arg( 'afilter' , $link );
@@ -2155,21 +2211,20 @@ function bp_activity_filter_links( $args = false ) {
 /**
  * Determine if a comment can be made on an activity item
  *
- * @since 1.2.0
+ * @since BuddyPress (1.2)
  *
  * @global object $activities_template {@link BP_Activity_Template}
- * @global object $bp BuddyPress global settings
  * @uses bp_get_activity_action_name()
  * @uses apply_filters() To call the 'bp_activity_can_comment' hook
  *
  * @return bool $can_comment Defaults to true
  */
 function bp_activity_can_comment() {
-	global $activities_template, $bp;
+	global $activities_template;
 
 	$can_comment = true;
 
-	if ( false === $activities_template->disable_blogforum_replies || (int)$activities_template->disable_blogforum_replies ) {
+	if ( false === $activities_template->disable_blogforum_replies || (int) $activities_template->disable_blogforum_replies ) {
 		if ( 'new_blog_post' == bp_get_activity_action_name() || 'new_blog_comment' == bp_get_activity_action_name() || 'new_forum_topic' == bp_get_activity_action_name() || 'new_forum_post' == bp_get_activity_action_name() )
 			$can_comment = false;
 	}
@@ -2183,7 +2238,7 @@ function bp_activity_can_comment() {
 /**
  * Determine if a comment can be made on an activity reply item
  *
- * @since 1.5.0
+ * @since BuddyPress (1.5)
  *
  * @param object $comment Activity comment
  *
@@ -2200,7 +2255,7 @@ function bp_activity_can_comment_reply( $comment ) {
 /**
  * Determine if an favorites are allowed
  *
- * @since 1.5.0
+ * @since BuddyPress (1.5)
  *
  * @uses apply_filters() To call the 'bp_activity_can_favorite' hook
  *
@@ -2215,7 +2270,7 @@ function bp_activity_can_favorite() {
 /**
  * Echoes the total favorite count for a specified user
  *
- * @since 1.2.0
+ * @since BuddyPress (1.2)
  *
  * @param int $user_id Defaults to 0
  *
@@ -2228,7 +2283,7 @@ function bp_total_favorite_count_for_user( $user_id = 0 ) {
 	/**
 	 * Returns the total favorite count for a specified user
 	 *
-	 * @since 1.2.0
+	 * @since BuddyPress (1.2)
 	 *
 	 * @param int $user_id Defaults to 0
 	 *
@@ -2244,7 +2299,7 @@ function bp_total_favorite_count_for_user( $user_id = 0 ) {
 /**
  * Echoes the total mention count for a specified user
  *
- * @since 1.2.0
+ * @since BuddyPress (1.2)
  *
  * @param int $user_id Defaults to 0
  *
@@ -2257,27 +2312,21 @@ function bp_total_mention_count_for_user( $user_id = 0 ) {
 	/**
 	 * Returns the total mention count for a specified user
 	 *
-	 * @since 1.2.0
-	 *
-	 * @todo remove unnecessary $bp global
+	 * @since BuddyPress (1.2)
 	 *
 	 * @param int $user_id Defaults to 0
-	 *
 	 * @uses bp_get_user_meta()
 	 * @uses apply_filters() To call the 'bp_get_total_mention_count_for_user' hook
-	 *
 	 * @return int The total mention count for a specified user
 	 */
 	function bp_get_total_mention_count_for_user( $user_id = 0 ) {
-		global $bp;
-
 		return apply_filters( 'bp_get_total_mention_count_for_user', bp_get_user_meta( $user_id, 'bp_new_mention_count', true ) );
 	}
 
 /**
  * Echoes the public message link for displayed user
  *
- * @since 1.2.0
+ * @since BuddyPress (1.2)
  *
  * @uses bp_get_send_public_message_link()
  */
@@ -2288,7 +2337,7 @@ function bp_send_public_message_link() {
 	/**
 	 * Returns the public message link for displayed user
 	 *
-	 * @since 1.2.0
+	 * @since BuddyPress (1.2)
 	 *
 	 * @global object $bp BuddyPress global settings
 	 * @uses bp_is_my_profile()
@@ -2307,13 +2356,13 @@ function bp_send_public_message_link() {
 		if ( bp_is_my_profile() || !is_user_logged_in() )
 			return false;
 
-		return apply_filters( 'bp_get_send_public_message_link', wp_nonce_url( bp_loggedin_user_domain() . bp_get_activity_slug() . '/?r=' . bp_core_get_username( $bp->displayed_user->id, $bp->displayed_user->userdata->user_nicename, $bp->displayed_user->userdata->user_login ) ) );
+		return apply_filters( 'bp_get_send_public_message_link', wp_nonce_url( bp_loggedin_user_domain() . bp_get_activity_slug() . '/?r=' . bp_core_get_username( bp_displayed_user_id(), bp_get_displayed_user_username(), $bp->displayed_user->userdata->user_login ) ) );
 	}
 
 /**
  * Echoes the mentioned user display name
  *
- * @since 1.2.0
+ * @since BuddyPress (1.2)
  *
  * @param int|string User id or username
  *
@@ -2326,7 +2375,7 @@ function bp_mentioned_user_display_name( $user_id_or_username ) {
 	/**
 	 * Returns the mentioned user display name
 	 *
-	 * @since 1.2.0
+	 * @since BuddyPress (1.2)
 	 *
 	 * @param int|string User id or username
 	 *
@@ -2345,7 +2394,7 @@ function bp_mentioned_user_display_name( $user_id_or_username ) {
 /**
  * Output button for sending a public message
  *
- * @since 1.2.0
+ * @since BuddyPress (1.2)
  *
  * @param array $args Optional
  *
@@ -2358,7 +2407,7 @@ function bp_send_public_message_button( $args = '' ) {
 	/**
 	 * Return button for sending a public message
 	 *
-	 * @since 1.2.0
+	 * @since BuddyPress (1.2)
 	 *
 	 * @param array $args Optional
 	 *
@@ -2391,7 +2440,7 @@ function bp_send_public_message_button( $args = '' ) {
 /**
  * Outputs the activity post form action
  *
- * @since 1.2.0
+ * @since BuddyPress (1.2)
  *
  * @uses bp_get_activity_post_form_action()
  */
@@ -2402,7 +2451,7 @@ function bp_activity_post_form_action() {
 	/**
 	 * Returns the activity post form action
 	 *
-	 * @since 1.2.0
+	 * @since BuddyPress (1.2)
 	 *
 	 * @uses home_url()
 	 * @uses bp_get_activity_root_slug()
@@ -2419,7 +2468,7 @@ function bp_activity_post_form_action() {
 /**
  * Outputs the sitewide activity feed link
  *
- * @since 1.0.0
+ * @since BuddyPress (1.0)
  *
  * @uses bp_get_sitewide_activity_feed_link()
  */
@@ -2430,7 +2479,7 @@ function bp_sitewide_activity_feed_link() {
 	/**
 	 * Returns the sitewide activity feed link
 	 *
-	 * @since 1.0.0
+	 * @since BuddyPress (1.0)
 	 *
 	 * @uses home_url()
 	 * @uses bp_get_activity_root_slug()
@@ -2445,7 +2494,7 @@ function bp_sitewide_activity_feed_link() {
 /**
  * Outputs the member activity feed link
  *
- * @since 1.2.0
+ * @since BuddyPress (1.2)
  *
  * @uses bp_get_member_activity_feed_link()
  */
@@ -2456,8 +2505,8 @@ function bp_member_activity_feed_link() {
 /**
  * Outputs the member activity feed link
  *
- * @since 1.0.0
- * @deprecated 1.2.0
+ * @since BuddyPress (1.0)
+ * @deprecated BuddyPress (1.2)
  *
  * @todo properly deprecated in favor of bp_member_activity_feed_link()
  *
@@ -2468,7 +2517,7 @@ function bp_activities_member_rss_link() { echo bp_get_member_activity_feed_link
 	/**
 	 * Returns the member activity feed link
 	 *
-	 * @since 1.2.0
+	 * @since BuddyPress (1.2)
 	 *
 	 * @uses bp_is_profile_component()
 	 * @uses bp_is_current_action()
@@ -2482,7 +2531,6 @@ function bp_activities_member_rss_link() { echo bp_get_member_activity_feed_link
 	 * @return string $link The member activity feed link
 	 */
 	function bp_get_member_activity_feed_link() {
-		global $bp;
 
 		if ( bp_is_profile_component() || bp_is_current_action( 'just-me' ) )
 			$link = bp_displayed_user_domain() . bp_get_activity_slug() . '/feed/';
@@ -2490,9 +2538,9 @@ function bp_activities_member_rss_link() { echo bp_get_member_activity_feed_link
 			$link = bp_displayed_user_domain() . bp_get_activity_slug() . '/' . bp_get_friends_slug() . '/feed/';
 		elseif ( bp_is_active( 'groups'  ) && bp_is_current_action( bp_get_groups_slug()  ) )
 			$link = bp_displayed_user_domain() . bp_get_activity_slug() . '/' . bp_get_groups_slug() . '/feed/';
-		elseif ( 'favorites' == $bp->current_action )
+		elseif ( 'favorites' == bp_current_action() )
 			$link = bp_displayed_user_domain() . bp_get_activity_slug() . '/favorites/feed/';
-		elseif ( 'mentions' == $bp->current_action )
+		elseif ( 'mentions' == bp_current_action() )
 			$link = bp_displayed_user_domain() . bp_get_activity_slug() . '/mentions/feed/';
 		else
 			$link = '';
@@ -2503,8 +2551,8 @@ function bp_activities_member_rss_link() { echo bp_get_member_activity_feed_link
 	/**
 	 * Returns the member activity feed link
 	 *
-	 * @since 1.0.0
-	 * @deprecated 1.2.0
+	 * @since BuddyPress (1.0)
+	 * @deprecated BuddyPress (1.2)
 	 *
 	 * @todo properly deprecated in favor of bp_get_member_activity_feed_link()
 	 *
@@ -2520,7 +2568,7 @@ function bp_activities_member_rss_link() { echo bp_get_member_activity_feed_link
 /**
  * Outputs the activity feed item guid
  *
- * @since 1.0.0
+ * @since BuddyPress (1.0)
  *
  * @uses bp_activity_feed_item_guid()
  */
@@ -2531,7 +2579,7 @@ function bp_activity_feed_item_guid() {
 	/**
 	 * Returns the activity feed item guid
 	 *
-	 * @since 1.2.0
+	 * @since BuddyPress (1.2)
 	 *
 	 * @global object $activities_template {@link BP_Activity_Template}
 	 * @uses apply_filters() To call the 'bp_get_activity_feed_item_guid' hook
@@ -2547,7 +2595,7 @@ function bp_activity_feed_item_guid() {
 /**
  * Outputs the activity feed item title
  *
- * @since 1.0.0
+ * @since BuddyPress (1.0)
  *
  * @uses bp_get_activity_feed_item_title()
  */
@@ -2558,7 +2606,7 @@ function bp_activity_feed_item_title() {
 	/**
 	 * Returns the activity feed item title
 	 *
-	 * @since 1.0.0
+	 * @since BuddyPress (1.0)
 	 *
 	 * @global object $activities_template {@link BP_Activity_Template}
 	 * @uses ent2ncr()
@@ -2591,7 +2639,7 @@ function bp_activity_feed_item_title() {
 /**
  * Outputs the activity feed item link
  *
- * @since 1.0.0
+ * @since BuddyPress (1.0)
  *
  * @uses bp_get_activity_feed_item_link()
  */
@@ -2602,7 +2650,7 @@ function bp_activity_feed_item_link() {
 	/**
 	 * Returns the activity feed item link
 	 *
-	 * @since 1.0.0
+	 * @since BuddyPress (1.0)
 	 *
 	 * @global object $activities_template {@link BP_Activity_Template}
 	 * @uses apply_filters() To call the 'bp_get_activity_feed_item_link' hook
@@ -2618,7 +2666,7 @@ function bp_activity_feed_item_link() {
 /**
  * Outputs the activity feed item date
  *
- * @since 1.0.0
+ * @since BuddyPress (1.0)
  *
  * @uses bp_get_activity_feed_item_date()
  */
@@ -2629,7 +2677,7 @@ function bp_activity_feed_item_date() {
 	/**
 	 * Returns the activity feed item date
 	 *
-	 * @since 1.0.0
+	 * @since BuddyPress (1.0)
 	 *
 	 * @global object $activities_template {@link BP_Activity_Template}
 	 * @uses apply_filters() To call the 'bp_get_activity_feed_item_date' hook
@@ -2645,7 +2693,7 @@ function bp_activity_feed_item_date() {
 /**
  * Outputs the activity feed item description
  *
- * @since 1.0.0
+ * @since BuddyPress (1.0)
  *
  * @uses bp_get_activity_feed_item_description()
  */
@@ -2656,7 +2704,7 @@ function bp_activity_feed_item_description() {
 	/**
 	 * Returns the activity feed item description
 	 *
-	 * @since 1.0.0
+	 * @since BuddyPress (1.0)
 	 *
 	 * @global object $activities_template {@link BP_Activity_Template}
 	 * @uses ent2ncr()
@@ -2668,10 +2716,9 @@ function bp_activity_feed_item_description() {
 	function bp_get_activity_feed_item_description() {
 		global $activities_template;
 
-		if ( empty( $activities_template->activity->action ) )
+		$content = '';
+		if ( ! empty( $activities_template->activity->content ) )
 			$content = $activities_template->activity->content;
-		else
-			$content = $activities_template->activity->action . ' ' . $activities_template->activity->content;
 
 		return apply_filters( 'bp_get_activity_feed_item_description', ent2ncr( convert_chars( str_replace( '%s', '', $content ) ) ) );
 	}
@@ -2679,7 +2726,7 @@ function bp_activity_feed_item_description() {
 /**
  * Template tag so we can hook activity feed to <head>
  *
- * @since 1.5.0
+ * @since BuddyPress (1.5)
  *
  * @uses bloginfo()
  * @uses bp_sitewide_activity_feed_link()
@@ -2693,4 +2740,4 @@ function bp_activity_sitewide_feed() {
 }
 add_action( 'bp_head', 'bp_activity_sitewide_feed' );
 
-?>
\ No newline at end of file
+?>
diff --git a/wp-content/plugins/buddypress/bp-activity/feeds/bp-activity-favorites-feed.php b/wp-content/plugins/buddypress/bp-activity/feeds/bp-activity-favorites-feed.php
index b99de10459ba5539c9bd8a1e127ca1da072b2dc0..8c90c5834823d9472aa42e9ef33e2af12394d543 100644
--- a/wp-content/plugins/buddypress/bp-activity/feeds/bp-activity-favorites-feed.php
+++ b/wp-content/plugins/buddypress/bp-activity/feeds/bp-activity-favorites-feed.php
@@ -24,10 +24,11 @@ header('Status: 200 OK');
 >
 
 <channel>
-	<title><?php bp_site_name() ?> | <?php echo $bp->displayed_user->fullname; ?> | <?php _e( 'Favorite Activity', 'buddypress' ) ?></title>
+	<?php /* translators: Favorited activity RSS title - "[Site Name] | [Displayed User Name] | Favorite Activity" */ ?>
+	<title><?php printf( '%1$s | %2$s | %3$s', bp_get_site_name(), bp_get_displayed_user_fullname(), __( 'Favorite Activity', 'buddypress' ) ) ?></title>
 	<atom:link href="<?php self_link(); ?>" rel="self" type="application/rss+xml" />
 	<link><?php echo home_url( bp_get_activity_root_slug() . '/#my-favorites/' ) ?></link>
-	<description><?php echo $bp->displayed_user->fullname; ?> - <?php _e( 'Favorite Activity', 'buddypress' ) ?></description>
+	<description><?php printf( __( '%s - Favorite Activity', 'buddypress' ), bp_get_displayed_user_fullname() ) ?></description>
 	<pubDate><?php echo mysql2date('D, d M Y H:i:s O', bp_activity_get_last_updated(), false); ?></pubDate>
 	<generator>http://buddypress.org/?v=<?php echo BP_VERSION ?></generator>
 	<language><?php echo get_option('rss_language'); ?></language>
@@ -35,8 +36,8 @@ header('Status: 200 OK');
 	<?php do_action('bp_activity_favorites_feed_head'); ?>
 
 	<?php
-		$favs = bp_activity_get_user_favorites( $bp->displayed_user->id );
-		$fav_ids = implode( ',', (array)$favs );
+		$favs = bp_activity_get_user_favorites( bp_displayed_user_id() );
+		$fav_ids = implode( ',', (array) $favs );
 	?>
 
 	<?php if ( bp_has_activities( 'include=' . $fav_ids . '&max=50&display_comments=stream' ) ) : ?>
diff --git a/wp-content/plugins/buddypress/bp-activity/feeds/bp-activity-friends-feed.php b/wp-content/plugins/buddypress/bp-activity/feeds/bp-activity-friends-feed.php
index e1d83abd693eaf403ef192b52fc2111575517693..c24a3c7a6d52f556d7db22f2f2ab983a3e942a4a 100644
--- a/wp-content/plugins/buddypress/bp-activity/feeds/bp-activity-friends-feed.php
+++ b/wp-content/plugins/buddypress/bp-activity/feeds/bp-activity-friends-feed.php
@@ -24,6 +24,7 @@ header('Status: 200 OK');
 >
 
 <channel>
+	<?php /* translators: Member friends activity RSS title - "[Site Name] | Friends Activity" */ ?>
 	<title><?php bp_site_name() ?> | <?php bp_displayed_user_fullname(); ?> | <?php _e( 'Friends Activity', 'buddypress' ); ?></title>
 	<atom:link href="<?php self_link(); ?>" rel="self" type="application/rss+xml" />
 	<link><?php echo bp_displayed_user_domain() . bp_get_activity_slug() . '/' . bp_get_friends_slug() . '/feed'; ?></link>
diff --git a/wp-content/plugins/buddypress/bp-activity/feeds/bp-activity-group-feed.php b/wp-content/plugins/buddypress/bp-activity/feeds/bp-activity-group-feed.php
index 4300e17598b406a768e737ddf52185a24125c3bf..846108b4dbd0a9633ce77b44542ca4a27d9d5f79 100644
--- a/wp-content/plugins/buddypress/bp-activity/feeds/bp-activity-group-feed.php
+++ b/wp-content/plugins/buddypress/bp-activity/feeds/bp-activity-group-feed.php
@@ -24,7 +24,8 @@ header('Status: 200 OK');
 >
 
 <channel>
-	<title><?php bp_site_name() ?> | <?php echo $bp->groups->current_group->name ?> | <?php _e( 'Group Activity', 'buddypress' ) ?></title>
+	<?php /* translators: Single group activity RSS title - "[Site Name] | [Group Name] | Group Activity" */ ?>
+	<title><?php printf( '%1$s | %2$s | %3$s', bp_get_site_name(), bp_get_current_group_name(), __( 'Group Activity', 'buddypress' ) ) ?></title>
 	<atom:link href="<?php self_link(); ?>" rel="self" type="application/rss+xml" />
 	<link><?php echo bp_get_group_permalink( $bp->groups->current_group ) . bp_get_activity_slug() . '/feed' ?></link>
 	<description><?php printf( __( '%s - Group Activity Feed', 'buddypress' ), $bp->groups->current_group->name  ) ?></description>
diff --git a/wp-content/plugins/buddypress/bp-activity/feeds/bp-activity-mentions-feed.php b/wp-content/plugins/buddypress/bp-activity/feeds/bp-activity-mentions-feed.php
index 40228d24ae8481dafef32d32522b30ff9fbc2878..b329096fe0549542286003d4e33192824f61f0da 100644
--- a/wp-content/plugins/buddypress/bp-activity/feeds/bp-activity-mentions-feed.php
+++ b/wp-content/plugins/buddypress/bp-activity/feeds/bp-activity-mentions-feed.php
@@ -1,7 +1,7 @@
 <?php
 
 /**
- * RSS2 Feed Template for displaying a member's group's activity
+ * RSS2 Feed Template for displaying a member's activity mentions
  *
  * @package BuddyPress
  * @subpackage ActivityFeeds
@@ -24,16 +24,18 @@ header('Status: 200 OK');
 >
 
 <channel>
-	<title><?php bp_site_name() ?> | <?php echo $bp->displayed_user->fullname; ?> | <?php _e( 'Mentions', 'buddypress' ) ?></title>
+	<?php /* translators: Mentions RSS title - "[Site Name] | [Displayed User Name] | Mentions" */ ?>
+	<title><?php printf( '%1$s | %2$s | %3$s', bp_get_site_name(), bp_get_displayed_user_fullname(), __( 'Mentions', 'buddypress' ) ) ?></title>
 	<atom:link href="<?php self_link(); ?>" rel="self" type="application/rss+xml" />
 	<link><?php echo home_url( bp_get_activity_root_slug() . '/#mentions/' ) ?></link>
-	<description><?php echo $bp->displayed_user->fullname; ?> - <?php _e( 'Mentions', 'buddypress' ) ?></description>
+	<?php /* translators: Mentions RSS title - "[Site Name] | [Displayed User Name] | Mentions" */ ?>
+	<description><?php printf( __( '%s - Mentions', 'buddypress' ), bp_get_displayed_user_fullname() ) ?></description>
 	<pubDate><?php echo mysql2date('D, d M Y H:i:s O', bp_activity_get_last_updated(), false); ?></pubDate>
 	<generator>http://buddypress.org/?v=<?php echo BP_VERSION ?></generator>
 	<language><?php echo get_option('rss_language'); ?></language>
 	<?php do_action('bp_activity_mentions_feed_head'); ?>
 
-	<?php if ( bp_has_activities( 'max=50&display_comments=stream&search_terms=@' . bp_core_get_username( $bp->displayed_user->id, $bp->displayed_user->userdata->user_nicename, $bp->displayed_user->userdata->user_login ) ) ) : ?>
+	<?php if ( bp_has_activities( 'max=50&display_comments=stream&search_terms=@' . bp_core_get_username( bp_displayed_user_id() ) ) ) : ?>
 		<?php while ( bp_activities() ) : bp_the_activity(); ?>
 			<item>
 				<guid><?php bp_activity_thread_permalink() ?></guid>
diff --git a/wp-content/plugins/buddypress/bp-activity/feeds/bp-activity-mygroups-feed.php b/wp-content/plugins/buddypress/bp-activity/feeds/bp-activity-mygroups-feed.php
index 21b8d26fc99a09e9798560da2203ec90881036b6..da15c36777792eadf552551dee83ac41192f909f 100644
--- a/wp-content/plugins/buddypress/bp-activity/feeds/bp-activity-mygroups-feed.php
+++ b/wp-content/plugins/buddypress/bp-activity/feeds/bp-activity-mygroups-feed.php
@@ -24,17 +24,19 @@ header('Status: 200 OK');
 >
 
 <channel>
-	<title><?php bp_site_name() ?> | <?php echo $bp->displayed_user->fullname; ?> | <?php _e( 'My Groups - Public Activity', 'buddypress' ) ?></title>
+	<?php /* translators: Member groups activity RSS title - "[Site Name] | [Displayed User Name] | My Groups - Public Activity" */ ?>
+	<title><?php printf( '%1$s | %2$s | %3$s', bp_get_site_name(), bp_get_displayed_user_fullname(), __( 'My Groups - Public Activity', 'buddypress' ) ) ?></title>
 	<atom:link href="<?php self_link(); ?>" rel="self" type="application/rss+xml" />
 	<link><?php echo home_url( bp_get_activity_root_slug() . '/#my-groups/' ) ?></link>
-	<description><?php echo $bp->displayed_user->fullname; ?> - <?php _e( 'My Groups - Public Activity', 'buddypress' ) ?></description>
+	<?php /* translators: Member groups activity RSS description - "[Displayed user name] - My Groups - Public Activity" */ ?>
+	<description><?php printf( __( '%1$s - My Groups - Public Activity', 'buddypress' ), bp_get_displayed_user_fullname() ) ?></description>
 	<pubDate><?php echo mysql2date('D, d M Y H:i:s O', bp_activity_get_last_updated(), false); ?></pubDate>
 	<generator>http://buddypress.org/?v=<?php echo BP_VERSION ?></generator>
 	<language><?php echo get_option('rss_language'); ?></language>
 	<?php do_action('bp_activity_mygroups_feed_head'); ?>
 
 	<?php
-		$groups = groups_get_user_groups( $bp->loggedin_user->id );
+		$groups = groups_get_user_groups( bp_loggedin_user_id() );
 		$group_ids = implode( ',', $groups['groups'] );
 	?>
 
diff --git a/wp-content/plugins/buddypress/bp-activity/feeds/bp-activity-personal-feed.php b/wp-content/plugins/buddypress/bp-activity/feeds/bp-activity-personal-feed.php
index 02e41ab091907a086648afed669ec532d35a2c9e..f438bc7f675f58f8cc2ddaa3dd68657d93b22427 100644
--- a/wp-content/plugins/buddypress/bp-activity/feeds/bp-activity-personal-feed.php
+++ b/wp-content/plugins/buddypress/bp-activity/feeds/bp-activity-personal-feed.php
@@ -24,16 +24,17 @@ header('Status: 200 OK');
 >
 
 <channel>
-	<title><?php bp_site_name() ?> | <?php echo $bp->displayed_user->fullname; ?> | <?php _e( 'Activity', 'buddypress' ) ?></title>
+	<?php /* translators: Personal activity RSS title - "[Site Name] | [Displayed User Name] | Activity" */ ?>
+	<title><?php printf( '%1$s | %2$s | %3$s', bp_get_site_name(), bp_get_displayed_user_fullname(), __( 'Activity', 'buddypress' ) ) ?></title>
 	<atom:link href="<?php self_link(); ?>" rel="self" type="application/rss+xml" />
 	<link><?php echo bp_displayed_user_domain() . bp_get_activity_slug() . '/feed' ?></link>
-	<description><?php printf( __( '%s - Activity Feed', 'buddypress' ), $bp->displayed_user->fullname ) ?></description>
+	<description><?php printf( __( '%s - Activity Feed', 'buddypress' ), bp_get_displayed_user_fullname() ) ?></description>
 	<pubDate><?php echo mysql2date('D, d M Y H:i:s O', bp_activity_get_last_updated(), false); ?></pubDate>
 	<generator>http://buddypress.org/?v=<?php echo BP_VERSION ?></generator>
 	<language><?php echo get_option('rss_language'); ?></language>
 	<?php do_action('bp_activity_personal_feed_head'); ?>
 
-	<?php if ( bp_has_activities( 'user_id=' . $bp->displayed_user->id . '&max=50&display_comments=stream' ) ) : ?>
+	<?php if ( bp_has_activities( 'user_id=' . bp_displayed_user_id() . '&max=50&display_comments=stream' ) ) : ?>
 		<?php while ( bp_activities() ) : bp_the_activity(); ?>
 			<item>
 				<guid><?php bp_activity_thread_permalink() ?></guid>
diff --git a/wp-content/plugins/buddypress/bp-activity/feeds/bp-activity-sitewide-feed.php b/wp-content/plugins/buddypress/bp-activity/feeds/bp-activity-sitewide-feed.php
index 5a3a0f6632670e3334405258c992ca967fd9d2d6..37a62c6d4382d66363994cfb1eb13de66ed34b9d 100644
--- a/wp-content/plugins/buddypress/bp-activity/feeds/bp-activity-sitewide-feed.php
+++ b/wp-content/plugins/buddypress/bp-activity/feeds/bp-activity-sitewide-feed.php
@@ -24,7 +24,8 @@ header('Status: 200 OK');
 >
 
 <channel>
-	<title><?php bp_site_name() ?> | <?php _e( 'Site Wide Activity', 'buddypress' ) ?></title>
+	<?php /* translators: Sitewide activity RSS title - "[Site Name] | Site Wide Activity" */ ?>
+	<title><?php printf( '%1$s | %2$s', bp_get_site_name(), __( 'Site Wide Activity', 'buddypress' ) ) ?></title>
 	<atom:link href="<?php self_link(); ?>" rel="self" type="application/rss+xml" />
 	<link><?php echo bp_get_root_domain() . '/' . bp_get_activity_root_slug() . '/feed' ?></link>
 	<description><?php _e( 'Site Wide Activity Feed', 'buddypress' ) ?></description>
diff --git a/wp-content/plugins/buddypress/bp-blogs/bp-blogs-actions.php b/wp-content/plugins/buddypress/bp-blogs/bp-blogs-actions.php
index dd248b445c881aba582ba51988c70e05850feb78..4300683016aac0702b7936738030b75da4df0612 100644
--- a/wp-content/plugins/buddypress/bp-blogs/bp-blogs-actions.php
+++ b/wp-content/plugins/buddypress/bp-blogs/bp-blogs-actions.php
@@ -1,16 +1,38 @@
 <?php
+
+/**
+ * BuddyPress Blogs Actions
+ *
+ * @package BuddyPress
+ * @subpackage BlogsActions
+ */
+
 // Exit if accessed directly
 if ( !defined( 'ABSPATH' ) ) exit;
 
+/**
+ * Redirect to a random blog in the multisite network
+ *
+ * @since BuddyPress (1.0)
+ * @package BuddyPress
+ * @subpackage BlogsActions
+ */
 function bp_blogs_redirect_to_random_blog() {
-	global $bp, $wpdb;
 
-	if ( bp_is_blogs_component() && isset( $_GET['random-blog'] ) ) {
-		$blog = bp_blogs_get_random_blogs( 1, 1 );
+	// Bail if not looking for a random blog
+	if ( ! bp_is_blogs_component() || ! isset( $_GET['random-blog'] ) )
+		return;
 
+	// Multisite is active so find a random blog
+	if ( is_multisite() ) {
+		$blog = bp_blogs_get_random_blogs( 1, 1 );
 		bp_core_redirect( get_site_url( $blog['blogs'][0]->blog_id ) );
+
+	// No multisite and still called, always redirect to root
+	} else {
+		bp_core_redirect( bp_core_get_root_domain() );
 	}
 }
 add_action( 'bp_actions', 'bp_blogs_redirect_to_random_blog' );
 
-?>
\ No newline at end of file
+?>
diff --git a/wp-content/plugins/buddypress/bp-blogs/bp-blogs-activity.php b/wp-content/plugins/buddypress/bp-blogs/bp-blogs-activity.php
index ec5f48417458b9e94fbed5924c09408af5320018..1fe80dfd38e7e0fd78be860efbcbf4d37f1c8616 100644
--- a/wp-content/plugins/buddypress/bp-blogs/bp-blogs-activity.php
+++ b/wp-content/plugins/buddypress/bp-blogs/bp-blogs-activity.php
@@ -1,17 +1,29 @@
 <?php
-/******************************************************************************
- * These functions handle the recording, deleting and formatting of activity and
- * notifications for the user and for this specific component.
+
+/**
+ * BuddyPress Blogs Activity
+ *
+ * @package BuddyPress
+ * @subpackage BlogsActivity
  */
 
 // Exit if accessed directly
 if ( !defined( 'ABSPATH' ) ) exit;
 
-
+/**
+ * Register activity actions for the blogs component
+ *
+ * @since BuddyPress (1.0)
+ * @package BuddyPress
+ * @subpackage BlogsActivity
+ * @global type $bp
+ * @return boolean 
+ */
 function bp_blogs_register_activity_actions() {
 	global $bp;
 
-	if ( !bp_is_active( 'activity' ) )
+	// Bail if activity is not active
+	if ( ! bp_is_active( 'activity' ) )
 		return false;
 
 	bp_activity_set_action( $bp->blogs->id, 'new_blog',         __( 'New site created',        'buddypress' ) );
@@ -22,14 +34,25 @@ function bp_blogs_register_activity_actions() {
 }
 add_action( 'bp_register_activity_actions', 'bp_blogs_register_activity_actions' );
 
+/**
+ * Record the activity to the actvity stream
+ *
+ * @since BuddyPress (1.0)
+ * @package BuddyPress
+ * @subpackage BlogsActivity
+ * @global BuddyPress $bp
+ * @param array $args
+ * @return boolean 
+ */
 function bp_blogs_record_activity( $args = '' ) {
 	global $bp;
 
-	if ( !bp_is_active( 'activity' ) )
+	// Bail if activity is not active
+	if ( ! bp_is_active( 'activity' ) )
 		return false;
 
 	$defaults = array(
-		'user_id'           => $bp->loggedin_user->id,
+		'user_id'           => bp_loggedin_user_id(),
 		'action'            => '',
 		'content'           => '',
 		'primary_link'      => '',
@@ -45,7 +68,7 @@ function bp_blogs_record_activity( $args = '' ) {
 	extract( $r, EXTR_SKIP );
 
 	// Remove large images and replace them with just one image thumbnail
- 	if ( bp_is_active( 'activity' ) && !empty( $content ) )
+ 	if ( !empty( $content ) )
 		$content = bp_activity_thumbnail_content_images( $content, $primary_link );
 
 	if ( !empty( $action ) )
@@ -66,29 +89,41 @@ function bp_blogs_record_activity( $args = '' ) {
 	return bp_activity_add( array( 'id' => $id, 'user_id' => $user_id, 'action' => $action, 'content' => $content, 'primary_link' => $primary_link, 'component' => $component, 'type' => $type, 'item_id' => $item_id, 'secondary_item_id' => $secondary_item_id, 'recorded_time' => $recorded_time, 'hide_sitewide' => $hide_sitewide ) );
 }
 
+/**
+ * Delete a blogs activity stream item
+ *
+ * @since BuddyPress (1.0)
+ * @package BuddyPress
+ * @subpackage BlogsActivity
+ * @global BuddyPress $bp
+ * @param array $args
+ * @return If activity is not active
+ */
 function bp_blogs_delete_activity( $args = true ) {
 	global $bp;
 
-	if ( bp_is_active( 'activity' ) ) {
-		$defaults = array(
-			'item_id'           => false,
-			'component'         => $bp->blogs->id,
-			'type'              => false,
-			'user_id'           => false,
-			'secondary_item_id' => false
-		);
-
-		$params = wp_parse_args( $args, $defaults );
-		extract( $params, EXTR_SKIP );
-
-		bp_activity_delete_by_item_id( array(
-			'item_id'           => $item_id,
-			'component'         => $component,
-			'type'              => $type,
-			'user_id'           => $user_id,
-			'secondary_item_id' => $secondary_item_id
-		) );
-	}
+	// Bail if activity is not active
+	if ( ! bp_is_active( 'activity' ) )
+		return false;
+
+	$defaults = array(
+		'item_id'           => false,
+		'component'         => $bp->blogs->id,
+		'type'              => false,
+		'user_id'           => false,
+		'secondary_item_id' => false
+	);
+
+	$params = wp_parse_args( $args, $defaults );
+	extract( $params, EXTR_SKIP );
+
+	bp_activity_delete_by_item_id( array(
+		'item_id'           => $item_id,
+		'component'         => $component,
+		'type'              => $type,
+		'user_id'           => $user_id,
+		'secondary_item_id' => $secondary_item_id
+	) );
 }
 
-?>
\ No newline at end of file
+?>
diff --git a/wp-content/plugins/buddypress/bp-blogs/bp-blogs-buddybar.php b/wp-content/plugins/buddypress/bp-blogs/bp-blogs-buddybar.php
index 06384fdec531a956909b2a6d0f173ce30fa87cf5..a254d05ef8f3a6889283a0c5db622837554774fb 100644
--- a/wp-content/plugins/buddypress/bp-blogs/bp-blogs-buddybar.php
+++ b/wp-content/plugins/buddypress/bp-blogs/bp-blogs-buddybar.php
@@ -1,8 +1,25 @@
 <?php
+
+/**
+ * BuddyPress Blogs Activity
+ *
+ * @package BuddyPress
+ * @subpackage BlogsBuddyBar
+ */
+
 // Exit if accessed directly
 if ( !defined( 'ABSPATH' ) ) exit;
 
-// *** "My Blogs" Menu ********
+/**
+ * Add a Sites menu to the BuddyBar
+ *
+ * @since BuddyPress (1.0)
+ * @package BuddyPress
+ * @subpackage BlogsBuddyBar
+ * @global BuddyPress $bp
+ * @return boolean 
+ */
+	
 function bp_adminbar_blogs_menu() {
 	global $bp;
 
@@ -12,22 +29,23 @@ function bp_adminbar_blogs_menu() {
 	if ( !is_multisite() )
 		return false;
 
-	if ( !$blogs = wp_cache_get( 'bp_blogs_of_user_' . $bp->loggedin_user->id . '_inc_hidden', 'bp' ) ) {
-		$blogs = bp_blogs_get_blogs_for_user( $bp->loggedin_user->id, true );
-		wp_cache_set( 'bp_blogs_of_user_' . $bp->loggedin_user->id . '_inc_hidden', $blogs, 'bp' );
+	$blogs = wp_cache_get( 'bp_blogs_of_user_' . bp_loggedin_user_id() . '_inc_hidden', 'bp' );
+	if ( empty( $blogs ) ) {
+		$blogs = bp_blogs_get_blogs_for_user( bp_loggedin_user_id(), true );
+		wp_cache_set( 'bp_blogs_of_user_' . bp_loggedin_user_id() . '_inc_hidden', $blogs, 'bp' );
 	}
 
 	$counter = 0;
-	if ( is_array( $blogs['blogs'] ) && (int)$blogs['count'] ) {
+	if ( is_array( $blogs['blogs'] ) && (int) $blogs['count'] ) {
 
-		echo '<li id="bp-adminbar-blogs-menu"><a href="' . trailingslashit( $bp->loggedin_user->domain . bp_get_blogs_slug() ) . '">';
+		echo '<li id="bp-adminbar-blogs-menu"><a href="' . trailingslashit( bp_loggedin_user_domain() . bp_get_blogs_slug() ) . '">';
 
 		_e( 'My Sites', 'buddypress' );
 
 		echo '</a>';
 		echo '<ul>';
 
-		foreach ( (array)$blogs['blogs'] as $blog ) {
+		foreach ( (array) $blogs['blogs'] as $blog ) {
 			$alt      = ( 0 == $counter % 2 ) ? ' class="alt"' : '';
 			$site_url = esc_attr( $blog->siteurl );
 
@@ -60,4 +78,4 @@ function bp_adminbar_blogs_menu() {
 }
 add_action( 'bp_adminbar_menus', 'bp_adminbar_blogs_menu', 6 );
 
-?>
\ No newline at end of file
+?>
diff --git a/wp-content/plugins/buddypress/bp-blogs/bp-blogs-cache.php b/wp-content/plugins/buddypress/bp-blogs/bp-blogs-cache.php
index 24f69ff89c28f1df411d97a68f8c19d59b138d4c..3fc55bc0a028414920e54319a7a6959f544e92f3 100644
--- a/wp-content/plugins/buddypress/bp-blogs/bp-blogs-cache.php
+++ b/wp-content/plugins/buddypress/bp-blogs/bp-blogs-cache.php
@@ -1,19 +1,40 @@
 <?php
-/*******************************************************************************
- * Caching
+
+/**
+ * BuddyPress Blogs Caching
  *
  * Caching functions handle the clearing of cached objects and pages on specific
  * actions throughout BuddyPress.
+ *
+ * @package BuddyPress
+ * @subpackage BlogsBuddyBar
  */
 
 // Exit if accessed directly
 if ( !defined( 'ABSPATH' ) ) exit;
 
+/**
+ * Clear the blog object cache
+ *
+ * @since BuddyPress (1.0)
+ * @package BuddyPress
+ * @subpackage BlogsBuddyBar
+ * @param int $blog_id
+ * @param int $user_id 
+ */
 function bp_blogs_clear_blog_object_cache( $blog_id, $user_id ) {
-	wp_cache_delete( 'bp_blogs_of_user_' . $user_id, 'bp' );
+	wp_cache_delete( 'bp_blogs_of_user_'        . $user_id, 'bp' );
 	wp_cache_delete( 'bp_total_blogs_for_user_' . $user_id, 'bp' );
 }
 
+/**
+ * Clear cache when a new blog is created
+ *
+ * @since BuddyPress (1.0)
+ * @package BuddyPress
+ * @subpackage BlogsBuddyBar
+ * @param Blog $recorded_blog_obj 
+ */
 function bp_blogs_format_clear_blog_cache( $recorded_blog_obj ) {
 	bp_blogs_clear_blog_object_cache( false, $recorded_blog_obj->user_id );
 	wp_cache_delete( 'bp_total_blogs', 'bp' );
@@ -34,4 +55,4 @@ add_action( 'bp_blogs_new_blog_post',        'bp_core_clear_cache' );
 add_action( 'bp_blogs_new_blog',             'bp_core_clear_cache' );
 add_action( 'bp_blogs_remove_data',          'bp_core_clear_cache' );
 
-?>
\ No newline at end of file
+?>
diff --git a/wp-content/plugins/buddypress/bp-blogs/bp-blogs-classes.php b/wp-content/plugins/buddypress/bp-blogs/bp-blogs-classes.php
index 73b5640e8517d1aae8a45edcff8babd687ea25ce..87d6f19feca1f388a149f4bd5129830a4170010f 100644
--- a/wp-content/plugins/buddypress/bp-blogs/bp-blogs-classes.php
+++ b/wp-content/plugins/buddypress/bp-blogs/bp-blogs-classes.php
@@ -1,22 +1,29 @@
 <?php
+
+/**
+ * BuddyPress Blogs Classes
+ *
+ * @package BuddyPress
+ * @subpackage BlogsClasses
+ */
+
 // Exit if accessed directly
 if ( !defined( 'ABSPATH' ) ) exit;
 
-Class BP_Blogs_Blog {
+/**
+ * The main BuddyPress blog class
+ *
+ * @since BuddyPress (1.0)
+ * @package BuddyPress
+ * @subpackage BlogsClasses
+ */
+class BP_Blogs_Blog {
 	var $id;
 	var $user_id;
 	var $blog_id;
 
-	function bp_blogs_blog( $id = null ) {
-		$this->__construct( $id );
-	}
-
 	function __construct( $id = null ) {
-		global $bp, $wpdb;
-
-		$user_id = bp_displayed_user_id();
-
-		if ( $id ) {
+		if ( !empty( $id ) ) {
 			$this->id = $id;
 			$this->populate();
 		}
@@ -77,7 +84,7 @@ Class BP_Blogs_Blog {
 	function get( $type, $limit = false, $page = false, $user_id = 0, $search_terms = false ) {
 		global $bp, $wpdb;
 
-		if ( !is_user_logged_in() || ( !is_super_admin() && ( $user_id != $bp->loggedin_user->id ) ) )
+		if ( !is_user_logged_in() || ( !bp_current_user_can( 'bp_moderate' ) && ( $user_id != bp_loggedin_user_id() ) ) )
 			$hidden_sql = "AND wb.public = 1";
 		else
 			$hidden_sql = '';
@@ -106,16 +113,16 @@ Class BP_Blogs_Blog {
 			$paged_blogs = $wpdb->get_results( "SELECT b.blog_id, b.user_id as admin_user_id, u.user_email as admin_user_email, wb.domain, wb.path, bm.meta_value as last_activity, bm2.meta_value as name FROM {$bp->blogs->table_name} b, {$bp->blogs->table_name_blogmeta} bm, {$bp->blogs->table_name_blogmeta} bm2, {$wpdb->base_prefix}blogs wb, {$wpdb->users} u WHERE b.blog_id = wb.blog_id AND b.user_id = u.ID AND b.blog_id = bm.blog_id AND b.blog_id = bm2.blog_id AND wb.archived = '0' AND wb.spam = 0 AND wb.mature = 0 AND wb.deleted = 0 {$hidden_sql} AND bm.meta_key = 'last_activity' AND bm2.meta_key = 'name' AND bm2.meta_value LIKE '%%$filter%%' {$user_sql} GROUP BY b.blog_id {$order_sql} {$pag_sql}" );
 			$total_blogs = $wpdb->get_var( "SELECT COUNT(DISTINCT b.blog_id) FROM {$bp->blogs->table_name} b, {$wpdb->base_prefix}blogs wb, {$bp->blogs->table_name_blogmeta} bm, {$bp->blogs->table_name_blogmeta} bm2 WHERE b.blog_id = wb.blog_id AND bm.blog_id = b.blog_id AND bm2.blog_id = b.blog_id AND wb.archived = '0' AND wb.spam = 0 AND wb.mature = 0 AND wb.deleted = 0 {$hidden_sql} AND bm.meta_key = 'name' AND bm2.meta_key = 'description' AND ( bm.meta_value LIKE '%%$filter%%' || bm2.meta_value LIKE '%%$filter%%' ) {$user_sql}" );
 		} else {
-			$paged_blogs = $wpdb->get_results( $wpdb->prepare( "SELECT b.blog_id, b.user_id as admin_user_id, u.user_email as admin_user_email, wb.domain, wb.path, bm.meta_value as last_activity, bm2.meta_value as name FROM {$bp->blogs->table_name} b, {$bp->blogs->table_name_blogmeta} bm, {$bp->blogs->table_name_blogmeta} bm2, {$wpdb->base_prefix}blogs wb, {$wpdb->users} u WHERE b.blog_id = wb.blog_id AND b.user_id = u.ID AND b.blog_id = bm.blog_id AND b.blog_id = bm2.blog_id {$user_sql} AND wb.archived = '0' AND wb.spam = 0 AND wb.mature = 0 AND wb.deleted = 0 {$hidden_sql} AND bm.meta_key = 'last_activity' AND bm2.meta_key = 'name' GROUP BY b.blog_id {$order_sql} {$pag_sql}" ) );
-			$total_blogs = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(DISTINCT b.blog_id) FROM {$bp->blogs->table_name} b, {$wpdb->base_prefix}blogs wb WHERE b.blog_id = wb.blog_id {$user_sql} AND wb.archived = '0' AND wb.spam = 0 AND wb.mature = 0 AND wb.deleted = 0 {$hidden_sql}" ) );
+			$paged_blogs = $wpdb->get_results( "SELECT b.blog_id, b.user_id as admin_user_id, u.user_email as admin_user_email, wb.domain, wb.path, bm.meta_value as last_activity, bm2.meta_value as name FROM {$bp->blogs->table_name} b, {$bp->blogs->table_name_blogmeta} bm, {$bp->blogs->table_name_blogmeta} bm2, {$wpdb->base_prefix}blogs wb, {$wpdb->users} u WHERE b.blog_id = wb.blog_id AND b.user_id = u.ID AND b.blog_id = bm.blog_id AND b.blog_id = bm2.blog_id {$user_sql} AND wb.archived = '0' AND wb.spam = 0 AND wb.mature = 0 AND wb.deleted = 0 {$hidden_sql} AND bm.meta_key = 'last_activity' AND bm2.meta_key = 'name' GROUP BY b.blog_id {$order_sql} {$pag_sql}" );
+			$total_blogs = $wpdb->get_var( "SELECT COUNT(DISTINCT b.blog_id) FROM {$bp->blogs->table_name} b, {$wpdb->base_prefix}blogs wb WHERE b.blog_id = wb.blog_id {$user_sql} AND wb.archived = '0' AND wb.spam = 0 AND wb.mature = 0 AND wb.deleted = 0 {$hidden_sql}" );
 		}
 
 		$blog_ids = array();
-		foreach ( (array)$paged_blogs as $blog ) {
+		foreach ( (array) $paged_blogs as $blog ) {
 			$blog_ids[] = $blog->blog_id;
 		}
 
-		$blog_ids = $wpdb->escape( join( ',', (array)$blog_ids ) );
+		$blog_ids = $wpdb->escape( join( ',', (array) $blog_ids ) );
 		$paged_blogs = BP_Blogs_Blog::get_blog_extras( $paged_blogs, $blog_ids, $type );
 
 		return array( 'blogs' => $paged_blogs, 'total' => $total_blogs );
@@ -132,7 +139,7 @@ Class BP_Blogs_Blog {
 		global $wpdb, $bp;
 
 		if ( !$user_id )
-			$user_id = $bp->loggedin_user->id;
+			$user_id = bp_loggedin_user_id();
 
 		return $wpdb->query( $wpdb->prepare( "DELETE FROM {$bp->blogs->table_name} WHERE user_id = %d AND blog_id = %d", $user_id, $blog_id ) );
 	}
@@ -141,7 +148,7 @@ Class BP_Blogs_Blog {
 		global $wpdb, $bp;
 
 		if ( !$user_id )
-			$user_id = $bp->loggedin_user->id;
+			$user_id = bp_loggedin_user_id();
 
 		return $wpdb->query( $wpdb->prepare( "DELETE FROM {$bp->blogs->table_name} WHERE user_id = %d", $user_id ) );
 	}
@@ -150,7 +157,7 @@ Class BP_Blogs_Blog {
 		global $bp, $wpdb;
 
 		if ( !$user_id )
-			$user_id = $bp->displayed_user->id;
+			$user_id = bp_displayed_user_id();
 
 		// Show logged in users their hidden blogs.
 		if ( !bp_is_my_profile() && !$show_hidden )
@@ -161,7 +168,7 @@ Class BP_Blogs_Blog {
 		$total_blog_count = BP_Blogs_Blog::total_blog_count_for_user( $user_id );
 
 		$user_blogs = array();
-		foreach ( (array)$blogs as $blog ) {
+		foreach ( (array) $blogs as $blog ) {
 			$user_blogs[$blog->blog_id] = new stdClass;
 			$user_blogs[$blog->blog_id]->id = $blog->id;
 			$user_blogs[$blog->blog_id]->blog_id = $blog->blog_id;
@@ -176,7 +183,7 @@ Class BP_Blogs_Blog {
 		global $bp, $wpdb;
 
 		if ( !$user_id )
-			$user_id = $bp->displayed_user->id;
+			$user_id = bp_displayed_user_id();
 
 		return $wpdb->get_col( $wpdb->prepare( "SELECT blog_id FROM {$bp->blogs->table_name} WHERE user_id = %d", $user_id ) );
 	}
@@ -191,10 +198,10 @@ Class BP_Blogs_Blog {
 		global $bp, $wpdb;
 
 		if ( !$user_id )
-			$user_id = $bp->displayed_user->id;
+			$user_id = bp_displayed_user_id();
 
 		// If the user is logged in return the blog count including their hidden blogs.
-		if ( ( is_user_logged_in() && $user_id == $bp->loggedin_user->id ) || is_super_admin() )
+		if ( ( is_user_logged_in() && $user_id == bp_loggedin_user_id() ) || bp_current_user_can( 'bp_moderate' ) )
 			return $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(DISTINCT b.blog_id) FROM {$bp->blogs->table_name} b LEFT JOIN {$wpdb->base_prefix}blogs wb ON b.blog_id = wb.blog_id WHERE wb.deleted = 0 AND wb.spam = 0 AND wb.mature = 0 AND wb.archived = '0' AND user_id = %d", $user_id) );
 		else
 			return $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(DISTINCT b.blog_id) FROM {$bp->blogs->table_name} b LEFT JOIN {$wpdb->base_prefix}blogs wb ON b.blog_id = wb.blog_id WHERE wb.public = 1 AND wb.deleted = 0 AND wb.spam = 0 AND wb.mature = 0 AND wb.archived = '0' AND user_id = %d", $user_id) );
@@ -205,7 +212,7 @@ Class BP_Blogs_Blog {
 
 		$filter = like_escape( $wpdb->escape( $filter ) );
 
-		if ( !is_super_admin() )
+		if ( !bp_current_user_can( 'bp_moderate' ) )
 			$hidden_sql = "AND wb.public = 1";
 
 		if ( $limit && $page )
@@ -220,11 +227,11 @@ Class BP_Blogs_Blog {
 	function get_all( $limit = null, $page = null ) {
 		global $bp, $wpdb;
 
-		$hidden_sql = !is_super_admin() ? "AND wb.public = 1" : '';
+		$hidden_sql = !bp_current_user_can( 'bp_moderate' ) ? "AND wb.public = 1" : '';
 		$pag_sql = ( $limit && $page ) ? $wpdb->prepare( " LIMIT %d, %d", intval( ( $page - 1 ) * $limit), intval( $limit ) ) : '';
 
-		$paged_blogs = $wpdb->get_results( $wpdb->prepare( "SELECT DISTINCT b.blog_id FROM {$bp->blogs->table_name} b LEFT JOIN {$wpdb->base_prefix}blogs wb ON b.blog_id = wb.blog_id WHERE wb.mature = 0 AND wb.spam = 0 AND wb.archived = '0' AND wb.deleted = 0 {$hidden_sql} {$pag_sql}" ) );
-		$total_blogs = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(DISTINCT b.blog_id) FROM {$bp->blogs->table_name} b LEFT JOIN {$wpdb->base_prefix}blogs wb ON b.blog_id = wb.blog_id WHERE wb.mature = 0 AND wb.spam = 0 AND wb.archived = '0' AND wb.deleted = 0 {$hidden_sql}" ) );
+		$paged_blogs = $wpdb->get_results( "SELECT DISTINCT b.blog_id FROM {$bp->blogs->table_name} b LEFT JOIN {$wpdb->base_prefix}blogs wb ON b.blog_id = wb.blog_id WHERE wb.mature = 0 AND wb.spam = 0 AND wb.archived = '0' AND wb.deleted = 0 {$hidden_sql} {$pag_sql}" );
+		$total_blogs = $wpdb->get_var( "SELECT COUNT(DISTINCT b.blog_id) FROM {$bp->blogs->table_name} b LEFT JOIN {$wpdb->base_prefix}blogs wb ON b.blog_id = wb.blog_id WHERE wb.mature = 0 AND wb.spam = 0 AND wb.archived = '0' AND wb.deleted = 0 {$hidden_sql}" );
 
 		return array( 'blogs' => $paged_blogs, 'total' => $total_blogs );
 	}
@@ -234,14 +241,14 @@ Class BP_Blogs_Blog {
 
 		$letter = like_escape( $wpdb->escape( $letter ) );
 
-		if ( !is_super_admin() )
+		if ( !bp_current_user_can( 'bp_moderate' ) )
 			$hidden_sql = "AND wb.public = 1";
 
 		if ( $limit && $page )
 			$pag_sql = $wpdb->prepare( " LIMIT %d, %d", intval( ( $page - 1 ) * $limit), intval( $limit ) );
 
-		$paged_blogs = $wpdb->get_results( $wpdb->prepare( "SELECT DISTINCT bm.blog_id FROM {$bp->blogs->table_name_blogmeta} bm LEFT JOIN {$wpdb->base_prefix}blogs wb ON bm.blog_id = wb.blog_id WHERE bm.meta_key = 'name' AND bm.meta_value LIKE '$letter%%' {$hidden_sql} AND wb.mature = 0 AND wb.spam = 0 AND wb.archived = '0' AND wb.deleted = 0 ORDER BY bm.meta_value ASC{$pag_sql}" ) );
-		$total_blogs = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(DISTINCT bm.blog_id) FROM {$bp->blogs->table_name_blogmeta} bm LEFT JOIN {$wpdb->base_prefix}blogs wb ON bm.blog_id = wb.blog_id WHERE bm.meta_key = 'name' AND bm.meta_value LIKE '$letter%%' {$hidden_sql} AND wb.mature = 0 AND wb.spam = 0 AND wb.archived = '0' AND wb.deleted = 0 ORDER BY bm.meta_value ASC" ) );
+		$paged_blogs = $wpdb->get_results( "SELECT DISTINCT bm.blog_id FROM {$bp->blogs->table_name_blogmeta} bm LEFT JOIN {$wpdb->base_prefix}blogs wb ON bm.blog_id = wb.blog_id WHERE bm.meta_key = 'name' AND bm.meta_value LIKE '$letter%%' {$hidden_sql} AND wb.mature = 0 AND wb.spam = 0 AND wb.archived = '0' AND wb.deleted = 0 ORDER BY bm.meta_value ASC{$pag_sql}" );
+		$total_blogs = $wpdb->get_var( "SELECT COUNT(DISTINCT bm.blog_id) FROM {$bp->blogs->table_name_blogmeta} bm LEFT JOIN {$wpdb->base_prefix}blogs wb ON bm.blog_id = wb.blog_id WHERE bm.meta_key = 'name' AND bm.meta_value LIKE '$letter%%' {$hidden_sql} AND wb.mature = 0 AND wb.spam = 0 AND wb.archived = '0' AND wb.deleted = 0 ORDER BY bm.meta_value ASC" );
 
 		return array( 'blogs' => $paged_blogs, 'total' => $total_blogs );
 	}
@@ -258,10 +265,10 @@ Class BP_Blogs_Blog {
 		}
 
 		/* Fetch the blog description for each blog (as it may be empty we can't fetch it in the main query). */
-		$blog_descs = $wpdb->get_results( $wpdb->prepare( "SELECT blog_id, meta_value as description FROM {$bp->blogs->table_name_blogmeta} WHERE meta_key = 'description' AND blog_id IN ( {$blog_ids} )" ) );
+		$blog_descs = $wpdb->get_results( "SELECT blog_id, meta_value as description FROM {$bp->blogs->table_name_blogmeta} WHERE meta_key = 'description' AND blog_id IN ( {$blog_ids} )" );
 
 		for ( $i = 0, $count = count( $paged_blogs ); $i < $count; ++$i ) {
-			foreach ( (array)$blog_descs as $desc ) {
+			foreach ( (array) $blog_descs as $desc ) {
 				if ( $desc->blog_id == $paged_blogs[$i]->blog_id )
 					$paged_blogs[$i]->description = $desc->description;
 			}
@@ -273,10 +280,11 @@ Class BP_Blogs_Blog {
 	function is_hidden( $blog_id ) {
 		global $wpdb;
 
-		if ( !(int)$wpdb->get_var( $wpdb->prepare( "SELECT DISTINCT public FROM {$wpdb->base_prefix}blogs WHERE blog_id = %d", $blog_id ) ) )
+		if ( !(int) $wpdb->get_var( $wpdb->prepare( "SELECT DISTINCT public FROM {$wpdb->base_prefix}blogs WHERE blog_id = %d", $blog_id ) ) )
 			return true;
 
 		return false;
 	}
 }
-?>
\ No newline at end of file
+
+?>
diff --git a/wp-content/plugins/buddypress/bp-blogs/bp-blogs-filters.php b/wp-content/plugins/buddypress/bp-blogs/bp-blogs-filters.php
new file mode 100644
index 0000000000000000000000000000000000000000..1da1c54d86bce613528ca9a11f7d93d822f8313c
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-blogs/bp-blogs-filters.php
@@ -0,0 +1,26 @@
+<?php
+
+/**
+ * Filters related to the Blogs component.
+ *
+ * @package BuddyPress
+ * @subpackage Blogs
+ * @since 1.6
+ */
+
+/**
+ * Ensures that the 'Create a new site' link at wp-admin/my-sites.php points to the BP blog signup
+ *
+ * @since 1.6
+ * @uses apply_filters() Filter bp_blogs_creation_location to alter the returned value
+ *
+ * @param string $url The original URL (points to wp-signup.php by default)
+ * @return string The new URL
+ */
+function bp_blogs_creation_location( $url ) {
+     return apply_filters( 'bp_blogs_creation_location', trailingslashit( bp_get_root_domain() . '/' . bp_get_blogs_slug() . '/create', $url ) );
+}
+add_filter( 'wp_signup_location', 'bp_blogs_creation_location' );
+
+
+?>
\ No newline at end of file
diff --git a/wp-content/plugins/buddypress/bp-blogs/bp-blogs-functions.php b/wp-content/plugins/buddypress/bp-blogs/bp-blogs-functions.php
index 6606631efc210f92aca67a87e383877e7e5ad040..82b5b00e361cbe43f21801bc8f148c49b140d74d 100644
--- a/wp-content/plugins/buddypress/bp-blogs/bp-blogs-functions.php
+++ b/wp-content/plugins/buddypress/bp-blogs/bp-blogs-functions.php
@@ -5,9 +5,9 @@ if ( !defined( 'ABSPATH' ) ) exit;
 /**
  * Checks $bp pages global and looks for directory page
  *
- * @since 1.5
+ * @since BuddyPress (1.5)
  *
- * @global object $bp Global BuddyPress settings object
+ * @global BuddyPress $bp The one true BuddyPress instance
  * @return bool True if set, False if empty
  */
 function bp_blogs_has_directory() {
@@ -17,7 +17,6 @@ function bp_blogs_has_directory() {
 }
 
 function bp_blogs_get_blogs( $args = '' ) {
-	global $bp;
 
 	$defaults = array(
 		'type'         => 'active', // active, alphabetical, newest, or random
@@ -50,17 +49,17 @@ function bp_blogs_record_existing_blogs() {
 	$wpdb->query( "TRUNCATE TABLE {$bp->blogs->table_name}" );
 
 	if ( is_multisite() )
-		$blog_ids = $wpdb->get_col( $wpdb->prepare( "SELECT blog_id FROM {$wpdb->base_prefix}blogs WHERE mature = 0 AND spam = 0 AND deleted = 0" ) );
+		$blog_ids = $wpdb->get_col( "SELECT blog_id FROM {$wpdb->base_prefix}blogs WHERE mature = 0 AND spam = 0 AND deleted = 0" );
 	else
 		$blog_ids = 1;
 
 	if ( $blog_ids ) {
-		foreach( (array)$blog_ids as $blog_id ) {
+		foreach( (array) $blog_ids as $blog_id ) {
 			$users 		= get_users( array( 'blog_id' => $blog_id ) );
 			$subscribers 	= get_users( array( 'blog_id' => $blog_id, 'role' => 'subscriber' ) );
 
 			if ( !empty( $users ) ) {
-				foreach ( (array)$users as $user ) {
+				foreach ( (array) $users as $user ) {
 					// Don't record blogs for subscribers
 					if ( !in_array( $user, $subscribers ) )
 						bp_blogs_record_blog( $blog_id, $user->ID, true );
@@ -73,18 +72,16 @@ function bp_blogs_record_existing_blogs() {
 /**
  * Makes BuddyPress aware of a new site so that it can track its activity.
  *
- * @global object $bp BuddyPress global settings
+ * @since BuddyPress (1.0)
  * @param int $blog_id
  * @param int $user_id
  * @param $bool $no_activity ; optional.
- * @since 1.0
  * @uses BP_Blogs_Blog
  */
 function bp_blogs_record_blog( $blog_id, $user_id, $no_activity = false ) {
-	global $bp;
 
-	if ( !$user_id )
-		$user_id = $bp->loggedin_user->id;
+	if ( empty( $user_id ) )
+		$user_id = bp_loggedin_user_id();
 
 	$name = get_blog_option( $blog_id, 'blogname' );
 	$description = get_blog_option( $blog_id, 'blogdescription' );
@@ -95,16 +92,14 @@ function bp_blogs_record_blog( $blog_id, $user_id, $no_activity = false ) {
 	$recorded_blog          = new BP_Blogs_Blog;
 	$recorded_blog->user_id = $user_id;
 	$recorded_blog->blog_id = $blog_id;
-
-	$recorded_blog_id = $recorded_blog->save();
-
-	$is_recorded = !empty( $recorded_blog_id ) ? true : false;
+	$recorded_blog_id       = $recorded_blog->save();
+	$is_recorded            = !empty( $recorded_blog_id ) ? true : false;
 
 	bp_blogs_update_blogmeta( $recorded_blog->blog_id, 'name', $name );
 	bp_blogs_update_blogmeta( $recorded_blog->blog_id, 'description', $description );
 	bp_blogs_update_blogmeta( $recorded_blog->blog_id, 'last_activity', bp_core_current_time() );
 
-	$is_private = !empty( $_POST['blog_public'] ) && (int)$_POST['blog_public'] ? false : true;
+	$is_private = !empty( $_POST['blog_public'] ) && (int) $_POST['blog_public'] ? false : true;
 	$is_private = !apply_filters( 'bp_is_new_blog_public', !$is_private );
 
 	// Only record this activity if the blog is public
@@ -154,11 +149,11 @@ add_action( 'update_option_blogdescription', 'bp_blogs_update_option_blogdescrip
 function bp_blogs_record_post( $post_id, $post, $user_id = 0 ) {
 	global $bp, $wpdb;
 
-	$post_id = (int)$post_id;
-	$blog_id = (int)$wpdb->blogid;
+	$post_id = (int) $post_id;
+	$blog_id = (int) $wpdb->blogid;
 
 	if ( !$user_id )
-		$user_id = (int)$post->post_author;
+		$user_id = (int) $post->post_author;
 
 	// Stop infinite loops with WordPress MU Sitewide Tags.
 	// That plugin changed the way its settings were stored at some point. Thus the dual check.
@@ -169,7 +164,7 @@ function bp_blogs_record_post( $post_id, $post, $user_id = 0 ) {
 		$tags_blog_id = isset( $bp->site_options['tags_blog_id'] ) ? $bp->site_options['tags_blog_id'] : 0;
 	}
 
-	if ( (int)$blog_id == $tags_blog_id && apply_filters( 'bp_blogs_block_sitewide_tags_activity', true ) )
+	if ( (int) $blog_id == $tags_blog_id && apply_filters( 'bp_blogs_block_sitewide_tags_activity', true ) )
 		return false;
 
 	// Don't record this if it's not a post
@@ -180,18 +175,35 @@ function bp_blogs_record_post( $post_id, $post, $user_id = 0 ) {
 
 	if ( 'publish' == $post->post_status && empty( $post->post_password ) ) {
 		if ( $is_blog_public || !is_multisite() ) {
+			
 			// Record this in activity streams
 			$post_permalink   = get_permalink( $post_id );
 
 			if ( is_multisite() )
-				$activity_action  = sprintf( __( '%1$s wrote a new post, %2$s, on the site %3$s', 'buddypress' ), bp_core_get_userlink( (int)$post->post_author ), '<a href="' . $post_permalink . '">' . $post->post_title . '</a>', '<a href="' . get_blog_option( $blog_id, 'home' ) . '">' . get_blog_option( $blog_id, 'blogname' ) . '</a>' );
+				$activity_action  = sprintf( __( '%1$s wrote a new post, %2$s, on the site %3$s', 'buddypress' ), bp_core_get_userlink( (int) $post->post_author ), '<a href="' . $post_permalink . '">' . $post->post_title . '</a>', '<a href="' . get_blog_option( $blog_id, 'home' ) . '">' . get_blog_option( $blog_id, 'blogname' ) . '</a>' );
 			else
-				$activity_action  = sprintf( __( '%1$s wrote a new post, %2$s', 'buddypress' ), bp_core_get_userlink( (int)$post->post_author ), '<a href="' . $post_permalink . '">' . $post->post_title . '</a>' );
+				$activity_action  = sprintf( __( '%1$s wrote a new post, %2$s', 'buddypress' ), bp_core_get_userlink( (int) $post->post_author ), '<a href="' . $post_permalink . '">' . $post->post_title . '</a>' );
+
+			// Make sure there's not an existing entry for this post (prevent bumping)
+			if ( bp_is_active( 'activity' ) ) {
+				$existing = bp_activity_get( array(
+					'filter' => array(
+						'user_id'      => (int) $post->post_author,
+						'action'       => 'new_blog_post',
+						'primary_id'   => $blog_id,
+						'secondary_id' => $post_id,
+					)
+				) );
+				
+				if ( !empty( $existing['activities'] ) ) {
+					return;
+				}
+			}
 
 			$activity_content = $post->post_content;
 
 			bp_blogs_record_activity( array(
-				'user_id'           => (int)$post->post_author,
+				'user_id'           => (int) $post->post_author,
 				'action'            => apply_filters( 'bp_blogs_activity_new_post_action',       $activity_action,  $post, $post_permalink ),
 				'content'           => apply_filters( 'bp_blogs_activity_new_post_content',      $activity_content, $post, $post_permalink ),
 				'primary_link'      => apply_filters( 'bp_blogs_activity_new_post_primary_link', $post_permalink,   $post_id               ),
@@ -216,14 +228,11 @@ add_action( 'save_post', 'bp_blogs_record_post', 10, 2 );
  * Record blog comment activity. Checks if blog is public and post is not
  * password protected.
  *
- * @global $bp $bp
  * @param int $comment_id
- * @param bool $is_approved
+ * @param mixed $is_approved
  * @return mixed
  */
 function bp_blogs_record_comment( $comment_id, $is_approved = true ) {
-	global $bp;
-
 	// Get the users comment
 	$recorded_comment = get_comment( $comment_id );
 
@@ -235,14 +244,20 @@ function bp_blogs_record_comment( $comment_id, $is_approved = true ) {
 	if ( empty( $recorded_comment->comment_author_email ) )
 		return false;
 
-	// Get the user_id from the comment author email.
-	$user    = get_user_by( 'email', $recorded_comment->comment_author_email );
-	$user_id = (int)$user->ID;
+	// Don't record activity if the comment has already been marked as spam
+	if ( 'spam' === $is_approved )
+		return false;
 
-	// If there's no registered user id, don't record activity
-	if ( empty( $user_id ) )
+	// Get the user by the comment author email.
+	$user = get_user_by( 'email', $recorded_comment->comment_author_email );
+
+	// If user isn't registered, don't record activity
+	if ( empty( $user ) )
 		return false;
 
+	// Get the user_id
+	$user_id = (int) $user->ID;
+
 	// Get blog and post data
 	$blog_id                = get_current_blog_id();
 	$recorded_comment->post = get_post( $recorded_comment->comment_post_ID );
@@ -296,14 +311,6 @@ function bp_blogs_record_comment( $comment_id, $is_approved = true ) {
 add_action( 'comment_post', 'bp_blogs_record_comment', 10, 2 );
 add_action( 'edit_comment', 'bp_blogs_record_comment', 10    );
 
-function bp_blogs_manage_comment( $comment_id, $comment_status ) {
-	if ( 'spam' == $comment_status || 'hold' == $comment_status || 'delete' == $comment_status || 'trash' == $comment_status )
-		return bp_blogs_remove_comment( $comment_id );
-
-	return bp_blogs_record_comment( $comment_id, true );
-}
-add_action( 'wp_set_comment_status', 'bp_blogs_manage_comment', 10, 2 );
-
 function bp_blogs_add_user_to_blog( $user_id, $role = false, $blog_id = 0 ) {
 	global $wpdb;
 	
@@ -314,7 +321,7 @@ function bp_blogs_add_user_to_blog( $user_id, $role = false, $blog_id = 0 ) {
 	if ( empty( $role ) ) {
 		$key = $wpdb->get_blog_prefix( $blog_id ). 'capabilities';
 
-		$roles = get_user_meta( $user_id, $key, true );
+		$roles = bp_get_user_meta( $user_id, $key, true );
 
 		if ( is_array( $roles ) )
 			$role = array_search( 1, $roles );
@@ -339,10 +346,28 @@ function bp_blogs_remove_user_from_blog( $user_id, $blog_id = 0 ) {
 }
 add_action( 'remove_user_from_blog', 'bp_blogs_remove_user_from_blog', 10, 2 );
 
+/**
+ * Rehooks WP's maybe_add_existing_user_to_blog with a later priority
+ *
+ * WordPress catches add-user-to-blog requests at init:10. In some cases, this can precede BP's
+ * Blogs component. This function bumps the priority of the core function, so that we can be sure
+ * that the Blogs component is loaded first. See http://buddypress.trac.wordpress.org/ticket/3916
+ *
+ * @since 1.6
+ */
+function bp_blogs_maybe_add_user_to_blog() {
+	if ( ! is_multisite() )
+		return;
+
+	remove_action( 'init', 'maybe_add_existing_user_to_blog' );
+	add_action( 'init', 'maybe_add_existing_user_to_blog', 20 );
+}
+add_action( 'init', 'bp_blogs_maybe_add_user_to_blog', 1 );
+
 function bp_blogs_remove_blog( $blog_id ) {
 	global $bp;
 
-	$blog_id = (int)$blog_id;
+	$blog_id = (int) $blog_id;
 	do_action( 'bp_blogs_before_remove_blog', $blog_id );
 
 	BP_Blogs_Blog::delete_blog_for_all( $blog_id );
@@ -355,17 +380,21 @@ function bp_blogs_remove_blog( $blog_id ) {
 add_action( 'delete_blog', 'bp_blogs_remove_blog' );
 
 function bp_blogs_remove_blog_for_user( $user_id, $blog_id ) {
-	global $bp, $current_user;
+	global $bp;
 
-	$blog_id = (int)$blog_id;
-	$user_id = (int)$user_id;
+	$blog_id = (int) $blog_id;
+	$user_id = (int) $user_id;
 
 	do_action( 'bp_blogs_before_remove_blog_for_user', $blog_id, $user_id );
 
 	BP_Blogs_Blog::delete_blog_for_user( $blog_id, $user_id );
 
 	// Delete activity stream item
-	bp_blogs_delete_activity( array( 'item_id' => $blog_id, 'component' => $bp->blogs->id, 'type' => 'new_blog' ) );
+	bp_blogs_delete_activity( array(
+		'item_id'   => $blog_id,
+		'component' => $bp->blogs->id,
+		'type'      => 'new_blog'
+	) );
 
 	do_action( 'bp_blogs_remove_blog_for_user', $blog_id, $user_id );
 }
@@ -377,13 +406,13 @@ function bp_blogs_remove_post( $post_id, $blog_id = 0, $user_id = 0 ) {
 	if ( empty( $wpdb->blogid ) )
 		return false;
 
-	$post_id = (int)$post_id;
+	$post_id = (int) $post_id;
 
 	if ( !$blog_id )
-		$blog_id = (int)$wpdb->blogid;
+		$blog_id = (int) $wpdb->blogid;
 
 	if ( !$user_id )
-		$user_id = $bp->loggedin_user->id;
+		$user_id = bp_loggedin_user_id();
 
 	do_action( 'bp_blogs_before_remove_post', $blog_id, $post_id, $user_id );
 
@@ -395,15 +424,87 @@ function bp_blogs_remove_post( $post_id, $blog_id = 0, $user_id = 0 ) {
 add_action( 'delete_post', 'bp_blogs_remove_post' );
 
 function bp_blogs_remove_comment( $comment_id ) {
-	global $wpdb, $bp;
+	global $wpdb;
 
 	// Delete activity stream item
 	bp_blogs_delete_activity( array( 'item_id' => $wpdb->blogid, 'secondary_item_id' => $comment_id, 'type' => 'new_blog_comment' ) );
 
-	do_action( 'bp_blogs_remove_comment', $wpdb->blogid, $comment_id, $bp->loggedin_user->id );
+	do_action( 'bp_blogs_remove_comment', $wpdb->blogid, $comment_id, bp_loggedin_user_id() );
 }
 add_action( 'delete_comment', 'bp_blogs_remove_comment' );
 
+/**
+ * When a blog comment status transition occurs, update the relevant activity's status.
+ *
+ * @global object $bp BuddyPress global settings
+ * @param string $new_status New comment status.
+ * @param string $old_status Previous comment status.
+ * @param object $comment Comment data.
+ * @since 1.6
+ */
+function bp_blogs_transition_activity_status( $new_status, $old_status, $comment ) {
+	global $bp;
+
+	// Check the Activity component is active
+	if ( ! bp_is_active( 'activity' ) )
+		return;
+
+	/**
+	 * Activity currently doesn't have any concept of a trash, or an unapproved/approved state.
+	 *
+	 * If a blog comment transitions to a "delete" or "hold" status, delete the activity item.
+	 * If a blog comment transitions to trashed, or spammed, mark the activity as spam.
+	 * If a blog comment transitions to approved (and the activity exists), mark the activity as ham.
+	 * Otherwise, record the comment into the activity stream.
+	 */
+
+	// This clause was moved in from bp_blogs_remove_comment() in BuddyPress 1.6. It handles delete/hold.
+	if ( in_array( $new_status, array( 'delete', 'hold' ) ) )
+		return bp_blogs_remove_comment( $comment->comment_ID );
+
+	// These clauses handle trash, spam, and un-spams.
+	elseif ( in_array( $new_status, array( 'trash', 'spam' ) ) )
+		$action = 'spam_activity';
+	elseif ( 'approved' == $new_status )
+		$action = 'ham_activity';
+
+	// Get the activity
+	$activity_id = bp_activity_get_activity_id( array( 'component' => $bp->blogs->id, 'item_id' => get_current_blog_id(), 'secondary_item_id' => $comment->comment_ID, 'type' => 'new_blog_comment', ) );
+
+	// Check activity item exists
+	if ( ! $activity_id ) {
+
+		// If no activity exists, but the comment has been approved, record it into the activity table.
+		if ( 'approved' == $new_status )
+			return bp_blogs_record_comment( $comment->comment_ID, true );
+
+		return;
+	}
+
+	// Create an activity object
+	$activity = new BP_Activity_Activity( $activity_id );
+	if ( empty( $activity->component ) )
+		return;
+
+	// Spam/ham the activity if it's not already in that state
+	if ( 'spam_activity' == $action && ! $activity->is_spam ) {
+		bp_activity_mark_as_spam( $activity );
+	} elseif ( 'ham_activity' == $action) {
+		bp_activity_mark_as_ham( $activity );
+	}
+
+	// Add "new_blog_comment" to the whitelisted activity types, so that the activity's Akismet history is generated
+	$comment_akismet_history = create_function( '$t', '$t[] = "new_blog_comment"; return $t;' );
+	add_filter( 'bp_akismet_get_activity_types', $comment_akismet_history );
+
+	// Save the updated activity
+	$activity->save();
+
+	// Remove the "new_blog_comment" activity type whitelist so we don't break anything
+	remove_filter( 'bp_akismet_get_activity_types', $comment_akismet_history );
+}
+add_action( 'transition_comment_status', 'bp_blogs_transition_activity_status', 10, 3 );
+
 function bp_blogs_total_blogs() {
 	if ( !$count = wp_cache_get( 'bp_total_blogs', 'bp' ) ) {
 		$blogs = BP_Blogs_Blog::get_all();
@@ -414,10 +515,9 @@ function bp_blogs_total_blogs() {
 }
 
 function bp_blogs_total_blogs_for_user( $user_id = 0 ) {
-	global $bp;
 
-	if ( !$user_id )
-		$user_id = ( $bp->displayed_user->id ) ? $bp->displayed_user->id : $bp->loggedin_user->id;
+	if ( empty( $user_id ) )
+		$user_id = ( bp_displayed_user_id() ) ? bp_displayed_user_id() : bp_loggedin_user_id();
 
 	if ( !$count = wp_cache_get( 'bp_total_blogs_for_user_' . $user_id, 'bp' ) ) {
 		$count = BP_Blogs_Blog::total_blog_count_for_user( $user_id );
@@ -518,7 +618,7 @@ function bp_blogs_get_blogmeta( $blog_id, $meta_key = '') {
 			return '';
 	}
 
-	$metas = array_map('maybe_unserialize', (array)$metas);
+	$metas = array_map('maybe_unserialize', (array) $metas);
 
 	if ( 1 == count($metas) )
 		return $metas[0];
@@ -570,4 +670,5 @@ function bp_blogs_remove_data( $user_id ) {
 add_action( 'wpmu_delete_user',  'bp_blogs_remove_data' );
 add_action( 'delete_user',       'bp_blogs_remove_data' );
 add_action( 'bp_make_spam_user', 'bp_blogs_remove_data' );
-?>
\ No newline at end of file
+
+?>
diff --git a/wp-content/plugins/buddypress/bp-blogs/bp-blogs-loader.php b/wp-content/plugins/buddypress/bp-blogs/bp-blogs-loader.php
index fc23a6675df3a8962f1f516d6644533b28148d7e..76e4815e457bd949f46cfc0dc5a8b6c951a10c0a 100644
--- a/wp-content/plugins/buddypress/bp-blogs/bp-blogs-loader.php
+++ b/wp-content/plugins/buddypress/bp-blogs/bp-blogs-loader.php
@@ -1,4 +1,5 @@
 <?php
+
 /**
  * BuddyPress Blogs Streams Loader
  *
@@ -16,7 +17,7 @@ class BP_Blogs_Component extends BP_Component {
 	/**
 	 * Start the blogs component creation process
 	 *
-	 * @since 1.5
+	 * @since BuddyPress (1.5)
 	 */
 	function __construct() {
 		parent::start(
@@ -32,8 +33,8 @@ class BP_Blogs_Component extends BP_Component {
 	 * The BP_BLOGS_SLUG constant is deprecated, and only used here for
 	 * backwards compatibility.
 	 *
-	 * @since 1.5
-	 * @global obj $bp
+	 * @since BuddyPress (1.5)
+	 * @global BuddyPress $bp The one true BuddyPress instance
 	 */
 	function setup_globals() {
 		global $bp;
@@ -50,7 +51,6 @@ class BP_Blogs_Component extends BP_Component {
 		// All globals for messaging component.
 		// Note that global_tables is included in this array.
 		$globals = array(
-			'path'                  => BP_PLUGIN_DIR,
 			'slug'                  => BP_BLOGS_SLUG,
 			'root_slug'             => isset( $bp->pages->blogs->slug ) ? $bp->pages->blogs->slug : BP_BLOGS_SLUG,
 			'has_directory'         => is_multisite(), // Non-multisite installs don't need a top-level Sites directory, since there's only one site
@@ -75,6 +75,7 @@ class BP_Blogs_Component extends BP_Component {
 			'screens',
 			'classes',
 			'template',
+			'filters',
 			'activity',
 			'functions',
 			'buddybar'
@@ -90,7 +91,7 @@ class BP_Blogs_Component extends BP_Component {
 	/**
 	 * Setup BuddyBar navigation
 	 *
-	 * @global obj $bp
+	 * @global BuddyPress $bp The one true BuddyPress instance
 	 */
 	function setup_nav() {
 		global $bp;
@@ -103,24 +104,37 @@ class BP_Blogs_Component extends BP_Component {
 		if ( !is_multisite() )
 			return false;
 
+		$sub_nav = array();
+
 		// Add 'Sites' to the main navigation
 		$main_nav =  array(
 			'name'                => sprintf( __( 'Sites <span>%d</span>', 'buddypress' ), bp_blogs_total_blogs_for_user() ),
 			'slug'                => $this->slug,
 			'position'            => 30,
 			'screen_function'     => 'bp_blogs_screen_my_blogs',
-			'default_subnav_slug' => 'my-blogs',
+			'default_subnav_slug' => 'my-sites',
 			'item_css_id'         => $this->id
 		);
+		
+		$parent_url = trailingslashit( bp_displayed_user_domain() . bp_get_blogs_slug() );
+		
+		$sub_nav[] = array(
+			'name'            => __( 'My Sites', 'buddypress' ),
+			'slug'            => 'my-sites',
+			'parent_url'      => $parent_url,
+			'parent_slug'     => $bp->blogs->slug,
+			'screen_function' => 'bp_blogs_screen_my_blogs',
+			'position'        => 10
+		);
 
 		// Setup navigation
-		parent::setup_nav( $main_nav );
+		parent::setup_nav( $main_nav, $sub_nav );
 	}
 
 	/**
-	 * Set up the admin bar
+	 * Set up the Toolbar
 	 *
-	 * @global obj $bp
+	 * @global BuddyPress $bp The one true BuddyPress instance
 	 */
 	function setup_admin_bar() {
 		global $bp;
@@ -139,7 +153,7 @@ class BP_Blogs_Component extends BP_Component {
 		// Menus for logged in user
 		if ( is_user_logged_in() ) {
 
-			$blogs_link = trailingslashit( $bp->loggedin_user->domain . $this->slug );
+			$blogs_link = trailingslashit( bp_loggedin_user_domain() . $this->slug );
 
 			// Add the "Blogs" sub menu
 			$wp_admin_nav[] = array(
@@ -165,7 +179,7 @@ class BP_Blogs_Component extends BP_Component {
 	/**
 	 * Sets up the title for pages and <title>
 	 *
-	 * @global obj $bp
+	 * @global BuddyPress $bp The one true BuddyPress instance
 	 */
 	function setup_title() {
 		global $bp;
@@ -181,17 +195,22 @@ class BP_Blogs_Component extends BP_Component {
 			// users avatar and name
 			} else {
 				$bp->bp_options_avatar = bp_core_fetch_avatar( array(
-					'item_id' => $bp->displayed_user->id,
-					'type'    => 'thumb'
+					'item_id' => bp_displayed_user_id(),
+					'type'    => 'thumb',
+					'alt'     => sprintf( __( 'Profile picture of %s', 'buddypress' ), bp_get_displayed_user_fullname() )
 				) );
-				$bp->bp_options_title = $bp->displayed_user->fullname;
+				$bp->bp_options_title = bp_get_displayed_user_fullname();
 			}
 		}
 
 		parent::setup_title();
 	}
 }
-// Create the blogs component
-$bp->blogs = new BP_Blogs_Component();
 
-?>
\ No newline at end of file
+function bp_setup_blogs() {
+	global $bp;
+	$bp->blogs = new BP_Blogs_Component();
+}
+add_action( 'bp_setup_components', 'bp_setup_blogs', 6 );
+
+?>
diff --git a/wp-content/plugins/buddypress/bp-blogs/bp-blogs-screens.php b/wp-content/plugins/buddypress/bp-blogs/bp-blogs-screens.php
index c7cedf2ccc5d3fabcbd93ea0f549a616c050666d..b96cf8ed66d3c0ffbdbf13db45a90971e1fadbfa 100644
--- a/wp-content/plugins/buddypress/bp-blogs/bp-blogs-screens.php
+++ b/wp-content/plugins/buddypress/bp-blogs/bp-blogs-screens.php
@@ -1,4 +1,12 @@
 <?php
+
+/**
+ * BuddyPress Blogs Screens
+ *
+ * @package BuddyPress
+ * @subpackage BlogsScreens
+ */
+
 // Exit if accessed directly
 if ( !defined( 'ABSPATH' ) ) exit;
 
@@ -35,4 +43,4 @@ function bp_blogs_screen_index() {
 }
 add_action( 'bp_screens', 'bp_blogs_screen_index', 2 );
 
-?>
\ No newline at end of file
+?>
diff --git a/wp-content/plugins/buddypress/bp-blogs/bp-blogs-template.php b/wp-content/plugins/buddypress/bp-blogs/bp-blogs-template.php
index f916f68f3dcea8643613faf66aeec93fdea807ec..3bca221a9f4415d8c408719c4d4912543cd2a19d 100644
--- a/wp-content/plugins/buddypress/bp-blogs/bp-blogs-template.php
+++ b/wp-content/plugins/buddypress/bp-blogs/bp-blogs-template.php
@@ -1,4 +1,12 @@
 <?php
+
+/**
+ * BuddyPress Blogs Template Tags
+ *
+ * @package BuddyPress
+ * @subpackage BlogsTemplate
+ */
+
 // Exit if accessed directly
 if ( !defined( 'ABSPATH' ) ) exit;
 
@@ -6,8 +14,8 @@ if ( !defined( 'ABSPATH' ) ) exit;
  * Output the blogs component slug
  *
  * @package BuddyPress
- * @subpackage Blogs Template
- * @since BuddyPress (r4100)
+ * @subpackage BlogsTemplate
+ * @since BuddyPress (1.5)
  *
  * @uses bp_get_blogs_slug()
  */
@@ -18,8 +26,8 @@ function bp_blogs_slug() {
 	 * Return the blogs component slug
 	 *
 	 * @package BuddyPress
-	 * @subpackage Blogs Template
-	 * @since BuddyPress (r4100)
+	 * @subpackage BlogsTemplate
+	 * @since BuddyPress (1.5)
 	 */
 	function bp_get_blogs_slug() {
 		global $bp;
@@ -30,8 +38,8 @@ function bp_blogs_slug() {
  * Output the blogs component root slug
  *
  * @package BuddyPress
- * @subpackage Blogs Template
- * @since BuddyPress (r4100)
+ * @subpackage BlogsTemplate
+ * @since BuddyPress (1.5)
  *
  * @uses bp_get_blogs_root_slug()
  */
@@ -42,8 +50,8 @@ function bp_blogs_root_slug() {
 	 * Return the blogs component root slug
 	 *
 	 * @package BuddyPress
-	 * @subpackage Blogs Template
-	 * @since BuddyPress (r4100)
+	 * @subpackage BlogsTemplate
+	 * @since BuddyPress (1.5)
 	 */
 	function bp_get_blogs_root_slug() {
 		global $bp;
@@ -54,8 +62,8 @@ function bp_blogs_root_slug() {
  * Output blog directory permalink
  *
  * @package BuddyPress
- * @subpackage Blogs Template
- * @since 1.5
+ * @subpackage BlogsTemplate
+ * @since BuddyPress (1.5)
  * @uses bp_get_blogs_directory_permalink()
  */
 function bp_blogs_directory_permalink() {
@@ -65,8 +73,8 @@ function bp_blogs_directory_permalink() {
 	 * Return blog directory permalink
 	 *
 	 * @package BuddyPress
-	 * @subpackage Blogs Template
-	 * @since 1.5
+	 * @subpackage BlogsTemplate
+	 * @since BuddyPress (1.5)
 	 * @uses apply_filters()
 	 * @uses traisingslashit()
 	 * @uses bp_get_root_domain()
@@ -94,14 +102,9 @@ class BP_Blogs_Template {
 	var $pag_links;
 	var $total_blog_count;
 
-	function bp_blogs_template( $type, $page, $per_page, $max, $user_id, $search_terms ) {
-		$this->__construct( $type, $page, $per_page, $max, $user_id, $search_terms );
-	}
+	function __construct( $type, $page, $per_page, $max, $user_id, $search_terms, $page_arg = 'bpage' ) {
 
-	function __construct( $type, $page, $per_page, $max, $user_id, $search_terms ) {
-		global $bp;
-
-		$this->pag_page = isset( $_REQUEST['bpage'] ) ? intval( $_REQUEST['bpage'] ) : $page;
+		$this->pag_page = isset( $_REQUEST[$page_arg] ) ? intval( $_REQUEST[$page_arg] ) : $page;
 		$this->pag_num = isset( $_REQUEST['num'] ) ? intval( $_REQUEST['num'] ) : $per_page;
 
 		if ( isset( $_REQUEST['letter'] ) && '' != $_REQUEST['letter'] )
@@ -109,10 +112,10 @@ class BP_Blogs_Template {
 		else
 			$this->blogs = bp_blogs_get_blogs( array( 'type' => $type, 'per_page' => $this->pag_num, 'page' => $this->pag_page, 'user_id' => $user_id, 'search_terms' => $search_terms ) );
 
-		if ( !$max || $max >= (int)$this->blogs['total'] )
-			$this->total_blog_count = (int)$this->blogs['total'];
+		if ( !$max || $max >= (int) $this->blogs['total'] )
+			$this->total_blog_count = (int) $this->blogs['total'];
 		else
-			$this->total_blog_count = (int)$max;
+			$this->total_blog_count = (int) $max;
 
 		$this->blogs = $this->blogs['blogs'];
 
@@ -120,18 +123,18 @@ class BP_Blogs_Template {
 			if ( $max >= count($this->blogs) ) {
 				$this->blog_count = count( $this->blogs );
 			} else {
-				$this->blog_count = (int)$max;
+				$this->blog_count = (int) $max;
 			}
 		} else {
 			$this->blog_count = count( $this->blogs );
 		}
 
-		if ( (int)$this->total_blog_count && (int)$this->pag_num ) {
+		if ( (int) $this->total_blog_count && (int) $this->pag_num ) {
 			$this->pag_links = paginate_links( array(
-				'base'      => add_query_arg( 'bpage', '%#%' ),
+				'base'      => add_query_arg( $page_arg, '%#%' ),
 				'format'    => '',
-				'total'     => ceil( (int)$this->total_blog_count / (int)$this->pag_num ),
-				'current'   => (int)$this->pag_page,
+				'total'     => ceil( (int) $this->total_blog_count / (int) $this->pag_num ),
+				'current'   => (int) $this->pag_page,
 				'prev_text' => _x( '&larr;', 'Blog pagination previous text', 'buddypress' ),
 				'next_text' => _x( '&rarr;', 'Blog pagination next text', 'buddypress' ),
 				'mid_size'  => 1
@@ -174,7 +177,6 @@ class BP_Blogs_Template {
 	}
 
 	function the_blog() {
-		global $blog;
 
 		$this->in_the_loop = true;
 		$this->blog        = $this->next_blog();
@@ -191,7 +193,7 @@ function bp_rewind_blogs() {
 }
 
 function bp_has_blogs( $args = '' ) {
-	global $bp, $blogs_template;
+	global $blogs_template;
 
 	/***
 	 * Set the defaults based on the current page. Any of these will be overridden
@@ -202,9 +204,9 @@ function bp_has_blogs( $args = '' ) {
 	$user_id      = 0;
 	$search_terms = null;
 
-	/* User filtering */
-	if ( !empty( $bp->displayed_user->id ) )
-		$user_id = $bp->displayed_user->id;
+	// User filtering
+	if ( bp_displayed_user_id() )
+		$user_id = bp_displayed_user_id();
 
 	$defaults = array(
 		'type'         => $type,
@@ -212,8 +214,10 @@ function bp_has_blogs( $args = '' ) {
 		'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' => $search_terms // Pass search terms to filter on the blog title or description.
+		'page_arg'     => 'bpage',        // See https://buddypress.trac.wordpress.org/ticket/3679
+
+		'user_id'      => $user_id,       // Pass a user_id to limit to only blogs this user has higher than subscriber access to
+		'search_terms' => $search_terms   // Pass search terms to filter on the blog title or description.
 	);
 
 	$r = wp_parse_args( $args, $defaults );
@@ -227,11 +231,12 @@ function bp_has_blogs( $args = '' ) {
 	}
 
 	if ( $max ) {
-		if ( $per_page > $max )
+		if ( $per_page > $max ) {
 			$per_page = $max;
+		}
 	}
 
-	$blogs_template = new BP_Blogs_Template( $type, $page, $per_page, $max, $user_id, $search_terms );
+	$blogs_template = new BP_Blogs_Template( $type, $page, $per_page, $max, $user_id, $search_terms, $page_arg );
 	return apply_filters( 'bp_has_blogs', $blogs_template->has_blogs(), $blogs_template );
 }
 
@@ -248,7 +253,7 @@ function bp_the_blog() {
 }
 
 function bp_blogs_pagination_count() {
-	global $bp, $blogs_template;
+	global $blogs_template;
 
 	$start_num = intval( ( $blogs_template->pag_page - 1 ) * $blogs_template->pag_num ) + 1;
 	$from_num  = bp_core_number_format( $start_num );
@@ -271,7 +276,7 @@ function bp_blog_avatar( $args = '' ) {
 	echo bp_get_blog_avatar( $args );
 }
 	function bp_get_blog_avatar( $args = '' ) {
-		global $blogs_template, $bp;
+		global $blogs_template;
 
 		$defaults = array(
 			'type'    => 'full',
@@ -279,7 +284,7 @@ function bp_blog_avatar( $args = '' ) {
 			'height'  => false,
 			'class'   => 'avatar',
 			'id'      => false,
-			'alt'     => __( 'Site authored by %s', 'buddypress' ),
+			'alt'     => sprintf( __( 'Profile picture of site author %s', 'buddypress' ), bp_core_get_user_displayname( $blogs_template->blog->admin_user_id ) ),
 			'no_grav' => true
 		);
 
@@ -401,8 +406,7 @@ function bp_blog_signup_enabled() {
 }
 
 function bp_show_blog_signup_form($blogname = '', $blog_title = '', $errors = '') {
-	global $current_user, $current_site;
-	global $bp;
+	global $current_user;
 
 	if ( isset($_POST['submit']) ) {
 		bp_blogs_validate_blog_signup();
@@ -521,7 +525,7 @@ function bp_blogs_subdomain_base() {
 	 */
 	function bp_blogs_get_subdomain_base() {
 		global $current_site;
-		
+
 		return apply_filters( 'bp_blogs_subdomain_base', preg_replace( '|^www\.|', '', $current_site->domain ) . $current_site->path );
 	}
 
@@ -554,7 +558,7 @@ function bp_blogs_validate_blog_signup() {
 	if ( is_subdomain_install() )
 		$domain = $blogname . '.' . preg_replace( '|^www\.|', '', $current_site->domain );
 
-	wpmu_create_blog( $domain, $path, $blog_title, $current_user->id, $meta, $wpdb->siteid );
+	wpmu_create_blog( $domain, $path, $blog_title, $current_user->ID, $meta, $wpdb->siteid );
 	bp_blogs_confirm_blog_signup($domain, $path, $blog_title, $current_user->user_login, $current_user->user_email, $meta);
 	return true;
 }
@@ -581,14 +585,11 @@ function bp_blogs_confirm_blog_signup( $domain, $path, $blog_title, $user_name,
 }
 
 function bp_create_blog_link() {
-	global $bp;
-
 	if ( bp_is_my_profile() )
 		echo apply_filters( 'bp_create_blog_link', '<a href="' . bp_get_root_domain() . '/' . bp_get_blogs_root_slug() . '/create/">' . __( 'Create a Site', 'buddypress' ) . '</a>' );
 }
 
 function bp_blogs_blog_tabs() {
-	global $bp, $groups_template;
 
 	// Don't show these tabs on a user's own profile
 	if ( bp_is_my_profile() )
@@ -607,13 +608,12 @@ function bp_blogs_blog_tabs() {
 }
 
 function bp_directory_blogs_search_form() {
-	global $bp;
 
 	$default_search_value = bp_get_search_default_text();
-	$search_value = !empty( $_REQUEST['s'] ) ? stripslashes( $_REQUEST['s'] ) : $default_search_value; ?>
+	$search_value         = !empty( $_REQUEST['s'] ) ? stripslashes( $_REQUEST['s'] ) : $default_search_value; ?>
 
 	<form action="" method="get" id="search-blogs-form">
-		<label><input type="text" name="s" id="blogs_search" value="<?php echo esc_attr( $search_value ) ?>"  onfocus="if (this.value == '<?php echo $default_search_value ?>') {this.value = '';}" onblur="if (this.value == '') {this.value = '<?php echo $default_search_value ?>';}" /></label>
+		<label><input type="text" name="s" id="blogs_search" placeholder="<?php echo esc_attr( $search_value ) ?>" /></label>
 		<input type="submit" id="blogs_search_submit" name="blogs_search_submit" value="<?php _e( 'Search', 'buddypress' ) ?>" />
 	</form>
 
diff --git a/wp-content/plugins/buddypress/bp-blogs/bp-blogs-widgets.php b/wp-content/plugins/buddypress/bp-blogs/bp-blogs-widgets.php
index 9ff4642d5f304379f9b633e3fad2d11e627189ea..6298d89cbdfac699dad111f03a3823dc47de7785 100644
--- a/wp-content/plugins/buddypress/bp-blogs/bp-blogs-widgets.php
+++ b/wp-content/plugins/buddypress/bp-blogs/bp-blogs-widgets.php
@@ -1,32 +1,31 @@
 <?php
-// Exit if accessed directly
-if ( !defined( 'ABSPATH' ) ) exit;
 
-/***
- * The recent blogs widget is actually just the activity feed filtered on "new_blog_post".
- * Why not make some of your own widgets using a filtered activity stream?
+/**
+ * BuddyPress Blogs Widgets
+ *
+ * @package BuddyPress
+ * @subpackage BlogsWidgets
  */
 
+// Exit if accessed directly
+if ( !defined( 'ABSPATH' ) ) exit;
+
+// @todo not use create_function()
 function bp_blogs_register_widgets() {
-	global $wpdb, $bp;
+	global $wpdb;
 
-	if ( bp_is_active( 'activity' ) && (int)$wpdb->blogid == bp_get_root_blog_id() )
+	if ( bp_is_active( 'activity' ) && (int) $wpdb->blogid == bp_get_root_blog_id() )
 		add_action('widgets_init', create_function('', 'return register_widget("BP_Blogs_Recent_Posts_Widget");') );
 }
 add_action( 'bp_register_widgets', 'bp_blogs_register_widgets' );
 
 class BP_Blogs_Recent_Posts_Widget extends WP_Widget {
 
-	function bp_blogs_recent_posts_widget() {
-		$this->__construct();
-	}
-
 	function __construct() {
 		parent::__construct( false, $name = __( 'Recent Networkwide Posts', 'buddypress' ) );
 	}
 
 	function widget($args, $instance) {
-		global $bp;
 
 		extract( $args );
 
diff --git a/wp-content/plugins/buddypress/bp-core/admin/bp-core-components.php b/wp-content/plugins/buddypress/bp-core/admin/bp-core-components.php
new file mode 100644
index 0000000000000000000000000000000000000000..0bdfa82459b6d73d98cc98eeb0bb85660bdbaba8
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-core/admin/bp-core-components.php
@@ -0,0 +1,300 @@
+<?php
+
+/**
+ * BuddyPress Admin Component Functions
+ *
+ * @package BuddyPress
+ * @subpackage CoreAdministration
+ */
+
+// Exit if accessed directly
+if ( !defined( 'ABSPATH' ) ) exit;
+
+/**
+ * Renders the Component Setup admin panel.
+ *
+ * @package BuddyPress
+ * @since BuddyPress (1.6)
+ * @uses bp_core_admin_component_options()
+ */
+function bp_core_admin_components_settings() {
+?>
+
+	<div class="wrap">
+		<?php screen_icon( 'buddypress'); ?>
+
+		<h2 class="nav-tab-wrapper"><?php bp_core_admin_tabs( __( 'Components', 'buddypress' ) ); ?></h2>
+		<form action="" method="post" id="bp-admin-component-form">
+
+			<?php bp_core_admin_components_options(); ?>
+
+			<p class="submit clear">
+				<input class="button-primary" type="submit" name="bp-admin-component-submit" id="bp-admin-component-submit" value="<?php _e( 'Save Settings', 'buddypress' ) ?>"/>
+			</p>
+
+			<?php wp_nonce_field( 'bp-admin-component-setup' ); ?>
+
+		</form>
+	</div>
+
+<?php
+}
+
+/**
+ * Creates reusable markup for component setup on the Components and Pages dashboard panel.
+ *
+ * This markup has been abstracted so that it can be used both during the setup wizard as well as
+ * when BP has been fully installed.
+ *
+ * @package BuddyPress
+ * @since BuddyPress (1.6)
+ * @todo Use settings API
+ */
+function bp_core_admin_components_options() {
+
+	// Load core functions, if needed
+	if ( !function_exists( 'bp_get_option' ) )
+		require( BP_PLUGIN_DIR . '/bp-core/bp-core-functions.php' );
+
+	// Declare local variables
+	$deactivated_components = array();
+	$required_components    = array();
+	$active_components      = apply_filters( 'bp_active_components', bp_get_option( 'bp-active-components' ) );
+
+	// Optional core components
+	$optional_components = array(
+		'xprofile' => array(
+			'title'       => __( 'Extended Profiles', 'buddypress' ),
+			'description' => __( 'Customize your community with fully editable profile fields that allow your users to describe themselves.', 'buddypress' )
+		),
+		'settings' => array(
+			'title'       => __( 'Account Settings', 'buddypress' ),
+			'description' => __( 'Allow your users to modify their account and notification settings directly from within their profiles.', 'buddypress' )
+		),
+		'friends'  => array(
+			'title'       => __( 'Friend Connections', 'buddypress' ),
+			'description' => __( 'Let your users make connections so they can track the activity of others and focus on the people they care about the most.', 'buddypress' )
+		),
+		'messages' => array(
+			'title'       => __( 'Private Messaging', 'buddypress' ),
+			'description' => __( 'Allow your users to talk to each other directly and in private. Not just limited to one-on-one discussions, messages can be sent between any number of members.', 'buddypress' )
+		),
+		'activity' => array(
+			'title'       => __( 'Activity Streams', 'buddypress' ),
+			'description' => __( 'Global, personal, and group activity streams with threaded commenting, direct posting, favoriting and @mentions, all with full RSS feed and email notification support.', 'buddypress' )
+		),
+		'groups'   => array(
+			'title'       => __( 'User Groups', 'buddypress' ),
+			'description' => __( 'Groups allow your users to organize themselves into specific public, private or hidden sections with separate activity streams and member listings.', 'buddypress' )
+		),
+		'forums'   => array(
+			'title'       => __( 'Discussion Forums', 'buddypress' ),
+			'description' => __( 'Site-wide and Group forums allow for focused, bulletin-board style conversations. Powered by bbPress.', 'buddypress' )
+		),
+		'blogs'    => array(
+			'title'       => __( 'Site Tracking', 'buddypress' ),
+			'description' => __( 'Record activity for new posts and comments from your site.', 'buddypress' )
+		)
+	);
+
+	// Add blogs tracking if multisite
+	if ( is_multisite() ) {
+		$optional_components['blogs']['description'] = __( 'Record activity for new sites, posts, and comments across your network.', 'buddypress' );
+	}
+
+	// Required components
+	$required_components = array(
+		'core' => array(
+			'title'       => __( 'BuddyPress Core', 'buddypress' ),
+			'description' => __( 'It&#8216;s what makes <del>time travel</del> BuddyPress possible!', 'buddypress' )
+		),
+		'members' => array(
+			'title'       => __( 'Community Members', 'buddypress' ),
+			'description' => __( 'Everything in a BuddyPress community revolves around its members.', 'buddypress' )
+		),
+	);
+
+	// Merge optional and required together
+	$all_components = $optional_components + $required_components;
+
+	// If this is an upgrade from before BuddyPress 1.5, we'll have to convert
+	// deactivated components into activated ones.
+	if ( empty( $active_components ) ) {
+		$deactivated_components = bp_get_option( 'bp-deactivated-components' );
+		if ( !empty( $deactivated_components ) ) {
+
+			// Trim off namespace and filename
+			$trimmed = array();
+			foreach ( (array) $deactivated_components as $component => $value ) {
+				$trimmed[] = str_replace( '.php', '', str_replace( 'bp-', '', $component ) );
+			}
+
+			// Loop through the optional components to create an active component array
+			foreach ( (array) $optional_components as $ocomponent => $ovalue ) {
+				if ( !in_array( $ocomponent, $trimmed ) ) {
+					$active_components[$ocomponent] = 1;
+				}
+			}
+		}
+	}
+
+	// On new install, set all components to be active by default
+	if ( empty( $active_components ) && ( bp_get_maintenance_mode() == 'install' ) ) {
+		$active_components = $optional_components;
+	}
+
+	// Core component is always active
+	$active_components['core'] = $all_components['core'];
+	$inactive_components       = array_diff( array_keys( $all_components ) , array_keys( $active_components ) );
+
+	/** Display ***************************************************************/
+
+	// Get the total count of all plugins
+	$all_count = count( $all_components );
+	$page      = bp_core_do_network_admin()  ? 'settings.php' : 'options-general.php';
+	$action    = !empty( $_GET['action'] ) ? $_GET['action'] : 'all';
+	
+	switch( $action ) {
+		case 'all' :
+			$current_components = $all_components;
+			break;
+		case 'active' :
+			foreach ( array_keys( $active_components ) as $component ) {
+				$current_components[$component] = $all_components[$component];
+			}
+			break;
+		case 'inactive' :
+			foreach ( $inactive_components as $component ) {
+				$current_components[$component] = $all_components[$component];
+			}
+			break;
+		case 'mustuse' :
+			$current_components = $required_components;
+			break;
+	}
+	
+	// The setup wizard uses different, more descriptive text
+	if ( bp_get_maintenance_mode() ) : ?>
+
+		<h3><?php _e( 'Available Components', 'buddypress' ); ?></h3>
+
+		<p><?php _e( 'Each component has a unique purpose, and your community may not need each one.', 'buddypress' ); ?></p>
+
+	<?php endif ?>
+		
+		<ul class="subsubsub">
+			<li><a href="<?php echo add_query_arg( array( 'page' => 'bp-components', 'action' => 'all'      ), bp_get_admin_url( $page ) ); ?>" <?php if ( $action === 'all'      ) : ?>class="current"<?php endif; ?>><?php printf( _nx( 'All <span class="count">(%s)</span>',      'All <span class="count">(%s)</span>',      $all_count,         'plugins', 'buddypress' ), number_format_i18n( $all_count                    ) ); ?></a> | </li>
+			<li><a href="<?php echo add_query_arg( array( 'page' => 'bp-components', 'action' => 'active'   ), bp_get_admin_url( $page ) ); ?>" <?php if ( $action === 'active'   ) : ?>class="current"<?php endif; ?>><?php printf( _n(  'Active <span class="count">(%s)</span>',   'Active <span class="count">(%s)</span>',   count( $active_components   ), 'buddypress' ), number_format_i18n( count( $active_components   ) ) ); ?></a> | </li>
+			<li><a href="<?php echo add_query_arg( array( 'page' => 'bp-components', 'action' => 'inactive' ), bp_get_admin_url( $page ) ); ?>" <?php if ( $action === 'inactive' ) : ?>class="current"<?php endif; ?>><?php printf( _n(  'Inactive <span class="count">(%s)</span>', 'Inactive <span class="count">(%s)</span>', count( $inactive_components ), 'buddypress' ), number_format_i18n( count( $inactive_components ) ) ); ?></a> | </li>
+			<li><a href="<?php echo add_query_arg( array( 'page' => 'bp-components', 'action' => 'mustuse'  ), bp_get_admin_url( $page ) ); ?>" <?php if ( $action === 'mustuse'  ) : ?>class="current"<?php endif; ?>><?php printf( _n(  'Must-Use <span class="count">(%s)</span>', 'Must-Use <span class="count">(%s)</span>', count( $required_components ), 'buddypress' ), number_format_i18n( count( $required_components ) ) ); ?></a></li>
+		</ul>
+
+		<table class="widefat fixed plugins" cellspacing="0">
+			<thead>
+				<tr>
+					<th scope="col" id="cb" class="manage-column column-cb check-column">&nbsp;</th>
+					<th scope="col" id="name" class="manage-column column-name" style="width: 190px;"><?php _e( 'Component', 'buddypress' ); ?></th>
+					<th scope="col" id="description" class="manage-column column-description"><?php _e( 'Description', 'buddypress' ); ?></th>
+				</tr>
+			</thead>
+
+			<tfoot>
+				<tr>
+					<th scope="col" class="manage-column column-cb check-column">&nbsp;</th>
+					<th scope="col" class="manage-column column-name" style="width: 190px;"><?php _e( 'Component', 'buddypress' ); ?></th>
+					<th scope="col" class="manage-column column-description"><?php _e( 'Description', 'buddypress' ); ?></th>
+				</tr>
+			</tfoot>
+
+			<tbody id="the-list">
+				
+				<?php if ( !empty( $current_components ) ) : ?>
+
+					<?php foreach ( $current_components as $name => $labels ) : ?>
+
+						<?php if ( !in_array( $name, array( 'core', 'members' ) ) ) :
+							$class = isset( $active_components[esc_attr( $name )] ) ? 'active' : 'inactive';
+						else :
+							$class = 'active';
+						endif; ?>
+
+						<tr id="<?php echo $name; ?>" class="<?php echo $name . ' ' . $class; ?>">
+							<th scope="row">
+
+								<?php if ( !in_array( $name, array( 'core', 'members' ) ) ) : ?>
+
+									<input type="checkbox" id="bp_components[<?php echo esc_attr( $name ); ?>]" name="bp_components[<?php echo esc_attr( $name ); ?>]" value="1"<?php checked( isset( $active_components[esc_attr( $name )] ) ); ?> />
+
+								<?php endif; ?>
+
+								<label class="screen-reader-text" for="bp_components[<?php echo esc_attr( $name ); ?>]"><?php sprintf( __( 'Select %s', 'buddypress' ), esc_html( $labels['title'] ) );  ?></label>
+							</th>
+							<td class="plugin-title" style="width: 190px;">
+								<span></span>
+								<strong><?php echo esc_html( $labels['title'] ); ?></strong>
+								<div class="row-actions-visible">
+									
+								</div>
+							</td>
+
+							<td class="column-description desc">
+								<div class="plugin-description">
+									<p><?php echo $labels['description']; ?></p>
+								</div>
+								<div class="active second plugin-version-author-uri">
+									
+								</div>
+							</td>
+						</tr>
+
+					<?php endforeach ?>
+
+				<?php else : ?>
+						
+					<tr class="no-items">
+						<td class="colspanchange" colspan="3"><?php _e( 'No components found.', 'buddypress' ); ?></td>
+					</tr>
+
+				<?php endif; ?>
+
+			</tbody>
+		</table>
+
+	<input type="hidden" name="bp_components[members]" value="1" />
+
+	<?php
+}
+
+/**
+ * Handle saving the Component settings
+ *
+ * @since BuddyPress (1.6)
+ * @todo Use settings API
+ * @global BuddyPress $bp
+ * @return false On failure
+ */
+function bp_core_admin_components_settings_handler() {
+	global $bp;
+
+	if ( isset( $_POST['bp-admin-component-submit'] ) ) {
+		if ( !check_admin_referer('bp-admin-component-setup') )
+			return false;
+
+		// Settings form submitted, now save the settings. First, set active components
+		if ( isset( $_POST['bp_components'] ) ) {
+			// Save settings and upgrade schema
+			require_once( BP_PLUGIN_DIR . '/bp-core/admin/bp-core-schema.php' );
+			$bp->active_components = stripslashes_deep( $_POST['bp_components'] );
+			bp_core_install( $bp->active_components );
+
+			bp_update_option( 'bp-active-components', $bp->active_components );
+		}
+
+		$base_url = bp_get_admin_url(  add_query_arg( array( 'page' => 'bp-components', 'updated' => 'true' ), 'admin.php' ) );
+
+		wp_redirect( $base_url );
+	}
+}
+add_action( 'admin_init', 'bp_core_admin_components_settings_handler' );
+
+?>
diff --git a/wp-content/plugins/buddypress/bp-core/admin/bp-core-functions.php b/wp-content/plugins/buddypress/bp-core/admin/bp-core-functions.php
new file mode 100644
index 0000000000000000000000000000000000000000..d910050d9c0d8af263c3177c26cb64fdc59c281b
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-core/admin/bp-core-functions.php
@@ -0,0 +1,399 @@
+<?php
+
+/**
+ * BuddyPress Common Admin Functions
+ *
+ * @package BuddyPress
+ * @subpackage CoreAdministration
+ */
+
+// Exit if accessed directly
+if ( !defined( 'ABSPATH' ) ) exit;
+
+/** Menu **********************************************************************/
+
+/**
+ * Initializes the wp-admin area "BuddyPress" menus and sub menus.
+ *
+ * @package BuddyPress Core
+ * @uses bp_current_user_can() returns true if the current user is a site admin, false if not
+ */
+function bp_core_admin_menu_init() {
+	add_action( bp_core_admin_hook(), 'bp_core_add_admin_menu', 9 );
+}
+
+/**
+ * In BP 1.6, the top-level admin menu was removed. For backpat, this function
+ * keeps the top-level menu if a plugin has registered a menu into the old
+ * 'bp-general-settings' menu.
+ *
+ * The old "bp-general-settings" page was renamed "bp-components".
+ *
+ * @global array $_parent_pages
+ * @global array $_registered_pages
+ * @global array $submenu
+ * @since 1.6
+ */
+function bp_core_admin_backpat_menu() {
+	global $_parent_pages, $_registered_pages, $submenu;
+
+	if ( ! is_super_admin() )
+		return;
+
+	// Don't do anything if a BP upgrade is in progress, or if the bp-wizard is in progress.
+	if ( defined( 'BP_IS_UPGRADE' ) && BP_IS_UPGRADE || empty( $submenu['bp-general-settings'] ) )
+		return;
+
+	/**
+	 * By default, only the core "Help" submenu is added under the top-level BuddyPress menu.
+	 * This means that if no third-party plugins have registered their admin pages into the
+	 * 'bp-general-settings' menu, it will only contain one item. Kill it.
+	 */
+	if ( 1 == count( $submenu['bp-general-settings'] ) ) {
+
+		// This removes the top-level menu
+		remove_submenu_page( 'bp-general-settings', 'bp-general-settings' );
+		remove_menu_page( 'bp-general-settings' );
+
+		// These stop people accessing the URL directly
+		unset( $_parent_pages['bp-general-settings'] );
+		unset( $_registered_pages['toplevel_page_bp-general-settings'] );
+	}
+}
+add_action( bp_core_admin_hook(), 'bp_core_admin_backpat_menu', 999 );
+
+/**
+ * Tweak the Settings subnav menu to show only one BuddyPress menu item (Settings > BuddyPress).
+ *
+ * @since 1.6
+ */
+function bp_core_modify_admin_menu() {
+ 	$page  = bp_core_do_network_admin()  ? 'settings.php' : 'options-general.php';
+
+	remove_submenu_page( $page, 'bb-forums-setup' );
+	remove_submenu_page( $page, 'bp-page-settings' );
+	remove_submenu_page( $page, 'bp-settings'     );
+}
+add_action( 'admin_head', 'bp_core_modify_admin_menu', 999 );
+
+/**
+ * This tells WP to highlight the Settings > BuddyPress menu item,
+ * regardless of which actual BuddyPress admin screen we are on.
+ *
+ * The conditional prevents the behaviour when the user is viewing the
+ * backpat "Help" page, the Activity page, or any third-party plugins.
+ *
+ * @global string $plugin_page
+ * @global array $submenu
+ * @since 1.6
+ */
+function bp_core_modify_admin_menu_highlight() {
+	global $plugin_page, $submenu_file;
+
+	// This tweaks the Settings subnav menu to show only one BuddyPress menu item
+	if ( ! in_array( $plugin_page, array( 'bp-activity', 'bp-general-settings', ) ) )
+		$submenu_file = 'bp-components';
+}
+
+/**
+ * Generates markup for a fallback top-level BuddyPress menu page, if the site is running
+ * a legacy plugin which hasn't been updated. If the site is up to date, this page
+ * will never appear.
+ *
+ * @see bp_core_admin_backpat_menu()
+ * @since 1.6
+ * @todo Add convenience links into the markup once new positions are finalised.
+ */
+function bp_core_admin_backpat_page() {
+	$url          = bp_core_do_network_admin() ? network_admin_url( 'settings.php' ) : admin_url( 'options-general.php' );
+	$settings_url = add_query_arg( 'page', 'bp-components', $url ); ?>
+
+	<div class="wrap">
+		<?php screen_icon( 'buddypress'); ?>
+		<h2><?php _e( 'Why have all my BuddyPress menus disappeared?', 'buddypress' ); ?></h2>
+
+		<p><?php _e( "Don't worry! We've moved the BuddyPress options into more convenient and easier to find locations. You're seeing this page because you are running a legacy BuddyPress plugin which has not been updated.", 'buddypress' ); ?></p>
+		<p><?php printf( __( 'Components, Pages, Settings, and Forums, have been moved to <a href="%s">Settings &gt; BuddyPress</a>. Profile Fields has been moved into the <a href="%s">Users</a> menu.', 'buddypress' ), $settings_url, network_admin_url( 'users.php?page=bp-profile-setup' ) ); ?></p>
+	</div>
+
+<?php
+}
+
+/** Notices *******************************************************************/
+
+/**
+ * Print admin messages to admin_notices or network_admin_notices
+ *
+ * BuddyPress combines all its messages into a single notice, to avoid a preponderance of yellow
+ * boxes.
+ *
+ * @package BuddyPress Core
+ * @since BuddyPress (1.5)
+ *
+ * @global BuddyPress $bp The one true BuddyPress instance
+ * @uses bp_current_user_can() to check current user permissions before showing the notices
+ * @uses bp_is_root_blog()
+ */
+function bp_core_print_admin_notices() {
+	global $bp;
+
+	// Only the super admin should see messages
+	if ( !bp_current_user_can( 'bp_moderate' ) )
+		return;
+
+	// On multisite installs, don't show on the Site Admin of a non-root blog, unless
+	// do_network_admin is overridden
+	if ( is_multisite() && bp_core_do_network_admin() && !bp_is_root_blog() )
+		return;
+
+	// Show the messages
+	if ( !empty( $bp->admin->notices ) ) {
+	?>
+		<div id="message" class="updated fade">
+			<?php foreach( $bp->admin->notices as $notice ) : ?>
+				<p><?php echo $notice ?></p>
+			<?php endforeach ?>
+		</div>
+	<?php
+	}
+}
+add_action( 'admin_notices',         'bp_core_print_admin_notices' );
+add_action( 'network_admin_notices', 'bp_core_print_admin_notices' );
+
+/**
+ * Add an admin notice to the BP queue
+ *
+ * Messages added with this function are displayed in BuddyPress's general purpose admin notices
+ * box. It is recommended that you hook this function to admin_init, so that your messages are
+ * loaded in time.
+ *
+ * @package BuddyPress Core
+ * @since BuddyPress (1.5)
+ *
+ * @global BuddyPress $bp The one true BuddyPress instance
+ * @param string $notice The notice you are adding to the queue
+ */
+function bp_core_add_admin_notice( $notice ) {
+	global $bp;
+
+	if ( empty( $bp->admin->notices ) ) {
+		$bp->admin->notices = array();
+	}
+
+	$bp->admin->notices[] = $notice;
+}
+
+/**
+ * Verify that some BP prerequisites are set up properly, and notify the admin if not
+ *
+ * On every Dashboard page, this function checks the following:
+ *   - that pretty permalinks are enabled
+ *   - that a BP-compatible theme is activated
+ *   - that every BP component that needs a WP page for a directory has one
+ *   - that no WP page has multiple BP components associated with it
+ * The administrator will be shown a notice for each check that fails.
+ *
+ * @package BuddyPress Core
+ */
+function bp_core_activation_notice() {
+	global $wp_rewrite, $wpdb, $bp;
+
+	// Only the super admin gets warnings
+	if ( !bp_current_user_can( 'bp_moderate' ) )
+		return;
+
+	// On multisite installs, don't load on a non-root blog, unless do_network_admin is
+	// overridden
+	if ( is_multisite() && bp_core_do_network_admin() && !bp_is_root_blog() )
+		return;
+
+	// Don't show these messages during setup or upgrade
+	if ( !empty( $bp->maintenance_mode ) )
+		return;
+
+	/**
+	 * Check to make sure that the blog setup routine has run. This can't happen during the
+	 * wizard because of the order which the components are loaded. We check for multisite here
+	 * on the off chance that someone has activated the blogs component and then disabled MS
+	 */
+	if ( bp_is_active( 'blogs' ) ) {
+		$count = $wpdb->get_var( "SELECT COUNT(*) FROM {$bp->blogs->table_name}" );
+
+		if ( empty( $count ) ) {
+			bp_blogs_record_existing_blogs();
+		}
+	}
+
+	/**
+	 * Are pretty permalinks enabled?
+	 */
+	if ( isset( $_POST['permalink_structure'] ) )
+		return false;
+
+	if ( empty( $wp_rewrite->permalink_structure ) ) {
+		bp_core_add_admin_notice( sprintf( __( '<strong>BuddyPress is almost ready</strong>. You must <a href="%s">update your permalink structure</a> to something other than the default for it to work.', 'buddypress' ), admin_url( 'options-permalink.php' ) ) );
+	}
+
+	/**
+	 * Are you using a BP-compatible theme?
+	 */
+
+	// Get current theme info
+	$ct = wp_get_theme();
+
+	// Make sure tags is an array to suppress notices
+	if ( ! isset( $ct->tags ) )
+		$ct->tags = array();
+	else
+		$ct->tags = (array) $ct->tags;
+
+	// The best way to remove this notice is to add a "buddypress" tag to
+	// your active theme's CSS header.
+	if ( !defined( 'BP_SILENCE_THEME_NOTICE' ) && !in_array( 'buddypress', $ct->tags ) ) {
+		bp_core_add_admin_notice( sprintf( __( "You'll need to <a href='%s'>activate a <strong>BuddyPress-compatible theme</strong></a> to take advantage of all of BuddyPress's features. We've bundled a default theme, but you can always <a href='%s'>install some other compatible themes</a> or <a href='%s'>update your existing WordPress theme</a>.", 'buddypress' ), admin_url( 'themes.php' ), network_admin_url( 'theme-install.php?type=tag&s=buddypress&tab=search' ), network_admin_url( 'plugin-install.php?type=term&tab=search&s=%22bp-template-pack%22' ) ) );
+	}
+
+	/**
+	 * Check for orphaned BP components (BP component is enabled, no WP page exists)
+	 */
+
+	$orphaned_components = array();
+	$wp_page_components  = array();
+
+	// Only components with 'has_directory' require a WP page to function
+	foreach( $bp->loaded_components as $component_id => $is_active ) {
+		if ( !empty( $bp->{$component_id}->has_directory ) ) {
+			$wp_page_components[] = array(
+				'id'   => $component_id,
+				'name' => isset( $bp->{$component_id}->name ) ? $bp->{$component_id}->name : ucwords( $bp->{$component_id}->id )
+			);
+		}
+	}
+
+	// Activate and Register are special cases. They are not components but they need WP pages.
+	// If user registration is disabled, we can skip this step.
+	if ( bp_get_signup_allowed() ) {
+		$wp_page_components[] = array(
+			'id'   => 'activate',
+			'name' => __( 'Activate', 'buddypress' )
+		);
+
+		$wp_page_components[] = array(
+			'id'   => 'register',
+			'name' => __( 'Register', 'buddypress' )
+		);
+	}
+
+	foreach( $wp_page_components as $component ) {
+		if ( !isset( $bp->pages->{$component['id']} ) ) {
+			$orphaned_components[] = $component['name'];
+		}
+	}
+
+	// Special case: If the Forums component is orphaned, but the bbPress 1.x installation is
+	// not correctly set up, don't show a nag. (In these cases, it's probably the case that the
+	// user is using bbPress 2.x; see https://buddypress.trac.wordpress.org/ticket/4292
+	if ( isset( $bp->forums->name ) && in_array( $bp->forums->name, $orphaned_components ) && !bp_forums_is_installed_correctly() ) {
+		$forum_key = array_search( $bp->forums->name, $orphaned_components );
+		unset( $orphaned_components[$forum_key] );
+		$orphaned_components = array_values( $orphaned_components );
+	}
+
+	if ( !empty( $orphaned_components ) ) {
+		$admin_url = bp_get_admin_url( add_query_arg( array( 'page' => 'bp-page-settings' ), 'admin.php' ) );
+		$notice    = sprintf( __( 'The following active BuddyPress Components do not have associated WordPress Pages: %2$s. <a href="%1$s" class="button-secondary">Repair</a>', 'buddypress' ), $admin_url, '<strong>' . implode( '</strong>, <strong>', $orphaned_components ) . '</strong>' );
+
+		bp_core_add_admin_notice( $notice );
+	}
+
+	/**
+	 * BP components cannot share a single WP page. Check for duplicate assignments, and post
+	 * a message if found.
+	 */
+	$dupe_names = array();
+	$page_ids   = (array)bp_core_get_directory_page_ids();
+	$dupes      = array_diff_assoc( $page_ids, array_unique( $page_ids ) );
+
+	if ( !empty( $dupes ) ) {
+		foreach( $dupes as $dupe_component => $dupe_id ) {
+			$dupe_names[] = $bp->pages->{$dupe_component}->title;
+		}
+
+		// Make sure that there are no duplicate duplicates :)
+		$dupe_names = array_unique( $dupe_names );
+	}
+
+	// If there are duplicates, post a message about them
+	if ( !empty( $dupe_names ) ) {
+		$admin_url = bp_get_admin_url( add_query_arg( array( 'page' => 'bp-page-settings' ), 'admin.php' ) );
+		$notice    = sprintf( __( 'Each BuddyPress Component needs its own WordPress page. The following WordPress Pages have more than one component associated with them: %2$s. <a href="%1$s" class="button-secondary">Repair</a>', 'buddypress' ), $admin_url, '<strong>' . implode( '</strong>, <strong>', $dupe_names ) . '</strong>' );
+
+		bp_core_add_admin_notice( $notice );
+	}
+}
+add_action( 'admin_init', 'bp_core_activation_notice' );
+
+/**
+ * Add an extra update message to the update plugin notification.
+ *
+ * @package BuddyPress Core
+ */
+function bp_core_update_message() {
+	echo '<p style="color: red; margin: 3px 0 0 0; border-top: 1px solid #ddd; padding-top: 3px">' . __( 'IMPORTANT: <a href="http://codex.buddypress.org/buddypress-site-administration/upgrading-buddypress/">Read this before attempting to update BuddyPress</a>', 'buddypress' ) . '</p>';
+}
+add_action( 'in_plugin_update_message-buddypress/bp-loader.php', 'bp_core_update_message' );
+
+/** UI/Styling ****************************************************************/
+
+/**
+ * Output the tabs in the admin area
+ *
+ * @since BuddyPress (1.5)
+ * @param string $active_tab Name of the tab that is active
+ */
+function bp_core_admin_tabs( $active_tab = '' ) {
+
+	// Declare local variables
+	$tabs_html    = '';
+	$idle_class   = 'nav-tab';
+	$active_class = 'nav-tab nav-tab-active';
+
+	// Setup core admin tabs
+	$tabs = array(
+		'0' => array(
+			'href' => bp_get_admin_url( add_query_arg( array( 'page' => 'bp-components'    ), 'admin.php' ) ),
+			'name' => __( 'Components', 'buddypress' )
+		),
+		'1' => array(
+			'href' => bp_get_admin_url( add_query_arg( array( 'page' => 'bp-page-settings' ), 'admin.php' ) ),
+			'name' => __( 'Pages', 'buddypress' )
+		),
+		'2' => array(
+			'href' => bp_get_admin_url( add_query_arg( array( 'page' => 'bp-settings'      ), 'admin.php' ) ),
+			'name' => __( 'Settings',   'buddypress' )
+		)
+	);
+
+	// If forums component is active, add additional tab
+	if ( bp_is_active( 'forums' ) ) {
+		$tabs['3'] = array(
+			'href' => bp_get_admin_url( add_query_arg( array( 'page' => 'bb-forums-setup'  ), 'admin.php' ) ),
+			'name' => __( 'Forums', 'buddypress' )
+		);
+	}
+
+	// Loop through tabs and build navigation
+	foreach( $tabs as $tab_id => $tab_data ) {
+		$is_current = (bool) ( $tab_data['name'] == $active_tab );
+		$tab_class  = $is_current ? $active_class : $idle_class;
+		$tabs_html .= '<a href="' . $tab_data['href'] . '" class="' . $tab_class . '">' . $tab_data['name'] . '</a>';
+	}
+
+	// Output the tabs
+	echo $tabs_html;
+
+	// Do other fun things
+	do_action( 'bp_admin_tabs' );
+}
+
+?>
diff --git a/wp-content/plugins/buddypress/bp-core/admin/bp-core-schema.php b/wp-content/plugins/buddypress/bp-core/admin/bp-core-schema.php
index 484660005daab2fefffa12db32e07dd171fdca87..341c1a7fb300713b373b7db74276a83a1ec921c7 100644
--- a/wp-content/plugins/buddypress/bp-core/admin/bp-core-schema.php
+++ b/wp-content/plugins/buddypress/bp-core/admin/bp-core-schema.php
@@ -1,4 +1,5 @@
 <?php
+
 // Exit if accessed directly
 if ( !defined( 'ABSPATH' ) ) exit;
 
@@ -14,11 +15,44 @@ function bp_core_set_charset() {
 	return '';
 }
 
+function bp_core_install( $active_components = false ) {
+
+	if ( empty( $active_components ) )
+		$active_components = apply_filters( 'bp_active_components', bp_get_option( 'bp-active-components' ) );
+
+	// Core DB Tables
+	bp_core_install_notifications();
+
+	// Activity Streams
+	if ( !empty( $active_components['activity'] ) )
+		bp_core_install_activity_streams();
+
+	// Friend Connections
+	if ( !empty( $active_components['friends'] ) )
+		bp_core_install_friends();
+
+	// Extensible Groups
+	if ( !empty( $active_components['groups'] ) )
+		bp_core_install_groups();
+
+	// Private Messaging
+	if ( !empty( $active_components['messages'] ) )
+		bp_core_install_private_messaging();
+
+	// Extended Profiles
+	if ( !empty( $active_components['xprofile'] ) )
+		bp_core_install_extended_profiles();
+
+	// Blog tracking
+	if ( !empty( $active_components['blogs'] ) )
+		bp_core_install_blog_tracking();
+}
+
 function bp_core_install_notifications() {
-	global $wpdb;
 
+	$sql             = array();
 	$charset_collate = bp_core_set_charset();
-	$bp_prefix = bp_core_get_table_prefix();
+	$bp_prefix       = bp_core_get_table_prefix();
 
 	$sql[] = "CREATE TABLE {$bp_prefix}bp_notifications (
 	  		    id bigint(20) NOT NULL AUTO_INCREMENT PRIMARY KEY,
@@ -38,29 +72,30 @@ function bp_core_install_notifications() {
 			    KEY useritem (user_id,is_new)
 		       ) {$charset_collate};";
 
-	dbDelta($sql);
+	dbDelta( $sql );
 }
 
 function bp_core_install_activity_streams() {
-	global $wpdb;
 
+	$sql             = array();
 	$charset_collate = bp_core_set_charset();
-	$bp_prefix = bp_core_get_table_prefix();
+	$bp_prefix       = bp_core_get_table_prefix();
 
 	$sql[] = "CREATE TABLE {$bp_prefix}bp_activity (
-		  		id bigint(20) NOT NULL AUTO_INCREMENT PRIMARY KEY,
+				id bigint(20) NOT NULL AUTO_INCREMENT PRIMARY KEY,
 				user_id bigint(20) NOT NULL,
 				component varchar(75) NOT NULL,
 				type varchar(75) NOT NULL,
 				action text NOT NULL,
 				content longtext NOT NULL,
-				primary_link varchar(150) NOT NULL,
-				item_id varchar(75) NOT NULL,
-				secondary_item_id varchar(75) DEFAULT NULL,
+				primary_link varchar(255) NOT NULL,
+				item_id bigint(20) NOT NULL,
+				secondary_item_id bigint(20) DEFAULT NULL,
 				date_recorded datetime NOT NULL,
 				hide_sitewide bool DEFAULT 0,
 				mptt_left int(11) NOT NULL DEFAULT 0,
 				mptt_right int(11) NOT NULL DEFAULT 0,
+				is_spam tinyint(1) NOT NULL DEFAULT 0,
 				KEY date_recorded (date_recorded),
 				KEY user_id (user_id),
 				KEY item_id (item_id),
@@ -69,8 +104,9 @@ function bp_core_install_activity_streams() {
 				KEY type (type),
 				KEY mptt_left (mptt_left),
 				KEY mptt_right (mptt_right),
-				KEY hide_sitewide (hide_sitewide)
-		 	   ) {$charset_collate};";
+				KEY hide_sitewide (hide_sitewide),
+				KEY is_spam (is_spam)
+			) {$charset_collate};";
 
 	$sql[] = "CREATE TABLE {$bp_prefix}bp_activity_meta (
 				id bigint(20) NOT NULL AUTO_INCREMENT PRIMARY KEY,
@@ -81,14 +117,14 @@ function bp_core_install_activity_streams() {
 				KEY meta_key (meta_key)
 		   	   ) {$charset_collate};";
 
-	dbDelta($sql);
+	dbDelta( $sql );
 }
 
 function bp_core_install_friends() {
-	global $wpdb;
 
+	$sql             = array();
 	$charset_collate = bp_core_set_charset();
-	$bp_prefix = bp_core_get_table_prefix();
+	$bp_prefix       = bp_core_get_table_prefix();
 
 	$sql[] = "CREATE TABLE {$bp_prefix}bp_friends (
 	  		    id bigint(20) NOT NULL AUTO_INCREMENT PRIMARY KEY,
@@ -101,14 +137,14 @@ function bp_core_install_friends() {
 		        KEY friend_user_id (friend_user_id)
 	 	       ) {$charset_collate};";
 
-	dbDelta($sql);
+	dbDelta( $sql );
 }
 
 function bp_core_install_groups() {
-	global $wpdb;
 
+	$sql             = array();
 	$charset_collate = bp_core_set_charset();
-	$bp_prefix = bp_core_get_table_prefix();
+	$bp_prefix       = bp_core_get_table_prefix();
 
 	$sql[] = "CREATE TABLE {$bp_prefix}bp_groups (
 		  		id bigint(20) NOT NULL AUTO_INCREMENT PRIMARY KEY,
@@ -153,14 +189,14 @@ function bp_core_install_groups() {
 				KEY meta_key (meta_key)
 			   ) {$charset_collate};";
 
-	dbDelta($sql);
+	dbDelta( $sql );
 }
 
 function bp_core_install_private_messaging() {
-	global $wpdb;
 
+	$sql             = array();
 	$charset_collate = bp_core_set_charset();
-	$bp_prefix = bp_core_get_table_prefix();
+	$bp_prefix       = bp_core_get_table_prefix();
 
 	$sql[] = "CREATE TABLE {$bp_prefix}bp_messages_messages (
 		  		id bigint(20) NOT NULL AUTO_INCREMENT PRIMARY KEY,
@@ -196,17 +232,24 @@ function bp_core_install_private_messaging() {
 			    KEY is_active (is_active)
 		 	   ) {$charset_collate};";
 
-	dbDelta($sql);
+	dbDelta( $sql );
 }
 
 function bp_core_install_extended_profiles() {
 	global $wpdb;
 
+	$sql             = array();
 	$charset_collate = bp_core_set_charset();
-	$bp_prefix = bp_core_get_table_prefix();
+	$bp_prefix       = bp_core_get_table_prefix();
 
-	bp_update_option( 'bp-xprofile-base-group-name', _x( 'Base', 'First XProfile group name', 'buddypress' ) );
-	bp_update_option( 'bp-xprofile-fullname-field-name', _x( 'Name', 'XProfile fullname field name', 'buddypress' ) );
+	// These values should only be updated if they are not already present 
+	if ( !$base_group_name = bp_get_option( 'bp-xprofile-base-group-name' ) ) { 
+		bp_update_option( 'bp-xprofile-base-group-name', _x( 'Base', 'First XProfile group name', 'buddypress' ) ); 
+	} 
+
+	if ( !$fullname_field_name = bp_get_option( 'bp-xprofile-fullname-field-name' ) ) { 
+		bp_update_option( 'bp-xprofile-fullname-field-name', _x( 'Name', 'XProfile fullname field name', 'buddypress' ) ); 
+	} 
 
 	$sql[] = "CREATE TABLE {$bp_prefix}bp_xprofile_groups (
 			    id bigint(20) unsigned NOT NULL AUTO_INCREMENT PRIMARY KEY,
@@ -272,10 +315,10 @@ function bp_core_install_extended_profiles() {
 }
 
 function bp_core_install_blog_tracking() {
-	global $wpdb;
 
+	$sql             = array();
 	$charset_collate = bp_core_set_charset();
-	$bp_prefix = bp_core_get_table_prefix();
+	$bp_prefix       = bp_core_get_table_prefix();
 
 	$sql[] = "CREATE TABLE {$bp_prefix}bp_user_blogs (
 	  		    id bigint(20) NOT NULL AUTO_INCREMENT PRIMARY KEY,
@@ -294,7 +337,54 @@ function bp_core_install_blog_tracking() {
 				KEY meta_key (meta_key)
 		       ) {$charset_collate};";
 
-	dbDelta($sql);
+	dbDelta( $sql );
+}
+
+/**
+ * I don't appear to be used anymore, but I'm here anyways. I was originally
+ * used in olden days to update pre-1.1 schemas, but that was before we had
+ * a legitimate update process. Keep me around just incase.
+ *
+ * @global WPDB $wpdb
+ * @global BuddyPress $bp 
+ */
+function bp_update_db_stuff() {
+	global $wpdb, $bp;
+
+	$bp_prefix = bp_core_get_table_prefix();
+
+	// Rename the old user activity cached table if needed.
+	if ( $wpdb->get_var( "SHOW TABLES LIKE '%{$bp_prefix}bp_activity_user_activity_cached%'" ) )
+		$wpdb->query( "RENAME TABLE {$bp_prefix}bp_activity_user_activity_cached TO {$bp->activity->table_name}" );
+
+	// Rename fields from pre BP 1.2
+	if ( $wpdb->get_var( "SHOW TABLES LIKE '%{$bp->activity->table_name}%'" ) ) {
+		if ( $wpdb->get_var( "SHOW COLUMNS FROM {$bp->activity->table_name} LIKE 'component_action'" ) ) {
+			$wpdb->query( "ALTER TABLE {$bp->activity->table_name} CHANGE component_action type varchar(75) NOT NULL" );
+		}
+
+		if ( $wpdb->get_var( "SHOW COLUMNS FROM {$bp->activity->table_name} LIKE 'component_name'" ) ) {
+			$wpdb->query( "ALTER TABLE {$bp->activity->table_name} CHANGE component_name component varchar(75) NOT NULL" );
+		}
+	}
+
+	// On first installation - record all existing blogs in the system.
+	if ( !(int) $bp->site_options['bp-blogs-first-install'] ) {
+		bp_blogs_record_existing_blogs();
+		bp_update_option( 'bp-blogs-first-install', 1 );
+	}
+
+	if ( is_multisite() ) {
+		bp_core_add_illegal_names();
+	}
+
+	// Update and remove the message threads table if it exists
+	if ( $wpdb->get_var( "SHOW TABLES LIKE '%{$bp_prefix}bp_messages_threads%'" ) ) {
+		if ( BP_Messages_Thread::update_tables() ) {
+			$wpdb->query( "DROP TABLE {$bp_prefix}bp_messages_threads" );
+		}
+	}
+
 }
 
 ?>
\ No newline at end of file
diff --git a/wp-content/plugins/buddypress/bp-core/admin/bp-core-settings.php b/wp-content/plugins/buddypress/bp-core/admin/bp-core-settings.php
new file mode 100644
index 0000000000000000000000000000000000000000..c1c81ad80af8cfdeef28448c9db40962cc11b3f9
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-core/admin/bp-core-settings.php
@@ -0,0 +1,368 @@
+<?php
+
+/**
+ * BuddyPress Admin Settings
+ *
+ * @package BuddyPress
+ * @subpackage CoreAdministration
+ */
+
+// Exit if accessed directly
+if ( !defined( 'ABSPATH' ) ) exit;
+
+/**
+ * Main settings section description for the settings page
+ *
+ * @since BuddyPress (1.6)
+ */
+function bp_admin_setting_callback_main_section() { }
+
+/**
+ * Admin bar for logged out users setting field
+ *
+ * @since BuddyPress (1.6)
+ *
+ * @uses bp_form_option() To output the option value
+ */
+function bp_admin_setting_callback_admin_bar() {
+?>
+
+	<input id="hide-loggedout-adminbar" name="hide-loggedout-adminbar" type="checkbox" value="1" <?php checked( !bp_hide_loggedout_adminbar( false ) ); ?> />
+	<label for="hide-loggedout-adminbar"><?php _e( 'Show the Toolbar for logged out users', 'buddypress' ); ?></label>
+
+<?php
+}
+
+/**
+ * Allow members to delete their accounts setting field
+ *
+ * @since BuddyPress (1.6)
+ *
+ * @uses checked() To display the checked attribute
+ */
+function bp_admin_setting_callback_account_deletion() {
+?>
+
+	<input id="bp-disable-account-deletion" name="bp-disable-account-deletion" type="checkbox" value="1" <?php checked( !bp_disable_account_deletion( false ) ); ?> />
+	<label for="bp-disable-account-deletion"><?php _e( 'Allow registered members to delete their own accounts', 'buddypress' ); ?></label>
+
+<?php
+}
+
+/**
+ * If user has upgraded to 1.6 and chose to retain their BuddyBar, offer then a switch to change over
+ * to the WP Toolbar.
+ *
+ * @since BuddyPress (1.6)
+ */
+function bp_admin_setting_callback_force_buddybar() {
+?>
+
+	<input id="_bp_force_buddybar" name="_bp_force_buddybar" type="checkbox" value="1" <?php checked( ! bp_force_buddybar( true ) ); ?> />
+	<label for="_bp_force_buddybar"><?php _e( 'Switch to WordPress Toolbar', 'buddypress' ); ?></label>
+
+<?php
+}
+
+/** Activity *******************************************************************/
+
+/**
+ * Groups settings section description for the settings page
+ *
+ * @since BuddyPress (1.6)
+ */
+function bp_admin_setting_callback_activity_section() { }
+
+/**
+ * Allow Akismet setting field
+ *
+ * @since BuddyPress (1.6)
+ *
+ * @uses checked() To display the checked attribute
+ */
+function bp_admin_setting_callback_activity_akismet() {
+?>
+
+	<input id="_bp_enable_akismet" name="_bp_enable_akismet" type="checkbox" value="1" <?php checked( bp_is_akismet_active( true ) ); ?> />
+	<label for="_bp_enable_akismet"><?php _e( 'Allow Akismet to scan for activity stream spam', 'buddypress' ); ?></label>
+
+<?php
+}
+
+/**
+ * Allow activity comments on blog posts and forum posts
+ *
+ * @since BuddyPress (1.6)
+ */
+function bp_admin_setting_callback_blogforum_comments() {
+?>
+
+	<input id="bp-disable-blogforum-comments" name="bp-disable-blogforum-comments" type="checkbox" value="1" <?php checked( !bp_disable_blogforum_comments( false ) ); ?> />
+	<label for="bp-disable-blogforum-comments"><?php _e( 'Allow activity stream commenting on blog and forum posts', 'buddypress' ); ?></label>
+
+<?php
+}
+
+/**
+ * Sanitization for _bp_force_buddyvar
+ *
+ * If upgraded to 1.6 and you chose to keep the BuddyBar, a checkbox asks if you want to switch to
+ * the WP Toolbar. The option we store is 1 if the BuddyBar is forced on, so we use this function
+ * to flip the boolean before saving the intval.
+ *
+ * @since BuddyPress (1.6)
+ * @access Private
+ */
+function bp_admin_sanitize_callback_force_buddybar( $value = false ) {
+	return $value ? 0 : 1;
+}
+
+/**
+ * Sanitization for bp-disable-blogforum-comments setting
+ *
+ * In the UI, a checkbox asks whether you'd like to *enable* blog/forum activity comments. For
+ * legacy reasons, the option that we store is 1 if these comments are *disabled*. So we use this
+ * function to flip the boolean before saving the intval.
+ *
+ * @since BuddyPress (1.6)
+ */
+function bp_admin_sanitize_callback_blogforum_comments( $value = false ) {
+	return $value ? 0 : 1;
+}
+
+/** XProfile ******************************************************************/
+
+/**
+ * Profile settings section description for the settings page
+ *
+ * @since BuddyPress (1.6)
+ */
+function bp_admin_setting_callback_xprofile_section() { }
+
+/**
+ * Enable BP->WP profile syncing field
+ *
+ * @since BuddyPress (1.6)
+ *
+ * @uses bp_form_option() To output the option value
+ */
+function bp_admin_setting_callback_profile_sync() {
+?>
+
+	<input id="bp-disable-profile-sync" name="bp-disable-profile-sync" type="checkbox" value="1" <?php checked( !bp_disable_profile_sync( false ) ); ?> />
+	<label for="bp-disable-profile-sync"><?php _e( 'Enable BuddyPress to WordPress profile syncing', 'buddypress' ); ?></label>
+
+<?php
+}
+
+/**
+ * Allow members to upload avatars field
+ *
+ * @since BuddyPress (1.6)
+ *
+ * @uses checked() To display the checked attribute
+ */
+function bp_admin_setting_callback_avatar_uploads() {
+?>
+
+	<input id="bp-disable-avatar-uploads" name="bp-disable-avatar-uploads" type="checkbox" value="1" <?php checked( !bp_disable_avatar_uploads( false ) ); ?> />
+	<label for="bp-disable-avatar-uploads"><?php _e( 'Allow registered members to upload avatars', 'buddypress' ); ?></label>
+
+<?php
+}
+
+/** Groups Section ************************************************************/
+
+/**
+ * Groups settings section description for the settings page
+ *
+ * @since BuddyPress (1.6)
+ */
+function bp_admin_setting_callback_groups_section() { }
+
+/**
+ * Allow all users to create groups field
+ *
+ * @since BuddyPress (1.6)
+ *
+ * @uses checked() To display the checked attribute
+ */
+function bp_admin_setting_callback_group_creation() {
+?>
+
+	<input id="bp_restrict_group_creation" name="bp_restrict_group_creation" type="checkbox"value="1" <?php checked( !bp_restrict_group_creation( false ) ); ?> />
+	<label for="bp_restrict_group_creation"><?php _e( 'Enable group creation for all users', 'buddypress' ); ?></label>
+	<p class="description"><?php _e( 'Administrators can always create groups, regardless of this setting.', 'buddypress' ); ?></p>
+
+<?php
+}
+
+/** Forums Section ************************************************************/
+
+/**
+ * Forums settings section description for the settings page
+ *
+ * @since BuddyPress (1.6)
+ */
+function bp_admin_setting_callback_bbpress_section() { }
+
+/**
+ * bb-config.php location field
+ *
+ * @since BuddyPress (1.6)
+ * @uses checked() To display the checked attribute
+ * @uses bp_get_option() To get the config location
+ * @uses bp_form_option() To get the sanitized form option
+ */
+function bp_admin_setting_callback_bbpress_configuration() {
+
+	$config_location = bp_get_option( 'bb-config-location' );
+	$file_exists     = (bool) ( file_exists( $config_location ) || is_file( $config_location ) ); ?>
+
+	<input name="bb-config-location" type="text" id="bb-config-location" value="<?php bp_form_option( 'bb-config-location', '' ); ?>" class="medium-text" style="width: 300px;" />
+
+	<?php if ( false === $file_exists ) : ?>
+
+		<a class="button" href="<?php bp_admin_url( 'admin.php?page=bb-forums-setup&repair=1' ); ?>" title="<?php _e( 'Attempt to save a new config file.', 'buddypress' ); ?>"><?php _e( 'Repair', 'buddypress' ) ?></a>
+		<span class="attention"><?php _e( 'File does not exist', 'buddypress' ); ?></span>
+
+	<?php endif; ?>
+
+	<p class="description"><?php _e( 'Absolute path to your bbPress configuration file.', 'buddypress' ); ?></p>
+
+<?php
+}
+
+/** Settings Page *************************************************************/
+
+/**
+ * The main settings page
+ *
+ * @since BuddyPress (1.6)
+ *
+ * @uses screen_icon() To display the screen icon
+ * @uses settings_fields() To output the hidden fields for the form
+ * @uses do_settings_sections() To output the settings sections
+ */
+function bp_core_admin_settings() {
+
+	// We're saving our own options, until the WP Settings API is updated to work with Multisite
+	$form_action = add_query_arg( 'page', 'bp-settings', bp_core_do_network_admin() ? network_admin_url( 'admin.php' ) : admin_url( 'admin.php' ) );
+
+	?>
+
+	<div class="wrap">
+
+		<?php screen_icon( 'buddypress' ); ?>
+
+		<h2 class="nav-tab-wrapper"><?php bp_core_admin_tabs( __( 'Settings', 'buddypress' ) ); ?></h2>
+
+		<form action="<?php echo $form_action ?>" method="post">
+
+			<?php settings_fields( 'buddypress' ); ?>
+
+			<?php do_settings_sections( 'buddypress' ); ?>
+
+			<p class="submit">
+				<input type="submit" name="submit" class="button-primary" value="<?php _e( 'Save Changes', 'buddypress' ); ?>" />
+			</p>
+		</form>
+	</div>
+
+<?php
+}
+
+/**
+ * Save our settings
+ *
+ * @since BuddyPress (1.6)
+ */
+function bp_core_admin_settings_save() {
+	global $wp_settings_fields;
+
+	if ( isset( $_GET['page'] ) && 'bp-settings' == $_GET['page'] && !empty( $_POST['submit'] ) ) {
+		check_admin_referer( 'buddypress-options' );
+
+		// Because many settings are saved with checkboxes, and thus will have no values
+		// in the $_POST array when unchecked, we loop through the registered settings
+		if ( isset( $wp_settings_fields['buddypress'] ) ) {
+			foreach( (array) $wp_settings_fields['buddypress'] as $section => $settings ) {
+				foreach( $settings as $setting_name => $setting ) {
+					$value = isset( $_POST[$setting_name] ) ? $_POST[$setting_name] : '';
+
+					bp_update_option( $setting_name, $value );
+				}
+			}
+		}
+
+		// Some legacy options are not registered with the Settings API
+		$legacy_options = array(
+			'bp-disable-account-deletion',
+			'bp-disable-avatar-uploads',
+			'bp_disable_blogforum_comments',
+			'bp-disable-profile-sync',
+			'bp_restrict_group_creation',
+			'hide-loggedout-adminbar',
+		);
+
+		foreach( $legacy_options as $legacy_option ) {
+			// Note: Each of these options is represented by its opposite in the UI
+			// Ie, the Profile Syncing option reads "Enable Sync", so when it's checked,
+			// the corresponding option should be unset
+			$value = isset( $_POST[$legacy_option] ) ? '' : 1;
+			bp_update_option( $legacy_option, $value );
+		}
+
+		bp_core_redirect( add_query_arg( 'page', 'bp-settings', bp_core_do_network_admin() ? network_admin_url( 'admin.php' ) : admin_url( 'admin.php' ) ) );
+	}
+}
+add_action( 'bp_admin_init', 'bp_core_admin_settings_save', 100 );
+
+/**
+ * Output settings API option
+ *
+ * @since BuddyPress (1.6)
+ *
+ * @uses bp_get_bp_form_option()
+ *
+ * @param string $option
+ * @param string $default
+ * @param bool $slug
+ */
+function bp_form_option( $option, $default = '' , $slug = false ) {
+	echo bp_get_form_option( $option, $default, $slug );
+}
+	/**
+	 * Return settings API option
+	 *
+	 * @since BuddyPress (1.6)
+	 *
+	 * @uses bp_get_option()
+	 * @uses esc_attr()
+	 * @uses apply_filters()
+	 *
+	 * @param string $option
+	 * @param string $default
+	 * @param bool $slug
+	 */
+	function bp_get_form_option( $option, $default = '', $slug = false ) {
+
+		// Get the option and sanitize it
+		$value = bp_get_option( $option, $default );
+
+		// Slug?
+		if ( true === $slug )
+			$value = esc_attr( apply_filters( 'editable_slug', $value ) );
+
+		// Not a slug
+		else
+			$value = esc_attr( $value );
+
+		// Fallback to default
+		if ( empty( $value ) )
+			$value = $default;
+
+		// Allow plugins to further filter the output
+		return apply_filters( 'bp_get_form_option', $value, $option );
+	}
+?>
diff --git a/wp-content/plugins/buddypress/bp-core/admin/bp-core-slugs.php b/wp-content/plugins/buddypress/bp-core/admin/bp-core-slugs.php
new file mode 100644
index 0000000000000000000000000000000000000000..27e9b42c7d3bdecc07bbb7d1d76e2cbf6927c929
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-core/admin/bp-core-slugs.php
@@ -0,0 +1,224 @@
+<?php
+
+/**
+ * BuddyPress Admin Slug Functions
+ *
+ * @package BuddyPress
+ * @subpackage CoreAdministration
+ */
+
+// Exit if accessed directly
+if ( !defined( 'ABSPATH' ) ) exit;
+
+/**
+ * Renders the page mapping admin panel.
+ *
+ * @since BuddyPress (1.6)
+ * @todo Use settings API
+ * @uses bp_core_admin_component_options()
+ */
+function bp_core_admin_slugs_settings() {
+?>
+
+	<div class="wrap">
+		<?php screen_icon( 'buddypress'); ?>
+
+		<h2 class="nav-tab-wrapper"><?php bp_core_admin_tabs( __( 'Pages', 'buddypress' ) ); ?></h2>
+		<form action="" method="post" id="bp-admin-page-form">
+
+			<?php bp_core_admin_slugs_options(); ?>
+
+			<p class="submit clear">
+				<input class="button-primary" type="submit" name="bp-admin-pages-submit" id="bp-admin-pages-submit" value="<?php _e( 'Save All', 'buddypress' ) ?>"/>
+			</p>
+
+			<?php wp_nonce_field( 'bp-admin-pages-setup' ); ?>
+
+		</form>
+	</div>
+
+<?php
+}
+
+/**
+ * Creates reusable markup for page setup on the Components and Pages dashboard panel.
+ *
+ * This markup has been abstracted so that it can be used both during the setup wizard as well as
+ * when BP has been fully installed.
+ *
+ * @package BuddyPress
+ * @since BuddyPress (1.6)
+ * @todo Use settings API
+ */
+function bp_core_admin_slugs_options() {
+	global $bp;
+
+	// Get the existing WP pages
+	$existing_pages = bp_core_get_directory_page_ids();
+
+	// Set up an array of components (along with component names) that have
+	// directory pages.
+	$directory_pages = array();
+
+	// Loop through loaded components and collect directories
+	if ( is_array( $bp->loaded_components ) ) {
+		foreach( $bp->loaded_components as $component_slug => $component_id ) {
+
+			// Only components that need directories should be listed here
+			if ( isset( $bp->{$component_id} ) && !empty( $bp->{$component_id}->has_directory ) ) {
+
+				// component->name was introduced in BP 1.5, so we must provide a fallback
+				$directory_pages[$component_id] = !empty( $bp->{$component_id}->name ) ? $bp->{$component_id}->name : ucwords( $component_id );
+			}
+		}
+	}
+
+	/** Directory Display *****************************************************/
+
+	$directory_pages = apply_filters( 'bp_directory_pages', $directory_pages );
+
+	if ( !empty( $directory_pages ) ) : ?>
+
+		<h3><?php _e( 'Directories', 'buddypress' ); ?></h3>
+
+		<p><?php _e( 'Associate a WordPress Page with each BuddyPress component directory.', 'buddypress' ); ?></p>
+
+		<table class="form-table">
+			<tbody>
+
+				<?php foreach ( $directory_pages as $name => $label ) : ?>
+
+					<tr valign="top">
+						<th scope="row">
+							<label for="bp_pages[<?php echo esc_attr( $name ) ?>]"><?php echo esc_html( $label ) ?></label>
+						</th>
+
+						<td>
+							<?php if ( !bp_is_root_blog() )
+								switch_to_blog( bp_get_root_blog_id() ) ?>
+
+							<?php echo wp_dropdown_pages( array(
+								'name'             => 'bp_pages[' . esc_attr( $name ) . ']',
+								'echo'             => false,
+								'show_option_none' => __( '- None -', 'buddypress' ),
+								'selected'         => !empty( $existing_pages[$name] ) ? $existing_pages[$name] : false
+							) ); ?>
+
+							<a href="<?php echo admin_url( add_query_arg( array( 'post_type' => 'page' ), 'post-new.php' ) ); ?>" class="button-secondary"><?php _e( 'New Page', 'buddypress' ); ?></a>
+							<input class="button-primary" type="submit" name="bp-admin-pages-single" value="<?php _e( 'Save', 'buddypress' ) ?>" />
+
+							<?php if ( !empty( $existing_pages[$name] ) ) : ?>
+
+								<a href="<?php echo get_permalink( $existing_pages[$name] ); ?>" class="button-secondary" target="_bp"><?php _e( 'View', 'buddypress' ); ?></a>
+
+							<?php endif; ?>
+
+							<?php if ( !bp_is_root_blog() )
+								restore_current_blog() ?>
+
+						</td>
+					</tr>
+
+
+				<?php endforeach ?>
+
+				<?php do_action( 'bp_active_external_directories' ); ?>
+
+			</tbody>
+		</table>
+
+	<?php
+
+	endif;
+
+	/** Static Display ********************************************************/
+
+	// Static pages
+	$static_pages = array(
+		'register' => __( 'Register', 'buddypress' ),
+		'activate' => __( 'Activate', 'buddypress' ),
+	);
+	
+	$static_pages = apply_filters( 'bp_static_pages', $static_pages );
+	
+	if ( !empty( $static_pages ) ) : ?>
+
+		<h3><?php _e( 'Registration', 'buddypress' ); ?></h3>
+
+		<p><?php _e( 'Associate WordPress Pages with the following BuddyPress Registration pages.', 'buddypress' ); ?></p>
+
+		<table class="form-table">
+			<tbody>
+
+				<?php foreach ( $static_pages as $name => $label ) : ?>
+
+					<tr valign="top">
+						<th scope="row">
+							<label for="bp_pages[<?php echo esc_attr( $name ) ?>]"><?php echo esc_html( $label ) ?></label>
+						</th>
+
+						<td>
+							<?php echo wp_dropdown_pages( array(
+								'name'             => 'bp_pages[' . esc_attr( $name ) . ']',
+								'echo'             => false,
+								'show_option_none' => __( '- None -', 'buddypress' ),
+								'selected'         => !empty( $existing_pages[$name] ) ? $existing_pages[$name] : false
+							) ) ?>
+
+							<a href="<?php echo admin_url( add_query_arg( array( 'post_type' => 'page' ), 'post-new.php' ) ); ?>" class="button-secondary"><?php _e( 'New Page', 'buddypress' ); ?></a>
+							<input class="button-primary" type="submit" name="bp-admin-pages-single" value="<?php _e( 'Save', 'buddypress' ) ?>" />
+
+							<?php if ( !empty( $existing_pages[$name] ) ) : ?>
+
+								<a href="<?php echo get_permalink( $existing_pages[$name] ); ?>" class="button-secondary" target="_bp"><?php _e( 'View', 'buddypress' ); ?></a>
+
+							<?php endif; ?>
+
+						</td>
+					</tr>
+
+				<?php endforeach ?>
+
+				<?php do_action( 'bp_active_external_pages' ); ?>
+
+			</tbody>
+		</table>
+
+		<?php
+	endif;
+}
+
+/**
+ * Handle saving of the BuddyPress slugs
+ *
+ * @since BuddyPress (1.6)
+ * @todo Use settings API
+ * @return False if referer does not check out
+ */
+function bp_core_admin_slugs_setup_handler() {
+
+	if ( isset( $_POST['bp-admin-pages-submit'] ) || isset( $_POST['bp-admin-pages-single'] ) ) {
+		if ( !check_admin_referer( 'bp-admin-pages-setup' ) )
+			return false;
+
+		// Then, update the directory pages
+		if ( isset( $_POST['bp_pages'] ) ) {
+
+			$directory_pages = array();
+
+			foreach ( (array) $_POST['bp_pages'] as $key => $value ) {
+				if ( !empty( $value ) ) {
+					$directory_pages[$key] = (int) $value;
+				}
+			}
+			bp_core_update_directory_page_ids( $directory_pages );
+		}
+
+		$base_url = bp_get_admin_url( add_query_arg( array( 'page' => 'bp-page-settings', 'updated' => 'true' ), 'admin.php' ) );
+
+		wp_redirect( $base_url );
+	}
+}
+add_action( 'admin_init', 'bp_core_admin_slugs_setup_handler' );
+
+?>
diff --git a/wp-content/plugins/buddypress/bp-core/admin/bp-core-update.php b/wp-content/plugins/buddypress/bp-core/admin/bp-core-update.php
index 2549f3c6e72538ac5cb2e4f96c12f5030f1e2ad8..1f34d1e0b06a6b398e1231e30f322a4cf4a4a5ca 100644
--- a/wp-content/plugins/buddypress/bp-core/admin/bp-core-update.php
+++ b/wp-content/plugins/buddypress/bp-core/admin/bp-core-update.php
@@ -1,44 +1,28 @@
 <?php
+
 // Exit if accessed directly
 if ( !defined( 'ABSPATH' ) ) exit;
 
 class BP_Core_Setup_Wizard {
+
+	/**
+	 * @var int The current step of the updater
+	 */
 	var $current_step;
-	var $steps;
 
-	var $database_version;
-	var $is_network_activate;
-	var $new_version;
-	var $setup_type;
+	/**
+	 *
+	 * @var array The total steps to be completed
+	 */
+	var $steps;
 
-	function bp_core_setup_wizard() {
-		$this->__construct();
-	}
+	/** Methods ***************************************************************/
 
 	function __construct() {
-		global $bp;
 
-		// Ensure that we have access to some utility functions. Must use require_once()
-		// because BP Core is loaded during incremental upgrades
-		require_once( BP_PLUGIN_DIR . '/bp-core/bp-core-functions.php' );
-
-		// Get current DB version
-		$this->database_version = !empty( $bp->database_version ) ? (int) $bp->database_version : 0;
-
-		if ( !empty( $bp->is_network_activate ) ) {
-			$this->is_network_activate = $bp->is_network_activate;
-
-		} elseif ( !$this->current_step() ) {
-			setcookie( 'bp-wizard-step', 0, time() + 60 * 60 * 24, COOKIEPATH );
-			$_COOKIE['bp-wizard-step'] = 0;
-		}
-
-		$this->new_version  = constant( 'BP_DB_VERSION' );
-		$this->setup_type   = !empty( $bp->maintenance_mode ) ? $bp->maintenance_mode : '';
-		$this->current_step = $this->current_step();
-
-		// Remove the admin menu while we update/install
-		remove_action( bp_core_admin_hook(), 'bp_core_add_admin_menu', 9 );
+		// Set/reset the wizard cookie
+		setcookie( 'bp-wizard-step', 0, time() + 60 * 60 * 24, COOKIEPATH );
+		$_COOKIE['bp-wizard-step'] = 0;
 
 		// Call the save method that will save data and modify $current_step
 		if ( isset( $_POST['save'] ) )
@@ -50,24 +34,25 @@ class BP_Core_Setup_Wizard {
 
 	function current_step() {
 		if ( isset( $_POST['step'] ) ) {
-			$current_step = (int)$_POST['step'] + 1;
+			$current_step = (int) $_POST['step'] + 1;
 		} else {
-			if ( !empty( $_COOKIE['bp-wizard-step'] ) )
+			if ( !empty( $_COOKIE['bp-wizard-step'] ) ) {
 				$current_step = $_COOKIE['bp-wizard-step'];
-			else
+			} else {
 				$current_step = 0;
+			}
 		}
 
 		return $current_step;
 	}
 
 	function add_steps() {
-		global $wp_rewrite;
 
 		// Setup wizard steps
 		$steps = array();
 
-		if ( 'install' == $this->setup_type ) {
+		// This is a first time installation
+		if ( bp_get_maintenance_mode() == 'install' ) {
 			$steps = array(
 				__( 'Components', 'buddypress' ),
 				__( 'Pages',      'buddypress' ),
@@ -76,19 +61,22 @@ class BP_Core_Setup_Wizard {
 				__( 'Finish',     'buddypress' )
 			);
 
-		// Update wizard steps
+		// This is an update to an existing install
 		} else {
-			if ( $this->is_network_activate )
-				$steps[] = __( 'Multisite Update', 'buddypress' );
-
-			if ( $this->database_version < (int) $this->new_version )
-				$steps[] = __( 'Database Update', 'buddypress' );
 
-			if ( $this->database_version < 1801 || !bp_core_get_directory_page_ids() ) {
+			// New for BP 1.5
+			if ( bp_get_db_version_raw() < 1801 || !bp_core_get_directory_page_ids() ) {
 				$steps[] = __( 'Components', 'buddypress' );
-				$steps[] = __( 'Pages', 'buddypress' );
+				$steps[] = __( 'Pages',      'buddypress' );
 			}
 
+			// New for BP 1.6
+			if ( bp_get_db_version_raw() < 5222 && !defined( 'BP_USE_WP_ADMIN_BAR' ) )
+				$steps[] = __( 'Toolbar', 'buddypress' );
+
+			if ( bp_get_db_version_raw() < (int) bp_get_db_version() )
+				$steps[] = __( 'Database Update', 'buddypress' );
+
 			$steps[] = __( 'Finish', 'buddypress' );
 		}
 
@@ -97,56 +85,58 @@ class BP_Core_Setup_Wizard {
 
 	function save( $step_name ) {
 
+		// Bail if user is not capable of being here
+		if ( ! bp_current_user_can( 'activate_plugins' ) )
+			wp_die( 'Uh... No.' );
+
 		// Save any posted values
 		switch ( $step_name ) {
-			case 'db_update': default:
+			case 'db_update':
 				$result = $this->step_db_update_save();
 				break;
 
-			case 'ms_update': default:
-				$result = $this->step_ms_update_save();
-				break;
-
-			case 'ms_pages': default:
-				$result = $this->step_ms_update_save();
-				break;
-
-			case 'components': default:
+			case 'components':
 				$result = $this->step_components_save();
 				break;
 
-			case 'pages': default:
+			case 'pages':
 				$result = $this->step_pages_save();
 				break;
 
-			case 'permalinks': default:
+			case 'permalinks':
 				$result = $this->step_permalinks_save();
 				break;
 
-			case 'theme': default:
+			case 'theme':
 				$result = $this->step_theme_save();
 				break;
 
-			case 'finish': default:
+			case 'admin_bar':
+				$result = $this->step_admin_bar_save();
+				break;
+
+			case 'finish':
+			default:
 				$result = $this->step_finish_save();
 				break;
 		}
 
-		if ( !$result && $this->current_step )
-			$this->current_step--;
-
 		if ( 'finish' != $step_name )
-			setcookie( 'bp-wizard-step', (int)$this->current_step, time() + 60 * 60 * 24, COOKIEPATH );
+			setcookie( 'bp-wizard-step', (int) $this->current_step(), time() + 60 * 60 * 24, COOKIEPATH );
 	}
 
 	function html() {
 
+		// Bail if user is not capable of being here
+		if ( ! bp_current_user_can( 'activate_plugins' ) )
+			wp_die( 'You do not have sufficient permissions to access this page.' );
+
 		// Update or Setup
-		$type = ( 'update' == $this->setup_type ) ? __( 'Update', 'buddypress' ) : __( 'Setup', 'buddypress' );
+		$type = ( 'update' == bp_get_maintenance_mode() ) ? __( 'Update', 'buddypress' ) : __( 'Setup', 'buddypress' );
 
 		?>
 
-		<div class="wrap" id="bp-admin">
+		<div class="wrap" id="bp-wizard">
 
 			<?php screen_icon( 'buddypress' ); ?>
 
@@ -156,18 +146,18 @@ class BP_Core_Setup_Wizard {
 				do_action( 'bp_admin_notices' );
 
 				$step_count  = count( $this->steps ) - 1;
-				$wiz_or_set  = $this->current_step >= $step_count ? 'bp-general-settings' : 'bp-wizard';
-				$form_action = bp_core_update_do_network_admin() ? network_admin_url( add_query_arg( array( 'page' => $wiz_or_set ), 'admin.php' ) ) : admin_url( add_query_arg( array( 'page' => $wiz_or_set ), 'admin.php' ) );
+				$wiz_or_set  = $this->current_step() >= $step_count ? 'bp-components' : 'bp-wizard';
+				$form_action = bp_core_do_network_admin() ? network_admin_url( add_query_arg( array( 'page' => $wiz_or_set ), 'admin.php' ) ) : admin_url( add_query_arg( array( 'page' => $wiz_or_set ), 'index.php' ) );
 			?>
 
-			<form action="<?php echo $form_action; ?>" method="post" id="bp-admin-form">
-				<div id="bp-admin-nav">
+			<form action="<?php echo $form_action; ?>" method="post" id="bp-wizard-form">
+				<div id="bp-wizard-nav">
 					<ol>
 
-						<?php foreach( (array)$this->steps as $i => $name ) : ?>
+						<?php foreach( (array) $this->steps as $i => $name ) : ?>
 
-							<li<?php if ( $this->current_step == $i ) : ?> class="current"<?php endif; ?>>
-								<?php if ( $this->current_step > $i ) : ?>
+							<li<?php if ( $this->current_step() == $i ) : ?> class="current"<?php endif; ?>>
+								<?php if ( $this->current_step() > $i ) : ?>
 
 									<span class="complete">&nbsp;</span>
 
@@ -185,7 +175,7 @@ class BP_Core_Setup_Wizard {
 
 					</ol>
 
-					<?php if ( __( 'Finish', 'buddypress' ) == $this->steps[$this->current_step] ) : ?>
+					<?php if ( __( 'Finish', 'buddypress' ) == $this->steps[$this->current_step()] ) : ?>
 
 						<div class="prev-next submit clear">
 							<input type="submit" value="<?php _e( 'Finish &amp; Activate', 'buddypress' ); ?>" name="submit" />
@@ -201,21 +191,13 @@ class BP_Core_Setup_Wizard {
 
 				</div>
 
-				<div id="bp-admin-content">
+				<div id="bp-wizard-content">
 
-					<?php switch ( $this->steps[$this->current_step] ) {
+					<?php switch ( $this->steps[$this->current_step()] ) {
 						case __( 'Database Update', 'buddypress') :
 							$this->step_db_update();
 							break;
 
-						case __( 'Multisite Update', 'buddypress') :
-							$this->step_ms_update();
-							break;
-
-						case __( 'Site Directory', 'buddypress') :
-							$this->step_ms_update();
-							break;
-
 						case __( 'Components', 'buddypress') :
 							$this->step_components();
 							break;
@@ -232,10 +214,13 @@ class BP_Core_Setup_Wizard {
 							$this->step_theme();
 							break;
 
+						case __( 'Toolbar', 'buddypress' ) :
+							$this->step_admin_bar();
+							break;
+
 						case __( 'Finish', 'buddypress') :
 							$this->step_finish();
 							break;
-
 					} ?>
 
 				</div>
@@ -248,14 +233,13 @@ class BP_Core_Setup_Wizard {
 	/** Screen methods ********************************************************/
 
 	function step_db_update() {
-		if ( !current_user_can( 'activate_plugins' ) )
-			return false; ?>
+	?>
 
-		<p><?php _e( 'Before you can continue using BuddyPress, a few minor adjustments need to be made. These changes are not destructive and will not remove or change any existing settings.', 'buddypress' ); ?></p>
+		<p><?php _e( 'To complete the update, a few changes need to be made to your database. These changes are not destructive and will not remove or change any existing settings.', 'buddypress' ); ?></p>
 
 		<div class="submit clear">
 			<input type="hidden" name="save" value="db_update" />
-			<input type="hidden" name="step" value="<?php echo esc_attr( $this->current_step ); ?>" />
+			<input type="hidden" name="step" value="<?php echo esc_attr( $this->current_step() ); ?>" />
 
 			<?php wp_nonce_field( 'bpwizard_db_update' ) ?>
 
@@ -264,104 +248,18 @@ class BP_Core_Setup_Wizard {
 	<?php
 	}
 
-	function step_ms_update() {
-		global $wpdb;
-
-		// Make sure that page info is pulled from bp_get_root_blog_id() (except when in
-		// multisite mode)
-		if ( !empty( $wpdb->blogid ) && ( $wpdb->blogid != bp_get_root_blog_id() ) && ( !defined( 'BP_ENABLE_MULTIBLOG' ) ) )
-			switch_to_blog( bp_get_root_blog_id() );
-
-		if ( !current_user_can( 'activate_plugins' ) )
-			return false;
-
-		$active_components = bp_get_option( 'bp-active-components' );
-
-		if ( defined( 'BP_BLOGS_SLUG' ) )
-			$blogs_slug = constant( 'BP_BLOGS_SLUG' );
-		else
-			$blogs_slug = 'blogs';
-
- 		// Call up old bp-pages to see if a page has been previously linked to Blogs
-		$existing_pages = bp_get_option( 'bp-pages' );
-
-		if ( !empty( $existing_pages['blogs'] ) )
-			$existing_blog_page = '&selected=' . $existing_pages['blogs'];
-		else
-			$existing_blog_page = '';
-		?>
-
-		<script type="text/javascript">
-			jQuery( document ).ready( function() {
-				jQuery( 'select' ).change( function() {
-					jQuery( this ).siblings( 'input[@type=radio]' ).click();
-				});
-			});
-		</script>
-
-		<p><?php printf( __( 'BuddyPress has detected a recent change to WordPress Multisite, which allows members of your community to have their own WordPress sites. You can enable or disable this feature at any time at <a href="%s">Network Options</a>.', 'buddypress' ), network_admin_url( 'settings.php' ) ); ?></p>
-
-		<p><?php __( "Please select the WordPress page you would like to use to display the site directory. You can either choose an existing page or let BuddyPress auto-create a page for you. If you'd like, you can go to manually create pages now, and return to this step when you are finished.", 'buddypress' ) ?></p>
-
-		<p><strong><?php _e( 'Please Note:', 'buddypress' ) ?></strong> <?php _e( "If you have manually added BuddyPress navigation links in your theme you may need to remove these from your header.php to avoid duplicate links.", 'buddypress' ) ?></p>
-
-		<p><?php _e( 'Would you like to enable site tracking, which tracks blog posts and comments from across your network?', 'buddypress' ); ?></p>
-
-		<table class="form-table">
-
-			<tr valign="top">
-				<th scope="row"><?php _e( "Enable Site Tracking?", 'buddypress' ) ?></th>
-
-				<td>
-					<label for="bp_components[blogs]">
-						<input id="site-tracking-enabled" type="checkbox" id="bp_components[blogs]" name="bp_components[blogs]" value="1"<?php checked( isset( $active_components['blogs'] ) ); ?> />
-
-						<?php _e( "Track new sites, new posts and new comments across your entire network.", 'buddypress' ) ?>
-
-					</label>
-
-				</td>
-			</tr>
-
-			<tr valign="top" id="site-tracking-page-selector">
-				<th scope="row"><?php _e( 'Select a WordPress page for the Sites directory.', 'buddypress' ); ?></th>
-
-				<td>
-					<p><input type="radio" name="bp_pages[blogs]" checked="checked" value="<?php echo $blogs_slug; ?>" /> <?php _e( 'Automatically create a page at:', 'buddypress' ); ?> <?php echo site_url( $blogs_slug ); ?>/</p>
-					<p><input type="radio" name="bp_pages[blogs]" value="page" /> <?php _e( 'Use an existing page:', 'buddypress' ); ?> <?php echo wp_dropdown_pages( "name=bp-blogs-page&echo=0&show_option_none=" . __( '- Select -', 'buddypress' ) . $existing_blog_page ); ?></p>
-				</td>
-			</tr>
-
-		</table>
-
-
-		<div class="submit clear">
-			<input type="hidden" name="save" value="ms_update" />
-			<input type="hidden" name="step" value="<?php echo esc_attr( $this->current_step ); ?>" />
-
-			<?php wp_nonce_field( 'bpwizard_ms_update' ); ?>
-
-		</div>
-
-		<?php
-
-		restore_current_blog();
-	}
-
 	function step_components() {
-		if ( !current_user_can( 'activate_plugins' ) )
-			return false;
 
-		if ( !function_exists( 'bp_core_admin_component_options' ) )
-			require ( WP_PLUGIN_DIR . '/buddypress/bp-core/admin/bp-core-admin.php' ); ?>
+		if ( !function_exists( 'bp_core_admin_components_options' ) )
+			require ( BP_PLUGIN_DIR . 'bp-core/admin/bp-core-components.php' ); ?>
 
 		<p><?php _e( "BuddyPress bundles several individual social components together, each one adding a distinct feature. This first step decides which features are enabled on your site; all features are enabled by default. Don't worry, you can change your mind at any point in the future.", 'buddypress' ); ?></p>
 
-		<?php bp_core_admin_component_options(); ?>
+		<?php bp_core_admin_components_options(); ?>
 
 		<div class="submit clear">
 			<input type="hidden" name="save" value="components" />
-			<input type="hidden" name="step" value="<?php echo esc_attr( $this->current_step ); ?>" />
+			<input type="hidden" name="step" value="<?php echo esc_attr( $this->current_step() ); ?>" />
 
 			<?php wp_nonce_field( 'bpwizard_components' ); ?>
 
@@ -378,16 +276,14 @@ class BP_Core_Setup_Wizard {
 		if ( !empty( $wpdb->blogid ) && ( $wpdb->blogid != bp_get_root_blog_id() ) && ( !defined( 'BP_ENABLE_MULTIBLOG' ) ) )
 			switch_to_blog( bp_get_root_blog_id() );
 
-		if ( !current_user_can( 'activate_plugins' ) )
-			return false;
-
-		$existing_pages = bp_core_update_get_page_meta();
+		$existing_pages = bp_core_get_directory_page_ids();
 
 		// Provide empty indexes to avoid PHP errors with wp_dropdown_pages()
 		$indexes = array( 'members', 'activity', 'groups', 'forums', 'blogs', 'register', 'activate' );
 		foreach ( $indexes as $index ) {
-			if ( !isset( $existing_pages[$index] ) )
+			if ( !isset( $existing_pages[$index] ) ) {
 				$existing_pages[$index] = '';
+			}
 		}
 
 		if ( !empty( $existing_pages['blogs'] ) )
@@ -429,11 +325,9 @@ class BP_Core_Setup_Wizard {
 			});
 		</script>
 
-		<p><?php _e( 'BuddyPress now uses WordPress pages to display content. This allows you to easily change the names of pages or move them to a sub page.', 'buddypress' ); ?></p>
-
-		<p><?php _e( 'Either choose an existing page or let BuddyPress auto-create pages for you. To manually create custom pages, come back to this step once you are finished.', 'buddypress' ); ?></p>
+		<p><?php _e( 'BuddyPress uses WordPress pages to display directories. This allows you to easily change their titles and relocate them.', 'buddypress' ); ?></p>
 
-		<p><strong><?php _e( 'Please Note:', 'buddypress' ); ?></strong> <?php _e( 'If you have manually added BuddyPress navigation links in your theme you may need to remove these from your header.php to avoid duplicate links.', 'buddypress' ); ?></p>
+		<p><?php _e( 'Choose an existing page, have one auto-created, or create them manually and come back here once you are finished.', 'buddypress' ); ?></p>
 
 		<table class="form-table">
 
@@ -444,66 +338,83 @@ class BP_Core_Setup_Wizard {
 				</th>
 				<td>
 					<p><label><input type="radio" name="bp_pages[members]" <?php checked( empty( $existing_pages['members'] ) ); ?>  value="<?php echo $members_slug; ?>" /> <?php _e( 'Automatically create a page at:', 'buddypress' ) ?> <?php echo home_url( $members_slug ); ?>/</label></p>
-					<p><label><input type="radio" name="bp_pages[members]" <?php checked( !empty( $existing_pages['members'] ) ); ?> value="page" /> <?php _e( 'Use an existing page:', 'buddypress' ); ?> <?php echo wp_dropdown_pages( "name=bp-members-page&echo=0&show_option_none=" . __( '- Select -', 'buddypress' ) . "&selected=" . $existing_pages['members'] ); ?></label></p>
+
+					<?php if ( $members_page_dropdown = wp_dropdown_pages( "name=bp-members-page&echo=0&selected={$existing_pages['members']}&show_option_none=" . __( '- Select -', 'buddypress' ) ) ) : ?>
+
+						<p><label><input type="radio" name="bp_pages[members]" <?php checked( !empty( $existing_pages['members'] ) ); ?> value="page" /> <?php _e( 'Use an existing page:', 'buddypress' ); ?> <?php echo $members_page_dropdown ?></label></p>
+
+					<?php endif ?>
 				</td>
 			</tr>
 
-			<?php if ( isset( $active_components['activity'] ) ) : ?>
+			<?php if ( isset( $active_components['groups'] ) ) : ?>
 
 				<tr valign="top">
 					<th scope="row">
-						<h5><?php _e( 'Site Activity', 'buddypress' ); ?></h5>
-						<p><?php _e( "Displays the activity for the entire site, a member's friends, groups and @mentions.", 'buddypress' ); ?></p>
+						<h5><?php _e( 'Groups', 'buddypress' ); ?></h5>
+						<p><?php _e( 'Displays individual groups as well as a directory of groups.', 'buddypress' ); ?></p>
 					</th>
 					<td>
-						<p><label><input type="radio" name="bp_pages[activity]" <?php checked( empty( $existing_pages['activity'] ) ); ?>  value="<?php echo $activity_slug; ?>" /> <?php _e( 'Automatically create a page at:', 'buddypress' ); ?> <?php echo home_url( $activity_slug ); ?>/</label></p>
-						<p><label><input type="radio" name="bp_pages[activity]" <?php checked( !empty( $existing_pages['activity'] ) ); ?> value="page" /> <?php _e( 'Use an existing page:', 'buddypress' ); ?> <?php echo wp_dropdown_pages( "name=bp-activity-page&echo=0&show_option_none=" . __( '- Select -', 'buddypress' ) . "&selected=" . $existing_pages['activity'] ); ?></label></p>
+						<p><label><input type="radio" name="bp_pages[groups]" <?php checked( empty( $existing_pages['groups'] ) ); ?>  value="<?php echo $groups_slug; ?>" /> <?php _e( 'Automatically create a page at:', 'buddypress' ); ?> <?php echo home_url( $groups_slug ); ?>/</label></p>
+
+						<?php if ( $groups_page_dropdown = wp_dropdown_pages( "name=bp-groups-page&echo=0&selected={$existing_pages['groups']}&show_option_none=" . __( '- Select -', 'buddypress' ) ) ) : ?>
+							<p><label><input type="radio" name="bp_pages[groups]" <?php checked( !empty( $existing_pages['groups'] ) ); ?> value="page" /> <?php _e( 'Use an existing page:', 'buddypress' ); ?> <?php echo $groups_page_dropdown ?></label></p>
+						<?php endif ?>
 					</td>
 				</tr>
 
 			<?php endif; ?>
 
-			<?php if ( isset( $active_components['groups'] ) ) : ?>
+			<?php /* The Blogs component only needs a directory page when Multisite is enabled */ ?>
+			<?php if ( is_multisite() && isset( $active_components['blogs'] ) ) : ?>
 
 				<tr valign="top">
 					<th scope="row">
-						<h5><?php _e( 'Groups', 'buddypress' ); ?></h5>
-						<p><?php _e( 'Displays individual groups as well as a directory of groups.', 'buddypress' ); ?></p>
+						<h5><?php _e( 'Blogs', 'buddypress' ); ?></h5>
+						<p><?php _e( 'Displays a directory of the blogs in your network.', 'buddypress' ); ?></p>
 					</th>
 					<td>
-						<p><label><input type="radio" name="bp_pages[groups]" <?php checked( empty( $existing_pages['groups'] ) ); ?>  value="<?php echo $groups_slug; ?>" /> <?php _e( 'Automatically create a page at:', 'buddypress' ); ?> <?php echo home_url( $groups_slug ); ?>/</label></p>
-						<p><label><input type="radio" name="bp_pages[groups]" <?php checked( !empty( $existing_pages['groups'] ) ); ?> value="page" /> <?php _e( 'Use an existing page:', 'buddypress' ); ?> <?php echo wp_dropdown_pages( "name=bp-groups-page&echo=0&show_option_none=" . __( '- Select -', 'buddypress' ) . "&selected=" . $existing_pages['groups'] ); ?></label></p>
+						<p><label><input type="radio" name="bp_pages[blogs]" <?php checked( empty( $existing_pages['blogs'] ) ); ?>  value="<?php echo $blogs_slug; ?>" /> <?php _e( 'Automatically create a page at:', 'buddypress' ); ?> <?php echo home_url( $blogs_slug ); ?>/</label></p>
+
+						<?php if ( $blogs_page_dropdown = wp_dropdown_pages( "name=bp-blogs-page&echo=0&selected={$existing_pages['blogs']}&show_option_none=" . __( '- Select -', 'buddypress' ) ) ) : ?>
+							<p><label><input type="radio" name="bp_pages[blogs]" <?php checked( !empty( $existing_pages['blogs'] ) ); ?> value="page" /> <?php _e( 'Use an existing page:', 'buddypress' ); ?> <?php echo $blogs_page_dropdown ?></label></p>
+						<?php endif ?>
 					</td>
 				</tr>
 
 			<?php endif; ?>
 
-			<?php if ( isset( $active_components['forums'] ) ) : ?>
+			<?php if ( isset( $active_components['activity'] ) ) : ?>
 
 				<tr valign="top">
 					<th scope="row">
-						<h5><?php _e( 'Forums', 'buddypress' ); ?></h5>
-						<p><?php _e( 'Displays a directory of public forum topics.', 'buddypress' ); ?></p>
+						<h5><?php _e( 'Activity', 'buddypress' ); ?></h5>
+						<p><?php _e( "Displays the activity for the entire site, a member's friends, groups and @mentions.", 'buddypress' ); ?></p>
 					</th>
 					<td>
-						<p><label><input type="radio" name="bp_pages[forums]" <?php checked( empty( $existing_pages['forums'] ) ); ?>  value="<?php echo $forums_slug; ?>" /> <?php _e( 'Automatically create a page at:', 'buddypress' ); ?> <?php echo home_url( $forums_slug ); ?>/</label></p>
-						<p><label><input type="radio" name="bp_pages[forums]" <?php checked( !empty( $existing_pages['forums'] ) ); ?> value="page" /> <?php _e( 'Use an existing page:', 'buddypress' ); ?> <?php echo wp_dropdown_pages( "name=bp-forums-page&echo=0&show_option_none=" . __( '- Select -', 'buddypress' ) . "&selected=" . $existing_pages['forums'] ); ?></label></p>
+						<p><label><input type="radio" name="bp_pages[activity]" <?php checked( empty( $existing_pages['activity'] ) ); ?>  value="<?php echo $activity_slug; ?>" /> <?php _e( 'Automatically create a page at:', 'buddypress' ); ?> <?php echo home_url( $activity_slug ); ?>/</label></p>
+
+						<?php if ( $activity_page_dropdown = wp_dropdown_pages( "name=bp-activity-page&echo=0&selected={$existing_pages['activity']}&show_option_none=" . __( '- Select -', 'buddypress' ) ) ) : ?>
+							<p><label><input type="radio" name="bp_pages[activity]" <?php checked( !empty( $existing_pages['activity'] ) ); ?> value="page" /> <?php _e( 'Use an existing page:', 'buddypress' ); ?> <?php echo $activity_page_dropdown ?></label></p>
+						<?php endif ?>
 					</td>
 				</tr>
 
 			<?php endif; ?>
 
-			<?php /* The Blogs component only needs a directory page when Multisite is enabled */ ?>
-			<?php if ( is_multisite() && isset( $active_components['blogs'] ) ) : ?>
+			<?php if ( isset( $active_components['forums'] ) ) : ?>
 
 				<tr valign="top">
 					<th scope="row">
-						<h5><?php _e( 'Sites', 'buddypress' ); ?></h5>
-						<p><?php _e( 'Displays a directory of the sites in your network.', 'buddypress' ); ?></p>
+						<h5><?php _e( 'Forums', 'buddypress' ); ?></h5>
+						<p><?php _e( 'Displays a directory of public forum topics.', 'buddypress' ); ?></p>
 					</th>
 					<td>
-						<p><label><input type="radio" name="bp_pages[blogs]" <?php checked( empty( $existing_pages['blogs'] ) ); ?>  value="<?php echo $blogs_slug; ?>" /> <?php _e( 'Automatically create a page at:', 'buddypress' ); ?> <?php echo home_url( $blogs_slug ); ?>/</label></p>
-						<p><label><input type="radio" name="bp_pages[blogs]" <?php checked( !empty( $existing_pages['blogs'] ) ); ?> value="page" /> <?php _e( 'Use an existing page:', 'buddypress' ); ?> <?php echo wp_dropdown_pages( "name=bp-blogs-page&echo=0&show_option_none=" . __( '- Select -', 'buddypress' ) . "&selected=" . $existing_pages['blogs'] ); ?></label></p>
+						<p><label><input type="radio" name="bp_pages[forums]" <?php checked( empty( $existing_pages['forums'] ) ); ?>  value="<?php echo $forums_slug; ?>" /> <?php _e( 'Automatically create a page at:', 'buddypress' ); ?> <?php echo home_url( $forums_slug ); ?>/</label></p>
+
+						<?php if ( $forums_page_dropdown = wp_dropdown_pages( "name=bp-forums-page&echo=0&selected={$existing_pages['forums']}&show_option_none=" . __( '- Select -', 'buddypress' ) ) ) : ?>
+							<p><label><input type="radio" name="bp_pages[forums]" <?php checked( !empty( $existing_pages['forums'] ) ); ?> value="page" /> <?php _e( 'Use an existing page:', 'buddypress' ); ?> <?php echo $forums_page_dropdown ?></label></p>
+						<?php endif ?>
 					</td>
 				</tr>
 
@@ -516,7 +427,10 @@ class BP_Core_Setup_Wizard {
 				</th>
 				<td>
 					<p><label><input type="radio" name="bp_pages[register]" <?php checked( empty( $existing_pages['register'] ) ); ?>  value="<?php echo $register_slug; ?>" /> <?php _e( 'Automatically create a page at:', 'buddypress' ) ?> <?php echo home_url( $register_slug ) ?>/</label></p>
-					<p><label><input type="radio" name="bp_pages[register]" <?php checked( !empty( $existing_pages['register'] ) ); ?> value="page" /> <?php _e( 'Use an existing page:', 'buddypress' ) ?> <?php echo wp_dropdown_pages( "name=bp-register-page&echo=0&show_option_none=" . __( '- Select -', 'buddypress' ) . "&selected=" . $existing_pages['register'] ); ?></label></p>
+
+					<?php if ( $register_page_dropdown = wp_dropdown_pages( "name=bp-register-page&echo=0&selected={$existing_pages['register']}&show_option_none=" . __( '- Select -', 'buddypress' ) ) ) : ?>
+						<p><label><input type="radio" name="bp_pages[register]" <?php checked( !empty( $existing_pages['register'] ) ); ?> value="page" /> <?php _e( 'Use an existing page:', 'buddypress' ); ?> <?php echo $register_page_dropdown ?></label></p>
+					<?php endif ?>
 				</td>
 			</tr>
 
@@ -527,14 +441,17 @@ class BP_Core_Setup_Wizard {
 				</th>
 				<td>
 					<p><label><input type="radio" name="bp_pages[activate]" <?php checked( empty( $existing_pages['activate'] ) ); ?>  value="<?php echo $activation_slug; ?>" /> <?php _e( 'Automatically create a page at:', 'buddypress' ); ?> <?php echo home_url( $activation_slug ); ?>/</label></p>
-					<p><label><input type="radio" name="bp_pages[activate]" <?php checked( !empty( $existing_pages['activate'] ) ); ?> value="page" /> <?php _e( 'Use an existing page:', 'buddypress' ); ?> <?php echo wp_dropdown_pages( "name=bp-activate-page&echo=0&show_option_none=" . __( '- Select -', 'buddypress' ) . "&selected=" . $existing_pages['activate'] ); ?></label></p>
+
+					<?php if ( $activate_page_dropdown = wp_dropdown_pages( "name=bp-activate-page&echo=0&selected={$existing_pages['activate']}&show_option_none=" . __( '- Select -', 'buddypress' ) ) ) : ?>
+						<p><label><input type="radio" name="bp_pages[activate]" <?php checked( !empty( $existing_pages['activate'] ) ); ?> value="page" /> <?php _e( 'Use an existing page:', 'buddypress' ); ?> <?php echo $activate_page_dropdown ?></label></p>
+					<?php endif ?>
 				</td>
 			</tr>
 		</table>
 
 		<div class="submit clear">
 			<input type="hidden" name="save" value="pages" />
-			<input type="hidden" name="step" value="<?php echo esc_attr( $this->current_step ); ?>" />
+			<input type="hidden" name="step" value="<?php echo esc_attr( $this->current_step() ); ?>" />
 
 			<?php wp_nonce_field( 'bpwizard_pages' ); ?>
 
@@ -546,25 +463,22 @@ class BP_Core_Setup_Wizard {
 	}
 
 	function step_permalinks() {
-		if ( !current_user_can( 'activate_plugins' ) )
-			return false;
 
 		$prefix              = '';
-		$permalink_structure = get_option( 'permalink_structure' );
-		$using_permalinks    = ( !empty( $permalink_structure ) ) ? true : false;
+		$permalink_structure = bp_get_option( 'permalink_structure' );
 		$structures          = array( '', $prefix . '/%year%/%monthnum%/%day%/%postname%/', $prefix . '/%year%/%monthnum%/%postname%/', $prefix . '/archives/%post_id%' );
 
 		// If we're using permalinks already, adjust text accordingly
-		if ( $permalink_structure )
-			$permalink_setup_text = __( 'Congratulations! You are already using pretty permalinks, which BuddyPress requires. If you\'d like to change your settings, you may do so now. If you\'re happy with your current settings, click Save &amp; Next to continue.', 'buddypress' );
+		if ( !empty( $permalink_structure ) )
+			$permalink_setup_text = __( 'Your permalink settings are compatible with BuddyPress.', 'buddypress' );
 		else
-			$permalink_setup_text = __( 'To make sure the pages created in the previous step work correctly, pretty permalinks must be active on your site.', 'buddypress' );
+			$permalink_setup_text = __( 'Pretty permalinks must be active on your site.', 'buddypress' );
 
 		if ( !got_mod_rewrite() && !iis7_supports_permalinks() )
 			$prefix = '/index.php'; ?>
 
 		<p><?php echo $permalink_setup_text; ?></p>
-		<p><?php printf( __( 'Please select the permalink setting you would like to use. For more advanced options please visit the <a href="%s">permalink settings page</a> first, and complete this setup wizard later.', 'buddypress' ), admin_url( 'options-permalink.php' ) ); ?>
+		<p><?php printf( __( 'For more advanced options please visit the <a href="%s">permalink settings page</a> now and come back here later.', 'buddypress' ), admin_url( 'options-permalink.php' ) ); ?>
 
 		<table class="form-table">
 			<tr>
@@ -583,7 +497,7 @@ class BP_Core_Setup_Wizard {
 
 		<div class="submit clear">
 			<input type="hidden" name="save" value="permalinks" />
-			<input type="hidden" name="step" value="<?php echo esc_attr( $this->current_step ); ?>" />
+			<input type="hidden" name="step" value="<?php echo esc_attr( $this->current_step() ); ?>" />
 
 			<?php if ( 'post' == strtolower( $_SERVER['REQUEST_METHOD'] ) && empty( $_POST['skip-htaccess'] ) ) : ?>
 
@@ -599,24 +513,23 @@ class BP_Core_Setup_Wizard {
 	}
 
 	function step_theme() {
-		if ( !current_user_can( 'activate_plugins' ) )
-			return false;
+		global $bp;
 
 		$installed_plugins = get_plugins();
-		$installed_themes  = get_themes();
+		$installed_themes  = wp_get_themes();
+		$bp_themes         = array();
 
 		$template_pack_installed = false;
-		$bp_autotheme_installed  = false;
 		$bp_theme_installed      = false;
 
-		foreach ( (array)$installed_plugins as $plugin ) {
+		foreach ( (array) $installed_plugins as $plugin ) {
 			if ( 'BuddyPress Template Pack' == $plugin['Name'] ) {
 				$template_pack_installed = true;
 			}
 		}
 
-		foreach ( (array)$installed_themes as $theme ) {
-			foreach ( (array)$theme['Tags'] as $tag ) {
+		foreach ( (array) $installed_themes as $theme ) {
+			foreach ( (array) $theme['Tags'] as $tag ) {
 				if ( ( 'BuddyPress Default' != $theme['Name'] ) && ( 'buddypress' == $tag ) ) {
 					$bp_theme_installed = true;
 					$bp_themes[] = $theme;
@@ -625,13 +538,12 @@ class BP_Core_Setup_Wizard {
 		}
 
 		// Get theme screenshot
-		$current_theme = get_current_theme();
+		$current_theme = wp_get_theme();
 		$screenshot    = '';
-		$themes        = get_themes();
 
-		if ( !empty( $themes[$current_theme]['Screenshot'] ) )
-			$screenshot = trailingslashit( get_stylesheet_directory_uri() ) . $themes[$current_theme]['Screenshot'];
-	?>
+		if ( !empty( $installed_themes[$current_theme->stylesheet]['Screenshot'] ) ) {
+			$screenshot = trailingslashit( get_stylesheet_directory_uri() ) . $installed_themes[$current_theme->stylesheet]['Screenshot'];
+		} ?>
 
 		<script type="text/javascript">
 			jQuery( document ).ready( function() {
@@ -641,29 +553,28 @@ class BP_Core_Setup_Wizard {
 			});
 		</script>
 
-		<p><?php _e( "BuddyPress introduces a whole range of new screens to display content. To display these screens, you need to decide how you want to handle them in your current theme.", 'buddypress' ); ?></p>
-
 		<table class="form-table">
 			<tr>
 				<th>
 					<h5><?php _e( 'Use BuddyPress Default', 'buddypress' ); ?></h5>
-					<img src="<?php echo plugins_url( '/buddypress/bp-themes/bp-default/screenshot.png' ); ?>" alt="<?php _e( 'BuddyPress Default', 'buddypress' ); ?>" />
+					<img src="<?php echo plugins_url( 'bp-themes/bp-default/screenshot.png', $bp->file ); ?>" alt="<?php _e( 'BuddyPress Default', 'buddypress' ); ?>" />
 				</th>
 				<td>
-					<p><?php _e( 'BuddyPress Default contains everything you need to get up and running out of the box. It supports all features and is highly customizable.', 'buddypress' ); ?></p>
-					<p><strong><?php _e( 'This is the best choice if you do not have an existing WordPress theme, or want to start using BuddyPress immediately.', 'buddypress' ); ?></strong></p>
+					<p><?php _e( 'The default BuddyPress theme comes with the basics, to get up and running out of the box. It supports all features and is highly customizable.', 'buddypress' ); ?></p>
+					<p><strong><?php _e( 'This is the best choice if you want to start using BuddyPress immediately.', 'buddypress' ); ?></strong></p>
 					<p><label><input type="radio" name="theme" value="bp_default" checked="checked" /> <?php _e( 'Yes, please!', 'buddypress' ); ?></label></p>
 				</td>
 			</tr>
 
-			<?php if ( $bp_theme_installed ) : ?>
+			<?php if ( !empty( $bp_theme_installed ) ) : ?>
+
 				<tr>
 					<th>
 						<h5><?php _e( 'Other themes', 'buddypress' ); ?></h5>
-						<img src="<?php echo plugins_url( '/buddypress/bp-core/images/find.png' ); ?>" alt="<?php _e( 'A BuddyPress theme', 'buddypress' ); ?>" />
+						<img src="<?php echo plugins_url( 'bp-core/admin/images/find.png', $bp->file ); ?>" alt="<?php _e( 'A BuddyPress theme', 'buddypress' ); ?>" />
 					</th>
 					<td>
-						<p><?php _e( "We've found that you already have some other BuddyPress-compatible themes available. To use one of those, pick it from this list.", 'buddypress' ); ?></p>
+						<p><?php _e( "You have some other BuddyPress compatible themes available. Pick one of them from this list to use it.", 'buddypress' ); ?></p>
 						<p>
 							<label>
 								<input type="radio" name="theme" value="3rd_party" /> <?php _e( 'Use this theme', 'buddypress' ); ?>
@@ -671,38 +582,49 @@ class BP_Core_Setup_Wizard {
 							<select name="3rd_party_theme">
 
 								<?php foreach( (array) $bp_themes as $theme ) : ?>
+
 									<option value="<?php echo $theme['Template'] . ',' . $theme['Stylesheet']; ?>"><?php echo $theme['Name']; ?></option>
+
 								<?php endforeach; ?>
 
 							</select>
 						</p>
 					</td>
 				</tr>
+
 			<?php endif; ?>
 
-			<tr>
-				<th>
-					<h5><?php _e( 'Manually update current theme', 'buddypress' ); ?></h5>
-					<?php if ( !empty( $screenshot ) ) : ?>
-						<img src="<?php echo esc_url( $screenshot ); ?>" alt="<?php _e( 'Your existing theme', 'buddypress' ); ?>" />
-					<?php endif; ?>
-				</th>
-				<td>
-					<p><?php _e( 'The BuddyPress Template Pack plugin will guide you through the process of manually upgrading your existing WordPress theme. This usually involves following the step-by-step instructions and copying the BuddyPress template files into your theme. This option requires a working knowledge of CSS and HTML, as you will need to tweak the new templates to match your existing theme.', 'buddypress' ); ?></p>
+			<?php if ( ! current_theme_supports( 'buddypress' ) ) : ?>
 
-					<?php if ( empty( $template_pack_installed ) ) : ?>
+				<tr>
+					<th>
+						<h5><?php _e( 'Manually update current theme', 'buddypress' ); ?></h5>
 
-						<p><a id="bp-template-pack" class="thickbox onclick button" href="<?php echo network_admin_url( 'plugin-install.php?tab=plugin-information&plugin=bp-template-pack&TB_iframe=true&width=640&height=500' ); ?>"><?php _e( 'Install BuddyPress Template Pack', 'buddypress' ); ?></a></p>
+						<?php if ( !empty( $screenshot ) ) : ?>
 
-					<?php else : ?>
+							<img src="<?php echo esc_url( $screenshot ); ?>" alt="<?php _e( 'Your existing theme', 'buddypress' ); ?>" />
 
-						<p><label><input type="radio" name="theme" value="manual_wp" /> <?php _e( 'Choose this option (go to Appearance &rarr; BP Compatibility after setup is complete)', 'buddypress' ); ?></label></p>
-						<p><a id="bp-template-pack" class="button installed disabled" href="javascript:void();"><span></span><?php _e( 'Plugin Installed', 'buddypress' ); ?></a></p>
+						<?php endif; ?>
 
-					<?php endif; ?>
+					</th>
+					<td>
+						<p><?php _e( 'The BuddyPress Template Pack will guide you through the process of manually editing your existing theme. It comes with a step-by-step guide and involves copying the BuddyPress template files into your theme. <strong>This option requires knowledge of CSS and HTML.</strong> You will need to tweak the new templates to match your existing theme.', 'buddypress' ); ?></p>
 
-				</td>
-			</tr>
+						<?php if ( empty( $template_pack_installed ) ) : ?>
+
+							<p><a id="bp-template-pack" class="thickbox onclick button" href="<?php echo network_admin_url( 'plugin-install.php?tab=plugin-information&plugin=bp-template-pack&TB_iframe=true&width=640&height=500' ); ?>"><?php _e( 'Install BuddyPress Template Pack', 'buddypress' ); ?></a></p>
+
+						<?php else : ?>
+
+							<p><label><input type="radio" name="theme" value="manual_wp" /> <?php _e( 'Choose this option (go to Appearance &rarr; BP Compatibility after setup is complete)', 'buddypress' ); ?></label></p>
+							<p><a id="bp-template-pack" class="button installed disabled" href="javascript:void();"><span></span><?php _e( 'Plugin Installed', 'buddypress' ); ?></a></p>
+
+						<?php endif; ?>
+
+					</td>
+				</tr>
+
+			<?php endif; ?>
 
 			<tr>
 				<th>
@@ -710,7 +632,7 @@ class BP_Core_Setup_Wizard {
 				</th>
 				<td>
 					<p><?php _e( "You are happy with your current theme and plan on changing it later.", 'buddypress' ); ?></p>
-					<p><strong><?php _e( 'This is the best choice if you have a highly customized theme on your site already, and want to later manually integrate BuddyPress into your site.', 'buddypress' ); ?></strong></p>
+					<p><strong><?php _e( 'This is the best choice if you have a custom theme already and want to manually integrate BuddyPress later.', 'buddypress' ); ?></strong></p>
 
 					<p><label><input type="radio" name="theme" value="do_not_change" /> <?php _e( "Don't change my current theme", 'buddypress' ); ?></label></p>
 
@@ -720,7 +642,7 @@ class BP_Core_Setup_Wizard {
 
 		<div class="submit clear">
 			<input type="hidden" name="save" value="theme" />
-			<input type="hidden" name="step" value="<?php echo esc_attr( $this->current_step ) ?>" />
+			<input type="hidden" name="step" value="<?php echo esc_attr( $this->current_step() ) ?>" />
 
 			<?php wp_nonce_field( 'bpwizard_theme' ) ?>
 
@@ -729,18 +651,46 @@ class BP_Core_Setup_Wizard {
 	<?php
 	}
 
+	/**
+	 * When upgrading to BP 1.6, prompt the admin to switch to WordPress' Toolbar.
+	 *
+	 * @since 1.6
+	 */
+	function step_admin_bar() {
+	?>
+
+		<p><?php _e( "BuddyPress now uses the WordPress Toolbar; we've turbo-charged it by adding social items to help your users explore your site and manage their content.", 'buddypress' ); ?></p>
+
+		<p><?php _e( "We've noticed that your site uses the old bar from earlier versions of BuddyPress.", 'buddypress' ); ?></p>
+
+		<p>
+			<label>
+				<input type="checkbox" name="keep_buddybar" value="1" />
+				<?php _e( "If you'd prefer to not switch to the WordPress Toolbar just yet, check this box. Don't worry, you can change your mind later.", 'buddypress' ); ?>
+			</label>
+		</p>
+
+		<div class="submit clear">
+			<input type="hidden" name="save" value="admin_bar" />
+			<input type="hidden" name="step" value="<?php echo esc_attr( $this->current_step() ); ?>" />
+
+			<?php wp_nonce_field( 'bpwizard_admin_bar' ) ?>
+
+		</div>
+
+		<?php
+	}
+
 	function step_finish() {
-		if ( !current_user_can( 'activate_plugins' ) )
-			return false;
 
 		// What type of action is happening here?
-		$type = ( 'install' == $this->setup_type ) ? __( 'setup', 'buddypress' ) : __( 'update', 'buddypress' ); ?>
+		$type = ( bp_get_maintenance_mode() == 'install' ) ? __( 'setup', 'buddypress' ) : __( 'update', 'buddypress' ); ?>
 
-		<p><?php printf( __( "The BuddyPress %1\$s is complete, and your site is ready to go!", 'buddypress' ), $type, $type ); ?></p>
+		<p><?php printf( __( "The BuddyPress %1\$s is complete, and your site is ready to go!", 'buddypress' ), $type ); ?></p>
 
 		<div class="submit clear">
 			<input type="hidden" name="save" value="finish" />
-			<input type="hidden" name="step" value="<?php echo esc_attr( $this->current_step ); ?>" />
+			<input type="hidden" name="step" value="<?php echo esc_attr( $this->current_step() ); ?>" />
 
 			<?php wp_nonce_field( 'bpwizard_finish' ); ?>
 
@@ -752,7 +702,6 @@ class BP_Core_Setup_Wizard {
 	/** Save Step Methods *****************************************************/
 
 	function step_db_update_save() {
-		global $bp;
 
 		if ( isset( $_POST['submit'] ) ) {
 			check_admin_referer( 'bpwizard_db_update' );
@@ -760,58 +709,13 @@ class BP_Core_Setup_Wizard {
 			// Run the schema install to update tables
 			bp_core_install();
 
-			if ( $this->database_version < 1801 )
+			// Update to 1.5
+			if ( bp_get_db_version_raw() < 1801 )
 				$this->update_1_5();
 
-			// Update the active components option early if we're updating
-			if ( 'update' == $this->setup_type )
-				bp_update_option( 'bp-active-components', $bp->active_components );
-
-			return true;
-		}
-
-		return false;
-	}
-
-	function step_ms_update_save() {
-		global $wpdb;
-
-		if ( isset( $_POST['submit'] ) ) {
-			check_admin_referer( 'bpwizard_ms_update' );
-
-			if ( !$active_components = bp_get_option( 'bp-active-components' ) )
-				$active_components = array();
-
-			// Transfer important settings from blog options to site options
-			$options = array(
-				'bp-db-version'        => $this->database_version,
-				'bp-active-components' => $active_components,
-				'avatar-default'       => get_option( 'avatar-default' )
-			);
-			bp_core_activate_site_options( $options );
-
-			if ( isset( $_POST['bp_components']['blogs'] ) ) {
-				$active_components['blogs'] = 1;
-
-				// Make sure that the pages are created on the bp_get_root_blog_id(), no matter which Dashboard the setup is being run on
-				if ( !empty( $wpdb->blogid ) && ( $wpdb->blogid != bp_get_root_blog_id() ) && ( !defined( 'BP_ENABLE_MULTIBLOG' ) ) )
-					switch_to_blog( bp_get_root_blog_id() );
-
-				// Move bp-pages data from the blog options table to site options
-				$existing_pages	= bp_get_option( 'bp-pages' );
-
-				$bp_pages       = $this->setup_pages( (array)$_POST['bp_pages'] );
-				$bp_pages       = array_merge( (array)$existing_pages, (array)$bp_pages );
-
-				bp_update_option( 'bp-pages', $bp_pages );
-
-				if ( !empty( $wpdb->blogid ) && ( $wpdb->blogid != bp_get_root_blog_id() ) && ( !defined( 'BP_ENABLE_MULTIBLOG' ) ) )
-					restore_current_blog();
-
-				bp_core_install( $active_components );
-			}
-
-			bp_update_option( 'bp-active-components', $active_components );
+			// Update to 1.6
+			if ( bp_get_db_version_raw() < bp_get_db_version() )
+				$this->update_1_6();
 
 			return true;
 		}
@@ -819,16 +723,18 @@ class BP_Core_Setup_Wizard {
 		return false;
 	}
 
-
 	function step_components_save() {
+
 		if ( isset( $_POST['submit'] ) && isset( $_POST['bp_components'] ) ) {
+
 			check_admin_referer( 'bpwizard_components' );
 
 			$active_components = array();
 
 			// Settings form submitted, now save the settings.
-			foreach ( (array)$_POST['bp_components'] as $key => $value )
+			foreach ( (array) $_POST['bp_components'] as $key => $value ) {
 				$active_components[$key] = 1;
+			}
 
 			bp_update_option( 'bp-active-components', $active_components );
 
@@ -852,12 +758,13 @@ class BP_Core_Setup_Wizard {
 				switch_to_blog( bp_get_root_blog_id() );
 
 			// Delete any existing pages
-			$existing_pages = bp_core_update_get_page_meta( 'bp-pages' );
+			$existing_pages = bp_core_get_directory_page_ids();
 
-			foreach ( (array)$existing_pages as $page_id )
+			foreach ( (array) $existing_pages as $page_id ) {
 				wp_delete_post( $page_id, true );
+			}
 
-			$blog_pages   = $this->setup_pages( (array)$_POST['bp_pages'] );
+			$blog_pages   = $this->setup_pages( (array) $_POST['bp_pages'] );
 			bp_update_option( 'bp-pages', $blog_pages );
 
 			if ( !empty( $wpdb->blogid ) && ( $wpdb->blogid != bp_get_root_blog_id() ) && ( !defined( 'BP_ENABLE_MULTIBLOG' ) ) )
@@ -971,6 +878,8 @@ class BP_Core_Setup_Wizard {
 	}
 
 	function step_theme_save() {
+		global $bp;
+
 		if ( isset( $_POST['submit'] ) && isset( $_POST['theme'] ) ) {
 			check_admin_referer( 'bpwizard_theme' );
 
@@ -981,6 +890,7 @@ class BP_Core_Setup_Wizard {
 
 				// Activate the bp-default theme
 				case 'bp_default' :
+					register_theme_directory( $bp->themes_dir );
 					switch_theme( 'bp-default', 'bp-default' );
 					break;
 
@@ -1022,41 +932,60 @@ class BP_Core_Setup_Wizard {
 		return false;
 	}
 
+	/**
+	 * When upgrading to BP 1.6, the admin is prompted to switch to WordPress' Toolbar.
+	 * If they choose not to, record that preference in the options table.
+	 *
+	 * @since 1.6
+	 */
+	function step_admin_bar_save() {
+		if ( isset( $_POST['submit'] ) ) {
+			check_admin_referer( 'bpwizard_admin_bar' );
+
+			if ( !empty( $_POST['keep_buddybar'] ) ) {
+				bp_update_option( '_bp_force_buddybar', 1 );
+			}
+
+			return true;
+		}
+
+		return false;
+	}
+
 	function step_finish_save() {
+
 		if ( isset( $_POST['submit'] ) ) {
+
 			check_admin_referer( 'bpwizard_finish' );
 
 			// Update the DB version in the database
-			// Stored in sitemeta. Do not use bp_update_option()
-			update_site_option( 'bp-db-version', $this->new_version );
-			delete_site_option( 'bp-core-db-version' );
+			bp_version_bump();
 
 			// Delete the setup cookie
 			@setcookie( 'bp-wizard-step', '', time() - 3600, COOKIEPATH );
 
-			// Load BP and hook the admin menu, so that the redirect is successful
-			if ( !function_exists( 'bp_core_update_message' ) )
-				require( WP_PLUGIN_DIR . '/buddypress/bp-core/admin/bp-core-admin.php' );
-
-			bp_core_add_admin_menu();
-
 			// Redirect to the BuddyPress dashboard
-			$redirect = bp_core_update_do_network_admin() ? add_query_arg( array( 'page' => 'bp-general-settings' ), network_admin_url( 'admin.php' ) ) : add_query_arg( array( 'page' => 'bp-general-settings' ), admin_url( 'admin.php' ) );
+			$redirect = bp_core_do_network_admin() ? network_admin_url( 'settings.php' ) : admin_url( 'options-general.php' );
+			$redirect = add_query_arg( array( 'page' => 'bp-components' ), $redirect  );
 
-			wp_redirect( $redirect );
+			wp_safe_redirect( $redirect );
 
-			return true;
+			// That's all!
+			exit();
 		}
 
 		return false;
 	}
 
 	function setup_pages( $pages ) {
+
+		$bp_pages = array();
+
 		foreach ( $pages as $key => $value ) {
 			if ( 'page' == $value ) {
 				// Check for the selected page
 				if ( !empty( $_POST['bp-' . $key . '-page'] ) )
-					$bp_pages[$key] = (int)$_POST['bp-' . $key . '-page'];
+					$bp_pages[$key] = (int) $_POST['bp-' . $key . '-page'];
 				else
 					$bp_pages[$key] = wp_insert_post( array( 'comment_status' => 'closed', 'ping_status' => 'closed', 'post_title' => ucwords( $key ), 'post_status' => 'publish', 'post_type' => 'page' ) );
 			} else {
@@ -1070,6 +999,7 @@ class BP_Core_Setup_Wizard {
 
 	// Database update methods based on version numbers
 	function update_1_5() {
+
 		// Delete old database version options
 		delete_site_option( 'bp-activity-db-version' );
 		delete_site_option( 'bp-blogs-db-version'    );
@@ -1079,6 +1009,22 @@ class BP_Core_Setup_Wizard {
 		delete_site_option( 'bp-xprofile-db-version' );
 	}
 
+	// Database update methods based on version numbers
+	function update_1_6() {
+
+		// Delete possible site options
+		delete_site_option( 'bp-db-version'       );
+		delete_site_option( '_bp_db_version'      );
+		delete_site_option( 'bp-core-db-version'  );
+		delete_site_option( '_bp-core-db-version' );
+
+		// Delete possible blog options
+		delete_blog_option( bp_get_root_blog_id(), 'bp-db-version'       );
+		delete_blog_option( bp_get_root_blog_id(), 'bp-core-db-version'  );
+		delete_site_option( bp_get_root_blog_id(), '_bp-core-db-version' );
+		delete_site_option( bp_get_root_blog_id(), '_bp_db_version'      );
+	}
+
 	/**
 	 * Reset the cookie so the install script starts over
 	 */
@@ -1087,258 +1033,19 @@ class BP_Core_Setup_Wizard {
 	}
 }
 
-function bp_core_setup_wizard_init() {
-	global $bp_wizard;
-
-	$bp_wizard = new BP_Core_Setup_Wizard;
-}
-add_action( bp_core_update_admin_hook(), 'bp_core_setup_wizard_init', 7 );
-
-function bp_core_install( $active_components = false ) {
-	global $wpdb;
-
-	if ( empty( $active_components ) )
-		$active_components = apply_filters( 'bp_active_components', bp_get_option( 'bp-active-components' ) );
-
-	require( dirname( __FILE__ ) . '/bp-core-schema.php' );
-
-	// Core DB Tables
-	bp_core_install_notifications();
-
-	// Activity Streams
-	if ( !empty( $active_components['activity'] ) )
-		bp_core_install_activity_streams();
-
-	// Friend Connections
-	if ( !empty( $active_components['friends'] ) )
-		bp_core_install_friends();
-
-	// Extensible Groups
-	if ( !empty( $active_components['groups'] ) )
-		bp_core_install_groups();
-
-	// Private Messaging
-	if ( !empty( $active_components['messages'] ) )
-		bp_core_install_private_messaging();
-
-	// Extended Profiles
-	if ( !empty( $active_components['xprofile'] ) )
-		bp_core_install_extended_profiles();
-
-	// Blog tracking
-	if ( !empty( $active_components['blogs'] ) )
-		bp_core_install_blog_tracking();
-}
-
-function bp_core_update( $disabled ) {
-	global $wpdb;
-
-	require( dirname( __FILE__ ) . '/bp-core-schema.php' );
-}
-
-function bp_update_db_stuff() {
-	$bp_prefix = bp_core_get_table_prefix();
-	// Rename the old user activity cached table if needed.
-	if ( $wpdb->get_var( "SHOW TABLES LIKE '%{$bp_prefix}bp_activity_user_activity_cached%'" ) )
-		$wpdb->query( "RENAME TABLE {$bp_prefix}bp_activity_user_activity_cached TO {$bp->activity->table_name}" );
-
-	// Rename fields from pre BP 1.2
-	if ( $wpdb->get_var( "SHOW TABLES LIKE '%{$bp->activity->table_name}%'" ) ) {
-		if ( $wpdb->get_var( "SHOW COLUMNS FROM {$bp->activity->table_name} LIKE 'component_action'" ) )
-			$wpdb->query( "ALTER TABLE {$bp->activity->table_name} CHANGE component_action type varchar(75) NOT NULL" );
-
-		if ( $wpdb->get_var( "SHOW COLUMNS FROM {$bp->activity->table_name} LIKE 'component_name'" ) )
-			$wpdb->query( "ALTER TABLE {$bp->activity->table_name} CHANGE component_name component varchar(75) NOT NULL" );
-	}
-
-	// On first installation - record all existing blogs in the system.
-	if ( !(int)$bp->site_options['bp-blogs-first-install'] ) {
-		bp_blogs_record_existing_blogs();
-		bp_update_option( 'bp-blogs-first-install', 1 );
-	}
-
-	if ( is_multisite() )
-		bp_core_add_illegal_names();
-
-	// Update and remove the message threads table if it exists
-	if ( $wpdb->get_var( "SHOW TABLES LIKE '%{$bp_prefix}bp_messages_threads%'" ) ) {
-		$update = BP_Messages_Thread::update_tables();
-
-		if ( $update )
-			$wpdb->query( "DROP TABLE {$bp_prefix}bp_messages_threads" );
-	}
-
-}
-
-function bp_core_wizard_message() {
-	if ( isset( $_GET['updated'] ) )
-		$message = __( 'Installation was successful. The available options have now been updated, please continue with your selection.', 'buddypress' );
-	else
-		return false; ?>
-
-	<div id="message" class="updated">
-		<p><?php echo esc_attr( $message ) ?></p>
-	</div>
-
-<?php
-}
-add_action( 'bp_admin_notices', 'bp_core_wizard_message' );
-
-// Alter thickbox screens so the entire plugin download and install
-// interface is contained within.
-function bp_core_wizard_thickbox() {
-	$form_action = bp_core_update_do_network_admin() ? network_admin_url( add_query_arg( array( 'page' => 'bp-wizard', 'updated' => '1' ), 'admin.php' ) ) : admin_url( add_query_arg( array( 'page' => 'bp-wizard', 'updated' => '1' ), 'admin.php' ) ); ?>
-
-	<script type="text/javascript">
-		jQuery('p.action-button a').attr( 'target', '' );
-
-		if ( window.location != window.parent.location ) {
-			jQuery('#adminmenu, #wphead, #footer, #update-nag, #screen-meta').hide();
-			jQuery('#wpbody').css( 'margin', '15px' );
-			jQuery('body').css( 'min-width', '30px' );
-			jQuery('#wpwrap').css( 'min-height', '30px' );
-			jQuery('a').removeClass( 'thickbox thickbox-preview onclick' );
-			jQuery('body.update-php div.wrap p:last').hide();
-			jQuery('body.update-php div.wrap p:last').after( '<p><a class="button" target="_parent" href="<?php echo $form_action; ?>"><?php _e( 'Finish', 'buddypress' ) ?></a></p>' );
-		}
-	</script>
-
-<?php
-}
-add_action( 'admin_footer', 'bp_core_wizard_thickbox' );
-
 /**
- * Adds the "BuddyPress" admin submenu item to the Site Admin tab.
+ * Get the wizard
  *
- * @package BuddyPress Core
- * @global object $bp Global BuddyPress settings object
- * @global $wpdb WordPress DB access object.
- * @uses add_submenu_page() WP function to add a submenu item
+ * @global type $bp
+ * @return boolean
  */
-function bp_core_update_add_admin_menu() {
-	global $bp_wizard;
-
-	// Only load this version of the menu if this is an upgrade or a new installation
-	if ( empty( $bp_wizard->setup_type ) )
-		return false;
-
-	if ( !current_user_can( 'activate_plugins' ) )
-		return false;
+function bp_get_wizard() {
+	global $bp;
 
-	if ( 'install' == $bp_wizard->setup_type )
-		$status = __( 'Setup', 'buddypress' );
-	else
-		$status = __( 'Update', 'buddypress' );
-
-	// Add the administration tab under the "Site Admin" tab for site administrators
-	add_menu_page( __( 'BuddyPress', 'buddypress' ), __( 'BuddyPress', 'buddypress' ), 'manage_options', 'bp-wizard', '' );
-	$hook = add_submenu_page( 'bp-wizard', $status, $status, 'manage_options', 'bp-wizard', array( $bp_wizard, 'html' ) );
-
-	// Add a hook for css/js
-	add_action( "admin_print_styles-$hook", 'bp_core_update_add_admin_menu_styles' );
-}
-add_action( bp_core_update_admin_hook(),  'bp_core_update_add_admin_menu', 9 );
-
-function bp_core_update_add_admin_menu_styles() {
-	if ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) {
-		wp_enqueue_style( 'bp-admin-css', apply_filters( 'bp_core_admin_css', plugins_url( '/buddypress' ) . '/bp-core/css/admin.dev.css' ), array(), '20110723' );
-		wp_enqueue_script( 'bp-update-js', apply_filters( 'bp_core_update_js', plugins_url( '/buddypress' ) . '/bp-core/js/update.dev.js' ), array( 'jquery' ), '20110723' );
-	} else {
-		wp_enqueue_style( 'bp-admin-css', apply_filters( 'bp_core_admin_css', plugins_url( '/buddypress' ) . '/bp-core/css/admin.css' ), array(), '20110723' );
-		wp_enqueue_script( 'bp-update-js', apply_filters( 'bp_core_update_js', plugins_url( '/buddypress' ) . '/bp-core/js/update.js' ), array( 'jquery' ), '20110723' );
-
-	}
-
-	wp_enqueue_script( 'thickbox' );
-	wp_enqueue_style( 'thickbox' ); ?>
-
-	<style type="text/css">
-		/* Wizard Icon */
-		ul#adminmenu li.toplevel_page_bp-wizard .wp-menu-image a img { display: none; }
-		ul#adminmenu li.toplevel_page_bp-wizard .wp-menu-image a { background-image: url( <?php echo plugins_url( 'buddypress/bp-core/images/admin_menu_icon.png' ) ?> ) !important; background-position: -1px -32px; }
-		ul#adminmenu li.toplevel_page_bp-wizard:hover .wp-menu-image a,
-		ul#adminmenu li.toplevel_page_bp-wizard.wp-has-current-submenu .wp-menu-image a {
-			background-position: -1px 0;
-		}
-
-		/* Settings Icon */
-		ul#adminmenu li.toplevel_page_bp-general-settings .wp-menu-image a img { display: none; }
-		ul#adminmenu li.toplevel_page_bp-general-settings .wp-menu-image a { background-image: url( <?php echo plugins_url( 'buddypress/bp-core/images/admin_menu_icon.png' ) ?> ) !important; background-position: -1px -32px; }
-		ul#adminmenu li.toplevel_page_bp-general-settings:hover .wp-menu-image a,
-		ul#adminmenu li.toplevel_page_bp-general-settings.wp-has-current-submenu .wp-menu-image a {
-			background-position: -1px 0;
-		}
-	</style>
-
-<?php
-}
-add_action( 'admin_head', 'bp_core_update_add_admin_menu_styles' );
-
-/**
- * Fetches BP pages from the meta table
- *
- * @package BuddyPress Core
- * @since 1.5
- *
- * @return array $page_ids
- */
-function bp_core_update_get_page_meta() {
-	if ( !$page_ids = bp_get_option( 'bp-pages' ) )
-		$page_ids = array();
-
-	return apply_filters( 'bp_core_update_get_page_meta', $page_ids );
-}
-
-function bp_core_update_do_network_admin() {
-	$do_network_admin = false;
-
-	if ( is_multisite() && ( !defined( 'BP_ENABLE_MULTIBLOG' ) || !BP_ENABLE_MULTIBLOG ) )
-		$do_network_admin = true;
-
-	return apply_filters( 'bp_core_do_network_admin', $do_network_admin );
-}
-
-function bp_core_update_admin_hook() {
-	$hook = bp_core_update_do_network_admin() ? 'network_admin_menu' : 'admin_menu';
-
-	return apply_filters( 'bp_core_admin_hook', $hook );
-}
-
-/**
- * Adds an admin nag about running the BP upgrade/install wizard
- *
- * @package BuddyPress Core
- * @since 1.5
- * @global $pagenow The current admin page
- */
-function bp_core_update_nag() {
-	global $bp_wizard, $pagenow;
-
-	if ( empty( $bp_wizard->setup_type ) )
-		return;
-
-	if ( !is_super_admin() )
-		return;
-
-	if ( 'admin.php' == $pagenow && ( empty( $_GET['page'] ) || 'bp-wizard' == $_GET['page'] ) )
-		return;
-
-	$url = bp_core_update_do_network_admin() ? network_admin_url( 'admin.php?page=bp-wizard' ) : admin_url( 'admin.php?page=bp-wizard' );
-
-	switch( $bp_wizard->setup_type ) {
-		case 'update':
-			$msg = sprintf( __( 'BuddyPress has been updated! Please run the <a href="%s">update wizard</a>.', 'buddypress' ), $url );
-			break;
-
-		default:
-		case 'install':
-			$msg = sprintf( __( 'BuddyPress was successfully installed! Please run the <a href="%s">installation wizard</a>.', 'buddypress' ), $url );
-			break;
-	}
+	if ( !empty( $bp->admin->wizard ) )
+		return $bp->admin->wizard;
 
-	echo '<div class="update-nag">' . $msg . '</div>';
+	return false;
 }
-add_action( 'admin_notices', 'bp_core_update_nag', 5 );
-add_action( 'network_admin_notices', 'bp_core_update_nag', 5 );
 
-?>
\ No newline at end of file
+?>
diff --git a/wp-content/plugins/buddypress/bp-core/admin/css/common.css b/wp-content/plugins/buddypress/bp-core/admin/css/common.css
new file mode 100644
index 0000000000000000000000000000000000000000..523df84eeca12395c0e65e5e79fb32b90ca731e1
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-core/admin/css/common.css
@@ -0,0 +1 @@
+div#icon-buddypress{background:url(../images/icons32.png) no-repeat -370px -6px}div#icon-buddypress-activity{background:url(../images/icons32.png) no-repeat -10px -6px}ul#adminmenu li.toplevel_page_bp-wizard .wp-menu-image a img{display:none}ul#adminmenu li.toplevel_page_bp-wizard .wp-menu-image a{background-image:url(../images/menu.png)!important;background-position:-178pxpx -34px}ul#adminmenu li.toplevel_page_bp-wizard:hover .wp-menu-image a,ul#adminmenu li.toplevel_page_bp-wizard.wp-has-current-submenu .wp-menu-image a{background-position:-178px -2px}ul#adminmenu li.toplevel_page_bp-components .wp-menu-image a img,ul#adminmenu li.toplevel_page_bp-general-settings .wp-menu-image a img{display:none}ul#adminmenu li.toplevel_page_bp-components .wp-menu-image a,ul#adminmenu li.toplevel_page_bp-general-settings .wp-menu-image a{background-image:url(../images/menu.png)!important;background-position:-178px -34px}ul#adminmenu li.toplevel_page_bp-components:hover .wp-menu-image a,ul#adminmenu li.toplevel_page_bp-general-settings:hover .wp-menu-image a,ul#adminmenu li.toplevel_page_bp-components.wp-has-current-submenu .wp-menu-image a,ul#adminmenu li.toplevel_page_bp-general-settings.wp-has-current-submenu .wp-menu-image a{background-position:-178px -2px}ul#adminmenu li.toplevel_page_bp-activity .wp-menu-image a img,ul#adminmenu li.toplevel_page_bp-activity_network .wp-menu-image a img{display:none}ul#adminmenu li.toplevel_page_bp-activity .wp-menu-image a,ul#adminmenu li.toplevel_page_bp-activity_network .wp-menu-image a{background-image:url(../images/menu.png)!important;background-position:0 -34px}ul#adminmenu li.toplevel_page_bp-activity:hover .wp-menu-image a,ul#adminmenu li.toplevel_page_bp-activity.current .wp-menu-image a,ul#adminmenu li.toplevel_page_bp-activity.wp-has-current-submenu .wp-menu-image a,ul#adminmenu li.toplevel_page_bp-activity_network:hover .wp-menu-image a,ul#adminmenu li.toplevel_page_bp-activity_network.current .wp-menu-image a,ul#adminmenu li.toplevel_page_bp-activity_network.wp-has-current-submenu .wp-menu-image a{background-position:0 -2px}.dashboard_page_bp-wizard td.plugin-title span,.settings_page_bp-components td.plugin-title span{float:left;width:18px;height:18px;background-image:url(../images/menu.png);background-position:-4px -40px;background-repeat:no-repeat;margin-right:5px}.dashboard_page_bp-wizard tr.active td.plugin-title span,.settings_page_bp-components tr.active td.plugin-title span{background-position-y:-7px}.dashboard_page_bp-wizard tr.activity td.plugin-title span,.settings_page_bp-components tr.activity td.plugin-title span{background-position-x:-4px}.dashboard_page_bp-wizard tr.xprofile td.plugin-title span,.settings_page_bp-components tr.xprofile td.plugin-title span{background-image:url(../images/menu-wp.png);background-position-x:-305px}.dashboard_page_bp-wizard tr.settings td.plugin-title span,.settings_page_bp-components tr.settings td.plugin-title span{background-image:url(../images/menu-wp.png);background-position-x:-334px}.dashboard_page_bp-wizard tr.groups td.plugin-title span,.settings_page_bp-components tr.groups td.plugin-title span{background-position-x:-66px}.dashboard_page_bp-wizard tr.messages td.plugin-title span,.settings_page_bp-components tr.messages td.plugin-title span{background-position-x:-154px}.dashboard_page_bp-wizard tr.forums td.plugin-title span,.settings_page_bp-components tr.forums td.plugin-title span{background-image:url(../images/menu-wp.png);background-position-x:-36px}.dashboard_page_bp-wizard tr.blogs td.plugin-title span,.settings_page_bp-components tr.blogs td.plugin-title span{background-position-x:-125px}.dashboard_page_bp-wizard tr.friends td.plugin-title span,.settings_page_bp-components tr.friends td.plugin-title span{background-position-x:-95px}.dashboard_page_bp-wizard tr.core td.plugin-title span,.settings_page_bp-components tr.core td.plugin-title span{background-position-x:-184px}.dashboard_page_bp-wizard tr.members td.plugin-title span,.settings_page_bp-components tr.members td.plugin-title span{background-position-x:-36px}#bp-admin-component-form .widefat th{display:table-cell;vertical-align:top}
\ No newline at end of file
diff --git a/wp-content/plugins/buddypress/bp-core/admin/css/common.dev.css b/wp-content/plugins/buddypress/bp-core/admin/css/common.dev.css
new file mode 100644
index 0000000000000000000000000000000000000000..f722b5238de6d26e802de3ace632ceef26629dcf
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-core/admin/css/common.dev.css
@@ -0,0 +1,148 @@
+/**
+ * CSS that is always loaded when in wp-admin
+ *
+ * @since BuddyPress (1.6)
+ */
+
+/* Icon 32's
+------------------------------------------------------------------------------*/
+
+div#icon-buddypress {
+	background: url( ../images/icons32.png ) no-repeat -370px -6px;
+}
+
+div#icon-buddypress-activity {
+	background: url( ../images/icons32.png ) no-repeat -10px -6px;
+}
+
+/* Menu Icons
+------------------------------------------------------------------------------*/
+
+/* Wizard */
+ul#adminmenu li.toplevel_page_bp-wizard .wp-menu-image a img {
+	display: none;
+}
+ul#adminmenu li.toplevel_page_bp-wizard .wp-menu-image a {
+	background-image: url( ../images/menu.png ) !important;
+	background-position: -178pxpx -34px;
+}
+ul#adminmenu li.toplevel_page_bp-wizard:hover .wp-menu-image a,
+ul#adminmenu li.toplevel_page_bp-wizard.wp-has-current-submenu .wp-menu-image a {
+	background-position: -178px -2px;
+}
+
+/* Backpat */
+ul#adminmenu li.toplevel_page_bp-components .wp-menu-image a img,
+ul#adminmenu li.toplevel_page_bp-general-settings .wp-menu-image a img {
+	display: none;
+}
+
+ul#adminmenu li.toplevel_page_bp-components .wp-menu-image a,
+ul#adminmenu li.toplevel_page_bp-general-settings .wp-menu-image a {
+	background-image: url( ../images/menu.png ) !important;
+	background-position: -178px -34px;
+}
+
+ul#adminmenu li.toplevel_page_bp-components:hover .wp-menu-image a,
+ul#adminmenu li.toplevel_page_bp-general-settings:hover .wp-menu-image a,
+ul#adminmenu li.toplevel_page_bp-components.wp-has-current-submenu .wp-menu-image a,
+ul#adminmenu li.toplevel_page_bp-general-settings.wp-has-current-submenu .wp-menu-image a {
+	background-position: -178px -2px;
+}
+
+/* Activity */
+ul#adminmenu li.toplevel_page_bp-activity .wp-menu-image a img,
+ul#adminmenu li.toplevel_page_bp-activity_network .wp-menu-image a img {
+	display: none;
+}
+ul#adminmenu li.toplevel_page_bp-activity .wp-menu-image a,
+ul#adminmenu li.toplevel_page_bp-activity_network .wp-menu-image a {
+	background-image: url( ../images/menu.png ) !important;
+	background-position: 0 -34px;
+}
+ul#adminmenu li.toplevel_page_bp-activity:hover .wp-menu-image a,
+ul#adminmenu li.toplevel_page_bp-activity.current .wp-menu-image a,
+ul#adminmenu li.toplevel_page_bp-activity.wp-has-current-submenu .wp-menu-image a,
+ul#adminmenu li.toplevel_page_bp-activity_network:hover .wp-menu-image a,
+ul#adminmenu li.toplevel_page_bp-activity_network.current .wp-menu-image a,
+ul#adminmenu li.toplevel_page_bp-activity_network.wp-has-current-submenu .wp-menu-image a {
+	background-position: 0 -2px;
+}
+
+
+/* Components
+------------------------------------------------------------------------------*/
+
+.dashboard_page_bp-wizard td.plugin-title span,
+.settings_page_bp-components td.plugin-title span {
+	float: left;
+	width: 18px;
+	height: 18px;
+	background-image: url( ../images/menu.png );
+	background-position: -4px -40px;
+	background-repeat: no-repeat;
+	margin-right: 5px;
+}
+
+.dashboard_page_bp-wizard tr.active td.plugin-title span,
+.settings_page_bp-components tr.active td.plugin-title span {
+	background-position-y: -7px;
+}
+
+.dashboard_page_bp-wizard tr.activity td.plugin-title span,
+.settings_page_bp-components tr.activity td.plugin-title span {
+	background-position-x: -4px;
+}
+
+.dashboard_page_bp-wizard tr.xprofile td.plugin-title span,
+.settings_page_bp-components tr.xprofile td.plugin-title span {
+	background-image: url( ../images/menu-wp.png );
+	background-position-x: -305px;
+}
+
+.dashboard_page_bp-wizard tr.settings td.plugin-title span,
+.settings_page_bp-components tr.settings td.plugin-title span {
+	background-image: url( ../images/menu-wp.png );
+	background-position-x: -334px;
+}
+
+.dashboard_page_bp-wizard tr.groups td.plugin-title span,
+.settings_page_bp-components tr.groups td.plugin-title span {
+	background-position-x: -66px;
+}
+
+.dashboard_page_bp-wizard tr.messages td.plugin-title span,
+.settings_page_bp-components tr.messages td.plugin-title span {
+	background-position-x: -154px;
+}
+
+.dashboard_page_bp-wizard tr.forums td.plugin-title span,
+.settings_page_bp-components tr.forums td.plugin-title span {
+	background-image: url( ../images/menu-wp.png );
+	background-position-x: -36px;
+}
+
+.dashboard_page_bp-wizard tr.blogs td.plugin-title span,
+.settings_page_bp-components tr.blogs td.plugin-title span {
+	background-position-x: -125px;
+}
+
+.dashboard_page_bp-wizard tr.friends td.plugin-title span,
+.settings_page_bp-components tr.friends td.plugin-title span {
+	background-position-x: -95px;
+}
+
+.dashboard_page_bp-wizard tr.core td.plugin-title span,
+.settings_page_bp-components tr.core td.plugin-title span {
+	background-position-x: -184px;
+}
+
+.dashboard_page_bp-wizard tr.members td.plugin-title span,
+.settings_page_bp-components tr.members td.plugin-title span {
+	background-position-x: -36px;
+}
+
+#bp-admin-component-form .widefat th {
+    display: table-cell;
+    vertical-align: top;
+}
diff --git a/wp-content/plugins/buddypress/bp-core/admin/css/wizard.css b/wp-content/plugins/buddypress/bp-core/admin/css/wizard.css
new file mode 100644
index 0000000000000000000000000000000000000000..98399d77d79cd9226a7bdc8e238b23382114cfc8
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-core/admin/css/wizard.css
@@ -0,0 +1 @@
+div#bp-wizard{color:#555;min-width:680px}div#bp-wizard p{line-height:170%}form#bp-wizard-form{margin:0 10px}div#bp-wizard-nav{background:#e0e0e0;margin:15px -10px 10px;padding:10px 10px 0 10px;height:30px;-moz-border-radius:2px;-webkit-border-radius:2px;border-radius:2px}div#bp-wizard-nav div.submit{position:relative;float:right;margin-top:-36px!important}div#bp-wizard-nav div.submit input{padding:6px 10px}div#bp-wizard-nav ol{list-style-type:decimal;margin:0;padding:0}div#bp-wizard-nav ol li{float:left;margin:0 10px 0 0;color:#666}div#bp-wizard-nav ol li{padding:8px 12px;display:block;-moz-border-radius:2px;-webkit-border-radius:2px;border-radius:2px;text-decoration:none}div#bp-wizard-nav ol li.current{background:#fff;color:#555}div#bp-wizard-nav ol li span.complete{background:url(../images/completed.gif) center left no-repeat;padding:6px}div.component{width:323px;float:left;margin:15px 30px 0 0}div.component div.radio{position:relative;background:#e0e0e0;padding:5px 10px;-moz-border-radius:2px;-webkit-border-radius:2px;border-radius:2px;top:-6px}div.component img{margin-top:10px}div.component p{margin-left:4px}div.component h5{font-size:18px;float:left;margin:0 0 0 4px;width:100px}div.component div.radio{font-size:11px;float:right;top:5px}div#bp-wizard div.prev-next,div#bp-wizard div.prev-next p,div#bp-wizard div.submit,div#bp-wizard div.submit p{margin:0;padding:0}div#bp-wizard div.submit{margin-top:30px}div#bp-wizard div.prev-next{text-align:right;margin-top:0}div#bp-wizard div.prev-next{margin:0 -20px;padding:0 20px 10px}div#bp-wizard table td{font-family:helvetica,arial,tahoma,sans-serif;vertical-align:top}div#bp-wizard table.form-table th{border-right:1px solid #eee;padding:15px 25px 15px 0;color:#555;vertical-align:top}div#bp-wizard table.form-table tr{border-bottom:1px dotted #f0f0f0}div#bp-wizard table.form-table td{padding-left:25px;font-size:12px}div#bp-wizard table.form-table th h5{font-size:14px;margin:0;line-height:150%}div#bp-wizard table.form-table th img{margin-top:5px}div#bp-wizard table.form-table th p{margin:3px 0 0 0}div#bp-wizard code,div#bp-wizard kbd{font-size:12px;background:#f0f0f0}div#bp-wizard div#message code,div#bp-wizard div#message kbd{background:#ffe293}a.button{padding-top:4px}a.installed,a.installed:hover,a.installed:active{padding-left:15px;color:#888;border-color:#ccc;cursor:default}a.installed span{background:url(../images/installed.gif) left center no-repeat;padding:6px 10px 7px 6px;margin-left:-5px}
\ No newline at end of file
diff --git a/wp-content/plugins/buddypress/bp-core/admin/css/wizard.dev.css b/wp-content/plugins/buddypress/bp-core/admin/css/wizard.dev.css
new file mode 100644
index 0000000000000000000000000000000000000000..ff3abcb234edaceff795087aea5e476ccc3e7bfe
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-core/admin/css/wizard.dev.css
@@ -0,0 +1,181 @@
+
+/* General Admin Styling
+------------------------------------------------------------------------------*/
+
+div#bp-wizard {
+	color: #555;
+	min-width: 680px;
+}
+div#bp-wizard p {
+	line-height: 170%;
+}
+
+form#bp-wizard-form {
+	margin: 0 10px;
+}
+
+div#bp-wizard-nav {
+	background: #e0e0e0;
+	margin: 15px -10px 10px;
+	padding: 10px 10px 0 10px;
+	height: 30px;
+	-moz-border-radius: 2px;
+	-webkit-border-radius: 2px;
+	border-radius: 2px;
+}
+div#bp-wizard-nav div.submit {
+	position: relative;
+	float: right;
+	margin-top: -36px !important;
+}
+div#bp-wizard-nav div.submit input {
+	padding: 6px 10px;
+}
+	div#bp-wizard-nav ol {
+		list-style-type: decimal;
+		margin: 0;
+		padding: 0;
+	}
+		div#bp-wizard-nav ol li {
+			float: left;
+			margin: 0 10px 0 0;
+			color: #666;
+		}
+			div#bp-wizard-nav ol li {
+				padding: 8px 12px;
+				display: block;
+				-moz-border-radius: 2px;
+				-webkit-border-radius: 2px;
+				border-radius: 2px;
+				text-decoration: none;
+			}
+				div#bp-wizard-nav ol li.current {
+					background: #fff;
+					color: #555;
+				}
+
+	div#bp-wizard-nav ol li span.complete {
+		background: url( ../images/completed.gif ) center left no-repeat;
+		padding: 6px;
+	}
+
+div.component {
+	width: 323px;
+	float: left;
+	margin: 15px 30px 0 0;
+}
+	div.component div.radio {
+		position: relative;
+		background: #e0e0e0;
+		padding: 5px 10px;
+		-moz-border-radius: 2px;
+		-webkit-border-radius: 2px;
+		border-radius: 2px;
+		top: -6px;
+	}
+
+	div.component img {
+		margin-top: 10px;
+	}
+
+	div.component p {
+		margin-left: 4px;
+	}
+
+	div.component h5 {
+		font-size: 18px;
+		float: left;
+		margin: 0 0 0 4px;
+		width: 100px;
+	}
+
+	div.component div.radio {
+		font-size: 11px;
+		float: right;
+		top: 5px;
+	}
+
+div#bp-wizard div.prev-next, div#bp-wizard div.prev-next p,
+div#bp-wizard div.submit, div#bp-wizard div.submit p {
+	margin: 0;
+	padding: 0;
+}
+div#bp-wizard div.submit {
+	margin-top: 30px;
+}
+div#bp-wizard div.prev-next {
+	text-align: right;
+	margin-top: 0;
+}
+
+div#bp-wizard div.prev-next {
+	margin: 0 -20px;
+	padding: 0 20px 10px;
+}
+
+div#bp-wizard table td {
+	font-family: helvetica, arial, tahoma, sans-serif;
+	vertical-align: top;
+}
+
+div#bp-wizard table.form-table th {
+	border-right: 1px solid #eee;
+	padding: 15px 25px 15px 0;
+	color: #555;
+	vertical-align: top;
+}
+	div#bp-wizard table.form-table tr {
+		border-bottom: 1px dotted #f0f0f0;
+	}
+	div#bp-wizard table.form-table td {
+		padding-left: 25px;
+		font-size: 12px;
+	}
+
+	div#bp-wizard table.form-table th h5 {
+		font-size: 14px;
+		margin: 0;
+		line-height: 150%;
+	}
+
+	div#bp-wizard table.form-table th img {
+		margin-top: 5px;
+		width: 300px;
+	}
+
+	div#bp-wizard table.form-table th p {
+		margin: 3px 0 0 0;
+	}
+
+#bp-wizard .widefat th {
+	vertical-align: top;
+	display: table-cell;
+}
+
+div#bp-wizard code, div#bp-wizard kbd {
+	font-size: 12px;
+	background: #f0f0f0;
+}
+
+div#bp-wizard div#message code, div#bp-wizard div#message kbd {
+	background: #ffe293;
+}
+
+a.button {
+	padding-top: 4px;
+}
+
+a.installed,
+a.installed:hover,
+a.installed:active {
+	padding-left: 15px;
+	color: #888;
+	border-color: #ccc;
+	cursor: default;
+}
+
+a.installed span {
+	background: url( ../images/installed.gif ) left center no-repeat;
+	padding: 6px 10px 7px 6px;
+	margin-left: -5px;
+}
diff --git a/wp-content/plugins/buddypress/bp-core/admin/images/completed.gif b/wp-content/plugins/buddypress/bp-core/admin/images/completed.gif
new file mode 100644
index 0000000000000000000000000000000000000000..aaca9881da38c2d5040e23d004e140f8a68b3144
Binary files /dev/null and b/wp-content/plugins/buddypress/bp-core/admin/images/completed.gif differ
diff --git a/wp-content/plugins/buddypress/bp-core/admin/images/find.png b/wp-content/plugins/buddypress/bp-core/admin/images/find.png
new file mode 100644
index 0000000000000000000000000000000000000000..7ef0e3746da73f097c9120f0b0ec58c45faf7d55
Binary files /dev/null and b/wp-content/plugins/buddypress/bp-core/admin/images/find.png differ
diff --git a/wp-content/plugins/buddypress/bp-core/admin/images/icons32.png b/wp-content/plugins/buddypress/bp-core/admin/images/icons32.png
new file mode 100644
index 0000000000000000000000000000000000000000..2cc8f004fbefa323ccadf52d444c1699920868ec
Binary files /dev/null and b/wp-content/plugins/buddypress/bp-core/admin/images/icons32.png differ
diff --git a/wp-content/plugins/buddypress/bp-core/admin/images/installed.gif b/wp-content/plugins/buddypress/bp-core/admin/images/installed.gif
new file mode 100644
index 0000000000000000000000000000000000000000..878b8bd300326793fb0392e7f98d9577e6940f26
Binary files /dev/null and b/wp-content/plugins/buddypress/bp-core/admin/images/installed.gif differ
diff --git a/wp-content/plugins/buddypress/bp-core/admin/images/menu-wp.png b/wp-content/plugins/buddypress/bp-core/admin/images/menu-wp.png
new file mode 100644
index 0000000000000000000000000000000000000000..bbb1c50ed0a66a3291088beb722f652fa39f6285
Binary files /dev/null and b/wp-content/plugins/buddypress/bp-core/admin/images/menu-wp.png differ
diff --git a/wp-content/plugins/buddypress/bp-core/admin/images/menu.png b/wp-content/plugins/buddypress/bp-core/admin/images/menu.png
new file mode 100644
index 0000000000000000000000000000000000000000..f0fa69328694322fc44c7b6ceabb2339c6a90414
Binary files /dev/null and b/wp-content/plugins/buddypress/bp-core/admin/images/menu.png differ
diff --git a/wp-content/plugins/buddypress/bp-core/admin/js/wizard.dev.js b/wp-content/plugins/buddypress/bp-core/admin/js/wizard.dev.js
new file mode 100644
index 0000000000000000000000000000000000000000..9d87b47d1619ab8fa26c43c3bb8276df231c0ac6
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-core/admin/js/wizard.dev.js
@@ -0,0 +1,11 @@
+jQuery(document).ready( function($) {
+	var toggle = $('#site-tracking-enabled');
+
+	if ( !$(toggle).is(':checked') ) {
+		$('#site-tracking-page-selector').hide();
+	}
+
+	$(toggle).click(function(){
+		$('#site-tracking-page-selector').toggle('fast');
+	});
+},jQuery );
\ No newline at end of file
diff --git a/wp-content/plugins/buddypress/bp-core/admin/js/wizard.js b/wp-content/plugins/buddypress/bp-core/admin/js/wizard.js
new file mode 100644
index 0000000000000000000000000000000000000000..e6a007f4b99e005e591eb33612122294be2fb575
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-core/admin/js/wizard.js
@@ -0,0 +1 @@
+jQuery(document).ready(function(b){var a=b("#site-tracking-enabled");if(!b(a).is(":checked")){b("#site-tracking-page-selector").hide()}b(a).click(function(){b("#site-tracking-page-selector").toggle("fast")})},jQuery);
\ No newline at end of file
diff --git a/wp-content/plugins/buddypress/bp-core/bp-core-actions.php b/wp-content/plugins/buddypress/bp-core/bp-core-actions.php
new file mode 100644
index 0000000000000000000000000000000000000000..523d7bb1b6e34ca89be1251a0fb1a53696fc9fb9
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-core/bp-core-actions.php
@@ -0,0 +1,267 @@
+<?php
+
+/**
+ * BuddyPress Filters & Actions
+ *
+ * @package BuddyPress
+ * @subpackage Hooks
+ *
+ * This file contains the actions and filters that are used through-out BuddyPress.
+ * They are consolidated here to make searching for them easier, and to help
+ * developers understand at a glance the order in which things occur.
+ *
+ */
+
+// Exit if accessed directly
+if ( !defined( 'ABSPATH' ) ) exit;
+
+/**
+ * Attach BuddyPress to WordPress
+ *
+ * BuddyPress uses its own internal actions to help aid in third-party plugin
+ * development, and to limit the amount of potential future code changes when
+ * updates to WordPress core occur.
+ *
+ * These actions exist to create the concept of 'plugin dependencies'. They
+ * provide a safe way for plugins to execute code *only* when BuddyPress is
+ * installed and activated, without needing to do complicated guesswork.
+ *
+ * For more information on how this works, see the 'Plugin Dependency' section
+ * near the bottom of this file.
+ *
+ *           v--WordPress Actions       v--BuddyPress Sub-actions
+  */
+add_action( 'plugins_loaded',          'bp_loaded',                 10    );
+add_action( 'init',                    'bp_init',                   10    );
+add_action( 'wp',                      'bp_ready',                  10    );
+add_action( 'setup_theme',             'bp_setup_theme',            10    );
+add_action( 'after_theme_setup',       'bp_after_theme_setup',      10    );
+add_action( 'wp_enqueue_scripts',      'bp_enqueue_scripts',        10    );
+add_action( 'admin_bar_menu',          'bp_setup_admin_bar',        20    ); // After WP core
+add_action( 'template_redirect',       'bp_template_redirect',      10    );
+add_action( 'widgets_init',            'bp_widgets_init',           10    );
+add_filter( 'template_include',        'bp_template_include',       10    );
+add_filter( 'map_meta_cap',            'bp_map_meta_caps',          10, 4 );
+
+/**
+ * bp_loaded - Attached to 'plugins_loaded' above
+ *
+ * Attach various loader actions to the bp_loaded action.
+ * The load order helps to execute code at the correct time.
+ *                                                 v---Load order
+ */
+add_action( 'bp_loaded', 'bp_setup_components',    2  );
+add_action( 'bp_loaded', 'bp_include',             4  );
+add_action( 'bp_loaded', 'bp_setup_widgets',       6  );
+add_action( 'bp_loaded', 'bp_core_load_admin_bar', 10 );
+
+/**
+ * bp_init - Attached to 'init' above
+ *
+ * Attach various initialization actions to the bp_init action.
+ * The load order helps to execute code at the correct time.
+ *                                                 v---Load order
+ */
+add_action( 'bp_init', 'bp_core_set_uri_globals',  2 );
+add_action( 'bp_init', 'bp_setup_globals',         4 );
+add_action( 'bp_init', 'bp_setup_nav',             6 );
+add_action( 'bp_init', 'bp_setup_title',           8 );
+
+/**
+ * bp_template_redirect - Attached to 'template_redirect' above
+ *
+ * Attach various template actions to the bp_template_redirect action.
+ * The load order helps to execute code at the correct time.
+ *
+ * Note that we currently use template_redirect versus template include because
+ * BuddyPress is a bully and overrides the existing themes output in many
+ * places. This won't always be this way, we promise.
+ *                                                	     v---Load order
+ */
+add_action( 'bp_template_redirect', 'bp_redirect_canonical', 2 );
+add_action( 'bp_template_redirect', 'bp_actions', 	     4 );
+add_action( 'bp_template_redirect', 'bp_screens', 	     6 );
+
+// Load the admin
+if ( is_admin() ) {
+	add_action( 'bp_loaded', 'bp_admin' );
+}
+
+/**
+ * Plugin Dependency
+ *
+ * The purpose of the following actions is to mimic the behavior of something
+ * called 'plugin dependency' which enables a plugin to have plugins of their
+ * own in a safe and reliable way.
+ *
+ * We do this in BuddyPress by mirroring existing WordPress actions in many places
+ * allowing dependant plugins to hook into the BuddyPress specific ones, thus
+ * guaranteeing proper code execution only whenBuddyPresss is active.
+ *
+ * The following functions are wrappers for their actions, allowing them to be
+ * manually called and/or piggy-backed on top of other actions if needed.
+ */
+
+/** Sub-actions ***************************************************************/
+
+/**
+ * Include files on this action
+ */
+function bp_include() {
+	do_action( 'bp_include' );
+}
+
+/**
+ * Include files on this action
+ */
+function bp_setup_components() {
+	do_action( 'bp_setup_components' );
+}
+
+/**
+ * Setup global variables and objects
+ */
+function bp_setup_globals() {
+	do_action( 'bp_setup_globals' );
+}
+
+/**
+ * Set navigation elements
+ */
+function bp_setup_nav() {
+	do_action( 'bp_setup_nav' );
+}
+
+/**
+ * Set up BuddyPress implementation of the WP Toolbar
+ */
+function bp_setup_admin_bar() {
+	if ( bp_use_wp_admin_bar() )
+		do_action( 'bp_setup_admin_bar' );
+}
+
+/**
+ * Set the page title
+ */
+function bp_setup_title() {
+	do_action( 'bp_setup_title' );
+}
+
+/**
+ * Register widgets
+ */
+function bp_setup_widgets() {
+	do_action( 'bp_register_widgets' );
+}
+
+/**
+ * Initlialize code
+ */
+function bp_init() {
+	do_action( 'bp_init' );
+}
+
+/**
+ * Attached to plugins_loaded
+ */
+function bp_loaded() {
+	do_action( 'bp_loaded' );
+}
+
+/**
+ * Attached to wp
+ */
+function bp_ready() {
+	do_action( 'bp_ready' );
+}
+
+/**
+ * Attach potential template actions
+ */
+function bp_actions() {
+	do_action( 'bp_actions' );
+}
+
+/**
+ * Attach potential template screens
+ */
+function bp_screens() {
+	do_action( 'bp_screens' );
+}
+
+/**
+ * Initialize widgets
+ */
+function bp_widgets_init() {
+	do_action ( 'bp_widgets_init' );
+}
+
+/** Theme *********************************************************************/
+
+/**
+ * Enqueue BuddyPress specific CSS and JS
+ *
+ * @since BuddyPress (1.6)
+ *
+ * @uses do_action() Calls 'bp_enqueue_scripts'
+ */
+function bp_enqueue_scripts() {
+	do_action ( 'bp_enqueue_scripts' );
+}
+
+/**
+ * Piggy back action for BuddyPress sepecific theme actions before the theme has
+ * been setup and the theme's functions.php has loaded.
+ *
+ * @since BuddyPress (1.6)
+ *
+ * @uses do_action() Calls 'bp_setup_theme'
+ */
+function bp_setup_theme() {
+	do_action ( 'bp_setup_theme' );
+}
+
+/**
+ * Piggy back action for BuddyPress sepecific theme actions once the theme has
+ * been setup and the theme's functions.php has loaded.
+ *
+ * @since BuddyPress (1.6)
+ *
+ * @uses do_action() Calls 'bp_after_theme_setup'
+ */
+function bp_after_theme_setup() {
+	do_action ( 'bp_after_theme_setup' );
+}
+
+/** Theme Compatibility Filter ************************************************/
+
+/**
+ * The main filter used for theme compatibility and displaying custom BuddyPress
+ * theme files.
+ *
+ * @since BuddyPress (1.6)
+ *
+ * @uses apply_filters()
+ *
+ * @param string $template
+ * @return string Template file to use
+ */
+function bp_template_include( $template = '' ) {
+	return apply_filters( 'bp_template_include', $template );
+}
+
+/** Theme Permissions *********************************************************/
+
+/**
+ * The main action used for redirecting BuddyPress theme actions that are not
+ * permitted by the current_user
+ *
+ * @since BuddyPress (1.6)
+ *
+ * @uses do_action()
+ */
+function bp_template_redirect() {
+	do_action( 'bp_template_redirect' );
+}
+
+?>
diff --git a/wp-content/plugins/buddypress/bp-core/bp-core-admin.php b/wp-content/plugins/buddypress/bp-core/bp-core-admin.php
index e81f114640414278ce32e6c156c0711af3fca227..2db359bd526f4f3daeb7874108175b3331fec827 100644
--- a/wp-content/plugins/buddypress/bp-core/bp-core-admin.php
+++ b/wp-content/plugins/buddypress/bp-core/bp-core-admin.php
@@ -1,251 +1,511 @@
 <?php
 
-function bp_core_admin_settings() {
-	global $wpdb, $bp, $current_blog;
-?>
+/**
+ * Main BuddyPress Admin Class
+ *
+ * @package BuddyPress
+ * @subpackage CoreAdministration
+ */
+
+// Exit if accessed directly
+if ( !defined( 'ABSPATH' ) ) exit;
+
+if ( !class_exists( 'BP_Admin' ) ) :
+/**
+ * Loads BuddyPress plugin admin area
+ *
+ * @package BuddyPress
+ * @subpackage CoreAdministration
+ * @since BuddyPress (1.6)
+ */
+class BP_Admin {
+
+	/**
+	 * Instance of the setup wizard
+	 *
+	 * @since BuddyPress (1.6)
+	 * @var BP_Core_Setup_Wizard
+	 */
+	public $wizard;
+
+	/** Directory *************************************************************/
+
+	/**
+	 * @var string Path to the BuddyPress admin directory
+	 */
+	public $admin_dir = '';
+
+	/** URLs ******************************************************************/
+
+	/**
+	 * @var string URL to the BuddyPress admin directory
+	 */
+	public $admin_url = '';
+
+	/**
+	 * @var string URL to the BuddyPress images directory
+	 */
+	public $images_url = '';
+
+	/**
+	 * @var string URL to the BuddyPress admin CSS directory
+	 */
+	public $css_url = '';
+
+	/**
+	 * @var string URL to the BuddyPress admin JS directory
+	 */
+	public $js_url = '';
+
+
+	/** Methods ***************************************************************/
+
+	/**
+	 * The main BuddyPress admin loader
+	 *
+	 * @since BuddyPress (1.6)
+	 *
+	 * @uses BBP_Admin::setup_globals() Setup the globals needed
+	 * @uses BBP_Admin::includes() Include the required files
+	 * @uses BBP_Admin::setup_actions() Setup the hooks and actions
+	 */
+	public function __construct() {
+		$this->setup_globals();
+		$this->includes();
+		$this->setup_actions();
+	}
 
-	<?php
-	if ( isset( $_POST['bp-admin-submit'] ) && isset( $_POST['bp-admin'] ) ) {
-		if ( !check_admin_referer('bp-admin') )
-			return false;
+	/**
+	 * Admin globals
+	 *
+	 * @since BuddyPress (1.6)
+	 * @access private
+	 */
+	private function setup_globals() {
+		global $bp;
 
-		// Settings form submitted, now save the settings.
-		foreach ( (array)$_POST['bp-admin'] as $key => $value ) {
+		// Admin url
+		$this->admin_dir  = trailingslashit( $bp->plugin_dir . 'bp-core/admin' );
 
-			if ( function_exists( 'xprofile_install' ) ) {
-				if ( 'bp-xprofile-base-group-name' == $key ) {
-					$wpdb->query( $wpdb->prepare( "UPDATE {$bp->profile->table_name_groups} SET name = %s WHERE id = 1", $value ) );
-				}
+		// Admin url
+		$this->admin_url  = trailingslashit( $bp->plugin_url . 'bp-core/admin' );
+
+		// Admin images URL
+		$this->images_url = trailingslashit( $this->admin_url . 'images' );
+
+		// Admin css URL
+		$this->css_url    = trailingslashit( $this->admin_url . 'css'    );
+
+		// Admin css URL
+		$this->js_url     = trailingslashit( $this->admin_url . 'js'     );
+	}
+
+	/**
+	 * Include required files
+	 *
+	 * @since BuddyPress (1.6)
+	 * @access private
+	 */
+	private function includes() {
+
+		// If in maintenance mode, only include updater and schema
+		if ( bp_get_maintenance_mode() ) {
+			require( $this->admin_dir . 'bp-core-schema.php' );
+			require( $this->admin_dir . 'bp-core-update.php' );
+
+		// No update needed so proceed with loading everything
+		} else {
+			require( $this->admin_dir . 'bp-core-settings.php'   );
+			require( $this->admin_dir . 'bp-core-functions.php'  );
+			require( $this->admin_dir . 'bp-core-components.php' );
+			require( $this->admin_dir . 'bp-core-slugs.php'      );
+		}
+	}
+
+	/**
+	 * Setup the admin hooks, actions and filters
+	 *
+	 * @since BuddyPress (1.6)
+	 * @access private
+	 *
+	 * @uses add_action() To add various actions
+	 * @uses add_filter() To add various filters
+	 */
+	private function setup_actions() {
+
+		// Start the wizard if in maintenance mode
+		if ( bp_get_maintenance_mode() ) {
+			add_action( bp_core_admin_hook(), array( $this, 'start_wizard' ), 2 );
+		}
+
+		/** General Actions ***************************************************/
+
+		// Attach the BuddyPress admin_init action to the WordPress admin_init action.
+		add_action( 'admin_init',            array( $this, 'admin_init'  ) );
+
+		// Add some page specific output to the <head>
+		add_action( 'admin_head',            array( $this, 'admin_head'  ) );
+
+		// Add menu item to settings menu
+		add_action( bp_core_admin_hook(),    array( $this, 'admin_menus' ), 5 );
+
+		// Add notice if not using a BuddyPress theme
+		add_action( 'admin_notices',         array( $this, 'admin_notices' ) );
+		add_action( 'network_admin_notices', array( $this, 'admin_notices' ) );
+
+		// Enqueue all admin JS and CSS
+		add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_scripts'   ) );
+
+		/** BuddyPress Actions ************************************************/
+
+		// Add settings
+		add_action( 'bp_admin_init',      array( $this, 'register_admin_settings' ) );
 
-				if ( 'bp-xprofile-fullname-field-name' == $key ) {
-					$wpdb->query( $wpdb->prepare( "UPDATE {$bp->profile->table_name_fields} SET name = %s WHERE group_id = 1 AND id = 1", $value ) );
+		/** Filters ***********************************************************/
+
+		// Add link to settings page
+		add_filter( 'plugin_action_links', array( $this, 'add_settings_link' ), 10, 2 );
+	}
+
+	public function start_wizard() {
+		$this->wizard = new BP_Core_Setup_Wizard;
+	}
+
+	/**
+	 * Add the navigational menu elements
+	 *
+	 * @since BuddyPress (1.6)
+	 *
+	 * @uses add_management_page() To add the Recount page in Tools section
+	 * @uses add_options_page() To add the Forums settings page in Settings
+	 *                           section
+	 */
+	public function admin_menus() {
+
+		// In maintenance mode
+		if ( bp_get_maintenance_mode() ) {
+
+			if ( !current_user_can( 'manage_options' ) )
+				return;
+
+			if ( bp_get_maintenance_mode() == 'install' )
+				$status = __( 'BuddyPress Setup', 'buddypress' );
+			else
+				$status = __( 'Update BuddyPress',  'buddypress' );
+
+			if ( bp_get_wizard() ) {
+				if ( ! is_multisite() || bp_is_multiblog_mode() ) {
+					$hook = add_dashboard_page( $status, $status, 'manage_options', 'bp-wizard', array( bp_get_wizard(), 'html' ) );
+				} else {
+					$hook = add_submenu_page( 'update-core.php', $status, $status, 'manage_options', 'bp-wizard', array( bp_get_wizard(), 'html' ) );
 				}
 			}
 
-			update_site_option( $key, $value );
+		// Not in maintenance mode
+		} else {
+
+			// Bail if user cannot moderate
+			if ( ! bp_current_user_can( 'manage_options' ) )
+				return;
+
+			$hooks = array();
+			$page  = bp_core_do_network_admin()  ? 'settings.php' : 'options-general.php';
+
+			// Changed in BP 1.6 . See bp_core_admin_backpat_menu()
+			$hooks[] = add_menu_page(
+				__( 'BuddyPress', 'buddypress' ),
+				__( 'BuddyPress', 'buddypress' ),
+				'manage_options',
+				'bp-general-settings',
+				'bp_core_admin_backpat_menu',
+				''
+			);
+
+			$hooks[] = add_submenu_page(
+				'bp-general-settings',
+				__( 'BuddyPress Help', 'buddypress' ),
+				__( 'Help', 'buddypress' ),
+				'manage_options',
+				'bp-general-settings',
+				'bp_core_admin_backpat_page'
+			);
+
+			// Add the option pages
+			$hooks[] = add_submenu_page(
+				$page,
+				__( 'BuddyPress Components', 'buddypress' ),
+				__( 'BuddyPress', 'buddypress' ),
+				'manage_options',
+				'bp-components',
+				'bp_core_admin_components_settings'
+			);
+
+			$hooks[] = add_submenu_page(
+				$page,
+				__( 'BuddyPress Pages', 'buddypress' ),
+				__( 'BuddyPress Pages', 'buddypress' ),
+				'manage_options',
+				'bp-page-settings',
+				'bp_core_admin_slugs_settings'
+			);
+
+			$hooks[] = add_submenu_page(
+				$page,
+				__( 'BuddyPress Settings', 'buddypress' ),
+				__( 'BuddyPress Settings', 'buddypress' ),
+				'manage_options',
+				'bp-settings',
+				'bp_core_admin_settings'
+			);
+
+			// Fudge the highlighted subnav item when on a BuddyPress admin page
+			foreach( $hooks as $hook ) {
+				add_action( "admin_head-$hook", 'bp_core_modify_admin_menu_highlight' );
+			}
 		}
 	}
-	?>
-
-	<div class="wrap">
-
-		<h2><?php _e( 'BuddyPress Settings', 'buddypress' ) ?></h2>
-
-		<?php if ( isset( $_POST['bp-admin'] ) ) : ?>
-			<div id="message" class="updated fade">
-				<p><?php _e( 'Settings Saved', 'buddypress' ) ?></p>
-			</div>
-		<?php endif; ?>
-
-		<form action="" method="post" id="bp-admin-form">
-
-			<table class="form-table">
-			<tbody>
-				<?php if ( function_exists( 'xprofile_install' ) ) :?>
-				<tr>
-					<th scope="row"><p><?php _e( 'Base profile group name', 'buddypress' ) ?>:</p></th>
-					<td>
-						<input name="bp-admin[bp-xprofile-base-group-name]" id="bp-xprofile-base-group-name" value="<?php echo get_site_option('bp-xprofile-base-group-name') ?>" />
-					</td>
-				</tr>
-				<tr>
-					<th scope="row"><p><?php _e( 'Full Name field name', 'buddypress' ) ?>:</p></th>
-					<td>
-						<input name="bp-admin[bp-xprofile-fullname-field-name]" id="bp-xprofile-fullname-field-name" value="<?php echo get_site_option('bp-xprofile-fullname-field-name') ?>" />
-					</td>
-				</tr>
-				<tr>
-					<th scope="row"><p><?php _e( 'Disable BuddyPress to WordPress profile syncing?', 'buddypress' ) ?>:</p></th>
-					<td>
-						<input type="radio" name="bp-admin[bp-disable-profile-sync]"<?php if ( (int)get_site_option( 'bp-disable-profile-sync' ) ) : ?> checked="checked"<?php endif; ?> id="bp-disable-profile-sync" value="1" /> <?php _e( 'Yes', 'buddypress' ) ?> &nbsp;
-						<input type="radio" name="bp-admin[bp-disable-profile-sync]"<?php if ( !(int)get_site_option( 'bp-disable-profile-sync' ) || '' == get_site_option( 'bp-disable-profile-sync' ) ) : ?> checked="checked"<?php endif; ?> id="bp-disable-profile-sync" value="0" /> <?php _e( 'No', 'buddypress' ) ?>
-					</td>
-				</tr>
-				<?php endif; ?>
-				<tr>
-					<th scope="row"><p><?php _e( 'Hide admin bar for logged out users?', 'buddypress' ) ?>:</p></th>
-					<td>
-						<input type="radio" name="bp-admin[hide-loggedout-adminbar]"<?php if ( (int)get_site_option( 'hide-loggedout-adminbar' ) ) : ?> checked="checked"<?php endif; ?> id="bp-admin-hide-loggedout-adminbar-yes" value="1" /> <?php _e( 'Yes', 'buddypress' ) ?> &nbsp;
-						<input type="radio" name="bp-admin[hide-loggedout-adminbar]"<?php if ( !(int)get_site_option( 'hide-loggedout-adminbar' ) ) : ?> checked="checked"<?php endif; ?> id="bp-admin-hide-loggedout-adminbar-no" value="0" /> <?php _e( 'No', 'buddypress' ) ?>
-					</td>
-				</tr>
-				<tr>
-					<th scope="row"><p><?php _e( 'Disable avatar uploads? (Gravatars will still work)', 'buddypress' ) ?>:</p></th>
-					<td>
-						<input type="radio" name="bp-admin[bp-disable-avatar-uploads]"<?php if ( (int)get_site_option( 'bp-disable-avatar-uploads' ) ) : ?> checked="checked"<?php endif; ?> id="bp-admin-disable-avatar-uploads-yes" value="1" /> <?php _e( 'Yes', 'buddypress' ) ?> &nbsp;
-						<input type="radio" name="bp-admin[bp-disable-avatar-uploads]"<?php if ( !(int)get_site_option( 'bp-disable-avatar-uploads' ) ) : ?> checked="checked"<?php endif; ?> id="bp-admin-disable-avatar-uploads-no" value="0" /> <?php _e( 'No', 'buddypress' ) ?>
-					</td>
-				</tr>
-				<tr>
-					<th scope="row"><p><?php _e( 'Disable user account deletion?', 'buddypress' ) ?>:</p></th>
-					<td>
-						<input type="radio" name="bp-admin[bp-disable-account-deletion]"<?php if ( (int)get_site_option( 'bp-disable-account-deletion' ) ) : ?> checked="checked"<?php endif; ?> id="bp-disable-account-deletion" value="1" /> <?php _e( 'Yes', 'buddypress' ) ?> &nbsp;
-						<input type="radio" name="bp-admin[bp-disable-account-deletion]"<?php if ( !(int)get_site_option( 'bp-disable-account-deletion' ) ) : ?> checked="checked"<?php endif; ?> id="bp-disable-account-deletion" value="0" /> <?php _e( 'No', 'buddypress' ) ?>
-					</td>
-				</tr>
-				<?php if ( function_exists( 'bp_forums_setup') ) : ?>
-				<tr>
-					<th scope="row"><p><?php _e( 'Disable global forum directory?', 'buddypress' ) ?>:</p></th>
-					<td>
-						<input type="radio" name="bp-admin[bp-disable-forum-directory]"<?php if ( (int)get_site_option( 'bp-disable-forum-directory' ) ) : ?> checked="checked"<?php endif; ?> id="bp-disable-forum-directory" value="1" /> <?php _e( 'Yes', 'buddypress' ) ?> &nbsp;
-						<input type="radio" name="bp-admin[bp-disable-forum-directory]"<?php if ( !(int)get_site_option( 'bp-disable-forum-directory' ) ) : ?> checked="checked"<?php endif; ?> id="bp-disable-forum-directory" value="0" /> <?php _e( 'No', 'buddypress' ) ?>
-					</td>
-				</tr>
-				<?php endif; ?>
-				<?php if ( function_exists( 'bp_activity_install') ) : ?>
-				<tr>
-					<th scope="row"><p><?php _e( 'Disable activity stream commenting on blog and forum posts?', 'buddypress' ) ?>:</p></th>
-					<td>
-						<input type="radio" name="bp-admin[bp-disable-blogforum-comments]"<?php if ( (int)get_site_option( 'bp-disable-blogforum-comments' ) || false === get_site_option( 'bp-disable-blogforum-comments' ) ) : ?> checked="checked"<?php endif; ?> id="bp-disable-blogforum-comments" value="1" /> <?php _e( 'Yes', 'buddypress' ) ?> &nbsp;
-						<input type="radio" name="bp-admin[bp-disable-blogforum-comments]"<?php if ( !(int)get_site_option( 'bp-disable-blogforum-comments' ) ) : ?> checked="checked"<?php endif; ?> id="bp-disable-blogforum-comments" value="0" /> <?php _e( 'No', 'buddypress' ) ?>
-					</td>
-				</tr>
-				<?php endif; ?>
-
-				<tr>
-					<th scope="row"><p><?php _e( 'Default User Avatar', 'buddypress' ) ?></p></th>
-					<td>
-						<p><?php _e( 'For users without a custom avatar of their own, you can either display a generic logo or a generated one based on their email address', 'buddypress' ) ?></p>
-
-						<label><input name="bp-admin[user-avatar-default]" id="avatar_mystery" value="mystery" type="radio" <?php if ( get_site_option( 'user-avatar-default' ) == 'mystery' ) : ?> checked="checked"<?php endif; ?> /> &nbsp;<img alt="" src="http://www.gravatar.com/avatar/<?php md5( strtolower( $ud->user_email ) ) ?>&amp;?s=32&amp;d=<?php echo BP_PLUGIN_URL . '/bp-core/images/mystery-man.jpg' ?>&amp;r=PG&amp;forcedefault=1" class="avatar avatar-32" height="32" width="32"> &nbsp;<?php _e( 'Mystery Man', 'buddypress' ) ?></label><br>
-						<label><input name="bp-admin[user-avatar-default]" id="avatar_identicon" value="identicon" type="radio" <?php if ( get_site_option( 'user-avatar-default' ) == 'identicon' ) : ?> checked="checked"<?php endif; ?> /> &nbsp;<img alt="" src="http://www.gravatar.com/avatar/<?php md5( strtolower( $ud->user_email ) ) ?>?s=32&amp;d=identicon&amp;r=PG&amp;forcedefault=1" class="avatar avatar-32" height="32" width="32"> &nbsp;<?php _e( 'Identicon (Generated)', 'buddypress' ) ?></label><br>
-						<label><input name="bp-admin[user-avatar-default]" id="avatar_wavatar" value="wavatar" type="radio" <?php if ( get_site_option( 'user-avatar-default' ) == 'wavatar' ) : ?> checked="checked"<?php endif; ?> /> &nbsp;<img alt="" src="http://www.gravatar.com/avatar/<?php md5( strtolower( $ud->user_email ) ) ?>?s=32&amp;d=wavatar&amp;r=PG&amp;forcedefault=1" class="avatar avatar-32" height="32" width="32"> &nbsp;<?php _e( 'Wavatar (Generated)', 'buddypress' ) ?> </label><br>
-						<label><input name="bp-admin[user-avatar-default]" id="avatar_monsterid" value="monsterid" type="radio" <?php if ( get_site_option( 'user-avatar-default' ) == 'monsterid' ) : ?> checked="checked"<?php endif; ?> /> &nbsp;<img alt="" src="http://www.gravatar.com/avatar/<?php md5( strtolower( $ud->user_email ) ) ?>?s=32&amp;d=monsterid&amp;r=PG&amp;forcedefault=1" class="avatar avatar-32" height="32" width="32"> &nbsp;<?php _e( 'MonsterID (Generated)', 'buddypress' ) ?></label>
-					</td>
-				</tr>
-
-				<?php do_action( 'bp_core_admin_screen_fields' ) ?>
-			</tbody>
-			</table>
-
-			<?php do_action( 'bp_core_admin_screen' ) ?>
-
-			<p class="submit">
-				<input class="button-primary" type="submit" name="bp-admin-submit" id="bp-admin-submit" value="<?php _e( 'Save Settings', 'buddypress' ) ?>"/>
-			</p>
-
-			<?php wp_nonce_field( 'bp-admin' ) ?>
-
-		</form>
-
-	</div>
 
-<?php
-}
+	/**
+	 * Register the settings
+	 *
+	 * @since BuddyPress (1.6)
+	 *
+	 * @uses add_settings_section() To add our own settings section
+	 * @uses add_settings_field() To add various settings fields
+	 * @uses register_setting() To register various settings
+	 * @uses do_action() Calls 'bp_register_admin_settings'
+	 */
+	public function register_admin_settings() {
+
+		/** Main Section ******************************************************/
+
+		// Add the main section
+		add_settings_section( 'bp_main',            __( 'Main Settings',    'buddypress' ), 'bp_admin_setting_callback_main_section',     'buddypress'            );
+
+		// Hide toolbar for logged out users setting
+		add_settings_field( 'hide-loggedout-adminbar',        __( 'Toolbar',        'buddypress' ), 'bp_admin_setting_callback_admin_bar',        'buddypress', 'bp_main' );
+	 	register_setting  ( 'buddypress',           'hide-loggedout-adminbar',        'intval'                                                                              );
+
+		// Only show 'switch to Toolbar' option if the user chose to retain the BuddyBar during the 1.6 upgrade
+		if ( (bool) bp_get_option( '_bp_force_buddybar', false ) ) {
+			add_settings_field( '_bp_force_buddybar', __( 'Toolbar', 'buddypress' ), 'bp_admin_setting_callback_force_buddybar', 'buddypress', 'bp_main' );
+		 	register_setting( 'buddypress', '_bp_force_buddybar', 'bp_admin_sanitize_callback_force_buddybar' );
+		}
 
-function bp_core_admin_component_setup() {
-	global $wpdb, $bp;
-?>
+		// Allow account deletion
+		add_settings_field( 'bp-disable-account-deletion', __( 'Account Deletion', 'buddypress' ), 'bp_admin_setting_callback_account_deletion', 'buddypress', 'bp_main' );
+	 	register_setting  ( 'buddypress',           'bp-disable-account-deletion', 'intval'                                                                              );
 
-	<?php
-	if ( isset( $_POST['bp-admin-component-submit'] ) && isset( $_POST['bp_components'] ) ) {
-		if ( !check_admin_referer('bp-admin-component-setup') )
-			return false;
+		/** XProfile Section **************************************************/
 
-		// Settings form submitted, now save the settings.
-		foreach ( (array)$_POST['bp_components'] as $key => $value ) {
-			if ( !(int) $value )
-				$disabled[$key] = 1;
+		if ( bp_is_active( 'xprofile' ) ) {
+
+			// Add the main section
+			add_settings_section( 'bp_xprofile',      __( 'Profile Settings', 'buddypress' ), 'bp_admin_setting_callback_xprofile_section', 'buddypress'                );
+
+			// Allow avatar uploads
+			add_settings_field( 'bp-disable-avatar-uploads', __( 'Avatar Uploads',   'buddypress' ), 'bp_admin_setting_callback_avatar_uploads',   'buddypress', 'bp_xprofile' );
+			register_setting  ( 'buddypress',         'bp-disable-avatar-uploads',   'intval'                                                                                  );
+
+			// Profile sync setting
+			add_settings_field( 'bp-disable-profile-sync',   __( 'Profile Syncing',  'buddypress' ), 'bp_admin_setting_callback_profile_sync',     'buddypress', 'bp_xprofile' );
+			register_setting  ( 'buddypress',         'bp-disable-profile-sync',     'intval'                                                                                  );
 		}
-		update_site_option( 'bp-deactivated-components', $disabled );
+
+		/** Groups Section ****************************************************/
+
+		if ( bp_is_active( 'groups' ) ) {
+
+			// Add the main section
+			add_settings_section( 'bp_groups',        __( 'Groups Settings',  'buddypress' ), 'bp_admin_setting_callback_groups_section',   'buddypress'              );
+
+			// Allow subscriptions setting
+			add_settings_field( 'bp_restrict_group_creation', __( 'Group Creation',   'buddypress' ), 'bp_admin_setting_callback_group_creation',   'buddypress', 'bp_groups' );
+			register_setting  ( 'buddypress',         'bp_restrict_group_creation',   'intval'                                                                                );
+		}
+
+		/** Forums ************************************************************/
+
+		if ( bp_is_active( 'forums' ) && bp_forums_is_installed_correctly() ) {
+
+			// Add the main section
+			add_settings_section( 'bp_forums',        __( 'Forums Settings',       'buddypress' ), 'bp_admin_setting_callback_bbpress_section',       'buddypress'              );
+
+			// Allow subscriptions setting
+			add_settings_field( 'bb-config-location', __( 'bbPress Configuration', 'buddypress' ), 'bp_admin_setting_callback_bbpress_configuration', 'buddypress', 'bp_forums' );
+			register_setting  ( 'buddypress',         'bb-config-location',        ''                                                                                           );
+		}
+
+		/** Activity Section **************************************************/
+
+		if ( bp_is_active( 'activity' ) ) {
+
+			// Add the main section
+			add_settings_section( 'bp_activity',      __( 'Activity Settings', 'buddypress' ), 'bp_admin_setting_callback_activity_section', 'buddypress'                );
+
+			// Activity commenting on blog and forum posts
+			add_settings_field( 'bp-disable-blogforum-comments', __( 'Blog &amp; Forum Comments', 'buddypress' ), 'bp_admin_setting_callback_blogforum_comments', 'buddypress', 'bp_activity' );
+			register_setting( 'buddypress', 'bp-disable-blogforum-comments', 'bp_admin_sanitize_callback_blogforum_comments' );
+
+			// Allow activity akismet
+			if ( is_plugin_active( 'akismet/akismet.php' ) && defined( 'AKISMET_VERSION' ) ) {
+				add_settings_field( '_bp_enable_akismet', __( 'Akismet',          'buddypress' ), 'bp_admin_setting_callback_activity_akismet', 'buddypress', 'bp_activity' );
+				register_setting  ( 'buddypress',         '_bp_enable_akismet',   'intval'                                                                                  );
+			}
+		}
+
+		do_action( 'bp_register_admin_settings' );
 	}
-	?>
-
-	<div class="wrap">
-
-		<h2><?php _e( 'BuddyPress Component Setup', 'buddypress' ) ?></h2>
-
-		<?php if ( isset( $_POST['bp-admin-component-submit'] ) ) : ?>
-			<div id="message" class="updated fade">
-				<p><?php _e( 'Settings Saved', 'buddypress' ) ?></p>
-			</div>
-		<?php endif; ?>
-
-		<form action="" method="post" id="bp-admin-component-form">
-
-			<p><?php _e('By default, all BuddyPress components are enabled. You can selectively disable any of the components by using the form below. Your BuddyPress installation will continue to function, however the features of the disabled components will no longer be accessible to anyone using the site.', 'buddypress' ) ?></p>
-
-			<?php $disabled_components = get_site_option( 'bp-deactivated-components' ); ?>
-
-			<table class="form-table" style="width: 80%">
-			<tbody>
-				<?php if ( file_exists( BP_PLUGIN_DIR . '/bp-activity.php') ) : ?>
-				<tr>
-					<td><h3><?php _e( 'Activity Streams', 'buddypress' ) ?></h3><p><?php _e( 'Allow users to post activity updates and track all activity across the entire site.', 'buddypress' ) ?></p></td>
-					<td>
-						<input type="radio" name="bp_components[bp-activity.php]" value="1"<?php if ( !isset( $disabled_components['bp-activity.php'] ) ) : ?> checked="checked" <?php endif; ?>/> <?php _e( 'Enabled', 'buddypress' ) ?> &nbsp;
-						<input type="radio" name="bp_components[bp-activity.php]" value="0"<?php if ( isset( $disabled_components['bp-activity.php'] ) ) : ?> checked="checked" <?php endif; ?>/> <?php _e( 'Disabled', 'buddypress' ) ?>
-					</td>
-				</tr>
-				<?php endif; ?>
-				<?php if ( file_exists( BP_PLUGIN_DIR . '/bp-blogs.php') && bp_core_is_multisite() ) : ?>
-				<tr>
-					<td><h3><?php _e( 'Blog Tracking', 'buddypress' ) ?></h3><p><?php _e( 'Tracks blogs, blog posts and blogs comments for a user across a WPMU installation.', 'buddypress' ) ?></p></td>
-					<td>
-						<input type="radio" name="bp_components[bp-blogs.php]" value="1"<?php if ( !isset( $disabled_components['bp-blogs.php'] ) ) : ?> checked="checked" <?php endif; ?>/> <?php _e( 'Enabled', 'buddypress' ) ?>  &nbsp;
-						<input type="radio" name="bp_components[bp-blogs.php]" value="0"<?php if ( isset( $disabled_components['bp-blogs.php'] ) ) : ?> checked="checked" <?php endif; ?>/> <?php _e( 'Disabled', 'buddypress' ) ?>
-					</td>
-				</tr>
-				<?php endif; ?>
-				<?php if ( file_exists( BP_PLUGIN_DIR . '/bp-forums.php') ) : ?>
-				<tr>
-					<td><h3><?php _e( 'bbPress Forums', 'buddypress' ) ?></h3><p><?php _e( 'Activates bbPress forum support within BuddyPress groups or any other custom component.', 'buddypress' ) ?></p></td>
-					<td>
-						<input type="radio" name="bp_components[bp-forums.php]" value="1"<?php if ( !isset( $disabled_components['bp-forums.php'] ) ) : ?> checked="checked" <?php endif; ?>/> <?php _e( 'Enabled', 'buddypress' ) ?>  &nbsp;
-						<input type="radio" name="bp_components[bp-forums.php]" value="0"<?php if ( isset( $disabled_components['bp-forums.php'] ) ) : ?> checked="checked" <?php endif; ?>/> <?php _e( 'Disabled', 'buddypress' ) ?>
-					</td>
-				</tr>
-				<?php endif; ?>
-				<?php if ( file_exists( BP_PLUGIN_DIR . '/bp-friends.php') ) : ?>
-				<tr>
-					<td><h3><?php _e( 'Friends', 'buddypress' ) ?></h3><p><?php _e( 'Allows the creation of friend connections between users.', 'buddypress' ) ?></p></td>
-					<td>
-						<input type="radio" name="bp_components[bp-friends.php]" value="1"<?php if ( !isset( $disabled_components['bp-friends.php'] ) ) : ?> checked="checked" <?php endif; ?>/> <?php _e( 'Enabled', 'buddypress' ) ?>  &nbsp;
-						<input type="radio" name="bp_components[bp-friends.php]" value="0"<?php if ( isset( $disabled_components['bp-friends.php'] ) ) : ?> checked="checked" <?php endif; ?>/> <?php _e( 'Disabled', 'buddypress' ) ?>
-					</td>
-				</tr>
-				<?php endif; ?>
-				<?php if ( file_exists( BP_PLUGIN_DIR . '/bp-groups.php') ) : ?>
-				<tr>
-					<td><h3><?php _e( 'Groups', 'buddypress' ) ?></h3><p><?php _e( 'Let users create, join and participate in groups.', 'buddypress' ) ?></p></td>
-					<td>
-						<input type="radio" name="bp_components[bp-groups.php]" value="1"<?php if ( !isset( $disabled_components['bp-groups.php'] ) ) : ?> checked="checked" <?php endif; ?>/> <?php _e( 'Enabled', 'buddypress' ) ?>  &nbsp;
-						<input type="radio" name="bp_components[bp-groups.php]" value="0"<?php if ( isset( $disabled_components['bp-groups.php'] ) ) : ?> checked="checked" <?php endif; ?>/> <?php _e( 'Disabled', 'buddypress' ) ?>
-					</td>
-				</tr>
-				<?php endif; ?>
-				<?php if ( file_exists( BP_PLUGIN_DIR . '/bp-messages.php') ) : ?>
-				<tr>
-					<td><h3><?php _e( 'Private Messaging', 'buddypress' ) ?></h3><p><?php _e( 'Let users send private messages to one another. Site admins can also send site-wide notices.', 'buddypress' ) ?></p></td>
-					<td>
-						<input type="radio" name="bp_components[bp-messages.php]" value="1"<?php if ( !isset( $disabled_components['bp-messages.php'] ) ) : ?> checked="checked" <?php endif; ?>/> <?php _e( 'Enabled', 'buddypress' ) ?>  &nbsp;
-						<input type="radio" name="bp_components[bp-messages.php]" value="0"<?php if ( isset( $disabled_components['bp-messages.php'] ) ) : ?> checked="checked" <?php endif; ?>/> <?php _e( 'Disabled', 'buddypress' ) ?>
-					</td>
-				</tr>
-				<?php endif; ?>
-				<?php if ( file_exists( BP_PLUGIN_DIR . '/bp-xprofile.php') ) : ?>
-				<tr>
-					<td><h3><?php _e( 'Extended Profiles', 'buddypress' ) ?></h3><p><?php _e( 'Activates customizable profiles and avatars for site users.', 'buddypress' ) ?></p></td>
-					<td width="45%">
-						<input type="radio" name="bp_components[bp-xprofile.php]" value="1"<?php if ( !isset( $disabled_components['bp-xprofile.php'] ) ) : ?> checked="checked" <?php endif; ?>/> <?php _e( 'Enabled', 'buddypress' ) ?>  &nbsp;
-						<input type="radio" name="bp_components[bp-xprofile.php]" value="0"<?php if ( isset( $disabled_components['bp-xprofile.php'] ) ) : ?> checked="checked" <?php endif; ?>/> <?php _e( 'Disabled', 'buddypress' ) ?>
-					</td>
-				</tr>
-				<?php endif; ?>
-			</tbody>
-			</table>
-
-			<p class="submit">
-				<input class="button-primary" type="submit" name="bp-admin-component-submit" id="bp-admin-component-submit" value="<?php _e( 'Save Settings', 'buddypress' ) ?>"/>
-			</p>
-
-			<?php wp_nonce_field( 'bp-admin-component-setup' ) ?>
-
-		</form>
-
-	</div>
 
-<?php
+	/**
+	 * Add Settings link to plugins area
+	 *
+	 * @since BuddyPress (1.6)
+	 *
+	 * @param array $links Links array in which we would prepend our link
+	 * @param string $file Current plugin basename
+	 * @return array Processed links
+	 */
+	public function add_settings_link( $links, $file ) {
+		global $bp;
+
+		if ( plugin_basename( $bp->file ) == $file ) {
+			$url           = bp_core_do_network_admin() ? network_admin_url( 'settings.php' ) : admin_url( 'options-general.php' );
+			$settings_link = '<a href="' . add_query_arg( array( 'page' => 'bp-components' ), $url ) . '">' . __( 'Settings', 'buddypress' ) . '</a>';
+			array_unshift( $links, $settings_link );
+		}
+
+		return $links;
+	}
+
+	/**
+	 * BuddyPress's dedicated admin init action
+	 *
+	 * @since BuddyPress (1.6)
+	 *
+	 * @uses do_action() Calls 'bp_admin_init'
+	 */
+	public function admin_init() {
+		do_action( 'bp_admin_init' );
+	}
+
+	/**
+	 * Add some general styling to the admin area
+	 *
+	 * @since BuddyPress (1.6)
+	 */
+	public function admin_head() { }
+
+	/**
+	 * Add some general styling to the admin area
+	 *
+	 * @since BuddyPress (1.6)
+	 */
+	public function enqueue_scripts() {
+
+		$maybe_dev = '';
+		if ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG )
+			$maybe_dev = '.dev';
+
+		$file = $this->css_url . "common{$maybe_dev}.css";
+		$file = apply_filters( 'bp_core_admin_common_css', $file );
+		wp_enqueue_style( 'bp-admin-common-css', $file, array(), bp_get_version() );
+
+		// Extra bits for the installation wizard
+		if ( bp_get_maintenance_mode() ) {
+
+			// Styling
+			$file = $this->css_url . "wizard{$maybe_dev}.css";
+			$file = apply_filters( 'bp_core_admin_wizard_css', $file );
+			wp_enqueue_style( 'bp-admin-wizard-css', $file, array(), bp_get_version() );
+
+			// JS
+			$file = $this->js_url . "wizard{$maybe_dev}.js";
+			$file = apply_filters( 'bp_core_admin_wizard_js', $file );
+			wp_enqueue_script( 'bp-admin-wizard-js', $file, array(), bp_get_version() );
+
+			// We'll need the thickbox too
+			wp_enqueue_script( 'thickbox' );
+			wp_enqueue_style( 'thickbox' );
+		}
+
+		do_action( 'bp_admin_head' );
+	}
+
+	/**
+	 * Add any admin notices we might need, mostly for update or new installs
+	 *
+	 * @since BuddyPress (1.6)
+	 *
+	 * @global string $pagenow
+	 * @return If no notice is needed
+	 */
+	public function admin_notices() {
+		global $pagenow;
+
+		// Bail if not in maintenance mode
+		if ( ! bp_get_maintenance_mode() )
+			return;
+
+		// Bail if user cannot manage options
+		if ( ! current_user_can( 'manage_options' ) )
+			return;
+
+		// Are we looking at a network?
+		if ( bp_core_do_network_admin() ) {
+
+			// Bail if looking at wizard page
+			if ( ( 'admin.php' == $pagenow ) && ( !empty( $_GET['page'] ) && ( 'bp-wizard' == $_GET['page'] ) ) ) {
+				return;
+			}
+
+			// Set the url for the nag
+			$url = network_admin_url( 'admin.php?page=bp-wizard' );
+
+		// Single site
+		} else {
+
+			// Bail if looking at wizard page
+			if ( ( 'index.php' == $pagenow ) && ( !empty( $_GET['page'] ) && ( 'bp-wizard' == $_GET['page'] ) ) ) {
+				return;
+			}
+
+			// Set the url for the nag
+			$url = admin_url( 'index.php?page=bp-wizard' );
+		}
+
+		// What does the nag say?
+		switch ( bp_get_maintenance_mode() ) {
+
+			// Update text
+			case 'update' :
+				$msg = sprintf( __( 'BuddyPress has been updated! Please run the <a href="%s">update wizard</a>.', 'buddypress' ), $url );
+				break;
+
+			// First install text
+			case 'install' : default :
+				$msg = sprintf( __( 'BuddyPress was successfully activated! Please run the <a href="%s">installation wizard</a>.', 'buddypress' ), $url );
+				break;
+		} ?>
+
+		<div class="update-nag"><?php echo $msg; ?></div>
+
+		<?php
+	}
+}
+endif; // class_exists check
+
+/**
+ * Setup BuddyPress Admin
+ *
+ * @since BuddyPress (1.6)
+ *
+ * @uses BP_Admin
+ */
+function bp_admin() {
+	global $bp;
+
+	$bp->admin = new BP_Admin();
 }
 
-?>
\ No newline at end of file
+?>
diff --git a/wp-content/plugins/buddypress/bp-core/bp-core-adminbar.php b/wp-content/plugins/buddypress/bp-core/bp-core-adminbar.php
index bbce16b1b58a2bb4710995481cd935cd74b05ab8..d7208f1457749cd9192b3303851f8d55494abeee 100644
--- a/wp-content/plugins/buddypress/bp-core/bp-core-adminbar.php
+++ b/wp-content/plugins/buddypress/bp-core/bp-core-adminbar.php
@@ -1,8 +1,9 @@
 <?php
+
 /**
- * BuddyPress Core Admin Bar
+ * BuddyPress Core Toolbar
  *
- * Handles the core functions related to the WordPress Admin Bar
+ * Handles the core functions related to the WordPress Toolbar
  *
  * @package BuddyPress
  * @subpackage Core
@@ -11,254 +12,65 @@
 // Exit if accessed directly
 if ( !defined( 'ABSPATH' ) ) exit;
 
-if ( !bp_use_wp_admin_bar() || defined( 'DOING_AJAX' ) )
-	return;
-
-/**
- * Adjust the admin bar menus based on which WordPress version this is
- *
- * @since BuddyPress (1.5.2)
- */
-function bp_core_admin_bar_version_check() {
-	if ( '3.2' == bp_get_major_wp_version() ) {
-		add_action( 'bp_setup_admin_bar', 'bp_admin_bar_root_site',       3 );
-		add_action( 'bp_setup_admin_bar', 'bp_admin_bar_comments_menu',   3 );
-		add_action( 'bp_setup_admin_bar', 'bp_admin_bar_appearance_menu', 3 );
-		add_action( 'bp_setup_admin_bar', 'bp_admin_bar_updates_menu',    3 );
-	}
-}
-add_action( 'admin_bar_menu', 'bp_core_admin_bar_version_check', 4 );
-
-/**
- * Unhook the WordPress core menus.
- *
- * @since BuddyPress (r4151)
- *
- * @uses remove_action
- * @uses is_network_admin()
- * @uses is_user_admin()
- */
-function bp_admin_bar_remove_wp_menus() {
-
-	if ( '3.2' == bp_get_major_wp_version() ) {
-		remove_action( 'admin_bar_menu', 'wp_admin_bar_my_account_menu', 10 );
-		remove_action( 'admin_bar_menu', 'wp_admin_bar_my_sites_menu', 20 );
-		remove_action( 'admin_bar_menu', 'wp_admin_bar_dashboard_view_site_menu', 25 );
-
-		// Don't show the 'Edit Page' menu on BP pages
-		if ( !bp_is_blog_page() )
-			remove_action( 'admin_bar_menu', 'wp_admin_bar_edit_menu', 30 );
-
-		remove_action( 'admin_bar_menu', 'wp_admin_bar_shortlink_menu', 80 );
-		remove_action( 'admin_bar_menu', 'wp_admin_bar_updates_menu', 70 );
-
-		if ( !is_network_admin() && !is_user_admin() ) {
-			remove_action( 'admin_bar_menu', 'wp_admin_bar_comments_menu', 50 );
-			remove_action( 'admin_bar_menu', 'wp_admin_bar_appearance_menu', 60 );
-		}
-
-		remove_action( 'admin_bar_menu', 'wp_admin_bar_updates_menu', 70 );
-	}
-}
-add_action( 'bp_init', 'bp_admin_bar_remove_wp_menus', 2 );
-
 /**
- * Add a menu for the root site of this BuddyPress network
+ * Adds the secondary BuddyPress area to the my-account menu
  *
- * @global type $bp
- * @global type $wp_admin_bar
- * @return If in ajax
+ * @since BuddyPress 1.6
+ * @global WP_Admin_Bar $wp_admin_bar
+ * @return If doing ajax
  */
-function bp_admin_bar_root_site() {
-	global $bp, $wp_admin_bar;
-
-	// Create the root blog menu
-	$wp_admin_bar->add_menu( array(
-		'id'    => 'bp-root-blog',
-		'title' => get_blog_option( bp_get_root_blog_id(), 'blogname' ),
-		'href'  => bp_get_root_domain()
-	) );
-
-	// Logged in user
-	if ( is_user_logged_in() ) {
-
-		// Dashboard links
-		if ( is_super_admin() ) {
-
-			// Add site admin link
-			$wp_admin_bar->add_menu( array(
-				'id' => 'dashboard',
-				'parent' => 'bp-root-blog',
-				'title' => __( 'Admin Dashboard', 'buddypress' ),
-				'href' => get_admin_url( bp_get_root_blog_id() )
-			) );
-
-			// Add network admin link
-			if ( is_multisite() ) {
-
-				// Link to the network admin dashboard
-				$wp_admin_bar->add_menu( array(
-					'id' => 'network-dashboard',
-					'parent' => 'bp-root-blog',
-					'title' => __( 'Network Dashboard', 'buddypress' ),
-					'href' => network_admin_url()
-				) );
-			}
-		}
-	}
-}
-
-/**
- * Add the "My Sites/[Site Name]" menu and all submenus.
- */
-function bp_admin_bar_my_sites_menu() {
-	global $wpdb, $wp_admin_bar;
-
-	/* Add the 'My Sites' menu if the user has more than one site. */
-	if ( count( $wp_admin_bar->user->blogs ) <= 1 )
-		return;
-
-	$wp_admin_bar->add_menu( array( 'id' => 'my-blogs', 'title' => __( 'My Sites' ), 'href' => admin_url( 'my-sites.php' ) ) );
-
-	$default = includes_url( 'images/wpmini-blue.png' );
-
-	foreach ( (array)$wp_admin_bar->user->blogs as $blog ) {
-		// @todo Replace with some favicon lookup.
-		//$blavatar = '<img src="' . esc_url( blavatar_url( blavatar_domain( $blog->siteurl ), 'img', 16, $default ) ) . '" alt="Blavatar" width="16" height="16" />';
-		$blavatar = '<img src="' . esc_url( $default ) . '" alt="' . esc_attr__( 'Blavatar' ) . '" width="16" height="16" class="blavatar"/>';
-
-		$blogname = empty( $blog->blogname ) ? $blog->domain : $blog->blogname;
-
-		$wp_admin_bar->add_menu( array( 'parent' => 'my-blogs', 'id' => 'blog-' . $blog->userblog_id, 'title' => $blavatar . $blogname, 'href' => get_admin_url( $blog->userblog_id ) ) );
-		$wp_admin_bar->add_menu( array( 'parent' => 'blog-' . $blog->userblog_id, 'id' => 'blog-' . $blog->userblog_id . '-d', 'title' => __( 'Dashboard' ), 'href' => get_admin_url( $blog->userblog_id ) ) );
-
-		if ( current_user_can_for_blog( $blog->userblog_id, 'edit_posts' ) ) {
-			$wp_admin_bar->add_menu( array( 'parent' => 'blog-' . $blog->userblog_id, 'id' => 'blog-' . $blog->userblog_id . '-n', 'title' => __( 'New Post' ), 'href' => get_admin_url( $blog->userblog_id, 'post-new.php' ) ) );
-			$wp_admin_bar->add_menu( array( 'parent' => 'blog-' . $blog->userblog_id, 'id' => 'blog-' . $blog->userblog_id . '-c', 'title' => __( 'Manage Comments' ), 'href' => get_admin_url( $blog->userblog_id, 'edit-comments.php' ) ) );
-		}
-
-		$wp_admin_bar->add_menu( array( 'parent' => 'blog-' . $blog->userblog_id, 'id' => 'blog-' . $blog->userblog_id . '-v', 'title' => __( 'Visit Site' ), 'href' => get_home_url( $blog->userblog_id ) ) );
-	}
-}
-
-/**
- * Add edit comments link with awaiting moderation count bubble
- */
-function bp_admin_bar_comments_menu( $wp_admin_bar ) {
-	global $wp_admin_bar;
-
-	if ( !current_user_can( 'edit_posts' ) )
-		return;
-
-	$awaiting_mod = wp_count_comments();
-	$awaiting_mod = $awaiting_mod->moderated;
-
-	$awaiting_mod = $awaiting_mod ? "<span id='ab-awaiting-mod' class='pending-count'>" . number_format_i18n( $awaiting_mod ) . "</span>" : '';
-	$wp_admin_bar->add_menu( array( 'parent' => 'dashboard', 'id' => 'comments', 'title' => sprintf( __( 'Comments %s' ), $awaiting_mod ), 'href' => admin_url( 'edit-comments.php' ) ) );
-}
-
-/**
- * Add "Appearance" menu with widget and nav menu submenu
- */
-function bp_admin_bar_appearance_menu() {
+function bp_admin_bar_my_account_root() {
 	global $wp_admin_bar;
 
-	// You can have edit_theme_options but not switch_themes.
-	if ( !current_user_can( 'switch_themes' ) && !current_user_can( 'edit_theme_options' ) )
+	// Bail if this is an ajax request
+	if ( !bp_use_wp_admin_bar() || defined( 'DOING_AJAX' ) )
 		return;
 
-	$wp_admin_bar->add_menu( array( 'parent' => 'dashboard', 'id' => 'appearance', 'title' => __( 'Appearance' ), 'href' => admin_url( 'themes.php' ) ) );
-
-	if ( !current_user_can( 'edit_theme_options' ) )
-		return;
-
-	if ( current_user_can( 'switch_themes' ) )
-		$wp_admin_bar->add_menu( array( 'parent' => 'appearance', 'id' => 'themes', 'title' => __( 'Themes' ), 'href' => admin_url( 'themes.php' ) ) );
-
-	if ( current_theme_supports( 'widgets' ) )
-		$wp_admin_bar->add_menu( array( 'parent' => 'appearance', 'id' => 'widgets', 'title' => __( 'Widgets' ), 'href' => admin_url( 'widgets.php' ) ) );
-
-	if ( current_theme_supports( 'menus' ) || current_theme_supports( 'widgets' ) )
-		$wp_admin_bar->add_menu( array( 'parent' => 'appearance', 'id' => 'menus', 'title' => __( 'Menus' ), 'href' => admin_url( 'nav-menus.php' ) ) );
-
-	if ( current_theme_supports( 'custom-background' ) )
-		$wp_admin_bar->add_menu( array( 'parent' => 'appearance', 'id' => 'background', 'title' => __( 'Background' ), 'href' => admin_url( 'themes.php?page=custom-background' ) ) );
-
-	if ( current_theme_supports( 'custom-header' ) )
-		$wp_admin_bar->add_menu( array( 'parent' => 'appearance', 'id' => 'header', 'title' => __( 'Header' ), 'href' => admin_url( 'themes.php?page=custom-header' ) ) );
-}
-
-/**
- * Provide an update link if theme/plugin/core updates are available
- */
-function bp_admin_bar_updates_menu() {
-	global $wp_admin_bar;
-
-	if ( !current_user_can( 'install_plugins' ) )
-		return;
-
-	$plugin_update_count = $theme_update_count = $wordpress_update_count = 0;
-	$update_plugins = get_site_transient( 'update_plugins' );
-	if ( !empty( $update_plugins->response ) )
-		$plugin_update_count = count( $update_plugins->response );
-	$update_themes = get_site_transient( 'update_themes' );
-	if ( !empty( $update_themes->response ) )
-		$theme_update_count = count( $update_themes->response );
-	/* @todo get_core_updates() is only available on admin page loads
-	  $update_wordpress = get_core_updates( array('dismissed' => false) );
-	  if ( !empty($update_wordpress) && !in_array( $update_wordpress[0]->response, array('development', 'latest') ) )
-	  $wordpress_update_count = 1;
-	 */
-
-	$update_count = $plugin_update_count + $theme_update_count + $wordpress_update_count;
-
-	if ( !$update_count )
-		return;
-
-	$update_title = array( );
-	if ( $wordpress_update_count )
-		$update_title[] = sprintf( __( '%d WordPress Update' ), $wordpress_update_count );
-	if ( $plugin_update_count )
-		$update_title[] = sprintf( _n( '%d Plugin Update', '%d Plugin Updates', $plugin_update_count ), $plugin_update_count );
-	if ( $theme_update_count )
-		$update_title[] = sprintf( _n( '%d Theme Update', '%d Theme Updates', $theme_update_count ), $theme_update_count );
-
-	$update_title = !empty( $update_title ) ? esc_attr( implode( ', ', $update_title ) ) : '';
-
-	$update_title = "<span title='$update_title'>";
-	$update_title .= sprintf( __( 'Updates %s' ), "<span id='ab-updates' class='update-count'>" . number_format_i18n( $update_count ) . '</span>' );
-	$update_title .= '</span>';
+	// Only add menu for logged in user
+	if ( is_user_logged_in() ) {
 
-	$wp_admin_bar->add_menu( array( 'parent' => 'dashboard', 'id' => 'updates', 'title' => $update_title, 'href' => network_admin_url( 'update-core.php' ) ) );
+		// Add secondary parent item for all BuddyPress components
+		$wp_admin_bar->add_menu( array(
+			'parent'    => 'my-account',
+			'id'        => 'my-account-buddypress',
+			'title'     => __( 'My Account' ),
+			'group'     => true,
+			'meta'      => array(
+				'class' => 'ab-sub-secondary'
+			)
+		) );
+	}
 }
+add_action( 'admin_bar_menu', 'bp_admin_bar_my_account_root', 100 );
 
 /**
- * Handle the Admin Bar CSS
+ * Handle the Toolbar CSS
+ *
+ * @since BuddyPress 1.5
  */
 function bp_core_load_admin_bar_css() {
-	global $wp_version;
 
-	if ( !bp_use_wp_admin_bar() )
+	if ( ! bp_use_wp_admin_bar() || ! is_admin_bar_showing() )
 		return;
 
-	// Admin bar styles
+	// Toolbar styles
 	if ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG )
-		$stylesheet = BP_PLUGIN_URL . '/bp-core/css/admin-bar.dev.css';
+		$stylesheet = BP_PLUGIN_URL . 'bp-core/css/admin-bar.dev.css';
 	else
-		$stylesheet = BP_PLUGIN_URL . '/bp-core/css/admin-bar.css';
+		$stylesheet = BP_PLUGIN_URL . 'bp-core/css/admin-bar.css';
 
-	wp_enqueue_style( 'bp-admin-bar', apply_filters( 'bp_core_admin_bar_css', $stylesheet ), array( 'admin-bar' ), '20110723' );
+	wp_enqueue_style( 'bp-admin-bar', apply_filters( 'bp_core_admin_bar_css', $stylesheet ), array( 'admin-bar' ), bp_get_version() );
 
 	if ( !is_rtl() )
 		return;
 
 	if ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG )
-		$stylesheet = BP_PLUGIN_URL . '/bp-core/css/admin-bar-rtl.dev.css';
+		$stylesheet = BP_PLUGIN_URL . 'bp-core/css/admin-bar-rtl.dev.css';
 	else
-		$stylesheet = BP_PLUGIN_URL . '/bp-core/css/admin-bar-rtl.css';
+		$stylesheet = BP_PLUGIN_URL . 'bp-core/css/admin-bar-rtl.css';
 
-	wp_enqueue_style( 'bp-admin-bar-rtl', apply_filters( 'bp_core_admin_bar_rtl_css', $stylesheet ), array( 'bp-admin-bar' ), '20110723' );
+	wp_enqueue_style( 'bp-admin-bar-rtl', apply_filters( 'bp_core_admin_bar_rtl_css', $stylesheet ), array( 'bp-admin-bar' ), bp_get_version() );
 }
 add_action( 'bp_init', 'bp_core_load_admin_bar_css' );
 
-?>
+?>
\ No newline at end of file
diff --git a/wp-content/plugins/buddypress/bp-core/bp-core-avatars.php b/wp-content/plugins/buddypress/bp-core/bp-core-avatars.php
index d4bbf30203e68a028838b2324b3e178a246ae052..3a5c025c4905fdd34c94e9194cc790f1e408f945 100644
--- a/wp-content/plugins/buddypress/bp-core/bp-core-avatars.php
+++ b/wp-content/plugins/buddypress/bp-core/bp-core-avatars.php
@@ -1,9 +1,7 @@
 <?php
+
 /**
  * BuddyPress Avatars
- *
- * Based on contributions from: Beau Lebens - http://www.dentedreality.com.au/
- * Modified for BuddyPress by: Andy Peatling - http://apeatling.wordpress.com/
  */
 
 // Exit if accessed directly
@@ -14,7 +12,7 @@ if ( !defined( 'ABSPATH' ) ) exit;
  */
 function bp_core_set_avatar_constants() {
 	global $bp;
-	
+
 	if ( !defined( 'BP_AVATAR_THUMB_WIDTH' ) )
 		define( 'BP_AVATAR_THUMB_WIDTH', 50 );
 
@@ -31,41 +29,54 @@ function bp_core_set_avatar_constants() {
 		define( 'BP_AVATAR_ORIGINAL_MAX_WIDTH', 450 );
 
 	if ( !defined( 'BP_AVATAR_ORIGINAL_MAX_FILESIZE' ) ) {
-		if ( !isset( $bp->site_options['fileupload_maxk'] ) )
+		if ( !isset( $bp->site_options['fileupload_maxk'] ) ) {
 			define( 'BP_AVATAR_ORIGINAL_MAX_FILESIZE', 5120000 ); // 5mb
-		else
+		} else {
 			define( 'BP_AVATAR_ORIGINAL_MAX_FILESIZE', $bp->site_options['fileupload_maxk'] * 1024 );
+		}
 	}
 
 	if ( !defined( 'BP_AVATAR_DEFAULT' ) )
-		define( 'BP_AVATAR_DEFAULT', BP_PLUGIN_URL . '/bp-core/images/mystery-man.jpg' );
+		define( 'BP_AVATAR_DEFAULT', BP_PLUGIN_URL . 'bp-core/images/mystery-man.jpg' );
 
 	if ( !defined( 'BP_AVATAR_DEFAULT_THUMB' ) )
-		define( 'BP_AVATAR_DEFAULT_THUMB', BP_PLUGIN_URL . '/bp-core/images/mystery-man-50.jpg' );
+		define( 'BP_AVATAR_DEFAULT_THUMB', BP_PLUGIN_URL . 'bp-core/images/mystery-man-50.jpg' );
 }
 add_action( 'bp_init', 'bp_core_set_avatar_constants', 3 );
 
 function bp_core_set_avatar_globals() {
 	global $bp;
-	
+
+	$bp->avatar        = new stdClass;
+	$bp->avatar->thumb = new stdClass;
+	$bp->avatar->full  = new stdClass;
+
 	// Dimensions
 	$bp->avatar->thumb->width  	   = BP_AVATAR_THUMB_WIDTH;
 	$bp->avatar->thumb->height 	   = BP_AVATAR_THUMB_HEIGHT;
 	$bp->avatar->full->width 	   = BP_AVATAR_FULL_WIDTH;
 	$bp->avatar->full->height 	   = BP_AVATAR_FULL_HEIGHT;
-	
+
 	// Upload maximums
 	$bp->avatar->original_max_width    = BP_AVATAR_ORIGINAL_MAX_WIDTH;
 	$bp->avatar->original_max_filesize = BP_AVATAR_ORIGINAL_MAX_FILESIZE;
-	
+
 	// Defaults
-	$bp->avatar->thumb->default 	   = BP_AVATAR_DEFAULT_THUMB;
-	$bp->avatar->full->default 	   = BP_AVATAR_DEFAULT;
-	
+	$bp->avatar->thumb->default = BP_AVATAR_DEFAULT_THUMB;
+	$bp->avatar->full->default 	= BP_AVATAR_DEFAULT;
+
 	// These have to be set on page load in order to avoid infinite filter loops at runtime
-	$bp->avatar->upload_path	   = bp_core_avatar_upload_path();
-	$bp->avatar->url	   	   = bp_core_avatar_url();
-	
+	$bp->avatar->upload_path = bp_core_avatar_upload_path();
+	$bp->avatar->url	   	 = bp_core_avatar_url();
+
+	// Backpat for pre-1.5
+	if ( ! defined( 'BP_AVATAR_UPLOAD_PATH' ) )
+		define( 'BP_AVATAR_UPLOAD_PATH', $bp->avatar->upload_path );
+
+	// Backpat for pre-1.5
+	if ( ! defined( 'BP_AVATAR_URL' ) )
+		define( 'BP_AVATAR_URL', $bp->avatar->url );
+
 	do_action( 'bp_core_set_avatar_globals' );
 }
 add_action( 'bp_setup_globals', 'bp_core_set_avatar_globals' );
@@ -76,7 +87,7 @@ add_action( 'bp_setup_globals', 'bp_core_set_avatar_globals' );
  * Fetches an avatar from a BuddyPress object. Supports user/group/blog as
  * default, but can be extended to include your own custom components too.
  *
- * @global object $bp Global BuddyPress settings object
+ * @global BuddyPress $bp The one true BuddyPress instance
  * @global $current_blog WordPress global containing information and settings for the current blog being viewed.
  * @param array $args Determine the output of this function
  * @return string Formatted HTML <img> element, or raw avatar URL based on $html arg
@@ -88,7 +99,6 @@ function bp_core_fetch_avatar( $args = '' ) {
 	$def_object = 'user';
 	$def_type   = 'thumb';
 	$def_class  = 'avatar';
-	$def_alt    = __( 'Avatar Image', 'buddypress' );
 
 	// Set the default variables array
 	$defaults = array(
@@ -100,7 +110,7 @@ function bp_core_fetch_avatar( $args = '' ) {
 		'height'     => false,       // Custom height (int)
 		'class'      => $def_class,  // Custom <img> class (string)
 		'css_id'     => false,       // Custom <img> ID (string)
-		'alt'        => $def_alt,    // Custom <img> alt (string)
+		'alt'        => '',    	     // Custom <img> alt (string)
 		'email'      => false,       // Pass the user email (for gravatar) to prevent querying the DB for it
 		'no_grav'    => false,       // If there is no avatar found, return false instead of a grav?
 		'html'       => true,        // Wrap the return img URL in <img />
@@ -111,76 +121,136 @@ function bp_core_fetch_avatar( $args = '' ) {
 	$params = wp_parse_args( $args, $defaults );
 	extract( $params, EXTR_SKIP );
 
-	// Set item_id if not passed
-	if ( !$item_id ) {
-		if ( 'user' == $object )
-			$item_id = $bp->displayed_user->id;
-		else if ( bp_is_active( 'groups' ) && 'group' == $object )
-			$item_id = $bp->groups->current_group->id;
-		else if ( 'blog' == $object )
-			$item_id = $current_blog->id;
+	/** Set item_id ***********************************************************/
 
-		$item_id = apply_filters( 'bp_core_avatar_item_id', $item_id, $object );
+	if ( empty( $item_id ) ) {
+
+		switch ( $object ) {
+
+			case 'blog'  :
+				$item_id = $current_blog->id;
+				break;
+
+			case 'group' :
+				if ( bp_is_active( 'groups' ) ) {
+					$item_id = $bp->groups->current_group->id;
+				} else {
+					$item_id = false;
+				}
+
+				break;
+
+			case 'user'  :
+			default      :
+				$item_id = bp_displayed_user_id();
+				break;
+		}
 
-		if ( !$item_id )
+		$item_id = apply_filters( 'bp_core_avatar_item_id', $item_id, $object, $params );
+
+		if ( empty( $item_id ) ) {
 			return false;
+		}
 	}
 
-	// Set avatar_dir if not passed (uses $object)
-	if ( !$avatar_dir ) {
-		if ( 'user' == $object )
-			$avatar_dir = 'avatars';
-		else if ( bp_is_active( 'groups' ) && 'group' == $object )
-			$avatar_dir = 'group-avatars';
-		else if ( 'blog' == $object )
-			$avatar_dir = 'blog-avatars';
+	$class = apply_filters( 'bp_core_avatar_class', $class, $item_id, $object, $params );
 
-		$avatar_dir = apply_filters( 'bp_core_avatar_dir', $avatar_dir, $object );
+	/** Set avatar_dir ********************************************************/
+
+	if ( empty( $avatar_dir ) ) {
+
+		switch ( $object ) {
+
+			case 'blog'  :
+				$avatar_dir = 'blog-avatars';
+				break;
+
+			case 'group' :
+				if ( bp_is_active( 'groups' ) ) {
+					$avatar_dir = 'group-avatars';
+				} else {
+					$avatar_dir = false;
+				}
+
+				break;
+
+			case 'user'  :
+			default      :
+				$avatar_dir = 'avatars';
+				break;
+		}
+
+		$avatar_dir = apply_filters( 'bp_core_avatar_dir', $avatar_dir, $object, $params );
 
-		if ( !$avatar_dir )
+		if ( empty( $avatar_dir ) ) {
 			return false;
+		}
 	}
 
-	// Add an identifying class to each item
-	$class .= ' ' . $object . '-' . $item_id . '-avatar';
+	/** <img> alt *************************************************************/
+
+	if ( false !== strpos( $alt, '%s' ) || false !== strpos( $alt, '%1$s' ) ) {
+
+		// Get item name for alt/title tags
+		$item_name = '';
 
-	// Get item name for alt/title tags
-	$item_name = '';
+		switch ( $object ) {
 
-	if ( 'user' == $object )
-		$item_name = bp_core_get_user_displayname( $item_id );
-	elseif ( 'group' == $object )
-		$item_name = bp_get_group_name( new BP_Groups_Group( $item_id ) );
-	elseif ( 'blog' == $object )
-		$item_name = get_blog_option( $item_id, 'blogname' );
+			case 'blog'  :
+				$item_name = get_blog_option( $item_id, 'blogname' );
+				break;
 
-	$alt = sprintf( $alt, apply_filters( 'bp_core_avatar_alt', $item_name, $item_id, $object ) );
+			case 'group' :
+				$item_name = bp_get_group_name( groups_get_group( array( 'group_id' => $item_id ) ) );
+				break;
 
-	// Set title tag
-	if ( $title )
-		$title = " title='" . esc_attr( apply_filters( 'bp_core_avatar_title', $title, $item_id, $object ) ) . "'";
-	elseif ( $item_name )
-		$title = " title='" . esc_attr( apply_filters( 'bp_core_avatar_title', $item_name, $item_id, $object ) ) . "'";
+			case 'user'  :
+			default :
+				$item_name = bp_core_get_user_displayname( $item_id );
+				break;
+		}
+
+		$item_name = apply_filters( 'bp_core_avatar_alt', $item_name, $item_id, $object, $params );
+		$alt       = sprintf( $alt, $item_name );
+	}
+
+	/** Sanity Checks *********************************************************/
+
+	// Get a fallback for the 'alt' parameter
+	if ( empty( $alt ) )
+		$alt = __( 'Avatar Image', 'buddypress' );
+
+	// Set title tag, if it's been provided
+	if ( !empty( $title ) )
+		$title = " title='" . esc_attr( apply_filters( 'bp_core_avatar_title', $title, $item_id, $object, $params ) ) . "'";
 
 	// Set CSS ID if passed
 	if ( !empty( $css_id ) )
-		$css_id = " id='{$css_id}'";
+		$css_id = ' id="' . $css_id . '"';
 
-	// Set avatar width
-	if ( $width )
-		$html_width = " width='{$width}'";
+	// Set image width
+	if ( false !== $width )
+		$html_width = ' width="' . $width . '"';
 	else
 		$html_width = ( 'thumb' == $type ) ? ' width="' . bp_core_avatar_thumb_width() . '"' : ' width="' . bp_core_avatar_full_width() . '"';
 
-	// Set avatar height
-	if ( $height )
-		$html_height = " height='{$height}'";
+	// Set image height
+	if ( false !== $height )
+		$html_height = ' height="' . $height . '"';
 	else
 		$html_height = ( 'thumb' == $type ) ? ' height="' . bp_core_avatar_thumb_height() . '"' : ' height="' . bp_core_avatar_full_height() . '"';
 
-	// Set avatar URL and DIR based on prepopulated constants
-	$avatar_folder_url = apply_filters( 'bp_core_avatar_folder_url', bp_core_avatar_url() . '/' . $avatar_dir . '/' . $item_id, $item_id, $object, $avatar_dir );
-	$avatar_folder_dir = apply_filters( 'bp_core_avatar_folder_dir', bp_core_avatar_upload_path() . '/' . $avatar_dir . '/' . $item_id, $item_id, $object, $avatar_dir );
+	// Set img URL and DIR based on prepopulated constants
+	$avatar_loc        = new stdClass();
+	$avatar_loc->path  = trailingslashit( bp_core_avatar_upload_path() );
+	$avatar_loc->url   = trailingslashit( bp_core_avatar_url() );
+
+	$avatar_loc->dir   = trailingslashit( $avatar_dir );
+	$avatar_folder_url = apply_filters( 'bp_core_avatar_folder_url', ( $avatar_loc->url  . $avatar_loc->dir . $item_id ), $item_id, $object, $avatar_dir );
+	$avatar_folder_dir = apply_filters( 'bp_core_avatar_folder_dir', ( $avatar_loc->path . $avatar_loc->dir . $item_id ), $item_id, $object, $avatar_dir );
+
+	// Add an identifying class
+	$class .= ' ' . $object . '-' . $item_id . '-avatar';
 
 	/****
 	 * Look for uploaded avatar first. Use it if it exists.
@@ -199,10 +269,11 @@ function bp_core_fetch_avatar( $args = '' ) {
 
 			// Stash files in an array once to check for one that matches
 			$avatar_files = array();
-			while ( false !== ( $avatar_file = readdir($av_dir) ) ) {
+			while ( false !== ( $avatar_file = readdir( $av_dir ) ) ) {
 				// Only add files to the array (skip directories)
-				if ( 2 < strlen( $avatar_file ) )
+				if ( 2 < strlen( $avatar_file ) ) {
 					$avatar_files[] = $avatar_file;
+				}
 			}
 
 			// Check for array
@@ -210,22 +281,25 @@ function bp_core_fetch_avatar( $args = '' ) {
 
 				// Check for current avatar
 				foreach( $avatar_files as $key => $value ) {
-					if ( strpos ( $value, $avatar_size )!== false )
+					if ( strpos ( $value, $avatar_size )!== false ) {
 						$avatar_url = $avatar_folder_url . '/' . $avatar_files[$key];
+					}
 				}
 
 				// Legacy avatar check
 				if ( !isset( $avatar_url ) ) {
 					foreach( $avatar_files as $key => $value ) {
-						if ( strpos ( $value, $legacy_user_avatar_name )!== false )
+						if ( strpos ( $value, $legacy_user_avatar_name )!== false ) {
 							$avatar_url = $avatar_folder_url . '/' . $avatar_files[$key];
+						}
 					}
 
 					// Legacy group avatar check
 					if ( !isset( $avatar_url ) ) {
 						foreach( $avatar_files as $key => $value ) {
-							if ( strpos ( $value, $legacy_group_avatar_name )!== false )
+							if ( strpos ( $value, $legacy_group_avatar_name )!== false ) {
 								$avatar_url = $avatar_folder_url . '/' . $avatar_files[$key];
+							}
 						}
 					}
 				}
@@ -255,20 +329,22 @@ function bp_core_fetch_avatar( $args = '' ) {
 	if ( ! apply_filters( 'bp_core_fetch_avatar_no_grav', $no_grav ) ) {
 
 		// Set gravatar size
-		if ( $width )
+		if ( false !== $width ) {
 			$grav_size = $width;
-		else if ( 'full' == $type )
+		} else if ( 'full' == $type ) {
 			$grav_size = bp_core_avatar_full_width();
-		else if ( 'thumb' == $type )
+		} else if ( 'thumb' == $type ) {
 			$grav_size = bp_core_avatar_thumb_width();
+		}
 
 		// Set gravatar type
-		if ( empty( $bp->grav_default->{$object} ) )
+		if ( empty( $bp->grav_default->{$object} ) ) {
 			$default_grav = 'wavatar';
-		else if ( 'mystery' == $bp->grav_default->{$object} )
+		} else if ( 'mystery' == $bp->grav_default->{$object} ) {
 			$default_grav = apply_filters( 'bp_core_mysteryman_src', bp_core_avatar_default(), $grav_size );
-		else
+		} else {
 			$default_grav = $bp->grav_default->{$object};
+		}
 
 		// Set gravatar object
 		if ( empty( $email ) ) {
@@ -280,18 +356,23 @@ function bp_core_fetch_avatar( $args = '' ) {
 		}
 
 		// Set host based on if using ssl
-		if ( is_ssl() )
+		$host = 'http://www.gravatar.com/avatar/';
+		if ( is_ssl() ) {
 			$host = 'https://secure.gravatar.com/avatar/';
-		else
-			$host = 'http://www.gravatar.com/avatar/';
+		}
 
 		// Filter gravatar vars
 		$email    = apply_filters( 'bp_core_gravatar_email', $email, $item_id, $object );
 		$gravatar = apply_filters( 'bp_gravatar_url', $host ) . md5( strtolower( $email ) ) . '?d=' . $default_grav . '&amp;s=' . $grav_size;
 
+		// Gravatar rating; http://bit.ly/89QxZA
+		$rating = get_option( 'avatar_rating' );
+		if ( ! empty( $rating ) )
+			$gravatar .= "&amp;r={$rating}";
+
+	// No avatar was found, and we've been told not to use a gravatar.
 	} else {
-		// No avatar was found, and we've been told not to use a gravatar.
-		$gravatar = apply_filters( "bp_core_default_avatar_$object", BP_PLUGIN_URL . '/bp-core/images/mystery-man.jpg', $params );
+		$gravatar = apply_filters( "bp_core_default_avatar_$object", BP_PLUGIN_URL . 'bp-core/images/mystery-man.jpg', $params );
 	}
 
 	if ( true === $html )
@@ -324,9 +405,9 @@ function bp_core_delete_existing_avatar( $args = '' ) {
 	$args = wp_parse_args( $args, $defaults );
 	extract( $args, EXTR_SKIP );
 
-	if ( !$item_id ) {
+	if ( empty( $item_id ) ) {
 		if ( 'user' == $object )
-			$item_id = $bp->displayed_user->id;
+			$item_id = bp_displayed_user_id();
 		else if ( 'group' == $object )
 			$item_id = $bp->groups->current_group->id;
 		else if ( 'blog' == $object )
@@ -337,7 +418,7 @@ function bp_core_delete_existing_avatar( $args = '' ) {
 		if ( !$item_id ) return false;
 	}
 
-	if ( !$avatar_dir ) {
+	if ( empty( $avatar_dir ) ) {
 		if ( 'user' == $object )
 			$avatar_dir = 'avatars';
 		else if ( 'group' == $object )
@@ -394,7 +475,6 @@ function bp_core_avatar_handle_upload( $file, $upload_dir_filter ) {
 	if ( !apply_filters( 'bp_core_pre_avatar_handle_upload', true, $file, $upload_dir_filter ) )
 		return true;
 
-	require_once( ABSPATH . '/wp-admin/includes/image.php' );
 	require_once( ABSPATH . '/wp-admin/includes/file.php' );
 
 	$uploadErrors = array(
@@ -433,27 +513,46 @@ function bp_core_avatar_handle_upload( $file, $upload_dir_filter ) {
 	}
 
 	// Get image size
-	$size = @getimagesize( $bp->avatar_admin->original['file'] );
+	$size  = @getimagesize( $bp->avatar_admin->original['file'] );
+	$error = false;
 
 	// Check image size and shrink if too large
 	if ( $size[0] > bp_core_avatar_original_max_width() ) {
-		$thumb = wp_create_thumbnail( $bp->avatar_admin->original['file'], bp_core_avatar_original_max_width() );
+		$editor = wp_get_image_editor( $bp->avatar_admin->original['file'] );
 
-		// Check for thumbnail creation errors
-		if ( is_wp_error( $thumb ) ) {
-			bp_core_add_message( sprintf( __( 'Upload Failed! Error was: %s', 'buddypress' ), $thumb->get_error_message() ), 'error' );
-			return false;
+		if ( ! is_wp_error( $editor ) ) {
+			$editor->set_quality( 100 );
+
+			$resized = $editor->resize( bp_core_avatar_original_max_width(), bp_core_avatar_original_max_width(), false );
+			if ( ! is_wp_error( $resized ) )
+				$thumb = $editor->save( $editor->generate_filename() );
+			else
+				$error = $resized;
+
+			// Check for thumbnail creation errors
+			if ( false === $error && is_wp_error( $thumb ) )
+				$error = $thumb;
+
+			if ( false === $error ) {
+				// Thumbnail is good so proceed
+				$bp->avatar_admin->resized = $thumb;
+			}
+
+		} else {
+			$error = $editor;
 		}
 
-		// Thumbnail is good so proceed
-		$bp->avatar_admin->resized = $thumb;
+		if ( false !== $error ) {
+			bp_core_add_message( sprintf( __( 'Upload Failed! Error was: %s', 'buddypress' ), $error->get_error_message() ), 'error' );
+			return false;
+		}
 	}
 
 	// We only want to handle one image after resize.
 	if ( empty( $bp->avatar_admin->resized ) )
 		$bp->avatar_admin->image->dir = str_replace( bp_core_avatar_upload_path(), '', $bp->avatar_admin->original['file'] );
 	else {
-		$bp->avatar_admin->image->dir = str_replace( bp_core_avatar_upload_path(), '', $bp->avatar_admin->resized );
+		$bp->avatar_admin->image->dir = str_replace( bp_core_avatar_upload_path(), '', $bp->avatar_admin->resized['path'] );
 		@unlink( $bp->avatar_admin->original['file'] );
 	}
 
@@ -482,12 +581,10 @@ function bp_core_avatar_handle_upload( $file, $upload_dir_filter ) {
  *  crop_x - The horizontal starting point of the crop
  *  crop_y - The vertical starting point of the crop
  *
- * @global object $bp BuddyPress global settings
  * @param mixed $args
  * @return bool Success/failure
  */
 function bp_core_avatar_handle_crop( $args = '' ) {
-	global $bp;
 
 	$defaults = array(
 		'object'        => 'user',
@@ -534,10 +631,10 @@ function bp_core_avatar_handle_crop( $args = '' ) {
 	bp_core_delete_existing_avatar( array( 'object' => $object, 'avatar_path' => $avatar_folder_dir ) );
 
 	// Make sure we at least have a width and height for cropping
-	if ( !(int)$crop_w )
+	if ( !(int) $crop_w )
 		$crop_w = bp_core_avatar_full_width();
 
-	if ( !(int)$crop_h )
+	if ( !(int) $crop_h )
 		$crop_h = bp_core_avatar_full_height();
 
 	// Set the full and thumb filenames
@@ -545,8 +642,12 @@ function bp_core_avatar_handle_crop( $args = '' ) {
 	$thumb_filename = wp_hash( $original_file . time() ) . '-bpthumb.jpg';
 
 	// Crop the image
-	$full_cropped  = wp_crop_image( $original_file, (int)$crop_x, (int)$crop_y, (int)$crop_w, (int)$crop_h, bp_core_avatar_full_width(), bp_core_avatar_full_height(), false, $avatar_folder_dir . '/' . $full_filename );
-	$thumb_cropped = wp_crop_image( $original_file, (int)$crop_x, (int)$crop_y, (int)$crop_w, (int)$crop_h, bp_core_avatar_thumb_width(), bp_core_avatar_thumb_height(), false, $avatar_folder_dir . '/' . $thumb_filename );
+	$full_cropped  = wp_crop_image( $original_file, (int) $crop_x, (int) $crop_y, (int) $crop_w, (int) $crop_h, bp_core_avatar_full_width(), bp_core_avatar_full_height(), false, $avatar_folder_dir . '/' . $full_filename );
+	$thumb_cropped = wp_crop_image( $original_file, (int) $crop_x, (int) $crop_y, (int) $crop_w, (int) $crop_h, bp_core_avatar_thumb_width(), bp_core_avatar_thumb_height(), false, $avatar_folder_dir . '/' . $thumb_filename );
+
+	// Check for errors
+	if ( ! $full_cropped || ! $thumb_cropped || is_wp_error( $full_cropped ) || is_wp_error( $thumb_cropped ) )
+		return false;
 
 	// Remove the original
 	@unlink( $original_file );
@@ -592,7 +693,7 @@ function bp_core_fetch_avatar_filter( $avatar, $user, $size, $default, $alt = ''
 		return !empty( $avatar ) ? $avatar : $default;
 
 	if ( !$alt )
-		$alt = __( 'Avatar of %s', 'buddypress' );
+		$alt = sprintf( __( 'Avatar of %s', 'buddypress' ), bp_core_get_user_displayname( $id ) );
 
 	// Let BuddyPress handle the fetching of the avatar
 	$bp_avatar = bp_core_fetch_avatar( array( 'item_id' => $id, 'width' => $size, 'height' => $size, 'alt' => $alt ) );
@@ -653,7 +754,7 @@ function bp_core_check_avatar_type($file) {
  */
 function bp_core_avatar_upload_path() {
 	global $bp;
-	
+
 	// See if the value has already been calculated and stashed in the $bp global
 	if ( isset( $bp->avatar->upload_path ) ) {
 		$basedir = $bp->avatar->upload_path;
@@ -662,26 +763,30 @@ function bp_core_avatar_upload_path() {
 		if ( defined( 'BP_AVATAR_UPLOAD_PATH' ) ) {
 			$basedir = BP_AVATAR_UPLOAD_PATH;
 		} else {
+			if ( !bp_is_root_blog() ) {
+				// Switch dynamically in order to support BP_ENABLE_MULTIBLOG
+				switch_to_blog( bp_get_root_blog_id() );
+			}
+
 			// Get upload directory information from current site
 			$upload_dir = wp_upload_dir();
-		
+
 			// Directory does not exist and cannot be created
 			if ( !empty( $upload_dir['error'] ) ) {
 				$basedir = '';
-		
+
 			} else {
 				$basedir = $upload_dir['basedir'];
-		
-				// If multisite, and current blog does not match root blog, make adjustments
-				if ( is_multisite() && bp_get_root_blog_id() != get_current_blog_id() )
-					$basedir = get_blog_option( bp_get_root_blog_id(), 'upload_path' );
 			}
+
+			// Will bail if not switched
+			restore_current_blog();
 		}
-		
+
 		// Stash in $bp for later use
 		$bp->avatar->upload_path = $basedir;
 	}
-	
+
 	return apply_filters( 'bp_core_avatar_upload_path', $basedir );
 }
 
@@ -695,10 +800,11 @@ function bp_core_avatar_upload_path() {
  */
 function bp_core_avatar_url() {
 	global $bp;
-	
+
 	// See if the value has already been calculated and stashed in the $bp global
 	if ( isset( $bp->avatar->url ) ) {
 		$baseurl = $bp->avatar->url;
+
 	} else {
 		// If this value has been set in a constant, just use that
 		if ( defined( 'BP_AVATAR_URL' ) ) {
@@ -706,20 +812,24 @@ function bp_core_avatar_url() {
 		} else {
 			// Get upload directory information from current site
 			$upload_dir = wp_upload_dir();
-		
+
 			// Directory does not exist and cannot be created
 			if ( !empty( $upload_dir['error'] ) ) {
 				$baseurl = '';
-		
+
 			} else {
 				$baseurl = $upload_dir['baseurl'];
-		
+
+				// If we're using https, update the protocol. Workaround for WP13941, WP15928, WP19037.
+				if ( is_ssl() )
+					$baseurl = str_replace( 'http://', 'https://', $baseurl );
+
 				// If multisite, and current blog does not match root blog, make adjustments
 				if ( is_multisite() && bp_get_root_blog_id() != get_current_blog_id() )
 					$baseurl = trailingslashit( get_blog_option( bp_get_root_blog_id(), 'home' ) ) . get_blog_option( bp_get_root_blog_id(), 'upload_path' );
 			}
 		}
-		
+
 		// Stash in $bp for later use
 		$bp->avatar->url = $baseurl;
 	}
@@ -727,11 +837,30 @@ function bp_core_avatar_url() {
 	return apply_filters( 'bp_core_avatar_url', $baseurl );
 }
 
+/**
+ * Check if a given user ID has an uploaded avatar
+ *
+ * @since BuddyPress (1.0)
+ * @param int $user_id
+ * @return boolean
+ */
+function bp_get_user_has_avatar( $user_id = 0 ) {
+
+	if ( empty( $user_id ) )
+		$user_id = bp_displayed_user_id();
+
+	$retval = false;
+	if ( bp_core_fetch_avatar( array( 'item_id' => $user_id, 'no_grav' => true, 'html' => false ) ) != bp_core_avatar_default() )
+		$retval = true;
+
+	return (bool) apply_filters( 'bp_get_user_has_avatar', $retval, $user_id );
+}
+
 /**
  * Utility function for fetching an avatar dimension setting
  *
  * @package BuddyPress
- * @since 1.5
+ * @since BuddyPress (1.5)
  *
  * @param str $type 'thumb' for thumbs, otherwise full
  * @param str $h_or_w 'height' for height, otherwise width
@@ -739,9 +868,9 @@ function bp_core_avatar_url() {
  */
 function bp_core_avatar_dimension( $type = 'thumb', $h_or_w = 'height' ) {
 	global $bp;
-	
-	$dim = isset( $bp->avatar->{$type}->{$h_or_w} ) ? (int)$bp->avatar->{$type}->{$h_or_w} : false;
-	
+
+	$dim = isset( $bp->avatar->{$type}->{$h_or_w} ) ? (int) $bp->avatar->{$type}->{$h_or_w} : false;
+
 	return apply_filters( 'bp_core_avatar_dimension', $dim, $type, $h_or_w );
 }
 
@@ -749,7 +878,7 @@ function bp_core_avatar_dimension( $type = 'thumb', $h_or_w = 'height' ) {
  * Get the avatar thumb width setting
  *
  * @package BuddyPress
- * @since 1.5
+ * @since BuddyPress (1.5)
  *
  * @return int The thumb width
  */
@@ -761,7 +890,7 @@ function bp_core_avatar_thumb_width() {
  * Get the avatar thumb height setting
  *
  * @package BuddyPress
- * @since 1.5
+ * @since BuddyPress (1.5)
  *
  * @return int The thumb height
  */
@@ -773,7 +902,7 @@ function bp_core_avatar_thumb_height() {
  * Get the avatar full width setting
  *
  * @package BuddyPress
- * @since 1.5
+ * @since BuddyPress (1.5)
  *
  * @return int The full width
  */
@@ -785,7 +914,7 @@ function bp_core_avatar_full_width() {
  * Get the avatar full height setting
  *
  * @package BuddyPress
- * @since 1.5
+ * @since BuddyPress (1.5)
  *
  * @return int The full height
  */
@@ -797,41 +926,41 @@ function bp_core_avatar_full_height() {
  * Get the max width for original avatar uploads
  *
  * @package BuddyPress
- * @since 1.5
+ * @since BuddyPress (1.5)
  *
  * @return int The width
  */
 function bp_core_avatar_original_max_width() {
 	global $bp;
-	
-	return apply_filters( 'bp_core_avatar_original_max_width', (int)$bp->avatar->original_max_width );
+
+	return apply_filters( 'bp_core_avatar_original_max_width', (int) $bp->avatar->original_max_width );
 }
 
 /**
  * Get the max filesize for original avatar uploads
  *
  * @package BuddyPress
- * @since 1.5
+ * @since BuddyPress (1.5)
  *
  * @return int The filesize
  */
 function bp_core_avatar_original_max_filesize() {
 	global $bp;
-	
-	return apply_filters( 'bp_core_avatar_original_max_filesize', (int)$bp->avatar->original_max_filesize );
+
+	return apply_filters( 'bp_core_avatar_original_max_filesize', (int) $bp->avatar->original_max_filesize );
 }
 
 /**
  * Get the default avatar
  *
  * @package BuddyPress
- * @since 1.5
+ * @since BuddyPress (1.5)
  *
  * @return int The URL of the default avatar
  */
 function bp_core_avatar_default() {
 	global $bp;
-	
+
 	return apply_filters( 'bp_core_avatar_default', $bp->avatar->full->default );
 }
 
@@ -839,13 +968,13 @@ function bp_core_avatar_default() {
  * Get the default avatar thumb
  *
  * @package BuddyPress
- * @since 1.5
+ * @since BuddyPress (1.5)
  *
  * @return int The URL of the default avatar thumb
  */
 function bp_core_avatar_default_thumb() {
 	global $bp;
-	
+
 	return apply_filters( 'bp_core_avatar_thumb', $bp->avatar->thumb->default );
 }
 
diff --git a/wp-content/plugins/buddypress/bp-core/bp-core-buddybar.php b/wp-content/plugins/buddypress/bp-core/bp-core-buddybar.php
index 0cd1b0ba23d4d19e26ab17cbee04cbf4001d4b5a..81adbe09d65296fa698cd6bf68f2e7370f818a16 100644
--- a/wp-content/plugins/buddypress/bp-core/bp-core-buddybar.php
+++ b/wp-content/plugins/buddypress/bp-core/bp-core-buddybar.php
@@ -1,4 +1,13 @@
 <?php
+
+/**
+ * Core BuddyPress Navigational Functions
+ *
+ * @package BuddyPress
+ * @subpackage Core
+ * @todo Deprecate BuddyBar functions
+ */
+
 // Exit if accessed directly
 if ( !defined( 'ABSPATH' ) ) exit;
 
@@ -6,7 +15,7 @@ if ( !defined( 'ABSPATH' ) ) exit;
  * Adds a navigation item to the main navigation array used in BuddyPress themes.
  *
  * @package BuddyPress Core
- * @global object $bp Global BuddyPress settings object
+ * @global BuddyPress $bp The one true BuddyPress instance
  */
 function bp_core_new_nav_item( $args = '' ) {
 	global $bp;
@@ -30,7 +39,7 @@ function bp_core_new_nav_item( $args = '' ) {
 		return false;
 
 	// If this is for site admins only and the user is not one, don't create the subnav item
-	if ( $site_admin_only && !is_super_admin() )
+	if ( !empty( $site_admin_only ) && !bp_current_user_can( 'bp_moderate' ) )
 		return false;
 
 	if ( empty( $item_css_id ) )
@@ -39,22 +48,23 @@ function bp_core_new_nav_item( $args = '' ) {
 	$bp->bp_nav[$slug] = array(
 		'name'                    => $name,
 		'slug'                    => $slug,
-		'link'                    => $bp->loggedin_user->domain . $slug . '/',
+		'link'                    => trailingslashit( bp_loggedin_user_domain() . $slug ),
 		'css_id'                  => $item_css_id,
 		'show_for_displayed_user' => $show_for_displayed_user,
 		'position'                => $position,
-		'screen_function'         => &$screen_function
+		'screen_function'         => &$screen_function,
+		'default_subnav_slug'	  => $default_subnav_slug
 	);
 
- 	/***
+ 	/**
 	 * If this nav item is hidden for the displayed user, and
 	 * the logged in user is not the displayed user
 	 * looking at their own profile, don't create the nav item.
 	 */
-	if ( !$show_for_displayed_user && !bp_user_has_access() )
+	if ( empty( $show_for_displayed_user ) && !bp_user_has_access() )
 		return false;
 
-	/***
+	/**
  	 * If the nav item is visible, we are not viewing a user, and this is a root
 	 * component, don't attach the default subnav function so we can display a
 	 * directory or something else.
@@ -63,24 +73,21 @@ function bp_core_new_nav_item( $args = '' ) {
 		return;
 
 	// Look for current component
-	if ( bp_is_current_component( $slug ) && !bp_current_action() ) {
-		if ( !is_object( $screen_function[0] ) )
-			add_action( 'bp_screens', $screen_function );
-		else
-			add_action( 'bp_screens', array( &$screen_function[0], $screen_function[1] ), 3 );
-
-		if ( !empty( $default_subnav_slug ) )
-			$bp->current_action = apply_filters( 'bp_default_component_subnav', $default_subnav_slug, $r );
-
-	// Look for current item
-	} elseif ( bp_is_current_item( $slug ) && !bp_current_action() ) {
-		if ( !is_object( $screen_function[0] ) )
-			add_action( 'bp_screens', $screen_function );
-		else
-			add_action( 'bp_screens', array( &$screen_function[0], $screen_function[1] ), 3 );
-
-		if ( !empty( $default_subnav_slug ) )
-			$bp->current_action = apply_filters( 'bp_default_component_subnav', $default_subnav_slug, $r );
+	if ( bp_is_current_component( $slug ) || bp_is_current_item( $slug ) ) {
+
+		// The requested URL has explicitly included the default subnav
+		// (eg: http://example.com/members/membername/activity/just-me/)
+		// The canonical version will not contain this subnav slug.
+		if ( !empty( $default_subnav_slug ) && bp_is_current_action( $default_subnav_slug ) && !bp_action_variable( 0 ) ) {
+			unset( $bp->canonical_stack['action'] );
+		} elseif ( ! bp_current_action() ) {
+			$func = is_object( $screen_function[0] ) ? array( &$screen_function[0], $screen_function[1] ) : $screen_function;
+			add_action( 'bp_screens', $func, 3 );
+
+			if ( !empty( $default_subnav_slug ) ) {
+				$bp->current_action = apply_filters( 'bp_default_component_subnav', $default_subnav_slug, $r );
+			}
+		}
 	}
 
 	do_action( 'bp_core_new_nav_item', $r, $args, $defaults );
@@ -90,7 +97,7 @@ function bp_core_new_nav_item( $args = '' ) {
  * Modify the default subnav item to load when a top level nav item is clicked.
  *
  * @package BuddyPress Core
- * @global object $bp Global BuddyPress settings object
+ * @global BuddyPress $bp The one true BuddyPress instance
  */
 function bp_core_new_nav_default( $args = '' ) {
 	global $bp;
@@ -105,23 +112,54 @@ function bp_core_new_nav_default( $args = '' ) {
 	extract( $r, EXTR_SKIP );
 
 	if ( $function = $bp->bp_nav[$parent_slug]['screen_function'] ) {
-		if ( !is_object( $function[0] ) )
-			remove_action( 'bp_screens', $function, 3 );
-		else
+		if ( is_object( $function[0] ) ) {
 			remove_action( 'bp_screens', array( &$function[0], $function[1] ), 3 );
+		} else {
+			remove_action( 'bp_screens', $function, 3 );
+		}
 	}
 
 	$bp->bp_nav[$parent_slug]['screen_function'] = &$screen_function;
 
-	if ( $bp->current_component == $parent_slug && !$bp->current_action ) {
-		if ( !is_object( $screen_function[0] ) )
-			add_action( 'bp_screens', $screen_function );
-		else
-			add_action( 'bp_screens', array( &$screen_function[0], $screen_function[1] ) );
+	if ( bp_is_current_component( $parent_slug ) ) {
+
+		// The only way to tell whether to set the subnav is to peek at the unfiltered_uri
+		// Find the component
+		$component_uri_key = array_search( $parent_slug, $bp->unfiltered_uri );
+
+		if ( false !== $component_uri_key ) {
+			if ( !empty( $bp->unfiltered_uri[$component_uri_key + 1] ) ) {
+				$unfiltered_action = $bp->unfiltered_uri[$component_uri_key + 1];
+			}
+		}
 
-		if ( $subnav_slug )
-			$bp->current_action = $subnav_slug;
+		// No subnav item has been requested in the URL, so set a new nav default
+		if ( empty( $unfiltered_action ) ) {
+			if ( !bp_is_current_action( $subnav_slug ) ) {
+				if ( is_object( $screen_function[0] ) ) {
+					add_action( 'bp_screens', array( &$screen_function[0], $screen_function[1] ), 3 );
+				} else {
+					add_action( 'bp_screens', $screen_function, 3 );
+				}
+
+				$bp->current_action = $subnav_slug;
+				unset( $bp->canonical_stack['action'] );
+			}
+
+		// The URL is explicitly requesting the new subnav item, but should be
+		// directed to the canonical URL
+		} elseif ( $unfiltered_action == $subnav_slug ) {
+			unset( $bp->canonical_stack['action'] );
+
+		// In all other cases (including the case where the original subnav item
+		// is explicitly called in the URL), the canonical URL will contain the
+		// subnav slug
+		} else {
+			$bp->canonical_stack['action'] = bp_current_action();
+		}
 	}
+
+	return;
 }
 
 /**
@@ -129,7 +167,7 @@ function bp_core_new_nav_default( $args = '' ) {
  * plugins have registered their navigation items.
  *
  * @package BuddyPress Core
- * @global object $bp Global BuddyPress settings object
+ * @global BuddyPress $bp The one true BuddyPress instance
  */
 function bp_core_sort_nav_items() {
 	global $bp;
@@ -137,10 +175,12 @@ function bp_core_sort_nav_items() {
 	if ( empty( $bp->bp_nav ) || !is_array( $bp->bp_nav ) )
 		return false;
 
-	foreach ( (array)$bp->bp_nav as $slug => $nav_item ) {
-		if ( empty( $temp[$nav_item['position']]) )
+	$temp = array();
+
+	foreach ( (array) $bp->bp_nav as $slug => $nav_item ) {
+		if ( empty( $temp[$nav_item['position']]) ) {
 			$temp[$nav_item['position']] = $nav_item;
-		else {
+		} else {
 			// increase numbers here to fit new items in.
 			do {
 				$nav_item['position']++;
@@ -160,7 +200,7 @@ add_action( 'admin_head', 'bp_core_sort_nav_items' );
  * Adds a navigation item to the sub navigation array used in BuddyPress themes.
  *
  * @package BuddyPress Core
- * @global object $bp Global BuddyPress settings object
+ * @global BuddyPress $bp The one true BuddyPress instance
  */
 function bp_core_new_subnav_item( $args = '' ) {
 	global $bp;
@@ -185,11 +225,18 @@ function bp_core_new_subnav_item( $args = '' ) {
 	if ( empty( $name ) || empty( $slug ) || empty( $parent_slug ) || empty( $parent_url ) || empty( $screen_function ) )
 		return false;
 
-	if ( empty( $link ) )
+	// Link was not forced, so create one
+	if ( empty( $link ) ) {
 		$link = $parent_url . $slug;
 
+		// If this sub item is the default for its parent, skip the slug
+		if ( ! empty( $bp->bp_nav[$parent_slug]['default_subnav_slug'] ) && $slug == $bp->bp_nav[$parent_slug]['default_subnav_slug'] ) {
+			$link = $parent_url;
+		}
+	}
+
 	// If this is for site admins only and the user is not one, don't create the subnav item
-	if ( $site_admin_only && !is_super_admin() )
+	if ( !empty( $site_admin_only ) && !bp_current_user_can( 'bp_moderate' ) )
 		return false;
 
 	if ( empty( $item_css_id ) )
@@ -211,10 +258,10 @@ function bp_core_new_subnav_item( $args = '' ) {
 	 * subnav item. We figure out whether we're currently viewing this subnav by checking the
 	 * following two conditions:
 	 *   (1) Either:
-	 *	 (a) the parent slug matches the current_component, or
-	 *	 (b) the parent slug matches the current_item
+	 *	     (a) the parent slug matches the current_component, or
+	 *	     (b) the parent slug matches the current_item
 	 *   (2) And either:
-	 * 	 (a) the current_action matches $slug, or
+	 *	     (a) the current_action matches $slug, or
 	 *       (b) there is no current_action (ie, this is the default subnav for the parent nav)
 	 *	     and this subnav item is the default for the parent item (which we check by
 	 *	     comparing this subnav item's screen function with the screen function of the
@@ -223,30 +270,49 @@ function bp_core_new_subnav_item( $args = '' ) {
 	 */
 
 	// If we *don't* meet condition (1), return
-	if ( $bp->current_component != $parent_slug && $bp->current_item != $parent_slug )
+	if ( ! bp_is_current_component( $parent_slug ) && ! bp_is_current_item( $parent_slug ) )
 		return;
 
 	// If we *do* meet condition (2), then the added subnav item is currently being requested
-	if ( ( !empty( $bp->current_action ) && $slug == $bp->current_action ) || ( bp_is_user() && empty( $bp->current_action ) && $screen_function == $bp->bp_nav[$parent_slug]['screen_function'] ) ) {
+	if ( ( bp_current_action() && bp_is_current_action( $slug ) ) || ( bp_is_user() && ! bp_current_action() && ( $screen_function == $bp->bp_nav[$parent_slug]['screen_function'] ) ) ) {
 
 		// Before hooking the screen function, check user access
-		if ( $user_has_access ) {
-			if ( !is_object( $screen_function[0] ) )
-				add_action( 'bp_screens', $screen_function );
-			else
-				add_action( 'bp_screens', array( &$screen_function[0], $screen_function[1] ) );
+		if ( !empty( $user_has_access ) ) {
+			if ( is_object( $screen_function[0] ) ) {
+				add_action( 'bp_screens', array( &$screen_function[0], $screen_function[1] ), 3 );
+			} else {
+				add_action( 'bp_screens', $screen_function, 3 );
+			}
 		} else {
-			// When the content is off-limits, we handle the situation differently
-			// depending on whether the current user is logged in
+
+			// When the content is off-limits, we handle the situation
+			// differently depending on whether the current user is logged in
 			if ( is_user_logged_in() ) {
+				if ( !bp_is_my_profile() && empty( $bp->bp_nav[$bp->default_component]['show_for_displayed_user'] ) ) {
+
+					// This covers the edge case where the default component is
+					// a non-public tab, like 'messages'
+					if ( bp_is_active( 'activity' ) && isset( $bp->pages->activity ) ) {
+						$redirect_to = trailingslashit( bp_displayed_user_domain() . bp_get_activity_slug() );
+					} else {
+						$redirect_to = trailingslashit( bp_displayed_user_domain() . ( 'xprofile' == $bp->profile->id ? 'profile' : $bp->profile->id ) );
+					}
+
+					$message     = '';
+				} else {
+					$message     = __( 'You do not have access to this page.', 'buddypress' );
+					$redirect_to = bp_displayed_user_domain();
+				}
+
 				// Off-limits to this user. Throw an error and redirect to the displayed user's domain
 				bp_core_no_access( array(
-					'message'  => __( 'You do not have access to this page.', 'buddypress' ),
-					'root'     => bp_displayed_user_domain(),
+					'message'  => $message,
+					'root'     => $redirect_to,
 					'redirect' => false
 				) );
+
+			// Not logged in. Allow the user to log in, and attempt to redirect
 			} else {
-				// Not logged in. Allow the user to log in, and attempt to redirect
 				bp_core_no_access();
 			}
 		}
@@ -259,11 +325,11 @@ function bp_core_sort_subnav_items() {
 	if ( empty( $bp->bp_options_nav ) || !is_array( $bp->bp_options_nav ) )
 		return false;
 
-	foreach ( (array)$bp->bp_options_nav as $parent_slug => $subnav_items ) {
+	foreach ( (array) $bp->bp_options_nav as $parent_slug => $subnav_items ) {
 		if ( !is_array( $subnav_items ) )
 			continue;
 
-		foreach ( (array)$subnav_items as $subnav_item ) {
+		foreach ( (array) $subnav_items as $subnav_item ) {
 			if ( empty( $temp[$subnav_item['position']]) )
 				$temp[$subnav_item['position']] = $subnav_item;
 			else {
@@ -287,7 +353,7 @@ add_action( 'admin_head', 'bp_core_sort_subnav_items' );
  * Determines whether a given nav item has subnav items
  *
  * @package BuddyPress
- * @since 1.5
+ * @since BuddyPress (1.5)
  *
  * @param str $nav_item The id of the top-level nav item whose nav items you're checking
  * @return bool $has_subnav True if the nav item is found and has subnav items; false otherwise
@@ -315,16 +381,16 @@ function bp_core_remove_nav_item( $parent_id ) {
 
 	// Unset subnav items for this nav item
 	if ( isset( $bp->bp_options_nav[$parent_id] ) && is_array( $bp->bp_options_nav[$parent_id] ) ) {
-		foreach( (array)$bp->bp_options_nav[$parent_id] as $subnav_item ) {
+		foreach( (array) $bp->bp_options_nav[$parent_id] as $subnav_item ) {
 			bp_core_remove_subnav_item( $parent_id, $subnav_item['slug'] );
 		}
 	}
 
 	if ( $function = $bp->bp_nav[$parent_id]['screen_function'] ) {
-		if ( !is_object( $function[0] ) ) {
-			remove_action( 'bp_screens', $function );
+		if ( is_object( $function[0] ) ) {
+			remove_action( 'bp_screens', array( &$function[0], $function[1] ), 3 );
 		} else {
-			remove_action( 'bp_screens', array( &$function[0], $function[1] ) );
+			remove_action( 'bp_screens', $function, 3 );
 		}
 	}
 
@@ -341,13 +407,14 @@ function bp_core_remove_nav_item( $parent_id ) {
 function bp_core_remove_subnav_item( $parent_id, $slug ) {
 	global $bp;
 
-	$screen_function = ( isset( $bp->bp_options_nav[$parent_id][$slug]['screen_function'] ) ) ? $bp->bp_options_nav[$parent_id][$slug]['screen_function'] : false;
+	$screen_function = isset( $bp->bp_options_nav[$parent_id][$slug]['screen_function'] ) ? $bp->bp_options_nav[$parent_id][$slug]['screen_function'] : false;
 
-	if ( $screen_function ) {
-		if ( !is_object( $screen_function[0] ) )
-			remove_action( 'bp_screens', $screen_function );
-		else
-			remove_action( 'bp_screens', array( &$screen_function[0], $screen_function[1] ) );
+	if ( !empty( $screen_function ) ) {
+		if ( is_object( $screen_function[0] ) ) {
+			remove_action( 'bp_screens', array( &$screen_function[0], $screen_function[1] ), 3 );
+		} else {
+			remove_action( 'bp_screens', $screen_function, 3 );
+		}
 	}
 
 	unset( $bp->bp_options_nav[$parent_id][$slug] );
@@ -361,7 +428,7 @@ function bp_core_remove_subnav_item( $parent_id, $slug ) {
  *
  * @package BuddyPress Core
  * @param $parent_id The id of the parent navigation item.
- * @global object $bp Global BuddyPress settings object
+ * @global BuddyPress $bp The one true BuddyPress instance
  */
 function bp_core_reset_subnav_items( $parent_slug ) {
 	global $bp;
@@ -377,7 +444,7 @@ function bp_core_admin_bar() {
 	if ( defined( 'BP_DISABLE_ADMIN_BAR' ) && BP_DISABLE_ADMIN_BAR )
 		return false;
 
-	if ( (int)bp_get_option( 'hide-loggedout-adminbar' ) && !is_user_logged_in() )
+	if ( (int) bp_get_option( 'hide-loggedout-adminbar' ) && !is_user_logged_in() )
 		return false;
 
 	$bp->doing_admin_bar = true;
@@ -398,21 +465,18 @@ function bp_core_admin_bar() {
 	$bp->doing_admin_bar = false;
 }
 
-// **** Default BuddyPress admin bar logo ********
+// **** Default BuddyPress Toolbar logo ********
 function bp_adminbar_logo() {
-	global $bp;
-
 	echo '<a href="' . bp_get_root_domain() . '" id="admin-bar-logo">' . get_blog_option( bp_get_root_blog_id(), 'blogname' ) . '</a>';
 }
 
 // **** "Log In" and "Sign Up" links (Visible when not logged in) ********
 function bp_adminbar_login_menu() {
-	global $bp;
 
 	if ( is_user_logged_in() )
 		return false;
 
-	echo '<li class="bp-login no-arrow"><a href="' . bp_get_root_domain() . '/wp-login.php?redirect_to=' . urlencode( bp_get_root_domain() ) . '">' . __( 'Log In', 'buddypress' ) . '</a></li>';
+	echo '<li class="bp-login no-arrow"><a href="' . wp_login_url() . '">' . __( 'Log In', 'buddypress' ) . '</a></li>';
 
 	// Show "Sign Up" link if user registrations are allowed
 	if ( bp_get_signup_allowed() )
@@ -433,7 +497,7 @@ function bp_adminbar_account_menu() {
 
 	// Loop through each navigation item
 	$counter = 0;
-	foreach( (array)$bp->bp_nav as $nav_item ) {
+	foreach( (array) $bp->bp_nav as $nav_item ) {
 		$alt = ( 0 == $counter % 2 ) ? ' class="alt"' : '';
 
 		if ( -1 == $nav_item['position'] )
@@ -446,12 +510,12 @@ function bp_adminbar_account_menu() {
 			echo '<ul>';
 			$sub_counter = 0;
 
-			foreach( (array)$bp->bp_options_nav[$nav_item['slug']] as $subnav_item ) {
+			foreach( (array) $bp->bp_options_nav[$nav_item['slug']] as $subnav_item ) {
 				$link = $subnav_item['link'];
 				$name = $subnav_item['name'];
 
-				if ( isset( $bp->displayed_user->domain ) )
-					$link = str_replace( $bp->displayed_user->domain, $bp->loggedin_user->domain, $subnav_item['link'] );
+				if ( bp_displayed_user_domain() )
+					$link = str_replace( bp_displayed_user_domain(), bp_loggedin_user_domain(), $subnav_item['link'] );
 
 				if ( isset( $bp->displayed_user->userdata->user_login ) )
 					$name = str_replace( $bp->displayed_user->userdata->user_login, $bp->loggedin_user->userdata->user_login, $subnav_item['name'] );
@@ -496,7 +560,7 @@ function bp_adminbar_thisblog_menu() {
 
 // **** "Random" Menu (visible when not logged in) ********
 function bp_adminbar_random_menu() {
-	global $bp; ?>
+?>
 
 	<li class="align-right" id="bp-adminbar-visitrandom-menu">
 		<a href="#"><?php _e( 'Visit', 'buddypress' ) ?></a>
@@ -524,18 +588,18 @@ function bp_adminbar_random_menu() {
 }
 
 /**
- * Retrieve the admin bar display preference of a user based on context.
+ * Retrieve the Toolbar display preference of a user based on context.
  *
  * This is a direct copy of WP's private _get_admin_bar_pref()
  *
- * @since 1.5.0
+ * @since BuddyPress (1.5)
  *
  * @param string $context Context of this preference check, either 'admin' or 'front'.
  * @param int $user Optional. ID of the user to check, defaults to 0 for current user.
  *
  * @uses get_user_option()
  *
- * @return bool Whether the admin bar should be showing for this user.
+ * @return bool Whether the Toolbar should be showing for this user.
  */
 function bp_get_admin_bar_pref( $context, $user = 0 ) {
 	$pref = get_user_option( "show_admin_bar_{$context}", $user );
@@ -546,9 +610,9 @@ function bp_get_admin_bar_pref( $context, $user = 0 ) {
 }
 
 /**
- * Handle the Admin Bar/BuddyBar business
+ * Handle the Toolbar/BuddyBar business
  *
- * @since 1.2.0
+ * @since BuddyPress (1.2)
  *
  * @global string $wp_version
  * @uses bp_get_option()
@@ -566,32 +630,32 @@ function bp_get_admin_bar_pref( $context, $user = 0 ) {
 function bp_core_load_admin_bar() {
 	global $wp_version;
 
-	// Don't show if admin bar is disabled for non-logged in users
-	if ( (int) bp_get_option( 'hide-loggedout-adminbar' ) && !is_user_logged_in() )
+	// Don't show if Toolbar is disabled for non-logged in users
+	if ( (int) bp_get_option( 'hide-loggedout-adminbar' ) && ! is_user_logged_in() )
 		return;
 
-	// Show the WordPress admin bar
+	// Show the WordPress Toolbar
 	if ( bp_use_wp_admin_bar() && $wp_version >= 3.1 ) {
-		// Respect user's admin bar display preferences
-		if ( bp_get_admin_bar_pref( 'front', bp_loggedin_user_id() ) || bp_get_admin_bar_pref( 'admin', bp_loggedin_user_id() ) )
+
+		// Respect user's Toolbar display preferences
+		if ( is_user_logged_in() && ( bp_get_admin_bar_pref( 'front', bp_loggedin_user_id() ) || bp_get_admin_bar_pref( 'admin', bp_loggedin_user_id() ) ) )
 			return;
 
 		show_admin_bar( true );
 
-	// Hide the WordPress admin bar
+	// Hide the WordPress Toolbar
 	} elseif ( !bp_use_wp_admin_bar() ) {
-
-		// Keep the WP admin bar from loading
+		// Keep the WP Toolbar from loading
 		show_admin_bar( false );
 
-		// Actions used to build the BP admin bar
+		// Actions used to build the BP Toolbar
 		add_action( 'bp_adminbar_logo',  'bp_adminbar_logo' );
 		add_action( 'bp_adminbar_menus', 'bp_adminbar_login_menu',         2   );
 		add_action( 'bp_adminbar_menus', 'bp_adminbar_account_menu',       4   );
 		add_action( 'bp_adminbar_menus', 'bp_adminbar_thisblog_menu',      6   );
 		add_action( 'bp_adminbar_menus', 'bp_adminbar_random_menu',        100 );
 
-		// Actions used to append BP admin bar to footer
+		// Actions used to append BP Toolbar to footer
 		add_action( 'wp_footer',    'bp_core_admin_bar', 8 );
 		add_action( 'admin_footer', 'bp_core_admin_bar'    );
 	}
@@ -607,21 +671,22 @@ function bp_core_load_buddybar_css() {
 	if ( file_exists( get_stylesheet_directory() . '/_inc/css/adminbar.css' ) ) // Backwards compatibility
 		$stylesheet = get_stylesheet_directory_uri() . '/_inc/css/adminbar.css';
 	elseif ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG )
-		$stylesheet = BP_PLUGIN_URL . '/bp-core/css/buddybar.dev.css';
+		$stylesheet = BP_PLUGIN_URL . 'bp-core/css/buddybar.dev.css';
 	else
-		$stylesheet = BP_PLUGIN_URL . '/bp-core/css/buddybar.css';
+		$stylesheet = BP_PLUGIN_URL . 'bp-core/css/buddybar.css';
 
-	wp_enqueue_style( 'bp-admin-bar', apply_filters( 'bp_core_admin_bar_css', $stylesheet ), array(), '20110723' );
+	wp_enqueue_style( 'bp-admin-bar', apply_filters( 'bp_core_admin_bar_css', $stylesheet ), array(), bp_get_version() );
 
 	if ( !is_rtl() )
 		return;
 
 	if ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG )
-		$stylesheet = BP_PLUGIN_URL . '/bp-core/css/buddybar-rtl.dev.css';
+		$stylesheet = BP_PLUGIN_URL . 'bp-core/css/buddybar-rtl.dev.css';
 	else
-		$stylesheet = BP_PLUGIN_URL . '/bp-core/css/buddybar-rtl.css';
+		$stylesheet = BP_PLUGIN_URL . 'bp-core/css/buddybar-rtl.css';
 
-	wp_enqueue_style( 'bp-admin-bar-rtl', apply_filters( 'bp_core_buddybar_rtl_css', $stylesheet ), array( 'bp-admin-bar' ), '20110723' );
+	wp_enqueue_style( 'bp-admin-bar-rtl', apply_filters( 'bp_core_buddybar_rtl_css', $stylesheet ), array( 'bp-admin-bar' ), bp_get_version() );
 }
 add_action( 'bp_init', 'bp_core_load_buddybar_css' );
+
 ?>
\ No newline at end of file
diff --git a/wp-content/plugins/buddypress/bp-core/bp-core-cache.php b/wp-content/plugins/buddypress/bp-core/bp-core-cache.php
index 0c30cb1c1b020b10d87a98e39b1d3d76e5f4264f..8b4d566586c6b181659608973cb822c97df8dee7 100644
--- a/wp-content/plugins/buddypress/bp-core/bp-core-cache.php
+++ b/wp-content/plugins/buddypress/bp-core/bp-core-cache.php
@@ -44,8 +44,93 @@ function bp_core_clear_user_object_cache( $user_id ) {
 	wp_cache_delete( 'bp_user_' . $user_id, 'bp' );
 }
 
-// List actions to clear super cached pages on, if super cache is installed
-add_action( 'wp_login',              'bp_core_clear_cache' );
-add_action( 'bp_core_render_notice', 'bp_core_clear_cache' );
+/**
+ * Clears member count caches and transients
+ */
+function bp_core_clear_member_count_caches() {
+	wp_cache_delete( 'bp_total_member_count', 'bp' );
+	delete_transient( 'bp_active_member_count' );
+}
+add_action( 'bp_core_activated_user',         'bp_core_clear_member_count_caches' );
+add_action( 'bp_core_process_spammer_status', 'bp_core_clear_member_count_caches' );
+add_action( 'bp_core_deleted_account',        'bp_core_clear_member_count_caches' );
+add_action( 'bp_first_activity_for_member',   'bp_core_clear_member_count_caches' );
+add_action( 'deleted_user',                   'bp_core_clear_member_count_caches' );
+
+/**
+ * Update the metadata cache for the specified objects.
+ *
+ * @since 1.6
+ * @global $wpdb WordPress database object for queries.
+ * @param array $args See $defaults definition for more details
+ * @return mixed Metadata cache for the specified objects, or false on failure.
+ */
+function bp_update_meta_cache( $args = array() ) {
+	global $wpdb;
+
+	$defaults = array(
+		'object_ids' 	   => array(), // Comma-separated list or array of item ids
+		'object_type' 	   => '',      // Canonical component id: groups, members, etc
+		'meta_table' 	   => '',      // Name of the table containing the metadata
+		'object_column'    => '',      // DB column for the object ids (group_id, etc)
+		'cache_key_prefix' => ''       // Prefix to use when creating cache key names. Eg
+					       //    'bp_groups_groupmeta'
+	);
+	$r = wp_parse_args( $args, $defaults );
+	extract( $r );
+
+	if ( empty( $object_ids ) || empty( $object_type ) || empty( $meta_table ) ) {
+		return false;
+	}
+
+	if ( empty( $cache_key_prefix ) ) {
+		$cache_key_prefix = $meta_table;
+	}
+
+	if ( empty( $object_column ) ) {
+		$object_column = $object_type . '_id';
+	}
+
+	if ( !is_array( $object_ids ) ) {
+		$object_ids = preg_replace( '|[^0-9,]|', '', $object_ids );
+		$object_ids = explode( ',', $object_ids );
+	}
+
+	$object_ids = array_map( 'intval', $object_ids );
+
+	$cache = array();
+
+	// Get meta info
+	$id_list   = join( ',', $object_ids );
+	$meta_list = $wpdb->get_results( "SELECT $object_column, meta_key, meta_value FROM $meta_table WHERE $object_column IN ($id_list)", ARRAY_A );
+
+	if ( !empty( $meta_list ) ) {
+		foreach ( $meta_list as $metarow ) {
+			$mpid = intval( $metarow[$object_column] );
+			$mkey = $metarow['meta_key'];
+			$mval = $metarow['meta_value'];
+
+			// Force subkeys to be array type:
+			if ( !isset( $cache[$mpid] ) || !is_array( $cache[$mpid] ) )
+				$cache[$mpid] = array();
+			if ( !isset( $cache[$mpid][$mkey] ) || !is_array( $cache[$mpid][$mkey] ) )
+				$cache[$mpid][$mkey] = array();
+
+			// Add a value to the current pid/key:
+			$cache[$mpid][$mkey][] = $mval;
+		}
+	}
+
+	foreach ( $object_ids as $id ) {
+		if ( ! isset($cache[$id]) )
+			$cache[$id] = array();
+
+		foreach( $cache[$id] as $meta_key => $meta_value ) {
+			wp_cache_set( $cache_key_prefix . '_' . $id . '_' . $meta_key, $meta_value, 'bp' );
+		}
+	}
+
+	return $cache;
+}
 
 ?>
\ No newline at end of file
diff --git a/wp-content/plugins/buddypress/bp-core/bp-core-caps.php b/wp-content/plugins/buddypress/bp-core/bp-core-caps.php
new file mode 100644
index 0000000000000000000000000000000000000000..bbdbbc1a8f238945e7bf64aaccaa2dc065829d0e
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-core/bp-core-caps.php
@@ -0,0 +1,426 @@
+<?php
+
+/**
+ * BuddyPress Capabilites
+ *
+ * @package BuddyPress
+ * @subpackage Capabilities
+ */
+
+// Exit if accessed directly
+if ( !defined( 'ABSPATH' ) ) exit;
+
+/**
+ * Adds BuddyPress-specific user roles.
+ *
+ * This is called on plugin activation.
+ *
+ * @since BuddyPress (1.6)
+ *
+ * @uses get_option() To get the default role
+ * @uses get_role() To get the default role object
+ * @uses add_role() To add our own roles
+ * @uses do_action() Calls 'bp_add_roles'
+ */
+function bp_add_roles() {
+
+	// Get new role names
+	$moderator_role   = bp_get_moderator_role();
+	$participant_role = bp_get_participant_role();
+
+	// Add the Moderator role and add the default role caps.
+	// Mod caps are added by the bp_add_caps() function
+	$default = get_role( get_option( 'default_role' ) );
+
+	// If role does not exist, default to read cap
+	if ( empty( $default->capabilities ) )
+		$default->capabilities = array( 'read' );
+
+	// Moderators are default role + community moderating caps in bp_add_caps()
+	add_role( $moderator_role,   'Community Moderator',   $default->capabilities );
+
+	// Forum Subscribers are auto added to sites with global communities
+	add_role( $participant_role, 'Community Participant', $default->capabilities );
+
+	do_action( 'bp_add_roles' );
+}
+
+/**
+ * Adds capabilities to WordPress user roles.
+ *
+ * This is called on plugin activation.
+ *
+ * @since BuddyPress (1.6)
+ *
+ * @uses get_role() To get the administrator, default and moderator roles
+ * @uses WP_Role::add_cap() To add various capabilities
+ * @uses do_action() Calls 'bp_add_caps'
+ */
+function bp_add_caps() {
+	global $wp_roles;
+
+	// Load roles if not set
+	if ( ! isset( $wp_roles ) )
+		$wp_roles = new WP_Roles();
+
+	// Loop through available roles
+	foreach( $wp_roles->roles as $role => $details ) {
+
+		// Load this role
+		$this_role = get_role( $role );
+
+		// Loop through caps for this role and remove them
+		foreach ( bp_get_caps_for_role( $role ) as $cap ) {
+			$this_role->add_cap( $cap );
+		}
+	}
+
+	do_action( 'bp_add_caps' );
+}
+
+/**
+ * Removes capabilities from WordPress user roles.
+ *
+ * This is called on plugin deactivation.
+ *
+ * @since BuddyPress (1.6)
+ *
+ * @uses get_role() To get the administrator and default roles
+ * @uses WP_Role::remove_cap() To remove various capabilities
+ * @uses do_action() Calls 'bp_remove_caps'
+ */
+function bp_remove_caps() {
+	global $wp_roles;
+
+	// Load roles if not set
+	if ( ! isset( $wp_roles ) )
+		$wp_roles = new WP_Roles();
+
+	// Loop through available roles
+	foreach( $wp_roles->roles as $role => $details ) {
+
+		// Load this role
+		$this_role = get_role( $role );
+
+		// Loop through caps for this role and remove them
+		foreach ( bp_get_caps_for_role( $role ) as $cap ) {
+			$this_role->remove_cap( $cap );
+		}
+	}
+
+	do_action( 'bp_remove_caps' );
+}
+
+/**
+ * Removes BuddyPress-specific user roles.
+ *
+ * This is called on plugin deactivation.
+ *
+ * @since BuddyPress (1.6)
+ *
+ * @uses remove_role() To remove our roles
+ * @uses do_action() Calls 'bp_remove_roles'
+ */
+function bp_remove_roles() {
+
+	// Get new role names
+	$moderator_role   = bp_get_moderator_role();
+	$participant_role = bp_get_participant_role();
+
+	// Remove the Moderator role
+	remove_role( $moderator_role );
+
+	// Remove the Moderator role
+	remove_role( $participant_role );
+
+	do_action( 'bp_remove_roles' );
+}
+
+/**
+ * Maps community caps to built in WordPress caps
+ *
+ * @since BuddyPress (1.6)
+ *
+ * @param array $caps Capabilities for meta capability
+ * @param string $cap Capability name
+ * @param int $user_id User id
+ * @param mixed $args Arguments
+ * @uses get_post() To get the post
+ * @uses get_post_type_object() To get the post type object
+ * @uses apply_filters() Calls 'bp_map_meta_caps' with caps, cap, user id and
+ *                        args
+ * @return array Actual capabilities for meta capability
+ */
+function bp_map_meta_caps( $caps, $cap, $user_id, $args ) {
+	return apply_filters( 'bp_map_meta_caps', $caps, $cap, $user_id, $args );
+}
+
+/**
+ * Return community capabilities
+ *
+ * @since BuddyPress (1.6)
+ *
+ * @uses apply_filters() Calls 'bp_get_community_caps' with the capabilities
+ * @return array Forum capabilities
+ */
+function bp_get_community_caps() {
+
+	// Forum meta caps
+	$caps = array();
+
+	return apply_filters( 'bp_get_community_caps', $caps );
+}
+
+/**
+ * Returns an array of capabilities based on the role that is being requested.
+ *
+ * @since BuddyPress (1.6)
+ *
+ * @param string $role Optional. Defaults to The role to load caps for
+ * @uses apply_filters() Allow return value to be filtered
+ *
+ * @return array Capabilities for $role
+ */
+function bp_get_caps_for_role( $role = '' ) {
+
+	// Get new role names
+	$moderator_role   = bp_get_moderator_role();
+	$participant_role = bp_get_participant_role();
+
+	// Which role are we looking for?
+	switch ( $role ) {
+
+		// Administrator
+		case 'administrator' :
+			$caps = array(
+				// Misc
+				'bp_moderate',
+			);
+
+			break;
+
+		// Moderator
+		case $moderator_role :
+			$caps = array(
+				// Misc
+				'bp_moderate',
+			);
+
+			break;
+
+		// WordPress Core Roles
+		case 'editor'          :
+		case 'author'          :
+		case 'contributor'     :
+		case 'subscriber'      :
+
+		// BuddyPress Participant Role
+		case $participant_role :
+		default                :
+			$caps = array();
+			break;
+	}
+
+	return apply_filters( 'bp_get_caps_for_role', $caps, $role );
+}
+
+/**
+ * Give a user the default 'Forum Participant' role when creating a topic/reply
+ * on a site they do not have a role or capability on.
+ *
+ * @since BuddyPress (1.6)
+ *
+ * @global BuddyPress $bbp
+ *
+ * @uses is_multisite()
+ * @uses bp_allow_global_access()
+ * @uses bp_is_user_inactive()
+ * @uses is_user_logged_in()
+ * @uses current_user_can()
+ * @uses WP_User::set_role()
+ *
+ * @return If user is not spam/deleted or is already capable
+ */
+function bp_global_access_auto_role() {
+
+	// Bail if not multisite or community is not global
+	if ( !is_multisite() || !bp_allow_global_access() )
+		return;
+
+	// Bail if user is not active
+	if ( bp_is_user_inactive() )
+		return;
+
+	// Bail if user is not logged in
+	if ( !is_user_logged_in() )
+		return;
+
+	// Give the user the 'Forum Participant' role
+	if ( current_user_can( 'bp_masked' ) ) {
+		global $bbp;
+
+		// Get the default role
+		$default_role = bp_get_participant_role();
+
+		// Set the current users default role
+		$bbp->current_user->set_role( $default_role );
+	}
+}
+
+/**
+ * The participant role for registered users without roles
+ *
+ * This is primarily for multisite compatibility when users without roles on
+ * sites that have global communities enabled
+ *
+ * @since BuddyPress (1.6)
+ *
+ * @param string $role
+ * @uses apply_filters()
+ * @return string
+ */
+function bp_get_participant_role() {
+
+	// Hardcoded participant role
+	$role = 'bp_participant';
+
+	// Allow override
+	return apply_filters( 'bp_get_participant_role', $role );
+}
+
+/**
+ * The moderator role for BuddyPress users
+ *
+ * @since BuddyPress (1.6)
+ *
+ * @param string $role
+ * @uses apply_filters()
+ * @return string
+ */
+function bp_get_moderator_role() {
+
+	// Hardcoded moderated user role
+	$role = 'bp_moderator';
+
+	// Allow override
+	return apply_filters( 'bp_get_moderator_role', $role );
+}
+
+/**
+ * Add the default role and mapped BuddyPress caps to the current user if needed
+ *
+ * This function will bail if the community is not global in a multisite
+ * installation of WordPress, or if the user is marked as spam or deleted.
+ *
+ * @since BuddyPress (1.6)
+ *
+ * @uses is_multisite()
+ * @uses bp_allow_global_access()
+ * @uses bp_is_user_inactive()
+ * @uses is_user_logged_in()
+ * @uses current_user_can()
+ * @uses get_option()
+ * @uses bp_get_caps_for_role()
+ *
+ * @global BuddyPress $bbp
+ * @return If not multisite, not global, or user is deleted/spammed
+ */
+function bp_global_access_role_mask() {
+
+	// Bail if not multisite or community is not global
+	if ( !is_multisite() || !bp_allow_global_access() )
+		return;
+
+	// Bail if user is marked as spam or is deleted
+	if ( bp_is_user_inactive() )
+		return;
+
+	// Normal user is logged in but has no caps
+	if ( is_user_logged_in() && !current_user_can( 'read' ) ) {
+
+		// Define local variable
+		$mapped_meta_caps = array();
+
+		// Assign user the minimal participant role to map caps to
+		$default_role  = bp_get_participant_role();
+
+		// Get BuddyPress caps for the default role
+		$caps_for_role = bp_get_caps_for_role( $default_role );
+
+		// Set all caps to true
+		foreach ( $caps_for_role as $cap ) {
+			$mapped_meta_caps[$cap] = true;
+		}
+
+		// Add 'read' cap just in case
+		$mapped_meta_caps['read']      = true;
+		$mapped_meta_caps['bp_masked'] = true;
+
+		// Allow global access caps to be manipulated
+		$mapped_meta_caps = apply_filters( 'bp_global_access_mapped_meta_caps', $mapped_meta_caps );
+
+		// Assign the role and mapped caps to the current user
+		global $bp;
+		$bp->current_user->roles[0] = $default_role;
+		$bp->current_user->caps     = $mapped_meta_caps;
+		$bp->current_user->allcaps  = $mapped_meta_caps;
+	}
+}
+
+/**
+ * Whether current user has a capability or role. Can be passed blog ID, or will
+ * use the root blod by default
+ *
+ * @since BuddyPress (1.6)
+ *
+ * @param string $capability Capability or role name.
+ * @param int $blog_id Blog ID
+ * @return bool
+ */
+function bp_current_user_can( $capability, $blog_id = 0 ) {
+
+	// Use root blog if no ID passed
+	if ( empty( $blog_id ) )
+		$blog_id = bp_get_root_blog_id();
+
+	$retval = current_user_can_for_blog( $blog_id, $capability );
+
+	return (bool) apply_filters( 'bp_current_user_can', $retval, $capability, $blog_id );
+}
+
+/**
+ * Temporary implementation of 'bp_moderate' cap
+ *
+ * In BuddyPress 1.6, the 'bp_moderate' cap was introduced. In order to enforce that
+ * bp_current_user_can( 'bp_moderate' ) always returns true for Administrators, we must manually
+ * add the 'bp_moderate' cap to the list of user caps for Admins.
+ *
+ * Note that this level of enforcement is only necessary in the case of non-Multisite. This is
+ * because WordPress automatically assigns every capability - and thus 'bp_moderate' - to Super
+ * Admins on a Multisite installation. See WP_User::has_cap().
+ *
+ * This implementation of 'bp_moderate' is temporary, until BuddyPress properly matches caps to
+ * roles and stores them in the database. Plugin authors: Do not use this function.
+ *
+ * @since BuddyPress (1.6)
+ * @see WP_User::has_cap()
+ *
+ * @param array $allcaps The caps that WP associates with the given role
+ * @param array $caps The caps being tested for in WP_User::has_cap()
+ * @param array $args Miscellaneous arguments passed to the user_has_cap filter
+ * @return array $allcaps The user's cap list, with 'bp_moderate' appended, if relevant
+ */
+function _bp_enforce_bp_moderate_cap_for_admins( $allcaps, $caps, $args ) {
+	if ( in_array( 'bp_moderate', $caps ) &&   // We only care if checking for bp_moderate
+	     !in_array( 'do_not_allow', $caps ) && // 'do_not_allow' overrides everything else
+	     !is_multisite() &&                    // Check not necessary on Multisite
+	     isset( $allcaps['delete_users'] ) )   // Mimicking WP's check for Administrator status
+	{
+		$allcaps['bp_moderate'] = true;
+	}
+
+	return $allcaps;
+}
+add_filter( 'user_has_cap', '_bp_enforce_bp_moderate_cap_for_admins', 10, 3 );
+
+?>
diff --git a/wp-content/plugins/buddypress/bp-core/bp-core-catchuri.php b/wp-content/plugins/buddypress/bp-core/bp-core-catchuri.php
index 0dbcb46fa53ce7891ed9d29ea55910613ae237f7..973ae4e70869506d008a63283666245deb11ada6 100644
--- a/wp-content/plugins/buddypress/bp-core/bp-core-catchuri.php
+++ b/wp-content/plugins/buddypress/bp-core/bp-core-catchuri.php
@@ -1,21 +1,26 @@
 <?php
+
+/**
+ * BuddyPress URI catcher
+ *
+ * Functions for parsing the URI and determining which BuddyPress template file
+ * to use on-screen.
+ *
+ * @package BuddyPress
+ * @subpackage Core
+ */
+
 // Exit if accessed directly
 if ( !defined( 'ABSPATH' ) ) exit;
 
-/*
-Based on contributions from: Chris Taylor - http://www.stillbreathing.co.uk/
-Modified for BuddyPress by: Andy Peatling - http://apeatling.wordpress.com/
-*/
-
 /**
  * Analyzes the URI structure and breaks it down into parts for use in code.
- * The idea is that BuddyPress can use complete custom friendly URI's without the
- * user having to add new re-write rules.
- *
- * Future custom components would then be able to use their own custom URI structure.
+ * BuddyPress can use complete custom friendly URI's without the user having to
+ * add new re-write rules. Custom components are able to use their own custom
+ * URI structures with very little work.
  *
  * @package BuddyPress Core
- * @since BuddyPress (r100)
+ * @since BuddyPress (1.0)
  *
  * The URI's are broken down as follows:
  *   - http:// domain.com / members / andy / [current_component] / [current_action] / [action_variables] / [action_variables] / ...
@@ -29,23 +34,22 @@ Modified for BuddyPress by: Andy Peatling - http://apeatling.wordpress.com/
  *
  */
 function bp_core_set_uri_globals() {
-	global $bp, $bp_unfiltered_uri, $bp_unfiltered_uri_offset;
-	global $current_blog, $wpdb;
-
-	// Create global component, action, and item variables
-	$bp->current_component = $bp->current_action = $bp->current_item ='';
-	$bp->action_variables = $bp->displayed_user->id = '';
+	global $bp, $current_blog, $wp_rewrite;
 
 	// Don't catch URIs on non-root blogs unless multiblog mode is on
 	if ( !bp_is_root_blog() && !bp_is_multiblog_mode() )
 		return false;
 
+	// Define local variables
+	$root_profile = $match   = false;
+	$key_slugs    = $matches = $uri_chunks = array();
+
 	// Fetch all the WP page names for each component
 	if ( empty( $bp->pages ) )
 		$bp->pages = bp_core_get_directory_pages();
 
 	// Ajax or not?
-	if ( strpos( $_SERVER['REQUEST_URI'], 'wp-load.php' ) )
+	if ( defined( 'DOING_AJAX' ) && DOING_AJAX || strpos( $_SERVER['REQUEST_URI'], 'wp-load.php' ) )
 		$path = bp_core_referrer();
 	else
 		$path = esc_url( $_SERVER['REQUEST_URI'] );
@@ -53,30 +57,39 @@ function bp_core_set_uri_globals() {
 	// Filter the path
 	$path = apply_filters( 'bp_uri', $path );
 
-	// Take GET variables off the URL to avoid problems,
-	// they are still registered in the global $_GET variable
-	if ( $noget = substr( $path, 0, strpos( $path, '?' ) ) )
-		$path = $noget;
+	// Take GET variables off the URL to avoid problems
+	$path = strtok( $path, '?' );
 
-	// Fetch the current URI and explode each part separated by '/' into an array
+	// Fetch current URI and explode each part separated by '/' into an array
 	$bp_uri = explode( '/', $path );
 
 	// Loop and remove empties
-	foreach ( (array)$bp_uri as $key => $uri_chunk )
-		if ( empty( $bp_uri[$key] ) ) unset( $bp_uri[$key] );
+	foreach ( (array) $bp_uri as $key => $uri_chunk ) {
+		if ( empty( $bp_uri[$key] ) ) {
+			unset( $bp_uri[$key] );
+		}
+	}
 
-	// Running off blog other than root
+	// If running off blog other than root, any subdirectory names must be
+	// removed from $bp_uri. This includes two cases:
+	//
+	//    1. when WP is installed in a subdirectory,
+	//    2. when BP is running on secondary blog of a subdirectory
+	//       multisite installation. Phew!
 	if ( is_multisite() && !is_subdomain_install() && ( bp_is_multiblog_mode() || 1 != bp_get_root_blog_id() ) ) {
 
-		// Any subdirectory names must be removed from $bp_uri.
-		// This includes two cases: (1) when WP is installed in a subdirectory,
-		// and (2) when BP is running on secondary blog of a subdirectory
-		// multisite installation. Phew!
-		if ( $chunks = explode( '/', $current_blog->path ) ) {
+		// Blow chunks
+		$chunks = explode( '/', $current_blog->path );
+
+		// If chunks exist...
+		if ( !empty( $chunks ) ) {
+
+			// ...loop through them...
 			foreach( $chunks as $key => $chunk ) {
 				$bkey = array_search( $chunk, $bp_uri );
 
-				if ( $bkey !== false ) {
+				// ...and unset offending keys
+				if ( false !== $bkey ) {
 					unset( $bp_uri[$bkey] );
 				}
 
@@ -85,10 +98,6 @@ function bp_core_set_uri_globals() {
 		}
 	}
 
-	// Set the indexes, these are incresed by one if we are not on a VHOST install
-	$component_index = 0;
-	$action_index    = $component_index + 1;
-
 	// Get site path items
 	$paths = explode( '/', bp_core_get_site_path() );
 
@@ -100,9 +109,13 @@ function bp_core_set_uri_globals() {
 	if ( empty( $paths[0] ) )
 		array_shift( $paths );
 
+	// Reset indexes
+	$bp_uri = array_values( $bp_uri );
+	$paths  = array_values( $paths );
+
 	// Unset URI indices if they intersect with the paths
 	foreach ( (array) $bp_uri as $key => $uri_chunk ) {
-		if ( in_array( $uri_chunk, $paths ) ) {
+		if ( isset( $paths[$key] ) && $uri_chunk == $paths[$key] ) {
 			unset( $bp_uri[$key] );
 		}
 	}
@@ -113,7 +126,7 @@ function bp_core_set_uri_globals() {
 	// If a component is set to the front page, force its name into $bp_uri
 	// so that $current_component is populated (unless a specific WP post is being requested
 	// via a URL parameter, usually signifying Preview mode)
-	if ( 'page' == get_option( 'show_on_front' ) && get_option( 'page_on_front' ) && empty( $bp_uri ) && empty( $_GET['p'] ) ) {
+	if ( 'page' == get_option( 'show_on_front' ) && get_option( 'page_on_front' ) && empty( $bp_uri ) && empty( $_GET['p'] ) && empty( $_GET['page_id'] ) ) {
 		$post = get_post( get_option( 'page_on_front' ) );
 		if ( !empty( $post ) ) {
 			$bp_uri[0] = $post->post_name;
@@ -121,7 +134,10 @@ function bp_core_set_uri_globals() {
 	}
 
 	// Keep the unfiltered URI safe
-	$bp_unfiltered_uri = $bp_uri;
+	$bp->unfiltered_uri = $bp_uri;
+
+	// Don't use $bp_unfiltered_uri, this is only for backpat with old plugins. Use $bp->unfiltered_uri.
+	$GLOBALS['bp_unfiltered_uri'] = &$bp->unfiltered_uri;
 
 	// Get slugs of pages into array
 	foreach ( (array) $bp->pages as $page_key => $bp_page )
@@ -183,10 +199,13 @@ function bp_core_set_uri_globals() {
 	}
 
 	// URLs with BP_ENABLE_ROOT_PROFILES enabled won't be caught above
-	if ( empty( $matches ) && defined( 'BP_ENABLE_ROOT_PROFILES' ) && BP_ENABLE_ROOT_PROFILES ) {
+	if ( empty( $matches ) && bp_core_enable_root_profiles() ) {
+
+		// Switch field based on compat
+		$field = bp_is_username_compatibility_mode() ? 'login' : 'slug';
 
 		// Make sure there's a user corresponding to $bp_uri[0]
-		if ( !empty( $bp->pages->members ) && !empty( $bp_uri[0] ) && $root_profile = get_user_by( 'login', $bp_uri[0] ) ) {
+		if ( !empty( $bp->pages->members ) && !empty( $bp_uri[0] ) && $root_profile = get_user_by( $field, $bp_uri[0] ) ) {
 
 			// Force BP to recognize that this is a members page
 			$matches[]  = 1;
@@ -208,9 +227,11 @@ function bp_core_set_uri_globals() {
 	}
 
 	// This is not a BuddyPress page, so just return.
-	if ( !isset( $matches ) )
+	if ( empty( $matches ) )
 		return false;
 
+	$wp_rewrite->use_verbose_page_rules = false;
+
 	// Find the offset. With $root_profile set, we fudge the offset down so later parsing works
 	$slug       = !empty ( $match ) ? explode( '/', $match->slug ) : '';
 	$uri_offset = empty( $root_profile ) ? 0 : -1;
@@ -223,7 +244,7 @@ function bp_core_set_uri_globals() {
 
 	// Global the unfiltered offset to use in bp_core_load_template().
 	// To avoid PHP warnings in bp_core_load_template(), it must always be >= 0
-	$bp_unfiltered_uri_offset = $uri_offset >= 0 ? $uri_offset : 0;
+	$bp->unfiltered_uri_offset = $uri_offset >= 0 ? $uri_offset : 0;
 
 	// We have an exact match
 	if ( isset( $match->key ) ) {
@@ -238,12 +259,14 @@ function bp_core_set_uri_globals() {
 			if ( !empty( $bp_uri[$uri_offset + 1] ) ) {
 
 				// Switch the displayed_user based on compatbility mode
-				if ( bp_is_username_compatibility_mode() )
+				if ( bp_is_username_compatibility_mode() ) {
 					$bp->displayed_user->id = (int) bp_core_get_userid( urldecode( $bp_uri[$uri_offset + 1] ) );
-				else
+				} else {
 					$bp->displayed_user->id = (int) bp_core_get_userid_from_nicename( urldecode( $bp_uri[$uri_offset + 1] ) );
+				}
+
+				if ( !bp_displayed_user_id() ) {
 
-				if ( empty( $bp->displayed_user->id ) ) {
 					// Prevent components from loading their templates
 					$bp->current_component = '';
 
@@ -253,9 +276,9 @@ function bp_core_set_uri_globals() {
 
 				// If the displayed user is marked as a spammer, 404 (unless logged-
 				// in user is a super admin)
-				if ( !empty( $bp->displayed_user->id ) && bp_core_is_user_spammer( $bp->displayed_user->id ) ) {
-					if ( is_super_admin() ) {
-						bp_core_add_message( __( 'This user has been marked as a spammer. Only site admins can view this profile.', 'buddypress' ), 'error' );
+				if ( bp_displayed_user_id() && bp_is_user_spammer( bp_displayed_user_id() ) ) {
+					if ( bp_current_user_can( 'bp_moderate' ) ) {
+						bp_core_add_message( __( 'This user has been marked as a spammer. Only site admins can view this profile.', 'buddypress' ), 'warning' );
 					} else {
 						bp_do_404();
 						return;
@@ -289,15 +312,26 @@ function bp_core_set_uri_globals() {
 	// Set the entire URI as the action variables, we will unset the current_component and action in a second
 	$bp->action_variables = $bp_uri;
 
-	// Remove the username from action variables if this is not a VHOST install
-	// @todo - move or remove this all together
-	if ( defined( 'VHOST' ) && ( 'no' == VHOST ) && empty( $bp->current_component ) )
-		array_shift( $bp_uri );
-
 	// Reset the keys by merging with an empty array
 	$bp->action_variables = array_merge( array(), $bp->action_variables );
 }
 
+/**
+ * Are root profiles enabled and allowed
+ *
+ * @since BuddyPress (1.6)
+ * @return bool True if yes, false if no
+ */
+function bp_core_enable_root_profiles() {
+
+	$retval = false;
+
+	if ( defined( 'BP_ENABLE_ROOT_PROFILES' ) && ( true == BP_ENABLE_ROOT_PROFILES ) )
+		$retval = true;
+
+	return apply_filters( 'bp_core_enable_root_profiles', $retval );
+}
+
 /**
  * bp_core_load_template()
  *
@@ -313,16 +347,20 @@ function bp_core_set_uri_globals() {
  * @return false|int The user ID of the matched user, or false.
  */
 function bp_core_load_template( $templates ) {
-	global $post, $bp, $wpdb, $wp_query, $bp_unfiltered_uri, $bp_unfiltered_uri_offset;
+	global $post, $bp, $wp_query, $wpdb;
 
-	// Determine if the root object WP page exists for this request (TODO: is there an API function for this?
-	if ( !empty( $bp_unfiltered_uri_offset ) && !$page_exists = $wpdb->get_var( $wpdb->prepare( "SELECT ID FROM {$wpdb->posts} WHERE post_name = %s", $bp_unfiltered_uri[$bp_unfiltered_uri_offset] ) ) )
-		return false;
+	// Determine if the root object WP page exists for this request
+	// note: get_page_by_path() breaks non-root pages
+	if ( !empty( $bp->unfiltered_uri_offset ) ) {
+		if ( !$page_exists = $wpdb->get_var( $wpdb->prepare( "SELECT ID FROM {$wpdb->posts} WHERE post_name = %s", $bp->unfiltered_uri[$bp->unfiltered_uri_offset] ) ) ) {
+			return false;
+		}
+	}
 
 	// Set the root object as the current wp_query-ied item
 	$object_id = 0;
-	foreach ( (array)$bp->pages as $page ) {
-		if ( isset( $bp_unfiltered_uri[$bp_unfiltered_uri_offset] ) && $page->name == $bp_unfiltered_uri[$bp_unfiltered_uri_offset] ) {
+	foreach ( (array) $bp->pages as $page ) {
+		if ( $page->name == $bp->unfiltered_uri[$bp->unfiltered_uri_offset] ) {
 			$object_id = $page->id;
 		}
 	}
@@ -334,18 +372,28 @@ function bp_core_load_template( $templates ) {
 		$post                        = $wp_query->queried_object;
 	}
 
+	// Define local variables
+	$located_template   = false;
+	$filtered_templates = array();
+
 	// Fetch each template and add the php suffix
-	foreach ( (array)$templates as $template )
+	foreach ( (array) $templates as $template )
 		$filtered_templates[] = $template . '.php';
 
 	// Filter the template locations so that plugins can alter where they are located
-	if ( $located_template = apply_filters( 'bp_located_template', locate_template( (array) $filtered_templates, false ), $filtered_templates ) ) {
+	$located_template = apply_filters( 'bp_located_template', locate_template( (array) $filtered_templates, false ), $filtered_templates );
+	if ( !empty( $located_template ) ) {
+
 		// Template was located, lets set this as a valid page and not a 404.
 		status_header( 200 );
-		$wp_query->is_page = true;
-		$wp_query->is_404 = false;
+		$wp_query->is_page = $wp_query->is_singular = true;
+		$wp_query->is_404  = false;
+
+		do_action( 'bp_core_pre_load_template', $located_template );
 
 		load_template( apply_filters( 'bp_load_template', $located_template ) );
+
+		do_action( 'bp_core_post_load_template', $located_template );
 	}
 
 	// Kill any other output after this.
@@ -360,31 +408,30 @@ function bp_core_load_template( $templates ) {
  *
  */
 function bp_core_catch_profile_uri() {
-	global $bp;
-
-	if ( !bp_is_active( 'xprofile' ) )
+	if ( !bp_is_active( 'xprofile' ) ) {
 		bp_core_load_template( apply_filters( 'bp_core_template_display_profile', 'members/single/home' ) );
+	}
 }
 
 /**
  * Catches invalid access to BuddyPress pages and redirects them accordingly.
  *
  * @package BuddyPress Core
- * @since 1.5
+ * @since BuddyPress (1.5)
  */
 function bp_core_catch_no_access() {
-	global $bp, $bp_no_status_set, $wp_query;
+	global $bp, $wp_query;
 
-	// If bp_core_redirect() and $bp_no_status_set is true,
-	// we are redirecting to an accessible page, so skip this check.
-	if ( $bp_no_status_set )
+	// If coming from bp_core_redirect() and $bp_no_status_set is true,
+	// we are redirecting to an accessible page so skip this check.
+	if ( !empty( $bp->no_status_set ) )
 		return false;
 
 	if ( !isset( $wp_query->queried_object ) && !bp_is_blog_page() ) {
 		bp_do_404();
 	}
 }
-add_action( 'wp', 'bp_core_catch_no_access' );
+add_action( 'bp_template_redirect', 'bp_core_catch_no_access', 1 );
 
 /**
  * Redirects a user to login for BP pages that require access control and adds an error message (if
@@ -392,33 +439,42 @@ add_action( 'wp', 'bp_core_catch_no_access' );
  * If authenticated, redirects user back to requested content by default.
  *
  * @package BuddyPress Core
- * @since 1.5
+ * @since BuddyPress (1.5)
  */
 function bp_core_no_access( $args = '' ) {
-	global $bp;
+
+ 	// Build the redirect URL
+ 	$redirect_url  = is_ssl() ? 'https://' : 'http://';
+ 	$redirect_url .= $_SERVER['HTTP_HOST'];
+ 	$redirect_url .= $_SERVER['REQUEST_URI'];
 
 	$defaults = array(
-		'mode'     => '1',			    // 1 = $root, 2 = wp-login.php
-		'message'  => __( 'You must log in to access the page you requested.', 'buddypress' ),
-		'redirect' => wp_guess_url(),	// the URL you get redirected to when a user successfully logs in
-		'root'     => $bp->root_domain	// the landing page you get redirected to when a user doesn't have access
+		'mode'     => '1',                  // 1 = $root, 2 = wp-login.php
+		'redirect' => $redirect_url,        // the URL you get redirected to when a user successfully logs in
+		'root'     => bp_get_root_domain(),	// the landing page you get redirected to when a user doesn't have access
+		'message'  => __( 'You must log in to access the page you requested.', 'buddypress' )
 	);
 
 	$r = wp_parse_args( $args, $defaults );
+	$r = apply_filters( 'bp_core_no_access', $r );
 	extract( $r, EXTR_SKIP );
 
-	// Apply filters to these variables
-	$mode		= apply_filters( 'bp_no_access_mode', $mode, $root, $redirect, $message );
-	$redirect	= apply_filters( 'bp_no_access_redirect', $redirect, $root, $message, $mode );
-	$root		= trailingslashit( apply_filters( 'bp_no_access_root', $root, $redirect, $message, $mode ) );
-	$message	= apply_filters( 'bp_no_access_message', $message, $root, $redirect, $mode );
+	/**
+	 * @ignore Ignore these filters and use 'bp_core_no_access' above
+	 */
+	$mode		= apply_filters( 'bp_no_access_mode',     $mode,     $root,     $redirect, $message );
+	$redirect	= apply_filters( 'bp_no_access_redirect', $redirect, $root,     $message,  $mode    );
+	$root		= apply_filters( 'bp_no_access_root',     $root,     $redirect, $message,  $mode    );
+	$message	= apply_filters( 'bp_no_access_message',  $message,  $root,     $redirect, $mode    );
+	$root       = trailingslashit( $root );
 
 	switch ( $mode ) {
+
 		// Option to redirect to wp-login.php
 		// Error message is displayed with bp_core_no_access_wp_login_error()
 		case 2 :
-			if ( $redirect ) {
-				bp_core_redirect( wp_login_url( $redirect ) . '&action=bpnoaccess' );
+			if ( !empty( $redirect ) ) {
+				bp_core_redirect( add_query_arg( array( 'action' => 'bpnoaccess' ), wp_login_url( $redirect ) ) );
 			} else {
 				bp_core_redirect( $root );
 			}
@@ -429,13 +485,12 @@ function bp_core_no_access( $args = '' ) {
 		// Error message is displayed with bp_core_add_message()
 		case 1 :
 		default :
-			if ( $redirect ) {
+
+			$url = $root;
+			if ( !empty( $redirect ) )
 				$url = add_query_arg( 'redirect_to', urlencode( $redirect ), $root );
-			} else {
-				$url = $root;
-			}
 
-			if ( $message ) {
+			if ( !empty( $message ) ) {
 				bp_core_add_message( $message, 'error' );
 			}
 
@@ -451,7 +506,7 @@ function bp_core_no_access( $args = '' ) {
  *
  * @package BuddyPress Core
  * @global $error
- * @since 1.5
+ * @since BuddyPress (1.5)
  */
 function bp_core_no_access_wp_login_error() {
 	global $error;
@@ -463,4 +518,220 @@ function bp_core_no_access_wp_login_error() {
 }
 add_action( 'login_form_bpnoaccess', 'bp_core_no_access_wp_login_error' );
 
+/**
+ * Canonicalizes BuddyPress URLs
+ *
+ * This function ensures that requests for BuddyPress content are always redirected to their
+ * canonical versions. Canonical versions are always trailingslashed, and are typically the most
+ * general possible versions of the URL - eg, example.com/groups/mygroup/ instead of
+ * example.com/groups/mygroup/home/
+ *
+ * @since 1.6
+ * @see BP_Members_Component::setup_globals() where $bp->canonical_stack['base_url'] and
+ *   ['component'] may be set
+ * @see bp_core_new_nav_item() where $bp->canonical_stack['action'] may be set
+ * @uses bp_get_canonical_url()
+ * @uses bp_get_requested_url()
+ */
+function bp_redirect_canonical() {
+	global $bp;
+
+	if ( !bp_is_blog_page() && apply_filters( 'bp_do_redirect_canonical', true ) ) {
+		// If this is a POST request, don't do a canonical redirect.
+		// This is for backward compatibility with plugins that submit form requests to
+		// non-canonical URLs. Plugin authors should do their best to use canonical URLs in
+		// their form actions.
+		if ( !empty( $_POST ) ) {
+			return;
+		}
+
+		// build the URL in the address bar
+		$requested_url  = bp_get_requested_url();
+
+		// Stash query args
+		$url_stack      = explode( '?', $requested_url );
+		$req_url_clean  = $url_stack[0];
+		$query_args     = isset( $url_stack[1] ) ? $url_stack[1] : '';
+
+		$canonical_url  = bp_get_canonical_url();
+
+		// Only redirect if we've assembled a URL different from the request
+		if ( $canonical_url !== $req_url_clean ) {
+
+			// Template messages have been deleted from the cookie by this point, so
+			// they must be readded before redirecting
+			if ( isset( $bp->template_message ) ) {
+				$message      = stripslashes( $bp->template_message );
+				$message_type = isset( $bp->template_message_type ) ? $bp->template_message_type : 'success';
+
+				bp_core_add_message( $message, $message_type );
+			}
+
+			if ( !empty( $query_args ) ) {
+				$canonical_url .= '?' . $query_args;
+			}
+
+			bp_core_redirect( $canonical_url, 301 );
+		}
+	}
+}
+
+/**
+ * Output rel=canonical header tag for BuddyPress content
+ *
+ * @since 1.6
+ */
+function bp_rel_canonical() {
+	$canonical_url = bp_get_canonical_url();
+
+	// Output rel=canonical tag
+	echo "<link rel='canonical' href='" . esc_attr( $canonical_url ) . "' />\n";
+}
+
+/**
+ * Returns the canonical URL of the current page
+ *
+ * @since BuddyPress (1.6)
+ * @uses apply_filters() Filter bp_get_canonical_url to modify return value
+ * @param array $args
+ * @return string
+ */
+function bp_get_canonical_url( $args = array() ) {
+	global $bp;
+
+	// For non-BP content, return the requested url, and let WP do the work
+	if ( bp_is_blog_page() ) {
+		return bp_get_requested_url();
+	}
+
+	$defaults = array(
+		'include_query_args' => false // Include URL arguments, eg ?foo=bar&foo2=bar2
+	);
+	$r = wp_parse_args( $args, $defaults );
+	extract( $r );
+
+	if ( empty( $bp->canonical_stack['canonical_url'] ) ) {
+		// Build the URL in the address bar
+		$requested_url  = bp_get_requested_url();
+
+		// Stash query args
+		$url_stack      = explode( '?', $requested_url );
+
+		// Build the canonical URL out of the redirect stack
+		if ( isset( $bp->canonical_stack['base_url'] ) )
+			$url_stack[0] = $bp->canonical_stack['base_url'];
+
+		if ( isset( $bp->canonical_stack['component'] ) )
+			$url_stack[0] = trailingslashit( $url_stack[0] . $bp->canonical_stack['component'] );
+
+		if ( isset( $bp->canonical_stack['action'] ) )
+			$url_stack[0] = trailingslashit( $url_stack[0] . $bp->canonical_stack['action'] );
+
+		if ( !empty( $bp->canonical_stack['action_variables'] ) ) {
+			foreach( (array) $bp->canonical_stack['action_variables'] as $av ) {
+				$url_stack[0] = trailingslashit( $url_stack[0] . $av );
+			}
+		}
+
+		// Add trailing slash
+		$url_stack[0] = trailingslashit( $url_stack[0] );
+
+		// Stash in the $bp global
+		$bp->canonical_stack['canonical_url'] = implode( '?', $url_stack );
+	}
+
+	$canonical_url = $bp->canonical_stack['canonical_url'];
+
+	if ( !$include_query_args ) {
+		$canonical_url = array_pop( array_reverse( explode( '?', $canonical_url ) ) );
+	}
+
+	return apply_filters( 'bp_get_canonical_url', $canonical_url, $args );
+}
+
+/**
+ * Returns the URL as requested on the current page load by the user agent
+ *
+ * @since BuddyPress (1.6)
+ * @return string
+ */
+function bp_get_requested_url() {
+	global $bp;
+
+	if ( empty( $bp->canonical_stack['requested_url'] ) ) {
+		$bp->canonical_stack['requested_url']  = is_ssl() ? 'https://' : 'http://';
+		$bp->canonical_stack['requested_url'] .= $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
+	}
+
+	return $bp->canonical_stack['requested_url'];
+}
+
+/**
+ * Remove WordPress's really awesome canonical redirect if we are trying to load
+ * BuddyPress specific content. Avoids issues with WordPress thinking that a
+ * BuddyPress URL might actually be a blog post or page.
+ *
+ * This function should be considered temporary, and may be removed without
+ * notice in future versions of BuddyPress.
+ *
+ * @since BuddyPress (1.6)
+ * @uses bp_is_blog_page()
+ */
+function _bp_maybe_remove_redirect_canonical() {
+	if ( ! bp_is_blog_page() )
+		remove_action( 'template_redirect', 'redirect_canonical' );
+}
+add_action( 'bp_init', '_bp_maybe_remove_redirect_canonical' );
+
+/**
+ * Rehook maybe_redirect_404() to run later than the default
+ *
+ * WordPress's maybe_redirect_404() allows admins on a multisite installation
+ * to define 'NOBLOGREDIRECT', a URL to which 404 requests will be redirected.
+ * maybe_redirect_404() is hooked to template_redirect at priority 10, which
+ * creates a race condition with bp_template_redirect(), our piggyback hook.
+ * Due to a legacy bug in BuddyPress, internal BP content (such as members and
+ * groups) is marked 404 in $wp_query until bp_core_load_template(), when BP
+ * manually overrides the automatic 404. However, the race condition with
+ * maybe_redirect_404() means that this manual un-404-ing doesn't happen in
+ * time, with the results that maybe_redirect_404() thinks that the page is
+ * a legitimate 404, and redirects incorrectly to NOBLOGREDIRECT.
+ *
+ * By switching maybe_redirect_404() to catch at a higher priority, we avoid
+ * the race condition. If bp_core_load_template() runs, it dies before reaching
+ * maybe_redirect_404(). If bp_core_load_template() does not run, it means that
+ * the 404 is legitimate, and maybe_redirect_404() can proceed as expected.
+ *
+ * This function will be removed in a later version of BuddyPress. Plugins
+ * (and plugin authors!) should ignore it.
+ *
+ * @since 1.6.1
+ *
+ * @link http://buddypress.trac.wordpress.org/ticket/4329
+ * @link http://buddypress.trac.wordpress.org/ticket/4415
+ */
+function _bp_rehook_maybe_redirect_404() {
+	if ( defined( 'NOBLOGREDIRECT' ) ) {
+		remove_action( 'template_redirect', 'maybe_redirect_404' );
+		add_action( 'template_redirect', 'maybe_redirect_404', 100 );
+	}
+}
+add_action( 'template_redirect', '_bp_rehook_maybe_redirect_404', 1 );
+
+/**
+ * Remove WordPress's rel=canonical HTML tag if we are trying to load BuddyPress
+ * specific content.
+ *
+ * This function should be considered temporary, and may be removed without
+ * notice in future versions of BuddyPress.
+ *
+ * @since 1.6
+ */
+function _bp_maybe_remove_rel_canonical() {
+	if ( ! bp_is_blog_page() && ! is_404() ) {
+		remove_action( 'wp_head', 'rel_canonical' );
+		add_action( 'bp_head', 'bp_rel_canonical' );
+	}
+}
+add_action( 'wp_head', '_bp_maybe_remove_rel_canonical', 8 );
 ?>
\ No newline at end of file
diff --git a/wp-content/plugins/buddypress/bp-core/bp-core-classes.php b/wp-content/plugins/buddypress/bp-core/bp-core-classes.php
index 2bd18277e938dbb72069e130d9ce9f45838dfe46..75e622635faab4ff073bec5282a0a605bbf19334 100644
--- a/wp-content/plugins/buddypress/bp-core/bp-core-classes.php
+++ b/wp-content/plugins/buddypress/bp-core/bp-core-classes.php
@@ -109,13 +109,14 @@ class BP_Core_User {
 	var $total_groups;
 
 	/**
-	 * PHP4 constructor.
+	 * Profile information for the specific user.
 	 *
-	 * @see BP_Core_User::__construct()
+	 * @since BuddyPress (1.2)
+	 * @var array
 	 */
-	function bp_core_user( $user_id, $populate_extras = false ) {
-		$this->__construct( $user_id, $populate_extras );
-	}
+	public $profile_data;
+
+	/** Public Methods *******************************************************/
 
 	/**
 	 * Class constructor.
@@ -124,19 +125,21 @@ class BP_Core_User {
 	 * @param boolean $populate_extras Whether to fetch extra information such as group/friendship counts or not.
 	 */
 	function __construct( $user_id, $populate_extras = false ) {
-		if ( $user_id ) {
+		if ( !empty( $user_id ) ) {
 			$this->id = $user_id;
 			$this->populate();
 
-			if ( $populate_extras )
+			if ( !empty( $populate_extras ) ) {
 				$this->populate_extras();
+			}
 		}
 	}
 
+	/** Private Methods *******************************************************/
+
 	/**
 	 * Populate the instantiated class with data based on the User ID provided.
 	 *
-	 * @global object $bp Global BuddyPress settings object
 	 * @uses bp_core_get_userurl() Returns the URL with no HTML markup for a user based on their user id
 	 * @uses bp_core_get_userlink() Returns a HTML formatted link for a user with the user's full name as the link text
 	 * @uses bp_core_get_user_email() Returns the email address for the user based on user ID
@@ -145,7 +148,6 @@ class BP_Core_User {
 	 * @uses bp_profile_last_updated_date() Returns the last updated date for a user.
 	 */
 	function populate() {
-		global $bp;
 
 		if ( bp_is_active( 'xprofile' ) )
 			$this->profile_data = $this->get_profile_data();
@@ -169,26 +171,24 @@ class BP_Core_User {
 		wp_cache_set( 'bp_user_email_' . $this->id, $this->email, 'bp' );
 		wp_cache_set( 'bp_user_url_' . $this->id, $this->user_url, 'bp' );
 
-		$this->avatar       = bp_core_fetch_avatar( array( 'item_id' => $this->id, 'type' => 'full'  ) );
-		$this->avatar_thumb = bp_core_fetch_avatar( array( 'item_id' => $this->id, 'type' => 'thumb' ) );
-		$this->avatar_mini  = bp_core_fetch_avatar( array( 'item_id' => $this->id, 'type' => 'thumb', 'width' => 30, 'height' => 30 ) );
+		$this->avatar       = bp_core_fetch_avatar( array( 'item_id' => $this->id, 'type' => 'full', 'alt' => sprintf( __( 'Avatar of %s', 'buddypress' ), $this->fullname ) ) );
+		$this->avatar_thumb = bp_core_fetch_avatar( array( 'item_id' => $this->id, 'type' => 'thumb', 'alt' => sprintf( __( 'Avatar of %s', 'buddypress' ), $this->fullname ) ) );
+		$this->avatar_mini  = bp_core_fetch_avatar( array( 'item_id' => $this->id, 'type' => 'thumb', 'alt' => sprintf( __( 'Avatar of %s', 'buddypress' ), $this->fullname ), 'width' => 30, 'height' => 30 ) );
 		$this->last_active  = bp_core_get_last_activity( bp_get_user_meta( $this->id, 'last_activity', true ), __( 'active %s', 'buddypress' ) );
 	}
 
 	/**
 	 * Populates extra fields such as group and friendship counts.
-	 *
-	 * @global object $bp Global BuddyPress settings object
 	 */
 	function populate_extras() {
-		global $bp;
 
-		if ( bp_is_active( 'friends' ) )
+		if ( bp_is_active( 'friends' ) ) {
 			$this->total_friends = BP_Friends_Friendship::total_friend_count( $this->id );
+		}
 
 		if ( bp_is_active( 'groups' ) ) {
 			$this->total_groups = BP_Groups_Member::total_group_count( $this->id );
-			$this->total_groups = sprintf( _n( '%d group', '%d groups', $this->total_groups ), $this->total_groups );
+			$this->total_groups = sprintf( _n( '%d group', '%d groups', $this->total_groups, 'buddypress' ), $this->total_groups );
 		}
 	}
 
@@ -196,7 +196,7 @@ class BP_Core_User {
 		return BP_XProfile_ProfileData::get_all_for_user( $this->id );
 	}
 
-	/** Static Functions ******************************************************/
+	/** Static Methods ********************************************************/
 
 	function get_users( $type, $limit = 0, $page = 1, $user_id = 0, $include = false, $search_terms = false, $populate_extras = true, $exclude = false, $meta_key = false, $meta_value = false ) {
 		global $wpdb, $bp;
@@ -205,81 +205,99 @@ class BP_Core_User {
 
 		$sql['select_main'] = "SELECT DISTINCT u.ID as id, u.user_registered, u.user_nicename, u.user_login, u.display_name, u.user_email";
 
-		if ( 'active' == $type || 'online' == $type || 'newest' == $type  )
+		if ( 'active' == $type || 'online' == $type || 'newest' == $type  ) {
 			$sql['select_active'] = ", um.meta_value as last_activity";
+		}
 
-		if ( 'popular' == $type )
+		if ( 'popular' == $type ) {
 			$sql['select_popular'] = ", um.meta_value as total_friend_count";
+		}
 
-		if ( 'alphabetical' == $type )
+		if ( 'alphabetical' == $type ) {
 			$sql['select_alpha'] = ", pd.value as fullname";
+		}
 
 		if ( $meta_key ) {
 			$sql['select_meta'] = ", umm.meta_key";
 
-			if ( $meta_value )
+			if ( $meta_value ) {
 				$sql['select_meta'] .= ", umm.meta_value";
+			}
 		}
 
-		$sql['from'] = "FROM $wpdb->users u LEFT JOIN $wpdb->usermeta um ON um.user_id = u.ID";
+		$sql['from'] = "FROM {$wpdb->users} u LEFT JOIN {$wpdb->usermeta} um ON um.user_id = u.ID";
 
 		// We search against xprofile fields, so we must join the table
-		if ( $search_terms && bp_is_active( 'xprofile' ) )
+		if ( $search_terms && bp_is_active( 'xprofile' ) ) {
 			$sql['join_profiledata_search'] = "LEFT JOIN {$bp->profile->table_name_data} spd ON u.ID = spd.user_id";
+		}
 
 		// Alphabetical sorting is done by the xprofile Full Name field
-		if ( 'alphabetical' == $type )
+		if ( 'alphabetical' == $type ) {
 			$sql['join_profiledata_alpha'] = "LEFT JOIN {$bp->profile->table_name_data} pd ON u.ID = pd.user_id";
+		}
 
-		if ( $meta_key )
+		if ( $meta_key ) {
 			$sql['join_meta'] = "LEFT JOIN {$wpdb->usermeta} umm ON umm.user_id = u.ID";
+		}
 
 		$sql['where'] = 'WHERE ' . bp_core_get_status_sql( 'u.' );
 
-		if ( 'active' == $type || 'online' == $type || 'newest' == $type )
+		if ( 'active' == $type || 'online' == $type || 'newest' == $type ) {
 			$sql['where_active'] = $wpdb->prepare( "AND um.meta_key = %s", bp_get_user_meta_key( 'last_activity' ) );
+		}
 
-		if ( 'popular' == $type )
+		if ( 'popular' == $type ) {
 			$sql['where_popular'] = $wpdb->prepare( "AND um.meta_key = %s", bp_get_user_meta_key( 'total_friend_count' ) );
+		}
 
-		if ( 'online' == $type )
+		if ( 'online' == $type ) {
 			$sql['where_online'] = "AND DATE_ADD( um.meta_value, INTERVAL 5 MINUTE ) >= UTC_TIMESTAMP()";
+		}
 
-		if ( 'alphabetical' == $type )
+		if ( 'alphabetical' == $type ) {
 			$sql['where_alpha'] = "AND pd.field_id = 1";
+		}
 
-		if ( !empty( $exclude ) )
+		if ( !empty( $exclude ) ) {
 			$sql['where_exclude'] = "AND u.ID NOT IN ({$exclude})";
-
-		if ( $include ) {
-			if ( is_array( $include ) )
-				$uids = $wpdb->escape( implode( ',', (array)$include ) );
-			else
-				$uids = $wpdb->escape( $include );
-
-			if ( !empty( $uids ) )
-				$sql['where_users'] = "AND u.ID IN ({$uids})";
 		}
 
-		else if ( $user_id && bp_is_active( 'friends' ) ) {
-			$friend_ids = friends_get_friend_user_ids( $user_id );
-			$friend_ids = $wpdb->escape( implode( ',', (array)$friend_ids ) );
+		// Passing an $include value of 0 or '0' will necessarily result in an empty set
+		// returned. The default value of false will hit the 'else' clause.
+		if ( 0 === $include || '0' === $include ) {
+			$sql['where_users'] = "AND 0 = 1";
+		} else {
+			if ( !empty( $include ) ) {
+				if ( is_array( $include ) ) {
+					$uids = $wpdb->escape( implode( ',', (array) $include ) );
+				} else {
+					$uids = $wpdb->escape( $include );
+				}
 
-			if ( !empty( $friend_ids ) )
-				$sql['where_friends'] = "AND u.ID IN ({$friend_ids})";
+				if ( !empty( $uids ) ) {
+					$sql['where_users'] = "AND u.ID IN ({$uids})";
+				}
+			} elseif ( !empty( $user_id ) && bp_is_active( 'friends' ) ) {
+				$friend_ids = friends_get_friend_user_ids( $user_id );
+				$friend_ids = $wpdb->escape( implode( ',', (array) $friend_ids ) );
 
-			// User has no friends, return false since there will be no users to fetch.
-			else
-				return false;
+				if ( !empty( $friend_ids ) ) {
+					$sql['where_friends'] = "AND u.ID IN ({$friend_ids})";
 
+				// User has no friends, return false since there will be no users to fetch.
+				} else {
+					return false;
+				}
+			}
 		}
 
-		if ( $search_terms && bp_is_active( 'xprofile' ) ) {
+		if ( !empty( $search_terms ) && bp_is_active( 'xprofile' ) ) {
 			$search_terms             = like_escape( $wpdb->escape( $search_terms ) );
 			$sql['where_searchterms'] = "AND spd.value LIKE '%%$search_terms%%'";
 		}
 
-		if ( $meta_key ) {
+		if ( !empty( $meta_key ) ) {
 			$sql['where_meta'] = $wpdb->prepare( " AND umm.meta_key = %s", $meta_key );
 
 			// If a meta value is provided, match it
@@ -306,32 +324,37 @@ class BP_Core_User {
 				break;
 		}
 
-		if ( $limit && $page )
+		if ( !empty( $limit ) && !empty( $page ) ) {
 			$sql['pagination'] = $wpdb->prepare( "LIMIT %d, %d", intval( ( $page - 1 ) * $limit), intval( $limit ) );
+		}
 
 		// Get paginated results
-		$paged_users_sql = apply_filters( 'bp_core_get_paged_users_sql', join( ' ', (array)$sql ), $sql );
+		$paged_users_sql = apply_filters( 'bp_core_get_paged_users_sql', join( ' ', (array) $sql ), $sql );
 		$paged_users     = $wpdb->get_results( $paged_users_sql );
 
 		// Re-jig the SQL so we can get the total user count
 		unset( $sql['select_main'] );
 
-		if ( !empty( $sql['select_active'] ) )
+		if ( !empty( $sql['select_active'] ) ) {
 			unset( $sql['select_active'] );
+		}
 
-		if ( !empty( $sql['select_popular'] ) )
+		if ( !empty( $sql['select_popular'] ) ) {
 			unset( $sql['select_popular'] );
+		}
 
-		if ( !empty( $sql['select_alpha'] ) )
+		if ( !empty( $sql['select_alpha'] ) ) {
 			unset( $sql['select_alpha'] );
+		}
 
-		if ( !empty( $sql['pagination'] ) )
+		if ( !empty( $sql['pagination'] ) ) {
 			unset( $sql['pagination'] );
+		}
 
 		array_unshift( $sql, "SELECT COUNT(DISTINCT u.ID)" );
 
 		// Get total user results
-		$total_users_sql = apply_filters( 'bp_core_get_total_users_sql', join( ' ', (array)$sql ), $sql );
+		$total_users_sql = apply_filters( 'bp_core_get_total_users_sql', join( ' ', (array) $sql ), $sql );
 		$total_users     = $wpdb->get_var( $total_users_sql );
 
 		/***
@@ -341,10 +364,11 @@ class BP_Core_User {
 		if ( !empty( $populate_extras ) ) {
 			$user_ids = array();
 
-			foreach ( (array)$paged_users as $user )
+			foreach ( (array) $paged_users as $user ) {
 				$user_ids[] = $user->id;
+			}
 
-			$user_ids = $wpdb->escape( join( ',', (array)$user_ids ) );
+			$user_ids = $wpdb->escape( join( ',', (array) $user_ids ) );
 
 			// Add additional data to the returned results
 			$paged_users = BP_Core_User::get_user_extras( $paged_users, $user_ids, $type );
@@ -357,7 +381,7 @@ class BP_Core_User {
 	/**
 	 * Fetches the user details for all the users who username starts with the letter given.
 	 *
-	 * @global object $bp Global BuddyPress settings object
+	 * @global BuddyPress $bp The one true BuddyPress instance
 	 * @global wpdb $wpdb WordPress database object
 	 * @param string $letter The letter the users names are to start with.
 	 * @param integer $limit The number of users we wish to retrive.
@@ -371,8 +395,9 @@ class BP_Core_User {
 		global $bp, $wpdb;
 
 		$pag_sql = '';
-		if ( $limit && $page )
+		if ( $limit && $page ) {
 			$pag_sql = $wpdb->prepare( " LIMIT %d, %d", intval( ( $page - 1 ) * $limit), intval( $limit ) );
+		}
 
 		// Multibyte compliance
 		if ( function_exists( 'mb_strlen' ) ) {
@@ -390,25 +415,29 @@ class BP_Core_User {
 
 		$exclude_sql = ( !empty( $exclude ) ) ? " AND u.ID NOT IN ({$exclude})" : "";
 
-		$total_users_sql = apply_filters( 'bp_core_users_by_letter_count_sql', $wpdb->prepare( "SELECT COUNT(DISTINCT u.ID) FROM {$wpdb->users} u LEFT JOIN {$bp->profile->table_name_data} pd ON u.ID = pd.user_id LEFT JOIN {$bp->profile->table_name_fields} pf ON pd.field_id = pf.id WHERE {$status_sql} AND pf.name = %s {$exclude_sql} AND pd.value LIKE '$letter%%'  ORDER BY pd.value ASC", bp_xprofile_fullname_field_name() ), $letter );
-		$paged_users_sql = apply_filters( 'bp_core_users_by_letter_sql', $wpdb->prepare( "SELECT DISTINCT u.ID as id, u.user_registered, u.user_nicename, u.user_login, u.user_email FROM {$wpdb->users} u LEFT JOIN {$bp->profile->table_name_data} pd ON u.ID = pd.user_id LEFT JOIN {$bp->profile->table_name_fields} pf ON pd.field_id = pf.id WHERE {$status_sql} AND pf.name = %s {$exclude_sql} AND pd.value LIKE '$letter%%' ORDER BY pd.value ASC{$pag_sql}", bp_xprofile_fullname_field_name() ), $letter, $pag_sql );
+		$total_users_sql = apply_filters( 'bp_core_users_by_letter_count_sql', $wpdb->prepare( "SELECT COUNT(DISTINCT u.ID) FROM {$wpdb->users} u LEFT JOIN {$bp->profile->table_name_data} pd ON u.ID = pd.user_id LEFT JOIN {$bp->profile->table_name_fields} pf ON pd.field_id = pf.id WHERE {$status_sql} AND pf.name = %s {$exclude_sql} AND pd.value LIKE '{$letter}%%'  ORDER BY pd.value ASC", bp_xprofile_fullname_field_name() ), $letter );
+		$paged_users_sql = apply_filters( 'bp_core_users_by_letter_sql',       $wpdb->prepare( "SELECT DISTINCT u.ID as id, u.user_registered, u.user_nicename, u.user_login, u.user_email FROM {$wpdb->users} u LEFT JOIN {$bp->profile->table_name_data} pd ON u.ID = pd.user_id LEFT JOIN {$bp->profile->table_name_fields} pf ON pd.field_id = pf.id WHERE {$status_sql} AND pf.name = %s {$exclude_sql} AND pd.value LIKE '{$letter}%%' ORDER BY pd.value ASC{$pag_sql}", bp_xprofile_fullname_field_name() ), $letter, $pag_sql );
 
 		$total_users = $wpdb->get_var( $total_users_sql );
 		$paged_users = $wpdb->get_results( $paged_users_sql );
 
 		/***
-		 * Lets fetch some other useful data in a separate queries, this will be faster than querying the data for every user in a list.
-		 * We can't add these to the main query above since only users who have this information will be returned (since the much of the data is in usermeta and won't support any type of directional join)
+		 * Lets fetch some other useful data in a separate queries, this will be
+		 * faster than querying the data for every user in a list. We can't add
+		 * these to the main query above since only users who have this
+		 * information will be returned (since the much of the data is in
+		 * usermeta and won't support any type of directional join)
 		 */
 		$user_ids = array();
-		foreach ( (array)$paged_users as $user )
+		foreach ( (array) $paged_users as $user )
 			$user_ids[] = $user->id;
 
-		$user_ids = $wpdb->escape( join( ',', (array)$user_ids ) );
+		$user_ids = $wpdb->escape( join( ',', (array) $user_ids ) );
 
-		/* Add additional data to the returned results */
-		if ( $populate_extras )
+		// Add additional data to the returned results
+		if ( $populate_extras ) {
 			$paged_users = BP_Core_User::get_user_extras( $paged_users, $user_ids );
+		}
 
 		return array( 'users' => $paged_users, 'total' => $total_users );
 	}
@@ -416,7 +445,6 @@ class BP_Core_User {
 	/**
 	 * Get details of specific users from the database
 	 *
-	 * @global object $bp Global BuddyPress settings object
 	 * @global wpdb $wpdb WordPress database object
 	 * @param array $user_ids The user IDs of the users who we wish to fetch information on.
 	 * @param integer $limit The limit of results we want.
@@ -426,29 +454,34 @@ class BP_Core_User {
 	 * @static
 	 */
 	function get_specific_users( $user_ids, $limit = null, $page = 1, $populate_extras = true ) {
-		global $bp, $wpdb;
+		global $wpdb;
 
 		$pag_sql = '';
 		if ( $limit && $page )
 			$pag_sql = $wpdb->prepare( " LIMIT %d, %d", intval( ( $page - 1 ) * $limit), intval( $limit ) );
 
+		// @todo remove? $user_sql is not used here
 		$user_sql   = " AND user_id IN ( " . $wpdb->escape( $user_ids ) . " ) ";
 		$status_sql = bp_core_get_status_sql();
 
-		$total_users_sql = apply_filters( 'bp_core_get_specific_users_count_sql', $wpdb->prepare( "SELECT COUNT(DISTINCT ID) FROM {$wpdb->users} WHERE {$status_sql} AND ID IN ( " . $wpdb->escape( $user_ids ) . " ) " ), $wpdb->escape( $user_ids ) );
-		$paged_users_sql = apply_filters( 'bp_core_get_specific_users_count_sql', $wpdb->prepare( "SELECT DISTINCT ID as id, user_registered, user_nicename, user_login, user_email FROM {$wpdb->users} WHERE {$status_sql} AND ID IN ( " . $wpdb->escape( $user_ids ) . " ) {$pag_sql}" ), $wpdb->escape( $user_ids ) );
+		$total_users_sql = apply_filters( 'bp_core_get_specific_users_count_sql', "SELECT COUNT(DISTINCT ID) FROM {$wpdb->users} WHERE {$status_sql} AND ID IN ( " . $wpdb->escape( $user_ids ) . " ) ", $wpdb->escape( $user_ids ) );
+		$paged_users_sql = apply_filters( 'bp_core_get_specific_users_count_sql', "SELECT DISTINCT ID as id, user_registered, user_nicename, user_login, user_email FROM {$wpdb->users} WHERE {$status_sql} AND ID IN ( " . $wpdb->escape( $user_ids ) . " ) {$pag_sql}", $wpdb->escape( $user_ids ) );
 
 		$total_users = $wpdb->get_var( $total_users_sql );
 		$paged_users = $wpdb->get_results( $paged_users_sql );
 
 		/***
-		 * Lets fetch some other useful data in a separate queries, this will be faster than querying the data for every user in a list.
-		 * We can't add these to the main query above since only users who have this information will be returned (since the much of the data is in usermeta and won't support any type of directional join)
+		 * Lets fetch some other useful data in a separate queries, this will be
+		 * faster than querying the data for every user in a list. We can't add
+		 * these to the main query above since only users who have this
+		 * information will be returned (since the much of the data is in
+		 * usermeta and won't support any type of directional join)
 		 */
 
-		/* Add additional data to the returned results */
-		if ( $populate_extras )
+		// Add additional data to the returned results
+		if ( !empty( $populate_extras ) ) {
 			$paged_users = BP_Core_User::get_user_extras( $paged_users, $user_ids );
+		}
 
 		return array( 'users' => $paged_users, 'total' => $total_users );
 	}
@@ -456,7 +489,7 @@ class BP_Core_User {
 	/**
 	 * Find users who match on the value of an xprofile data.
 	 *
-	 * @global object $bp Global BuddyPress settings object
+	 * @global BuddyPress $bp The one true BuddyPress instance
 	 * @global wpdb $wpdb WordPress database object
 	 * @param string $search_terms The terms to search the profile table value column for.
 	 * @param integer $limit The limit of results we want.
@@ -468,13 +501,14 @@ class BP_Core_User {
 	function search_users( $search_terms, $limit = null, $page = 1, $populate_extras = true ) {
 		global $bp, $wpdb;
 
-		$pag_sql = $limit && $page ? $wpdb->prepare( " LIMIT %d, %d", intval( ( $page - 1 ) * intval( $limit ) ), intval( $limit ) ) : '';
+		$user_ids = array();
+		$pag_sql  = $limit && $page ? $wpdb->prepare( " LIMIT %d, %d", intval( ( $page - 1 ) * intval( $limit ) ), intval( $limit ) ) : '';
 
 		$search_terms = like_escape( $wpdb->escape( $search_terms ) );
 		$status_sql   = bp_core_get_status_sql( 'u.' );
 
-		$total_users_sql = apply_filters( 'bp_core_search_users_count_sql', "SELECT COUNT(DISTINCT u.ID) as id FROM {$wpdb->users} u LEFT JOIN {$bp->profile->table_name_data} pd ON u.ID = pd.user_id WHERE {$status_sql} AND pd.value LIKE '%%$search_terms%%' ORDER BY pd.value ASC", $search_terms );
-		$paged_users_sql = apply_filters( 'bp_core_search_users_sql', "SELECT DISTINCT u.ID as id, u.user_registered, u.user_nicename, u.user_login, u.user_email FROM {$wpdb->users} u LEFT JOIN {$bp->profile->table_name_data} pd ON u.ID = pd.user_id WHERE {$status_sql} AND pd.value LIKE '%%$search_terms%%' ORDER BY pd.value ASC{$pag_sql}", $search_terms, $pag_sql );
+		$total_users_sql = apply_filters( 'bp_core_search_users_count_sql', "SELECT COUNT(DISTINCT u.ID) as id FROM {$wpdb->users} u LEFT JOIN {$bp->profile->table_name_data} pd ON u.ID = pd.user_id WHERE {$status_sql} AND pd.value LIKE '%%{$search_terms}%%' ORDER BY pd.value ASC", $search_terms );
+		$paged_users_sql = apply_filters( 'bp_core_search_users_sql',       "SELECT DISTINCT u.ID as id, u.user_registered, u.user_nicename, u.user_login, u.user_email FROM {$wpdb->users} u LEFT JOIN {$bp->profile->table_name_data} pd ON u.ID = pd.user_id WHERE {$status_sql} AND pd.value LIKE '%%{$search_terms}%%' ORDER BY pd.value ASC{$pag_sql}", $search_terms, $pag_sql );
 
 		$total_users = $wpdb->get_var( $total_users_sql );
 		$paged_users = $wpdb->get_results( $paged_users_sql );
@@ -483,10 +517,10 @@ class BP_Core_User {
 		 * Lets fetch some other useful data in a separate queries, this will be faster than querying the data for every user in a list.
 		 * We can't add these to the main query above since only users who have this information will be returned (since the much of the data is in usermeta and won't support any type of directional join)
 		 */
-		foreach ( (array)$paged_users as $user )
+		foreach ( (array) $paged_users as $user )
 			$user_ids[] = $user->id;
 
-		$user_ids = $wpdb->escape( join( ',', (array)$user_ids ) );
+		$user_ids = $wpdb->escape( join( ',', (array) $user_ids ) );
 
 		// Add additional data to the returned results
 		if ( $populate_extras )
@@ -500,7 +534,7 @@ class BP_Core_User {
 	 *
 	 * Accepts multiple user IDs to fetch data for.
 	 *
-	 * @global object $bp Global BuddyPress settings object
+	 * @global BuddyPress $bp The one true BuddyPress instance
 	 * @global wpdb $wpdb WordPress database object
 	 * @param array $paged_users an array of stdClass containing the users
 	 * @param string $user_ids the user ids to select information about
@@ -518,7 +552,7 @@ class BP_Core_User {
 		if ( bp_is_active( 'xprofile' ) && 'alphabetical' != $type ) {
 			$names = $wpdb->get_results( $wpdb->prepare( "SELECT pd.user_id as id, pd.value as fullname FROM {$bp->profile->table_name_fields} pf, {$bp->profile->table_name_data} pd WHERE pf.id = pd.field_id AND pf.name = %s AND pd.user_id IN ( {$user_ids} )", bp_xprofile_fullname_field_name() ) );
 			for ( $i = 0, $count = count( $paged_users ); $i < $count; ++$i ) {
-				foreach ( (array)$names as $name ) {
+				foreach ( (array) $names as $name ) {
 					if ( $name->id == $paged_users[$i]->id )
 						$paged_users[$i]->fullname = $name->fullname;
 				}
@@ -529,18 +563,18 @@ class BP_Core_User {
 		if ( 'popular' != $type ) {
 			$friend_count = $wpdb->get_results( $wpdb->prepare( "SELECT user_id as id, meta_value as total_friend_count FROM {$wpdb->usermeta} WHERE meta_key = %s AND user_id IN ( {$user_ids} )", bp_get_user_meta_key( 'total_friend_count' ) ) );
 			for ( $i = 0, $count = count( $paged_users ); $i < $count; ++$i ) {
-				foreach ( (array)$friend_count as $fcount ) {
+				foreach ( (array) $friend_count as $fcount ) {
 					if ( $fcount->id == $paged_users[$i]->id )
-						$paged_users[$i]->total_friend_count = (int)$fcount->total_friend_count;
+						$paged_users[$i]->total_friend_count = (int) $fcount->total_friend_count;
 				}
 			}
 		}
 
 		// Fetch whether or not the user is a friend
 		if ( bp_is_active( 'friends' ) ) {
-			$friend_status = $wpdb->get_results( $wpdb->prepare( "SELECT initiator_user_id, friend_user_id, is_confirmed FROM {$bp->friends->table_name} WHERE (initiator_user_id = %d AND friend_user_id IN ( {$user_ids} ) ) OR (initiator_user_id IN ( {$user_ids} ) AND friend_user_id = %d )", $bp->loggedin_user->id, $bp->loggedin_user->id ) );
+			$friend_status = $wpdb->get_results( $wpdb->prepare( "SELECT initiator_user_id, friend_user_id, is_confirmed FROM {$bp->friends->table_name} WHERE (initiator_user_id = %d AND friend_user_id IN ( {$user_ids} ) ) OR (initiator_user_id IN ( {$user_ids} ) AND friend_user_id = %d )", bp_loggedin_user_id(), bp_loggedin_user_id() ) );
 			for ( $i = 0, $count = count( $paged_users ); $i < $count; ++$i ) {
-				foreach ( (array)$friend_status as $status ) {
+				foreach ( (array) $friend_status as $status ) {
 					if ( $status->initiator_user_id == $paged_users[$i]->id || $status->friend_user_id == $paged_users[$i]->id )
 						$paged_users[$i]->is_friend = $status->is_confirmed;
 				}
@@ -550,7 +584,7 @@ class BP_Core_User {
 		if ( 'active' != $type ) {
 			$user_activity = $wpdb->get_results( $wpdb->prepare( "SELECT user_id as id, meta_value as last_activity FROM {$wpdb->usermeta} WHERE meta_key = %s AND user_id IN ( {$user_ids} )", bp_get_user_meta_key( 'last_activity' ) ) );
 			for ( $i = 0, $count = count( $paged_users ); $i < $count; ++$i ) {
-				foreach ( (array)$user_activity as $activity ) {
+				foreach ( (array) $user_activity as $activity ) {
 					if ( $activity->id == $paged_users[$i]->id )
 						$paged_users[$i]->last_activity = $activity->last_activity;
 				}
@@ -561,7 +595,7 @@ class BP_Core_User {
 		if ( 'active' != $type ) {
 			$user_activity = $wpdb->get_results( $wpdb->prepare( "SELECT user_id as id, meta_value as last_activity FROM {$wpdb->usermeta} WHERE meta_key = %s AND user_id IN ( {$user_ids} )", bp_get_user_meta_key( 'last_activity' ) ) );
 			for ( $i = 0, $count = count( $paged_users ); $i < $count; ++$i ) {
-				foreach ( (array)$user_activity as $activity ) {
+				foreach ( (array) $user_activity as $activity ) {
 					if ( $activity->id == $paged_users[$i]->id )
 						$paged_users[$i]->last_activity = $activity->last_activity;
 				}
@@ -571,7 +605,7 @@ class BP_Core_User {
 		// Fetch the user's latest update
 		$user_update = $wpdb->get_results( $wpdb->prepare( "SELECT user_id as id, meta_value as latest_update FROM {$wpdb->usermeta} WHERE meta_key = %s AND user_id IN ( {$user_ids} )", bp_get_user_meta_key( 'bp_latest_update' ) ) );
 		for ( $i = 0, $count = count( $paged_users ); $i < $count; ++$i ) {
-			foreach ( (array)$user_update as $update ) {
+			foreach ( (array) $user_update as $update ) {
 				if ( $update->id == $paged_users[$i]->id )
 					$paged_users[$i]->latest_update = $update->latest_update;
 			}
@@ -591,7 +625,7 @@ class BP_Core_User {
 	function get_core_userdata( $user_id ) {
 		global $wpdb;
 
-		if ( !$user = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM $wpdb->users WHERE ID = %d LIMIT 1", $user_id ) ) )
+		if ( !$user = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM {$wpdb->users} WHERE ID = %d LIMIT 1", $user_id ) ) )
 			return false;
 
 		return $user;
@@ -664,15 +698,7 @@ class BP_Core_Notification {
 	 */
 	var $is_new;
 
-
-	/**
-	 * PHP4 constructor
-	 *
-	 * @param integer $id
-	 */
-	function bp_core_notification( $id = 0 ) {
-		$this->__construct($id);
-	}
+	/** Public Methods ********************************************************/
 
 	/**
 	 * Constructor
@@ -680,36 +706,16 @@ class BP_Core_Notification {
 	 * @param integer $id
 	 */
 	function __construct( $id = 0 ) {
-		if ( $id ) {
+		if ( !empty( $id ) ) {
 			$this->id = $id;
 			$this->populate();
 		}
 	}
 
-	/**
-	 * Fetches the notification data from the database.
-	 *
-	 * @global object $bp Global BuddyPress settings object
-	 * @global wpdb $wpdb WordPress database object
-	 */
-	function populate() {
-		global $bp, $wpdb;
-
-		if ( $notification = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM {$bp->core->table_name_notifications} WHERE id = %d", $this->id ) ) ) {
-			$this->item_id = $notification->item_id;
-			$this->secondary_item_id = $notification->secondary_item_id;
-			$this->user_id           = $notification->user_id;
-			$this->component_name    = $notification->component_name;
-			$this->component_action  = $notification->component_action;
-			$this->date_notified     = $notification->date_notified;
-			$this->is_new            = $notification->is_new;
-		}
-	}
-
 	/**
 	 * Update or insert notification details into the database.
 	 *
-	 * @global object $bp Global BuddyPress settings object
+	 * @global BuddyPress $bp The one true BuddyPress instance
 	 * @global wpdb $wpdb WordPress database object
 	 * @return bool Success or failure
 	 */
@@ -717,21 +723,45 @@ class BP_Core_Notification {
 		global $bp, $wpdb;
 
 		// Update
-		if ( $this->id )
+		if ( !empty( $this->id ) ) {
 			$sql = $wpdb->prepare( "UPDATE {$bp->core->table_name_notifications} SET item_id = %d, secondary_item_id = %d, user_id = %d, component_name = %s, component_action = %d, date_notified = %s, is_new = %d ) WHERE id = %d", $this->item_id, $this->secondary_item_id, $this->user_id, $this->component_name, $this->component_action, $this->date_notified, $this->is_new, $this->id );
 
 		// Save
-		else
+		} else {
 			$sql = $wpdb->prepare( "INSERT INTO {$bp->core->table_name_notifications} ( item_id, secondary_item_id, user_id, component_name, component_action, date_notified, is_new ) VALUES ( %d, %d, %d, %s, %s, %s, %d )", $this->item_id, $this->secondary_item_id, $this->user_id, $this->component_name, $this->component_action, $this->date_notified, $this->is_new );
+		}
 
 		if ( !$result = $wpdb->query( $sql ) )
 			return false;
 
 		$this->id = $wpdb->insert_id;
+
 		return true;
 	}
 
-	/** Static functions ******************************************************/
+	/** Private Methods *******************************************************/
+
+	/**
+	 * Fetches the notification data from the database.
+	 *
+	 * @global BuddyPress $bp The one true BuddyPress instance
+	 * @global wpdb $wpdb WordPress database object
+	 */
+	function populate() {
+		global $bp, $wpdb;
+
+		if ( $notification = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM {$bp->core->table_name_notifications} WHERE id = %d", $this->id ) ) ) {
+			$this->item_id = $notification->item_id;
+			$this->secondary_item_id = $notification->secondary_item_id;
+			$this->user_id           = $notification->user_id;
+			$this->component_name    = $notification->component_name;
+			$this->component_action  = $notification->component_action;
+			$this->date_notified     = $notification->date_notified;
+			$this->is_new            = $notification->is_new;
+		}
+	}
+
+	/** Static Methods ********************************************************/
 
 	function check_access( $user_id, $notification_id ) {
 		global $wpdb, $bp;
@@ -742,22 +772,25 @@ class BP_Core_Notification {
 	/**
 	 * Fetches all the notifications in the database for a specific user.
 	 *
-	 * @global object $bp Global BuddyPress settings object
+	 * @global BuddyPress $bp The one true BuddyPress instance
 	 * @global wpdb $wpdb WordPress database object
 	 * @param integer $user_id User ID
+	 * @param str $status 'is_new' or 'all'
 	 * @return array Associative array
 	 * @static
 	 */
-	function get_all_for_user( $user_id ) {
+	function get_all_for_user( $user_id, $status = 'is_new' ) {
 		global $bp, $wpdb;
 
- 		return $wpdb->get_results( $wpdb->prepare( "SELECT * FROM {$bp->core->table_name_notifications} WHERE user_id = %d AND is_new = 1", $user_id ) );
+		$is_new = 'is_new' == $status ? ' AND is_new = 1 ' : '';
+
+ 		return $wpdb->get_results( $wpdb->prepare( "SELECT * FROM {$bp->core->table_name_notifications} WHERE user_id = %d {$is_new}", $user_id ) );
 	}
 
 	/**
 	 * Delete all the notifications for a user based on the component name and action.
 	 *
-	 * @global object $bp Global BuddyPress settings object
+	 * @global BuddyPress $bp The one true BuddyPress instance
 	 * @global wpdb $wpdb WordPress database object
 	 * @param integer $user_id
 	 * @param string $component_name
@@ -773,7 +806,7 @@ class BP_Core_Notification {
 	/**
 	 * Delete all the notifications that have a specific item id, component name and action.
 	 *
-	 * @global object $bp Global BuddyPress settings object
+	 * @global BuddyPress $bp The one true BuddyPress instance
 	 * @global wpdb $wpdb WordPress database object
 	 * @param integer $user_id The ID of the user who the notifications are for.
 	 * @param integer $item_id The item ID of the notifications we wish to delete.
@@ -793,7 +826,7 @@ class BP_Core_Notification {
 	/**
 	 * Deletes all the notifications sent by a specific user, by component and action.
 	 *
-	 * @global object $bp Global BuddyPress settings object
+	 * @global BuddyPress $bp The one true BuddyPress instance
 	 * @global wpdb $wpdb WordPress database object
 	 * @param integer $user_id The ID of the user whose sent notifications we wish to delete.
 	 * @param string $component_name The name of the component the notification was sent from.
@@ -809,7 +842,7 @@ class BP_Core_Notification {
 	/**
 	 * Deletes all the notifications for all users by item id, and optional secondary item id, and component name and action.
 	 *
-	 * @global object $bp Global BuddyPress settings object
+	 * @global BuddyPress $bp The one true BuddyPress instance
 	 * @global wpdb $wpdb WordPress database object
 	 * @param string $item_id The item id that they notifications are to be for.
 	 * @param string $component_name The component that the notifications are to be from.
@@ -969,10 +1002,6 @@ class BP_Button {
 	 * @param array $args
 	 * @return bool False if not allowed
 	 */
-	function bp_button( $args = '' ) {
-		$this->__construct($args);
-	}
-
 	function __construct( $args = '' ) {
 
 		// Default arguments
@@ -1024,14 +1053,16 @@ class BP_Button {
 		if ( false !== $this->wrapper ) {
 
 			// Wrapper ID
-			if ( !empty( $wrapper_id ) )
+			if ( !empty( $wrapper_id ) ) {
 				$this->wrapper_id    = ' id="' . $wrapper_id . '"';
+			}
 
 			// Wrapper class
-			if ( !empty( $wrapper_class ) )
+			if ( !empty( $wrapper_class ) ) {
 				$this->wrapper_class = ' class="generic-button ' . $wrapper_class . '"';
-			else
+			} else {
 				$this->wrapper_class = ' class="generic-button"';
+			}
 
 			// Set before and after
 			$before = '<' . $wrapper . $this->wrapper_class . $this->wrapper_id . '>';
@@ -1096,10 +1127,11 @@ class BP_Button {
  * Extends WP_Embed class for use with BuddyPress.
  *
  * @package BuddyPress Core
- * @since 1.5
+ * @since BuddyPress (1.5)
  * @see WP_Embed
  */
 class BP_Embed extends WP_Embed {
+
 	/**
 	 * Constructor
 	 *
@@ -1170,8 +1202,9 @@ class BP_Embed extends WP_Embed {
 		foreach ( $this->handlers as $priority => $handlers ) {
 			foreach ( $handlers as $hid => $handler ) {
 				if ( preg_match( $handler['regex'], $url, $matches ) && is_callable( $handler['callback'] ) ) {
-					if ( false !== $return = call_user_func( $handler['callback'], $matches, $attr, $url, $rawattr ) )
+					if ( false !== $return = call_user_func( $handler['callback'], $matches, $attr, $url, $rawattr ) ) {
 						return apply_filters( 'embed_handler_html', $return, $url, $attr );
+					}
 				}
 			}
 		}
@@ -1189,7 +1222,7 @@ class BP_Embed extends WP_Embed {
 		// If oEmbed discovery is true, skip oEmbed provider check
 		$is_oembed_link = false;
 		if ( !$attr['discover'] ) {
-			foreach ( (array)$oembed_obj->providers as $provider_matchmask => $provider ) {
+			foreach ( (array) $oembed_obj->providers as $provider_matchmask => $provider ) {
 				$regex = ( $is_regex = $provider[1] ) ? $provider_matchmask : '#' . str_replace( '___wildcard___', '(.+)', preg_quote( str_replace( '*', '___wildcard___', $provider_matchmask ), '#' ) ) . '#i';
 
 				if ( preg_match( $regex, $url ) )
@@ -1251,4 +1284,5 @@ class BP_Embed extends WP_Embed {
 		return $this->maybe_make_link( $url );
 	}
 }
-?>
\ No newline at end of file
+
+?>
diff --git a/wp-content/plugins/buddypress/bp-core/bp-core-component.php b/wp-content/plugins/buddypress/bp-core/bp-core-component.php
index b857b24f9982a6f861fa010785ad8b6bd1ea0a5c..b30e646d1b567bbc0fef71e26216fe0d1b6f26f7 100644
--- a/wp-content/plugins/buddypress/bp-core/bp-core-component.php
+++ b/wp-content/plugins/buddypress/bp-core/bp-core-component.php
@@ -14,7 +14,7 @@ if ( !class_exists( 'BP_Component' ) ) :
  * @package BuddyPress
  * @subpackage Component
  *
- * @since 1.5
+ * @since BuddyPress (1.5)
  */
 class BP_Component {
 
@@ -60,14 +60,30 @@ class BP_Component {
 	var $notification_callback;
 
 	/**
-	 * @var array WordPress admin bar links
+	 * @var array WordPress Toolbar links
 	 */
 	var $admin_menu;
 
+	/**
+	 * Search input box placeholder string for the component
+	 *
+	 * @since BuddyPress (1.5)
+	 * @var string
+	 */
+	public $search_string;
+
+	/**
+	 * Component's root slug
+	 *
+	 * @since BuddyPress (1.5)
+	 * @var string
+	 */
+	public $root_slug;
+
 	/**
 	 * Component loader
 	 *
-	 * @since 1.5
+	 * @since BuddyPress (1.5)
 	 *
 	 * @param mixed $args Required. Supports these args:
 	 *  - id: Unique ID (for internal identification). Letters, numbers, and underscores only
@@ -92,7 +108,7 @@ class BP_Component {
 	/**
 	 * Component global variables
 	 *
-	 * @since 1.5
+	 * @since BuddyPress (1.5)
 	 * @access private
 	 *
 	 * @uses apply_filters() Calls 'bp_{@link bp_Component::name}_id'
@@ -130,10 +146,16 @@ class BP_Component {
 		// Notifications callback
 		$this->notification_callback = apply_filters( 'bp_' . $this->id . '_notification_callback', $r['notification_callback'] );
 
-		// Setup global table names
-		if ( !empty( $r['global_tables'] ) )
-			foreach ( $r['global_tables'] as $global_name => $table_name )
+		// Set up global table names
+		if ( !empty( $r['global_tables'] ) ) {
+			// This filter allows for component-specific filtering of table names
+			// To filter *all* tables, use the 'bp_core_get_table_prefix' filter instead
+			$r['global_tables'] = apply_filters( 'bp_' . $this->id . '_global_tables', $r['global_tables'] );
+
+			foreach ( $r['global_tables'] as $global_name => $table_name ) {
 				$this->$global_name = $table_name;
+			}
+                }
 
 		/** BuddyPress ********************************************************/
 
@@ -164,7 +186,7 @@ class BP_Component {
 	 *   - ./bp-my_component/actions
 	 *   - ./bp-my_component/bp-my_component-actions.php
 	 *
-	 * @since 1.5
+	 * @since BuddyPress (1.5)
 	 * @access private
 	 *
 	 * @uses do_action() Calls 'bp_{@link bp_Component::name}includes'
@@ -173,21 +195,30 @@ class BP_Component {
 		if ( empty( $includes ) )
 			return;
 
+		$slashed_path = trailingslashit( $this->path );
+
 		// Loop through files to be included
 		foreach ( $includes as $file ) {
 
-			// Check path + file
-			if ( @is_file( $this->path . '/' . $file ) )
-				require( $this->path . '/' . $file );
+			$paths = array(
 
-			// Check path + /bp-component/ + file
-			elseif ( @is_file( $this->path . '/bp-' . $this->id . '/' . $file ) )
-				require( $this->path . '/bp-' . $this->id . '/' . $file );
+				// Passed with no extension
+				'bp-' . $this->id . '/bp-' . $this->id . '-' . $file  . '.php',
+				'bp-' . $this->id . '-' . $file . '.php',
+				'bp-' . $this->id . '/' . $file . '.php',
 
-			// Check buddypress/bp-component/bp-component-$file.php
-			elseif ( @is_file( $this->path . '/bp-' . $this->id . '/bp-' . $this->id . '-' . $file  . '.php' ) )
-				require( $this->path . '/bp-' . $this->id . '/bp-' . $this->id . '-' . $file . '.php' );
+				// Passed with extension
+				$file,
+				'bp-' . $this->id . '-' . $file,
+				'bp-' . $this->id . '/' . $file,
+			);
 
+			foreach ( $paths as $path ) {
+				if ( @is_file( $slashed_path . $path ) ) {
+					require( $slashed_path . $path );
+					continue;
+				}
+			}
 		}
 
 		// Call action
@@ -197,7 +228,7 @@ class BP_Component {
 	/**
 	 * Setup the actions
 	 *
-	 * @since 1.5
+	 * @since BuddyPress (1.5)
 	 * @access private
 	 *
 	 * @uses add_action() To add various actions
@@ -218,7 +249,7 @@ class BP_Component {
 		// Setup navigation
 		add_action( 'bp_setup_nav',              array ( $this, 'setup_nav'              ), 10 );
 
-		// Setup WP Admin Bar menus
+		// Setup WP Toolbar menus
 		add_action( 'bp_setup_admin_bar',        array ( $this, 'setup_admin_bar'        ), 10 );
 
 		// Setup component title
@@ -265,7 +296,7 @@ class BP_Component {
 	}
 
 	/**
-	 * Setup the admin bar
+	 * Setup the Toolbar
 	 *
 	 * @global obj $wp_admin_bar
 	 * @param array $wp_admin_menus
@@ -280,7 +311,7 @@ class BP_Component {
 		if ( !bp_use_wp_admin_bar() )
 			return;
 
-		// Do we have admin bar menus to add?
+		// Do we have Toolbar menus to add?
 		if ( !empty( $wp_admin_nav ) ) {
 
 			// Set this objects menus
@@ -301,7 +332,7 @@ class BP_Component {
 	/**
 	 * Setup the component title
 	 *
-	 * @since 1.5
+	 * @since BuddyPress (1.5)
 	 *
 	 * @uses do_action() Calls 'bp_{@link bp_Component::name}setup_title'
 	 */
@@ -312,7 +343,7 @@ class BP_Component {
 	/**
 	 * Setup the component post types
 	 *
-	 * @since 1.5
+	 * @since BuddyPress (1.5)
 	 *
 	 * @uses do_action() Calls 'bp_{@link bp_Component::name}_register_post_types'
 	 */
@@ -323,7 +354,7 @@ class BP_Component {
 	/**
 	 * Register component specific taxonomies
 	 *
-	 * @since 1.5
+	 * @since BuddyPress (1.5)
 	 *
 	 * @uses do_action() Calls 'bp_{@link bp_Component::name}_register_taxonomies'
 	 */
@@ -334,7 +365,7 @@ class BP_Component {
 	/**
 	 * Add any additional rewrite tags
 	 *
-	 * @since 1.5
+	 * @since BuddyPress (1.5)
 	 *
 	 * @uses do_action() Calls 'bp_{@link bp_Component::name}_add_rewrite_tags'
 	 */
@@ -345,7 +376,7 @@ class BP_Component {
 	/**
 	 * Generate any additional rewrite rules
 	 *
-	 * @since 1.5
+	 * @since BuddyPress (1.5)
 	 *
 	 * @uses do_action() Calls 'bp_{@link bp_Component::name}_generate_rewrite_rules'
 	 */
diff --git a/wp-content/plugins/buddypress/bp-core/bp-core-cssjs.php b/wp-content/plugins/buddypress/bp-core/bp-core-cssjs.php
index 0c6c7f83ad6a4de2940a3a371a30585188ea8b22..0c6810e9af508f59e7afc3d40daa5846bb548b70 100644
--- a/wp-content/plugins/buddypress/bp-core/bp-core-cssjs.php
+++ b/wp-content/plugins/buddypress/bp-core/bp-core-cssjs.php
@@ -2,38 +2,6 @@
 // Exit if accessed directly
 if ( !defined( 'ABSPATH' ) ) exit;
 
-/**
- * bp_core_admin_menu_icon_css()
- *
- * Add a hover-able icon to the "BuddyPress" wp-admin area menu.
- *
- * @package BuddyPress Core
- */
-function bp_core_admin_menu_icon_css() {
-	global $bp; ?>
-
-	<style type="text/css">
-		/* Wizard Icon */
-		ul#adminmenu li.toplevel_page_bp-wizard .wp-menu-image a img { display: none; }
-		ul#adminmenu li.toplevel_page_bp-wizard .wp-menu-image a { background-image: url( <?php echo plugins_url( 'buddypress/bp-core/images/admin_menu_icon.png' ) ?> ) !important; background-position: -1px -32px; }
-		ul#adminmenu li.toplevel_page_bp-wizard:hover .wp-menu-image a,
-		ul#adminmenu li.toplevel_page_bp-wizard.wp-has-current-submenu .wp-menu-image a {
-			background-position: -1px 0;
-		}
-
-		/* Settings Icon */
-		ul#adminmenu li.toplevel_page_bp-general-settings .wp-menu-image a img { display: none; }
-		ul#adminmenu li.toplevel_page_bp-general-settings .wp-menu-image a { background-image: url( <?php echo plugins_url( 'buddypress/bp-core/images/admin_menu_icon.png' ) ?> ) !important; background-position: -1px -32px; }
-		ul#adminmenu li.toplevel_page_bp-general-settings:hover .wp-menu-image a,
-		ul#adminmenu li.toplevel_page_bp-general-settings.wp-has-current-submenu .wp-menu-image a {
-			background-position: -1px 0;
-		}
-	</style>
-
-<?php
-}
-add_action( 'admin_head', 'bp_core_admin_menu_icon_css' );
-
 function bp_core_confirmation_js() {
 	global $wpdb;
 
@@ -86,8 +54,7 @@ function bp_core_add_cropper_inline_js() {
 		$aspect_ratio = $full_width / $full_height;
 
 	$width  = $image[0] / 2;
-	$height = $image[1] / 2;
-?>
+	$height = $image[1] / 2; ?>
 
 	<script type="text/javascript">
 		jQuery(window).load( function(){
@@ -106,17 +73,21 @@ function bp_core_add_cropper_inline_js() {
 			jQuery('#y').val(c.y);
 			jQuery('#w').val(c.w);
 			jQuery('#h').val(c.h);
-		};
+		}
 
 		function showPreview(coords) {
 			if ( parseInt(coords.w) > 0 ) {
 				var rx = <?php echo $full_width; ?> / coords.w;
 				var ry = <?php echo $full_height; ?> / coords.h;
+				<?php if ( $image ) : ?>
+				var w  = <?php echo $image[0]; ?>;
+				var h  = <?php echo $image[1]; ?>;
+				<?php endif; ?>
 
 				jQuery('#avatar-crop-preview').css({
 				<?php if ( $image ) : ?>
-					width: Math.round(rx * <?php echo $image[0]; ?>) + 'px',
-					height: Math.round(ry * <?php echo $image[1]; ?>) + 'px',
+					width: Math.round(rx * w) + 'px',
+					height: Math.round(ry * h) + 'px',
 				<?php endif; ?>
 					marginLeft: '-' + Math.round(rx * coords.x) + 'px',
 					marginTop: '-' + Math.round(ry * coords.y) + 'px'
@@ -136,12 +107,11 @@ function bp_core_add_cropper_inline_js() {
  * @package BuddyPress Core
  */
 function bp_core_add_cropper_inline_css() {
-	global $bp;
 ?>
 
 	<style type="text/css">
 		.jcrop-holder { float: left; margin: 0 20px 20px 0; text-align: left; }
-		.jcrop-vline, .jcrop-hline { font-size: 0; position: absolute; background: white top left repeat url( <?php echo BP_PLUGIN_URL ?>/bp-core/images/Jcrop.gif ); }
+		.jcrop-vline, .jcrop-hline { font-size: 0; position: absolute; background: white top left repeat url('<?php echo BP_PLUGIN_URL ?>/bp-core/images/Jcrop.gif'); }
 		.jcrop-vline { height: 100%; width: 1px !important; }
 		.jcrop-hline { width: 100%; height: 1px !important; }
 		.jcrop-handle { font-size: 1px; width: 7px !important; height: 7px !important; border: 1px #eee solid; background-color: #333; *width: 9px; *height: 9px; }
@@ -161,13 +131,12 @@ function bp_core_add_cropper_inline_css() {
  *
  * Adds AJAX target URL so themes can access the WordPress AJAX functionality.
  *
- * @package BuddyPress Core
+ * @since 1.1
  */
 function bp_core_add_ajax_url_js() {
-	global $bp;
 ?>
 
-	<script type="text/javascript">var ajaxurl = "<?php echo site_url( 'wp-load.php' ); ?>";</script>
+	<script type="text/javascript">var ajaxurl = '<?php echo admin_url( 'admin-ajax.php' ); ?>';</script>
 
 <?php
 }
diff --git a/wp-content/plugins/buddypress/bp-core/bp-core-filters.php b/wp-content/plugins/buddypress/bp-core/bp-core-filters.php
index 99839fb94cf54c95e6644fccd70021f952f72c1d..a65b29a4c4f3e80bf634a6bcf531af9bda42154d 100644
--- a/wp-content/plugins/buddypress/bp-core/bp-core-filters.php
+++ b/wp-content/plugins/buddypress/bp-core/bp-core-filters.php
@@ -1,7 +1,15 @@
 <?php
+
 // Exit if accessed directly
 if ( !defined( 'ABSPATH' ) ) exit;
 
+// Add some filters to feedback messages
+add_filter( 'bp_core_render_message_content', 'wptexturize'       );
+add_filter( 'bp_core_render_message_content', 'convert_smilies'   );
+add_filter( 'bp_core_render_message_content', 'convert_chars'     );
+add_filter( 'bp_core_render_message_content', 'wpautop'           );
+add_filter( 'bp_core_render_message_content', 'shortcode_unautop' );
+
 /**
  * bp_core_exclude_pages()
  *
@@ -13,14 +21,14 @@ if ( !defined( 'ABSPATH' ) ) exit;
  */
 function bp_core_exclude_pages( $pages ) {
 	global $bp;
-	
+
 	if ( bp_is_root_blog() ) {
 		if ( !empty( $bp->pages->activate ) )
 			$pages[] = $bp->pages->activate->id;
-	
+
 		if ( !empty( $bp->pages->register ) )
 			$pages[] = $bp->pages->register->id;
-	
+
 		if ( !empty( $bp->pages->forums ) && ( !bp_is_active( 'forums' ) || ( bp_is_active( 'forums' ) && bp_forums_has_directory() && !bp_forums_is_installed_correctly() ) ) )
 			$pages[] = $bp->pages->forums->id;
 	}
@@ -43,21 +51,6 @@ function bp_core_email_from_name_filter() {
 }
 add_filter( 'wp_mail_from_name', 'bp_core_email_from_name_filter' );
 
-/**
- * bp_core_email_from_name_filter()
- *
- * Sets the "From" address in emails sent
- *
- * @package BuddyPress Core
- * @return noreply@sitedomain email address
- */
-function bp_core_email_from_address_filter() {
-	$domain = (array) explode( '/', site_url() );
-
-	return apply_filters( 'bp_core_email_from_address_filter', 'noreply@' . $domain[2] );
-}
-add_filter( 'wp_mail_from', 'bp_core_email_from_address_filter' );
-
 /**
  * bp_core_allow_default_theme()
  *
@@ -69,9 +62,9 @@ add_filter( 'wp_mail_from', 'bp_core_email_from_address_filter' );
  * @package BuddyPress Core
  */
 function bp_core_allow_default_theme( $themes ) {
-	global $bp, $wpdb;
+	global $wpdb;
 
-	if ( !is_super_admin() )
+	if ( !bp_current_user_can( 'bp_moderate' ) )
 		return $themes;
 
 	if ( $wpdb->blogid == bp_get_root_blog_id() ) {
@@ -92,7 +85,7 @@ add_filter( 'allowed_themes', 'bp_core_allow_default_theme' );
 function bp_core_filter_comments( $comments, $post_id ) {
 	global $wpdb;
 
-	foreach( (array)$comments as $comment ) {
+	foreach( (array) $comments as $comment ) {
 		if ( $comment->user_id )
 			$user_ids[] = $comment->user_id;
 	}
@@ -102,13 +95,13 @@ function bp_core_filter_comments( $comments, $post_id ) {
 
 	$user_ids = implode( ',', $user_ids );
 
-	if ( !$userdata = $wpdb->get_results( $wpdb->prepare( "SELECT ID as user_id, user_login, user_nicename FROM {$wpdb->users} WHERE ID IN ({$user_ids})" ) ) )
+	if ( !$userdata = $wpdb->get_results( "SELECT ID as user_id, user_login, user_nicename FROM {$wpdb->users} WHERE ID IN ({$user_ids})" ) )
 		return $comments;
 
-	foreach( (array)$userdata as $user )
+	foreach( (array) $userdata as $user )
 		$users[$user->user_id] = bp_core_get_user_domain( $user->user_id, $user->user_nicename, $user->user_login );
 
-	foreach( (array)$comments as $i => $comment ) {
+	foreach( (array) $comments as $i => $comment ) {
 		if ( !empty( $comment->user_id ) ) {
 			if ( !empty( $users[$comment->user_id] ) )
 				$comments[$i]->comment_author_url = $users[$comment->user_id];
@@ -120,29 +113,50 @@ function bp_core_filter_comments( $comments, $post_id ) {
 add_filter( 'comments_array', 'bp_core_filter_comments', 10, 2 );
 
 /**
- * bp_core_login_redirect()
- *
- * When a user logs in, always redirect them back to the previous page. NOT the admin area.
+ * When a user logs in, redirect him in a logical way
  *
  * @package BuddyPress Core
+ *
+ * @uses apply_filters Filter bp_core_login_redirect to modify where users are redirected to on
+ *   login
+ * @param string $redirect_to The URL to be redirected to, sanitized in wp-login.php
+ * @param string $redirect_to_raw The unsanitized redirect_to URL ($_REQUEST['redirect_to'])
+ * @param obj $user The WP_User object corresponding to a successfully logged-in user. Otherwise
+ *   a WP_Error object
+ * @return string The redirect URL
  */
-function bp_core_login_redirect( $redirect_to ) {
-	global $bp, $wpdb;
+function bp_core_login_redirect( $redirect_to, $redirect_to_raw, $user ) {
 
-	// Don't mess with the redirect if this is not the root blog
-	if ( is_multisite() && $wpdb->blogid != bp_get_root_blog_id() )
+	// Only modify the redirect if we're on the main BP blog
+	if ( !bp_is_root_blog() ) {
 		return $redirect_to;
+	}
 
-	// If the redirect doesn't contain 'wp-admin', it's OK
-	if ( !empty( $_REQUEST['redirect_to'] ) && false === strpos( $_REQUEST['redirect_to'], 'wp-admin' ) )
+	// Only modify the redirect once the user is logged in
+	if ( !is_a( $user, 'WP_User' ) ) {
 		return $redirect_to;
+	}
 
-	if ( false === strpos( wp_get_referer(), 'wp-login.php' ) && false === strpos( wp_get_referer(), 'activate' ) && empty( $_REQUEST['nr'] ) )
+	// Allow plugins to allow or disallow redirects, as desired
+	$maybe_redirect = apply_filters( 'bp_core_login_redirect', false, $redirect_to, $redirect_to_raw, $user );
+	if ( false !== $maybe_redirect ) {
+		return $maybe_redirect;
+	}
+
+	// If a 'redirect_to' parameter has been passed that contains 'wp-admin', verify that the
+	// logged-in user has any business to conduct in the Dashboard before allowing the
+	// redirect to go through
+	if ( !empty( $redirect_to ) && ( false === strpos( $redirect_to, 'wp-admin' ) || user_can( $user, 'edit_posts' ) ) ) {
+		return $redirect_to;
+	}
+
+	if ( false === strpos( wp_get_referer(), 'wp-login.php' ) && false === strpos( wp_get_referer(), 'activate' ) && empty( $_REQUEST['nr'] ) ) {
 		return wp_get_referer();
+	}
 
 	return bp_get_root_domain();
 }
-add_filter( 'login_redirect', 'bp_core_login_redirect' );
+add_filter( 'login_redirect', 'bp_core_login_redirect', 10, 3 );
 
 /***
  * bp_core_filter_user_welcome_email()
@@ -155,7 +169,8 @@ add_filter( 'login_redirect', 'bp_core_login_redirect' );
  * @return string Filtered $welcome_email with 'PASSWORD' replaced by [User Set]
  */
 function bp_core_filter_user_welcome_email( $welcome_email ) {
-	/* Don't touch the email if we don't have a custom registration template */
+
+	// Don't touch the email if we don't have a custom registration template
 	if ( '' == locate_template( array( 'registration/register.php' ), false ) && '' == locate_template( array( 'register.php' ), false ) )
 		return $welcome_email;
 
@@ -179,7 +194,8 @@ if ( !is_admin() && empty( $_GET['e'] ) )
  * @return string Filtered $welcome_email with $password replaced by [User Set]
  */
 function bp_core_filter_blog_welcome_email( $welcome_email, $blog_id, $user_id, $password ) {
-	/* Don't touch the email if we don't have a custom registration template */
+
+	// Don't touch the email if we don't have a custom registration template
 	if ( '' == locate_template( array( 'registration/register.php' ), false ) && '' == locate_template( array( 'register.php' ), false ) )
 		return $welcome_email;
 
@@ -236,7 +252,7 @@ function bp_core_activation_signup_user_notification( $user, $user_email, $key,
 
 	$from_name       = ( '' == get_site_option( 'site_name' ) ) ? 'WordPress' : esc_html( get_site_option( 'site_name' ) );
 	$message_headers = "MIME-Version: 1.0\n" . "From: \"{$from_name}\" <{$admin_email}>\n" . "Content-Type: text/plain; charset=\"" . get_option( 'blog_charset' ) . "\"\n";
-	$message         = sprintf( __( "Thanks for registering! To complete the activation of your account please click the following link:\n\n%s\n\n", 'buddypress' ), $activate_url . $email );
+	$message         = sprintf( __( "Thanks for registering! To complete the activation of your account please click the following link:\n\n%1\$s\n\n", 'buddypress' ), $activate_url . $email );
 	$subject         = '[' . $from_name . '] ' . __( 'Activate Your Account', 'buddypress' );
 
 	// Send the message
@@ -258,17 +274,15 @@ if ( !is_admin() || ( is_admin() && empty( $_POST['noconfirmation'] ) ) )
  * Filter the page title for BuddyPress pages
  *
  * @global object $bp BuddyPress global settings
- * @global unknown $post
- * @global WP_Query $wp_query WordPress query object
  * @param string $title Original page title
  * @param string $sep How to separate the various items within the page title.
  * @param string $seplocation Direction to display title
  * @return string new page title
  * @see wp_title()
- * @since 1.5
+ * @since BuddyPress (1.5)
  */
 function bp_modify_page_title( $title, $sep, $seplocation ) {
-	global $bp, $post, $wp_query;
+	global $bp;
 
 	// If this is not a BP page, just return the title produced by WP
 	if ( bp_is_blog_page() )
@@ -281,27 +295,41 @@ function bp_modify_page_title( $title, $sep, $seplocation ) {
 	$title = '';
 
 	// Displayed user
-	if ( !empty( $bp->displayed_user->fullname ) && !is_404() ) {
+	if ( bp_get_displayed_user_fullname() && !is_404() ) {
+
+		// Get the component's ID to try and get it's name
+		$component_id = $component_name = bp_current_component();
+
+		// Use the actual component name
+		if ( !empty( $bp->{$component_id}->name ) ) {
+			$component_name = $bp->{$component_id}->name;
+
+		// Fall back on the component ID (probably same as current_component)
+		} elseif ( !empty( $bp->{$component_id}->id ) ) {
+			$component_name = $bp->{$component_id}->id;
+		}
+
 		// translators: "displayed user's name | canonicalised component name"
-		$title = strip_tags( sprintf( __( '%1$s | %2$s', 'buddypress' ), bp_get_displayed_user_fullname(), __( ucwords( bp_current_component() ), 'buddypress' ) ) );
+		$title = strip_tags( sprintf( __( '%1$s | %2$s', 'buddypress' ), bp_get_displayed_user_fullname(), ucwords( $component_name ) ) );
 
 	// A single group
 	} elseif ( bp_is_active( 'groups' ) && !empty( $bp->groups->current_group ) && !empty( $bp->bp_options_nav[$bp->groups->current_group->slug] ) ) {
-		$subnav = isset( $bp->bp_options_nav[$bp->groups->current_group->slug][$bp->current_action]['name'] ) ? $bp->bp_options_nav[$bp->groups->current_group->slug][$bp->current_action]['name'] : '';
+		$subnav = isset( $bp->bp_options_nav[$bp->groups->current_group->slug][bp_current_action()]['name'] ) ? $bp->bp_options_nav[$bp->groups->current_group->slug][bp_current_action()]['name'] : '';
 		// translators: "group name | group nav section name"
 		$title = sprintf( __( '%1$s | %2$s', 'buddypress' ), $bp->bp_options_title, $subnav );
 
 	// A single item from a component other than groups
 	} elseif ( bp_is_single_item() ) {
 		// translators: "component item name | component nav section name | root component name"
-		$title = sprintf( __( '%1$s | %2$s | %3$s', 'buddypress' ), $bp->bp_options_title, $bp->bp_options_nav[$bp->current_item][$bp->current_action]['name'], bp_get_name_from_root_slug( bp_get_root_slug() ) );
+		$title = sprintf( __( '%1$s | %2$s | %3$s', 'buddypress' ), $bp->bp_options_title, $bp->bp_options_nav[bp_current_item()][bp_current_action()]['name'], bp_get_name_from_root_slug( bp_get_root_slug() ) );
 
 	// An index or directory
 	} elseif ( bp_is_directory() ) {
-		if ( !bp_current_component() )
-			$title = sprintf( __( '%s Directory', 'buddypress' ), __( bp_get_name_from_root_slug(), 'buddypress' ) );
-		else
-			$title = sprintf( __( '%s Directory', 'buddypress' ), __( bp_get_name_from_root_slug(), 'buddypress' ) );
+		if ( !bp_current_component() ) {
+			$title = sprintf( __( '%s Directory', 'buddypress' ), bp_get_name_from_root_slug() );
+		} else {
+			$title = sprintf( __( '%s Directory', 'buddypress' ), bp_get_name_from_root_slug() );
+		}
 
 	// Sign up page
 	} elseif ( bp_is_register_page() ) {
@@ -323,11 +351,11 @@ function bp_modify_page_title( $title, $sep, $seplocation ) {
 	// Some BP nav items contain item counts. Remove them
 	$title = preg_replace( '|<span>[0-9]+</span>|', '', $title );
 
-	return apply_filters( 'bp_modify_page_title', $title . " $sep ", $title, $sep, $seplocation );
+	return apply_filters( 'bp_modify_page_title', $title . ' ' . $sep . ' ', $title, $sep, $seplocation );
 }
 add_filter( 'wp_title', 'bp_modify_page_title', 10, 3 );
 add_filter( 'bp_modify_page_title', 'wptexturize'     );
 add_filter( 'bp_modify_page_title', 'convert_chars'   );
 add_filter( 'bp_modify_page_title', 'esc_html'        );
 
-?>
\ No newline at end of file
+?>
diff --git a/wp-content/plugins/buddypress/bp-core/bp-core-functions.php b/wp-content/plugins/buddypress/bp-core/bp-core-functions.php
index 6cd07430fd1dd83867867cd1a62a7407a573912e..e410546129d439322f7090b4f4f1b84b37105b54 100644
--- a/wp-content/plugins/buddypress/bp-core/bp-core-functions.php
+++ b/wp-content/plugins/buddypress/bp-core/bp-core-functions.php
@@ -1,61 +1,107 @@
 <?php
-// Exit if accessed directly
-if ( !defined( 'ABSPATH' ) ) exit;
 
 /**
- * Retrieve an option
- *
- * This is a wrapper for get_blog_option(), which in turn stores settings data (such as bp-pages)
- * on the appropriate blog, given your current setup.
- *
- * The 'bp_get_option' filter is primarily for backward-compatibility.
+ * BuddyPress Common Functions
  *
  * @package BuddyPress
- * @since 1.5
- *
- * @uses bp_get_root_blog_id()
- * @param str $option_name The option to be retrieved
- * @param str $default Optional. Default value to be returned if the option isn't set
- * @return mixed The value for the option
+ * @subpackage Functions
  */
-function bp_get_option( $option_name, $default = '' ) {
-	$value = get_blog_option( bp_get_root_blog_id(), $option_name, $default );
 
-	return apply_filters( 'bp_get_option', $value );
-}
+// Exit if accessed directly
+if ( !defined( 'ABSPATH' ) ) exit;
+
+/** Versions ******************************************************************/
 
 /**
- * Save an option
+ * Output the BuddyPress version
  *
- * This is a wrapper for update_blog_option(), which in turn stores settings data (such as bp-pages)
- * on the appropriate blog, given your current setup.
- *
- * @package BuddyPress
- * @since 1.5
- *
- * @uses bp_get_root_blog_id()
- * @param str $option_name The option key to be set
- * @param str $value The value to be set
+ * @since BuddyPress (1.6)
+ * @uses bp_get_version() To get the BuddyPress version
  */
-function bp_update_option( $option_name, $value ) {
-	update_blog_option( bp_get_root_blog_id(), $option_name, $value );
+function bp_version() {
+	echo bp_get_version();
 }
+	/**
+	 * Return the BuddyPress version
+	 *
+	 * @since BuddyPress (1.6)
+	 * @global BuddyPress $bp
+	 * @return string The BuddyPress version
+	 */
+	function bp_get_version() {
+		global $bp;
+		return $bp->version;
+	}
 
 /**
- * Delete an option
+ * Output the BuddyPress database version
  *
- * This is a wrapper for delete_blog_option(), which in turn deletes settings data (such as
- * bp-pages) on the appropriate blog, given your current setup.
+ * @since BuddyPress (1.6)
+ * @uses bp_get_db_version() To get the BuddyPress version
+ */
+function bp_db_version() {
+	echo bp_get_db_version();
+}
+	/**
+	 * Return the BuddyPress database version
+	 *
+	 * @since BuddyPress (1.6)
+	 * @global BuddyPress $bp
+	 * @return string The BuddyPress version
+	 */
+	function bp_get_db_version() {
+		global $bp;
+		return $bp->db_version;
+	}
+
+/**
+ * Output the BuddyPress database version
  *
- * @package BuddyPress
- * @since 1.5
+ * @since BuddyPress (1.6)
+ * @uses bp_get_db_version_raw() To get the current BuddyPress version
+ */
+function bp_db_version_raw() {
+	echo bp_get_db_version_raw();
+}
+	/**
+	 * Return the BuddyPress database version
+	 *
+	 * @since BuddyPress (1.6)
+	 * @global BuddyPress $bp
+	 * @return string The BuddyPress version direct from the database
+	 */
+	function bp_get_db_version_raw() {
+		global $bp;
+
+		$retval = 0;
+		if ( !empty( $bp->db_version_raw ) )
+			$retval = $bp->db_version_raw;
+
+		return $retval;
+	}
+
+/**
+ * Output the BuddyPress maintenance mode
  *
- * @uses bp_get_root_blog_id()
- * @param str $option_name The option key to be set
+ * @since BuddyPress (1.6)
+ * @uses bp_get_maintenance_mode() To get the BuddyPress maintenance mode
  */
-function bp_delete_option( $option_name ) {
-	delete_blog_option( bp_get_root_blog_id(), $option_name );
+function bp_maintenance_mode() {
+	echo bp_get_maintenance_mode();
 }
+	/**
+	 * Return the BuddyPress maintenance mode
+	 *
+	 * @since BuddyPress (1.6)
+	 * @global BuddyPress $bp
+	 * @return string The BuddyPress maintenance mode
+	 */
+	function bp_get_maintenance_mode() {
+		global $bp;
+		return $bp->maintenance_mode;
+	}
+
+/** Functions *****************************************************************/
 
 /**
  * Allow filtering of database prefix. Intended for use in multinetwork installations.
@@ -73,28 +119,14 @@ function bp_core_get_table_prefix() {
  * Fetches BP pages from the meta table, depending on setup
  *
  * @package BuddyPress Core
- * @since 1.5
- *
- * @todo Remove the "Upgrading from an earlier version of BP pre-1.5" block. Temporary measure for
- *       people running trunk installations. Leave for a version or two, then remove.
+ * @since BuddyPress (1.5)
  */
 function bp_core_get_directory_page_ids() {
 	$page_ids = bp_get_option( 'bp-pages' );
 
-  	// Upgrading from an earlier version of BP pre-1.5
-	if ( !isset( $page_ids['members'] ) && $ms_page_ids = get_site_option( 'bp-pages' ) ) {
-		$page_blog_id = bp_is_multiblog_mode() ? get_current_blog_id() : bp_get_root_blog_id();
-
-		if ( isset( $ms_page_ids[$page_blog_id] ) ) {
-			$page_ids = $ms_page_ids[$page_blog_id];
-
-			bp_update_option( 'bp-pages', $page_ids );
-		}
-  	}
-
 	// Ensure that empty indexes are unset. Should only matter in edge cases
-	if ( $page_ids && is_array( $page_ids ) ) {
-		foreach( (array)$page_ids as $component_name => $page_id ) {
+	if ( !empty( $page_ids ) && is_array( $page_ids ) ) {
+		foreach( (array) $page_ids as $component_name => $page_id ) {
 			if ( empty( $component_name ) || empty( $page_id ) ) {
 				unset( $page_ids[$component_name] );
 			}
@@ -111,7 +143,7 @@ function bp_core_get_directory_page_ids() {
  * blog_id. This allows you to change your bp_get_root_blog_id() and go through the setup process again.
  *
  * @package BuddyPress Core
- * @since 1.5
+ * @since BuddyPress (1.5)
  *
  * @param array $blog_page_ids The IDs of the WP pages corresponding to BP component directories
  */
@@ -123,28 +155,33 @@ function bp_core_update_directory_page_ids( $blog_page_ids ) {
  * Get bp-pages names and slugs
  *
  * @package BuddyPress Core
- * @since 1.5
+ * @since BuddyPress (1.5)
  *
  * @return obj $pages Page names, IDs, and slugs
  */
 function bp_core_get_directory_pages() {
-	global $wpdb, $bp;
+	global $wpdb;
 
 	// Set pages as standard class
 	$pages = new stdClass;
 
 	// Get pages and IDs
-	if ( $page_ids = bp_core_get_directory_page_ids() ) {
+	$page_ids = bp_core_get_directory_page_ids();
+	if ( !empty( $page_ids ) ) {
 
 		// Always get page data from the root blog, except on multiblog mode, when it comes
 		// from the current blog
 		$posts_table_name = bp_is_multiblog_mode() ? $wpdb->posts : $wpdb->get_blog_prefix( bp_get_root_blog_id() ) . 'posts';
-		$page_ids_sql     = implode( ',', (array)$page_ids );
-		$page_names       = $wpdb->get_results( $wpdb->prepare( "SELECT ID, post_name, post_parent, post_title FROM {$posts_table_name} WHERE ID IN ({$page_ids_sql}) AND post_status = 'publish' " ) );
+		$page_ids_sql     = implode( ',', (array) $page_ids );
+		$page_names       = $wpdb->get_results( "SELECT ID, post_name, post_parent, post_title FROM {$posts_table_name} WHERE ID IN ({$page_ids_sql}) AND post_status = 'publish' " );
 
-		foreach ( (array)$page_ids as $component_id => $page_id ) {
-			foreach ( (array)$page_names as $page_name ) {
+		foreach ( (array) $page_ids as $component_id => $page_id ) {
+			foreach ( (array) $page_names as $page_name ) {
 				if ( $page_name->ID == $page_id ) {
+					if ( !isset( $pages->{$component_id} ) || !is_object( $pages->{$component_id} ) ) {
+						$pages->{$component_id} = new stdClass;
+					}
+
 					$pages->{$component_id}->name  = $page_name->post_name;
 					$pages->{$component_id}->id    = $page_name->ID;
 					$pages->{$component_id}->title = $page_name->post_title;
@@ -157,7 +194,7 @@ function bp_core_get_directory_pages() {
 						$page_name->post_parent = $parent[0]->post_parent;
 					}
 
-					$pages->{$component_id}->slug = implode( '/', array_reverse( (array)$slug ) );
+					$pages->{$component_id}->slug = implode( '/', array_reverse( (array) $slug ) );
 				}
 
 				unset( $slug );
@@ -186,7 +223,7 @@ function bp_core_get_directory_pages() {
  * to override specific component slugs.
  *
  * @package BuddyPress Core
- * @since 1.5
+ * @since BuddyPress (1.5)
  *
  * @param str $root_slug The root slug, which comes from $bp->pages->[component]->slug
  * @return str $slug The short slug for use in the middle of URLs
@@ -198,263 +235,6 @@ function bp_core_component_slug_from_root_slug( $root_slug ) {
  	return apply_filters( 'bp_core_component_slug_from_root_slug', $slug, $root_slug );
 }
 
-function bp_core_do_network_admin() {
-	$do_network_admin = false;
-
-	if ( is_multisite() && !bp_is_multiblog_mode() )
-		$do_network_admin = true;
-
-	return apply_filters( 'bp_core_do_network_admin', $do_network_admin );
-}
-
-function bp_core_admin_hook() {
-	$hook = bp_core_do_network_admin() ? 'network_admin_menu' : 'admin_menu';
-
-	return apply_filters( 'bp_core_admin_hook', $hook );
-}
-
-/**
- * Initializes the wp-admin area "BuddyPress" menus and sub menus.
- *
- * @package BuddyPress Core
- * @uses is_super_admin() returns true if the current user is a site admin, false if not
- */
-function bp_core_admin_menu_init() {
-	if ( !is_super_admin() )
-		return false;
-
-	add_action( bp_core_admin_hook(), 'bp_core_add_admin_menu', 9 );
-
-	require ( BP_PLUGIN_DIR . '/bp-core/admin/bp-core-admin.php' );
-}
-add_action( 'bp_init', 'bp_core_admin_menu_init' );
-
-/**
- * Adds the "BuddyPress" admin submenu item to the Site Admin tab.
- *
- * @package BuddyPress Core
- * @global object $bp Global BuddyPress settings object
- * @uses is_super_admin() returns true if the current user is a site admin, false if not
- * @uses add_submenu_page() WP function to add a submenu item
- */
-function bp_core_add_admin_menu() {
-	if ( !is_super_admin() )
-		return false;
-
-	// Don't add this version of the admin menu if a BP upgrade is in progress
- 	// See bp_core_update_add_admin_menu()
-	if ( defined( 'BP_IS_UPGRADE' ) && BP_IS_UPGRADE )
- 		return false;
-
-	$hooks = array();
-
-	// Add the administration tab under the "Site Admin" tab for site administrators
-	$hooks[] = add_menu_page( __( 'BuddyPress', 'buddypress' ), __( 'BuddyPress', 'buddypress' ), 'manage_options', 'bp-general-settings', 'bp_core_admin_component_setup', '' );
-	$hooks[] = add_submenu_page( 'bp-general-settings', __( 'Components', 'buddypress' ), __( 'Components', 'buddypress' ), 'manage_options', 'bp-general-settings', 'bp_core_admin_component_setup'  );
-	$hooks[] = add_submenu_page( 'bp-general-settings', __( 'Pages',      'buddypress' ), __( 'Pages',      'buddypress' ), 'manage_options', 'bp-page-settings',    'bp_core_admin_page_setup'       );
-	$hooks[] = add_submenu_page( 'bp-general-settings', __( 'Settings',   'buddypress' ), __( 'Settings',   'buddypress' ), 'manage_options', 'bp-settings',         'bp_core_admin_settings'         );
-
-	// Add a hook for css/js
-	foreach( $hooks as $hook )
-		add_action( "admin_print_styles-$hook", 'bp_core_add_admin_menu_styles' );
-}
-
-/**
- * Print admin messages to admin_notices or network_admin_notices
- *
- * BuddyPress combines all its messages into a single notice, to avoid a preponderance of yellow
- * boxes.
- *
- * @package BuddyPress Core
- * @since 1.5
- *
- * @global object $bp Global BuddyPress settings object
- * @uses is_super_admin() to check current user permissions before showing the notices
- * @uses bp_is_root_blog()
- */
-function bp_core_print_admin_notices() {
-	global $bp;
-
-	// Only the super admin should see messages
-	if ( !is_super_admin() )
-		return;
-
-	// On multisite installs, don't show on the Site Admin of a non-root blog, unless
-	// do_network_admin is overridden
-	if ( is_multisite() && bp_core_do_network_admin() && !bp_is_root_blog() )
-		return;
-
-	// Show the messages
-	if ( !empty( $bp->admin->notices ) ) {
-	?>
-		<div id="message" class="updated fade">
-			<?php foreach( $bp->admin->notices as $notice ) : ?>
-				<p><?php echo $notice ?></p>
-			<?php endforeach ?>
-		</div>
-	<?php
-	}
-}
-add_action( 'admin_notices', 'bp_core_print_admin_notices' );
-add_action( 'network_admin_notices', 'bp_core_print_admin_notices' );
-
-/**
- * Add an admin notice to the BP queue
- *
- * Messages added with this function are displayed in BuddyPress's general purpose admin notices
- * box. It is recommended that you hook this function to admin_init, so that your messages are
- * loaded in time.
- *
- * @package BuddyPress Core
- * @since 1.5
- *
- * @global object $bp Global BuddyPress settings object
- * @param string $notice The notice you are adding to the queue
- */
-function bp_core_add_admin_notice( $notice ) {
-	global $bp;
-
-	if ( empty( $bp->admin->notices ) ) {
-		$bp->admin->notices = array();
-	}
-
-	$bp->admin->notices[] = $notice;
-}
-
-/**
- * Verify that some BP prerequisites are set up properly, and notify the admin if not
- *
- * On every Dashboard page, this function checks the following:
- *   - that pretty permalinks are enabled
- *   - that a BP-compatible theme is activated
- *   - that every BP component that needs a WP page for a directory has one
- *   - that no WP page has multiple BP components associated with it
- * The administrator will be shown a notice for each check that fails.
- *
- * @package BuddyPress Core
- */
-function bp_core_activation_notice() {
-	global $wp_rewrite, $wpdb, $bp;
-
-	// Only the super admin gets warnings
-	if ( !is_super_admin() )
-		return;
-
-	// On multisite installs, don't load on a non-root blog, unless do_network_admin is
-	// overridden
-	if ( is_multisite() && bp_core_do_network_admin() && !bp_is_root_blog() )
-		return;
-
-	// Don't show these messages during setup or upgrade
-	if ( isset( $bp->maintenance_mode ) )
-		return;
-
-	/**
-	 * Check to make sure that the blog setup routine has run. This can't happen during the
-	 * wizard because of the order which the components are loaded. We check for multisite here
-	 * on the off chance that someone has activated the blogs component and then disabled MS
-	 */
-	if ( bp_is_active( 'blogs' ) ) {
-		$count = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(*) FROM {$bp->blogs->table_name}" ) );
-
-		if ( !$count )
-			bp_blogs_record_existing_blogs();
-	}
-
-	/**
-	 * Are pretty permalinks enabled?
-	 */
-	if ( isset( $_POST['permalink_structure'] ) )
-		return false;
-
-	if ( empty( $wp_rewrite->permalink_structure ) ) {
-		bp_core_add_admin_notice( sprintf( __( '<strong>BuddyPress is almost ready</strong>. You must <a href="%s">update your permalink structure</a> to something other than the default for it to work.', 'buddypress' ), admin_url( 'options-permalink.php' ) ) );
-	}
-
-	/**
-	 * Are you using a BP-compatible theme?
-	 */
-
-	// Get current theme info
-	$ct = current_theme_info();
-
-	// The best way to remove this notice is to add a "buddypress" tag to
-	// your active theme's CSS header.
-	if ( !defined( 'BP_SILENCE_THEME_NOTICE' ) && !in_array( 'buddypress', (array)$ct->tags ) ) {
-		bp_core_add_admin_notice( sprintf( __( "You'll need to <a href='%s'>activate a <strong>BuddyPress-compatible theme</strong></a> to take advantage of all of BuddyPress's features. We've bundled a default theme, but you can always <a href='%s'>install some other compatible themes</a> or <a href='%s'>update your existing WordPress theme</a>.", 'buddypress' ), admin_url( 'themes.php' ), network_admin_url( 'theme-install.php?type=tag&s=buddypress&tab=search' ), network_admin_url( 'plugin-install.php?type=term&tab=search&s=%22bp-template-pack%22' ) ) );
-	}
-
-	/**
-	 * Check for orphaned BP components (BP component is enabled, no WP page exists)
-	 */
-
-	$orphaned_components = array();
-	$wp_page_components  = array();
-
-	// Only components with 'has_directory' require a WP page to function
-	foreach( $bp->loaded_components as $component_id => $is_active ) {
-		if ( !empty( $bp->{$component_id}->has_directory ) ) {
-			$wp_page_components[] = array(
-				'id'   => $component_id,
-				'name' => isset( $bp->{$component_id}->name ) ? $bp->{$component_id}->name : ucwords( $bp->{$component_id}->id )
-			);
-		}
-	}
-
-	// Activate and Register are special cases. They are not components but they need WP pages.
-	// If user registration is disabled, we can skip this step.
-	if ( bp_get_signup_allowed() ) {
-		$wp_page_components[] = array(
-			'id'   => 'activate',
-			'name' => __( 'Activate', 'buddypress' )
-		);
-
-		$wp_page_components[] = array(
-			'id'   => 'register',
-			'name' => __( 'Register', 'buddypress' )
-		);
-	}
-
-	foreach( $wp_page_components as $component ) {
-		if ( !isset( $bp->pages->{$component['id']} ) ) {
-			$orphaned_components[] = $component['name'];
-		}
-	}
-
-	if ( !empty( $orphaned_components ) ) {
-		$admin_url = bp_get_admin_url( add_query_arg( array( 'page' => 'bp-page-settings' ), 'admin.php' ) );
-		$notice    = sprintf( __( 'The following active BuddyPress Components do not have associated WordPress Pages: %2$s. <a href="%1$s" class="button-secondary">Repair</a>', 'buddypress' ), $admin_url, '<strong>' . implode( '</strong>, <strong>', $orphaned_components ) . '</strong>' );
-
-		bp_core_add_admin_notice( $notice );
-	}
-
-	/**
-	 * BP components cannot share a single WP page. Check for duplicate assignments, and post
-	 * a message if found.
-	 */
-	$dupe_names = array();
-	$page_ids   = (array)bp_core_get_directory_page_ids();
-	$dupes      = array_diff_assoc( $page_ids, array_unique( $page_ids ) );
-
-	if ( !empty( $dupes ) ) {
-		foreach( $dupes as $dupe_component => $dupe_id ) {
-			$dupe_names[] = $bp->pages->{$dupe_component}->title;
-		}
-
-		// Make sure that there are no duplicate duplicates :)
-		$dupe_names = array_unique( $dupe_names );
-	}
-
-	// If there are duplicates, post a message about them
-	if ( !empty( $dupe_names ) ) {
-		$admin_url = bp_get_admin_url( add_query_arg( array( 'page' => 'bp-page-settings' ), 'admin.php' ) );
-		$notice    = sprintf( __( 'Each BuddyPress Component needs its own WordPress page. The following WordPress Pages have more than one component associated with them: %2$s. <a href="%1$s" class="button-secondary">Repair</a>', 'buddypress' ), $admin_url, '<strong>' . implode( '</strong>, <strong>', $dupe_names ) . '</strong>' );
-
-		bp_core_add_admin_notice( $notice );
-	}
-}
-add_action( 'admin_init', 'bp_core_activation_notice' );
-
 /**
  * Returns the domain for the root blog.
  * eg: http://domain.com/ OR https://domain.com
@@ -464,7 +244,6 @@ add_action( 'admin_init', 'bp_core_activation_notice' );
  * @return $domain The domain URL for the blog.
  */
 function bp_core_get_root_domain() {
-	global $wpdb;
 
 	$domain = get_home_url( bp_get_root_blog_id() );
 
@@ -490,7 +269,7 @@ function bp_core_current_time( $gmt = true ) {
  *
  * @package BuddyPress Core
  *
- * @global obj $bp
+ * @global BuddyPress $bp The one true BuddyPress instance
  * @param str $message Feedback to give to user
  * @param str $type updated|success|error|warning
  */
@@ -547,16 +326,19 @@ add_action( 'bp_actions', 'bp_core_setup_message', 5 );
  * The hook action 'template_notices' is used to call this function, it is not called directly.
  *
  * @package BuddyPress Core
- * @global object $bp Global BuddyPress settings object
+ * @global BuddyPress $bp The one true BuddyPress instance
  */
 function bp_core_render_message() {
 	global $bp;
 
-	if ( isset( $bp->template_message ) && $bp->template_message ) :
-		$type = ( 'success' == $bp->template_message_type ) ? 'updated' : 'error'; ?>
+	if ( !empty( $bp->template_message ) ) :
+		$type    = ( 'success' == $bp->template_message_type ) ? 'updated' : 'error';
+		$content = apply_filters( 'bp_core_render_message_content', $bp->template_message, $type ); ?>
 
 		<div id="message" class="<?php echo $type; ?>">
-			<p><?php echo stripslashes( esc_attr( $bp->template_message ) ); ?></p>
+
+			<?php echo $content; ?>
+
 		</div>
 
 	<?php
@@ -574,11 +356,12 @@ function bp_core_render_message() {
  * @return str
  */
 function bp_core_number_format( $number, $decimals = false ) {
-	// Check we actually have a number first.
+
+	// Force number to 0 if needed
 	if ( empty( $number ) )
-		return $number;
+		$number = 0;
 
-	return apply_filters( 'bp_core_number_format', number_format( $number, $decimals ), $number, $decimals );
+	return apply_filters( 'bp_core_number_format', number_format_i18n( $number, $decimals ), $number, $decimals );
 }
 
 /**
@@ -616,7 +399,7 @@ function bp_core_time_since( $older_date, $newer_date = false ) {
 	if ( !empty( $older_date ) && !is_numeric( $older_date ) ) {
 		$time_chunks = explode( ':', str_replace( ' ', ':', $older_date ) );
 		$date_chunks = explode( '-', str_replace( ' ', '-', $older_date ) );
-		$older_date  = gmmktime( (int)$time_chunks[1], (int)$time_chunks[2], (int)$time_chunks[3], (int)$date_chunks[1], (int)$date_chunks[2], (int)$date_chunks[0] );
+		$older_date  = gmmktime( (int) $time_chunks[1], (int) $time_chunks[2], (int) $time_chunks[3], (int) $date_chunks[1], (int) $date_chunks[2], (int) $date_chunks[0] );
 	}
 
 	/**
@@ -646,7 +429,8 @@ function bp_core_time_since( $older_date, $newer_date = false ) {
 			$seconds = $chunks[$i][0];
 
 			// Finding the biggest chunk (if the chunk fits, break)
-			if ( ( $count = floor($since / $seconds) ) != 0 ) {
+			$count = floor( $since / $seconds );
+			if ( 0 != $count ) {
 				break;
 			}
 		}
@@ -663,16 +447,17 @@ function bp_core_time_since( $older_date, $newer_date = false ) {
 			// Step two: the second chunk
 			if ( $i + 2 < $j ) {
 				$seconds2 = $chunks[$i + 1][0];
-				$name2 = $chunks[$i + 1][1];
+				$name2    = $chunks[$i + 1][1];
+				$count2   = floor( ( $since - ( $seconds * $count ) ) / $seconds2 );
 
-				if ( ( $count2 = floor( ( $since - ( $seconds * $count ) ) / $seconds2 ) ) != 0 ) {
-					// Add to output var
-					$output .= ( 1 == $count2 ) ? _x( ',', 'Separator in time since', 'buddypress' ) . ' 1 '. $chunks[$i + 1][1] : _x( ',', 'Separator in time since', 'buddypress' ) . ' ' . $count2 . ' ' . $chunks[$i + 1][2];
+				// Add to output var
+				if ( 0 != $count2 ) {
+					$output .= ( 1 == $count2 ) ? _x( ',', 'Separator in time since', 'buddypress' ) . ' 1 '. $name2 : _x( ',', 'Separator in time since', 'buddypress' ) . ' ' . $count2 . ' ' . $chunks[$i + 1][2];
 				}
 			}
 
 			// No output, so happened right now
-			if ( !(int)trim( $output ) ) {
+			if ( ! (int) trim( $output ) ) {
 				$output = $right_now_text;
 			}
 		}
@@ -696,14 +481,13 @@ function bp_core_time_since( $older_date, $newer_date = false ) {
  * @uses bp_update_user_meta() BP function to update user metadata in the usermeta table.
  */
 function bp_core_record_activity() {
-	global $bp;
 
 	if ( !is_user_logged_in() )
 		return false;
 
-	$user_id = $bp->loggedin_user->id;
+	$user_id = bp_loggedin_user_id();
 
-	if ( bp_core_is_user_spammer( $user_id ) || bp_core_is_user_deleted( $user_id ) )
+	if ( bp_is_user_inactive( $user_id ) )
 		return false;
 
 	$activity = bp_get_user_meta( $user_id, 'last_activity', true );
@@ -714,6 +498,11 @@ function bp_core_record_activity() {
 	// Get current time
 	$current_time = bp_core_current_time();
 
+	// Use this action to detect the very first activity for a given member
+	if ( empty( $activity ) ) {
+		do_action( 'bp_first_activity_for_member', $user_id );
+	}
+
 	if ( empty( $activity ) || strtotime( $current_time ) >= strtotime( '+5 minutes', $activity ) )
 		bp_update_user_meta( $user_id, 'last_activity', $current_time );
 }
@@ -729,8 +518,9 @@ add_action( 'wp_head', 'bp_core_record_activity' );
  * @uses bp_core_time_since() This function will return an English representation of the time elapsed.
  */
 function bp_core_get_last_activity( $last_activity_date, $string ) {
-	if ( !$last_activity_date || empty( $last_activity_date ) )
-		$last_active = __( 'not recently active', 'buddypress' );
+
+	if ( empty( $last_activity_date ) )
+		$last_active = __( 'Not recently active', 'buddypress' );
 	else
 		$last_active = sprintf( $string, bp_core_time_since( $last_activity_date ) );
 
@@ -742,12 +532,11 @@ function bp_core_get_last_activity( $last_activity_date, $string ) {
  *
  * @package BuddyPress Core
  *
- * @global $bp $bp
  * @global object $current_site
  * @return string
  */
 function bp_core_get_site_path() {
-	global $bp, $current_site;
+	global $current_site;
 
 	if ( is_multisite() )
 		$site_path = $current_site->path;
@@ -776,16 +565,22 @@ function bp_core_get_site_path() {
  * Performs a status safe wp_redirect() that is compatible with bp_catch_uri()
  *
  * @package BuddyPress Core
- * @global $bp_no_status_set Makes sure that there are no conflicts with status_header() called in bp_core_do_catch_uri()
- * @uses get_themes()
- * @return An array containing all of the themes.
+ * @global BuddyPress $bp Makes sure that there are no conflicts with
+ *                         status_header() called in bp_core_do_catch_uri()
+ * @uses wp_redirect()
  */
 function bp_core_redirect( $location, $status = 302 ) {
-	global $bp_no_status_set;
+	global $bp;
+
+	// On some setups, passing the value of wp_get_referer() may result in an empty value for
+	// $location, which results in an error. Ensure that we have a valid URL.
+	if ( empty( $location ) ) {
+		$location = bp_get_root_domain();
+	}
 
 	// Make sure we don't call status_header() in bp_core_do_catch_uri()
 	// as this conflicts with wp_redirect()
-	$bp_no_status_set = true;
+	$bp->no_status_set = true;
 
 	wp_redirect( $location, $status );
 	die;
@@ -817,11 +612,9 @@ function bp_core_add_illegal_names() {
  * A javascript free implementation of the search functions in BuddyPress
  *
  * @package BuddyPress Core
- * @global object $bp Global BuddyPress settings object
  * @param string $slug The slug to redirect to for searching.
  */
 function bp_core_action_search_site( $slug = '' ) {
-	global $bp;
 
 	if ( !bp_is_current_component( bp_get_search_slug() ) )
 		return;
@@ -904,7 +697,7 @@ function bp_core_load_buddypress_textdomain() {
 	$locale        = apply_filters( 'buddypress_locale', get_locale() );
 	$mofile        = sprintf( 'buddypress-%s.mo', $locale );
 	$mofile_global = WP_LANG_DIR . '/' . $mofile;
-	$mofile_local  = BP_PLUGIN_DIR . '/bp-languages/' . $mofile;
+	$mofile_local  = BP_PLUGIN_DIR . 'bp-languages/' . $mofile;
 
 	if ( file_exists( $mofile_global ) )
 		return load_textdomain( 'buddypress', $mofile_global );
@@ -913,21 +706,14 @@ function bp_core_load_buddypress_textdomain() {
 	else
 		return false;
 }
-add_action ( 'bp_init', 'bp_core_load_buddypress_textdomain', 2 );
-
-function bp_core_add_ajax_hook() {
-	// Theme only, we already have the wp_ajax_ hook firing in wp-admin
-	if ( !defined( 'WP_ADMIN' ) && isset( $_REQUEST['action'] ) )
-		do_action( 'wp_ajax_' . $_REQUEST['action'] );
-}
-add_action( 'bp_init', 'bp_core_add_ajax_hook' );
+add_action ( 'bp_core_loaded', 'bp_core_load_buddypress_textdomain' );
 
 /**
  * Initializes {@link BP_Embed} after everything is loaded.
  *
  * @global object $bp BuddyPress global settings
  * @package BuddyPress Core
- * @since 1.5
+ * @since BuddyPress (1.5)
  */
 function bp_embed_init() {
 	global $bp;
@@ -937,135 +723,6 @@ function bp_embed_init() {
 }
 add_action( 'bp_init', 'bp_embed_init', 9 );
 
-/**
- * When switching from single to multisite we need to copy blog options to
- * site options.
- *
- * @package BuddyPress Core
- * @todo Does this need to be here anymore after the introduction of bp_get_option etc?
- */
-function bp_core_activate_site_options( $keys = array() ) {
-	global $bp;
-
-	if ( !empty( $keys ) && is_array( $keys ) ) {
-		$errors = false;
-
-		foreach ( $keys as $key => $default ) {
-			if ( empty( $bp->site_options[ $key ] ) ) {
-				$bp->site_options[ $key ] = bp_get_option( $key, $default );
-
-				if ( !bp_update_option( $key, $bp->site_options[ $key ] ) )
-					$errors = true;
-			}
-		}
-
-		if ( empty( $errors ) )
-			return true;
-	}
-
-	return false;
-}
-
-/**
- * BuddyPress uses common options to store configuration settings. Many of these
- * settings are needed at run time. Instead of fetching them all and adding many
- * initial queries to each page load, let's fetch them all in one go.
- *
- * @package BuddyPress Core
- * @todo Use settings API and audit these methods
- */
-function bp_core_get_root_options() {
-	global $wpdb;
-
-	// These options come from the root blog options table
-	$root_blog_options = apply_filters( 'bp_core_site_options', array(
-
-		// BuddyPress core settings
-		'bp-deactivated-components'       => serialize( array( ) ),
-		'bp-blogs-first-install'          => '0',
-		'bp-disable-blogforum-comments'  => '0',
-		'bp-xprofile-base-group-name'     => 'Base',
-		'bp-xprofile-fullname-field-name' => 'Name',
-		'bp-disable-profile-sync'         => '0',
-		'bp-disable-avatar-uploads'       => '0',
-		'bp-disable-account-deletion'     => '0',
-		'bp-disable-blogforum-comments'   => '0',
-		'bb-config-location'              => ABSPATH . 'bb-config.php',
-		'hide-loggedout-adminbar'         => '0',
-
-		// Useful WordPress settings
-		'registration'                    => '0',
-		'avatar_default'                  => 'mysteryman'
-	) );
-
-	$root_blog_option_keys  = array_keys( $root_blog_options );
-	$blog_options_keys      = "'" . join( "', '", (array) $root_blog_option_keys ) . "'";
-	$blog_options_table	= bp_is_multiblog_mode() ? $wpdb->options : $wpdb->get_blog_prefix( bp_get_root_blog_id() ) . 'options';
-
-	$blog_options_query     = $wpdb->prepare( "SELECT option_name AS name, option_value AS value FROM {$blog_options_table} WHERE option_name IN ( {$blog_options_keys} )" );
-	$root_blog_options_meta = $wpdb->get_results( $blog_options_query );
-
-	// On Multisite installations, some options must always be fetched from sitemeta
-	if ( is_multisite() ) {
-		$network_options = apply_filters( 'bp_core_network_options', array(
-			'tags_blog_id'       => '0',
-			'sitewide_tags_blog' => '',
-			'registration'       => '0',
-			'fileupload_maxk'    => '1500'
-		) );
-
-		$current_site           = get_current_site();
-		$network_option_keys    = array_keys( $network_options );
-		$sitemeta_options_keys  = "'" . join( "', '", (array) $network_option_keys ) . "'";
-		$sitemeta_options_query = $wpdb->prepare( "SELECT meta_key AS name, meta_value AS value FROM {$wpdb->sitemeta} WHERE meta_key IN ( {$sitemeta_options_keys} ) AND site_id = %d", $current_site->id );
-		$network_options_meta   = $wpdb->get_results( $sitemeta_options_query );
-
-		// Sitemeta comes second in the merge, so that network 'registration' value wins
-		$root_blog_options_meta = array_merge( $root_blog_options_meta, $network_options_meta );
-	}
-
-	// Missing some options, so do some one-time fixing
-	if ( empty( $root_blog_options_meta ) || ( count( $root_blog_options_meta ) < count( $root_blog_option_keys ) ) ) {
-
-	// Unset the query - We'll be resetting it soon
-	unset( $root_blog_options_meta );
-
-	// Loop through options
-	foreach ( $root_blog_options as $old_meta_key => $old_meta_default ) {
-		// Clear out the value from the last time around
-		unset( $old_meta_value );
-
-		// Get old site option
-		if ( is_multisite() )
-			$old_meta_value = get_site_option( $old_meta_key );
-
-		// No site option so look in root blog
-		if ( empty( $old_meta_value ) )
-			$old_meta_value = bp_get_option( $old_meta_key, $old_meta_default );
-
-		// Update the root blog option
-		bp_update_option( $old_meta_key, $old_meta_value );
-
-		// Update the global array
-		$root_blog_options_meta[$old_meta_key] = $old_meta_value;
-	}
-
-	// We're all matched up
-	} else {
-		// Loop through our results and make them usable
-		foreach ( $root_blog_options_meta as $root_blog_option )
-			$root_blog_options[$root_blog_option->name] = $root_blog_option->value;
-
-		// Copy the options no the return val
-		$root_blog_options_meta = $root_blog_options;
-
-		// Clean up our temporary copy
-		unset( $root_blog_options );
-	}
-
-	return apply_filters( 'bp_core_get_root_options', $root_blog_options_meta );
-}
-
 /**
  * This function originally let plugins add support for pages in the root of the install.
  * These root level pages are now handled by actual WordPress pages and this function is now
@@ -1083,7 +740,7 @@ function bp_core_add_root_component( $slug ) {
 	$match = false;
 
 	// Check if the slug is registered in the $bp->pages global
-	foreach ( (array)$bp->pages as $key => $page ) {
+	foreach ( (array) $bp->pages as $key => $page ) {
 		if ( $key == $slug || $page->slug == $slug )
 			$match = true;
 	}
@@ -1105,7 +762,7 @@ function bp_core_create_root_component_page() {
 
 	$new_page_ids = array();
 
-	foreach ( (array)$bp->add_root as $slug )
+	foreach ( (array) $bp->add_root as $slug )
 		$new_page_ids[$slug] = wp_insert_post( array( 'comment_status' => 'closed', 'ping_status' => 'closed', 'post_title' => ucwords( $slug ), 'post_status' => 'publish', 'post_type' => 'page' ) );
 
 	$page_ids = array_merge( (array) $new_page_ids, (array) bp_core_get_directory_page_ids() );
@@ -1116,12 +773,13 @@ function bp_core_create_root_component_page() {
  * Is this the root blog ID?
  *
  * @package BuddyPress
- * @since 1.5
+ * @since BuddyPress (1.5)
  *
  * @param int $blog_id Optional. Defaults to the current blog id.
  * @return bool $is_root_blog Returns true if this is bp_get_root_blog_id().
  */
 function bp_is_root_blog( $blog_id = 0 ) {
+
 	// Assume false
 	$is_root_blog = false;
 
@@ -1133,45 +791,21 @@ function bp_is_root_blog( $blog_id = 0 ) {
 	if ( $blog_id == bp_get_root_blog_id() )
 		$is_root_blog = true;
 
-	return apply_filters( 'bp_is_root_blog', (bool) $is_root_blog );
+	return (bool) apply_filters( 'bp_is_root_blog', (bool) $is_root_blog );
 }
 
 /**
  * Is this bp_get_root_blog_id()?
  *
  * @package BuddyPress
- * @since 1.5
+ * @since BuddyPress (1.5)
  *
- * @param int $blog_id Optional. Defaults to the current blog id.
- * @return bool $is_root_blog Returns true if this is bp_get_root_blog_id().
+ * @return int Return the root site ID
  */
-function bp_get_root_blog_id( $blog_id = false ) {
-
-	// Define on which blog ID BuddyPress should run
-	if ( !defined( 'BP_ROOT_BLOG' ) ) {
-
-		// Root blog is the main site on this network
-		if ( is_multisite() && !bp_is_multiblog_mode() ) {
-			$current_site = get_current_site();
-			$root_blog_id = $current_site->blog_id;
-
-		// Root blog is whatever the current site is (could be any site on the network)
-		} elseif ( is_multisite() && bp_is_multiblog_mode() ) {
-			$root_blog_id = get_current_blog_id();
-
-		// Root blog is the only blog on this network
-		} elseif( !is_multisite() ) {
-			$root_blog_id = 1;
-		}
-
-		define( 'BP_ROOT_BLOG', $root_blog_id );
-
-	// Root blog is defined
-	} else {
-		$root_blog_id = BP_ROOT_BLOG;
-	}
+function bp_get_root_blog_id() {
+	global $bp;
 
-	return apply_filters( 'bp_get_root_blog_id', (int) $root_blog_id );
+	return (int) apply_filters( 'bp_get_root_blog_id', (int) $bp->root_blog_id );
 }
 
 /**
@@ -1188,7 +822,7 @@ function bp_get_root_blog_id( $blog_id = false ) {
  * If using the WP functions, do not not hardcode your meta keys.
  *
  * @package BuddyPress
- * @since 1.5
+ * @since BuddyPress (1.5)
  *
  * @uses apply_filters() Filter bp_get_user_meta_key to modify keys individually
  * @param str $key
@@ -1205,7 +839,7 @@ function bp_get_user_meta_key( $key = false ) {
  * increasing compatibility with non-standard BP setups.
  *
  * @package BuddyPress
- * @since 1.5
+ * @since BuddyPress (1.5)
  *
  * @uses bp_get_user_meta_key() For a filterable version of the meta key
  * @uses get_user_meta() See get_user_meta() docs for more details on parameters
@@ -1226,7 +860,7 @@ function bp_get_user_meta( $user_id, $key, $single = false ) {
  * thereby increasing compatibility with non-standard BP setups.
  *
  * @package BuddyPress
- * @since 1.5
+ * @since BuddyPress (1.5)
  *
  * @uses bp_get_user_meta_key() For a filterable version of the meta key
  * @uses update_user_meta() See update_user_meta() docs for more details on parameters
@@ -1247,7 +881,7 @@ function bp_update_user_meta( $user_id, $key, $value, $prev_value = '' ) {
  * thereby increasing compatibility with non-standard BP setups.
  *
  * @package BuddyPress
- * @since 1.5
+ * @since BuddyPress (1.5)
  *
  * @uses bp_get_user_meta_key() For a filterable version of the meta key
  * @uses delete_user_meta() See delete_user_meta() docs for more details on parameters
@@ -1264,7 +898,7 @@ function bp_delete_user_meta( $user_id, $key, $value = '' ) {
  * Are we running username compatibility mode?
  *
  * @package BuddyPress
- * @since 1.5
+ * @since BuddyPress (1.5)
  *
  * @uses apply_filters() Filter 'bp_is_username_compatibility_mode' to alter
  * @return bool False when compatibility mode is disabled (default); true when enabled
@@ -1288,7 +922,7 @@ function bp_is_username_compatibility_mode() {
  * blog.
  *
  * @package BuddyPress
- * @since 1.5
+ * @since BuddyPress (1.5)
  *
  * @uses apply_filters() Filter 'bp_is_multiblog_mode' to alter
  * @return bool False when multiblog mode is disabled (default); true when enabled
@@ -1298,29 +932,83 @@ function bp_is_multiblog_mode() {
 }
 
 /**
- * Should we use the WP admin bar?
- *
- * The WP Admin Bar, introduced in WP 3.1, is fully supported in BuddyPress as of BP 1.5.
+ * Should we use the WP Toolbar?
  *
- * For the BP 1.5 development cycle, the BuddyBar will remain the default navigation for BP
- * installations. In the future, this behavior will be changed, so that the WP Admin Bar is the
- * default.
- *
- * @package BuddyPress
- * @since 1.5
+ * The WP Toolbar, introduced in WP 3.1, is fully supported in BuddyPress as of BP 1.5.
+ * For BP 1.6, the WP Toolbar is the default.
  *
+ * @return bool False when WP Toolbar support is disabled; true when enabled (default)
+ * @since BuddyPress (1.5)
  * @uses apply_filters() Filter 'bp_use_wp_admin_bar' to alter
- * @return bool False when WP Admin Bar support is disabled (default); true when enabled
  */
 function bp_use_wp_admin_bar() {
-	return apply_filters( 'bp_use_wp_admin_bar', defined( 'BP_USE_WP_ADMIN_BAR' ) && BP_USE_WP_ADMIN_BAR );
+	$use_admin_bar = true;
+
+	// Has the WP Toolbar constant been explicity set?
+	if ( defined( 'BP_USE_WP_ADMIN_BAR' ) && ! BP_USE_WP_ADMIN_BAR )
+		$use_admin_bar = false;
+
+	// Has the admin chosen to use the BuddyBar during an upgrade?
+	elseif ( (bool) bp_get_option( '_bp_force_buddybar', false ) )
+		$use_admin_bar = false;
+
+	return apply_filters( 'bp_use_wp_admin_bar', $use_admin_bar );
 }
 
+/**
+ * A utility for parsing individual function arguments into an array.
+ *
+ * The purpose of this function is to help with backward compatibility in cases where
+ *
+ *   function foo( $bar = 1, $baz = false, $barry = array(), $blip = false ) { // ...
+ *
+ * is deprecated in favor of
+ *
+ *   function foo( $args = array() ) {
+ *       $defaults = array(
+ *           'bar'  => 1,
+ *           'arg2' => false,
+ *           'arg3' => array(),
+ *           'arg4' => false,
+ *       );
+ *       $r = wp_parse_args( $args, $defaults ); // ...
+ *
+ * The first argument, $old_args_keys, is an array that matches the parameter positions (keys) to
+ * the new $args keys (values):
+ *
+ *   $old_args_keys = array(
+ *       0 => 'bar', // because $bar was the 0th parameter for foo()
+ *       1 => 'baz', // because $baz was the 1st parameter for foo()
+ *       2 => 'barry', // etc
+ *       3 => 'blip'
+ *   );
+ *
+ * For the second argument, $func_args, you should just pass the value of func_get_args().
+ *
+ * @since BuddyPress (1.6)
+ * @param array $old_args_keys
+ * @param array $func_args
+ * @return array $new_args
+ */
+function bp_core_parse_args_array( $old_args_keys, $func_args ) {
+	$new_args = array();
+
+	foreach( $old_args_keys as $arg_num => $arg_key ) {
+		if ( isset( $func_args[$arg_num] ) ) {
+			$new_args[$arg_key] = $func_args[$arg_num];
+		}
+	}
+
+	return $new_args;
+}
+
+/** Embeds ********************************************************************/
+
 /**
  * Are oembeds allowed in activity items?
  *
  * @return bool False when activity embed support is disabled; true when enabled (default)
- * @since 1.5
+ * @since BuddyPress (1.5)
  */
 function bp_use_embed_in_activity() {
 	return apply_filters( 'bp_use_oembed_in_activity', !defined( 'BP_EMBED_DISABLE_ACTIVITY' ) || !BP_EMBED_DISABLE_ACTIVITY );
@@ -1330,7 +1018,7 @@ function bp_use_embed_in_activity() {
  * Are oembeds allwoed in activity replies?
  *
  * @return bool False when activity replies embed support is disabled; true when enabled (default)
- * @since 1.5
+ * @since BuddyPress (1.5)
  */
 function bp_use_embed_in_activity_replies() {
 	return apply_filters( 'bp_use_embed_in_activity_replies', !defined( 'BP_EMBED_DISABLE_ACTIVITY_REPLIES' ) || !BP_EMBED_DISABLE_ACTIVITY_REPLIES );
@@ -1340,7 +1028,7 @@ function bp_use_embed_in_activity_replies() {
  * Are oembeds allowed in forum posts?
  *
  * @return bool False when form post embed support is disabled; true when enabled (default)
- * @since 1.5
+ * @since BuddyPress (1.5)
  */
 function bp_use_embed_in_forum_posts() {
 	return apply_filters( 'bp_use_embed_in_forum_posts', !defined( 'BP_EMBED_DISABLE_FORUM_POSTS' ) || !BP_EMBED_DISABLE_FORUM_POSTS );
@@ -1350,17 +1038,19 @@ function bp_use_embed_in_forum_posts() {
  * Are oembeds allowed in private messages?
  *
  * @return bool False when form post embed support is disabled; true when enabled (default)
- * @since 1.5
+ * @since BuddyPress (1.5)
  */
 function bp_use_embed_in_private_messages() {
 	return apply_filters( 'bp_use_embed_in_private_messages', !defined( 'BP_EMBED_DISABLE_PRIVATE_MESSAGES' ) || !BP_EMBED_DISABLE_PRIVATE_MESSAGES );
 }
 
+/** Admin *********************************************************************/
+
 /**
  * Output the correct URL based on BuddyPress and WordPress configuration
  *
  * @package BuddyPress
- * @since 1.5
+ * @since BuddyPress (1.5)
  *
  * @param string $path
  * @param string $scheme
@@ -1374,7 +1064,7 @@ function bp_admin_url( $path = '', $scheme = 'admin' ) {
 	 * Return the correct URL based on BuddyPress and WordPress configuration
 	 *
 	 * @package BuddyPress
-	 * @since 1.5
+	 * @since BuddyPress (1.5)
 	 *
 	 * @param string $path
 	 * @param string $scheme
@@ -1396,12 +1086,27 @@ function bp_admin_url( $path = '', $scheme = 'admin' ) {
 		return $url;
 	}
 
+function bp_core_do_network_admin() {
+	$do_network_admin = false;
+
+	if ( is_multisite() && !bp_is_multiblog_mode() )
+		$do_network_admin = true;
+
+	return apply_filters( 'bp_core_do_network_admin', $do_network_admin );
+}
+
+function bp_core_admin_hook() {
+	$hook = bp_core_do_network_admin() ? 'network_admin_menu' : 'admin_menu';
+
+	return apply_filters( 'bp_core_admin_hook', $hook );
+}
+
 /** Global Manipulators *******************************************************/
 
 /**
  * Set the $bp->is_directory global
  *
- * @global obj $bp
+ * @global BuddyPress $bp The one true BuddyPress instance
  * @param bool $is_directory
  * @param str $component
  */
@@ -1417,7 +1122,7 @@ function bp_update_is_directory( $is_directory = false, $component = '' ) {
 /**
  * Set the $bp->is_item_admin global
  *
- * @global obj $bp
+ * @global BuddyPress $bp The one true BuddyPress instance
  * @param bool $is_item_admin
  * @param str $component
  */
@@ -1433,7 +1138,7 @@ function bp_update_is_item_admin( $is_item_admin = false, $component = '' ) {
 /**
  * Set the $bp->is_item_mod global
  *
- * @global obj $bp
+ * @global BuddyPress $bp The one true BuddyPress instance
  * @param bool $is_item_mod
  * @param str $component
  */
@@ -1449,13 +1154,13 @@ function bp_update_is_item_mod( $is_item_mod = false, $component = '' ) {
 /**
  * Trigger a 404
  *
- * @global object $bp Global BuddyPress settings object
+ * @global BuddyPress $bp The one true BuddyPress instance
  * @global WP_Query $wp_query WordPress query object
  * @param string $redirect If 'remove_canonical_direct', remove WordPress' "helpful" redirect_canonical action.
- * @since 1.5
+ * @since BuddyPress (1.5)
  */
 function bp_do_404( $redirect = 'remove_canonical_direct' ) {
-	global $bp, $wp_query;
+	global $wp_query;
 
 	do_action( 'bp_do_404', $redirect );
 
@@ -1466,4 +1171,40 @@ function bp_do_404( $redirect = 'remove_canonical_direct' ) {
 	if ( 'remove_canonical_direct' == $redirect )
 		remove_action( 'template_redirect', 'redirect_canonical' );
 }
+
+/** Nonces ********************************************************************/
+
+/**
+ * Makes sure the user requested an action from another page on this site.
+ *
+ * To avoid security exploits within the theme.
+ *
+ * @since BuddyPress (1.6)
+ *
+ * @uses do_action() Calls 'bp_verify_nonce_request' on $action.
+ * @param string $action Action nonce
+ * @param string $query_arg where to look for nonce in $_REQUEST
+ */
+function bp_verify_nonce_request( $action = '', $query_arg = '_wpnonce' ) {
+
+	// Get the home URL
+	$home_url = strtolower( home_url() );
+
+	// Build the currently requested URL
+	$scheme        = is_ssl() ? 'https://' : 'http://';
+	$requested_url = strtolower( $scheme . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] );
+
+	// Check the nonce
+	$result = isset( $_REQUEST[$query_arg] ) ? wp_verify_nonce( $_REQUEST[$query_arg], $action ) : false;
+
+	// Nonce check failed
+	if ( empty( $result ) || empty( $action ) || ( strpos( $requested_url, $home_url ) !== 0 ) )
+		$result = false;
+
+	// Do extra things
+	do_action( 'bp_verify_nonce_request', $action, $result );
+
+	return $result;
+}
+
 ?>
diff --git a/wp-content/plugins/buddypress/bp-core/bp-core-loader.php b/wp-content/plugins/buddypress/bp-core/bp-core-loader.php
index 3a167107df4ef76af1a50352d0f8d1d3ca2d1a89..635f6b4abde5336a56813c74ee6b9a20bf40b9ab 100644
--- a/wp-content/plugins/buddypress/bp-core/bp-core-loader.php
+++ b/wp-content/plugins/buddypress/bp-core/bp-core-loader.php
@@ -1,40 +1,29 @@
 <?php
+
+/**
+ * BuddyPress Core Loader
+ *
+ * Core contains the commonly used functions, classes, and API's
+ *
+ * @package BuddyPress
+ * @subpackage Core
+ */
+
 // Exit if accessed directly
 if ( !defined( 'ABSPATH' ) ) exit;
 
-// Require all of the BuddyPress core libraries
-require( BP_PLUGIN_DIR . '/bp-core/bp-core-cache.php'     );
-require( BP_PLUGIN_DIR . '/bp-core/bp-core-hooks.php'     );
-require( BP_PLUGIN_DIR . '/bp-core/bp-core-cssjs.php'     );
-require( BP_PLUGIN_DIR . '/bp-core/bp-core-classes.php'   );
-require( BP_PLUGIN_DIR . '/bp-core/bp-core-filters.php'   );
-require( BP_PLUGIN_DIR . '/bp-core/bp-core-avatars.php'   );
-require( BP_PLUGIN_DIR . '/bp-core/bp-core-widgets.php'   );
-require( BP_PLUGIN_DIR . '/bp-core/bp-core-template.php'  );
-require( BP_PLUGIN_DIR . '/bp-core/bp-core-buddybar.php'  );
-require( BP_PLUGIN_DIR . '/bp-core/bp-core-catchuri.php'  );
-require( BP_PLUGIN_DIR . '/bp-core/bp-core-component.php' );
-require( BP_PLUGIN_DIR . '/bp-core/bp-core-functions.php' );
-
-// Load deprecated functions
-require( BP_PLUGIN_DIR . '/bp-core/deprecated/1.5.php'    );
-
-// Load the WP admin bar.
-if ( !defined( 'BP_DISABLE_ADMIN_BAR' ) )
-	require( BP_PLUGIN_DIR . '/bp-core/bp-core-adminbar.php'  );
-
-// Move active components from sitemeta, if necessary
-// Provides backpat with earlier versions of BP
-if ( is_multisite() && $active_components = get_site_option( 'bp-active-components' ) )
-	bp_update_option( 'bp-active-components', $active_components );
-
-/** "And now for something completely different" ******************************/
-
 class BP_Core extends BP_Component {
 
+	/**
+	 * Start the members component creation process
+	 *
+	 * @since BuddyPress (1.5)
+	 *
+	 * @uses BP_Core::bootstrap()
+	 */
 	function __construct() {
 		parent::start(
-			'_core',
+			'core',
 			__( 'BuddyPress Core', 'buddypress' )
 			, BP_PLUGIN_DIR
 		);
@@ -42,6 +31,16 @@ class BP_Core extends BP_Component {
 		$this->bootstrap();
 	}
 
+	/**
+	 * Populate the global data needed before BuddyPress can continue
+	 *
+	 * This involves figuring out the currently required, active, deactive,
+	 * and optional components.
+	 *
+	 * @since BuddyPress (1.5)
+	 *
+	 * @global BuddyPress $bp
+	 */
 	private function bootstrap() {
 		global $bp;
 
@@ -69,6 +68,7 @@ class BP_Core extends BP_Component {
 
 		// Pre 1.5 Backwards compatibility
 		} elseif ( $deactivated_components = bp_get_option( 'bp-deactivated-components' ) ) {
+
 			// Trim off namespace and filename
 			foreach ( (array) $deactivated_components as $component => $value )
 				$trimmed[] = str_replace( '.php', '', str_replace( 'bp-', '', $component ) );
@@ -77,24 +77,19 @@ class BP_Core extends BP_Component {
 			$bp->deactivated_components = apply_filters( 'bp_deactivated_components', $trimmed );
 
 			// Setup the active components
-			$active_components     = array_flip( array_diff( array_values( array_merge( $bp->optional_components, $bp->required_components ) ), array_values( $bp->deactivated_components ) ) );
-
-			// Loop through active components and set the values
-			$bp->active_components = array_map( '__return_true', $active_components );
+			$active_components     = array_fill_keys( array_diff( array_values( array_merge( $optional_components, $required_components ) ), array_values( $deactivated_components ) ), '1' );
 
 			// Set the active component global
 			$bp->active_components = apply_filters( 'bp_active_components', $bp->active_components );
 
 		// Default to all components active
 		} else {
+
 			// Set globals
 			$bp->deactivated_components = array();
 
 			// Setup the active components
-			$active_components     = array_flip( array_values( array_merge( $bp->optional_components, $bp->required_components ) ) );
-
-			// Loop through active components and set the values
-			$bp->active_components = array_map( '__return_true', $active_components );
+			$active_components     = array_fill_keys( array_values( array_merge( $bp->optional_components, $bp->required_components ) ), '1' );
 
 			// Set the active component global
 			$bp->active_components = apply_filters( 'bp_active_components', $bp->active_components );
@@ -114,6 +109,26 @@ class BP_Core extends BP_Component {
 		$bp->required_components[] = 'core';
 	}
 
+	function includes() {
+
+		if ( !is_admin() )
+			return;
+
+		$includes = array(
+			'admin'
+		);
+
+		parent::includes( $includes );
+	}
+
+	/**
+	 * Sets up a majority of the BuddyPress globals that require a minimal
+	 * amount of processing, meaning they cannot be set in the BuddyPress class.
+	 *
+	 * @since BuddyPress (1.5)
+	 *
+	 * @global BuddyPress $bp
+	 */
 	function setup_globals() {
 		global $bp;
 
@@ -135,40 +150,19 @@ class BP_Core extends BP_Component {
 		if ( empty( $bp->pages ) )
 			$bp->pages = bp_core_get_directory_pages();
 
-		/** Admin Bar *********************************************************/
-
-		// Set the 'My Account' global to prevent debug notices
-		$bp->my_account_menu_id = false;
-
-		/** Component and Action **********************************************/
-
-		// Used for overriding the 2nd level navigation menu so it can be used to
-		// display custom navigation for an item (for example a group)
-		$bp->is_single_item = false;
-
-		// Sets up the array container for the component navigation rendered
-		// by bp_get_nav()
-		$bp->bp_nav            = array();
-
-		// Sets up the array container for the component options navigation
-		// rendered by bp_get_options_nav()
-		$bp->bp_options_nav    = array();
-
-		// Contains an array of all the active components. The key is the slug,
-		// value the internal ID of the component.
-		//$bp->active_components = array();
-
 		/** Basic current user data *******************************************/
 
 		// Logged in user is the 'current_user'
 		$current_user            = wp_get_current_user();
 
 		// The user ID of the user who is currently logged in.
-		$bp->loggedin_user->id   = $current_user->ID;
+		$bp->loggedin_user       = new stdClass;
+		$bp->loggedin_user->id   = isset( $current_user->ID ) ? $current_user->ID : 0;
 
 		/** Avatars ***********************************************************/
 
 		// Fetches the default Gravatar image to use if the user/group/blog has no avatar or gravatar
+		$bp->grav_default        = new stdClass;
 		$bp->grav_default->user  = apply_filters( 'bp_user_gravatar_default',  $bp->site_options['avatar_default'] );
 		$bp->grav_default->group = apply_filters( 'bp_group_gravatar_default', $bp->grav_default->user );
 		$bp->grav_default->blog  = apply_filters( 'bp_blog_gravatar_default',  $bp->grav_default->user );
@@ -192,15 +186,22 @@ class BP_Core extends BP_Component {
 		do_action( 'bp_core_setup_globals' );
 	}
 
+	/**
+	 * Setup BuddyBar navigation
+	 *
+	 * @since BuddyPress (1.5)
+	 *
+	 * @global BuddyPress $bp
+	 */
 	function setup_nav() {
 		global $bp;
 
-		/***
-		 * If the extended profiles component is disabled, we need to revert to using the
-		 * built in WordPress profile information
-		 */
+		 // If xprofile component is disabled, revert to WordPress profile
 		if ( !bp_is_active( 'xprofile' ) ) {
 
+			// Define local variable
+			$sub_nav = array();
+
 			// Fallback values if xprofile is disabled
 			$bp->core->profile->slug = 'profile';
 			$bp->active_components[$bp->core->profile->slug] = $bp->core->profile->slug;
@@ -214,7 +215,7 @@ class BP_Core extends BP_Component {
 				'default_subnav_slug' => 'public'
 			);
 
-			$profile_link = trailingslashit( $bp->loggedin_user->domain . '/' . $bp->core->profile->slug );
+			$profile_link = trailingslashit( bp_loggedin_user_domain() . '/' . $bp->core->profile->slug );
 
 			// Add the subnav items to the profile
 			$sub_nav[] = array(
@@ -224,11 +225,23 @@ class BP_Core extends BP_Component {
 				'parent_slug'     => $bp->core->profile->slug,
 				'screen_function' => 'bp_core_catch_profile_uri'
 			);
+
+			parent::setup_nav( $main_nav, $sub_nav );
 		}
 	}
 }
 
-// Initialize the BuddyPress Core
-$bp->core = new BP_Core();
+/**
+ * Setup the BuddyPress Core component
+ *
+ * @since BuddyPress (1.6)
+ *
+ * @global BuddyPress $bp
+ */
+function bp_setup_core() {
+	global $bp;
+	$bp->core = new BP_Core();
+}
+add_action( 'bp_setup_components', 'bp_setup_core', 2 );
 
 ?>
\ No newline at end of file
diff --git a/wp-content/plugins/buddypress/bp-core/bp-core-moderation.php b/wp-content/plugins/buddypress/bp-core/bp-core-moderation.php
new file mode 100644
index 0000000000000000000000000000000000000000..b2777047e779a27d2aa91bb4912f2b81a58f7a59
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-core/bp-core-moderation.php
@@ -0,0 +1,268 @@
+<?php
+/**
+ * BuddyPress Moderation Functions
+ *
+ * @package BuddyPress
+ * @subpackage Core
+ * @since 1.6
+ */
+
+// Exit if accessed directly
+if ( !defined( 'ABSPATH' ) ) exit;
+
+/** Moderation ****************************************************************/
+
+/**
+ * Check for flooding
+ *
+ * Check to make sure that a user is not making too many posts in a short amount
+ * of time.
+ *
+ * @param int $user_id User id to check for flood
+ * @return bool True if there is no flooding, true if there is
+ * @since 1.6
+ * @uses current_user_can() To check if the current user can throttle
+ * @uses bp_get_option() To get the throttle time
+ * @uses get_transient() To get the last posted transient of the ip
+ * @uses get_user_meta() To get the last posted meta of the user
+ */
+function bp_core_check_for_flood( $user_id = 0 ) {
+
+	// Option disabled. No flood checks.
+	if ( !$throttle_time = bp_get_option( '_bp_throttle_time' ) )
+		return true;
+
+	// Bail if no user ID passed
+	if ( empty( $user_id ) )
+		return false;
+
+	$last_posted = get_user_meta( $user_id, '_bp_last_posted', true );
+	if ( isset( $last_posted ) && ( time() < ( $last_posted + $throttle_time ) ) && !current_user_can( 'throttle' ) )
+		return false;
+
+	return true;
+}
+
+/**
+ * Check for moderation keys and too many links
+ *
+ * @param int $user_id Topic or reply author ID
+ * @param string $title The title of the content
+ * @param string $content The content being posted
+ * @return bool True if test is passed, false if fail
+ * @since 1.6
+ * @uses bp_current_author_ip() To get current user IP address
+ * @uses bp_current_author_ua() To get current user agent
+ * @uses bp_current_user_can() Allow super admins to bypass blacklist
+ */
+function bp_core_check_for_moderation( $user_id = 0, $title = '', $content = '' ) {
+
+	// Bail if super admin is author
+	if ( is_super_admin( $user_id ) )
+		return true;
+
+	// Define local variable(s)
+	$post      = array();
+	$match_out = '';
+
+	/** Blacklist *************************************************************/
+
+	// Get the moderation keys
+	$blacklist = trim( get_option( 'moderation_keys' ) );
+
+	// Bail if blacklist is empty
+	if ( empty( $blacklist ) )
+		return true;
+
+	/** User Data *************************************************************/
+
+	if ( !empty( $user_id ) ) {
+
+		// Get author data
+		$user = get_userdata( $user_id );
+
+		// If data exists, map it
+		if ( !empty( $user ) ) {
+			$post['author'] = $user->display_name;
+			$post['email']  = $user->user_email;
+			$post['url']    = $user->user_url;
+		}
+	}
+
+	// Current user IP and user agent
+	$post['user_ip'] = bp_core_current_user_ip();
+	$post['user_ua'] = bp_core_current_user_ua();
+
+	// Post title and content
+	$post['title']   = $title;
+	$post['content'] = $content;
+
+	/** Max Links *************************************************************/
+
+	$max_links = get_option( 'comment_max_links' );
+	if ( !empty( $max_links ) ) {
+
+		// How many links?
+		$num_links = preg_match_all( '/<a [^>]*href/i', $content, $match_out );
+
+		// Allow for bumping the max to include the user's URL
+		$num_links = apply_filters( 'comment_max_links_url', $num_links, $post['url'] );
+
+		// Das ist zu viele links!
+		if ( $num_links >= $max_links ) {
+			return false;
+		}
+	}
+
+	/** Words *****************************************************************/
+
+	// Get words separated by new lines
+	$words = explode( "\n", $blacklist );
+
+	// Loop through words
+	foreach ( (array) $words as $word ) {
+
+		// Trim the whitespace from the word
+		$word = trim( $word );
+
+		// Skip empty lines
+		if ( empty( $word ) ) { continue; }
+
+		// Do some escaping magic so that '#' chars in the
+		// spam words don't break things:
+		$word    = preg_quote( $word, '#' );
+		$pattern = "#$word#i";
+
+		// Loop through post data
+		foreach( $post as $post_data ) {
+
+			// Check each user data for current word
+			if ( preg_match( $pattern, $post_data ) ) {
+
+				// Post does not pass
+				return false;
+			}
+		}
+	}
+
+	// Check passed successfully
+	return true;
+}
+
+/**
+ * Checks for blocked keys
+ *
+ * @param int $user_id Topic or reply author ID
+ * @param string $title The title of the content
+ * @param string $content The content being posted
+ * @return bool True if test is passed, false if fail
+ * @uses bp_current_author_ip() To get current user IP address
+ * @uses bp_current_author_ua() To get current user agent
+ * @uses bp_current_user_can() Allow super admins to bypass blacklist
+ * @since 1.6
+ */
+function bp_core_check_for_blacklist( $user_id = 0, $title = '', $content = '' ) {
+
+	// Bail if super admin is author
+	if ( is_super_admin( $user_id ) )
+		return true;
+
+	// Define local variable
+	$post = array();
+
+	/** Blacklist *************************************************************/
+
+	// Get the moderation keys
+	$blacklist = trim( get_option( 'blacklist_keys' ) );
+
+	// Bail if blacklist is empty
+	if ( empty( $blacklist ) )
+		return true;
+
+	/** User Data *************************************************************/
+
+	// Map current user data
+	if ( !empty( $user_id ) ) {
+
+		// Get author data
+		$user = get_userdata( $user_id );
+
+		// If data exists, map it
+		if ( !empty( $user ) ) {
+			$post['author'] = $user->display_name;
+			$post['email']  = $user->user_email;
+			$post['url']    = $user->user_url;
+		}
+	}
+
+	// Current user IP and user agent
+	$post['user_ip'] = bp_core_current_user_ip();
+	$post['user_ua'] = bp_core_current_user_ua();
+
+	// Post title and content
+	$post['title']   = $title;
+	$post['content'] = $content;
+
+	/** Words *****************************************************************/
+
+	// Get words separated by new lines
+	$words = explode( "\n", $blacklist );
+
+	// Loop through words
+	foreach ( (array) $words as $word ) {
+
+		// Trim the whitespace from the word
+		$word = trim( $word );
+
+		// Skip empty lines
+		if ( empty( $word ) ) { continue; }
+
+		// Do some escaping magic so that '#' chars in the spam words don't break things:
+		$word    = preg_quote( $word, '#' );
+		$pattern = "#$word#i";
+
+		// Loop through post data
+		foreach( $post as $post_data ) {
+
+			// Check each user data for current word
+			if ( preg_match( $pattern, $post_data ) ) {
+
+				// Post does not pass
+				return false;
+			}
+		}
+	}
+
+	// Check passed successfully
+	return true;
+}
+
+/**
+ * Get the current-user IP address
+ *
+ * @return string
+ * @since 1.6
+ */
+function bp_core_current_user_ip() {
+	$retval = preg_replace( '/[^0-9a-fA-F:., ]/', '', $_SERVER['REMOTE_ADDR'] );
+
+	return apply_filters( 'bp_core_current_user_ip', $retval );
+}
+
+/**
+ * Get the current-user user-agent
+ *
+ * @return string
+ * @since 1.6
+ */
+function bp_core_current_user_ua() {
+
+	// Sanity check the user agent
+	if ( !empty( $_SERVER['HTTP_USER_AGENT'] ) )
+		$retval = substr( $_SERVER['HTTP_USER_AGENT'], 0, 254 );
+	else
+		$retval = '';
+
+	return apply_filters( 'bp_core_current_user_ua', $retval );
+}
+?>
\ No newline at end of file
diff --git a/wp-content/plugins/buddypress/bp-core/bp-core-options.php b/wp-content/plugins/buddypress/bp-core/bp-core-options.php
new file mode 100644
index 0000000000000000000000000000000000000000..73cadc9979fbda80f2192d228dccc473fa8b0ffa
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-core/bp-core-options.php
@@ -0,0 +1,524 @@
+<?php
+
+/**
+ * BuddyPress Options
+ *
+ * @package BuddyPress
+ * @subpackage Options
+ */
+
+// Exit if accessed directly
+if ( !defined( 'ABSPATH' ) ) exit;
+
+/**
+ * Get the default site options and their values
+ *
+ * @since BuddyPress (1.6)
+ *
+ * @return array Filtered option names and values
+ */
+function bp_get_default_options() {
+
+	// Default options
+	$options = array (
+
+		/** Components ********************************************************/
+
+		'bp-deactivated-components'       => array(),
+
+		/** bbPress ***********************************************************/
+
+		// Legacy bbPress config location
+		'bb-config-location'              => ABSPATH . 'bb-config.php',
+
+		/** XProfile **********************************************************/
+
+		// Base profile groups name
+		'bp-xprofile-base-group-name'     => 'Base',
+
+		// Base fullname field name
+		'bp-xprofile-fullname-field-name' => 'Name',
+
+		/** Blogs *************************************************************/
+
+		// Used to decide if blogs need indexing
+		'bp-blogs-first-install'          => false,
+
+		/** Settings **********************************************************/
+
+		// Disable the WP to BP profile sync
+		'bp-disable-profile-sync'         => false,
+
+		// Hide the Toolbar for logged out users
+		'hide-loggedout-adminbar'         => false,
+
+		// Avatar uploads
+		'bp-disable-avatar-uploads'       => false,
+
+		// Allow users to delete their own accounts
+		'bp-disable-account-deletion'     => false,
+
+		// Allow comments on blog and forum activity items
+		'bp-disable-blogforum-comments'   => true,
+
+		/** Groups ************************************************************/
+
+		// @todo Move this into the groups component
+
+		// Restrict group creation to super admins
+		'bp_restrict_group_creation'      => false,
+
+		/** Akismet ***********************************************************/
+
+		// Users from all sites can post
+		'_bp_enable_akismet'              => true,
+
+		/** BuddyBar **********************************************************/
+
+		// Force the BuddyBar
+		'_bp_force_buddybar'              => false
+	);
+
+	return apply_filters( 'bp_get_default_options', $options );
+}
+
+/**
+ * Add default options
+ *
+ * Hooked to bp_activate, it is only called once when BuddyPress is activated.
+ * This is non-destructive, so existing settings will not be overridden.
+ *
+ * @since BuddyPress (1.6)
+ *
+ * @uses bp_get_default_options() To get default options
+ * @uses add_option() Adds default options
+ * @uses do_action() Calls 'bp_add_options'
+ */
+function bp_add_options() {
+
+	// Get the default options and values
+	$options = bp_get_default_options();
+
+	// Add default options
+	foreach ( $options as $key => $value )
+		add_option( $key, $value );
+
+	// Allow previously activated plugins to append their own options.
+	do_action( 'bp_add_options' );
+}
+
+/**
+ * Delete default options
+ *
+ * Hooked to bp_uninstall, it is only called once when BuddyPress is uninstalled.
+ * This is destructive, so existing settings will be destroyed.
+ *
+ * @since BuddyPress (1.6)
+ *
+ * @uses bp_get_default_options() To get default options
+ * @uses delete_option() Removes default options
+ * @uses do_action() Calls 'bp_delete_options'
+ */
+function bp_delete_options() {
+
+	// Get the default options and values
+	$options = bp_get_default_options();
+
+	// Add default options
+	foreach ( $options as $key => $value )
+		delete_option( $key );
+
+	// Allow previously activated plugins to append their own options.
+	do_action( 'bp_delete_options' );
+}
+
+/**
+ * Add filters to each BuddyPress option and allow them to be overloaded from
+ * inside the $bp->options array.
+ *
+ * @since BuddyPress (1.6)
+ *
+ * @uses bp_get_default_options() To get default options
+ * @uses add_filter() To add filters to 'pre_option_{$key}'
+ * @uses do_action() Calls 'bp_add_option_filters'
+ */
+function bp_setup_option_filters() {
+
+	// Get the default options and values
+	$options = bp_get_default_options();
+
+	// Add filters to each BuddyPress option
+	foreach ( $options as $key => $value )
+		add_filter( 'pre_option_' . $key, 'bp_pre_get_option' );
+
+	// Allow previously activated plugins to append their own options.
+	do_action( 'bp_setup_option_filters' );
+}
+
+/**
+ * Filter default options and allow them to be overloaded from inside the
+ * $bp->options array.
+ *
+ * @since BuddyPress (1.6)
+ *
+ * @global BuddyPress $bp
+ * @param bool $value Optional. Default value false
+ * @return mixed false if not overloaded, mixed if set
+ */
+function bp_pre_get_option( $value = false ) {
+	global $bp;
+
+	// Get the name of the current filter so we can manipulate it
+	$filter = current_filter();
+
+	// Remove the filter prefix
+	$option = str_replace( 'pre_option_', '', $filter );
+
+	// Check the options global for preset value
+	if ( !empty( $bp->options[$option] ) )
+		$value = $bp->options[$option];
+
+	// Always return a value, even if false
+	return $value;
+}
+
+/**
+ * Retrieve an option
+ *
+ * This is a wrapper for get_blog_option(), which in turn stores settings data (such as bp-pages)
+ * on the appropriate blog, given your current setup.
+ *
+ * The 'bp_get_option' filter is primarily for backward-compatibility.
+ *
+ * @package BuddyPress
+ * @since BuddyPress (1.5)
+ *
+ * @uses bp_get_root_blog_id()
+ * @param str $option_name The option to be retrieved
+ * @param str $default Optional. Default value to be returned if the option isn't set
+ * @return mixed The value for the option
+ */
+function bp_get_option( $option_name, $default = '' ) {
+	$value = get_blog_option( bp_get_root_blog_id(), $option_name, $default );
+
+	return apply_filters( 'bp_get_option', $value );
+}
+
+/**
+ * Save an option
+ *
+ * This is a wrapper for update_blog_option(), which in turn stores settings data (such as bp-pages)
+ * on the appropriate blog, given your current setup.
+ *
+ * @package BuddyPress
+ * @since BuddyPress (1.5)
+ *
+ * @uses bp_get_root_blog_id()
+ * @param str $option_name The option key to be set
+ * @param str $value The value to be set
+ */
+function bp_update_option( $option_name, $value ) {
+	update_blog_option( bp_get_root_blog_id(), $option_name, $value );
+}
+
+/**
+ * Delete an option
+ *
+ * This is a wrapper for delete_blog_option(), which in turn deletes settings data (such as
+ * bp-pages) on the appropriate blog, given your current setup.
+ *
+ * @package BuddyPress
+ * @since BuddyPress (1.5)
+ *
+ * @uses bp_get_root_blog_id()
+ * @param str $option_name The option key to be set
+ */
+function bp_delete_option( $option_name ) {
+	delete_blog_option( bp_get_root_blog_id(), $option_name );
+}
+
+/**
+ * When switching from single to multisite we need to copy blog options to
+ * site options.
+ *
+ * This function is no longer used
+ *
+ * @package BuddyPress Core
+ * @deprecated Since BuddyPress (1.6)
+ */
+function bp_core_activate_site_options( $keys = array() ) {
+	global $bp;
+
+	if ( !empty( $keys ) && is_array( $keys ) ) {
+		$errors = false;
+
+		foreach ( $keys as $key => $default ) {
+			if ( empty( $bp->site_options[ $key ] ) ) {
+				$bp->site_options[ $key ] = bp_get_option( $key, $default );
+
+				if ( !bp_update_option( $key, $bp->site_options[ $key ] ) ) {
+					$errors = true;
+				}
+			}
+		}
+
+		if ( empty( $errors ) ) {
+			return true;
+		}
+	}
+
+	return false;
+}
+
+/**
+ * BuddyPress uses common options to store configuration settings. Many of these
+ * settings are needed at run time. Instead of fetching them all and adding many
+ * initial queries to each page load, let's fetch them all in one go.
+ *
+ * @package BuddyPress Core
+ * @todo Use settings API and audit these methods
+ */
+function bp_core_get_root_options() {
+	global $wpdb;
+
+	// Get all the BuddyPress settings, and a few useful WP ones too
+	$root_blog_options                   = bp_get_default_options();
+	$root_blog_options['registration']   = '0';
+	$root_blog_options['avatar_default'] = 'mysteryman';
+	$root_blog_option_keys               = array_keys( $root_blog_options );
+
+	// Do some magic to get all the root blog options in 1 swoop
+	$blog_options_keys      = "'" . join( "', '", (array) $root_blog_option_keys ) . "'";
+	$blog_options_table	    = bp_is_multiblog_mode() ? $wpdb->options : $wpdb->get_blog_prefix( bp_get_root_blog_id() ) . 'options';
+	$blog_options_query     = "SELECT option_name AS name, option_value AS value FROM {$blog_options_table} WHERE option_name IN ( {$blog_options_keys} )";
+	$root_blog_options_meta = $wpdb->get_results( $blog_options_query );
+
+	// On Multisite installations, some options must always be fetched from sitemeta
+	if ( is_multisite() ) {
+		$network_options = apply_filters( 'bp_core_network_options', array(
+			'tags_blog_id'       => '0',
+			'sitewide_tags_blog' => '',
+			'registration'       => '0',
+			'fileupload_maxk'    => '1500'
+		) );
+
+		$current_site           = get_current_site();
+		$network_option_keys    = array_keys( $network_options );
+		$sitemeta_options_keys  = "'" . join( "', '", (array) $network_option_keys ) . "'";
+		$sitemeta_options_query = $wpdb->prepare( "SELECT meta_key AS name, meta_value AS value FROM {$wpdb->sitemeta} WHERE meta_key IN ( {$sitemeta_options_keys} ) AND site_id = %d", $current_site->id );
+		$network_options_meta   = $wpdb->get_results( $sitemeta_options_query );
+
+		// Sitemeta comes second in the merge, so that network 'registration' value wins
+		$root_blog_options_meta = array_merge( $root_blog_options_meta, $network_options_meta );
+	}
+
+	// Missing some options, so do some one-time fixing
+	if ( empty( $root_blog_options_meta ) || ( count( $root_blog_options_meta ) < count( $root_blog_option_keys ) ) ) {
+
+		// Get a list of the keys that are already populated
+		$existing_options = array();
+		foreach( $root_blog_options_meta as $already_option ) {
+			$existing_options[$already_option->name] = $already_option->value;
+		}
+
+		// Unset the query - We'll be resetting it soon
+		unset( $root_blog_options_meta );
+
+		// Loop through options
+		foreach ( $root_blog_options as $old_meta_key => $old_meta_default ) {
+			// Clear out the value from the last time around
+			unset( $old_meta_value );
+
+			if ( isset( $existing_options[$old_meta_key] ) ) {
+				continue;
+			}
+
+			// Get old site option
+			if ( is_multisite() )
+				$old_meta_value = get_site_option( $old_meta_key );
+
+			// No site option so look in root blog
+			if ( empty( $old_meta_value ) )
+				$old_meta_value = bp_get_option( $old_meta_key, $old_meta_default );
+
+			// Update the root blog option
+			bp_update_option( $old_meta_key, $old_meta_value );
+
+			// Update the global array
+			$root_blog_options_meta[$old_meta_key] = $old_meta_value;
+		}
+
+		$root_blog_options_meta = array_merge( $root_blog_options_meta, $existing_options );
+		unset( $existing_options );
+
+	// We're all matched up
+	} else {
+		// Loop through our results and make them usable
+		foreach ( $root_blog_options_meta as $root_blog_option )
+			$root_blog_options[$root_blog_option->name] = $root_blog_option->value;
+
+		// Copy the options no the return val
+		$root_blog_options_meta = $root_blog_options;
+
+		// Clean up our temporary copy
+		unset( $root_blog_options );
+	}
+
+	return apply_filters( 'bp_core_get_root_options', $root_blog_options_meta );
+}
+
+/** Active? *******************************************************************/
+
+/**
+ * Is profile sycing disabled?
+ *
+ * @since BuddyPress (1.6)
+ *
+ * @param $default bool Optional.Default value true
+ *
+ * @uses bp_get_option() To get the profile sync option
+ * @return bool Is profile sync enabled or not
+ */
+function bp_disable_profile_sync( $default = true ) {
+	return (bool) apply_filters( 'bp_disable_profile_sync', (bool) bp_get_option( 'bp-disable-profile-sync', $default ) );
+}
+
+/**
+ * Is the Toolbar hidden for logged out users?
+ *
+ * @since BuddyPress (1.6)
+ *
+ * @param $default bool Optional.Default value true
+ *
+ * @uses bp_get_option() To get the logged out Toolbar option
+ * @return bool Is logged out Toolbar enabled or not
+ */
+function bp_hide_loggedout_adminbar( $default = true ) {
+	return (bool) apply_filters( 'bp_hide_loggedout_adminbar', (bool) bp_get_option( 'hide-loggedout-adminbar', $default ) );
+}
+
+/**
+ * Are members able to upload their own avatars?
+ *
+ * @since BuddyPress (1.6)
+ *
+ * @param $default bool Optional. Default value true
+ *
+ * @uses bp_get_option() To get the avatar uploads option
+ * @return bool Are avatar uploads allowed?
+ */
+function bp_disable_avatar_uploads( $default = true ) {
+	return (bool) apply_filters( 'bp_disable_avatar_uploads', (bool) bp_get_option( 'bp-disable-avatar-uploads', $default ) );
+}
+
+/**
+ * Are members able to delete their own accounts?
+ *
+ * @since BuddyPress (1.6)
+ *
+ * @param $default bool Optional. Default value
+ *
+ * @uses bp_get_option() To get the account deletion option
+ * @return bool Is account deletion allowed?
+ */
+function bp_disable_account_deletion( $default = false ) {
+	return apply_filters( 'bp_disable_account_deletion', (bool) bp_get_option( 'bp-disable-account-deletion', $default ) );
+}
+
+/**
+ * Are blog and forum activity stream comments disabled?
+ *
+ * @since BuddyPress (1.6)
+ *
+ * @param $default bool Optional. Default value false
+ * @todo split and move into blog and forum components
+ * @uses bp_get_option() To get the blog/forum comments option
+ * @return bool Is blog/forum comments allowed?
+ */
+function bp_disable_blogforum_comments( $default = false ) {
+	return (bool) apply_filters( 'bp_disable_blogforum_comments', (bool) bp_get_option( 'bp-disable-blogforum-comments', $default ) );
+}
+
+/**
+ * Is group creation turned off?
+ *
+ * @since BuddyPress (1.6)
+ *
+ * @param $default bool Optional. Default value true
+ *
+ * @todo Move into groups component
+ * @uses bp_get_option() To get the group creation
+ * @return bool Allow group creation?
+ */
+function bp_restrict_group_creation( $default = true ) {
+	return (bool) apply_filters( 'bp_restrict_group_creation', (bool) bp_get_option( 'bp_restrict_group_creation', $default ) );
+}
+
+/**
+ * Have we migrated to using the WordPress Toolbar?
+ *
+ * @since BuddyPress (1.6)
+ *
+ * @param $default bool Optional. Default value true
+ *
+ * @todo Move into groups component
+ * @uses bp_get_option() To get the WP editor option
+ * @return bool Use WP editor?
+ */
+function bp_force_buddybar( $default = true ) {
+	return (bool) apply_filters( 'bp_force_buddybar', (bool) bp_get_option( '_bp_force_buddybar', $default ) );
+}
+
+/**
+ * Output the group forums root parent forum id
+ *
+ * @since BuddyPress (1.6)
+ *
+ * @param $default bool Optional. Default value
+ */
+function bp_group_forums_root_id( $default = '0' ) {
+	echo bp_get_group_forums_root_id( $default );
+}
+	/**
+	 * Return the group forums root parent forum id
+	 *
+	 * @since BuddyPress (1.6)
+	 *
+	 * @param $default bool Optional. Default value 0
+	 *
+	 * @uses bp_get_option() To get the maximum title length
+	 * @return int Is anonymous posting allowed?
+	 */
+	function bp_get_group_forums_root_id( $default = '0' ) {
+		return (int) apply_filters( 'bp_get_group_forums_root_id', (int) bp_get_option( '_bbp_group_forums_root_id', $default ) );
+	}
+
+/**
+ * Checks if BuddyPress Group Forums are enabled
+ *
+ * @since BuddyPress (1.6)
+ *
+ * @param $default bool Optional. Default value true
+ *
+ * @uses bp_get_option() To get the group forums option
+ * @return bool Is group forums enabled or not
+ */
+function bp_is_group_forums_active( $default = true ) {
+	return (bool) apply_filters( 'bp_is_group_forums_active', (bool) bp_get_option( '_bbp_enable_group_forums', $default ) );
+}
+
+/**
+ * Checks if Akismet is enabled
+ *
+ * @since BuddyPress (1.6)
+ *
+ * @param $default bool Optional. Default value true
+ *
+ * @uses bp_get_option() To get the Akismet option
+ * @return bool Is Akismet enabled or not
+ */
+function bp_is_akismet_active( $default = true ) {
+	return (bool) apply_filters( 'bp_is_akismet_active', (bool) bp_get_option( '_bp_enable_akismet', $default ) );
+}
+
+?>
diff --git a/wp-content/plugins/buddypress/bp-core/bp-core-template.php b/wp-content/plugins/buddypress/bp-core/bp-core-template.php
index 8cb969490abd7f3eded7c28ba90d8319f8541056..28263753108d533f901748ef57c2081b9ba1015a 100644
--- a/wp-content/plugins/buddypress/bp-core/bp-core-template.php
+++ b/wp-content/plugins/buddypress/bp-core/bp-core-template.php
@@ -1,4 +1,5 @@
 <?php
+
 // Exit if accessed directly
 if ( !defined( 'ABSPATH' ) ) exit;
 
@@ -13,7 +14,7 @@ if ( !defined( 'ABSPATH' ) ) exit;
  * or not to highlight a particular sub nav item.
  *
  * @package BuddyPress Core
- * @global object $bp Global BuddyPress settings object
+ * @global BuddyPress $bp The one true BuddyPress instance
  * @uses bp_get_user_nav() Renders the navigation for a profile of a currently viewed user.
  */
 function bp_get_options_nav() {
@@ -21,7 +22,7 @@ function bp_get_options_nav() {
 
 	// If we are looking at a member profile, then the we can use the current component as an
 	// index. Otherwise we need to use the component's root_slug
-	$component_index = !empty( $bp->displayed_user ) ? $bp->current_component : bp_get_root_slug( $bp->current_component );
+	$component_index = !empty( $bp->displayed_user ) ? bp_current_component() : bp_get_root_slug( bp_current_component() );
 
 	if ( !bp_is_single_item() ) {
 		if ( !isset( $bp->bp_options_nav[$component_index] ) || count( $bp->bp_options_nav[$component_index] ) < 1 ) {
@@ -30,20 +31,20 @@ function bp_get_options_nav() {
 			$the_index = $component_index;
 		}
 	} else {
-		if ( !isset( $bp->bp_options_nav[$bp->current_item] ) || count( $bp->bp_options_nav[$bp->current_item] ) < 1 ) {
+		if ( !isset( $bp->bp_options_nav[bp_current_item()] ) || count( $bp->bp_options_nav[bp_current_item()] ) < 1 ) {
 			return false;
 		} else {
-			$the_index = $bp->current_item;
+			$the_index = bp_current_item();
 		}
 	}
 
 	// Loop through each navigation item
-	foreach ( (array)$bp->bp_options_nav[$the_index] as $subnav_item ) {
+	foreach ( (array) $bp->bp_options_nav[$the_index] as $subnav_item ) {
 		if ( !$subnav_item['user_has_access'] )
 			continue;
 
 		// If the current action or an action variable matches the nav item id, then add a highlight CSS class.
-		if ( $subnav_item['slug'] == $bp->current_action ) {
+		if ( $subnav_item['slug'] == bp_current_action() ) {
 			$selected = ' class="current selected"';
 		} else {
 			$selected = '';
@@ -73,7 +74,7 @@ function bp_get_options_title() {
  * like a group, or a friend. Basically an avatar that appears in the sub nav options bar.
  *
  * @package BuddyPress Core
- * @global object $bp Global BuddyPress settings object
+ * @global BuddyPress $bp The one true BuddyPress instance
  */
 function bp_has_options_avatar() {
 	global $bp;
@@ -94,7 +95,7 @@ function bp_comment_author_avatar() {
 	global $comment;
 
 	if ( function_exists( 'bp_core_fetch_avatar' ) )
-		echo apply_filters( 'bp_comment_author_avatar', bp_core_fetch_avatar( array( 'item_id' => $comment->user_id, 'type' => 'thumb' ) ) );
+		echo apply_filters( 'bp_comment_author_avatar', bp_core_fetch_avatar( array( 'item_id' => $comment->user_id, 'type' => 'thumb', 'alt' => sprintf( __( 'Avatar of %s', 'buddypress' ), bp_core_get_user_displayname( $comment->user_id ) ) ) ) );
 	else if ( function_exists('get_avatar') )
 		get_avatar();
 }
@@ -103,7 +104,7 @@ function bp_post_author_avatar() {
 	global $post;
 
 	if ( function_exists( 'bp_core_fetch_avatar' ) )
-		echo apply_filters( 'bp_post_author_avatar', bp_core_fetch_avatar( array( 'item_id' => $post->post_author, 'type' => 'thumb' ) ) );
+		echo apply_filters( 'bp_post_author_avatar', bp_core_fetch_avatar( array( 'item_id' => $post->post_author, 'type' => 'thumb', 'alt' => sprintf( __( 'Avatar of %s', 'buddypress' ), bp_core_get_user_displayname( $post->post_author ) ) ) ) );
 	else if ( function_exists('get_avatar') )
 		get_avatar();
 }
@@ -151,9 +152,20 @@ function bp_avatar_cropper() {
 	echo '<img id="avatar-to-crop" class="avatar" src="' . $bp->avatar_admin->image . '" />';
 }
 
+/**
+ * Echoes bp_get_site_name()
+ */
 function bp_site_name() {
-	echo apply_filters( 'bp_site_name', get_bloginfo( 'name', 'display' ) );
+	echo bp_get_site_name();
 }
+	/**
+	 * Returns the name of the BP site. Used in RSS headers
+	 *
+	 * @since 1.6
+	 */
+	function bp_get_site_name() {
+		return apply_filters( 'bp_site_name', get_bloginfo( 'name', 'display' ) );
+	}
 
 function bp_get_profile_header() {
 	locate_template( array( '/profile/profile-header.php' ), true );
@@ -194,23 +206,25 @@ function bp_format_time( $time, $just_date = false, $localize_time = true ) {
 }
 
 function bp_word_or_name( $youtext, $nametext, $capitalize = true, $echo = true ) {
-	global $bp;
 
-	if ( $capitalize )
-		$youtext = bp_core_ucfirst($youtext);
+	if ( !empty( $capitalize ) )
+		$youtext = bp_core_ucfirst( $youtext );
 
-	if ( $bp->displayed_user->id == $bp->loggedin_user->id ) {
-		if ( $echo )
+	if ( bp_displayed_user_id() == bp_loggedin_user_id() ) {
+		if ( true == $echo ) {
 			echo apply_filters( 'bp_word_or_name', $youtext );
-		else
+		} else {
 			return apply_filters( 'bp_word_or_name', $youtext );
+		}
 	} else {
-		$fullname = (array)explode( ' ', $bp->displayed_user->fullname );
+		$fullname = bp_get_displayed_user_fullname();
+		$fullname = (array) explode( ' ', $fullname );
 		$nametext = sprintf( $nametext, $fullname[0] );
-		if ( $echo )
+		if ( true == $echo ) {
 			echo apply_filters( 'bp_word_or_name', $nametext );
-		else
+		} else {
 			return apply_filters( 'bp_word_or_name', $nametext );
+		}
 	}
 }
 
@@ -226,18 +240,16 @@ function bp_styles() {
 /** Search Form ***************************************************************/
 
 function bp_search_form_action() {
-	return apply_filters( 'bp_search_form_action', bp_get_root_domain() . '/' . bp_get_search_slug() );
+	return apply_filters( 'bp_search_form_action', trailingslashit( bp_get_root_domain() . '/' . bp_get_search_slug() ) );
 }
 
 /**
  * Generates the basic search form as used in BP-Default's header.
  *
- * @global object $bp BuddyPress global settings
  * @return string HTML <select> element
  * @since 1.0
  */
 function bp_search_form_type_select() {
-	global $bp;
 
 	$options = array();
 
@@ -260,7 +272,7 @@ function bp_search_form_type_select() {
 	$selection_box .= '<select name="search-which" id="search-which" style="width: auto">';
 
 	$options = apply_filters( 'bp_search_form_type_select_options', $options );
-	foreach( (array)$options as $option_value => $option_title )
+	foreach( (array) $options as $option_value => $option_title )
 		$selection_box .= sprintf( '<option value="%s">%s</option>', $option_value, $option_title );
 
 	$selection_box .= '</select>';
@@ -273,7 +285,7 @@ function bp_search_form_type_select() {
  *
  * @global object $bp BuddyPress global settings
  * @return string
- * @since 1.5
+ * @since BuddyPress (1.5)
  */
 function bp_search_default_text( $component = '' ) {
 	echo bp_get_search_default_text( $component );
@@ -394,12 +406,12 @@ function bp_create_excerpt( $text, $length = 225, $options = array() ) {
 	$ending = apply_filters( 'bp_excerpt_append_text', $ending );
 
 	// Remove shortcodes if necessary
-	if ( $filter_shortcodes )
+	if ( !empty( $filter_shortcodes ) )
 		$text = strip_shortcodes( $text );
 
 	// When $html is true, the excerpt should be created without including HTML tags in the
 	// excerpt length
-	if ( $html ) {
+	if ( !empty( $html ) ) {
 		// The text is short enough. No need to truncate
 		if ( mb_strlen( preg_replace( '/<.*?>/', '', $text ) ) <= $length ) {
 			return $text;
@@ -459,7 +471,7 @@ function bp_create_excerpt( $text, $length = 225, $options = array() ) {
 	}
 
 	// If $exact is false, we can't break on words
-	if ( !$exact ) {
+	if ( empty( $exact ) ) {
 		$spacepos = mb_strrpos( $truncate, ' ' );
 		if ( isset( $spacepos ) ) {
 			if ( $html ) {
@@ -490,11 +502,25 @@ function bp_create_excerpt( $text, $length = 225, $options = array() ) {
 add_filter( 'bp_create_excerpt', 'stripslashes_deep' );
 add_filter( 'bp_create_excerpt', 'force_balance_tags' );
 
+/**
+ * Echoes the output of bp_get_total_member_count()
+ */
 function bp_total_member_count() {
 	echo bp_get_total_member_count();
 }
+	/**
+	 * Returns the total member count in your BP instance
+	 *
+	 * Since BuddyPress 1.6, this function has used bp_core_get_active_member_count(), which
+	 * counts non-spam, non-deleted users who have last_activity. This value will correctly
+	 * match the total member count number used for pagination on member directories.
+	 *
+	 * Before BuddyPress 1.6, this function used bp_core_get_total_member_count(), which did
+	 * not take into account last_activity, and thus often resulted in higher counts than
+	 * shown by member directory pagination.
+	 */
 	function bp_get_total_member_count() {
-		return apply_filters( 'bp_get_total_member_count', bp_core_get_total_member_count() );
+		return apply_filters( 'bp_get_total_member_count', bp_core_get_active_member_count() );
 	}
 	add_filter( 'bp_get_total_member_count', 'bp_core_number_format' );
 
@@ -555,7 +581,7 @@ function bp_current_component() {
 
 function bp_current_action() {
 	global $bp;
-	$current_action = !empty( $bp->current_action ) ? $bp->current_action : false;
+	$current_action = !empty( $bp->current_action ) ? $bp->current_action : '';
 	return apply_filters( 'bp_current_action', $current_action );
 }
 
@@ -582,7 +608,7 @@ function bp_action_variables() {
  * Return the value of a given action variable
  *
  * @package BuddyPress
- * @since 1.5
+ * @since BuddyPress (1.5)
  *
  * @param int $position The key of the action_variables array that you want
  * @return str $action_variable The value of that position in the array
@@ -614,7 +640,7 @@ function bp_root_domain() {
  * Echoes the output of bp_get_root_slug()
  *
  * @package BuddyPress Core
- * @since 1.5
+ * @since BuddyPress (1.5)
  */
 function bp_root_slug( $component = '' ) {
 	echo bp_get_root_slug( $component );
@@ -635,9 +661,9 @@ function bp_root_slug( $component = '' ) {
 	 * $bp->groups->root_slug.
 	 *
 	 * @package BuddyPress Core
-	 * @since 1.5
+	 * @since BuddyPress (1.5)
 	 *
-	 * @global object $bp Global BuddyPress settings object
+	 * @global BuddyPress $bp The one true BuddyPress instance
 	 * @param string $component Optional. Defaults to the current component
 	 * @return string $root_slug The root slug
 	 */
@@ -648,7 +674,7 @@ function bp_root_slug( $component = '' ) {
 
 		// Use current global component if none passed
 		if ( empty( $component ) )
-			$component = $bp->current_component;
+			$component = bp_current_component();
 
 		// Component is active
 		if ( !empty( $bp->active_components[$component] ) ) {
@@ -673,7 +699,7 @@ function bp_root_slug( $component = '' ) {
  * Return the component name based on the current root slug
  *
  * @since BuddyPress {r3923}
- * @global object $bp Global BuddyPress settings object
+ * @global BuddyPress $bp The one true BuddyPress instance
  * @param str $root_slug Needle to our active component haystack
  * @return mixed False if none found, component name if found
  */
@@ -682,24 +708,24 @@ function bp_get_name_from_root_slug( $root_slug = '' ) {
 
 	// If no slug is passed, look at current_component
 	if ( empty( $root_slug ) )
-		$root_slug = $bp->current_component;
+		$root_slug = bp_current_component();
 
 	// No current component or root slug, so flee
 	if ( empty( $root_slug ) )
 		return false;
 
 	// Loop through active components and look for a match
-	foreach ( $bp->active_components as $component => $id )
-		if (	isset( $bp->{$component}->root_slug ) &&
-				!empty( $bp->{$component}->root_slug ) &&
-				$bp->{$component}->root_slug == $root_slug )
+	foreach ( $bp->active_components as $component => $id ) {
+		if ( !empty( $bp->{$component}->root_slug ) && ( $bp->{$component}->root_slug == $root_slug ) ) {
 			return $bp->{$component}->name;
+		}
+	}
 
 	return false;
 }
 
 function bp_user_has_access() {
-	$has_access = ( is_super_admin() || bp_is_my_profile() ) ? true : false;
+	$has_access = ( bp_current_user_can( 'bp_moderate' ) || bp_is_my_profile() ) ? true : false;
 
 	return apply_filters( 'bp_user_has_access', $has_access );
 }
@@ -708,7 +734,7 @@ function bp_user_has_access() {
  * Output the search slug
  *
  * @package BuddyPress
- * @since 1.5
+ * @since BuddyPress (1.5)
  *
  * @uses bp_get_search_slug()
  */
@@ -719,12 +745,48 @@ function bp_search_slug() {
 	 * Return the search slug
 	 *
 	 * @package BuddyPress
-	 * @since 1.5
+	 * @since BuddyPress (1.5)
 	 */
 	function bp_get_search_slug() {
 		return apply_filters( 'bp_get_search_slug', BP_SEARCH_SLUG );
 	}
 
+/**
+ * Get the id of the currently displayed user
+ *
+ * @uses apply_filters() Filter 'bp_displayed_user_id' to change this value
+ * @return int
+ */
+function bp_displayed_user_id() {
+
+	static $id = 0;
+
+	if ( empty( $id ) ) {
+		global $bp;
+		$id = !empty( $bp->displayed_user->id ) ? $bp->displayed_user->id : 0;
+	}
+
+	return apply_filters( 'bp_displayed_user_id', $id );
+}
+
+/**
+ * Get the id of the currently logged-in user
+ *
+ * @uses apply_filters() Filter 'bp_loggedin_user_id' to change this value
+ * @return int
+ */
+function bp_loggedin_user_id() {
+
+	static $id = 0;
+
+	if ( empty( $id ) ) {
+		global $bp;
+		$id = !empty( $bp->loggedin_user->id ) ? $bp->loggedin_user->id : 0;
+	}
+
+	return apply_filters( 'bp_loggedin_user_id', $id );
+}
+
 /** is_() functions to determine the current page *****************************/
 
 /**
@@ -737,7 +799,7 @@ function bp_search_slug() {
  * - the component's id, or 'canonical' name
  *
  * @package BuddyPress Core
- * @since 1.5
+ * @since BuddyPress (1.5)
  * @return bool Returns true if the component matches, or else false.
  */
 function bp_is_current_component( $component ) {
@@ -750,6 +812,7 @@ function bp_is_current_component( $component ) {
 		$component = 'profile';
 
 	if ( !empty( $bp->current_component ) ) {
+
 		// First, check to see whether $component_name and the current
 		// component are a simple match
 		if ( $bp->current_component == $component ) {
@@ -768,8 +831,9 @@ function bp_is_current_component( $component ) {
 		// non-translatable component name. If so, we can return its
 		// corresponding slug from $bp->active_components.
 		} else if ( $key = array_search( $component, $bp->active_components ) ) {
-			if ( strstr( $bp->current_component, $key ) )
+			if ( strstr( $bp->current_component, $key ) ) {
 				$is_current_component = true;
+			}
 
 		// If we haven't found a match yet, check against the root_slugs
 		// created by $bp->pages, as well as the regular slugs
@@ -777,8 +841,9 @@ function bp_is_current_component( $component ) {
 			foreach ( $bp->active_components as $id ) {
 				// If the $component parameter does not match the current_component,
 				// then move along, these are not the droids you are looking for
-				if ( empty( $bp->{$id}->root_slug ) || $bp->{$id}->root_slug != $bp->current_component )
+				if ( empty( $bp->{$id}->root_slug ) || $bp->{$id}->root_slug != $bp->current_component ) {
 					continue;
+				}
 
 				if ( $id == $component ) {
 					$is_current_component = true;
@@ -795,8 +860,9 @@ function bp_is_current_component( $component ) {
 		$page_template = $custom_fields[0];
 
 		// Component name is in the page template name
-		if ( !empty( $page_template ) && strstr( strtolower( $page_template ), strtolower( $component ) ) )
+		if ( !empty( $page_template ) && strstr( strtolower( $page_template ), strtolower( $component ) ) ) {
 			$is_current_component = true;
+		}
 	}
 
  	return apply_filters( 'bp_is_current_component', $is_current_component, $component );
@@ -814,15 +880,13 @@ function bp_is_current_component( $component ) {
  * the current_action is 'members'.
  *
  * @package BuddyPress
- * @since 1.5
+ * @since BuddyPress (1.5)
  *
  * @param str $action The action being tested against
  * @return bool True if the current action matches $action
  */
 function bp_is_current_action( $action = '' ) {
-	global $bp;
-
-	if ( $action == $bp->current_action )
+	if ( $action == bp_current_action() )
 		return true;
 
 	return false;
@@ -840,7 +904,7 @@ function bp_is_current_action( $action = '' ) {
  * $action_variables[0] is 'group-settings'.
  *
  * @package BuddyPress
- * @since 1.5
+ * @since BuddyPress (1.5)
  *
  * @param str $action_variable The action_variable being tested against
  * @param int $position The array key you're testing against. If you don't provide a $position,
@@ -939,11 +1003,11 @@ function bp_is_root_component( $component_name ) {
  * Checks if the site's front page is set to the specified BuddyPress component
  * page in wp-admin's Settings > Reading screen.
  *
- * @global object $bp Global BuddyPress settings object
+ * @global BuddyPress $bp The one true BuddyPress instance
  * @global $current_blog WordPress global for the current blog
  * @param string $component Optional; Name of the component to check for.
  * @return bool True If the specified component is set to be the site's front page.
- * @since 1.5
+ * @since BuddyPress (1.5)
  */
 function bp_is_component_front_page( $component = '' ) {
 	global $bp, $current_blog;
@@ -969,7 +1033,6 @@ function bp_is_component_front_page( $component = '' ) {
  * @return bool True if it's a non-BP page, false otherwise
  */
 function bp_is_blog_page() {
-	global $wp_query;
 
 	$is_blog_page = false;
 
@@ -997,7 +1060,7 @@ function bp_is_page( $page ) {
 function bp_is_active( $component ) {
 	global $bp;
 
-	if ( isset( $bp->active_components[$component] ) )
+	if ( isset( $bp->active_components[$component] ) || 'core' == $component )
 		return true;
 
 	return false;
@@ -1069,9 +1132,7 @@ function bp_is_settings_component() {
 /** Activity ******************************************************************/
 
 function bp_is_single_activity() {
-	global $bp;
-
-	if ( bp_is_activity_component() && is_numeric( $bp->current_action ) )
+	if ( bp_is_activity_component() && is_numeric( bp_current_action() ) )
 		return true;
 
 	return false;
@@ -1080,9 +1141,7 @@ function bp_is_single_activity() {
 /** User **********************************************************************/
 
 function bp_is_my_profile() {
-	global $bp;
-
-	if ( is_user_logged_in() && $bp->loggedin_user->id == $bp->displayed_user->id )
+	if ( is_user_logged_in() && bp_loggedin_user_id() == bp_displayed_user_id() )
 		$my_profile = true;
 	else
 		$my_profile = false;
@@ -1091,9 +1150,7 @@ function bp_is_my_profile() {
 }
 
 function bp_is_user() {
-	global $bp;
-
-	if ( !empty( $bp->displayed_user->id ) )
+	if ( bp_displayed_user_id() && !is_404() )
 		return true;
 
 	return false;
@@ -1177,7 +1234,7 @@ function bp_is_user_forums() {
  * Is this a user's "Topics Started" page?
  *
  * @package BuddyPress
- * @since 1.5
+ * @since BuddyPress (1.5)
  *
  * @return bool
  */
@@ -1192,7 +1249,7 @@ function bp_is_user_forums_started() {
  * Is this a user's "Replied To" page?
  *
  * @package BuddyPress
- * @since 1.5
+ * @since BuddyPress (1.5)
  *
  * @return bool
  */
@@ -1263,7 +1320,7 @@ function bp_is_user_settings() {
  * Is this a user's General Settings page?
  *
  * @package BuddyPress
- * @since 1.5
+ * @since BuddyPress (1.5)
  *
  * @return bool
  */
@@ -1278,7 +1335,7 @@ function bp_is_user_settings_general() {
  * Is this a user's Notification Settings page?
  *
  * @package BuddyPress
- * @since 1.5
+ * @since BuddyPress (1.5)
  *
  * @return bool
  */
@@ -1293,7 +1350,7 @@ function bp_is_user_settings_notifications() {
  * Is this a user's Account Deletion page?
  *
  * @package BuddyPress
- * @since 1.5
+ * @since BuddyPress (1.5)
  *
  * @return bool
  */
@@ -1445,6 +1502,12 @@ function bp_is_notices() {
 	return false;
 }
 
+function bp_is_messages_conversation() {
+	if ( bp_is_user_messages() && ( bp_is_current_action( 'view' ) ) )
+		return true;
+
+	return false;
+}
 
 function bp_is_single( $component, $callback ) {
 	if ( bp_is_current_component( $component ) && ( true === call_user_func( $callback ) ) )
@@ -1524,6 +1587,9 @@ function bp_the_body_class() {
 
 		/** User **************************************************************/
 
+		if ( bp_is_user() )
+			$bp_classes[] = 'bp-user';
+
 		if ( !bp_is_directory() ) :
 			if ( bp_is_user_blogs() )
 				$bp_classes[] = 'my-blogs';
@@ -1608,11 +1674,15 @@ function bp_the_body_class() {
 		if ( bp_is_group_forum() )
 			$bp_classes[] = 'group-forum';
 
-		if ( bp_is_group_admin_page() )
+		if ( bp_is_group_admin_page() ) {
 			$bp_classes[] = 'group-admin';
+			$bp_classes[] = bp_get_group_current_admin_tab();
+		}
 
-		if ( bp_is_group_create() )
+		if ( bp_is_group_create() ) {
 			$bp_classes[] = 'group-create';
+			$bp_classes[] = bp_get_groups_current_create_step();
+		}
 
 		if ( bp_is_group_home() )
 			$bp_classes[] = 'group-home';
@@ -1640,6 +1710,10 @@ function bp_the_body_class() {
 		// We don't want WordPress blog classes to appear on non-blog pages.
 		if ( !bp_is_blog_page() ) {
 
+			// Observe WP custom background body class
+			if ( in_array( 'custom-background', (array) $wp_classes ) )
+				$bp_classes[] = 'custom-background';
+
 			// Preserve any custom classes already set
 			if ( !empty( $custom_classes ) ) {
 				$wp_classes = (array) $custom_classes;
diff --git a/wp-content/plugins/buddypress/bp-core/bp-core-update.php b/wp-content/plugins/buddypress/bp-core/bp-core-update.php
new file mode 100644
index 0000000000000000000000000000000000000000..f3dea1cd6da0a50a29a67ac8b450b8e7096bd168
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-core/bp-core-update.php
@@ -0,0 +1,197 @@
+<?php
+
+/**
+ * BuddyPress Updater
+ *
+ * @package BuddyPress
+ * @subpackage Updater
+ */
+
+// Exit if accessed directly
+if ( !defined( 'ABSPATH' ) ) exit;
+
+/**
+ * Compare the BuddyPress version to the DB version to determine if updating
+ *
+ * @since BuddyPress (1.6)
+ *
+ * @uses get_option()
+ * @uses bp_get_db_version() To get BuddyPress's database version
+ * @return bool True if update, False if not
+ */
+function bp_is_update() {
+
+	// Current DB version of this site (per site in a multisite network)
+	$current_db   = bp_get_option( '_bp_db_version' );
+	$current_live = bp_get_db_version();
+
+	// Compare versions (cast as int and bool to be safe)
+	$is_update = (bool) ( (int) $current_db < (int) $current_live );
+
+	// Return the product of version comparison
+	return $is_update;
+}
+
+/**
+ * Determine if BuddyPress is being activated
+ *
+ * @since BuddyPress (1.6)
+ *
+ * @global BuddyPress $bp
+ * @return bool True if activating BuddyPress, false if not
+ */
+function bp_is_activation( $basename = '' ) {
+	global $bp;
+
+	// Baif if action or plugin are empty
+	if ( empty( $_GET['action'] ) || empty( $_GET['plugin'] ) )
+		return false;
+
+	// Bail if not activating
+	if ( 'activate' !== $_GET['action'] )
+		return false;
+
+	// The plugin being activated
+	$plugin = isset( $_GET['plugin'] ) ? $_GET['plugin'] : '';
+
+	// Set basename if empty
+	if ( empty( $basename ) && !empty( $bp->basename ) )
+		$basename = $bp->basename;
+
+	// Bail if no basename
+	if ( empty( $basename ) )
+		return false;
+
+	// Bail if plugin is not BuddyPress
+	if ( $basename !== $plugin )
+		return false;
+
+	return true;
+}
+
+/**
+ * Determine if BuddyPress is being deactivated
+ *
+ * @since BuddyPress (1.6)
+ *
+ * @global BuddyPress $bp
+ * @return bool True if deactivating BuddyPress, false if not
+ */
+function bp_is_deactivation( $basename = '' ) {
+	global $bp;
+
+	// Baif if action or plugin are empty
+	if ( empty( $_GET['action'] ) || empty( $_GET['plugin'] ) )
+		return false;
+
+	// Bail if not deactivating
+	if ( 'deactivate' !== $_GET['action'] )
+		return false;
+
+	// The plugin being deactivated
+	$plugin = isset( $_GET['plugin'] ) ? $_GET['plugin'] : '';
+
+	// Set basename if empty
+	if ( empty( $basename ) && !empty( $bp->basename ) )
+		$basename = $bp->basename;
+
+	// Bail if no basename
+	if ( empty( $basename ) )
+		return false;
+
+	// Bail if plugin is not BuddyPress
+	if ( $basename !== $plugin )
+		return false;
+
+	return true;
+}
+
+/**
+ * Update the DB to the latest version
+ *
+ * @since BuddyPress (1.6)
+ *
+ * @uses update_option()
+ * @uses bp_get_db_version() To get BuddyPress's database version
+ * @uses bp_update_option() To update BuddyPress's database version
+ */
+function bp_version_bump() {
+	$db_version = bp_get_db_version();
+	bp_update_option( '_bp_db_version', $db_version );
+}
+
+/**
+ * Setup the BuddyPress updater
+ *
+ * @since BuddyPress (1.6)
+ *
+ * @uses BBP_Updater
+ */
+function bp_setup_updater() {
+
+	// Are we running an outdated version of BuddyPress?
+	if ( bp_is_update() ) {
+
+		// Bump the version
+		bp_version_bump();
+
+		// Run the deactivation function to wipe roles, caps, and rewrite rules
+		bp_deactivation();
+
+		// Run the activation function to reset roles, caps, and rewrite rules
+		bp_activation();
+	}
+}
+
+/** Activation Actions ********************************************************/
+
+/**
+ * Runs on BuddyPress activation
+ *
+ * @since BuddyPress (1.6)
+ *
+ * @uses do_action() Calls 'bp_activation' hook
+ */
+function bp_activation() {
+
+	// Force refresh theme roots.
+	delete_site_transient( 'theme_roots' );
+
+	// Use as of (1.6)
+	do_action( 'bp_activation' );
+
+	// @deprecated as of (1.6)
+	do_action( 'bp_loader_activate' );
+}
+
+/**
+ * Runs on BuddyPress deactivation
+ *
+ * @since BuddyPress (1.6)
+ *
+ * @uses do_action() Calls 'bp_deactivation' hook
+ */
+function bp_deactivation() {
+
+	// Force refresh theme roots.
+	delete_site_transient( 'theme_roots' );
+
+	// Use as of (1.6)
+	do_action( 'bp_deactivation' );
+
+	// @deprecated as of (1.6)
+	do_action( 'bp_loader_deactivate' );
+}
+
+/**
+ * Runs when uninstalling BuddyPress
+ *
+ * @since BuddyPress (1.6)
+ *
+ * @uses do_action() Calls 'bp_uninstall' hook
+ */
+function bp_uninstall() {
+	do_action( 'bp_uninstall' );
+}
+
+?>
diff --git a/wp-content/plugins/buddypress/bp-core/bp-core-widgets.php b/wp-content/plugins/buddypress/bp-core/bp-core-widgets.php
index 11dff4c26bbb259cc8dab522780900a35d3e2086..fae5d686b19dd636e8d37b55fb5628c0b792c922 100644
--- a/wp-content/plugins/buddypress/bp-core/bp-core-widgets.php
+++ b/wp-content/plugins/buddypress/bp-core/bp-core-widgets.php
@@ -14,24 +14,20 @@ add_action( 'bp_register_widgets', 'bp_core_register_widgets' );
 
 class BP_Core_Members_Widget extends WP_Widget {
 
-	function bp_core_members_widget() {
-		$this->__construct();
-	}
-
 	function __construct() {
 		$widget_ops = array( 'description' => __( 'A dynamic list of recently active, popular, and newest members', 'buddypress' ) );
 		parent::__construct( false, $name = __( 'Members', 'buddypress' ), $widget_ops );
 
 		if ( is_active_widget( false, false, $this->id_base ) && !is_admin() && !is_network_admin() ) {
-			if ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG )
-				wp_enqueue_script( 'bp_core_widget_members-js', BP_PLUGIN_URL . '/bp-core/js/widget-members.dev.js', array( 'jquery' ), '20110723' );
-			else
-				wp_enqueue_script( 'bp_core_widget_members-js', BP_PLUGIN_URL . '/bp-core/js/widget-members.js', array( 'jquery' ), '20110723' );
+			if ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) {
+				wp_enqueue_script( 'bp_core_widget_members-js', BP_PLUGIN_URL . 'bp-core/js/widget-members.dev.js', array( 'jquery' ), bp_get_version() );
+			} else {
+				wp_enqueue_script( 'bp_core_widget_members-js', BP_PLUGIN_URL . 'bp-core/js/widget-members.js',     array( 'jquery' ), bp_get_version() );
+			}
 		}
 	}
 
 	function widget( $args, $instance ) {
-		global $bp;
 
 		extract( $args );
 
@@ -39,8 +35,11 @@ class BP_Core_Members_Widget extends WP_Widget {
 			$instance['member_default'] = 'active';
 
 		echo $before_widget;
+
+		$title = $instance['link_title'] ? '<a href="' . trailingslashit( bp_get_root_domain() . '/' . bp_get_members_root_slug() ) . '">' . $instance['title'] . '</a>' : $instance['title'];
+
 		echo $before_title
-		   . $instance['title']
+		   . $title
 		   . $after_title; ?>
 
 		<?php if ( bp_has_members( 'user_id=0&type=' . $instance['member_default'] . '&max=' . $instance['max_members'] . '&populate_extras=0' ) ) : ?>
@@ -98,28 +97,34 @@ class BP_Core_Members_Widget extends WP_Widget {
 
 	function update( $new_instance, $old_instance ) {
 		$instance = $old_instance;
-		$instance['title'] = strip_tags( $new_instance['title'] );
-		$instance['max_members'] = strip_tags( $new_instance['max_members'] );
+
+		$instance['title'] 	    = strip_tags( $new_instance['title'] );
+		$instance['max_members']    = strip_tags( $new_instance['max_members'] );
 		$instance['member_default'] = strip_tags( $new_instance['member_default'] );
+		$instance['link_title']	    = (bool)$new_instance['link_title'];
 
 		return $instance;
 	}
 
 	function form( $instance ) {
 		$defaults = array(
-			'title' => __( 'Members', 'buddypress' ),
-			'max_members' => 5,
-			'member_default' => 'active'
+			'title' 	 => __( 'Members', 'buddypress' ),
+			'max_members' 	 => 5,
+			'member_default' => 'active',
+			'link_title' 	 => false
 		);
 		$instance = wp_parse_args( (array) $instance, $defaults );
 
-		$title = strip_tags( $instance['title'] );
-		$max_members = strip_tags( $instance['max_members'] );
+		$title 		= strip_tags( $instance['title'] );
+		$max_members 	= strip_tags( $instance['max_members'] );
 		$member_default = strip_tags( $instance['member_default'] );
+		$link_title	= (bool)$instance['link_title'];
 		?>
 
 		<p><label for="bp-core-widget-title"><?php _e('Title:', 'buddypress'); ?> <input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" type="text" value="<?php echo esc_attr( $title ); ?>" style="width: 100%" /></label></p>
 
+		<p><label for="<?php echo $this->get_field_name('link_title') ?>"><input type="checkbox" name="<?php echo $this->get_field_name('link_title') ?>" value="1" <?php checked( $link_title ) ?> /> <?php _e( 'Link widget title to Members directory', 'buddypress' ) ?></label></p>
+
 		<p><label for="bp-core-widget-members-max"><?php _e('Max members to show:', 'buddypress'); ?> <input class="widefat" id="<?php echo $this->get_field_id( 'max_members' ); ?>" name="<?php echo $this->get_field_name( 'max_members' ); ?>" type="text" value="<?php echo esc_attr( $max_members ); ?>" style="width: 30%" /></label></p>
 
 		<p>
@@ -140,17 +145,12 @@ class BP_Core_Members_Widget extends WP_Widget {
 
 class BP_Core_Whos_Online_Widget extends WP_Widget {
 
-	function bp_core_whos_online_widget() {
-		$this->__construct();
-	}
-
 	function __construct() {
 		$widget_ops = array( 'description' => __( 'Avatars of users who are currently online', 'buddypress' ) );
 		parent::__construct( false, $name = __( "Who's Online Avatars", 'buddypress' ), $widget_ops );
 	}
 
 	function widget($args, $instance) {
-		global $bp;
 
 	    extract( $args );
 
@@ -209,17 +209,12 @@ class BP_Core_Whos_Online_Widget extends WP_Widget {
 
 class BP_Core_Recently_Active_Widget extends WP_Widget {
 
-	function bp_core_recently_active_widget() {
-		$this->__construct();
-	}
-
 	function __construct() {
 		$widget_ops = array( 'description' => __( 'Avatars of recently active members', 'buddypress' ) );
 		parent::__construct( false, $name = __( 'Recently Active Member Avatars', 'buddypress' ), $widget_ops );
 	}
 
-	function widget($args, $instance) {
-		global $bp;
+	function widget( $args, $instance ) {
 
 		extract( $args );
 
@@ -277,7 +272,6 @@ class BP_Core_Recently_Active_Widget extends WP_Widget {
 /** Widget AJAX ******************/
 
 function bp_core_ajax_widget_members() {
-	global $bp;
 
 	check_ajax_referer( 'bp_core_widget_members' );
 
@@ -330,5 +324,6 @@ function bp_core_ajax_widget_members() {
 	<?php endif;
 }
 add_action( 'wp_ajax_widget_members', 'bp_core_ajax_widget_members' );
+add_action( 'wp_ajax_nopriv_widget_members', 'bp_core_ajax_widget_members' );
 
 ?>
\ No newline at end of file
diff --git a/wp-content/plugins/buddypress/bp-core/bp-core-wpabstraction.php b/wp-content/plugins/buddypress/bp-core/bp-core-wpabstraction.php
index bef59de08620c8bbbb8ebcd7aef2d76d36953c3b..c36dbd2b825dc14f6d35280cf5d1aa675453268e 100644
--- a/wp-content/plugins/buddypress/bp-core/bp-core-wpabstraction.php
+++ b/wp-content/plugins/buddypress/bp-core/bp-core-wpabstraction.php
@@ -5,28 +5,27 @@
  * The functions within this file will detect the version of WordPress you are running
  * and will alter the environment so BuddyPress can run regardless.
  *
- * The code below mostly contains function mappings. This code is subject to change once
- * the 3.0 WordPress version merge takes place.
+ * The code below mostly contains function mappings. This file is subject to change at any time.
  */
 
 // Exit if accessed directly
 if ( !defined( 'ABSPATH' ) ) exit;
 
 /**
- * Parso the WordPress core version number into the major release
+ * Parse the WordPress core version number into the major release
  *
  * @since BuddyPress (1.5.2)
  * @global string $wp_version
- * @return string 
+ * @return string
  */
 function bp_get_major_wp_version() {
 	global $wp_version;
-	
-	return substr( $wp_version, 0, ( strpos( $wp_version, '.' ) + 2 ) );
+
+	return (float) $wp_version;
 }
 
 /**
- * Only add abstraction functions if WordPress is not in multisite mode
+ * Only add MS-specific abstraction functions if WordPress is not in multisite mode
  */
 if ( !is_multisite() ) {
 	global $wpdb;
diff --git a/wp-content/plugins/buddypress/bp-core/css/admin-bar-rtl.css b/wp-content/plugins/buddypress/bp-core/css/admin-bar-rtl.css
index 3c33211afb4a14498bae9193b79e3571384fdea3..d46916c32ed5a07a62a23d5c4b9e68fbaa5f08b5 100644
--- a/wp-content/plugins/buddypress/bp-core/css/admin-bar-rtl.css
+++ b/wp-content/plugins/buddypress/bp-core/css/admin-bar-rtl.css
@@ -1 +1 @@
-#wpadminbar .quicklinks li#wp-admin-bar-my-account ul,#wpadminbar .quicklinks li#wp-admin-bar-my-account-with-avatar ul{left:auto;right:0;}#wpadminbar .quicklinks li#wp-admin-bar-user-admin-with-avatar>a img,#wpadminbar .quicklinks li#wp-admin-bar-group-admin-with-avatar>a img{margin:-2px -5px 0 23px;}#wpadminbar .quicklinks li#wp-admin-bar-user-admin-with-avatar ul,#wpadminbar .quicklinks li#wp-admin-bar-group-admin-with-avatar ul{left:auto;right:30px;}#wpadminbar .quicklinks li#wp-admin-bar-user-admin-with-avatar ul ul,#wpadminbar .quicklinks li#wp-admin-bar-group-admin-with-avatar ul ul{left:auto;right:0;}#wpadminbar .quicklinks li#wp-admin-bar-group-admin-with-avatar ul{left:auto;right:0;}#wpadminbar .quicklinks li#wp-admin-bar-group-admin-with-avatar ul ul{left:auto;right:0;}
\ No newline at end of file
+#wpadminbar .quicklinks li#wp-admin-bar-my-account ul,#wpadminbar .quicklinks li#wp-admin-bar-my-account-with-avatar ul{left:auto;right:0}#wpadminbar .quicklinks li#wp-admin-bar-user-admin-with-avatar>a img,#wpadminbar .quicklinks li#wp-admin-bar-group-admin-with-avatar>a img{margin:-2px -5px 0 23px}#wpadminbar .quicklinks li#wp-admin-bar-user-admin-with-avatar ul,#wpadminbar .quicklinks li#wp-admin-bar-group-admin-with-avatar ul{left:auto;right:30px}#wpadminbar .quicklinks li#wp-admin-bar-user-admin-with-avatar ul ul,#wpadminbar .quicklinks li#wp-admin-bar-group-admin-with-avatar ul ul{left:auto;right:0}#wpadminbar .quicklinks li#wp-admin-bar-group-admin-with-avatar ul{left:auto;right:0}#wpadminbar .quicklinks li#wp-admin-bar-group-admin-with-avatar ul ul{left:auto;right:0}
\ No newline at end of file
diff --git a/wp-content/plugins/buddypress/bp-core/css/admin-bar.css b/wp-content/plugins/buddypress/bp-core/css/admin-bar.css
index a26d0cf6ec1c9e96144438e20949ed65cbcf8e07..b20ce7e6cb5fddd6197194fdd69381bcc45f66a3 100644
--- a/wp-content/plugins/buddypress/bp-core/css/admin-bar.css
+++ b/wp-content/plugins/buddypress/bp-core/css/admin-bar.css
@@ -1 +1 @@
-#wpadminbar .quicklinks li#wp-admin-bar-my-account ul,#wpadminbar .quicklinks li#wp-admin-bar-my-account-with-avatar ul{left:0;right:auto;}#wp-admin-bar-user-info img.avatar{height:64px;width:64px;}#wpadminbar .quicklinks li#wp-admin-bar-user-admin-with-avatar>a{border-left:none;background:url(../images/admin-bar-sprite.png?d=11122010) top left no-repeat;}#wpadminbar .quicklinks li#wp-admin-bar-user-admin-with-avatar>a img,#wpadminbar .quicklinks li#wp-admin-bar-group-admin-with-avatar>a img{width:16px;height:16px;display:inline;border:1px solid #999;vertical-align:middle;margin:-2px 23px 0 -5px;padding:0;background:#eee;float:none;}#wpadminbar .quicklinks li#wp-admin-bar-user-admin-with-avatar ul,#wpadminbar .quicklinks li#wp-admin-bar-group-admin-with-avatar ul{left:30px;}#wpadminbar .quicklinks li#wp-admin-bar-user-admin-with-avatar ul ul,#wpadminbar .quicklinks li#wp-admin-bar-group-admin-with-avatar ul ul{left:0;}#wpadminbar .quicklinks li#wp-admin-bar-group-admin-with-avatar>a{border-left:none;background:url(../images/admin-bar-sprite.png?d=11122010) top left no-repeat;}#wpadminbar .quicklinks li#wp-admin-bar-group-admin-with-avatar ul{left:0;}#wpadminbar .quicklinks li#wp-admin-bar-group-admin-with-avatar ul ul{left:0;}#wpadminbar .quicklinks li#wp-admin-bar-my-account a span.count,#wpadminbar .quicklinks li#wp-admin-bar-my-account-with-avatar a span.count,#wpadminbar .quicklinks li#wp-admin-bar-bp-notifications #ab-pending-notifications{background:#eee;color:#333;text-shadow:none;display:inline;padding:2px 5px;font-size:10px;font-weight:bold;-moz-border-radius:10px;-khtml-border-radius:10px;-webkit-border-radius:10px;border-radius:10px;}
\ No newline at end of file
+#wpadminbar .quicklinks li#wp-admin-bar-user-admin-with-avatar>a img,#wpadminbar .quicklinks li#wp-admin-bar-group-admin-with-avatar>a img{width:16px;height:16px;display:inline;border:1px solid #999;vertical-align:middle;margin:-2px 10px 0 -5px;padding:0;background:#eee;float:none}#wpadminbar .quicklinks li#wp-admin-bar-group-admin-with-avatar ul{left:0}#wpadminbar .quicklinks li#wp-admin-bar-group-admin-with-avatar ul ul{left:0}#wpadminbar .quicklinks li#wp-admin-bar-my-account a span.count,#wpadminbar .quicklinks li#wp-admin-bar-my-account-with-avatar a span.count,#wpadminbar .quicklinks li#wp-admin-bar-bp-notifications #ab-pending-notifications{background:#21759b;color:#fff;text-shadow:none;display:inline;padding:2px 5px;font-size:10px;font-weight:bold;-moz-border-radius:10px;-khtml-border-radius:10px;-webkit-border-radius:10px;border-radius:10px}#wpadminbar .quicklinks li#wp-admin-bar-bp-notifications #ab-pending-notifications{background:#ddd;color:#333;margin:0}#wpadminbar .quicklinks li#wp-admin-bar-bp-notifications #ab-pending-notifications.alert{background-color:#1fb3dd;color:#fff}#wpadminbar .quicklinks li#wp-admin-bar-bp-notifications>a{padding:0 .5em}#wp-admin-bar-user-info img.avatar{height:64px;width:64px}
\ No newline at end of file
diff --git a/wp-content/plugins/buddypress/bp-core/css/admin-bar.dev.css b/wp-content/plugins/buddypress/bp-core/css/admin-bar.dev.css
index 78259bcf44fd4f3da28d54455457e5cce0a8f9fe..d3801dc7736d87946fc20c23281c9085bcb5c004 100644
--- a/wp-content/plugins/buddypress/bp-core/css/admin-bar.dev.css
+++ b/wp-content/plugins/buddypress/bp-core/css/admin-bar.dev.css
@@ -1,18 +1,4 @@
-#wpadminbar .quicklinks li#wp-admin-bar-my-account ul,
-#wpadminbar .quicklinks li#wp-admin-bar-my-account-with-avatar ul {
-	left: 0;
-	right: auto;
-}
-#wp-admin-bar-user-info img.avatar {
-	height: 64px;
-	width: 64px;
-}
-
 /* Displayed User */
-#wpadminbar .quicklinks li#wp-admin-bar-user-admin-with-avatar > a {
-	border-left: none;
-	background: url(../images/admin-bar-sprite.png?d=11122010) top left no-repeat;
-}
 #wpadminbar .quicklinks li#wp-admin-bar-user-admin-with-avatar > a img,
 #wpadminbar .quicklinks li#wp-admin-bar-group-admin-with-avatar > a img {
 	width: 16px;
@@ -20,36 +6,26 @@
 	display: inline;
 	border: 1px solid #999;
 	vertical-align: middle;
-	margin: -2px 23px 0 -5px;
+	margin: -2px 10px 0 -5px;
 	padding: 0;
 	background: #eee;
 	float: none;
 }
-#wpadminbar .quicklinks li#wp-admin-bar-user-admin-with-avatar ul,
-#wpadminbar .quicklinks li#wp-admin-bar-group-admin-with-avatar ul {
-	left: 30px;
-}
-#wpadminbar .quicklinks li#wp-admin-bar-user-admin-with-avatar ul ul,
-#wpadminbar .quicklinks li#wp-admin-bar-group-admin-with-avatar ul ul {
- 	left: 0;
-}
 
 /* Displayed Group */
-#wpadminbar .quicklinks li#wp-admin-bar-group-admin-with-avatar > a {
-	border-left: none;
-	background: url(../images/admin-bar-sprite.png?d=11122010) top left no-repeat;
-}
 #wpadminbar .quicklinks li#wp-admin-bar-group-admin-with-avatar ul {
 	left: 0;
 }
 #wpadminbar .quicklinks li#wp-admin-bar-group-admin-with-avatar ul ul {
  	left: 0;
 }
+
+/* Notifications */
 #wpadminbar .quicklinks li#wp-admin-bar-my-account a span.count,
 #wpadminbar .quicklinks li#wp-admin-bar-my-account-with-avatar a span.count,
 #wpadminbar .quicklinks li#wp-admin-bar-bp-notifications #ab-pending-notifications {
-	background: #eee;
-	color: #333;
+	background: #21759B;
+	color: #fff;
 	text-shadow: none;
 	display: inline;
 	padding: 2px 5px;
@@ -59,4 +35,24 @@
 	-khtml-border-radius: 10px;
 	-webkit-border-radius: 10px;
 	border-radius: 10px;
+}
+
+#wpadminbar .quicklinks li#wp-admin-bar-bp-notifications #ab-pending-notifications {
+	background: #ddd;
+	color: #333;
+	margin: 0
+}
+
+#wpadminbar .quicklinks li#wp-admin-bar-bp-notifications #ab-pending-notifications.alert {
+	background-color: #1fb3dd;
+	color: #fff;
+}
+
+#wpadminbar .quicklinks li#wp-admin-bar-bp-notifications > a {
+	padding: 0 .5em;
+}
+
+#wp-admin-bar-user-info img.avatar {
+	height: 64px;
+	width: 64px;
 }
\ No newline at end of file
diff --git a/wp-content/plugins/buddypress/bp-core/css/buddybar-rtl.css b/wp-content/plugins/buddypress/bp-core/css/buddybar-rtl.css
index 425dff0f3e37f9eada35b0e56578b601d8fd0f94..a89f116f4a2daf72bb41be3b8531d8e6c3258de8 100644
--- a/wp-content/plugins/buddypress/bp-core/css/buddybar-rtl.css
+++ b/wp-content/plugins/buddypress/bp-core/css/buddybar-rtl.css
@@ -1 +1 @@
-#wp-admin-bar{right:0;left:auto;}#wp-admin-bar div#admin-bar-logo{right:10px;left:auto;}#wp-admin-bar li{text-align:right;}#wp-admin-bar li.no-arrow a{padding-left:15px;padding-right:0;}#admin-bar-logo{float:right;}#wp-admin-bar ul li{float:right;background:url(_inc/images/admin-menu-arrow.gif) 12% 53% no-repeat;padding-left:11px;padding-right:0;}#wp-admin-bar ul li.no-arrow{padding-left:0;}#wp-admin-bar ul li.align-right{left:0;right:auto;}#wp-admin-bar ul li ul{right:-999em;left:auto;margin-right:0;}#wp-admin-bar ul li ul li{float:right;}#wp-admin-bar ul li ul ul{margin:-25px 184px 0 0;}#wp-admin-bar ul li:hover ul,#wp-admin-bar ul li li:hover ul,#wp-admin-bar ul li.sfhover ul,#wp-admin-bar ul li ul li.sfhover ul{right:auto;}#wp-admin-bar ul li.align-right:hover ul{left:0;right:auto;}#wp-admin-bar ul li:hover ul ul,#wp-admin-bar li.sfhover ul li ul{right:-999em;left:auto;}#wp-admin-bar img.avatar{float:right;margin-left:8px;margin-right:0;}#wp-admin-bar span.activity{margin-right:34px;margin-left:0;}#wp-admin-bar ul li#bp-adminbar-notifications-menu a span{margin-right:2px;margin-left:0;}
\ No newline at end of file
+#wp-admin-bar{right:0;left:auto}#wp-admin-bar div#admin-bar-logo{right:10px;left:auto}#wp-admin-bar li{text-align:right}#wp-admin-bar li.no-arrow a{padding-left:15px;padding-right:0}#admin-bar-logo{float:right}#wp-admin-bar ul li{float:right;background:url(_inc/images/admin-menu-arrow.gif) 12% 53% no-repeat;padding-left:11px;padding-right:0}#wp-admin-bar ul li.no-arrow{padding-left:0}#wp-admin-bar ul li.align-right{left:0;right:auto}#wp-admin-bar ul li ul{right:-999em;left:auto;margin-right:0}#wp-admin-bar ul li ul li{float:right}#wp-admin-bar ul li ul ul{margin:-25px 184px 0 0}#wp-admin-bar ul li:hover ul,#wp-admin-bar ul li li:hover ul,#wp-admin-bar ul li.sfhover ul,#wp-admin-bar ul li ul li.sfhover ul{right:auto}#wp-admin-bar ul li.align-right:hover ul{left:0;right:auto}#wp-admin-bar ul li:hover ul ul,#wp-admin-bar li.sfhover ul li ul{right:-999em;left:auto}#wp-admin-bar img.avatar{float:right;margin-left:8px;margin-right:0}#wp-admin-bar span.activity{margin-right:34px;margin-left:0}#wp-admin-bar ul li#bp-adminbar-notifications-menu a span{margin-right:2px;margin-left:0}
\ No newline at end of file
diff --git a/wp-content/plugins/buddypress/bp-core/css/buddybar.css b/wp-content/plugins/buddypress/bp-core/css/buddybar.css
index 88b866f5b39032f5900927bf35deb2de09c3cd08..f5c4e54147be0fa2ccbd5aabfb727f9d6ca119a0 100644
--- a/wp-content/plugins/buddypress/bp-core/css/buddybar.css
+++ b/wp-content/plugins/buddypress/bp-core/css/buddybar.css
@@ -1 +1 @@
-body,body.wp-admin{padding-top:25px!important;}#wp-admin-bar{position:fixed;top:0;left:0;z-index:99;height:25px;font-size:11px;width:100%;z-index:1000;}#wp-admin-bar .padder{position:relative;padding:0;width:100%;margin:0 auto;background:url(../images/60pc_black.png);height:25px;}body#bp-default #wp-admin-bar .padder{min-width:960px;max-width:1250px;}#wp-admin-bar *{z-index:999;}#wp-admin-bar div#admin-bar-logo{position:absolute;top:5px;left:10px;}#wp-admin-bar a img{border:none;}#wp-admin-bar li{list-style:none;margin:0;padding:0;line-height:100%;text-align:left;}#wp-admin-bar li a{padding:7px 15px 7px 15px;color:#eee;text-decoration:none;font-size:11px;}#wp-admin-bar li.alt{border:none;}#wp-admin-bar li.no-arrow a{padding-right:15px;}#wp-admin-bar ul li ul li a span{display:none;}#wp-admin-bar li:hover,#wp-admin-bar li.hover{position:static;}#admin-bar-logo{float:left;font-weight:bold;font-size:11px;padding:5px 8px;margin:0;text-decoration:none;color:#fff;}body#bp-default #admin-bar-logo{padding:2px 8px;}#wp-admin-bar ul{margin:0;list-style:none;line-height:1;cursor:pointer;height:auto;padding:0;}#wp-admin-bar ul li{padding:0;float:left;position:relative;background:url(../images/admin-menu-arrow.gif) 88% 53% no-repeat;padding-right:11px;}#wp-admin-bar ul li.no-arrow{background:none;padding-right:0;}#wp-admin-bar ul li ul li{background-image:none;}#wp-admin-bar ul li.align-right{position:absolute;right:0;}#wp-admin-bar ul li a{display:block;}#wp-admin-bar ul.main-nav li:hover,#wp-admin-bar ul.main-nav li.sfhover,#wp-admin-bar ul.main-nav li ul li.sfhover{background-color:#333;}#wp-admin-bar ul li ul{position:absolute;width:185px;left:-999em;margin-left:0;background:#333;border:1px solid #222;-moz-box-shadow:0 4px 8px rgba(0,0,0,0.1);-webkit-box-shadow:0 4px 8px rgba(0,0,0,0.1);-moz-border-radius:3px;-webkit-border-radius:3px;-moz-border-radius-topleft:0;-webkit-border-top-left-radius:0;-moz-border-radius-topright:0;-webkit-border-top-right-radius:0;}#wp-admin-bar ul li>ul{border-top:none;}#wp-admin-bar ul li ul a{color:#eee;}#wp-admin-bar ul li ul li{float:left;width:174px;margin:0;}#wp-admin-bar ul li ul li:hover a{color:#fff;}#wp-admin-bar ul li div.admin-bar-clear{clear:both;}#wp-admin-bar ul.main-nav li ul li:hover,#wp-admin-bar ul.main-nav li ul li.sfhover,#wp-admin-bar ul.main-nav li ul li.sfhover{background-color:#222;}#wp-admin-bar ul li ul ul{margin:-25px 0 0 184px;-moz-border-radius:3px;-webkit-border-radius:3px;}#wp-admin-bar ul li ul li:hover ul li a{color:#eee;}#wp-admin-bar ul li ul li ul li:hover a{color:#fff;}#wp-admin-bar ul li:hover ul,#wp-admin-bar ul li ul li:hover ul,#wp-admin-bar ul li.sfhover ul,#wp-admin-bar ul li ul li.sfhover ul{left:auto;}#wp-admin-bar ul li.align-right:hover ul{right:0;}#wp-admin-bar ul li:hover ul ul,#wp-admin-bar li.sfhover ul li ul{left:-999em;}#wp-admin-bar img.avatar{float:left;margin-right:8px;}#wp-admin-bar span.activity{display:block;margin-left:34px;padding:0;}#wp-admin-bar ul.author-list li a{height:17px;}#wp-admin-bar ul li#bp-adminbar-notifications-menu a span{padding:0 6px;margin-left:2px;background:#fff;color:#000;-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;}
\ No newline at end of file
+body:not(.wp-admin){padding-top:25px!important}#wp-admin-bar{position:fixed;top:0;left:0;height:25px;font-size:11px;width:100%;z-index:9999}#wp-admin-bar .padder{position:relative;padding:0;width:100%;margin:0 auto;background:url(../images/60pc_black.png);height:25px}body#bp-default #wp-admin-bar .padder{max-width:1250px}#wp-admin-bar *{z-index:999}#wp-admin-bar div#admin-bar-logo{position:absolute;top:5px;left:10px}#wp-admin-bar a img{border:0}#wp-admin-bar li{list-style:none;margin:0;padding:0;line-height:100%;text-align:left}#wp-admin-bar li a{padding:7px 15px 7px 15px;color:#eee;text-decoration:none;font-size:11px}#wp-admin-bar li.alt{border:0}#wp-admin-bar li.no-arrow a{padding-right:15px}#wp-admin-bar ul li ul li a span{display:none}#wp-admin-bar li:hover,#wp-admin-bar li.hover{position:static}#admin-bar-logo{float:left;font-weight:bold;font-size:11px;padding:5px 8px;margin:0;text-decoration:none;color:#fff}body#bp-default #admin-bar-logo{padding:2px 8px}#wp-admin-bar ul{margin:0;list-style:none;line-height:1;cursor:pointer;height:auto;padding:0}#wp-admin-bar ul li{padding:0;float:left;position:relative;background:url(../images/admin-menu-arrow.gif) 88% 53% no-repeat;padding-right:11px}#wp-admin-bar ul li.no-arrow{background:0;padding-right:0}#wp-admin-bar ul li ul li{background-image:none}#wp-admin-bar ul li.align-right{position:absolute;right:0}#wp-admin-bar ul li a{display:block}#wp-admin-bar ul.main-nav li:hover,#wp-admin-bar ul.main-nav li.sfhover,#wp-admin-bar ul.main-nav li ul li.sfhover{background-color:#333}#wp-admin-bar ul li ul{position:absolute;width:185px;left:-999em;margin-left:0;background:#333;border:1px solid #222;-moz-box-shadow:0 4px 8px rgba(0,0,0,0.1);-webkit-box-shadow:0 4px 8px rgba(0,0,0,0.1);-moz-border-radius:3px;-webkit-border-radius:3px;-moz-border-radius-topleft:0;-webkit-border-top-left-radius:0;-moz-border-radius-topright:0;-webkit-border-top-right-radius:0}#wp-admin-bar ul li>ul{border-top:0}#wp-admin-bar ul li ul a{color:#eee}#wp-admin-bar ul li ul li{float:left;width:174px;margin:0}#wp-admin-bar ul li ul li:hover a{color:#fff}#wp-admin-bar ul li div.admin-bar-clear{clear:both}#wp-admin-bar ul.main-nav li ul li:hover,#wp-admin-bar ul.main-nav li ul li.sfhover,#wp-admin-bar ul.main-nav li ul li.sfhover{background-color:#222}#wp-admin-bar ul li ul ul{margin:-25px 0 0 184px;-moz-border-radius:3px;-webkit-border-radius:3px}#wp-admin-bar ul li ul li:hover ul li a{color:#eee}#wp-admin-bar ul li ul li ul li:hover a{color:#fff}#wp-admin-bar ul li:hover ul,#wp-admin-bar ul li ul li:hover ul,#wp-admin-bar ul li.sfhover ul,#wp-admin-bar ul li ul li.sfhover ul{left:auto}#wp-admin-bar ul li.align-right:hover ul{right:0}#wp-admin-bar ul li:hover ul ul,#wp-admin-bar li.sfhover ul li ul{left:-999em}#wp-admin-bar img.avatar{float:left;margin-right:8px}#wp-admin-bar span.activity{display:block;margin-left:34px;padding:0}#wp-admin-bar ul.author-list li a{height:17px}#wp-admin-bar ul li#bp-adminbar-notifications-menu a span{padding:0 6px;margin-left:2px;background:#fff;color:#000;-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px}#wp-admin-bar-user-info img.avatar{height:64px;width:64px}
\ No newline at end of file
diff --git a/wp-content/plugins/buddypress/bp-core/css/buddybar.dev.css b/wp-content/plugins/buddypress/bp-core/css/buddybar.dev.css
index 0c3ed9ad216039b8b71884430032ca376efd6352..2d19c599aa559ff8de120ee4d03c1d2a64b16aaf 100644
--- a/wp-content/plugins/buddypress/bp-core/css/buddybar.dev.css
+++ b/wp-content/plugins/buddypress/bp-core/css/buddybar.dev.css
@@ -1,16 +1,14 @@
-body,
-body.wp-admin {
+body:not(.wp-admin) {
 	padding-top: 25px !important;
 }
 #wp-admin-bar {
 	position: fixed;
 	top: 0;
 	left: 0;
-	z-index: 99;
 	height: 25px;
 	font-size: 11px;
 	width: 100%;
-	z-index: 1000;
+	z-index: 9999;
 }
 #wp-admin-bar .padder {
 	position: relative;
@@ -198,4 +196,8 @@ body#bp-default #admin-bar-logo {
 	-moz-border-radius: 3px;
 	-webkit-border-radius: 3px;
 	border-radius: 3px;
+}
+#wp-admin-bar-user-info img.avatar { 
+	height: 64px; 
+	width: 64px; 
 }
\ No newline at end of file
diff --git a/wp-content/plugins/buddypress/bp-core/deprecated/1.5.php b/wp-content/plugins/buddypress/bp-core/deprecated/1.5.php
index 03b03b82300032f66da089cce22bff28ff7f0c7b..f56c222ae79809ca20b960ab7dc8748d3224ce64 100644
--- a/wp-content/plugins/buddypress/bp-core/deprecated/1.5.php
+++ b/wp-content/plugins/buddypress/bp-core/deprecated/1.5.php
@@ -129,7 +129,7 @@ function bp_core_get_wp_profile() {
 
 	global $bp;
 
-	$ud = get_userdata( $bp->displayed_user->id ); ?>
+	$ud = get_userdata( bp_displayed_user_id() ); ?>
 
 <div class="bp-widget wp-profile">
 	<h4><?php _e( 'My Profile' ) ?></h4>
@@ -227,7 +227,7 @@ function bp_is_activity_front_page() {
 
 function bp_is_member() {
 	_deprecated_function( __FUNCTION__, '1.5', 'bp_is_user' );
-	bp_is_user();
+	return bp_is_user();
 }
 
 function bp_loggedinuser_link() {
@@ -309,7 +309,7 @@ function groups_at_message_notification( $content, $poster_user_id, $group_id, $
 
 	$group = new BP_Groups_Group( $group_id );
 
-	foreach( (array)$usernames as $username ) {
+	foreach( (array) $usernames as $username ) {
 		if ( !$receiver_user_id = bp_core_get_userid( $username ) )
 			continue;
 
@@ -321,8 +321,9 @@ function groups_at_message_notification( $content, $poster_user_id, $group_id, $
 		if ( 'no' != bp_get_user_meta( $receiver_user_id, 'notification_activity_new_mention', true ) ) {
 			$poster_name = bp_core_get_user_displayname( $poster_user_id );
 
-			$message_link = bp_activity_get_permalink( $activity_id );
-			$settings_link = bp_core_get_user_domain( $receiver_user_id ) . bp_get_settings_slug() . '/notifications/';
+			$message_link  = bp_activity_get_permalink( $activity_id );
+			$settings_slug = function_exists( 'bp_get_settings_slug' ) ? bp_get_settings_slug() : 'settings';
+			$settings_link = bp_core_get_user_domain( $receiver_user_id ) . $settings_slug . '/notifications/';
 
 			$poster_name = stripslashes( $poster_name );
 			$content = bp_groups_filter_kses( stripslashes( $content ) );
@@ -419,13 +420,27 @@ function bp_is_friend_requests() {
 	return bp_is_user_friend_requests();
 }
 
+/**
+ * Checks to see if a component's URL should be in the root, not under a member page:
+ * eg: http://domain.com/groups/the-group NOT http://domain.com/members/andy/groups/the-group
+ * You should be using bp_is_root_component().
+ *
+ * @deprecated 1.5
+ * @deprecated bp_is_root_component()
+ * @return true if root component, else false.
+ */
+function bp_core_is_root_component( $component_name ) {
+	_deprecated_function( __FUNCTION__, '1.5', 'bp_is_root_component()' );
+	return bp_is_root_component( $component_name );
+}
+
 /** Theme *********************************************************************/
 
 /**
  * Contains functions which were moved out of BP-Default's functions.php
  * in BuddyPress 1.5.
  *
- * @since 1.5
+ * @since BuddyPress (1.5)
  */
 function bp_dtheme_deprecated() {
 	if ( !function_exists( 'bp_dtheme_wp_pages_filter' ) ) :
@@ -461,7 +476,7 @@ function bp_dtheme_deprecated() {
 	 */
 	function bp_dtheme_page_on_front_update( $oldvalue, $newvalue ) {
 		_deprecated_function( __FUNCTION__, '1.5', "No longer required." );
-		if ( !is_admin() || !is_super_admin() )
+		if ( !is_admin() || !bp_current_user_can( 'bp_moderate' ) )
 			return false;
 
 		return $oldvalue;
@@ -533,4 +548,133 @@ function bp_dtheme_deprecated() {
 	endif;
 }
 add_action( 'after_setup_theme', 'bp_dtheme_deprecated', 15 );
+
+/**
+ * In BP 1.5, the Settings functions were moved out of the Core and Members
+ * components, and moved into a new Settings component. This function is no
+ * longer needed as the nav structure is set up by the {@link BP_Component} class.
+ *
+ * @deprecated BuddyPress (1.5)
+ * @since BuddyPress (1.6)
+ */
+function bp_core_add_settings_nav() {
+	_deprecated_function( __FUNCTION__, '1.5' );
+}
+
+/**
+ * In BP 1.5, the Settings functions were moved out of the Core and Members
+ * components, and moved into a new Settings component. This function is no
+ * longer needed as new template files for the Settings component were
+ * introduced.
+ *
+ * @deprecated BuddyPress (1.5)
+ * @since BuddyPress (1.6)
+ */
+function bp_core_screen_general_settings() {
+	_deprecated_function( __FUNCTION__, '1.5', 'Moved into theme template' );
+}
+
+/**
+ * In BP 1.5, the Settings functions were moved out of the Core and Members
+ * components, and moved into a new Settings component. This function is no
+ * longer needed as new template files for the Settings component were
+ * introduced.
+ *
+ * @deprecated BuddyPress (1.5)
+ * @since BuddyPress (1.6)
+ */
+function bp_core_screen_general_settings_title() {
+	_deprecated_function( __FUNCTION__, '1.5', 'Moved into theme template' );
+}
+
+/**
+ * In BP 1.5, the Settings functions were moved out of the Core and Members
+ * components, and moved into a new Settings component. This function is no
+ * longer needed as new template files for the Settings component were
+ * introduced.
+ *
+ * @deprecated BuddyPress (1.5)
+ * @since BuddyPress (1.6)
+ */
+function bp_core_screen_general_settings_content() {
+	_deprecated_function( __FUNCTION__, '1.5', 'Moved into theme template' );
+}
+
+/**
+ * In BP 1.5, the Settings functions were moved out of the Core and Members
+ * components, and moved into a new Settings component. This function is no
+ * longer needed as new template files for the Settings component were
+ * introduced.
+ *
+ * @deprecated BuddyPress (1.5)
+ * @since BuddyPress (1.6)
+ */
+function bp_core_screen_notification_settings() {
+	_deprecated_function( __FUNCTION__, '1.5', 'Moved into theme template' );
+}
+
+/**
+ * In BP 1.5, the Settings functions were moved out of the Core and Members
+ * components, and moved into a new Settings component. This function is no
+ * longer needed as new template files for the Settings component were
+ * introduced.
+ *
+ * @deprecated BuddyPress (1.5)
+ * @since BuddyPress (1.6)
+ */
+function bp_core_screen_notification_settings_title() {
+	_deprecated_function( __FUNCTION__, '1.5', 'Moved into theme template' );
+}
+
+/**
+ * In BP 1.5, the Settings functions were moved out of the Core and Members
+ * components, and moved into a new Settings component. This function is no
+ * longer needed as new template files for the Settings component were
+ * introduced.
+ *
+ * @deprecated BuddyPress (1.5)
+ * @since BuddyPress (1.6)
+ */
+function bp_core_screen_notification_settings_content() {
+	_deprecated_function( __FUNCTION__, '1.5', 'Moved into theme template' );
+}
+
+/**
+ * In BP 1.5, the Settings functions were moved out of the Core and Members
+ * components, and moved into a new Settings component. This function is no
+ * longer needed as new template files for the Settings component were
+ * introduced.
+ *
+ * @deprecated BuddyPress (1.5)
+ * @since BuddyPress (1.6)
+ */
+function bp_core_screen_delete_account() {
+	_deprecated_function( __FUNCTION__, '1.5', 'Moved into theme template' );
+}
+
+/**
+ * In BP 1.5, the Settings functions were moved out of the Core and Members
+ * components, and moved into a new Settings component. This function is no
+ * longer needed as new template files for the Settings component were
+ * introduced.
+ *
+ * @deprecated BuddyPress (1.5)
+ * @since BuddyPress (1.6)
+ */
+function bp_core_screen_delete_account_title() {
+	_deprecated_function( __FUNCTION__, '1.5', 'Moved into theme template' );
+}
+
+/**
+ * In BP 1.5, the Settings functions were moved out of the Core and Members
+ * components, and moved into a new Settings component. This function is no
+ * longer needed as new template files for the Settings component were
+ * introduced.
+ *
+ * @deprecated BuddyPress (1.5)
+ * @since BuddyPress (1.6)
+ */
+function bp_core_screen_delete_account_content() {
+	_deprecated_function( __FUNCTION__, '1.5', 'Moved into theme template' );
+}
 ?>
\ No newline at end of file
diff --git a/wp-content/plugins/buddypress/bp-core/deprecated/1.6.php b/wp-content/plugins/buddypress/bp-core/deprecated/1.6.php
new file mode 100644
index 0000000000000000000000000000000000000000..a782e7f6d07ab40ae1ef9083fbf5e9822b32988a
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-core/deprecated/1.6.php
@@ -0,0 +1,264 @@
+<?php
+
+/**
+ * Deprecated Functions
+ *
+ * @package BuddyPress
+ * @subpackage Core
+ * @deprecated Since 1.6
+ */
+
+/** Toolbar functions *********************************************************/
+
+function bp_admin_bar_remove_wp_menus() {
+	_deprecated_function( __FUNCTION__, '1.6' );
+}
+
+function bp_admin_bar_root_site() {
+	_deprecated_function( __FUNCTION__, '1.6' );
+}
+
+function bp_admin_bar_my_sites_menu() {
+	_deprecated_function( __FUNCTION__, '1.6' );
+}
+
+function bp_admin_bar_comments_menu( $wp_admin_bar ) {
+	_deprecated_function( __FUNCTION__, '1.6' );
+}
+
+function bp_admin_bar_appearance_menu() {
+	_deprecated_function( __FUNCTION__, '1.6' );
+}
+
+function bp_admin_bar_updates_menu() {
+	_deprecated_function( __FUNCTION__, '1.6' );
+}
+
+function bp_members_admin_bar_my_account_logout() {
+	_deprecated_function( __FUNCTION__, '1.6' );
+}
+
+function bp_core_is_user_deleted( $user_id = 0 ) {
+	_deprecated_function( __FUNCTION__, '1.6' );
+	bp_is_user_deleted( $user_id );
+}
+
+function bp_core_is_user_spammer( $user_id = 0 ) {
+	_deprecated_function( __FUNCTION__, '1.6' );
+	bp_is_user_spammer( $user_id );
+}
+
+
+/**
+ * Blogs functions
+ */
+
+/**
+ * @deprecated 1.6
+ * @deprecated No longer used; see bp_blogs_transition_activity_status()
+ */
+function bp_blogs_manage_comment( $comment_id, $comment_status ) {
+	_deprecated_function( __FUNCTION__, '1.6', 'No longer used' );
+}
+
+/**
+ * Core functions
+ */
+
+/**
+ * @deprecated 1.6
+ * @deprecated No longer used; see BP_Admin::admin_menus()
+ */
+function bp_core_add_admin_menu() {
+	_deprecated_function( __FUNCTION__, '1.6', 'No longer used' );
+}
+
+/**
+ * @deprecated 1.6
+ * @deprecated No longer used. We do ajax properly now.
+ */
+function bp_core_add_ajax_hook() {
+	_deprecated_function( __FUNCTION__, '1.6', 'No longer used' );
+}
+
+/**
+ * Members functions
+ */
+
+/**
+ * @deprecated 1.6
+ * @deprecated No longer used. Check for $bp->pages->activate->slug instead.
+ */
+function bp_has_custom_activation_page() {
+	_deprecated_function( __FUNCTION__, '1.6' );
+}
+
+/**
+ * Friends functions
+ */
+
+/**
+ * Displays Friends header tabs
+ *
+ * @deprecated 1.6
+ * @deprecated No longer used
+ */
+function bp_friends_header_tabs() {
+	_deprecated_function( __FUNCTION__, '1.6', 'Since BuddyPress 1.2, BP has not supported ordering of friend lists by URL parameters.' );
+?>
+
+	<li<?php if ( !bp_action_variable( 0 ) || bp_is_action_variable( 'recently-active', 0 ) ) : ?> class="current"<?php endif; ?>><a href="<?php echo trailingslashit( bp_displayed_user_domain() . bp_get_friends_slug() . '/my-friends/recently-active' ) ?>"><?php _e( 'Recently Active', 'buddypress' ) ?></a></li>
+	<li<?php if ( bp_is_action_variable( 'newest', 0 ) ) : ?> class="current"<?php endif; ?>><a href="<?php echo trailingslashit( bp_displayed_user_domain() . bp_get_friends_slug() . '/my-friends/newest' ) ?>"><?php _e( 'Newest', 'buddypress' ) ?></a></li>
+	<li<?php if ( bp_is_action_variable( 'alphabetically', 0 ) ) : ?> class="current"<?php endif; ?>><a href="<?php echo trailingslashit( bp_displayed_user_domain() . bp_get_friends_slug() . '/my-friends/alphabetically' ) ?>"><?php _e( 'Alphabetically', 'buddypress' ) ?></a></li>
+
+<?php
+	do_action( 'friends_header_tabs' );
+}
+
+/**
+ * Filters the title for the Friends component
+ *
+ * @deprecated 1.6
+ * @deprecated No longer used
+ */
+function bp_friends_filter_title() {
+	_deprecated_function( __FUNCTION__, '1.6', 'Since BuddyPress 1.2, BP has not supported ordering of friend lists by URL parameters.' );
+
+	$current_filter = bp_action_variable( 0 );
+
+	switch ( $current_filter ) {
+		case 'recently-active': default:
+			_e( 'Recently Active', 'buddypress' );
+			break;
+		case 'newest':
+			_e( 'Newest', 'buddypress' );
+			break;
+		case 'alphabetically':
+			_e( 'Alphabetically', 'buddypress' );
+			break;
+	}
+}
+
+
+/**
+ * Groups functions
+ */
+
+/**
+ * @deprecated 1.6
+ * @deprecated Renamed to groups_get_id() for greater consistency
+ */
+function groups_check_group_exists( $group_slug ) {
+	_deprecated_function( __FUNCTION__, '1.6', 'groups_get_id()' );
+	return groups_get_id( $group_slug );
+}
+
+/**
+ * Admin functions
+ */
+
+/**
+ * Loads admin panel styles and scripts.
+ *
+ * @deprecated 1.6
+ * @deprecated No longer used.
+ */
+function bp_core_add_admin_menu_styles() {
+	_deprecated_function( __FUNCTION__, '1.6' );
+}
+
+/**
+ * Activity functions
+ */
+
+/**
+ * @deprecated 1.6
+ * @deprecated No longer used. Renamed to bp_activity_register_activity_actions().
+ */
+function updates_register_activity_actions() {
+	_deprecated_function( __FUNCTION__, '1.6' );
+}
+
+/**
+ * Sets the "From" address in emails sent
+ *
+ * @deprecated 1.6
+ * @deprecated No longer used.
+ * @return noreply@sitedomain email address
+ */
+function bp_core_email_from_address_filter() {
+	_deprecated_function( __FUNCTION__, '1.6' );
+
+	$domain = (array) explode( '/', site_url() );
+	return apply_filters( 'bp_core_email_from_address_filter', 'noreply@' . $domain[2] );
+}
+
+/**
+ * Backward compatibility for AJAX callbacks that do not die() on their own
+ *
+ * In BuddyPress 1.6, BP was altered so that it uses admin-ajax.php (instead of wp-load.php) for
+ * AJAX requests. admin-ajax.php dies with an output of '0' (to signify an error), so that if an
+ * AJAX callback does not kill PHP execution, a '0' character will be erroneously appended to the
+ * output. All bp-default AJAX callbacks (/bp-themes/bp-default/_inc/ajax.php) have been updated
+ * for BP 1.6 so that they die() properly; any theme that dynamically includes this file will
+ * inherit the fixes. However, any theme that contains a copy of BP's pre-1.5 ajax.php file will
+ * continue to witness the 'trailing "0"' problem.
+ *
+ * This function provides a backward compatible workaround for these themes, by hooking to the
+ * BP wp_ajax_ actions that were problematic prior to BP 1.6, and killing PHP execution with die().
+ *
+ * Note that this hack only runs if the function bp_dtheme_register_actions() is not found (this
+ * function was introduced in BP 1.6 for related backward compatibility reasons).
+ */
+if ( !function_exists( 'bp_dtheme_register_actions' ) ) :
+	function bp_die_legacy_ajax_callbacks() {
+
+		// This is a list of the BP wp_ajax_ hook suffixes whose associated functions did
+		// not die properly before BP 1.6
+		$actions = array(
+			// Directory template loaders
+			'members_filter',
+			'groups_filter',
+			'blogs_filter',
+			'forums_filter',
+			'messages_filter',
+
+			// Activity
+			'activity_widget_filter',
+			'activity_get_older_updates',
+			'post_update',
+			'new_activity_comment',
+			'delete_activity',
+			'delete_activity_comment',
+			'spam_activity',
+			'spam_activity_comment',
+			'activity_mark_fav',
+			'activity_mark_unfav',
+
+			// Groups
+			'groups_invite_user',
+			'joinleave_group',
+
+			// Members
+			'addremove_friend',
+			'accept_friendship',
+			'reject_friendship',
+
+			// Messages
+			'messages_close_notice',
+			'messages_send_reply',
+			'messages_markunread',
+			'messages_markread',
+			'messages_delete',
+			'messages_autocomplete_results'
+		);
+
+		// For each of the problematic hooks, exit at the very end of execution
+		foreach( $actions as $action ) {
+			add_action( 'wp_ajax_'        . $action, create_function( '', 'exit;' ), 9999 );
+			add_action( 'wp_ajax_nopriv_' . $action, create_function( '', 'exit;' ), 9999 );
+		}
+	}
+	add_action( 'after_setup_theme', 'bp_die_legacy_ajax_callbacks', 20 );
+endif;
+?>
\ No newline at end of file
diff --git a/wp-content/plugins/buddypress/bp-forums/bp-forums-admin.php b/wp-content/plugins/buddypress/bp-forums/bp-forums-admin.php
index 3e96bd53abbd7c2cd7595ae037592a2ecde12378..6e4fc2a61e1b1bfc48b226f42ae9367214317027 100644
--- a/wp-content/plugins/buddypress/bp-forums/bp-forums-admin.php
+++ b/wp-content/plugins/buddypress/bp-forums/bp-forums-admin.php
@@ -8,15 +8,37 @@ function bp_forums_add_admin_menu() {
 	if ( !is_super_admin() )
 		return false;
 
+	$page  = bp_core_do_network_admin()  ? 'settings.php' : 'options-general.php';
+
 	// Add the administration tab under the "Site Admin" tab for site administrators
-	$hook = add_submenu_page( 'bp-general-settings', __( 'Forums', 'buddypress' ), __( 'Forums', 'buddypress' ), 'manage_options', 'bb-forums-setup', "bp_forums_bbpress_admin" );
-	add_action( "admin_print_styles-$hook", 'bp_core_add_admin_menu_styles' );
+	$hook = add_submenu_page( $page, __( 'Forums', 'buddypress' ), __( 'Forums', 'buddypress' ), 'manage_options', 'bb-forums-setup', "bp_forums_bbpress_admin" );
+
+	// Fudge the highlighted subnav item when on the BuddyPress Forums admin page
+	add_action( "admin_head-$hook", 'bp_core_modify_admin_menu_highlight' );
 }
 add_action( bp_core_admin_hook(), 'bp_forums_add_admin_menu' );
 
+/**
+ * Outputs the markup for the bb-forums-admin panel
+ */
 function bp_forums_bbpress_admin() {
 	global $bp;
 
+	// The text and URL of the Site Wide Forums button differs depending on whether bbPress
+	// is running
+	if ( is_plugin_active( 'bbpress/bbpress.php' ) ) {
+		// The bbPress admin page will always be on the root blog. switch_to_blog() will
+		// pass through if we're already there.
+		switch_to_blog( bp_get_root_blog_id() );
+		$button_url = admin_url( add_query_arg( array( 'page' => 'bbpress' ), 'options-general.php' ) );
+		restore_current_blog();
+
+		$button_text = __( 'Configure Site Wide Forums', 'buddypress' );
+	} else {
+		$button_url = bp_get_admin_url( add_query_arg( array( 'tab' => 'plugin-information', 'plugin' => 'bbpress', 'TB_iframe' => 'true', 'width' => '640', 'height' => '500' ), 'plugin-install.php' ) );
+		$button_text = __( 'Install Site Wide Forums', 'buddypress' );
+	}
+
 	$action = bp_get_admin_url( 'admin.php?page=bb-forums-setup&reinstall=1' ); ?>
 
 	<div class="wrap">
@@ -73,22 +95,42 @@ function bp_forums_bbpress_admin() {
 					<li><?php _e( 'Activity Stream Integration', 'buddypress' ); ?></p></li>
 					<li><?php _e( '@ Mention Integration',       'buddypress' ); ?></p></li>
 				</ul>
+
 				<div>
-					<a class="button thickbox button-primary" href="<?php bp_admin_url( add_query_arg( array( 'tab' => 'plugin-information', 'plugin' => 'bbpress', 'TB_iframe' => 'true', 'width' => '640', 'height' => '500' ), 'plugin-install.php' ) ); ?>"><?php _e( 'Install Site Wide Forums', 'buddypress' ) ?></a> &nbsp;
+					<a class="button thickbox button-primary" href="<?php echo esc_attr( $button_url ) ?>"><?php echo esc_html( $button_text ) ?></a> &nbsp;
 				</div>
 			</div>
 
 		<?php endif; ?>
 
+		<p class="clear description"><?php printf( __( 'Need help deciding between Group Forums and Site Wide Forums? Visit <a href="%s">the BuddyPress codex</a> for more information.', 'buddypress' ), 'http://codex.buddypress.org/getting-started/installing-group-and-sitewide-forums/' ) ?></p>
 	</div>
 <?php
 }
 
 function bp_forums_bbpress_install_wizard() {
-	$post_url = network_admin_url( 'admin.php?page=bb-forums-setup' );
+	$post_url                 = network_admin_url( 'admin.php?page=bb-forums-setup' );
+	$bbpress_plugin_is_active = false;
 
 	$step = isset( $_REQUEST['step'] ) ? $_REQUEST['step'] : '';
 
+	// The text and URL of the Site Wide Forums button differs depending on whether bbPress
+	// is running
+	if ( is_plugin_active( 'bbpress/bbpress.php' ) ) {
+		$bbpress_plugin_is_active = true;
+
+		// The bbPress admin page will always be on the root blog. switch_to_blog() will
+		// pass through if we're already there.
+		switch_to_blog( bp_get_root_blog_id() );
+		$button_url = admin_url( add_query_arg( array( 'page' => 'bbpress' ), 'options-general.php' ) );
+		restore_current_blog();
+
+		$button_text = __( 'Configure Site Wide Forums', 'buddypress' );
+	} else {
+		$button_url = bp_get_admin_url( add_query_arg( array( 'tab' => 'plugin-information', 'plugin' => 'bbpress', 'TB_iframe' => 'true', 'width' => '640', 'height' => '500' ), 'plugin-install.php' ) );
+		$button_text = __( 'Install Site Wide Forums', 'buddypress' );
+	}
+
 	switch( $step ) {
 		case 'existing':
 			if ( isset( $_REQUEST['doinstall'] ) && ( 1 == (int) $_REQUEST['doinstall'] ) ) {
@@ -192,7 +234,7 @@ function bp_forums_bbpress_install_wizard() {
 						<li><?php _e( '@ Mention Integration',       'buddypress' ); ?></p></li>
 					</ul>
 					<div>
-						<a class="button thickbox button-primary" href="<?php bp_admin_url( add_query_arg( array( 'tab' => 'plugin-information', 'plugin' => 'bbpress', 'TB_iframe' => 'true', 'width' => '640', 'height' => '500' ), 'plugin-install.php' ) ); ?>"><?php _e( 'Install Site Wide Forums', 'buddypress' ) ?></a> &nbsp;
+						<a class="button button-primary <?php if ( ! $bbpress_plugin_is_active ) { echo esc_attr( 'thickbox' ); }?>" href="<?php echo esc_attr( $button_url ) ?>"><?php echo esc_html( $button_text ) ?></a> &nbsp;
 					</div>
 				</div>
 
@@ -218,21 +260,26 @@ function bp_forums_configure_existing_install() {
 
 	bp_update_option( 'bb-config-location', $_REQUEST['bbconfigloc'] );
 
-	if ( !file_exists( $_REQUEST['bbconfigloc'] ) )
+	if ( !file_exists( $_REQUEST['bbconfigloc'] ) ) {
 		return false;
+	}
 
 	return true;
 }
 
-function bp_forums_bbpress_install() {
+function bp_forums_bbpress_install( $location = '' ) {
 	global $wpdb, $bbdb, $bp;
 
 	check_admin_referer( 'bp_forums_new_install_init' );
 
+	if ( empty( $location ) ) {
+		$location = ABSPATH . 'bb-config.php';
+	}
+
 	// Create the bb-config.php file
 	$initial_write = bp_forums_bbpress_write(
 		BP_PLUGIN_DIR . '/bp-forums/bbpress/bb-config-sample.php',
-		ABSPATH . 'bb-config.php',
+		$location,
 		array(
 			"define( 'BBDB_NAME',"  => array( "'bbpress'",                     	"'" . DB_NAME . "'" ),
 			"define( 'BBDB_USER',"  => array( "'username'",                    	"'" . DB_USER . "'" ),
@@ -250,57 +297,66 @@ function bp_forums_bbpress_install() {
 	);
 
 	// Add the custom user and usermeta entries to the config file
-	if ( $initial_write == 1 )
-		$file = file_get_contents( ABSPATH . 'bb-config.php' );
-	else
+	if ( $initial_write == 1 ) {
+		$file = file_get_contents( $location );
+	} else {
 		$file = &$initial_write;
+	}
 
 	$file = trim( $file );
-	if ( '?>' == substr( $file, -2, 2 ) )
+	if ( '?>' == substr( $file, -2, 2 ) ) {
 		$file = substr( $file, 0, -2 );
+	}
 
 	$file .= "\n" .   '$bb->custom_user_table = \'' . $wpdb->users . '\';';
 	$file .= "\n" .   '$bb->custom_user_meta_table = \'' . $wpdb->usermeta . '\';';
 	$file .= "\n\n" . '$bb->uri = \'' . BP_PLUGIN_URL . '/bp-forums/bbpress/\';';
 	$file .= "\n" .   '$bb->name = \'' . get_blog_option( bp_get_root_blog_id(), 'blogname' ) . ' ' . __( 'Forums', 'buddypress' ) . '\';';
 
-	if ( is_multisite() )
+	if ( is_multisite() ) {
 		$file .= "\n" .   '$bb->wordpress_mu_primary_blog_id = ' . bp_get_root_blog_id() . ';';
+	}
 
-	if ( defined( 'AUTH_SALT' ) )
+	if ( defined( 'AUTH_SALT' ) ) {
 		$file .= "\n\n" . 'define(\'BB_AUTH_SALT\', \'' . addslashes( AUTH_SALT ) . '\');';
+	}
 
-	if ( defined( 'LOGGED_IN_SALT' ) )
+	if ( defined( 'LOGGED_IN_SALT' ) ) {
 		$file .= "\n" .   'define(\'BB_LOGGED_IN_SALT\', \'' . addslashes( LOGGED_IN_SALT ) . '\');';
+	}
 
-	if ( defined( 'SECURE_AUTH_SALT' ) )
+	if ( defined( 'SECURE_AUTH_SALT' ) ) {
 		$file .= "\n" .   'define(\'BB_SECURE_AUTH_SALT\', \'' . addslashes( SECURE_AUTH_SALT ) . '\');';
+	}
 
 	$file .= "\n\n" . 'define(\'WP_AUTH_COOKIE_VERSION\', 2);';
 	$file .= "\n\n" . '?>';
 
 	if ( $initial_write == 1 ) {
-		$file_handle = fopen( ABSPATH . 'bb-config.php', 'w' );
+		$file_handle = fopen( $location, 'w' );
 		fwrite( $file_handle, $file );
 		fclose( $file_handle );
 	} else {
 		$initial_write = $file;
 	}
 
-	bp_update_option( 'bb-config-location', ABSPATH . 'bb-config.php' );
+	bp_update_option( 'bb-config-location', $location );
 	return $initial_write;
 }
 
 function bp_forums_bbpress_write( $file_source, $file_target, $alterations ) {
 
-	if ( !$file_source || !file_exists( $file_source ) || !is_file( $file_source ) )
+	if ( empty( $file_source ) || !file_exists( $file_source ) || !is_file( $file_source ) ) {
 		return -1;
+	}
 
-	if ( !$file_target )
+	if ( empty( $file_target ) ) {
 		$file_target = $file_source;
+	}
 
-	if ( !$alterations || !is_array( $alterations ) )
+	if ( empty( $alterations ) || !is_array( $alterations ) ) {
 		return -2;
+	}
 
 	// Get the existing lines in the file
 	$lines = file( $file_source );
@@ -309,7 +365,7 @@ function bp_forums_bbpress_write( $file_source, $file_target, $alterations ) {
 	$modified_lines = array();
 
 	// Loop through the lines and modify them
-	foreach ( (array)$lines as $line ) {
+	foreach ( (array) $lines as $line ) {
 		if ( isset( $alterations[substr( $line, 0, 20 )] ) ) {
 			$alteration = $alterations[substr( $line, 0, 20 )];
 			$modified_lines[] = str_replace( $alteration[0], $alteration[1], $line );
@@ -335,17 +391,19 @@ function bp_forums_bbpress_write( $file_source, $file_target, $alterations ) {
 		}
 	}
 
-	if ( empty( $writable ) )
+	if ( empty( $writable ) ) {
 		return trim( join( null, $modified_lines ) );
+	}
 
 	// Open the file for writing - rewrites the whole file
 	$file_handle = fopen( $file_target, 'w' );
 
 	// Write lines one by one to avoid OS specific newline hassles
-	foreach ( (array)$modified_lines as $modified_line ) {
-		if ( false !== strpos( $modified_line, '?>' ) ) {
+	foreach ( (array) $modified_lines as $modified_line ) {
+		if ( strlen( $modified_line ) - 2 === strrpos( $modified_line, '?>' ) ) {
 			$modified_line = '?>';
 		}
+
 		fwrite( $file_handle, $modified_line );
 		if ( $modified_line == '?>' ) {
 			break;
@@ -360,4 +418,4 @@ function bp_forums_bbpress_write( $file_source, $file_target, $alterations ) {
 	return 1;
 }
 
-?>
+?>
\ No newline at end of file
diff --git a/wp-content/plugins/buddypress/bp-forums/bp-forums-bbpress-sa.php b/wp-content/plugins/buddypress/bp-forums/bp-forums-bbpress-sa.php
index 1c700d8419cfa3c916861f4bb1aa28819b021b49..d8d0eede302b9d280624c5e0f8a60a3b1ccf129c 100644
--- a/wp-content/plugins/buddypress/bp-forums/bp-forums-bbpress-sa.php
+++ b/wp-content/plugins/buddypress/bp-forums/bp-forums-bbpress-sa.php
@@ -16,7 +16,7 @@ function bp_forums_load_bbpress() {
 
 	define( 'BB_PATH', BP_PLUGIN_DIR . '/bp-forums/bbpress/' );
 	define( 'BACKPRESS_PATH', BP_PLUGIN_DIR . '/bp-forums/bbpress/bb-includes/backpress/' );
-	define( 'BB_URL', BP_PLUGIN_URL . '/bp-forums/bbpress/' );
+	define( 'BB_URL', BP_PLUGIN_URL . 'bp-forums/bbpress/' );
 	define( 'BB_INC', 'bb-includes/' );
 
 	require( BB_PATH . BB_INC . 'class.bb-query.php' );
@@ -39,7 +39,7 @@ function bp_forums_load_bbpress() {
 	require( BB_PATH . 'bb-admin/includes/functions.bb-admin.php' );
 
 	$bb = new stdClass();
-	require( $bp->forums->bbconfig );
+	require( bp_get_option(	'bb-config-location' ) );
 
 	// Setup the global database connection
 	$bbdb = new BPDB ( BBDB_USER, BBDB_PASSWORD, BBDB_NAME, BBDB_HOST );
@@ -100,8 +100,8 @@ function bp_forums_load_bbpress() {
 
 		// Set the site admins as the keymasters
 		$site_admins = get_site_option( 'site_admins', array('admin') );
-		foreach ( (array)$site_admins as $site_admin )
-			update_user_meta( bp_core_get_userid( $site_admin ), $bb_table_prefix . 'capabilities', array( 'keymaster' => true ) );
+		foreach ( (array) $site_admins as $site_admin )
+			bp_update_user_meta( bp_core_get_userid( $site_admin ), $bb_table_prefix . 'capabilities', array( 'keymaster' => true ) );
 
 		// Create the first forum.
 		bb_new_forum( array( 'forum_name' => 'Default Forum' ) );
@@ -128,7 +128,7 @@ class BP_Forums_BB_Auth {
 		$args = wp_parse_args( $args, $defaults );
 		extract( $args, EXTR_SKIP );
 
-		return update_user_meta( $id, $meta_key, $meta_value );
+		return bp_update_user_meta( $id, $meta_key, $meta_value );
 	}
 }
 
@@ -144,10 +144,6 @@ if ( ! class_exists( 'BPDB' ) ) :
 	class BPDB extends WPDB {
 		var $db_servers = array();
 
-		function BPDB( $dbuser, $dbpassword, $dbname, $dbhost ) {
-			$this->__construct( $dbuser, $dbpassword, $dbname, $dbhost );
-		}
-
 		function __construct( $dbuser, $dbpassword, $dbname, $dbhost ) {
 			parent::__construct( $dbuser, $dbpassword, $dbname, $dbhost );
 
diff --git a/wp-content/plugins/buddypress/bp-forums/bp-forums-filters.php b/wp-content/plugins/buddypress/bp-forums/bp-forums-filters.php
index 008dc534f069e12f0dc1273f652ad8bff758f36b..4a16166f6b5ffc6d348858ee0360ad29afdf5404 100644
--- a/wp-content/plugins/buddypress/bp-forums/bp-forums-filters.php
+++ b/wp-content/plugins/buddypress/bp-forums/bp-forums-filters.php
@@ -148,16 +148,14 @@ add_filter( 'bp_get_the_topic_text', 'bp_forums_strip_mentions_on_post_edit' );
  * This filter is added in bp_has_forum_topics()
  *
  * @package BuddyPress
- * @since 1.5
+ * @since BuddyPress (1.5)
  *
  * @global object $wpdb The WordPress database global
  * @param string $sql
  * @return string $sql
  */
 function bp_forums_add_replied_distinct_sql( $sql ) {
-	global $wpdb;
-
-	$sql = $wpdb->prepare( "DISTINCT t.topic_id, " );
+	$sql = "DISTINCT t.topic_id, ";
 
 	return $sql;
 }
@@ -168,7 +166,7 @@ function bp_forums_add_replied_distinct_sql( $sql ) {
  * This filter is added in bp_has_forum_topics()
  *
  * @package BuddyPress
- * @since 1.5
+ * @since BuddyPress (1.5)
  *
  * @global object $bbdb The bbPress database global
  * @global object $wpdb The WordPress database global
@@ -176,9 +174,9 @@ function bp_forums_add_replied_distinct_sql( $sql ) {
  * @return string $sql
  */
 function bp_forums_add_replied_join_sql( $sql ) {
-	global $bbdb, $wpdb;
+	global $bbdb;
 
-	$sql .= $wpdb->prepare( " LEFT JOIN $bbdb->posts p ON p.topic_id = t.topic_id " );
+	$sql .= " LEFT JOIN $bbdb->posts p ON p.topic_id = t.topic_id ";
 
 	return $sql;
 }
@@ -189,7 +187,7 @@ function bp_forums_add_replied_join_sql( $sql ) {
  * This filter is added in bp_has_forum_topics()
  *
  * @package BuddyPress
- * @since 1.5
+ * @since BuddyPress (1.5)
  *
  * @global object $wpdb The WordPress database global
  * @param string $sql
diff --git a/wp-content/plugins/buddypress/bp-forums/bp-forums-functions.php b/wp-content/plugins/buddypress/bp-forums/bp-forums-functions.php
index e56911c0cb941b02678cdc42a27b1ba9ec79cdf1..5085d491f38562112c3db8ac2818ce4cb47cabeb 100644
--- a/wp-content/plugins/buddypress/bp-forums/bp-forums-functions.php
+++ b/wp-content/plugins/buddypress/bp-forums/bp-forums-functions.php
@@ -1,7 +1,38 @@
 <?php
+
 // Exit if accessed directly
 if ( !defined( 'ABSPATH' ) ) exit;
 
+/** bbPress 2.x ***************************************************************/
+
+/**
+ * Used to see if bbPress 2.x is installed and active
+ *
+ * @since BuddyPress (1.6)
+ * @return boolean True if bbPress 2.x is active, false if not
+ */
+function bp_forums_is_bbpress_active() {
+
+	// Single site
+	if ( is_plugin_active( 'bbpress/bbpress.php' ) )
+		return true;
+
+	// Network active
+	if ( is_plugin_active_for_network( 'bbpress/bbpress.php' ) )
+		return true;
+
+	// Nope
+	return false;
+}
+
+/** bbPress 1.x ***************************************************************/
+
+/**
+ * If the bb-config-location option exists, bbPress 1.x was previously installed
+ *
+ * @since BuddyPress (1.2)
+ * @return boolean True if option exists, false if not
+ */
 function bp_forums_is_installed_correctly() {
 	global $bp;
 
@@ -14,9 +45,9 @@ function bp_forums_is_installed_correctly() {
 /**
  * Checks $bp pages global and looks for directory page
  *
- * @since 1.5
+ * @since BuddyPress (1.5)
  *
- * @global object $bp Global BuddyPress settings object
+ * @global BuddyPress $bp The one true BuddyPress instance
  * @return bool True if set, False if empty
  */
 function bp_forums_has_directory() {
@@ -65,8 +96,18 @@ function bp_forums_update_forum( $args = '' ) {
 	$r = wp_parse_args( $args, $defaults );
 	extract( $r, EXTR_SKIP );
 
-	return bb_update_forum( array( 'forum_id' => (int)$forum_id, 'forum_name' => stripslashes( $forum_name ), 'forum_desc' => stripslashes( $forum_desc ), 'forum_slug' => stripslashes( $forum_slug ), 'forum_parent' => $forum_parent_id, 'forum_order' => $forum_order, 'forum_is_category' => $forum_is_category ) );
+	return bb_update_forum( array( 'forum_id' => (int) $forum_id, 'forum_name' => stripslashes( $forum_name ), 'forum_desc' => stripslashes( $forum_desc ), 'forum_slug' => stripslashes( $forum_slug ), 'forum_parent' => $forum_parent_id, 'forum_order' => $forum_order, 'forum_is_category' => $forum_is_category ) );
+}
+
+function bp_forums_delete_group_forum( $group_id ) {
+	$forum_id = groups_get_groupmeta( $group_id, 'forum_id' );
+
+	if ( !empty( $forum_id ) && is_int( $forum_id ) ) {
+		do_action( 'bbpress_init' );
+		bb_delete_forum( $forum_id );
+	}
 }
+add_action( 'groups_delete_group', 'bp_forums_delete_group_forum' );
 
 /** Topic Functions ***********************************************************/
 
@@ -146,9 +187,9 @@ function bp_forums_new_topic( $args = '' ) {
 		'topic_title'            => '',
 		'topic_slug'             => '',
 		'topic_text'             => '',
-		'topic_poster'           => $bp->loggedin_user->id,       // accepts ids
+		'topic_poster'           => bp_loggedin_user_id(),       // accepts ids
 		'topic_poster_name'      => $bp->loggedin_user->fullname, // accept names
-		'topic_last_poster'      => $bp->loggedin_user->id,       // accepts ids
+		'topic_last_poster'      => bp_loggedin_user_id(),       // accepts ids
 		'topic_last_poster_name' => $bp->loggedin_user->fullname, // accept names
 		'topic_start_time'       => bp_core_current_time(),
 		'topic_time'             => bp_core_current_time(),
@@ -168,13 +209,13 @@ function bp_forums_new_topic( $args = '' ) {
 	if ( empty( $topic_poster ) )
 		return false;
 
-	if ( bp_core_is_user_spammer( $topic_poster ) || bp_core_is_user_deleted( $topic_poster ) )
+	if ( bp_is_user_inactive( $topic_poster ) )
 		return false;
 
 	if ( empty( $topic_slug ) )
 		$topic_slug = sanitize_title( $topic_title );
 
-	if ( !$topic_id = bb_insert_topic( array( 'topic_title' => stripslashes( $topic_title ), 'topic_slug' => $topic_slug, 'topic_poster' => $topic_poster, 'topic_poster_name' => $topic_poster_name, 'topic_last_poster' => $topic_last_poster, 'topic_last_poster_name' => $topic_last_poster_name, 'topic_start_time' => $topic_start_time, 'topic_time' => $topic_time, 'topic_open' => $topic_open, 'forum_id' => (int)$forum_id, 'tags' => $topic_tags ) ) )
+	if ( !$topic_id = bb_insert_topic( array( 'topic_title' => stripslashes( $topic_title ), 'topic_slug' => $topic_slug, 'topic_poster' => $topic_poster, 'topic_poster_name' => $topic_poster_name, 'topic_last_poster' => $topic_last_poster, 'topic_last_poster_name' => $topic_last_poster_name, 'topic_start_time' => $topic_start_time, 'topic_time' => $topic_time, 'topic_open' => $topic_open, 'forum_id' => (int) $forum_id, 'tags' => $topic_tags ) ) )
 		return false;
 
 	// Now insert the first post.
@@ -202,7 +243,7 @@ function bp_forums_update_topic( $args = '' ) {
 	extract( $r, EXTR_SKIP );
 
 	// Check if the user is a spammer 
-	if ( bp_core_is_user_spammer( $bp->loggedin_user->id ) || bp_core_is_user_deleted( $bp->loggedin_user->id ) ) 
+	if ( bp_is_user_inactive( bp_loggedin_user_id() ) ) 
 		return false;
 
 	// bb_insert_topic() will append tags, but not remove them. So we remove all existing tags.
@@ -291,8 +332,8 @@ function bp_forums_total_topic_count() {
 			$groups_table_sql = '';
 			$groups_where_sql = "t.topic_status = 0";
 		}
-		$count = $bbdb->get_results( $bbdb->prepare( "SELECT t.topic_id FROM {$bbdb->topics} AS t {$groups_table_sql} WHERE {$groups_where_sql}" ) );
-		$count = count( (array)$count );
+		$count = $bbdb->get_results( "SELECT t.topic_id FROM {$bbdb->topics} AS t {$groups_table_sql} WHERE {$groups_where_sql}" );
+		$count = count( (array) $count );
 	} else {
 		$count = 0;
 	}
@@ -300,6 +341,38 @@ function bp_forums_total_topic_count() {
 	return apply_filters( 'bp_forums_total_topic_count', $count );
 }
 
+/**
+ * Check to see whether a user has already left this particular reply on a given post.
+ * Prevents dupes.
+ *
+ * @since 1.6
+ *
+ * @param str $text The text of the comment
+ * @param int $topic_id The topic id
+ * @param int $user_id The user id
+ */
+function bp_forums_reply_exists( $text = '', $topic_id = 0, $user_id = 0 ) {
+	$reply_exists = false;
+	
+	if ( $text && $topic_id && $user_id ) {
+		do_action( 'bbpress_init' );
+		
+		$args = array(
+			'post_author_id' => $user_id,
+			'topic_id'       => $topic_id
+		);
+		
+		// BB_Query's post_text parameter does a MATCH, while we need exact matches
+		add_filter( 'get_posts_where', create_function( '$q', 'return $q . " AND p.post_text = \'' . $text . '\'";' ) );
+		
+		$query = new BB_Query( 'post', $args );
+		
+		$reply_exists = !empty( $query->results );
+	}
+	
+	return apply_filters( 'bp_forums_reply_exists', $reply_exists, $text, $topic_id, $user_id );
+}
+
 /**
  * Get a total "Topics Started" count for a given user
  *
@@ -315,7 +388,7 @@ function bp_forums_total_topic_count_for_user( $user_id = 0, $type = 'active' )
 	do_action( 'bbpress_init' );
 
 	if ( !$user_id )
-		$user_id = ( $bp->displayed_user->id ) ? $bp->displayed_user->id : $bp->loggedin_user->id;
+		$user_id = ( bp_displayed_user_id() ) ? bp_displayed_user_id() : bp_loggedin_user_id();
 
 	if ( class_exists( 'BB_Query' ) ) {
 		$args = array(
@@ -344,7 +417,7 @@ function bp_forums_total_topic_count_for_user( $user_id = 0, $type = 'active' )
  * Uses an unfortunate technique to count unique topics, due to limitations in BB_Query.
  *
  * @package BuddyPress
- * @since 1.5
+ * @since BuddyPress (1.5)
  *
  * @param int $user_id Defaults to displayed user, then to logged-in user
  * @return int $count
@@ -393,13 +466,13 @@ function bp_forums_get_topic_extras( $topics ) {
 		return $topics;
 
 	// Get the topic ids
-	foreach ( (array)$topics as $topic ) $topic_ids[] = $topic->topic_id;
-	$topic_ids = $wpdb->escape( join( ',', (array)$topic_ids ) );
+	foreach ( (array) $topics as $topic ) $topic_ids[] = $topic->topic_id;
+	$topic_ids = $wpdb->escape( join( ',', (array) $topic_ids ) );
 
 	// Fetch the topic's last poster details
-	$poster_details = $wpdb->get_results( $wpdb->prepare( "SELECT t.topic_id, t.topic_last_poster, u.user_login, u.user_nicename, u.user_email, u.display_name FROM {$wpdb->users} u, {$bbdb->topics} t WHERE u.ID = t.topic_last_poster AND t.topic_id IN ( {$topic_ids} )" ) );
+	$poster_details = $wpdb->get_results( "SELECT t.topic_id, t.topic_last_poster, u.user_login, u.user_nicename, u.user_email, u.display_name FROM {$wpdb->users} u, {$bbdb->topics} t WHERE u.ID = t.topic_last_poster AND t.topic_id IN ( {$topic_ids} )" );
 	for ( $i = 0, $count = count( $topics ); $i < $count; ++$i ) {
-		foreach ( (array)$poster_details as $poster ) {
+		foreach ( (array) $poster_details as $poster ) {
 			if ( $poster->topic_id == $topics[$i]->topic_id ) {
 				$topics[$i]->topic_last_poster_email       = $poster->user_email;
 				$topics[$i]->topic_last_poster_nicename    = $poster->user_nicename;
@@ -411,9 +484,9 @@ function bp_forums_get_topic_extras( $topics ) {
 
 	// Fetch fullname for the topic's last poster
 	if ( bp_is_active( 'xprofile' ) ) {
-		$poster_names = $wpdb->get_results( $wpdb->prepare( "SELECT t.topic_id, pd.value FROM {$bp->profile->table_name_data} pd, {$bbdb->topics} t WHERE pd.user_id = t.topic_last_poster AND pd.field_id = 1 AND t.topic_id IN ( {$topic_ids} )" ) );
+		$poster_names = $wpdb->get_results( "SELECT t.topic_id, pd.value FROM {$bp->profile->table_name_data} pd, {$bbdb->topics} t WHERE pd.user_id = t.topic_last_poster AND pd.field_id = 1 AND t.topic_id IN ( {$topic_ids} )" );
 		for ( $i = 0, $count = count( $topics ); $i < $count; ++$i ) {
-			foreach ( (array)$poster_names as $name ) {
+			foreach ( (array) $poster_names as $name ) {
 				if ( $name->topic_id == $topics[$i]->topic_id )
 					$topics[$i]->topic_last_poster_displayname = $name->value;
 			}
@@ -422,7 +495,7 @@ function bp_forums_get_topic_extras( $topics ) {
 
 	// Loop through to make sure that each topic has the proper values set. This covers the
 	// case of deleted users
-	foreach ( (array)$topics as $key => $topic ) {
+	foreach ( (array) $topics as $key => $topic ) {
 		if ( !isset( $topic->topic_last_poster_email ) )
 			$topics[$key]->topic_last_poster_email = '';
 
@@ -487,7 +560,7 @@ function bp_forums_insert_post( $args = '' ) {
 		'topic_id'      => false,
 		'post_text'     => '',
 		'post_time'     => bp_core_current_time(),
-		'poster_id'     => $bp->loggedin_user->id, // accepts ids or names
+		'poster_id'     => bp_loggedin_user_id(), // accepts ids or names
 		'poster_ip'     => $_SERVER['REMOTE_ADDR'],
 		'post_status'   => 0, // use bb_delete_post() instead
 		'post_position' => false
@@ -514,7 +587,7 @@ function bp_forums_insert_post( $args = '' ) {
 	if ( empty( $poster_id ) )
 		return false;
 
-	if ( bp_core_is_user_spammer( $bp->loggedin_user->id ) || bp_core_is_user_deleted( $bp->loggedin_user->id ) )
+	if ( bp_is_user_inactive( bp_loggedin_user_id() ) )
 		return false;
 
 	$post_id = bb_insert_post( array( 'post_id' => $post_id, 'topic_id' => $topic_id, 'post_text' => stripslashes( trim( $post_text ) ), 'post_time' => $post_time, 'poster_id' => $poster_id, 'poster_ip' => $poster_ip, 'post_status' => $post_status, 'post_position' => $post_position ) );
@@ -532,18 +605,18 @@ function bp_forums_get_post_extras( $posts ) {
 		return $posts;
 
 	// Get the user ids
-	foreach ( (array)$posts as $post ) $user_ids[] = $post->poster_id;
-	$user_ids = $wpdb->escape( join( ',', (array)$user_ids ) );
+	foreach ( (array) $posts as $post ) $user_ids[] = $post->poster_id;
+	$user_ids = $wpdb->escape( join( ',', (array) $user_ids ) );
 
 	// Fetch the poster's user_email, user_nicename and user_login
-	$poster_details = $wpdb->get_results( $wpdb->prepare( "SELECT u.ID as user_id, u.user_login, u.user_nicename, u.user_email, u.display_name FROM {$wpdb->users} u WHERE u.ID IN ( {$user_ids} )" ) );
+	$poster_details = $wpdb->get_results( "SELECT u.ID as user_id, u.user_login, u.user_nicename, u.user_email, u.display_name FROM {$wpdb->users} u WHERE u.ID IN ( {$user_ids} )" );
 
 	for ( $i = 0, $count = count( $posts ); $i < $count; ++$i ) {
-		foreach ( (array)$poster_details as $poster ) {
+		foreach ( (array) $poster_details as $poster ) {
 			if ( $poster->user_id == $posts[$i]->poster_id ) {
 				$posts[$i]->poster_email    = $poster->user_email;
-				$posts[$i]->poster_login    = $poster->user_nicename;
-				$posts[$i]->poster_nicename = $poster->user_login;
+				$posts[$i]->poster_login    = $poster->user_login;
+				$posts[$i]->poster_nicename = $poster->user_nicename;
 				$posts[$i]->poster_name     = $poster->display_name;
 			}
 		}
@@ -551,9 +624,9 @@ function bp_forums_get_post_extras( $posts ) {
 
 	// Fetch fullname for each poster.
 	if ( bp_is_active( 'xprofile' ) ) {
-		$poster_names = $wpdb->get_results( $wpdb->prepare( "SELECT pd.user_id, pd.value FROM {$bp->profile->table_name_data} pd WHERE pd.user_id IN ( {$user_ids} )" ) );
+		$poster_names = $wpdb->get_results( "SELECT pd.user_id, pd.value FROM {$bp->profile->table_name_data} pd WHERE pd.user_id IN ( {$user_ids} )" );
 		for ( $i = 0, $count = count( $posts ); $i < $count; ++$i ) {
-			foreach ( (array)$poster_names as $name ) {
+			foreach ( (array) $poster_names as $name ) {
 				if ( isset( $topics[$i] ) && $name->user_id == $topics[$i]->user_id )
 				$posts[$i]->poster_name = $poster->value;
 			}
@@ -575,10 +648,10 @@ function bp_forums_get_forum_topicpost_count( $forum_id ) {
 function bp_forums_filter_caps( $allcaps ) {
 	global $bp, $wp_roles, $bb_table_prefix;
 
-	if ( !isset( $bp->loggedin_user->id ) )
+	if ( !bp_loggedin_user_id() )
 		return $allcaps;
 
-	$bb_cap = get_user_meta( $bp->loggedin_user->id, $bb_table_prefix . 'capabilities', true );
+	$bb_cap = bp_get_user_meta( bp_loggedin_user_id(), $bb_table_prefix . 'capabilities', true );
 
 	if ( empty( $bb_cap ) )
 		return $allcaps;
@@ -595,7 +668,7 @@ add_filter( 'user_has_cap', 'bp_forums_filter_caps' );
  * Returns the parent forum id for the bbPress abstraction layer
  *
  * @package BuddyPress
- * @since 1.5
+ * @since BuddyPress (1.5)
  *
  * @return int
  */
@@ -610,7 +683,7 @@ function bp_forums_parent_forum_id() {
  * bp_forums_enable_global_directory_stickies, to change this behavior.
  *
  * @package BuddyPress
- * @since 1.5
+ * @since BuddyPress (1.5)
  *
  * @return bool True if stickies should be displayed at the top of the global directory, false
  *    otherwise.
@@ -643,7 +716,7 @@ add_action( 'bp_forums_new_post',  'bp_core_clear_cache' );
  * @see bp_embed_forum_cache()
  * @see bp_embed_forum_save_cache()
  * @package BuddyPress_Forums
- * @since 1.5
+ * @since BuddyPress (1.5)
  */
 function bp_forums_embed() {
 	add_filter( 'embed_post_id',         'bp_get_the_topic_post_id'         );
@@ -657,7 +730,7 @@ add_action( 'topic_loop_start', 'bp_forums_embed' );
  * Used during {@link BP_Embed::parse_oembed()} via {@link bp_forums_embed()}.
  *
  * @package BuddyPress_Forums
- * @since 1.5
+ * @since BuddyPress (1.5)
  */
 function bp_embed_forum_cache( $cache, $id, $cachekey ) {
 	return bb_get_postmeta( $id, $cachekey );
@@ -668,7 +741,7 @@ function bp_embed_forum_cache( $cache, $id, $cachekey ) {
  * Used during {@link BP_Embed::parse_oembed()} via {@link bp_forums_embed()}.
  *
  * @package BuddyPress_Forums
- * @since 1.5
+ * @since BuddyPress (1.5)
  */
 function bp_embed_forum_save_cache( $cache, $cachekey, $id ) {
 	bb_update_postmeta( $id, $cachekey, $cache );
diff --git a/wp-content/plugins/buddypress/bp-forums/bp-forums-loader.php b/wp-content/plugins/buddypress/bp-forums/bp-forums-loader.php
index d27d881519cd55f10ca9d9733c2a41d3862ba76b..24b9cfef57e44a44012087b923fdcbc66f3cb146 100644
--- a/wp-content/plugins/buddypress/bp-forums/bp-forums-loader.php
+++ b/wp-content/plugins/buddypress/bp-forums/bp-forums-loader.php
@@ -1,4 +1,5 @@
 <?php
+
 /**
  * BuddyPress Forums Loader
  *
@@ -16,7 +17,7 @@ class BP_Forums_Component extends BP_Component {
 	/**
 	 * Start the forums component creation process
 	 *
-	 * @since 1.5
+	 * @since BuddyPress (1.5)
 	 */
 	function __construct() {
 		parent::start(
@@ -32,8 +33,8 @@ class BP_Forums_Component extends BP_Component {
 	 * The BP_FORUMS_SLUG constant is deprecated, and only used here for
 	 * backwards compatibility.
 	 *
-	 * @since 1.5
-	 * @global obj $bp
+	 * @since BuddyPress (1.5)
+	 * @global BuddyPress $bp The one true BuddyPress instance
 	 */
 	function setup_globals() {
 		global $bp;
@@ -53,7 +54,6 @@ class BP_Forums_Component extends BP_Component {
 		// All globals for messaging component.
 		// Note that global_tables is included in this array.
 		$globals = array(
-			'path'                  => BP_PLUGIN_DIR,
 			'slug'                  => BP_FORUMS_SLUG,
 			'root_slug'             => isset( $bp->pages->forums->slug ) ? $bp->pages->forums->slug : BP_FORUMS_SLUG,
 			'has_directory'         => true,
@@ -93,7 +93,7 @@ class BP_Forums_Component extends BP_Component {
 	/**
 	 * Setup BuddyBar navigation
 	 *
-	 * @global obj $bp
+	 * @global BuddyPress $bp The one true BuddyPress instance
 	 */
 	function setup_nav() {
 		global $bp;
@@ -103,7 +103,7 @@ class BP_Forums_Component extends BP_Component {
 			return;
 
 		// Stop if there is no user displayed or logged in
-		if ( !is_user_logged_in() && !isset( $bp->displayed_user->id ) )
+		if ( !is_user_logged_in() && !bp_displayed_user_id() )
 			return;
 
 		// Add 'Forums' to the main navigation
@@ -117,12 +117,10 @@ class BP_Forums_Component extends BP_Component {
 		);
 
 		// Determine user to use
-		if ( isset( $bp->displayed_user->domain ) ) {
-			$user_domain = $bp->displayed_user->domain;
-			$user_login  = $bp->displayed_user->userdata->user_login;
-		} elseif ( isset( $bp->loggedin_user->domain ) ) {
-			$user_domain = $bp->loggedin_user->domain;
-			$user_login  = $bp->loggedin_user->userdata->user_login;
+		if ( bp_displayed_user_domain() ) {
+			$user_domain = bp_displayed_user_domain();
+		} elseif ( bp_loggedin_user_domain() ) {
+			$user_domain = bp_loggedin_user_domain();
 		} else {
 			return;
 		}
@@ -169,9 +167,9 @@ class BP_Forums_Component extends BP_Component {
 	}
 
 	/**
-	 * Set up the admin bar
+	 * Set up the Toolbar
 	 *
-	 * @global obj $bp
+	 * @global BuddyPress $bp The one true BuddyPress instance
 	 */
 	function setup_admin_bar() {
 		global $bp;
@@ -183,9 +181,7 @@ class BP_Forums_Component extends BP_Component {
 		if ( is_user_logged_in() ) {
 
 			// Setup the logged in user variables
-			$user_domain = $bp->loggedin_user->domain;
-			$user_login  = $bp->loggedin_user->userdata->user_login;
-			$forums_link = trailingslashit( $user_domain . $this->slug );
+			$forums_link = trailingslashit( bp_loggedin_user_domain() . $this->slug );
 
 			// Add the "My Account" sub menus
 			$wp_admin_nav[] = array(
@@ -226,7 +222,7 @@ class BP_Forums_Component extends BP_Component {
 	/**
 	 * Sets up the title for pages and <title>
 	 *
-	 * @global obj $bp
+	 * @global BuddyPress $bp The one true BuddyPress instance
 	 */
 	function setup_title() {
 		global $bp;
@@ -237,17 +233,23 @@ class BP_Forums_Component extends BP_Component {
 				$bp->bp_options_title = __( 'Forums', 'buddypress' );
 			} else {
 				$bp->bp_options_avatar = bp_core_fetch_avatar( array(
-					'item_id' => $bp->displayed_user->id,
-					'type'    => 'thumb'
+					'item_id' => bp_displayed_user_id(),
+					'type'    => 'thumb',
+					'alt'     => sprintf( __( 'Profile picture of %s', 'buddypress' ), bp_get_displayed_user_fullname() )
 				) );
-				$bp->bp_options_title  = $bp->displayed_user->fullname;
+				$bp->bp_options_title  = bp_get_displayed_user_fullname();
 			}
 		}
 
 		parent::setup_title();
 	}
 }
-// Create the forums component
-$bp->forums = new BP_Forums_Component();
+
+function bp_setup_forums() {
+	global $bp;
+
+	$bp->forums = new BP_Forums_Component();
+}
+add_action( 'bp_setup_components', 'bp_setup_forums', 6 );
 
 ?>
\ No newline at end of file
diff --git a/wp-content/plugins/buddypress/bp-forums/bp-forums-screens.php b/wp-content/plugins/buddypress/bp-forums/bp-forums-screens.php
index 026b231970feba6827abfa1ad6b4275c56cba631..c2010f9ff01be2562a62dbc3ef609aa79aeec0f7 100644
--- a/wp-content/plugins/buddypress/bp-forums/bp-forums-screens.php
+++ b/wp-content/plugins/buddypress/bp-forums/bp-forums-screens.php
@@ -25,7 +25,7 @@ function bp_forums_directory_forums_setup() {
 			$bp->groups->current_group = groups_get_group( array( 'group_id' => $_POST['topic_group_id'] ) );
 			if ( !empty( $bp->groups->current_group->id ) ) {
 				// Auto join this user if they are not yet a member of this group
-				if ( !is_super_admin() && 'public' == $bp->groups->current_group->status && !groups_is_user_member( $bp->loggedin_user->id, $bp->groups->current_group->id ) )
+				if ( !bp_current_user_can( 'bp_moderate' ) && 'public' == $bp->groups->current_group->status && !groups_is_user_member( bp_loggedin_user_id(), $bp->groups->current_group->id ) )
 					groups_join_group( $bp->groups->current_group->id );
 
 				$error_message = '';
@@ -59,7 +59,7 @@ function bp_forums_directory_forums_setup() {
 
 			}	 else {
 				bp_core_add_message( __( 'Please pick the group forum where you would like to post this topic.', 'buddypress' ), 'error' );
-				bp_core_redirect( add_query_arg( 'new', '', bp_get_forum_directory_permalink() ) );
+				bp_core_redirect( add_query_arg( 'new', '', bp_get_forums_directory_permalink() ) );
 			}
 		}
 
@@ -124,4 +124,4 @@ function bp_forums_screen_single_topic() {
 	bp_core_load_template( apply_filters( 'bp_forums_screen_single_topic', 'forums/single/topic' ) );
 }
 add_action( 'bp_screens', 'bp_forums_screen_single_topic' );
-?>
\ No newline at end of file
+?>
diff --git a/wp-content/plugins/buddypress/bp-forums/bp-forums-template.php b/wp-content/plugins/buddypress/bp-forums/bp-forums-template.php
index 265cd9f30517dc154c7708758d03b063ca4c27f1..527ff65288b06a50bb32e790bafc58e24dc1db07 100644
--- a/wp-content/plugins/buddypress/bp-forums/bp-forums-template.php
+++ b/wp-content/plugins/buddypress/bp-forums/bp-forums-template.php
@@ -7,7 +7,7 @@ if ( !defined( 'ABSPATH' ) ) exit;
  *
  * @package BuddyPress
  * @subpackage Forums Template
- * @since 1.5
+ * @since BuddyPress (1.5)
  *
  * @uses bp_get_forums_slug()
  */
@@ -19,7 +19,7 @@ function bp_forums_slug() {
 	 *
 	 * @package BuddyPress
 	 * @subpackage Forums Template
-	 * @since 1.5
+	 * @since BuddyPress (1.5)
 	 */
 	function bp_get_forums_slug() {
 		global $bp;
@@ -31,7 +31,7 @@ function bp_forums_slug() {
  *
  * @package BuddyPress
  * @subpackage Forums Template
- * @since 1.5
+ * @since BuddyPress (1.5)
  *
  * @uses bp_get_forums_root_slug()
  */
@@ -43,7 +43,7 @@ function bp_forums_root_slug() {
 	 *
 	 * @package BuddyPress
 	 * @subpackage Forums Template
-	 * @since 1.5
+	 * @since BuddyPress (1.5)
 	 */
 	function bp_get_forums_root_slug() {
 		global $bp;
@@ -55,7 +55,7 @@ function bp_forums_root_slug() {
  *
  * @package BuddyPress
  * @subpackage Forums Template
- * @since 1.5
+ * @since BuddyPress (1.5)
  * @uses bp_get_forums_directory_permalink()
  */
 function bp_forums_directory_permalink() {
@@ -66,7 +66,7 @@ function bp_forums_directory_permalink() {
 	 *
 	 * @package BuddyPress
 	 * @subpackage Forums Template
-	 * @since 1.5
+	 * @since BuddyPress (1.5)
 	 * @uses apply_filters()
 	 * @uses traisingslashit()
 	 * @uses bp_get_root_domain()
@@ -97,10 +97,6 @@ class BP_Forums_Template_Forum {
 	var $sort_by;
 	var $order;
 
-	function BP_Forums_Template_Forum( $type, $forum_id, $user_id, $page, $per_page, $max, $no_stickies, $search_terms, $offset = false, $number = false ) {
-		$this->__construct( $type, $forum_id, $user_id, $page, $per_page, $max, $no_stickies, $search_terms, $offset, $number );
-	}
-
 	function __construct( $type, $forum_id, $user_id, $page, $per_page, $max, $no_stickies, $search_terms, $offset = false, $number = false ) {
 		global $bp;
 
@@ -132,7 +128,7 @@ class BP_Forums_Template_Forum {
 
 		$this->topics = apply_filters( 'bp_forums_template_topics', $this->topics, $type, $forum_id, $per_page, $max, $no_stickies );
 
-		if ( !(int)$this->topics ) {
+		if ( !(int) $this->topics ) {
 			$this->topic_count       = 0;
 			$this->total_topic_count = 0;
 		} else {
@@ -141,7 +137,7 @@ class BP_Forums_Template_Forum {
 			if ( !empty( $forum_id ) ) {
 				// Group forums
 				$topic_count = bp_forums_get_forum( $forum_id );
-				$topic_count = (int)$topic_count->topics;
+				$topic_count = (int) $topic_count->topics;
 			} else if ( !empty( $bp->groups->current_group ) ) {
 				$topic_count = (int)groups_total_public_forum_topic_count( $type );
 			} else if ( bp_is_user_forums_started() || ( bp_is_directory() && $user_id ) ) {
@@ -151,23 +147,26 @@ class BP_Forums_Template_Forum {
 			} else if ( bp_is_user_forums_replied_to() ) {
 				// Profile > Forums > Replied To
 				$topic_count = bp_forums_total_replied_count_for_user( bp_displayed_user_id(), $type );
+			} else if ( 'tags' == $type ) {
+				$tag         = bb_get_tag( $search_terms );
+				$topic_count = $tag->count;
 			} else {
 				// For forum directories (All Topics), get a true count
-				$status = is_super_admin() ? 'all' : 'public'; // todo: member-of
+				$status = bp_current_user_can( 'bp_moderate' ) ? 'all' : 'public'; // todo: member-of
 				$topic_count = (int)groups_total_forum_topic_count( $status, $search_terms );
 			}
 
 			if ( !$max || $max >= $topic_count ) {
 				$this->total_topic_count = $topic_count;
 			} else {
-				$this->total_topic_count = (int)$max;
+				$this->total_topic_count = (int) $max;
 			}
 
 			if ( $max ) {
 				if ( $max >= count($this->topics) ) {
 					$this->topic_count = count( $this->topics );
 				} else {
-					$this->topic_count = (int)$max;
+					$this->topic_count = (int) $max;
 				}
 			} else {
 				$this->topic_count = count( $this->topics );
@@ -180,11 +179,11 @@ class BP_Forums_Template_Forum {
 		// Fetch extra information for topics, so we don't have to query inside the loop
 		$this->topics = bp_forums_get_topic_extras( $this->topics );
 
-		if ( (int)$this->total_topic_count && (int)$this->pag_num ) {
+		if ( (int) $this->total_topic_count && (int) $this->pag_num ) {
 			$this->pag_links = paginate_links( array(
 				'base'      => add_query_arg( array( 'p' => '%#%', 'n' => $this->pag_num ) ),
 				'format'    => '',
-				'total'     => ceil( (int)$this->total_topic_count / (int)$this->pag_num),
+				'total'     => ceil( (int) $this->total_topic_count / (int) $this->pag_num),
 				'current'   => $this->pag_page,
 				'prev_text' => _x( '&larr;', 'Forum topic pagination previous text', 'buddypress' ),
 				'next_text' => _x( '&rarr;', 'Forum topic pagination next text', 'buddypress' ),
@@ -268,8 +267,8 @@ function bp_has_forum_topics( $args = '' ) {
 	$do_stickies  = false;
 
 	// User filtering
-	if ( !empty( $bp->displayed_user->id ) )
-		$user_id = $bp->displayed_user->id;
+	if ( bp_displayed_user_id() )
+		$user_id = bp_displayed_user_id();
 
 	// "Replied" query must be manually modified
 	if ( 'replies' == bp_current_action() ) {
@@ -375,13 +374,13 @@ function bp_has_forum_topics( $args = '' ) {
 				// If there are stickies to merge on this page, do it now
 				if ( $this_page_stickies ) {
 					// Correct the topic_count
-					$forum_template->topic_count += (int)$this_page_stickies;
+					$forum_template->topic_count += (int) $this_page_stickies;
 
 					// Figure out which stickies need to be included
 					$this_page_sticky_topics = array_slice( $stickies_template->topics, 0 - $this_page_stickies );
 
 					// Merge these topics into the forum template
-					$forum_template->topics = array_merge( $this_page_sticky_topics, (array)$forum_template->topics );
+					$forum_template->topics = array_merge( $this_page_sticky_topics, (array) $forum_template->topics );
 				}
 			} else {
 				// This page has no non-stickies
@@ -400,7 +399,7 @@ function bp_has_forum_topics( $args = '' ) {
 			$forum_template->pag_links = paginate_links( array(
 				'base'      => add_query_arg( array( 'p' => '%#%', 'n' => $forum_template->pag_num ) ),
 				'format'    => '',
-				'total'     => ceil( (int)$forum_template->total_topic_count / (int)$forum_template->pag_num ),
+				'total'     => ceil( (int) $forum_template->total_topic_count / (int) $forum_template->pag_num ),
 				'current'   => $forum_template->pag_page,
 				'prev_text' => _x( '&larr;', 'Forum topic pagination previous text', 'buddypress' ),
 				'next_text' => _x( '&rarr;', 'Forum topic pagination next text', 'buddypress' ),
@@ -462,7 +461,7 @@ function bp_the_topic_text() {
 	function bp_get_the_topic_text() {
 		global $forum_template;
 
-		$post = bb_get_first_post( (int)$forum_template->topic->topic_id, false );
+		$post = bb_get_first_post( (int) $forum_template->topic->topic_id, false );
 		return apply_filters( 'bp_get_the_topic_text', esc_attr( $post->post_text ) );
 	}
 
@@ -485,7 +484,7 @@ function bp_the_topic_poster_avatar( $args = '' ) {
 			'type'   => 'thumb',
 			'width'  => false,
 			'height' => false,
-			'alt'    => __( 'Profile picture of %s', 'buddypress' )
+			'alt'    => sprintf( __( 'Profile picture of %s', 'buddypress' ), bp_core_get_user_displayname( $forum_template->topic->topic_poster ) )
 		);
 
 		$r = wp_parse_args( $args, $defaults );
@@ -771,16 +770,16 @@ function bp_the_topic_is_mine() {
 	echo bp_get_the_topic_is_mine();
 }
 	function bp_get_the_topic_is_mine() {
-		global $bp, $forum_template;
+		global $forum_template;
 
-		return $bp->loggedin_user->id == $forum_template->topic->topic_poster;
+		return bp_loggedin_user_id() == $forum_template->topic->topic_poster;
 	}
 
 function bp_the_topic_admin_links( $args = '' ) {
 	echo bp_get_the_topic_admin_links( $args );
 }
 	function bp_get_the_topic_admin_links( $args = '' ) {
-		global $bp, $forum_template;
+		global $forum_template;
 
 		$defaults = array(
 			'seperator' => '|'
@@ -791,13 +790,13 @@ function bp_the_topic_admin_links( $args = '' ) {
 
 		$links[] = '<a href="' . wp_nonce_url( bp_get_the_topic_permalink() . 'edit', 'bp_forums_edit_topic' ) . '">' . __( 'Edit Topic', 'buddypress' ) . '</a>';
 
-		if ( $bp->is_item_admin || $bp->is_item_mod || is_super_admin() ) {
-			if ( 0 == (int)$forum_template->topic->topic_sticky )
+		if ( bp_is_item_admin() || bp_is_item_mod() || bp_current_user_can( 'bp_moderate' ) ) {
+			if ( 0 == (int) $forum_template->topic->topic_sticky )
 				$links[] = '<a href="' . wp_nonce_url( bp_get_the_topic_permalink() . 'stick', 'bp_forums_stick_topic' ) . '">' . __( 'Sticky Topic', 'buddypress' ) . '</a>';
 			else
 				$links[] = '<a href="' . wp_nonce_url( bp_get_the_topic_permalink() . 'unstick', 'bp_forums_unstick_topic' ) . '">' . __( 'Un-stick Topic', 'buddypress' ) . '</a>';
 
-			if ( 0 == (int)$forum_template->topic->topic_open )
+			if ( 0 == (int) $forum_template->topic->topic_open )
 				$links[] = '<a href="' . wp_nonce_url( bp_get_the_topic_permalink() . 'open', 'bp_forums_open_topic' ) . '">' . __( 'Open Topic', 'buddypress' ) . '</a>';
 			else
 				$links[] = '<a href="' . wp_nonce_url( bp_get_the_topic_permalink() . 'close', 'bp_forums_close_topic' ) . '">' . __( 'Close Topic', 'buddypress' ) . '</a>';
@@ -820,10 +819,10 @@ function bp_the_topic_css_class() {
 		if ( $forum_template->current_topic % 2 == 1 )
 			$class .= 'alt';
 
-		if ( isset( $forum_template->topic->topic_sticky ) && 1 == (int)$forum_template->topic->topic_sticky )
+		if ( isset( $forum_template->topic->topic_sticky ) && 1 == (int) $forum_template->topic->topic_sticky )
 			$class .= ' sticky';
 
-		if ( !isset( $forum_template->topic->topic_open ) || 0 == (int)$forum_template->topic->topic_open )
+		if ( !isset( $forum_template->topic->topic_open ) || 0 == (int) $forum_template->topic->topic_open )
 			$class .= ' closed';
 
 		return apply_filters( 'bp_get_the_topic_css_class', trim( $class ) );
@@ -882,7 +881,7 @@ function bp_forum_topic_type() {
  * Echoes the output of bp_get_forum_topic_new_reply_link()
  *
  * @package BuddyPress
- * @since 1.5
+ * @since BuddyPress (1.5)
  */
 function bp_forum_topic_new_reply_link() {
 	echo bp_get_forum_topic_new_reply_link();
@@ -891,7 +890,7 @@ function bp_forum_topic_new_reply_link() {
 	 * Returns the permalink for the New Reply button at the top of forum topics
 	 *
 	 * @package BuddyPress
-	 * @since 1.5
+	 * @since BuddyPress (1.5)
 	 *
 	 * @uses apply_filters() Filter bp_get_forum_topic_new_reply_link to modify
 	 * @return str The URL for the New Reply link
@@ -971,7 +970,6 @@ function bp_is_edit_topic() {
 	return true;
 }
 
-
 class BP_Forums_Template_Topic {
 	var $current_post = -1;
 	var $post_count;
@@ -984,6 +982,14 @@ class BP_Forums_Template_Topic {
 
 	var $in_the_loop;
 
+	/**
+	 * Contains a 'total_pages' property holding total number of pages in this loop.
+	 *
+	 * @since BuddyPress (1.2)
+	 * @var stdClass
+	 */
+	public $pag;
+
 	var $pag_page;
 	var $pag_num;
 	var $pag_links;
@@ -994,13 +1000,13 @@ class BP_Forums_Template_Topic {
 	var $sort_by;
 	var $order;
 
-	function BP_Forums_Template_Topic( $topic_id, $per_page, $max, $order ) {
-		$this->__construct( $topic_id, $per_page, $max, $order );
-	}
-
 	function __construct( $topic_id, $per_page, $max, $order ) {
 		global $bp, $current_user, $forum_template;
 
+                if ( !isset( $forum_template ) ) {
+                        $forum_template = new stdClass;
+                }
+
 		$this->pag_page        = isset( $_REQUEST['topic_page'] ) ? intval( $_REQUEST['topic_page'] ) : 1;
 		$this->pag_num         = isset( $_REQUEST['num'] ) ? intval( $_REQUEST['num'] ) : $per_page;
 
@@ -1015,17 +1021,17 @@ class BP_Forums_Template_Topic {
 			$this->post_count       = 0;
 			$this->total_post_count = 0;
 		} else {
-			if ( !$max || $max >= (int)$forum_template->topic->topic_posts ) {
-				$this->total_post_count = (int)$forum_template->topic->topic_posts;
+			if ( !$max || $max >= (int) $forum_template->topic->topic_posts ) {
+				$this->total_post_count = (int) $forum_template->topic->topic_posts;
 			} else {
-				$this->total_post_count = (int)$max;
+				$this->total_post_count = (int) $max;
 			}
 
 			if ( $max ) {
 				if ( $max >= count( $this->posts ) ) {
 					$this->post_count = count( $this->posts );
 				} else {
-					$this->post_count = (int)$max;
+					$this->post_count = (int) $max;
 				}
 			} else {
 				$this->post_count = count( $this->posts );
@@ -1035,18 +1041,20 @@ class BP_Forums_Template_Topic {
 		// Load topic tags
 		$this->topic_tags = bb_get_topic_tags( $this->topic_id );
 
-		if ( (int)$this->total_post_count && (int)$this->pag_num ) {
+		$this->pag = new stdClass;
+
+		if ( (int) $this->total_post_count && (int) $this->pag_num ) {
 			$this->pag_links = paginate_links( array(
-				'base'      => add_query_arg( array( 'topic_page' => '%#%', 'num' => (int)$this->pag_num ) ),
+				'base'      => add_query_arg( array( 'topic_page' => '%#%', 'num' => (int) $this->pag_num ) ),
 				'format'    => '',
-				'total'     => ceil( (int)$this->total_post_count / (int)$this->pag_num ),
+				'total'     => ceil( (int) $this->total_post_count / (int) $this->pag_num ),
 				'current'   => $this->pag_page,
 				'prev_text' => _x( '&larr;', 'Forum thread pagination previous text', 'buddypress' ),
 				'next_text' => _x( '&rarr;', 'Forum thread pagination next text', 'buddypress' ),
 				'mid_size'  => 1
 			) );
 
-			$this->pag->total_pages = ceil( (int)$this->total_post_count / (int)$this->pag_num );
+			$this->pag->total_pages = ceil( (int) $this->total_post_count / (int) $this->pag_num );
 		} else {
 			$this->pag->total_pages = 1;
 		}
@@ -1170,10 +1178,10 @@ function bp_the_topic_post_css_class() {
 		if ( $topic_template->current_post % 2 == 1 )
 			$class .= 'alt';
 
-		if ( 1 == (int)$topic_template->post->post_status )
+		if ( 1 == (int) $topic_template->post->post_status )
 			$class .= ' deleted';
 
-		if ( 0 == (int)$topic_template->post->post_status )
+		if ( 0 == (int) $topic_template->post->post_status )
 			$class .= ' open';
 
 		return apply_filters( 'bp_get_the_topic_post_css_class', trim( $class ) );
@@ -1204,7 +1212,7 @@ function bp_the_topic_post_poster_name() {
 	function bp_get_the_topic_post_poster_name() {
 		global $topic_template;
 
-		if ( !$link = bp_core_get_user_domain( $topic_template->post->poster_id, $topic_template->post->poster_nicename, $topic_template->post->poster_login ) )
+		if ( empty( $topic_template->post->poster_name ) || ( !$link = bp_core_get_user_domain( $topic_template->post->poster_id ) ) )
 			return __( 'Deleted User', 'buddypress' );
 
 		return apply_filters( 'bp_get_the_topic_post_poster_name', '<a href="' . $link . '" title="' . $topic_template->post->poster_name . '">' . $topic_template->post->poster_name . '</a>' );
@@ -1216,7 +1224,7 @@ function bp_the_topic_post_poster_link() {
 	function bp_get_the_topic_post_poster_link() {
 		global $topic_template;
 
-		return apply_filters( 'bp_the_topic_post_poster_link', bp_core_get_user_domain( $topic_template->post->poster_id, $topic_template->post->poster_nicename, $topic_template->post->poster_login ) );
+		return apply_filters( 'bp_the_topic_post_poster_link', bp_core_get_user_domain( $topic_template->post->poster_id ) );
 	}
 
 function bp_the_topic_post_time_since() {
@@ -1234,7 +1242,7 @@ function bp_the_topic_post_is_mine() {
 	function bp_get_the_topic_post_is_mine() {
 		global $bp, $topic_template;
 
-		return $bp->loggedin_user->id == $topic_template->post->poster_id;
+		return bp_loggedin_user_id() == $topic_template->post->poster_id;
 	}
 
 function bp_the_topic_post_admin_links( $args = '' ) {
@@ -1309,7 +1317,7 @@ function bp_directory_forums_search_form() {
 	$search_value = !empty( $_REQUEST['fs'] ) ? stripslashes( $_REQUEST['fs'] ) : $default_search_value;  ?>
 
 	<form action="" method="get" id="search-forums-form">
-		<label><input type="text" name="s" id="forums_search" value="<?php echo esc_attr( $search_value ); ?>"  onfocus="if (this.value == '<?php echo $default_search_value ?>') {this.value = '';}" onblur="if (this.value == '') {this.value = '<?php echo $default_search_value ?>';}" /></label>
+		<label><input type="text" name="s" id="forums_search" placeholder="<?php echo esc_attr( $search_value ); ?>" /></label>
 		<input type="submit" id="forums_search_submit" name="forums_search_submit" value="<?php _e( 'Search', 'buddypress' ); ?>" />
 	</form>
 
@@ -1376,7 +1384,7 @@ function bp_forums_tag_heat_map( $args = '' ) {
  * Echo the current topic's tag list, comma-separated
  *
  * @package BuddyPress
- * @since 1.5
+ * @since BuddyPress (1.5)
  */
 function bp_forum_topic_tag_list() {
 	echo bp_get_forum_topic_tag_list();
@@ -1385,7 +1393,7 @@ function bp_forum_topic_tag_list() {
 	 * Get the current topic's tag list
 	 *
 	 * @package BuddyPress
-	 * @since 1.5
+	 * @since BuddyPress (1.5)
 	 *
 	 * @param str $format 'string' returns comma-separated string; otherwise returns array
 	 * @return mixed $tags
@@ -1413,7 +1421,7 @@ function bp_forum_topic_tag_list() {
  * Returns true if the current topic has tags
  *
  * @package BuddyPress
- * @since 1.5
+ * @since BuddyPress (1.5)
  *
  * @return bool
  */
diff --git a/wp-content/plugins/buddypress/bp-forums/deprecated/1.6.php b/wp-content/plugins/buddypress/bp-forums/deprecated/1.6.php
new file mode 100644
index 0000000000000000000000000000000000000000..9368fe774e2fe091dd7af2069aa9323abfd4282c
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-forums/deprecated/1.6.php
@@ -0,0 +1,203 @@
+<?php
+
+/**
+ * BuddyPress Forums Deprecated Functions
+ *
+ * This file contains all the deprecated functions for BuddyPress forums since
+ * version 1.6. This was a major update for the forums component, moving from
+ * bbPress 1.1 to bbPress 2.1.
+ *
+ * @package BuddyPress
+ * @subpackage Forums
+ */
+
+// Exit if accessed directly
+if ( !defined( 'ABSPATH' ) ) exit;
+
+function bp_forums_bbpress_admin() {
+
+	$action = bp_get_admin_url( 'admin.php?page=bb-forums-setup&reinstall=1' ); ?>
+
+	<div class="wrap">
+		<?php screen_icon( 'buddypress' ); ?>
+
+		<h2 class="nav-tab-wrapper"><?php bp_core_admin_tabs( __( 'Forums', 'buddypress' ) ); ?></h2>
+
+		<?php if ( isset( $_POST['submit'] ) ) : ?>
+
+			<div id="message" class="updated fade">
+				<p><?php _e( 'Settings Saved.', 'buddypress' ) ?></p>
+			</div>
+
+		<?php endif; ?>
+
+		<?php
+
+		if ( isset( $_REQUEST['reinstall'] ) || !bp_forums_is_installed_correctly() ) :
+
+			// Delete the bb-config.php location option
+			bp_delete_option( 'bb-config-location' );
+			bp_forums_bbpress_install_wizard();
+
+		else : ?>
+
+			<div style="width: 45%; float: left; margin-top: 20px;">
+				<h3><?php _e( 'Forums for Groups', 'buddypress' ) ?></h3>
+
+				<p><?php _e( 'Give each individual group its own discussion forum. Choose this if you\'d like to keep your members\' conversations separated into distinct areas.' , 'buddypress' ); ?></p>
+				<p class="description"><?php _e( 'You may use an existing bbPress installation if you have one.', 'buddypress' ); ?></p>
+
+				<h4 style="margin-bottom: 10px;"><?php _e( 'Features', 'buddypress' ); ?></h4>
+				<ul class="description" style="list-style: square; margin-left: 30px;">
+					<li><?php _e( 'Group Integration',           'buddypress' ); ?></p></li>
+					<li><?php _e( 'Member Profile Integration',  'buddypress' ); ?></p></li>
+					<li><?php _e( 'Activity Stream Integration', 'buddypress' ); ?></p></li>
+					<li><?php _e( '@ Mention Integration',       'buddypress' ); ?></p></li>
+				</ul>
+
+				<div>
+					<a class="button button-primary" href="<?php echo $action ?>"><?php _e( 'Reinstall Group Forums', 'buddypress' ) ?></a> &nbsp;
+				</div>
+			</div>
+
+			<div style="width: 45%; float: left; margin: 20px 0 20px 20px; padding: 0 20px 20px 20px; border: 1px solid #ddd; background-color: #fff;">
+				<h3><?php _e( 'New! Site Wide Forums', 'buddypress' ) ?></h3>
+				<p><?php _e( 'Your site will have central forums that are not isolated to any specific group. Choose this if you\'d like to have a central forum area for your members.', 'buddypress' ) ?></p>
+				<p class="description"><?php _e( 'You may activate both Group and Site Wide forums, but this may create a poor experience for your members.', 'buddypress' ) ?></p>
+
+				<h4 style="margin-bottom: 10px;"><?php _e( 'Features', 'buddypress' ); ?></h4>
+				<ul class="description" style="list-style: square; margin-left: 30px;">
+					<li><?php _e( 'Central Discussion Area',     'buddypress' ); ?></p></li>
+					<li><?php _e( 'Forum Plugins Available',     'buddypress' ); ?></p></li>
+					<li><?php _e( 'Activity Stream Integration', 'buddypress' ); ?></p></li>
+					<li><?php _e( '@ Mention Integration',       'buddypress' ); ?></p></li>
+				</ul>
+				<div>
+					<a class="button thickbox button-primary" href="<?php bp_admin_url( add_query_arg( array( 'tab' => 'plugin-information', 'plugin' => 'bbpress', 'TB_iframe' => 'true', 'width' => '640', 'height' => '500' ), 'plugin-install.php' ) ); ?>"><?php _e( 'Install Site Wide Forums', 'buddypress' ) ?></a> &nbsp;
+				</div>
+			</div>
+
+		<?php endif; ?>
+
+	</div>
+<?php
+}
+
+function bp_forums_bbpress_install_wizard() {
+	$post_url = network_admin_url( 'admin.php?page=bb-forums-setup' );
+
+	$step = isset( $_REQUEST['step'] ) ? $_REQUEST['step'] : '';
+
+	switch( $step ) {
+		case 'existing':
+			if ( isset( $_REQUEST['doinstall'] ) && ( 1 == (int) $_REQUEST['doinstall'] ) ) {
+				if ( !bp_forums_configure_existing_install() ) {
+					_e( 'The bb-config.php file was not found at that location, please try again.', 'buddypress' );
+				} else {
+					?>
+					<h3><?php _e( 'Forums were set up correctly using your existing bbPress install!', 'buddypress' ) ?></h3>
+					<p><?php _e( 'BuddyPress will now use its internal copy of bbPress to run the forums on your site. If you wish, you can remove your old bbPress installation files, as long as you keep the bb-config.php file in the same location.', 'buddypress' ) ?></p><?php
+				}
+			} else { ?>
+
+					<form action="" method="post">
+						<h3><?php _e( 'Existing bbPress Installation', 'buddypress' ) ?></h3>
+						<p><?php _e( "BuddyPress can make use of your existing bbPress install. Just provide the location of your <code>bb-config.php</code> file, and BuddyPress will do the rest.", 'buddypress' ) ?></p>
+						<p><label><code>bb-config.php</code> file location:</label><br /><input style="width: 50%" type="text" name="bbconfigloc" id="bbconfigloc" value="<?php echo str_replace( 'buddypress', '', $_SERVER['DOCUMENT_ROOT'] ) ?>" /></p>
+						<p><input type="submit" class="button-primary" value="<?php _e( 'Complete Installation', 'buddypress' ) ?>" /></p>
+						<input type="hidden" name="step" value="existing" />
+						<input type="hidden" name="doinstall" value="1" />
+						<?php wp_nonce_field( 'bp_forums_existing_install_init' ) ?>
+					</form>
+
+				<?php
+			}
+		break;
+
+		case 'new':
+			if ( isset( $_REQUEST['doinstall'] ) && 1 == (int) $_REQUEST['doinstall'] ) {
+				$result = bp_forums_bbpress_install();
+
+				switch ( $result ) {
+					case 1:
+						_e( '<p>All done! Configuration settings have been saved to the file <code>bb-config.php</code> in the root of your WordPress install.</p>', 'buddypress' );
+						break;
+					default:
+						// Just write the contents to screen
+						_e( '<p>A configuration file could not be created. No problem, but you will need to save the text shown below into a file named <code>bb-config.php</code> in the root directory of your WordPress installation before you can start using the forum functionality.</p>', 'buddypress' ); ?>
+
+						<textarea style="display:block; margin-top: 30px; width: 80%;" rows="50"><?php echo htmlspecialchars( $result ); ?></textarea>
+
+					<?php
+						break;
+				}
+			} else { ?>
+
+				<h3><?php _e( 'New bbPress Installation', 'buddypress' ) ?></h3>
+				<p><?php _e( "You've decided to set up a new installation of bbPress for forum management in BuddyPress. This is very simple and is usually just a one click
+				process. When you're ready, hit the link below.", 'buddypress' ) ?></p>
+				<p><a class="button-primary" href="<?php echo wp_nonce_url( $post_url . '&step=new&doinstall=1', 'bp_forums_new_install_init' ) ?>"><?php _e( 'Complete Installation', 'buddypress' ) ?></a></p>
+
+				<?php
+			}
+		break;
+
+		default:
+			if ( !file_exists( BP_PLUGIN_DIR . '/bp-forums/bbpress/' ) ) { ?>
+
+				<div id="message" class="error">
+					<p><?php printf( __( 'bbPress files were not found. To install the forums component you must download a copy of bbPress and make sure it is in the folder: "%s"', 'buddypress' ), 'wp-content/plugins/buddypress/bp-forums/bbpress/' ) ?></p>
+				</div>
+
+			<?php } else {
+
+				// Include the plugin install
+
+				add_thickbox();
+				wp_enqueue_script( 'plugin-install' );
+				wp_admin_css( 'plugin-install' );
+			?>
+
+				<div style="width: 45%; float: left;  margin-top: 20px;">
+					<h3><?php _e( 'Forums for Groups', 'buddypress' ) ?></h3>
+
+					<p><?php _e( 'Give each individual group its own discussion forum. Choose this if you\'d like to keep your members\' conversations separated into distinct areas.' , 'buddypress' ); ?></p>
+					<p class="description"><?php _e( 'You may use an existing bbPress installation if you have one.', 'buddypress' ); ?></p>
+
+					<h4 style="margin-bottom: 10px;"><?php _e( 'Features', 'buddypress' ); ?></h4>
+					<ul class="description" style="list-style: square; margin-left: 30px;">
+						<li><?php _e( 'Group Integration',           'buddypress' ); ?></p></li>
+						<li><?php _e( 'Member Profile Integration',  'buddypress' ); ?></p></li>
+						<li><?php _e( 'Activity Stream Integration', 'buddypress' ); ?></p></li>
+						<li><?php _e( '@ Mention Integration',       'buddypress' ); ?></p></li>
+					</ul>
+
+					<div>
+						<a class="button button-primary" href="<?php echo $post_url . '&step=new' ?>"><?php _e( 'Install Group Forums', 'buddypress' ) ?></a> &nbsp;
+						<a class="button" href="<?php echo $post_url . '&step=existing' ?>"><?php _e( 'Use Existing Installation', 'buddypress' ) ?></a>
+					</div>
+				</div>
+
+				<div style="width: 45%; float: left; margin: 20px 0 20px 20px; padding: 0 20px 20px 20px; border: 1px solid #ddd; background-color: #fff;">
+					<h3><?php _e( 'New! Site Wide Forums', 'buddypress' ) ?></h3>
+					<p><?php _e( 'Your site will have central forums that are not isolated to any specific group. Choose this if you\'d like to have a central forum area for your members.', 'buddypress' ) ?></p>
+					<p class="description"><?php _e( 'You may activate both Group and Site Wide forums, but this may create a poor experience for your members.', 'buddypress' ) ?></p>
+
+					<h4 style="margin-bottom: 10px;"><?php _e( 'Features', 'buddypress' ); ?></h4>
+					<ul class="description" style="list-style: square; margin-left: 30px;">
+						<li><?php _e( 'Central Discussion Area',     'buddypress' ); ?></p></li>
+						<li><?php _e( 'Forum Plugins Available',     'buddypress' ); ?></p></li>
+						<li><?php _e( 'Activity Stream Integration', 'buddypress' ); ?></p></li>
+						<li><?php _e( '@ Mention Integration',       'buddypress' ); ?></p></li>
+					</ul>
+					<div>
+						<a class="button thickbox button-primary" href="<?php bp_admin_url( add_query_arg( array( 'tab' => 'plugin-information', 'plugin' => 'bbpress', 'TB_iframe' => 'true', 'width' => '640', 'height' => '500' ), 'plugin-install.php' ) ); ?>"><?php _e( 'Install Site Wide Forums', 'buddypress' ) ?></a> &nbsp;
+					</div>
+				</div>
+
+			<?php }
+		break;
+	}
+}
+
+?>
diff --git a/wp-content/plugins/buddypress/bp-friends/bp-friends-actions.php b/wp-content/plugins/buddypress/bp-friends/bp-friends-actions.php
index 65a75154f7a9c2772ca3a6092ce89e71c9dca3e0..16b80726a1fbdfd7f6c75ffe7959961f94c49df2 100644
--- a/wp-content/plugins/buddypress/bp-friends/bp-friends-actions.php
+++ b/wp-content/plugins/buddypress/bp-friends/bp-friends-actions.php
@@ -1,8 +1,14 @@
 <?php
+
 /**
+ * BuddyPress Friends Actions
+ *
  * Action functions are exactly the same as screen functions, however they do not
  * have a template screen associated with them. Usually they will send the user
  * back to the default screen after execution.
+ *
+ * @package BuddyPress
+ * @subpackage FriendsActions
  */
 
 // Exit if accessed directly
@@ -78,4 +84,4 @@ function friends_action_remove_friend() {
 }
 add_action( 'bp_init', 'friends_action_remove_friend' );
 
-?>
\ No newline at end of file
+?>
diff --git a/wp-content/plugins/buddypress/bp-friends/bp-friends-activity.php b/wp-content/plugins/buddypress/bp-friends/bp-friends-activity.php
index 82f717a1701405c59708583e6e2489686472300f..7c1b5be90d07f6ab19545498ee112f380fddaea3 100644
--- a/wp-content/plugins/buddypress/bp-friends/bp-friends-activity.php
+++ b/wp-content/plugins/buddypress/bp-friends/bp-friends-activity.php
@@ -1,7 +1,13 @@
 <?php
+
 /**
- * These functions handle the recording, deleting and formatting of activity and
- * notifications for the user and for this specific component.
+ * BuddyPress Friends Activity Functions
+ *
+ * These functions handle the recording, deleting and formatting of activity 
+ * for the user and for this specific component.
+ *
+ * @package BuddyPress
+ * @subpackage FriendsActivity
  */
 
 // Exit if accessed directly
@@ -14,7 +20,7 @@ function friends_record_activity( $args = '' ) {
 		return false;
 
 	$defaults = array (
-		'user_id'           => $bp->loggedin_user->id,
+		'user_id'           => bp_loggedin_user_id(),
 		'action'            => '',
 		'content'           => '',
 		'primary_link'      => '',
@@ -36,7 +42,7 @@ function friends_delete_activity( $args ) {
 	global $bp;
 
 	if ( bp_is_active( 'activity' ) ) {
-		extract( (array)$args );
+		extract( (array) $args );
 		bp_activity_delete_by_item_id( array( 'item_id' => $item_id, 'component' => $bp->friends->id, 'type' => $type, 'user_id' => $user_id ) );
 	}
 }
@@ -47,6 +53,11 @@ function friends_register_activity_actions() {
 	if ( !bp_is_active( 'activity' ) )
 		return false;
 
+	// These two added in BP 1.6
+	bp_activity_set_action( $bp->friends->id, 'friendship_accepted', __( 'Friendships accepted', 'buddypress' ) );
+	bp_activity_set_action( $bp->friends->id, 'friendship_created', __( 'New friendships', 'buddypress' ) );
+
+	// < BP 1.6 backpat
 	bp_activity_set_action( $bp->friends->id, 'friends_register_activity_action', __( 'New friendship created', 'buddypress' ) );
 
 	do_action( 'friends_register_activity_actions' );
@@ -54,7 +65,7 @@ function friends_register_activity_actions() {
 add_action( 'bp_register_activity_actions', 'friends_register_activity_actions' );
 
 /**
- * Format the BuddyBar/admin bar notifications for the Friends component
+ * Format the BuddyBar/Toolbar notifications for the Friends component
  *
  * @package BuddyPress
  *
@@ -62,18 +73,17 @@ add_action( 'bp_register_activity_actions', 'friends_register_activity_actions'
  * @param int $item_id The primary item id
  * @param int $secondary_item_id The secondary item id
  * @param int $total_items The total number of messaging-related notifications waiting for the user
- * @param str $format 'string' for BuddyBar-compatible notifications; 'array' for WP Admin Bar
+ * @param str $format 'string' for BuddyBar-compatible notifications; 'array' for WP Toolbar
  */
 function friends_format_notifications( $action, $item_id, $secondary_item_id, $total_items, $format = 'string' ) {
-	global $bp;
 
 	switch ( $action ) {
 		case 'friendship_accepted':
-			$link = bp_loggedin_user_domain() . bp_get_friends_slug() . '/my-friends/newest';
+			$link = trailingslashit( bp_loggedin_user_domain() . bp_get_friends_slug() . '/my-friends' );
 
 			// Set up the string and the filter
-			if ( (int)$total_items > 1 ) {
-				$text = sprintf( __( '%d friends accepted your friendship requests', 'buddypress' ), (int)$total_items );
+			if ( (int) $total_items > 1 ) {
+				$text = sprintf( __( '%d friends accepted your friendship requests', 'buddypress' ), (int) $total_items );
 				$filter = 'bp_friends_multiple_friendship_accepted_notification';
 			} else {
 				$text = sprintf( __( '%s accepted your friendship request', 'buddypress' ),  bp_core_get_user_displayname( $item_id ) );
@@ -83,11 +93,11 @@ function friends_format_notifications( $action, $item_id, $secondary_item_id, $t
 			break;
 
 		case 'friendship_request':
-			$link = bp_loggedin_user_domain() . bp_get_friends_slug() . '/requests?new';
+			$link = bp_loggedin_user_domain() . bp_get_friends_slug() . '/requests/?new';
 
 			// Set up the string and the filter
-			if ( (int)$total_items > 1 ) {
-				$text = sprintf( __( 'You have %d pending friendship requests', 'buddypress' ), (int)$total_items );
+			if ( (int) $total_items > 1 ) {
+				$text = sprintf( __( 'You have %d pending friendship requests', 'buddypress' ), (int) $total_items );
 				$filter = 'bp_friends_multiple_friendship_request_notification';
 			} else {
 				$text = sprintf( __( 'You have a friendship request from %s', 'buddypress' ),  bp_core_get_user_displayname( $item_id ) );
@@ -99,12 +109,12 @@ function friends_format_notifications( $action, $item_id, $secondary_item_id, $t
 
 	// Return either an HTML link or an array, depending on the requested format
 	if ( 'string' == $format ) {
-		$return = apply_filters( $filter, '<a href="' . $link . '">' . $text . '</a>', (int)$total_items );
+		$return = apply_filters( $filter, '<a href="' . $link . '">' . $text . '</a>', (int) $total_items );
 	} else {
 		$return = apply_filters( $filter, array(
 			'link' => $link,
 			'text' => $text
-		), (int)$total_items );
+		), (int) $total_items );
 	}
 
 	do_action( 'friends_format_notifications', $action, $item_id, $secondary_item_id, $total_items, $return );
@@ -112,4 +122,4 @@ function friends_format_notifications( $action, $item_id, $secondary_item_id, $t
 	return $return;
 }
 
-?>
\ No newline at end of file
+?>
diff --git a/wp-content/plugins/buddypress/bp-friends/bp-friends-cache.php b/wp-content/plugins/buddypress/bp-friends/bp-friends-cache.php
index c2b52a651008dc3bad15fb775a745d9567334c04..0c15d89c06c87e0311493c49c6c8861bd3adca5e 100644
--- a/wp-content/plugins/buddypress/bp-friends/bp-friends-cache.php
+++ b/wp-content/plugins/buddypress/bp-friends/bp-friends-cache.php
@@ -1,9 +1,16 @@
 <?php
+
 /**
+ * BuddyPress Friends Caching
+ *
  * Caching functions handle the clearing of cached objects and pages on specific
  * actions throughout BuddyPress.
+ *
+ * @package BuddyPress
+ * @subpackage FriendsCaching
  */
 
+
 // Exit if accessed directly
 if ( !defined( 'ABSPATH' ) ) exit;
 
@@ -13,15 +20,13 @@ function friends_clear_friend_object_cache( $friendship_id ) {
 
 	wp_cache_delete( 'friends_friend_ids_' .    $friendship->initiator_user_id, 'bp' );
 	wp_cache_delete( 'friends_friend_ids_' .    $friendship->friend_user_id,    'bp' );
-	wp_cache_delete( 'bp_total_friend_count_' . $friendship->initiator_user_id, 'bp' );
-	wp_cache_delete( 'bp_total_friend_count_' . $friendship->friend_user_id,    'bp' );
 }
 
 function friends_clear_friend_notifications() {
 	global $bp;
 
 	if ( isset( $_GET['new'] ) )
-		bp_core_delete_notifications_by_type( $bp->loggedin_user->id, $bp->friends->id, 'friendship_accepted' );
+		bp_core_delete_notifications_by_type( bp_loggedin_user_id(), $bp->friends->id, 'friendship_accepted' );
 }
 add_action( 'bp_activity_screen_my_activity', 'friends_clear_friend_notifications' );
 
@@ -35,4 +40,4 @@ add_action( 'friends_friendship_accepted',  'bp_core_clear_cache' );
 add_action( 'friends_friendship_deleted',   'bp_core_clear_cache' );
 add_action( 'friends_friendship_requested', 'bp_core_clear_cache' );
 
-?>
\ No newline at end of file
+?>
diff --git a/wp-content/plugins/buddypress/bp-friends/bp-friends-classes.php b/wp-content/plugins/buddypress/bp-friends/bp-friends-classes.php
index c762e2224d7fb5667676fc98b10c2bd4e1e01169..9d8197e369815515011438441a1d558ee63ee360 100644
--- a/wp-content/plugins/buddypress/bp-friends/bp-friends-classes.php
+++ b/wp-content/plugins/buddypress/bp-friends/bp-friends-classes.php
@@ -1,4 +1,5 @@
 <?php
+
 // Exit if accessed directly
 if ( !defined( 'ABSPATH' ) ) exit;
 
@@ -15,22 +16,18 @@ class BP_Friends_Friendship {
 
 	var $friend;
 
-	function bp_friends_friendship( $id = null, $is_request = false, $populate_friend_details = true ) {
-		$this->__construct( $id, $is_request, $populate_friend_details );
-	}
-
 	function __construct( $id = null, $is_request = false, $populate_friend_details = true ) {
 		$this->is_request = $is_request;
 
-		if ( $id ) {
-			$this->id = $id;
+		if ( !empty( $id ) ) {
+			$this->id                      = $id;
 			$this->populate_friend_details = $populate_friend_details;
 			$this->populate( $this->id );
 		}
 	}
 
 	function populate() {
-		global $wpdb, $bp, $creds;
+		global $wpdb, $bp;
 
 		if ( $friendship = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM {$bp->friends->table_name} WHERE id = %d", $this->id ) ) ) {
 			$this->initiator_user_id = $friendship->initiator_user_id;
@@ -40,12 +37,8 @@ class BP_Friends_Friendship {
 			$this->date_created      = $friendship->date_created;
 		}
 
-		// if running from ajax.
-		if ( !$bp->displayed_user->id )
-			$bp->displayed_user->id = $creds['current_userid'];
-
-		if ( $this->populate_friend_details ) {
-			if ( $this->friend_user_id == $bp->displayed_user->id ) {
+		if ( !empty( $this->populate_friend_details ) ) {
+			if ( $this->friend_user_id == bp_displayed_user_id() ) {
 				$this->friend = new BP_Core_User( $this->initiator_user_id );
 			} else {
 				$this->friend = new BP_Core_User( $this->friend_user_id );
@@ -64,11 +57,12 @@ class BP_Friends_Friendship {
 
 		do_action_ref_array( 'friends_friendship_before_save', array( &$this ) );
 
-		if ( $this->id ) {
-			// Update
+		// Update
+		if (!empty( $this->id ) ) {
 			$result = $wpdb->query( $wpdb->prepare( "UPDATE {$bp->friends->table_name} SET initiator_user_id = %d, friend_user_id = %d, is_confirmed = %d, is_limited = %d, date_created = %s ) WHERE id = %d", $this->initiator_user_id, $this->friend_user_id, $this->is_confirmed, $this->is_limited, $this->date_created, $this->id ) );
+
+		// Save
 		} else {
-			// Save
 			$result = $wpdb->query( $wpdb->prepare( "INSERT INTO {$bp->friends->table_name} ( initiator_user_id, friend_user_id, is_confirmed, is_limited, date_created ) VALUES ( %d, %d, %d, %d, %s )", $this->initiator_user_id, $this->friend_user_id, $this->is_confirmed, $this->is_limited, $this->date_created ) );
 			$this->id = $wpdb->insert_id;
 		}
@@ -84,27 +78,28 @@ class BP_Friends_Friendship {
 		return $wpdb->query( $wpdb->prepare( "DELETE FROM {$bp->friends->table_name} WHERE id = %d", $this->id ) );
 	}
 
-	/* Static Functions */
+	/** Static Methods ********************************************************/
 
 	function get_friend_user_ids( $user_id, $friend_requests_only = false, $assoc_arr = false ) {
 		global $wpdb, $bp;
 
-		if ( $friend_requests_only ) {
-			$oc_sql = $wpdb->prepare( "AND is_confirmed = 0" );
+		if ( !empty( $friend_requests_only ) ) {
+			$oc_sql = "AND is_confirmed = 0";
 			$friend_sql = $wpdb->prepare ( " WHERE friend_user_id = %d", $user_id );
 		} else {
-			$oc_sql = $wpdb->prepare( "AND is_confirmed = 1" );
+			$oc_sql = "AND is_confirmed = 1";
 			$friend_sql = $wpdb->prepare ( " WHERE (initiator_user_id = %d OR friend_user_id = %d)", $user_id, $user_id );
 		}
 
-		$friends = $wpdb->get_results( $wpdb->prepare( "SELECT friend_user_id, initiator_user_id FROM {$bp->friends->table_name} $friend_sql $oc_sql ORDER BY date_created DESC" ) );
+		$friends = $wpdb->get_results( "SELECT friend_user_id, initiator_user_id FROM {$bp->friends->table_name} {$friend_sql} {$oc_sql} ORDER BY date_created DESC" );
 		$fids = array();
 
 		for ( $i = 0, $count = count( $friends ); $i < $count; ++$i ) {
-			if ( $assoc_arr )
+			if ( !empty( $assoc_arr ) ) {
 				$fids[] = array( 'user_id' => ( $friends[$i]->friend_user_id == $user_id ) ? $friends[$i]->initiator_user_id : $friends[$i]->friend_user_id );
-			else
+			} else {
 				$fids[] = ( $friends[$i]->friend_user_id == $user_id ) ? $friends[$i]->initiator_user_id : $friends[$i]->friend_user_id;
+			}
 		}
 
 		return $fids;
@@ -125,8 +120,8 @@ class BP_Friends_Friendship {
 	function total_friend_count( $user_id = 0 ) {
 		global $wpdb, $bp;
 
-		if ( !$user_id )
-			$user_id = ( $bp->displayed_user->id ) ? $bp->displayed_user->id : $bp->loggedin_user->id;
+		if ( empty( $user_id ) )
+			$user_id = ( bp_displayed_user_id() ) ? bp_displayed_user_id() : bp_loggedin_user_id();
 
 		/* This is stored in 'total_friend_count' usermeta.
 		   This function will recalculate, update and return. */
@@ -134,11 +129,11 @@ class BP_Friends_Friendship {
 		$count = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(id) FROM {$bp->friends->table_name} WHERE (initiator_user_id = %d OR friend_user_id = %d) AND is_confirmed = 1", $user_id, $user_id ) );
 
 		// Do not update meta if user has never had friends
-		if ( !$count && !bp_get_user_meta( $user_id, 'total_friend_count', true ) )
+		if ( empty( $count ) && !bp_get_user_meta( $user_id, 'total_friend_count', true ) )
 			return 0;
 
-		bp_update_user_meta( $user_id, 'total_friend_count', (int)$count );
-		return (int)$count;
+		bp_update_user_meta( $user_id, 'total_friend_count', (int) $count );
+		return (int) $count;
 	}
 
 	function search_friends( $filter, $user_id, $limit = null, $page = null ) {
@@ -146,12 +141,12 @@ class BP_Friends_Friendship {
 
 		// TODO: Optimize this function.
 
-		if ( !$user_id )
-			$user_id = $bp->loggedin_user->id;
+		if ( empty( $user_id ) )
+			$user_id = bp_loggedin_user_id();
 
 		$filter = like_escape( $wpdb->escape( $filter ) );
 
-		if ( $limit && $page )
+		if ( !empty( $limit ) && !empty( $page ) )
 			$pag_sql = $wpdb->prepare( " LIMIT %d, %d", intval( ( $page - 1 ) * $limit), intval( $limit ) );
 
 		if ( !$friend_ids = BP_Friends_Friendship::get_friend_user_ids( $user_id ) )
@@ -160,37 +155,37 @@ class BP_Friends_Friendship {
 		// Get all the user ids for the current user's friends.
 		$fids = implode( ',', $friend_ids );
 
-		if ( empty($fids) )
+		if ( empty( $fids ) )
 			return false;
 
 		// filter the user_ids based on the search criteria.
 		if ( bp_is_active( 'xprofile' ) ) {
-			$sql = "SELECT DISTINCT user_id FROM {$bp->profile->table_name_data} WHERE user_id IN ($fids) AND value LIKE '$filter%%' {$pag_sql}";
-			$total_sql = "SELECT COUNT(DISTINCT user_id) FROM {$bp->profile->table_name_data} WHERE user_id IN ($fids) AND value LIKE '$filter%%'";
+			$sql = "SELECT DISTINCT user_id FROM {$bp->profile->table_name_data} WHERE user_id IN ({$fids}) AND value LIKE '{$filter}%%' {$pag_sql}";
+			$total_sql = "SELECT COUNT(DISTINCT user_id) FROM {$bp->profile->table_name_data} WHERE user_id IN ({$fids}) AND value LIKE '{$filter}%%'";
 		} else {
-			$sql = "SELECT DISTINCT user_id FROM {$wpdb->usermeta} WHERE user_id IN ($fids) AND meta_key = 'nickname' AND meta_value LIKE '$filter%%' {$pag_sql}";
-			$total_sql = "SELECT COUNT(DISTINCT user_id) FROM {$wpdb->usermeta} WHERE user_id IN ($fids) AND meta_key = 'nickname' AND meta_value LIKE '$filter%%'";
+			$sql = "SELECT DISTINCT user_id FROM {$wpdb->usermeta} WHERE user_id IN ({$fids}) AND meta_key = 'nickname' AND meta_value LIKE '{$filter}%%' {$pag_sql}";
+			$total_sql = "SELECT COUNT(DISTINCT user_id) FROM {$wpdb->usermeta} WHERE user_id IN ({$fids}) AND meta_key = 'nickname' AND meta_value LIKE '{$filter}%%'";
 		}
 
-		$filtered_friend_ids = $wpdb->get_col($sql);
-		$total_friend_ids = $wpdb->get_var($total_sql);
+		$filtered_friend_ids = $wpdb->get_col( $sql );
+		$total_friend_ids    = $wpdb->get_var( $total_sql );
 
-		if ( !$filtered_friend_ids )
+		if ( empty( $filtered_friend_ids ) )
 			return false;
 
-		return array( 'friends' => $filtered_friend_ids, 'total' => (int)$total_friend_ids );
+		return array( 'friends' => $filtered_friend_ids, 'total' => (int) $total_friend_ids );
 	}
 
 	function check_is_friend( $loggedin_userid, $possible_friend_userid ) {
 		global $wpdb, $bp;
 
-		if ( !$loggedin_userid || !$possible_friend_userid )
+		if ( empty( $loggedin_userid ) || empty( $possible_friend_userid ) )
 			return false;
 
 		$result = $wpdb->get_results( $wpdb->prepare( "SELECT id, is_confirmed FROM {$bp->friends->table_name} WHERE (initiator_user_id = %d AND friend_user_id = %d) OR (initiator_user_id = %d AND friend_user_id = %d)", $loggedin_userid, $possible_friend_userid, $possible_friend_userid, $loggedin_userid ) );
 
-		if ( $result ) {
-			if ( 0 == (int)$result[0]->is_confirmed ) {
+		if ( !empty( $result ) ) {
+			if ( 0 == (int) $result[0]->is_confirmed ) {
 				return 'pending';
 			} else {
 				return 'is_friend';
@@ -201,7 +196,7 @@ class BP_Friends_Friendship {
 	}
 
 	function get_bulk_last_active( $user_ids ) {
-		global $wpdb, $bp;
+		global $wpdb;
 
 		return $wpdb->get_results( $wpdb->prepare( "SELECT meta_value as last_activity, user_id FROM {$wpdb->usermeta} WHERE meta_key = %s AND user_id IN ( {$user_ids} ) ORDER BY meta_value DESC", bp_get_user_meta_key( 'last_activity' ) ) );
 	}
@@ -209,13 +204,19 @@ class BP_Friends_Friendship {
 	function accept($friendship_id) {
 		global $wpdb, $bp;
 
-	 	return $wpdb->query( $wpdb->prepare( "UPDATE {$bp->friends->table_name} SET is_confirmed = 1, date_created = %s WHERE id = %d AND friend_user_id = %d", bp_core_current_time(), $friendship_id, $bp->loggedin_user->id ) );
+	 	return $wpdb->query( $wpdb->prepare( "UPDATE {$bp->friends->table_name} SET is_confirmed = 1, date_created = %s WHERE id = %d AND friend_user_id = %d", bp_core_current_time(), $friendship_id, bp_loggedin_user_id() ) );
+	}
+
+	function withdraw($friendship_id) {
+		global $wpdb, $bp;
+
+		return $wpdb->query( $wpdb->prepare( "DELETE FROM {$bp->friends->table_name} WHERE id = %d AND initiator_user_id = %d", $friendship_id, bp_loggedin_user_id() ) );
 	}
 
 	function reject($friendship_id) {
 		global $wpdb, $bp;
 
-		return $wpdb->query( $wpdb->prepare( "DELETE FROM {$bp->friends->table_name} WHERE id = %d AND friend_user_id = %d", $friendship_id, $bp->loggedin_user->id ) );
+		return $wpdb->query( $wpdb->prepare( "DELETE FROM {$bp->friends->table_name} WHERE id = %d AND friend_user_id = %d", $friendship_id, bp_loggedin_user_id() ) );
 	}
 
 	function search_users( $filter, $user_id, $limit = null, $page = null ) {
@@ -224,21 +225,21 @@ class BP_Friends_Friendship {
 		$filter = like_escape( $wpdb->escape( $filter ) );
 
 		$usermeta_table = $wpdb->base_prefix . 'usermeta';
-		$users_table = $wpdb->base_prefix . 'users';
+		$users_table    = $wpdb->base_prefix . 'users';
 
-		if ( $limit && $page )
+		if ( !empty( $limit ) && !empty( $page ) )
 			$pag_sql = $wpdb->prepare( " LIMIT %d, %d", intval( ( $page - 1 ) * intval( $limit ) ), intval( $limit ) );
 
 		// filter the user_ids based on the search criteria.
 		if ( bp_is_active( 'xprofile' ) ) {
-			$sql = $wpdb->prepare( "SELECT DISTINCT d.user_id as id FROM {$bp->profile->table_name_data} d, $users_table u WHERE d.user_id = u.id AND d.value LIKE '$filter%%' ORDER BY d.value DESC $pag_sql" );
+			$sql = "SELECT DISTINCT d.user_id as id FROM {$bp->profile->table_name_data} d, {$users_table} u WHERE d.user_id = u.id AND d.value LIKE '{$filter}%%' ORDER BY d.value DESC {$pag_sql}";
 		} else {
-			$sql = $wpdb->prepare( "SELECT DISTINCT user_id as id FROM $usermeta_table WHERE meta_value LIKE '$filter%%' ORDER BY d.value DESC $pag_sql" );
+			$sql = "SELECT DISTINCT user_id as id FROM {$usermeta_table} WHERE meta_value LIKE '{$filter}%%' ORDER BY d.value DESC {$pag_sql}";
 		}
 
 		$filtered_fids = $wpdb->get_col($sql);
 
-		if ( !$filtered_fids )
+		if ( empty( $filtered_fids ) )
 			return false;
 
 		return $filtered_fids;
@@ -250,18 +251,18 @@ class BP_Friends_Friendship {
 		$filter = like_escape( $wpdb->escape( $filter ) );
 
 		$usermeta_table = $wpdb->prefix . 'usermeta';
-		$users_table = $wpdb->base_prefix . 'users';
+		$users_table    = $wpdb->base_prefix . 'users';
 
 		// filter the user_ids based on the search criteria.
 		if ( bp_is_active( 'xprofile' ) ) {
-			$sql = $wpdb->prepare( "SELECT COUNT(DISTINCT d.user_id) FROM {$bp->profile->table_name_data} d, $users_table u WHERE d.user_id = u.id AND d.value LIKE '$filter%%'" );
+			$sql = "SELECT COUNT(DISTINCT d.user_id) FROM {$bp->profile->table_name_data} d, {$users_table} u WHERE d.user_id = u.id AND d.value LIKE '{$filter}%%'";
 		} else {
-			$sql = $wpdb->prepare( "SELECT COUNT(DISTINCT user_id) FROM $usermeta_table WHERE meta_value LIKE '$filter%%'" );
+			$sql = "SELECT COUNT(DISTINCT user_id) FROM {$usermeta_table} WHERE meta_value LIKE '{$filter}%%'";
 		}
 
 		$user_count = $wpdb->get_col($sql);
 
-		if ( !$user_count )
+		if ( empty( $user_count ) )
 			return false;
 
 		return $user_count[0];
@@ -279,8 +280,9 @@ class BP_Friends_Friendship {
 	function get_random_friends( $user_id, $total_friends = 5 ) {
 		global $wpdb, $bp;
 
-		$sql = $wpdb->prepare( "SELECT friend_user_id, initiator_user_id FROM {$bp->friends->table_name} WHERE (friend_user_id = %d || initiator_user_id = %d) && is_confirmed = 1 ORDER BY rand() LIMIT %d", $user_id, $user_id, $total_friends );
-		$results = $wpdb->get_results($sql);
+		$fids    = array();
+		$sql     = $wpdb->prepare( "SELECT friend_user_id, initiator_user_id FROM {$bp->friends->table_name} WHERE (friend_user_id = %d || initiator_user_id = %d) && is_confirmed = 1 ORDER BY rand() LIMIT %d", $user_id, $user_id, $total_friends );
+		$results = $wpdb->get_results( $sql );
 
 		for ( $i = 0, $count = count( $results ); $i < $count; ++$i ) {
 			$fids[] = ( $results[$i]->friend_user_id == $user_id ) ? $results[$i]->initiator_user_id : $results[$i]->friend_user_id;
@@ -288,23 +290,30 @@ class BP_Friends_Friendship {
 
 		// remove duplicates
 		if ( count( $fids ) > 0 )
-			return array_flip(array_flip($fids));
+			return array_flip( array_flip( $fids ) );
 		else
 			return false;
 	}
 
 	function get_invitable_friend_count( $user_id, $group_id ) {
-		global $wpdb, $bp;
-
-		$friend_ids = BP_Friends_Friendship::get_friend_user_ids( $user_id );
 
+		// Setup some data we'll use below
+		$is_group_admin  = BP_Groups_Member::check_is_admin( $user_id, $group_id );
+		$friend_ids      = BP_Friends_Friendship::get_friend_user_ids( $user_id );
 		$invitable_count = 0;
+
 		for ( $i = 0, $count = count( $friend_ids ); $i < $count; ++$i ) {
 
-			if ( BP_Groups_Member::check_is_member( (int)$friend_ids[$i], $group_id ) )
+			// If already a member, they cannot be invited again
+			if ( BP_Groups_Member::check_is_member( (int) $friend_ids[$i], $group_id ) )
 				continue;
 
-			if ( BP_Groups_Member::check_has_invite( (int)$friend_ids[$i], $group_id )  )
+			// If user already has invite, they cannot be added
+			if ( BP_Groups_Member::check_has_invite( (int) $friend_ids[$i], $group_id )  )
+				continue;
+
+			// If user is not group admin and friend is banned, they cannot be invited
+			if ( ( false === $is_group_admin ) && BP_Groups_Member::check_is_banned( (int) $friend_ids[$i], $group_id ) )
 				continue;
 
 			$invitable_count++;
@@ -332,9 +341,10 @@ class BP_Friends_Friendship {
 		$wpdb->query( $wpdb->prepare( "DELETE FROM {$bp->core->table_name_notifications} WHERE component_name = 'friends' AND ( component_action = 'friendship_request' OR component_action = 'friendship_accepted' ) AND item_id = %d", $user_id ) );
 
 		// Loop through friend_ids and update their counts
-		foreach ( (array)$friend_ids as $friend_id ) {
+		foreach ( (array) $friend_ids as $friend_id ) {
 			BP_Friends_Friendship::total_friend_count( $friend_id );
 		}
 	}
 }
-?>
\ No newline at end of file
+
+?>
diff --git a/wp-content/plugins/buddypress/bp-friends/bp-friends-functions.php b/wp-content/plugins/buddypress/bp-friends/bp-friends-functions.php
index bc8cc959e8aaa52d5c22f0919a1362b6f58b8c7a..075a1d3f3d3185c7a4c94694ca3a78973fe00721 100644
--- a/wp-content/plugins/buddypress/bp-friends/bp-friends-functions.php
+++ b/wp-content/plugins/buddypress/bp-friends/bp-friends-functions.php
@@ -1,11 +1,15 @@
 <?php
-/********************************************************************************
- * Business Functions
+
+/**
+ * BuddyPress Friends Functions
  *
- * Business functions are where all the magic happens in BuddyPress. They will
+ * Functions are where all the magic happens in BuddyPress. They will
  * handle the actual saving or manipulation of information. Usually they will
  * hand off to a database class for data access, then return
  * true or false on success or failure.
+ *
+ * @package BuddyPress
+ * @subpackage FriendsFunctions
  */
 
 // Exit if accessed directly
@@ -16,7 +20,7 @@ function friends_add_friend( $initiator_userid, $friend_userid, $force_accept =
 
 	$friendship = new BP_Friends_Friendship;
 
-	if ( (int)$friendship->is_confirmed )
+	if ( (int) $friendship->is_confirmed )
 		return true;
 
 	$friendship->initiator_user_id = $initiator_userid;
@@ -39,6 +43,9 @@ function friends_add_friend( $initiator_userid, $friend_userid, $force_accept =
 
 			do_action( 'friends_friendship_requested', $friendship->id, $friendship->initiator_user_id, $friendship->friend_user_id );
 		} else {
+			// Update friend totals
+			friends_update_friend_totals( $friendship->initiator_user_id, $friendship->friend_user_id, 'add' );
+
 			do_action( 'friends_friendship_accepted', $friendship->id, $friendship->initiator_user_id, $friendship->friend_user_id );
 		}
 
@@ -49,7 +56,6 @@ function friends_add_friend( $initiator_userid, $friend_userid, $force_accept =
 }
 
 function friends_remove_friend( $initiator_userid, $friend_userid ) {
-	global $bp;
 
 	$friendship_id = BP_Friends_Friendship::get_friendship_id( $initiator_userid, $friend_userid );
 	$friendship    = new BP_Friends_Friendship( $friendship_id );
@@ -57,7 +63,7 @@ function friends_remove_friend( $initiator_userid, $friend_userid ) {
 	do_action( 'friends_before_friendship_delete', $friendship_id, $initiator_userid, $friend_userid );
 
 	// Remove the activity stream item for the user who canceled the friendship
-	friends_delete_activity( array( 'item_id' => $friendship_id, 'type' => 'friendship_accepted', 'user_id' => $bp->displayed_user->id ) );
+	friends_delete_activity( array( 'item_id' => $friendship_id, 'type' => 'friendship_accepted', 'user_id' => bp_displayed_user_id() ) );
 
 	do_action( 'friends_friendship_deleted', $friendship_id, $initiator_userid, $friend_userid );
 
@@ -133,9 +139,25 @@ function friends_reject_friendship( $friendship_id ) {
 	return false;
 }
 
-function friends_check_friendship( $user_id, $possible_friend_id ) {
+function friends_withdraw_friendship( $initiator_userid, $friend_userid ) {
 	global $bp;
 
+	$friendship_id = BP_Friends_Friendship::get_friendship_id( $initiator_userid, $friend_userid );
+	$friendship    = new BP_Friends_Friendship( $friendship_id, true, false );
+	
+	if ( !$friendship->is_confirmed && BP_Friends_Friendship::withdraw( $friendship_id ) ) {
+		// Remove the friend request notice
+		bp_core_delete_notifications_by_item_id( $friendship->friend_user_id, $friendship->initiator_user_id, $bp->friends->id, 'friendship_request' );
+
+		do_action_ref_array( 'friends_friendship_whithdrawn', array( $friendship_id, &$friendship ) );
+		return true;
+	}
+
+	return false;
+}
+
+function friends_check_friendship( $user_id, $possible_friend_id ) {
+
 	if ( 'is_friend' == BP_Friends_Friendship::check_is_friend( $user_id, $possible_friend_id ) )
 		return true;
 
@@ -148,16 +170,12 @@ function friends_check_friendship_status( $user_id, $possible_friend_id ) {
 }
 
 function friends_get_total_friend_count( $user_id = 0 ) {
-	global $bp;
+	if ( empty( $user_id ) )
+		$user_id = ( bp_displayed_user_id() ) ? bp_displayed_user_id() : bp_loggedin_user_id();
 
-	if ( !$user_id )
-		$user_id = ( $bp->displayed_user->id ) ? $bp->displayed_user->id : $bp->loggedin_user->id;
-
-	if ( !$count = wp_cache_get( 'bp_total_friend_count_' . $user_id, 'bp' ) ) {
-		$count = bp_get_user_meta( $user_id, 'total_friend_count', true );
-		if ( empty( $count ) ) $count = 0;
-		wp_cache_set( 'bp_total_friend_count_' . $user_id, $count, 'bp' );
-	}
+	$count = bp_get_user_meta( $user_id, 'total_friend_count', true );
+	if ( empty( $count ) )
+		$count = 0;
 
 	return apply_filters( 'friends_get_total_friend_count', $count );
 }
@@ -168,7 +186,7 @@ function friends_check_user_has_friends( $user_id ) {
 	if ( empty( $friend_count ) )
 		return false;
 
-	if ( !(int)$friend_count )
+	if ( !(int) $friend_count )
 		return false;
 
 	return true;
@@ -178,7 +196,7 @@ function friends_get_friendship_id( $initiator_user_id, $friend_user_id ) {
 	return BP_Friends_Friendship::get_friendship_id( $initiator_user_id, $friend_user_id );
 }
 
-function friends_get_friend_user_ids( $user_id, $friend_requests_only = false, $assoc_arr = false, $filter = false ) {
+function friends_get_friend_user_ids( $user_id, $friend_requests_only = false, $assoc_arr = false ) {
 	return BP_Friends_Friendship::get_friend_user_ids( $user_id, $friend_requests_only, $assoc_arr );
 }
 
@@ -206,25 +224,78 @@ function friends_get_bulk_last_active( $friend_ids ) {
 	return BP_Friends_Friendship::get_bulk_last_active( $friend_ids );
 }
 
-function friends_get_friends_invite_list( $user_id = 0 ) {
-	global $bp;
+/**
+ * Get a list of friends that a user can invite into this group.
+ * 
+ * Excludes friends that are already in the group, and banned friends if the
+ * user is not a group admin.
+ *
+ * @since 1.0
+ * @param int $user_id User ID whose friends to see can be invited
+ * @param int $group_id Group to check possible invitations against
+ * @return mixed False if no friends, array of users if friends
+ */
+function friends_get_friends_invite_list( $user_id = 0, $group_id = 0 ) {
+
+	// Default to logged in user id
+	if ( empty( $user_id ) )
+		$user_id = bp_loggedin_user_id();
+
+	// Only group admins can invited previously banned users
+	$user_is_admin = (bool) groups_is_user_admin( $user_id, $group_id );
+
+	// Assume no friends
+	$friends = array();
+
+	// Default args
+	$args = apply_filters( 'bp_friends_pre_get_invite_list', array(
+		'user_id'  => $user_id,
+		'type'     => 'alphabetical',
+		'per_page' => 0
+	) );
 
-	if ( !$user_id )
-		$user_id = $bp->loggedin_user->id;
+	// User has friends
+	if ( bp_has_members( $args ) ) {
 
-	if ( bp_has_members( 'user_id=' . $user_id . '&type=alphabetical&per_page=0' ) ) {
-		while ( bp_members() ) : bp_the_member();
+		/**
+		 * Loop through all friends and try to add them to the invitation list.
+		 *
+		 * Exclude friends that:
+		 *     1. are already members of the group
+		 *     2. are banned from this group if the current user is also not a
+		 *        group admin.
+		 */
+		while ( bp_members() ) :
+
+			// Load the member
+			bp_the_member();
+
+			// Get the user ID of the friend
+			$friend_user_id = bp_get_member_user_id();
+
+			// Skip friend if already in the group
+			if ( groups_is_user_member( $friend_user_id, $group_id ) )
+				continue;
+
+			// Skip friend if not group admin and user banned from group
+			if ( ( false === $user_is_admin ) && groups_is_user_banned( $friend_user_id, $group_id ) )
+				continue;
+
+			// Friend is safe, so add it to the array of possible friends
 			$friends[] = array(
-				'id' => bp_get_member_user_id(),
+				'id'        => $friend_user_id,
 				'full_name' => bp_get_member_name()
 			);
+
 		endwhile;
 	}
 
-	if ( empty($friends) )
-		return false;
+	// If no friends, explicitly set to false
+	if ( empty( $friends ) )
+		$friends = false;
 
-	return $friends;
+	// Allow friends to be filtered
+	return apply_filters( 'bp_friends_get_invite_list', $friends, $user_id, $group_id );
 }
 
 function friends_count_invitable_friends( $user_id, $group_id ) {
@@ -236,13 +307,13 @@ function friends_get_friend_count_for_user( $user_id ) {
 }
 
 function friends_search_users( $search_terms, $user_id, $pag_num = 0, $pag_page = 0 ) {
-	global $bp;
 
 	$user_ids = BP_Friends_Friendship::search_users( $search_terms, $user_id, $pag_num, $pag_page );
 
-	if ( !$user_ids )
+	if ( empty( $user_ids ) )
 		return false;
 
+	$users = array();
 	for ( $i = 0, $count = count( $user_ids ); $i < $count; ++$i )
 		$users[] = new BP_Core_User( $user_ids[$i] );
 
@@ -255,7 +326,6 @@ function friends_is_friendship_confirmed( $friendship_id ) {
 }
 
 function friends_update_friend_totals( $initiator_user_id, $friend_user_id, $status = 'add' ) {
-	global $bp;
 
 	if ( 'add' == $status ) {
 		bp_update_user_meta( $initiator_user_id, 'total_friend_count', (int)bp_get_user_meta( $initiator_user_id, 'total_friend_count', true ) + 1 );
@@ -271,7 +341,7 @@ function friends_remove_data( $user_id ) {
 
 	do_action( 'friends_before_remove_data', $user_id );
 
-	BP_Friends_Friendship::delete_all_for_user($user_id);
+	BP_Friends_Friendship::delete_all_for_user( $user_id );
 
 	// Remove usermeta
 	bp_delete_user_meta( $user_id, 'total_friend_count' );
@@ -285,4 +355,4 @@ add_action( 'wpmu_delete_user',  'friends_remove_data' );
 add_action( 'delete_user',       'friends_remove_data' );
 add_action( 'bp_make_spam_user', 'friends_remove_data' );
 
-?>
\ No newline at end of file
+?>
diff --git a/wp-content/plugins/buddypress/bp-friends/bp-friends-loader.php b/wp-content/plugins/buddypress/bp-friends/bp-friends-loader.php
index 83e9641a63924eff5b46ba65a9e8ce28eefcbdb4..99df5ab85b5af05b40bbfe5693ddde099516dde4 100644
--- a/wp-content/plugins/buddypress/bp-friends/bp-friends-loader.php
+++ b/wp-content/plugins/buddypress/bp-friends/bp-friends-loader.php
@@ -16,7 +16,7 @@ class BP_Friends_Component extends BP_Component {
 	/**
 	 * Start the friends component creation process
 	 *
-	 * @since 1.5
+	 * @since BuddyPress (1.5)
 	 */
 	function __construct() {
 		parent::start(
@@ -51,8 +51,8 @@ class BP_Friends_Component extends BP_Component {
 	 * The BP_FRIENDS_SLUG constant is deprecated, and only used here for
 	 * backwards compatibility.
 	 *
-	 * @since 1.5
-	 * @global obj $bp
+	 * @since BuddyPress (1.5)
+	 * @global BuddyPress $bp The one true BuddyPress instance
 	 */
 	function setup_globals() {
 		global $bp;
@@ -72,7 +72,6 @@ class BP_Friends_Component extends BP_Component {
 		// All globals for the friends component.
 		// Note that global_tables is included in this array.
 		$globals = array(
-			'path'                  => BP_PLUGIN_DIR,
 			'slug'                  => BP_FRIENDS_SLUG,
 			'has_directory'         => false,
 			'search_string'         => __( 'Search Friends...', 'buddypress' ),
@@ -86,11 +85,13 @@ class BP_Friends_Component extends BP_Component {
 	/**
 	 * Setup BuddyBar navigation
 	 *
-	 * @global obj $bp
+	 * @global BuddyPress $bp The one true BuddyPress instance
 	 */
 	function setup_nav() {
 		global $bp;
 
+		$sub_nav = array();
+
 		// Add 'Friends' to the main navigation
 		$main_nav = array(
 			'name'                => sprintf( __( 'Friends <span>%d</span>', 'buddypress' ), friends_get_total_friend_count() ),
@@ -101,7 +102,7 @@ class BP_Friends_Component extends BP_Component {
 			'item_css_id'         => $bp->friends->id
 		);
 
-		$friends_link = trailingslashit( $bp->loggedin_user->domain . bp_get_friends_slug() );
+		$friends_link = trailingslashit( bp_loggedin_user_domain() . bp_get_friends_slug() );
 
 		// Add the subnav items to the friends nav item
 		$sub_nav[] = array(
@@ -128,9 +129,9 @@ class BP_Friends_Component extends BP_Component {
 	}
 
 	/**
-	 * Set up the admin bar
+	 * Set up the Toolbar
 	 *
-	 * @global obj $bp
+	 * @global BuddyPress $bp The one true BuddyPress instance
 	 */
 	function setup_admin_bar() {
 		global $bp;
@@ -142,13 +143,14 @@ class BP_Friends_Component extends BP_Component {
 		if ( is_user_logged_in() ) {
 
 			// Setup the logged in user variables
-			$user_domain  = $bp->loggedin_user->domain;
+			$user_domain  = bp_loggedin_user_domain();
 			$friends_link = trailingslashit( $user_domain . $this->slug );
 
 			// Pending friend requests
-			if ( $count = count( friends_get_friendship_request_user_ids( $bp->loggedin_user->id ) ) ) {
-				$title   = sprintf( __( 'Friends <span class="count">%s</span>',          'buddypress' ), $count );
-				$pending = sprintf( __( 'Pending Requests <span class="count">%s</span>', 'buddypress' ), $count );
+			$count = count( friends_get_friendship_request_user_ids( bp_loggedin_user_id() ) );
+			if ( !empty( $count ) ) {
+				$title   = sprintf( __( 'Friends <span class="count">%s</span>',          'buddypress' ), number_format_i18n( $count ) );
+				$pending = sprintf( __( 'Pending Requests <span class="count">%s</span>', 'buddypress' ), number_format_i18n( $count ) );
 			} else {
 				$title   = __( 'Friends',             'buddypress' );
 				$pending = __( 'No Pending Requests', 'buddypress' );
@@ -185,7 +187,7 @@ class BP_Friends_Component extends BP_Component {
 	/**
 	 * Sets up the title for pages and <title>
 	 *
-	 * @global obj $bp
+	 * @global BuddyPress $bp The one true BuddyPress instance
 	 */
 	function setup_title() {
 		global $bp;
@@ -196,17 +198,22 @@ class BP_Friends_Component extends BP_Component {
 				$bp->bp_options_title = __( 'Friendships', 'buddypress' );
 			} else {
 				$bp->bp_options_avatar = bp_core_fetch_avatar( array(
-					'item_id' => $bp->displayed_user->id,
-					'type'    => 'thumb'
+					'item_id' => bp_displayed_user_id(),
+					'type'    => 'thumb',
+					'alt'     => sprintf( __( 'Profile picture of %s', 'buddypress' ), bp_get_displayed_user_fullname() )
 				) );
-				$bp->bp_options_title  = $bp->displayed_user->fullname;
+				$bp->bp_options_title = bp_get_displayed_user_fullname();
 			}
 		}
 
 		parent::setup_title();
 	}
 }
-// Create the friends component
-$bp->friends = new BP_Friends_Component();
+
+function bp_setup_friends() {
+	global $bp;
+	$bp->friends = new BP_Friends_Component();
+}
+add_action( 'bp_setup_components', 'bp_setup_friends', 6 );
 
 ?>
\ No newline at end of file
diff --git a/wp-content/plugins/buddypress/bp-friends/bp-friends-notifications.php b/wp-content/plugins/buddypress/bp-friends/bp-friends-notifications.php
index 59b2487929c25d729e1034aa56024d4a8d29d85a..76303d541aae5f7c3a6b75afeeabf77c0383b8e1 100644
--- a/wp-content/plugins/buddypress/bp-friends/bp-friends-notifications.php
+++ b/wp-content/plugins/buddypress/bp-friends/bp-friends-notifications.php
@@ -1,22 +1,30 @@
 <?php
+
+/**
+ * BuddyPress Friends Activity Functions
+ *
+ * These functions handle the recording, deleting and formatting of activity
+ * for the user and for this specific component.
+ *
+ * @package BuddyPress
+ * @subpackage FriendsActivity
+ */
+
 // Exit if accessed directly
 if ( !defined( 'ABSPATH' ) ) exit;
 
 function friends_notification_new_request( $friendship_id, $initiator_id, $friend_id ) {
-	global $bp;
 
 	$initiator_name = bp_core_get_user_displayname( $initiator_id );
 
-	if ( 'no' == bp_get_user_meta( (int)$friend_id, 'notification_friends_friendship_request', true ) )
+	if ( 'no' == bp_get_user_meta( (int) $friend_id, 'notification_friends_friendship_request', true ) )
 		return false;
 
-	$ud = get_userdata( $friend_id );
-	$initiator_ud = get_userdata( $initiator_id );
-
+	$ud                = get_userdata( $friend_id );
 	$all_requests_link = bp_core_get_user_domain( $friend_id ) . bp_get_friends_slug() . '/requests/';
-	$settings_link = bp_core_get_user_domain( $friend_id ) .  bp_get_settings_slug() . '/notifications';
-
-	$initiator_link = bp_core_get_user_domain( $initiator_id );
+	$settings_slug     = function_exists( 'bp_get_settings_slug' ) ? bp_get_settings_slug() : 'settings';
+	$settings_link     = trailingslashit( bp_core_get_user_domain( $friend_id ) .  $settings_slug . '/notifications' );
+	$initiator_link    = bp_core_get_user_domain( $initiator_id );
 
 	// Set up and send the message
 	$to       = $ud->user_email;
@@ -46,19 +54,16 @@ To view %3$s\'s profile: %4$s
 }
 
 function friends_notification_accepted_request( $friendship_id, $initiator_id, $friend_id ) {
-	global $bp;
-
-	$friendship = new BP_Friends_Friendship( $friendship_id, false, false );
 
 	$friend_name = bp_core_get_user_displayname( $friend_id );
 
-	if ( 'no' == bp_get_user_meta( (int)$initiator_id, 'notification_friends_friendship_accepted', true ) )
+	if ( 'no' == bp_get_user_meta( (int) $initiator_id, 'notification_friends_friendship_accepted', true ) )
 		return false;
 
-	$ud = get_userdata( $initiator_id );
-
-	$friend_link = bp_core_get_user_domain( $friend_id );
-	$settings_link = bp_core_get_user_domain( $initiator_id ) . bp_get_settings_slug() . '/notifications';
+	$ud            = get_userdata( $initiator_id );
+	$friend_link   = bp_core_get_user_domain( $friend_id );
+	$settings_slug = function_exists( 'bp_get_settings_slug' ) ? bp_get_settings_slug() : 'settings';
+	$settings_link = trailingslashit( bp_core_get_user_domain( $initiator_id ) . $settings_slug . '/notifications' );
 
 	// Set up and send the message
 	$to       = $ud->user_email;
@@ -85,4 +90,4 @@ To view %2$s\'s profile: %3$s
 	do_action( 'bp_friends_sent_accepted_email', $initiator_id, $subject, $message, $friendship_id, $friend_id );
 }
 
-?>
\ No newline at end of file
+?>
diff --git a/wp-content/plugins/buddypress/bp-friends/bp-friends-screens.php b/wp-content/plugins/buddypress/bp-friends/bp-friends-screens.php
index 5afbd07310ca261d0ab8d6f65670edf4cd83041b..29b376dda6223cc5ff2eac0ac6124c6ac040b2ac 100644
--- a/wp-content/plugins/buddypress/bp-friends/bp-friends-screens.php
+++ b/wp-content/plugins/buddypress/bp-friends/bp-friends-screens.php
@@ -1,8 +1,14 @@
 <?php
+
 /**
+ * BuddyPress Friends Screen Functions
+ *
  * Screen functions are the controllers of BuddyPress. They will execute when their
  * specific URL is caught. They will first save or manipulate data using business
  * functions, then pass on the user to a template file.
+ *
+ * @package BuddyPress
+ * @subpackage FriendsScreens
  */
 
 // Exit if accessed directly
@@ -12,7 +18,7 @@ function friends_screen_my_friends() {
 	global $bp;
 
 	// Delete any friendship acceptance notifications for the user when viewing a profile
-	bp_core_delete_notifications_by_type( $bp->loggedin_user->id, $bp->friends->id, 'friendship_accepted' );
+	bp_core_delete_notifications_by_type( bp_loggedin_user_id(), $bp->friends->id, 'friendship_accepted' );
 
 	do_action( 'friends_screen_my_friends' );
 
@@ -29,7 +35,7 @@ function friends_screen_requests() {
 		else
 			bp_core_add_message( __( 'Friendship could not be accepted', 'buddypress' ), 'error' );
 
-		bp_core_redirect( bp_loggedin_user_domain() . bp_current_component() . '/' . bp_current_action() );
+		bp_core_redirect( trailingslashit( bp_loggedin_user_domain() . bp_current_component() . '/' . bp_current_action() ) );
 
 	} elseif ( bp_is_action_variable( 'reject', 0 ) && is_numeric( bp_action_variable( 1 ) ) ) {
 		// Check the nonce
@@ -40,7 +46,18 @@ function friends_screen_requests() {
 		else
 			bp_core_add_message( __( 'Friendship could not be rejected', 'buddypress' ), 'error' );
 
-		bp_core_redirect( bp_loggedin_user_domain() . bp_current_component() . '/' . bp_current_action() );
+		bp_core_redirect( trailingslashit( bp_loggedin_user_domain() . bp_current_component() . '/' . bp_current_action() ) );
+		
+	} elseif ( bp_is_action_variable( 'cancel', 0 ) && is_numeric( bp_action_variable( 1 ) ) ) {
+		// Check the nonce
+		check_admin_referer( 'friends_withdraw_friendship' );
+
+		if ( friends_withdraw_friendship( bp_loggedin_user_id(), bp_action_variable( 1 ) ) )
+			bp_core_add_message( __( 'Friendship request withdrawn', 'buddypress' ) );
+		else
+			bp_core_add_message( __( 'Friendship request could not be withdrawn', 'buddypress' ), 'error' );
+
+		bp_core_redirect( trailingslashit( bp_loggedin_user_domain() . bp_current_component() . '/' . bp_current_action() ) );
 	}
 
 	do_action( 'friends_screen_requests' );
@@ -52,14 +69,12 @@ function friends_screen_requests() {
 }
 
 function friends_screen_notification_settings() {
-	global $bp;
 
-	if ( !$send_requests = bp_get_user_meta( $bp->displayed_user->id, 'notification_friends_friendship_request', true ) )
+	if ( !$send_requests = bp_get_user_meta( bp_displayed_user_id(), 'notification_friends_friendship_request', true ) )
 		$send_requests   = 'yes';
 
-	if ( !$accept_requests = bp_get_user_meta( $bp->displayed_user->id, 'notification_friends_friendship_accepted', true ) )
-		$accept_requests = 'yes';
-?>
+	if ( !$accept_requests = bp_get_user_meta( bp_displayed_user_id(), 'notification_friends_friendship_accepted', true ) )
+		$accept_requests = 'yes'; ?>
 
 	<table class="notification-settings" id="friends-notification-settings">
 		<thead>
@@ -94,4 +109,4 @@ function friends_screen_notification_settings() {
 }
 add_action( 'bp_notification_settings', 'friends_screen_notification_settings' );
 
-?>
\ No newline at end of file
+?>
diff --git a/wp-content/plugins/buddypress/bp-friends/bp-friends-template.php b/wp-content/plugins/buddypress/bp-friends/bp-friends-template.php
index 71833bdd327bc002815ef7894670f0b07929ac04..689083ca6bb1db2df3fe34dc7e74a13fc0b6ce65 100644
--- a/wp-content/plugins/buddypress/bp-friends/bp-friends-template.php
+++ b/wp-content/plugins/buddypress/bp-friends/bp-friends-template.php
@@ -1,4 +1,12 @@
 <?php
+
+/**
+ * BuddyPress Friends Template Functions
+ *
+ * @package BuddyPress
+ * @subpackage FriendsTemplate
+ */
+
 // Exit if accessed directly
 if ( !defined( 'ABSPATH' ) ) exit;
 
@@ -7,7 +15,7 @@ if ( !defined( 'ABSPATH' ) ) exit;
  *
  * @package BuddyPress
  * @subpackage Friends Template
- * @since 1.5
+ * @since BuddyPress (1.5)
  *
  * @uses bp_get_friends_slug()
  */
@@ -19,7 +27,7 @@ function bp_friends_slug() {
 	 *
 	 * @package BuddyPress
 	 * @subpackage Friends Template
-	 * @since 1.5
+	 * @since BuddyPress (1.5)
 	 */
 	function bp_get_friends_slug() {
 		global $bp;
@@ -31,7 +39,7 @@ function bp_friends_slug() {
  *
  * @package BuddyPress
  * @subpackage Friends Template
- * @since 1.5
+ * @since BuddyPress (1.5)
  *
  * @uses bp_get_friends_root_slug()
  */
@@ -43,62 +51,22 @@ function bp_friends_root_slug() {
 	 *
 	 * @package BuddyPress
 	 * @subpackage Friends Template
-	 * @since 1.5
+	 * @since BuddyPress (1.5)
 	 */
 	function bp_get_friends_root_slug() {
 		global $bp;
 		return apply_filters( 'bp_get_friends_root_slug', $bp->friends->root_slug );
 	}
 
-/**
- * Displays Friends header tabs
- *
- * @package BuddyPress
- * @todo Deprecate?
- */
-function bp_friends_header_tabs() {
-	global $bp; ?>
-
-	<li<?php if ( !bp_action_variable( 0 ) || bp_is_action_variable( 'recently-active', 0 ) ) : ?> class="current"<?php endif; ?>><a href="<?php echo $bp->displayed_user->domain . bp_get_friends_slug() ?>/my-friends/recently-active"><?php _e( 'Recently Active', 'buddypress' ) ?></a></li>
-	<li<?php if ( bp_is_action_variable( 'newest', 0 ) ) : ?> class="current"<?php endif; ?>><a href="<?php echo $bp->displayed_user->domain . bp_get_friends_slug() ?>/my-friends/newest"><?php _e( 'Newest', 'buddypress' ) ?></a></li>
-	<li<?php if ( bp_is_action_variable( 'alphabetically', 0 ) ) : ?> class="current"<?php endif; ?>><a href="<?php echo $bp->displayed_user->domain . bp_get_friends_slug() ?>/my-friends/alphabetically"><?php _e( 'Alphabetically', 'buddypress' ) ?></a></li>
-
-<?php
-	do_action( 'friends_header_tabs' );
-}
-
-/**
- * Filters the title for the Friends component
- *
- * @package BuddyPress
- * @todo Deprecate?
- */
-function bp_friends_filter_title() {
-	$current_filter = bp_action_variable( 0 );
-
-	switch ( $current_filter ) {
-		case 'recently-active': default:
-			_e( 'Recently Active', 'buddypress' );
-			break;
-		case 'newest':
-			_e( 'Newest', 'buddypress' );
-			break;
-		case 'alphabetically':
-			_e( 'Alphabetically', 'buddypress' );
-			break;
-	}
-}
-
 function bp_friends_random_friends() {
-	global $bp;
 
-	if ( !$friend_ids = wp_cache_get( 'friends_friend_ids_' . $bp->displayed_user->id, 'bp' ) ) {
-		$friend_ids = BP_Friends_Friendship::get_random_friends( $bp->displayed_user->id );
-		wp_cache_set( 'friends_friend_ids_' . $bp->displayed_user->id, $friend_ids, 'bp' );
+	if ( !$friend_ids = wp_cache_get( 'friends_friend_ids_' . bp_displayed_user_id(), 'bp' ) ) {
+		$friend_ids = BP_Friends_Friendship::get_random_friends( bp_displayed_user_id() );
+		wp_cache_set( 'friends_friend_ids_' . bp_displayed_user_id(), $friend_ids, 'bp' );
 	} ?>
 
 	<div class="info-group">
-		<h4><?php bp_word_or_name( __( "My Friends", 'buddypress' ), __( "%s's Friends", 'buddypress' ) ) ?>  (<?php echo BP_Friends_Friendship::total_friend_count( $bp->displayed_user->id ) ?>) <span><a href="<?php echo $bp->displayed_user->domain . bp_get_friends_slug() ?>"><?php _e('See All', 'buddypress') ?></a></span></h4>
+		<h4><?php bp_word_or_name( __( "My Friends", 'buddypress' ), __( "%s's Friends", 'buddypress' ) ) ?>  (<?php echo BP_Friends_Friendship::total_friend_count( bp_displayed_user_id() ) ?>) <span><a href="<?php echo trailingslashit( bp_displayed_user_domain() . bp_get_friends_slug() ) ?>"><?php _e('See All', 'buddypress') ?></a></span></h4>
 
 		<?php if ( $friend_ids ) { ?>
 
@@ -122,8 +90,10 @@ function bp_friends_random_friends() {
 			</div>
 
 		<?php } ?>
+
 		<div class="clear"></div>
 	</div>
+
 <?php
 }
 
@@ -137,7 +107,6 @@ function bp_friends_random_friends() {
  * @param int $total_members The number of members to retrieve
  */
 function bp_friends_random_members( $total_members = 5 ) {
-	global $bp;
 
 	if ( !$user_ids = wp_cache_get( 'friends_random_users', 'bp' ) ) {
 		$user_ids = BP_Core_User::get_users( 'random', $total_members );
@@ -195,10 +164,9 @@ function bp_friends_random_members( $total_members = 5 ) {
 }
 
 function bp_friend_search_form() {
-	global $friends_template, $bp;
 
-	$action = $bp->displayed_user->domain . bp_get_friends_slug() . '/my-friends/search/';
-	$label = __( 'Filter Friends', 'buddypress' ); ?>
+	$action = bp_displayed_user_domain() . bp_get_friends_slug() . '/my-friends/search/';
+	$label  = __( 'Filter Friends', 'buddypress' ); ?>
 
 		<form action="<?php echo $action ?>" id="friend-search-form" method="post">
 
@@ -207,7 +175,7 @@ function bp_friend_search_form() {
 
 			<?php wp_nonce_field( 'friends_search', '_wpnonce_friend_search' ) ?>
 
-			<input type="hidden" name="initiator" id="initiator" value="<?php echo esc_attr( $bp->displayed_user->id ) ?>" />
+			<input type="hidden" name="initiator" id="initiator" value="<?php echo esc_attr( bp_displayed_user_id() ) ?>" />
 
 		</form>
 
@@ -227,8 +195,6 @@ function bp_member_add_friend_button() {
 add_action( 'bp_directory_members_actions', 'bp_member_add_friend_button' );
 
 function bp_member_total_friend_count() {
-	global $members_template;
-
 	echo bp_get_member_total_friend_count();
 }
 	function bp_get_member_total_friend_count() {
@@ -256,20 +222,19 @@ function bp_potential_friend_id( $user_id = 0 ) {
 	 *
 	 * Returns the ID of the potential friend
 	 *
-	 * @global object $bp
 	 * @global object $friends_template
 	 * @param int $user_id
 	 * @return int ID of potential friend
 	 */
 	function bp_get_potential_friend_id( $user_id = 0 ) {
-		global $bp, $friends_template;
+		global $friends_template;
 
 		if ( empty( $user_id ) && isset( $friends_template->friendship->friend ) )
 			$user_id = $friends_template->friendship->friend->id;
 		else if ( empty( $user_id ) && !isset( $friends_template->friendship->friend ) )
-			$user_id = $bp->displayed_user->id;
+			$user_id = bp_displayed_user_id();
 
-		return apply_filters( 'bp_get_potential_friend_id', (int)$user_id );
+		return apply_filters( 'bp_get_potential_friend_id', (int) $user_id );
 	}
 
 /**
@@ -277,12 +242,10 @@ function bp_potential_friend_id( $user_id = 0 ) {
  *
  * Returns - 'is_friend', 'not_friends', 'pending'
  *
- * @global object $bp
  * @param int $potential_friend_id
  * @return string
  */
 function bp_is_friend( $user_id = 0 ) {
-	global $bp;
 
 	if ( !is_user_logged_in() )
 		return false;
@@ -290,17 +253,16 @@ function bp_is_friend( $user_id = 0 ) {
 	if ( empty( $user_id ) )
 		$user_id = bp_get_potential_friend_id( $user_id );
 
-	if ( $bp->loggedin_user->id == $user_id )
+	if ( bp_loggedin_user_id() == $user_id )
 		return false;
 
-	return apply_filters( 'bp_is_friend', friends_check_friendship_status( $bp->loggedin_user->id, $user_id ), $user_id );
+	return apply_filters( 'bp_is_friend', friends_check_friendship_status( bp_loggedin_user_id(), $user_id ), $user_id );
 }
 
 function bp_add_friend_button( $potential_friend_id = 0, $friend_status = false ) {
 	echo bp_get_add_friend_button( $potential_friend_id, $friend_status );
 }
 	function bp_get_add_friend_button( $potential_friend_id = 0, $friend_status = false ) {
-		global $bp, $friends_template;
 
 		if ( empty( $potential_friend_id ) )
 			$potential_friend_id = bp_get_potential_friend_id( $potential_friend_id );
@@ -317,12 +279,14 @@ function bp_add_friend_button( $potential_friend_id = 0, $friend_status = false
 					'component'         => 'friends',
 					'must_be_logged_in' => true,
 					'block_self'        => true,
-					'wrapper_class'     => 'friendship-button pending',
+					'wrapper_class'     => 'friendship-button pending_friend',
 					'wrapper_id'        => 'friendship-button-' . $potential_friend_id,
-					'link_href'         => trailingslashit( $bp->loggedin_user->domain . bp_get_friends_slug() . '/requests' ),
-					'link_text'         => __( 'Friendship Requested', 'buddypress' ),
-					'link_title'        => __( 'Friendship Requested', 'buddypress' ),
-					'link_class'        => 'friendship-button pending requested'
+					'link_href'         => wp_nonce_url( bp_loggedin_user_domain() . bp_get_friends_slug() . '/requests/cancel/' . $potential_friend_id . '/', 'friends_withdraw_friendship' ),
+					'link_text'         => __( 'Cancel Friendship Request', 'buddypress' ),
+					'link_title'        => __( 'Cancel Friendship Requested', 'buddypress' ),
+					'link_id'			=> 'friend-' . $potential_friend_id,
+					'link_rel'			=> 'remove',
+					'link_class'        => 'friendship-button pending_friend requested'
 				);
 				break;
 
@@ -334,7 +298,7 @@ function bp_add_friend_button( $potential_friend_id = 0, $friend_status = false
 					'block_self'        => false,
 					'wrapper_class'     => 'friendship-button is_friend',
 					'wrapper_id'        => 'friendship-button-' . $potential_friend_id,
-					'link_href'         => wp_nonce_url( $bp->loggedin_user->domain . bp_get_friends_slug() . '/remove-friend/' . $potential_friend_id . '/', 'friends_remove_friend' ),
+					'link_href'         => wp_nonce_url( bp_loggedin_user_domain() . bp_get_friends_slug() . '/remove-friend/' . $potential_friend_id . '/', 'friends_remove_friend' ),
 					'link_text'         => __( 'Cancel Friendship', 'buddypress' ),
 					'link_title'        => __( 'Cancel Friendship', 'buddypress' ),
 					'link_id'           => 'friend-' . $potential_friend_id,
@@ -351,7 +315,7 @@ function bp_add_friend_button( $potential_friend_id = 0, $friend_status = false
 					'block_self'        => true,
 					'wrapper_class'     => 'friendship-button not_friends',
 					'wrapper_id'        => 'friendship-button-' . $potential_friend_id,
-					'link_href'         => wp_nonce_url( $bp->loggedin_user->domain . bp_get_friends_slug() . '/add-friend/' . $potential_friend_id . '/', 'friends_add_friend' ),
+					'link_href'         => wp_nonce_url( bp_loggedin_user_domain() . bp_get_friends_slug() . '/add-friend/' . $potential_friend_id . '/', 'friends_add_friend' ),
 					'link_text'         => __( 'Add Friend', 'buddypress' ),
 					'link_title'        => __( 'Add Friend', 'buddypress' ),
 					'link_id'           => 'friend-' . $potential_friend_id,
@@ -366,10 +330,9 @@ function bp_add_friend_button( $potential_friend_id = 0, $friend_status = false
 	}
 
 function bp_get_friend_ids( $user_id = 0 ) {
-	global $bp;
 
-	if ( !$user_id )
-		$user_id = ( $bp->displayed_user->id ) ? $bp->displayed_user->id : $bp->loggedin_user->id;
+	if ( empty( $user_id ) )
+		$user_id = ( bp_displayed_user_id() ) ? bp_displayed_user_id() : bp_loggedin_user_id();
 
 	$friend_ids = friends_get_friend_user_ids( $user_id );
 
@@ -378,21 +341,45 @@ function bp_get_friend_ids( $user_id = 0 ) {
 
 	return implode( ',', friends_get_friend_user_ids( $user_id ) );
 }
-function bp_get_friendship_requests() {
-	global $bp;
 
-	return apply_filters( 'bp_get_friendship_requests', implode( ',', (array) friends_get_friendship_request_user_ids( $bp->loggedin_user->id ) ) );
+/**
+ * Get a user's friendship requests
+ *
+ * Note that we return a 0 if no pending requests are found. This is necessary because of the
+ * structure of the $include parameter in bp_has_members().
+ *
+ * @param int $user_id Defaults to displayed user
+ * @return mixed Returns an array of users if found, or a 0 if none are found
+ */
+function bp_get_friendship_requests( $user_id = 0 ) {
+	if ( !$user_id ) {
+		$user_id = bp_displayed_user_id();
+	}
+	
+	if ( !$user_id ) {
+		return 0;	
+	}
+	
+	$requests = friends_get_friendship_request_user_ids( $user_id );
+	
+	if ( !empty( $requests ) ) {
+		$requests = implode( ',', (array) $requests );
+	} else {
+		$requests = 0;
+	}
+	
+	return apply_filters( 'bp_get_friendship_requests', $requests );
 }
 
 function bp_friend_friendship_id() {
 	echo bp_get_friend_friendship_id();
 }
 	function bp_get_friend_friendship_id() {
-		global $members_template, $bp;
+		global $members_template;
 
-		if ( !$friendship_id = wp_cache_get( 'friendship_id_' . $members_template->member->id . '_' . $bp->loggedin_user->id ) ) {
-			$friendship_id = friends_get_friendship_id( $members_template->member->id, $bp->loggedin_user->id );
-			wp_cache_set( 'friendship_id_' . $members_template->member->id . '_' . $bp->loggedin_user->id, $friendship_id, 'bp' );
+		if ( !$friendship_id = wp_cache_get( 'friendship_id_' . $members_template->member->id . '_' . bp_loggedin_user_id() ) ) {
+			$friendship_id = friends_get_friendship_id( $members_template->member->id, bp_loggedin_user_id() );
+			wp_cache_set( 'friendship_id_' . $members_template->member->id . '_' . bp_loggedin_user_id(), $friendship_id, 'bp' );
 		}
 
 		return apply_filters( 'bp_get_friend_friendship_id', $friendship_id );
@@ -402,28 +389,28 @@ function bp_friend_accept_request_link() {
 	echo bp_get_friend_accept_request_link();
 }
 	function bp_get_friend_accept_request_link() {
-		global $members_template, $bp;
+		global $members_template;
 
-		if ( !$friendship_id = wp_cache_get( 'friendship_id_' . $members_template->member->id . '_' . $bp->loggedin_user->id ) ) {
-			$friendship_id = friends_get_friendship_id( $members_template->member->id, $bp->loggedin_user->id );
-			wp_cache_set( 'friendship_id_' . $members_template->member->id . '_' . $bp->loggedin_user->id, $friendship_id, 'bp' );
+		if ( !$friendship_id = wp_cache_get( 'friendship_id_' . $members_template->member->id . '_' . bp_loggedin_user_id() ) ) {
+			$friendship_id = friends_get_friendship_id( $members_template->member->id, bp_loggedin_user_id() );
+			wp_cache_set( 'friendship_id_' . $members_template->member->id . '_' . bp_loggedin_user_id(), $friendship_id, 'bp' );
 		}
 
-		return apply_filters( 'bp_get_friend_accept_request_link', wp_nonce_url( $bp->loggedin_user->domain . bp_get_friends_slug() . '/requests/accept/' . $friendship_id, 'friends_accept_friendship' ) );
+		return apply_filters( 'bp_get_friend_accept_request_link', wp_nonce_url( bp_loggedin_user_domain() . bp_get_friends_slug() . '/requests/accept/' . $friendship_id, 'friends_accept_friendship' ) );
 	}
 
 function bp_friend_reject_request_link() {
 	echo bp_get_friend_reject_request_link();
 }
 	function bp_get_friend_reject_request_link() {
-		global $members_template, $bp;
+		global $members_template;
 
-		if ( !$friendship_id = wp_cache_get( 'friendship_id_' . $members_template->member->id . '_' . $bp->loggedin_user->id ) ) {
-			$friendship_id = friends_get_friendship_id( $members_template->member->id, $bp->loggedin_user->id );
-			wp_cache_set( 'friendship_id_' . $members_template->member->id . '_' . $bp->loggedin_user->id, $friendship_id, 'bp' );
+		if ( !$friendship_id = wp_cache_get( 'friendship_id_' . $members_template->member->id . '_' . bp_loggedin_user_id() ) ) {
+			$friendship_id = friends_get_friendship_id( $members_template->member->id, bp_loggedin_user_id() );
+			wp_cache_set( 'friendship_id_' . $members_template->member->id . '_' . bp_loggedin_user_id(), $friendship_id, 'bp' );
 		}
 
-		return apply_filters( 'bp_get_friend_reject_request_link', wp_nonce_url( $bp->loggedin_user->domain . bp_get_friends_slug() . '/requests/reject/' . $friendship_id, 'friends_reject_friendship' ) );
+		return apply_filters( 'bp_get_friend_reject_request_link', wp_nonce_url( bp_loggedin_user_domain() . bp_get_friends_slug() . '/requests/reject/' . $friendship_id, 'friends_reject_friendship' ) );
 	}
 
 function bp_total_friend_count( $user_id = 0 ) {
@@ -438,12 +425,10 @@ function bp_friend_total_requests_count( $user_id = 0 ) {
 	echo bp_friend_get_total_requests_count( $user_id );
 }
 	function bp_friend_get_total_requests_count( $user_id = 0 ) {
-		global $bp;
-
 		if ( empty( $user_id ) )
-			$user_id = $bp->loggedin_user->id;
+			$user_id = bp_loggedin_user_id();
 
 		return apply_filters( 'bp_friend_get_total_requests_count', count( BP_Friends_Friendship::get_friend_user_ids( $user_id, true ) ) );
 	}
 
-?>
\ No newline at end of file
+?>
diff --git a/wp-content/plugins/buddypress/bp-groups/bp-groups-actions.php b/wp-content/plugins/buddypress/bp-groups/bp-groups-actions.php
index 74766e2a4dcec8984a1a68d2a1e94709d104b4d8..fa16119b613b3d3c497374cfa28af4f7babd3814 100644
--- a/wp-content/plugins/buddypress/bp-groups/bp-groups-actions.php
+++ b/wp-content/plugins/buddypress/bp-groups/bp-groups-actions.php
@@ -1,10 +1,14 @@
 <?php
-/********************************************************************************
- * Action Functions
+
+/**
+ * BuddyPress Groups Actions
  *
  * Action functions are exactly the same as screen functions, however they do not
  * have a template screen associated with them. Usually they will send the user
  * back to the default screen after execution.
+ *
+ * @package BuddyPress
+ * @subpackage GroupsActions
  */
 
 // Exit if accessed directly
@@ -30,7 +34,7 @@ function groups_action_create_group() {
 
 	// If no current step is set, reset everything so we can start a fresh group creation
 	$bp->groups->current_create_step = bp_action_variable( 1 );
-	if ( !$bp->groups->current_create_step ) {
+	if ( !bp_get_groups_current_create_step() ) {
 		unset( $bp->groups->current_create_step );
 		unset( $bp->groups->completed_create_steps );
 
@@ -42,7 +46,7 @@ function groups_action_create_group() {
 	}
 
 	// If this is a creation step that is not recognized, just redirect them back to the first screen
-	if ( !empty( $bp->groups->current_create_step ) && empty( $bp->groups->group_creation_steps[$bp->groups->current_create_step] ) ) {
+	if ( bp_get_groups_current_create_step() && empty( $bp->groups->group_creation_steps[bp_get_groups_current_create_step()] ) ) {
 		bp_core_add_message( __('There was an error saving group details. Please try again.', 'buddypress'), 'error' );
 		bp_core_redirect( bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/create/' );
 	}
@@ -54,33 +58,33 @@ function groups_action_create_group() {
 	// Set the ID of the new group, if it has already been created in a previous step
 	if ( isset( $_COOKIE['bp_new_group_id'] ) ) {
 		$bp->groups->new_group_id = $_COOKIE['bp_new_group_id'];
-		$bp->groups->current_group = new BP_Groups_Group( $bp->groups->new_group_id );
+		$bp->groups->current_group = groups_get_group( array( 'group_id' => $bp->groups->new_group_id ) );
 	}
 
 	// If the save, upload or skip button is hit, lets calculate what we need to save
 	if ( isset( $_POST['save'] ) ) {
 
 		// Check the nonce
-		check_admin_referer( 'groups_create_save_' . $bp->groups->current_create_step );
+		check_admin_referer( 'groups_create_save_' . bp_get_groups_current_create_step() );
 
-		if ( 'group-details' == $bp->groups->current_create_step ) {
+		if ( 'group-details' == bp_get_groups_current_create_step() ) {
 			if ( empty( $_POST['group-name'] ) || empty( $_POST['group-desc'] ) || !strlen( trim( $_POST['group-name'] ) ) || !strlen( trim( $_POST['group-desc'] ) ) ) {
 				bp_core_add_message( __( 'Please fill in all of the required fields', 'buddypress' ), 'error' );
-				bp_core_redirect( bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/create/step/' . $bp->groups->current_create_step . '/' );
+				bp_core_redirect( bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/create/step/' . bp_get_groups_current_create_step() . '/' );
 			}
 
 			$new_group_id = isset( $bp->groups->new_group_id ) ? $bp->groups->new_group_id : 0;
 
 			if ( !$bp->groups->new_group_id = groups_create_group( array( 'group_id' => $new_group_id, 'name' => $_POST['group-name'], 'description' => $_POST['group-desc'], 'slug' => groups_check_slug( sanitize_title( esc_attr( $_POST['group-name'] ) ) ), 'date_created' => bp_core_current_time(), 'status' => 'public' ) ) ) {
 				bp_core_add_message( __( 'There was an error saving group details, please try again.', 'buddypress' ), 'error' );
-				bp_core_redirect( bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/create/step/' . $bp->groups->current_create_step . '/' );
+				bp_core_redirect( bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/create/step/' . bp_get_groups_current_create_step() . '/' );
 			}
 
 			groups_update_groupmeta( $bp->groups->new_group_id, 'total_member_count', 1 );
 			groups_update_groupmeta( $bp->groups->new_group_id, 'last_activity', bp_core_current_time() );
 		}
 
-		if ( 'group-settings' == $bp->groups->current_create_step ) {
+		if ( 'group-settings' == bp_get_groups_current_create_step() ) {
 			$group_status = 'public';
 			$group_enable_forum = 1;
 
@@ -88,7 +92,7 @@ function groups_action_create_group() {
 				$group_enable_forum = 0;
 			} else {
 				// Create the forum if enable_forum = 1
-				if ( bp_is_active( 'forums' ) && '' == groups_get_groupmeta( $bp->groups->new_group_id, 'forum_id' ) ) {
+				if ( bp_is_active( 'forums' ) && !groups_get_groupmeta( $bp->groups->new_group_id, 'forum_id' ) ) {
 					groups_new_group_forum();
 				}
 			}
@@ -100,21 +104,21 @@ function groups_action_create_group() {
 
 			if ( !$bp->groups->new_group_id = groups_create_group( array( 'group_id' => $bp->groups->new_group_id, 'status' => $group_status, 'enable_forum' => $group_enable_forum ) ) ) {
 				bp_core_add_message( __( 'There was an error saving group details, please try again.', 'buddypress' ), 'error' );
-				bp_core_redirect( bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/create/step/' . $bp->groups->current_create_step . '/' );
+				bp_core_redirect( bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/create/step/' . bp_get_groups_current_create_step() . '/' );
 			}
 
-			// Set the invite status			
+			// Set the invite status
 			// Checked against a whitelist for security
 			$allowed_invite_status = apply_filters( 'groups_allowed_invite_status', array( 'members', 'mods', 'admins' ) );
-			$invite_status	       = !empty( $_POST['group-invite-status'] ) && in_array( $_POST['group-invite-status'], (array)$allowed_invite_status ) ? $_POST['group-invite-status'] : 'members';
+			$invite_status	       = !empty( $_POST['group-invite-status'] ) && in_array( $_POST['group-invite-status'], (array) $allowed_invite_status ) ? $_POST['group-invite-status'] : 'members';
 
 			groups_update_groupmeta( $bp->groups->new_group_id, 'invite_status', $invite_status );
 		}
 
-		if ( 'group-invites' == $bp->groups->current_create_step )
-			groups_send_invites( $bp->loggedin_user->id, $bp->groups->new_group_id );
+		if ( 'group-invites' == bp_get_groups_current_create_step() )
+			groups_send_invites( bp_loggedin_user_id(), $bp->groups->new_group_id );
 
-		do_action( 'groups_create_group_step_save_' . $bp->groups->current_create_step );
+		do_action( 'groups_create_group_step_save_' . bp_get_groups_current_create_step() );
 		do_action( 'groups_create_group_step_complete' ); // Mostly for clearing cache on a generic action name
 
 		/**
@@ -123,8 +127,8 @@ function groups_action_create_group() {
 		 * holding the information
 		 */
 		$completed_create_steps = isset( $bp->groups->completed_create_steps ) ? $bp->groups->completed_create_steps : array();
-		if ( !in_array( $bp->groups->current_create_step, $completed_create_steps ) )
-			$bp->groups->completed_create_steps[] = $bp->groups->current_create_step;
+		if ( !in_array( bp_get_groups_current_create_step(), $completed_create_steps ) )
+			$bp->groups->completed_create_steps[] = bp_get_groups_current_create_step();
 
 		// Reset cookie info
 		setcookie( 'bp_new_group_id', $bp->groups->new_group_id, time()+60*60*24, COOKIEPATH );
@@ -132,13 +136,13 @@ function groups_action_create_group() {
 
 		// If we have completed all steps and hit done on the final step we
 		// can redirect to the completed group
-		if ( count( $bp->groups->completed_create_steps ) == count( $bp->groups->group_creation_steps ) && $bp->groups->current_create_step == array_pop( array_keys( $bp->groups->group_creation_steps ) ) ) {
+		if ( count( $bp->groups->completed_create_steps ) == count( $bp->groups->group_creation_steps ) && bp_get_groups_current_create_step() == array_pop( array_keys( $bp->groups->group_creation_steps ) ) ) {
 			unset( $bp->groups->current_create_step );
 			unset( $bp->groups->completed_create_steps );
 
 			// Once we compelete all steps, record the group creation in the activity stream.
 			groups_record_activity( array(
-				'action' => apply_filters( 'groups_activity_created_group_action', sprintf( __( '%1$s created the group %2$s', 'buddypress'), bp_core_get_userlink( $bp->loggedin_user->id ), '<a href="' . bp_get_group_permalink( $bp->groups->current_group ) . '">' . esc_attr( $bp->groups->current_group->name ) . '</a>' ) ),
+				'action' => apply_filters( 'groups_activity_created_group_action', sprintf( __( '%1$s created the group %2$s', 'buddypress'), bp_core_get_userlink( bp_loggedin_user_id() ), '<a href="' . bp_get_group_permalink( $bp->groups->current_group ) . '">' . esc_attr( $bp->groups->current_group->name ) . '</a>' ) ),
 				'type' => 'created_group',
 				'item_id' => $bp->groups->new_group_id
 			) );
@@ -151,8 +155,8 @@ function groups_action_create_group() {
 			 * Since we don't know what the next step is going to be (any plugin can insert steps)
 			 * we need to loop the step array and fetch the next step that way.
 			 */
-			foreach ( (array)$bp->groups->group_creation_steps as $key => $value ) {
-				if ( $key == $bp->groups->current_create_step ) {
+			foreach ( (array) $bp->groups->group_creation_steps as $key => $value ) {
+				if ( $key == bp_get_groups_current_create_step() ) {
 					$next = 1;
 					continue;
 				}
@@ -168,7 +172,7 @@ function groups_action_create_group() {
 	}
 
 	// Group avatar is handled separately
-	if ( 'group-avatar' == $bp->groups->current_create_step && isset( $_POST['upload'] ) ) {
+	if ( 'group-avatar' == bp_get_groups_current_create_step() && isset( $_POST['upload'] ) ) {
 		if ( !empty( $_FILES ) && isset( $_POST['upload'] ) ) {
 			// Normally we would check a nonce here, but the group save nonce is used instead
 
@@ -207,11 +211,11 @@ function groups_action_join_group() {
 		return false;
 
 	// Skip if banned or already a member
-	if ( !groups_is_user_member( $bp->loggedin_user->id, $bp->groups->current_group->id ) && !groups_is_user_banned( $bp->loggedin_user->id, $bp->groups->current_group->id ) ) {
+	if ( !groups_is_user_member( bp_loggedin_user_id(), $bp->groups->current_group->id ) && !groups_is_user_banned( bp_loggedin_user_id(), $bp->groups->current_group->id ) ) {
 
 		// User wants to join a group that is not public
 		if ( $bp->groups->current_group->status != 'public' ) {
-			if ( !groups_check_user_has_invite( $bp->loggedin_user->id, $bp->groups->current_group->id ) ) {
+			if ( !groups_check_user_has_invite( bp_loggedin_user_id(), $bp->groups->current_group->id ) ) {
 				bp_core_add_message( __( 'There was an error joining the group.', 'buddypress' ), 'error' );
 				bp_core_redirect( bp_get_group_permalink( $bp->groups->current_group ) );
 			}
@@ -242,11 +246,11 @@ function groups_action_leave_group() {
 		return false;
 
 	// User wants to leave any group
-	if ( groups_is_user_member( $bp->loggedin_user->id, $bp->groups->current_group->id ) ) {
+	if ( groups_is_user_member( bp_loggedin_user_id(), $bp->groups->current_group->id ) ) {
 
 		// Stop sole admins from abandoning their group
 		$group_admins = groups_get_group_admins( $bp->groups->current_group->id );
-	 	if ( 1 == count( $group_admins ) && $group_admins[0]->user_id == $bp->loggedin_user->id )
+	 	if ( 1 == count( $group_admins ) && $group_admins[0]->user_id == bp_loggedin_user_id() )
 			bp_core_add_message( __( 'This group must have at least one admin', 'buddypress' ), 'error' );
 
 		elseif ( !groups_leave_group( $bp->groups->current_group->id ) )
@@ -271,7 +275,7 @@ function groups_action_sort_creation_steps() {
 	if ( !is_array( $bp->groups->group_creation_steps ) )
 		return false;
 
-	foreach ( (array)$bp->groups->group_creation_steps as $slug => $step ) {
+	foreach ( (array) $bp->groups->group_creation_steps as $slug => $step ) {
 		while ( !empty( $temp[$step['position']] ) )
 			$step['position']++;
 
@@ -282,15 +286,17 @@ function groups_action_sort_creation_steps() {
 	ksort($temp);
 	unset($bp->groups->group_creation_steps);
 
-	foreach( (array)$temp as $position => $step )
+	foreach( (array) $temp as $position => $step )
 		$bp->groups->group_creation_steps[$step['slug']] = array( 'name' => $step['name'], 'position' => $position );
 }
 
+/**
+ * Catches requests for a random group page (example.com/groups/?random-group) and redirects
+ */
 function groups_action_redirect_to_random_group() {
-	global $bp, $wpdb;
 
 	if ( bp_is_groups_component() && isset( $_GET['random-group'] ) ) {
-		$group = groups_get_groups( array( 'type' => 'random', 'per_page' => 1 ) );
+		$group = BP_Groups_Group::get_random( 1, 1 );
 
 		bp_core_redirect( bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/' . $group['groups'][0]->slug . '/' );
 	}
@@ -307,7 +313,7 @@ function groups_action_group_feed() {
 	status_header( 200 );
 
 	if ( 'public' != $bp->groups->current_group->status ) {
-		if ( !groups_is_user_member( $bp->loggedin_user->id, $bp->groups->current_group->id ) )
+		if ( !groups_is_user_member( bp_loggedin_user_id(), $bp->groups->current_group->id ) )
 			return false;
 	}
 
@@ -315,4 +321,5 @@ function groups_action_group_feed() {
 	die;
 }
 add_action( 'bp_actions', 'groups_action_group_feed' );
-?>
\ No newline at end of file
+
+?>
diff --git a/wp-content/plugins/buddypress/bp-groups/bp-groups-activity.php b/wp-content/plugins/buddypress/bp-groups/bp-groups-activity.php
index a09b7f8e7f2aac81b0194d4233c66ce3a1d8d910..944bb037d0e9fe3f10796f84c1d3647c309291f5 100644
--- a/wp-content/plugins/buddypress/bp-groups/bp-groups-activity.php
+++ b/wp-content/plugins/buddypress/bp-groups/bp-groups-activity.php
@@ -1,12 +1,13 @@
 <?php
+
 /**
- * BuddyPress Groups Activity & Notification Functions
+ * BuddyPress Groups Activity Functions
  *
- * These functions handle the recording, deleting and formatting of activity and
- * notifications for the user and for this specific component.
+ * These functions handle the recording, deleting and formatting of activity
+ * for the user and for this specific component.
  *
  * @package BuddyPress
- * @subpackage Groups
+ * @subpackage GroupsActivity
  */
 
 // Exit if accessed directly
@@ -33,15 +34,23 @@ function groups_record_activity( $args = '' ) {
 	if ( !bp_is_active( 'activity' ) )
 		return false;
 
-	// If the group is not public, hide the activity sitewide.
-	if ( isset( $bp->groups->current_group->status ) && 'public' == $bp->groups->current_group->status )
-		$hide_sitewide = false;
-	else
-		$hide_sitewide = true;
+	// Set the default for hide_sitewide by checking the status of the group
+	$hide_sitewide = false;
+	if ( !empty( $args['item_id'] ) ) {
+		if ( bp_get_current_group_id() == $args['item_id'] ) {
+			$group = groups_get_current_group();
+		} else {
+			$group = groups_get_group( array( 'group_id' => $args['item_id'] ) );
+		}
+
+		if ( isset( $group->status ) && 'public' != $group->status ) {
+			$hide_sitewide = true;
+		}
+	}
 
 	$defaults = array (
 		'id'                => false,
-		'user_id'           => $bp->loggedin_user->id,
+		'user_id'           => bp_loggedin_user_id(),
 		'action'            => '',
 		'content'           => '',
 		'primary_link'      => '',
@@ -62,35 +71,34 @@ function groups_record_activity( $args = '' ) {
 function groups_update_last_activity( $group_id = 0 ) {
 	global $bp;
 
-	if ( !$group_id )
+	if ( empty( $group_id ) )
 		$group_id = $bp->groups->current_group->id;
 
-	if ( !$group_id )
+	if ( empty( $group_id ) )
 		return false;
 
 	groups_update_groupmeta( $group_id, 'last_activity', bp_core_current_time() );
 }
-add_action( 'groups_leave_group', 'groups_update_last_activity' );
-add_action( 'groups_created_group', 'groups_update_last_activity' );
-add_action( 'groups_new_forum_topic', 'groups_update_last_activity' );
+add_action( 'groups_leave_group',          'groups_update_last_activity' );
+add_action( 'groups_created_group',        'groups_update_last_activity' );
+add_action( 'groups_new_forum_topic',      'groups_update_last_activity' );
 add_action( 'groups_new_forum_topic_post', 'groups_update_last_activity' );
 
 function groups_format_notifications( $action, $item_id, $secondary_item_id, $total_items, $format = 'string' ) {
-	global $bp;
 
 	switch ( $action ) {
 		case 'new_membership_request':
 			$group_id = $secondary_item_id;
 			$requesting_user_id = $item_id;
 
-			$group = new BP_Groups_Group( $group_id );
+			$group = groups_get_group( array( 'group_id' => $group_id ) );
 			$group_link = bp_get_group_permalink( $group );
 
 			// Set up the string and the filter
 			// Because different values are passed to the filters, we'll return the
 			// values inline
-			if ( (int)$total_items > 1 ) {
-				$text = sprintf( __( '%1$d new membership requests for the group "%2$s"', 'buddypress' ), (int)$total_items, $group->name );
+			if ( (int) $total_items > 1 ) {
+				$text = sprintf( __( '%1$d new membership requests for the group "%2$s"', 'buddypress' ), (int) $total_items, $group->name );
 				$filter = 'bp_groups_multiple_new_membership_requests_notification';
 				$notification_link = $group_link . 'admin/membership-requests/?n=1';
 
@@ -123,13 +131,13 @@ function groups_format_notifications( $action, $item_id, $secondary_item_id, $to
 		case 'membership_request_accepted':
 			$group_id = $item_id;
 
-			$group = new BP_Groups_Group( $group_id );
+			$group = groups_get_group( array( 'group_id' => $group_id ) );
 			$group_link = bp_get_group_permalink( $group );
 
-			if ( (int)$total_items > 1 ) {
-				$text = sprintf( __( '%d accepted group membership requests', 'buddypress' ), (int)$total_items, $group->name );
+			if ( (int) $total_items > 1 ) {
+				$text = sprintf( __( '%d accepted group membership requests', 'buddypress' ), (int) $total_items, $group->name );
 				$filter = 'bp_groups_multiple_membership_request_accepted_notification';
-				$notification_link = bp_loggedin_user_domain() . bp_get_groups_slug() . '/?n=1';
+				$notification_link = trailingslashit( bp_loggedin_user_domain() . bp_get_groups_slug() ) . '?n=1';
 
 				if ( 'string' == $format ) {
 					return apply_filters( $filter, '<a href="' . $notification_link . '" title="' . __( 'Groups', 'buddypress' ) . '">' . $text . '</a>', $total_items, $group->name, $text, $notification_link );
@@ -159,13 +167,13 @@ function groups_format_notifications( $action, $item_id, $secondary_item_id, $to
 		case 'membership_request_rejected':
 			$group_id = $item_id;
 
-			$group = new BP_Groups_Group( $group_id );
+			$group = groups_get_group( array( 'group_id' => $group_id ) );
 			$group_link = bp_get_group_permalink( $group );
 
-			if ( (int)$total_items > 1 ) {
-				$text = sprintf( __( '%d rejected group membership requests', 'buddypress' ), (int)$total_items, $group->name );
+			if ( (int) $total_items > 1 ) {
+				$text = sprintf( __( '%d rejected group membership requests', 'buddypress' ), (int) $total_items, $group->name );
 				$filter = 'bp_groups_multiple_membership_request_rejected_notification';
-				$notification_link = bp_loggedin_user_domain() . bp_get_groups_slug() . '/?n=1';
+				$notification_link = trailingslashit( bp_loggedin_user_domain() . bp_get_groups_slug() ) . '?n=1';
 
 				if ( 'string' == $format ) {
 					return apply_filters( $filter, '<a href="' . $notification_link . '" title="' . __( 'Groups', 'buddypress' ) . '">' . $text . '</a>', $total_items, $group->name );
@@ -195,13 +203,13 @@ function groups_format_notifications( $action, $item_id, $secondary_item_id, $to
 		case 'member_promoted_to_admin':
 			$group_id = $item_id;
 
-			$group = new BP_Groups_Group( $group_id );
+			$group = groups_get_group( array( 'group_id' => $group_id ) );
 			$group_link = bp_get_group_permalink( $group );
 
-			if ( (int)$total_items > 1 ) {
-				$text = sprintf( __( 'You were promoted to an admin in %d groups', 'buddypress' ), (int)$total_items );
+			if ( (int) $total_items > 1 ) {
+				$text = sprintf( __( 'You were promoted to an admin in %d groups', 'buddypress' ), (int) $total_items );
 				$filter = 'bp_groups_multiple_member_promoted_to_admin_notification';
-				$notification_link = bp_loggedin_user_domain() . bp_get_groups_slug() . '?n=1';
+				$notification_link = trailingslashit( bp_loggedin_user_domain() . bp_get_groups_slug() ) . '?n=1';
 
 				if ( 'string' == $format ) {
 					return apply_filters( $filter, '<a href="' . $notification_link . '" title="' . __( 'Groups', 'buddypress' ) . '">' . $text . '</a>', $total_items, $text, $notification_link );
@@ -231,13 +239,13 @@ function groups_format_notifications( $action, $item_id, $secondary_item_id, $to
 		case 'member_promoted_to_mod':
 			$group_id = $item_id;
 
-			$group = new BP_Groups_Group( $group_id );
+			$group = groups_get_group( array( 'group_id' => $group_id ) );
 			$group_link = bp_get_group_permalink( $group );
 
-			if ( (int)$total_items > 1 ) {
-				$text = sprintf( __( 'You were promoted to a mod in %d groups', 'buddypress' ), (int)$total_items );
+			if ( (int) $total_items > 1 ) {
+				$text = sprintf( __( 'You were promoted to a mod in %d groups', 'buddypress' ), (int) $total_items );
 				$filter = 'bp_groups_multiple_member_promoted_to_mod_notification';
-				$notification_link = bp_loggedin_user_domain() . bp_get_groups_slug() . '?n=1';
+				$notification_link = trailingslashit( bp_loggedin_user_domain() . bp_get_groups_slug() ) . '?n=1';
 
 				if ( 'string' == $format ) {
 					return apply_filters( $filter, '<a href="' . $notification_link . '" title="' . __( 'Groups', 'buddypress' ) . '">' . $text . '</a>', $total_items, $text, $notification_link );
@@ -266,13 +274,13 @@ function groups_format_notifications( $action, $item_id, $secondary_item_id, $to
 
 		case 'group_invite':
 			$group_id = $item_id;
-			$group = new BP_Groups_Group( $group_id );
+			$group = groups_get_group( array( 'group_id' => $group_id ) );
 			$group_link = bp_get_group_permalink( $group );
 
 			$notification_link = bp_loggedin_user_domain() . bp_get_groups_slug() . '/invites/?n=1';
 
-			if ( (int)$total_items > 1 ) {
-				$text = sprintf( __( 'You have %d new group invitations', 'buddypress' ), (int)$total_items );
+			if ( (int) $total_items > 1 ) {
+				$text = sprintf( __( 'You have %d new group invitations', 'buddypress' ), (int) $total_items );
 				$filter = 'bp_groups_multiple_group_invite_notification';
 
 				if ( 'string' == $format ) {
@@ -304,4 +312,5 @@ function groups_format_notifications( $action, $item_id, $secondary_item_id, $to
 
 	return false;
 }
-?>
\ No newline at end of file
+
+?>
diff --git a/wp-content/plugins/buddypress/bp-groups/bp-groups-adminbar.php b/wp-content/plugins/buddypress/bp-groups/bp-groups-adminbar.php
index 2d2c346b70586125f4b409b05447cdf5f8d3956b..26e57f8cdedec3505be0cb5e4fd0f2e322c389c8 100644
--- a/wp-content/plugins/buddypress/bp-groups/bp-groups-adminbar.php
+++ b/wp-content/plugins/buddypress/bp-groups/bp-groups-adminbar.php
@@ -1,8 +1,9 @@
 <?php
+
 /**
- * BuddyPress Groups Admin Bar
+ * BuddyPress Groups Toolbar
  *
- * Handles the groups functions related to the WordPress Admin Bar
+ * Handles the groups functions related to the WordPress Toolbar
  *
  * @package BuddyPress
  * @subpackage Groups
@@ -11,26 +12,11 @@
 // Exit if accessed directly
 if ( !defined( 'ABSPATH' ) ) exit;
 
-/**
- * Adjust the admin bar menus based on which WordPress version this is
- *
- * @since BuddyPress (1.5.2)
- */
-function bp_groups_admin_bar_version_check() {
-	if ( '3.2' == bp_get_major_wp_version() ) {
-		add_action( 'bp_setup_admin_bar', 'bp_groups_group_admin_menu', 99 );
-	} elseif ( '3.3' == bp_get_major_wp_version() ) {
-		remove_action( 'admin_bar_menu', 'wp_admin_bar_edit_menu',  80  );
-		add_action( 'admin_bar_menu', 'bp_groups_group_admin_menu', 400 );
-	}
-}
-add_action( 'admin_bar_menu', 'bp_groups_admin_bar_version_check', 4 );
-
 /**
  * Adds the Group Admin top-level menu to group pages
  *
  * @package BuddyPress
- * @since 1.5
+ * @since BuddyPress (1.5)
  *
  * @todo Add dynamic menu items for group extensions
  */
@@ -42,43 +28,18 @@ function bp_groups_group_admin_menu() {
 		return false;
 
 	// Only show this menu to group admins and super admins
-	if ( !is_super_admin() && !bp_group_is_admin() )
+	if ( !bp_current_user_can( 'bp_moderate' ) && !bp_group_is_admin() )
 		return false;
 
-	if ( '3.2' == bp_get_major_wp_version() ) {
-
-		// Group avatar
-		$avatar = bp_core_fetch_avatar( array(
-			'object'     => 'group',
-			'type'       => 'thumb',
-			'avatar_dir' => 'group-avatars',
-			'item_id'    => $bp->groups->current_group->id,
-			'width'      => 16,
-			'height'     => 16
-		) );
-
-		// Unique ID for the 'My Account' menu
-		$bp->group_admin_menu_id = ( ! empty( $avatar ) ) ? 'group-admin-with-avatar' : 'group-admin';
-
-		// Add the top-level Group Admin button
-		$wp_admin_bar->add_menu( array(
-			'id'    => $bp->group_admin_menu_id,
-			'title' => $avatar . bp_get_current_group_name(),
-			'href'  => bp_get_group_permalink( $bp->groups->current_group )
-		) );
+	// Unique ID for the 'Edit Group' menu
+	$bp->group_admin_menu_id = 'group-admin';
 
-	} elseif ( '3.3' == bp_get_major_wp_version() ) {
-		
-		// Unique ID for the 'My Account' menu
-		$bp->group_admin_menu_id = 'group-admin';
-
-		// Add the top-level Group Admin button
-		$wp_admin_bar->add_menu( array(
-			'id'    => $bp->group_admin_menu_id,
-			'title' => __( 'Edit Group', 'buddypress' ),
-			'href'  => bp_get_group_permalink( $bp->groups->current_group )
-		) );
-	}
+	// Add the top-level Group Admin button
+	$wp_admin_bar->add_menu( array(
+		'id'    => $bp->group_admin_menu_id,
+		'title' => __( 'Edit Group', 'buddypress' ),
+		'href'  => bp_get_group_permalink( $bp->groups->current_group )
+	) );
 
 	// Group Admin > Edit details
 	$wp_admin_bar->add_menu( array(
@@ -142,5 +103,18 @@ function bp_groups_group_admin_menu() {
 		'href'   =>  bp_get_groups_action_link( 'admin/delete-group' )
 	) );
 }
+add_action( 'admin_bar_menu', 'bp_groups_group_admin_menu', 99 );
+
+/**
+ * Remove rogue WP core edit menu when viewing a group
+ *
+ * @since BuddyPress (1.6)
+ */
+function bp_groups_remove_edit_page_menu() {
+	if ( bp_is_group() ) {
+		remove_action( 'admin_bar_menu', 'wp_admin_bar_edit_menu', 80 );
+	}
+}
+add_action( 'bp_init', 'bp_groups_remove_edit_page_menu', 99 );
 
-?>
\ No newline at end of file
+?>
diff --git a/wp-content/plugins/buddypress/bp-groups/bp-groups-buddybar.php b/wp-content/plugins/buddypress/bp-groups/bp-groups-buddybar.php
index da4a61c25a2c4914774cc9346e275d4322b97077..4ae3dc9d9537e09f18ab3c4c957ee527d9829a95 100644
--- a/wp-content/plugins/buddypress/bp-groups/bp-groups-buddybar.php
+++ b/wp-content/plugins/buddypress/bp-groups/bp-groups-buddybar.php
@@ -1,15 +1,30 @@
 <?php
+
+/**
+ * BuddyPress Groups BuddyBar
+ *
+ * @package BuddyPress
+ * @subpackage GroupsBuddyBar
+ */
+
 // Exit if accessed directly
 if ( !defined( 'ABSPATH' ) ) exit;
 
+/**
+ * Adds menu items to the BuddyBar
+ *
+ * @since BuddyPress (1.0)
+ * @global BuddyPress $bp
+ * @return False if no menu
+ */
 function bp_groups_adminbar_admin_menu() {
-	global $bp, $groups_template;
+	global $bp;
 
 	if ( empty( $bp->groups->current_group ) )
 		return false;
 
-	// Don't show this menu to non site admins or if you're viewing your own profile
-	if ( !current_user_can( 'edit_users' ) || !is_super_admin() || ( !$bp->is_item_admin && !$bp->is_item_mod ) )
+	// Only group admins and site admins can see this menu
+	if ( !current_user_can( 'edit_users' ) && !bp_current_user_can( 'bp_moderate' ) && !bp_is_item_admin() )
 		return false; ?>
 
 	<li id="bp-adminbar-adminoptions-menu">
@@ -51,4 +66,4 @@ function bp_groups_adminbar_admin_menu() {
 }
 add_action( 'bp_adminbar_menus', 'bp_groups_adminbar_admin_menu', 20 );
 
-?>
\ No newline at end of file
+?>
diff --git a/wp-content/plugins/buddypress/bp-groups/bp-groups-cache.php b/wp-content/plugins/buddypress/bp-groups/bp-groups-cache.php
index 908df53b9aa3f693b84c2b3e57ebc903cf7b7e0b..e51456e09a22c57a9efab9a9419c7d41b3b72e77 100644
--- a/wp-content/plugins/buddypress/bp-groups/bp-groups-cache.php
+++ b/wp-content/plugins/buddypress/bp-groups/bp-groups-cache.php
@@ -1,4 +1,5 @@
 <?php
+
 /**
  * BuddyPress Groups Caching
  *
@@ -12,6 +13,33 @@
 // Exit if accessed directly
 if ( !defined( 'ABSPATH' ) ) exit;
 
+/**
+ * Slurps up groupmeta
+ *
+ * This function is called in two places in the BP_Groups_Group class:
+ *   - in the populate() method, when single group objects are populated
+ *   - in the get() method, when multiple groups are queried
+ *
+ * It grabs all groupmeta associated with all of the groups passed in $group_ids and adds it to
+ * the WP cache. This improves efficiency when using groupmeta inline
+ *
+ * @param int|str|array $group_ids Accepts a single group_id, or a comma-separated list or array of
+ *    group ids
+ */
+function bp_groups_update_meta_cache( $group_ids = false ) {
+	global $bp;
+	
+	$cache_args = array(
+		'object_ids' 	   => $group_ids,
+		'object_type' 	   => $bp->groups->id,
+		'object_column'    => 'group_id',
+		'meta_table' 	   => $bp->groups->table_name_groupmeta,
+		'cache_key_prefix' => 'bp_groups_groupmeta'
+	);
+	
+	bp_update_meta_cache( $cache_args );
+}
+
 function groups_clear_group_object_cache( $group_id ) {
 	wp_cache_delete( 'bp_total_group_count', 'bp' );
 }
@@ -21,8 +49,35 @@ add_action( 'groups_details_updated',            'groups_clear_group_object_cach
 add_action( 'groups_group_avatar_updated',       'groups_clear_group_object_cache' );
 add_action( 'groups_create_group_step_complete', 'groups_clear_group_object_cache' );
 
+/**
+ * Clears caches for the group creator when a group is created
+ *
+ * @param int $group_id
+ * @param BP_Groups_Group $group_obj
+ * @since BuddyPress (1.6)
+ */
+function bp_groups_clear_group_creator_cache( $group_id, $group_obj ) {
+	// Clears the 'total groups' for this user
+	groups_clear_group_user_object_cache( $group_obj->id, $group_obj->creator_id );
+}
+add_action( 'groups_created_group', 'bp_groups_clear_group_creator_cache', 10, 2 );
+
+/**
+ * Clears caches for all members in a group when a group is deleted
+ *
+ * @param BP_Groups_Group $group_obj
+ * @param array User IDs who were in this group
+ * @since BuddyPress (1.6)
+ */
+function bp_groups_clear_group_members_caches( $group_obj, $user_ids ) {
+	// Clears the 'total groups' cache for each member in a group
+	foreach ( (array) $user_ids as $user_id )
+		groups_clear_group_user_object_cache( $group_obj->id, $user_id );
+}
+add_action( 'bp_groups_delete_group', 'bp_groups_clear_group_members_caches', 10, 2 );
+
 function groups_clear_group_user_object_cache( $group_id, $user_id ) {
-	wp_cache_delete( 'bp_total_groups_for_user_' . $user_id );
+	wp_cache_delete( 'bp_total_groups_for_user_' . $user_id, 'bp' );
 }
 add_action( 'groups_join_group',   'groups_clear_group_user_object_cache', 10, 2 );
 add_action( 'groups_leave_group',  'groups_clear_group_user_object_cache', 10, 2 );
@@ -41,7 +96,7 @@ add_action( 'groups_settings_updated',           'bp_core_clear_cache' );
 add_action( 'groups_unban_member',               'bp_core_clear_cache' );
 add_action( 'groups_ban_member',                 'bp_core_clear_cache' );
 add_action( 'groups_demote_member',              'bp_core_clear_cache' );
-add_action( 'groups_premote_member',             'bp_core_clear_cache' );
+add_action( 'groups_promote_member',             'bp_core_clear_cache' );
 add_action( 'groups_membership_rejected',        'bp_core_clear_cache' );
 add_action( 'groups_membership_accepted',        'bp_core_clear_cache' );
 add_action( 'groups_membership_requested',       'bp_core_clear_cache' );
@@ -49,4 +104,4 @@ add_action( 'groups_create_group_step_complete', 'bp_core_clear_cache' );
 add_action( 'groups_created_group',              'bp_core_clear_cache' );
 add_action( 'groups_group_avatar_updated',       'bp_core_clear_cache' );
 
-?>
\ No newline at end of file
+?>
diff --git a/wp-content/plugins/buddypress/bp-groups/bp-groups-classes.php b/wp-content/plugins/buddypress/bp-groups/bp-groups-classes.php
index f4467022c3030a7c0cbc3005360a9dbb19864a12..033dd41be0388d4aec248163cb37f344bb3ce2fe 100644
--- a/wp-content/plugins/buddypress/bp-groups/bp-groups-classes.php
+++ b/wp-content/plugins/buddypress/bp-groups/bp-groups-classes.php
@@ -1,8 +1,16 @@
 <?php
+
+/**
+ * BuddyPress Groups Classes
+ *
+ * @package BuddyPress
+ * @subpackage GroupsClasses
+ */
+
 // Exit if accessed directly
 if ( !defined( 'ABSPATH' ) ) exit;
 
-Class BP_Groups_Group {
+class BP_Groups_Group {
 	var $id;
 	var $creator_id;
 	var $name;
@@ -16,12 +24,32 @@ Class BP_Groups_Group {
 	var $mods;
 	var $total_member_count;
 
-	function bp_groups_group( $id = null ) {
-		$this->__construct($id);
-	}
+	/**
+	 * Is the current user a member of this group?
+	 *
+	 * @since BuddyPress (1.2)
+	 * @var bool
+	 */
+	public $is_member;
+
+	/**
+	 * Timestamp of the last activity that happened in this group.
+	 *
+	 * @since BuddyPress (1.2)
+	 * @var string
+	 */
+	public $last_activity;
+
+	/**
+	 * If this is a private or hidden group, does the current user have access?
+	 *
+	 * @since BuddyPress (1.6)
+	 * @var bool
+	 */
+	public $user_has_access;
 
 	function __construct( $id = null ) {
-		if ( $id ) {
+		if ( !empty( $id ) ) {
 			$this->id = $id;
 			$this->populate();
 		}
@@ -30,7 +58,9 @@ Class BP_Groups_Group {
 	function populate() {
 		global $wpdb, $bp;
 
-		if ( $group = $wpdb->get_row( $wpdb->prepare( "SELECT g.*, gm.meta_value as last_activity, gm2.meta_value as total_member_count FROM {$bp->groups->table_name} g, {$bp->groups->table_name_groupmeta} gm, {$bp->groups->table_name_groupmeta} gm2 WHERE g.id = gm.group_id AND g.id = gm2.group_id AND gm.meta_key = 'last_activity' AND gm2.meta_key = 'total_member_count' AND g.id = %d", $this->id ) ) ) {
+		if ( $group = $wpdb->get_row( $wpdb->prepare( "SELECT g.* FROM {$bp->groups->table_name} g WHERE g.id = %d", $this->id ) ) ) {			
+			bp_groups_update_meta_cache( $this->id );
+						
 			$this->id                 = $group->id;
 			$this->creator_id         = $group->creator_id;
 			$this->name               = stripslashes($group->name);
@@ -39,14 +69,24 @@ Class BP_Groups_Group {
 			$this->status             = $group->status;
 			$this->enable_forum       = $group->enable_forum;
 			$this->date_created       = $group->date_created;
-			$this->last_activity      = $group->last_activity;
-			$this->total_member_count = $group->total_member_count;
-			$this->is_member          = BP_Groups_Member::check_is_member( $bp->loggedin_user->id, $this->id );
+			$this->last_activity      = groups_get_groupmeta( $this->id, 'last_activity' );
+			$this->total_member_count = groups_get_groupmeta( $this->id, 'total_member_count' );
+			$this->is_member          = BP_Groups_Member::check_is_member( bp_loggedin_user_id(), $this->id );
+			
+			// If this is a private or hidden group, does the current user have access?
+			if ( 'private' == $this->status || 'hidden' == $this->status ) {
+				if ( $this->is_member && is_user_logged_in() || bp_current_user_can( 'bp_moderate' ) )
+					$this->user_has_access = true;
+				else
+					$this->user_has_access = false;
+			} else {
+				$this->user_has_access = true;
+			}
 
 			// Get group admins and mods
 			$admin_mods = $wpdb->get_results( apply_filters( 'bp_group_admin_mods_user_join_filter', $wpdb->prepare( "SELECT u.ID as user_id, u.user_login, u.user_email, u.user_nicename, m.is_admin, m.is_mod FROM {$wpdb->users} u, {$bp->groups->table_name_members} m WHERE u.ID = m.user_id AND m.group_id = %d AND ( m.is_admin = 1 OR m.is_mod = 1 )", $this->id ) ) );
-			foreach( (array)$admin_mods as $user ) {
-				if ( (int)$user->is_admin )
+			foreach( (array) $admin_mods as $user ) {
+				if ( (int) $user->is_admin )
 					$this->admins[] = $user;
 				else
 					$this->mods[] = $user;
@@ -119,6 +159,8 @@ Class BP_Groups_Group {
 			$this->id = $wpdb->insert_id;
 
 		do_action_ref_array( 'groups_group_after_save', array( &$this ) );
+		
+		wp_cache_delete( 'bp_groups_group_' . $this->id, 'bp' );
 
 		return true;
 	}
@@ -130,16 +172,18 @@ Class BP_Groups_Group {
 		groups_delete_groupmeta( $this->id );
 
 		// Fetch the user IDs of all the members of the group
-		$user_ids = BP_Groups_Member::get_group_member_ids( $this->id );
-		$user_ids = implode( ',', (array)$user_ids );
+		$user_ids    = BP_Groups_Member::get_group_member_ids( $this->id );
+		$user_id_str = implode( ',', (array) $user_ids );
 
 		// Modify group count usermeta for members
-		$wpdb->query( $wpdb->prepare( "UPDATE {$wpdb->usermeta} SET meta_value = meta_value - 1 WHERE meta_key = 'total_group_count' AND user_id IN ( {$user_ids} )" ) );
+		$wpdb->query( "UPDATE {$wpdb->usermeta} SET meta_value = meta_value - 1 WHERE meta_key = 'total_group_count' AND user_id IN ( {$user_id_str} )" );
 
 		// Now delete all group member entries
 		BP_Groups_Member::delete_all( $this->id );
 
-		do_action_ref_array( 'bp_groups_delete_group', array( &$this ) );
+		do_action_ref_array( 'bp_groups_delete_group', array( &$this, $user_ids ) );
+
+		wp_cache_delete( 'bp_groups_group_' . $this->id, 'bp' );
 
 		// Finally remove the group entry from the DB
 		if ( !$wpdb->query( $wpdb->prepare( "DELETE FROM {$bp->groups->table_name} WHERE id = %d", $this->id ) ) )
@@ -148,15 +192,15 @@ Class BP_Groups_Group {
 		return true;
 	}
 
-	/* Static Functions */
+	/** Static Methods ********************************************************/
 
 	function group_exists( $slug, $table_name = false ) {
 		global $wpdb, $bp;
 
-		if ( !$table_name )
+		if ( empty( $table_name ) )
 			$table_name = $bp->groups->table_name;
 
-		if ( !$slug )
+		if ( empty( $slug ) )
 			return false;
 
 		return $wpdb->get_var( $wpdb->prepare( "SELECT id FROM {$table_name} WHERE slug = %s", $slug ) );
@@ -174,24 +218,24 @@ Class BP_Groups_Group {
 	function filter_user_groups( $filter, $user_id = 0, $order = false, $limit = null, $page = null ) {
 		global $wpdb, $bp;
 
-		if ( !$user_id )
-			$user_id = $bp->displayed_user->id;
+		if ( empty( $user_id ) )
+			$user_id = bp_displayed_user_id();
 
 		$filter = like_escape( $wpdb->escape( $filter ) );
 
-		if ( $limit && $page )
+		if ( !empty( $limit ) && !empty( $page ) )
 			$pag_sql = $wpdb->prepare( " LIMIT %d, %d", intval( ( $page - 1 ) * $limit), intval( $limit ) );
 
 		// Get all the group ids for the current user's groups.
 		$gids = BP_Groups_Member::get_group_ids( $user_id );
 
-		if ( !$gids['groups'] )
+		if ( empty( $gids['groups'] ) )
 			return false;
 
 		$gids = implode( ',', $gids['groups'] );
 
-		$paged_groups = $wpdb->get_results( $wpdb->prepare( "SELECT id as group_id FROM {$bp->groups->table_name} WHERE ( name LIKE '{$filter}%%' OR description LIKE '{$filter}%%' ) AND id IN ({$gids}) {$pag_sql}" ) );
-		$total_groups = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(id) FROM {$bp->groups->table_name} WHERE ( name LIKE '{$filter}%%' OR description LIKE '{$filter}%%' ) AND id IN ({$gids})" ) );
+		$paged_groups = $wpdb->get_results( "SELECT id as group_id FROM {$bp->groups->table_name} WHERE ( name LIKE '{$filter}%%' OR description LIKE '{$filter}%%' ) AND id IN ({$gids}) {$pag_sql}" );
+		$total_groups = $wpdb->get_var( "SELECT COUNT(id) FROM {$bp->groups->table_name} WHERE ( name LIKE '{$filter}%%' OR description LIKE '{$filter}%%' ) AND id IN ({$gids})" );
 
 		return array( 'groups' => $paged_groups, 'total' => $total_groups );
 	}
@@ -201,16 +245,16 @@ Class BP_Groups_Group {
 
 		$filter = like_escape( $wpdb->escape( $filter ) );
 
-		if ( $limit && $page )
+		if ( !empty( $limit ) && !empty( $page ) )
 			$pag_sql = $wpdb->prepare( " LIMIT %d, %d", intval( ( $page - 1 ) * $limit), intval( $limit ) );
 
-		if ( $sort_by && $order ) {
-			$sort_by = $wpdb->escape( $sort_by );
-			$order = $wpdb->escape( $order );
+		if ( !empty( $sort_by ) && !empty( $order ) ) {
+			$sort_by   = $wpdb->escape( $sort_by );
+			$order     = $wpdb->escape( $order );
 			$order_sql = "ORDER BY $sort_by $order";
 		}
 
-		if ( !is_super_admin() )
+		if ( !bp_current_user_can( 'bp_moderate' ) )
 			$hidden_sql = "AND status != 'hidden'";
 
 		$paged_groups = $wpdb->get_results( "SELECT id as group_id FROM {$bp->groups->table_name} WHERE ( name LIKE '%%$filter%%' OR description LIKE '%%$filter%%' ) {$hidden_sql} {$order_sql} {$pag_sql}" );
@@ -236,7 +280,7 @@ Class BP_Groups_Group {
 
 		$members = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(id) FROM {$bp->groups->table_name_members} WHERE group_id = %d", $group_id ) );
 
-		if ( !$members )
+		if ( empty( $members ) )
 			return false;
 
 		return true;
@@ -251,7 +295,7 @@ Class BP_Groups_Group {
 	function get_membership_requests( $group_id, $limit = null, $page = null ) {
 		global $wpdb, $bp;
 
-		if ( $limit && $page ) {
+		if ( !empty( $limit ) && !empty( $page ) ) {
 			$pag_sql = $wpdb->prepare( " LIMIT %d, %d", intval( ( $page - 1 ) * $limit), intval( $limit ) );
 		}
 
@@ -264,7 +308,8 @@ Class BP_Groups_Group {
 	function get( $type = 'newest', $per_page = null, $page = null, $user_id = 0, $search_terms = false, $include = false, $populate_extras = true, $exclude = false, $show_hidden = false ) {
 		global $wpdb, $bp;
 
-		$sql = array();
+		$sql       = array();
+		$total_sql = array();
 
 		$sql['select'] = "SELECT g.*, gm1.meta_value AS total_member_count, gm2.meta_value AS last_activity";
 		$sql['from']   = " FROM {$bp->groups->table_name_groupmeta} gm1, {$bp->groups->table_name_groupmeta} gm2,";
@@ -324,11 +369,11 @@ Class BP_Groups_Group {
 				break;
 		}
 
-		if ( $per_page && $page )
+		if ( !empty( $per_page ) && !empty( $page ) )
 			$sql['pagination'] = $wpdb->prepare( "LIMIT %d, %d", intval( ( $page - 1 ) * $per_page), intval( $per_page ) );
 
-		/* Get paginated results */
-		$paged_groups_sql = apply_filters( 'bp_groups_get_paged_groups_sql', join( ' ', (array)$sql ), $sql );
+		// Get paginated results
+		$paged_groups_sql = apply_filters( 'bp_groups_get_paged_groups_sql', join( ' ', (array) $sql ), $sql );
 		$paged_groups     = $wpdb->get_results( $paged_groups_sql );
 
 		$total_sql['select'] = "SELECT COUNT(DISTINCT g.id) FROM {$bp->groups->table_name} g, {$bp->groups->table_name_members} gm1, {$bp->groups->table_name_groupmeta} gm2";
@@ -345,10 +390,13 @@ Class BP_Groups_Group {
 		if ( !empty( $user_id ) )
 			$total_sql['where'][] = "m.group_id = g.id AND m.user_id = {$user_id} AND m.is_confirmed = 1 AND m.is_banned = 0";
 
-		if ( !empty( $exclude ) ) {
-			$exclude = $wpdb->escape( $exclude );
-			$total_sql['where'][] = " g.id NOT IN ({$exclude})";
-		}
+		// Already escaped in the paginated results block
+		if ( ! empty( $include ) )
+			$total_sql['where'][] = "g.id IN ({$include})";
+
+		// Already escaped in the paginated results block
+		if ( ! empty( $exclude ) )
+			$total_sql['where'][] = "g.id NOT IN ({$exclude})";
 
 		$total_sql['where'][] = "g.id = gm1.group_id";
 		$total_sql['where'][] = "g.id = gm2.group_id";
@@ -357,19 +405,25 @@ Class BP_Groups_Group {
 		$t_sql = $total_sql['select'];
 
 		if ( !empty( $total_sql['where'] ) )
-			$t_sql .= " WHERE " . join( ' AND ', (array)$total_sql['where'] );
+			$t_sql .= " WHERE " . join( ' AND ', (array) $total_sql['where'] );
 
-		/* Get total group results */
-		$total_groups_sql = apply_filters( 'bp_groups_get_total_groups_sql', join( ' ', (array)$t_sql ), $t_sql );
+		// Get total group results
+		$total_groups_sql = apply_filters( 'bp_groups_get_total_groups_sql', $t_sql, $total_sql );
 		$total_groups     = $wpdb->get_var( $total_groups_sql );
 
-		/* Populate some extra information instead of querying each time in the loop */
+		$group_ids = array();
+		foreach ( (array) $paged_groups as $group ) {
+			$group_ids[] = $group->id;
+		}
+		
+		// Populate some extra information instead of querying each time in the loop
 		if ( !empty( $populate_extras ) ) {
-			$group_ids = array();
-			foreach ( (array)$paged_groups as $group ) $group_ids[] = $group->id;
-			$group_ids = $wpdb->escape( join( ',', (array)$group_ids ) );
+			$group_ids = $wpdb->escape( join( ',', (array) $group_ids ) );
 			$paged_groups = BP_Groups_Group::get_group_extras( $paged_groups, $group_ids, $type );
 		}
+		
+		// Grab all groupmeta
+		bp_groups_update_meta_cache( $group_ids );
 
 		unset( $sql, $total_sql );
 
@@ -379,14 +433,14 @@ Class BP_Groups_Group {
 	function get_by_most_forum_topics( $limit = null, $page = null, $user_id = 0, $search_terms = false, $populate_extras = true, $exclude = false ) {
 		global $wpdb, $bp, $bbdb;
 
-		if ( !$bbdb )
+		if ( empty( $bbdb ) )
 			do_action( 'bbpress_init' );
 
-		if ( $limit && $page ) {
+		if ( !empty( $limit ) && !empty( $page ) ) {
 			$pag_sql = $wpdb->prepare( " LIMIT %d, %d", intval( ( $page - 1 ) * $limit), intval( $limit ) );
 		}
 
-		if ( !is_user_logged_in() || ( !is_super_admin() && ( $user_id != $bp->loggedin_user->id ) ) )
+		if ( !is_user_logged_in() || ( !bp_current_user_can( 'bp_moderate' ) && ( $user_id != bp_loggedin_user_id() ) ) )
 			$hidden_sql = " AND g.status != 'hidden'";
 
 		if ( !empty( $search_terms ) ) {
@@ -399,7 +453,7 @@ Class BP_Groups_Group {
 			$exclude_sql = " AND g.id NOT IN ({$exclude})";
 		}
 
-		if ( $user_id ) {
+		if ( !empty( $user_id ) ) {
 			$user_id = $wpdb->escape( $user_id );
 			$paged_groups = $wpdb->get_results( "SELECT DISTINCT g.*, gm1.meta_value as total_member_count, gm2.meta_value as last_activity FROM {$bp->groups->table_name_groupmeta} gm1, {$bp->groups->table_name_groupmeta} gm2, {$bp->groups->table_name_groupmeta} gm3, {$bp->groups->table_name_members} m, {$bbdb->forums} f, {$bp->groups->table_name} g WHERE g.id = m.group_id AND g.id = gm1.group_id AND g.id = gm2.group_id AND g.id = gm3.group_id AND gm2.meta_key = 'last_activity' AND gm1.meta_key = 'total_member_count' AND (gm3.meta_key = 'forum_id' AND gm3.meta_value = f.forum_id) AND f.topics > 0 {$hidden_sql} {$search_sql} AND m.user_id = {$user_id} AND m.is_confirmed = 1 AND m.is_banned = 0 {$exclude_sql} ORDER BY f.topics DESC {$pag_sql}" );
 			$total_groups = $wpdb->get_var( "SELECT COUNT(DISTINCT g.id) FROM {$bp->groups->table_name_groupmeta} gm1, {$bp->groups->table_name_groupmeta} gm2, {$bp->groups->table_name_groupmeta} gm3, {$bbdb->forums} f, {$bp->groups->table_name} g WHERE g.id = gm1.group_id AND g.id = gm2.group_id AND g.id = gm3.group_id AND gm2.meta_key = 'last_activity' AND gm1.meta_key = 'total_member_count' AND (gm3.meta_key = 'forum_id' AND gm3.meta_value = f.forum_id) AND f.topics > 0 {$hidden_sql} {$search_sql} AND m.user_id = {$user_id} AND m.is_confirmed = 1 AND m.is_banned = 0 {$exclude_sql}" );
@@ -409,8 +463,8 @@ Class BP_Groups_Group {
 		}
 
 		if ( !empty( $populate_extras ) ) {
-			foreach ( (array)$paged_groups as $group ) $group_ids[] = $group->id;
-			$group_ids = $wpdb->escape( join( ',', (array)$group_ids ) );
+			foreach ( (array) $paged_groups as $group ) $group_ids[] = $group->id;
+			$group_ids = $wpdb->escape( join( ',', (array) $group_ids ) );
 			$paged_groups = BP_Groups_Group::get_group_extras( $paged_groups, $group_ids, 'newest' );
 		}
 
@@ -420,17 +474,17 @@ Class BP_Groups_Group {
 	function get_by_most_forum_posts( $limit = null, $page = null, $search_terms = false, $populate_extras = true, $exclude = false ) {
 		global $wpdb, $bp, $bbdb;
 
-		if ( !$bbdb )
+		if ( empty( $bbdb ) )
 			do_action( 'bbpress_init' );
 
-		if ( $limit && $page ) {
+		if ( !empty( $limit ) && !empty( $page ) ) {
 			$pag_sql = $wpdb->prepare( " LIMIT %d, %d", intval( ( $page - 1 ) * $limit), intval( $limit ) );
 		}
 
-		if ( !is_user_logged_in() || ( !is_super_admin() && ( $user_id != $bp->loggedin_user->id ) ) )
+		if ( !is_user_logged_in() || ( !bp_current_user_can( 'bp_moderate' ) && ( $user_id != bp_loggedin_user_id() ) ) )
 			$hidden_sql = " AND g.status != 'hidden'";
 
-		if ( $search_terms ) {
+		if ( !empty( $search_terms ) ) {
 			$search_terms = like_escape( $wpdb->escape( $search_terms ) );
 			$search_sql = " AND ( g.name LIKE '%%{$search_terms}%%' OR g.description LIKE '%%{$search_terms}%%' )";
 		}
@@ -440,7 +494,7 @@ Class BP_Groups_Group {
 			$exclude_sql = " AND g.id NOT IN ({$exclude})";
 		}
 
-		if ( $user_id ) {
+		if ( !empty( $user_id ) ) {
 			$user_id = $wpdb->escape( $user_id );
 			$paged_groups = $wpdb->get_results( "SELECT DISTINCT g.*, gm1.meta_value as total_member_count, gm2.meta_value as last_activity FROM {$bp->groups->table_name_groupmeta} gm1, {$bp->groups->table_name_groupmeta} gm2, {$bp->groups->table_name_groupmeta} gm3, {$bp->groups->table_name_members} m, {$bbdb->forums} f, {$bp->groups->table_name} g WHERE g.id = m.group_id AND g.id = gm1.group_id AND g.id = gm2.group_id AND g.id = gm3.group_id AND gm2.meta_key = 'last_activity' AND gm1.meta_key = 'total_member_count' AND (gm3.meta_key = 'forum_id' AND gm3.meta_value = f.forum_id) {$hidden_sql} {$search_sql} AND m.user_id = {$user_id} AND m.is_confirmed = 1 AND m.is_banned = 0 {$exclude_sql} ORDER BY f.posts ASC {$pag_sql}" );
 			$total_groups = $wpdb->get_results( "SELECT COUNT(DISTINCT g.id) FROM {$bp->groups->table_name_groupmeta} gm1, {$bp->groups->table_name_groupmeta} gm2, {$bp->groups->table_name_groupmeta} gm3, {$bp->groups->table_name_members} m, {$bbdb->forums} f, {$bp->groups->table_name} g WHERE g.id = m.group_id AND g.id = gm1.group_id AND g.id = gm2.group_id AND g.id = gm3.group_id AND gm2.meta_key = 'last_activity' AND gm1.meta_key = 'total_member_count' AND (gm3.meta_key = 'forum_id' AND gm3.meta_value = f.forum_id) AND f.posts > 0 {$hidden_sql} {$search_sql} AND m.user_id = {$user_id} AND m.is_confirmed = 1 AND m.is_banned = 0 {$exclude_sql} " );
@@ -450,8 +504,8 @@ Class BP_Groups_Group {
 		}
 
 		if ( !empty( $populate_extras ) ) {
-			foreach ( (array)$paged_groups as $group ) $group_ids[] = $group->id;
-			$group_ids = $wpdb->escape( join( ',', (array)$group_ids ) );
+			foreach ( (array) $paged_groups as $group ) $group_ids[] = $group->id;
+			$group_ids = $wpdb->escape( join( ',', (array) $group_ids ) );
 			$paged_groups = BP_Groups_Group::get_group_extras( $paged_groups, $group_ids, 'newest' );
 		}
 
@@ -477,21 +531,21 @@ Class BP_Groups_Group {
 			$exclude_sql = " AND g.id NOT IN ({$exclude})";
 		}
 
-		if ( !is_super_admin() )
-			$hidden_sql = $wpdb->prepare( " AND status != 'hidden'");
+		if ( !bp_current_user_can( 'bp_moderate' ) )
+			$hidden_sql = " AND status != 'hidden'";
 
 		$letter = like_escape( $wpdb->escape( $letter ) );
 
-		if ( $limit && $page ) {
+		if ( !empty( $limit ) && !empty( $page ) ) {
 			$pag_sql = $wpdb->prepare( " LIMIT %d, %d", intval( ( $page - 1 ) * $limit), intval( $limit ) );
-			$total_groups = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(DISTINCT g.id) FROM {$bp->groups->table_name_groupmeta} gm1, {$bp->groups->table_name_groupmeta} gm2, {$bp->groups->table_name} g WHERE g.id = gm1.group_id AND g.id = gm2.group_id AND gm2.meta_key = 'last_activity' AND gm1.meta_key = 'total_member_count' AND g.name LIKE '$letter%%' {$hidden_sql} {$search_sql} {$exclude_sql}" ) );
+			$total_groups = $wpdb->get_var( "SELECT COUNT(DISTINCT g.id) FROM {$bp->groups->table_name_groupmeta} gm1, {$bp->groups->table_name_groupmeta} gm2, {$bp->groups->table_name} g WHERE g.id = gm1.group_id AND g.id = gm2.group_id AND gm2.meta_key = 'last_activity' AND gm1.meta_key = 'total_member_count' AND g.name LIKE '$letter%%' {$hidden_sql} {$search_sql} {$exclude_sql}" );
 		}
 
-		$paged_groups = $wpdb->get_results( $wpdb->prepare( "SELECT g.*, gm1.meta_value as total_member_count, gm2.meta_value as last_activity FROM {$bp->groups->table_name_groupmeta} gm1, {$bp->groups->table_name_groupmeta} gm2, {$bp->groups->table_name} g WHERE g.id = gm1.group_id AND g.id = gm2.group_id AND gm2.meta_key = 'last_activity' AND gm1.meta_key = 'total_member_count' AND g.name LIKE '$letter%%' {$hidden_sql} {$search_sql} {$exclude_sql} ORDER BY g.name ASC {$pag_sql}"  ) );
+		$paged_groups = $wpdb->get_results( "SELECT g.*, gm1.meta_value as total_member_count, gm2.meta_value as last_activity FROM {$bp->groups->table_name_groupmeta} gm1, {$bp->groups->table_name_groupmeta} gm2, {$bp->groups->table_name} g WHERE g.id = gm1.group_id AND g.id = gm2.group_id AND gm2.meta_key = 'last_activity' AND gm1.meta_key = 'total_member_count' AND g.name LIKE '$letter%%' {$hidden_sql} {$search_sql} {$exclude_sql} ORDER BY g.name ASC {$pag_sql}" );
 
 		if ( !empty( $populate_extras ) ) {
-			foreach ( (array)$paged_groups as $group ) $group_ids[] = $group->id;
-			$group_ids = $wpdb->escape( join( ',', (array)$group_ids ) );
+			foreach ( (array) $paged_groups as $group ) $group_ids[] = $group->id;
+			$group_ids = $wpdb->escape( join( ',', (array) $group_ids ) );
 			$paged_groups = BP_Groups_Group::get_group_extras( $paged_groups, $group_ids, 'newest' );
 		}
 
@@ -501,13 +555,15 @@ Class BP_Groups_Group {
 	function get_random( $limit = null, $page = null, $user_id = 0, $search_terms = false, $populate_extras = true, $exclude = false ) {
 		global $wpdb, $bp;
 
-		if ( $limit && $page )
+		$pag_sql = $hidden_sql = $search_sql = $exclude_sql = '';
+
+		if ( !empty( $limit ) && !empty( $page ) )
 			$pag_sql = $wpdb->prepare( " LIMIT %d, %d", intval( ( $page - 1 ) * $limit), intval( $limit ) );
 
-		if ( !is_user_logged_in() || ( !is_super_admin() && ( $user_id != $bp->loggedin_user->id ) ) )
+		if ( !is_user_logged_in() || ( !bp_current_user_can( 'bp_moderate' ) && ( $user_id != bp_loggedin_user_id() ) ) )
 			$hidden_sql = "AND g.status != 'hidden'";
 
-		if ( $search_terms ) {
+		if ( !empty( $search_terms ) ) {
 			$search_terms = like_escape( $wpdb->escape( $search_terms ) );
 			$search_sql = " AND ( g.name LIKE '%%{$search_terms}%%' OR g.description LIKE '%%{$search_terms}%%' )";
 		}
@@ -517,7 +573,7 @@ Class BP_Groups_Group {
 			$exclude_sql = " AND g.id NOT IN ({$exclude})";
 		}
 
-		if ( $user_id ) {
+		if ( !empty( $user_id ) ) {
 			$user_id = $wpdb->escape( $user_id );
 			$paged_groups = $wpdb->get_results( "SELECT g.*, gm1.meta_value as total_member_count, gm2.meta_value as last_activity FROM {$bp->groups->table_name_groupmeta} gm1, {$bp->groups->table_name_groupmeta} gm2, {$bp->groups->table_name_members} m, {$bp->groups->table_name} g WHERE g.id = m.group_id AND g.id = gm1.group_id AND g.id = gm2.group_id AND gm2.meta_key = 'last_activity' AND gm1.meta_key = 'total_member_count' {$hidden_sql} {$search_sql} AND m.user_id = {$user_id} AND m.is_confirmed = 1 AND m.is_banned = 0 {$exclude_sql} ORDER BY rand() {$pag_sql}" );
 			$total_groups = $wpdb->get_var( "SELECT COUNT(DISTINCT m.group_id) FROM {$bp->groups->table_name_members} m LEFT JOIN {$bp->groups->table_name_groupmeta} gm ON m.group_id = gm.group_id INNER JOIN {$bp->groups->table_name} g ON m.group_id = g.id WHERE gm.meta_key = 'last_activity'{$hidden_sql} {$search_sql} AND m.user_id = {$user_id} AND m.is_confirmed = 1 AND m.is_banned = 0 {$exclude_sql}" );
@@ -527,8 +583,8 @@ Class BP_Groups_Group {
 		}
 
 		if ( !empty( $populate_extras ) ) {
-			foreach ( (array)$paged_groups as $group ) $group_ids[] = $group->id;
-			$group_ids = $wpdb->escape( join( ',', (array)$group_ids ) );
+			foreach ( (array) $paged_groups as $group ) $group_ids[] = $group->id;
+			$group_ids = $wpdb->escape( join( ',', (array) $group_ids ) );
 			$paged_groups = BP_Groups_Group::get_group_extras( $paged_groups, $group_ids, 'newest' );
 		}
 
@@ -541,24 +597,26 @@ Class BP_Groups_Group {
 		if ( empty( $group_ids ) )
 			return $paged_groups;
 
-		/* Fetch the logged in users status within each group */
-		$user_status = $wpdb->get_col( $wpdb->prepare( "SELECT group_id FROM {$bp->groups->table_name_members} WHERE user_id = %d AND group_id IN ( {$group_ids} ) AND is_confirmed = 1 AND is_banned = 0", $bp->loggedin_user->id ) );
+		// Fetch the logged in users status within each group
+		$user_status = $wpdb->get_col( $wpdb->prepare( "SELECT group_id FROM {$bp->groups->table_name_members} WHERE user_id = %d AND group_id IN ( {$group_ids} ) AND is_confirmed = 1 AND is_banned = 0", bp_loggedin_user_id() ) );
 		for ( $i = 0, $count = count( $paged_groups ); $i < $count; ++$i ) {
 			$paged_groups[$i]->is_member = false;
 
-			foreach ( (array)$user_status as $group_id ) {
-				if ( $group_id == $paged_groups[$i]->id )
+			foreach ( (array) $user_status as $group_id ) {
+				if ( $group_id == $paged_groups[$i]->id ) {
 					$paged_groups[$i]->is_member = true;
+				}
 			}
 		}
 
-		$user_banned = $wpdb->get_col( $wpdb->prepare( "SELECT group_id FROM {$bp->groups->table_name_members} WHERE is_banned = 1 AND user_id = %d AND group_id IN ( {$group_ids} )", $bp->loggedin_user->id ) );
+		$user_banned = $wpdb->get_col( $wpdb->prepare( "SELECT group_id FROM {$bp->groups->table_name_members} WHERE is_banned = 1 AND user_id = %d AND group_id IN ( {$group_ids} )", bp_loggedin_user_id() ) );
 		for ( $i = 0, $count = count( $paged_groups ); $i < $count; ++$i ) {
 			$paged_groups[$i]->is_banned = false;
 
-			foreach ( (array)$user_banned as $group_id ) {
-				if ( $group_id == $paged_groups[$i]->id )
+			foreach ( (array) $user_banned as $group_id ) {
+				if ( $group_id == $paged_groups[$i]->id ) {
 					$paged_groups[$i]->is_banned = true;
+				}
 			}
 		}
 
@@ -575,10 +633,10 @@ Class BP_Groups_Group {
 		global $wpdb, $bp;
 
 		$hidden_sql = '';
-		if ( !is_super_admin() )
+		if ( !bp_current_user_can( 'bp_moderate' ) )
 			$hidden_sql = "WHERE status != 'hidden'";
 
-		return $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(id) FROM {$bp->groups->table_name} {$hidden_sql}" ) );
+		return $wpdb->get_var( "SELECT COUNT(id) FROM {$bp->groups->table_name} {$hidden_sql}" );
 	}
 
 	function get_global_forum_topic_count( $type ) {
@@ -587,7 +645,24 @@ Class BP_Groups_Group {
 		if ( 'unreplied' == $type )
 			$bp->groups->filter_sql = ' AND t.topic_posts = 1';
 
-		$extra_sql = apply_filters( 'groups_total_public_forum_topic_count', $bp->groups->filter_sql, $type );
+		/**
+		 * Provide backward-compatibility for the groups_total_public_forum_topic_count SQL filter. 
+		 * Developers: DO NOT use this filter. It will be removed in BP 1.7. Instead, use
+		 * get_global_forum_topic_count_extra_sql. See https://buddypress.trac.wordpress.org/ticket/4306
+		 */
+		$maybe_extra_sql = apply_filters( 'groups_total_public_forum_topic_count', $bp->groups->filter_sql, $type );
+
+		if ( is_int( $maybe_extra_sql ) )
+			$extra_sql = $bp->groups->filter_sql;
+		else
+			$extra_sql = $maybe_extra_sql;
+
+		// Developers: use this filter instead
+		$extra_sql = apply_filters( 'get_global_forum_topic_count_extra_sql', $bp->groups->filter_sql, $type );
+
+		// Make sure the $extra_sql begins with an AND
+		if ( 'AND' != substr( trim( strtoupper( $extra_sql ) ), 0, 3 ) )
+			$extra_sql = ' AND ' . $extra_sql;
 
 		return $wpdb->get_var( "SELECT COUNT(t.topic_id) FROM {$bbdb->topics} AS t, {$bp->groups->table_name} AS g LEFT JOIN {$bp->groups->table_name_groupmeta} AS gm ON g.id = gm.group_id WHERE (gm.meta_key = 'forum_id' AND gm.meta_value = t.forum_id) AND g.status = 'public' AND t.topic_status = '0' AND t.topic_sticky != '2' {$extra_sql} " );
 	}
@@ -598,12 +673,11 @@ Class BP_Groups_Group {
 		return $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(id) FROM {$bp->groups->table_name_members} WHERE group_id = %d AND is_confirmed = 1 AND is_banned = 0", $group_id ) );
 	}
 
-
 	/**
 	 * Get a total count of all topics of a given status, across groups/forums
 	 *
 	 * @package BuddyPress
-	 * @since 1.5
+	 * @since BuddyPress (1.5)
 	 *
 	 * @param str $status 'public', 'private', 'hidden', 'all' Which group types to count
 	 * @return int The topic count
@@ -617,16 +691,16 @@ Class BP_Groups_Group {
 				break;
 
 			case 'hidden' :
-				$status_sql = $wpdb->prepare( "AND g.status = 'hidden'" );
+				$status_sql = "AND g.status = 'hidden'";
 				break;
 
 			case 'private' :
-				$status_sql = $wpdb->prepare( "AND g.status = 'private'" );
+				$status_sql = "AND g.status = 'private'";
 				break;
 
 			case 'public' :
 			default :
-				$status_sql = $wpdb->prepare( "AND g.status = 'public'" );
+				$status_sql = "AND g.status = 'public'";
 				break;
 		}
 
@@ -647,7 +721,7 @@ Class BP_Groups_Group {
 	}
 }
 
-Class BP_Groups_Member {
+class BP_Groups_Member {
 	var $id;
 	var $group_id;
 	var $user_id;
@@ -660,27 +734,27 @@ Class BP_Groups_Member {
 	var $is_confirmed;
 	var $comments;
 	var $invite_sent;
-
 	var $user;
 
-	function bp_groups_member( $user_id = 0, $group_id = 0, $id = false, $populate = true ) {
-		$this->__construct($user_id,$group_id,$id,$populate);
-	}
-
 	function __construct( $user_id = 0, $group_id = 0, $id = false, $populate = true ) {
-		if ( $user_id && $group_id && !$id ) {
-			$this->user_id = $user_id;
+
+		// User and group are not empty, and ID is
+		if ( !empty( $user_id ) && !empty( $group_id ) && empty( $id ) ) {
+			$this->user_id  = $user_id;
 			$this->group_id = $group_id;
 
-			if ( $populate )
+			if ( !empty( $populate ) ) {
 				$this->populate();
+			}
 		}
 
-		if ( $id ) {
+		// ID is not empty
+		if ( !empty( $id ) ) {
 			$this->id = $id;
 
-			if ( $populate )
+			if ( !empty( $populate ) ) {
 				$this->populate();
+			}
 		}
 	}
 
@@ -690,12 +764,12 @@ Class BP_Groups_Member {
 		if ( $this->user_id && $this->group_id && !$this->id )
 			$sql = $wpdb->prepare( "SELECT * FROM {$bp->groups->table_name_members} WHERE user_id = %d AND group_id = %d", $this->user_id, $this->group_id );
 
-		if ( $this->id )
+		if ( !empty( $this->id ) )
 			$sql = $wpdb->prepare( "SELECT * FROM {$bp->groups->table_name_members} WHERE id = %d", $this->id );
 
 		$member = $wpdb->get_row($sql);
 
-		if ( $member ) {
+		if ( !empty( $member ) ) {
 			$this->id            = $member->id;
 			$this->group_id      = $member->group_id;
 			$this->user_id       = $member->user_id;
@@ -730,12 +804,18 @@ Class BP_Groups_Member {
 
 		do_action_ref_array( 'groups_member_before_save', array( &$this ) );
 
-		if ( $this->id )
+		if ( !empty( $this->id ) ) {
 			$sql = $wpdb->prepare( "UPDATE {$bp->groups->table_name_members} SET inviter_id = %d, is_admin = %d, is_mod = %d, is_banned = %d, user_title = %s, date_modified = %s, is_confirmed = %d, comments = %s, invite_sent = %d WHERE id = %d", $this->inviter_id, $this->is_admin, $this->is_mod, $this->is_banned, $this->user_title, $this->date_modified, $this->is_confirmed, $this->comments, $this->invite_sent, $this->id );
-		else
+		} else {
+			// Ensure that user is not already a member of the group before inserting
+			if ( $wpdb->get_var( $wpdb->prepare( "SELECT id FROM {$bp->groups->table_name_members} WHERE user_id = %d AND group_id = %d AND is_confirmed = 1 LIMIT 1", $this->user_id, $this->group_id ) ) ) {
+				return false;
+			}
+			
 			$sql = $wpdb->prepare( "INSERT INTO {$bp->groups->table_name_members} ( user_id, group_id, inviter_id, is_admin, is_mod, is_banned, user_title, date_modified, is_confirmed, comments, invite_sent ) VALUES ( %d, %d, %d, %d, %d, %d, %s, %s, %d, %s, %d )", $this->user_id, $this->group_id, $this->inviter_id, $this->is_admin, $this->is_mod, $this->is_banned, $this->user_title, $this->date_modified, $this->is_confirmed, $this->comments, $this->invite_sent );
+		}
 
-		if ( !$wpdb->query($sql) )
+		if ( !$wpdb->query( $sql ) )
 			return false;
 
 		$this->id = $wpdb->insert_id;
@@ -747,14 +827,14 @@ Class BP_Groups_Member {
 
 	function promote( $status = 'mod' ) {
 		if ( 'mod' == $status ) {
-			$this->is_admin = 0;
-			$this->is_mod = 1;
+			$this->is_admin   = 0;
+			$this->is_mod     = 1;
 			$this->user_title = __( 'Group Mod', 'buddypress' );
 		}
 
 		if ( 'admin' == $status ) {
-			$this->is_admin = 1;
-			$this->is_mod = 0;
+			$this->is_admin   = 1;
+			$this->is_mod     = 0;
 			$this->user_title = __( 'Group Admin', 'buddypress' );
 		}
 
@@ -762,17 +842,16 @@ Class BP_Groups_Member {
 	}
 
 	function demote() {
-		$this->is_mod = 0;
-		$this->is_admin = 0;
+		$this->is_mod     = 0;
+		$this->is_admin   = 0;
 		$this->user_title = false;
 
 		return $this->save();
 	}
 
 	function ban() {
-		global $bp;
 
-		if ( $this->is_admin )
+		if ( !empty( $this->is_admin ) )
 			return false;
 
 		$this->is_mod = 0;
@@ -782,42 +861,39 @@ Class BP_Groups_Member {
 
 		$group_count = bp_get_user_meta( $this->user_id, 'total_group_count', true );
 		if ( !empty( $group_count ) )
-			bp_update_user_meta( $this->user_id, 'total_group_count', (int)$group_count - 1 );
+			bp_update_user_meta( $this->user_id, 'total_group_count', (int) $group_count - 1 );
 
 		return $this->save();
 	}
 
 	function unban() {
-		global $bp;
 
-		if ( $this->is_admin )
+		if ( !empty( $this->is_admin ) )
 			return false;
 
 		$this->is_banned = 0;
 
 		groups_update_groupmeta( $this->group_id, 'total_member_count', ( (int) groups_get_groupmeta( $this->group_id, 'total_member_count' ) + 1 ) );
-		bp_update_user_meta( $this->user_id, 'total_group_count', (int)bp_get_user_meta( $this->user_id, 'total_group_count', true ) + 1 );
+		bp_update_user_meta( $this->user_id, 'total_group_count', (int) bp_get_user_meta( $this->user_id, 'total_group_count', true ) + 1 );
 
 		return $this->save();
 	}
 
 	function accept_invite() {
-		global $bp;
 
 		$this->inviter_id    = 0;
 		$this->is_confirmed  = 1;
 		$this->date_modified = bp_core_current_time();
 
-		bp_update_user_meta( $this->user_id, 'total_group_count', (int)bp_get_user_meta( $this->user_id, 'total_group_count', true ) + 1 );
+		bp_update_user_meta( $this->user_id, 'total_group_count', (int) bp_get_user_meta( $this->user_id, 'total_group_count', true ) + 1 );
 	}
 
 	function accept_request() {
-		global $bp;
 
 		$this->is_confirmed = 1;
 		$this->date_modified = bp_core_current_time();
 
-		bp_update_user_meta( $this->user_id, 'total_group_count', (int)bp_get_user_meta( $this->user_id, 'total_group_count', true ) + 1 );
+		bp_update_user_meta( $this->user_id, 'total_group_count', (int) bp_get_user_meta( $this->user_id, 'total_group_count', true ) + 1 );
 	}
 
 	function remove() {
@@ -832,12 +908,12 @@ Class BP_Groups_Member {
 
 		$group_count = bp_get_user_meta( $this->user_id, 'total_group_count', true );
 		if ( !empty( $group_count ) )
-			bp_update_user_meta( $this->user_id, 'total_group_count', (int)$group_count - 1 );
+			bp_update_user_meta( $this->user_id, 'total_group_count', (int) $group_count - 1 );
 
 		return $result;
 	}
 
-	/* Static Functions */
+	/** Static Methods ********************************************************/
 
 	function delete( $user_id, $group_id ) {
 		global $wpdb, $bp;
@@ -849,11 +925,11 @@ Class BP_Groups_Member {
 		global $wpdb, $bp;
 
 		$pag_sql = '';
-		if ( $limit && $page )
+		if ( !empty( $limit ) && !empty( $page ) )
 			$pag_sql = $wpdb->prepare( " LIMIT %d, %d", intval( ( $page - 1 ) * $limit), intval( $limit ) );
 
 		// If the user is logged in and viewing their own groups, we can show hidden and private groups
-		if ( $user_id != $bp->loggedin_user->id ) {
+		if ( $user_id != bp_loggedin_user_id() ) {
 			$group_sql = $wpdb->prepare( "SELECT DISTINCT m.group_id FROM {$bp->groups->table_name_members} m, {$bp->groups->table_name} g WHERE g.status != 'hidden' AND m.user_id = %d AND m.is_confirmed = 1 AND m.is_banned = 0{$pag_sql}", $user_id );
 			$total_groups = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(DISTINCT m.group_id) FROM {$bp->groups->table_name_members} m, {$bp->groups->table_name} g WHERE g.status != 'hidden' AND m.user_id = %d AND m.is_confirmed = 1 AND m.is_banned = 0", $user_id ) );
 		} else {
@@ -871,15 +947,15 @@ Class BP_Groups_Member {
 
 		$pag_sql = $hidden_sql = $filter_sql = '';
 
-		if ( $limit && $page )
+		if ( !empty( $limit ) && !empty( $page ) )
 			$pag_sql = $wpdb->prepare( " LIMIT %d, %d", intval( ( $page - 1 ) * $limit), intval( $limit ) );
 
-		if ( $filter ) {
+		if ( !empty( $filter ) ) {
 			$filter = like_escape( $wpdb->escape( $filter ) );
 			$filter_sql = " AND ( g.name LIKE '%%{$filter}%%' OR g.description LIKE '%%{$filter}%%' )";
 		}
 
-		if ( $user_id != $bp->loggedin_user->id )
+		if ( $user_id != bp_loggedin_user_id() )
 			$hidden_sql = " AND g.status != 'hidden'";
 
 		$paged_groups = $wpdb->get_results( $wpdb->prepare( "SELECT g.*, gm1.meta_value as total_member_count, gm2.meta_value as last_activity FROM {$bp->groups->table_name_groupmeta} gm1, {$bp->groups->table_name_groupmeta} gm2, {$bp->groups->table_name_members} m, {$bp->groups->table_name} g WHERE g.id = m.group_id AND g.id = gm1.group_id AND g.id = gm2.group_id AND gm2.meta_key = 'last_activity' AND gm1.meta_key = 'total_member_count'{$hidden_sql}{$filter_sql} AND m.user_id = %d AND m.is_confirmed = 1 AND m.is_banned = 0 ORDER BY m.date_modified DESC {$pag_sql}", $user_id ) );
@@ -893,15 +969,15 @@ Class BP_Groups_Member {
 
 		$pag_sql = $hidden_sql = $filter_sql = '';
 
-		if ( $limit && $page )
+		if ( !empty( $limit ) && !empty( $page ) )
 			$pag_sql = $wpdb->prepare( " LIMIT %d, %d", intval( ( $page - 1 ) * $limit), intval( $limit ) );
 
-		if ( $filter ) {
+		if ( !empty( $filter ) ) {
 			$filter = like_escape( $wpdb->escape( $filter ) );
 			$filter_sql = " AND ( g.name LIKE '%%{$filter}%%' OR g.description LIKE '%%{$filter}%%' )";
 		}
 
-		if ( $user_id != $bp->loggedin_user->id )
+		if ( $user_id != bp_loggedin_user_id() )
 			$hidden_sql = " AND g.status != 'hidden'";
 
 		$paged_groups = $wpdb->get_results( $wpdb->prepare( "SELECT g.*, gm1.meta_value as total_member_count, gm2.meta_value as last_activity FROM {$bp->groups->table_name_groupmeta} gm1, {$bp->groups->table_name_groupmeta} gm2, {$bp->groups->table_name_members} m, {$bp->groups->table_name} g WHERE g.id = m.group_id AND g.id = gm1.group_id AND g.id = gm2.group_id AND gm2.meta_key = 'last_activity' AND gm1.meta_key = 'total_member_count'{$hidden_sql}{$filter_sql} AND m.user_id = %d AND m.is_confirmed = 1 AND m.is_banned = 0 AND m.is_admin = 1 ORDER BY m.date_modified ASC {$pag_sql}", $user_id ) );
@@ -915,15 +991,15 @@ Class BP_Groups_Member {
 
 		$pag_sql = $hidden_sql = $filter_sql = '';
 
-		if ( $limit && $page )
+		if ( !empty( $limit ) && !empty( $page ) )
 			$pag_sql = $wpdb->prepare( " LIMIT %d, %d", intval( ( $page - 1 ) * $limit), intval( $limit ) );
 
-		if ( $filter ) {
+		if ( !empty( $filter ) ) {
 			$filter = like_escape( $wpdb->escape( $filter ) );
 			$filter_sql = " AND ( g.name LIKE '%%{$filter}%%' OR g.description LIKE '%%{$filter}%%' )";
 		}
 
-		if ( $user_id != $bp->loggedin_user->id )
+		if ( $user_id != bp_loggedin_user_id() )
 			$hidden_sql = " AND g.status != 'hidden'";
 
 		$paged_groups = $wpdb->get_results( $wpdb->prepare( "SELECT g.*, gm1.meta_value as total_member_count, gm2.meta_value as last_activity FROM {$bp->groups->table_name_groupmeta} gm1, {$bp->groups->table_name_groupmeta} gm2, {$bp->groups->table_name_members} m, {$bp->groups->table_name} g WHERE g.id = m.group_id AND g.id = gm1.group_id AND g.id = gm2.group_id AND gm2.meta_key = 'last_activity' AND gm1.meta_key = 'total_member_count'{$hidden_sql}{$filter_sql} AND m.user_id = %d AND m.is_confirmed = 1 AND m.is_banned = 0 AND m.is_mod = 1 ORDER BY m.date_modified ASC {$pag_sql}", $user_id ) );
@@ -935,10 +1011,10 @@ Class BP_Groups_Member {
 	function total_group_count( $user_id = 0 ) {
 		global $bp, $wpdb;
 
-		if ( !$user_id )
-			$user_id = $bp->displayed_user->id;
+		if ( empty( $user_id ) )
+			$user_id = bp_displayed_user_id();
 
-		if ( $user_id != $bp->loggedin_user->id && !is_super_admin() ) {
+		if ( $user_id != bp_loggedin_user_id() && !bp_current_user_can( 'bp_moderate' ) ) {
 			return $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(DISTINCT m.group_id) FROM {$bp->groups->table_name_members} m, {$bp->groups->table_name} g WHERE m.group_id = g.id AND g.status != 'hidden' AND m.user_id = %d AND m.is_confirmed = 1 AND m.is_banned = 0", $user_id ) );
 		} else {
 			return $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(DISTINCT m.group_id) FROM {$bp->groups->table_name_members} m, {$bp->groups->table_name} g WHERE m.group_id = g.id AND m.user_id = %d AND m.is_confirmed = 1 AND m.is_banned = 0", $user_id ) );
@@ -961,7 +1037,7 @@ Class BP_Groups_Member {
 	function check_has_invite( $user_id, $group_id, $type = 'sent' ) {
 		global $wpdb, $bp;
 
-		if ( !$user_id )
+		if ( empty( $user_id ) )
 			return false;
 
 		$sql = "SELECT id FROM {$bp->groups->table_name_members} WHERE user_id = %d AND group_id = %d AND is_confirmed = 0 AND inviter_id != 0";
@@ -975,7 +1051,7 @@ Class BP_Groups_Member {
 	function delete_invite( $user_id, $group_id ) {
 		global $wpdb, $bp;
 
-		if ( !$user_id )
+		if ( empty( $user_id ) )
 			return false;
 
 		return $wpdb->query( $wpdb->prepare( "DELETE FROM {$bp->groups->table_name_members} WHERE user_id = %d AND group_id = %d AND is_confirmed = 0 AND inviter_id != 0 AND invite_sent = 1", $user_id, $group_id ) );
@@ -984,7 +1060,7 @@ Class BP_Groups_Member {
 	function delete_request( $user_id, $group_id ) {
 		global $wpdb, $bp;
 
-		if ( !$user_id )
+		if ( empty( $user_id ) )
 			return false;
 
  		return $wpdb->query( $wpdb->prepare( "DELETE FROM {$bp->groups->table_name_members} WHERE user_id = %d AND group_id = %d AND is_confirmed = 0 AND inviter_id = 0 AND invite_sent = 0", $user_id, $group_id ) );
@@ -993,7 +1069,7 @@ Class BP_Groups_Member {
 	function check_is_admin( $user_id, $group_id ) {
 		global $wpdb, $bp;
 
-		if ( !$user_id )
+		if ( empty( $user_id ) )
 			return false;
 
 		return $wpdb->query( $wpdb->prepare( "SELECT id FROM {$bp->groups->table_name_members} WHERE user_id = %d AND group_id = %d AND is_admin = 1 AND is_banned = 0", $user_id, $group_id ) );
@@ -1002,7 +1078,7 @@ Class BP_Groups_Member {
 	function check_is_mod( $user_id, $group_id ) {
 		global $wpdb, $bp;
 
-		if ( !$user_id )
+		if ( empty( $user_id ) )
 			return false;
 
 		return $wpdb->query( $wpdb->prepare( "SELECT id FROM {$bp->groups->table_name_members} WHERE user_id = %d AND group_id = %d AND is_mod = 1 AND is_banned = 0", $user_id, $group_id ) );
@@ -1011,7 +1087,7 @@ Class BP_Groups_Member {
 	function check_is_member( $user_id, $group_id ) {
 		global $wpdb, $bp;
 
-		if ( !$user_id )
+		if ( empty( $user_id ) )
 			return false;
 
 		return $wpdb->query( $wpdb->prepare( "SELECT id FROM {$bp->groups->table_name_members} WHERE user_id = %d AND group_id = %d AND is_confirmed = 1 AND is_banned = 0", $user_id, $group_id ) );
@@ -1020,7 +1096,7 @@ Class BP_Groups_Member {
 	function check_is_banned( $user_id, $group_id ) {
 		global $wpdb, $bp;
 
-		if ( !$user_id )
+		if ( empty( $user_id ) )
 			return false;
 
 		return $wpdb->get_var( $wpdb->prepare( "SELECT is_banned FROM {$bp->groups->table_name_members} WHERE user_id = %d AND group_id = %d", $user_id, $group_id ) );
@@ -1038,7 +1114,7 @@ Class BP_Groups_Member {
 	function check_is_creator( $user_id, $group_id ) {
 		global $bp, $wpdb;
 
-		if ( !$user_id )
+		if ( empty( $user_id ) )
 			return false;
 
 		return $wpdb->get_var( $wpdb->prepare( "SELECT id FROM {$bp->groups->table_name} WHERE creator_id = %d AND id = %d", $user_id, $group_id ) );
@@ -1047,7 +1123,7 @@ Class BP_Groups_Member {
 	function check_for_membership_request( $user_id, $group_id ) {
 		global $wpdb, $bp;
 
-		if ( !$user_id )
+		if ( empty( $user_id ) )
 			return false;
 
 		return $wpdb->query( $wpdb->prepare( "SELECT id FROM {$bp->groups->table_name_members} WHERE user_id = %d AND group_id = %d AND is_confirmed = 0 AND is_banned = 0 AND inviter_id = 0", $user_id, $group_id ) );
@@ -1058,9 +1134,9 @@ Class BP_Groups_Member {
 
 		// If the user is logged in and viewing their random groups, we can show hidden and private groups
 		if ( bp_is_my_profile() ) {
-			return $wpdb->get_col( $wpdb->prepare( "SELECT DISTINCT group_id FROM {$bp->groups->table_name_members} WHERE user_id = %d AND is_confirmed = 1 AND is_banned = 0 ORDER BY rand() LIMIT $total_groups", $user_id ) );
+			return $wpdb->get_col( $wpdb->prepare( "SELECT DISTINCT group_id FROM {$bp->groups->table_name_members} WHERE user_id = %d AND is_confirmed = 1 AND is_banned = 0 ORDER BY rand() LIMIT {$total_groups}", $user_id ) );
 		} else {
-			return $wpdb->get_col( $wpdb->prepare( "SELECT DISTINCT m.group_id FROM {$bp->groups->table_name_members} m, {$bp->groups->table_name} g WHERE m.group_id = g.id AND g.status != 'hidden' AND m.user_id = %d AND m.is_confirmed = 1 AND m.is_banned = 0 ORDER BY rand() LIMIT $total_groups", $user_id ) );
+			return $wpdb->get_col( $wpdb->prepare( "SELECT DISTINCT m.group_id FROM {$bp->groups->table_name_members} m, {$bp->groups->table_name} g WHERE m.group_id = g.id AND g.status != 'hidden' AND m.user_id = %d AND m.is_confirmed = 1 AND m.is_banned = 0 ORDER BY rand() LIMIT {$total_groups}", $user_id ) );
 		}
 	}
 
@@ -1092,27 +1168,27 @@ Class BP_Groups_Member {
 		global $bp, $wpdb;
 
 		$pag_sql = '';
-		if ( $limit && $page )
+		if ( !empty( $limit ) && !empty( $page ) )
 			$pag_sql = $wpdb->prepare( "LIMIT %d, %d", intval( ( $page - 1 ) * $limit), intval( $limit ) );
 
 		$exclude_admins_sql = '';
-		if ( $exclude_admins_mods )
-			$exclude_admins_sql = $wpdb->prepare( "AND is_admin = 0 AND is_mod = 0" );
+		if ( !empty( $exclude_admins_mods ) )
+			$exclude_admins_sql = "AND is_admin = 0 AND is_mod = 0";
 
 		$banned_sql = '';
-		if ( $exclude_banned )
-			$banned_sql = $wpdb->prepare( " AND is_banned = 0" );
+		if ( !empty( $exclude_banned ) )
+			$banned_sql = " AND is_banned = 0";
 
 		$exclude_sql = '';
-		if ( $exclude )
-			$exclude_sql = $wpdb->prepare( " AND m.user_id NOT IN ({$exclude})" );
+		if ( !empty( $exclude ) )
+			$exclude_sql = " AND m.user_id NOT IN ({$exclude})";
 
 		if ( bp_is_active( 'xprofile' ) )
 			$members = $wpdb->get_results( apply_filters( 'bp_group_members_user_join_filter', $wpdb->prepare( "SELECT m.user_id, m.date_modified, m.is_banned, u.user_login, u.user_nicename, u.user_email, pd.value as display_name FROM {$bp->groups->table_name_members} m, {$wpdb->users} u, {$bp->profile->table_name_data} pd WHERE u.ID = m.user_id AND u.ID = pd.user_id AND pd.field_id = 1 AND group_id = %d AND is_confirmed = 1 {$banned_sql} {$exclude_admins_sql} {$exclude_sql} ORDER BY m.date_modified DESC {$pag_sql}", $group_id ) ) );
 		else
 			$members = $wpdb->get_results( apply_filters( 'bp_group_members_user_join_filter', $wpdb->prepare( "SELECT m.user_id, m.date_modified, m.is_banned, u.user_login, u.user_nicename, u.user_email, u.display_name FROM {$bp->groups->table_name_members} m, {$wpdb->users} u WHERE u.ID = m.user_id AND group_id = %d AND is_confirmed = 1 {$banned_sql} {$exclude_admins_sql} {$exclude_sql} ORDER BY m.date_modified DESC {$pag_sql}", $group_id ) ) );
 
-		if ( !$members )
+		if ( empty( $members ) )
 			return false;
 
 		if ( empty( $pag_sql ) )
@@ -1120,16 +1196,19 @@ Class BP_Groups_Member {
 		else
 			$total_member_count = $wpdb->get_var( apply_filters( 'bp_group_members_count_user_join_filter', $wpdb->prepare( "SELECT COUNT(user_id) FROM {$bp->groups->table_name_members} WHERE group_id = %d AND is_confirmed = 1 {$banned_sql} {$exclude_admins_sql} {$exclude_sql}", $group_id ) ) );
 
-		/* Fetch whether or not the user is a friend */
-		foreach ( (array)$members as $user ) $user_ids[] = $user->user_id;
-		$user_ids = $wpdb->escape( join( ',', (array)$user_ids ) );
+		// Fetch whether or not the user is a friend
+		foreach ( (array) $members as $user )
+			$user_ids[] = $user->user_id;
+
+		$user_ids = $wpdb->escape( join( ',', (array) $user_ids ) );
 
 		if ( bp_is_active( 'friends' ) ) {
-			$friend_status = $wpdb->get_results( $wpdb->prepare( "SELECT initiator_user_id, friend_user_id, is_confirmed FROM {$bp->friends->table_name} WHERE (initiator_user_id = %d AND friend_user_id IN ( {$user_ids} ) ) OR (initiator_user_id IN ( {$user_ids} ) AND friend_user_id = %d )", $bp->loggedin_user->id, $bp->loggedin_user->id ) );
+			$friend_status = $wpdb->get_results( $wpdb->prepare( "SELECT initiator_user_id, friend_user_id, is_confirmed FROM {$bp->friends->table_name} WHERE (initiator_user_id = %d AND friend_user_id IN ( {$user_ids} ) ) OR (initiator_user_id IN ( {$user_ids} ) AND friend_user_id = %d )", bp_loggedin_user_id(), bp_loggedin_user_id() ) );
 			for ( $i = 0, $count = count( $members ); $i < $count; ++$i ) {
-				foreach ( (array)$friend_status as $status ) {
-					if ( $status->initiator_user_id == $members[$i]->user_id || $status->friend_user_id == $members[$i]->user_id )
+				foreach ( (array) $friend_status as $status ) {
+					if ( $status->initiator_user_id == $members[$i]->user_id || $status->friend_user_id == $members[$i]->user_id ) {
 						$members[$i]->is_friend = $status->is_confirmed;
+					}
 				}
 			}
 		}
@@ -1186,8 +1265,16 @@ Class BP_Groups_Member {
 class BP_Group_Extension {
 	var $name = false;
 	var $slug = false;
+	
+	// The name/slug of the Group Admin tab for this extension
+	var $admin_name = '';
+	var $admin_slug = '';
 
-	/* Will this extension be visible to non-members of a group? Options: public/private */
+	// The name/slug of the Group Creation tab for this extension
+	var $create_name = '';
+	var $create_slug = '';
+
+	// Will this extension be visible to non-members of a group? Options: public/private
 	var $visibility = 'public';
 
 	var $create_step_position = 81;
@@ -1220,16 +1307,34 @@ class BP_Group_Extension {
 
 	function _register() {
 		global $bp;
+		
+		// If admin/create names and slugs are not provided, they fall back on the main
+		// name and slug for the extension
+		if ( !$this->admin_name ) {
+			$this->admin_name = $this->name;
+		}
+		
+		if ( !$this->admin_slug ) {
+			$this->admin_slug = $this->slug;
+		}
+		
+		if ( !$this->create_name ) {
+			$this->create_name = $this->name;
+		}
+		
+		if ( !$this->create_slug ) {
+			$this->create_slug = $this->slug;
+		}
 
 		if ( !empty( $this->enable_create_step ) ) {
 			// Insert the group creation step for the new group extension
-			$bp->groups->group_creation_steps[$this->slug] = array( 'name' => $this->name, 'slug' => $this->slug, 'position' => $this->create_step_position );
+			$bp->groups->group_creation_steps[$this->create_slug] = array( 'name' => $this->create_name, 'slug' => $this->create_slug, 'position' => $this->create_step_position );
 
 			// Attach the group creation step display content action
 			add_action( 'groups_custom_create_steps', array( &$this, 'create_screen' ) );
 
 			// Attach the group creation step save content action
-			add_action( 'groups_create_group_step_save_' . $this->slug, array( &$this, 'create_screen_save' ) );
+			add_action( 'groups_create_group_step_save_' . $this->create_slug, array( &$this, 'create_screen_save' ) );
 		}
 
 		// When we are viewing a single group, add the group extension nav item
@@ -1252,11 +1357,11 @@ class BP_Group_Extension {
 		}
 
 		// Construct the admin edit tab for the new group extension
-		if ( !empty( $this->enable_edit_item ) && !empty( $bp->is_item_admin ) ) {
-			add_action( 'groups_admin_tabs', create_function( '$current, $group_slug', '$selected = ""; if ( "' . esc_attr( $this->slug ) . '" == $current ) $selected = " class=\"current\""; echo "<li{$selected}><a href=\"' . bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/{$group_slug}/admin/' . esc_attr( $this->slug ) . '\">' . esc_attr( $this->name ) . '</a></li>";' ), 10, 2 );
+		if ( !empty( $this->enable_edit_item ) && bp_is_item_admin() ) {
+			add_action( 'groups_admin_tabs', create_function( '$current, $group_slug', '$selected = ""; if ( "' . esc_attr( $this->admin_slug ) . '" == $current ) $selected = " class=\"current\""; echo "<li{$selected}><a href=\"' . trailingslashit( bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/{$group_slug}/admin/' . esc_attr( $this->admin_slug ) ) . '\">' . esc_attr( $this->admin_name ) . '</a></li>";' ), 10, 2 );
 
 			// Catch the edit screen and forward it to the plugin template
-			if ( bp_is_groups_component() && bp_is_current_action( 'admin' ) && bp_is_action_variable( $this->slug, 0 ) ) {
+			if ( bp_is_groups_component() && bp_is_current_action( 'admin' ) && bp_is_action_variable( $this->admin_slug, 0 ) ) {
 				// Check whether the user is saving changes
 				$this->edit_screen_save();
 
@@ -1280,12 +1385,12 @@ class BP_Group_Extension {
 }
 
 function bp_register_group_extension( $group_extension_class ) {
-	global $bp;
 
 	if ( !class_exists( $group_extension_class ) )
 		return false;
 
-	/* Register the group extension on the bp_init action so we have access to all plugins */
+	// Register the group extension on the bp_init action so we have access
+	// to all plugins.
 	add_action( 'bp_init', create_function( '', '$extension = new ' . $group_extension_class . '; add_action( "bp_actions", array( &$extension, "_register" ), 8 );' ), 11 );
 }
 
diff --git a/wp-content/plugins/buddypress/bp-groups/bp-groups-filters.php b/wp-content/plugins/buddypress/bp-groups/bp-groups-filters.php
index fdbd32b528d3df2e93e48f10d55c58434fe0784f..41e59c4279548531075dbd8e943577d0ffae0029 100644
--- a/wp-content/plugins/buddypress/bp-groups/bp-groups-filters.php
+++ b/wp-content/plugins/buddypress/bp-groups/bp-groups-filters.php
@@ -1,4 +1,12 @@
 <?php
+
+/**
+ * BuddyPress Groups Filters
+ *
+ * @package BuddyPress
+ * @subpackage GroupsFilters
+ */
+
 // Exit if accessed directly
 if ( !defined( 'ABSPATH' ) ) exit;
 
@@ -56,25 +64,26 @@ function bp_groups_filter_kses( $content ) {
 	$groups_allowedtags['img']['class']  = array();
 	$groups_allowedtags['img']['id']     = array();
 	$groups_allowedtags['code']          = array();
-
 	$groups_allowedtags = apply_filters( 'bp_groups_filter_kses', $groups_allowedtags );
+
 	return wp_kses( $content, $groups_allowedtags );
 }
 
-/**** Filters for group forums ****/
+/** Group forums **************************************************************/
 
+/**
+ * Only filter the forum SQL on group pages or on the forums directory 
+ */
 function groups_add_forum_privacy_sql() {
-	global $bp;
-
-	// Only filter the forum SQL on group pages or on the forums directory
-	add_filter( 'get_topics_fields',     'groups_add_forum_fields_sql' );
-	add_filter( 'get_topics_join', 	     'groups_add_forum_tables_sql' );
-	add_filter( 'get_topics_where',      'groups_add_forum_where_sql'  );
+	add_filter( 'get_topics_fields', 'groups_add_forum_fields_sql' );
+	add_filter( 'get_topics_join', 	 'groups_add_forum_tables_sql' );
+	add_filter( 'get_topics_where',  'groups_add_forum_where_sql'  );
 }
 add_filter( 'bbpress_init', 'groups_add_forum_privacy_sql' );
 
 function groups_add_forum_fields_sql( $sql = '' ) {
-	return 't.*, g.id as object_id, g.name as object_name, g.slug as object_slug';
+	$sql = 't.*, g.id as object_id, g.name as object_name, g.slug as object_slug';
+	return $sql;
 }
 
 function groups_add_forum_tables_sql( $sql = '' ) {
@@ -88,6 +97,9 @@ function groups_add_forum_tables_sql( $sql = '' ) {
 function groups_add_forum_where_sql( $sql = '' ) {
 	global $bp;
 
+	// Define locale variable
+	$parts = array();
+
 	// Set this for groups
 	$parts['groups'] = "(gm.meta_key = 'forum_id' AND gm.meta_value = t.forum_id)";
 
@@ -104,7 +116,7 @@ function groups_add_forum_where_sql( $sql = '' ) {
 		unset( $parts['private'] );
 
 	// Are we a super admin?
-	elseif ( is_super_admin() )
+	elseif ( bp_current_user_can( 'bp_moderate' ) )
 		unset( $parts['private'] );
 
 	// No need to filter on a single item
@@ -128,9 +140,9 @@ function groups_add_forum_where_sql( $sql = '' ) {
 function groups_filter_bbpress_caps( $value, $cap, $args ) {
 	global $bp;
 
-	if ( is_super_admin() )
+	if ( bp_current_user_can( 'bp_moderate' ) )
 		return true;
-
+	
 	if ( 'add_tag_to' == $cap )
 		if ( $bp->groups->current_group->user_has_access ) return true;
 
@@ -146,10 +158,11 @@ add_filter( 'bb_current_user_can', 'groups_filter_bbpress_caps', 10, 3 );
  * information we aren't going to use. This speeds up the query.
  *
  * @see BB_Query::_filter_sql()
- * @since 1.5
+ * @since BuddyPress (1.5)
  */
 function groups_filter_forums_root_page_sql( $sql ) {
 	return apply_filters( 'groups_filter_bbpress_root_page_sql', 't.topic_id' );
 }
 add_filter( 'get_latest_topics_fields', 'groups_filter_forums_root_page_sql' );
-?>
\ No newline at end of file
+
+?>
diff --git a/wp-content/plugins/buddypress/bp-groups/bp-groups-forums.php b/wp-content/plugins/buddypress/bp-groups/bp-groups-forums.php
index 082d9e35ca0abd26df313bfc5a1ceb42fce05865..694c3b52fe9e9e1f6a299f84e24d508092e9c882 100644
--- a/wp-content/plugins/buddypress/bp-groups/bp-groups-forums.php
+++ b/wp-content/plugins/buddypress/bp-groups/bp-groups-forums.php
@@ -1,17 +1,38 @@
 <?php
-/*** Group Forums **************************************************************/
+
+/**
+ * BuddyPress Groups Forums
+ *
+ * Action functions are exactly the same as screen functions, however they do not
+ * have a template screen associated with them. Usually they will send the user
+ * back to the default screen after execution.
+ *
+ * @package BuddyPress
+ * @subpackage GroupsForums
+ */
 
 // Exit if accessed directly
 if ( !defined( 'ABSPATH' ) ) exit;
 
+/**
+ * Creates a new forum inside a specific BuddyPress group.
+ *
+ * Uses the bundled version of bbPress packaged with BuddyPress.
+ *
+ * @param int $group_id The group ID that the new forum should be attached to
+ * @param string $group_name The group name
+ * @param string $group_description The group description
+ *
+ * @since 1.0
+ */
 function groups_new_group_forum( $group_id = 0, $group_name = '', $group_desc = '' ) {
 	global $bp;
 
 	if ( empty( $group_id ) )
-		$group_id = $bp->groups->current_group->id;
+		$group_id = bp_get_current_group_id();
 
 	if ( empty( $group_name ) )
-		$group_name = $bp->groups->current_group->name;
+		$group_name = bp_get_current_group_name();
 
 	if ( empty( $group_desc ) )
 		$group_desc = $bp->groups->current_group->description;
@@ -30,10 +51,12 @@ function groups_new_group_forum( $group_id = 0, $group_name = '', $group_desc =
  * @subpackage Groups
  *
  * @param int $group_id Group id, passed from groups_details_updated
+ *
+ * @since 1.1
  */
 function groups_update_group_forum( $group_id ) {
 
-	$group = new BP_Groups_Group( $group_id );
+	$group = groups_get_group( array( 'group_id' => $group_id ) );
 
 	/**
 	 * Bail in the following three situations:
@@ -56,9 +79,19 @@ function groups_update_group_forum( $group_id ) {
 }
 add_action( 'groups_details_updated', 'groups_update_group_forum' );
 
+/**
+ * Creates a new group forum post.
+ *
+ * Uses the bundled version of bbPress packaged with BuddyPress.
+ *
+ * @param string $post_text The text for the forum post
+ * @param int $topic_id The topic ID used so we can identify where the new forum post should reside
+ * @param mixed $page The page number where the new forum post should reside. Defaults to boolean false.
+ * @return mixed The new forum post ID on success. Boolean false on failure.
+ *
+ * @since 1.0
+ */
 function groups_new_group_forum_post( $post_text, $topic_id, $page = false ) {
-	global $bp;
-
 	if ( empty( $post_text ) )
 		return false;
 
@@ -68,24 +101,24 @@ function groups_new_group_forum_post( $post_text, $topic_id, $page = false ) {
 	if ( $post_id = bp_forums_insert_post( array( 'post_text' => $post_text, 'topic_id' => $topic_id ) ) ) {
 		$topic = bp_forums_get_topic_details( $topic_id );
 
-		$activity_action = sprintf( __( '%1$s replied to the forum topic %2$s in the group %3$s', 'buddypress'), bp_core_get_userlink( $bp->loggedin_user->id ), '<a href="' . bp_get_group_permalink( $bp->groups->current_group ) . 'forum/topic/' . $topic->topic_slug .'/">' . esc_attr( $topic->topic_title ) . '</a>', '<a href="' . bp_get_group_permalink( $bp->groups->current_group ) . '">' . esc_attr( $bp->groups->current_group->name ) . '</a>' );
+		$activity_action = sprintf( __( '%1$s replied to the forum topic %2$s in the group %3$s', 'buddypress'), bp_core_get_userlink( bp_loggedin_user_id() ), '<a href="' . bp_get_group_permalink( groups_get_current_group() ) . 'forum/topic/' . $topic->topic_slug .'/">' . esc_attr( $topic->topic_title ) . '</a>', '<a href="' . bp_get_group_permalink( groups_get_current_group() ) . '">' . esc_attr( bp_get_current_group_name() ) . '</a>' );
 		$activity_content = bp_create_excerpt( $post_text );
-		$primary_link = bp_get_group_permalink( $bp->groups->current_group ) . 'forum/topic/' . $topic->topic_slug . '/';
+		$primary_link = bp_get_group_permalink( groups_get_current_group() ) . 'forum/topic/' . $topic->topic_slug . '/';
 
 		if ( $page )
 			$primary_link .= "?topic_page=" . $page;
 
 		// Record this in activity streams
 		groups_record_activity( array(
-			'action'            => apply_filters_ref_array( 'groups_activity_new_forum_post_action',       array( $activity_action,  $post_id, $post_text, &$topic ) ),
-			'content'           => apply_filters_ref_array( 'groups_activity_new_forum_post_content',      array( $activity_content, $post_id, $post_text, &$topic ) ),
+			'action'            => apply_filters_ref_array( 'groups_activity_new_forum_post_action',  array( $activity_action,  $post_id, $post_text, &$topic ) ),
+			'content'           => apply_filters_ref_array( 'groups_activity_new_forum_post_content', array( $activity_content, $post_id, $post_text, &$topic ) ),
 			'primary_link'      => apply_filters( 'groups_activity_new_forum_post_primary_link', "{$primary_link}#post-{$post_id}" ),
 			'type'              => 'new_forum_post',
-			'item_id'           => $bp->groups->current_group->id,
+			'item_id'           => bp_get_current_group_id(),
 			'secondary_item_id' => $post_id
 		) );
 
-		do_action( 'groups_new_forum_topic_post', $bp->groups->current_group->id, $post_id );
+		do_action( 'groups_new_forum_topic_post', bp_get_current_group_id(), $post_id );
 
 		return $post_id;
 	}
@@ -93,9 +126,20 @@ function groups_new_group_forum_post( $post_text, $topic_id, $page = false ) {
 	return false;
 }
 
+/**
+ * Creates a new group forum topic.
+ *
+ * Uses the bundled version of bbPress packaged with BuddyPress.
+ *
+ * @param string $topic_title The title for the forum topic
+ * @param string $topic_text The text for the forum topic
+ * @param string $topic_tags A comma-delimited string of topic tags
+ * @param int $forum_id The forum ID this forum topic resides in
+ * @return mixed The new topic object on success. Boolean false on failure.
+ *
+ * @since 1.0
+ */
 function groups_new_group_forum_topic( $topic_title, $topic_text, $topic_tags, $forum_id ) {
-	global $bp;
-
 	if ( empty( $topic_title ) || empty( $topic_text ) )
 		return false;
 
@@ -107,20 +151,20 @@ function groups_new_group_forum_topic( $topic_title, $topic_text, $topic_tags, $
 	if ( $topic_id = bp_forums_new_topic( array( 'topic_title' => $topic_title, 'topic_text' => $topic_text, 'topic_tags' => $topic_tags, 'forum_id' => $forum_id ) ) ) {
 		$topic = bp_forums_get_topic_details( $topic_id );
 
-		$activity_action = sprintf( __( '%1$s started the forum topic %2$s in the group %3$s', 'buddypress'), bp_core_get_userlink( $bp->loggedin_user->id ), '<a href="' . bp_get_group_permalink( $bp->groups->current_group ) . 'forum/topic/' . $topic->topic_slug .'/">' . esc_attr( $topic->topic_title ) . '</a>', '<a href="' . bp_get_group_permalink( $bp->groups->current_group ) . '">' . esc_attr( $bp->groups->current_group->name ) . '</a>' );
+		$activity_action = sprintf( __( '%1$s started the forum topic %2$s in the group %3$s', 'buddypress'), bp_core_get_userlink( bp_loggedin_user_id() ), '<a href="' . bp_get_group_permalink( groups_get_current_group() ) . 'forum/topic/' . $topic->topic_slug .'/">' . esc_attr( $topic->topic_title ) . '</a>', '<a href="' . bp_get_group_permalink( groups_get_current_group() ) . '">' . esc_attr( bp_get_current_group_name() ) . '</a>' );
 		$activity_content = bp_create_excerpt( $topic_text );
 
 		// Record this in activity streams
 		groups_record_activity( array(
 			'action'            => apply_filters_ref_array( 'groups_activity_new_forum_topic_action',  array( $activity_action,  $topic_text, &$topic ) ),
 			'content'           => apply_filters_ref_array( 'groups_activity_new_forum_topic_content', array( $activity_content, $topic_text, &$topic ) ),
-			'primary_link'      => apply_filters( 'groups_activity_new_forum_topic_primary_link', bp_get_group_permalink( $bp->groups->current_group ) . 'forum/topic/' . $topic->topic_slug . '/' ),
+			'primary_link'      => apply_filters( 'groups_activity_new_forum_topic_primary_link', bp_get_group_permalink( groups_get_current_group() ) . 'forum/topic/' . $topic->topic_slug . '/' ),
 			'type'              => 'new_forum_topic',
-			'item_id'           => $bp->groups->current_group->id,
+			'item_id'           => bp_get_current_group_id(),
 			'secondary_item_id' => $topic->topic_id
 		) );
 
-	  do_action_ref_array( 'groups_new_forum_topic', array( $bp->groups->current_group->id, &$topic ) );
+		do_action_ref_array( 'groups_new_forum_topic', array( bp_get_current_group_id(), &$topic ) );
 
 		return $topic;
 	}
@@ -128,6 +172,19 @@ function groups_new_group_forum_topic( $topic_title, $topic_text, $topic_tags, $
 	return false;
 }
 
+/**
+ * Updates an existing group forum topic.
+ *
+ * Uses the bundled version of bbPress packaged with BuddyPress.
+ *
+ * @param int $topic_id The topic ID of the existing forum topic
+ * @param string $topic_title The title for the forum topic
+ * @param string $topic_text The text for the forum topic
+ * @param mixed $topic_tags A comma-delimited string of topic tags. Defaults to boolean false.
+ * @return mixed The topic object on success. Boolean false on failure.
+ *
+ * @since 1.1
+ */
 function groups_update_group_forum_topic( $topic_id, $topic_title, $topic_text, $topic_tags = false ) {
 	global $bp;
 
@@ -135,21 +192,29 @@ function groups_update_group_forum_topic( $topic_id, $topic_title, $topic_text,
 	$topic_text  = apply_filters( 'group_forum_topic_text_before_save',  $topic_text  );
 
 	if ( $topic = bp_forums_update_topic( array( 'topic_title' => $topic_title, 'topic_text' => $topic_text, 'topic_id' => $topic_id, 'topic_tags' => $topic_tags ) ) ) {
-		// Update the activity stream item
-		if ( bp_is_active( 'activity' ) )
-			bp_activity_delete_by_item_id( array( 'item_id' => $bp->groups->current_group->id, 'secondary_item_id' => $topic_id, 'component' => $bp->groups->id, 'type' => 'new_forum_topic' ) );
 
-		$activity_action = sprintf( __( '%1$s started the forum topic %2$s in the group %3$s', 'buddypress'), bp_core_get_userlink( $topic->topic_poster ), '<a href="' . bp_get_group_permalink( $bp->groups->current_group ) . 'forum/topic/' . $topic->topic_slug .'/">' . esc_attr( $topic->topic_title ) . '</a>', '<a href="' . bp_get_group_permalink( $bp->groups->current_group ) . '">' . esc_attr( $bp->groups->current_group->name ) . '</a>' );
+		// Get the corresponding activity item
+		if ( bp_is_active( 'activity' ) ) {
+			$id = bp_activity_get_activity_id( array(
+					'item_id'           => bp_get_current_group_id(),
+					'secondary_item_id' => $topic_id,
+					'component'         => $bp->groups->id,
+					'type'              => 'new_forum_topic'
+			) );
+		}
+
+		$activity_action = sprintf( __( '%1$s started the forum topic %2$s in the group %3$s', 'buddypress'), bp_core_get_userlink( $topic->topic_poster ), '<a href="' . bp_get_group_permalink( groups_get_current_group() ) . 'forum/topic/' . $topic->topic_slug .'/">' . esc_attr( $topic->topic_title ) . '</a>', '<a href="' . bp_get_group_permalink( groups_get_current_group() ) . '">' . esc_attr( bp_get_current_group_name() ) . '</a>' );
 		$activity_content = bp_create_excerpt( $topic_text );
 
 		// Record this in activity streams
 		groups_record_activity( array(
+			'id'                => $id,
 			'action'            => apply_filters_ref_array( 'groups_activity_new_forum_topic_action',  array( $activity_action,  $topic_text, &$topic ) ),
 			'content'           => apply_filters_ref_array( 'groups_activity_new_forum_topic_content', array( $activity_content, $topic_text, &$topic ) ),
-			'primary_link'      => apply_filters( 'groups_activity_new_forum_topic_primary_link', bp_get_group_permalink( $bp->groups->current_group ) . 'forum/topic/' . $topic->topic_slug . '/' ),
+			'primary_link'      => apply_filters( 'groups_activity_new_forum_topic_primary_link', bp_get_group_permalink( groups_get_current_group() ) . 'forum/topic/' . $topic->topic_slug . '/' ),
 			'type'              => 'new_forum_topic',
-			'item_id'           => (int)$bp->groups->current_group->id,
-			'user_id'           => (int)$topic->topic_poster,
+			'item_id'           => (int) bp_get_current_group_id(),
+			'user_id'           => (int) $topic->topic_poster,
 			'secondary_item_id' => $topic->topic_id,
 			'recorded_time '    => $topic->topic_time
 		) );
@@ -162,6 +227,19 @@ function groups_update_group_forum_topic( $topic_id, $topic_title, $topic_text,
 	return false;
 }
 
+/**
+ * Updates an existing group forum post.
+ *
+ * Uses the bundled version of bbPress packaged with BuddyPress.
+ *
+ * @param int $post_id The post ID of the existing forum post
+ * @param string $post_text The text for the forum post
+ * @param int $topic_id The topic ID of the existing forum topic
+ * @param mixed $page The page number where the new forum post should reside. Defaults to boolean false.
+ * @return mixed The forum post ID on success. Boolean false on failure.
+ *
+ * @since 1.1
+ */
 function groups_update_group_forum_post( $post_id, $post_text, $topic_id, $page = false ) {
 	global $bp;
 
@@ -172,26 +250,33 @@ function groups_update_group_forum_post( $post_id, $post_text, $topic_id, $page
 	if ( $post_id = bp_forums_insert_post( array( 'post_id' => $post_id, 'post_text' => $post_text, 'post_time' => $post->post_time, 'topic_id' => $topic_id, 'poster_id' => $post->poster_id ) ) ) {
 		$topic = bp_forums_get_topic_details( $topic_id );
 
-		$activity_action = sprintf( __( '%1$s replied to the forum topic %2$s in the group %3$s', 'buddypress'), bp_core_get_userlink( $post->poster_id ), '<a href="' . bp_get_group_permalink( $bp->groups->current_group ) . 'forum/topic/' . $topic->topic_slug .'">' . esc_attr( $topic->topic_title ) . '</a>', '<a href="' . bp_get_group_permalink( $bp->groups->current_group ) . '">' . esc_attr( $bp->groups->current_group->name ) . '</a>' );
+		$activity_action = sprintf( __( '%1$s replied to the forum topic %2$s in the group %3$s', 'buddypress'), bp_core_get_userlink( $post->poster_id ), '<a href="' . bp_get_group_permalink( groups_get_current_group() ) . 'forum/topic/' . $topic->topic_slug .'">' . esc_attr( $topic->topic_title ) . '</a>', '<a href="' . bp_get_group_permalink( groups_get_current_group() ) . '">' . esc_attr( bp_get_current_group_name() ) . '</a>' );
 		$activity_content = bp_create_excerpt( $post_text );
-		$primary_link = bp_get_group_permalink( $bp->groups->current_group ) . 'forum/topic/' . $topic->topic_slug . '/';
+		$primary_link = bp_get_group_permalink( groups_get_current_group() ) . 'forum/topic/' . $topic->topic_slug . '/';
 
 		if ( $page )
 			$primary_link .= "?topic_page=" . $page;
 
-		// Fetch an existing entry and update if one exists.
-		if ( bp_is_active( 'activity' ) )
-			$id = bp_activity_get_activity_id( array( 'user_id' => $post->poster_id, 'component' => $bp->groups->id, 'type' => 'new_forum_post', 'item_id' => $bp->groups->current_group->id, 'secondary_item_id' => $post_id ) );
+		// Get the corresponding activity item
+		if ( bp_is_active( 'activity' ) ) {
+			$id = bp_activity_get_activity_id( array(
+				'user_id'           => $post->poster_id,
+				'component'         => $bp->groups->id,
+				'type'              => 'new_forum_post',
+				'item_id'           => bp_get_current_group_id(),
+				'secondary_item_id' => $post_id
+			 ) );
+		}
 
 		// Update the entry in activity streams
 		groups_record_activity( array(
 			'id'                => $id,
-			'action'            => apply_filters_ref_array( 'groups_activity_new_forum_post_action',  array( $activity_action,  $post_text, &$topic, &$forum_post ) ),
-			'content'           => apply_filters_ref_array( 'groups_activity_new_forum_post_content', array( $activity_content, $post_text, &$topic, &$forum_post ) ),
+			'action'            => apply_filters_ref_array( 'groups_activity_new_forum_post_action',  array( $activity_action,  $post_text, &$topic, &$topic ) ),
+			'content'           => apply_filters_ref_array( 'groups_activity_new_forum_post_content', array( $activity_content, $post_text, &$topic, &$topic ) ),
 			'primary_link'      => apply_filters( 'groups_activity_new_forum_post_primary_link', $primary_link . "#post-" . $post_id ),
 			'type'              => 'new_forum_post',
-			'item_id'           => (int)$bp->groups->current_group->id,
-			'user_id'           => (int)$post->poster_id,
+			'item_id'           => (int) bp_get_current_group_id(),
+			'user_id'           => (int) $post->poster_id,
 			'secondary_item_id' => $post_id,
 			'recorded_time'     => $post->post_time
 		) );
@@ -205,7 +290,9 @@ function groups_update_group_forum_post( $post_id, $post_text, $topic_id, $page
 }
 
 /**
- * Handles the forum topic deletion routine
+ * Deletes a group forum topic and also any corresponding activity items.
+ *
+ * Uses the bundled version of bbPress packaged with BuddyPress.
  *
  * @package BuddyPress
  *
@@ -214,6 +301,8 @@ function groups_update_group_forum_post( $post_id, $post_text, $topic_id, $page
  * @uses bp_forums_delete_topic() to do the deletion itself
  * @param int $topic_id The id of the topic to be deleted
  * @return bool True if the delete routine went through properly
+ *
+ * @since 1.1
  */
 function groups_delete_group_forum_topic( $topic_id ) {
 	global $bp;
@@ -224,14 +313,24 @@ function groups_delete_group_forum_topic( $topic_id ) {
 	if ( bp_forums_delete_topic( array( 'topic_id' => $topic_id ) ) ) {
 		do_action( 'groups_before_delete_group_forum_topic', $topic_id );
 
-		// Delete the activity stream items
+		// Delete the corresponding activity stream items
 		if ( bp_is_active( 'activity' ) ) {
 			// The activity item for the initial topic
-			bp_activity_delete( array( 'item_id' => $bp->groups->current_group->id, 'secondary_item_id' => $topic_id, 'component' => $bp->groups->id, 'type' => 'new_forum_topic' ) );
+			bp_activity_delete( array(
+				'item_id'           => bp_get_current_group_id(),
+				'secondary_item_id' => $topic_id,
+				'component'         => $bp->groups->id,
+				'type'              => 'new_forum_topic'
+			) );
 
 			// The activity item for each post
-			foreach ( (array)$posts as $post ) {
-				bp_activity_delete( array( 'item_id' => $bp->groups->current_group->id, 'secondary_item_id' => $post->post_id, 'component' => $bp->groups->id, 'type' => 'new_forum_post' ) );
+			foreach ( (array) $posts as $post ) {
+				bp_activity_delete( array(
+					'item_id'           => bp_get_current_group_id(),
+					'secondary_item_id' => $post->post_id,
+					'component'         => $bp->groups->id,
+					'type'              => 'new_forum_post'
+				) );
 			}
 		}
 
@@ -244,7 +343,9 @@ function groups_delete_group_forum_topic( $topic_id ) {
 }
 
 /**
- * Delete a forum post
+ * Deletes a group forum post and its corresponding activity item.
+ *
+ * Uses the bundled version of bbPress packaged with BuddyPress.
  *
  * @package BuddyPress
  *
@@ -252,6 +353,8 @@ function groups_delete_group_forum_topic( $topic_id ) {
  * @param int $topic_id Optional. The topic to which the post belongs. This value isn't used in the
  *   function but is passed along to do_action() hooks.
  * @return bool True on success.
+ *
+ * @since 1.1
  */
 function groups_delete_group_forum_post( $post_id, $topic_id = false ) {
 	global $bp;
@@ -259,9 +362,14 @@ function groups_delete_group_forum_post( $post_id, $topic_id = false ) {
 	if ( bp_forums_delete_post( array( 'post_id' => $post_id ) ) ) {
 		do_action( 'groups_before_delete_group_forum_post', $post_id, $topic_id );
 
-		// Delete the activity stream item
+		// Delete the corresponding activity stream item
 		if ( bp_is_active( 'activity' ) )
-			bp_activity_delete( array( 'item_id' => $bp->groups->current_group->id, 'secondary_item_id' => $post_id, 'component' => $bp->groups->id, 'type' => 'new_forum_post' ) );
+			bp_activity_delete( array(
+				'item_id'           => bp_get_current_group_id(),
+				'secondary_item_id' => $post_id,
+				'component'         => $bp->groups->id,
+				'type'              => 'new_forum_post'
+			) );
 
 		do_action( 'groups_delete_group_forum_post', $post_id, $topic_id );
 
@@ -271,6 +379,15 @@ function groups_delete_group_forum_post( $post_id, $topic_id = false ) {
 	return false;
 }
 
+/**
+ * Get a total count of all public topics of a given type, across groups/forums
+ *
+ * @package BuddyPress
+ * @since 1.5
+ *
+ * @param string $type Either 'newest', 'popular', 'unreplied', 'tags'.  Defaults to 'newest'.
+ * @return int The topic count
+ */
 function groups_total_public_forum_topic_count( $type = 'newest' ) {
 	return apply_filters( 'groups_total_public_forum_topic_count', BP_Groups_Group::get_global_forum_topic_count( $type ) );
 }
diff --git a/wp-content/plugins/buddypress/bp-groups/bp-groups-functions.php b/wp-content/plugins/buddypress/bp-groups/bp-groups-functions.php
index 2d0b569eac9778f4b3520f92bfa6511e3b65beed..1fba041289e65352aa3a4223caadb8e018dfd68c 100644
--- a/wp-content/plugins/buddypress/bp-groups/bp-groups-functions.php
+++ b/wp-content/plugins/buddypress/bp-groups/bp-groups-functions.php
@@ -1,9 +1,15 @@
 <?php
+
 /**
+ * BuddyPress Groups Functions
+ *
  * Functions are where all the magic happens in BuddyPress. They will
  * handle the actual saving or manipulation of information. Usually they will
  * hand off to a database class for data access, then return
  * true or false on success or failure.
+ *
+ * @package BuddyPress
+ * @subpackage GroupsFunctions
  */
 
 // Exit if accessed directly
@@ -12,9 +18,9 @@ if ( !defined( 'ABSPATH' ) ) exit;
 /**
  * Checks $bp pages global and looks for directory page
  *
- * @since 1.5
+ * @since BuddyPress (1.5)
  *
- * @global object $bp Global BuddyPress settings object
+ * @global BuddyPress $bp The one true BuddyPress instance
  * @return bool True if set, False if empty
  */
 function bp_groups_has_directory() {
@@ -23,6 +29,16 @@ function bp_groups_has_directory() {
 	return (bool) !empty( $bp->pages->groups->id );
 }
 
+/**
+ * Pulls up the database object corresponding to a group
+ *
+ * When calling up a group object, you should always use this function instead
+ * of instantiating BP_Groups_Group directly, so that you will inherit cache
+ * support and pass through the groups_get_group filter.
+ *
+ * @param $args The load_users parameter is deprecated and does nothing.
+ * @return obj $group The group object
+ */
 function groups_get_group( $args = '' ) {
 	$defaults = array(
 		'group_id'   => false,
@@ -32,13 +48,19 @@ function groups_get_group( $args = '' ) {
 	$args = wp_parse_args( $args, $defaults );
 	extract( $args, EXTR_SKIP );
 
-	return apply_filters( 'groups_get_group', new BP_Groups_Group( $group_id, true, $load_users ) );
+	$cache_key = 'bp_groups_group_' . $group_id . ( $load_users ? '_load_users' : '_noload_users' );
+
+	if ( !$group = wp_cache_get( $cache_key, 'bp' ) ) {
+		$group = new BP_Groups_Group( $group_id, true, $load_users );
+		wp_cache_set( $cache_key, $group, 'bp' );
+	}
+
+	return apply_filters( 'groups_get_group', $group );
 }
 
 /*** Group Creation, Editing & Deletion *****************************************/
 
 function groups_create_group( $args = '' ) {
-	global $bp;
 
 	extract( $args );
 
@@ -54,15 +76,15 @@ function groups_create_group( $args = '' ) {
 	 *	'date_created'
 	 */
 
-	if ( isset( $group_id ) && $group_id )
-		$group = new BP_Groups_Group( $group_id );
+	if ( !empty( $group_id ) )
+		$group = groups_get_group( array( 'group_id' => $group_id ) );
 	else
 		$group = new BP_Groups_Group;
 
-	if ( isset( $creator_id ) && $creator_id )
+	if ( !empty( $creator_id ) )
 		$group->creator_id = $creator_id;
 	else
-		$group->creator_id = $bp->loggedin_user->id;
+		$group->creator_id = bp_loggedin_user_id();
 
 	if ( isset( $name ) )
 		$group->name = $name;
@@ -74,13 +96,14 @@ function groups_create_group( $args = '' ) {
 		$group->slug = $slug;
 
 	if ( isset( $status ) ) {
-		if ( groups_is_valid_status( $status ) )
+		if ( groups_is_valid_status( $status ) ) {
 			$group->status = $status;
+		}
 	}
 
 	if ( isset( $enable_forum ) )
 		$group->enable_forum = $enable_forum;
-	else if ( !$group_id && !isset( $enable_forum ) )
+	else if ( empty( $group_id ) && !isset( $enable_forum ) )
 		$group->enable_forum = 1;
 
 	if ( isset( $date_created ) )
@@ -98,26 +121,25 @@ function groups_create_group( $args = '' ) {
 		$member->user_title    = __( 'Group Admin', 'buddypress' );
 		$member->is_confirmed  = 1;
 		$member->date_modified = bp_core_current_time();
-
 		$member->save();
+
 		do_action( 'groups_create_group', $group->id, $member, $group );
 
 	} else {
 		do_action( 'groups_update_group', $group->id, $group );
 	}
 
-	do_action( 'groups_created_group', $group->id );
+	do_action( 'groups_created_group', $group->id, $group );
 
 	return $group->id;
 }
 
 function groups_edit_base_group_details( $group_id, $group_name, $group_desc, $notify_members ) {
-	global $bp;
 
 	if ( empty( $group_name ) || empty( $group_desc ) )
 		return false;
 
-	$group              = new BP_Groups_Group( $group_id );
+	$group              = groups_get_group( array( 'group_id' => $group_id ) );
 	$group->name        = $group_name;
 	$group->description = $group_desc;
 
@@ -134,9 +156,8 @@ function groups_edit_base_group_details( $group_id, $group_name, $group_desc, $n
 }
 
 function groups_edit_group_settings( $group_id, $enable_forum, $status, $invite_status = false ) {
-	global $bp;
 
-	$group = new BP_Groups_Group( $group_id );
+	$group = groups_get_group( array( 'group_id' => $group_id ) );
 	$group->enable_forum = $enable_forum;
 
 	/***
@@ -180,11 +201,11 @@ function groups_delete_group( $group_id ) {
 	global $bp;
 
 	// Check the user is the group admin.
-	if ( !$bp->is_item_admin )
+	if ( ! bp_is_item_admin() )
 		return false;
 
 	// Get the group object
-	$group = new BP_Groups_Group( $group_id );
+	$group = groups_get_group( array( 'group_id' => $group_id ) );
 	if ( !$group->delete() )
 		return false;
 
@@ -200,12 +221,6 @@ function groups_delete_group( $group_id ) {
 	// Remove all notifications for any user belonging to this group
 	bp_core_delete_all_notifications_by_type( $group_id, $bp->groups->id );
 
-	// Remove forum if component is active and current group has one
-	if ( bp_is_active( 'forums' ) && $forum_id = groups_get_groupmeta( $group_id, 'forum_id' ) ) {
-		do_action( 'bbpress_init' );
-		bb_delete_forum( $forum_id );
-	}
-
 	do_action( 'groups_delete_group', $group_id);
 
 	return true;
@@ -214,7 +229,7 @@ function groups_delete_group( $group_id ) {
 function groups_is_valid_status( $status ) {
 	global $bp;
 
-	return in_array( $status, (array)$bp->groups->valid_status );
+	return in_array( $status, (array) $bp->groups->valid_status );
 }
 
 function groups_check_slug( $slug ) {
@@ -223,7 +238,7 @@ function groups_check_slug( $slug ) {
 	if ( 'wp' == substr( $slug, 0, 2 ) )
 		$slug = substr( $slug, 2, strlen( $slug ) - 2 );
 
-	if ( in_array( $slug, (array)$bp->groups->forbidden_names ) )
+	if ( in_array( $slug, (array) $bp->groups->forbidden_names ) )
 		$slug = $slug . '-' . rand();
 
 	if ( BP_Groups_Group::check_slug( $slug ) ) {
@@ -236,9 +251,27 @@ function groups_check_slug( $slug ) {
 	return $slug;
 }
 
+/**
+ * Get a group slug by its ID
+ *
+ * @param int $group_id The numeric ID of the group
+ * @return string The group's slug
+ */
 function groups_get_slug( $group_id ) {
-	$group = new BP_Groups_Group( $group_id );
-	return $group->slug;
+	$group = groups_get_group( array( 'group_id' => $group_id ) );
+	return !empty( $group->slug ) ? $group->slug : '';
+}
+
+/**
+ * Get a group ID by its slug
+ *
+ * @since 1.6
+ *
+ * @param string $group_slug The group's slug
+ * @return int The ID
+ */
+function groups_get_id( $group_slug ) {
+	return (int)BP_Groups_Group::group_exists( $group_slug );
 }
 
 /*** User Actions ***************************************************************/
@@ -246,8 +279,8 @@ function groups_get_slug( $group_id ) {
 function groups_leave_group( $group_id, $user_id = 0 ) {
 	global $bp;
 
-	if ( !$user_id )
-		$user_id = $bp->loggedin_user->id;
+	if ( empty( $user_id ) )
+		$user_id = bp_loggedin_user_id();
 
 	// Don't let single admins leave the group.
 	if ( count( groups_get_group_admins( $group_id ) ) < 2 ) {
@@ -287,14 +320,14 @@ function groups_leave_group( $group_id, $user_id = 0 ) {
 function groups_join_group( $group_id, $user_id = 0 ) {
 	global $bp;
 
-	if ( !$user_id )
-		$user_id = $bp->loggedin_user->id;
+	if ( empty( $user_id ) )
+		$user_id = bp_loggedin_user_id();
 
-	// Check if the user has an outstanding invite, is so delete it.
+	// Check if the user has an outstanding invite. If so, delete it.
 	if ( groups_check_user_has_invite( $user_id, $group_id ) )
 		groups_delete_invite( $user_id, $group_id );
 
-	// Check if the user has an outstanding request, is so delete it.
+	// Check if the user has an outstanding request. If so, delete it.
 	if ( groups_check_for_membership_request( $user_id, $group_id ) )
 		groups_delete_membership_request( $user_id, $group_id );
 
@@ -315,7 +348,7 @@ function groups_join_group( $group_id, $user_id = 0 ) {
 		return false;
 
 	if ( !isset( $bp->groups->current_group ) || !$bp->groups->current_group || $group_id != $bp->groups->current_group->id )
-		$group = new BP_Groups_Group( $group_id );
+		$group = groups_get_group( array( 'group_id' => $group_id ) );
 	else
 		$group = $bp->groups->current_group;
 
@@ -338,10 +371,6 @@ function groups_join_group( $group_id, $user_id = 0 ) {
 
 /*** General Group Functions ****************************************************/
 
-function groups_check_group_exists( $group_id ) {
-	return BP_Groups_Group::group_exists( $group_id );
-}
-
 function groups_get_group_admins( $group_id ) {
 	return BP_Groups_Member::get_group_administrator_ids( $group_id );
 }
@@ -361,7 +390,6 @@ function groups_get_total_member_count( $group_id ) {
 /*** Group Fetching, Filtering & Searching  *************************************/
 
 function groups_get_groups( $args = '' ) {
-	global $bp;
 
 	$defaults = array(
 		'type'            => 'active', // active, newest, alphabetical, random, popular, most-forum-topics or most-forum-posts
@@ -370,7 +398,6 @@ function groups_get_groups( $args = '' ) {
 		'exclude'         => false,    // Do not include these specific groups (group_ids)
 		'search_terms'    => false,    // Limit to groups that match these search terms
 		'show_hidden'     => false,    // Show hidden groups to non-admins
-
 		'per_page'        => 20,       // The number of results to return per page
 		'page'            => 1,        // The page to return if limiting per page
 		'populate_extras' => true,     // Fetch meta such as is_banned and is_member
@@ -394,19 +421,17 @@ function groups_get_total_group_count() {
 }
 
 function groups_get_user_groups( $user_id = 0, $pag_num = 0, $pag_page = 0 ) {
-	global $bp;
 
-	if ( !$user_id )
-		$user_id = $bp->displayed_user->id;
+	if ( empty( $user_id ) )
+		$user_id = bp_displayed_user_id();
 
 	return BP_Groups_Member::get_group_ids( $user_id, $pag_num, $pag_page );
 }
 
 function groups_total_groups_for_user( $user_id = 0 ) {
-	global $bp;
 
-	if ( !$user_id )
-		$user_id = ( $bp->displayed_user->id ) ? $bp->displayed_user->id : $bp->loggedin_user->id;
+	if ( empty( $user_id ) )
+		$user_id = ( bp_displayed_user_id() ) ? bp_displayed_user_id() : bp_loggedin_user_id();
 
 	if ( !$count = wp_cache_get( 'bp_total_groups_for_user_' . $user_id, 'bp' ) ) {
 		$count = BP_Groups_Member::total_group_count( $user_id );
@@ -420,7 +445,7 @@ function groups_total_groups_for_user( $user_id = 0 ) {
  * Returns the group object for the group currently being viewed
  *
  * @package BuddyPress
- * @since 1.5
+ * @since BuddyPress (1.5)
  *
  * @return obj The current group object
  */
@@ -490,7 +515,7 @@ function groups_post_update( $args = '' ) {
 
 	$defaults = array(
 		'content'  => false,
-		'user_id'  => $bp->loggedin_user->id,
+		'user_id'  => bp_loggedin_user_id(),
 		'group_id' => 0
 	);
 
@@ -503,10 +528,10 @@ function groups_post_update( $args = '' ) {
 	if ( empty( $content ) || !strlen( trim( $content ) ) || empty( $user_id ) || empty( $group_id ) )
 		return false;
 
-	$bp->groups->current_group = new BP_Groups_Group( $group_id );
+	$bp->groups->current_group = groups_get_group( array( 'group_id' => $group_id ) );
 
 	// Be sure the user is a member of the group before posting.
-	if ( !is_super_admin() && !groups_is_user_member( $user_id, $group_id ) )
+	if ( !bp_current_user_can( 'bp_moderate' ) && !groups_is_user_member( $user_id, $group_id ) )
 		return false;
 
 	// Record this in activity streams
@@ -530,21 +555,19 @@ function groups_post_update( $args = '' ) {
 /*** Group Invitations *********************************************************/
 
 function groups_get_invites_for_user( $user_id = 0, $limit = false, $page = false, $exclude = false ) {
-	global $bp;
 
-	if ( !$user_id )
-		$user_id = $bp->loggedin_user->id;
+	if ( empty( $user_id ) )
+		$user_id = bp_loggedin_user_id();
 
 	return BP_Groups_Member::get_invites( $user_id, $limit, $page, $exclude );
 }
 
 function groups_invite_user( $args = '' ) {
-	global $bp;
 
 	$defaults = array(
 		'user_id'       => false,
 		'group_id'      => false,
-		'inviter_id'    => $bp->loggedin_user->id,
+		'inviter_id'    => bp_loggedin_user_id(),
 		'date_modified' => bp_core_current_time(),
 		'is_confirmed'  => 0
 	);
@@ -552,7 +575,7 @@ function groups_invite_user( $args = '' ) {
 	$args = wp_parse_args( $args, $defaults );
 	extract( $args, EXTR_SKIP );
 
-	if ( !$user_id || !$group_id )
+	if ( empty( $user_id ) || empty( $group_id ) )
 		return false;
 
 	if ( !groups_is_user_member( $user_id, $group_id ) && !groups_check_user_has_invite( $user_id, $group_id, 'all' ) ) {
@@ -573,7 +596,6 @@ function groups_invite_user( $args = '' ) {
 }
 
 function groups_uninvite_user( $user_id, $group_id ) {
-	global $bp;
 
 	if ( !BP_Groups_Member::delete( $user_id, $group_id ) )
 		return false;
@@ -583,11 +605,29 @@ function groups_uninvite_user( $user_id, $group_id ) {
 	return true;
 }
 
+/**
+ * Process the acceptance of a group invitation.
+ *
+ * Returns true if a user is already a member of the group.
+ *
+ * @param int $user_id
+ * @param int $group_id
+ * @return bool True when the user is a member of the group, otherwise false
+ */
 function groups_accept_invite( $user_id, $group_id ) {
 	global $bp;
 
-	if ( groups_is_user_member( $user_id, $group_id ) )
-		return false;
+	// If the user is already a member (because BP at one point allowed two invitations to
+	// slip through), delete all existing invitations/requests and return true
+	if ( groups_is_user_member( $user_id, $group_id ) ) {
+		if ( groups_check_user_has_invite( $user_id, $group_id ) )
+			groups_delete_invite( $user_id, $group_id );
+
+		if ( groups_check_for_membership_request( $user_id, $group_id ) )
+			groups_delete_membership_request( $user_id, $group_id );
+
+		return true;
+	}
 
 	$member = new BP_Groups_Member( $user_id, $group_id );
 	$member->accept_invite();
@@ -630,14 +670,13 @@ function groups_delete_invite( $user_id, $group_id ) {
 }
 
 function groups_send_invites( $user_id, $group_id ) {
-	global $bp;
 
-	if ( !$user_id )
-		$user_id = $bp->loggedin_user->id;
+	if ( empty( $user_id ) )
+		$user_id = bp_loggedin_user_id();
 
 	// Send friend invites.
 	$invited_users = groups_get_invites_for_group( $user_id, $group_id );
-	$group = new BP_Groups_Group( $group_id );
+	$group = groups_get_group( array( 'group_id' => $group_id ) );
 
 	for ( $i = 0, $count = count( $invited_users ); $i < $count; ++$i ) {
 		$member = new BP_Groups_Member( $invited_users[$i], $group_id );
@@ -681,20 +720,25 @@ function groups_delete_all_group_invites( $group_id ) {
 /*** Group Promotion & Banning *************************************************/
 
 function groups_promote_member( $user_id, $group_id, $status ) {
-	global $bp;
 
-	if ( !$bp->is_item_admin )
+	if ( ! bp_is_item_admin() )
 		return false;
 
 	$member = new BP_Groups_Member( $user_id, $group_id );
 
+	// Don't use this action. It's deprecated as of BuddyPress 1.6.
 	do_action( 'groups_premote_member', $group_id, $user_id, $status );
 
+	// Use this action instead.
+	do_action( 'groups_promote_member', $group_id, $user_id, $status );
+
 	return $member->promote( $status );
 }
 
 function groups_demote_member( $user_id, $group_id ) {
-	global $bp;
+
+	if ( ! bp_is_item_admin() )
+		return false;
 
 	$member = new BP_Groups_Member( $user_id, $group_id );
 
@@ -704,9 +748,8 @@ function groups_demote_member( $user_id, $group_id ) {
 }
 
 function groups_ban_member( $user_id, $group_id ) {
-	global $bp;
 
-	if ( !$bp->is_item_admin )
+	if ( ! bp_is_item_admin() )
 		return false;
 
 	$member = new BP_Groups_Member( $user_id, $group_id );
@@ -717,9 +760,8 @@ function groups_ban_member( $user_id, $group_id ) {
 }
 
 function groups_unban_member( $user_id, $group_id ) {
-	global $bp;
 
-	if ( !$bp->is_item_admin )
+	if ( ! bp_is_item_admin() )
 		return false;
 
 	$member = new BP_Groups_Member( $user_id, $group_id );
@@ -732,9 +774,8 @@ function groups_unban_member( $user_id, $group_id ) {
 /*** Group Removal *******************************************************/
 
 function groups_remove_member( $user_id, $group_id ) {
-	global $bp;
 
-	if ( !$bp->is_item_admin )
+	if ( ! bp_is_item_admin() )
 		return false;
 
 	$member = new BP_Groups_Member( $user_id, $group_id );
@@ -747,7 +788,6 @@ function groups_remove_member( $user_id, $group_id ) {
 /*** Group Membership ****************************************************/
 
 function groups_send_membership_request( $requesting_user_id, $group_id ) {
-	global $bp;
 
 	// Prevent duplicate requests
 	if ( groups_check_for_membership_request( $requesting_user_id, $group_id ) )
@@ -783,9 +823,8 @@ function groups_send_membership_request( $requesting_user_id, $group_id ) {
 }
 
 function groups_accept_membership_request( $membership_id, $user_id = 0, $group_id = 0 ) {
-	global $bp;
 
-	if ( $user_id && $group_id )
+	if ( !empty( $user_id ) && !empty( $group_id ) )
 		$membership = new BP_Groups_Member( $user_id, $group_id );
 	else
 		$membership = new BP_Groups_Member( false, false, $membership_id );
@@ -803,7 +842,7 @@ function groups_accept_membership_request( $membership_id, $user_id = 0, $group_
 	groups_update_groupmeta( $membership->group_id, 'total_member_count', (int) groups_get_groupmeta( $membership->group_id, 'total_member_count') + 1 );
 
 	// Record this in activity streams
-	$group = new BP_Groups_Group( $membership->group_id );
+	$group = groups_get_group( array( 'group_id' => $membership->group_id ) );
 
 	groups_record_activity( array(
 		'action'  => apply_filters_ref_array( 'groups_activity_membership_accepted_action', array( sprintf( __( '%1$s joined the group %2$s', 'buddypress'), bp_core_get_userlink( $membership->user_id ), '<a href="' . bp_get_group_permalink( $group ) . '">' . esc_attr( $group->name ) . '</a>' ), $membership->user_id, &$group ) ),
@@ -833,7 +872,7 @@ function groups_reject_membership_request( $membership_id, $user_id = 0, $group_
 }
 
 function groups_delete_membership_request( $membership_id, $user_id = 0, $group_id = 0 ) {
-	if ( $user_id && $group_id )
+	if ( !empty( $user_id ) && !empty( $group_id ) )
 		$membership = new BP_Groups_Member( $user_id, $group_id );
 	else
 		$membership = new BP_Groups_Member( false, false, $membership_id );
@@ -878,11 +917,11 @@ function groups_delete_groupmeta( $group_id, $meta_key = false, $meta_value = fa
 	$meta_value = trim( $meta_value );
 
 	if ( !$meta_key )
-		$wpdb->query( $wpdb->prepare( "DELETE FROM " . $bp->groups->table_name_groupmeta . " WHERE group_id = %d", $group_id ) );
+		$wpdb->query( $wpdb->prepare( "DELETE FROM {$bp->groups->table_name_groupmeta} WHERE group_id = %d", $group_id ) );
 	else if ( $meta_value )
-		$wpdb->query( $wpdb->prepare( "DELETE FROM " . $bp->groups->table_name_groupmeta . " WHERE group_id = %d AND meta_key = %s AND meta_value = %s", $group_id, $meta_key, $meta_value ) );
+		$wpdb->query( $wpdb->prepare( "DELETE FROM {$bp->groups->table_name_groupmeta} WHERE group_id = %d AND meta_key = %s AND meta_value = %s", $group_id, $meta_key, $meta_value ) );
 	else
-		$wpdb->query( $wpdb->prepare( "DELETE FROM " . $bp->groups->table_name_groupmeta . " WHERE group_id = %d AND meta_key = %s", $group_id, $meta_key ) );
+		$wpdb->query( $wpdb->prepare( "DELETE FROM {$bp->groups->table_name_groupmeta} WHERE group_id = %d AND meta_key = %s", $group_id, $meta_key ) );
 
 	// Delete the cached object
 	wp_cache_delete( 'bp_groups_groupmeta_' . $group_id . '_' . $meta_key, 'bp' );
@@ -901,12 +940,13 @@ function groups_get_groupmeta( $group_id, $meta_key = '') {
 	if ( !empty($meta_key) ) {
 		$meta_key = preg_replace( '|[^a-z0-9_]|i', '', $meta_key );
 
-		if ( !$metas = wp_cache_get( 'bp_groups_groupmeta_' . $group_id . '_' . $meta_key, 'bp' ) ) {
-			$metas = $wpdb->get_col( $wpdb->prepare("SELECT meta_value FROM " . $bp->groups->table_name_groupmeta . " WHERE group_id = %d AND meta_key = %s", $group_id, $meta_key) );
+		$metas = wp_cache_get( 'bp_groups_groupmeta_' . $group_id . '_' . $meta_key, 'bp' );
+		if ( false === $metas ) {
+			$metas = $wpdb->get_col( $wpdb->prepare("SELECT meta_value FROM {$bp->groups->table_name_groupmeta} WHERE group_id = %d AND meta_key = %s", $group_id, $meta_key) );
 			wp_cache_set( 'bp_groups_groupmeta_' . $group_id . '_' . $meta_key, $metas, 'bp' );
 		}
 	} else {
-		$metas = $wpdb->get_col( $wpdb->prepare("SELECT meta_value FROM " . $bp->groups->table_name_groupmeta . " WHERE group_id = %d", $group_id) );
+		$metas = $wpdb->get_col( $wpdb->prepare("SELECT meta_value FROM {$bp->groups->table_name_groupmeta} WHERE group_id = %d", $group_id) );
 	}
 
 	if ( empty( $metas ) ) {
@@ -916,7 +956,7 @@ function groups_get_groupmeta( $group_id, $meta_key = '') {
 			return '';
 	}
 
-	$metas = array_map( 'maybe_unserialize', (array)$metas );
+	$metas = array_map( 'maybe_unserialize', (array) $metas );
 
 	if ( 1 == count( $metas ) )
 		return $metas[0];
@@ -937,15 +977,12 @@ function groups_update_groupmeta( $group_id, $meta_key, $meta_value ) {
 
 	$meta_value = maybe_serialize( $meta_value );
 
-	if ( empty( $meta_value ) )
-		return groups_delete_groupmeta( $group_id, $meta_key );
-
-	$cur = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM " . $bp->groups->table_name_groupmeta . " WHERE group_id = %d AND meta_key = %s", $group_id, $meta_key ) );
+	$cur = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM {$bp->groups->table_name_groupmeta} WHERE group_id = %d AND meta_key = %s", $group_id, $meta_key ) );
 
 	if ( !$cur )
-		$wpdb->query( $wpdb->prepare( "INSERT INTO " . $bp->groups->table_name_groupmeta . " ( group_id, meta_key, meta_value ) VALUES ( %d, %s, %s )", $group_id, $meta_key, $meta_value ) );
+		$wpdb->query( $wpdb->prepare( "INSERT INTO {$bp->groups->table_name_groupmeta} ( group_id, meta_key, meta_value ) VALUES ( %d, %s, %s )", $group_id, $meta_key, $meta_value ) );
 	else if ( $cur->meta_value != $meta_value )
-		$wpdb->query( $wpdb->prepare( "UPDATE " . $bp->groups->table_name_groupmeta . " SET meta_value = %s WHERE group_id = %d AND meta_key = %s", $meta_value, $group_id, $meta_key ) );
+		$wpdb->query( $wpdb->prepare( "UPDATE {$bp->groups->table_name_groupmeta} SET meta_value = %s WHERE group_id = %d AND meta_key = %s", $meta_value, $group_id, $meta_key ) );
 	else
 		return false;
 
@@ -958,12 +995,16 @@ function groups_update_groupmeta( $group_id, $meta_key, $meta_value ) {
 /*** Group Cleanup Functions ****************************************************/
 
 function groups_remove_data_for_user( $user_id ) {
+	global $bp;
+
 	BP_Groups_Member::delete_all_for_user( $user_id );
 
+	bp_core_delete_notifications_from_user( $user_id, $bp->groups->id, 'new_membership_request' );
+
 	do_action( 'groups_remove_data_for_user', $user_id );
 }
 add_action( 'wpmu_delete_user',  'groups_remove_data_for_user' );
 add_action( 'delete_user',       'groups_remove_data_for_user' );
 add_action( 'bp_make_spam_user', 'groups_remove_data_for_user' );
 
-?>
\ No newline at end of file
+?>
diff --git a/wp-content/plugins/buddypress/bp-groups/bp-groups-loader.php b/wp-content/plugins/buddypress/bp-groups/bp-groups-loader.php
index 80243d040330680513927911b118befbff367237..6b70eb2379caa7d99f3d53a6f3e8b719836437b5 100644
--- a/wp-content/plugins/buddypress/bp-groups/bp-groups-loader.php
+++ b/wp-content/plugins/buddypress/bp-groups/bp-groups-loader.php
@@ -1,4 +1,5 @@
 <?php
+
 /**
  * BuddyPress Groups Loader
  *
@@ -7,7 +8,7 @@
  * Comes preconfigured with an activity stream, discussion forums, and settings.
  *
  * @package BuddyPress
- * @subpackage Groups Core
+ * @subpackage GroupsLoader
  */
 
 // Exit if accessed directly
@@ -15,10 +16,66 @@ if ( !defined( 'ABSPATH' ) ) exit;
 
 class BP_Groups_Component extends BP_Component {
 
+	/**
+	 * Auto join group when non group member performs group activity
+	 *
+	 * @since BuddyPress (1.5)
+	 * @var bool
+	 */
+	public $auto_join;
+
+	/**
+	 * The group being currently accessed
+	 *
+	 * @since BuddyPress (1.5)
+	 * @var BP_Groups_Group
+	 */
+	public $current_group;
+
+	/**
+	 * Default group extension
+	 *
+	 * @since BuddyPress (1.6)
+	 * @todo Is this used anywhere? Is this a duplicate of $default_extension?
+	 */
+	var $default_component;
+
+	/**
+	 * Default group extension
+	 *
+	 * @since BuddyPress (1.6)
+	 * @var string
+	 */
+	public $default_extension;
+
+	/**
+	 * Illegal group names/slugs
+	 *
+	 * @since BuddyPress (1.5)
+	 * @var array
+	 */
+	public $forbidden_names;
+
+	/**
+	 * Group creation/edit steps (e.g. Details, Settings, Avatar, Invites)
+	 *
+	 * @since BuddyPress (1.5)
+	 * @var array
+	 */
+	public $group_creation_steps;
+
+	/**
+	 * Types of group statuses (Public, Private, Hidden)
+	 *
+	 * @since BuddyPress (1.5)
+	 * @var array
+	 */
+	public $valid_status;
+
 	/**
 	 * Start the groups component creation process
 	 *
-	 * @since 1.5
+	 * @since BuddyPress (1.5)
 	 */
 	function __construct() {
 		parent::start(
@@ -56,8 +113,8 @@ class BP_Groups_Component extends BP_Component {
 	 * The BP_GROUPS_SLUG constant is deprecated, and only used here for
 	 * backwards compatibility.
 	 *
-	 * @since 1.5
-	 * @global obj $bp
+	 * @since BuddyPress (1.5)
+	 * @global BuddyPress $bp The one true BuddyPress instance
 	 */
 	function setup_globals() {
 		global $bp;
@@ -76,7 +133,6 @@ class BP_Groups_Component extends BP_Component {
 		// All globals for messaging component.
 		// Note that global_tables is included in this array.
 		$globals = array(
-			'path'                  => BP_PLUGIN_DIR,
 			'slug'                  => BP_GROUPS_SLUG,
 			'root_slug'             => isset( $bp->pages->groups->slug ) ? $bp->pages->groups->slug : BP_GROUPS_SLUG,
 			'has_directory'         => true,
@@ -103,17 +159,17 @@ class BP_Groups_Component extends BP_Component {
 			array_shift( $bp->action_variables );
 
 			// Using "item" not "group" for generic support in other components.
-			if ( is_super_admin() )
+			if ( bp_current_user_can( 'bp_moderate' ) )
 				bp_update_is_item_admin( true, 'groups' );
 			else
-				bp_update_is_item_admin( groups_is_user_admin( $bp->loggedin_user->id, $this->current_group->id ), 'groups' );
+				bp_update_is_item_admin( groups_is_user_admin( bp_loggedin_user_id(), $this->current_group->id ), 'groups' );
 
 			// If the user is not an admin, check if they are a moderator
 			if ( !bp_is_item_admin() )
-				bp_update_is_item_mod  ( groups_is_user_mod  ( $bp->loggedin_user->id, $this->current_group->id ), 'groups' );
+				bp_update_is_item_mod  ( groups_is_user_mod  ( bp_loggedin_user_id(), $this->current_group->id ), 'groups' );
 
 			// Is the logged in user a member of the group?
-			if ( ( is_user_logged_in() && groups_is_user_member( $bp->loggedin_user->id, $this->current_group->id ) ) )
+			if ( ( is_user_logged_in() && groups_is_user_member( bp_loggedin_user_id(), $this->current_group->id ) ) )
 				$this->current_group->is_user_member = true;
 			else
 				$this->current_group->is_user_member = false;
@@ -126,7 +182,7 @@ class BP_Groups_Component extends BP_Component {
 
 			// If this is a private or hidden group, does the user have access?
 			if ( 'private' == $this->current_group->status || 'hidden' == $this->current_group->status ) {
-				if ( $this->current_group->is_user_member && is_user_logged_in() || is_super_admin() )
+				if ( $this->current_group->is_user_member && is_user_logged_in() || bp_current_user_can( 'bp_moderate' ) )
 					$this->current_group->user_has_access = true;
 				else
 					$this->current_group->user_has_access = false;
@@ -158,24 +214,77 @@ class BP_Groups_Component extends BP_Component {
 		) );
 
 		// If the user was attempting to access a group, but no group by that name was found, 404
-		if ( bp_is_groups_component() && empty( $this->current_group ) && !empty( $bp->current_action ) && !in_array( $bp->current_action, $this->forbidden_names ) ) {
+		if ( bp_is_groups_component() && empty( $this->current_group ) && bp_current_action() && !in_array( bp_current_action(), $this->forbidden_names ) ) {
 			bp_do_404();
 			return;
 		}
 
+		if ( bp_is_groups_component() && !empty( $this->current_group ) ) {
+
+			$this->default_extension = apply_filters( 'bp_groups_default_extension', defined( 'BP_GROUPS_DEFAULT_EXTENSION' ) ? BP_GROUPS_DEFAULT_EXTENSION : 'home' );
+
+			if ( !bp_current_action() ) {
+				$bp->current_action = $this->default_extension;
+			}
+
+			// Prepare for a redirect to the canonical URL
+			$bp->canonical_stack['base_url'] = bp_get_group_permalink( $this->current_group );
+
+			if ( bp_current_action() ) {
+				$bp->canonical_stack['action'] = bp_current_action();
+			}
+
+			if ( !empty( $bp->action_variables ) ) {
+				$bp->canonical_stack['action_variables'] = bp_action_variables();
+			}
+
+			// When viewing the default extension, the canonical URL should not have
+			// that extension's slug, unless more has been tacked onto the URL via
+			// action variables
+			if ( bp_is_current_action( $this->default_extension ) && empty( $bp->action_variables ) )  {
+				unset( $bp->canonical_stack['action'] );
+			}
+
+		}
+
 		// Group access control
-		if ( bp_is_groups_component() && !empty( $this->current_group ) && !empty( $bp->current_action ) && !$this->current_group->user_has_access ) {
-			if ( is_user_logged_in() ) {
-				// Off-limits to this user. Throw an error and redirect to the
-				// group's home page
+		if ( bp_is_groups_component() && !empty( $this->current_group ) ) {
+			if ( !$this->current_group->user_has_access ) {
+
+				// Hidden groups should return a 404 for non-members.
+				// Unset the current group so that you're not redirected
+				// to the default group tab
+				if ( 'hidden' == $this->current_group->status ) {
+					$this->current_group = 0;
+					$bp->is_single_item  = false;
+					bp_do_404();
+					return;
+
+				// Skip the no_access check on home and membership request pages
+				} elseif ( !bp_is_current_action( 'home' ) && !bp_is_current_action( 'request-membership' ) ) {
+
+					// Off-limits to this user. Throw an error and redirect to the group's home page
+					if ( is_user_logged_in() ) {
+						bp_core_no_access( array(
+							'message'  => __( 'You do not have access to this group.', 'buddypress' ),
+							'root'     => bp_get_group_permalink( $bp->groups->current_group ),
+							'redirect' => false
+						) );
+
+					// User does not have access, and does not get a message
+					} else {
+						bp_core_no_access();
+					}
+				}
+			}
+
+			// Protect the admin tab from non-admins
+			if ( bp_is_current_action( 'admin' ) && !bp_is_item_admin() ) {
 				bp_core_no_access( array(
-					'message'  => __( 'You do not have access to this group.', 'buddypress' ),
+					'message'  => __( 'You are not an admin of this group.', 'buddypress' ),
 					'root'     => bp_get_group_permalink( $bp->groups->current_group ),
 					'redirect' => false
 				) );
-			} else {
-				// Allow the user to log in
-				bp_core_no_access();
 			}
 		}
 
@@ -221,10 +330,12 @@ class BP_Groups_Component extends BP_Component {
 	/**
 	 * Setup BuddyBar navigation
 	 *
-	 * @global obj $bp
+	 * @global BuddyPress $bp The one true BuddyPress instance
 	 */
 	function setup_nav() {
-		global $bp;
+
+		// Define local variables
+		$sub_nav = array();
 
 		// Add 'Groups' to the main navigation
 		$main_nav = array(
@@ -236,7 +347,7 @@ class BP_Groups_Component extends BP_Component {
 			'item_css_id'         => $this->id
 		);
 
-		$groups_link = trailingslashit( $bp->loggedin_user->domain . $this->slug );
+		$groups_link = trailingslashit( bp_loggedin_user_domain() . $this->slug );
 
 		// Add the My Groups nav item
 		$sub_nav[] = array(
@@ -264,7 +375,8 @@ class BP_Groups_Component extends BP_Component {
 
 		if ( bp_is_groups_component() && bp_is_single_item() ) {
 
-			unset( $main_nav ); unset( $sub_nav );
+			// Reset sub nav
+			$sub_nav = array();
 
 			// Add 'Groups' to the main navigation
 			$main_nav = array(
@@ -272,11 +384,11 @@ class BP_Groups_Component extends BP_Component {
 				'slug'                => $this->current_group->slug,
 				'position'            => -1, // Do not show in BuddyBar
 				'screen_function'     => 'groups_screen_group_home',
-				'default_subnav_slug' => 'home',
+				'default_subnav_slug' => $this->default_extension,
 				'item_css_id'         => $this->id
 			);
 
-			$group_link = trailingslashit( bp_get_root_domain() . '/' . $this->root_slug . '/' . $this->current_group->slug );
+			$group_link = bp_get_group_permalink( $this->current_group );
 
 			// Add the "Home" subnav item, as this will always be present
 			$sub_nav[] = array(
@@ -289,25 +401,11 @@ class BP_Groups_Component extends BP_Component {
 				'item_css_id'     => 'home'
 			);
 
-			// If the user is a group mod or more, then show the group admin nav item
-			if ( bp_is_item_admin() || bp_is_item_mod() ) {
-				$sub_nav[] = array(
-					'name'            => __( 'Admin', 'buddypress' ),
-					'slug'            => 'admin',
-					'parent_url'      => $group_link,
-					'parent_slug'     => $this->current_group->slug,
-					'screen_function' => 'groups_screen_group_admin',
-					'position'        => 20,
-					'user_has_access' => ( $bp->is_item_admin + (int)$bp->is_item_mod ),
-					'item_css_id'     => 'admin'
-				);
-			}
-
 			// If this is a private group, and the user is not a member, show a "Request Membership" nav item.
 			if ( is_user_logged_in() &&
-				 !is_super_admin() &&
+				 !bp_current_user_can( 'bp_moderate' ) &&
 				 !$this->current_group->is_user_member &&
-				 !groups_check_for_membership_request( $bp->loggedin_user->id, $this->current_group->id ) &&
+				 !groups_check_for_membership_request( bp_loggedin_user_id(), $this->current_group->id ) &&
 				 $this->current_group->status == 'private'
 				) {
 				$sub_nav[] = array(
@@ -358,6 +456,20 @@ class BP_Groups_Component extends BP_Component {
 				);
 			}
 
+			// If the user is a group mod or more, then show the group admin nav item
+			if ( bp_is_item_admin() || bp_is_item_mod() ) {
+				$sub_nav[] = array(
+					'name'            => __( 'Admin', 'buddypress' ),
+					'slug'            => 'admin',
+					'parent_url'      => $group_link,
+					'parent_slug'     => $this->current_group->slug,
+					'screen_function' => 'groups_screen_group_admin',
+					'position'        => 1000,
+					'user_has_access' => true,
+					'item_css_id'     => 'admin'
+				);
+			}
+
 			parent::setup_nav( $main_nav, $sub_nav );
 		}
 
@@ -368,9 +480,9 @@ class BP_Groups_Component extends BP_Component {
 	}
 
 	/**
-	 * Set up the admin bar
+	 * Set up the Toolbar
 	 *
-	 * @global obj $bp
+	 * @global BuddyPress $bp The one true BuddyPress instance
 	 */
 	function setup_admin_bar() {
 		global $bp;
@@ -382,18 +494,17 @@ class BP_Groups_Component extends BP_Component {
 		if ( is_user_logged_in() ) {
 
 			// Setup the logged in user variables
-			$user_domain = $bp->loggedin_user->domain;
+			$user_domain = bp_loggedin_user_domain();
 			$groups_link = trailingslashit( $user_domain . $this->slug );
 
 			// Pending group invites
-			$count = groups_get_invites_for_user( $bp->loggedin_user->id );
+			$count   = groups_get_invites_for_user( bp_loggedin_user_id() );
+			$title   = __( 'Groups',             'buddypress' );
+			$pending = __( 'No Pending Invites', 'buddypress' );
 
-			if ( !empty( $count->total ) ) {
-				$title   = sprintf( __( 'Groups <span class="count">%s</span>',          'buddypress' ), $count->total );
-				$pending = sprintf( __( 'Pending Invites <span class="count">%s</span>', 'buddypress' ), $count->total );
-			} else {
-				$title   = __( 'Groups',             'buddypress' );
-				$pending = __( 'No Pending Invites', 'buddypress' );
+			if ( !empty( $count['total'] ) ) {
+				$title   = sprintf( __( 'Groups <span class="count">%s</span>',          'buddypress' ), $count['total'] );
+				$pending = sprintf( __( 'Pending Invites <span class="count">%s</span>', 'buddypress' ), $count['total'] );
 			}
 
 			// Add the "My Account" sub menus
@@ -427,7 +538,7 @@ class BP_Groups_Component extends BP_Component {
 	/**
 	 * Sets up the title for pages and <title>
 	 *
-	 * @global obj $bp
+	 * @global BuddyPress $bp The one true BuddyPress instance
 	 */
 	function setup_title() {
 		global $bp;
@@ -441,10 +552,11 @@ class BP_Groups_Component extends BP_Component {
 			} else if ( !bp_is_my_profile() && !bp_is_single_item() ) {
 
 				$bp->bp_options_avatar = bp_core_fetch_avatar( array(
-					'item_id' => $bp->displayed_user->id,
-					'type'    => 'thumb'
+					'item_id' => bp_displayed_user_id(),
+					'type'    => 'thumb',
+					'alt'     => sprintf( __( 'Profile picture of %s', 'buddypress' ), bp_get_displayed_user_fullname() )
 				) );
-				$bp->bp_options_title  = $bp->displayed_user->fullname;
+				$bp->bp_options_title = bp_get_displayed_user_fullname();
 
 			// We are viewing a single group, so set up the
 			// group navigation menu using the $this->current_group global.
@@ -457,15 +569,22 @@ class BP_Groups_Component extends BP_Component {
 					'avatar_dir' => 'group-avatars',
 					'alt'        => __( 'Group Avatar', 'buddypress' )
 				) );
-				if ( empty( $bp->bp_options_avatar ) )
+				if ( empty( $bp->bp_options_avatar ) ) {
 					$bp->bp_options_avatar = '<img src="' . esc_attr( $group->avatar_full ) . '" class="avatar" alt="' . esc_attr( $group->name ) . '" />';
+				}
 			}
 		}
 
 		parent::setup_title();
 	}
 }
-// Create the groups component
-$bp->groups = new BP_Groups_Component();
+
+
+function bp_setup_groups() {
+	global $bp;
+
+	$bp->groups = new BP_Groups_Component();
+}
+add_action( 'bp_setup_components', 'bp_setup_groups', 6 );
 
 ?>
diff --git a/wp-content/plugins/buddypress/bp-groups/bp-groups-notifications.php b/wp-content/plugins/buddypress/bp-groups/bp-groups-notifications.php
index f5076dd352cb943e0df97b609331cc9b8ded3b98..859bda449ba4b60d648e40f2a2833ed26486184c 100644
--- a/wp-content/plugins/buddypress/bp-groups/bp-groups-notifications.php
+++ b/wp-content/plugins/buddypress/bp-groups/bp-groups-notifications.php
@@ -1,16 +1,26 @@
 <?php
+
+/**
+ * BuddyPress Groups Notification Functions
+ *
+ * These functions handle the recording, deleting and formatting of notifications
+ * for the user and for this specific component.
+ *
+ * @package BuddyPress
+ * @subpackage GroupsActivity
+ */
+
 // Exit if accessed directly
 if ( !defined( 'ABSPATH' ) ) exit;
 
 function groups_notification_group_updated( $group_id ) {
-	global $bp;
 
-	$group    = new BP_Groups_Group( $group_id );
+	$group    = groups_get_group( array( 'group_id' => $group_id ) );
 	$sitename = wp_specialchars_decode( get_blog_option( bp_get_root_blog_id(), 'blogname' ), ENT_QUOTES );
 	$subject  = '[' . $sitename . '] ' . __( 'Group Details Updated', 'buddypress' );
 
 	$user_ids = BP_Groups_Member::get_group_member_ids( $group->id );
-	foreach ( (array)$user_ids as $user_id ) {
+	foreach ( (array) $user_ids as $user_id ) {
 		if ( 'no' == bp_get_user_meta( $user_id, 'notification_groups_group_updated', true ) ) continue;
 
 		$ud = bp_core_get_core_userdata( $user_id );
@@ -18,8 +28,9 @@ function groups_notification_group_updated( $group_id ) {
 		// Set up and send the message
 		$to = $ud->user_email;
 
-		$group_link = site_url( bp_get_groups_root_slug(). '/' . $group->slug );
-		$settings_link = bp_core_get_user_domain( $user_id ) . bp_get_settings_slug() . '/notifications/';
+		$group_link    = bp_get_group_permalink( $group );
+		$settings_slug = function_exists( 'bp_get_settings_slug' ) ? bp_get_settings_slug() : 'settings';
+		$settings_link = bp_core_get_user_domain( $user_id ) . $settings_slug . '/notifications/';
 
 		$message = sprintf( __(
 'Group details for the group "%1$s" were updated:
@@ -45,7 +56,6 @@ To view the group: %2$s
 }
 
 function groups_notification_new_membership_request( $requesting_user_id, $admin_id, $group_id, $membership_id ) {
-	global $bp;
 
 	bp_core_add_notification( $requesting_user_id, $admin_id, 'groups', 'new_membership_request', $group_id );
 
@@ -53,18 +63,17 @@ function groups_notification_new_membership_request( $requesting_user_id, $admin
 		return false;
 
 	$requesting_user_name = bp_core_get_user_displayname( $requesting_user_id );
-	$group = new BP_Groups_Group( $group_id );
-
-	$ud = bp_core_get_core_userdata($admin_id);
-	$requesting_ud = bp_core_get_core_userdata($requesting_user_id);
+	$group                = groups_get_group( array( 'group_id' => $group_id ) );
 
+	$ud             = bp_core_get_core_userdata( $admin_id );
 	$group_requests = bp_get_group_permalink( $group ) . 'admin/membership-requests';
-	$profile_link = bp_core_get_user_domain( $requesting_user_id );
-	$settings_link = bp_core_get_user_domain( $requesting_user_id ) . bp_get_settings_slug() . '/notifications/';
+	$profile_link   = bp_core_get_user_domain( $requesting_user_id );
+	$settings_slug  = function_exists( 'bp_get_settings_slug' ) ? bp_get_settings_slug() : 'settings';
+	$settings_link  = bp_core_get_user_domain( $requesting_user_id ) . $settings_slug . '/notifications/';
 
 	// Set up and send the message
 	$to       = $ud->user_email;
-	$sitename = wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES );
+	$sitename = wp_specialchars_decode( bp_get_option( 'blogname' ), ENT_QUOTES );
 	$subject  = '[' . $sitename . '] ' . sprintf( __( 'Membership request for group: %s', 'buddypress' ), $group->name );
 
 $message = sprintf( __(
@@ -93,7 +102,6 @@ To view %4$s\'s profile: %5$s
 }
 
 function groups_notification_membership_request_completed( $requesting_user_id, $group_id, $accepted = true ) {
-	global $bp;
 
 	// Post a screen notification first.
 	if ( $accepted )
@@ -104,12 +112,13 @@ function groups_notification_membership_request_completed( $requesting_user_id,
 	if ( 'no' == bp_get_user_meta( $requesting_user_id, 'notification_membership_request_completed', true ) )
 		return false;
 
-	$group = new BP_Groups_Group( $group_id );
+	$group = groups_get_group( array( 'group_id' => $group_id ) );
 
 	$ud = bp_core_get_core_userdata($requesting_user_id);
 
-	$group_link = bp_get_group_permalink( $group );
-	$settings_link = bp_core_get_user_domain( $requesting_user_id ) . bp_get_settings_slug() . '/notifications/';
+	$group_link   = bp_get_group_permalink( $group );
+	$settings_slug = function_exists( 'bp_get_settings_slug' ) ? bp_get_settings_slug() : 'settings';
+	$settings_link = bp_core_get_user_domain( $requesting_user_id ) . $settings_slug . '/notifications/';
 
 	// Set up and send the message
 	$to       = $ud->user_email;
@@ -149,7 +158,6 @@ To submit another request please log in and visit: %2$s
 }
 
 function groups_notification_promoted_member( $user_id, $group_id ) {
-	global $bp;
 
 	if ( groups_is_user_admin( $user_id, $group_id ) ) {
 		$promoted_to = __( 'an administrator', 'buddypress' );
@@ -165,11 +173,11 @@ function groups_notification_promoted_member( $user_id, $group_id ) {
 	if ( 'no' == bp_get_user_meta( $user_id, 'notification_groups_admin_promotion', true ) )
 		return false;
 
-	$group = new BP_Groups_Group( $group_id );
-	$ud = bp_core_get_core_userdata($user_id);
-
-	$group_link = bp_get_group_permalink( $group );
-	$settings_link = bp_core_get_user_domain( $user_id ) . bp_get_settings_slug() . '/notifications/';
+	$group         = groups_get_group( array( 'group_id' => $group_id ) );
+	$ud            = bp_core_get_core_userdata($user_id);
+	$group_link    = bp_get_group_permalink( $group );
+	$settings_slug = function_exists( 'bp_get_settings_slug' ) ? bp_get_settings_slug() : 'settings';
+	$settings_link = bp_core_get_user_domain( $user_id ) . $settings_slug . '/notifications/';
 
 	// Set up and send the message
 	$to       = $ud->user_email;
@@ -198,9 +206,9 @@ To view the group please visit: %3$s
 add_action( 'groups_promoted_member', 'groups_notification_promoted_member', 10, 2 );
 
 function groups_notification_group_invites( &$group, &$member, $inviter_user_id ) {
-	global $bp;
 
-	$inviter_ud = bp_core_get_core_userdata( $inviter_user_id );
+	// @todo $inviter_up may be used for caching, test without it
+	$inviter_ud   = bp_core_get_core_userdata( $inviter_user_id );
 	$inviter_name = bp_core_get_userlink( $inviter_user_id, true, false, true );
 	$inviter_link = bp_core_get_user_domain( $inviter_user_id );
 
@@ -215,11 +223,11 @@ function groups_notification_group_invites( &$group, &$member, $inviter_user_id
 		if ( 'no' == bp_get_user_meta( $invited_user_id, 'notification_groups_invite', true ) )
 			return false;
 
-		$invited_ud = bp_core_get_core_userdata($invited_user_id);
-
-		$settings_link = bp_core_get_user_domain( $invited_user_id ) . bp_get_settings_slug() . '/notifications/';
-		$invited_link = bp_core_get_user_domain( $invited_user_id );
-		$invites_link = $invited_link . bp_get_groups_slug() . '/invites';
+		$invited_ud    = bp_core_get_core_userdata($invited_user_id);
+		$settings_slug = function_exists( 'bp_get_settings_slug' ) ? bp_get_settings_slug() : 'settings';
+		$settings_link = bp_core_get_user_domain( $invited_user_id ) . $settings_slug . '/notifications/';
+		$invited_link  = bp_core_get_user_domain( $invited_user_id );
+		$invites_link  = trailingslashit( $invited_link . bp_get_groups_slug() . '/invites' );
 
 		// Set up and send the message
 		$to       = $invited_ud->user_email;
diff --git a/wp-content/plugins/buddypress/bp-groups/bp-groups-screens.php b/wp-content/plugins/buddypress/bp-groups/bp-groups-screens.php
index aaf7980c510daf8babc29a1c2d534af967d48ba3..b294494fd2f0f80cad6e9112139cbb784bf6c48f 100644
--- a/wp-content/plugins/buddypress/bp-groups/bp-groups-screens.php
+++ b/wp-content/plugins/buddypress/bp-groups/bp-groups-screens.php
@@ -1,10 +1,14 @@
 <?php
-/********************************************************************************
- * Screen Functions
+
+/**
+ * BuddyPress Groups Screen Functions
  *
  * Screen functions are the controllers of BuddyPress. They will execute when their
  * specific URL is caught. They will first save or manipulate data using business
  * functions, then pass on the user to a template file.
+ *
+ * @package BuddyPress
+ * @subpackage GroupsScreens
  */
 
 // Exit if accessed directly
@@ -26,10 +30,10 @@ function groups_screen_my_groups() {
 
 	// Delete group request notifications for the user
 	if ( isset( $_GET['n'] ) ) {
-		bp_core_delete_notifications_by_type( $bp->loggedin_user->id, $bp->groups->id, 'membership_request_accepted' );
-		bp_core_delete_notifications_by_type( $bp->loggedin_user->id, $bp->groups->id, 'membership_request_rejected' );
-		bp_core_delete_notifications_by_type( $bp->loggedin_user->id, $bp->groups->id, 'member_promoted_to_mod'      );
-		bp_core_delete_notifications_by_type( $bp->loggedin_user->id, $bp->groups->id, 'member_promoted_to_admin'    );
+		bp_core_delete_notifications_by_type( bp_loggedin_user_id(), $bp->groups->id, 'membership_request_accepted' );
+		bp_core_delete_notifications_by_type( bp_loggedin_user_id(), $bp->groups->id, 'membership_request_rejected' );
+		bp_core_delete_notifications_by_type( bp_loggedin_user_id(), $bp->groups->id, 'member_promoted_to_mod'      );
+		bp_core_delete_notifications_by_type( bp_loggedin_user_id(), $bp->groups->id, 'member_promoted_to_admin'    );
 	}
 
 	do_action( 'groups_screen_my_groups' );
@@ -51,7 +55,7 @@ function groups_screen_group_invites() {
 			bp_core_add_message( __('Group invite accepted', 'buddypress') );
 
 			// Record this in activity streams
-			$group = new BP_Groups_Group( $group_id );
+			$group = groups_get_group( array( 'group_id' => $group_id ) );
 
 			groups_record_activity( array(
 				'action'  => apply_filters_ref_array( 'groups_activity_accepted_invite_action', array( sprintf( __( '%1$s joined the group %2$s', 'buddypress'), bp_core_get_userlink( bp_loggedin_user_id() ), '<a href="' . bp_get_group_permalink( $group ) . '">' . esc_attr( $group->name ) . '</a>' ), bp_loggedin_user_id(), &$group ) ),
@@ -60,7 +64,7 @@ function groups_screen_group_invites() {
 			) );
 		}
 
-		bp_core_redirect( bp_loggedin_user_domain() . bp_get_groups_slug() . '/' . bp_current_action() );
+		bp_core_redirect( trailingslashit( bp_loggedin_user_domain() . bp_get_groups_slug() . '/' . bp_current_action() ) );
 
 	} else if ( bp_is_action_variable( 'reject' ) && is_numeric( $group_id ) ) {
 		// Check the nonce
@@ -72,7 +76,7 @@ function groups_screen_group_invites() {
 		else
 			bp_core_add_message( __('Group invite rejected', 'buddypress') );
 
-		bp_core_redirect( bp_loggedin_user_domain() . bp_get_groups_slug() . '/' . bp_current_action() );
+		bp_core_redirect( trailingslashit( bp_loggedin_user_domain() . bp_get_groups_slug() . '/' . bp_current_action() ) );
 	}
 
 	// Remove notifications
@@ -88,10 +92,10 @@ function groups_screen_group_home() {
 
 	if ( bp_is_single_item() ) {
 		if ( isset( $_GET['n'] ) ) {
-			bp_core_delete_notifications_by_type( $bp->loggedin_user->id, $bp->groups->id, 'membership_request_accepted' );
-			bp_core_delete_notifications_by_type( $bp->loggedin_user->id, $bp->groups->id, 'membership_request_rejected' );
-			bp_core_delete_notifications_by_type( $bp->loggedin_user->id, $bp->groups->id, 'member_promoted_to_mod'      );
-			bp_core_delete_notifications_by_type( $bp->loggedin_user->id, $bp->groups->id, 'member_promoted_to_admin'    );
+			bp_core_delete_notifications_by_type( bp_loggedin_user_id(), $bp->groups->id, 'membership_request_accepted' );
+			bp_core_delete_notifications_by_type( bp_loggedin_user_id(), $bp->groups->id, 'membership_request_rejected' );
+			bp_core_delete_notifications_by_type( bp_loggedin_user_id(), $bp->groups->id, 'member_promoted_to_mod'      );
+			bp_core_delete_notifications_by_type( bp_loggedin_user_id(), $bp->groups->id, 'member_promoted_to_admin'    );
 		}
 
 		do_action( 'groups_screen_group_home' );
@@ -129,7 +133,7 @@ function groups_screen_group_forum() {
 		$forum_id       = groups_get_groupmeta( $bp->groups->current_group->id, 'forum_id' );
 		$user_is_banned = false;
 
-		if ( !is_super_admin() && groups_is_user_banned( $bp->loggedin_user->id, $bp->groups->current_group->id ) )
+		if ( !bp_current_user_can( 'bp_moderate' ) && groups_is_user_banned( bp_loggedin_user_id(), $bp->groups->current_group->id ) )
 			$user_is_banned = true;
 
 		if ( !empty( $topic_slug ) && !empty( $topic_id ) ) {
@@ -140,24 +144,34 @@ function groups_screen_group_forum() {
 				check_admin_referer( 'bp_forums_new_reply' );
 
 				// Auto join this user if they are not yet a member of this group
-				if ( bp_groups_auto_join() && !is_super_admin() && 'public' == $bp->groups->current_group->status && !groups_is_user_member( $bp->loggedin_user->id, $bp->groups->current_group->id ) )
-					groups_join_group( $bp->groups->current_group->id, $bp->loggedin_user->id );
+				if ( bp_groups_auto_join() && !bp_current_user_can( 'bp_moderate' ) && 'public' == $bp->groups->current_group->status && !groups_is_user_member( bp_loggedin_user_id(), $bp->groups->current_group->id ) )
+					groups_join_group( $bp->groups->current_group->id, bp_loggedin_user_id() );
 
 				$topic_page = isset( $_GET['topic_page'] ) ? $_GET['topic_page'] : false;
+				
+				// Don't allow reply flooding
+				if ( bp_forums_reply_exists( $_POST['reply_text'], $topic_id, bp_loggedin_user_id() ) ) {
+					bp_core_add_message( __( 'It looks like you\'ve already said that!', 'buddypress' ), 'error' );
+				} else {	
+					if ( !$post_id = groups_new_group_forum_post( $_POST['reply_text'], $topic_id, $topic_page ) )
+						bp_core_add_message( __( 'There was an error when replying to that topic', 'buddypress'), 'error' );
+					else
+						bp_core_add_message( __( 'Your reply was posted successfully', 'buddypress') );
+				}
 
-				if ( !$post_id = groups_new_group_forum_post( $_POST['reply_text'], $topic_id, $topic_page ) )
-					bp_core_add_message( __( 'There was an error when replying to that topic', 'buddypress'), 'error' );
-				else
-					bp_core_add_message( __( 'Your reply was posted successfully', 'buddypress') );
+				$query_vars = isset( $_SERVER['QUERY_STRING'] ) ? '?' . $_SERVER['QUERY_STRING'] : '';
+				
+				$redirect = bp_get_group_permalink( groups_get_current_group() ) . 'forum/topic/' . $topic_slug . '/' . $query_vars;
 
-				if ( isset( $_SERVER['QUERY_STRING'] ) )
-					$query_vars = '?' . $_SERVER['QUERY_STRING'];
+				if ( !empty( $post_id ) ) {
+					$redirect .= '#post-' . $post_id;
+				}
 
-				bp_core_redirect( bp_get_group_permalink( groups_get_current_group() ) . 'forum/topic/' . $topic_slug . '/' . $query_vars . '#post-' . $post_id );
+				bp_core_redirect( $redirect );
 			}
 
 			// Sticky a topic
-			else if ( bp_is_action_variable( 'stick', 2 ) && ( isset( $bp->is_item_admin ) || isset( $bp->is_item_mod ) ) ) {
+			else if ( bp_is_action_variable( 'stick', 2 ) && ( bp_is_item_admin() || bp_is_item_mod() ) ) {
 				// Check the nonce
 				check_admin_referer( 'bp_forums_stick_topic' );
 
@@ -171,7 +185,7 @@ function groups_screen_group_forum() {
 			}
 
 			// Un-Sticky a topic
-			else if ( bp_is_action_variable( 'unstick', 2 ) && ( isset( $bp->is_item_admin ) || isset( $bp->is_item_mod ) ) ) {
+			else if ( bp_is_action_variable( 'unstick', 2 ) && ( bp_is_item_admin() || bp_is_item_mod() ) ) {
 				// Check the nonce
 				check_admin_referer( 'bp_forums_unstick_topic' );
 
@@ -185,7 +199,7 @@ function groups_screen_group_forum() {
 			}
 
 			// Close a topic
-			else if ( bp_is_action_variable( 'close', 2 ) && ( isset( $bp->is_item_admin ) || isset( $bp->is_item_mod ) ) ) {
+			else if ( bp_is_action_variable( 'close', 2 ) && ( bp_is_item_admin() || bp_is_item_mod() ) ) {
 				// Check the nonce
 				check_admin_referer( 'bp_forums_close_topic' );
 
@@ -199,7 +213,7 @@ function groups_screen_group_forum() {
 			}
 
 			// Open a topic
-			else if ( bp_is_action_variable( 'open', 2 ) && ( isset( $bp->is_item_admin ) || isset( $bp->is_item_mod ) ) ) {
+			else if ( bp_is_action_variable( 'open', 2 ) && ( bp_is_item_admin() || bp_is_item_mod() ) ) {
 				// Check the nonce
 				check_admin_referer( 'bp_forums_open_topic' );
 
@@ -218,7 +232,7 @@ function groups_screen_group_forum() {
 				$topic = bp_forums_get_topic_details( $topic_id );
 
 				/* Check the logged in user can delete this topic */
-				if ( !$bp->is_item_admin && !$bp->is_item_mod && (int)$bp->loggedin_user->id != (int)$topic->topic_poster )
+				if ( ! bp_is_item_admin() && ! bp_is_item_mod() && ( (int) bp_loggedin_user_id() != (int) $topic->topic_poster ) )
 					bp_core_redirect( wp_get_referer() );
 
 				// Check the nonce
@@ -241,7 +255,7 @@ function groups_screen_group_forum() {
 				$topic = bp_forums_get_topic_details( $topic_id );
 
 				// Check the logged in user can edit this topic
-				if ( !$bp->is_item_admin && !$bp->is_item_mod && (int)$bp->loggedin_user->id != (int)$topic->topic_poster )
+				if ( ! bp_is_item_admin() && ! bp_is_item_mod() && ( (int) bp_loggedin_user_id() != (int) $topic->topic_poster ) )
 					bp_core_redirect( wp_get_referer() );
 
 				if ( isset( $_POST['save_changes'] ) ) {
@@ -268,7 +282,7 @@ function groups_screen_group_forum() {
 				$post = bp_forums_get_post( $post_id );
 
 				// Check the logged in user can edit this topic
-				if ( !$bp->is_item_admin && !$bp->is_item_mod && (int)$bp->loggedin_user->id != (int)$post->poster_id )
+				if ( ! bp_is_item_admin() && ! bp_is_item_mod() && ( (int) bp_loggedin_user_id() != (int) $post->poster_id ) )
 					bp_core_redirect( wp_get_referer() );
 
 				// Check the nonce
@@ -291,7 +305,7 @@ function groups_screen_group_forum() {
 				$post = bp_forums_get_post( $post_id );
 
 				// Check the logged in user can edit this topic
-				if ( !$bp->is_item_admin && !$bp->is_item_mod && (int)$bp->loggedin_user->id != (int)$post->poster_id )
+				if ( ! bp_is_item_admin() && ! bp_is_item_mod() && ( (int) bp_loggedin_user_id() != (int) $post->poster_id ) )
 					bp_core_redirect( wp_get_referer() );
 
 				if ( isset( $_POST['save_changes'] ) ) {
@@ -337,9 +351,9 @@ function groups_screen_group_forum() {
 				if ( $user_is_banned ) {
 				 	$error_message = __( "You have been banned from this group.", 'buddypress' );
 
-				} elseif ( bp_groups_auto_join() && !is_super_admin() && 'public' == $bp->groups->current_group->status && !groups_is_user_member( $bp->loggedin_user->id, $bp->groups->current_group->id ) ) {
+				} elseif ( bp_groups_auto_join() && !bp_current_user_can( 'bp_moderate' ) && 'public' == $bp->groups->current_group->status && !groups_is_user_member( bp_loggedin_user_id(), $bp->groups->current_group->id ) ) {
 					// Auto join this user if they are not yet a member of this group
-					groups_join_group( $bp->groups->current_group->id, $bp->loggedin_user->id );
+					groups_join_group( $bp->groups->current_group->id, bp_loggedin_user_id() );
 				}
 
 				if ( empty( $_POST['topic_title'] ) )
@@ -395,13 +409,13 @@ function groups_screen_group_invite() {
 				return false;
 
 			if ( !empty( $_POST['friends'] ) ) {
-				foreach( (array)$_POST['friends'] as $friend ) {
+				foreach( (array) $_POST['friends'] as $friend ) {
 					groups_invite_user( array( 'user_id' => $friend, 'group_id' => $bp->groups->current_group->id ) );
 				}
 			}
 
 			// Send the invites.
-			groups_send_invites( $bp->loggedin_user->id, $bp->groups->current_group->id );
+			groups_send_invites( bp_loggedin_user_id(), $bp->groups->current_group->id );
 			bp_core_add_message( __('Group invites sent.', 'buddypress') );
 			do_action( 'groups_screen_group_invite', $bp->groups->current_group->id );
 			bp_core_redirect( bp_get_group_permalink( $bp->groups->current_group ) );
@@ -429,7 +443,7 @@ function groups_screen_group_request_membership() {
 			if ( !check_admin_referer( 'groups_request_membership' ) )
 				return false;
 
-			if ( !groups_send_membership_request( $bp->loggedin_user->id, $bp->groups->current_group->id ) ) {
+			if ( !groups_send_membership_request( bp_loggedin_user_id(), $bp->groups->current_group->id ) ) {
 				bp_core_add_message( __( 'There was an error sending your group membership request, please try again.', 'buddypress' ), 'error' );
 			} else {
 				bp_core_add_message( __( 'Your membership request was sent to the group administrator successfully. You will be notified when the group administrator responds to your request.', 'buddypress' ) );
@@ -468,9 +482,9 @@ function groups_screen_group_admin() {
 function groups_screen_group_admin_edit_details() {
 	global $bp;
 
-	if ( bp_is_groups_component() && bp_is_action_variable( 'edit-details', 0 ) ) {
+	if ( 'edit-details' == bp_get_group_current_admin_tab() ) {
 
-		if ( $bp->is_item_admin || $bp->is_item_mod  ) {
+		if ( bp_is_item_admin() || bp_is_item_mod() ) {
 
 			// If the edit form has been submitted, save the edited details
 			if ( isset( $_POST['save'] ) ) {
@@ -478,7 +492,7 @@ function groups_screen_group_admin_edit_details() {
 				if ( !check_admin_referer( 'groups_edit_group_details' ) )
 					return false;
 
-				if ( !groups_edit_base_group_details( $_POST['group-id'], $_POST['group-name'], $_POST['group-desc'], (int)$_POST['group-notify-members'] ) ) {
+				if ( !groups_edit_base_group_details( $_POST['group-id'], $_POST['group-name'], $_POST['group-desc'], (int) $_POST['group-notify-members'] ) ) {
 					bp_core_add_message( __( 'There was an error updating group details, please try again.', 'buddypress' ), 'error' );
 				} else {
 					bp_core_add_message( __( 'Group details were successfully updated.', 'buddypress' ) );
@@ -500,9 +514,9 @@ add_action( 'bp_screens', 'groups_screen_group_admin_edit_details' );
 function groups_screen_group_admin_settings() {
 	global $bp;
 
-	if ( bp_is_groups_component() && bp_is_action_variable( 'group-settings', 0 ) ) {
+	if ( 'group-settings' == bp_get_group_current_admin_tab() ) {
 
-		if ( !$bp->is_item_admin )
+		if ( ! bp_is_item_admin() )
 			return false;
 
 		// If the edit form has been submitted, save the edited details
@@ -511,11 +525,11 @@ function groups_screen_group_admin_settings() {
 
 			// Checked against a whitelist for security
 			$allowed_status = apply_filters( 'groups_allowed_status', array( 'public', 'private', 'hidden' ) );
-			$status         = ( in_array( $_POST['group-status'], (array)$allowed_status ) ) ? $_POST['group-status'] : 'public';
+			$status         = ( in_array( $_POST['group-status'], (array) $allowed_status ) ) ? $_POST['group-status'] : 'public';
 
 			// Checked against a whitelist for security
 			$allowed_invite_status = apply_filters( 'groups_allowed_invite_status', array( 'members', 'mods', 'admins' ) );
-			$invite_status	       = in_array( $_POST['group-invite-status'], (array)$allowed_invite_status ) ? $_POST['group-invite-status'] : 'members';
+			$invite_status	       = in_array( $_POST['group-invite-status'], (array) $allowed_invite_status ) ? $_POST['group-invite-status'] : 'members';
 
 			// Check the nonce
 			if ( !check_admin_referer( 'groups_edit_group_settings' ) )
@@ -542,10 +556,10 @@ add_action( 'bp_screens', 'groups_screen_group_admin_settings' );
 function groups_screen_group_admin_avatar() {
 	global $bp;
 
-	if ( bp_is_groups_component() && bp_is_action_variable( 'group-avatar', 0 ) ) {
+	if ( 'group-avatar' == bp_get_group_current_admin_tab() ) {
 
 		// If the logged-in user doesn't have permission or if avatar uploads are disabled, then stop here
-		if ( !$bp->is_item_admin || (int)bp_get_option( 'bp-disable-avatar-uploads' ) )
+		if ( ! bp_is_item_admin() || (int) bp_get_option( 'bp-disable-avatar-uploads' ) )
 			return false;
 
 		// If the group admin has deleted the admin avatar
@@ -606,9 +620,9 @@ add_action( 'bp_screens', 'groups_screen_group_admin_avatar' );
 function groups_screen_group_admin_manage_members() {
 	global $bp;
 
-	if ( bp_is_groups_component() && bp_is_action_variable( 'manage-members', 0 ) ) {
+	if ( 'manage-members' == bp_get_group_current_admin_tab() ) {
 
-		if ( !$bp->is_item_admin )
+		if ( ! bp_is_item_admin() )
 			return false;
 
 		if ( bp_action_variable( 1 ) && bp_action_variable( 2 ) && bp_action_variable( 3 ) ) {
@@ -721,9 +735,9 @@ add_action( 'bp_screens', 'groups_screen_group_admin_manage_members' );
 function groups_screen_group_admin_requests() {
 	global $bp;
 
-	if ( bp_is_groups_component() && bp_is_action_variable( 'membership-requests', 0 ) ) {
+	if ( 'membership-requests' == bp_get_group_current_admin_tab() ) {
 
-		if ( !$bp->is_item_admin || 'public' == $bp->groups->current_group->status )
+		if ( ! bp_is_item_admin() || ( 'public' == $bp->groups->current_group->status ) )
 			return false;
 
 		// Remove any screen notifications
@@ -770,9 +784,9 @@ add_action( 'bp_screens', 'groups_screen_group_admin_requests' );
 function groups_screen_group_admin_delete_group() {
 	global $bp;
 
-	if ( bp_is_groups_component() && bp_is_action_variable( 'delete-group', 0 ) ) {
+	if ( 'delete-group' == bp_get_group_current_admin_tab() ) {
 
-		if ( !$bp->is_item_admin && !is_super_admin() )
+		if ( ! bp_is_item_admin() && !bp_current_user_can( 'bp_moderate' ) )
 			return false;
 
 		if ( isset( $_REQUEST['delete-group-button'] ) && isset( $_REQUEST['delete-group-understand'] ) ) {
@@ -790,10 +804,10 @@ function groups_screen_group_admin_delete_group() {
 
 				do_action( 'groups_group_deleted', $bp->groups->current_group->id );
 
-				bp_core_redirect( bp_loggedin_user_domain() . bp_get_groups_slug() . '/' );
+				bp_core_redirect( trailingslashit( bp_loggedin_user_domain() . bp_get_groups_slug() ) );
 			}
 
-			bp_core_redirect( bp_loggedin_user_domain() . bp_get_groups_slug() );
+			bp_core_redirect( trailingslashit( bp_loggedin_user_domain() . bp_get_groups_slug() ) );
 		}
 
 		do_action( 'groups_screen_group_admin_delete_group', $bp->groups->current_group->id );
@@ -809,18 +823,17 @@ add_action( 'bp_screens', 'groups_screen_group_admin_delete_group' );
  * @package BuddyPress
  */
 function groups_screen_notification_settings() {
-	global $bp;
 
-	if ( !$group_invite = bp_get_user_meta( $bp->displayed_user->id, 'notification_groups_invite', true ) )
+	if ( !$group_invite = bp_get_user_meta( bp_displayed_user_id(), 'notification_groups_invite', true ) )
 		$group_invite  = 'yes';
 
-	if ( !$group_update = bp_get_user_meta( $bp->displayed_user->id, 'notification_groups_group_updated', true ) )
+	if ( !$group_update = bp_get_user_meta( bp_displayed_user_id(), 'notification_groups_group_updated', true ) )
 		$group_update  = 'yes';
 
-	if ( !$group_promo = bp_get_user_meta( $bp->displayed_user->id, 'notification_groups_admin_promotion', true ) )
+	if ( !$group_promo = bp_get_user_meta( bp_displayed_user_id(), 'notification_groups_admin_promotion', true ) )
 		$group_promo   = 'yes';
 
-	if ( !$group_request = bp_get_user_meta( $bp->displayed_user->id, 'notification_groups_membership_request', true ) )
+	if ( !$group_request = bp_get_user_meta( bp_displayed_user_id(), 'notification_groups_membership_request', true ) )
 		$group_request = 'yes';
 ?>
 
@@ -868,4 +881,5 @@ function groups_screen_notification_settings() {
 <?php
 }
 add_action( 'bp_notification_settings', 'groups_screen_notification_settings' );
-?>
\ No newline at end of file
+
+?>
diff --git a/wp-content/plugins/buddypress/bp-groups/bp-groups-template.php b/wp-content/plugins/buddypress/bp-groups/bp-groups-template.php
index 87f63b322f009ec4e2129c13eca76e78ad52e7ae..e471241ed8508ecb37d77d28c50d23095b27ddeb 100644
--- a/wp-content/plugins/buddypress/bp-groups/bp-groups-template.php
+++ b/wp-content/plugins/buddypress/bp-groups/bp-groups-template.php
@@ -1,4 +1,12 @@
 <?php
+
+/**
+ * BuddyPress Groups Template Functions
+ *
+ * @package BuddyPress
+ * @subpackage GroupsTemplate
+ */
+
 // Exit if accessed directly
 if ( !defined( 'ABSPATH' ) ) exit;
 
@@ -7,7 +15,7 @@ if ( !defined( 'ABSPATH' ) ) exit;
  *
  * @package BuddyPress
  * @subpackage Groups Template
- * @since 1.5
+ * @since BuddyPress (1.5)
  *
  * @uses bp_get_groups_slug()
  */
@@ -19,7 +27,7 @@ function bp_groups_slug() {
 	 *
 	 * @package BuddyPress
 	 * @subpackage Groups Template
-	 * @since 1.5
+	 * @since BuddyPress (1.5)
 	 */
 	function bp_get_groups_slug() {
 		global $bp;
@@ -31,7 +39,7 @@ function bp_groups_slug() {
  *
  * @package BuddyPress
  * @subpackage Groups Template
- * @since 1.5
+ * @since BuddyPress (1.5)
  *
  * @uses bp_get_groups_root_slug()
  */
@@ -43,7 +51,7 @@ function bp_groups_root_slug() {
 	 *
 	 * @package BuddyPress
 	 * @subpackage Groups Template
-	 * @since 1.5
+	 * @since BuddyPress (1.5)
 	 */
 	function bp_get_groups_root_slug() {
 		global $bp;
@@ -55,7 +63,7 @@ function bp_groups_root_slug() {
  *
  * @package BuddyPress
  * @subpackage Groups Template
- * @since 1.5
+ * @since BuddyPress (1.5)
  * @uses bp_get_groups_directory_permalink()
  */
 function bp_groups_directory_permalink() {
@@ -66,7 +74,7 @@ function bp_groups_directory_permalink() {
 	 *
 	 * @package BuddyPress
 	 * @subpackage Groups Template
-	 * @since 1.5
+	 * @since BuddyPress (1.5)
 	 * @uses apply_filters()
 	 * @uses traisingslashit()
 	 * @uses bp_get_root_domain()
@@ -99,18 +107,12 @@ class BP_Groups_Template {
 	var $sort_by;
 	var $order;
 
-	function bp_groups_template( $user_id, $type, $page, $per_page, $max, $slug, $search_terms, $populate_extras, $include = false, $exclude = false, $show_hidden = false ) {
-		$this->__construct( $user_id, $type, $page, $per_page, $max, $slug, $search_terms, $include, $populate_extras, $exclude, $show_hidden );
-	}
-
-	function __construct( $user_id, $type, $page, $per_page, $max, $slug, $search_terms, $populate_extras, $include = false, $exclude = false, $show_hidden = false ){
-
-		global $bp;
+	function __construct( $user_id, $type, $page, $per_page, $max, $slug, $search_terms, $populate_extras, $include = false, $exclude = false, $show_hidden = false, $page_arg = 'grpage' ){
 
-		$this->pag_page = isset( $_REQUEST['grpage'] ) ? intval( $_REQUEST['grpage'] ) : $page;
+		$this->pag_page = isset( $_REQUEST[$page_arg] ) ? intval( $_REQUEST[$page_arg] ) : $page;
 		$this->pag_num  = isset( $_REQUEST['num'] ) ? intval( $_REQUEST['num'] ) : $per_page;
 
-		if ( $bp->loggedin_user->is_super_admin || ( is_user_logged_in() && $user_id == $bp->loggedin_user->id ) )
+		if ( bp_current_user_can( 'bp_moderate' ) || ( is_user_logged_in() && $user_id == bp_loggedin_user_id() ) )
 			$show_hidden = true;
 
 		if ( 'invites' == $type ) {
@@ -134,18 +136,18 @@ class BP_Groups_Template {
 		}
 
 		if ( 'invites' == $type ) {
-			$this->total_group_count = (int)$this->groups['total'];
-			$this->group_count       = (int)$this->groups['total'];
+			$this->total_group_count = (int) $this->groups['total'];
+			$this->group_count       = (int) $this->groups['total'];
 			$this->groups            = $this->groups['groups'];
 		} else if ( 'single-group' == $type ) {
 			$this->single_group      = true;
 			$this->total_group_count = 1;
 			$this->group_count       = 1;
 		} else {
-			if ( empty( $max ) || $max >= (int)$this->groups['total'] ) {
-				$this->total_group_count = (int)$this->groups['total'];
+			if ( empty( $max ) || $max >= (int) $this->groups['total'] ) {
+				$this->total_group_count = (int) $this->groups['total'];
 			} else {
-				$this->total_group_count = (int)$max;
+				$this->total_group_count = (int) $max;
 			}
 
 			$this->groups = $this->groups['groups'];
@@ -154,7 +156,7 @@ class BP_Groups_Template {
 				if ( $max >= count( $this->groups ) ) {
 					$this->group_count = count( $this->groups );
 				} else {
-					$this->group_count = (int)$max;
+					$this->group_count = (int) $max;
 				}
 			} else {
 				$this->group_count = count( $this->groups );
@@ -162,11 +164,11 @@ class BP_Groups_Template {
 		}
 
 		// Build pagination links
-		if ( (int)$this->total_group_count && (int)$this->pag_num ) {
+		if ( (int) $this->total_group_count && (int) $this->pag_num ) {
 			$this->pag_links = paginate_links( array(
-				'base'      => add_query_arg( array( 'grpage' => '%#%', 'num' => $this->pag_num, 's' => $search_terms, 'sortby' => $this->sort_by, 'order' => $this->order ) ),
+				'base'      => add_query_arg( array( $page_arg => '%#%', 'num' => $this->pag_num, 's' => $search_terms, 'sortby' => $this->sort_by, 'order' => $this->order ) ),
 				'format'    => '',
-				'total'     => ceil( (int)$this->total_group_count / (int)$this->pag_num ),
+				'total'     => ceil( (int) $this->total_group_count / (int) $this->pag_num ),
 				'current'   => $this->pag_page,
 				'prev_text' => _x( '&larr;', 'Group pagination previous text', 'buddypress' ),
 				'next_text' => _x( '&rarr;', 'Group pagination next text', 'buddypress' ),
@@ -210,13 +212,11 @@ class BP_Groups_Template {
 	}
 
 	function the_group() {
-		global $group;
-
 		$this->in_the_loop = true;
-		$this->group = $this->next_group();
+		$this->group       = $this->next_group();
 
 		if ( $this->single_group )
-			$this->group = new BP_Groups_Group( $this->group->group_id );
+			$this->group = groups_get_group( array( 'group_id' => $this->group->group_id ) );
 
 		if ( 0 == $this->current_group ) // loop has just started
 			do_action('group_loop_start');
@@ -237,17 +237,17 @@ function bp_has_groups( $args = '' ) {
 	$order   = '';
 
 	// User filtering
-	if ( !empty( $bp->displayed_user->id ) )
-		$user_id = $bp->displayed_user->id;
+	if ( bp_displayed_user_id() )
+		$user_id = bp_displayed_user_id();
 
 	// Type
-	if ( 'my-groups' == $bp->current_action ) {
+	if ( bp_is_current_action( 'my-groups' ) ) {
 		if ( 'most-popular' == $order ) {
 			$type = 'popular';
 		} elseif ( 'alphabetically' == $order ) {
 			$type = 'alphabetical';
 		}
-	} elseif ( 'invites' == $bp->current_action ) {
+	} elseif ( bp_is_current_action( 'invites' ) ) {
 		$type = 'invites';
 	} elseif ( isset( $bp->groups->current_group->slug ) && $bp->groups->current_group->slug ) {
 		$type = 'single-group';
@@ -261,6 +261,8 @@ function bp_has_groups( $args = '' ) {
 		'max'             => false,
 		'show_hidden'     => false,
 
+		'page_arg'        => 'grpage', // See https://buddypress.trac.wordpress.org/ticket/3679
+
 		'user_id'         => $user_id, // Pass a user ID to limit to groups this user has joined
 		'slug'            => $slug,    // Pass a group slug to only return that group
 		'search_terms'    => '',       // Pass search terms to return only matching groups
@@ -282,7 +284,7 @@ function bp_has_groups( $args = '' ) {
 			$search_terms = false;
 	}
 
-	$groups_template = new BP_Groups_Template( (int)$user_id, $type, (int)$page, (int)$per_page, (int)$max, $slug, $search_terms, (bool)$populate_extras, $include, $exclude, $show_hidden );
+	$groups_template = new BP_Groups_Template( (int) $user_id, $type, (int) $page, (int) $per_page, (int) $max, $slug, $search_terms, (bool)$populate_extras, $include, $exclude, $show_hidden, $page_arg );
 	return apply_filters( 'bp_has_groups', $groups_template->has_groups(), $groups_template );
 }
 
@@ -297,18 +299,18 @@ function bp_the_group() {
 }
 
 function bp_group_is_visible( $group = false ) {
-	global $bp, $groups_template;
+	global $groups_template;
 
-	if ( $bp->loggedin_user->is_super_admin )
+	if ( bp_current_user_can( 'bp_moderate' ) )
 		return true;
 
-	if ( !$group )
+	if ( empty( $group ) )
 		$group =& $groups_template->group;
 
 	if ( 'public' == $group->status ) {
 		return true;
 	} else {
-		if ( groups_is_user_member( $bp->loggedin_user->id, $group->id ) ) {
+		if ( groups_is_user_member( bp_loggedin_user_id(), $group->id ) ) {
 			return true;
 		}
 	}
@@ -322,7 +324,7 @@ function bp_group_id() {
 	function bp_get_group_id( $group = false ) {
 		global $groups_template;
 
-		if ( !$group )
+		if ( empty( $group ) )
 			$group =& $groups_template->group;
 
 		return apply_filters( 'bp_get_group_id', $group->id );
@@ -334,7 +336,7 @@ function bp_group_name() {
 	function bp_get_group_name( $group = false ) {
 		global $groups_template;
 
-		if ( !$group )
+		if ( empty( $group ) )
 			$group =& $groups_template->group;
 
 		return apply_filters( 'bp_get_group_name', $group->name );
@@ -346,7 +348,7 @@ function bp_group_type() {
 	function bp_get_group_type( $group = false ) {
 		global $groups_template;
 
-		if ( !$group )
+		if ( empty( $group ) )
 			$group =& $groups_template->group;
 
 		if ( 'public' == $group->status ) {
@@ -368,7 +370,7 @@ function bp_group_status() {
 	function bp_get_group_status( $group = false ) {
 		global $groups_template;
 
-		if ( !$group )
+		if ( empty( $group ) )
 			$group =& $groups_template->group;
 
 		return apply_filters( 'bp_get_group_status', $group->status );
@@ -381,19 +383,19 @@ function bp_group_avatar( $args = '' ) {
 		global $bp, $groups_template;
 
 		$defaults = array(
-			'type' => 'full',
-			'width' => false,
+			'type'   => 'full',
+			'width'  => false,
 			'height' => false,
-			'class' => 'avatar',
-			'id' => false,
-			'alt' => __( 'Group logo of %s', 'buddypress' )
+			'class'  => 'avatar',
+			'id'     => false,
+			'alt'    => sprintf( __( 'Group logo of %s', 'buddypress' ), $groups_template->group->name )
 		);
 
 		$r = wp_parse_args( $args, $defaults );
 		extract( $r, EXTR_SKIP );
 
 		/* Fetch the avatar from the folder, if not provide backwards compat. */
-		if ( !$avatar = bp_core_fetch_avatar( array( 'item_id' => $groups_template->group->id, 'object' => 'group', 'type' => $type, 'avatar_dir' => 'group-avatars', 'alt' => $alt, 'css_id' => $id, 'class' => $class, 'width' => $width, 'height' => $height ) ) )
+		if ( !$avatar = bp_core_fetch_avatar( array( 'item_id' => $groups_template->group->id, 'object' => 'group', 'type' => $type, 'avatar_dir' => 'group-avatars', 'alt' => $alt, 'css_id' => $id, 'class' => $class, 'width' => $width, 'height' => $height, 'title' => $groups_template->group->name, 'alt' => $alt ) ) )
 			$avatar = '<img src="' . esc_attr( $groups_template->group->avatar_thumb ) . '" class="avatar" alt="' . esc_attr( $groups_template->group->name ) . '" />';
 
 		return apply_filters( 'bp_get_group_avatar', $avatar );
@@ -419,7 +421,7 @@ function bp_group_last_active() {
 	function bp_get_group_last_active( $group = false ) {
 		global $groups_template;
 
-		if ( !$group )
+		if ( empty( $group ) )
 			$group =& $groups_template->group;
 
 		$last_active = $group->last_activity;
@@ -438,24 +440,24 @@ function bp_group_permalink() {
 	echo bp_get_group_permalink();
 }
 	function bp_get_group_permalink( $group = false ) {
-		global $groups_template, $bp;
+		global $groups_template;
 
-		if ( !$group )
+		if ( empty( $group ) )
 			$group =& $groups_template->group;
 
-		return apply_filters( 'bp_get_group_permalink', bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/' . $group->slug . '/' );
+		return apply_filters( 'bp_get_group_permalink', trailingslashit( bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/' . $group->slug . '/' ) );
 	}
 
 function bp_group_admin_permalink() {
 	echo bp_get_group_admin_permalink();
 }
 	function bp_get_group_admin_permalink( $group = false ) {
-		global $groups_template, $bp;
+		global $groups_template;
 
-		if ( !$group )
+		if ( empty( $group ) )
 			$group =& $groups_template->group;
 
-		return apply_filters( 'bp_get_group_admin_permalink', bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/' . $group->slug . '/admin' );
+		return apply_filters( 'bp_get_group_admin_permalink', trailingslashit( bp_get_group_permalink( $group ) . 'admin' ) );
 	}
 
 function bp_group_slug() {
@@ -464,7 +466,7 @@ function bp_group_slug() {
 	function bp_get_group_slug( $group = false ) {
 		global $groups_template;
 
-		if ( !$group )
+		if ( empty( $group ) )
 			$group =& $groups_template->group;
 
 		return apply_filters( 'bp_get_group_slug', $group->slug );
@@ -476,7 +478,7 @@ function bp_group_description() {
 	function bp_get_group_description( $group = false ) {
 		global $groups_template;
 
-		if ( !$group )
+		if ( empty( $group ) )
 			$group =& $groups_template->group;
 
 		return apply_filters( 'bp_get_group_description', stripslashes($group->description) );
@@ -488,7 +490,7 @@ function bp_group_description_editable() {
 	function bp_get_group_description_editable( $group = false ) {
 		global $groups_template;
 
-		if ( !$group )
+		if ( empty( $group ) )
 			$group =& $groups_template->group;
 
 		return apply_filters( 'bp_get_group_description_editable', $group->description );
@@ -500,7 +502,7 @@ function bp_group_description_excerpt() {
 	function bp_get_group_description_excerpt( $group = false ) {
 		global $groups_template;
 
-		if ( !$group )
+		if ( empty( $group ) )
 			$group =& $groups_template->group;
 
 		return apply_filters( 'bp_get_group_description_excerpt', bp_create_excerpt( $group->description ) );
@@ -513,7 +515,7 @@ function bp_group_public_status() {
 	function bp_get_group_public_status( $group = false ) {
 		global $groups_template;
 
-		if ( !$group )
+		if ( empty( $group ) )
 			$group =& $groups_template->group;
 
 		if ( $group->is_public ) {
@@ -529,7 +531,7 @@ function bp_group_is_public() {
 	function bp_get_group_is_public( $group = false ) {
 		global $groups_template;
 
-		if ( !$group )
+		if ( empty( $group ) )
 			$group =& $groups_template->group;
 
 		return apply_filters( 'bp_get_group_is_public', $group->is_public );
@@ -541,35 +543,31 @@ function bp_group_date_created() {
 	function bp_get_group_date_created( $group = false ) {
 		global $groups_template;
 
-		if ( !$group )
+		if ( empty( $group ) )
 			$group =& $groups_template->group;
 
 		return apply_filters( 'bp_get_group_date_created', bp_core_time_since( strtotime( $group->date_created ) ) );
 	}
 
 function bp_group_is_admin() {
-	global $bp;
-
-	return $bp->is_item_admin;
+	return bp_is_item_admin();
 }
 
 function bp_group_is_mod() {
-	global $bp;
-
-	return $bp->is_item_mod;
+	return bp_is_item_mod();
 }
 
 function bp_group_list_admins( $group = false ) {
 	global $groups_template;
 
-	if ( !$group )
+	if ( empty( $group ) )
 		$group =& $groups_template->group;
 
-	if ( $group->admins ) { ?>
+	if ( !empty( $group->admins ) ) { ?>
 		<ul id="group-admins">
-			<?php foreach( (array)$group->admins as $admin ) { ?>
+			<?php foreach( (array) $group->admins as $admin ) { ?>
 				<li>
-					<a href="<?php echo bp_core_get_user_domain( $admin->user_id, $admin->user_nicename, $admin->user_login ) ?>"><?php echo bp_core_fetch_avatar( array( 'item_id' => $admin->user_id, 'email' => $admin->user_email, 'alt' => __( 'Profile picture of %s', 'buddypress' ) ) ) ?></a>
+					<a href="<?php echo bp_core_get_user_domain( $admin->user_id, $admin->user_nicename, $admin->user_login ) ?>"><?php echo bp_core_fetch_avatar( array( 'item_id' => $admin->user_id, 'email' => $admin->user_email, 'alt' => sprintf( __( 'Profile picture of %s', 'buddypress' ), bp_core_get_user_displayname( $admin->user_id ) ) ) ) ?></a>
 				</li>
 			<?php } ?>
 		</ul>
@@ -589,10 +587,10 @@ function bp_group_list_mods( $group = false ) {
 
 		<ul id="group-mods">
 
-			<?php foreach( (array)$group->mods as $mod ) { ?>
+			<?php foreach( (array) $group->mods as $mod ) { ?>
 
 				<li>
-					<a href="<?php echo bp_core_get_user_domain( $mod->user_id, $mod->user_nicename, $mod->user_login ) ?>"><?php echo bp_core_fetch_avatar( array( 'item_id' => $mod->user_id, 'email' => $mod->user_email, 'alt' => __( 'Profile picture of %s', 'buddypress' ) ) ) ?></a>
+					<a href="<?php echo bp_core_get_user_domain( $mod->user_id, $mod->user_nicename, $mod->user_login ) ?>"><?php echo bp_core_fetch_avatar( array( 'item_id' => $mod->user_id, 'email' => $mod->user_email, 'alt' => sprintf( __( 'Profile picture of %s', 'buddypress' ), bp_core_get_user_displayname( $mod->user_id ) ) ) ) ?></a>
 				</li>
 
 			<?php } ?>
@@ -611,7 +609,7 @@ function bp_group_list_mods( $group = false ) {
  * Return a list of user_ids for a group's admins
  *
  * @package BuddyPress
- * @since 1.5
+ * @since BuddyPress (1.5)
  *
  * @param obj $group (optional) The group being queried. Defaults to the current group in the loop
  * @param str $format 'string' to get a comma-separated string, 'array' to get an array
@@ -620,7 +618,7 @@ function bp_group_list_mods( $group = false ) {
 function bp_group_admin_ids( $group = false, $format = 'string' ) {
 	global $groups_template;
 
-	if ( !$group )
+	if ( empty( $group ) )
 		$group =& $groups_template->group;
 
 	$admin_ids = array();
@@ -641,7 +639,7 @@ function bp_group_admin_ids( $group = false, $format = 'string' ) {
  * Return a list of user_ids for a group's moderators
  *
  * @package BuddyPress
- * @since 1.5
+ * @since BuddyPress (1.5)
  *
  * @param obj $group (optional) The group being queried. Defaults to the current group in the loop
  * @param str $format 'string' to get a comma-separated string, 'array' to get an array
@@ -650,7 +648,7 @@ function bp_group_admin_ids( $group = false, $format = 'string' ) {
 function bp_group_mod_ids( $group = false, $format = 'string' ) {
 	global $groups_template;
 
-	if ( !$group )
+	if ( empty( $group ) )
 		$group =& $groups_template->group;
 
 	$mod_ids = array();
@@ -671,18 +669,18 @@ function bp_group_all_members_permalink() {
 	echo bp_get_group_all_members_permalink();
 }
 	function bp_get_group_all_members_permalink( $group = false ) {
-		global $groups_template, $bp;
+		global $groups_template;
 
-		if ( !$group )
+		if ( empty( $group ) )
 			$group =& $groups_template->group;
 
 		return apply_filters( 'bp_get_group_all_members_permalink', bp_get_group_permalink( $group ) . 'members' );
 	}
 
 function bp_group_search_form() {
-	global $groups_template, $bp;
+	global $bp;
 
-	$action = $bp->displayed_user->domain . bp_get_groups_slug() . '/my-groups/search/';
+	$action = bp_displayed_user_domain() . bp_get_groups_slug() . '/my-groups/search/';
 	$label = __('Filter Groups', 'buddypress');
 	$name = 'group-filter-box';
 
@@ -697,9 +695,7 @@ function bp_group_search_form() {
 }
 
 function bp_group_show_no_groups_message() {
-	global $bp;
-
-	if ( !groups_total_groups_for_user( $bp->displayed_user->id ) )
+	if ( !groups_total_groups_for_user( bp_displayed_user_id() ) )
 		return true;
 
 	return false;
@@ -726,12 +722,12 @@ function bp_groups_pagination_count() {
 	echo bp_get_groups_pagination_count();
 }
 	function bp_get_groups_pagination_count() {
-		global $bp, $groups_template;
+		global $groups_template;
 
 		$start_num = intval( ( $groups_template->pag_page - 1 ) * $groups_template->pag_num ) + 1;
-		$from_num = bp_core_number_format( $start_num );
-		$to_num = bp_core_number_format( ( $start_num + ( $groups_template->pag_num - 1 ) > $groups_template->total_group_count ) ? $groups_template->total_group_count : $start_num + ( $groups_template->pag_num - 1 ) );
-		$total = bp_core_number_format( $groups_template->total_group_count );
+		$from_num  = bp_core_number_format( $start_num );
+		$to_num    = bp_core_number_format( ( $start_num + ( $groups_template->pag_num - 1 ) > $groups_template->total_group_count ) ? $groups_template->total_group_count : $start_num + ( $groups_template->pag_num - 1 ) );
+		$total     = bp_core_number_format( $groups_template->total_group_count );
 
 		return apply_filters( 'bp_get_groups_pagination_count', sprintf( __( 'Viewing group %1$s to %2$s (of %3$s groups)', 'buddypress' ), $from_num, $to_num, $total ) );
 	}
@@ -748,7 +744,7 @@ function bp_group_total_members( $group = false ) {
 	function bp_get_group_total_members( $group = false ) {
 		global $groups_template;
 
-		if ( !$group )
+		if ( empty( $group ) )
 			$group =& $groups_template->group;
 
 		return apply_filters( 'bp_get_group_total_members', $group->total_member_count );
@@ -772,7 +768,7 @@ function bp_group_forum_permalink() {
 	function bp_get_group_forum_permalink( $group = false ) {
 		global $groups_template;
 
-		if ( !$group )
+		if ( empty( $group ) )
 			$group =& $groups_template->group;
 
 		return apply_filters( 'bp_get_group_forum_permalink', bp_get_group_permalink( $group ) . 'forum' );
@@ -798,7 +794,7 @@ function bp_group_forum_topic_count( $args = '' ) {
 			return false;
 
 		if ( !$groups_template->group->forum_counts )
-			$groups_template->group->forum_counts = bp_forums_get_forum_topicpost_count( (int)$forum_id );
+			$groups_template->group->forum_counts = bp_forums_get_forum_topicpost_count( (int) $forum_id );
 
 		if ( (bool) $showtext ) {
 			if ( 1 == (int) $groups_template->group->forum_counts[0]->topics )
@@ -832,7 +828,7 @@ function bp_group_forum_post_count( $args = '' ) {
 			return false;
 
 		if ( !$groups_template->group->forum_counts )
-			$groups_template->group->forum_counts = bp_forums_get_forum_topicpost_count( (int)$forum_id );
+			$groups_template->group->forum_counts = bp_forums_get_forum_topicpost_count( (int) $forum_id );
 
 		if ( (bool) $showtext ) {
 			if ( 1 == (int) $groups_template->group->forum_counts[0]->posts )
@@ -849,7 +845,7 @@ function bp_group_forum_post_count( $args = '' ) {
 function bp_group_is_forum_enabled( $group = false ) {
 	global $groups_template;
 
-	if ( !$group )
+	if ( empty( $group ) )
 		$group =& $groups_template->group;
 
 	if ( bp_is_active( 'forums' ) ) {
@@ -869,7 +865,7 @@ function bp_group_is_forum_enabled( $group = false ) {
 function bp_group_show_forum_setting( $group = false ) {
 	global $groups_template;
 
-	if ( !$group )
+	if ( empty( $group ) )
 		$group =& $groups_template->group;
 
 	if ( $group->enable_forum )
@@ -879,7 +875,7 @@ function bp_group_show_forum_setting( $group = false ) {
 function bp_group_show_status_setting( $setting, $group = false ) {
 	global $groups_template;
 
-	if ( !$group )
+	if ( empty( $group ) )
 		$group =& $groups_template->group;
 
 	if ( $setting == $group->status )
@@ -891,7 +887,7 @@ function bp_group_show_status_setting( $setting, $group = false ) {
  *
  * @package BuddyPress
  * @subpackage Groups Template
- * @since 1.5
+ * @since BuddyPress (1.5)
  *
  * @param str $setting The setting you want to check against ('members', 'mods', or 'admins')
  * @param obj $group (optional) The group whose status you want to check
@@ -916,7 +912,7 @@ function bp_group_show_invite_status_setting( $setting, $group = false ) {
  *
  * @package BuddyPress
  * @subpackage Groups Template
- * @since 1.5
+ * @since BuddyPress (1.5)
  *
  * @param int $group_id (optional) The id of the group whose status you want to check
  * @return mixed Returns false when no group can be found. Otherwise returns the group invite
@@ -952,7 +948,7 @@ function bp_group_get_invite_status( $group_id = false ) {
  *
  * @package BuddyPress
  * @subpackage Groups Template
- * @since 1.5
+ * @since BuddyPress (1.5)
  *
  * @param int $group_id (optional) The id of the group whose status you want to check
  * @return bool $can_send_invites
@@ -964,7 +960,7 @@ function bp_groups_user_can_send_invites( $group_id = false ) {
 	$invite_status    = false;
 
 	if ( is_user_logged_in() ) {
-		if ( is_super_admin() ) {
+		if ( bp_current_user_can( 'bp_moderate' ) ) {
 			// Super admins can always send invitations
 			$can_send_invites = true;
 
@@ -1025,13 +1021,13 @@ function bp_group_admin_memberlist( $admin_list = false, $group = false ) {
 
 		<ul id="admins-list" class="item-list<?php if ( !empty( $admin_list ) ) : ?> single-line<?php endif; ?>">
 
-		<?php foreach ( (array)$admins as $admin ) { ?>
+		<?php foreach ( (array) $admins as $admin ) { ?>
 
 			<?php if ( !empty( $admin_list ) ) : ?>
 
 			<li>
 
-				<?php echo bp_core_fetch_avatar( array( 'item_id' => $admin->user_id, 'type' => 'thumb', 'width' => 30, 'height' => 30, 'alt' => __( 'Profile picture of %s', 'buddypress' ) ) ) ?>
+				<?php echo bp_core_fetch_avatar( array( 'item_id' => $admin->user_id, 'type' => 'thumb', 'width' => 30, 'height' => 30, 'alt' => sprintf( __( 'Profile picture of %s', 'buddypress' ), bp_core_get_user_displayname( $admin->user_id ) ) ) ) ?>
 
 				<h5>
 
@@ -1047,7 +1043,7 @@ function bp_group_admin_memberlist( $admin_list = false, $group = false ) {
 
 			<li>
 
-				<?php echo bp_core_fetch_avatar( array( 'item_id' => $admin->user_id, 'type' => 'thumb', 'alt' => __( 'Profile picture of %s', 'buddypress' ) ) ) ?>
+				<?php echo bp_core_fetch_avatar( array( 'item_id' => $admin->user_id, 'type' => 'thumb', 'alt' => sprintf( __( 'Profile picture of %s', 'buddypress' ), bp_core_get_user_displayname( $admin->user_id ) ) ) ) ?>
 
 				<h5><?php echo bp_core_get_userlink( $admin->user_id ) ?></h5>
 				<span class="activity">
@@ -1081,7 +1077,7 @@ function bp_group_admin_memberlist( $admin_list = false, $group = false ) {
 }
 
 function bp_group_mod_memberlist( $admin_list = false, $group = false ) {
-	global $groups_template, $group_mods;
+	global $groups_template;
 
 	if ( empty( $group ) )
 		$group =& $groups_template->group;
@@ -1090,13 +1086,13 @@ function bp_group_mod_memberlist( $admin_list = false, $group = false ) {
 
 		<ul id="mods-list" class="item-list<?php if ( $admin_list ) { ?> single-line<?php } ?>">
 
-		<?php foreach ( (array)$group_mods as $mod ) { ?>
+		<?php foreach ( (array) $group_mods as $mod ) { ?>
 
 			<?php if ( !empty( $admin_list ) ) { ?>
 
 			<li>
 
-				<?php echo bp_core_fetch_avatar( array( 'item_id' => $mod->user_id, 'type' => 'thumb', 'width' => 30, 'height' => 30, 'alt' => __( 'Profile picture of %s', 'buddypress' ) ) ) ?>
+				<?php echo bp_core_fetch_avatar( array( 'item_id' => $mod->user_id, 'type' => 'thumb', 'width' => 30, 'height' => 30, 'alt' => sprintf( __( 'Profile picture of %s', 'buddypress' ), bp_core_get_user_displayname( $mod->user_id ) ) ) ) ?>
 
 				<h5>
 					<?php echo bp_core_get_userlink( $mod->user_id ); ?>
@@ -1112,7 +1108,7 @@ function bp_group_mod_memberlist( $admin_list = false, $group = false ) {
 
 			<li>
 
-				<?php echo bp_core_fetch_avatar( array( 'item_id' => $mod->user_id, 'type' => 'thumb', 'alt' => __( 'Profile picture of %s', 'buddypress' ) ) ) ?>
+				<?php echo bp_core_fetch_avatar( array( 'item_id' => $mod->user_id, 'type' => 'thumb', 'alt' => sprintf( __( 'Profile picture of %s', 'buddypress' ), bp_core_get_user_displayname( $mod->user_id ) ) ) ) ?>
 
 				<h5><?php echo bp_core_get_userlink( $mod->user_id ) ?></h5>
 
@@ -1143,9 +1139,9 @@ function bp_group_mod_memberlist( $admin_list = false, $group = false ) {
 }
 
 function bp_group_has_moderators( $group = false ) {
-	global $group_mods, $groups_template;
+	global $groups_template;
 
-	if ( !$group )
+	if ( empty( $group ) )
 		$group =& $groups_template->group;
 
 	return apply_filters( 'bp_group_has_moderators', groups_get_group_mods( $group->id ) );
@@ -1155,7 +1151,7 @@ function bp_group_member_promote_mod_link( $args = '' ) {
 	echo bp_get_group_member_promote_mod_link( $args );
 }
 	function bp_get_group_member_promote_mod_link( $args = '' ) {
-		global $members_template, $groups_template, $bp;
+		global $members_template, $groups_template;
 
 		$defaults = array(
 			'user_id' => $members_template->member->user_id,
@@ -1172,7 +1168,7 @@ function bp_group_member_promote_admin_link( $args = '' ) {
 	echo bp_get_group_member_promote_admin_link( $args );
 }
 	function bp_get_group_member_promote_admin_link( $args = '' ) {
-		global $members_template, $groups_template, $bp;
+		global $members_template, $groups_template;
 
 		$defaults = array(
 			'user_id' => !empty( $members_template->member->user_id ) ? $members_template->member->user_id : false,
@@ -1194,9 +1190,9 @@ function bp_group_member_demote_link( $user_id = 0 ) {
 	echo bp_get_group_member_demote_link( $user_id );
 }
 	function bp_get_group_member_demote_link( $user_id = 0, $group = false ) {
-		global $members_template, $groups_template, $bp;
+		global $members_template, $groups_template;
 
-		if ( !$group )
+		if ( empty( $group ) )
 			$group =& $groups_template->group;
 
 		if ( !$user_id )
@@ -1214,9 +1210,9 @@ function bp_group_member_ban_link( $user_id = 0 ) {
 	echo bp_get_group_member_ban_link( $user_id );
 }
 	function bp_get_group_member_ban_link( $user_id = 0, $group = false ) {
-		global $members_template, $groups_template, $bp;
+		global $groups_template;
 
-		if ( !$group )
+		if ( empty( $group ) )
 			$group =& $groups_template->group;
 
 		return apply_filters( 'bp_get_group_member_ban_link', wp_nonce_url( bp_get_group_permalink( $group ) . 'admin/manage-members/ban/' . $user_id, 'groups_ban_member' ) );
@@ -1236,7 +1232,7 @@ function bp_group_member_unban_link( $user_id = 0 ) {
 		if ( !$user_id )
 			$user_id = $members_template->member->user_id;
 
-		if ( !$group )
+		if ( empty( $group ) )
 			$group =& $groups_template->group;
 
 		return apply_filters( 'bp_get_group_member_unban_link', wp_nonce_url( bp_get_group_permalink( $group ) . 'admin/manage-members/unban/' . $user_id, 'groups_unban_member' ) );
@@ -1252,9 +1248,9 @@ function bp_group_member_remove_link( $user_id = 0 ) {
 	echo bp_get_group_member_remove_link( $user_id );
 }
 	function bp_get_group_member_remove_link( $user_id = 0, $group = false ) {
-		global $members_template, $groups_template;
+		global $groups_template;
 
-		if ( !$group )
+		if ( empty( $group ) )
 			$group =& $groups_template->group;
 
 		return apply_filters( 'bp_get_group_member_remove_link', wp_nonce_url( bp_get_group_permalink( $group ) . 'admin/manage-members/remove/' . $user_id, 'groups_remove_member' ) );
@@ -1263,34 +1259,40 @@ function bp_group_member_remove_link( $user_id = 0 ) {
 function bp_group_admin_tabs( $group = false ) {
 	global $bp, $groups_template;
 
-	if ( !$group )
+	if ( empty( $group ) )
 		$group = ( $groups_template->group ) ? $groups_template->group : $bp->groups->current_group;
 
-	$current_tab = bp_action_variable( 0 );
-?>
-	<?php if ( $bp->is_item_admin || $bp->is_item_mod ) { ?>
-		<li<?php if ( 'edit-details' == $current_tab || empty( $current_tab ) ) : ?> class="current"<?php endif; ?>><a href="<?php echo bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/' . $group->slug ?>/admin/edit-details"><?php _e( 'Details', 'buddypress' ); ?></a></li>
-	<?php } ?>
+	$current_tab = bp_get_group_current_admin_tab();
 
-	<?php
-		if ( !$bp->is_item_admin )
-			return false;
-	?>
-	<li<?php if ( 'group-settings' == $current_tab ) : ?> class="current"<?php endif; ?>><a href="<?php echo bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/' . $group->slug ?>/admin/group-settings"><?php _e( 'Settings', 'buddypress' ); ?></a></li>
+	if ( bp_is_item_admin() || bp_is_item_mod() ) : ?>
+
+		<li<?php if ( 'edit-details' == $current_tab || empty( $current_tab ) ) : ?> class="current"<?php endif; ?>><a href="<?php echo trailingslashit( bp_get_group_permalink( $group ) . 'admin/edit-details' ) ?>"><?php _e( 'Details', 'buddypress' ); ?></a></li>
+
+	<?php endif; ?>
+
+	<?php if ( ! bp_is_item_admin() )
+			return false; ?>
+
+	<li<?php if ( 'group-settings' == $current_tab ) : ?> class="current"<?php endif; ?>><a href="<?php echo trailingslashit( bp_get_group_permalink( $group ) . 'admin/group-settings' ) ?>"><?php _e( 'Settings', 'buddypress' ); ?></a></li>
 
 	<?php if ( !(int)bp_get_option( 'bp-disable-avatar-uploads' ) ) : ?>
-		<li<?php if ( 'group-avatar'   == $current_tab ) : ?> class="current"<?php endif; ?>><a href="<?php echo bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/' . $group->slug ?>/admin/group-avatar"><?php _e( 'Avatar', 'buddypress' ); ?></a></li>
+
+		<li<?php if ( 'group-avatar'   == $current_tab ) : ?> class="current"<?php endif; ?>><a href="<?php echo trailingslashit( bp_get_group_permalink( $group ) . 'admin/group-avatar' ) ?>"><?php _e( 'Avatar', 'buddypress' ); ?></a></li>
+
 	<?php endif; ?>
 
-	<li<?php if ( 'manage-members' == $current_tab ) : ?> class="current"<?php endif; ?>><a href="<?php echo bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/' . $group->slug ?>/admin/manage-members"><?php _e( 'Members', 'buddypress' ); ?></a></li>
+	<li<?php if ( 'manage-members' == $current_tab ) : ?> class="current"<?php endif; ?>><a href="<?php echo trailingslashit( bp_get_group_permalink( $group ) . 'admin/manage-members' ) ?>"><?php _e( 'Members', 'buddypress' ); ?></a></li>
 
 	<?php if ( $groups_template->group->status == 'private' ) : ?>
-		<li<?php if ( 'membership-requests' == $current_tab ) : ?> class="current"<?php endif; ?>><a href="<?php echo bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/' . $group->slug ?>/admin/membership-requests"><?php _e( 'Requests', 'buddypress' ); ?></a></li>
+
+		<li<?php if ( 'membership-requests' == $current_tab ) : ?> class="current"<?php endif; ?>><a href="<?php echo trailingslashit( bp_get_group_permalink( $group ) . 'admin/membership-requests' ) ?>"><?php _e( 'Requests', 'buddypress' ); ?></a></li>
+
 	<?php endif; ?>
 
 	<?php do_action( 'groups_admin_tabs', $current_tab, $group->slug ) ?>
 
-	<li<?php if ( 'delete-group' == $current_tab ) : ?> class="current"<?php endif; ?>><a href="<?php echo bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/' . $group->slug ?>/admin/delete-group"><?php _e( 'Delete', 'buddypress' ); ?></a></li>
+	<li<?php if ( 'delete-group' == $current_tab ) : ?> class="current"<?php endif; ?>><a href="<?php echo trailingslashit( bp_get_group_permalink( $group ) . 'admin/delete-group' ) ?>"><?php _e( 'Delete', 'buddypress' ); ?></a></li>
+
 <?php
 }
 
@@ -1305,9 +1307,9 @@ function bp_group_form_action( $page ) {
 	echo bp_get_group_form_action( $page );
 }
 	function bp_get_group_form_action( $page, $group = false ) {
-		global $bp, $groups_template;
+		global $groups_template;
 
-		if ( !$group )
+		if ( empty( $group ) )
 			$group =& $groups_template->group;
 
 		return apply_filters( 'bp_group_form_action', bp_get_group_permalink( $group ) . $page );
@@ -1319,10 +1321,10 @@ function bp_group_admin_form_action( $page = false ) {
 	function bp_get_group_admin_form_action( $page = false, $group = false ) {
 		global $groups_template;
 
-		if ( !$group )
+		if ( empty( $group ) )
 			$group =& $groups_template->group;
 
-		if ( !$page )
+		if ( empty( $page ) )
 			$page = bp_action_variable( 0 );
 
 		return apply_filters( 'bp_group_admin_form_action', bp_get_group_permalink( $group ) . 'admin/' . $page );
@@ -1331,7 +1333,7 @@ function bp_group_admin_form_action( $page = false ) {
 function bp_group_has_requested_membership( $group = false ) {
 	global $groups_template;
 
-	if ( !$group )
+	if ( empty( $group ) )
 		$group =& $groups_template->group;
 
 	if ( groups_check_for_membership_request( bp_loggedin_user_id(), $group->id ) )
@@ -1345,22 +1347,21 @@ function bp_group_has_requested_membership( $group = false ) {
  *
  * Checks if current user is member of a group.
  *
- * @uses is_super_admin Check if current user is super admin
+ * @uses bp_current_user_can() Check if current user is super admin
  * @uses apply_filters Creates bp_group_is_member filter and passes $is_member
  * @usedby groups/activity.php, groups/single/forum/edit.php, groups/single/forum/topic.php to determine template part visibility
- * @global array $bp BuddyPress Master global
  * @global object $groups_template Current Group (usually in template loop)
  * @param object $group Group to check is_member
  * @return bool If user is member of group or not
  */
 function bp_group_is_member( $group = false ) {
-	global $bp, $groups_template;
+	global $groups_template;
 
 	// Site admins always have access
-	if ( $bp->loggedin_user->is_super_admin )
+	if ( bp_current_user_can( 'bp_moderate' ) )
 		return true;
 
-	if ( !$group )
+	if ( empty( $group ) )
 		$group =& $groups_template->group;
 
 	return apply_filters( 'bp_group_is_member', !empty( $group->is_member ) );
@@ -1373,21 +1374,20 @@ function bp_group_is_member( $group = false ) {
  * check $groups_template->group->is_banned instead of making another SQL query.
  * However, if used in a single group's pages, we must use groups_is_user_banned().
  *
- * @global object $bp BuddyPress global settings
  * @global BP_Groups_Template $groups_template Group template loop object
  * @param object $group Group to check if user is banned from the group
  * @param int $user_id
  * @return bool If user is banned from the group or not
- * @since 1.5
+ * @since BuddyPress (1.5)
  */
 function bp_group_is_user_banned( $group = false, $user_id = 0 ) {
-	global $bp, $groups_template;
+	global $groups_template;
 
 	// Site admins always have access
-	if ( $bp->loggedin_user->is_super_admin )
+	if ( bp_current_user_can( 'bp_moderate' ) )
 		return false;
 
-	if ( !$group ) {
+	if ( empty( $group ) ) {
 		$group =& $groups_template->group;
 
 		if ( !$user_id && isset( $group->is_banned ) )
@@ -1395,7 +1395,7 @@ function bp_group_is_user_banned( $group = false, $user_id = 0 ) {
 	}
 
 	if ( !$user_id )
-		$user_id = $bp->loggedin_user->id;
+		$user_id = bp_loggedin_user_id();
 
 	return apply_filters( 'bp_group_is_user_banned', groups_is_user_banned( $user_id, $group->id ) );
 }
@@ -1406,10 +1406,10 @@ function bp_group_accept_invite_link() {
 	function bp_get_group_accept_invite_link( $group = false ) {
 		global $groups_template, $bp;
 
-		if ( !$group )
+		if ( empty( $group ) )
 			$group =& $groups_template->group;
 
-		return apply_filters( 'bp_get_group_accept_invite_link', wp_nonce_url( $bp->loggedin_user->domain . bp_get_groups_slug() . '/invites/accept/' . $group->id, 'groups_accept_invite' ) );
+		return apply_filters( 'bp_get_group_accept_invite_link', wp_nonce_url( trailingslashit( bp_loggedin_user_domain() . bp_get_groups_slug() . '/invites/accept/' . $group->id ), 'groups_accept_invite' ) );
 	}
 
 function bp_group_reject_invite_link() {
@@ -1418,19 +1418,19 @@ function bp_group_reject_invite_link() {
 	function bp_get_group_reject_invite_link( $group = false ) {
 		global $groups_template, $bp;
 
-		if ( !$group )
+		if ( empty( $group ) )
 			$group =& $groups_template->group;
 
-		return apply_filters( 'bp_get_group_reject_invite_link', wp_nonce_url( $bp->loggedin_user->domain . bp_get_groups_slug() . '/invites/reject/' . $group->id, 'groups_reject_invite' ) );
+		return apply_filters( 'bp_get_group_reject_invite_link', wp_nonce_url( trailingslashit( bp_loggedin_user_domain() . bp_get_groups_slug() . '/invites/reject/' . $group->id ), 'groups_reject_invite' ) );
 	}
 
 function bp_group_leave_confirm_link() {
 	echo bp_get_group_leave_confirm_link();
 }
 	function bp_get_group_leave_confirm_link( $group = false ) {
-		global $groups_template, $bp;
+		global $groups_template;
 
-		if ( !$group )
+		if ( empty( $group ) )
 			$group =& $groups_template->group;
 
 		return apply_filters( 'bp_group_leave_confirm_link', wp_nonce_url( bp_get_group_permalink( $group ) . 'leave-group/yes', 'groups_leave_group' ) );
@@ -1440,9 +1440,9 @@ function bp_group_leave_reject_link() {
 	echo bp_get_group_leave_reject_link();
 }
 	function bp_get_group_leave_reject_link( $group = false ) {
-		global $groups_template, $bp;
+		global $groups_template;
 
-		if ( !$group )
+		if ( empty( $group ) )
 			$group =& $groups_template->group;
 
 		return apply_filters( 'bp_get_group_leave_reject_link', bp_get_group_permalink( $group ) );
@@ -1452,36 +1452,36 @@ function bp_group_send_invite_form_action() {
 	echo bp_get_group_send_invite_form_action();
 }
 	function bp_get_group_send_invite_form_action( $group = false ) {
-		global $groups_template, $bp;
+		global $groups_template;
 
-		if ( !$group )
+		if ( empty( $group ) )
 			$group =& $groups_template->group;
 
 		return apply_filters( 'bp_group_send_invite_form_action', bp_get_group_permalink( $group ) . 'send-invites/send' );
 	}
 
 function bp_has_friends_to_invite( $group = false ) {
-	global $groups_template, $bp;
+	global $groups_template;
 
 	if ( !bp_is_active( 'friends' ) )
 		return false;
 
-	if ( !$group )
+	if ( empty( $group ) )
 		$group =& $groups_template->group;
 
-	if ( !friends_check_user_has_friends( $bp->loggedin_user->id ) || !friends_count_invitable_friends( $bp->loggedin_user->id, $group->id ) )
+	if ( !friends_check_user_has_friends( bp_loggedin_user_id() ) || !friends_count_invitable_friends( bp_loggedin_user_id(), $group->id ) )
 		return false;
 
 	return true;
 }
 
 function bp_group_new_topic_button( $group = false ) {
-	echo bp_get_group_new_topic_button();
+	echo bp_get_group_new_topic_button( $group );
 }
 	function bp_get_group_new_topic_button( $group = false ) {
 		global $groups_template;
 
-		if ( !$group )
+		if ( empty( $group ) )
 			$group =& $groups_template->group;
 
 		if ( !is_user_logged_in() || bp_group_is_user_banned() || !bp_is_group_forum() || bp_is_group_forum_topic() )
@@ -1508,9 +1508,9 @@ function bp_group_join_button( $group = false ) {
 	echo bp_get_group_join_button( $group );
 }
 	function bp_get_group_join_button( $group = false ) {
-		global $bp, $groups_template;
+		global $groups_template;
 
-		if ( !$group )
+		if ( empty( $group ) )
 			$group =& $groups_template->group;
 
 		if ( !is_user_logged_in() || bp_group_is_user_banned( $group ) )
@@ -1525,7 +1525,7 @@ function bp_group_join_button( $group = false ) {
 
 			// Stop sole admins from abandoning their group
 	 		$group_admins = groups_get_group_admins( $group->id );
-		 	if ( 1 == count( $group_admins ) && $group_admins[0]->user_id == $bp->loggedin_user->id )
+		 	if ( 1 == count( $group_admins ) && $group_admins[0]->user_id == bp_loggedin_user_id() )
 				return false;
 
 			$button = array(
@@ -1606,23 +1606,36 @@ function bp_group_join_button( $group = false ) {
 		return bp_get_button( apply_filters( 'bp_get_group_join_button', $button ) );
 	}
 
-function bp_group_status_message( $group = false ) {
+/**
+ * Prints a message if the group is not visible to the current user (it is a
+ * hidden or private group, and the user does not have access).
+ *
+ * @global BP_Groups_Template $groups_template Groups template object
+ * @param object $group Group to get status message for. Optional; defaults to current group.
+ * @since 1.0
+ */
+function bp_group_status_message( $group = null ) {
 	global $groups_template;
 
-	if ( !$group )
+	if ( ! $group )
 		$group =& $groups_template->group;
 
 	if ( 'private' == $group->status ) {
-		if ( !bp_group_has_requested_membership() )
+ 		if ( ! bp_group_has_requested_membership() ) {
 			if ( is_user_logged_in() )
-				_e( 'This is a private group and you must request group membership in order to join.', 'buddypress' );
+				$message = __( 'This is a private group and you must request group membership in order to join.', 'buddypress' );
 			else
-				_e( 'This is a private group. To join you must be a registered site member and request group membership.', 'buddypress' );
-		else
-			_e( 'This is a private group. Your membership request is awaiting approval from the group administrator.', 'buddypress' );
+				$message = __( 'This is a private group. To join you must be a registered site member and request group membership.', 'buddypress' );
+
+		} else {
+			$message = __( 'This is a private group. Your membership request is awaiting approval from the group administrator.', 'buddypress' );
+		}
+
 	} else {
-		_e( 'This is a hidden group and only invited members can join.', 'buddypress' );
+		$message = __( 'This is a hidden group and only invited members can join.', 'buddypress' );
 	}
+
+	echo apply_filters( 'bp_group_status_message', $message, $group );
 }
 
 function bp_group_hidden_fields() {
@@ -1650,7 +1663,7 @@ function bp_total_group_count_for_user( $user_id = 0 ) {
 	echo bp_get_total_group_count_for_user( $user_id );
 }
 	function bp_get_total_group_count_for_user( $user_id = 0 ) {
-		return apply_filters( 'bp_get_total_group_count_for_user', groups_total_groups_for_user( $user_id ) );
+		return apply_filters( 'bp_get_total_group_count_for_user', groups_total_groups_for_user( $user_id ), $user_id );
 	}
 
 
@@ -1671,22 +1684,16 @@ class BP_Groups_Group_Members_Template {
 	var $pag_links;
 	var $total_group_count;
 
-	function bp_groups_group_members_template( $group_id, $per_page, $max, $exclude_admins_mods, $exclude_banned, $exclude ) {
-		$this->__construct( $group_id, $per_page, $max, $exclude_admins_mods, $exclude_banned, $exclude );
-	}
-
 	function __construct( $group_id, $per_page, $max, $exclude_admins_mods, $exclude_banned, $exclude ) {
-		global $bp;
 
 		$this->pag_page = isset( $_REQUEST['mlpage'] ) ? intval( $_REQUEST['mlpage'] ) : 1;
-		$this->pag_num = isset( $_REQUEST['num'] ) ? intval( $_REQUEST['num'] ) : $per_page;
-
-		$this->members = BP_Groups_Member::get_all_for_group( $group_id, $this->pag_num, $this->pag_page, $exclude_admins_mods, $exclude_banned, $exclude );
+		$this->pag_num  = isset( $_REQUEST['num'] ) ? intval( $_REQUEST['num'] ) : $per_page;
+		$this->members  = BP_Groups_Member::get_all_for_group( $group_id, $this->pag_num, $this->pag_page, $exclude_admins_mods, $exclude_banned, $exclude );
 
-		if ( !$max || $max >= (int)$this->members['count'] )
-			$this->total_member_count = (int)$this->members['count'];
+		if ( !$max || $max >= (int) $this->members['count'] )
+			$this->total_member_count = (int) $this->members['count'];
 		else
-			$this->total_member_count = (int)$max;
+			$this->total_member_count = (int) $max;
 
 		$this->members = $this->members['members'];
 
@@ -1694,7 +1701,7 @@ class BP_Groups_Group_Members_Template {
 			if ( $max >= count($this->members) )
 				$this->member_count = count($this->members);
 			else
-				$this->member_count = (int)$max;
+				$this->member_count = (int) $max;
 		} else {
 			$this->member_count = count($this->members);
 		}
@@ -1702,7 +1709,7 @@ class BP_Groups_Group_Members_Template {
 		$this->pag_links = paginate_links( array(
 			'base' => add_query_arg( 'mlpage', '%#%' ),
 			'format' => '',
-			'total' => ceil( $this->total_member_count / $this->pag_num ),
+			'total' => !empty( $this->pag_num ) ? ceil( $this->total_member_count / $this->pag_num ) : $this->total_member_count,
 			'current' => $this->pag_page,
 			'prev_text' => '&larr;',
 			'next_text' => '&rarr;',
@@ -1745,10 +1752,9 @@ class BP_Groups_Group_Members_Template {
 	}
 
 	function the_member() {
-		global $member;
 
 		$this->in_the_loop = true;
-		$this->member = $this->next_member();
+		$this->member      = $this->next_member();
 
 		if ( 0 == $this->current_member ) // loop has just started
 			do_action('loop_start');
@@ -1756,7 +1762,7 @@ class BP_Groups_Group_Members_Template {
 }
 
 function bp_group_has_members( $args = '' ) {
-	global $bp, $members_template;
+	global $members_template;
 
 	$defaults = array(
 		'group_id' => bp_get_current_group_id(),
@@ -1770,7 +1776,7 @@ function bp_group_has_members( $args = '' ) {
 	$r = wp_parse_args( $args, $defaults );
 	extract( $r, EXTR_SKIP );
 
-	$members_template = new BP_Groups_Group_Members_Template( $group_id, $per_page, $max, (int)$exclude_admins_mods, (int)$exclude_banned, $exclude );
+	$members_template = new BP_Groups_Group_Members_Template( $group_id, $per_page, $max, (int) $exclude_admins_mods, (int) $exclude_banned, $exclude );
 	return apply_filters( 'bp_group_has_members', $members_template->has_members(), $members_template );
 }
 
@@ -1792,7 +1798,7 @@ function bp_group_member_avatar() {
 	function bp_get_group_member_avatar() {
 		global $members_template;
 
-		return apply_filters( 'bp_get_group_member_avatar', bp_core_fetch_avatar( array( 'item_id' => $members_template->member->user_id, 'type' => 'full', 'email' => $members_template->member->user_email, 'alt' => __( 'Profile picture of %s', 'buddypress' ) ) ) );
+		return apply_filters( 'bp_get_group_member_avatar', bp_core_fetch_avatar( array( 'item_id' => $members_template->member->user_id, 'type' => 'full', 'email' => $members_template->member->user_email, 'alt' => sprintf( __( 'Profile picture of %s', 'buddypress' ), $members_template->member->display_name ) ) ) );
 	}
 
 function bp_group_member_avatar_thumb() {
@@ -1801,7 +1807,7 @@ function bp_group_member_avatar_thumb() {
 	function bp_get_group_member_avatar_thumb() {
 		global $members_template;
 
-		return apply_filters( 'bp_get_group_member_avatar_thumb', bp_core_fetch_avatar( array( 'item_id' => $members_template->member->user_id, 'type' => 'thumb', 'email' => $members_template->member->user_email, 'alt' => __( 'Profile picture of %s', 'buddypress' ) ) ) );
+		return apply_filters( 'bp_get_group_member_avatar_thumb', bp_core_fetch_avatar( array( 'item_id' => $members_template->member->user_id, 'type' => 'thumb', 'email' => $members_template->member->user_email, 'alt' => sprintf( __( 'Profile picture of %s', 'buddypress' ), $members_template->member->display_name ) ) ) );
 	}
 
 function bp_group_member_avatar_mini( $width = 30, $height = 30 ) {
@@ -1810,7 +1816,7 @@ function bp_group_member_avatar_mini( $width = 30, $height = 30 ) {
 	function bp_get_group_member_avatar_mini( $width = 30, $height = 30 ) {
 		global $members_template;
 
-		return apply_filters( 'bp_get_group_member_avatar_mini', bp_core_fetch_avatar( array( 'item_id' => $members_template->member->user_id, 'type' => 'thumb', 'width' => $width, 'height' => $height, 'email' => $members_template->member->user_email, 'alt' => __( 'Profile picture of %s', 'buddypress' ) ) ) );
+		return apply_filters( 'bp_get_group_member_avatar_mini', bp_core_fetch_avatar( array( 'item_id' => $members_template->member->user_id, 'type' => 'thumb', 'width' => $width, 'height' => $height, 'email' => $members_template->member->user_email, 'alt' => sprintf( __( 'Profile picture of %s', 'buddypress' ), $members_template->member->display_name ) ) ) );
 	}
 
 function bp_group_member_name() {
@@ -1867,7 +1873,7 @@ function bp_group_member_is_banned() {
 	echo bp_get_group_member_is_banned();
 }
 	function bp_get_group_member_is_banned() {
-		global $members_template, $groups_template;
+		global $members_template;
 
 		return apply_filters( 'bp_get_group_member_is_banned', $members_template->member->is_banned );
 	}
@@ -1910,8 +1916,6 @@ function bp_group_pag_id() {
 	echo bp_get_group_pag_id();
 }
 	function bp_get_group_pag_id() {
-		global $bp;
-
 		return apply_filters( 'bp_get_group_pag_id', 'pag' );
 	}
 
@@ -1957,17 +1961,17 @@ function bp_group_member_admin_pagination() {
  * Determine if the current logged in user can create groups.
  *
  * @package BuddyPress Groups
- * @since 1.5
+ * @since BuddyPress (1.5)
  *
  * @uses apply_filters() To call 'bp_user_can_create_groups'.
  * @uses bp_get_option() To retrieve value of 'bp_restrict_group_creation'. Defaults to 0.
- * @uses is_super_admin() To determine if current user if super admin.
+ * @uses bp_current_user_can() To determine if current user if super admin.
  *
  * @return bool True if user can create groups. False otherwise.
  */
 function bp_user_can_create_groups() {
 	// Super admin can always create groups
-	if ( is_super_admin() )
+	if ( bp_current_user_can( 'bp_moderate' ) )
 		return true;
 
 	// Get group creation option, default to 0 (allowed)
@@ -1989,15 +1993,15 @@ function bp_group_creation_tabs() {
 	if ( !is_array( $bp->groups->group_creation_steps ) )
 		return false;
 
-	if ( !$bp->groups->current_create_step )
+	if ( !bp_get_groups_current_create_step() )
 		$bp->groups->current_create_step = array_shift( array_keys( $bp->groups->group_creation_steps ) );
 
 	$counter = 1;
 
-	foreach ( (array)$bp->groups->group_creation_steps as $slug => $step ) {
+	foreach ( (array) $bp->groups->group_creation_steps as $slug => $step ) {
 		$is_enabled = bp_are_previous_group_creation_steps_complete( $slug ); ?>
 
-		<li<?php if ( $bp->groups->current_create_step == $slug ) : ?> class="current"<?php endif; ?>><?php if ( $is_enabled ) : ?><a href="<?php echo bp_get_root_domain() . '/' . bp_get_groups_root_slug() ?>/create/step/<?php echo $slug ?>/"><?php else: ?><span><?php endif; ?><?php echo $counter ?>. <?php echo $step['name'] ?><?php if ( $is_enabled ) : ?></a><?php else: ?></span><?php endif ?></li><?php
+		<li<?php if ( bp_get_groups_current_create_step() == $slug ) : ?> class="current"<?php endif; ?>><?php if ( $is_enabled ) : ?><a href="<?php echo bp_get_root_domain() . '/' . bp_get_groups_root_slug() ?>/create/step/<?php echo $slug ?>/"><?php else: ?><span><?php endif; ?><?php echo $counter ?>. <?php echo $step['name'] ?><?php if ( $is_enabled ) : ?></a><?php else: ?></span><?php endif ?></li><?php
 		$counter++;
 	}
 
@@ -2009,7 +2013,7 @@ function bp_group_creation_tabs() {
 function bp_group_creation_stage_title() {
 	global $bp;
 
-	echo apply_filters( 'bp_group_creation_stage_title', '<span>&mdash; ' . $bp->groups->group_creation_steps[$bp->groups->current_create_step]['name'] . '</span>' );
+	echo apply_filters( 'bp_group_creation_stage_title', '<span>&mdash; ' . $bp->groups->group_creation_steps[bp_get_groups_current_create_step()]['name'] . '</span>' );
 }
 
 function bp_group_creation_form_action() {
@@ -2021,7 +2025,7 @@ function bp_group_creation_form_action() {
 		if ( !bp_action_variable( 1 ) )
 			$bp->action_variables[1] = array_shift( array_keys( $bp->groups->group_creation_steps ) );
 
-		return apply_filters( 'bp_get_group_creation_form_action', bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/create/step/' . bp_action_variable( 1 ) );
+		return apply_filters( 'bp_get_group_creation_form_action', trailingslashit( bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/create/step/' . bp_action_variable( 1 ) ) );
 	}
 
 function bp_is_group_creation_step( $step_slug ) {
@@ -2057,7 +2061,7 @@ function bp_is_group_creation_step_complete( $step_slugs ) {
 	if ( is_array( $step_slugs ) ) {
 		$found = true;
 
-		foreach ( (array)$step_slugs as $step_slug ) {
+		foreach ( (array) $step_slugs as $step_slug ) {
 			if ( !in_array( $step_slug, $bp->groups->completed_create_steps ) )
 				$found = false;
 		}
@@ -2081,7 +2085,7 @@ function bp_are_previous_group_creation_steps_complete( $step_slug ) {
 	unset( $previous_steps );
 
 	/* Get previous steps */
-	foreach ( (array)$bp->groups->group_creation_steps as $slug => $name ) {
+	foreach ( (array) $bp->groups->group_creation_steps as $slug => $name ) {
 		if ( $slug == $step_slug )
 			break;
 
@@ -2177,7 +2181,7 @@ function bp_group_creation_previous_link() {
 	function bp_get_group_creation_previous_link() {
 		global $bp;
 
-		foreach ( (array)$bp->groups->group_creation_steps as $slug => $name ) {
+		foreach ( (array) $bp->groups->group_creation_steps as $slug => $name ) {
 			if ( bp_is_action_variable( $slug ) )
 				break;
 
@@ -2187,12 +2191,40 @@ function bp_group_creation_previous_link() {
 		return apply_filters( 'bp_get_group_creation_previous_link', trailingslashit( bp_get_root_domain() ) . bp_get_groups_root_slug() . '/create/step/' . array_pop( $previous_steps ) );
 	}
 
+/**
+ * Echoes the current group creation step
+ *
+ * @since 1.6
+ */
+function bp_groups_current_create_step() {
+	echo bp_get_groups_current_create_step();
+}
+	/**
+	 * Returns the current group creation step. If none is found, returns an empty string
+	 *
+	 * @since 1.6
+	 *
+	 * @uses apply_filters() Filter bp_get_groups_current_create_step to modify
+	 * @return str $current_create_step
+	 */
+	function bp_get_groups_current_create_step() {
+		global $bp;
+		
+		if ( !empty( $bp->groups->current_create_step ) ) {
+			$current_create_step = $bp->groups->current_create_step;
+		} else {
+			$current_create_step = '';
+		}
+		
+		return apply_filters( 'bp_get_groups_current_create_step', $current_create_step );
+	}
+
 function bp_is_last_group_creation_step() {
 	global $bp;
 
 	$last_step = array_pop( array_keys( $bp->groups->group_creation_steps ) );
 
-	if ( $last_step == $bp->groups->current_create_step )
+	if ( $last_step == bp_get_groups_current_create_step() )
 		return true;
 
 	return false;
@@ -2203,7 +2235,7 @@ function bp_is_first_group_creation_step() {
 
 	$first_step = array_shift( array_keys( $bp->groups->group_creation_steps ) );
 
-	if ( $first_step == $bp->groups->current_create_step )
+	if ( $first_step == bp_get_groups_current_create_step() )
 		return true;
 
 	return false;
@@ -2229,8 +2261,8 @@ function bp_new_group_invite_friend_list() {
 		if ( empty( $group_id ) )
 			$group_id = !empty( $bp->groups->new_group_id ) ? $bp->groups->new_group_id : $bp->groups->current_group->id;
 
-		if ( $friends = friends_get_friends_invite_list( $bp->loggedin_user->id, $group_id ) ) {
-			$invites = groups_get_invites_for_group( $bp->loggedin_user->id, $group_id );
+		if ( $friends = friends_get_friends_invite_list( bp_loggedin_user_id(), $group_id ) ) {
+			$invites = groups_get_invites_for_group( bp_loggedin_user_id(), $group_id );
 
 			for ( $i = 0, $count = count( $friends ); $i < $count; ++$i ) {
 				$checked = '';
@@ -2245,19 +2277,18 @@ function bp_new_group_invite_friend_list() {
 		}
 
 		if ( !empty( $items ) )
-			return implode( "\n", (array)$items );
+			return implode( "\n", (array) $items );
 
 		return false;
 	}
 
 function bp_directory_groups_search_form() {
-	global $bp;
 
 	$default_search_value = bp_get_search_default_text( 'groups' );
 	$search_value         = !empty( $_REQUEST['s'] ) ? stripslashes( $_REQUEST['s'] ) : $default_search_value; ?>
 
 	<form action="" method="get" id="search-groups-form">
-		<label><input type="text" name="s" id="groups_search" value="<?php echo esc_attr( $search_value ) ?>"  onfocus="if (this.value == '<?php echo $default_search_value ?>') {this.value = '';}" onblur="if (this.value == '') {this.value = '<?php echo $default_search_value ?>';}" /></label>
+		<label><input type="text" name="s" id="groups_search" placeholder="<?php echo esc_attr( $search_value ) ?>" /></label>
 		<input type="submit" id="groups_search_submit" name="groups_search_submit" value="<?php _e( 'Search', 'buddypress' ) ?>" />
 	</form>
 
@@ -2271,14 +2302,15 @@ function bp_directory_groups_search_form() {
  * @todo Deprecate?
  */
 function bp_groups_header_tabs() {
-	global $create_group_step, $completed_to_step;
-?>
-	<li<?php if ( !bp_action_variable( 0 ) || bp_is_action_variable( 'recently-active', 0 ) ) : ?> class="current"<?php endif; ?>><a href="<?php echo $bp->displayed_user->domain . bp_get_groups_slug() ?>/my-groups/recently-active"><?php _e( 'Recently Active', 'buddypress' ) ?></a></li>
-	<li<?php if ( bp_is_action_variable( 'recently-joined', 0 ) ) : ?> class="current"<?php endif; ?>><a href="<?php echo $bp->displayed_user->domain . bp_get_groups_slug() ?>/my-groups/recently-joined"><?php _e( 'Recently Joined', 'buddypress' ) ?></a></li>
-	<li<?php if ( bp_is_action_variable( 'most-popular', 0 ) ) : ?> class="current"<?php endif; ?>><a href="<?php echo $bp->displayed_user->domain . bp_get_groups_slug() ?>/my-groups/most-popular"><?php _e( 'Most Popular', 'buddypress' ) ?></a></li>
-	<li<?php if ( bp_is_action_variable( 'admin-of', 0 ) ) : ?> class="current"<?php endif; ?>><a href="<?php echo $bp->displayed_user->domain . bp_get_groups_slug() ?>/my-groups/admin-of"><?php _e( 'Administrator Of', 'buddypress' ) ?></a></li>
-	<li<?php if ( bp_is_action_variable( 'mod-of', 0 ) ) : ?> class="current"<?php endif; ?>><a href="<?php echo $bp->displayed_user->domain . bp_get_groups_slug() ?>/my-groups/mod-of"><?php _e( 'Moderator Of', 'buddypress' ) ?></a></li>
-	<li<?php if ( bp_is_action_variable( 'alphabetically' ) ) : ?> class="current"<?php endif; ?>><a href="<?php echo $bp->displayed_user->domain . bp_get_groups_slug() ?>/my-groups/alphabetically"><?php _e( 'Alphabetically', 'buddypress' ) ?></a></li>
+	global $bp;?>
+
+	<li<?php if ( !bp_action_variable( 0 ) || bp_is_action_variable( 'recently-active', 0 ) ) : ?> class="current"<?php endif; ?>><a href="<?php echo trailingslashit( bp_displayed_user_domain() . bp_get_groups_slug() . '/my-groups/recently-active' ) ?>"><?php _e( 'Recently Active', 'buddypress' ) ?></a></li>
+	<li<?php if ( bp_is_action_variable( 'recently-joined', 0 ) ) : ?> class="current"<?php endif; ?>><a href="<?php echo trailingslashit( bp_displayed_user_domain() . bp_get_groups_slug() . '/my-groups/recently-joined' ) ?>"><?php _e( 'Recently Joined', 'buddypress' ) ?></a></li>
+	<li<?php if ( bp_is_action_variable( 'most-popular', 0 ) ) : ?> class="current"<?php endif; ?>><a href="<?php echo trailingslashit( bp_displayed_user_domain() . bp_get_groups_slug() . '/my-groups/most-popular' ) ?>"><?php _e( 'Most Popular', 'buddypress' ) ?></a></li>
+	<li<?php if ( bp_is_action_variable( 'admin-of', 0 ) ) : ?> class="current"<?php endif; ?>><a href="<?php echo trailingslashit( bp_displayed_user_domain() . bp_get_groups_slug() . '/my-groups/admin-of' ) ?>"><?php _e( 'Administrator Of', 'buddypress' ) ?></a></li>
+	<li<?php if ( bp_is_action_variable( 'mod-of', 0 ) ) : ?> class="current"<?php endif; ?>><a href="<?php echo trailingslashit( bp_displayed_user_domain() . bp_get_groups_slug() . '/my-groups/mod-of' ) ?>"><?php _e( 'Moderator Of', 'buddypress' ) ?></a></li>
+	<li<?php if ( bp_is_action_variable( 'alphabetically' ) ) : ?> class="current"<?php endif; ?>><a href="<?php echo trailingslashit( bp_displayed_user_domain() . bp_get_groups_slug() . '/my-groups/alphabetically' ) ?>"><?php _e( 'Alphabetically', 'buddypress' ) ?></a></li>
+
 <?php
 	do_action( 'groups_header_tabs' );
 }
@@ -2325,6 +2357,32 @@ function bp_is_group_admin_screen( $slug ) {
 	return false;
 }
 
+/**
+ * Echoes the current group admin tab slug
+ *
+ * @since 1.6
+ */
+function bp_group_current_admin_tab() {
+	echo bp_get_group_current_admin_tab();
+}
+	/**
+	 * Returns the current group admin tab slug
+	 *
+	 * @since 1.6
+	 *
+	 * @uses apply_filters() Filter bp_get_current_group_admin_tab to modify return value
+	 * @return str $tab The current tab's slug
+	 */
+	function bp_get_group_current_admin_tab() {
+		if ( bp_is_groups_component() && bp_is_current_action( 'admin' ) ) {
+			$tab = bp_action_variable( 0 );
+		} else {
+			$tab = '';
+		}
+		
+		return apply_filters( 'bp_get_current_group_admin_tab', $tab );
+	}
+
 /************************************************************************************
  * Group Avatar Template Tags
  **/
@@ -2358,7 +2416,7 @@ function bp_group_avatar_delete_link() {
 	function bp_get_group_avatar_delete_link() {
 		global $bp;
 
-		return apply_filters( 'bp_get_group_avatar_delete_link', wp_nonce_url( bp_get_group_permalink( $bp->groups->current_group ) . '/admin/group-avatar/delete', 'bp_group_avatar_delete' ) );
+		return apply_filters( 'bp_get_group_avatar_delete_link', wp_nonce_url( bp_get_group_permalink( $bp->groups->current_group ) . 'admin/group-avatar/delete', 'bp_group_avatar_delete' ) );
 	}
 
 function bp_group_avatar_edit_form() {
@@ -2399,24 +2457,16 @@ class BP_Groups_Membership_Requests_Template {
 	var $pag_links;
 	var $total_request_count;
 
-	function bp_groups_membership_requests_template( $group_id, $per_page, $max ) {
-		$this->__construct( $group_id, $per_page, $max );
-	}
-
-
 	function __construct( $group_id, $per_page, $max ) {
 
-		global $bp;
-
 		$this->pag_page = isset( $_REQUEST['mrpage'] ) ? intval( $_REQUEST['mrpage'] ) : 1;
-		$this->pag_num = isset( $_REQUEST['num'] ) ? intval( $_REQUEST['num'] ) : $per_page;
-
+		$this->pag_num  = isset( $_REQUEST['num'] ) ? intval( $_REQUEST['num'] ) : $per_page;
 		$this->requests = BP_Groups_Group::get_membership_requests( $group_id, $this->pag_num, $this->pag_page );
 
-		if ( !$max || $max >= (int)$this->requests['total'] )
-			$this->total_request_count = (int)$this->requests['total'];
+		if ( !$max || $max >= (int) $this->requests['total'] )
+			$this->total_request_count = (int) $this->requests['total'];
 		else
-			$this->total_request_count = (int)$max;
+			$this->total_request_count = (int) $max;
 
 		$this->requests = $this->requests['requests'];
 
@@ -2424,7 +2474,7 @@ class BP_Groups_Membership_Requests_Template {
 			if ( $max >= count($this->requests) )
 				$this->request_count = count($this->requests);
 			else
-				$this->request_count = (int)$max;
+				$this->request_count = (int) $max;
 		} else {
 			$this->request_count = count($this->requests);
 		}
@@ -2475,10 +2525,8 @@ class BP_Groups_Membership_Requests_Template {
 	}
 
 	function the_request() {
-		global $request;
-
 		$this->in_the_loop = true;
-		$this->request = $this->next_request();
+		$this->request     = $this->next_request();
 
 		if ( 0 == $this->current_request ) // loop has just started
 			do_action('group_request_loop_start');
@@ -2516,7 +2564,7 @@ function bp_group_the_membership_request() {
 function bp_group_request_user_avatar_thumb() {
 	global $requests_template;
 
-	echo apply_filters( 'bp_group_request_user_avatar_thumb', bp_core_fetch_avatar( array( 'item_id' => $requests_template->request->user_id, 'type' => 'thumb', 'alt' => __( 'Profile picture of %s', 'buddypress' ) ) ) );
+	echo apply_filters( 'bp_group_request_user_avatar_thumb', bp_core_fetch_avatar( array( 'item_id' => $requests_template->request->user_id, 'type' => 'thumb', 'alt' => sprintf( __( 'Profile picture of %s', 'buddypress' ), bp_core_get_user_displayname( $requests_template->request->user_id ) ) ) ) );
 }
 
 function bp_group_request_reject_link() {
@@ -2525,7 +2573,7 @@ function bp_group_request_reject_link() {
 	function bp_get_group_request_reject_link() {
 		global $requests_template, $groups_template;
 
-		return apply_filters( 'bp_get_group_request_reject_link', wp_nonce_url( bp_get_group_permalink( $groups_template->group ) . '/admin/membership-requests/reject/' . $requests_template->request->id, 'groups_reject_membership_request' ) );
+		return apply_filters( 'bp_get_group_request_reject_link', wp_nonce_url( bp_get_group_permalink( $groups_template->group ) . 'admin/membership-requests/reject/' . $requests_template->request->id, 'groups_reject_membership_request' ) );
 	}
 
 function bp_group_request_accept_link() {
@@ -2534,7 +2582,7 @@ function bp_group_request_accept_link() {
 	function bp_get_group_request_accept_link() {
 		global $requests_template, $groups_template;
 
-		return apply_filters( 'bp_get_group_request_accept_link', wp_nonce_url( bp_get_group_permalink( $groups_template->group ) . '/admin/membership-requests/accept/' . $requests_template->request->id, 'groups_accept_membership_request' ) );
+		return apply_filters( 'bp_get_group_request_accept_link', wp_nonce_url( bp_get_group_permalink( $groups_template->group ) . 'admin/membership-requests/accept/' . $requests_template->request->id, 'groups_accept_membership_request' ) );
 	}
 
 function bp_group_request_user_link() {
@@ -2575,17 +2623,9 @@ class BP_Groups_Invite_Template {
 	var $pag_links;
 	var $total_invite_count;
 
-	function bp_groups_invite_template( $user_id, $group_id ) {
-		$this->__construct( $user_id, $group_id );
-	}
-
 	function __construct( $user_id, $group_id ) {
-
-		global $bp;
-
-		$this->invites = groups_get_invites_for_group( $user_id, $group_id );
+		$this->invites      = groups_get_invites_for_group( $user_id, $group_id );
 		$this->invite_count = count( $this->invites );
-
 	}
 
 	function has_invites() {
@@ -2622,13 +2662,12 @@ class BP_Groups_Invite_Template {
 	}
 
 	function the_invite() {
-		global $invite, $group_id;
-
-		$this->in_the_loop = true;
-		$user_id = $this->next_invite();
+		global $group_id;
 
-		$this->invite = new stdClass;
-		$this->invite->user = new BP_Core_User( $user_id );
+		$this->in_the_loop      = true;
+		$user_id                = $this->next_invite();
+		$this->invite           = new stdClass;
+		$this->invite->user     = new BP_Core_User( $user_id );
 		$this->invite->group_id = $group_id; // Globaled in bp_group_has_invites()
 
 		if ( 0 == $this->current_invite ) // loop has just started
@@ -2641,7 +2680,7 @@ function bp_group_has_invites( $args = '' ) {
 
 	$defaults = array(
 		'group_id' => false,
-		'user_id' => $bp->loggedin_user->id
+		'user_id' => bp_loggedin_user_id()
 	);
 
 	$r = wp_parse_args( $args, $defaults );
@@ -2727,7 +2766,7 @@ function bp_group_invite_user_remove_invite_url() {
 /**
  * Hook group activity feed to <head>
  *
- * @since 1.5
+ * @since BuddyPress (1.5)
  */
 function bp_groups_activity_feed() {
 	if ( !bp_is_active( 'groups' ) || !bp_is_active( 'activity' ) || !bp_is_group() )
@@ -2752,7 +2791,7 @@ function bp_group_activity_feed_link() {
  * Echoes the output of bp_get_current_group_id()
  *
  * @package BuddyPress
- * @since 1.5
+ * @since BuddyPress (1.5)
  */
 function bp_current_group_id() {
 	echo bp_get_current_group_id();
@@ -2761,7 +2800,7 @@ function bp_current_group_id() {
 	 * Returns the ID of the current group
 	 *
 	 * @package BuddyPress
-	 * @since 1.5
+	 * @since BuddyPress (1.5)
 	 * @uses apply_filters() Filter bp_get_current_group_id to modify this output
 	 *
 	 * @return int $current_group_id The id of the current group, if there is one
@@ -2769,7 +2808,7 @@ function bp_current_group_id() {
 	function bp_get_current_group_id() {
 		$current_group = groups_get_current_group();
 
-		$current_group_id = isset( $current_group->id ) ? (int)$current_group->id : 0;
+		$current_group_id = isset( $current_group->id ) ? (int) $current_group->id : 0;
 
 		return apply_filters( 'bp_get_current_group_id', $current_group_id, $current_group );
 	}
@@ -2778,7 +2817,7 @@ function bp_current_group_id() {
  * Echoes the output of bp_get_current_group_slug()
  *
  * @package BuddyPress
- * @since 1.5
+ * @since BuddyPress (1.5)
  */
 function bp_current_group_slug() {
 	echo bp_get_current_group_slug();
@@ -2787,7 +2826,7 @@ function bp_current_group_slug() {
 	 * Returns the slug of the current group
 	 *
 	 * @package BuddyPress
-	 * @since 1.5
+	 * @since BuddyPress (1.5)
 	 * @uses apply_filters() Filter bp_get_current_group_slug to modify this output
 	 *
 	 * @return str $current_group_slug The slug of the current group, if there is one
@@ -2812,7 +2851,7 @@ function bp_current_group_name() {
 	 * Returns the name of the current group
 	 *
 	 * @package BuddyPress
-	 * @since 1.5
+	 * @since BuddyPress (1.5)
 	 * @uses apply_filters() Filter bp_get_current_group_name to modify this output
 	 *
 	 * @return str The name of the current group, if there is one
@@ -2830,15 +2869,15 @@ function bp_groups_action_link( $action = '', $query_args = '', $nonce = false )
 	function bp_get_groups_action_link( $action = '', $query_args = '', $nonce = false ) {
 		global $bp;
 
-		// Must be displayed user
+		// Must be a group
 		if ( empty( $bp->groups->current_group->id ) )
 			return;
 
-		// Append $action to $url if there is no $type
+		// Append $action to $url if provided
 		if ( !empty( $action ) )
-			$url = bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/' . $bp->groups->current_group->slug . '/' . $action;
+			$url = bp_get_group_permalink( groups_get_current_group() ) . $action;
 		else
-			$url = bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/' . $bp->groups->current_group->slug;
+			$url = bp_get_group_permalink( groups_get_current_group() );
 
 		// Add a slash at the end of our user url
 		$url = trailingslashit( $url );
diff --git a/wp-content/plugins/buddypress/bp-groups/bp-groups-widgets.php b/wp-content/plugins/buddypress/bp-groups/bp-groups-widgets.php
index 2ceaef6370a9ff9ce66089469ca2fe9f61c3abdf..d2765db0408aaab8998fed34ff10dc9893668259 100644
--- a/wp-content/plugins/buddypress/bp-groups/bp-groups-widgets.php
+++ b/wp-content/plugins/buddypress/bp-groups/bp-groups-widgets.php
@@ -1,4 +1,12 @@
 <?php
+
+/**
+ * BuddyPress Groups Widgets
+ *
+ * @package BuddyPress
+ * @subpackage GroupsWidgets
+ */
+
 // Exit if accessed directly
 if ( !defined( 'ABSPATH' ) ) exit;
 
@@ -20,16 +28,15 @@ class BP_Groups_Widget extends WP_Widget {
 		parent::__construct( false, __( 'Groups', 'buddypress' ), $widget_ops );
 
 		if ( is_active_widget( false, false, $this->id_base ) && !is_admin() && !is_network_admin() ) {
-			if ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG )
-				wp_enqueue_script( 'groups_widget_groups_list-js', BP_PLUGIN_URL . '/bp-groups/js/widget-groups.dev.js', array( 'jquery' ) );
-			else
-				wp_enqueue_script( 'groups_widget_groups_list-js', BP_PLUGIN_URL . '/bp-groups/js/widget-groups.js', array( 'jquery' ) );
+			if ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) {
+				wp_enqueue_script( 'groups_widget_groups_list-js', BP_PLUGIN_URL . 'bp-groups/js/widget-groups.dev.js', array( 'jquery' ), bp_get_version() );
+			} else {
+				wp_enqueue_script( 'groups_widget_groups_list-js', BP_PLUGIN_URL . 'bp-groups/js/widget-groups.js', array( 'jquery' ),     bp_get_version() );
+			}
 		}
 	}
 
 	function widget( $args, $instance ) {
-		global $bp;
-
 		$user_id = apply_filters( 'bp_group_widget_user_id', '0' );
 
 		extract( $args );
@@ -41,8 +48,11 @@ class BP_Groups_Widget extends WP_Widget {
 			$instance['title'] = __( 'Groups', 'buddypress' );
 
 		echo $before_widget;
+		
+		$title = $instance['link_title'] ? '<a href="' . trailingslashit( bp_get_root_domain() . '/' . bp_get_groups_root_slug() ) . '">' . $instance['title'] . '</a>' : $instance['title'];
+		
 		echo $before_title
-		   . $instance['title']
+		   . $title
 		   . $after_title; ?>
 
 		<?php if ( bp_has_groups( 'user_id=' . $user_id . '&type=' . $instance['group_default'] . '&max=' . $instance['max_groups'] ) ) : ?>
@@ -95,9 +105,11 @@ class BP_Groups_Widget extends WP_Widget {
 
 	function update( $new_instance, $old_instance ) {
 		$instance = $old_instance;
-		$instance['title'] = strip_tags( $new_instance['title'] );
-		$instance['max_groups'] = strip_tags( $new_instance['max_groups'] );
+		
+		$instance['title']         = strip_tags( $new_instance['title'] );
+		$instance['max_groups']    = strip_tags( $new_instance['max_groups'] );
 		$instance['group_default'] = strip_tags( $new_instance['group_default'] );
+		$instance['link_title']    = (bool)$new_instance['link_title'];
 
 		return $instance;
 	}
@@ -106,16 +118,20 @@ class BP_Groups_Widget extends WP_Widget {
 		$defaults = array(
 			'title'         => __( 'Groups', 'buddypress' ),
 			'max_groups'    => 5,
-			'group_default' => 'active'
+			'group_default' => 'active',
+			'link_title'    => false
 		);
 		$instance = wp_parse_args( (array) $instance, $defaults );
 
-		$title = strip_tags( $instance['title'] );
-		$max_groups = strip_tags( $instance['max_groups'] );
+		$title 	       = strip_tags( $instance['title'] );
+		$max_groups    = strip_tags( $instance['max_groups'] );
 		$group_default = strip_tags( $instance['group_default'] );
+		$link_title    = (bool)$instance['link_title'];
 		?>
 
 		<p><label for="bp-groups-widget-title"><?php _e('Title:', 'buddypress'); ?> <input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" type="text" value="<?php echo esc_attr( $title ); ?>" style="width: 100%" /></label></p>
+		
+		<p><label for="<?php echo $this->get_field_name('link_title') ?>"><input type="checkbox" name="<?php echo $this->get_field_name('link_title') ?>" value="1" <?php checked( $link_title ) ?> /> <?php _e( 'Link widget title to Groups directory', 'buddypress' ) ?></label></p>
 
 		<p><label for="bp-groups-widget-groups-max"><?php _e('Max groups to show:', 'buddypress'); ?> <input class="widefat" id="<?php echo $this->get_field_id( 'max_groups' ); ?>" name="<?php echo $this->get_field_name( 'max_groups' ); ?>" type="text" value="<?php echo esc_attr( $max_groups ); ?>" style="width: 30%" /></label></p>
 
@@ -133,7 +149,6 @@ class BP_Groups_Widget extends WP_Widget {
 }
 
 function groups_ajax_widget_groups_list() {
-	global $bp;
 
 	check_ajax_referer('groups_widget_groups_list');
 
@@ -190,4 +205,6 @@ function groups_ajax_widget_groups_list() {
 
 }
 add_action( 'wp_ajax_widget_groups_list', 'groups_ajax_widget_groups_list' );
-?>
\ No newline at end of file
+add_action( 'wp_ajax_nopriv_widget_groups_list', 'groups_ajax_widget_groups_list' );
+
+?>
diff --git a/wp-content/plugins/buddypress/bp-languages/buddypress.pot b/wp-content/plugins/buddypress/bp-languages/buddypress.pot
index 36c46b55d220de37e49e4d0048e50bb2dafdf7ec..e12df5dd18e641d22e488185e8601624e9694dea 100644
--- a/wp-content/plugins/buddypress/bp-languages/buddypress.pot
+++ b/wp-content/plugins/buddypress/bp-languages/buddypress.pot
@@ -1,4342 +1,4321 @@
-# Copyright (C) 2010 BuddyPress
+# Copyright (C) 2012 BuddyPress
 # This file is distributed under the same license as the BuddyPress package.
 msgid ""
 msgstr ""
 "Project-Id-Version: BuddyPress \n"
-"Report-Msgid-Bugs-To: wp-polyglots@lists.automattic.com\n"
-"POT-Creation-Date: 2011-12-23 20:31:22+00:00\n"
+"Report-Msgid-Bugs-To: http://wppolyglots.wordpress.com\n"
+"POT-Creation-Date: 2012-12-10 06:36:53+00:00\n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=UTF-8\n"
 "Content-Transfer-Encoding: 8bit\n"
-"PO-Revision-Date: 2010-MO-DA HO:MI+ZONE\n"
+"PO-Revision-Date: 2012-MO-DA HO:MI+ZONE\n"
 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
 "Language-Team: LANGUAGE <LL@li.org>\n"
 
-#: bp-blogs/bp-blogs-loader.php:24 bp-core/admin/bp-core-admin.php:370
-msgid "Site Tracking"
+#: bp-activity/bp-activity-actions.php:158
+msgid "Activity deleted successfully"
 msgstr ""
 
-#: bp-blogs/bp-blogs-loader.php:58
-msgid "Search sites..."
+#: bp-activity/bp-activity-actions.php:160
+msgid "There was an error when deleting that activity"
 msgstr ""
 
-#: bp-blogs/bp-blogs-loader.php:108
-msgid "Sites <span>%d</span>"
+#: bp-activity/bp-activity-actions.php:214
+msgid "The activity item has been marked as spam and is no longer visible."
 msgstr ""
 
-#: bp-blogs/bp-blogs-loader.php:148 bp-core/admin/bp-core-update.php:501
-msgid "Sites"
+#: bp-activity/bp-activity-actions.php:263
+#: bp-themes/bp-default/_inc/ajax.php:263
+msgid "Please enter some content to post."
 msgstr ""
 
-#: bp-blogs/bp-blogs-loader.php:156 bp-blogs/bp-blogs-loader.php:177
-#: bp-blogs/bp-blogs-buddybar.php:25 bp-core/bp-core-adminbar.php:121
-msgid "My Sites"
+#: bp-activity/bp-activity-actions.php:284
+msgid "Update Posted!"
 msgstr ""
 
-#: bp-blogs/bp-blogs-activity.php:17
-msgid "New site created"
+#: bp-activity/bp-activity-actions.php:286
+msgid "There was an error when posting your update, please try again."
 msgstr ""
 
-#: bp-blogs/bp-blogs-activity.php:18
-msgid "New post published"
+#: bp-activity/bp-activity-actions.php:323
+#: bp-themes/bp-default/_inc/ajax.php:311
+msgid "Please do not leave the comment area blank."
 msgstr ""
 
-#: bp-blogs/bp-blogs-activity.php:19
-msgid "New post comment posted"
+#: bp-activity/bp-activity-actions.php:334
+msgid "Reply Posted!"
 msgstr ""
 
-#: bp-blogs/bp-blogs-buddybar.php:37 bp-core/bp-core-adminbar.php:133
-#: bp-core/bp-core-buddybar.php:481
-msgid "Dashboard"
+#: bp-activity/bp-activity-actions.php:336
+#: bp-themes/bp-default/_inc/ajax.php:314
+#: bp-themes/bp-default/_inc/ajax.php:323
+msgid "There was an error posting that reply, please try again."
 msgstr ""
 
-#: bp-blogs/bp-blogs-buddybar.php:38 bp-core/bp-core-adminbar.php:136
-#: bp-core/bp-core-buddybar.php:485
-msgid "New Post"
+#: bp-activity/bp-activity-actions.php:368
+msgid "Activity marked as favorite."
 msgstr ""
 
-#: bp-blogs/bp-blogs-buddybar.php:39 bp-core/bp-core-buddybar.php:486
-msgid "Manage Posts"
+#: bp-activity/bp-activity-actions.php:370
+msgid "There was an error marking that activity as a favorite, please try again."
 msgstr ""
 
-#: bp-blogs/bp-blogs-buddybar.php:40 bp-core/bp-core-adminbar.php:137
-#: bp-core/bp-core-buddybar.php:487
-msgid "Manage Comments"
+#: bp-activity/bp-activity-actions.php:402
+msgid "Activity removed as favorite."
 msgstr ""
 
-#: bp-blogs/bp-blogs-buddybar.php:53
-msgid "Create a Site!"
+#: bp-activity/bp-activity-actions.php:404
+msgid "There was an error removing that activity as a favorite, please try again."
 msgstr ""
 
-#: bp-blogs/bp-blogs-template.php:135
-msgctxt "Blog pagination previous text"
-msgid "&larr;"
-msgstr ""
+#. translators: Personal activity RSS title - "[Site Name] | [Displayed User
+#. Name] | Activity"
 
-#: bp-blogs/bp-blogs-template.php:136
-msgctxt "Blog pagination next text"
-msgid "&rarr;"
+#: bp-activity/bp-activity-admin.php:34 bp-activity/bp-activity-admin.php:835
+#: bp-activity/bp-activity-admin.php:1145
+#: bp-activity/bp-activity-loader.php:118
+#: bp-activity/bp-activity-loader.php:241
+#: bp-activity/bp-activity-screens.php:278
+#: bp-activity/feeds/bp-activity-personal-feed.php:28
+#: bp-core/admin/bp-core-update.php:391
+msgid "Activity"
 msgstr ""
 
-#: bp-blogs/bp-blogs-template.php:258
-msgid "Viewing site %1$s to %2$s (of %3$s sites)"
+#: bp-activity/bp-activity-admin.php:64
+msgid "ERROR: Please type a reply."
 msgstr ""
 
-#: bp-blogs/bp-blogs-template.php:282 bp-activity/bp-activity-template.php:1000
-msgid "Site authored by %s"
+#: bp-activity/bp-activity-admin.php:69
+msgid "ERROR: The item you are trying to reply to cannot be found, or it has been deleted."
 msgstr ""
 
-#: bp-blogs/bp-blogs-template.php:345 bp-core/bp-core-classes.php:175
-#: bp-groups/bp-groups-widgets.php:70 bp-groups/bp-groups-widgets.php:170
-#: bp-members/bp-members-template.php:559
-#: bp-members/bp-members-template.php:833
-#: bp-themes/bp-default/groups/groups-loop.php:47
-#: bp-themes/bp-default/groups/single/group-header.php:42
-msgid "active %s"
+#: bp-activity/bp-activity-admin.php:177 bp-activity/bp-activity-admin.php:224
+msgid "Overview"
 msgstr ""
 
-#: bp-blogs/bp-blogs-template.php:357
-msgid "Latest Post: %s"
+#: bp-activity/bp-activity-admin.php:179
+msgid "You edit activities made on your site similar to the way you edit a comment. This is useful if you need to change which page the activity links to, or when you notice that the author has made a typographical error."
 msgstr ""
 
-#: bp-blogs/bp-blogs-template.php:421
-msgid "There was a problem, please correct the form below and try again."
+#: bp-activity/bp-activity-admin.php:180
+msgid "The two big editing areas for the activity title and content are fixed in place, but you can reposition all the other boxes using drag and drop, and can minimize or expand them by clicking the title bar of each box. Use the Screen Options tab to unhide more boxes (Primary Item/Secondary Item, Link, Type, Author ID) or to choose a 1- or 2-column layout for this screen."
 msgstr ""
 
-#: bp-blogs/bp-blogs-template.php:424
-msgid "By filling out the form below, you can <strong>add a site to your account</strong>. There is no limit to the number of sites that you can have, so create to your heart's content, but blog responsibly!"
+#: bp-activity/bp-activity-admin.php:181
+msgid "You can also moderate the activity from this screen using the Status box, where you can also change the timestamp of the activity."
 msgstr ""
 
-#: bp-blogs/bp-blogs-template.php:426
-msgid "If you&#8217;re not going to use a great domain, leave it for a new user. Now have at it!"
+#: bp-activity/bp-activity-admin.php:186
+msgid "Item, Link, Type"
 msgstr ""
 
-#: bp-blogs/bp-blogs-template.php:435
-msgid "Create Site"
+#: bp-activity/bp-activity-admin.php:188
+msgid "<strong>Primary Item/Secondary Item</strong> - These identify the object that created the activity. For example, the fields could reference a comment left on a specific site. Some types of activity may only use one, or none, of these fields."
 msgstr ""
 
-#: bp-blogs/bp-blogs-template.php:449
-msgid "Site Name:"
+#: bp-activity/bp-activity-admin.php:189
+msgid "<strong>Link</strong> - Activity generated by blog posts and comments, forum topics and replies, and some plugins, uses the link field for a permalink back to the content item. Some types of activity may not use this field, even if it has been set."
 msgstr ""
 
-#: bp-blogs/bp-blogs-template.php:451
-msgid "Site Domain:"
+#: bp-activity/bp-activity-admin.php:190
+msgid "<strong>Type</strong> - Each distinct kind of activity has its own type. For example, <code>created_group</code> is used when a group is created and <code>joined_group</code> is used when a user joins a group."
 msgstr ""
 
-#: bp-blogs/bp-blogs-template.php:465
-msgid "Your address will be "
+#: bp-activity/bp-activity-admin.php:191
+msgid "For information about when and how BuddyPress uses all of these settings, see the Managing Activity link in the panel to the side."
 msgstr ""
 
-#: bp-blogs/bp-blogs-template.php:468
-msgid "blogname"
+#: bp-activity/bp-activity-admin.php:196 bp-activity/bp-activity-admin.php:241
+msgid "For more information:"
 msgstr ""
 
-#: bp-blogs/bp-blogs-template.php:470
-msgid "domain."
+#: bp-activity/bp-activity-admin.php:197
+msgid "<a href=\"http://codex.buddypress.org/buddypress-site-administration/managing-activity/\">Managing Activity</a>"
 msgstr ""
 
-#: bp-blogs/bp-blogs-template.php:473
-msgid "Must be at least 4 characters, letters and numbers only. It cannot be changed so choose carefully!)"
+#: bp-activity/bp-activity-admin.php:198 bp-activity/bp-activity-admin.php:242
+msgid "<a href=\"http://buddypress.org/support/\">Support Forums</a>"
 msgstr ""
 
-#: bp-blogs/bp-blogs-template.php:479
-msgid "Site Title:"
+#: bp-activity/bp-activity-admin.php:202
+msgctxt "activity admin edit screen"
+msgid "Status"
 msgstr ""
 
-#: bp-blogs/bp-blogs-template.php:490
-msgid "Privacy:"
+#: bp-activity/bp-activity-admin.php:203
+msgctxt "activity admin edit screen"
+msgid "Primary Item/Secondary Item"
 msgstr ""
 
-#: bp-blogs/bp-blogs-template.php:491
-#: bp-themes/bp-default/registration/register.php:202
-msgid "I would like my site to appear in search engines, and in public listings around this network."
+#: bp-activity/bp-activity-admin.php:204
+msgctxt "activity admin edit screen"
+msgid "Link"
 msgstr ""
 
-#: bp-blogs/bp-blogs-template.php:495 bp-core/admin/bp-core-admin.php:111
-#: bp-core/admin/bp-core-admin.php:121 bp-core/admin/bp-core-admin.php:129
-#: bp-core/admin/bp-core-admin.php:137 bp-core/admin/bp-core-admin.php:147
-#: bp-core/admin/bp-core-admin.php:159 bp-friends/bp-friends-screens.php:69
-#: bp-groups/bp-groups-screens.php:832 bp-messages/bp-messages-screens.php:150
-#: bp-themes/bp-default/registration/register.php:205
-#: bp-themes/bp-default/groups/single/admin.php:26
-#: bp-activity/bp-activity-screens.php:281
-msgid "Yes"
+#: bp-activity/bp-activity-admin.php:205
+msgctxt "activity admin edit screen"
+msgid "Type"
 msgstr ""
 
-#: bp-blogs/bp-blogs-template.php:499 bp-core/admin/bp-core-admin.php:112
-#: bp-core/admin/bp-core-admin.php:122 bp-core/admin/bp-core-admin.php:130
-#: bp-core/admin/bp-core-admin.php:138 bp-core/admin/bp-core-admin.php:148
-#: bp-core/admin/bp-core-admin.php:160 bp-friends/bp-friends-screens.php:70
-#: bp-groups/bp-groups-screens.php:833 bp-messages/bp-messages-screens.php:151
-#: bp-themes/bp-default/registration/register.php:206
-#: bp-themes/bp-default/groups/single/admin.php:27
-#: bp-activity/bp-activity-screens.php:282
-msgid "No"
+#: bp-activity/bp-activity-admin.php:206
+msgctxt "activity admin edit screen"
+msgid "Author ID"
 msgstr ""
 
-#: bp-blogs/bp-blogs-template.php:574
-msgid "Congratulations! You have successfully registered a new site."
+#: bp-activity/bp-activity-admin.php:219
+msgctxt "Activity items per page (screen options)"
+msgid "Activity"
 msgstr ""
 
-#: bp-blogs/bp-blogs-template.php:576
-msgid "<a href=\"%1$s\">%2$s</a> is your new site.  <a href=\"%3$s\">Login</a> as \"%4$s\" using your existing password."
+#: bp-activity/bp-activity-admin.php:226
+msgid "You can manage activities made on your site similar to the way you manage comments and other content. This screen is customizable in the same ways as other management screens, and you can act on activities using the on-hover action links or the Bulk Actions."
 msgstr ""
 
-#: bp-blogs/bp-blogs-template.php:587 bp-core/bp-core-filters.php:320
-#: bp-themes/bp-default/blogs/index.php:23
-#: bp-themes/bp-default/blogs/create.php:21
-msgid "Create a Site"
+#: bp-activity/bp-activity-admin.php:227
+msgid "There are many different types of activities. Some are generated automatically by BuddyPress and other plugins, and some are entered directly by a user in the form of status update. To help manage the different activity types, use the filter dropdown box to switch between them."
 msgstr ""
 
-#: bp-blogs/bp-blogs-template.php:600
-msgid "%s's Sites"
+#: bp-activity/bp-activity-admin.php:233
+msgid "Moderating Activity"
 msgstr ""
 
-#: bp-blogs/bp-blogs-template.php:601
-msgid "%s's Recent Posts"
+#: bp-activity/bp-activity-admin.php:235
+msgid "In the <strong>Activity</strong> column, above each activity it says &#8220;Submitted on,&#8221; followed by the date and time the activity item was generated on your site. Clicking on the date/time link will take you to that activity on your live site. Hovering over any activity gives you options to reply, edit, spam mark, or delete that activity."
 msgstr ""
 
-#: bp-blogs/bp-blogs-template.php:602
-msgid "%s's Recent Comments"
+#: bp-activity/bp-activity-admin.php:236
+msgid "In the <strong>In Response To</strong> column, if the activity was in reply to another activity, it shows that activity's author's picture and name, and a link to that activity on your live site. If there is a small bubble, the number in it shows how many other activities are related to this one; these are usually comments. Clicking the bubble will filter the activity screen to show only related activity items."
 msgstr ""
 
-#: bp-blogs/bp-blogs-template.php:617 bp-core/deprecated/1.5.php:396
-#: bp-groups/bp-groups-template.php:2261 bp-forums/bp-forums-template.php:1313
-#: bp-members/bp-members-template.php:674 bp-themes/bp-default/header.php:35
-#: bp-themes/bp-default/searchform.php:5
-msgid "Search"
+#: bp-activity/bp-activity-admin.php:564
+msgid "Editing Activity (ID #%s)"
 msgstr ""
 
-#: bp-blogs/bp-blogs-template.php:650 bp-blogs/bp-blogs-template.php:651
-#: bp-core/bp-core-adminbar.php:140
-msgid "Visit Site"
+#: bp-activity/bp-activity-admin.php:575
+msgid "Action"
 msgstr ""
 
-#: bp-blogs/bp-blogs-functions.php:115
-msgid "%s created the site %s"
+#: bp-activity/bp-activity-admin.php:582
+msgid "Content"
 msgstr ""
 
-#: bp-blogs/bp-blogs-functions.php:187
-msgid "%1$s wrote a new post, %2$s, on the site %3$s"
+#: bp-activity/bp-activity-admin.php:607
+msgid "No activity found with this ID. <a href=\"%s\">Go back and try again</a>."
 msgstr ""
 
-#: bp-blogs/bp-blogs-functions.php:189
-msgid "%1$s wrote a new post, %2$s"
+#: bp-activity/bp-activity-admin.php:629
+msgid "View Activity"
 msgstr ""
 
-#: bp-blogs/bp-blogs-functions.php:272
-msgid "%1$s commented on the post, %2$s, on the site %3$s"
+#: bp-activity/bp-activity-admin.php:637
+msgid "Approved"
 msgstr ""
 
-#: bp-blogs/bp-blogs-functions.php:274
-msgid "%1$s commented on the post, %2$s"
+#: bp-activity/bp-activity-admin.php:638 bp-activity/bp-activity-admin.php:1283
+#: bp-activity/bp-activity-akismet.php:178
+#: bp-activity/bp-activity-akismet.php:207
+msgid "Spam"
 msgstr ""
 
-#: bp-blogs/bp-blogs-widgets.php:25
-msgid "Recent Networkwide Posts"
-msgstr ""
+#. translators: Publish box date format, see http:php.net/date
 
-#: bp-blogs/bp-blogs-widgets.php:68
-msgid "Sorry, there were no posts found. Why not write one?"
+#: bp-activity/bp-activity-admin.php:644
+msgid "M j, Y @ G:i"
 msgstr ""
 
-#: bp-blogs/bp-blogs-widgets.php:88
-msgid "Max posts to show:"
+#: bp-activity/bp-activity-admin.php:647
+msgid "Submitted on: <strong>%1$s</strong>"
 msgstr ""
 
-#: bp-core/bp-core-widgets.php:22
-msgid "A dynamic list of recently active, popular, and newest members"
+#: bp-activity/bp-activity-admin.php:647 bp-activity/bp-activity-admin.php:1276
+#: bp-forums/bp-forums-template.php:1270 bp-themes/bp-default/functions.php:507
+#: bp-xprofile/bp-xprofile-admin.php:456 bp-xprofile/bp-xprofile-loader.php:172
+#: bp-xprofile/bp-xprofile-loader.php:230
+msgid "Edit"
 msgstr ""
 
-#: bp-core/bp-core-widgets.php:23 bp-core/bp-core-widgets.php:110
-#: bp-core/admin/bp-core-update.php:442 bp-core/bp-core-template.php:245
-#: bp-groups/bp-groups-template.php:1285 bp-members/bp-members-loader.php:24
-#: bp-themes/bp-default/groups/single/admin.php:229
-msgid "Members"
+#: bp-activity/bp-activity-admin.php:660 bp-core/admin/bp-core-update.php:135
+msgid "Update"
 msgstr ""
 
-#: bp-core/bp-core-widgets.php:48 bp-core/bp-core-widgets.php:128
-#: bp-friends/bp-friends-template.php:63 bp-friends/bp-friends-template.php:84
-#: bp-groups/bp-groups-widgets.php:50 bp-groups/bp-groups-widgets.php:125
-#: bp-themes/bp-default/members/single/blogs.php:22
-#: bp-themes/bp-default/blogs/index.php:58
-msgid "Newest"
+#: bp-activity/bp-activity-admin.php:679
+msgid "Link"
 msgstr ""
 
-#: bp-core/bp-core-widgets.php:49 bp-core/bp-core-widgets.php:129
-#: bp-groups/bp-groups-widgets.php:51 bp-groups/bp-groups-widgets.php:126
-msgid "Active"
+#: bp-activity/bp-activity-admin.php:681
+msgid "Activity generated by blog posts and comments, forum topics and replies, and some plugins, uses the link field for a permalink back to the content item."
 msgstr ""
 
-#: bp-core/bp-core-widgets.php:53 bp-core/bp-core-widgets.php:130
-#: bp-groups/bp-groups-widgets.php:52 bp-groups/bp-groups-widgets.php:127
-msgid "Popular"
+#: bp-activity/bp-activity-admin.php:695
+msgid "Author ID"
 msgstr ""
 
-#: bp-core/bp-core-widgets.php:90
-msgid "No one has signed up yet!"
+#: bp-activity/bp-activity-admin.php:747
+msgid "Primary Item ID"
 msgstr ""
 
-#: bp-core/bp-core-widgets.php:121 bp-core/bp-core-widgets.php:201
-#: bp-core/bp-core-widgets.php:270 bp-groups/bp-groups-widgets.php:118
-#: bp-themes/bp-default/forums/index.php:104
-#: bp-themes/bp-default/groups/single/forum/edit.php:49
-#: bp-themes/bp-default/groups/single/forum.php:75
-msgid "Title:"
+#: bp-activity/bp-activity-admin.php:751
+msgid "Secondary Item ID"
 msgstr ""
 
-#: bp-core/bp-core-widgets.php:123
-msgid "Max members to show:"
+#: bp-activity/bp-activity-admin.php:754
+msgid "These identify the object that created this activity. For example, the fields could reference a pair of site and comment IDs."
 msgstr ""
 
-#: bp-core/bp-core-widgets.php:126
-msgid "Default members to show:"
+#: bp-activity/bp-activity-admin.php:791
+msgid "%s activity has been permanently deleted."
+msgid_plural "%s activity items have been permanently deleted."
+msgstr[0] ""
+msgstr[1] ""
+
+#: bp-activity/bp-activity-admin.php:795
+msgid "An error occurred when trying to update activity ID #%s."
 msgstr ""
 
-#: bp-core/bp-core-widgets.php:148
-msgid "Avatars of users who are currently online"
+#: bp-activity/bp-activity-admin.php:798
+msgid "Errors occurred when trying to update these activity items:"
 msgstr ""
 
-#: bp-core/bp-core-widgets.php:149
-msgid "Who's Online Avatars"
+#: bp-activity/bp-activity-admin.php:804
+msgid "#%s"
 msgstr ""
 
-#: bp-core/bp-core-widgets.php:173
-msgid "There are no users currently online"
+#: bp-activity/bp-activity-admin.php:813
+msgid "%s activity has been successfully spammed."
+msgid_plural "%s activity items have been successfully spammed."
+msgstr[0] ""
+msgstr[1] ""
+
+#: bp-activity/bp-activity-admin.php:816
+msgid "%s activity has been successfully unspammed."
+msgid_plural "%s activity items have been successfully unspammed."
+msgstr[0] ""
+msgstr[1] ""
+
+#: bp-activity/bp-activity-admin.php:819
+msgid "The activity has been updated succesfully."
 msgstr ""
 
-#: bp-core/bp-core-widgets.php:192
-msgid "Who's Online"
+#: bp-activity/bp-activity-admin.php:833
+msgid "Activity related to ID #%s"
 msgstr ""
 
-#: bp-core/bp-core-widgets.php:203 bp-core/bp-core-widgets.php:272
-msgid "Max Members to show:"
+#: bp-activity/bp-activity-admin.php:839
+msgid "Search results for &#8220;%s&#8221;"
 msgstr ""
 
-#: bp-core/bp-core-widgets.php:217
-msgid "Avatars of recently active members"
+#: bp-activity/bp-activity-admin.php:852
+msgid "Search all Activity"
 msgstr ""
 
-#: bp-core/bp-core-widgets.php:218
-msgid "Recently Active Member Avatars"
+#: bp-activity/bp-activity-admin.php:863
+msgid "Reply to Activity"
 msgstr ""
 
-#: bp-core/bp-core-widgets.php:242
-msgid "There are no recently active members"
+#: bp-activity/bp-activity-admin.php:867
+#: bp-themes/bp-default/forums/index.php:134
+#: bp-xprofile/bp-xprofile-classes.php:405
+#: bp-xprofile/bp-xprofile-classes.php:913
+msgid "Cancel"
 msgstr ""
 
-#: bp-core/bp-core-widgets.php:328
-msgid "There were no members found, please try another filter."
+#: bp-activity/bp-activity-admin.php:868 bp-activity/bp-activity-admin.php:1273
+#: bp-themes/bp-default/activity/comment.php:37
+#: bp-themes/bp-default/groups/single/forum/edit.php:10
+msgid "Reply"
 msgstr ""
 
-#: bp-core/bp-core-adminbar.php:92
-msgid "Admin Dashboard"
+#: bp-activity/bp-activity-admin.php:1051
+msgid "No activities found."
 msgstr ""
 
-#: bp-core/bp-core-adminbar.php:103
-msgid "Network Dashboard"
+#: bp-activity/bp-activity-admin.php:1111
+#: bp-messages/bp-messages-template.php:440
+msgid "All"
 msgstr ""
 
-#: bp-core/bp-core-adminbar.php:128
-msgid "Blavatar"
+#: bp-activity/bp-activity-admin.php:1112
+msgid "Spam <span class=\"count\">(%s)</span>"
 msgstr ""
 
-#: bp-core/bp-core-adminbar.php:157
-msgid "Comments %s"
+#: bp-activity/bp-activity-admin.php:1127
+msgid "Mark as Spam"
 msgstr ""
 
-#: bp-core/bp-core-adminbar.php:170
-msgid "Appearance"
+#: bp-activity/bp-activity-admin.php:1128
+#: bp-activity/bp-activity-admin.php:1281
+msgid "Not Spam"
 msgstr ""
 
-#: bp-core/bp-core-adminbar.php:176
-msgid "Themes"
+#: bp-activity/bp-activity-admin.php:1129
+#: bp-activity/bp-activity-admin.php:1286
+msgid "Delete Permanently"
 msgstr ""
 
-#: bp-core/bp-core-adminbar.php:179
-msgid "Widgets"
+#: bp-activity/bp-activity-admin.php:1144
+msgid "Author"
 msgstr ""
 
-#: bp-core/bp-core-adminbar.php:182
-msgid "Menus"
+#: bp-activity/bp-activity-admin.php:1146
+msgid "In Response To"
 msgstr ""
 
-#: bp-core/bp-core-adminbar.php:185
-msgid "Background"
+#: bp-activity/bp-activity-admin.php:1201
+msgid "Show all activity types"
 msgstr ""
 
-#: bp-core/bp-core-adminbar.php:188
-msgid "Header"
+#: bp-activity/bp-activity-admin.php:1208
+msgid "Filter"
 msgstr ""
 
-#: bp-core/bp-core-adminbar.php:220
-msgid "%d WordPress Update"
+#: bp-activity/bp-activity-admin.php:1286 bp-core/bp-core-cssjs.php:17
+msgid "Are you sure?"
 msgstr ""
 
-#: bp-core/bp-core-adminbar.php:222
-msgid "%d Plugin Update"
-msgid_plural "%d Plugin Updates"
-msgstr[0] ""
-msgstr[1] ""
+#. translators: 2: activity admin ui date/time
 
-#: bp-core/bp-core-adminbar.php:224
-msgid "%d Theme Update"
-msgid_plural "%d Theme Updates"
+#: bp-activity/bp-activity-admin.php:1295
+msgid "Submitted on <a href=\"%1$s\">%2$s at %3$s</a>"
+msgstr ""
+
+#: bp-activity/bp-activity-admin.php:1324
+msgid "%s related activity"
+msgid_plural "%s related activities"
 msgstr[0] ""
 msgstr[1] ""
 
-#: bp-core/bp-core-adminbar.php:229
-msgid "Updates %s"
-msgstr ""
-
-#: bp-core/admin/bp-core-schema.php:208
-msgctxt "First XProfile group name"
-msgid "Base"
+#: bp-activity/bp-activity-admin.php:1335
+msgid "<a href=\"%1$s\">View Activity</a>"
 msgstr ""
 
-#: bp-core/admin/bp-core-schema.php:209
-msgctxt "XProfile fullname field name"
-msgid "Name"
+#: bp-activity/bp-activity-akismet.php:80
+msgid "Flagged as spam by Akismet"
 msgstr ""
 
-#: bp-core/admin/bp-core-admin.php:11
-msgid "IMPORTANT: <a href=\"http://codex.buddypress.org/buddypress-site-administration/upgrading-buddypress/\">Read this before attempting to update BuddyPress</a>"
+#: bp-activity/bp-activity-akismet.php:83
+msgid "Cleared by Akismet"
 msgstr ""
 
-#: bp-core/admin/bp-core-admin.php:32 bp-core/admin/bp-core-admin.php:251
-#: bp-core/admin/bp-core-update.php:72 bp-core/admin/bp-core-update.php:88
-#: bp-core/admin/bp-core-update.php:219 bp-core/bp-core-functions.php:253
-msgid "Components"
+#: bp-activity/bp-activity-akismet.php:89
+msgid "Flagged as spam by %s"
 msgstr ""
 
-#: bp-core/admin/bp-core-admin.php:36 bp-core/admin/bp-core-admin.php:293
-#: bp-core/admin/bp-core-update.php:73 bp-core/admin/bp-core-update.php:89
-#: bp-core/admin/bp-core-update.php:223 bp-core/bp-core-functions.php:254
-msgid "Pages"
+#: bp-activity/bp-activity-akismet.php:91
+msgid "Un-spammed by %s"
 msgstr ""
 
-#: bp-core/admin/bp-core-admin.php:40 bp-core/admin/bp-core-admin.php:91
-#: bp-core/bp-core-functions.php:255 bp-settings/bp-settings-loader.php:15
-#: bp-settings/bp-settings-loader.php:72 bp-settings/bp-settings-loader.php:150
-#: bp-groups/bp-groups-loader.php:189 bp-groups/bp-groups-template.php:1279
-msgid "Settings"
+#: bp-activity/bp-activity-akismet.php:100
+msgid "History"
 msgstr ""
 
-#: bp-core/admin/bp-core-admin.php:48 bp-core/admin/bp-core-update.php:485
-#: bp-core/bp-core-template.php:254 bp-forums/bp-forums-admin.php:12
-#: bp-forums/bp-forums-admin.php:25 bp-forums/bp-forums-admin.php:265
-#: bp-forums/bp-forums-loader.php:111 bp-forums/bp-forums-loader.php:194
-#: bp-forums/bp-forums-loader.php:237
-msgid "Forums"
+#: bp-activity/bp-activity-akismet.php:345
+msgid "%s reported this activity as spam"
 msgstr ""
 
-#: bp-core/admin/bp-core-admin.php:96 bp-core/admin/bp-core-admin.php:257
-#: bp-core/admin/bp-core-admin.php:299
-msgid "Settings Saved"
+#: bp-activity/bp-activity-akismet.php:361
+msgid "%s reported this activity as not spam"
 msgstr ""
 
-#: bp-core/admin/bp-core-admin.php:109
-msgid "Disable BuddyPress to WordPress profile syncing?"
+#: bp-activity/bp-activity-akismet.php:384
+msgid "Akismet caught this item as spam"
 msgstr ""
 
-#: bp-core/admin/bp-core-admin.php:119
-msgid "Hide admin bar for logged out users?"
+#: bp-activity/bp-activity-akismet.php:389
+msgid "Akismet cleared this item"
 msgstr ""
 
-#: bp-core/admin/bp-core-admin.php:127
-msgid "Disable avatar uploads? (Gravatars will still work)"
+#: bp-activity/bp-activity-akismet.php:394
+msgid "Akismet was unable to check this item (response: %s), will automatically retry again later."
 msgstr ""
 
-#: bp-core/admin/bp-core-admin.php:135
-msgid "Disable user account deletion?"
+#: bp-activity/bp-activity-akismet.php:502
+msgid "Activity History"
 msgstr ""
 
-#: bp-core/admin/bp-core-admin.php:145
-msgid "Disable activity stream commenting on blog and forum posts?"
+#: bp-activity/bp-activity-akismet.php:520
+msgctxt "x hours ago - akismet cleared this item"
+msgid "<span>%1$s</span> &mdash; %2$s"
 msgstr ""
 
-#: bp-core/admin/bp-core-admin.php:157
-msgid "Restrict group creation to Site Admins?"
+#: bp-activity/bp-activity-classes.php:122
+#: bp-activity/bp-activity-template.php:120
+msgid "Arguments passed to %1$s should be in an associative array. See the inline documentation at %2$s for more details."
 msgstr ""
 
-#: bp-core/admin/bp-core-admin.php:174 bp-core/admin/bp-core-admin.php:268
-msgid "Save Settings"
+#: bp-activity/bp-activity-filters.php:321
+msgid "[Read more]"
 msgstr ""
 
-#: bp-core/admin/bp-core-admin.php:310
-msgid "Save All"
+#: bp-activity/bp-activity-filters.php:326
+msgid "&hellip;"
 msgstr ""
 
-#: bp-core/admin/bp-core-admin.php:342 bp-xprofile/bp-xprofile-loader.php:25
-msgid "Extended Profiles"
+#: bp-activity/bp-activity-functions.php:149
+msgid "@%s Mentions"
 msgstr ""
 
-#: bp-core/admin/bp-core-admin.php:343
-msgid "Customize your community with fully editable profile fields that allow your users to describe themselves."
+#: bp-activity/bp-activity-functions.php:152
+msgid "You have %1$d new mentions"
 msgstr ""
 
-#: bp-core/admin/bp-core-admin.php:346
-msgid "Account Settings"
+#: bp-activity/bp-activity-functions.php:156
+msgid "%1$s mentioned you"
 msgstr ""
 
-#: bp-core/admin/bp-core-admin.php:347
-msgid "Allow your users to modify their account and notification settings directly from within their profiles."
+#: bp-activity/bp-activity-functions.php:767
+msgid "Posted a status update"
 msgstr ""
 
-#: bp-core/admin/bp-core-admin.php:350 bp-friends/bp-friends-loader.php:24
-msgid "Friend Connections"
+#: bp-activity/bp-activity-functions.php:768
+msgid "Replied to a status update"
 msgstr ""
 
-#: bp-core/admin/bp-core-admin.php:351
-msgid "Let your users make connections so they can track the activity of others and focus on the people they care about the most."
+#: bp-activity/bp-activity-functions.php:1016
+msgid "%s posted an update"
 msgstr ""
 
-#: bp-core/admin/bp-core-admin.php:354
-msgid "Private Messaging"
+#: bp-activity/bp-activity-functions.php:1085
+msgid "%s posted a new activity comment"
 msgstr ""
 
-#: bp-core/admin/bp-core-admin.php:355
-msgid "Allow your users to talk to each other directly and in private. Not just limited to one-on-one discussions, messages can be sent between any number of members."
+#: bp-activity/bp-activity-functions.php:1458
+msgid "Thumbnail"
 msgstr ""
 
-#: bp-core/admin/bp-core-admin.php:358 bp-activity/bp-activity-loader.php:34
+#: bp-activity/bp-activity-loader.php:30
+#: bp-core/admin/bp-core-components.php:83
 msgid "Activity Streams"
 msgstr ""
 
-#: bp-core/admin/bp-core-admin.php:359
-msgid "Global, personal, and group activity streams with threaded commenting, direct posting, favoriting and @mentions, all with full RSS feed and email notification support."
+#: bp-activity/bp-activity-loader.php:93
+msgid "Search Activity..."
 msgstr ""
 
-#: bp-core/admin/bp-core-admin.php:362 bp-groups/bp-groups-loader.php:26
-msgid "User Groups"
+#: bp-activity/bp-activity-loader.php:143
+#: bp-activity/bp-activity-loader.php:257
+msgid "Personal"
 msgstr ""
 
-#: bp-core/admin/bp-core-admin.php:363
-msgid "Groups allow your users to organize themselves into specific public, private or hidden sections with separate activity streams and member listings."
-msgstr ""
+#. translators: Mentions RSS title - "[Site Name] | [Displayed User Name] |
+#. Mentions"
 
-#: bp-core/admin/bp-core-admin.php:366 bp-forums/bp-forums-loader.php:24
-msgid "Discussion Forums"
+#: bp-activity/bp-activity-loader.php:153
+#: bp-activity/bp-activity-loader.php:234
+#: bp-activity/feeds/bp-activity-mentions-feed.php:28
+#: bp-themes/bp-default/activity/index.php:77
+msgid "Mentions"
 msgstr ""
 
-#: bp-core/admin/bp-core-admin.php:367
-msgid "Full-powered discussion forums built directly into groups allow for more conventional in-depth conversations. NOTE: This will require an extra (but easy) setup step."
+#: bp-activity/bp-activity-loader.php:164
+#: bp-activity/bp-activity-loader.php:265
+msgid "Favorites"
 msgstr ""
 
-#: bp-core/admin/bp-core-admin.php:371
-msgid "Make BuddyPress aware of new posts and new comments from your site."
+#: bp-activity/bp-activity-loader.php:176
+#: bp-activity/bp-activity-loader.php:274 bp-friends/bp-friends-loader.php:155
+#: bp-friends/bp-friends-screens.php:83
+msgid "Friends"
 msgstr ""
 
-#: bp-core/admin/bp-core-admin.php:376
-msgid "Make BuddyPress aware of new sites, new posts and new comments from across your entire network."
+#: bp-activity/bp-activity-loader.php:189
+#: bp-activity/bp-activity-loader.php:284 bp-core/admin/bp-core-update.php:354
+#: bp-core/bp-core-template.php:260 bp-groups/bp-groups-activity.php:143
+#: bp-groups/bp-groups-activity.php:179 bp-groups/bp-groups-activity.php:215
+#: bp-groups/bp-groups-activity.php:251 bp-groups/bp-groups-loader.php:502
+#: bp-groups/bp-groups-screens.php:844 bp-groups/bp-groups-widgets.php:28
+#: bp-groups/bp-groups-widgets.php:48 bp-groups/bp-groups-widgets.php:119
+msgid "Groups"
 msgstr ""
 
-#: bp-core/admin/bp-core-admin.php:400 bp-core/bp-core-loader.php:38
-msgid "BuddyPress Core"
+#: bp-activity/bp-activity-loader.php:232
+msgid "Mentions <span class=\"count\">%s</span>"
 msgstr ""
 
-#: bp-core/admin/bp-core-admin.php:401
-msgid "It&#8216;s what makes <del>time travel</del> BuddyPress possible!"
+#: bp-activity/bp-activity-loader.php:309
+msgid "My Activity"
 msgstr ""
 
-#: bp-core/admin/bp-core-admin.php:404
-msgid "Community Members"
+#: bp-activity/bp-activity-loader.php:314
+#: bp-activity/bp-activity-template.php:968
+#: bp-activity/bp-activity-template.php:1089
+#: bp-activity/bp-activity-template.php:1099 bp-blogs/bp-blogs-loader.php:200
+#: bp-forums/bp-forums-loader.php:238 bp-forums/bp-forums-template.php:487
+#: bp-forums/bp-forums-template.php:604 bp-forums/bp-forums-template.php:1200
+#: bp-friends/bp-friends-loader.php:203 bp-groups/bp-groups-loader.php:557
+#: bp-groups/bp-groups-template.php:570 bp-groups/bp-groups-template.php:593
+#: bp-groups/bp-groups-template.php:1030 bp-groups/bp-groups-template.php:1046
+#: bp-groups/bp-groups-template.php:1095 bp-groups/bp-groups-template.php:1111
+#: bp-groups/bp-groups-template.php:1801 bp-groups/bp-groups-template.php:1810
+#: bp-groups/bp-groups-template.php:1819 bp-groups/bp-groups-template.php:2567
+#: bp-members/bp-members-buddybar.php:90 bp-members/bp-members-loader.php:197
+#: bp-members/bp-members-template.php:478
+#: bp-members/bp-members-template.php:778
+#: bp-members/bp-members-template.php:797
+#: bp-messages/bp-messages-loader.php:255
+#: bp-messages/bp-messages-template.php:326
+#: bp-themes/bp-default/groups/single/admin.php:185
+#: bp-themes/bp-default/groups/single/admin.php:212
+#: bp-xprofile/bp-xprofile-loader.php:262
+msgid "Profile picture of %s"
 msgstr ""
 
-#: bp-core/admin/bp-core-admin.php:405
-msgid "Everything in a BuddyPress community revolves around its members."
+#: bp-activity/bp-activity-notifications.php:74
+msgid "%s mentioned you in an update"
 msgstr ""
 
-#: bp-core/admin/bp-core-admin.php:418
-msgid "Available Components"
+#: bp-activity/bp-activity-notifications.php:77 bp-core/deprecated/1.5.php:337
+msgid ""
+"%1$s mentioned you in the group \"%2$s\":\n"
+"\n"
+"\"%3$s\"\n"
+"\n"
+"To view and respond to the message, log in and visit: %4$s\n"
+"\n"
+"---------------------\n"
 msgstr ""
 
-#: bp-core/admin/bp-core-admin.php:420
-msgid "Each component has a unique purpose, and your community may not need each one."
+#: bp-activity/bp-activity-notifications.php:87
+msgid ""
+"%1$s mentioned you in an update:\n"
+"\n"
+"\"%2$s\"\n"
+"\n"
+"To view and respond to the message, log in and visit: %3$s\n"
+"\n"
+"---------------------\n"
 msgstr ""
 
-#: bp-core/admin/bp-core-admin.php:450
-msgid "Required Components"
+#: bp-activity/bp-activity-notifications.php:98
+#: bp-activity/bp-activity-notifications.php:175
+#: bp-activity/bp-activity-notifications.php:221 bp-core/deprecated/1.5.php:347
+#: bp-friends/bp-friends-notifications.php:44
+#: bp-friends/bp-friends-notifications.php:81
+#: bp-groups/bp-groups-notifications.php:43
+#: bp-groups/bp-groups-notifications.php:92
+#: bp-groups/bp-groups-notifications.php:148
+#: bp-groups/bp-groups-notifications.php:195
+#: bp-groups/bp-groups-notifications.php:249
+#: bp-messages/bp-messages-notifications.php:60
+msgid "To disable these notifications please log in and go to: %s"
 msgstr ""
 
-#: bp-core/admin/bp-core-admin.php:452
-msgid "The following components are required by BuddyPress and cannot be turned off."
+#: bp-activity/bp-activity-notifications.php:163
+msgid "%s replied to one of your updates"
 msgstr ""
 
-#: bp-core/admin/bp-core-admin.php:520
-msgid "Directories"
+#: bp-activity/bp-activity-notifications.php:165
+msgid ""
+"%1$s replied to one of your updates:\n"
+"\n"
+"\"%2$s\"\n"
+"\n"
+"To view your original update and all comments, log in and visit: %3$s\n"
+"\n"
+"---------------------\n"
 msgstr ""
 
-#: bp-core/admin/bp-core-admin.php:522
-msgid "Associate a WordPress Page with each BuddyPress component directory."
+#: bp-activity/bp-activity-notifications.php:206
+msgid "%s replied to one of your comments"
 msgstr ""
 
-#: bp-core/admin/bp-core-admin.php:542 bp-core/admin/bp-core-admin.php:595
-msgid "- None -"
+#: bp-activity/bp-activity-notifications.php:211
+msgid ""
+"%1$s replied to one of your comments:\n"
+"\n"
+"\"%2$s\"\n"
+"\n"
+"To view the original activity, your comment and all replies, log in and visit: %3$s\n"
+"\n"
+"---------------------\n"
 msgstr ""
 
-#: bp-core/admin/bp-core-admin.php:546 bp-core/admin/bp-core-admin.php:599
-msgid "New Page"
+#: bp-activity/bp-activity-screens.php:245
+msgid "You do not have access to this activity."
 msgstr ""
 
-#: bp-core/admin/bp-core-admin.php:547 bp-core/admin/bp-core-admin.php:600
-#: bp-xprofile/bp-xprofile-classes.php:760
-msgid "Save"
+#: bp-activity/bp-activity-screens.php:279 bp-blogs/bp-blogs-template.php:499
+#: bp-friends/bp-friends-screens.php:84 bp-groups/bp-groups-screens.php:845
+#: bp-messages/bp-messages-screens.php:149
+#: bp-themes/bp-default/groups/single/admin.php:26
+#: bp-themes/bp-default/registration/register.php:227
+msgid "Yes"
 msgstr ""
 
-#: bp-core/admin/bp-core-admin.php:551 bp-core/admin/bp-core-admin.php:604
-#: bp-xprofile/bp-xprofile-loader.php:185
-#: bp-members/bp-members-template.php:588
-#: bp-themes/bp-default/functions.php:156
-#: bp-themes/bp-default/activity/entry.php:37
-#: bp-activity/bp-activity-template.php:2053
-msgid "View"
+#: bp-activity/bp-activity-screens.php:280 bp-blogs/bp-blogs-template.php:503
+#: bp-friends/bp-friends-screens.php:85 bp-groups/bp-groups-screens.php:846
+#: bp-messages/bp-messages-screens.php:150
+#: bp-themes/bp-default/groups/single/admin.php:27
+#: bp-themes/bp-default/registration/register.php:228
+msgid "No"
 msgstr ""
 
-#: bp-core/admin/bp-core-admin.php:573 bp-core/admin/bp-core-update.php:514
-#: bp-core/bp-core-functions.php:414 bp-members/bp-members-adminbar.php:100
-msgid "Register"
+#: bp-activity/bp-activity-screens.php:287
+msgid "A member mentions you in an update using \"@%s\""
 msgstr ""
 
-#: bp-core/admin/bp-core-admin.php:574 bp-core/admin/bp-core-update.php:525
-#: bp-core/bp-core-functions.php:409 bp-messages/bp-messages-template.php:498
-#: bp-themes/bp-default/registration/activate.php:36
-msgid "Activate"
+#: bp-activity/bp-activity-screens.php:293
+msgid "A member replies to an update or comment you've posted"
 msgstr ""
 
-#: bp-core/admin/bp-core-admin.php:577
-msgid "Registration"
+#: bp-activity/bp-activity-template.php:220
+msgctxt "Activity pagination previous text"
+msgid "&larr;"
 msgstr ""
 
-#: bp-core/admin/bp-core-admin.php:579
-msgid "Associate WordPress Pages with the following BuddyPress Registration pages."
+#: bp-activity/bp-activity-template.php:221
+msgctxt "Activity pagination next text"
+msgid "&rarr;"
 msgstr ""
 
-#: bp-core/admin/bp-core-update.php:74 bp-core/admin/bp-core-update.php:227
-msgid "Permalinks"
+#: bp-activity/bp-activity-template.php:523
+msgid "Viewing item %1$s to %2$s (of %3$s items)"
 msgstr ""
 
-#: bp-core/admin/bp-core-update.php:75 bp-core/admin/bp-core-update.php:231
-msgid "Theme"
+#: bp-activity/bp-activity-template.php:968
+msgid "Profile picture"
 msgstr ""
 
-#: bp-core/admin/bp-core-update.php:76 bp-core/admin/bp-core-update.php:92
-#: bp-core/admin/bp-core-update.php:188 bp-core/admin/bp-core-update.php:235
-#: bp-core/admin/bp-core-update.php:1202
-#: bp-themes/bp-default/groups/create.php:294
-msgid "Finish"
+#: bp-activity/bp-activity-template.php:1065
+msgid "Group logo"
 msgstr ""
 
-#: bp-core/admin/bp-core-update.php:82 bp-core/admin/bp-core-update.php:211
-msgid "Multisite Update"
+#: bp-activity/bp-activity-template.php:1070
+#: bp-groups/bp-groups-template.php:391
+msgid "Group logo of %s"
 msgstr ""
 
-#: bp-core/admin/bp-core-update.php:85 bp-core/admin/bp-core-update.php:207
-msgid "Database Update"
+#: bp-activity/bp-activity-template.php:1080
+msgid "Profile picture of the author of the site %s"
 msgstr ""
 
-#: bp-core/admin/bp-core-update.php:145 bp-core/admin/bp-core-update.php:1231
-msgid "Update"
+#: bp-activity/bp-activity-template.php:1270
+msgid "View Discussion"
 msgstr ""
 
-#: bp-core/admin/bp-core-update.php:145 bp-core/admin/bp-core-update.php:1229
-msgid "Setup"
+#: bp-activity/bp-activity-template.php:2065
+#: bp-forums/bp-forums-template.php:1271 bp-groups/bp-groups-template.php:1294
+#: bp-themes/bp-default/activity/comment.php:43
+#: bp-themes/bp-default/members/single/messages/messages-loop.php:51
+#: bp-themes/bp-default/members/single/messages/single.php:24
+#: bp-xprofile/bp-xprofile-admin.php:460
+msgid "Delete"
 msgstr ""
 
-#: bp-core/admin/bp-core-update.php:153
-msgid "BuddyPress %s"
+#: bp-activity/bp-activity-template.php:2112
+#: bp-core/admin/bp-core-slugs.php:112 bp-core/admin/bp-core-slugs.php:173
+#: bp-members/bp-members-template.php:583
+#: bp-themes/bp-default/activity/entry.php:37
+#: bp-themes/bp-default/functions.php:165
+#: bp-xprofile/bp-xprofile-loader.php:222
+msgid "View"
 msgstr ""
 
-#: bp-core/admin/bp-core-update.php:191
-msgid "Finish &amp; Activate"
+#: bp-activity/bp-activity-template.php:2206
+msgid "Clear Filter"
 msgstr ""
 
-#: bp-core/admin/bp-core-update.php:197
-msgid "Save &amp; Next"
+#: bp-activity/bp-activity-template.php:2389
+msgid "a user"
 msgstr ""
 
-#: bp-core/admin/bp-core-update.php:215 bp-themes/bp-default/blogs/index.php:23
-#: bp-themes/bp-default/blogs/create.php:21
-msgid "Site Directory"
+#: bp-activity/bp-activity-template.php:2429
+msgid "Send a public message on your activity stream."
 msgstr ""
 
-#: bp-core/admin/bp-core-update.php:254
-msgid "Before you can continue using BuddyPress, a few minor adjustments need to be made. These changes are not destructive and will not remove or change any existing settings."
+#: bp-activity/bp-activity-template.php:2430
+msgid "Public Message"
 msgstr ""
 
-#: bp-core/admin/bp-core-update.php:302
-msgid "BuddyPress has detected a recent change to WordPress Multisite, which allows members of your community to have their own WordPress sites. You can enable or disable this feature at any time at <a href=\"%s\">Network Options</a>."
+#: bp-activity/bp-activity-template.php:2737
+msgid "Site Wide Activity RSS Feed"
 msgstr ""
 
-#: bp-core/admin/bp-core-update.php:304
-msgid "Please select the WordPress page you would like to use to display the site directory. You can either choose an existing page or let BuddyPress auto-create a page for you. If you'd like, you can go to manually create pages now, and return to this step when you are finished."
-msgstr ""
+#. translators: Favorited activity RSS title - "[Site Name] | [Displayed User
+#. Name] | Favorite Activity"
 
-#: bp-core/admin/bp-core-update.php:306 bp-core/admin/bp-core-update.php:436
-msgid "Please Note:"
+#: bp-activity/feeds/bp-activity-favorites-feed.php:28
+msgid "Favorite Activity"
 msgstr ""
 
-#: bp-core/admin/bp-core-update.php:306 bp-core/admin/bp-core-update.php:436
-msgid "If you have manually added BuddyPress navigation links in your theme you may need to remove these from your header.php to avoid duplicate links."
+#: bp-activity/feeds/bp-activity-favorites-feed.php:31
+msgid "%s - Favorite Activity"
 msgstr ""
 
-#: bp-core/admin/bp-core-update.php:308
-msgid "Would you like to enable site tracking, which tracks blog posts and comments from across your network?"
+#: bp-activity/feeds/bp-activity-favorites-feed.php:57
+#: bp-activity/feeds/bp-activity-friends-feed.php:50
+#: bp-activity/feeds/bp-activity-group-feed.php:50
+#: bp-activity/feeds/bp-activity-mentions-feed.php:51
+#: bp-activity/feeds/bp-activity-mygroups-feed.php:56
+#: bp-activity/feeds/bp-activity-personal-feed.php:50
+#: bp-activity/feeds/bp-activity-sitewide-feed.php:50
+msgid "Comments: %s"
 msgstr ""
 
-#: bp-core/admin/bp-core-update.php:313
-msgid "Enable Site Tracking?"
+#: bp-activity/feeds/bp-activity-favorites-feed.php:61
+#: bp-activity/feeds/bp-activity-friends-feed.php:54
+#: bp-activity/feeds/bp-activity-mentions-feed.php:55
+#: bp-activity/feeds/bp-activity-personal-feed.php:54
+msgid "In reply to"
 msgstr ""
 
-#: bp-core/admin/bp-core-update.php:319
-msgid "Track new sites, new posts and new comments across your entire network."
-msgstr ""
+#. translators: Member friends activity RSS title - "[Site Name] | Friends
+#. Activity"
 
-#: bp-core/admin/bp-core-update.php:327
-msgid "Select a WordPress page for the Sites directory."
+#: bp-activity/feeds/bp-activity-friends-feed.php:28
+msgid "Friends Activity"
 msgstr ""
 
-#: bp-core/admin/bp-core-update.php:330 bp-core/admin/bp-core-update.php:446
-#: bp-core/admin/bp-core-update.php:459 bp-core/admin/bp-core-update.php:474
-#: bp-core/admin/bp-core-update.php:489 bp-core/admin/bp-core-update.php:505
-#: bp-core/admin/bp-core-update.php:518 bp-core/admin/bp-core-update.php:529
-msgid "Automatically create a page at:"
+#: bp-activity/feeds/bp-activity-friends-feed.php:31
+msgid "%s - Friends Activity Feed"
 msgstr ""
 
-#: bp-core/admin/bp-core-update.php:331 bp-core/admin/bp-core-update.php:447
-#: bp-core/admin/bp-core-update.php:460 bp-core/admin/bp-core-update.php:475
-#: bp-core/admin/bp-core-update.php:490 bp-core/admin/bp-core-update.php:506
-#: bp-core/admin/bp-core-update.php:519 bp-core/admin/bp-core-update.php:530
-msgid "Use an existing page:"
-msgstr ""
+#. translators: Single group activity RSS title - "[Site Name] | [Group Name] |
+#. Group Activity"
 
-#: bp-core/admin/bp-core-update.php:331 bp-core/admin/bp-core-update.php:447
-#: bp-core/admin/bp-core-update.php:460 bp-core/admin/bp-core-update.php:475
-#: bp-core/admin/bp-core-update.php:490 bp-core/admin/bp-core-update.php:506
-#: bp-core/admin/bp-core-update.php:519 bp-core/admin/bp-core-update.php:530
-msgid "- Select -"
+#: bp-activity/feeds/bp-activity-group-feed.php:28
+msgid "Group Activity"
 msgstr ""
 
-#: bp-core/admin/bp-core-update.php:358
-msgid "BuddyPress bundles several individual social components together, each one adding a distinct feature. This first step decides which features are enabled on your site; all features are enabled by default. Don't worry, you can change your mind at any point in the future."
+#: bp-activity/feeds/bp-activity-group-feed.php:31
+msgid "%s - Group Activity Feed"
 msgstr ""
 
-#: bp-core/admin/bp-core-update.php:402
-msgid "members"
-msgstr ""
+#. translators: Mentions RSS title - "[Site Name] | [Displayed User Name] |
+#. Mentions"
 
-#: bp-core/admin/bp-core-update.php:405
-#: bp-activity/bp-activity-template.php:2142
-msgid "groups"
+#: bp-activity/feeds/bp-activity-mentions-feed.php:32
+msgid "%s - Mentions"
 msgstr ""
 
-#: bp-core/admin/bp-core-update.php:408
-msgid "activity"
-msgstr ""
+#. translators: Member groups activity RSS title - "[Site Name] | [Displayed
+#. User Name] | My Groups - Public Activity"
 
-#: bp-core/admin/bp-core-update.php:411
-msgid "forums"
+#: bp-activity/feeds/bp-activity-mygroups-feed.php:28
+msgid "My Groups - Public Activity"
 msgstr ""
 
-#: bp-core/admin/bp-core-update.php:414
-msgid "blogs"
-msgstr ""
+#. translators: Member groups activity RSS description - "[Displayed user name]
+#. - My Groups - Public Activity"
 
-#: bp-core/admin/bp-core-update.php:417
-msgid "register"
+#: bp-activity/feeds/bp-activity-mygroups-feed.php:32
+msgid "%1$s - My Groups - Public Activity"
 msgstr ""
 
-#: bp-core/admin/bp-core-update.php:420
-msgid "activate"
+#: bp-activity/feeds/bp-activity-personal-feed.php:31
+msgid "%s - Activity Feed"
 msgstr ""
 
-#: bp-core/admin/bp-core-update.php:432
-msgid "BuddyPress now uses WordPress pages to display content. This allows you to easily change the names of pages or move them to a sub page."
+#. translators: Sitewide activity RSS title - "[Site Name] | Site Wide
+#. Activity"
+
+#: bp-activity/feeds/bp-activity-sitewide-feed.php:28
+msgid "Site Wide Activity"
 msgstr ""
 
-#: bp-core/admin/bp-core-update.php:434
-msgid "Either choose an existing page or let BuddyPress auto-create pages for you. To manually create custom pages, come back to this step once you are finished."
+#: bp-activity/feeds/bp-activity-sitewide-feed.php:31
+msgid "Site Wide Activity Feed"
 msgstr ""
 
-#: bp-core/admin/bp-core-update.php:443
-msgid "Displays member profiles, and a directory of all site members."
+#: bp-blogs/bp-blogs-activity.php:29
+msgid "New site created"
 msgstr ""
 
-#: bp-core/admin/bp-core-update.php:455
-#: bp-themes/bp-default/activity/index.php:23
-msgid "Site Activity"
+#: bp-blogs/bp-blogs-activity.php:30
+msgid "New post published"
 msgstr ""
 
-#: bp-core/admin/bp-core-update.php:456
-msgid "Displays the activity for the entire site, a member's friends, groups and @mentions."
+#: bp-blogs/bp-blogs-activity.php:31
+msgid "New post comment posted"
 msgstr ""
 
-#: bp-core/admin/bp-core-update.php:470 bp-core/bp-core-template.php:248
-#: bp-groups/bp-groups-activity.php:135 bp-groups/bp-groups-activity.php:171
-#: bp-groups/bp-groups-activity.php:207 bp-groups/bp-groups-activity.php:243
-#: bp-groups/bp-groups-loader.php:395 bp-groups/bp-groups-widgets.php:20
-#: bp-groups/bp-groups-widgets.php:41 bp-groups/bp-groups-widgets.php:107
-#: bp-groups/bp-groups-screens.php:831 bp-activity/bp-activity-loader.php:184
-#: bp-activity/bp-activity-loader.php:278
-msgid "Groups"
+#: bp-blogs/bp-blogs-buddybar.php:43 bp-blogs/bp-blogs-loader.php:122
+#: bp-blogs/bp-blogs-loader.php:170 bp-blogs/bp-blogs-loader.php:191
+msgid "My Sites"
 msgstr ""
 
-#: bp-core/admin/bp-core-update.php:471
-msgid "Displays individual groups as well as a directory of groups."
+#: bp-blogs/bp-blogs-buddybar.php:55 bp-core/bp-core-buddybar.php:545
+msgid "Dashboard"
 msgstr ""
 
-#: bp-core/admin/bp-core-update.php:486
-msgid "Displays a directory of public forum topics."
+#: bp-blogs/bp-blogs-buddybar.php:56 bp-core/bp-core-buddybar.php:549
+msgid "New Post"
 msgstr ""
 
-#: bp-core/admin/bp-core-update.php:502
-msgid "Displays a directory of the sites in your network."
+#: bp-blogs/bp-blogs-buddybar.php:57 bp-core/bp-core-buddybar.php:550
+msgid "Manage Posts"
 msgstr ""
 
-#: bp-core/admin/bp-core-update.php:515
-msgid "Displays a site registration page where users can create new accounts."
+#: bp-blogs/bp-blogs-buddybar.php:58 bp-core/bp-core-buddybar.php:551
+msgid "Manage Comments"
 msgstr ""
 
-#: bp-core/admin/bp-core-update.php:526
-msgid "The page users will visit to activate their account once they have registered."
+#: bp-blogs/bp-blogs-buddybar.php:71
+msgid "Create a Site!"
 msgstr ""
 
-#: bp-core/admin/bp-core-update.php:559
-msgid "Congratulations! You are already using pretty permalinks, which BuddyPress requires. If you'd like to change your settings, you may do so now. If you're happy with your current settings, click Save &amp; Next to continue."
+#: bp-blogs/bp-blogs-functions.php:110
+msgid "%s created the site %s"
 msgstr ""
 
-#: bp-core/admin/bp-core-update.php:561
-msgid "To make sure the pages created in the previous step work correctly, pretty permalinks must be active on your site."
+#: bp-blogs/bp-blogs-functions.php:183
+msgid "%1$s wrote a new post, %2$s, on the site %3$s"
 msgstr ""
 
-#: bp-core/admin/bp-core-update.php:567
-msgid "Please select the permalink setting you would like to use. For more advanced options please visit the <a href=\"%s\">permalink settings page</a> first, and complete this setup wizard later."
+#: bp-blogs/bp-blogs-functions.php:185
+msgid "%1$s wrote a new post, %2$s"
 msgstr ""
 
-#: bp-core/admin/bp-core-update.php:571
-msgid "Day and name"
+#: bp-blogs/bp-blogs-functions.php:287
+msgid "%1$s commented on the post, %2$s, on the site %3$s"
 msgstr ""
 
-#: bp-core/admin/bp-core-update.php:575
-msgid "Month and name"
+#: bp-blogs/bp-blogs-functions.php:289
+msgid "%1$s commented on the post, %2$s"
 msgstr ""
 
-#: bp-core/admin/bp-core-update.php:579
-msgid "Numeric"
+#: bp-blogs/bp-blogs-loader.php:25 bp-core/admin/bp-core-components.php:95
+msgid "Site Tracking"
 msgstr ""
 
-#: bp-core/admin/bp-core-update.php:644
-msgid "BuddyPress introduces a whole range of new screens to display content. To display these screens, you need to decide how you want to handle them in your current theme."
+#: bp-blogs/bp-blogs-loader.php:58
+msgid "Search sites..."
 msgstr ""
 
-#: bp-core/admin/bp-core-update.php:649
-msgid "Use BuddyPress Default"
+#: bp-blogs/bp-blogs-loader.php:111
+msgid "Sites <span>%d</span>"
 msgstr ""
 
-#: bp-core/admin/bp-core-update.php:650
-msgid "BuddyPress Default"
+#: bp-blogs/bp-blogs-loader.php:162
+msgid "Sites"
 msgstr ""
 
-#: bp-core/admin/bp-core-update.php:653
-msgid "BuddyPress Default contains everything you need to get up and running out of the box. It supports all features and is highly customizable."
+#: bp-blogs/bp-blogs-template.php:138
+msgctxt "Blog pagination previous text"
+msgid "&larr;"
 msgstr ""
 
-#: bp-core/admin/bp-core-update.php:654
-msgid "This is the best choice if you do not have an existing WordPress theme, or want to start using BuddyPress immediately."
+#: bp-blogs/bp-blogs-template.php:139
+msgctxt "Blog pagination next text"
+msgid "&rarr;"
 msgstr ""
 
-#: bp-core/admin/bp-core-update.php:655
-msgid "Yes, please!"
+#: bp-blogs/bp-blogs-template.php:263
+msgid "Viewing site %1$s to %2$s (of %3$s sites)"
 msgstr ""
 
-#: bp-core/admin/bp-core-update.php:662
-msgid "Other themes"
+#: bp-blogs/bp-blogs-template.php:287
+msgid "Profile picture of site author %s"
 msgstr ""
 
-#: bp-core/admin/bp-core-update.php:663
-msgid "A BuddyPress theme"
+#: bp-blogs/bp-blogs-template.php:350 bp-core/bp-core-classes.php:177
+#: bp-groups/bp-groups-widgets.php:80 bp-groups/bp-groups-widgets.php:185
+#: bp-members/bp-members-template.php:554
+#: bp-members/bp-members-template.php:829
+#: bp-themes/bp-default/groups/groups-loop.php:47
+#: bp-themes/bp-default/groups/single/group-header.php:42
+msgid "active %s"
 msgstr ""
 
-#: bp-core/admin/bp-core-update.php:666
-msgid "We've found that you already have some other BuddyPress-compatible themes available. To use one of those, pick it from this list."
+#: bp-blogs/bp-blogs-template.php:362
+msgid "Latest Post: %s"
 msgstr ""
 
-#: bp-core/admin/bp-core-update.php:669
-msgid "Use this theme"
+#: bp-blogs/bp-blogs-template.php:425
+msgid "There was a problem, please correct the form below and try again."
 msgstr ""
 
-#: bp-core/admin/bp-core-update.php:685
-msgid "Manually update current theme"
+#: bp-blogs/bp-blogs-template.php:428
+msgid "By filling out the form below, you can <strong>add a site to your account</strong>. There is no limit to the number of sites that you can have, so create to your heart's content, but blog responsibly!"
 msgstr ""
 
-#: bp-core/admin/bp-core-update.php:687
-msgid "Your existing theme"
+#: bp-blogs/bp-blogs-template.php:430
+msgid "If you&#8217;re not going to use a great domain, leave it for a new user. Now have at it!"
 msgstr ""
 
-#: bp-core/admin/bp-core-update.php:691
-msgid "The BuddyPress Template Pack plugin will guide you through the process of manually upgrading your existing WordPress theme. This usually involves following the step-by-step instructions and copying the BuddyPress template files into your theme. This option requires a working knowledge of CSS and HTML, as you will need to tweak the new templates to match your existing theme."
+#: bp-blogs/bp-blogs-template.php:439
+msgid "Create Site"
 msgstr ""
 
-#: bp-core/admin/bp-core-update.php:695
-msgid "Install BuddyPress Template Pack"
+#: bp-blogs/bp-blogs-template.php:453
+msgid "Site Name:"
 msgstr ""
 
-#: bp-core/admin/bp-core-update.php:699
-msgid "Choose this option (go to Appearance &rarr; BP Compatibility after setup is complete)"
+#: bp-blogs/bp-blogs-template.php:455
+msgid "Site Domain:"
 msgstr ""
 
-#: bp-core/admin/bp-core-update.php:700
-msgid "Plugin Installed"
+#: bp-blogs/bp-blogs-template.php:469
+msgid "Your address will be "
 msgstr ""
 
-#: bp-core/admin/bp-core-update.php:709
-msgid "Do not change theme"
+#: bp-blogs/bp-blogs-template.php:472
+msgid "blogname"
 msgstr ""
 
-#: bp-core/admin/bp-core-update.php:712
-msgid "You are happy with your current theme and plan on changing it later."
+#: bp-blogs/bp-blogs-template.php:474
+msgid "domain."
 msgstr ""
 
-#: bp-core/admin/bp-core-update.php:713
-msgid "This is the best choice if you have a highly customized theme on your site already, and want to later manually integrate BuddyPress into your site."
+#: bp-blogs/bp-blogs-template.php:477
+msgid "Must be at least 4 characters, letters and numbers only. It cannot be changed so choose carefully!)"
 msgstr ""
 
-#: bp-core/admin/bp-core-update.php:715
-msgid "Don't change my current theme"
+#: bp-blogs/bp-blogs-template.php:483
+msgid "Site Title:"
 msgstr ""
 
-#: bp-core/admin/bp-core-update.php:737
-msgid "setup"
+#: bp-blogs/bp-blogs-template.php:494
+msgid "Privacy:"
 msgstr ""
 
-#: bp-core/admin/bp-core-update.php:737
-msgid "update"
+#: bp-blogs/bp-blogs-template.php:495
+#: bp-themes/bp-default/registration/register.php:224
+msgid "I would like my site to appear in search engines, and in public listings around this network."
 msgstr ""
 
-#: bp-core/admin/bp-core-update.php:739
-msgid "The BuddyPress %1$s is complete, and your site is ready to go!"
+#: bp-blogs/bp-blogs-template.php:578
+msgid "Congratulations! You have successfully registered a new site."
 msgstr ""
 
-#: bp-core/admin/bp-core-update.php:919
-msgid "Oops, there was a problem creating a configuration file. "
+#: bp-blogs/bp-blogs-template.php:580
+msgid "<a href=\"%1$s\">%2$s</a> is your new site.  <a href=\"%3$s\">Login</a> as \"%4$s\" using your existing password."
 msgstr ""
 
-#: bp-core/admin/bp-core-update.php:925
-msgid "If your <code>web.config</code> file were <a href=\"http://codex.wordpress.org/Changing_File_Permissions\">writable</a>, we could do this automatically, but it isn&#8217;t so this is the url rewrite rule you should have in your <code>web.config</code> file. Click in the field and press <kbd>CTRL + a</kbd> to select all. Then insert this rule inside of the <code>/&lt;configuration&gt;/&lt;system.webServer&gt;/&lt;rewrite&gt;/&lt;rules&gt;</code> element in <code>web.config</code> file."
+#: bp-blogs/bp-blogs-template.php:589 bp-core/bp-core-filters.php:348
+#: bp-themes/bp-default/blogs/create.php:21
+#: bp-themes/bp-default/blogs/index.php:21
+msgid "Create a Site"
 msgstr ""
 
-#: bp-core/admin/bp-core-update.php:934
-msgid "Permalink structure updated. Remove write access on web.config file now!"
+#: bp-blogs/bp-blogs-template.php:601
+msgid "%s's Sites"
 msgstr ""
 
-#: bp-core/admin/bp-core-update.php:939
-msgid "If your <code>.htaccess</code> file were <a href=\"http://codex.wordpress.org/Changing_File_Permissions\">writable</a>, we could do this automatically, but it isn&#8217;t so these are the mod_rewrite rules you should have in your <code>.htaccess</code> file. Click in the field and press <kbd>CTRL + a</kbd> to select all."
+#: bp-blogs/bp-blogs-template.php:602
+msgid "%s's Recent Posts"
 msgstr ""
 
-#: bp-core/admin/bp-core-update.php:951
-msgid "Paste all these rules into a new <code>.htaccess</code> file in the root of your WordPress installation and save the file. Once you're done, please hit the \"Save and Next\" button to continue."
+#: bp-blogs/bp-blogs-template.php:603
+msgid "%s's Recent Comments"
 msgstr ""
 
-#: bp-core/admin/bp-core-update.php:1175
-msgid "Installation was successful. The available options have now been updated, please continue with your selection."
+#: bp-blogs/bp-blogs-template.php:617 bp-core/deprecated/1.5.php:397
+#: bp-forums/bp-forums-template.php:1321 bp-groups/bp-groups-template.php:2292
+#: bp-members/bp-members-template.php:668
+#: bp-messages/bp-messages-template.php:373 bp-themes/bp-default/header.php:30
+#: bp-themes/bp-default/searchform.php:5
+msgid "Search"
 msgstr ""
 
-#: bp-core/admin/bp-core-update.php:1234 bp-core/bp-core-functions.php:252
-#: bp-members/bp-members-signup.php:572
-msgid "BuddyPress"
+#: bp-blogs/bp-blogs-template.php:650 bp-blogs/bp-blogs-template.php:651
+msgid "Visit Site"
 msgstr ""
 
-#: bp-core/admin/bp-core-update.php:1330
-msgid "BuddyPress has been updated! Please run the <a href=\"%s\">update wizard</a>."
+#: bp-blogs/bp-blogs-widgets.php:25
+msgid "Recent Networkwide Posts"
 msgstr ""
 
-#: bp-core/admin/bp-core-update.php:1335
-msgid "BuddyPress was successfully installed! Please run the <a href=\"%s\">installation wizard</a>."
+#: bp-blogs/bp-blogs-widgets.php:67
+msgid "Sorry, there were no posts found. Why not write one?"
 msgstr ""
 
-#: bp-core/bp-core-avatars.php:91
-msgid "Avatar Image"
+#: bp-blogs/bp-blogs-widgets.php:87
+msgid "Max posts to show:"
 msgstr ""
 
-#: bp-core/bp-core-avatars.php:401
-msgid "There is no error, the file uploaded with success"
+#: bp-core/admin/bp-core-components.php:26
+#: bp-core/admin/bp-core-functions.php:365 bp-core/admin/bp-core-update.php:57
+#: bp-core/admin/bp-core-update.php:69 bp-core/admin/bp-core-update.php:201
+msgid "Components"
 msgstr ""
 
-#: bp-core/bp-core-avatars.php:402 bp-core/bp-core-avatars.php:403
-msgid "Your image was bigger than the maximum allowed file size of: "
+#: bp-core/admin/bp-core-components.php:32
+msgid "Save Settings"
 msgstr ""
 
-#: bp-core/bp-core-avatars.php:404
-msgid "The uploaded file was only partially uploaded"
+#: bp-core/admin/bp-core-components.php:67
+#: bp-xprofile/bp-xprofile-loader.php:41
+msgid "Extended Profiles"
 msgstr ""
 
-#: bp-core/bp-core-avatars.php:405
-msgid "No file was uploaded"
+#: bp-core/admin/bp-core-components.php:68
+msgid "Customize your community with fully editable profile fields that allow your users to describe themselves."
 msgstr ""
 
-#: bp-core/bp-core-avatars.php:406
-msgid "Missing a temporary folder"
+#: bp-core/admin/bp-core-components.php:71
+msgid "Account Settings"
 msgstr ""
 
-#: bp-core/bp-core-avatars.php:410
-msgid "Your upload failed, please try again. Error was: %s"
+#: bp-core/admin/bp-core-components.php:72
+msgid "Allow your users to modify their account and notification settings directly from within their profiles."
 msgstr ""
 
-#: bp-core/bp-core-avatars.php:415
-msgid "The file you uploaded is too big. Please upload a file under %s"
+#: bp-core/admin/bp-core-components.php:75 bp-friends/bp-friends-loader.php:24
+msgid "Friend Connections"
 msgstr ""
 
-#: bp-core/bp-core-avatars.php:420
-msgid "Please upload only JPG, GIF or PNG photos."
+#: bp-core/admin/bp-core-components.php:76
+msgid "Let your users make connections so they can track the activity of others and focus on the people they care about the most."
 msgstr ""
 
-#: bp-core/bp-core-avatars.php:431 bp-core/bp-core-avatars.php:444
-msgid "Upload Failed! Error was: %s"
+#: bp-core/admin/bp-core-components.php:79
+msgid "Private Messaging"
 msgstr ""
 
-#: bp-core/bp-core-avatars.php:462
-msgid "Upload failed! Error was: %s"
+#: bp-core/admin/bp-core-components.php:80
+msgid "Allow your users to talk to each other directly and in private. Not just limited to one-on-one discussions, messages can be sent between any number of members."
 msgstr ""
 
-#: bp-core/bp-core-avatars.php:595
-msgid "Avatar of %s"
+#: bp-core/admin/bp-core-components.php:84
+msgid "Global, personal, and group activity streams with threaded commenting, direct posting, favoriting and @mentions, all with full RSS feed and email notification support."
 msgstr ""
 
-#: bp-core/bp-core-template.php:64
-msgid "Options"
+#: bp-core/admin/bp-core-components.php:87 bp-groups/bp-groups-loader.php:83
+msgid "User Groups"
 msgstr ""
 
-#: bp-core/bp-core-template.php:190
-msgid "%1$s at %2$s"
+#: bp-core/admin/bp-core-components.php:88
+msgid "Groups allow your users to organize themselves into specific public, private or hidden sections with separate activity streams and member listings."
 msgstr ""
 
-#: bp-core/bp-core-template.php:251
-msgid "Blogs"
+#: bp-core/admin/bp-core-components.php:91 bp-forums/bp-forums-loader.php:25
+msgid "Discussion Forums"
 msgstr ""
 
-#: bp-core/bp-core-template.php:256
-#: bp-themes/bp-default/members/single/activity.php:27
-#: bp-themes/bp-default/activity/index.php:101
-#: bp-themes/bp-default/forums/forums-loop.php:40
-msgid "Posts"
+#: bp-core/admin/bp-core-components.php:92
+msgid "Site-wide and Group forums allow for focused, bulletin-board style conversations. Powered by bbPress."
 msgstr ""
 
-#: bp-core/bp-core-template.php:259
-msgid "Search these:"
+#: bp-core/admin/bp-core-components.php:96
+msgid "Record activity for new posts and comments from your site."
 msgstr ""
 
-#: bp-core/bp-core-template.php:287
-msgid "Search anything..."
+#: bp-core/admin/bp-core-components.php:102
+msgid "Record activity for new sites, posts, and comments across your network."
 msgstr ""
 
-#: bp-core/bp-core-template.php:381
-msgid " [&hellip;]"
+#: bp-core/admin/bp-core-components.php:108 bp-core/bp-core-loader.php:27
+msgid "BuddyPress Core"
 msgstr ""
 
-#: bp-core/bp-core-filters.php:163 bp-core/bp-core-filters.php:187
-msgid "[User Set]"
+#: bp-core/admin/bp-core-components.php:109
+msgid "It&#8216;s what makes <del>time travel</del> BuddyPress possible!"
 msgstr ""
 
-#: bp-core/bp-core-filters.php:206
-msgid ""
-"Thanks for registering! To complete the activation of your account and blog, please click the following link:\n"
-"\n"
-"%1$s\n"
-"\n"
-"\n"
-"\n"
-"After you activate, you can visit your blog here:\n"
-"\n"
-"%2$s"
+#: bp-core/admin/bp-core-components.php:112
+msgid "Community Members"
 msgstr ""
 
-#: bp-core/bp-core-filters.php:207
-msgid "Activate %s"
+#: bp-core/admin/bp-core-components.php:113
+msgid "Everything in a BuddyPress community revolves around its members."
 msgstr ""
 
-#: bp-core/bp-core-filters.php:239 bp-members/bp-members-signup.php:574
-msgid ""
-"Thanks for registering! To complete the activation of your account please click the following link:\n"
-"\n"
-"%s\n"
-"\n"
+#: bp-core/admin/bp-core-components.php:179
+msgid "Available Components"
 msgstr ""
 
-#: bp-core/bp-core-filters.php:240 bp-members/bp-members-signup.php:575
-msgid "Activate Your Account"
+#: bp-core/admin/bp-core-components.php:181
+msgid "Each component has a unique purpose, and your community may not need each one."
 msgstr ""
 
-#. translators: "displayed user's name | canonicalised component name"
-#. translators: "group name | group nav section name"
+#: bp-core/admin/bp-core-components.php:186
+msgctxt "plugins"
+msgid "All <span class=\"count\">(%s)</span>"
+msgid_plural "All <span class=\"count\">(%s)</span>"
+msgstr[0] ""
+msgstr[1] ""
 
-#: bp-core/bp-core-filters.php:286 bp-core/bp-core-filters.php:292
-msgid "%1$s | %2$s"
-msgstr ""
+#: bp-core/admin/bp-core-components.php:187
+msgid "Active <span class=\"count\">(%s)</span>"
+msgid_plural "Active <span class=\"count\">(%s)</span>"
+msgstr[0] ""
+msgstr[1] ""
 
-#. translators: "component item name | component nav section name | root
-#. component name"
+#: bp-core/admin/bp-core-components.php:188
+msgid "Inactive <span class=\"count\">(%s)</span>"
+msgid_plural "Inactive <span class=\"count\">(%s)</span>"
+msgstr[0] ""
+msgstr[1] ""
 
-#: bp-core/bp-core-filters.php:297
-msgid "%1$s | %2$s | %3$s"
+#: bp-core/admin/bp-core-components.php:189
+msgid "Must-Use <span class=\"count\">(%s)</span>"
+msgid_plural "Must-Use <span class=\"count\">(%s)</span>"
+msgstr[0] ""
+msgstr[1] ""
+
+#: bp-core/admin/bp-core-components.php:196
+#: bp-core/admin/bp-core-components.php:204
+msgid "Component"
 msgstr ""
 
-#: bp-core/bp-core-filters.php:302 bp-core/bp-core-filters.php:304
-msgid "%s Directory"
+#: bp-core/admin/bp-core-components.php:197
+#: bp-core/admin/bp-core-components.php:205
+msgid "Description"
 msgstr ""
 
-#: bp-core/bp-core-filters.php:308
-#: bp-themes/bp-default/registration/register.php:23
-msgid "Create an Account"
+#: bp-core/admin/bp-core-components.php:230
+msgid "Select %s"
 msgstr ""
 
-#: bp-core/bp-core-filters.php:312
-#: bp-themes/bp-default/registration/activate.php:24
-msgid "Activate your Account"
+#: bp-core/admin/bp-core-components.php:255
+msgid "No components found."
 msgstr ""
 
-#: bp-core/bp-core-filters.php:316 bp-themes/bp-default/groups/index.php:23
-#: bp-themes/bp-default/groups/create.php:18
-msgid "Create a Group"
+#: bp-core/admin/bp-core-functions.php:113
+msgid "Why have all my BuddyPress menus disappeared?"
 msgstr ""
 
-#: bp-core/bp-core-cssjs.php:49
-msgid "Are you sure?"
+#: bp-core/admin/bp-core-functions.php:115
+msgid "Don't worry! We've moved the BuddyPress options into more convenient and easier to find locations. You're seeing this page because you are running a legacy BuddyPress plugin which has not been updated."
 msgstr ""
 
-#: bp-core/bp-core-classes.php:191
-msgid "%d group"
-msgid_plural "%d groups"
-msgstr[0] ""
-msgstr[1] ""
+#: bp-core/admin/bp-core-functions.php:116
+msgid "Components, Pages, Settings, and Forums, have been moved to <a href=\"%s\">Settings &gt; BuddyPress</a>. Profile Fields has been moved into the <a href=\"%s\">Users</a> menu."
+msgstr ""
 
-#: bp-core/deprecated/1.5.php:135 bp-xprofile/bp-xprofile-loader.php:220
-#: bp-themes/bp-default/members/single/profile/profile-wp.php:8
-#: bp-themes/bp-default/activity/post-form.php:45
-msgid "My Profile"
+#: bp-core/admin/bp-core-functions.php:234
+msgid "<strong>BuddyPress is almost ready</strong>. You must <a href=\"%s\">update your permalink structure</a> to something other than the default for it to work."
 msgstr ""
 
-#: bp-core/deprecated/1.5.php:142 bp-themes/bp-default/functions.php:634
-#: bp-themes/bp-default/members/single/profile/profile-wp.php:15
-msgid "Name"
+#: bp-core/admin/bp-core-functions.php:253
+msgid "You'll need to <a href='%s'>activate a <strong>BuddyPress-compatible theme</strong></a> to take advantage of all of BuddyPress's features. We've bundled a default theme, but you can always <a href='%s'>install some other compatible themes</a> or <a href='%s'>update your existing WordPress theme</a>."
 msgstr ""
 
-#: bp-core/deprecated/1.5.php:151
-#: bp-themes/bp-default/members/single/profile/profile-wp.php:24
-msgid "About Me"
+#: bp-core/admin/bp-core-functions.php:278 bp-core/admin/bp-core-slugs.php:139
+#: bp-core/admin/bp-core-update.php:439
+#: bp-messages/bp-messages-template.php:564
+#: bp-themes/bp-default/registration/activate.php:36
+msgid "Activate"
 msgstr ""
 
-#: bp-core/deprecated/1.5.php:160 bp-themes/bp-default/functions.php:638
-#: bp-themes/bp-default/members/single/profile/profile-wp.php:33
-msgid "Website"
+#: bp-core/admin/bp-core-functions.php:283 bp-core/admin/bp-core-slugs.php:138
+#: bp-core/admin/bp-core-update.php:425 bp-members/bp-members-adminbar.php:60
+msgid "Register"
 msgstr ""
 
-#: bp-core/deprecated/1.5.php:169
-#: bp-themes/bp-default/members/single/profile/profile-wp.php:42
-msgid "Jabber"
+#: bp-core/admin/bp-core-functions.php:304
+msgid "The following active BuddyPress Components do not have associated WordPress Pages: %2$s. <a href=\"%1$s\" class=\"button-secondary\">Repair</a>"
 msgstr ""
 
-#: bp-core/deprecated/1.5.php:178
-#: bp-themes/bp-default/members/single/profile/profile-wp.php:51
-msgid "AOL Messenger"
+#: bp-core/admin/bp-core-functions.php:329
+msgid "Each BuddyPress Component needs its own WordPress page. The following WordPress Pages have more than one component associated with them: %2$s. <a href=\"%1$s\" class=\"button-secondary\">Repair</a>"
 msgstr ""
 
-#: bp-core/deprecated/1.5.php:187
-#: bp-themes/bp-default/members/single/profile/profile-wp.php:60
-msgid "Yahoo Messenger"
+#: bp-core/admin/bp-core-functions.php:342
+msgid "IMPORTANT: <a href=\"http://codex.buddypress.org/buddypress-site-administration/upgrading-buddypress/\">Read this before attempting to update BuddyPress</a>"
 msgstr ""
 
-#: bp-core/deprecated/1.5.php:287 bp-core/bp-core-buddybar.php:473
-#: bp-members/bp-members-adminbar.php:281
-#: bp-members/bp-members-template.php:734 bp-themes/bp-default/sidebar.php:18
-msgid "Log Out"
+#: bp-core/admin/bp-core-functions.php:369 bp-core/admin/bp-core-slugs.php:26
+#: bp-core/admin/bp-core-update.php:58 bp-core/admin/bp-core-update.php:70
+#: bp-core/admin/bp-core-update.php:205
+msgid "Pages"
 msgstr ""
 
-#: bp-core/deprecated/1.5.php:334
-msgid "%1$s mentioned you in the group \"%2$s\""
+#: bp-core/admin/bp-core-functions.php:373
+#: bp-core/admin/bp-core-settings.php:258 bp-core/bp-core-admin.php:374
+#: bp-groups/bp-groups-loader.php:298 bp-groups/bp-groups-template.php:1276
+#: bp-settings/bp-settings-loader.php:23 bp-settings/bp-settings-loader.php:78
+#: bp-settings/bp-settings-loader.php:169
+msgid "Settings"
 msgstr ""
 
-#: bp-core/deprecated/1.5.php:336 bp-activity/bp-activity-notifications.php:69
-msgid ""
-"%1$s mentioned you in the group \"%2$s\":\n"
-"\n"
-"\"%3$s\"\n"
-"\n"
-"To view and respond to the message, log in and visit: %4$s\n"
-"\n"
-"---------------------\n"
+#: bp-core/admin/bp-core-functions.php:381 bp-core/admin/bp-core-update.php:409
+#: bp-core/bp-core-template.php:266 bp-forums/bp-forums-admin.php:14
+#: bp-forums/bp-forums-admin.php:47 bp-forums/bp-forums-admin.php:314
+#: bp-forums/bp-forums-loader.php:111 bp-forums/bp-forums-loader.php:190
+#: bp-forums/bp-forums-loader.php:233 bp-forums/deprecated/1.6.php:24
+msgid "Forums"
 msgstr ""
 
-#: bp-core/deprecated/1.5.php:346 bp-friends/bp-friends-notifications.php:36
-#: bp-friends/bp-friends-notifications.php:76
-#: bp-groups/bp-groups-notifications.php:32
-#: bp-groups/bp-groups-notifications.php:83
-#: bp-groups/bp-groups-notifications.php:139
-#: bp-groups/bp-groups-notifications.php:187
-#: bp-groups/bp-groups-notifications.php:241
-#: bp-messages/bp-messages-notifications.php:44
-#: bp-activity/bp-activity-notifications.php:90
-#: bp-activity/bp-activity-notifications.php:164
-#: bp-activity/bp-activity-notifications.php:209
-msgid "To disable these notifications please log in and go to: %s"
+#: bp-core/admin/bp-core-schema.php:247
+msgctxt "First XProfile group name"
+msgid "Base"
 msgstr ""
 
-#: bp-core/bp-core-functions.php:371
-msgid "<strong>BuddyPress is almost ready</strong>. You must <a href=\"%s\">update your permalink structure</a> to something other than the default for it to work."
+#: bp-core/admin/bp-core-schema.php:251
+msgctxt "XProfile fullname field name"
+msgid "Name"
 msgstr ""
 
-#: bp-core/bp-core-functions.php:384
-msgid "You'll need to <a href='%s'>activate a <strong>BuddyPress-compatible theme</strong></a> to take advantage of all of BuddyPress's features. We've bundled a default theme, but you can always <a href='%s'>install some other compatible themes</a> or <a href='%s'>update your existing WordPress theme</a>."
+#: bp-core/admin/bp-core-settings.php:31
+msgid "Show the Toolbar for logged out users"
 msgstr ""
 
-#: bp-core/bp-core-functions.php:426
-msgid "The following active BuddyPress Components do not have associated WordPress Pages: %2$s. <a href=\"%1$s\" class=\"button-secondary\">Repair</a>"
+#: bp-core/admin/bp-core-settings.php:47
+msgid "Allow registered members to delete their own accounts"
 msgstr ""
 
-#: bp-core/bp-core-functions.php:451
-msgid "Each BuddyPress Component needs its own WordPress page. The following WordPress Pages have more than one component associated with them: %2$s. <a href=\"%1$s\" class=\"button-secondary\">Repair</a>"
+#: bp-core/admin/bp-core-settings.php:62
+msgid "Switch to WordPress Toolbar"
 msgstr ""
 
-#: bp-core/bp-core-functions.php:601
-msgid "sometime"
+#: bp-core/admin/bp-core-settings.php:87
+msgid "Allow Akismet to scan for activity stream spam"
 msgstr ""
 
-#: bp-core/bp-core-functions.php:602
-msgid "right now"
+#: bp-core/admin/bp-core-settings.php:101
+msgid "Allow activity stream commenting on blog and forum posts"
 msgstr ""
 
-#: bp-core/bp-core-functions.php:603
-msgid "%s ago"
+#: bp-core/admin/bp-core-settings.php:153
+msgid "Enable BuddyPress to WordPress profile syncing"
 msgstr ""
 
-#: bp-core/bp-core-functions.php:607
-msgid "year"
+#: bp-core/admin/bp-core-settings.php:169
+msgid "Allow registered members to upload avatars"
 msgstr ""
 
-#: bp-core/bp-core-functions.php:607
-msgid "years"
+#: bp-core/admin/bp-core-settings.php:194
+msgid "Enable group creation for all users"
 msgstr ""
 
-#: bp-core/bp-core-functions.php:608
-msgid "month"
+#: bp-core/admin/bp-core-settings.php:195
+msgid "Administrators can always create groups, regardless of this setting."
 msgstr ""
 
-#: bp-core/bp-core-functions.php:608
-msgid "months"
+#: bp-core/admin/bp-core-settings.php:226
+msgid "Attempt to save a new config file."
 msgstr ""
 
-#: bp-core/bp-core-functions.php:609
-msgid "week"
+#: bp-core/admin/bp-core-settings.php:226
+msgid "Repair"
 msgstr ""
 
-#: bp-core/bp-core-functions.php:609
-msgid "weeks"
+#: bp-core/admin/bp-core-settings.php:227
+msgid "File does not exist"
 msgstr ""
 
-#: bp-core/bp-core-functions.php:610
-msgid "day"
+#: bp-core/admin/bp-core-settings.php:231
+msgid "Absolute path to your bbPress configuration file."
 msgstr ""
 
-#: bp-core/bp-core-functions.php:610
-msgid "days"
+#: bp-core/admin/bp-core-settings.php:267
+#: bp-themes/bp-default/groups/single/admin.php:32
+#: bp-themes/bp-default/groups/single/admin.php:117
+#: bp-themes/bp-default/groups/single/forum/edit.php:58
+#: bp-themes/bp-default/groups/single/forum/edit.php:74
+#: bp-themes/bp-default/members/single/profile/edit.php:146
+#: bp-themes/bp-default/members/single/settings/general.php:72
+#: bp-themes/bp-default/members/single/settings/notifications.php:61
+#: bp-xprofile/bp-xprofile-classes.php:363
+msgid "Save Changes"
 msgstr ""
 
-#: bp-core/bp-core-functions.php:611
-msgid "hour"
+#: bp-core/admin/bp-core-slugs.php:32
+msgid "Save All"
 msgstr ""
 
-#: bp-core/bp-core-functions.php:611
-msgid "hours"
+#: bp-core/admin/bp-core-slugs.php:82
+msgid "Directories"
 msgstr ""
 
-#: bp-core/bp-core-functions.php:612
-msgid "minute"
+#: bp-core/admin/bp-core-slugs.php:84
+msgid "Associate a WordPress Page with each BuddyPress component directory."
 msgstr ""
 
-#: bp-core/bp-core-functions.php:612
-msgid "minutes"
+#: bp-core/admin/bp-core-slugs.php:103 bp-core/admin/bp-core-slugs.php:164
+msgid "- None -"
 msgstr ""
 
-#: bp-core/bp-core-functions.php:613
-msgid "second"
+#: bp-core/admin/bp-core-slugs.php:107 bp-core/admin/bp-core-slugs.php:168
+msgid "New Page"
 msgstr ""
 
-#: bp-core/bp-core-functions.php:613
-msgid "seconds"
+#: bp-core/admin/bp-core-slugs.php:108 bp-core/admin/bp-core-slugs.php:169
+#: bp-themes/bp-default/members/single/settings/capabilities.php:61
+#: bp-xprofile/bp-xprofile-classes.php:912
+msgid "Save"
 msgstr ""
 
-#: bp-core/bp-core-functions.php:670
-msgctxt "Separator in time since"
-msgid ","
+#: bp-core/admin/bp-core-slugs.php:146
+msgid "Registration"
 msgstr ""
 
-#: bp-core/bp-core-functions.php:733
-msgid "not recently active"
+#: bp-core/admin/bp-core-slugs.php:148
+msgid "Associate WordPress Pages with the following BuddyPress Registration pages."
 msgstr ""
 
-#: bp-core/bp-core-catchuri.php:258
-msgid "This user has been marked as a spammer. Only site admins can view this profile."
+#: bp-core/admin/bp-core-update.php:59 bp-core/admin/bp-core-update.php:209
+msgid "Permalinks"
 msgstr ""
 
-#: bp-core/bp-core-catchuri.php:402 bp-core/bp-core-catchuri.php:459
-msgid "You must log in to access the page you requested."
+#: bp-core/admin/bp-core-update.php:60 bp-core/admin/bp-core-update.php:213
+msgid "Theme"
 msgstr ""
 
-#: bp-core/bp-core-buddybar.php:244
-msgid "You do not have access to this page."
+#: bp-core/admin/bp-core-update.php:61 bp-core/admin/bp-core-update.php:80
+#: bp-core/admin/bp-core-update.php:178 bp-core/admin/bp-core-update.php:221
+#: bp-themes/bp-default/groups/create.php:289
+msgid "Finish"
 msgstr ""
 
-#: bp-core/bp-core-buddybar.php:415 bp-themes/bp-default/sidebar.php:53
-msgid "Log In"
+#: bp-core/admin/bp-core-update.php:75 bp-core/admin/bp-core-update.php:217
+#: bp-core/bp-core-admin.php:286 bp-core/bp-core-admin.php:291
+msgid "Toolbar"
 msgstr ""
 
-#: bp-core/bp-core-buddybar.php:419
-msgid "Sign Up"
+#: bp-core/admin/bp-core-update.php:78 bp-core/admin/bp-core-update.php:197
+msgid "Database Update"
 msgstr ""
 
-#: bp-core/bp-core-buddybar.php:431
-msgid "My Account"
+#: bp-core/admin/bp-core-update.php:135
+msgid "Setup"
 msgstr ""
 
-#: bp-core/bp-core-buddybar.php:502
-msgid "Visit"
+#: bp-core/admin/bp-core-update.php:143
+msgid "BuddyPress %s"
 msgstr ""
 
-#: bp-core/bp-core-buddybar.php:504
-msgid "Random Member"
+#: bp-core/admin/bp-core-update.php:181
+msgid "Finish &amp; Activate"
 msgstr ""
 
-#: bp-core/bp-core-buddybar.php:508
-msgid "Random Group"
+#: bp-core/admin/bp-core-update.php:187
+msgid "Save &amp; Next"
 msgstr ""
 
-#: bp-core/bp-core-buddybar.php:514
-msgid "Random Site"
+#: bp-core/admin/bp-core-update.php:238
+msgid "To complete the update, a few changes need to be made to your database. These changes are not destructive and will not remove or change any existing settings."
 msgstr ""
 
-#: bp-core/bp-core-loader.php:210 bp-xprofile/bp-xprofile-loader.php:113
-#: bp-xprofile/bp-xprofile-loader.php:177 bp-members/bp-members-loader.php:141
-msgid "Profile"
+#: bp-core/admin/bp-core-update.php:256
+msgid "BuddyPress bundles several individual social components together, each one adding a distinct feature. This first step decides which features are enabled on your site; all features are enabled by default. Don't worry, you can change your mind at any point in the future."
 msgstr ""
 
-#: bp-core/bp-core-loader.php:221 bp-groups/bp-groups-template.php:520
-#: bp-xprofile/bp-xprofile-loader.php:125 bp-members/bp-members-loader.php:156
-msgid "Public"
+#: bp-core/admin/bp-core-update.php:298
+msgid "members"
 msgstr ""
 
-#: bp-friends/bp-friends-loader.php:78
-msgid "Search Friends..."
+#: bp-core/admin/bp-core-update.php:301
+msgid "groups"
 msgstr ""
 
-#: bp-friends/bp-friends-loader.php:96
-msgid "Friends <span>%d</span>"
+#: bp-core/admin/bp-core-update.php:304
+msgid "activity"
 msgstr ""
 
-#: bp-friends/bp-friends-loader.php:108 bp-friends/bp-friends-loader.php:169
-#: bp-friends/bp-friends-loader.php:196
-#: bp-themes/bp-default/members/single/activity.php:35
-#: bp-themes/bp-default/activity/index.php:122
-msgid "Friendships"
+#: bp-core/admin/bp-core-update.php:307
+msgid "forums"
 msgstr ""
 
-#: bp-friends/bp-friends-loader.php:118 bp-groups/bp-groups-template.php:1288
-msgid "Requests"
+#: bp-core/admin/bp-core-update.php:310
+msgid "blogs"
 msgstr ""
 
-#: bp-friends/bp-friends-loader.php:150
-msgid "Friends <span class=\"count\">%s</span>"
+#: bp-core/admin/bp-core-update.php:313
+msgid "register"
 msgstr ""
 
-#: bp-friends/bp-friends-loader.php:151
-msgid "Pending Requests <span class=\"count\">%s</span>"
+#: bp-core/admin/bp-core-update.php:316
+msgid "activate"
 msgstr ""
 
-#: bp-friends/bp-friends-loader.php:153 bp-friends/bp-friends-screens.php:68
-#: bp-activity/bp-activity-loader.php:171
-#: bp-activity/bp-activity-loader.php:268
-msgid "Friends"
+#: bp-core/admin/bp-core-update.php:328
+msgid "BuddyPress uses WordPress pages to display directories. This allows you to easily change their titles and relocate them."
 msgstr ""
 
-#: bp-friends/bp-friends-loader.php:154
-msgid "No Pending Requests"
+#: bp-core/admin/bp-core-update.php:330
+msgid "Choose an existing page, have one auto-created, or create them manually and come back here once you are finished."
 msgstr ""
 
-#: bp-friends/bp-friends-notifications.php:24
-msgid "New friendship request from %s"
+#: bp-core/admin/bp-core-update.php:336 bp-core/bp-core-template.php:257
+#: bp-core/bp-core-widgets.php:19 bp-core/bp-core-widgets.php:111
+#: bp-groups/bp-groups-template.php:1284 bp-members/bp-members-loader.php:24
+#: bp-themes/bp-default/groups/single/admin.php:231
+msgid "Members"
 msgstr ""
 
-#: bp-friends/bp-friends-notifications.php:26
-msgid ""
-"%1$s wants to add you as a friend.\n"
-"\n"
-"To view all of your pending friendship requests: %2$s\n"
-"\n"
-"To view %3$s's profile: %4$s\n"
-"\n"
-"---------------------\n"
+#: bp-core/admin/bp-core-update.php:337
+msgid "Displays member profiles, and a directory of all site members."
 msgstr ""
 
-#: bp-friends/bp-friends-notifications.php:66
-#: bp-friends/bp-friends-activity.php:79
-msgid "%s accepted your friendship request"
+#: bp-core/admin/bp-core-update.php:340 bp-core/admin/bp-core-update.php:358
+#: bp-core/admin/bp-core-update.php:377 bp-core/admin/bp-core-update.php:395
+#: bp-core/admin/bp-core-update.php:413 bp-core/admin/bp-core-update.php:429
+#: bp-core/admin/bp-core-update.php:443
+msgid "Automatically create a page at:"
 msgstr ""
 
-#: bp-friends/bp-friends-notifications.php:68
-msgid ""
-"%1$s accepted your friend request.\n"
-"\n"
-"To view %2$s's profile: %3$s\n"
-"\n"
-"---------------------\n"
+#: bp-core/admin/bp-core-update.php:342 bp-core/admin/bp-core-update.php:360
+#: bp-core/admin/bp-core-update.php:379 bp-core/admin/bp-core-update.php:397
+#: bp-core/admin/bp-core-update.php:415 bp-core/admin/bp-core-update.php:431
+#: bp-core/admin/bp-core-update.php:445
+msgid "- Select -"
 msgstr ""
 
-#: bp-friends/bp-friends-template.php:62 bp-friends/bp-friends-template.php:81
-#: bp-groups/bp-groups-template.php:2276 bp-groups/bp-groups-template.php:2297
-msgid "Recently Active"
+#: bp-core/admin/bp-core-update.php:344 bp-core/admin/bp-core-update.php:361
+#: bp-core/admin/bp-core-update.php:380 bp-core/admin/bp-core-update.php:398
+#: bp-core/admin/bp-core-update.php:416 bp-core/admin/bp-core-update.php:432
+#: bp-core/admin/bp-core-update.php:446
+msgid "Use an existing page:"
 msgstr ""
 
-#: bp-friends/bp-friends-template.php:64 bp-friends/bp-friends-template.php:87
-#: bp-groups/bp-groups-template.php:2281 bp-groups/bp-groups-template.php:2312
-msgid "Alphabetically"
+#: bp-core/admin/bp-core-update.php:355
+msgid "Displays individual groups as well as a directory of groups."
 msgstr ""
 
-#: bp-friends/bp-friends-template.php:101
-msgid "My Friends"
+#: bp-core/admin/bp-core-update.php:373 bp-core/bp-core-template.php:263
+msgid "Blogs"
 msgstr ""
 
-#: bp-friends/bp-friends-template.php:101
-msgid "%s's Friends"
+#: bp-core/admin/bp-core-update.php:374
+msgid "Displays a directory of the blogs in your network."
 msgstr ""
 
-#: bp-friends/bp-friends-template.php:101
-msgid "See All"
+#: bp-core/admin/bp-core-update.php:392
+msgid "Displays the activity for the entire site, a member's friends, groups and @mentions."
 msgstr ""
 
-#: bp-friends/bp-friends-template.php:121
-msgid "You haven't added any friend connections yet."
+#: bp-core/admin/bp-core-update.php:410
+msgid "Displays a directory of public forum topics."
 msgstr ""
 
-#: bp-friends/bp-friends-template.php:121
-msgid "%s hasn't created any friend connections yet."
+#: bp-core/admin/bp-core-update.php:426
+msgid "Displays a site registration page where users can create new accounts."
 msgstr ""
 
-#: bp-friends/bp-friends-template.php:190
-msgid "There aren't enough site members to show a random sample just yet."
+#: bp-core/admin/bp-core-update.php:440
+msgid "The page users will visit to activate their account once they have registered."
 msgstr ""
 
-#: bp-friends/bp-friends-template.php:201
-msgid "Filter Friends"
+#: bp-core/admin/bp-core-update.php:473
+msgid "Your permalink settings are compatible with BuddyPress."
 msgstr ""
 
-#: bp-friends/bp-friends-template.php:238
-msgid "%d friend"
+#: bp-core/admin/bp-core-update.php:475
+msgid "Pretty permalinks must be active on your site."
 msgstr ""
 
-#: bp-friends/bp-friends-template.php:240
-msgid "%d friends"
+#: bp-core/admin/bp-core-update.php:481
+msgid "For more advanced options please visit the <a href=\"%s\">permalink settings page</a> now and come back here later."
 msgstr ""
 
-#: bp-friends/bp-friends-template.php:323
-#: bp-friends/bp-friends-template.php:324
-#: bp-themes/bp-default/_inc/ajax.php:431
-msgid "Friendship Requested"
+#: bp-core/admin/bp-core-update.php:485
+msgid "Day and name"
 msgstr ""
 
-#: bp-friends/bp-friends-template.php:338
-#: bp-friends/bp-friends-template.php:339
-msgid "Cancel Friendship"
+#: bp-core/admin/bp-core-update.php:489
+msgid "Month and name"
 msgstr ""
 
-#: bp-friends/bp-friends-template.php:355
-#: bp-friends/bp-friends-template.php:356
-#: bp-themes/bp-default/_inc/ajax.php:421
-msgid "Add Friend"
+#: bp-core/admin/bp-core-update.php:493
+msgid "Numeric"
 msgstr ""
 
-#: bp-friends/bp-friends-actions.php:29 bp-themes/bp-default/_inc/ajax.php:429
-msgid "Friendship could not be requested."
+#: bp-core/admin/bp-core-update.php:559
+msgid "Use BuddyPress Default"
 msgstr ""
 
-#: bp-friends/bp-friends-actions.php:31
-msgid "Friendship requested"
+#: bp-core/admin/bp-core-update.php:560
+msgid "BuddyPress Default"
 msgstr ""
 
-#: bp-friends/bp-friends-actions.php:35
-msgid "You are already friends with this user"
+#: bp-core/admin/bp-core-update.php:563
+msgid "The default BuddyPress theme comes with the basics, to get up and running out of the box. It supports all features and is highly customizable."
 msgstr ""
 
-#: bp-friends/bp-friends-actions.php:37
-msgid "You already have a pending friendship request with this user"
+#: bp-core/admin/bp-core-update.php:564
+msgid "This is the best choice if you want to start using BuddyPress immediately."
 msgstr ""
 
-#: bp-friends/bp-friends-actions.php:64 bp-themes/bp-default/_inc/ajax.php:419
-msgid "Friendship could not be canceled."
+#: bp-core/admin/bp-core-update.php:565
+msgid "Yes, please!"
 msgstr ""
 
-#: bp-friends/bp-friends-actions.php:66
-msgid "Friendship canceled"
+#: bp-core/admin/bp-core-update.php:573
+msgid "Other themes"
 msgstr ""
 
-#: bp-friends/bp-friends-actions.php:70
-msgid "You are not yet friends with this user"
+#: bp-core/admin/bp-core-update.php:574
+msgid "A BuddyPress theme"
 msgstr ""
 
-#: bp-friends/bp-friends-actions.php:72
-msgid "You have a pending friendship request with this user"
+#: bp-core/admin/bp-core-update.php:577
+msgid "You have some other BuddyPress compatible themes available. Pick one of them from this list to use it."
 msgstr ""
 
-#: bp-friends/bp-friends-functions.php:94
-#: bp-friends/bp-friends-functions.php:103
-msgid "%1$s and %2$s are now friends"
+#: bp-core/admin/bp-core-update.php:580
+msgid "Use this theme"
 msgstr ""
 
-#: bp-friends/bp-friends-screens.php:28
-msgid "Friendship accepted"
+#: bp-core/admin/bp-core-update.php:601
+msgid "Manually update current theme"
 msgstr ""
 
-#: bp-friends/bp-friends-screens.php:30
-msgid "Friendship could not be accepted"
+#: bp-core/admin/bp-core-update.php:605
+msgid "Your existing theme"
 msgstr ""
 
-#: bp-friends/bp-friends-screens.php:39
-msgid "Friendship rejected"
+#: bp-core/admin/bp-core-update.php:611
+msgid "The BuddyPress Template Pack will guide you through the process of manually editing your existing theme. It comes with a step-by-step guide and involves copying the BuddyPress template files into your theme. <strong>This option requires knowledge of CSS and HTML.</strong> You will need to tweak the new templates to match your existing theme."
 msgstr ""
 
-#: bp-friends/bp-friends-screens.php:41
-msgid "Friendship could not be rejected"
+#: bp-core/admin/bp-core-update.php:615
+msgid "Install BuddyPress Template Pack"
 msgstr ""
 
-#: bp-friends/bp-friends-screens.php:77
-msgid "A member sends you a friendship request"
+#: bp-core/admin/bp-core-update.php:619
+msgid "Choose this option (go to Appearance &rarr; BP Compatibility after setup is complete)"
 msgstr ""
 
-#: bp-friends/bp-friends-screens.php:83
-msgid "A member accepts your friendship request"
+#: bp-core/admin/bp-core-update.php:620
+msgid "Plugin Installed"
 msgstr ""
 
-#: bp-friends/bp-friends-activity.php:50
-msgid "New friendship created"
+#: bp-core/admin/bp-core-update.php:631
+msgid "Do not change theme"
 msgstr ""
 
-#: bp-friends/bp-friends-activity.php:76
-msgid "%d friends accepted your friendship requests"
+#: bp-core/admin/bp-core-update.php:634
+msgid "You are happy with your current theme and plan on changing it later."
 msgstr ""
 
-#: bp-friends/bp-friends-activity.php:90
-msgid "You have %d pending friendship requests"
+#: bp-core/admin/bp-core-update.php:635
+msgid "This is the best choice if you have a custom theme already and want to manually integrate BuddyPress later."
 msgstr ""
 
-#: bp-friends/bp-friends-activity.php:93
-msgid "You have a friendship request from %s"
+#: bp-core/admin/bp-core-update.php:637
+msgid "Don't change my current theme"
 msgstr ""
 
-#: bp-settings/bp-settings-loader.php:92 bp-settings/bp-settings-loader.php:158
-msgid "General"
+#: bp-core/admin/bp-core-update.php:662
+msgid "BuddyPress now uses the WordPress Toolbar; we've turbo-charged it by adding social items to help your users explore your site and manage their content."
 msgstr ""
 
-#: bp-settings/bp-settings-loader.php:103
-#: bp-settings/bp-settings-loader.php:166
-#: bp-members/bp-members-adminbar.php:217 bp-members/bp-members-buddybar.php:13
-msgid "Notifications"
+#: bp-core/admin/bp-core-update.php:664
+msgid "We've noticed that your site uses the old bar from earlier versions of BuddyPress."
 msgstr ""
 
-#: bp-settings/bp-settings-loader.php:115
-#: bp-settings/bp-settings-loader.php:175
-#: bp-members/bp-members-adminbar.php:196
-#: bp-themes/bp-default/members/single/settings/delete-account.php:50
-msgid "Delete Account"
+#: bp-core/admin/bp-core-update.php:669
+msgid "If you'd prefer to not switch to the WordPress Toolbar just yet, check this box. Don't worry, you can change your mind later."
 msgstr ""
 
-#: bp-settings/bp-settings-actions.php:102
-#: bp-settings/bp-settings-actions.php:141
-#: bp-xprofile/bp-xprofile-screens.php:113
-msgid "Changes saved."
+#: bp-core/admin/bp-core-update.php:687
+msgid "setup"
 msgstr ""
 
-#: bp-settings/bp-settings-actions.php:105
-msgid "Your new passwords did not match."
+#: bp-core/admin/bp-core-update.php:687
+msgid "update"
 msgstr ""
 
-#: bp-settings/bp-settings-actions.php:108
-msgid "Your existing password is incorrect."
+#: bp-core/admin/bp-core-update.php:689
+msgid "The BuddyPress %1$s is complete, and your site is ready to go!"
 msgstr ""
 
-#: bp-settings/bp-settings-actions.php:111
-msgid "Sorry, that email address is already used or is invalid."
+#: bp-core/admin/bp-core-update.php:826
+msgid "Oops, there was a problem creating a configuration file. "
 msgstr ""
 
-#: bp-groups/bp-groups-actions.php:24
-msgid "Sorry, you are not allowed to create groups."
+#: bp-core/admin/bp-core-update.php:832
+msgid "If your <code>web.config</code> file were <a href=\"http://codex.wordpress.org/Changing_File_Permissions\">writable</a>, we could do this automatically, but it isn&#8217;t so this is the url rewrite rule you should have in your <code>web.config</code> file. Click in the field and press <kbd>CTRL + a</kbd> to select all. Then insert this rule inside of the <code>/&lt;configuration&gt;/&lt;system.webServer&gt;/&lt;rewrite&gt;/&lt;rules&gt;</code> element in <code>web.config</code> file."
 msgstr ""
 
-#: bp-groups/bp-groups-actions.php:46
-msgid "There was an error saving group details. Please try again."
+#: bp-core/admin/bp-core-update.php:841
+msgid "Permalink structure updated. Remove write access on web.config file now!"
 msgstr ""
 
-#: bp-groups/bp-groups-actions.php:68
-msgid "Please fill in all of the required fields"
+#: bp-core/admin/bp-core-update.php:846
+msgid "If your <code>.htaccess</code> file were <a href=\"http://codex.wordpress.org/Changing_File_Permissions\">writable</a>, we could do this automatically, but it isn&#8217;t so these are the mod_rewrite rules you should have in your <code>.htaccess</code> file. Click in the field and press <kbd>CTRL + a</kbd> to select all."
 msgstr ""
 
-#: bp-groups/bp-groups-actions.php:75 bp-groups/bp-groups-actions.php:102
-msgid "There was an error saving group details, please try again."
+#: bp-core/admin/bp-core-update.php:858
+msgid "Paste all these rules into a new <code>.htaccess</code> file in the root of your WordPress installation and save the file. Once you're done, please hit the \"Save and Next\" button to continue."
 msgstr ""
 
-#: bp-groups/bp-groups-actions.php:141
-msgid "%1$s created the group %2$s"
+#: bp-core/bp-core-admin.php:192
+msgid "BuddyPress Setup"
 msgstr ""
 
-#: bp-groups/bp-groups-actions.php:189
-msgid "There was an error saving the group avatar, please try uploading again."
+#: bp-core/bp-core-admin.php:194
+msgid "Update BuddyPress"
 msgstr ""
 
-#: bp-groups/bp-groups-actions.php:191
-msgid "The group avatar was uploaded successfully!"
+#: bp-core/bp-core-admin.php:216 bp-core/bp-core-admin.php:217
+#: bp-core/bp-core-admin.php:237 bp-members/bp-members-functions.php:1310
+msgid "BuddyPress"
 msgstr ""
 
-#: bp-groups/bp-groups-actions.php:215 bp-groups/bp-groups-actions.php:222
-msgid "There was an error joining the group."
+#: bp-core/bp-core-admin.php:226
+msgid "BuddyPress Help"
 msgstr ""
 
-#: bp-groups/bp-groups-actions.php:224
-msgid "You joined the group!"
+#: bp-core/bp-core-admin.php:227
+msgid "Help"
 msgstr ""
 
-#: bp-groups/bp-groups-actions.php:250 bp-groups/bp-groups-screens.php:646
-msgid "This group must have at least one admin"
+#: bp-core/bp-core-admin.php:236
+msgid "BuddyPress Components"
 msgstr ""
 
-#: bp-groups/bp-groups-actions.php:253
-msgid "There was an error leaving the group."
+#: bp-core/bp-core-admin.php:245 bp-core/bp-core-admin.php:246
+msgid "BuddyPress Pages"
 msgstr ""
 
-#: bp-groups/bp-groups-actions.php:255 bp-groups/bp-groups-functions.php:280
-msgid "You successfully left the group."
+#: bp-core/bp-core-admin.php:254 bp-core/bp-core-admin.php:255
+msgid "BuddyPress Settings"
 msgstr ""
 
-#: bp-groups/bp-groups-activity.php:21
-msgid "Created a group"
+#: bp-core/bp-core-admin.php:283
+msgid "Main Settings"
 msgstr ""
 
-#: bp-groups/bp-groups-activity.php:22
-msgid "Joined a group"
+#: bp-core/bp-core-admin.php:296
+msgid "Account Deletion"
 msgstr ""
 
-#: bp-groups/bp-groups-activity.php:23
-msgid "New group forum topic"
+#: bp-core/bp-core-admin.php:304
+msgid "Profile Settings"
 msgstr ""
 
-#: bp-groups/bp-groups-activity.php:24
-msgid "New group forum post"
+#: bp-core/bp-core-admin.php:307
+msgid "Avatar Uploads"
 msgstr ""
 
-#: bp-groups/bp-groups-activity.php:93
-msgid "%1$d new membership requests for the group \"%2$s\""
+#: bp-core/bp-core-admin.php:311
+msgid "Profile Syncing"
 msgstr ""
 
-#: bp-groups/bp-groups-activity.php:98
-msgid "Group Membership Requests"
+#: bp-core/bp-core-admin.php:320
+msgid "Groups Settings"
 msgstr ""
 
-#: bp-groups/bp-groups-activity.php:107 bp-groups/bp-groups-activity.php:112
-msgid "%s requests group membership"
+#: bp-core/bp-core-admin.php:323
+msgid "Group Creation"
 msgstr ""
 
-#: bp-groups/bp-groups-activity.php:130
-msgid "%d accepted group membership requests"
+#: bp-core/bp-core-admin.php:332
+msgid "Forums Settings"
 msgstr ""
 
-#: bp-groups/bp-groups-activity.php:143
-msgid "Membership for group \"%s\" accepted"
+#: bp-core/bp-core-admin.php:335
+msgid "bbPress Configuration"
 msgstr ""
 
-#: bp-groups/bp-groups-activity.php:166
-msgid "%d rejected group membership requests"
+#: bp-core/bp-core-admin.php:344
+msgid "Activity Settings"
 msgstr ""
 
-#: bp-groups/bp-groups-activity.php:179
-msgid "Membership for group \"%s\" rejected"
+#: bp-core/bp-core-admin.php:347
+msgid "Blog &amp; Forum Comments"
 msgstr ""
 
-#: bp-groups/bp-groups-activity.php:202
-msgid "You were promoted to an admin in %d groups"
+#: bp-core/bp-core-admin.php:352
+msgid "Akismet"
 msgstr ""
 
-#: bp-groups/bp-groups-activity.php:215
-msgid "You were promoted to an admin in the group \"%s\""
+#: bp-core/bp-core-admin.php:482
+msgid "BuddyPress has been updated! Please run the <a href=\"%s\">update wizard</a>."
 msgstr ""
 
-#: bp-groups/bp-groups-activity.php:238
-msgid "You were promoted to a mod in %d groups"
+#: bp-core/bp-core-admin.php:487
+msgid "BuddyPress was successfully activated! Please run the <a href=\"%s\">installation wizard</a>."
 msgstr ""
 
-#: bp-groups/bp-groups-activity.php:251
-msgid "You were promoted to a mod in the group \"%s\""
+#: bp-core/bp-core-adminbar.php:36 bp-core/bp-core-buddybar.php:495
+msgid "My Account"
 msgstr ""
 
-#: bp-groups/bp-groups-activity.php:275
-msgid "You have %d new group invitations"
+#: bp-core/bp-core-avatars.php:221
+msgid "Avatar Image"
 msgstr ""
 
-#: bp-groups/bp-groups-activity.php:279
-msgid "Group Invites"
+#: bp-core/bp-core-avatars.php:481
+msgid "There is no error, the file uploaded with success"
 msgstr ""
 
-#: bp-groups/bp-groups-activity.php:287
-msgid "You have an invitation to the group: %s"
+#: bp-core/bp-core-avatars.php:482 bp-core/bp-core-avatars.php:483
+msgid "Your image was bigger than the maximum allowed file size of: "
 msgstr ""
 
-#: bp-groups/bp-groups-loader.php:84
-msgid "Search Groups..."
+#: bp-core/bp-core-avatars.php:484
+msgid "The uploaded file was only partially uploaded"
 msgstr ""
 
-#: bp-groups/bp-groups-loader.php:172
-msgid "You do not have access to this group."
+#: bp-core/bp-core-avatars.php:485
+msgid "No file was uploaded"
 msgstr ""
 
-#: bp-groups/bp-groups-loader.php:185 bp-groups/bp-groups-template.php:1272
-msgid "Details"
+#: bp-core/bp-core-avatars.php:486
+msgid "Missing a temporary folder"
 msgstr ""
 
-#: bp-groups/bp-groups-loader.php:197 bp-groups/bp-groups-template.php:1282
-msgid "Avatar"
+#: bp-core/bp-core-avatars.php:490
+msgid "Your upload failed, please try again. Error was: %s"
 msgstr ""
 
-#: bp-groups/bp-groups-loader.php:205
-msgid "Invites"
+#: bp-core/bp-core-avatars.php:495
+msgid "The file you uploaded is too big. Please upload a file under %s"
 msgstr ""
 
-#: bp-groups/bp-groups-loader.php:231
-msgid "Groups <span>%d</span>"
+#: bp-core/bp-core-avatars.php:500
+msgid "Please upload only JPG, GIF or PNG photos."
 msgstr ""
 
-#: bp-groups/bp-groups-loader.php:243 bp-groups/bp-groups-loader.php:271
-#: bp-groups/bp-groups-loader.php:411 bp-groups/bp-groups-loader.php:439
-msgid "Memberships"
+#: bp-core/bp-core-avatars.php:511 bp-core/bp-core-avatars.php:546
+msgid "Upload Failed! Error was: %s"
 msgstr ""
 
-#: bp-groups/bp-groups-loader.php:254
-msgid "Invitations"
+#: bp-core/bp-core-avatars.php:561
+msgid "Upload failed! Error was: %s"
 msgstr ""
 
-#: bp-groups/bp-groups-loader.php:283
-msgctxt "Group home navigation title"
-msgid "Home"
+#: bp-core/bp-core-avatars.php:696 bp-core/bp-core-classes.php:174
+#: bp-core/bp-core-classes.php:175 bp-core/bp-core-classes.php:176
+#: bp-core/bp-core-template.php:98 bp-core/bp-core-template.php:107
+msgid "Avatar of %s"
 msgstr ""
 
-#: bp-groups/bp-groups-loader.php:295
-msgid "Admin"
+#: bp-core/bp-core-buddybar.php:303
+msgid "You do not have access to this page."
 msgstr ""
 
-#: bp-groups/bp-groups-loader.php:314 bp-groups/bp-groups-template.php:1580
-#: bp-groups/bp-groups-template.php:1581 bp-themes/bp-default/_inc/ajax.php:506
-msgid "Request Membership"
+#: bp-core/bp-core-buddybar.php:479 bp-themes/bp-default/sidebar.php:53
+msgid "Log In"
 msgstr ""
 
-#: bp-groups/bp-groups-loader.php:326
-msgid "Forum"
+#: bp-core/bp-core-buddybar.php:483
+msgid "Sign Up"
 msgstr ""
 
-#: bp-groups/bp-groups-loader.php:338
-msgid "Members <span>%s</span>"
+#: bp-core/bp-core-buddybar.php:537 bp-core/deprecated/1.5.php:287
+#: bp-members/bp-members-template.php:732 bp-themes/bp-default/sidebar.php:18
+msgid "Log Out"
 msgstr ""
 
-#: bp-groups/bp-groups-loader.php:350
-#: bp-themes/bp-default/groups/single/send-invites.php:60
-msgid "Send Invites"
+#: bp-core/bp-core-buddybar.php:566
+msgid "Visit"
 msgstr ""
 
-#: bp-groups/bp-groups-loader.php:392
-msgid "Groups <span class=\"count\">%s</span>"
+#: bp-core/bp-core-buddybar.php:568
+msgid "Random Member"
 msgstr ""
 
-#: bp-groups/bp-groups-loader.php:393
-msgid "Pending Invites <span class=\"count\">%s</span>"
+#: bp-core/bp-core-buddybar.php:572
+msgid "Random Group"
 msgstr ""
 
-#: bp-groups/bp-groups-loader.php:396
-msgid "No Pending Invites"
+#: bp-core/bp-core-buddybar.php:578
+msgid "Random Site"
 msgstr ""
 
-#: bp-groups/bp-groups-loader.php:458 bp-groups/bp-groups-buddybar.php:25
-#: bp-groups/bp-groups-template.php:2337
-msgid "Group Avatar"
+#: bp-core/bp-core-catchuri.php:281
+msgid "This user has been marked as a spammer. Only site admins can view this profile."
 msgstr ""
 
-#: bp-groups/bp-groups-classes.php:752
-msgid "Group Mod"
+#: bp-core/bp-core-catchuri.php:455 bp-core/bp-core-catchuri.php:514
+msgid "You must log in to access the page you requested."
 msgstr ""
 
-#: bp-groups/bp-groups-classes.php:758 bp-groups/bp-groups-functions.php:98
-msgid "Group Admin"
-msgstr ""
+#: bp-core/bp-core-classes.php:191
+msgid "%d group"
+msgid_plural "%d groups"
+msgstr[0] ""
+msgstr[1] ""
 
-#: bp-groups/bp-groups-notifications.php:10
-msgid "Group Details Updated"
+#: bp-core/bp-core-filters.php:178 bp-core/bp-core-filters.php:203
+msgid "[User Set]"
 msgstr ""
 
-#: bp-groups/bp-groups-notifications.php:24
+#: bp-core/bp-core-filters.php:222
 msgid ""
-"Group details for the group \"%1$s\" were updated:\n"
-"\n"
-"To view the group: %2$s\n"
+"Thanks for registering! To complete the activation of your account and blog, please click the following link:\n"
 "\n"
-"---------------------\n"
-msgstr ""
-
-#: bp-groups/bp-groups-notifications.php:68
-msgid "Membership request for group: %s"
-msgstr ""
-
-#: bp-groups/bp-groups-notifications.php:70
-msgid ""
-"%1$s wants to join the group \"%2$s\".\n"
+"%1$s\n"
 "\n"
-"Because you are the administrator of this group, you must either accept or reject the membership request.\n"
 "\n"
-"To view all pending membership requests for this group, please visit:\n"
-"%3$s\n"
 "\n"
-"To view %4$s's profile: %5$s\n"
+"After you activate, you can visit your blog here:\n"
 "\n"
-"---------------------\n"
+"%2$s"
 msgstr ""
 
-#: bp-groups/bp-groups-notifications.php:119
-msgid "Membership request for group \"%s\" accepted"
+#: bp-core/bp-core-filters.php:223
+msgid "Activate %s"
 msgstr ""
 
-#: bp-groups/bp-groups-notifications.php:120
+#: bp-core/bp-core-filters.php:255 bp-members/bp-members-functions.php:1312
 msgid ""
-"Your membership request for the group \"%1$s\" has been accepted.\n"
+"Thanks for registering! To complete the activation of your account please click the following link:\n"
 "\n"
-"To view the group please login and visit: %2$s\n"
+"%1$s\n"
 "\n"
-"---------------------\n"
 msgstr ""
 
-#: bp-groups/bp-groups-notifications.php:129
-msgid "Membership request for group \"%s\" rejected"
+#: bp-core/bp-core-filters.php:256 bp-members/bp-members-functions.php:1313
+msgid "Activate Your Account"
 msgstr ""
 
-#: bp-groups/bp-groups-notifications.php:130
-msgid ""
-"Your membership request for the group \"%1$s\" has been rejected.\n"
-"\n"
-"To submit another request please log in and visit: %2$s\n"
-"\n"
-"---------------------\n"
-msgstr ""
+#. translators: "displayed user's name | canonicalised component name"
+#. translators: "group name | group nav section name"
 
-#: bp-groups/bp-groups-notifications.php:155
-msgid "an administrator"
+#: bp-core/bp-core-filters.php:313 bp-core/bp-core-filters.php:319
+msgid "%1$s | %2$s"
 msgstr ""
 
-#: bp-groups/bp-groups-notifications.php:158
-msgid "a moderator"
-msgstr ""
+#. translators: "component item name | component nav section name | root
+#. component name"
 
-#: bp-groups/bp-groups-notifications.php:177
-msgid "You have been promoted in the group: \"%s\""
+#: bp-core/bp-core-filters.php:324
+msgid "%1$s | %2$s | %3$s"
 msgstr ""
 
-#: bp-groups/bp-groups-notifications.php:179
-msgid ""
-"You have been promoted to %1$s for the group: \"%2$s\".\n"
-"\n"
-"To view the group please visit: %3$s\n"
-"\n"
-"---------------------\n"
+#: bp-core/bp-core-filters.php:329 bp-core/bp-core-filters.php:331
+msgid "%s Directory"
 msgstr ""
 
-#: bp-groups/bp-groups-notifications.php:227
-msgid "You have an invitation to the group: \"%s\""
+#: bp-core/bp-core-filters.php:336
+#: bp-themes/bp-default/registration/register.php:23
+msgid "Create an Account"
 msgstr ""
 
-#: bp-groups/bp-groups-notifications.php:229
-msgid ""
-"One of your friends %1$s has invited you to the group: \"%2$s\".\n"
-"\n"
-"To view your group invites visit: %3$s\n"
-"\n"
-"To view the group visit: %4$s\n"
-"\n"
-"To view %5$s's profile visit: %6$s\n"
-"\n"
-"---------------------\n"
+#: bp-core/bp-core-filters.php:340
+#: bp-themes/bp-default/registration/activate.php:24
+msgid "Activate your Account"
 msgstr ""
 
-#: bp-groups/bp-groups-adminbar.php:78 bp-xprofile/bp-xprofile-admin.php:121
-msgid "Edit Group"
+#: bp-core/bp-core-filters.php:344 bp-themes/bp-default/groups/create.php:18
+#: bp-themes/bp-default/groups/index.php:21
+msgid "Create a Group"
 msgstr ""
 
-#: bp-groups/bp-groups-adminbar.php:87 bp-groups/bp-groups-buddybar.php:19
-msgid "Edit Details"
+#: bp-core/bp-core-functions.php:384
+msgid "sometime"
 msgstr ""
 
-#: bp-groups/bp-groups-adminbar.php:95
-msgid "Edit Settings"
+#: bp-core/bp-core-functions.php:385
+msgid "right now"
 msgstr ""
 
-#: bp-groups/bp-groups-adminbar.php:104 bp-members/bp-members-adminbar.php:169
-msgid "Edit Avatar"
+#: bp-core/bp-core-functions.php:386
+msgid "%s ago"
 msgstr ""
 
-#: bp-groups/bp-groups-adminbar.php:114 bp-groups/bp-groups-buddybar.php:31
-msgid "Manage Invitations"
+#: bp-core/bp-core-functions.php:390
+msgid "year"
 msgstr ""
 
-#: bp-groups/bp-groups-adminbar.php:123 bp-groups/bp-groups-buddybar.php:35
-msgid "Manage Members"
+#: bp-core/bp-core-functions.php:390
+msgid "years"
 msgstr ""
 
-#: bp-groups/bp-groups-adminbar.php:132 bp-groups/bp-groups-buddybar.php:39
-msgid "Membership Requests"
+#: bp-core/bp-core-functions.php:391
+msgid "month"
 msgstr ""
 
-#: bp-groups/bp-groups-adminbar.php:141 bp-groups/bp-groups-buddybar.php:43
-#: bp-xprofile/bp-xprofile-admin.php:125
-#: bp-themes/bp-default/groups/single/admin.php:358
-msgid "Delete Group"
+#: bp-core/bp-core-functions.php:391
+msgid "months"
 msgstr ""
 
-#: bp-groups/bp-groups-widgets.php:19
-msgid "A dynamic list of recently active, popular, and newest groups"
+#: bp-core/bp-core-functions.php:392
+msgid "week"
 msgstr ""
 
-#: bp-groups/bp-groups-widgets.php:68 bp-groups/bp-groups-widgets.php:168
-msgid "created %s"
+#: bp-core/bp-core-functions.php:392
+msgid "weeks"
 msgstr ""
 
-#: bp-groups/bp-groups-widgets.php:87
-msgid "There are no groups to display."
+#: bp-core/bp-core-functions.php:393
+msgid "day"
 msgstr ""
 
-#: bp-groups/bp-groups-widgets.php:120
-msgid "Max groups to show:"
+#: bp-core/bp-core-functions.php:393
+msgid "days"
 msgstr ""
 
-#: bp-groups/bp-groups-widgets.php:123
-msgid "Default groups to show:"
+#: bp-core/bp-core-functions.php:394
+msgid "hour"
 msgstr ""
 
-#: bp-groups/bp-groups-widgets.php:187
-msgid "No groups matched the current filter."
+#: bp-core/bp-core-functions.php:394
+msgid "hours"
 msgstr ""
 
-#: bp-groups/bp-groups-forums.php:71 bp-groups/bp-groups-forums.php:175
-msgid "%1$s replied to the forum topic %2$s in the group %3$s"
+#: bp-core/bp-core-functions.php:395
+msgid "minute"
 msgstr ""
 
-#: bp-groups/bp-groups-forums.php:110 bp-groups/bp-groups-forums.php:142
-msgid "%1$s started the forum topic %2$s in the group %3$s"
+#: bp-core/bp-core-functions.php:395
+msgid "minutes"
 msgstr ""
 
-#: bp-groups/bp-groups-screens.php:49
-msgid "Group invite could not be accepted"
+#: bp-core/bp-core-functions.php:396
+msgid "second"
 msgstr ""
 
-#: bp-groups/bp-groups-screens.php:51
-msgid "Group invite accepted"
+#: bp-core/bp-core-functions.php:396
+msgid "seconds"
 msgstr ""
 
-#: bp-groups/bp-groups-screens.php:57 bp-groups/bp-groups-functions.php:324
-#: bp-groups/bp-groups-functions.php:809
-msgid "%1$s joined the group %2$s"
+#: bp-core/bp-core-functions.php:455
+msgctxt "Separator in time since"
+msgid ","
 msgstr ""
 
-#: bp-groups/bp-groups-screens.php:71
-msgid "Group invite could not be rejected"
+#: bp-core/bp-core-functions.php:523
+msgid "Not recently active"
 msgstr ""
 
-#: bp-groups/bp-groups-screens.php:73
-msgid "Group invite rejected"
+#: bp-core/bp-core-loader.php:211 bp-members/bp-members-loader.php:157
+#: bp-xprofile/bp-xprofile-loader.php:150
+#: bp-xprofile/bp-xprofile-loader.php:214
+msgid "Profile"
 msgstr ""
 
-#: bp-groups/bp-groups-screens.php:149
-msgid "There was an error when replying to that topic"
+#: bp-core/bp-core-loader.php:222 bp-groups/bp-groups-template.php:522
+#: bp-members/bp-members-loader.php:171 bp-xprofile/bp-xprofile-loader.php:162
+msgid "Public"
 msgstr ""
 
-#: bp-groups/bp-groups-screens.php:151
-msgid "Your reply was posted successfully"
+#: bp-core/bp-core-template.php:65
+msgid "Options"
 msgstr ""
 
-#: bp-groups/bp-groups-screens.php:165
-msgid "There was an error when making that topic a sticky"
+#: bp-core/bp-core-template.php:202
+msgid "%1$s at %2$s"
 msgstr ""
 
-#: bp-groups/bp-groups-screens.php:167
-msgid "The topic was made sticky successfully"
+#: bp-core/bp-core-template.php:268 bp-themes/bp-default/activity/index.php:99
+#: bp-themes/bp-default/forums/forums-loop.php:40
+#: bp-themes/bp-default/members/single/activity.php:27
+msgid "Posts"
 msgstr ""
 
-#: bp-groups/bp-groups-screens.php:179
-msgid "There was an error when unsticking that topic"
+#: bp-core/bp-core-template.php:271
+msgid "Search these:"
 msgstr ""
 
-#: bp-groups/bp-groups-screens.php:181
-msgid "The topic was unstuck successfully"
+#: bp-core/bp-core-template.php:299
+msgid "Search anything..."
 msgstr ""
 
-#: bp-groups/bp-groups-screens.php:193
-msgid "There was an error when closing that topic"
+#: bp-core/bp-core-template.php:393
+msgid " [&hellip;]"
 msgstr ""
 
-#: bp-groups/bp-groups-screens.php:195
-msgid "The topic was closed successfully"
+#: bp-core/bp-core-widgets.php:18
+msgid "A dynamic list of recently active, popular, and newest members"
 msgstr ""
 
-#: bp-groups/bp-groups-screens.php:207
-msgid "There was an error when opening that topic"
+#: bp-core/bp-core-widgets.php:47 bp-core/bp-core-widgets.php:133
+#: bp-core/deprecated/1.6.php:111 bp-core/deprecated/1.6.php:134
+#: bp-groups/bp-groups-widgets.php:60 bp-groups/bp-groups-widgets.php:141
+#: bp-themes/bp-default/blogs/index.php:56
+#: bp-themes/bp-default/members/single/blogs.php:22
+msgid "Newest"
 msgstr ""
 
-#: bp-groups/bp-groups-screens.php:209
-msgid "The topic was opened successfully"
+#: bp-core/bp-core-widgets.php:48 bp-core/bp-core-widgets.php:134
+#: bp-groups/bp-groups-widgets.php:61 bp-groups/bp-groups-widgets.php:142
+msgid "Active"
 msgstr ""
 
-#: bp-groups/bp-groups-screens.php:230
-msgid "There was an error deleting the topic"
+#: bp-core/bp-core-widgets.php:52 bp-core/bp-core-widgets.php:135
+#: bp-groups/bp-groups-widgets.php:62 bp-groups/bp-groups-widgets.php:143
+msgid "Popular"
 msgstr ""
 
-#: bp-groups/bp-groups-screens.php:232
-msgid "The topic was deleted successfully"
+#: bp-core/bp-core-widgets.php:89
+msgid "No one has signed up yet!"
 msgstr ""
 
-#: bp-groups/bp-groups-screens.php:254
-msgid "There was an error when editing that topic"
+#: bp-core/bp-core-widgets.php:124 bp-core/bp-core-widgets.php:201
+#: bp-core/bp-core-widgets.php:265 bp-groups/bp-groups-widgets.php:132
+#: bp-themes/bp-default/forums/index.php:104
+#: bp-themes/bp-default/groups/single/forum/edit.php:47
+#: bp-themes/bp-default/groups/single/forum.php:75
+msgid "Title:"
 msgstr ""
 
-#: bp-groups/bp-groups-screens.php:256
-msgid "The topic was edited successfully"
+#: bp-core/bp-core-widgets.php:126
+msgid "Link widget title to Members directory"
 msgstr ""
 
-#: bp-groups/bp-groups-screens.php:280
-msgid "There was an error deleting that post"
+#: bp-core/bp-core-widgets.php:128
+msgid "Max members to show:"
 msgstr ""
 
-#: bp-groups/bp-groups-screens.php:282
-msgid "The post was deleted successfully"
+#: bp-core/bp-core-widgets.php:131
+msgid "Default members to show:"
 msgstr ""
 
-#: bp-groups/bp-groups-screens.php:304
-msgid "There was an error when editing that post"
+#: bp-core/bp-core-widgets.php:149
+msgid "Avatars of users who are currently online"
 msgstr ""
 
-#: bp-groups/bp-groups-screens.php:306
-msgid "The post was edited successfully"
+#: bp-core/bp-core-widgets.php:150
+msgid "Who's Online Avatars"
 msgstr ""
 
-#: bp-groups/bp-groups-screens.php:321 bp-groups/bp-groups-screens.php:338
-msgid "You have been banned from this group."
+#: bp-core/bp-core-widgets.php:173
+msgid "There are no users currently online"
 msgstr ""
 
-#: bp-groups/bp-groups-screens.php:346 bp-forums/bp-forums-screens.php:36
-msgid "Please provide a title for your forum topic."
+#: bp-core/bp-core-widgets.php:192
+msgid "Who's Online"
 msgstr ""
 
-#: bp-groups/bp-groups-screens.php:348 bp-forums/bp-forums-screens.php:38
-msgid "Forum posts cannot be empty. Please enter some text."
+#: bp-core/bp-core-widgets.php:203 bp-core/bp-core-widgets.php:267
+msgid "Max Members to show:"
 msgstr ""
 
-#: bp-groups/bp-groups-screens.php:351
-msgid "This group does not have a forum setup yet."
+#: bp-core/bp-core-widgets.php:213
+msgid "Avatars of recently active members"
 msgstr ""
 
-#: bp-groups/bp-groups-screens.php:358 bp-forums/bp-forums-screens.php:45
-msgid "There was an error when creating the topic"
+#: bp-core/bp-core-widgets.php:214
+msgid "Recently Active Member Avatars"
 msgstr ""
 
-#: bp-groups/bp-groups-screens.php:361 bp-forums/bp-forums-screens.php:48
-msgid "The topic was created successfully"
+#: bp-core/bp-core-widgets.php:237
+msgid "There are no recently active members"
 msgstr ""
 
-#: bp-groups/bp-groups-screens.php:405
-msgid "Group invites sent."
+#: bp-core/bp-core-widgets.php:322
+msgid "There were no members found, please try another filter."
 msgstr ""
 
-#: bp-groups/bp-groups-screens.php:433
-msgid "There was an error sending your group membership request, please try again."
+#: bp-core/deprecated/1.5.php:135
+#: bp-themes/bp-default/activity/post-form.php:45
+#: bp-themes/bp-default/members/single/profile/profile-wp.php:8
+#: bp-xprofile/bp-xprofile-loader.php:257
+msgid "My Profile"
 msgstr ""
 
-#: bp-groups/bp-groups-screens.php:435
-msgid "Your membership request was sent to the group administrator successfully. You will be notified when the group administrator responds to your request."
+#: bp-core/deprecated/1.5.php:142 bp-themes/bp-default/functions.php:641
+#: bp-themes/bp-default/members/single/profile/profile-wp.php:15
+msgid "Name"
 msgstr ""
 
-#: bp-groups/bp-groups-screens.php:482
-msgid "There was an error updating group details, please try again."
+#: bp-core/deprecated/1.5.php:151
+#: bp-themes/bp-default/members/single/profile/profile-wp.php:24
+msgid "About Me"
 msgstr ""
 
-#: bp-groups/bp-groups-screens.php:484
-msgid "Group details were successfully updated."
+#: bp-core/deprecated/1.5.php:160 bp-themes/bp-default/functions.php:645
+#: bp-themes/bp-default/members/single/profile/profile-wp.php:33
+msgid "Website"
 msgstr ""
 
-#: bp-groups/bp-groups-screens.php:525
-msgid "There was an error updating group settings, please try again."
+#: bp-core/deprecated/1.5.php:169
+#: bp-themes/bp-default/members/single/profile/profile-wp.php:42
+msgid "Jabber"
 msgstr ""
 
-#: bp-groups/bp-groups-screens.php:527
-msgid "Group settings were successfully updated."
+#: bp-core/deprecated/1.5.php:178
+#: bp-themes/bp-default/members/single/profile/profile-wp.php:51
+msgid "AOL Messenger"
 msgstr ""
 
-#: bp-groups/bp-groups-screens.php:558 bp-xprofile/bp-xprofile-actions.php:36
-msgid "Your avatar was deleted successfully!"
+#: bp-core/deprecated/1.5.php:187
+#: bp-themes/bp-default/members/single/profile/profile-wp.php:60
+msgid "Yahoo Messenger"
 msgstr ""
 
-#: bp-groups/bp-groups-screens.php:560 bp-xprofile/bp-xprofile-actions.php:38
-msgid "There was a problem deleting that avatar, please try again."
+#: bp-core/deprecated/1.5.php:335
+msgid "%1$s mentioned you in the group \"%2$s\""
 msgstr ""
 
-#: bp-groups/bp-groups-screens.php:588
-msgid "There was a problem cropping the avatar, please try uploading it again"
+#: bp-core/deprecated/1.6.php:110 bp-core/deprecated/1.6.php:131
+#: bp-groups/bp-groups-template.php:2307 bp-groups/bp-groups-template.php:2329
+msgid "Recently Active"
 msgstr ""
 
-#: bp-groups/bp-groups-screens.php:590
-msgid "The new group avatar was uploaded successfully!"
+#: bp-core/deprecated/1.6.php:112 bp-core/deprecated/1.6.php:137
+#: bp-groups/bp-groups-template.php:2312 bp-groups/bp-groups-template.php:2344
+msgid "Alphabetically"
 msgstr ""
 
-#: bp-groups/bp-groups-screens.php:625
-msgid "There was an error when promoting that user, please try again"
+#: bp-forums/bp-forums-admin.php:36 bp-forums/bp-forums-admin.php:128
+msgid "Configure Site Wide Forums"
 msgstr ""
 
-#: bp-groups/bp-groups-screens.php:627
-msgid "User promoted successfully"
+#: bp-forums/bp-forums-admin.php:39 bp-forums/bp-forums-admin.php:131
+#: bp-forums/deprecated/1.6.php:76 bp-forums/deprecated/1.6.php:194
+msgid "Install Site Wide Forums"
 msgstr ""
 
-#: bp-groups/bp-groups-screens.php:650
-msgid "There was an error when demoting that user, please try again"
+#: bp-forums/bp-forums-admin.php:52 bp-forums/deprecated/1.6.php:29
+msgid "Settings Saved."
 msgstr ""
 
-#: bp-groups/bp-groups-screens.php:652
-msgid "User demoted successfully"
+#: bp-forums/bp-forums-admin.php:68
+msgid "(Installed)"
 msgstr ""
 
-#: bp-groups/bp-groups-screens.php:668
-msgid "There was an error when banning that user, please try again"
+#: bp-forums/bp-forums-admin.php:68 bp-forums/bp-forums-admin.php:205
+#: bp-forums/deprecated/1.6.php:45 bp-forums/deprecated/1.6.php:162
+msgid "Forums for Groups"
 msgstr ""
 
-#: bp-groups/bp-groups-screens.php:670
-msgid "User banned successfully"
+#: bp-forums/bp-forums-admin.php:70 bp-forums/bp-forums-admin.php:207
+#: bp-forums/deprecated/1.6.php:47 bp-forums/deprecated/1.6.php:164
+msgid "Give each individual group its own discussion forum. Choose this if you'd like to keep your members' conversations separated into distinct areas."
 msgstr ""
 
-#: bp-groups/bp-groups-screens.php:686
-msgid "There was an error when unbanning that user, please try again"
+#: bp-forums/bp-forums-admin.php:71 bp-forums/bp-forums-admin.php:208
+#: bp-forums/deprecated/1.6.php:48 bp-forums/deprecated/1.6.php:165
+msgid "You may use an existing bbPress installation if you have one."
 msgstr ""
 
-#: bp-groups/bp-groups-screens.php:688
-msgid "User ban removed successfully"
+#: bp-forums/bp-forums-admin.php:73 bp-forums/bp-forums-admin.php:91
+#: bp-forums/bp-forums-admin.php:210 bp-forums/bp-forums-admin.php:229
+#: bp-forums/deprecated/1.6.php:50 bp-forums/deprecated/1.6.php:68
+#: bp-forums/deprecated/1.6.php:167 bp-forums/deprecated/1.6.php:186
+msgid "Features"
 msgstr ""
 
-#: bp-groups/bp-groups-screens.php:704
-msgid "There was an error removing that user from the group, please try again"
+#: bp-forums/bp-forums-admin.php:75 bp-forums/bp-forums-admin.php:212
+#: bp-forums/deprecated/1.6.php:52 bp-forums/deprecated/1.6.php:169
+msgid "Group Integration"
 msgstr ""
 
-#: bp-groups/bp-groups-screens.php:706
-msgid "User removed successfully"
+#: bp-forums/bp-forums-admin.php:76 bp-forums/bp-forums-admin.php:213
+#: bp-forums/deprecated/1.6.php:53 bp-forums/deprecated/1.6.php:170
+msgid "Member Profile Integration"
 msgstr ""
 
-#: bp-groups/bp-groups-screens.php:744
-msgid "There was an error accepting the membership request, please try again."
+#: bp-forums/bp-forums-admin.php:77 bp-forums/bp-forums-admin.php:95
+#: bp-forums/bp-forums-admin.php:214 bp-forums/bp-forums-admin.php:233
+#: bp-forums/deprecated/1.6.php:54 bp-forums/deprecated/1.6.php:72
+#: bp-forums/deprecated/1.6.php:171 bp-forums/deprecated/1.6.php:190
+msgid "Activity Stream Integration"
 msgstr ""
 
-#: bp-groups/bp-groups-screens.php:746
-msgid "Group membership request accepted"
+#: bp-forums/bp-forums-admin.php:78 bp-forums/bp-forums-admin.php:96
+#: bp-forums/bp-forums-admin.php:215 bp-forums/bp-forums-admin.php:234
+#: bp-forums/deprecated/1.6.php:55 bp-forums/deprecated/1.6.php:73
+#: bp-forums/deprecated/1.6.php:172 bp-forums/deprecated/1.6.php:191
+msgid "@ Mention Integration"
 msgstr ""
 
-#: bp-groups/bp-groups-screens.php:755
-msgid "There was an error rejecting the membership request, please try again."
+#: bp-forums/bp-forums-admin.php:82
+msgid "Uninstall Group Forums"
 msgstr ""
 
-#: bp-groups/bp-groups-screens.php:757
-msgid "Group membership request rejected"
+#: bp-forums/bp-forums-admin.php:87 bp-forums/bp-forums-admin.php:225
+#: bp-forums/deprecated/1.6.php:64 bp-forums/deprecated/1.6.php:182
+msgid "New! Site Wide Forums"
 msgstr ""
 
-#: bp-groups/bp-groups-screens.php:787
-msgid "There was an error deleting the group, please try again."
+#: bp-forums/bp-forums-admin.php:88 bp-forums/bp-forums-admin.php:226
+#: bp-forums/deprecated/1.6.php:65 bp-forums/deprecated/1.6.php:183
+msgid "Your site will have central forums that are not isolated to any specific group. Choose this if you'd like to have a central forum area for your members."
 msgstr ""
 
-#: bp-groups/bp-groups-screens.php:789
-msgid "The group was deleted successfully"
+#: bp-forums/bp-forums-admin.php:89 bp-forums/bp-forums-admin.php:227
+#: bp-forums/deprecated/1.6.php:66 bp-forums/deprecated/1.6.php:184
+msgid "You may activate both Group and Site Wide forums, but this may create a poor experience for your members."
 msgstr ""
 
-#: bp-groups/bp-groups-screens.php:840
-msgid "A member invites you to join a group"
+#: bp-forums/bp-forums-admin.php:93 bp-forums/bp-forums-admin.php:231
+#: bp-forums/deprecated/1.6.php:70 bp-forums/deprecated/1.6.php:188
+msgid "Central Discussion Area"
 msgstr ""
 
-#: bp-groups/bp-groups-screens.php:846
-msgid "Group information is updated"
+#: bp-forums/bp-forums-admin.php:94 bp-forums/bp-forums-admin.php:232
+#: bp-forums/deprecated/1.6.php:71 bp-forums/deprecated/1.6.php:189
+msgid "Forum Plugins Available"
 msgstr ""
 
-#: bp-groups/bp-groups-screens.php:852
-msgid "You are promoted to a group administrator or moderator"
+#: bp-forums/bp-forums-admin.php:106
+msgid "Need help deciding between Group Forums and Site Wide Forums? Visit <a href=\"%s\">the BuddyPress codex</a> for more information."
 msgstr ""
 
-#: bp-groups/bp-groups-screens.php:858
-msgid "A member requests to join a private group for which you are an admin"
+#: bp-forums/bp-forums-admin.php:138 bp-forums/deprecated/1.6.php:95
+msgid "The bb-config.php file was not found at that location, please try again."
 msgstr ""
 
-#: bp-groups/bp-groups-buddybar.php:16 bp-members/bp-members-buddybar.php:103
-msgid "Admin Options"
+#: bp-forums/bp-forums-admin.php:141 bp-forums/deprecated/1.6.php:98
+msgid "Forums were set up correctly using your existing bbPress install!"
 msgstr ""
 
-#: bp-groups/bp-groups-buddybar.php:21
-msgid "Group Settings"
+#: bp-forums/bp-forums-admin.php:142 bp-forums/deprecated/1.6.php:99
+msgid "BuddyPress will now use its internal copy of bbPress to run the forums on your site. If you wish, you can remove your old bbPress installation files, as long as you keep the bb-config.php file in the same location."
 msgstr ""
 
-#: bp-groups/bp-groups-template.php:171
-msgctxt "Group pagination previous text"
-msgid "&larr;"
+#: bp-forums/bp-forums-admin.php:147 bp-forums/deprecated/1.6.php:104
+msgid "Existing bbPress Installation"
 msgstr ""
 
-#: bp-groups/bp-groups-template.php:172
-msgctxt "Group pagination next text"
-msgid "&rarr;"
+#: bp-forums/bp-forums-admin.php:148 bp-forums/deprecated/1.6.php:105
+msgid "BuddyPress can make use of your existing bbPress install. Just provide the location of your <code>bb-config.php</code> file, and BuddyPress will do the rest."
 msgstr ""
 
-#: bp-groups/bp-groups-template.php:353
-msgid "Public Group"
+#: bp-forums/bp-forums-admin.php:150 bp-forums/bp-forums-admin.php:182
+#: bp-forums/deprecated/1.6.php:107 bp-forums/deprecated/1.6.php:139
+msgid "Complete Installation"
 msgstr ""
 
-#: bp-groups/bp-groups-template.php:355
-msgid "Hidden Group"
+#: bp-forums/bp-forums-admin.php:166 bp-forums/deprecated/1.6.php:123
+msgid "<p>All done! Configuration settings have been saved to the file <code>bb-config.php</code> in the root of your WordPress install.</p>"
 msgstr ""
 
-#: bp-groups/bp-groups-template.php:357
-msgid "Private Group"
+#: bp-forums/bp-forums-admin.php:170 bp-forums/deprecated/1.6.php:127
+msgid "<p>A configuration file could not be created. No problem, but you will need to save the text shown below into a file named <code>bb-config.php</code> in the root directory of your WordPress installation before you can start using the forum functionality.</p>"
 msgstr ""
 
-#: bp-groups/bp-groups-template.php:359
-msgid "Group"
+#: bp-forums/bp-forums-admin.php:179 bp-forums/deprecated/1.6.php:136
+msgid "New bbPress Installation"
 msgstr ""
 
-#: bp-groups/bp-groups-template.php:389
-#: bp-activity/bp-activity-template.php:992
-msgid "Group logo of %s"
+#: bp-forums/bp-forums-admin.php:180 bp-forums/deprecated/1.6.php:137
+msgid ""
+"You've decided to set up a new installation of bbPress for forum management in BuddyPress. This is very simple and is usually just a one click\n"
+"\t\t\t\tprocess. When you're ready, hit the link below."
 msgstr ""
 
-#: bp-groups/bp-groups-template.php:431
-msgid "not yet active"
+#: bp-forums/bp-forums-admin.php:192 bp-forums/deprecated/1.6.php:149
+msgid "bbPress files were not found. To install the forums component you must download a copy of bbPress and make sure it is in the folder: \"%s\""
 msgstr ""
 
-#: bp-groups/bp-groups-template.php:522
-msgid "Private"
+#: bp-forums/bp-forums-admin.php:219 bp-forums/deprecated/1.6.php:176
+msgid "Install Group Forums"
 msgstr ""
 
-#: bp-groups/bp-groups-template.php:572 bp-groups/bp-groups-template.php:595
-#: bp-groups/bp-groups-template.php:1034 bp-groups/bp-groups-template.php:1050
-#: bp-groups/bp-groups-template.php:1099 bp-groups/bp-groups-template.php:1115
-#: bp-groups/bp-groups-template.php:1795 bp-groups/bp-groups-template.php:1804
-#: bp-groups/bp-groups-template.php:1813 bp-groups/bp-groups-template.php:2519
-#: bp-forums/bp-forums-template.php:488 bp-forums/bp-forums-template.php:605
-#: bp-forums/bp-forums-template.php:1192 bp-members/bp-members-template.php:484
-#: bp-members/bp-members-template.php:780
-#: bp-members/bp-members-template.php:800
-#: bp-themes/bp-default/groups/single/admin.php:185
-#: bp-themes/bp-default/groups/single/admin.php:210
-#: bp-activity/bp-activity-template.php:897
-#: bp-activity/bp-activity-template.php:1008
-#: bp-activity/bp-activity-template.php:1017
-msgid "Profile picture of %s"
+#: bp-forums/bp-forums-admin.php:220 bp-forums/deprecated/1.6.php:177
+msgid "Use Existing Installation"
 msgstr ""
 
-#: bp-groups/bp-groups-template.php:577
-msgid "No Admins"
+#: bp-forums/bp-forums-loader.php:61
+msgid "Search Forums..."
 msgstr ""
 
-#: bp-groups/bp-groups-template.php:604
-msgid "No Mods"
+#: bp-forums/bp-forums-loader.php:133 bp-forums/bp-forums-loader.php:198
+msgid "Topics Started"
 msgstr ""
 
-#: bp-groups/bp-groups-template.php:686
-msgid "Filter Groups"
+#: bp-forums/bp-forums-loader.php:144
+msgid "Replied To"
 msgstr ""
 
-#: bp-groups/bp-groups-template.php:736
-msgid "Viewing group %1$s to %2$s (of %3$s groups)"
+#: bp-forums/bp-forums-loader.php:206
+msgid "Replies"
 msgstr ""
 
-#: bp-groups/bp-groups-template.php:764
-msgid "%s member"
+#: bp-forums/bp-forums-loader.php:214
+msgid "Favorite Topics"
 msgstr ""
 
-#: bp-groups/bp-groups-template.php:766
-#: bp-themes/bp-default/members/single/groups/invites.php:14
-msgid "%s members"
+#: bp-forums/bp-forums-screens.php:13
+msgid "The forums component has not been set up yet."
 msgstr ""
 
-#: bp-groups/bp-groups-template.php:805
-msgid "%d topic"
+#: bp-forums/bp-forums-screens.php:36 bp-groups/bp-groups-screens.php:360
+msgid "Please provide a title for your forum topic."
 msgstr ""
 
-#: bp-groups/bp-groups-template.php:807
-msgid "%d topics"
+#: bp-forums/bp-forums-screens.php:38 bp-groups/bp-groups-screens.php:362
+msgid "Forum posts cannot be empty. Please enter some text."
 msgstr ""
 
-#: bp-groups/bp-groups-template.php:839 bp-forums/bp-forums-template.php:684
-msgid "%d post"
+#: bp-forums/bp-forums-screens.php:45 bp-groups/bp-groups-screens.php:372
+msgid "There was an error when creating the topic"
 msgstr ""
 
-#: bp-groups/bp-groups-template.php:841 bp-forums/bp-forums-template.php:686
-msgid "%d posts"
+#: bp-forums/bp-forums-screens.php:48 bp-groups/bp-groups-screens.php:375
+msgid "The topic was created successfully"
 msgstr ""
 
-#: bp-groups/bp-groups-template.php:1041 bp-groups/bp-groups-template.php:1106
-#: bp-themes/bp-default/groups/single/admin.php:189
-#: bp-themes/bp-default/groups/single/admin.php:215
-msgid "Demote to Member"
+#: bp-forums/bp-forums-screens.php:56 bp-forums/bp-forums-screens.php:61
+msgid "Please pick the group forum where you would like to post this topic."
 msgstr ""
 
-#: bp-groups/bp-groups-template.php:1054 bp-groups/bp-groups-template.php:1119
-#: bp-groups/bp-groups-template.php:1888
-msgid "joined %s"
+#: bp-forums/bp-forums-template.php:188 bp-forums/bp-forums-template.php:404
+msgctxt "Forum topic pagination previous text"
+msgid "&larr;"
 msgstr ""
 
-#: bp-groups/bp-groups-template.php:1077
-msgid "This group has no administrators"
+#: bp-forums/bp-forums-template.php:189 bp-forums/bp-forums-template.php:405
+msgctxt "Forum topic pagination next text"
+msgid "&rarr;"
 msgstr ""
 
-#: bp-groups/bp-groups-template.php:1105
-#: bp-themes/bp-default/groups/single/admin.php:214
-#: bp-themes/bp-default/groups/single/admin.php:270
-msgid "Promote to Admin"
+#: bp-forums/bp-forums-template.php:505 bp-forums/bp-forums-template.php:567
+#: bp-forums/bp-forums-template.php:1216
+#: bp-messages/bp-messages-classes.php:269
+#: bp-messages/bp-messages-template.php:847
+msgid "Deleted User"
 msgstr ""
 
-#: bp-groups/bp-groups-template.php:1139
-msgid "This group has no moderators"
+#: bp-forums/bp-forums-template.php:585
+msgid "Group logo for %s"
 msgstr ""
 
-#: bp-groups/bp-groups-template.php:1293 bp-xprofile/bp-xprofile-admin.php:464
-#: bp-forums/bp-forums-template.php:1263
-#: bp-themes/bp-default/members/single/messages/messages-loop.php:50
-#: bp-themes/bp-default/members/single/messages/single.php:24
-#: bp-themes/bp-default/activity/comment.php:43
-#: bp-activity/bp-activity-template.php:2004
-msgid "Delete"
+#: bp-forums/bp-forums-template.php:683 bp-groups/bp-groups-template.php:835
+msgid "%d post"
 msgstr ""
 
-#: bp-groups/bp-groups-template.php:1499 bp-groups/bp-groups-template.php:1500
-#: bp-themes/bp-default/forums/index.php:23
-#: bp-themes/bp-default/groups/single/forum.php:19
-msgid "New Topic"
+#: bp-forums/bp-forums-template.php:685 bp-groups/bp-groups-template.php:837
+msgid "%d posts"
 msgstr ""
 
-#: bp-groups/bp-groups-template.php:1539 bp-groups/bp-groups-template.php:1540
-#: bp-themes/bp-default/_inc/ajax.php:482
-msgid "Leave Group"
+#: bp-forums/bp-forums-template.php:791
+msgid "Edit Topic"
 msgstr ""
 
-#: bp-groups/bp-groups-template.php:1562 bp-groups/bp-groups-template.php:1563
-#: bp-themes/bp-default/_inc/ajax.php:504
-msgid "Join Group"
+#: bp-forums/bp-forums-template.php:795
+msgid "Sticky Topic"
 msgstr ""
 
-#: bp-groups/bp-groups-template.php:1595 bp-groups/bp-groups-template.php:1596
-msgid "Request Sent"
+#: bp-forums/bp-forums-template.php:797
+msgid "Un-stick Topic"
 msgstr ""
 
-#: bp-groups/bp-groups-template.php:1618
-msgid "This is a private group and you must request group membership in order to join."
+#: bp-forums/bp-forums-template.php:800
+msgid "Open Topic"
 msgstr ""
 
-#: bp-groups/bp-groups-template.php:1620
-msgid "This is a private group. To join you must be a registered site member and request group membership."
+#: bp-forums/bp-forums-template.php:802
+msgid "Close Topic"
 msgstr ""
 
-#: bp-groups/bp-groups-template.php:1622
-msgid "This is a private group. Your membership request is awaiting approval from the group administrator."
+#: bp-forums/bp-forums-template.php:804
+msgid "Delete Topic"
 msgstr ""
 
-#: bp-groups/bp-groups-template.php:1624
-msgid "This is a hidden group and only invited members can join."
+#: bp-forums/bp-forums-template.php:959
+msgid " matching tag \"%s\""
 msgstr ""
 
-#: bp-groups/bp-groups-template.php:1938
-msgid "Viewing members %1$s to %2$s (of %3$s members)"
+#: bp-forums/bp-forums-template.php:961
+msgid "Viewing topic %s to %s (of %s total topics%s)"
 msgstr ""
 
-#: bp-groups/bp-groups-template.php:2164
-msgid "Group avatar"
+#: bp-forums/bp-forums-template.php:1052
+msgctxt "Forum thread pagination previous text"
+msgid "&larr;"
 msgstr ""
 
-#: bp-groups/bp-groups-template.php:2277 bp-groups/bp-groups-template.php:2300
-msgid "Recently Joined"
+#: bp-forums/bp-forums-template.php:1053
+msgctxt "Forum thread pagination next text"
+msgid "&rarr;"
 msgstr ""
 
-#: bp-groups/bp-groups-template.php:2278 bp-groups/bp-groups-template.php:2303
-msgid "Most Popular"
+#: bp-forums/bp-forums-template.php:1301
+msgid "Viewing post %1$s to %2$s (%3$s total posts)"
 msgstr ""
 
-#: bp-groups/bp-groups-template.php:2279 bp-groups/bp-groups-template.php:2306
-msgid "Administrator Of"
+#: bp-forums/deprecated/1.6.php:59
+msgid "Reinstall Group Forums"
 msgstr ""
 
-#: bp-groups/bp-groups-template.php:2280 bp-groups/bp-groups-template.php:2309
-msgid "Moderator Of"
+#: bp-friends/bp-friends-actions.php:35
+msgid "Friendship could not be requested."
 msgstr ""
 
-#: bp-groups/bp-groups-template.php:2341
-msgid "No Group Avatar"
+#: bp-friends/bp-friends-actions.php:37
+msgid "Friendship requested"
 msgstr ""
 
-#: bp-groups/bp-groups-template.php:2552
-msgid "requested %s"
+#: bp-friends/bp-friends-actions.php:41
+msgid "You are already friends with this user"
 msgstr ""
 
-#: bp-groups/bp-groups-template.php:2736
-msgid "Group Activity RSS Feed"
+#: bp-friends/bp-friends-actions.php:43
+msgid "You already have a pending friendship request with this user"
 msgstr ""
 
-#: bp-groups/bp-groups-functions.php:255
-msgid "As the only Admin, you cannot leave the group."
+#: bp-friends/bp-friends-actions.php:70 bp-themes/bp-default/_inc/ajax.php:600
+msgid "Friendship could not be canceled."
 msgstr ""
 
-#: bp-groups/bp-groups-functions.php:513
-msgid "%1$s posted an update in the group %2$s"
+#: bp-friends/bp-friends-actions.php:72
+msgid "Friendship canceled"
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-loader.php:135
-#: bp-xprofile/bp-xprofile-loader.php:193 bp-xprofile/bp-xprofile-admin.php:463
-#: bp-forums/bp-forums-template.php:1262 bp-themes/bp-default/functions.php:495
-msgid "Edit"
+#: bp-friends/bp-friends-actions.php:76
+msgid "You are not yet friends with this user"
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-loader.php:145
-#: bp-xprofile/bp-xprofile-loader.php:201
-#: bp-themes/bp-default/members/single/profile/change-avatar.php:1
-msgid "Change Avatar"
+#: bp-friends/bp-friends-actions.php:78
+msgid "You have a pending friendship request with this user"
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-screens.php:85
-msgid "Please make sure you fill in all required fields in this profile field group before saving."
+#: bp-friends/bp-friends-activity.php:57
+msgid "Friendships accepted"
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-screens.php:111
-msgid "There was a problem updating some of your profile information, please try again."
+#: bp-friends/bp-friends-activity.php:58
+msgid "New friendships"
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-screens.php:165
-msgid "There was a problem cropping your avatar, please try uploading it again"
+#: bp-friends/bp-friends-activity.php:61
+msgid "New friendship created"
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-screens.php:167
-msgid "Your new avatar was uploaded successfully!"
+#: bp-friends/bp-friends-activity.php:86
+msgid "%d friends accepted your friendship requests"
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-classes.php:244
-msgid "Please make sure you give the group a name."
+#: bp-friends/bp-friends-activity.php:89
+#: bp-friends/bp-friends-notifications.php:71
+msgid "%s accepted your friendship request"
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-classes.php:268
-msgid "Add New Field Group"
+#: bp-friends/bp-friends-activity.php:100
+msgid "You have %d pending friendship requests"
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-classes.php:270
-msgid "Create Field Group"
+#: bp-friends/bp-friends-activity.php:103
+msgid "You have a friendship request from %s"
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-classes.php:272
-msgid "Edit Field Group"
+#: bp-friends/bp-friends-functions.php:100
+#: bp-friends/bp-friends-functions.php:109
+msgid "%1$s and %2$s are now friends"
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-classes.php:274
-#: bp-themes/bp-default/members/single/settings/notifications.php:62
-#: bp-themes/bp-default/members/single/settings/general.php:69
-#: bp-themes/bp-default/members/single/profile/edit.php:126
-#: bp-themes/bp-default/groups/single/forum/edit.php:60
-#: bp-themes/bp-default/groups/single/forum/edit.php:76
-#: bp-themes/bp-default/groups/single/admin.php:32
-#: bp-themes/bp-default/groups/single/admin.php:117
-msgid "Save Changes"
+#: bp-friends/bp-friends-loader.php:77
+msgid "Search Friends..."
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-classes.php:282
-#: bp-xprofile/bp-xprofile-classes.php:702
-msgid "Fields marked * are required"
+#: bp-friends/bp-friends-loader.php:97
+msgid "Friends <span>%d</span>"
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-classes.php:293
-msgid "Field Group Title"
+#: bp-friends/bp-friends-loader.php:109 bp-friends/bp-friends-loader.php:171
+#: bp-friends/bp-friends-loader.php:198
+#: bp-themes/bp-default/activity/index.php:120
+#: bp-themes/bp-default/members/single/activity.php:35
+msgid "Friendships"
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-classes.php:301
-msgid "Group Description"
+#: bp-friends/bp-friends-loader.php:119 bp-groups/bp-groups-template.php:1288
+msgid "Requests"
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-classes.php:311
-#: bp-xprofile/bp-xprofile-classes.php:761
-msgid "or"
+#: bp-friends/bp-friends-loader.php:152
+msgid "Friends <span class=\"count\">%s</span>"
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-classes.php:311
-#: bp-xprofile/bp-xprofile-classes.php:761
-#: bp-themes/bp-default/forums/index.php:134
-msgid "Cancel"
+#: bp-friends/bp-friends-loader.php:153
+msgid "Pending Requests <span class=\"count\">%s</span>"
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-classes.php:619
-msgid "Please enter options for this Field:"
+#: bp-friends/bp-friends-loader.php:156
+msgid "No Pending Requests"
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-classes.php:620
-#: bp-themes/bp-default/members/index.php:55
-#: bp-themes/bp-default/members/single/friends.php:20
-#: bp-themes/bp-default/members/single/groups.php:20
-#: bp-themes/bp-default/members/single/forums.php:18
-#: bp-themes/bp-default/members/single/blogs.php:19
-#: bp-themes/bp-default/blogs/index.php:55
-#: bp-themes/bp-default/forums/index.php:60
-#: bp-themes/bp-default/groups/index.php:57
-#: bp-themes/bp-default/groups/single/forum.php:36
-msgid "Order By:"
+#: bp-friends/bp-friends-notifications.php:32
+msgid "New friendship request from %s"
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-classes.php:622
-msgid "Order Entered"
+#: bp-friends/bp-friends-notifications.php:34
+msgid ""
+"%1$s wants to add you as a friend.\n"
+"\n"
+"To view all of your pending friendship requests: %2$s\n"
+"\n"
+"To view %3$s's profile: %4$s\n"
+"\n"
+"---------------------\n"
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-classes.php:623
-msgid "Name - Ascending"
+#: bp-friends/bp-friends-notifications.php:73
+msgid ""
+"%1$s accepted your friend request.\n"
+"\n"
+"To view %2$s's profile: %3$s\n"
+"\n"
+"---------------------\n"
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-classes.php:624
-msgid "Name - Descending"
+#: bp-friends/bp-friends-screens.php:34
+msgid "Friendship accepted"
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-classes.php:651
-#: bp-xprofile/bp-xprofile-classes.php:668
-msgid "Option"
+#: bp-friends/bp-friends-screens.php:36
+msgid "Friendship could not be accepted"
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-classes.php:653
-#: bp-xprofile/bp-xprofile-classes.php:669
-msgid "Default Value"
+#: bp-friends/bp-friends-screens.php:45
+msgid "Friendship rejected"
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-classes.php:675
-msgid "Add Another Option"
+#: bp-friends/bp-friends-screens.php:47
+msgid "Friendship could not be rejected"
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-classes.php:683
-msgid "Add Field"
+#: bp-friends/bp-friends-screens.php:56
+msgid "Friendship request withdrawn"
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-classes.php:695
-msgid "Edit Field"
+#: bp-friends/bp-friends-screens.php:58
+msgid "Friendship request could not be withdrawn"
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-classes.php:715
-msgid "Field Title"
+#: bp-friends/bp-friends-screens.php:92
+msgid "A member sends you a friendship request"
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-classes.php:724
-msgid "Field Description"
+#: bp-friends/bp-friends-screens.php:98
+msgid "A member accepts your friendship request"
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-classes.php:731
-msgid "Is This Field Required?"
+#: bp-friends/bp-friends-template.php:69 bp-xprofile/bp-xprofile-loader.php:117
+msgid "My Friends"
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-classes.php:733
-msgid "Not Required"
+#: bp-friends/bp-friends-template.php:69
+msgid "%s's Friends"
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-classes.php:734
-msgid "Required"
+#: bp-friends/bp-friends-template.php:69
+msgid "See All"
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-classes.php:739
-msgid "Field Type"
+#: bp-friends/bp-friends-template.php:89
+msgid "You haven't added any friend connections yet."
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-classes.php:741
-msgid "Text Box"
+#: bp-friends/bp-friends-template.php:89
+msgid "%s hasn't created any friend connections yet."
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-classes.php:742
-msgid "Multi-line Text Box"
+#: bp-friends/bp-friends-template.php:159
+msgid "There aren't enough site members to show a random sample just yet."
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-classes.php:743
-msgid "Date Selector"
+#: bp-friends/bp-friends-template.php:169
+msgid "Filter Friends"
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-classes.php:744
-msgid "Radio Buttons"
+#: bp-friends/bp-friends-template.php:204
+msgid "%d friend"
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-classes.php:745
-msgid "Drop Down Select Box"
+#: bp-friends/bp-friends-template.php:206
+msgid "%d friends"
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-classes.php:746
-msgid "Multi Select Box"
+#: bp-friends/bp-friends-template.php:285
+#: bp-themes/bp-default/_inc/ajax.php:610
+msgid "Cancel Friendship Request"
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-classes.php:747
-msgid "Checkboxes"
+#: bp-friends/bp-friends-template.php:286
+msgid "Cancel Friendship Requested"
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-classes.php:779
-msgid "Please make sure you fill out all required fields."
+#: bp-friends/bp-friends-template.php:302
+#: bp-friends/bp-friends-template.php:303
+msgid "Cancel Friendship"
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-classes.php:782
-msgid "Radio button field types require at least one option. Please add options below."
+#: bp-friends/bp-friends-template.php:319
+#: bp-friends/bp-friends-template.php:320
+#: bp-themes/bp-default/_inc/ajax.php:602
+#: bp-themes/bp-default/_inc/ajax.php:616
+msgid "Add Friend"
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-classes.php:785
-#: bp-xprofile/bp-xprofile-classes.php:788
-msgid "Select box field types require at least one option. Please add options below."
+#: bp-groups/bp-groups-actions.php:28
+msgid "Sorry, you are not allowed to create groups."
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-classes.php:791
-msgid "Checkbox field types require at least one option. Please add options below."
+#: bp-groups/bp-groups-actions.php:50
+msgid "There was an error saving group details. Please try again."
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-admin.php:25
-msgid "Profile Fields"
+#: bp-groups/bp-groups-actions.php:72
+msgid "Please fill in all of the required fields"
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-admin.php:74
-msgid "Extended Profile Fields"
+#: bp-groups/bp-groups-actions.php:79 bp-groups/bp-groups-actions.php:106
+msgid "There was an error saving group details, please try again."
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-admin.php:76 bp-xprofile/bp-xprofile-admin.php:178
-msgid "Add New Group"
+#: bp-groups/bp-groups-actions.php:145
+msgid "%1$s created the group %2$s"
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-admin.php:79
-msgid "Your users will distinguish themselves through their profile page. You must give them profile fields that allow them to describe themselves in a way that is relevant to the theme of your social network."
+#: bp-groups/bp-groups-actions.php:193
+msgid "There was an error saving the group avatar, please try uploading again."
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-admin.php:80
-msgid "NOTE: Any fields in the \"%s\" group will appear on the signup page."
+#: bp-groups/bp-groups-actions.php:195
+msgid "The group avatar was uploaded successfully!"
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-admin.php:103 bp-xprofile/bp-xprofile-admin.php:399
-msgid "(Primary)"
+#: bp-groups/bp-groups-actions.php:219 bp-groups/bp-groups-actions.php:226
+msgid "There was an error joining the group."
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-admin.php:120
-msgid "Add New Field"
+#: bp-groups/bp-groups-actions.php:228
+msgid "You joined the group!"
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-admin.php:160
-msgid "There are no fields in this group."
+#: bp-groups/bp-groups-actions.php:254 bp-groups/bp-groups-screens.php:660
+msgid "This group must have at least one admin"
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-admin.php:177
-msgid "You have no groups."
+#: bp-groups/bp-groups-actions.php:257
+msgid "There was an error leaving the group."
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-admin.php:209
-msgid "There was an error saving the group. Please try again"
+#: bp-groups/bp-groups-actions.php:259 bp-groups/bp-groups-functions.php:313
+msgid "You successfully left the group."
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-admin.php:212
-msgid "The group was saved successfully."
+#: bp-groups/bp-groups-activity.php:22
+msgid "Created a group"
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-admin.php:244
-msgid "There was an error deleting the group. Please try again"
+#: bp-groups/bp-groups-activity.php:23
+msgid "Joined a group"
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-admin.php:247
-msgid "The group was deleted successfully."
+#: bp-groups/bp-groups-activity.php:24
+msgid "New group forum topic"
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-admin.php:288
-msgid "There was an error saving the field. Please try again"
+#: bp-groups/bp-groups-activity.php:25
+msgid "New group forum post"
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-admin.php:294
-msgid "The field was saved successfully."
+#: bp-groups/bp-groups-activity.php:101
+msgid "%1$d new membership requests for the group \"%2$s\""
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-admin.php:324
-msgid "field"
+#: bp-groups/bp-groups-activity.php:106
+msgid "Group Membership Requests"
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-admin.php:326
-msgid "option"
+#: bp-groups/bp-groups-activity.php:115 bp-groups/bp-groups-activity.php:120
+msgid "%s requests group membership"
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-admin.php:331
-msgid "There was an error deleting the %s. Please try again"
+#: bp-groups/bp-groups-activity.php:138
+msgid "%d accepted group membership requests"
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-admin.php:334
-msgid "The %s was deleted successfully!"
+#: bp-groups/bp-groups-activity.php:151
+msgid "Membership for group \"%s\" accepted"
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-admin.php:399
-msgid "(Required)"
+#: bp-groups/bp-groups-activity.php:174
+msgid "%d rejected group membership requests"
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-admin.php:432
-#: bp-themes/bp-default/registration/register.php:119
-#: bp-themes/bp-default/members/single/profile/edit.php:58
-#: bp-themes/bp-default/members/single/profile/edit.php:73
-msgid "Clear"
+#: bp-groups/bp-groups-activity.php:187
+msgid "Membership for group \"%s\" rejected"
 msgstr ""
 
-#. translators: no option picked in select box
-
-#: bp-xprofile/bp-xprofile-template.php:432
-#: bp-themes/bp-default/forums/index.php:116
-msgid "----"
+#: bp-groups/bp-groups-activity.php:210
+msgid "You were promoted to an admin in %d groups"
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-template.php:615
-msgid "January"
+#: bp-groups/bp-groups-activity.php:223
+msgid "You were promoted to an admin in the group \"%s\""
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-template.php:616
-msgid "February"
+#: bp-groups/bp-groups-activity.php:246
+msgid "You were promoted to a mod in %d groups"
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-template.php:617
-msgid "March"
+#: bp-groups/bp-groups-activity.php:259
+msgid "You were promoted to a mod in the group \"%s\""
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-template.php:618
-msgid "April"
+#: bp-groups/bp-groups-activity.php:283
+msgid "You have %d new group invitations"
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-template.php:619
-msgid "May"
+#: bp-groups/bp-groups-activity.php:287
+msgid "Group Invites"
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-template.php:620
-msgid "June"
+#: bp-groups/bp-groups-activity.php:295
+msgid "You have an invitation to the group: %s"
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-template.php:621
-msgid "July"
+#: bp-groups/bp-groups-adminbar.php:40 bp-xprofile/bp-xprofile-admin.php:114
+msgid "Edit Group"
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-template.php:622
-msgid "August"
+#: bp-groups/bp-groups-adminbar.php:48 bp-groups/bp-groups-buddybar.php:34
+msgid "Edit Details"
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-template.php:623
-msgid "September"
+#: bp-groups/bp-groups-adminbar.php:56
+msgid "Edit Settings"
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-template.php:624
-msgid "October"
+#: bp-groups/bp-groups-adminbar.php:65 bp-members/bp-members-adminbar.php:107
+msgid "Edit Avatar"
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-template.php:625
-msgid "November"
+#: bp-groups/bp-groups-adminbar.php:75 bp-groups/bp-groups-buddybar.php:46
+msgid "Manage Invitations"
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-template.php:626
-msgid "December"
+#: bp-groups/bp-groups-adminbar.php:84 bp-groups/bp-groups-buddybar.php:50
+msgid "Manage Members"
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-template.php:759
-msgid "Avatar uploads are currently disabled. Why not use a <a href=\"http://gravatar.com\" target=\"_blank\">gravatar</a> instead?"
+#: bp-groups/bp-groups-adminbar.php:93 bp-groups/bp-groups-buddybar.php:54
+msgid "Membership Requests"
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-template.php:768
-msgid "Profile not recently updated"
+#: bp-groups/bp-groups-adminbar.php:102 bp-groups/bp-groups-buddybar.php:58
+#: bp-themes/bp-default/groups/single/admin.php:360
+#: bp-xprofile/bp-xprofile-admin.php:118
+msgid "Delete Group"
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-template.php:779
-msgid "Profile updated %s"
+#: bp-groups/bp-groups-buddybar.php:31 bp-members/bp-members-buddybar.php:120
+msgid "Admin Options"
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-template.php:822
-#: bp-xprofile/bp-xprofile-template.php:823
-#: bp-members/bp-members-adminbar.php:161
-msgid "Edit Profile"
+#: bp-groups/bp-groups-buddybar.php:36
+msgid "Group Settings"
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-activity.php:22
-msgid "New member registered"
+#: bp-groups/bp-groups-buddybar.php:40 bp-groups/bp-groups-loader.php:570
+#: bp-groups/bp-groups-template.php:2395
+msgid "Group Avatar"
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-activity.php:23
-msgid "Updated Profile"
+#: bp-groups/bp-groups-classes.php:832
+msgid "Group Mod"
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-activity.php:128
-msgid "%s changed their profile picture"
+#: bp-groups/bp-groups-classes.php:838 bp-groups/bp-groups-functions.php:121
+msgid "Group Admin"
 msgstr ""
 
-#: bp-forums/bp-forums-admin.php:30
-msgid "Settings Saved."
+#: bp-groups/bp-groups-forums.php:104 bp-groups/bp-groups-forums.php:253
+msgid "%1$s replied to the forum topic %2$s in the group %3$s"
 msgstr ""
 
-#: bp-forums/bp-forums-admin.php:46
-msgid "(Installed)"
+#: bp-groups/bp-groups-forums.php:154 bp-groups/bp-groups-forums.php:206
+msgid "%1$s started the forum topic %2$s in the group %3$s"
 msgstr ""
 
-#: bp-forums/bp-forums-admin.php:46 bp-forums/bp-forums-admin.php:163
-msgid "Forums for Groups"
+#: bp-groups/bp-groups-functions.php:288
+msgid "As the only Admin, you cannot leave the group."
 msgstr ""
 
-#: bp-forums/bp-forums-admin.php:48 bp-forums/bp-forums-admin.php:165
-msgid "Give each individual group its own discussion forum. Choose this if you'd like to keep your members' conversations separated into distinct areas."
+#: bp-groups/bp-groups-functions.php:357 bp-groups/bp-groups-functions.php:848
+#: bp-groups/bp-groups-screens.php:61
+msgid "%1$s joined the group %2$s"
 msgstr ""
 
-#: bp-forums/bp-forums-admin.php:49 bp-forums/bp-forums-admin.php:166
-msgid "You may use an existing bbPress installation if you have one."
+#: bp-groups/bp-groups-functions.php:538
+msgid "%1$s posted an update in the group %2$s"
 msgstr ""
 
-#: bp-forums/bp-forums-admin.php:51 bp-forums/bp-forums-admin.php:69
-#: bp-forums/bp-forums-admin.php:168 bp-forums/bp-forums-admin.php:187
-msgid "Features"
+#: bp-groups/bp-groups-loader.php:140
+msgid "Search Groups..."
 msgstr ""
 
-#: bp-forums/bp-forums-admin.php:53 bp-forums/bp-forums-admin.php:170
-msgid "Group Integration"
+#: bp-groups/bp-groups-loader.php:269
+msgid "You do not have access to this group."
 msgstr ""
 
-#: bp-forums/bp-forums-admin.php:54 bp-forums/bp-forums-admin.php:171
-msgid "Member Profile Integration"
+#: bp-groups/bp-groups-loader.php:284
+msgid "You are not an admin of this group."
 msgstr ""
 
-#: bp-forums/bp-forums-admin.php:55 bp-forums/bp-forums-admin.php:73
-#: bp-forums/bp-forums-admin.php:172 bp-forums/bp-forums-admin.php:191
-msgid "Activity Stream Integration"
+#: bp-groups/bp-groups-loader.php:294 bp-groups/bp-groups-template.php:1269
+msgid "Details"
 msgstr ""
 
-#: bp-forums/bp-forums-admin.php:56 bp-forums/bp-forums-admin.php:74
-#: bp-forums/bp-forums-admin.php:173 bp-forums/bp-forums-admin.php:192
-msgid "@ Mention Integration"
+#: bp-groups/bp-groups-loader.php:306 bp-groups/bp-groups-template.php:1280
+msgid "Avatar"
 msgstr ""
 
-#: bp-forums/bp-forums-admin.php:60
-msgid "Uninstall Group Forums"
+#: bp-groups/bp-groups-loader.php:314
+msgid "Invites"
 msgstr ""
 
-#: bp-forums/bp-forums-admin.php:65 bp-forums/bp-forums-admin.php:183
-msgid "New! Site Wide Forums"
+#: bp-groups/bp-groups-loader.php:342
+msgid "Groups <span>%d</span>"
 msgstr ""
 
-#: bp-forums/bp-forums-admin.php:66 bp-forums/bp-forums-admin.php:184
-msgid "Your site will have central forums that are not isolated to any specific group. Choose this if you'd like to have a central forum area for your members."
+#: bp-groups/bp-groups-loader.php:354 bp-groups/bp-groups-loader.php:383
+#: bp-groups/bp-groups-loader.php:522 bp-groups/bp-groups-loader.php:550
+msgid "Memberships"
 msgstr ""
 
-#: bp-forums/bp-forums-admin.php:67 bp-forums/bp-forums-admin.php:185
-msgid "You may activate both Group and Site Wide forums, but this may create a poor experience for your members."
+#: bp-groups/bp-groups-loader.php:365
+msgid "Invitations"
 msgstr ""
 
-#: bp-forums/bp-forums-admin.php:71 bp-forums/bp-forums-admin.php:189
-msgid "Central Discussion Area"
+#: bp-groups/bp-groups-loader.php:395
+msgctxt "Group home navigation title"
+msgid "Home"
 msgstr ""
 
-#: bp-forums/bp-forums-admin.php:72 bp-forums/bp-forums-admin.php:190
-msgid "Forum Plugins Available"
+#: bp-groups/bp-groups-loader.php:412 bp-groups/bp-groups-template.php:1580
+#: bp-groups/bp-groups-template.php:1581 bp-themes/bp-default/_inc/ajax.php:708
+msgid "Request Membership"
 msgstr ""
 
-#: bp-forums/bp-forums-admin.php:77 bp-forums/bp-forums-admin.php:195
-msgid "Install Site Wide Forums"
+#: bp-groups/bp-groups-loader.php:424
+msgid "Forum"
 msgstr ""
 
-#: bp-forums/bp-forums-admin.php:96
-msgid "The bb-config.php file was not found at that location, please try again."
+#: bp-groups/bp-groups-loader.php:436
+msgid "Members <span>%s</span>"
 msgstr ""
 
-#: bp-forums/bp-forums-admin.php:99
-msgid "Forums were set up correctly using your existing bbPress install!"
+#: bp-groups/bp-groups-loader.php:448
+#: bp-themes/bp-default/groups/single/send-invites.php:60
+msgid "Send Invites"
 msgstr ""
 
-#: bp-forums/bp-forums-admin.php:100
-msgid "BuddyPress will now use its internal copy of bbPress to run the forums on your site. If you wish, you can remove your old bbPress installation files, as long as you keep the bb-config.php file in the same location."
+#: bp-groups/bp-groups-loader.php:462
+msgid "Admin"
 msgstr ""
 
-#: bp-forums/bp-forums-admin.php:105
-msgid "Existing bbPress Installation"
+#: bp-groups/bp-groups-loader.php:503
+msgid "No Pending Invites"
 msgstr ""
 
-#: bp-forums/bp-forums-admin.php:106
-msgid "BuddyPress can make use of your existing bbPress install. Just provide the location of your <code>bb-config.php</code> file, and BuddyPress will do the rest."
+#: bp-groups/bp-groups-loader.php:506
+msgid "Groups <span class=\"count\">%s</span>"
 msgstr ""
 
-#: bp-forums/bp-forums-admin.php:108 bp-forums/bp-forums-admin.php:140
-msgid "Complete Installation"
+#: bp-groups/bp-groups-loader.php:507
+msgid "Pending Invites <span class=\"count\">%s</span>"
 msgstr ""
 
-#: bp-forums/bp-forums-admin.php:124
-msgid "<p>All done! Configuration settings have been saved to the file <code>bb-config.php</code> in the root of your WordPress install.</p>"
+#: bp-groups/bp-groups-notifications.php:20
+msgid "Group Details Updated"
 msgstr ""
 
-#: bp-forums/bp-forums-admin.php:128
-msgid "<p>A configuration file could not be created. No problem, but you will need to save the text shown below into a file named <code>bb-config.php</code> in the root directory of your WordPress installation before you can start using the forum functionality.</p>"
+#: bp-groups/bp-groups-notifications.php:35
+msgid ""
+"Group details for the group \"%1$s\" were updated:\n"
+"\n"
+"To view the group: %2$s\n"
+"\n"
+"---------------------\n"
 msgstr ""
 
-#: bp-forums/bp-forums-admin.php:137
-msgid "New bbPress Installation"
+#: bp-groups/bp-groups-notifications.php:77
+msgid "Membership request for group: %s"
 msgstr ""
 
-#: bp-forums/bp-forums-admin.php:138
+#: bp-groups/bp-groups-notifications.php:79
 msgid ""
-"You've decided to set up a new installation of bbPress for forum management in BuddyPress. This is very simple and is usually just a one click\n"
-"\t\t\t\tprocess. When you're ready, hit the link below."
+"%1$s wants to join the group \"%2$s\".\n"
+"\n"
+"Because you are the administrator of this group, you must either accept or reject the membership request.\n"
+"\n"
+"To view all pending membership requests for this group, please visit:\n"
+"%3$s\n"
+"\n"
+"To view %4$s's profile: %5$s\n"
+"\n"
+"---------------------\n"
 msgstr ""
 
-#: bp-forums/bp-forums-admin.php:150
-msgid "bbPress files were not found. To install the forums component you must download a copy of bbPress and make sure it is in the folder: \"%s\""
+#: bp-groups/bp-groups-notifications.php:128
+msgid "Membership request for group \"%s\" accepted"
 msgstr ""
 
-#: bp-forums/bp-forums-admin.php:177
-msgid "Install Group Forums"
+#: bp-groups/bp-groups-notifications.php:129
+msgid ""
+"Your membership request for the group \"%1$s\" has been accepted.\n"
+"\n"
+"To view the group please login and visit: %2$s\n"
+"\n"
+"---------------------\n"
 msgstr ""
 
-#: bp-forums/bp-forums-admin.php:178
-msgid "Use Existing Installation"
+#: bp-groups/bp-groups-notifications.php:138
+msgid "Membership request for group \"%s\" rejected"
 msgstr ""
 
-#: bp-forums/bp-forums-loader.php:61
-msgid "Search Forums..."
+#: bp-groups/bp-groups-notifications.php:139
+msgid ""
+"Your membership request for the group \"%1$s\" has been rejected.\n"
+"\n"
+"To submit another request please log in and visit: %2$s\n"
+"\n"
+"---------------------\n"
 msgstr ""
 
-#: bp-forums/bp-forums-loader.php:135 bp-forums/bp-forums-loader.php:202
-msgid "Topics Started"
+#: bp-groups/bp-groups-notifications.php:163
+msgid "an administrator"
 msgstr ""
 
-#: bp-forums/bp-forums-loader.php:146
-msgid "Replied To"
+#: bp-groups/bp-groups-notifications.php:166
+msgid "a moderator"
 msgstr ""
 
-#: bp-forums/bp-forums-loader.php:210
-msgid "Replies"
+#: bp-groups/bp-groups-notifications.php:185
+msgid "You have been promoted in the group: \"%s\""
 msgstr ""
 
-#: bp-forums/bp-forums-loader.php:218
-msgid "Favorite Topics"
+#: bp-groups/bp-groups-notifications.php:187
+msgid ""
+"You have been promoted to %1$s for the group: \"%2$s\".\n"
+"\n"
+"To view the group please visit: %3$s\n"
+"\n"
+"---------------------\n"
 msgstr ""
 
-#: bp-forums/bp-forums-template.php:189 bp-forums/bp-forums-template.php:405
-msgctxt "Forum topic pagination previous text"
-msgid "&larr;"
+#: bp-groups/bp-groups-notifications.php:235
+msgid "You have an invitation to the group: \"%s\""
 msgstr ""
 
-#: bp-forums/bp-forums-template.php:190 bp-forums/bp-forums-template.php:406
-msgctxt "Forum topic pagination next text"
-msgid "&rarr;"
+#: bp-groups/bp-groups-notifications.php:237
+msgid ""
+"One of your friends %1$s has invited you to the group: \"%2$s\".\n"
+"\n"
+"To view your group invites visit: %3$s\n"
+"\n"
+"To view the group visit: %4$s\n"
+"\n"
+"To view %5$s's profile visit: %6$s\n"
+"\n"
+"---------------------\n"
 msgstr ""
 
-#: bp-forums/bp-forums-template.php:506 bp-forums/bp-forums-template.php:568
-#: bp-forums/bp-forums-template.php:1208
-msgid "Deleted User"
+#: bp-groups/bp-groups-screens.php:53
+msgid "Group invite could not be accepted"
 msgstr ""
 
-#: bp-forums/bp-forums-template.php:586
-msgid "Group logo for %s"
+#: bp-groups/bp-groups-screens.php:55
+msgid "Group invite accepted"
 msgstr ""
 
-#: bp-forums/bp-forums-template.php:792
-msgid "Edit Topic"
+#: bp-groups/bp-groups-screens.php:75
+msgid "Group invite could not be rejected"
 msgstr ""
 
-#: bp-forums/bp-forums-template.php:796
-msgid "Sticky Topic"
+#: bp-groups/bp-groups-screens.php:77
+msgid "Group invite rejected"
 msgstr ""
 
-#: bp-forums/bp-forums-template.php:798
-msgid "Un-stick Topic"
+#: bp-groups/bp-groups-screens.php:154
+msgid "It looks like you've already said that!"
 msgstr ""
 
-#: bp-forums/bp-forums-template.php:801
-msgid "Open Topic"
+#: bp-groups/bp-groups-screens.php:157
+msgid "There was an error when replying to that topic"
 msgstr ""
 
-#: bp-forums/bp-forums-template.php:803
-msgid "Close Topic"
+#: bp-groups/bp-groups-screens.php:159
+msgid "Your reply was posted successfully"
 msgstr ""
 
-#: bp-forums/bp-forums-template.php:805
-msgid "Delete Topic"
+#: bp-groups/bp-groups-screens.php:179
+msgid "There was an error when making that topic a sticky"
 msgstr ""
 
-#: bp-forums/bp-forums-template.php:960
-msgid " matching tag \"%s\""
+#: bp-groups/bp-groups-screens.php:181
+msgid "The topic was made sticky successfully"
 msgstr ""
 
-#: bp-forums/bp-forums-template.php:962
-msgid "Viewing topic %s to %s (of %s total topics%s)"
+#: bp-groups/bp-groups-screens.php:193
+msgid "There was an error when unsticking that topic"
 msgstr ""
 
-#: bp-forums/bp-forums-template.php:1044
-msgctxt "Forum thread pagination previous text"
-msgid "&larr;"
+#: bp-groups/bp-groups-screens.php:195
+msgid "The topic was unstuck successfully"
 msgstr ""
 
-#: bp-forums/bp-forums-template.php:1045
-msgctxt "Forum thread pagination next text"
-msgid "&rarr;"
+#: bp-groups/bp-groups-screens.php:207
+msgid "There was an error when closing that topic"
 msgstr ""
 
-#: bp-forums/bp-forums-template.php:1293
-msgid "Viewing post %1$s to %2$s (%3$s total posts)"
+#: bp-groups/bp-groups-screens.php:209
+msgid "The topic was closed successfully"
 msgstr ""
 
-#: bp-forums/bp-forums-screens.php:13
-msgid "The forums component has not been set up yet."
+#: bp-groups/bp-groups-screens.php:221
+msgid "There was an error when opening that topic"
 msgstr ""
 
-#: bp-forums/bp-forums-screens.php:56 bp-forums/bp-forums-screens.php:61
-msgid "Please pick the group forum where you would like to post this topic."
+#: bp-groups/bp-groups-screens.php:223
+msgid "The topic was opened successfully"
 msgstr ""
 
-#: bp-messages/bp-messages-loader.php:24
-msgid "Private Messages"
+#: bp-groups/bp-groups-screens.php:244
+msgid "There was an error deleting the topic"
 msgstr ""
 
-#: bp-messages/bp-messages-loader.php:79
-msgid "Search Messages..."
+#: bp-groups/bp-groups-screens.php:246
+msgid "The topic was deleted successfully"
 msgstr ""
 
-#: bp-messages/bp-messages-loader.php:96 bp-messages/bp-messages-actions.php:41
-msgid "Messages <span>%s</span>"
+#: bp-groups/bp-groups-screens.php:268
+msgid "There was an error when editing that topic"
 msgstr ""
 
-#: bp-messages/bp-messages-loader.php:114
-#: bp-messages/bp-messages-loader.php:182
-#: bp-messages/bp-messages-functions.php:237
-msgid "Inbox"
+#: bp-groups/bp-groups-screens.php:270
+msgid "The topic was edited successfully"
 msgstr ""
 
-#: bp-messages/bp-messages-loader.php:124
-#: bp-messages/bp-messages-loader.php:205
-msgid "Sent"
+#: bp-groups/bp-groups-screens.php:294
+msgid "There was an error deleting that post"
 msgstr ""
 
-#: bp-messages/bp-messages-loader.php:134
-#: bp-messages/bp-messages-loader.php:213
-msgid "Compose"
+#: bp-groups/bp-groups-screens.php:296
+msgid "The post was deleted successfully"
 msgstr ""
 
-#: bp-messages/bp-messages-loader.php:145
-msgid "Notices"
+#: bp-groups/bp-groups-screens.php:318
+msgid "There was an error when editing that post"
 msgstr ""
 
-#: bp-messages/bp-messages-loader.php:178
-msgid "Messages <span class=\"count\">%s</span>"
+#: bp-groups/bp-groups-screens.php:320
+msgid "The post was edited successfully"
 msgstr ""
 
-#: bp-messages/bp-messages-loader.php:179
-msgid "Inbox <span class=\"count\">%s</span>"
+#: bp-groups/bp-groups-screens.php:335 bp-groups/bp-groups-screens.php:352
+msgid "You have been banned from this group."
 msgstr ""
 
-#: bp-messages/bp-messages-loader.php:181
-#: bp-messages/bp-messages-screens.php:149
-msgid "Messages"
+#: bp-groups/bp-groups-screens.php:365
+msgid "This group does not have a forum setup yet."
 msgstr ""
 
-#: bp-messages/bp-messages-loader.php:222
-msgid "All Member Notices"
+#: bp-groups/bp-groups-screens.php:419
+msgid "Group invites sent."
 msgstr ""
 
-#: bp-messages/bp-messages-loader.php:241
-msgid "My Messages"
+#: bp-groups/bp-groups-screens.php:447
+msgid "There was an error sending your group membership request, please try again."
 msgstr ""
 
-#: bp-messages/bp-messages-template.php:75
-msgctxt "Message pagination previous text"
-msgid "&larr;"
+#: bp-groups/bp-groups-screens.php:449
+msgid "Your membership request was sent to the group administrator successfully. You will be notified when the group administrator responds to your request."
 msgstr ""
 
-#: bp-messages/bp-messages-template.php:76
-msgctxt "Message pagination next text"
-msgid "&rarr;"
+#: bp-groups/bp-groups-screens.php:496
+msgid "There was an error updating group details, please try again."
 msgstr ""
 
-#: bp-messages/bp-messages-template.php:343
-msgid "Viewing message %1$s to %2$s (of %3$s messages)"
+#: bp-groups/bp-groups-screens.php:498
+msgid "Group details were successfully updated."
 msgstr ""
 
-#: bp-messages/bp-messages-template.php:401
-msgid "Select:"
+#: bp-groups/bp-groups-screens.php:539
+msgid "There was an error updating group settings, please try again."
 msgstr ""
 
-#: bp-messages/bp-messages-template.php:404
-msgid "Read"
+#: bp-groups/bp-groups-screens.php:541
+msgid "Group settings were successfully updated."
 msgstr ""
 
-#: bp-messages/bp-messages-template.php:405
-msgid "Unread"
+#: bp-groups/bp-groups-screens.php:572 bp-xprofile/bp-xprofile-actions.php:40
+msgid "Your avatar was deleted successfully!"
 msgstr ""
 
-#: bp-messages/bp-messages-template.php:406
-msgid "All"
+#: bp-groups/bp-groups-screens.php:574 bp-xprofile/bp-xprofile-actions.php:42
+msgid "There was a problem deleting that avatar, please try again."
 msgstr ""
 
-#: bp-messages/bp-messages-template.php:409
-msgid "Mark as Read"
+#: bp-groups/bp-groups-screens.php:602
+msgid "There was a problem cropping the avatar, please try uploading it again"
 msgstr ""
 
-#: bp-messages/bp-messages-template.php:410
-msgid "Mark as Unread"
+#: bp-groups/bp-groups-screens.php:604
+msgid "The new group avatar was uploaded successfully!"
 msgstr ""
 
-#: bp-messages/bp-messages-template.php:412
-msgid "Delete Selected"
+#: bp-groups/bp-groups-screens.php:639
+msgid "There was an error when promoting that user, please try again"
 msgstr ""
 
-#: bp-messages/bp-messages-template.php:421
-msgid "Currently Active"
+#: bp-groups/bp-groups-screens.php:641
+msgid "User promoted successfully"
 msgstr ""
 
-#: bp-messages/bp-messages-template.php:496
-msgid "Deactivate"
+#: bp-groups/bp-groups-screens.php:664
+msgid "There was an error when demoting that user, please try again"
 msgstr ""
 
-#: bp-messages/bp-messages-template.php:547
-#: bp-themes/bp-default/functions.php:155
-msgid "Close"
+#: bp-groups/bp-groups-screens.php:666
+msgid "User demoted successfully"
 msgstr ""
 
-#: bp-messages/bp-messages-template.php:591
-msgid "Send a private message to this user."
+#: bp-groups/bp-groups-screens.php:682
+msgid "There was an error when banning that user, please try again"
 msgstr ""
 
-#: bp-messages/bp-messages-template.php:592
-msgid "Private Message"
+#: bp-groups/bp-groups-screens.php:684
+msgid "User banned successfully"
 msgstr ""
 
-#: bp-messages/bp-messages-template.php:782
-msgid "%d Recipients"
+#: bp-groups/bp-groups-screens.php:700
+msgid "There was an error when unbanning that user, please try again"
 msgstr ""
 
-#: bp-messages/bp-messages-template.php:857
-#: bp-themes/bp-default/_inc/ajax.php:543
-msgid "Sent %s"
+#: bp-groups/bp-groups-screens.php:702
+msgid "User ban removed successfully"
 msgstr ""
 
-#: bp-messages/bp-messages-actions.php:30
-msgid "Your reply was sent successfully"
+#: bp-groups/bp-groups-screens.php:718
+msgid "There was an error removing that user from the group, please try again"
 msgstr ""
 
-#: bp-messages/bp-messages-actions.php:32
-msgid "There was a problem sending your reply, please try again"
+#: bp-groups/bp-groups-screens.php:720
+msgid "User removed successfully"
 msgstr ""
 
-#: bp-messages/bp-messages-actions.php:48
-msgid "From: %s"
+#: bp-groups/bp-groups-screens.php:758
+msgid "There was an error accepting the membership request, please try again."
 msgstr ""
 
-#: bp-messages/bp-messages-actions.php:78
-msgid "There was an error deleting that message."
+#: bp-groups/bp-groups-screens.php:760
+msgid "Group membership request accepted"
 msgstr ""
 
-#: bp-messages/bp-messages-actions.php:80
-msgid "Message deleted."
+#: bp-groups/bp-groups-screens.php:769
+msgid "There was an error rejecting the membership request, please try again."
 msgstr ""
 
-#: bp-messages/bp-messages-actions.php:102
-msgid "There was an error deleting messages."
+#: bp-groups/bp-groups-screens.php:771
+msgid "Group membership request rejected"
 msgstr ""
 
-#: bp-messages/bp-messages-actions.php:104
-#: bp-themes/bp-default/_inc/ajax.php:609
-msgid "Messages deleted."
+#: bp-groups/bp-groups-screens.php:801
+msgid "There was an error deleting the group, please try again."
 msgstr ""
 
-#: bp-messages/bp-messages-classes.php:203
-msgid " Recipients"
+#: bp-groups/bp-groups-screens.php:803
+msgid "The group was deleted successfully"
 msgstr ""
 
-#: bp-messages/bp-messages-screens.php:54
-#: bp-messages/bp-messages-screens.php:76
-msgid "There was an error sending that message, please try again"
+#: bp-groups/bp-groups-screens.php:853
+msgid "A member invites you to join a group"
 msgstr ""
 
-#: bp-messages/bp-messages-screens.php:59
-msgid "Notice sent successfully!"
+#: bp-groups/bp-groups-screens.php:859
+msgid "Group information is updated"
 msgstr ""
 
-#: bp-messages/bp-messages-screens.php:62
-msgid "There was an error sending that notice, please try again"
+#: bp-groups/bp-groups-screens.php:865
+msgid "You are promoted to a group administrator or moderator"
 msgstr ""
 
-#: bp-messages/bp-messages-screens.php:73
-msgid "Message sent successfully!"
+#: bp-groups/bp-groups-screens.php:871
+msgid "A member requests to join a private group for which you are an admin"
 msgstr ""
 
-#: bp-messages/bp-messages-screens.php:100
-msgid "There was a problem deactivating that notice."
+#: bp-groups/bp-groups-template.php:173
+msgctxt "Group pagination previous text"
+msgid "&larr;"
 msgstr ""
 
-#: bp-messages/bp-messages-screens.php:102
-msgid "Notice deactivated."
+#: bp-groups/bp-groups-template.php:174
+msgctxt "Group pagination next text"
+msgid "&rarr;"
 msgstr ""
 
-#: bp-messages/bp-messages-screens.php:106
-msgid "There was a problem activating that notice."
+#: bp-groups/bp-groups-template.php:355
+msgid "Public Group"
 msgstr ""
 
-#: bp-messages/bp-messages-screens.php:108
-msgid "Notice activated."
+#: bp-groups/bp-groups-template.php:357
+msgid "Hidden Group"
 msgstr ""
 
-#: bp-messages/bp-messages-screens.php:112
-msgid "There was a problem deleting that notice."
+#: bp-groups/bp-groups-template.php:359
+msgid "Private Group"
 msgstr ""
 
-#: bp-messages/bp-messages-screens.php:114
-msgid "Notice deleted."
+#: bp-groups/bp-groups-template.php:361
+msgid "Group"
 msgstr ""
 
-#: bp-messages/bp-messages-screens.php:158
-msgid "A member sends you a new message"
+#: bp-groups/bp-groups-template.php:433
+msgid "not yet active"
 msgstr ""
 
-#: bp-messages/bp-messages-screens.php:164
-msgid "A new site notice is posted"
+#: bp-groups/bp-groups-template.php:524
+msgid "Private"
 msgstr ""
 
-#: bp-messages/bp-messages-notifications.php:30
-msgid "New message from %s"
+#: bp-groups/bp-groups-template.php:575
+msgid "No Admins"
 msgstr ""
 
-#: bp-messages/bp-messages-notifications.php:32
-msgid ""
-"%s sent you a new message:\n"
-"\n"
-"Subject: %s\n"
-"\n"
-"\"%s\"\n"
-"\n"
-"To view and read your messages please log in and visit: %s\n"
-"\n"
-"---------------------\n"
+#: bp-groups/bp-groups-template.php:602
+msgid "No Mods"
 msgstr ""
 
-#: bp-messages/bp-messages-functions.php:48
-msgid "Re: %s"
+#: bp-groups/bp-groups-template.php:684
+msgid "Filter Groups"
 msgstr ""
 
-#: bp-messages/bp-messages-functions.php:56
-msgid "No Subject"
+#: bp-groups/bp-groups-template.php:732
+msgid "Viewing group %1$s to %2$s (of %3$s groups)"
 msgstr ""
 
-#: bp-messages/bp-messages-functions.php:240
-msgid "You have %d new messages"
+#: bp-groups/bp-groups-template.php:760
+msgid "%s member"
 msgstr ""
 
-#: bp-messages/bp-messages-functions.php:243
-msgid "You have %d new message"
+#: bp-groups/bp-groups-template.php:762
+#: bp-themes/bp-default/members/single/groups/invites.php:14
+msgid "%s members"
 msgstr ""
 
-#: bp-members/bp-members-adminbar.php:92
-msgid "Log in"
+#: bp-groups/bp-groups-template.php:801
+msgid "%d topic"
 msgstr ""
 
-#: bp-members/bp-members-adminbar.php:152
-msgid "Edit Member"
+#: bp-groups/bp-groups-template.php:803
+msgid "%d topics"
 msgstr ""
 
-#: bp-members/bp-members-adminbar.php:178
-#: bp-members/bp-members-buddybar.php:116
-msgid "Mark as Spammer"
+#: bp-groups/bp-groups-template.php:1037 bp-groups/bp-groups-template.php:1102
+#: bp-themes/bp-default/groups/single/admin.php:190
+#: bp-themes/bp-default/groups/single/admin.php:217
+msgid "Demote to Member"
 msgstr ""
 
-#: bp-members/bp-members-adminbar.php:180
-msgid "Are you sure you want to mark this user as a spammer?"
+#: bp-groups/bp-groups-template.php:1050 bp-groups/bp-groups-template.php:1115
+#: bp-groups/bp-groups-template.php:1894
+msgid "joined %s"
 msgstr ""
 
-#: bp-members/bp-members-adminbar.php:186
-#: bp-members/bp-members-buddybar.php:120
-msgid "Not a Spammer"
+#: bp-groups/bp-groups-template.php:1073
+msgid "This group has no administrators"
 msgstr ""
 
-#: bp-members/bp-members-adminbar.php:188
-msgid "Are you sure you want to mark this user as not a spammer?"
+#: bp-groups/bp-groups-template.php:1101
+#: bp-themes/bp-default/groups/single/admin.php:216
+#: bp-themes/bp-default/groups/single/admin.php:272
+msgid "Promote to Admin"
 msgstr ""
 
-#: bp-members/bp-members-adminbar.php:198
-msgid "Are you sure you want to delete this user's account?"
+#: bp-groups/bp-groups-template.php:1135
+msgid "This group has no moderators"
 msgstr ""
 
-#: bp-members/bp-members-adminbar.php:215
-msgid "Notifications <span id=\"ab-pending-notifications\" class=\"pending-count\">%s</span>"
+#: bp-groups/bp-groups-template.php:1499 bp-groups/bp-groups-template.php:1500
+#: bp-themes/bp-default/forums/index.php:23
+#: bp-themes/bp-default/groups/single/forum.php:19
+msgid "New Topic"
 msgstr ""
 
-#: bp-members/bp-members-adminbar.php:253
-msgid "No new notifications"
+#: bp-groups/bp-groups-template.php:1539 bp-groups/bp-groups-template.php:1540
+#: bp-themes/bp-default/_inc/ajax.php:689
+msgid "Leave Group"
 msgstr ""
 
-#: bp-members/bp-members-actions.php:87
-msgid "User marked as spammer. Spam users are visible only to site admins."
+#: bp-groups/bp-groups-template.php:1562 bp-groups/bp-groups-template.php:1563
+#: bp-themes/bp-default/_inc/ajax.php:706
+msgid "Join Group"
 msgstr ""
 
-#: bp-members/bp-members-actions.php:89
-msgid "User removed as spammer."
+#: bp-groups/bp-groups-template.php:1595 bp-groups/bp-groups-template.php:1596
+msgid "Request Sent"
 msgstr ""
 
-#: bp-members/bp-members-actions.php:136
-msgid "%s has been deleted from the system."
+#: bp-groups/bp-groups-template.php:1626
+msgid "This is a private group and you must request group membership in order to join."
 msgstr ""
 
-#: bp-members/bp-members-actions.php:138
-msgid "There was an error deleting %s from the system. Please try again."
+#: bp-groups/bp-groups-template.php:1628
+msgid "This is a private group. To join you must be a registered site member and request group membership."
 msgstr ""
 
-#: bp-members/bp-members-buddybar.php:34
-msgid "No new notifications."
+#: bp-groups/bp-groups-template.php:1631
+msgid "This is a private group. Your membership request is awaiting approval from the group administrator."
 msgstr ""
 
-#: bp-members/bp-members-buddybar.php:62
-msgid "Blog Authors"
+#: bp-groups/bp-groups-template.php:1635
+msgid "This is a hidden group and only invited members can join."
 msgstr ""
 
-#: bp-members/bp-members-buddybar.php:108
-msgid "Edit %s's Profile"
+#: bp-groups/bp-groups-template.php:1942
+msgid "Viewing members %1$s to %2$s (of %3$s members)"
 msgstr ""
 
-#: bp-members/bp-members-buddybar.php:112
-msgid "Edit %s's Avatar"
+#: bp-groups/bp-groups-template.php:2168
+msgid "Group avatar"
 msgstr ""
 
-#: bp-members/bp-members-buddybar.php:124
-msgid "Delete %s's Account"
+#: bp-groups/bp-groups-template.php:2308 bp-groups/bp-groups-template.php:2332
+msgid "Recently Joined"
 msgstr ""
 
-#: bp-members/bp-members-loader.php:70
-msgid "Search Members..."
+#: bp-groups/bp-groups-template.php:2309 bp-groups/bp-groups-template.php:2335
+msgid "Most Popular"
 msgstr ""
 
-#: bp-members/bp-members-loader.php:177
-msgid "You"
+#: bp-groups/bp-groups-template.php:2310 bp-groups/bp-groups-template.php:2338
+msgid "Administrator Of"
 msgstr ""
 
-#: bp-members/bp-members-functions.php:671
-msgid "<strong>ERROR</strong>: Your account has been marked as a spammer."
+#: bp-groups/bp-groups-template.php:2311 bp-groups/bp-groups-template.php:2341
+msgid "Moderator Of"
 msgstr ""
 
-#: bp-members/bp-members-signup.php:59
-msgid "Please make sure you enter your password twice"
+#: bp-groups/bp-groups-template.php:2399
+msgid "No Group Avatar"
 msgstr ""
 
-#: bp-members/bp-members-signup.php:63
-msgid "The passwords you entered do not match."
+#: bp-groups/bp-groups-template.php:2600
+msgid "requested %s"
 msgstr ""
 
-#: bp-members/bp-members-signup.php:86
-msgid "This is a required field"
+#: bp-groups/bp-groups-template.php:2775
+msgid "Group Activity RSS Feed"
 msgstr ""
 
-#: bp-members/bp-members-signup.php:199
-msgid "Your account is now active!"
+#: bp-groups/bp-groups-widgets.php:27
+msgid "A dynamic list of recently active, popular, and newest groups"
 msgstr ""
 
-#: bp-members/bp-members-signup.php:308
-msgid "Please enter a username"
+#: bp-groups/bp-groups-widgets.php:78 bp-groups/bp-groups-widgets.php:183
+msgid "created %s"
 msgstr ""
 
-#: bp-members/bp-members-signup.php:319
-msgid "Only lowercase letters and numbers allowed"
+#: bp-groups/bp-groups-widgets.php:97
+msgid "There are no groups to display."
 msgstr ""
 
-#: bp-members/bp-members-signup.php:322
-msgid "Username must be at least 4 characters"
+#: bp-groups/bp-groups-widgets.php:134
+msgid "Link widget title to Groups directory"
 msgstr ""
 
-#: bp-members/bp-members-signup.php:325
-msgid "Sorry, usernames may not contain the character \"_\"!"
+#: bp-groups/bp-groups-widgets.php:136
+msgid "Max groups to show:"
 msgstr ""
 
-#: bp-members/bp-members-signup.php:332
-msgid "Sorry, usernames must have letters too!"
+#: bp-groups/bp-groups-widgets.php:139
+msgid "Default groups to show:"
 msgstr ""
 
-#: bp-members/bp-members-signup.php:335
-msgid "Please check your email address."
+#: bp-groups/bp-groups-widgets.php:202
+msgid "No groups matched the current filter."
 msgstr ""
 
-#: bp-members/bp-members-signup.php:338 bp-members/bp-members-signup.php:346
-msgid "Sorry, that email address is not allowed!"
+#: bp-members/bp-members-actions.php:45
+msgid "User marked as spammer. Spam users are visible only to site admins."
 msgstr ""
 
-#: bp-members/bp-members-signup.php:351
-msgid "Sorry, that username already exists!"
+#: bp-members/bp-members-actions.php:47
+msgid "User removed as spammer."
 msgstr ""
 
-#: bp-members/bp-members-signup.php:355
-msgid "Sorry, that email address is already used!"
+#: bp-members/bp-members-actions.php:80
+msgid "%s has been deleted from the system."
 msgstr ""
 
-#: bp-members/bp-members-signup.php:394
-msgid "<strong>ERROR</strong>: Couldn&#8217;t register you... please contact the <a href=\"mailto:%s\">webmaster</a> !"
+#: bp-members/bp-members-actions.php:82
+msgid "There was an error deleting %s from the system. Please try again."
 msgstr ""
 
-#: bp-members/bp-members-signup.php:479 bp-members/bp-members-signup.php:483
-msgid "Invalid activation key"
+#: bp-members/bp-members-adminbar.php:38
+msgid "Edit My Profile"
 msgstr ""
 
-#: bp-members/bp-members-signup.php:523
-msgid "%s became a registered member"
+#: bp-members/bp-members-adminbar.php:52
+msgid "Log in"
 msgstr ""
 
-#: bp-members/bp-members-signup.php:597
-msgid "<strong>ERROR</strong>: Your account has not been activated. Check your email for the activation link."
+#: bp-members/bp-members-adminbar.php:91
+msgid "Edit Member"
 msgstr ""
 
-#: bp-members/bp-members-template.php:212
-msgctxt "Member pagination previous text"
-msgid "&larr;"
+#: bp-members/bp-members-adminbar.php:99
+#: bp-xprofile/bp-xprofile-template.php:899
+#: bp-xprofile/bp-xprofile-template.php:900
+msgid "Edit Profile"
 msgstr ""
 
-#: bp-members/bp-members-template.php:213
-msgctxt "Member pagination next text"
-msgid "&rarr;"
+#: bp-members/bp-members-adminbar.php:115
+msgid "User Capabilities"
 msgstr ""
 
-#: bp-members/bp-members-template.php:354
-msgid "Viewing member %1$s to %2$s (of %3$s active members)"
+#: bp-members/bp-members-adminbar.php:123
+#: bp-settings/bp-settings-loader.php:134
+#: bp-settings/bp-settings-loader.php:194
+#: bp-themes/bp-default/members/single/settings/delete-account.php:50
+#: bp-themes/bp-default/members/single/settings/delete-account.php:76
+msgid "Delete Account"
 msgstr ""
 
-#: bp-members/bp-members-template.php:356
-msgid "Viewing member %1$s to %2$s (of %3$s members with friends)"
+#: bp-members/bp-members-adminbar.php:167
+msgid "No new notifications"
 msgstr ""
 
-#: bp-members/bp-members-template.php:358
-msgid "Viewing member %1$s to %2$s (of %3$s members online)"
+#: bp-members/bp-members-buddybar.php:24 bp-settings/bp-settings-loader.php:109
+#: bp-settings/bp-settings-loader.php:185
+msgid "Notifications"
 msgstr ""
 
-#: bp-members/bp-members-template.php:360
-msgid "Viewing member %1$s to %2$s (of %3$s members)"
+#: bp-members/bp-members-buddybar.php:45
+msgid "No new notifications."
 msgstr ""
 
-#: bp-members/bp-members-template.php:561
-msgid "Never active"
+#: bp-members/bp-members-buddybar.php:75
+msgid "Blog Authors"
 msgstr ""
 
-#: bp-members/bp-members-template.php:583
-msgctxt "member latest update in member directory"
-msgid "- &quot;%s &quot;"
+#: bp-members/bp-members-buddybar.php:125
+msgid "Edit %s's Profile"
 msgstr ""
 
-#: bp-members/bp-members-template.php:640
-msgid "registered %s"
+#: bp-members/bp-members-buddybar.php:129
+msgid "Edit %s's Avatar"
 msgstr ""
 
-#: bp-members/bp-members-template.php:1091
-msgid "Your Avatar"
+#: bp-members/bp-members-buddybar.php:133
+msgid "Mark as Spammer"
 msgstr ""
 
-#: bp-members/bp-members-template.php:1159
-msgid "Activity RSS Feed"
+#: bp-members/bp-members-buddybar.php:137
+msgid "Not a Spammer"
 msgstr ""
 
-#: bp-themes/bp-default/index.php:24 bp-themes/bp-default/attachment.php:18
-#: bp-themes/bp-default/search.php:26 bp-themes/bp-default/archive.php:24
-#: bp-themes/bp-default/single.php:16
-msgctxt "Post written by..."
-msgid "by %s"
+#: bp-members/bp-members-buddybar.php:141
+msgid "Delete %s's Account"
 msgstr ""
 
-#: bp-themes/bp-default/index.php:27
-msgctxt "Sticky post"
-msgid "Featured"
+#: bp-members/bp-members-functions.php:862
+msgid "<strong>ERROR</strong>: Your account has been marked as a spammer."
 msgstr ""
 
-#: bp-themes/bp-default/index.php:32 bp-themes/bp-default/attachment.php:22
-#: bp-themes/bp-default/search.php:30 bp-themes/bp-default/archive.php:28
-msgid "Permanent Link to"
+#: bp-members/bp-members-functions.php:1038
+msgid "Please enter a username"
 msgstr ""
 
-#: bp-themes/bp-default/index.php:34 bp-themes/bp-default/search.php:32
-#: bp-themes/bp-default/archive.php:30 bp-themes/bp-default/single.php:23
-msgid "%1$s <span>in %2$s</span>"
+#: bp-members/bp-members-functions.php:1046
+msgid "Only lowercase letters and numbers allowed"
 msgstr ""
 
-#: bp-themes/bp-default/index.php:37 bp-themes/bp-default/search.php:35
-#: bp-themes/bp-default/archive.php:33 bp-themes/bp-default/single.php:28
-msgid "Read the rest of this entry &rarr;"
+#: bp-members/bp-members-functions.php:1049
+msgid "Username must be at least 4 characters"
 msgstr ""
 
-#: bp-themes/bp-default/index.php:38 bp-themes/bp-default/page.php:20
-#: bp-themes/bp-default/onecolumn-page.php:31
-#: bp-themes/bp-default/archive.php:34 bp-themes/bp-default/single.php:30
-msgid "Pages: "
+#: bp-members/bp-members-functions.php:1052
+msgid "Sorry, usernames may not contain the character \"_\"!"
 msgstr ""
 
-#: bp-themes/bp-default/index.php:41 bp-themes/bp-default/search.php:38
-#: bp-themes/bp-default/archive.php:37 bp-themes/bp-default/single.php:33
-msgid "Tags: "
+#: bp-members/bp-members-functions.php:1059
+msgid "Sorry, usernames must have letters too!"
 msgstr ""
 
-#: bp-themes/bp-default/index.php:41 bp-themes/bp-default/search.php:38
-#: bp-themes/bp-default/archive.php:37
-msgid "No Comments &#187;"
+#: bp-members/bp-members-functions.php:1062
+msgid "Please check your email address."
 msgstr ""
 
-#: bp-themes/bp-default/index.php:41 bp-themes/bp-default/search.php:38
-#: bp-themes/bp-default/archive.php:37
-msgid "1 Comment &#187;"
+#: bp-members/bp-members-functions.php:1065
+#: bp-members/bp-members-functions.php:1073
+msgid "Sorry, that email address is not allowed!"
 msgstr ""
 
-#: bp-themes/bp-default/index.php:41 bp-themes/bp-default/search.php:38
-#: bp-themes/bp-default/archive.php:37
-msgid "% Comments &#187;"
+#: bp-members/bp-members-functions.php:1078
+msgid "Sorry, that username already exists!"
 msgstr ""
 
-#: bp-themes/bp-default/index.php:54 bp-themes/bp-default/archive.php:50
-msgid "Not Found"
+#: bp-members/bp-members-functions.php:1082
+msgid "Sorry, that email address is already used!"
 msgstr ""
 
-#: bp-themes/bp-default/index.php:55
-msgid "Sorry, but you are looking for something that isn't here."
+#: bp-members/bp-members-functions.php:1121
+msgid "<strong>ERROR</strong>: Couldn&#8217;t register you... please contact the <a href=\"mailto:%s\">webmaster</a> !"
 msgstr ""
 
-#: bp-themes/bp-default/registration/activate.php:12
-msgid "Account Activated"
+#: bp-members/bp-members-functions.php:1219
+#: bp-members/bp-members-functions.php:1223
+msgid "Invalid activation key"
 msgstr ""
 
-#: bp-themes/bp-default/registration/activate.php:17
-msgid "Your account was activated successfully! Your account details have been sent to you in a separate email."
+#: bp-members/bp-members-functions.php:1260
+msgid "%s became a registered member"
 msgstr ""
 
-#: bp-themes/bp-default/registration/activate.php:19
-msgid "Your account was activated successfully! You can now log in with the username and password you provided when you signed up."
+#: bp-members/bp-members-functions.php:1346
+msgid "<strong>ERROR</strong>: Your account has not been activated. Check your email for the activation link."
 msgstr ""
 
-#: bp-themes/bp-default/registration/activate.php:28
-msgid "Please provide a valid activation key."
+#: bp-members/bp-members-loader.php:68
+msgid "Search Members..."
 msgstr ""
 
-#: bp-themes/bp-default/registration/activate.php:32
-msgid "Activation Key:"
+#: bp-members/bp-members-loader.php:192
+msgid "You"
 msgstr ""
 
-#: bp-themes/bp-default/registration/register.php:16
-msgid "User registration is currently not allowed."
+#: bp-members/bp-members-screens.php:94
+msgid "Please make sure you enter your password twice"
 msgstr ""
 
-#: bp-themes/bp-default/registration/register.php:27
-msgid "Registering for this site is easy, just fill in the fields below and we'll get a new account set up for you in no time."
+#: bp-members/bp-members-screens.php:98
+msgid "The passwords you entered do not match."
 msgstr ""
 
-#: bp-themes/bp-default/registration/register.php:35
-msgid "Account Details"
+#: bp-members/bp-members-screens.php:121
+msgid "This is a required field"
 msgstr ""
 
-#: bp-themes/bp-default/registration/register.php:37
-#: bp-themes/bp-default/sidebar.php:44
-msgid "Username"
+#: bp-members/bp-members-screens.php:251
+msgid "Your account is now active!"
 msgstr ""
 
-#: bp-themes/bp-default/registration/register.php:37
-#: bp-themes/bp-default/registration/register.php:41
-#: bp-themes/bp-default/registration/register.php:45
-#: bp-themes/bp-default/registration/register.php:49
-#: bp-themes/bp-default/registration/register.php:76
-#: bp-themes/bp-default/registration/register.php:84
-#: bp-themes/bp-default/registration/register.php:92
-#: bp-themes/bp-default/registration/register.php:102
-#: bp-themes/bp-default/registration/register.php:113
-#: bp-themes/bp-default/registration/register.php:128
-#: bp-themes/bp-default/registration/register.php:139
-#: bp-themes/bp-default/registration/register.php:189
-#: bp-themes/bp-default/registration/register.php:198
-#: bp-themes/bp-default/members/single/profile/edit.php:26
-#: bp-themes/bp-default/members/single/profile/edit.php:33
-#: bp-themes/bp-default/members/single/profile/edit.php:40
-#: bp-themes/bp-default/members/single/profile/edit.php:49
-#: bp-themes/bp-default/members/single/profile/edit.php:67
-#: bp-themes/bp-default/members/single/profile/edit.php:83
-#: bp-themes/bp-default/members/single/profile/edit.php:93
-msgid "(required)"
+#: bp-members/bp-members-template.php:206
+msgctxt "Member pagination previous text"
+msgid "&larr;"
 msgstr ""
 
-#: bp-themes/bp-default/registration/register.php:41
-msgid "Email Address"
+#: bp-members/bp-members-template.php:207
+msgctxt "Member pagination next text"
+msgid "&rarr;"
 msgstr ""
 
-#: bp-themes/bp-default/registration/register.php:45
-msgid "Choose a Password"
+#: bp-members/bp-members-template.php:346
+msgid "Viewing member %1$s to %2$s (of %3$s active members)"
 msgstr ""
 
-#: bp-themes/bp-default/registration/register.php:49
-msgid "Confirm Password"
+#: bp-members/bp-members-template.php:348
+msgid "Viewing member %1$s to %2$s (of %3$s members with friends)"
 msgstr ""
 
-#: bp-themes/bp-default/registration/register.php:65
-msgid "Profile Details"
+#: bp-members/bp-members-template.php:350
+msgid "Viewing member %1$s to %2$s (of %3$s members online)"
 msgstr ""
 
-#: bp-themes/bp-default/registration/register.php:183
-msgid "Blog Details"
+#: bp-members/bp-members-template.php:352
+msgid "Viewing member %1$s to %2$s (of %3$s members)"
 msgstr ""
 
-#: bp-themes/bp-default/registration/register.php:185
-msgid "Yes, I'd like to create a new site"
+#: bp-members/bp-members-template.php:556
+msgid "Never active"
 msgstr ""
 
-#: bp-themes/bp-default/registration/register.php:189
-msgid "Blog URL"
+#: bp-members/bp-members-template.php:578
+msgctxt "member latest update in member directory"
+msgid "- &quot;%s &quot;"
 msgstr ""
 
-#: bp-themes/bp-default/registration/register.php:198
-msgid "Site Title"
+#: bp-members/bp-members-template.php:635
+msgid "registered %s"
 msgstr ""
 
-#: bp-themes/bp-default/registration/register.php:219
-msgid "Complete Sign Up"
+#: bp-members/bp-members-template.php:1077
+msgid "Your Avatar"
 msgstr ""
 
-#: bp-themes/bp-default/registration/register.php:230
-msgid "Sign Up Complete!"
+#: bp-members/bp-members-template.php:1147
+msgid "Activity RSS Feed"
 msgstr ""
 
-#: bp-themes/bp-default/registration/register.php:236
-msgid "You have successfully created your account! To begin using this site you will need to activate your account via the email we have just sent to your address."
+#: bp-messages/bp-messages-actions.php:36
+msgid "Your reply was sent successfully"
 msgstr ""
 
-#: bp-themes/bp-default/registration/register.php:238
-msgid "You have successfully created your account! Please log in using the username and password you have just created."
+#: bp-messages/bp-messages-actions.php:38
+msgid "There was a problem sending your reply, please try again"
 msgstr ""
 
-#: bp-themes/bp-default/_inc/ajax.php:160
-#: bp-activity/bp-activity-actions.php:206
-msgid "Please enter some content to post."
+#: bp-messages/bp-messages-actions.php:47
+#: bp-messages/bp-messages-loader.php:104
+msgid "Messages <span>%s</span>"
 msgstr ""
 
-#: bp-themes/bp-default/_inc/ajax.php:177
-msgid "There was a problem posting your update, please try again."
+#: bp-messages/bp-messages-actions.php:54
+msgid "From: %s"
 msgstr ""
 
-#: bp-themes/bp-default/_inc/ajax.php:202
-#: bp-activity/bp-activity-actions.php:268
-msgid "Please do not leave the comment area blank."
+#: bp-messages/bp-messages-actions.php:84
+msgid "There was an error deleting that message."
 msgstr ""
 
-#: bp-themes/bp-default/_inc/ajax.php:207
-#: bp-themes/bp-default/_inc/ajax.php:218
-#: bp-activity/bp-activity-actions.php:281
-msgid "There was an error posting that reply, please try again."
+#: bp-messages/bp-messages-actions.php:86
+msgid "Message deleted."
 msgstr ""
 
-#: bp-themes/bp-default/_inc/ajax.php:275
-#: bp-themes/bp-default/_inc/ajax.php:310
-msgid "There was a problem when deleting. Please try again."
+#: bp-messages/bp-messages-actions.php:108
+msgid "There was an error deleting messages."
 msgstr ""
 
-#: bp-themes/bp-default/_inc/ajax.php:325
-#: bp-themes/bp-default/functions.php:158
-#: bp-themes/bp-default/activity/entry.php:72
-msgid "Remove Favorite"
+#: bp-messages/bp-messages-actions.php:110
+#: bp-themes/bp-default/_inc/ajax.php:853
+msgid "Messages deleted."
 msgstr ""
 
-#: bp-themes/bp-default/_inc/ajax.php:334
-#: bp-themes/bp-default/functions.php:157
-#: bp-themes/bp-default/activity/entry.php:68
-msgid "Favorite"
+#: bp-messages/bp-messages-classes.php:261
+msgid "%s Recipients"
 msgstr ""
 
-#: bp-themes/bp-default/_inc/ajax.php:393
-#: bp-themes/bp-default/groups/single/send-invites.php:42
-#: bp-themes/bp-default/groups/create.php:234
-msgid "Remove Invite"
+#: bp-messages/bp-messages-functions.php:53
+msgid "Re: %s"
 msgstr ""
 
-#: bp-themes/bp-default/_inc/ajax.php:434
-msgid "Request Pending"
+#: bp-messages/bp-messages-functions.php:61
+msgid "No Subject"
 msgstr ""
 
-#: bp-themes/bp-default/_inc/ajax.php:446
-msgid "There was a problem accepting that request. Please try again."
+#: bp-messages/bp-messages-functions.php:233
+#: bp-messages/bp-messages-loader.php:122
+#: bp-messages/bp-messages-loader.php:191
+msgid "Inbox"
 msgstr ""
 
-#: bp-themes/bp-default/_inc/ajax.php:457
-msgid "There was a problem rejecting that request. Please try again."
+#: bp-messages/bp-messages-functions.php:236
+msgid "You have %d new messages"
 msgstr ""
 
-#: bp-themes/bp-default/_inc/ajax.php:480
-msgid "Error joining group"
+#: bp-messages/bp-messages-functions.php:239
+msgid "You have %d new message"
 msgstr ""
 
-#: bp-themes/bp-default/_inc/ajax.php:490
-msgid "Error requesting membership"
+#: bp-messages/bp-messages-loader.php:33
+msgid "Private Messages"
 msgstr ""
 
-#: bp-themes/bp-default/_inc/ajax.php:492
-msgid "Membership Requested"
+#: bp-messages/bp-messages-loader.php:87
+msgid "Search Messages..."
 msgstr ""
 
-#: bp-themes/bp-default/_inc/ajax.php:501
-msgid "Error leaving group"
+#: bp-messages/bp-messages-loader.php:132
+#: bp-messages/bp-messages-loader.php:214
+msgid "Sent"
 msgstr ""
 
-#: bp-themes/bp-default/_inc/ajax.php:518
-msgid "There was a problem closing the notice."
+#: bp-messages/bp-messages-loader.php:142
+#: bp-messages/bp-messages-loader.php:222
+msgid "Compose"
 msgstr ""
 
-#: bp-themes/bp-default/_inc/ajax.php:560
-msgid "There was a problem sending that reply. Please try again."
+#: bp-messages/bp-messages-loader.php:153
+msgid "Notices"
 msgstr ""
 
-#: bp-themes/bp-default/_inc/ajax.php:570
-msgid "There was a problem marking messages as unread."
+#: bp-messages/bp-messages-loader.php:187
+msgid "Messages <span class=\"count\">%s</span>"
 msgstr ""
 
-#: bp-themes/bp-default/_inc/ajax.php:586
-msgid "There was a problem marking messages as read."
+#: bp-messages/bp-messages-loader.php:188
+msgid "Inbox <span class=\"count\">%s</span>"
 msgstr ""
 
-#: bp-themes/bp-default/_inc/ajax.php:602
-msgid "There was a problem deleting messages."
+#: bp-messages/bp-messages-loader.php:190
+#: bp-messages/bp-messages-screens.php:148
+msgid "Messages"
 msgstr ""
 
-#: bp-themes/bp-default/footer.php:15
-msgid "Proudly powered by <a href=\"%1$s\">WordPress</a> and <a href=\"%2$s\">BuddyPress</a>."
+#: bp-messages/bp-messages-loader.php:231
+msgid "All Member Notices"
 msgstr ""
 
-#: bp-themes/bp-default/sidebar.php:37
-msgid "Please <a href=\"%s\" title=\"Create an account\">create an account</a> to get started."
+#: bp-messages/bp-messages-loader.php:250
+msgid "My Messages"
 msgstr ""
 
-#: bp-themes/bp-default/sidebar.php:47
-msgid "Password"
+#: bp-messages/bp-messages-notifications.php:46
+msgid "New message from %s"
 msgstr ""
 
-#: bp-themes/bp-default/sidebar.php:50
-msgid "Remember Me"
+#: bp-messages/bp-messages-notifications.php:48
+msgid ""
+"%1$s sent you a new message:\n"
+"\n"
+"Subject: %2$s\n"
+"\n"
+"\"%3$s\"\n"
+"\n"
+"To view and read your messages please log in and visit: %4$s\n"
+"\n"
+"---------------------\n"
 msgstr ""
 
-#: bp-themes/bp-default/sidebar.php:64
-msgid "Forum Topic Tags"
+#: bp-messages/bp-messages-screens.php:56
+#: bp-messages/bp-messages-screens.php:78
+msgid "There was an error sending that message, please try again"
 msgstr ""
 
-#: bp-themes/bp-default/comments.php:3
-msgid "Password Protected"
+#: bp-messages/bp-messages-screens.php:61
+msgid "Notice sent successfully!"
 msgstr ""
 
-#: bp-themes/bp-default/comments.php:4
-msgid "Enter the password to view comments."
+#: bp-messages/bp-messages-screens.php:64
+msgid "There was an error sending that notice, please try again"
 msgstr ""
 
-#: bp-themes/bp-default/comments.php:24
-msgid "1 response to %2$s"
-msgid_plural "%1$s responses to %2$s"
-msgstr[0] ""
-msgstr[1] ""
-
-#: bp-themes/bp-default/comments.php:46
-msgid "Comments are closed, but <a href=\"%1$s\" title=\"Trackback URL for this post\">trackbacks</a> and pingbacks are open."
+#: bp-messages/bp-messages-screens.php:75
+msgid "Message sent successfully!"
 msgstr ""
 
-#: bp-themes/bp-default/comments.php:50
-msgid "Comments are closed."
+#: bp-messages/bp-messages-screens.php:102
+msgid "There was a problem deactivating that notice."
 msgstr ""
 
-#: bp-themes/bp-default/comments.php:62
-msgid "1 trackback"
-msgid_plural "%d trackbacks"
-msgstr[0] ""
-msgstr[1] ""
-
-#: bp-themes/bp-default/404.php:7
-msgid "Page not found"
+#: bp-messages/bp-messages-screens.php:104
+msgid "Notice deactivated."
 msgstr ""
 
-#: bp-themes/bp-default/404.php:9
-msgid "We're sorry, but we can't find the page that you're looking for. Perhaps searching will help."
+#: bp-messages/bp-messages-screens.php:108
+msgid "There was a problem activating that notice."
 msgstr ""
 
-#: bp-themes/bp-default/functions.php:81
-msgid "Primary Navigation"
+#: bp-messages/bp-messages-screens.php:110
+msgid "Notice activated."
 msgstr ""
 
-#: bp-themes/bp-default/functions.php:149
-msgid "My Favorites"
+#: bp-messages/bp-messages-screens.php:114
+msgid "There was a problem deleting that notice."
 msgstr ""
 
-#: bp-themes/bp-default/functions.php:150
-msgid "Accepted"
+#: bp-messages/bp-messages-screens.php:116
+msgid "Notice deleted."
 msgstr ""
 
-#: bp-themes/bp-default/functions.php:151
-msgid "Rejected"
+#: bp-messages/bp-messages-screens.php:157
+msgid "A member sends you a new message"
 msgstr ""
 
-#: bp-themes/bp-default/functions.php:152
-msgid "Show all comments for this thread"
+#: bp-messages/bp-messages-screens.php:163
+msgid "A new site notice is posted"
 msgstr ""
 
-#: bp-themes/bp-default/functions.php:153
-msgid "Show all"
+#: bp-messages/bp-messages-template.php:84
+msgctxt "Message pagination previous text"
+msgid "&larr;"
 msgstr ""
 
-#: bp-themes/bp-default/functions.php:154
-msgid "comments"
+#: bp-messages/bp-messages-template.php:85
+msgctxt "Message pagination next text"
+msgid "&rarr;"
 msgstr ""
 
-#: bp-themes/bp-default/functions.php:377
-msgid "The sidebar widget area"
+#: bp-messages/bp-messages-template.php:358
+msgid "Viewing message %1$s to %2$s (of %3$s messages)"
 msgstr ""
 
-#: bp-themes/bp-default/functions.php:386
-msgid "First Footer Widget Area"
+#: bp-messages/bp-messages-template.php:434
+msgid "Select:"
 msgstr ""
 
-#: bp-themes/bp-default/functions.php:388
-msgid "The first footer widget area"
+#: bp-messages/bp-messages-template.php:438
+msgid "Read"
 msgstr ""
 
-#: bp-themes/bp-default/functions.php:397
-msgid "Second Footer Widget Area"
+#: bp-messages/bp-messages-template.php:439
+msgid "Unread"
 msgstr ""
 
-#: bp-themes/bp-default/functions.php:399
-msgid "The second footer widget area"
+#: bp-messages/bp-messages-template.php:445
+msgid "Mark as Read"
 msgstr ""
 
-#: bp-themes/bp-default/functions.php:408
-msgid "Third Footer Widget Area"
+#: bp-messages/bp-messages-template.php:446
+msgid "Mark as Unread"
 msgstr ""
 
-#: bp-themes/bp-default/functions.php:410
-msgid "The third footer widget area"
+#: bp-messages/bp-messages-template.php:450
+msgid "Delete Selected"
 msgstr ""
 
-#: bp-themes/bp-default/functions.php:419
-msgid "Fourth Footer Widget Area"
+#: bp-messages/bp-messages-template.php:495
+msgid "Currently Active"
 msgstr ""
 
-#: bp-themes/bp-default/functions.php:421
-msgid "The fourth footer widget area"
+#: bp-messages/bp-messages-template.php:562
+msgid "Deactivate"
 msgstr ""
 
-#. translators: 1: comment author url, 2: comment author name, 3: comment
-#. permalink, 4: comment date/timestamp
-
-#: bp-themes/bp-default/functions.php:476
-msgid "<a href=\"%1$s\" rel=\"nofollow\">%2$s</a> said on <a href=\"%3$s\"><span class=\"time-since\">%4$s</span></a>"
+#: bp-messages/bp-messages-template.php:613
+#: bp-themes/bp-default/functions.php:164
+#: bp-themes/bp-default/members/single/profile/edit.php:128
+#: bp-themes/bp-default/registration/register.php:169
+msgid "Close"
 msgstr ""
 
-#: bp-themes/bp-default/functions.php:483
-msgid "Your comment is awaiting moderation."
+#: bp-messages/bp-messages-template.php:656
+msgid "Send a private message to this user."
 msgstr ""
 
-#: bp-themes/bp-default/functions.php:495
-msgid "Edit comment"
+#: bp-messages/bp-messages-template.php:657
+msgid "Private Message"
 msgstr ""
 
-#: bp-themes/bp-default/functions.php:565
-msgid "Theme activated! This theme contains <a href=\"%s\">custom header image</a> support and <a href=\"%s\">sidebar widgets</a>."
+#: bp-messages/bp-messages-template.php:840
+msgid "%d Recipients"
 msgstr ""
 
-#: bp-themes/bp-default/functions.php:636
-msgid "Email"
+#: bp-messages/bp-messages-template.php:922
+#: bp-themes/bp-default/_inc/ajax.php:760
+msgid "Sent %s"
 msgstr ""
 
-#: bp-themes/bp-default/functions.php:646
-msgid "You must be <a href=\"%1$s\">logged in</a> to post a comment."
+#: bp-settings/bp-settings-actions.php:157
+msgid "That email address is invalid. Check the formatting and try again."
 msgstr ""
 
-#: bp-themes/bp-default/functions.php:647
-msgid "Leave a reply"
+#: bp-settings/bp-settings-actions.php:160
+msgid "That email address is currently unavailable for use."
 msgstr ""
 
-#: bp-themes/bp-default/functions.php:731
-msgid "&larr; Previous Entries"
+#: bp-settings/bp-settings-actions.php:163
+msgid "That email address is already taken."
 msgstr ""
 
-#: bp-themes/bp-default/functions.php:732
-msgid "Next Entries &rarr;"
+#: bp-settings/bp-settings-actions.php:166
+msgid "Email address cannot be empty."
 msgstr ""
 
-#: bp-themes/bp-default/page.php:18 bp-themes/bp-default/onecolumn-page.php:29
-msgid "<p class=\"serif\">Read the rest of this page &rarr;</p>"
+#: bp-settings/bp-settings-actions.php:176
+msgid "Your current password is invalid."
 msgstr ""
 
-#: bp-themes/bp-default/page.php:21 bp-themes/bp-default/onecolumn-page.php:32
-msgid "Edit this page."
+#: bp-settings/bp-settings-actions.php:179
+msgid "The new password fields did not match."
 msgstr ""
 
-#: bp-themes/bp-default/header.php:27
-msgctxt "Home page banner link title"
-msgid "Home"
+#: bp-settings/bp-settings-actions.php:182
+msgid "One of the password fields was empty."
 msgstr ""
 
-#: bp-themes/bp-default/header.php:30
-msgid "Search for:"
+#: bp-settings/bp-settings-actions.php:191
+msgid "Your settings have been saved."
 msgstr ""
 
-#: bp-themes/bp-default/members/index.php:23
-msgid "Members Directory"
+#: bp-settings/bp-settings-actions.php:197
+msgid "No changes were made to your account."
 msgstr ""
 
-#: bp-themes/bp-default/members/index.php:35
-#: bp-themes/bp-default/activity/index.php:41
-msgid "All Members <span>%s</span>"
+#: bp-settings/bp-settings-actions.php:199
+msgid "No changes were made to this account."
 msgstr ""
 
-#: bp-themes/bp-default/members/index.php:39
-#: bp-themes/bp-default/activity/index.php:51
-msgid "My Friends <span>%s</span>"
+#: bp-settings/bp-settings-actions.php:247
+msgid "Your notification settings have been saved."
 msgstr ""
 
-#: bp-themes/bp-default/members/index.php:57
-#: bp-themes/bp-default/members/single/friends.php:22
-#: bp-themes/bp-default/members/single/groups.php:22
-#: bp-themes/bp-default/members/single/forums.php:20
-#: bp-themes/bp-default/members/single/blogs.php:21
-#: bp-themes/bp-default/blogs/index.php:57
-#: bp-themes/bp-default/forums/index.php:62
-#: bp-themes/bp-default/groups/index.php:59
-#: bp-themes/bp-default/groups/single/forum.php:38
-msgid "Last Active"
+#: bp-settings/bp-settings-actions.php:249
+msgid "This user's notification settings have been saved."
 msgstr ""
 
-#: bp-themes/bp-default/members/index.php:58
-#: bp-themes/bp-default/members/single/friends.php:23
-msgid "Newest Registered"
+#: bp-settings/bp-settings-actions.php:340
+msgid "%s was successfully deleted."
 msgstr ""
 
-#: bp-themes/bp-default/members/index.php:62
-#: bp-themes/bp-default/members/single/friends.php:24
-#: bp-themes/bp-default/members/single/groups.php:25
-#: bp-themes/bp-default/members/single/blogs.php:23
-#: bp-themes/bp-default/blogs/index.php:59
-#: bp-themes/bp-default/groups/index.php:62
-msgid "Alphabetical"
+#: bp-settings/bp-settings-loader.php:98 bp-settings/bp-settings-loader.php:177
+msgid "General"
 msgstr ""
 
-#: bp-themes/bp-default/members/members-loop.php:108
-msgid "Sorry, no members were found."
+#: bp-settings/bp-settings-loader.php:121
+#: bp-themes/bp-default/members/single/settings/capabilities.php:49
+msgid "Capabilities"
 msgstr ""
 
-#: bp-themes/bp-default/members/single/settings/notifications.php:50
-msgid "Email Notification"
+#: bp-themes/bp-default/404.php:7
+msgid "Page not found"
 msgstr ""
 
-#: bp-themes/bp-default/members/single/settings/notifications.php:55
-msgid "Send a notification by email when:"
+#: bp-themes/bp-default/404.php:9
+msgid "We're sorry, but we can't find the page that you're looking for. Perhaps searching will help."
 msgstr ""
 
-#: bp-themes/bp-default/members/single/settings/delete-account.php:55
-msgid "WARNING: Deleting your account will completely remove ALL content associated with it. There is no way back, please be careful with this option."
+#: bp-themes/bp-default/_inc/ajax.php:278
+msgid "There was a problem posting your update, please try again."
 msgstr ""
 
-#: bp-themes/bp-default/members/single/settings/delete-account.php:58
-msgid "I understand the consequences of deleting my account."
+#: bp-themes/bp-default/_inc/ajax.php:379
+#: bp-themes/bp-default/_inc/ajax.php:415
+msgid "There was a problem when deleting. Please try again."
 msgstr ""
 
-#: bp-themes/bp-default/members/single/settings/delete-account.php:63
-msgid "Delete My Account"
+#: bp-themes/bp-default/_inc/ajax.php:478
+#: bp-themes/bp-default/_inc/ajax.php:499
+#: bp-themes/bp-default/activity/entry.php:72
+#: bp-themes/bp-default/functions.php:167
+msgid "Remove Favorite"
 msgstr ""
 
-#: bp-themes/bp-default/members/single/settings/general.php:50
-msgid "General Settings"
+#: bp-themes/bp-default/_inc/ajax.php:480
+#: bp-themes/bp-default/_inc/ajax.php:497
+#: bp-themes/bp-default/activity/entry.php:68
+#: bp-themes/bp-default/functions.php:166
+msgid "Favorite"
 msgstr ""
 
-#: bp-themes/bp-default/members/single/settings/general.php:56
-msgid "Current Password <span>(required to update email or change current password)</span>"
-msgstr ""
-
-#: bp-themes/bp-default/members/single/settings/general.php:57
-msgid "Password Lost and Found"
-msgstr ""
-
-#: bp-themes/bp-default/members/single/settings/general.php:57
-msgid "Lost your password?"
-msgstr ""
-
-#: bp-themes/bp-default/members/single/settings/general.php:59
-msgid "Account Email"
-msgstr ""
-
-#: bp-themes/bp-default/members/single/settings/general.php:62
-msgid "Change Password <span>(leave blank for no change)</span>"
-msgstr ""
-
-#: bp-themes/bp-default/members/single/settings/general.php:63
-msgid "New Password"
-msgstr ""
-
-#: bp-themes/bp-default/members/single/settings/general.php:64
-msgid "Repeat New Password"
+#: bp-themes/bp-default/_inc/ajax.php:569
+#: bp-themes/bp-default/groups/create.php:229
+#: bp-themes/bp-default/groups/single/send-invites.php:42
+msgid "Remove Invite"
 msgstr ""
 
-#: bp-themes/bp-default/members/single/profile/profile-wp.php:8
-msgid "%s's Profile"
+#: bp-themes/bp-default/_inc/ajax.php:608
+msgid " Friendship could not be requested."
 msgstr ""
 
-#: bp-themes/bp-default/members/single/profile/change-avatar.php:7
-msgid "Your avatar will be used on your profile and throughout the site. If there is a <a href=\"http://gravatar.com\">Gravatar</a> associated with your account email we will use that, or you can upload an image from your computer."
+#: bp-themes/bp-default/_inc/ajax.php:618
+msgid "Friendship request could not be cancelled."
 msgstr ""
 
-#: bp-themes/bp-default/members/single/profile/change-avatar.php:14
-msgid "Click below to select a JPG, GIF or PNG format photo from your computer and then click 'Upload Image' to proceed."
+#: bp-themes/bp-default/_inc/ajax.php:621
+msgid "Request Pending"
 msgstr ""
 
-#: bp-themes/bp-default/members/single/profile/change-avatar.php:18
-#: bp-themes/bp-default/groups/single/admin.php:131
-#: bp-themes/bp-default/groups/create.php:158
-msgid "Upload Image"
+#: bp-themes/bp-default/_inc/ajax.php:641
+msgid "There was a problem accepting that request. Please try again."
 msgstr ""
 
-#: bp-themes/bp-default/members/single/profile/change-avatar.php:23
-msgid "If you'd like to delete your current avatar but not upload a new one, please use the delete avatar button."
+#: bp-themes/bp-default/_inc/ajax.php:660
+msgid "There was a problem rejecting that request. Please try again."
 msgstr ""
 
-#: bp-themes/bp-default/members/single/profile/change-avatar.php:24
-#: bp-themes/bp-default/groups/single/admin.php:139
-msgid "Delete Avatar"
+#: bp-themes/bp-default/_inc/ajax.php:687
+msgid "Error joining group"
 msgstr ""
 
-#: bp-themes/bp-default/members/single/profile/change-avatar.php:24
-msgid "Delete My Avatar"
+#: bp-themes/bp-default/_inc/ajax.php:695
+msgid "Error requesting membership"
 msgstr ""
 
-#: bp-themes/bp-default/members/single/profile/change-avatar.php:31
-msgid "Crop Your New Avatar"
+#: bp-themes/bp-default/_inc/ajax.php:697
+msgid "Membership Requested"
 msgstr ""
 
-#: bp-themes/bp-default/members/single/profile/change-avatar.php:33
-#: bp-themes/bp-default/groups/single/admin.php:151
-#: bp-themes/bp-default/groups/create.php:171
-msgid "Avatar to crop"
+#: bp-themes/bp-default/_inc/ajax.php:704
+msgid "Error leaving group"
 msgstr ""
 
-#: bp-themes/bp-default/members/single/profile/change-avatar.php:36
-#: bp-themes/bp-default/groups/single/admin.php:154
-#: bp-themes/bp-default/groups/create.php:174
-msgid "Avatar preview"
+#: bp-themes/bp-default/_inc/ajax.php:726
+msgid "There was a problem closing the notice."
 msgstr ""
 
-#: bp-themes/bp-default/members/single/profile/change-avatar.php:39
-#: bp-themes/bp-default/groups/single/admin.php:157
-#: bp-themes/bp-default/groups/create.php:177
-msgid "Crop Image"
+#: bp-themes/bp-default/_inc/ajax.php:777
+msgid "There was a problem sending that reply. Please try again."
 msgstr ""
 
-#: bp-themes/bp-default/members/single/profile/change-avatar.php:55
-msgid "Your avatar will be used on your profile and throughout the site. To change your avatar, please create an account with <a href=\"http://gravatar.com\">Gravatar</a> using the same email address as you used to register with this site."
+#: bp-themes/bp-default/_inc/ajax.php:795
+msgid "There was a problem marking messages as unread."
 msgstr ""
 
-#: bp-themes/bp-default/members/single/profile/edit.php:10
-msgid "Editing '%s' Profile Group"
+#: bp-themes/bp-default/_inc/ajax.php:820
+msgid "There was a problem marking messages as read."
 msgstr ""
 
-#: bp-themes/bp-default/members/single/groups.php:23
-#: bp-themes/bp-default/groups/index.php:60
-msgid "Most Members"
+#: bp-themes/bp-default/_inc/ajax.php:845
+msgid "There was a problem deleting messages."
 msgstr ""
 
-#: bp-themes/bp-default/members/single/groups.php:24
-#: bp-themes/bp-default/groups/index.php:61
-msgid "Newly Created"
+#: bp-themes/bp-default/activity/activity-loop.php:41
+msgid "Load More"
 msgstr ""
 
-#: bp-themes/bp-default/members/single/forums.php:21
-#: bp-themes/bp-default/forums/index.php:63
-#: bp-themes/bp-default/groups/single/forum.php:39
-msgid "Most Posts"
+#: bp-themes/bp-default/activity/activity-loop.php:55
+msgid "Sorry, there was no activity found. Please try a different filter."
 msgstr ""
 
-#: bp-themes/bp-default/members/single/forums.php:22
-#: bp-themes/bp-default/forums/index.php:64
-#: bp-themes/bp-default/groups/single/forum.php:40
-msgid "Unreplied"
-msgstr ""
+#. translators: 1: user profile link, 2: user name, 3: activity permalink, 4:
+#. activity timestamp
 
-#: bp-themes/bp-default/members/single/messages/compose.php:5
-msgid "Send To (Username or Friend's Name)"
+#: bp-themes/bp-default/activity/comment.php:27
+msgid "<a href=\"%1$s\">%2$s</a> replied <a href=\"%3$s\" class=\"activity-time-since\"><span class=\"time-since\">%4$s</span></a>"
 msgstr ""
 
-#: bp-themes/bp-default/members/single/messages/compose.php:14
-msgid "This is a notice to all users."
+#: bp-themes/bp-default/activity/entry.php:37
+msgid "In reply to: "
 msgstr ""
 
-#: bp-themes/bp-default/members/single/messages/compose.php:17
-msgid "Subject"
+#: bp-themes/bp-default/activity/entry.php:37
+msgid "View Thread / Permalink"
 msgstr ""
 
-#: bp-themes/bp-default/members/single/messages/compose.php:20
-msgid "Message"
+#: bp-themes/bp-default/activity/entry.php:60
+msgid "Comment <span>%s</span>"
 msgstr ""
 
-#: bp-themes/bp-default/members/single/messages/compose.php:28
-msgid "Send Message"
+#: bp-themes/bp-default/activity/entry.php:68
+msgid "Mark as Favorite"
 msgstr ""
 
-#: bp-themes/bp-default/members/single/messages/notices-loop.php:31
-msgid "Sent:"
+#: bp-themes/bp-default/activity/entry.php:104
+msgid "Post"
 msgstr ""
 
-#: bp-themes/bp-default/members/single/messages/notices-loop.php:38
-#: bp-themes/bp-default/members/single/messages/messages-loop.php:50
-#: bp-themes/bp-default/members/single/messages/single.php:24
-msgid "Delete Message"
+#: bp-themes/bp-default/activity/entry.php:104
+msgid "or press esc to cancel."
 msgstr ""
 
-#: bp-themes/bp-default/members/single/messages/notices-loop.php:49
-msgid "Sorry, no notices were found."
+#: bp-themes/bp-default/activity/index.php:21
+msgid "Site Activity"
 msgstr ""
 
-#: bp-themes/bp-default/members/single/messages/messages-loop.php:31
-msgid "From:"
+#: bp-themes/bp-default/activity/index.php:39
+msgid "The public activity for everyone on this site."
 msgstr ""
 
-#: bp-themes/bp-default/members/single/messages/messages-loop.php:36
-msgid "To:"
+#: bp-themes/bp-default/activity/index.php:39
+#: bp-themes/bp-default/members/index.php:33
+msgid "All Members <span>%s</span>"
 msgstr ""
 
-#: bp-themes/bp-default/members/single/messages/messages-loop.php:42
-msgid "View Message"
+#: bp-themes/bp-default/activity/index.php:49
+msgid "The activity of my friends only."
 msgstr ""
 
-#: bp-themes/bp-default/members/single/messages/messages-loop.php:68
-msgid "Sorry, no messages were found."
+#: bp-themes/bp-default/activity/index.php:49
+#: bp-themes/bp-default/members/index.php:37
+msgid "My Friends <span>%s</span>"
 msgstr ""
 
-#: bp-themes/bp-default/members/single/messages/single.php:14
-msgid "You are alone in this conversation."
+#: bp-themes/bp-default/activity/index.php:61
+msgid "The activity of groups I am a member of."
 msgstr ""
 
-#: bp-themes/bp-default/members/single/messages/single.php:18
-msgid "Conversation between %s and you."
+#: bp-themes/bp-default/activity/index.php:61
+#: bp-themes/bp-default/groups/index.php:39
+msgid "My Groups <span>%s</span>"
 msgstr ""
 
-#: bp-themes/bp-default/members/single/messages/single.php:75
-msgid "Send a Reply"
+#: bp-themes/bp-default/activity/index.php:71
+msgid "The activity I've marked as a favorite."
 msgstr ""
 
-#: bp-themes/bp-default/members/single/messages/single.php:91
-msgid "Send Reply"
+#: bp-themes/bp-default/activity/index.php:71
+msgid "My Favorites <span>%s</span>"
 msgstr ""
 
-#: bp-themes/bp-default/members/single/groups/invites.php:23
-#: bp-themes/bp-default/members/single/friends/requests.php:37
-#: bp-themes/bp-default/groups/single/admin.php:318
-msgid "Accept"
+#: bp-themes/bp-default/activity/index.php:77
+msgid "Activity that I have been mentioned in."
 msgstr ""
 
-#: bp-themes/bp-default/members/single/groups/invites.php:24
-#: bp-themes/bp-default/members/single/friends/requests.php:38
-#: bp-themes/bp-default/groups/single/admin.php:320
-msgid "Reject"
+#: bp-themes/bp-default/activity/index.php:77
+msgid "<span>%s new</span>"
 msgstr ""
 
-#: bp-themes/bp-default/members/single/groups/invites.php:37
-msgid "You have no outstanding group invites."
+#: bp-themes/bp-default/activity/index.php:87
+#: bp-themes/bp-default/groups/single/activity.php:3
+msgid "RSS Feed"
 msgstr ""
 
-#: bp-themes/bp-default/members/single/friends/requests.php:68
-msgid "You have no pending friendship requests."
+#: bp-themes/bp-default/activity/index.php:87
+#: bp-themes/bp-default/groups/single/activity.php:3
+msgid "RSS"
 msgstr ""
 
-#: bp-themes/bp-default/members/single/activity.php:18
-#: bp-themes/bp-default/activity/index.php:94
+#: bp-themes/bp-default/activity/index.php:92
 #: bp-themes/bp-default/groups/single/activity.php:8
+#: bp-themes/bp-default/members/single/activity.php:18
 msgid "Show:"
 msgstr ""
 
-#: bp-themes/bp-default/members/single/activity.php:20
-#: bp-themes/bp-default/activity/index.php:96
+#: bp-themes/bp-default/activity/index.php:94
 #: bp-themes/bp-default/groups/single/activity.php:10
+#: bp-themes/bp-default/members/single/activity.php:20
 msgid "Everything"
 msgstr ""
 
-#: bp-themes/bp-default/members/single/activity.php:21
-#: bp-themes/bp-default/activity/index.php:97
+#: bp-themes/bp-default/activity/index.php:95
 #: bp-themes/bp-default/groups/single/activity.php:11
+#: bp-themes/bp-default/members/single/activity.php:21
 msgid "Updates"
 msgstr ""
 
+#: bp-themes/bp-default/activity/index.php:100
 #: bp-themes/bp-default/members/single/activity.php:28
-#: bp-themes/bp-default/activity/index.php:102
 msgid "Comments"
 msgstr ""
 
-#: bp-themes/bp-default/members/single/activity.php:43
-#: bp-themes/bp-default/activity/index.php:108
+#: bp-themes/bp-default/activity/index.php:106
 #: bp-themes/bp-default/groups/single/activity.php:14
+#: bp-themes/bp-default/members/single/activity.php:43
 msgid "Forum Topics"
 msgstr ""
 
-#: bp-themes/bp-default/members/single/activity.php:44
-#: bp-themes/bp-default/activity/index.php:109
+#: bp-themes/bp-default/activity/index.php:107
 #: bp-themes/bp-default/groups/single/activity.php:15
+#: bp-themes/bp-default/members/single/activity.php:44
 msgid "Forum Replies"
 msgstr ""
 
+#: bp-themes/bp-default/activity/index.php:113
 #: bp-themes/bp-default/members/single/activity.php:50
-#: bp-themes/bp-default/activity/index.php:115
 msgid "New Groups"
 msgstr ""
 
-#: bp-themes/bp-default/members/single/activity.php:51
-#: bp-themes/bp-default/activity/index.php:116
+#: bp-themes/bp-default/activity/index.php:114
 #: bp-themes/bp-default/groups/single/activity.php:18
+#: bp-themes/bp-default/members/single/activity.php:51
 msgid "Group Memberships"
 msgstr ""
 
-#: bp-themes/bp-default/activity/index.php:41
-msgid "The public activity for everyone on this site."
-msgstr ""
-
-#: bp-themes/bp-default/activity/index.php:51
-msgid "The activity of my friends only."
-msgstr ""
-
-#: bp-themes/bp-default/activity/index.php:63
-msgid "The activity of groups I am a member of."
-msgstr ""
-
-#: bp-themes/bp-default/activity/index.php:63
-#: bp-themes/bp-default/groups/index.php:41
-msgid "My Groups <span>%s</span>"
+#: bp-themes/bp-default/activity/index.php:124
+msgid "New Members"
 msgstr ""
 
-#: bp-themes/bp-default/activity/index.php:73
-msgid "The activity I've marked as a favorite."
+#: bp-themes/bp-default/activity/post-form.php:23
+msgid "What's new in %s, %s?"
 msgstr ""
 
-#: bp-themes/bp-default/activity/index.php:73
-msgid "My Favorites <span>%s</span>"
+#: bp-themes/bp-default/activity/post-form.php:25
+msgid "What's new, %s?"
 msgstr ""
 
-#: bp-themes/bp-default/activity/index.php:79
-msgid "Activity that I have been mentioned in."
+#: bp-themes/bp-default/activity/post-form.php:35
+msgid "Post Update"
 msgstr ""
 
-#: bp-themes/bp-default/activity/index.php:79
-#: bp-activity/bp-activity-loader.php:148
-#: bp-activity/bp-activity-loader.php:228
-#: bp-activity/feeds/bp-activity-mentions-feed.php:27
-#: bp-activity/feeds/bp-activity-mentions-feed.php:30
-msgid "Mentions"
+#: bp-themes/bp-default/activity/post-form.php:42
+msgid "Post in"
 msgstr ""
 
-#: bp-themes/bp-default/activity/index.php:79
-msgid "<span>%s new</span>"
+#: bp-themes/bp-default/archive.php:10
+msgid "You are browsing the archive for %1$s."
 msgstr ""
 
-#: bp-themes/bp-default/activity/index.php:89
-#: bp-themes/bp-default/groups/single/activity.php:3
-msgid "RSS Feed"
+#: bp-themes/bp-default/archive.php:24 bp-themes/bp-default/attachment.php:18
+#: bp-themes/bp-default/index.php:24 bp-themes/bp-default/search.php:26
+#: bp-themes/bp-default/single.php:16
+msgctxt "Post written by..."
+msgid "by %s"
 msgstr ""
 
-#: bp-themes/bp-default/activity/index.php:89
-#: bp-themes/bp-default/groups/single/activity.php:3
-msgid "RSS"
+#: bp-themes/bp-default/archive.php:28 bp-themes/bp-default/attachment.php:22
+#: bp-themes/bp-default/index.php:32 bp-themes/bp-default/search.php:30
+msgid "Permanent Link to"
 msgstr ""
 
-#: bp-themes/bp-default/activity/index.php:126
-msgid "New Members"
+#: bp-themes/bp-default/archive.php:30 bp-themes/bp-default/index.php:34
+#: bp-themes/bp-default/search.php:32 bp-themes/bp-default/single.php:23
+msgid "%1$s <span>in %2$s</span>"
 msgstr ""
 
-#. translators: 1: user profile link, 2: user name, 3: activity permalink, 3:
-#. activity timestamp
-
-#: bp-themes/bp-default/activity/comment.php:27
-msgid "<a href=\"%1$s\">%2$s</a> replied <a href=\"%3$s\" class=\"activity-time-since\"><span class=\"time-since\">%4$s</span></a>"
+#: bp-themes/bp-default/archive.php:33 bp-themes/bp-default/index.php:37
+#: bp-themes/bp-default/search.php:35 bp-themes/bp-default/single.php:28
+msgid "Read the rest of this entry &rarr;"
 msgstr ""
 
-#: bp-themes/bp-default/activity/comment.php:37
-#: bp-themes/bp-default/groups/single/forum/edit.php:10
-msgid "Reply"
+#: bp-themes/bp-default/archive.php:34 bp-themes/bp-default/index.php:38
+#: bp-themes/bp-default/onecolumn-page.php:31 bp-themes/bp-default/page.php:20
+#: bp-themes/bp-default/single.php:30
+msgid "Pages: "
 msgstr ""
 
-#: bp-themes/bp-default/activity/post-form.php:23
-msgid "What's new in %s, %s?"
+#: bp-themes/bp-default/archive.php:37 bp-themes/bp-default/index.php:41
+#: bp-themes/bp-default/search.php:38 bp-themes/bp-default/single.php:33
+msgid "Tags: "
 msgstr ""
 
-#: bp-themes/bp-default/activity/post-form.php:25
-msgid "What's new, %s?"
+#: bp-themes/bp-default/archive.php:37 bp-themes/bp-default/index.php:41
+#: bp-themes/bp-default/search.php:38
+msgid "No Comments &#187;"
 msgstr ""
 
-#: bp-themes/bp-default/activity/post-form.php:35
-msgid "Post Update"
+#: bp-themes/bp-default/archive.php:37 bp-themes/bp-default/index.php:41
+#: bp-themes/bp-default/search.php:38
+msgid "1 Comment &#187;"
 msgstr ""
 
-#: bp-themes/bp-default/activity/post-form.php:42
-msgid "Post in"
+#: bp-themes/bp-default/archive.php:37 bp-themes/bp-default/index.php:41
+#: bp-themes/bp-default/search.php:38
+msgid "% Comments &#187;"
 msgstr ""
 
-#: bp-themes/bp-default/activity/entry.php:37
-msgid "In reply to: "
+#: bp-themes/bp-default/archive.php:50 bp-themes/bp-default/index.php:54
+msgid "Not Found"
 msgstr ""
 
-#: bp-themes/bp-default/activity/entry.php:37
-msgid "View Thread / Permalink"
+#: bp-themes/bp-default/attachment.php:26 bp-themes/bp-default/single.php:24
+msgid "Edit this entry"
 msgstr ""
 
-#: bp-themes/bp-default/activity/entry.php:60
-msgid "Comment <span>%s</span>"
+#: bp-themes/bp-default/attachment.php:40
+msgid "Full size is %s pixels"
 msgstr ""
 
-#: bp-themes/bp-default/activity/entry.php:68
-msgid "Mark as Favorite"
+#: bp-themes/bp-default/attachment.php:43
+msgid "Link to full size image"
 msgstr ""
 
-#: bp-themes/bp-default/activity/entry.php:104
-msgid "Post"
+#: bp-themes/bp-default/attachment.php:62
+msgid "Sorry, no attachments matched your criteria."
 msgstr ""
 
-#: bp-themes/bp-default/activity/entry.php:104
-msgid "or press esc to cancel."
+#: bp-themes/bp-default/blogs/blogs-loop.php:90
+msgid "Sorry, there were no sites found."
 msgstr ""
 
-#: bp-themes/bp-default/activity/activity-loop.php:41
-msgid "Load More"
+#: bp-themes/bp-default/blogs/create.php:21
+#: bp-themes/bp-default/blogs/index.php:21
+msgid "Site Directory"
 msgstr ""
 
-#: bp-themes/bp-default/activity/activity-loop.php:55
-msgid "Sorry, there was no activity found. Please try a different filter."
+#: bp-themes/bp-default/blogs/create.php:32
+msgid "Site registration is currently disabled"
 msgstr ""
 
-#: bp-themes/bp-default/blogs/index.php:35
+#: bp-themes/bp-default/blogs/index.php:33
 msgid "All Sites <span>%s</span>"
 msgstr ""
 
-#: bp-themes/bp-default/blogs/index.php:39
+#: bp-themes/bp-default/blogs/index.php:37
 msgid "My Sites <span>%s</span>"
 msgstr ""
 
-#: bp-themes/bp-default/blogs/blogs-loop.php:90
-msgid "Sorry, there were no sites found."
-msgstr ""
-
-#: bp-themes/bp-default/blogs/create.php:32
-msgid "Site registration is currently disabled"
+#: bp-themes/bp-default/blogs/index.php:53
+#: bp-themes/bp-default/forums/index.php:60
+#: bp-themes/bp-default/groups/index.php:55
+#: bp-themes/bp-default/groups/single/forum.php:36
+#: bp-themes/bp-default/members/index.php:53
+#: bp-themes/bp-default/members/single/blogs.php:19
+#: bp-themes/bp-default/members/single/forums.php:18
+#: bp-themes/bp-default/members/single/friends.php:20
+#: bp-themes/bp-default/members/single/groups.php:20
+#: bp-xprofile/bp-xprofile-classes.php:741
+msgid "Order By:"
 msgstr ""
 
-#: bp-themes/bp-default/forums/index.php:23
-msgid "Forums Directory"
+#: bp-themes/bp-default/blogs/index.php:55
+#: bp-themes/bp-default/forums/index.php:62
+#: bp-themes/bp-default/groups/index.php:57
+#: bp-themes/bp-default/groups/single/forum.php:38
+#: bp-themes/bp-default/members/index.php:55
+#: bp-themes/bp-default/members/single/blogs.php:21
+#: bp-themes/bp-default/members/single/forums.php:20
+#: bp-themes/bp-default/members/single/friends.php:22
+#: bp-themes/bp-default/members/single/groups.php:22
+msgid "Last Active"
 msgstr ""
 
-#: bp-themes/bp-default/forums/index.php:40
-msgid "All Topics <span>%s</span>"
+#: bp-themes/bp-default/blogs/index.php:57
+#: bp-themes/bp-default/groups/index.php:60
+#: bp-themes/bp-default/members/index.php:60
+#: bp-themes/bp-default/members/single/blogs.php:23
+#: bp-themes/bp-default/members/single/friends.php:24
+#: bp-themes/bp-default/members/single/groups.php:25
+msgid "Alphabetical"
 msgstr ""
 
-#: bp-themes/bp-default/forums/index.php:44
-msgid "My Topics <span>%s</span>"
+#: bp-themes/bp-default/comments.php:3
+msgid "Password Protected"
 msgstr ""
 
-#: bp-themes/bp-default/forums/index.php:100
-msgid "Create New Topic:"
+#: bp-themes/bp-default/comments.php:4
+msgid "Enter the password to view comments."
 msgstr ""
 
-#: bp-themes/bp-default/forums/index.php:107
-#: bp-themes/bp-default/groups/single/forum/edit.php:52
-#: bp-themes/bp-default/groups/single/forum.php:78
-msgid "Content:"
-msgstr ""
+#: bp-themes/bp-default/comments.php:24
+msgid "1 response to %2$s"
+msgid_plural "%1$s responses to %2$s"
+msgstr[0] ""
+msgstr[1] ""
 
-#: bp-themes/bp-default/forums/index.php:110
-#: bp-themes/bp-default/groups/single/forum/edit.php:55
-#: bp-themes/bp-default/groups/single/forum.php:81
-msgid "Tags (comma separated):"
+#: bp-themes/bp-default/comments.php:46
+msgid "Comments are closed, but <a href=\"%1$s\" title=\"Trackback URL for this post\">trackbacks</a> and pingbacks are open."
 msgstr ""
 
-#: bp-themes/bp-default/forums/index.php:113
-msgid "Post In Group Forum:"
+#: bp-themes/bp-default/comments.php:50
+msgid "Comments are closed."
 msgstr ""
 
-#: bp-themes/bp-default/forums/index.php:133
-#: bp-themes/bp-default/groups/single/forum.php:87
-msgid "Post Topic"
-msgstr ""
+#: bp-themes/bp-default/comments.php:62
+msgid "1 trackback"
+msgid_plural "%d trackbacks"
+msgstr[0] ""
+msgstr[1] ""
 
-#: bp-themes/bp-default/forums/index.php:145
-msgid "You are not a member of any groups so you don't have any group forums you can post in. To start posting, first find a group that matches the topic subject you'd like to start. If this group does not exist, why not <a href='%s'>create a new group</a>? Once you have joined or created the group you can post your topic in that group's forum."
+#: bp-themes/bp-default/footer.php:15
+msgid "Proudly powered by <a href=\"%1$s\">WordPress</a> and <a href=\"%2$s\">BuddyPress</a>."
 msgstr ""
 
 #: bp-themes/bp-default/forums/forums-loop.php:39
@@ -4367,617 +4346,1239 @@ msgstr ""
 msgid "Sorry, there were no forum topics found."
 msgstr ""
 
-#: bp-themes/bp-default/groups/index.php:23
-#: bp-themes/bp-default/groups/create.php:18
-msgid "Groups Directory"
+#: bp-themes/bp-default/forums/index.php:23
+msgid "Forums Directory"
 msgstr ""
 
-#: bp-themes/bp-default/groups/index.php:37
-msgid "All Groups <span>%s</span>"
+#: bp-themes/bp-default/forums/index.php:40
+msgid "All Topics <span>%s</span>"
 msgstr ""
 
-#: bp-themes/bp-default/groups/groups-loop.php:95
-msgid "There were no groups found."
+#: bp-themes/bp-default/forums/index.php:44
+msgid "My Topics <span>%s</span>"
 msgstr ""
 
-#: bp-themes/bp-default/groups/single/members.php:87
-#: bp-themes/bp-default/groups/single/admin.php:288
-msgid "This group has no members."
+#: bp-themes/bp-default/forums/index.php:63
+#: bp-themes/bp-default/groups/single/forum.php:39
+#: bp-themes/bp-default/members/single/forums.php:21
+msgid "Most Posts"
 msgstr ""
 
-#: bp-themes/bp-default/groups/single/forum/edit.php:16
-#: bp-themes/bp-default/groups/single/forum/topic.php:20
-#: bp-themes/bp-default/groups/single/forum.php:27
-msgid "Forum Directory"
+#: bp-themes/bp-default/forums/index.php:64
+#: bp-themes/bp-default/groups/single/forum.php:40
+#: bp-themes/bp-default/members/single/forums.php:22
+msgid "Unreplied"
 msgstr ""
 
-#: bp-themes/bp-default/groups/single/forum/edit.php:25
-msgid "Edit:"
+#: bp-themes/bp-default/forums/index.php:100
+msgid "Create New Topic:"
 msgstr ""
 
-#: bp-themes/bp-default/groups/single/forum/edit.php:91
-msgid "This topic does not exist."
+#: bp-themes/bp-default/forums/index.php:107
+#: bp-themes/bp-default/groups/single/forum/edit.php:50
+#: bp-themes/bp-default/groups/single/forum.php:78
+msgid "Content:"
 msgstr ""
 
-#: bp-themes/bp-default/groups/single/forum/topic.php:12
-msgid "New Reply"
+#: bp-themes/bp-default/forums/index.php:110
+#: bp-themes/bp-default/groups/single/forum/edit.php:53
+#: bp-themes/bp-default/groups/single/forum.php:81
+msgid "Tags (comma separated):"
 msgstr ""
 
-#: bp-themes/bp-default/groups/single/forum/topic.php:35
-msgid "Topic tags:"
+#: bp-themes/bp-default/forums/index.php:113
+msgid "Post In Group Forum:"
 msgstr ""
 
-#: bp-themes/bp-default/groups/single/forum/topic.php:81
-msgid "%1$s said %2$s:"
+#. translators: no option picked in select box
+
+#: bp-themes/bp-default/forums/index.php:116
+#: bp-xprofile/bp-xprofile-template.php:463
+msgid "----"
 msgstr ""
 
-#: bp-themes/bp-default/groups/single/forum/topic.php:95
-msgid "Permanent link to this post"
+#: bp-themes/bp-default/forums/index.php:133
+#: bp-themes/bp-default/groups/single/forum.php:87
+msgid "Post Topic"
 msgstr ""
 
-#: bp-themes/bp-default/groups/single/forum/topic.php:126
-msgid "You will auto join this group when you reply to this topic."
+#: bp-themes/bp-default/forums/index.php:145
+msgid "You are not a member of any groups so you don't have any group forums you can post in. To start posting, first find a group that matches the topic subject you'd like to start. If this group does not exist, why not <a href='%s'>create a new group</a>? Once you have joined or created the group you can post your topic in that group's forum."
 msgstr ""
 
-#: bp-themes/bp-default/groups/single/forum/topic.php:131
-msgid "Add a reply:"
+#: bp-themes/bp-default/functions.php:85
+msgid "Primary Navigation"
 msgstr ""
 
-#: bp-themes/bp-default/groups/single/forum/topic.php:136
-msgid "Post Reply"
+#: bp-themes/bp-default/functions.php:158
+msgid "My Favorites"
 msgstr ""
 
-#: bp-themes/bp-default/groups/single/forum/topic.php:147
-msgid "This topic is closed, replies are no longer accepted."
+#: bp-themes/bp-default/functions.php:159
+msgid "Accepted"
 msgstr ""
 
-#: bp-themes/bp-default/groups/single/forum/topic.php:161
-msgid "There are no posts for this topic."
+#: bp-themes/bp-default/functions.php:160
+msgid "Rejected"
 msgstr ""
 
-#: bp-themes/bp-default/groups/single/request-membership.php:4
-msgid "You are requesting to become a member of the group '%s'."
+#: bp-themes/bp-default/functions.php:161
+msgid "Show all comments for this thread"
 msgstr ""
 
-#: bp-themes/bp-default/groups/single/request-membership.php:7
-msgid "Comments (optional)"
+#: bp-themes/bp-default/functions.php:162
+msgid "Show all"
 msgstr ""
 
-#: bp-themes/bp-default/groups/single/request-membership.php:12
-msgid "Send Request"
+#: bp-themes/bp-default/functions.php:163
+msgid "comments"
 msgstr ""
 
-#: bp-themes/bp-default/groups/single/send-invites.php:22
-#: bp-themes/bp-default/groups/create.php:216
-msgid "Select people to invite from your friends list."
+#: bp-themes/bp-default/functions.php:389
+msgid "The sidebar widget area"
 msgstr ""
 
-#: bp-themes/bp-default/groups/single/send-invites.php:73
-#: bp-themes/bp-default/groups/create.php:251
-msgid "Once you have built up friend connections you will be able to invite others to your group. You can send invites any time in the future by selecting the \"Send Invites\" option when viewing your new group."
+#: bp-themes/bp-default/functions.php:398
+msgid "First Footer Widget Area"
 msgstr ""
 
-#: bp-themes/bp-default/groups/single/forum.php:69
-msgid "You will auto join this group when you start a new topic."
+#: bp-themes/bp-default/functions.php:400
+msgid "The first footer widget area"
 msgstr ""
 
-#: bp-themes/bp-default/groups/single/forum.php:73
-msgid "Post a New Topic:"
+#: bp-themes/bp-default/functions.php:409
+msgid "Second Footer Widget Area"
 msgstr ""
 
-#: bp-themes/bp-default/groups/single/group-header.php:11
-msgid "Group Admins"
+#: bp-themes/bp-default/functions.php:411
+msgid "The second footer widget area"
 msgstr ""
 
-#: bp-themes/bp-default/groups/single/group-header.php:20
-msgid "Group Mods"
+#: bp-themes/bp-default/functions.php:420
+msgid "Third Footer Widget Area"
 msgstr ""
 
-#: bp-themes/bp-default/groups/single/admin.php:16
-#: bp-themes/bp-default/groups/create.php:39
-msgid "Group Name (required)"
+#: bp-themes/bp-default/functions.php:422
+msgid "The third footer widget area"
 msgstr ""
 
-#: bp-themes/bp-default/groups/single/admin.php:19
-#: bp-themes/bp-default/groups/create.php:42
-msgid "Group Description (required)"
+#: bp-themes/bp-default/functions.php:431
+msgid "Fourth Footer Widget Area"
 msgstr ""
 
-#: bp-themes/bp-default/groups/single/admin.php:25
-msgid "Notify group members of changes via email"
+#: bp-themes/bp-default/functions.php:433
+msgid "The fourth footer widget area"
 msgstr ""
 
-#: bp-themes/bp-default/groups/single/admin.php:47
-#: bp-themes/bp-default/groups/create.php:62
-msgid "Enable discussion forum"
+#. translators: 1: comment author url, 2: comment author name, 3: comment
+#. permalink, 4: comment date/timestamp
+
+#: bp-themes/bp-default/functions.php:488
+msgid "<a href=\"%1$s\" rel=\"nofollow\">%2$s</a> said on <a href=\"%3$s\"><span class=\"time-since\">%4$s</span></a>"
+msgstr ""
+
+#: bp-themes/bp-default/functions.php:495
+msgid "Your comment is awaiting moderation."
+msgstr ""
+
+#: bp-themes/bp-default/functions.php:507
+msgid "Edit comment"
+msgstr ""
+
+#: bp-themes/bp-default/functions.php:577
+msgid "Theme activated! This theme contains <a href=\"%s\">custom header image</a> support and <a href=\"%s\">sidebar widgets</a>."
+msgstr ""
+
+#: bp-themes/bp-default/functions.php:643
+msgid "Email"
+msgstr ""
+
+#: bp-themes/bp-default/functions.php:653
+msgid "You must be <a href=\"%1$s\">logged in</a> to post a comment."
+msgstr ""
+
+#: bp-themes/bp-default/functions.php:654
+msgid "Leave a reply"
+msgstr ""
+
+#: bp-themes/bp-default/functions.php:741
+msgid "&larr; Previous Entries"
+msgstr ""
+
+#: bp-themes/bp-default/functions.php:742
+msgid "Next Entries &rarr;"
+msgstr ""
+
+#: bp-themes/bp-default/groups/create.php:18
+#: bp-themes/bp-default/groups/index.php:21
+msgid "Groups Directory"
+msgstr ""
+
+#: bp-themes/bp-default/groups/create.php:39
+#: bp-themes/bp-default/groups/single/admin.php:16
+msgid "Group Name (required)"
+msgstr ""
+
+#: bp-themes/bp-default/groups/create.php:42
+#: bp-themes/bp-default/groups/single/admin.php:19
+msgid "Group Description (required)"
 msgstr ""
 
+#: bp-themes/bp-default/groups/create.php:58
 #: bp-themes/bp-default/groups/single/admin.php:56
-#: bp-themes/bp-default/groups/create.php:78
 msgid "Privacy Options"
 msgstr ""
 
+#: bp-themes/bp-default/groups/create.php:62
 #: bp-themes/bp-default/groups/single/admin.php:61
-#: bp-themes/bp-default/groups/create.php:82
 msgid "This is a public group"
 msgstr ""
 
+#: bp-themes/bp-default/groups/create.php:64
 #: bp-themes/bp-default/groups/single/admin.php:63
-#: bp-themes/bp-default/groups/create.php:84
 msgid "Any site member can join this group."
 msgstr ""
 
+#: bp-themes/bp-default/groups/create.php:65
+#: bp-themes/bp-default/groups/create.php:74
 #: bp-themes/bp-default/groups/single/admin.php:64
 #: bp-themes/bp-default/groups/single/admin.php:74
-#: bp-themes/bp-default/groups/create.php:85
-#: bp-themes/bp-default/groups/create.php:94
 msgid "This group will be listed in the groups directory and in search results."
 msgstr ""
 
+#: bp-themes/bp-default/groups/create.php:66
 #: bp-themes/bp-default/groups/single/admin.php:65
-#: bp-themes/bp-default/groups/create.php:86
 msgid "Group content and activity will be visible to any site member."
 msgstr ""
 
+#: bp-themes/bp-default/groups/create.php:71
 #: bp-themes/bp-default/groups/single/admin.php:71
-#: bp-themes/bp-default/groups/create.php:91
 msgid "This is a private group"
 msgstr ""
 
+#: bp-themes/bp-default/groups/create.php:73
 #: bp-themes/bp-default/groups/single/admin.php:73
-#: bp-themes/bp-default/groups/create.php:93
 msgid "Only users who request membership and are accepted can join the group."
 msgstr ""
 
+#: bp-themes/bp-default/groups/create.php:75
+#: bp-themes/bp-default/groups/create.php:84
 #: bp-themes/bp-default/groups/single/admin.php:75
 #: bp-themes/bp-default/groups/single/admin.php:85
-#: bp-themes/bp-default/groups/create.php:95
-#: bp-themes/bp-default/groups/create.php:104
 msgid "Group content and activity will only be visible to members of the group."
 msgstr ""
 
-#: bp-themes/bp-default/groups/single/admin.php:81
-#: bp-themes/bp-default/groups/create.php:100
-msgid "This is a hidden group"
+#: bp-themes/bp-default/groups/create.php:80
+#: bp-themes/bp-default/groups/single/admin.php:81
+msgid "This is a hidden group"
+msgstr ""
+
+#: bp-themes/bp-default/groups/create.php:82
+#: bp-themes/bp-default/groups/single/admin.php:83
+msgid "Only users who are invited can join the group."
+msgstr ""
+
+#: bp-themes/bp-default/groups/create.php:83
+#: bp-themes/bp-default/groups/single/admin.php:84
+msgid "This group will not be listed in the groups directory or search results."
+msgstr ""
+
+#: bp-themes/bp-default/groups/create.php:89
+#: bp-themes/bp-default/groups/single/admin.php:92
+msgid "Group Invitations"
+msgstr ""
+
+#: bp-themes/bp-default/groups/create.php:91
+#: bp-themes/bp-default/groups/single/admin.php:94
+msgid "Which members of this group are allowed to invite others?"
+msgstr ""
+
+#: bp-themes/bp-default/groups/create.php:96
+#: bp-themes/bp-default/groups/single/admin.php:99
+msgid "All group members"
+msgstr ""
+
+#: bp-themes/bp-default/groups/create.php:101
+#: bp-themes/bp-default/groups/single/admin.php:104
+msgid "Group admins and mods only"
+msgstr ""
+
+#: bp-themes/bp-default/groups/create.php:106
+#: bp-themes/bp-default/groups/single/admin.php:109
+msgid "Group admins only"
+msgstr ""
+
+#: bp-themes/bp-default/groups/create.php:112
+msgid "Group Forums"
+msgstr ""
+
+#: bp-themes/bp-default/groups/create.php:116
+msgid "Should this group have a forum?"
+msgstr ""
+
+#: bp-themes/bp-default/groups/create.php:119
+#: bp-themes/bp-default/groups/single/admin.php:47
+msgid "Enable discussion forum"
+msgstr ""
+
+#: bp-themes/bp-default/groups/create.php:123
+msgid "<strong>Attention Site Admin:</strong> Group forums require the <a href=\"%s\">correct setup and configuration</a> of a bbPress installation."
+msgstr ""
+
+#: bp-themes/bp-default/groups/create.php:149
+#: bp-themes/bp-default/groups/single/admin.php:127
+msgid "Upload an image to use as an avatar for this group. The image will be shown on the main group page, and in search results."
+msgstr ""
+
+#: bp-themes/bp-default/groups/create.php:153
+#: bp-themes/bp-default/groups/single/admin.php:131
+#: bp-themes/bp-default/members/single/profile/change-avatar.php:18
+msgid "Upload Image"
+msgstr ""
+
+#: bp-themes/bp-default/groups/create.php:157
+msgid "To skip the avatar upload process, hit the \"Next Step\" button."
+msgstr ""
+
+#: bp-themes/bp-default/groups/create.php:164
+msgid "Crop Group Avatar"
+msgstr ""
+
+#: bp-themes/bp-default/groups/create.php:166
+#: bp-themes/bp-default/groups/single/admin.php:151
+#: bp-themes/bp-default/members/single/profile/change-avatar.php:33
+msgid "Avatar to crop"
+msgstr ""
+
+#: bp-themes/bp-default/groups/create.php:169
+#: bp-themes/bp-default/groups/single/admin.php:154
+#: bp-themes/bp-default/members/single/profile/change-avatar.php:36
+msgid "Avatar preview"
+msgstr ""
+
+#: bp-themes/bp-default/groups/create.php:172
+#: bp-themes/bp-default/groups/single/admin.php:157
+#: bp-themes/bp-default/members/single/profile/change-avatar.php:39
+msgid "Crop Image"
+msgstr ""
+
+#: bp-themes/bp-default/groups/create.php:211
+#: bp-themes/bp-default/groups/single/send-invites.php:22
+msgid "Select people to invite from your friends list."
+msgstr ""
+
+#: bp-themes/bp-default/groups/create.php:246
+#: bp-themes/bp-default/groups/single/send-invites.php:73
+msgid "Once you have built up friend connections you will be able to invite others to your group. You can send invites any time in the future by selecting the \"Send Invites\" option when viewing your new group."
+msgstr ""
+
+#: bp-themes/bp-default/groups/create.php:268
+msgid "Back to Previous Step"
+msgstr ""
+
+#: bp-themes/bp-default/groups/create.php:275
+msgid "Next Step"
+msgstr ""
+
+#: bp-themes/bp-default/groups/create.php:282
+msgid "Create Group and Continue"
+msgstr ""
+
+#: bp-themes/bp-default/groups/groups-loop.php:95
+msgid "There were no groups found."
+msgstr ""
+
+#: bp-themes/bp-default/groups/index.php:35
+msgid "All Groups <span>%s</span>"
+msgstr ""
+
+#: bp-themes/bp-default/groups/index.php:58
+#: bp-themes/bp-default/members/single/groups.php:23
+msgid "Most Members"
+msgstr ""
+
+#: bp-themes/bp-default/groups/index.php:59
+#: bp-themes/bp-default/members/single/groups.php:24
+msgid "Newly Created"
+msgstr ""
+
+#: bp-themes/bp-default/groups/single/admin.php:25
+msgid "Notify group members of changes via email"
+msgstr ""
+
+#: bp-themes/bp-default/groups/single/admin.php:137
+msgid "If you'd like to remove the existing avatar but not upload a new one, please use the delete avatar button."
+msgstr ""
+
+#: bp-themes/bp-default/groups/single/admin.php:139
+#: bp-themes/bp-default/members/single/profile/change-avatar.php:24
+msgid "Delete Avatar"
+msgstr ""
+
+#: bp-themes/bp-default/groups/single/admin.php:149
+msgid "Crop Avatar"
+msgstr ""
+
+#: bp-themes/bp-default/groups/single/admin.php:177
+msgid "Administrators"
+msgstr ""
+
+#: bp-themes/bp-default/groups/single/admin.php:205
+msgid "Moderators"
+msgstr ""
+
+#: bp-themes/bp-default/groups/single/admin.php:260
+msgid "(banned)"
+msgstr ""
+
+#: bp-themes/bp-default/groups/single/admin.php:266
+msgid "Unban this member"
+msgstr ""
+
+#: bp-themes/bp-default/groups/single/admin.php:266
+msgid "Remove Ban"
+msgstr ""
+
+#: bp-themes/bp-default/groups/single/admin.php:270
+msgid "Kick and ban this member"
+msgstr ""
+
+#: bp-themes/bp-default/groups/single/admin.php:270
+msgid "Kick &amp; Ban"
+msgstr ""
+
+#: bp-themes/bp-default/groups/single/admin.php:271
+msgid "Promote to Mod"
+msgstr ""
+
+#: bp-themes/bp-default/groups/single/admin.php:276
+msgid "Remove this member"
+msgstr ""
+
+#: bp-themes/bp-default/groups/single/admin.php:276
+msgid "Remove from group"
+msgstr ""
+
+#: bp-themes/bp-default/groups/single/admin.php:290
+#: bp-themes/bp-default/groups/single/members.php:87
+msgid "This group has no members."
+msgstr ""
+
+#: bp-themes/bp-default/groups/single/admin.php:320
+#: bp-themes/bp-default/members/single/friends/requests.php:37
+#: bp-themes/bp-default/members/single/groups/invites.php:23
+msgid "Accept"
+msgstr ""
+
+#: bp-themes/bp-default/groups/single/admin.php:322
+#: bp-themes/bp-default/members/single/friends/requests.php:38
+#: bp-themes/bp-default/members/single/groups/invites.php:24
+msgid "Reject"
+msgstr ""
+
+#: bp-themes/bp-default/groups/single/admin.php:335
+msgid "There are no pending membership requests."
+msgstr ""
+
+#: bp-themes/bp-default/groups/single/admin.php:352
+msgid "WARNING: Deleting this group will completely remove ALL content associated with it. There is no way back, please be careful with this option."
+msgstr ""
+
+#: bp-themes/bp-default/groups/single/admin.php:355
+msgid "I understand the consequences of deleting this group."
+msgstr ""
+
+#: bp-themes/bp-default/groups/single/forum/edit.php:16
+#: bp-themes/bp-default/groups/single/forum/topic.php:17
+#: bp-themes/bp-default/groups/single/forum.php:27
+msgid "Forum Directory"
+msgstr ""
+
+#: bp-themes/bp-default/groups/single/forum/edit.php:25
+msgid "Edit:"
+msgstr ""
+
+#: bp-themes/bp-default/groups/single/forum/edit.php:87
+msgid "This topic does not exist."
+msgstr ""
+
+#: bp-themes/bp-default/groups/single/forum/topic.php:9
+msgid "New Reply"
+msgstr ""
+
+#: bp-themes/bp-default/groups/single/forum/topic.php:32
+msgid "Topic tags:"
+msgstr ""
+
+#: bp-themes/bp-default/groups/single/forum/topic.php:81
+msgid "%1$s said %2$s:"
+msgstr ""
+
+#: bp-themes/bp-default/groups/single/forum/topic.php:95
+msgid "Permanent link to this post"
+msgstr ""
+
+#: bp-themes/bp-default/groups/single/forum/topic.php:119
+msgid "There are no posts for this topic."
+msgstr ""
+
+#: bp-themes/bp-default/groups/single/forum/topic.php:134
+msgid "You will auto join this group when you reply to this topic."
+msgstr ""
+
+#: bp-themes/bp-default/groups/single/forum/topic.php:139
+msgid "Add a reply:"
+msgstr ""
+
+#: bp-themes/bp-default/groups/single/forum/topic.php:144
+msgid "Post Reply"
+msgstr ""
+
+#: bp-themes/bp-default/groups/single/forum/topic.php:155
+msgid "This topic is closed, replies are no longer accepted."
+msgstr ""
+
+#: bp-themes/bp-default/groups/single/forum.php:69
+msgid "You will auto join this group when you start a new topic."
+msgstr ""
+
+#: bp-themes/bp-default/groups/single/forum.php:73
+msgid "Post a New Topic:"
+msgstr ""
+
+#: bp-themes/bp-default/groups/single/group-header.php:11
+msgid "Group Admins"
+msgstr ""
+
+#: bp-themes/bp-default/groups/single/group-header.php:20
+msgid "Group Mods"
+msgstr ""
+
+#: bp-themes/bp-default/groups/single/request-membership.php:4
+msgid "You are requesting to become a member of the group '%s'."
+msgstr ""
+
+#: bp-themes/bp-default/groups/single/request-membership.php:7
+msgid "Comments (optional)"
+msgstr ""
+
+#: bp-themes/bp-default/groups/single/request-membership.php:12
+msgid "Send Request"
+msgstr ""
+
+#: bp-themes/bp-default/header.php:22
+msgctxt "Home page banner link title"
+msgid "Home"
+msgstr ""
+
+#: bp-themes/bp-default/header.php:25
+msgid "Search for:"
+msgstr ""
+
+#: bp-themes/bp-default/index.php:27
+msgctxt "Sticky post"
+msgid "Featured"
+msgstr ""
+
+#: bp-themes/bp-default/index.php:55
+msgid "Sorry, but you are looking for something that isn't here."
+msgstr ""
+
+#: bp-themes/bp-default/links.php:16
+msgid "Links"
+msgstr ""
+
+#: bp-themes/bp-default/members/index.php:21
+msgid "Members Directory"
+msgstr ""
+
+#: bp-themes/bp-default/members/index.php:56
+#: bp-themes/bp-default/members/single/friends.php:23
+msgid "Newest Registered"
+msgstr ""
+
+#: bp-themes/bp-default/members/members-loop.php:108
+msgid "Sorry, no members were found."
+msgstr ""
+
+#: bp-themes/bp-default/members/single/friends/requests.php:68
+msgid "You have no pending friendship requests."
+msgstr ""
+
+#: bp-themes/bp-default/members/single/groups/invites.php:37
+msgid "You have no outstanding group invites."
+msgstr ""
+
+#: bp-themes/bp-default/members/single/messages/compose.php:5
+msgid "Send To (Username or Friend's Name)"
+msgstr ""
+
+#: bp-themes/bp-default/members/single/messages/compose.php:14
+msgid "This is a notice to all users."
+msgstr ""
+
+#: bp-themes/bp-default/members/single/messages/compose.php:17
+msgid "Subject"
+msgstr ""
+
+#: bp-themes/bp-default/members/single/messages/compose.php:20
+msgid "Message"
+msgstr ""
+
+#: bp-themes/bp-default/members/single/messages/compose.php:28
+msgid "Send Message"
+msgstr ""
+
+#: bp-themes/bp-default/members/single/messages/messages-loop.php:32
+msgid "From:"
+msgstr ""
+
+#: bp-themes/bp-default/members/single/messages/messages-loop.php:37
+msgid "To:"
+msgstr ""
+
+#: bp-themes/bp-default/members/single/messages/messages-loop.php:43
+msgid "View Message"
+msgstr ""
+
+#: bp-themes/bp-default/members/single/messages/messages-loop.php:51
+#: bp-themes/bp-default/members/single/messages/notices-loop.php:43
+#: bp-themes/bp-default/members/single/messages/single.php:24
+msgid "Delete Message"
+msgstr ""
+
+#: bp-themes/bp-default/members/single/messages/messages-loop.php:69
+msgid "Sorry, no messages were found."
+msgstr ""
+
+#: bp-themes/bp-default/members/single/messages/notices-loop.php:36
+msgid "Sent:"
+msgstr ""
+
+#: bp-themes/bp-default/members/single/messages/notices-loop.php:54
+msgid "Sorry, no notices were found."
+msgstr ""
+
+#: bp-themes/bp-default/members/single/messages/single.php:14
+msgid "You are alone in this conversation."
+msgstr ""
+
+#: bp-themes/bp-default/members/single/messages/single.php:18
+msgid "Conversation between %s and you."
+msgstr ""
+
+#: bp-themes/bp-default/members/single/messages/single.php:75
+msgid "Send a Reply"
+msgstr ""
+
+#: bp-themes/bp-default/members/single/messages/single.php:91
+msgid "Send Reply"
+msgstr ""
+
+#: bp-themes/bp-default/members/single/profile/change-avatar.php:1
+#: bp-xprofile/bp-xprofile-loader.php:182
+#: bp-xprofile/bp-xprofile-loader.php:238
+msgid "Change Avatar"
+msgstr ""
+
+#: bp-themes/bp-default/members/single/profile/change-avatar.php:7
+msgid "Your avatar will be used on your profile and throughout the site. If there is a <a href=\"http://gravatar.com\">Gravatar</a> associated with your account email we will use that, or you can upload an image from your computer."
+msgstr ""
+
+#: bp-themes/bp-default/members/single/profile/change-avatar.php:14
+msgid "Click below to select a JPG, GIF or PNG format photo from your computer and then click 'Upload Image' to proceed."
+msgstr ""
+
+#: bp-themes/bp-default/members/single/profile/change-avatar.php:23
+msgid "If you'd like to delete your current avatar but not upload a new one, please use the delete avatar button."
+msgstr ""
+
+#: bp-themes/bp-default/members/single/profile/change-avatar.php:24
+msgid "Delete My Avatar"
+msgstr ""
+
+#: bp-themes/bp-default/members/single/profile/change-avatar.php:31
+msgid "Crop Your New Avatar"
+msgstr ""
+
+#: bp-themes/bp-default/members/single/profile/change-avatar.php:55
+msgid "Your avatar will be used on your profile and throughout the site. To change your avatar, please create an account with <a href=\"http://gravatar.com\">Gravatar</a> using the same email address as you used to register with this site."
+msgstr ""
+
+#: bp-themes/bp-default/members/single/profile/edit.php:10
+msgid "Editing '%s' Profile Group"
+msgstr ""
+
+#: bp-themes/bp-default/members/single/profile/edit.php:26
+#: bp-themes/bp-default/members/single/profile/edit.php:33
+#: bp-themes/bp-default/members/single/profile/edit.php:40
+#: bp-themes/bp-default/members/single/profile/edit.php:49
+#: bp-themes/bp-default/members/single/profile/edit.php:67
+#: bp-themes/bp-default/members/single/profile/edit.php:83
+#: bp-themes/bp-default/members/single/profile/edit.php:93
+#: bp-themes/bp-default/registration/register.php:37
+#: bp-themes/bp-default/registration/register.php:41
+#: bp-themes/bp-default/registration/register.php:45
+#: bp-themes/bp-default/registration/register.php:49
+#: bp-themes/bp-default/registration/register.php:76
+#: bp-themes/bp-default/registration/register.php:84
+#: bp-themes/bp-default/registration/register.php:92
+#: bp-themes/bp-default/registration/register.php:102
+#: bp-themes/bp-default/registration/register.php:113
+#: bp-themes/bp-default/registration/register.php:128
+#: bp-themes/bp-default/registration/register.php:139
+#: bp-themes/bp-default/registration/register.php:211
+#: bp-themes/bp-default/registration/register.php:220
+msgid "(required)"
+msgstr ""
+
+#: bp-themes/bp-default/members/single/profile/edit.php:58
+#: bp-themes/bp-default/members/single/profile/edit.php:73
+#: bp-themes/bp-default/registration/register.php:119
+#: bp-xprofile/bp-xprofile-admin.php:415
+msgid "Clear"
+msgstr ""
+
+#: bp-themes/bp-default/members/single/profile/edit.php:118
+#: bp-themes/bp-default/members/single/profile/edit.php:132
+#: bp-themes/bp-default/registration/register.php:159
+#: bp-themes/bp-default/registration/register.php:174
+msgid "This field can be seen by: <span class=\"current-visibility-level\">%s</span>"
+msgstr ""
+
+#: bp-themes/bp-default/members/single/profile/edit.php:118
+msgid "Change"
+msgstr ""
+
+#: bp-themes/bp-default/members/single/profile/edit.php:123
+#: bp-themes/bp-default/registration/register.php:164
+msgid "Who can see this field?"
+msgstr ""
+
+#: bp-themes/bp-default/members/single/profile/profile-wp.php:8
+msgid "%s's Profile"
+msgstr ""
+
+#: bp-themes/bp-default/members/single/settings/capabilities.php:57
+msgid "This user is a spammer."
+msgstr ""
+
+#: bp-themes/bp-default/members/single/settings/delete-account.php:56
+msgid "Deleting your account will delete all of the content you have created. It will be completely irrecoverable."
+msgstr ""
+
+#: bp-themes/bp-default/members/single/settings/delete-account.php:60
+msgid "Deleting this account will delete all of the content it has created. It will be completely irrecoverable."
+msgstr ""
+
+#: bp-themes/bp-default/members/single/settings/delete-account.php:72
+msgid "I understand the consequences."
+msgstr ""
+
+#: bp-themes/bp-default/members/single/settings/general.php:49
+msgid "General Settings"
+msgstr ""
+
+#: bp-themes/bp-default/members/single/settings/general.php:57
+msgid "Current Password <span>(required to update email or change current password)</span>"
+msgstr ""
+
+#: bp-themes/bp-default/members/single/settings/general.php:58
+msgid "Password Lost and Found"
+msgstr ""
+
+#: bp-themes/bp-default/members/single/settings/general.php:58
+msgid "Lost your password?"
+msgstr ""
+
+#: bp-themes/bp-default/members/single/settings/general.php:62
+msgid "Account Email"
+msgstr ""
+
+#: bp-themes/bp-default/members/single/settings/general.php:65
+msgid "Change Password <span>(leave blank for no change)</span>"
+msgstr ""
+
+#: bp-themes/bp-default/members/single/settings/general.php:66
+msgid "New Password"
+msgstr ""
+
+#: bp-themes/bp-default/members/single/settings/general.php:67
+msgid "Repeat New Password"
+msgstr ""
+
+#: bp-themes/bp-default/members/single/settings/notifications.php:49
+msgid "Email Notification"
+msgstr ""
+
+#: bp-themes/bp-default/members/single/settings/notifications.php:54
+msgid "Send a notification by email when:"
+msgstr ""
+
+#: bp-themes/bp-default/onecolumn-page.php:29 bp-themes/bp-default/page.php:18
+msgid "<p class=\"serif\">Read the rest of this page &rarr;</p>"
+msgstr ""
+
+#: bp-themes/bp-default/onecolumn-page.php:32 bp-themes/bp-default/page.php:21
+msgid "Edit this page."
+msgstr ""
+
+#: bp-themes/bp-default/registration/activate.php:12
+msgid "Account Activated"
+msgstr ""
+
+#: bp-themes/bp-default/registration/activate.php:17
+msgid "Your account was activated successfully! Your account details have been sent to you in a separate email."
+msgstr ""
+
+#: bp-themes/bp-default/registration/activate.php:19
+msgid "Your account was activated successfully! You can now log in with the username and password you provided when you signed up."
+msgstr ""
+
+#: bp-themes/bp-default/registration/activate.php:28
+msgid "Please provide a valid activation key."
+msgstr ""
+
+#: bp-themes/bp-default/registration/activate.php:32
+msgid "Activation Key:"
+msgstr ""
+
+#: bp-themes/bp-default/registration/register.php:16
+msgid "User registration is currently not allowed."
+msgstr ""
+
+#: bp-themes/bp-default/registration/register.php:27
+msgid "Registering for this site is easy, just fill in the fields below and we'll get a new account set up for you in no time."
+msgstr ""
+
+#: bp-themes/bp-default/registration/register.php:35
+msgid "Account Details"
+msgstr ""
+
+#: bp-themes/bp-default/registration/register.php:37
+#: bp-themes/bp-default/sidebar.php:44
+msgid "Username"
+msgstr ""
+
+#: bp-themes/bp-default/registration/register.php:41
+msgid "Email Address"
+msgstr ""
+
+#: bp-themes/bp-default/registration/register.php:45
+msgid "Choose a Password"
+msgstr ""
+
+#: bp-themes/bp-default/registration/register.php:49
+msgid "Confirm Password"
+msgstr ""
+
+#: bp-themes/bp-default/registration/register.php:65
+msgid "Profile Details"
+msgstr ""
+
+#: bp-themes/bp-default/registration/register.php:205
+msgid "Blog Details"
 msgstr ""
 
-#: bp-themes/bp-default/groups/single/admin.php:83
-#: bp-themes/bp-default/groups/create.php:102
-msgid "Only users who are invited can join the group."
+#: bp-themes/bp-default/registration/register.php:207
+msgid "Yes, I'd like to create a new site"
 msgstr ""
 
-#: bp-themes/bp-default/groups/single/admin.php:84
-#: bp-themes/bp-default/groups/create.php:103
-msgid "This group will not be listed in the groups directory or search results."
+#: bp-themes/bp-default/registration/register.php:211
+msgid "Blog URL"
 msgstr ""
 
-#: bp-themes/bp-default/groups/single/admin.php:92
-#: bp-themes/bp-default/groups/create.php:111
-msgid "Group Invitations"
+#: bp-themes/bp-default/registration/register.php:220
+msgid "Site Title"
 msgstr ""
 
-#: bp-themes/bp-default/groups/single/admin.php:94
-#: bp-themes/bp-default/groups/create.php:113
-msgid "Which members of this group are allowed to invite others?"
+#: bp-themes/bp-default/registration/register.php:241
+msgid "Complete Sign Up"
 msgstr ""
 
-#: bp-themes/bp-default/groups/single/admin.php:99
-#: bp-themes/bp-default/groups/create.php:118
-msgid "All group members"
+#: bp-themes/bp-default/registration/register.php:252
+msgid "Sign Up Complete!"
 msgstr ""
 
-#: bp-themes/bp-default/groups/single/admin.php:104
-#: bp-themes/bp-default/groups/create.php:123
-msgid "Group admins and mods only"
+#: bp-themes/bp-default/registration/register.php:258
+msgid "You have successfully created your account! To begin using this site you will need to activate your account via the email we have just sent to your address."
 msgstr ""
 
-#: bp-themes/bp-default/groups/single/admin.php:109
-#: bp-themes/bp-default/groups/create.php:128
-msgid "Group admins only"
+#: bp-themes/bp-default/registration/register.php:260
+msgid "You have successfully created your account! Please log in using the username and password you have just created."
 msgstr ""
 
-#: bp-themes/bp-default/groups/single/admin.php:127
-#: bp-themes/bp-default/groups/create.php:154
-msgid "Upload an image to use as an avatar for this group. The image will be shown on the main group page, and in search results."
+#: bp-themes/bp-default/search.php:10
+msgid "Site"
 msgstr ""
 
-#: bp-themes/bp-default/groups/single/admin.php:137
-msgid "If you'd like to remove the existing avatar but not upload a new one, please use the delete avatar button."
+#: bp-themes/bp-default/search.php:14
+msgid "Search Results"
 msgstr ""
 
-#: bp-themes/bp-default/groups/single/admin.php:149
-msgid "Crop Avatar"
+#: bp-themes/bp-default/search.php:51
+msgid "No posts found. Try a different search?"
 msgstr ""
 
-#: bp-themes/bp-default/groups/single/admin.php:177
-msgid "Administrators"
+#: bp-themes/bp-default/sidebar.php:37
+msgid "Please <a href=\"%s\" title=\"Create an account\">create an account</a> to get started."
 msgstr ""
 
-#: bp-themes/bp-default/groups/single/admin.php:203
-msgid "Moderators"
+#: bp-themes/bp-default/sidebar.php:47
+msgid "Password"
 msgstr ""
 
-#: bp-themes/bp-default/groups/single/admin.php:258
-msgid "(banned)"
+#: bp-themes/bp-default/sidebar.php:50
+msgid "Remember Me"
 msgstr ""
 
-#: bp-themes/bp-default/groups/single/admin.php:264
-msgid "Unban this member"
+#: bp-themes/bp-default/sidebar.php:64
+msgid "Forum Topic Tags"
 msgstr ""
 
-#: bp-themes/bp-default/groups/single/admin.php:264
-msgid "Remove Ban"
+#: bp-themes/bp-default/single.php:35
+msgctxt "Previous post link"
+msgid "&larr;"
 msgstr ""
 
-#: bp-themes/bp-default/groups/single/admin.php:268
-msgid "Kick and ban this member"
+#: bp-themes/bp-default/single.php:36
+msgctxt "Next post link"
+msgid "&rarr;"
 msgstr ""
 
-#: bp-themes/bp-default/groups/single/admin.php:268
-msgid "Kick &amp; Ban"
+#: bp-themes/bp-default/single.php:45
+msgid "Sorry, no posts matched your criteria."
 msgstr ""
 
-#: bp-themes/bp-default/groups/single/admin.php:269
-msgid "Promote to Mod"
+#: bp-xprofile/bp-xprofile-activity.php:20
+msgid "Member changed profile picture"
 msgstr ""
 
-#: bp-themes/bp-default/groups/single/admin.php:274
-msgid "Remove this member"
+#: bp-xprofile/bp-xprofile-activity.php:21
+msgid "New member registered"
 msgstr ""
 
-#: bp-themes/bp-default/groups/single/admin.php:274
-msgid "Remove from group"
+#: bp-xprofile/bp-xprofile-activity.php:22
+msgid "Updated Profile"
 msgstr ""
 
-#: bp-themes/bp-default/groups/single/admin.php:333
-msgid "There are no pending membership requests."
+#: bp-xprofile/bp-xprofile-activity.php:129
+msgid "%s changed their profile picture"
 msgstr ""
 
-#: bp-themes/bp-default/groups/single/admin.php:350
-msgid "WARNING: Deleting this group will completely remove ALL content associated with it. There is no way back, please be careful with this option."
+#: bp-xprofile/bp-xprofile-admin.php:27 bp-xprofile/bp-xprofile-admin.php:71
+msgid "Profile Fields"
 msgstr ""
 
-#: bp-themes/bp-default/groups/single/admin.php:353
-msgid "I understand the consequences of deleting this group."
+#: bp-xprofile/bp-xprofile-admin.php:72 bp-xprofile/bp-xprofile-classes.php:357
+msgid "Add New Field Group"
 msgstr ""
 
-#: bp-themes/bp-default/groups/create.php:69
-msgid "<strong>Attention Site Admin:</strong> Group forums require the <a href=\"%s\">correct setup and configuration</a> of a bbPress installation."
+#: bp-xprofile/bp-xprofile-admin.php:75
+msgid "Fields in the \"%s\" group will appear on the signup page."
 msgstr ""
 
-#: bp-themes/bp-default/groups/create.php:162
-msgid "To skip the avatar upload process, hit the \"Next Step\" button."
+#: bp-xprofile/bp-xprofile-admin.php:98 bp-xprofile/bp-xprofile-admin.php:382
+msgid "(Primary)"
 msgstr ""
 
-#: bp-themes/bp-default/groups/create.php:169
-msgid "Crop Group Avatar"
+#: bp-xprofile/bp-xprofile-admin.php:113
+msgid "Add New Field"
 msgstr ""
 
-#: bp-themes/bp-default/groups/create.php:273
-msgid "Back to Previous Step"
+#: bp-xprofile/bp-xprofile-admin.php:152
+msgid "There are no fields in this group."
 msgstr ""
 
-#: bp-themes/bp-default/groups/create.php:280
-msgid "Next Step"
+#: bp-xprofile/bp-xprofile-admin.php:161
+msgid "You have no groups."
 msgstr ""
 
-#: bp-themes/bp-default/groups/create.php:287
-msgid "Create Group and Continue"
+#: bp-xprofile/bp-xprofile-admin.php:162
+msgid "Add New Group"
 msgstr ""
 
-#: bp-themes/bp-default/attachment.php:26 bp-themes/bp-default/single.php:24
-msgid "Edit this entry"
+#: bp-xprofile/bp-xprofile-admin.php:189
+msgid "There was an error saving the group. Please try again"
 msgstr ""
 
-#: bp-themes/bp-default/attachment.php:40
-msgid "Full size is %s pixels"
+#: bp-xprofile/bp-xprofile-admin.php:192
+msgid "The group was saved successfully."
 msgstr ""
 
-#: bp-themes/bp-default/attachment.php:43
-msgid "Link to full size image"
+#: bp-xprofile/bp-xprofile-admin.php:221
+msgid "There was an error deleting the group. Please try again"
 msgstr ""
 
-#: bp-themes/bp-default/attachment.php:62
-msgid "Sorry, no attachments matched your criteria."
+#: bp-xprofile/bp-xprofile-admin.php:224
+msgid "The group was deleted successfully."
 msgstr ""
 
-#: bp-themes/bp-default/search.php:10
-msgid "Site"
+#: bp-xprofile/bp-xprofile-admin.php:265
+msgid "There was an error saving the field. Please try again"
 msgstr ""
 
-#: bp-themes/bp-default/search.php:14
-msgid "Search Results"
+#: bp-xprofile/bp-xprofile-admin.php:272
+msgid "The field was saved successfully."
 msgstr ""
 
-#: bp-themes/bp-default/search.php:51
-msgid "No posts found. Try a different search?"
+#: bp-xprofile/bp-xprofile-admin.php:316
+msgid "field"
 msgstr ""
 
-#: bp-themes/bp-default/archive.php:10
-msgid "You are browsing the archive for %1$s."
+#: bp-xprofile/bp-xprofile-admin.php:316
+msgid "option"
 msgstr ""
 
-#: bp-themes/bp-default/links.php:16
-msgid "Links"
+#: bp-xprofile/bp-xprofile-admin.php:320
+msgid "There was an error deleting the %s. Please try again"
 msgstr ""
 
-#: bp-themes/bp-default/single.php:35
-msgctxt "Previous post link"
-msgid "&larr;"
+#: bp-xprofile/bp-xprofile-admin.php:323
+msgid "The %s was deleted successfully!"
 msgstr ""
 
-#: bp-themes/bp-default/single.php:36
-msgctxt "Next post link"
-msgid "&rarr;"
+#: bp-xprofile/bp-xprofile-admin.php:382
+msgid "(Required)"
 msgstr ""
 
-#: bp-themes/bp-default/single.php:45
-msgid "Sorry, no posts matched your criteria."
+#: bp-xprofile/bp-xprofile-classes.php:271
+msgid "Please make sure you give the group a name."
 msgstr ""
 
-#: bp-activity/bp-activity-template.php:173
-msgctxt "Activity pagination previous text"
-msgid "&larr;"
+#: bp-xprofile/bp-xprofile-classes.php:359
+msgid "Create Field Group"
 msgstr ""
 
-#: bp-activity/bp-activity-template.php:174
-msgctxt "Activity pagination next text"
-msgid "&rarr;"
+#: bp-xprofile/bp-xprofile-classes.php:361
+msgid "Edit Field Group"
 msgstr ""
 
-#: bp-activity/bp-activity-template.php:453
-msgid "Viewing item %1$s to %2$s (of %3$s items)"
+#: bp-xprofile/bp-xprofile-classes.php:371
+#: bp-xprofile/bp-xprofile-classes.php:824
+msgid "Fields marked * are required"
 msgstr ""
 
-#: bp-activity/bp-activity-template.php:1191
-msgid "View Discussion"
+#: bp-xprofile/bp-xprofile-classes.php:385
+msgid "Field Group Title"
 msgstr ""
 
-#: bp-activity/bp-activity-template.php:2142
-msgid "xprofile"
+#: bp-xprofile/bp-xprofile-classes.php:394
+msgid "Group Description"
 msgstr ""
 
-#: bp-activity/bp-activity-template.php:2142
-msgid "friends"
+#: bp-xprofile/bp-xprofile-classes.php:405
+#: bp-xprofile/bp-xprofile-classes.php:913
+msgid "or"
 msgstr ""
 
-#: bp-activity/bp-activity-template.php:2142
-msgid "status"
+#: bp-xprofile/bp-xprofile-classes.php:740
+msgid "Please enter options for this Field:"
 msgstr ""
 
-#: bp-activity/bp-activity-template.php:2142
-msgid "sites"
+#: bp-xprofile/bp-xprofile-classes.php:743
+msgid "Order Entered"
 msgstr ""
 
-#: bp-activity/bp-activity-template.php:2150
-msgid "Clear Filter"
+#: bp-xprofile/bp-xprofile-classes.php:744
+msgid "Name - Ascending"
 msgstr ""
 
-#: bp-activity/bp-activity-template.php:2340
-msgid "a user"
+#: bp-xprofile/bp-xprofile-classes.php:745
+msgid "Name - Descending"
 msgstr ""
 
-#: bp-activity/bp-activity-template.php:2380
-msgid "Send a public message on your activity stream."
+#: bp-xprofile/bp-xprofile-classes.php:769
+#: bp-xprofile/bp-xprofile-classes.php:790
+msgid "Option"
 msgstr ""
 
-#: bp-activity/bp-activity-template.php:2381
-msgid "Public Message"
+#: bp-xprofile/bp-xprofile-classes.php:771
+#: bp-xprofile/bp-xprofile-classes.php:791
+msgid "Default Value"
 msgstr ""
 
-#: bp-activity/bp-activity-template.php:2690
-msgid "Site Wide Activity RSS Feed"
+#: bp-xprofile/bp-xprofile-classes.php:797
+msgid "Add Another Option"
 msgstr ""
 
-#: bp-activity/bp-activity-loader.php:89
-msgid "Search Activity..."
+#: bp-xprofile/bp-xprofile-classes.php:805
+msgid "Add Field"
 msgstr ""
 
-#: bp-activity/bp-activity-loader.php:113
-#: bp-activity/bp-activity-loader.php:235
-#: bp-activity/feeds/bp-activity-personal-feed.php:27
-#: bp-activity/bp-activity-screens.php:280
-msgid "Activity"
+#: bp-xprofile/bp-xprofile-classes.php:817
+msgid "Edit Field"
 msgstr ""
 
-#: bp-activity/bp-activity-loader.php:138
-#: bp-activity/bp-activity-loader.php:251
-msgid "Personal"
+#: bp-xprofile/bp-xprofile-classes.php:837
+msgid "Field Title"
 msgstr ""
 
-#: bp-activity/bp-activity-loader.php:159
-#: bp-activity/bp-activity-loader.php:259
-msgid "Favorites"
+#: bp-xprofile/bp-xprofile-classes.php:844
+msgid "Field Description"
 msgstr ""
 
-#: bp-activity/bp-activity-loader.php:226
-msgid "Mentions <span class=\"count\">%s</span>"
+#: bp-xprofile/bp-xprofile-classes.php:853
+msgid "Is This Field Required?"
 msgstr ""
 
-#: bp-activity/bp-activity-loader.php:303
-msgid "My Activity"
+#: bp-xprofile/bp-xprofile-classes.php:855
+msgid "Not Required"
 msgstr ""
 
-#: bp-activity/bp-activity-notifications.php:66
-msgid "%s mentioned you in an update"
+#: bp-xprofile/bp-xprofile-classes.php:856
+msgid "Required"
 msgstr ""
 
-#: bp-activity/bp-activity-notifications.php:79
-msgid ""
-"%1$s mentioned you in an update:\n"
-"\n"
-"\"%2$s\"\n"
-"\n"
-"To view and respond to the message, log in and visit: %3$s\n"
-"\n"
-"---------------------\n"
+#: bp-xprofile/bp-xprofile-classes.php:861
+msgid "Field Type"
 msgstr ""
 
-#: bp-activity/bp-activity-notifications.php:152
-msgid "%s replied to one of your updates"
+#: bp-xprofile/bp-xprofile-classes.php:863
+msgid "Text Box"
 msgstr ""
 
-#: bp-activity/bp-activity-notifications.php:154
-msgid ""
-"%1$s replied to one of your updates:\n"
-"\n"
-"\"%2$s\"\n"
-"\n"
-"To view your original update and all comments, log in and visit: %3$s\n"
-"\n"
-"---------------------\n"
+#: bp-xprofile/bp-xprofile-classes.php:864
+msgid "Multi-line Text Box"
 msgstr ""
 
-#: bp-activity/bp-activity-notifications.php:194
-msgid "%s replied to one of your comments"
+#: bp-xprofile/bp-xprofile-classes.php:865
+msgid "Date Selector"
 msgstr ""
 
-#: bp-activity/bp-activity-notifications.php:199
-msgid ""
-"%1$s replied to one of your comments:\n"
-"\n"
-"\"%2$s\"\n"
-"\n"
-"To view the original activity, your comment and all replies, log in and visit: %3$s\n"
-"\n"
-"---------------------\n"
+#: bp-xprofile/bp-xprofile-classes.php:866
+msgid "Radio Buttons"
 msgstr ""
 
-#: bp-activity/bp-activity-filters.php:248
-msgid "[Read more]"
+#: bp-xprofile/bp-xprofile-classes.php:867
+msgid "Drop Down Select Box"
 msgstr ""
 
-#: bp-activity/bp-activity-filters.php:253
-msgid "&hellip;"
+#: bp-xprofile/bp-xprofile-classes.php:868
+msgid "Multi Select Box"
 msgstr ""
 
-#: bp-activity/bp-activity-functions.php:151
-msgid "@%s Mentions"
+#: bp-xprofile/bp-xprofile-classes.php:869
+msgid "Checkboxes"
 msgstr ""
 
-#: bp-activity/bp-activity-functions.php:154
-msgid "You have %1$d new activity mentions"
+#: bp-xprofile/bp-xprofile-classes.php:890
+msgid "Default Visibility"
 msgstr ""
 
-#: bp-activity/bp-activity-functions.php:158
-msgid "%1$s mentioned you in an activity update"
+#: bp-xprofile/bp-xprofile-classes.php:899
+msgid "Per-Member Visibility"
 msgstr ""
 
-#: bp-activity/bp-activity-functions.php:664
-msgid "Posted an update"
+#: bp-xprofile/bp-xprofile-classes.php:901
+msgid "Let members change the this field's visibility"
 msgstr ""
 
-#: bp-activity/bp-activity-functions.php:872
-msgid "%s posted an update"
+#: bp-xprofile/bp-xprofile-classes.php:903
+msgid "Enforce the default visibility for all members"
 msgstr ""
 
-#: bp-activity/bp-activity-functions.php:939
-msgid "%s posted a new activity comment"
+#: bp-xprofile/bp-xprofile-classes.php:931
+msgid "Please make sure you fill out all required fields."
 msgstr ""
 
-#: bp-activity/bp-activity-functions.php:1310
-msgid "Thumbnail"
+#: bp-xprofile/bp-xprofile-classes.php:934
+msgid "Radio button field types require at least one option. Please add options below."
 msgstr ""
 
-#: bp-activity/feeds/bp-activity-friends-feed.php:27
-msgid "Friends Activity"
+#: bp-xprofile/bp-xprofile-classes.php:937
+#: bp-xprofile/bp-xprofile-classes.php:940
+msgid "Select box field types require at least one option. Please add options below."
 msgstr ""
 
-#: bp-activity/feeds/bp-activity-friends-feed.php:30
-msgid "%s - Friends Activity Feed"
+#: bp-xprofile/bp-xprofile-classes.php:943
+msgid "Checkbox field types require at least one option. Please add options below."
 msgstr ""
 
-#: bp-activity/feeds/bp-activity-friends-feed.php:49
-#: bp-activity/feeds/bp-activity-mentions-feed.php:49
-#: bp-activity/feeds/bp-activity-personal-feed.php:49
-#: bp-activity/feeds/bp-activity-favorites-feed.php:56
-#: bp-activity/feeds/bp-activity-group-feed.php:49
-#: bp-activity/feeds/bp-activity-sitewide-feed.php:49
-#: bp-activity/feeds/bp-activity-mygroups-feed.php:54
-msgid "Comments: %s"
+#: bp-xprofile/bp-xprofile-loader.php:106
+msgid "Anyone"
 msgstr ""
 
-#: bp-activity/feeds/bp-activity-friends-feed.php:53
-#: bp-activity/feeds/bp-activity-mentions-feed.php:53
-#: bp-activity/feeds/bp-activity-personal-feed.php:53
-#: bp-activity/feeds/bp-activity-favorites-feed.php:60
-msgid "In reply to"
+#: bp-xprofile/bp-xprofile-loader.php:110
+msgid "Logged In Users"
 msgstr ""
 
-#: bp-activity/feeds/bp-activity-personal-feed.php:30
-msgid "%s - Activity Feed"
+#: bp-xprofile/bp-xprofile-screens.php:95
+msgid "Please make sure you fill in all required fields in this profile field group before saving."
 msgstr ""
 
-#: bp-activity/feeds/bp-activity-favorites-feed.php:27
-#: bp-activity/feeds/bp-activity-favorites-feed.php:30
-msgid "Favorite Activity"
+#: bp-xprofile/bp-xprofile-screens.php:126
+msgid "There was a problem updating some of your profile information, please try again."
 msgstr ""
 
-#: bp-activity/feeds/bp-activity-group-feed.php:27
-msgid "Group Activity"
+#: bp-xprofile/bp-xprofile-screens.php:128
+msgid "Changes saved."
 msgstr ""
 
-#: bp-activity/feeds/bp-activity-group-feed.php:30
-msgid "%s - Group Activity Feed"
+#: bp-xprofile/bp-xprofile-screens.php:180
+msgid "There was a problem cropping your avatar, please try uploading it again"
 msgstr ""
 
-#: bp-activity/feeds/bp-activity-sitewide-feed.php:27
-msgid "Site Wide Activity"
+#: bp-xprofile/bp-xprofile-screens.php:182
+msgid "Your new avatar was uploaded successfully!"
 msgstr ""
 
-#: bp-activity/feeds/bp-activity-sitewide-feed.php:30
-msgid "Site Wide Activity Feed"
+#: bp-xprofile/bp-xprofile-template.php:668
+msgid "January"
 msgstr ""
 
-#: bp-activity/feeds/bp-activity-mygroups-feed.php:27
-#: bp-activity/feeds/bp-activity-mygroups-feed.php:30
-msgid "My Groups - Public Activity"
+#: bp-xprofile/bp-xprofile-template.php:669
+msgid "February"
 msgstr ""
 
-#: bp-activity/bp-activity-screens.php:245
-msgid "You do not have access to this activity."
+#: bp-xprofile/bp-xprofile-template.php:670
+msgid "March"
 msgstr ""
 
-#: bp-activity/bp-activity-screens.php:289
-msgid "A member mentions you in an update using \"@%s\""
+#: bp-xprofile/bp-xprofile-template.php:671
+msgid "April"
 msgstr ""
 
-#: bp-activity/bp-activity-screens.php:295
-msgid "A member replies to an update or comment you've posted"
+#: bp-xprofile/bp-xprofile-template.php:672
+msgid "May"
 msgstr ""
 
-#: bp-activity/bp-activity-actions.php:153
-msgid "Activity deleted successfully"
+#: bp-xprofile/bp-xprofile-template.php:673
+msgid "June"
 msgstr ""
 
-#: bp-activity/bp-activity-actions.php:155
-msgid "There was an error when deleting that activity"
+#: bp-xprofile/bp-xprofile-template.php:674
+msgid "July"
 msgstr ""
 
-#: bp-activity/bp-activity-actions.php:227
-msgid "Update Posted!"
+#: bp-xprofile/bp-xprofile-template.php:675
+msgid "August"
 msgstr ""
 
-#: bp-activity/bp-activity-actions.php:229
-msgid "There was an error when posting your update, please try again."
+#: bp-xprofile/bp-xprofile-template.php:676
+msgid "September"
 msgstr ""
 
-#: bp-activity/bp-activity-actions.php:279
-msgid "Reply Posted!"
+#: bp-xprofile/bp-xprofile-template.php:677
+msgid "October"
 msgstr ""
 
-#: bp-activity/bp-activity-actions.php:315
-msgid "Activity marked as favorite."
+#: bp-xprofile/bp-xprofile-template.php:678
+msgid "November"
 msgstr ""
 
-#: bp-activity/bp-activity-actions.php:317
-msgid "There was an error marking that activity as a favorite, please try again."
+#: bp-xprofile/bp-xprofile-template.php:679
+msgid "December"
 msgstr ""
 
-#: bp-activity/bp-activity-actions.php:351
-msgid "Activity removed as favorite."
+#: bp-xprofile/bp-xprofile-template.php:847
+msgid "Avatar uploads are currently disabled. Why not use a <a href=\"http://gravatar.com\" target=\"_blank\">gravatar</a> instead?"
 msgstr ""
 
-#: bp-activity/bp-activity-actions.php:353
-msgid "There was an error removing that activity as a favorite, please try again."
+#: bp-xprofile/bp-xprofile-template.php:855
+msgid "Profile not recently updated"
+msgstr ""
+
+#: bp-xprofile/bp-xprofile-template.php:865
+msgid "Profile updated %s"
 msgstr ""
\ No newline at end of file
diff --git a/wp-content/plugins/buddypress/bp-loader.php b/wp-content/plugins/buddypress/bp-loader.php
index 8c8bd64cfe46dea99d242aa70e8e33b72e0b59d5..a2086450546ff893e9a2192d8e8d4f66340f1adc 100644
--- a/wp-content/plugins/buddypress/bp-loader.php
+++ b/wp-content/plugins/buddypress/bp-loader.php
@@ -1,136 +1,487 @@
 <?php
+/**
+ * The BuddyPress Plugin
+ *
+ * BuddyPress is social networking software with a twist from the creators of WordPress.
+ *
+ * @package BuddyPress
+ * @subpackage Main
+ */
+
 /**
  * Plugin Name: BuddyPress
  * Plugin URI:  http://buddypress.org
  * Description: Social networking in a box. Build a social network for your company, school, sports team or niche community all based on the power and flexibility of WordPress.
  * Author:      The BuddyPress Community
- * Version:     1.5.3.1
  * Author URI:  http://buddypress.org/community/members/
- * Network:     true
+ * Version:     1.6.2
+ * Text Domain: buddypress
+ * Domain Path: /bp-languages/
  */
 
 // Exit if accessed directly
 if ( !defined( 'ABSPATH' ) ) exit;
 
 /** Constants *****************************************************************/
-global $wpdb;
 
-// Define the BuddyPress version
-if ( !defined( 'BP_VERSION' ) )
-	define( 'BP_VERSION', '1.5.3.1' );
+if ( !class_exists( 'BuddyPress' ) ) :
+/**
+ * Main BuddyPress Class
+ *
+ * Tap tap tap... Is this thing on?
+ *
+ * @since BuddyPress (1.6)
+ */
+class BuddyPress {
+
+	/**
+	 * Note to Plugin and Theme authors:
+	 *
+	 * Do not directly reference the variables below in your code. Their names
+	 * and locations in the BuddyPress class are subject to change at any time.
+	 *
+	 * Most of them have reference functions located in bp-core-functions.php.
+	 * The ones that don't can be accessed via their respective WordPress API's.
+	 *
+	 * Components are encouraged to store their data in the $bp global rather
+	 * than new globals to keep all BuddyPress data in one place.
+	 */
+
+	/** Version ***************************************************************/
+
+	/**
+	 * @var string BuddyPress version
+	 */
+	public $version = '1.6.2';
+
+	/**
+	 * @var int Database version of current BuddyPress files
+	 */
+	public $db_version = 6066;
+
+	/**
+	 * @var int Database version raw from database connection
+	 */
+	public $db_version_raw = 0;
+
+	/**
+	 * @var string State of BuddyPress installation
+	 */
+	public $maintenance_mode = '';
+
+	/**
+	 * @var bool Include deprecated BuddyPress files or not
+	 */
+	public $load_deprecated = true;
+
+	/** Root ******************************************************************/
+
+	/**
+	 * @var int The root blog ID
+	 */
+	public $root_blog_id = 1;
+
+	/** Paths *****************************************************************/
+
+	/**
+	 * The absolute path and filename of this file.
+	 *
+	 * @since BuddyPress (1.6)
+	 * @var string
+	 */
+	public $file;
+
+	/**
+	 * @var string Basename of the BuddyPress plugin directory
+	 */
+	public $basename = '';
+
+	/**
+	 * @var string Absolute path to the BuddyPress plugin directory
+	 */
+	public $plugin_dir = '';
+
+	/**
+	 * @var string Absolute path to the BuddyPress themes directory
+	 */
+	public $themes_dir = '';
+
+	/**
+	 * @var string Absolute path to the BuddyPress language directory
+	 */
+	public $lang_dir = '';
+
+	/** URLs ******************************************************************/
+
+	/**
+	 * @var string URL to the BuddyPress plugin directory
+	 */
+	public $plugin_url = '';
+
+	/**
+	 * @var string URL to the BuddyPress themes directory
+	 */
+	public $themes_url = '';
+
+	/** Users *****************************************************************/
+
+	/**
+	 * @var object Current user
+	 */
+	public $current_user = null;
+
+	/**
+	 * @var object Displayed user
+	 */
+	public $displayed_user = null;
+
+	/** Navigation ************************************************************/
+
+	/**
+	 * @var array Primary BuddyPress navigation
+	 */
+	public $bp_nav = array();
+
+	/**
+	 * @var array Secondary BuddyPress navigation to $bp_nav
+	 */
+	public $bp_options_nav = array();
+
+	/** Toolbar ***************************************************************/
+
+	/**
+	 * @var string The primary toolbar ID
+	 */
+	public $my_account_menu_id = '';
+
+	/** URI's *****************************************************************/
+
+	/**
+	 * @var array The unfiltered URI broken down into chunks
+	 * @see bp_core_set_uri_globals()
+	 */
+	public $unfiltered_uri = array();
+
+	/**
+	 * @var int The current offset of the URI
+	 * @see bp_core_set_uri_globals()
+	 */
+	public $unfiltered_uri_offset = 0;
+
+	/**
+	 * @var bool Are status headers already sent?
+	 */
+	public $no_status_set = false;
+
+	/**
+	 * @var array The canonical URI stack
+	 * @see bp_redirect_canonical()
+	 * @see bp_core_new_nav_item()
+	 */
+	public $canonical_stack = array();
+
+	/** Components ************************************************************/
+
+	/**
+	 * @var string Name of the current BuddyPress component (primary)
+	 */
+	public $current_component = '';
 
-// Define the database version
-if ( !defined( 'BP_DB_VERSION' ) )
-	define( 'BP_DB_VERSION', 3820 );
+	/**
+	 * @var string Name of the current BuddyPress item (secondary)
+	 */
+	public $current_item = '';
 
-// Place your custom code (actions/filters) in a file called
-// '/plugins/bp-custom.php' and it will be loaded before anything else.
-if ( file_exists( WP_PLUGIN_DIR . '/bp-custom.php' ) )
-	require( WP_PLUGIN_DIR . '/bp-custom.php' );
+	/**
+	 * @var string Name of the current BuddyPress action (tertiary)
+	 */
+	public $current_action = '';
 
-// Define on which blog ID BuddyPress should run
-if ( !defined( 'BP_ROOT_BLOG' ) ) {
+	/**
+	 * @var array Additional navigation elements (supplemental)
+	 */
+	public $action_variables = array();
 
-	// Root blog is the main site on this network
-	if ( is_multisite() && !defined( 'BP_ENABLE_MULTIBLOG' ) ) {
-		$current_site = get_current_site();
-		$root_blog_id = $current_site->blog_id;
+	/**
+	 * @var bool Displaying custom 2nd level navigation menu (I.E a group)
+	 */
+	public $is_single_item = false;
 
-	// Root blog is every site on this network
-	} elseif ( is_multisite() && defined( 'BP_ENABLE_MULTIBLOG' ) ) {
-		$root_blog_id = get_current_blog_id();
+	/** Option Overload *******************************************************/
 
-	// Root blog is the only blog on this network
-	} elseif( !is_multisite() ) {
-		$root_blog_id = 1;
+	/**
+	 * @var array Optional Overloads default options retrieved from get_option()
+	 */
+	public $options = array();
+
+	/** Functions *************************************************************/
+
+	/**
+	 * The main BuddyPress loader
+	 *
+	 * @since BuddyPress (1.6)
+	 *
+	 * @uses BuddyPress::constants() Setup legacy constants
+	 * @uses BuddyPress::setup_globals() Setup globals needed
+	 * @uses BuddyPress::includes() Includ required files
+	 * @uses BuddyPress::setup_actions() Setup hooks and actions
+	 */
+	public function __construct() {
+		$this->constants();
+		$this->setup_globals();
+		$this->includes();
+		$this->setup_actions();
 	}
 
-	define( 'BP_ROOT_BLOG', $root_blog_id );
-}
+	/**
+	 * Legacy BuddyPress constants
+	 *
+	 * Try to avoid using these. Their values have been moved into variables
+	 * in the $bp global, and have matching functions to get/set their value.
+	 *
+	 * @since BuddyPress (1.6)
+	 *
+	 * @uses is_multisite()
+	 * @uses get_current_site()
+	 * @uses get_current_blog_id()
+	 * @uses plugin_dir_path()
+	 * @uses plugin_dir_url()
+	 */
+	private function constants() {
+
+		// Define the BuddyPress version
+		if ( !defined( 'BP_VERSION' ) )
+			define( 'BP_VERSION', $this->version );
+
+		// Define the database version
+		if ( !defined( 'BP_DB_VERSION' ) )
+			define( 'BP_DB_VERSION', $this->db_version );
+
+		// Place your custom code (actions/filters) in a file called
+		// '/plugins/bp-custom.php' and it will be loaded before anything else.
+		if ( file_exists( WP_PLUGIN_DIR . '/bp-custom.php' ) )
+			require( WP_PLUGIN_DIR . '/bp-custom.php' );
 
-// Path and URL
-if ( !defined( 'BP_PLUGIN_DIR' ) )
-	define( 'BP_PLUGIN_DIR', WP_PLUGIN_DIR . '/buddypress' );
+		// Define on which blog ID BuddyPress should run
+		if ( !defined( 'BP_ROOT_BLOG' ) ) {
 
-if ( !defined( 'BP_PLUGIN_URL' ) )
-	define( 'BP_PLUGIN_URL', plugins_url( 'buddypress' ) );
+			// Default to 1
+			$root_blog_id = 1;
 
-// The search slug has to be defined nice and early because of the way search requests are loaded
-if ( !defined( 'BP_SEARCH_SLUG' ) )
-	define( 'BP_SEARCH_SLUG', 'search' );
+			// Root blog is the main site on this network
+			if ( is_multisite() && !defined( 'BP_ENABLE_MULTIBLOG' ) ) {
+				$current_site = get_current_site();
+				$root_blog_id = $current_site->blog_id;
 
-// Setup the BuddyPress theme directory
-register_theme_directory( BP_PLUGIN_DIR . '/bp-themes' );
+			// Root blog is every site on this network
+			} elseif ( is_multisite() && defined( 'BP_ENABLE_MULTIBLOG' ) ) {
+				$root_blog_id = get_current_blog_id();
+			}
 
-/** Loader ********************************************************************/
+			define( 'BP_ROOT_BLOG', $root_blog_id );
+		}
 
-// Load the WP abstraction file so BuddyPress can run on all WordPress setups.
-require( BP_PLUGIN_DIR . '/bp-core/bp-core-wpabstraction.php' );
+		// Path and URL
+		if ( !defined( 'BP_PLUGIN_DIR' ) )
+			define( 'BP_PLUGIN_DIR', trailingslashit( WP_PLUGIN_DIR . '/buddypress' ) );
 
-// Test to see whether this is a new installation or an upgraded version of BuddyPress
-if ( !$bp->database_version = get_site_option( 'bp-db-version' ) ) {
-	if ( $bp->database_version = get_option( 'bp-db-version' ) ) {
-		$bp->is_network_activate = 1;
-	} else {
-		$bp->database_version = get_site_option( 'bp-core-db-version' );  // BP 1.2 option
+		if ( !defined( 'BP_PLUGIN_URL' ) ) {
+			$plugin_url = plugin_dir_url( __FILE__ );
+
+			// If we're using https, update the protocol. Workaround for WP13941, WP15928, WP19037.
+			if ( is_ssl() )
+				$plugin_url = str_replace( 'http://', 'https://', $plugin_url );
+
+			define( 'BP_PLUGIN_URL', $plugin_url );
+		}
+
+		// The search slug has to be defined nice and early because of the way
+		// search requests are loaded
+		//
+		// @todo Make this better
+		if ( !defined( 'BP_SEARCH_SLUG' ) )
+			define( 'BP_SEARCH_SLUG', 'search' );
 	}
-}
 
-// This is a new installation.
-if ( empty( $bp->database_version ) ) {
-	$bp->maintenance_mode = 'install';
-	require( BP_PLUGIN_DIR . '/bp-core/admin/bp-core-update.php' );
+	/**
+	 * Component global variables
+	 *
+	 * @since BuddyPress (1.6)
+	 * @access private
+	 *
+	 * @uses plugin_dir_path() To generate BuddyPress plugin path
+	 * @uses plugin_dir_url() To generate BuddyPress plugin url
+	 * @uses apply_filters() Calls various filters
+	 */
+	private function setup_globals() {
+
+		/** Root **************************************************************/
 
-// There is a previous installation
-} else {
-	// Load core
-	require( BP_PLUGIN_DIR . '/bp-core/bp-core-loader.php' );
+		// BuddyPress Root blog ID
+		$this->root_blog_id = (int) apply_filters( 'bp_get_root_blog_id', BP_ROOT_BLOG );
 
-	// Check if an update is required
-	if ( (int)$bp->database_version < (int)constant( 'BP_DB_VERSION' ) || isset( $bp->is_network_activate ) ) {
-		$bp->maintenance_mode = 'update';
-		require( BP_PLUGIN_DIR . '/bp-core/admin/bp-core-update.php' );
+		/** Paths *************************************************************/
+
+		// BuddyPress root directory
+		$this->file       = __FILE__;
+		$this->basename   = plugin_basename( $this->file );
+		$this->plugin_dir = BP_PLUGIN_DIR;
+		$this->plugin_url = BP_PLUGIN_URL;
+
+		// Themes
+		$this->themes_dir = $this->plugin_dir . 'bp-themes';
+		$this->themes_url = $this->plugin_url . 'bp-themes';
+
+		// Languages
+		$this->lang_dir   = $this->plugin_dir . 'bp-languages';
+
+		/** Users *************************************************************/
+
+		$this->current_user       = new stdClass();
+		$this->displayed_user     = new stdClass();
 	}
-}
 
-/** Activation ****************************************************************/
+	/**
+	 * Include required files
+	 *
+	 * @since BuddyPress (1.6)
+	 * @access private
+	 *
+	 * @uses is_admin() If in WordPress admin, load additional file
+	 */
+	private function includes() {
 
-if ( !function_exists( 'bp_loader_activate' ) ) :
-/**
- * Defines BP's activation routine.
- *
- * Most of BP's crucial setup is handled by the setup wizard. This function takes care of some
- * issues with incompatible legacy themes, and provides a hook for other functions to know that
- * BP has been activated.
- *
- * @package BuddyPress Core
-*/
-function bp_loader_activate() {
-	// Force refresh theme roots.
-	delete_site_transient( 'theme_roots' );
+		// Load the WP abstraction file so BuddyPress can run on all WordPress setups.
+		require( BP_PLUGIN_DIR . '/bp-core/bp-core-wpabstraction.php' );
 
-	if ( !function_exists( 'get_blog_option' ) )
-		require ( WP_PLUGIN_DIR . '/buddypress/bp-core/bp-core-wpabstraction.php' );
+		// Get the possible DB versions (boy is this gross)
+		$versions               = array();
+		$versions['1.6-single'] = get_blog_option( $this->root_blog_id, '_bp_db_version' );
 
-	if ( !function_exists( 'bp_get_root_blog_id' ) )
-		require ( WP_PLUGIN_DIR . '/buddypress/bp-core/bp-core-functions.php' );
+		// 1.6-single exists, so trust it
+		if ( !empty( $versions['1.6-single'] ) ) {
+			$this->db_version_raw = (int) $versions['1.6-single'];
 
-	// Switch the user to the new bp-default if they are using the old
-	// bp-default on activation.
-	if ( 'bp-sn-parent' == get_blog_option( bp_get_root_blog_id(), 'template' ) && 'bp-default' == get_blog_option( bp_get_root_blog_id(), 'stylesheet' ) )
-		switch_theme( 'bp-default', 'bp-default' );
+		// If no 1.6-single exists, use the max of the others
+		} else {
+			$versions['1.2']        = get_site_option(                      'bp-core-db-version' );
+			$versions['1.5-multi']  = get_site_option(                           'bp-db-version' );
+			$versions['1.6-multi']  = get_site_option(                          '_bp_db_version' );
+			$versions['1.5-single'] = get_blog_option( $this->root_blog_id,     'bp-db-version'  );
 
-	do_action( 'bp_loader_activate' );
-}
-register_activation_hook( 'buddypress/bp-loader.php', 'bp_loader_activate' );
-endif;
+			// Remove empty array items
+			$versions             = array_filter( $versions );
+			$this->db_version_raw = (int) ( !empty( $versions ) ) ? (int) max( $versions ) : 0;
+		}
+
+		/** Update/Install ****************************************************/
+
+		// This is a new installation
+		if ( is_admin() ) {
+
+			// New installation
+			if ( empty( $this->db_version_raw ) ) {
+				$this->maintenance_mode = 'install';
+
+			// Update
+			} elseif ( (int) $this->db_version_raw < (int) $this->db_version ) {
+				$this->maintenance_mode = 'update';
+			}
+
+			// The installation process requires a few BuddyPress core libraries
+			if ( !empty( $this->maintenance_mode ) ) {
+				require( $this->plugin_dir . 'bp-core/bp-core-admin.php'     );
+				require( $this->plugin_dir . 'bp-core/bp-core-functions.php' );
+				require( $this->plugin_dir . 'bp-core/bp-core-template.php'  );
+				require( $this->plugin_dir . 'bp-core/bp-core-update.php'    );
+				require( $this->plugin_dir . 'bp-core/bp-core-caps.php'      );
+				require( $this->plugin_dir . 'bp-core/bp-core-options.php'   );
 
-if ( !function_exists( 'bp_loader_deactivate' ) ) :
-// Deactivation Function
-function bp_loader_deactivate() {
-	do_action( 'bp_loader_deactivate' );
+				/**
+				 * Textdomain is usually loaded via the bp_core_loaded action, but
+				 * that action isn't available when BP is in maintenance mode.
+				 */
+				add_action( 'plugins_loaded', 'bp_core_load_buddypress_textdomain', 9 );
+
+				// Load up BuddyPress's admin
+				add_action( 'plugins_loaded', 'bp_admin' );
+			}
+		}
+
+		// Not in maintenance mode
+		if ( empty( $this->maintenance_mode ) ) {
+
+			// Require all of the BuddyPress core libraries
+			require( $this->plugin_dir . 'bp-core/bp-core-actions.php'    );
+			require( $this->plugin_dir . 'bp-core/bp-core-caps.php'       );
+			require( $this->plugin_dir . 'bp-core/bp-core-cache.php'      );
+			require( $this->plugin_dir . 'bp-core/bp-core-cssjs.php'      );
+			require( $this->plugin_dir . 'bp-core/bp-core-update.php'     );
+			require( $this->plugin_dir . 'bp-core/bp-core-options.php'    );
+			require( $this->plugin_dir . 'bp-core/bp-core-classes.php'    );
+			require( $this->plugin_dir . 'bp-core/bp-core-filters.php'    );
+			require( $this->plugin_dir . 'bp-core/bp-core-avatars.php'    );
+			require( $this->plugin_dir . 'bp-core/bp-core-widgets.php'    );
+			require( $this->plugin_dir . 'bp-core/bp-core-template.php'   );
+			require( $this->plugin_dir . 'bp-core/bp-core-adminbar.php'   );
+			require( $this->plugin_dir . 'bp-core/bp-core-buddybar.php'   );
+			require( $this->plugin_dir . 'bp-core/bp-core-catchuri.php'   );
+			require( $this->plugin_dir . 'bp-core/bp-core-component.php'  );
+			require( $this->plugin_dir . 'bp-core/bp-core-functions.php'  );
+			require( $this->plugin_dir . 'bp-core/bp-core-moderation.php' );
+			require( $this->plugin_dir . 'bp-core/bp-core-loader.php'     );
+
+			// Skip or load deprecated content
+			if ( false !== $this->load_deprecated ) {
+				require( $this->plugin_dir . 'bp-core/deprecated/1.5.php' );
+				require( $this->plugin_dir . 'bp-core/deprecated/1.6.php' );
+			}
+		}
+	}
+
+	/**
+	 * Setup the default hooks and actions
+	 *
+	 * @since BuddyPress (1.6)
+	 * @access private
+	 *
+	 * @uses register_activation_hook() To register the activation hook
+	 * @uses register_deactivation_hook() To register the deactivation hook
+	 * @uses add_action() To add various actions
+	 */
+	private function setup_actions() {
+
+		// Add actions to plugin activation and deactivation hooks
+		add_action( 'activate_'   . $this->basename, 'bp_activation'   );
+		add_action( 'deactivate_' . $this->basename, 'bp_deactivation' );
+
+		// If BuddyPress is being deactivated, do not add any actions
+		if ( bp_is_deactivation( $this->basename ) )
+			return;
+
+		// Array of BuddyPress core actions
+		$actions = array(
+			'setup_current_user',       // Setup currently logged in user
+			'register_post_types',      // Register post types
+			'register_post_statuses',   // Register post statuses
+			'register_taxonomies',      // Register taxonomies
+			'register_views',           // Register the views
+			'register_theme_directory', // Register the theme directory
+			'load_textdomain',          // Load textdomain
+			'add_rewrite_tags',         // Add rewrite tags
+			'generate_rewrite_rules'    // Generate rewrite rules
+		);
+
+		// Add the actions
+		foreach( $actions as $class_action )
+			add_action( 'bp_' . $class_action, array( $this, $class_action ), 5 );
+
+		// Setup the BuddyPress theme directory
+		register_theme_directory( $this->themes_dir );
+	}
 }
-register_deactivation_hook( 'buddypress/bp-loader.php', 'bp_loader_deactivate' );
-endif;
 
-?>
+// "And now for something completely different"
+$GLOBALS['bp'] = new BuddyPress;
+
+endif;
diff --git a/wp-content/plugins/buddypress/bp-members/bp-members-actions.php b/wp-content/plugins/buddypress/bp-members/bp-members-actions.php
index 785165e68457d00cd115f33065edd1a04b530e16..44360814a26e6934ec26007292e13b25c9746f78 100644
--- a/wp-content/plugins/buddypress/bp-members/bp-members-actions.php
+++ b/wp-content/plugins/buddypress/bp-members/bp-members-actions.php
@@ -1,24 +1,19 @@
 <?php
-/*******************************************************************************
- * Action Functions
+
+/**
+ * BuddyPress Members Actions
  *
  * Action functions are exactly the same as screen functions, however they do not
  * have a template screen associated with them. Usually they will send the user
  * back to the default screen after execution.
+ *
+ * @package BuddyPress
+ * @subpackage MembersActions
  */
 
 // Exit if accessed directly
 if ( !defined( 'ABSPATH' ) ) exit;
 
-/**
- * Listens to the $bp component and action variables to determine if the user is viewing the members
- * directory page. If they are, it will set up the directory and load the members directory template.
- *
- * @package BuddyPress Core
- * @global object $bp Global BuddyPress settings object
- * @uses wp_enqueue_script() Loads a JS script into the header of the page.
- * @uses bp_core_load_template() Loads a specific template file.
- */
 /**
  * When a site admin selects "Mark as Spammer/Not Spammer" from the admin menu
  * this action will fire and mark or unmark the user and their blogs as spam.
@@ -29,125 +24,75 @@ if ( !defined( 'ABSPATH' ) ) exit;
  * @global object $wpdb Global WordPress Database object
  */
 function bp_core_action_set_spammer_status( $user_id = 0 ) {
-	global $wpdb;
-
-	// Only super admins can currently spam users
-	if ( !is_super_admin() || bp_is_my_profile() )
-		return;
 
 	// Use displayed user if it's not yourself
-	if ( empty( $user_id ) && bp_is_user() )
-		$user_id = bp_displayed_user_id();
-
-	// Bail if no user ID
 	if ( empty( $user_id ) )
-		return;
-
-	// Bail if user ID is super admin
-	if ( is_super_admin( $user_id ) )
-		return;
+		$user_id = bp_displayed_user_id();
 
 	if ( bp_is_current_component( 'admin' ) && ( in_array( bp_current_action(), array( 'mark-spammer', 'unmark-spammer' ) ) ) ) {
 
 		// Check the nonce
 		check_admin_referer( 'mark-unmark-spammer' );
 
-		// Get the functions file
-		if ( is_multisite() ) {
-			require( ABSPATH . 'wp-admin/includes/ms.php' );
-		}
-
 		// To spam or not to spam
-		$is_spam = bp_is_current_action( 'mark-spammer' ) ? 1 : 0;
+		$status = bp_is_current_action( 'mark-spammer' ) ? 'spam' : 'ham';
 
-		// Get the blogs for the user
-		$blogs = get_blogs_of_user( $user_id, true );
+		// The heavy lifting
+		bp_core_process_spammer_status( $user_id, $status );
 
-		foreach ( (array) $blogs as $key => $details ) {
-
-			// Do not mark the main or current root blog as spam
-			if ( 1 == $details->userblog_id || bp_get_root_blog_id() == $details->userblog_id ) {
-				continue;
-			}
-
-			// Update the blog status
-			update_blog_status( $details->userblog_id, 'spam', $is_spam );
-		}
-
-		// Finally, mark this user as a spammer
-		if ( is_multisite() ) {
-			update_user_status( $user_id, 'spam', $is_spam );
-		}
-
-		// Always set single site status
-		$wpdb->update( $wpdb->users, array( 'user_status' => $is_spam ), array( 'ID' => $user_id ) );
-
-		// Add feedback message
-		if ( $is_spam ) {
+		// Add feedback message. @todo - Error reporting
+		if ( 'spam' == $status ) {
 			bp_core_add_message( __( 'User marked as spammer. Spam users are visible only to site admins.', 'buddypress' ) );
 		} else {
 			bp_core_add_message( __( 'User removed as spammer.', 'buddypress' ) );
 		}
 
-		// Hide this user's activity
-		if ( $is_spam && bp_is_active( 'activity' ) ) {
-			bp_activity_hide_user_activity( $user_id );
-		}
-
-		// We need a special hook for is_spam so that components can delete data at spam time
-		$bp_action = $is_spam ? 'bp_make_spam_user' : 'bp_make_ham_user';
-		do_action( $bp_action, bp_displayed_user_id() );
-
-		// Call multisite actions in single site mode for good measure
-		if ( !is_multisite() ) {
-			$wp_action = $is_spam ? 'make_spam_user' : 'make_ham_user';
-			do_action( $wp_action, bp_displayed_user_id() );
-		}
-
-		// Allow plugins to do neat things
+		// Deprecated. Use bp_core_process_spammer_status.
+		$is_spam = 'spam' == $status;
 		do_action( 'bp_core_action_set_spammer_status', bp_displayed_user_id(), $is_spam );
 
 		// Redirect back to where we came from
 		bp_core_redirect( wp_get_referer() );
 	}
 }
-add_action( 'bp_actions', 'bp_core_action_set_spammer_status' );
+// Unhooked in BuddyPress (1.6) - moved to settings
+//add_action( 'bp_actions', 'bp_core_action_set_spammer_status' );
 
 /**
  * Allows a site admin to delete a user from the adminbar menu.
  *
  * @package BuddyPress Core
- * @global object $bp Global BuddyPress settings object
  */
 function bp_core_action_delete_user() {
-	global $bp;
 
-	if ( !is_super_admin() || bp_is_my_profile() || !$bp->displayed_user->id )
+	if ( !bp_current_user_can( 'bp_moderate' ) || bp_is_my_profile() || !bp_displayed_user_id() )
 		return false;
 
-	if ( 'admin' == $bp->current_component && 'delete-user' == $bp->current_action ) {
+	if ( bp_is_current_component( 'admin' ) && bp_is_current_action( 'delete-user' ) ) {
+
 		// Check the nonce
 		check_admin_referer( 'delete-user' );
 
 		$errors = false;
 		do_action( 'bp_core_before_action_delete_user', $errors );
 
-		if ( bp_core_delete_account( $bp->displayed_user->id ) ) {
-			bp_core_add_message( sprintf( __( '%s has been deleted from the system.', 'buddypress' ), $bp->displayed_user->fullname ) );
+		if ( bp_core_delete_account( bp_displayed_user_id() ) ) {
+			bp_core_add_message( sprintf( __( '%s has been deleted from the system.', 'buddypress' ), bp_get_displayed_user_fullname() ) );
 		} else {
-			bp_core_add_message( sprintf( __( 'There was an error deleting %s from the system. Please try again.', 'buddypress' ), $bp->displayed_user->fullname ), 'error' );
+			bp_core_add_message( sprintf( __( 'There was an error deleting %s from the system. Please try again.', 'buddypress' ), bp_get_displayed_user_fullname() ), 'error' );
 			$errors = true;
 		}
 
 		do_action( 'bp_core_action_delete_user', $errors );
 
 		if ( $errors )
-			bp_core_redirect( $bp->displayed_user->domain );
+			bp_core_redirect( bp_displayed_user_domain() );
 		else
-			bp_core_redirect( $bp->loggedin_user->domain );
+			bp_core_redirect( bp_loggedin_user_domain() );
 	}
 }
-add_action( 'bp_actions', 'bp_core_action_delete_user' );
+// Unhooked in BuddyPress (1.6) - moved to settings
+//add_action( 'bp_actions', 'bp_core_action_delete_user' );
 
 /**
  * Returns the user_id for a user based on their username.
@@ -158,12 +103,12 @@ add_action( 'bp_actions', 'bp_core_action_delete_user' );
  * @return int the user ID of the matched user.
  */
 function bp_core_get_random_member() {
-	global $bp;
+	if ( ! isset( $_GET['random-member'] ) )
+		return;
 
-	if ( isset( $_GET['random-member'] ) ) {
-		$user = bp_core_get_users( array( 'type' => 'random', 'per_page' => 1 ) );
-		bp_core_redirect( bp_core_get_user_domain( $user['users'][0]->id ) );
-	}
+	$user = bp_core_get_users( array( 'type' => 'random', 'per_page' => 1 ) );
+	bp_core_redirect( bp_core_get_user_domain( $user['users'][0]->id ) );
 }
 add_action( 'bp_actions', 'bp_core_get_random_member' );
-?>
\ No newline at end of file
+
+?>
diff --git a/wp-content/plugins/buddypress/bp-members/bp-members-adminbar.php b/wp-content/plugins/buddypress/bp-members/bp-members-adminbar.php
index 80e7a5bac4a2aa79a2610f65df8a080c99d5e920..7d78bbb28c5c1927583bb5ff418e40209f1d4731 100644
--- a/wp-content/plugins/buddypress/bp-members/bp-members-adminbar.php
+++ b/wp-content/plugins/buddypress/bp-members/bp-members-adminbar.php
@@ -1,43 +1,25 @@
 <?php
+
 /**
- * BuddyPress Members Admin Bar
+ * BuddyPress Members Toolbar
  *
- * Handles the member functions related to the WordPress Admin Bar
+ * Handles the member functions related to the WordPress Toolbar
  *
  * @package BuddyPress
- * @subpackage Core
+ * @subpackage MembersAdminBar
  */
 
 // Exit if accessed directly
 if ( !defined( 'ABSPATH' ) ) exit;
 
-/**
- * Adjust the admin bar menus based on which WordPress version this is
- *
- * @since BuddyPress (1.5.2)
- */
-function bp_members_admin_bar_version_check() {
-	
-	if ( '3.2' == bp_get_major_wp_version() ) {
-		add_action( 'bp_setup_admin_bar', 'bp_members_admin_bar_my_account_menu',    4    );
-		add_action( 'bp_setup_admin_bar', 'bp_members_admin_bar_notifications_menu', 5    );
-		add_action( 'bp_setup_admin_bar', 'bp_members_admin_bar_user_admin_menu',    99   );
-		add_action( 'bp_setup_admin_bar', 'bp_members_admin_bar_my_account_logout',  9999 );
-	} elseif ( '3.3' == bp_get_major_wp_version() ) {
-		add_action( 'bp_setup_admin_bar', 'bp_members_admin_bar_my_account_menu',    4   );
-		add_action( 'bp_setup_admin_bar', 'bp_members_admin_bar_notifications_menu', 5   );
-		add_action( 'admin_bar_menu',     'bp_members_admin_bar_user_admin_menu',    400 );
-	}
-}
-add_action( 'admin_bar_menu', 'bp_members_admin_bar_version_check', 4 );
-
 /**
  * Add the "My Account" menu and all submenus.
  *
- * @since BuddyPress (r4151)
+ * @since BuddyPress (1.6)
+ * @todo Deprecate WP 3.2 Toolbar compatibility when we drop 3.2 support
  */
 function bp_members_admin_bar_my_account_menu() {
-	global $bp, $wp_admin_bar, $wp_version;
+	global $bp, $wp_admin_bar;
 
 	// Bail if this is an ajax request
 	if ( defined( 'DOING_AJAX' ) )
@@ -46,40 +28,18 @@ function bp_members_admin_bar_my_account_menu() {
 	// Logged in user
 	if ( is_user_logged_in() ) {
 
-		if ( '3.2' == bp_get_major_wp_version() ) {
+		// Stored in the global so we can add menus easily later on
+		$bp->my_account_menu_id = 'my-account-buddypress';
 
-			// User avatar
-			$avatar = bp_core_fetch_avatar( array(
-				'item_id' => $bp->loggedin_user->id,
-				'email'   => $bp->loggedin_user->userdata->user_email,
-				'width'   => 16,
-				'height'  => 16
-			) );
-
-			// Unique ID for the 'My Account' menu
-			$bp->my_account_menu_id = ( ! empty( $avatar ) ) ? 'my-account-with-avatar' : 'my-account';
-
-			// Create the main 'My Account' menu
-			$wp_admin_bar->add_menu( array(
-				'id'    => $bp->my_account_menu_id,
-				'title' => $avatar . bp_get_loggedin_user_fullname(),
-				'href'  => $bp->loggedin_user->domain
-			) );
-
-		} else {
-
-			// Unique ID for the 'My Account' menu
-			$bp->my_account_menu_id = 'my-account-buddypress';
-
-			// Create the main 'My Account' menu
-			$wp_admin_bar->add_menu( array(
-				'parent' => 'my-account',
-				'id'     => $bp->my_account_menu_id,
-				'href'   => $bp->loggedin_user->domain,
-				'group'  => true,
-				'meta'   => array( 'class' => 'ab-sub-secondary' )
-			) );
-		}
+		// Create the main 'My Account' menu
+		$wp_admin_bar->add_menu( array(
+			'id'     => $bp->my_account_menu_id,
+			'group'  => true,
+			'title'  => __( 'Edit My Profile', 'buddypress' ),
+			'href'   => bp_loggedin_user_domain(),
+			'meta'   => array(
+			'class'  => 'ab-sub-secondary'
+		) ) );
 
 	// Show login and sign-up links
 	} elseif ( !empty( $wp_admin_bar ) ) {
@@ -103,12 +63,13 @@ function bp_members_admin_bar_my_account_menu() {
 		}
 	}
 }
+add_action( 'bp_setup_admin_bar', 'bp_members_admin_bar_my_account_menu', 4 );
 
 /**
  * Adds the User Admin top-level menu to user pages
  *
  * @package BuddyPress
- * @since 1.5
+ * @since BuddyPress (1.5)
  */
 function bp_members_admin_bar_user_admin_menu() {
 	global $bp, $wp_admin_bar;
@@ -121,43 +82,20 @@ function bp_members_admin_bar_user_admin_menu() {
 	if ( !current_user_can( 'edit_users' ) || bp_is_my_profile() )
 		return false;
 
-	if ( '3.2' == bp_get_major_wp_version() ) {
-
-		// User avatar
-		$avatar = bp_core_fetch_avatar( array(
-			'item_id' => $bp->displayed_user->id,
-			'email'   => $bp->displayed_user->userdata->user_email,
-			'width'   => 16,
-			'height'  => 16
-		) );
-
-		// Unique ID for the 'My Account' menu
-		$bp->user_admin_menu_id = ( ! empty( $avatar ) ) ? 'user-admin-with-avatar' : 'user-admin';
-
-		// Add the top-level User Admin button
-		$wp_admin_bar->add_menu( array(
-			'id'    => $bp->user_admin_menu_id,
-			'title' => $avatar . bp_get_displayed_user_fullname(),
-			'href'  => bp_displayed_user_domain()
-		) );
+	// Unique ID for the 'My Account' menu
+	$bp->user_admin_menu_id = 'user-admin';
 
-	} elseif ( '3.3' == bp_get_major_wp_version() ) {
-		
-		// Unique ID for the 'My Account' menu
-		$bp->user_admin_menu_id = 'user-admin';
-
-		// Add the top-level User Admin button
-		$wp_admin_bar->add_menu( array(
-			'id'    => $bp->user_admin_menu_id,
-			'title' => __( 'Edit Member', 'buddypress' ),
-			'href'  => bp_displayed_user_domain()
-		) );
-	}
+	// Add the top-level User Admin button
+	$wp_admin_bar->add_menu( array(
+		'id'    => $bp->user_admin_menu_id,
+		'title' => __( 'Edit Member', 'buddypress' ),
+		'href'  => bp_displayed_user_domain()
+	) );
 
 	// User Admin > Edit this user's profile
 	$wp_admin_bar->add_menu( array(
 		'parent' => $bp->user_admin_menu_id,
-		'id'     => 'edit-profile',
+		'id'     => $bp->user_admin_menu_id . '-edit-profile',
 		'title'  => __( "Edit Profile", 'buddypress' ),
 		'href'   => bp_get_members_component_link( 'profile', 'edit' )
 	) );
@@ -165,80 +103,56 @@ function bp_members_admin_bar_user_admin_menu() {
 	// User Admin > Edit this user's avatar
 	$wp_admin_bar->add_menu( array(
 		'parent' => $bp->user_admin_menu_id,
-		'id'     => 'change-avatar',
+		'id'     => $bp->user_admin_menu_id . '-change-avatar',
 		'title'  => __( "Edit Avatar", 'buddypress' ),
 		'href'   => bp_get_members_component_link( 'profile', 'change-avatar' )
 	) );
 
 	// User Admin > Spam/unspam
-	if ( !bp_core_is_user_spammer( bp_displayed_user_id() ) ) {
-		$wp_admin_bar->add_menu( array(
-			'parent' => $bp->user_admin_menu_id,
-			'id'     => 'spam-user',
-			'title'  => __( 'Mark as Spammer', 'buddypress' ),
-			'href'   => wp_nonce_url( bp_displayed_user_domain() . 'admin/mark-spammer/', 'mark-unmark-spammer' ),
-			'meta'   => array( 'onclick' => 'confirm(" ' . __( 'Are you sure you want to mark this user as a spammer?', 'buddypress' ) . '");' )
-		) );
-	} else {
-		$wp_admin_bar->add_menu( array(
-			'parent' => $bp->user_admin_menu_id,
-			'id'     => 'unspam-user',
-			'title'  => __( 'Not a Spammer', 'buddypress' ),
-			'href'   => wp_nonce_url( bp_displayed_user_domain() . 'admin/unmark-spammer/', 'mark-unmark-spammer' ),
-			'meta'   => array( 'onclick' => 'confirm(" ' . __( 'Are you sure you want to mark this user as not a spammer?', 'buddypress' ) . '");' )
-		) );
-	}
+	$wp_admin_bar->add_menu( array(
+		'parent' => $bp->user_admin_menu_id,
+		'id'     => $bp->user_admin_menu_id . '-user-capabilities',
+		'title'  => __( 'User Capabilities', 'buddypress' ),
+		'href'   => bp_displayed_user_domain() . 'settings/capabilities/'
+	) );
 
 	// User Admin > Delete Account
 	$wp_admin_bar->add_menu( array(
 		'parent' => $bp->user_admin_menu_id,
-		'id'     => 'delete-user',
+		'id'     => $bp->user_admin_menu_id . '-delete-user',
 		'title'  => __( 'Delete Account', 'buddypress' ),
-		'href'   => wp_nonce_url( bp_displayed_user_domain() . 'admin/delete-user/', 'delete-user' ),
-		'meta'   => array( 'onclick' => 'confirm(" ' . __( "Are you sure you want to delete this user's account?", 'buddypress' ) . '");' )
+		'href'   => bp_displayed_user_domain() . 'settings/delete-account/'
 	) );
 }
+add_action( 'admin_bar_menu', 'bp_members_admin_bar_user_admin_menu', 99 );
 
 /**
  * Build the "Notifications" dropdown
  *
  * @package Buddypress
- * @since 1.5
+ * @since BuddyPress (1.5)
  */
 function bp_members_admin_bar_notifications_menu() {
-	global $bp, $wp_admin_bar;
+	global $wp_admin_bar;
 
 	if ( !is_user_logged_in() )
 		return false;
 
-	if ( $notifications = bp_core_get_notifications_for_user( bp_loggedin_user_id(), 'object' ) ) {
-		$menu_title = sprintf( __( 'Notifications <span id="ab-pending-notifications" class="pending-count">%s</span>', 'buddypress' ), count( $notifications ) );
-	} else {
-		$menu_title = __( 'Notifications', 'buddypress' );
-	}
-
-	if ( '3.2' == bp_get_major_wp_version() ) {
-
-		// Add the top-level Notifications button
-		$wp_admin_bar->add_menu( array(
-			'id'    => 'bp-notifications',
-			'title' => $menu_title,
-			'href'  => bp_loggedin_user_domain()
-		) );
+	$notifications = bp_core_get_notifications_for_user( bp_loggedin_user_id(), 'object' );
+	$count         = !empty( $notifications ) ? count( $notifications ) : 0;
+	$alert_class   = (int) $count > 0 ? 'pending-count alert' : 'count no-alert';
+	$menu_title    = '<span id="ab-pending-notifications" class="' . $alert_class . '">' . $count . '</span>';
 
-	} elseif ( '3.3' == bp_get_major_wp_version() ) {
-		
-		// Add the top-level Notifications button
-		$wp_admin_bar->add_menu( array(
-			'parent' => 'top-secondary',
-			'id'     => 'bp-notifications',
-			'title'  => $menu_title,
-			'href'   => bp_loggedin_user_domain()
-		) );
-	}
+	// Add the top-level Notifications button
+	$wp_admin_bar->add_menu( array(
+		'parent'    => 'top-secondary',
+		'id'        => 'bp-notifications',
+		'title'     => $menu_title,
+		'href'      => bp_loggedin_user_domain(),
+	) );
 
 	if ( !empty( $notifications ) ) {
-		foreach ( (array)$notifications as $notification ) {
+		foreach ( (array) $notifications as $notification ) {
 			$wp_admin_bar->add_menu( array(
 				'parent' => 'bp-notifications',
 				'id'     => 'notification-' . $notification->id,
@@ -257,31 +171,18 @@ function bp_members_admin_bar_notifications_menu() {
 
 	return;
 }
+add_action( 'admin_bar_menu', 'bp_members_admin_bar_notifications_menu', 90 );
 
 /**
- * Make sure the logout link is at the bottom of the "My Account" menu
+ * Remove rogue WP core edit menu when viewing a single user
  *
- * @since BuddyPress (r4151)
- *
- * @global obj $bp
- * @global obj $wp_admin_bar
+ * @since BuddyPress (1.6)
  */
-function bp_members_admin_bar_my_account_logout() {
-	global $bp, $wp_admin_bar;
-
-	// Bail if this is an ajax request
-	if ( defined( 'DOING_AJAX' ) )
-		return;
-
-	if ( is_user_logged_in() ) {
-		// Log out
-		$wp_admin_bar->add_menu( array(
-			'parent' => $bp->my_account_menu_id,
-			'id'     => $bp->my_account_menu_id . '-logout',
-			'title'  => __( 'Log Out', 'buddypress' ),
-			'href'   => wp_logout_url()
-		) );
+function bp_members_remove_edit_page_menu() {
+	if ( bp_is_user() ) {
+		remove_action( 'admin_bar_menu', 'wp_admin_bar_edit_menu', 80 );
 	}
 }
+add_action( 'bp_init', 'bp_members_remove_edit_page_menu', 99 );
 
-?>
\ No newline at end of file
+?>
diff --git a/wp-content/plugins/buddypress/bp-members/bp-members-buddybar.php b/wp-content/plugins/buddypress/bp-members/bp-members-buddybar.php
index ed94a5238e9bd807805aa944aa108918207220e8..fac547b1f2027e9da5081852dac3554b4b4f72ce 100644
--- a/wp-content/plugins/buddypress/bp-members/bp-members-buddybar.php
+++ b/wp-content/plugins/buddypress/bp-members/bp-members-buddybar.php
@@ -1,18 +1,29 @@
 <?php
+
+/**
+ * BuddyPress Members BuddyBar
+ *
+ * Handles the member functions related to the BuddyBar
+ *
+ * @package BuddyPress
+ * @subpackage MembersBuddyBar
+ */
+
 // Exit if accessed directly
 if ( !defined( 'ABSPATH' ) ) exit;
 
-// **** "Notifications" Menu *********
+/**
+ * Notifications Menu
+ */
 function bp_adminbar_notifications_menu() {
-	global $bp;
 
 	if ( !is_user_logged_in() )
 		return false;
 
-	echo '<li id="bp-adminbar-notifications-menu"><a href="' . $bp->loggedin_user->domain . '">';
+	echo '<li id="bp-adminbar-notifications-menu"><a href="' . bp_loggedin_user_domain() . '">';
 	_e( 'Notifications', 'buddypress' );
 
-	if ( $notifications = bp_core_get_notifications_for_user( $bp->loggedin_user->id ) ) { ?>
+	if ( $notifications = bp_core_get_notifications_for_user( bp_loggedin_user_id() ) ) { ?>
 		<span><?php echo count( $notifications ) ?></span>
 	<?php
 	}
@@ -31,7 +42,7 @@ function bp_adminbar_notifications_menu() {
 		}
 	} else { ?>
 
-		<li><a href="<?php echo $bp->loggedin_user->domain ?>"><?php _e( 'No new notifications.', 'buddypress' ); ?></a></li>
+		<li><a href="<?php echo bp_loggedin_user_domain() ?>"><?php _e( 'No new notifications.', 'buddypress' ); ?></a></li>
 
 	<?php
 	}
@@ -41,9 +52,11 @@ function bp_adminbar_notifications_menu() {
 }
 add_action( 'bp_adminbar_menus', 'bp_adminbar_notifications_menu', 8 );
 
-// **** "Blog Authors" Menu (visible when not logged in) ********
+/**
+ * Blog Authors Menu (visible when not logged in)
+ */
 function bp_adminbar_authors_menu() {
-	global $bp, $wpdb;
+	global $wpdb;
 
 	// Only for multisite
 	if ( !is_multisite() )
@@ -63,13 +76,19 @@ function bp_adminbar_authors_menu() {
 		echo '</a>';
 
 		echo '<ul class="author-list">';
-		foreach( (array)$authors as $author ) {
+		foreach( (array) $authors as $author ) {
 			$caps = maybe_unserialize( $author->caps );
 			if ( isset( $caps['subscriber'] ) || isset( $caps['contributor'] ) ) continue;
 
 			echo '<li>';
 			echo '<a href="' . bp_core_get_user_domain( $author->user_id, $author->user_nicename, $author->user_login ) . '">';
-			echo bp_core_fetch_avatar( array( 'item_id' => $author->user_id, 'email' => $author->user_email, 'width' => 15, 'height' => 15 ) ) ;
+			echo bp_core_fetch_avatar( array( 
+				'item_id' => $author->user_id, 
+				'email'   => $author->user_email, 
+				'width'   => 15, 
+				'height'  => 15, 
+				'alt'     => sprintf( __( 'Profile picture of %s', 'buddypress' ), $author->display_name )
+			) );
  			echo ' ' . $author->display_name . '</a>';
 			echo '<div class="admin-bar-clear"></div>';
 			echo '</li>';
@@ -81,17 +100,15 @@ function bp_adminbar_authors_menu() {
 add_action( 'bp_adminbar_menus', 'bp_adminbar_authors_menu', 12 );
 
 /**
- * Adds an admin bar menu to any profile page providing site moderator actions
+ * Adds an Toolbar menu to any profile page providing site moderator actions
  * that allow capable users to clean up a users account.
  *
  * @package BuddyPress XProfile
- * @global $bp BuddyPress
  */
 function bp_members_adminbar_admin_menu() {
-	global $bp;
 
 	// Only show if viewing a user
-	if ( !$bp->displayed_user->id )
+	if ( !bp_displayed_user_id() )
 		return false;
 
 	// Don't show this menu to non site admins or if you're viewing your own profile
@@ -105,23 +122,23 @@ function bp_members_adminbar_admin_menu() {
 		<ul>
 			<?php if ( bp_is_active( 'xprofile' ) ) : ?>
 
-				<li><a href="<?php bp_members_component_link( 'profile', 'edit' ); ?>"><?php printf( __( "Edit %s's Profile", 'buddypress' ), esc_attr( $bp->displayed_user->fullname ) ) ?></a></li>
+				<li><a href="<?php bp_members_component_link( 'profile', 'edit' ); ?>"><?php printf( __( "Edit %s's Profile", 'buddypress' ), esc_attr( bp_get_displayed_user_fullname() ) ) ?></a></li>
 
 			<?php endif ?>
 
-			<li><a href="<?php bp_members_component_link( 'profile', 'change-avatar' ); ?>"><?php printf( __( "Edit %s's Avatar", 'buddypress' ), esc_attr( $bp->displayed_user->fullname ) ) ?></a></li>
+			<li><a href="<?php bp_members_component_link( 'profile', 'change-avatar' ); ?>"><?php printf( __( "Edit %s's Avatar", 'buddypress' ), esc_attr( bp_get_displayed_user_fullname() ) ) ?></a></li>
 
-			<?php if ( !bp_core_is_user_spammer( $bp->displayed_user->id ) ) : ?>
+			<?php if ( !bp_is_user_spammer( bp_displayed_user_id() ) ) : ?>
 
-				<li><a href="<?php echo wp_nonce_url( $bp->displayed_user->domain . 'admin/mark-spammer/', 'mark-unmark-spammer' ) ?>" class="confirm"><?php printf( __( "Mark as Spammer", 'buddypress' ), esc_attr( $bp->displayed_user->fullname ) ); ?></a></li>
+				<li><a href="<?php echo wp_nonce_url( bp_displayed_user_domain() . 'admin/mark-spammer/', 'mark-unmark-spammer' ) ?>" class="confirm"><?php printf( __( "Mark as Spammer", 'buddypress' ), esc_attr( bp_get_displayed_user_fullname() ) ); ?></a></li>
 
 			<?php else : ?>
 
-				<li><a href="<?php echo wp_nonce_url( $bp->displayed_user->domain . 'admin/unmark-spammer/', 'mark-unmark-spammer' ) ?>" class="confirm"><?php _e( "Not a Spammer", 'buddypress' ) ?></a></li>
+				<li><a href="<?php echo wp_nonce_url( bp_displayed_user_domain() . 'admin/unmark-spammer/', 'mark-unmark-spammer' ) ?>" class="confirm"><?php _e( "Not a Spammer", 'buddypress' ) ?></a></li>
 
 			<?php endif; ?>
 
-			<li><a href="<?php echo wp_nonce_url( $bp->displayed_user->domain . 'admin/delete-user/', 'delete-user' ) ?>" class="confirm"><?php printf( __( "Delete %s's Account", 'buddypress' ), esc_attr( $bp->displayed_user->fullname ) ); ?></a></li>
+			<li><a href="<?php echo wp_nonce_url( bp_displayed_user_domain() . 'admin/delete-user/', 'delete-user' ) ?>" class="confirm"><?php printf( __( "Delete %s's Account", 'buddypress' ), esc_attr( bp_get_displayed_user_fullname() ) ); ?></a></li>
 
 			<?php do_action( 'bp_members_adminbar_admin_menu' ) ?>
 
@@ -132,4 +149,4 @@ function bp_members_adminbar_admin_menu() {
 }
 add_action( 'bp_adminbar_menus', 'bp_members_adminbar_admin_menu', 20 );
 
-?>
\ No newline at end of file
+?>
diff --git a/wp-content/plugins/buddypress/bp-members/bp-members-filters.php b/wp-content/plugins/buddypress/bp-members/bp-members-filters.php
index 1601fb097861c8405bf4475cbfbf9f3d69ef2e85..7d4e5847bf5373d08ed5ed8b0726831739153098 100644
--- a/wp-content/plugins/buddypress/bp-members/bp-members-filters.php
+++ b/wp-content/plugins/buddypress/bp-members/bp-members-filters.php
@@ -1,23 +1,30 @@
 <?php
+
 /**
  * BuddyPress Members Filters
  *
  * Member specific filters
  *
  * @package BuddyPress
- * @subpackage Member Core
+ * @subpackage MembersFilters
  */
 
 // Exit if accessed directly
 if ( !defined( 'ABSPATH' ) ) exit;
 
+/**
+ * Escape commonly used fullname output functions
+ */
+add_filter( 'bp_displayed_user_fullname',    'esc_html' );
+add_filter( 'bp_get_loggedin_user_fullname', 'esc_html' );
+
 /**
  * Load additional sign-up sanitization filters on bp_loaded. These are used
  * to prevent XSS in the BuddyPress sign-up process. You can unhook these to
  * allow for customization of your registration fields, however it is highly
  * recommended that you leave these in place for the safety of your network.
  *
- * @since BuddyPress (r4079)
+ * @since BuddyPress (1.5)
  * @uses add_filter()
  */
 function bp_members_signup_sanitization() {
@@ -48,7 +55,7 @@ add_action( 'bp_loaded', 'bp_members_signup_sanitization' );
 /**
  * Filter the user profile URL to point to BuddyPress profile edit
  *
- * @since BuddyPress 1.5.2
+ * @since BuddyPress 1.6
  *
  * @global BuddyPress $bp
  * @param string $url
@@ -72,4 +79,4 @@ function bp_members_edit_profile_url( $url, $user_id, $scheme = 'admin' ) {
 }
 add_filter( 'edit_profile_url', 'bp_members_edit_profile_url', 10, 3 );
 
-?>
\ No newline at end of file
+?>
diff --git a/wp-content/plugins/buddypress/bp-members/bp-members-functions.php b/wp-content/plugins/buddypress/bp-members/bp-members-functions.php
index a259d0a71f5dd59a16ab18cabbea7e9dfab4ec73..65d3a65eabbb4aed25bfdbfe8fd823e064548d16 100644
--- a/wp-content/plugins/buddypress/bp-members/bp-members-functions.php
+++ b/wp-content/plugins/buddypress/bp-members/bp-members-functions.php
@@ -1,11 +1,12 @@
 <?php
+
 /**
  * BuddyPress Member Functions
  *
  * Functions specific to the members component.
  *
  * @package BuddyPress
- * @subpackage Members
+ * @subpackage MembersFunctions
  */
 
 // Exit if accessed directly
@@ -14,9 +15,9 @@ if ( !defined( 'ABSPATH' ) ) exit;
 /**
  * Checks $bp pages global and looks for directory page
  *
- * @since 1.5
+ * @since BuddyPress (1.5)
  *
- * @global object $bp Global BuddyPress settings object
+ * @global BuddyPress $bp The one true BuddyPress instance
  * @return bool True if set, False if empty
  */
 function bp_members_has_directory() {
@@ -33,34 +34,39 @@ function bp_members_has_directory() {
  * explicitly defined.
  *
  * @package BuddyPress Core Core
- * @global object $bp Global BuddyPress settings object
+ * @global BuddyPress $bp The one true BuddyPress instance
  */
 function bp_core_define_slugs() {
 	global $bp;
 
 	// No custom members slug
-	if ( !defined( 'BP_MEMBERS_SLUG' ) )
-		if ( !empty( $bp->pages->members ) )
+	if ( !defined( 'BP_MEMBERS_SLUG' ) ) {
+		if ( !empty( $bp->pages->members ) ) {
 			define( 'BP_MEMBERS_SLUG', $bp->pages->members->slug );
-		else
+		} else {
 			define( 'BP_MEMBERS_SLUG', 'members' );
+		}
+	}
 
 	// No custom registration slug
-	if ( !defined( 'BP_REGISTER_SLUG' ) )
-		if ( !empty( $bp->pages->register ) )
+	if ( !defined( 'BP_REGISTER_SLUG' ) ) {
+		if ( !empty( $bp->pages->register ) ) {
 			define( 'BP_REGISTER_SLUG', $bp->pages->register->slug );
-		else
+		} else {
 			define( 'BP_REGISTER_SLUG', 'register' );
+		}
+	}
 
 	// No custom activation slug
-	if ( !defined( 'BP_ACTIVATION_SLUG' ) )
-		if ( !empty( $bp->pages->activate ) )
+	if ( !defined( 'BP_ACTIVATION_SLUG' ) ) {
+		if ( !empty( $bp->pages->activate ) ) {
 			define( 'BP_ACTIVATION_SLUG', $bp->pages->activate->slug );
-		else
+		} else {
 			define( 'BP_ACTIVATION_SLUG', 'activate' );
-
+		}
+	}
 }
-add_action( 'bp_setup_globals', 'bp_core_define_slugs' );
+add_action( 'bp_setup_globals', 'bp_core_define_slugs', 11 );
 
 /**
  * Return an array of users IDs based on the parameters passed.
@@ -68,7 +74,6 @@ add_action( 'bp_setup_globals', 'bp_core_define_slugs' );
  * @package BuddyPress Core
  */
 function bp_core_get_users( $args = '' ) {
-	global $bp;
 
 	$defaults = array(
 		'type'            => 'active', // active, newest, alphabetical, random or popular
@@ -98,7 +103,6 @@ function bp_core_get_users( $args = '' ) {
  * @param user_id The ID of the user.
  */
 function bp_core_get_user_domain( $user_id, $user_nicename = false, $user_login = false ) {
-	global $bp;
 
 	if ( empty( $user_id ) )
 		return;
@@ -109,18 +113,14 @@ function bp_core_get_user_domain( $user_id, $user_nicename = false, $user_login
 		if ( bp_is_username_compatibility_mode() )
 			$username = rawurlencode( $username );
 
-		// If we are using a members slug, include it.
-		if ( !defined( 'BP_ENABLE_ROOT_PROFILES' ) )
-			$domain = bp_get_root_domain() . '/' . bp_get_members_root_slug() . '/' . $username;
-		else
-			$domain = bp_get_root_domain() . '/' . $username;
-
-		// Add a slash at the end, and filter before caching
-		$domain = apply_filters( 'bp_core_get_user_domain_pre_cache', trailingslashit( $domain ), $user_id, $user_nicename, $user_login );
+		$after_domain = bp_core_enable_root_profiles() ? $username : bp_get_members_root_slug() . '/' . $username;
+		$domain       = trailingslashit( bp_get_root_domain() . '/' . $after_domain );
+		$domain       = apply_filters( 'bp_core_get_user_domain_pre_cache', $domain, $user_id, $user_nicename, $user_login );
 
 		// Cache the link
-		if ( !empty( $domain ) )
+		if ( !empty( $domain ) ) {
 			wp_cache_set( 'bp_user_domain_' . $user_id, $domain, 'bp' );
+		}
 	}
 
 	return apply_filters( 'bp_core_get_user_domain', $domain, $user_id, $user_nicename, $user_login );
@@ -206,6 +206,7 @@ function bp_core_get_username( $user_id, $user_nicename = false, $user_login = f
 	global $bp;
 
 	if ( !$username = wp_cache_get( 'bp_user_username_' . $user_id, 'bp' ) ) {
+
 		// Cache not found so prepare to update it
 		$update_cache = true;
 
@@ -213,11 +214,11 @@ function bp_core_get_username( $user_id, $user_nicename = false, $user_login = f
 		if ( empty( $user_nicename ) && empty( $user_login ) ) {
 
 			// User ID matches logged in user
-			if ( isset( $bp->loggedin_user->id ) && $bp->loggedin_user->id == $user_id ) {
+			if ( bp_loggedin_user_id() == $user_id ) {
 				$userdata = &$bp->loggedin_user->userdata;
 
 			// User ID matches displayed in user
-			} elseif ( isset( $bp->displayed_user->id ) && $bp->displayed_user->id == $user_id ) {
+			} elseif ( bp_displayed_user_id() == $user_id ) {
 				$userdata = &$bp->displayed_user->userdata;
 
 			// No user ID match
@@ -242,11 +243,8 @@ function bp_core_get_username( $user_id, $user_nicename = false, $user_login = f
 			$user_login    = $userdata->user_login;
 		}
 
-		// Pull an audible and use the login over the nicename
-		if ( bp_is_username_compatibility_mode() )
-			$username = $user_login;
-		else
-			$username = $user_nicename;
+		// Pull an audible and maybe use the login over the nicename
+		$username = bp_is_username_compatibility_mode() ? $user_login : $user_nicename;
 
 	// Username found in cache so don't update it again
 	} else {
@@ -285,11 +283,11 @@ function bp_members_get_user_nicename( $user_id ) {
 		$update_cache = true;
 
 		// User ID matches logged in user
-		if ( isset( $bp->loggedin_user->id ) && $bp->loggedin_user->id == $user_id ) {
+		if ( bp_loggedin_user_id() == $user_id ) {
 			$userdata = &$bp->loggedin_user->userdata;
 
 		// User ID matches displayed in user
-		} elseif ( isset( $bp->displayed_user->id ) && $bp->displayed_user->id == $user_id ) {
+		} elseif ( bp_displayed_user_id() == $user_id ) {
 			$userdata = &$bp->displayed_user->userdata;
 
 		// No user ID match
@@ -331,6 +329,7 @@ function bp_members_get_user_nicename( $user_id ) {
  * @return str The email for the matched user.
  */
 function bp_core_get_user_email( $uid ) {
+
 	if ( !$email = wp_cache_get( 'bp_user_email_' . $uid, 'bp' ) ) {
 		// User exists
 		if ( $ud = bp_core_get_core_userdata( $uid ) )
@@ -382,7 +381,7 @@ function bp_core_get_userlink( $user_id, $no_anchor = false, $just_link = false
  * Otherwise, it will fall back to the normal WP display_name, or user_nicename, depending on what has been set.
  *
  * @package BuddyPress Core
- * @global object $bp Global BuddyPress settings object
+ * @global BuddyPress $bp The one true BuddyPress instance
  * @uses wp_cache_get() Will try and fetch the value from the cache, rather than querying the DB again.
  * @uses get_userdata() Fetches the WP userdata for a specific user.
  * @uses xprofile_set_field_data() Will update the field data for a user based on field name and user id.
@@ -407,7 +406,7 @@ function bp_core_get_user_displayname( $user_id_or_username ) {
 
 	if ( !$fullname = wp_cache_get( 'bp_user_fullname_' . $user_id, 'bp' ) ) {
 		if ( bp_is_active( 'xprofile' ) ) {
-			$fullname = xprofile_get_field_data( stripslashes( $bp->site_options['bp-xprofile-fullname-field-name'] ), $user_id );
+			$fullname = xprofile_get_field_data( 1, $user_id );
 
 			if ( empty($fullname) ) {
 				$ud = bp_core_get_core_userdata( $user_id );
@@ -437,7 +436,7 @@ function bp_core_get_user_displayname( $user_id_or_username ) {
 add_filter( 'bp_core_get_user_displayname', 'strip_tags', 1 );
 add_filter( 'bp_core_get_user_displayname', 'trim'          );
 add_filter( 'bp_core_get_user_displayname', 'stripslashes'  );
-
+add_filter( 'bp_core_get_user_displayname', 'esc_html'      );
 
 /**
  * Returns the user link for the user based on user email address
@@ -475,17 +474,153 @@ function bp_core_get_userlink_by_username( $username ) {
  * @return int The total number of members.
  */
 function bp_core_get_total_member_count() {
-	global $wpdb, $bp;
+	global $wpdb;
 
 	if ( !$count = wp_cache_get( 'bp_total_member_count', 'bp' ) ) {
 		$status_sql = bp_core_get_status_sql();
-		$count = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(ID) FROM $wpdb->users WHERE {$status_sql}" ) );
+		$count = $wpdb->get_var( "SELECT COUNT(ID) FROM $wpdb->users WHERE {$status_sql}" );
 		wp_cache_set( 'bp_total_member_count', $count, 'bp' );
 	}
 
 	return apply_filters( 'bp_core_get_total_member_count', $count );
 }
 
+/**
+ * Returns the total number of members, limited to those members with last_activity
+ *
+ * @return int The number of active members
+ */
+function bp_core_get_active_member_count() {
+	global $wpdb;
+
+	if ( !$count = get_transient( 'bp_active_member_count' ) ) {
+		// Avoid a costly join by splitting the lookup
+		if ( is_multisite() ) {
+			$sql = "SELECT ID FROM $wpdb->users WHERE (user_status != 0 OR deleted != 0 OR user_status != 0)";
+		} else {
+			$sql = "SELECT ID FROM $wpdb->users WHERE user_status != 0";
+		}
+
+		$exclude_users = $wpdb->get_col( $sql );
+		$exclude_users_sql = !empty( $exclude_users ) ? "AND user_id NOT IN (" . implode( ',', wp_parse_id_list( $exclude_users ) ) . ")" : '';
+
+		$count = (int) $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(user_id) FROM {$wpdb->usermeta} WHERE meta_key = %s {$exclude_users_sql}", bp_get_user_meta_key( 'last_activity' ) ) );
+		set_transient( 'bp_active_member_count', $count );
+	}
+
+	return apply_filters( 'bp_core_get_active_member_count', $count );
+}
+
+/**
+ * Processes a spammed or unspammed user
+ *
+ * This function is called in three ways:
+ *  - in bp_settings_action_capabilities() (from the front-end)
+ *  - by bp_core_mark_user_spam_admin()    (from wp-admin)
+ *  - bp_core_mark_user_ham_admin()        (from wp-admin)
+ *
+ * @since BuddyPress (1.6)
+ *
+ * @param int $user_id The user being spammed/hammed
+ * @param string $status 'spam' if being marked as spam, 'ham' otherwise
+ */
+function bp_core_process_spammer_status( $user_id, $status ) {
+	global $wpdb;
+
+	// Only super admins can currently spam users
+	if ( !is_super_admin() || bp_is_my_profile() )
+		return;
+
+	// Bail if no user ID
+	if ( empty( $user_id ) )
+		return;
+
+	// Bail if user ID is super admin
+	if ( is_super_admin( $user_id ) )
+		return;
+
+	// Get the functions file
+	if ( is_multisite() ) {
+		require_once( ABSPATH . 'wp-admin/includes/ms.php' );
+	}
+
+	$is_spam = ( 'spam' == $status );
+
+	// Only you can prevent infinite loops
+	remove_action( 'make_spam_user', 'bp_core_mark_user_spam_admin' );
+	remove_action( 'make_ham_user',  'bp_core_mark_user_ham_admin'  );
+
+	// When marking as spam in the Dashboard, these actions are handled by WordPress
+	if ( !is_admin() ) {
+
+		// Get the blogs for the user
+		$blogs = get_blogs_of_user( $user_id, true );
+
+		foreach ( (array) $blogs as $key => $details ) {
+
+			// Do not mark the main or current root blog as spam
+			if ( 1 == $details->userblog_id || bp_get_root_blog_id() == $details->userblog_id ) {
+				continue;
+			}
+
+			// Update the blog status
+			update_blog_status( $details->userblog_id, 'spam', $is_spam );
+		}
+
+		// Finally, mark this user as a spammer
+		if ( is_multisite() ) {
+			update_user_status( $user_id, 'spam', $is_spam );
+		}
+
+		// Always set single site status
+		$wpdb->update( $wpdb->users, array( 'user_status' => $is_spam ), array( 'ID' => $user_id ) );
+
+		// Call multisite actions in single site mode for good measure
+		if ( !is_multisite() ) {
+			$wp_action = ( true === $is_spam ) ? 'make_spam_user' : 'make_ham_user';
+			do_action( $wp_action, bp_displayed_user_id() );
+		}
+	}
+
+	// Hide this user's activity
+	if ( ( true === $is_spam ) && bp_is_active( 'activity' ) ) {
+		bp_activity_hide_user_activity( $user_id );
+	}
+
+	// We need a special hook for is_spam so that components can delete data at spam time
+	$bp_action = ( true === $is_spam ) ? 'bp_make_spam_user' : 'bp_make_ham_user';
+	do_action( $bp_action, $user_id );
+
+	// Allow plugins to do neat things
+	do_action( 'bp_core_process_spammer_status', $user_id, $is_spam );
+
+	return true;
+}
+
+/**
+ * Hook to WP's make_spam_user and run our custom BP spam functions
+ *
+ * @since BuddyPress (1.6)
+ *
+ * @param int $user_id The user id passed from the make_spam_user hook
+ */
+function bp_core_mark_user_spam_admin( $user_id ) {
+	bp_core_process_spammer_status( $user_id, 'spam' );
+}
+add_action( 'make_spam_user', 'bp_core_mark_user_spam_admin' );
+
+/**
+ * Hook to WP's make_ham_user and run our custom BP spam functions
+ *
+ * @since BuddyPress (1.6)
+ *
+ * @param int $user_id The user id passed from the make_ham_user hook
+ */
+function bp_core_mark_user_ham_admin( $user_id ) {
+	bp_core_process_spammer_status( $user_id, 'ham' );
+}
+add_action( 'make_ham_user', 'bp_core_mark_user_ham_admin' );
+
 /**
  * Checks if the user has been marked as a spammer.
  *
@@ -493,8 +628,7 @@ function bp_core_get_total_member_count() {
  * @param int $user_id int The id for the user.
  * @return bool True if spammer, False if not.
  */
-function bp_core_is_user_spammer( $user_id = 0 ) {
-	global $wpdb;
+function bp_is_user_spammer( $user_id = 0 ) {
 
 	// No user to check
 	if ( empty( $user_id ) )
@@ -521,7 +655,7 @@ function bp_core_is_user_spammer( $user_id = 0 ) {
 			$is_spammer = true;
 	}
 
-	return apply_filters( 'bp_core_is_user_spammer', (bool) $is_spammer );
+	return apply_filters( 'bp_is_user_spammer', (bool) $is_spammer );
 }
 
 /**
@@ -531,8 +665,7 @@ function bp_core_is_user_spammer( $user_id = 0 ) {
  * @param int $user_id int The id for the user.
  * @return bool True if deleted, False if not.
  */
-function bp_core_is_user_deleted( $user_id = 0 ) {
-	global $wpdb;
+function bp_is_user_deleted( $user_id = 0 ) {
 
 	// No user to check
 	if ( empty( $user_id ) )
@@ -560,65 +693,124 @@ function bp_core_is_user_deleted( $user_id = 0 ) {
 
 	}
 
-	return apply_filters( 'bp_core_is_user_deleted', (bool) $is_deleted );
+	return apply_filters( 'bp_is_user_deleted', (bool) $is_deleted );
+}
+
+/**
+ * Checks if user is active
+ *
+ * @since BuddyPress (1.6)
+ *
+ * @uses is_user_logged_in() To check if user is logged in
+ * @uses bp_loggedin_user_id() To get current user ID
+ * @uses bp_is_user_spammer() To check if user is spammer
+ * @uses bp_is_user_deleted() To check if user is deleted
+ *
+ * @param int $user_id The user ID to check
+ * @return bool True if public, false if not
+ */
+function bp_is_user_active( $user_id = 0 ) {
+
+	// Default to current user
+	if ( empty( $user_id ) && is_user_logged_in() )
+		$user_id = bp_loggedin_user_id();
+
+	// No user to check
+	if ( empty( $user_id ) )
+		return false;
+
+	// Check spam
+	if ( bp_is_user_spammer( $user_id ) )
+		return false;
+
+	// Check deleted
+	if ( bp_is_user_deleted( $user_id ) )
+		return false;
+
+	// Assume true if not spam or deleted
+	return true;
+}
+
+/**
+ * Checks if user is not active.
+ *
+ * @since BuddyPress (1.6)
+ *
+ * @uses is_user_logged_in() To check if user is logged in
+ * @uses bp_get_displayed_user_id() To get current user ID
+ * @uses bp_is_user_active() To check if user is active
+ *
+ * @param int $user_id The user ID to check
+ * @return bool True if inactive, false if active
+ */
+function bp_is_user_inactive( $user_id = 0 ) {
+
+	// Default to current user
+	if ( empty( $user_id ) && is_user_logged_in() )
+		$user_id = bp_loggedin_user_id();
+
+	// No user to check
+	if ( empty( $user_id ) )
+		return false;
+
+	// Return the inverse of active
+	return !bp_is_user_active( $user_id );
 }
 
 /**
  * Fetch every post that is authored by the given user for the current blog.
  *
  * @package BuddyPress Core
- * @global object $bp Global BuddyPress settings object
  * @global $wpdb WordPress user data for the current logged in user.
  * @return array of post ids.
  */
 function bp_core_get_all_posts_for_user( $user_id = 0 ) {
-	global $bp, $wpdb;
+	global $wpdb;
 
 	if ( empty( $user_id ) )
-		$user_id = $bp->displayed_user->id;
+		$user_id = bp_displayed_user_id();
 
-	return apply_filters( 'bp_core_get_all_posts_for_user', $wpdb->get_col( $wpdb->prepare( "SELECT ID FROM $wpdb->posts WHERE post_author = %d AND post_status = 'publish' AND post_type = 'post'", $user_id ) ) );
+	return apply_filters( 'bp_core_get_all_posts_for_user', $wpdb->get_col( $wpdb->prepare( "SELECT ID FROM {$wpdb->posts} WHERE post_author = %d AND post_status = 'publish' AND post_type = 'post'", $user_id ) ) );
 }
 
 /**
  * Allows a user to completely remove their account from the system
  *
  * @package BuddyPress Core
- * @global object $bp Global BuddyPress settings object
- * @uses is_super_admin() Checks to see if the user is a site administrator.
  * @uses wpmu_delete_user() Deletes a user from the system on multisite installs.
  * @uses wp_delete_user() Deletes a user from the system on singlesite installs.
  */
 function bp_core_delete_account( $user_id = 0 ) {
-	global $bp, $wp_version;
 
-	if ( !$user_id )
-		$user_id = $bp->loggedin_user->id;
+	if ( empty( $user_id ) )
+		$user_id = bp_loggedin_user_id();
 
 	// Make sure account deletion is not disabled
-	if ( !empty( $bp->site_options['bp-disable-account-deletion'] ) && !$bp->loggedin_user->is_super_admin )
+	if ( !bp_current_user_can( 'delete_users' ) && bp_disable_account_deletion() )
 		return false;
 
 	// Site admins cannot be deleted
-	if ( is_super_admin( bp_core_get_username( $user_id ) ) )
+	if ( is_super_admin( $user_id ) )
 		return false;
 
+	do_action( 'bp_core_pre_delete_account', $user_id );
+
 	// Specifically handle multi-site environment
 	if ( is_multisite() ) {
-		if ( $wp_version >= '3.0' )
-			require( ABSPATH . '/wp-admin/includes/ms.php' );
-		else
-			require( ABSPATH . '/wp-admin/includes/mu.php' );
-
+		require( ABSPATH . '/wp-admin/includes/ms.php'   );
 		require( ABSPATH . '/wp-admin/includes/user.php' );
 
-		return wpmu_delete_user( $user_id );
+		$retval = wpmu_delete_user( $user_id );
 
 	// Single site user deletion
 	} else {
 		require( ABSPATH . '/wp-admin/includes/user.php' );
-		return wp_delete_user( $user_id );
+		$retval = wp_delete_user( $user_id );
 	}
+
+	do_action( 'bp_core_deleted_account', $user_id );
+
+	return $retval;
 }
 
 /**
@@ -654,25 +846,25 @@ add_action( 'pre_user_login', 'bp_core_strip_username_spaces' );
  * When a user logs in, check if they have been marked as a spammer. If yes then simply
  * redirect them to the home page and stop them from logging in.
  *
- * @package BuddyPress Core
- * @param $auth_obj The WP authorization object
- * @param $username The username of the user logging in.
- * @uses get_user_by() Get the userdata object for a user based on their username
- * @uses bp_core_redirect() Safe redirect to a page
- * @return $auth_obj If the user is not a spammer, return the authorization object
+ * @param obj $user Either the WP_User object or the WP_Error object
+ * @return obj If the user is not a spammer, return the WP_User object. Otherwise a new WP_Error object.
+ *
+ * @since 1.1.2
  */
-function bp_core_boot_spammer( $auth_obj, $username ) {
-	global $bp;
-
-	if ( !$user = get_user_by( 'login',  $username ) )
-		return $auth_obj;
-
-	if ( ( is_multisite() && (int)$user->spam ) || 1 == (int)$user->user_status )
+function bp_core_boot_spammer( $user ) {
+	// check to see if the $user has already failed logging in, if so return $user as-is
+	if ( is_wp_error( $user ) || empty( $user ) )
+		return $user;
+
+	// the user exists; now do a check to see if the user is a spammer
+	// if the user is a spammer, stop them in their tracks!
+	if ( is_a( $user, 'WP_User' ) && ( ( is_multisite() && (int) $user->spam ) || 1 == $user->user_status ) )
 		return new WP_Error( 'invalid_username', __( '<strong>ERROR</strong>: Your account has been marked as a spammer.', 'buddypress' ) );
-	else
-		return $auth_obj;
+
+	// user is good to go!
+	return $user;
 }
-add_filter( 'authenticate', 'bp_core_boot_spammer', 30, 2 );
+add_filter( 'authenticate', 'bp_core_boot_spammer', 30 );
 
 /**
  * Deletes usermeta for the user when the user is deleted.
@@ -682,6 +874,7 @@ add_filter( 'authenticate', 'bp_core_boot_spammer', 30, 2 );
  * @uses bp_delete_user_meta() deletes a row from the wp_usermeta table based on meta_key
  */
 function bp_core_remove_data( $user_id ) {
+
 	// Remove usermeta
 	bp_delete_user_meta( $user_id, 'last_activity' );
 
@@ -696,10 +889,484 @@ function bp_core_can_edit_settings() {
 	if ( bp_is_my_profile() )
 		return true;
 
-	if ( is_super_admin() || current_user_can( 'edit_users' ) )
+	if ( bp_current_user_can( 'bp_moderate' ) || current_user_can( 'edit_users' ) )
 		return true;
 
 	return false;
 }
 
-?>
\ No newline at end of file
+/** Sign-up *******************************************************************/
+
+/**
+ * Flush illegal names by getting and setting 'illegal_names' site option
+ */
+function bp_core_flush_illegal_names() {
+	$illegal_names = get_site_option( 'illegal_names' );
+	update_site_option( 'illegal_names', $illegal_names );
+}
+
+/**
+ * Filter the illegal_names site option and make sure it includes a few
+ * specific BuddyPress and Multi-site slugs
+ *
+ * @param array|string $value Illegal names from field
+ * @param array|string $oldvalue The value as it is currently
+ * @return array Merged and unique array of illegal names
+ */
+function bp_core_get_illegal_names( $value = '', $oldvalue = '' ) {
+
+	// Make sure $value is array
+	if ( empty( $value ) )
+		$db_illegal_names = array();
+	if ( is_array( $value ) )
+		$db_illegal_names = $value;
+	elseif ( is_string( $value ) )
+		$db_illegal_names = explode( ' ', $value );
+
+	// Add the core components' slugs to the banned list even if their components aren't active.
+	$bp_component_slugs = array(
+		'groups',
+		'members',
+		'forums',
+		'blogs',
+		'activity',
+		'profile',
+		'friends',
+		'search',
+		'settings',
+		'register',
+		'activate'
+	);
+
+	// Core constants
+	$slug_constants = array(
+		'BP_GROUPS_SLUG',
+		'BP_MEMBERS_SLUG',
+		'BP_FORUMS_SLUG',
+		'BP_BLOGS_SLUG',
+		'BP_ACTIVITY_SLUG',
+		'BP_XPROFILE_SLUG',
+		'BP_FRIENDS_SLUG',
+		'BP_SEARCH_SLUG',
+		'BP_SETTINGS_SLUG',
+		'BP_REGISTER_SLUG',
+		'BP_ACTIVATION_SLUG',
+	);
+	foreach( $slug_constants as $constant )
+		if ( defined( $constant ) )
+			$bp_component_slugs[] = constant( $constant );
+
+	// Add our slugs to the array and allow them to be filtered
+	$filtered_illegal_names = apply_filters( 'bp_core_illegal_usernames', array_merge( array( 'www', 'web', 'root', 'admin', 'main', 'invite', 'administrator' ), $bp_component_slugs ) );
+
+	// Merge the arrays together
+	$merged_names           = array_merge( (array) $filtered_illegal_names, (array) $db_illegal_names );
+
+	// Remove duplicates
+	$illegal_names          = array_unique( (array) $merged_names );
+
+	return apply_filters( 'bp_core_illegal_names', $illegal_names );
+}
+add_filter( 'pre_update_site_option_illegal_names', 'bp_core_get_illegal_names', 10, 2 );
+
+/**
+ * Check that an email address is valid for use
+ *
+ * Performs the following checks:
+ *   - Is the email address well-formed?
+ *   - Is the email address already used?
+ *   - If there's an email domain blacklist, is the current domain on it?
+ *   - If there's an email domain whitelest, is the current domain on it?
+ *
+ * @since 1.6.2
+ *
+ * @param string $user_email The email being checked
+ * @return bool|array True if the address passes all checks; otherwise an array
+ *   of error codes
+ */
+function bp_core_validate_email_address( $user_email ) {
+	$errors = array();
+
+	$user_email = sanitize_email( $user_email );
+
+	// Is the email well-formed?
+	if ( ! is_email( $user_email ) )
+		$errors['invalid'] = 1;
+
+	// Is the email on the Banned Email Domains list?
+	// Note: This check only works on Multisite
+	if ( function_exists( 'is_email_address_unsafe' ) && is_email_address_unsafe( $user_email ) )
+		$errors['domain_banned'] = 1;
+
+	// Is the email on the Limited Email Domains list?
+	// Note: This check only works on Multisite
+	$limited_email_domains = get_site_option( 'limited_email_domains' );
+	if ( is_array( $limited_email_domains ) && empty( $limited_email_domains ) == false ) {
+		$emaildomain = substr( $user_email, 1 + strpos( $user_email, '@' ) );
+		if ( ! in_array( $emaildomain, $limited_email_domains ) ) {
+			$errors['domain_not_allowed'] = 1;
+		}
+	}
+
+	// Is the email alreday in use?
+	if ( email_exists( $user_email ) )
+		$errors['in_use'] = 1;
+
+	$retval = ! empty( $errors ) ? $errors : true;
+
+	return apply_filters( 'bp_core_validate_email_address', $retval, $user_email );
+}
+
+/**
+ * Validate a user name and email address when creating a new user.
+ *
+ * @todo Refactor to use bp_core_validate_email_address()
+ *
+ * @param string $user_name Username to validate
+ * @param string $user_email Email address to validate
+ * @return array Results of user validation including errors, if any
+ */
+function bp_core_validate_user_signup( $user_name, $user_email ) {
+
+	$errors = new WP_Error();
+	$user_email = sanitize_email( $user_email );
+
+	// Apply any user_login filters added by BP or other plugins before validating
+	$user_name = apply_filters( 'pre_user_login', $user_name );
+
+	if ( empty( $user_name ) )
+		$errors->add( 'user_name', __( 'Please enter a username', 'buddypress' ) );
+
+	// Make sure illegal names include BuddyPress slugs and values
+	bp_core_flush_illegal_names();
+
+	$illegal_names = get_site_option( 'illegal_names' );
+
+	if ( !validate_username( $user_name ) || in_array( $user_name, (array) $illegal_names ) )
+		$errors->add( 'user_name', __( 'Only lowercase letters and numbers allowed', 'buddypress' ) );
+
+	if( strlen( $user_name ) < 4 )
+		$errors->add( 'user_name',  __( 'Username must be at least 4 characters', 'buddypress' ) );
+
+	if ( strpos( ' ' . $user_name, '_' ) != false )
+		$errors->add( 'user_name', __( 'Sorry, usernames may not contain the character "_"!', 'buddypress' ) );
+
+	// Is the user_name all numeric?
+	$match = array();
+	preg_match( '/[0-9]*/', $user_name, $match );
+
+	if ( $match[0] == $user_name )
+		$errors->add( 'user_name', __( 'Sorry, usernames must have letters too!', 'buddypress' ) );
+
+	if ( !is_email( $user_email ) )
+		$errors->add( 'user_email', __( 'Please check your email address.', 'buddypress' ) );
+
+	if ( function_exists( 'is_email_address_unsafe' ) && is_email_address_unsafe( $user_email ) )
+		$errors->add( 'user_email',  __( 'Sorry, that email address is not allowed!', 'buddypress' ) );
+
+	$limited_email_domains = get_site_option( 'limited_email_domains', 'buddypress' );
+
+	if ( is_array( $limited_email_domains ) && empty( $limited_email_domains ) == false ) {
+		$emaildomain = substr( $user_email, 1 + strpos( $user_email, '@' ) );
+
+		if ( in_array( $emaildomain, (array) $limited_email_domains ) == false )
+			$errors->add( 'user_email', __( 'Sorry, that email address is not allowed!', 'buddypress' ) );
+	}
+
+	// Check if the username has been used already.
+	if ( username_exists( $user_name ) )
+		$errors->add( 'user_name', __( 'Sorry, that username already exists!', 'buddypress' ) );
+
+	// Check if the email address has been used already.
+	if ( email_exists( $user_email ) )
+		$errors->add( 'user_email', __( 'Sorry, that email address is already used!', 'buddypress' ) );
+
+	$result = array( 'user_name' => $user_name, 'user_email' => $user_email, 'errors' => $errors );
+
+	// Apply WPMU legacy filter
+	$result = apply_filters( 'wpmu_validate_user_signup', $result );
+
+ 	return apply_filters( 'bp_core_validate_user_signup', $result );
+}
+
+function bp_core_validate_blog_signup( $blog_url, $blog_title ) {
+	if ( !is_multisite() || !function_exists( 'wpmu_validate_blog_signup' ) )
+		return false;
+
+	return apply_filters( 'bp_core_validate_blog_signup', wpmu_validate_blog_signup( $blog_url, $blog_title ) );
+}
+
+function bp_core_signup_user( $user_login, $user_password, $user_email, $usermeta ) {
+	global $bp, $wpdb;
+
+	// Multisite installs have their own install procedure
+	if ( is_multisite() ) {
+		wpmu_signup_user( $user_login, $user_email, $usermeta );
+
+		// On multisite, the user id is not created until the user activates the account
+		// but we need to cast $user_id to pass to the filters
+		$user_id = false;
+
+	} else {
+		$errors = new WP_Error();
+
+		$user_id = wp_insert_user( array(
+			'user_login' => $user_login,
+			'user_pass' => $user_password,
+			'display_name' => sanitize_title( $user_login ),
+			'user_email' => $user_email
+		) );
+
+		if ( is_wp_error( $user_id ) || empty( $user_id ) ) {
+			$errors->add( 'registerfail', sprintf( __('<strong>ERROR</strong>: Couldn&#8217;t register you... please contact the <a href="mailto:%s">webmaster</a> !', 'buddypress' ), bp_get_option( 'admin_email' ) ) );
+			return $errors;
+		}
+
+		// Update the user status to '2' which we will use as 'not activated' (0 = active, 1 = spam, 2 = not active)
+		$wpdb->query( $wpdb->prepare( "UPDATE {$wpdb->users} SET user_status = 2 WHERE ID = %d", $user_id ) );
+
+		// Set any profile data
+		if ( bp_is_active( 'xprofile' ) ) {
+			if ( !empty( $usermeta['profile_field_ids'] ) ) {
+				$profile_field_ids = explode( ',', $usermeta['profile_field_ids'] );
+
+				foreach( (array) $profile_field_ids as $field_id ) {
+					if ( empty( $usermeta["field_{$field_id}"] ) )
+						continue;
+
+					$current_field = $usermeta["field_{$field_id}"];
+					xprofile_set_field_data( $field_id, $user_id, $current_field );
+
+					// Save the visibility level
+					$visibility_level = !empty( $usermeta['field_' . $field_id . '_visibility'] ) ? $usermeta['field_' . $field_id . '_visibility'] : 'public';
+					xprofile_set_field_visibility_level( $field_id, $user_id, $visibility_level );
+				}
+			}
+		}
+	}
+	$bp->signup->username = $user_login;
+
+	/***
+	 * Now generate an activation key and send an email to the user so they can activate their
+	 * account and validate their email address. Multisite installs send their own email, so
+	 * this is only for single blog installs.
+	 *
+	 * To disable sending activation emails you can user the filter
+	 * 'bp_core_signup_send_activation_key' and return false. Note that this will only disable
+	 * the email - a key will still be generated, and the account must still be activated
+	 * before use.
+	 */
+	if ( !is_multisite() ) {
+		$activation_key = wp_hash( $user_id );
+		update_user_meta( $user_id, 'activation_key', $activation_key );
+
+		if ( apply_filters( 'bp_core_signup_send_activation_key', true ) ) {
+			bp_core_signup_send_validation_email( $user_id, $user_email, $activation_key );
+		}
+	}
+
+	do_action( 'bp_core_signup_user', $user_id, $user_login, $user_password, $user_email, $usermeta );
+
+	return $user_id;
+}
+
+function bp_core_signup_blog( $blog_domain, $blog_path, $blog_title, $user_name, $user_email, $usermeta ) {
+	if ( !is_multisite() || !function_exists( 'wpmu_signup_blog' ) )
+		return false;
+
+	return apply_filters( 'bp_core_signup_blog', wpmu_signup_blog( $blog_domain, $blog_path, $blog_title, $user_name, $user_email, $usermeta ) );
+}
+
+function bp_core_activate_signup( $key ) {
+	global $wpdb;
+
+	$user = false;
+
+	// Multisite installs have their own activation routine
+	if ( is_multisite() ) {
+		$user = wpmu_activate_signup( $key );
+
+		// If there were errors, add a message and redirect
+		if ( !empty( $user->errors ) ) {
+			return $user;
+		}
+
+		$user_id = $user['user_id'];
+
+		// Set any profile data
+		if ( bp_is_active( 'xprofile' ) ) {
+			if ( !empty( $user['meta']['profile_field_ids'] ) ) {
+				$profile_field_ids = explode( ',', $user['meta']['profile_field_ids'] );
+
+				foreach( (array) $profile_field_ids as $field_id ) {
+					$current_field = isset( $user['meta']["field_{$field_id}"] ) ? $user['meta']["field_{$field_id}"] : false;
+
+					if ( !empty( $current_field ) )
+						xprofile_set_field_data( $field_id, $user_id, $current_field );
+
+					// Save the visibility level
+					$visibility_level = !empty( $user['meta']['field_' . $field_id . '_visibility'] ) ? $user['meta']['field_' . $field_id . '_visibility'] : 'public';
+					xprofile_set_field_visibility_level( $field_id, $user_id, $visibility_level );
+				}
+			}
+		}
+	} else {
+
+		// Get the user_id based on the $key
+		$user_id = $wpdb->get_var( $wpdb->prepare( "SELECT user_id FROM {$wpdb->usermeta} WHERE meta_key = 'activation_key' AND meta_value = %s", $key ) );
+
+		if ( empty( $user_id ) )
+			return new WP_Error( 'invalid_key', __( 'Invalid activation key', 'buddypress' ) );
+
+		// Change the user's status so they become active
+		if ( !$wpdb->query( $wpdb->prepare( "UPDATE {$wpdb->users} SET user_status = 0 WHERE ID = %d", $user_id ) ) )
+			return new WP_Error( 'invalid_key', __( 'Invalid activation key', 'buddypress' ) );
+
+		// Notify the site admin of a new user registration
+		wp_new_user_notification( $user_id );
+
+		// Remove the activation key meta
+		delete_user_meta( $user_id, 'activation_key' );
+	}
+
+	// Update the display_name
+	wp_update_user( array( 'ID' => $user_id, 'display_name' => bp_core_get_user_displayname( $user_id ) ) );
+
+	// Set the password on multisite installs
+	if ( is_multisite() && !empty( $user['meta']['password'] ) )
+		$wpdb->query( $wpdb->prepare( "UPDATE {$wpdb->users} SET user_pass = %s WHERE ID = %d", $user['meta']['password'], $user_id ) );
+
+	do_action( 'bp_core_activated_user', $user_id, $key, $user );
+
+	return $user_id;
+}
+
+function bp_core_new_user_activity( $user ) {
+	if ( empty( $user ) || !bp_is_active( 'activity' ) )
+		return false;
+
+	if ( is_array( $user ) )
+		$user_id = $user['user_id'];
+	else
+		$user_id = $user;
+
+	if ( empty( $user_id ) )
+		return false;
+
+	$userlink = bp_core_get_userlink( $user_id );
+
+	bp_activity_add( array(
+		'user_id'   => $user_id,
+		'action'    => apply_filters( 'bp_core_activity_registered_member_action', sprintf( __( '%s became a registered member', 'buddypress' ), $userlink ), $user_id ),
+		'component' => 'xprofile',
+		'type'      => 'new_member'
+	) );
+}
+add_action( 'bp_core_activated_user', 'bp_core_new_user_activity' );
+
+function bp_core_map_user_registration( $user_id ) {
+
+	// Only map data when the site admin is adding users, not on registration.
+	if ( !is_admin() )
+		return false;
+
+	// Add the user's fullname to Xprofile
+	if ( bp_is_active( 'xprofile' ) ) {
+		$firstname = bp_get_user_meta( $user_id, 'first_name', true );
+		$lastname = ' ' . bp_get_user_meta( $user_id, 'last_name', true );
+		$name = $firstname . $lastname;
+
+		if ( empty( $name ) || ' ' == $name )
+			$name = bp_get_user_meta( $user_id, 'nickname', true );
+
+		xprofile_set_field_data( 1, $user_id, $name );
+	}
+}
+add_action( 'user_register', 'bp_core_map_user_registration' );
+
+function bp_core_signup_avatar_upload_dir() {
+	global $bp;
+
+	if ( !$bp->signup->avatar_dir )
+		return false;
+
+	$path  = bp_core_avatar_upload_path() . '/avatars/signups/' . $bp->signup->avatar_dir;
+	$newbdir = $path;
+
+	if ( !file_exists( $path ) )
+		@wp_mkdir_p( $path );
+
+	$newurl = bp_core_avatar_url() . '/avatars/signups/' . $bp->signup->avatar_dir;
+	$newburl = $newurl;
+	$newsubdir = '/avatars/signups/' . $bp->signup->avatar_dir;
+
+	return apply_filters( 'bp_core_signup_avatar_upload_dir', array( 'path' => $path, 'url' => $newurl, 'subdir' => $newsubdir, 'basedir' => $newbdir, 'baseurl' => $newburl, 'error' => false ) );
+}
+
+function bp_core_signup_send_validation_email( $user_id, $user_email, $key ) {
+	$activate_url = bp_get_activation_page() ."?key=$key";
+	$activate_url = esc_url( $activate_url );
+
+	$from_name = ( '' == bp_get_option( 'blogname' ) ) ? __( 'BuddyPress', 'buddypress' ) : esc_html( bp_get_option( 'blogname' ) );
+
+	$message = sprintf( __( "Thanks for registering! To complete the activation of your account please click the following link:\n\n%1\$s\n\n", 'buddypress' ), $activate_url );
+	$subject = '[' . $from_name . '] ' . __( 'Activate Your Account', 'buddypress' );
+
+	// Send the message
+	$to      = apply_filters( 'bp_core_signup_send_validation_email_to',     $user_email, $user_id                );
+	$subject = apply_filters( 'bp_core_signup_send_validation_email_subject', $subject,    $user_id                );
+	$message = apply_filters( 'bp_core_signup_send_validation_email_message', $message,    $user_id, $activate_url );
+
+	wp_mail( $to, $subject, $message );
+
+	do_action( 'bp_core_sent_user_validation_email', $subject, $message, $user_id, $user_email, $key );
+}
+
+/**
+ * Stop user accounts logging in that have not been activated yet (user_status = 2).
+ *
+ * Note: This is only applicable for single site WordPress installs.
+ * Multisite has their own DB table - 'wp_signups' - dedicated for unactivated users.
+ * See {@link wpmu_signup_user()} and {@link wpmu_validate_user_signup()}.
+ *
+ * @param obj $user Either the WP_User object or the WP_Error object
+ * @return obj If the user is not a spammer, return the WP_User object. Otherwise a new WP_Error object.
+ *
+ * @since 1.2.2
+ */
+function bp_core_signup_disable_inactive( $user ) {
+	// check to see if the $user has already failed logging in, if so return $user as-is
+	if ( is_wp_error( $user ) || empty( $user ) )
+		return $user;
+
+	// the user exists; now do a check to see if the user has activated their account or not
+	// NOTE: this is only applicable for single site WordPress installs!
+	// if unactivated, stop the login now!
+	if ( is_a( $user, 'WP_User' ) && 2 == $user->user_status )
+		return new WP_Error( 'bp_account_not_activated', __( '<strong>ERROR</strong>: Your account has not been activated. Check your email for the activation link.', 'buddypress' ) );
+
+	// user has activated their account! all clear!
+	return $user;
+}
+add_filter( 'authenticate', 'bp_core_signup_disable_inactive', 30 );
+
+/**
+ * Kill the wp-signup.php if custom registration signup templates are present
+ */
+function bp_core_wpsignup_redirect() {
+	$action = !empty( $_GET['action'] ) ? $_GET['action'] : '';
+
+	if ( is_admin() || is_network_admin() )
+		return;
+
+	// Not at the WP core signup page and action is not register
+	if ( ! empty( $_SERVER['SCRIPT_NAME'] ) && false === strpos( $_SERVER['SCRIPT_NAME'], 'wp-signup.php' ) && ( 'register' != $action ) )
+		return;
+
+	// Redirect to sign-up page
+	if ( locate_template( array( 'registration/register.php' ), false ) || locate_template( array( 'register.php' ), false ) )
+		bp_core_redirect( bp_get_signup_page() );
+}
+add_action( 'bp_init', 'bp_core_wpsignup_redirect' );
+
+?>
diff --git a/wp-content/plugins/buddypress/bp-members/bp-members-loader.php b/wp-content/plugins/buddypress/bp-members/bp-members-loader.php
index 07f9bcd1f21a30d539733662d17920a1cd90c3f9..339a9696d7c373a874d63055126c76ed75b8e13f 100644
--- a/wp-content/plugins/buddypress/bp-members/bp-members-loader.php
+++ b/wp-content/plugins/buddypress/bp-members/bp-members-loader.php
@@ -16,7 +16,7 @@ class BP_Members_Component extends BP_Component {
 	/**
 	 * Start the members component creation process
 	 *
-	 * @since 1.5
+	 * @since BuddyPress (1.5)
 	 */
 	function __construct() {
 		parent::start(
@@ -29,11 +29,10 @@ class BP_Members_Component extends BP_Component {
 	/**
 	 * Include files
 	 *
-	 * @global obj $bp
+	 * @global BuddyPress $bp The one true BuddyPress instance
 	 */
 	function includes() {
 		$includes = array(
-			'signup',
 			'actions',
 			'filters',
 			'screens',
@@ -52,18 +51,17 @@ class BP_Members_Component extends BP_Component {
 	 * The BP_MEMBERS_SLUG constant is deprecated, and only used here for
 	 * backwards compatibility.
 	 *
-	 * @since 1.5
-	 * @global obj $bp
+	 * @since BuddyPress (1.5)
+	 * @global BuddyPress $bp The one true BuddyPress instance
 	 */
 	function setup_globals() {
-		global $bp, $current_user, $displayed_user_id;
+		global $bp;
 
 		// Define a slug, if necessary
 		if ( !defined( 'BP_MEMBERS_SLUG' ) )
 			define( 'BP_MEMBERS_SLUG', $this->id );
 
 		$globals = array(
-			'path'          => BP_PLUGIN_DIR,
 			'slug'          => BP_MEMBERS_SLUG,
 			'root_slug'     => isset( $bp->pages->members->slug ) ? $bp->pages->members->slug : BP_MEMBERS_SLUG,
 			'has_directory' => true,
@@ -75,34 +73,30 @@ class BP_Members_Component extends BP_Component {
 		/** Logged in user ****************************************************/
 
 		// Fetch the full name for the logged in user
-		$bp->loggedin_user->fullname       = bp_core_get_user_displayname( $bp->loggedin_user->id );
+		$bp->loggedin_user->fullname       = bp_core_get_user_displayname( bp_loggedin_user_id() );
 
 		// Hits the DB on single WP installs so get this separately
-		$bp->loggedin_user->is_super_admin = $bp->loggedin_user->is_site_admin = is_super_admin();
+		$bp->loggedin_user->is_super_admin = $bp->loggedin_user->is_site_admin = is_super_admin( bp_loggedin_user_id() );
 
 		// The domain for the user currently logged in. eg: http://domain.com/members/andy
-		$bp->loggedin_user->domain         = bp_core_get_user_domain( $bp->loggedin_user->id );
+		$bp->loggedin_user->domain         = bp_core_get_user_domain( bp_loggedin_user_id() );
 
 		// The core userdata of the user who is currently logged in.
-		$bp->loggedin_user->userdata       = bp_core_get_core_userdata( $bp->loggedin_user->id );
+		$bp->loggedin_user->userdata       = bp_core_get_core_userdata( bp_loggedin_user_id() );
 
 		/** Displayed user ****************************************************/
 
-		// The user id of the user currently being viewed:
-		// $bp->displayed_user->id is set in /bp-core/bp-core-catchuri.php
-		if ( empty( $bp->displayed_user->id ) )
-			$bp->displayed_user->id = 0;
-
 		// The domain for the user currently being displayed
-		$bp->displayed_user->domain   = bp_core_get_user_domain( $bp->displayed_user->id );
+		$bp->displayed_user->domain   = bp_core_get_user_domain( bp_displayed_user_id() );
 
 		// The core userdata of the user who is currently being displayed
-		$bp->displayed_user->userdata = bp_core_get_core_userdata( $bp->displayed_user->id );
+		$bp->displayed_user->userdata = bp_core_get_core_userdata( bp_displayed_user_id() );
 
 		// Fetch the full name displayed user
-		$bp->displayed_user->fullname = bp_core_get_user_displayname( $bp->displayed_user->id );
+		$bp->displayed_user->fullname = bp_core_get_user_displayname( bp_displayed_user_id() );
 
 		/** Profiles Fallback *************************************************/
+
 		if ( !bp_is_active( 'xprofile' ) ) {
 			$bp->profile->slug = 'profile';
 			$bp->profile->id   = 'profile';
@@ -118,25 +112,47 @@ class BP_Members_Component extends BP_Component {
 		} else {
 			$bp->default_component = BP_DEFAULT_COMPONENT;
 		}
-
-		if ( !$bp->current_component && $bp->displayed_user->id )
-			$bp->current_component = $bp->default_component;
+		
+		if ( bp_displayed_user_id() ) {
+			$bp->canonical_stack['base_url'] = bp_displayed_user_domain();
+		
+			if ( bp_current_component() ) {
+				$bp->canonical_stack['component'] = bp_current_component();
+			}
+			
+			if ( bp_current_action() ) {
+				$bp->canonical_stack['action'] = bp_current_action();
+			}
+			
+			if ( !empty( $bp->action_variables ) ) {
+				$bp->canonical_stack['action_variables'] = bp_action_variables();
+			}
+
+			if ( !bp_current_component() ) {
+				$bp->current_component = $bp->default_component;
+			} else if ( bp_is_current_component( $bp->default_component ) && !bp_current_action() ) {			
+				// The canonical URL will not contain the default component
+				unset( $bp->canonical_stack['component'] );
+			}
+		}
 	}
 
 	/**
 	 * Setup BuddyBar navigation
 	 *
-	 * @global obj $bp
+	 * @global BuddyPress $bp The one true BuddyPress instance
 	 */
 	function setup_nav() {
 		global $bp;
 
 		// Add 'Profile' to the main navigation
 		if ( !bp_is_active( 'xprofile' ) ) {
+
 			// Don't set up navigation if there's no user
 			if ( !is_user_logged_in() && !bp_is_user() )
 				return;
 
+			$sub_nav  = array();
 			$main_nav = array(
 				'name'                => __( 'Profile', 'buddypress' ),
 				'slug'                => $bp->profile->slug,
@@ -147,8 +163,7 @@ class BP_Members_Component extends BP_Component {
 			);
 
 			// User links
-			$user_domain   = ( isset( $bp->displayed_user->domain ) )               ? $bp->displayed_user->domain               : $bp->loggedin_user->domain;
-			$user_login    = ( isset( $bp->displayed_user->userdata->user_login ) ) ? $bp->displayed_user->userdata->user_login : $bp->loggedin_user->userdata->user_login;
+			$user_domain   = bp_displayed_user_domain() ? bp_displayed_user_domain() : bp_loggedin_user_domain();
 			$profile_link  = trailingslashit( $user_domain . $bp->profile->slug );
 
 			// Add the subnav items to the profile
@@ -168,7 +183,7 @@ class BP_Members_Component extends BP_Component {
 	/**
 	 * Sets up the title for pages and <title>
 	 *
-	 * @global obj $bp
+	 * @global BuddyPress $bp The one true BuddyPress instance
 	 */
 	function setup_title() {
 		global $bp;
@@ -177,17 +192,21 @@ class BP_Members_Component extends BP_Component {
 			$bp->bp_options_title = __( 'You', 'buddypress' );
 		} elseif( bp_is_user() ) {
 			$bp->bp_options_avatar = bp_core_fetch_avatar( array(
-				'item_id' => $bp->displayed_user->id,
-				'type'    => 'thumb'
+				'item_id' => bp_displayed_user_id(),
+				'type'    => 'thumb',
+				'alt'     => sprintf( __( 'Profile picture of %s', 'buddypress' ), bp_get_displayed_user_fullname() )
 			) );
-			$bp->bp_options_title  = $bp->displayed_user->fullname;
+			$bp->bp_options_title = bp_get_displayed_user_fullname();
 		}
 
 		parent::setup_title();
 	}
+}
 
+function bp_setup_members() {
+	global $bp;
+	$bp->members = new BP_Members_Component();
 }
-// Create the users component
-$bp->members = new BP_Members_Component();
+add_action( 'bp_setup_components', 'bp_setup_members', 1 );
 
-?>
\ No newline at end of file
+?>
diff --git a/wp-content/plugins/buddypress/bp-members/bp-members-notifications.php b/wp-content/plugins/buddypress/bp-members/bp-members-notifications.php
index 3635827b1b89c71fb8771d04e933a8ee13b5bdf6..a7bad54977c6d1aa3a64f3f1ff875483c7a0d0e5 100644
--- a/wp-content/plugins/buddypress/bp-members/bp-members-notifications.php
+++ b/wp-content/plugins/buddypress/bp-members/bp-members-notifications.php
@@ -1,54 +1,91 @@
 <?php
+
 /**
  * BuddyPress Member Notifications
  *
  * Functions and filters used for member notification
  *
  * @package BuddyPress
- * @subpackage Members
+ * @subpackage MembersNotifications
  */
 
 // Exit if accessed directly
 if ( !defined( 'ABSPATH' ) ) exit;
 
+/**
+ * Add a notification for a specific user, from a specific component
+ *
+ * @since BuddyPress (1.0)
+ * @param string $item_id
+ * @param int $user_id
+ * @param string $component_name
+ * @param string $component_action
+ * @param string $secondary_item_id
+ * @param string $date_notified
+ * @return boolean True on success, false on fail
+ */
 function bp_core_add_notification( $item_id, $user_id, $component_name, $component_action, $secondary_item_id = 0, $date_notified = false ) {
-	global $bp;
 
 	if ( empty( $date_notified ) )
 		$date_notified = bp_core_current_time();
 
-	$notification                        = new BP_Core_Notification;
-	$notification->item_id               = $item_id;
-	$notification->user_id               = $user_id;
-	$notification->component_name        = $component_name;
-	$notification->component_action      = $component_action;
-	$notification->date_notified         = $date_notified;
-	$notification->is_new                = 1;
+	$notification                   = new BP_Core_Notification;
+	$notification->item_id          = $item_id;
+	$notification->user_id          = $user_id;
+	$notification->component_name   = $component_name;
+	$notification->component_action = $component_action;
+	$notification->date_notified    = $date_notified;
+	$notification->is_new           = 1;
 
 	if ( !empty( $secondary_item_id ) )
 		$notification->secondary_item_id = $secondary_item_id;
 
-	if ( !$notification->save() )
-		return false;
+	if ( $notification->save() )
+		return true;
 
-	return true;
+	return false;
 }
 
+/**
+ * Delete a specific notification by its ID
+ *
+ * @since BuddyPress (1.0)
+ * @param int $id
+ * @return boolean True on success, false on fail
+ */
 function bp_core_delete_notification( $id ) {
-	if ( !bp_core_check_notification_access( $bp->loggedin_user->id, $id ) )
+	if ( !bp_core_check_notification_access( bp_loggedin_user_id(), $id ) )
 		return false;
 
 	return BP_Core_Notification::delete( $id );
 }
 
+/**
+ * Get a specific notification by its ID
+ * 
+ * @since BuddyPress (1.0)
+ * @param int $id
+ * @return BP_Core_Notification 
+ */
 function bp_core_get_notification( $id ) {
 	return new BP_Core_Notification( $id );
 }
 
+/**
+ * Get notifications for a specific user
+ * 
+ * @since BuddyPress (1.0)
+ * @global BuddyPress $bp
+ * @param int $user_id
+ * @param string $format
+ * @return boolean Object or array on success, false on fail
+ */
 function bp_core_get_notifications_for_user( $user_id, $format = 'simple' ) {
 	global $bp;
 
-	$notifications = BP_Core_Notification::get_all_for_user( $user_id );
+	$notifications         = BP_Core_Notification::get_all_for_user( $user_id );
+	$grouped_notifications = array(); // Notification groups
+	$renderable            = array(); // Renderable notifications
 
 	// Group notifications by component and component_action and provide totals
 	for ( $i = 0, $count = count( $notifications ); $i < $count; ++$i ) {
@@ -56,29 +93,48 @@ function bp_core_get_notifications_for_user( $user_id, $format = 'simple' ) {
 		$grouped_notifications[$notification->component_name][$notification->component_action][] = $notification;
 	}
 
+	// Bail if no notification groups
 	if ( empty( $grouped_notifications ) )
 		return false;
 
-	$renderable = array();
-
 	// Calculate a renderable output for each notification type
-	foreach ( (array)$grouped_notifications as $component_name => $action_arrays ) {
-		if ( !$action_arrays )
+	foreach ( $grouped_notifications as $component_name => $action_arrays ) {
+
+		// Skip if group is empty
+		if ( empty( $action_arrays ) )
 			continue;
 
-		foreach ( (array)$action_arrays as $component_action_name => $component_action_items ) {
-			$action_item_count = count($component_action_items);
+		// Skip inactive components
+		if ( !bp_is_active( $component_name ) )
+			continue;
 
+		// Loop through each actionable item and try to map it to a component
+		foreach ( (array) $action_arrays as $component_action_name => $component_action_items ) {
+
+			// Get the number of actionable items
+			$action_item_count = count( $component_action_items );
+
+			// Skip if the count is less than 1
 			if ( $action_item_count < 1 )
 				continue;
 
-			// @deprecated format_notification_function - 1.5
-			if ( isset( $bp->{$component_name}->format_notification_function ) && function_exists( $bp->{$component_name}->format_notification_function ) ) {
-				$renderable[] = call_user_func( $bp->{$component_name}->format_notification_function, $component_action_name, $component_action_items[0]->item_id, $component_action_items[0]->secondary_item_id, $action_item_count );
-			} elseif ( isset( $bp->{$component_name}->notification_callback ) && function_exists( $bp->{$component_name}->notification_callback ) ) {
+			// Callback function exists
+			if ( isset( $bp->{$component_name}->notification_callback ) && function_exists( $bp->{$component_name}->notification_callback ) ) {
+
+				// Function should return an object
 				if ( 'object' == $format ) {
-					$content = call_user_func( $bp->{$component_name}->notification_callback, $component_action_name, $component_action_items[0]->item_id, $component_action_items[0]->secondary_item_id, $action_item_count, 'array' );
 
+					// Retrieve the content of the notification using the callback
+					$content = call_user_func(
+						$bp->{$component_name}->notification_callback,
+						$component_action_name,
+						$component_action_items[0]->item_id,
+						$component_action_items[0]->secondary_item_id,
+						$action_item_count,
+						'array'
+					);
+
+					// Create the object to be returned
 					$notification_object = new stdClass;
 
 					// Minimal backpat with non-compatible notification
@@ -92,35 +148,101 @@ function bp_core_get_notifications_for_user( $user_id, $format = 'simple' ) {
 					}
 
 					$notification_object->id = $component_action_items[0]->id;
+					$renderable[]            = $notification_object;
 
-					$renderable[] 	  = $notification_object;
+				// Return an array of content strings
 				} else {
-					$content = call_user_func( $bp->{$component_name}->notification_callback, $component_action_name, $component_action_items[0]->item_id, $component_action_items[0]->secondary_item_id, $action_item_count );
+					$content      = call_user_func( $bp->{$component_name}->notification_callback, $component_action_name, $component_action_items[0]->item_id, $component_action_items[0]->secondary_item_id, $action_item_count );
 					$renderable[] = $content;
 				}
+
+			// @deprecated format_notification_function - 1.5
+			} elseif ( isset( $bp->{$component_name}->format_notification_function ) && function_exists( $bp->{$component_name}->format_notification_function ) ) {
+				$renderable[] = call_user_func( $bp->{$component_name}->format_notification_function, $component_action_name, $component_action_items[0]->item_id, $component_action_items[0]->secondary_item_id, $action_item_count );
 			}
 		}
 	}
 
-	return isset( $renderable ) ? $renderable : false;
+	// If renderable is empty array, set to false
+	if ( empty( $renderable ) )
+		$renderable = false;
+
+	// Filter and return
+	return apply_filters( 'bp_core_get_notifications_for_user', $renderable, $user_id, $format );
 }
 
+/**
+ * Delete notifications for a user by type
+ * 
+ * Used when clearing out notifications for a specific component when the user
+ * has visited that component.
+ *
+ * @since BuddyPress (1.0)
+ * @param int $user_id
+ * @param string $component_name
+ * @param string $component_action
+ * @return boolean True on success, false on fail
+ */
 function bp_core_delete_notifications_by_type( $user_id, $component_name, $component_action ) {
 	return BP_Core_Notification::delete_for_user_by_type( $user_id, $component_name, $component_action );
 }
 
+/**
+ * Delete notifications for an item ID
+ * 
+ * Used when clearing out notifications for a specific component when the user
+ * has visited that component.
+ *
+ * @since BuddyPress (1.0)
+ * @param int $user_id
+ * @param string $component_name
+ * @param string $component_action
+ * @return boolean True on success, false on fail
+ */
 function bp_core_delete_notifications_by_item_id( $user_id, $item_id, $component_name, $component_action, $secondary_item_id = false ) {
 	return BP_Core_Notification::delete_for_user_by_item_id( $user_id, $item_id, $component_name, $component_action, $secondary_item_id );
 }
 
+/**
+ * Delete all notifications for by type
+ *
+ * Used when clearing out notifications for an entire component
+ *
+ * @since BuddyPress (1.0)
+ * @param int $user_id
+ * @param string $component_name
+ * @param string $component_action
+ * @return boolean True on success, false on fail
+ */
 function bp_core_delete_all_notifications_by_type( $item_id, $component_name, $component_action = false, $secondary_item_id = false ) {
 	return BP_Core_Notification::delete_all_by_type( $item_id, $component_name, $component_action, $secondary_item_id );
 }
 
+/**
+ * Delete all notifications for a user
+ *
+ * Used when clearing out all notifications for a user, whene deleted or spammed
+ *
+ * @since BuddyPress (1.0)
+ * @param int $user_id
+ * @param string $component_name
+ * @param string $component_action
+ * @return boolean True on success, false on fail
+ */
 function bp_core_delete_notifications_from_user( $user_id, $component_name, $component_action ) {
 	return BP_Core_Notification::delete_from_user_by_type( $user_id, $component_name, $component_action );
 }
 
+/**
+ * Check if a user has access to a specific notification
+ *
+ * Used before deleting a notification for a user
+ *
+ * @since BuddyPress (1.0)
+ * @param int $user_id
+ * @param int $notification_id
+ * @return boolean True on success, false on fail
+ */
 function bp_core_check_notification_access( $user_id, $notification_id ) {
 	if ( !BP_Core_Notification::check_access( $user_id, $notification_id ) )
 		return false;
@@ -128,4 +250,4 @@ function bp_core_check_notification_access( $user_id, $notification_id ) {
 	return true;
 }
 
-?>
\ No newline at end of file
+?>
diff --git a/wp-content/plugins/buddypress/bp-members/bp-members-screens.php b/wp-content/plugins/buddypress/bp-members/bp-members-screens.php
index cac072e80fa4a49bc5990fd0ac435ab299ec376c..dfb5cc139aeab703430a21857bfcee5ec9d62c26 100644
--- a/wp-content/plugins/buddypress/bp-members/bp-members-screens.php
+++ b/wp-content/plugins/buddypress/bp-members/bp-members-screens.php
@@ -1,11 +1,12 @@
 <?php
+
 /**
  * BuddyPress Member Screens
  *
  * Handlers for member screens that aren't handled elsewhere
  *
  * @package BuddyPress
- * @subpackage Members
+ * @subpackage MembersScreens
  */
 
 // Exit if accessed directly
@@ -45,4 +46,218 @@ function bp_members_screen_index() {
 add_action( 'bp_screens', 'bp_members_screen_index' );
 
 
+function bp_core_screen_signup() {
+	global $bp;
+
+	if ( !bp_is_current_component( 'register' ) )
+		return;
+
+	// Not a directory
+	bp_update_is_directory( false, 'register' );
+
+	// If the user is logged in, redirect away from here
+	if ( is_user_logged_in() ) {
+		if ( bp_is_component_front_page( 'register' ) )
+			$redirect_to = trailingslashit( bp_get_root_domain() . '/' . bp_get_members_root_slug() );
+		else
+			$redirect_to = bp_get_root_domain();
+
+		bp_core_redirect( apply_filters( 'bp_loggedin_register_page_redirect_to', $redirect_to ) );
+
+		return;
+	}
+
+	if ( !isset( $bp->signup ) ) {
+		$bp->signup = new stdClass;
+	}
+
+	$bp->signup->step = 'request-details';
+
+ 	if ( !bp_get_signup_allowed() ) {
+		$bp->signup->step = 'registration-disabled';
+
+	// If the signup page is submitted, validate and save
+	} elseif ( isset( $_POST['signup_submit'] ) && bp_verify_nonce_request( 'bp_new_signup' ) ) {
+
+		// Check the base account details for problems
+		$account_details = bp_core_validate_user_signup( $_POST['signup_username'], $_POST['signup_email'] );
+
+		// If there are errors with account details, set them for display
+		if ( !empty( $account_details['errors']->errors['user_name'] ) )
+			$bp->signup->errors['signup_username'] = $account_details['errors']->errors['user_name'][0];
+
+		if ( !empty( $account_details['errors']->errors['user_email'] ) )
+			$bp->signup->errors['signup_email'] = $account_details['errors']->errors['user_email'][0];
+
+		// Check that both password fields are filled in
+		if ( empty( $_POST['signup_password'] ) || empty( $_POST['signup_password_confirm'] ) )
+			$bp->signup->errors['signup_password'] = __( 'Please make sure you enter your password twice', 'buddypress' );
+
+		// Check that the passwords match
+		if ( ( !empty( $_POST['signup_password'] ) && !empty( $_POST['signup_password_confirm'] ) ) && $_POST['signup_password'] != $_POST['signup_password_confirm'] )
+			$bp->signup->errors['signup_password'] = __( 'The passwords you entered do not match.', 'buddypress' );
+
+		$bp->signup->username = $_POST['signup_username'];
+		$bp->signup->email = $_POST['signup_email'];
+
+		// Now we've checked account details, we can check profile information
+		if ( bp_is_active( 'xprofile' ) ) {
+
+			// Make sure hidden field is passed and populated
+			if ( isset( $_POST['signup_profile_field_ids'] ) && !empty( $_POST['signup_profile_field_ids'] ) ) {
+
+				// Let's compact any profile field info into an array
+				$profile_field_ids = explode( ',', $_POST['signup_profile_field_ids'] );
+
+				// Loop through the posted fields formatting any datebox values then validate the field
+				foreach ( (array) $profile_field_ids as $field_id ) {
+					if ( !isset( $_POST['field_' . $field_id] ) ) {
+						if ( !empty( $_POST['field_' . $field_id . '_day'] ) && !empty( $_POST['field_' . $field_id . '_month'] ) && !empty( $_POST['field_' . $field_id . '_year'] ) )
+							$_POST['field_' . $field_id] = date( 'Y-m-d H:i:s', strtotime( $_POST['field_' . $field_id . '_day'] . $_POST['field_' . $field_id . '_month'] . $_POST['field_' . $field_id . '_year'] ) );
+					}
+
+					// Create errors for required fields without values
+					if ( xprofile_check_is_required_field( $field_id ) && empty( $_POST['field_' . $field_id] ) )
+						$bp->signup->errors['field_' . $field_id] = __( 'This is a required field', 'buddypress' );
+				}
+
+			// This situation doesn't naturally occur so bounce to website root
+			} else {
+				bp_core_redirect( bp_get_root_domain() );
+			}
+		}
+
+		// Finally, let's check the blog details, if the user wants a blog and blog creation is enabled
+		if ( isset( $_POST['signup_with_blog'] ) ) {
+			$active_signup = $bp->site_options['registration'];
+
+			if ( 'blog' == $active_signup || 'all' == $active_signup ) {
+				$blog_details = bp_core_validate_blog_signup( $_POST['signup_blog_url'], $_POST['signup_blog_title'] );
+
+				// If there are errors with blog details, set them for display
+				if ( !empty( $blog_details['errors']->errors['blogname'] ) )
+					$bp->signup->errors['signup_blog_url'] = $blog_details['errors']->errors['blogname'][0];
+
+				if ( !empty( $blog_details['errors']->errors['blog_title'] ) )
+					$bp->signup->errors['signup_blog_title'] = $blog_details['errors']->errors['blog_title'][0];
+			}
+		}
+
+		do_action( 'bp_signup_validate' );
+
+		// Add any errors to the action for the field in the template for display.
+		if ( !empty( $bp->signup->errors ) ) {
+			foreach ( (array) $bp->signup->errors as $fieldname => $error_message ) {
+				// addslashes() and stripslashes() to avoid create_function()
+				// syntax errors when the $error_message contains quotes
+				add_action( 'bp_' . $fieldname . '_errors', create_function( '', 'echo apply_filters(\'bp_members_signup_error_message\', "<div class=\"error\">" . stripslashes( \'' . addslashes( $error_message ) . '\' ) . "</div>" );' ) );
+			}
+		} else {
+			$bp->signup->step = 'save-details';
+
+			// No errors! Let's register those deets.
+			$active_signup = !empty( $bp->site_options['registration'] ) ? $bp->site_options['registration'] : '';
+
+			if ( 'none' != $active_signup ) {
+
+				// Let's compact any profile field info into usermeta
+				$profile_field_ids = explode( ',', $_POST['signup_profile_field_ids'] );
+
+				// Loop through the posted fields formatting any datebox values then add to usermeta - @todo This logic should be shared with the same in xprofile_screen_edit_profile()
+				foreach ( (array) $profile_field_ids as $field_id ) {
+					if ( ! isset( $_POST['field_' . $field_id] ) ) {
+
+						if ( ! empty( $_POST['field_' . $field_id . '_day'] ) && ! empty( $_POST['field_' . $field_id . '_month'] ) && ! empty( $_POST['field_' . $field_id . '_year'] ) ) {
+							// Concatenate the values
+							$date_value = $_POST['field_' . $field_id . '_day'] . ' ' . $_POST['field_' . $field_id . '_month'] . ' ' . $_POST['field_' . $field_id . '_year'];
+
+							// Turn the concatenated value into a timestamp
+							$_POST['field_' . $field_id] = date( 'Y-m-d H:i:s', strtotime( $date_value ) );
+						}
+					}
+
+					if ( !empty( $_POST['field_' . $field_id] ) )
+						$usermeta['field_' . $field_id] = $_POST['field_' . $field_id];
+					
+					if ( !empty( $_POST['field_' . $field_id . '_visibility'] ) )
+						$usermeta['field_' . $field_id . '_visibility'] = $_POST['field_' . $field_id . '_visibility'];
+				}
+
+				// Store the profile field ID's in usermeta
+				$usermeta['profile_field_ids'] = $_POST['signup_profile_field_ids'];
+
+				// Hash and store the password
+				$usermeta['password'] = wp_hash_password( $_POST['signup_password'] );
+
+				// If the user decided to create a blog, save those details to usermeta
+				if ( 'blog' == $active_signup || 'all' == $active_signup )
+					$usermeta['public'] = ( isset( $_POST['signup_blog_privacy'] ) && 'public' == $_POST['signup_blog_privacy'] ) ? true : false;
+
+				$usermeta = apply_filters( 'bp_signup_usermeta', $usermeta );
+
+				// Finally, sign up the user and/or blog
+				if ( isset( $_POST['signup_with_blog'] ) && is_multisite() )
+					$wp_user_id = bp_core_signup_blog( $blog_details['domain'], $blog_details['path'], $blog_details['blog_title'], $_POST['signup_username'], $_POST['signup_email'], $usermeta );
+				else
+					$wp_user_id = bp_core_signup_user( $_POST['signup_username'], $_POST['signup_password'], $_POST['signup_email'], $usermeta );
+
+				if ( is_wp_error( $wp_user_id ) ) {
+					$bp->signup->step = 'request-details';
+					bp_core_add_message( $wp_user_id->get_error_message(), 'error' ); 
+				} else {
+					$bp->signup->step = 'completed-confirmation';
+				}
+			}
+
+			do_action( 'bp_complete_signup' );
+		}
+
+	}
+
+	do_action( 'bp_core_screen_signup' );
+	bp_core_load_template( apply_filters( 'bp_core_template_register', 'registration/register' ) );
+}
+add_action( 'bp_screens', 'bp_core_screen_signup' );
+
+function bp_core_screen_activation() {
+	global $bp;
+
+	if ( !bp_is_current_component( 'activate' ) )
+		return false;
+
+	// Check if an activation key has been passed
+	if ( isset( $_GET['key'] ) ) {
+
+		// Activate the signup
+		$user = apply_filters( 'bp_core_activate_account', bp_core_activate_signup( $_GET['key'] ) );
+
+		// If there were errors, add a message and redirect
+		if ( !empty( $user->errors ) ) {
+			bp_core_add_message( $user->get_error_message(), 'error' );
+			bp_core_redirect( trailingslashit( bp_get_root_domain() . '/' . $bp->pages->activate->slug ) );
+		}
+
+		// Check for an uploaded avatar and move that to the correct user folder
+		if ( is_multisite() )
+			$hashed_key = wp_hash( $_GET['key'] );
+		else
+			$hashed_key = wp_hash( $user );
+
+		// Check if the avatar folder exists. If it does, move rename it, move
+		// it and delete the signup avatar dir
+		if ( file_exists( bp_core_avatar_upload_path() . '/avatars/signups/' . $hashed_key ) )
+			@rename( bp_core_avatar_upload_path() . '/avatars/signups/' . $hashed_key, bp_core_avatar_upload_path() . '/avatars/' . $user );
+
+		bp_core_add_message( __( 'Your account is now active!', 'buddypress' ) );
+
+		$bp->activation_complete = true;
+	}
+
+	if ( '' != locate_template( array( 'registration/activate' ), false ) )
+		bp_core_load_template( apply_filters( 'bp_core_template_activate', 'activate' ) );
+	else
+		bp_core_load_template( apply_filters( 'bp_core_template_activate', 'registration/activate' ) );
+}
+add_action( 'bp_screens', 'bp_core_screen_activation' );
+
 ?>
diff --git a/wp-content/plugins/buddypress/bp-members/bp-members-template.php b/wp-content/plugins/buddypress/bp-members/bp-members-template.php
index 158927c25c2398f3c0d6eb66275fb77110fc68a4..c7927cb959c76e380f3421e49d61158fd58b06c0 100644
--- a/wp-content/plugins/buddypress/bp-members/bp-members-template.php
+++ b/wp-content/plugins/buddypress/bp-members/bp-members-template.php
@@ -1,4 +1,5 @@
 <?php
+
 /**
  * BuddyPress Member Template Tags
  *
@@ -16,7 +17,7 @@ if ( !defined( 'ABSPATH' ) ) exit;
  *
  * @package BuddyPress
  * @subpackage Members Template
- * @since 1.5
+ * @since BuddyPress (1.5)
  *
  * @uses bp_get_members_slug()
  */
@@ -28,7 +29,7 @@ function bp_members_slug() {
 	 *
 	 * @package BuddyPress
 	 * @subpackage Members Template
-	 * @since 1.5
+	 * @since BuddyPress (1.5)
 	 */
 	function bp_get_members_slug() {
 		global $bp;
@@ -40,7 +41,7 @@ function bp_members_slug() {
  *
  * @package BuddyPress
  * @subpackage Members Template
- * @since 1.5
+ * @since BuddyPress (1.5)
  *
  * @uses bp_get_members_root_slug()
  */
@@ -52,7 +53,7 @@ function bp_members_root_slug() {
 	 *
 	 * @package BuddyPress
 	 * @subpackage Members Template
-	 * @since 1.5
+	 * @since BuddyPress (1.5)
 	 */
 	function bp_get_members_root_slug() {
 		global $bp;
@@ -64,7 +65,7 @@ function bp_members_root_slug() {
  *
  * @package BuddyPress
  * @subpackage Members Template
- * @since 1.5
+ * @since BuddyPress (1.5)
  * @uses bp_get_members_directory_permalink()
  */
 function bp_members_directory_permalink() {
@@ -75,7 +76,7 @@ function bp_members_directory_permalink() {
 	 *
 	 * @package BuddyPress
 	 * @subpackage Members Template
-	 * @since 1.5
+	 * @since BuddyPress (1.5)
 	 * @uses apply_filters()
 	 * @uses traisingslashit()
 	 * @uses bp_get_root_domain()
@@ -91,7 +92,7 @@ function bp_members_directory_permalink() {
  *
  * @package BuddyPress
  * @subpackage Members Template
- * @since 1.5
+ * @since BuddyPress (1.5)
  *
  * @uses bp_get_signup_slug()
  */
@@ -103,7 +104,7 @@ function bp_signup_slug() {
 	 *
 	 * @package BuddyPress
 	 * @subpackage Members Template
-	 * @since 1.5
+	 * @since BuddyPress (1.5)
 	 */
 	function bp_get_signup_slug() {
 		global $bp;
@@ -123,7 +124,7 @@ function bp_signup_slug() {
  *
  * @package BuddyPress
  * @subpackage Members Template
- * @since 1.5
+ * @since BuddyPress (1.5)
  *
  * @uses bp_get_activate_slug()
  */
@@ -135,7 +136,7 @@ function bp_activate_slug() {
 	 *
 	 * @package BuddyPress
 	 * @subpackage Members Template
-	 * @since 1.5
+	 * @since BuddyPress (1.5)
 	 */
 	function bp_get_activate_slug() {
 		global $bp;
@@ -168,28 +169,21 @@ class BP_Core_Members_Template {
 	var $pag_links;
 	var $total_member_count;
 
-	function bp_core_members_template( $type, $page_number, $per_page, $max, $user_id, $search_terms, $include, $populate_extras, $exclude, $meta_key, $meta_value ) {
-		$this->__construct( $type, $page_number, $per_page, $max, $user_id, $search_terms, $include, $populate_extras, $exclude, $meta_key, $meta_value );
-	}
-
-	function __construct( $type, $page_number, $per_page, $max, $user_id, $search_terms, $include, $populate_extras, $exclude, $meta_key, $meta_value ) {
-		global $bp;
+	function __construct( $type, $page_number, $per_page, $max, $user_id, $search_terms, $include, $populate_extras, $exclude, $meta_key, $meta_value, $page_arg = 'upage' ) {
 
-		$this->pag_page  = !empty( $_REQUEST['upage'] ) ? intval( $_REQUEST['upage'] ) : (int)$page_number;
-		$this->pag_num   = !empty( $_REQUEST['num'] )   ? intval( $_REQUEST['num'] )   : (int)$per_page;
-		$this->type      = $type;
+		$this->pag_page = !empty( $_REQUEST[$page_arg] ) ? intval( $_REQUEST[$page_arg] ) : (int) $page_number;
+		$this->pag_num  = !empty( $_REQUEST['num'] )   ? intval( $_REQUEST['num'] )   : (int) $per_page;
+		$this->type     = $type;
 
-		if ( isset( $_REQUEST['letter'] ) && '' != $_REQUEST['letter'] )
+		if ( !empty( $_REQUEST['letter'] ) )
 			$this->members = BP_Core_User::get_users_by_letter( $_REQUEST['letter'], $this->pag_num, $this->pag_page, $populate_extras, $exclude );
-		else if ( false !== $include )
-			$this->members = BP_Core_User::get_specific_users( $include, $this->pag_num, $this->pag_page, $populate_extras );
 		else
 			$this->members = bp_core_get_users( array( 'type' => $this->type, 'per_page' => $this->pag_num, 'page' => $this->pag_page, 'user_id' => $user_id, 'include' => $include, 'search_terms' => $search_terms, 'populate_extras' => $populate_extras, 'exclude' => $exclude, 'meta_key' => $meta_key, 'meta_value' => $meta_value ) );
 
-		if ( !$max || $max >= (int)$this->members['total'] )
-			$this->total_member_count = (int)$this->members['total'];
+		if ( !$max || $max >= (int) $this->members['total'] )
+			$this->total_member_count = (int) $this->members['total'];
 		else
-			$this->total_member_count = (int)$max;
+			$this->total_member_count = (int) $max;
 
 		$this->members = $this->members['users'];
 
@@ -197,17 +191,17 @@ class BP_Core_Members_Template {
 			if ( $max >= count( $this->members ) ) {
 				$this->member_count = count( $this->members );
 			} else {
-				$this->member_count = (int)$max;
+				$this->member_count = (int) $max;
 			}
 		} else {
 			$this->member_count = count( $this->members );
 		}
 
-		if ( (int)$this->total_member_count && (int)$this->pag_num ) {
+		if ( (int) $this->total_member_count && (int) $this->pag_num ) {
 			$this->pag_links = paginate_links( array(
-				'base'      => add_query_arg( 'upage', '%#%' ),
+				'base'      => add_query_arg( $page_arg, '%#%' ),
 				'format'    => '',
-				'total'     => ceil( (int)$this->total_member_count / (int)$this->pag_num ),
+				'total'     => ceil( (int) $this->total_member_count / (int) $this->pag_num ),
 				'current'   => (int) $this->pag_page,
 				'prev_text' => _x( '&larr;', 'Member pagination previous text', 'buddypress' ),
 				'next_text' => _x( '&rarr;', 'Member pagination next text', 'buddypress' ),
@@ -251,13 +245,13 @@ class BP_Core_Members_Template {
 	}
 
 	function the_member() {
-		global $member, $bp;
 
 		$this->in_the_loop = true;
-		$this->member = $this->next_member();
+		$this->member      = $this->next_member();
 
-		if ( 0 == $this->current_member ) // loop has just started
-			do_action('member_loop_start');
+		// loop has just started
+		if ( 0 == $this->current_member )
+			do_action( 'member_loop_start' );
 	}
 }
 
@@ -268,7 +262,7 @@ function bp_rewind_members() {
 }
 
 function bp_has_members( $args = '' ) {
-	global $bp, $members_template;
+	global $members_template;
 
 	/***
 	 * Set the defaults based on the current page. Any of these will be overridden
@@ -281,8 +275,8 @@ function bp_has_members( $args = '' ) {
 	$search_terms = null;
 
 	// User filtering
-	if ( !empty( $bp->displayed_user->id ) )
-		$user_id = $bp->displayed_user->id;
+	if ( bp_displayed_user_id() )
+		$user_id = bp_displayed_user_id();
 
 	// type: active ( default ) | random | newest | popular | online | alphabetical
 	$defaults = array(
@@ -291,6 +285,8 @@ function bp_has_members( $args = '' ) {
 		'per_page'        => 20,
 		'max'             => false,
 
+		'page_arg'        => 'upage',       // See https://buddypress.trac.wordpress.org/ticket/3679
+
 		'include'         => false,         // Pass a user_id or a list (comma-separated or array) of user_ids to only show these users
 		'exclude'         => false,         // Pass a user_id or a list (comma-separated or array) of user_ids to exclude these users
 
@@ -318,11 +314,7 @@ function bp_has_members( $args = '' ) {
 	if ( !empty( $max ) && ( $per_page > $max ) )
 		$per_page = $max;
 
-	// Make sure we return no members if we looking at friendship requests and there are none.
-	if ( empty( $include ) && bp_is_friends_component() && bp_is_current_action( 'requests' ) )
-		return false;
-
-	$members_template = new BP_Core_Members_Template( $type, $page, $per_page, $max, $user_id, $search_terms, $include, (bool)$populate_extras, $exclude, $meta_key, $meta_value );
+	$members_template = new BP_Core_Members_Template( $type, $page, $per_page, $max, $user_id, $search_terms, $include, (bool)$populate_extras, $exclude, $meta_key, $meta_value, $page_arg );
 	return apply_filters( 'bp_has_members', $members_template->has_members(), $members_template );
 }
 
@@ -340,7 +332,7 @@ function bp_members_pagination_count() {
 	echo bp_get_members_pagination_count();
 }
 	function bp_get_members_pagination_count() {
-		global $bp, $members_template;
+		global $members_template;
 
 		if ( empty( $members_template->type ) )
 			$members_template->type = '';
@@ -465,23 +457,25 @@ function bp_member_user_email() {
 	}
 
 function bp_member_is_loggedin_user() {
-	global $bp, $members_template;
-	return apply_filters( 'bp_member_is_loggedin_user', $bp->loggedin_user->id == $members_template->member->id ? true : false );
+	global $members_template;
+	return apply_filters( 'bp_member_is_loggedin_user', bp_loggedin_user_id() == $members_template->member->id ? true : false );
 }
 
 function bp_member_avatar( $args = '' ) {
 	echo apply_filters( 'bp_member_avatar', bp_get_member_avatar( $args ) );
 }
 	function bp_get_member_avatar( $args = '' ) {
-		global $bp, $members_template;
+		global $members_template;
+
+		$fullname = !empty( $members_template->member->fullname ) ? $members_template->member->fullname : $members_template->member->display_name;
 
 		$defaults = array(
-			'type' => 'thumb',
-			'width' => false,
+			'type'   => 'thumb',
+			'width'  => false,
 			'height' => false,
-			'class' => 'avatar',
-			'id' => false,
-			'alt' => __( 'Profile picture of %s', 'buddypress' )
+			'class'  => 'avatar',
+			'id'     => false,
+			'alt'    => sprintf( __( 'Profile picture of %s', 'buddypress' ), $fullname )
 		);
 
 		$r = wp_parse_args( $args, $defaults );
@@ -546,8 +540,9 @@ function bp_member_name() {
 		return apply_filters( 'bp_get_member_name', $members_template->member->fullname );
 	}
 	add_filter( 'bp_get_member_name', 'wp_filter_kses' );
-	add_filter( 'bp_get_member_name', 'stripslashes' );
-	add_filter( 'bp_get_member_name', 'strip_tags' );
+	add_filter( 'bp_get_member_name', 'stripslashes'   );
+	add_filter( 'bp_get_member_name', 'strip_tags'     );
+	add_filter( 'bp_get_member_name', 'esc_html'       );
 
 function bp_member_last_active() {
 	echo bp_get_member_last_active();
@@ -567,7 +562,7 @@ function bp_member_latest_update( $args = '' ) {
 	echo bp_get_member_latest_update( $args );
 }
 	function bp_get_member_latest_update( $args = '' ) {
-		global $bp, $members_template;
+		global $members_template;
 
 		$defaults = array(
 			'length'    => 225,
@@ -597,7 +592,7 @@ function bp_member_profile_data( $args = '' ) {
 	echo bp_get_member_profile_data( $args );
 }
 	function bp_get_member_profile_data( $args = '' ) {
-		global $bp, $members_template;
+		global $members_template;
 
 		if ( !bp_is_active( 'xprofile' ) )
 			return false;
@@ -609,8 +604,8 @@ function bp_member_profile_data( $args = '' ) {
 		// Guess at default $user_id
 		if ( !empty( $members_template->member->id ) )
 			$user_id = $members_template->member->id;
-		elseif ( !empty( $bp->displayed_user->id ) )
-			$user_id = $bp->displayed_user->id;
+		elseif ( bp_displayed_user_id() )
+			$user_id = bp_displayed_user_id();
 
 		$defaults = array(
 			'field'   => false,   // Field name
@@ -625,7 +620,7 @@ function bp_member_profile_data( $args = '' ) {
 			$members_template->member->profile_data = BP_XProfile_ProfileData::get_all_for_user( $user_id );
 
 		// Get the field data if there is data to get
-		if ( !empty( $members_template->member->profile_data ) )
+		if ( ! empty( $members_template->member->profile_data ) && ! empty( $members_template->member->profile_data[$field]['field_type'] ) && ! empty( $members_template->member->profile_data[$field]['field_data'] ) )
 			$data = xprofile_format_profile_field( $members_template->member->profile_data[$field]['field_type'], $members_template->member->profile_data[$field]['field_data'] );
 
 		return apply_filters( 'bp_get_member_profile_data', $data );
@@ -664,13 +659,12 @@ function bp_member_hidden_fields() {
 }
 
 function bp_directory_members_search_form() {
-	global $bp;
 
 	$default_search_value = bp_get_search_default_text( 'members' );
 	$search_value         = !empty( $_REQUEST['s'] ) ? stripslashes( $_REQUEST['s'] ) : $default_search_value; ?>
 
 	<form action="" method="get" id="search-members-form">
-		<label><input type="text" name="s" id="members_search" value="<?php echo esc_attr( $search_value ) ?>"  onfocus="if (this.value == '<?php echo $default_search_value ?>') {this.value = '';}" onblur="if (this.value == '') {this.value = '<?php echo $default_search_value ?>';}" /></label>
+		<label><input type="text" name="s" id="members_search" placeholder="<?php echo esc_attr( $search_value ) ?>" /></label>
 		<input type="submit" id="members_search_submit" name="members_search_submit" value="<?php _e( 'Search', 'buddypress' ) ?>" />
 	</form>
 
@@ -699,29 +693,33 @@ function bp_total_site_member_count() {
  * @package BuddyPress Core
  * @todo Move to a back-compat file?
  * @deprecated Does not seem to be called anywhere in the core
- * @global object $bp Global BuddyPress settings object
+ * @global BuddyPress $bp The one true BuddyPress instance
  */
 function bp_get_loggedin_user_nav() {
 	global $bp;
 
 	// Loop through each navigation item
 	foreach( (array) $bp->bp_nav as $nav_item ) {
+
+		$selected = '';
+
 		// If the current component matches the nav item id, then add a highlight CSS class.
-		if ( !bp_is_directory() && $bp->active_components[$bp->current_component] == $nav_item['css_id'] )
+		if ( !bp_is_directory() && !empty( $bp->active_components[bp_current_component()] ) && $bp->active_components[bp_current_component()] == $nav_item['css_id'] ) {
 			$selected = ' class="current selected"';
-		else
-			$selected = '';
+		}
 
-		/* If we are viewing another person (current_userid does not equal loggedin_user->id)
-		   then check to see if the two users are friends. if they are, add a highlight CSS class
-		   to the friends nav item if it exists. */
-		if ( !bp_is_my_profile() && $bp->displayed_user->id ) {
+		// If we are viewing another person (current_userid does not equal
+		// loggedin_user->id then check to see if the two users are friends.
+		// if they are, add a highlight CSS class to the friends nav item
+		// if it exists.
+		if ( !bp_is_my_profile() && bp_displayed_user_id() ) {
 			$selected = '';
 
 			if ( bp_is_active( 'friends' ) ) {
 				if ( $nav_item['css_id'] == $bp->friends->id ) {
-					if ( friends_check_friendship( $bp->loggedin_user->id, $bp->displayed_user->id ) )
+					if ( friends_check_friendship( bp_loggedin_user_id(), bp_displayed_user_id() ) ) {
 						$selected = ' class="current selected"';
+					}
 				}
 			}
 		}
@@ -741,24 +739,25 @@ function bp_get_loggedin_user_nav() {
  * yourself.
  *
  * @package BuddyPress Core
- * @global object $bp Global BuddyPress settings object
+ * @global BuddyPress $bp The one true BuddyPress instance
  */
 function bp_get_displayed_user_nav() {
 	global $bp;
 
-	foreach ( (array)$bp->bp_nav as $user_nav_item ) {
-		if ( !$user_nav_item['show_for_displayed_user'] && !bp_is_my_profile() )
+	foreach ( (array) $bp->bp_nav as $user_nav_item ) {
+		if ( empty( $user_nav_item['show_for_displayed_user'] ) && !bp_is_my_profile() )
 			continue;
 
-		if ( $bp->current_component == $user_nav_item['slug'] )
+		$selected = '';
+		if ( bp_is_current_component( $user_nav_item['slug'] ) ) {
 			$selected = ' class="current selected"';
-		else
-			$selected = '';
+		}
 
-		if ( $bp->loggedin_user->domain )
-			$link = str_replace( $bp->loggedin_user->domain, $bp->displayed_user->domain, $user_nav_item['link'] );
-		else
-			$link = $bp->displayed_user->domain . $user_nav_item['link'];
+		if ( bp_loggedin_user_domain() ) {
+			$link = str_replace( bp_loggedin_user_domain(), bp_displayed_user_domain(), $user_nav_item['link'] );
+		} else {
+			$link = trailingslashit( bp_displayed_user_domain() . $user_nav_item['link'] );
+		}
 
 		echo apply_filters_ref_array( 'bp_get_displayed_user_nav_' . $user_nav_item['css_id'], array( '<li id="' . $user_nav_item['css_id'] . '-personal-li" ' . $selected . '><a id="user-' . $user_nav_item['css_id'] . '" href="' . $link . '">' . $user_nav_item['name'] . '</a></li>', &$user_nav_item ) );
 	}
@@ -770,40 +769,38 @@ function bp_loggedin_user_avatar( $args = '' ) {
 	echo bp_get_loggedin_user_avatar( $args );
 }
 	function bp_get_loggedin_user_avatar( $args = '' ) {
-		global $bp;
 
 		$defaults = array(
 			'type'   => 'thumb',
 			'width'  => false,
 			'height' => false,
 			'html'   => true,
-			'alt'    => __( 'Profile picture of %s', 'buddypress' )
+			'alt'    => sprintf( __( 'Profile picture of %s', 'buddypress' ), bp_get_loggedin_user_fullname() )
 		);
 
 		$r = wp_parse_args( $args, $defaults );
 		extract( $r, EXTR_SKIP );
 
-		return apply_filters( 'bp_get_loggedin_user_avatar', bp_core_fetch_avatar( array( 'item_id' => $bp->loggedin_user->id, 'type' => $type, 'width' => $width, 'height' => $height, 'html' => $html, 'alt' => $alt ) ) );
+		return apply_filters( 'bp_get_loggedin_user_avatar', bp_core_fetch_avatar( array( 'item_id' => bp_loggedin_user_id(), 'type' => $type, 'width' => $width, 'height' => $height, 'html' => $html, 'alt' => $alt ) ) );
 	}
 
 function bp_displayed_user_avatar( $args = '' ) {
 	echo bp_get_displayed_user_avatar( $args );
 }
 	function bp_get_displayed_user_avatar( $args = '' ) {
-		global $bp;
 
 		$defaults = array(
 			'type'   => 'thumb',
 			'width'  => false,
 			'height' => false,
 			'html'   => true,
-			'alt'    => __( 'Profile picture of %s', 'buddypress' )
+			'alt'    => sprintf( __( 'Profile picture of %s', 'buddypress' ), bp_get_displayed_user_fullname() )
 		);
 
 		$r = wp_parse_args( $args, $defaults );
 		extract( $r, EXTR_SKIP );
 
-		return apply_filters( 'bp_get_displayed_user_avatar', bp_core_fetch_avatar( array( 'item_id' => $bp->displayed_user->id, 'type' => $type, 'width' => $width, 'height' => $height, 'html' => $html, 'alt' => $alt ) ) );
+		return apply_filters( 'bp_get_displayed_user_avatar', bp_core_fetch_avatar( array( 'item_id' => bp_displayed_user_id(), 'type' => $type, 'width' => $width, 'height' => $height, 'html' => $html, 'alt' => $alt ) ) );
 	}
 
 function bp_displayed_user_email() {
@@ -825,10 +822,9 @@ function bp_last_activity( $user_id = 0 ) {
 	echo apply_filters( 'bp_last_activity', bp_get_last_activity( $user_id ) );
 }
 	function bp_get_last_activity( $user_id = 0 ) {
-		global $bp;
 
 		if ( empty( $user_id ) )
-			$user_id = $bp->displayed_user->id;
+			$user_id = bp_displayed_user_id();
 
 		$last_activity = bp_core_get_last_activity( bp_get_user_meta( $user_id, 'last_activity', true ), __('active %s', 'buddypress') );
 
@@ -839,17 +835,16 @@ function bp_user_firstname() {
 	echo bp_get_user_firstname();
 }
 	function bp_get_user_firstname( $name = false ) {
-		global $bp;
 
 		// Try to get displayed user
 		if ( empty( $name ) )
-			$name = $bp->displayed_user->fullname;
+			$name = bp_get_displayed_user_fullname();
 
 		// Fall back on logged in user
 		if ( empty( $name ) )
-			$name = $bp->loggedin_user->fullname;
+			$name = bp_get_loggedin_user_fullname();
 
-		$fullname = (array)explode( ' ', $name );
+		$fullname = (array) explode( ' ', $name );
 
 		return apply_filters( 'bp_get_user_firstname', $fullname[0], $fullname );
 	}
@@ -869,16 +864,7 @@ function bp_displayed_user_link() {
 	}
 	function bp_user_link() { bp_displayed_user_domain(); } // Deprecated.
 
-function bp_displayed_user_id() {
-	global $bp;
-	return apply_filters( 'bp_displayed_user_id', !empty( $bp->displayed_user->id ) ? $bp->displayed_user->id : 0 );
-}
-	function bp_current_user_id() { return bp_displayed_user_id(); }
-
-function bp_loggedin_user_id() {
-	global $bp;
-	return apply_filters( 'bp_loggedin_user_id', !empty( $bp->loggedin_user->id ) ? $bp->loggedin_user->id : 0 );
-}
+function bp_current_user_id() { return bp_displayed_user_id(); }
 
 function bp_displayed_user_domain() {
 	global $bp;
@@ -914,8 +900,8 @@ function bp_displayed_user_username() {
 	function bp_get_displayed_user_username() {
 		global $bp;
 
-		if ( !empty( $bp->displayed_user->id ) ) {
-			$username = bp_core_get_username( $bp->displayed_user->id, $bp->displayed_user->userdata->user_nicename, $bp->displayed_user->userdata->user_login );
+		if ( bp_displayed_user_id() ) {
+			$username = bp_core_get_username( bp_displayed_user_id(), $bp->displayed_user->userdata->user_nicename, $bp->displayed_user->userdata->user_login );
 		} else {
 			$username = '';
 		}
@@ -929,8 +915,8 @@ function bp_loggedin_user_username() {
 	function bp_get_loggedin_user_username() {
 		global $bp;
 
-		if ( !empty( $bp->loggedin_user->id ) ) {
-			$username = bp_core_get_username( $bp->loggedin_user->id, $bp->loggedin_user->userdata->user_nicename, $bp->loggedin_user->userdata->user_login );
+		if ( bp_loggedin_user_id() ) {
+			$username = bp_core_get_username( bp_loggedin_user_id(), $bp->loggedin_user->userdata->user_nicename, $bp->loggedin_user->userdata->user_login );
 		} else {
 			$username = '';
 		}
@@ -947,12 +933,18 @@ function bp_has_custom_signup_page() {
 	return false;
 }
 
+/**
+ * Echoes the URL to the signup page
+ */
 function bp_signup_page() {
 	echo bp_get_signup_page();
 }
+	/**
+	 * Returns the URL to the signup page
+	 *
+	 * @return string
+	 */
 	function bp_get_signup_page() {
-		global $bp;
-
 		if ( bp_has_custom_signup_page() ) {
 			$page = trailingslashit( bp_get_root_domain() . '/' . bp_get_signup_slug() );
 		} else {
@@ -962,20 +954,14 @@ function bp_signup_page() {
 		return apply_filters( 'bp_get_signup_page', $page );
 	}
 
-function bp_has_custom_activation_page() {
-	if ( locate_template( array( 'activate.php' ), false ) || locate_template( array( '/registration/activate.php' ), false ) )
-		return true;
-
-	return false;
-}
-
 function bp_activation_page() {
 	echo bp_get_activation_page();
 }
 	function bp_get_activation_page() {
 		global $bp;
 
-		if ( bp_has_custom_activation_page() )
+		// Check the global directly to make sure the WP page exists in $bp->pages
+		if ( !empty( $bp->pages->activate->slug ) )
 			$page = trailingslashit( bp_get_root_domain() . '/' . $bp->pages->activate->slug );
 		else
 			$page = trailingslashit( bp_get_root_domain() ) . 'wp-activate.php';
@@ -1114,7 +1100,7 @@ function bp_signup_avatar( $args = '' ) {
 			if ( empty( $bp->grav_default->user ) )
 				$default_grav = 'wavatar';
 			else if ( 'mystery' == $bp->grav_default->user )
-				$default_grav = BP_PLUGIN_URL . '/bp-core/images/mystery-man.jpg';
+				$default_grav = BP_PLUGIN_URL . 'bp-core/images/mystery-man.jpg';
 			else
 				$default_grav = $bp->grav_default->user;
 
@@ -1136,12 +1122,14 @@ function bp_signup_allowed() {
 		$signup_allowed = false;
 
 		if ( is_multisite() ) {
-			if ( in_array( $bp->site_options['registration'], array( 'all', 'user' ) ) )
+			if ( in_array( $bp->site_options['registration'], array( 'all', 'user' ) ) ) {
 				$signup_allowed = true;
+			}
 
 		} else {
-			if ( get_option( 'users_can_register') )
+			if ( bp_get_option( 'users_can_register') ) {
 				$signup_allowed = true;
+			}
 		}
 
 		return apply_filters( 'bp_get_signup_allowed', $signup_allowed );
@@ -1150,7 +1138,7 @@ function bp_signup_allowed() {
 /**
  * Hook member activity feed to <head>
  *
- * @since 1.5
+ * @since BuddyPress (1.5)
  */
 function bp_members_activity_feed() {
 	if ( !bp_is_active( 'activity' ) || !bp_is_user() )
@@ -1170,14 +1158,14 @@ function bp_members_component_link( $component, $action = '', $query_args = '',
 		global $bp;
 
 		// Must be displayed user
-		if ( empty( $bp->displayed_user->id ) )
+		if ( !bp_displayed_user_id() )
 			return;
 
 		// Append $action to $url if there is no $type
 		if ( !empty( $action ) )
-			$url = $bp->displayed_user->domain . $bp->{$component}->slug . '/' . $action;
+			$url = bp_displayed_user_domain() . $bp->{$component}->slug . '/' . $action;
 		else
-			$url = $bp->displayed_user->domain . $bp->{$component}->slug;
+			$url = bp_displayed_user_domain() . $bp->{$component}->slug;
 
 		// Add a slash at the end of our user url
 		$url = trailingslashit( $url );
@@ -1197,4 +1185,4 @@ function bp_members_component_link( $component, $action = '', $query_args = '',
 			return $url;
 	}
 
-?>
\ No newline at end of file
+?>
diff --git a/wp-content/plugins/buddypress/bp-messages/bp-messages-actions.php b/wp-content/plugins/buddypress/bp-messages/bp-messages-actions.php
index bdc3e1ad077833c108908c4e053604b1983675a6..6d00051cd85bb15175b568d4c7a8fa71fc9d20cd 100644
--- a/wp-content/plugins/buddypress/bp-messages/bp-messages-actions.php
+++ b/wp-content/plugins/buddypress/bp-messages/bp-messages-actions.php
@@ -1,8 +1,14 @@
 <?php
-/*******************************************************************************
+
+/**
+ * BuddyPress Messages Actions
+ *
  * Action functions are exactly the same as screen functions, however they do not
  * have a template screen associated with them. Usually they will send the user
  * back to the default screen after execution.
+ *
+ * @package BuddyPress
+ * @subpackage MessagesActions
  */
 
 // Exit if accessed directly
@@ -16,8 +22,8 @@ function messages_action_view_message() {
 
 	$thread_id = (int)bp_action_variable( 0 );
 
-	if ( !$thread_id || !messages_is_valid_thread( $thread_id ) || ( !messages_check_thread_access( $thread_id ) && !is_super_admin() ) )
-		bp_core_redirect( bp_displayed_user_domain() . bp_get_messages_slug() );
+	if ( !$thread_id || !messages_is_valid_thread( $thread_id ) || ( !messages_check_thread_access( $thread_id ) && !bp_current_user_can( 'bp_moderate' ) ) )
+		bp_core_redirect( trailingslashit( bp_displayed_user_domain() . bp_get_messages_slug() ) );
 
 	// Check if a new reply has been submitted
 	if ( isset( $_POST['send'] ) ) {
@@ -26,7 +32,7 @@ function messages_action_view_message() {
 		check_admin_referer( 'messages_send_message', 'send_message_nonce' );
 
 		// Send the reply
-		if ( messages_new_message( array( 'thread_id' => $thread_id, 'subject' => $_POST['subject'], 'content' => $_POST['content'] ) ) )
+		if ( messages_new_message( array( 'thread_id' => $thread_id, 'subject' => ! empty( $_POST['subject'] ) ? $_POST['subject'] : false, 'content' => $_POST['content'] ) ) )
 			bp_core_add_message( __( 'Your reply was sent successfully', 'buddypress' ) );
 		else
 			bp_core_add_message( __( 'There was a problem sending your reply, please try again', 'buddypress' ), 'error' );
@@ -52,7 +58,7 @@ function messages_action_view_message() {
 		'screen_function' => true,
 		'position'        => 40,
 		'user_has_access' => bp_is_my_profile(),
-		'link'            => bp_displayed_user_domain() . bp_get_messages_slug() . '/view/' . (int) $thread_id
+		'link'            => trailingslashit( bp_displayed_user_domain() . bp_get_messages_slug() . '/view/' . (int) $thread_id )
 	) );
 
 	bp_core_load_template( apply_filters( 'messages_template_view_message', 'members/single/home' ) );
@@ -68,7 +74,7 @@ function messages_action_delete_message() {
 	$thread_id = bp_action_variable( 1 );
 
 	if ( !$thread_id || !is_numeric( $thread_id ) || !messages_check_thread_access( $thread_id ) ) {
-		bp_core_redirect( bp_displayed_user_domain() . bp_get_messages_slug() . '/' . bp_current_action() );
+		bp_core_redirect( trailingslashit( bp_displayed_user_domain() . bp_get_messages_slug() . '/' . bp_current_action() ) );
 	} else {
 		if ( !check_admin_referer( 'messages_delete_thread' ) )
 			return false;
@@ -79,7 +85,7 @@ function messages_action_delete_message() {
 		} else {
 			bp_core_add_message( __('Message deleted.', 'buddypress') );
 		}
-		bp_core_redirect( bp_displayed_user_domain() . bp_get_messages_slug() . '/' . bp_current_action() );
+		bp_core_redirect( trailingslashit( bp_displayed_user_domain() . bp_get_messages_slug() . '/' . bp_current_action() ) );
 	}
 }
 add_action( 'bp_actions', 'messages_action_delete_message' );
@@ -93,7 +99,7 @@ function messages_action_bulk_delete() {
 	$thread_ids = $_POST['thread_ids'];
 
 	if ( !$thread_ids || !messages_check_thread_access( $thread_ids ) ) {
-		bp_core_redirect( bp_displayed_user_domain() . bp_get_messages_slug() . '/' . bp_current_action() );
+		bp_core_redirect( trailingslashit( bp_displayed_user_domain() . bp_get_messages_slug() . '/' . bp_current_action() ) );
 	} else {
 		if ( !check_admin_referer( 'messages_delete_thread' ) )
 			return false;
@@ -103,8 +109,9 @@ function messages_action_bulk_delete() {
 		else
 			bp_core_add_message( __('Messages deleted.', 'buddypress') );
 
-		bp_core_redirect( bp_displayed_user_domain() . bp_get_messages_slug() . '/' . bp_current_action() );
+		bp_core_redirect( trailingslashit( bp_displayed_user_domain() . bp_get_messages_slug() . '/' . bp_current_action() ) );
 	}
 }
 add_action( 'bp_actions', 'messages_action_bulk_delete' );
-?>
\ No newline at end of file
+
+?>
diff --git a/wp-content/plugins/buddypress/bp-messages/bp-messages-cache.php b/wp-content/plugins/buddypress/bp-messages/bp-messages-cache.php
index 77c8114310a840b6ea6428425f07a3c32e67ea86..485792a028dffa670666e59877c41b86c1ffbbba 100644
--- a/wp-content/plugins/buddypress/bp-messages/bp-messages-cache.php
+++ b/wp-content/plugins/buddypress/bp-messages/bp-messages-cache.php
@@ -1,7 +1,13 @@
 <?php
-/*******************************************************************************
+
+/**
+ * BuddyPress Messages Caching
+ *
  * Caching functions handle the clearing of cached objects and pages on specific
  * actions throughout BuddyPress.
+ *
+ * @package BuddyPress
+ * @subpackage SettingsLoader
  */
 
 // Exit if accessed directly
@@ -17,4 +23,4 @@ add_action( 'messages_screen_compose', 'bp_core_clear_cache' );
 add_action( 'messages_screen_sentbox', 'bp_core_clear_cache' );
 add_action( 'messages_screen_inbox',   'bp_core_clear_cache' );
 
-?>
\ No newline at end of file
+?>
diff --git a/wp-content/plugins/buddypress/bp-messages/bp-messages-classes.php b/wp-content/plugins/buddypress/bp-messages/bp-messages-classes.php
index 9f9c77a2816aad035cbed91e7d15f3aaa27a274f..9374ecb574fdac95f054ef91a3962fa406039ac0 100644
--- a/wp-content/plugins/buddypress/bp-messages/bp-messages-classes.php
+++ b/wp-content/plugins/buddypress/bp-messages/bp-messages-classes.php
@@ -1,8 +1,16 @@
 <?php
+
+/**
+ * BuddyPress Messages Classes
+ *
+ * @package BuddyPress
+ * @subpackage MessagesClasses
+ */
+
 // Exit if accessed directly
 if ( !defined( 'ABSPATH' ) ) exit;
 
-Class BP_Messages_Thread {
+class BP_Messages_Thread {
 	var $thread_id;
 	var $messages;
 	var $recipients;
@@ -10,9 +18,53 @@ Class BP_Messages_Thread {
 
 	var $unread_count;
 
-	function bp_messages_thread ( $thread_id = false, $order = 'ASC' ) {
-		$this->__construct( $thread_id, $order);
-	}
+	/**
+	 * The content of the last message in this thread
+	 *
+	 * @since BuddyPress (1.2)
+	 * @var string
+	 */
+	public $last_message_content;
+
+	/**
+	 * The date of the last message in this thread
+	 *
+	 * @since BuddyPress (1.2)
+	 * @var string
+	 */
+	public $last_message_date;
+
+	/**
+	 * The ID of the last message in this thread
+	 *
+	 * @since BuddyPress (1.2)
+	 * @var int
+	 */
+	public $last_message_id;
+
+	/**
+	 * The subject of the last message in this thread
+	 *
+	 * @since BuddyPress (1.2)
+	 * @var string
+	 */
+	public $last_message_subject;
+
+	/**
+	 * The user ID of the author of the last message in this thread
+	 *
+	 * @since BuddyPress (1.2)
+	 * @var int
+	 */
+	public $last_sender_id;
+
+	/**
+	 * Sort order of the messages in this thread (ASC or DESC).
+	 *
+	 * @since BuddyPress (1.5)
+	 * @var string
+	 */
+	public $messages_order;
 
 	function __construct( $thread_id = false, $order = 'ASC' ) {
 		if ( $thread_id )
@@ -31,15 +83,15 @@ Class BP_Messages_Thread {
 		if ( !$this->messages = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM {$bp->messages->table_name_messages} WHERE thread_id = %d ORDER BY date_sent " . $order, $this->thread_id ) ) )
 			return false;
 
-		foreach ( (array)$this->messages as $key => $message )
+		foreach ( (array) $this->messages as $key => $message )
 			$this->sender_ids[$message->sender_id] = $message->sender_id;
 
 		// Fetch the recipients
 		$this->recipients = $this->get_recipients();
 
 		// Get the unread count for the logged in user
-		if ( isset( $this->recipients[$bp->loggedin_user->id] ) )
-			$this->unread_count = $this->recipients[$bp->loggedin_user->id]->unread_count;
+		if ( isset( $this->recipients[bp_loggedin_user_id()] ) )
+			$this->unread_count = $this->recipients[bp_loggedin_user_id()]->unread_count;
 	}
 
 	function mark_read() {
@@ -53,9 +105,10 @@ Class BP_Messages_Thread {
 	function get_recipients() {
 		global $wpdb, $bp;
 
-		$results = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM {$bp->messages->table_name_recipients} WHERE thread_id = %d", $this->thread_id ) );
+		$recipients = array();
+		$results    = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM {$bp->messages->table_name_recipients} WHERE thread_id = %d", $this->thread_id ) );
 
-		foreach ( (array)$results as $recipient )
+		foreach ( (array) $results as $recipient )
 			$recipients[$recipient->user_id] = $recipient;
 
 		return $recipients;
@@ -66,7 +119,7 @@ Class BP_Messages_Thread {
 	function delete( $thread_id ) {
 		global $wpdb, $bp;
 
-		$delete_for_user = $wpdb->query( $wpdb->prepare( "UPDATE {$bp->messages->table_name_recipients} SET is_deleted = 1 WHERE thread_id = %d AND user_id = %d", $thread_id, $bp->loggedin_user->id ) );
+		$delete_for_user = $wpdb->query( $wpdb->prepare( "UPDATE {$bp->messages->table_name_recipients} SET is_deleted = 1 WHERE thread_id = %d AND user_id = %d", $thread_id, bp_loggedin_user_id() ) );
 
 		// Check to see if any more recipients remain for this message
 		// if not, then delete the message from the database.
@@ -83,53 +136,58 @@ Class BP_Messages_Thread {
 		return true;
 	}
 
-	function get_current_threads_for_user( $user_id, $box = 'inbox', $type = 'all', $limit = null, $page = null ) {
+	function get_current_threads_for_user( $user_id, $box = 'inbox', $type = 'all', $limit = null, $page = null, $search_terms = '' ) {
 		global $wpdb, $bp;
 
-		$pag_sql = $type_sql = '';
+		$pag_sql = $type_sql = $search_sql = '';
 		if ( $limit && $page )
 			$pag_sql = $wpdb->prepare( " LIMIT %d, %d", intval( ( $page - 1 ) * $limit), intval( $limit ) );
 
 		if ( $type == 'unread' )
-			$type_sql = $wpdb->prepare( " AND r.unread_count != 0 " );
+			$type_sql = " AND r.unread_count != 0 ";
 		elseif ( $type == 'read' )
-			$type_sql = $wpdb->prepare( " AND r.unread_count = 0 " );
+			$type_sql = " AND r.unread_count = 0 ";
+
+		if ( !empty( $search_terms ) ) {
+			$search_terms = like_escape( $wpdb->escape( $search_terms ) );
+			$search_sql   = "AND ( subject LIKE '%%$search_terms%%' OR message LIKE '%%$search_terms%%' )";
+		}
 
 		if ( 'sentbox' == $box ) {
-			$thread_ids = $wpdb->get_results( $wpdb->prepare( "SELECT m.thread_id, MAX(m.date_sent) AS date_sent FROM {$bp->messages->table_name_recipients} r, {$bp->messages->table_name_messages} m WHERE m.thread_id = r.thread_id AND m.sender_id = r.user_id AND m.sender_id = %d AND r.is_deleted = 0 GROUP BY m.thread_id ORDER BY date_sent DESC {$pag_sql}", $user_id ) );
-			$total_threads = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT( DISTINCT m.thread_id ) FROM {$bp->messages->table_name_recipients} r, {$bp->messages->table_name_messages} m WHERE m.thread_id = r.thread_id AND m.sender_id = r.user_id AND m.sender_id = %d AND r.is_deleted = 0 ", $user_id ) );
+			$thread_ids    = $wpdb->get_results( $wpdb->prepare( "SELECT m.thread_id, MAX(m.date_sent) AS date_sent FROM {$bp->messages->table_name_recipients} r, {$bp->messages->table_name_messages} m WHERE m.thread_id = r.thread_id AND m.sender_id = r.user_id AND m.sender_id = %d AND r.is_deleted = 0 {$search_sql} GROUP BY m.thread_id ORDER BY date_sent DESC {$pag_sql}", $user_id ) );
+			$total_threads = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT( DISTINCT m.thread_id ) FROM {$bp->messages->table_name_recipients} r, {$bp->messages->table_name_messages} m WHERE m.thread_id = r.thread_id AND m.sender_id = r.user_id AND m.sender_id = %d AND r.is_deleted = 0 {$search_sql} ", $user_id ) );
 		} else {
-			$thread_ids = $wpdb->get_results( $wpdb->prepare( "SELECT m.thread_id, MAX(m.date_sent) AS date_sent FROM {$bp->messages->table_name_recipients} r, {$bp->messages->table_name_messages} m WHERE m.thread_id = r.thread_id AND r.is_deleted = 0 AND r.user_id = %d AND r.sender_only = 0 {$type_sql} GROUP BY m.thread_id ORDER BY date_sent DESC {$pag_sql}", $user_id ) );
-			$total_threads = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT( DISTINCT m.thread_id ) FROM {$bp->messages->table_name_recipients} r, {$bp->messages->table_name_messages} m WHERE m.thread_id = r.thread_id AND r.is_deleted = 0 AND r.user_id = %d AND r.sender_only = 0 {$type_sql}", $user_id ) );
+			$thread_ids = $wpdb->get_results( $wpdb->prepare( "SELECT m.thread_id, MAX(m.date_sent) AS date_sent FROM {$bp->messages->table_name_recipients} r, {$bp->messages->table_name_messages} m WHERE m.thread_id = r.thread_id AND r.is_deleted = 0 AND r.user_id = %d AND r.sender_only = 0 {$type_sql} {$search_sql} GROUP BY m.thread_id ORDER BY date_sent DESC {$pag_sql}", $user_id ) );
+			$total_threads = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT( DISTINCT m.thread_id ) FROM {$bp->messages->table_name_recipients} r, {$bp->messages->table_name_messages} m WHERE m.thread_id = r.thread_id AND r.is_deleted = 0 AND r.user_id = %d AND r.sender_only = 0 {$type_sql} {$search_sql} ", $user_id ) );
 		}
 
 		if ( empty( $thread_ids ) )
 			return false;
 
 		// Sort threads by date_sent
-		foreach( (array)$thread_ids as $thread )
+		foreach( (array) $thread_ids as $thread )
 			$sorted_threads[$thread->thread_id] = strtotime( $thread->date_sent );
 
 		arsort( $sorted_threads );
 
 		$threads = false;
-		foreach ( (array)$sorted_threads as $thread_id => $date_sent )
+		foreach ( (array) $sorted_threads as $thread_id => $date_sent )
 			$threads[] = new BP_Messages_Thread( $thread_id );
 
-		return array( 'threads' => &$threads, 'total' => (int)$total_threads );
+		return array( 'threads' => &$threads, 'total' => (int) $total_threads );
 	}
 
 	function mark_as_read( $thread_id ) {
 		global $wpdb, $bp;
 
-		$sql = $wpdb->prepare( "UPDATE {$bp->messages->table_name_recipients} SET unread_count = 0 WHERE user_id = %d AND thread_id = %d", $bp->loggedin_user->id, $thread_id );
+		$sql = $wpdb->prepare( "UPDATE {$bp->messages->table_name_recipients} SET unread_count = 0 WHERE user_id = %d AND thread_id = %d", bp_loggedin_user_id(), $thread_id );
 		$wpdb->query($sql);
 	}
 
 	function mark_as_unread( $thread_id ) {
 		global $wpdb, $bp;
 
-		$sql = $wpdb->prepare( "UPDATE {$bp->messages->table_name_recipients} SET unread_count = 1 WHERE user_id = %d AND thread_id = %d", $bp->loggedin_user->id, $thread_id );
+		$sql = $wpdb->prepare( "UPDATE {$bp->messages->table_name_recipients} SET unread_count = 1 WHERE user_id = %d AND thread_id = %d", bp_loggedin_user_id(), $thread_id );
 		$wpdb->query($sql);
 	}
 
@@ -141,9 +199,9 @@ Class BP_Messages_Thread {
 			$exclude_sender = ' AND sender_only != 1';
 
 		if ( $type == 'unread' )
-			$type_sql = $wpdb->prepare( " AND unread_count != 0 " );
+			$type_sql = " AND unread_count != 0 ";
 		else if ( $type == 'read' )
-			$type_sql = $wpdb->prepare( " AND unread_count = 0 " );
+			$type_sql = " AND unread_count = 0 ";
 
 		return (int) $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(thread_id) FROM {$bp->messages->table_name_recipients} WHERE user_id = %d AND is_deleted = 0$exclude_sender $type_sql", $user_id ) );
 	}
@@ -156,7 +214,7 @@ Class BP_Messages_Thread {
 		if ( !$sender_ids )
 			return false;
 
-		return in_array( $bp->loggedin_user->id, $sender_ids );
+		return in_array( bp_loggedin_user_id(), $sender_ids );
 	}
 
 	function get_last_sender( $thread_id ) {
@@ -172,7 +230,7 @@ Class BP_Messages_Thread {
 		global $wpdb, $bp;
 
 		if ( empty( $user_id ) )
-			$user_id = $bp->loggedin_user->id;
+			$user_id = bp_loggedin_user_id();
 
 		$sql = $wpdb->prepare( "SELECT SUM(unread_count) FROM {$bp->messages->table_name_recipients} WHERE user_id = %d AND is_deleted = 0 AND sender_only = 0", $user_id );
 		$unread_count = $wpdb->get_var( $sql );
@@ -187,7 +245,7 @@ Class BP_Messages_Thread {
 		global $wpdb, $bp;
 
 		if ( empty( $user_id ) )
-			$user_id = $bp->loggedin_user->id;
+			$user_id = bp_loggedin_user_id();
 
 		return $wpdb->get_var( $wpdb->prepare( "SELECT id FROM {$bp->messages->table_name_recipients} WHERE thread_id = %d AND user_id = %d", $thread_id, $user_id ) );
 	}
@@ -198,12 +256,21 @@ Class BP_Messages_Thread {
 		return $wpdb->get_var( $wpdb->prepare( "SELECT thread_id FROM {$bp->messages->table_name_messages} WHERE thread_id = %d LIMIT 1", $thread_id ) );
 	}
 
-	function get_recipient_links($recipients) {
-		if ( count($recipients) >= 5 )
-			return count( $recipients ) . __(' Recipients', 'buddypress');
+	function get_recipient_links( $recipients ) {
+		if ( count( $recipients ) >= 5 )
+			return sprintf( __( '%s Recipients', 'buddypress' ), number_format_i18n( count( $recipients ) ) );
 
-		foreach ( (array)$recipients as $recipient )
-			$recipient_links[] = bp_core_get_userlink( $recipient->user_id );
+		$recipient_links = array();
+
+		foreach ( (array) $recipients as $recipient ) {
+			$recipient_link = bp_core_get_userlink( $recipient->user_id );
+
+			if ( empty( $recipient_link ) ) {
+				$recipient_link = __( 'Deleted User', 'buddypress' );
+			}
+
+			$recipient_links[] = $recipient_link;
+		}
 
 		return implode( ', ', (array) $recipient_links );
 	}
@@ -215,13 +282,13 @@ Class BP_Messages_Thread {
 
 		$bp_prefix = bp_core_get_table_prefix();
 		$errors    = false;
-		$threads   = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM {$bp_prefix}bp_messages_threads" ) );
+		$threads   = $wpdb->get_results( "SELECT * FROM {$bp_prefix}bp_messages_threads" );
 
 		// Nothing to update, just return true to remove the table
 		if ( empty( $threads ) )
 			return true;
 
-		foreach( (array)$threads as $thread ) {
+		foreach( (array) $threads as $thread ) {
 			$message_ids = maybe_unserialize( $thread->message_ids );
 
 			if ( !empty( $message_ids ) ) {
@@ -240,7 +307,7 @@ Class BP_Messages_Thread {
 	}
 }
 
-Class BP_Messages_Message {
+class BP_Messages_Message {
 	var $id;
 	var $thread_id;
 	var $sender_id;
@@ -250,15 +317,9 @@ Class BP_Messages_Message {
 
 	var $recipients = false;
 
-	function bp_messages_message( $id = null ) {
-		$this->__construct( $id );
-	}
-
 	function __construct( $id = null ) {
-		global $bp;
-
 		$this->date_sent = bp_core_current_time();
-		$this->sender_id = $bp->loggedin_user->id;
+		$this->sender_id = bp_loggedin_user_id();
 
 		if ( !empty( $id ) )
 			$this->populate( $id );
@@ -296,7 +357,7 @@ Class BP_Messages_Message {
 
 		// If we have no thread_id then this is the first message of a new thread.
 		if ( empty( $this->thread_id ) ) {
-			$this->thread_id = (int)$wpdb->get_var( $wpdb->prepare( "SELECT MAX(thread_id) FROM {$bp->messages->table_name_messages}" ) ) + 1;
+			$this->thread_id = (int) $wpdb->get_var( "SELECT MAX(thread_id) FROM {$bp->messages->table_name_messages}" ) + 1;
 			$new_thread = true;
 		}
 
@@ -308,7 +369,7 @@ Class BP_Messages_Message {
 
 		if ( $new_thread ) {
 			// Add an recipient entry for all recipients
-			foreach ( (array)$this->recipients as $recipient ) {
+			foreach ( (array) $this->recipients as $recipient ) {
 				$wpdb->query( $wpdb->prepare( "INSERT INTO {$bp->messages->table_name_recipients} ( user_id, thread_id, unread_count ) VALUES ( %d, %d, 1 )", $recipient->user_id, $this->thread_id ) );
 				$recipient_ids[] = $recipient->user_id;
 			}
@@ -343,8 +404,9 @@ Class BP_Messages_Message {
 
 		if ( is_array( $recipient_usernames ) ) {
 			for ( $i = 0, $count = count( $recipient_usernames ); $i < $count; ++$i ) {
-				if ( $rid = bp_core_get_userid( trim($recipient_usernames[$i]) ) )
+				if ( $rid = bp_core_get_userid( trim($recipient_usernames[$i]) ) ) {
 					$recipient_ids[] = $rid;
+				}
 			}
 		}
 
@@ -354,7 +416,7 @@ Class BP_Messages_Message {
 	function get_last_sent_for_user( $thread_id ) {
 		global $wpdb, $bp;
 
-		return $wpdb->get_var( $wpdb->prepare( "SELECT id FROM {$bp->messages->table_name_messages} WHERE sender_id = %d AND thread_id = %d ORDER BY date_sent DESC LIMIT 1", $bp->loggedin_user->id, $thread_id ) );
+		return $wpdb->get_var( $wpdb->prepare( "SELECT id FROM {$bp->messages->table_name_messages} WHERE sender_id = %d AND thread_id = %d ORDER BY date_sent DESC LIMIT 1", bp_loggedin_user_id(), $thread_id ) );
 	}
 
 	function is_user_sender( $user_id, $message_id ) {
@@ -368,17 +430,13 @@ Class BP_Messages_Message {
 	}
 }
 
-Class BP_Messages_Notice {
+class BP_Messages_Notice {
 	var $id = null;
 	var $subject;
 	var $message;
 	var $date_sent;
 	var $is_active;
 
-	function bp_messages_notice( $id = null ) {
-		$this->__construct($id);
-	}
-
 	function __construct( $id = null ) {
 		if ( $id ) {
 			$this->id = $id;
@@ -421,7 +479,7 @@ Class BP_Messages_Notice {
 		// Now deactivate all notices apart from the new one.
 		$wpdb->query( $wpdb->prepare( "UPDATE {$bp->messages->table_name_notices} SET is_active = 0 WHERE id != %d", $id ) );
 
-		bp_update_user_meta( $bp->loggedin_user->id, 'last_activity', bp_core_current_time() );
+		bp_update_user_meta( bp_loggedin_user_id(), 'last_activity', bp_core_current_time() );
 
 		do_action_ref_array( 'messages_notice_after_save', array( &$this ) );
 
@@ -457,17 +515,38 @@ Class BP_Messages_Notice {
 
 	// Static Functions
 
-	function get_notices() {
+	/**
+	 * Pulls up a list of notices
+	 *
+	 * To get all notices, pass a value of -1 to pag_num
+	 *
+	 * @param array $args See $defaults for explanation of accepted arguments
+	 * @return array $notices
+	 */
+	function get_notices( $args = array() ) {
 		global $wpdb, $bp;
 
-		$notices = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM {$bp->messages->table_name_notices} ORDER BY date_sent DESC" ) );
+		$defaults = array(
+			'pag_num'  => 20, // Number of notices per page
+			'pag_page' => 1   // Page number
+		);
+		$r = wp_parse_args( $args, $defaults );
+		extract( $r );
+
+		$limit_sql = '';
+		if ( (int) $pag_num >= 0 ) {
+			$limit_sql = $wpdb->prepare( "LIMIT %d, %d", (int) ( ( $pag_page - 1 ) * $pag_num ), (int) $pag_num );
+		}
+
+		$notices = $wpdb->get_results( "SELECT * FROM {$bp->messages->table_name_notices} ORDER BY date_sent DESC {$limit_sql}" );
+
 		return $notices;
 	}
 
 	function get_total_notice_count() {
 		global $wpdb, $bp;
 
-		$notice_count = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(id) FROM " . $bp->messages->table_name_notices ) );
+		$notice_count = $wpdb->get_var( "SELECT COUNT(id) FROM " . $bp->messages->table_name_notices );
 
 		return $notice_count;
 	}
@@ -475,8 +554,9 @@ Class BP_Messages_Notice {
 	function get_active() {
 		global $wpdb, $bp;
 
-		$notice_id = $wpdb->get_var( $wpdb->prepare( "SELECT id FROM {$bp->messages->table_name_notices} WHERE is_active = 1") );
+		$notice_id = $wpdb->get_var( "SELECT id FROM {$bp->messages->table_name_notices} WHERE is_active = 1" );
 		return new BP_Messages_Notice( $notice_id );
 	}
 }
-?>
\ No newline at end of file
+
+?>
diff --git a/wp-content/plugins/buddypress/bp-messages/bp-messages-cssjs.php b/wp-content/plugins/buddypress/bp-messages/bp-messages-cssjs.php
index 59b8de28f7e0fd4827df3a1c7ddbf253433c78e4..bbfe6c2a363485ed27266fab9f14e375be11dd83 100644
--- a/wp-content/plugins/buddypress/bp-messages/bp-messages-cssjs.php
+++ b/wp-content/plugins/buddypress/bp-messages/bp-messages-cssjs.php
@@ -1,38 +1,47 @@
 <?php
+
+/**
+ * BuddyPress Messages CSS and JS
+ *
+ * Apply WordPress defined filters to private messages
+ *
+ * @package BuddyPress
+ * @subpackage MessagesScripts
+ */
+
 // Exit if accessed directly
 if ( !defined( 'ABSPATH' ) ) exit;
 
 function messages_add_autocomplete_js() {
-	global $bp;
 
 	// Include the autocomplete JS for composing a message.
 	if ( bp_is_messages_component() && bp_is_current_action( 'compose' ) ) {
 		add_action( 'wp_head', 'messages_autocomplete_init_jsblock' );
 
 		if ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) {
-			wp_enqueue_script( 'bp-jquery-autocomplete', BP_PLUGIN_URL . '/bp-messages/js/autocomplete/jquery.autocomplete.dev.js', array( 'jquery' ), '20110723' );
-			wp_enqueue_script( 'bp-jquery-autocomplete-fb', BP_PLUGIN_URL . '/bp-messages/js/autocomplete/jquery.autocompletefb.dev.js', array(), '20110723' );
-			wp_enqueue_script( 'bp-jquery-bgiframe', BP_PLUGIN_URL . '/bp-messages/js/autocomplete/jquery.bgiframe.dev.js', array(), '20110723' );
-			wp_enqueue_script( 'bp-jquery-dimensions', BP_PLUGIN_URL . '/bp-messages/js/autocomplete/jquery.dimensions.dev.js', array(), '20110723' );
+			wp_enqueue_script( 'bp-jquery-autocomplete',    BP_PLUGIN_URL . 'bp-messages/js/autocomplete/jquery.autocomplete.dev.js',   array( 'jquery' ), bp_get_version() );
+			wp_enqueue_script( 'bp-jquery-autocomplete-fb', BP_PLUGIN_URL . 'bp-messages/js/autocomplete/jquery.autocompletefb.dev.js', array(),           bp_get_version() );
+			wp_enqueue_script( 'bp-jquery-bgiframe',        BP_PLUGIN_URL . 'bp-messages/js/autocomplete/jquery.bgiframe.dev.js',       array(),           bp_get_version() );
+			wp_enqueue_script( 'bp-jquery-dimensions',      BP_PLUGIN_URL . 'bp-messages/js/autocomplete/jquery.dimensions.dev.js',     array(),           bp_get_version() );
 
 		} else {
-			wp_enqueue_script( 'bp-jquery-autocomplete', BP_PLUGIN_URL . '/bp-messages/js/autocomplete/jquery.autocomplete.js', array( 'jquery' ), '20110723' );
-			wp_enqueue_script( 'bp-jquery-autocomplete-fb', BP_PLUGIN_URL . '/bp-messages/js/autocomplete/jquery.autocompletefb.js', array(), '20110723' );
-			wp_enqueue_script( 'bp-jquery-bgiframe', BP_PLUGIN_URL . '/bp-messages/js/autocomplete/jquery.bgiframe.js', array(), '20110723' );
-			wp_enqueue_script( 'bp-jquery-dimensions', BP_PLUGIN_URL . '/bp-messages/js/autocomplete/jquery.dimensions.js', array(), '20110723' );
+			wp_enqueue_script( 'bp-jquery-autocomplete',    BP_PLUGIN_URL . 'bp-messages/js/autocomplete/jquery.autocomplete.js',   array( 'jquery' ), bp_get_version() );
+			wp_enqueue_script( 'bp-jquery-autocomplete-fb', BP_PLUGIN_URL . 'bp-messages/js/autocomplete/jquery.autocompletefb.js', array(),           bp_get_version() );
+			wp_enqueue_script( 'bp-jquery-bgiframe',        BP_PLUGIN_URL . 'bp-messages/js/autocomplete/jquery.bgiframe.js',       array(),           bp_get_version() );
+			wp_enqueue_script( 'bp-jquery-dimensions',      BP_PLUGIN_URL . 'bp-messages/js/autocomplete/jquery.dimensions.js',     array(),           bp_get_version() );
 		}
 	}
 }
 add_action( 'bp_actions', 'messages_add_autocomplete_js' );
 
 function messages_add_autocomplete_css() {
-	global $bp;
 
 	if ( bp_is_messages_component() && bp_is_current_action( 'compose' ) ) {
-		if ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG )
-			wp_enqueue_style( 'bp-messages-autocomplete', BP_PLUGIN_URL . '/bp-messages/css/autocomplete/jquery.autocompletefb.dev.css', array(), '20110723' );
-		else
-			wp_enqueue_style( 'bp-messages-autocomplete', BP_PLUGIN_URL . '/bp-messages/css/autocomplete/jquery.autocompletefb.css', array(), '20110723' );
+		if ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) {
+			wp_enqueue_style( 'bp-messages-autocomplete', BP_PLUGIN_URL . 'bp-messages/css/autocomplete/jquery.autocompletefb.dev.css', array(), bp_get_version() );
+		} else {
+			wp_enqueue_style( 'bp-messages-autocomplete', BP_PLUGIN_URL . 'bp-messages/css/autocomplete/jquery.autocompletefb.css',     array(), bp_get_version() );
+		}
 
 		wp_print_styles();
 	}
@@ -41,10 +50,10 @@ add_action( 'wp_head', 'messages_add_autocomplete_css' );
 
 function messages_autocomplete_init_jsblock() {
 ?>
+
 	<script type="text/javascript">
 		jQuery(document).ready(function() {
-			var acfb =
-			jQuery("ul.first").autoCompletefb({urlLookup:'<?php echo site_url( 'wp-load.php' ) ?>'});
+			var acfb = jQuery("ul.first").autoCompletefb({urlLookup: ajaxurl});
 
 			jQuery('#send_message_form').submit( function() {
 				var users = document.getElementById('send-to-usernames').className;
@@ -52,5 +61,8 @@ function messages_autocomplete_init_jsblock() {
 			});
 		});
 	</script>
+
 <?php
-}
\ No newline at end of file
+}
+
+?>
diff --git a/wp-content/plugins/buddypress/bp-messages/bp-messages-filters.php b/wp-content/plugins/buddypress/bp-messages/bp-messages-filters.php
index 9ee113df6b8cb547822e9c8662d15c11a95dac4a..fffbc240a28e87fc574f01b05fbfd22b4f1cdfba 100644
--- a/wp-content/plugins/buddypress/bp-messages/bp-messages-filters.php
+++ b/wp-content/plugins/buddypress/bp-messages/bp-messages-filters.php
@@ -1,63 +1,70 @@
 <?php
+
+/**
+ * BuddyPress Messages Filters
+ *
+ * Apply WordPress defined filters to private messages
+ *
+ * @package BuddyPress
+ * @subpackage MessagesFilters
+ */
+
 // Exit if accessed directly
 if ( !defined( 'ABSPATH' ) ) exit;
 
-/* Apply WordPress defined filters */
-add_filter( 'bp_get_message_notice_subject', 'wp_filter_kses', 1 );
-add_filter( 'bp_get_message_notice_text', 'wp_filter_kses', 1 );
-add_filter( 'bp_get_message_thread_subject', 'wp_filter_kses', 1 );
-add_filter( 'bp_get_message_thread_excerpt', 'wp_filter_kses', 1 );
-add_filter( 'bp_get_messages_subject_value', 'wp_filter_kses', 1 );
-add_filter( 'bp_get_messages_content_value', 'wp_filter_kses', 1 );
-add_filter( 'bp_get_the_thread_message_content', 'wp_filter_kses', 1 );
+add_filter( 'bp_get_message_notice_subject',        'wp_filter_kses', 1 );
+add_filter( 'bp_get_message_notice_text',           'wp_filter_kses', 1 );
+add_filter( 'bp_get_message_thread_subject',        'wp_filter_kses', 1 );
+add_filter( 'bp_get_message_thread_excerpt',        'wp_filter_kses', 1 );
+add_filter( 'bp_get_messages_subject_value',        'wp_filter_kses', 1 );
+add_filter( 'bp_get_messages_content_value',        'wp_filter_kses', 1 );
+add_filter( 'bp_get_the_thread_message_content',    'wp_filter_kses', 1 );
 
 add_filter( 'messages_message_content_before_save', 'wp_filter_kses', 1 );
 add_filter( 'messages_message_subject_before_save', 'wp_filter_kses', 1 );
-add_filter( 'messages_notice_message_before_save', 'wp_filter_kses', 1 );
-add_filter( 'messages_notice_subject_before_save', 'wp_filter_kses', 1 );
+add_filter( 'messages_notice_message_before_save',  'wp_filter_kses', 1 );
+add_filter( 'messages_notice_subject_before_save',  'wp_filter_kses', 1 );
 
-add_filter( 'bp_get_the_thread_message_content', 'wp_filter_kses', 1 );
-add_filter( 'bp_get_the_thread_subject', 'wp_filter_kses', 1 );
+add_filter( 'bp_get_the_thread_message_content',    'wp_filter_kses', 1 );
+add_filter( 'bp_get_the_thread_subject',            'wp_filter_kses', 1 );
 
 add_filter( 'messages_message_content_before_save', 'force_balance_tags' );
 add_filter( 'messages_message_subject_before_save', 'force_balance_tags' );
-add_filter( 'messages_notice_message_before_save', 'force_balance_tags' );
-add_filter( 'messages_notice_subject_before_save', 'force_balance_tags' );
+add_filter( 'messages_notice_message_before_save',  'force_balance_tags' );
+add_filter( 'messages_notice_subject_before_save',  'force_balance_tags' );
 
-add_filter( 'bp_get_message_notice_subject', 'wptexturize' );
-add_filter( 'bp_get_message_notice_text', 'wptexturize' );
-add_filter( 'bp_get_message_thread_subject', 'wptexturize' );
-add_filter( 'bp_get_message_thread_excerpt', 'wptexturize' );
+add_filter( 'bp_get_message_notice_subject',     'wptexturize' );
+add_filter( 'bp_get_message_notice_text',        'wptexturize' );
+add_filter( 'bp_get_message_thread_subject',     'wptexturize' );
+add_filter( 'bp_get_message_thread_excerpt',     'wptexturize' );
 add_filter( 'bp_get_the_thread_message_content', 'wptexturize' );
 
-add_filter( 'bp_get_message_notice_subject', 'convert_smilies', 2 );
-add_filter( 'bp_get_message_notice_text', 'convert_smilies', 2 );
-add_filter( 'bp_get_message_thread_subject', 'convert_smilies', 2 );
-add_filter( 'bp_get_message_thread_excerpt', 'convert_smilies', 2 );
+add_filter( 'bp_get_message_notice_subject',     'convert_smilies', 2 );
+add_filter( 'bp_get_message_notice_text',        'convert_smilies', 2 );
+add_filter( 'bp_get_message_thread_subject',     'convert_smilies', 2 );
+add_filter( 'bp_get_message_thread_excerpt',     'convert_smilies', 2 );
 add_filter( 'bp_get_the_thread_message_content', 'convert_smilies', 2 );
 
-add_filter( 'bp_get_message_notice_subject', 'convert_chars' );
-add_filter( 'bp_get_message_notice_text', 'convert_chars' );
-add_filter( 'bp_get_message_thread_subject', 'convert_chars' );
-add_filter( 'bp_get_message_thread_excerpt', 'convert_chars' );
+add_filter( 'bp_get_message_notice_subject',     'convert_chars' );
+add_filter( 'bp_get_message_notice_text',        'convert_chars' );
+add_filter( 'bp_get_message_thread_subject',     'convert_chars' );
+add_filter( 'bp_get_message_thread_excerpt',     'convert_chars' );
 add_filter( 'bp_get_the_thread_message_content', 'convert_chars' );
 
-add_filter( 'bp_get_message_notice_text', 'make_clickable', 9 );
-add_filter( 'bp_get_message_thread_excerpt', 'make_clickable', 9 );
+add_filter( 'bp_get_message_notice_text',        'make_clickable', 9 );
+add_filter( 'bp_get_message_thread_excerpt',     'make_clickable', 9 );
 add_filter( 'bp_get_the_thread_message_content', 'make_clickable', 9 );
 
-add_filter( 'bp_get_message_notice_text', 'wpautop' );
+add_filter( 'bp_get_message_notice_text',        'wpautop' );
 add_filter( 'bp_get_the_thread_message_content', 'wpautop' );
 
-add_filter( 'bp_get_message_notice_subject', 'stripslashes_deep' );
-add_filter( 'bp_get_message_notice_text', 'stripslashes_deep' );
-add_filter( 'bp_get_message_thread_subject', 'stripslashes_deep' );
-add_filter( 'bp_get_message_thread_excerpt', 'stripslashes_deep' );
-add_filter( 'bp_get_messages_subject_value', 'stripslashes_deep' );
-add_filter( 'bp_get_messages_content_value', 'stripslashes_deep' );
-add_filter( 'bp_get_the_thread_message_content', 'stripslashes_deep' );
-
+add_filter( 'bp_get_message_notice_subject',     'stripslashes_deep' );
+add_filter( 'bp_get_message_notice_text',        'stripslashes_deep' );
+add_filter( 'bp_get_message_thread_subject',     'stripslashes_deep' );
+add_filter( 'bp_get_message_thread_excerpt',     'stripslashes_deep' );
+add_filter( 'bp_get_messages_subject_value',     'stripslashes_deep' );
+add_filter( 'bp_get_messages_content_value',     'stripslashes_deep' );
 add_filter( 'bp_get_the_thread_message_content', 'stripslashes_deep' );
-add_filter( 'bp_get_the_thread_subject', 'stripslashes_deep' );
+add_filter( 'bp_get_the_thread_subject',         'stripslashes_deep' );
 
-?>
\ No newline at end of file
+?>
diff --git a/wp-content/plugins/buddypress/bp-messages/bp-messages-functions.php b/wp-content/plugins/buddypress/bp-messages/bp-messages-functions.php
index ca7383a9ef779dbe995efbf474bcb0a61318c4fc..5ba6284a8c37ed86f860a20a27ce6c6db94d13ff 100644
--- a/wp-content/plugins/buddypress/bp-messages/bp-messages-functions.php
+++ b/wp-content/plugins/buddypress/bp-messages/bp-messages-functions.php
@@ -1,19 +1,24 @@
 <?php
-/*******************************************************************************
+
+/**
+ * BuddyPress Messages Functions
+ *
  * Business functions are where all the magic happens in BuddyPress. They will
  * handle the actual saving or manipulation of information. Usually they will
  * hand off to a database class for data access, then return
  * true or false on success or failure.
+ *
+ * @package BuddyPress
+ * @subpackage MessagesFunctions
  */
 
 // Exit if accessed directly
 if ( !defined( 'ABSPATH' ) ) exit;
 
 function messages_new_message( $args = '' ) {
-	global $bp;
 
 	$defaults = array (
-		'sender_id'  => $bp->loggedin_user->id,
+		'sender_id'  => bp_loggedin_user_id(),
 		'thread_id'  => false, // false for a new message, thread id for a reply to a thread.
 		'recipients' => false, // Can be an array of usernames, user_ids or mixed.
 		'subject'    => false,
@@ -84,17 +89,17 @@ function messages_new_message( $args = '' ) {
 		}
 
 		// Strip the sender from the recipient list if they exist
-		if ( $key = array_search( $sender_id, (array)$recipient_ids ) )
+		if ( $key = array_search( $sender_id, (array) $recipient_ids ) )
 			unset( $recipient_ids[$key] );
 
 		// Remove duplicates
-		$recipient_ids = array_unique( (array)$recipient_ids );
+		$recipient_ids = array_unique( (array) $recipient_ids );
 
 		if ( empty( $recipient_ids ) )
 			return false;
 
 		// Format this to match existing recipients
-		foreach( (array)$recipient_ids as $i => $recipient_id ) {
+		foreach( (array) $recipient_ids as $i => $recipient_id ) {
 			$message->recipients[$i]          = new stdClass;
 			$message->recipients[$i]->user_id = $recipient_id;
 		}
@@ -103,7 +108,7 @@ function messages_new_message( $args = '' ) {
 	if ( $message->send() ) {
 
 		// Send screen notifications to the recipients
-		foreach ( (array)$message->recipients as $recipient )
+		foreach ( (array) $message->recipients as $recipient )
 			bp_core_add_notification( $message->id, $recipient->user_id, 'messages', 'new_message' );
 
 		// Send email notifications to the recipients
@@ -119,7 +124,7 @@ function messages_new_message( $args = '' ) {
 
 
 function messages_send_notice( $subject, $message ) {
-	if ( !is_super_admin() || empty( $subject ) || empty( $message ) ) {
+	if ( !bp_current_user_can( 'bp_moderate' ) || empty( $subject ) || empty( $message ) ) {
 		return false;
 
 	// Has access to send notices, lets do it.
@@ -143,8 +148,9 @@ function messages_delete_thread( $thread_ids ) {
 	if ( is_array( $thread_ids ) ) {
 		$error = 0;
 		for ( $i = 0, $count = count( $thread_ids ); $i < $count; ++$i ) {
-			if ( !$status = BP_Messages_Thread::delete( $thread_ids[$i]) )
+			if ( !$status = BP_Messages_Thread::delete( $thread_ids[$i]) ) {
 				$error = 1;
+			}
 		}
 
 		if ( !empty( $error ) )
@@ -164,10 +170,8 @@ function messages_delete_thread( $thread_ids ) {
 }
 
 function messages_check_thread_access( $thread_id, $user_id = 0 ) {
-	global $bp;
-
 	if ( empty( $user_id ) )
-		$user_id = $bp->loggedin_user->id;
+		$user_id = bp_loggedin_user_id();
 
 	return BP_Messages_Thread::check_access( $thread_id, $user_id );
 }
@@ -193,10 +197,8 @@ function messages_remove_callback_values() {
 }
 
 function messages_get_unread_count( $user_id = 0 ) {
-	global $bp;
-
 	if ( empty( $user_id ) )
-		$user_id = $bp->loggedin_user->id;
+		$user_id = bp_loggedin_user_id();
 
 	return BP_Messages_Thread::get_inbox_count( $user_id );
 }
@@ -213,13 +215,8 @@ function messages_is_valid_thread( $thread_id ) {
 	return BP_Messages_Thread::is_valid( $thread_id );
 }
 
-/*******************************************************************************
- * These functions handle the recording, deleting and formatting of activity and
- * notifications for the user and for this specific component.
- */
-
 /**
- * Format the BuddyBar/admin bar notifications for the Messages component
+ * Format the BuddyBar/Toolbar notifications for the Messages component
  *
  * @package BuddyPress
  *
@@ -227,35 +224,35 @@ function messages_is_valid_thread( $thread_id ) {
  * @param int $item_id The primary item id
  * @param int $secondary_item_id The secondary item id
  * @param int $total_items The total number of messaging-related notifications waiting for the user
- * @param str $format 'string' for BuddyBar-compatible notifications; 'array' for WP Admin Bar
+ * @param str $format 'string' for BuddyBar-compatible notifications; 'array' for WP Toolbar
  */
 function messages_format_notifications( $action, $item_id, $secondary_item_id, $total_items, $format = 'string' ) {
-	global $bp;
 
 	if ( 'new_message' == $action ) {
-		$link  = bp_loggedin_user_domain() . bp_get_messages_slug() . '/inbox';
+		$link  = trailingslashit( bp_loggedin_user_domain() . bp_get_messages_slug() . '/inbox' );
 		$title = __( 'Inbox', 'buddypress' );
 
-		if ( (int)$total_items > 1 ) {
-			$text = sprintf( __('You have %d new messages', 'buddypress' ), (int)$total_items );
+		if ( (int) $total_items > 1 ) {
+			$text = sprintf( __('You have %d new messages', 'buddypress' ), (int) $total_items );
 			$filter = 'bp_messages_multiple_new_message_notification';
 		} else {
-			$text = sprintf( __('You have %d new message', 'buddypress' ), (int)$total_items );
+			$text = sprintf( __('You have %d new message', 'buddypress' ), (int) $total_items );
 			$filter = 'bp_messages_single_new_message_notification';
 		}
 	}
 
 	if ( 'string' == $format ) {
-		$return = apply_filters( $filter, '<a href="' . $link . '" title="' . $title . '">' . $text . '</a>', (int)$total_items, $text, $link );
+		$return = apply_filters( $filter, '<a href="' . $link . '" title="' . $title . '">' . $text . '</a>', (int) $total_items, $text, $link );
 	} else {
 		$return = apply_filters( $filter, array(
 			'text' => $text,
 			'link' => $link
-		), $link, (int)$total_items, $text, $link );
+		), $link, (int) $total_items, $text, $link );
 	}
 
 	do_action( 'messages_format_notifications', $action, $item_id, $secondary_item_id, $total_items );
 
 	return $return;
 }
-?>
\ No newline at end of file
+
+?>
diff --git a/wp-content/plugins/buddypress/bp-messages/bp-messages-loader.php b/wp-content/plugins/buddypress/bp-messages/bp-messages-loader.php
index ce6a2c6c98a1a6934e61cd2d5f888f29ccb85fa6..b94b007ed19118a837ba9dc359e539cc4477db12 100644
--- a/wp-content/plugins/buddypress/bp-messages/bp-messages-loader.php
+++ b/wp-content/plugins/buddypress/bp-messages/bp-messages-loader.php
@@ -1,22 +1,31 @@
 <?php
+
 /**
- * BuddyPress Private Messages Loader
+ * BuddyPress Messages Loader
  *
  * A private messages component, for users to send messages to each other
  *
  * @package BuddyPress
- * @subpackage Messages Core
+ * @subpackage MessagesLoader
  */
 
 // Exit if accessed directly
 if ( !defined( 'ABSPATH' ) ) exit;
 
 class BP_Messages_Component extends BP_Component {
+	/**
+	 * If this is true, the Message autocomplete will return friends only, unless
+	 * this is set to false, in which any matching users will be returned.
+	 *
+	 * @since BuddyPress (1.5)
+	 * @var bool
+	 */
+	public $autocomplete_all;
 
 	/**
 	 * Start the messages component creation process
 	 *
-	 * @since 1.5
+	 * @since BuddyPress (1.5)
 	 */
 	function __construct() {
 		parent::start(
@@ -52,8 +61,8 @@ class BP_Messages_Component extends BP_Component {
 	 * The BP_MESSAGES_SLUG constant is deprecated, and only used here for
 	 * backwards compatibility.
 	 *
-	 * @since 1.5
-	 * @global obj $bp
+	 * @since BuddyPress (1.5)
+	 * @global BuddyPress $bp The one true BuddyPress instance
 	 */
 	function setup_globals() {
 		global $bp;
@@ -72,7 +81,6 @@ class BP_Messages_Component extends BP_Component {
 		// All globals for messaging component.
 		// Note that global_tables is included in this array.
 		$globals = array(
-			'path'                  => BP_PLUGIN_DIR,
 			'slug'                  => BP_MESSAGES_SLUG,
 			'has_directory'         => false,
 			'notification_callback' => 'messages_format_notifications',
@@ -88,12 +96,12 @@ class BP_Messages_Component extends BP_Component {
 	/**
 	 * Setup BuddyBar navigation
 	 *
-	 * @global obj $bp
+	 * @global BuddyPress $bp The one true BuddyPress instance
 	 */
 	function setup_nav() {
-		global $bp;
 
-		$name = sprintf( __( 'Messages <span>%s</span>', 'buddypress' ), bp_get_total_unread_messages_count() );
+		$sub_nav = array();
+		$name    = sprintf( __( 'Messages <span>%s</span>', 'buddypress' ), bp_get_total_unread_messages_count() );
 
 		// Add 'Messages' to the main navigation
 		$main_nav = array(
@@ -107,7 +115,7 @@ class BP_Messages_Component extends BP_Component {
 		);
 
 		// Link to user messages
-		$messages_link = trailingslashit( $bp->loggedin_user->domain . $this->slug );
+		$messages_link = trailingslashit( bp_loggedin_user_domain() . $this->slug );
 
 		// Add the subnav items to the profile
 		$sub_nav[] = array(
@@ -140,7 +148,7 @@ class BP_Messages_Component extends BP_Component {
 			'user_has_access' => bp_is_my_profile()
 		);
 
-		if ( is_super_admin() ) {
+		if ( bp_current_user_can( 'bp_moderate' ) ) {
 			$sub_nav[] = array(
 				'name'            => __( 'Notices', 'buddypress' ),
 				'slug'            => 'notices',
@@ -148,7 +156,7 @@ class BP_Messages_Component extends BP_Component {
 				'parent_slug'     => $this->slug,
 				'screen_function' => 'messages_screen_notices',
 				'position'        => 90,
-				'user_has_access' => is_super_admin()
+				'user_has_access' => bp_current_user_can( 'bp_moderate' )
 			);
 		}
 
@@ -156,9 +164,9 @@ class BP_Messages_Component extends BP_Component {
 	}
 
 	/**
-	 * Set up the admin bar
+	 * Set up the Toolbar
 	 *
-	 * @global obj $bp
+	 * @global BuddyPress $bp The one true BuddyPress instance
 	 */
 	function setup_admin_bar() {
 		global $bp;
@@ -170,13 +178,14 @@ class BP_Messages_Component extends BP_Component {
 		if ( is_user_logged_in() ) {
 
 			// Setup the logged in user variables
-			$user_domain   = $bp->loggedin_user->domain;
+			$user_domain   = bp_loggedin_user_domain();
 			$messages_link = trailingslashit( $user_domain . $this->slug );
 
 			// Unread message count
-			if ( $count = messages_get_unread_count() ) {
-				$title = sprintf( __( 'Messages <span class="count">%s</span>', 'buddypress' ), $count );
-				$inbox = sprintf( __( 'Inbox <span class="count">%s</span>',    'buddypress' ), $count );
+			$count = messages_get_unread_count();
+			if ( !empty( $count ) ) {
+				$title = sprintf( __( 'Messages <span class="count">%s</span>', 'buddypress' ), number_format_i18n( $count ) );
+				$inbox = sprintf( __( 'Inbox <span class="count">%s</span>',    'buddypress' ), number_format_i18n( $count ) );
 			} else {
 				$title = __( 'Messages', 'buddypress' );
 				$inbox = __( 'Inbox',    'buddypress' );
@@ -215,7 +224,7 @@ class BP_Messages_Component extends BP_Component {
 			);
 
 			// Site Wide Notices
-			if ( is_super_admin() ) {
+			if ( bp_current_user_can( 'bp_moderate' ) ) {
 				$wp_admin_nav[] = array(
 					'parent' => 'my-account-' . $this->id,
 					'id'     => 'my-account-' . $this->id . '-notices',
@@ -231,7 +240,7 @@ class BP_Messages_Component extends BP_Component {
 	/**
 	 * Sets up the title for pages and <title>
 	 *
-	 * @global obj $bp
+	 * @global BuddyPress $bp The one true BuddyPress instance
 	 */
 	function setup_title() {
 		global $bp;
@@ -241,17 +250,22 @@ class BP_Messages_Component extends BP_Component {
 				$bp->bp_options_title = __( 'My Messages', 'buddypress' );
 			} else {
 				$bp->bp_options_avatar = bp_core_fetch_avatar( array(
-					'item_id' => $bp->displayed_user->id,
-					'type'    => 'thumb'
+					'item_id' => bp_displayed_user_id(),
+					'type'    => 'thumb',
+					'alt'     => sprintf( __( 'Profile picture of %s', 'buddypress' ), bp_get_displayed_user_fullname() )
 				) );
-				$bp->bp_options_title = $bp->displayed_user->fullname;
+				$bp->bp_options_title = bp_get_displayed_user_fullname();
 			}
 		}
 
 		parent::setup_title();
 	}
 }
-// Create the messages component
-$bp->messages = new BP_Messages_Component();
+
+function bp_setup_messages() {
+	global $bp;
+	$bp->messages = new BP_Messages_Component();
+}
+add_action( 'bp_setup_components', 'bp_setup_messages', 6 );
 
 ?>
\ No newline at end of file
diff --git a/wp-content/plugins/buddypress/bp-messages/bp-messages-notifications.php b/wp-content/plugins/buddypress/bp-messages/bp-messages-notifications.php
index 1e09b556d936f5036a8f91354a7357f325906b83..d709c1c3c5e09020735f0ec0e1688a6ef0ffba0d 100644
--- a/wp-content/plugins/buddypress/bp-messages/bp-messages-notifications.php
+++ b/wp-content/plugins/buddypress/bp-messages/bp-messages-notifications.php
@@ -1,57 +1,74 @@
 <?php
+
+/**
+ * BuddyPress Messages Notifications
+ *
+ * @package BuddyPress
+ * @subpackage MessagesNotifications
+ */
+
+
 // Exit if accessed directly
 if ( !defined( 'ABSPATH' ) ) exit;
 
-function messages_notification_new_message( $args ) {
-	global $bp;
+function messages_notification_new_message( $args = array() ) {
+
+	// These should be extracted below
+	$recipients    = array();
+	$email_subject = $email_content = '';
+
+	extract( $args );
+
+	$sender_name = bp_core_get_user_displayname( $sender_id );
 
-	extract($args);
+	// Bail if no recipients
+	if ( ! empty( $recipients ) ) {
 
-	$email_subject = $email_content = $args = '';
-	$sender_name   = bp_core_get_user_displayname( $sender_id );
+		foreach( $recipients as $recipient ) {
 
-	foreach( $recipients as $recipient ) {
-		if ( $sender_id == $recipient->user_id || 'no' == bp_get_user_meta( $recipient->user_id, 'notification_messages_new_message', true ) )
-			continue;
+			if ( $sender_id == $recipient->user_id || 'no' == bp_get_user_meta( $recipient->user_id, 'notification_messages_new_message', true ) )
+				continue;
 
-		// User data and links
-		$ud            = get_userdata( $recipient->user_id );
-		$message_link  = bp_core_get_user_domain( $recipient->user_id ) . bp_get_messages_slug() .'/';
-		$settings_link = bp_core_get_user_domain( $recipient->user_id ) . bp_get_settings_slug() . '/notifications/';
+			// User data and links
+			$ud            = get_userdata( $recipient->user_id );
+			$message_link  = bp_core_get_user_domain( $recipient->user_id ) . bp_get_messages_slug() .'/';
+			$settings_slug = function_exists( 'bp_get_settings_slug' ) ? bp_get_settings_slug() : 'settings';
+			$settings_link = bp_core_get_user_domain( $recipient->user_id ) . $settings_slug . '/notifications/';
 
-		// Sender info
-		$sender_name   = stripslashes( $sender_name );
-		$subject       = stripslashes( wp_filter_kses( $subject ) );
-		$content       = stripslashes( wp_filter_kses( $content ) );
+			// Sender info
+			$sender_name   = stripslashes( $sender_name );
+			$subject       = stripslashes( wp_filter_kses( $subject ) );
+			$content       = stripslashes( wp_filter_kses( $content ) );
 
-		// Set up and send the message
-		$email_to      = $ud->user_email;
-		$sitename      = wp_specialchars_decode( get_blog_option( bp_get_root_blog_id(), 'blogname' ), ENT_QUOTES );
-		$email_subject = '[' . $sitename . '] ' . sprintf( __( 'New message from %s', 'buddypress' ), $sender_name );
+			// Set up and send the message
+			$email_to      = $ud->user_email;
+			$sitename      = wp_specialchars_decode( get_blog_option( bp_get_root_blog_id(), 'blogname' ), ENT_QUOTES );
+			$email_subject = '[' . $sitename . '] ' . sprintf( __( 'New message from %s', 'buddypress' ), $sender_name );
 
-		$email_content = sprintf( __(
-'%s sent you a new message:
+			$email_content = sprintf( __(
+'%1$s sent you a new message:
 
-Subject: %s
+Subject: %2$s
 
-"%s"
+"%3$s"
 
-To view and read your messages please log in and visit: %s
+To view and read your messages please log in and visit: %4$s
 
 ---------------------
 ', 'buddypress' ), $sender_name, $subject, $content, $message_link );
 
-		$email_content .= sprintf( __( 'To disable these notifications please log in and go to: %s', 'buddypress' ), $settings_link );
+			$email_content .= sprintf( __( 'To disable these notifications please log in and go to: %s', 'buddypress' ), $settings_link );
 
-		// Send the message
-		$email_to = apply_filters( 'messages_notification_new_message_to', $email_to );
-		$email_subject = apply_filters( 'messages_notification_new_message_subject', $email_subject, $sender_name );
-		$email_content = apply_filters( 'messages_notification_new_message_message', $email_content, $sender_name, $subject, $content, $message_link, $settings_link );
+			// Send the message
+			$email_to      = apply_filters( 'messages_notification_new_message_to',      $email_to );
+			$email_subject = apply_filters( 'messages_notification_new_message_subject', $email_subject, $sender_name );
+			$email_content = apply_filters( 'messages_notification_new_message_message', $email_content, $sender_name, $subject, $content, $message_link, $settings_link );
 
-		wp_mail( $email_to, $email_subject, $email_content );
+			wp_mail( $email_to, $email_subject, $email_content );
+		}
 	}
 
 	do_action( 'bp_messages_sent_notification_email', $recipients, $email_subject, $email_content, $args );
 }
 
-?>
\ No newline at end of file
+?>
diff --git a/wp-content/plugins/buddypress/bp-messages/bp-messages-screens.php b/wp-content/plugins/buddypress/bp-messages/bp-messages-screens.php
index 62a6f49e2d6f45915eea2a5cd1b1b69e9e6eea5f..85a10f1d2cc16e1d80524df2871099d68527c98d 100644
--- a/wp-content/plugins/buddypress/bp-messages/bp-messages-screens.php
+++ b/wp-content/plugins/buddypress/bp-messages/bp-messages-screens.php
@@ -1,16 +1,20 @@
 <?php
-/*******************************************************************************
+
+/**
+ * BuddyPress Messages Screens
+ *
  * Screen functions are the controllers of BuddyPress. They will execute when their
  * specific URL is caught. They will first save or manipulate data using business
  * functions, then pass on the user to a template file.
+ *
+ * @package BuddyPress
+ * @subpackage MessagesScreens
  */
 
 // Exit if accessed directly
 if ( !defined( 'ABSPATH' ) ) exit;
 
 function messages_screen_inbox() {
-	global $bp;
-
 	if ( bp_action_variables() ) {
 		bp_do_404();
 		return;
@@ -21,8 +25,6 @@ function messages_screen_inbox() {
 }
 
 function messages_screen_sentbox() {
-	global $bp;
-
 	if ( bp_action_variables() ) {
 		bp_do_404();
 		return;
@@ -57,7 +59,7 @@ function messages_screen_compose() {
 			if ( isset( $_POST['send-notice'] ) ) {
 				if ( messages_send_notice( $_POST['subject'], $_POST['content'] ) ) {
 					bp_core_add_message( __( 'Notice sent successfully!', 'buddypress' ) );
-					bp_core_redirect( $bp->loggedin_user->domain . $bp->messages->slug . '/inbox/' );
+					bp_core_redirect( bp_loggedin_user_domain() . $bp->messages->slug . '/inbox/' );
 				} else {
 					bp_core_add_message( __( 'There was an error sending that notice, please try again', 'buddypress' ), 'error' );
 				}
@@ -71,7 +73,7 @@ function messages_screen_compose() {
 				// Send the message
 				if ( $thread_id = messages_new_message( array( 'recipients' => $recipients, 'subject' => $_POST['subject'], 'content' => $_POST['content'] ) ) ) {
 					bp_core_add_message( __( 'Message sent successfully!', 'buddypress' ) );
-					bp_core_redirect( $bp->loggedin_user->domain . $bp->messages->slug . '/view/' . $thread_id . '/' );
+					bp_core_redirect( bp_loggedin_user_domain() . $bp->messages->slug . '/view/' . $thread_id . '/' );
 				} else {
 					bp_core_add_message( __( 'There was an error sending that message, please try again', 'buddypress' ), 'error' );
 				}
@@ -87,7 +89,7 @@ function messages_screen_compose() {
 function messages_screen_notices() {
 	global $notice_id;
 
-	if ( !is_super_admin() )
+	if ( !bp_current_user_can( 'bp_moderate' ) )
 		return false;
 
 	$notice_id = (int)bp_action_variable( 1 );
@@ -114,7 +116,7 @@ function messages_screen_notices() {
 				bp_core_add_message( __('Notice deleted.', 'buddypress') );
 			}
 		}
-		bp_core_redirect( bp_loggedin_user_domain() . bp_get_messages_slug() . '/notices' );
+		bp_core_redirect( trailingslashit( bp_loggedin_user_domain() . bp_get_messages_slug() . '/notices' ) );
 	}
 
 	if ( bp_action_variables() ) {
@@ -128,19 +130,16 @@ function messages_screen_notices() {
 }
 
 function messages_screen_notification_settings() {
-	global $bp;
-
 	if ( bp_action_variables() ) {
 		bp_do_404();
 		return;
 	}
 
-	if ( !$new_messages = bp_get_user_meta( $bp->displayed_user->id, 'notification_messages_new_message', true ) )
+	if ( !$new_messages = bp_get_user_meta( bp_displayed_user_id(), 'notification_messages_new_message', true ) )
 		$new_messages = 'yes';
 
-	if ( !$new_notices = bp_get_user_meta( $bp->displayed_user->id, 'notification_messages_new_notice', true ) )
-		$new_notices  = 'yes';
-?>
+	if ( !$new_notices = bp_get_user_meta( bp_displayed_user_id(), 'notification_messages_new_notice', true ) )
+		$new_notices  = 'yes'; ?>
 
 	<table class="notification-settings" id="messages-notification-settings">
 		<thead>
@@ -174,4 +173,4 @@ function messages_screen_notification_settings() {
 }
 add_action( 'bp_notification_settings', 'messages_screen_notification_settings', 2 );
 
-?>
\ No newline at end of file
+?>
diff --git a/wp-content/plugins/buddypress/bp-messages/bp-messages-template.php b/wp-content/plugins/buddypress/bp-messages/bp-messages-template.php
index bbe812ce65edabfcad33987bb5001adead0003ce..0d0ec8f4a0c096cdfcd66bf12dbe412982a66135 100644
--- a/wp-content/plugins/buddypress/bp-messages/bp-messages-template.php
+++ b/wp-content/plugins/buddypress/bp-messages/bp-messages-template.php
@@ -1,11 +1,19 @@
 <?php
+
+/**
+ * BuddyPress Messages Template Tags
+ *
+ * @package BuddyPress
+ * @subpackage MessagesTemplate
+ */
+
 // Exit if accessed directly
 if ( !defined( 'ABSPATH' ) ) exit;
 
-/*****************************************************************************
+/**
  * Message Box Template Class
- **/
-Class BP_Messages_Box_Template {
+ */
+class BP_Messages_Box_Template {
 	var $current_thread = -1;
 	var $current_thread_count;
 	var $total_thread_count;
@@ -19,23 +27,24 @@ Class BP_Messages_Box_Template {
 	var $pag_page;
 	var $pag_num;
 	var $pag_links;
+	var $search_terms;
 
-	function bp_messages_box_template( $user_id, $box, $per_page, $max, $type ) {
-		$this->__construct( $user_id, $box, $per_page, $max, $type );
-	}
-
-	function __construct( $user_id, $box, $per_page, $max, $type ) {
-		$this->pag_page = isset( $_GET['mpage'] ) ? intval( $_GET['mpage'] ) : 1;
-		$this->pag_num  = isset( $_GET['num'] ) ? intval( $_GET['num'] ) : $per_page;
+	function __construct( $user_id, $box, $per_page, $max, $type, $search_terms, $page_arg = 'mpage' ) {
+		$this->pag_page = isset( $_GET[$page_arg] ) ? intval( $_GET[$page_arg] ) : 1;
+		$this->pag_num  = isset( $_GET['num'] )   ? intval( $_GET['num'] )   : $per_page;
 
-		$this->user_id  = $user_id;
-		$this->box      = $box;
-		$this->type     = $type;
+		$this->user_id      = $user_id;
+		$this->box          = $box;
+		$this->type         = $type;
+		$this->search_terms = $search_terms;
 
 		if ( 'notices' == $this->box ) {
-			$this->threads = BP_Messages_Notice::get_notices();
+			$this->threads = BP_Messages_Notice::get_notices( array(
+				'pag_num'  => $this->pag_num,
+				'pag_page' => $this->pag_page
+			) );
 		} else {
-			$threads = BP_Messages_Thread::get_current_threads_for_user( $this->user_id, $this->box, $this->type, $this->pag_num, $this->pag_page );
+			$threads = BP_Messages_Thread::get_current_threads_for_user( $this->user_id, $this->box, $this->type, $this->pag_num, $this->pag_page, $this->search_terms );
 
 			$this->threads            = $threads['threads'];
 			$this->total_thread_count = $threads['total'];
@@ -47,30 +56,30 @@ Class BP_Messages_Box_Template {
 		} else {
 			$total_notice_count = BP_Messages_Notice::get_total_notice_count();
 
-			if ( !$max || $max >= (int)$total_notice_count ) {
+			if ( !$max || $max >= (int) $total_notice_count ) {
 				if ( 'notices' == $this->box ) {
-					$this->total_thread_count = (int)$total_notice_count;
+					$this->total_thread_count = (int) $total_notice_count;
 				}
 			} else {
-				$this->total_thread_count = (int)$max;
+				$this->total_thread_count = (int) $max;
 			}
 
 			if ( $max ) {
 				if ( $max >= count( $this->threads ) ) {
 					$this->thread_count = count( $this->threads );
 				} else {
-					$this->thread_count = (int)$max;
+					$this->thread_count = (int) $max;
 				}
 			} else {
 				$this->thread_count = count( $this->threads );
 			}
 		}
 
-		if ( (int)$this->total_thread_count && (int)$this->pag_num ) {
+		if ( (int) $this->total_thread_count && (int) $this->pag_num ) {
 			$this->pag_links = paginate_links( array(
-				'base'      => add_query_arg( 'mpage', '%#%' ),
+				'base'      => add_query_arg( $page_arg, '%#%' ),
 				'format'    => '',
-				'total'     => ceil( (int)$this->total_thread_count / (int)$this->pag_num ),
+				'total'     => ceil( (int) $this->total_thread_count / (int) $this->pag_num ),
 				'current'   => $this->pag_page,
 				'prev_text' => _x( '&larr;', 'Message pagination previous text', 'buddypress' ),
 				'next_text' => _x( '&rarr;', 'Message pagination next text', 'buddypress' ),
@@ -114,28 +123,27 @@ Class BP_Messages_Box_Template {
 	}
 
 	function the_message_thread() {
-		global $bp;
 
 		$this->in_the_loop = true;
-		$this->thread = $this->next_thread();
+		$this->thread      = $this->next_thread();
 
-		if ( 'notices' != $bp->current_action ) {
-			$last_message_index = count( $this->thread->messages ) - 1;
-			$this->thread->messages = array_reverse( (array)$this->thread->messages );
+		if ( ! bp_is_current_action( 'notices' ) ) {
+			$last_message_index     = count( $this->thread->messages ) - 1;
+			$this->thread->messages = array_reverse( (array) $this->thread->messages );
 
 			// Set up the last message data
 			if ( count($this->thread->messages) > 1 ) {
 				if ( 'inbox' == $this->box ) {
-					foreach ( (array)$this->thread->messages as $key => $message ) {
-						if ( $bp->loggedin_user->id != $message->sender_id ) {
+					foreach ( (array) $this->thread->messages as $key => $message ) {
+						if ( bp_loggedin_user_id() != $message->sender_id ) {
 							$last_message_index = $key;
 							break;
 						}
 					}
 
 				} elseif ( 'sentbox' == $this->box ) {
-					foreach ( (array)$this->thread->messages as $key => $message ) {
-						if ( $bp->loggedin_user->id == $message->sender_id ) {
+					foreach ( (array) $this->thread->messages as $key => $message ) {
+						if ( bp_loggedin_user_id() == $message->sender_id ) {
 							$last_message_index = $key;
 							break;
 						}
@@ -143,15 +151,17 @@ Class BP_Messages_Box_Template {
 				}
 			}
 
-			$this->thread->last_message_id = $this->thread->messages[$last_message_index]->id;
-			$this->thread->last_message_date = $this->thread->messages[$last_message_index]->date_sent;
-			$this->thread->last_sender_id = $this->thread->messages[$last_message_index]->sender_id;
+			$this->thread->last_message_id      = $this->thread->messages[$last_message_index]->id;
+			$this->thread->last_message_date    = $this->thread->messages[$last_message_index]->date_sent;
+			$this->thread->last_sender_id       = $this->thread->messages[$last_message_index]->sender_id;
 			$this->thread->last_message_subject = $this->thread->messages[$last_message_index]->subject;
 			$this->thread->last_message_content = $this->thread->messages[$last_message_index]->message;
 		}
 
-		if ( 0 == $this->current_thread ) // loop has just started
+		// loop has just started
+		if ( 0 == $this->current_thread ) {
 			do_action('messages_box_loop_start');
+		}
 	}
 }
 
@@ -159,29 +169,34 @@ function bp_has_message_threads( $args = '' ) {
 	global $bp, $messages_template;
 
 	$defaults = array(
-		'user_id' => $bp->loggedin_user->id,
-		'box' => 'inbox',
-		'per_page' => 10,
-		'max' => false,
-		'type' => 'all'
+		'user_id'      => bp_loggedin_user_id(),
+		'box'          => 'inbox',
+		'per_page'     => 10,
+		'max'          => false,
+		'type'         => 'all',
+		'search_terms' => isset( $_REQUEST['s'] ) ? stripslashes( $_REQUEST['s'] ) : '',
+		'page_arg'     => 'mpage', // See https://buddypress.trac.wordpress.org/ticket/3679
 	);
 
 	$r = wp_parse_args( $args, $defaults );
 	extract( $r, EXTR_SKIP );
 
-	if ( 'notices' == $bp->current_action && !is_super_admin() ) {
-		wp_redirect( $bp->displayed_user->id );
+	if ( bp_is_current_action( 'notices' ) && !bp_current_user_can( 'bp_moderate' ) ) {
+		wp_redirect( bp_displayed_user_id() );
 	} else {
-		if ( 'inbox' == $bp->current_action )
-			bp_core_delete_notifications_by_type( $bp->loggedin_user->id, $bp->messages->id, 'new_message' );
+		if ( bp_is_current_action( 'inbox' ) ) {
+			bp_core_delete_notifications_by_type( bp_loggedin_user_id(), $bp->messages->id, 'new_message' );
+		}
 
-		if ( 'sentbox' == $bp->current_action )
+		if ( bp_is_current_action( 'sentbox' ) ) {
 			$box = 'sentbox';
+		}
 
-		if ( 'notices' == $bp->current_action )
+		if ( bp_is_current_action( 'notices' ) ) {
 			$box = 'notices';
+		}
 
-		$messages_template = new BP_Messages_Box_Template( $user_id, $box, $per_page, $max, $type );
+		$messages_template = new BP_Messages_Box_Template( $user_id, $box, $per_page, $max, $type, $search_terms, $page_arg );
 	}
 
 	return apply_filters( 'bp_has_message_threads', $messages_template->has_threads(), $messages_template );
@@ -210,7 +225,7 @@ function bp_message_thread_subject() {
 	echo bp_get_message_thread_subject();
 }
 	function bp_get_message_thread_subject() {
-		global $messages_template, $message_template_subject;
+		global $messages_template;
 
 		return apply_filters( 'bp_get_message_thread_subject', stripslashes_deep( $messages_template->thread->last_message_subject ) );
 	}
@@ -228,7 +243,7 @@ function bp_message_thread_from() {
 	echo bp_get_message_thread_from();
 }
 	function bp_get_message_thread_from() {
-		global $messages_template, $bp;
+		global $messages_template;
 
 		return apply_filters( 'bp_get_message_thread_from', bp_core_get_userlink( $messages_template->thread->last_sender_id ) );
 	}
@@ -238,7 +253,7 @@ function bp_message_thread_to() {
 }
 	function bp_get_message_thread_to() {
 		global $messages_template;
-		return apply_filters( 'bp_message_thread_to', BP_Messages_Thread::get_recipient_links($messages_template->thread->recipients) );
+		return apply_filters( 'bp_message_thread_to', BP_Messages_Thread::get_recipient_links($messages_template->thread->recipients ) );
 	}
 
 function bp_message_thread_view_link() {
@@ -246,7 +261,7 @@ function bp_message_thread_view_link() {
 }
 	function bp_get_message_thread_view_link() {
 		global $messages_template, $bp;
-		return apply_filters( 'bp_get_message_thread_view_link', trailingslashit( $bp->loggedin_user->domain . $bp->messages->slug . '/view/' . $messages_template->thread->thread_id ) );
+		return apply_filters( 'bp_get_message_thread_view_link', trailingslashit( bp_loggedin_user_domain() . $bp->messages->slug . '/view/' . $messages_template->thread->thread_id ) );
 	}
 
 function bp_message_thread_delete_link() {
@@ -254,7 +269,7 @@ function bp_message_thread_delete_link() {
 }
 	function bp_get_message_thread_delete_link() {
 		global $messages_template, $bp;
-		return apply_filters( 'bp_get_message_thread_delete_link', wp_nonce_url( $bp->loggedin_user->domain . $bp->messages->slug . '/' . $bp->current_action . '/delete/' . $messages_template->thread->thread_id, 'messages_delete_thread' ) );
+		return apply_filters( 'bp_get_message_thread_delete_link', wp_nonce_url( trailingslashit( bp_loggedin_user_domain() . $bp->messages->slug . '/' . bp_current_action() . '/delete/' . $messages_template->thread->thread_id ), 'messages_delete_thread' ) );
 	}
 
 function bp_message_css_class() {
@@ -287,7 +302,7 @@ function bp_message_thread_unread_count() {
 	function bp_get_message_thread_unread_count() {
 		global $messages_template;
 
-		if ( (int)$messages_template->thread->unread_count )
+		if ( (int) $messages_template->thread->unread_count )
 			return apply_filters( 'bp_get_message_thread_unread_count', $messages_template->thread->unread_count );
 
 		return false;
@@ -306,9 +321,9 @@ function bp_message_thread_avatar() {
 	echo bp_get_message_thread_avatar();
 }
 	function bp_get_message_thread_avatar() {
-		global $messages_template, $bp;
+		global $messages_template;
 
-		return apply_filters( 'bp_get_message_thread_avatar', bp_core_fetch_avatar( array( 'item_id' => $messages_template->thread->last_sender_id, 'type' => 'thumb' ) ) );
+		return apply_filters( 'bp_get_message_thread_avatar', bp_core_fetch_avatar( array( 'item_id' => $messages_template->thread->last_sender_id, 'type' => 'thumb', 'alt' => sprintf( __( 'Profile picture of %s', 'buddypress' ), bp_core_get_user_displayname( $messages_template->thread->last_sender_id ) ) ) ) );
 	}
 
 function bp_message_thread_view() {
@@ -343,6 +358,24 @@ function bp_messages_pagination_count() {
 	echo sprintf( __( 'Viewing message %1$s to %2$s (of %3$s messages)', 'buddypress' ), $from_num, $to_num, $total ); ?><?php
 }
 
+/**
+ * Output the Private Message search form
+ *
+ * @since BuddyPress (1.6)
+ */
+function bp_message_search_form() {
+
+	$default_search_value = bp_get_search_default_text( 'messages' );
+	$search_value         = !empty( $_REQUEST['s'] ) ? stripslashes( $_REQUEST['s'] ) : $default_search_value; ?>
+
+	<form action="" method="get" id="search-message-form">
+		<label><input type="text" name="s" id="messages_search" <?php if ( $search_value === $default_search_value ) : ?>placeholder="<?php echo esc_html( $search_value ); ?>"<?php endif; ?> <?php if ( $search_value !== $default_search_value ) : ?>value="<?php echo esc_html( $search_value ); ?>"<?php endif; ?> /></label>
+		<input type="submit" id="messages_search_submit" name="messages_search_submit" value="<?php _e( 'Search', 'buddypress' ) ?>" />
+	</form>
+
+<?php
+}
+
 /**
  * Echoes the form action for Messages HTML forms
  *
@@ -396,39 +429,72 @@ function bp_messages_content_value() {
 	}
 
 function bp_messages_options() {
-	global $bp;
 ?>
+
 	<?php _e( 'Select:', 'buddypress' ) ?>
+
 	<select name="message-type-select" id="message-type-select">
 		<option value=""></option>
 		<option value="read"><?php _e('Read', 'buddypress') ?></option>
 		<option value="unread"><?php _e('Unread', 'buddypress') ?></option>
 		<option value="all"><?php _e('All', 'buddypress') ?></option>
 	</select> &nbsp;
-	<?php if ( $bp->current_action != 'sentbox' && $bp->current_action != 'notices' ) : ?>
+
+	<?php if ( ! bp_is_current_action( 'sentbox' ) && bp_is_current_action( 'notices' ) ) : ?>
+
 		<a href="#" id="mark_as_read"><?php _e('Mark as Read', 'buddypress') ?></a> &nbsp;
 		<a href="#" id="mark_as_unread"><?php _e('Mark as Unread', 'buddypress') ?></a> &nbsp;
+
 	<?php endif; ?>
-	<a href="#" id="delete_<?php echo $bp->current_action ?>_messages"><?php _e('Delete Selected', 'buddypress') ?></a> &nbsp;
+
+	<a href="#" id="delete_<?php echo bp_current_action(); ?>_messages"><?php _e( 'Delete Selected', 'buddypress' ); ?></a> &nbsp;
+
 <?php
 }
 
-function bp_message_is_active_notice() {
+/**
+ * Return whether or not the notice is currently active
+ *
+ * @since BuddyPress (1.6)
+ * @uses bp_get_messages_is_active_notice()
+ */
+function bp_messages_is_active_notice() {
 	global $messages_template;
 
-	if ( $messages_template->thread->is_active ) {
-		echo "<strong>";
-		_e( 'Currently Active', 'buddypress' );
-		echo "</strong>";
-	}
+	if ( $messages_template->thread->is_active )
+		return true;
+
+	return false;
 }
+
+/**
+ * Output a string for the active notice
+ *
+ * Since 1.6 this function has been deprecated in favor of text in the theme
+ *
+ * @since BuddyPress (1.0)
+ * @deprecated BuddyPress (1.6)
+ * @uses bp_get_message_is_active_notice()
+ */
+function bp_message_is_active_notice() {
+	echo bp_get_message_is_active_notice();
+}
+	/**
+	 * Returns a string for the active notice
+	 *
+	 * Since 1.6 this function has been deprecated in favor of text in the theme
+	 *
+	 * @since BuddyPress (1.0)
+	 * @deprecated BuddyPress (1.6)
+	 * @uses bp_messages_is_active_notice()
+	 */
 	function bp_get_message_is_active_notice() {
-		global $messages_template;
 
-		if ( $messages_template->thread->is_active )
-			return true;
+		$string = '';
+		if ( bp_messages_is_active_notice() )
+			$string = __( 'Currently Active', 'buddypress' );
 
-		return false;
+		return apply_filters( 'bp_get_message_is_active_notice', $string );
 	}
 
 function bp_message_notice_id() {
@@ -469,7 +535,7 @@ function bp_message_notice_delete_link() {
 	function bp_get_message_notice_delete_link() {
 		global $messages_template, $bp;
 
-		return apply_filters( 'bp_get_message_notice_delete_link', wp_nonce_url( $bp->loggedin_user->domain . $bp->messages->slug . '/notices/delete/' . $messages_template->thread->id, 'messages_delete_thread' ) );
+		return apply_filters( 'bp_get_message_notice_delete_link', wp_nonce_url( bp_loggedin_user_domain() . $bp->messages->slug . '/notices/delete/' . $messages_template->thread->id, 'messages_delete_thread' ) );
 	}
 
 function bp_message_activate_deactivate_link() {
@@ -478,10 +544,10 @@ function bp_message_activate_deactivate_link() {
 	function bp_get_message_activate_deactivate_link() {
 		global $messages_template, $bp;
 
-		if ( 1 == (int)$messages_template->thread->is_active ) {
-			$link = wp_nonce_url( $bp->loggedin_user->domain . $bp->messages->slug . '/notices/deactivate/' . $messages_template->thread->id, 'messages_deactivate_notice' );
+		if ( 1 == (int) $messages_template->thread->is_active ) {
+			$link = wp_nonce_url( trailingslashit( bp_loggedin_user_domain() . $bp->messages->slug . '/notices/deactivate/' . $messages_template->thread->id ), 'messages_deactivate_notice' );
 		} else {
-			$link = wp_nonce_url( $bp->loggedin_user->domain . $bp->messages->slug . '/notices/activate/' . $messages_template->thread->id, 'messages_activate_notice' );
+			$link = wp_nonce_url( trailingslashit( bp_loggedin_user_domain() . $bp->messages->slug . '/notices/activate/' . $messages_template->thread->id ), 'messages_activate_notice' );
 		}
 		return apply_filters( 'bp_get_message_activate_deactivate_link', $link );
 	}
@@ -492,7 +558,7 @@ function bp_message_activate_deactivate_text() {
 	function bp_get_message_activate_deactivate_text() {
 		global $messages_template;
 
-		if ( 1 == (int)$messages_template->thread->is_active  ) {
+		if ( 1 == (int) $messages_template->thread->is_active  ) {
 			$text = __('Deactivate', 'buddypress');
 		} else {
 			$text = __('Activate', 'buddypress');
@@ -505,7 +571,7 @@ function bp_message_activate_deactivate_text() {
  *
  * @package BuddyPress
  * @subpackage Messages Template
- * @since 1.5
+ * @since BuddyPress (1.5)
  *
  * @uses bp_get_messages_slug()
  */
@@ -517,7 +583,7 @@ function bp_messages_slug() {
 	 *
 	 * @package BuddyPress
 	 * @subpackage Messages Template
-	 * @since 1.5
+	 * @since BuddyPress (1.5)
 	 */
 	function bp_get_messages_slug() {
 		global $bp;
@@ -556,12 +622,11 @@ function bp_send_private_message_link() {
 	echo bp_get_send_private_message_link();
 }
 	function bp_get_send_private_message_link() {
-		global $bp;
 
 		if ( bp_is_my_profile() || !is_user_logged_in() )
 			return false;
 
-		return apply_filters( 'bp_get_send_private_message_link', wp_nonce_url( $bp->loggedin_user->domain . $bp->messages->slug . '/compose/?r=' . bp_core_get_username( $bp->displayed_user->id, $bp->displayed_user->userdata->user_nicename, $bp->displayed_user->userdata->user_login ) ) );
+		return apply_filters( 'bp_get_send_private_message_link', wp_nonce_url( bp_loggedin_user_domain() . bp_get_messages_slug() . '/compose/?r=' . bp_core_get_username( bp_displayed_user_id() ) ) );
 	}
 
 /**
@@ -650,14 +715,8 @@ class BP_Messages_Thread_Template {
 	var $pag_links;
 	var $total_message_count;
 
-	function bp_messages_thread_template( $thread_id, $order ) {
-		$this->__construct( $thread_id, $order );
-	}
-
 	function __construct( $thread_id, $order ) {
-		global $bp;
-
-		$this->thread = new BP_Messages_Thread( $thread_id, $order );
+		$this->thread        = new BP_Messages_Thread( $thread_id, $order );
 		$this->message_count = count( $this->thread->messages );
 
 		$last_message_index = $this->message_count - 1;
@@ -703,29 +762,28 @@ class BP_Messages_Thread_Template {
 	}
 
 	function the_message() {
-		global $message;
-
 		$this->in_the_loop = true;
-		$this->message = $this->next_message();
+		$this->message     = $this->next_message();
 
-		if ( 0 == $this->current_message ) // loop has just started
+		// loop has just started
+		if ( 0 == $this->current_message )
 			do_action('thread_loop_start');
 	}
 }
 
 function bp_thread_has_messages( $args = '' ) {
-	global $bp, $thread_template, $group_id;
+	global $thread_template;
 
 	$defaults = array(
 		'thread_id' => false,
-		'order' => 'ASC'
+		'order'     => 'ASC'
 	);
 
 	$r = wp_parse_args( $args, $defaults );
 	extract( $r, EXTR_SKIP );
 
-	if ( !$thread_id && bp_is_messages_component() && bp_is_current_action( 'view' ) )
-		$thread_id = (int)bp_action_variable( 0 );
+	if ( empty( $thread_id ) && bp_is_messages_component() && bp_is_current_action( 'view' ) )
+		$thread_id = (int) bp_action_variable( 0 );
 
 	$thread_template = new BP_Messages_Thread_Template( $thread_id, $order );
 	return $thread_template->has_messages();
@@ -774,16 +832,23 @@ function bp_the_thread_recipients() {
 	echo bp_get_the_thread_recipients();
 }
 	function bp_get_the_thread_recipients() {
-		global $thread_template, $bp;
+		global $thread_template;
 
 		$recipient_links = array();
 
 		if ( count( $thread_template->thread->recipients ) >= 5 )
 			return apply_filters( 'bp_get_the_thread_recipients', sprintf( __( '%d Recipients', 'buddypress' ), count($thread_template->thread->recipients) ) );
 
-		foreach( (array)$thread_template->thread->recipients as $recipient ) {
-			if ( $recipient->user_id !== $bp->loggedin_user->id )
-				$recipient_links[] = bp_core_get_userlink( $recipient->user_id );
+		foreach( (array) $thread_template->thread->recipients as $recipient ) {
+			if ( (int) $recipient->user_id !== bp_loggedin_user_id() ) {
+				$recipient_link = bp_core_get_userlink( $recipient->user_id );
+
+				if ( empty( $recipient_link ) ) {
+					$recipient_link = __( 'Deleted User', 'buddypress' );
+				}
+
+				$recipient_links[] = $recipient_link;
+			}
 		}
 
 		return apply_filters( 'bp_get_the_thread_recipients', implode( ', ', $recipient_links ) );
@@ -810,15 +875,15 @@ function bp_the_thread_message_sender_avatar( $args = '' ) {
 		global $thread_template;
 
 		$defaults = array(
-			'type' => 'thumb',
-			'width' => false,
+			'type'   => 'thumb',
+			'width'  => false,
 			'height' => false,
 		);
 
 		$r = wp_parse_args( $args, $defaults );
 		extract( $r, EXTR_SKIP );
 
-		return apply_filters( 'bp_get_the_thread_message_sender_avatar_thumb', bp_core_fetch_avatar( array( 'item_id' => $thread_template->message->sender_id, 'type' => $type, 'width' => $width, 'height' => $height ) ) );
+		return apply_filters( 'bp_get_the_thread_message_sender_avatar_thumb', bp_core_fetch_avatar( array( 'item_id' => $thread_template->message->sender_id, 'type' => $type, 'width' => $width, 'height' => $height, 'alt' => bp_core_get_user_displayname( $thread_template->message->sender_id ) ) ) );
 	}
 
 function bp_the_thread_message_sender_link() {
@@ -845,7 +910,7 @@ function bp_the_thread_delete_link() {
 	function bp_get_the_thread_delete_link() {
 		global $bp;
 
-		return apply_filters( 'bp_get_message_thread_delete_link', wp_nonce_url( $bp->loggedin_user->domain . $bp->messages->slug . '/inbox/delete/' . bp_get_the_thread_id(), 'messages_delete_thread' ) );
+		return apply_filters( 'bp_get_message_thread_delete_link', wp_nonce_url( bp_loggedin_user_domain() . $bp->messages->slug . '/inbox/delete/' . bp_get_the_thread_id(), 'messages_delete_thread' ) );
 	}
 
 function bp_the_thread_message_time_since() {
@@ -874,11 +939,12 @@ function bp_the_thread_message_content() {
  * There's no caching as BP 1.5 does not have a Messages meta API.
  *
  * @see BP_Embed
- * @since 1.5
+ * @since BuddyPress (1.5)
  * @todo Add Messages meta?
  */
 function bp_messages_embed() {
 	add_filter( 'embed_post_id', 'bp_get_message_thread_id' );
 }
 add_action( 'messages_box_loop_start', 'bp_messages_embed' );
+
 ?>
diff --git a/wp-content/plugins/buddypress/bp-messages/css/autocomplete/jquery.autocompletefb.css b/wp-content/plugins/buddypress/bp-messages/css/autocomplete/jquery.autocompletefb.css
index 51ad7112e74a2475506e977c7c1a2ceb41969c45..77388d0dd9051c6987c0699d321aababc5fdc746 100644
--- a/wp-content/plugins/buddypress/bp-messages/css/autocomplete/jquery.autocompletefb.css
+++ b/wp-content/plugins/buddypress/bp-messages/css/autocomplete/jquery.autocompletefb.css
@@ -1 +1 @@
-.ac_results{padding:0;overflow:hidden;z-index:99999;background:#fff;border:1px solid #ccc;-moz-border-radius-bottomleft:3px;-khtml-border-bottom-left-radius:3px;-webkit-border-bottom-left-radius:3px;border-bottom-left-radius:3px;-moz-border-radius-bottomright:3px;-khtml-border-bottom-right-radius:3px;-webkit-border-bottom-right-radius:3px;border-bottom-right-radius:3px;}.ac_results ul{width:100%;list-style-position:outside;list-style:none;padding:0;margin:0;}.ac_results li{margin:0;padding:5px 10px;cursor:pointer;display:block;font-size:1em;line-height:16px;overflow:hidden;}.ac_results li img{margin-right:5px;}.ac_loading{background:url('../../../bp-themes/bp-default/_inc/images/ajax-loader.gif') right center no-repeat;}.ac_odd{background-color:#f0f0f0;}.ac_over{background-color:#888;color:#fff;}ul.acfb-holder{margin:0;height:auto!important;height:1%;overflow:hidden;padding:0;list-style:none;}ul.acfb-holder li{float:left;margin:0 5px 4px 0;list-style-type:none;}ul.acfb-holder li.friend-tab{border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;border:1px solid #ffe7c7;padding:2px 7px 2px;background:#FFF9DF;font-size:1em;}li.friend-tab img.avatar{border-width:2px!important;vertical-align:middle;}li.friend-tab span.p{padding-left:5px;font-size:.8em;cursor:pointer;}input#send-to-input{width:275px;}
\ No newline at end of file
+.ac_results{padding:0;overflow:hidden;z-index:99999;background:#fff;border:1px solid #ccc;-moz-border-radius-bottomleft:3px;-khtml-border-bottom-left-radius:3px;-webkit-border-bottom-left-radius:3px;border-bottom-left-radius:3px;-moz-border-radius-bottomright:3px;-khtml-border-bottom-right-radius:3px;-webkit-border-bottom-right-radius:3px;border-bottom-right-radius:3px}.ac_results ul{width:100%;list-style-position:outside;list-style:none;padding:0;margin:0}.ac_results li{margin:0;padding:5px 10px;cursor:pointer;display:block;font-size:1em;line-height:16px;overflow:hidden}.ac_results li img{margin-right:5px}.ac_loading{background:url('../../../bp-themes/bp-default/_inc/images/ajax-loader.gif') right center no-repeat}.ac_odd{background-color:#f0f0f0}.ac_over{background-color:#888;color:#fff}ul.acfb-holder{margin:0;height:auto!important;height:1%;overflow:hidden;padding:0;list-style:none}ul.acfb-holder li{float:left;margin:0 5px 4px 0;list-style-type:none}ul.acfb-holder li.friend-tab{border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;border:1px solid #ffe7c7;padding:2px 7px 2px;background:#fff9df;font-size:1em}li.friend-tab img.avatar{border-width:2px!important;vertical-align:middle}li.friend-tab span.p{padding-left:5px;font-size:.8em;cursor:pointer}input#send-to-input{width:275px}
\ No newline at end of file
diff --git a/wp-content/plugins/buddypress/bp-messages/js/autocomplete/jquery.autocomplete.js b/wp-content/plugins/buddypress/bp-messages/js/autocomplete/jquery.autocomplete.js
index 4192cb76b5ebc4ed82803b18dc4552d29bcdb05b..42a07995ae8953717263bfb4c2c4999492b4ac06 100644
--- a/wp-content/plugins/buddypress/bp-messages/js/autocomplete/jquery.autocomplete.js
+++ b/wp-content/plugins/buddypress/bp-messages/js/autocomplete/jquery.autocomplete.js
@@ -1,4 +1,4 @@
-/*
+/*!
  * Autocomplete - jQuery plugin 1.0 Beta
  *
  * Copyright (c) 2007 Dylan Verheul, Dan G. Switzer, Anjesh Tuladhar, Jörn Zaefferer
diff --git a/wp-content/plugins/buddypress/bp-messages/js/autocomplete/jquery.autocompletefb.js b/wp-content/plugins/buddypress/bp-messages/js/autocomplete/jquery.autocompletefb.js
index c8c92e8488d04e9c55ad55fc37042f636210865d..119449e1043441e5930a8c431870d9509e0827c0 100644
--- a/wp-content/plugins/buddypress/bp-messages/js/autocomplete/jquery.autocompletefb.js
+++ b/wp-content/plugins/buddypress/bp-messages/js/autocomplete/jquery.autocompletefb.js
@@ -1,4 +1,4 @@
-/*
+/*!
  * jQuery plugin: autoCompletefb(AutoComplete Facebook)
  * @requires jQuery v1.2.2 or later
  * using plugin:jquery.autocomplete.js
diff --git a/wp-content/plugins/buddypress/bp-messages/js/autocomplete/jquery.bgiframe.js b/wp-content/plugins/buddypress/bp-messages/js/autocomplete/jquery.bgiframe.js
index e54882f3e182669f96f04a4f1baebcd2d999a978..690f3e1ad8d34c509aa0203ee4ea740e0b7e5c6f 100644
--- a/wp-content/plugins/buddypress/bp-messages/js/autocomplete/jquery.bgiframe.js
+++ b/wp-content/plugins/buddypress/bp-messages/js/autocomplete/jquery.bgiframe.js
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010 Brandon Aaron (http://brandonaaron.net)
+/*! Copyright (c) 2010 Brandon Aaron (http://brandonaaron.net)
  * Licensed under the MIT License (license.bgiframe.txt).
  *
  * Version 2.1.2
diff --git a/wp-content/plugins/buddypress/bp-messages/js/autocomplete/jquery.dimensions.js b/wp-content/plugins/buddypress/bp-messages/js/autocomplete/jquery.dimensions.js
index 024853f47c0961b0b060e5b1ffd793fb081051cd..20c46bc948d9f57afefb3385caf93c857128fd36 100644
--- a/wp-content/plugins/buddypress/bp-messages/js/autocomplete/jquery.dimensions.js
+++ b/wp-content/plugins/buddypress/bp-messages/js/autocomplete/jquery.dimensions.js
@@ -1,4 +1,4 @@
-/*
+/*!
  * Copyright (c) 2007 Paul Bakaus (paul.bakaus@googlemail.com) and Brandon Aaron (brandon.aaron@gmail.com || http://brandonaaron.net)
  * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php)
  * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
diff --git a/wp-content/plugins/buddypress/bp-messages/js/autocomplete/license.bgiframe.txt b/wp-content/plugins/buddypress/bp-messages/js/autocomplete/license.bgiframe.txt
index 21f87ae7a5ff34c4bb9584be4b84fbd315e805cb..74c597096986d6a2dbc21f4c8f9b7700b36b97b7 100644
--- a/wp-content/plugins/buddypress/bp-messages/js/autocomplete/license.bgiframe.txt
+++ b/wp-content/plugins/buddypress/bp-messages/js/autocomplete/license.bgiframe.txt
@@ -1,20 +1,20 @@
-Copyright 2010, Brandon Aaron (http://brandonaaron.net/)
- 
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
- 
-The above copyright notice and this permission notice shall be
-included in all copies or substantial portions of the Software.
- 
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+Copyright 2010, Brandon Aaron (http://brandonaaron.net/)
+ 
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+ 
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+ 
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
\ No newline at end of file
diff --git a/wp-content/plugins/buddypress/bp-settings/bp-settings-actions.php b/wp-content/plugins/buddypress/bp-settings/bp-settings-actions.php
index dfed7125ae2ca666366a3f6e7c606ee7229076fd..3fc310f0e2ee26ea1a43d948957407a050edf52b 100644
--- a/wp-content/plugins/buddypress/bp-settings/bp-settings-actions.php
+++ b/wp-content/plugins/buddypress/bp-settings/bp-settings-actions.php
@@ -1,19 +1,55 @@
 <?php
+
+/**
+ * BuddyPress Settings Actions
+ *
+ * @todo split actions into separate screen functions
+ * @package BuddyPress
+ * @subpackage SettingsActions
+ */
+
 // Exit if accessed directly
 if ( !defined( 'ABSPATH' ) ) exit;
 
-/** General *******************************************************************/
-
-function bp_core_screen_general_settings() {
+/**
+ * Handles the changing and saving of user email addressos and passwords
+ *
+ * We do quite a bit of logic and error handling here to make sure that users
+ * do not accidentally lock themselves out of their accounts. We also try to
+ * provide as accurate of feedback as possible without exposing anyone else's
+ * inforation to them.
+ *
+ * Special considerations are made for super admins that are able to edit any
+ * users accounts already, without knowing their existing password.
+ *
+ * @global BuddyPress $bp
+ * @return If no reason to proceed
+ */
+function bp_settings_action_general() {
 	global $bp;
 
+	// Bail if not a POST action
+	if ( 'POST' !== strtoupper( $_SERVER['REQUEST_METHOD'] ) )
+		return;
+
+	// Bail if not in settings
+	if ( ! bp_is_settings_component() || ! bp_is_current_action( 'general' ) )
+		return;
+
+	// 404 if there are any additional action variables attached
 	if ( bp_action_variables() ) {
 		bp_do_404();
 		return;
 	}
 
-	// Setup private variables
-	$bp_settings_updated = $pass_error = $email_error = $pwd_error = false;
+	// Define local defaults
+	$email_error   = false;   // invalid|blocked|taken|empty|nochange
+	$pass_error    = false;   // invalid|mismatch|empty|nochange
+	$pass_changed  = false;   // true if the user changes their password
+	$email_changed = false;   // true if the user changes their email
+	$feedback_type = 'error'; // success|error
+	$feedback      = array(); // array of strings for feedback
+
 
 	if ( isset( $_POST['submit'] ) ) {
 
@@ -21,154 +57,293 @@ function bp_core_screen_general_settings() {
 		check_admin_referer('bp_settings_general');
 
 		// Validate the user again for the current password when making a big change
-		if ( is_super_admin() || ( !empty( $_POST['pwd'] ) && $_POST['pwd'] != '' && wp_check_password( $_POST['pwd'], $bp->displayed_user->userdata->user_pass, $bp->displayed_user->id ) ) ) {
+		if ( ( is_super_admin() ) || ( !empty( $_POST['pwd'] ) && wp_check_password( $_POST['pwd'], $bp->displayed_user->userdata->user_pass, bp_displayed_user_id() ) ) ) {
 
-			$update_user = get_userdata( $bp->displayed_user->id );
-			
-			// The structure of the $update_user object changed in WP 3.3, but
-			// wp_update_user() still expects the old format
-			if ( isset( $update_user->data ) && is_object( $update_user->data ) ) {
-				$update_user = $update_user->data;
-			}
+			$update_user = get_userdata( bp_displayed_user_id() );
 
-			// Make sure changing an email address does not already exist
-			if ( $_POST['email'] != '' ) {
+			/** Email Change Attempt ******************************************/
+
+			if ( !empty( $_POST['email'] ) ) {
 
 				// What is missing from the profile page vs signup - lets double check the goodies
 				$user_email = sanitize_email( esc_html( trim( $_POST['email'] ) ) );
 
-				// Is email valid
-				if ( !is_email( $user_email ) )
-					$email_error = true;
+				// User is changing email address
+				if ( $bp->displayed_user->userdata->user_email != $user_email ) {
 
-				// Get blocked email domains
-				$limited_email_domains = get_site_option( 'limited_email_domains', 'buddypress' );
+					// Run some tests on the email address
+					$email_checks = bp_core_validate_email_address( $user_email );
 
-				// If blocked email domains exist, see if this is one of them
-				if ( is_array( $limited_email_domains ) && empty( $limited_email_domains ) == false ) {
-					$emaildomain = substr( $user_email, 1 + strpos( $user_email, '@' ) );
+					if ( true !== $email_checks ) {
+						if ( isset( $email_checks['invalid'] ) ) {
+							$email_error = 'invalid';
+						}
 
-					if ( in_array( $emaildomain, (array)$limited_email_domains ) == false ) {
-						$email_error = true;
-					}
-				}
+						if ( isset( $email_checks['domain_banned'] ) || isset( $email_checks['domain_not_allowed'] ) ) {
+							$email_error = 'blocked';
+						}
 
-				// No errors, and email address doesn't match
-				if ( ( false === $email_error ) && ( $bp->displayed_user->userdata->user_email != $user_email ) ) {
+						if ( isset( $email_checks['in_use'] ) ) {
+							$email_error = 'taken';
+						}
+					}
 
-					// We don't want email dupes in the system
-					if ( email_exists( $user_email ) )
-						$email_error = true;
+					// Yay we made it!
+					if ( false === $email_error ) {
+						$update_user->user_email = $user_email;
+						$email_changed = true;
+					}
 
-					// Set updated user email to this email address
-					$update_user->user_email = $user_email;
+				// No change
+				} else {
+					$email_error = false;
 				}
+
+			// Email address cannot be empty
+			} else {
+				$email_error = 'empty';
 			}
 
-			// Password change
+			/** Password Change Attempt ***************************************/
+
 			if ( !empty( $_POST['pass1'] ) && !empty( $_POST['pass2'] ) ) {
 
 				// Password change attempt is successful
-				if ( $_POST['pass1'] == $_POST['pass2'] && !strpos( " " . $_POST['pass1'], "\\" ) ) {
+				if ( ( $_POST['pass1'] == $_POST['pass2'] ) && !strpos( " " . $_POST['pass1'], "\\" ) ) {
 					$update_user->user_pass = $_POST['pass1'];
+					$pass_changed = true;
 
 				// Password change attempt was unsuccessful
 				} else {
-					$pass_error = true;
+					$pass_error = 'mismatch';
 				}
 
+			// Both password fields were empty
+			} elseif ( empty( $_POST['pass1'] ) && empty( $_POST['pass2'] ) ) {
+				$pass_error = false;
+
 			// One of the password boxes was left empty
-			} else if ( ( empty( $_POST['pass1'] ) && !empty( $_POST['pass2'] ) ) || ( !empty( $_POST['pass1'] ) && empty( $_POST['pass2'] ) ) ) {
-				$pass_error = true;
+			} elseif ( ( empty( $_POST['pass1'] ) && !empty( $_POST['pass2'] ) ) || ( !empty( $_POST['pass1'] ) && empty( $_POST['pass2'] ) ) ) {
+				$pass_error = 'empty';
+			}
 
-			// Not a password change attempt so empty the user_pass
-			} else {
-				unset( $update_user->user_pass );
+			// The structure of the $update_user object changed in WP 3.3, but
+			// wp_update_user() still expects the old format
+			if ( isset( $update_user->data ) && is_object( $update_user->data ) ) {
+				$update_user = $update_user->data;
+				$update_user = get_object_vars( $update_user );
+
+				// Unset the password field to prevent it from emptying out the
+				// user's user_pass field in the database.
+				// @see wp_update_user()
+				if ( false === $pass_changed ) {
+					unset( $update_user['user_pass'] );
+				}
 			}
 
 			// Make sure these changes are in $bp for the current page load
-			if ( ( false === $email_error ) && ( false === $pass_error ) && ( wp_update_user( get_object_vars( $update_user ) ) ) ) {
-				$bp_settings_updated = true;
+			if ( ( false === $email_error ) && ( false === $pass_error ) && ( wp_update_user( $update_user ) ) ) {
+				$bp->displayed_user->userdata = bp_core_get_core_userdata( bp_displayed_user_id() );
 			}
 
 		// Password Error
 		} else {
-			$pwd_error = true;
+			$pass_error = 'invalid';
 		}
 
-		// Add user feedback messages
-		if ( empty( $pass_error ) && empty( $pwd_error ) && ( empty( $email_error ) ) )
-			bp_core_add_message( __( 'Changes saved.', 'buddypress' ), 'success' );
+		// Email feedback
+		switch ( $email_error ) {
+			case 'invalid' :
+				$feedback['email_invalid']  = __( 'That email address is invalid. Check the formatting and try again.', 'buddypress' );
+				break;
+			case 'blocked' :
+				$feedback['email_blocked']  = __( 'That email address is currently unavailable for use.', 'buddypress' );
+				break;
+			case 'taken' :
+				$feedback['email_taken']    = __( 'That email address is already taken.', 'buddypress' );
+				break;
+			case 'empty' :
+				$feedback['email_empty']    = __( 'Email address cannot be empty.', 'buddypress' );
+				break;
+			case false :
+				// No change
+				break;
+		}
 
-		elseif ( !empty( $pass_error ) )
-			bp_core_add_message( __( 'Your new passwords did not match.', 'buddypress' ), 'error' );
+		// Password feedback
+		switch ( $pass_error ) {
+			case 'invalid' :
+				$feedback['pass_error']    = __( 'Your current password is invalid.', 'buddypress' );
+				break;
+			case 'mismatch' :
+				$feedback['pass_mismatch'] = __( 'The new password fields did not match.', 'buddypress' );
+				break;
+			case 'empty' :
+				$feedback['pass_empty']    = __( 'One of the password fields was empty.', 'buddypress' );
+				break;
+			case false :
+				// No change
+				break;
+		}
 
-		elseif ( !empty( $pwd_error ) )
-			bp_core_add_message( __( 'Your existing password is incorrect.', 'buddypress' ), 'error' );
+		// No errors so show a simple success message
+		if ( ( ( false === $email_error ) || ( false == $pass_error ) ) && ( ( true === $pass_changed ) || ( true === $email_changed ) ) ) {
+			$feedback[]    = __( 'Your settings have been saved.', 'buddypress' );
+			$feedback_type = 'success';
+
+		// Some kind of errors occurred
+		} elseif ( ( ( false === $email_error ) || ( false === $pass_error ) ) && ( ( false === $pass_changed ) || ( false === $email_changed ) ) ) {
+			if ( bp_is_my_profile() ) {
+				$feedback['nochange'] = __( 'No changes were made to your account.', 'buddypress' );
+			} else {
+				$feedback['nochange'] = __( 'No changes were made to this account.', 'buddypress' );
+			}
+		}
 
-		elseif ( !empty( $email_error ) )
-			bp_core_add_message( __( 'Sorry, that email address is already used or is invalid.', 'buddypress' ), 'error' );
+		// Set the feedback
+		bp_core_add_message( implode( '</p><p>', $feedback ), $feedback_type );
 
 		// Execute additional code
 		do_action( 'bp_core_general_settings_after_save' );
-		
+
+		// Redirect to prevent issues with browser back button
 		bp_core_redirect( trailingslashit( bp_displayed_user_domain() . bp_get_settings_slug() . '/general' ) );
 	}
-
-	// Load the template
-	bp_core_load_template( apply_filters( 'bp_core_screen_general_settings', 'members/single/settings/general' ) );
 }
+add_action( 'bp_actions', 'bp_settings_action_general' );
 
-/** Notifications *************************************************************/
+/**
+ * Handles the changing and saving of user notification settings
+ *
+ * @return If no reason to proceed
+ */
+function bp_settings_action_notifications() {
 
-function bp_core_screen_notification_settings() {
-	global $bp;
+	// Bail if not a POST action
+	if ( 'POST' !== strtoupper( $_SERVER['REQUEST_METHOD'] ) )
+		return;
+
+	// Bail if not in settings
+	if ( ! bp_is_settings_component() || ! bp_is_current_action( 'notifications' ) )
+		return false;
 
+	// 404 if there are any additional action variables attached
 	if ( bp_action_variables() ) {
 		bp_do_404();
 		return;
 	}
 
 	if ( isset( $_POST['submit'] ) ) {
-		check_admin_referer('bp_settings_notifications');
+		check_admin_referer( 'bp_settings_notifications' );
 
 		if ( isset( $_POST['notifications'] ) ) {
-			foreach ( (array)$_POST['notifications'] as $key => $value ) {
-				if ( $meta_key = bp_get_user_meta_key( $key ) )
-					bp_update_user_meta( (int)$bp->displayed_user->id, $meta_key, $value );
+			foreach ( (array) $_POST['notifications'] as $key => $value ) {
+				bp_update_user_meta( (int) bp_displayed_user_id(), $key, $value );
 			}
 		}
 
-		bp_core_add_message( __( 'Changes saved.', 'buddypress' ), 'success' );
+		// Switch feedback for super admins
+		if ( bp_is_my_profile() ) {
+			bp_core_add_message( __( 'Your notification settings have been saved.',        'buddypress' ), 'success' );
+		} else {
+			bp_core_add_message( __( "This user's notification settings have been saved.", 'buddypress' ), 'success' );
+		}
 
 		do_action( 'bp_core_notification_settings_after_save' );
+
+		bp_core_redirect( bp_displayed_user_domain() . bp_get_settings_slug() . '/notifications/' );
 	}
+}
+add_action( 'bp_actions', 'bp_settings_action_notifications' );
+
+/**
+ * Handles the setting of user capabilities, spamming, hamming, role, etc...
+ *
+ * @return If no reason to proceed
+ */
+function bp_settings_action_capabilities() {
+
+	// Bail if not a POST action
+	if ( 'POST' !== strtoupper( $_SERVER['REQUEST_METHOD'] ) )
+		return;
+
+	// Bail if not in settings
+	if ( ! bp_is_settings_component() || ! bp_is_current_action( 'capabilities' ) )
+		return false;
+
+	// 404 if there are any additional action variables attached
+	if ( bp_action_variables() ) {
+		bp_do_404();
+		return;
+	}
+
+	if ( isset( $_POST['capabilities-submit'] ) ) {
 
-	bp_core_load_template( apply_filters( 'bp_core_screen_notification_settings', 'members/single/settings/notifications' ) );
+		// Nonce check
+		check_admin_referer( 'capabilities' );
+
+		do_action( 'bp_settings_capabilities_before_save' );
+
+		/** Spam **************************************************************/
+
+		$is_spammer = !empty( $_POST['user-spammer'] ) ? true : false;
+
+		if ( bp_is_user_spammer( bp_displayed_user_id() ) != $is_spammer ) {
+			$status = ( true == $is_spammer ) ? 'spam' : 'ham';
+			bp_core_process_spammer_status( bp_displayed_user_id(), $status );
+			do_action( 'bp_core_action_set_spammer_status', bp_displayed_user_id(), $status );
+		}
+
+		/** Other *************************************************************/
+
+		do_action( 'bp_settings_capabilities_after_save' );
+
+		// Redirect to the root domain
+		bp_core_redirect( bp_displayed_user_domain() . bp_get_settings_slug() . '/capabilities/' );
+	}
 }
+add_action( 'bp_actions', 'bp_settings_action_capabilities' );
 
-/** Delete Account ************************************************************/
+/**
+ * Handles the deleting of a user
+ *
+ * @return If no reason to proceed
+ */
+function bp_settings_action_delete_account() {
 
-function bp_core_screen_delete_account() {
-	global $bp;
+	// Bail if not a POST action
+	if ( 'POST' !== strtoupper( $_SERVER['REQUEST_METHOD'] ) )
+		return;
 
+	// Bail if not in settings
+	if ( ! bp_is_settings_component() || ! bp_is_current_action( 'delete-account' ) )
+		return false;
+
+	// 404 if there are any additional action variables attached
 	if ( bp_action_variables() ) {
 		bp_do_404();
 		return;
 	}
 
 	if ( isset( $_POST['delete-account-understand'] ) ) {
+
 		// Nonce check
 		check_admin_referer( 'delete-account' );
 
+		// Get username now because it might be gone soon!
+		$username = bp_get_displayed_user_fullname();
+
 		// delete the users account
-		if ( bp_core_delete_account( $bp->displayed_user->id ) ) {
-			bp_core_redirect( home_url() );
+		if ( bp_core_delete_account( bp_displayed_user_id() ) ) {
+
+			// Add feedback ater deleting a user
+			bp_core_add_message( sprintf( __( '%s was successfully deleted.', 'buddypress' ), $username ), 'success' );
+
+			// Redirect to the root domain
+			bp_core_redirect( bp_get_root_domain() );
 		}
 	}
-
-	// Load the template
-	bp_core_load_template( apply_filters( 'bp_core_screen_delete_account', 'members/single/settings/delete-account' ) );
 }
+add_action( 'bp_actions', 'bp_settings_action_delete_account' );
 
-?>
\ No newline at end of file
+?>
diff --git a/wp-content/plugins/buddypress/bp-settings/bp-settings-functions.php b/wp-content/plugins/buddypress/bp-settings/bp-settings-functions.php
index 9b66e1b6d430b220fe20cded59cf07baddb45e31..c17a35eab877d7050b5037de026685fb14367ef4 100644
--- a/wp-content/plugins/buddypress/bp-settings/bp-settings-functions.php
+++ b/wp-content/plugins/buddypress/bp-settings/bp-settings-functions.php
@@ -1,4 +1,13 @@
 <?php
+
+/**
+ * BuddyPress Settings Functions
+ *
+ * @package BuddyPress
+ * @subpackage SettingsFunctions
+ */
+
 // Exit if accessed directly
 if ( !defined( 'ABSPATH' ) ) exit;
+
 ?>
\ No newline at end of file
diff --git a/wp-content/plugins/buddypress/bp-settings/bp-settings-loader.php b/wp-content/plugins/buddypress/bp-settings/bp-settings-loader.php
index 7f726150016f0b2af7553e62b42cda76141a3a21..b1c7589d6ee620f3908b815077a4ab3dac3edbd6 100644
--- a/wp-content/plugins/buddypress/bp-settings/bp-settings-loader.php
+++ b/wp-content/plugins/buddypress/bp-settings/bp-settings-loader.php
@@ -1,4 +1,12 @@
 <?php
+
+/**
+ * BuddyPress Settings Loader
+ *
+ * @package BuddyPress
+ * @subpackage SettingsLoader
+ */
+
 // Exit if accessed directly
 if ( !defined( 'ABSPATH' ) ) exit;
 
@@ -7,7 +15,7 @@ class BP_Settings_Component extends BP_Component {
 	/**
 	 * Start the settings component creation process
 	 *
-	 * @since 1.5
+	 * @since BuddyPress (1.5)
 	 */
 	function __construct() {
 		parent::start(
@@ -20,7 +28,7 @@ class BP_Settings_Component extends BP_Component {
 	/**
 	 * Include files
 	 *
-	 * @global obj $bp
+	 * @global BuddyPress $bp The one true BuddyPress instance
 	 */
 	function includes() {
 		// Files to include
@@ -40,11 +48,9 @@ class BP_Settings_Component extends BP_Component {
 	 * The BP_SETTINGS_SLUG constant is deprecated, and only used here for
 	 * backwards compatibility.
 	 *
-	 * @since 1.5
-	 * @global obj $bp
+	 * @since BuddyPress (1.5)
 	 */
 	function setup_globals() {
-		global $bp;
 
 		// Define a slug, if necessary
 		if ( !defined( 'BP_SETTINGS_SLUG' ) )
@@ -61,11 +67,11 @@ class BP_Settings_Component extends BP_Component {
 
 	/**
 	 * Setup BuddyBar navigation
-	 *
-	 * @global obj $bp
 	 */
 	function setup_nav() {
-		global $bp;
+
+		// Define local variable
+		$sub_nav = array();
 
 		// Add the settings navigation item
 		$main_nav = array(
@@ -73,15 +79,15 @@ class BP_Settings_Component extends BP_Component {
 			'slug'                    => $this->slug,
 			'position'                => 100,
 			'show_for_displayed_user' => bp_core_can_edit_settings(),
-			'screen_function'         => 'bp_core_screen_general_settings',
+			'screen_function'         => 'bp_settings_screen_general',
 			'default_subnav_slug'     => 'general'
 		);
 
 		// Determine user to use
-		if ( isset( $bp->displayed_user->domain ) )
-			$user_domain = $bp->displayed_user->domain;
-		elseif ( isset( $bp->loggedin_user->domain ) )
-			$user_domain = $bp->loggedin_user->domain;
+		if ( bp_displayed_user_domain() )
+			$user_domain = bp_displayed_user_domain();
+		elseif ( bp_loggedin_user_domain() )
+			$user_domain = bp_loggedin_user_domain();
 		else
 			return;
 
@@ -93,7 +99,7 @@ class BP_Settings_Component extends BP_Component {
 			'slug'            => 'general',
 			'parent_url'      => $settings_link,
 			'parent_slug'     => $this->slug,
-			'screen_function' => 'bp_core_screen_general_settings',
+			'screen_function' => 'bp_settings_screen_general',
 			'position'        => 10,
 			'user_has_access' => bp_core_can_edit_settings()
 		);
@@ -104,21 +110,34 @@ class BP_Settings_Component extends BP_Component {
 			'slug'            => 'notifications',
 			'parent_url'      => $settings_link,
 			'parent_slug'     => $this->slug,
-			'screen_function' => 'bp_core_screen_notification_settings',
+			'screen_function' => 'bp_settings_screen_notification',
 			'position'        => 20,
 			'user_has_access' => bp_core_can_edit_settings()
 		);
 
+		// Add Spam Account nav item
+		if ( bp_current_user_can( 'bp_moderate' ) ) {
+			$sub_nav[] = array(
+				'name'            => __( 'Capabilities', 'buddypress' ),
+				'slug'            => 'capabilities',
+				'parent_url'      => $settings_link,
+				'parent_slug'     => $this->slug,
+				'screen_function' => 'bp_settings_screen_capabilities',
+				'position'        => 80,
+				'user_has_access' => ! bp_is_my_profile()
+			);
+		}
+
 		// Add Delete Account nav item
-		if ( !is_super_admin() && empty( $bp->site_options['bp-disable-account-deletion'] ) ) {
+		if ( ! bp_disable_account_deletion() || bp_current_user_can( 'delete_users' ) ) {
 			$sub_nav[] = array(
 				'name'            => __( 'Delete Account', 'buddypress' ),
 				'slug'            => 'delete-account',
 				'parent_url'      => $settings_link,
 				'parent_slug'     => $this->slug,
-				'screen_function' => 'bp_core_screen_delete_account',
+				'screen_function' => 'bp_settings_screen_delete_account',
 				'position'        => 90,
-				'user_has_access' => bp_is_my_profile()
+				'user_has_access' => bp_is_my_profile() || !is_super_admin( bp_displayed_user_id() )
 			);
 		}
 
@@ -126,9 +145,9 @@ class BP_Settings_Component extends BP_Component {
 	}
 
 	/**
-	 * Set up the admin bar
+	 * Set up the Toolbar
 	 *
-	 * @global obj $bp
+	 * @global BuddyPress $bp The one true BuddyPress instance
 	 */
 	function setup_admin_bar() {
 		global $bp;
@@ -140,7 +159,7 @@ class BP_Settings_Component extends BP_Component {
 		if ( is_user_logged_in() ) {
 
 			// Setup the logged in user variables
-			$user_domain   = $bp->loggedin_user->domain;
+			$user_domain   = bp_loggedin_user_domain();
 			$settings_link = trailingslashit( $user_domain . $this->slug );
 
 			// Add main Settings menu
@@ -168,7 +187,7 @@ class BP_Settings_Component extends BP_Component {
 			);
 
 			// Delete Account
-			if ( !is_super_admin() && empty( $bp->site_options['bp-disable-account-deletion'] ) ) {
+			if ( !bp_current_user_can( 'bp_moderate' ) && empty( $bp->site_options['bp-disable-account-deletion'] ) ) {
 				$wp_admin_nav[] = array(
 					'parent' => 'my-account-' . $this->id,
 					'id'     => 'my-account-' . $this->id . '-delete-account',
@@ -181,7 +200,11 @@ class BP_Settings_Component extends BP_Component {
 		parent::setup_admin_bar( $wp_admin_nav );
 	}
 }
-// Create the settingss component
-$bp->settings = new BP_Settings_Component();
 
-?>
+function bp_setup_settings() {
+	global $bp;
+	$bp->settings = new BP_Settings_Component();
+}
+add_action( 'bp_setup_components', 'bp_setup_settings', 6 );
+
+?>
\ No newline at end of file
diff --git a/wp-content/plugins/buddypress/bp-settings/bp-settings-screens.php b/wp-content/plugins/buddypress/bp-settings/bp-settings-screens.php
index 9b66e1b6d430b220fe20cded59cf07baddb45e31..96a15132ff9dbd1de45fa0443477418630118a28 100644
--- a/wp-content/plugins/buddypress/bp-settings/bp-settings-screens.php
+++ b/wp-content/plugins/buddypress/bp-settings/bp-settings-screens.php
@@ -1,4 +1,83 @@
 <?php
+
+/**
+ * BuddyPress Settings Screens
+ *
+ * @package BuddyPress
+ * @subpackage SettingsScreens
+ */
+
 // Exit if accessed directly
 if ( !defined( 'ABSPATH' ) ) exit;
-?>
\ No newline at end of file
+
+/**
+ * Show the general settings template
+ *
+ * @since BuddyPress (1.5)
+ *
+ * @return If we shouldn't be here
+ */
+function bp_settings_screen_general() {
+
+	if ( bp_action_variables() ) {
+		bp_do_404();
+		return;
+	}
+
+	bp_core_load_template( apply_filters( 'bp_settings_screen_general_settings', 'members/single/settings/general' ) );
+}
+
+/**
+ * Show the notifications settings template
+ *
+ * @since BuddyPress (1.5)
+ *
+ * @return If we shouldn't be here
+ */
+function bp_settings_screen_notification() {
+
+	if ( bp_action_variables() ) {
+		bp_do_404();
+		return;
+	}
+
+	bp_core_load_template( apply_filters( 'bp_settings_screen_notification_settings', 'members/single/settings/notifications' ) );
+}
+
+/**
+ * Show the delete-account settings template
+ *
+ * @since BuddyPress (1.5)
+ *
+ * @return If we shouldn't be here
+ */
+function bp_settings_screen_delete_account() {
+
+	if ( bp_action_variables() ) {
+		bp_do_404();
+		return;
+	}
+
+	// Load the template
+	bp_core_load_template( apply_filters( 'bp_settings_screen_delete_account', 'members/single/settings/delete-account' ) );
+}
+
+/**
+ * Show the capabilities settings template
+ *
+ * @since BuddyPress (1.6)
+ *
+ * @return If we shouldn't be here
+ */
+function bp_settings_screen_capabilities() {
+
+	if ( bp_action_variables() ) {
+		bp_do_404();
+		return;
+	}
+
+	// Load the template
+	bp_core_load_template( apply_filters( 'bp_settings_screen_capabilities', 'members/single/settings/capabilities' ) );
+}
+
+?>
diff --git a/wp-content/plugins/buddypress/bp-settings/bp-settings-template.php b/wp-content/plugins/buddypress/bp-settings/bp-settings-template.php
index 7303775530f762a99b86abf8a1c285fbb0987435..36f72e23932053d2cb30176f313f2f6e806b22e1 100644
--- a/wp-content/plugins/buddypress/bp-settings/bp-settings-template.php
+++ b/wp-content/plugins/buddypress/bp-settings/bp-settings-template.php
@@ -1,9 +1,10 @@
 <?php
+
 /**
  * BuddyPress Settings Template Functions
  *
  * @package BuddyPress
- * @subpackage Settings Template
+ * @subpackage SettingsTemplate
  */
 
 // Exit if accessed directly
@@ -13,8 +14,8 @@ if ( !defined( 'ABSPATH' ) ) exit;
  * Output the settings component slug
  *
  * @package BuddyPress
- * @subpackage Settings Template
- * @since 1.5
+ * @subpackage SettingsTemplate
+ * @since BuddyPress (1.5)
  *
  * @uses bp_get_settings_slug()
  */
@@ -25,8 +26,8 @@ function bp_settings_slug() {
 	 * Return the settings component slug
 	 *
 	 * @package BuddyPress
-	 * @subpackage Settings Template
-	 * @since 1.5
+	 * @subpackage SettingsTemplate
+	 * @since BuddyPress (1.5)
 	 */
 	function bp_get_settings_slug() {
 		global $bp;
@@ -37,8 +38,8 @@ function bp_settings_slug() {
  * Output the settings component root slug
  *
  * @package BuddyPress
- * @subpackage Settings Template
- * @since 1.5
+ * @subpackage SettingsTemplate
+ * @since BuddyPress (1.5)
  *
  * @uses bp_get_settings_root_slug()
  */
@@ -49,8 +50,8 @@ function bp_settings_root_slug() {
 	 * Return the settings component root slug
 	 *
 	 * @package BuddyPress
-	 * @subpackage Settings Template
-	 * @since 1.5
+	 * @subpackage SettingsTemplate
+	 * @since BuddyPress (1.5)
 	 */
 	function bp_get_settings_root_slug() {
 		global $bp;
diff --git a/wp-content/plugins/buddypress/bp-themes/bp-default/404.php b/wp-content/plugins/buddypress/bp-themes/bp-default/404.php
index bba9b09698e0080ebb9920876753fc4ae2fc4e96..2b44db4dd3b3dc1fb7d754128a7804b3cda357ba 100644
--- a/wp-content/plugins/buddypress/bp-themes/bp-default/404.php
+++ b/wp-content/plugins/buddypress/bp-themes/bp-default/404.php
@@ -1,4 +1,4 @@
-<?php get_header() ?>
+<?php get_header(); ?>
 
 	<div id="content">
 		<div class="padder one-column">
@@ -12,8 +12,8 @@
 				<?php do_action( 'bp_404' ); ?>
 			</div>
 
-			<?php do_action( 'bp_after_404' ) ?>
+			<?php do_action( 'bp_after_404' ); ?>
 		</div><!-- .padder -->
 	</div><!-- #content -->
 
-<?php get_footer() ?>
\ No newline at end of file
+<?php get_footer(); ?>
\ No newline at end of file
diff --git a/wp-content/plugins/buddypress/bp-themes/bp-default/_inc/ajax.php b/wp-content/plugins/buddypress/bp-themes/bp-default/_inc/ajax.php
index 4c9ceb1b4e185531b5de6b057c9204d7292ccc06..b05d32d50af06d6bfe72fdc044942a93f988594c 100644
--- a/wp-content/plugins/buddypress/bp-themes/bp-default/_inc/ajax.php
+++ b/wp-content/plugins/buddypress/bp-themes/bp-default/_inc/ajax.php
@@ -1,61 +1,137 @@
 <?php
-/***
+/**
  * AJAX Functions
  *
- * All of these functions enhance the responsiveness of the user interface in the default
- * theme by adding AJAX functionality.
+ * All of these functions enhance the responsiveness of the user interface in
+ * the default theme by adding AJAX functionality.
+ *
+ * For more information on how the custom AJAX functions work, see
+ * http://codex.wordpress.org/AJAX_in_Plugins.
+ *
+ * @package BuddyPress
+ * @since 1.2
+ * @subpackage BP-Default
  */
 
-/***
+// Exit if accessed directly
+if ( ! defined( 'ABSPATH' ) ) exit;
+
+/**
+ * Register AJAX handlers for BP Default theme functionality.
+ *
+ * This function is registered to the after_setup_theme hook with priority 20 as
+ * this file is included in a function hooked to after_setup_theme at priority 10.
+ *
+ * @since BuddyPress (1.6)
+ */
+function bp_dtheme_register_actions() {
+	$actions = array(
+		// Directory filters
+		'blogs_filter'    => 'bp_dtheme_object_template_loader',
+		'forums_filter'   => 'bp_dtheme_object_template_loader',
+		'groups_filter'   => 'bp_dtheme_object_template_loader',
+		'members_filter'  => 'bp_dtheme_object_template_loader',
+		'messages_filter' => 'bp_dtheme_messages_template_loader',
+
+		// Friends
+		'accept_friendship' => 'bp_dtheme_ajax_accept_friendship',
+		'addremove_friend'  => 'bp_dtheme_ajax_addremove_friend',
+		'reject_friendship' => 'bp_dtheme_ajax_reject_friendship',
+
+		// Activity
+		'activity_get_older_updates'  => 'bp_dtheme_activity_template_loader',
+		'activity_mark_fav'           => 'bp_dtheme_mark_activity_favorite',
+		'activity_mark_unfav'         => 'bp_dtheme_unmark_activity_favorite',
+		'activity_widget_filter'      => 'bp_dtheme_activity_template_loader',
+		'delete_activity'             => 'bp_dtheme_delete_activity',
+		'delete_activity_comment'     => 'bp_dtheme_delete_activity_comment',
+		'get_single_activity_content' => 'bp_dtheme_get_single_activity_content',
+		'new_activity_comment'        => 'bp_dtheme_new_activity_comment',
+		'post_update'                 => 'bp_dtheme_post_update',
+		'bp_spam_activity'            => 'bp_dtheme_spam_activity',
+		'bp_spam_activity_comment'    => 'bp_dtheme_spam_activity',
+
+		// Groups
+		'groups_invite_user' => 'bp_dtheme_ajax_invite_user',
+		'joinleave_group'    => 'bp_dtheme_ajax_joinleave_group',
+
+		// Messages
+		'messages_autocomplete_results' => 'bp_dtheme_ajax_messages_autocomplete_results',
+		'messages_close_notice'         => 'bp_dtheme_ajax_close_notice',
+		'messages_delete'               => 'bp_dtheme_ajax_messages_delete',
+		'messages_markread'             => 'bp_dtheme_ajax_message_markread',
+		'messages_markunread'           => 'bp_dtheme_ajax_message_markunread',
+		'messages_send_reply'           => 'bp_dtheme_ajax_messages_send_reply',
+	);
+
+	/**
+	 * Register all of these AJAX handlers
+	 *
+	 * The "wp_ajax_" action is used for logged in users, and "wp_ajax_nopriv_"
+	 * executes for users that aren't logged in. This is for backpat with BP <1.6.
+	 */
+	foreach( $actions as $name => $function ) {
+		add_action( 'wp_ajax_'        . $name, $function );
+		add_action( 'wp_ajax_nopriv_' . $name, $function );
+	}
+}
+add_action( 'after_setup_theme', 'bp_dtheme_register_actions', 20 );
+
+/**
  * This function looks scarier than it actually is. :)
  * Each object loop (activity/members/groups/blogs/forums) contains default 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.
  * By using cookies we can also make sure that user settings are retained across page loads.
+ *
+ * @return string Query string for the activity/members/groups/blogs/forums loops
+ * @since BuddyPress (1.2)
  */
 function bp_dtheme_ajax_querystring( $query_string, $object ) {
-	global $bp;
-
 	if ( empty( $object ) )
-		return false;
+		return '';
 
-	/* Set up the cookies passed on this AJAX request. Store a local var to avoid conflicts */
-	if ( !empty( $_POST['cookie'] ) )
+	// Set up the cookies passed on this AJAX request. Store a local var to avoid conflicts
+	if ( ! empty( $_POST['cookie'] ) )
 		$_BP_COOKIE = wp_parse_args( str_replace( '; ', '&', urldecode( $_POST['cookie'] ) ) );
 	else
 		$_BP_COOKIE = &$_COOKIE;
 
-	$qs = false;
+	$qs = array();
 
-	/***
+	/**
 	 * Check if any cookie values are set. If there are then override the default params passed to the
 	 * template loop
 	 */
-	if ( !empty( $_BP_COOKIE['bp-' . $object . '-filter'] ) && '-1' != $_BP_COOKIE['bp-' . $object . '-filter'] ) {
-		$qs[] = 'type=' . $_BP_COOKIE['bp-' . $object . '-filter'];
-		$qs[] = 'action=' . $_BP_COOKIE['bp-' . $object . '-filter']; // Activity stream filtering on action
+
+	// Activity stream filtering on action
+	if ( ! empty( $_BP_COOKIE['bp-' . $object . '-filter'] ) && '-1' != $_BP_COOKIE['bp-' . $object . '-filter'] ) {
+		$qs[] = 'type='   . $_BP_COOKIE['bp-' . $object . '-filter'];
+		$qs[] = 'action=' . $_BP_COOKIE['bp-' . $object . '-filter'];
 	}
 
-	if ( !empty( $_BP_COOKIE['bp-' . $object . '-scope'] ) ) {
+	if ( ! empty( $_BP_COOKIE['bp-' . $object . '-scope'] ) ) {
 		if ( 'personal' == $_BP_COOKIE['bp-' . $object . '-scope'] ) {
-			$user_id = ( $bp->displayed_user->id ) ? $bp->displayed_user->id : $bp->loggedin_user->id;
+			$user_id = ( bp_displayed_user_id() ) ? bp_displayed_user_id() : bp_loggedin_user_id();
 			$qs[] = 'user_id=' . $user_id;
 		}
-		if ( 'all' != $_BP_COOKIE['bp-' . $object . '-scope'] && empty( $bp->displayed_user->id ) && !$bp->is_single_item )
-			$qs[] = 'scope=' . $_BP_COOKIE['bp-' . $object . '-scope']; // Activity stream scope only on activity directory.
+
+		// Activity stream scope only on activity directory.
+		if ( 'all' != $_BP_COOKIE['bp-' . $object . '-scope'] && ! bp_displayed_user_id() && ! bp_is_single_item() )
+			$qs[] = 'scope=' . $_BP_COOKIE['bp-' . $object . '-scope'];
 	}
 
-	/* If page and search_terms have been passed via the AJAX post request, use those */
-	if ( !empty( $_POST['page'] ) && '-1' != $_POST['page'] )
+	// If page and search_terms have been passed via the AJAX post request, use those.
+	if ( ! empty( $_POST['page'] ) && '-1' != $_POST['page'] )
 		$qs[] = 'page=' . $_POST['page'];
 
 	$object_search_text = bp_get_search_default_text( $object );
- 	if ( !empty( $_POST['search_terms'] ) && $object_search_text != $_POST['search_terms'] && 'false' != $_POST['search_terms'] && 'undefined' != $_POST['search_terms'] )
+ 	if ( ! empty( $_POST['search_terms'] ) && $object_search_text != $_POST['search_terms'] && 'false' != $_POST['search_terms'] && 'undefined' != $_POST['search_terms'] )
 		$qs[] = 'search_terms=' . $_POST['search_terms'];
 
-	/* Now pass the querystring to override default values. */
-	$query_string = empty( $qs ) ? '' : join( '&', (array)$qs );
+	// Now pass the querystring to override default values.
+	$query_string = empty( $qs ) ? '' : join( '&', (array) $qs );
 
 	$object_filter = '';
 	if ( isset( $_BP_COOKIE['bp-' . $object . '-filter'] ) )
@@ -81,8 +157,16 @@ function bp_dtheme_ajax_querystring( $query_string, $object ) {
 }
 add_filter( 'bp_ajax_querystring', 'bp_dtheme_ajax_querystring', 10, 2 );
 
-/* This function will simply load the template loop for the current object. On an AJAX request */
+/**
+ * Load the template loop for the current object.
+ *
+ * @return string Prints template loop for the specified object
+ * @since BuddyPress (1.2)
+ */
 function bp_dtheme_object_template_loader() {
+	// Bail if not a POST action
+	if ( 'POST' !== strtoupper( $_SERVER['REQUEST_METHOD'] ) )
+		return;
 
  	/**
 	 * AJAX requests happen too early to be seen by bp_update_is_directory()
@@ -90,7 +174,8 @@ function bp_dtheme_object_template_loader() {
 	 * context. Without this check, templates will load the 'single' version
 	 * of themselves rather than the directory version.
 	 */
-	if ( !bp_current_action() )
+
+	if ( ! bp_current_action() )
 		bp_update_is_directory( true, bp_current_component() );
 
 	// Sanitize the post object
@@ -98,131 +183,147 @@ function bp_dtheme_object_template_loader() {
 
 	// Locate the object template
 	locate_template( array( "$object/$object-loop.php" ), true );
+	exit;
+}
+
+/**
+ * Load messages template loop when searched on the private message page
+ *
+ * @return string Prints template loop for the Messages component
+ * @since BuddyPress (1.6)
+ */
+function bp_dtheme_messages_template_loader(){
+	locate_template( array( 'members/single/messages/messages-loop.php' ), true );
+	exit;
 }
-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' );
 
-// This function will load the activity loop template when activity is requested via AJAX
+/**
+ * Load the activity loop template when activity is requested via AJAX,
+ *
+ * @return string JSON object containing 'contents' (output of the template loop for the Activity component) and 'feed_url' (URL to the relevant RSS feed).
+ * @since BuddyPress (1.2)
+ */
 function bp_dtheme_activity_template_loader() {
-	global $bp;
+	// Bail if not a POST action
+	if ( 'POST' !== strtoupper( $_SERVER['REQUEST_METHOD'] ) )
+		return;
 
 	$scope = '';
-	if ( !empty( $_POST['scope'] ) )
+	if ( ! empty( $_POST['scope'] ) )
 		$scope = $_POST['scope'];
 
 	// We need to calculate and return the feed URL for each scope
 	switch ( $scope ) {
 		case 'friends':
-			$feed_url = $bp->loggedin_user->domain . bp_get_activity_slug() . '/friends/feed/';
+			$feed_url = bp_loggedin_user_domain() . bp_get_activity_slug() . '/friends/feed/';
 			break;
 		case 'groups':
-			$feed_url = $bp->loggedin_user->domain . bp_get_activity_slug() . '/groups/feed/';
+			$feed_url = bp_loggedin_user_domain() . bp_get_activity_slug() . '/groups/feed/';
 			break;
 		case 'favorites':
-			$feed_url = $bp->loggedin_user->domain . bp_get_activity_slug() . '/favorites/feed/';
+			$feed_url = bp_loggedin_user_domain() . bp_get_activity_slug() . '/favorites/feed/';
 			break;
 		case 'mentions':
-			$feed_url = $bp->loggedin_user->domain . bp_get_activity_slug() . '/mentions/feed/';
-			bp_activity_clear_new_mentions( $bp->loggedin_user->id );
+			$feed_url = bp_loggedin_user_domain() . bp_get_activity_slug() . '/mentions/feed/';
+			bp_activity_clear_new_mentions( bp_loggedin_user_id() );
 			break;
 		default:
 			$feed_url = home_url( bp_get_activity_root_slug() . '/feed/' );
 			break;
 	}
 
-	/* Buffer the loop in the template to a var for JS to spit out. */
+	// 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();
 	$result['feed_url'] = apply_filters( 'bp_dtheme_activity_feed_url', $feed_url, $scope );
 	ob_end_clean();
 
-	echo json_encode( $result );
+	exit( json_encode( $result ) );
 }
-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' );
 
-/* AJAX update posting */
+/**
+ * Processes Activity updates received via a POST request.
+ *
+ * @return string HTML
+ * @since BuddyPress (1.2)
+ */
 function bp_dtheme_post_update() {
-	global $bp;
+	// Bail if not a POST action
+	if ( 'POST' !== strtoupper( $_SERVER['REQUEST_METHOD'] ) )
+		return;
 
 	// Check the nonce
 	check_admin_referer( 'post_update', '_wpnonce_post_update' );
 
-	if ( !is_user_logged_in() ) {
-		echo '-1';
-		return false;
-	}
+	if ( ! is_user_logged_in() )
+		exit( '-1' );
 
-	if ( empty( $_POST['content'] ) ) {
-		echo '-1<div id="message" class="error"><p>' . __( 'Please enter some content to post.', 'buddypress' ) . '</p></div>';
-		return false;
-	}
+	if ( empty( $_POST['content'] ) )
+		exit( '-1<div id="message" class="error"><p>' . __( 'Please enter some content to post.', 'buddypress' ) . '</p></div>' );
 
 	$activity_id = 0;
 	if ( empty( $_POST['object'] ) && bp_is_active( 'activity' ) ) {
 		$activity_id = bp_activity_post_update( array( 'content' => $_POST['content'] ) );
 
 	} elseif ( $_POST['object'] == 'groups' ) {
-		if ( !empty( $_POST['item_id'] ) && bp_is_active( 'groups' ) )
+		if ( ! empty( $_POST['item_id'] ) && bp_is_active( 'groups' ) )
 			$activity_id = groups_post_update( array( 'content' => $_POST['content'], 'group_id' => $_POST['item_id'] ) );
 
 	} else {
 		$activity_id = apply_filters( 'bp_activity_custom_update', $_POST['object'], $_POST['item_id'], $_POST['content'] );
 	}
 
-	if ( empty( $activity_id ) ) {
-		echo '-1<div id="message" class="error"><p>' . __( 'There was a problem posting your update, please try again.', 'buddypress' ) . '</p></div>';
-		return false;
+	if ( empty( $activity_id ) )
+		exit( '-1<div id="message" class="error"><p>' . __( 'There was a problem posting your update, please try again.', 'buddypress' ) . '</p></div>' );
+
+	if ( bp_has_activities ( 'include=' . $activity_id ) ) {
+		while ( bp_activities() ) {
+			bp_the_activity(); 
+			locate_template( array( 'activity/entry.php' ), true );
+		}
 	}
 
-	if ( bp_has_activities ( 'include=' . $activity_id ) ) : ?>
-		<?php while ( bp_activities() ) : bp_the_activity(); ?>
-			<?php locate_template( array( 'activity/entry.php' ), true ) ?>
-		<?php endwhile; ?>
-	 <?php endif;
+	exit;
 }
-add_action( 'wp_ajax_post_update', 'bp_dtheme_post_update' );
 
-/* AJAX activity comment posting */
+/**
+ * Posts new Activity comments received via a POST request.
+ *
+ * @global BP_Activity_Template $activities_template
+ * @return string HTML
+ * @since BuddyPress (1.2)
+ */
 function bp_dtheme_new_activity_comment() {
-	global $bp;
+	global $activities_template;
+
+	// Bail if not a POST action
+	if ( 'POST' !== strtoupper( $_SERVER['REQUEST_METHOD'] ) )
+		return;
 
 	// Check the nonce
 	check_admin_referer( 'new_activity_comment', '_wpnonce_new_activity_comment' );
 
-	if ( !is_user_logged_in() ) {
-		echo '-1';
-		return false;
-	}
+	if ( ! is_user_logged_in() )
+		exit( '-1' );
 
-	if ( empty( $_POST['content'] ) ) {
-		echo '-1<div id="message" class="error"><p>' . __( 'Please do not leave the comment area blank.', 'buddypress' ) . '</p></div>';
-		return false;
-	}
+	if ( empty( $_POST['content'] ) )
+		exit( '-1<div id="message" class="error"><p>' . __( 'Please do not leave the comment area blank.', 'buddypress' ) . '</p></div>' );
 
-	if ( empty( $_POST['form_id'] ) || empty( $_POST['comment_id'] ) || !is_numeric( $_POST['form_id'] ) || !is_numeric( $_POST['comment_id'] ) ) {
-		echo '-1<div id="message" class="error"><p>' . __( 'There was an error posting that reply, please try again.', 'buddypress' ) . '</p></div>';
-		return false;
-	}
+	if ( empty( $_POST['form_id'] ) || empty( $_POST['comment_id'] ) || ! is_numeric( $_POST['form_id'] ) || ! is_numeric( $_POST['comment_id'] ) )
+		exit( '-1<div id="message" class="error"><p>' . __( 'There was an error posting that reply, please try again.', 'buddypress' ) . '</p></div>' );
 
 	$comment_id = bp_activity_new_comment( array(
 		'activity_id' => $_POST['form_id'],
 		'content'     => $_POST['content'],
-		'parent_id'   => $_POST['comment_id']
+		'parent_id'   => $_POST['comment_id'],
 	) );
 
-	if ( !$comment_id ) {
-		echo '-1<div id="message" class="error"><p>' . __( 'There was an error posting that reply, please try again.', 'buddypress' ) . '</p></div>';
-		return false;
-	}
-
-	global $activities_template;
+	if ( ! $comment_id )
+		exit( '-1<div id="message" class="error"><p>' . __( 'There was an error posting that reply, please try again.', 'buddypress' ) . '</p></div>' );
 
 	// Load the new activity item into the $activities_template global
-	bp_has_activities( 'display_comments=stream&include=' . $comment_id );
+	bp_has_activities( 'display_comments=stream&hide_spam=false&include=' . $comment_id );
 
 	// Swap the current comment with the activity item we just loaded
 	$activities_template->activity->id              = $activities_template->activities[0]->item_id;
@@ -230,127 +331,197 @@ function bp_dtheme_new_activity_comment() {
 
 	$template = locate_template( 'activity/comment.php', false, false );
 
-	// Backward compatibility. In older versions of BP, the markup was
-	// generated in the PHP instead of a template. This ensures that
-	// older themes (which are not children of bp-default and won't
-	// have the new template) will still work.
+	/**
+	 * Backward compatibility. In older versions of BP, the markup was
+	 * generated in the PHP instead of a template. This ensures that
+	 * older themes (which are not children of bp-default and won't
+	 * have the new template) will still work.
+	 */
 	if ( empty( $template ) )
 		$template = BP_PLUGIN_DIR . '/bp-themes/bp-default/activity/comment.php';
 
 	load_template( $template, false );
 
 	unset( $activities_template );
+	exit;
 }
-add_action( 'wp_ajax_new_activity_comment', 'bp_dtheme_new_activity_comment' );
 
-/* AJAX delete an activity */
+/**
+ * Deletes an Activity item received via a POST request.
+ *
+ * @return mixed String on error, void on success
+ * @since BuddyPress (1.2)
+ */ 
 function bp_dtheme_delete_activity() {
-	global $bp;
+	// Bail if not a POST action
+	if ( 'POST' !== strtoupper( $_SERVER['REQUEST_METHOD'] ) )
+		return;
 
 	// Check the nonce
 	check_admin_referer( 'bp_activity_delete_link' );
 
-	if ( !is_user_logged_in() ) {
-		echo '-1';
-		return false;
-	}
+	if ( ! is_user_logged_in() )
+		exit( '-1' );
 
-	if ( empty( $_POST['id'] ) || !is_numeric( $_POST['id'] ) ) {
-		echo '-1';
-		return false;
-	}
+	if ( empty( $_POST['id'] ) || ! is_numeric( $_POST['id'] ) )
+		exit( '-1' );
 
 	$activity = new BP_Activity_Activity( (int) $_POST['id'] );
 
 	// Check access
-	if ( empty( $activity->user_id ) || !bp_activity_user_can_delete( $activity ) ) {
-		echo '-1';
-		return false;
-	}
+	if ( empty( $activity->user_id ) || ! bp_activity_user_can_delete( $activity ) )
+		exit( '-1' );
 
 	// Call the action before the delete so plugins can still fetch information about it
 	do_action( 'bp_activity_before_action_delete_activity', $activity->id, $activity->user_id );
 
-	if ( !bp_activity_delete( array( 'id' => $activity->id, 'user_id' => $activity->user_id ) ) ) {
-		echo '-1<div id="message" class="error"><p>' . __( 'There was a problem when deleting. Please try again.', 'buddypress' ) . '</p></div>';
-		return false;
-	}
+	if ( ! bp_activity_delete( array( 'id' => $activity->id, 'user_id' => $activity->user_id ) ) )
+		exit( '-1<div id="message" class="error"><p>' . __( 'There was a problem when deleting. Please try again.', 'buddypress' ) . '</p></div>' );
 
 	do_action( 'bp_activity_action_delete_activity', $activity->id, $activity->user_id );
-
-	return true;
+	exit;
 }
-add_action( 'wp_ajax_delete_activity', 'bp_dtheme_delete_activity' );
 
-/* AJAX delete an activity comment */
+/**
+ * Deletes an Activity comment received via a POST request
+ *
+ * @return mixed String on error, void on success
+ * @since BuddyPress (1.2)
+ */
 function bp_dtheme_delete_activity_comment() {
-	global $bp;
+	// Bail if not a POST action
+	if ( 'POST' !== strtoupper( $_SERVER['REQUEST_METHOD'] ) )
+		return;
 
-	/* Check the nonce */
+	// Check the nonce
 	check_admin_referer( 'bp_activity_delete_link' );
 
-	if ( !is_user_logged_in() ) {
-		echo '-1';
-		return false;
-	}
+	if ( ! is_user_logged_in() )
+		exit( '-1' );
 
 	$comment = new BP_Activity_Activity( $_POST['id'] );
 
-	/* Check access */
-	if ( !is_super_admin() && $comment->user_id != $bp->loggedin_user->id )
-		return false;
+	// Check access
+	if ( ! bp_current_user_can( 'bp_moderate' ) && $comment->user_id != bp_loggedin_user_id() )
+		exit( '-1' );
 
-	if ( empty( $_POST['id'] ) || !is_numeric( $_POST['id'] ) )
-		return false;
+	if ( empty( $_POST['id'] ) || ! is_numeric( $_POST['id'] ) )
+		exit( '-1' );
 
-	/* Call the action before the delete so plugins can still fetch information about it */
+	// Call the action before the delete so plugins can still fetch information about it
 	do_action( 'bp_activity_before_action_delete_activity', $_POST['id'], $comment->user_id );
 
-	if ( !bp_activity_delete_comment( $comment->item_id, $comment->id ) ) {
-		echo '-1<div id="message" class="error"><p>' . __( 'There was a problem when deleting. Please try again.', 'buddypress' ) . '</p></div>';
-		return false;
-	}
+	if ( ! bp_activity_delete_comment( $comment->item_id, $comment->id ) )
+		exit( '-1<div id="message" class="error"><p>' . __( 'There was a problem when deleting. Please try again.', 'buddypress' ) . '</p></div>' );
 
 	do_action( 'bp_activity_action_delete_activity', $_POST['id'], $comment->user_id );
+	exit;
+}
+
+/**
+ * AJAX spam an activity item or comment
+ *
+ * @global BuddyPress $bp The one true BuddyPress instance
+ * @return mixed String on error, void on success
+ * @since BuddyPress (1.6)
+ */
+function bp_dtheme_spam_activity() {
+	global $bp;
+
+	// Bail if not a POST action
+	if ( 'POST' !== strtoupper( $_SERVER['REQUEST_METHOD'] ) )
+		return;
+
+	// Check that user is logged in, Activity Streams are enabled, and Akismet is present.
+	if ( ! is_user_logged_in() || ! bp_is_active( 'activity' ) || empty( $bp->activity->akismet ) )
+		exit( '-1' );
+
+	// Check an item ID was passed
+	if ( empty( $_POST['id'] ) || ! is_numeric( $_POST['id'] ) )
+		exit( '-1' );
+
+	// Is the current user allowed to spam items?
+	if ( ! bp_activity_user_can_mark_spam() )
+		exit( '-1' );
+
+	// Load up the activity item
+	$activity = new BP_Activity_Activity( (int) $_POST['id'] );
+	if ( empty( $activity->component ) )
+		exit( '-1' );
+
+	// Check nonce
+	check_admin_referer( 'bp_activity_akismet_spam_' . $activity->id );
+
+	// Call an action before the spamming so plugins can modify things if they want to
+	do_action( 'bp_activity_before_action_spam_activity', $activity->id, $activity );
+
+	// Mark as spam
+	bp_activity_mark_as_spam( $activity );
+	$activity->save();
 
-	return true;
+	do_action( 'bp_activity_action_spam_activity', $activity->id, $activity->user_id );
+	exit;
 }
-add_action( 'wp_ajax_delete_activity_comment', 'bp_dtheme_delete_activity_comment' );
 
-/* AJAX mark an activity as a favorite */
+/**
+ * Mark an activity as a favourite via a POST request.
+ *
+ * @return string HTML
+ * @since BuddyPress (1.2)
+ */
 function bp_dtheme_mark_activity_favorite() {
-	global $bp;
+	// Bail if not a POST action
+	if ( 'POST' !== strtoupper( $_SERVER['REQUEST_METHOD'] ) )
+		return;
+
+	if ( bp_activity_add_user_favorite( $_POST['id'] ) )
+		_e( 'Remove Favorite', 'buddypress' );
+	else
+		_e( 'Favorite', 'buddypress' );
 
-	bp_activity_add_user_favorite( $_POST['id'] );
-	_e( 'Remove Favorite', 'buddypress' );
+	exit;
 }
-add_action( 'wp_ajax_activity_mark_fav', 'bp_dtheme_mark_activity_favorite' );
 
-/* AJAX mark an activity as not a favorite */
+/**
+ * Un-favourite an activity via a POST request.
+ *
+ * @return string HTML
+ * @since BuddyPress (1.2)
+ */
 function bp_dtheme_unmark_activity_favorite() {
-	global $bp;
+	// Bail if not a POST action
+	if ( 'POST' !== strtoupper( $_SERVER['REQUEST_METHOD'] ) )
+		return;
 
-	bp_activity_remove_user_favorite( $_POST['id'] );
-	_e( 'Favorite', 'buddypress' );
+	if ( bp_activity_remove_user_favorite( $_POST['id'] ) )
+		_e( 'Favorite', 'buddypress' );
+	else
+		_e( 'Remove Favorite', 'buddypress' );
+
+	exit;
 }
-add_action( 'wp_ajax_activity_mark_unfav', 'bp_dtheme_unmark_activity_favorite' );
 
 /**
- * AJAX handler for Read More link on long activity items
+ * Fetches full an activity's full, non-excerpted content via a POST request.
+ * Used for the 'Read More' link on long activity items.
  *
- * @package BuddyPress
- * @since 1.5
+ * @return string HTML
+ * @since BuddyPress (1.5)
  */
 function bp_dtheme_get_single_activity_content() {
+	// Bail if not a POST action
+	if ( 'POST' !== strtoupper( $_SERVER['REQUEST_METHOD'] ) )
+		return;
+
 	$activity_array = bp_activity_get_specific( array(
 		'activity_ids'     => $_POST['activity_id'],
 		'display_comments' => 'stream'
 	) );
 
-	$activity = !empty( $activity_array['activities'][0] ) ? $activity_array['activities'][0] : false;
+	$activity = ! empty( $activity_array['activities'][0] ) ? $activity_array['activities'][0] : false;
 
-	if ( !$activity )
-		exit(); // todo: error?
+	if ( empty( $activity ) )
+		exit; // @todo: error?
 
 	do_action_ref_array( 'bp_dtheme_get_single_activity_content', array( &$activity ) );
 
@@ -358,30 +529,35 @@ function bp_dtheme_get_single_activity_content() {
 	remove_filter( 'bp_get_activity_content_body', 'bp_activity_truncate_entry', 5 );
 	$content = apply_filters( 'bp_get_activity_content_body', $activity->content );
 
-	echo $content;
-	exit();
+	exit( $content );
 }
-add_action( 'wp_ajax_get_single_activity_content', 'bp_dtheme_get_single_activity_content' );
 
-/* AJAX invite a friend to a group functionality */
+/**
+ * Invites a friend to join a group via a POST request.
+ *
+ * @return unknown
+ * @since BuddyPress (1.2)
+ * @todo Audit return types
+ */
 function bp_dtheme_ajax_invite_user() {
-	global $bp;
+	// Bail if not a POST action
+	if ( 'POST' !== strtoupper( $_SERVER['REQUEST_METHOD'] ) )
+		return;
 
 	check_ajax_referer( 'groups_invite_uninvite_user' );
 
-	if ( !$_POST['friend_id'] || !$_POST['friend_action'] || !$_POST['group_id'] )
-		return false;
+	if ( ! $_POST['friend_id'] || ! $_POST['friend_action'] || ! $_POST['group_id'] )
+		return;
 
-	if ( !bp_groups_user_can_send_invites( $_POST['group_id'] ) )
-		return false;
+	if ( ! bp_groups_user_can_send_invites( $_POST['group_id'] ) )
+		return;
 
-	if ( !friends_check_friendship( $bp->loggedin_user->id, $_POST['friend_id'] ) )
-		return false;
+	if ( ! friends_check_friendship( bp_loggedin_user_id(), $_POST['friend_id'] ) )
+		return;
 
 	if ( 'invite' == $_POST['friend_action'] ) {
-
-		if ( !groups_invite_user( array( 'user_id' => $_POST['friend_id'], 'group_id' => $_POST['group_id'] ) ) )
-			return false;
+		if ( ! groups_invite_user( array( 'user_id' => $_POST['friend_id'], 'group_id' => $_POST['group_id'] ) ) )
+			return;
 
 		$user = new BP_Core_User( $_POST['friend_id'] );
 
@@ -390,145 +566,186 @@ function bp_dtheme_ajax_invite_user() {
 		echo '<h4>' . $user->user_link . '</h4>';
 		echo '<span class="activity">' . esc_attr( $user->last_active ) . '</span>';
 		echo '<div class="action">
-				<a class="button remove" href="' . wp_nonce_url( $bp->loggedin_user->domain . bp_get_groups_slug() . '/' . $_POST['group_id'] . '/invites/remove/' . $user->id, 'groups_invite_uninvite_user' ) . '" id="uid-' . esc_attr( $user->id ) . '">' . __( 'Remove Invite', 'buddypress' ) . '</a>
+				<a class="button remove" href="' . wp_nonce_url( bp_loggedin_user_domain() . bp_get_groups_slug() . '/' . $_POST['group_id'] . '/invites/remove/' . $user->id, 'groups_invite_uninvite_user' ) . '" id="uid-' . esc_attr( $user->id ) . '">' . __( 'Remove Invite', 'buddypress' ) . '</a>
 			  </div>';
 		echo '</li>';
+		exit;
 
-	} else if ( 'uninvite' == $_POST['friend_action'] ) {
+	} elseif ( 'uninvite' == $_POST['friend_action'] ) {
+		if ( ! groups_uninvite_user( $_POST['friend_id'], $_POST['group_id'] ) )
+			return;
 
-		if ( !groups_uninvite_user( $_POST['friend_id'], $_POST['group_id'] ) )
-			return false;
-
-		return true;
+		exit;
 
 	} else {
-		return false;
+		return;
 	}
 }
-add_action( 'wp_ajax_groups_invite_user', 'bp_dtheme_ajax_invite_user' );
 
-/* AJAX add/remove a user as a friend when clicking the button */
+/**
+ * Friend/un-friend a user via a POST request.
+ *
+ * @return string HTML
+ * @since BuddyPress (1.2)
+ */
 function bp_dtheme_ajax_addremove_friend() {
-	global $bp;
+	// Bail if not a POST action
+	if ( 'POST' !== strtoupper( $_SERVER['REQUEST_METHOD'] ) )
+		return;
 
-	if ( 'is_friend' == BP_Friends_Friendship::check_is_friend( $bp->loggedin_user->id, $_POST['fid'] ) ) {
+	if ( 'is_friend' == BP_Friends_Friendship::check_is_friend( bp_loggedin_user_id(), $_POST['fid'] ) ) {
+		check_ajax_referer( 'friends_remove_friend' );
 
-		check_ajax_referer('friends_remove_friend');
+		if ( ! friends_remove_friend( bp_loggedin_user_id(), $_POST['fid'] ) )
+			echo __( 'Friendship could not be canceled.', 'buddypress' );
+		else
+			echo '<a id="friend-' . $_POST['fid'] . '" class="add" rel="add" title="' . __( 'Add Friend', 'buddypress' ) . '" href="' . wp_nonce_url( bp_loggedin_user_domain() . bp_get_friends_slug() . '/add-friend/' . $_POST['fid'], 'friends_add_friend' ) . '">' . __( 'Add Friend', 'buddypress' ) . '</a>';
 
-		if ( !friends_remove_friend( $bp->loggedin_user->id, $_POST['fid'] ) ) {
-			echo __("Friendship could not be canceled.", 'buddypress');
-		} else {
-			echo '<a id="friend-' . $_POST['fid'] . '" class="add" rel="add" title="' . __( 'Add Friend', 'buddypress' ) . '" href="' . wp_nonce_url( $bp->loggedin_user->domain . bp_get_friends_slug() . '/add-friend/' . $_POST['fid'], 'friends_add_friend' ) . '">' . __( 'Add Friend', 'buddypress' ) . '</a>';
-		}
+	} elseif ( 'not_friends' == BP_Friends_Friendship::check_is_friend( bp_loggedin_user_id(), $_POST['fid'] ) ) {
+		check_ajax_referer( 'friends_add_friend' );
 
-	} else if ( 'not_friends' == BP_Friends_Friendship::check_is_friend( $bp->loggedin_user->id, $_POST['fid'] ) ) {
+		if ( ! friends_add_friend( bp_loggedin_user_id(), $_POST['fid'] ) )
+			echo __(' Friendship could not be requested.', 'buddypress' );
+		else
+			echo '<a id="friend-' . $_POST['fid'] . '" class="remove" rel="remove" title="' . __( 'Cancel Friendship Request', 'buddypress' ) . '" href="' . wp_nonce_url( bp_loggedin_user_domain() . bp_get_friends_slug() . '/requests/cancel/' . (int) $_POST['fid'] . '/', 'friends_withdraw_friendship' ) . '" class="requested">' . __( 'Cancel Friendship Request', 'buddypress' ) . '</a>';
 
-		check_ajax_referer('friends_add_friend');
+	} elseif ( 'pending' == BP_Friends_Friendship::check_is_friend( bp_loggedin_user_id(), (int) $_POST['fid'] ) ) {		
+		check_ajax_referer( 'friends_withdraw_friendship' );
+
+		if ( friends_withdraw_friendship( bp_loggedin_user_id(), (int) $_POST['fid'] ) )
+			echo '<a id="friend-' . $_POST['fid'] . '" class="add" rel="add" title="' . __( 'Add Friend', 'buddypress' ) . '" href="' . wp_nonce_url( bp_loggedin_user_domain() . bp_get_friends_slug() . '/add-friend/' . $_POST['fid'], 'friends_add_friend' ) . '">' . __( 'Add Friend', 'buddypress' ) . '</a>';
+		else
+			echo __("Friendship request could not be cancelled.", 'buddypress');
 
-		if ( !friends_add_friend( $bp->loggedin_user->id, $_POST['fid'] ) ) {
-			echo __("Friendship could not be requested.", 'buddypress');
-		} else {
-			echo '<a href="' . $bp->loggedin_user->domain . bp_get_friends_slug() . '/requests" class="requested">' . __( 'Friendship Requested', 'buddypress' ) . '</a>';
-		}
 	} else {
 		echo __( 'Request Pending', 'buddypress' );
 	}
 
-	return false;
+	exit;
 }
-add_action( 'wp_ajax_addremove_friend', 'bp_dtheme_ajax_addremove_friend' );
 
-/* AJAX accept a user as a friend when clicking the "accept" button */
+/**
+ * Accept a user friendship request via a POST request.
+ *
+ * @return mixed String on error, void on success
+ * @since BuddyPress (1.2)
+ */
 function bp_dtheme_ajax_accept_friendship() {
+	// Bail if not a POST action
+	if ( 'POST' !== strtoupper( $_SERVER['REQUEST_METHOD'] ) )
+		return;
+
 	check_admin_referer( 'friends_accept_friendship' );
 
-	if ( !friends_accept_friendship( $_POST['id'] ) )
+	if ( ! friends_accept_friendship( $_POST['id'] ) )
 		echo "-1<div id='message' class='error'><p>" . __( 'There was a problem accepting that request. Please try again.', 'buddypress' ) . '</p></div>';
 
-	return true;
+	exit;
 }
-add_action( 'wp_ajax_accept_friendship', 'bp_dtheme_ajax_accept_friendship' );
 
-/* AJAX reject a user as a friend when clicking the "reject" button */
+/**
+ * Reject a user friendship request via a POST request.
+ *
+ * @return mixed String on error, void on success
+ * @since BuddyPress (1.2)
+ */
 function bp_dtheme_ajax_reject_friendship() {
+	// Bail if not a POST action
+	if ( 'POST' !== strtoupper( $_SERVER['REQUEST_METHOD'] ) )
+		return;
+
 	check_admin_referer( 'friends_reject_friendship' );
 
-	if ( !friends_reject_friendship( $_POST['id'] ) )
+	if ( ! friends_reject_friendship( $_POST['id'] ) )
 		echo "-1<div id='message' class='error'><p>" . __( 'There was a problem rejecting that request. Please try again.', 'buddypress' ) . '</p></div>';
 
-	return true;
+	exit;
 }
-add_action( 'wp_ajax_reject_friendship', 'bp_dtheme_ajax_reject_friendship' );
 
-/* AJAX join or leave a group when clicking the "join/leave" button */
+/**
+ * Join or leave a group when clicking the "join/leave" button via a POST request.
+ *
+ * @return string HTML
+ * @since BuddyPress (1.2)
+ */
 function bp_dtheme_ajax_joinleave_group() {
-	global $bp;
-
-	if ( groups_is_user_banned( $bp->loggedin_user->id, $_POST['gid'] ) )
-		return false;
+	// Bail if not a POST action
+	if ( 'POST' !== strtoupper( $_SERVER['REQUEST_METHOD'] ) )
+		return;
 
-	if ( !$group = new BP_Groups_Group( $_POST['gid'], false, false ) )
-		return false;
+	if ( groups_is_user_banned( bp_loggedin_user_id(), $_POST['gid'] ) )
+		return;
 
-	if ( !groups_is_user_member( $bp->loggedin_user->id, $group->id ) ) {
+	if ( ! $group = groups_get_group( array( 'group_id' => $_POST['gid'] ) ) )
+		return;
 
+	if ( ! groups_is_user_member( bp_loggedin_user_id(), $group->id ) ) {
 		if ( 'public' == $group->status ) {
-
 			check_ajax_referer( 'groups_join_group' );
 
-			if ( !groups_join_group( $group->id ) ) {
+			if ( ! groups_join_group( $group->id ) )
 				_e( 'Error joining group', 'buddypress' );
-			} else {
+			else
 				echo '<a id="group-' . esc_attr( $group->id ) . '" class="leave-group" rel="leave" title="' . __( 'Leave Group', 'buddypress' ) . '" href="' . wp_nonce_url( bp_get_group_permalink( $group ) . 'leave-group', 'groups_leave_group' ) . '">' . __( 'Leave Group', 'buddypress' ) . '</a>';
-			}
-
-		} else if ( 'private' == $group->status ) {
 
+		} elseif ( 'private' == $group->status ) {
 			check_ajax_referer( 'groups_request_membership' );
 
-			if ( !groups_send_membership_request( $bp->loggedin_user->id, $group->id ) ) {
+			if ( ! groups_send_membership_request( bp_loggedin_user_id(), $group->id ) )
 				_e( 'Error requesting membership', 'buddypress' );
-			} else {
+			else
 				echo '<a id="group-' . esc_attr( $group->id ) . '" class="membership-requested" rel="membership-requested" title="' . __( 'Membership Requested', 'buddypress' ) . '" href="' . bp_get_group_permalink( $group ) . '">' . __( 'Membership Requested', 'buddypress' ) . '</a>';
-			}
 		}
 
 	} else {
-
 		check_ajax_referer( 'groups_leave_group' );
 
-		if ( !groups_leave_group( $group->id ) ) {
+		if ( ! groups_leave_group( $group->id ) )
 			_e( 'Error leaving group', 'buddypress' );
-		} else {
-			if ( 'public' == $group->status ) {
-				echo '<a id="group-' . esc_attr( $group->id ) . '" class="join-group" rel="join" title="' . __( 'Join Group', 'buddypress' ) . '" href="' . wp_nonce_url( bp_get_group_permalink( $group ) . 'join', 'groups_join_group' ) . '">' . __( 'Join Group', 'buddypress' ) . '</a>';
-			} else if ( 'private' == $group->status ) {
-				echo '<a id="group-' . esc_attr( $group->id ) . '" class="request-membership" rel="join" title="' . __( 'Request Membership', 'buddypress' ) . '" href="' . wp_nonce_url( bp_get_group_permalink( $group ) . 'request-membership', 'groups_send_membership_request' ) . '">' . __( 'Request Membership', 'buddypress' ) . '</a>';
-			}
-		}
+		elseif ( 'public' == $group->status )
+			echo '<a id="group-' . esc_attr( $group->id ) . '" class="join-group" rel="join" title="' . __( 'Join Group', 'buddypress' ) . '" href="' . wp_nonce_url( bp_get_group_permalink( $group ) . 'join', 'groups_join_group' ) . '">' . __( 'Join Group', 'buddypress' ) . '</a>';
+		elseif ( 'private' == $group->status )
+			echo '<a id="group-' . esc_attr( $group->id ) . '" class="request-membership" rel="join" title="' . __( 'Request Membership', 'buddypress' ) . '" href="' . wp_nonce_url( bp_get_group_permalink( $group ) . 'request-membership', 'groups_send_membership_request' ) . '">' . __( 'Request Membership', 'buddypress' ) . '</a>';
 	}
+
+	exit;
 }
-add_action( 'wp_ajax_joinleave_group', 'bp_dtheme_ajax_joinleave_group' );
 
-/* AJAX close and keep closed site wide notices from an admin in the sidebar */
+/**
+ * Close and keep closed site wide notices from an admin in the sidebar, via a POST request.
+ *
+ * @return mixed String on error, void on success
+ * @since BuddyPress (1.2)
+ */
 function bp_dtheme_ajax_close_notice() {
-	global $userdata;
+	// Bail if not a POST action
+	if ( 'POST' !== strtoupper( $_SERVER['REQUEST_METHOD'] ) )
+		return;
 
-	if ( !isset( $_POST['notice_id'] ) ) {
-		echo "-1<div id='message' class='error'><p>" . __('There was a problem closing the notice.', 'buddypress') . '</p></div>';
-	} else {
-		$notice_ids = bp_get_user_meta( $userdata->ID, 'closed_notices', true );
+	if ( ! isset( $_POST['notice_id'] ) ) {
+		echo "-1<div id='message' class='error'><p>" . __( 'There was a problem closing the notice.', 'buddypress' ) . '</p></div>';
 
+	} else {
+		$user_id      = get_current_user_id();
+		$notice_ids   = bp_get_user_meta( $user_id, 'closed_notices', true );
 		$notice_ids[] = (int) $_POST['notice_id'];
 
-		bp_update_user_meta( $userdata->ID, 'closed_notices', $notice_ids );
+		bp_update_user_meta( $user_id, 'closed_notices', $notice_ids );
 	}
+
+	exit;
 }
-add_action( 'wp_ajax_messages_close_notice', 'bp_dtheme_ajax_close_notice' );
 
-/* AJAX send a private message reply to a thread */
+/**
+ * Send a private message reply to a thread via a POST request.
+ *
+ * @return string HTML
+ * @since BuddyPress (1.2)
+ */
 function bp_dtheme_ajax_messages_send_reply() {
-	global $bp;
+	// Bail if not a POST action
+	if ( 'POST' !== strtoupper( $_SERVER['REQUEST_METHOD'] ) )
+		return;
 
 	check_ajax_referer( 'messages_send_message' );
 
@@ -537,21 +754,21 @@ function bp_dtheme_ajax_messages_send_reply() {
 	if ( $result ) { ?>
 		<div class="message-box new-message">
 			<div class="message-metadata">
-				<?php do_action( 'bp_before_message_meta' ) ?>
+				<?php do_action( 'bp_before_message_meta' ); ?>
 				<?php echo bp_loggedin_user_avatar( 'type=thumb&width=30&height=30' ); ?>
 
-				<strong><a href="<?php echo $bp->loggedin_user->domain ?>"><?php echo $bp->loggedin_user->fullname ?></a> <span class="activity"><?php printf( __( 'Sent %s', 'buddypress' ), bp_core_time_since( bp_core_current_time() ) ) ?></span></strong>
+				<strong><a href="<?php echo bp_loggedin_user_domain(); ?>"><?php bp_loggedin_user_fullname(); ?></a> <span class="activity"><?php printf( __( 'Sent %s', 'buddypress' ), bp_core_time_since( bp_core_current_time() ) ); ?></span></strong>
 
-				<?php do_action( 'bp_after_message_meta' ) ?>
+				<?php do_action( 'bp_after_message_meta' ); ?>
 			</div>
 
-			<?php do_action( 'bp_before_message_content' ) ?>
+			<?php do_action( 'bp_before_message_content' ); ?>
 
 			<div class="message-content">
-				<?php echo stripslashes( apply_filters( 'bp_get_the_thread_message_content', $_REQUEST['content'] ) ) ?>
+				<?php echo stripslashes( apply_filters( 'bp_get_the_thread_message_content', $_REQUEST['content'] ) ); ?>
 			</div>
 
-			<?php do_action( 'bp_after_message_content' ) ?>
+			<?php do_action( 'bp_after_message_content' ); ?>
 
 			<div class="clear"></div>
 		</div>
@@ -559,15 +776,24 @@ function bp_dtheme_ajax_messages_send_reply() {
 	} else {
 		echo "-1<div id='message' class='error'><p>" . __( 'There was a problem sending that reply. Please try again.', 'buddypress' ) . '</p></div>';
 	}
+
+	exit;
 }
-add_action( 'wp_ajax_messages_send_reply', 'bp_dtheme_ajax_messages_send_reply' );
 
-/* AJAX mark a private message as unread in your inbox */
+/**
+ * Mark a private message as unread in your inbox via a POST request.
+ *
+ * @return mixed String on error, void on success
+ * @since BuddyPress (1.2)
+ */
 function bp_dtheme_ajax_message_markunread() {
-	global $bp;
+	// Bail if not a POST action
+	if ( 'POST' !== strtoupper( $_SERVER['REQUEST_METHOD'] ) )
+		return;
+
+	if ( ! isset($_POST['thread_ids']) ) {
+		echo "-1<div id='message' class='error'><p>" . __( 'There was a problem marking messages as unread.', 'buddypress' ) . '</p></div>';
 
-	if ( !isset($_POST['thread_ids']) ) {
-		echo "-1<div id='message' class='error'><p>" . __('There was a problem marking messages as unread.', 'buddypress' ) . '</p></div>';
 	} else {
 		$thread_ids = explode( ',', $_POST['thread_ids'] );
 
@@ -575,15 +801,24 @@ function bp_dtheme_ajax_message_markunread() {
 			BP_Messages_Thread::mark_as_unread($thread_ids[$i]);
 		}
 	}
+
+	exit;
 }
-add_action( 'wp_ajax_messages_markunread', 'bp_dtheme_ajax_message_markunread' );
 
-/* AJAX mark a private message as read in your inbox */
+/**
+ * Mark a private message as read in your inbox via a POST request.
+ *
+ * @return mixed String on error, void on success
+ * @since BuddyPress (1.2)
+ */
 function bp_dtheme_ajax_message_markread() {
-	global $bp;
+	// Bail if not a POST action
+	if ( 'POST' !== strtoupper( $_SERVER['REQUEST_METHOD'] ) )
+		return;
 
-	if ( !isset($_POST['thread_ids']) ) {
+	if ( ! isset($_POST['thread_ids']) ) {
 		echo "-1<div id='message' class='error'><p>" . __('There was a problem marking messages as read.', 'buddypress' ) . '</p></div>';
+
 	} else {
 		$thread_ids = explode( ',', $_POST['thread_ids'] );
 
@@ -591,15 +826,24 @@ function bp_dtheme_ajax_message_markread() {
 			BP_Messages_Thread::mark_as_read($thread_ids[$i]);
 		}
 	}
+
+	exit;
 }
-add_action( 'wp_ajax_messages_markread', 'bp_dtheme_ajax_message_markread' );
 
-/* AJAX delete a private message or array of messages in your inbox */
+/**
+ * Delete a private message(s) in your inbox via a POST request.
+ *
+ * @return string HTML
+ * @since BuddyPress (1.2)
+ */
 function bp_dtheme_ajax_messages_delete() {
-	global $bp;
+	// Bail if not a POST action
+	if ( 'POST' !== strtoupper( $_SERVER['REQUEST_METHOD'] ) )
+		return;
 
-	if ( !isset($_POST['thread_ids']) ) {
+	if ( ! isset($_POST['thread_ids']) ) {
 		echo "-1<div id='message' class='error'><p>" . __( 'There was a problem deleting messages.', 'buddypress' ) . '</p></div>';
+
 	} else {
 		$thread_ids = explode( ',', $_POST['thread_ids'] );
 
@@ -608,59 +852,58 @@ function bp_dtheme_ajax_messages_delete() {
 
 		_e( 'Messages deleted.', 'buddypress' );
 	}
+
+	exit;
 }
-add_action( 'wp_ajax_messages_delete', 'bp_dtheme_ajax_messages_delete' );
 
 /**
- * bp_dtheme_ajax_messages_autocomplete_results()
+ * AJAX handler for autocomplete. Displays friends only, unless BP_MESSAGES_AUTOCOMPLETE_ALL is defined.
  *
- * AJAX handler for autocomplete. Displays friends only, unless BP_MESSAGES_AUTOCOMPLETE_ALL is defined
- *
- * @global object object $bp Global BuddyPress settings object
- * @return none
+ * @global BuddyPress $bp The one true BuddyPress instance
+ * @return string HTML
+ * @since BuddyPress (1.2)
  */
 function bp_dtheme_ajax_messages_autocomplete_results() {
 	global $bp;
 
 	// Include everyone in the autocomplete, or just friends?
-	if ( $bp->messages->slug == $bp->current_component )
+	if ( bp_is_current_component( bp_get_messages_slug() ) )
 		$autocomplete_all = $bp->messages->autocomplete_all;
 
-	$friends  = false;
 	$pag_page = 1;
-
-	$limit = $_GET['limit'] ? $_GET['limit'] : apply_filters( 'bp_autocomplete_max_results', 10 );
+	$limit    = $_GET['limit'] ? $_GET['limit'] : apply_filters( 'bp_autocomplete_max_results', 10 );
 
 	// Get the user ids based on the search terms
-	if ( !empty( $autocomplete_all ) ) {
+	if ( ! empty( $autocomplete_all ) ) {
 		$users = BP_Core_User::search_users( $_GET['q'], $limit, $pag_page );
 
-		if ( !empty( $users['users'] ) ) {
+		if ( ! empty( $users['users'] ) ) {
 			// Build an array with the correct format
 			$user_ids = array();
 			foreach( $users['users'] as $user ) {
-				if ( $user->id != $bp->loggedin_user->id )
+				if ( $user->id != bp_loggedin_user_id() )
 					$user_ids[] = $user->id;
 			}
 
 			$user_ids = apply_filters( 'bp_core_autocomplete_ids', $user_ids, $_GET['q'], $limit );
 		}
+
 	} else {
 		if ( bp_is_active( 'friends' ) ) {
-			$users = friends_search_friends( $_GET['q'], $bp->loggedin_user->id, $limit, 1 );
+			$users = friends_search_friends( $_GET['q'], bp_loggedin_user_id(), $limit, 1 );
 
 			// Keeping the bp_friends_autocomplete_list filter for backward compatibility
 			$users = apply_filters( 'bp_friends_autocomplete_list', $users, $_GET['q'], $limit );
 
-			if ( !empty( $users['friends'] ) )
+			if ( ! empty( $users['friends'] ) )
 				$user_ids = apply_filters( 'bp_friends_autocomplete_ids', $users['friends'], $_GET['q'], $limit );
 		}
 	}
 
-	if ( !empty( $user_ids ) ) {
+	if ( ! empty( $user_ids ) ) {
 		foreach ( $user_ids as $user_id ) {
 			$ud = get_userdata( $user_id );
-			if ( !$ud )
+			if ( ! $ud )
 				continue;
 
 			if ( bp_is_username_compatibility_mode() )
@@ -668,11 +911,12 @@ function bp_dtheme_ajax_messages_autocomplete_results() {
 			else
 				$username = $ud->user_nicename;
 
-			echo '<span id="link-' . $username . '" href="' . bp_core_get_user_domain( $user_id ) . '"></span>' . bp_core_fetch_avatar( array( 'item_id' => $user_id, 'type' => 'thumb', 'width' => 15, 'height' => 15 ) ) . ' &nbsp;' . bp_core_get_user_displayname( $user_id ) . ' (' . $username . ')
-			';
+			// Note that the final line break acts as a delimiter for the
+			// autocomplete javascript and thus should not be removed
+			echo '<span id="link-' . $username . '" href="' . bp_core_get_user_domain( $user_id ) . '"></span>' . bp_core_fetch_avatar( array( 'item_id' => $user_id, 'type' => 'thumb', 'width' => 15, 'height' => 15, 'alt' => $ud->display_name ) ) . ' &nbsp;' . bp_core_get_user_displayname( $user_id ) . ' (' . $username . ')' . "\n";
 		}
 	}
-}
-add_action( 'wp_ajax_messages_autocomplete_results', 'bp_dtheme_ajax_messages_autocomplete_results' );
 
+	exit;
+}
 ?>
\ No newline at end of file
diff --git a/wp-content/plugins/buddypress/bp-themes/bp-default/_inc/css/default-rtl.css b/wp-content/plugins/buddypress/bp-themes/bp-default/_inc/css/default-rtl.css
index a3c75ae11e2965055edcb5cc07ea27de0192afdd..5eb118dfe08755589b8c0e67ada0430514c29c3b 100644
--- a/wp-content/plugins/buddypress/bp-themes/bp-default/_inc/css/default-rtl.css
+++ b/wp-content/plugins/buddypress/bp-themes/bp-default/_inc/css/default-rtl.css
@@ -27,7 +27,7 @@ right to left for languages that support this method.
 	5.1 - Activity
 		5.1.1 - Activity Listing
 		5.1.2 - Activity Comments
-	5.2 - Admin Bar
+	5.2 - Toolbar
 	5.3 - Ajax Loading
 	5.4 - Directories - Members, Groups, Blogs, Forums
 	5.5 - Error / Success Messages
@@ -247,17 +247,6 @@ dl {
 	margin-left: auto;
 	margin-right: 0;
 }
-#nav ul,
-#nav .sfhover ul ul,
-#nav :hover ul ul {
-	left: auto;
-	right: -9999px;
-}
-#nav .sfhover ul,
-#nav :hover ul {
-	left: auto;
-	right: 0;
-}
 #nav .sfhover ul .sfhover > ul,
 #nav :hover ul :hover > ul {
 	left: auto;
@@ -268,6 +257,11 @@ dl {
 .comment-navigation {
 	font-family: sans-serif;
 }
+#nav .sfhover ul li a,
+#nav :hover ul li a {
+	padding-left: 0;
+	padding-right: 10px;
+}
 
 
 /*--------------------------------------------------------------
@@ -558,7 +552,7 @@ body.activity-permalink div.activity-comments > ul {
 
 
 /*--------------------------------------------------------------
-5.2 - Admin Bar
+5.2 - Toolbar
 --------------------------------------------------------------*/
 /*--------------------------------------------------------------
 5.3 - Ajax Loading
@@ -766,4 +760,7 @@ div#message-thread div.message-content {
 }
 div#message-thread div.message-options {
 	text-align: left;
-}
\ No newline at end of file
+}
+div.message-search {
+	float: left;
+}
diff --git a/wp-content/plugins/buddypress/bp-themes/bp-default/_inc/css/default.css b/wp-content/plugins/buddypress/bp-themes/bp-default/_inc/css/default.css
index 9df949266b1c6f5120ca77a381a30512827c0862..c347fca18d109675ed97d68c5e2d6760e1ed3187 100644
--- a/wp-content/plugins/buddypress/bp-themes/bp-default/_inc/css/default.css
+++ b/wp-content/plugins/buddypress/bp-themes/bp-default/_inc/css/default.css
@@ -26,7 +26,7 @@ Hello, this is the BuddyPress Default theme stylesheet.
 	6.1 - Activity
 		6.1.1 - Activity Listing
 		6.1.2 - Activity Comments
-	6.2 - Admin Bar
+	6.2 - Toolbar
 	6.3 - Directories - Members, Groups, Blogs, Forums
 	6.4 - Error / Success Messages
 	6.5 - Forms
@@ -34,6 +34,7 @@ Hello, this is the BuddyPress Default theme stylesheet.
 	6.7 - Topics and Tables - Forums and General
 	6.8 - Headers, Lists and Tabs - Activity, Groups, Blogs, Forums
 	6.9 - Private Messaging Threads
+	6.10 - Extended Profiles
 --------------------------------------------------------------*/
 
 /*--------------------------------------------------------------
@@ -131,6 +132,9 @@ div#content .left-menu {
 div#content .main-column {
 	margin-left: 190px;
 }
+textarea {
+	overflow: auto;
+}
 
 
 /*--------------------------------------------------------------
@@ -512,16 +516,20 @@ a:focus {
 }
 #navigation {
 	position: relative;
-	text-align: right;
 	width: 100%;
 }
+#navigation:after {
+	content: ".";
+	display: block;
+	height: 0;
+	clear: both;
+	visibility: hidden;
+}
 #nav {
 	margin: 40px 20px 0 0;
 	list-style: none;
 	padding: 0;
-	position: relative;
-	right: auto;
-	bottom: 0;
+	float: right;
 }
 #nav li a {
 	background: url( ../images/60pc_black.png );
@@ -534,6 +542,7 @@ a:focus {
 #nav li {
 	margin-left: 5px;
 	display: inline-block;
+	float: left;
 }
 #nav li li {
 	margin-left: 0;
@@ -588,12 +597,12 @@ a:focus {
 #nav ul,
 #nav .sfhover ul ul,
 #nav :hover ul ul {
-	left: -9999px;
+	display: none;
 	position: absolute;
 }
 #nav .sfhover ul,
 #nav :hover ul {
-	left: 0;
+	display: block;
 	top: 100%;
 	width: 128px;
 }
@@ -607,6 +616,7 @@ a:focus {
 	left: 125px;
 	top: -1px;
 	width: 128px;
+	display: block;
 }
 #nav ul li.sfhover > a,
 #nav ul li:hover > a {
@@ -615,14 +625,13 @@ a:focus {
 }
 #nav .sfhover ul li,
 #nav :hover ul li {
-	height: 30px;
-	line-height: 30px;
-	text-indent: 10px;
+	min-height: 30px;
+	line-height: 20px;
 	width: 128px;
 }
 #nav .sfhover ul li a,
 #nav :hover ul li a {
-	padding: 0 0;
+	padding: 5px 5px 5px 10px;
 }
 
 
@@ -653,6 +662,9 @@ div.pagination .pagination-links a {
 div.pagination .pagination-links a:hover {
 	font-weight: bold;
 }
+noscript div.pagination {
+	margin-bottom: 15px;
+}
 div#pag-bottom {
 	margin-top: -1px;
 }
@@ -1484,10 +1496,10 @@ div.activity-comments form div.ac-reply-content {
 
 
 /*--------------------------------------------------------------
-6.2 - Admin Bar
+6.2 - Toolbar
 --------------------------------------------------------------*/
 #wp-admin-bar .padder {
-	width: 95% !important; /* Line up the admin bar with the content body in this theme */
+	width: 95% !important; /* Line up the Toolbar with the content body in this theme */
 }
 
 
@@ -1850,8 +1862,6 @@ ul#topic-post-list li div.post-content {
 }
 div.topic-tags {
 	font-size: 11px;
-	float: right;
-	margin-top: -25px;
 }
 div.admin-links {
 	color: #888;
@@ -2016,9 +2026,9 @@ table.forum p.topic-meta {
 	margin: 5px 0 0 0;
 }
 
-/*--------------------------------------------------------------
-6.8 - Headers, Lists and Tabs - Activity, Groups, Blogs, Forums
---------------------------------------------------------------*/
+/*-------------------------------------------------------------------------
+6.8 - Headers, Lists and Tabs - Activity, Groups, Blogs, Forums, Profiles
+-------------------------------------------------------------------------*/
 .item-body {
 	margin: 20px 0;
 }
@@ -2288,7 +2298,9 @@ div.item-list-tabs ul li.feed a {
 	background: url( ../images/rss.png ) center left no-repeat;
 	padding-left: 20px;
 }
-#admins-list li {
+#admins-list li,
+#mods-list li,
+#members-list li {
 	overflow: auto;
 }
 
@@ -2356,4 +2368,56 @@ div#message-thread div.message-content {
 }
 div#message-thread div.message-options {
 	text-align: right;
+}
+
+div.message-search {
+	float: right;
+	margin: 0 20px;
+}
+
+/*--------------------------------------------------------------
+6.9 - Extended Profiles
+--------------------------------------------------------------*/
+
+div.profile h4 {
+	margin-bottom: auto;
+	margin-top: 15px;
+}
+#profile-edit-form ul.button-nav {
+	margin-top: 15px;
+}
+body.no-js .field-visibility-settings-toggle,
+body.no-js .field-visibility-settings-close {
+	display: none;
+}
+.field-visibility-settings {
+	display: none;
+	margin-top: 10px;
+}
+	body.no-js .field-visibility-settings {
+		display: block;
+	}
+.current-visibility-level {
+	font-weight: bold;
+	font-style: normal;
+}
+.field-visibility-settings,
+.field-visibility-settings-toggle,
+.field-visibility-settings-notoggle {
+	color: #888;
+}
+.field-visibility-settings-toggle a,
+.field-visibility-settings a {
+	font-size: .9em;
+}
+body.register div.page ul {
+	list-style: none;
+}
+.standard-form .field-visibility-settings label {
+	margin: 0;
+	font-weight: normal;
+}
+.field-visibility-settings legend,
+.field-visibility-settings-toggle {
+	font-style: italic;
 }
\ No newline at end of file
diff --git a/wp-content/plugins/buddypress/bp-themes/bp-default/_inc/css/responsive.css b/wp-content/plugins/buddypress/bp-themes/bp-default/_inc/css/responsive.css
index 77ddaed38b2811d6dbf4d23f46d8587df8ccc7c6..42e756a497f5be65090cb75d31c635ebb688f6ac 100644
--- a/wp-content/plugins/buddypress/bp-themes/bp-default/_inc/css/responsive.css
+++ b/wp-content/plugins/buddypress/bp-themes/bp-default/_inc/css/responsive.css
@@ -55,6 +55,23 @@ Hello, this is the BuddyPress Responsive theme stylesheet
 		border-radius: 0.25em;
 		margin-bottom: 0;
 	}
+	.wp-caption {
+		width: 99% !important;
+	}
+	.entry {
+		width: 100%;
+	}
+	.entry img {
+		max-width: 100%;
+		height: auto;
+	}
+	.wp-caption img {
+		max-width: 99%;
+		height: auto;
+	}
+	#footer-widgets {
+		padding: 19px 10px;
+	}
 }
 
 
@@ -74,6 +91,27 @@ Hello, this is the BuddyPress Responsive theme stylesheet
 		top: 1em;
 		margin-bottom: 1.25em;
 	}
+	.wp-caption {
+		width: 99% !important;
+	}
+	.entry {
+		width: 100%;
+	}
+	.entry img {
+		max-width: 100%;
+		height: auto;
+	}
+	.wp-caption img {
+		max-width: 99%;
+		height: auto;
+	}
+	#footer-widget-area div.widget-area > ul {
+		float: left;
+		width: 100%;
+	}
+	#footer-widgets {
+		padding: 19px 10px;
+	}
 }
 
 
@@ -142,6 +180,27 @@ Hello, this is the BuddyPress Responsive theme stylesheet
 		float: none;
 		width: 100%;
 	}
+ 	.wp-caption {
+		width: 99% !important;
+ 	}
+ 	.entry {
+		width: 100%;
+ 	}
+ 	.entry img {
+		max-width: 100%;
+		height: auto;
+ 	}
+ 	.wp-caption img {
+		max-width: 99%;
+		height: auto;
+ 	}
+	#footer-widget-area div.widget-area > ul {
+		float: left;
+		width: 100%;
+	}
+	#footer-widgets {
+		padding: 19px 10px;
+	}
 }
 
 
@@ -197,4 +256,28 @@ Hello, this is the BuddyPress Responsive theme stylesheet
 	body.activity-permalink .activity-list li.mini .activity-meta {
 		left: 0;
 	}
+ 	div.post .entry {
+		width: 100%;
+ 	}
+ 	.wp-caption {
+		width: 99%!important;
+ 	}
+ 	.entry {
+		width: 100%;
+ 	}
+ 	.entry img {
+		width: 100%;
+		height: auto;
+ 	}
+ 	.wp-caption img {
+		width: 99%;
+		height: auto;
+ 	}
+ 	#footer-widget-area div.widget-area > ul {
+		float: left;
+		width: 100%;
+ 	}
+ 	#footer-widgets {
+		padding: 19px 10px;
+	}
 }
\ No newline at end of file
diff --git a/wp-content/plugins/buddypress/bp-themes/bp-default/_inc/global.js b/wp-content/plugins/buddypress/bp-themes/bp-default/_inc/global.js
index fe781047cf93d6bdeeae6bcf9ac82c9f6ab28bf9..9efbd7100605c0164998599858ff57a707b2d9f8 100644
--- a/wp-content/plugins/buddypress/bp-themes/bp-default/_inc/global.js
+++ b/wp-content/plugins/buddypress/bp-themes/bp-default/_inc/global.js
@@ -9,9 +9,9 @@ jq(document).ready( function() {
 
 	/* Hide Forums Post Form */
 	if ( '-1' == window.location.search.indexOf('new') && jq('div.forums').length )
-		jq('div#new-topic-post').hide();
+		jq('#new-topic-post').hide();
 	else
-		jq('div#new-topic-post').show();
+		jq('#new-topic-post').show();
 
 	/* Activity filter and scope set */
 	bp_init_activity();
@@ -22,9 +22,16 @@ jq(document).ready( function() {
 
 	/* @mention Compose Scrolling */
 	if ( jq.query.get('r') && jq('textarea#whats-new').length ) {
-		jq('#whats-new-options').animate({height:'40px'});
-		jq("form#whats-new-form textarea").animate({height:'50px'});
-		jq.scrollTo( jq('textarea#whats-new'), 500, { offset:-125, easing:'easeOutQuad' } );
+		jq('#whats-new-options').animate({
+			height:'40px'
+		});
+		jq("form#whats-new-form textarea").animate({
+			height:'50px'
+		});
+		jq.scrollTo( jq('textarea#whats-new'), 500, {
+			offset:-125, 
+			easing:'easeOutQuad'
+		} );
 		jq('textarea#whats-new').focus();
 	}
 
@@ -32,8 +39,12 @@ jq(document).ready( function() {
 
 	/* Textarea focus */
 	jq('#whats-new').focus( function(){
-		jq("#whats-new-options").animate({height:'40px'});
-		jq("form#whats-new-form textarea").animate({height:'50px'});
+		jq("#whats-new-options").animate({
+			height:'40px'
+		});
+		jq("form#whats-new-form textarea").animate({
+			height:'50px'
+		});
 		jq("#aw-whats-new-submit").prop("disabled", false);
 	});
 
@@ -68,7 +79,8 @@ jq(document).ready( function() {
 			'_wpnonce_post_update': jq("input#_wpnonce_post_update").val(),
 			'content': content,
 			'object': object,
-			'item_id': item_id
+			'item_id': item_id,
+			'_bp_as_nonce': jq('#_bp_as_nonce').val() || ''
 		},
 		function(response) {
 
@@ -92,7 +104,7 @@ jq(document).ready( function() {
 				jq("ul#activity-stream").prepend(response);
 				jq("ul#activity-stream li:first").addClass('new-update');
 
-				if ( 0 != jq("div#latest-update").length ) {
+				if ( 0 != jq("#latest-update").length ) {
 					var l = jq("ul#activity-stream li.new-update .activity-content .activity-inner p").html();
 					var v = jq("ul#activity-stream li.new-update .activity-content .activity-header p a.view").attr('href');
 
@@ -100,13 +112,13 @@ jq(document).ready( function() {
 
 					var u = '';
 					if ( ltext != '' )
-						u = '&quot;' + l + '&quot; ';
+						u = l + ' ';
 
 					u += '<a href="' + v + '" rel="nofollow">' + BP_DTheme.view + '</a>';
 
-					jq("div#latest-update").slideUp(300,function(){
-						jq("div#latest-update").html( u );
-						jq("div#latest-update").slideDown(300);
+					jq("#latest-update").slideUp(300,function(){
+						jq("#latest-update").html( u );
+						jq("#latest-update").slideDown(300);
 					});
 				}
 
@@ -115,8 +127,12 @@ jq(document).ready( function() {
 				jq("textarea#whats-new").val('');
 			}
 
-			jq("#whats-new-options").animate({height:'0px'});
-			jq("form#whats-new-form textarea").animate({height:'20px'});
+			jq("#whats-new-options").animate({
+				height:'0px'
+			});
+			jq("form#whats-new-form textarea").animate({
+				height:'20px'
+			});
 			jq("#aw-whats-new-submit").prop("disabled", true).removeClass('loading');
 		});
 
@@ -133,7 +149,9 @@ jq(document).ready( function() {
 			return false;
 
 		/* Reset the page */
-		jq.cookie( 'bp-activity-oldestpage', 1, {path: '/'} );
+		jq.cookie( 'bp-activity-oldestpage', 1, {
+			path: '/'
+		} );
 
 		/* Activity Stream Tabs */
 		var scope = target.attr('id').substr( 9, target.attr('id').length );
@@ -170,7 +188,7 @@ jq(document).ready( function() {
 		/* Favoriting activity stream items */
 		if ( target.hasClass('fav') || target.hasClass('unfav') ) {
 			var type = target.hasClass('fav') ? 'fav' : 'unfav';
-			var parent = target.parent().parent().parent();
+			var parent = target.closest('.activity-item');
 			var parent_id = parent.attr('id').substr( 9, parent.attr('id').length );
 
 			target.addClass('loading');
@@ -190,28 +208,28 @@ jq(document).ready( function() {
 				});
 
 				if ( 'fav' == type ) {
-					if ( !jq('div.item-list-tabs li#activity-favorites').length )
-						jq('div.item-list-tabs ul li#activity-mentions').before( '<li id="activity-favorites"><a href="#">' + BP_DTheme.my_favs + ' <span>0</span></a></li>');
+					if ( !jq('.item-list-tabs li#activity-favorites').length )
+						jq('.item-list-tabs ul li#activity-mentions').before( '<li id="activity-favorites"><a href="#">' + BP_DTheme.my_favs + ' <span>0</span></a></li>');
 
 					target.removeClass('fav');
 					target.addClass('unfav');
 
-					jq('div.item-list-tabs ul li#activity-favorites span').html( Number( jq('div.item-list-tabs ul li#activity-favorites span').html() ) + 1 );
+					jq('.item-list-tabs ul li#activity-favorites span').html( Number( jq('.item-list-tabs ul li#activity-favorites span').html() ) + 1 );
 				} else {
 					target.removeClass('unfav');
 					target.addClass('fav');
 
-					jq('div.item-list-tabs ul li#activity-favorites span').html( Number( jq('div.item-list-tabs ul li#activity-favorites span').html() ) - 1 );
+					jq('.item-list-tabs ul li#activity-favorites span').html( Number( jq('.item-list-tabs ul li#activity-favorites span').html() ) - 1 );
 
-					if ( !Number( jq('div.item-list-tabs ul li#activity-favorites span').html() ) ) {
-						if ( jq('div.item-list-tabs ul li#activity-favorites').hasClass('selected') )
+					if ( !Number( jq('.item-list-tabs ul li#activity-favorites span').html() ) ) {
+						if ( jq('.item-list-tabs ul li#activity-favorites').hasClass('selected') )
 							bp_activity_request( null, null );
 
-						jq('div.item-list-tabs ul li#activity-favorites').remove();
+						jq('.item-list-tabs ul li#activity-favorites').remove();
 					}
 				}
 
-				if ( 'activity-favorites' == jq( 'div.item-list-tabs li.selected').attr('id') )
+				if ( 'activity-favorites' == jq( '.item-list-tabs li.selected').attr('id') )
 					target.parent().parent().parent().slideUp(100);
 			});
 
@@ -248,12 +266,38 @@ jq(document).ready( function() {
 			return false;
 		}
 
+		// Spam activity stream items
+		if ( target.hasClass( 'spam-activity' ) ) {
+			var li = target.parents( 'div.activity ul li' );
+			target.addClass( 'loading' );
+
+			jq.post( ajaxurl, {
+				action: 'bp_spam_activity',
+				'cookie': encodeURIComponent( document.cookie ),
+				'id': li.attr( 'id' ).substr( 9, li.attr( 'id' ).length ),
+				'_wpnonce': target.attr( 'href' ).split( '_wpnonce=' )[1]
+			},
+
+			function(response) {
+				if ( response[0] + response[1] === '-1' ) {
+					li.prepend( response.substr( 2, response.length ) );
+					li.children( 'div#message' ).hide().fadeIn(300);
+				} else {
+					li.slideUp( 300 );
+				}
+			});
+
+			return false;
+		}
+
 		/* Load more updates at the end of the page */
 		if ( target.parent().hasClass('load-more') ) {
 			jq("#content li.load-more").addClass('loading');
 
 			if ( null == jq.cookie('bp-activity-oldestpage') )
-				jq.cookie('bp-activity-oldestpage', 1, {path: '/'} );
+				jq.cookie('bp-activity-oldestpage', 1, {
+					path: '/'
+				} );
 
 			var oldest_page = ( jq.cookie('bp-activity-oldestpage') * 1 ) + 1;
 
@@ -265,7 +309,9 @@ jq(document).ready( function() {
 			function(response)
 			{
 				jq("#content li.load-more").removeClass('loading');
-				jq.cookie( 'bp-activity-oldestpage', oldest_page, {path: '/'} );
+				jq.cookie( 'bp-activity-oldestpage', oldest_page, {
+					path: '/'
+				} );
 				jq("#content ul.activity-list").append(response.contents);
 
 				target.parent().hide();
@@ -303,7 +349,7 @@ jq(document).ready( function() {
 	jq('form.ac-form').hide();
 
 	/* Hide excess comments */
-	if ( jq('div.activity-comments').length )
+	if ( jq('.activity-comments').length )
 		bp_dtheme_hide_comments();
 
 	/* Activity list event delegation */
@@ -333,16 +379,19 @@ jq(document).ready( function() {
 			});
 
 			if ( ids[1] != 'comment' ) {
-				jq('div.activity-comments li#acomment-' + c_id).append( form );
+				jq('.activity-comments li#acomment-' + c_id).append( form );
 			} else {
-				jq('li#activity-' + a_id + ' div.activity-comments').append( form );
+				jq('li#activity-' + a_id + ' .activity-comments').append( form );
 			}
 
-	 		if ( form.parent().hasClass( 'activity-comments' ) )
+			if ( form.parent().hasClass( 'activity-comments' ) )
 				form.addClass('root');
 
 			form.slideDown( 200 );
-			jq.scrollTo( form, 500, { offset:-100, easing:'easeOutQuad' } );
+			jq.scrollTo( form, 500, {
+				offset:-100, 
+				easing:'easeOutQuad'
+			} );
 			jq('#ac-form-' + ids[2] + ' textarea').focus();
 
 			return false;
@@ -365,44 +414,52 @@ jq(document).ready( function() {
 			jq( 'form#' + form + ' div.error').hide();
 			target.addClass('loading').prop('disabled', true);
 
-			jq.post( ajaxurl, {
+			var ajaxdata = {
 				action: 'new_activity_comment',
 				'cookie': encodeURIComponent(document.cookie),
 				'_wpnonce_new_activity_comment': jq("input#_wpnonce_new_activity_comment").val(),
 				'comment_id': comment_id,
 				'form_id': form_id[2],
 				'content': jq('form#' + form.attr('id') + ' textarea').val()
-			},
-			function(response)
-			{
-				target.removeClass('loading');
+			};
 
-				/* Check for errors and append if found. */
-				if ( response[0] + response[1] == '-1' ) {
-					form.append( response.substr( 2, response.length ) ).hide().fadeIn( 200 );
-				} else {
-					form.fadeOut( 200,
-						function() {
-							if ( 0 == form.parent().children('ul').length ) {
-								if ( form.parent().hasClass('activity-comments') )
-									form.parent().prepend('<ul></ul>');
-								else
-									form.parent().append('<ul></ul>');
-							}
+			// Akismet
+			var ak_nonce = jq('#_bp_as_nonce_' + comment_id).val();
+			if ( ak_nonce ) {
+				ajaxdata['_bp_as_nonce_' + comment_id] = ak_nonce;
+			}
 
-							form.parent().children('ul').append(response).hide().fadeIn( 200 );
-							form.children('textarea').val('');
-							form.parent().parent().addClass('has-comments');
-						}
-					);
-					jq( 'form#' + form + ' textarea').val('');
+			jq.post( ajaxurl, ajaxdata,
+				function(response)
+				{
+					target.removeClass('loading');
 
-					/* Increase the "Reply (X)" button count */
-					jq('li#activity-' + form_id[2] + ' a.acomment-reply span').html( Number( jq('li#activity-' + form_id[2] + ' a.acomment-reply span').html() ) + 1 );
-				}
+					/* Check for errors and append if found. */
+					if ( response[0] + response[1] == '-1' ) {
+						form.append( response.substr( 2, response.length ) ).hide().fadeIn( 200 );
+					} else {
+						form.fadeOut( 200,
+							function() {
+								if ( 0 == form.parent().children('ul').length ) {
+									if ( form.parent().hasClass('activity-comments') )
+										form.parent().prepend('<ul></ul>');
+									else
+										form.parent().append('<ul></ul>');
+								}
+
+								form.parent().children('ul').append(response).hide().fadeIn( 200 );
+								form.children('textarea').val('');
+								form.parent().parent().addClass('has-comments');
+							}
+							);
+						jq( 'form#' + form + ' textarea').val('');
 
-				jq(target).prop("disabled", false);
-			});
+						/* Increase the "Reply (X)" button count */
+						jq('li#activity-' + form_id[2] + ' a.acomment-reply span').html( Number( jq('li#activity-' + form_id[2] + ' a.acomment-reply span').html() ) + 1 );
+					}
+
+					jq(target).prop("disabled", false);
+				});
 
 			return false;
 		}
@@ -414,19 +471,19 @@ jq(document).ready( function() {
 			var form = comment_li.parents('div.activity-comments').children('form');
 
 			var nonce = link_href.split('_wpnonce=');
-				nonce = nonce[1];
+			nonce = nonce[1];
 
 			var comment_id = link_href.split('cid=');
-				comment_id = comment_id[1].split('&');
-				comment_id = comment_id[0];
+			comment_id = comment_id[1].split('&');
+			comment_id = comment_id[0];
 
 			target.addClass('loading');
 
 			/* Remove any error messages */
-			jq('div.activity-comments ul div.error').remove();
+			jq('.activity-comments ul .error').remove();
 
 			/* Reset the form position */
-			comment_li.parents('div.activity-comments').append(form);
+			comment_li.parents('.activity-comments').append(form);
 
 			jq.post( ajaxurl, {
 				action: 'delete_activity_comment',
@@ -449,8 +506,58 @@ jq(document).ready( function() {
 					comment_li.fadeOut(200);
 
 					/* Decrease the "Reply (X)" button count */
-					var parent_li = comment_li.parents('ul#activity-stream > li');
-					jq('li#' + parent_li.attr('id') + ' a.acomment-reply span').html( jq('li#' + parent_li.attr('id') + ' a.acomment-reply span').html() - ( 1 + child_count ) );
+					var count_span = jq('li#' + comment_li.parents('ul#activity-stream > li').attr('id') + ' a.acomment-reply span');
+					var new_count = count_span.html() - ( 1 + child_count );
+					count_span.html(new_count);
+
+					/* If that was the last comment for the item, remove the has-comments class to clean up the styling */
+					if ( 0 == new_count ) {
+						jq(comment_li.parents('ul#activity-stream > li')).removeClass('has-comments');
+					}
+				}
+			});
+
+			return false;
+		}
+
+		// Spam an activity stream comment
+		if ( target.hasClass( 'spam-activity-comment' ) ) {
+			var link_href  = target.attr( 'href' );
+			var comment_li = target.parent().parent();
+
+			target.addClass('loading');
+
+			// Remove any error messages
+			jq( '.activity-comments ul div.error' ).remove();
+
+			// Reset the form position
+			comment_li.parents( '.activity-comments' ).append( comment_li.parents( '.activity-comments' ).children( 'form' ) );
+
+			jq.post( ajaxurl, {
+				action: 'bp_spam_activity_comment',
+				'cookie': encodeURIComponent( document.cookie ),
+				'_wpnonce': link_href.split( '_wpnonce=' )[1],
+				'id': link_href.split( 'cid=' )[1].split( '&' )[0]
+			},
+
+			function ( response ) {
+				// Check for errors and append if found.
+				if ( response[0] + response[1] == '-1' ) {
+					comment_li.prepend( response.substr( 2, response.length ) ).hide().fadeIn( 200 );
+
+				} else {
+					var children = jq( 'li#' + comment_li.attr( 'id' ) + ' ul' ).children( 'li' );
+					var child_count = 0;
+					jq(children).each( function() {
+						if ( !jq( this ).is( ':hidden' ) ) {
+							child_count++;
+						}
+					});
+					comment_li.fadeOut( 200 );
+
+					// Decrease the "Reply (X)" button count
+					var parent_li = comment_li.parents( 'ul#activity-stream > li' );
+					jq( 'li#' + parent_li.attr( 'id' ) + ' a.acomment-reply span' ).html( jq( 'li#' + parent_li.attr( 'id' ) + ' a.acomment-reply span' ).html() - ( 1 + child_count ) );
 				}
 			});
 
@@ -498,14 +605,14 @@ jq(document).ready( function() {
 	/**** Directory Search ****************************************************/
 
 	/* The search form on all directory pages */
-	jq('div.dir-search').click( function(event) {
+	jq('.dir-search').click( function(event) {
 		if ( jq(this).hasClass('no-ajax') )
 			return;
 
 		var target = jq(event.target);
 
 		if ( target.attr('type') == 'submit' ) {
-			var css_id = jq('div.item-list-tabs li.selected').attr('id').split( '-' );
+			var css_id = jq('.item-list-tabs li.selected').attr('id').split( '-' );
 			var object = css_id[0];
 
 			bp_filter_request( object, jq.cookie('bp-' + object + '-filter'), jq.cookie('bp-' + object + '-scope') , 'div.' + object, target.parent().children('label').children('input').val(), 1, jq.cookie('bp-' + object + '-extras') );
@@ -542,8 +649,8 @@ jq(document).ready( function() {
 
 	/* When the filter select box is changed re-query */
 	jq('li.filter select').change( function() {
-		if ( jq('div.item-list-tabs li.selected').length )
-			var el = jq('div.item-list-tabs li.selected');
+		if ( jq('.item-list-tabs li.selected').length )
+			var el = jq('.item-list-tabs li.selected');
 		else
 			var el = jq(this);
 
@@ -553,8 +660,8 @@ jq(document).ready( function() {
 		var filter = jq(this).val();
 		var search_terms = false;
 
-		if ( jq('div.dir-search input').length )
-			search_terms = jq('div.dir-search input').val();
+		if ( jq('.dir-search input').length )
+			search_terms = jq('.dir-search input').val();
 
 		if ( 'friends' == object )
 			object = 'members';
@@ -575,8 +682,8 @@ jq(document).ready( function() {
 			if ( target.hasClass('dots') || target.hasClass('current') )
 				return false;
 
-			if ( jq('div.item-list-tabs li.selected').length )
-				var el = jq('div.item-list-tabs li.selected');
+			if ( jq('.item-list-tabs li.selected').length )
+				var el = jq('.item-list-tabs li.selected');
 			else
 				var el = jq('li.filter select');
 
@@ -586,12 +693,12 @@ jq(document).ready( function() {
 			var search_terms = false;
 
 			if ( jq('div.dir-search input').length )
-				search_terms = jq('div.dir-search input').val();
+				search_terms = jq('.dir-search input').val();
 
 			if ( jq(target).hasClass('next') )
-				var page_number = Number( jq('div.pagination span.current').html() ) + 1;
+				var page_number = Number( jq('.pagination span.current').html() ) + 1;
 			else if ( jq(target).hasClass('prev') )
-				var page_number = Number( jq('div.pagination span.current').html() ) - 1;
+				var page_number = Number( jq('.pagination span.current').html() ) - 1;
 			else
 				var page_number = Number( jq(target).html() );
 
@@ -606,28 +713,30 @@ jq(document).ready( function() {
 
 	/* Hit the "New Topic" button on the forums directory page */
 	jq('a.show-hide-new').click( function() {
-		if ( !jq('div#new-topic-post').length )
+		if ( !jq('#new-topic-post').length )
 			return false;
 
-		if ( jq('div#new-topic-post').is(":visible") )
-			jq('div#new-topic-post').slideUp(200);
+		if ( jq('#new-topic-post').is(":visible") )
+			jq('#new-topic-post').slideUp(200);
 		else
-			jq('div#new-topic-post').slideDown(200, function() { jq('#topic_title').focus(); } );
+			jq('#new-topic-post').slideDown(200, function() {
+				jq('#topic_title').focus();
+			} );
 
 		return false;
 	});
 
 	/* Cancel the posting of a new forum topic */
 	jq('input#submit_topic_cancel').click( function() {
-		if ( !jq('div#new-topic-post').length )
+		if ( !jq('#new-topic-post').length )
 			return false;
 
-		jq('div#new-topic-post').slideUp(200);
+		jq('#new-topic-post').slideUp(200);
 		return false;
 	});
 
 	/* Clicking a forum tag */
-	jq('div#forum-directory-tags a').click( function() {
+	jq('#forum-directory-tags a').click( function() {
 		bp_filter_request( 'forums', 'tags', jq.cookie('bp-forums-scope'), 'div.forums', jq(this).html().replace( /&nbsp;/g, '-' ), 1, jq.cookie('bp-forums-extras') );
 		return false;
 	});
@@ -645,7 +754,7 @@ jq(document).ready( function() {
 		else
 			var friend_action = 'uninvite';
 
-		jq('div.item-list-tabs li.selected').addClass('loading');
+		jq('.item-list-tabs li.selected').addClass('loading');
 
 		jq.post( ajaxurl, {
 			action: 'groups_invite_user',
@@ -668,7 +777,7 @@ jq(document).ready( function() {
 				jq('#friend-list li#uid-' + friend_id).remove();
 			}
 
-			jq('div.item-list-tabs li.selected').removeClass('loading');
+			jq('.item-list-tabs li.selected').removeClass('loading');
 		});
 	});
 
@@ -698,6 +807,29 @@ jq(document).ready( function() {
 		return false;
 	});
 
+	/** Profile Visibility Settings *********************************/
+	jq('.field-visibility-settings').hide();
+	jq('.visibility-toggle-link').on( 'click', function() {
+		var toggle_div = jq(this).parent();
+		
+		jq(toggle_div).fadeOut( 600, function(){
+			jq(toggle_div).siblings('.field-visibility-settings').slideDown(400);
+		});
+		
+		return false;
+	} );
+
+	jq('.field-visibility-settings-close').on( 'click', function() {
+		var settings_div = jq(this).parent();
+		
+		jq(settings_div).slideUp( 400, function(){
+			jq(settings_div).siblings('.field-visibility-settings-toggle').fadeIn(800);
+		});
+		
+		return false;
+	} );
+
+
 	/** Friendship Requests **************************************/
 
 	/* Accept and Reject friendship request buttons */
@@ -710,7 +842,7 @@ jq(document).ready( function() {
 		var link_href = button.attr('href');
 
 		var nonce = link_href.split('_wpnonce=');
-			nonce = nonce[1];
+		nonce = nonce[1];
 
 		if ( jq(this).hasClass('accepted') || jq(this).hasClass('rejected') )
 			return false;
@@ -756,7 +888,7 @@ jq(document).ready( function() {
 	});
 
 	/* Add / Remove friendship buttons */
-	jq("div.friendship-button a").live('click', function() {
+	jq(".friendship-button a").live('click', function() {
 		jq(this).parent().addClass('loading');
 		var fid = jq(this).attr('id');
 		fid = fid.split('-');
@@ -785,10 +917,10 @@ jq(document).ready( function() {
 					function() {
 						parentdiv.removeClass('add_friend');
 						parentdiv.removeClass('loading');
-						parentdiv.addClass('pending');
+						parentdiv.addClass('pending_friend');
 						parentdiv.fadeIn(200).html(response);
 					}
-				);
+					);
 
 			} else if ( action == 'remove' ) {
 				jq(parentdiv).fadeOut(200,
@@ -798,7 +930,7 @@ jq(document).ready( function() {
 						parentdiv.addClass('add');
 						parentdiv.fadeIn(200).html(response);
 					}
-				);
+					);
 			}
 		});
 		return false;
@@ -806,7 +938,7 @@ jq(document).ready( function() {
 
 	/** Group Join / Leave Buttons **************************************/
 
-	jq("div.group-button a").live('click', function() {
+	jq(".group-button a").live('click', function() {
 		var gid = jq(this).parent().attr('id');
 		gid = gid.split('-');
 		gid = gid[1];
@@ -835,7 +967,7 @@ jq(document).ready( function() {
 					function() {
 						parentdiv.fadeIn(200).html(response);
 					}
-				);
+					);
 			}
 		});
 		return false;
@@ -843,17 +975,34 @@ jq(document).ready( function() {
 
 	/** Button disabling ************************************************/
 
-	jq('div.pending').click(function() {
+	jq('.pending').click(function() {
 		return false;
 	});
 
 	/** Private Messaging ******************************************/
 
+	/** Message search*/
+	jq('.message-search').click( function(event) {
+		if ( jq(this).hasClass('no-ajax') )
+			return;
+
+		var target = jq(event.target);
+
+		if ( target.attr('type') == 'submit' ) {
+			//var css_id = jq('.item-list-tabs li.selected').attr('id').split( '-' );
+			var object = 'messages';
+
+			bp_filter_request( object, jq.cookie('bp-' + object + '-filter'), jq.cookie('bp-' + object + '-scope') , 'div.' + object, target.parent().children('label').children('input').val(), 1, jq.cookie('bp-' + object + '-extras') );
+
+			return false;
+		}
+	});
+
 	/* AJAX send reply functionality */
 	jq("input#send_reply_button").click(
 		function() {
 			var order = jq('#messages_order').val() || 'ASC',
-				offset = jq('#message-recipients').offset();
+			offset = jq('#message-recipients').offset();
 
 			var button = jq("input#send_reply_button");
 			jq(button).addClass('loading');
@@ -883,8 +1032,8 @@ jq(document).ready( function() {
 						jq(window).scrollTop(offset.top);
 					}
 
-					jq("div.new-message").hide().slideDown( 200, function() {
-						jq('div.new-message').removeClass('new-message');
+					jq(".new-message").hide().slideDown( 200, function() {
+						jq('.new-message').removeClass('new-message');
 					});
 				}
 				jq(button).removeClass('loading');
@@ -955,10 +1104,10 @@ jq(document).ready( function() {
 			switch(selection) {
 				case 'unread':
 					var checkboxes = jq("tr.unread td input[type='checkbox']");
-				break;
+					break;
 				case 'read':
 					var checkboxes = jq("tr.read td input[type='checkbox']");
-				break;
+					break;
 			}
 			if ( selection != '' ) {
 				checkboxes.each( function(i) {
@@ -1033,7 +1182,7 @@ jq(document).ready( function() {
 		return false;
 	});
 
-	/* Admin Bar & wp_list_pages Javascript IE6 hover class */
+	/* Toolbar & wp_list_pages Javascript IE6 hover class */
 	jq("#wp-admin-bar ul.main-nav li, #nav li").mouseover( function() {
 		jq(this).addClass('sfhover');
 	});
@@ -1044,15 +1193,27 @@ jq(document).ready( function() {
 
 	/* Clear BP cookies on logout */
 	jq('a.logout').click( function() {
-		jq.cookie('bp-activity-scope', null, {path: '/'});
-		jq.cookie('bp-activity-filter', null, {path: '/'});
-		jq.cookie('bp-activity-oldestpage', null, {path: '/'});
+		jq.cookie('bp-activity-scope', null, {
+			path: '/'
+		});
+		jq.cookie('bp-activity-filter', null, {
+			path: '/'
+		});
+		jq.cookie('bp-activity-oldestpage', null, {
+			path: '/'
+		});
 
 		var objects = [ 'members', 'groups', 'blogs', 'forums' ];
 		jq(objects).each( function(i) {
-			jq.cookie('bp-' + objects[i] + '-scope', null, {path: '/'} );
-			jq.cookie('bp-' + objects[i] + '-filter', null, {path: '/'} );
-			jq.cookie('bp-' + objects[i] + '-extras', null, {path: '/'} );
+			jq.cookie('bp-' + objects[i] + '-scope', null, {
+				path: '/'
+			} );
+			jq.cookie('bp-' + objects[i] + '-filter', null, {
+				path: '/'
+			} );
+			jq.cookie('bp-' + objects[i] + '-extras', null, {
+				path: '/'
+			} );
 		});
 	});
 });
@@ -1060,17 +1221,19 @@ jq(document).ready( function() {
 /* Setup activity scope and filter based on the current cookie settings. */
 function bp_init_activity() {
 	/* Reset the page */
-	jq.cookie( 'bp-activity-oldestpage', 1, {path: '/'} );
+	jq.cookie( 'bp-activity-oldestpage', 1, {
+		path: '/'
+	} );
 
 	if ( null != jq.cookie('bp-activity-filter') && jq('#activity-filter-select').length )
 		jq('#activity-filter-select select option[value="' + jq.cookie('bp-activity-filter') + '"]').prop( 'selected', true );
 
 	/* Activity Tab Set */
-	if ( null != jq.cookie('bp-activity-scope') && jq('div.activity-type-tabs').length ) {
-		jq('div.activity-type-tabs li').each( function() {
+	if ( null != jq.cookie('bp-activity-scope') && jq('.activity-type-tabs').length ) {
+		jq('.activity-type-tabs li').each( function() {
 			jq(this).removeClass('selected');
 		});
-		jq('li#activity-' + jq.cookie('bp-activity-scope') + ', div.item-list-tabs li.current').addClass('selected');
+		jq('li#activity-' + jq.cookie('bp-activity-scope') + ', .item-list-tabs li.current').addClass('selected');
 	}
 }
 
@@ -1081,10 +1244,10 @@ function bp_init_objects(objects) {
 			jq('li#' + objects[i] + '-order-select select option[value="' + jq.cookie('bp-' + objects[i] + '-filter') + '"]').prop( 'selected', true );
 
 		if ( null != jq.cookie('bp-' + objects[i] + '-scope') && jq('div.' + objects[i]).length ) {
-			jq('div.item-list-tabs li').each( function() {
+			jq('.item-list-tabs li').each( function() {
 				jq(this).removeClass('selected');
 			});
-			jq('div.item-list-tabs li#' + objects[i] + '-' + jq.cookie('bp-' + objects[i] + '-scope') + ', div.item-list-tabs#object-nav li.current').addClass('selected');
+			jq('.item-list-tabs li#' + objects[i] + '-' + jq.cookie('bp-' + objects[i] + '-scope') + ', div.item-list-tabs#object-nav li.current').addClass('selected');
 		}
 	});
 }
@@ -1101,17 +1264,23 @@ function bp_filter_request( object, filter, scope, target, search_terms, page, e
 		scope = 'all';
 
 	/* Save the settings we want to remain persistent to a cookie */
-	jq.cookie( 'bp-' + object + '-scope', scope, {path: '/'} );
-	jq.cookie( 'bp-' + object + '-filter', filter, {path: '/'} );
-	jq.cookie( 'bp-' + object + '-extras', extras, {path: '/'} );
+	jq.cookie( 'bp-' + object + '-scope', scope, {
+		path: '/'
+	} );
+	jq.cookie( 'bp-' + object + '-filter', filter, {
+		path: '/'
+	} );
+	jq.cookie( 'bp-' + object + '-extras', extras, {
+		path: '/'
+	} );
 
 	/* Set the correct selected nav and filter */
-	jq('div.item-list-tabs li').each( function() {
+	jq('.item-list-tabs li').each( function() {
 		jq(this).removeClass('selected');
 	});
-	jq('div.item-list-tabs li#' + object + '-' + scope + ', div.item-list-tabs#object-nav li.current').addClass('selected');
-	jq('div.item-list-tabs li.selected').addClass('loading');
-	jq('div.item-list-tabs select option[value="' + filter + '"]').prop( 'selected', true );
+	jq('.item-list-tabs li#' + object + '-' + scope + ', .item-list-tabs#object-nav li.current').addClass('selected');
+	jq('.item-list-tabs li.selected').addClass('loading');
+	jq('.item-list-tabs select option[value="' + filter + '"]').prop( 'selected', true );
 
 	if ( 'friends' == object )
 		object = 'members';
@@ -1134,25 +1303,31 @@ function bp_filter_request( object, filter, scope, target, search_terms, page, e
 		jq(target).fadeOut( 100, function() {
 			jq(this).html(response);
 			jq(this).fadeIn(100);
-	 	});
-		jq('div.item-list-tabs li.selected').removeClass('loading');
+		});
+		jq('.item-list-tabs li.selected').removeClass('loading');
 	});
 }
 
 /* Activity Loop Requesting */
 function bp_activity_request(scope, filter) {
 	/* Save the type and filter to a session cookie */
-	jq.cookie( 'bp-activity-scope', scope, {path: '/'} );
-	jq.cookie( 'bp-activity-filter', filter, {path: '/'} );
-	jq.cookie( 'bp-activity-oldestpage', 1, {path: '/'} );
+	jq.cookie( 'bp-activity-scope', scope, {
+		path: '/'
+	} );
+	jq.cookie( 'bp-activity-filter', filter, {
+		path: '/'
+	} );
+	jq.cookie( 'bp-activity-oldestpage', 1, {
+		path: '/'
+	} );
 
 	/* Remove selected and loading classes from tabs */
-	jq('div.item-list-tabs li').each( function() {
+	jq('.item-list-tabs li').each( function() {
 		jq(this).removeClass('selected loading');
 	});
 	/* Set the correct selected nav and filter */
-	jq('li#activity-' + scope + ', div.item-list-tabs li.current').addClass('selected');
-	jq('div#object-nav.item-list-tabs li.selected, div.activity-type-tabs li.selected').addClass('loading');
+	jq('li#activity-' + scope + ', .item-list-tabs li.current').addClass('selected');
+	jq('#object-nav.item-list-tabs li.selected, div.activity-type-tabs li.selected').addClass('loading');
 	jq('#activity-filter-select select option[value="' + filter + '"]').prop( 'selected', true );
 
 	/* Reload the activity stream based on the selection */
@@ -1182,9 +1357,9 @@ function bp_activity_request(scope, filter) {
 
 		/* Update the feed link */
 		if ( null != response.feed_url )
-			jq('.directory div#subnav li.feed a, .home-page div#subnav li.feed a').attr('href', response.feed_url);
+			jq('.directory #subnav li.feed a, .home-page #subnav li.feed a').attr('href', response.feed_url);
 
-		jq('div.item-list-tabs li.selected').removeClass('loading');
+		jq('.item-list-tabs li.selected').removeClass('loading');
 
 	}, 'json' );
 }
@@ -1267,4 +1442,4 @@ jQuery.easing.jswing=jQuery.easing.swing;jQuery.extend(jQuery.easing,{def:"easeO
 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,{}))
\ No newline at end of file
+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,{}))
diff --git a/wp-content/plugins/buddypress/bp-themes/bp-default/activity/comment.php b/wp-content/plugins/buddypress/bp-themes/bp-default/activity/comment.php
index d807ca193b678cb79a98bc384e35e0d131e4102e..2ff231f78ec356650db93b1ad5f61c15aff7316c 100644
--- a/wp-content/plugins/buddypress/bp-themes/bp-default/activity/comment.php
+++ b/wp-content/plugins/buddypress/bp-themes/bp-default/activity/comment.php
@@ -23,7 +23,7 @@
 
 	<div class="acomment-meta">
 		<?php
-		/* translators: 1: user profile link, 2: user name, 3: activity permalink, 3: activity timestamp */
+		/* translators: 1: user profile link, 2: user name, 3: activity permalink, 4: activity timestamp */
 		printf( __( '<a href="%1$s">%2$s</a> replied <a href="%3$s" class="activity-time-since"><span class="time-since">%4$s</span></a>', 'buddypress' ), bp_get_activity_comment_user_link(), bp_get_activity_comment_name(), bp_get_activity_thread_permalink(), bp_get_activity_comment_date_recorded() );
 		?>
 	</div>
@@ -34,7 +34,7 @@
 
 		<?php if ( is_user_logged_in() && bp_activity_can_comment_reply( bp_activity_current_comment() ) ) : ?>
 
-			<a href="#acomment-<?php bp_activity_comment_id(); ?>" class="acomment-reply bp-primary-action" id="acomment-reply-<?php bp_activity_id() ?>-from-<?php bp_activity_comment_id() ?>"><?php _e( 'Reply', 'buddypress' ); ?></a>
+			<a href="#acomment-<?php bp_activity_comment_id(); ?>" class="acomment-reply bp-primary-action" id="acomment-reply-<?php bp_activity_id(); ?>-from-<?php bp_activity_comment_id(); ?>"><?php _e( 'Reply', 'buddypress' ); ?></a>
 
 		<?php endif; ?>
 
@@ -44,6 +44,8 @@
 
 		<?php endif; ?>
 
+		<?php do_action( 'bp_activity_comment_options' ); ?>
+
 	</div>
 
 	<?php bp_activity_recurse_comments( bp_activity_current_comment() ); ?>
diff --git a/wp-content/plugins/buddypress/bp-themes/bp-default/activity/entry.php b/wp-content/plugins/buddypress/bp-themes/bp-default/activity/entry.php
index ed9527284d3c360764035ae2df92d1042400fc3c..c18d6e5774d72bedd5ebf590321fc06ea2f65924 100644
--- a/wp-content/plugins/buddypress/bp-themes/bp-default/activity/entry.php
+++ b/wp-content/plugins/buddypress/bp-themes/bp-default/activity/entry.php
@@ -65,11 +65,11 @@
 
 					<?php if ( !bp_get_activity_is_favorite() ) : ?>
 
-						<a href="<?php bp_activity_favorite_link(); ?>" class="button fav bp-secondary-action" title="<?php esc_attr_e( 'Mark as Favorite', 'buddypress' ); ?>"><?php _e( 'Favorite', 'buddypress' ) ?></a>
+						<a href="<?php bp_activity_favorite_link(); ?>" class="button fav bp-secondary-action" title="<?php esc_attr_e( 'Mark as Favorite', 'buddypress' ); ?>"><?php _e( 'Favorite', 'buddypress' ); ?></a>
 
 					<?php else : ?>
 
-						<a href="<?php bp_activity_unfavorite_link(); ?>" class="button unfav bp-secondary-action" title="<?php esc_attr_e( 'Remove Favorite', 'buddypress' ); ?>"><?php _e( 'Remove Favorite', 'buddypress' ) ?></a>
+						<a href="<?php bp_activity_unfavorite_link(); ?>" class="button unfav bp-secondary-action" title="<?php esc_attr_e( 'Remove Favorite', 'buddypress' ); ?>"><?php _e( 'Remove Favorite', 'buddypress' ); ?></a>
 
 					<?php endif; ?>
 
diff --git a/wp-content/plugins/buddypress/bp-themes/bp-default/activity/index.php b/wp-content/plugins/buddypress/bp-themes/bp-default/activity/index.php
index 9332f7abf9114f504f32177c38648b8240f0d344..bbcdbb24ac24a4e4196fcf39955061a635f95af3 100644
--- a/wp-content/plugins/buddypress/bp-themes/bp-default/activity/index.php
+++ b/wp-content/plugins/buddypress/bp-themes/bp-default/activity/index.php
@@ -7,9 +7,7 @@
  * @subpackage Theme
  */
 
-?>
-
-<?php get_header( 'buddypress' ); ?>
+get_header( 'buddypress' ); ?>
 
 	<?php do_action( 'bp_before_directory_activity_page' ); ?>
 
@@ -38,11 +36,11 @@
 				<ul>
 					<?php do_action( 'bp_before_activity_type_tab_all' ); ?>
 
-					<li class="selected" id="activity-all"><a href="<?php echo bp_loggedin_user_domain() . bp_get_activity_slug() . '/'; ?>" title="<?php _e( 'The public activity for everyone on this site.', 'buddypress' ); ?>"><?php printf( __( 'All Members <span>%s</span>', 'buddypress' ), bp_get_total_site_member_count() ); ?></a></li>
+					<li class="selected" id="activity-all"><a href="<?php bp_activity_directory_permalink(); ?>" title="<?php _e( 'The public activity for everyone on this site.', 'buddypress' ); ?>"><?php printf( __( 'All Members <span>%s</span>', 'buddypress' ), bp_get_total_member_count() ); ?></a></li>
 
 					<?php if ( is_user_logged_in() ) : ?>
 
-						<?php do_action( 'bp_before_activity_type_tab_friends' ) ?>
+						<?php do_action( 'bp_before_activity_type_tab_friends' ); ?>
 
 						<?php if ( bp_is_active( 'friends' ) ) : ?>
 
@@ -54,7 +52,7 @@
 
 						<?php endif; ?>
 
-						<?php do_action( 'bp_before_activity_type_tab_groups' ) ?>
+						<?php do_action( 'bp_before_activity_type_tab_groups' ); ?>
 
 						<?php if ( bp_is_active( 'groups' ) ) : ?>
 
@@ -86,12 +84,12 @@
 
 			<div class="item-list-tabs no-ajax" id="subnav" role="navigation">
 				<ul>
-					<li class="feed"><a href="<?php bp_sitewide_activity_feed_link() ?>" title="<?php _e( 'RSS Feed', 'buddypress' ); ?>"><?php _e( 'RSS', 'buddypress' ); ?></a></li>
+					<li class="feed"><a href="<?php bp_sitewide_activity_feed_link(); ?>" title="<?php _e( 'RSS Feed', 'buddypress' ); ?>"><?php _e( 'RSS', 'buddypress' ); ?></a></li>
 
 					<?php do_action( 'bp_activity_syndication_options' ); ?>
 
 					<li id="activity-filter-select" class="last">
-						<label for="activity-filter-by"><?php _e( 'Show:', 'buddypress' ); ?></label> 
+						<label for="activity-filter-by"><?php _e( 'Show:', 'buddypress' ); ?></label>
 						<select id="activity-filter-by">
 							<option value="-1"><?php _e( 'Everything', 'buddypress' ); ?></option>
 							<option value="activity_update"><?php _e( 'Updates', 'buddypress' ); ?></option>
diff --git a/wp-content/plugins/buddypress/bp-themes/bp-default/activity/post-form.php b/wp-content/plugins/buddypress/bp-themes/bp-default/activity/post-form.php
index 7bf1880ba94112a4f023b4876f0a1bdb90a68a99..92d085ecead2479d94f5ac9cef350302d0a59bea 100644
--- a/wp-content/plugins/buddypress/bp-themes/bp-default/activity/post-form.php
+++ b/wp-content/plugins/buddypress/bp-themes/bp-default/activity/post-form.php
@@ -39,7 +39,7 @@
 
 				<div id="whats-new-post-in-box">
 
-					<?php _e( 'Post in', 'buddypress' ) ?>:
+					<?php _e( 'Post in', 'buddypress' ); ?>:
 
 					<select id="whats-new-post-in" name="whats-new-post-in">
 						<option selected="selected" value="0"><?php _e( 'My Profile', 'buddypress' ); ?></option>
diff --git a/wp-content/plugins/buddypress/bp-themes/bp-default/archive.php b/wp-content/plugins/buddypress/bp-themes/bp-default/archive.php
index 921eaea4b445c34d31741b3f7bfd31ad478262ca..1fdfe85d3df15c64616628145841c336dbb46fdc 100644
--- a/wp-content/plugins/buddypress/bp-themes/bp-default/archive.php
+++ b/wp-content/plugins/buddypress/bp-themes/bp-default/archive.php
@@ -3,7 +3,7 @@
 	<div id="content">
 		<div class="padder">
 
-		<?php do_action( 'bp_before_archive' ) ?>
+		<?php do_action( 'bp_before_archive' ); ?>
 
 		<div class="page" id="blog-archives" role="main">
 
@@ -15,17 +15,17 @@
 
 				<?php while (have_posts()) : the_post(); ?>
 
-					<?php do_action( 'bp_before_blog_post' ) ?>
+					<?php do_action( 'bp_before_blog_post' ); ?>
 
 					<div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
 
 						<div class="author-box">
 							<?php echo get_avatar( get_the_author_meta( 'user_email' ), '50' ); ?>
-							<p><?php printf( _x( 'by %s', 'Post written by...', 'buddypress' ), bp_core_get_userlink( $post->post_author ) ) ?></p>
+							<p><?php printf( _x( 'by %s', 'Post written by...', 'buddypress' ), bp_core_get_userlink( $post->post_author ) ); ?></p>
 						</div>
 
 						<div class="post-content">
-							<h2 class="posttitle"><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php _e( 'Permanent Link to', 'buddypress' ) ?> <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>
+							<h2 class="posttitle"><a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php _e( 'Permanent Link to', 'buddypress' ); ?> <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>
 
 							<p class="date"><?php printf( __( '%1$s <span>in %2$s</span>', 'buddypress' ), get_the_date(), get_the_category_list( ', ' ) ); ?></p>
 
@@ -39,7 +39,7 @@
 
 					</div>
 
-					<?php do_action( 'bp_after_blog_post' ) ?>
+					<?php do_action( 'bp_after_blog_post' ); ?>
 
 				<?php endwhile; ?>
 
@@ -47,18 +47,18 @@
 
 			<?php else : ?>
 
-				<h2 class="center"><?php _e( 'Not Found', 'buddypress' ) ?></h2>
-				<?php get_search_form() ?>
+				<h2 class="center"><?php _e( 'Not Found', 'buddypress' ); ?></h2>
+				<?php get_search_form(); ?>
 
 			<?php endif; ?>
 
 		</div>
 
-		<?php do_action( 'bp_after_archive' ) ?>
+		<?php do_action( 'bp_after_archive' ); ?>
 
 		</div><!-- .padder -->
 	</div><!-- #content -->
 
-	<?php get_sidebar() ?>
+	<?php get_sidebar(); ?>
 
 <?php get_footer(); ?>
diff --git a/wp-content/plugins/buddypress/bp-themes/bp-default/attachment.php b/wp-content/plugins/buddypress/bp-themes/bp-default/attachment.php
index f50841b5cb1383d3b78ba696ef6d5bb4f894a4fd..8f6d501738d4a4ef41a5379031f51c312d49b851 100644
--- a/wp-content/plugins/buddypress/bp-themes/bp-default/attachment.php
+++ b/wp-content/plugins/buddypress/bp-themes/bp-default/attachment.php
@@ -9,7 +9,7 @@
 
 				<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
 
-					<?php do_action( 'bp_before_blog_post' ) ?>
+					<?php do_action( 'bp_before_blog_post' ); ?>
 
 					<div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
 
@@ -19,7 +19,7 @@
 						</div>
 
 						<div class="post-content">
-							<h2 class="posttitle"><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php _e( 'Permanent Link to', 'buddypress' ) ?> <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>
+							<h2 class="posttitle"><a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php _e( 'Permanent Link to', 'buddypress' ); ?> <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>
 
 							<p class="date">
 								<?php the_date(); ?>
@@ -53,19 +53,19 @@
 
 					</div>
 
-					<?php do_action( 'bp_after_blog_post' ) ?>
+					<?php do_action( 'bp_after_blog_post' ); ?>
 
 					<?php comments_template(); ?>
 
 				<?php endwhile; else: ?>
 
-					<p><?php _e( 'Sorry, no attachments matched your criteria.', 'buddypress' ) ?></p>
+					<p><?php _e( 'Sorry, no attachments matched your criteria.', 'buddypress' ); ?></p>
 
 				<?php endif; ?>
 
 			</div>
 
-		<?php do_action( 'bp_after_attachment' ) ?>
+		<?php do_action( 'bp_after_attachment' ); ?>
 
 		</div><!-- .padder -->
 	</div><!-- #content -->
diff --git a/wp-content/plugins/buddypress/bp-themes/bp-default/blogs/create.php b/wp-content/plugins/buddypress/bp-themes/bp-default/blogs/create.php
index 0260fd9fa384312cb3327d618c75f7a332efb8c9..7084a7900ad21fdc2a8b07e39776972e0d7e6b90 100644
--- a/wp-content/plugins/buddypress/bp-themes/bp-default/blogs/create.php
+++ b/wp-content/plugins/buddypress/bp-themes/bp-default/blogs/create.php
@@ -7,18 +7,18 @@
  * @subpackage bp-default
  */
 
-?>
-
-<?php get_header( 'buddypress' ); ?>
+get_header( 'buddypress' ); ?>
 
 	<?php do_action( 'bp_before_directory_blogs_content' ); ?>
 
 	<div id="content">
 		<div class="padder" role="main">
+		
+		<?php do_action( 'bp_before_create_blog_content_template' ); ?>
 
 		<?php do_action( 'template_notices' ); ?>
 
-			<h3><?php _e( 'Create a Site', 'buddypress' ); ?> &nbsp;<a class="button" href="<?php echo trailingslashit( bp_get_root_domain() . '/' . bp_get_blogs_root_slug() ) ?>"><?php _e( 'Site Directory', 'buddypress' ); ?></a></h3>
+			<h3><?php _e( 'Create a Site', 'buddypress' ); ?> &nbsp;<a class="button" href="<?php echo trailingslashit( bp_get_root_domain() . '/' . bp_get_blogs_root_slug() ); ?>"><?php _e( 'Site Directory', 'buddypress' ); ?></a></h3>
 
 		<?php do_action( 'bp_before_create_blog_content' ); ?>
 
@@ -35,6 +35,8 @@
 		<?php endif; ?>
 
 		<?php do_action( 'bp_after_create_blog_content' ); ?>
+		
+		<?php do_action( 'bp_after_create_blog_content_template' ); ?>
 
 		</div><!-- .padder -->
 	</div><!-- #content -->
@@ -42,5 +44,4 @@
 	<?php do_action( 'bp_after_directory_blogs_content' ); ?>
 
 <?php get_sidebar( 'buddypress' ); ?>
-<?php get_footer( 'buddypress' ); ?>
-
+<?php get_footer( 'buddypress' ); ?>
\ No newline at end of file
diff --git a/wp-content/plugins/buddypress/bp-themes/bp-default/blogs/index.php b/wp-content/plugins/buddypress/bp-themes/bp-default/blogs/index.php
index 186c5abd924ceea3faa451f3170caf311db52120..9748f6ed8715e25bfddce27c37a21b46939d53f5 100644
--- a/wp-content/plugins/buddypress/bp-themes/bp-default/blogs/index.php
+++ b/wp-content/plugins/buddypress/bp-themes/bp-default/blogs/index.php
@@ -7,9 +7,7 @@
  * @subpackage bp-default
  */
 
-?>
-
-<?php get_header( 'buddypress' ); ?>
+get_header( 'buddypress' ); ?>
 
 	<?php do_action( 'bp_before_directory_blogs_page' ); ?>
 
@@ -32,11 +30,11 @@
 
 			<div class="item-list-tabs" role="navigation">
 				<ul>
-					<li class="selected" id="blogs-all"><a href="<?php bp_root_domain(); ?>/<?php bp_blogs_root_slug() ?>"><?php printf( __( 'All Sites <span>%s</span>', 'buddypress' ), bp_get_total_blog_count() ); ?></a></li>
+					<li class="selected" id="blogs-all"><a href="<?php bp_root_domain(); ?>/<?php bp_blogs_root_slug(); ?>"><?php printf( __( 'All Sites <span>%s</span>', 'buddypress' ), bp_get_total_blog_count() ); ?></a></li>
 
 					<?php if ( is_user_logged_in() && bp_get_total_blog_count_for_user( bp_loggedin_user_id() ) ) : ?>
 
-						<li id="blogs-personal"><a href="<?php echo bp_loggedin_user_domain() . bp_get_blogs_slug() ?>"><?php printf( __( 'My Sites <span>%s</span>', 'buddypress' ), bp_get_total_blog_count_for_user( bp_loggedin_user_id() ) ); ?></a></li>
+						<li id="blogs-personal"><a href="<?php echo bp_loggedin_user_domain() . bp_get_blogs_slug(); ?>"><?php printf( __( 'My Sites <span>%s</span>', 'buddypress' ), bp_get_total_blog_count_for_user( bp_loggedin_user_id() ) ); ?></a></li>
 
 					<?php endif; ?>
 
diff --git a/wp-content/plugins/buddypress/bp-themes/bp-default/comments.php b/wp-content/plugins/buddypress/bp-themes/bp-default/comments.php
index e4f16626769e4e5a94241f569428355b542a7ad0..ba8fc2a9dd9f049264820d33f95cfe54516e420c 100644
--- a/wp-content/plugins/buddypress/bp-themes/bp-default/comments.php
+++ b/wp-content/plugins/buddypress/bp-themes/bp-default/comments.php
@@ -11,7 +11,7 @@
 	if ( have_comments() ) :
 		$num_comments = 0;
 		$num_trackbacks = 0;
-		foreach ( (array)$comments as $comment ) {
+		foreach ( (array) $comments as $comment ) {
 			if ( 'comment' != get_comment_type() )
 				$num_trackbacks++;
 			else
@@ -21,20 +21,20 @@
 	<div id="comments">
 
 		<h3>
-			<?php printf( _n( '1 response to %2$s', '%1$s responses to %2$s', $num_comments, 'buddypress' ), number_format_i18n( $num_comments ), '<em>' . get_the_title() . '</em>' ) ?>
+			<?php printf( _n( '1 response to %2$s', '%1$s responses to %2$s', $num_comments, 'buddypress' ), number_format_i18n( $num_comments ), '<em>' . get_the_title() . '</em>' ); ?>
 		</h3>
 
-		<?php do_action( 'bp_before_blog_comment_list' ) ?>
+		<?php do_action( 'bp_before_blog_comment_list' ); ?>
 
 		<ol class="commentlist">
-			<?php wp_list_comments( array( 'callback' => 'bp_dtheme_blog_comments', 'type' => 'comment' ) ) ?>
+			<?php wp_list_comments( array( 'callback' => 'bp_dtheme_blog_comments', 'type' => 'comment' ) ); ?>
 		</ol><!-- .comment-list -->
 
-		<?php do_action( 'bp_after_blog_comment_list' ) ?>
+		<?php do_action( 'bp_after_blog_comment_list' ); ?>
 
 		<?php if ( get_option( 'page_comments' ) ) : ?>
 			<div class="comment-navigation paged-navigation">
-				<?php paginate_comments_links() ?>
+				<?php paginate_comments_links(); ?>
 			</div>
 		<?php endif; ?>
 
@@ -43,31 +43,31 @@
 
 	<?php if ( pings_open() && !comments_open() && ( is_single() || is_page() ) ) : ?>
 		<p class="comments-closed pings-open">
-			<?php printf( __( 'Comments are closed, but <a href="%1$s" title="Trackback URL for this post">trackbacks</a> and pingbacks are open.', 'buddypress' ), trackback_url( '0' ) ) ?>
+			<?php printf( __( 'Comments are closed, but <a href="%1$s" title="Trackback URL for this post">trackbacks</a> and pingbacks are open.', 'buddypress' ), trackback_url( '0' ) ); ?>
 		</p>
 	<?php elseif ( !comments_open() && ( is_single() || is_page() ) ) : ?>
 		<p class="comments-closed">
-			<?php _e( 'Comments are closed.', 'buddypress' ) ?>
+			<?php _e( 'Comments are closed.', 'buddypress' ); ?>
 		</p>
 	<?php endif; ?>
 
 <?php endif; ?>
 
 <?php if ( comments_open() ) : ?>
-	<?php comment_form() ?>
+	<?php comment_form(); ?>
 <?php endif; ?>
 
 <?php if ( !empty( $num_trackbacks ) ) : ?>
 	<div id="trackbacks">
-		<h3><?php printf( _n( '1 trackback', '%d trackbacks', $num_trackbacks, 'buddypress' ), number_format_i18n( $num_trackbacks ) ) ?></h3>
+		<h3><?php printf( _n( '1 trackback', '%d trackbacks', $num_trackbacks, 'buddypress' ), number_format_i18n( $num_trackbacks ) ); ?></h3>
 
 		<ul id="trackbacklist">
-			<?php foreach ( (array)$comments as $comment ) : ?>
+			<?php foreach ( (array) $comments as $comment ) : ?>
 
 				<?php if ( 'comment' != get_comment_type() ) : ?>
 					<li>
-						<h5><?php comment_author_link() ?></h5>
-						<em>on <?php comment_date() ?></em>
+						<h5><?php comment_author_link(); ?></h5>
+						<em>on <?php comment_date(); ?></em>
 					</li>
  				<?php endif; ?>
 
diff --git a/wp-content/plugins/buddypress/bp-themes/bp-default/footer.php b/wp-content/plugins/buddypress/bp-themes/bp-default/footer.php
index b521d58838b7e733f20a7ffb8594400a63cf778b..6d300774f629d32252d6f163eed361e9d4cb6a44 100644
--- a/wp-content/plugins/buddypress/bp-themes/bp-default/footer.php
+++ b/wp-content/plugins/buddypress/bp-themes/bp-default/footer.php
@@ -1,24 +1,25 @@
 		</div> <!-- #container -->
 
-		<?php do_action( 'bp_after_container' ) ?>
-		<?php do_action( 'bp_before_footer' ) ?>
+		<?php do_action( 'bp_after_container' ); ?>
+		<?php do_action( 'bp_before_footer'   ); ?>
 
 		<div id="footer">
 			<?php if ( is_active_sidebar( 'first-footer-widget-area' ) || is_active_sidebar( 'second-footer-widget-area' ) || is_active_sidebar( 'third-footer-widget-area' ) || is_active_sidebar( 'fourth-footer-widget-area' ) ) : ?>
 				<div id="footer-widgets">
-					<?php get_sidebar( 'footer' ) ?>
+					<?php get_sidebar( 'footer' ); ?>
 				</div>
 			<?php endif; ?>
 
 			<div id="site-generator" role="contentinfo">
-				<?php do_action( 'bp_dtheme_credits' ) ?>
-				<p><?php printf( __( 'Proudly powered by <a href="%1$s">WordPress</a> and <a href="%2$s">BuddyPress</a>.', 'buddypress' ), 'http://wordpress.org', 'http://buddypress.org' ) ?></p>
+				<?php do_action( 'bp_dtheme_credits' ); ?>
+				<p><?php printf( __( 'Proudly powered by <a href="%1$s">WordPress</a> and <a href="%2$s">BuddyPress</a>.', 'buddypress' ), 'http://wordpress.org', 'http://buddypress.org' ); ?></p>
 			</div>
 
-			<?php do_action( 'bp_footer' ) ?>
+			<?php do_action( 'bp_footer' ); ?>
+
 		</div><!-- #footer -->
 
-		<?php do_action( 'bp_after_footer' ) ?>
+		<?php do_action( 'bp_after_footer' ); ?>
 
 		<?php wp_footer(); ?>
 
diff --git a/wp-content/plugins/buddypress/bp-themes/bp-default/forums/index.php b/wp-content/plugins/buddypress/bp-themes/bp-default/forums/index.php
index 19a1f5af6ee50b23ef91ac20e753a490b40fae89..cd8d3e01797f5835009a36dba09af3f97836c65d 100644
--- a/wp-content/plugins/buddypress/bp-themes/bp-default/forums/index.php
+++ b/wp-content/plugins/buddypress/bp-themes/bp-default/forums/index.php
@@ -94,7 +94,7 @@
 
 						<form action="" method="post" id="forum-topic-form" class="standard-form">
 
-							<?php do_action( 'groups_forum_new_topic_before' ) ?>
+							<?php do_action( 'groups_forum_new_topic_before' ); ?>
 
 							<a name="post-new"></a>
 							<h5><?php _e( 'Create New Topic:', 'buddypress' ); ?></h5>
@@ -102,7 +102,7 @@
 							<?php do_action( 'template_notices' ); ?>
 
 							<label><?php _e( 'Title:', 'buddypress' ); ?></label>
-							<input type="text" name="topic_title" id="topic_title" value="" />
+							<input type="text" name="topic_title" id="topic_title" value="" maxlength="100" />
 
 							<label><?php _e( 'Content:', 'buddypress' ); ?></label>
 							<textarea name="topic_text" id="topic_text"></textarea>
@@ -117,7 +117,7 @@
 
 								<?php while ( bp_groups() ) : bp_the_group(); ?>
 
-									<?php if ( bp_group_is_forum_enabled() && ( is_super_admin() || 'public' == bp_get_group_status() || bp_group_is_member() ) ) : ?>
+									<?php if ( bp_group_is_forum_enabled() && ( bp_current_user_can( 'bp_moderate' ) || 'public' == bp_get_group_status() || bp_group_is_member() ) ) : ?>
 
 										<option value="<?php bp_group_id(); ?>"><?php bp_group_name(); ?></option>
 
@@ -142,7 +142,7 @@
 
 						<div id="message" class="info">
 
-							<p><?php printf( __( "You are not a member of any groups so you don't have any group forums you can post in. To start posting, first find a group that matches the topic subject you'd like to start. If this group does not exist, why not <a href='%s'>create a new group</a>? Once you have joined or created the group you can post your topic in that group's forum.", 'buddypress' ), site_url( bp_get_groups_root_slug() . '/create/' ) ) ?></p>
+							<p><?php printf( __( "You are not a member of any groups so you don't have any group forums you can post in. To start posting, first find a group that matches the topic subject you'd like to start. If this group does not exist, why not <a href='%s'>create a new group</a>? Once you have joined or created the group you can post your topic in that group's forum.", 'buddypress' ), site_url( bp_get_groups_root_slug() . '/create/' ) ); ?></p>
 
 						</div>
 
diff --git a/wp-content/plugins/buddypress/bp-themes/bp-default/functions.php b/wp-content/plugins/buddypress/bp-themes/bp-default/functions.php
index c1042a26efb6abd9ba056764de319cd67c874fd0..fef15060a5a5ba3c7673f924ec657f24cb553f4b 100644
--- a/wp-content/plugins/buddypress/bp-themes/bp-default/functions.php
+++ b/wp-content/plugins/buddypress/bp-themes/bp-default/functions.php
@@ -27,12 +27,14 @@
  * @since 1.2
  */
 
-if ( !function_exists( 'bp_is_active' ) )
-	return;
+// Exit if accessed directly
+if ( ! defined( 'ABSPATH' ) ) exit;
 
-// If BuddyPress is not activated, switch back to the default WP theme
-if ( !defined( 'BP_VERSION' ) )
+// If BuddyPress is not activated, switch back to the default WP theme and bail out
+if ( ! function_exists( 'bp_is_active' ) ) {
 	switch_theme( WP_DEFAULT_THEME, WP_DEFAULT_THEME );
+	return;
+}
 
 /**
  * Set the content width based on the theme's design and stylesheet.
@@ -43,7 +45,7 @@ if ( !defined( 'BP_VERSION' ) )
 if ( ! isset( $content_width ) )
 	$content_width = 591;
 
-if ( !function_exists( 'bp_dtheme_setup' ) ) :
+if ( ! function_exists( 'bp_dtheme_setup' ) ) :
 /**
  * Sets up theme defaults and registers support for various WordPress and BuddyPress features.
  *
@@ -54,11 +56,10 @@ if ( !function_exists( 'bp_dtheme_setup' ) ) :
  * To override bp_dtheme_setup() in a child theme, add your own bp_dtheme_setup to your child theme's
  * functions.php file.
  *
- * @global object $bp Global BuddyPress settings object
- * @since 1.5
+ * @global BuddyPress $bp The one true BuddyPress instance
+ * @since BuddyPress (1.5)
  */
 function bp_dtheme_setup() {
-	global $bp;
 
 	// Load the AJAX functions for the theme
 	require( TEMPLATEPATH . '/_inc/ajax.php' );
@@ -66,6 +67,9 @@ function bp_dtheme_setup() {
 	// This theme styles the visual editor with editor-style.css to match the theme style.
 	add_editor_style();
 
+	// This theme comes with all the BuddyPress goodies
+	add_theme_support( 'buddypress' );
+
 	// This theme uses post thumbnails
 	add_theme_support( 'post-thumbnails' );
 
@@ -82,7 +86,10 @@ function bp_dtheme_setup() {
 	) );
 
 	// This theme allows users to set a custom background
-	add_custom_background( 'bp_dtheme_custom_background_style' );
+	$custom_background_args = array(
+		'wp-head-callback' => 'bp_dtheme_custom_background_style'
+	);
+	add_theme_support( 'custom-background', $custom_background_args );
 
 	// Add custom header support if allowed
 	if ( !defined( 'BP_DTHEME_DISABLE_CUSTOM_HEADER' ) ) {
@@ -98,27 +105,31 @@ function bp_dtheme_setup() {
 		set_post_thumbnail_size( HEADER_IMAGE_WIDTH, HEADER_IMAGE_HEIGHT, true );
 
 		// Add a way for the custom header to be styled in the admin panel that controls custom headers.
-		add_custom_image_header( 'bp_dtheme_header_style', 'bp_dtheme_admin_header_style' );
+		$custom_header_args = array(
+			'wp-head-callback' => 'bp_dtheme_header_style',
+			'admin-head-callback' => 'bp_dtheme_admin_header_style'
+		);
+		add_theme_support( 'custom-header', $custom_header_args );
 	}
 
 	if ( !is_admin() ) {
 		// Register buttons for the relevant component templates
 		// Friends button
 		if ( bp_is_active( 'friends' ) )
-			add_action( 'bp_member_header_actions',    'bp_add_friend_button' );
+			add_action( 'bp_member_header_actions',    'bp_add_friend_button',           5 );
 
 		// Activity button
 		if ( bp_is_active( 'activity' ) )
-			add_action( 'bp_member_header_actions',    'bp_send_public_message_button' );
+			add_action( 'bp_member_header_actions',    'bp_send_public_message_button',  20 );
 
 		// Messages button
 		if ( bp_is_active( 'messages' ) )
-			add_action( 'bp_member_header_actions',    'bp_send_private_message_button' );
+			add_action( 'bp_member_header_actions',    'bp_send_private_message_button', 20 );
 
 		// Group buttons
 		if ( bp_is_active( 'groups' ) ) {
-			add_action( 'bp_group_header_actions',     'bp_group_join_button' );
-			add_action( 'bp_group_header_actions',     'bp_group_new_topic_button' );
+			add_action( 'bp_group_header_actions',     'bp_group_join_button',           5 );
+			add_action( 'bp_group_header_actions',     'bp_group_new_topic_button',      20 );
 			add_action( 'bp_directory_groups_actions', 'bp_group_join_button' );
 		}
 
@@ -135,14 +146,12 @@ if ( !function_exists( 'bp_dtheme_enqueue_scripts' ) ) :
  * Enqueue theme javascript safely
  *
  * @see http://codex.wordpress.org/Function_Reference/wp_enqueue_script
- * @since 1.5
+ * @since BuddyPress (1.5)
  */
 function bp_dtheme_enqueue_scripts() {
-	// Bump this when changes are made to bust cache
-	$version = '20120110';
 
 	// Enqueue the global JS - Ajax will not work without it
-	wp_enqueue_script( 'dtheme-ajax-js', get_template_directory_uri() . '/_inc/global.js', array( 'jquery' ), $version );
+	wp_enqueue_script( 'dtheme-ajax-js', get_template_directory_uri() . '/_inc/global.js', array( 'jquery' ), bp_get_version() );
 
 	// Add words that we need to use in JS to the end of the page so they can be translated and still used.
 	$params = array(
@@ -157,8 +166,11 @@ function bp_dtheme_enqueue_scripts() {
 		'mark_as_fav'	    => __( 'Favorite', 'buddypress' ),
 		'remove_fav'	    => __( 'Remove Favorite', 'buddypress' )
 	);
-
 	wp_localize_script( 'dtheme-ajax-js', 'BP_DTheme', $params );
+
+	// Maybe enqueue comment reply JS
+	if ( is_singular() && bp_is_blog_page() && get_option( 'thread_comments' ) )
+		wp_enqueue_script( 'comment-reply' );
 }
 add_action( 'wp_enqueue_scripts', 'bp_dtheme_enqueue_scripts' );
 endif;
@@ -177,19 +189,16 @@ if ( !function_exists( 'bp_dtheme_enqueue_styles' ) ) :
  *
  * @see http://codex.wordpress.org/Function_Reference/wp_enqueue_style
  * @see http://codex.buddypress.org/releases/1-5-developer-and-designer-information/
- * @since 1.5
+ * @since BuddyPress (1.5)
  */
 function bp_dtheme_enqueue_styles() {
-	
-	// Bump this when changes are made to bust cache
-	$version = '20120110';
 
 	// Register our main stylesheet
-	wp_register_style( 'bp-default-main', get_template_directory_uri() . '/_inc/css/default.css', array(), $version );
+	wp_register_style( 'bp-default-main', get_template_directory_uri() . '/_inc/css/default.css', array(), bp_get_version() );
 
 	// If the current theme is a child of bp-default, enqueue its stylesheet
 	if ( is_child_theme() && 'bp-default' == get_template() ) {
-		wp_enqueue_style( get_stylesheet(), get_stylesheet_uri(), array( 'bp-default-main' ), $version );
+		wp_enqueue_style( get_stylesheet(), get_stylesheet_uri(), array( 'bp-default-main' ), bp_get_version() );
 	}
 
 	// Enqueue the main stylesheet
@@ -197,14 +206,15 @@ function bp_dtheme_enqueue_styles() {
 
 	// Default CSS RTL
 	if ( is_rtl() )
-		wp_enqueue_style( 'bp-default-main-rtl',  get_template_directory_uri() . '/_inc/css/default-rtl.css', array( 'bp-default-main' ), $version );
+		wp_enqueue_style( 'bp-default-main-rtl',  get_template_directory_uri() . '/_inc/css/default-rtl.css', array( 'bp-default-main' ), bp_get_version() );
 
 	// Responsive layout
 	if ( current_theme_supports( 'bp-default-responsive' ) ) {
-		wp_enqueue_style( 'bp-default-responsive', get_template_directory_uri() . '/_inc/css/responsive.css', array( 'bp-default-main' ), $version );
+		wp_enqueue_style( 'bp-default-responsive', get_template_directory_uri() . '/_inc/css/responsive.css', array( 'bp-default-main' ), bp_get_version() );
 
-		if ( is_rtl() )
-			wp_enqueue_style( 'bp-default-responsive-rtl', get_template_directory_uri() . '/_inc/css/responsive-rtl.css', array( 'bp-default-responsive' ), $version );
+		if ( is_rtl() ) {
+			wp_enqueue_style( 'bp-default-responsive-rtl', get_template_directory_uri() . '/_inc/css/responsive-rtl.css', array( 'bp-default-responsive' ), bp_get_version() );
+		}
 	}
 }
 add_action( 'wp_enqueue_scripts', 'bp_dtheme_enqueue_styles' );
@@ -224,7 +234,7 @@ function bp_dtheme_admin_header_style() {
 		#headimg {
 			position: relative;
 			color: #fff;
-			background: url(<?php header_image() ?>);
+			background: url(<?php header_image(); ?>);
 			-moz-border-radius-bottomleft: 6px;
 			-webkit-border-bottom-left-radius: 6px;
 			-moz-border-radius-bottomright: 6px;
@@ -242,12 +252,12 @@ function bp_dtheme_admin_header_style() {
 			font-family: Arial, Tahoma, sans-serif;
 		}
 		#headimg h1 a{
-			color:#<?php header_textcolor() ?>;
+			color:#<?php header_textcolor(); ?>;
 			text-decoration: none;
 			border-bottom: none;
 		}
 		#headimg #desc{
-			color:#<?php header_textcolor() ?>;
+			color:#<?php header_textcolor(); ?>;
 			font-size:1em;
 			margin-top:-0.5em;
 		}
@@ -261,7 +271,7 @@ function bp_dtheme_admin_header_style() {
 			display: none;
 		}
 		#headimg h1 a, #headimg #desc {
-			color:#<?php echo HEADER_TEXTCOLOR ?>;
+			color:#<?php echo HEADER_TEXTCOLOR; ?>;
 		}
 		<?php } ?>
 	</style>
@@ -276,7 +286,7 @@ if ( !function_exists( 'bp_dtheme_custom_background_style' ) ) :
  * Referenced via add_custom_background() in bp_dtheme_setup().
  *
  * @see _custom_background_cb()
- * @since 1.5
+ * @since BuddyPress (1.5)
  */
 function bp_dtheme_custom_background_style() {
 	$background = get_background_image();
@@ -337,6 +347,8 @@ function bp_dtheme_header_style() {
 		// $src, $width, $height
 		if ( !empty( $image ) && $image[1] >= HEADER_IMAGE_WIDTH )
 			$header_image = $image[0];
+		else
+			$header_image = get_header_image();
 
 	} else {
 		$header_image = get_header_image();
@@ -351,7 +363,7 @@ function bp_dtheme_header_style() {
 		<?php if ( 'blank' == get_header_textcolor() ) { ?>
 		#header h1, #header #desc { display: none; }
 		<?php } else { ?>
-		#header h1 a, #desc { color:#<?php header_textcolor() ?>; }
+		#header h1 a, #desc { color:#<?php header_textcolor(); ?>; }
 		<?php } ?>
 	</style>
 
@@ -366,10 +378,10 @@ if ( !function_exists( 'bp_dtheme_widgets_init' ) ) :
  * To override bp_dtheme_widgets_init() in a child theme, remove the action hook and add your own
  * function tied to the init hook.
  *
- * @since 1.5
+ * @since BuddyPress (1.5)
  */
 function bp_dtheme_widgets_init() {
-	// Register the widget columns
+
 	// Area 1, located in the sidebar. Empty by default.
 	register_sidebar( array(
 		'name'          => 'Sidebar',
@@ -455,14 +467,14 @@ function bp_dtheme_blog_comments( $comment, $args, $depth ) {
 		$avatar_size = 25;
 	?>
 
-	<li <?php comment_class() ?> id="comment-<?php comment_ID() ?>">
+	<li <?php comment_class(); ?> id="comment-<?php comment_ID(); ?>">
 		<div class="comment-avatar-box">
 			<div class="avb">
-				<a href="<?php echo get_comment_author_url() ?>" rel="nofollow">
+				<a href="<?php echo get_comment_author_url(); ?>" rel="nofollow">
 					<?php if ( $comment->user_id ) : ?>
-						<?php echo bp_core_fetch_avatar( array( 'item_id' => $comment->user_id, 'width' => $avatar_size, 'height' => $avatar_size, 'email' => $comment->comment_author_email ) ) ?>
+						<?php echo bp_core_fetch_avatar( array( 'item_id' => $comment->user_id, 'width' => $avatar_size, 'height' => $avatar_size, 'email' => $comment->comment_author_email ) ); ?>
 					<?php else : ?>
-						<?php echo get_avatar( $comment, $avatar_size ) ?>
+						<?php echo get_avatar( $comment, $avatar_size ); ?>
 					<?php endif; ?>
 				</a>
 			</div>
@@ -483,7 +495,7 @@ function bp_dtheme_blog_comments( $comment, $args, $depth ) {
 				 	<em class="moderate"><?php _e( 'Your comment is awaiting moderation.', 'buddypress' ); ?></em>
 				<?php endif; ?>
 
-				<?php comment_text() ?>
+				<?php comment_text(); ?>
 			</div>
 
 			<div class="comment-options">
@@ -492,7 +504,7 @@ function bp_dtheme_blog_comments( $comment, $args, $depth ) {
 					<?php endif; ?>
 
 					<?php if ( current_user_can( 'edit_comment', $comment->comment_ID ) ) : ?>
-						<?php printf( '<a class="button comment-edit-link bp-secondary-action" href="%1$s" title="%2$s">%3$s</a> ', get_edit_comment_link( $comment->comment_ID ), esc_attr__( 'Edit comment', 'buddypress' ), __( 'Edit', 'buddypress' ) ) ?>
+						<?php printf( '<a class="button comment-edit-link bp-secondary-action" href="%1$s" title="%2$s">%3$s</a> ', get_edit_comment_link( $comment->comment_ID ), esc_attr__( 'Edit comment', 'buddypress' ), __( 'Edit', 'buddypress' ) ); ?>
 					<?php endif; ?>
 
 			</div>
@@ -562,7 +574,7 @@ function bp_dtheme_show_notice() {
 	?>
 
 	<div id="message" class="updated fade">
-		<p><?php printf( __( 'Theme activated! This theme contains <a href="%s">custom header image</a> support and <a href="%s">sidebar widgets</a>.', 'buddypress' ), admin_url( 'themes.php?page=custom-header' ), admin_url( 'widgets.php' ) ) ?></p>
+		<p><?php printf( __( 'Theme activated! This theme contains <a href="%s">custom header image</a> support and <a href="%s">sidebar widgets</a>.', 'buddypress' ), admin_url( 'themes.php?page=custom-header' ), admin_url( 'widgets.php' ) ); ?></p>
 	</div>
 
 	<style type="text/css">#message2, #message0 { display: none; }</style>
@@ -578,14 +590,11 @@ if ( !function_exists( 'bp_dtheme_main_nav' ) ) :
  *
  * Used when the custom menus haven't been configured.
  *
- * @global object $bp Global BuddyPress settings object
  * @param array Menu arguments from wp_nav_menu()
  * @see wp_nav_menu()
- * @since 1.5
+ * @since BuddyPress (1.5)
  */
 function bp_dtheme_main_nav( $args ) {
-	global $bp;
-
 	$pages_args = array(
 		'depth'      => 0,
 		'echo'       => false,
@@ -606,7 +615,7 @@ if ( !function_exists( 'bp_dtheme_page_menu_args' ) ) :
  *
  * @param array $args Default values for wp_page_menu()
  * @see wp_page_menu()
- * @since 1.5
+ * @since BuddyPress (1.5)
  */
 function bp_dtheme_page_menu_args( $args ) {
 	$args['show_home'] = true;
@@ -619,18 +628,16 @@ if ( !function_exists( 'bp_dtheme_comment_form' ) ) :
 /**
  * Applies BuddyPress customisations to the post comment form.
  *
- * @global string $user_identity The display name of the user
  * @param array $default_labels The default options for strings, fields etc in the form
  * @see comment_form()
- * @since 1.5
+ * @since BuddyPress (1.5)
  */
 function bp_dtheme_comment_form( $default_labels ) {
-	global $user_identity;
 
 	$commenter = wp_get_current_commenter();
-	$req = get_option( 'require_name_email' );
-	$aria_req = ( $req ? " aria-required='true'" : '' );
-	$fields =  array(
+	$req       = get_option( 'require_name_email' );
+	$aria_req  = ( $req ? " aria-required='true'" : '' );
+	$fields    =  array(
 		'author' => '<p class="comment-form-author">' . '<label for="author">' . __( 'Name', 'buddypress' ) . ( $req ? '<span class="required"> *</span>' : '' ) . '</label> ' .
 		            '<input id="author" name="author" type="text" value="' . esc_attr( $commenter['comment_author'] ) . '" size="30"' . $aria_req . ' /></p>',
 		'email'  => '<p class="comment-form-email"><label for="email">' . __( 'Email', 'buddypress' ) . ( $req ? '<span class="required"> *</span>' : '' ) . '</label> ' .
@@ -660,18 +667,18 @@ if ( !function_exists( 'bp_dtheme_before_comment_form' ) ) :
  * so that the nested comments comment-reply javascript moves the entirety of the comment reply area.
  *
  * @see comment_form()
- * @since 1.5
+ * @since BuddyPress (1.5)
  */
 function bp_dtheme_before_comment_form() {
 ?>
 	<div class="comment-avatar-box">
 		<div class="avb">
 			<?php if ( bp_loggedin_user_id() ) : ?>
-				<a href="<?php echo bp_loggedin_user_domain() ?>">
-					<?php echo get_avatar( bp_loggedin_user_id(), 50 ) ?>
+				<a href="<?php echo bp_loggedin_user_domain(); ?>">
+					<?php echo get_avatar( bp_loggedin_user_id(), 50 ); ?>
 				</a>
 			<?php else : ?>
-				<?php echo get_avatar( 0, 50 ) ?>
+				<?php echo get_avatar( 0, 50 ); ?>
 			<?php endif; ?>
 		</div>
 	</div>
@@ -688,7 +695,7 @@ if ( !function_exists( 'bp_dtheme_after_comment_form' ) ) :
  *
  * @see bp_dtheme_before_comment_form()
  * @see comment_form()
- * @since 1.5
+ * @since BuddyPress (1.5)
  */
 function bp_dtheme_after_comment_form() {
 ?>
@@ -704,12 +711,14 @@ if ( !function_exists( 'bp_dtheme_sidebar_login_redirect_to' ) ) :
 /**
  * Adds a hidden "redirect_to" input field to the sidebar login form.
  *
- * @since 1.5
+ * @since BuddyPress (1.5)
  */
 function bp_dtheme_sidebar_login_redirect_to() {
-	$redirect_to = apply_filters( 'bp_no_access_redirect', !empty( $_REQUEST['redirect_to'] ) ? $_REQUEST['redirect_to'] : '' );
-?>
+	$redirect_to = !empty( $_REQUEST['redirect_to'] ) ? $_REQUEST['redirect_to'] : '';
+	$redirect_to = apply_filters( 'bp_no_access_redirect', $redirect_to ); ?>
+
 	<input type="hidden" name="redirect_to" value="<?php echo esc_attr( $redirect_to ); ?>" />
+
 <?php
 }
 add_action( 'bp_sidebar_login_form', 'bp_dtheme_sidebar_login_redirect_to' );
@@ -719,18 +728,20 @@ if ( !function_exists( 'bp_dtheme_content_nav' ) ) :
 /**
  * Display navigation to next/previous pages when applicable
  *
- * @global unknown $wp_query
+ * @global WP_Query $wp_query
  * @param string $nav_id DOM ID for this navigation
- * @since 1.5
+ * @since BuddyPress (1.5)
  */
 function bp_dtheme_content_nav( $nav_id ) {
 	global $wp_query;
 
-	if ( $wp_query->max_num_pages > 1 ) : ?>
+	if ( !empty( $wp_query->max_num_pages ) && $wp_query->max_num_pages > 1 ) : ?>
+
 		<div id="<?php echo $nav_id; ?>" class="navigation">
 			<div class="alignleft"><?php next_posts_link( __( '&larr; Previous Entries', 'buddypress' ) ); ?></div>
 			<div class="alignright"><?php previous_posts_link( __( 'Next Entries &rarr;', 'buddypress' ) ); ?></div>
 		</div><!-- #<?php echo $nav_id; ?> -->
+
 	<?php endif;
 }
 endif;
@@ -745,7 +756,7 @@ endif;
  * The no-js class is removed by the JavaScript created in bp_dtheme_remove_nojs_body_class().
  *
  * @package BuddyPress
- * @since 1.5.1
+ * @since BuddyPress (1.5).1
  * @see bp_dtheme_remove_nojs_body_class()
  */
 function bp_dtheme_add_nojs_body_class( $classes ) {
@@ -766,7 +777,7 @@ add_filter( 'bp_get_the_body_class', 'bp_dtheme_add_nojs_body_class' );
  * This technique is borrowed from WordPress, wp-admin/admin-header.php.
  *
  * @package BuddyPress
- * @since 1.5.1
+ * @since BuddyPress (1.5).1
  * @see bp_dtheme_add_nojs_body_class()
  */
 function bp_dtheme_remove_nojs_body_class() {
diff --git a/wp-content/plugins/buddypress/bp-themes/bp-default/groups/create.php b/wp-content/plugins/buddypress/bp-themes/bp-default/groups/create.php
index 84cefe5cc124dd0f50b11f9f694a887fcb04a13d..39533d1ee9634f929c24f1ba659aa6d1ecd19334 100644
--- a/wp-content/plugins/buddypress/bp-themes/bp-default/groups/create.php
+++ b/wp-content/plugins/buddypress/bp-themes/bp-default/groups/create.php
@@ -7,12 +7,12 @@
  * @subpackage bp-default
  */
 
-?>
-
-<?php get_header( 'buddypress' ); ?>
+get_header( 'buddypress' ); ?>
 
 	<div id="content">
 		<div class="padder">
+		
+		<?php do_action( 'bp_before_create_group_content_template' ); ?>
 
 		<form action="<?php bp_group_creation_form_action(); ?>" method="post" id="create-group-form" class="standard-form" enctype="multipart/form-data">
 			<h3><?php _e( 'Create a Group', 'buddypress' ); ?> &nbsp;<a class="button" href="<?php echo trailingslashit( bp_get_root_domain() . '/' . bp_get_groups_root_slug() ); ?>"><?php _e( 'Groups Directory', 'buddypress' ); ?></a></h3>
@@ -39,7 +39,7 @@
 					<label for="group-name"><?php _e( 'Group Name (required)', 'buddypress' ); ?></label>
 					<input type="text" name="group-name" id="group-name" aria-required="true" value="<?php bp_new_group_name(); ?>" />
 
-					<label for="group-desc"><?php _e( 'Group Description (required)', 'buddypress' ) ?></label>
+					<label for="group-desc"><?php _e( 'Group Description (required)', 'buddypress' ); ?></label>
 					<textarea name="group-desc" id="group-desc" aria-required="true"><?php bp_new_group_description(); ?></textarea>
 
 					<?php
@@ -55,26 +55,6 @@
 
 					<?php do_action( 'bp_before_group_settings_creation_step' ); ?>
 
-					<?php if ( bp_is_active( 'forums' ) ) : ?>
-						<?php if ( bp_forums_is_installed_correctly() ) : ?>
-
-							<div class="checkbox">
-								<label><input type="checkbox" name="group-show-forum" id="group-show-forum" value="1"<?php checked( bp_get_new_group_enable_forum(), true, true ); ?> /> <?php _e( 'Enable discussion forum', 'buddypress' ); ?></label>
-							</div>
-
-						<?php else : ?>
-							<?php if ( is_super_admin() ) : ?>
-
-								<div class="checkbox">
-									<label><input type="checkbox" disabled="disabled" name="disabled" id="disabled" value="0" /> <?php printf( __( '<strong>Attention Site Admin:</strong> Group forums require the <a href="%s">correct setup and configuration</a> of a bbPress installation.', 'buddypress' ), bp_get_root_domain() . '/wp-admin/admin.php?page=bb-forums-setup' ); ?></label>
-								</div>
-
-							<?php endif; ?>
-						<?php endif; ?>
-					<?php endif; ?>
-
-					<hr />
-
 					<h4><?php _e( 'Privacy Options', 'buddypress' ); ?></h4>
 
 					<div class="radio">
@@ -106,30 +86,45 @@
 						</label>
 					</div>
 
-					<hr />
-
 					<h4><?php _e( 'Group Invitations', 'buddypress' ); ?></h4>
 
-					<p><?php _e( 'Which members of this group are allowed to invite others?', 'buddypress' ) ?></p>
+					<p><?php _e( 'Which members of this group are allowed to invite others?', 'buddypress' ); ?></p>
 
 					<div class="radio">
 						<label>
-							<input type="radio" name="group-invite-status" value="members"<?php bp_group_show_invite_status_setting( 'members' ) ?> />
-							<strong><?php _e( 'All group members', 'buddypress' ) ?></strong>
+							<input type="radio" name="group-invite-status" value="members"<?php bp_group_show_invite_status_setting( 'members' ); ?> />
+							<strong><?php _e( 'All group members', 'buddypress' ); ?></strong>
 						</label>
 
 						<label>
-							<input type="radio" name="group-invite-status" value="mods"<?php bp_group_show_invite_status_setting( 'mods' ) ?> />
-							<strong><?php _e( 'Group admins and mods only', 'buddypress' ) ?></strong>
+							<input type="radio" name="group-invite-status" value="mods"<?php bp_group_show_invite_status_setting( 'mods' ); ?> />
+							<strong><?php _e( 'Group admins and mods only', 'buddypress' ); ?></strong>
 						</label>
 
 						<label>
-							<input type="radio" name="group-invite-status" value="admins"<?php bp_group_show_invite_status_setting( 'admins' ) ?> />
-							<strong><?php _e( 'Group admins only', 'buddypress' ) ?></strong>
+							<input type="radio" name="group-invite-status" value="admins"<?php bp_group_show_invite_status_setting( 'admins' ); ?> />
+							<strong><?php _e( 'Group admins only', 'buddypress' ); ?></strong>
 						</label>
 					</div>
 
-					<hr />
+					<?php if ( bp_is_active( 'forums' ) ) : ?>
+
+						<h4><?php _e( 'Group Forums', 'buddypress' ); ?></h4>
+
+						<?php if ( bp_forums_is_installed_correctly() ) : ?>
+
+							<p><?php _e( 'Should this group have a forum?', 'buddypress' ); ?></p>
+
+							<div class="checkbox">
+								<label><input type="checkbox" name="group-show-forum" id="group-show-forum" value="1"<?php checked( bp_get_new_group_enable_forum(), true, true ); ?> /> <?php _e( 'Enable discussion forum', 'buddypress' ); ?></label>
+							</div>
+						<?php elseif ( is_super_admin() ) : ?>
+
+							<p><?php printf( __( '<strong>Attention Site Admin:</strong> Group forums require the <a href="%s">correct setup and configuration</a> of a bbPress installation.', 'buddypress' ), bp_core_do_network_admin() ? network_admin_url( 'settings.php?page=bb-forums-setup' ) :  admin_url( 'admin.php?page=bb-forums-setup' ) ); ?></p>
+
+						<?php endif; ?>
+
+					<?php endif; ?>
 
 					<?php do_action( 'bp_after_group_settings_creation_step' ); ?>
 
@@ -310,6 +305,8 @@
 			<?php do_action( 'bp_after_create_group' ); ?>
 
 		</form>
+		
+		<?php do_action( 'bp_after_create_group_content_template' ); ?>
 
 		</div><!-- .padder -->
 	</div><!-- #content -->
diff --git a/wp-content/plugins/buddypress/bp-themes/bp-default/groups/index.php b/wp-content/plugins/buddypress/bp-themes/bp-default/groups/index.php
index 7da62e9ce56ed9a86297a3edb59b71d4f23e6795..56e3eb10dd7acfc1698aa00184d04c45ed3d339b 100644
--- a/wp-content/plugins/buddypress/bp-themes/bp-default/groups/index.php
+++ b/wp-content/plugins/buddypress/bp-themes/bp-default/groups/index.php
@@ -7,9 +7,7 @@
  * @subpackage bp-default
  */
 
-?>
-
-<?php get_header( 'buddypress' ); ?>
+get_header( 'buddypress' ); ?>
 
 	<?php do_action( 'bp_before_directory_groups_page' ); ?>
 
@@ -26,7 +24,7 @@
 
 			<div id="group-dir-search" class="dir-search" role="search">
 
-				<?php bp_directory_groups_search_form() ?>
+				<?php bp_directory_groups_search_form(); ?>
 
 			</div><!-- #group-dir-search -->
 
@@ -90,5 +88,4 @@
 	<?php do_action( 'bp_after_directory_groups_page' ); ?>
 
 <?php get_sidebar( 'buddypress' ); ?>
-<?php get_footer( 'buddypress' ); ?>
-
+<?php get_footer( 'buddypress' ); ?>
\ No newline at end of file
diff --git a/wp-content/plugins/buddypress/bp-themes/bp-default/groups/single/activity.php b/wp-content/plugins/buddypress/bp-themes/bp-default/groups/single/activity.php
index 57f30c7f3daa75ccbcfcdc0a0dea24f7f42f8a66..5dd535ce52a06963a4ea5b4dcec35c36dff75a38 100644
--- a/wp-content/plugins/buddypress/bp-themes/bp-default/groups/single/activity.php
+++ b/wp-content/plugins/buddypress/bp-themes/bp-default/groups/single/activity.php
@@ -1,39 +1,39 @@
 <div class="item-list-tabs no-ajax" id="subnav" role="navigation">
 	<ul>
-		<li class="feed"><a href="<?php bp_group_activity_feed_link() ?>" title="<?php _e( 'RSS Feed', 'buddypress' ); ?>"><?php _e( 'RSS', 'buddypress' ) ?></a></li>
+		<li class="feed"><a href="<?php bp_group_activity_feed_link(); ?>" title="<?php _e( 'RSS Feed', 'buddypress' ); ?>"><?php _e( 'RSS', 'buddypress' ); ?></a></li>
 
-		<?php do_action( 'bp_group_activity_syndication_options' ) ?>
+		<?php do_action( 'bp_group_activity_syndication_options' ); ?>
 
 		<li id="activity-filter-select" class="last">
 			<label for="activity-filter-by"><?php _e( 'Show:', 'buddypress' ); ?></label> 
 			<select id="activity-filter-by">
-				<option value="-1"><?php _e( 'Everything', 'buddypress' ) ?></option>
-				<option value="activity_update"><?php _e( 'Updates', 'buddypress' ) ?></option>
+				<option value="-1"><?php _e( 'Everything', 'buddypress' ); ?></option>
+				<option value="activity_update"><?php _e( 'Updates', 'buddypress' ); ?></option>
 
 				<?php if ( bp_is_active( 'forums' ) ) : ?>
-					<option value="new_forum_topic"><?php _e( 'Forum Topics', 'buddypress' ) ?></option>
-					<option value="new_forum_post"><?php _e( 'Forum Replies', 'buddypress' ) ?></option>
+					<option value="new_forum_topic"><?php _e( 'Forum Topics', 'buddypress' ); ?></option>
+					<option value="new_forum_post"><?php _e( 'Forum Replies', 'buddypress' ); ?></option>
 				<?php endif; ?>
 
-				<option value="joined_group"><?php _e( 'Group Memberships', 'buddypress' ) ?></option>
+				<option value="joined_group"><?php _e( 'Group Memberships', 'buddypress' ); ?></option>
 
-				<?php do_action( 'bp_group_activity_filter_options' ) ?>
+				<?php do_action( 'bp_group_activity_filter_options' ); ?>
 			</select>
 		</li>
 	</ul>
 </div><!-- .item-list-tabs -->
 
-<?php do_action( 'bp_before_group_activity_post_form' ) ?>
+<?php do_action( 'bp_before_group_activity_post_form' ); ?>
 
 <?php if ( is_user_logged_in() && bp_group_is_member() ) : ?>
-	<?php locate_template( array( 'activity/post-form.php'), true ) ?>
+	<?php locate_template( array( 'activity/post-form.php'), true ); ?>
 <?php endif; ?>
 
-<?php do_action( 'bp_after_group_activity_post_form' ) ?>
-<?php do_action( 'bp_before_group_activity_content' ) ?>
+<?php do_action( 'bp_after_group_activity_post_form' ); ?>
+<?php do_action( 'bp_before_group_activity_content' ); ?>
 
 <div class="activity single-group" role="main">
-	<?php locate_template( array( 'activity/activity-loop.php' ), true ) ?>
+	<?php locate_template( array( 'activity/activity-loop.php' ), true ); ?>
 </div><!-- .activity.single-group -->
 
-<?php do_action( 'bp_after_group_activity_content' ) ?>
+<?php do_action( 'bp_after_group_activity_content' ); ?>
diff --git a/wp-content/plugins/buddypress/bp-themes/bp-default/groups/single/admin.php b/wp-content/plugins/buddypress/bp-themes/bp-default/groups/single/admin.php
index 29264175e4114caa9804a7d577dce3700fe3308b..e1698f9e783b3231666ae4ad3042eb8754275df2 100644
--- a/wp-content/plugins/buddypress/bp-themes/bp-default/groups/single/admin.php
+++ b/wp-content/plugins/buddypress/bp-themes/bp-default/groups/single/admin.php
@@ -4,9 +4,9 @@
 	</ul>
 </div><!-- .item-list-tabs -->
 
-<form action="<?php bp_group_admin_form_action() ?>" name="group-settings-form" id="group-settings-form" class="standard-form" method="post" enctype="multipart/form-data" role="main">
+<form action="<?php bp_group_admin_form_action(); ?>" name="group-settings-form" id="group-settings-form" class="standard-form" method="post" enctype="multipart/form-data" role="main">
 
-<?php do_action( 'bp_before_group_admin_content' ) ?>
+<?php do_action( 'bp_before_group_admin_content' ); ?>
 
 <?php /* Edit Group Details */ ?>
 <?php if ( bp_is_group_admin_screen( 'edit-details' ) ) : ?>
@@ -14,12 +14,12 @@
 	<?php do_action( 'bp_before_group_details_admin' ); ?>
 
 	<label for="group-name"><?php _e( 'Group Name (required)', 'buddypress' ); ?></label>
-	<input type="text" name="group-name" id="group-name" value="<?php bp_group_name() ?>" aria-required="true" />
+	<input type="text" name="group-name" id="group-name" value="<?php bp_group_name(); ?>" aria-required="true" />
 
 	<label for="group-desc"><?php _e( 'Group Description (required)', 'buddypress' ); ?></label>
-	<textarea name="group-desc" id="group-desc" aria-required="true"><?php bp_group_description_editable() ?></textarea>
+	<textarea name="group-desc" id="group-desc" aria-required="true"><?php bp_group_description_editable(); ?></textarea>
 
-	<?php do_action( 'groups_custom_group_fields_editable' ) ?>
+	<?php do_action( 'groups_custom_group_fields_editable' ); ?>
 
 	<p>
 		<label for="group-notifiy-members"><?php _e( 'Notify group members of changes via email', 'buddypress' ); ?></label>
@@ -29,8 +29,8 @@
 
 	<?php do_action( 'bp_after_group_details_admin' ); ?>
 
-	<p><input type="submit" value="<?php _e( 'Save Changes', 'buddypress' ) ?>" id="save" name="save" /></p>
-	<?php wp_nonce_field( 'groups_edit_group_details' ) ?>
+	<p><input type="submit" value="<?php _e( 'Save Changes', 'buddypress' ); ?>" id="save" name="save" /></p>
+	<?php wp_nonce_field( 'groups_edit_group_details' ); ?>
 
 <?php endif; ?>
 
@@ -44,7 +44,7 @@
 		<?php if ( bp_forums_is_installed_correctly() ) : ?>
 
 			<div class="checkbox">
-				<label><input type="checkbox" name="group-show-forum" id="group-show-forum" value="1"<?php bp_group_show_forum_setting() ?> /> <?php _e( 'Enable discussion forum', 'buddypress' ) ?></label>
+				<label><input type="checkbox" name="group-show-forum" id="group-show-forum" value="1"<?php bp_group_show_forum_setting(); ?> /> <?php _e( 'Enable discussion forum', 'buddypress' ); ?></label>
 			</div>
 
 			<hr />
@@ -57,32 +57,32 @@
 
 	<div class="radio">
 		<label>
-			<input type="radio" name="group-status" value="public"<?php bp_group_show_status_setting( 'public' ) ?> />
-			<strong><?php _e( 'This is a public group', 'buddypress' ) ?></strong>
+			<input type="radio" name="group-status" value="public"<?php bp_group_show_status_setting( 'public' ); ?> />
+			<strong><?php _e( 'This is a public group', 'buddypress' ); ?></strong>
 			<ul>
-				<li><?php _e( 'Any site member can join this group.', 'buddypress' ) ?></li>
-				<li><?php _e( 'This group will be listed in the groups directory and in search results.', 'buddypress' ) ?></li>
-				<li><?php _e( 'Group content and activity will be visible to any site member.', 'buddypress' ) ?></li>
+				<li><?php _e( 'Any site member can join this group.', 'buddypress' ); ?></li>
+				<li><?php _e( 'This group will be listed in the groups directory and in search results.', 'buddypress' ); ?></li>
+				<li><?php _e( 'Group content and activity will be visible to any site member.', 'buddypress' ); ?></li>
 			</ul>
 		</label>
 
 		<label>
-			<input type="radio" name="group-status" value="private"<?php bp_group_show_status_setting( 'private' ) ?> />
-			<strong><?php _e( 'This is a private group', 'buddypress' ) ?></strong>
+			<input type="radio" name="group-status" value="private"<?php bp_group_show_status_setting( 'private' ); ?> />
+			<strong><?php _e( 'This is a private group', 'buddypress' ); ?></strong>
 			<ul>
-				<li><?php _e( 'Only users who request membership and are accepted can join the group.', 'buddypress' ) ?></li>
-				<li><?php _e( 'This group will be listed in the groups directory and in search results.', 'buddypress' ) ?></li>
-				<li><?php _e( 'Group content and activity will only be visible to members of the group.', 'buddypress' ) ?></li>
+				<li><?php _e( 'Only users who request membership and are accepted can join the group.', 'buddypress' ); ?></li>
+				<li><?php _e( 'This group will be listed in the groups directory and in search results.', 'buddypress' ); ?></li>
+				<li><?php _e( 'Group content and activity will only be visible to members of the group.', 'buddypress' ); ?></li>
 			</ul>
 		</label>
 
 		<label>
-			<input type="radio" name="group-status" value="hidden"<?php bp_group_show_status_setting( 'hidden' ) ?> />
-			<strong><?php _e( 'This is a hidden group', 'buddypress' ) ?></strong>
+			<input type="radio" name="group-status" value="hidden"<?php bp_group_show_status_setting( 'hidden' ); ?> />
+			<strong><?php _e( 'This is a hidden group', 'buddypress' ); ?></strong>
 			<ul>
-				<li><?php _e( 'Only users who are invited can join the group.', 'buddypress' ) ?></li>
-				<li><?php _e( 'This group will not be listed in the groups directory or search results.', 'buddypress' ) ?></li>
-				<li><?php _e( 'Group content and activity will only be visible to members of the group.', 'buddypress' ) ?></li>
+				<li><?php _e( 'Only users who are invited can join the group.', 'buddypress' ); ?></li>
+				<li><?php _e( 'This group will not be listed in the groups directory or search results.', 'buddypress' ); ?></li>
+				<li><?php _e( 'Group content and activity will only be visible to members of the group.', 'buddypress' ); ?></li>
 			</ul>
 		</label>
 	</div>
@@ -91,22 +91,22 @@
 	 
 	<h4><?php _e( 'Group Invitations', 'buddypress' ); ?></h4> 
 
-	<p><?php _e( 'Which members of this group are allowed to invite others?', 'buddypress' ) ?></p> 
+	<p><?php _e( 'Which members of this group are allowed to invite others?', 'buddypress' ); ?></p> 
 
 	<div class="radio"> 
 		<label> 
-			<input type="radio" name="group-invite-status" value="members"<?php bp_group_show_invite_status_setting( 'members' ) ?> /> 
-			<strong><?php _e( 'All group members', 'buddypress' ) ?></strong> 
+			<input type="radio" name="group-invite-status" value="members"<?php bp_group_show_invite_status_setting( 'members' ); ?> /> 
+			<strong><?php _e( 'All group members', 'buddypress' ); ?></strong> 
 		</label> 
 
 		<label> 
-			<input type="radio" name="group-invite-status" value="mods"<?php bp_group_show_invite_status_setting( 'mods' ) ?> /> 
-			<strong><?php _e( 'Group admins and mods only', 'buddypress' ) ?></strong> 
+			<input type="radio" name="group-invite-status" value="mods"<?php bp_group_show_invite_status_setting( 'mods' ); ?> /> 
+			<strong><?php _e( 'Group admins and mods only', 'buddypress' ); ?></strong> 
 		</label>
 		
 		<label> 
-			<input type="radio" name="group-invite-status" value="admins"<?php bp_group_show_invite_status_setting( 'admins' ) ?> /> 
-			<strong><?php _e( 'Group admins only', 'buddypress' ) ?></strong> 
+			<input type="radio" name="group-invite-status" value="admins"<?php bp_group_show_invite_status_setting( 'admins' ); ?> /> 
+			<strong><?php _e( 'Group admins only', 'buddypress' ); ?></strong> 
 		</label> 
  	</div> 
 
@@ -114,8 +114,8 @@
 
 	<?php do_action( 'bp_after_group_settings_admin' ); ?>
 
-	<p><input type="submit" value="<?php _e( 'Save Changes', 'buddypress' ) ?>" id="save" name="save" /></p>
-	<?php wp_nonce_field( 'groups_edit_group_settings' ) ?>
+	<p><input type="submit" value="<?php _e( 'Save Changes', 'buddypress' ); ?>" id="save" name="save" /></p>
+	<?php wp_nonce_field( 'groups_edit_group_settings' ); ?>
 
 <?php endif; ?>
 
@@ -124,45 +124,45 @@
 
 	<?php if ( 'upload-image' == bp_get_avatar_admin_step() ) : ?>
 
-			<p><?php _e("Upload an image to use as an avatar for this group. The image will be shown on the main group page, and in search results.", 'buddypress') ?></p>
+			<p><?php _e("Upload an image to use as an avatar for this group. The image will be shown on the main group page, and in search results.", 'buddypress'); ?></p>
 
 			<p>
 				<input type="file" name="file" id="file" />
-				<input type="submit" name="upload" id="upload" value="<?php _e( 'Upload Image', 'buddypress' ) ?>" />
+				<input type="submit" name="upload" id="upload" value="<?php _e( 'Upload Image', 'buddypress' ); ?>" />
 				<input type="hidden" name="action" id="action" value="bp_avatar_upload" />
 			</p>
 
 			<?php if ( bp_get_group_has_avatar() ) : ?>
 
-				<p><?php _e( "If you'd like to remove the existing avatar but not upload a new one, please use the delete avatar button.", 'buddypress' ) ?></p>
+				<p><?php _e( "If you'd like to remove the existing avatar but not upload a new one, please use the delete avatar button.", 'buddypress' ); ?></p>
 
 				<?php bp_button( array( 'id' => 'delete_group_avatar', 'component' => 'groups', 'wrapper_id' => 'delete-group-avatar-button', 'link_class' => 'edit', 'link_href' => bp_get_group_avatar_delete_link(), 'link_title' => __( 'Delete Avatar', 'buddypress' ), 'link_text' => __( 'Delete Avatar', 'buddypress' ) ) ); ?>
 
 			<?php endif; ?>
 
-			<?php wp_nonce_field( 'bp_avatar_upload' ) ?>
+			<?php wp_nonce_field( 'bp_avatar_upload' ); ?>
 
 	<?php endif; ?>
 
 	<?php if ( 'crop-image' == bp_get_avatar_admin_step() ) : ?>
 
-		<h3><?php _e( 'Crop Avatar', 'buddypress' ) ?></h3>
+		<h3><?php _e( 'Crop Avatar', 'buddypress' ); ?></h3>
 
-		<img src="<?php bp_avatar_to_crop() ?>" id="avatar-to-crop" class="avatar" alt="<?php _e( 'Avatar to crop', 'buddypress' ) ?>" />
+		<img src="<?php bp_avatar_to_crop(); ?>" id="avatar-to-crop" class="avatar" alt="<?php _e( 'Avatar to crop', 'buddypress' ); ?>" />
 
 		<div id="avatar-crop-pane">
-			<img src="<?php bp_avatar_to_crop() ?>" id="avatar-crop-preview" class="avatar" alt="<?php _e( 'Avatar preview', 'buddypress' ) ?>" />
+			<img src="<?php bp_avatar_to_crop(); ?>" id="avatar-crop-preview" class="avatar" alt="<?php _e( 'Avatar preview', 'buddypress' ); ?>" />
 		</div>
 
-		<input type="submit" name="avatar-crop-submit" id="avatar-crop-submit" value="<?php _e( 'Crop Image', 'buddypress' ) ?>" />
+		<input type="submit" name="avatar-crop-submit" id="avatar-crop-submit" value="<?php _e( 'Crop Image', 'buddypress' ); ?>" />
 
-		<input type="hidden" name="image_src" id="image_src" value="<?php bp_avatar_to_crop_src() ?>" />
+		<input type="hidden" name="image_src" id="image_src" value="<?php bp_avatar_to_crop_src(); ?>" />
 		<input type="hidden" id="x" name="x" />
 		<input type="hidden" id="y" name="y" />
 		<input type="hidden" id="w" name="w" />
 		<input type="hidden" id="h" name="h" />
 
-		<?php wp_nonce_field( 'bp_avatar_cropstore' ) ?>
+		<?php wp_nonce_field( 'bp_avatar_cropstore' ); ?>
 
 	<?php endif; ?>
 
@@ -178,16 +178,18 @@
 
 		<?php if ( bp_has_members( '&include='. bp_group_admin_ids() ) ) : ?>
 		
-		<ul id="admins-list" class="item-list single-line>">
+		<ul id="admins-list" class="item-list single-line">
 			
 			<?php while ( bp_members() ) : bp_the_member(); ?>
 			<li>
-				<?php echo bp_core_fetch_avatar( array( 'item_id' => bp_get_member_user_id(), 'type' => 'thumb', 'width' => 30, 'height' => 30, 'alt' => __( 'Profile picture of %s', 'buddypress' ) ) ) ?>
+				<?php echo bp_core_fetch_avatar( array( 'item_id' => bp_get_member_user_id(), 'type' => 'thumb', 'width' => 30, 'height' => 30, 'alt' => sprintf( __( 'Profile picture of %s', 'buddypress' ), bp_get_member_name() ) ) ); ?>
 				<h5>
 					<a href="<?php bp_member_permalink(); ?>"> <?php bp_member_name(); ?></a>
+					<?php if ( count( bp_group_admin_ids( false, 'array' ) ) > 1 ) : ?>
 					<span class="small">
-						<a class="button confirm admin-demote-to-member" href="<?php bp_group_member_demote_link( bp_get_member_user_id() ) ?>"><?php _e( 'Demote to Member', 'buddypress' ) ?></a>
+						<a class="button confirm admin-demote-to-member" href="<?php bp_group_member_demote_link( bp_get_member_user_id() ); ?>"><?php _e( 'Demote to Member', 'buddypress' ); ?></a>
 					</span>			
+					<?php endif; ?>
 				</h5>		
 			</li>
 			<?php endwhile; ?>
@@ -200,19 +202,19 @@
 	
 	<?php if ( bp_group_has_moderators() ) : ?>
 		<div class="bp-widget">
-			<h4><?php _e( 'Moderators', 'buddypress' ) ?></h4>		
+			<h4><?php _e( 'Moderators', 'buddypress' ); ?></h4>		
 			
 			<?php if ( bp_has_members( '&include=' . bp_group_mod_ids() ) ) : ?>
-				<ul id="mods-list" class="item-list">
+				<ul id="mods-list" class="item-list single-line">
 				
 					<?php while ( bp_members() ) : bp_the_member(); ?>					
 					<li>
-						<?php echo bp_core_fetch_avatar( array( 'item_id' => bp_get_member_user_id(), 'type' => 'thumb', 'width' => 30, 'height' => 30, 'alt' => __( 'Profile picture of %s', 'buddypress' ) ) ) ?>
+						<?php echo bp_core_fetch_avatar( array( 'item_id' => bp_get_member_user_id(), 'type' => 'thumb', 'width' => 30, 'height' => 30, 'alt' => sprintf( __( 'Profile picture of %s', 'buddypress' ), bp_get_member_name() ) ) ); ?>
 						<h5>
 							<a href="<?php bp_member_permalink(); ?>"> <?php bp_member_name(); ?></a>
 							<span class="small">
-								<a href="<?php bp_group_member_promote_admin_link( array( 'user_id' => bp_get_member_user_id() ) ) ?>" class="button confirm mod-promote-to-admin" title="<?php _e( 'Promote to Admin', 'buddypress' ); ?>"><?php _e( 'Promote to Admin', 'buddypress' ); ?></a>
-								<a class="button confirm mod-demote-to-member" href="<?php bp_group_member_demote_link( bp_get_member_user_id() ) ?>"><?php _e( 'Demote to Member', 'buddypress' ) ?></a>
+								<a href="<?php bp_group_member_promote_admin_link( array( 'user_id' => bp_get_member_user_id() ) ); ?>" class="button confirm mod-promote-to-admin" title="<?php _e( 'Promote to Admin', 'buddypress' ); ?>"><?php _e( 'Promote to Admin', 'buddypress' ); ?></a>
+								<a class="button confirm mod-demote-to-member" href="<?php bp_group_member_demote_link( bp_get_member_user_id() ); ?>"><?php _e( 'Demote to Member', 'buddypress' ); ?></a>
 							</span>		
 						</h5>		
 					</li>	
@@ -235,11 +237,11 @@
 				<div class="pagination no-ajax">
 
 					<div id="member-count" class="pag-count">
-						<?php bp_group_member_pagination_count() ?>
+						<?php bp_group_member_pagination_count(); ?>
 					</div>
 
 					<div id="member-admin-pagination" class="pagination-links">
-						<?php bp_group_member_admin_pagination() ?>
+						<?php bp_group_member_admin_pagination(); ?>
 					</div>
 
 				</div>
@@ -250,10 +252,10 @@
 				<?php while ( bp_group_members() ) : bp_group_the_member(); ?>
 
 					<li class="<?php bp_group_member_css_class(); ?>">
-						<?php bp_group_member_avatar_mini() ?>
+						<?php bp_group_member_avatar_mini(); ?>
 
 						<h5>
-							<?php bp_group_member_link() ?>
+							<?php bp_group_member_link(); ?>
 
 							<?php if ( bp_get_group_member_is_banned() ) _e( '(banned)', 'buddypress'); ?>
 
@@ -261,17 +263,17 @@
 
 							<?php if ( bp_get_group_member_is_banned() ) : ?>
 
-								<a href="<?php bp_group_member_unban_link() ?>" class="button confirm member-unban" title="<?php _e( 'Unban this member', 'buddypress' ) ?>"><?php _e( 'Remove Ban', 'buddypress' ); ?></a>
+								<a href="<?php bp_group_member_unban_link(); ?>" class="button confirm member-unban" title="<?php _e( 'Unban this member', 'buddypress' ); ?>"><?php _e( 'Remove Ban', 'buddypress' ); ?></a>
 
 							<?php else : ?>
 
-								<a href="<?php bp_group_member_ban_link() ?>" class="button confirm member-ban" title="<?php _e( 'Kick and ban this member', 'buddypress' ); ?>"><?php _e( 'Kick &amp; Ban', 'buddypress' ); ?></a>
-								<a href="<?php bp_group_member_promote_mod_link() ?>" class="button confirm member-promote-to-mod" title="<?php _e( 'Promote to Mod', 'buddypress' ); ?>"><?php _e( 'Promote to Mod', 'buddypress' ); ?></a>
-								<a href="<?php bp_group_member_promote_admin_link() ?>" class="button confirm member-promote-to-admin" title="<?php _e( 'Promote to Admin', 'buddypress' ); ?>"><?php _e( 'Promote to Admin', 'buddypress' ); ?></a>
+								<a href="<?php bp_group_member_ban_link(); ?>" class="button confirm member-ban" title="<?php _e( 'Kick and ban this member', 'buddypress' ); ?>"><?php _e( 'Kick &amp; Ban', 'buddypress' ); ?></a>
+								<a href="<?php bp_group_member_promote_mod_link(); ?>" class="button confirm member-promote-to-mod" title="<?php _e( 'Promote to Mod', 'buddypress' ); ?>"><?php _e( 'Promote to Mod', 'buddypress' ); ?></a>
+								<a href="<?php bp_group_member_promote_admin_link(); ?>" class="button confirm member-promote-to-admin" title="<?php _e( 'Promote to Admin', 'buddypress' ); ?>"><?php _e( 'Promote to Admin', 'buddypress' ); ?></a>
 
 							<?php endif; ?>
 
-								<a href="<?php bp_group_member_remove_link() ?>" class="button confirm" title="<?php _e( 'Remove this member', 'buddypress' ); ?>"><?php _e( 'Remove from group', 'buddypress' ); ?></a>
+								<a href="<?php bp_group_member_remove_link(); ?>" class="button confirm" title="<?php _e( 'Remove this member', 'buddypress' ); ?>"><?php _e( 'Remove from group', 'buddypress' ); ?></a>
 
 								<?php do_action( 'bp_group_manage_members_admin_item' ); ?>
 
@@ -307,9 +309,9 @@
 			<?php while ( bp_group_membership_requests() ) : bp_group_the_membership_request(); ?>
 
 				<li>
-					<?php bp_group_request_user_avatar_thumb() ?>
-					<h4><?php bp_group_request_user_link() ?> <span class="comments"><?php bp_group_request_comment() ?></span></h4>
-					<span class="activity"><?php bp_group_request_time_since_requested() ?></span>
+					<?php bp_group_request_user_avatar_thumb(); ?>
+					<h4><?php bp_group_request_user_link(); ?> <span class="comments"><?php bp_group_request_comment(); ?></span></h4>
+					<span class="activity"><?php bp_group_request_time_since_requested(); ?></span>
 
 					<?php do_action( 'bp_group_membership_requests_admin_item' ); ?>
 
@@ -355,17 +357,17 @@
 	<?php do_action( 'bp_after_group_delete_admin' ); ?>
 
 	<div class="submit">
-		<input type="submit" disabled="disabled" value="<?php _e( 'Delete Group', 'buddypress' ) ?>" id="delete-group-button" name="delete-group-button" />
+		<input type="submit" disabled="disabled" value="<?php _e( 'Delete Group', 'buddypress' ); ?>" id="delete-group-button" name="delete-group-button" />
 	</div>
 
-	<?php wp_nonce_field( 'groups_delete_group' ) ?>
+	<?php wp_nonce_field( 'groups_delete_group' ); ?>
 
 <?php endif; ?>
 
 <?php /* This is important, don't forget it */ ?>
-	<input type="hidden" name="group-id" id="group-id" value="<?php bp_group_id() ?>" />
+	<input type="hidden" name="group-id" id="group-id" value="<?php bp_group_id(); ?>" />
 
-<?php do_action( 'bp_after_group_admin_content' ) ?>
+<?php do_action( 'bp_after_group_admin_content' ); ?>
 
 </form><!-- #group-settings-form -->
 
diff --git a/wp-content/plugins/buddypress/bp-themes/bp-default/groups/single/forum.php b/wp-content/plugins/buddypress/bp-themes/bp-default/groups/single/forum.php
index f376e2803ea88ad27024b28da50e2c3c1148bcb5..d94faba9abba89f3827b3ed286d53b4d4e9b0bf2 100644
--- a/wp-content/plugins/buddypress/bp-themes/bp-default/groups/single/forum.php
+++ b/wp-content/plugins/buddypress/bp-themes/bp-default/groups/single/forum.php
@@ -16,7 +16,7 @@ else : ?>
 			<?php if ( is_user_logged_in() ) : ?>
 
 				<li>
-					<a href="#post-new" class="show-hide-new"><?php _e( 'New Topic', 'buddypress' ) ?></a>
+					<a href="#post-new" class="show-hide-new"><?php _e( 'New Topic', 'buddypress' ); ?></a>
 				</li>
 
 			<?php endif; ?>
@@ -24,7 +24,7 @@ else : ?>
 			<?php if ( bp_forums_has_directory() ) : ?>
 
 				<li>
-					<a href="<?php bp_forums_directory_permalink() ?>"><?php _e( 'Forum Directory', 'buddypress') ?></a>
+					<a href="<?php bp_forums_directory_permalink(); ?>"><?php _e( 'Forum Directory', 'buddypress'); ?></a>
 				</li>
 
 			<?php endif; ?>
@@ -48,13 +48,13 @@ else : ?>
 
 	<div class="forums single-forum" role="main">
 
-		<?php locate_template( array( 'forums/forums-loop.php' ), true ) ?>
+		<?php locate_template( array( 'forums/forums-loop.php' ), true ); ?>
 
 	</div><!-- .forums.single-forum -->
 
 <?php endif; ?>
 
-<?php do_action( 'bp_after_group_forum_content' ) ?>
+<?php do_action( 'bp_after_group_forum_content' ); ?>
 
 <?php if ( !bp_is_group_forum_topic_edit() && !bp_is_group_forum_topic() ) : ?>
 
@@ -63,35 +63,34 @@ else : ?>
 		<form action="" method="post" id="forum-topic-form" class="standard-form">
 			<div id="new-topic-post">
 
-				<?php do_action( 'bp_before_group_forum_post_new' ) ?>
+				<?php do_action( 'bp_before_group_forum_post_new' ); ?>
 
 				<?php if ( bp_groups_auto_join() && !bp_group_is_member() ) : ?>
-					<p><?php _e( 'You will auto join this group when you start a new topic.', 'buddypress' ) ?></p>
+					<p><?php _e( 'You will auto join this group when you start a new topic.', 'buddypress' ); ?></p>
 				<?php endif; ?>
 
 				<p id="post-new"></p>
-				<h4><?php _e( 'Post a New Topic:', 'buddypress' ) ?></h4>
+				<h4><?php _e( 'Post a New Topic:', 'buddypress' ); ?></h4>
 
-				<label><?php _e( 'Title:', 'buddypress' ) ?></label>
-				<input type="text" name="topic_title" id="topic_title" value="" />
+				<label><?php _e( 'Title:', 'buddypress' ); ?></label>
+				<input type="text" name="topic_title" id="topic_title" value="" maxlength="100" />
 
-				<label><?php _e( 'Content:', 'buddypress' ) ?></label>
+				<label><?php _e( 'Content:', 'buddypress' ); ?></label>
 				<textarea name="topic_text" id="topic_text"></textarea>
 
-				<label><?php _e( 'Tags (comma separated):', 'buddypress' ) ?></label>
+				<label><?php _e( 'Tags (comma separated):', 'buddypress' ); ?></label>
 				<input type="text" name="topic_tags" id="topic_tags" value="" />
 
-				<?php do_action( 'bp_after_group_forum_post_new' ) ?>
+				<?php do_action( 'bp_after_group_forum_post_new' ); ?>
 
 				<div class="submit">
-					<input type="submit" name="submit_topic" id="submit" value="<?php _e( 'Post Topic', 'buddypress' ) ?>" />
+					<input type="submit" name="submit_topic" id="submit" value="<?php _e( 'Post Topic', 'buddypress' ); ?>" />
 				</div>
 
-				<?php wp_nonce_field( 'bp_forums_new_topic' ) ?>
+				<?php wp_nonce_field( 'bp_forums_new_topic' ); ?>
 			</div><!-- #new-topic-post -->
 		</form><!-- #forum-topic-form -->
 
 	<?php endif; ?>
 
-<?php endif; ?>
-
+<?php endif; ?>
\ No newline at end of file
diff --git a/wp-content/plugins/buddypress/bp-themes/bp-default/groups/single/forum/edit.php b/wp-content/plugins/buddypress/bp-themes/bp-default/groups/single/forum/edit.php
index 1db8ca22312b39c1f0bdc213d15a4e30a70b3b51..57cbc377a3c11d2dd146a87b39cad81d087c278d 100644
--- a/wp-content/plugins/buddypress/bp-themes/bp-default/groups/single/forum/edit.php
+++ b/wp-content/plugins/buddypress/bp-themes/bp-default/groups/single/forum/edit.php
@@ -38,48 +38,44 @@
 
 		</div>
 
-		<?php if ( bp_group_is_member() ) : ?>
+		<?php if ( bp_is_edit_topic() ) : ?>
 
-			<?php if ( bp_is_edit_topic() ) : ?>
+			<div id="edit-topic">
 
-				<div id="edit-topic">
+				<?php do_action( 'bp_group_before_edit_forum_topic' ); ?>
 
-					<?php do_action( 'bp_group_before_edit_forum_topic' ); ?>
+				<label for="topic_title"><?php _e( 'Title:', 'buddypress' ); ?></label>
+				<input type="text" name="topic_title" id="topic_title" value="<?php bp_the_topic_title(); ?>" maxlength="100" />
 
-					<label for="topic_title"><?php _e( 'Title:', 'buddypress' ); ?></label>
-					<input type="text" name="topic_title" id="topic_title" value="<?php bp_the_topic_title(); ?>" />
+				<label for="topic_text"><?php _e( 'Content:', 'buddypress' ); ?></label>
+				<textarea name="topic_text" id="topic_text"><?php bp_the_topic_text(); ?></textarea>
 
-					<label for="topic_text"><?php _e( 'Content:', 'buddypress' ); ?></label>
-					<textarea name="topic_text" id="topic_text"><?php bp_the_topic_text(); ?></textarea>
+				<label><?php _e( 'Tags (comma separated):', 'buddypress' ); ?></label>
+				<input type="text" name="topic_tags" id="topic_tags" value="<?php bp_forum_topic_tag_list(); ?>" />
 
-					<label><?php _e( 'Tags (comma separated):', 'buddypress' ) ?></label>
-					<input type="text" name="topic_tags" id="topic_tags" value="<?php bp_forum_topic_tag_list() ?>" />
+				<?php do_action( 'bp_group_after_edit_forum_topic' ); ?>
 
-					<?php do_action( 'bp_group_after_edit_forum_topic' ); ?>
+				<p class="submit"><input type="submit" name="save_changes" id="save_changes" value="<?php _e( 'Save Changes', 'buddypress' ); ?>" /></p>
 
-					<p class="submit"><input type="submit" name="save_changes" id="save_changes" value="<?php _e( 'Save Changes', 'buddypress' ); ?>" /></p>
+				<?php wp_nonce_field( 'bp_forums_edit_topic' ); ?>
 
-					<?php wp_nonce_field( 'bp_forums_edit_topic' ); ?>
+			</div>
 
-				</div>
-
-			<?php else : ?>
+		<?php else : ?>
 
-				<div id="edit-post">
+			<div id="edit-post">
 
-					<?php do_action( 'bp_group_before_edit_forum_post' ); ?>
+				<?php do_action( 'bp_group_before_edit_forum_post' ); ?>
 
-					<textarea name="post_text" id="post_text"><?php bp_the_topic_post_edit_text(); ?></textarea>
+				<textarea name="post_text" id="post_text"><?php bp_the_topic_post_edit_text(); ?></textarea>
 
-					<?php do_action( 'bp_group_after_edit_forum_post' ) ?>
+				<?php do_action( 'bp_group_after_edit_forum_post' ); ?>
 
-					<p class="submit"><input type="submit" name="save_changes" id="save_changes" value="<?php _e( 'Save Changes', 'buddypress' ); ?>" /></p>
+				<p class="submit"><input type="submit" name="save_changes" id="save_changes" value="<?php _e( 'Save Changes', 'buddypress' ); ?>" /></p>
 
-					<?php wp_nonce_field( 'bp_forums_edit_post' ); ?>
+				<?php wp_nonce_field( 'bp_forums_edit_post' ); ?>
 
-				</div>
-
-			<?php endif; ?>
+			</div>
 
 		<?php endif; ?>
 
diff --git a/wp-content/plugins/buddypress/bp-themes/bp-default/groups/single/forum/topic.php b/wp-content/plugins/buddypress/bp-themes/bp-default/groups/single/forum/topic.php
index 14b7f0b99ed485fc3f15092d11154cdf09cb4087..fff78e139dd6e68b7a20a86a40954895d5a4376e 100644
--- a/wp-content/plugins/buddypress/bp-themes/bp-default/groups/single/forum/topic.php
+++ b/wp-content/plugins/buddypress/bp-themes/bp-default/groups/single/forum/topic.php
@@ -1,166 +1,166 @@
 <?php do_action( 'bp_before_group_forum_topic' ); ?>
 
-<?php if ( bp_has_forum_topic_posts() ) : ?>
-
-	<form action="<?php bp_forum_topic_action() ?>" method="post" id="forum-topic-form" class="standard-form">
-
-		<div class="item-list-tabs no-ajax" id="subnav" role="navigation">
-			<ul>
-				<?php if ( is_user_logged_in() ) : ?>
-
-					<li>
-						<a href="<?php bp_forum_topic_new_reply_link() ?>" class="new-reply-link"><?php _e( 'New Reply', 'buddypress' ) ?></a>
-					</li>
-
-				<?php endif; ?>
-
-				<?php if ( bp_forums_has_directory() ) : ?>
-
-					<li>
-						<a href="<?php bp_forums_directory_permalink() ?>"><?php _e( 'Forum Directory', 'buddypress') ?></a>
-					</li>
-
-				<?php endif; ?>
-
-			</ul>
-		</div>
-
-		<div id="topic-meta">
-			<h3><?php bp_the_topic_title() ?> (<?php bp_the_topic_total_post_count() ?>)</h3>
-
-			<?php if ( bp_forum_topic_has_tags() ) : ?>
-
-				<div class="topic-tags">
-
-					<?php _e( 'Topic tags:', 'buddypress' ) ?> <?php bp_forum_topic_tag_list() ?>
-
-				</div>
-
+<form action="<?php bp_forum_topic_action(); ?>" method="post" id="forum-topic-form" class="standard-form">
+	<div class="item-list-tabs no-ajax" id="subnav" role="navigation">
+		<ul>
+			<?php if ( is_user_logged_in() ) : ?>
+	
+				<li>
+					<a href="<?php bp_forum_topic_new_reply_link(); ?>" class="new-reply-link"><?php _e( 'New Reply', 'buddypress' ); ?></a>
+				</li>
+	
 			<?php endif; ?>
-
-			<?php if ( bp_group_is_admin() || bp_group_is_mod() || bp_get_the_topic_is_mine() ) : ?>
-
-				<div class="last admin-links">
-
-					<?php bp_the_topic_admin_links() ?>
-
-				</div>
-
+	
+			<?php if ( bp_forums_has_directory() ) : ?>
+	
+				<li>
+					<a href="<?php bp_forums_directory_permalink(); ?>"><?php _e( 'Forum Directory', 'buddypress'); ?></a>
+				</li>
+	
 			<?php endif; ?>
+	
+		</ul>
+	</div>
+	
+	<div id="topic-meta">
+		<h3><?php bp_the_topic_title(); ?> (<?php bp_the_topic_total_post_count(); ?>)</h3>
+	
+		<?php if ( bp_forum_topic_has_tags() ) : ?>
+	
+			<div class="topic-tags">
+	
+				<?php _e( 'Topic tags:', 'buddypress' ); ?> <?php bp_forum_topic_tag_list(); ?>
+	
+			</div>
+	
+		<?php endif; ?>
+	
+		<?php if ( bp_group_is_admin() || bp_group_is_mod() || bp_get_the_topic_is_mine() ) : ?>
+	
+			<div class="last admin-links">
+	
+				<?php bp_the_topic_admin_links(); ?>
+	
+			</div>
+	
+		<?php endif; ?>
+	
+		<?php do_action( 'bp_group_forum_topic_meta' ); ?>
+	
+	</div>
 
-			<?php do_action( 'bp_group_forum_topic_meta' ); ?>
 
-		</div>
+	<?php if ( bp_has_forum_topic_posts() ) : ?>
 
 		<div class="pagination no-ajax">
 
 			<div id="post-count-top" class="pag-count">
 
-				<?php bp_the_topic_pagination_count() ?>
+				<?php bp_the_topic_pagination_count(); ?>
 
 			</div>
 
 			<div class="pagination-links" id="topic-pag-top">
 
-				<?php bp_the_topic_pagination() ?>
+				<?php bp_the_topic_pagination(); ?>
 
 			</div>
 
 		</div>
 
-		<?php do_action( 'bp_before_group_forum_topic_posts' ) ?>
+		<?php do_action( 'bp_before_group_forum_topic_posts' ); ?>
 
 		<ul id="topic-post-list" class="item-list" role="main">
 			<?php while ( bp_forum_topic_posts() ) : bp_the_forum_topic_post(); ?>
 
-				<li id="post-<?php bp_the_topic_post_id() ?>" class="<?php bp_the_topic_post_css_class() ?>">
+				<li id="post-<?php bp_the_topic_post_id(); ?>" class="<?php bp_the_topic_post_css_class(); ?>">
 					<div class="poster-meta">
-						<a href="<?php bp_the_topic_post_poster_link() ?>">
-							<?php bp_the_topic_post_poster_avatar( 'width=40&height=40' ) ?>
+						<a href="<?php bp_the_topic_post_poster_link(); ?>">
+							<?php bp_the_topic_post_poster_avatar( 'width=40&height=40' ); ?>
 						</a>
-						<?php echo sprintf( __( '%1$s said %2$s:', 'buddypress' ), bp_get_the_topic_post_poster_name(), bp_get_the_topic_post_time_since() ) ?>
+						<?php echo sprintf( __( '%1$s said %2$s:', 'buddypress' ), bp_get_the_topic_post_poster_name(), bp_get_the_topic_post_time_since() ); ?>
 					</div>
 
 					<div class="post-content">
-						<?php bp_the_topic_post_content() ?>
+						<?php bp_the_topic_post_content(); ?>
 					</div>
 
 					<div class="admin-links">
 						<?php if ( bp_group_is_admin() || bp_group_is_mod() || bp_get_the_topic_post_is_mine() ) : ?>
-							<?php bp_the_topic_post_admin_links() ?>
+							<?php bp_the_topic_post_admin_links(); ?>
 						<?php endif; ?>
 
 						<?php do_action( 'bp_group_forum_post_meta' ); ?>
 
-						<a href="#post-<?php bp_the_topic_post_id() ?>" title="<?php _e( 'Permanent link to this post', 'buddypress' ) ?>">#</a>
+						<a href="#post-<?php bp_the_topic_post_id(); ?>" title="<?php _e( 'Permanent link to this post', 'buddypress' ); ?>">#</a>
 					</div>
 				</li>
 
 			<?php endwhile; ?>
 		</ul><!-- #topic-post-list -->
 
-		<?php do_action( 'bp_after_group_forum_topic_posts' ) ?>
+		<?php do_action( 'bp_after_group_forum_topic_posts' ); ?>
 
 		<div class="pagination no-ajax">
 
 			<div id="post-count-bottom" class="pag-count">
-				<?php bp_the_topic_pagination_count() ?>
+				<?php bp_the_topic_pagination_count(); ?>
 			</div>
 
 			<div class="pagination-links" id="topic-pag-bottom">
-				<?php bp_the_topic_pagination() ?>
+				<?php bp_the_topic_pagination(); ?>
 			</div>
 
 		</div>
 
-		<?php if ( ( is_user_logged_in() && 'public' == bp_get_group_status() ) || bp_group_is_member() ) : ?>
-
-			<?php if ( bp_get_the_topic_is_last_page() ) : ?>
+	<?php else: ?>
+	
+		<div id="message" class="info">
+			<p><?php _e( 'There are no posts for this topic.', 'buddypress' ); ?></p>
+		</div>
+	
+	<?php endif;?>
 
-				<?php if ( bp_get_the_topic_is_topic_open() && !bp_group_is_user_banned() ) : ?>
+	<?php if ( ( is_user_logged_in() && 'public' == bp_get_group_status() ) || bp_group_is_member() ) : ?>
 
-					<div id="post-topic-reply">
-						<p id="post-reply"></p>
+		<?php if ( bp_get_the_topic_is_last_page() ) : ?>
 
-						<?php if ( bp_groups_auto_join() && !bp_group_is_member() ) : ?>
-							<p><?php _e( 'You will auto join this group when you reply to this topic.', 'buddypress' ) ?></p>
-						<?php endif; ?>
+			<?php if ( bp_get_the_topic_is_topic_open() && !bp_group_is_user_banned() ) : ?>
 
-						<?php do_action( 'groups_forum_new_reply_before' ) ?>
+				<div id="post-topic-reply">
+					<p id="post-reply"></p>
 
-						<h4><?php _e( 'Add a reply:', 'buddypress' ) ?></h4>
+					<?php if ( bp_groups_auto_join() && !bp_group_is_member() ) : ?>
+						<p><?php _e( 'You will auto join this group when you reply to this topic.', 'buddypress' ); ?></p>
+					<?php endif; ?>
 
-						<textarea name="reply_text" id="reply_text"></textarea>
+					<?php do_action( 'groups_forum_new_reply_before' ); ?>
 
-						<div class="submit">
-							<input type="submit" name="submit_reply" id="submit" value="<?php _e( 'Post Reply', 'buddypress' ) ?>" />
-						</div>
+					<h4><?php _e( 'Add a reply:', 'buddypress' ); ?></h4>
 
-						<?php do_action( 'groups_forum_new_reply_after' ) ?>
+					<textarea name="reply_text" id="reply_text"></textarea>
 
-						<?php wp_nonce_field( 'bp_forums_new_reply' ) ?>
+					<div class="submit">
+						<input type="submit" name="submit_reply" id="submit" value="<?php _e( 'Post Reply', 'buddypress' ); ?>" />
 					</div>
 
-				<?php elseif ( !bp_group_is_user_banned() ) : ?>
+					<?php do_action( 'groups_forum_new_reply_after' ); ?>
 
-					<div id="message" class="info">
-						<p><?php _e( 'This topic is closed, replies are no longer accepted.', 'buddypress' ) ?></p>
-					</div>
+					<?php wp_nonce_field( 'bp_forums_new_reply' ); ?>
+				</div>
 
-				<?php endif; ?>
+			<?php elseif ( !bp_group_is_user_banned() ) : ?>
+
+				<div id="message" class="info">
+					<p><?php _e( 'This topic is closed, replies are no longer accepted.', 'buddypress' ); ?></p>
+				</div>
 
 			<?php endif; ?>
 
 		<?php endif; ?>
 
-	</form><!-- #forum-topic-form -->
-
-<?php else: ?>
-
-	<div id="message" class="info">
-		<p><?php _e( 'There are no posts for this topic.', 'buddypress' ) ?></p>
-	</div>
+	<?php endif; ?>
 
-<?php endif;?>
+</form><!-- #forum-topic-form -->
 
-<?php do_action( 'bp_after_group_forum_topic' ) ?>
+<?php do_action( 'bp_after_group_forum_topic' ); ?>
diff --git a/wp-content/plugins/buddypress/bp-themes/bp-default/groups/single/group-header.php b/wp-content/plugins/buddypress/bp-themes/bp-default/groups/single/group-header.php
index 7d7263cd7dd8ff296464a38e287ed27696074061..36fb5fa7caf59fe9bc05d69afe6614faa9f5c43f 100644
--- a/wp-content/plugins/buddypress/bp-themes/bp-default/groups/single/group-header.php
+++ b/wp-content/plugins/buddypress/bp-themes/bp-default/groups/single/group-header.php
@@ -17,7 +17,7 @@ do_action( 'bp_before_group_header' );
 		if ( bp_group_has_moderators() ) :
 			do_action( 'bp_before_group_menu_mods' ); ?>
 
-			<h3><?php _e( 'Group Mods' , 'buddypress' ) ?></h3>
+			<h3><?php _e( 'Group Mods' , 'buddypress' ); ?></h3>
 
 			<?php bp_group_list_mods();
 
diff --git a/wp-content/plugins/buddypress/bp-themes/bp-default/groups/single/home.php b/wp-content/plugins/buddypress/bp-themes/bp-default/groups/single/home.php
index b02d55c1357a5ef6fcd8b087c2396fdf6729046b..5fee65574782ce952183ec06c695abad4c2b2d12 100644
--- a/wp-content/plugins/buddypress/bp-themes/bp-default/groups/single/home.php
+++ b/wp-content/plugins/buddypress/bp-themes/bp-default/groups/single/home.php
@@ -5,7 +5,7 @@
 
 			<?php if ( bp_has_groups() ) : while ( bp_groups() ) : bp_the_group(); ?>
 
-			<?php do_action( 'bp_before_group_home_content' ) ?>
+			<?php do_action( 'bp_before_group_home_content' ); ?>
 
 			<div id="item-header" role="complementary">
 
diff --git a/wp-content/plugins/buddypress/bp-themes/bp-default/groups/single/members.php b/wp-content/plugins/buddypress/bp-themes/bp-default/groups/single/members.php
index 3d9c7f5c6a05a0c7239d8c6d1d1141dd93f87709..fb7b4e2e99f01338455cf2b106dc5d44ba6fbcaa 100644
--- a/wp-content/plugins/buddypress/bp-themes/bp-default/groups/single/members.php
+++ b/wp-content/plugins/buddypress/bp-themes/bp-default/groups/single/members.php
@@ -63,7 +63,7 @@
 
 	<?php do_action( 'bp_after_group_members_list' ); ?>
 
-	<div id="pag-bottom" class="pagination">
+	<div id="pag-bottom" class="pagination no-ajax">
 
 		<div class="pag-count" id="member-count-bottom">
 
diff --git a/wp-content/plugins/buddypress/bp-themes/bp-default/groups/single/plugins.php b/wp-content/plugins/buddypress/bp-themes/bp-default/groups/single/plugins.php
index 5579b3421a2b789e46bac32acb69a7500cc5001e..3bad868789046da0bfffb61b433d55caadfaecdf 100644
--- a/wp-content/plugins/buddypress/bp-themes/bp-default/groups/single/plugins.php
+++ b/wp-content/plugins/buddypress/bp-themes/bp-default/groups/single/plugins.php
@@ -1,41 +1,41 @@
-<?php get_header( 'buddypress' ) ?>
+<?php get_header( 'buddypress' ); ?>
 
 	<div id="content">
 		<div class="padder">
 			<?php if ( bp_has_groups() ) : while ( bp_groups() ) : bp_the_group(); ?>
 
-			<?php do_action( 'bp_before_group_plugin_template' ) ?>
+			<?php do_action( 'bp_before_group_plugin_template' ); ?>
 
 			<div id="item-header">
-				<?php locate_template( array( 'groups/single/group-header.php' ), true ) ?>
+				<?php locate_template( array( 'groups/single/group-header.php' ), true ); ?>
 			</div><!-- #item-header -->
 
 			<div id="item-nav">
 				<div class="item-list-tabs no-ajax" id="object-nav" role="navigation">
 					<ul>
-						<?php bp_get_options_nav() ?>
+						<?php bp_get_options_nav(); ?>
 
-						<?php do_action( 'bp_group_plugin_options_nav' ) ?>
+						<?php do_action( 'bp_group_plugin_options_nav' ); ?>
 					</ul>
 				</div>
 			</div><!-- #item-nav -->
 
 			<div id="item-body">
 
-				<?php do_action( 'bp_before_group_body' ) ?>
+				<?php do_action( 'bp_before_group_body' ); ?>
 
-				<?php do_action( 'bp_template_content' ) ?>
+				<?php do_action( 'bp_template_content' ); ?>
 
-				<?php do_action( 'bp_after_group_body' ) ?>
+				<?php do_action( 'bp_after_group_body' ); ?>
 			</div><!-- #item-body -->
 
-			<?php do_action( 'bp_after_group_plugin_template' ) ?>
+			<?php do_action( 'bp_after_group_plugin_template' ); ?>
 
 			<?php endwhile; endif; ?>
 
 		</div><!-- .padder -->
 	</div><!-- #content -->
 
-	<?php get_sidebar( 'buddypress' ) ?>
+	<?php get_sidebar( 'buddypress' ); ?>
 
-<?php get_footer( 'buddypress' ) ?>
\ No newline at end of file
+<?php get_footer( 'buddypress' ); ?>
\ No newline at end of file
diff --git a/wp-content/plugins/buddypress/bp-themes/bp-default/groups/single/request-membership.php b/wp-content/plugins/buddypress/bp-themes/bp-default/groups/single/request-membership.php
index 55b548d37ce96e0a9eafe96ce13e6f32a3b0b6f6..66e0dc9559c7b2f41866a0b3d1db690db17356ad 100644
--- a/wp-content/plugins/buddypress/bp-themes/bp-default/groups/single/request-membership.php
+++ b/wp-content/plugins/buddypress/bp-themes/bp-default/groups/single/request-membership.php
@@ -1,18 +1,18 @@
-<?php do_action( 'bp_before_group_request_membership_content' ) ?>
+<?php do_action( 'bp_before_group_request_membership_content' ); ?>
 
 <?php if ( !bp_group_has_requested_membership() ) : ?>
 	<p><?php printf( __( "You are requesting to become a member of the group '%s'.", "buddypress" ), bp_get_group_name( false ) ); ?></p>
 
-	<form action="<?php bp_group_form_action('request-membership') ?>" method="post" name="request-membership-form" id="request-membership-form" class="standard-form">
+	<form action="<?php bp_group_form_action('request-membership'); ?>" method="post" name="request-membership-form" id="request-membership-form" class="standard-form">
 		<label for="group-request-membership-comments"><?php _e( 'Comments (optional)', 'buddypress' ); ?></label>
 		<textarea name="group-request-membership-comments" id="group-request-membership-comments"></textarea>
 
-		<?php do_action( 'bp_group_request_membership_content' ) ?>
+		<?php do_action( 'bp_group_request_membership_content' ); ?>
 
-		<p><input type="submit" name="group-request-send" id="group-request-send" value="<?php _e( 'Send Request', 'buddypress' ) ?>" />
+		<p><input type="submit" name="group-request-send" id="group-request-send" value="<?php _e( 'Send Request', 'buddypress' ); ?>" />
 
-		<?php wp_nonce_field( 'groups_request_membership' ) ?>
+		<?php wp_nonce_field( 'groups_request_membership' ); ?>
 	</form><!-- #request-membership-form -->
 <?php endif; ?>
 
-<?php do_action( 'bp_after_group_request_membership_content' ) ?>
+<?php do_action( 'bp_after_group_request_membership_content' ); ?>
diff --git a/wp-content/plugins/buddypress/bp-themes/bp-default/groups/single/send-invites.php b/wp-content/plugins/buddypress/bp-themes/bp-default/groups/single/send-invites.php
index c6562e37503ad7cd4cb257ac2e76973fa534f204..d83c754bd08d5cf97b33f78f39bab40e56f00d2a 100644
--- a/wp-content/plugins/buddypress/bp-themes/bp-default/groups/single/send-invites.php
+++ b/wp-content/plugins/buddypress/bp-themes/bp-default/groups/single/send-invites.php
@@ -1,17 +1,17 @@
-<?php do_action( 'bp_before_group_send_invites_content' ) ?>
+<?php do_action( 'bp_before_group_send_invites_content' ); ?>
 
 <?php if ( bp_get_total_friend_count( bp_loggedin_user_id() ) ) : ?>
 
-	<form action="<?php bp_group_send_invite_form_action() ?>" method="post" id="send-invite-form" class="standard-form" role="main">
+	<form action="<?php bp_group_send_invite_form_action(); ?>" method="post" id="send-invite-form" class="standard-form" role="main">
 
 		<div class="left-menu">
 
 			<div id="invite-list">
 				<ul>
-					<?php bp_new_group_invite_friend_list() ?>
+					<?php bp_new_group_invite_friend_list(); ?>
 				</ul>
 
-				<?php wp_nonce_field( 'groups_invite_uninvite_user', '_wpnonce_invite_uninvite_user' ) ?>
+				<?php wp_nonce_field( 'groups_invite_uninvite_user', '_wpnonce_invite_uninvite_user' ); ?>
 			</div>
 
 		</div><!-- .left-menu -->
@@ -22,7 +22,7 @@
 				<p><?php _e('Select people to invite from your friends list.', 'buddypress'); ?></p>
 			</div>
 
-			<?php do_action( 'bp_before_group_send_invites_list' ) ?>
+			<?php do_action( 'bp_before_group_send_invites_list' ); ?>
 
 			<?php /* The ID 'friend-list' is important for AJAX support. */ ?>
 			<ul id="friend-list" class="item-list">
@@ -30,18 +30,18 @@
 
 				<?php while ( bp_group_invites() ) : bp_group_the_invite(); ?>
 
-					<li id="<?php bp_group_invite_item_id() ?>">
-						<?php bp_group_invite_user_avatar() ?>
+					<li id="<?php bp_group_invite_item_id(); ?>">
+						<?php bp_group_invite_user_avatar(); ?>
 
-						<h4><?php bp_group_invite_user_link() ?></h4>
-						<span class="activity"><?php bp_group_invite_user_last_active() ?></span>
+						<h4><?php bp_group_invite_user_link(); ?></h4>
+						<span class="activity"><?php bp_group_invite_user_last_active(); ?></span>
 
-						<?php do_action( 'bp_group_send_invites_item' ) ?>
+						<?php do_action( 'bp_group_send_invites_item' ); ?>
 
 						<div class="action">
-							<a class="button remove" href="<?php bp_group_invite_user_remove_invite_url() ?>" id="<?php bp_group_invite_item_id() ?>"><?php _e( 'Remove Invite', 'buddypress' ) ?></a>
+							<a class="button remove" href="<?php bp_group_invite_user_remove_invite_url(); ?>" id="<?php bp_group_invite_item_id(); ?>"><?php _e( 'Remove Invite', 'buddypress' ); ?></a>
 
-							<?php do_action( 'bp_group_send_invites_item_action' ) ?>
+							<?php do_action( 'bp_group_send_invites_item_action' ); ?>
 						</div>
 					</li>
 
@@ -50,20 +50,20 @@
 			<?php endif; ?>
 			</ul><!-- #friend-list -->
 
-			<?php do_action( 'bp_after_group_send_invites_list' ) ?>
+			<?php do_action( 'bp_after_group_send_invites_list' ); ?>
 
 		</div><!-- .main-column -->
 
 		<div class="clear"></div>
 
 		<div class="submit">
-			<input type="submit" name="submit" id="submit" value="<?php _e( 'Send Invites', 'buddypress' ) ?>" />
+			<input type="submit" name="submit" id="submit" value="<?php _e( 'Send Invites', 'buddypress' ); ?>" />
 		</div>
 
-		<?php wp_nonce_field( 'groups_send_invites', '_wpnonce_send_invites') ?>
+		<?php wp_nonce_field( 'groups_send_invites', '_wpnonce_send_invites'); ?>
 
 		<?php /* This is important, don't forget it */ ?>
-		<input type="hidden" name="group_id" id="group_id" value="<?php bp_group_id() ?>" />
+		<input type="hidden" name="group_id" id="group_id" value="<?php bp_group_id(); ?>" />
 
 	</form><!-- #send-invite-form -->
 
@@ -75,4 +75,4 @@
 
 <?php endif; ?>
 
-<?php do_action( 'bp_after_group_send_invites_content' ) ?>
+<?php do_action( 'bp_after_group_send_invites_content' ); ?>
diff --git a/wp-content/plugins/buddypress/bp-themes/bp-default/header.php b/wp-content/plugins/buddypress/bp-themes/bp-default/header.php
index 7835d115e370f963d8fd933808971865b3ef8cf7..4753889bb36d4f3462aab7ea2e3ab851cdfc89fa 100644
--- a/wp-content/plugins/buddypress/bp-themes/bp-default/header.php
+++ b/wp-content/plugins/buddypress/bp-themes/bp-default/header.php
@@ -2,43 +2,38 @@
 
 <html xmlns="http://www.w3.org/1999/xhtml" <?php language_attributes(); ?>>
 	<head profile="http://gmpg.org/xfn/11">
-		<meta http-equiv="Content-Type" content="<?php bloginfo( 'html_type' ) ?>; charset=<?php bloginfo( 'charset' ) ?>" />
+		<meta http-equiv="Content-Type" content="<?php bloginfo( 'html_type' ); ?>; charset=<?php bloginfo( 'charset' ); ?>" />
+		<?php if ( current_theme_supports( 'bp-default-responsive' ) ) : ?><meta name="viewport" content="width=device-width, initial-scale=1.0" /><?php endif; ?>
 		<title><?php wp_title( '|', true, 'right' ); bloginfo( 'name' ); ?></title>
+		<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>" />
 
-		<?php do_action( 'bp_head' ) ?>
+		<?php do_action( 'bp_head' ); ?>
+		<?php wp_head(); ?>
 
-		<link rel="pingback" href="<?php bloginfo( 'pingback_url' ) ?>" />
-
-		<?php
-			if ( is_singular() && bp_is_blog_page() && get_option( 'thread_comments' ) )
-				wp_enqueue_script( 'comment-reply' );
-
-			wp_head();
-		?>
 	</head>
 
-	<body <?php body_class() ?> id="bp-default">
+	<body <?php body_class(); ?> id="bp-default">
 
-		<?php do_action( 'bp_before_header' ) ?>
+		<?php do_action( 'bp_before_header' ); ?>
 
 		<div id="header">
 			<div id="search-bar" role="search">
 				<div class="padder">
 					<h1 id="logo" role="banner"><a href="<?php echo home_url(); ?>" title="<?php _ex( 'Home', 'Home page banner link title', 'buddypress' ); ?>"><?php bp_site_name(); ?></a></h1>
 
-						<form action="<?php echo bp_search_form_action() ?>" method="post" id="search-form">
+						<form action="<?php echo bp_search_form_action(); ?>" method="post" id="search-form">
 							<label for="search-terms" class="accessibly-hidden"><?php _e( 'Search for:', 'buddypress' ); ?></label>
 							<input type="text" id="search-terms" name="search-terms" value="<?php echo isset( $_REQUEST['s'] ) ? esc_attr( $_REQUEST['s'] ) : ''; ?>" />
 
-							<?php echo bp_search_form_type_select() ?>
+							<?php echo bp_search_form_type_select(); ?>
 
-							<input type="submit" name="search-submit" id="search-submit" value="<?php _e( 'Search', 'buddypress' ) ?>" />
+							<input type="submit" name="search-submit" id="search-submit" value="<?php _e( 'Search', 'buddypress' ); ?>" />
 
-							<?php wp_nonce_field( 'bp_search_form' ) ?>
+							<?php wp_nonce_field( 'bp_search_form' ); ?>
 
 						</form><!-- #search-form -->
 
-				<?php do_action( 'bp_search_login_bar' ) ?>
+				<?php do_action( 'bp_search_login_bar' ); ?>
 
 				</div><!-- .padder -->
 			</div><!-- #search-bar -->
@@ -47,11 +42,11 @@
 				<?php wp_nav_menu( array( 'container' => false, 'menu_id' => 'nav', 'theme_location' => 'primary', 'fallback_cb' => 'bp_dtheme_main_nav' ) ); ?>
 			</div>
 
-			<?php do_action( 'bp_header' ) ?>
+			<?php do_action( 'bp_header' ); ?>
 
 		</div><!-- #header -->
 
-		<?php do_action( 'bp_after_header' ) ?>
-		<?php do_action( 'bp_before_container' ) ?>
+		<?php do_action( 'bp_after_header'     ); ?>
+		<?php do_action( 'bp_before_container' ); ?>
 
 		<div id="container">
diff --git a/wp-content/plugins/buddypress/bp-themes/bp-default/index.php b/wp-content/plugins/buddypress/bp-themes/bp-default/index.php
index 80110247b1e09186ba234895f44a113d43dba537..33c8d0f2da3d45fb5d8d10f4bca613e6b440ff49 100644
--- a/wp-content/plugins/buddypress/bp-themes/bp-default/index.php
+++ b/wp-content/plugins/buddypress/bp-themes/bp-default/index.php
@@ -1,11 +1,11 @@
-<?php get_header() ?>
+<?php get_header(); ?>
 
 	<div id="content">
 		<div class="padder">
 
-		<?php do_action( 'bp_before_blog_home' ) ?>
+		<?php do_action( 'bp_before_blog_home' ); ?>
 
-		<?php do_action( 'template_notices' ) ?>
+		<?php do_action( 'template_notices' ); ?>
 
 		<div class="page" id="blog-latest" role="main">
 
@@ -15,13 +15,13 @@
 
 				<?php while (have_posts()) : the_post(); ?>
 
-					<?php do_action( 'bp_before_blog_post' ) ?>
+					<?php do_action( 'bp_before_blog_post' ); ?>
 
 					<div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
 
 						<div class="author-box">
 							<?php echo get_avatar( get_the_author_meta( 'user_email' ), '50' ); ?>
-							<p><?php printf( _x( 'by %s', 'Post written by...', 'buddypress' ), bp_core_get_userlink( $post->post_author ) ) ?></p>
+							<p><?php printf( _x( 'by %s', 'Post written by...', 'buddypress' ), bp_core_get_userlink( $post->post_author ) ); ?></p>
 
 							<?php if ( is_sticky() ) : ?>
 								<span class="activity sticky-post"><?php _ex( 'Featured', 'Sticky post', 'buddypress' ); ?></span>
@@ -29,7 +29,7 @@
 						</div>
 
 						<div class="post-content">
-							<h2 class="posttitle"><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php _e( 'Permanent Link to', 'buddypress' ) ?> <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>
+							<h2 class="posttitle"><a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php _e( 'Permanent Link to', 'buddypress' ); ?> <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>
 
 							<p class="date"><?php printf( __( '%1$s <span>in %2$s</span>', 'buddypress' ), get_the_date(), get_the_category_list( ', ' ) ); ?></p>
 
@@ -43,7 +43,7 @@
 
 					</div>
 
-					<?php do_action( 'bp_after_blog_post' ) ?>
+					<?php do_action( 'bp_after_blog_post' ); ?>
 
 				<?php endwhile; ?>
 
@@ -51,19 +51,19 @@
 
 			<?php else : ?>
 
-				<h2 class="center"><?php _e( 'Not Found', 'buddypress' ) ?></h2>
-				<p class="center"><?php _e( 'Sorry, but you are looking for something that isn\'t here.', 'buddypress' ) ?></p>
+				<h2 class="center"><?php _e( 'Not Found', 'buddypress' ); ?></h2>
+				<p class="center"><?php _e( 'Sorry, but you are looking for something that isn\'t here.', 'buddypress' ); ?></p>
 
-				<?php get_search_form() ?>
+				<?php get_search_form(); ?>
 
 			<?php endif; ?>
 		</div>
 
-		<?php do_action( 'bp_after_blog_home' ) ?>
+		<?php do_action( 'bp_after_blog_home' ); ?>
 
 		</div><!-- .padder -->
 	</div><!-- #content -->
 
-	<?php get_sidebar() ?>
+	<?php get_sidebar(); ?>
 
-<?php get_footer() ?>
+<?php get_footer(); ?>
diff --git a/wp-content/plugins/buddypress/bp-themes/bp-default/license.txt b/wp-content/plugins/buddypress/bp-themes/bp-default/license.txt
index b5fcfa6e7a5343eec02d2d25805773efbdf65121..888220587e12015cf35eb05c5d54fd341d11d4cb 100644
--- a/wp-content/plugins/buddypress/bp-themes/bp-default/license.txt
+++ b/wp-content/plugins/buddypress/bp-themes/bp-default/license.txt
@@ -1,280 +1,280 @@
-		    GNU GENERAL PUBLIC LICENSE
-		       Version 2, June 1991
-
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.
-                          675 Mass Ave, Cambridge, MA 02139, USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
-			    Preamble
-
-  The licenses for most software are designed to take away your
-freedom to share and change it.  By contrast, the GNU General Public
-License is intended to guarantee your freedom to share and change free
-software--to make sure the software is free for all its users.  This
-General Public License applies to most of the Free Software
-Foundation's software and to any other program whose authors commit to
-using it.  (Some other Free Software Foundation software is covered by
-the GNU Library General Public License instead.)  You can apply it to
-your programs, too.
-
-  When we speak of free software, we are referring to freedom, not
-price.  Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-this service if you wish), that you receive source code or can get it
-if you want it, that you can change the software or use pieces of it
-in new free programs; and that you know you can do these things.
-
-  To protect your rights, we need to make restrictions that forbid
-anyone to deny you these rights or to ask you to surrender the rights.
-These restrictions translate to certain responsibilities for you if you
-distribute copies of the software, or if you modify it.
-
-  For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must give the recipients all the rights that
-you have.  You must make sure that they, too, receive or can get the
-source code.  And you must show them these terms so they know their
-rights.
-
-  We protect your rights with two steps: (1) copyright the software, and
-(2) offer you this license which gives you legal permission to copy,
-distribute and/or modify the software.
-
-  Also, for each author's protection and ours, we want to make certain
-that everyone understands that there is no warranty for this free
-software.  If the software is modified by someone else and passed on, we
-want its recipients to know that what they have is not the original, so
-that any problems introduced by others will not reflect on the original
-authors' reputations.
-
-  Finally, any free program is threatened constantly by software
-patents.  We wish to avoid the danger that redistributors of a free
-program will individually obtain patent licenses, in effect making the
-program proprietary.  To prevent this, we have made it clear that any
-patent must be licensed for everyone's free use or not licensed at all.
-
-  The precise terms and conditions for copying, distribution and
-modification follow.
-
-		    GNU GENERAL PUBLIC LICENSE
-   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
-  0. This License applies to any program or other work which contains
-a notice placed by the copyright holder saying it may be distributed
-under the terms of this General Public License.  The "Program", below,
-refers to any such program or work, and a "work based on the Program"
-means either the Program or any derivative work under copyright law:
-that is to say, a work containing the Program or a portion of it,
-either verbatim or with modifications and/or translated into another
-language.  (Hereinafter, translation is included without limitation in
-the term "modification".)  Each licensee is addressed as "you".
-
-Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope.  The act of
-running the Program is not restricted, and the output from the Program
-is covered only if its contents constitute a work based on the
-Program (independent of having been made by running the Program).
-Whether that is true depends on what the Program does.
-
-  1. You may copy and distribute verbatim copies of the Program's
-source code as you receive it, in any medium, provided that you
-conspicuously and appropriately publish on each copy an appropriate
-copyright notice and disclaimer of warranty; keep intact all the
-notices that refer to this License and to the absence of any warranty;
-and give any other recipients of the Program a copy of this License
-along with the Program.
-
-You may charge a fee for the physical act of transferring a copy, and
-you may at your option offer warranty protection in exchange for a fee.
-
-  2. You may modify your copy or copies of the Program or any portion
-of it, thus forming a work based on the Program, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
-    a) You must cause the modified files to carry prominent notices
-    stating that you changed the files and the date of any change.
-
-    b) You must cause any work that you distribute or publish, that in
-    whole or in part contains or is derived from the Program or any
-    part thereof, to be licensed as a whole at no charge to all third
-    parties under the terms of this License.
-
-    c) If the modified program normally reads commands interactively
-    when run, you must cause it, when started running for such
-    interactive use in the most ordinary way, to print or display an
-    announcement including an appropriate copyright notice and a
-    notice that there is no warranty (or else, saying that you provide
-    a warranty) and that users may redistribute the program under
-    these conditions, and telling the user how to view a copy of this
-    License.  (Exception: if the Program itself is interactive but
-    does not normally print such an announcement, your work based on
-    the Program is not required to print an announcement.)
-
-These requirements apply to the modified work as a whole.  If
-identifiable sections of that work are not derived from the Program,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works.  But when you
-distribute the same sections as part of a whole which is a work based
-on the Program, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote it.
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Program.
-
-In addition, mere aggregation of another work not based on the Program
-with the Program (or with a work based on the Program) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
-  3. You may copy and distribute the Program (or a work based on it,
-under Section 2) in object code or executable form under the terms of
-Sections 1 and 2 above provided that you also do one of the following:
-
-    a) Accompany it with the complete corresponding machine-readable
-    source code, which must be distributed under the terms of Sections
-    1 and 2 above on a medium customarily used for software interchange; or,
-
-    b) Accompany it with a written offer, valid for at least three
-    years, to give any third party, for a charge no more than your
-    cost of physically performing source distribution, a complete
-    machine-readable copy of the corresponding source code, to be
-    distributed under the terms of Sections 1 and 2 above on a medium
-    customarily used for software interchange; or,
-
-    c) Accompany it with the information you received as to the offer
-    to distribute corresponding source code.  (This alternative is
-    allowed only for noncommercial distribution and only if you
-    received the program in object code or executable form with such
-    an offer, in accord with Subsection b above.)
-
-The source code for a work means the preferred form of the work for
-making modifications to it.  For an executable work, complete source
-code means all the source code for all modules it contains, plus any
-associated interface definition files, plus the scripts used to
-control compilation and installation of the executable.  However, as a
-special exception, the source code distributed need not include
-anything that is normally distributed (in either source or binary
-form) with the major components (compiler, kernel, and so on) of the
-operating system on which the executable runs, unless that component
-itself accompanies the executable.
-
-If distribution of executable or object code is made by offering
-access to copy from a designated place, then offering equivalent
-access to copy the source code from the same place counts as
-distribution of the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
-  4. You may not copy, modify, sublicense, or distribute the Program
-except as expressly provided under this License.  Any attempt
-otherwise to copy, modify, sublicense or distribute the Program is
-void, and will automatically terminate your rights under this License.
-However, parties who have received copies, or rights, from you under
-this License will not have their licenses terminated so long as such
-parties remain in full compliance.
-
-  5. You are not required to accept this License, since you have not
-signed it.  However, nothing else grants you permission to modify or
-distribute the Program or its derivative works.  These actions are
-prohibited by law if you do not accept this License.  Therefore, by
-modifying or distributing the Program (or any work based on the
-Program), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Program or works based on it.
-
-  6. Each time you redistribute the Program (or any work based on the
-Program), the recipient automatically receives a license from the
-original licensor to copy, distribute or modify the Program subject to
-these terms and conditions.  You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties to
-this License.
-
-  7. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License.  If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Program at all.  For example, if a patent
-license would not permit royalty-free redistribution of the Program by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Program.
-
-If any portion of this section is held invalid or unenforceable under
-any particular circumstance, the balance of the section is intended to
-apply and the section as a whole is intended to apply in other
-circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system, which is
-implemented by public license practices.  Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-
-  8. If the distribution and/or use of the Program is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Program under this License
-may add an explicit geographical distribution limitation excluding
-those countries, so that distribution is permitted only in or among
-countries not thus excluded.  In such case, this License incorporates
-the limitation as if written in the body of this License.
-
-  9. The Free Software Foundation may publish revised and/or new versions
-of the General Public License from time to time.  Such new versions will
-be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
-Each version is given a distinguishing version number.  If the Program
-specifies a version number of this License which applies to it and "any
-later version", you have the option of following the terms and conditions
-either of that version or of any later version published by the Free
-Software Foundation.  If the Program does not specify a version number of
-this License, you may choose any version ever published by the Free Software
-Foundation.
-
-  10. If you wish to incorporate parts of the Program into other free
-programs whose distribution conditions are different, write to the author
-to ask for permission.  For software which is copyrighted by the Free
-Software Foundation, write to the Free Software Foundation; we sometimes
-make exceptions for this.  Our decision will be guided by the two goals
-of preserving the free status of all derivatives of our free software and
-of promoting the sharing and reuse of software generally.
-
-			    NO WARRANTY
-
-  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
-FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
-OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
-PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
-OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
-TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
-PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
-REPAIR OR CORRECTION.
-
-  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
-REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
-INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
-OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
-TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
-YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
-PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGES.
-
-		     END OF TERMS AND CONDITIONS
-
+		    GNU GENERAL PUBLIC LICENSE
+		       Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+                          675 Mass Ave, Cambridge, MA 02139, USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+			    Preamble
+
+  The licenses for most software are designed to take away your
+freedom to share and change it.  By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users.  This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it.  (Some other Free Software Foundation software is covered by
+the GNU Library General Public License instead.)  You can apply it to
+your programs, too.
+
+  When we speak of free software, we are referring to freedom, not
+price.  Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+  To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+  For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have.  You must make sure that they, too, receive or can get the
+source code.  And you must show them these terms so they know their
+rights.
+
+  We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+  Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software.  If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+  Finally, any free program is threatened constantly by software
+patents.  We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary.  To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.
+
+		    GNU GENERAL PUBLIC LICENSE
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+  0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License.  The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language.  (Hereinafter, translation is included without limitation in
+the term "modification".)  Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope.  The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+  1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+  2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+    a) You must cause the modified files to carry prominent notices
+    stating that you changed the files and the date of any change.
+
+    b) You must cause any work that you distribute or publish, that in
+    whole or in part contains or is derived from the Program or any
+    part thereof, to be licensed as a whole at no charge to all third
+    parties under the terms of this License.
+
+    c) If the modified program normally reads commands interactively
+    when run, you must cause it, when started running for such
+    interactive use in the most ordinary way, to print or display an
+    announcement including an appropriate copyright notice and a
+    notice that there is no warranty (or else, saying that you provide
+    a warranty) and that users may redistribute the program under
+    these conditions, and telling the user how to view a copy of this
+    License.  (Exception: if the Program itself is interactive but
+    does not normally print such an announcement, your work based on
+    the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole.  If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works.  But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+  3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+    a) Accompany it with the complete corresponding machine-readable
+    source code, which must be distributed under the terms of Sections
+    1 and 2 above on a medium customarily used for software interchange; or,
+
+    b) Accompany it with a written offer, valid for at least three
+    years, to give any third party, for a charge no more than your
+    cost of physically performing source distribution, a complete
+    machine-readable copy of the corresponding source code, to be
+    distributed under the terms of Sections 1 and 2 above on a medium
+    customarily used for software interchange; or,
+
+    c) Accompany it with the information you received as to the offer
+    to distribute corresponding source code.  (This alternative is
+    allowed only for noncommercial distribution and only if you
+    received the program in object code or executable form with such
+    an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it.  For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable.  However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+  4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License.  Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+  5. You are not required to accept this License, since you have not
+signed it.  However, nothing else grants you permission to modify or
+distribute the Program or its derivative works.  These actions are
+prohibited by law if you do not accept this License.  Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+  6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions.  You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+  7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all.  For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices.  Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+  8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded.  In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+  9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time.  Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number.  If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation.  If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+  10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission.  For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this.  Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+			    NO WARRANTY
+
+  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+		     END OF TERMS AND CONDITIONS
+
diff --git a/wp-content/plugins/buddypress/bp-themes/bp-default/links.php b/wp-content/plugins/buddypress/bp-themes/bp-default/links.php
index c2c7cd37d7922a69005f03da7f8e908ae30a3a48..8a06af00c9cb69e980b968085feeebee399089a6 100644
--- a/wp-content/plugins/buddypress/bp-themes/bp-default/links.php
+++ b/wp-content/plugins/buddypress/bp-themes/bp-default/links.php
@@ -4,16 +4,16 @@ Template Name: Links
 */
 ?>
 
-<?php get_header() ?>
+<?php get_header(); ?>
 
 	<div id="content">
 		<div class="padder">
 
-		<?php do_action( 'bp_before_blog_links' ) ?>
+		<?php do_action( 'bp_before_blog_links' ); ?>
 
 		<div class="page" id="blog-latest" role="main">
 
-			<h2 class="pagetitle"><?php _e( 'Links', 'buddypress' ) ?></h2>
+			<h2 class="pagetitle"><?php _e( 'Links', 'buddypress' ); ?></h2>
 
 			<ul id="links-list">
 				<?php wp_list_bookmarks(); ?>
@@ -21,7 +21,7 @@ Template Name: Links
 
 		</div>
 
-		<?php do_action( 'bp_after_blog_links' ) ?>
+		<?php do_action( 'bp_after_blog_links' ); ?>
 
 		</div>
 	</div>
diff --git a/wp-content/plugins/buddypress/bp-themes/bp-default/members/index.php b/wp-content/plugins/buddypress/bp-themes/bp-default/members/index.php
index 52f3413b42bfaab629e435579fe9c7bce4fdd238..3a9b797496e7363b0cbc590118c68a97b0672d5c 100644
--- a/wp-content/plugins/buddypress/bp-themes/bp-default/members/index.php
+++ b/wp-content/plugins/buddypress/bp-themes/bp-default/members/index.php
@@ -7,9 +7,7 @@
  * @subpackage bp-default
  */
 
-?>
-
-<?php get_header( 'buddypress' ); ?>
+get_header( 'buddypress' ); ?>
 
 	<?php do_action( 'bp_before_directory_members_page' ); ?>
 
diff --git a/wp-content/plugins/buddypress/bp-themes/bp-default/members/single/activity.php b/wp-content/plugins/buddypress/bp-themes/bp-default/members/single/activity.php
index de5a67575e7abd6b910677258a7b42dde5cee2a8..869df39afeb017681b400707651e2cec80646f43 100644
--- a/wp-content/plugins/buddypress/bp-themes/bp-default/members/single/activity.php
+++ b/wp-content/plugins/buddypress/bp-themes/bp-default/members/single/activity.php
@@ -12,27 +12,27 @@
 <div class="item-list-tabs no-ajax" id="subnav" role="navigation">
 	<ul>
 
-		<?php bp_get_options_nav() ?>
+		<?php bp_get_options_nav(); ?>
 
 		<li id="activity-filter-select" class="last">
 			<label for="activity-filter-by"><?php _e( 'Show:', 'buddypress' ); ?></label>
 			<select id="activity-filter-by">
-				<option value="-1"><?php _e( 'Everything', 'buddypress' ) ?></option>
-				<option value="activity_update"><?php _e( 'Updates', 'buddypress' ) ?></option>
+				<option value="-1"><?php _e( 'Everything', 'buddypress' ); ?></option>
+				<option value="activity_update"><?php _e( 'Updates', 'buddypress' ); ?></option>
 
 				<?php
 				if ( !bp_is_current_action( 'groups' ) ) :
 					if ( bp_is_active( 'blogs' ) ) : ?>
 
-						<option value="new_blog_post"><?php _e( 'Posts', 'buddypress' ) ?></option>
-						<option value="new_blog_comment"><?php _e( 'Comments', 'buddypress' ) ?></option>
+						<option value="new_blog_post"><?php _e( 'Posts', 'buddypress' ); ?></option>
+						<option value="new_blog_comment"><?php _e( 'Comments', 'buddypress' ); ?></option>
 
 					<?php
 					endif;
 
 					if ( bp_is_active( 'friends' ) ) : ?>
 
-						<option value="friendship_accepted,friendship_created"><?php _e( 'Friendships', 'buddypress' ) ?></option>
+						<option value="friendship_accepted,friendship_created"><?php _e( 'Friendships', 'buddypress' ); ?></option>
 
 					<?php endif;
 
@@ -40,15 +40,15 @@
 
 				if ( bp_is_active( 'forums' ) ) : ?>
 
-					<option value="new_forum_topic"><?php _e( 'Forum Topics', 'buddypress' ) ?></option>
-					<option value="new_forum_post"><?php _e( 'Forum Replies', 'buddypress' ) ?></option>
+					<option value="new_forum_topic"><?php _e( 'Forum Topics', 'buddypress' ); ?></option>
+					<option value="new_forum_post"><?php _e( 'Forum Replies', 'buddypress' ); ?></option>
 
 				<?php endif;
 
 				if ( bp_is_active( 'groups' ) ) : ?>
 
-					<option value="created_group"><?php _e( 'New Groups', 'buddypress' ) ?></option>
-					<option value="joined_group"><?php _e( 'Group Memberships', 'buddypress' ) ?></option>
+					<option value="created_group"><?php _e( 'New Groups', 'buddypress' ); ?></option>
+					<option value="joined_group"><?php _e( 'Group Memberships', 'buddypress' ); ?></option>
 
 				<?php endif;
 
diff --git a/wp-content/plugins/buddypress/bp-themes/bp-default/members/single/activity/permalink.php b/wp-content/plugins/buddypress/bp-themes/bp-default/members/single/activity/permalink.php
index ad4beecf30e3ab1209659ca132ff8b24d2adc453..7c5ab6d11a38a5c53b0bf5103b7166309a08f72d 100644
--- a/wp-content/plugins/buddypress/bp-themes/bp-default/members/single/activity/permalink.php
+++ b/wp-content/plugins/buddypress/bp-themes/bp-default/members/single/activity/permalink.php
@@ -1,4 +1,6 @@
-<?php get_header( 'buddypress' ) ?>
+<?php get_header( 'buddypress' ); ?>
+
+<?php do_action( 'template_notices' ); ?>
 
 <div class="activity no-ajax" role="main">
 	<?php if ( bp_has_activities( 'display_comments=threaded&show_hidden=true&include=' . bp_current_action() ) ) : ?>
@@ -6,7 +8,7 @@
 		<ul id="activity-stream" class="activity-list item-list">
 		<?php while ( bp_activities() ) : bp_the_activity(); ?>
 
-			<?php locate_template( array( 'activity/entry.php' ), true ) ?>
+			<?php locate_template( array( 'activity/entry.php' ), true ); ?>
 
 		<?php endwhile; ?>
 		</ul>
@@ -14,4 +16,4 @@
 	<?php endif; ?>
 </div>
 
-<?php get_footer( 'buddypress' ) ?>
\ No newline at end of file
+<?php get_footer( 'buddypress' ); ?>
\ No newline at end of file
diff --git a/wp-content/plugins/buddypress/bp-themes/bp-default/members/single/forums.php b/wp-content/plugins/buddypress/bp-themes/bp-default/members/single/forums.php
index 6131c1cbf377b079f8d073bf001d998c4dcada49..3d2a3520d1cca08c810fe0c68c4c499f7dc2a731 100644
--- a/wp-content/plugins/buddypress/bp-themes/bp-default/members/single/forums.php
+++ b/wp-content/plugins/buddypress/bp-themes/bp-default/members/single/forums.php
@@ -11,7 +11,7 @@
 
 <div class="item-list-tabs no-ajax" id="subnav" role="navigation">
 	<ul>
-		<?php bp_get_options_nav() ?>
+		<?php bp_get_options_nav(); ?>
 
 		<li id="forums-order-select" class="last filter">
 
diff --git a/wp-content/plugins/buddypress/bp-themes/bp-default/members/single/friends.php b/wp-content/plugins/buddypress/bp-themes/bp-default/members/single/friends.php
index 6975e78e96de5197484a6516fc1346347d85b0e0..70a3a33ef92c84dd75c88991762600fc15681949 100644
--- a/wp-content/plugins/buddypress/bp-themes/bp-default/members/single/friends.php
+++ b/wp-content/plugins/buddypress/bp-themes/bp-default/members/single/friends.php
@@ -17,13 +17,13 @@
 
 			<li id="members-order-select" class="last filter">
 
-				<label for="members-all"><?php _e( 'Order By:', 'buddypress' ) ?></label>
-				<select id="members-all">
-					<option value="active"><?php _e( 'Last Active', 'buddypress' ) ?></option>
-					<option value="newest"><?php _e( 'Newest Registered', 'buddypress' ) ?></option>
-					<option value="alphabetical"><?php _e( 'Alphabetical', 'buddypress' ) ?></option>
+				<label for="members-friends"><?php _e( 'Order By:', 'buddypress' ); ?></label>
+				<select id="members-friends">
+					<option value="active"><?php _e( 'Last Active', 'buddypress' ); ?></option>
+					<option value="newest"><?php _e( 'Newest Registered', 'buddypress' ); ?></option>
+					<option value="alphabetical"><?php _e( 'Alphabetical', 'buddypress' ); ?></option>
 
-					<?php do_action( 'bp_member_blog_order_options' ) ?>
+					<?php do_action( 'bp_member_blog_order_options' ); ?>
 
 				</select>
 			</li>
diff --git a/wp-content/plugins/buddypress/bp-themes/bp-default/members/single/friends/requests.php b/wp-content/plugins/buddypress/bp-themes/bp-default/members/single/friends/requests.php
index 874d0dfcb166cd1bb929974a3c44bb6ec8270018..a47f6bc5ecada19723b56a5e5796634e79330be0 100644
--- a/wp-content/plugins/buddypress/bp-themes/bp-default/members/single/friends/requests.php
+++ b/wp-content/plugins/buddypress/bp-themes/bp-default/members/single/friends/requests.php
@@ -1,6 +1,6 @@
-<?php do_action( 'bp_before_member_friend_requests_content' ) ?>
+<?php do_action( 'bp_before_member_friend_requests_content' ); ?>
 
-<?php if ( bp_has_members( 'include=' . bp_get_friendship_requests() ) ) : ?>
+<?php if ( bp_has_members( 'type=alphabetical&include=' . bp_get_friendship_requests() ) ) : ?>
 
 	<div id="pag-top" class="pagination no-ajax">
 
@@ -21,30 +21,30 @@
 	<ul id="friend-list" class="item-list" role="main">
 		<?php while ( bp_members() ) : bp_the_member(); ?>
 
-			<li id="friendship-<?php bp_friend_friendship_id() ?>">
+			<li id="friendship-<?php bp_friend_friendship_id(); ?>">
 				<div class="item-avatar">
-					<a href="<?php bp_member_link() ?>"><?php bp_member_avatar() ?></a>
+					<a href="<?php bp_member_link(); ?>"><?php bp_member_avatar(); ?></a>
 				</div>
 
 				<div class="item">
-					<div class="item-title"><a href="<?php bp_member_link() ?>"><?php bp_member_name() ?></a></div>
-					<div class="item-meta"><span class="activity"><?php bp_member_last_active() ?></span></div>
+					<div class="item-title"><a href="<?php bp_member_link(); ?>"><?php bp_member_name(); ?></a></div>
+					<div class="item-meta"><span class="activity"><?php bp_member_last_active(); ?></span></div>
 				</div>
 
-				<?php do_action( 'bp_friend_requests_item' ) ?>
+				<?php do_action( 'bp_friend_requests_item' ); ?>
 
 				<div class="action">
-					<a class="button accept" href="<?php bp_friend_accept_request_link() ?>"><?php _e( 'Accept', 'buddypress' ); ?></a> &nbsp;
-					<a class="button reject" href="<?php bp_friend_reject_request_link() ?>"><?php _e( 'Reject', 'buddypress' ); ?></a>
+					<a class="button accept" href="<?php bp_friend_accept_request_link(); ?>"><?php _e( 'Accept', 'buddypress' ); ?></a> &nbsp;
+					<a class="button reject" href="<?php bp_friend_reject_request_link(); ?>"><?php _e( 'Reject', 'buddypress' ); ?></a>
 
-					<?php do_action( 'bp_friend_requests_item_action' ) ?>
+					<?php do_action( 'bp_friend_requests_item_action' ); ?>
 				</div>
 			</li>
 
 		<?php endwhile; ?>
 	</ul>
 
-	<?php do_action( 'bp_friend_requests_content' ) ?>
+	<?php do_action( 'bp_friend_requests_content' ); ?>
 
 	<div id="pag-bottom" class="pagination no-ajax">
 
@@ -70,4 +70,4 @@
 
 <?php endif;?>
 
-<?php do_action( 'bp_after_member_friend_requests_content' ) ?>
+<?php do_action( 'bp_after_member_friend_requests_content' ); ?>
diff --git a/wp-content/plugins/buddypress/bp-themes/bp-default/members/single/groups.php b/wp-content/plugins/buddypress/bp-themes/bp-default/members/single/groups.php
index 143436c2bd23c12ad57a8eb7879affae0930ec7c..73a26ad3eedacbd79ff5ed86e332812f3fcc0383 100644
--- a/wp-content/plugins/buddypress/bp-themes/bp-default/members/single/groups.php
+++ b/wp-content/plugins/buddypress/bp-themes/bp-default/members/single/groups.php
@@ -24,7 +24,7 @@
 					<option value="newest"><?php _e( 'Newly Created', 'buddypress' ); ?></option>
 					<option value="alphabetical"><?php _e( 'Alphabetical', 'buddypress' ); ?></option>
 
-					<?php do_action( 'bp_member_group_order_options' ) ?>
+					<?php do_action( 'bp_member_group_order_options' ); ?>
 
 				</select>
 			</li>
diff --git a/wp-content/plugins/buddypress/bp-themes/bp-default/members/single/groups/invites.php b/wp-content/plugins/buddypress/bp-themes/bp-default/members/single/groups/invites.php
index dcf2d697b1b2ffcd98c18cc22835665ed803283d..4d2047fe77c4a9bdfaf69146bcd3606a482be0e1 100644
--- a/wp-content/plugins/buddypress/bp-themes/bp-default/members/single/groups/invites.php
+++ b/wp-content/plugins/buddypress/bp-themes/bp-default/members/single/groups/invites.php
@@ -1,4 +1,4 @@
-<?php do_action( 'bp_before_group_invites_content' ) ?>
+<?php do_action( 'bp_before_group_invites_content' ); ?>
 
 <?php if ( bp_has_groups( 'type=invites&user_id=' . bp_loggedin_user_id() ) ) : ?>
 
@@ -8,22 +8,22 @@
 
 			<li>
 				<div class="item-avatar">
-					<a href="<?php bp_group_permalink() ?>"><?php bp_group_avatar( 'type=thumb&width=50&height=50' ) ?></a>
+					<a href="<?php bp_group_permalink(); ?>"><?php bp_group_avatar( 'type=thumb&width=50&height=50' ); ?></a>
 				</div>
 
-				<h4><a href="<?php bp_group_permalink() ?>"><?php bp_group_name() ?></a><span class="small"> - <?php printf( __( '%s members', 'buddypress' ), bp_group_total_members( false ) ) ?></span></h4>
+				<h4><a href="<?php bp_group_permalink(); ?>"><?php bp_group_name(); ?></a><span class="small"> - <?php printf( __( '%s members', 'buddypress' ), bp_group_total_members( false ) ); ?></span></h4>
 
 				<p class="desc">
-					<?php bp_group_description_excerpt() ?>
+					<?php bp_group_description_excerpt(); ?>
 				</p>
 
-				<?php do_action( 'bp_group_invites_item' ) ?>
+				<?php do_action( 'bp_group_invites_item' ); ?>
 
 				<div class="action">
-					<a class="button accept" href="<?php bp_group_accept_invite_link() ?>"><?php _e( 'Accept', 'buddypress' ) ?></a> &nbsp;
-					<a class="button reject confirm" href="<?php bp_group_reject_invite_link() ?>"><?php _e( 'Reject', 'buddypress' ) ?></a>
+					<a class="button accept" href="<?php bp_group_accept_invite_link(); ?>"><?php _e( 'Accept', 'buddypress' ); ?></a> &nbsp;
+					<a class="button reject confirm" href="<?php bp_group_reject_invite_link(); ?>"><?php _e( 'Reject', 'buddypress' ); ?></a>
 
-					<?php do_action( 'bp_group_invites_item_action' ) ?>
+					<?php do_action( 'bp_group_invites_item_action' ); ?>
 
 				</div>
 			</li>
@@ -34,9 +34,9 @@
 <?php else: ?>
 
 	<div id="message" class="info" role="main">
-		<p><?php _e( 'You have no outstanding group invites.', 'buddypress' ) ?></p>
+		<p><?php _e( 'You have no outstanding group invites.', 'buddypress' ); ?></p>
 	</div>
 
 <?php endif;?>
 
-<?php do_action( 'bp_after_group_invites_content' ) ?>
\ No newline at end of file
+<?php do_action( 'bp_after_group_invites_content' ); ?>
\ No newline at end of file
diff --git a/wp-content/plugins/buddypress/bp-themes/bp-default/members/single/home.php b/wp-content/plugins/buddypress/bp-themes/bp-default/members/single/home.php
index bc2ac2a3a8506233ce939b9f6d587f63522e6db4..39d70fbf34ec31d37444fd003038c542051f8153 100644
--- a/wp-content/plugins/buddypress/bp-themes/bp-default/members/single/home.php
+++ b/wp-content/plugins/buddypress/bp-themes/bp-default/members/single/home.php
@@ -7,9 +7,7 @@
  * @subpackage bp-default
  */
 
-?>
-
-<?php get_header( 'buddypress' ); ?>
+get_header( 'buddypress' ); ?>
 
 	<div id="content">
 		<div class="padder">
diff --git a/wp-content/plugins/buddypress/bp-themes/bp-default/members/single/member-header.php b/wp-content/plugins/buddypress/bp-themes/bp-default/members/single/member-header.php
index 902bc654cd657f5e3dc9248384eff3eb25130ae0..1728555435caf3f4aeee6b29df32b47424b58048 100644
--- a/wp-content/plugins/buddypress/bp-themes/bp-default/members/single/member-header.php
+++ b/wp-content/plugins/buddypress/bp-themes/bp-default/members/single/member-header.php
@@ -12,7 +12,7 @@
 <?php do_action( 'bp_before_member_header' ); ?>
 
 <div id="item-header-avatar">
-	<a href="<?php bp_user_link(); ?>">
+	<a href="<?php bp_displayed_user_link(); ?>">
 
 		<?php bp_displayed_user_avatar( 'type=full' ); ?>
 
@@ -51,7 +51,7 @@
 		<?php
 		/***
 		 * If you'd like to show specific profile fields here use:
-		 * bp_profile_field_data( 'field=About Me' ); -- Pass the name of the field
+		 * bp_member_profile_data( 'field=About Me' ); -- Pass the name of the field
 		 */
 		 do_action( 'bp_profile_header_meta' );
 
diff --git a/wp-content/plugins/buddypress/bp-themes/bp-default/members/single/messages.php b/wp-content/plugins/buddypress/bp-themes/bp-default/members/single/messages.php
index 2426fd82eb6f45c9aee7b2f8cc8446712e6559fa..2860da72d6e19a6f6557b83f7696c621f3017473 100644
--- a/wp-content/plugins/buddypress/bp-themes/bp-default/members/single/messages.php
+++ b/wp-content/plugins/buddypress/bp-themes/bp-default/members/single/messages.php
@@ -15,6 +15,13 @@
 		<?php bp_get_options_nav(); ?>
 
 	</ul>
+	
+	<?php if ( bp_is_messages_inbox() || bp_is_messages_sentbox() ) : ?>
+
+		<div class="message-search"><?php bp_message_search_form(); ?></div>
+
+	<?php endif; ?>
+
 </div><!-- .item-list-tabs -->
 
 <?php
diff --git a/wp-content/plugins/buddypress/bp-themes/bp-default/members/single/messages/compose.php b/wp-content/plugins/buddypress/bp-themes/bp-default/members/single/messages/compose.php
index 00a840bc80cead9cf581bf5c8dba5597e81f96a6..6b08d9ad0675c60e9eb675600d8b1ddd23217bed 100644
--- a/wp-content/plugins/buddypress/bp-themes/bp-default/members/single/messages/compose.php
+++ b/wp-content/plugins/buddypress/bp-themes/bp-default/members/single/messages/compose.php
@@ -1,34 +1,34 @@
-<form action="<?php bp_messages_form_action('compose') ?>" method="post" id="send_message_form" class="standard-form" role="main">
+<form action="<?php bp_messages_form_action('compose'); ?>" method="post" id="send_message_form" class="standard-form" role="main">
 
-	<?php do_action( 'bp_before_messages_compose_content' ) ?>
+	<?php do_action( 'bp_before_messages_compose_content' ); ?>
 
-	<label for="send-to-input"><?php _e("Send To (Username or Friend's Name)", 'buddypress') ?></label>
+	<label for="send-to-input"><?php _e("Send To (Username or Friend's Name)", 'buddypress'); ?></label>
 	<ul class="first acfb-holder">
 		<li>
-			<?php bp_message_get_recipient_tabs() ?>
+			<?php bp_message_get_recipient_tabs(); ?>
 			<input type="text" name="send-to-input" class="send-to-input" id="send-to-input" />
 		</li>
 	</ul>
 
-	<?php if ( is_super_admin() ) : ?>
-		<input type="checkbox" id="send-notice" name="send-notice" value="1" /> <?php _e( "This is a notice to all users.", "buddypress" ) ?>
+	<?php if ( bp_current_user_can( 'bp_moderate' ) ) : ?>
+		<input type="checkbox" id="send-notice" name="send-notice" value="1" /> <?php _e( "This is a notice to all users.", "buddypress" ); ?>
 	<?php endif; ?>
 
-	<label for="subject"><?php _e( 'Subject', 'buddypress') ?></label>
-	<input type="text" name="subject" id="subject" value="<?php bp_messages_subject_value() ?>" />
+	<label for="subject"><?php _e( 'Subject', 'buddypress'); ?></label>
+	<input type="text" name="subject" id="subject" value="<?php bp_messages_subject_value(); ?>" />
 
-	<label for="content"><?php _e( 'Message', 'buddypress') ?></label>
-	<textarea name="content" id="message_content" rows="15" cols="40"><?php bp_messages_content_value() ?></textarea>
+	<label for="content"><?php _e( 'Message', 'buddypress'); ?></label>
+	<textarea name="content" id="message_content" rows="15" cols="40"><?php bp_messages_content_value(); ?></textarea>
 
-	<input type="hidden" name="send_to_usernames" id="send-to-usernames" value="<?php bp_message_get_recipient_usernames(); ?>" class="<?php bp_message_get_recipient_usernames() ?>" />
+	<input type="hidden" name="send_to_usernames" id="send-to-usernames" value="<?php bp_message_get_recipient_usernames(); ?>" class="<?php bp_message_get_recipient_usernames(); ?>" />
 
-	<?php do_action( 'bp_after_messages_compose_content' ) ?>
+	<?php do_action( 'bp_after_messages_compose_content' ); ?>
 
 	<div class="submit">
-		<input type="submit" value="<?php _e( "Send Message", 'buddypress' ) ?>" name="send" id="send" />
+		<input type="submit" value="<?php _e( "Send Message", 'buddypress' ); ?>" name="send" id="send" />
 	</div>
 
-	<?php wp_nonce_field( 'messages_send_message' ) ?>
+	<?php wp_nonce_field( 'messages_send_message' ); ?>
 </form>
 
 <script type="text/javascript">
diff --git a/wp-content/plugins/buddypress/bp-themes/bp-default/members/single/messages/messages-loop.php b/wp-content/plugins/buddypress/bp-themes/bp-default/members/single/messages/messages-loop.php
index 8c26abece2d6f4429a779046ef4e5a0b2079a006..5ed1ca26e3d992e8a7c05ad38899cc578c8e6acb 100644
--- a/wp-content/plugins/buddypress/bp-themes/bp-default/members/single/messages/messages-loop.php
+++ b/wp-content/plugins/buddypress/bp-themes/bp-default/members/single/messages/messages-loop.php
@@ -1,53 +1,54 @@
-<?php do_action( 'bp_before_member_messages_loop' ) ?>
+<?php do_action( 'bp_before_member_messages_loop' ); ?>
 
-<?php if ( bp_has_message_threads() ) : ?>
+<?php if ( bp_has_message_threads( bp_ajax_querystring( 'messages' ) ) ) : ?>
 
 	<div class="pagination no-ajax" id="user-pag">
 
 		<div class="pag-count" id="messages-dir-count">
-			<?php bp_messages_pagination_count() ?>
+			<?php bp_messages_pagination_count(); ?>
 		</div>
 
 		<div class="pagination-links" id="messages-dir-pag">
-			<?php bp_messages_pagination() ?>
+			<?php bp_messages_pagination(); ?>
 		</div>
 
 	</div><!-- .pagination -->
 
-	<?php do_action( 'bp_after_member_messages_pagination' ) ?>
-	<?php do_action( 'bp_before_member_messages_threads' ) ?>
+	<?php do_action( 'bp_after_member_messages_pagination' ); ?>
+
+	<?php do_action( 'bp_before_member_messages_threads'   ); ?>
 
 	<table id="message-threads" class="messages-notices">
 		<?php while ( bp_message_threads() ) : bp_message_thread(); ?>
 
-			<tr id="m-<?php bp_message_thread_id() ?>" class="<?php bp_message_css_class(); ?><?php if ( bp_message_thread_has_unread() ) : ?> unread"<?php else: ?> read"<?php endif; ?>>
+			<tr id="m-<?php bp_message_thread_id(); ?>" class="<?php bp_message_css_class(); ?><?php if ( bp_message_thread_has_unread() ) : ?> unread"<?php else: ?> read"<?php endif; ?>>
 				<td width="1%" class="thread-count">
-					<span class="unread-count"><?php bp_message_thread_unread_count() ?></span>
+					<span class="unread-count"><?php bp_message_thread_unread_count(); ?></span>
 				</td>
-				<td width="1%" class="thread-avatar"><?php bp_message_thread_avatar() ?></td>
+				<td width="1%" class="thread-avatar"><?php bp_message_thread_avatar(); ?></td>
 
 				<?php if ( 'sentbox' != bp_current_action() ) : ?>
 					<td width="30%" class="thread-from">
-						<?php _e( 'From:', 'buddypress' ); ?> <?php bp_message_thread_from() ?><br />
-						<span class="activity"><?php bp_message_thread_last_post_date() ?></span>
+						<?php _e( 'From:', 'buddypress' ); ?> <?php bp_message_thread_from(); ?><br />
+						<span class="activity"><?php bp_message_thread_last_post_date(); ?></span>
 					</td>
 				<?php else: ?>
 					<td width="30%" class="thread-from">
-						<?php _e( 'To:', 'buddypress' ); ?> <?php bp_message_thread_to() ?><br />
-						<span class="activity"><?php bp_message_thread_last_post_date() ?></span>
+						<?php _e( 'To:', 'buddypress' ); ?> <?php bp_message_thread_to(); ?><br />
+						<span class="activity"><?php bp_message_thread_last_post_date(); ?></span>
 					</td>
 				<?php endif; ?>
 
 				<td width="50%" class="thread-info">
-					<p><a href="<?php bp_message_thread_view_link() ?>" title="<?php _e( "View Message", "buddypress" ); ?>"><?php bp_message_thread_subject() ?></a></p>
-					<p class="thread-excerpt"><?php bp_message_thread_excerpt() ?></p>
+					<p><a href="<?php bp_message_thread_view_link(); ?>" title="<?php _e( "View Message", "buddypress" ); ?>"><?php bp_message_thread_subject(); ?></a></p>
+					<p class="thread-excerpt"><?php bp_message_thread_excerpt(); ?></p>
 				</td>
 
-				<?php do_action( 'bp_messages_inbox_list_item' ) ?>
+				<?php do_action( 'bp_messages_inbox_list_item' ); ?>
 
 				<td width="13%" class="thread-options">
-					<input type="checkbox" name="message_ids[]" value="<?php bp_message_thread_id() ?>" />
-					<a class="button confirm" href="<?php bp_message_thread_delete_link() ?>" title="<?php _e( "Delete Message", "buddypress" ); ?>"><?php _e( 'Delete', 'buddypress' ) ?></a> &nbsp;
+					<input type="checkbox" name="message_ids[]" value="<?php bp_message_thread_id(); ?>" />
+					<a class="button confirm" href="<?php bp_message_thread_delete_link(); ?>" title="<?php _e( "Delete Message", "buddypress" ); ?>"><?php _e( 'Delete', 'buddypress' ); ?></a> &nbsp;
 				</td>
 			</tr>
 
@@ -55,12 +56,12 @@
 	</table><!-- #message-threads -->
 
 	<div class="messages-options-nav">
-		<?php bp_messages_options() ?>
+		<?php bp_messages_options(); ?>
 	</div><!-- .messages-options-nav -->
 
-	<?php do_action( 'bp_after_member_messages_threads' ) ?>
+	<?php do_action( 'bp_after_member_messages_threads' ); ?>
 
-	<?php do_action( 'bp_after_member_messages_options' ) ?>
+	<?php do_action( 'bp_after_member_messages_options' ); ?>
 
 <?php else: ?>
 
@@ -70,4 +71,4 @@
 
 <?php endif;?>
 
-<?php do_action( 'bp_after_member_messages_loop' ) ?>
\ No newline at end of file
+<?php do_action( 'bp_after_member_messages_loop' ); ?>
diff --git a/wp-content/plugins/buddypress/bp-themes/bp-default/members/single/messages/notices-loop.php b/wp-content/plugins/buddypress/bp-themes/bp-default/members/single/messages/notices-loop.php
index 29d0eb1e8db0af820749d3c611eaa6812250d202..5733c8b2fc3ff6cdf33e6117456ff8670951dbef 100644
--- a/wp-content/plugins/buddypress/bp-themes/bp-default/members/single/messages/notices-loop.php
+++ b/wp-content/plugins/buddypress/bp-themes/bp-default/members/single/messages/notices-loop.php
@@ -1,47 +1,52 @@
-<?php do_action( 'bp_before_notices_loop' ) ?>
+<?php do_action( 'bp_before_notices_loop' ); ?>
 
 <?php if ( bp_has_message_threads() ) : ?>
 
-	<div class="pagination" id="user-pag">
+	<div class="pagination no-ajax" id="user-pag">
 
 		<div class="pag-count" id="messages-dir-count">
-			<?php bp_messages_pagination_count() ?>
+			<?php bp_messages_pagination_count(); ?>
 		</div>
 
 		<div class="pagination-links" id="messages-dir-pag">
-			<?php bp_messages_pagination() ?>
+			<?php bp_messages_pagination(); ?>
 		</div>
 
 	</div><!-- .pagination -->
 
-	<?php do_action( 'bp_after_notices_pagination' ) ?>
-	<?php do_action( 'bp_before_notices' ) ?>
+	<?php do_action( 'bp_after_notices_pagination' ); ?>
+	<?php do_action( 'bp_before_notices' ); ?>
 
 	<table id="message-threads" class="messages-notices">
 		<?php while ( bp_message_threads() ) : bp_message_thread(); ?>
-			<tr id="notice-<?php bp_message_notice_id() ?>" class="<?php bp_message_css_class(); ?>">
-				<td width="1%">
-				</td>
+			<tr id="notice-<?php bp_message_notice_id(); ?>" class="<?php bp_message_css_class(); ?>">
+				<td width="1%"></td>
 				<td width="38%">
-					<strong><?php bp_message_notice_subject() ?></strong>
-					<?php bp_message_notice_text() ?>
+					<strong><?php bp_message_notice_subject(); ?></strong>
+					<?php bp_message_notice_text(); ?>
 				</td>
 				<td width="21%">
-					<strong><?php bp_message_is_active_notice() ?></strong>
-					<span class="activity"><?php _e("Sent:", "buddypress"); ?> <?php bp_message_notice_post_date() ?></span>
+
+					<?php if ( bp_messages_is_active_notice() ) : ?>
+
+						<strong><?php bp_messages_is_active_notice(); ?></strong>
+
+					<?php endif; ?>
+
+					<span class="activity"><?php _e( 'Sent:', 'buddypress' ); ?> <?php bp_message_notice_post_date(); ?></span>
 				</td>
 
-				<?php do_action( 'bp_notices_list_item' ) ?>
+				<?php do_action( 'bp_notices_list_item' ); ?>
 
 				<td width="10%">
-					<a class="button" href="<?php bp_message_activate_deactivate_link() ?>" class="confirm"><?php bp_message_activate_deactivate_text() ?></a>
-					<a class="button" href="<?php bp_message_notice_delete_link() ?>" class="confirm" title="<?php _e( "Delete Message", "buddypress" ); ?>">x</a>
+					<a class="button" href="<?php bp_message_activate_deactivate_link(); ?>" class="confirm"><?php bp_message_activate_deactivate_text(); ?></a>
+					<a class="button" href="<?php bp_message_notice_delete_link(); ?>" class="confirm" title="<?php _e( "Delete Message", "buddypress" ); ?>">x</a>
 				</td>
 			</tr>
 		<?php endwhile; ?>
 	</table><!-- #message-threads -->
 
-	<?php do_action( 'bp_after_notices' ) ?>
+	<?php do_action( 'bp_after_notices' ); ?>
 
 <?php else: ?>
 
@@ -51,4 +56,4 @@
 
 <?php endif;?>
 
-<?php do_action( 'bp_after_notices_loop' ) ?>
\ No newline at end of file
+<?php do_action( 'bp_after_notices_loop' ); ?>
\ No newline at end of file
diff --git a/wp-content/plugins/buddypress/bp-themes/bp-default/members/single/messages/single.php b/wp-content/plugins/buddypress/bp-themes/bp-default/members/single/messages/single.php
index 35de17b7226c9e15218f3d269a1fa610897cf03b..ca07bab163ac96ce4cc990681e05fd2aad296bd8 100644
--- a/wp-content/plugins/buddypress/bp-themes/bp-default/members/single/messages/single.php
+++ b/wp-content/plugins/buddypress/bp-themes/bp-default/members/single/messages/single.php
@@ -1,10 +1,10 @@
 <div id="message-thread" role="main">
 
-	<?php do_action( 'bp_before_message_thread_content' ) ?>
+	<?php do_action( 'bp_before_message_thread_content' ); ?>
 
 	<?php if ( bp_thread_has_messages() ) : ?>
 
-		<h3 id="message-subject"><?php bp_the_thread_subject() ?></h3>
+		<h3 id="message-subject"><?php bp_the_thread_subject(); ?></h3>
 
 		<p id="message-recipients">
 			<span class="highlight">
@@ -15,16 +15,16 @@
 
 				<?php else : ?>
 
-					<?php printf( __( 'Conversation between %s and you.', 'buddypress' ), bp_get_the_thread_recipients() ) ?>
+					<?php printf( __( 'Conversation between %s and you.', 'buddypress' ), bp_get_the_thread_recipients() ); ?>
 
 				<?php endif; ?>
 
 			</span>
 
-			<a class="button confirm" href="<?php bp_the_thread_delete_link() ?>" title="<?php _e( "Delete Message", "buddypress" ); ?>"><?php _e( 'Delete', 'buddypress' ) ?></a> &nbsp;
+			<a class="button confirm" href="<?php bp_the_thread_delete_link(); ?>" title="<?php _e( "Delete Message", "buddypress" ); ?>"><?php _e( 'Delete', 'buddypress' ); ?></a> &nbsp;
 		</p>
 
-		<?php do_action( 'bp_before_message_thread_list' ) ?>
+		<?php do_action( 'bp_before_message_thread_list' ); ?>
 
 		<?php while ( bp_thread_messages() ) : bp_thread_the_message(); ?>
 
@@ -32,24 +32,24 @@
 
 				<div class="message-metadata">
 
-					<?php do_action( 'bp_before_message_meta' ) ?>
+					<?php do_action( 'bp_before_message_meta' ); ?>
 
-					<?php bp_the_thread_message_sender_avatar( 'type=thumb&width=30&height=30' ) ?>
-					<strong><a href="<?php bp_the_thread_message_sender_link() ?>" title="<?php bp_the_thread_message_sender_name() ?>"><?php bp_the_thread_message_sender_name() ?></a> <span class="activity"><?php bp_the_thread_message_time_since() ?></span></strong>
+					<?php bp_the_thread_message_sender_avatar( 'type=thumb&width=30&height=30' ); ?>
+					<strong><a href="<?php bp_the_thread_message_sender_link(); ?>" title="<?php bp_the_thread_message_sender_name(); ?>"><?php bp_the_thread_message_sender_name(); ?></a> <span class="activity"><?php bp_the_thread_message_time_since(); ?></span></strong>
 
-					<?php do_action( 'bp_after_message_meta' ) ?>
+					<?php do_action( 'bp_after_message_meta' ); ?>
 
 				</div><!-- .message-metadata -->
 
-				<?php do_action( 'bp_before_message_content' ) ?>
+				<?php do_action( 'bp_before_message_content' ); ?>
 
 				<div class="message-content">
 
-					<?php bp_the_thread_message_content() ?>
+					<?php bp_the_thread_message_content(); ?>
 
 				</div><!-- .message-content -->
 
-				<?php do_action( 'bp_after_message_content' ) ?>
+				<?php do_action( 'bp_after_message_content' ); ?>
 
 				<div class="clear"></div>
 
@@ -57,43 +57,43 @@
 
 		<?php endwhile; ?>
 
-		<?php do_action( 'bp_after_message_thread_list' ) ?>
+		<?php do_action( 'bp_after_message_thread_list' ); ?>
 
-		<?php do_action( 'bp_before_message_thread_reply' ) ?>
+		<?php do_action( 'bp_before_message_thread_reply' ); ?>
 
-		<form id="send-reply" action="<?php bp_messages_form_action() ?>" method="post" class="standard-form">
+		<form id="send-reply" action="<?php bp_messages_form_action(); ?>" method="post" class="standard-form">
 
 			<div class="message-box">
 
 				<div class="message-metadata">
 
-					<?php do_action( 'bp_before_message_meta' ) ?>
+					<?php do_action( 'bp_before_message_meta' ); ?>
 
 					<div class="avatar-box">
-						<?php bp_loggedin_user_avatar( 'type=thumb&height=30&width=30' ) ?>
+						<?php bp_loggedin_user_avatar( 'type=thumb&height=30&width=30' ); ?>
 
-						<strong><?php _e( 'Send a Reply', 'buddypress' ) ?></strong>
+						<strong><?php _e( 'Send a Reply', 'buddypress' ); ?></strong>
 					</div>
 
-					<?php do_action( 'bp_after_message_meta' ) ?>
+					<?php do_action( 'bp_after_message_meta' ); ?>
 
 				</div><!-- .message-metadata -->
 
 				<div class="message-content">
 
-					<?php do_action( 'bp_before_message_reply_box' ) ?>
+					<?php do_action( 'bp_before_message_reply_box' ); ?>
 
 					<textarea name="content" id="message_content" rows="15" cols="40"></textarea>
 
-					<?php do_action( 'bp_after_message_reply_box' ) ?>
+					<?php do_action( 'bp_after_message_reply_box' ); ?>
 
 					<div class="submit">
-						<input type="submit" name="send" value="<?php _e( 'Send Reply', 'buddypress' ) ?>" id="send_reply_button"/>
+						<input type="submit" name="send" value="<?php _e( 'Send Reply', 'buddypress' ); ?>" id="send_reply_button"/>
 					</div>
 
 					<input type="hidden" id="thread_id" name="thread_id" value="<?php bp_the_thread_id(); ?>" />
 					<input type="hidden" id="messages_order" name="messages_order" value="<?php bp_thread_messages_order(); ?>" />
-					<?php wp_nonce_field( 'messages_send_message', 'send_message_nonce' ) ?>
+					<?php wp_nonce_field( 'messages_send_message', 'send_message_nonce' ); ?>
 
 				</div><!-- .message-content -->
 
@@ -101,10 +101,10 @@
 
 		</form><!-- #send-reply -->
 
-		<?php do_action( 'bp_after_message_thread_reply' ) ?>
+		<?php do_action( 'bp_after_message_thread_reply' ); ?>
 
 	<?php endif; ?>
 
-	<?php do_action( 'bp_after_message_thread_content' ) ?>
+	<?php do_action( 'bp_after_message_thread_content' ); ?>
 
 </div>
\ No newline at end of file
diff --git a/wp-content/plugins/buddypress/bp-themes/bp-default/members/single/profile/change-avatar.php b/wp-content/plugins/buddypress/bp-themes/bp-default/members/single/profile/change-avatar.php
index b7a351e3dbcca7918892e79e97bf2900cc31dc20..e1e4851652638de2d944ccf4296aafaa812bfd59 100644
--- a/wp-content/plugins/buddypress/bp-themes/bp-default/members/single/profile/change-avatar.php
+++ b/wp-content/plugins/buddypress/bp-themes/bp-default/members/single/profile/change-avatar.php
@@ -1,50 +1,50 @@
-<h4><?php _e( 'Change Avatar', 'buddypress' ) ?></h4>
+<h4><?php _e( 'Change Avatar', 'buddypress' ); ?></h4>
 
-<?php do_action( 'bp_before_profile_avatar_upload_content' ) ?>
+<?php do_action( 'bp_before_profile_avatar_upload_content' ); ?>
 
 <?php if ( !(int)bp_get_option( 'bp-disable-avatar-uploads' ) ) : ?>
 
-	<p><?php _e( 'Your avatar will be used on your profile and throughout the site. If there is a <a href="http://gravatar.com">Gravatar</a> associated with your account email we will use that, or you can upload an image from your computer.', 'buddypress') ?></p>
+	<p><?php _e( 'Your avatar will be used on your profile and throughout the site. If there is a <a href="http://gravatar.com">Gravatar</a> associated with your account email we will use that, or you can upload an image from your computer.', 'buddypress'); ?></p>
 
 	<form action="" method="post" id="avatar-upload-form" class="standard-form" enctype="multipart/form-data">
 
 		<?php if ( 'upload-image' == bp_get_avatar_admin_step() ) : ?>
 
-			<?php wp_nonce_field( 'bp_avatar_upload' ) ?>
-			<p><?php _e( 'Click below to select a JPG, GIF or PNG format photo from your computer and then click \'Upload Image\' to proceed.', 'buddypress' ) ?></p>
+			<?php wp_nonce_field( 'bp_avatar_upload' ); ?>
+			<p><?php _e( 'Click below to select a JPG, GIF or PNG format photo from your computer and then click \'Upload Image\' to proceed.', 'buddypress' ); ?></p>
 
 			<p id="avatar-upload">
 				<input type="file" name="file" id="file" />
-				<input type="submit" name="upload" id="upload" value="<?php _e( 'Upload Image', 'buddypress' ) ?>" />
+				<input type="submit" name="upload" id="upload" value="<?php _e( 'Upload Image', 'buddypress' ); ?>" />
 				<input type="hidden" name="action" id="action" value="bp_avatar_upload" />
 			</p>
 
 			<?php if ( bp_get_user_has_avatar() ) : ?>
-				<p><?php _e( "If you'd like to delete your current avatar but not upload a new one, please use the delete avatar button.", 'buddypress' ) ?></p>
-				<p><a class="button edit" href="<?php bp_avatar_delete_link() ?>" title="<?php _e( 'Delete Avatar', 'buddypress' ) ?>"><?php _e( 'Delete My Avatar', 'buddypress' ) ?></a></p>
+				<p><?php _e( "If you'd like to delete your current avatar but not upload a new one, please use the delete avatar button.", 'buddypress' ); ?></p>
+				<p><a class="button edit" href="<?php bp_avatar_delete_link(); ?>" title="<?php _e( 'Delete Avatar', 'buddypress' ); ?>"><?php _e( 'Delete My Avatar', 'buddypress' ); ?></a></p>
 			<?php endif; ?>
 
 		<?php endif; ?>
 
 		<?php if ( 'crop-image' == bp_get_avatar_admin_step() ) : ?>
 
-			<h5><?php _e( 'Crop Your New Avatar', 'buddypress' ) ?></h5>
+			<h5><?php _e( 'Crop Your New Avatar', 'buddypress' ); ?></h5>
 
-			<img src="<?php bp_avatar_to_crop() ?>" id="avatar-to-crop" class="avatar" alt="<?php _e( 'Avatar to crop', 'buddypress' ) ?>" />
+			<img src="<?php bp_avatar_to_crop(); ?>" id="avatar-to-crop" class="avatar" alt="<?php _e( 'Avatar to crop', 'buddypress' ); ?>" />
 
 			<div id="avatar-crop-pane">
-				<img src="<?php bp_avatar_to_crop() ?>" id="avatar-crop-preview" class="avatar" alt="<?php _e( 'Avatar preview', 'buddypress' ) ?>" />
+				<img src="<?php bp_avatar_to_crop(); ?>" id="avatar-crop-preview" class="avatar" alt="<?php _e( 'Avatar preview', 'buddypress' ); ?>" />
 			</div>
 
-			<input type="submit" name="avatar-crop-submit" id="avatar-crop-submit" value="<?php _e( 'Crop Image', 'buddypress' ) ?>" />
+			<input type="submit" name="avatar-crop-submit" id="avatar-crop-submit" value="<?php _e( 'Crop Image', 'buddypress' ); ?>" />
 
-			<input type="hidden" name="image_src" id="image_src" value="<?php bp_avatar_to_crop_src() ?>" />
+			<input type="hidden" name="image_src" id="image_src" value="<?php bp_avatar_to_crop_src(); ?>" />
 			<input type="hidden" id="x" name="x" />
 			<input type="hidden" id="y" name="y" />
 			<input type="hidden" id="w" name="w" />
 			<input type="hidden" id="h" name="h" />
 
-			<?php wp_nonce_field( 'bp_avatar_cropstore' ) ?>
+			<?php wp_nonce_field( 'bp_avatar_cropstore' ); ?>
 
 		<?php endif; ?>
 
@@ -52,8 +52,8 @@
 
 <?php else : ?>
 
-	<p><?php _e( 'Your avatar will be used on your profile and throughout the site. To change your avatar, please create an account with <a href="http://gravatar.com">Gravatar</a> using the same email address as you used to register with this site.', 'buddypress' ) ?></p>
+	<p><?php _e( 'Your avatar will be used on your profile and throughout the site. To change your avatar, please create an account with <a href="http://gravatar.com">Gravatar</a> using the same email address as you used to register with this site.', 'buddypress' ); ?></p>
 
 <?php endif; ?>
 
-<?php do_action( 'bp_after_profile_avatar_upload_content' ) ?>
+<?php do_action( 'bp_after_profile_avatar_upload_content' ); ?>
diff --git a/wp-content/plugins/buddypress/bp-themes/bp-default/members/single/profile/edit.php b/wp-content/plugins/buddypress/bp-themes/bp-default/members/single/profile/edit.php
index e863b1a0aa43ad67378d1a63feae98f66ee2cc18..9b4586fa93ee497c33e34a2ecb2b18311a9fa298 100644
--- a/wp-content/plugins/buddypress/bp-themes/bp-default/members/single/profile/edit.php
+++ b/wp-content/plugins/buddypress/bp-themes/bp-default/members/single/profile/edit.php
@@ -19,7 +19,7 @@ if ( bp_has_profile( 'profile_group_id=' . bp_get_current_profile_group_id() ) )
 
 		<?php while ( bp_profile_fields() ) : bp_the_profile_field(); ?>
 
-			<div<?php bp_field_css_class( 'editfield' ) ?>>
+			<div<?php bp_field_css_class( 'editfield' ); ?>>
 
 				<?php if ( 'textbox' == bp_get_the_profile_field_type() ) : ?>
 
@@ -30,7 +30,7 @@ if ( bp_has_profile( 'profile_group_id=' . bp_get_current_profile_group_id() ) )
 
 				<?php if ( 'textarea' == bp_get_the_profile_field_type() ) : ?>
 
-					<label for="<?php bp_the_profile_field_input_name() ?>"><?php bp_the_profile_field_name(); ?> <?php if ( bp_get_the_profile_field_is_required() ) : ?><?php _e( '(required)', 'buddypress' ); ?><?php endif; ?></label>
+					<label for="<?php bp_the_profile_field_input_name(); ?>"><?php bp_the_profile_field_name(); ?> <?php if ( bp_get_the_profile_field_is_required() ) : ?><?php _e( '(required)', 'buddypress' ); ?><?php endif; ?></label>
 					<textarea rows="5" cols="40" name="<?php bp_the_profile_field_input_name(); ?>" id="<?php bp_the_profile_field_input_name(); ?>" <?php if ( bp_get_the_profile_field_is_required() ) : ?>aria-required="true"<?php endif; ?>><?php bp_the_profile_field_edit_value(); ?></textarea>
 
 				<?php endif; ?>
@@ -39,15 +39,15 @@ if ( bp_has_profile( 'profile_group_id=' . bp_get_current_profile_group_id() ) )
 
 					<label for="<?php bp_the_profile_field_input_name(); ?>"><?php bp_the_profile_field_name(); ?> <?php if ( bp_get_the_profile_field_is_required() ) : ?><?php _e( '(required)', 'buddypress' ); ?><?php endif; ?></label>
 					<select name="<?php bp_the_profile_field_input_name(); ?>" id="<?php bp_the_profile_field_input_name(); ?>" <?php if ( bp_get_the_profile_field_is_required() ) : ?>aria-required="true"<?php endif; ?>>
-						<?php bp_the_profile_field_options() ?>
+						<?php bp_the_profile_field_options(); ?>
 					</select>
 
 				<?php endif; ?>
 
 				<?php if ( 'multiselectbox' == bp_get_the_profile_field_type() ) : ?>
 
-					<label for="<?php bp_the_profile_field_input_name() ?>"><?php bp_the_profile_field_name() ?> <?php if ( bp_get_the_profile_field_is_required() ) : ?><?php _e( '(required)', 'buddypress' ); ?><?php endif; ?></label>
-					<select name="<?php bp_the_profile_field_input_name() ?>" id="<?php bp_the_profile_field_input_name() ?>" multiple="multiple" <?php if ( bp_get_the_profile_field_is_required() ) : ?>aria-required="true"<?php endif; ?>>
+					<label for="<?php bp_the_profile_field_input_name(); ?>"><?php bp_the_profile_field_name(); ?> <?php if ( bp_get_the_profile_field_is_required() ) : ?><?php _e( '(required)', 'buddypress' ); ?><?php endif; ?></label>
+					<select name="<?php bp_the_profile_field_input_name(); ?>" id="<?php bp_the_profile_field_input_name(); ?>" multiple="multiple" <?php if ( bp_get_the_profile_field_is_required() ) : ?>aria-required="true"<?php endif; ?>>
 
 						<?php bp_the_profile_field_options(); ?>
 
@@ -98,13 +98,13 @@ if ( bp_has_profile( 'profile_group_id=' . bp_get_current_profile_group_id() ) )
 
 						</select>
 
-						<select name="<?php bp_the_profile_field_input_name() ?>_month" id="<?php bp_the_profile_field_input_name(); ?>_month" <?php if ( bp_get_the_profile_field_is_required() ) : ?>aria-required="true"<?php endif; ?>>
+						<select name="<?php bp_the_profile_field_input_name(); ?>_month" id="<?php bp_the_profile_field_input_name(); ?>_month" <?php if ( bp_get_the_profile_field_is_required() ) : ?>aria-required="true"<?php endif; ?>>
 
 							<?php bp_the_profile_field_options( 'type=month' ); ?>
 
 						</select>
 
-						<select name="<?php bp_the_profile_field_input_name() ?>_year" id="<?php bp_the_profile_field_input_name(); ?>_year" <?php if ( bp_get_the_profile_field_is_required() ) : ?>aria-required="true"<?php endif; ?>>
+						<select name="<?php bp_the_profile_field_input_name(); ?>_year" id="<?php bp_the_profile_field_input_name(); ?>_year" <?php if ( bp_get_the_profile_field_is_required() ) : ?>aria-required="true"<?php endif; ?>>
 
 							<?php bp_the_profile_field_options( 'type=year' ); ?>
 
@@ -113,6 +113,26 @@ if ( bp_has_profile( 'profile_group_id=' . bp_get_current_profile_group_id() ) )
 
 				<?php endif; ?>
 
+				<?php if ( bp_current_user_can( 'bp_xprofile_change_field_visibility' ) ) : ?>
+					<p class="field-visibility-settings-toggle" id="field-visibility-settings-toggle-<?php bp_the_profile_field_id() ?>">
+						<?php printf( __( 'This field can be seen by: <span class="current-visibility-level">%s</span>', 'buddypress' ), bp_get_the_profile_field_visibility_level_label() ) ?> <a href="#" class="visibility-toggle-link"><?php _e( 'Change', 'buddypress' ); ?></a>
+					</p>
+
+					<div class="field-visibility-settings" id="field-visibility-settings-<?php bp_the_profile_field_id() ?>">
+						<fieldset>
+							<legend><?php _e( 'Who can see this field?', 'buddypress' ) ?></legend>
+
+							<?php bp_profile_visibility_radio_buttons() ?>
+
+						</fieldset>
+						<a class="field-visibility-settings-close" href="#"><?php _e( 'Close', 'buddypress' ) ?></a>
+					</div>
+				<?php else : ?>
+					<div class="field-visibility-settings-notoggle" id="field-visibility-settings-toggle-<?php bp_the_profile_field_id() ?>">
+						<?php printf( __( 'This field can be seen by: <span class="current-visibility-level">%s</span>', 'buddypress' ), bp_get_the_profile_field_visibility_level_label() ) ?>
+					</div>
+				<?php endif ?>
+
 				<?php do_action( 'bp_custom_profile_edit_fields' ); ?>
 
 				<p class="description"><?php bp_the_profile_field_description(); ?></p>
diff --git a/wp-content/plugins/buddypress/bp-themes/bp-default/members/single/profile/profile-wp.php b/wp-content/plugins/buddypress/bp-themes/bp-default/members/single/profile/profile-wp.php
index 9756265b683e3f05f0d595902e24b2850fc3d39d..cc00f7d0a33d37965c15423a071fac27e7507a25 100644
--- a/wp-content/plugins/buddypress/bp-themes/bp-default/members/single/profile/profile-wp.php
+++ b/wp-content/plugins/buddypress/bp-themes/bp-default/members/single/profile/profile-wp.php
@@ -1,8 +1,8 @@
-<?php do_action( 'bp_before_profile_loop_content' ) ?>
+<?php do_action( 'bp_before_profile_loop_content' ); ?>
 
 <?php $ud = get_userdata( bp_displayed_user_id() ); ?>
 
-<?php do_action( 'bp_before_profile_field_content' ) ?>
+<?php do_action( 'bp_before_profile_field_content' ); ?>
 
 	<div class="bp-widget wp-profile">
 		<h4><?php bp_is_my_profile() ? _e( 'My Profile', 'buddypress' ) : printf( __( "%s's Profile", 'buddypress' ), bp_get_displayed_user_fullname() ); ?></h4>
@@ -66,8 +66,8 @@
 		</table>
 	</div>
 
-<?php do_action( 'bp_after_profile_field_content' ) ?>
+<?php do_action( 'bp_after_profile_field_content' ); ?>
 
-<?php do_action( 'bp_profile_field_buttons' ) ?>
+<?php do_action( 'bp_profile_field_buttons' ); ?>
 
-<?php do_action( 'bp_after_profile_loop_content' ) ?>
+<?php do_action( 'bp_after_profile_loop_content' ); ?>
diff --git a/wp-content/plugins/buddypress/bp-themes/bp-default/members/single/settings/capabilities.php b/wp-content/plugins/buddypress/bp-themes/bp-default/members/single/settings/capabilities.php
new file mode 100644
index 0000000000000000000000000000000000000000..19ba3d094074d130242fcd167ecc5c53a4a808a7
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-themes/bp-default/members/single/settings/capabilities.php
@@ -0,0 +1,81 @@
+<?php
+
+/**
+ * BuddyPress Delete Account
+ *
+ * @package BuddyPress
+ * @subpackage bp-default
+ */
+
+get_header( 'buddypress' ); ?>
+
+	<div id="content">
+		<div class="padder">
+
+			<?php do_action( 'bp_before_member_settings_template' ); ?>
+
+			<div id="item-header">
+
+				<?php locate_template( array( 'members/single/member-header.php' ), true ); ?>
+
+			</div><!-- #item-header -->
+
+			<div id="item-nav">
+				<div class="item-list-tabs no-ajax" id="object-nav" role="navigation">
+					<ul>
+
+						<?php bp_get_displayed_user_nav(); ?>
+
+						<?php do_action( 'bp_member_options_nav' ); ?>
+
+					</ul>
+				</div>
+			</div><!-- #item-nav -->
+
+			<div id="item-body" role="main">
+
+				<?php do_action( 'bp_before_member_body' ); ?>
+
+				<div class="item-list-tabs no-ajax" id="subnav">
+					<ul>
+
+						<?php bp_get_options_nav(); ?>
+
+						<?php do_action( 'bp_member_plugin_options_nav' ); ?>
+
+					</ul>
+				</div><!-- .item-list-tabs -->
+
+				<h3><?php _e( 'Capabilities', 'buddypress' ); ?></h3>
+
+				<form action="<?php echo bp_displayed_user_domain() . bp_get_settings_slug() . '/capabilities/'; ?>" name="account-capabilities-form" id="account-capabilities-form" class="standard-form" method="post">
+
+					<?php do_action( 'bp_members_capabilities_account_before_submit' ); ?>
+
+					<label>
+						<input type="checkbox" name="user-spammer" id="user-spammer" value="1" <?php checked( bp_is_user_spammer( bp_displayed_user_id() ) ); ?> />
+						 <?php _e( 'This user is a spammer.', 'buddypress' ); ?>
+					</label>
+
+					<div class="submit">
+						<input type="submit" value="<?php _e( 'Save', 'buddypress' ); ?>" id="capabilities-submit" name="capabilities-submit" />
+					</div>
+
+					<?php do_action( 'bp_members_capabilities_account_after_submit' ); ?>
+
+					<?php wp_nonce_field( 'capabilities' ); ?>
+
+				</form>
+
+				<?php do_action( 'bp_after_member_body' ); ?>
+
+			</div><!-- #item-body -->
+
+			<?php do_action( 'bp_after_member_settings_template' ); ?>
+
+		</div><!-- .padder -->
+	</div><!-- #content -->
+
+<?php get_sidebar( 'buddypress' ); ?>
+
+<?php get_footer( 'buddypress' ); ?>
\ No newline at end of file
diff --git a/wp-content/plugins/buddypress/bp-themes/bp-default/members/single/settings/delete-account.php b/wp-content/plugins/buddypress/bp-themes/bp-default/members/single/settings/delete-account.php
index d67f4835502898a4217ef51e7c789f8473c79324..c99a7d3ed8cc72e0d3155e0d5dc89c22b808563a 100644
--- a/wp-content/plugins/buddypress/bp-themes/bp-default/members/single/settings/delete-account.php
+++ b/wp-content/plugins/buddypress/bp-themes/bp-default/members/single/settings/delete-account.php
@@ -8,7 +8,7 @@
  */
 ?>
 
-<?php get_header( 'buddypress' ) ?>
+<?php get_header( 'buddypress' ); ?>
 
 	<div id="content">
 		<div class="padder">
@@ -49,23 +49,37 @@
 
 				<h3><?php _e( 'Delete Account', 'buddypress' ); ?></h3>
 
-				<form action="<?php echo bp_displayed_user_domain() . bp_get_settings_slug() . '/delete-account'; ?>" name="account-delete-form" id="account-delete-form" class="standard-form" method="post">
+				<div id="message" class="info">
+					
+					<?php if ( bp_is_my_profile() ) : ?>
 
-					<div id="message" class="info">
-						<p><?php _e( 'WARNING: Deleting your account will completely remove ALL content associated with it. There is no way back, please be careful with this option.', 'buddypress' ); ?></p>
-					</div>
+						<p><?php _e( 'Deleting your account will delete all of the content you have created. It will be completely irrecoverable.', 'buddypress' ); ?></p>
+						
+					<?php else : ?>
+
+						<p><?php _e( 'Deleting this account will delete all of the content it has created. It will be completely irrecoverable.', 'buddypress' ); ?></p>
 
-					<input type="checkbox" name="delete-account-understand" id="delete-account-understand" value="1" onclick="if(this.checked) { document.getElementById('delete-account-button').disabled = ''; } else { document.getElementById('delete-account-button').disabled = 'disabled'; }" /> <?php _e( 'I understand the consequences of deleting my account.', 'buddypress' ); ?>
+					<?php endif; ?>
+
+				</div>
+
+				<form action="<?php echo bp_displayed_user_domain() . bp_get_settings_slug() . '/delete-account'; ?>" name="account-delete-form" id="account-delete-form" class="standard-form" method="post">
 
 					<?php do_action( 'bp_members_delete_account_before_submit' ); ?>
 
+					<label>
+						<input type="checkbox" name="delete-account-understand" id="delete-account-understand" value="1" onclick="if(this.checked) { document.getElementById('delete-account-button').disabled = ''; } else { document.getElementById('delete-account-button').disabled = 'disabled'; }" />
+						 <?php _e( 'I understand the consequences.', 'buddypress' ); ?>
+					</label>
+
 					<div class="submit">
-						<input type="submit" disabled="disabled" value="<?php _e( 'Delete My Account', 'buddypress' ) ?>" id="delete-account-button" name="delete-account-button" />
+						<input type="submit" disabled="disabled" value="<?php _e( 'Delete Account', 'buddypress' ); ?>" id="delete-account-button" name="delete-account-button" />
 					</div>
 
 					<?php do_action( 'bp_members_delete_account_after_submit' ); ?>
 
 					<?php wp_nonce_field( 'delete-account' ); ?>
+
 				</form>
 
 				<?php do_action( 'bp_after_member_body' ); ?>
@@ -77,6 +91,6 @@
 		</div><!-- .padder -->
 	</div><!-- #content -->
 
-<?php get_sidebar( 'buddypress' ) ?>
+<?php get_sidebar( 'buddypress' ); ?>
 
-<?php get_footer( 'buddypress' ) ?>
\ No newline at end of file
+<?php get_footer( 'buddypress' ); ?>
\ No newline at end of file
diff --git a/wp-content/plugins/buddypress/bp-themes/bp-default/members/single/settings/general.php b/wp-content/plugins/buddypress/bp-themes/bp-default/members/single/settings/general.php
index 2bef2a1b4a0eee217b1e2f6c03af2c32c0494bab..f3bc0261c13a0962d7e7b1eaa4d216386bc601c1 100644
--- a/wp-content/plugins/buddypress/bp-themes/bp-default/members/single/settings/general.php
+++ b/wp-content/plugins/buddypress/bp-themes/bp-default/members/single/settings/general.php
@@ -6,9 +6,8 @@
  * @package BuddyPress
  * @subpackage bp-default
  */
-?>
 
-<?php get_header( 'buddypress' ) ?>
+get_header( 'buddypress' ); ?>
 
 	<div id="content">
 		<div class="padder">
@@ -49,12 +48,16 @@
 
 				<h3><?php _e( 'General Settings', 'buddypress' ); ?></h3>
 
-				<?php do_action( 'bp_template_content' ) ?>
+				<?php do_action( 'bp_template_content' ); ?>
 
 				<form action="<?php echo bp_displayed_user_domain() . bp_get_settings_slug() . '/general'; ?>" method="post" class="standard-form" id="settings-form">
 
-					<label for="pwd"><?php _e( 'Current Password <span>(required to update email or change current password)</span>', 'buddypress' ); ?></label>
-					<input type="password" name="pwd" id="pwd" size="16" value="" class="settings-input small" /> &nbsp;<a href="<?php echo site_url( add_query_arg( array( 'action' => 'lostpassword' ), 'wp-login.php' ), 'login' ); ?>" title="<?php _e( 'Password Lost and Found', 'buddypress' ); ?>"><?php _e( 'Lost your password?', 'buddypress' ); ?></a>
+					<?php if ( !is_super_admin() ) : ?>
+
+						<label for="pwd"><?php _e( 'Current Password <span>(required to update email or change current password)</span>', 'buddypress' ); ?></label>
+						<input type="password" name="pwd" id="pwd" size="16" value="" class="settings-input small" /> &nbsp;<a href="<?php echo site_url( add_query_arg( array( 'action' => 'lostpassword' ), 'wp-login.php' ), 'login' ); ?>" title="<?php _e( 'Password Lost and Found', 'buddypress' ); ?>"><?php _e( 'Lost your password?', 'buddypress' ); ?></a>
+
+					<?php endif; ?>
 
 					<label for="email"><?php _e( 'Account Email', 'buddypress' ); ?></label>
 					<input type="text" name="email" id="email" value="<?php echo bp_get_displayed_user_email(); ?>" class="settings-input" />
@@ -84,6 +87,6 @@
 		</div><!-- .padder -->
 	</div><!-- #content -->
 
-<?php get_sidebar( 'buddypress' ) ?>
+<?php get_sidebar( 'buddypress' ); ?>
 
-<?php get_footer( 'buddypress' ) ?>
\ No newline at end of file
+<?php get_footer( 'buddypress' ); ?>
\ No newline at end of file
diff --git a/wp-content/plugins/buddypress/bp-themes/bp-default/members/single/settings/notifications.php b/wp-content/plugins/buddypress/bp-themes/bp-default/members/single/settings/notifications.php
index 7a51f7b01013dbeb954b7586310f9a704dbaad5f..8d81b789a776e9b6a82473293f10fb4d8b0b8394 100644
--- a/wp-content/plugins/buddypress/bp-themes/bp-default/members/single/settings/notifications.php
+++ b/wp-content/plugins/buddypress/bp-themes/bp-default/members/single/settings/notifications.php
@@ -6,9 +6,8 @@
  * @package BuddyPress
  * @subpackage bp-default
  */
-?>
 
-<?php get_header( 'buddypress' ) ?>
+get_header( 'buddypress' ); ?>
 
 	<div id="content">
 		<div class="padder">
@@ -49,7 +48,7 @@
 
 				<h3><?php _e( 'Email Notification', 'buddypress' ); ?></h3>
 
-				<?php do_action( 'bp_template_content' ) ?>
+				<?php do_action( 'bp_template_content' ); ?>
 
 				<form action="<?php echo bp_displayed_user_domain() . bp_get_settings_slug() . '/notifications'; ?>" method="post" class="standard-form" id="settings-form">
 					<p><?php _e( 'Send a notification by email when:', 'buddypress' ); ?></p>
@@ -77,6 +76,6 @@
 		</div><!-- .padder -->
 	</div><!-- #content -->
 
-<?php get_sidebar( 'buddypress' ) ?>
+<?php get_sidebar( 'buddypress' ); ?>
 
-<?php get_footer( 'buddypress' ) ?>
\ No newline at end of file
+<?php get_footer( 'buddypress' ); ?>
\ No newline at end of file
diff --git a/wp-content/plugins/buddypress/bp-themes/bp-default/onecolumn-page.php b/wp-content/plugins/buddypress/bp-themes/bp-default/onecolumn-page.php
index f5d3261d043157701b933dfa3df9a6ac02b4b3ee..72976dfcf604c61b6c90171c2a82ebb2e305096b 100644
--- a/wp-content/plugins/buddypress/bp-themes/bp-default/onecolumn-page.php
+++ b/wp-content/plugins/buddypress/bp-themes/bp-default/onecolumn-page.php
@@ -6,15 +6,15 @@
  *
  * @package BuddyPress
  * @subpackage BP_Default
- * @since 1.5
+ * @since BuddyPress (1.5)
  */
 
-get_header() ?>
+get_header(); ?>
 
 	<div id="content">
 		<div class="padder one-column">
 
-		<?php do_action( 'bp_before_blog_page' ) ?>
+		<?php do_action( 'bp_before_blog_page' ); ?>
 
 		<div class="page" id="blog-page" role="main">
 
@@ -41,7 +41,7 @@ get_header() ?>
 
 		</div><!-- .page -->
 
-		<?php do_action( 'bp_after_blog_page' ) ?>
+		<?php do_action( 'bp_after_blog_page' ); ?>
 
 		</div><!-- .padder -->
 	</div><!-- #content -->
diff --git a/wp-content/plugins/buddypress/bp-themes/bp-default/page.php b/wp-content/plugins/buddypress/bp-themes/bp-default/page.php
index af0c10954c35ac96e8b5b431bdc8f78063706881..d3d65cd1f9af0d39ad59b88c69d96a8c28366c89 100644
--- a/wp-content/plugins/buddypress/bp-themes/bp-default/page.php
+++ b/wp-content/plugins/buddypress/bp-themes/bp-default/page.php
@@ -1,9 +1,9 @@
-<?php get_header() ?>
+<?php get_header(); ?>
 
 	<div id="content">
 		<div class="padder">
 
-		<?php do_action( 'bp_before_blog_page' ) ?>
+		<?php do_action( 'bp_before_blog_page' ); ?>
 
 		<div class="page" id="blog-page" role="main">
 
@@ -30,11 +30,11 @@
 
 		</div><!-- .page -->
 
-		<?php do_action( 'bp_after_blog_page' ) ?>
+		<?php do_action( 'bp_after_blog_page' ); ?>
 
 		</div><!-- .padder -->
 	</div><!-- #content -->
 
-	<?php get_sidebar() ?>
+	<?php get_sidebar(); ?>
 
 <?php get_footer(); ?>
diff --git a/wp-content/plugins/buddypress/bp-themes/bp-default/readme.txt b/wp-content/plugins/buddypress/bp-themes/bp-default/readme.txt
index ab411eeafce4bde629e65ef9314a257255a40c16..b2c7f6ff4bd41eda3e45d23b0e5fed86acf9f2d0 100644
--- a/wp-content/plugins/buddypress/bp-themes/bp-default/readme.txt
+++ b/wp-content/plugins/buddypress/bp-themes/bp-default/readme.txt
@@ -1,22 +1,22 @@
---- BuddyPress Default ---
-Clean and stylish, BuddyPress Default lets you build a social network straight out of the box. Make it yours with a custom menu, header image, and background. Along with five widgetized areas (one in the sidebar, four in the footer), BP-Default supports featured images (as custom header images on posts and pages) and is furnished with an optional one-column page template that removes the sidebar, and a stylesheet for the admin Visual Editor.
-
-
---- Installation ---
-The theme is bundled with BuddyPress. After activating the plugin, BuddyPress Default will be added to the "Appearance > Themes" menu in your WordPress admin area.
-
-
---- About BuddyPress ---
-Social networking in a box. Build a social network for your company, school, sports team or niche community all based on the power and flexibility of WordPress. BuddyPress will let users register on your site and start creating profiles, posting messages, making connections, creating and interacting in groups and much more.
-
-For help with BuddyPress Default, or for more information about BuddyPress, please visit http://buddypress.org/.
-
-
---- Building a BuddyPress theme ---
-If you want to make a custom theme based on BuddyPress Default, DO NOT copy and edit it. By doing this you will make updates and maintenance much harder for yourself. Instead, please review this codex page for instructions on how to build a BuddyPress child theme:
-
-http://codex.buddypress.org/how-to-guides/building-a-buddypress-child-theme/
-
-
---- Changelog ---
+--- BuddyPress Default ---
+Clean and stylish, BuddyPress Default lets you build a social network straight out of the box. Make it yours with a custom menu, header image, and background. Along with five widgetized areas (one in the sidebar, four in the footer), BP-Default supports featured images (as custom header images on posts and pages) and is furnished with an optional one-column page template that removes the sidebar, and a stylesheet for the admin Visual Editor.
+
+
+--- Installation ---
+The theme is bundled with BuddyPress. After activating the plugin, BuddyPress Default will be added to the "Appearance > Themes" menu in your WordPress admin area.
+
+
+--- About BuddyPress ---
+Social networking in a box. Build a social network for your company, school, sports team or niche community all based on the power and flexibility of WordPress. BuddyPress will let users register on your site and start creating profiles, posting messages, making connections, creating and interacting in groups and much more.
+
+For help with BuddyPress Default, or for more information about BuddyPress, please visit http://buddypress.org/.
+
+
+--- Building a BuddyPress theme ---
+If you want to make a custom theme based on BuddyPress Default, DO NOT copy and edit it. By doing this you will make updates and maintenance much harder for yourself. Instead, please review this codex page for instructions on how to build a BuddyPress child theme:
+
+http://codex.buddypress.org/how-to-guides/building-a-buddypress-child-theme/
+
+
+--- Changelog ---
 A list of changes is available at http://codex.buddypress.org/theme-development/bp-default-theme-changelog/.
\ No newline at end of file
diff --git a/wp-content/plugins/buddypress/bp-themes/bp-default/registration/activate.php b/wp-content/plugins/buddypress/bp-themes/bp-default/registration/activate.php
index f7fcf19d4672cf309172909738f313e8d3e3d6d5..a030263884cba7cb3e61b73122aa730efc7ad2de 100644
--- a/wp-content/plugins/buddypress/bp-themes/bp-default/registration/activate.php
+++ b/wp-content/plugins/buddypress/bp-themes/bp-default/registration/activate.php
@@ -3,52 +3,52 @@
 	<div id="content">
 		<div class="padder">
 
-		<?php do_action( 'bp_before_activation_page' ) ?>
+		<?php do_action( 'bp_before_activation_page' ); ?>
 
 		<div class="page" id="activate-page">
 
 			<?php if ( bp_account_was_activated() ) : ?>
 
-				<h2 class="widgettitle"><?php _e( 'Account Activated', 'buddypress' ) ?></h2>
+				<h2 class="widgettitle"><?php _e( 'Account Activated', 'buddypress' ); ?></h2>
 
-				<?php do_action( 'bp_before_activate_content' ) ?>
+				<?php do_action( 'bp_before_activate_content' ); ?>
 
 				<?php if ( isset( $_GET['e'] ) ) : ?>
-					<p><?php _e( 'Your account was activated successfully! Your account details have been sent to you in a separate email.', 'buddypress' ) ?></p>
+					<p><?php _e( 'Your account was activated successfully! Your account details have been sent to you in a separate email.', 'buddypress' ); ?></p>
 				<?php else : ?>
-					<p><?php _e( 'Your account was activated successfully! You can now log in with the username and password you provided when you signed up.', 'buddypress' ) ?></p>
+					<p><?php _e( 'Your account was activated successfully! You can now log in with the username and password you provided when you signed up.', 'buddypress' ); ?></p>
 				<?php endif; ?>
 
 			<?php else : ?>
 
-				<h3><?php _e( 'Activate your Account', 'buddypress' ) ?></h3>
+				<h3><?php _e( 'Activate your Account', 'buddypress' ); ?></h3>
 
-				<?php do_action( 'bp_before_activate_content' ) ?>
+				<?php do_action( 'bp_before_activate_content' ); ?>
 
-				<p><?php _e( 'Please provide a valid activation key.', 'buddypress' ) ?></p>
+				<p><?php _e( 'Please provide a valid activation key.', 'buddypress' ); ?></p>
 
 				<form action="" method="get" class="standard-form" id="activation-form">
 
-					<label for="key"><?php _e( 'Activation Key:', 'buddypress' ) ?></label>
+					<label for="key"><?php _e( 'Activation Key:', 'buddypress' ); ?></label>
 					<input type="text" name="key" id="key" value="" />
 
 					<p class="submit">
-						<input type="submit" name="submit" value="<?php _e( 'Activate', 'buddypress' ) ?>" />
+						<input type="submit" name="submit" value="<?php _e( 'Activate', 'buddypress' ); ?>" />
 					</p>
 
 				</form>
 
 			<?php endif; ?>
 
-			<?php do_action( 'bp_after_activate_content' ) ?>
+			<?php do_action( 'bp_after_activate_content' ); ?>
 
 		</div><!-- .page -->
 
-		<?php do_action( 'bp_after_activation_page' ) ?>
+		<?php do_action( 'bp_after_activation_page' ); ?>
 
 		</div><!-- .padder -->
 	</div><!-- #content -->
 
-	<?php get_sidebar( 'buddypress' ) ?>
+	<?php get_sidebar( 'buddypress' ); ?>
 
 <?php get_footer( 'buddypress' ); ?>
diff --git a/wp-content/plugins/buddypress/bp-themes/bp-default/registration/register.php b/wp-content/plugins/buddypress/bp-themes/bp-default/registration/register.php
index c841cf6fb32b26af4b7dab30d5ecb05968222add..35519388de8c2ca6e79a41d94b80b5babd970d82 100644
--- a/wp-content/plugins/buddypress/bp-themes/bp-default/registration/register.php
+++ b/wp-content/plugins/buddypress/bp-themes/bp-default/registration/register.php
@@ -1,17 +1,17 @@
-<?php get_header( 'buddypress' ) ?>
+<?php get_header( 'buddypress' ); ?>
 
 	<div id="content">
 		<div class="padder">
 
-		<?php do_action( 'bp_before_register_page' ) ?>
+		<?php do_action( 'bp_before_register_page' ); ?>
 
 		<div class="page" id="register-page">
 
 			<form action="" name="signup_form" id="signup_form" class="standard-form" method="post" enctype="multipart/form-data">
 
 			<?php if ( 'registration-disabled' == bp_get_current_signup_step() ) : ?>
-				<?php do_action( 'template_notices' ) ?>
-				<?php do_action( 'bp_before_registration_disabled' ) ?>
+				<?php do_action( 'template_notices' ); ?>
+				<?php do_action( 'bp_before_registration_disabled' ); ?>
 
 					<p><?php _e( 'User registration is currently not allowed.', 'buddypress' ); ?></p>
 
@@ -20,49 +20,49 @@
 
 			<?php if ( 'request-details' == bp_get_current_signup_step() ) : ?>
 
-				<h2><?php _e( 'Create an Account', 'buddypress' ) ?></h2>
+				<h2><?php _e( 'Create an Account', 'buddypress' ); ?></h2>
 
-				<?php do_action( 'template_notices' ) ?>
+				<?php do_action( 'template_notices' ); ?>
 
-				<p><?php _e( 'Registering for this site is easy, just fill in the fields below and we\'ll get a new account set up for you in no time.', 'buddypress' ) ?></p>
+				<p><?php _e( 'Registering for this site is easy, just fill in the fields below and we\'ll get a new account set up for you in no time.', 'buddypress' ); ?></p>
 
-				<?php do_action( 'bp_before_account_details_fields' ) ?>
+				<?php do_action( 'bp_before_account_details_fields' ); ?>
 
 				<div class="register-section" id="basic-details-section">
 
 					<?php /***** Basic Account Details ******/ ?>
 
-					<h4><?php _e( 'Account Details', 'buddypress' ) ?></h4>
+					<h4><?php _e( 'Account Details', 'buddypress' ); ?></h4>
 
-					<label for="signup_username"><?php _e( 'Username', 'buddypress' ) ?> <?php _e( '(required)', 'buddypress' ) ?></label>
-					<?php do_action( 'bp_signup_username_errors' ) ?>
-					<input type="text" name="signup_username" id="signup_username" value="<?php bp_signup_username_value() ?>" />
+					<label for="signup_username"><?php _e( 'Username', 'buddypress' ); ?> <?php _e( '(required)', 'buddypress' ); ?></label>
+					<?php do_action( 'bp_signup_username_errors' ); ?>
+					<input type="text" name="signup_username" id="signup_username" value="<?php bp_signup_username_value(); ?>" />
 
-					<label for="signup_email"><?php _e( 'Email Address', 'buddypress' ) ?> <?php _e( '(required)', 'buddypress' ) ?></label>
-					<?php do_action( 'bp_signup_email_errors' ) ?>
-					<input type="text" name="signup_email" id="signup_email" value="<?php bp_signup_email_value() ?>" />
+					<label for="signup_email"><?php _e( 'Email Address', 'buddypress' ); ?> <?php _e( '(required)', 'buddypress' ); ?></label>
+					<?php do_action( 'bp_signup_email_errors' ); ?>
+					<input type="text" name="signup_email" id="signup_email" value="<?php bp_signup_email_value(); ?>" />
 
-					<label for="signup_password"><?php _e( 'Choose a Password', 'buddypress' ) ?> <?php _e( '(required)', 'buddypress' ) ?></label>
-					<?php do_action( 'bp_signup_password_errors' ) ?>
+					<label for="signup_password"><?php _e( 'Choose a Password', 'buddypress' ); ?> <?php _e( '(required)', 'buddypress' ); ?></label>
+					<?php do_action( 'bp_signup_password_errors' ); ?>
 					<input type="password" name="signup_password" id="signup_password" value="" />
 
-					<label for="signup_password_confirm"><?php _e( 'Confirm Password', 'buddypress' ) ?> <?php _e( '(required)', 'buddypress' ) ?></label>
-					<?php do_action( 'bp_signup_password_confirm_errors' ) ?>
+					<label for="signup_password_confirm"><?php _e( 'Confirm Password', 'buddypress' ); ?> <?php _e( '(required)', 'buddypress' ); ?></label>
+					<?php do_action( 'bp_signup_password_confirm_errors' ); ?>
 					<input type="password" name="signup_password_confirm" id="signup_password_confirm" value="" />
 
 				</div><!-- #basic-details-section -->
 
-				<?php do_action( 'bp_after_account_details_fields' ) ?>
+				<?php do_action( 'bp_after_account_details_fields' ); ?>
 
 				<?php /***** Extra Profile Details ******/ ?>
 
 				<?php if ( bp_is_active( 'xprofile' ) ) : ?>
 
-					<?php do_action( 'bp_before_signup_profile_fields' ) ?>
+					<?php do_action( 'bp_before_signup_profile_fields' ); ?>
 
 					<div class="register-section" id="profile-details-section">
 
-						<h4><?php _e( 'Profile Details', 'buddypress' ) ?></h4>
+						<h4><?php _e( 'Profile Details', 'buddypress' ); ?></h4>
 
 						<?php /* Use the profile field loop to render input fields for the 'base' profile field group */ ?>
 						<?php if ( bp_is_active( 'xprofile' ) ) : if ( bp_has_profile( 'profile_group_id=1' ) ) : while ( bp_profile_groups() ) : bp_the_profile_group(); ?>
@@ -73,36 +73,36 @@
 
 								<?php if ( 'textbox' == bp_get_the_profile_field_type() ) : ?>
 
-									<label for="<?php bp_the_profile_field_input_name() ?>"><?php bp_the_profile_field_name() ?> <?php if ( bp_get_the_profile_field_is_required() ) : ?><?php _e( '(required)', 'buddypress' ) ?><?php endif; ?></label>
-									<?php do_action( 'bp_' . bp_get_the_profile_field_input_name() . '_errors' ) ?>
-									<input type="text" name="<?php bp_the_profile_field_input_name() ?>" id="<?php bp_the_profile_field_input_name() ?>" value="<?php bp_the_profile_field_edit_value() ?>" />
+									<label for="<?php bp_the_profile_field_input_name(); ?>"><?php bp_the_profile_field_name(); ?> <?php if ( bp_get_the_profile_field_is_required() ) : ?><?php _e( '(required)', 'buddypress' ); ?><?php endif; ?></label>
+									<?php do_action( 'bp_' . bp_get_the_profile_field_input_name() . '_errors' ); ?>
+									<input type="text" name="<?php bp_the_profile_field_input_name(); ?>" id="<?php bp_the_profile_field_input_name(); ?>" value="<?php bp_the_profile_field_edit_value(); ?>" />
 
 								<?php endif; ?>
 
 								<?php if ( 'textarea' == bp_get_the_profile_field_type() ) : ?>
 
-									<label for="<?php bp_the_profile_field_input_name() ?>"><?php bp_the_profile_field_name() ?> <?php if ( bp_get_the_profile_field_is_required() ) : ?><?php _e( '(required)', 'buddypress' ) ?><?php endif; ?></label>
-									<?php do_action( 'bp_' . bp_get_the_profile_field_input_name() . '_errors' ) ?>
-									<textarea rows="5" cols="40" name="<?php bp_the_profile_field_input_name() ?>" id="<?php bp_the_profile_field_input_name() ?>"><?php bp_the_profile_field_edit_value() ?></textarea>
+									<label for="<?php bp_the_profile_field_input_name(); ?>"><?php bp_the_profile_field_name(); ?> <?php if ( bp_get_the_profile_field_is_required() ) : ?><?php _e( '(required)', 'buddypress' ); ?><?php endif; ?></label>
+									<?php do_action( 'bp_' . bp_get_the_profile_field_input_name() . '_errors' ); ?>
+									<textarea rows="5" cols="40" name="<?php bp_the_profile_field_input_name(); ?>" id="<?php bp_the_profile_field_input_name(); ?>"><?php bp_the_profile_field_edit_value(); ?></textarea>
 
 								<?php endif; ?>
 
 								<?php if ( 'selectbox' == bp_get_the_profile_field_type() ) : ?>
 
-									<label for="<?php bp_the_profile_field_input_name() ?>"><?php bp_the_profile_field_name() ?> <?php if ( bp_get_the_profile_field_is_required() ) : ?><?php _e( '(required)', 'buddypress' ) ?><?php endif; ?></label>
-									<?php do_action( 'bp_' . bp_get_the_profile_field_input_name() . '_errors' ) ?>
-									<select name="<?php bp_the_profile_field_input_name() ?>" id="<?php bp_the_profile_field_input_name() ?>">
-										<?php bp_the_profile_field_options() ?>
+									<label for="<?php bp_the_profile_field_input_name(); ?>"><?php bp_the_profile_field_name(); ?> <?php if ( bp_get_the_profile_field_is_required() ) : ?><?php _e( '(required)', 'buddypress' ); ?><?php endif; ?></label>
+									<?php do_action( 'bp_' . bp_get_the_profile_field_input_name() . '_errors' ); ?>
+									<select name="<?php bp_the_profile_field_input_name(); ?>" id="<?php bp_the_profile_field_input_name(); ?>">
+										<?php bp_the_profile_field_options(); ?>
 									</select>
 
 								<?php endif; ?>
 
 								<?php if ( 'multiselectbox' == bp_get_the_profile_field_type() ) : ?>
 
-									<label for="<?php bp_the_profile_field_input_name() ?>"><?php bp_the_profile_field_name() ?> <?php if ( bp_get_the_profile_field_is_required() ) : ?><?php _e( '(required)', 'buddypress' ) ?><?php endif; ?></label>
-									<?php do_action( 'bp_' . bp_get_the_profile_field_input_name() . '_errors' ) ?>
-									<select name="<?php bp_the_profile_field_input_name() ?>" id="<?php bp_the_profile_field_input_name() ?>" multiple="multiple">
-										<?php bp_the_profile_field_options() ?>
+									<label for="<?php bp_the_profile_field_input_name(); ?>"><?php bp_the_profile_field_name(); ?> <?php if ( bp_get_the_profile_field_is_required() ) : ?><?php _e( '(required)', 'buddypress' ); ?><?php endif; ?></label>
+									<?php do_action( 'bp_' . bp_get_the_profile_field_input_name() . '_errors' ); ?>
+									<select name="<?php bp_the_profile_field_input_name(); ?>" id="<?php bp_the_profile_field_input_name(); ?>" multiple="multiple">
+										<?php bp_the_profile_field_options(); ?>
 									</select>
 
 								<?php endif; ?>
@@ -110,13 +110,13 @@
 								<?php if ( 'radio' == bp_get_the_profile_field_type() ) : ?>
 
 									<div class="radio">
-										<span class="label"><?php bp_the_profile_field_name() ?> <?php if ( bp_get_the_profile_field_is_required() ) : ?><?php _e( '(required)', 'buddypress' ) ?><?php endif; ?></span>
+										<span class="label"><?php bp_the_profile_field_name(); ?> <?php if ( bp_get_the_profile_field_is_required() ) : ?><?php _e( '(required)', 'buddypress' ); ?><?php endif; ?></span>
 
-										<?php do_action( 'bp_' . bp_get_the_profile_field_input_name() . '_errors' ) ?>
-										<?php bp_the_profile_field_options() ?>
+										<?php do_action( 'bp_' . bp_get_the_profile_field_input_name() . '_errors' ); ?>
+										<?php bp_the_profile_field_options(); ?>
 
 										<?php if ( !bp_get_the_profile_field_is_required() ) : ?>
-											<a class="clear-value" href="javascript:clear( '<?php bp_the_profile_field_input_name() ?>' );"><?php _e( 'Clear', 'buddypress' ) ?></a>
+											<a class="clear-value" href="javascript:clear( '<?php bp_the_profile_field_input_name(); ?>' );"><?php _e( 'Clear', 'buddypress' ); ?></a>
 										<?php endif; ?>
 									</div>
 
@@ -125,10 +125,10 @@
 								<?php if ( 'checkbox' == bp_get_the_profile_field_type() ) : ?>
 
 									<div class="checkbox">
-										<span class="label"><?php bp_the_profile_field_name() ?> <?php if ( bp_get_the_profile_field_is_required() ) : ?><?php _e( '(required)', 'buddypress' ) ?><?php endif; ?></span>
+										<span class="label"><?php bp_the_profile_field_name(); ?> <?php if ( bp_get_the_profile_field_is_required() ) : ?><?php _e( '(required)', 'buddypress' ); ?><?php endif; ?></span>
 
-										<?php do_action( 'bp_' . bp_get_the_profile_field_input_name() . '_errors' ) ?>
-										<?php bp_the_profile_field_options() ?>
+										<?php do_action( 'bp_' . bp_get_the_profile_field_input_name() . '_errors' ); ?>
+										<?php bp_the_profile_field_options(); ?>
 									</div>
 
 								<?php endif; ?>
@@ -136,124 +136,146 @@
 								<?php if ( 'datebox' == bp_get_the_profile_field_type() ) : ?>
 
 									<div class="datebox">
-										<label for="<?php bp_the_profile_field_input_name() ?>_day"><?php bp_the_profile_field_name() ?> <?php if ( bp_get_the_profile_field_is_required() ) : ?><?php _e( '(required)', 'buddypress' ) ?><?php endif; ?></label>
-										<?php do_action( 'bp_' . bp_get_the_profile_field_input_name() . '_errors' ) ?>
+										<label for="<?php bp_the_profile_field_input_name(); ?>_day"><?php bp_the_profile_field_name(); ?> <?php if ( bp_get_the_profile_field_is_required() ) : ?><?php _e( '(required)', 'buddypress' ); ?><?php endif; ?></label>
+										<?php do_action( 'bp_' . bp_get_the_profile_field_input_name() . '_errors' ); ?>
 
-										<select name="<?php bp_the_profile_field_input_name() ?>_day" id="<?php bp_the_profile_field_input_name() ?>_day">
-											<?php bp_the_profile_field_options( 'type=day' ) ?>
+										<select name="<?php bp_the_profile_field_input_name(); ?>_day" id="<?php bp_the_profile_field_input_name(); ?>_day">
+											<?php bp_the_profile_field_options( 'type=day' ); ?>
 										</select>
 
-										<select name="<?php bp_the_profile_field_input_name() ?>_month" id="<?php bp_the_profile_field_input_name() ?>_month">
-											<?php bp_the_profile_field_options( 'type=month' ) ?>
+										<select name="<?php bp_the_profile_field_input_name(); ?>_month" id="<?php bp_the_profile_field_input_name(); ?>_month">
+											<?php bp_the_profile_field_options( 'type=month' ); ?>
 										</select>
 
-										<select name="<?php bp_the_profile_field_input_name() ?>_year" id="<?php bp_the_profile_field_input_name() ?>_year">
-											<?php bp_the_profile_field_options( 'type=year' ) ?>
+										<select name="<?php bp_the_profile_field_input_name(); ?>_year" id="<?php bp_the_profile_field_input_name(); ?>_year">
+											<?php bp_the_profile_field_options( 'type=year' ); ?>
 										</select>
 									</div>
 
 								<?php endif; ?>
+								
+								<?php if ( bp_current_user_can( 'bp_xprofile_change_field_visibility' ) ) : ?>
+									<p class="field-visibility-settings-toggle" id="field-visibility-settings-toggle-<?php bp_the_profile_field_id() ?>">
+										<?php printf( __( 'This field can be seen by: <span class="current-visibility-level">%s</span>', 'buddypress' ), bp_get_the_profile_field_visibility_level_label() ) ?> <a href="#" class="visibility-toggle-link">Change</a>
+									</p>
+									
+									<div class="field-visibility-settings" id="field-visibility-settings-<?php bp_the_profile_field_id() ?>">
+										<fieldset>
+											<legend><?php _e( 'Who can see this field?', 'buddypress' ) ?></legend>
+										
+											<?php bp_profile_visibility_radio_buttons() ?>
+										
+										</fieldset>
+										<a class="field-visibility-settings-close" href="#"><?php _e( 'Close', 'buddypress' ) ?></a>
+										
+									</div>
+								<?php else : ?>
+									<p class="field-visibility-settings-notoggle" id="field-visibility-settings-toggle-<?php bp_the_profile_field_id() ?>">
+										<?php printf( __( 'This field can be seen by: <span class="current-visibility-level">%s</span>', 'buddypress' ), bp_get_the_profile_field_visibility_level_label() ) ?>
+									</p>			
+								<?php endif ?>
+
 
-								<?php do_action( 'bp_custom_profile_edit_fields' ) ?>
+								<?php do_action( 'bp_custom_profile_edit_fields' ); ?>
 
-								<p class="description"><?php bp_the_profile_field_description() ?></p>
+								<p class="description"><?php bp_the_profile_field_description(); ?></p>
 
 							</div>
 
 						<?php endwhile; ?>
 
-						<input type="hidden" name="signup_profile_field_ids" id="signup_profile_field_ids" value="<?php bp_the_profile_group_field_ids() ?>" />
+						<input type="hidden" name="signup_profile_field_ids" id="signup_profile_field_ids" value="<?php bp_the_profile_group_field_ids(); ?>" />
 
 						<?php endwhile; endif; endif; ?>
 
 					</div><!-- #profile-details-section -->
 
-					<?php do_action( 'bp_after_signup_profile_fields' ) ?>
+					<?php do_action( 'bp_after_signup_profile_fields' ); ?>
 
 				<?php endif; ?>
 
 				<?php if ( bp_get_blog_signup_allowed() ) : ?>
 
-					<?php do_action( 'bp_before_blog_details_fields' ) ?>
+					<?php do_action( 'bp_before_blog_details_fields' ); ?>
 
 					<?php /***** Blog Creation Details ******/ ?>
 
 					<div class="register-section" id="blog-details-section">
 
-						<h4><?php _e( 'Blog Details', 'buddypress' ) ?></h4>
+						<h4><?php _e( 'Blog Details', 'buddypress' ); ?></h4>
 
-						<p><input type="checkbox" name="signup_with_blog" id="signup_with_blog" value="1"<?php if ( (int) bp_get_signup_with_blog_value() ) : ?> checked="checked"<?php endif; ?> /> <?php _e( 'Yes, I\'d like to create a new site', 'buddypress' ) ?></p>
+						<p><input type="checkbox" name="signup_with_blog" id="signup_with_blog" value="1"<?php if ( (int) bp_get_signup_with_blog_value() ) : ?> checked="checked"<?php endif; ?> /> <?php _e( 'Yes, I\'d like to create a new site', 'buddypress' ); ?></p>
 
 						<div id="blog-details"<?php if ( (int) bp_get_signup_with_blog_value() ) : ?>class="show"<?php endif; ?>>
 
-							<label for="signup_blog_url"><?php _e( 'Blog URL', 'buddypress' ) ?> <?php _e( '(required)', 'buddypress' ) ?></label>
-							<?php do_action( 'bp_signup_blog_url_errors' ) ?>
+							<label for="signup_blog_url"><?php _e( 'Blog URL', 'buddypress' ); ?> <?php _e( '(required)', 'buddypress' ); ?></label>
+							<?php do_action( 'bp_signup_blog_url_errors' ); ?>
 
 							<?php if ( is_subdomain_install() ) : ?>
-								http:// <input type="text" name="signup_blog_url" id="signup_blog_url" value="<?php bp_signup_blog_url_value() ?>" /> .<?php bp_blogs_subdomain_base() ?>
+								http:// <input type="text" name="signup_blog_url" id="signup_blog_url" value="<?php bp_signup_blog_url_value(); ?>" /> .<?php bp_blogs_subdomain_base(); ?>
 							<?php else : ?>
-								<?php echo site_url() ?>/ <input type="text" name="signup_blog_url" id="signup_blog_url" value="<?php bp_signup_blog_url_value() ?>" />
+								<?php echo site_url(); ?>/ <input type="text" name="signup_blog_url" id="signup_blog_url" value="<?php bp_signup_blog_url_value(); ?>" />
 							<?php endif; ?>
 
-							<label for="signup_blog_title"><?php _e( 'Site Title', 'buddypress' ) ?> <?php _e( '(required)', 'buddypress' ) ?></label>
-							<?php do_action( 'bp_signup_blog_title_errors' ) ?>
-							<input type="text" name="signup_blog_title" id="signup_blog_title" value="<?php bp_signup_blog_title_value() ?>" />
+							<label for="signup_blog_title"><?php _e( 'Site Title', 'buddypress' ); ?> <?php _e( '(required)', 'buddypress' ); ?></label>
+							<?php do_action( 'bp_signup_blog_title_errors' ); ?>
+							<input type="text" name="signup_blog_title" id="signup_blog_title" value="<?php bp_signup_blog_title_value(); ?>" />
 
-							<span class="label"><?php _e( 'I would like my site to appear in search engines, and in public listings around this network.', 'buddypress' ) ?>:</span>
-							<?php do_action( 'bp_signup_blog_privacy_errors' ) ?>
+							<span class="label"><?php _e( 'I would like my site to appear in search engines, and in public listings around this network.', 'buddypress' ); ?>:</span>
+							<?php do_action( 'bp_signup_blog_privacy_errors' ); ?>
 
-							<label><input type="radio" name="signup_blog_privacy" id="signup_blog_privacy_public" value="public"<?php if ( 'public' == bp_get_signup_blog_privacy_value() || !bp_get_signup_blog_privacy_value() ) : ?> checked="checked"<?php endif; ?> /> <?php _e( 'Yes', 'buddypress' ) ?></label>
-							<label><input type="radio" name="signup_blog_privacy" id="signup_blog_privacy_private" value="private"<?php if ( 'private' == bp_get_signup_blog_privacy_value() ) : ?> checked="checked"<?php endif; ?> /> <?php _e( 'No', 'buddypress' ) ?></label>
+							<label><input type="radio" name="signup_blog_privacy" id="signup_blog_privacy_public" value="public"<?php if ( 'public' == bp_get_signup_blog_privacy_value() || !bp_get_signup_blog_privacy_value() ) : ?> checked="checked"<?php endif; ?> /> <?php _e( 'Yes', 'buddypress' ); ?></label>
+							<label><input type="radio" name="signup_blog_privacy" id="signup_blog_privacy_private" value="private"<?php if ( 'private' == bp_get_signup_blog_privacy_value() ) : ?> checked="checked"<?php endif; ?> /> <?php _e( 'No', 'buddypress' ); ?></label>
 
 						</div>
 
 					</div><!-- #blog-details-section -->
 
-					<?php do_action( 'bp_after_blog_details_fields' ) ?>
+					<?php do_action( 'bp_after_blog_details_fields' ); ?>
 
 				<?php endif; ?>
 
-				<?php do_action( 'bp_before_registration_submit_buttons' ) ?>
+				<?php do_action( 'bp_before_registration_submit_buttons' ); ?>
 
 				<div class="submit">
-					<input type="submit" name="signup_submit" id="signup_submit" value="<?php _e( 'Complete Sign Up', 'buddypress' ) ?>" />
+					<input type="submit" name="signup_submit" id="signup_submit" value="<?php _e( 'Complete Sign Up', 'buddypress' ); ?>" />
 				</div>
 
-				<?php do_action( 'bp_after_registration_submit_buttons' ) ?>
+				<?php do_action( 'bp_after_registration_submit_buttons' ); ?>
 
-				<?php wp_nonce_field( 'bp_new_signup' ) ?>
+				<?php wp_nonce_field( 'bp_new_signup' ); ?>
 
 			<?php endif; // request-details signup step ?>
 
 			<?php if ( 'completed-confirmation' == bp_get_current_signup_step() ) : ?>
 
-				<h2><?php _e( 'Sign Up Complete!', 'buddypress' ) ?></h2>
+				<h2><?php _e( 'Sign Up Complete!', 'buddypress' ); ?></h2>
 
-				<?php do_action( 'template_notices' ) ?>
-				<?php do_action( 'bp_before_registration_confirmed' ) ?>
+				<?php do_action( 'template_notices' ); ?>
+				<?php do_action( 'bp_before_registration_confirmed' ); ?>
 
 				<?php if ( bp_registration_needs_activation() ) : ?>
-					<p><?php _e( 'You have successfully created your account! To begin using this site you will need to activate your account via the email we have just sent to your address.', 'buddypress' ) ?></p>
+					<p><?php _e( 'You have successfully created your account! To begin using this site you will need to activate your account via the email we have just sent to your address.', 'buddypress' ); ?></p>
 				<?php else : ?>
-					<p><?php _e( 'You have successfully created your account! Please log in using the username and password you have just created.', 'buddypress' ) ?></p>
+					<p><?php _e( 'You have successfully created your account! Please log in using the username and password you have just created.', 'buddypress' ); ?></p>
 				<?php endif; ?>
 
-				<?php do_action( 'bp_after_registration_confirmed' ) ?>
+				<?php do_action( 'bp_after_registration_confirmed' ); ?>
 
 			<?php endif; // completed-confirmation signup step ?>
 
-			<?php do_action( 'bp_custom_signup_steps' ) ?>
+			<?php do_action( 'bp_custom_signup_steps' ); ?>
 
 			</form>
 
 		</div>
 
-		<?php do_action( 'bp_after_register_page' ) ?>
+		<?php do_action( 'bp_after_register_page' ); ?>
 
 		</div><!-- .padder -->
 	</div><!-- #content -->
 
-	<?php get_sidebar( 'buddypress' ) ?>
+	<?php get_sidebar( 'buddypress' ); ?>
 
 	<script type="text/javascript">
 		jQuery(document).ready( function() {
@@ -266,4 +288,4 @@
 		});
 	</script>
 
-<?php get_footer( 'buddypress' ) ?>
\ No newline at end of file
+<?php get_footer( 'buddypress' ); ?>
\ No newline at end of file
diff --git a/wp-content/plugins/buddypress/bp-themes/bp-default/rtl.css b/wp-content/plugins/buddypress/bp-themes/bp-default/rtl.css
index 23c5fec327c406bf4d32af329202515b9b5e650a..144fe52e7337fabc5c047f1a7b9ea49f2856d841 100644
--- a/wp-content/plugins/buddypress/bp-themes/bp-default/rtl.css
+++ b/wp-content/plugins/buddypress/bp-themes/bp-default/rtl.css
@@ -2,7 +2,7 @@
  * Theme Name: BuddyPress Default
  * Theme URI: http://buddypress.org/extend/themes/
  * Description: Clean and stylish, BuddyPress Default lets you build a social network straight out of the box. Make it yours with a custom menu, header image, and background. Along with five widgetized areas (one in the sidebar, four in the footer), BP-Default supports featured images (as custom header images on posts and pages) and is furnished with an optional one-column page template that removes the sidebar, and a stylesheet for the admin Visual Editor.
- * Version: 1.5.3.1
+ * Version: 1.6.2
  * Author: the BuddyPress team
  * Author URI: http://buddypress.org
  * License: GNU General Public License
diff --git a/wp-content/plugins/buddypress/bp-themes/bp-default/search.php b/wp-content/plugins/buddypress/bp-themes/bp-default/search.php
index 54eae9f65e5e3e8d55edc143f1821b87fd2ac299..19bde077a63926148e83ea44b1fbff36264223ef 100644
--- a/wp-content/plugins/buddypress/bp-themes/bp-default/search.php
+++ b/wp-content/plugins/buddypress/bp-themes/bp-default/search.php
@@ -1,33 +1,33 @@
-<?php get_header() ?>
+<?php get_header(); ?>
 
 	<div id="content">
 		<div class="padder">
 
-		<?php do_action( 'bp_before_blog_search' ) ?>
+		<?php do_action( 'bp_before_blog_search' ); ?>
 
 		<div class="page" id="blog-search" role="main">
 
-			<h2 class="pagetitle"><?php _e( 'Site', 'buddypress' ) ?></h2>
+			<h2 class="pagetitle"><?php _e( 'Site', 'buddypress' ); ?></h2>
 
 			<?php if (have_posts()) : ?>
 
-				<h3 class="pagetitle"><?php _e( 'Search Results', 'buddypress' ) ?></h3>
+				<h3 class="pagetitle"><?php _e( 'Search Results', 'buddypress' ); ?></h3>
 
 				<?php bp_dtheme_content_nav( 'nav-above' ); ?>
 
 				<?php while (have_posts()) : the_post(); ?>
 
-					<?php do_action( 'bp_before_blog_post' ) ?>
+					<?php do_action( 'bp_before_blog_post' ); ?>
 
 					<div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
 
 						<div class="author-box">
 							<?php echo get_avatar( get_the_author_meta( 'email' ), '50' ); ?>
-							<p><?php printf( _x( 'by %s', 'Post written by...', 'buddypress' ), bp_core_get_userlink( $post->post_author ) ) ?></p>
+							<p><?php printf( _x( 'by %s', 'Post written by...', 'buddypress' ), bp_core_get_userlink( $post->post_author ) ); ?></p>
 						</div>
 
 						<div class="post-content">
-							<h2 class="posttitle"><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php _e( 'Permanent Link to', 'buddypress' ) ?> <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>
+							<h2 class="posttitle"><a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php _e( 'Permanent Link to', 'buddypress' ); ?> <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>
 
 							<p class="date"><?php printf( __( '%1$s <span>in %2$s</span>', 'buddypress' ), get_the_date(), get_the_category_list( ', ' ) ); ?></p>
 
@@ -40,7 +40,7 @@
 
 					</div>
 
-					<?php do_action( 'bp_after_blog_post' ) ?>
+					<?php do_action( 'bp_after_blog_post' ); ?>
 
 				<?php endwhile; ?>
 
@@ -48,18 +48,18 @@
 
 			<?php else : ?>
 
-				<h2 class="center"><?php _e( 'No posts found. Try a different search?', 'buddypress' ) ?></h2>
-				<?php get_search_form() ?>
+				<h2 class="center"><?php _e( 'No posts found. Try a different search?', 'buddypress' ); ?></h2>
+				<?php get_search_form(); ?>
 
 			<?php endif; ?>
 
 		</div>
 
-		<?php do_action( 'bp_after_blog_search' ) ?>
+		<?php do_action( 'bp_after_blog_search' ); ?>
 
 		</div><!-- .padder -->
 	</div><!-- #content -->
 
-	<?php get_sidebar() ?>
+	<?php get_sidebar(); ?>
 
-<?php get_footer() ?>
+<?php get_footer(); ?>
diff --git a/wp-content/plugins/buddypress/bp-themes/bp-default/searchform.php b/wp-content/plugins/buddypress/bp-themes/bp-default/searchform.php
index 633dcff041a1589fbc0524ba5504caccd5ed8b1c..16aa704ccd7551d6e8d1514cd6c17e1fd3b5305e 100755
--- a/wp-content/plugins/buddypress/bp-themes/bp-default/searchform.php
+++ b/wp-content/plugins/buddypress/bp-themes/bp-default/searchform.php
@@ -1,10 +1,10 @@
-<?php do_action( 'bp_before_blog_search_form' ) ?>
+<?php do_action( 'bp_before_blog_search_form' ); ?>
 
-<form role="search" method="get" id="searchform" action="<?php echo home_url() ?>/">
+<form role="search" method="get" id="searchform" action="<?php echo home_url(); ?>/">
 	<input type="text" value="<?php the_search_query(); ?>" name="s" id="s" />
-	<input type="submit" id="searchsubmit" value="<?php _e( 'Search', 'buddypress' ) ?>" />
+	<input type="submit" id="searchsubmit" value="<?php _e( 'Search', 'buddypress' ); ?>" />
 
-	<?php do_action( 'bp_blog_search_form' ) ?>
+	<?php do_action( 'bp_blog_search_form' ); ?>
 </form>
 
-<?php do_action( 'bp_after_blog_search_form' ) ?>
+<?php do_action( 'bp_after_blog_search_form' ); ?>
diff --git a/wp-content/plugins/buddypress/bp-themes/bp-default/sidebar-footer.php b/wp-content/plugins/buddypress/bp-themes/bp-default/sidebar-footer.php
index 2a04443c70e6d3f4d6ccffbf2f1d704dc7da33b2..e4a801df8908c6c4f4e45f0029a3ea3c78514ee7 100644
--- a/wp-content/plugins/buddypress/bp-themes/bp-default/sidebar-footer.php
+++ b/wp-content/plugins/buddypress/bp-themes/bp-default/sidebar-footer.php
@@ -1,50 +1,57 @@
 <?php
-	/* The footer widget area is triggered if any of the areas
-	 * have widgets. So let's check that first.
+	/**
+	 * The footer widget area is triggered if any of the areas
+	 * have widgets.
 	 *
-	 * If none of the sidebars have widgets, then let's bail early.
+	 * If none of the sidebars have widgets, bail early.
 	 */
 	if (   ! is_active_sidebar( 'first-footer-widget-area'  )
 		&& ! is_active_sidebar( 'second-footer-widget-area' )
 		&& ! is_active_sidebar( 'third-footer-widget-area'  )
 		&& ! is_active_sidebar( 'fourth-footer-widget-area' )
 	)
-		return;
-	// If we get this far, we have widgets. Let do this.
-?>
+	return; ?>
 
 			<div id="footer-widget-area" role="complementary">
 
-<?php if ( is_active_sidebar( 'first-footer-widget-area' ) ) : ?>
-				<div id="first" class="widget-area">
-					<ul class="xoxo">
-						<?php dynamic_sidebar( 'first-footer-widget-area' ); ?>
-					</ul>
-				</div><!-- #first .widget-area -->
-<?php endif; ?>
-
-<?php if ( is_active_sidebar( 'second-footer-widget-area' ) ) : ?>
-				<div id="second" class="widget-area">
-					<ul class="xoxo">
-						<?php dynamic_sidebar( 'second-footer-widget-area' ); ?>
-					</ul>
-				</div><!-- #second .widget-area -->
-<?php endif; ?>
-
-<?php if ( is_active_sidebar( 'third-footer-widget-area' ) ) : ?>
-				<div id="third" class="widget-area">
-					<ul class="xoxo">
-						<?php dynamic_sidebar( 'third-footer-widget-area' ); ?>
-					</ul>
-				</div><!-- #third .widget-area -->
-<?php endif; ?>
-
-<?php if ( is_active_sidebar( 'fourth-footer-widget-area' ) ) : ?>
-				<div id="fourth" class="widget-area">
-					<ul class="xoxo">
-						<?php dynamic_sidebar( 'fourth-footer-widget-area' ); ?>
-					</ul>
-				</div><!-- #fourth .widget-area -->
-<?php endif; ?>
+				<?php if ( is_active_sidebar( 'first-footer-widget-area' ) ) : ?>
+
+					<div id="first" class="widget-area">
+						<ul class="xoxo">
+							<?php dynamic_sidebar( 'first-footer-widget-area' ); ?>
+						</ul>
+					</div><!-- #first .widget-area -->
+
+				<?php endif; ?>
+
+				<?php if ( is_active_sidebar( 'second-footer-widget-area' ) ) : ?>
+
+					<div id="second" class="widget-area">
+						<ul class="xoxo">
+							<?php dynamic_sidebar( 'second-footer-widget-area' ); ?>
+						</ul>
+					</div><!-- #second .widget-area -->
+
+				<?php endif; ?>
+
+				<?php if ( is_active_sidebar( 'third-footer-widget-area' ) ) : ?>
+
+					<div id="third" class="widget-area">
+						<ul class="xoxo">
+							<?php dynamic_sidebar( 'third-footer-widget-area' ); ?>
+						</ul>
+					</div><!-- #third .widget-area -->
+
+				<?php endif; ?>
+
+				<?php if ( is_active_sidebar( 'fourth-footer-widget-area' ) ) : ?>
+
+					<div id="fourth" class="widget-area">
+						<ul class="xoxo">
+							<?php dynamic_sidebar( 'fourth-footer-widget-area' ); ?>
+						</ul>
+					</div><!-- #fourth .widget-area -->
+
+				<?php endif; ?>
 
 			</div><!-- #footer-widget-area -->
diff --git a/wp-content/plugins/buddypress/bp-themes/bp-default/sidebar.php b/wp-content/plugins/buddypress/bp-themes/bp-default/sidebar.php
index 42fae58874bba7b8277fe9fa07d2af3740dc1ec5..b891b88c62dc57f125b3d6c0fc12b0b33fa35b52 100644
--- a/wp-content/plugins/buddypress/bp-themes/bp-default/sidebar.php
+++ b/wp-content/plugins/buddypress/bp-themes/bp-default/sidebar.php
@@ -1,26 +1,26 @@
-<?php do_action( 'bp_before_sidebar' ) ?>
+<?php do_action( 'bp_before_sidebar' ); ?>
 
 <div id="sidebar" role="complementary">
 	<div class="padder">
 
-	<?php do_action( 'bp_inside_before_sidebar' ) ?>
+	<?php do_action( 'bp_inside_before_sidebar' ); ?>
 
 	<?php if ( is_user_logged_in() ) : ?>
 
-		<?php do_action( 'bp_before_sidebar_me' ) ?>
+		<?php do_action( 'bp_before_sidebar_me' ); ?>
 
 		<div id="sidebar-me">
-			<a href="<?php echo bp_loggedin_user_domain() ?>">
-				<?php bp_loggedin_user_avatar( 'type=thumb&width=40&height=40' ) ?>
+			<a href="<?php echo bp_loggedin_user_domain(); ?>">
+				<?php bp_loggedin_user_avatar( 'type=thumb&width=40&height=40' ); ?>
 			</a>
 
 			<h4><?php echo bp_core_get_userlink( bp_loggedin_user_id() ); ?></h4>
-			<a class="button logout" href="<?php echo wp_logout_url( bp_get_root_domain() ) ?>"><?php _e( 'Log Out', 'buddypress' ) ?></a>
+			<a class="button logout" href="<?php echo wp_logout_url( wp_guess_url() ); ?>"><?php _e( 'Log Out', 'buddypress' ); ?></a>
 
-			<?php do_action( 'bp_sidebar_me' ) ?>
+			<?php do_action( 'bp_sidebar_me' ); ?>
 		</div>
 
-		<?php do_action( 'bp_after_sidebar_me' ) ?>
+		<?php do_action( 'bp_after_sidebar_me' ); ?>
 
 		<?php if ( bp_is_active( 'messages' ) ) : ?>
 			<?php bp_message_get_notices(); /* Site wide notices to all users */ ?>
@@ -28,49 +28,49 @@
 
 	<?php else : ?>
 
-		<?php do_action( 'bp_before_sidebar_login_form' ) ?>
+		<?php do_action( 'bp_before_sidebar_login_form' ); ?>
 
 		<?php if ( bp_get_signup_allowed() ) : ?>
 		
 			<p id="login-text">
 
-				<?php printf( __( 'Please <a href="%s" title="Create an account">create an account</a> to get started.', 'buddypress' ), site_url( bp_get_signup_slug() . '/' ) ) ?>
+				<?php printf( __( 'Please <a href="%s" title="Create an account">create an account</a> to get started.', 'buddypress' ), bp_get_signup_page() ); ?>
 
 			</p>
 
 		<?php endif; ?>
 
-		<form name="login-form" id="sidebar-login-form" class="standard-form" action="<?php echo site_url( 'wp-login.php', 'login_post' ) ?>" method="post">
-			<label><?php _e( 'Username', 'buddypress' ) ?><br />
+		<form name="login-form" id="sidebar-login-form" class="standard-form" action="<?php echo site_url( 'wp-login.php', 'login_post' ); ?>" method="post">
+			<label><?php _e( 'Username', 'buddypress' ); ?><br />
 			<input type="text" name="log" id="sidebar-user-login" class="input" value="<?php if ( isset( $user_login) ) echo esc_attr(stripslashes($user_login)); ?>" tabindex="97" /></label>
 
-			<label><?php _e( 'Password', 'buddypress' ) ?><br />
+			<label><?php _e( 'Password', 'buddypress' ); ?><br />
 			<input type="password" name="pwd" id="sidebar-user-pass" class="input" value="" tabindex="98" /></label>
 
-			<p class="forgetmenot"><label><input name="rememberme" type="checkbox" id="sidebar-rememberme" value="forever" tabindex="99" /> <?php _e( 'Remember Me', 'buddypress' ) ?></label></p>
+			<p class="forgetmenot"><label><input name="rememberme" type="checkbox" id="sidebar-rememberme" value="forever" tabindex="99" /> <?php _e( 'Remember Me', 'buddypress' ); ?></label></p>
 
-			<?php do_action( 'bp_sidebar_login_form' ) ?>
+			<?php do_action( 'bp_sidebar_login_form' ); ?>
 			<input type="submit" name="wp-submit" id="sidebar-wp-submit" value="<?php _e( 'Log In', 'buddypress' ); ?>" tabindex="100" />
 			<input type="hidden" name="testcookie" value="1" />
 		</form>
 
-		<?php do_action( 'bp_after_sidebar_login_form' ) ?>
+		<?php do_action( 'bp_after_sidebar_login_form' ); ?>
 
 	<?php endif; ?>
 
 	<?php /* Show forum tags on the forums directory */
 	if ( bp_is_active( 'forums' ) && bp_is_forums_component() && bp_is_directory() ) : ?>
 		<div id="forum-directory-tags" class="widget tags">
-			<h3 class="widgettitle"><?php _e( 'Forum Topic Tags', 'buddypress' ) ?></h3>
+			<h3 class="widgettitle"><?php _e( 'Forum Topic Tags', 'buddypress' ); ?></h3>
 			<div id="tag-text"><?php bp_forums_tag_heat_map(); ?></div>
 		</div>
 	<?php endif; ?>
 
-	<?php dynamic_sidebar( 'sidebar-1' ) ?>
+	<?php dynamic_sidebar( 'sidebar-1' ); ?>
 
-	<?php do_action( 'bp_inside_after_sidebar' ) ?>
+	<?php do_action( 'bp_inside_after_sidebar' ); ?>
 
 	</div><!-- .padder -->
 </div><!-- #sidebar -->
 
-<?php do_action( 'bp_after_sidebar' ) ?>
+<?php do_action( 'bp_after_sidebar' ); ?>
diff --git a/wp-content/plugins/buddypress/bp-themes/bp-default/single.php b/wp-content/plugins/buddypress/bp-themes/bp-default/single.php
index c2aee9d76bd840b803e1dbf76e398b891b6de4be..d539ffafb81ee6b549e11d373b79f02b30f14669 100644
--- a/wp-content/plugins/buddypress/bp-themes/bp-default/single.php
+++ b/wp-content/plugins/buddypress/bp-themes/bp-default/single.php
@@ -1,9 +1,9 @@
-<?php get_header() ?>
+<?php get_header(); ?>
 
 	<div id="content">
 		<div class="padder">
 
-			<?php do_action( 'bp_before_blog_single_post' ) ?>
+			<?php do_action( 'bp_before_blog_single_post' ); ?>
 
 			<div class="page" id="blog-single" role="main">
 
@@ -42,17 +42,17 @@
 
 			<?php endwhile; else: ?>
 
-				<p><?php _e( 'Sorry, no posts matched your criteria.', 'buddypress' ) ?></p>
+				<p><?php _e( 'Sorry, no posts matched your criteria.', 'buddypress' ); ?></p>
 
 			<?php endif; ?>
 
 		</div>
 
-		<?php do_action( 'bp_after_blog_single_post' ) ?>
+		<?php do_action( 'bp_after_blog_single_post' ); ?>
 
 		</div><!-- .padder -->
 	</div><!-- #content -->
 
-	<?php get_sidebar() ?>
+	<?php get_sidebar(); ?>
 
-<?php get_footer() ?>
\ No newline at end of file
+<?php get_footer(); ?>
\ No newline at end of file
diff --git a/wp-content/plugins/buddypress/bp-themes/bp-default/style.css b/wp-content/plugins/buddypress/bp-themes/bp-default/style.css
index 23c5fec327c406bf4d32af329202515b9b5e650a..144fe52e7337fabc5c047f1a7b9ea49f2856d841 100644
--- a/wp-content/plugins/buddypress/bp-themes/bp-default/style.css
+++ b/wp-content/plugins/buddypress/bp-themes/bp-default/style.css
@@ -2,7 +2,7 @@
  * Theme Name: BuddyPress Default
  * Theme URI: http://buddypress.org/extend/themes/
  * Description: Clean and stylish, BuddyPress Default lets you build a social network straight out of the box. Make it yours with a custom menu, header image, and background. Along with five widgetized areas (one in the sidebar, four in the footer), BP-Default supports featured images (as custom header images on posts and pages) and is furnished with an optional one-column page template that removes the sidebar, and a stylesheet for the admin Visual Editor.
- * Version: 1.5.3.1
+ * Version: 1.6.2
  * Author: the BuddyPress team
  * Author URI: http://buddypress.org
  * License: GNU General Public License
diff --git a/wp-content/plugins/buddypress/bp-xprofile/admin/css/admin.css b/wp-content/plugins/buddypress/bp-xprofile/admin/css/admin.css
index a84c0e764c1a31d8b84ffa442399ebf98ac2f9cd..bf26c30bdd868e923a0ab979436c84c7e8304a3d 100644
--- a/wp-content/plugins/buddypress/bp-xprofile/admin/css/admin.css
+++ b/wp-content/plugins/buddypress/bp-xprofile/admin/css/admin.css
@@ -1 +1 @@
-div#icon-buddypress{background:url(../../../bp-core/images/icons32.png) no-repeat -4px 0;}#tabs-bottom{background:#DFDFDF url(../../../../../wp-admin/images/gray-grad.png) repeat-x scroll 0 0;height:32px;border:1px solid #ccc;-moz-border-radius:0 0 6px 6px;-khtml-border-radius:0 0 6px 6px;-webkit-border-radius:0 0 6px 6px;border-radius:0 0 6px 6px;}#tabs{position:relative;}p.nofields{margin-top:20px;}ul#field-group-tabs{float:left;padding:0 0 0 15px;display:none;}ul#field-group-tabs li{float:left;margin-bottom:-1px;background-color:transparent;margin-right:8px;}ul#field-group-tabs li.ui-state-hover{background-color:#fafafa;}ul#field-group-tabs li.ui-state-hover a.ui-tab{border-color:#bbb #bbb #ccc #bbb;color:#888;}ul#field-group-tabs li.ui-state-acceptable a.ui-tab{border-color:#5a5 #5a5 #ccc #5a5;color:#8a8;background-image:url(../images/plus.gif);background-color:#efe;}ul#field-group-tabs li.ui-tabs-selected.ui-state-acceptable a.ui-tab{background-color:#ECECEC;background-image:url(../images/cross.gif);}ul#field-group-tabs li.drop-candidate a.ui-tab{background-color:#ffc;border-color:#aa5 #aa5 #ccc #aa5;color:#aa8;}ul#field-group-tabs li a.ui-tab{display:block;margin-top:3px;padding:5px 10px 5px 28px;border:1px solid #ccc;border-bottom:none;-moz-border-radius:6px 6px 0 0;-khtml-border-radius:6px 6px 0 0;-webkit-border-radius:6px 6px 0 0;border-radius:6px 6px 0 0;text-decoration:none;background:#F4F4F4 url(../images/move-x.gif) 7px 55% no-repeat;color:#888;}ul#field-group-tabs li.ui-tabs-selected a.ui-tab{background-color:#ECECEC;margin-top:-1px;padding:7px 10px 7px 28px;border:1px solid #ccc;border-bottom:1px solid transparent;color:#000;font-weight:bold;}.tab-toolbar{background:#ddd url(../../../../../wp-admin/images/gray-grad.png) repeat-x scroll 0 0;border-width:1px 1px 0;-moz-border-radius:6px 6px 0 0;-khtml-border-radius:6px 6px 0 0;-webkit-border-radius:6px 6px 0 0;border-radius:6px 6px 0 0;margin:-20px -21px 20px -21px;clear:left;padding:10px;border:1px solid #ccc;}.tab-toolbar a.button{padding:5px 10px;}.tab-toolbar a.deletion{color:#f00;border-bottom:1px solid #f00;font-size:11px;text-decoration:none;padding:0 2px;margin-top:-2px;}div.tab-wrapper{background-color:#f9f9f9;clear:left;padding:20px;border-left:1px solid #ccc;border-right:1px solid #ccc;-moz-border-radius:6px 6px 0 0;-khtml-border-radius:6px 6px 0 0;-webkit-border-radius:6px 6px 0 0;border-radius:6px 6px 0 0;}.tab-wrapper fieldset{position:relative;cursor:default!important;background:inherit;}.tab-wrapper fieldset legend{padding-bottom:15px;font-weight:bold;}.tab-wrapper .xprofile-field{position:relative;}.tab-wrapper fieldset fieldset{position:relative;border:1px solid #ddd;-moz-border-radius:6px;-khtml-border-radius:6px;-webkit-border-radius:6px;border-radius:5px;margin:10px 0 0 0;cursor:move!important;background:#fcfcfc url(../../../../../wp-admin/images/gray-grad.png) repeat-x scroll 0 0;}.tab-wrapper fieldset fieldset legend{position:absolute!important;top:0;left:0;width:80%;padding:30px;}.tab-wrapper fieldset fieldset legend span{position:absolute;top:6px;left:30px;font-weight:bold;width:100%;}.field-group fieldset:hover{background-color:#fafafa;border-color:#ccc;}fieldset div.field-wrapper{padding-left:30px;padding:40px 10px 10px 10px;background:url(../images/move.gif) 6px 6px no-repeat transparent;}fieldset.radio div div,fieldset.checkbox div{float:left;}fieldset.radio div div label,fieldset.checkbox div label{margin-right:20px;}fieldset.clear-value{margin-left:10px;}.field-group div.actions{position:absolute;right:10px;top:6px;}.field-group fieldset:hover div.actions{display:block;}.field-group fieldset.ui-sortable-placeholder{border:1px dashed #999;background-color:#eee;visibility:visible!important;}ul.forTab{list-style:none;padding:0;margin:0 0 0 1em;}ul.forTab li{margin:0 0 1em 0;}ul.forTab li label{display:block;}ul.forTab li input{font-size:1.4em;}p.success{background:green;}p.err{border-top:2px solid red;border-bottom:2px solid red;color:red;padding:5px 0;width:40%;}span.desc,span.signup-description{display:block;font-size:11px;color:#555;}select.multi-select{width:90%;height:10em!important;}ul.multi-checkbox{margin:0 5px 0 0;padding:.5em .9em;height:10em;overflow:auto;list-style:none;border:solid 1px #ccc;width:90%;}ul.multi-checkbox li{padding:0;margin:0;}div.options-box{margin-left:20px!important;margin-right:10px!important;border-left:4px solid #EAF3FA;padding-left:15px;}th a{background:#fff;padding:2px 5px;-moz-border-radius:3px;-khtml-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;top:-2px;}textarea#description{border:1px solid #ddd;width:85%;}
\ No newline at end of file
+#tabs-bottom{background:#f9f9f9;height:32px;border:1px solid #dfdfdf;border-radius:0 0 3px 3px}#tabs{position:relative}p.nofields{margin-top:20px}ul#field-group-tabs{float:left;padding:0 0 0 15px;margin:0;display:none}ul#field-group-tabs li{float:left;margin-bottom:-1px;background-color:transparent;margin-right:8px}ul#field-group-tabs li.ui-state-hover{background-color:#fafafa}ul#field-group-tabs li.ui-state-hover a.ui-tab{border-color:#dfdfdf #dfdfdf #f9f9f9 #dfdfdf;color:#d54e21}ul#field-group-tabs li.ui-state-acceptable a.ui-tab{border-color:#5a5 #5a5 #ccc #5a5;color:#8a8;background-color:#efe}ul#field-group-tabs li.ui-tabs-selected.ui-state-acceptable a.ui-tab{background-color:#f9f9f9}ul#field-group-tabs li.drop-candidate a.ui-tab{background-color:#ffc;border-color:#aa5 #aa5 #ccc #aa5;color:#aa8}ul#field-group-tabs li a.ui-tab{font-family:Georgia,"Times New Roman","Bitstream Charter",Times,serif;font-size:14px;display:block;margin-top:3px;padding:5px 10px 5px;border:1px solid #dfdfdf;border-bottom:0;border-radius:3px 3px 0 0;text-decoration:none;color:#aaa}ul#field-group-tabs li.ui-tabs-selected a.ui-tab{background-color:#f9f9f9;margin-top:-1px;padding:7px 10px 7px;border:1px solid #dfdfdf;border-bottom:1px solid transparent;color:#000}.tab-toolbar{background:#f9f9f9;border-width:1px 1px 0;border-radius:3px 3px 0 0;margin:-20px -21px 20px -21px;clear:left;padding:10px;border:1px solid #dfdfdf}.field-wrapper a.deletion,.tab-toolbar a.deletion{color:#f00;border-bottom:1px solid #f00;font-size:12px;text-decoration:none;padding:0;margin:-2px 0 0 5px}div.tab-toolbar a.button-primary{color:#fff!important}div.tab-wrapper{background-color:#fff;clear:left;padding:20px;border-left:1px solid #ccc;border-right:1px solid #ccc;border-radius:3px 3px 0 0}.tab-wrapper fieldset{position:relative;cursor:default!important;background:inherit}.tab-wrapper fieldset legend{padding-bottom:15px;font-weight:bold}.tab-wrapper .xprofile-field{position:relative}.tab-wrapper fieldset fieldset{position:relative;border:1px solid #ddd;border-radius:3px;margin:10px 0 0 0;cursor:move!important;background:#f9f9f9}.tab-wrapper fieldset fieldset legend{position:absolute!important;top:0;left:0;width:80%;padding:30px}.tab-wrapper fieldset fieldset legend span{position:absolute;top:6px;left:10px;font-weight:bold;width:100%}.field-group fieldset:hover{background-color:#fafafa;border-color:#ccc}fieldset div.field-wrapper{padding:40px 10px 10px}fieldset.radio div div label,fieldset.checkbox div label{margin-right:20px}fieldset.clear-value{margin-left:10px}.field-group div.actions{float:none;border-top:1px solid #ddd;margin:20px 0 0;padding-top:10px}.field-group div.actions a,.field-group div.actions button,.field-group div.actions input{float:none}.field-group fieldset:hover div.actions{display:block}.field-group fieldset.ui-sortable-placeholder{border:1px dashed #999;background-color:#eee;visibility:visible!important}ul.forTab{list-style:none;padding:0;margin:0 0 0 1em}ul.forTab li{margin:0 0 1em 0}ul.forTab li label{display:block}ul.forTab li input{font-size:1.4em}p.success{background:green}p.err{border-top:2px solid red;border-bottom:2px solid red;color:red;padding:5px 0;width:40%}span.desc,span.signup-description{display:block;font-size:11px;color:#555}select.multi-select{width:90%;height:10em!important}ul.multi-checkbox{margin:0 5px 0 0;padding:.5em .9em;height:10em;overflow:auto;list-style:none;border:solid 1px #ccc;width:90%}ul.multi-checkbox li{padding:0;margin:0}div.options-box{margin-left:20px!important;margin-right:10px!important;border-left:4px solid #eaf3fa;padding-left:15px}th a{background:#fff;padding:2px 5px;-moz-border-radius:3px;-khtml-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;top:-2px}textarea#description{border:1px solid #ddd;width:85%}
\ No newline at end of file
diff --git a/wp-content/plugins/buddypress/bp-xprofile/admin/css/admin.dev.css b/wp-content/plugins/buddypress/bp-xprofile/admin/css/admin.dev.css
index 5845c7ee60a1debf418eac2ab3905c991472a2e2..cc32e4f6ec7c0fea2e7b28d3f017906a1ab72f2e 100644
--- a/wp-content/plugins/buddypress/bp-xprofile/admin/css/admin.dev.css
+++ b/wp-content/plugins/buddypress/bp-xprofile/admin/css/admin.dev.css
@@ -1,16 +1,9 @@
 /* Profile field group main admin page */
-div#icon-buddypress {
-	background: url( ../../../bp-core/images/icons32.png ) no-repeat -4px 0px;
-}
-
 #tabs-bottom {
-	background: #DFDFDF url(../../../../../wp-admin/images/gray-grad.png) repeat-x scroll 0% 0%;
+	background: #f9f9f9;
 	height: 32px;
-	border: 1px solid #ccc;
-	-moz-border-radius: 0 0 6px 6px;
-	-khtml-border-radius: 0 0 6px 6px;
-	-webkit-border-radius: 0 0 6px 6px;
-	border-radius: 0 0 6px 6px;
+	border: 1px solid #dfdfdf;
+	border-radius: 0 0 3px 3px;
 }
 
 #tabs {
@@ -24,6 +17,7 @@ div#icon-buddypress {
 	ul#field-group-tabs {
 		float: left;
 		padding: 0 0 0 15px;
+		margin: 0;
 		display: none;
 	}
 		ul#field-group-tabs li {
@@ -36,18 +30,16 @@ div#icon-buddypress {
 			background-color: #fafafa;
 		}
 		ul#field-group-tabs li.ui-state-hover a.ui-tab {
-			border-color: #bbb #bbb #ccc #bbb;
-			color: #888;
+			border-color: #dfdfdf #dfdfdf #f9f9f9 #dfdfdf;
+			color: #d54e21;
 		}
 		ul#field-group-tabs li.ui-state-acceptable a.ui-tab {
 			border-color: #5a5 #5a5 #ccc #5a5;
 			color: #8a8;
-			background-image: url(../images/plus.gif);
 			background-color: #efe;
 		}
 			ul#field-group-tabs li.ui-tabs-selected.ui-state-acceptable a.ui-tab {
-				background-color: #ECECEC;
-				background-image: url(../images/cross.gif);
+				background-color: #f9f9f9;
 			}
 		ul#field-group-tabs li.drop-candidate a.ui-tab {
 			background-color: #ffc;
@@ -55,68 +47,60 @@ div#icon-buddypress {
 			color: #aa8;
 		}
 		ul#field-group-tabs li a.ui-tab {
+			font-family: Georgia, "Times New Roman", "Bitstream Charter", Times, serif;
+			font-size: 14px;
 			display: block;
 			margin-top: 3px;
-			padding: 5px 10px 5px 28px;
-			border: 1px solid #ccc;
+			padding: 5px 10px 5px;
+			border: 1px solid #dfdfdf;
 			border-bottom: none;
-			-moz-border-radius: 6px 6px 0 0;
-			-khtml-border-radius: 6px 6px 0 0;
-			-webkit-border-radius: 6px 6px 0 0;
-			border-radius: 6px 6px 0 0;
+			border-radius: 3px 3px 0 0;
 			text-decoration: none;
-			background: #F4F4F4 url(../images/move-x.gif) 7px 55% no-repeat;
-			color: #888;
+			color: #aaa;
 		}
 
 		/* Selected tab */
 		ul#field-group-tabs li.ui-tabs-selected a.ui-tab {
-			background-color: #ECECEC;
+			background-color: #f9f9f9;
 			margin-top: -1px;
-			padding: 7px 10px 7px 28px;
-			border: 1px solid #ccc;
+			padding: 7px 10px 7px;
+			border: 1px solid #dfdfdf;
 			border-bottom: 1px solid transparent;
 			color: #000;
-			font-weight: bold;
 		}
 
 	/* Toolbar */
 	.tab-toolbar {
-		background: #ddd url(../../../../../wp-admin/images/gray-grad.png) repeat-x scroll 0% 0%;
-		border-width: 1px 1px 0px;
-		-moz-border-radius: 6px 6px 0 0;
-		-khtml-border-radius: 6px 6px 0 0;
-		-webkit-border-radius: 6px 6px 0 0;
-		border-radius: 6px 6px 0 0;
+		background: #f9f9f9;
+		border-width: 1px 1px 0;
+		border-radius: 3px 3px 0 0;
 		margin: -20px -21px 20px -21px;
 		clear: left;
 		padding: 10px;
-		border: 1px solid #ccc;
-	}
-
-	.tab-toolbar a.button {
-		padding: 5px 10px;
+		border: 1px solid #dfdfdf;
 	}
 
+	.field-wrapper a.deletion,
 	.tab-toolbar a.deletion {
 		color: #f00;
 		border-bottom: 1px solid #f00;
-		font-size: 11px;
+		font-size: 12px;
 		text-decoration: none;
-		padding: 0 2px;
-		margin-top: -2px;
+		padding: 0;
+		margin: -2px 0 0 5px;
+	}
+		
+	div.tab-toolbar a.button-primary {
+		color: #fff !important; /* Overriding a WP !important */
 	}
 
 	div.tab-wrapper {
-		background-color: #f9f9f9;
+		background-color: #fff;
 		clear: left;
 		padding: 20px;
 		border-left: 1px solid #ccc;
 		border-right: 1px solid #ccc;
-		-moz-border-radius: 6px 6px 0 0;
-		-khtml-border-radius: 6px 6px 0 0;
-		-webkit-border-radius: 6px 6px 0 0;
-		border-radius: 6px 6px 0 0;
+		border-radius: 3px 3px 0 0;
 	}
 
 	.tab-wrapper fieldset {
@@ -134,13 +118,10 @@ div#icon-buddypress {
 	.tab-wrapper fieldset fieldset {
 		position: relative;
 		border: 1px solid #ddd;
-		-moz-border-radius: 6px;
-		-khtml-border-radius: 6px;
-		-webkit-border-radius: 6px;
-		border-radius: 5px;
+		border-radius: 3px;
 		margin: 10px 0 0 0;
 		cursor: move !important;
-		background: #fcfcfc url(../../../../../wp-admin/images/gray-grad.png) repeat-x scroll 0% 0%;
+		background: #f9f9f9;
 	}
 	.tab-wrapper fieldset fieldset legend {
 		position: absolute !important;
@@ -152,7 +133,7 @@ div#icon-buddypress {
 	.tab-wrapper fieldset fieldset legend span {
 		position: absolute;
 		top: 6px;
-		left: 30px;
+		left: 10px;
 		font-weight: bold;
 		width: 100%;
 	}
@@ -161,14 +142,8 @@ div#icon-buddypress {
 			border-color: #ccc;
 		}
 		fieldset div.field-wrapper {
-			padding-left: 30px;
-			padding: 40px 10px 10px 10px;
-			background: url(../images/move.gif) 6px 6px no-repeat transparent;
+			padding: 40px 10px 10px;
 		}
-	fieldset.radio div div,
-	fieldset.checkbox div {
-		float: left;
-	}
 	fieldset.radio div div label,
 	fieldset.checkbox div label {
 		margin-right: 20px;
@@ -178,9 +153,15 @@ div#icon-buddypress {
 		margin-left: 10px;
 	}
 	.field-group div.actions {
-		position: absolute;
-		right: 10px;
-		top: 6px;
+		float: none;
+		border-top: 1px solid #ddd;
+		margin: 20px 0 0;
+		padding-top: 10px;
+	}
+	.field-group div.actions a,
+	.field-group div.actions button,
+	.field-group div.actions input {
+		float: none;
 	}
 	.field-group fieldset:hover div.actions {
 		display: block;
@@ -229,7 +210,7 @@ div#icon-buddypress {
 	}
 
 ul.multi-checkbox {
-	margin: 0 5px 0 0px;
+	margin: 0 5px 0 0;
 	padding: .5em .9em;
 	height: 10em;
 	overflow: auto;
@@ -263,4 +244,5 @@ th a {
 textarea#description {
 	border: 1px solid #ddd;
 	width: 85%;
-}
\ No newline at end of file
+}
+
diff --git a/wp-content/plugins/buddypress/bp-xprofile/admin/js/admin.dev.js b/wp-content/plugins/buddypress/bp-xprofile/admin/js/admin.dev.js
index d4e64a929143d4499bb53ac540336af4e46b07a1..e4af4e049a9e14325d2656e2b8b831d4aa15499c 100644
--- a/wp-content/plugins/buddypress/bp-xprofile/admin/js/admin.dev.js
+++ b/wp-content/plugins/buddypress/bp-xprofile/admin/js/admin.dev.js
@@ -1,121 +1,113 @@
 function add_option(forWhat) {
-	var holder = document.getElementById(forWhat + "_more");
-	var theId = document.getElementById(forWhat + '_option_number').value;
-
-	var newDiv = document.createElement('p');
-	newDiv.setAttribute('id', forWhat + '_div' + theId);
-
+	var holder    = document.getElementById(forWhat + "_more");
+	var theId     = document.getElementById(forWhat + '_option_number').value;
+	var newDiv    = document.createElement('p');
 	var newOption = document.createElement('input');
-	newOption.setAttribute('type', 'text');
-	newOption.setAttribute('name', forWhat + '_option[' + theId + ']');
-	newOption.setAttribute('id', forWhat + '_option' + theId);
+	var label     = document.createElement( 'label' );
+	var txt       = document.createTextNode( "Option " + theId + ": " );
+	var isDefault = document.createElement( 'input' );
+	var label1    = document.createElement( 'label' );
+	var txt1      = document.createTextNode( " Default Value " );
 
-	var label = document.createElement('label');
-	label.setAttribute('for', forWhat + '_option' + theId);
-
-	var txt = document.createTextNode("Option " + theId + ": ");
-	label.appendChild(txt);
+	newDiv.setAttribute('id', forWhat + '_div' + theId);
+	
+	newOption.setAttribute( 'type', 'text' );
+	newOption.setAttribute( 'name', forWhat + '_option[' + theId + ']' );
+	newOption.setAttribute( 'id', forWhat + '_option' + theId );
 
-	var isDefault = document.createElement('input');
+	label.setAttribute( 'for', forWhat + '_option' + theId );
+	label.appendChild( txt );
 
-	if(forWhat == 'checkbox' || forWhat == 'multiselectbox') {
-		isDefault.setAttribute('type', 'checkbox');
-		isDefault.setAttribute('name', 'isDefault_' + forWhat + '_option[' + theId + ']');
+	if ( forWhat == 'checkbox' || forWhat == 'multiselectbox' ) {
+		isDefault.setAttribute( 'type', 'checkbox' );
+		isDefault.setAttribute( 'name', 'isDefault_' + forWhat + '_option[' + theId + ']' );
 	} else {
-		isDefault.setAttribute('type', 'radio');
-		isDefault.setAttribute('name', 'isDefault_' + forWhat + '_option');
+		isDefault.setAttribute( 'type', 'radio' );
+		isDefault.setAttribute( 'name', 'isDefault_' + forWhat + '_option' );
 	}
 
-	isDefault.setAttribute('value', theId);
-
-	var label1 = document.createElement('label');
-	var txt1 = document.createTextNode(" Default Value ");
+	isDefault.setAttribute( 'value', theId );
 
-	label1.appendChild(txt1);
-	label1.setAttribute('for', 'isDefault_' + forWhat + '_option[]');
-	toDelete = document.createElement('a');
+	label1.appendChild( txt1 );
+	label1.setAttribute( 'for', 'isDefault_' + forWhat + '_option[]' );
 
-	toDeleteText = document.createTextNode('[x]');
-	toDelete.setAttribute('href',"javascript:hide('" + forWhat + '_div' + theId + "')");
+	var toDelete     = document.createElement( 'a' );
+	var toDeleteText = document.createTextNode( '[x]' );
 
-	toDelete.setAttribute('class','delete');
+	toDelete.setAttribute( 'href', "javascript:hide('" + forWhat + '_div' + theId + "')" );
+	toDelete.setAttribute( 'class', 'delete' );
+	toDelete.appendChild( toDeleteText );
 
-	toDelete.appendChild(toDeleteText);
+	newDiv.appendChild( label );
+	newDiv.appendChild( newOption );
+	newDiv.appendChild( document.createTextNode( " " ) );
+	newDiv.appendChild( isDefault );
+	newDiv.appendChild( label1 );
+	newDiv.appendChild( toDelete );
+	holder.appendChild( newDiv );
 
-	newDiv.appendChild(label);
-	newDiv.appendChild(newOption);
-	newDiv.appendChild(document.createTextNode(" "));
-	newDiv.appendChild(isDefault);
-	newDiv.appendChild(label1);
-	newDiv.appendChild(toDelete);
-	holder.appendChild(newDiv);
 
+	theId++;
 
-	theId++
 	document.getElementById(forWhat + "_option_number").value = theId;
 }
 
 function show_options(forWhat) {
-	document.getElementById("radio").style.display = "none";
-	document.getElementById("selectbox").style.display = "none";
-	document.getElementById("multiselectbox").style.display = "none";
-	document.getElementById("checkbox").style.display = "none";
+	document.getElementById( 'radio'          ).style.display = 'none';
+	document.getElementById( 'selectbox'      ).style.display = 'none';
+	document.getElementById( 'multiselectbox' ).style.display = 'none';
+	document.getElementById( 'checkbox'       ).style.display = 'none';
 
-	if(forWhat == "radio")
-		document.getElementById("radio").style.display = "";
+	if ( forWhat == 'radio' )
+		document.getElementById( 'radio' ).style.display = "";
 
-	if(forWhat == "selectbox")
-		document.getElementById("selectbox").style.display = "";
+	if ( forWhat == 'selectbox' )
+		document.getElementById( 'selectbox' ).style.display = "";
 
-	if(forWhat == "multiselectbox")
-		document.getElementById("multiselectbox").style.display = "";
+	if ( forWhat == 'multiselectbox' )
+		document.getElementById( 'multiselectbox' ).style.display = "";
 
-	if(forWhat == "checkbox")
-		document.getElementById("checkbox").style.display = "";
+	if ( forWhat == 'checkbox' )
+		document.getElementById( 'checkbox' ).style.display = "";
 }
 
-function hide(id) {
-	if ( !document.getElementById(id) ) return false;
+function hide( id ) {
+	if ( !document.getElementById( id ) ) return false;
 
-	document.getElementById(id).style.display = "none";
-	document.getElementById(id).value = '';
+	document.getElementById( id ).style.display = "none";
+	document.getElementById( id ).value = '';
 }
 
+var fixHelper = function(e, ui) {
+	ui.children().each(function() {
+		jQuery(this).width( jQuery(this).width() );
+	});
+	return ui;
+};
+
 // Set up deleting options ajax
-jQuery(document).ready( function() {
+jQuery( document ).ready( function() {
 
-	jQuery("a.ajax-option-delete").click(
+	jQuery( 'a.ajax-option-delete' ).click(
 		function() {
-			var theId = this.id.split('-');
+			var theId = this.id.split( '-' );
 			theId = theId[1];
 
 			jQuery.post( ajaxurl, {
 				action: 'xprofile_delete_option',
-				'cookie': encodeURIComponent(document.cookie),
-				'_wpnonce': jQuery("input#_wpnonce").val(),
-
+				'cookie': encodeURIComponent( document.cookie ),
+				'_wpnonce': jQuery('input#_wpnonce').val(),
 				'option_id': theId
 			},
-			function(response)
-			{});
+			function( response ) {} );
 		}
 	);
-});
 
-var fixHelper = function(e, ui) {
-	ui.children().each(function() {
-		jQuery(this).width( jQuery(this).width() );
-	});
-	return ui;
-};
+	// Show object if JS is enabled
+	jQuery( 'ul#field-group-tabs' ).show();
 
-// Main XProfile behavior layer
-jQuery(document).ready( function() {
-	/* Show object if JS is enabled */
-	jQuery( "ul#field-group-tabs" ).show();
-
-	/* Allow reordering of field group tabs */
-	jQuery( "ul#field-group-tabs" ).sortable( {
+	// Allow reordering of field group tabs
+	jQuery( 'ul#field-group-tabs' ).sortable( {
 		cursor: 'move',
 		axis: 'x',
 		opacity: 0.6,
@@ -125,16 +117,16 @@ jQuery(document).ready( function() {
 		update: function() {
 			jQuery.post( ajaxurl, {
 				action: 'xprofile_reorder_groups',
-				'cookie': encodeURIComponent(document.cookie),
-				'_wpnonce_reorder_groups': jQuery( "input#_wpnonce_reorder_groups" ).val(),
-				'group_order': jQuery(this).sortable( 'serialize' )
+				'cookie': encodeURIComponent( document.cookie ),
+				'_wpnonce_reorder_groups': jQuery( 'input#_wpnonce_reorder_groups' ).val(),
+				'group_order': jQuery( this ).sortable( 'serialize' )
 			},
-			function(response){});
+			function( response ) {} );
 		}
 	}).disableSelection();
 
-	/* Allow reordering of fields within groups */
-	jQuery( "fieldset.field-group" ).sortable({
+	// Allow reordering of fields within groups
+	jQuery( 'fieldset.field-group' ).sortable({
 		cursor: 'move',
 		opacity: 0.3,
 		items: 'fieldset',
@@ -144,59 +136,58 @@ jQuery(document).ready( function() {
 			jQuery.post( ajaxurl, {
 				action: 'xprofile_reorder_fields',
 				'cookie': encodeURIComponent(document.cookie),
-				'_wpnonce_reorder_fields': jQuery( "input#_wpnonce_reorder_fields" ).val(),
+				'_wpnonce_reorder_fields': jQuery( 'input#_wpnonce_reorder_fields' ).val(),
 				'field_order': jQuery(this).sortable( 'serialize' ),
 				'field_group_id': jQuery(this).attr( 'id' )
 			},
-			function(response)
-			{});
+			function( response ) {} );
 		}
 	})
 
-	/* Disallow text selection */
+	// Disallow text selection
 	.disableSelection()
 
-	/* Change cursor to move if JS is enabled */
+	// Change cursor to move if JS is enabled
 	.css( 'cursor', 'move' );
 
-	/* tabs init with a custom tab template and an "add" callback filling in the content */
+	// tabs init with a custom tab template and an "add" callback filling in the content
 	var $tab_items;
-	var $tabs = jQuery( "#tabs" ).tabs();
+	var $tabs = jQuery( '#tabs' ).tabs();
 	set_tab_items( $tabs );
 
 	function set_tab_items( $tabs ) {
-		$tab_items = jQuery( "ul:first li", $tabs ).droppable({
-			accept: ".connectedSortable fieldset",
-			hoverClass: "ui-state-hover",
-			activeClass: "ui-state-acceptable",
-			touch: "pointer",
-			tolerance: "pointer",
-
-			/* When field is dropped on tab */
+		$tab_items = jQuery( 'ul:first li', $tabs ).droppable({
+			accept: '.connectedSortable fieldset',
+			hoverClass: 'ui-state-hover',
+			activeClass: 'ui-state-acceptable',
+			touch: 'pointer',
+			tolerance: 'pointer',
+
+			// When field is dropped on tab
 			drop: function( ev, ui ) {
-				/* The tab */
+				// The tab
 				var $item = jQuery(this);
 
-				/* The tab body */
+				// The tab body
 				var $list = jQuery( $item.find( 'a' ).attr( 'href' ) ).find( '.connectedSortable' );
 
-				/* Remove helper class */
+				// Remove helper class
 				jQuery($item).removeClass( 'drop-candidate' );
 
-				/* Hide field, change selected tab, and show new placement */
+				// Hide field, change selected tab, and show new placement
 				ui.draggable.hide( 'slow', function() {
 
-					/* Select new tab as current */
+					// Select new tab as current
 					$tabs.tabs( 'select', $tab_items.index( $item ) );
 
-					/* Show new placement */
+					// Show new placement
 					jQuery(this).appendTo($list).show( 'slow' ).animate( {opacity: "1"}, 500 );
 
-					/* Refresh $list variable */
+					// Refresh $list variable
 					$list = jQuery( $item.find( 'a' ).attr( 'href' ) ).find( '.connectedSortable' );
 					jQuery($list).find( 'p.nofields' ).hide( 'slow' );
 
-					/* Ajax update field locations and orders */
+					// Ajax update field locations and orders
 					jQuery.post( ajaxurl, {
 						action: 'xprofile_reorder_fields',
 						'cookie': encodeURIComponent(document.cookie),
@@ -204,7 +195,7 @@ jQuery(document).ready( function() {
 						'field_order': jQuery( $list ).sortable( 'serialize' ),
 						'field_group_id': jQuery( $list ).attr( 'id' )
 					},
-					function(response){});
+					function( response ) {} );
 				});
 			},
 			over: function( event, ui ) {
diff --git a/wp-content/plugins/buddypress/bp-xprofile/admin/js/admin.js b/wp-content/plugins/buddypress/bp-xprofile/admin/js/admin.js
index 3efa1d023bf35ea1fd8ab430155bfb75c1359c12..5f4eb44e2c91b9a9bb281295c6cd8b636067e5e4 100644
--- a/wp-content/plugins/buddypress/bp-xprofile/admin/js/admin.js
+++ b/wp-content/plugins/buddypress/bp-xprofile/admin/js/admin.js
@@ -1 +1 @@
-function add_option(f){var h=document.getElementById(f+"_more");var j=document.getElementById(f+"_option_number").value;var a=document.createElement("p");a.setAttribute("id",f+"_div"+j);var g=document.createElement("input");g.setAttribute("type","text");g.setAttribute("name",f+"_option["+j+"]");g.setAttribute("id",f+"_option"+j);var i=document.createElement("label");i.setAttribute("for",f+"_option"+j);var e=document.createTextNode("Option "+j+": ");i.appendChild(e);var b=document.createElement("input");if(f=="checkbox"||f=="multiselectbox"){b.setAttribute("type","checkbox");b.setAttribute("name","isDefault_"+f+"_option["+j+"]")}else{b.setAttribute("type","radio");b.setAttribute("name","isDefault_"+f+"_option")}b.setAttribute("value",j);var d=document.createElement("label");var c=document.createTextNode(" Default Value ");d.appendChild(c);d.setAttribute("for","isDefault_"+f+"_option[]");toDelete=document.createElement("a");toDeleteText=document.createTextNode("[x]");toDelete.setAttribute("href","javascript:hide('"+f+"_div"+j+"')");toDelete.setAttribute("class","delete");toDelete.appendChild(toDeleteText);a.appendChild(i);a.appendChild(g);a.appendChild(document.createTextNode(" "));a.appendChild(b);a.appendChild(d);a.appendChild(toDelete);h.appendChild(a);j++;document.getElementById(f+"_option_number").value=j}function show_options(a){document.getElementById("radio").style.display="none";document.getElementById("selectbox").style.display="none";document.getElementById("multiselectbox").style.display="none";document.getElementById("checkbox").style.display="none";if(a=="radio"){document.getElementById("radio").style.display=""}if(a=="selectbox"){document.getElementById("selectbox").style.display=""}if(a=="multiselectbox"){document.getElementById("multiselectbox").style.display=""}if(a=="checkbox"){document.getElementById("checkbox").style.display=""}}function hide(a){if(!document.getElementById(a)){return false}document.getElementById(a).style.display="none";document.getElementById(a).value=""}jQuery(document).ready(function(){jQuery("a.ajax-option-delete").click(function(){var a=this.id.split("-");a=a[1];jQuery.post(ajaxurl,{action:"xprofile_delete_option",cookie:encodeURIComponent(document.cookie),_wpnonce:jQuery("input#_wpnonce").val(),option_id:a},function(b){})})});var fixHelper=function(b,a){a.children().each(function(){jQuery(this).width(jQuery(this).width())});return a};jQuery(document).ready(function(){jQuery("ul#field-group-tabs").show();jQuery("ul#field-group-tabs").sortable({cursor:"move",axis:"x",opacity:0.6,items:"li",tolerance:"pointer",update:function(){jQuery.post(ajaxurl,{action:"xprofile_reorder_groups",cookie:encodeURIComponent(document.cookie),_wpnonce_reorder_groups:jQuery("input#_wpnonce_reorder_groups").val(),group_order:jQuery(this).sortable("serialize")},function(d){})}}).disableSelection();jQuery("fieldset.field-group").sortable({cursor:"move",opacity:0.3,items:"fieldset",tolerance:"pointer",update:function(){jQuery.post(ajaxurl,{action:"xprofile_reorder_fields",cookie:encodeURIComponent(document.cookie),_wpnonce_reorder_fields:jQuery("input#_wpnonce_reorder_fields").val(),field_order:jQuery(this).sortable("serialize"),field_group_id:jQuery(this).attr("id")},function(d){})}}).disableSelection().css("cursor","move");var b;var a=jQuery("#tabs").tabs();c(a);function c(d){b=jQuery("ul:first li",d).droppable({accept:".connectedSortable fieldset",hoverClass:"ui-state-hover",activeClass:"ui-state-acceptable",touch:"pointer",tolerance:"pointer",drop:function(g,h){var e=jQuery(this);var f=jQuery(e.find("a").attr("href")).find(".connectedSortable");jQuery(e).removeClass("drop-candidate");h.draggable.hide("slow",function(){d.tabs("select",b.index(e));jQuery(this).appendTo(f).show("slow").animate({opacity:"1"},500);f=jQuery(e.find("a").attr("href")).find(".connectedSortable");jQuery(f).find("p.nofields").hide("slow");jQuery.post(ajaxurl,{action:"xprofile_reorder_fields",cookie:encodeURIComponent(document.cookie),_wpnonce_reorder_fields:jQuery("input#_wpnonce_reorder_fields").val(),field_order:jQuery(f).sortable("serialize"),field_group_id:jQuery(f).attr("id")},function(i){})})},over:function(e,f){jQuery(this).addClass("drop-candidate")},out:function(e,f){jQuery(this).removeClass("drop-candidate")}})}});
\ No newline at end of file
+function add_option(g){var j=document.getElementById(g+"_more");var l=document.getElementById(g+"_option_number").value;var a=document.createElement("p");var h=document.createElement("input");var k=document.createElement("label");var f=document.createTextNode("Option "+l+": ");var b=document.createElement("input");var e=document.createElement("label");var d=document.createTextNode(" Default Value ");a.setAttribute("id",g+"_div"+l);h.setAttribute("type","text");h.setAttribute("name",g+"_option["+l+"]");h.setAttribute("id",g+"_option"+l);k.setAttribute("for",g+"_option"+l);k.appendChild(f);if(g=="checkbox"||g=="multiselectbox"){b.setAttribute("type","checkbox");b.setAttribute("name","isDefault_"+g+"_option["+l+"]")}else{b.setAttribute("type","radio");b.setAttribute("name","isDefault_"+g+"_option")}b.setAttribute("value",l);e.appendChild(d);e.setAttribute("for","isDefault_"+g+"_option[]");var c=document.createElement("a");var i=document.createTextNode("[x]");c.setAttribute("href","javascript:hide('"+g+"_div"+l+"')");c.setAttribute("class","delete");c.appendChild(i);a.appendChild(k);a.appendChild(h);a.appendChild(document.createTextNode(" "));a.appendChild(b);a.appendChild(e);a.appendChild(c);j.appendChild(a);l++;document.getElementById(g+"_option_number").value=l}function show_options(a){document.getElementById("radio").style.display="none";document.getElementById("selectbox").style.display="none";document.getElementById("multiselectbox").style.display="none";document.getElementById("checkbox").style.display="none";if(a=="radio"){document.getElementById("radio").style.display=""}if(a=="selectbox"){document.getElementById("selectbox").style.display=""}if(a=="multiselectbox"){document.getElementById("multiselectbox").style.display=""}if(a=="checkbox"){document.getElementById("checkbox").style.display=""}}function hide(a){if(!document.getElementById(a)){return false}document.getElementById(a).style.display="none";document.getElementById(a).value=""}var fixHelper=function(b,a){a.children().each(function(){jQuery(this).width(jQuery(this).width())});return a};jQuery(document).ready(function(){jQuery("a.ajax-option-delete").click(function(){var d=this.id.split("-");d=d[1];jQuery.post(ajaxurl,{action:"xprofile_delete_option",cookie:encodeURIComponent(document.cookie),_wpnonce:jQuery("input#_wpnonce").val(),option_id:d},function(e){})});jQuery("ul#field-group-tabs").show();jQuery("ul#field-group-tabs").sortable({cursor:"move",axis:"x",opacity:0.6,items:"li",tolerance:"pointer",update:function(){jQuery.post(ajaxurl,{action:"xprofile_reorder_groups",cookie:encodeURIComponent(document.cookie),_wpnonce_reorder_groups:jQuery("input#_wpnonce_reorder_groups").val(),group_order:jQuery(this).sortable("serialize")},function(d){})}}).disableSelection();jQuery("fieldset.field-group").sortable({cursor:"move",opacity:0.3,items:"fieldset",tolerance:"pointer",update:function(){jQuery.post(ajaxurl,{action:"xprofile_reorder_fields",cookie:encodeURIComponent(document.cookie),_wpnonce_reorder_fields:jQuery("input#_wpnonce_reorder_fields").val(),field_order:jQuery(this).sortable("serialize"),field_group_id:jQuery(this).attr("id")},function(d){})}}).disableSelection().css("cursor","move");var b;var a=jQuery("#tabs").tabs();c(a);function c(d){b=jQuery("ul:first li",d).droppable({accept:".connectedSortable fieldset",hoverClass:"ui-state-hover",activeClass:"ui-state-acceptable",touch:"pointer",tolerance:"pointer",drop:function(g,h){var e=jQuery(this);var f=jQuery(e.find("a").attr("href")).find(".connectedSortable");jQuery(e).removeClass("drop-candidate");h.draggable.hide("slow",function(){d.tabs("select",b.index(e));jQuery(this).appendTo(f).show("slow").animate({opacity:"1"},500);f=jQuery(e.find("a").attr("href")).find(".connectedSortable");jQuery(f).find("p.nofields").hide("slow");jQuery.post(ajaxurl,{action:"xprofile_reorder_fields",cookie:encodeURIComponent(document.cookie),_wpnonce_reorder_fields:jQuery("input#_wpnonce_reorder_fields").val(),field_order:jQuery(f).sortable("serialize"),field_group_id:jQuery(f).attr("id")},function(i){})})},over:function(e,f){jQuery(this).addClass("drop-candidate")},out:function(e,f){jQuery(this).removeClass("drop-candidate")}})}});
\ No newline at end of file
diff --git a/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-actions.php b/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-actions.php
index 7eecdc18f105274b6f041f00d40a7bc836f1be2d..2ab4562f131a7e4585510c3a60044f4481a56b73 100644
--- a/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-actions.php
+++ b/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-actions.php
@@ -1,8 +1,14 @@
 <?php
-/*******************************************************************************
- * Action functions are exactly the same as screen functions, however they do
- * not have a template screen associated with them. Usually they will send the
- * user back to the default screen after execution.
+
+/**
+ * BuddyPress XProfile Actions
+ *
+ * Action functions are exactly the same as screen functions, however they do not
+ * have a template screen associated with them. Usually they will send the user
+ * back to the default screen after execution.
+ *
+ * @package BuddyPress
+ * @subpackage XProfileActions
  */
 
 // Exit if accessed directly
@@ -15,13 +21,11 @@ if ( !defined( 'ABSPATH' ) ) exit;
  * The function will delete the active avatar for a user.
  *
  * @package BuddyPress Xprofile
- * @global object $bp Global BuddyPress settings object
  * @uses bp_core_delete_avatar() Deletes the active avatar for the logged in user.
  * @uses add_action() Runs a specific function for an action when it fires.
  * @uses bp_core_load_template() Looks for and loads a template file within the current member theme (folder/filename)
  */
 function xprofile_action_delete_avatar() {
-	global $bp;
 
 	if ( !bp_is_user_change_avatar() || !bp_is_action_variable( 'delete-avatar', 0 ) )
 		return false;
@@ -29,10 +33,10 @@ function xprofile_action_delete_avatar() {
 	// Check the nonce
 	check_admin_referer( 'bp_delete_avatar_link' );
 
-	if ( !bp_is_my_profile() && !is_super_admin() )
+	if ( !bp_is_my_profile() && !bp_current_user_can( 'bp_moderate' ) )
 		return false;
 
-	if ( bp_core_delete_existing_avatar( array( 'item_id' => $bp->displayed_user->id ) ) )
+	if ( bp_core_delete_existing_avatar( array( 'item_id' => bp_displayed_user_id() ) ) )
 		bp_core_add_message( __( 'Your avatar was deleted successfully!', 'buddypress' ) );
 	else
 		bp_core_add_message( __( 'There was a problem deleting that avatar, please try again.', 'buddypress' ), 'error' );
diff --git a/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-activity.php b/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-activity.php
index 9a3c5e61148365aeaf580630a11a76b26854dfc5..7419f39b7c80c1eeb01c5a9295732eded2f03df1 100644
--- a/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-activity.php
+++ b/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-activity.php
@@ -1,4 +1,5 @@
 <?php
+
 /**
  * BuddyPress XProfile Activity & Notification Functions
  *
@@ -6,7 +7,7 @@
  * notifications for the user and for this specific component.
  *
  * @package BuddyPress
- * @subpackage XProfile
+ * @subpackage XProfileActivity
  */
 
 // Exit if accessed directly
@@ -15,12 +16,10 @@ if ( !defined( 'ABSPATH' ) ) exit;
 function xprofile_register_activity_actions() {
 	global $bp;
 
-	if ( bp_is_active( 'activity' ) )
-		return false;
-
 	// Register the activity stream actions for this component
+	bp_activity_set_action( $bp->profile->id, 'new_avatar',      __( 'Member changed profile picture', 'buddypress' ) );
 	bp_activity_set_action( $bp->profile->id, 'new_member',      __( 'New member registered', 'buddypress' ) );
-	bp_activity_set_action( $bp->profile->id, 'updated_profile', __( 'Updated Profile',       'buddypress' ) );
+	bp_activity_set_action( $bp->profile->id, 'updated_profile', __( 'Updated Profile', 'buddypress' ) );
 
 	do_action( 'xprofile_register_activity_actions' );
 }
@@ -30,19 +29,21 @@ add_action( 'bp_register_activity_actions', 'xprofile_register_activity_actions'
  * Records activity for the logged in user within the profile component so that
  * it will show in the users activity stream (if installed)
  *
- * @package BuddyPress XProfile
+ * @package BuddyPress
+ * @subpackage XProfileActivity
  * @param $args Array containing all variables used after extract() call
  * @global $bp The global BuddyPress settings variable created in bp_core_current_times()
  * @uses bp_activity_record() Adds an entry to the activity component tables for a specific activity
  */
 function xprofile_record_activity( $args = '' ) {
-	global $bp;
 
 	if ( !bp_is_active( 'activity' ) )
 		return false;
 
+	global $bp;
+
 	$defaults = array (
-		'user_id'           => $bp->loggedin_user->id,
+		'user_id'           => bp_loggedin_user_id(),
 		'action'            => '',
 		'content'           => '',
 		'primary_link'      => '',
@@ -77,24 +78,25 @@ function xprofile_record_activity( $args = '' ) {
  *
  * @package BuddyPress XProfile
  * @param $args Array containing all variables used after extract() call
- * @global object $bp Global BuddyPress settings object
+ * @global BuddyPress $bp The one true BuddyPress instance
  * @uses bp_activity_delete() Deletes an entry to the activity component tables for a specific activity
  */
 function xprofile_delete_activity( $args = '' ) {
-	global $bp;
 
-	if ( bp_is_active( 'activity' ) ) {
+	if ( ! bp_is_active( 'activity' ) )
+		return false;
 
-		extract( $args );
+	global $bp;
+
+	extract( $args );
 
-		bp_activity_delete_by_item_id( array(
-			'item_id'           => $item_id,
-			'component'         => $bp->profile->id,
-			'type'              => $type,
-			'user_id'           => $user_id,
-			'secondary_item_id' => $secondary_item_id
-		) );
-	}
+	bp_activity_delete_by_item_id( array(
+		'item_id'           => $item_id,
+		'component'         => $bp->profile->id,
+		'type'              => $type,
+		'user_id'           => $user_id,
+		'secondary_item_id' => $secondary_item_id
+	) );
 }
 
 function xprofile_register_activity_action( $key, $value ) {
@@ -110,16 +112,15 @@ function xprofile_register_activity_action( $key, $value ) {
  * Adds an activity stream item when a user has uploaded a new avatar.
  *
  * @package BuddyPress XProfile
- * @global object $bp Global BuddyPress settings object
+ * @global BuddyPress $bp The one true BuddyPress instance
  * @uses bp_activity_add() Adds an entry to the activity component tables for a specific activity
  */
 function bp_xprofile_new_avatar_activity() {
-	global $bp;
 
 	if ( !bp_is_active( 'activity' ) )
 		return false;
 
-	$user_id = apply_filters( 'bp_xprofile_new_avatar_user_id', $bp->displayed_user->id );
+	$user_id = apply_filters( 'bp_xprofile_new_avatar_user_id', bp_displayed_user_id() );
 
 	$userlink = bp_core_get_userlink( $user_id );
 
@@ -131,4 +132,5 @@ function bp_xprofile_new_avatar_activity() {
 	) );
 }
 add_action( 'xprofile_avatar_uploaded', 'bp_xprofile_new_avatar_activity' );
-?>
\ No newline at end of file
+
+?>
diff --git a/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-admin.php b/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-admin.php
index 6836ca915b6a594cdfbe702ec64d9f3737f0dfde..f32c2af78f035b441ae14184d6e352b3b034766f 100644
--- a/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-admin.php
+++ b/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-admin.php
@@ -1,4 +1,12 @@
 <?php
+
+/**
+ * BuddyPress XProfile Admin
+ *
+ * @package BuddyPress
+ * @subpackage XProfileAdmin
+ */
+
 // Exit if accessed directly
 if ( !defined( 'ABSPATH' ) ) exit;
 
@@ -7,24 +15,16 @@ if ( !defined( 'ABSPATH' ) ) exit;
  * tables are set up.
  *
  * @package BuddyPress XProfile
- * @global object $bp Global BuddyPress settings object
- * @global $wpdb WordPress DB access object.
- * @uses is_super_admin() returns true if the current user is a site admin, false if not
- * @uses bp_xprofile_install() runs the installation of DB tables for the xprofile component
- * @uses wp_enqueue_script() Adds a JS file to the JS queue ready for output
- * @uses add_submenu_page() Adds a submenu tab to a top level tab in the admin area
- * @uses xprofile_install() Runs the DB table installation function
+ * @uses bp_current_user_can() returns true if the current user is a site admin, false if not
+ * @uses add_users_page() Adds a submenu tab to a top level tab in the admin area
  * @return
  */
 function xprofile_add_admin_menu() {
-	global $wpdb, $bp;
 
-	if ( !is_super_admin() )
+	if ( !bp_current_user_can( 'bp_moderate' ) )
 		return false;
 
-	$hook = add_submenu_page( 'bp-general-settings', __( 'Profile Fields', 'buddypress' ), __( 'Profile Fields', 'buddypress' ), 'manage_options', 'bp-profile-setup', 'xprofile_admin' );
-
-	add_action( "admin_print_styles-$hook", 'bp_core_add_admin_menu_styles' );
+	add_users_page( __( 'Profile Fields', 'buddypress' ), __( 'Profile Fields', 'buddypress' ), 'manage_options', 'bp-profile-setup', 'xprofile_admin' );
 }
 add_action( bp_core_admin_hook(), 'xprofile_add_admin_menu' );
 
@@ -33,13 +33,12 @@ add_action( bp_core_admin_hook(), 'xprofile_add_admin_menu' );
  * profile groups and fields.
  */
 function xprofile_admin( $message = '', $type = 'error' ) {
-	global $bp;
 
 	$type = preg_replace( '|[^a-z]|i', '', $type );
 
 	$groups = BP_XProfile_Group::get( array(
 		'fetch_fields' => true
-	));
+	) );
 
 	if ( isset( $_GET['mode'] ) && isset( $_GET['group_id'] ) && 'add_field' == $_GET['mode'] )
 		xprofile_admin_manage_field( $_GET['group_id'] );
@@ -62,28 +61,25 @@ function xprofile_admin( $message = '', $type = 'error' ) {
 	else if ( isset( $_GET['mode'] ) && isset( $_GET['group_id'] ) && 'edit_group' == $_GET['mode'] )
 		xprofile_admin_manage_group( $_GET['group_id'] );
 
-	else {
-?>
+	else { ?>
 
 	<div class="wrap">
 
-		<?php screen_icon( 'buddypress' ); ?>
+		<?php screen_icon( 'users' ); ?>
 
 		<h2>
-
-			<?php _e( 'Extended Profile Fields', 'buddypress'); ?>
-
-			<a id="add_group" class="button add-new-h2" href="admin.php?page=bp-profile-setup&amp;mode=add_group"><?php _e( 'Add New Group', 'buddypress' ); ?></a>
+			<?php _e( 'Profile Fields', 'buddypress'); ?>
+			<a id="add_group" class="add-new-h2" href="admin.php?page=bp-profile-setup&amp;mode=add_group"><?php _e( 'Add New Field Group', 'buddypress' ); ?></a>
 		</h2>
 
-		<p><?php _e( 'Your users will distinguish themselves through their profile page. You must give them profile fields that allow them to describe themselves in a way that is relevant to the theme of your social network.', 'buddypress'); ?></p>
-		<p><?php echo sprintf( __( 'NOTE: Any fields in the "%s" group will appear on the signup page.', 'buddypress' ), esc_html( stripslashes( bp_get_option( 'bp-xprofile-base-group-name' ) ) ) ) ?></p>
+		<p><?php echo sprintf( __( 'Fields in the "%s" group will appear on the signup page.', 'buddypress' ), esc_html( stripslashes( bp_get_option( 'bp-xprofile-base-group-name' ) ) ) ) ?></p>
 
 		<form action="" id="profile-field-form" method="post">
 
-			<?php wp_nonce_field( 'bp_reorder_fields', '_wpnonce_reorder_fields' ); ?>
-
-			<?php wp_nonce_field( 'bp_reorder_groups', '_wpnonce_reorder_groups', false );
+			<?php
+			
+			wp_nonce_field( 'bp_reorder_fields', '_wpnonce_reorder_fields'        );
+			wp_nonce_field( 'bp_reorder_groups', '_wpnonce_reorder_groups', false );
 
 			if ( !empty( $message ) ) :
 				$type = ( $type == 'error' ) ? 'error' : 'updated'; ?>
@@ -92,23 +88,20 @@ function xprofile_admin( $message = '', $type = 'error' ) {
 					<p><?php echo esc_html( esc_attr( $message ) ); ?></p>
 				</div>
 
-<?php		endif; ?>
+			<?php endif; ?>
 
 			<div id="tabs">
 				<ul id="field-group-tabs">
-<?php
-			if ( !empty( $groups ) ) :
-				foreach ( $groups as $group ) { ?>
 
-					<li id="group_<?php echo $group->id; ?>"><a href="#tabs-<?php echo $group->id; ?>" class="ui-tab"><?php echo esc_attr( $group->name ); ?><?php if ( !$group->can_delete ) : ?> <?php _e( '(Primary)', 'buddypress'); endif; ?></a></li>
+					<?php if ( !empty( $groups ) ) : foreach ( $groups as $group ) : ?>
+
+						<li id="group_<?php echo $group->id; ?>"><a href="#tabs-<?php echo $group->id; ?>" class="ui-tab"><?php echo esc_attr( $group->name ); ?><?php if ( !$group->can_delete ) : ?> <?php _e( '(Primary)', 'buddypress'); endif; ?></a></li>
 
-<?php			}
-			endif; ?>
+					<?php endforeach; endif; ?>
 
 				</ul>
 
-<?php		if ( !empty( $groups ) ) :
-				foreach ( $groups as $group ) { ?>
+				<?php if ( !empty( $groups ) ) : foreach ( $groups as $group ) : ?>
 
 					<noscript>
 						<h3><?php echo esc_attr( $group->name ); ?></h3>
@@ -117,84 +110,71 @@ function xprofile_admin( $message = '', $type = 'error' ) {
 					<div id="tabs-<?php echo $group->id; ?>" class="tab-wrapper">
 						<div class="tab-toolbar">
 							<div class="tab-toolbar-left">
-								<a class="button" href="admin.php?page=bp-profile-setup&amp;group_id=<?php echo esc_attr( $group->id ); ?>&amp;mode=add_field"><?php _e( 'Add New Field', 'buddypress' ); ?></a>
+								<a class="button-primary" href="admin.php?page=bp-profile-setup&amp;group_id=<?php echo esc_attr( $group->id ); ?>&amp;mode=add_field"><?php _e( 'Add New Field', 'buddypress' ); ?></a>
 								<a class="button edit" href="admin.php?page=bp-profile-setup&amp;mode=edit_group&amp;group_id=<?php echo esc_attr( $group->id ); ?>"><?php _e( 'Edit Group', 'buddypress' ); ?></a>
 
-<?php				if ( $group->can_delete ) : ?>
+								<?php if ( $group->can_delete ) : ?>
 
-								<a class="submitdelete deletion" href="admin.php?page=bp-profile-setup&amp;mode=delete_group&amp;group_id=<?php echo esc_attr( $group->id ); ?>"><?php _e( 'Delete Group', 'buddypress' ); ?></a>
+									<a class="submitdelete deletion ajax-option-delete" href="admin.php?page=bp-profile-setup&amp;mode=delete_group&amp;group_id=<?php echo esc_attr( $group->id ); ?>"><?php _e( 'Delete Group', 'buddypress' ); ?></a>
 
-<?php				endif; ?>
+								<?php endif; ?>
 
 							</div>
 						</div>
 
 						<fieldset id="<?php echo $group->id; ?>" class="connectedSortable field-group">
 
-<?php				if( $group->description ) : ?>
+							<?php if ( $group->description ) : ?>
 
-							<legend><?php echo esc_attr( $group->description ) ?></legend>
+								<legend><?php echo esc_attr( $group->description ) ?></legend>
 
-<?php				endif;
+							<?php endif;
 
-					if ( !empty( $group->fields ) ) :
-						foreach ( $group->fields as $field ) {
+							if ( !empty( $group->fields ) ) :
+								foreach ( $group->fields as $field ) {
 
-							// Load the field
-							$field = new BP_XProfile_Field( $field->id );
+									// Load the field
+									$field = new BP_XProfile_Field( $field->id );
 
-							$class = '';
-							if ( !$field->can_delete )
-								$class = ' core nodrag';
+									$class = '';
+									if ( !$field->can_delete )
+										$class = ' core nodrag';
 
-							/* This function handles the WYSIWYG profile field
-							 * display for the xprofile admin setup screen
-							 */
-							xprofile_admin_field( $field, $group, $class );
+									/* This function handles the WYSIWYG profile field
+									* display for the xprofile admin setup screen
+									*/
+									xprofile_admin_field( $field, $group, $class );
 
-						} // end for
+								} // end for
 
-					else : // !$group->fields
-?>
+							else : // !$group->fields ?>
 
-							<p class="nodrag nofields"><?php _e( 'There are no fields in this group.', 'buddypress' ); ?></p>
+								<p class="nodrag nofields"><?php _e( 'There are no fields in this group.', 'buddypress' ); ?></p>
 
-<?php
-					endif; // end $group->fields
-?>
+							<?php endif; // end $group->fields ?>
 
 						</fieldset>
 					</div>
 
-<?php
-					} // End For ?>
+				<?php endforeach; else : ?>
 
-				</div>
-<?php
-				else :
-?>
+					<div id="message" class="error"><p><?php _e( 'You have no groups.', 'buddypress' ); ?></p></div>
+					<p><a href="admin.php?page=bp-profile-setup&amp;mode=add_group"><?php _e( 'Add New Group', 'buddypress' ); ?></a></p>
 
-				<div id="message" class="error"><p><?php _e( 'You have no groups.', 'buddypress' ); ?></p></div>
-				<p><a href="admin.php?page=bp-profile-setup&amp;mode=add_group"><?php _e( 'Add New Group', 'buddypress' ); ?></a></p>
+				<?php endif; ?>
+
+				<div id="tabs-bottom">&nbsp;</div>
+			</div>
+		</form>
+	</div>
 
-<?php
-				endif;
-?>
-				<div id="tabs-bottom">
-					&nbsp;
-				</div>
-			</form>
-		</div>
 <?php
 	}
 }
 
-/**************************************************************************
- xprofile_admin_manage_group()
-
- Handles the adding or editing of groups.
- **************************************************************************/
-
+/**
+ * Handles the adding or editing of groups.
+ */
 function xprofile_admin_manage_group( $group_id = null ) {
 	global $message, $type;
 
@@ -229,12 +209,9 @@ function xprofile_admin_manage_group( $group_id = null ) {
 	}
 }
 
-/**************************************************************************
- xprofile_admin_delete_group()
-
- Handles the deletion of profile data groups.
- **************************************************************************/
-
+/**
+ * Handles the deletion of profile data groups.
+ */
 function xprofile_admin_delete_group( $group_id ) {
 	global $message, $type;
 
@@ -254,17 +231,13 @@ function xprofile_admin_delete_group( $group_id ) {
 	xprofile_admin( $message, $type );
 }
 
-
-/**************************************************************************
- xprofile_admin_manage_field()
-
- Handles the adding or editing of profile field data for a user.
- **************************************************************************/
-
+/**
+ * Handles the adding or editing of profile field data for a user.
+ */
 function xprofile_admin_manage_field( $group_id, $field_id = null ) {
 	global $bp, $wpdb, $message, $groups;
 
-	$field = new BP_XProfile_Field( $field_id );
+	$field           = new BP_XProfile_Field( $field_id );
 	$field->group_id = $group_id;
 
 	if ( isset( $_POST['saveField'] ) ) {
@@ -284,11 +257,16 @@ function xprofile_admin_manage_field( $group_id, $field_id = null ) {
 				$field->field_order++;
 			}
 
-			if ( !$field->save() ) {
+			// For new profile fields, set the $field_id. For existing profile fields,
+			// this will overwrite $field_id with the same value.
+			$field_id = $field->save();
+
+			if ( !$field_id ) {
 				$message = __( 'There was an error saving the field. Please try again', 'buddypress' );
 				$type = 'error';
 
 				unset( $_GET['mode'] );
+				
 				xprofile_admin( $message, $type );
 			} else {
 				$message = __( 'The field was saved successfully.', 'buddypress' );
@@ -297,6 +275,14 @@ function xprofile_admin_manage_field( $group_id, $field_id = null ) {
 				if ( 1 == $field_id )
 					bp_update_option( 'bp-xprofile-fullname-field-name', $field->name );
 
+				if ( !empty( $_POST['default-visibility'] ) ) {
+					bp_xprofile_update_field_meta( $field_id, 'default_visibility', $_POST['default-visibility'] );
+				}
+				
+				if ( !empty( $_POST['allow-custom-visibility'] ) ) {
+					bp_xprofile_update_field_meta( $field_id, 'allow_custom_visibility', $_POST['allow-custom-visibility'] );
+				}
+
 				unset( $_GET['mode'] );
 
 				do_action( 'xprofile_fields_saved_field', $field );
@@ -312,27 +298,30 @@ function xprofile_admin_manage_field( $group_id, $field_id = null ) {
 	}
 }
 
-/**************************************************************************
- xprofile_admin_delete_field()
-
- Handles the deletion of a profile field [or option].
-**************************************************************************/
-function xprofile_admin_delete_field( $field_id, $type = 'field' ) {
+/**
+ * Handles the deletion of a profile field (or field option)
+ *
+ * @since BuddyPress (1.0)
+ * @global string $message The feedback message to show
+ * @global $type The type of feedback message to show
+ * @param int $field_id The field to delete
+ * @param string $field_type The type of field being deleted
+ * @param bool $delete_data Should the field data be deleted too?
+ */
+function xprofile_admin_delete_field( $field_id, $field_type = 'field', $delete_data = false ) {
 	global $message, $type;
 
-	if ( 'field' == $type )
-		$type = __('field', 'buddypress');
-	else
-		$type = __('option', 'buddypress');
+	// Switch type to 'option' if type is not 'field'
+	// @todo trust this param
+	$field_type  = ( 'field' == $field_type ) ? __( 'field', 'buddypress' ) : __( 'option', 'buddypress' );
+	$field       = new BP_XProfile_Field( $field_id );
 
-	$field = new BP_XProfile_Field( $field_id );
-
-	if ( !$field->delete() ) {
-		$message = sprintf( __('There was an error deleting the %s. Please try again', 'buddypress' ), $type );
-		$type = 'error';
+	if ( !$field->delete( (bool) $delete_data ) ) {
+		$message = sprintf( __( 'There was an error deleting the %s. Please try again', 'buddypress' ), $field_type );
+		$type    = 'error';
 	} else {
-		$message = sprintf( __('The %s was deleted successfully!', 'buddypress' ), $type );
-		$type = 'success';
+		$message = sprintf( __( 'The %s was deleted successfully!', 'buddypress' ), $field_type );
+		$type    = 'success';
 
 		do_action( 'xprofile_fields_deleted_field', $field );
 	}
@@ -341,13 +330,10 @@ function xprofile_admin_delete_field( $field_id, $type = 'field' ) {
 	xprofile_admin( $message, $type );
 }
 
-/**************************************************************************
- xprofile_ajax_reorder_fields()
-
- Handles the ajax reordering of fields within a group
-**************************************************************************/
+/**
+ * Handles the ajax reordering of fields within a group
+ */
 function xprofile_ajax_reorder_fields() {
-	global $bp;
 
 	// Check the nonce
 	check_admin_referer( 'bp_reorder_fields', '_wpnonce_reorder_fields' );
@@ -356,21 +342,19 @@ function xprofile_ajax_reorder_fields() {
 		return false;
 
 	parse_str( $_POST['field_order'], $order );
+
 	$field_group_id = $_POST['field_group_id'];
 
-	foreach ( (array) $order['field'] as $position => $field_id )
+	foreach ( (array) $order['field'] as $position => $field_id ) {
 		xprofile_update_field_position( (int) $field_id, (int) $position, (int) $field_group_id );
-
+	}
 }
 add_action( 'wp_ajax_xprofile_reorder_fields', 'xprofile_ajax_reorder_fields' );
 
-/**************************************************************************
- xprofile_ajax_reorder_field_groups()
-
- Handles the reordering of field groups
-**************************************************************************/
+/**
+ * Handles the reordering of field groups
+ */
 function xprofile_ajax_reorder_field_groups() {
-	global $bp;
 
 	// Check the nonce
 	check_admin_referer( 'bp_reorder_groups', '_wpnonce_reorder_groups' );
@@ -380,98 +364,107 @@ function xprofile_ajax_reorder_field_groups() {
 
 	parse_str( $_POST['group_order'], $order );
 
-	foreach ( (array) $order['group'] as $position => $field_group_id )
+	foreach ( (array) $order['group'] as $position => $field_group_id ) {
 		xprofile_update_field_group_position( (int) $field_group_id, (int) $position );
-
+	}
 }
 add_action( 'wp_ajax_xprofile_reorder_groups', 'xprofile_ajax_reorder_field_groups' );
 
-/**************************************************************************
- xprofile_admin_field()
-
- Handles the WYSIWYG display of each profile field on the edit screen
-**************************************************************************/
-function xprofile_admin_field( $admin_field, $admin_group, $class='' ) {
+/**
+ * Handles the WYSIWYG display of each profile field on the edit screen
+ */
+function xprofile_admin_field( $admin_field, $admin_group, $class = '' ) {
 	global $field;
 
 	$field = $admin_field; ?>
-						<fieldset id="field_<?php echo esc_attr( $field->id ); ?>" class="sortable<?php echo ' ' . $field->type; if ( $class ) echo ' ' . $class; ?>">
-							<legend><span><?php bp_the_profile_field_name(); ?> <?php if( !$field->can_delete ) : ?> <?php _e( '(Primary)', 'buddypress' ); endif; ?> <?php if ( bp_get_the_profile_field_is_required() ) : ?><?php _e( '(Required)', 'buddypress' ) ?><?php endif; ?></span></legend>
-							<div class="field-wrapper">
 
-<?php
-	switch ( $field->type ) {
-		case 'textbox' : ?>
+	<fieldset id="field_<?php echo esc_attr( $field->id ); ?>" class="sortable<?php echo ' ' . $field->type; if ( !empty( $class ) ) echo ' ' . $class; ?>">
+		<legend><span><?php bp_the_profile_field_name(); ?> <?php if( !$field->can_delete ) : ?> <?php _e( '(Primary)', 'buddypress' ); endif; ?> <?php if ( bp_get_the_profile_field_is_required() ) : ?><?php _e( '(Required)', 'buddypress' ) ?><?php endif; ?></span></legend>
+		<div class="field-wrapper">
 
-								<input type="text" name="<?php bp_the_profile_field_input_name() ?>" id="<?php bp_the_profile_field_input_name() ?>" value="" />
+			<?php switch ( $field->type ) : case 'textbox' : ?>
 
-<?php		break; case 'textarea' : ?>
+				<input type="text" name="<?php bp_the_profile_field_input_name() ?>" id="<?php bp_the_profile_field_input_name() ?>" value="" />
 
-								<textarea rows="5" cols="40" name="<?php bp_the_profile_field_input_name() ?>" id="<?php bp_the_profile_field_input_name() ?>"></textarea>
+			<?php break; case 'textarea' : ?>
 
-<?php		break; case 'selectbox' : ?>
+				<textarea rows="5" cols="40" name="<?php bp_the_profile_field_input_name() ?>" id="<?php bp_the_profile_field_input_name() ?>"></textarea>
 
-								<select name="<?php bp_the_profile_field_input_name() ?>" id="<?php bp_the_profile_field_input_name() ?>">
-									<?php bp_the_profile_field_options() ?>
+			<?php break; case 'selectbox' : ?>
 
-								</select>
+				<select name="<?php bp_the_profile_field_input_name() ?>" id="<?php bp_the_profile_field_input_name() ?>">
 
-<?php		break; case 'multiselectbox' : ?>
+					<?php bp_the_profile_field_options() ?>
 
-								<select name="<?php bp_the_profile_field_input_name() ?>" id="<?php bp_the_profile_field_input_name() ?>" multiple="multiple">
-									<?php bp_the_profile_field_options() ?>
+				</select>
 
-								</select>
+			<?php break; case 'multiselectbox' : ?>
 
-<?php		break; case 'radio' : ?>
+				<select name="<?php bp_the_profile_field_input_name() ?>" id="<?php bp_the_profile_field_input_name() ?>" multiple="multiple">
 
-								<?php bp_the_profile_field_options() ?>
+					<?php bp_the_profile_field_options() ?>
 
-<?php			if ( !bp_get_the_profile_field_is_required() ) : ?>
+				</select>
 
-								<a class="clear-value" href="javascript:clear( '<?php bp_the_profile_field_input_name() ?>' );"><?php _e( 'Clear', 'buddypress' ) ?></a>
+			<?php break; case 'radio' : ?>
 
-<?php			endif; ?>
+				<?php bp_the_profile_field_options() ?>
 
-<?php		break; case 'checkbox' : ?>
+				<?php if ( !bp_get_the_profile_field_is_required() ) : ?>
 
-<?php bp_the_profile_field_options(); ?>
+					<a class="clear-value" href="javascript:clear( '<?php bp_the_profile_field_input_name() ?>' );"><?php _e( 'Clear', 'buddypress' ) ?></a>
 
-<?php		break; case 'datebox' : ?>
+				<?php endif; ?>
 
-								<select name="<?php bp_the_profile_field_input_name(); ?>_day" id="<?php bp_the_profile_field_input_name(); ?>_day">
-									<?php bp_the_profile_field_options( 'type=day' ); ?>
+			<?php break; case 'checkbox' : ?>
 
-								</select>
+				<?php bp_the_profile_field_options(); ?>
 
-								<select name="<?php bp_the_profile_field_input_name(); ?>_month" id="<?php bp_the_profile_field_input_name(); ?>_month">
-									<?php bp_the_profile_field_options( 'type=month' ); ?>
+			<?php break; case 'datebox' : ?>
 
-								</select>
+				<select name="<?php bp_the_profile_field_input_name(); ?>_day" id="<?php bp_the_profile_field_input_name(); ?>_day">
 
-								<select name="<?php bp_the_profile_field_input_name(); ?>_year" id="<?php bp_the_profile_field_input_name(); ?>_year">
-									<?php bp_the_profile_field_options( 'type=year' ); ?>
+					<?php bp_the_profile_field_options( 'type=day' ); ?>
 
-								</select>
+				</select>
 
-<?php		break; default : ?>
+				<select name="<?php bp_the_profile_field_input_name(); ?>_month" id="<?php bp_the_profile_field_input_name(); ?>_month">
 
-<?php	do_action( 'xprofile_admin_field', $field, 1 ); ?>
+					<?php bp_the_profile_field_options( 'type=month' ); ?>
 
-<?php } ?>
-								<div class="actions">
-									<a class="button edit" href="admin.php?page=bp-profile-setup&amp;group_id=<?php echo esc_attr( $admin_group->id ); ?>&amp;field_id=<?php echo esc_attr( $field->id ); ?>&amp;mode=edit_field"><?php _e( 'Edit', 'buddypress' ); ?></a>
-									<?php if ( !$field->can_delete ) : ?>&nbsp;<?php else : ?><a class="button delete" href="admin.php?page=bp-profile-setup&amp;field_id=<?php echo esc_attr( $field->id ); ?>&amp;mode=delete_field"><?php _e( 'Delete', 'buddypress' ); ?></a><?php endif; ?>
+				</select>
 
-								</div>
+				<select name="<?php bp_the_profile_field_input_name(); ?>_year" id="<?php bp_the_profile_field_input_name(); ?>_year">
 
-<?php if ( $field->description ) : ?>
+					<?php bp_the_profile_field_options( 'type=year' ); ?>
 
-								<p class="description"><?php echo esc_attr( $field->description ); ?></p>
+				</select>
 
-<?php endif; ?>
+			<?php break; default : ?>
+
+			<?php do_action( 'xprofile_admin_field', $field, 1 ); ?>
+
+			<?php endswitch; ?>
+
+			<?php if ( $field->description ) : ?>
+
+				<p class="description"><?php echo esc_attr( $field->description ); ?></p>
+
+			<?php endif; ?>
+
+			<div class="actions">
+				<a class="button edit" href="admin.php?page=bp-profile-setup&amp;group_id=<?php echo esc_attr( $admin_group->id ); ?>&amp;field_id=<?php echo esc_attr( $field->id ); ?>&amp;mode=edit_field"><?php _e( 'Edit', 'buddypress' ); ?></a>
+
+				<?php if ( $field->can_delete ) : ?>
+
+					<a class="submit-delete deletion" href="admin.php?page=bp-profile-setup&amp;field_id=<?php echo esc_attr( $field->id ); ?>&amp;mode=delete_field"><?php _e( 'Delete', 'buddypress' ); ?></a>
+
+				<?php endif; ?>
+			</div>
+		</div>
+	</fieldset>
 
-							</div>
-						</fieldset>
 <?php
-}
\ No newline at end of file
+}
+
+?>
diff --git a/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-buddybar.php b/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-buddybar.php
index 9b66e1b6d430b220fe20cded59cf07baddb45e31..b5751561aa6694df953d2a28f4903d740eae97f2 100644
--- a/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-buddybar.php
+++ b/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-buddybar.php
@@ -1,4 +1,6 @@
 <?php
+
 // Exit if accessed directly
 if ( !defined( 'ABSPATH' ) ) exit;
+
 ?>
\ No newline at end of file
diff --git a/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-cache.php b/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-cache.php
index a4afa6fad4d534bcb216ae84c5a088f3830a3117..4e063745578766ef6ac8ccc8ec871e568fca637a 100644
--- a/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-cache.php
+++ b/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-cache.php
@@ -1,22 +1,25 @@
 <?php
-/********************************************************************************
- * Caching
+
+/**
+ * BuddyPress XProfile Template Tags
  *
  * Caching functions handle the clearing of cached objects and pages on specific
  * actions throughout BuddyPress.
+ *
+ * @package BuddyPress
+ * @subpackage XProfileTemplate
  */
 
 // Exit if accessed directly
 if ( !defined( 'ABSPATH' ) ) exit;
 
 function xprofile_clear_profile_groups_object_cache( $group_obj ) {
-	wp_cache_delete( 'xprofile_groups_inc_empty', 'bp' );
-	wp_cache_delete( 'xprofile_group_' . $group_obj->id );
+	wp_cache_delete( 'xprofile_groups_inc_empty',        'bp' );
+	wp_cache_delete( 'xprofile_group_' . $group_obj->id, 'bp' );
 }
 
 function xprofile_clear_profile_data_object_cache( $group_id ) {
-	global $bp;
-	wp_cache_delete( 'bp_user_fullname_' . $bp->loggedin_user->id, 'bp' );
+	wp_cache_delete( 'bp_user_fullname_' . bp_loggedin_user_id(), 'bp' );
 }
 
 // List actions to clear object caches on
@@ -27,4 +30,4 @@ add_action( 'xprofile_updated_profile',      'xprofile_clear_profile_data_object
 // List actions to clear super cached pages on, if super cache is installed
 add_action( 'xprofile_updated_profile', 'bp_core_clear_cache' );
 
-?>
\ No newline at end of file
+?>
diff --git a/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-caps.php b/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-caps.php
new file mode 100644
index 0000000000000000000000000000000000000000..f5cc6293e6a6abffa78472addb68fdbc5de165d3
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-caps.php
@@ -0,0 +1,61 @@
+<?php
+
+/**
+ * Roles and capabilities logic for the XProfile component
+ *
+ * @package BuddyPress
+ * @since 1.6
+ */
+
+// Exit if accessed directly
+if ( ! defined( 'ABSPATH' ) ) exit;
+
+/**
+ * Maps XProfile caps to built in WordPress caps
+ *
+ * @since 1.6
+ *
+ * @param array $caps Capabilities for meta capability
+ * @param string $cap Capability name
+ * @param int $user_id User id
+ * @param mixed $args Arguments
+ * @uses get_post() To get the post
+ * @uses get_post_type_object() To get the post type object
+ * @uses apply_filters() Calls 'bp_map_meta_caps' with caps, cap, user id and
+ *                        args
+ * @return array Actual capabilities for meta capability
+ */
+function bp_xprofile_map_meta_caps( $caps, $cap, $user_id, $args ) {
+	switch ( $cap ) {
+		case 'bp_xprofile_change_field_visibility' :
+			$caps = array( 'exist' ); // Must allow for logged-out users during registration
+
+			// You may pass args manually: $field_id, $profile_user_id
+			$field_id        = isset( $args[0] ) ? (int)$args[0] : bp_get_the_profile_field_id();
+			$profile_user_id = isset( $args[1] ) ? (int)$args[1] : bp_displayed_user_id();
+
+			// Visibility on the fullname field is not editable
+			if ( 1 == $field_id ) {
+				$caps[] = 'do_not_allow';
+				break;
+			}
+
+			// Has the admin disabled visibility modification for this field?
+			if ( 'disabled' == bp_xprofile_get_meta( $field_id, 'field', 'allow_custom_visibility' ) ) {
+				$caps[] = 'do_not_allow';
+				break;
+			}
+
+			// Friends don't let friends edit each other's visibility
+			if ( $profile_user_id != bp_displayed_user_id() && !bp_current_user_can( 'bp_moderate' ) ) {
+				$caps[] = 'do_not_allow'; 
+				break;
+			}
+
+			break;
+	}
+
+	return apply_filters( 'bp_xprofile_map_meta_caps', $caps, $cap, $user_id, $args );
+}
+add_filter( 'bp_map_meta_caps', 'bp_xprofile_map_meta_caps', 10, 4 );
+?>
\ No newline at end of file
diff --git a/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-classes.php b/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-classes.php
index cf75798ea3dd3d14302228eb4f27a988e4a0ca74..b6f9c421ca7d7efd5a716ac75f4e5bc7f134a172 100644
--- a/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-classes.php
+++ b/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-classes.php
@@ -1,8 +1,16 @@
 <?php
+
+/**
+ * BuddyPress XProfile Classes
+ *
+ * @package BuddyPress
+ * @subpackage XProfileClasses
+ */
+
 // Exit if accessed directly
 if ( !defined( 'ABSPATH' ) ) exit;
 
-Class BP_XProfile_Group {
+class BP_XProfile_Group {
 	var $id = null;
 	var $name;
 	var $description;
@@ -10,16 +18,9 @@ Class BP_XProfile_Group {
 	var $group_order;
 	var $fields;
 
-	function bp_xprofile_group( $id = null ) {
-		$this->__construct( $id );
-	}
-
 	function __construct( $id = null ) {
-		global $bp, $wpdb;
-
-		if ( $id )
+		if ( !empty( $id ) )
 			$this->populate( $id );
-
 	}
 
 	function populate( $id ) {
@@ -40,8 +41,8 @@ Class BP_XProfile_Group {
 	function save() {
 		global $wpdb, $bp;
 
-		$this->name			= apply_filters( 'xprofile_group_name_before_save',        $this->name,        $this->id );
-		$this->description	= apply_filters( 'xprofile_group_description_before_save', $this->description, $this->id );
+		$this->name        = apply_filters( 'xprofile_group_name_before_save',        $this->name,        $this->id );
+		$this->description = apply_filters( 'xprofile_group_description_before_save', $this->description, $this->id );
 
 		do_action_ref_array( 'xprofile_group_before_save', array( &$this ) );
 
@@ -53,27 +54,30 @@ Class BP_XProfile_Group {
 		if ( is_wp_error( $wpdb->query( $sql ) ) )
 			return false;
 
+		// If not set, update the ID in the group object
+		if ( ! $this->id )
+			$this->id = $wpdb->insert_id;
+
 		do_action_ref_array( 'xprofile_group_after_save', array( &$this ) );
 
-		if ( $this->id )
-			return $this->id;
-		else
-			return $wpdb->insert_id;
+		return $this->id;
 	}
 
 	function delete() {
 		global $wpdb, $bp;
 
-		if ( !$this->can_delete )
+		if ( empty( $this->can_delete ) )
 			return false;
 
-		/* Delete field group */
+		// Delete field group
 		if ( !$wpdb->query( $wpdb->prepare( "DELETE FROM {$bp->profile->table_name_groups} WHERE id = %d", $this->id ) ) ) {
 			return false;
 		} else {
-			/* Remove the group's fields. */
+
+			// Remove the group's fields.
 			if ( BP_XProfile_Field::delete_for_group( $this->id ) ) {
-				/* Remove profile data for the groups fields */
+
+				// Remove profile data for the groups fields
 				for ( $i = 0, $count = count( $this->fields ); $i < $count; ++$i ) {
 					BP_XProfile_ProfileData::delete_for_field( $this->fields[$i]->id );
 				}
@@ -83,7 +87,7 @@ Class BP_XProfile_Group {
 		}
 	}
 
-	/** Static Functions **/
+	/** Static Methods ********************************************************/
 
 	/**
 	 * get()
@@ -93,7 +97,7 @@ Class BP_XProfile_Group {
 	 * @package BuddyPress XProfile
 	 *
 	 * @global $wpdb WordPress DB access object.
-	 * @global object $bp Global BuddyPress settings object
+	 * @global BuddyPress $bp The one true BuddyPress instance
 	 *
 	 * @param array $args Takes an array of parameters:
 	 *		'profile_group_id' - Limit results to a single profile group
@@ -111,36 +115,37 @@ Class BP_XProfile_Group {
 		global $wpdb, $bp;
 
 		$defaults = array(
-			'profile_group_id'  => false,
-			'user_id'           => $bp->displayed_user->id,
-			'hide_empty_groups' => false,
-			'hide_empty_fields' => false,
-			'fetch_fields'      => false,
-			'fetch_field_data'  => false,
-			'exclude_groups'    => false,
-			'exclude_fields'    => false
+			'profile_group_id'    => false,
+			'user_id'             => bp_displayed_user_id(),
+			'hide_empty_groups'   => false,
+			'hide_empty_fields'   => false,
+			'fetch_fields'        => false,
+			'fetch_field_data'    => false,
+			'fetch_visibility_level' => false,
+			'exclude_groups'      => false,
+			'exclude_fields'      => false
 		);
 
 		$r = wp_parse_args( $args, $defaults );
 		extract( $r, EXTR_SKIP );
 		$where_sql = '';
 
-		if ( $profile_group_id )
+		if ( !empty( $profile_group_id ) )
 			$where_sql = $wpdb->prepare( 'WHERE g.id = %d', $profile_group_id );
 		elseif ( $exclude_groups )
-			$where_sql = $wpdb->prepare( "WHERE g.id NOT IN ({$exclude_groups})");
+			$where_sql = "WHERE g.id NOT IN ({$exclude_groups})";
 
-		if ( $hide_empty_groups )
-			$groups = $wpdb->get_results( $wpdb->prepare( "SELECT DISTINCT g.* FROM {$bp->profile->table_name_groups} g INNER JOIN {$bp->profile->table_name_fields} f ON g.id = f.group_id {$where_sql} ORDER BY g.group_order ASC" ) );
+		if ( !empty( $hide_empty_groups ) )
+			$groups = $wpdb->get_results( "SELECT DISTINCT g.* FROM {$bp->profile->table_name_groups} g INNER JOIN {$bp->profile->table_name_fields} f ON g.id = f.group_id {$where_sql} ORDER BY g.group_order ASC" );
 		else
-			$groups = $wpdb->get_results( $wpdb->prepare( "SELECT DISTINCT g.* FROM {$bp->profile->table_name_groups} g {$where_sql} ORDER BY g.group_order ASC" ) );
+			$groups = $wpdb->get_results( "SELECT DISTINCT g.* FROM {$bp->profile->table_name_groups} g {$where_sql} ORDER BY g.group_order ASC" );
 
-		if ( !$fetch_fields )
+		if ( empty( $fetch_fields ) )
 			return $groups;
 
 		// Get the group ids
 		$group_ids = array();
-		foreach( (array)$groups as $group ) {
+		foreach( (array) $groups as $group ) {
 			$group_ids[] = $group->id;
 		}
 
@@ -149,31 +154,45 @@ Class BP_XProfile_Group {
 		if ( empty( $group_ids ) )
 			return $groups;
 
-		$exclude_fields_sql = '';
-		if ( $exclude_fields )
-			$exclude_fields_sql = $wpdb->prepare( "AND id NOT IN ({$exclude_fields})" );
+		// Support arrays and comma-separated strings
+		$exclude_fields_cs = wp_parse_id_list( $exclude_fields );
+
+		// Visibility - Handled here so as not to be overridden by sloppy use of the
+		// exclude_fields parameter. See bp_xprofile_get_hidden_fields_for_user()
+		$exclude_fields_cs = array_merge( $exclude_fields_cs, bp_xprofile_get_hidden_fields_for_user( $user_id ) );
+
+		$exclude_fields_cs = implode( ',', $exclude_fields_cs );
+
+		if ( !empty( $exclude_fields_cs ) ) {
+			$exclude_fields_sql = "AND id NOT IN ({$exclude_fields_cs})";
+		} else {
+			$exclude_fields_sql = '';
+		}
 
 		// Fetch the fields
-		$fields = $wpdb->get_results( $wpdb->prepare( "SELECT id, name, description, type, group_id, is_required FROM {$bp->profile->table_name_fields} WHERE group_id IN ( {$group_ids} ) AND parent_id = 0 {$exclude_fields_sql} ORDER BY field_order" ) );
+		$fields = $wpdb->get_results( "SELECT id, name, description, type, group_id, is_required FROM {$bp->profile->table_name_fields} WHERE group_id IN ( {$group_ids} ) AND parent_id = 0 {$exclude_fields_sql} ORDER BY field_order" );
 
 		if ( empty( $fields ) )
 			return $groups;
 
-		if ( $fetch_field_data ) {
+		if ( ! empty( $fetch_field_data ) && ! empty( $user_id ) ) {
+
 			// Fetch the field data for the user.
-			foreach( (array)$fields as $field )
+			foreach( (array) $fields as $field ) {
 				$field_ids[] = $field->id;
+			}
 
 			$field_ids_sql = implode( ',', (array) $field_ids );
 
 			if ( !empty( $field_ids ) )
-				$field_data = $wpdb->get_results( $wpdb->prepare( "SELECT field_id, value FROM {$bp->profile->table_name_data} WHERE field_id IN ( {$field_ids_sql} ) AND user_id = %d", $user_id ) );
+				$field_data = $wpdb->get_results( $wpdb->prepare( "SELECT id, field_id, value FROM {$bp->profile->table_name_data} WHERE field_id IN ( {$field_ids_sql} ) AND user_id = %d", $user_id ) );
 
 			// Remove data-less fields, if necessary
-			if ( $hide_empty_fields ) {
+			if ( !empty( $hide_empty_fields ) ) {
 
 				// Loop through the results and find the fields that have data.
-				foreach( (array)$field_data as $data ) {
+				foreach( (array) $field_data as $data ) {
+
 					// Empty fields may contain a serialized empty array
 					$maybe_value = maybe_unserialize( $data->value );
 					if ( !empty( $maybe_value ) && false !== $key = array_search( $data->field_id, $field_ids ) ) {
@@ -198,17 +217,24 @@ Class BP_XProfile_Group {
 			if ( !empty( $field_data ) && !is_wp_error( $field_data ) ) {
 
 				// Loop through fields
-				foreach( (array)$fields as $field_key => $field ) {
+				foreach( (array) $fields as $field_key => $field ) {
 
 					// Loop throught the data in each field
-					foreach( (array)$field_data as $data ) {
+					foreach( (array) $field_data as $data ) {
 
 						// Assign correct data value to the field
-						if ( $field->id == $data->field_id )
-							$fields[$field_key]->data->value = $data->value;
+						if ( $field->id == $data->field_id ) {
+                                                        $fields[$field_key]->data = new stdClass;
+                                                        $fields[$field_key]->data->value = $data->value;
+                                                        $fields[$field_key]->data->id = $data->id;
+						}
 					}
 				}
 			}
+
+			if ( $fetch_visibility_level ) {
+				$fields = self::fetch_visibility_level( $user_id, $fields );
+			}
 		}
 
 		// Merge the field array back in with the group array
@@ -219,8 +245,9 @@ Class BP_XProfile_Group {
 			$index = array_search( $group, $groups );
 
 			foreach( (array) $fields as $field ) {
-				if ( $group->id == $field->group_id )
+				if ( $group->id == $field->group_id ) {
 					$groups[$index]->fields[] = $field;
+				}
 			}
 
 			// When we unset fields above, we may have created empty groups.
@@ -257,6 +284,68 @@ Class BP_XProfile_Group {
 		return $wpdb->query( $wpdb->prepare( "UPDATE {$bp->profile->table_name_groups} SET group_order = %d WHERE id = %d", $position, $field_group_id ) );
 	}
 
+	/**
+	 * Fetch the field visibility level for the fields returned by the query
+	 *
+	 * @since 1.6
+	 *
+	 * @param int $user_id The profile owner's user_id
+	 * @param array $fields The database results returned by the get() query
+	 * @return array $fields The database results, with field_visibility added
+	 */
+	function fetch_visibility_level( $user_id, $fields ) {
+		global $wpdb, $bp;
+
+		// Get the user's visibility level preferences
+		$visibility_levels = bp_get_user_meta( $user_id, 'bp_xprofile_visibility_levels', true );
+
+		// Get the admin-set preferences
+		$admin_set_levels  = self::fetch_default_visibility_levels();
+
+		foreach( (array)$fields as $key => $field ) {
+			// Does the admin allow this field to be customized?
+			$allow_custom = empty( $admin_set_levels[$field->id]['allow_custom'] ) || 'allowed' == $admin_set_levels[$field->id]['allow_custom'];
+
+			// Look to see if the user has set the visibility for this field
+			if ( $allow_custom && isset( $visibility_levels[$field->id] ) ) {
+				$field_visibility = $visibility_levels[$field->id];
+			} else {
+				// If no admin-set default is saved, fall back on a global default
+				$field_visibility = !empty( $admin_set_levels[$field->id]['default'] ) ? $admin_set_levels[$field->id]['default'] : apply_filters( 'bp_xprofile_default_visibility_level', 'public' );
+			}
+
+			$fields[$key]->visibility_level = $field_visibility;
+		}
+
+		return $fields;
+	}
+
+	/**
+	 * Fetch the admin-set preferences for all fields
+	 *
+	 * @since 1.6
+	 *
+	 * @return array $default_visibility_levels An array, keyed by field_id, of default
+	 *   visibility level + allow_custom (whether the admin allows this field to be set by user)
+	 */
+	function fetch_default_visibility_levels() {
+		global $wpdb, $bp;
+
+		$levels = $wpdb->get_results( "SELECT object_id, meta_key, meta_value FROM {$bp->profile->table_name_meta} WHERE object_type = 'field' AND ( meta_key = 'default_visibility' OR meta_key = 'allow_custom_visibility' )" );
+
+		// Arrange so that the field id is the key and the visibility level the value
+		$default_visibility_levels = array();
+		foreach( $levels as $level ) {
+			if ( 'default_visibility' == $level->meta_key ) {
+				$default_visibility_levels[$level->object_id]['default'] = $level->meta_value;
+			} else if ( 'allow_custom_visibility' == $level->meta_key ) {
+				$default_visibility_levels[$level->object_id]['allow_custom'] = $level->meta_value;
+			}
+		}
+
+		return $default_visibility_levels;
+	}
+
 	/* ADMIN AREA HTML.
 	* TODO: Get this out of here and replace with standard loops
 	*/
@@ -264,7 +353,7 @@ Class BP_XProfile_Group {
 	function render_admin_form() {
 		global $message;
 
-		if ( !$this->id ) {
+		if ( empty( $this->id ) ) {
 			$title	= __( 'Add New Field Group', 'buddypress' );
 			$action	= "admin.php?page=bp-profile-setup&amp;mode=add_group";
 			$button	= __( 'Create Field Group', 'buddypress' );
@@ -272,21 +361,24 @@ Class BP_XProfile_Group {
 			$title = __( 'Edit Field Group', 'buddypress' );
 			$action = "admin.php?page=bp-profile-setup&amp;mode=edit_group&amp;group_id=" . $this->id;
 			$button	= __( 'Save Changes', 'buddypress' );
-		}
-?>
+		} ?>
+
 		<div class="wrap">
 
-			<?php screen_icon( 'buddypress' ); ?>
+			<?php screen_icon( 'users' ); ?>
 
 			<h2><?php echo $title; ?></h2>
 			<p><?php _e( 'Fields marked * are required', 'buddypress' ) ?></p>
 
-<?php if ( $message != '' ) :
-		$type = ( 'error' == $type ) ? 'error' : 'updated'; ?>
+			<?php if ( !empty( $message ) ) :
+					$type = ( 'error' == $type ) ? 'error' : 'updated'; ?>
+
 				<div id="message" class="<?php echo $type; ?> fade">
 					<p><?php echo $message; ?></p>
 				</div>
-<?php endif; ?>
+
+			<?php endif; ?>
+
 			<div id="poststuff">
 				<form action="<?php echo esc_attr( $action ); ?>" method="post">
 					<div id="titlediv">
@@ -296,14 +388,16 @@ Class BP_XProfile_Group {
 						</div>
 					</div>
 
-<?php if ( '0' != $this->can_delete ) : ?>
-					<div id="titlediv">
-						<h3><label for="description"><?php _e( "Group Description", 'buddypress' ); ?></label></h3>
-						<div id="titlewrap">
-							<textarea name="group_description" id="group_description" rows="8" cols="60"><?php echo htmlspecialchars( $this->description ); ?></textarea>
+					<?php if ( '0' != $this->can_delete ) : ?>
+
+						<div id="titlediv">
+							<h3><label for="description"><?php _e( "Group Description", 'buddypress' ); ?></label></h3>
+							<div id="titlewrap">
+								<textarea name="group_description" id="group_description" rows="8" cols="60"><?php echo htmlspecialchars( $this->description ); ?></textarea>
+							</div>
 						</div>
-					</div>
-<?php endif; ?>
+
+					<?php endif; ?>
 
 					<p class="submit">
 						<input type="hidden" name="group_order" id="group_order" value="<?php echo esc_attr( $this->group_order ); ?>" />
@@ -313,12 +407,12 @@ Class BP_XProfile_Group {
 				</form>
 			</div>
 		</div>
+
 <?php
 	}
 }
 
-
-Class BP_XProfile_Field {
+class BP_XProfile_Field {
 	var $id;
 	var $group_id;
 	var $parent_id;
@@ -331,23 +425,22 @@ Class BP_XProfile_Field {
 	var $option_order;
 	var $order_by;
 	var $is_default_option;
+	var $default_visibility;
+	var $allow_custom_visibility = 'allowed';
 
 	var $data;
 	var $message = null;
 	var $message_type = 'err';
 
-	function bp_xprofile_field( $id = null, $user_id = null, $get_data = true ) {
-		$this->__construct( $id, $user_id, $get_data );
-	}
-
 	function __construct( $id = null, $user_id = null, $get_data = true ) {
-		if ( $id )
+		if ( !empty( $id ) )
 			$this->populate( $id, $user_id, $get_data );
 	}
 
 	function populate( $id, $user_id, $get_data ) {
 		global $wpdb, $userdata, $bp;
 
+		// @todo Why are we nooping the user_id ?
 		$user_id = 0;
 		if ( is_null( $user_id ) )
 			$user_id = $userdata->ID;
@@ -368,26 +461,35 @@ Class BP_XProfile_Field {
 			$this->order_by          = $field->order_by;
 			$this->is_default_option = $field->is_default_option;
 
-			if ( $get_data && $user_id )
-				$this->data            = $this->get_field_data( $user_id );
+			if ( $get_data && $user_id ) {
+				$this->data          = $this->get_field_data( $user_id );
+			}
+
+			$this->default_visibility = bp_xprofile_get_meta( $id, 'field', 'default_visibility' );
+
+			if ( empty( $this->default_visibility ) ) {
+				$this->default_visibility = 'public';
+			}
+
+			$this->allow_custom_visibility = 'disabled' == bp_xprofile_get_meta( $id, 'field', 'allow_custom_visibility' ) ? 'disabled' : 'allowed';
 		}
 	}
 
-	function delete() {
+	function delete( $delete_data = false ) {
 		global $wpdb, $bp;
 
-		if ( !$this->id ||
-			/* Prevent deletion by url when can_delete is false. */
-			!$this->can_delete ||
-			/* Prevent deletion of option 1 since this invalidates fields with options. */
-			( $this->parent_id && $this->option_order == 1 ) )
+		// Prevent deletion if no ID is present
+		// Prevent deletion by url when can_delete is false.
+		// Prevent deletion of option 1 since this invalidates fields with options.
+		if ( empty( $this->id ) || empty( $this->can_delete ) || ( $this->parent_id && $this->option_order == 1 ) )
 			return false;
 
 		if ( !$wpdb->query( $wpdb->prepare( "DELETE FROM {$bp->profile->table_name_fields} WHERE id = %d OR parent_id = %d", $this->id, $this->id ) ) )
 			return false;
 
-		/* delete the data in the DB for this field */
-		BP_XProfile_ProfileData::delete_for_field( $this->id );
+		// delete the data in the DB for this field
+		if ( true === $delete_data )
+			BP_XProfile_ProfileData::delete_for_field( $this->id );
 
 		return true;
 	}
@@ -395,37 +497,39 @@ Class BP_XProfile_Field {
 	function save() {
 		global $wpdb, $bp;
 
-		$error = false;
-
-		$this->group_id		= apply_filters( 'xprofile_field_group_id_before_save',    $this->group_id,    $this->id );
-		$this->parent_id	= apply_filters( 'xprofile_field_parent_id_before_save',   $this->parent_id,   $this->id );
-		$this->type			= apply_filters( 'xprofile_field_type_before_save',        $this->type,        $this->id );
-		$this->name			= apply_filters( 'xprofile_field_name_before_save',        $this->name,        $this->id );
-		$this->description	= apply_filters( 'xprofile_field_description_before_save', $this->description, $this->id );
-		$this->is_required	= apply_filters( 'xprofile_field_is_required_before_save', $this->is_required, $this->id );
-		$this->order_by		= apply_filters( 'xprofile_field_order_by_before_save',    $this->order_by,    $this->id );
-		$this->field_order	= apply_filters( 'xprofile_field_field_order_before_save', $this->field_order, $this->id );
+		$this->group_id	   = apply_filters( 'xprofile_field_group_id_before_save',    $this->group_id,    $this->id );
+		$this->parent_id   = apply_filters( 'xprofile_field_parent_id_before_save',   $this->parent_id,   $this->id );
+		$this->type	       = apply_filters( 'xprofile_field_type_before_save',        $this->type,        $this->id );
+		$this->name	       = apply_filters( 'xprofile_field_name_before_save',        $this->name,        $this->id );
+		$this->description = apply_filters( 'xprofile_field_description_before_save', $this->description, $this->id );
+		$this->is_required = apply_filters( 'xprofile_field_is_required_before_save', $this->is_required, $this->id );
+		$this->order_by	   = apply_filters( 'xprofile_field_order_by_before_save',    $this->order_by,    $this->id );
+		$this->field_order = apply_filters( 'xprofile_field_field_order_before_save', $this->field_order, $this->id );
 
-		do_action_ref_array( 'xprofile_field_before_save', array( &$this ) );
+		do_action_ref_array( 'xprofile_field_before_save', array( $this ) );
 
-		if ( $this->id != null )
+		if ( $this->id != null ) {
 			$sql = $wpdb->prepare( "UPDATE {$bp->profile->table_name_fields} SET group_id = %d, parent_id = 0, type = %s, name = %s, description = %s, is_required = %d, order_by = %s, field_order = %d WHERE id = %d", $this->group_id, $this->type, $this->name, $this->description, $this->is_required, $this->order_by, $this->field_order, $this->id );
-		else
+		} else {
 			$sql = $wpdb->prepare( "INSERT INTO {$bp->profile->table_name_fields} (group_id, parent_id, type, name, description, is_required, order_by, field_order ) VALUES (%d, %d, %s, %s, %s, %d, %s, %d )", $this->group_id, $this->parent_id, $this->type, $this->name, $this->description, $this->is_required, $this->order_by, $this->field_order );
+		}
 
-		/*
+		/**
 		 * Check for null so field options can be changed without changing any other part of the field.
 		 * The described situation will return 0 here.
 		 */
 		if ( $wpdb->query( $sql ) !== null ) {
-			if ( $this->id )
+
+			if ( !empty( $this->id ) ) {
 				$field_id = $this->id;
-			else
+			} else {
 				$field_id = $wpdb->insert_id;
+			}
 
-			/* Only do this if we are editing an existing field */
+			// Only do this if we are editing an existing field
 			if ( $this->id != null ) {
-				/*
+
+				/**
 				 * Remove any radio or dropdown options for this
 				 * field. They will be re-added if needed.
 				 * This stops orphan options if the user changes a
@@ -434,15 +538,17 @@ Class BP_XProfile_Field {
 				$this->delete_children();
 			}
 
-			/*
+			/**
 			 * Check to see if this is a field with child options.
 			 * We need to add the options to the db, if it is.
 			 */
 			if ( 'radio' == $this->type || 'selectbox' == $this->type || 'checkbox' == $this->type || 'multiselectbox' == $this->type ) {
-				if ( $this->id )
+
+				if ( !empty( $this->id ) ) {
 					$parent_id = $this->id;
-				else
+				} else {
 					$parent_id = $wpdb->insert_id;
+				}
 
 				if ( 'radio' == $this->type ) {
 					$post_option  = !empty( $_POST['radio_option']           ) ? $_POST['radio_option']           : '';
@@ -451,21 +557,21 @@ Class BP_XProfile_Field {
 					$options	= apply_filters( 'xprofile_field_options_before_save', $post_option,  'radio' );
 					$defaults	= apply_filters( 'xprofile_field_default_before_save', $post_default, 'radio' );
 
-				} else if ( 'selectbox' == $this->type ) {
+				} elseif ( 'selectbox' == $this->type ) {
 					$post_option  = !empty( $_POST['selectbox_option']           ) ? $_POST['selectbox_option']           : '';
 					$post_default = !empty( $_POST['isDefault_selectbox_option'] ) ? $_POST['isDefault_selectbox_option'] : '';
 
 					$options	= apply_filters( 'xprofile_field_options_before_save', $post_option, 'selectbox' );
 					$defaults	= apply_filters( 'xprofile_field_default_before_save', $post_default, 'selectbox' );
 
-				} else if ( 'multiselectbox' == $this->type ) {
+				} elseif ( 'multiselectbox' == $this->type ) {
 					$post_option  = !empty( $_POST['multiselectbox_option']           ) ? $_POST['multiselectbox_option']           : '';
 					$post_default = !empty( $_POST['isDefault_multiselectbox_option'] ) ? $_POST['isDefault_multiselectbox_option'] : '';
 
 					$options	= apply_filters( 'xprofile_field_options_before_save', $post_option, 'multiselectbox' );
 					$defaults	= apply_filters( 'xprofile_field_default_before_save', $post_default, 'multiselectbox' );
 
-				} else if ( 'checkbox' == $this->type ) {
+				} elseif ( 'checkbox' == $this->type ) {
 					$post_option  = !empty( $_POST['checkbox_option']           ) ? $_POST['checkbox_option']           : '';
 					$post_default = !empty( $_POST['isDefault_checkbox_option'] ) ? $_POST['isDefault_checkbox_option'] : '';
 
@@ -474,8 +580,8 @@ Class BP_XProfile_Field {
 				}
 
 				$counter = 1;
-				if ( $options ) {
-					foreach ( (array)$options as $option_key => $option_value ) {
+				if ( !empty( $options ) ) {
+					foreach ( (array) $options as $option_key => $option_value ) {
 						$is_default = 0;
 
 						if ( is_array( $defaults ) ) {
@@ -487,8 +593,9 @@ Class BP_XProfile_Field {
 						}
 
 						if ( '' != $option_value ) {
-							if ( !$wpdb->query( $wpdb->prepare( "INSERT INTO {$bp->profile->table_name_fields} (group_id, parent_id, type, name, description, is_required, option_order, is_default_option) VALUES (%d, %d, 'option', %s, '', 0, %d, %d)", $this->group_id, $parent_id, $option_value, $counter, $is_default ) ) )
+							if ( !$wpdb->query( $wpdb->prepare( "INSERT INTO {$bp->profile->table_name_fields} (group_id, parent_id, type, name, description, is_required, option_order, is_default_option) VALUES (%d, %d, 'option', %s, '', 0, %d, %d)", $this->group_id, $parent_id, $option_value, $counter, $is_default ) ) ) {
 								return false;
+							}
 						}
 
 						$counter++;
@@ -496,7 +603,7 @@ Class BP_XProfile_Field {
 				}
 			}
 
-			do_action_ref_array( 'xprofile_field_after_save', array( &$this ) );
+			do_action_ref_array( 'xprofile_field_after_save', array( $this ) );
 
 			return $field_id;
 		} else {
@@ -512,18 +619,20 @@ Class BP_XProfile_Field {
 		global $wpdb, $bp;
 
 		// This is done here so we don't have problems with sql injection
-		if ( 'asc' == $this->order_by && !$for_editing )
+		if ( 'asc' == $this->order_by && empty( $for_editing ) ) {
 			$sort_sql = 'ORDER BY name ASC';
-		else if ( 'desc' == $this->order_by && !$for_editing )
+		} elseif ( 'desc' == $this->order_by && empty( $for_editing ) ) {
 			$sort_sql = 'ORDER BY name DESC';
-		else
+		} else {
 			$sort_sql = 'ORDER BY option_order ASC';
+		}
 
 		// This eliminates a problem with getting all fields when there is no id for the object
-		if ( !$this->id )
+		if ( empty( $this->id ) ) {
 			$parent_id = -1;
-		else
+		} else {
 			$parent_id = $this->id;
+		}
 
 		$sql = $wpdb->prepare( "SELECT * FROM {$bp->profile->table_name_fields} WHERE parent_id = %d AND group_id = %d $sort_sql", $parent_id, $this->group_id );
 
@@ -546,11 +655,12 @@ Class BP_XProfile_Field {
 	function get_type( $field_id ) {
 		global $wpdb, $bp;
 
-		if ( $field_id ) {
+		if ( !empty( $field_id ) ) {
 			$sql = $wpdb->prepare( "SELECT type FROM {$bp->profile->table_name_fields} WHERE id = %d", $field_id );
 
-			if ( !$field_type = $wpdb->get_var( $sql ) )
+			if ( !$field_type = $wpdb->get_var( $sql ) ) {
 				return false;
+			}
 
 			return $field_type;
 		}
@@ -561,11 +671,12 @@ Class BP_XProfile_Field {
 	function delete_for_group( $group_id ) {
 		global $wpdb, $bp;
 
-		if ( $group_id ) {
+		if ( !empty( $group_id ) ) {
 			$sql = $wpdb->prepare( "DELETE FROM {$bp->profile->table_name_fields} WHERE group_id = %d", $group_id );
 
-			if ( $wpdb->get_var( $sql ) === false )
+			if ( $wpdb->get_var( $sql ) === false ) {
 				return false;
+			}
 
 			return true;
 		}
@@ -588,9 +699,10 @@ Class BP_XProfile_Field {
 		if ( !is_numeric( $position ) || !is_numeric( $field_group_id ) )
 			return false;
 
-		/* Update $field_id with new $position and $field_group_id */
+		// Update $field_id with new $position and $field_group_id
 		if ( $parent = $wpdb->query( $wpdb->prepare( "UPDATE {$bp->profile->table_name_fields} SET field_order = %d, group_id = %d WHERE id = %d", $position, $field_group_id, $field_id ) ) ) {;
-			/* Update any children of this $field_id */
+
+			// Update any children of this $field_id
 			$children = $wpdb->query( $wpdb->prepare( "UPDATE {$bp->profile->table_name_fields} SET group_id = %d WHERE parent_id = %d", $field_group_id, $field_id ) );
 
 			return $parent;
@@ -607,15 +719,24 @@ Class BP_XProfile_Field {
 	function render_admin_form_children() {
 		$input_types = array( 'checkbox', 'selectbox', 'multiselectbox', 'radio' );
 
-		foreach ($input_types as $type) {
+		foreach ( $input_types as $type ) {
 			$default_name = '';
 
-			if ( 'multiselectbox' == $type || 'checkbox' == $type )
+			if ( ( 'multiselectbox' == $type ) || ( 'checkbox' == $type ) ) {
 				$default_input = 'checkbox';
-			else
+			} else {
 				$default_input = 'radio';
-?>
-			<div id="<?php echo $type; ?>" class="options-box" style="<?php if ( $this->type != $type ) { ?>display: none;<?php } ?> margin-left: 15px;">
+			}
+
+			$class = $this->type != $type ? 'display: none;' : '';
+
+			if ( empty( $this->default_visibility ) ) {
+				$this->default_visibility = 'public';
+			}
+
+			?>
+
+			<div id="<?php echo $type; ?>" class="options-box" style="<?php echo $class; ?> margin-left: 15px;">
 				<h4><?php _e( 'Please enter options for this Field:', 'buddypress' ); ?></h4>
 				<p><label for="sort_order_<?php echo $type; ?>"><?php _e( 'Order By:', 'buddypress' ); ?></label>
 					<select name="sort_order_<?php echo $type; ?>" id="sort_order_<?php echo $type; ?>" >
@@ -623,18 +744,15 @@ Class BP_XProfile_Field {
 						<option value="asc" <?php if ( 'asc' == $this->order_by ) {?> selected="selected"<?php } ?>><?php _e( 'Name - Ascending', 'buddypress' ); ?></option>
 						<option value="desc" <?php if ( 'desc' == $this->order_by ) {?> selected="selected"<?php } ?>><?php _e( 'Name - Descending', 'buddypress' ); ?></option>
 					</select>
-<?php
-				if ( !$options = $this->get_children( true ) ) {
+
+				<?php if ( !$options = $this->get_children( true ) ) {
+
 					$i = 1;
 					while ( isset( $_POST[$type . '_option'][$i] ) ) {
 						(array) $options[] = (object) array(
-							'id' => -1,
-							'name' => $_POST[$type . '_option'][$i],
-							'is_default_option' => ( 'multiselectbox' != $type &&
-								'checkbox' != $type &&
-								$_POST["isDefault_{$type}_option"] == $i ) ?
-									1 :
-									$_POST["isDefault_{$type}_option"][$i]
+							'id'                => -1,
+							'name'              => $_POST[$type . '_option'][$i],
+							'is_default_option' => ( ( 'multiselectbox' != $type ) && ( 'checkbox' != $type ) && ( $_POST["isDefault_{$type}_option"] == $i ) ) ? 1 : $_POST["isDefault_{$type}_option"][$i]
 						);
 
 						++$i;
@@ -646,30 +764,34 @@ Class BP_XProfile_Field {
 						$j = $i + 1;
 
 						if ( 'multiselectbox' == $type || 'checkbox' == $type )
-							$default_name = '[' . $j . ']';
-?>
-						<p><?php _e('Option', 'buddypress'); ?> <?php echo $j; ?>:
+							$default_name = '[' . $j . ']'; ?>
+
+						<p><?php _e( 'Option', 'buddypress' ); ?> <?php echo $j; ?>:
 						   <input type="text" name="<?php echo $type; ?>_option[<?php echo $j; ?>]" id="<?php echo $type; ?>_option<?php echo $j; ?>" value="<?php echo stripslashes( esc_attr( $options[$i]->name ) ); ?>" />
 						   <input type="<?php echo $default_input; ?>" name="isDefault_<?php echo $type; ?>_option<?php echo $default_name; ?>" <?php if ( (int) $options[$i]->is_default_option ) {?> checked="checked"<?php } ?> " value="<?php echo $j; ?>" /> <?php _e( 'Default Value', 'buddypress' ); ?>
-<?php
-					if ( $j != 1 && $options[$i]->id != -1 ) : ?>
-							<a href="admin.php?page=bp-profile-setup&amp;mode=delete_option&amp;option_id=<?php echo $options[$i]->id ?>" class="ajax-option-delete" id="delete-<?php echo $options[$i]->id; ?>">[x]</a>
-<?php				endif; ?>
+
+							<?php if ( $j != 1 && $options[$i]->id != -1 ) : ?>
+
+								<a href="admin.php?page=bp-profile-setup&amp;mode=delete_option&amp;option_id=<?php echo $options[$i]->id ?>" class="ajax-option-delete" id="delete-<?php echo $options[$i]->id; ?>">[x]</a>
+
+							<?php endif; ?>
+
 						</p>
-<?php				} /* end for */ ?>
+
+					<?php } /* end for */ ?>
 
 					<input type="hidden" name="<?php echo $type; ?>_option_number" id="<?php echo $type; ?>_option_number" value="<?php echo $j + 1; ?>" />
-<?php
-				} else {
+
+				<?php } else {
+
 					if ( 'multiselectbox' == $type || 'checkbox' == $type )
-						$default_name = '[1]';
-?>
+						$default_name = '[1]'; ?>
 
 					<p><?php _e( 'Option', 'buddypress' ); ?> 1: <input type="text" name="<?php echo $type; ?>_option[1]" id="<?php echo $type; ?>_option1" />
 					<input type="<?php echo $default_input; ?>" name="isDefault_<?php echo $type; ?>_option<?php echo $default_name; ?>" id="isDefault_<?php echo $type; ?>_option" value="1" /> <?php _e( 'Default Value', 'buddypress' ); ?>
 					<input type="hidden" name="<?php echo $type; ?>_option_number" id="<?php echo $type; ?>_option_number" value="2" />
 
-<?php			} /* end if */ ?>
+				<?php } /* end if */ ?>
 
 				<div id="<?php echo $type; ?>_more"></div>
 				<p><a href="javascript:add_option('<?php echo $type; ?>')"><?php _e('Add Another Option', 'buddypress'); ?></a></p>
@@ -679,94 +801,124 @@ Class BP_XProfile_Field {
 	}
 
 	function render_admin_form( $message = '' ) {
-		if ( !$this->id ) {
+		if ( empty( $this->id ) ) {
 			$title				= __( 'Add Field', 'buddypress' );
 			$action				= "admin.php?page=bp-profile-setup&amp;group_id=" . $this->group_id . "&amp;mode=add_field#tabs-" . $this->group_id;
 
 			if ( !empty( $_POST['saveField'] ) ) {
-				$this->name		= $_POST['title'];
-				$this->description	= $_POST['description'];
-				$this->is_required	= $_POST['required'];
-				$this->type		= $_POST['fieldtype'];
-				$this->order_by		= $_POST["sort_order_{$this->type}"];
-				$this->field_order	= $_POST['field_order'];
+				$this->name  	   = $_POST['title'];
+				$this->description = $_POST['description'];
+				$this->is_required = $_POST['required'];
+				$this->type        = $_POST['fieldtype'];
+				$this->order_by    = $_POST["sort_order_{$this->type}"];
+				$this->field_order = $_POST['field_order'];
 			}
 		} else {
-			$title				= __( 'Edit Field', 'buddypress' );
-			$action				= "admin.php?page=bp-profile-setup&amp;mode=edit_field&amp;group_id=" . $this->group_id . "&amp;field_id=" . $this->id . "#tabs-" . $this->group_id;
-		}
-?>
-	<div class="wrap">
-		<div id="icon-users" class="icon32"><br /></div>
-		<h2><?php echo $title; ?></h2>
-		<p><?php _e( 'Fields marked * are required', 'buddypress' ) ?></p>
+			$title  = __( 'Edit Field', 'buddypress' );
+			$action = "admin.php?page=bp-profile-setup&amp;mode=edit_field&amp;group_id=" . $this->group_id . "&amp;field_id=" . $this->id . "#tabs-" . $this->group_id;
+		} ?>
 
-<?php
-		if ( $message != '' ) {
-?>
-			<div id="message" class="error fade">
-				<p><?php echo $message; ?></p>
-			</div>
-<?php	} ?>
+		<div class="wrap">
+			<div id="icon-users" class="icon32"><br /></div>
+			<h2><?php echo $title; ?></h2>
+			<p><?php _e( 'Fields marked * are required', 'buddypress' ) ?></p>
 
-		<form action="<?php echo $action; ?>" method="post">
-			<div id="poststuff">
-				<div id="titlediv">
-					<h3><label for="title"><?php _e( 'Field Title', 'buddypress' ); ?> *</label></h3>
-					<div id="titlewrap">
-						<input type="text" name="title" id="title" value="<?php echo esc_attr( $this->name ); ?>" style="width:50%" />
-					</div>
+			<?php if ( !empty( $message ) ) : ?>
+
+				<div id="message" class="error fade">
+					<p><?php echo $message; ?></p>
 				</div>
-<?php
-		if ( '0' != $this->can_delete ) {
-?>
-				<div id="titlediv">
-					<h3><label for="description"><?php _e("Field Description", 'buddypress'); ?></label></h3>
-					<div id="titlewrap">
-						<textarea name="description" id="description" rows="8" cols="60"><?php echo htmlspecialchars( $this->description ); ?></textarea>
+
+			<?php endif; ?>
+
+			<form action="<?php echo $action; ?>" method="post">
+				<div id="poststuff">
+					<div id="titlediv">
+						<h3><label for="title"><?php _e( 'Field Title', 'buddypress' ); ?> *</label></h3>
+						<div id="titlewrap">
+							<input type="text" name="title" id="title" value="<?php echo esc_attr( $this->name ); ?>" style="width:50%" />
+						</div>
 					</div>
-				</div>
 
-				<div id="titlediv">
-					<h3><label for="required"><?php _e( "Is This Field Required?", 'buddypress' ); ?> *</label></h3>
-					<select name="required" id="required" style="width: 30%">
-						<option value="0"<?php if ( $this->is_required == '0' ) { ?> selected="selected"<?php } ?>><?php _e( 'Not Required', 'buddypress' ); ?></option>
-						<option value="1"<?php if ( $this->is_required == '1' ) { ?> selected="selected"<?php } ?>><?php _e( 'Required', 'buddypress' ); ?></option>
-					</select>
-				</div>
+					<div id="titlediv">
+						<h3><label for="description"><?php _e("Field Description", 'buddypress'); ?></label></h3>
+						<div id="titlewrap">
+							<textarea name="description" id="description" rows="8" cols="60"><?php echo htmlspecialchars( $this->description ); ?></textarea>
+						</div>
+					</div>
 
-				<div id="titlediv">
-					<h3><label for="fieldtype"><?php _e("Field Type", 'buddypress'); ?> *</label></h3>
-					<select name="fieldtype" id="fieldtype" onchange="show_options(this.value)" style="width: 30%">
-						<option value="textbox"<?php if ( $this->type == 'textbox' ) {?> selected="selected"<?php } ?>><?php _e( 'Text Box', 'buddypress' ); ?></option>
-						<option value="textarea"<?php if ( $this->type == 'textarea' ) {?> selected="selected"<?php } ?>><?php _e( 'Multi-line Text Box', 'buddypress' ); ?></option>
-						<option value="datebox"<?php if ( $this->type == 'datebox' ) {?> selected="selected"<?php } ?>><?php _e( 'Date Selector', 'buddypress' ); ?></option>
-						<option value="radio"<?php if ( $this->type == 'radio' ) {?> selected="selected"<?php } ?>><?php _e( 'Radio Buttons', 'buddypress' ); ?></option>
-						<option value="selectbox"<?php if ( $this->type == 'selectbox' ) {?> selected="selected"<?php } ?>><?php _e( 'Drop Down Select Box', 'buddypress' ); ?></option>
-						<option value="multiselectbox"<?php if ( $this->type == 'multiselectbox' ) {?> selected="selected"<?php } ?>><?php _e( 'Multi Select Box', 'buddypress' ); ?></option>
-						<option value="checkbox"<?php if ( $this->type == 'checkbox' ) {?> selected="selected"<?php } ?>><?php _e( 'Checkboxes', 'buddypress' ); ?></option>
-					</select>
-				</div>
+					<?php if ( '0' != $this->can_delete ) { ?>
 
-				<?php do_action( 'xprofile_field_additional_options', $this ) ?>
+						<div id="titlediv">
+							<h3><label for="required"><?php _e( "Is This Field Required?", 'buddypress' ); ?> *</label></h3>
+							<select name="required" id="required" style="width: 30%">
+								<option value="0"<?php if ( $this->is_required == '0' ) { ?> selected="selected"<?php } ?>><?php _e( 'Not Required', 'buddypress' ); ?></option>
+								<option value="1"<?php if ( $this->is_required == '1' ) { ?> selected="selected"<?php } ?>><?php _e( 'Required', 'buddypress' ); ?></option>
+							</select>
+						</div>
 
-				<?php $this->render_admin_form_children(); ?>
-<?php	} else { ?>
-				<input type="hidden" name="required" id="required" value="1" />
-				<input type="hidden" name="fieldtype" id="fieldtype" value="textbox" />
-<?php	} ?>
-				<p class="submit">
-					<input type="hidden" name="field_order" id="field_order" value="<?php echo esc_attr( $this->field_order ); ?>" />
-					<input type="submit" value="<?php _e( 'Save', 'buddypress' ); ?>" name="saveField" id="saveField" style="font-weight: bold" class="button-primary" />
-					<?php _e( 'or', 'buddypress' ); ?> <a href="admin.php?page=bp-profile-setup" class="deletion"><?php _e( 'Cancel', 'buddypress' ); ?></a>
-				</p>
+						<div id="titlediv">
+							<h3><label for="fieldtype"><?php _e("Field Type", 'buddypress'); ?> *</label></h3>
+							<select name="fieldtype" id="fieldtype" onchange="show_options(this.value)" style="width: 30%">
+								<option value="textbox"<?php if ( $this->type == 'textbox' ) {?> selected="selected"<?php } ?>><?php _e( 'Text Box', 'buddypress' ); ?></option>
+								<option value="textarea"<?php if ( $this->type == 'textarea' ) {?> selected="selected"<?php } ?>><?php _e( 'Multi-line Text Box', 'buddypress' ); ?></option>
+								<option value="datebox"<?php if ( $this->type == 'datebox' ) {?> selected="selected"<?php } ?>><?php _e( 'Date Selector', 'buddypress' ); ?></option>
+								<option value="radio"<?php if ( $this->type == 'radio' ) {?> selected="selected"<?php } ?>><?php _e( 'Radio Buttons', 'buddypress' ); ?></option>
+								<option value="selectbox"<?php if ( $this->type == 'selectbox' ) {?> selected="selected"<?php } ?>><?php _e( 'Drop Down Select Box', 'buddypress' ); ?></option>
+								<option value="multiselectbox"<?php if ( $this->type == 'multiselectbox' ) {?> selected="selected"<?php } ?>><?php _e( 'Multi Select Box', 'buddypress' ); ?></option>
+								<option value="checkbox"<?php if ( $this->type == 'checkbox' ) {?> selected="selected"<?php } ?>><?php _e( 'Checkboxes', 'buddypress' ); ?></option>
+							</select>
+						</div>
 
-			</div>
+						<?php do_action_ref_array( 'xprofile_field_additional_options', array( $this ) ); ?>
 
-			<?php wp_nonce_field( 'xprofile_delete_option' ); ?>
+						<?php $this->render_admin_form_children(); ?>
 
-		</form>
-	</div>
+					<?php } else { ?>
+
+						<input type="hidden" name="required" id="required" value="1" />
+						<input type="hidden" name="fieldtype" id="fieldtype" value="textbox" />
+
+					<?php } ?>
+
+					<?php /* The fullname field cannot be hidden */ ?>
+					<?php if ( 1 != $this->id ) : ?>
+
+						<div id="titlediv">
+
+							<div id="titlewrap">
+								<h3><label for="default-visibility"><?php _e( "Default Visibility", 'buddypress' ); ?></label></h3>
+								<ul>
+								<?php foreach( bp_xprofile_get_visibility_levels() as $level ) : ?>
+									<li><input type="radio" name="default-visibility" value="<?php echo esc_attr( $level['id'] ) ?>" <?php checked( $this->default_visibility, $level['id'] ) ?>> <?php echo esc_html( $level['label'] ) ?></li>
+								<?php endforeach ?>
+								</ul>
+							</div>
+
+							<div id="titlewrap">
+								<h3><label for="allow-custom-visibility"><?php _e( "Per-Member Visibility", 'buddypress' ); ?></label></h3>
+								<ul>
+									<li><input type="radio" name="allow-custom-visibility" value="allowed" <?php checked( $this->allow_custom_visibility, 'allowed' ) ?>> <?php _e( "Let members change the this field's visibility", 'buddypress' ) ?></li>
+
+									<li><input type="radio" name="allow-custom-visibility" value="disabled" <?php checked( $this->allow_custom_visibility, 'disabled' ) ?>> <?php _e( 'Enforce the default visibility for all members', 'buddypress' ) ?></li>
+								</ul>
+							</div>
+						</div>
+
+					<?php endif ?>
+
+					<p class="submit">
+						<input type="hidden" name="field_order" id="field_order" value="<?php echo esc_attr( $this->field_order ); ?>" />
+						<input type="submit" value="<?php _e( 'Save', 'buddypress' ); ?>" name="saveField" id="saveField" style="font-weight: bold" class="button-primary" />
+						<?php _e( 'or', 'buddypress' ); ?> <a href="admin.php?page=bp-profile-setup" class="deletion"><?php _e( 'Cancel', 'buddypress' ); ?></a>
+					</p>
+
+				</div>
+
+				<?php wp_nonce_field( 'xprofile_delete_option' ); ?>
+
+			</form>
+		</div>
 
 <?php
 	}
@@ -774,7 +926,7 @@ Class BP_XProfile_Field {
 	function admin_validate() {
 		global $message;
 
-		/* Validate Form */
+		// Validate Form
 		if ( '' == $_POST['title'] || '' == $_POST['required'] || '' == $_POST['fieldtype'] ) {
 			$message = __( 'Please make sure you fill out all required fields.', 'buddypress' );
 			return false;
@@ -797,19 +949,15 @@ Class BP_XProfile_Field {
 }
 
 
-Class BP_XProfile_ProfileData {
+class BP_XProfile_ProfileData {
 	var $id;
 	var $user_id;
 	var $field_id;
 	var $value;
 	var $last_updated;
 
-	function bp_xprofile_profiledata( $field_id = null, $user_id = null ) {
-		$this->__construct( $field_id, $user_id );
-	}
-
 	function __construct( $field_id = null, $user_id = null ) {
-		if ( $field_id )
+		if ( !empty( $field_id ) )
 			$this->populate( $field_id, $user_id );
 	}
 
@@ -845,7 +993,7 @@ Class BP_XProfile_ProfileData {
 
 		$retval = $wpdb->get_row( $wpdb->prepare( "SELECT id FROM {$bp->profile->table_name_data} WHERE user_id = %d AND field_id = %d", $this->user_id, $this->field_id ) );
 
-		return apply_filters_ref_array( 'xprofile_data_exists', array( (bool)$retval, &$this ) );
+		return apply_filters_ref_array( 'xprofile_data_exists', array( (bool)$retval, $this ) );
 	}
 
 	/**
@@ -862,7 +1010,7 @@ Class BP_XProfile_ProfileData {
 
 		$retval = $wpdb->get_row( $wpdb->prepare( "SELECT id FROM {$bp->profile->table_name_fields} WHERE id = %d", $this->field_id ) );
 
-		return apply_filters_ref_array( 'xprofile_data_is_valid_field', array( (bool)$retval, &$this ) );
+		return apply_filters_ref_array( 'xprofile_data_is_valid_field', array( (bool)$retval, $this ) );
 	}
 
 	function save() {
@@ -873,7 +1021,7 @@ Class BP_XProfile_ProfileData {
 		$this->value        = apply_filters( 'xprofile_data_value_before_save',        $this->value,           $this->id );
 		$this->last_updated = apply_filters( 'xprofile_data_last_updated_before_save', bp_core_current_time(), $this->id );
 
-		do_action_ref_array( 'xprofile_data_before_save', array( &$this ) );
+		do_action_ref_array( 'xprofile_data_before_save', array( $this ) );
 
 		if ( $this->is_valid_field() ) {
 			if ( $this->exists() && !empty( $this->value ) && strlen( trim( $this->value ) ) ) {
@@ -888,10 +1036,10 @@ Class BP_XProfile_ProfileData {
 				$this->id = $wpdb->insert_id;
 			}
 
-			if ( !$result )
+			if ( false === $result )
 				return false;
 
-			do_action_ref_array( 'xprofile_data_after_save', array( &$this ) );
+			do_action_ref_array( 'xprofile_data_after_save', array( $this ) );
 
 			return true;
 		}
@@ -921,7 +1069,7 @@ Class BP_XProfile_ProfileData {
 		$results      = $wpdb->get_results( $wpdb->prepare( "SELECT g.id as field_group_id, g.name as field_group_name, f.id as field_id, f.name as field_name, f.type as field_type, d.value as field_data, u.user_login, u.user_nicename, u.user_email FROM {$bp->profile->table_name_groups} g LEFT JOIN {$bp->profile->table_name_fields} f ON g.id = f.group_id INNER JOIN {$bp->profile->table_name_data} d ON f.id = d.field_id LEFT JOIN {$wpdb->users} u ON d.user_id = u.ID WHERE d.user_id = %d AND d.value != ''", $user_id ) );
 		$profile_data = array();
 
-		if ( $results ) {
+		if ( !empty( $results ) ) {
 			$profile_data['user_login']		= $results[0]->user_login;
 			$profile_data['user_nicename']	= $results[0]->user_nicename;
 			$profile_data['user_email']		= $results[0]->user_email;
@@ -940,11 +1088,30 @@ Class BP_XProfile_ProfileData {
 		return $profile_data;
 	}
 
+	/**
+	 * Get the user's field data id by the id of the xprofile field
+	 *
+	 * @param int $field_id
+	 * @param int $user_id
+	 * @return int $fielddata_id
+	 */
+	function get_fielddataid_byid( $field_id, $user_id ) {
+		global $wpdb, $bp;
+
+		if ( empty( $field_id ) || empty( $user_id ) ) {
+			$fielddata_id = 0;
+		} else {
+			$fielddata_id = $wpdb->get_var( $wpdb->prepare( "SELECT id FROM {$bp->profile->table_name_data} WHERE field_id = %d AND user_id = %d", $field_id, $user_id ) );
+		}
+
+		return $fielddata_id;
+	}
+
 	function get_value_byid( $field_id, $user_ids = null ) {
 		global $wpdb, $bp;
 
-		if ( !$user_ids )
-			$user_ids = $bp->displayed_user->id;
+		if ( empty( $user_ids ) )
+			$user_ids = bp_displayed_user_id();
 
 		if ( is_array( $user_ids ) ) {
 			$user_ids = implode( ',', (array) $user_ids );
@@ -959,11 +1126,11 @@ Class BP_XProfile_ProfileData {
 	function get_value_byfieldname( $fields, $user_id = null ) {
 		global $bp, $wpdb;
 
-		if ( !$fields )
+		if ( empty( $fields ) )
 			return false;
 
-		if ( !$user_id )
-			$user_id = $bp->displayed_user->id;
+		if ( empty( $user_id ) )
+			$user_id = bp_displayed_user_id();
 
 		$field_sql = '';
 
@@ -1004,7 +1171,7 @@ Class BP_XProfile_ProfileData {
 	}
 
 	function delete_for_field( $field_id ) {
-		global $wpdb, $userdata, $bp;
+		global $wpdb, $bp;
 
 		if ( !$wpdb->query( $wpdb->prepare( "DELETE FROM {$bp->profile->table_name_data} WHERE field_id = %d", $field_id ) ) )
 			return false;
@@ -1029,17 +1196,16 @@ Class BP_XProfile_ProfileData {
 	function get_random( $user_id, $exclude_fullname ) {
 		global $wpdb, $bp;
 
-		if ( $exclude_fullname )
-			$exclude_sql = $wpdb->prepare( " AND pf.id != 1" );
+		if ( !empty( $exclude_fullname ) )
+			$exclude_sql = " AND pf.id != 1";
 
 		return $wpdb->get_results( $wpdb->prepare( "SELECT pf.type, pf.name, pd.value FROM {$bp->profile->table_name_data} pd INNER JOIN {$bp->profile->table_name_fields} pf ON pd.field_id = pf.id AND pd.user_id = %d {$exclude_sql} ORDER BY RAND() LIMIT 1", $user_id ) );
 	}
 
 	function get_fullname( $user_id = 0 ) {
-		global $bp;
 
-		if ( !$user_id )
-			$user_id = $bp->displayed_user->id;
+		if ( empty( $user_id ) )
+			$user_id = bp_displayed_user_id();
 
 		$field_name = bp_xprofile_fullname_field_name();
 
@@ -1049,4 +1215,4 @@ Class BP_XProfile_ProfileData {
 	}
 }
 
-?>
\ No newline at end of file
+?>
diff --git a/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-cssjs.php b/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-cssjs.php
index 4d401a7ee386298a2a8fb900cfe3ea0ddb51843d..3e687ff39f31232dc4700f5ada7ab64944e31806 100644
--- a/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-cssjs.php
+++ b/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-cssjs.php
@@ -1,31 +1,52 @@
 <?php
+
+/**
+ * BuddyPress XProfile CSS and JS
+ *
+ * @package BuddyPress
+ * @subpackage XProfileScripts
+ */
+
 // Exit if accessed directly
 if ( !defined( 'ABSPATH' ) ) exit;
 
+/**
+ * Enqueue the CSS for XProfile admin styling
+ *
+ * @since BuddyPress (1.1)
+ */
 function xprofile_add_admin_css() {
 	if ( !empty( $_GET['page'] ) && strpos( $_GET['page'], 'bp-profile-setup' ) !== false ) {
-		if ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG )
-			wp_enqueue_style( 'xprofile-admin-css', BP_PLUGIN_URL . '/bp-xprofile/admin/css/admin.dev.css', array(), '20110723' );
-		else
-			wp_enqueue_style( 'xprofile-admin-css', BP_PLUGIN_URL . '/bp-xprofile/admin/css/admin.css', array(), '20110723' );
+		if ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) {
+			wp_enqueue_style( 'xprofile-admin-css', BP_PLUGIN_URL . 'bp-xprofile/admin/css/admin.dev.css', array(), bp_get_version() );
+		} else {
+			wp_enqueue_style( 'xprofile-admin-css', BP_PLUGIN_URL . 'bp-xprofile/admin/css/admin.css',     array(), bp_get_version() );
+		}
 	}
 }
-add_action( bp_core_admin_hook(), 'xprofile_add_admin_css' );
+add_action( 'admin_enqueue_scripts', 'xprofile_add_admin_css' );
 
+/**
+ * Enqueue the jQuery libraries for handling drag/drop/sort
+ *
+ * @since BuddyPres (1.5)
+ */
 function xprofile_add_admin_js() {
 	if ( !empty( $_GET['page'] ) && strpos( $_GET['page'], 'bp-profile-setup' ) !== false ) {
-		wp_enqueue_script( 'jquery-ui-core' );
-		wp_enqueue_script( 'jquery-ui-tabs' );
-		wp_enqueue_script( 'jquery-ui-mouse' );
+		wp_enqueue_script( 'jquery-ui-core'      );
+		wp_enqueue_script( 'jquery-ui-tabs'      );
+		wp_enqueue_script( 'jquery-ui-mouse'     );
 		wp_enqueue_script( 'jquery-ui-draggable' );
 		wp_enqueue_script( 'jquery-ui-droppable' );
-		wp_enqueue_script( 'jquery-ui-sortable' );
+		wp_enqueue_script( 'jquery-ui-sortable'  );
 
-		if ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG )
-			wp_enqueue_script( 'xprofile-admin-js', BP_PLUGIN_URL . '/bp-xprofile/admin/js/admin.dev.js', array( 'jquery', 'jquery-ui-sortable' ), '20110723' );
-		else
-			wp_enqueue_script( 'xprofile-admin-js', BP_PLUGIN_URL . '/bp-xprofile/admin/js/admin.js', array( 'jquery', 'jquery-ui-sortable' ), '20110723' );
+		if ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) {
+			wp_enqueue_script( 'xprofile-admin-js', BP_PLUGIN_URL . 'bp-xprofile/admin/js/admin.dev.js', array( 'jquery', 'jquery-ui-sortable' ), bp_get_version() );
+		} else {
+			wp_enqueue_script( 'xprofile-admin-js', BP_PLUGIN_URL . 'bp-xprofile/admin/js/admin.js',     array( 'jquery', 'jquery-ui-sortable' ), bp_get_version() );
+		}
 	}
 }
-add_action( bp_core_admin_hook(), 'xprofile_add_admin_js', 1 );
-?>
\ No newline at end of file
+add_action( 'admin_enqueue_scripts', 'xprofile_add_admin_js', 1 );
+
+?>
diff --git a/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-filters.php b/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-filters.php
index e7e4ed525af94f2eae2bc799728e05c391ef9886..fe8bd707bc7ca5c2e1163308fb626fdcc98b6260 100644
--- a/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-filters.php
+++ b/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-filters.php
@@ -1,50 +1,57 @@
 <?php
-// Exit if accessed directly
-if ( !defined( 'ABSPATH' ) ) exit;
-
-/* Apply WordPress defined filters */
-
-add_filter( 'bp_get_the_profile_group_name',          'wp_filter_kses',       1 );
-add_filter( 'bp_get_the_profile_group_description',   'wp_filter_kses',       1 );
-add_filter( 'bp_get_the_profile_field_value',         'xprofile_filter_kses', 1 );
-add_filter( 'bp_get_the_profile_field_name',          'wp_filter_kses',       1 );
-add_filter( 'bp_get_the_profile_field_edit_value',    'wp_filter_kses',       1 );
-add_filter( 'bp_get_the_profile_field_description',   'wp_filter_kses',       1 );
-
-add_filter( 'bp_get_the_profile_field_value',         'wptexturize'        );
-add_filter( 'bp_get_the_profile_field_value',         'convert_smilies', 2 );
-add_filter( 'bp_get_the_profile_field_value',         'convert_chars'      );
-add_filter( 'bp_get_the_profile_field_value',         'wpautop'            );
-add_filter( 'bp_get_the_profile_field_value',         'make_clickable', 8  );
-add_filter( 'bp_get_the_profile_field_value',         'force_balance_tags' );
-
-add_filter( 'bp_get_the_profile_field_edit_value',    'force_balance_tags' );
-add_filter( 'bp_get_the_profile_field_edit_value',    'esc_html'           );
 
-add_filter( 'bp_get_the_profile_group_name',          'stripslashes' );
-add_filter( 'bp_get_the_profile_group_description',   'stripslashes' );
-add_filter( 'bp_get_the_profile_field_value',         'stripslashes' );
-add_filter( 'bp_get_the_profile_field_edit_value',    'stripslashes' );
-add_filter( 'bp_get_the_profile_field_name',          'stripslashes' );
-add_filter( 'bp_get_the_profile_field_description',   'stripslashes' );
-
-add_filter( 'xprofile_get_field_data',                'wp_filter_kses', 1 );
-add_filter( 'xprofile_field_name_before_save',        'wp_filter_kses', 1 );
-add_filter( 'xprofile_field_description_before_save', 'wp_filter_kses', 1 );
-
-add_filter( 'xprofile_get_field_data',                'force_balance_tags' );
-add_filter( 'xprofile_field_name_before_save',        'force_balance_tags' );
-add_filter( 'xprofile_field_description_before_save', 'force_balance_tags' );
-
-add_filter( 'xprofile_get_field_data',                'stripslashes' );
-
-/* Custom BuddyPress filters */
+/**
+ * BuddyPress XProfile Filters
+ *
+ * Apply WordPress defined filters
+ *
+ * @package BuddyPress
+ * @subpackage XProfileFilters
+ */
 
-add_filter( 'bp_get_the_profile_field_value',         'xprofile_filter_format_field_value', 1, 2 );
-add_filter( 'bp_get_the_site_member_profile_data',    'xprofile_filter_format_field_value', 1, 2 );
-add_filter( 'bp_get_the_profile_field_value',         'xprofile_filter_link_profile_data', 9, 2 );
+// Exit if accessed directly
+if ( !defined( 'ABSPATH' ) ) exit;
 
-add_filter( 'xprofile_data_value_before_save',        'xprofile_sanitize_data_value_before_save', 1, 2 );
+add_filter( 'bp_get_the_profile_group_name',            'wp_filter_kses',       1 );
+add_filter( 'bp_get_the_profile_group_description',     'wp_filter_kses',       1 );
+add_filter( 'bp_get_the_profile_field_value',           'xprofile_filter_kses', 1 );
+add_filter( 'bp_get_the_profile_field_name',            'wp_filter_kses',       1 );
+add_filter( 'bp_get_the_profile_field_edit_value',      'wp_filter_kses',       1 );
+add_filter( 'bp_get_the_profile_field_description',     'wp_filter_kses',       1 );
+
+add_filter( 'bp_get_the_profile_field_value',           'wptexturize'        );
+add_filter( 'bp_get_the_profile_field_value',           'convert_smilies', 2 );
+add_filter( 'bp_get_the_profile_field_value',           'convert_chars'      );
+add_filter( 'bp_get_the_profile_field_value',           'wpautop'            );
+add_filter( 'bp_get_the_profile_field_value',           'force_balance_tags' );
+add_filter( 'bp_get_the_profile_field_value',           'make_clickable'     );
+add_filter( 'bp_get_the_profile_field_value',           'esc_html',        8 );
+
+add_filter( 'bp_get_the_profile_field_edit_value',      'force_balance_tags' );
+add_filter( 'bp_get_the_profile_field_edit_value',      'esc_html'           );
+
+add_filter( 'bp_get_the_profile_group_name',            'stripslashes' );
+add_filter( 'bp_get_the_profile_group_description',     'stripslashes' );
+add_filter( 'bp_get_the_profile_field_value',           'stripslashes' );
+add_filter( 'bp_get_the_profile_field_edit_value',      'stripslashes' );
+add_filter( 'bp_get_the_profile_field_name',            'stripslashes' );
+add_filter( 'bp_get_the_profile_field_description',     'stripslashes' );
+
+add_filter( 'xprofile_get_field_data',                  'wp_filter_kses', 1 );
+add_filter( 'xprofile_field_name_before_save',          'wp_filter_kses', 1 );
+add_filter( 'xprofile_field_description_before_save',   'wp_filter_kses', 1 );
+
+add_filter( 'xprofile_get_field_data',                  'force_balance_tags' );
+add_filter( 'xprofile_field_name_before_save',          'force_balance_tags' );
+add_filter( 'xprofile_field_description_before_save',   'force_balance_tags' );
+
+add_filter( 'xprofile_get_field_data',                  'stripslashes' );
+
+add_filter( 'bp_get_the_profile_field_value',           'xprofile_filter_format_field_value', 1, 2 );
+add_filter( 'bp_get_the_site_member_profile_data',      'xprofile_filter_format_field_value', 1, 2 );
+add_filter( 'bp_get_the_profile_field_value',           'xprofile_filter_link_profile_data',  9, 2 );
+
+add_filter( 'xprofile_data_value_before_save',          'xprofile_sanitize_data_value_before_save', 1, 2 );
 add_filter( 'xprofile_filtered_data_value_before_save', 'trim', 2 );
 
 /**
@@ -93,14 +100,14 @@ function xprofile_sanitize_data_value_before_save ( $field_value, $field_id, $re
 	// Filter each array item independently
 	} else {
 		$filtered_values = array();
-		foreach ( (array)$field_value as $value ) {
+		foreach ( (array) $field_value as $value ) {
 			$kses_field_value       = xprofile_filter_kses( $value );
 			$filtered_value 	= wp_rel_nofollow( force_balance_tags( $kses_field_value ) );
 			$filtered_values[] = apply_filters( 'xprofile_filtered_data_value_before_save', $filtered_value, $value );
 
 		}
 
-		if ( $reserialize )
+		if ( !empty( $reserialize ) )
 			$filtered_field_value = serialize( $filtered_values );
 		else
 			$filtered_field_value = $filtered_values;
@@ -115,7 +122,7 @@ function xprofile_sanitize_data_value_before_save ( $field_value, $field_id, $re
  * Runs stripslashes on XProfile fields. If is field_type is 'datebox'
  * then the date will be formatted by bp_format_time().
  *
- * @since 1.0.0
+ * @since BuddyPress (1.0)
  *
  * @param string $field_value XProfile field_value to be filtered.
  * @param string $field_type XProfile field_type to be filtered.
@@ -131,12 +138,13 @@ function xprofile_filter_format_field_value( $field_value, $field_type = '' ) {
 	if ( 'datebox' == $field_type ) {
 
 		// If Unix timestamp
-		if ( is_numeric( $field_value ) )
+		if ( is_numeric( $field_value ) ) {
 			$field_value = bp_format_time( $field_value, true, false );
 
 		// If MySQL timestamp
-		else
+		} else {
 			$field_value = bp_format_time( strtotime( $field_value ), true, false );
+		}
 
 	} else {
 		$field_value = str_replace(']]>', ']]&gt;', $field_value );
@@ -154,18 +162,25 @@ function xprofile_filter_link_profile_data( $field_value, $field_type = 'textbox
 
 	$values = explode( ',', $field_value );
 
-	if ( $values ) {
-		foreach ( (array)$values as $value ) {
+	if ( !empty( $values ) ) {
+		foreach ( (array) $values as $value ) {
 			$value = trim( $value );
 
 			// If the value is a URL, skip it and just make it clickable.
 			if ( preg_match( '@(https?://([-\w\.]+)+(:\d+)?(/([\w/_\.]*(\?\S+)?)?)?)@', $value ) ) {
 				$new_values[] = make_clickable( $value );
+
+			// Is not clickable
 			} else {
+
+				// More than 5 spaces
 				if ( count( explode( ' ', $value ) ) > 5 ) {
 					$new_values[] = $value;
+
+				// Less than 5 spaces
 				} else {
-					$new_values[] = '<a href="' . site_url( bp_get_members_root_slug() ) . '/?s=' . strip_tags( $value ) . '" rel="nofollow">' . $value . '</a>';
+					$search_url   = add_query_arg( array( 's' => urlencode( $value ) ), bp_get_members_directory_permalink() );
+					$new_values[] = '<a href="' . $search_url . '" rel="nofollow">' . $value . '</a>';
 				}
 			}
 		}
@@ -177,7 +192,7 @@ function xprofile_filter_link_profile_data( $field_value, $field_type = 'textbox
 }
 
 function xprofile_filter_comments( $comments, $post_id ) {
-	foreach( (array)$comments as $comment ) {
+	foreach( (array) $comments as $comment ) {
 		if ( $comment->user_id ) {
 			$user_ids[] = $comment->user_id;
 		}
@@ -187,12 +202,12 @@ function xprofile_filter_comments( $comments, $post_id ) {
 		return $comments;
 
 	if ( $fullnames = BP_XProfile_ProfileData::get_value_byid( 1, $user_ids ) ) {
-		foreach( (array)$fullnames as $user ) {
+		foreach( (array) $fullnames as $user ) {
 			$users[$user->user_id] = trim($user->value);
 		}
 	}
 
-	foreach( (array)$comments as $i => $comment ) {
+	foreach( (array) $comments as $i => $comment ) {
 		if ( !empty( $comment->user_id ) ) {
 			if ( !empty( $users[$comment->user_id] ) ) {
 				$comments[$i]->comment_author = $users[$comment->user_id];
@@ -204,4 +219,6 @@ function xprofile_filter_comments( $comments, $post_id ) {
 }
 add_filter( 'comments_array', 'xprofile_filter_comments', 10, 2 );
 
-?>
\ No newline at end of file
+
+
+?>
diff --git a/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-functions.php b/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-functions.php
index 19988e8a1df3667f0a50e0e0523b8b33bf2986b4..48b0c6b18f11f85d1bb862ac1641a90a895a4df0 100644
--- a/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-functions.php
+++ b/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-functions.php
@@ -1,11 +1,15 @@
 <?php
-/********************************************************************************
- * Business Functions
+
+/**
+ * BuddyPress XProfile Filters
  *
  * Business functions are where all the magic happens in BuddyPress. They will
  * handle the actual saving or manipulation of information. Usually they will
  * hand off to a database class for data access, then return
  * true or false on success or failure.
+ *
+ * @package BuddyPress
+ * @subpackage XProfileFilters
  */
 
 // Exit if accessed directly
@@ -24,7 +28,7 @@ function xprofile_insert_field_group( $args = '' ) {
 	$r = wp_parse_args( $args, $defaults );
 	extract( $r, EXTR_SKIP );
 
-	if ( !$name )
+	if ( empty( $name ) )
 		return false;
 
 	$field_group              = new BP_XProfile_Group( $field_group_id );
@@ -78,7 +82,7 @@ function xprofile_insert_field( $args = '' ) {
 	 */
 
 	// Check we have the minimum details
-	if ( !$field_group_id )
+	if ( empty( $field_group_id ) )
 		return false;
 
 	// Check this is a valid field type
@@ -86,7 +90,7 @@ function xprofile_insert_field( $args = '' ) {
 		return false;
 
 	// Instantiate a new field object
-	if ( $field_id )
+	if ( !empty( $field_id ) )
 		$field = new BP_XProfile_Field( $field_id );
 	else
 		$field = new BP_XProfile_Field;
@@ -147,15 +151,15 @@ function xprofile_delete_field( $field_id ) {
  * @package BuddyPress Core
  * @param mixed $field The ID of the field, or the $name of the field.
  * @param int $user_id The ID of the user
- * @global object $bp Global BuddyPress settings object
+ * @param string $multi_format How should array data be returned? 'comma' if you want a
+ *   comma-separated string; 'array' if you want an array
  * @uses BP_XProfile_ProfileData::get_value_byid() Fetches the value based on the params passed.
  * @return mixed The profile field data.
  */
-function xprofile_get_field_data( $field, $user_id = 0 ) {
-	global $bp;
+function xprofile_get_field_data( $field, $user_id = 0, $multi_format = 'array' ) {
 
 	if ( empty( $user_id ) )
-		$user_id = $bp->displayed_user->id;
+		$user_id = bp_displayed_user_id();
 
 	if ( empty( $user_id ) )
 		return false;
@@ -172,9 +176,13 @@ function xprofile_get_field_data( $field, $user_id = 0 ) {
 
 	if ( is_array( $values ) ) {
 		$data = array();
-		foreach( (array)$values as $value ) {
+		foreach( (array) $values as $value ) {
 			$data[] = apply_filters( 'xprofile_get_field_data', $value, $field_id, $user_id );
 		}
+
+		if ( 'comma' == $multi_format ) {
+			$data = implode( ', ', $data );
+		}
 	} else {
 		$data = apply_filters( 'xprofile_get_field_data', $values, $field_id, $user_id );
 	}
@@ -189,7 +197,7 @@ function xprofile_get_field_data( $field, $user_id = 0 ) {
  * @param $field The ID of the field, or the $name of the field.
  * @param $user_id The ID of the user
  * @param $value The value for the field you want to set for the user.
- * @global object $bp Global BuddyPress settings object
+ * @global BuddyPress $bp The one true BuddyPress instance
  * @uses xprofile_get_field_id_from_name() Gets the ID for the field based on the name.
  * @return true on success, false on failure.
  */
@@ -215,6 +223,8 @@ function xprofile_set_field_data( $field, $user_id, $value, $is_required = false
 		return true;
 	}
 
+	$possible_values = array();
+
 	// Check the value is an acceptable value
 	if ( 'checkbox' == $field->type || 'radio' == $field->type || 'selectbox' == $field->type || 'multiselectbox' == $field->type ) {
 		$options = $field->get_children();
@@ -224,7 +234,7 @@ function xprofile_set_field_data( $field, $user_id, $value, $is_required = false
 
 		if ( is_array( $value ) ) {
 			foreach( $value as $i => $single ) {
-				if ( !in_array( $single, (array)$possible_values ) ) {
+				if ( !in_array( $single, $possible_values ) ) {
 					unset( $value[$i] );
 				}
 			}
@@ -232,7 +242,7 @@ function xprofile_set_field_data( $field, $user_id, $value, $is_required = false
 			// Reset the keys by merging with an empty array
 			$value = array_merge( array(), $value );
 		} else {
-			if ( !in_array( $value, (array)$possible_values ) ) {
+			if ( !in_array( $value, $possible_values ) ) {
 				return false;
 			}
 		}
@@ -246,6 +256,37 @@ function xprofile_set_field_data( $field, $user_id, $value, $is_required = false
 	return $field->save();
 }
 
+/**
+ * Set the visibility level for this field
+ *
+ * @param int $field_id The ID of the xprofile field
+ * @param int $user_id The ID of the user to whom the data belongs
+ * @param string $visibility_level
+ * @return bool True on success
+ */
+function xprofile_set_field_visibility_level( $field_id = 0, $user_id = 0, $visibility_level = '' ) {
+	if ( empty( $field_id ) || empty( $user_id ) || empty( $visibility_level ) ) {
+		return false;
+	}
+
+	// Check against a whitelist
+	$allowed_values = bp_xprofile_get_visibility_levels();
+	if ( !array_key_exists( $visibility_level, $allowed_values ) ) {
+		return false;
+	}
+
+	// Stored in an array in usermeta
+	$current_visibility_levels = bp_get_user_meta( $user_id, 'bp_xprofile_visibility_levels', true );
+
+	if ( !$current_visibility_levels ) {
+		$current_visibility_levels = array();
+	}
+
+	$current_visibility_levels[$field_id] = $visibility_level;
+
+	return bp_update_user_meta( $user_id, 'bp_xprofile_visibility_levels', $current_visibility_levels );
+}
+
 function xprofile_delete_field_data( $field, $user_id ) {
 	if ( is_numeric( $field ) )
 		$field_id = $field;
@@ -266,7 +307,7 @@ function xprofile_check_is_required_field( $field_id ) {
 	$retval = false;
 
 	// Super admins can skip required check
-	if ( is_super_admin() && !is_admin() )
+	if ( bp_current_user_can( 'bp_moderate' ) && !is_admin() )
 		$retval = false;
 
 	// All other users will use the field's setting
@@ -293,21 +334,21 @@ function xprofile_get_field_id_from_name( $field_name ) {
  * @package BuddyPress Core
  * @param $user_id User ID of the user to get random data for
  * @param $exclude_fullname whether or not to exclude the full name field as random data.
- * @global object $bp Global BuddyPress settings object
+ * @global BuddyPress $bp The one true BuddyPress instance
  * @global $wpdb WordPress DB access object.
  * @global $current_user WordPress global variable containing current logged in user information
  * @uses xprofile_format_profile_field() Formats profile field data so it is suitable for display.
  * @return $field_data The fetched random data for the user.
  */
 function xprofile_get_random_profile_data( $user_id, $exclude_fullname = true ) {
-	$field_data           = BP_XProfile_ProfileData::get_random( $user_id, $exclude_fullname );
+	$field_data = BP_XProfile_ProfileData::get_random( $user_id, $exclude_fullname );
 
-	if ( !$field_data )
+	if ( empty( $field_data ) )
 		return false;
 
 	$field_data[0]->value = xprofile_format_profile_field( $field_data[0]->type, $field_data[0]->value );
 
-	if ( !$field_data[0]->value || empty( $field_data[0]->value ) )
+	if ( empty( $field_data[0]->value ) )
 		return false;
 
 	return apply_filters( 'xprofile_get_random_profile_data', $field_data );
@@ -351,10 +392,9 @@ function xprofile_update_field_position( $field_id, $position, $field_group_id )
  * @return array() containing the path and URL plus some other settings.
  */
 function xprofile_avatar_upload_dir( $directory = false, $user_id = 0 ) {
-	global $bp;
 
 	if ( empty( $user_id ) )
-		$user_id = $bp->displayed_user->id;
+		$user_id = bp_displayed_user_id();
 
 	if ( empty( $directory ) )
 		$directory = 'avatars';
@@ -387,11 +427,11 @@ function xprofile_avatar_upload_dir( $directory = false, $user_id = 0 ) {
 function xprofile_sync_wp_profile( $user_id = 0 ) {
 	global $bp, $wpdb;
 
-	if ( !empty( $bp->site_options['bp-disable-profile-sync'] ) && (int)$bp->site_options['bp-disable-profile-sync'] )
+	if ( !empty( $bp->site_options['bp-disable-profile-sync'] ) && (int) $bp->site_options['bp-disable-profile-sync'] )
 		return true;
 
 	if ( empty( $user_id ) )
-		$user_id = $bp->loggedin_user->id;
+		$user_id = bp_loggedin_user_id();
 
 	if ( empty( $user_id ) )
 		return false;
@@ -407,9 +447,9 @@ function xprofile_sync_wp_profile( $user_id = 0 ) {
 		$lastname = trim( substr( $fullname, $space, strlen( $fullname ) ) );
 	}
 
-	update_user_meta( $user_id, 'nickname',   $fullname  );
-	update_user_meta( $user_id, 'first_name', $firstname );
-	update_user_meta( $user_id, 'last_name',  $lastname  );
+	bp_update_user_meta( $user_id, 'nickname',   $fullname  );
+	bp_update_user_meta( $user_id, 'first_name', $firstname );
+	bp_update_user_meta( $user_id, 'last_name',  $lastname  );
 
 	$wpdb->query( $wpdb->prepare( "UPDATE {$wpdb->users} SET display_name = %s WHERE ID = %d", $fullname, $user_id ) );
 }
@@ -426,7 +466,7 @@ add_action( 'bp_core_signup_user', 'xprofile_sync_wp_profile' );
 function xprofile_sync_bp_profile( &$errors, $update, &$user ) {
 	global $bp;
 
-	if ( ( !empty( $bp->site_options['bp-disable-profile-sync'] ) && (int)$bp->site_options['bp-disable-profile-sync'] ) || !$update || $errors->get_error_codes() )
+	if ( ( !empty( $bp->site_options['bp-disable-profile-sync'] ) && (int) $bp->site_options['bp-disable-profile-sync'] ) || !$update || $errors->get_error_codes() )
 		return;
 
 	xprofile_set_field_data( bp_xprofile_fullname_field_name(), $user->ID, $user->display_name );
@@ -436,27 +476,14 @@ add_action( 'user_profile_update_errors', 'xprofile_sync_bp_profile', 10, 3 );
 
 /**
  * When a user is deleted, we need to clean up the database and remove all the
- * profile data from each table. Also we need to clean anything up in the usermeta table
- * that this component uses.
+ * profile data from each table. Also we need to clean anything up in the
+ * usermeta table that this component uses.
  *
  * @package BuddyPress XProfile
  * @param $user_id The ID of the deleted user
- * @uses get_user_meta() Get a user meta value based on meta key from wp_usermeta
- * @uses delete_user_meta() Delete user meta value based on meta key from wp_usermeta
- * @uses delete_data_for_user() Removes all profile data from the xprofile tables for the user
  */
 function xprofile_remove_data( $user_id ) {
 	BP_XProfile_ProfileData::delete_data_for_user( $user_id );
-
-	// delete any avatar files.
-	@unlink( get_user_meta( $user_id, 'bp_core_avatar_v1_path', true ) );
-	@unlink( get_user_meta( $user_id, 'bp_core_avatar_v2_path', true ) );
-
-	// unset the usermeta for avatars from the usermeta table.
-	delete_user_meta( $user_id, 'bp_core_avatar_v1'      );
-	delete_user_meta( $user_id, 'bp_core_avatar_v1_path' );
-	delete_user_meta( $user_id, 'bp_core_avatar_v2'      );
-	delete_user_meta( $user_id, 'bp_core_avatar_v2_path' );
 }
 add_action( 'wpmu_delete_user',  'xprofile_remove_data' );
 add_action( 'delete_user',       'xprofile_remove_data' );
@@ -486,11 +513,11 @@ function bp_xprofile_delete_meta( $object_id, $object_type, $meta_key = false, $
 	$meta_value = trim( $meta_value );
 
 	if ( !$meta_key )
-		$wpdb->query( $wpdb->prepare( "DELETE FROM " . $bp->profile->table_name_meta . " WHERE object_id = %d AND object_type = %s", $object_id, $object_type ) );
+		$wpdb->query( $wpdb->prepare( "DELETE FROM {$bp->profile->table_name_meta} WHERE object_id = %d AND object_type = %s", $object_id, $object_type ) );
 	else if ( $meta_value )
-		$wpdb->query( $wpdb->prepare( "DELETE FROM " . $bp->profile->table_name_meta . " WHERE object_id = %d AND object_type = %s AND meta_key = %s AND meta_value = %s", $object_id, $object_type, $meta_key, $meta_value ) );
+		$wpdb->query( $wpdb->prepare( "DELETE FROM {$bp->profile->table_name_meta} WHERE object_id = %d AND object_type = %s AND meta_key = %s AND meta_value = %s", $object_id, $object_type, $meta_key, $meta_value ) );
 	else
-		$wpdb->query( $wpdb->prepare( "DELETE FROM " . $bp->profile->table_name_meta . " WHERE object_id = %d AND object_type = %s AND meta_key = %s", $object_id, $object_type, $meta_key ) );
+		$wpdb->query( $wpdb->prepare( "DELETE FROM {$bp->profile->table_name_meta} WHERE object_id = %d AND object_type = %s AND meta_key = %s", $object_id, $object_type, $meta_key ) );
 
 	// Delete the cached object
 	wp_cache_delete( 'bp_xprofile_meta_' . $object_type . '_' . $object_id . '_' . $meta_key, 'bp' );
@@ -516,11 +543,11 @@ function bp_xprofile_get_meta( $object_id, $object_type, $meta_key = '') {
 		$meta_key = preg_replace( '|[^a-z0-9_]|i', '', $meta_key );
 
 		if ( !$metas = wp_cache_get( 'bp_xprofile_meta_' . $object_type . '_' . $object_id . '_' . $meta_key, 'bp' ) ) {
-			$metas = $wpdb->get_col( $wpdb->prepare( "SELECT meta_value FROM " . $bp->profile->table_name_meta . " WHERE object_id = %d AND object_type = %s AND meta_key = %s", $object_id, $object_type, $meta_key ) );
+			$metas = $wpdb->get_col( $wpdb->prepare( "SELECT meta_value FROM {$bp->profile->table_name_meta} WHERE object_id = %d AND object_type = %s AND meta_key = %s", $object_id, $object_type, $meta_key ) );
 			wp_cache_set( 'bp_xprofile_meta_' . $object_type . '_' . $object_id . '_' . $meta_key, $metas, 'bp' );
 		}
 	} else {
-		$metas = $wpdb->get_col( $wpdb->prepare( "SELECT meta_value FROM " . $bp->profile->table_name_meta . " WHERE object_id = %d AND object_type = %s", $object_id, $object_type ) );
+		$metas = $wpdb->get_col( $wpdb->prepare( "SELECT meta_value FROM {$bp->profile->table_name_meta} WHERE object_id = %d AND object_type = %s", $object_id, $object_type ) );
 	}
 
 	if ( empty( $metas ) ) {
@@ -531,7 +558,7 @@ function bp_xprofile_get_meta( $object_id, $object_type, $meta_key = '') {
 		}
 	}
 
-	$metas = array_map( 'maybe_unserialize', (array)$metas );
+	$metas = array_map( 'maybe_unserialize', (array) $metas );
 
 	if ( 1 == count( $metas ) )
 		return $metas[0];
@@ -563,12 +590,12 @@ function bp_xprofile_update_meta( $object_id, $object_type, $meta_key, $meta_val
 	if ( empty( $meta_value ) )
 		return bp_xprofile_delete_meta( $object_id, $object_type, $meta_key );
 
-	$cur = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM " . $bp->profile->table_name_meta . " WHERE object_id = %d AND object_type = %s AND meta_key = %s", $object_id, $object_type, $meta_key ) );
+	$cur = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM {$bp->profile->table_name_meta} WHERE object_id = %d AND object_type = %s AND meta_key = %s", $object_id, $object_type, $meta_key ) );
 
 	if ( empty( $cur ) )
-		$wpdb->query( $wpdb->prepare( "INSERT INTO " . $bp->profile->table_name_meta . " ( object_id, object_type, meta_key, meta_value ) VALUES ( %d, %s, %s, %s )", $object_id, $object_type,  $meta_key, $meta_value ) );
+		$wpdb->query( $wpdb->prepare( "INSERT INTO {$bp->profile->table_name_meta} ( object_id, object_type, meta_key, meta_value ) VALUES ( %d, %s, %s, %s )", $object_id, $object_type,  $meta_key, $meta_value ) );
 	else if ( $cur->meta_value != $meta_value )
-		$wpdb->query( $wpdb->prepare( "UPDATE " . $bp->profile->table_name_meta . " SET meta_value = %s WHERE object_id = %d AND object_type = %s AND meta_key = %s", $meta_value, $object_id, $object_type, $meta_key ) );
+		$wpdb->query( $wpdb->prepare( "UPDATE {$bp->profile->table_name_meta} SET meta_value = %s WHERE object_id = %d AND object_type = %s AND meta_key = %s", $meta_value, $object_id, $object_type, $meta_key ) );
 	else
 		return false;
 
@@ -594,7 +621,7 @@ function bp_xprofile_update_fielddata_meta( $field_data_id, $meta_key, $meta_val
  * Return the field name for the Full Name xprofile field
  *
  * @package BuddyPress
- * @since 1.5
+ * @since BuddyPress (1.5)
  *
  * @return str The field name
  */
@@ -602,4 +629,119 @@ function bp_xprofile_fullname_field_name() {
 	return apply_filters( 'bp_xprofile_fullname_field_name', BP_XPROFILE_FULLNAME_FIELD_NAME );
 }
 
-?>
\ No newline at end of file
+/**
+ * Get visibility levels out of the $bp global
+ *
+ * @return array
+ */
+function bp_xprofile_get_visibility_levels() {
+	global $bp;
+
+	return apply_filters( 'bp_xprofile_get_visibility_levels', $bp->profile->visibility_levels );
+}
+
+/**
+ * Get the ids of fields that are hidden for this displayed/loggedin user pair
+ *
+ * This is the function primarily responsible for profile field visibility. It works by determining
+ * the relationship between the displayed_user (ie the profile owner) and the current_user (ie the
+ * profile viewer). Then, based on that relationship, we query for the set of fields that should
+ * be excluded from the profile loop.
+ *
+ * @since 1.6
+ * @see BP_XProfile_Group::get()
+ * @uses apply_filters() Filter bp_xprofile_get_hidden_fields_for_user to modify visibility levels,
+ *   or if you have added your own custom levels
+ *
+ * @param int $displayed_user_id The id of the user the profile fields belong to
+ * @param int $current_user_id The id of the user viewing the profile
+ * @return array An array of field ids that should be excluded from the profile query
+ */
+function bp_xprofile_get_hidden_fields_for_user( $displayed_user_id = 0, $current_user_id = 0 ) {
+	if ( !$displayed_user_id ) {
+		$displayed_user_id = bp_displayed_user_id();
+	}
+
+	if ( !$displayed_user_id ) {
+		return array();
+	}
+
+	if ( !$current_user_id ) {
+		$current_user_id = bp_loggedin_user_id();
+	}
+
+	// @todo - This is where you'd swap out for current_user_can() checks
+
+	if ( $current_user_id ) {
+		// Current user is logged in
+		if ( $displayed_user_id == $current_user_id ) {
+			// If you're viewing your own profile, nothing's private
+			$hidden_fields = array();
+
+		} else if ( bp_is_active( 'friends' ) && friends_check_friendship( $displayed_user_id, $current_user_id ) ) {
+			// If the current user and displayed user are friends, show all
+			$hidden_fields = array();
+
+		} else {
+			// current user is logged-in but not friends, so exclude friends-only
+			$hidden_levels = array( 'friends' );
+			$hidden_fields = bp_xprofile_get_fields_by_visibility_levels( $displayed_user_id, $hidden_levels );
+		}
+
+	} else {
+		// Current user is not logged in, so exclude friends-only and loggedin
+		$hidden_levels = array( 'friends', 'loggedin' );
+		$hidden_fields = bp_xprofile_get_fields_by_visibility_levels( $displayed_user_id, $hidden_levels );
+	}
+
+	return apply_filters( 'bp_xprofile_get_hidden_fields_for_user', $hidden_fields, $displayed_user_id, $current_user_id );
+}
+
+/**
+ * Fetch an array of the xprofile fields that a given user has marked with certain visibility levels
+ *
+ * @since 1.6
+ * @see bp_xprofile_get_hidden_fields_for_user()
+ *
+ * @param int $user_id The id of the profile owner
+ * @param array $levels An array of visibility levels ('public', 'friends', 'loggedin', etc) to be
+ *    checked against
+ * @return array $field_ids The fields that match the requested visibility levels for the given user
+ */
+function bp_xprofile_get_fields_by_visibility_levels( $user_id, $levels = array() ) {
+	if ( !is_array( $levels ) ) {
+		$levels = (array)$levels;
+	}
+
+	$user_visibility_levels = bp_get_user_meta( $user_id, 'bp_xprofile_visibility_levels', true );
+
+	// Parse the user-provided visibility levels with the default levels, which may take
+	// precedence
+	$default_visibility_levels = BP_XProfile_Group::fetch_default_visibility_levels();
+
+	foreach( (array) $default_visibility_levels as $d_field_id => $defaults ) {
+		// If the admin has forbidden custom visibility levels for this field, replace
+		// the user-provided setting with the default specified by the admin
+		if ( isset( $defaults['allow_custom'] ) && isset( $defaults['default'] ) && 'disabled' == $defaults['allow_custom'] && isset( $user_visibility_levels[$d_field_id] ) ) {
+			$user_visibility_levels[$d_field_id] = $defaults['default'];
+		}
+	}
+
+	$field_ids = array();
+	foreach( (array) $user_visibility_levels as $field_id => $field_visibility ) {
+		if ( in_array( $field_visibility, $levels ) ) {
+			$field_ids[] = $field_id;
+		}
+	}
+
+	// Never allow the fullname field to be excluded
+	if ( in_array( 1, $field_ids ) ) {
+		$key = array_search( 1, $field_ids );
+		unset( $field_ids[$key] );
+	}
+
+	return $field_ids;
+}
+
+
+?>
diff --git a/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-loader.php b/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-loader.php
index f7506de8c4d1c6ecf59bde5f8900ff49d11213a1..b32b9bcbb587f86144a575c22625c400819ef556 100644
--- a/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-loader.php
+++ b/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-loader.php
@@ -1,4 +1,5 @@
 <?php
+
 /**
  * BuddyPress XProfile Loader
  *
@@ -6,18 +7,33 @@
  * groups of fields for users to enter information about themselves.
  *
  * @package BuddyPress
- * @subpackage XProfile Core
+ * @subpackage XProfileLoader
  */
 
 // Exit if accessed directly
 if ( !defined( 'ABSPATH' ) ) exit;
 
 class BP_XProfile_Component extends BP_Component {
+	/**
+	 * Profile field types
+	 *
+	 * @since BuddyPress (1.5)
+	 * @var array
+	 */
+	public $field_types;
+
+	/**
+	 * The acceptable visibility levels for xprofile fields.
+	 *
+	 * @see bp_xprofile_get_visibility_levels()
+	 * @since 1.6
+	 */
+	var $visibility_levels = array();
 
 	/**
 	 * Start the xprofile component creation process
 	 *
-	 * @since 1.5
+	 * @since BuddyPress (1.5)
 	 */
 	function __construct() {
 		parent::start(
@@ -37,6 +53,7 @@ class BP_XProfile_Component extends BP_Component {
 			'actions',
 			'activity',
 			'screens',
+			'caps',
 			'classes',
 			'filters',
 			'template',
@@ -56,8 +73,8 @@ class BP_XProfile_Component extends BP_Component {
 	 * The BP_XPROFILE_SLUG constant is deprecated, and only used here for
 	 * backwards compatibility.
 	 *
-	 * @since 1.5
-	 * @global obj $bp
+	 * @since BuddyPress (1.5)
+	 * @global BuddyPress $bp The one true BuddyPress instance
 	 */
 	function setup_globals() {
 		global $bp;
@@ -81,6 +98,25 @@ class BP_XProfile_Component extends BP_Component {
 			'multiselectbox',
 			'datebox'
 		) );
+		
+		// Register the visibility levels. See bp_xprofile_get_visibility_levels() to filter		
+		$this->visibility_levels = array(
+			'public'  => array(
+				'id'	=> 'public',
+				'label' => __( 'Anyone', 'buddypress' )
+			),
+			'loggedin' => array(
+				'id'	=> 'loggedin',
+				'label' => __( 'Logged In Users', 'buddypress' )
+			)
+		);
+		
+		if ( bp_is_active( 'friends' ) ) {
+			$this->visibility_levels['friends'] = array(
+				'id'	=> 'friends',
+				'label'	=> __( 'My Friends', 'buddypress' )
+			);
+		}
 
 		// Tables
 		$global_tables = array(
@@ -103,10 +139,11 @@ class BP_XProfile_Component extends BP_Component {
 	/**
 	 * Setup BuddyBar navigation
 	 *
-	 * @global obj $bp
+	 * @global BuddyPress $bp The one true BuddyPress instance
 	 */
 	function setup_nav() {
-		global $bp;
+
+		$sub_nav = array();
 
 		// Add 'Profile' to the main navigation
 		$main_nav = array(
@@ -118,7 +155,7 @@ class BP_XProfile_Component extends BP_Component {
 			'item_css_id'         => $this->id
 		);
 
-		$profile_link = trailingslashit( $bp->loggedin_user->domain . $this->slug );
+		$profile_link = trailingslashit( bp_loggedin_user_domain() . $this->slug );
 
 		// Add the subnav items to the profile
 		$sub_nav[] = array(
@@ -154,9 +191,9 @@ class BP_XProfile_Component extends BP_Component {
 	}
 
 	/**
-	 * Set up the admin bar
+	 * Set up the Toolbar
 	 *
-	 * @global obj $bp
+	 * @global BuddyPress $bp The one true BuddyPress instance
 	 */
 	function setup_admin_bar() {
 		global $bp;
@@ -168,7 +205,7 @@ class BP_XProfile_Component extends BP_Component {
 		if ( is_user_logged_in() ) {
 
 			// Profile link
-			$profile_link = trailingslashit( $bp->loggedin_user->domain . $this->slug );
+			$profile_link = trailingslashit( bp_loggedin_user_domain() . $this->slug );
 
 			// Add the "Profile" sub menu
 			$wp_admin_nav[] = array(
@@ -181,7 +218,7 @@ class BP_XProfile_Component extends BP_Component {
 			// View Profile
 			$wp_admin_nav[] = array(
 				'parent' => 'my-account-' . $this->id,
-				'id'     => 'my-account-' . $this->id . '-view',
+				'id'     => 'my-account-' . $this->id . '-public',
 				'title'  => __( 'View', 'buddypress' ),
 				'href'   => trailingslashit( $profile_link . 'public' )
 			);
@@ -210,7 +247,7 @@ class BP_XProfile_Component extends BP_Component {
 	/**
 	 * Sets up the title for pages and <title>
 	 *
-	 * @global obj $bp
+	 * @global BuddyPress $bp The one true BuddyPress instance
 	 */
 	function setup_title() {
 		global $bp;
@@ -220,18 +257,24 @@ class BP_XProfile_Component extends BP_Component {
 				$bp->bp_options_title = __( 'My Profile', 'buddypress' );
 			} else {
 				$bp->bp_options_avatar = bp_core_fetch_avatar( array(
-					'item_id' => $bp->displayed_user->id,
-					'type'    => 'thumb'
+					'item_id' => bp_displayed_user_id(),
+					'type'    => 'thumb',
+					'alt'	  => sprintf( __( 'Profile picture of %s', 'buddypress' ), bp_get_displayed_user_fullname() )
 				) );
-				$bp->bp_options_title = $bp->displayed_user->fullname;
+				$bp->bp_options_title = bp_get_displayed_user_fullname();
 			}
 		}
 
 		parent::setup_title();
 	}
 }
-// Create the xprofile component
-if ( !isset( $bp->profile->id ) )
-	$bp->profile = new BP_XProfile_Component();
+
+function bp_setup_xprofile() {
+	global $bp;
+
+	if ( !isset( $bp->profile->id ) )
+		$bp->profile = new BP_XProfile_Component();
+}
+add_action( 'bp_setup_components', 'bp_setup_xprofile', 6 );
 
 ?>
diff --git a/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-screens.php b/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-screens.php
index f01a947370205bf4a84ebb8d8efc2cdc26b4f8cb..16102fda59cc9b6ef474ab74605d0679cd792829 100644
--- a/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-screens.php
+++ b/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-screens.php
@@ -1,8 +1,14 @@
 <?php
-/*******************************************************************************
+
+/**
+ * BuddyPress XProfile Screens
+ *
  * Screen functions are the controllers of BuddyPress. They will execute when
  * their specific URL is caught. They will first save or manipulate data using
  * business functions, then pass on the user to a template file.
+ *
+ * @package BuddyPress
+ * @subpackage XProfileScreens
  */
 
 // Exit if accessed directly
@@ -32,12 +38,12 @@ function xprofile_screen_display_profile() {
 function xprofile_screen_edit_profile() {
 	global $bp;
 
-	if ( !bp_is_my_profile() && !is_super_admin() )
+	if ( !bp_is_my_profile() && !bp_current_user_can( 'bp_moderate' ) )
 		return false;
 
 	// Make sure a group is set.
 	if ( !bp_action_variable( 1 ) )
-		bp_core_redirect( bp_displayed_user_domain() . $bp->profile->slug . '/edit/group/1' );
+		bp_core_redirect( trailingslashit( bp_displayed_user_domain() . $bp->profile->slug . '/edit/group/1' ) );
 
 	// Check the field group exists
 	if ( !bp_is_action_variable( 'group' ) || !xprofile_get_field_group( bp_action_variable( 1 ) ) ) {
@@ -45,6 +51,9 @@ function xprofile_screen_edit_profile() {
 		return;
 	}
 
+	// No errors
+	$errors = false;
+
 	// Check to see if any new information has been submitted
 	if ( isset( $_POST['field_ids'] ) ) {
 
@@ -53,7 +62,7 @@ function xprofile_screen_edit_profile() {
 
 		// Check we have field ID's
 		if ( empty( $_POST['field_ids'] ) )
-			bp_core_redirect( trailingslashit( $bp->displayed_user->domain . $bp->profile->slug . '/edit/group/' . bp_action_variable( 1 ) ) );
+			bp_core_redirect( trailingslashit( bp_displayed_user_domain() . $bp->profile->slug . '/edit/group/' . bp_action_variable( 1 ) ) );
 
 		// Explode the posted field IDs into an array so we know which
 		// fields have been submitted
@@ -62,7 +71,7 @@ function xprofile_screen_edit_profile() {
 
 		// Loop through the posted fields formatting any datebox values
 		// then validate the field
-		foreach ( (array)$posted_field_ids as $field_id ) {
+		foreach ( (array) $posted_field_ids as $field_id ) {
 			if ( !isset( $_POST['field_' . $field_id] ) ) {
 
 				if ( !empty( $_POST['field_' . $field_id . '_day'] ) && !empty( $_POST['field_' . $field_id . '_month'] ) && !empty( $_POST['field_' . $field_id . '_year'] ) ) {
@@ -76,8 +85,9 @@ function xprofile_screen_edit_profile() {
 			}
 
 			$is_required[$field_id] = xprofile_check_is_required_field( $field_id );
-			if ( $is_required[$field_id] && empty( $_POST['field_' . $field_id] ) )
+			if ( $is_required[$field_id] && empty( $_POST['field_' . $field_id] ) ) {
 				$errors = true;
+			}
 		}
 
 		// There are errors
@@ -86,11 +96,12 @@ function xprofile_screen_edit_profile() {
 
 		// No errors
 		} else {
+
 			// Reset the errors var
 			$errors = false;
 
 			// Now we've checked for required fields, lets save the values.
-			foreach ( (array)$posted_field_ids as $field_id ) {
+			foreach ( (array) $posted_field_ids as $field_id ) {
 
 				// Certain types of fields (checkboxes, multiselects) may come through empty. Save them as an empty array so that they don't get overwritten by the default on the next edit.
 				if ( empty( $_POST['field_' . $field_id] ) )
@@ -98,16 +109,20 @@ function xprofile_screen_edit_profile() {
 				else
 					$value = $_POST['field_' . $field_id];
 
-				if ( !xprofile_set_field_data( $field_id, $bp->displayed_user->id, $value, $is_required[$field_id] ) )
+				if ( !xprofile_set_field_data( $field_id, bp_displayed_user_id(), $value, $is_required[$field_id] ) )
 					$errors = true;
 				else
 					do_action( 'xprofile_profile_field_data_updated', $field_id, $value );
+
+				// Save the visibility level
+				$visibility_level = !empty( $_POST['field_' . $field_id . '_visibility'] ) ? $_POST['field_' . $field_id . '_visibility'] : 'public';
+				xprofile_set_field_visibility_level( $field_id, bp_displayed_user_id(), $visibility_level );
 			}
 
-			do_action( 'xprofile_updated_profile', $bp->displayed_user->id, $posted_field_ids, $errors );
+			do_action( 'xprofile_updated_profile', bp_displayed_user_id(), $posted_field_ids, $errors );
 
 			// Set the feedback messages
-			if ( $errors )
+			if ( !empty( $errors ) )
 				bp_core_add_message( __( 'There was a problem updating some of your profile information, please try again.', 'buddypress' ), 'error' );
 			else
 				bp_core_add_message( __( 'Changes saved.', 'buddypress' ) );
@@ -131,7 +146,7 @@ function xprofile_screen_edit_profile() {
 function xprofile_screen_change_avatar() {
 	global $bp;
 
-	if ( !bp_is_my_profile() && !is_super_admin() )
+	if ( !bp_is_my_profile() && !bp_current_user_can( 'bp_moderate' ) )
 		return false;
 
 	if ( bp_action_variables() ) {
@@ -161,7 +176,7 @@ function xprofile_screen_change_avatar() {
 		// Check the nonce
 		check_admin_referer( 'bp_avatar_cropstore' );
 
-		if ( !bp_core_avatar_handle_crop( array( 'item_id' => $bp->displayed_user->id, 'original_file' => $_POST['image_src'], 'crop_x' => $_POST['x'], 'crop_y' => $_POST['y'], 'crop_w' => $_POST['w'], 'crop_h' => $_POST['h'] ) ) )
+		if ( !bp_core_avatar_handle_crop( array( 'item_id' => bp_displayed_user_id(), 'original_file' => $_POST['image_src'], 'crop_x' => $_POST['x'], 'crop_y' => $_POST['y'], 'crop_w' => $_POST['w'], 'crop_h' => $_POST['h'] ) ) )
 			bp_core_add_message( __( 'There was a problem cropping your avatar, please try uploading it again', 'buddypress' ), 'error' );
 		else {
 			bp_core_add_message( __( 'Your new avatar was uploaded successfully!', 'buddypress' ) );
@@ -174,4 +189,4 @@ function xprofile_screen_change_avatar() {
 	bp_core_load_template( apply_filters( 'xprofile_template_change_avatar', 'members/single/home' ) );
 }
 
-?>
\ No newline at end of file
+?>
diff --git a/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-template.php b/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-template.php
index f7ebceb04490f2c33bd80be90d3722cd5aed7391..11dd52e7a673fb9e1d5186381cfd7ed027686ae7 100644
--- a/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-template.php
+++ b/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-template.php
@@ -1,12 +1,16 @@
 <?php
-/***************************************************************************
- * XProfile Data Display Template Tags
- **/
+
+/**
+ * BuddyPress XProfile Template Tags
+ *
+ * @package BuddyPress
+ * @subpackage XProfileTemplate
+ */
 
 // Exit if accessed directly
 if ( !defined( 'ABSPATH' ) ) exit;
 
-Class BP_XProfile_Data_Template {
+class BP_XProfile_Data_Template {
 	var $current_group = -1;
 	var $group_count;
 	var $groups;
@@ -20,20 +24,17 @@ Class BP_XProfile_Data_Template {
 	var $in_the_loop;
 	var $user_id;
 
-	function bp_xprofile_data_template( $user_id, $profile_group_id, $hide_empty_groups = false, $fetch_fields = false, $fetch_field_data = false, $exclude_groups = false, $exclude_fields = false, $hide_empty_fields = false ) {
-		$this->__construct( $user_id, $profile_group_id, $hide_empty_groups, $fetch_fields, $fetch_field_data, $exclude_groups, $exclude_fields, $hide_empty_fields );
-	}
-
-	function __construct( $user_id, $profile_group_id, $hide_empty_groups = false, $fetch_fields = false, $fetch_field_data = false, $exclude_groups = false, $exclude_fields = false, $hide_empty_fields = false ) {
+	function __construct( $user_id, $profile_group_id, $hide_empty_groups = false, $fetch_fields = false, $fetch_field_data = false, $exclude_groups = false, $exclude_fields = false, $hide_empty_fields = false, $fetch_visibility_level = false ) {
 		$this->groups = BP_XProfile_Group::get( array(
-			'profile_group_id'  => $profile_group_id,
-			'user_id'           => $user_id,
-			'hide_empty_groups' => $hide_empty_groups,
-			'hide_empty_fields' => $hide_empty_fields,
-			'fetch_fields'      => $fetch_fields,
-			'fetch_field_data'  => $fetch_field_data,
-			'exclude_groups'    => $exclude_groups,
-			'exclude_fields'    => $exclude_fields
+			'profile_group_id'    => $profile_group_id,
+			'user_id'             => $user_id,
+			'hide_empty_groups'   => $hide_empty_groups,
+			'hide_empty_fields'   => $hide_empty_fields,
+			'fetch_fields'        => $fetch_fields,
+			'fetch_field_data'    => $fetch_field_data,
+			'fetch_visibility_level' => $fetch_visibility_level,
+			'exclude_groups'      => $exclude_groups,
+			'exclude_fields'      => $exclude_fields
 		) );
 
 		$this->group_count = count($this->groups);
@@ -151,27 +152,35 @@ function xprofile_get_profile() {
 }
 
 function bp_has_profile( $args = '' ) {
-	global $bp, $profile_template;
+	global $profile_template;
 
 	// Only show empty fields if we're on the Dashboard, or we're on a user's profile edit page,
 	// or this is a registration page
 	$hide_empty_fields_default = ( !is_network_admin() && !is_admin() && !bp_is_user_profile_edit() && !bp_is_register_page() );
 
+	// We only need to fetch visibility levels when viewing your own profile
+	if ( bp_is_my_profile() || bp_current_user_can( 'bp_moderate' ) || bp_is_register_page() ) {
+		$fetch_visibility_level_default = true;
+	} else {
+		$fetch_visibility_level_default = false;
+	}
+
 	$defaults = array(
-		'user_id'           => $bp->displayed_user->id,
-		'profile_group_id'  => false,
-		'hide_empty_groups' => true,
-		'hide_empty_fields' => $hide_empty_fields_default,
-		'fetch_fields'      => true,
-		'fetch_field_data'  => true,
-		'exclude_groups'    => false, // Comma-separated list of profile field group IDs to exclude
-		'exclude_fields'    => false  // Comma-separated list of profile field IDs to exclude
+		'user_id'             => bp_displayed_user_id(),
+		'profile_group_id'    => false,
+		'hide_empty_groups'   => true,
+		'hide_empty_fields'   => $hide_empty_fields_default,
+		'fetch_fields'        => true,
+		'fetch_field_data'    => true,
+		'fetch_visibility_level' => $fetch_visibility_level_default,
+		'exclude_groups'      => false, // Comma-separated list of profile field group IDs to exclude
+		'exclude_fields'      => false  // Comma-separated list of profile field IDs to exclude
 	);
 
 	$r = wp_parse_args( $args, $defaults );
 	extract( $r, EXTR_SKIP );
 
-	$profile_template = new BP_XProfile_Data_Template( $user_id, $profile_group_id, $hide_empty_groups, $fetch_fields, $fetch_field_data, $exclude_groups, $exclude_fields, $hide_empty_fields );
+	$profile_template = new BP_XProfile_Data_Template( $user_id, $profile_group_id, $hide_empty_groups, $fetch_fields, $fetch_field_data, $exclude_groups, $exclude_fields, $hide_empty_fields, $fetch_visibility_level );
 	return apply_filters( 'bp_has_profile', $profile_template->has_groups(), $profile_template );
 }
 
@@ -267,7 +276,7 @@ function bp_the_profile_group_edit_form_action() {
 	function bp_get_the_profile_group_edit_form_action() {
 		global $bp, $group;
 
-		return apply_filters( 'bp_get_the_profile_group_edit_form_action', trailingslashit( $bp->displayed_user->domain . $bp->profile->slug . '/edit/group/' . $group->id ) );
+		return apply_filters( 'bp_get_the_profile_group_edit_form_action', trailingslashit( bp_displayed_user_domain() . $bp->profile->slug . '/edit/group/' . $group->id ) );
 	}
 
 function bp_the_profile_group_field_ids() {
@@ -331,8 +340,13 @@ function bp_the_profile_field_edit_value() {
 		 * Check to see if the posted value is different, if it is re-display this
 		 * value as long as it's not empty and a required field.
 		 */
-		if ( !isset( $field->data->value ) )
+		if ( !isset( $field->data ) ) {
+			$field->data = new stdClass;
+		}
+
+		if ( !isset( $field->data->value ) ) {
 			$field->data->value = '';
+		}
 
 		if ( isset( $_POST['field_' . $field->id] ) && $field->data->value != $_POST['field_' . $field->id] ) {
 			if ( !empty( $_POST['field_' . $field->id] ) )
@@ -410,15 +424,31 @@ function bp_the_profile_field_options( $args = '' ) {
 	function bp_get_the_profile_field_options( $args = '' ) {
 		global $field;
 
+		// Generally a required dropdown field will not get a blank value at
+		// the top. Set 'null_on_required' to true if you want this blank value
+		// even on required fields.
 		$defaults = array(
-			'type' => false
+			'type' 		       => false,
+			'null_on_required' => false
 		);
 
 		$r = wp_parse_args( $args, $defaults );
 		extract( $r, EXTR_SKIP );
 
-		if ( !method_exists( $field, 'get_children' ) )
-			$field = new BP_XProfile_Field( $field->id );
+		// In some cases, the $field global is not an instantiation of the BP_XProfile_Field
+		// class. However, we have to make sure that all data originally in $field gets
+		// merged back in, after reinstantiation.
+		if ( !method_exists( $field, 'get_children' ) ) {
+			$field_obj = new BP_XProfile_Field( $field->id );
+
+			foreach( $field as $field_prop => $field_prop_value ) {
+				if ( !isset( $field_obj->{$field_prop} ) ) {
+					$field_obj->{$field_prop} = $field_prop_value;
+				}
+			}
+
+			$field = $field_obj;
+		}
 
 		$options = $field->get_children();
 
@@ -428,37 +458,45 @@ function bp_the_profile_field_options( $args = '' ) {
 
 		switch ( $field->type ) {
 			case 'selectbox':
-				if ( !$field->is_required )
+
+				if ( !$field->is_required || $null_on_required ) {
 					$html .= '<option value="">' . /* translators: no option picked in select box */ __( '----', 'buddypress' ) . '</option>';
+				}
 
 				$original_option_values = '';
 				$original_option_values = maybe_unserialize( BP_XProfile_ProfileData::get_value_byid( $field->id ) );
 
-				if ( empty( $original_option_values ) && !empty( $_POST['field_' . $field->id] ) )
+				if ( empty( $original_option_values ) && !empty( $_POST['field_' . $field->id] ) ) {
 					$original_option_values = $_POST['field_' . $field->id];
+				}
 
 				$option_values = (array) $original_option_values;
 
 				for ( $k = 0, $count = count( $options ); $k < $count; ++$k ) {
+
 					// Check for updated posted values, but errors preventing them from being saved first time
 					foreach( $option_values as $i => $option_value ) {
 						if ( isset( $_POST['field_' . $field->id] ) && $_POST['field_' . $field->id] != $option_value ) {
-							if ( !empty( $_POST['field_' . $field->id] ) )
+							if ( !empty( $_POST['field_' . $field->id] ) ) {
 								$option_values[$i] = $_POST['field_' . $field->id];
+							}
 						}
 					}
+
 					$selected = '';
 
 					// Run the allowed option name through the before_save filter, so we'll be sure to get a match
 					$allowed_options = xprofile_sanitize_data_value_before_save( $options[$k]->name, false, false );
 
 					// First, check to see whether the user-entered value matches
-					if ( in_array( $allowed_options, (array) $option_values ) )
+					if ( in_array( $allowed_options, (array) $option_values ) ) {
 						$selected = ' selected="selected"';
+					}
 
 					// Then, if the user has not provided a value, check for defaults
-					if ( !is_array( $original_option_values ) && empty( $option_values ) && $options[$k]->is_default_option )
+					if ( !is_array( $original_option_values ) && empty( $option_values ) && $options[$k]->is_default_option ) {
 						$selected = ' selected="selected"';
+					}
 
 					$html .= apply_filters( 'bp_get_the_profile_field_options_select', '<option' . $selected . ' value="' . esc_attr( stripslashes( $options[$k]->name ) ) . '">' . esc_attr( stripslashes( $options[$k]->name ) ) . '</option>', $options[$k], $field->id, $selected, $k );
 				}
@@ -468,17 +506,20 @@ function bp_the_profile_field_options( $args = '' ) {
 				$original_option_values = '';
 				$original_option_values = maybe_unserialize( BP_XProfile_ProfileData::get_value_byid( $field->id ) );
 
-				if ( empty( $original_option_values ) && !empty( $_POST['field_' . $field->id] ) )
+				if ( empty( $original_option_values ) && !empty( $_POST['field_' . $field->id] ) ) {
 					$original_option_values = $_POST['field_' . $field->id];
+				}
 
 				$option_values = (array) $original_option_values;
 
 				for ( $k = 0, $count = count( $options ); $k < $count; ++$k ) {
+
 					// Check for updated posted values, but errors preventing them from being saved first time
 					foreach( $option_values as $i => $option_value ) {
 						if ( isset( $_POST['field_' . $field->id] ) && $_POST['field_' . $field->id][$i] != $option_value ) {
-							if ( !empty( $_POST['field_' . $field->id][$i] ) )
+							if ( !empty( $_POST['field_' . $field->id][$i] ) ) {
 								$option_values[] = $_POST['field_' . $field->id][$i];
+							}
 						}
 					}
 					$selected = '';
@@ -487,12 +528,14 @@ function bp_the_profile_field_options( $args = '' ) {
 					$allowed_options = xprofile_sanitize_data_value_before_save( $options[$k]->name, false, false );
 
 					// First, check to see whether the user-entered value matches
-					if ( in_array( $allowed_options, (array) $option_values ) )
+					if ( in_array( $allowed_options, (array) $option_values ) ) {
 						$selected = ' selected="selected"';
+					}
 
 					// Then, if the user has not provided a value, check for defaults
-					if ( !is_array( $original_option_values ) && empty( $option_values ) && $options[$k]->is_default_option )
+					if ( !is_array( $original_option_values ) && empty( $option_values ) && !empty( $options[$k]->is_default_option ) ) {
 						$selected = ' selected="selected"';
+					}
 
 					$html .= apply_filters( 'bp_get_the_profile_field_options_multiselect', '<option' . $selected . ' value="' . esc_attr( stripslashes( $options[$k]->name ) ) . '">' . esc_attr( stripslashes( $options[$k]->name ) ) . '</option>', $options[$k], $field->id, $selected, $k );
 				}
@@ -503,18 +546,21 @@ function bp_the_profile_field_options( $args = '' ) {
 				$option_value = BP_XProfile_ProfileData::get_value_byid( $field->id );
 
 				for ( $k = 0, $count = count( $options ); $k < $count; ++$k ) {
+
 					// Check for updated posted values, but errors preventing them from being saved first time
 					if ( isset( $_POST['field_' . $field->id] ) && $option_value != $_POST['field_' . $field->id] ) {
-						if ( !empty( $_POST['field_' . $field->id] ) )
+						if ( !empty( $_POST['field_' . $field->id] ) ) {
 							$option_value = $_POST['field_' . $field->id];
+						}
 					}
 
 					// Run the allowed option name through the before_save
 					// filter, so we'll be sure to get a match
 					$allowed_options = xprofile_sanitize_data_value_before_save( $options[$k]->name, false, false );
+					$selected        = '';
 
-					$selected = '';
-					if ( $option_value == $allowed_options || !empty( $value ) && $value == $allowed_options || ( empty( $option_value ) && $options[$k]->is_default_option ) )
+					// @todo $value is never created
+					if ( $option_value == $allowed_options || !empty( $value ) && $value == $allowed_options || ( empty( $option_value ) && !empty( $options[$k]->is_default_option ) ) )
 						$selected = ' checked="checked"';
 
 					$html .= apply_filters( 'bp_get_the_profile_field_options_radio', '<label><input' . $selected . ' type="radio" name="field_' . $field->id . '" id="option_' . $options[$k]->id . '" value="' . esc_attr( stripslashes( $options[$k]->name ) ) . '"> ' . esc_attr( stripslashes( $options[$k]->name ) ) . '</label>', $options[$k], $field->id, $selected, $k );
@@ -525,7 +571,7 @@ function bp_the_profile_field_options( $args = '' ) {
 
 			case 'checkbox':
 				$option_values = BP_XProfile_ProfileData::get_value_byid( $field->id );
-				$option_values = maybe_unserialize( $option_values );
+				$option_values = (array) maybe_unserialize( $option_values );
 
 				// Check for updated posted values, but errors preventing them from being saved first time
 				if ( isset( $_POST['field_' . $field->id] ) && $option_values != maybe_serialize( $_POST['field_' . $field->id] ) ) {
@@ -544,7 +590,8 @@ function bp_the_profile_field_options( $args = '' ) {
 						// before_save filter, so we'll be sure to get a match
 						$allowed_options = xprofile_sanitize_data_value_before_save( $options[$k]->name, false, false );
 
-						if ( $option_values[$j] == $allowed_options || @in_array( $allowed_options, $value ) ) {
+						// @todo $value is never created
+						if ( $option_values[$j] == $allowed_options || @in_array( $allowed_options, $option_values ) ) {
 							$selected = ' checked="checked"';
 							break;
 						}
@@ -552,7 +599,7 @@ function bp_the_profile_field_options( $args = '' ) {
 
 					// If the user has not yet supplied a value for this field,
 					// check to see whether there is a default value available
-					if ( !is_array( $option_values ) && empty( $option_values ) && !$selected && $options[$k]->is_default_option) {
+					if ( !is_array( $option_values ) && empty( $option_values ) && empty( $selected ) && !empty( $options[$k]->is_default_option ) ) {
 						$selected = ' checked="checked"';
 					}
 
@@ -569,6 +616,7 @@ function bp_the_profile_field_options( $args = '' ) {
 				$year  = '';
 
 				if ( !empty( $date ) ) {
+
 					// If Unix timestamp
 					if ( is_numeric( $date ) ) {
 						$day   = date( 'j', $date );
@@ -583,22 +631,27 @@ function bp_the_profile_field_options( $args = '' ) {
 					}
 				}
 
-				// Check for updated posted values, but errors preventing them from being saved first time
+				// Check for updated posted values, and errors preventing
+				// them from being saved first time.
 				if ( !empty( $_POST['field_' . $field->id . '_day'] ) ) {
-					if ( $day != $_POST['field_' . $field->id . '_day'] )
+					if ( $day != $_POST['field_' . $field->id . '_day'] ) {
 						$day = $_POST['field_' . $field->id . '_day'];
+					}
 				}
 
 				if ( !empty( $_POST['field_' . $field->id . '_month'] ) ) {
-					if ( $month != $_POST['field_' . $field->id . '_month'] )
+					if ( $month != $_POST['field_' . $field->id . '_month'] ) {
 						$month = $_POST['field_' . $field->id . '_month'];
+					}
 				}
 
 				if ( !empty( $_POST['field_' . $field->id . '_year'] ) ) {
-					if ( $year != date( "j", $_POST['field_' . $field->id . '_year'] ) )
+					if ( $year != date( "j", $_POST['field_' . $field->id . '_year'] ) ) {
 						$year = $_POST['field_' . $field->id . '_year'];
+					}
 				}
 
+				// $type will be passed by calling function when needed
 				switch ( $type ) {
 					case 'day':
 						$html .= '<option value=""' . selected( $day, '', false ) . '>--</option>';
@@ -660,7 +713,7 @@ function bp_the_profile_field_is_required() {
 		$retval = false;
 
 		// Super admins can skip required check
-		if ( is_super_admin() && !is_admin() )
+		if ( bp_current_user_can( 'bp_moderate' ) && !is_admin() )
 			$retval = false;
 
 		// All other users will use the field's setting
@@ -670,6 +723,42 @@ function bp_the_profile_field_is_required() {
 		return apply_filters( 'bp_get_the_profile_field_is_required', (bool) $retval );
 	}
 
+/**
+ * Echo the visibility level of this field
+ */
+function bp_the_profile_field_visibility_level() {
+	echo bp_get_the_profile_field_visibility_level();
+}
+	/**
+	 * Return the visibility level of this field
+	 */
+	function bp_get_the_profile_field_visibility_level() {
+		global $field;
+
+		$retval = !empty( $field->visibility_level ) ? $field->visibility_level : 'public';
+
+		return apply_filters( 'bp_get_the_profile_field_visibility_level', $retval );
+	}
+
+/**
+ * Echo the visibility level label of this field
+ */
+function bp_the_profile_field_visibility_level_label() {
+	echo bp_get_the_profile_field_visibility_level_label();
+}
+	/**
+	 * Return the visibility level label of this field
+	 */
+	function bp_get_the_profile_field_visibility_level_label() {
+		global $field;
+
+		$level  = !empty( $field->visibility_level ) ? $field->visibility_level : 'public';
+		$fields = bp_xprofile_get_visibility_levels();
+
+		return apply_filters( 'bp_get_the_profile_field_visibility_level_label', $fields[$level]['label'] );
+	}
+
+
 function bp_unserialize_profile_field( $value ) {
 	if ( is_serialized($value) ) {
 		$field_value = maybe_unserialize($value);
@@ -684,11 +773,10 @@ function bp_profile_field_data( $args = '' ) {
 	echo bp_get_profile_field_data( $args );
 }
 	function bp_get_profile_field_data( $args = '' ) {
-		global $bp;
 
 		$defaults = array(
 			'field'   => false, // Field name or ID.
-			'user_id' => $bp->displayed_user->id
+			'user_id' => bp_displayed_user_id()
 		);
 
 		$r = wp_parse_args( $args, $defaults );
@@ -716,7 +804,7 @@ function bp_profile_group_tabs() {
 			$selected = '';
 
 		if ( !empty( $groups[$i]->fields ) ) {
-			$link = $bp->displayed_user->domain . $bp->profile->slug . '/edit/group/' . $groups[$i]->id;
+			$link = trailingslashit( bp_displayed_user_domain() . $bp->profile->slug . '/edit/group/' . $groups[$i]->id );
 			$tabs[] = sprintf( '<li %1$s><a href="%2$s">%3$s</a></li>', $selected, $link, esc_html( $groups[$i]->name ) );
 		}
 	}
@@ -753,14 +841,13 @@ function bp_profile_group_name( $deprecated = true ) {
 function bp_avatar_upload_form() {
 	global $bp;
 
-	if ( !(int)$bp->site_options['bp-disable-avatar-uploads'] )
-		bp_core_avatar_admin( null, $bp->loggedin_user->domain . $bp->profile->slug . '/change-avatar/', $bp->loggedin_user->domain . $bp->profile->slug . '/delete-avatar/' );
+	if ( !(int) $bp->site_options['bp-disable-avatar-uploads'] )
+		bp_core_avatar_admin( null, bp_loggedin_user_domain() . $bp->profile->slug . '/change-avatar/', bp_loggedin_user_domain() . $bp->profile->slug . '/delete-avatar/' );
 	else
 		_e( 'Avatar uploads are currently disabled. Why not use a <a href="http://gravatar.com" target="_blank">gravatar</a> instead?', 'buddypress' );
 }
 
 function bp_profile_last_updated() {
-	global $bp;
 
 	$last_updated = bp_get_profile_last_updated();
 
@@ -771,9 +858,8 @@ function bp_profile_last_updated() {
 	}
 }
 	function bp_get_profile_last_updated() {
-		global $bp;
 
-		$last_updated = bp_get_user_meta( $bp->displayed_user->id, 'profile_last_updated', true );
+		$last_updated = bp_get_user_meta( bp_displayed_user_id(), 'profile_last_updated', true );
 
 		if ( $last_updated )
 			return apply_filters( 'bp_get_profile_last_updated', sprintf( __('Profile updated %s', 'buddypress'), bp_core_time_since( strtotime( $last_updated ) ) ) );
@@ -797,18 +883,9 @@ function bp_avatar_delete_link() {
 	function bp_get_avatar_delete_link() {
 		global $bp;
 
-		return apply_filters( 'bp_get_avatar_delete_link', wp_nonce_url( $bp->displayed_user->domain . $bp->profile->slug . '/change-avatar/delete-avatar/', 'bp_delete_avatar_link' ) );
+		return apply_filters( 'bp_get_avatar_delete_link', wp_nonce_url( bp_displayed_user_domain() . $bp->profile->slug . '/change-avatar/delete-avatar/', 'bp_delete_avatar_link' ) );
 	}
 
-function bp_get_user_has_avatar() {
-	global $bp;
-
-	if ( !bp_core_fetch_avatar( array( 'item_id' => $bp->displayed_user->id, 'no_grav' => true ) ) )
-		return false;
-
-	return true;
-}
-
 function bp_edit_profile_button() {
 	global $bp;
 
@@ -817,10 +894,33 @@ function bp_edit_profile_button() {
 		'component'         => 'xprofile',
 		'must_be_logged_in' => true,
 		'block_self'        => true,
-		'link_href'         => trailingslashit( $bp->displayed_user->domain . $bp->profile->slug . '/edit' ),
+		'link_href'         => trailingslashit( bp_displayed_user_domain() . $bp->profile->slug . '/edit' ),
 		'link_class'        => 'edit',
 		'link_text'         => __( 'Edit Profile', 'buddypress' ),
 		'link_title'        => __( 'Edit Profile', 'buddypress' ),
 	) );
 }
-?>
\ No newline at end of file
+
+/**
+ * Echo the field visibility radio buttons
+ */
+function bp_profile_visibility_radio_buttons() {
+	echo bp_profile_get_visibility_radio_buttons();
+}
+	/**
+	 * Return the field visibility radio buttons
+	 */
+	function bp_profile_get_visibility_radio_buttons() {
+		$html = '<ul class="radio">';
+
+		foreach( bp_xprofile_get_visibility_levels() as $level ) {
+			$checked = $level['id'] == bp_get_the_profile_field_visibility_level() ? ' checked="checked" ' : '';
+
+			$html .= '<li><label for="see-field_' . esc_attr( $level['id'] ) . '"><input type="radio" id="see-field_' . esc_attr( $level['id'] ) . '" name="field_' . bp_get_the_profile_field_id() . '_visibility" value="' . esc_attr( $level['id'] ) . '"' . $checked . ' /> ' . esc_html( $level['label'] ) . '</label></li>';
+		}
+
+		$html .= '</ul>';
+
+		return apply_filters( 'bp_profile_get_visibility_radio_buttons', $html );
+	}
+?>
diff --git a/wp-content/plugins/buddypress/humans.txt b/wp-content/plugins/buddypress/humans.txt
index 390b2a2be46a1fbec4a77b954732aa5f66b23802..3485e8c6488914e4c45c6f452f790feb35b5ed4d 100644
--- a/wp-content/plugins/buddypress/humans.txt
+++ b/wp-content/plugins/buddypress/humans.txt
@@ -47,7 +47,7 @@ Twitter: pgibbs
 Favourite Food: Pizza
 
 /* THANKS */
-r-a-y, hnla, mercime, modemlooper, cnorris23
+r-a-y, hnla, mercime, modemlooper, cnorris23, karmatosed
 
 /* META */
 Updated: 2011/08/29
diff --git a/wp-content/plugins/buddypress/license.txt b/wp-content/plugins/buddypress/license.txt
index b5fcfa6e7a5343eec02d2d25805773efbdf65121..888220587e12015cf35eb05c5d54fd341d11d4cb 100644
--- a/wp-content/plugins/buddypress/license.txt
+++ b/wp-content/plugins/buddypress/license.txt
@@ -1,280 +1,280 @@
-		    GNU GENERAL PUBLIC LICENSE
-		       Version 2, June 1991
-
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.
-                          675 Mass Ave, Cambridge, MA 02139, USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
-			    Preamble
-
-  The licenses for most software are designed to take away your
-freedom to share and change it.  By contrast, the GNU General Public
-License is intended to guarantee your freedom to share and change free
-software--to make sure the software is free for all its users.  This
-General Public License applies to most of the Free Software
-Foundation's software and to any other program whose authors commit to
-using it.  (Some other Free Software Foundation software is covered by
-the GNU Library General Public License instead.)  You can apply it to
-your programs, too.
-
-  When we speak of free software, we are referring to freedom, not
-price.  Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-this service if you wish), that you receive source code or can get it
-if you want it, that you can change the software or use pieces of it
-in new free programs; and that you know you can do these things.
-
-  To protect your rights, we need to make restrictions that forbid
-anyone to deny you these rights or to ask you to surrender the rights.
-These restrictions translate to certain responsibilities for you if you
-distribute copies of the software, or if you modify it.
-
-  For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must give the recipients all the rights that
-you have.  You must make sure that they, too, receive or can get the
-source code.  And you must show them these terms so they know their
-rights.
-
-  We protect your rights with two steps: (1) copyright the software, and
-(2) offer you this license which gives you legal permission to copy,
-distribute and/or modify the software.
-
-  Also, for each author's protection and ours, we want to make certain
-that everyone understands that there is no warranty for this free
-software.  If the software is modified by someone else and passed on, we
-want its recipients to know that what they have is not the original, so
-that any problems introduced by others will not reflect on the original
-authors' reputations.
-
-  Finally, any free program is threatened constantly by software
-patents.  We wish to avoid the danger that redistributors of a free
-program will individually obtain patent licenses, in effect making the
-program proprietary.  To prevent this, we have made it clear that any
-patent must be licensed for everyone's free use or not licensed at all.
-
-  The precise terms and conditions for copying, distribution and
-modification follow.
-
-		    GNU GENERAL PUBLIC LICENSE
-   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
-  0. This License applies to any program or other work which contains
-a notice placed by the copyright holder saying it may be distributed
-under the terms of this General Public License.  The "Program", below,
-refers to any such program or work, and a "work based on the Program"
-means either the Program or any derivative work under copyright law:
-that is to say, a work containing the Program or a portion of it,
-either verbatim or with modifications and/or translated into another
-language.  (Hereinafter, translation is included without limitation in
-the term "modification".)  Each licensee is addressed as "you".
-
-Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope.  The act of
-running the Program is not restricted, and the output from the Program
-is covered only if its contents constitute a work based on the
-Program (independent of having been made by running the Program).
-Whether that is true depends on what the Program does.
-
-  1. You may copy and distribute verbatim copies of the Program's
-source code as you receive it, in any medium, provided that you
-conspicuously and appropriately publish on each copy an appropriate
-copyright notice and disclaimer of warranty; keep intact all the
-notices that refer to this License and to the absence of any warranty;
-and give any other recipients of the Program a copy of this License
-along with the Program.
-
-You may charge a fee for the physical act of transferring a copy, and
-you may at your option offer warranty protection in exchange for a fee.
-
-  2. You may modify your copy or copies of the Program or any portion
-of it, thus forming a work based on the Program, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
-    a) You must cause the modified files to carry prominent notices
-    stating that you changed the files and the date of any change.
-
-    b) You must cause any work that you distribute or publish, that in
-    whole or in part contains or is derived from the Program or any
-    part thereof, to be licensed as a whole at no charge to all third
-    parties under the terms of this License.
-
-    c) If the modified program normally reads commands interactively
-    when run, you must cause it, when started running for such
-    interactive use in the most ordinary way, to print or display an
-    announcement including an appropriate copyright notice and a
-    notice that there is no warranty (or else, saying that you provide
-    a warranty) and that users may redistribute the program under
-    these conditions, and telling the user how to view a copy of this
-    License.  (Exception: if the Program itself is interactive but
-    does not normally print such an announcement, your work based on
-    the Program is not required to print an announcement.)
-
-These requirements apply to the modified work as a whole.  If
-identifiable sections of that work are not derived from the Program,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works.  But when you
-distribute the same sections as part of a whole which is a work based
-on the Program, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote it.
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Program.
-
-In addition, mere aggregation of another work not based on the Program
-with the Program (or with a work based on the Program) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
-  3. You may copy and distribute the Program (or a work based on it,
-under Section 2) in object code or executable form under the terms of
-Sections 1 and 2 above provided that you also do one of the following:
-
-    a) Accompany it with the complete corresponding machine-readable
-    source code, which must be distributed under the terms of Sections
-    1 and 2 above on a medium customarily used for software interchange; or,
-
-    b) Accompany it with a written offer, valid for at least three
-    years, to give any third party, for a charge no more than your
-    cost of physically performing source distribution, a complete
-    machine-readable copy of the corresponding source code, to be
-    distributed under the terms of Sections 1 and 2 above on a medium
-    customarily used for software interchange; or,
-
-    c) Accompany it with the information you received as to the offer
-    to distribute corresponding source code.  (This alternative is
-    allowed only for noncommercial distribution and only if you
-    received the program in object code or executable form with such
-    an offer, in accord with Subsection b above.)
-
-The source code for a work means the preferred form of the work for
-making modifications to it.  For an executable work, complete source
-code means all the source code for all modules it contains, plus any
-associated interface definition files, plus the scripts used to
-control compilation and installation of the executable.  However, as a
-special exception, the source code distributed need not include
-anything that is normally distributed (in either source or binary
-form) with the major components (compiler, kernel, and so on) of the
-operating system on which the executable runs, unless that component
-itself accompanies the executable.
-
-If distribution of executable or object code is made by offering
-access to copy from a designated place, then offering equivalent
-access to copy the source code from the same place counts as
-distribution of the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
-  4. You may not copy, modify, sublicense, or distribute the Program
-except as expressly provided under this License.  Any attempt
-otherwise to copy, modify, sublicense or distribute the Program is
-void, and will automatically terminate your rights under this License.
-However, parties who have received copies, or rights, from you under
-this License will not have their licenses terminated so long as such
-parties remain in full compliance.
-
-  5. You are not required to accept this License, since you have not
-signed it.  However, nothing else grants you permission to modify or
-distribute the Program or its derivative works.  These actions are
-prohibited by law if you do not accept this License.  Therefore, by
-modifying or distributing the Program (or any work based on the
-Program), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Program or works based on it.
-
-  6. Each time you redistribute the Program (or any work based on the
-Program), the recipient automatically receives a license from the
-original licensor to copy, distribute or modify the Program subject to
-these terms and conditions.  You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties to
-this License.
-
-  7. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License.  If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Program at all.  For example, if a patent
-license would not permit royalty-free redistribution of the Program by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Program.
-
-If any portion of this section is held invalid or unenforceable under
-any particular circumstance, the balance of the section is intended to
-apply and the section as a whole is intended to apply in other
-circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system, which is
-implemented by public license practices.  Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-
-  8. If the distribution and/or use of the Program is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Program under this License
-may add an explicit geographical distribution limitation excluding
-those countries, so that distribution is permitted only in or among
-countries not thus excluded.  In such case, this License incorporates
-the limitation as if written in the body of this License.
-
-  9. The Free Software Foundation may publish revised and/or new versions
-of the General Public License from time to time.  Such new versions will
-be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
-Each version is given a distinguishing version number.  If the Program
-specifies a version number of this License which applies to it and "any
-later version", you have the option of following the terms and conditions
-either of that version or of any later version published by the Free
-Software Foundation.  If the Program does not specify a version number of
-this License, you may choose any version ever published by the Free Software
-Foundation.
-
-  10. If you wish to incorporate parts of the Program into other free
-programs whose distribution conditions are different, write to the author
-to ask for permission.  For software which is copyrighted by the Free
-Software Foundation, write to the Free Software Foundation; we sometimes
-make exceptions for this.  Our decision will be guided by the two goals
-of preserving the free status of all derivatives of our free software and
-of promoting the sharing and reuse of software generally.
-
-			    NO WARRANTY
-
-  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
-FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
-OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
-PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
-OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
-TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
-PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
-REPAIR OR CORRECTION.
-
-  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
-REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
-INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
-OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
-TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
-YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
-PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGES.
-
-		     END OF TERMS AND CONDITIONS
-
+		    GNU GENERAL PUBLIC LICENSE
+		       Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+                          675 Mass Ave, Cambridge, MA 02139, USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+			    Preamble
+
+  The licenses for most software are designed to take away your
+freedom to share and change it.  By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users.  This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it.  (Some other Free Software Foundation software is covered by
+the GNU Library General Public License instead.)  You can apply it to
+your programs, too.
+
+  When we speak of free software, we are referring to freedom, not
+price.  Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+  To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+  For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have.  You must make sure that they, too, receive or can get the
+source code.  And you must show them these terms so they know their
+rights.
+
+  We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+  Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software.  If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+  Finally, any free program is threatened constantly by software
+patents.  We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary.  To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.
+
+		    GNU GENERAL PUBLIC LICENSE
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+  0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License.  The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language.  (Hereinafter, translation is included without limitation in
+the term "modification".)  Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope.  The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+  1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+  2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+    a) You must cause the modified files to carry prominent notices
+    stating that you changed the files and the date of any change.
+
+    b) You must cause any work that you distribute or publish, that in
+    whole or in part contains or is derived from the Program or any
+    part thereof, to be licensed as a whole at no charge to all third
+    parties under the terms of this License.
+
+    c) If the modified program normally reads commands interactively
+    when run, you must cause it, when started running for such
+    interactive use in the most ordinary way, to print or display an
+    announcement including an appropriate copyright notice and a
+    notice that there is no warranty (or else, saying that you provide
+    a warranty) and that users may redistribute the program under
+    these conditions, and telling the user how to view a copy of this
+    License.  (Exception: if the Program itself is interactive but
+    does not normally print such an announcement, your work based on
+    the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole.  If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works.  But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+  3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+    a) Accompany it with the complete corresponding machine-readable
+    source code, which must be distributed under the terms of Sections
+    1 and 2 above on a medium customarily used for software interchange; or,
+
+    b) Accompany it with a written offer, valid for at least three
+    years, to give any third party, for a charge no more than your
+    cost of physically performing source distribution, a complete
+    machine-readable copy of the corresponding source code, to be
+    distributed under the terms of Sections 1 and 2 above on a medium
+    customarily used for software interchange; or,
+
+    c) Accompany it with the information you received as to the offer
+    to distribute corresponding source code.  (This alternative is
+    allowed only for noncommercial distribution and only if you
+    received the program in object code or executable form with such
+    an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it.  For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable.  However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+  4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License.  Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+  5. You are not required to accept this License, since you have not
+signed it.  However, nothing else grants you permission to modify or
+distribute the Program or its derivative works.  These actions are
+prohibited by law if you do not accept this License.  Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+  6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions.  You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+  7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all.  For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices.  Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+  8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded.  In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+  9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time.  Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number.  If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation.  If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+  10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission.  For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this.  Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+			    NO WARRANTY
+
+  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+		     END OF TERMS AND CONDITIONS
+
diff --git a/wp-content/plugins/buddypress/readme.txt b/wp-content/plugins/buddypress/readme.txt
index 723676f92cd69d98de3e71cb92739fa1a11124d6..ddf52884ac244eafd8a0b49108ca3317a756c397 100644
--- a/wp-content/plugins/buddypress/readme.txt
+++ b/wp-content/plugins/buddypress/readme.txt
@@ -1,117 +1,114 @@
-=== Plugin Name ===
-Contributors: apeatling, johnjamesjacoby, MrMaz, DJPaul, boonebgorges
-Tags: buddypress, social networking, activity, profiles, messaging, friends, groups, forums, microblogging, twitter, facebook, social, community, networks, networking, cms
-Requires at least: 3.3
-Tested up to: 3.3
-Stable tag: 1.5.3.1
-
-Social networking in a box. Build a social network for your company, school, sports team or niche community.
-
-== Description ==
-
-BuddyPress lets users register on your site and start creating profiles, posting messages, making connections, creating and interacting in groups and much more. A social network in a box, BuddyPress lets you build a social network for your company, school, sports team or niche community.
-
-<h4>Try the Demo</h4>
-
-If you're interested in seeing what a default installation of BuddyPress has to offer, try out the BuddyPress Test Drive! This site is a community of BuddyPress users looking to try out and discuss the latest features of BuddyPress.
-
-<a href="http://testbp.org/">BuddyPress Test Drive</a>
-
-<h4>Who's Using BuddyPress?</h4>
-
-More and more BuddyPress powered sites are popping up. You can take a look at some of the best sites on the <a href="http://buddypress.org/showcase/">BuddyPress Showcase</a>.
-
-<h4>Plugins: Adding So Much More</h4>
-
-BuddyPress boasts an ever growing array of new features developed by an awesome plugin development community. There are more than 330 BuddyPress plugins available, and the list is growing every day. Check out our list of <a href="http://buddypress.org/extend/recommended-plugins/">popular and recommended plugins</a>; for a full list of plugins, please visit the <a href="http://buddypress.org/extend/plugins/">BuddyPress.org plugins page</a>. You can install any of these plugins automatically, using the plugin installer on your WordPress Dashboard.
-
-<h4>More Information</h4>
-
-Visit the <a href="http://buddypress.org/">BuddyPress website</a> for more information about BuddyPress.
-
-== Installation ==
-
-You can download and install BuddyPress using the built in WordPress plugin installer. If you download BuddyPress manually, make sure it is uploaded to "/wp-content/plugins/buddypress/".
-
-Activate BuddyPress in the "Plugins" admin panel using the "Activate" link. You'll then see a message asking you to complete the BuddyPress Installation Wizard, which will guide you through configuring your site for BuddyPress.
-
---- Discussion Forums ---
-
-BuddyPress includes full support for discussion forums. Each group created on your site can have its own forum. If you'd like to enable this feature, after completing the Installation Wizard, visit the "Forums Setup" item under the "BuddyPress" menu in your WordPress admin area, and follow the on-screen instructions.
-
-== Frequently Asked Questions ==
-
-= Can I use my existing WordPress theme? =
-
-Of course! Once you've installed and activated BuddyPress, the Installation Wizard will guide you through the available theme options. You'll be given the option of installing the <a href="http://wordpress.org/extend/plugins/bp-template-pack/">BuddyPress Template Pack</a>, which will help you add BuddyPress compatibility to your existing theme.
-
-Be sure to also try out the default theme bundled with BuddyPress. It provides all the awesome features of a standard WordPress blog, but also integrates BuddyPress's features in a seamless and beautiful way. The BuddyPress Default theme is a snap to customize, with full support for custom headers and backgrounds and multiple widget areas. It also makes a great starting point for your own  <a href="http://codex.buddypress.org/how-to-guides/building-a-buddypress-child-theme/">child theme</a>.
-
-= Will this work on WordPress multisite? =
-
-Yes! If your WordPress site has multisite enabled, BuddyPress will support the global tracking of blogs, posts and comments.
-
-= Where can I get support? =
-
-The support forums can be found at <a href="http://buddypress.org/forums/">http://buddypress.org/forums/</a>.
-
-= Where can I find documentation? =
-
-The documentation codex can be found at <a href="http://codex.buddypress.org/">http://codex.buddypress.org/</a>.
-
-= Where can I report a bug? =
-
-Report bugs and participate in development at <a href="http://buddypress.trac.wordpress.org/">http://buddypress.trac.wordpress.org</a>.
-
-= Where can I get the bleeding edge version of BuddyPress? =
-
-Check out the development trunk of BuddyPress via Subversion, from <a href="http://buddypress.svn.wordpress.org/trunk/">http://buddypress.svn.wordpress.org/trunk/</a>
-
-== Screenshots ==
-
-1. **Activity Streams** - Global, personal and group activity streams with threaded commenting, direct posting, favoriting and @mentions. All with full RSS feeds and email notification support.
-2. **Extended Profiles** - Fully editable rofile fields allow you to define the fields users can fill in to describe themselves. Tailor profile fields to suit your audience.
-3. **Extensible Groups** - Powerful public, private or hidden groups allow your users to break the discussion down into specific topics. Extend groups with your own custom features using the group extension API.
-4. **Friend Connections** - Let your users make connections so they can track the activity of others, or filter on only those users they care about the most.
-5. **Private Messaging** - Private messaging will allow your users to talk to each other directly and in private. Not just limited to one-on-one discussions, your users can send messages to multiple recipients.
-6. **Discussion Forums** - Full powered discussion forums built directly into groups allow for more conventional in-depth conversations.
-7. **WordPress Blogging** - Allow your users to start their own WordPress sites (using WordPress's Multisite feature), and track posts and comments from across your blog network in the activity stream.
-8. **User Settings** - Give your users complete control over profile and notification settings. Settings are fully integrated into your theme, and can be disabled by the administrator.
-
-== Languages ==
-
-BuddyPress is available in more than 20 languages. For more information, check out the <a href="http://codex.buddypress.org/getting-started/translations/">translation page</a> on the BuddyPress Codex.
-
-== Upgrade Notice ==
-
-= 1.5.3.1 =
-* Fixes bug related to password changes
-* See http://codex.buddypress.org/releases/version-1-5-3-1/
-
-= 1.5.3 =
-* Fixes 6 minor bugs/notices
-* See http://codex.buddypress.org/releases/version-1-5-3/
-
-= 1.5.2 =
-* Compatibility with WordPress 3.3
-* Fixes 10 minor bugs/notices
-
-= 1.5.1 =
-* Fixes over 25 issues
-
-= 1.5 =
-See: http://codex.buddypress.org/releases/version-1-5/
-
-= 1.2.9 =
-* Compatibility with WordPress 3.2
-
-= 1.2.8 =
-* Compatibility with WordPress 3.1
-
-= 1.2.7 =
-* Fixes over 10 bugs.
-
-== Changelog ==
-
-See http://codex.buddypress.org/releases/version-1-5/ for 1.5.
-See http://buddypress.org/about/release-history/ for all other versions.
+=== Plugin Name ===
+Contributors: johnjamesjacoby, DJPaul, boonebgorges
+Tags: buddypress, social networking, activity, profiles, messaging, friends, groups, forums, microblogging, twitter, facebook, social, community, networks, networking, cms
+Requires at least: 3.4
+Tested up to: 3.4.1
+Stable tag: 1.6.2
+License: GPLv2 or later
+License URI: http://www.gnu.org/licenses/gpl-2.0.html
+
+Social networking in a box. Build a social network for your company, school, sports team or niche community.
+
+== Description ==
+
+BuddyPress lets users sign-up and start creating profiles, posting messages, making connections, creating and interacting in groups, and much more. A social network in a box, BuddyPress lets you easily build a community for your company, school, sports team, or other niche community.
+
+<h4>Try the Demo</h4>
+
+If you're interested in seeing what a default installation of BuddyPress has to offer, try out the BuddyPress Test Drive! This site is a community of BuddyPress users looking to try out and discuss the latest features of BuddyPress.
+
+<a href="http://testbp.org/">BuddyPress Test Drive</a>
+
+<h4>Who's Using BuddyPress?</h4>
+
+Take a look at some of the best sites on the <a href="http://buddypress.org/showcase/">BuddyPress Showcase</a>.
+
+<h4>Plugins: Adding So Much More</h4>
+
+BuddyPress boasts an ever growing array of new features developed by an awesome plugin development community. There are more than 330 BuddyPress plugins available, and the list is growing every day. Check out our list of <a href="http://buddypress.org/extend/recommended-plugins/">popular and recommended plugins</a>; for a full list of plugins, please visit the <a href="http://buddypress.org/extend/plugins/">BuddyPress.org plugins page</a>. You can install any of these plugins automatically, using the plugin installer on your WordPress Dashboard.
+
+<h4>More Information</h4>
+
+Visit the <a href="http://buddypress.org/">BuddyPress website</a> for more information about BuddyPress.
+
+== Installation ==
+
+You can download and install BuddyPress using the built in WordPress plugin installer. If you download BuddyPress manually, make sure it is uploaded to "/wp-content/plugins/buddypress/".
+
+Activate BuddyPress in the "Plugins" admin panel using the "Activate" link. You'll then see a message asking you to complete the BuddyPress Installation Wizard, which will guide you through configuring your site for BuddyPress.
+
+--- Discussion Forums ---
+
+BuddyPress includes full support for discussion forums. Each group created on your site can have its own forum. If you'd like to enable this feature, after completing the Installation Wizard, visit the "Forums Setup" item under the "BuddyPress" menu in your WordPress admin-area, and follow the on-screen instructions.
+
+== Frequently Asked Questions ==
+
+= Can I use my existing WordPress theme? =
+
+Of course! Once you've installed and activated BuddyPress, the Installation Wizard will guide you through the available theme options. You'll be given the option of installing the <a href="http://wordpress.org/extend/plugins/bp-template-pack/">BuddyPress Template Pack</a>, which will help you add BuddyPress compatibility to your existing theme.
+
+Be sure to also try out the default theme bundled with BuddyPress. It provides all the awesome features of a standard WordPress blog, but also integrates BuddyPress's features in a seamless and beautiful way. The BuddyPress Default theme is a snap to customize, with full support for custom headers and backgrounds and multiple widget areas. It also makes a great starting point for your own <a href="http://codex.buddypress.org/how-to-guides/building-a-buddypress-child-theme/">child theme</a>.
+
+= Will this work on WordPress multisite? =
+
+Yes! If your WordPress installation has multisite enabled, BuddyPress will support the global tracking of blogs, posts and comments.
+
+= Where can I get support? =
+
+The support forums can be found at <a href="http://buddypress.org/forums/">http://buddypress.org/forums/</a>.
+
+= Where can I find documentation? =
+
+The documentation codex can be found at <a href="http://codex.buddypress.org/">http://codex.buddypress.org/</a>.
+
+= Where can I report a bug? =
+
+Report bugs and participate in development at <a href="http://buddypress.trac.wordpress.org/">http://buddypress.trac.wordpress.org</a>.
+
+= Where can I get the bleeding edge version of BuddyPress? =
+
+Check out the development trunk of BuddyPress via Subversion, from <a href="http://buddypress.svn.wordpress.org/trunk/">http://buddypress.svn.wordpress.org/trunk/</a>
+
+== Screenshots ==
+
+1. **Activity Streams** - Global, personal and group activity streams with threaded commenting, direct posting, favoriting and @mentions. All with full RSS feeds and email notification support.
+2. **Extended Profiles** - Fully editable profile fields allow you to define the fields users can fill in to describe themselves. Tailor profile fields to suit your audience.
+3. **Extensible Groups** - Powerful public, private or hidden groups allow your users to break the discussion down into specific topics. Extend groups with your own custom features using the group extension API.
+4. **Friend Connections** - Let your users make connections so they can track the activity of others, or filter on only those users they care about the most.
+5. **Private Messaging** - Private messaging will allow your users to talk to each other directly and in private. Not just limited to one-on-one discussions, your users can send messages to multiple recipients.
+6. **Discussion Forums** - Full powered discussion forums built directly into groups allow for more conventional in-depth conversations.
+7. **WordPress Blogging** - Allow your users to start their own blogs using WordPress's Multisite feature, and track posts and comments from across your blog network in the activity stream.
+8. **User Settings** - Give your users complete control over profile and notification settings. Settings are fully integrated into your theme, and can be disabled by the administrator.
+
+== Languages ==
+
+BuddyPress is available in more than 20 languages. For more information, check out the <a href="http://codex.buddypress.org/getting-started/translations/">translation page</a> on the BuddyPress Codex.
+
+== Upgrade Notice ==
+
+= 1.6.2 =
+Compatibility with WordPress 3.5
+
+= 1.6.1 =
+Fixes 4 bugs
+
+= 1.6 =
+See: http://codex.buddypress.org/releases/version-1-6/
+
+= 1.5 =
+See: http://codex.buddypress.org/releases/version-1-5/
+
+= 1.2.9 =
+Compatibility with WordPress 3.2
+
+= 1.2.8 =
+Compatibility with WordPress 3.1
+
+= 1.2.7 =
+Fixes over 10 bugs.
+
+== Changelog ==
+
+See http://codex.buddypress.org/releases/version-1-6/ for 1.6.
+See http://codex.buddypress.org/releases/version-1-5/ for 1.5.
+See http://buddypress.org/about/release-history/ for all other versions.