diff --git a/wp-content/plugins/buddypress/bp-activity/bp-activity-actions.php b/wp-content/plugins/buddypress/bp-activity/bp-activity-actions.php
new file mode 100644
index 0000000000000000000000000000000000000000..fa0e23e55c025a0a7bfc499157992632feefdd86
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-activity/bp-activity-actions.php
@@ -0,0 +1,530 @@
+<?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.
+ *
+ * @package BuddyPress
+ * @subpackage ActivityActions
+ */
+
+// Exit if accessed directly
+if ( !defined( 'ABSPATH' ) ) exit;
+
+/**
+ * Allow core components and dependent plugins to register activity actions
+ *
+ * @since 1.2.0
+ *
+ * @uses do_action() To call 'bp_register_activity_actions' hook.
+ */
+function bp_register_activity_actions() {
+	do_action( 'bp_register_activity_actions' );
+}
+add_action( 'bp_init', 'bp_register_activity_actions', 8 );
+
+/**
+ * Allow core components and dependent plugins to register activity actions
+ *
+ * @since 1.2.0
+ *
+ * @global object $bp BuddyPress global settings
+ * @uses bp_is_activity_component()
+ * @uses bp_is_current_action()
+ * @uses bp_action_variable()
+ * @uses bp_activity_get_specific()
+ * @uses bp_is_active()
+ * @uses bp_core_get_user_domain()
+ * @uses groups_get_group()
+ * @uses bp_get_group_permalink()
+ * @uses apply_filters_ref_array() To call the 'bp_activity_permalink_redirect_url' hook
+ * @uses bp_core_redirect()
+ * @uses bp_get_root_domain()
+ *
+ * @return bool False on failure
+ */
+function bp_activity_action_permalink_router() {
+	global $bp;
+
+	// Not viewing activity
+	if ( !bp_is_activity_component() || !bp_is_current_action( 'p' ) )
+		return false;
+
+	// No activity to display
+	if ( !bp_action_variable( 0 ) || !is_numeric( bp_action_variable( 0 ) ) )
+		return false;
+
+	// Get the activity details
+	$activity = bp_activity_get_specific( array( 'activity_ids' => bp_action_variable( 0 ), 'show_hidden' => true ) );
+
+	// 404 if activity does not exist
+	if ( empty( $activity['activities'][0] ) ) {
+		bp_do_404();
+		return;
+
+	} else {
+		$activity = $activity['activities'][0];
+	}
+
+	// Do not redirect at default
+	$redirect = false;
+
+	// Redirect based on the type of activity
+	if ( bp_is_active( 'groups' ) && $activity->component == $bp->groups->id ) {
+
+		// Activity is a user update
+		if ( !empty( $activity->user_id ) ) {
+			$redirect = bp_core_get_user_domain( $activity->user_id, $activity->user_nicename, $activity->user_login ) . bp_get_activity_slug() . '/' . $activity->id . '/';
+
+		// Activity is something else
+		} else {
+
+			// Set redirect to group activity stream
+			if ( $group = groups_get_group( array( 'group_id' => $activity->item_id ) ) ) {
+				$redirect = bp_get_group_permalink( $group ) . bp_get_activity_slug() . '/' . $activity->id . '/';
+			}
+		}
+
+	// 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;
+	}
+
+	// Allow redirect to be filtered
+	if ( !$redirect = apply_filters_ref_array( 'bp_activity_permalink_redirect_url', array( $redirect, &$activity ) ) )
+		bp_core_redirect( bp_get_root_domain() );
+
+	// Redirect to the actual activity permalink page
+	bp_core_redirect( $redirect );
+}
+add_action( 'bp_actions', 'bp_activity_action_permalink_router' );
+
+/**
+ * Delete specific activity item and redirect to previous page.
+ *
+ * @since 1.1.0
+ *
+ * @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()
+ * @uses check_admin_referer()
+ * @uses bp_activity_user_can_delete()
+ * @uses do_action() Calls 'bp_activity_before_action_delete_activity' hook to allow actions to be taken before the activity is deleted.
+ * @uses bp_activity_delete()
+ * @uses bp_core_add_message()
+ * @uses do_action() Calls 'bp_activity_action_delete_activity' hook to allow actions to be taken after the activity is deleted.
+ * @uses bp_core_redirect()
+ *
+ * @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' ) )
+		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;
+
+	// Check the nonce
+	check_admin_referer( 'bp_activity_delete_link' );
+
+	// Load up the activity item
+	$activity = new BP_Activity_Activity( $activity_id );
+
+	// Check access
+	if ( empty( $activity->user_id ) || !bp_activity_user_can_delete( $activity ) )
+		return false;
+
+	// 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 );
+
+	// Delete the activity item and provide user feedback
+	if ( bp_activity_delete( array( 'id' => $activity_id, 'user_id' => $activity->user_id ) ) )
+		bp_core_add_message( __( 'Activity deleted successfully', 'buddypress' ) );
+	else
+		bp_core_add_message( __( 'There was an error when deleting that activity', 'buddypress' ), 'error' );
+
+	do_action( 'bp_activity_action_delete_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_delete_activity' );
+
+/**
+ * Post user/group activity update.
+ *
+ * @since 1.2.0
+ *
+ * @global object $bp BuddyPress global settings
+ * @uses is_user_logged_in()
+ * @uses bp_is_activity_component()
+ * @uses bp_is_current_action()
+ * @uses check_admin_referer()
+ * @uses apply_filters() To call 'bp_activity_post_update_content' hook.
+ * @uses apply_filters() To call 'bp_activity_post_update_object' hook.
+ * @uses apply_filters() To call 'bp_activity_post_update_item_id' hook.
+ * @uses bp_core_add_message()
+ * @uses bp_core_redirect()
+ * @uses bp_activity_post_update()
+ * @uses groups_post_update()
+ * @uses bp_core_redirect()
+ * @uses apply_filters() To call 'bp_activity_custom_update' hook.
+ *
+ * @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' ) )
+		return false;
+
+	// Check the nonce
+	check_admin_referer( 'post_update', '_wpnonce_post_update' );
+
+	// Get activity info
+	$content = apply_filters( 'bp_activity_post_update_content', $_POST['whats-new']             );
+	$object  = apply_filters( 'bp_activity_post_update_object',  $_POST['whats-new-post-object'] );
+	$item_id = apply_filters( 'bp_activity_post_update_item_id', $_POST['whats-new-post-in']     );
+
+	// No activity content so provide feedback and redirect
+	if ( empty( $content ) ) {
+		bp_core_add_message( __( 'Please enter some content to post.', 'buddypress' ), 'error' );
+		bp_core_redirect( wp_get_referer() );
+	}
+
+	// No existing item_id
+	if ( empty( $item_id ) ) {
+		$activity_id = bp_activity_post_update( array( 'content' => $content ) );
+
+	// Post to groups object
+	} else if ( 'groups' == $object && bp_is_active( 'groups' ) ) {
+		if ( (int)$item_id ) {
+			$activity_id = groups_post_update( array( 'content' => $content, 'group_id' => $item_id ) );
+		}
+
+	// Special circumstance so let filters handle it
+	} else {
+		$activity_id = apply_filters( 'bp_activity_custom_update', $object, $item_id, $content );
+	}
+
+	// Provide user feedback
+	if ( !empty( $activity_id ) )
+		bp_core_add_message( __( 'Update Posted!', 'buddypress' ) );
+	else
+		bp_core_add_message( __( 'There was an error when posting your update, please try again.', 'buddypress' ), 'error' );
+
+	// Redirect
+	bp_core_redirect( wp_get_referer() );
+}
+add_action( 'bp_actions', 'bp_activity_action_post_update' );
+
+/**
+ * Post new activity comment.
+ *
+ * @since 1.2.0
+ *
+ * @global object $bp BuddyPress global settings
+ * @uses is_user_logged_in()
+ * @uses bp_is_activity_component()
+ * @uses bp_is_current_action()
+ * @uses check_admin_referer()
+ * @uses apply_filters() To call 'bp_activity_post_comment_activity_id' hook.
+ * @uses apply_filters() To call 'bp_activity_post_comment_content' hook.
+ * @uses bp_core_add_message()
+ * @uses bp_core_redirect()
+ * @uses bp_activity_new_comment()
+ * @uses wp_get_referer()
+ *
+ * @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' ) )
+		return false;
+
+	// Check the nonce
+	check_admin_referer( 'new_activity_comment', '_wpnonce_new_activity_comment' );
+
+	$activity_id = apply_filters( 'bp_activity_post_comment_activity_id', $_POST['comment_form_id'] );
+	$content = apply_filters( 'bp_activity_post_comment_content', $_POST['ac_input_' . $activity_id] );
+
+	if ( empty( $content ) ) {
+		bp_core_add_message( __( 'Please do not leave the comment area blank.', 'buddypress' ), 'error' );
+		bp_core_redirect( wp_get_referer() . '#ac-form-' . $activity_id );
+	}
+
+	$comment_id = bp_activity_new_comment( array(
+		'content' => $content,
+		'activity_id' => $activity_id,
+		'parent_id' => $parent_id
+	));
+
+	if ( !empty( $comment_id ) )
+		bp_core_add_message( __( 'Reply Posted!', 'buddypress' ) );
+	else
+		bp_core_add_message( __( 'There was an error posting that reply, please try again.', 'buddypress' ), 'error' );
+
+	bp_core_redirect( wp_get_referer() . '#ac-form-' . $activity_id );
+}
+add_action( 'bp_actions', 'bp_activity_action_post_comment' );
+
+/**
+ * Mark activity as favorite.
+ *
+ * @since 1.2.0
+ *
+ * @global object $bp BuddyPress global settings
+ * @uses is_user_logged_in()
+ * @uses bp_is_activity_component()
+ * @uses bp_is_current_action()
+ * @uses check_admin_referer()
+ * @uses bp_activity_add_user_favorite()
+ * @uses bp_action_variable()
+ * @uses bp_core_add_message()
+ * @uses bp_core_redirect()
+ * @uses wp_get_referer()
+ *
+ * @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' ) )
+		return false;
+
+	// Check the nonce
+	check_admin_referer( 'mark_favorite' );
+
+	if ( bp_activity_add_user_favorite( bp_action_variable( 0 ) ) )
+		bp_core_add_message( __( 'Activity marked as favorite.', 'buddypress' ) );
+	else
+		bp_core_add_message( __( 'There was an error marking that activity as a favorite, please try again.', 'buddypress' ), 'error' );
+
+	bp_core_redirect( wp_get_referer() . '#activity-' . bp_action_variable( 0 ) );
+}
+add_action( 'bp_actions', 'bp_activity_action_mark_favorite' );
+
+/**
+ * Remove activity from favorites.
+ *
+ * @since 1.2.0
+ *
+ * @global object $bp BuddyPress global settings
+ * @uses is_user_logged_in()
+ * @uses bp_is_activity_component()
+ * @uses bp_is_current_action()
+ * @uses check_admin_referer()
+ * @uses bp_activity_remove_user_favorite()
+ * @uses bp_action_variable()
+ * @uses bp_core_add_message()
+ * @uses bp_core_redirect()
+ * @uses wp_get_referer()
+ *
+ * @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' ) )
+		return false;
+
+	// Check the nonce
+	check_admin_referer( 'unmark_favorite' );
+
+	if ( bp_activity_remove_user_favorite( bp_action_variable( 0 ) ) )
+		bp_core_add_message( __( 'Activity removed as favorite.', 'buddypress' ) );
+	else
+		bp_core_add_message( __( 'There was an error removing that activity as a favorite, please try again.', 'buddypress' ), 'error' );
+
+	bp_core_redirect( wp_get_referer() . '#activity-' . bp_action_variable( 0 ) );
+}
+add_action( 'bp_actions', 'bp_activity_action_remove_favorite' );
+
+/**
+ * Load the sitewide feed.
+ *
+ * @since 1.0.0
+ *
+ * @global object $bp BuddyPress global settings
+ * @global object $wp_query
+ * @uses bp_is_activity_component()
+ * @uses bp_is_current_action()
+ * @uses bp_is_user()
+ * @uses status_header()
+ *
+ * @return bool False on failure
+ */
+function bp_activity_action_sitewide_feed() {
+	global $bp, $wp_query;
+
+	if ( !bp_is_activity_component() || !bp_is_current_action( 'feed' ) || bp_is_user() || !empty( $bp->groups->current_group ) )
+		return false;
+
+	$wp_query->is_404 = false;
+	status_header( 200 );
+
+	include_once( 'feeds/bp-activity-sitewide-feed.php' );
+	die;
+}
+add_action( 'bp_actions', 'bp_activity_action_sitewide_feed' );
+
+/**
+ * Load a user's personal feed.
+ *
+ * @since 1.0.0
+ *
+ * @global object $bp BuddyPress global settings
+ * @global object $wp_query
+ * @uses bp_is_user_activity()
+ * @uses bp_is_current_action()
+ * @uses status_header()
+ *
+ * @return bool False on failure
+ */
+function bp_activity_action_personal_feed() {
+	global $bp, $wp_query;
+
+	if ( !bp_is_user_activity() || !bp_is_current_action( 'feed' ) )
+		return false;
+
+	$wp_query->is_404 = false;
+	status_header( 200 );
+
+	include_once( 'feeds/bp-activity-personal-feed.php' );
+	die;
+}
+add_action( 'bp_actions', 'bp_activity_action_personal_feed' );
+
+/**
+ * Load a user's friends feed.
+ *
+ * @since 1.0.0
+ *
+ * @global object $bp BuddyPress global settings
+ * @global object $wp_query
+ * @uses bp_is_active()
+ * @uses bp_is_user_activity()
+ * @uses bp_is_current_action()
+ * @uses bp_get_friends_slug()
+ * @uses bp_is_action_variable()
+ * @uses status_header()
+ *
+ * @return bool False on failure
+ */
+function bp_activity_action_friends_feed() {
+	global $bp, $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;
+
+	$wp_query->is_404 = false;
+	status_header( 200 );
+
+	include_once( 'feeds/bp-activity-friends-feed.php' );
+	die;
+}
+add_action( 'bp_actions', 'bp_activity_action_friends_feed' );
+
+/**
+ * Load a user's my groups feed.
+ *
+ * @since 1.2.0
+ *
+ * @global object $bp BuddyPress global settings
+ * @global object $wp_query
+ * @uses bp_is_active()
+ * @uses bp_is_user_activity()
+ * @uses bp_is_current_action()
+ * @uses bp_get_groups_slug()
+ * @uses bp_is_action_variable()
+ * @uses status_header()
+ *
+ * @return bool False on failure
+ */
+function bp_activity_action_my_groups_feed() {
+	global $bp, $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;
+
+	$wp_query->is_404 = false;
+	status_header( 200 );
+
+	include_once( 'feeds/bp-activity-mygroups-feed.php' );
+	die;
+}
+add_action( 'bp_actions', 'bp_activity_action_my_groups_feed' );
+
+/**
+ * Load a user's @mentions feed.
+ *
+ * @since 1.2.0
+ *
+ * @global object $bp BuddyPress global settings
+ * @global object $wp_query
+ * @uses bp_is_user_activity()
+ * @uses bp_is_current_action()
+ * @uses bp_is_action_variable()
+ * @uses status_header()
+ *
+ * @return bool False on failure
+ */
+function bp_activity_action_mentions_feed() {
+	global $bp, $wp_query;
+
+	if ( !bp_is_user_activity() || !bp_is_current_action( 'mentions' ) || !bp_is_action_variable( 'feed', 0 ) )
+		return false;
+
+	$wp_query->is_404 = false;
+	status_header( 200 );
+
+	include_once( 'feeds/bp-activity-mentions-feed.php' );
+	die;
+}
+add_action( 'bp_actions', 'bp_activity_action_mentions_feed' );
+
+/**
+ * Load a user's favorites feed.
+ *
+ * @since 1.2.0
+ *
+ * @global object $bp BuddyPress global settings
+ * @global object $wp_query
+ * @uses bp_is_user_activity()
+ * @uses bp_is_current_action()
+ * @uses bp_is_action_variable()
+ * @uses status_header()
+ *
+ * @return bool False on failure
+ */
+function bp_activity_action_favorites_feed() {
+	global $bp, $wp_query;
+
+	if ( !bp_is_user_activity() || !bp_is_current_action( 'favorites' ) || !bp_is_action_variable( 'feed', 0 ) )
+		return false;
+
+	$wp_query->is_404 = false;
+	status_header( 200 );
+
+	include_once( 'feeds/bp-activity-favorites-feed.php' );
+	die;
+}
+add_action( 'bp_actions', 'bp_activity_action_favorites_feed' );
+
+?>
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 f8d3175f6e1b002980c6ad73669e46ac6cb543dd..bba59089efb5957082ade89fdba7a7f9ffe4e480 100644
--- a/wp-content/plugins/buddypress/bp-activity/bp-activity-classes.php
+++ b/wp-content/plugins/buddypress/bp-activity/bp-activity-classes.php
@@ -1,5 +1,15 @@
 <?php
 
+/**
+ * BuddyPress Activity Classes
+ *
+ * @package BuddyPress
+ * @subpackage ActivityClasses
+ */
+
+// Exit if accessed directly
+if ( !defined( 'ABSPATH' ) ) exit;
+
 Class BP_Activity_Activity {
 	var $id;
 	var $item_id;
@@ -12,11 +22,17 @@ Class BP_Activity_Activity {
 	var $content;
 	var $date_recorded;
 	var $hide_sitewide = false;
+	var $mptt_left;
+	var $mptt_right;
 
 	function bp_activity_activity( $id = false ) {
+		$this->__construct( $id );
+	}
+
+	function __construct( $id = false ) {
 		global $bp;
 
-		if ( $id ) {
+		if ( !empty( $id ) ) {
 			$this->id = $id;
 			$this->populate();
 		}
@@ -25,42 +41,42 @@ Class BP_Activity_Activity {
 	function populate() {
 		global $wpdb, $bp;
 
-		$row = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM {$bp->activity->table_name} WHERE id = %d", $this->id ) );
-		if ( $row ) {
-			$this->id = $row->id;
-			$this->item_id = $row->item_id;
+		if ( $row = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM {$bp->activity->table_name} WHERE id = %d", $this->id ) ) ) {
+			$this->id                = $row->id;
+			$this->item_id           = $row->item_id;
 			$this->secondary_item_id = $row->secondary_item_id;
-			$this->user_id = $row->user_id;
-			$this->primary_link = $row->primary_link;
-			$this->component = $row->component;
-			$this->type = $row->type;
-			$this->action = $row->action;
-			$this->content = $row->content;
-			$this->date_recorded = $row->date_recorded;
-			$this->hide_sitewide = $row->hide_sitewide;
-			$this->mptt_left = $row->mptt_left;
-			$this->mptt_right = $row->mptt_right;
+			$this->user_id           = $row->user_id;
+			$this->primary_link      = $row->primary_link;
+			$this->component         = $row->component;
+			$this->type              = $row->type;
+			$this->action            = $row->action;
+			$this->content           = $row->content;
+			$this->date_recorded     = $row->date_recorded;
+			$this->hide_sitewide     = $row->hide_sitewide;
+			$this->mptt_left         = $row->mptt_left;
+			$this->mptt_right        = $row->mptt_right;
 		}
 	}
 
 	function save() {
 		global $wpdb, $bp, $current_user;
 
-		do_action( 'bp_activity_before_save', &$this );
-
-		$this->id = apply_filters( 'bp_activity_id_before_save', $this->id, &$this );
-		$this->item_id = apply_filters( 'bp_activity_item_id_before_save', $this->item_id, &$this );
-		$this->secondary_item_id = apply_filters( 'bp_activity_secondary_item_id_before_save', $this->secondary_item_id, &$this );
-		$this->user_id = apply_filters( 'bp_activity_user_id_before_save', $this->user_id, &$this );
-		$this->primary_link = apply_filters( 'bp_activity_primary_link_before_save', $this->primary_link, &$this );
-		$this->component = apply_filters( 'bp_activity_component_before_save', $this->component, &$this );
-		$this->type = apply_filters( 'bp_activity_type_before_save', $this->type, &$this );
-		$this->action = apply_filters( 'bp_activity_action_before_save', $this->action, &$this );
-		$this->content = apply_filters( 'bp_activity_content_before_save', $this->content, &$this );
-		$this->date_recorded = apply_filters( 'bp_activity_date_recorded_before_save', $this->date_recorded, &$this );
-		$this->hide_sitewide = apply_filters( 'bp_activity_hide_sitewide_before_save', $this->hide_sitewide, &$this );
-		$this->mptt_left = apply_filters( 'bp_activity_mptt_left_before_save', $this->mptt_left, &$this );
-		$this->mptt_right = apply_filters( 'bp_activity_mptt_right_before_save', $this->mptt_right, &$this );
+		$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 ) );
+		$this->secondary_item_id = apply_filters_ref_array( 'bp_activity_secondary_item_id_before_save', array( $this->secondary_item_id, &$this ) );
+		$this->user_id           = apply_filters_ref_array( 'bp_activity_user_id_before_save',           array( $this->user_id,           &$this ) );
+		$this->primary_link      = apply_filters_ref_array( 'bp_activity_primary_link_before_save',      array( $this->primary_link,      &$this ) );
+		$this->component         = apply_filters_ref_array( 'bp_activity_component_before_save',         array( $this->component,         &$this ) );
+		$this->type              = apply_filters_ref_array( 'bp_activity_type_before_save',              array( $this->type,              &$this ) );
+		$this->action            = apply_filters_ref_array( 'bp_activity_action_before_save',            array( $this->action,            &$this ) );
+		$this->content           = apply_filters_ref_array( 'bp_activity_content_before_save',           array( $this->content,           &$this ) );
+		$this->date_recorded     = apply_filters_ref_array( 'bp_activity_date_recorded_before_save',     array( $this->date_recorded,     &$this ) );
+		$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 ) );
+
+		// Use this, not the filters above
+		do_action_ref_array( 'bp_activity_before_save', array( &$this ) );
 
 		if ( !$this->component || !$this->type )
 			return false;
@@ -68,7 +84,7 @@ Class BP_Activity_Activity {
 		if ( !$this->primary_link )
 			$this->primary_link = $bp->loggedin_user->domain;
 
-		/* If we have an existing ID, update the activity item, otherwise insert it. */
+		// 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
@@ -80,58 +96,78 @@ Class BP_Activity_Activity {
 		if ( empty( $this->id ) )
 			$this->id = $wpdb->insert_id;
 
-		do_action( 'bp_activity_after_save', &$this );
+		do_action_ref_array( 'bp_activity_after_save', array( &$this ) );
+
 		return true;
 	}
 
-	/* Static Functions */
+	// Static Functions
 
-	function get( $max = false, $page = 1, $per_page = 25, $sort = 'DESC', $search_terms = false, $filter = false, $display_comments = false, $show_hidden = false ) {
+	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 ) {
 		global $wpdb, $bp;
 
-		/* Select conditions */
+		// Select conditions
 		$select_sql = "SELECT a.*, u.user_email, u.user_nicename, u.user_login, u.display_name";
 
 		$from_sql = " FROM {$bp->activity->table_name} a LEFT JOIN {$wpdb->users} u ON a.user_id = u.ID";
 
-		/* Where conditions */
+		// Where conditions
 		$where_conditions = array();
 
-		/* Searching */
+		// Searching
 		if ( $search_terms ) {
 			$search_terms = $wpdb->escape( $search_terms );
 			$where_conditions['search_sql'] = "a.content LIKE '%%" . like_escape( $search_terms ) . "%%'";
 		}
 
-		/* Filtering */
+		// Filtering
 		if ( $filter && $filter_sql = BP_Activity_Activity::get_filter_sql( $filter ) )
 			$where_conditions['filter_sql'] = $filter_sql;
 
-		/* Sorting */
+		// Sorting
 		if ( $sort != 'ASC' && $sort != 'DESC' )
 			$sort = 'DESC';
 
-		/* Hide Hidden Items? */
+		// Hide Hidden Items?
 		if ( !$show_hidden )
 			$where_conditions['hidden_sql'] = "a.hide_sitewide = 0";
 
-		/* Alter the query based on whether we want to show activity item comments in the stream like normal comments or threaded below the activity */
-		if ( !$display_comments || 'threaded' == $display_comments ) {
-			$where_conditions[] = "a.type != 'activity_comment'";
+		// Exclude specified items
+		if ( $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 ) ) );
+			}
+
+			$where_conditions['in'] = "a.id IN ({$in})";
 		}
 
+		// Alter the query based on whether we want to show activity item
+		// comments in the stream like normal comments or threaded below
+		// the activity.
+		if ( false === $display_comments || 'threaded' === $display_comments )
+			$where_conditions[] = "a.type != 'activity_comment'";
+
 		$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( $wpdb->prepare( "{$select_sql} {$from_sql} {$where_sql} ORDER BY a.date_recorded {$sort} {$pag_sql}" ) );
-		} else
-			$activities = $wpdb->get_results( $wpdb->prepare( "{$select_sql} {$from_sql} {$where_sql} ORDER BY a.date_recorded {$sort} {$pag_sql}" ) );
+			$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 ) );
+		} 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 ) );
+		}
+
+		$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 = $wpdb->get_var( $wpdb->prepare( "SELECT count(a.id) FROM {$bp->activity->table_name} a {$where_sql} ORDER BY a.date_recorded {$sort}" ) );
+		$total_activities = $wpdb->get_var( $total_activities_sql );
 
-		/* Get the fullnames of users so we don't have to query in the loop */
-		if ( function_exists( 'xprofile_install' ) && $activities ) {
+		// Get the fullnames of users so we don't have to query in the loop
+		if ( bp_is_active( 'xprofile' ) && $activities ) {
 			foreach ( (array)$activities as $activity ) {
 				if ( (int)$activity->user_id )
 					$activity_user_ids[] = $activity->user_id;
@@ -155,9 +191,9 @@ Class BP_Activity_Activity {
 		}
 
 		if ( $activities && $display_comments )
-			$activities = BP_Activity_Activity::append_comments( &$activities );
+			$activities = BP_Activity_Activity::append_comments( $activities );
 
-		/* If $max is set, only return up to the max results */
+		// If $max is set, only return up to the max results
 		if ( !empty( $max ) ) {
 			if ( (int)$total_activities > (int)$max )
 				$total_activities = $max;
@@ -166,36 +202,24 @@ Class BP_Activity_Activity {
 		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.
+	 *
+	 * @deprecated 1.5
+	 * @deprecated Use BP_Activity_Activity::get( ..., $in ) 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)
+	 * @param int $per_page Specifies how many results per page. Used in pagination. (Optional; default is 25)
+	 * @param string MySQL column sort; ASC or DESC. (Optional; default is DESC)
+	 * @param bool $display_comments Retrieve an activity item's associated comments or not. (Optional; default is false)
+	 * @return array
+	 * @since 1.2
+	 */
 	function get_specific( $activity_ids, $max = false, $page = 1, $per_page = 25, $sort = 'DESC', $display_comments = false ) {
-		global $wpdb, $bp;
-
-		if ( is_array( $activity_ids ) )
-			$activity_ids = implode( ',', $activity_ids );
-
-		$activity_ids = $wpdb->escape( $activity_ids );
-
-		if ( empty( $activity_ids ) )
-			return false;
-
-		if ( $per_page && $page )
-			$pag_sql = $wpdb->prepare( "LIMIT %d, %d", intval( ( $page - 1 ) * $per_page ), intval( $per_page ) );
-
-		if ( $sort != 'ASC' && $sort != 'DESC' )
-			$sort = 'DESC';
-
-		$activities = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM {$bp->activity->table_name} WHERE id IN ({$activity_ids}) ORDER BY date_recorded {$sort} $pag_sql" ) );
-		$total_activities = $wpdb->get_var( $wpdb->prepare( "SELECT count(id) FROM {$bp->activity->table_name} WHERE id IN ({$activity_ids})" ) );
-
-		if ( $display_comments )
-			$activities = BP_Activity_Activity::append_comments( $activities );
-
-		/* If $max is set, only return up to the max results */
-		if ( !empty( $max ) ) {
-			if ( (int)$total_activities > (int)$max )
-				$total_activities = $max;
-		}
-
-		return array( 'activities' => $activities, 'total' => (int)$total_activities );
+		_deprecated_function( __FUNCTION__, '1.5', 'Use BP_Activity_Activity::get( ..., $in ) instead.' );
+		return BP_Activity_Activity::get( $max, $page, $per_page, $sort, false, false, $display_comments, false, false, $activity_ids );
 	}
 
 	function get_id( $user_id, $component, $type, $item_id, $secondary_item_id, $action, $content, $date_recorded ) {
@@ -238,21 +262,21 @@ Class BP_Activity_Activity {
 	function delete( $args ) {
 		global $wpdb, $bp;
 
-		extract( $args );
-
 		$defaults = array(
-			'id' => false,
-			'action' => false,
-			'content' => false,
-			'component' => false,
-			'type' => false,
-			'primary_link' => false,
-			'user_id' => false,
-			'item_id' => false,
+			'id'                => false,
+			'action'            => false,
+			'content'           => false,
+			'component'         => false,
+			'type'              => false,
+			'primary_link'      => false,
+			'user_id'           => false,
+			'item_id'           => false,
 			'secondary_item_id' => false,
-			'date_recorded' => false,
-			'hide_sitewide' => false
+			'date_recorded'     => false,
+			'hide_sitewide'     => false
 		);
+		$params = wp_parse_args( $args, $defaults );
+		extract( $params );
 
 		$where_args = false;
 
@@ -294,7 +318,7 @@ Class BP_Activity_Activity {
 		else
 			return false;
 
-		/* Fetch the activity IDs so we can delete any comments for this activity item */
+		// 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}" ) );
 
 		if ( !$wpdb->query( $wpdb->prepare( "DELETE FROM {$bp->activity->table_name} {$where_sql}" ) ) )
@@ -313,10 +337,10 @@ Class BP_Activity_Activity {
 	function delete_activity_item_comments( $activity_ids ) {
 		global $bp, $wpdb;
 
-		if ( is_array($activity_ids) )
-			$activity_ids = implode( ',', $activity_ids );
-
-		$activity_ids = $wpdb->escape( $activity_ids );
+		if ( is_array( $activity_ids ) )
+			$activity_ids = implode ( ',', array_map( 'absint', $activity_ids ) );
+		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})" ) );
 	}
@@ -324,10 +348,10 @@ Class BP_Activity_Activity {
 	function delete_activity_meta_entries( $activity_ids ) {
 		global $bp, $wpdb;
 
-		if ( is_array($activity_ids) )
-			$activity_ids = implode( ',', $activity_ids );
-
-		$activity_ids = $wpdb->escape( $activity_ids );
+		if ( is_array( $activity_ids ) )
+			$activity_ids = implode ( ',', array_map( 'absint', $activity_ids ) );
+		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})" ) );
 	}
@@ -335,6 +359,8 @@ Class BP_Activity_Activity {
 	function append_comments( $activities ) {
 		global $bp, $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 ) {
 			if ( 'activity_comment' != $activity->type && $activity->mptt_left && $activity->mptt_right )
@@ -343,7 +369,8 @@ Class BP_Activity_Activity {
 
 		/* Merge the comments with the activity items */
 		foreach( (array)$activities as $key => $activity )
-			$activities[$key]->children = $activity_comments[$activity->id];
+			if ( isset( $activity_comments[$activity->id] ) )
+				$activities[$key]->children = $activity_comments[$activity->id];
 
 		return $activities;
 	}
@@ -352,30 +379,34 @@ Class BP_Activity_Activity {
 		global $wpdb, $bp;
 
 		if ( !$comments = wp_cache_get( 'bp_activity_comments_' . $activity_id ) ) {
-			/* Select the user's fullname with the query so we don't have to fetch it for each comment */
-			if ( function_exists( 'xprofile_install' ) ) {
+			// Select the user's fullname with the query
+			if ( bp_is_active( 'xprofile' ) ) {
 				$fullname_select = ", pd.value as user_fullname";
 				$fullname_from = ", {$bp->profile->table_name_data} pd ";
 				$fullname_where = "AND pd.user_id = a.user_id AND pd.field_id = 1";
+
+			// Prevent debug errors
+			} else {
+				$fullname_select = $fullname_from = $fullname_where = '';
 			}
 
-			/* Retrieve all descendants of the $root node */
-			$descendants = $wpdb->get_results( $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 ) );
+			// 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 ) );
 
-			/* Loop descendants and build an assoc array */
+			// Loop descendants and build an assoc array
 			foreach ( (array)$descendants as $d ) {
-			    $d->children = array();
-
-				/* If we have a reference on the parent */
-			    if ( isset( $ref[ $d->secondary_item_id ] ) ) {
-			        $ref[ $d->secondary_item_id ]->children[ $d->id ] = $d;
-			        $ref[ $d->id ] =& $ref[ $d->secondary_item_id ]->children[ $d->id ];
-
-				/* If we don't have a reference on the parent, put in the root level */
-			    } else {
-			        $comments[ $d->id ] = $d;
-			        $ref[ $d->id ] =& $comments[ $d->id ];
-			    }
+				$d->children = array();
+
+				// If we have a reference on the parent
+				if ( isset( $ref[ $d->secondary_item_id ] ) ) {
+					$ref[ $d->secondary_item_id ]->children[ $d->id ] = $d;
+					$ref[ $d->id ] =& $ref[ $d->secondary_item_id ]->children[ $d->id ];
+
+				// If we don't have a reference on the parent, put in the root level
+				} else {
+					$comments[ $d->id ] = $d;
+					$ref[ $d->id ] =& $comments[ $d->id ];
+				}
 			}
 			wp_cache_set( 'bp_activity_comments_' . $activity_id, $comments, 'bp' );
 		}
@@ -386,23 +417,24 @@ Class BP_Activity_Activity {
 	function rebuild_activity_comment_tree( $parent_id, $left = 1 ) {
 		global $wpdb, $bp;
 
-		/* The right value of this node is the left value + 1 */
+		// The right value of this node is the left value + 1
 		$right = $left + 1;
 
-		/* Get all descendants of this node */
+		// Get all descendants of this node
 		$descendants = BP_Activity_Activity::get_child_comments( $parent_id );
 
-		/* Loop the descendants and recalculate the left and right values */
+		// Loop the descendants and recalculate the left and right values
 		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 of this node we also know the right value */
+		// We've got the left value, and now that we've processed the children
+		// of this node we also know the right value
 		if ( 1 == $left )
 			$wpdb->query( $wpdb->prepare( "UPDATE {$bp->activity->table_name} SET mptt_left = %d, mptt_right = %d WHERE id = %d", $left, $right, $parent_id ) );
 		else
 			$wpdb->query( $wpdb->prepare( "UPDATE {$bp->activity->table_name} SET mptt_left = %d, mptt_right = %d WHERE type = 'activity_comment' AND id = %d", $left, $right, $parent_id ) );
 
-		/* Return the right value of this node + 1 */
+		// Return the right value of this node + 1
 		return $right + 1;
 	}
 
@@ -423,7 +455,7 @@ Class BP_Activity_Activity {
 
 		$activities = bp_activity_get_sitewide( array( 'max' => $limit ) );
 
-		for ( $i = 0; $i < count($activities); $i++ ) {
+		for ( $i = 0, $count = count( $activities ); $i < $count; ++$i ) {
 				$title = explode( '<span', $activities[$i]['content'] );
 
 				$activity_feed[$i]['title'] = trim( strip_tags( $title[0] ) );
@@ -435,85 +467,61 @@ Class BP_Activity_Activity {
 		return $activity_feed;
 	}
 
-	function get_filter_sql( $filter_array ) {
+	function get_in_operator_sql( $field, $items ) {
 		global $wpdb;
 
-		if ( !empty( $filter_array['user_id'] ) ) {
-			$user_filter = explode( ',', $filter_array['user_id'] );
-			$user_sql = ' ( a.user_id IN ( ' . $filter_array['user_id'] . ' ) )';
-			$filter_sql[] = $user_sql;
-		}
-
-		if ( !empty( $filter_array['object'] ) ) {
-			$object_filter = explode( ',', $filter_array['object'] );
-			$object_sql = ' ( ';
-
-			$counter = 1;
-			foreach( (array) $object_filter as $object ) {
-				$object_sql .= $wpdb->prepare( "a.component = %s", trim( $object ) );
+		// split items at the comma
+		$items_dirty = explode( ',', $items );
 
-				if ( $counter != count( $object_filter ) )
-					$object_sql .= ' || ';
-
-				$counter++;
-			}
+		// array of prepared integers or quoted strings
+		$items_prepared = array();
 
-			$object_sql .= ' )';
-			$filter_sql[] = $object_sql;
+		// clean up and format each item
+		foreach ( $items_dirty as $item ) {
+			// clean up the string
+			$item = trim( $item );
+			// pass everything through prepare for security and to safely quote strings
+			$items_prepared[] = ( is_numeric( $item ) ) ? $wpdb->prepare( '%d', $item ) : $wpdb->prepare( '%s', $item );
 		}
 
-		if ( !empty( $filter_array['action'] ) ) {
-			$action_filter = explode( ',', $filter_array['action'] );
-			$action_sql = ' ( ';
+		// build IN operator sql syntax
+		if ( count( $items_prepared ) )
+			return sprintf( '%s IN ( %s )', trim( $field ), implode( ',', $items_prepared ) );
+		else
+			return false;
+	}
 
-			$counter = 1;
-			foreach( (array) $action_filter as $action ) {
-				$action_sql .= $wpdb->prepare( "a.type = %s", trim( $action ) );
+	function get_filter_sql( $filter_array ) {
+		global $wpdb;
 
-				if ( $counter != count( $action_filter ) )
-					$action_sql .= ' || ';
+		if ( !empty( $filter_array['user_id'] ) ) {
+			$user_sql = BP_Activity_Activity::get_in_operator_sql( 'a.user_id', $filter_array['user_id'] );
+			if ( !empty( $user_sql ) )
+				$filter_sql[] = $user_sql;
+		}
 
-				$counter++;
-			}
+		if ( !empty( $filter_array['object'] ) ) {
+			$object_sql = BP_Activity_Activity::get_in_operator_sql( 'a.component', $filter_array['object'] );
+			if ( !empty( $object_sql ) )
+				$filter_sql[] = $object_sql;
+		}
 
-			$action_sql .= ' )';
-			$filter_sql[] = $action_sql;
+		if ( !empty( $filter_array['action'] ) ) {
+			$action_sql = BP_Activity_Activity::get_in_operator_sql( 'a.type', $filter_array['action'] );
+			if ( !empty( $action_sql ) )
+				$filter_sql[] = $action_sql;
 		}
 
 		if ( !empty( $filter_array['primary_id'] ) ) {
-			$pid_filter = explode( ',', $filter_array['primary_id'] );
-			$pid_sql = ' ( ';
-
-			$counter = 1;
-			foreach( (array) $pid_filter as $pid ) {
-				$pid_sql .= $wpdb->prepare( "a.item_id = %s", trim( $pid ) );
-
-				if ( $counter != count( $pid_filter ) )
-					$pid_sql .= ' || ';
-
-				$counter++;
-			}
-
-			$pid_sql .= ' )';
-			$filter_sql[] = $pid_sql;
+			$pid_sql = BP_Activity_Activity::get_in_operator_sql( 'a.item_id', $filter_array['primary_id'] );
+			if ( !empty( $pid_sql ) )
+				$filter_sql[] = $pid_sql;
 		}
 
 		if ( !empty( $filter_array['secondary_id'] ) ) {
-			$sid_filter = explode( ',', $filter_array['secondary_id'] );
-			$sid_sql = ' ( ';
-
-			$counter = 1;
-			foreach( (array) $sid_filter as $sid ) {
-				$sid_sql .= $wpdb->prepare( "a.secondary_item_id = %s", trim( $sid ) );
-
-				if ( $counter != count( $sid_filter ) )
-					$sid_sql .= ' || ';
-
-				$counter++;
-			}
-
-			$sid_sql .= ' )';
-			$filter_sql[] = $sid_sql;
+			$sid_sql = BP_Activity_Activity::get_in_operator_sql( 'a.secondary_item_id', $filter_array['secondary_id'] );
+			if ( !empty( $sid_sql ) )
+				$filter_sql[] = $sid_sql;
 		}
 
 		if ( empty($filter_sql) )
@@ -529,9 +537,7 @@ Class BP_Activity_Activity {
 	}
 
 	function total_favorite_count( $user_id ) {
-		global $bp;
-
-		if ( !$favorite_activity_entries = get_user_meta( $user_id, 'bp_favorite_activities', true ) )
+		if ( !$favorite_activity_entries = bp_get_user_meta( $user_id, 'bp_favorite_activities', true ) )
 			return 0;
 
 		return count( maybe_unserialize( $favorite_activity_entries ) );
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 aa9d1a03de08ab168fc1210f0cc211af8674afbe..5e207cfb855bc40dac75760e4068e93516396c9a 100644
--- a/wp-content/plugins/buddypress/bp-activity/bp-activity-filters.php
+++ b/wp-content/plugins/buddypress/bp-activity/bp-activity-filters.php
@@ -1,6 +1,16 @@
 <?php
 
-/* Apply WordPress defined filters */
+/**
+ * The Activity filters
+ *
+ * @package BuddyPress
+ * @subpackage ActivityFilters
+ */
+
+// Exit if accessed directly
+if ( !defined( 'ABSPATH' ) ) exit;
+
+// 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 );
 add_filter( 'bp_get_activity_content',               'bp_activity_filter_kses', 1 );
@@ -46,13 +56,13 @@ add_filter( 'bp_get_activity_content_body',          'wpautop' );
 add_filter( 'bp_get_activity_content',               'wpautop' );
 add_filter( 'bp_get_activity_feed_item_description', 'wpautop' );
 
-add_filter( 'bp_get_activity_action',                'make_clickable' );
-add_filter( 'bp_get_activity_content_body',          'make_clickable' );
-add_filter( 'bp_get_activity_content',               'make_clickable' );
-add_filter( 'bp_get_activity_parent_content',        'make_clickable' );
-add_filter( 'bp_get_activity_latest_update',         'make_clickable' );
-add_filter( 'bp_get_activity_latest_update_excerpt', 'make_clickable' );
-add_filter( 'bp_get_activity_feed_item_description', 'make_clickable' );
+add_filter( 'bp_get_activity_action',                'make_clickable', 9 );
+add_filter( 'bp_get_activity_content_body',          'make_clickable', 9 );
+add_filter( 'bp_get_activity_content',               'make_clickable', 9 );
+add_filter( 'bp_get_activity_parent_content',        'make_clickable', 9 );
+add_filter( 'bp_get_activity_latest_update',         'make_clickable', 9 );
+add_filter( 'bp_get_activity_latest_update_excerpt', 'make_clickable', 9 );
+add_filter( 'bp_get_activity_feed_item_description', 'make_clickable', 9 );
 
 add_filter( 'bp_acomment_name',                      'stripslashes_deep' );
 add_filter( 'bp_get_activity_action',                'stripslashes_deep' );
@@ -63,7 +73,7 @@ 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' );
 
-/* Apply BuddyPress defined filters */
+// 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' );
 add_filter( 'bp_get_activity_parent_content',        'bp_activity_make_nofollow_filter' );
@@ -71,12 +81,24 @@ add_filter( 'bp_get_activity_latest_update',         'bp_activity_make_nofollow_
 add_filter( 'bp_get_activity_latest_update_excerpt', 'bp_activity_make_nofollow_filter' );
 add_filter( 'bp_get_activity_feed_item_description', 'bp_activity_make_nofollow_filter' );
 
-add_filter( 'bp_get_activity_parent_content', 'bp_create_excerpt' );
+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' );
 
-/* Allow shortcodes in activity posts */
-add_filter( 'bp_get_activity_content', 'do_shortcode' );
-add_filter( 'bp_get_activity_content_body', 'do_shortcode' );
+add_filter( 'bp_get_activity_parent_content',        'bp_create_excerpt' );
 
+/**
+ * Custom kses filtering for activity content
+ *
+ * @since 1.1.0
+ *
+ * @param string $content The activity content
+ *
+ * @uses apply_filters() To call the 'bp_activity_allowed_tags' hook.
+ * @uses wp_kses()
+ *
+ * @return string $content Filtered activity content
+ */
 function bp_activity_filter_kses( $content ) {
 	global $allowedtags;
 
@@ -87,6 +109,8 @@ function bp_activity_filter_kses( $content ) {
 	$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();
 	$activity_allowedtags['img']           = array();
 	$activity_allowedtags['img']['src']    = array();
 	$activity_allowedtags['img']['alt']    = array();
@@ -102,43 +126,143 @@ function bp_activity_filter_kses( $content ) {
 	return wp_kses( $content, $activity_allowedtags );
 }
 
-function bp_activity_at_name_filter( $content ) {
-	include_once( ABSPATH . WPINC . '/registration.php' );
-
-	$pattern = '/[@]+([A-Za-z0-9-_\.]+)/';
-	preg_match_all( $pattern, $content, $usernames );
-
-	// Make sure there's only one instance of each username
-	if ( !$usernames = array_unique( $usernames[1] ) )
-		return $content;
+/**
+ * Finds and links @-mentioned users in the contents of activity items
+ *
+ * @since 1.2.0
+ *
+ * @param string $content The activity content
+ * @param int $activity_id The activity id
+ *
+ * @uses bp_activity_find_mentions()
+ * @uses bp_is_username_compatibility_mode()
+ * @uses bp_core_get_userid_from_nicename()
+ * @uses bp_activity_at_message_notification()
+ * @uses bp_core_get_user_domain()
+ * @uses bp_activity_adjust_mention_count()
+ *
+ * @return string $content Content filtered for mentions
+ */
+function bp_activity_at_name_filter( $content, $activity_id = 0 ) {
+	$usernames = bp_activity_find_mentions( $content );
 
 	foreach( (array)$usernames as $username ) {
-		if ( !$user_id = username_exists( $username ) )
+		if ( bp_is_username_compatibility_mode() )
+			$user_id = username_exists( $username );
+		else
+			$user_id = bp_core_get_userid_from_nicename( $username );
+
+		if ( empty( $user_id ) )
 			continue;
 
-		// Increase the number of new @ mentions for the user
-		$new_mention_count = (int)get_user_meta( $user_id, 'bp_new_mention_count', true );
-		update_user_meta( $user_id, 'bp_new_mention_count', $new_mention_count + 1 );
+		// If an activity_id is provided, we can send email and BP notifications
+		if ( $activity_id ) {
+			bp_activity_at_message_notification( $activity_id, $user_id );
+		}
 
-		$content = str_replace( "@$username", "<a href='" . bp_core_get_user_domain( bp_core_get_userid( $username ) ) . "' rel='nofollow'>@$username</a>", $content );
+		$content = preg_replace( '/(@' . $username . '\b)/', "<a href='" . bp_core_get_user_domain( $user_id ) . "' rel='nofollow'>@$username</a>", $content );
 	}
 
+	// Adjust the activity count for this item
+	if ( $activity_id )
+		bp_activity_adjust_mention_count( $activity_id, 'add' );
+
 	return $content;
 }
-add_filter( 'bp_activity_new_update_content',     'bp_activity_at_name_filter' );
-add_filter( 'groups_activity_new_update_content', 'bp_activity_at_name_filter' );
-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( 'bp_activity_comment_content',        'bp_activity_at_name_filter' );
 
+/**
+ * Catch mentions in saved activity items
+ *
+ * @since 1.5.0
+ *
+ * @param obj $activity
+ *
+ * @uses remove_filter() To remove the 'bp_activity_at_name_filter_updates' hook.
+ * @uses bp_activity_at_name_filter()
+ * @uses BP_Activity_Activity::save() {@link BP_Activity_Activity}
+ */
+function bp_activity_at_name_filter_updates( $activity ) {
+	// Only run this function once for a given activity item
+	remove_filter( 'bp_activity_after_save', 'bp_activity_at_name_filter_updates' );
+
+	// Run the content through the linking filter, making sure to increment mention count
+	$activity->content = bp_activity_at_name_filter( $activity->content, $activity->id );
+
+	// 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
+ *
+ * @param string $text Activity text
+ *
+ * @return string $text Text with rel=nofollow added to any links
+ */
 function bp_activity_make_nofollow_filter( $text ) {
 	return preg_replace_callback( '|<a (.+?)>|i', 'bp_activity_make_nofollow_filter_callback', $text );
 }
+
+	/**
+	 * Adds rel=nofollow to a link
+	 *
+	 * @since 1.2.0
+	 *
+	 * @param array $matches
+	 *
+	 * @return string $text Link with rel=nofollow added
+	 */
 	function bp_activity_make_nofollow_filter_callback( $matches ) {
 		$text = $matches[1];
 		$text = str_replace( array( ' rel="nofollow"', " rel='nofollow'"), '', $text );
 		return "<a $text rel=\"nofollow\">";
 	}
 
-?>
+/**
+ * Truncates long activity entries when viewed in activity streams
+ *
+ * @since 1.5.0
+ *
+ * @param $text The original activity entry text
+ *
+ * @uses bp_is_single_activity()
+ * @uses apply_filters() To call the 'bp_activity_excerpt_append_text' hook
+ * @uses apply_filters() To call the 'bp_activity_excerpt_length' hook
+ * @uses bp_create_excerpt()
+ * @uses bp_get_activity_id()
+ * @uses bp_get_activity_thread_permalink()
+ * @uses apply_filters() To call the 'bp_activity_truncate_entry' hook
+ *
+ * @return string $excerpt The truncated text
+ */
+function bp_activity_truncate_entry( $text ) {
+	global $activities_template;
+
+	// The full text of the activity update should always show on the single activity screen
+	if ( bp_is_single_activity() )
+		return $text;
+
+	$append_text    = apply_filters( 'bp_activity_excerpt_append_text', __( '[Read more]', 'buddypress' ) );
+	$excerpt_length = apply_filters( 'bp_activity_excerpt_length', 358 );
+
+	// Run the text through the excerpt function. If it's too short, the original text will be
+	// returned.
+	$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 ) {
+		$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 );
+	}
+
+	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
new file mode 100644
index 0000000000000000000000000000000000000000..519d00422b01416a794e94bc2e5af4cb83b650de
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-activity/bp-activity-functions.php
@@ -0,0 +1,1437 @@
+<?php
+
+/**
+ * BuddyPress Activity Functions
+ *
+ * Functions for the Activity Streams component
+ *
+ * @package BuddyPress
+ * @subpackage ActivityFunctions
+ */
+
+// Exit if accessed directly
+if ( !defined( 'ABSPATH' ) ) exit;
+
+/**
+ * Checks $bp pages global and looks for directory page
+ *
+ * @since 1.5.0
+ *
+ * @global object $bp BuddyPress global settings
+ *
+ * @return bool True if set, False if empty
+ */
+function bp_activity_has_directory() {
+	global $bp;
+
+	return (bool) !empty( $bp->pages->activity->id );
+}
+
+/**
+ * Searches through the content of an activity item to locate usernames, designated by an @ sign
+ *
+ * @since 1.5.0
+ *
+ * @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-_\.@]+)/';
+	preg_match_all( $pattern, $content, $usernames );
+
+	// Make sure there's only one instance of each username
+	if ( !$usernames = array_unique( $usernames[1] ) )
+		return false;
+
+	return $usernames;
+}
+
+/**
+ * Resets a user's unread mentions list and count
+ *
+ * @since 1.5.0
+ *
+ * @param int $user_id The id of the user whose unread mentions are being reset
+ * @uses bp_delete_user_meta()
+ */
+function bp_activity_clear_new_mentions( $user_id ) {
+	bp_delete_user_meta( $user_id, 'bp_new_mention_count' );
+	bp_delete_user_meta( $user_id, 'bp_new_mentions' );
+}
+
+/**
+ * Adjusts new mention count for mentioned users when activity items are deleted or created
+ *
+ * @since 1.5.0
+ *
+ * @param int $activity_id The unique id for the activity item
+ * @param string $action Can be 'delete' or 'add'. Defaults to 'add'
+ *
+ * @uses BP_Activity_Activity() {@link BP_Activity_Activity}
+ * @uses bp_activity_find_mentions()
+ * @uses bp_is_username_compatibility_mode()
+ * @uses bp_core_get_userid_from_nicename()
+ * @uses bp_get_user_meta()
+ * @uses bp_update_user_meta()
+ */
+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 ) {
+			if ( bp_is_username_compatibility_mode() )
+				$user_id = username_exists( $username );
+			else
+				$user_id = bp_core_get_userid_from_nicename( $username );
+
+			if ( empty( $user_id ) )
+				continue;
+
+			// Adjust the mention list and count for the member
+			$new_mention_count = (int)bp_get_user_meta( $user_id, 'bp_new_mention_count', true );
+			if ( !$new_mentions = bp_get_user_meta( $user_id, 'bp_new_mentions', true ) )
+				$new_mentions = array();
+
+			switch ( $action ) {
+				case 'delete' :
+					$key = array_search( $activity_id, $new_mentions );
+					if ( $key !== false ) {
+						unset( $new_mentions[$key] );
+					}
+					break;
+
+				case 'add' :
+				default :
+					if ( !in_array( $activity_id, $new_mentions ) ) {
+						$new_mentions[] = (int)$activity_id;
+					}
+					break;
+			}
+
+			// Get an updated mention count
+			$new_mention_count = count( $new_mentions );
+
+			// Resave the user_meta
+			bp_update_user_meta( $user_id, 'bp_new_mention_count', $new_mention_count );
+			bp_update_user_meta( $user_id, 'bp_new_mentions', $new_mentions );
+		}
+	}
+}
+
+/**
+ * Formats notifications related to activity
+ *
+ * @since 1.5.0
+ *
+ * @param string $action The type of activity item. Just 'new_at_mention' for now
+ * @param int $item_id The activity id
+ * @param int $secondary_item_id In the case of at-mentions, this is the mentioner's id
+ * @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()
+ * @uses apply_filters() To call the 'bp_activity_multiple_at_mentions_notification' hook
+ * @uses apply_filters() To call the 'bp_activity_single_at_mentions_notification' hook
+ * @uses do_action() To call 'activity_format_notifications' hook
+ *
+ * @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 );
+
+			if ( (int)$total_items > 1 ) {
+				$text = sprintf( __( 'You have %1$d new activity 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 );
+				$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 );
+	} else {
+		$return = apply_filters( $filter, array(
+			'text' => $text,
+			'link' => $at_mention_link
+		), $at_mention_link, (int)$total_items, $activity_id, $poster_user_id );
+	}
+
+	do_action( 'activity_format_notifications', $action, $item_id, $secondary_item_id, $total_items );
+
+	return $return;
+}
+
+/** Actions ******************************************************************/
+
+/**
+ * Sets the current action for a given activity stream location
+ *
+ * @since 1.1.0
+ *
+ * @param string $component_id
+ * @param string $key
+ * @param string $value
+ *
+ * @global object $bp BuddyPress global settings
+ * @uses apply_filters() To call the 'bp_activity_set_action' hook
+ *
+ * @return bool False if any param is empty, otherwise true
+ */
+function bp_activity_set_action( $component_id, $key, $value ) {
+	global $bp;
+
+	// Return false if any of the above values are not set
+	if ( empty( $component_id ) || empty( $key ) || empty( $value ) )
+		return false;
+
+	// Set activity action
+	$bp->activity->actions->{$component_id}->{$key} = apply_filters( 'bp_activity_set_action', array(
+		'key'   => $key,
+		'value' => $value
+	), $component_id, $key, $value );
+
+	return true;
+}
+
+/**
+ * Retreives the current action from a component and key
+ *
+ * @since 1.1.0
+ *
+ * @param string $component_id
+ * @param string $key
+ *
+ * @global object $bp BuddyPress global settings
+ * @uses apply_filters() To call the 'bp_activity_get_action' hook
+ *
+ * @return mixed False on error, action on success
+ */
+function bp_activity_get_action( $component_id, $key ) {
+	global $bp;
+
+	// Return false if any of the above values are not set
+	if ( empty( $component_id ) || empty( $key ) )
+		return false;
+
+	return apply_filters( 'bp_activity_get_action', $bp->activity->actions->{$component_id}->{$key}, $component_id, $key );
+}
+
+/** Favorites ****************************************************************/
+
+/**
+ * Get a users favorite activity stream items
+ *
+ * @since 1.2.0
+ *
+ * @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;
+
+	// Get favorites for user
+	$favs = bp_get_user_meta( $user_id, 'bp_favorite_activities', true );
+
+	return apply_filters( 'bp_activity_get_user_favorites', $favs );
+}
+
+/**
+ * Add an activity stream item as a favorite for a user
+ *
+ * @since 1.2.0
+ *
+ * @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()
+ * @uses bp_update_user_meta()
+ * @uses bp_activity_update_meta()
+ * @uses do_action() To call the 'bp_activity_add_user_favorite' hook
+ * @uses do_action() To call the 'bp_activity_add_user_favorite_fail' hook
+ *
+ * @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() )
+		return false;
+
+	// Fallback to logged in user if no user_id is passed
+	if ( empty( $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[] = $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;
+
+	// Update user meta
+	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 ) ) {
+
+		// Execute additional code
+		do_action( 'bp_activity_add_user_favorite', $activity_id, $user_id );
+
+		// Success
+		return true;
+
+	// Saving meta was unsuccessful for an unknown reason
+	} else {
+		// Execute additional code
+		do_action( 'bp_activity_add_user_favorite_fail', $activity_id, $user_id );
+
+		return false;
+	}
+}
+
+/**
+ * Remove an activity stream item as a favorite for a user
+ *
+ * @since 1.2.0
+ *
+ * @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()
+ * @uses bp_activity_update_meta()
+ * @uses bp_update_user_meta()
+ * @uses do_action() To call the 'bp_activity_remove_user_favorite' hook
+ *
+ * @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() )
+		return false;
+
+	// Fallback to logged in user if no user_id is passed
+	if ( empty( $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 );
+	$my_favs = array_flip( (array) $my_favs );
+	unset( $my_favs[$activity_id] );
+	$my_favs = array_unique( array_flip( $my_favs ) );
+
+	// Update the total number of users who have favorited this activity
+	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 ) ) {
+
+			// Update users favorites
+			if ( bp_update_user_meta( $user_id, 'bp_favorite_activities', $my_favs ) ) {
+
+				// Execute additional code
+				do_action( 'bp_activity_remove_user_favorite', $activity_id, $user_id );
+
+				// Success
+				return true;
+
+			// Error updating
+			} else {
+				return false;
+			}
+
+		// Error updating favorite count
+		} else {
+			return false;
+		}
+
+	// Error getting favorite count
+	} else {
+		return false;
+	}
+}
+
+/**
+ * Check if activity exists by scanning content
+ *
+ * @since 1.1.0
+ *
+ * @param string $content
+ *
+ * @uses BP_Activity_Activity::check_exists_by_content() {@link BP_Activity_Activity}
+ * @uses apply_filters() To call the 'bp_activity_check_exists_by_content' hook
+ *
+ * @return bool
+ */
+function bp_activity_check_exists_by_content( $content ) {
+	return apply_filters( 'bp_activity_check_exists_by_content', BP_Activity_Activity::check_exists_by_content( $content ) );
+}
+
+/**
+ * Retrieve the last time activity was updated
+ *
+ * @since 1.0.0
+ *
+ * @uses BP_Activity_Activity::get_last_updated() {@link BP_Activity_Activity}
+ * @uses apply_filters() To call the 'bp_activity_get_last_updated' hook
+ *
+ * @return string Date last updated
+ */
+function bp_activity_get_last_updated() {
+	return apply_filters( 'bp_activity_get_last_updated', BP_Activity_Activity::get_last_updated() );
+}
+
+/**
+ * Retrieve the number of favorite activity stream items a user has
+ *
+ * @since 1.2.0
+ *
+ * @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;
+
+	return BP_Activity_Activity::total_favorite_count( $user_id );
+}
+
+/** Meta *********************************************************************/
+
+/**
+ * Delete a meta entry from the DB for an activity stream item
+ *
+ * @since 1.2.0
+ *
+ * @param int $activity_id
+ * @param string $meta_key
+ * @param string $meta_value
+ *
+ * @global object $wpdb
+ * @global object $bp BuddyPress global settings
+ * @uses wp_cache_delete()
+ * @uses is_wp_error()
+ *
+ * @return bool True on success, false on failure
+ */
+function bp_activity_delete_meta( $activity_id, $meta_key = '', $meta_value = '' ) {
+	global $wpdb, $bp;
+
+	// Return false if any of the above values are not set
+	if ( !is_numeric( $activity_id ) )
+		return false;
+
+	// Sanitize key
+	$meta_key = preg_replace( '|[^a-z0-9_]|i', '', $meta_key );
+
+	if ( is_array( $meta_value ) || is_object( $meta_value ) )
+		$meta_value = serialize( $meta_value );
+
+	// Trim off whitespace
+	$meta_value = trim( $meta_value );
+
+	// Delete all for activity_id
+	if ( empty( $meta_key ) )
+		$retval = $wpdb->query( $wpdb->prepare( "DELETE FROM {$bp->activity->table_name_meta} WHERE activity_id = %d", $activity_id ) );
+
+	// Delete only when all match
+	else if ( $meta_value )
+		$retval = $wpdb->query( $wpdb->prepare( "DELETE FROM {$bp->activity->table_name_meta} WHERE activity_id = %d AND meta_key = %s AND meta_value = %s", $activity_id, $meta_key, $meta_value ) );
+
+	// Delete only when activity_id and meta_key match
+	else
+		$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' );
+
+	// Success
+	if ( !is_wp_error( $retval ) )
+		return true;
+
+	// Fail
+	else
+		return false;
+}
+
+/**
+ * Get activity meta
+ *
+ * @since 1.2.0
+ *
+ * @param int $activity_id
+ * @param string $meta_key
+ *
+ * @global object $wpdb
+ * @global object $bp BuddyPress global settings
+ * @uses wp_cache_get()
+ * @uses wp_cache_set()
+ * @uses apply_filters() To call the 'bp_activity_get_meta' hook
+ *
+ * @return bool
+ */
+function bp_activity_get_meta( $activity_id = 0, $meta_key = '' ) {
+	global $wpdb, $bp;
+
+	// Make sure activity_id is valid
+	if ( empty( $activity_id ) || !is_numeric( $activity_id ) )
+		return false;
+
+	// We have a key to look for
+	if ( !empty( $meta_key ) ) {
+
+		// Sanitize 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' ) ) {
+
+			// 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' );
+		}
+
+	// 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 ) );
+	}
+
+	// No result so return false
+	if ( empty( $metas ) )
+		return false;
+
+	// Maybe, just maybe... unserialize
+	$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 );
+
+	// Filter result before returning
+	return apply_filters( 'bp_activity_get_meta', $retval, $activity_id, $meta_key );
+}
+
+/**
+ * Update activity meta
+ *
+ * @since 1.2.0
+ *
+ * @param int $activity_id
+ * @param string $meta_key
+ * @param string $meta_value
+ *
+ * @global object $wpdb
+ * @global object $bp BuddyPress global settings
+ * @uses maybe_serialize()
+ * @uses bp_activity_delete_meta()
+ * @uses wp_cache_set()
+ *
+ * @return bool True on success, false on failure
+ */
+function bp_activity_update_meta( $activity_id, $meta_key, $meta_value ) {
+	global $wpdb, $bp;
+
+	// Make sure activity_id is valid
+	if ( !is_numeric( $activity_id ) )
+		return false;
+
+	// Sanitize key
+	$meta_key = preg_replace( '|[^a-z0-9_]|i', '', $meta_key );
+
+	// Sanitize value
+	if ( is_string( $meta_value ) )
+		$meta_value = stripslashes( $wpdb->escape( $meta_value ) );
+
+	// Maybe, just maybe... serialize
+	$meta_value = maybe_serialize( $meta_value );
+
+	// If value is empty, delete the meta key
+	if ( empty( $meta_value ) )
+		return bp_activity_delete_meta( $activity_id, $meta_key );
+
+	// See if meta key exists for activity_id
+	$cur = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM {$bp->activity->table_name_meta} WHERE activity_id = %d AND meta_key = %s", $activity_id, $meta_key ) );
+
+	// Meta key does not exist so INSERT
+	if ( empty( $cur ) )
+		$wpdb->query( $wpdb->prepare( "INSERT INTO {$bp->activity->table_name_meta} ( activity_id, meta_key, meta_value ) VALUES ( %d, %s, %s )", $activity_id, $meta_key, $meta_value ) );
+
+	// Meta key exists, so UPDATE
+	else if ( $cur->meta_value != $meta_value )
+		$wpdb->query( $wpdb->prepare( "UPDATE {$bp->activity->table_name_meta} SET meta_value = %s WHERE activity_id = %d AND meta_key = %s", $meta_value, $activity_id, $meta_key ) );
+
+	// Weirdness, so return false
+	else
+		return false;
+
+	// Set cache
+	wp_cache_set( 'bp_activity_meta_' . $meta_key . '_' . $activity_id, $meta_value, 'bp' );
+
+	// Victory is ours!
+	return true;
+}
+
+/** Clean up *****************************************************************/
+
+/**
+ * Completely remove a user's activity data
+ *
+ * @since 1.5.0
+ *
+ * @param int $user_id
+ *
+ * @uses is_user_logged_in()
+ * @uses bp_activity_delete()
+ * @uses bp_delete_user_meta()
+ * @uses do_action() To call the 'bp_activity_remove_data' hook
+ * @uses do_action() To call the 'bp_activity_remove_all_user_data' hook
+ */
+function bp_activity_remove_all_user_data( $user_id = 0 ) {
+
+	// Do not delete user data unless a logged in user says so
+	if ( empty( $user_id ) || !is_user_logged_in() )
+		return false;
+
+	// Clear the user's activity from the sitewide stream and clear their activity tables
+	bp_activity_delete( array( 'user_id' => $user_id ) );
+
+	// Remove any usermeta
+	bp_delete_user_meta( $user_id, 'bp_latest_update' );
+	bp_delete_user_meta( $user_id, 'bp_favorite_activities' );
+
+	// Execute additional code
+	do_action( 'bp_activity_remove_data', $user_id ); // Deprecated! Do not use!
+
+	// Use this going forward
+	do_action( 'bp_activity_remove_all_user_data', $user_id );
+}
+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
+ *
+ * @since 1.2.0
+ *
+ * @global object $bp BuddyPress global settings
+ * @uses bp_activity_set_action()
+ * @uses do_action() To call the 'updates_register_activity_actions' hook
+ */
+function updates_register_activity_actions() {
+	global $bp;
+
+	bp_activity_set_action( $bp->activity->id, 'activity_update', __( 'Posted an update', 'buddypress' ) );
+
+	do_action( 'updates_register_activity_actions' );
+}
+add_action( 'bp_register_activity_actions', 'updates_register_activity_actions' );
+
+/******************************************************************************
+ * 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.
+ */
+
+/**
+ * Retrieve an activity or activities
+ *
+ * @since 1.2.0
+ *
+ * @param array $args
+ *
+ * @uses wp_parse_args()
+ * @uses wp_cache_get()
+ * @uses wp_cache_set()
+ * @uses BP_Activity_Activity::get() {@link BP_Activity_Activity}
+ * @uses apply_filters_ref_array() To call the 'bp_activity_get' hook
+ *
+ * @return object $activity The activity/activities object
+ */
+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
+
+		/**
+		 * Pass filters as an array -- all filter items can be multiple values comma separated:
+		 * array(
+		 * 	'user_id'      => false, // user_id to filter on
+		 *	'object'       => false, // object to filter on e.g. groups, profile, status, friends
+		 *	'action'       => false, // action to filter on e.g. activity_update, profile_updated
+		 *	'primary_id'   => false, // object ID to filter on e.g. a group_id or forum_id or blog_id etc.
+		 *	'secondary_id' => false, // secondary object ID to filter on e.g. a post_id
+		 * );
+		 */
+		'filter' => array()
+	);
+	$r = wp_parse_args( $args, $defaults );
+	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 ( !$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 );
+			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 );
+
+	return apply_filters_ref_array( 'bp_activity_get', array( &$activity, &$r ) );
+}
+
+/**
+ * Fetch specific activity items
+ *
+ * @since 1.2.0
+ *
+ * @param array $args See docs for $defaults for details
+ *
+ * @uses wp_parse_args()
+ * @uses apply_filters() To call the 'bp_activity_get_specific' hook
+ * @uses BP_Activity_Activity::get() {@link BP_Activity_Activity}
+ *
+ * @return array The array returned by BP_Activity_Activity::get()
+ */
+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
+	);
+	$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 ) );
+}
+
+/**
+ * Add an activity item
+ *
+ * @since 1.1.0
+ *
+ * @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}
+ * @uses wp_cache_delete()
+ * @uses do_action() To call the 'bp_activity_add' hook
+ *
+ * @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.
+
+		'action'            => '',    // The activity action - e.g. "Jon Doe posted an update"
+		'content'           => '',    // Optional: The content of the activity item e.g. "BuddyPress is awesome guys!"
+
+		'component'         => false, // The name/ID of the component e.g. groups, profile, mycomponent
+		'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.
+		'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?
+	);
+	$params = wp_parse_args( $args, $defaults );
+	extract( $params, EXTR_SKIP );
+
+	// Make sure we are backwards compatible
+	if ( empty( $component ) && !empty( $component_name ) )
+		$component = $component_name;
+
+	if ( empty( $type ) && !empty( $component_action ) )
+		$type = $component_action;
+
+	// Setup activity to be added
+	$activity                    = new BP_Activity_Activity( $id );
+	$activity->user_id           = $user_id;
+	$activity->component         = $component;
+	$activity->type              = $type;
+	$activity->action            = $action;
+	$activity->content           = $content;
+	$activity->primary_link      = $primary_link;
+	$activity->item_id           = $item_id;
+	$activity->secondary_item_id = $secondary_item_id;
+	$activity->date_recorded     = $recorded_time;
+	$activity->hide_sitewide     = $hide_sitewide;
+
+	if ( !$activity->save() )
+		return false;
+
+	// If this is an activity comment, rebuild the tree
+	if ( 'activity_comment' == $activity->type )
+		BP_Activity_Activity::rebuild_activity_comment_tree( $activity->item_id );
+
+	wp_cache_delete( 'bp_activity_sitewide_front', 'bp' );
+	do_action( 'bp_activity_add', $params );
+
+	return $activity->id;
+}
+
+/**
+ * Post an activity update
+ *
+ * @since 1.2.0
+ *
+ * @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_core_get_userlink()
+ * @uses bp_activity_add()
+ * @uses apply_filters() To call the 'bp_activity_new_update_action' hook
+ * @uses apply_filters() To call the 'bp_activity_new_update_content' hook
+ * @uses apply_filters() To call the 'bp_activity_new_update_primary_link' hook
+ * @uses bp_update_user_meta()
+ * @uses wp_filter_kses()
+ * @uses do_action() To call the 'bp_activity_posted_update' hook
+ *
+ * @return int $activity_id The activity id
+ */
+function bp_activity_post_update( $args = '' ) {
+	global $bp;
+
+	$defaults = array(
+		'content' => false,
+		'user_id' => $bp->loggedin_user->id
+	);
+	$r = wp_parse_args( $args, $defaults );
+	extract( $r, EXTR_SKIP );
+
+	if ( empty( $content ) || !strlen( trim( $content ) ) )
+		return false;
+
+	if ( bp_core_is_user_spammer( $user_id ) || bp_core_is_user_deleted( $user_id ) )
+		return false;
+
+	// Record this on the user's profile
+	$from_user_link   = bp_core_get_userlink( $user_id );
+	$activity_action  = sprintf( __( '%s posted an update', 'buddypress' ), $from_user_link );
+	$activity_content = $content;
+	$primary_link     = bp_core_get_userlink( $user_id, false, true );
+
+	// Now write the values
+	$activity_id = bp_activity_add( array(
+		'user_id'      => $user_id,
+		'action'       => apply_filters( 'bp_activity_new_update_action', $activity_action ),
+		'content'      => apply_filters( 'bp_activity_new_update_content', $activity_content ),
+		'primary_link' => apply_filters( 'bp_activity_new_update_primary_link', $primary_link ),
+		'component'    => $bp->activity->id,
+		'type'         => 'activity_update'
+	) );
+
+	// 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 ) ) );
+
+	do_action( 'bp_activity_posted_update', $content, $user_id, $activity_id );
+
+	return $activity_id;
+}
+
+/**
+ * Add an activity comment
+ *
+ * @since 1.2.0
+ *
+ * @param array $args See docs for $defaults for details
+ *
+ * @global object $bp BuddyPress global settings
+ * @uses wp_parse_args()
+ * @uses bp_activity_add()
+ * @uses apply_filters() To call the 'bp_activity_comment_action' hook
+ * @uses apply_filters() To call the 'bp_activity_comment_content' hook
+ * @uses bp_activity_new_comment_notification()
+ * @uses wp_cache_delete()
+ * @uses do_action() To call the 'bp_activity_comment_posted' hook
+ *
+ * @return int $comment_id The comment id
+ */
+function bp_activity_new_comment( $args = '' ) {
+	global $bp;
+
+	$defaults = array(
+		'id'          => false,
+		'content'     => false,
+		'user_id'     => $bp->loggedin_user->id,
+		'activity_id' => false, // ID of the root activity item
+		'parent_id'   => false  // ID of a parent comment (optional)
+	);
+
+	$params = wp_parse_args( $args, $defaults );
+	extract( $params, EXTR_SKIP );
+
+	if ( empty($content) || empty($user_id) || empty($activity_id) )
+		return false;
+
+	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;
+
+	// 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,
+		'secondary_item_id' => $parent_id,
+		'hide_sitewide' => $is_hidden
+	) );
+
+	// Send an email notification if settings allow
+	bp_activity_new_comment_notification( $comment_id, $user_id, $params );
+
+	// Clear the comment cache for this activity
+	wp_cache_delete( 'bp_activity_comments_' . $parent_id );
+
+	do_action( 'bp_activity_comment_posted', $comment_id, $params );
+
+	return $comment_id;
+}
+
+/**
+ * Fetch the activity_id for an existing activity entry in the DB.
+ *
+ * @since 1.2.0
+ *
+ * @param array $args See docs for $defaults for details
+ *
+ * @uses wp_parse_args()
+ * @uses apply_filters() To call the 'bp_activity_get_activity_id' hook
+ * @uses BP_Activity_Activity::save() {@link BP_Activity_Activity}
+ *
+ * @return int $activity_id The activity id
+ */
+function bp_activity_get_activity_id( $args = '' ) {
+	$defaults = array(
+		'user_id'           => false,
+		'component'         => false,
+		'type'              => false,
+		'item_id'           => false,
+		'secondary_item_id' => false,
+		'action'            => false,
+		'content'           => false,
+		'date_recorded'     => false,
+	);
+
+	$r = wp_parse_args( $args, $defaults );
+	extract( $r, EXTR_SKIP );
+
+ 	return apply_filters( 'bp_activity_get_activity_id', BP_Activity_Activity::get_id( $user_id, $component, $type, $item_id, $secondary_item_id, $action, $content, $date_recorded ) );
+}
+
+/**
+ * Deleting Activity
+ *
+ * If you're looking to hook into one action that provides the ID(s) of
+ * the activity/activities deleted, then use:
+ *
+ * add_action( 'bp_activity_deleted_activities', 'my_function' );
+ *
+ * The action passes one parameter that is a single activity ID or an
+ * array of activity IDs depending on the number deleted.
+ *
+ * If you are deleting an activity comment please use bp_activity_delete_comment();
+ *
+ * @since 1.0.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}
+ * @uses do_action() To call the 'bp_before_activity_delete' hook
+ * @uses bp_get_user_meta()
+ * @uses bp_delete_user_meta()
+ * @uses do_action() To call the 'bp_activity_delete' hook
+ * @uses do_action() To call the 'bp_activity_deleted_activities' hook
+ * @uses wp_cache_delete()
+ *
+ * @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(
+		'id'                => false,
+		'action'            => false,
+		'content'           => false,
+		'component'         => false,
+		'type'              => false,
+		'primary_link'      => false,
+		'user_id'           => false,
+		'item_id'           => false,
+		'secondary_item_id' => false,
+		'date_recorded'     => false,
+		'hide_sitewide'     => false
+	);
+
+	$args = wp_parse_args( $args, $defaults );
+
+	// Adjust the new mention count of any mentioned member
+	bp_activity_adjust_mention_count( $args['id'], 'delete' );
+
+	if ( !$activity_ids_deleted = BP_Activity_Activity::delete( $args ) )
+		return false;
+
+	// Check if the user's latest update has been deleted
+	if ( empty( $args['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 ) )
+			bp_delete_user_meta( $user_id, 'bp_latest_update' );
+	}
+
+	do_action( 'bp_activity_delete', $args );
+	do_action( 'bp_activity_deleted_activities', $activity_ids_deleted );
+
+	wp_cache_delete( 'bp_activity_sitewide_front', 'bp' );
+
+	return true;
+}
+
+	/**
+	 * Delete an activity item by activity id
+	 *
+	 * You should use bp_activity_delete() instead
+	 *
+	 * @since 1.1.0
+	 * @deprecated 1.2.0
+	 *
+	 * @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 );
+		$r = wp_parse_args( $args, $defaults );
+		extract( $r, EXTR_SKIP );
+
+		return bp_activity_delete( array( 'item_id' => $item_id, 'component' => $component, 'type' => $type, 'user_id' => $user_id, 'secondary_item_id' => $secondary_item_id ) );
+	}
+
+	/**
+	 * Delete an activity item by activity id
+	 *
+	 * You should use bp_activity_delete() instead
+	 *
+	 * @since 1.1.0
+	 * @deprecated 1.2.0
+	 *
+	 * @param int $activity_id The activity id
+	 *
+	 * @uses bp_activity_delete()
+	 *
+	 * @return bool True on success, false on failure
+	 */
+	function bp_activity_delete_by_activity_id( $activity_id ) {
+		return bp_activity_delete( array( 'id' => $activity_id ) );
+	}
+
+	/**
+	 * Delete an activity item by it's content
+	 *
+	 * You should use bp_activity_delete() instead
+	 *
+	 * @since 1.1.0
+	 * @deprecated 1.2.0
+	 *
+	 * @param int $user_id The user id
+	 * @param string $content The activity id
+	 * @param string $component The activity component
+	 * @param string $type The activity type
+	 *
+	 * @uses bp_activity_delete()
+	 *
+	 * @return bool True on success, false on failure
+	 */
+	function bp_activity_delete_by_content( $user_id, $content, $component, $type ) {
+		return bp_activity_delete( array( 'user_id' => $user_id, 'content' => $content, 'component' => $component, 'type' => $type ) );
+	}
+
+	/**
+	 * Delete a user's activity for a component
+	 *
+	 * You should use bp_activity_delete() instead
+	 *
+	 * @since 1.1.0
+	 * @deprecated 1.2.0
+	 *
+	 * @param int $user_id The user id
+	 * @param string $component The activity component
+	 *
+	 * @uses bp_activity_delete()
+	 *
+	 * @return bool True on success, false on failure
+	 */
+	function bp_activity_delete_for_user_by_component( $user_id, $component ) {
+		return bp_activity_delete( array( 'user_id' => $user_id, 'component' => $component ) );
+	}
+
+/**
+ * Delete an activity comment
+ *
+ * @since 1.2.0
+ *
+ * @param int $activity_id The activity id
+ * @param int $comment_id The activity comment id
+ *
+ * @uses apply_filters() To call the 'bp_activity_delete_comment_pre' hook
+ * @uses bp_activity_delete_children()
+ * @uses bp_activity_delete()
+ * @uses BP_Activity_Activity::rebuild_activity_comment_tree() {@link BP_Activity_Activity}
+ * @uses do_action() To call the 'bp_activity_delete_comment' hook
+ *
+ * @return bool True on success, false on failure
+ */
+function bp_activity_delete_comment( $activity_id, $comment_id ) {
+	/***
+	 * You may want to hook into this filter if you want to override this function and
+	 * handle the deletion of child comments differently. Make sure you return false.
+	 */
+	if ( !apply_filters( 'bp_activity_delete_comment_pre', true, $activity_id, $comment_id ) )
+		return false;
+
+	// Delete any children of this comment.
+	bp_activity_delete_children( $activity_id, $comment_id );
+
+	// Delete the actual comment
+	if ( !bp_activity_delete( array( 'id' => $comment_id, 'type' => 'activity_comment' ) ) )
+		return false;
+
+	// Recalculate the comment tree
+	BP_Activity_Activity::rebuild_activity_comment_tree( $activity_id );
+
+	do_action( 'bp_activity_delete_comment', $activity_id, $comment_id );
+
+	return true;
+}
+
+	/**
+	 * Delete an activity comment's children
+	 *
+	 * @since 1.2.0
+	 *
+	 * @param int $activity_id The activity id
+	 * @param int $comment_id The activity comment id
+	 *
+	 * @uses BP_Activity_Activity::get_child_comments() {@link BP_Activity_Activity}
+	 * @uses bp_activity_delete_children()
+	 * @uses bp_activity_delete()
+	 */
+	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 )
+				bp_activity_delete_children( $activity_id, $child->id );
+		}
+		bp_activity_delete( array( 'secondary_item_id' => $comment_id, 'type' => 'activity_comment', 'item_id' => $activity_id ) );
+	}
+
+/**
+ * Get the permalink for a single activity item
+ *
+ * When only the $activity_id param is passed, BP has to instantiate a new BP_Activity_Activity
+ * 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
+ *
+ * @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
+ *
+ * @return string $link Permalink for the activity item
+ */
+function bp_activity_get_permalink( $activity_id, $activity_obj = false ) {
+	global $bp;
+
+	if ( !$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 )
+		$link = $activity_obj->primary_link;
+	else {
+		if ( 'activity_comment' == $activity_obj->type )
+			$link = bp_get_root_domain() . '/' . bp_get_activity_root_slug() . '/p/' . $activity_obj->item_id . '/';
+		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 ) );
+}
+
+/**
+ * Hide a user's activity
+ *
+ * @since 1.2.0
+ *
+ * @param int $user_id The user id
+ *
+ * @uses BP_Activity_Activity::hide_all_for_user() {@link BP_Activity_Activity}
+ *
+ * @return bool True on success, false on failure
+ */
+function bp_activity_hide_user_activity( $user_id ) {
+	return BP_Activity_Activity::hide_all_for_user( $user_id );
+}
+
+/**
+ * Take content, remove all images and replace them with one thumbnail image.
+ *
+ * @since 1.2.0
+ *
+ * @param string $content The content to work with
+ * @param string $link Optional. The URL that the image should link to
+ *
+ * @uses esc_attr()
+ * @uses apply_filters() To call the 'bp_activity_thumbnail_content_images' hook
+ *
+ * @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 );
+
+	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 );
+
+		if ( !empty( $src ) ) {
+			$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 );
+
+			if ( empty( $width ) || empty( $height ) ) {
+				$width = 100;
+				$height = 100;
+			}
+
+			$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" />';
+
+			if ( !empty( $link ) ) {
+				$image = '<a href="' . $link . '">' . $image . '</a>';
+			}
+
+			$content = $image . $content;
+		}
+	}
+
+	return apply_filters( 'bp_activity_thumbnail_content_images', $content, $matches );
+}
+
+/** Embeds *******************************************************************/
+
+/**
+ * Grabs the activity update ID and attempts to retrieve the oEmbed cache (if it exists)
+ * during the activity loop.  If no cache and link is embeddable, cache it.
+ *
+ * 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
+ *
+ * @see BP_Embed
+ * @see bp_embed_activity_cache()
+ * @see bp_embed_activity_save_cache()
+ *
+ * @uses add_filter() To attach 'bp_get_activity_id' to 'embed_post_id'
+ * @uses add_filter() To attach 'bp_embed_activity_cache' to 'bp_embed_get_cache'
+ * @uses add_action() To attach 'bp_embed_activity_save_cache' to 'bp_embed_update_cache'
+ */
+function bp_activity_embed() {
+	add_filter( 'embed_post_id',         'bp_get_activity_id'                  );
+	add_filter( 'bp_embed_get_cache',    'bp_embed_activity_cache',      10, 3 );
+	add_action( 'bp_embed_update_cache', 'bp_embed_activity_save_cache', 10, 3 );
+}
+add_action( 'activity_loop_start', 'bp_activity_embed' );
+
+/**
+ * Grabs the activity comment ID and attempts to retrieve the oEmbed cache (if it exists)
+ * when BP is recursing through activity comments {@link bp_activity_recurse_comments()}.
+ * If no cache and link is embeddable, cache it.
+ *
+ * @since 1.5
+ *
+ * @see BP_Embed
+ * @see bp_embed_activity_cache()
+ * @see bp_embed_activity_save_cache()
+ *
+ * @uses add_filter() To attach 'bp_get_activity_comment_id' to 'embed_post_id'
+ * @uses add_filter() To attach 'bp_embed_activity_cache' to 'bp_embed_get_cache'
+ * @uses add_action() To attach 'bp_embed_activity_save_cache' to 'bp_embed_update_cache'
+ */
+function bp_activity_comment_embed() {
+	add_filter( 'embed_post_id',         'bp_get_activity_comment_id'          );
+	add_filter( 'bp_embed_get_cache',    'bp_embed_activity_cache',      10, 3 );
+	add_action( 'bp_embed_update_cache', 'bp_embed_activity_save_cache', 10, 3 );
+}
+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
+ *
+ * @see BP_Embed
+ *
+ * @param object $activity The activity that is being expanded
+ *
+ * @global object $bp BuddyPress global settings
+ * @uses add_filter() To attach create_function() to 'embed_post_id'
+ * @uses add_filter() To attach 'bp_embed_activity_cache' to 'bp_embed_get_cache'
+ * @uses add_action() To attach 'bp_embed_activity_save_cache' to 'bp_embed_update_cache'
+ */
+function bp_dtheme_embed_read_more( $activity ) {
+	global $bp;
+
+	$bp->activity->read_more_id = $activity->id;
+
+	add_filter( 'embed_post_id',            create_function( '', 'global $bp; return $bp->activity->read_more_id;' ) );
+	add_filter( 'bp_embed_get_cache',       'bp_embed_activity_cache',      10, 3 );
+	add_action( 'bp_embed_update_cache',    'bp_embed_activity_save_cache', 10, 3 );
+}
+add_action( 'bp_dtheme_get_single_activity_content', 'bp_dtheme_embed_read_more' );
+
+/**
+ * Removes the 'embed_post_id' filter after {@link bp_activity_recurse_comments()}
+ * is rendered to avoid conflict with the 'embed_post_id' filter in
+ * {@link bp_activity_embed()} or any other component embeds.
+ *
+ * @since 1.5
+ *
+ * @see bp_activity_comment_embed()
+ *
+ * @uses remove_filter() To remove 'bp_get_activity_comment_id' from 'embed_post_id'
+ */
+function bp_activity_comment_embed_after_recurse() {
+	remove_filter( 'embed_post_id', 'bp_get_activity_comment_id' );
+}
+add_action( 'bp_after_activity_comment', 'bp_activity_comment_embed_after_recurse' );
+
+/**
+ * Wrapper function for {@link bp_activity_get_meta()}.
+ * Used during {@link BP_Embed::parse_oembed()} via {@link bp_activity_embed()}.
+ *
+ * @since 1.5
+ *
+ * @uses bp_activity_get_meta()
+ *
+ * @return mixed The activity meta
+ */
+function bp_embed_activity_cache( $cache, $id, $cachekey ) {
+	return bp_activity_get_meta( $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
+ *
+ * @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
new file mode 100644
index 0000000000000000000000000000000000000000..a31b777c6353dc462d897466d82d0ce2e00dc1a8
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-activity/bp-activity-loader.php
@@ -0,0 +1,320 @@
+<?php
+
+/**
+ * BuddyPress Activity Streams Loader
+ *
+ * An activity stream component, for users, groups, and blog tracking.
+ *
+ * @package BuddyPress
+ * @subpackage ActivityCore
+ */
+
+// Exit if accessed directly
+if ( !defined( 'ABSPATH' ) ) exit;
+
+/**
+ * Main Activity Class
+ *
+ * @since 1.5.0
+ */
+class BP_Activity_Component extends BP_Component {
+
+	/**
+	 * Start the activity component creation process
+	 *
+	 * @since 1.5.0
+	 */
+	function BP_Activity_Component() {
+		$this->__construct();
+	}
+
+	function __construct() {
+		parent::start(
+			'activity',
+			__( 'Activity Streams', 'buddypress' ),
+			BP_PLUGIN_DIR
+		);
+	}
+
+	/**
+	 * Include files
+	 *
+	 * @since 1.5.0
+	 */
+	function includes() {
+		// Files to include
+		$includes = array(
+			'actions',
+			'screens',
+			'filters',
+			'classes',
+			'template',
+			'functions',
+			'notifications',
+		);
+
+		parent::includes( $includes );
+	}
+
+	/**
+	 * Setup globals
+	 *
+	 * The BP_ACTIVITY_SLUG constant is deprecated, and only used here for
+	 * backwards compatibility.
+	 *
+	 * @since 1.5.0
+	 *
+	 * @global object $bp BuddyPress global settings
+	 */
+	function setup_globals() {
+		global $bp;
+
+		// Define a slug, if necessary
+		if ( !defined( 'BP_ACTIVITY_SLUG' ) )
+			define( 'BP_ACTIVITY_SLUG', $this->id );
+
+		// Global tables for activity component
+		$global_tables = array(
+			'table_name'      => $bp->table_prefix . 'bp_activity',
+			'table_name_meta' => $bp->table_prefix . 'bp_activity_meta',
+		);
+
+		// 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,
+			'search_string'         => __( 'Search Activity...', 'buddypress' ),
+			'global_tables'         => $global_tables,
+			'notification_callback' => 'bp_activity_format_notifications',
+		);
+
+		parent::setup_globals( $globals );
+	}
+
+	/**
+	 * Setup BuddyBar navigation
+	 *
+	 * @since 1.5.0
+	 *
+	 * @global object $bp BuddyPress global settings
+	 * @uses bp_is_active()
+	 * @uses is_user_logged_in()
+	 * @uses bp_get_friends_slug()
+	 * @uses bp_get_groups_slug()
+	 */
+	function setup_nav() {
+		global $bp;
+
+		// Add 'Activity' to the main navigation
+		$main_nav = array(
+			'name'                => __( 'Activity', 'buddypress' ),
+			'slug'                => $this->slug,
+			'position'            => 10,
+			'screen_function'     => 'bp_activity_screen_my_activity',
+			'default_subnav_slug' => 'just-me',
+			'item_css_id'         => $this->id
+		);
+
+		// Stop if there is no user displayed or logged in
+		if ( !is_user_logged_in() && !isset( $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;
+		else
+			return;
+
+		// User link
+		$activity_link = trailingslashit( $user_domain . $this->slug );
+
+		// Add the subnav items to the activity nav item if we are using a theme that supports this
+		$sub_nav[] = array(
+			'name'            => __( 'Personal', 'buddypress' ),
+			'slug'            => 'just-me',
+			'parent_url'      => $activity_link,
+			'parent_slug'     => $this->slug,
+			'screen_function' => 'bp_activity_screen_my_activity',
+			'position'        => 10
+		);
+
+		// @ mentions
+		$sub_nav[] = array(
+			'name'            => __( 'Mentions', 'buddypress' ),
+			'slug'            => 'mentions',
+			'parent_url'      => $activity_link,
+			'parent_slug'     => $this->slug,
+			'screen_function' => 'bp_activity_screen_mentions',
+			'position'        => 20,
+			'item_css_id'     => 'activity-mentions'
+		);
+
+		// Favorite activity items
+		$sub_nav[] = array(
+			'name'            => __( 'Favorites', 'buddypress' ),
+			'slug'            => 'favorites',
+			'parent_url'      => $activity_link,
+			'parent_slug'     => $this->slug,
+			'screen_function' => 'bp_activity_screen_favorites',
+			'position'        => 30,
+			'item_css_id'     => 'activity-favs'
+		);
+
+		// Additional menu if friends is active
+		if ( bp_is_active( 'friends' ) ) {
+			$sub_nav[] = array(
+				'name'            => __( 'Friends', 'buddypress' ),
+				'slug'            => bp_get_friends_slug(),
+				'parent_url'      => $activity_link,
+				'parent_slug'     => $this->slug,
+				'screen_function' => 'bp_activity_screen_friends',
+				'position'        => 40,
+				'item_css_id'     => 'activity-friends'
+			) ;
+		}
+
+		// Additional menu if groups is active
+		if ( bp_is_active( 'groups' ) ) {
+			$sub_nav[] = array(
+				'name'            => __( 'Groups', 'buddypress' ),
+				'slug'            => bp_get_groups_slug(),
+				'parent_url'      => $activity_link,
+				'parent_slug'     => $this->slug,
+				'screen_function' => 'bp_activity_screen_groups',
+				'position'        => 50,
+				'item_css_id'     => 'activity-groups'
+			);
+		}
+
+		parent::setup_nav( $main_nav, $sub_nav );
+	}
+
+	/**
+	 * Set up the admin bar
+	 *
+	 * @since 1.5.0
+	 *
+	 * @global object $bp BuddyPress global settings
+	 * @uses is_user_logged_in()
+	 * @uses trailingslashit()
+	 * @uses bp_get_total_mention_count_for_user()
+	 * @uses bp_loggedin_user_id()
+	 * @uses bp_is_active()
+	 * @uses bp_get_friends_slug()
+	 * @uses bp_get_groups_slug()
+	 */
+	function setup_admin_bar() {
+		global $bp;
+
+		// Prevent debug notices
+		$wp_admin_nav = array();
+
+		// Menus for logged in user
+		if ( is_user_logged_in() ) {
+
+			// Setup the logged in user variables
+			$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 );
+			} else {
+				$title = __( 'Mentions', 'buddypress' );
+			}
+
+			// Add the "Activity" sub menu
+			$wp_admin_nav[] = array(
+				'parent' => $bp->my_account_menu_id,
+				'id'     => 'my-account-' . $this->id,
+				'title'  => __( 'Activity', 'buddypress' ),
+				'href'   => trailingslashit( $activity_link )
+			);
+
+			// Mentions
+			$wp_admin_nav[] = array(
+				'parent' => 'my-account-' . $this->id,
+				'id'     => 'my-account-' . $this->id . '-mentions',
+				'title'  => $title,
+				'href'   => trailingslashit( $activity_link . 'mentions' )
+			);
+
+			// Personal
+			$wp_admin_nav[] = array(
+				'parent' => 'my-account-' . $this->id,
+				'id'     => 'my-account-' . $this->id . '-personal',
+				'title'  => __( 'Personal', 'buddypress' ),
+				'href'   => trailingslashit( $activity_link )
+			);
+
+			// Favorites
+			$wp_admin_nav[] = array(
+				'parent' => 'my-account-' . $this->id,
+				'id'     => 'my-account-' . $this->id . '-favorites',
+				'title'  => __( 'Favorites', 'buddypress' ),
+				'href'   => trailingslashit( $activity_link . 'favorites' )
+			);
+
+			// Friends?
+			if ( bp_is_active( 'friends' ) ) {
+				$wp_admin_nav[] = array(
+					'parent' => 'my-account-' . $this->id,
+					'id'     => 'my-account-' . $this->id . '-friends',
+					'title'  => __( 'Friends', 'buddypress' ),
+					'href'   => trailingslashit( $activity_link . bp_get_friends_slug() )
+				);
+			}
+
+			// Groups?
+			if ( bp_is_active( 'groups' ) ) {
+				$wp_admin_nav[] = array(
+					'parent' => 'my-account-' . $this->id,
+					'id'     => 'my-account-' . $this->id . '-groups',
+					'title'  => __( 'Groups', 'buddypress' ),
+					'href'   => trailingslashit( $activity_link . bp_get_groups_slug() )
+				);
+			}
+		}
+
+		parent::setup_admin_bar( $wp_admin_nav );
+	}
+
+	/**
+	 * Sets up the title for pages and <title>
+	 *
+	 * @since 1.5.0
+	 *
+	 * @global object $bp BuddyPress global settings
+	 * @uses bp_is_activity_component()
+	 * @uses bp_is_my_profile()
+	 * @uses bp_core_fetch_avatar()
+	 */
+	function setup_title() {
+		global $bp;
+
+		// Adjust title based on view
+		if ( bp_is_activity_component() ) {
+			if ( bp_is_my_profile() ) {
+				$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'
+				) );
+				$bp->bp_options_title  = $bp->displayed_user->fullname;
+			}
+		}
+
+		parent::setup_title();
+	}
+}
+
+// Create the activity component
+$bp->activity = new BP_Activity_Component();
+
+?>
\ 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 c6ec252e53ba25c23b74f3b40099b4c074842a58..0c27c53537ebe56a4fecc191e97e6f46d360746d 100644
--- a/wp-content/plugins/buddypress/bp-activity/bp-activity-notifications.php
+++ b/wp-content/plugins/buddypress/bp-activity/bp-activity-notifications.php
@@ -1,59 +1,135 @@
 <?php
 
-function bp_activity_at_message_notification( $content, $poster_user_id, $activity_id ) {
+/**
+ * BuddyPress Activity Notifications
+ *
+ * @package BuddyPress
+ * @subpackage ActivityNotifications
+ */
+
+// Exit if accessed directly
+if ( !defined( 'ABSPATH' ) ) exit;
+
+/**
+ * Sends an email notification and a BP notification when someone mentions you in an update
+ *
+ * @since 1.2.0
+ *
+ * @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()
+ * @uses bp_activity_get_permalink()
+ * @uses bp_core_get_user_domain()
+ * @uses bp_get_settings_slug()
+ * @uses bp_activity_filter_kses()
+ * @uses bp_core_get_core_userdata()
+ * @uses wp_specialchars_decode()
+ * @uses get_blog_option()
+ * @uses bp_is_active()
+ * @uses bp_is_group()
+ * @uses bp_get_current_group_name()
+ * @uses apply_filters() To call the 'bp_activity_at_message_notification_to' hook
+ * @uses apply_filters() To call the 'bp_activity_at_message_notification_subject' hook
+ * @uses apply_filters() To call the 'bp_activity_at_message_notification_message' hook
+ * @uses wp_mail()
+ * @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;
 
-	/* Scan for @username strings in an activity update. Notify each user. */
-	$pattern = '/[@]+([A-Za-z0-9-_\.]+)/';
-	preg_match_all( $pattern, $content, $usernames );
+	$activity = new BP_Activity_Activity( $activity_id );
 
-	/* Make sure there's only one instance of each username */
-	if ( !$usernames = array_unique( $usernames[1] ) )
-		return false;
+	$subject = '';
+	$message = '';
 
-	foreach( (array)$usernames as $username ) {
-		if ( !$receiver_user_id = bp_core_get_userid( $username ) )
-			continue;
+	// Add the BP notification
+	bp_core_add_notification( $activity_id, $receiver_user_id, 'activity', 'new_at_mention', $activity->user_id );
 
-		// Now email the user with the contents of the message (if they have enabled email notifications)
-		if ( 'no' != get_user_meta( $receiver_user_id, 'notification_activity_new_mention', true ) ) {
-			$poster_name = bp_core_get_user_displayname( $poster_user_id );
+	// Now email the user with the contents of the message (if they have enabled email notifications)
+	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_SETTINGS_SLUG . '/notifications/';
+		$message_link = bp_activity_get_permalink( $activity_id );
+		$settings_link = bp_core_get_user_domain( $receiver_user_id ) . bp_get_settings_slug() . '/notifications/';
 
-			$poster_name = stripslashes( $poster_name );
-			$content = bp_activity_filter_kses( stripslashes($content) );
+		$poster_name = stripslashes( $poster_name );
+		$content = bp_activity_filter_kses( strip_tags( stripslashes( $activity->content ) ) );
 
-			// Set up and send the message
-			$ud       = bp_core_get_core_userdata( $receiver_user_id );
-			$to       = $ud->user_email;
-			$sitename = wp_specialchars_decode( get_blog_option( BP_ROOT_BLOG, 'blogname' ), ENT_QUOTES );
-			$subject  = '[' . $sitename . '] ' . sprintf( __( '%s mentioned you in an update', 'buddypress' ), $poster_name );
+		// Set up and send the message
+		$ud       = bp_core_get_core_userdata( $receiver_user_id );
+		$to       = $ud->user_email;
+		$sitename = wp_specialchars_decode( get_blog_option( bp_get_root_blog_id(), 'blogname' ), ENT_QUOTES );
+		$subject  = '[' . $sitename . '] ' . sprintf( __( '%s mentioned you in an update', 'buddypress' ), $poster_name );
 
-$message = sprintf( __(
-'%s mentioned you in an update:
+		if ( bp_is_active( 'groups' ) && bp_is_group() ) {
+			$message = sprintf( __(
+'%1$s mentioned you in the group "%2$s":
 
-"%s"
+"%3$s"
 
-To view and respond to the message, log in and visit: %s
+To view and respond to the message, log in and visit: %4$s
 
 ---------------------
-', 'buddypress' ), $poster_name, $content, $message_link );
+', 'buddypress' ), $poster_name, bp_get_current_group_name(), $content, $message_link );
+		} else {
+			$message = sprintf( __(
+'%1$s mentioned you in an update:
 
-			$message .= sprintf( __( 'To disable these notifications please log in and go to: %s', 'buddypress' ), $settings_link );
+"%2$s"
 
-			/* Send the message */
-			$to = apply_filters( 'bp_activity_at_message_notification_to', $to );
-			$subject = apply_filters( 'bp_activity_at_message_notification_subject', $subject, $poster_name );
-			$message = apply_filters( 'bp_activity_at_message_notification_message', $message, $poster_name, $content, $message_link );
+To view and respond to the message, log in and visit: %3$s
 
-			wp_mail( $to, $subject, $message );
+---------------------
+', 'buddypress' ), $poster_name, $content, $message_link );
 		}
+
+		$message .= sprintf( __( 'To disable these notifications please log in and go to: %s', 'buddypress' ), $settings_link );
+
+		/* Send the message */
+		$to 	 = apply_filters( 'bp_activity_at_message_notification_to', $to );
+		$subject = apply_filters( 'bp_activity_at_message_notification_subject', $subject, $poster_name );
+		$message = apply_filters( 'bp_activity_at_message_notification_message', $message, $poster_name, $content, $message_link, $settings_link );
+
+		wp_mail( $to, $subject, $message );
 	}
+
+	do_action( 'bp_activity_sent_mention_email', $activity, $subject, $message, $content );
 }
-add_action( 'bp_activity_posted_update', 'bp_activity_at_message_notification', 10, 3 );
 
+/**
+ * Sends an email notification and a BP notification when someone mentions you in an update
+ *
+ * @since 1.2.0
+ *
+ * @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()
+ * @uses bp_core_get_user_domain()
+ * @uses bp_get_settings_slug()
+ * @uses bp_activity_filter_kses()
+ * @uses bp_core_get_core_userdata()
+ * @uses wp_specialchars_decode()
+ * @uses get_blog_option()
+ * @uses bp_get_root_blog_id()
+ * @uses apply_filters() To call the 'bp_activity_new_comment_notification_to' hook
+ * @uses apply_filters() To call the 'bp_activity_new_comment_notification_subject' hook
+ * @uses apply_filters() To call the 'bp_activity_new_comment_notification_message' hook
+ * @uses wp_mail()
+ * @uses do_action() To call the 'bp_activity_sent_reply_to_update_email' hook
+ * @uses apply_filters() To call the 'bp_activity_new_comment_notification_comment_author_to' hook
+ * @uses apply_filters() To call the 'bp_activity_new_comment_notification_comment_author_subject' hook
+ * @uses apply_filters() To call the 'bp_activity_new_comment_notification_comment_author_message' hook
+ * @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;
 
@@ -61,10 +137,10 @@ function bp_activity_new_comment_notification( $comment_id, $commenter_id, $para
 
 	$original_activity = new BP_Activity_Activity( $activity_id );
 
-	if ( $original_activity->user_id != $commenter_id && 'no' != get_user_meta( $original_activity->user_id, 'notification_activity_new_reply', true ) ) {
+	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_SETTINGS_SLUG . '/notifications/';
+		$settings_link = bp_core_get_user_domain( $original_activity->user_id ) . bp_get_settings_slug() . '/notifications/';
 
 		$poster_name = stripslashes( $poster_name );
 		$content = bp_activity_filter_kses( stripslashes($content) );
@@ -72,15 +148,15 @@ function bp_activity_new_comment_notification( $comment_id, $commenter_id, $para
 		// Set up and send the message
 		$ud       = bp_core_get_core_userdata( $original_activity->user_id );
 		$to       = $ud->user_email;
-		$sitename = wp_specialchars_decode( get_blog_option( BP_ROOT_BLOG, 'blogname' ), ENT_QUOTES );
+		$sitename = wp_specialchars_decode( get_blog_option( bp_get_root_blog_id(), 'blogname' ), ENT_QUOTES );
 		$subject = '[' . $sitename . '] ' . sprintf( __( '%s replied to one of your updates', 'buddypress' ), $poster_name );
 
 $message = sprintf( __(
-'%s replied to one of your updates:
+'%1$s replied to one of your updates:
 
-"%s"
+"%2$s"
 
-To view your original update and all comments, log in and visit: %s
+To view your original update and all comments, log in and visit: %3$s
 
 ---------------------
 ', 'buddypress' ), $poster_name, $content, $thread_link );
@@ -90,9 +166,11 @@ To view your original update and all comments, log in and visit: %s
 		/* Send the message */
 		$to = apply_filters( 'bp_activity_new_comment_notification_to', $to );
 		$subject = apply_filters( 'bp_activity_new_comment_notification_subject', $subject, $poster_name );
-		$message = apply_filters( 'bp_activity_new_comment_notification_message', $message, $poster_name, $content, $thread_link );
+		$message = apply_filters( 'bp_activity_new_comment_notification_message', $message, $poster_name, $content, $thread_link, $settings_link );
 
 		wp_mail( $to, $subject, $message );
+
+		do_action( 'bp_activity_sent_reply_to_update_email', $original_activity->user_id, $subject, $message, $comment_id, $commenter_id, $params );
 	}
 
 	/***
@@ -104,26 +182,26 @@ To view your original update and all comments, log in and visit: %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' != get_user_meta( $parent_comment->user_id, 'notification_activity_new_reply', true ) ) {
+	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_SETTINGS_SLUG . '/notifications/';
+		$settings_link = bp_core_get_user_domain( $parent_comment->user_id ) . bp_get_settings_slug() . '/notifications/';
 
 		// Set up and send the message
 		$ud       = bp_core_get_core_userdata( $parent_comment->user_id );
 		$to       = $ud->user_email;
-		$sitename = wp_specialchars_decode( get_blog_option( BP_ROOT_BLOG, 'blogname' ), ENT_QUOTES );
+		$sitename = wp_specialchars_decode( get_blog_option( bp_get_root_blog_id(), 'blogname' ), ENT_QUOTES );
 		$subject = '[' . $sitename . '] ' . sprintf( __( '%s replied to one of your comments', 'buddypress' ), $poster_name );
 
 		$poster_name = stripslashes( $poster_name );
 		$content = bp_activity_filter_kses( stripslashes( $content ) );
 
 $message = sprintf( __(
-'%s replied to one of your comments:
+'%1$s replied to one of your comments:
 
-"%s"
+"%2$s"
 
-To view the original activity, your comment and all replies, log in and visit: %s
+To view the original activity, your comment and all replies, log in and visit: %3$s
 
 ---------------------
 ', 'buddypress' ), $poster_name, $content, $thread_link );
@@ -133,10 +211,12 @@ To view the original activity, your comment and all replies, log in and visit: %
 		/* Send the message */
 		$to = apply_filters( 'bp_activity_new_comment_notification_comment_author_to', $to );
 		$subject = apply_filters( 'bp_activity_new_comment_notification_comment_author_subject', $subject, $poster_name );
-		$message = apply_filters( 'bp_activity_new_comment_notification_comment_author_message', $message, $poster_name, $content );
+		$message = apply_filters( 'bp_activity_new_comment_notification_comment_author_message', $message, $poster_name, $content, $settings_link, $thread_link );
 
 		wp_mail( $to, $subject, $message );
+
+		do_action( 'bp_activity_sent_reply_to_reply_email', $original_activity->user_id, $subject, $message, $comment_id, $commenter_id, $params );
 	}
 }
 
-?>
+?>
\ No newline at end of file
diff --git a/wp-content/plugins/buddypress/bp-activity/bp-activity-screens.php b/wp-content/plugins/buddypress/bp-activity/bp-activity-screens.php
new file mode 100644
index 0000000000000000000000000000000000000000..ff40b5be70c32b308625d21a9612f1eec63226be
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-activity/bp-activity-screens.php
@@ -0,0 +1,308 @@
+<?php
+
+/**
+ * BuddyPress Activity Screens
+ *
+ * @package BuddyPress
+ * @subpackage ActivityScreens
+ */
+
+// Exit if accessed directly
+if ( !defined( 'ABSPATH' ) ) exit;
+
+/**
+ * Activity screen index
+ *
+ * @since 1.5.0
+ *
+ * @uses bp_displayed_user_id()
+ * @uses bp_is_activity_component()
+ * @uses bp_current_action()
+ * @uses bp_update_is_directory()
+ * @uses do_action() To call the 'bp_activity_screen_index' hook
+ * @uses bp_core_load_template()
+ * @uses apply_filters() To call the 'bp_activity_screen_index' hook
+ */
+function bp_activity_screen_index() {
+	if ( !bp_displayed_user_id() && bp_is_activity_component() && !bp_current_action() ) {
+		bp_update_is_directory( true, 'activity' );
+
+		do_action( 'bp_activity_screen_index' );
+
+		bp_core_load_template( apply_filters( 'bp_activity_screen_index', 'activity/index' ) );
+	}
+}
+add_action( 'bp_screens', 'bp_activity_screen_index' );
+
+/**
+ * Activity screen 'my activity' index
+ *
+ * @since 1.0.0
+ *
+ * @uses do_action() To call the 'bp_activity_screen_my_activity' hook
+ * @uses bp_core_load_template()
+ * @uses apply_filters() To call the 'bp_activity_template_my_activity' hook
+ */
+function bp_activity_screen_my_activity() {
+	do_action( 'bp_activity_screen_my_activity' );
+	bp_core_load_template( apply_filters( 'bp_activity_template_my_activity', 'members/single/home' ) );
+}
+
+/**
+ * Activity screen 'friends' index
+ *
+ * @since 1.0.0
+ *
+ * @uses bp_is_active()
+ * @uses bp_update_is_item_admin()
+ * @uses is_super_admin()
+ * @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
+ */
+function bp_activity_screen_friends() {
+	if ( !bp_is_active( 'friends' ) )
+		return false;
+
+	bp_update_is_item_admin( is_super_admin(), 'activity' );
+	do_action( 'bp_activity_screen_friends' );
+	bp_core_load_template( apply_filters( 'bp_activity_template_friends_activity', 'members/single/home' ) );
+}
+
+/**
+ * Activity screen 'groups' index
+ *
+ * @since 1.2.0
+ *
+ * @uses bp_is_active()
+ * @uses bp_update_is_item_admin()
+ * @uses is_super_admin()
+ * @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
+ */
+function bp_activity_screen_groups() {
+	if ( !bp_is_active( 'groups' ) )
+		return false;
+
+	bp_update_is_item_admin( is_super_admin(), 'activity' );
+	do_action( 'bp_activity_screen_groups' );
+	bp_core_load_template( apply_filters( 'bp_activity_template_groups_activity', 'members/single/home' ) );
+}
+
+/**
+ * Activity screen 'favorites' index
+ *
+ * @since 1.2.0
+ *
+ * @uses bp_update_is_item_admin()
+ * @uses is_super_admin()
+ * @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' );
+	do_action( 'bp_activity_screen_favorites' );
+	bp_core_load_template( apply_filters( 'bp_activity_template_favorite_activity', 'members/single/home' ) );
+}
+
+/**
+ * Activity screen 'mentions' index
+ *
+ * @since 1.2.0
+ *
+ * @uses bp_update_is_item_admin()
+ * @uses is_super_admin()
+ * @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' );
+	do_action( 'bp_activity_screen_mentions' );
+	bp_core_load_template( apply_filters( 'bp_activity_template_mention_activity', 'members/single/home' ) );
+}
+
+/**
+ * Removes activity notifications from the notification menu when a user clicks on them and
+ * is taken to a specific screen.
+ *
+ * @since 1.5.0
+ *
+ * @global object $bp BuddyPress global settings
+ * @uses bp_core_delete_notifications_by_type()
+ */
+function bp_activity_remove_screen_notifications() {
+	global $bp;
+
+	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' );
+add_action( 'bp_activity_screen_mentions',                  'bp_activity_remove_screen_notifications' );
+
+/**
+ * Reset the logged-in user's new mentions data when he visits his mentions screen
+ *
+ * @since 1.5.0
+ *
+ * @uses bp_is_my_profile()
+ * @uses bp_activity_clear_new_mentions()
+ * @uses bp_loggedin_user_id()
+ */
+function bp_activity_reset_my_new_mentions() {
+	if ( bp_is_my_profile() )
+		bp_activity_clear_new_mentions( bp_loggedin_user_id() );
+}
+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
+ *
+ * @global object $bp BuddyPress global settings
+ * @uses bp_is_activity_component()
+ * @uses bp_activity_get_specific()
+ * @uses bp_current_action()
+ * @uses bp_action_variables()
+ * @uses bp_do_404()
+ * @uses bp_is_active()
+ * @uses groups_get_group()
+ * @uses groups_is_user_member()
+ * @uses apply_filters_ref_array() To call the 'bp_activity_permalink_access' hook
+ * @uses do_action() To call the 'bp_activity_screen_single_activity_permalink' hook
+ * @uses bp_core_add_message()
+ * @uses is_user_logged_in()
+ * @uses bp_core_redirect()
+ * @uses site_url()
+ * @uses esc_url()
+ * @uses bp_get_root_domain()
+ * @uses bp_get_activity_root_slug()
+ * @uses bp_core_load_template()
+ * @uses apply_filters() To call the 'bp_activity_template_profile_activity_permalink' hook
+ */
+function bp_activity_screen_single_activity_permalink() {
+	global $bp;
+
+	// No displayed user or not viewing activity component
+	if ( !bp_is_activity_component() )
+		return false;
+
+	if ( empty( $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 ) );
+
+	// 404 if activity does not exist
+	if ( empty( $activity['activities'][0] ) || bp_action_variables() ) {
+		bp_do_404();
+		return;
+
+	} else {
+		$activity = $activity['activities'][0];
+	}
+
+	// Default access is true
+	$has_access = true;
+
+	// If activity is from a group, do an extra cap check
+	if ( isset( $bp->groups->id ) && $activity->component == $bp->groups->id ) {
+
+		// Activity is from a group, but groups is currently disabled
+		if ( !bp_is_active( 'groups') ) {
+			bp_do_404();
+			return;
+		}
+
+		// Check to see if the group is not public, if so, check the
+		// user has access to see this activity
+		if ( $group = groups_get_group( array( 'group_id' => $activity->item_id ) ) ) {
+
+			// Group is not public
+			if ( 'public' != $group->status ) {
+
+				// User is not a member of group
+				if ( !groups_is_user_member( $bp->loggedin_user->id, $group->id ) ) {
+					$has_access = false;
+				}
+			}
+		}
+	}
+
+	// Allow access to be filtered
+	$has_access = apply_filters_ref_array( 'bp_activity_permalink_access', array( $has_access, &$activity ) );
+
+	// Allow additional code execution
+	do_action( 'bp_activity_screen_single_activity_permalink', $activity, $has_access );
+
+	// Access is specifically disallowed
+	if ( false === $has_access ) {
+
+		// User feedback
+		bp_core_add_message( __( 'You do not have access to this activity.', 'buddypress' ), 'error' );
+
+		// 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_load_template( apply_filters( 'bp_activity_template_profile_activity_permalink', 'members/single/activity/permalink' ) );
+}
+add_action( 'bp_screens', 'bp_activity_screen_single_activity_permalink' );
+
+/**
+ * Add activity notifications settings to the notifications settings page
+ *
+ * @since 1.2.0
+ *
+ * @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 ) )
+		$mention = 'yes';
+
+	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">
+		<thead>
+			<tr>
+				<th class="icon">&nbsp;</th>
+				<th class="title"><?php _e( 'Activity', 'buddypress' ) ?></th>
+				<th class="yes"><?php _e( 'Yes', 'buddypress' ) ?></th>
+				<th class="no"><?php _e( 'No', 'buddypress' )?></th>
+			</tr>
+		</thead>
+
+		<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 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>
+			<tr id="activity-notification-settings-replies">
+				<td>&nbsp;</td>
+				<td><?php _e( "A member replies to an update or comment you've posted", 'buddypress' ) ?></td>
+				<td class="yes"><input type="radio" name="notifications[notification_activity_new_reply]" value="yes" <?php checked( $reply, 'yes', true ) ?>/></td>
+				<td class="no"><input type="radio" name="notifications[notification_activity_new_reply]" value="no" <?php checked( $reply, 'no', true ) ?>/></td>
+			</tr>
+
+			<?php do_action( 'bp_activity_screen_notification_settings' ) ?>
+		</tbody>
+	</table>
+
+<?php
+}
+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
new file mode 100644
index 0000000000000000000000000000000000000000..9e8128c271f99e0cfb78d4560cd36cc7eb30fb8b
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-activity/bp-activity-template.php
@@ -0,0 +1,2696 @@
+<?php
+
+/**
+ * BuddyPress Activity Template Functions
+ *
+ * @package BuddyPress
+ * @subpackage ActivityTemplate
+ */
+
+// Exit if accessed directly
+if ( !defined( 'ABSPATH' ) ) exit;
+
+/**
+ * Output the activity component slug
+ *
+ * @since 1.5.0
+ *
+ * @uses bp_get_activity_slug()
+ */
+function bp_activity_slug() {
+	echo bp_get_activity_slug();
+}
+	/**
+	 * Return the activity component slug
+	 *
+	 * @since 1.5.0
+	 *
+	 * @global object $bp BuddyPress global settings
+	 * @uses apply_filters() To call the 'bp_get_activity_slug' hook
+	 */
+	function bp_get_activity_slug() {
+		global $bp;
+		return apply_filters( 'bp_get_activity_slug', $bp->activity->slug );
+	}
+
+/**
+ * Output the activity component root slug
+ *
+ * @since 1.5.0
+ *
+ * @uses bp_get_activity_root_slug()
+ */
+function bp_activity_root_slug() {
+	echo bp_get_activity_root_slug();
+}
+	/**
+	 * Return the activity component root slug
+	 *
+	 * @since 1.5.0
+	 *
+	 * @global object $bp BuddyPress global settings
+	 * @uses apply_filters() To call the 'bp_get_activity_root_slug' hook
+	 */
+	function bp_get_activity_root_slug() {
+		global $bp;
+		return apply_filters( 'bp_get_activity_root_slug', $bp->activity->root_slug );
+	}
+
+/**
+ * Output member directory permalink
+ *
+ * @since 1.5.0
+ *
+ * @uses bp_get_activity_directory_permalink()
+ */
+function bp_activity_directory_permalink() {
+	echo bp_get_activity_directory_permalink();
+}
+	/**
+	 * Return member directory permalink
+	 *
+	 * @since 1.5.0
+	 *
+	 * @uses traisingslashit()
+	 * @uses bp_get_root_domain()
+	 * @uses bp_get_activity_root_slug()
+	 * @uses apply_filters() To call the 'bp_get_activity_directory_permalink' hook
+	 *
+	 * @return string Activity directory permalink
+	 */
+	function bp_get_activity_directory_permalink() {
+		return apply_filters( 'bp_get_activity_directory_permalink', trailingslashit( bp_get_root_domain() . '/' . bp_get_activity_root_slug() ) );
+	}
+
+/**
+ * The main activity template loop
+ *
+ * This is responsible for loading a group of activity items and displaying them
+ *
+ * @since 1.0.0
+ */
+class BP_Activity_Template {
+	var $current_activity = -1;
+	var $activity_count;
+	var $total_activity_count;
+	var $activities;
+	var $activity;
+
+	var $in_the_loop;
+
+	var $pag_page;
+	var $pag_num;
+	var $pag_links;
+
+	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 ) {
+		global $bp;
+
+		$this->pag_page = isset( $_REQUEST['acpage'] ) ? intval( $_REQUEST['acpage'] ) : $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 ) );
+
+		// 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 ) );
+		// 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 ) );
+
+		if ( !$max || $max >= (int)$this->activities['total'] )
+			$this->total_activity_count = (int)$this->activities['total'];
+		else
+			$this->total_activity_count = (int)$max;
+
+		$this->activities = $this->activities['activities'];
+
+		if ( $max ) {
+			if ( $max >= count($this->activities) ) {
+				$this->activity_count = count( $this->activities );
+			} else {
+				$this->activity_count = (int)$max;
+			}
+		} else {
+			$this->activity_count = count( $this->activities );
+		}
+
+		$this->full_name = $bp->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 ) {
+			if ( 'activity_comment' != $activity->type )
+				continue;
+
+			$parent_ids[] = $activity->item_id;
+		}
+
+		if ( !empty( $parent_ids ) )
+			$activity_parents = bp_activity_get_specific( array( 'activity_ids' => $parent_ids ) );
+
+		if ( !empty( $activity_parents['activities'] ) ) {
+			foreach( $activity_parents['activities'] as $parent )
+				$this->activity_parents[$parent->id] = $parent;
+
+			unset( $activity_parents );
+		}
+
+		if ( (int)$this->total_activity_count && (int)$this->pag_num ) {
+			$this->pag_links = paginate_links( array(
+				'base'      => add_query_arg( 'acpage', '%#%' ),
+				'format'    => '',
+				'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
+			) );
+		}
+	}
+
+	function has_activities() {
+		if ( $this->activity_count )
+			return true;
+
+		return false;
+	}
+
+	function next_activity() {
+		$this->current_activity++;
+		$this->activity = $this->activities[$this->current_activity];
+
+		return $this->activity;
+	}
+
+	function rewind_activities() {
+		$this->current_activity = -1;
+		if ( $this->activity_count > 0 ) {
+			$this->activity = $this->activities[0];
+		}
+	}
+
+	function user_activities() {
+		if ( $this->current_activity + 1 < $this->activity_count ) {
+			return true;
+		} elseif ( $this->current_activity + 1 == $this->activity_count ) {
+			do_action('activity_loop_end');
+			// Do some cleaning up after the loop
+			$this->rewind_activities();
+		}
+
+		$this->in_the_loop = false;
+		return false;
+	}
+
+	function the_activity() {
+		global $activity;
+
+		$this->in_the_loop = true;
+		$this->activity = $this->next_activity();
+
+		if ( is_array( $this->activity ) )
+			$this->activity = (object) $this->activity;
+
+		if ( $this->current_activity == 0 ) // loop has just started
+			do_action('activity_loop_start');
+	}
+}
+
+/**
+ * Initializes the activity loop.
+ *
+ * Based on the $args passed, bp_has_activities() populates the $activities_template global.
+ *
+ * @since 1.0.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
+ *
+ * @global object $activities_template {@link BP_Activity_Template}
+ * @global object $bp BuddyPress global settings
+ * @uses groups_is_user_member()
+ * @uses bp_current_action()
+ * @uses bp_is_current_action()
+ * @uses bp_get_activity_slug()
+ * @uses bp_action_variable()
+ * @uses wp_parse_args()
+ * @uses bp_is_active()
+ * @uses friends_get_friend_user_ids()
+ * @uses groups_get_user_groups()
+ * @uses bp_activity_get_user_favorites()
+ * @uses apply_filters() To call the 'bp_has_activities' hook
+ *
+ * @return bool Returns true when activities are found
+ */
+function bp_has_activities( $args = '' ) {
+	global $activities_template, $bp;
+
+	/***
+	 * Set the defaults based on the current page. Any of these will be overridden
+	 * if arguments are directly passed into the loop. Custom plugins should always
+	 * pass their parameters directly to the loop.
+	 */
+	$user_id     = false;
+	$include     = false;
+	$exclude     = false;
+	$in          = false;
+	$show_hidden = false;
+	$object      = false;
+	$primary_id  = false;
+
+	// User filtering
+	if ( !empty( $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 ) )
+			$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];
+	}
+	else
+		$scope = bp_current_action();
+
+	// Support for permalinks on single item pages: /groups/my-group/activity/124/
+	if ( bp_is_current_action( bp_get_activity_slug() ) )
+		$include = bp_action_variable( 0 );
+
+	// Note: any params used for filtering can be a single value, or multiple values comma separated.
+	$defaults = array(
+		'display_comments' => 'threaded',   // false for none, stream/threaded - show comments in the stream or threaded under items
+		'include'          => $include,     // pass an activity_id or string of IDs comma-separated
+		'exclude'          => $exclude,     // pass an activity_id or string of IDs comma-separated
+		'in'               => $in,          // comma-separated list or array of activity IDs among which to search
+		'sort'             => 'DESC',       // sort DESC or ASC
+		'page'             => 1,            // which page to load
+		'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?
+
+		// Scope - pre-built activity filters for a user (friends/groups/favorites/mentions)
+		'scope'            => $scope,
+
+		// Filtering
+		'user_id'          => $user_id,     // user_id to filter on
+		'object'           => $object,      // object to filter on e.g. groups, profile, status, friends
+		'action'           => false,        // action to filter on e.g. activity_update, new_forum_post, profile_updated
+		'primary_id'       => $primary_id,  // object ID to filter on e.g. a group_id or forum_id or blog_id etc.
+		'secondary_id'     => false,        // secondary object ID to filter on e.g. a post_id
+
+		// Searching
+		'search_terms'     => false         // specify terms to search on
+	);
+
+	$r = wp_parse_args( $args, $defaults );
+	extract( $r );
+
+	// If you have passed a "scope" then this will override any filters you have passed.
+	if ( 'just-me' == $scope || 'friends' == $scope || 'groups' == $scope || 'favorites' == $scope || 'mentions' == $scope ) {
+		if ( 'just-me' == $scope )
+			$display_comments = 'stream';
+
+		// determine which user_id applies
+		if ( empty( $user_id ) )
+			$user_id = ( !empty( $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;
+
+			switch ( $scope ) {
+				case 'friends':
+					if ( bp_is_active( 'friends' ) )
+						$friends = friends_get_friend_user_ids( $user_id );
+						if ( empty( $friends ) )
+							return false;
+
+						$user_id = implode( ',', (array)$friends );
+					break;
+				case 'groups':
+					if ( bp_is_active( 'groups' ) ) {
+						$groups = groups_get_user_groups( $user_id );
+						if ( empty( $groups['groups'] ) )
+							return false;
+
+						$object = $bp->groups->id;
+						$primary_id = implode( ',', (array)$groups['groups'] );
+
+						$user_id = 0;
+					}
+					break;
+				case 'favorites':
+					$favs = bp_activity_get_user_favorites( $user_id );
+					if ( empty( $favs ) )
+						return false;
+
+					$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.
+					$display_comments = 'stream';
+					$user_id = 0;
+					break;
+			}
+		}
+	}
+
+	// Do not exceed the maximum per page
+	if ( !empty( $max ) && ( (int)$per_page > (int)$max ) )
+		$per_page = $max;
+
+	// Support for basic filters in earlier BP versions.
+	if ( isset( $_GET['afilter'] ) )
+		$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 );
+
+	return apply_filters( 'bp_has_activities', $activities_template->has_activities(), $activities_template );
+}
+
+/**
+ * Determines if there are still activities left in the loop.
+ *
+ * @since 1.0.0
+ *
+ * @global object $activities_template {@link BP_Activity_Template}
+ * @uses BP_Activity_Template::user_activities() {@link BP_Activity_Template::user_activities()}
+ *
+ * @return bool Returns true when activities are found
+ */
+function bp_activities() {
+	global $activities_template;
+	return $activities_template->user_activities();
+}
+
+/**
+ * Gets the current activity object in the loop
+ *
+ * @since 1.0.0
+ *
+ * @global object $activities_template {@link BP_Activity_Template}
+ * @uses BP_Activity_Template::the_activity() {@link BP_Activity_Template::the_activity()}
+ *
+ * @return object The current activity within the loop
+ */
+function bp_the_activity() {
+	global $activities_template;
+	return $activities_template->the_activity();
+}
+
+/**
+ * Outputs the activity pagination count
+ *
+ * @since 1.0.0
+ *
+ * @global object $activities_template {@link BP_Activity_Template}
+ * @uses BP_Activity_Template::the_activity() {@link BP_Activity_Template::the_activity()}
+ */
+function bp_activity_pagination_count() {
+	echo bp_get_activity_pagination_count();
+}
+
+	/**
+	 * Returns the activity pagination count
+	 *
+	 * @since 1.2.0
+	 *
+	 * @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;
+
+		$start_num = intval( ( $activities_template->pag_page - 1 ) * $activities_template->pag_num ) + 1;
+		$from_num  = bp_core_number_format( $start_num );
+		$to_num    = bp_core_number_format( ( $start_num + ( $activities_template->pag_num - 1 ) > $activities_template->total_activity_count ) ? $activities_template->total_activity_count : $start_num + ( $activities_template->pag_num - 1 ) );
+		$total     = bp_core_number_format( $activities_template->total_activity_count );
+
+		return sprintf( __( 'Viewing item %1$s to %2$s (of %3$s items)', 'buddypress' ), $from_num, $to_num, $total );
+	}
+
+/**
+ * Outputs the activity pagination links
+ *
+ * @since 1.0.0
+ *
+ * @uses bp_get_activity_pagination_links()
+ */
+function bp_activity_pagination_links() {
+	echo bp_get_activity_pagination_links();
+}
+
+	/**
+	 * Outputs the activity pagination links
+	 *
+	 * @since 1.0.0
+	 *
+	 * @global object $activities_template {@link BP_Activity_Template}
+	 * @uses apply_filters() To call the 'bp_get_activity_pagination_links' hook
+	 *
+	 * @return string The pagination links
+	 */
+	function bp_get_activity_pagination_links() {
+		global $activities_template;
+
+		return apply_filters( 'bp_get_activity_pagination_links', $activities_template->pag_links );
+	}
+
+/**
+ * Returns true when there are more activity items to be shown than currently appear
+ *
+ * @since 1.5.0
+ *
+ * @global object $activities_template {@link BP_Activity_Template}
+ * @uses apply_filters() To call the 'bp_activity_has_more_items' hook
+ *
+ * @return bool $has_more_items True if more items, false if not
+ */
+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;
+
+	return apply_filters( 'bp_activity_has_more_items', $has_more_items );
+}
+
+/**
+ * Outputs the activity count
+ *
+ * @since 1.2.0
+ *
+ * @uses bp_get_activity_count()
+ */
+function bp_activity_count() {
+	echo bp_get_activity_count();
+}
+
+	/**
+	 * Returns the activity count
+	 *
+	 * @since 1.2.0
+	 *
+	 * @global object $activities_template {@link BP_Activity_Template}
+	 * @uses apply_filters() To call the 'bp_get_activity_count' hook
+	 *
+	 * @return int The activity count
+	 */
+	function bp_get_activity_count() {
+		global $activities_template;
+
+		return apply_filters( 'bp_get_activity_count', (int)$activities_template->activity_count );
+	}
+
+/**
+ * Outputs the number of activities per page
+ *
+ * @since 1.2.0
+ *
+ * @uses bp_get_activity_per_page()
+ */
+function bp_activity_per_page() {
+	echo bp_get_activity_per_page();
+}
+
+	/**
+	 * Returns the number of activities per page
+	 *
+	 * @since 1.2.0
+	 *
+	 * @global object $activities_template {@link BP_Activity_Template}
+	 * @uses apply_filters() To call the 'bp_get_activity_per_page' hook
+	 *
+	 * @return int The activities per page
+	 */
+	function bp_get_activity_per_page() {
+		global $activities_template;
+
+		return apply_filters( 'bp_get_activity_per_page', (int)$activities_template->pag_num );
+	}
+
+/**
+ * Outputs the activities title
+ *
+ * @since 1.0.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
+	 *
+	 * @global string $bp_activity_title
+	 * @uses apply_filters() To call the 'bp_get_activities_title' hook
+	 *
+	 * @return int The activities title
+	 */
+	function bp_get_activities_title() {
+		global $bp_activity_title;
+
+		return apply_filters( 'bp_get_activities_title', $bp_activity_title );
+	}
+
+/**
+ * {@internal Missing Description}
+ *
+ * @since 1.0.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
+	 *
+	 * @global string $bp_activity_no_activity
+	 * @uses apply_filters() To call the 'bp_get_activities_no_activity' hook
+	 *
+	 * @return unknown_type
+	 */
+	function bp_get_activities_no_activity() {
+		global $bp_activity_no_activity;
+
+		return apply_filters( 'bp_get_activities_no_activity', $bp_activity_no_activity );
+	}
+
+/**
+ * Outputs the activity id
+ *
+ * @since 1.2.0
+ *
+ * @uses bp_get_activity_id()
+ */
+function bp_activity_id() {
+	echo bp_get_activity_id();
+}
+
+	/**
+	 * Returns the activity id
+	 *
+	 * @since 1.2.0
+	 *
+	 * @global object $activities_template {@link BP_Activity_Template}
+	 * @uses apply_filters() To call the 'bp_get_activity_id' hook
+	 *
+	 * @return int The activity id
+	 */
+	function bp_get_activity_id() {
+		global $activities_template;
+		return apply_filters( 'bp_get_activity_id', $activities_template->activity->id );
+	}
+
+/**
+ * Outputs the activity item id
+ *
+ * @since 1.2.0
+ *
+ * @uses bp_get_activity_item_id()
+ */
+function bp_activity_item_id() {
+	echo bp_get_activity_item_id();
+}
+
+	/**
+	 * Returns the activity item id
+	 *
+	 * @since 1.2.0
+	 *
+	 * @global object $activities_template {@link BP_Activity_Template}
+	 * @uses apply_filters() To call the 'bp_get_activity_item_id' hook
+	 *
+	 * @return int The activity item id
+	 */
+	function bp_get_activity_item_id() {
+		global $activities_template;
+		return apply_filters( 'bp_get_activity_item_id', $activities_template->activity->item_id );
+	}
+
+/**
+ * Outputs the activity secondary item id
+ *
+ * @since 1.2.0
+ *
+ * @uses bp_get_activity_secondary_item_id()
+ */
+function bp_activity_secondary_item_id() {
+	echo bp_get_activity_secondary_item_id();
+}
+
+	/**
+	 * Returns the activity secondary item id
+	 *
+	 * @since 1.2.0
+	 *
+	 * @global object $activities_template {@link BP_Activity_Template}
+	 * @uses apply_filters() To call the 'bp_get_activity_secondary_item_id' hook
+	 *
+	 * @return int The activity secondary item id
+	 */
+	function bp_get_activity_secondary_item_id() {
+		global $activities_template;
+		return apply_filters( 'bp_get_activity_secondary_item_id', $activities_template->activity->secondary_item_id );
+	}
+
+/**
+ * Outputs the date the activity was recorded
+ *
+ * @since 1.2.0
+ *
+ * @uses bp_get_activity_date_recorded()
+ */
+function bp_activity_date_recorded() {
+	echo bp_get_activity_date_recorded();
+}
+
+	/**
+	 * Returns the date the activity was recorded
+	 *
+	 * @since 1.2.0
+	 *
+	 * @global object $activities_template {@link BP_Activity_Template}
+	 * @uses apply_filters() To call the 'bp_get_activity_date_recorded' hook
+	 *
+	 * @return string The date the activity was recorded
+	 */
+	function bp_get_activity_date_recorded() {
+		global $activities_template;
+		return apply_filters( 'bp_get_activity_date_recorded', $activities_template->activity->date_recorded );
+	}
+
+/**
+ * Outputs the activity object name
+ *
+ * @since 1.2.0
+ *
+ * @uses bp_get_activity_object_name()
+ */
+function bp_activity_object_name() {
+	echo bp_get_activity_object_name();
+}
+
+	/**
+	 * Returns the activity object name
+	 *
+	 * @since 1.2.0
+	 *
+	 * @global object $activities_template {@link BP_Activity_Template}
+	 * @uses apply_filters() To call the 'bp_get_activity_object_name' hook
+	 *
+	 * @return string The activity object name
+	 */
+	function bp_get_activity_object_name() {
+		global $activities_template;
+		return apply_filters( 'bp_get_activity_object_name', $activities_template->activity->component );
+	}
+
+/**
+ * Outputs the activity type
+ *
+ * @since 1.2.0
+ *
+ * @uses bp_get_activity_type()
+ */
+function bp_activity_type() {
+	echo bp_get_activity_type();
+}
+
+	/**
+	 * Returns the activity type
+	 *
+	 * @since 1.2.0
+	 *
+	 * @global object $activities_template {@link BP_Activity_Template}
+	 * @uses apply_filters() To call the 'bp_get_activity_type' hook
+	 *
+	 * @return string The activity type
+	 */
+	function bp_get_activity_type() {
+		global $activities_template;
+		return apply_filters( 'bp_get_activity_type', $activities_template->activity->type );
+	}
+
+	/**
+	 * Outputs the activity action name
+	 *
+	 * Just a wrapper for bp_activity_type()
+	 *
+	 * @since 1.2.0
+	 * @deprecated 1.5.0
+	 *
+	 * @todo Properly deprecate in favor of bp_activity_type() and
+	 *		 remove redundant echo
+	 *
+	 * @uses bp_activity_type()
+	 */
+	function bp_activity_action_name() { echo bp_activity_type(); }
+
+	/**
+	 * Returns the activity type
+	 *
+	 * Just a wrapper for bp_get_activity_type()
+	 *
+	 * @since 1.2.0
+	 * @deprecated 1.5.0
+	 *
+	 * @todo Properly deprecate in favor of bp_get_activity_type()
+	 *
+	 * @uses bp_get_activity_type()
+	 *
+	 * @return string The activity type
+	 */
+	function bp_get_activity_action_name() { return bp_get_activity_type(); }
+
+/**
+ * Outputs the activity user id
+ *
+ * @since 1.1.0
+ *
+ * @uses bp_get_activity_user_id()
+ */
+function bp_activity_user_id() {
+	echo bp_get_activity_user_id();
+}
+
+	/**
+	 * Returns the activity user id
+	 *
+	 * @since 1.1.0
+	 *
+	 * @global object $activities_template {@link BP_Activity_Template}
+	 * @uses apply_filters() To call the 'bp_get_activity_user_id' hook
+	 *
+	 * @return int The activity user id
+	 */
+	function bp_get_activity_user_id() {
+		global $activities_template;
+		return apply_filters( 'bp_get_activity_user_id', $activities_template->activity->user_id );
+	}
+
+/**
+ * Outputs the activity user link
+ *
+ * @since 1.2.0
+ *
+ * @uses bp_get_activity_user_link()
+ */
+function bp_activity_user_link() {
+	echo bp_get_activity_user_link();
+}
+
+	/**
+	 * Returns the activity user link
+	 *
+	 * @since 1.2.0
+	 *
+	 * @global object $activities_template {@link BP_Activity_Template}
+	 * @uses bp_core_get_user_domain()
+	 * @uses apply_filters() To call the 'bp_get_activity_user_link' hook
+	 *
+	 * @return string $link The activity user link
+	 */
+	function bp_get_activity_user_link() {
+		global $activities_template;
+
+		if ( empty( $activities_template->activity->user_id ) )
+			$link = $activities_template->activity->primary_link;
+		else
+			$link = bp_core_get_user_domain( $activities_template->activity->user_id, $activities_template->activity->user_nicename, $activities_template->activity->user_login );
+
+		return apply_filters( 'bp_get_activity_user_link', $link );
+	}
+
+/**
+ * Output the avatar of the user that performed the action
+ *
+ * @since 1.1.0
+ *
+ * @param array $args
+ *
+ * @uses bp_get_activity_avatar()
+ */
+function bp_activity_avatar( $args = '' ) {
+	echo bp_get_activity_avatar( $args );
+}
+	/**
+	 * Return the avatar of the user that performed the action
+	 *
+	 * @since 1.1.0
+	 *
+	 * @param array $args optional
+	 *
+	 * @global object $activities_template {@link BP_Activity_Template}
+	 * @global object $bp BuddyPress global settings
+	 * @uses bp_is_single_activity()
+	 * @uses wp_parse_args()
+	 * @uses apply_filters() To call the 'bp_get_activity_avatar_object_' . $current_activity_item->component hook
+	 * @uses apply_filters() To call the 'bp_get_activity_avatar_item_id' hook
+	 * @uses bp_core_fetch_avatar()
+	 * @uses apply_filters() To call the 'bp_get_activity_avatar' hook
+	 *
+	 * @return string User avatar
+	 */
+	function bp_get_activity_avatar( $args = '' ) {
+		global $activities_template, $bp;
+
+		// On activity permalink pages, default to the full-size avatar
+		$type_default = bp_is_single_activity() ? 'full' : 'thumb';
+
+		$defaults = array(
+			'alt'     => __( 'Profile picture of %s', 'buddypress' ),
+			'class'   => 'avatar',
+			'email'   => false,
+			'type'    => $type_default,
+			'user_id' => false
+		);
+
+		$r = wp_parse_args( $args, $defaults );
+		extract( $r, EXTR_SKIP );
+
+		if ( !isset( $height ) && !isset( $width ) ) {
+			// Backpat
+			if ( isset( $bp->avatar->full->height ) || isset( $bp->avatar->thumb->height ) ) {
+				$height = ( 'full' == $type ) ? $bp->avatar->full->height : $bp->avatar->thumb->height;
+			} else {
+				$height = 20;
+			}
+
+			// Backpat
+			if ( isset( $bp->avatar->full->width ) || isset( $bp->avatar->thumb->width ) ) {
+				$width = ( 'full' == $type ) ? $bp->avatar->full->width : $bp->avatar->thumb->width;
+			} else {
+				$width = 20;
+			}
+
+		}
+
+		// Within the loop, we the current activity should be set first to the
+		// current_comment, if available
+		$current_activity_item = isset( $activities_template->activity->current_comment ) ? $activities_template->activity->current_comment : $activities_template->activity;
+
+		// Primary activity avatar is always a user, but can be modified via a filter
+		$object  = apply_filters( 'bp_get_activity_avatar_object_' . $current_activity_item->component, 'user' );
+		$item_id = $user_id ? $user_id : $current_activity_item->user_id;
+		$item_id = apply_filters( 'bp_get_activity_avatar_item_id', $item_id );
+
+		// If this is a user object pass the users' email address for Gravatar so we don't have to refetch it.
+		if ( 'user' == $object && empty( $user_id ) && empty( $email ) && isset( $activities_template->activity->user_email ) )
+			$email = $current_activity_item->user_email;
+
+		return apply_filters( 'bp_get_activity_avatar', bp_core_fetch_avatar( array( 'item_id' => $item_id, 'object' => $object, 'type' => $type, 'alt' => $alt, 'class' => $class, 'width' => $width, 'height' => $height, 'email' => $email ) ) );
+	}
+
+/**
+ * Output the avatar of the object that action was performed on
+ *
+ * @since 1.2.0
+ *
+ * @param array $args optional
+ *
+ * @uses bp_get_activity_secondary_avatar()
+ */
+function bp_activity_secondary_avatar( $args = '' ) {
+	echo bp_get_activity_secondary_avatar( $args );
+}
+
+	/**
+	 * Return the avatar of the object that action was performed on
+	 *
+	 * @since 1.2.0
+	 *
+	 * @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()
+	 * @uses apply_filters() To call the 'bp_get_activity_secondary_avatar_object_' . $activities_template->activity->component hook
+	 * @uses apply_filters() To call the 'bp_get_activity_secondary_avatar_item_id' hook
+	 * @uses bp_core_fetch_avatar()
+	 * @uses apply_filters() To call the 'bp_get_activity_secondary_avatar' hook
+	 *
+	 * @return string The secondary avatar
+	 */
+	function bp_get_activity_secondary_avatar( $args = '' ) {
+		global $bp, $activities_template;
+
+		$defaults = array(
+			'type'   => 'thumb',
+			'width'  => 20,
+			'height' => 20,
+			'class'  => 'avatar',
+			'email'  => false
+		);
+
+		$r = wp_parse_args( $args, $defaults );
+		extract( $r, EXTR_SKIP );
+
+		// Set item_id and object (default to user)
+		switch ( $activities_template->activity->component ) {
+			case 'groups' :
+				$object = 'group';
+				$item_id = $activities_template->activity->item_id;
+
+				if ( empty( $alt ) )
+					$alt = __( 'Group logo of %s', 'buddypress' );
+
+				break;
+			case 'blogs' :
+				$object = 'blog';
+				$item_id = $activities_template->activity->item_id;
+
+				if ( !$alt )
+					$alt = sprintf( __( 'Site authored by %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' );
+
+				break;
+			default :
+				$object  = 'user';
+				$item_id = $activities_template->activity->user_id;
+				$email = $activities_template->activity->user_email;
+
+				if ( !$alt )
+					$alt = __( 'Profile picture of %s', 'buddypress' );
+
+				break;
+		}
+
+		// Allow object and item_id to be filtered
+		$object  = apply_filters( 'bp_get_activity_secondary_avatar_object_' . $activities_template->activity->component, $object );
+		$item_id = apply_filters( 'bp_get_activity_secondary_avatar_item_id', $item_id );
+
+		// If we have no item_id or object, there is no avatar to display
+		if ( empty( $item_id ) || empty( $object ) )
+			return false;
+
+		return apply_filters( 'bp_get_activity_secondary_avatar', bp_core_fetch_avatar( array( 'item_id' => $item_id, 'object' => $object, 'type' => $type, 'alt' => $alt, 'class' => $class, 'width' => $width, 'height' => $height, 'email' => $email ) ) );
+	}
+
+/**
+ * Output the activity action
+ *
+ * @since 1.2.0
+ *
+ * @uses bp_get_activity_action()
+ */
+function bp_activity_action() {
+	echo bp_get_activity_action();
+}
+
+	/**
+	 * Return the activity action
+	 *
+	 * @since 1.2.0
+	 *
+	 * @global object $activities_template {@link BP_Activity_Template}
+	 * @uses apply_filters_ref_array() To call the 'bp_get_activity_action_pre_meta' hook
+	 * @uses bp_insert_activity_meta()
+	 * @uses apply_filters_ref_array() To call the 'bp_get_activity_action' hook
+	 *
+	 * @return string The activity action
+	 */
+	function bp_get_activity_action() {
+		global $activities_template;
+
+		$action = $activities_template->activity->action;
+		$action = apply_filters_ref_array( 'bp_get_activity_action_pre_meta', array( $action, &$activities_template->activity ) );
+
+		if ( !empty( $action ) )
+			$action = bp_insert_activity_meta( $action );
+
+		return apply_filters_ref_array( 'bp_get_activity_action', array( $action, &$activities_template->activity ) );
+	}
+
+/**
+ * Output the activity content body
+ *
+ * @since 1.2.0
+ *
+ * @uses bp_get_activity_content_body()
+ */
+function bp_activity_content_body() {
+	echo bp_get_activity_content_body();
+}
+
+	/**
+	 * Return the activity content body
+	 *
+	 * @since 1.2.0
+	 *
+	 * @global object $activities_template {@link BP_Activity_Template}
+	 * @uses bp_insert_activity_meta()
+	 * @uses apply_filters_ref_array() To call the 'bp_get_activity_content_body' hook
+	 *
+	 * @return string The activity content body
+	 */
+	function bp_get_activity_content_body() {
+		global $activities_template;
+
+		// Backwards compatibility if action is not being used
+		if ( empty( $activities_template->activity->action ) && !empty( $activities_template->activity->content ) )
+			$activities_template->activity->content = bp_insert_activity_meta( $activities_template->activity->content );
+
+		return apply_filters_ref_array( 'bp_get_activity_content_body', array( $activities_template->activity->content, &$activities_template->activity ) );
+	}
+
+/**
+ * Does the activity have content?
+ *
+ * @since 1.2.0
+ *
+ * @global object $activities_template {@link BP_Activity_Template}
+ *
+ * @return bool True if activity has content, false otherwise
+ */
+function bp_activity_has_content() {
+	global $activities_template;
+
+	if ( !empty( $activities_template->activity->content ) )
+		return true;
+
+	return false;
+}
+
+/**
+ * Output the activity content
+ *
+ * @since 1.0.0
+ * @deprecated 1.5.0
+ *
+ * @todo properly deprecate this function
+ *
+ * @uses bp_get_activity_content()
+ */
+function bp_activity_content() {
+	echo bp_get_activity_content();
+}
+
+	/**
+	 * Return the activity content
+	 *
+	 * @since 1.0.0
+	 * @deprecated 1.5.0
+	 *
+	 * @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
+	 *
+	 * @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'
+		 *
+		 * This function is mainly for backwards comptibility.
+		 */
+
+		$content = bp_get_activity_action() . ' ' . bp_get_activity_content_body();
+		return apply_filters( 'bp_get_activity_content', $content );
+	}
+
+/**
+ * Insert activity meta
+ *
+ * @since 1.2.0
+ *
+ * @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()
+ * @uses bp_activity_get_permalink()
+ * @uses esc_attr__()
+ * @uses apply_filters_ref_array() To call the 'bp_activity_permalink' hook
+ * @uses apply_filters() To call the 'bp_insert_activity_meta' hook
+ *
+ * @return string The activity content
+ */
+function bp_insert_activity_meta( $content ) {
+	global $activities_template, $bp;
+
+	// Strip any legacy time since placeholders from BP 1.0-1.1
+	$content = str_replace( '<span class="time-since">%s</span>', '', $content );
+
+	// Insert the time since.
+	$time_since = apply_filters_ref_array( 'bp_activity_time_since', array( '<span class="time-since">' . bp_core_time_since( $activities_template->activity->date_recorded ) . '</span>', &$activities_template->activity ) );
+
+	// Insert the permalink
+	if ( !bp_is_single_activity() )
+		$content = apply_filters_ref_array( 'bp_activity_permalink', array( sprintf( '%1$s <a href="%2$s" class="view activity-time-since" title="%3$s">%4$s</a>', $content, bp_activity_get_permalink( $activities_template->activity->id, $activities_template->activity ), esc_attr__( 'View Discussion', 'buddypress' ), $time_since ), &$activities_template->activity ) );
+	else
+		$content .= str_pad( $time_since, strlen( $time_since ) + 2, ' ', STR_PAD_BOTH );
+
+	return apply_filters( 'bp_insert_activity_meta', $content );
+}
+
+/**
+ * Determine if the current user can delete an activity item
+ *
+ * @since 1.2.0
+ *
+ * @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;
+
+	if ( !$activity )
+		$activity = $activities_template->activity;
+
+	if ( isset( $activity->current_comment ) )
+		$activity = $activity->current_comment;
+
+	$can_delete = false;
+
+	if ( $bp->loggedin_user->is_super_admin )
+		$can_delete = true;
+
+	if ( $activity->user_id == $bp->loggedin_user->id )
+		$can_delete = true;
+
+	if ( $bp->is_item_admin && $bp->is_single_item )
+		$can_delete = true;
+
+	return apply_filters( 'bp_activity_user_can_delete', $can_delete );
+}
+
+/**
+ * Output the activity parent content
+ *
+ * @since 1.2.0
+ *
+ * @param array $args Optional
+ *
+ * @uses bp_get_activity_parent_content()
+ */
+function bp_activity_parent_content( $args = '' ) {
+	echo bp_get_activity_parent_content($args);
+}
+
+	/**
+	 * Return the activity content
+	 *
+	 * @since 1.2.0
+	 *
+	 * @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
+	 *
+	 * @return mixed False on failure, otherwise the activity parent content
+	 */
+	function bp_get_activity_parent_content( $args = '' ) {
+		global $bp, $activities_template;
+
+		$defaults = array(
+			'hide_user' => false
+		);
+
+		$r = wp_parse_args( $args, $defaults );
+		extract( $r, EXTR_SKIP );
+
+		// Get the ID of the parent activity content
+		if ( !$parent_id = $activities_template->activity->item_id )
+			return false;
+
+		// Get the content of the parent
+		if ( empty( $activities_template->activity_parents[$parent_id] ) )
+			return false;
+
+		if ( empty( $activities_template->activity_parents[$parent_id]->content ) )
+			$content = $activities_template->activity_parents[$parent_id]->action;
+		else
+			$content = $activities_template->activity_parents[$parent_id]->action . ' ' . $activities_template->activity_parents[$parent_id]->content;
+
+		// Remove the time since content for backwards compatibility
+		$content = str_replace( '<span class="time-since">%s</span>', '', $content );
+
+		// Remove images
+		$content = preg_replace( '/<img[^>]*>/Ui', '', $content );
+
+		return apply_filters( 'bp_get_activity_parent_content', $content );
+	}
+
+/**
+ * Output whether or not the current activity is in a current user's favorites
+ *
+ * @since 1.2.0
+ *
+ * @uses bp_get_activity_is_favorite()
+ */
+function bp_activity_is_favorite() {
+	echo bp_get_activity_is_favorite();
+}
+
+	/**
+	 * Return whether or not the current activity is in a current user's favorites
+	 *
+	 * @since 1.2.0
+	 *
+	 * @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;
+
+ 		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
+ *
+ * @todo deprecate $args param
+ *
+ * @param string $args Unused. Appears to be left over from an earlier implementation.
+ */
+function bp_activity_comments( $args = '' ) {
+	echo bp_activity_get_comments( $args );
+}
+
+	/**
+	 * Gets the comment markup for an activity item
+	 *
+	 * @since 1.2.0
+	 *
+	 * @todo deprecate $args param
+	 *
+	 * @todo Given that checks for children already happen in bp_activity_recurse_comments(),
+	 *    this function can probably be streamlined or removed.
+	 *
+	 * @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;
+
+		if ( !isset( $activities_template->activity->children ) || !$activities_template->activity->children )
+			return false;
+
+		bp_activity_recurse_comments( $activities_template->activity );
+	}
+
+		/**
+		 * Loops through a level of activity comments and loads the template for each
+		 *
+		 * 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
+		 *
+		 * @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;
+
+			if ( !$comment )
+				return false;
+
+			if ( empty( $comment->children ) )
+				return false;
+
+			echo '<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;
+
+				$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.
+				if ( !$template ) {
+					$template = BP_PLUGIN_DIR . '/bp-themes/bp-default/activity/comment.php';
+				}
+
+				load_template( $template, false );
+
+				unset( $activities_template->activity->current_comment );
+			}
+			echo '</ul>';
+		}
+
+/**
+ * Utility function that returns the comment currently being recursed
+ *
+ * @since 1.5.0
+ *
+ * @global object $activities_template {@link BP_Activity_Template}
+ * @uses apply_filters() To call the 'bp_activity_current_comment' hook
+ *
+ * @return object|bool $current_comment The activity comment currently being displayed. False on failure
+ */
+function bp_activity_current_comment() {
+	global $activities_template;
+
+	$current_comment = !empty( $activities_template->activity->current_comment ) ? $activities_template->activity->current_comment : false;
+
+	return apply_filters( 'bp_activity_current_comment', $current_comment );
+}
+
+
+/**
+ * Echoes the id of the activity comment currently being displayed
+ *
+ * @since 1.5.0
+ *
+ * @uses bp_get_activity_comment_id()
+ */
+function bp_activity_comment_id() {
+	echo bp_get_activity_comment_id();
+}
+
+	/**
+	 * Gets the id of the activity comment currently being displayed
+	 *
+	 * @since 1.5.0
+	 *
+	 * @global object $activities_template {@link BP_Activity_Template}
+	 * @uses apply_filters() To call the 'bp_activity_comment_id' hook
+	 *
+	 * @return int $comment_id The id of the activity comment currently being displayed
+	 */
+	function bp_get_activity_comment_id() {
+		global $activities_template;
+
+		$comment_id = isset( $activities_template->activity->current_comment->id ) ? $activities_template->activity->current_comment->id : false;
+
+		return apply_filters( 'bp_activity_comment_id', $comment_id );
+	}
+
+/**
+ * Echoes the user_id of the author of the activity comment currently being displayed
+ *
+ * @since 1.5.0
+ *
+ * @uses bp_get_activity_comment_user_id()
+ */
+function bp_activity_comment_user_id() {
+	echo bp_get_activity_comment_user_id();
+}
+
+	/**
+	 * Gets the user_id of the author of the activity comment currently being displayed
+	 *
+	 * @since 1.5.0
+	 *
+	 * @global object $activities_template {@link BP_Activity_Template}
+	 * @uses apply_filters() To call the 'bp_activity_comment_user_id' hook
+	 *
+	 * @return int|bool $user_id The user_id of the author of the displayed activity comment. False on failure
+	 */
+	function bp_get_activity_comment_user_id() {
+		global $activities_template;
+
+		$user_id = isset( $activities_template->activity->current_comment->user_id ) ? $activities_template->activity->current_comment->user_id : false;
+
+		return apply_filters( 'bp_activity_comment_user_id', $user_id );
+	}
+
+/**
+ * Echoes the author link for the activity comment currently being displayed
+ *
+ * @since 1.5.0
+ *
+ * @uses bp_get_activity_comment_user_link()
+ */
+function bp_activity_comment_user_link() {
+	echo bp_get_activity_comment_user_link();
+}
+
+	/**
+	 * Gets the author link for the activity comment currently being displayed
+	 *
+	 * @since 1.5.0
+	 *
+	 * @uses bp_core_get_user_domain()
+	 * @uses bp_get_activity_comment_user_id()
+	 * @uses apply_filters() To call the 'bp_activity_comment_user_link' hook
+	 *
+	 * @return string $user_link The URL of the activity comment author's profile
+	 */
+	function bp_get_activity_comment_user_link() {
+		$user_link = bp_core_get_user_domain( bp_get_activity_comment_user_id() );
+
+		return apply_filters( 'bp_activity_comment_user_link', $user_link );
+	}
+
+/**
+ * Echoes the author name for the activity comment currently being displayed
+ *
+ * @since 1.5.0
+ *
+ * @uses bp_get_activity_comment_name()
+ */
+function bp_activity_comment_name() {
+	echo bp_get_activity_comment_name();
+}
+
+	/**
+	 * Gets the author name for the activity comment currently being displayed
+	 *
+	 * The use of the bp_acomment_name filter is deprecated. Please use bp_activity_comment_name
+	 *
+	 * @since 1.5.0
+	 *
+	 * @global object $activities_template {@link BP_Activity_Template}
+	 * @uses apply_filters() To call the 'bp_acomment_name' hook
+	 * @uses apply_filters() To call the 'bp_activity_comment_name' hook
+	 *
+	 * @return string $name The full name of the activity comment author
+	 */
+	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
+
+		return apply_filters( 'bp_activity_comment_name', $name );
+	}
+
+/**
+ * Echoes the date_recorded of the activity comment currently being displayed
+ *
+ * @since 1.5.0
+ *
+ * @uses bp_get_activity_comment_date_recorded()
+ */
+function bp_activity_comment_date_recorded() {
+	echo bp_get_activity_comment_date_recorded();
+}
+
+	/**
+	 * Gets the date_recorded for the activity comment currently being displayed
+	 *
+	 * @since 1.5.0
+	 *
+	 * @global object $activities_template {@link BP_Activity_Template}
+	 * @uses bp_core_time_since()
+	 * @uses apply_filters() To call the 'bp_activity_comment_date_recorded' hook
+	 *
+	 * @return string|bool $date_recorded Time since the activity was recorded, of the form "%s ago". False on failure
+	 */
+	function bp_get_activity_comment_date_recorded() {
+		global $activities_template;
+
+		if ( empty( $activities_template->activity->current_comment->date_recorded ) )
+			return false;
+
+		$date_recorded = bp_core_time_since( $activities_template->activity->current_comment->date_recorded );
+
+		return apply_filters( 'bp_activity_comment_date_recorded', $date_recorded );
+	}
+
+/**
+ * Echoes the 'delete' URL for the activity comment currently being displayed
+ *
+ * @since 1.5.0
+ *
+ * @uses bp_get_activity_comment_delete_link()
+ */
+function bp_activity_comment_delete_link() {
+	echo bp_get_activity_comment_delete_link();
+}
+
+	/**
+	 * Gets the 'delete' URL for the activity comment currently being displayed
+	 *
+	 * @since 1.5.0
+	 *
+	 * @global object $bp BuddyPress global settings
+	 * @uses wp_nonce_url()
+	 * @uses bp_get_root_domain()
+	 * @uses bp_get_activity_slug()
+	 * @uses bp_get_activity_comment_id()
+	 * @uses apply_filters() To call the 'bp_activity_comment_delete_link' hook
+	 *
+	 * @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' );
+
+		return apply_filters( 'bp_activity_comment_delete_link', $link );
+	}
+
+/**
+ * Echoes the content of the activity comment currently being displayed
+ *
+ * @since 1.5.0
+ *
+ * @uses bp_get_activity_comment_content()
+ */
+function bp_activity_comment_content() {
+	echo bp_get_activity_comment_content();
+}
+
+	/**
+	 * Gets the content of the activity comment currently being displayed
+	 *
+	 * The content is run through two filters. bp_get_activity_content will apply all filters
+	 * applied to activity items in general. Use bp_activity_comment_content to modify the
+	 * content of activity comments only.
+	 *
+	 * @since 1.5.0
+	 *
+	 * @global object $activities_template {@link BP_Activity_Template}
+	 * @uses apply_filters() To call the 'bp_get_activity_content' hook
+	 * @uses apply_filters() To call the 'bp_activity_comment_content' hook
+	 *
+	 * @return string $content The content of the current activity comment
+	 */
+	function bp_get_activity_comment_content() {
+		global $activities_template;
+
+		$content = apply_filters( 'bp_get_activity_content', $activities_template->activity->current_comment->content );
+
+		return apply_filters( 'bp_activity_comment_content', $content );
+	}
+
+/**
+ * Echoes the activity comment count
+ *
+ * @since 1.2.0
+ *
+ * @uses bp_activity_get_comment_count()
+ */
+function bp_activity_comment_count() {
+	echo bp_activity_get_comment_count();
+}
+
+	/**
+	 * Gets the content of the activity comment currently being displayed
+	 *
+	 * The content is run through two filters. bp_get_activity_content will apply all filters
+	 * applied to activity items in general. Use bp_activity_comment_content to modify the
+	 * content of activity comments only.
+	 *
+	 * @since 1.2.0
+	 *
+	 * @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;
+
+		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 );
+	}
+
+		/**
+		 * Gets the content of the activity comment currently being displayed
+		 *
+		 * The content is run through two filters. bp_get_activity_content will apply all filters
+		 * applied to activity items in general. Use bp_activity_comment_content to modify the
+		 * content of activity comments only.
+		 *
+		 * @since 1.2.0
+		 *
+		 * @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 )
+				return $count;
+
+			foreach ( (array)$comment->children as $comment ) {
+				$count++;
+				$count = bp_activity_recurse_comment_count( $comment, $count );
+			}
+
+			return $count;
+		}
+
+/**
+ * Echoes the activity comment link
+ *
+ * @since 1.2.0
+ *
+ * @uses bp_get_activity_comment_link()
+ */
+function bp_activity_comment_link() {
+	echo bp_get_activity_comment_link();
+}
+
+	/**
+	 * Gets the activity comment link
+	 *
+	 * @since 1.2.0
+	 *
+	 * @global object $activities_template {@link BP_Activity_Template}
+	 * @uses apply_filters() To call the 'bp_get_activity_comment_link' hook
+	 *
+	 * @return string The activity comment link
+	 */
+	function bp_get_activity_comment_link() {
+		global $activities_template;
+		return apply_filters( 'bp_get_activity_comment_link', '?ac=' . $activities_template->activity->id . '/#ac-form-' . $activities_template->activity->id );
+	}
+
+/**
+ * Echoes the activity comment form no javascript display CSS
+ *
+ * @since 1.2.0
+ *
+ * @uses bp_get_activity_comment_form_nojs_display()
+ */
+function bp_activity_comment_form_nojs_display() {
+	echo bp_get_activity_comment_form_nojs_display();
+}
+
+	/**
+	 * Gets the activity comment form no javascript display CSS
+	 *
+	 * @since 1.2.0
+	 *
+	 * @global object $activities_template {@link BP_Activity_Template}
+	 *
+	 * @return string|bool The activity comment form no javascript display CSS. False on failure
+	 */
+	function bp_get_activity_comment_form_nojs_display() {
+		global $activities_template;
+		if ( isset( $_GET['ac'] ) && $_GET['ac'] == $activities_template->activity->id . '/' )
+			return 'style="display: block"';
+
+		return false;
+	}
+
+/**
+ * Echoes the activity comment form action
+ *
+ * @since 1.2.0
+ *
+ * @uses bp_get_activity_comment_form_action()
+ */
+function bp_activity_comment_form_action() {
+	echo bp_get_activity_comment_form_action();
+}
+
+	/**
+	 * Gets the activity comment form action
+	 *
+	 * @since 1.2.0
+	 *
+	 * @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
+	 *
+	 * @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
+ *
+ * @uses bp_get_activity_permalink_id()
+ */
+function bp_activity_permalink_id() {
+	echo bp_get_activity_permalink_id();
+}
+
+	/**
+	 * Gets the activity permalink id
+	 *
+	 * @since 1.2.0
+	 *
+	 * @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 );
+	}
+
+/**
+ * Echoes the activity thread permalink
+ *
+ * @since 1.2.0
+ *
+ * @uses bp_get_activity_permalink_id()
+ */
+function bp_activity_thread_permalink() {
+	echo bp_get_activity_thread_permalink();
+}
+
+	/**
+	 * Gets the activity thread permalink
+	 *
+	 * @since 1.2.0
+	 *
+	 * @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;
+
+		$link = bp_activity_get_permalink( $activities_template->activity->id, $activities_template->activity );
+
+	 	return apply_filters( 'bp_get_activity_thread_permalink', $link );
+	}
+
+/**
+ * Echoes the activity favorite link
+ *
+ * @since 1.2.0
+ *
+ * @uses bp_get_activity_favorite_link()
+ */
+function bp_activity_favorite_link() {
+	echo bp_get_activity_favorite_link();
+}
+
+	/**
+	 * Gets the activity favorite link
+	 *
+	 * @since 1.2.0
+	 *
+	 * @global object $bp BuddyPress global settings
+	 * @global object $activities_template {@link BP_Activity_Template}
+	 * @uses wp_nonce_url()
+	 * @uses home_url()
+	 * @uses bp_get_activity_root_slug()
+	 * @uses apply_filters() To call the 'bp_get_activity_favorite_link' hook
+	 *
+	 * @return string The activity favorite link
+	 */
+	function bp_get_activity_favorite_link() {
+		global $bp, $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
+ *
+ * @uses bp_get_activity_unfavorite_link()
+ */
+function bp_activity_unfavorite_link() {
+	echo bp_get_activity_unfavorite_link();
+}
+
+	/**
+	 * Gets the activity unfavorite link
+	 *
+	 * @since 1.2.0
+	 *
+	 * @global object $bp BuddyPress global settings
+	 * @global object $activities_template {@link BP_Activity_Template}
+	 * @uses wp_nonce_url()
+	 * @uses home_url()
+	 * @uses bp_get_activity_root_slug()
+	 * @uses apply_filters() To call the 'bp_get_activity_unfavorite_link' hook
+	 *
+	 * @return string The activity unfavorite link
+	 */
+	function bp_get_activity_unfavorite_link() {
+		global $bp, $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
+ *
+ * @uses bp_get_activity_css_class()
+ */
+function bp_activity_css_class() {
+	echo bp_get_activity_css_class();
+}
+
+	/**
+	 * Gets the activity CSS class
+	 *
+	 * @since 1.0.0
+	 *
+	 * @global object $activities_template {@link BP_Activity_Template}
+	 * @uses apply_filters() To call the 'bp_activity_mini_activity_types' hook
+	 * @uses bp_activity_get_comment_count()
+	 * @uses bp_activity_can_comment()
+	 * @uses apply_filters() To call the 'bp_get_activity_css_class' hook
+	 *
+	 * @return string The activity css class
+	 */
+	function bp_get_activity_css_class() {
+		global $activities_template;
+
+		$mini_activity_actions = apply_filters( 'bp_activity_mini_activity_types', array(
+			'friendship_accepted',
+			'friendship_created',
+			'new_blog',
+			'joined_group',
+			'created_group',
+			'new_member'
+		) );
+
+		$class = '';
+		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';
+
+		return apply_filters( 'bp_get_activity_css_class', $activities_template->activity->component . ' ' . $activities_template->activity->type . $class );
+	}
+
+/**
+ * Display the activity delete link.
+ *
+ * @since 1.1.0
+ *
+ * @uses bp_get_activity_delete_link()
+ */
+function bp_activity_delete_link() {
+	echo bp_get_activity_delete_link();
+}
+
+	/**
+	 * Return the activity delete link.
+	 *
+	 * @since 1.1.0
+	 *
+	 * @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()
+	 * @uses bp_current_action()
+	 * @uses add_query_arg()
+	 * @uses wp_get_referer()
+	 * @uses wp_nonce_url()
+	 * @uses apply_filters() To call the 'bp_get_activity_delete_link' hook
+	 *
+	 * @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;
+
+		$url   = bp_get_root_domain() . '/' . bp_get_activity_root_slug() . '/delete/' . $activities_template->activity->id;
+		$class = 'delete-activity';
+
+		// Determine if we're on a single activity page, and customize accordingly
+		if ( bp_is_activity_component() && is_numeric( bp_current_action() ) ) {
+			$url   = add_query_arg( array( 'redirect_to' => wp_get_referer() ), $url );
+			$class = 'delete-activity-single';
+		}
+
+		$link = '<a href="' . wp_nonce_url( $url, 'bp_activity_delete_link' ) . '" class="button item-button bp-secondary-action ' . $class . ' confirm" rel="nofollow">' . __( 'Delete', 'buddypress' ) . '</a>';
+		return apply_filters( 'bp_get_activity_delete_link', $link );
+	}
+
+/**
+ * Display the activity latest update link.
+ *
+ * @since 1.2.0
+ *
+ * @param int $user_id Defaults to 0
+ *
+ * @uses bp_get_activity_latest_update()
+ */
+function bp_activity_latest_update( $user_id = 0 ) {
+	echo bp_get_activity_latest_update( $user_id );
+}
+
+	/**
+	 * Return the activity latest update link.
+	 *
+	 * @since 1.2.0
+	 *
+	 * @param int $user_id Defaults to 0
+	 *
+	 * @global object $bp BuddyPress global settings
+	 * @uses bp_core_is_user_spammer()
+	 * @uses bp_core_is_user_deleted()
+	 * @uses bp_get_user_meta()
+	 * @uses apply_filters() To call the 'bp_get_activity_latest_update_excerpt' hook
+	 * @uses bp_create_excerpt()
+	 * @uses bp_get_root_domain()
+	 * @uses bp_get_activity_root_slug()
+	 * @uses apply_filters() To call the 'bp_get_activity_latest_update' hook
+	 *
+	 * @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 ( bp_core_is_user_spammer( $user_id ) || bp_core_is_user_deleted( $user_id ) )
+			return false;
+
+		if ( !$update = bp_get_user_meta( $user_id, 'bp_latest_update', true ) )
+			return false;
+
+		$latest_update = apply_filters( 'bp_get_activity_latest_update_excerpt', trim( strip_tags( bp_create_excerpt( $update['content'], 358 ) ) ) );
+		$latest_update .= ' <a href="' . bp_get_root_domain() . '/' . bp_get_activity_root_slug() . '/p/' . $update['id'] . '/"> ' . __( 'View', 'buddypress' ) . '</a>';
+
+		return apply_filters( 'bp_get_activity_latest_update', $latest_update  );
+	}
+
+/**
+ * Display the activity filter links.
+ *
+ * @since 1.1.0
+ *
+ * @param array $args Defaults to false
+ *
+ * @uses bp_get_activity_filter_links()
+ */
+function bp_activity_filter_links( $args = false ) {
+	echo bp_get_activity_filter_links( $args );
+}
+
+	/**
+	 * Return the activity filter links.
+	 *
+	 * @since 1.1.0
+	 *
+	 * @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()
+	 * @uses add_query_arg()
+	 * @uses remove_query_arg()
+	 * @uses apply_filters() To call the 'bp_get_activity_filter_link_href' hook
+	 * @uses apply_filters() To call the 'bp_get_activity_filter_links' hook
+	 *
+	 * @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'
+		);
+
+		$r = wp_parse_args( $args, $defaults );
+		extract( $r, EXTR_SKIP );
+
+		// Fetch the names of components that have activity recorded in the DB
+		$components = BP_Activity_Activity::get_recorded_components();
+
+		if ( !$components )
+			return false;
+
+		foreach ( (array) $components as $component ) {
+			/* Skip the activity comment filter */
+			if ( 'activity' == $component )
+				continue;
+
+			if ( isset( $_GET['afilter'] ) && $component == $_GET['afilter'] )
+				$selected = ' class="selected"';
+			else
+				unset($selected);
+
+			$component = esc_attr( $component );
+
+			switch ( $style ) {
+				case 'list':
+					$tag = 'li';
+					$before = '<li id="afilter-' . $component . '"' . $selected . '>';
+					$after = '</li>';
+				break;
+				case 'paragraph':
+					$tag = 'p';
+					$before = '<p id="afilter-' . $component . '"' . $selected . '>';
+					$after = '</p>';
+				break;
+				case 'span':
+					$tag = 'span';
+					$before = '<span id="afilter-' . $component . '"' . $selected . '>';
+					$after = '</span>';
+				break;
+			}
+
+			$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;
+		}
+
+		$link = remove_query_arg( 'afilter' , $link );
+
+		if ( isset( $_GET['afilter'] ) )
+			$component_links[] = '<' . $tag . ' id="afilter-clear"><a href="' . esc_attr( $link ) . '">' . __( 'Clear Filter', 'buddypress' ) . '</a></' . $tag . '>';
+
+ 		return apply_filters( 'bp_get_activity_filter_links', implode( "\n", $component_links ) );
+	}
+
+/**
+ * Determine if a comment can be made on an activity item
+ *
+ * @since 1.2.0
+ *
+ * @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;
+
+	$can_comment = true;
+
+	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;
+	}
+
+	if ( 'activity_comment' == bp_get_activity_action_name() )
+		$can_comment = false;
+
+	return apply_filters( 'bp_activity_can_comment', $can_comment );
+}
+
+/**
+ * Determine if a comment can be made on an activity reply item
+ *
+ * @since 1.5.0
+ *
+ * @param object $comment Activity comment
+ *
+ * @uses apply_filters() To call the 'bp_activity_can_comment_reply' hook
+ *
+ * @return bool $can_comment Defaults to true
+ */
+function bp_activity_can_comment_reply( $comment ) {
+	$can_comment = true;
+
+	return apply_filters( 'bp_activity_can_comment_reply', $can_comment, $comment );
+}
+
+/**
+ * Determine if an favorites are allowed
+ *
+ * @since 1.5.0
+ *
+ * @uses apply_filters() To call the 'bp_activity_can_favorite' hook
+ *
+ * @return bool $can_favorite Defaults to true
+ */
+function bp_activity_can_favorite() {
+	$can_favorite = true;
+
+	return apply_filters( 'bp_activity_can_favorite', $can_favorite );
+}
+
+/**
+ * Echoes the total favorite count for a specified user
+ *
+ * @since 1.2.0
+ *
+ * @param int $user_id Defaults to 0
+ *
+ * @uses bp_get_total_favorite_count_for_user()
+ */
+function bp_total_favorite_count_for_user( $user_id = 0 ) {
+	echo bp_get_total_favorite_count_for_user( $user_id );
+}
+
+	/**
+	 * Returns the total favorite count for a specified user
+	 *
+	 * @since 1.2.0
+	 *
+	 * @param int $user_id Defaults to 0
+	 *
+	 * @uses bp_activity_total_favorites_for_user()
+	 * @uses apply_filters() To call the 'bp_get_total_favorite_count_for_user' hook
+	 *
+	 * @return int The total favorite count for a specified user
+	 */
+	function bp_get_total_favorite_count_for_user( $user_id = 0 ) {
+		return apply_filters( 'bp_get_total_favorite_count_for_user', bp_activity_total_favorites_for_user( $user_id ) );
+	}
+
+/**
+ * Echoes the total mention count for a specified user
+ *
+ * @since 1.2.0
+ *
+ * @param int $user_id Defaults to 0
+ *
+ * @uses bp_get_total_favorite_count_for_user()
+ */
+function bp_total_mention_count_for_user( $user_id = 0 ) {
+	echo bp_get_total_favorite_count_for_user( $user_id );
+}
+
+	/**
+	 * Returns the total mention count for a specified user
+	 *
+	 * @since 1.2.0
+	 *
+	 * @todo remove unnecessary $bp global
+	 *
+	 * @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
+ *
+ * @uses bp_get_send_public_message_link()
+ */
+function bp_send_public_message_link() {
+	echo bp_get_send_public_message_link();
+}
+
+	/**
+	 * Returns the public message link for displayed user
+	 *
+	 * @since 1.2.0
+	 *
+	 * @global object $bp BuddyPress global settings
+	 * @uses bp_is_my_profile()
+	 * @uses is_user_logged_in()
+	 * @uses wp_nonce_url()
+	 * @uses bp_loggedin_user_domain()
+	 * @uses bp_get_activity_slug()
+	 * @uses bp_core_get_username()
+	 * @uses apply_filters() To call the 'bp_get_send_public_message_link' hook
+	 *
+	 * @return string The public message link for displayed user
+	 */
+	function bp_get_send_public_message_link() {
+		global $bp;
+
+		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 ) ) );
+	}
+
+/**
+ * Echoes the mentioned user display name
+ *
+ * @since 1.2.0
+ *
+ * @param int|string User id or username
+ *
+ * @uses bp_get_mentioned_user_display_name()
+ */
+function bp_mentioned_user_display_name( $user_id_or_username ) {
+	echo bp_get_mentioned_user_display_name( $user_id_or_username );
+}
+
+	/**
+	 * Returns the mentioned user display name
+	 *
+	 * @since 1.2.0
+	 *
+	 * @param int|string User id or username
+	 *
+	 * @uses bp_core_get_user_displayname()
+	 * @uses apply_filters() To call the 'bp_get_mentioned_user_display_name' hook
+	 *
+	 * @return string The mentioned user display name
+	 */
+	function bp_get_mentioned_user_display_name( $user_id_or_username ) {
+		if ( !$name = bp_core_get_user_displayname( $user_id_or_username ) )
+			$name = __( 'a user', 'buddypress' );
+
+		return apply_filters( 'bp_get_mentioned_user_display_name', $name, $user_id_or_username );
+	}
+
+/**
+ * Output button for sending a public message
+ *
+ * @since 1.2.0
+ *
+ * @param array $args Optional
+ *
+ * @uses bp_get_send_public_message_button()
+ */
+function bp_send_public_message_button( $args = '' ) {
+	echo bp_get_send_public_message_button( $args );
+}
+
+	/**
+	 * Return button for sending a public message
+	 *
+	 * @since 1.2.0
+	 *
+	 * @param array $args Optional
+	 *
+	 * @uses bp_get_send_public_message_link()
+	 * @uses wp_parse_args()
+	 * @uses bp_get_button()
+	 * @uses apply_filters() To call the 'bp_get_send_public_message_button' hook
+	 *
+	 * @return string The button for sending a public message
+	 */
+	function bp_get_send_public_message_button( $args = '' ) {
+		$defaults = array(
+			'id'                => 'public_message',
+			'component'         => 'activity',
+			'must_be_logged_in' => true,
+			'block_self'        => true,
+			'wrapper_id'        => 'post-mention',
+			'link_href'         => bp_get_send_public_message_link(),
+			'link_title'        => __( 'Send a public message on your activity stream.', 'buddypress' ),
+			'link_text'         => __( 'Public Message', 'buddypress' ),
+			'link_class'        => 'activity-button mention'
+		);
+
+		$button = wp_parse_args( $args, $defaults );
+
+		// Filter and return the HTML button
+		return bp_get_button( apply_filters( 'bp_get_send_public_message_button', $button ) );
+	}
+
+/**
+ * Outputs the activity post form action
+ *
+ * @since 1.2.0
+ *
+ * @uses bp_get_activity_post_form_action()
+ */
+function bp_activity_post_form_action() {
+	echo bp_get_activity_post_form_action();
+}
+
+	/**
+	 * Returns the activity post form action
+	 *
+	 * @since 1.2.0
+	 *
+	 * @uses home_url()
+	 * @uses bp_get_activity_root_slug()
+	 * @uses apply_filters() To call the 'bp_get_activity_post_form_action' hook
+	 *
+	 * @return string The activity post form action
+	 */
+	function bp_get_activity_post_form_action() {
+		return apply_filters( 'bp_get_activity_post_form_action', home_url( bp_get_activity_root_slug() . '/post/' ) );
+	}
+
+/* RSS Feed Template Tags ****************************************************/
+
+/**
+ * Outputs the sitewide activity feed link
+ *
+ * @since 1.0.0
+ *
+ * @uses bp_get_sitewide_activity_feed_link()
+ */
+function bp_sitewide_activity_feed_link() {
+	echo bp_get_sitewide_activity_feed_link();
+}
+
+	/**
+	 * Returns the sitewide activity feed link
+	 *
+	 * @since 1.0.0
+	 *
+	 * @uses home_url()
+	 * @uses bp_get_activity_root_slug()
+	 * @uses apply_filters() To call the 'bp_get_sitewide_activity_feed_link' hook
+	 *
+	 * @return string The sitewide activity feed link
+	 */
+	function bp_get_sitewide_activity_feed_link() {
+		return apply_filters( 'bp_get_sitewide_activity_feed_link', bp_get_root_domain() . '/' . bp_get_activity_root_slug() . '/feed/' );
+	}
+
+/**
+ * Outputs the member activity feed link
+ *
+ * @since 1.2.0
+ *
+ * @uses bp_get_member_activity_feed_link()
+ */
+function bp_member_activity_feed_link() {
+	echo bp_get_member_activity_feed_link();
+}
+
+/**
+ * Outputs the member activity feed link
+ *
+ * @since 1.0.0
+ * @deprecated 1.2.0
+ *
+ * @todo properly deprecated in favor of bp_member_activity_feed_link()
+ *
+ * @uses bp_get_member_activity_feed_link()
+ */
+function bp_activities_member_rss_link() { echo bp_get_member_activity_feed_link(); }
+
+	/**
+	 * Returns the member activity feed link
+	 *
+	 * @since 1.2.0
+	 *
+	 * @uses bp_is_profile_component()
+	 * @uses bp_is_current_action()
+	 * @uses bp_displayed_user_domain()
+	 * @uses bp_get_activity_slug()
+	 * @uses bp_is_active()
+	 * @uses bp_get_friends_slug()
+	 * @uses bp_get_groups_slug()
+	 * @uses apply_filters() To call the 'bp_get_activities_member_rss_link' hook
+	 *
+	 * @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/';
+		elseif ( bp_is_active( 'friends' ) && bp_is_current_action( bp_get_friends_slug() ) )
+			$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 )
+			$link = bp_displayed_user_domain() . bp_get_activity_slug() . '/favorites/feed/';
+		elseif ( 'mentions' == $bp->current_action )
+			$link = bp_displayed_user_domain() . bp_get_activity_slug() . '/mentions/feed/';
+		else
+			$link = '';
+
+		return apply_filters( 'bp_get_activities_member_rss_link', $link );
+	}
+
+	/**
+	 * Returns the member activity feed link
+	 *
+	 * @since 1.0.0
+	 * @deprecated 1.2.0
+	 *
+	 * @todo properly deprecated in favor of bp_get_member_activity_feed_link()
+	 *
+	 * @uses bp_get_member_activity_feed_link()
+	 *
+	 * @return string The member activity feed link
+	 */
+	function bp_get_activities_member_rss_link() { return bp_get_member_activity_feed_link(); }
+
+
+/** Template tags for RSS feed output ****************************************/
+
+/**
+ * Outputs the activity feed item guid
+ *
+ * @since 1.0.0
+ *
+ * @uses bp_activity_feed_item_guid()
+ */
+function bp_activity_feed_item_guid() {
+	echo bp_get_activity_feed_item_guid();
+}
+
+	/**
+	 * Returns the activity feed item guid
+	 *
+	 * @since 1.2.0
+	 *
+	 * @global object $activities_template {@link BP_Activity_Template}
+	 * @uses apply_filters() To call the 'bp_get_activity_feed_item_guid' hook
+	 *
+	 * @return string The activity feed item guid
+	 */
+	function bp_get_activity_feed_item_guid() {
+		global $activities_template;
+
+		return apply_filters( 'bp_get_activity_feed_item_guid', md5( $activities_template->activity->date_recorded . '-' . $activities_template->activity->content ) );
+	}
+
+/**
+ * Outputs the activity feed item title
+ *
+ * @since 1.0.0
+ *
+ * @uses bp_get_activity_feed_item_title()
+ */
+function bp_activity_feed_item_title() {
+	echo bp_get_activity_feed_item_title();
+}
+
+	/**
+	 * Returns the activity feed item title
+	 *
+	 * @since 1.0.0
+	 *
+	 * @global object $activities_template {@link BP_Activity_Template}
+	 * @uses ent2ncr()
+	 * @uses convert_chars()
+	 * @uses bp_create_excerpt()
+	 * @uses apply_filters() To call the 'bp_get_activity_feed_item_title' hook
+	 *
+	 * @return string $title The activity feed item title
+	 */
+	function bp_get_activity_feed_item_title() {
+		global $activities_template;
+
+		if ( !empty( $activities_template->activity->action ) )
+			$content = $activities_template->activity->action;
+		else
+			$content = $activities_template->activity->content;
+
+		$content = explode( '<span', $content );
+		$title = strip_tags( ent2ncr( trim( convert_chars( $content[0] ) ) ) );
+
+		if ( ':' == substr( $title, -1 ) )
+			$title = substr( $title, 0, -1 );
+
+		if ( 'activity_update' == $activities_template->activity->type )
+			$title .= ': ' . strip_tags( ent2ncr( trim( convert_chars( bp_create_excerpt( $activities_template->activity->content, 70, array( 'ending' => " [&#133;]" ) ) ) ) ) );
+
+		return apply_filters( 'bp_get_activity_feed_item_title', $title );
+	}
+
+/**
+ * Outputs the activity feed item link
+ *
+ * @since 1.0.0
+ *
+ * @uses bp_get_activity_feed_item_link()
+ */
+function bp_activity_feed_item_link() {
+	echo bp_get_activity_feed_item_link();
+}
+
+	/**
+	 * Returns the activity feed item link
+	 *
+	 * @since 1.0.0
+	 *
+	 * @global object $activities_template {@link BP_Activity_Template}
+	 * @uses apply_filters() To call the 'bp_get_activity_feed_item_link' hook
+	 *
+	 * @return string The activity feed item link
+	 */
+	function bp_get_activity_feed_item_link() {
+		global $activities_template;
+
+		return apply_filters( 'bp_get_activity_feed_item_link', $activities_template->activity->primary_link );
+	}
+
+/**
+ * Outputs the activity feed item date
+ *
+ * @since 1.0.0
+ *
+ * @uses bp_get_activity_feed_item_date()
+ */
+function bp_activity_feed_item_date() {
+	echo bp_get_activity_feed_item_date();
+}
+
+	/**
+	 * Returns the activity feed item date
+	 *
+	 * @since 1.0.0
+	 *
+	 * @global object $activities_template {@link BP_Activity_Template}
+	 * @uses apply_filters() To call the 'bp_get_activity_feed_item_date' hook
+	 *
+	 * @return string The activity feed item date
+	 */
+	function bp_get_activity_feed_item_date() {
+		global $activities_template;
+
+		return apply_filters( 'bp_get_activity_feed_item_date', $activities_template->activity->date_recorded );
+	}
+
+/**
+ * Outputs the activity feed item description
+ *
+ * @since 1.0.0
+ *
+ * @uses bp_get_activity_feed_item_description()
+ */
+function bp_activity_feed_item_description() {
+	echo bp_get_activity_feed_item_description();
+}
+
+	/**
+	 * Returns the activity feed item description
+	 *
+	 * @since 1.0.0
+	 *
+	 * @global object $activities_template {@link BP_Activity_Template}
+	 * @uses ent2ncr()
+	 * @uses convert_chars()
+	 * @uses apply_filters() To call the 'bp_get_activity_feed_item_description' hook
+	 *
+	 * @return string The activity feed item description
+	 */
+	function bp_get_activity_feed_item_description() {
+		global $activities_template;
+
+		if ( empty( $activities_template->activity->action ) )
+			$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 ) ) ) );
+	}
+
+/**
+ * Template tag so we can hook activity feed to <head>
+ *
+ * @since 1.5.0
+ *
+ * @uses bloginfo()
+ * @uses bp_sitewide_activity_feed_link()
+ */
+function bp_activity_sitewide_feed() {
+?>
+
+	<link rel="alternate" type="application/rss+xml" title="<?php bloginfo( 'name' ) ?> | <?php _e( 'Site Wide Activity RSS Feed', 'buddypress' ) ?>" href="<?php bp_sitewide_activity_feed_link() ?>" />
+
+<?php
+}
+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 3fade9c3d6109da7b18c7ca2626e44d02f072b9b..b99de10459ba5539c9bd8a1e127ca1da072b2dc0 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
@@ -1,13 +1,19 @@
 <?php
+
 /**
  * RSS2 Feed Template for displaying a member's favorite activity
  *
  * @package BuddyPress
+ * @subpackage ActivityFeeds
  */
-header('Content-Type: text/xml; charset=' . get_option('blog_charset'), true);
+
+// Exit if accessed directly
+if ( !defined( 'ABSPATH' ) ) exit;
+
+header('Content-Type: text/xml; charset=' . get_option( 'blog_charset' ), true );
 header('Status: 200 OK');
 ?>
-<?php echo '<?xml version="1.0" encoding="'.get_option('blog_charset').'"?'.'>'; ?>
+<?php echo '<?xml version="1.0" encoding="' . get_option( 'blog_charset' ) . '"?'.'>'; ?>
 
 <rss version="2.0"
 	xmlns:content="http://purl.org/rss/1.0/modules/content/"
@@ -18,13 +24,14 @@ header('Status: 200 OK');
 >
 
 <channel>
-	<title><?php echo bp_site_name() ?> | <?php echo $bp->displayed_user->fullname; ?> | <?php _e( 'Favorite Activity', 'buddypress' ) ?></title>
+	<title><?php bp_site_name() ?> | <?php echo $bp->displayed_user->fullname; ?> | <?php _e( 'Favorite Activity', 'buddypress' ) ?></title>
 	<atom:link href="<?php self_link(); ?>" rel="self" type="application/rss+xml" />
-	<link><?php echo site_url( BP_ACTIVITY_SLUG . '/#my-favorites/' ) ?></link>
+	<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>
 	<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_favorites_feed_head'); ?>
 
 	<?php
@@ -34,9 +41,10 @@ header('Status: 200 OK');
 
 	<?php if ( bp_has_activities( 'include=' . $fav_ids . '&max=50&display_comments=stream' ) ) : ?>
 		<?php while ( bp_activities() ) : bp_the_activity(); ?>
+
 			<item>
 				<guid><?php bp_activity_thread_permalink() ?></guid>
-				<title><![CDATA[<?php bp_activity_feed_item_title() ?>]]></title>
+				<title><?php bp_activity_feed_item_title() ?></title>
 				<link><?php echo bp_activity_thread_permalink() ?></link>
 				<pubDate><?php echo mysql2date('D, d M Y H:i:s O', bp_get_activity_feed_item_date(), false); ?></pubDate>
 
@@ -54,10 +62,13 @@ header('Status: 200 OK');
 					<?php endif; ?>
 					]]>
 				</description>
+
 				<?php do_action('bp_activity_favorites_feed_item'); ?>
+
 			</item>
-		<?php endwhile; ?>
 
+		<?php endwhile; ?>
 	<?php endif; ?>
+
 </channel>
 </rss>
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 f0e62a5b4a47a41cf277620c407e8cd2e96cfba4..e1d83abd693eaf403ef192b52fc2111575517693 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
@@ -1,9 +1,15 @@
 <?php
+
 /**
  * RSS2 Feed Template for displaying a member's friends activity stream.
  *
  * @package BuddyPress
+ * @subpackage ActivityFeeds
  */
+
+// Exit if accessed directly
+if ( !defined( 'ABSPATH' ) ) exit;
+
 header('Content-Type: text/xml; charset=' . get_option('blog_charset'), true);
 header('Status: 200 OK');
 ?>
@@ -18,35 +24,34 @@ header('Status: 200 OK');
 >
 
 <channel>
-	<title><?php echo bp_site_name() ?> | <?php echo $bp->displayed_user->fullname; ?> | <?php _e( 'Friends Activity', 'buddypress' ) ?></title>
+	<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->activity->slug . '/my-friends/feed' ?></link>
-	<description><?php printf( __( '%s - Friends Activity Feed', 'buddypress' ), $bp->displayed_user->fullname ) ?></description>
+	<link><?php echo bp_displayed_user_domain() . bp_get_activity_slug() . '/' . bp_get_friends_slug() . '/feed'; ?></link>
+	<description><?php printf( __( '%s - Friends 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>
+	<generator>http://buddypress.org/?v=<?php echo BP_VERSION; ?></generator>
 	<language><?php echo get_option('rss_language'); ?></language>
 	<?php do_action('bp_activity_friends_feed_head'); ?>
 
-	<?php $friend_ids = implode( ',', friends_get_friend_user_ids( $bp->displayed_user->id ) ); ?>
-	<?php if ( bp_has_activities( 'user_id=' . $friend_ids . '&max=50&display_comments=stream' ) ) : ?>
+	<?php if ( bp_has_activities( 'scope=friends&max=50&display_comments=stream' ) ) : ?>
 		<?php while ( bp_activities() ) : bp_the_activity(); ?>
 			<item>
-				<guid><?php bp_activity_thread_permalink() ?></guid>
-				<title><![CDATA[<?php bp_activity_feed_item_title() ?>]]></title>
-				<link><?php echo bp_activity_thread_permalink() ?></link>
+				<guid><?php bp_activity_thread_permalink(); ?></guid>
+				<title><?php bp_activity_feed_item_title(); ?></title>
+				<link><?php echo bp_activity_thread_permalink(); ?></link>
 				<pubDate><?php echo mysql2date('D, d M Y H:i:s O', bp_get_activity_feed_item_date(), false); ?></pubDate>
 
 				<description>
 					<![CDATA[
-					<?php bp_activity_feed_item_description() ?>
+					<?php bp_activity_feed_item_description(); ?>
 
 					<?php if ( bp_activity_can_comment() ) : ?>
 						<p><?php printf( __( 'Comments: %s', 'buddypress' ), bp_activity_get_comment_count() ); ?></p>
 					<?php endif; ?>
 
 					<?php if ( 'activity_comment' == bp_get_activity_action_name() ) : ?>
-						<br /><strong><?php _e( 'In reply to', 'buddypress' ) ?></strong> -
-						<?php bp_activity_parent_content() ?>
+						<br /><strong><?php _e( 'In reply to', 'buddypress' ); ?></strong> -
+						<?php bp_activity_parent_content(); ?>
 					<?php endif; ?>
 					]]>
 				</description>
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 8748b60a24c916f0d185296f572438b35ffab4c0..4300e17598b406a768e737ddf52185a24125c3bf 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
@@ -1,9 +1,15 @@
 <?php
+
 /**
  * RSS2 Feed Template for displaying a group activity stream
  *
  * @package BuddyPress
+ * @subpackage ActivityFeeds
  */
+
+// Exit if accessed directly
+if ( !defined( 'ABSPATH' ) ) exit;
+
 header('Content-Type: text/xml; charset=' . get_option('blog_charset'), true);
 header('Status: 200 OK');
 ?>
@@ -18,9 +24,9 @@ header('Status: 200 OK');
 >
 
 <channel>
-	<title><?php echo bp_site_name() ?> | <?php echo $bp->groups->current_group->name ?> | <?php _e( 'Group Activity', 'buddypress' ) ?></title>
+	<title><?php bp_site_name() ?> | <?php echo $bp->groups->current_group->name ?> | <?php _e( '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->activity->slug . '/feed' ?></link>
+	<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>
 	<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>
@@ -31,7 +37,7 @@ header('Status: 200 OK');
 		<?php while ( bp_activities() ) : bp_the_activity(); ?>
 			<item>
 				<guid><?php bp_activity_thread_permalink() ?></guid>
-				<title><![CDATA[<?php bp_activity_feed_item_title() ?>]]></title>
+				<title><?php bp_activity_feed_item_title() ?></title>
 				<link><?php echo bp_activity_thread_permalink() ?></link>
 				<pubDate><?php echo mysql2date('D, d M Y H:i:s O', bp_get_activity_feed_item_date(), false); ?></pubDate>
 
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 8a0b868121d802bed0994ac1adcaf10daee41c02..40228d24ae8481dafef32d32522b30ff9fbc2878 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,9 +1,15 @@
 <?php
+
 /**
  * RSS2 Feed Template for displaying a member's group's activity
  *
  * @package BuddyPress
+ * @subpackage ActivityFeeds
  */
+
+// Exit if accessed directly
+if ( !defined( 'ABSPATH' ) ) exit;
+
 header('Content-Type: text/xml; charset=' . get_option('blog_charset'), true);
 header('Status: 200 OK');
 ?>
@@ -18,9 +24,9 @@ header('Status: 200 OK');
 >
 
 <channel>
-	<title><?php echo bp_site_name() ?> | <?php echo $bp->displayed_user->fullname; ?> | <?php _e( 'Mentions', 'buddypress' ) ?></title>
+	<title><?php bp_site_name() ?> | <?php echo $bp->displayed_user->fullname; ?> | <?php _e( 'Mentions', 'buddypress' ) ?></title>
 	<atom:link href="<?php self_link(); ?>" rel="self" type="application/rss+xml" />
-	<link><?php echo site_url( BP_ACTIVITY_SLUG . '/#mentions/' ) ?></link>
+	<link><?php echo home_url( bp_get_activity_root_slug() . '/#mentions/' ) ?></link>
 	<description><?php echo $bp->displayed_user->fullname; ?> - <?php _e( 'Mentions', 'buddypress' ) ?></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>
@@ -31,7 +37,7 @@ header('Status: 200 OK');
 		<?php while ( bp_activities() ) : bp_the_activity(); ?>
 			<item>
 				<guid><?php bp_activity_thread_permalink() ?></guid>
-				<title><![CDATA[<?php bp_activity_feed_item_title() ?>]]></title>
+				<title><?php bp_activity_feed_item_title() ?></title>
 				<link><?php echo bp_activity_thread_permalink() ?></link>
 				<pubDate><?php echo mysql2date('D, d M Y H:i:s O', bp_get_activity_feed_item_date(), false); ?></pubDate>
 
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 01d3e46023d99be133edb9fc07a5818f0ffa62ac..21b8d26fc99a09e9798560da2203ec90881036b6 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
@@ -1,9 +1,15 @@
 <?php
+
 /**
  * RSS2 Feed Template for displaying a member's group's activity
  *
  * @package BuddyPress
+ * @subpackage ActivityFeeds
  */
+
+// Exit if accessed directly
+if ( !defined( 'ABSPATH' ) ) exit;
+
 header('Content-Type: text/xml; charset=' . get_option('blog_charset'), true);
 header('Status: 200 OK');
 ?>
@@ -18,9 +24,9 @@ header('Status: 200 OK');
 >
 
 <channel>
-	<title><?php echo bp_site_name() ?> | <?php echo $bp->displayed_user->fullname; ?> | <?php _e( 'My Groups - Public Activity', 'buddypress' ) ?></title>
+	<title><?php bp_site_name() ?> | <?php echo $bp->displayed_user->fullname; ?> | <?php _e( 'My Groups - Public Activity', 'buddypress' ) ?></title>
 	<atom:link href="<?php self_link(); ?>" rel="self" type="application/rss+xml" />
-	<link><?php echo site_url( BP_ACTIVITY_SLUG . '/#my-groups/' ) ?></link>
+	<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>
 	<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>
@@ -36,7 +42,7 @@ header('Status: 200 OK');
 		<?php while ( bp_activities() ) : bp_the_activity(); ?>
 			<item>
 				<guid><?php bp_activity_thread_permalink() ?></guid>
-				<title><![CDATA[<?php bp_activity_feed_item_title() ?>]]></title>
+				<title><?php bp_activity_feed_item_title() ?></title>
 				<link><?php echo bp_activity_thread_permalink() ?></link>
 				<pubDate><?php echo mysql2date('D, d M Y H:i:s O', bp_get_activity_feed_item_date(), false); ?></pubDate>
 
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 1a9d37f961164e15bf5e7b26b97374924b3290e6..02e41ab091907a086648afed669ec532d35a2c9e 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
@@ -1,9 +1,15 @@
 <?php
+
 /**
  * RSS2 Feed Template for displaying a member's activity stream.
  *
  * @package BuddyPress
+ * @subpackage ActivityFeeds
  */
+
+// Exit if accessed directly
+if ( !defined( 'ABSPATH' ) ) exit;
+
 header('Content-Type: text/xml; charset=' . get_option('blog_charset'), true);
 header('Status: 200 OK');
 ?>
@@ -18,9 +24,9 @@ header('Status: 200 OK');
 >
 
 <channel>
-	<title><?php echo bp_site_name() ?> | <?php echo $bp->displayed_user->fullname; ?> | <?php _e( 'Activity', 'buddypress' ) ?></title>
+	<title><?php bp_site_name() ?> | <?php echo $bp->displayed_user->fullname; ?> | <?php _e( 'Activity', 'buddypress' ) ?></title>
 	<atom:link href="<?php self_link(); ?>" rel="self" type="application/rss+xml" />
-	<link><?php echo $bp->displayed_user->domain . $bp->activity->slug . '/feed' ?></link>
+	<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>
 	<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>
@@ -31,7 +37,7 @@ header('Status: 200 OK');
 		<?php while ( bp_activities() ) : bp_the_activity(); ?>
 			<item>
 				<guid><?php bp_activity_thread_permalink() ?></guid>
-				<title><![CDATA[<?php bp_activity_feed_item_title() ?>]]></title>
+				<title><?php bp_activity_feed_item_title() ?></title>
 				<link><?php echo bp_activity_thread_permalink() ?></link>
 				<pubDate><?php echo mysql2date('D, d M Y H:i:s O', bp_get_activity_feed_item_date(), false); ?></pubDate>
 
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 eae02b1b79dac411422d4960f04622c18336e5cb..5a3a0f6632670e3334405258c992ca967fd9d2d6 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
@@ -1,10 +1,15 @@
 <?php
+
 /**
  * RSS2 Feed Template for displaying the site wide activity stream.
  *
  * @package BuddyPress
+ * @subpackage ActivityFeeds
  */
 
+// Exit if accessed directly
+if ( !defined( 'ABSPATH' ) ) exit;
+
 header('Content-Type: text/xml; charset=' . get_option('blog_charset'), true);
 header('Status: 200 OK');
 ?>
@@ -19,9 +24,9 @@ header('Status: 200 OK');
 >
 
 <channel>
-	<title><?php echo bp_site_name() ?> | <?php _e( 'Site Wide Activity', 'buddypress' ) ?></title>
+	<title><?php bp_site_name() ?> | <?php _e( 'Site Wide Activity', 'buddypress' ) ?></title>
 	<atom:link href="<?php self_link(); ?>" rel="self" type="application/rss+xml" />
-	<link><?php echo site_url() . '/' . $bp->activity->slug . '/feed' ?></link>
+	<link><?php echo bp_get_root_domain() . '/' . bp_get_activity_root_slug() . '/feed' ?></link>
 	<description><?php _e( 'Site Wide Activity Feed', 'buddypress' ) ?></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>
@@ -32,7 +37,7 @@ header('Status: 200 OK');
 		<?php while ( bp_activities() ) : bp_the_activity(); ?>
 			<item>
 				<guid><?php bp_activity_thread_permalink() ?></guid>
-				<title><![CDATA[<?php bp_activity_feed_item_title() ?>]]></title>
+				<title><?php bp_activity_feed_item_title() ?></title>
 				<link><?php bp_activity_thread_permalink() ?></link>
 				<pubDate><?php echo mysql2date('D, d M Y H:i:s O', bp_get_activity_feed_item_date(), false); ?></pubDate>
 
diff --git a/wp-content/plugins/buddypress/bp-blogs/bp-blogs-actions.php b/wp-content/plugins/buddypress/bp-blogs/bp-blogs-actions.php
new file mode 100644
index 0000000000000000000000000000000000000000..dd248b445c881aba582ba51988c70e05850feb78
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-blogs/bp-blogs-actions.php
@@ -0,0 +1,16 @@
+<?php
+// Exit if accessed directly
+if ( !defined( 'ABSPATH' ) ) exit;
+
+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 );
+
+		bp_core_redirect( get_site_url( $blog['blogs'][0]->blog_id ) );
+	}
+}
+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
new file mode 100644
index 0000000000000000000000000000000000000000..ec5f48417458b9e94fbed5924c09408af5320018
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-blogs/bp-blogs-activity.php
@@ -0,0 +1,94 @@
+<?php
+/******************************************************************************
+ * These functions handle the recording, deleting and formatting of activity and
+ * notifications for the user and for this specific component.
+ */
+
+// Exit if accessed directly
+if ( !defined( 'ABSPATH' ) ) exit;
+
+
+function bp_blogs_register_activity_actions() {
+	global $bp;
+
+	if ( !bp_is_active( 'activity' ) )
+		return false;
+
+	bp_activity_set_action( $bp->blogs->id, 'new_blog',         __( 'New site created',        'buddypress' ) );
+	bp_activity_set_action( $bp->blogs->id, 'new_blog_post',    __( 'New post published',      'buddypress' ) );
+	bp_activity_set_action( $bp->blogs->id, 'new_blog_comment', __( 'New post comment posted', 'buddypress' ) );
+
+	do_action( 'bp_blogs_register_activity_actions' );
+}
+add_action( 'bp_register_activity_actions', 'bp_blogs_register_activity_actions' );
+
+function bp_blogs_record_activity( $args = '' ) {
+	global $bp;
+
+	if ( !bp_is_active( 'activity' ) )
+		return false;
+
+	$defaults = array(
+		'user_id'           => $bp->loggedin_user->id,
+		'action'            => '',
+		'content'           => '',
+		'primary_link'      => '',
+		'component'         => $bp->blogs->id,
+		'type'              => false,
+		'item_id'           => false,
+		'secondary_item_id' => false,
+		'recorded_time'     => bp_core_current_time(),
+		'hide_sitewide'     => false
+	);
+
+	$r = wp_parse_args( $args, $defaults );
+	extract( $r, EXTR_SKIP );
+
+	// Remove large images and replace them with just one image thumbnail
+ 	if ( bp_is_active( 'activity' ) && !empty( $content ) )
+		$content = bp_activity_thumbnail_content_images( $content, $primary_link );
+
+	if ( !empty( $action ) )
+		$action = apply_filters( 'bp_blogs_record_activity_action', $action );
+
+	if ( !empty( $content ) )
+		$content = apply_filters( 'bp_blogs_record_activity_content', bp_create_excerpt( $content ), $content );
+
+	// Check for an existing entry and update if one exists.
+	$id = bp_activity_get_activity_id( array(
+		'user_id'           => $user_id,
+		'component'         => $component,
+		'type'              => $type,
+		'item_id'           => $item_id,
+		'secondary_item_id' => $secondary_item_id
+	) );
+
+	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 ) );
+}
+
+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
+		) );
+	}
+}
+
+?>
\ 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
new file mode 100644
index 0000000000000000000000000000000000000000..06384fdec531a956909b2a6d0f173ce30fa87cf5
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-blogs/bp-blogs-buddybar.php
@@ -0,0 +1,63 @@
+<?php
+// Exit if accessed directly
+if ( !defined( 'ABSPATH' ) ) exit;
+
+// *** "My Blogs" Menu ********
+function bp_adminbar_blogs_menu() {
+	global $bp;
+
+	if ( !is_user_logged_in() || !bp_is_active( 'blogs' ) )
+		return false;
+
+	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' );
+	}
+
+	$counter = 0;
+	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() ) . '">';
+
+		_e( 'My Sites', 'buddypress' );
+
+		echo '</a>';
+		echo '<ul>';
+
+		foreach ( (array)$blogs['blogs'] as $blog ) {
+			$alt      = ( 0 == $counter % 2 ) ? ' class="alt"' : '';
+			$site_url = esc_attr( $blog->siteurl );
+
+			echo '<li' . $alt . '>';
+			echo '<a href="' . $site_url . '">' . esc_html( $blog->name ) . '</a>';
+			echo '<ul>';
+			echo '<li class="alt"><a href="' . $site_url . 'wp-admin/">' . __( 'Dashboard', 'buddypress' ) . '</a></li>';
+			echo '<li><a href="' . $site_url . 'wp-admin/post-new.php">' . __( 'New Post', 'buddypress' ) . '</a></li>';
+			echo '<li class="alt"><a href="' . $site_url . 'wp-admin/edit.php">' . __( 'Manage Posts', 'buddypress' ) . '</a></li>';
+			echo '<li><a href="' . $site_url . 'wp-admin/edit-comments.php">' . __( 'Manage Comments', 'buddypress' ) . '</a></li>';
+			echo '</ul>';
+
+			do_action( 'bp_adminbar_blog_items', $blog );
+
+			echo '</li>';
+			$counter++;
+		}
+
+		$alt = ( 0 == $counter % 2 ) ? ' class="alt"' : '';
+
+		if ( bp_blog_signup_enabled() ) {
+			echo '<li' . $alt . '>';
+			echo '<a href="' . bp_get_root_domain() . '/' . bp_get_blogs_root_slug() . '/create/">' . __( 'Create a Site!', 'buddypress' ) . '</a>';
+			echo '</li>';
+		}
+
+		echo '</ul>';
+		echo '</li>';
+	}
+}
+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
new file mode 100644
index 0000000000000000000000000000000000000000..24f69ff89c28f1df411d97a68f8c19d59b138d4c
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-blogs/bp-blogs-cache.php
@@ -0,0 +1,37 @@
+<?php
+/*******************************************************************************
+ * Caching
+ *
+ * Caching functions handle the clearing of cached objects and pages on specific
+ * actions throughout BuddyPress.
+ */
+
+// Exit if accessed directly
+if ( !defined( 'ABSPATH' ) ) exit;
+
+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_total_blogs_for_user_' . $user_id, 'bp' );
+}
+
+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' );
+}
+
+// List actions to clear object caches on
+add_action( 'bp_blogs_remove_blog_for_user', 'bp_blogs_clear_blog_object_cache', 10, 2 );
+add_action( 'bp_blogs_new_blog',             'bp_blogs_format_clear_blog_cache', 10, 2 );
+
+// List actions to clear super cached pages on, if super cache is installed
+add_action( 'bp_blogs_remove_data_for_blog', 'bp_core_clear_cache' );
+add_action( 'bp_blogs_remove_comment',       'bp_core_clear_cache' );
+add_action( 'bp_blogs_remove_post',          'bp_core_clear_cache' );
+add_action( 'bp_blogs_remove_blog_for_user', 'bp_core_clear_cache' );
+add_action( 'bp_blogs_remove_blog',          'bp_core_clear_cache' );
+add_action( 'bp_blogs_new_blog_comment',     'bp_core_clear_cache' );
+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 dd6a86343b28040d0b0112406c350ebd73d29c60..73b5640e8517d1aae8a45edcff8babd687ea25ce 100644
--- a/wp-content/plugins/buddypress/bp-blogs/bp-blogs-classes.php
+++ b/wp-content/plugins/buddypress/bp-blogs/bp-blogs-classes.php
@@ -1,4 +1,6 @@
 <?php
+// Exit if accessed directly
+if ( !defined( 'ABSPATH' ) ) exit;
 
 Class BP_Blogs_Blog {
 	var $id;
@@ -6,10 +8,13 @@ Class BP_Blogs_Blog {
 	var $blog_id;
 
 	function bp_blogs_blog( $id = null ) {
+		$this->__construct( $id );
+	}
+
+	function __construct( $id = null ) {
 		global $bp, $wpdb;
 
-		if ( !$user_id )
-			$user_id = $bp->displayed_user->id;
+		$user_id = bp_displayed_user_id();
 
 		if ( $id ) {
 			$this->id = $id;
@@ -32,7 +37,7 @@ Class BP_Blogs_Blog {
 		$this->user_id = apply_filters( 'bp_blogs_blog_user_id_before_save', $this->user_id, $this->id );
 		$this->blog_id = apply_filters( 'bp_blogs_blog_id_before_save', $this->blog_id, $this->id );
 
-		do_action( 'bp_blogs_blog_before_save', $this );
+		do_action_ref_array( 'bp_blogs_blog_before_save', array( &$this ) );
 
 		// Don't try and save if there is no user ID or blog ID set.
 		if ( !$this->user_id || !$this->blog_id )
@@ -53,7 +58,7 @@ Class BP_Blogs_Blog {
 		if ( !$wpdb->query($sql) )
 			return false;
 
-		do_action( 'bp_blogs_blog_after_save', $this );
+		do_action_ref_array( 'bp_blogs_blog_after_save', array( &$this ) );
 
 		if ( $this->id )
 			return $this->id;
@@ -69,20 +74,17 @@ Class BP_Blogs_Blog {
 
 	/* Static Functions */
 
-	function get( $type, $limit = false, $page = false, $user_id = false, $search_terms = false ) {
+	function get( $type, $limit = false, $page = false, $user_id = 0, $search_terms = false ) {
 		global $bp, $wpdb;
 
-		if ( !$bp->blogs )
-			bp_blogs_setup_globals();
-
 		if ( !is_user_logged_in() || ( !is_super_admin() && ( $user_id != $bp->loggedin_user->id ) ) )
 			$hidden_sql = "AND wb.public = 1";
+		else
+			$hidden_sql = '';
 
-		if ( $limit && $page )
-			$pag_sql = $wpdb->prepare( " LIMIT %d, %d", intval( ( $page - 1 ) * $limit), intval( $limit ) );
+		$pag_sql = ( $limit && $page ) ? $wpdb->prepare( " LIMIT %d, %d", intval( ( $page - 1 ) * $limit), intval( $limit ) ) : '';
 
-		if ( $user_id )
-			$user_sql = $wpdb->prepare( " AND b.user_id = %d", $user_id );
+		$user_sql = !empty( $user_id ) ? $wpdb->prepare( " AND b.user_id = %d", $user_id ) : '';
 
 		switch ( $type ) {
 			case 'active': default:
@@ -108,9 +110,13 @@ Class BP_Blogs_Blog {
 			$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}" ) );
 		}
 
-		foreach ( (array)$paged_blogs as $blog ) $blog_ids[] = $blog->blog_id;
+		$blog_ids = array();
+		foreach ( (array)$paged_blogs as $blog ) {
+			$blog_ids[] = $blog->blog_id;
+		}
+
 		$blog_ids = $wpdb->escape( join( ',', (array)$blog_ids ) );
-		$paged_blogs = BP_Blogs_Blog::get_blog_extras( &$paged_blogs, $blog_ids, $type );
+		$paged_blogs = BP_Blogs_Blog::get_blog_extras( $paged_blogs, $blog_ids, $type );
 
 		return array( 'blogs' => $paged_blogs, 'total' => $total_blogs );
 	}
@@ -118,20 +124,13 @@ Class BP_Blogs_Blog {
 	function delete_blog_for_all( $blog_id ) {
 		global $wpdb, $bp;
 
-		if ( !$bp->blogs )
-			bp_blogs_setup_globals();
-
 		bp_blogs_delete_blogmeta( $blog_id );
-
 		return $wpdb->query( $wpdb->prepare( "DELETE FROM {$bp->blogs->table_name} WHERE blog_id = %d", $blog_id ) );
 	}
 
 	function delete_blog_for_user( $blog_id, $user_id = null ) {
 		global $wpdb, $bp;
 
-		if ( !$bp->blogs )
-			bp_blogs_setup_globals();
-
 		if ( !$user_id )
 			$user_id = $bp->loggedin_user->id;
 
@@ -141,21 +140,15 @@ Class BP_Blogs_Blog {
 	function delete_blogs_for_user( $user_id = null ) {
 		global $wpdb, $bp;
 
-		if ( !$bp->blogs )
-			bp_blogs_setup_globals();
-
 		if ( !$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 ) );
 	}
 
-	function get_blogs_for_user( $user_id = false, $show_hidden = false ) {
+	function get_blogs_for_user( $user_id = 0, $show_hidden = false ) {
 		global $bp, $wpdb;
 
-		if ( !$bp->blogs )
-			bp_blogs_setup_globals();
-
 		if ( !$user_id )
 			$user_id = $bp->displayed_user->id;
 
@@ -167,6 +160,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 ) {
 			$user_blogs[$blog->blog_id] = new stdClass;
 			$user_blogs[$blog->blog_id]->id = $blog->id;
@@ -178,12 +172,9 @@ Class BP_Blogs_Blog {
 		return array( 'blogs' => $user_blogs, 'count' => $total_blog_count );
 	}
 
-	function get_blog_ids_for_user( $user_id = false ) {
+	function get_blog_ids_for_user( $user_id = 0 ) {
 		global $bp, $wpdb;
 
-		if ( !$bp->blogs )
-			bp_blogs_setup_globals();
-
 		if ( !$user_id )
 			$user_id = $bp->displayed_user->id;
 
@@ -193,18 +184,12 @@ Class BP_Blogs_Blog {
 	function is_recorded( $blog_id ) {
 		global $bp, $wpdb;
 
-		if ( !$bp->blogs )
-			bp_blogs_setup_globals();
-
 		return $wpdb->get_var( $wpdb->prepare( "SELECT id FROM {$bp->blogs->table_name} WHERE blog_id = %d", $blog_id ) );
 	}
 
 	function total_blog_count_for_user( $user_id = null ) {
 		global $bp, $wpdb;
 
-		if ( !$bp->blogs )
-			bp_blogs_setup_globals();
-
 		if ( !$user_id )
 			$user_id = $bp->displayed_user->id;
 
@@ -218,9 +203,6 @@ Class BP_Blogs_Blog {
 	function search_blogs( $filter, $limit = null, $page = null ) {
 		global $wpdb, $bp;
 
-		if ( !$bp->blogs )
-			bp_blogs_setup_globals();
-
 		$filter = like_escape( $wpdb->escape( $filter ) );
 
 		if ( !is_super_admin() )
@@ -238,14 +220,8 @@ Class BP_Blogs_Blog {
 	function get_all( $limit = null, $page = null ) {
 		global $bp, $wpdb;
 
-		if ( !$bp->blogs )
-			bp_blogs_setup_globals();
-
-		if ( !is_super_admin() )
-			$hidden_sql = "AND wb.public = 1";
-
-		if ( $limit && $page )
-			$pag_sql = $wpdb->prepare( " LIMIT %d, %d", intval( ( $page - 1 ) * $limit), intval( $limit ) );
+		$hidden_sql = !is_super_admin() ? "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}" ) );
@@ -256,9 +232,6 @@ Class BP_Blogs_Blog {
 	function get_by_letter( $letter, $limit = null, $page = null ) {
 		global $bp, $wpdb;
 
-		if ( !$bp->blogs )
-			bp_blogs_setup_globals();
-
 		$letter = like_escape( $wpdb->escape( $letter ) );
 
 		if ( !is_super_admin() )
@@ -273,13 +246,13 @@ Class BP_Blogs_Blog {
 		return array( 'blogs' => $paged_blogs, 'total' => $total_blogs );
 	}
 
-	function get_blog_extras( $paged_blogs, $blog_ids, $type = false ) {
+	function get_blog_extras( &$paged_blogs, &$blog_ids, $type = false ) {
 		global $bp, $wpdb;
 
 		if ( empty( $blog_ids ) )
 			return $paged_blogs;
 
-		for ( $i = 0; $i < count( $paged_blogs ); $i++ ) {
+		for ( $i = 0, $count = count( $paged_blogs ); $i < $count; ++$i ) {
 			$blog_prefix = $wpdb->get_blog_prefix( $paged_blogs[$i]->blog_id );
 			$paged_blogs[$i]->latest_post = $wpdb->get_row( "SELECT post_title, guid FROM {$blog_prefix}posts WHERE post_status = 'publish' AND post_type = 'post' AND id != 1 ORDER BY id DESC LIMIT 1" );
 		}
@@ -287,7 +260,7 @@ 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} )" ) );
 
-		for ( $i = 0; $i < count( $paged_blogs ); $i++ ) {
+		for ( $i = 0, $count = count( $paged_blogs ); $i < $count; ++$i ) {
 			foreach ( (array)$blog_descs as $desc ) {
 				if ( $desc->blog_id == $paged_blogs[$i]->blog_id )
 					$paged_blogs[$i]->description = $desc->description;
@@ -300,14 +273,10 @@ Class BP_Blogs_Blog {
 	function is_hidden( $blog_id ) {
 		global $wpdb;
 
-		if ( !$bp->blogs )
-			bp_blogs_setup_globals();
-
 		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-functions.php b/wp-content/plugins/buddypress/bp-blogs/bp-blogs-functions.php
new file mode 100644
index 0000000000000000000000000000000000000000..6606631efc210f92aca67a87e383877e7e5ad040
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-blogs/bp-blogs-functions.php
@@ -0,0 +1,573 @@
+<?php
+// Exit if accessed directly
+if ( !defined( 'ABSPATH' ) ) exit;
+
+/**
+ * Checks $bp pages global and looks for directory page
+ *
+ * @since 1.5
+ *
+ * @global object $bp Global BuddyPress settings object
+ * @return bool True if set, False if empty
+ */
+function bp_blogs_has_directory() {
+	global $bp;
+
+	return (bool) !empty( $bp->pages->blogs->id );
+}
+
+function bp_blogs_get_blogs( $args = '' ) {
+	global $bp;
+
+	$defaults = array(
+		'type'         => 'active', // active, alphabetical, newest, or random
+		'user_id'      => false,    // Pass a user_id to limit to only blogs that this user has privilages higher than subscriber on
+		'search_terms' => false,    // Limit to blogs that match these search terms
+		'per_page'     => 20,       // The number of results to return per page
+		'page'         => 1,        // The page to return if limiting per page
+	);
+
+	$params = wp_parse_args( $args, $defaults );
+	extract( $params, EXTR_SKIP );
+
+	return apply_filters( 'bp_blogs_get_blogs', BP_Blogs_Blog::get( $type, $per_page, $page, $user_id, $search_terms ), $params );
+}
+
+/**
+ * Populates the BP blogs table with existing blogs.
+ *
+ * @package BuddyPress Blogs
+ *
+ * @global object $bp BuddyPress global settings
+ * @global object $wpdb WordPress database object
+ * @uses get_users()
+ * @uses bp_blogs_record_blog()
+ */
+function bp_blogs_record_existing_blogs() {
+	global $bp, $wpdb;
+
+	// Truncate user blogs table and re-record.
+	$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" ) );
+	else
+		$blog_ids = 1;
+
+	if ( $blog_ids ) {
+		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 ) {
+					// Don't record blogs for subscribers
+					if ( !in_array( $user, $subscribers ) )
+						bp_blogs_record_blog( $blog_id, $user->ID, true );
+				}
+			}
+		}
+	}
+}
+
+/**
+ * Makes BuddyPress aware of a new site so that it can track its activity.
+ *
+ * @global object $bp BuddyPress global settings
+ * @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;
+
+	$name = get_blog_option( $blog_id, 'blogname' );
+	$description = get_blog_option( $blog_id, 'blogdescription' );
+
+	if ( empty( $name ) )
+		return 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;
+
+	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 = !apply_filters( 'bp_is_new_blog_public', !$is_private );
+
+	// Only record this activity if the blog is public
+	if ( !$is_private && !$no_activity ) {
+		// Record this in activity streams
+		bp_blogs_record_activity( array(
+			'user_id'      => $recorded_blog->user_id,
+			'action'       => apply_filters( 'bp_blogs_activity_created_blog_action', sprintf( __( '%s created the site %s', 'buddypress'), bp_core_get_userlink( $recorded_blog->user_id ), '<a href="' . get_site_url( $recorded_blog->blog_id ) . '">' . esc_attr( $name ) . '</a>' ), $recorded_blog, $name, $description ),
+			'primary_link' => apply_filters( 'bp_blogs_activity_created_blog_primary_link', get_site_url( $recorded_blog->blog_id ), $recorded_blog->blog_id ),
+			'type'         => 'new_blog',
+			'item_id'      => $recorded_blog->blog_id
+		) );
+	}
+
+	do_action_ref_array( 'bp_blogs_new_blog', array( &$recorded_blog, $is_private, $is_recorded ) );
+}
+add_action( 'wpmu_new_blog', 'bp_blogs_record_blog', 10, 2 );
+
+/**
+ * Updates blogname in BuddyPress blogmeta table
+ *
+ * @global object $wpdb DB Layer
+ * @param string $oldvalue Value before save (not used)
+ * @param string $newvalue Value to change meta to
+ */
+function bp_blogs_update_option_blogname( $oldvalue, $newvalue ) {
+	global $wpdb;
+
+	bp_blogs_update_blogmeta( $wpdb->blogid, 'name', $newvalue );
+}
+add_action( 'update_option_blogname', 'bp_blogs_update_option_blogname', 10, 2 );
+
+/**
+ * Updates blogdescription in BuddyPress blogmeta table
+ *
+ * @global object $wpdb DB Layer
+ * @param string $oldvalue Value before save (not used)
+ * @param string $newvalue Value to change meta to
+ */
+function bp_blogs_update_option_blogdescription( $oldvalue, $newvalue ) {
+	global $wpdb;
+
+	bp_blogs_update_blogmeta( $wpdb->blogid, 'description', $newvalue );
+}
+add_action( 'update_option_blogdescription', 'bp_blogs_update_option_blogdescription', 10, 2 );
+
+function bp_blogs_record_post( $post_id, $post, $user_id = 0 ) {
+	global $bp, $wpdb;
+
+	$post_id = (int)$post_id;
+	$blog_id = (int)$wpdb->blogid;
+
+	if ( !$user_id )
+		$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.
+	if ( !empty( $bp->site_options['sitewide_tags_blog'] ) ) {
+		$st_options = maybe_unserialize( $bp->site_options['sitewide_tags_blog'] );
+		$tags_blog_id = isset( $st_options['tags_blog_id'] ) ? $st_options['tags_blog_id'] : 0;
+	} else {
+		$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 ) )
+		return false;
+
+	// Don't record this if it's not a post
+	if ( !in_array( $post->post_type, apply_filters( 'bp_blogs_record_post_post_types', array( 'post' ) ) ) )
+		return false;
+
+	$is_blog_public = apply_filters( 'bp_is_blog_public', (int)get_blog_option( $blog_id, 'blog_public' ) );
+
+	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>' );
+			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_content = $post->post_content;
+
+			bp_blogs_record_activity( array(
+				'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               ),
+				'type'              => 'new_blog_post',
+				'item_id'           => $blog_id,
+				'secondary_item_id' => $post_id,
+				'recorded_time'     => $post->post_modified_gmt
+			));
+		}
+
+		// Update the blogs last activity
+		bp_blogs_update_blogmeta( $blog_id, 'last_activity', bp_core_current_time() );
+	} else {
+		bp_blogs_remove_post( $post_id, $blog_id, $user_id );
+	}
+
+	do_action( 'bp_blogs_new_blog_post', $post_id, $post, $user_id );
+}
+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
+ * @return mixed
+ */
+function bp_blogs_record_comment( $comment_id, $is_approved = true ) {
+	global $bp;
+
+	// Get the users comment
+	$recorded_comment = get_comment( $comment_id );
+
+	// Don't record activity if the comment hasn't been approved
+	if ( empty( $is_approved ) )
+		return false;
+
+	// Don't record activity if no email address has been included
+	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;
+
+	// If there's no registered user id, don't record activity
+	if ( empty( $user_id ) )
+		return false;
+
+	// Get blog and post data
+	$blog_id                = get_current_blog_id();
+	$recorded_comment->post = get_post( $recorded_comment->comment_post_ID );
+
+	if ( empty( $recorded_comment->post ) || is_wp_error( $recorded_comment->post ) )
+		return false;
+
+	// If this is a password protected post, don't record the comment
+	if ( !empty( $recorded_comment->post->post_password ) )
+		return false;
+
+	// Don't record activity if the comment's associated post isn't a WordPress Post
+	if ( !in_array( $recorded_comment->post->post_type, apply_filters( 'bp_blogs_record_comment_post_types', array( 'post' ) ) ) )
+		return false;
+
+	$is_blog_public = apply_filters( 'bp_is_blog_public', (int)get_blog_option( $blog_id, 'blog_public' ) );
+
+	// If blog is public allow activity to be posted
+	if ( $is_blog_public ) {
+
+		// Get activity related links
+		$post_permalink = get_permalink( $recorded_comment->comment_post_ID );
+		$comment_link   = htmlspecialchars( get_comment_link( $recorded_comment->comment_ID ) );
+
+		// Prepare to record in activity streams
+		if ( is_multisite() )
+			$activity_action = sprintf( __( '%1$s commented on the post, %2$s, on the site %3$s', 'buddypress' ), bp_core_get_userlink( $user_id ), '<a href="' . $post_permalink . '">' . apply_filters( 'the_title', $recorded_comment->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 commented on the post, %2$s', 'buddypress' ), bp_core_get_userlink( $user_id ), '<a href="' . $post_permalink . '">' . apply_filters( 'the_title', $recorded_comment->post->post_title ) . '</a>' );
+
+		$activity_content	= $recorded_comment->comment_content;
+
+		// Record in activity streams
+		bp_blogs_record_activity( array(
+			'user_id'           => $user_id,
+			'action'            => apply_filters_ref_array( 'bp_blogs_activity_new_comment_action',       array( $activity_action,  &$recorded_comment, $comment_link ) ),
+			'content'           => apply_filters_ref_array( 'bp_blogs_activity_new_comment_content',      array( $activity_content, &$recorded_comment, $comment_link ) ),
+			'primary_link'      => apply_filters_ref_array( 'bp_blogs_activity_new_comment_primary_link', array( $comment_link,     &$recorded_comment                ) ),
+			'type'              => 'new_blog_comment',
+			'item_id'           => $blog_id,
+			'secondary_item_id' => $comment_id,
+			'recorded_time'     => $recorded_comment->comment_date_gmt
+		) );
+
+		// Update the blogs last active date
+		bp_blogs_update_blogmeta( $blog_id, 'last_activity', bp_core_current_time() );
+	}
+
+	return $recorded_comment;
+}
+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;
+	
+	if ( empty( $blog_id ) ) {
+		$blog_id = isset( $wpdb->blogid ) ? $wpdb->blogid : bp_get_root_blog_id();
+	}
+
+	if ( empty( $role ) ) {
+		$key = $wpdb->get_blog_prefix( $blog_id ). 'capabilities';
+
+		$roles = get_user_meta( $user_id, $key, true );
+
+		if ( is_array( $roles ) )
+			$role = array_search( 1, $roles );
+		else
+			return false;
+	}
+
+	if ( $role != 'subscriber' )
+		bp_blogs_record_blog( $blog_id, $user_id, true );
+}
+add_action( 'add_user_to_blog', 'bp_blogs_add_user_to_blog', 10, 3 );
+add_action( 'profile_update',   'bp_blogs_add_user_to_blog'        );
+add_action( 'user_register',    'bp_blogs_add_user_to_blog'        );
+
+function bp_blogs_remove_user_from_blog( $user_id, $blog_id = 0 ) {
+	global $wpdb;
+
+	if ( empty( $blog_id ) )
+		$blog_id = $wpdb->blogid;
+
+	bp_blogs_remove_blog_for_user( $user_id, $blog_id );
+}
+add_action( 'remove_user_from_blog', 'bp_blogs_remove_user_from_blog', 10, 2 );
+
+function bp_blogs_remove_blog( $blog_id ) {
+	global $bp;
+
+	$blog_id = (int)$blog_id;
+	do_action( 'bp_blogs_before_remove_blog', $blog_id );
+
+	BP_Blogs_Blog::delete_blog_for_all( $blog_id );
+
+	// Delete activity stream item
+	bp_blogs_delete_activity( array( 'item_id' => $blog_id, 'component' => $bp->blogs->id, 'type' => 'new_blog' ) );
+
+	do_action( '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;
+
+	$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' ) );
+
+	do_action( 'bp_blogs_remove_blog_for_user', $blog_id, $user_id );
+}
+add_action( 'remove_user_from_blog', 'bp_blogs_remove_blog_for_user', 10, 2 );
+
+function bp_blogs_remove_post( $post_id, $blog_id = 0, $user_id = 0 ) {
+	global $wpdb, $bp;
+
+	if ( empty( $wpdb->blogid ) )
+		return false;
+
+	$post_id = (int)$post_id;
+
+	if ( !$blog_id )
+		$blog_id = (int)$wpdb->blogid;
+
+	if ( !$user_id )
+		$user_id = $bp->loggedin_user->id;
+
+	do_action( 'bp_blogs_before_remove_post', $blog_id, $post_id, $user_id );
+
+	// Delete activity stream item
+	bp_blogs_delete_activity( array( 'item_id' => $blog_id, 'secondary_item_id' => $post_id, 'component' => $bp->blogs->id, 'type' => 'new_blog_post' ) );
+
+	do_action( 'bp_blogs_remove_post', $blog_id, $post_id, $user_id );
+}
+add_action( 'delete_post', 'bp_blogs_remove_post' );
+
+function bp_blogs_remove_comment( $comment_id ) {
+	global $wpdb, $bp;
+
+	// 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 );
+}
+add_action( 'delete_comment', 'bp_blogs_remove_comment' );
+
+function bp_blogs_total_blogs() {
+	if ( !$count = wp_cache_get( 'bp_total_blogs', 'bp' ) ) {
+		$blogs = BP_Blogs_Blog::get_all();
+		$count = $blogs['total'];
+		wp_cache_set( 'bp_total_blogs', $count, 'bp' );
+	}
+	return $count;
+}
+
+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 ( !$count = wp_cache_get( 'bp_total_blogs_for_user_' . $user_id, 'bp' ) ) {
+		$count = BP_Blogs_Blog::total_blog_count_for_user( $user_id );
+		wp_cache_set( 'bp_total_blogs_for_user_' . $user_id, $count, 'bp' );
+	}
+
+	return $count;
+}
+
+function bp_blogs_remove_data_for_blog( $blog_id ) {
+	global $bp;
+
+	do_action( 'bp_blogs_before_remove_data_for_blog', $blog_id );
+
+	// If this is regular blog, delete all data for that blog.
+	BP_Blogs_Blog::delete_blog_for_all( $blog_id );
+
+	// Delete activity stream item
+	bp_blogs_delete_activity( array( 'item_id' => $blog_id, 'component' => $bp->blogs->id, 'type' => false ) );
+
+	do_action( 'bp_blogs_remove_data_for_blog', $blog_id );
+}
+add_action( 'delete_blog', 'bp_blogs_remove_data_for_blog', 1 );
+
+function bp_blogs_get_blogs_for_user( $user_id, $show_hidden = false ) {
+	return BP_Blogs_Blog::get_blogs_for_user( $user_id, $show_hidden );
+}
+
+function bp_blogs_get_all_blogs( $limit = null, $page = null ) {
+	return BP_Blogs_Blog::get_all( $limit, $page );
+}
+
+function bp_blogs_get_random_blogs( $limit = null, $page = null ) {
+	return BP_Blogs_Blog::get( 'random', $limit, $page );
+}
+
+function bp_blogs_is_blog_hidden( $blog_id ) {
+	return BP_Blogs_Blog::is_hidden( $blog_id );
+}
+
+/*******************************************************************************
+ * Blog meta functions
+ *
+ * These functions are used to store specific blogmeta in one global table,
+ * rather than in each blog's options table. Significantly speeds up global blog
+ * queries. By default each blog's name, description and last updated time are
+ * stored and synced here.
+ */
+
+function bp_blogs_delete_blogmeta( $blog_id, $meta_key = false, $meta_value = false ) {
+	global $wpdb, $bp;
+
+	if ( !is_numeric( $blog_id ) )
+		return false;
+
+	$meta_key = preg_replace('|[^a-z0-9_]|i', '', $meta_key);
+
+	if ( is_array($meta_value) || is_object($meta_value) )
+		$meta_value = serialize($meta_value);
+
+	$meta_value = trim( $meta_value );
+
+	if ( !$meta_key )
+		$wpdb->query( $wpdb->prepare( "DELETE FROM {$bp->blogs->table_name_blogmeta} WHERE blog_id = %d", $blog_id ) );
+	else if ( $meta_value )
+		$wpdb->query( $wpdb->prepare( "DELETE FROM {$bp->blogs->table_name_blogmeta} WHERE blog_id = %d AND meta_key = %s AND meta_value = %s", $blog_id, $meta_key, $meta_value ) );
+	else
+		$wpdb->query( $wpdb->prepare( "DELETE FROM {$bp->blogs->table_name_blogmeta} WHERE blog_id = %d AND meta_key = %s", $blog_id, $meta_key ) );
+
+	wp_cache_delete( 'bp_blogs_blogmeta_' . $blog_id . '_' . $meta_key, 'bp' );
+
+	return true;
+}
+
+function bp_blogs_get_blogmeta( $blog_id, $meta_key = '') {
+	global $wpdb, $bp;
+
+	$blog_id = (int) $blog_id;
+
+	if ( !$blog_id )
+		return false;
+
+	if ( !empty($meta_key) ) {
+		$meta_key = preg_replace('|[^a-z0-9_]|i', '', $meta_key);
+
+		if ( !$metas = wp_cache_get( 'bp_blogs_blogmeta_' . $blog_id . '_' . $meta_key, 'bp' ) ) {
+			$metas = $wpdb->get_col( $wpdb->prepare( "SELECT meta_value FROM {$bp->blogs->table_name_blogmeta} WHERE blog_id = %d AND meta_key = %s", $blog_id, $meta_key ) );
+			wp_cache_set( 'bp_blogs_blogmeta_' . $blog_id . '_' . $meta_key, $metas, 'bp' );
+		}
+	} else {
+		$metas = $wpdb->get_col( $wpdb->prepare("SELECT meta_value FROM {$bp->blogs->table_name_blogmeta} WHERE blog_id = %d", $blog_id) );
+	}
+
+	if ( empty($metas) ) {
+		if ( empty($meta_key) )
+			return array();
+		else
+			return '';
+	}
+
+	$metas = array_map('maybe_unserialize', (array)$metas);
+
+	if ( 1 == count($metas) )
+		return $metas[0];
+	else
+		return $metas;
+}
+
+function bp_blogs_update_blogmeta( $blog_id, $meta_key, $meta_value ) {
+	global $wpdb, $bp;
+
+	if ( !is_numeric( $blog_id ) )
+		return false;
+
+	$meta_key = preg_replace( '|[^a-z0-9_]|i', '', $meta_key );
+
+	if ( is_string($meta_value) )
+		$meta_value = stripslashes($wpdb->escape($meta_value));
+
+	$meta_value = maybe_serialize($meta_value);
+
+	if (empty( $meta_value ) )
+		return bp_blogs_delete_blogmeta( $blog_id, $meta_key );
+
+	$cur = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM {$bp->blogs->table_name_blogmeta} WHERE blog_id = %d AND meta_key = %s", $blog_id, $meta_key ) );
+
+	if ( !$cur )
+		$wpdb->query( $wpdb->prepare( "INSERT INTO {$bp->blogs->table_name_blogmeta} ( blog_id, meta_key, meta_value ) VALUES ( %d, %s, %s )", $blog_id, $meta_key, $meta_value ) );
+	else if ( $cur->meta_value != $meta_value )
+		$wpdb->query( $wpdb->prepare( "UPDATE {$bp->blogs->table_name_blogmeta} SET meta_value = %s WHERE blog_id = %d AND meta_key = %s", $meta_value, $blog_id, $meta_key ) );
+	else
+		return false;
+
+	wp_cache_set( 'bp_blogs_blogmeta_' . $blog_id . '_' . $meta_key, $meta_value, 'bp' );
+
+	return true;
+}
+
+function bp_blogs_remove_data( $user_id ) {
+	if ( !is_multisite() )
+		return false;
+
+	do_action( 'bp_blogs_before_remove_data', $user_id );
+
+	// If this is regular blog, delete all data for that blog.
+	BP_Blogs_Blog::delete_blogs_for_user( $user_id );
+
+	do_action( '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
new file mode 100644
index 0000000000000000000000000000000000000000..fc23a6675df3a8962f1f516d6644533b28148d7e
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-blogs/bp-blogs-loader.php
@@ -0,0 +1,197 @@
+<?php
+/**
+ * BuddyPress Blogs Streams Loader
+ *
+ * An blogs stream component, for users, groups, and blog tracking.
+ *
+ * @package BuddyPress
+ * @subpackage Blogs Core
+ */
+
+// Exit if accessed directly
+if ( !defined( 'ABSPATH' ) ) exit;
+
+class BP_Blogs_Component extends BP_Component {
+
+	/**
+	 * Start the blogs component creation process
+	 *
+	 * @since 1.5
+	 */
+	function __construct() {
+		parent::start(
+			'blogs',
+			__( 'Site Tracking', 'buddypress' ),
+			BP_PLUGIN_DIR
+		);
+	}
+
+	/**
+	 * Setup globals
+	 *
+	 * The BP_BLOGS_SLUG constant is deprecated, and only used here for
+	 * backwards compatibility.
+	 *
+	 * @since 1.5
+	 * @global obj $bp
+	 */
+	function setup_globals() {
+		global $bp;
+
+		if ( !defined( 'BP_BLOGS_SLUG' ) )
+			define ( 'BP_BLOGS_SLUG', $this->id );
+
+		// Global tables for messaging component
+		$global_tables = array(
+			'table_name'          => $bp->table_prefix . 'bp_user_blogs',
+			'table_name_blogmeta' => $bp->table_prefix . 'bp_user_blogs_blogmeta',
+		);
+
+		// 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
+			'notification_callback' => 'bp_blogs_format_notifications',
+			'search_string'         => __( 'Search sites...', 'buddypress' ),
+			'autocomplete_all'      => defined( 'BP_MESSAGES_AUTOCOMPLETE_ALL' ),
+			'global_tables'         => $global_tables,
+		);
+
+		// Setup the globals
+		parent::setup_globals( $globals );
+	}
+
+	/**
+	 * Include files
+	 */
+	function includes() {
+		// Files to include
+		$includes = array(
+			'cache',
+			'actions',
+			'screens',
+			'classes',
+			'template',
+			'activity',
+			'functions',
+			'buddybar'
+		);
+
+		if ( is_multisite() )
+			$includes[] = 'widgets';
+
+		// Include the files
+		parent::includes( $includes );
+	}
+
+	/**
+	 * Setup BuddyBar navigation
+	 *
+	 * @global obj $bp
+	 */
+	function setup_nav() {
+		global $bp;
+
+		/**
+		 * Blog/post/comment menus should not appear on single WordPress setups.
+		 * Although comments and posts made by users will still show on their
+		 * activity stream.
+		 */
+		if ( !is_multisite() )
+			return false;
+
+		// 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',
+			'item_css_id'         => $this->id
+		);
+
+		// Setup navigation
+		parent::setup_nav( $main_nav );
+	}
+
+	/**
+	 * Set up the admin bar
+	 *
+	 * @global obj $bp
+	 */
+	function setup_admin_bar() {
+		global $bp;
+
+		/**
+		 * Blog/post/comment menus should not appear on single WordPress setups.
+		 * Although comments and posts made by users will still show on their
+		 * activity stream.
+		 */
+		if ( !is_multisite() )
+			return false;
+
+		// Prevent debug notices
+		$wp_admin_nav = array();
+
+		// Menus for logged in user
+		if ( is_user_logged_in() ) {
+
+			$blogs_link = trailingslashit( $bp->loggedin_user->domain . $this->slug );
+
+			// Add the "Blogs" sub menu
+			$wp_admin_nav[] = array(
+				'parent' => $bp->my_account_menu_id,
+				'id'     => 'my-account-' . $this->id,
+				'title'  => __( 'Sites', 'buddypress' ),
+				'href'   => trailingslashit( $blogs_link )
+			);
+
+			// My Blogs
+			$wp_admin_nav[] = array(
+				'parent' => 'my-account-' . $this->id,
+				'id'     => 'my-account-' . $this->id . '-my-sites',
+				'title'  => __( 'My Sites', 'buddypress' ),
+				'href'   => trailingslashit( $blogs_link )
+			);
+
+		}
+
+		parent::setup_admin_bar( $wp_admin_nav );
+	}
+
+	/**
+	 * Sets up the title for pages and <title>
+	 *
+	 * @global obj $bp
+	 */
+	function setup_title() {
+		global $bp;
+
+		// Set up the component options navigation for Blog
+		if ( bp_is_blogs_component() ) {
+			if ( bp_is_my_profile() ) {
+				if ( bp_is_active( 'xprofile' ) ) {
+					$bp->bp_options_title = __( 'My Sites', 'buddypress' );
+				}
+
+			// If we are not viewing the logged in user, set up the current
+			// users avatar and name
+			} else {
+				$bp->bp_options_avatar = bp_core_fetch_avatar( array(
+					'item_id' => $bp->displayed_user->id,
+					'type'    => 'thumb'
+				) );
+				$bp->bp_options_title = $bp->displayed_user->fullname;
+			}
+		}
+
+		parent::setup_title();
+	}
+}
+// Create the blogs component
+$bp->blogs = new BP_Blogs_Component();
+
+?>
\ No newline at end of file
diff --git a/wp-content/plugins/buddypress/bp-blogs/bp-blogs-screens.php b/wp-content/plugins/buddypress/bp-blogs/bp-blogs-screens.php
new file mode 100644
index 0000000000000000000000000000000000000000..c7cedf2ccc5d3fabcbd93ea0f549a616c050666d
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-blogs/bp-blogs-screens.php
@@ -0,0 +1,38 @@
+<?php
+// Exit if accessed directly
+if ( !defined( 'ABSPATH' ) ) exit;
+
+function bp_blogs_screen_my_blogs() {
+	if ( !is_multisite() )
+		return false;
+
+	do_action( 'bp_blogs_screen_my_blogs' );
+
+	bp_core_load_template( apply_filters( 'bp_blogs_template_my_blogs', 'members/single/home' ) );
+}
+
+function bp_blogs_screen_create_a_blog() {
+	if ( !is_multisite() ||  !bp_is_blogs_component() || !bp_is_current_action( 'create' ) )
+		return false;
+
+	if ( !is_user_logged_in() || !bp_blog_signup_enabled() )
+		return false;
+
+	do_action( 'bp_blogs_screen_create_a_blog' );
+
+	bp_core_load_template( apply_filters( 'bp_blogs_template_create_a_blog', 'blogs/create' ) );
+}
+add_action( 'bp_screens', 'bp_blogs_screen_create_a_blog', 3 );
+
+function bp_blogs_screen_index() {
+	if ( is_multisite() && bp_is_blogs_component() && !bp_current_action() ) {
+		bp_update_is_directory( true, 'blogs' );
+
+		do_action( 'bp_blogs_screen_index' );
+
+		bp_core_load_template( apply_filters( 'bp_blogs_screen_index', 'blogs/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
new file mode 100644
index 0000000000000000000000000000000000000000..f916f68f3dcea8643613faf66aeec93fdea807ec
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-blogs/bp-blogs-template.php
@@ -0,0 +1,660 @@
+<?php
+// Exit if accessed directly
+if ( !defined( 'ABSPATH' ) ) exit;
+
+/**
+ * Output the blogs component slug
+ *
+ * @package BuddyPress
+ * @subpackage Blogs Template
+ * @since BuddyPress (r4100)
+ *
+ * @uses bp_get_blogs_slug()
+ */
+function bp_blogs_slug() {
+	echo bp_get_blogs_slug();
+}
+	/**
+	 * Return the blogs component slug
+	 *
+	 * @package BuddyPress
+	 * @subpackage Blogs Template
+	 * @since BuddyPress (r4100)
+	 */
+	function bp_get_blogs_slug() {
+		global $bp;
+		return apply_filters( 'bp_get_blogs_slug', $bp->blogs->slug );
+	}
+
+/**
+ * Output the blogs component root slug
+ *
+ * @package BuddyPress
+ * @subpackage Blogs Template
+ * @since BuddyPress (r4100)
+ *
+ * @uses bp_get_blogs_root_slug()
+ */
+function bp_blogs_root_slug() {
+	echo bp_get_blogs_root_slug();
+}
+	/**
+	 * Return the blogs component root slug
+	 *
+	 * @package BuddyPress
+	 * @subpackage Blogs Template
+	 * @since BuddyPress (r4100)
+	 */
+	function bp_get_blogs_root_slug() {
+		global $bp;
+		return apply_filters( 'bp_get_blogs_root_slug', $bp->blogs->root_slug );
+	}
+
+/**
+ * Output blog directory permalink
+ *
+ * @package BuddyPress
+ * @subpackage Blogs Template
+ * @since 1.5
+ * @uses bp_get_blogs_directory_permalink()
+ */
+function bp_blogs_directory_permalink() {
+	echo bp_get_blogs_directory_permalink();
+}
+	/**
+	 * Return blog directory permalink
+	 *
+	 * @package BuddyPress
+	 * @subpackage Blogs Template
+	 * @since 1.5
+	 * @uses apply_filters()
+	 * @uses traisingslashit()
+	 * @uses bp_get_root_domain()
+	 * @uses bp_get_blogs_root_slug()
+	 * @return string
+	 */
+	function bp_get_blogs_directory_permalink() {
+		return apply_filters( 'bp_get_blogs_directory_permalink', trailingslashit( bp_get_root_domain() . '/' . bp_get_blogs_root_slug() ) );
+	}
+
+/**********************************************************************
+ * Blog listing template class.
+ */
+
+class BP_Blogs_Template {
+	var $current_blog = -1;
+	var $blog_count;
+	var $blogs;
+	var $blog;
+
+	var $in_the_loop;
+
+	var $pag_page;
+	var $pag_num;
+	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 ) {
+		global $bp;
+
+		$this->pag_page = isset( $_REQUEST['bpage'] ) ? intval( $_REQUEST['bpage'] ) : $page;
+		$this->pag_num = isset( $_REQUEST['num'] ) ? intval( $_REQUEST['num'] ) : $per_page;
+
+		if ( isset( $_REQUEST['letter'] ) && '' != $_REQUEST['letter'] )
+			$this->blogs = BP_Blogs_Blog::get_by_letter( $_REQUEST['letter'], $this->pag_num, $this->pag_page );
+		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'];
+		else
+			$this->total_blog_count = (int)$max;
+
+		$this->blogs = $this->blogs['blogs'];
+
+		if ( $max ) {
+			if ( $max >= count($this->blogs) ) {
+				$this->blog_count = count( $this->blogs );
+			} else {
+				$this->blog_count = (int)$max;
+			}
+		} else {
+			$this->blog_count = count( $this->blogs );
+		}
+
+		if ( (int)$this->total_blog_count && (int)$this->pag_num ) {
+			$this->pag_links = paginate_links( array(
+				'base'      => add_query_arg( 'bpage', '%#%' ),
+				'format'    => '',
+				'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
+			) );
+		}
+	}
+
+	function has_blogs() {
+		if ( $this->blog_count )
+			return true;
+
+		return false;
+	}
+
+	function next_blog() {
+		$this->current_blog++;
+		$this->blog = $this->blogs[$this->current_blog];
+
+		return $this->blog;
+	}
+
+	function rewind_blogs() {
+		$this->current_blog = -1;
+		if ( $this->blog_count > 0 ) {
+			$this->blog = $this->blogs[0];
+		}
+	}
+
+	function blogs() {
+		if ( $this->current_blog + 1 < $this->blog_count ) {
+			return true;
+		} elseif ( $this->current_blog + 1 == $this->blog_count ) {
+			do_action('blog_loop_end');
+			// Do some cleaning up after the loop
+			$this->rewind_blogs();
+		}
+
+		$this->in_the_loop = false;
+		return false;
+	}
+
+	function the_blog() {
+		global $blog;
+
+		$this->in_the_loop = true;
+		$this->blog        = $this->next_blog();
+
+		if ( 0 == $this->current_blog ) // loop has just started
+			do_action('blog_loop_start');
+	}
+}
+
+function bp_rewind_blogs() {
+	global $blogs_template;
+
+	$blogs_template->rewind_blogs();
+}
+
+function bp_has_blogs( $args = '' ) {
+	global $bp, $blogs_template;
+
+	/***
+	 * Set the defaults based on the current page. Any of these will be overridden
+	 * if arguments are directly passed into the loop. Custom plugins should always
+	 * pass their parameters directly to the loop.
+	 */
+	$type         = 'active';
+	$user_id      = 0;
+	$search_terms = null;
+
+	/* User filtering */
+	if ( !empty( $bp->displayed_user->id ) )
+		$user_id = $bp->displayed_user->id;
+
+	$defaults = array(
+		'type'         => $type,
+		'page'         => 1,
+		'per_page'     => 20,
+		'max'          => false,
+
+		'user_id'      => $user_id, // Pass a user_id to limit to only blogs this user has higher than subscriber access to
+		'search_terms' => $search_terms // Pass search terms to filter on the blog title or description.
+	);
+
+	$r = wp_parse_args( $args, $defaults );
+	extract( $r );
+
+	if ( is_null( $search_terms ) ) {
+		if ( isset( $_REQUEST['s'] ) && !empty( $_REQUEST['s'] ) )
+			$search_terms = $_REQUEST['s'];
+		else
+			$search_terms = false;
+	}
+
+	if ( $max ) {
+		if ( $per_page > $max )
+			$per_page = $max;
+	}
+
+	$blogs_template = new BP_Blogs_Template( $type, $page, $per_page, $max, $user_id, $search_terms );
+	return apply_filters( 'bp_has_blogs', $blogs_template->has_blogs(), $blogs_template );
+}
+
+function bp_blogs() {
+	global $blogs_template;
+
+	return $blogs_template->blogs();
+}
+
+function bp_the_blog() {
+	global $blogs_template;
+
+	return $blogs_template->the_blog();
+}
+
+function bp_blogs_pagination_count() {
+	global $bp, $blogs_template;
+
+	$start_num = intval( ( $blogs_template->pag_page - 1 ) * $blogs_template->pag_num ) + 1;
+	$from_num  = bp_core_number_format( $start_num );
+	$to_num    = bp_core_number_format( ( $start_num + ( $blogs_template->pag_num - 1 ) > $blogs_template->total_blog_count ) ? $blogs_template->total_blog_count : $start_num + ( $blogs_template->pag_num - 1 ) );
+	$total     = bp_core_number_format( $blogs_template->total_blog_count );
+
+	echo sprintf( __( 'Viewing site %1$s to %2$s (of %3$s sites)', 'buddypress' ), $from_num, $to_num, $total );
+}
+
+function bp_blogs_pagination_links() {
+	echo bp_get_blogs_pagination_links();
+}
+	function bp_get_blogs_pagination_links() {
+		global $blogs_template;
+
+		return apply_filters( 'bp_get_blogs_pagination_links', $blogs_template->pag_links );
+	}
+
+function bp_blog_avatar( $args = '' ) {
+	echo bp_get_blog_avatar( $args );
+}
+	function bp_get_blog_avatar( $args = '' ) {
+		global $blogs_template, $bp;
+
+		$defaults = array(
+			'type'    => 'full',
+			'width'   => false,
+			'height'  => false,
+			'class'   => 'avatar',
+			'id'      => false,
+			'alt'     => __( 'Site authored by %s', 'buddypress' ),
+			'no_grav' => true
+		);
+
+		$r = wp_parse_args( $args, $defaults );
+		extract( $r, EXTR_SKIP );
+
+		/***
+		 * In future BuddyPress versions you will be able to set the avatar for a blog.
+		 * Right now you can use a filter with the ID of the blog to change it if you wish.
+		 * By default it will return the avatar for the primary blog admin.
+		 *
+		 * This filter is deprecated as of BuddyPress 1.5 and may be removed in a future version.
+		 * Use the 'bp_get_blog_avatar' filter instead.
+		 */
+		$avatar = apply_filters( 'bp_get_blog_avatar_' . $blogs_template->blog->blog_id, bp_core_fetch_avatar( array( 'item_id' => $blogs_template->blog->admin_user_id, 'type' => $type, 'alt' => $alt, 'width' => $width, 'height' => $height, 'class' => $class, 'email' => $blogs_template->blog->admin_user_email ) ) );
+
+		return apply_filters( 'bp_get_blog_avatar', $avatar, $blogs_template->blog->blog_id, array( 'item_id' => $blogs_template->blog->admin_user_id, 'type' => $type, 'alt' => $alt, 'width' => $width, 'height' => $height, 'class' => $class, 'email' => $blogs_template->blog->admin_user_email ) );
+	}
+
+function bp_blog_permalink() {
+	echo bp_get_blog_permalink();
+}
+	function bp_get_blog_permalink() {
+		global $blogs_template;
+
+		if ( empty( $blogs_template->blog->domain ) )
+			$permalink = bp_get_root_domain() . $blogs_template->blog->path;
+		else {
+			$protocol = 'http://';
+			if ( is_ssl() )
+				$protocol = 'https://';
+
+			$permalink = $protocol . $blogs_template->blog->domain . $blogs_template->blog->path;
+		}
+
+		return apply_filters( 'bp_get_blog_permalink', $permalink );
+	}
+
+function bp_blog_name() {
+	echo bp_get_blog_name();
+}
+	function bp_get_blog_name() {
+		global $blogs_template;
+
+		return apply_filters( 'bp_get_blog_name', $blogs_template->blog->name );
+	}
+
+function bp_blog_description() {
+	echo apply_filters( 'bp_blog_description', bp_get_blog_description() );
+}
+	function bp_get_blog_description() {
+		global $blogs_template;
+
+		return apply_filters( 'bp_get_blog_description', $blogs_template->blog->description );
+	}
+
+function bp_blog_last_active() {
+	echo bp_get_blog_last_active();
+}
+	function bp_get_blog_last_active() {
+		global $blogs_template;
+
+		return apply_filters( 'bp_blog_last_active', bp_core_get_last_activity( $blogs_template->blog->last_activity, __( 'active %s', 'buddypress' ) ) );
+	}
+
+function bp_blog_latest_post() {
+	echo bp_get_blog_latest_post();
+}
+	function bp_get_blog_latest_post() {
+		global $blogs_template;
+
+		if ( null == $blogs_template->blog->latest_post )
+			return false;
+
+		return apply_filters( 'bp_get_blog_latest_post', sprintf( __( 'Latest Post: %s', 'buddypress' ), '<a href="' . $blogs_template->blog->latest_post->guid . '">' . apply_filters( 'the_title', $blogs_template->blog->latest_post->post_title ) . '</a>' ) );
+	}
+
+function bp_blog_hidden_fields() {
+	if ( isset( $_REQUEST['s'] ) )
+		echo '<input type="hidden" id="search_terms" value="' . esc_attr( $_REQUEST['s'] ). '" name="search_terms" />';
+
+	if ( isset( $_REQUEST['letter'] ) )
+		echo '<input type="hidden" id="selected_letter" value="' . esc_attr( $_REQUEST['letter'] ) . '" name="selected_letter" />';
+
+	if ( isset( $_REQUEST['blogs_search'] ) )
+		echo '<input type="hidden" id="search_terms" value="' . esc_attr( $_REQUEST['blogs_search'] ) . '" name="search_terms" />';
+}
+
+function bp_total_blog_count() {
+	echo bp_get_total_blog_count();
+}
+	function bp_get_total_blog_count() {
+		return apply_filters( 'bp_get_total_blog_count', bp_blogs_total_blogs() );
+	}
+	add_filter( 'bp_get_total_blog_count', 'bp_core_number_format' );
+
+function bp_total_blog_count_for_user( $user_id = 0 ) {
+	echo bp_get_total_blog_count_for_user( $user_id );
+}
+	function bp_get_total_blog_count_for_user( $user_id = 0 ) {
+		return apply_filters( 'bp_get_total_blog_count_for_user', bp_blogs_total_blogs_for_user( $user_id ) );
+	}
+	add_filter( 'bp_get_total_blog_count_for_user', 'bp_core_number_format' );
+
+
+/* Blog registration template tags */
+
+function bp_blog_signup_enabled() {
+	global $bp;
+
+	$active_signup = isset( $bp->site_options['registration'] ) ? $bp->site_options['registration'] : 'all';
+
+	$active_signup = apply_filters( 'wpmu_active_signup', $active_signup ); // return "all", "none", "blog" or "user"
+
+	if ( 'none' == $active_signup || 'user' == $active_signup )
+		return false;
+
+	return true;
+}
+
+function bp_show_blog_signup_form($blogname = '', $blog_title = '', $errors = '') {
+	global $current_user, $current_site;
+	global $bp;
+
+	if ( isset($_POST['submit']) ) {
+		bp_blogs_validate_blog_signup();
+	} else {
+		if ( ! is_wp_error($errors) ) {
+			$errors = new WP_Error();
+		}
+
+		// allow definition of default variables
+		$filtered_results = apply_filters('signup_another_blog_init', array('blogname' => $blogname, 'blog_title' => $blog_title, 'errors' => $errors ));
+		$blogname = $filtered_results['blogname'];
+		$blog_title = $filtered_results['blog_title'];
+		$errors = $filtered_results['errors'];
+
+		if ( $errors->get_error_code() ) {
+			echo "<p>" . __('There was a problem, please correct the form below and try again.', 'buddypress') . "</p>";
+		}
+		?>
+		<p><?php printf(__("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!", 'buddypress'), $current_user->display_name) ?></p>
+
+		<p><?php _e("If you&#8217;re not going to use a great domain, leave it for a new user. Now have at it!", 'buddypress') ?></p>
+
+		<form class="standard-form" id="setupform" method="post" action="">
+
+			<input type="hidden" name="stage" value="gimmeanotherblog" />
+			<?php do_action( 'signup_hidden_fields' ); ?>
+
+			<?php bp_blogs_signup_blog($blogname, $blog_title, $errors); ?>
+			<p>
+				<input id="submit" type="submit" name="submit" class="submit" value="<?php _e('Create Site', 'buddypress') ?>" />
+			</p>
+
+			<?php wp_nonce_field( 'bp_blog_signup_form' ) ?>
+		</form>
+		<?php
+	}
+}
+
+function bp_blogs_signup_blog( $blogname = '', $blog_title = '', $errors = '' ) {
+	global $current_site;
+
+	// Blog name
+	if( !is_subdomain_install() )
+		echo '<label for="blogname">' . __('Site Name:', 'buddypress') . '</label>';
+	else
+		echo '<label for="blogname">' . __('Site Domain:', 'buddypress') . '</label>';
+
+	if ( $errmsg = $errors->get_error_message('blogname') ) { ?>
+
+		<p class="error"><?php echo $errmsg ?></p>
+
+	<?php }
+
+	if ( !is_subdomain_install() )
+		echo '<span class="prefix_address">' . $current_site->domain . $current_site->path . '</span> <input name="blogname" type="text" id="blogname" value="'.$blogname.'" maxlength="50" /><br />';
+	else
+		echo '<input name="blogname" type="text" id="blogname" value="'.$blogname.'" maxlength="50" /> <span class="suffix_address">.' . bp_blogs_get_subdomain_base() . '</span><br />';
+
+	if ( !is_user_logged_in() ) {
+		print '(<strong>' . __( 'Your address will be ' , 'buddypress');
+
+		if ( !is_subdomain_install() ) {
+			print $current_site->domain . $current_site->path . __( 'blogname' , 'buddypress');
+		} else {
+			print __( 'domain.' , 'buddypress') . $current_site->domain . $current_site->path;
+		}
+
+		echo '.</strong> ' . __( 'Must be at least 4 characters, letters and numbers only. It cannot be changed so choose carefully!)' , 'buddypress') . '</p>';
+	}
+
+	// Blog Title
+	?>
+
+	<label for="blog_title"><?php _e('Site Title:', 'buddypress') ?></label>
+
+	<?php if ( $errmsg = $errors->get_error_message('blog_title') ) { ?>
+
+		<p class="error"><?php echo $errmsg ?></p>
+
+	<?php }
+	echo '<input name="blog_title" type="text" id="blog_title" value="'.esc_html($blog_title, 1).'" /></p>';
+	?>
+
+	<p>
+		<label for="blog_public_on"><?php _e('Privacy:', 'buddypress') ?></label>
+		<?php _e( 'I would like my site to appear in search engines, and in public listings around this network.', 'buddypress' ); ?>
+
+		<label class="checkbox" for="blog_public_on">
+			<input type="radio" id="blog_public_on" name="blog_public" value="1" <?php if( !isset( $_POST['blog_public'] ) || '1' == $_POST['blog_public'] ) { ?>checked="checked"<?php } ?> />
+			<strong><?php _e( 'Yes' , 'buddypress'); ?></strong>
+		</label>
+		<label class="checkbox" for="blog_public_off">
+			<input type="radio" id="blog_public_off" name="blog_public" value="0" <?php if( isset( $_POST['blog_public'] ) && '0' == $_POST['blog_public'] ) { ?>checked="checked"<?php } ?> />
+			<strong><?php _e( 'No' , 'buddypress'); ?></strong>
+		</label>
+	</p>
+
+	<?php
+	do_action('signup_blogform', $errors);
+}
+
+/**
+ * Echo the value of bp_blogs_get_subdomain_base()
+ *
+ * @since 1.6
+ */
+function bp_blogs_subdomain_base() {
+	echo bp_blogs_get_subdomain_base();
+}
+	/**
+	 * Return the base URL to be displayed when a user chooses an address for a new blog, on
+	 * a subdomain installation of WordPress MS
+	 *
+	 * @since 1.6
+	 * @return str The base URL - eg, 'example.com' for site_url() example.com or www.example.com
+	 */
+	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 );
+	}
+
+function bp_blogs_validate_blog_signup() {
+	global $wpdb, $current_user, $blogname, $blog_title, $errors, $domain, $path, $current_site;
+
+	if ( !check_admin_referer( 'bp_blog_signup_form' ) )
+		return false;
+
+	$current_user = wp_get_current_user();
+
+	if( !is_user_logged_in() )
+		die();
+
+	$result = bp_blogs_validate_blog_form();
+	extract($result);
+
+	if ( $errors->get_error_code() ) {
+		unset($_POST['submit']);
+		bp_show_blog_signup_form( $blogname, $blog_title, $errors );
+		return false;
+	}
+
+	$public = (int) $_POST['blog_public'];
+
+	$meta = apply_filters( 'signup_create_blog_meta', array( 'lang_id' => 1, 'public' => $public ) ); // depreciated
+	$meta = apply_filters( 'add_signup_meta', $meta );
+
+	// If this is a subdomain install, set up the site inside the root domain.
+	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 );
+	bp_blogs_confirm_blog_signup($domain, $path, $blog_title, $current_user->user_login, $current_user->user_email, $meta);
+	return true;
+}
+
+function bp_blogs_validate_blog_form() {
+	$user = '';
+	if ( is_user_logged_in() )
+		$user = wp_get_current_user();
+
+	return wpmu_validate_blog_signup($_POST['blogname'], $_POST['blog_title'], $user);
+}
+
+function bp_blogs_confirm_blog_signup( $domain, $path, $blog_title, $user_name, $user_email = '', $meta = '' ) {
+	$protocol = is_ssl() ? 'https://' : 'http://';
+	$blog_url = $protocol . $domain . $path; ?>
+
+	<p><?php _e( 'Congratulations! You have successfully registered a new site.', 'buddypress' ) ?></p>
+	<p>
+		<?php printf(__( '<a href="%1$s">%2$s</a> is your new site.  <a href="%3$s">Login</a> as "%4$s" using your existing password.', 'buddypress' ), $blog_url, $blog_url, $blog_url . "wp-login.php", $user_name ); ?>
+	</p>
+
+<?php
+	do_action('signup_finished');
+}
+
+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() )
+		return false;
+
+	?>
+
+	<ul class="content-header-nav">
+		<li<?php if ( bp_is_current_action( 'my-blogs'        ) || !bp_current_action() ) : ?> class="current"<?php endif; ?>><a href="<?php echo trailingslashit( bp_displayed_user_domain() . bp_get_blogs_slug() . '/my-blogs'        ); ?>"><?php printf( __( "%s's Sites", 'buddypress' ),           bp_get_displayed_user_fullname() ); ?></a></li>
+		<li<?php if ( bp_is_current_action( 'recent-posts'    )                         ) : ?> class="current"<?php endif; ?>><a href="<?php echo trailingslashit( bp_displayed_user_domain() . bp_get_blogs_slug() . '/recent-posts'    ); ?>"><?php printf( __( "%s's Recent Posts", 'buddypress' ),    bp_get_displayed_user_fullname() ); ?></a></li>
+		<li<?php if ( bp_is_current_action( 'recent-comments' )                         ) : ?> class="current"<?php endif; ?>><a href="<?php echo trailingslashit( bp_displayed_user_domain() . bp_get_blogs_slug() . '/recent-comments' ); ?>"><?php printf( __( "%s's Recent Comments", 'buddypress' ), bp_get_displayed_user_fullname() ); ?></a></li>
+	</ul>
+
+<?php
+	do_action( 'bp_blogs_blog_tabs', $current_tab );
+}
+
+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; ?>
+
+	<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>
+		<input type="submit" id="blogs_search_submit" name="blogs_search_submit" value="<?php _e( 'Search', 'buddypress' ) ?>" />
+	</form>
+
+<?php
+}
+
+/**
+ * bp_blogs_visit_blog_button()
+ *
+ * Output button for visiting a blog in a loop
+ *
+ * @param array $args Custom button properties
+ */
+function bp_blogs_visit_blog_button( $args = '' ) {
+	echo bp_get_blogs_visit_blog_button( $args );
+}
+	/**
+	 * bp_get_blogs_visit_blog_button()
+	 *
+	 * Return button for visiting a blog in a loop
+	 *
+	 * @param array $args Custom button properties
+	 * @return string
+	 */
+	function bp_get_blogs_visit_blog_button( $args = '' ) {
+		$defaults = array(
+			'id'                => 'visit_blog',
+			'component'         => 'blogs',
+			'must_be_logged_in' => false,
+			'block_self'        => false,
+			'wrapper_class'     => 'blog-button visit',
+			'link_href'         => bp_get_blog_permalink(),
+			'link_class'        => 'blog-button visit',
+			'link_text'         => __( 'Visit Site', 'buddypress' ),
+			'link_title'        => __( 'Visit Site', 'buddypress' ),
+		);
+
+		$button = wp_parse_args( $args, $defaults );
+
+		// Filter and return the HTML button
+		return bp_get_button( apply_filters( 'bp_get_blogs_visit_blog_button', $button ) );
+	}
+
+?>
\ No newline at end of file
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 8f4309407d8b3cf00529b027b858bde1d19469e3..9ff4642d5f304379f9b633e3fad2d11e627189ea 100644
--- a/wp-content/plugins/buddypress/bp-blogs/bp-blogs-widgets.php
+++ b/wp-content/plugins/buddypress/bp-blogs/bp-blogs-widgets.php
@@ -1,4 +1,6 @@
 <?php
+// Exit if accessed directly
+if ( !defined( 'ABSPATH' ) ) exit;
 
 /***
  * The recent blogs widget is actually just the activity feed filtered on "new_blog_post".
@@ -6,16 +8,21 @@
  */
 
 function bp_blogs_register_widgets() {
-	global $current_blog, $bp;
+	global $wpdb, $bp;
 
-	if ( bp_is_active( 'activity' ) && (int)$current_blog->blog_id == BP_ROOT_BLOG )
+	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() {
-		parent::WP_Widget( false, $name = __( 'Recent Site Wide Posts', 'buddypress' ) );
+		$this->__construct();
+	}
+
+	function __construct() {
+		parent::__construct( false, $name = __( 'Recent Networkwide Posts', 'buddypress' ) );
 	}
 
 	function widget($args, $instance) {
@@ -29,7 +36,8 @@ class BP_Blogs_Recent_Posts_Widget extends WP_Widget {
 		if ( empty( $instance['max_posts'] ) || !$instance['max_posts'] )
 			$instance['max_posts'] = 10; ?>
 
-		<?php if ( bp_has_activities( 'action=new_blog_post&max=' . $instance['max_posts'] . '&per_page=' . $instance['max_posts'] ) ) : ?>
+		<?php /* Override some of the contextually set parameters for bp_has_activities() */ ?>
+		<?php if ( bp_has_activities( array( 'action' => 'new_blog_post', 'max' => $instance['max_posts'], 'per_page' => $instance['max_posts'], 'user_id' => 0, 'scope' => false, 'object' => false, 'primary_id' => false ) ) ) : ?>
 
 			<ul id="blog-post-list" class="activity-list item-list">
 
@@ -57,7 +65,7 @@ class BP_Blogs_Recent_Posts_Widget extends WP_Widget {
 
 		<?php else : ?>
 			<div id="message" class="info">
-				<p><?php _e( 'Sorry, there were no blog posts found. Why not write one?', 'buddypress' ) ?></p>
+				<p><?php _e( 'Sorry, there were no posts found. Why not write one?', 'buddypress' ) ?></p>
 			</div>
 		<?php endif; ?>
 
diff --git a/wp-content/plugins/buddypress/bp-core/admin/bp-core-admin.php b/wp-content/plugins/buddypress/bp-core/admin/bp-core-admin.php
new file mode 100644
index 0000000000000000000000000000000000000000..e598c897364a35ce31fb04aeb228b679f9a76376
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-core/admin/bp-core-admin.php
@@ -0,0 +1,637 @@
+<?php
+// Exit if accessed directly
+if ( !defined( 'ABSPATH' ) ) exit;
+
+/**
+ * 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' );
+
+/**
+ * Output the tabs in the admin area
+ *
+ * @since 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-general-settings' ), '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' );
+}
+
+/**
+ * Renders the Settings admin panel.
+ *
+ * @package BuddyPress Core
+ * @since {@internal Unknown}}
+ */
+function bp_core_admin_settings() {
+	global $wpdb, $bp;
+
+	$ud = get_userdata( $bp->loggedin_user->id );
+
+	if ( isset( $_POST['bp-admin-submit'] ) && isset( $_POST['bp-admin'] ) ) {
+		if ( !check_admin_referer('bp-admin') )
+			return false;
+
+		// Settings form submitted, now save the settings.
+		foreach ( (array)$_POST['bp-admin'] as $key => $value )
+			bp_update_option( $key, $value );
+
+	} ?>
+
+	<div class="wrap">
+
+		<?php screen_icon( 'buddypress' ); ?>
+
+		<h2 class="nav-tab-wrapper"><?php bp_core_admin_tabs( __( '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 ( bp_is_active( 'xprofile' ) ) : ?>
+
+						<tr>
+							<th scope="row"><?php _e( 'Disable BuddyPress to WordPress profile syncing?', 'buddypress' ) ?></th>
+							<td>
+								<input type="radio" name="bp-admin[bp-disable-profile-sync]"<?php if ( (int)bp_get_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)bp_get_option( 'bp-disable-profile-sync' ) || '' == bp_get_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"><?php _e( 'Hide admin bar for logged out users?', 'buddypress' ) ?></th>
+						<td>
+							<input type="radio" name="bp-admin[hide-loggedout-adminbar]"<?php if ( (int)bp_get_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)bp_get_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"><?php _e( 'Disable avatar uploads? (Gravatars will still work)', 'buddypress' ) ?></th>
+						<td>
+							<input type="radio" name="bp-admin[bp-disable-avatar-uploads]"<?php if ( (int)bp_get_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)bp_get_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"><?php _e( 'Disable user account deletion?', 'buddypress' ) ?></th>
+						<td>
+							<input type="radio" name="bp-admin[bp-disable-account-deletion]"<?php if ( (int)bp_get_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)bp_get_option( 'bp-disable-account-deletion' ) ) : ?> checked="checked"<?php endif; ?> id="bp-disable-account-deletion" value="0" /> <?php _e( 'No', 'buddypress' ) ?>
+						</td>
+					</tr>
+
+					<?php if ( bp_is_active( 'activity' ) ) : ?>
+
+						<tr>
+							<th scope="row"><?php _e( 'Disable activity stream commenting on blog and forum posts?', 'buddypress' ) ?></th>
+							<td>
+								<input type="radio" name="bp-admin[bp-disable-blogforum-comments]"<?php if ( (int)bp_get_option( 'bp-disable-blogforum-comments' ) || false === bp_get_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)bp_get_option( 'bp-disable-blogforum-comments' ) ) : ?> checked="checked"<?php endif; ?> id="bp-disable-blogforum-comments" value="0" /> <?php _e( 'No', 'buddypress' ) ?>
+							</td>
+						</tr>
+
+					<?php endif; ?>
+
+					<?php if ( bp_is_active( 'groups' ) ) : ?>
+
+						<tr>
+							<th scope="row"><?php _e( 'Restrict group creation to Site Admins?', 'buddypress' ) ?></th>
+							<td>
+								<input type="radio" name="bp-admin[bp_restrict_group_creation]"<?php checked( '1', bp_get_option( 'bp_restrict_group_creation', '0' ) ); ?>id="bp-restrict-group-creation" value="1" /> <?php _e( 'Yes', 'buddypress' ) ?> &nbsp;
+								<input type="radio" name="bp-admin[bp_restrict_group_creation]"<?php checked( '0', bp_get_option( 'bp_restrict_group_creation', '0' ) ); ?>id="bp-restrict-group-creation" value="0" /> <?php _e( 'No', 'buddypress' ) ?>
+							</td>
+						</tr>
+
+					<?php endif; ?>
+
+					<?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
+}
+
+function bp_core_admin_component_setup_handler() {
+	global $wpdb, $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( BP_PLUGIN_DIR . '/bp-core/admin/bp-core-update.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-general-settings', 'updated' => 'true' ), 'admin.php' ) );
+
+		wp_redirect( $base_url );
+	}
+}
+add_action( 'admin_init', 'bp_core_admin_component_setup_handler' );
+
+function bp_core_admin_pages_setup_handler() {
+	global $wpdb, $bp;
+
+	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_pages_setup_handler' );
+
+/**
+ * Renders the Component Setup admin panel.
+ *
+ * @package BuddyPress Core
+ * @since {@internal Unknown}}
+ * @uses bp_core_admin_component_options()
+ */
+function bp_core_admin_component_setup() {
+?>
+
+	<div class="wrap">
+
+		<?php screen_icon( 'buddypress'); ?>
+
+		<h2 class="nav-tab-wrapper"><?php bp_core_admin_tabs( __( 'Components', 'buddypress' ) ); ?></h2>
+
+		<?php if ( isset( $_GET['updated'] ) && 'true' === $_GET['updated'] ) : ?>
+
+			<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">
+
+			<?php bp_core_admin_component_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
+}
+
+/**
+ * Renders the Component Setup admin panel.
+ *
+ * @package BuddyPress Core
+ * @since {@internal Unknown}}
+ * @uses bp_core_admin_component_options()
+ */
+function bp_core_admin_page_setup() {
+?>
+
+	<div class="wrap">
+
+		<?php screen_icon( 'buddypress'); ?>
+
+		<h2 class="nav-tab-wrapper"><?php bp_core_admin_tabs( __( 'Pages', 'buddypress' ) ); ?></h2>
+
+		<?php if ( isset( $_GET['updated'] ) && 'true' === $_GET['updated'] ) : ?>
+
+			<div id="message" class="updated fade">
+
+				<p><?php _e( 'Settings Saved', 'buddypress' ); ?></p>
+
+			</div>
+
+		<?php endif; ?>
+
+		<form action="" method="post" id="bp-admin-page-form">
+
+			<?php bp_core_admin_page_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 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 Core
+ * @since 1.5
+ */
+function bp_core_admin_component_options() {
+	global $bp_wizard;
+
+	// Load core functions, if needed
+	if ( !function_exists( 'bp_get_option' ) )
+		require( BP_PLUGIN_DIR . '/bp-core/bp-core-functions.php' );
+
+	$active_components = apply_filters( 'bp_active_components', bp_get_option( 'bp-active-components' ) );
+
+	// An array of strings looped over to create component setup markup
+	$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' => __( '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.', 'buddypress' )
+		),
+		'blogs'    => array(
+			'title'       => __( 'Site Tracking', 'buddypress' ),
+			'description' => __( 'Make BuddyPress aware of new posts and new comments from your site.', 'buddypress' )
+		)
+	);
+
+	if ( is_multisite() )
+		$optional_components['blogs']['description'] = __( 'Make BuddyPress aware of new sites, new posts and new comments from across your entire network.', 'buddypress' );
+
+	// 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' );
+
+		// 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;
+			}
+		}
+	}
+
+	// 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' )
+		),
+	);
+
+	// On new install, set all components to be active by default
+	if ( !empty( $bp_wizard ) && 'install' == $bp_wizard->setup_type && empty( $active_components ) )
+		$active_components = $optional_components;
+
+	?>
+
+	<?php /* The setup wizard uses different, more descriptive text here */ ?>
+	<?php if ( empty( $bp_wizard ) ) : ?>
+
+		<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 ?>
+
+	<table class="form-table">
+		<tbody>
+
+			<?php foreach ( $optional_components as $name => $labels ) : ?>
+
+				<tr valign="top">
+					<th scope="row"><?php echo esc_html( $labels['title'] ); ?></th>
+
+					<td>
+						<label for="bp_components[<?php echo esc_attr( $name ); ?>]">
+							<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 echo $labels['description']; ?>
+
+						</label>
+
+					</td>
+				</tr>
+
+			<?php endforeach ?>
+
+		</tbody>
+	</table>
+
+	<?php if ( empty( $bp_wizard ) ) : ?>
+
+		<h3><?php _e( 'Required Components', 'buddypress' ); ?></h3>
+
+		<p><?php _e( 'The following components are required by BuddyPress and cannot be turned off.', 'buddypress' ); ?></p>
+
+	<?php endif ?>
+
+	<table class="form-table">
+		<tbody>
+
+			<?php foreach ( $required_components as $name => $labels ) : ?>
+
+				<tr valign="top">
+					<th scope="row"><?php echo esc_html( $labels['title'] ); ?></th>
+
+					<td>
+						<label for="bp_components[<?php echo esc_attr( $name ); ?>]">
+							<input type="checkbox" id="bp_components[<?php echo esc_attr( $name ); ?>]" name="" disabled="disabled" value="1"<?php checked( true ); ?> />
+
+							<?php echo $labels['description']; ?>
+
+						</label>
+
+					</td>
+				</tr>
+
+			<?php endforeach ?>
+
+		</tbody>
+	</table>
+
+	<input type="hidden" name="bp_components[members]" value="1" />
+
+	<?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 Core
+ * @since 1.5
+ */
+function bp_core_admin_page_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();
+
+	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
+			$component_name = !empty( $bp->{$component_id}->name ) ? $bp->{$component_id}->name : ucwords( $component_id );
+
+			$directory_pages[$component_id] = $component_name;
+		}
+	}
+
+	$directory_pages = apply_filters( 'bp_directory_pages', $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 ) : ?>
+				<?php $disabled = !bp_is_active( $name ) ? ' disabled="disabled"' : ''; ?>
+
+				<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' ); ?></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' ); ?></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
+
+	// Static pages
+	$static_pages = array(
+		'register' => __( 'Register', 'buddypress' ),
+		'activate' => __( 'Activate', 'buddypress' ),
+	); ?>
+
+	<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' ); ?></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' ); ?></a>
+
+						<?php endif; ?>
+
+					</td>
+				</tr>
+
+			<?php endforeach ?>
+
+			<?php do_action( 'bp_active_external_pages' ); ?>
+
+		</tbody>
+	</table>
+
+	<?php
+}
+
+/**
+ * Loads admin panel styles and scripts.
+ *
+ * @package BuddyPress Core
+ * @since {@internal Unknown}}
+ */
+function bp_core_add_admin_menu_styles() {
+	if ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG )
+		wp_enqueue_style( 'bp-admin-css', apply_filters( 'bp_core_admin_css', BP_PLUGIN_URL . '/bp-core/css/admin.dev.css' ), array(), '20110723' );
+	else
+		wp_enqueue_style( 'bp-admin-css', apply_filters( 'bp_core_admin_css', BP_PLUGIN_URL . '/bp-core/css/admin.css' ), array(), '20110723' );
+
+	wp_enqueue_script( 'thickbox' );
+	wp_enqueue_style( 'thickbox' );
+}
+
+?>
\ No newline at end of file
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
new file mode 100644
index 0000000000000000000000000000000000000000..484660005daab2fefffa12db32e07dd171fdca87
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-core/admin/bp-core-schema.php
@@ -0,0 +1,300 @@
+<?php
+// Exit if accessed directly
+if ( !defined( 'ABSPATH' ) ) exit;
+
+function bp_core_set_charset() {
+	global $wpdb;
+
+	require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
+
+	/* BuddyPress component DB schema */
+	if ( !empty($wpdb->charset) )
+		return "DEFAULT CHARACTER SET $wpdb->charset";
+
+	return '';
+}
+
+function bp_core_install_notifications() {
+	global $wpdb;
+
+	$charset_collate = bp_core_set_charset();
+	$bp_prefix = bp_core_get_table_prefix();
+
+	$sql[] = "CREATE TABLE {$bp_prefix}bp_notifications (
+	  		    id bigint(20) NOT NULL AUTO_INCREMENT PRIMARY KEY,
+			    user_id bigint(20) NOT NULL,
+			    item_id bigint(20) NOT NULL,
+			    secondary_item_id bigint(20),
+	  		    component_name varchar(75) NOT NULL,
+			    component_action varchar(75) NOT NULL,
+	  		    date_notified datetime NOT NULL,
+			    is_new bool NOT NULL DEFAULT 0,
+		        KEY item_id (item_id),
+			    KEY secondary_item_id (secondary_item_id),
+			    KEY user_id (user_id),
+			    KEY is_new (is_new),
+			    KEY component_name (component_name),
+	 	   	    KEY component_action (component_action),
+			    KEY useritem (user_id,is_new)
+		       ) {$charset_collate};";
+
+	dbDelta($sql);
+}
+
+function bp_core_install_activity_streams() {
+	global $wpdb;
+
+	$charset_collate = bp_core_set_charset();
+	$bp_prefix = bp_core_get_table_prefix();
+
+	$sql[] = "CREATE TABLE {$bp_prefix}bp_activity (
+		  		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,
+				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,
+				KEY date_recorded (date_recorded),
+				KEY user_id (user_id),
+				KEY item_id (item_id),
+				KEY secondary_item_id (secondary_item_id),
+				KEY component (component),
+				KEY type (type),
+				KEY mptt_left (mptt_left),
+				KEY mptt_right (mptt_right),
+				KEY hide_sitewide (hide_sitewide)
+		 	   ) {$charset_collate};";
+
+	$sql[] = "CREATE TABLE {$bp_prefix}bp_activity_meta (
+				id bigint(20) NOT NULL AUTO_INCREMENT PRIMARY KEY,
+				activity_id bigint(20) NOT NULL,
+				meta_key varchar(255) DEFAULT NULL,
+				meta_value longtext DEFAULT NULL,
+				KEY activity_id (activity_id),
+				KEY meta_key (meta_key)
+		   	   ) {$charset_collate};";
+
+	dbDelta($sql);
+}
+
+function bp_core_install_friends() {
+	global $wpdb;
+
+	$charset_collate = bp_core_set_charset();
+	$bp_prefix = bp_core_get_table_prefix();
+
+	$sql[] = "CREATE TABLE {$bp_prefix}bp_friends (
+	  		    id bigint(20) NOT NULL AUTO_INCREMENT PRIMARY KEY,
+	  		    initiator_user_id bigint(20) NOT NULL,
+	  		    friend_user_id bigint(20) NOT NULL,
+	  		    is_confirmed bool DEFAULT 0,
+			    is_limited bool DEFAULT 0,
+	  		    date_created datetime NOT NULL,
+		        KEY initiator_user_id (initiator_user_id),
+		        KEY friend_user_id (friend_user_id)
+	 	       ) {$charset_collate};";
+
+	dbDelta($sql);
+}
+
+function bp_core_install_groups() {
+	global $wpdb;
+
+	$charset_collate = bp_core_set_charset();
+	$bp_prefix = bp_core_get_table_prefix();
+
+	$sql[] = "CREATE TABLE {$bp_prefix}bp_groups (
+		  		id bigint(20) NOT NULL AUTO_INCREMENT PRIMARY KEY,
+				creator_id bigint(20) NOT NULL,
+		  		name varchar(100) NOT NULL,
+		  		slug varchar(200) NOT NULL,
+		  		description longtext NOT NULL,
+				status varchar(10) NOT NULL DEFAULT 'public',
+				enable_forum tinyint(1) NOT NULL DEFAULT '1',
+				date_created datetime NOT NULL,
+			    KEY creator_id (creator_id),
+			    KEY status (status)
+		 	   ) {$charset_collate};";
+
+	$sql[] = "CREATE TABLE {$bp_prefix}bp_groups_members (
+		  		id bigint(20) NOT NULL AUTO_INCREMENT PRIMARY KEY,
+				group_id bigint(20) NOT NULL,
+				user_id bigint(20) NOT NULL,
+				inviter_id bigint(20) NOT NULL,
+				is_admin tinyint(1) NOT NULL DEFAULT '0',
+				is_mod tinyint(1) NOT NULL DEFAULT '0',
+				user_title varchar(100) NOT NULL,
+				date_modified datetime NOT NULL,
+				comments longtext NOT NULL,
+				is_confirmed tinyint(1) NOT NULL DEFAULT '0',
+				is_banned tinyint(1) NOT NULL DEFAULT '0',
+				invite_sent tinyint(1) NOT NULL DEFAULT '0',
+				KEY group_id (group_id),
+				KEY is_admin (is_admin),
+				KEY is_mod (is_mod),
+			 	KEY user_id (user_id),
+				KEY inviter_id (inviter_id),
+				KEY is_confirmed (is_confirmed)
+		 	   ) {$charset_collate};";
+
+	$sql[] = "CREATE TABLE {$bp_prefix}bp_groups_groupmeta (
+				id bigint(20) NOT NULL AUTO_INCREMENT PRIMARY KEY,
+				group_id bigint(20) NOT NULL,
+				meta_key varchar(255) DEFAULT NULL,
+				meta_value longtext DEFAULT NULL,
+				KEY group_id (group_id),
+				KEY meta_key (meta_key)
+			   ) {$charset_collate};";
+
+	dbDelta($sql);
+}
+
+function bp_core_install_private_messaging() {
+	global $wpdb;
+
+	$charset_collate = bp_core_set_charset();
+	$bp_prefix = bp_core_get_table_prefix();
+
+	$sql[] = "CREATE TABLE {$bp_prefix}bp_messages_messages (
+		  		id bigint(20) NOT NULL AUTO_INCREMENT PRIMARY KEY,
+		  		thread_id bigint(20) NOT NULL,
+		  		sender_id bigint(20) NOT NULL,
+		  		subject varchar(200) NOT NULL,
+		  		message longtext NOT NULL,
+		  		date_sent datetime NOT NULL,
+			    KEY sender_id (sender_id),
+			    KEY thread_id (thread_id)
+		 	   ) {$charset_collate};";
+
+	$sql[] = "CREATE TABLE {$bp_prefix}bp_messages_recipients (
+		  		id bigint(20) NOT NULL AUTO_INCREMENT PRIMARY KEY,
+		  		user_id bigint(20) NOT NULL,
+		  		thread_id bigint(20) NOT NULL,
+		  		unread_count int(10) NOT NULL DEFAULT '0',
+				sender_only tinyint(1) NOT NULL DEFAULT '0',
+				is_deleted tinyint(1) NOT NULL DEFAULT '0',
+			    KEY user_id (user_id),
+			    KEY thread_id (thread_id),
+				KEY is_deleted (is_deleted),
+				KEY sender_only (sender_only),
+			    KEY unread_count (unread_count)
+		 	   ) {$charset_collate};";
+
+	$sql[] = "CREATE TABLE {$bp_prefix}bp_messages_notices (
+		  		id bigint(20) NOT NULL AUTO_INCREMENT PRIMARY KEY,
+		  		subject varchar(200) NOT NULL,
+		  		message longtext NOT NULL,
+		  		date_sent datetime NOT NULL,
+				is_active tinyint(1) NOT NULL DEFAULT '0',
+			    KEY is_active (is_active)
+		 	   ) {$charset_collate};";
+
+	dbDelta($sql);
+}
+
+function bp_core_install_extended_profiles() {
+	global $wpdb;
+
+	$charset_collate = bp_core_set_charset();
+	$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' ) );
+
+	$sql[] = "CREATE TABLE {$bp_prefix}bp_xprofile_groups (
+			    id bigint(20) unsigned NOT NULL AUTO_INCREMENT PRIMARY KEY,
+			    name varchar(150) NOT NULL,
+			    description mediumtext NOT NULL,
+			    group_order bigint(20) NOT NULL DEFAULT '0',
+			    can_delete tinyint(1) NOT NULL,
+			    KEY can_delete (can_delete)
+			   ) {$charset_collate};";
+
+	$sql[] = "CREATE TABLE {$bp_prefix}bp_xprofile_fields (
+			    id bigint(20) unsigned NOT NULL AUTO_INCREMENT PRIMARY KEY,
+			    group_id bigint(20) unsigned NOT NULL,
+			    parent_id bigint(20) unsigned NOT NULL,
+			    type varchar(150) NOT NULL,
+			    name varchar(150) NOT NULL,
+			    description longtext NOT NULL,
+			    is_required tinyint(1) NOT NULL DEFAULT '0',
+			    is_default_option tinyint(1) NOT NULL DEFAULT '0',
+			    field_order bigint(20) NOT NULL DEFAULT '0',
+			    option_order bigint(20) NOT NULL DEFAULT '0',
+			    order_by varchar(15) NOT NULL DEFAULT '',
+			    can_delete tinyint(1) NOT NULL DEFAULT '1',
+			    KEY group_id (group_id),
+			    KEY parent_id (parent_id),
+			    KEY field_order (field_order),
+			    KEY can_delete (can_delete),
+			    KEY is_required (is_required)
+			   ) {$charset_collate};";
+
+	$sql[] = "CREATE TABLE {$bp_prefix}bp_xprofile_data (
+			    id bigint(20) unsigned NOT NULL AUTO_INCREMENT PRIMARY KEY,
+			    field_id bigint(20) unsigned NOT NULL,
+			    user_id bigint(20) unsigned NOT NULL,
+			    value longtext NOT NULL,
+			    last_updated datetime NOT NULL,
+			    KEY field_id (field_id),
+			    KEY user_id (user_id)
+			   ) {$charset_collate};";
+
+	$sql[] = "CREATE TABLE {$bp_prefix}bp_xprofile_meta (
+				id bigint(20) NOT NULL AUTO_INCREMENT PRIMARY KEY,
+				object_id bigint(20) NOT NULL,
+				object_type varchar(150) NOT NULL,
+				meta_key varchar(255) DEFAULT NULL,
+				meta_value longtext DEFAULT NULL,
+				KEY object_id (object_id),
+				KEY meta_key (meta_key)
+		   	   ) {$charset_collate};";
+
+	dbDelta( $sql );
+
+	// Insert the default group and fields
+	$insert_sql = array();
+
+	if ( !$wpdb->get_var( "SELECT id FROM {$bp_prefix}bp_xprofile_groups WHERE id = 1" ) )
+		$insert_sql[] = "INSERT INTO {$bp_prefix}bp_xprofile_groups ( name, description, can_delete ) VALUES ( " . $wpdb->prepare( '%s', stripslashes( bp_get_option( 'bp-xprofile-base-group-name' ) ) ) . ", '', 0 );";
+
+	if ( !$wpdb->get_var( "SELECT id FROM {$bp_prefix}bp_xprofile_fields WHERE id = 1" ) )
+		$insert_sql[] = "INSERT INTO {$bp_prefix}bp_xprofile_fields ( group_id, parent_id, type, name, description, is_required, can_delete ) VALUES ( 1, 0, 'textbox', " . $wpdb->prepare( '%s', stripslashes( bp_get_option( 'bp-xprofile-fullname-field-name' ) ) ) . ", '', 1, 0 );";
+
+	dbDelta( $insert_sql );
+}
+
+function bp_core_install_blog_tracking() {
+	global $wpdb;
+
+	$charset_collate = bp_core_set_charset();
+	$bp_prefix = bp_core_get_table_prefix();
+
+	$sql[] = "CREATE TABLE {$bp_prefix}bp_user_blogs (
+	  		    id bigint(20) NOT NULL AUTO_INCREMENT PRIMARY KEY,
+			    user_id bigint(20) NOT NULL,
+			    blog_id bigint(20) NOT NULL,
+			    KEY user_id (user_id),
+			    KEY blog_id (blog_id)
+		       ) {$charset_collate};";
+
+	$sql[] = "CREATE TABLE {$bp_prefix}bp_user_blogs_blogmeta (
+				id bigint(20) NOT NULL AUTO_INCREMENT PRIMARY KEY,
+				blog_id bigint(20) NOT NULL,
+				meta_key varchar(255) DEFAULT NULL,
+				meta_value longtext DEFAULT NULL,
+				KEY blog_id (blog_id),
+				KEY meta_key (meta_key)
+		       ) {$charset_collate};";
+
+	dbDelta($sql);
+}
+
+?>
\ No newline at end of file
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
new file mode 100644
index 0000000000000000000000000000000000000000..2549f3c6e72538ac5cb2e4f96c12f5030f1e2ad8
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-core/admin/bp-core-update.php
@@ -0,0 +1,1344 @@
+<?php
+// Exit if accessed directly
+if ( !defined( 'ABSPATH' ) ) exit;
+
+class BP_Core_Setup_Wizard {
+	var $current_step;
+	var $steps;
+
+	var $database_version;
+	var $is_network_activate;
+	var $new_version;
+	var $setup_type;
+
+	function bp_core_setup_wizard() {
+		$this->__construct();
+	}
+
+	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 );
+
+		// Call the save method that will save data and modify $current_step
+		if ( isset( $_POST['save'] ) )
+			$this->save( $_POST['save'] );
+
+		// Build the steps needed for update or new installations
+		$this->steps = $this->add_steps();
+	}
+
+	function current_step() {
+		if ( isset( $_POST['step'] ) ) {
+			$current_step = (int)$_POST['step'] + 1;
+		} else {
+			if ( !empty( $_COOKIE['bp-wizard-step'] ) )
+				$current_step = $_COOKIE['bp-wizard-step'];
+			else
+				$current_step = 0;
+		}
+
+		return $current_step;
+	}
+
+	function add_steps() {
+		global $wp_rewrite;
+
+		// Setup wizard steps
+		$steps = array();
+
+		if ( 'install' == $this->setup_type ) {
+			$steps = array(
+				__( 'Components', 'buddypress' ),
+				__( 'Pages',      'buddypress' ),
+				__( 'Permalinks', 'buddypress' ),
+				__( 'Theme',      'buddypress' ),
+				__( 'Finish',     'buddypress' )
+			);
+
+		// Update wizard steps
+		} 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() ) {
+				$steps[] = __( 'Components', 'buddypress' );
+				$steps[] = __( 'Pages', 'buddypress' );
+			}
+
+			$steps[] = __( 'Finish', 'buddypress' );
+		}
+
+		return $steps;
+	}
+
+	function save( $step_name ) {
+
+		// Save any posted values
+		switch ( $step_name ) {
+			case 'db_update': default:
+				$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:
+				$result = $this->step_components_save();
+				break;
+
+			case 'pages': default:
+				$result = $this->step_pages_save();
+				break;
+
+			case 'permalinks': default:
+				$result = $this->step_permalinks_save();
+				break;
+
+			case 'theme': default:
+				$result = $this->step_theme_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 );
+	}
+
+	function html() {
+
+		// Update or Setup
+		$type = ( 'update' == $this->setup_type ) ? __( 'Update', 'buddypress' ) : __( 'Setup', 'buddypress' );
+
+		?>
+
+		<div class="wrap" id="bp-admin">
+
+			<?php screen_icon( 'buddypress' ); ?>
+
+			<h2><?php printf( __( 'BuddyPress %s', 'buddypress' ), $type ); ?></h2>
+
+			<?php
+				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' ) );
+			?>
+
+			<form action="<?php echo $form_action; ?>" method="post" id="bp-admin-form">
+				<div id="bp-admin-nav">
+					<ol>
+
+						<?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 ) : ?>
+
+									<span class="complete">&nbsp;</span>
+
+								<?php else :
+
+									echo $i + 1 . '. ';
+
+								endif;
+
+								echo esc_attr( $name ) ?>
+
+							</li>
+
+						<?php endforeach; ?>
+
+					</ol>
+
+					<?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" />
+						</div>
+
+					<?php else : ?>
+
+						<div class="prev-next submit clear">
+							<input type="submit" value="<?php _e( 'Save &amp; Next', 'buddypress' ); ?>" name="submit" />
+						</div>
+
+					<?php endif; ?>
+
+				</div>
+
+				<div id="bp-admin-content">
+
+					<?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;
+
+						case __( 'Pages', 'buddypress') :
+							$this->step_pages();
+							break;
+
+						case __( 'Permalinks', 'buddypress') :
+							$this->step_permalinks();
+							break;
+
+						case __( 'Theme', 'buddypress') :
+							$this->step_theme();
+							break;
+
+						case __( 'Finish', 'buddypress') :
+							$this->step_finish();
+							break;
+
+					} ?>
+
+				</div>
+			</form>
+		</div>
+
+	<?php
+	}
+
+	/** 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>
+
+		<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 ); ?>" />
+
+			<?php wp_nonce_field( 'bpwizard_db_update' ) ?>
+
+		</div>
+
+	<?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' ); ?>
+
+		<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(); ?>
+
+		<div class="submit clear">
+			<input type="hidden" name="save" value="components" />
+			<input type="hidden" name="step" value="<?php echo esc_attr( $this->current_step ); ?>" />
+
+			<?php wp_nonce_field( 'bpwizard_components' ); ?>
+
+		</div>
+
+	<?php
+	}
+
+	function step_pages() {
+		global $bp, $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;
+
+		$existing_pages = bp_core_update_get_page_meta();
+
+		// 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] ) )
+				$existing_pages[$index] = '';
+		}
+
+		if ( !empty( $existing_pages['blogs'] ) )
+			$existing_blog_page = '&selected=' . $existing_pages['blogs'];
+		else
+			$existing_blog_page = '';
+
+		// Get active components
+		$active_components = apply_filters( 'bp_active_components', bp_get_option( 'bp-active-components' ) );
+
+		// Check for defined slugs
+		$members_slug    = !empty( $bp->members->slug    ) ? $bp->members->slug    : __( 'members',  'buddypress' );
+
+		// Groups
+		$groups_slug     = !empty( $bp->groups->slug     ) ? $bp->groups->slug     : __( 'groups',   'buddypress' );
+
+		// Activity
+		$activity_slug   = !empty( $bp->activity->slug   ) ? $bp->activity->slug   : __( 'activity', 'buddypress' );
+
+		// Forums
+		$forums_slug     = !empty( $bp->forums->slug     ) ? $bp->forums->slug     : __( 'forums',   'buddypress' );
+
+		// Blogs
+		$blogs_slug      = !empty( $bp->blogs->slug      ) ? $bp->blogs->slug      : __( 'blogs',    'buddypress' );
+
+		// Register
+		$register_slug   = !empty( $bp->register->slug   ) ? $bp->register->slug   : __( 'register', 'buddypress' );
+
+		// Activation
+		$activation_slug = !empty( $bp->activation->slug ) ? $bp->activation->slug : __( 'activate', 'buddypress' );
+
+		?>
+
+		<script type="text/javascript">
+			jQuery( document ).ready( function() {
+				jQuery( 'select' ).change( function() {
+					jQuery( this ).siblings( 'input[@type=radio]' ).click();
+				});
+			});
+		</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><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>
+
+		<table class="form-table">
+
+			<tr valign="top">
+				<th scope="row">
+					<h5><?php _e( 'Members', 'buddypress' ); ?></h5>
+					<p><?php _e( 'Displays member profiles, and a directory of all site members.', 'buddypress' ); ?></p>
+				</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>
+				</td>
+			</tr>
+
+			<?php if ( isset( $active_components['activity'] ) ) : ?>
+
+				<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>
+					</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>
+					</td>
+				</tr>
+
+			<?php endif; ?>
+
+			<?php if ( isset( $active_components['groups'] ) ) : ?>
+
+				<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>
+					</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>
+					</td>
+				</tr>
+
+			<?php endif; ?>
+
+			<?php if ( isset( $active_components['forums'] ) ) : ?>
+
+				<tr valign="top">
+					<th scope="row">
+						<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[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>
+					</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'] ) ) : ?>
+
+				<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>
+					</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>
+					</td>
+				</tr>
+
+			<?php endif; ?>
+
+			<tr valign="top">
+				<th scope="row">
+					<h5><?php _e( 'Register', 'buddypress' ); ?></h5>
+					<p><?php _e( 'Displays a site registration page where users can create new accounts.', 'buddypress' ); ?></p>
+				</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>
+				</td>
+			</tr>
+
+			<tr valign="top">
+				<th scope="row">
+					<h5><?php _e( 'Activate', 'buddypress' ); ?></h5>
+					<p><?php _e( 'The page users will visit to activate their account once they have registered.', 'buddypress' ); ?></p>
+				</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>
+				</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 ); ?>" />
+
+			<?php wp_nonce_field( 'bpwizard_pages' ); ?>
+
+		</div>
+
+		<?php
+
+		restore_current_blog();
+	}
+
+	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;
+		$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' );
+		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' );
+
+		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' ) ); ?>
+
+		<table class="form-table">
+			<tr>
+				<th><label><input name="permalink_structure" type="radio"<?php if ( empty( $permalink_structure ) || false != strpos( $permalink_structure, $structures[1] ) ) : ?> checked="checked" <?php endif; ?>value="<?php echo esc_attr( $structures[1] ); ?>" class="tog" <?php checked( $structures[1], $permalink_structure ); ?> />&nbsp;<?php _e( 'Day and name' ); ?></label></th>
+				<td><code><?php echo get_home_url() . $prefix . '/' . date('Y') . '/' . date('m') . '/' . date('d') . '/sample-post/'; ?></code></td>
+			</tr>
+			<tr>
+				<th><label><input name="permalink_structure" type="radio"<?php if ( empty( $permalink_structure ) || false != strpos( $permalink_structure, $structures[2] ) ) : ?> checked="checked" <?php endif; ?> value="<?php echo esc_attr( $structures[2] ); ?>" class="tog" <?php checked( $structures[2], $permalink_structure ); ?> />&nbsp;<?php _e( 'Month and name' ); ?></label></th>
+				<td><code><?php echo get_home_url() . $prefix . '/' . date('Y') . '/' . date('m') . '/sample-post/'; ?></code></td>
+			</tr>
+			<tr>
+				<th><label><input name="permalink_structure" type="radio"<?php if ( empty( $permalink_structure ) || false != strpos( $permalink_structure, $structures[3] ) ) : ?> checked="checked" <?php endif; ?> value="<?php echo esc_attr( $structures[3] ); ?>" class="tog" <?php checked( $structures[3], $permalink_structure ); ?> />&nbsp;<?php _e( 'Numeric' ); ?></label></th>
+				<td><code><?php echo get_home_url() . $prefix ?>/archives/123</code></td>
+			</tr>
+		</table>
+
+		<div class="submit clear">
+			<input type="hidden" name="save" value="permalinks" />
+			<input type="hidden" name="step" value="<?php echo esc_attr( $this->current_step ); ?>" />
+
+			<?php if ( 'post' == strtolower( $_SERVER['REQUEST_METHOD'] ) && empty( $_POST['skip-htaccess'] ) ) : ?>
+
+				<input type="hidden" name="skip-htaccess" value="skip-htaccess" />
+
+			<?php endif; ?>
+
+			<?php wp_nonce_field( 'bpwizard_permalinks' ); ?>
+
+		</div>
+
+	<?php
+	}
+
+	function step_theme() {
+		if ( !current_user_can( 'activate_plugins' ) )
+			return false;
+
+		$installed_plugins = get_plugins();
+		$installed_themes  = get_themes();
+
+		$template_pack_installed = false;
+		$bp_autotheme_installed  = false;
+		$bp_theme_installed      = false;
+
+		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 ) {
+				if ( ( 'BuddyPress Default' != $theme['Name'] ) && ( 'buddypress' == $tag ) ) {
+					$bp_theme_installed = true;
+					$bp_themes[] = $theme;
+				}
+			}
+		}
+
+		// Get theme screenshot
+		$current_theme = get_current_theme();
+		$screenshot    = '';
+		$themes        = get_themes();
+
+		if ( !empty( $themes[$current_theme]['Screenshot'] ) )
+			$screenshot = trailingslashit( get_stylesheet_directory_uri() ) . $themes[$current_theme]['Screenshot'];
+	?>
+
+		<script type="text/javascript">
+			jQuery( document ).ready( function() {
+				jQuery( 'select' ).change( function() {
+					jQuery( this ).siblings( 'input[@type=radio]' ).click();
+				});
+			});
+		</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' ); ?>" />
+				</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><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 ) : ?>
+				<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' ); ?>" />
+					</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>
+							<label>
+								<input type="radio" name="theme" value="3rd_party" /> <?php _e( 'Use this theme', 'buddypress' ); ?>
+							</label>
+							<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 ( 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>
+
+			<tr>
+				<th>
+					<h5><?php _e( 'Do not change theme', 'buddypress' ) ?></h5>
+				</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><label><input type="radio" name="theme" value="do_not_change" /> <?php _e( "Don't change my current theme", 'buddypress' ); ?></label></p>
+
+				</td>
+			</tr>
+		</table>
+
+		<div class="submit clear">
+			<input type="hidden" name="save" value="theme" />
+			<input type="hidden" name="step" value="<?php echo esc_attr( $this->current_step ) ?>" />
+
+			<?php wp_nonce_field( 'bpwizard_theme' ) ?>
+
+		</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' ); ?>
+
+		<p><?php printf( __( "The BuddyPress %1\$s is complete, and your site is ready to go!", 'buddypress' ), $type, $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 ); ?>" />
+
+			<?php wp_nonce_field( 'bpwizard_finish' ); ?>
+
+		</div>
+
+	<?php
+	}
+
+	/** Save Step Methods *****************************************************/
+
+	function step_db_update_save() {
+		global $bp;
+
+		if ( isset( $_POST['submit'] ) ) {
+			check_admin_referer( 'bpwizard_db_update' );
+
+			// Run the schema install to update tables
+			bp_core_install();
+
+			if ( $this->database_version < 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 );
+
+			return true;
+		}
+
+		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 )
+				$active_components[$key] = 1;
+
+			bp_update_option( 'bp-active-components', $active_components );
+
+			wp_cache_flush();
+			bp_core_install();
+
+			return true;
+		}
+
+		return false;
+	}
+
+	function step_pages_save() {
+		global $wpdb;
+
+		if ( isset( $_POST['submit'] ) && isset( $_POST['bp_pages'] ) ) {
+			check_admin_referer( 'bpwizard_pages' );
+
+			// 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() );
+
+			// Delete any existing pages
+			$existing_pages = bp_core_update_get_page_meta( 'bp-pages' );
+
+			foreach ( (array)$existing_pages as $page_id )
+				wp_delete_post( $page_id, true );
+
+			$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' ) ) )
+				restore_current_blog();
+
+			return true;
+		}
+
+		return false;
+	}
+
+	function step_permalinks_save() {
+		global $wp_rewrite, $current_site, $current_blog;
+
+		// Prevent debug notices
+		$iis7_permalinks = $usingpi = $writable = false;
+
+		if ( isset( $_POST['submit'] ) ) {
+			check_admin_referer( 'bpwizard_permalinks' );
+
+			$home_path       = get_home_path();
+			$iis7_permalinks = iis7_supports_permalinks();
+
+			if ( isset( $_POST['permalink_structure'] ) ) {
+				$permalink_structure = $_POST['permalink_structure'];
+
+				if ( !empty( $permalink_structure ) )
+					$permalink_structure = preg_replace( '#/+#', '/', '/' . $_POST['permalink_structure'] );
+
+				if ( ( defined( 'VHOST' ) && constant( 'VHOST' ) == 'no' ) && $permalink_structure != '' && $current_site->domain . $current_site->path == $current_blog->domain . $current_blog->path )
+					$permalink_structure = '/blog' . $permalink_structure;
+
+				$wp_rewrite->set_permalink_structure( $permalink_structure );
+			}
+
+			if ( !empty( $iis7_permalinks ) ) {
+				if ( ( !file_exists( $home_path . 'web.config' ) && win_is_writable( $home_path ) ) || win_is_writable( $home_path . 'web.config' ) ) {
+					$writable = true;
+				}
+			} else {
+				if ( ( !file_exists( $home_path . '.htaccess' ) && is_writable( $home_path ) ) || is_writable( $home_path . '.htaccess' ) ) {
+					$writable = true;
+				}
+			}
+
+			if ( $wp_rewrite->using_index_permalinks() )
+				$usingpi = true;
+
+			$wp_rewrite->flush_rules();
+
+			if ( !empty( $iis7_permalinks ) || ( empty( $usingpi ) && empty( $writable ) ) ) {
+
+				function _bp_core_wizard_step_permalinks_message() {
+					global $wp_rewrite; ?>
+
+					<div id="message" class="updated fade"><p>
+
+						<?php
+							_e( 'Oops, there was a problem creating a configuration file. ', 'buddypress' );
+
+							if ( !empty( $iis7_permalinks ) ) {
+
+								if ( !empty( $permalink_structure ) && empty( $usingpi ) && empty( $writable ) ) {
+
+									_e( '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.' ); ?>
+
+									<br /><br />
+
+									<textarea rows="9" class="large-text readonly" style="background: #fff;" name="rules" id="rules" readonly="readonly"><?php echo esc_html( $wp_rewrite->iis7_url_rewrite_rules() ); ?></textarea>
+
+								<?php
+
+								} else if ( !empty( $permalink_structure ) && empty( $usingpi ) && !empty( $writable ) ); {
+									_e( 'Permalink structure updated. Remove write access on web.config file now!' );
+								}
+
+							} else {
+
+								_e( '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.' ); ?>
+
+								<br /><br />
+
+								<textarea rows="6" class="large-text readonly" style="background: #fff;" name="rules" id="rules" readonly="readonly"><?php echo esc_html( $wp_rewrite->mod_rewrite_rules() ); ?></textarea>
+
+							<?php } ?>
+
+						<br /><br />
+
+						<?php
+							if ( empty( $iis7_permalinks ) )
+								_e( '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.', 'buddypress' );
+						?>
+
+					</p></div>
+
+				<?php
+				}
+
+				if ( 'post' == strtolower( $_SERVER['REQUEST_METHOD'] ) && !empty( $_POST['skip-htaccess'] ) ) {
+					return true;
+				} else {
+					add_action( 'bp_admin_notices', '_bp_core_wizard_step_permalinks_message' );
+					return false;
+				}
+			}
+
+			return true;
+		}
+
+		return false;
+	}
+
+	function step_theme_save() {
+		if ( isset( $_POST['submit'] ) && isset( $_POST['theme'] ) ) {
+			check_admin_referer( 'bpwizard_theme' );
+
+			if ( is_multisite() && bp_get_root_blog_id() != get_current_blog_id() )
+				switch_to_blog( bp_get_root_blog_id() );
+
+			switch ( $_POST['theme'] ) {
+
+				// Activate the bp-default theme
+				case 'bp_default' :
+					switch_theme( 'bp-default', 'bp-default' );
+					break;
+
+				// Activate Template Pack plugin
+				case 'manual_wp' :
+
+					// Include
+					require_once( ABSPATH . WPINC . '/plugin.php' );
+					$installed_plugins = get_plugins();
+
+					foreach ( $installed_plugins as $key => $plugin ) {
+						if ( 'BuddyPress Template Pack' == $plugin['Name'] ) {
+							activate_plugin( $key );
+						}
+					}
+					break;
+
+				// Pick a theme from the repo
+				case '3rd_party' :
+					if ( empty( $_POST['3rd_party_theme'] ) )
+						return false;
+
+					$theme = explode( ',', $_POST['3rd_party_theme'] );
+					switch_theme( $theme[0], $theme[1] );
+					break;
+
+				// Keep existing theme
+				case 'do_not_change' :
+					return true;
+					break;
+			}
+
+			if ( is_multisite() )
+				restore_current_blog();
+
+			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' );
+
+			// 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' ) );
+
+			wp_redirect( $redirect );
+
+			return true;
+		}
+
+		return false;
+	}
+
+	function setup_pages( $pages ) {
+		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'];
+				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 {
+				// Create a new page
+				$bp_pages[$key] = wp_insert_post( array( 'comment_status' => 'closed', 'ping_status' => 'closed', 'post_title' => ucwords( $value ), 'post_status' => 'publish', 'post_type' => 'page' ) );
+			}
+		}
+
+		return $bp_pages;
+	}
+
+	// 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'    );
+		delete_site_option( 'bp-friends-db-version'  );
+		delete_site_option( 'bp-groups-db-version'   );
+		delete_site_option( 'bp-messages-db-version' );
+		delete_site_option( 'bp-xprofile-db-version' );
+	}
+
+	/**
+	 * Reset the cookie so the install script starts over
+	 */
+	function reset_cookie() {
+		@setcookie( 'bp-wizard-step', '', time() - 3600, COOKIEPATH );
+	}
+}
+
+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.
+ *
+ * @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
+ */
+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;
+
+	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;
+	}
+
+	echo '<div class="update-nag">' . $msg . '</div>';
+}
+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/bp-core-adminbar.php b/wp-content/plugins/buddypress/bp-core/bp-core-adminbar.php
index 05c60eac87c39bf8bc2b4049704e9b9396b3f9ab..bbce16b1b58a2bb4710995481cd935cd74b05ab8 100644
--- a/wp-content/plugins/buddypress/bp-core/bp-core-adminbar.php
+++ b/wp-content/plugins/buddypress/bp-core/bp-core-adminbar.php
@@ -1,314 +1,264 @@
 <?php
+/**
+ * BuddyPress Core Admin Bar
+ *
+ * Handles the core functions related to the WordPress Admin Bar
+ *
+ * @package BuddyPress
+ * @subpackage Core
+ */
 
-function bp_core_admin_bar() {
-	global $bp, $wpdb, $current_blog;
-
-	if ( defined( 'BP_DISABLE_ADMIN_BAR' ) )
-		return false;
-
-	if ( (int)get_site_option( 'hide-loggedout-adminbar' ) && !is_user_logged_in() )
-		return false;
-
-	$bp->doing_admin_bar = true;
-
-	echo '<div id="wp-admin-bar"><div class="padder">';
-
-	// **** Do bp-adminbar-logo Actions ********
-	do_action( 'bp_adminbar_logo' );
-
-	echo '<ul class="main-nav">';
-
-	// **** Do bp-adminbar-menus Actions ********
-	do_action( 'bp_adminbar_menus' );
+// Exit if accessed directly
+if ( !defined( 'ABSPATH' ) ) exit;
 
-	echo '</ul>';
-	echo "</div></div><!-- #wp-admin-bar -->\n\n";
+if ( !bp_use_wp_admin_bar() || defined( 'DOING_AJAX' ) )
+	return;
 
-	$bp->doing_admin_bar = false;
+/**
+ * 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 );
 
-// **** Default BuddyPress admin bar logo ********
-function bp_adminbar_logo() {
-	global $bp;
+/**
+ * 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() {
 
-	echo '<a href="' . $bp->root_domain . '" id="admin-bar-logo">' . get_blog_option( BP_ROOT_BLOG, 'blogname') . '</a>';
-}
+	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 );
 
-// **** "Log In" and "Sign Up" links (Visible when not logged in) ********
-function bp_adminbar_login_menu() {
-	global $bp;
+		// 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 );
 
-	if ( is_user_logged_in() )
-		return false;
+		remove_action( 'admin_bar_menu', 'wp_admin_bar_shortlink_menu', 80 );
+		remove_action( 'admin_bar_menu', 'wp_admin_bar_updates_menu', 70 );
 
-	echo '<li class="bp-login no-arrow"><a href="' . $bp->root_domain . '/wp-login.php?redirect_to=' . urlencode( $bp->root_domain ) . '">' . __( 'Log In', 'buddypress' ) . '</a></li>';
+		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 );
+		}
 
-	// Show "Sign Up" link if user registrations are allowed
-	if ( bp_get_signup_allowed() )
-		echo '<li class="bp-signup no-arrow"><a href="' . bp_get_signup_page(false) . '">' . __( 'Sign Up', 'buddypress' ) . '</a></li>';
+		remove_action( 'admin_bar_menu', 'wp_admin_bar_updates_menu', 70 );
+	}
 }
+add_action( 'bp_init', 'bp_admin_bar_remove_wp_menus', 2 );
 
-
-// **** "My Account" Menu ******
-function bp_adminbar_account_menu() {
-	global $bp;
-
-	if ( !$bp->bp_nav || !is_user_logged_in() )
-		return false;
-
-	echo '<li id="bp-adminbar-account-menu"><a href="' . bp_loggedin_user_domain() . '">';
-
-	echo __( 'My Account', 'buddypress' ) . '</a>';
-	echo '<ul>';
-
-	/* Loop through each navigation item */
-	$counter = 0;
-	foreach( (array)$bp->bp_nav as $nav_item ) {
-		$alt = ( 0 == $counter % 2 ) ? ' class="alt"' : '';
-
-		echo '<li' . $alt . '>';
-		echo '<a id="bp-admin-' . $nav_item['css_id'] . '" href="' . $nav_item['link'] . '">' . $nav_item['name'] . '</a>';
-
-		if ( is_array( $bp->bp_options_nav[$nav_item['slug']] ) ) {
-			echo '<ul>';
-			$sub_counter = 0;
-
-			foreach( (array)$bp->bp_options_nav[$nav_item['slug']] as $subnav_item ) {
-				$link = str_replace( $bp->displayed_user->domain, $bp->loggedin_user->domain, $subnav_item['link'] );
-				$name = str_replace( $bp->displayed_user->userdata->user_login, $bp->loggedin_user->userdata->user_login, $subnav_item['name'] );
-				$alt = ( 0 == $sub_counter % 2 ) ? ' class="alt"' : '';
-				echo '<li' . $alt . '><a id="bp-admin-' . $subnav_item['css_id'] . '" href="' . $link . '">' . $name . '</a></li>';
-				$sub_counter++;
+/**
+ * Add a menu for the root site of this BuddyPress network
+ *
+ * @global type $bp
+ * @global type $wp_admin_bar
+ * @return If in 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()
+				) );
 			}
-			echo '</ul>';
 		}
-
-		echo '</li>';
-
-		$counter++;
 	}
+}
 
-	$alt = ( 0 == $counter % 2 ) ? ' class="alt"' : '';
+/**
+ * Add the "My Sites/[Site Name]" menu and all submenus.
+ */
+function bp_admin_bar_my_sites_menu() {
+	global $wpdb, $wp_admin_bar;
 
-	echo '<li' . $alt . '><a id="bp-admin-logout" class="logout" href="' . wp_logout_url( site_url() ) . '">' . __( 'Log Out', 'buddypress' ) . '</a></li>';
-	echo '</ul>';
-	echo '</li>';
-}
+	/* Add the 'My Sites' menu if the user has more than one site. */
+	if ( count( $wp_admin_bar->user->blogs ) <= 1 )
+		return;
 
-// *** "My Blogs" Menu ********
-function bp_adminbar_blogs_menu() {
-	global $bp;
+	$wp_admin_bar->add_menu( array( 'id' => 'my-blogs', 'title' => __( 'My Sites' ), 'href' => admin_url( 'my-sites.php' ) ) );
 
-	if ( !is_user_logged_in() || !bp_is_active( 'blogs' ) )
-		return false;
+	$default = includes_url( 'images/wpmini-blue.png' );
 
-	if ( !is_multisite() )
-		return false;
+	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"/>';
 
-	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' );
-	}
+		$blogname = empty( $blog->blogname ) ? $blog->domain : $blog->blogname;
 
-	echo '<li id="bp-adminbar-blogs-menu"><a href="' . $bp->loggedin_user->domain . $bp->blogs->slug . '/">';
-
-	_e( 'My Blogs', 'buddypress' );
-
-	echo '</a>';
-	echo '<ul>';
-
-	if ( is_array( $blogs['blogs'] ) && (int)$blogs['count'] ) {
-		$counter = 0;
-		foreach ( (array)$blogs['blogs'] as $blog ) {
-			$alt = ( 0 == $counter % 2 ) ? ' class="alt"' : '';
-			$site_url = esc_attr( $blog->siteurl );
-
-			echo '<li' . $alt . '>';
-			echo '<a href="' . $site_url . '">' . esc_html( $blog->name ) . '</a>';
-			echo '<ul>';
-			echo '<li class="alt"><a href="' . $site_url . 'wp-admin/">' . __( 'Dashboard', 'buddypress' ) . '</a></li>';
-			echo '<li><a href="' . $site_url . 'wp-admin/post-new.php">' . __( 'New Post', 'buddypress' ) . '</a></li>';
-			echo '<li class="alt"><a href="' . $site_url . 'wp-admin/edit.php">' . __( 'Manage Posts', 'buddypress' ) . '</a></li>';
-			echo '<li><a href="' . $site_url . 'wp-admin/edit-comments.php">' . __( 'Manage Comments', 'buddypress' ) . '</a></li>';
-			echo '</ul>';
-			echo '</li>';
-			$counter++;
-		}
-	}
+		$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 ) ) );
 
-	$alt = ( 0 == $counter % 2 ) ? ' class="alt"' : '';
+		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' ) ) );
+		}
 
-	if ( bp_blog_signup_enabled() ) {
-		echo '<li' . $alt . '>';
-		echo '<a href="' . $bp->root_domain . '/' . $bp->blogs->slug . '/create/">' . __( 'Create a Blog!', 'buddypress' ) . '</a>';
-		echo '</li>';
+		$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 ) ) );
 	}
-
-	echo '</ul>';
-	echo '</li>';
 }
 
-function bp_adminbar_thisblog_menu() {
-	if ( current_user_can( 'edit_posts' ) ) {
-		echo '<li id="bp-adminbar-thisblog-menu"><a href="' . admin_url() . '">';
-
-		_e( 'Dashboard', 'buddypress' );
-
-		echo '</a>';
-		echo '<ul>';
+/**
+ * Add edit comments link with awaiting moderation count bubble
+ */
+function bp_admin_bar_comments_menu( $wp_admin_bar ) {
+	global $wp_admin_bar;
 
-		echo '<li class="alt"><a href="' . admin_url() . 'post-new.php">' . __( 'New Post', 'buddypress' ) . '</a></li>';
-		echo '<li><a href="' . admin_url() . 'edit.php">' . __( 'Manage Posts', 'buddypress' ) . '</a></li>';
-		echo '<li class="alt"><a href="' . admin_url() . 'edit-comments.php">' . __( 'Manage Comments', 'buddypress' ) . '</a></li>';
+	if ( !current_user_can( 'edit_posts' ) )
+		return;
 
-		do_action( 'bp_adminbar_thisblog_items' );
+	$awaiting_mod = wp_count_comments();
+	$awaiting_mod = $awaiting_mod->moderated;
 
-		echo '</ul>';
-		echo '</li>';
-	}
+	$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' ) ) );
 }
 
-// **** "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 . '">';
-	_e( 'Notifications', 'buddypress' );
+/**
+ * Add "Appearance" menu with widget and nav menu submenu
+ */
+function bp_admin_bar_appearance_menu() {
+	global $wp_admin_bar;
 
-	if ( $notifications = bp_core_get_notifications_for_user( $bp->loggedin_user->id ) ) { ?>
-		<span><?php echo count( $notifications ) ?></span>
-	<?php
-	}
+	// You can have edit_theme_options but not switch_themes.
+	if ( !current_user_can( 'switch_themes' ) && !current_user_can( 'edit_theme_options' ) )
+		return;
 
-	echo '</a>';
-	echo '<ul>';
+	$wp_admin_bar->add_menu( array( 'parent' => 'dashboard', 'id' => 'appearance', 'title' => __( 'Appearance' ), 'href' => admin_url( 'themes.php' ) ) );
 
-	if ( $notifications ) {
-		$counter = 0;
-		for ( $i = 0; $i < count($notifications); $i++ ) {
-			$alt = ( 0 == $counter % 2 ) ? ' class="alt"' : ''; ?>
+	if ( !current_user_can( 'edit_theme_options' ) )
+		return;
 
-			<li<?php echo $alt ?>><?php echo $notifications[$i] ?></li>
+	if ( current_user_can( 'switch_themes' ) )
+		$wp_admin_bar->add_menu( array( 'parent' => 'appearance', 'id' => 'themes', 'title' => __( 'Themes' ), 'href' => admin_url( 'themes.php' ) ) );
 
-			<?php $counter++;
-		}
-	} else { ?>
+	if ( current_theme_supports( 'widgets' ) )
+		$wp_admin_bar->add_menu( array( 'parent' => 'appearance', 'id' => 'widgets', 'title' => __( 'Widgets' ), 'href' => admin_url( 'widgets.php' ) ) );
 
-		<li><a href="<?php echo $bp->loggedin_user->domain ?>"><?php _e( 'No new notifications.', 'buddypress' ); ?></a></li>
+	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' ) ) );
 
-	<?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' ) ) );
 
-	echo '</ul>';
-	echo '</li>';
+	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' ) ) );
 }
 
-// **** "Blog Authors" Menu (visible when not logged in) ********
-function bp_adminbar_authors_menu() {
-	global $bp, $current_blog, $wpdb;
-
-	// Only for multisite
-	if ( !is_multisite() )
-		return false;
-
-	// Hide on root blog
-	if ( $current_blog->blog_id == BP_ROOT_BLOG || !bp_is_active( 'blogs' ) )
-		return false;
-
-	$blog_prefix = $wpdb->get_blog_prefix( $current_blog->id );
-	$authors     = $wpdb->get_results( "SELECT user_id, user_login, user_nicename, display_name, user_email, meta_value as caps FROM $wpdb->users u, $wpdb->usermeta um WHERE u.ID = um.user_id AND meta_key = '{$blog_prefix}capabilities' ORDER BY um.user_id" );
-
-	if ( !empty( $authors ) ) {
-		// This is a blog, render a menu with links to all authors
-		echo '<li id="bp-adminbar-authors-menu"><a href="/">';
-		_e('Blog Authors', 'buddypress');
-		echo '</a>';
-
-		echo '<ul class="author-list">';
-		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 ' ' . $author->display_name . '</a>';
-			echo '<div class="admin-bar-clear"></div>';
-			echo '</li>';
-		}
-		echo '</ul>';
-		echo '</li>';
-	}
-}
-
-// **** "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>
-		<ul class="random-list">
-			<li><a href="<?php echo $bp->root_domain . '/' . BP_MEMBERS_SLUG . '/?random-member' ?>"><?php _e( 'Random Member', 'buddypress' ) ?></a></li>
-
-			<?php if ( bp_is_active( 'groups' ) ) : ?>
-
-				<li class="alt"><a href="<?php echo $bp->root_domain . '/' . $bp->groups->slug . '/?random-group' ?>"><?php _e( 'Random Group', 'buddypress' ) ?></a></li>
-
-			<?php endif; ?>
+/**
+ * Provide an update link if theme/plugin/core updates are available
+ */
+function bp_admin_bar_updates_menu() {
+	global $wp_admin_bar;
 
-			<?php if ( bp_is_active( 'blogs' ) && is_multisite() ) : ?>
+	if ( !current_user_can( 'install_plugins' ) )
+		return;
 
-				<li><a href="<?php echo $bp->root_domain . '/' . $bp->blogs->slug . '/?random-blog' ?>"><?php _e( 'Random Blog', 'buddypress' ) ?></a></li>
+	$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;
 
-			<?php endif; ?>
+	$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 );
 
-			<?php do_action( 'bp_adminbar_random_menu' ) ?>
+	$update_title = !empty( $update_title ) ? esc_attr( implode( ', ', $update_title ) ) : '';
 
-		</ul>
-	</li>
+	$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>';
 
-	<?php
+	$wp_admin_bar->add_menu( array( 'parent' => 'dashboard', 'id' => 'updates', 'title' => $update_title, 'href' => network_admin_url( 'update-core.php' ) ) );
 }
 
 /**
- * Provides fallback support for the WordPress 3.1 admin bar
- *
- * By default, this function turns off the WP 3.1 admin bar in favor of the classic BP BuddyBar.
- * To turn off the BP BuddyBar in favor of WP's admin bar, place the following in wp-config.php:
- * define( 'BP_USE_WP_ADMIN_BAR', true );
- *
- * @package BuddyPress Core
- * @since 1.2.8
+ * Handle the Admin Bar CSS
  */
-function bp_core_load_admin_bar() {
+function bp_core_load_admin_bar_css() {
 	global $wp_version;
-	
-	if ( defined( 'BP_USE_WP_ADMIN_BAR' ) && BP_USE_WP_ADMIN_BAR && version_compare( $wp_version, 3.1, '>=' ) ) {
-		// TODO: Add BP support to WP admin bar
+
+	if ( !bp_use_wp_admin_bar() )
 		return;
-	} elseif ( !defined( 'BP_DISABLE_ADMIN_BAR' ) || !BP_DISABLE_ADMIN_BAR ) {
-		// Keep the WP admin bar from loading
-		if ( function_exists( 'show_admin_bar' ) )
-			show_admin_bar( false );
-		
-		// Actions used to build the BP admin bar
-		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_blogs_menu',         6   );
-		add_action( 'bp_adminbar_menus', 'bp_adminbar_thisblog_menu',      6   );
-		add_action( 'bp_adminbar_menus', 'bp_adminbar_notifications_menu', 8   );
-		add_action( 'bp_adminbar_menus', 'bp_adminbar_authors_menu',       12  );
-		add_action( 'bp_adminbar_menus', 'bp_adminbar_random_menu',        100 );
-		
-		// Actions used to append BP admin bar to footer
-		add_action( 'wp_footer',    'bp_core_admin_bar', 8 );
-		add_action( 'admin_footer', 'bp_core_admin_bar'    );	
-	}
+
+	// Admin bar styles
+	if ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG )
+		$stylesheet = BP_PLUGIN_URL . '/bp-core/css/admin-bar.dev.css';
+	else
+		$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' );
+
+	if ( !is_rtl() )
+		return;
+
+	if ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG )
+		$stylesheet = BP_PLUGIN_URL . '/bp-core/css/admin-bar-rtl.dev.css';
+	else
+		$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' );
 }
-add_action( 'bp_loaded', 'bp_core_load_admin_bar' );
+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 5b6810a5d563889ae5b9067902ca0399b8a17183..d4bbf30203e68a028838b2324b3e178a246ae052 100644
--- a/wp-content/plugins/buddypress/bp-core/bp-core-avatars.php
+++ b/wp-content/plugins/buddypress/bp-core/bp-core-avatars.php
@@ -1,21 +1,20 @@
 <?php
-/*
- Based on contributions from: Beau Lebens - http://www.dentedreality.com.au/
- Modified for BuddyPress by: Andy Peatling - http://apeatling.wordpress.com/
-*/
+/**
+ * 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
+if ( !defined( 'ABSPATH' ) ) exit;
 
 /***
  * Set up the constants we need for avatar support
  */
 function bp_core_set_avatar_constants() {
 	global $bp;
-
-	if ( !defined( 'BP_AVATAR_UPLOAD_PATH' ) )
-		define( 'BP_AVATAR_UPLOAD_PATH', bp_core_avatar_upload_path() );
-
-	if ( !defined( 'BP_AVATAR_URL' ) )
-		define( 'BP_AVATAR_URL', bp_core_avatar_url() );
-
+	
 	if ( !defined( 'BP_AVATAR_THUMB_WIDTH' ) )
 		define( 'BP_AVATAR_THUMB_WIDTH', 50 );
 
@@ -32,8 +31,8 @@ function bp_core_set_avatar_constants() {
 		define( 'BP_AVATAR_ORIGINAL_MAX_WIDTH', 450 );
 
 	if ( !defined( 'BP_AVATAR_ORIGINAL_MAX_FILESIZE' ) ) {
-		if ( !$bp->site_options['fileupload_maxk'] )
-			define( 'BP_AVATAR_ORIGINAL_MAX_FILESIZE', 5120000 ); /* 5mb */
+		if ( !isset( $bp->site_options['fileupload_maxk'] ) )
+			define( 'BP_AVATAR_ORIGINAL_MAX_FILESIZE', 5120000 ); // 5mb
 		else
 			define( 'BP_AVATAR_ORIGINAL_MAX_FILESIZE', $bp->site_options['fileupload_maxk'] * 1024 );
 	}
@@ -44,7 +43,32 @@ function bp_core_set_avatar_constants() {
 	if ( !defined( 'BP_AVATAR_DEFAULT_THUMB' ) )
 		define( 'BP_AVATAR_DEFAULT_THUMB', BP_PLUGIN_URL . '/bp-core/images/mystery-man-50.jpg' );
 }
-add_action( 'bp_loaded', 'bp_core_set_avatar_constants', 8 );
+add_action( 'bp_init', 'bp_core_set_avatar_constants', 3 );
+
+function bp_core_set_avatar_globals() {
+	global $bp;
+	
+	// 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;
+	
+	// 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();
+	
+	do_action( 'bp_core_set_avatar_globals' );
+}
+add_action( 'bp_setup_globals', 'bp_core_set_avatar_globals' );
 
 /**
  * bp_core_fetch_avatar()
@@ -52,8 +76,8 @@ add_action( 'bp_loaded', 'bp_core_set_avatar_constants', 8 );
  * 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 object $current_blog
+ * @global object $bp Global BuddyPress settings object
+ * @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
  */
@@ -61,25 +85,26 @@ function bp_core_fetch_avatar( $args = '' ) {
 	global $bp, $current_blog;
 
 	// Set a few default variables
-	$def_object		= 'user';
-	$def_type		= 'thumb';
-	$def_class		= 'avatar';
-	$def_alt		= __( 'Avatar Image', 'buddypress' );
+	$def_object = 'user';
+	$def_type   = 'thumb';
+	$def_class  = 'avatar';
+	$def_alt    = __( 'Avatar Image', 'buddypress' );
 
 	// Set the default variables array
 	$defaults = array(
-		'item_id'		=> false,
-		'object'		=> $def_object,	// user/group/blog/custom type (if you use filters)
-		'type'			=> $def_type,	// thumb or full
-		'avatar_dir'	=> false,		// Specify a custom avatar directory for your object
-		'width'			=> false,		// Custom width (int)
-		'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)
-		'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 />
+		'item_id'    => false,
+		'object'     => $def_object, // user/group/blog/custom type (if you use filters)
+		'type'       => $def_type,   // thumb or full
+		'avatar_dir' => false,       // Specify a custom avatar directory for your object
+		'width'      => false,       // Custom width (int)
+		'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)
+		'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 />
+		'title'      => ''           // Custom <img> title (string)
 	);
 
 	// Compare defaults to passed and extract
@@ -90,33 +115,53 @@ function bp_core_fetch_avatar( $args = '' ) {
 	if ( !$item_id ) {
 		if ( 'user' == $object )
 			$item_id = $bp->displayed_user->id;
-		else if ( 'group' == $object )
+		else if ( bp_is_active( 'groups' ) && 'group' == $object )
 			$item_id = $bp->groups->current_group->id;
 		else if ( 'blog' == $object )
 			$item_id = $current_blog->id;
 
 		$item_id = apply_filters( 'bp_core_avatar_item_id', $item_id, $object );
 
-		if ( !$item_id ) return false;
+		if ( !$item_id )
+			return false;
 	}
 
 	// Set avatar_dir if not passed (uses $object)
 	if ( !$avatar_dir ) {
 		if ( 'user' == $object )
 			$avatar_dir = 'avatars';
-		else if ( 'group' == $object )
+		else if ( bp_is_active( 'groups' ) && 'group' == $object )
 			$avatar_dir = 'group-avatars';
 		else if ( 'blog' == $object )
 			$avatar_dir = 'blog-avatars';
 
 		$avatar_dir = apply_filters( 'bp_core_avatar_dir', $avatar_dir, $object );
 
-		if ( !$avatar_dir ) return false;
+		if ( !$avatar_dir )
+			return false;
 	}
 
 	// Add an identifying class to each item
 	$class .= ' ' . $object . '-' . $item_id . '-avatar';
 
+	// Get item name for alt/title tags
+	$item_name = '';
+
+	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' );
+
+	$alt = sprintf( $alt, apply_filters( 'bp_core_avatar_alt', $item_name, $item_id, $object ) );
+
+	// 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 ) ) . "'";
+
 	// Set CSS ID if passed
 	if ( !empty( $css_id ) )
 		$css_id = " id='{$css_id}'";
@@ -125,25 +170,25 @@ function bp_core_fetch_avatar( $args = '' ) {
 	if ( $width )
 		$html_width = " width='{$width}'";
 	else
-		$html_width = ( 'thumb' == $type ) ? ' width="' . BP_AVATAR_THUMB_WIDTH . '"' : ' width="' . BP_AVATAR_FULL_WIDTH . '"';
+		$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}'";
 	else
-		$html_height = ( 'thumb' == $type ) ? ' height="' . BP_AVATAR_THUMB_HEIGHT . '"' : ' height="' . BP_AVATAR_FULL_HEIGHT . '"';
+		$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_AVATAR_URL . '/' . $avatar_dir . '/' . $item_id, $item_id, $object, $avatar_dir );
-	$avatar_folder_dir = apply_filters( 'bp_core_avatar_folder_dir', BP_AVATAR_UPLOAD_PATH . '/' . $avatar_dir . '/' . $item_id, $item_id, $object, $avatar_dir );
+	$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 );
 
 	/****
 	 * Look for uploaded avatar first. Use it if it exists.
 	 * Set the file names to search for, to select the full size
 	 * or thumbnail image.
 	 */
-	$avatar_size = ( 'full' == $type ) ? '-bpfull' : '-bpthumb';
-	$legacy_user_avatar_name = ( 'full' == $type ) ? '-avatar2' : '-avatar1';
+	$avatar_size              = ( 'full' == $type ) ? '-bpfull' : '-bpthumb';
+	$legacy_user_avatar_name  = ( 'full' == $type ) ? '-avatar2' : '-avatar1';
 	$legacy_group_avatar_name = ( 'full' == $type ) ? '-groupavatar-full' : '-groupavatar-thumb';
 
 	// Check for directory
@@ -191,11 +236,11 @@ function bp_core_fetch_avatar( $args = '' ) {
 		closedir( $av_dir );
 
 		// If we found a locally uploaded avatar
-		if ( $avatar_url ) {
+		if ( isset( $avatar_url ) ) {
 
 			// Return it wrapped in an <img> element
 			if ( true === $html ) {
-				return apply_filters( 'bp_core_fetch_avatar', '<img src="' . $avatar_url . '" alt="' . $alt . '" class="' . $class . '"' . $css_id . $html_width . $html_height . ' />', $params, $item_id, $avatar_dir, $css_id, $html_width, $html_height, $avatar_folder_url, $avatar_folder_dir );
+				return apply_filters( 'bp_core_fetch_avatar', '<img src="' . $avatar_url . '" alt="' . esc_attr( $alt ) . '" class="' . esc_attr( $class ) . '"' . $css_id . $html_width . $html_height . $title . ' />', $params, $item_id, $avatar_dir, $css_id, $html_width, $html_height, $avatar_folder_url, $avatar_folder_dir );
 
 			// ...or only the URL
 			} else {
@@ -207,21 +252,21 @@ function bp_core_fetch_avatar( $args = '' ) {
 	// If no avatars could be found, try to display a gravatar
 
 	// Skips gravatar check if $no_grav is passed
-	if ( !$no_grav ) {
+	if ( ! apply_filters( 'bp_core_fetch_avatar_no_grav', $no_grav ) ) {
 
 		// Set gravatar size
 		if ( $width )
 			$grav_size = $width;
 		else if ( 'full' == $type )
-			$grav_size = BP_AVATAR_FULL_WIDTH;
+			$grav_size = bp_core_avatar_full_width();
 		else if ( 'thumb' == $type )
-			$grav_size = BP_AVATAR_THUMB_WIDTH;
+			$grav_size = bp_core_avatar_thumb_width();
 
 		// Set gravatar type
 		if ( empty( $bp->grav_default->{$object} ) )
 			$default_grav = 'wavatar';
 		else if ( 'mystery' == $bp->grav_default->{$object} )
-			$default_grav = apply_filters( 'bp_core_mysteryman_src', BP_AVATAR_DEFAULT, $grav_size );
+			$default_grav = apply_filters( 'bp_core_mysteryman_src', bp_core_avatar_default(), $grav_size );
 		else
 			$default_grav = $bp->grav_default->{$object};
 
@@ -230,7 +275,7 @@ function bp_core_fetch_avatar( $args = '' ) {
 			if ( 'user' == $object ) {
 				$email = bp_core_get_user_email( $item_id );
 			} else if ( 'group' == $object || 'blog' == $object ) {
-				$email = "{$item_id}-{$object}@{$bp->root_domain}";
+				$email = "{$item_id}-{$object}@{bp_get_root_domain()}";
 			}
 		}
 
@@ -241,28 +286,38 @@ function bp_core_fetch_avatar( $args = '' ) {
 			$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;
-
-		// Return gravatar wrapped in <img />
-		if ( true === $html )
-			return apply_filters( 'bp_core_fetch_avatar', '<img src="' . $gravatar . '" alt="' . $alt . '" class="' . $class . '"' . $css_id . $html_width . $html_height . ' />', $params, $item_id, $avatar_dir, $css_id, $html_width, $html_height, $avatar_folder_url, $avatar_folder_dir );
-
-		// ...or only return the gravatar URL
-		else
-			return apply_filters( 'bp_core_fetch_avatar_url', $gravatar );
+		$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;
 
 	} else {
-		return apply_filters( 'bp_core_fetch_avatar', false, $params, $item_id, $avatar_dir, $css_id, $html_width, $html_height, $avatar_folder_url, $avatar_folder_dir );
+		// 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 );
 	}
+
+	if ( true === $html )
+		return apply_filters( 'bp_core_fetch_avatar', '<img src="' . $gravatar . '" alt="' . esc_attr( $alt ) . '" class="' . esc_attr( $class ) . '"' . $css_id . $html_width . $html_height . $title . ' />', $params, $item_id, $avatar_dir, $css_id, $html_width, $html_height, $avatar_folder_url, $avatar_folder_dir );
+	else
+		return apply_filters( 'bp_core_fetch_avatar_url', $gravatar );
 }
 
+/**
+ * Delete an existing avatar
+ *
+ * Accepted values for $args are:
+ *  item_id - item id which relates to the object type.
+ *  object - the objetc type user, group, blog, etc.
+ *  avatar_dir - The directory where the avatars to be uploaded.
+ *
+ * @global object $bp BuddyPress global settings
+ * @param mixed $args
+ * @return bool Success/failure
+ */
 function bp_core_delete_existing_avatar( $args = '' ) {
 	global $bp;
 
 	$defaults = array(
-		'item_id' => false,
-		'object' => 'user', // user OR group OR blog OR custom type (if you use filters)
+		'item_id'    => false,
+		'object'     => 'user', // user OR group OR blog OR custom type (if you use filters)
 		'avatar_dir' => false
 	);
 
@@ -295,7 +350,7 @@ function bp_core_delete_existing_avatar( $args = '' ) {
 		if ( !$avatar_dir ) return false;
 	}
 
-	$avatar_folder_dir = apply_filters( 'bp_core_avatar_folder_dir', BP_AVATAR_UPLOAD_PATH . '/' . $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 );
 
 	if ( !file_exists( $avatar_folder_dir ) )
 		return false;
@@ -315,6 +370,20 @@ function bp_core_delete_existing_avatar( $args = '' ) {
 	return true;
 }
 
+/**
+ * Handles avatar uploading.
+ *
+ * The functions starts off by checking that the file has been uploaded properly using bp_core_check_avatar_upload().
+ * It then checks that the file size is within limits, and that it has an accepted file extension (jpg, gif, png).
+ * If everything checks out, crop the image and move it to its real location.
+ *
+ * @global object $bp BuddyPress global settings
+ * @param array $file The appropriate entry the from $_FILES superglobal.
+ * @param string $upload_dir_filter A filter to be applied to upload_dir
+ * @return bool Success/failure
+ * @see bp_core_check_avatar_upload()
+ * @see bp_core_check_avatar_type()
+ */
 function bp_core_avatar_handle_upload( $file, $upload_dir_filter ) {
 	global $bp;
 
@@ -330,8 +399,8 @@ function bp_core_avatar_handle_upload( $file, $upload_dir_filter ) {
 
 	$uploadErrors = array(
 		0 => __("There is no error, the file uploaded with success", 'buddypress'),
-		1 => __("Your image was bigger than the maximum allowed file size of: ", 'buddypress') . size_format(BP_AVATAR_ORIGINAL_MAX_FILESIZE),
-		2 => __("Your image was bigger than the maximum allowed file size of: ", 'buddypress') . size_format(BP_AVATAR_ORIGINAL_MAX_FILESIZE),
+		1 => __("Your image was bigger than the maximum allowed file size of: ", 'buddypress') . size_format( bp_core_avatar_original_max_filesize() ),
+		2 => __("Your image was bigger than the maximum allowed file size of: ", 'buddypress') . size_format( bp_core_avatar_original_max_filesize() ),
 		3 => __("The uploaded file was only partially uploaded", 'buddypress'),
 		4 => __("No file was uploaded", 'buddypress'),
 		6 => __("Missing a temporary folder", 'buddypress')
@@ -343,7 +412,7 @@ function bp_core_avatar_handle_upload( $file, $upload_dir_filter ) {
 	}
 
 	if ( !bp_core_check_avatar_size( $file ) ) {
-		bp_core_add_message( sprintf( __( 'The file you uploaded is too big. Please upload a file under %s', 'buddypress'), size_format(BP_AVATAR_ORIGINAL_MAX_FILESIZE) ), 'error' );
+		bp_core_add_message( sprintf( __( 'The file you uploaded is too big. Please upload a file under %s', 'buddypress'), size_format( bp_core_avatar_original_max_filesize() ) ), 'error' );
 		return false;
 	}
 
@@ -352,60 +421,83 @@ function bp_core_avatar_handle_upload( $file, $upload_dir_filter ) {
 		return false;
 	}
 
-	/* Filter the upload location */
+	// Filter the upload location
 	add_filter( 'upload_dir', $upload_dir_filter, 10, 0 );
 
 	$bp->avatar_admin->original = wp_handle_upload( $file['file'], array( 'action'=> 'bp_avatar_upload' ) );
 
-	/* Move the file to the correct upload location. */
+	// Move the file to the correct upload location.
 	if ( !empty( $bp->avatar_admin->original['error'] ) ) {
 		bp_core_add_message( sprintf( __( 'Upload Failed! Error was: %s', 'buddypress' ), $bp->avatar_admin->original['error'] ), 'error' );
 		return false;
 	}
 
-	/* Get image size */
+	// Get image size
 	$size = @getimagesize( $bp->avatar_admin->original['file'] );
 
-	/* Check image size and shrink if too large */
-	if ( $size[0] > BP_AVATAR_ORIGINAL_MAX_WIDTH ) {
-		$thumb = wp_create_thumbnail( $bp->avatar_admin->original['file'], BP_AVATAR_ORIGINAL_MAX_WIDTH );
+	// 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() );
 
-		/* Check for thumbnail creation errors */
+		// 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;
 		}
 
-		/* Thumbnail is good so proceed */
+		// Thumbnail is good so proceed
 		$bp->avatar_admin->resized = $thumb;
 	}
 
-	/* We only want to handle one image after resize. */
+	// We only want to handle one image after resize.
 	if ( empty( $bp->avatar_admin->resized ) )
-		$bp->avatar_admin->image->dir = str_replace( BP_AVATAR_UPLOAD_PATH, '', $bp->avatar_admin->original['file'] );
+		$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_AVATAR_UPLOAD_PATH, '', $bp->avatar_admin->resized );
+		$bp->avatar_admin->image->dir = str_replace( bp_core_avatar_upload_path(), '', $bp->avatar_admin->resized );
 		@unlink( $bp->avatar_admin->original['file'] );
 	}
 
-	/* Set the url value for the image */
-	$bp->avatar_admin->image->url = BP_AVATAR_URL . $bp->avatar_admin->image->dir;
+	// Check for WP_Error on what should be an image
+	if ( is_wp_error( $bp->avatar_admin->image->dir ) ) {
+		bp_core_add_message( sprintf( __( 'Upload failed! Error was: %s', 'buddypress' ), $bp->avatar_admin->image->dir->get_error_message() ), 'error' );
+		return false;
+	}
+
+	// Set the url value for the image
+	$bp->avatar_admin->image->url = bp_core_avatar_url() . $bp->avatar_admin->image->dir;
 
 	return true;
 }
 
+/**
+ * Crop an uploaded avatar
+ *
+ * $args has the following parameters:
+ *  object - What component the avatar is for, e.g. "user"
+ *  avatar_dir  The absolute path to the avatar
+ *  item_id - Item ID
+ *  original_file - The absolute path to the original avatar file
+ *  crop_w - Crop width
+ *  crop_h - Crop height
+ *  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',
-		'avatar_dir' => 'avatars',
-		'item_id' => false,
+		'object'        => 'user',
+		'avatar_dir'    => 'avatars',
+		'item_id'       => false,
 		'original_file' => false,
-		'crop_w' => BP_AVATAR_FULL_WIDTH,
-		'crop_h' => BP_AVATAR_FULL_HEIGHT,
-		'crop_x' => 0,
-		'crop_y' => 0
+		'crop_w'        => bp_core_avatar_full_width(),
+		'crop_h'        => bp_core_avatar_full_height(),
+		'crop_x'        => 0,
+		'crop_y'        => 0
 	);
 
 	$r = wp_parse_args( $args, $defaults );
@@ -422,7 +514,7 @@ function bp_core_avatar_handle_crop( $args = '' ) {
 	if ( !$original_file )
 		return false;
 
-	$original_file = BP_AVATAR_UPLOAD_PATH . $original_file;
+	$original_file = bp_core_avatar_upload_path() . $original_file;
 
 	if ( !file_exists( $original_file ) )
 		return false;
@@ -430,7 +522,7 @@ function bp_core_avatar_handle_crop( $args = '' ) {
 	if ( !$item_id )
 		$avatar_folder_dir = apply_filters( 'bp_core_avatar_folder_dir', dirname( $original_file ), $item_id, $object, $avatar_dir );
 	else
-		$avatar_folder_dir = apply_filters( 'bp_core_avatar_folder_dir', BP_AVATAR_UPLOAD_PATH . '/' . $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 );
 
 	if ( !file_exists( $avatar_folder_dir ) )
 		return false;
@@ -438,25 +530,25 @@ function bp_core_avatar_handle_crop( $args = '' ) {
 	require_once( ABSPATH . '/wp-admin/includes/image.php' );
 	require_once( ABSPATH . '/wp-admin/includes/file.php' );
 
-	/* Delete the existing avatar files for the object */
+	// Delete the existing avatar files for the object
 	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 */
+	// Make sure we at least have a width and height for cropping
 	if ( !(int)$crop_w )
-		$crop_w = BP_AVATAR_FULL_WIDTH;
+		$crop_w = bp_core_avatar_full_width();
 
 	if ( !(int)$crop_h )
-		$crop_h = BP_AVATAR_FULL_HEIGHT;
+		$crop_h = bp_core_avatar_full_height();
 
-	/* Set the full and thumb filenames */
-	$full_filename = wp_hash( $original_file . time() ) . '-bpfull.jpg';
+	// Set the full and thumb filenames
+	$full_filename  = wp_hash( $original_file . time() ) . '-bpfull.jpg';
 	$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_AVATAR_FULL_WIDTH, BP_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_AVATAR_THUMB_WIDTH, BP_AVATAR_THUMB_HEIGHT, false, $avatar_folder_dir . '/' . $thumb_filename );
+	// 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 );
 
-	/* Remove the original */
+	// Remove the original
 	@unlink( $original_file );
 
 	return true;
@@ -476,13 +568,13 @@ function bp_core_avatar_handle_crop( $args = '' ) {
  * @param string $alt Alternate text to use in image tag. Defaults to blank
  * @return <type>
  */
-function bp_core_fetch_avatar_filter( $avatar, $user, $size, $default, $alt ) {
+function bp_core_fetch_avatar_filter( $avatar, $user, $size, $default, $alt = '' ) {
 	global $pagenow;
-	
+
 	// Do not filter if inside WordPress options page
 	if ( 'options-discussion.php' == $pagenow )
 		return $avatar;
-	
+
 	// If passed an object, assume $user->user_id
 	if ( is_object( $user ) )
 		$id = $user->user_id;
@@ -492,13 +584,16 @@ function bp_core_fetch_avatar_filter( $avatar, $user, $size, $default, $alt ) {
 		$id = $user;
 
 	// If passed a string and that string returns a user, get the $id
-	else if ( is_string( $user ) && ( $user_by_email = get_user_by_email( $user ) ) )
+	else if ( is_string( $user ) && ( $user_by_email = get_user_by( 'email', $user ) ) )
 		$id = $user_by_email->ID;
 
 	// If somehow $id hasn't been assigned, return the result of get_avatar
 	if ( empty( $id ) )
 		return !empty( $avatar ) ? $avatar : $default;
 
+	if ( !$alt )
+		$alt = __( 'Avatar of %s', 'buddypress' );
+
 	// Let BuddyPress handle the fetching of the avatar
 	$bp_avatar = bp_core_fetch_avatar( array( 'item_id' => $id, 'width' => $size, 'height' => $size, 'alt' => $alt ) );
 
@@ -507,22 +602,42 @@ function bp_core_fetch_avatar_filter( $avatar, $user, $size, $default, $alt ) {
 }
 add_filter( 'get_avatar', 'bp_core_fetch_avatar_filter', 10, 5 );
 
-function bp_core_check_avatar_upload($file) {
-	if ( $file['error'] )
+/**
+ * Has the current avatar upload generated an error?
+ *
+ * @param array $file
+ * @return bool
+ */
+function bp_core_check_avatar_upload( $file ) {
+	if ( isset( $file['error'] ) && $file['error'] )
 		return false;
 
 	return true;
 }
 
-function bp_core_check_avatar_size($file) {
-	if ( $file['file']['size'] > BP_AVATAR_ORIGINAL_MAX_FILESIZE )
+/**
+ * Is the file size of the current avatar upload permitted?
+ *
+ * @param array $file
+ * @return bool
+ */
+function bp_core_check_avatar_size( $file ) {
+	if ( $file['file']['size'] > bp_core_avatar_original_max_filesize() )
 		return false;
 
 	return true;
 }
 
+/**
+ * Does the current avatar upload have an allowed file type?
+ *
+ * Permitted file types are JPG, GIF and PNG.
+ *
+ * @param string $file
+ * @return bool
+ */
 function bp_core_check_avatar_type($file) {
-	if ( ( !empty( $file['file']['type'] ) && !preg_match('/(jpe?g|gif|png)$/', $file['file']['type'] ) ) || !preg_match( '/(jpe?g|gif|png)$/', $file['file']['name'] ) )
+	if ( ( !empty( $file['file']['type'] ) && !preg_match('/(jpe?g|gif|png)$/i', $file['file']['type'] ) ) || !preg_match( '/(jpe?g|gif|png)$/i', $file['file']['name'] ) )
 		return false;
 
 	return true;
@@ -533,21 +648,41 @@ function bp_core_check_avatar_type($file) {
  *
  * Returns the absolute upload path for the WP installation
  *
- * @global object $current_blog Current blog information
  * @uses wp_upload_dir To get upload directory info
  * @return string Absolute path to WP upload directory
  */
 function bp_core_avatar_upload_path() {
-	global $current_blog;
-
-	// Get upload directory information from current site
-	$upload_dir = wp_upload_dir();
-
-	// If multisite, and current blog does not match root blog, make adjustments
-	if ( bp_core_is_multisite() && BP_ROOT_BLOG != $current_blog->blog_id )
-		$upload_dir['basedir'] = get_blog_option( BP_ROOT_BLOG, 'upload_path' );
-
-	return apply_filters( 'bp_core_avatar_upload_path', $upload_dir['basedir'] );
+	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;
+	} else {
+		// If this value has been set in a constant, just use that
+		if ( defined( 'BP_AVATAR_UPLOAD_PATH' ) ) {
+			$basedir = BP_AVATAR_UPLOAD_PATH;
+		} 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'] ) ) {
+				$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' );
+			}
+		}
+		
+		// Stash in $bp for later use
+		$bp->avatar->upload_path = $basedir;
+	}
+	
+	return apply_filters( 'bp_core_avatar_upload_path', $basedir );
 }
 
 /**
@@ -555,21 +690,164 @@ function bp_core_avatar_upload_path() {
  *
  * Returns the raw base URL for root site upload location
  *
- * @global object $current_blog Current blog information
  * @uses wp_upload_dir To get upload directory info
  * @return string Full URL to current upload location
  */
 function bp_core_avatar_url() {
-	global $current_blog;
+	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' ) ) {
+			$baseurl = BP_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 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;
+	}
+
+	return apply_filters( 'bp_core_avatar_url', $baseurl );
+}
+
+/**
+ * Utility function for fetching an avatar dimension setting
+ *
+ * @package BuddyPress
+ * @since 1.5
+ *
+ * @param str $type 'thumb' for thumbs, otherwise full
+ * @param str $h_or_w 'height' for height, otherwise width
+ * @return int $dim The dimension
+ */
+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;
+	
+	return apply_filters( 'bp_core_avatar_dimension', $dim, $type, $h_or_w );
+}
 
-	// Get upload directory information from current site
-	$upload_dir = wp_upload_dir();
+/**
+ * Get the avatar thumb width setting
+ *
+ * @package BuddyPress
+ * @since 1.5
+ *
+ * @return int The thumb width
+ */
+function bp_core_avatar_thumb_width() {
+	return apply_filters( 'bp_core_avatar_thumb_width', bp_core_avatar_dimension( 'thumb', 'width' ) );
+}
 
-	// If multisite, and current blog does not match root blog, make adjustments
-	if ( bp_core_is_multisite() && BP_ROOT_BLOG != $current_blog->blog_id )
-		$upload_dir['baseurl'] = trailingslashit( get_blog_option( BP_ROOT_BLOG, 'home' ) ) . get_blog_option( BP_ROOT_BLOG, 'upload_path' );
+/**
+ * Get the avatar thumb height setting
+ *
+ * @package BuddyPress
+ * @since 1.5
+ *
+ * @return int The thumb height
+ */
+function bp_core_avatar_thumb_height() {
+	return apply_filters( 'bp_core_avatar_thumb_height', bp_core_avatar_dimension( 'thumb', 'height' ) );
+}
 
-	return apply_filters( 'bp_core_avatar_url', $upload_dir['baseurl'] );
+/**
+ * Get the avatar full width setting
+ *
+ * @package BuddyPress
+ * @since 1.5
+ *
+ * @return int The full width
+ */
+function bp_core_avatar_full_width() {
+	return apply_filters( 'bp_core_avatar_full_width', bp_core_avatar_dimension( 'full', 'width' ) );
 }
 
+/**
+ * Get the avatar full height setting
+ *
+ * @package BuddyPress
+ * @since 1.5
+ *
+ * @return int The full height
+ */
+function bp_core_avatar_full_height() {
+	return apply_filters( 'bp_core_avatar_full_height', bp_core_avatar_dimension( 'full', 'height' ) );
+}
+
+/**
+ * Get the max width for original avatar uploads
+ *
+ * @package BuddyPress
+ * @since 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 );
+}
+
+/**
+ * Get the max filesize for original avatar uploads
+ *
+ * @package BuddyPress
+ * @since 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 );
+}
+
+/**
+ * Get the default avatar
+ *
+ * @package BuddyPress
+ * @since 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 );
+}
+
+/**
+ * Get the default avatar thumb
+ *
+ * @package BuddyPress
+ * @since 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 );
+}
+
+
 ?>
\ No newline at end of file
diff --git a/wp-content/plugins/buddypress/bp-core/bp-core-buddybar.php b/wp-content/plugins/buddypress/bp-core/bp-core-buddybar.php
new file mode 100644
index 0000000000000000000000000000000000000000..0cd1b0ba23d4d19e26ab17cbee04cbf4001d4b5a
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-core/bp-core-buddybar.php
@@ -0,0 +1,627 @@
+<?php
+// Exit if accessed directly
+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
+ */
+function bp_core_new_nav_item( $args = '' ) {
+	global $bp;
+
+	$defaults = array(
+		'name'                    => false, // Display name for the nav item
+		'slug'                    => false, // URL slug for the nav item
+		'item_css_id'             => false, // The CSS ID to apply to the HTML of the nav item
+		'show_for_displayed_user' => true,  // When viewing another user does this nav item show up?
+		'site_admin_only'         => false, // Can only site admins see this nav item?
+		'position'                => 99,    // Index of where this nav item should be positioned
+		'screen_function'         => false, // The name of the function to run when clicked
+		'default_subnav_slug'     => false  // The slug of the default subnav item to select when clicked
+	);
+
+	$r = wp_parse_args( $args, $defaults );
+	extract( $r, EXTR_SKIP );
+
+	// If we don't have the required info we need, don't create this subnav item
+	if ( empty( $name ) || empty( $slug ) )
+		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() )
+		return false;
+
+	if ( empty( $item_css_id ) )
+		$item_css_id = $slug;
+
+	$bp->bp_nav[$slug] = array(
+		'name'                    => $name,
+		'slug'                    => $slug,
+		'link'                    => $bp->loggedin_user->domain . $slug . '/',
+		'css_id'                  => $item_css_id,
+		'show_for_displayed_user' => $show_for_displayed_user,
+		'position'                => $position,
+		'screen_function'         => &$screen_function
+	);
+
+ 	/***
+	 * 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() )
+		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.
+ 	 */
+	if ( ( -1 != $position ) && bp_is_root_component( $slug ) && !bp_displayed_user_id() )
+		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 );
+	}
+
+	do_action( 'bp_core_new_nav_item', $r, $args, $defaults );
+}
+
+/**
+ * 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
+ */
+function bp_core_new_nav_default( $args = '' ) {
+	global $bp;
+
+	$defaults = array(
+		'parent_slug'     => false, // Slug of the parent
+		'screen_function' => false, // The name of the function to run when clicked
+		'subnav_slug'     => false  // The slug of the subnav item to select when clicked
+	);
+
+	$r = wp_parse_args( $args, $defaults );
+	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
+			remove_action( 'bp_screens', array( &$function[0], $function[1] ), 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 ( $subnav_slug )
+			$bp->current_action = $subnav_slug;
+	}
+}
+
+/**
+ * We can only sort nav items by their position integer at a later point in time, once all
+ * plugins have registered their navigation items.
+ *
+ * @package BuddyPress Core
+ * @global object $bp Global BuddyPress settings object
+ */
+function bp_core_sort_nav_items() {
+	global $bp;
+
+	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[$nav_item['position']] = $nav_item;
+		else {
+			// increase numbers here to fit new items in.
+			do {
+				$nav_item['position']++;
+			} while ( !empty( $temp[$nav_item['position']] ) );
+
+			$temp[$nav_item['position']] = $nav_item;
+		}
+	}
+
+	ksort( $temp );
+	$bp->bp_nav = &$temp;
+}
+add_action( 'wp_head',    'bp_core_sort_nav_items' );
+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
+ */
+function bp_core_new_subnav_item( $args = '' ) {
+	global $bp;
+
+	$defaults = array(
+		'name'            => false, // Display name for the nav item
+		'slug'            => false, // URL slug for the nav item
+		'parent_slug'     => false, // URL slug of the parent nav item
+		'parent_url'      => false, // URL of the parent item
+		'item_css_id'     => false, // The CSS ID to apply to the HTML of the nav item
+		'user_has_access' => true,  // Can the logged in user see this nav item?
+		'site_admin_only' => false, // Can only site admins see this nav item?
+		'position'        => 90,    // Index of where this nav item should be positioned
+		'screen_function' => false, // The name of the function to run when clicked
+		'link'            => ''     // The link for the subnav item; optional, not usually required.
+	);
+
+	$r = wp_parse_args( $args, $defaults );
+	extract( $r, EXTR_SKIP );
+
+	// If we don't have the required info we need, don't create this subnav item
+	if ( empty( $name ) || empty( $slug ) || empty( $parent_slug ) || empty( $parent_url ) || empty( $screen_function ) )
+		return false;
+
+	if ( empty( $link ) )
+		$link = $parent_url . $slug;
+
+	// 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() )
+		return false;
+
+	if ( empty( $item_css_id ) )
+		$item_css_id = $slug;
+
+	$bp->bp_options_nav[$parent_slug][$slug] = array(
+		'name'            => $name,
+		'link'            => trailingslashit( $link ),
+		'slug'            => $slug,
+		'css_id'          => $item_css_id,
+		'position'        => $position,
+		'user_has_access' => $user_has_access,
+		'screen_function' => &$screen_function
+	);
+
+	/**
+	 * The last step is to hook the screen function for the added subnav item. But this only
+	 * needs to be done if this subnav item is the current view, and the user has access to the
+	 * 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
+	 *   (2) And either:
+	 * 	 (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
+	 *	     parent nav item in $bp->bp_nav). This condition only arises when viewing a
+	 *	     user, since groups should always have an action set.
+	 */
+
+	// If we *don't* meet condition (1), return
+	if ( $bp->current_component != $parent_slug && $bp->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'] ) ) {
+
+		// 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] ) );
+		} else {
+			// 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() ) {
+				// 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(),
+					'redirect' => false
+				) );
+			} else {
+				// Not logged in. Allow the user to log in, and attempt to redirect
+				bp_core_no_access();
+			}
+		}
+	}
+}
+
+function bp_core_sort_subnav_items() {
+	global $bp;
+
+	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 ) {
+		if ( !is_array( $subnav_items ) )
+			continue;
+
+		foreach ( (array)$subnav_items as $subnav_item ) {
+			if ( empty( $temp[$subnav_item['position']]) )
+				$temp[$subnav_item['position']] = $subnav_item;
+			else {
+				// increase numbers here to fit new items in.
+				do {
+					$subnav_item['position']++;
+				} while ( !empty( $temp[$subnav_item['position']] ) );
+
+				$temp[$subnav_item['position']] = $subnav_item;
+			}
+		}
+		ksort( $temp );
+		$bp->bp_options_nav[$parent_slug] = &$temp;
+		unset( $temp );
+	}
+}
+add_action( 'wp_head',    'bp_core_sort_subnav_items' );
+add_action( 'admin_head', 'bp_core_sort_subnav_items' );
+
+/**
+ * Determines whether a given nav item has subnav items
+ *
+ * @package BuddyPress
+ * @since 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
+ */
+function bp_nav_item_has_subnav( $nav_item = '' ) {
+	global $bp;
+
+	if ( !$nav_item )
+		$nav_item = bp_current_component();
+
+	$has_subnav = isset( $bp->bp_options_nav[$nav_item] ) && count( $bp->bp_options_nav[$nav_item] ) > 0;
+
+	return apply_filters( 'bp_nav_item_has_subnav', $has_subnav, $nav_item );
+}
+
+/**
+ * Removes a navigation item from the sub navigation array used in BuddyPress themes.
+ *
+ * @package BuddyPress Core
+ * @param $parent_id The id of the parent navigation item.
+ * @param $slug The slug of the sub navigation item.
+ */
+function bp_core_remove_nav_item( $parent_id ) {
+	global $bp;
+
+	// 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 ) {
+			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 );
+		} else {
+			remove_action( 'bp_screens', array( &$function[0], $function[1] ) );
+		}
+	}
+
+	unset( $bp->bp_nav[$parent_id] );
+}
+
+/**
+ * Removes a navigation item from the sub navigation array used in BuddyPress themes.
+ *
+ * @package BuddyPress Core
+ * @param $parent_id The id of the parent navigation item.
+ * @param $slug The slug of the sub navigation item.
+ */
+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;
+
+	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] ) );
+	}
+
+	unset( $bp->bp_options_nav[$parent_id][$slug] );
+
+	if ( isset( $bp->bp_options_nav[$parent_id] ) && !count( $bp->bp_options_nav[$parent_id] ) )
+		unset($bp->bp_options_nav[$parent_id]);
+}
+
+/**
+ * Clear the subnav items for a specific nav item.
+ *
+ * @package BuddyPress Core
+ * @param $parent_id The id of the parent navigation item.
+ * @global object $bp Global BuddyPress settings object
+ */
+function bp_core_reset_subnav_items( $parent_slug ) {
+	global $bp;
+
+	unset( $bp->bp_options_nav[$parent_slug] );
+}
+
+/** Template functions ********************************************************/
+
+function bp_core_admin_bar() {
+	global $bp;
+
+	if ( defined( 'BP_DISABLE_ADMIN_BAR' ) && BP_DISABLE_ADMIN_BAR )
+		return false;
+
+	if ( (int)bp_get_option( 'hide-loggedout-adminbar' ) && !is_user_logged_in() )
+		return false;
+
+	$bp->doing_admin_bar = true;
+
+	echo '<div id="wp-admin-bar"><div class="padder">';
+
+	// **** Do bp-adminbar-logo Actions ********
+	do_action( 'bp_adminbar_logo' );
+
+	echo '<ul class="main-nav">';
+
+	// **** Do bp-adminbar-menus Actions ********
+	do_action( 'bp_adminbar_menus' );
+
+	echo '</ul>';
+	echo "</div></div><!-- #wp-admin-bar -->\n\n";
+
+	$bp->doing_admin_bar = false;
+}
+
+// **** Default BuddyPress admin bar 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>';
+
+	// Show "Sign Up" link if user registrations are allowed
+	if ( bp_get_signup_allowed() )
+		echo '<li class="bp-signup no-arrow"><a href="' . bp_get_signup_page(false) . '">' . __( 'Sign Up', 'buddypress' ) . '</a></li>';
+}
+
+
+// **** "My Account" Menu ******
+function bp_adminbar_account_menu() {
+	global $bp;
+
+	if ( !$bp->bp_nav || !is_user_logged_in() )
+		return false;
+
+	echo '<li id="bp-adminbar-account-menu"><a href="' . bp_loggedin_user_domain() . '">';
+	echo __( 'My Account', 'buddypress' ) . '</a>';
+	echo '<ul>';
+
+	// Loop through each navigation item
+	$counter = 0;
+	foreach( (array)$bp->bp_nav as $nav_item ) {
+		$alt = ( 0 == $counter % 2 ) ? ' class="alt"' : '';
+
+		if ( -1 == $nav_item['position'] )
+			continue;
+
+		echo '<li' . $alt . '>';
+		echo '<a id="bp-admin-' . $nav_item['css_id'] . '" href="' . $nav_item['link'] . '">' . $nav_item['name'] . '</a>';
+
+		if ( isset( $bp->bp_options_nav[$nav_item['slug']] ) && is_array( $bp->bp_options_nav[$nav_item['slug']] ) ) {
+			echo '<ul>';
+			$sub_counter = 0;
+
+			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 ( 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'] );
+
+				$alt = ( 0 == $sub_counter % 2 ) ? ' class="alt"' : '';
+				echo '<li' . $alt . '><a id="bp-admin-' . $subnav_item['css_id'] . '" href="' . $link . '">' . $name . '</a></li>';
+				$sub_counter++;
+			}
+			echo '</ul>';
+		}
+
+		echo '</li>';
+
+		$counter++;
+	}
+
+	$alt = ( 0 == $counter % 2 ) ? ' class="alt"' : '';
+
+	echo '<li' . $alt . '><a id="bp-admin-logout" class="logout" href="' . wp_logout_url( home_url() ) . '">' . __( 'Log Out', 'buddypress' ) . '</a></li>';
+	echo '</ul>';
+	echo '</li>';
+}
+
+function bp_adminbar_thisblog_menu() {
+	if ( current_user_can( 'edit_posts' ) ) {
+		echo '<li id="bp-adminbar-thisblog-menu"><a href="' . admin_url() . '">';
+		_e( 'Dashboard', 'buddypress' );
+		echo '</a>';
+		echo '<ul>';
+
+		echo '<li class="alt"><a href="' . admin_url() . 'post-new.php">' . __( 'New Post', 'buddypress' ) . '</a></li>';
+		echo '<li><a href="' . admin_url() . 'edit.php">' . __( 'Manage Posts', 'buddypress' ) . '</a></li>';
+		echo '<li class="alt"><a href="' . admin_url() . 'edit-comments.php">' . __( 'Manage Comments', 'buddypress' ) . '</a></li>';
+
+		do_action( 'bp_adminbar_thisblog_items' );
+
+		echo '</ul>';
+		echo '</li>';
+	}
+}
+
+
+// **** "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>
+		<ul class="random-list">
+			<li><a href="<?php echo trailingslashit( bp_get_root_domain() . '/' . bp_get_members_root_slug() ) . '?random-member' ?>" rel="nofollow"><?php _e( 'Random Member', 'buddypress' ) ?></a></li>
+
+			<?php if ( bp_is_active( 'groups' ) ) : ?>
+
+				<li class="alt"><a href="<?php echo trailingslashit( bp_get_root_domain() . '/' . bp_get_groups_root_slug() ) . '?random-group' ?>"  rel="nofollow"><?php _e( 'Random Group', 'buddypress' ) ?></a></li>
+
+			<?php endif; ?>
+
+			<?php if ( is_multisite() && bp_is_active( 'blogs' ) ) : ?>
+
+				<li><a href="<?php echo trailingslashit( bp_get_root_domain() . '/' . bp_get_blogs_root_slug() ) . '?random-blog' ?>"  rel="nofollow"><?php _e( 'Random Site', 'buddypress' ) ?></a></li>
+
+			<?php endif; ?>
+
+			<?php do_action( 'bp_adminbar_random_menu' ) ?>
+
+		</ul>
+	</li>
+
+	<?php
+}
+
+/**
+ * Retrieve the admin bar 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
+ *
+ * @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.
+ */
+function bp_get_admin_bar_pref( $context, $user = 0 ) {
+	$pref = get_user_option( "show_admin_bar_{$context}", $user );
+	if ( false === $pref )
+		return true;
+
+	return 'true' === $pref;
+}
+
+/**
+ * Handle the Admin Bar/BuddyBar business
+ *
+ * @since 1.2.0
+ *
+ * @global string $wp_version
+ * @uses bp_get_option()
+ * @uses is_user_logged_in()
+ * @uses bp_use_wp_admin_bar()
+ * @uses show_admin_bar()
+ * @uses add_action() To hook 'bp_adminbar_logo' to 'bp_adminbar_logo'
+ * @uses add_action() To hook 'bp_adminbar_login_menu' to 'bp_adminbar_menus'
+ * @uses add_action() To hook 'bp_adminbar_account_menu' to 'bp_adminbar_menus'
+ * @uses add_action() To hook 'bp_adminbar_thisblog_menu' to 'bp_adminbar_menus'
+ * @uses add_action() To hook 'bp_adminbar_random_menu' to 'bp_adminbar_menus'
+ * @uses add_action() To hook 'bp_core_admin_bar' to 'wp_footer'
+ * @uses add_action() To hook 'bp_core_admin_bar' to 'admin_footer'
+ */
+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() )
+		return;
+
+	// Show the WordPress admin bar
+	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() ) )
+			return;
+
+		show_admin_bar( true );
+
+	// Hide the WordPress admin bar
+	} elseif ( !bp_use_wp_admin_bar() ) {
+
+		// Keep the WP admin bar from loading
+		show_admin_bar( false );
+
+		// Actions used to build the BP admin bar
+		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
+		add_action( 'wp_footer',    'bp_core_admin_bar', 8 );
+		add_action( 'admin_footer', 'bp_core_admin_bar'    );
+	}
+}
+
+/**
+ * Handle the BuddyBar CSS
+ */
+function bp_core_load_buddybar_css() {
+	if ( bp_use_wp_admin_bar() || ( (int) bp_get_option( 'hide-loggedout-adminbar' ) && !is_user_logged_in() ) || ( defined( 'BP_DISABLE_ADMIN_BAR' ) && BP_DISABLE_ADMIN_BAR ) )
+		return;
+
+	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';
+	else
+		$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' );
+
+	if ( !is_rtl() )
+		return;
+
+	if ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG )
+		$stylesheet = BP_PLUGIN_URL . '/bp-core/css/buddybar-rtl.dev.css';
+	else
+		$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' );
+}
+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
new file mode 100644
index 0000000000000000000000000000000000000000..0c30cb1c1b020b10d87a98e39b1d3d76e5f4264f
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-core/bp-core-cache.php
@@ -0,0 +1,51 @@
+<?php
+/**
+ * Caching functions handle the clearing of cached objects and pages on specific
+ * actions throughout BuddyPress.
+ */
+
+// Exit if accessed directly
+if ( !defined( 'ABSPATH' ) ) exit;
+
+/**
+ * REQUIRES WP-SUPER-CACHE
+ *
+ * When wp-super-cache is installed this function will clear cached pages
+ * so that success/error messages are not cached, or time sensitive content.
+ *
+ * @package BuddyPress Core
+ */
+function bp_core_clear_cache() {
+	global $cache_path, $cache_filename;
+
+	if ( function_exists( 'prune_super_cache' ) ) {
+		do_action( 'bp_core_clear_cache' );
+		return prune_super_cache( $cache_path, true );
+	}
+}
+
+/**
+ * Add's 'bp' to global group of network wide cachable objects
+ *
+ * @package BuddyPress Core
+ */
+function bp_core_add_global_group() {
+	wp_cache_init();
+	wp_cache_add_global_groups( array( 'bp' ) );
+}
+add_action( 'bp_loaded', 'bp_core_add_global_group' );
+
+/**
+ * Clears all cached objects for a user, or a user is part of.
+ *
+ * @package BuddyPress Core
+ */
+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' );
+
+?>
\ No newline at end of file
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 7678e3d8eaf4f9ebe180b759c1780e989ddc1f78..0dbcb46fa53ce7891ed9d29ea55910613ae237f7 100644
--- a/wp-content/plugins/buddypress/bp-core/bp-core-catchuri.php
+++ b/wp-content/plugins/buddypress/bp-core/bp-core-catchuri.php
@@ -1,41 +1,48 @@
 <?php
+// 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/
 */
 
 /**
- * bp_core_set_uri_globals()
- *
  * 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.
  *
+ * @package BuddyPress Core
+ * @since BuddyPress (r100)
+ *
  * The URI's are broken down as follows:
  *   - http:// domain.com / members / andy / [current_component] / [current_action] / [action_variables] / [action_variables] / ...
  *   - OUTSIDE ROOT: http:// domain.com / sites / buddypress / members / andy / [current_component] / [current_action] / [action_variables] / [action_variables] / ...
  *
  *	Example:
  *    - http://domain.com/members/andy/profile/edit/group/5/
- *    - $bp->current_component: string 'profile'
+ *    - $bp->current_component: string 'xprofile'
  *    - $bp->current_action: string 'edit'
  *    - $bp->action_variables: array ['group', 5]
  *
- * @package BuddyPress Core
  */
 function bp_core_set_uri_globals() {
-	global $current_component, $current_action, $action_variables;
-	global $displayed_user_id;
-	global $is_member_page;
-	global $bp_unfiltered_uri;
-	global $bp, $current_blog;
+	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 = '';
 
-	// Only catch URI's on the root blog if we are not running BP on multiple blogs
-	if ( !defined( 'BP_ENABLE_MULTIBLOG' ) && bp_core_is_multisite() )
-		if ( BP_ROOT_BLOG != (int) $current_blog->blog_id )
-			return false;
+	// Don't catch URIs on non-root blogs unless multiblog mode is on
+	if ( !bp_is_root_blog() && !bp_is_multiblog_mode() )
+		return false;
+
+	// 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' ) )
@@ -43,12 +50,12 @@ function bp_core_set_uri_globals() {
 	else
 		$path = esc_url( $_SERVER['REQUEST_URI'] );
 
+	// 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
-	$noget = substr( $path, 0, strpos( $path, '?' ) );
-	if ( $noget != '' )
+	if ( $noget = substr( $path, 0, strpos( $path, '?' ) ) )
 		$path = $noget;
 
 	// Fetch the current URI and explode each part separated by '/' into an array
@@ -59,7 +66,7 @@ function bp_core_set_uri_globals() {
 		if ( empty( $bp_uri[$key] ) ) unset( $bp_uri[$key] );
 
 	// Running off blog other than root
-	if ( defined( 'BP_ENABLE_MULTIBLOG' ) || 1 != BP_ROOT_BLOG ) {
+	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,
@@ -69,8 +76,9 @@ function bp_core_set_uri_globals() {
 			foreach( $chunks as $key => $chunk ) {
 				$bkey = array_search( $chunk, $bp_uri );
 
-				if ( $bkey !== false )
+				if ( $bkey !== false ) {
 					unset( $bp_uri[$bkey] );
+				}
 
 				$bp_uri = array_values( $bp_uri );
 			}
@@ -81,221 +89,378 @@ function bp_core_set_uri_globals() {
 	$component_index = 0;
 	$action_index    = $component_index + 1;
 
-	// If this is a WordPress page, return from the function.
-	if ( is_page( $bp_uri[$component_index] ) )
-		return false;
-
 	// Get site path items
 	$paths = explode( '/', bp_core_get_site_path() );
 
 	// Take empties off the end of path
-	if ( empty( $paths[count($paths) - 1] ) )
+	if ( empty( $paths[count( $paths ) - 1] ) )
 		array_pop( $paths );
 
 	// Take empties off the start of path
 	if ( empty( $paths[0] ) )
 		array_shift( $paths );
 
-	foreach ( (array)$bp_uri as $key => $uri_chunk )
-		if ( in_array( $uri_chunk, $paths ))
+	// Unset URI indices if they intersect with the paths
+	foreach ( (array) $bp_uri as $key => $uri_chunk ) {
+		if ( in_array( $uri_chunk, $paths ) ) {
 			unset( $bp_uri[$key] );
+		}
+	}
 
 	// Reset the keys by merging with an empty array
-	$bp_uri            = array_merge( array(), $bp_uri );
+	$bp_uri = array_merge( array(), $bp_uri );
+
+	// 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'] ) ) {
+		$post = get_post( get_option( 'page_on_front' ) );
+		if ( !empty( $post ) ) {
+			$bp_uri[0] = $post->post_name;
+		}
+	}
+
+	// Keep the unfiltered URI safe
 	$bp_unfiltered_uri = $bp_uri;
 
-	// If we are under anything with a members slug, set the correct globals
-	if ( $bp_uri[0] == BP_MEMBERS_SLUG ) {
-		$is_member_page    = true;
-		$is_root_component = true;
+	// Get slugs of pages into array
+	foreach ( (array) $bp->pages as $page_key => $bp_page )
+		$key_slugs[$page_key] = trailingslashit( '/' . $bp_page->slug );
+
+	// Bail if keyslugs are empty, as BP is not setup correct
+	if ( empty( $key_slugs ) )
+		return;
+
+	// Loop through page slugs and look for exact match to path
+	foreach ( $key_slugs as $key => $slug ) {
+		if ( $slug == $path ) {
+			$match      = $bp->pages->{$key};
+			$match->key = $key;
+			$matches[]  = 1;
+			break;
+		}
 	}
 
-	// Catch a member page and set the current member ID
-	if ( !defined( 'BP_ENABLE_ROOT_PROFILES' ) ) {
-		if ( ( $bp_uri[0] == BP_MEMBERS_SLUG && !empty( $bp_uri[1] ) ) || in_array( 'wp-load.php', $bp_uri ) ) {
-			// We are within a member page, set up user id globals
-			if ( defined( 'BP_ENABLE_USERNAME_COMPATIBILITY_MODE' ) )
-				$displayed_user_id = bp_core_get_userid( urldecode( $bp_uri[1] ) );
-			else
-				$displayed_user_id = bp_core_get_userid_from_nicename( urldecode( $bp_uri[1] ) );
+	// No exact match, so look for partials
+	if ( empty( $match ) ) {
+
+		// Loop through each page in the $bp->pages global
+		foreach ( (array) $bp->pages as $page_key => $bp_page ) {
+
+			// Look for a match (check members first)
+			if ( in_array( $bp_page->name, (array) $bp_uri ) ) {
+
+				// Match found, now match the slug to make sure.
+				$uri_chunks = explode( '/', $bp_page->slug );
+
+				// Loop through uri_chunks
+				foreach ( (array) $uri_chunks as $key => $uri_chunk ) {
+
+					// Make sure chunk is in the correct position
+					if ( !empty( $bp_uri[$key] ) && ( $bp_uri[$key] == $uri_chunk ) ) {
+						$matches[] = 1;
+
+					// No match
+					} else {
+						$matches[] = 0;
+					}
+				}
+
+				// Have a match
+				if ( !in_array( 0, (array) $matches ) ) {
+					$match      = $bp_page;
+					$match->key = $page_key;
+					break;
+				};
 
-			unset( $bp_uri[0] );
-			unset( $bp_uri[1] );
+				// Unset matches
+				unset( $matches );
+			}
 
-			// Reset the keys by merging with an empty array
-			$bp_uri = array_merge( array(), $bp_uri );
+			// Unset uri chunks
+			unset( $uri_chunks );
 		}
-	} else {
-		if ( get_userdatabylogin( $bp_uri[0] ) || in_array( 'wp-load.php', $bp_uri ) ) {
-			$is_member_page    = true;
-			$is_root_component = true;
+	}
+
+	// URLs with BP_ENABLE_ROOT_PROFILES enabled won't be caught above
+	if ( empty( $matches ) && defined( 'BP_ENABLE_ROOT_PROFILES' ) && BP_ENABLE_ROOT_PROFILES ) {
 
-			// We are within a member page, set up user id globals
-			if ( defined( 'BP_ENABLE_USERNAME_COMPATIBILITY_MODE' ) )
-				$displayed_user_id = bp_core_get_userid( urldecode( $bp_uri[0] ) );
-			else
-				$displayed_user_id = bp_core_get_userid_from_nicename( urldecode( $bp_uri[0] ) );
+		// 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] ) ) {
 
-			unset( $bp_uri[0] );
+			// Force BP to recognize that this is a members page
+			$matches[]  = 1;
+			$match      = $bp->pages->members;
+			$match->key = 'members';
 
-			// Reset the keys by merging with an empty array
-			$bp_uri = array_merge( array(), $bp_uri );
+			// Without the 'members' URL chunk, WordPress won't know which page to load
+			// This filter intercepts the WP query and tells it to load the members page
+			add_filter( 'request', create_function( '$query_args', '$query_args["pagename"] = "' . $match->name . '"; return $query_args;' ) );
 		}
 	}
 
-	if ( !isset( $is_root_component ) )
-		$is_root_component = in_array( $bp_uri[0], $bp->root_components );
+	// Search doesn't have an associated page, so we check for it separately
+	if ( !empty( $bp_uri[0] ) && ( bp_get_search_slug() == $bp_uri[0] ) ) {
+		$matches[]   = 1;
+		$match       = new stdClass;
+		$match->key  = 'search';
+		$match->slug = bp_get_search_slug();
+	}
+
+	// This is not a BuddyPress page, so just return.
+	if ( !isset( $matches ) )
+		return 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;
 
-	if ( !is_subdomain_install() && !$is_root_component ) {
-		$component_index++;
-		$action_index++;
+	// Rejig the offset
+	if ( !empty( $slug ) && ( 1 < count( $slug ) ) ) {
+		array_pop( $slug );
+		$uri_offset = count( $slug );
 	}
 
-	// Set the current component
-	$current_component = $bp_uri[$component_index];
+	// 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;
+
+	// We have an exact match
+	if ( isset( $match->key ) ) {
+
+		// Set current component to matched key
+		$bp->current_component = $match->key;
+
+		// If members component, do more work to find the actual component
+		if ( 'members' == $match->key ) {
+
+			// Viewing a specific user
+			if ( !empty( $bp_uri[$uri_offset + 1] ) ) {
+
+				// Switch the displayed_user based on compatbility mode
+				if ( bp_is_username_compatibility_mode() )
+					$bp->displayed_user->id = (int) bp_core_get_userid( urldecode( $bp_uri[$uri_offset + 1] ) );
+				else
+					$bp->displayed_user->id = (int) bp_core_get_userid_from_nicename( urldecode( $bp_uri[$uri_offset + 1] ) );
+
+				if ( empty( $bp->displayed_user->id ) ) {
+					// Prevent components from loading their templates
+					$bp->current_component = '';
+
+					bp_do_404();
+					return;
+				}
+
+				// 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' );
+					} else {
+						bp_do_404();
+						return;
+					}
+				}
+
+				// Bump the offset
+				if ( isset( $bp_uri[$uri_offset + 2] ) ) {
+					$bp_uri                = array_merge( array(), array_slice( $bp_uri, $uri_offset + 2 ) );
+					$bp->current_component = $bp_uri[0];
+
+				// No component, so default will be picked later
+				} else {
+					$bp_uri                = array_merge( array(), array_slice( $bp_uri, $uri_offset + 2 ) );
+					$bp->current_component = '';
+				}
+
+				// Reset the offset
+				$uri_offset = 0;
+			}
+		}
+	}
 
 	// Set the current action
-	$current_action    = $bp_uri[$action_index];
+	$bp->current_action = isset( $bp_uri[$uri_offset + 1] ) ? $bp_uri[$uri_offset + 1] : '';
 
-	// Set the entire URI as the action variables, we will unset the current_component and action in a second
-	$action_variables  = $bp_uri;
+	// Slice the rest of the $bp_uri array and reset offset
+	$bp_uri      = array_slice( $bp_uri, $uri_offset + 2 );
+	$uri_offset  = 0;
 
-	// Unset the current_component and action from action_variables
-	unset( $action_variables[$component_index] );
-	unset( $action_variables[$action_index] );
+	// 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
-	if ( !is_subdomain_install() && !$is_root_component )
-		array_shift( $action_variables );
+	// @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
-	$action_variables = array_merge( array(), $action_variables );
+	$bp->action_variables = array_merge( array(), $bp->action_variables );
 }
-add_action( 'bp_loaded', 'bp_core_set_uri_globals', 4 );
 
 /**
- * bp_catch_uri()
+ * bp_core_load_template()
  *
- * Takes either a single page name or array of page names and
- * loads the first template file that can be found.
+ * Load a specific template file with fallback support.
  *
- * Please don't call this function directly anymore, use: bp_core_load_template()
+ * Example:
+ *   bp_core_load_template( 'members/index' );
+ * Loads:
+ *   wp-content/themes/[activated_theme]/members/index.php
  *
  * @package BuddyPress Core
- * @global $bp_path BuddyPress global containing the template file names to use.
- * @param $pages Template file names to use.
- * @uses add_action() Hooks a function on to a specific action
+ * @param $username str Username to check.
+ * @return false|int The user ID of the matched user, or false.
  */
-function bp_catch_uri( $pages, $skip_blog_check = false ) {
-	global $bp_path, $bp_skip_blog_check;
+function bp_core_load_template( $templates ) {
+	global $post, $bp, $wpdb, $wp_query, $bp_unfiltered_uri, $bp_unfiltered_uri_offset;
 
-	$bp_skip_blog_check = $skip_blog_check;
-
-	$bp_path = $pages;
-
-	if ( !bp_is_blog_page() ) {
-		remove_action( 'template_redirect', 'redirect_canonical' );
-	}
-	add_action( 'template_redirect', 'bp_core_do_catch_uri', 2 );
-}
+	// 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;
 
-/**
- * bp_core_do_catch_uri()
- *
- * Loads the first template file found based on the $bp_path global.
- *
- * @package BuddyPress Core
- * @global $bp_path BuddyPress global containing the template file names to use.
- */
-function bp_core_do_catch_uri() {
-	global $bp_path, $bp, $wpdb;
-	global $current_blog, $bp_skip_blog_check;
-	global $bp_no_status_set;
-	global $wp_query;
-
-	/* Can be a single template or an array of templates */
-	$templates = $bp_path;
-
-	/* Don't hijack any URLs on blog pages */
-	if ( bp_is_blog_page() ) {
-		if ( !$bp_skip_blog_check )
-			return false;
-	} else {
-		$wp_query->is_home = 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] ) {
+			$object_id = $page->id;
+		}
 	}
 
-	/* Make sure this is not reported as a 404 */
-	if ( !$bp_no_status_set ) {
-		status_header( 200 );
-		$wp_query->is_404 = false;
-		$wp_query->is_page = true;
+	// Make the queried/post object an actual valid page
+	if ( !empty( $object_id ) ) {
+		$wp_query->queried_object    = &get_post( $object_id );
+		$wp_query->queried_object_id = $object_id;
+		$post                        = $wp_query->queried_object;
 	}
 
+	// Fetch each template and add the php suffix
 	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 ) ) {
+		// 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;
+
 		load_template( apply_filters( 'bp_load_template', $located_template ) );
-	} else {
-		if ( $located_template = locate_template( array( '404.php' ) ) ) {
-			status_header( 404 );
-			load_template( $located_template );
-		} else
-			bp_core_redirect( $bp->root_domain );
 	}
+
+	// Kill any other output after this.
 	die;
 }
 
+/**
+ * bp_core_catch_profile_uri()
+ *
+ * If the extended profiles component is not installed we still need
+ * to catch the /profile URI's and display whatever we have installed.
+ *
+ */
+function bp_core_catch_profile_uri() {
+	global $bp;
+
+	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
+ */
 function bp_core_catch_no_access() {
-	global $bp, $bp_path, $bp_unfiltered_uri, $bp_no_status_set;
+	global $bp, $bp_no_status_set, $wp_query;
 
 	// If bp_core_redirect() and $bp_no_status_set is true,
-	// we are redirecting to an accessable page, so skip this check.
+	// we are redirecting to an accessible page, so skip this check.
 	if ( $bp_no_status_set )
 		return false;
 
-	/* If this user has been marked as a spammer and the logged in user is not a site admin, redirect. */
-	if ( isset( $bp->displayed_user->id ) && bp_core_is_user_spammer( $bp->displayed_user->id ) ) {
-		if ( !is_super_admin() )
-			bp_core_redirect( $bp->root_domain );
-		else
-			bp_core_add_message( __( 'This user has been marked as a spammer. Only site admins can view this profile.', 'buddypress' ), 'error' );
+	if ( !isset( $wp_query->queried_object ) && !bp_is_blog_page() ) {
+		bp_do_404();
 	}
+}
+add_action( 'wp', 'bp_core_catch_no_access' );
+
+/**
+ * Redirects a user to login for BP pages that require access control and adds an error message (if
+ * one is provided).
+ * If authenticated, redirects user back to requested content by default.
+ *
+ * @package BuddyPress Core
+ * @since 1.5
+ */
+function bp_core_no_access( $args = '' ) {
+	global $bp;
 
-	// If this user does not exist, redirect to the root domain.
-	if ( !$bp->displayed_user->id && $bp_unfiltered_uri[0] == BP_MEMBERS_SLUG && isset($bp_unfiltered_uri[1]) )
-		bp_core_redirect( $bp->root_domain );
+	$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
+	);
+
+	$r = wp_parse_args( $args, $defaults );
+	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 );
+
+	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' );
+			} else {
+				bp_core_redirect( $root );
+			}
 
-	// Add .php to all options in $bp_path
-	foreach( (array) $bp_path as $template )
-		$filtered_templates[] = "$template.php";
+			break;
 
-	// If the template file doesn't exist, redirect to the root domain.
-	if ( !bp_is_blog_page() && !file_exists( apply_filters( 'bp_located_template', locate_template( $filtered_templates, false ), $filtered_templates ) ) ) 
-		bp_core_redirect( $bp->root_domain );
+		// Redirect to root with "redirect_to" parameter
+		// Error message is displayed with bp_core_add_message()
+		case 1 :
+		default :
+			if ( $redirect ) {
+				$url = add_query_arg( 'redirect_to', urlencode( $redirect ), $root );
+			} else {
+				$url = $root;
+			}
 
-	if ( !$bp_path && !bp_is_blog_page() ) {
-		if ( is_user_logged_in() ) {
-			wp_redirect( $bp->root_domain );
-		} else {
-			wp_redirect( site_url( 'wp-login.php?redirect_to=' . site_url() . $_SERVER['REQUEST_URI'] ) );
-		}
+			if ( $message ) {
+				bp_core_add_message( $message, 'error' );
+			}
+
+			bp_core_redirect( $url );
+
+			break;
 	}
 }
-add_action( 'wp', 'bp_core_catch_no_access' );
 
 /**
- * bp_core_catch_profile_uri()
- *
- * If the extended profiles component is not installed we still need
- * to catch the /profile URI's and display whatever we have installed.
+ * Adds an error message to wp-login.php.
+ * Hooks into the "bpnoaccess" action defined in bp_core_no_access().
  *
+ * @package BuddyPress Core
+ * @global $error
+ * @since 1.5
  */
-function bp_core_catch_profile_uri() {
-	global $bp;
+function bp_core_no_access_wp_login_error() {
+	global $error;
 
-	if ( !function_exists('xprofile_install') )
-		bp_core_load_template( apply_filters( 'bp_core_template_display_profile', 'members/single/home' ) );
+	$error = apply_filters( 'bp_wp_login_error', __( 'You must log in to access the page you requested.', 'buddypress' ), $_REQUEST['redirect_to'] );
+
+	// shake shake shake!
+	add_action( 'login_head', 'wp_shake_js', 12 );
 }
+add_action( 'login_form_bpnoaccess', 'bp_core_no_access_wp_login_error' );
 
 ?>
\ 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 ab7ce396eeb865ca9be1c498f26df10737472098..2bd18277e938dbb72069e130d9ce9f45838dfe46 100644
--- a/wp-content/plugins/buddypress/bp-core/bp-core-classes.php
+++ b/wp-content/plugins/buddypress/bp-core/bp-core-classes.php
@@ -1,4 +1,7 @@
 <?php
+// Exit if accessed directly
+if ( !defined( 'ABSPATH' ) ) exit;
+
 /**
  * BP_Core_User class can be used by any component. It will fetch useful
  * details for any user when provided with a user_id.
@@ -13,24 +16,114 @@
  * @package BuddyPress Core
  */
 class BP_Core_User {
+
+	/**
+	 * ID of the user which the object relates to.
+	 *
+	 * @var integer
+	 */
 	var $id;
+
+	/**
+	 * The URL to the full size of the avatar for the user.
+	 *
+	 * @var string
+	 */
 	var $avatar;
+
+	/**
+	 * The URL to the thumb size of the avatar for the user.
+	 *
+	 * @var string
+	 */
 	var $avatar_thumb;
+
+	/**
+	 * The URL to the mini size of the avatar for the user.
+	 *
+	 * @var string
+	 */
 	var $avatar_mini;
+
+	/**
+	 * The full name of the user
+	 *
+	 * @var string
+	 */
 	var $fullname;
+
+	/**
+	 * The email for the user.
+	 *
+	 * @var string
+	 */
 	var $email;
 
+	/**
+	 * The absolute url for the user's profile.
+	 *
+	 * @var string
+	 */
 	var $user_url;
+
+	/**
+	 * The HTML for the user link, with the link text being the user's full name.
+	 *
+	 * @var string
+	 */
 	var $user_link;
 
+	/**
+	 * Contains a formatted string when the last time the user was active.
+	 *
+	 * Example: "active 2 hours and 50 minutes ago"
+	 *
+	 * @var string
+	 */
 	var $last_active;
 
 	/* Extras */
+
+	/**
+	 * The total number of "Friends" the user has on site.
+	 *
+	 * @var integer
+	 */
 	var $total_friends;
+
+	/**
+	 * The total number of blog posts posted by the user
+	 *
+	 * @var integer
+	 * @deprecated No longer used
+	 */
 	var $total_blogs;
+
+	/**
+	 * The total number of groups the user is a part of.
+	 *
+	 * Example: "1 group", "2 groups"
+	 *
+	 * @var string
+	 */
 	var $total_groups;
 
+	/**
+	 * PHP4 constructor.
+	 *
+	 * @see BP_Core_User::__construct()
+	 */
 	function bp_core_user( $user_id, $populate_extras = false ) {
+		$this->__construct( $user_id, $populate_extras );
+	}
+
+	/**
+	 * Class constructor.
+	 *
+	 * @param integer $user_id The ID for the 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 ) {
 			$this->id = $user_id;
 			$this->populate();
@@ -41,62 +134,61 @@ class BP_Core_User {
 	}
 
 	/**
-	 * populate()
-	 *
 	 * Populate the instantiated class with data based on the User ID provided.
 	 *
-	 * @package BuddyPress Core
- 	 * @global $userdata WordPress user data for the current logged in user.
+	 * @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
-	 * @uses get_user_meta() WordPress function returns the value of passed usermeta name from usermeta table
+	 * @uses bp_get_user_meta() BP function returns the value of passed usermeta name from usermeta table
 	 * @uses bp_core_fetch_avatar() Returns HTML formatted avatar for a user
 	 * @uses bp_profile_last_updated_date() Returns the last updated date for a user.
 	 */
 	function populate() {
-		if ( function_exists( 'xprofile_install' ) )
+		global $bp;
+
+		if ( bp_is_active( 'xprofile' ) )
 			$this->profile_data = $this->get_profile_data();
 
-		if ( $this->profile_data ) {
-			$this->user_url = bp_core_get_user_domain( $this->id, $this->profile_data['user_nicename'], $this->profile_data['user_login'] );
-			$this->fullname = esc_attr( $this->profile_data[BP_XPROFILE_FULLNAME_FIELD_NAME]['field_data'] );
+		if ( !empty( $this->profile_data ) ) {
+			$full_name_field_name = bp_xprofile_fullname_field_name();
+
+			$this->user_url  = bp_core_get_user_domain( $this->id, $this->profile_data['user_nicename'], $this->profile_data['user_login'] );
+			$this->fullname  = esc_attr( $this->profile_data[$full_name_field_name]['field_data'] );
 			$this->user_link = "<a href='{$this->user_url}' title='{$this->fullname}'>{$this->fullname}</a>";
-			$this->email = esc_attr( $this->profile_data['user_email'] );
+			$this->email     = esc_attr( $this->profile_data['user_email'] );
 		} else {
-			$this->user_url = bp_core_get_user_domain( $this->id );
+			$this->user_url  = bp_core_get_user_domain( $this->id );
 			$this->user_link = bp_core_get_userlink( $this->id );
-			$this->fullname = esc_attr( bp_core_get_user_displayname( $this->id ) );
-			$this->email = esc_attr( bp_core_get_user_email( $this->id ) );
+			$this->fullname  = esc_attr( bp_core_get_user_displayname( $this->id ) );
+			$this->email     = esc_attr( bp_core_get_user_email( $this->id ) );
 		}
 
-		/* Cache a few things that are fetched often */
+		// Cache a few things that are fetched often
 		wp_cache_set( 'bp_user_fullname_' . $this->id, $this->fullname, 'bp' );
 		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       = 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->last_active = bp_core_get_last_activity( get_user_meta( $this->id, 'last_activity', true ), __( 'active %s ago', 'buddypress' ) );
+		$this->avatar_mini  = bp_core_fetch_avatar( array( 'item_id' => $this->id, 'type' => 'thumb', '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 ( function_exists('friends_install') )
+		if ( bp_is_active( 'friends' ) )
 			$this->total_friends = BP_Friends_Friendship::total_friend_count( $this->id );
 
-		if ( function_exists('groups_install') ) {
+		if ( bp_is_active( 'groups' ) ) {
 			$this->total_groups = BP_Groups_Member::total_group_count( $this->id );
-
-			if ( $this->total_groups ) {
-				if ( 1 == $this->total_groups )
-					$this->total_groups .= ' ' . __( 'group', 'buddypress' );
-				else
-					$this->total_groups .= ' ' . __( 'groups', 'buddypress' );
-			}
+			$this->total_groups = sprintf( _n( '%d group', '%d groups', $this->total_groups ), $this->total_groups );
 		}
 	}
 
@@ -104,16 +196,16 @@ class BP_Core_User {
 		return BP_XProfile_ProfileData::get_all_for_user( $this->id );
 	}
 
-	/* Static Functions */
+	/** Static Functions ******************************************************/
 
-	function get_users( $type, $limit = null, $page = 1, $user_id = false, $include = false, $search_terms = false, $populate_extras = true ) {
+	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;
 
 		$sql = array();
 
 		$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 )
+		if ( 'active' == $type || 'online' == $type || 'newest' == $type  )
 			$sql['select_active'] = ", um.meta_value as last_activity";
 
 		if ( 'popular' == $type )
@@ -122,18 +214,33 @@ class BP_Core_User {
 		if ( 'alphabetical' == $type )
 			$sql['select_alpha'] = ", pd.value as fullname";
 
-		$sql['from'] = "FROM " . CUSTOM_USER_TABLE . " u LEFT JOIN " . CUSTOM_USER_META_TABLE . " um ON um.user_id = u.ID";
+		if ( $meta_key ) {
+			$sql['select_meta'] = ", umm.meta_key";
+
+			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";
+
+		// We search against xprofile fields, so we must join the table
+		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 )
+			$sql['join_profiledata_alpha'] = "LEFT JOIN {$bp->profile->table_name_data} pd ON u.ID = pd.user_id";
 
-		if ( $search_terms && function_exists( 'xprofile_install' ) || 'alphabetical' == $type )
-			$sql['join_profiledata'] = "LEFT JOIN {$bp->profile->table_name_data} pd ON u.ID = pd.user_id";
+		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 )
-			$sql['where_active'] = "AND um.meta_key = 'last_activity'";
+		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 )
-			$sql['where_popular'] = "AND um.meta_key = 'total_friend_count'";
+			$sql['where_popular'] = $wpdb->prepare( "AND um.meta_key = %s", bp_get_user_meta_key( 'total_friend_count' ) );
 
 		if ( 'online' == $type )
 			$sql['where_online'] = "AND DATE_ADD( um.meta_value, INTERVAL 5 MINUTE ) >= UTC_TIMESTAMP()";
@@ -141,6 +248,9 @@ class BP_Core_User {
 		if ( 'alphabetical' == $type )
 			$sql['where_alpha'] = "AND pd.field_id = 1";
 
+		if ( !empty( $exclude ) )
+			$sql['where_exclude'] = "AND u.ID NOT IN ({$exclude})";
+
 		if ( $include ) {
 			if ( is_array( $include ) )
 				$uids = $wpdb->escape( implode( ',', (array)$include ) );
@@ -151,21 +261,31 @@ class BP_Core_User {
 				$sql['where_users'] = "AND u.ID IN ({$uids})";
 		}
 
-		else if ( $user_id && function_exists( 'friends_install' ) ) {
+		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 ) );
 
 			if ( !empty( $friend_ids ) )
 				$sql['where_friends'] = "AND u.ID IN ({$friend_ids})";
-			else {
-				/* User has no friends, return false since there will be no users to fetch. */
+
+			// User has no friends, return false since there will be no users to fetch.
+			else
 				return false;
-			}
+
 		}
 
-		if ( $search_terms && function_exists( 'xprofile_install' ) ) {
-			$search_terms = like_escape( $wpdb->escape( $search_terms ) );
-			$sql['where_searchterms'] = "AND pd.value LIKE '%%$search_terms%%'";
+		if ( $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 ) {
+			$sql['where_meta'] = $wpdb->prepare( " AND umm.meta_key = %s", $meta_key );
+
+			// If a meta value is provided, match it
+			if ( $meta_value ) {
+				$sql['where_meta'] .= $wpdb->prepare( " AND umm.meta_value = %s", $meta_value );
+			}
 		}
 
 		switch ( $type ) {
@@ -173,7 +293,7 @@ class BP_Core_User {
 				$sql[] = "ORDER BY um.meta_value DESC";
 				break;
 			case 'newest':
-				$sql[] = "ORDER BY u.user_registered DESC";
+				$sql[] = "ORDER BY u.ID DESC";
 				break;
 			case 'alphabetical':
 				$sql[] = "ORDER BY pd.value ASC";
@@ -189,11 +309,11 @@ class BP_Core_User {
 		if ( $limit && $page )
 			$sql['pagination'] = $wpdb->prepare( "LIMIT %d, %d", intval( ( $page - 1 ) * $limit), intval( $limit ) );
 
-		/* Get paginated results */
+		// Get paginated results
 		$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 */
+		// Re-jig the SQL so we can get the total user count
 		unset( $sql['select_main'] );
 
 		if ( !empty( $sql['select_active'] ) )
@@ -210,7 +330,7 @@ class BP_Core_User {
 
 		array_unshift( $sql, "SELECT COUNT(DISTINCT u.ID)" );
 
-		/* Get total user results */
+		// Get total user results
 		$total_users_sql = apply_filters( 'bp_core_get_total_users_sql', join( ' ', (array)$sql ), $sql );
 		$total_users     = $wpdb->get_var( $total_users_sql );
 
@@ -218,22 +338,39 @@ 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)
 		 */
-		if ( $populate_extras ) {
+		if ( !empty( $populate_extras ) ) {
+			$user_ids = array();
+
 			foreach ( (array)$paged_users as $user )
 				$user_ids[] = $user->id;
 
 			$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 );
+			// Add additional data to the returned results
+			$paged_users = BP_Core_User::get_user_extras( $paged_users, $user_ids, $type );
 		}
 
 		return array( 'users' => $paged_users, 'total' => $total_users );
 	}
 
-	function get_users_by_letter( $letter, $limit = null, $page = 1, $populate_extras = true ) {
-		global $wpdb, $bp;
 
+	/**
+	 * Fetches the user details for all the users who username starts with the letter given.
+	 *
+	 * @global object $bp Global BuddyPress settings object
+	 * @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.
+	 * @param integer $page The page number we are currently on, used in conjunction with $limit to get the start position for the limit.
+	 * @param boolean $populate_extras Populate extra user fields?
+	 * @param string $exclude Comma-separated IDs of users whose results aren't to be fetched.
+	 * @return mixed False on error, otherwise associative array of results.
+	 * @static
+	 */
+	function get_users_by_letter( $letter, $limit = null, $page = 1, $populate_extras = true, $exclude = '' ) {
+		global $bp, $wpdb;
+
+		$pag_sql = '';
 		if ( $limit && $page )
 			$pag_sql = $wpdb->prepare( " LIMIT %d, %d", intval( ( $page - 1 ) * $limit), intval( $limit ) );
 
@@ -248,11 +385,13 @@ class BP_Core_User {
 			}
 		}
 
-		$letter = like_escape( $wpdb->escape( $letter ) );
+		$letter     = like_escape( $wpdb->escape( $letter ) );
 		$status_sql = bp_core_get_status_sql( 'u.' );
 
-		$total_users_sql = apply_filters( 'bp_core_users_by_letter_count_sql', $wpdb->prepare( "SELECT COUNT(DISTINCT u.ID) FROM " . CUSTOM_USER_TABLE . " 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 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 " . CUSTOM_USER_TABLE . " 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 AND pd.value LIKE '$letter%%' ORDER BY pd.value ASC{$pag_sql}", BP_XPROFILE_FULLNAME_FIELD_NAME ), $letter, $pag_sql );
+		$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 = $wpdb->get_var( $total_users_sql );
 		$paged_users = $wpdb->get_results( $paged_users_sql );
@@ -261,6 +400,7 @@ 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)
 		 */
+		$user_ids = array();
 		foreach ( (array)$paged_users as $user )
 			$user_ids[] = $user->id;
 
@@ -268,22 +408,73 @@ class BP_Core_User {
 
 		/* Add additional data to the returned results */
 		if ( $populate_extras )
-			$paged_users = BP_Core_User::get_user_extras( &$paged_users, &$user_ids );
+			$paged_users = BP_Core_User::get_user_extras( $paged_users, $user_ids );
 
 		return array( 'users' => $paged_users, 'total' => $total_users );
 	}
 
-	function search_users( $search_terms, $limit = null, $page = 1, $populate_extras = true ) {
-		global $wpdb, $bp;
+	/**
+	 * 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.
+	 * @param integer $page The page we are on for pagination.
+	 * @param boolean $populate_extras Populate extra user fields?
+	 * @return array Associative array
+	 * @static
+	 */
+	function get_specific_users( $user_ids, $limit = null, $page = 1, $populate_extras = true ) {
+		global $bp, $wpdb;
 
+		$pag_sql = '';
 		if ( $limit && $page )
 			$pag_sql = $wpdb->prepare( " LIMIT %d, %d", intval( ( $page - 1 ) * $limit), intval( $limit ) );
 
+		$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 = $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)
+		 */
+
+		/* 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 );
+	}
+
+	/**
+	 * Find users who match on the value of an xprofile data.
+	 *
+	 * @global object $bp Global BuddyPress settings object
+	 * @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.
+	 * @param integer $page The page we are on for pagination.
+	 * @param boolean $populate_extras Populate extra user fields?
+	 * @return array Associative array
+	 * @static
+	 */
+	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 ) ) : '';
+
 		$search_terms = like_escape( $wpdb->escape( $search_terms ) );
-		$status_sql = bp_core_get_status_sql( 'u.' );
+		$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 " . CUSTOM_USER_TABLE . " 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 " . CUSTOM_USER_TABLE . " 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 );
@@ -297,27 +488,36 @@ class BP_Core_User {
 
 		$user_ids = $wpdb->escape( join( ',', (array)$user_ids ) );
 
-		/* Add additional data to the returned results */
+		// Add additional data to the returned results
 		if ( $populate_extras )
-			$paged_users = BP_Core_User::get_user_extras( &$paged_users, &$user_ids );
+			$paged_users = BP_Core_User::get_user_extras( $paged_users, $user_ids );
 
 		return array( 'users' => $paged_users, 'total' => $total_users );
 	}
 
-	function get_user_extras( $paged_users, $user_ids, $type = false ) {
+	/**
+	 * Fetch extra user information, such as friend count and last profile update message.
+	 *
+	 * Accepts multiple user IDs to fetch data for.
+	 *
+	 * @global object $bp Global BuddyPress settings object
+	 * @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
+	 * @param string $type the type of fields we wish to get
+	 * @return mixed False on error, otherwise associative array of results.
+	 * @static
+	 */
+	function get_user_extras( &$paged_users, &$user_ids, $type = false ) {
 		global $bp, $wpdb;
 
 		if ( empty( $user_ids ) )
 			return $paged_users;
 
-		/* Fetch the user's full name */
-		if ( function_exists( 'xprofile_install' ) && 'alphabetical' != $type ) {
-			/* Ensure xprofile globals are set */
-			if ( !defined( 'BP_XPROFILE_FULLNAME_FIELD_NAME' ) )
-				xprofile_setup_globals();
-
-			$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; $i < count( $paged_users ); $i++ ) {
+		// Fetch the user's full name
+		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 ) {
 					if ( $name->id == $paged_users[$i]->id )
 						$paged_users[$i]->fullname = $name->fullname;
@@ -325,21 +525,21 @@ class BP_Core_User {
 			}
 		}
 
-		/* Fetch the user's total friend count */
+		// Fetch the user's total friend count
 		if ( 'popular' != $type ) {
-			$friend_count = $wpdb->get_results( "SELECT user_id as id, meta_value as total_friend_count FROM " . CUSTOM_USER_META_TABLE . " WHERE meta_key = 'total_friend_count' AND user_id IN ( {$user_ids} )" );
-			for ( $i = 0; $i < count( $paged_users ); $i++ ) {
-				foreach ( (array)$friend_count as $count ) {
-					if ( $count->id == $paged_users[$i]->id )
-						$paged_users[$i]->total_friend_count = (int)$count->total_friend_count;
+			$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 ) {
+					if ( $fcount->id == $paged_users[$i]->id )
+						$paged_users[$i]->total_friend_count = (int)$fcount->total_friend_count;
 				}
 			}
 		}
 
-		/* Fetch whether or not the user is a friend */
-		if ( function_exists( 'friends_install' ) ) {
+		// 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 ) );
-			for ( $i = 0; $i < count( $paged_users ); $i++ ) {
+			for ( $i = 0, $count = count( $paged_users ); $i < $count; ++$i ) {
 				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;
@@ -348,8 +548,8 @@ class BP_Core_User {
 		}
 
 		if ( 'active' != $type ) {
-			$user_activity = $wpdb->get_results( "SELECT user_id as id, meta_value as last_activity FROM " . CUSTOM_USER_META_TABLE . " WHERE meta_key = 'last_activity' AND user_id IN ( {$user_ids} )" );
-			for ( $i = 0; $i < count( $paged_users ); $i++ ) {
+			$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 ) {
 					if ( $activity->id == $paged_users[$i]->id )
 						$paged_users[$i]->last_activity = $activity->last_activity;
@@ -357,10 +557,10 @@ class BP_Core_User {
 			}
 		}
 
-		/* Fetch the user's last_activity */
+		// Fetch the user's last_activity
 		if ( 'active' != $type ) {
-			$user_activity = $wpdb->get_results( "SELECT user_id as id, meta_value as last_activity FROM " . CUSTOM_USER_META_TABLE . " WHERE meta_key = 'last_activity' AND user_id IN ( {$user_ids} )" );
-			for ( $i = 0; $i < count( $paged_users ); $i++ ) {
+			$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 ) {
 					if ( $activity->id == $paged_users[$i]->id )
 						$paged_users[$i]->last_activity = $activity->last_activity;
@@ -368,9 +568,9 @@ class BP_Core_User {
 			}
 		}
 
-		/* Fetch the user's latest update */
-		$user_update = $wpdb->get_results( "SELECT user_id as id, meta_value as latest_update FROM " . CUSTOM_USER_META_TABLE . " WHERE meta_key = 'bp_latest_update' AND user_id IN ( {$user_ids} )" );
-		for ( $i = 0; $i < count( $paged_users ); $i++ ) {
+		// 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 ) {
 				if ( $update->id == $paged_users[$i]->id )
 					$paged_users[$i]->latest_update = $update->latest_update;
@@ -380,6 +580,14 @@ class BP_Core_User {
 		return $paged_users;
 	}
 
+	/**
+	 * Get WordPress user details for a specified user.
+	 *
+	 * @global wpdb $wpdb WordPress database object
+	 * @param integer $user_id User ID
+	 * @return array Associative array
+	 * @static
+	 */
 	function get_core_userdata( $user_id ) {
 		global $wpdb;
 
@@ -399,46 +607,122 @@ class BP_Core_User {
  */
 
 class BP_Core_Notification {
+
+	/**
+	 * The notification id
+	 *
+	 * @var integer
+	 */
 	var $id;
+
+	/**
+	 * The ID to which the notification relates to within the component.
+	 *
+	 * @var integer
+	 */
 	var $item_id;
+
+	/**
+	 * The secondary ID to which the notification relates to within the component.
+	 *
+	 * @var integer
+	 */
 	var $secondary_item_id = null;
+
+	/**
+	 * The user ID for who the notification is for.
+	 *
+	 * @var integer
+	 */
 	var $user_id;
+
+	/**
+	 * The name of the component that the notification is for.
+	 *
+	 * @var string
+	 */
 	var $component_name;
+
+	/**
+	 * The action within the component which the notification is related to.
+	 *
+	 * @var string
+	 */
 	var $component_action;
+
+	/**
+	 * The date the notification was created.
+	 *
+	 * @var string
+	 */
 	var $date_notified;
+
+	/**
+	 * Is the notification new or has it already been read.
+	 *
+	 * @var boolean
+	 */
 	var $is_new;
 
-	function bp_core_notification( $id = false ) {
+
+	/**
+	 * PHP4 constructor
+	 *
+	 * @param integer $id
+	 */
+	function bp_core_notification( $id = 0 ) {
+		$this->__construct($id);
+	}
+
+	/**
+	 * Constructor
+	 *
+	 * @param integer $id
+	 */
+	function __construct( $id = 0 ) {
 		if ( $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 $wpdb, $bp;
+		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;
+			$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 wpdb $wpdb WordPress database object
+	 * @return bool Success or failure
+	 */
 	function save() {
-		global $wpdb, $bp;
+		global $bp, $wpdb;
 
-		if ( $this->id ) {
-			// Update
+		// Update
+		if ( $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 );
-		} else {
-			// Save
+
+		// Save
+		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;
@@ -447,7 +731,7 @@ class BP_Core_Notification {
 		return true;
 	}
 
-	/* Static functions */
+	/** Static functions ******************************************************/
 
 	function check_access( $user_id, $notification_id ) {
 		global $wpdb, $bp;
@@ -455,41 +739,96 @@ class BP_Core_Notification {
 		return $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(id) FROM {$bp->core->table_name_notifications} WHERE id = %d AND user_id = %d", $notification_id, $user_id ) );
 	}
 
+	/**
+	 * Fetches all the notifications in the database for a specific user.
+	 *
+	 * @global object $bp Global BuddyPress settings object
+	 * @global wpdb $wpdb WordPress database object
+	 * @param integer $user_id User ID
+	 * @return array Associative array
+	 * @static
+	 */
 	function get_all_for_user( $user_id ) {
-		global $wpdb, $bp;
+		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 ) );
 	}
 
+	/**
+	 * Delete all the notifications for a user based on the component name and action.
+	 *
+	 * @global object $bp Global BuddyPress settings object
+	 * @global wpdb $wpdb WordPress database object
+	 * @param integer $user_id
+	 * @param string $component_name
+	 * @param string $component_action
+	 * @static
+	 */
 	function delete_for_user_by_type( $user_id, $component_name, $component_action ) {
-		global $wpdb, $bp;
+		global $bp, $wpdb;
 
 		return $wpdb->query( $wpdb->prepare( "DELETE FROM {$bp->core->table_name_notifications} WHERE user_id = %d AND component_name = %s AND component_action = %s", $user_id, $component_name, $component_action ) );
 	}
 
-	function delete_for_user_by_item_id( $user_id, $item_id, $component_name, $component_action, $secondary_item_id ) {
-		global $wpdb, $bp;
+	/**
+	 * Delete all the notifications that have a specific item id, component name and action.
+	 *
+	 * @global object $bp Global BuddyPress settings object
+	 * @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.
+	 * @param string $component_name The name of the component that the notifications we wish to delete.
+	 * @param string $component_action The action of the component that the notifications we wish to delete.
+	 * @param integer $secondary_item_id (optional) The secondary item id of the notifications that we wish to use to delete.
+	 * @static
+	 */
+	function delete_for_user_by_item_id( $user_id, $item_id, $component_name, $component_action, $secondary_item_id = false ) {
+		global $bp, $wpdb;
 
-		if ( $secondary_item_id )
-			$secondary_item_sql = $wpdb->prepare( " AND secondary_item_id = %d", $secondary_item_id );
+		$secondary_item_sql = !empty( $secondary_item_id ) ? $wpdb->prepare( " AND secondary_item_id = %d", $secondary_item_id ) : '';
 
 		return $wpdb->query( $wpdb->prepare( "DELETE FROM {$bp->core->table_name_notifications} WHERE user_id = %d AND item_id = %d AND component_name = %s AND component_action = %s{$secondary_item_sql}", $user_id, $item_id, $component_name, $component_action ) );
 	}
 
+	/**
+	 * Deletes all the notifications sent by a specific user, by component and action.
+	 *
+	 * @global object $bp Global BuddyPress settings object
+	 * @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.
+	 * @param string $component_action The action of the component the notification was sent from.
+	 * @static
+	 */
 	function delete_from_user_by_type( $user_id, $component_name, $component_action ) {
-		global $wpdb, $bp;
+		global $bp, $wpdb;
 
 		return $wpdb->query( $wpdb->prepare( "DELETE FROM {$bp->core->table_name_notifications} WHERE item_id = %d AND component_name = %s AND component_action = %s", $user_id, $component_name, $component_action ) );
 	}
 
+	/**
+	 * 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 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.
+	 * @param string $component_action The action that the notificationsa are to be from.
+	 * @param string $secondary_item_id Optional secondary item id that the notifications are to have.
+	 * @static
+	 */
 	function delete_all_by_type( $item_id, $component_name, $component_action, $secondary_item_id ) {
-		global $wpdb, $bp;
+		global $bp, $wpdb;
 
 		if ( $component_action )
 			$component_action_sql = $wpdb->prepare( "AND component_action = %s", $component_action );
+		else
+			$component_action_sql = '';
 
 		if ( $secondary_item_id )
 			$secondary_item_sql = $wpdb->prepare( "AND secondary_item_id = %d", $secondary_item_id );
+		else
+			$secondary_item_sql = '';
 
 		return $wpdb->query( $wpdb->prepare( "DELETE FROM {$bp->core->table_name_notifications} WHERE item_id = %d AND component_name = %s {$component_action_sql} {$secondary_item_sql}", $item_id, $component_name ) );
 	}
@@ -504,26 +843,109 @@ class BP_Core_Notification {
  * @since 1.2.6
  */
 class BP_Button {
-
 	// Button properties
+
+	/**
+	 * The button ID
+	 *
+	 * @var integer
+	 */
 	var $id;
+
+	/**
+	 * The component name that button belongs to.
+	 *
+	 * @var string
+	 */
 	var $component;
+
+	/**
+	 * Does the user need to be logged in to see this button?
+	 *
+	 * @var boolean
+	 */
 	var $must_be_logged_in;
+
+	/**
+	 * True or false if the button should not be displayed while viewing your own profile.
+	 *
+	 * @var boolean
+	 */
 	var $block_self;
 
-	// Wrapper div
+
+	// Wrapper
+
+	/**
+	 * What type of DOM element to use for a wrapper.
+	 *
+	 *
+	 * @var mixed div|span|p|li, or false for no wrapper
+	 */
+	var $wrapper;
+
+	/**
+	 * The DOM class of the button wrapper
+	 *
+	 * @var string
+	 */
 	var $wrapper_class;
+
+	/**
+	 * The DOM ID of the button wrapper
+	 *
+	 * @var string
+	 */
 	var $wrapper_id;
 
+
 	// Button
+
+	/**
+	 * The destination link of the button
+	 *
+	 * @var string
+	 */
 	var $link_href;
+
+	/**
+	 * The DOM class of the button link
+	 *
+	 * @var string
+	 */
 	var $link_class;
+
+	/**
+	 * The DOM ID of the button link
+	 *
+	 * @var string
+	 */
 	var $link_id;
+
+	/**
+	 * The DOM rel value of the button link
+	 *
+	 * @var string
+	 */
 	var $link_rel;
+
+	/**
+	 * Title of the button link
+	 *
+	 * @var string
+	 */
 	var $link_title;
+
+	/**
+	 * The contents of the button link
+	 *
+	 * @var string
+	 */
 	var $link_text;
 
+
 	// HTML result
+
 	var $contents;
 
 	/**
@@ -534,6 +956,7 @@ class BP_Button {
 	 * component: Which component this button is for
 	 * must_be_logged_in: Button only appears for logged in users
 	 * block_self: Button will not appear when viewing your own profile.
+	 * wrapper: div|span|p|li|false for no wrapper
 	 * wrapper_id: The DOM ID of the button wrapper
 	 * wrapper_class: The DOM class of the button wrapper
 	 * link_href: The destination link of the button
@@ -547,13 +970,19 @@ class BP_Button {
 	 * @return bool False if not allowed
 	 */
 	function bp_button( $args = '' ) {
+		$this->__construct($args);
+	}
+
+	function __construct( $args = '' ) {
 
+		// Default arguments
 		$defaults = array(
 			'id'                => '',
 			'component'         => 'core',
 			'must_be_logged_in' => true,
 			'block_self'        => true,
 
+			'wrapper'           => 'div',
 			'wrapper_id'        => '',
 			'wrapper_class'     => '',
 
@@ -573,6 +1002,7 @@ class BP_Button {
 		$this->component         = $component;
 		$this->must_be_logged_in = (bool)$must_be_logged_in;
 		$this->block_self        = (bool)$block_self;
+		$this->wrapper           = $wrapper;
 
 		// $id and $component are required
 		if ( empty( $id ) || empty( $component ) )
@@ -591,40 +1021,51 @@ class BP_Button {
 			return false;
 
 		// Wrapper properties
-		if ( !empty( $wrapper_id ) )
-			$this->wrapper_id    = ' id="' . $wrapper_id . '"';
+		if ( false !== $this->wrapper ) {
 
-		if ( !empty( $wrapper_class ) )
-			$this->wrapper_class = ' class="generic-button ' . $wrapper_class . '"';
-		else
-			$this->wrapper_class = ' class="generic-button"';
+			// Wrapper ID
+			if ( !empty( $wrapper_id ) )
+				$this->wrapper_id    = ' id="' . $wrapper_id . '"';
+
+			// Wrapper class
+			if ( !empty( $wrapper_class ) )
+				$this->wrapper_class = ' class="generic-button ' . $wrapper_class . '"';
+			else
+				$this->wrapper_class = ' class="generic-button"';
+
+			// Set before and after
+			$before = '<' . $wrapper . $this->wrapper_class . $this->wrapper_id . '>';
+			$after  = '</' . $wrapper . '>';
+
+		// No wrapper
+		} else {
+			$before = $after = '';
+		}
 
 		// Link properties
 		if ( !empty( $link_id ) )
-			$this->link_id       = ' id="' . $link_id . '"';
+			$this->link_id    = ' id="' . $link_id . '"';
 
 		if ( !empty( $link_href ) )
-			$this->link_href     = ' href="' . $link_href . '"';
+			$this->link_href  = ' href="' . $link_href . '"';
 
 		if ( !empty( $link_title ) )
-			$this->link_title    = ' title="' . $link_title . '"';
+			$this->link_title = ' title="' . $link_title . '"';
 
 		if ( !empty( $link_rel ) )
-			$this->link_rel      = ' rel="' . $link_rel . '"';
+			$this->link_rel   = ' rel="' . $link_rel . '"';
 
 		if ( !empty( $link_class ) )
-			$this->link_class    = ' class="' . $link_class . '"';
+			$this->link_class = ' class="' . $link_class . '"';
 
 		if ( !empty( $link_text ) )
-			$this->link_text     = $link_text;
+			$this->link_text  = $link_text;
 
 		// Build the button
-		$this->contents  = '<div' . $this->wrapper_class . $this->wrapper_id . '>';
-		$this->contents .= '<a'. $this->link_href . $this->link_title . $this->link_id . $this->link_rel . $this->link_class . '>' . $this->link_text . '</a>';
-		$this->contents .= '</div>';
+		$this->contents = $before . '<a'. $this->link_href . $this->link_title . $this->link_id . $this->link_rel . $this->link_class . '>' . $this->link_text . '</a>' . $after;
 
 		// Allow button to be manipulated externally
-		$this->contents = apply_filters( 'bp_button_' . $component . '_' . $id, $this->contents, $this );
+		$this->contents = apply_filters( 'bp_button_' . $component . '_' . $id, $this->contents, $this, $before, $after );
 	}
 
 	/**
@@ -649,4 +1090,165 @@ class BP_Button {
 	}
 }
 
-?>
+/**
+ * BP_Embed
+ *
+ * Extends WP_Embed class for use with BuddyPress.
+ *
+ * @package BuddyPress Core
+ * @since 1.5
+ * @see WP_Embed
+ */
+class BP_Embed extends WP_Embed {
+	/**
+	 * Constructor
+	 *
+	 * @global unknown $wp_embed
+	 */
+	function __construct() {
+		global $wp_embed;
+
+		// Make sure we populate the WP_Embed handlers array.
+		// These are providers that use a regex callback on the URL in question.
+		// Do not confuse with oEmbed providers, which require an external ping.
+		// Used in WP_Embed::shortcode()
+		$this->handlers = $wp_embed->handlers;
+
+		if ( bp_use_embed_in_activity() ) {
+			add_filter( 'bp_get_activity_content_body', array( &$this, 'autoembed' ), 8 );
+			add_filter( 'bp_get_activity_content_body', array( &$this, 'run_shortcode' ), 7 );
+		}
+
+		if ( bp_use_embed_in_activity_replies() ) {
+			add_filter( 'bp_get_activity_content', array( &$this, 'autoembed' ), 8 );
+			add_filter( 'bp_get_activity_content', array( &$this, 'run_shortcode' ), 7 );
+		}
+
+		if ( bp_use_embed_in_forum_posts() ) {
+			add_filter( 'bp_get_the_topic_post_content', array( &$this, 'autoembed' ), 8 );
+			add_filter( 'bp_get_the_topic_post_content', array( &$this, 'run_shortcode' ), 7 );
+		}
+
+		if ( bp_use_embed_in_private_messages() ) {
+			add_filter( 'bp_get_the_thread_message_content', array( &$this, 'autoembed' ), 8 );
+			add_filter( 'bp_get_the_thread_message_content', array( &$this, 'run_shortcode' ), 7 );
+		}
+
+		do_action_ref_array( 'bp_core_setup_oembed', array( &$this ) );
+	}
+
+	/**
+	 * The {@link do_shortcode()} callback function.
+	 *
+	 * Attempts to convert a URL into embed HTML. Starts by checking the URL against the regex of the registered embed handlers.
+	 * Next, checks the URL against the regex of registered {@link WP_oEmbed} providers if oEmbed discovery is false.
+	 * If none of the regex matches and it's enabled, then the URL will be passed to {@link BP_Embed::parse_oembed()} for oEmbed parsing.
+	 *
+	 * @uses wp_parse_args()
+	 * @uses wp_embed_defaults()
+	 * @uses current_user_can()
+	 * @uses _wp_oembed_get_object()
+	 * @uses WP_Embed::maybe_make_link()
+	 *
+	 * @param array $attr Shortcode attributes.
+	 * @param string $url The URL attempting to be embeded.
+	 * @return string The embed HTML on success, otherwise the original URL.
+	 */
+	function shortcode( $attr, $url = '' ) {
+		if ( empty( $url ) )
+			return '';
+
+		$rawattr = $attr;
+		$attr = wp_parse_args( $attr, wp_embed_defaults() );
+
+		// kses converts & into &amp; and we need to undo this
+		// See http://core.trac.wordpress.org/ticket/11311
+		$url = str_replace( '&amp;', '&', $url );
+
+		// Look for known internal handlers
+		ksort( $this->handlers );
+		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 ) )
+						return apply_filters( 'embed_handler_html', $return, $url, $attr );
+				}
+			}
+		}
+
+		// Get object ID
+		$id = apply_filters( 'embed_post_id', 0 );
+
+		// Is oEmbed discovery on?
+		$attr['discover'] = ( apply_filters( 'bp_embed_oembed_discover', false ) && current_user_can( 'unfiltered_html' ) );
+
+		// Set up a new WP oEmbed object to check URL with registered oEmbed providers
+		require_once( ABSPATH . WPINC . '/class-oembed.php' );
+		$oembed_obj = _wp_oembed_get_object();
+
+		// 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 ) {
+				$regex = ( $is_regex = $provider[1] ) ? $provider_matchmask : '#' . str_replace( '___wildcard___', '(.+)', preg_quote( str_replace( '*', '___wildcard___', $provider_matchmask ), '#' ) ) . '#i';
+
+				if ( preg_match( $regex, $url ) )
+					$is_oembed_link = true;
+			}
+
+			// If url doesn't match a WP oEmbed provider, stop parsing
+			if ( !$is_oembed_link )
+				return $this->maybe_make_link( $url );
+		}
+
+		return $this->parse_oembed( $id, $url, $attr, $rawattr );
+	}
+
+	/**
+	 * Base function so BP components / plugins can parse links to be embedded.
+	 * View an example to add support in {@link bp_activity_embed()}.
+	 *
+	 * @uses apply_filters() Filters cache.
+	 * @uses do_action() To save cache.
+	 * @uses wp_oembed_get() Connects to oEmbed provider and returns HTML on success.
+	 * @uses WP_Embed::maybe_make_link() Process URL for hyperlinking on oEmbed failure.
+	 * @param int $id ID to do the caching for.
+	 * @param string $url The URL attempting to be embedded.
+	 * @param array $attr Shortcode attributes from {@link WP_Embed::shortcode()}.
+	 * @param array $rawattr Untouched shortcode attributes from {@link WP_Embed::shortcode()}.
+	 * @return string The embed HTML on success, otherwise the original URL.
+	 */
+	function parse_oembed( $id, $url, $attr, $rawattr ) {
+		$id = intval( $id );
+
+		if ( $id ) {
+			// Setup the cachekey
+			$cachekey = '_oembed_' . md5( $url . serialize( $attr ) );
+
+			// Let components / plugins grab their cache
+			$cache = '';
+			$cache = apply_filters( 'bp_embed_get_cache', $cache, $id, $cachekey, $url, $attr, $rawattr );
+
+			// Grab cache and return it if available
+			if ( !empty( $cache ) ) {
+				return apply_filters( 'bp_embed_oembed_html', $cache, $url, $attr, $rawattr );
+
+			// If no cache, ping the oEmbed provider and cache the result
+			} else {
+				$html = wp_oembed_get( $url, $attr );
+				$cache = ( $html ) ? $html : $url;
+
+				// Let components / plugins save their cache
+				do_action( 'bp_embed_update_cache', $cache, $cachekey, $id );
+
+				// If there was a result, return it
+				if ( $html )
+					return apply_filters( 'bp_embed_oembed_html', $html, $url, $attr, $rawattr );
+			}
+		}
+
+		// Still unknown
+		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
new file mode 100644
index 0000000000000000000000000000000000000000..b857b24f9982a6f861fa010785ad8b6bd1ea0a5c
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-core/bp-core-component.php
@@ -0,0 +1,358 @@
+<?php
+// Exit if accessed directly
+if ( !defined( 'ABSPATH' ) ) exit;
+
+if ( !class_exists( 'BP_Component' ) ) :
+/**
+ * BuddyPress Component Class
+ *
+ * The BuddyPress component class is responsible for simplifying the creation
+ * of components that share similar behaviors and routines. It is used
+ * internally by BuddyPress to create the bundled components, but can be
+ * extended to create other really neat things.
+ *
+ * @package BuddyPress
+ * @subpackage Component
+ *
+ * @since 1.5
+ */
+class BP_Component {
+
+	/**
+	 * @var string Unique name (for internal identification)
+	 * @internal
+	 */
+	var $name;
+
+	/**
+	 * @var Unique ID (normally for custom post type)
+	 */
+	var $id;
+
+	/**
+	 * @var string Unique slug (used in query string and permalinks)
+	 */
+	var $slug;
+
+	/**
+	 * @var bool Does this component need a top-level directory?
+	 */
+	var $has_directory;
+
+	/**
+	 * @var string The path to the component's files
+	 */
+	var $path;
+
+	/**
+	 * @var WP_Query The loop for this component
+	 */
+	var $query;
+
+	/**
+	 * @var string The current ID of the queried object
+	 */
+	var $current_id;
+
+	/**
+	 * @var string Function to call for notifications
+	 */
+	var $notification_callback;
+
+	/**
+	 * @var array WordPress admin bar links
+	 */
+	var $admin_menu;
+
+	/**
+	 * Component loader
+	 *
+	 * @since 1.5
+	 *
+	 * @param mixed $args Required. Supports these args:
+	 *  - id: Unique ID (for internal identification). Letters, numbers, and underscores only
+	 *  - name: Unique name. This should be a translatable name, eg __( 'Groups', 'buddypress' )
+	 *  - path: The file path for the component's files. Used by BP_Component::includes()
+	 * @uses bp_Component::setup_actions() Setup the hooks and actions
+	 */
+	function start( $id, $name, $path ) {
+		// Internal identifier of component
+		$this->id   = $id;
+
+		// Internal component name
+		$this->name = $name;
+
+		// Path for includes
+		$this->path = $path;
+
+		// Move on to the next step
+		$this->setup_actions();
+	}
+
+	/**
+	 * Component global variables
+	 *
+	 * @since 1.5
+	 * @access private
+	 *
+	 * @uses apply_filters() Calls 'bp_{@link bp_Component::name}_id'
+	 * @uses apply_filters() Calls 'bp_{@link bp_Component::name}_slug'
+	 *
+	 * @param arr $args Used to
+	 */
+	function setup_globals( $args = '' ) {
+		global $bp;
+
+		/** Slugs *************************************************************/
+
+		$defaults = array(
+			'slug'                  => $this->id,
+			'root_slug'             => '',
+			'has_directory'         => false,
+			'notification_callback' => '',
+			'search_string'         => '',
+			'global_tables'         => ''
+		);
+		$r = wp_parse_args( $args, $defaults );
+
+		// Slug used for permalink URI chunk after root
+		$this->slug          = apply_filters( 'bp_' . $this->id . '_slug',          $r['slug']          );
+
+		// Slug used for root directory
+		$this->root_slug     = apply_filters( 'bp_' . $this->id . '_root_slug',     $r['root_slug']     );
+
+		// Does this component have a top-level directory?
+		$this->has_directory = apply_filters( 'bp_' . $this->id . '_has_directory', $r['has_directory'] );
+
+		// Search string
+		$this->search_string = apply_filters( 'bp_' . $this->id . '_search_string', $r['search_string'] );
+
+		// 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 )
+				$this->$global_name = $table_name;
+
+		/** BuddyPress ********************************************************/
+
+		// Register this component in the loaded components array
+		$bp->loaded_components[$this->slug] = $this->id;
+
+		// Call action
+		do_action( 'bp_' . $this->id . '_setup_globals' );
+	}
+
+	/**
+	 * Include required files
+	 *
+	 * Please note that, by default, this method is fired on the bp_include hook, with priority
+	 * 8. This is necessary so that core components are loaded in time to be available to
+	 * third-party plugins. However, this load order means that third-party plugins whose main
+	 * files are loaded at bp_include with priority 10 (as recommended), will not be loaded in
+	 * time for their includes() method to fire automatically.
+	 *
+	 * For this reason, it is recommended that your plugin has its own method or function for
+	 * requiring necessary files. If you must use this method, you will have to call it manually
+	 * in your constructor class, ie
+	 *   $this->includes();
+	 *
+	 * Note that when you pass an array value like 'actions' to includes, it looks for the
+	 * following three files (assuming your component is called 'my_component'):
+	 *   - ./actions
+	 *   - ./bp-my_component/actions
+	 *   - ./bp-my_component/bp-my_component-actions.php
+	 *
+	 * @since 1.5
+	 * @access private
+	 *
+	 * @uses do_action() Calls 'bp_{@link bp_Component::name}includes'
+	 */
+	function includes( $includes = '' ) {
+		if ( empty( $includes ) )
+			return;
+
+		// Loop through files to be included
+		foreach ( $includes as $file ) {
+
+			// Check path + file
+			if ( @is_file( $this->path . '/' . $file ) )
+				require( $this->path . '/' . $file );
+
+			// Check path + /bp-component/ + file
+			elseif ( @is_file( $this->path . '/bp-' . $this->id . '/' . $file ) )
+				require( $this->path . '/bp-' . $this->id . '/' . $file );
+
+			// 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' );
+
+		}
+
+		// Call action
+		do_action( 'bp_' . $this->id . '_includes' );
+	}
+
+	/**
+	 * Setup the actions
+	 *
+	 * @since 1.5
+	 * @access private
+	 *
+	 * @uses add_action() To add various actions
+	 * @uses do_action() Calls 'bp_{@link BP_Component::name}setup_actions'
+	 */
+	function setup_actions() {
+
+		// Setup globals
+		add_action( 'bp_setup_globals',          array ( $this, 'setup_globals'          ), 10 );
+
+		// Include required files. Called early to ensure that BP core
+		// components are loaded before plugins that hook their loader functions
+		// to bp_include with the default priority of 10. This is for backwards
+		// compatibility; henceforth, plugins should register themselves by
+		// extending this base class.
+		add_action( 'bp_include',                array ( $this, 'includes'               ), 8 );
+
+		// Setup navigation
+		add_action( 'bp_setup_nav',              array ( $this, 'setup_nav'              ), 10 );
+
+		// Setup WP Admin Bar menus
+		add_action( 'bp_setup_admin_bar',        array ( $this, 'setup_admin_bar'        ), 10 );
+
+		// Setup component title
+		add_action( 'bp_setup_title',            array ( $this, 'setup_title'            ), 10 );
+
+		// Register post types
+		add_action( 'bp_register_post_types',    array ( $this, 'register_post_types'    ), 10 );
+
+		// Register taxonomies
+		add_action( 'bp_register_taxonomies',    array ( $this, 'register_taxonomies'    ), 10 );
+
+		// Add the rewrite tags
+		add_action( 'bp_add_rewrite_tags',       array ( $this, 'add_rewrite_tags'       ), 10 );
+
+		// Generate rewrite rules
+		add_action( 'bp_generate_rewrite_rules', array ( $this, 'generate_rewrite_rules' ), 10 );
+
+		// Additional actions can be attached here
+		do_action( 'bp_' . $this->id . '_setup_actions' );
+	}
+
+	/**
+	 * Setup the navigation
+	 *
+	 * @param arr $main_nav Optional
+	 * @param arr $sub_nav Optional
+	 */
+	function setup_nav( $main_nav = '', $sub_nav = '' ) {
+
+		// No sub nav items without a main nav item
+		if ( !empty( $main_nav ) ) {
+			bp_core_new_nav_item( $main_nav );
+
+			// Sub nav items are not required
+			if ( !empty( $sub_nav ) ) {
+				foreach( $sub_nav as $nav ) {
+					bp_core_new_subnav_item( $nav );
+				}
+			}
+		}
+
+		// Call action
+		do_action( 'bp_' . $this->id . '_setup_nav' );
+	}
+
+	/**
+	 * Setup the admin bar
+	 *
+	 * @global obj $wp_admin_bar
+	 * @param array $wp_admin_menus
+	 */
+	function setup_admin_bar( $wp_admin_nav = '' ) {
+
+		// Bail if this is an ajax request
+		if ( defined( 'DOING_AJAX' ) )
+			return;
+
+		// Do not proceed if BP_USE_WP_ADMIN_BAR constant is not set or is false
+		if ( !bp_use_wp_admin_bar() )
+			return;
+
+		// Do we have admin bar menus to add?
+		if ( !empty( $wp_admin_nav ) ) {
+
+			// Set this objects menus
+			$this->admin_menu = $wp_admin_nav;
+
+			// Define the WordPress global
+			global $wp_admin_bar;
+
+			// Add each admin menu
+			foreach( $this->admin_menu as $admin_menu )
+				$wp_admin_bar->add_menu( $admin_menu );
+		}
+
+		// Call action
+		do_action( 'bp_' . $this->id . '_setup_admin_bar' );
+	}
+
+	/**
+	 * Setup the component title
+	 *
+	 * @since 1.5
+	 *
+	 * @uses do_action() Calls 'bp_{@link bp_Component::name}setup_title'
+	 */
+	function setup_title( ) {
+		do_action(  'bp_' . $this->id . '_setup_title' );
+	}
+
+	/**
+	 * Setup the component post types
+	 *
+	 * @since 1.5
+	 *
+	 * @uses do_action() Calls 'bp_{@link bp_Component::name}_register_post_types'
+	 */
+	function register_post_types() {
+		do_action( 'bp_' . $this->id . '_register_post_types' );
+	}
+
+	/**
+	 * Register component specific taxonomies
+	 *
+	 * @since 1.5
+	 *
+	 * @uses do_action() Calls 'bp_{@link bp_Component::name}_register_taxonomies'
+	 */
+	function register_taxonomies() {
+		do_action( 'bp_' . $this->id . '_register_taxonomies' );
+	}
+
+	/**
+	 * Add any additional rewrite tags
+	 *
+	 * @since 1.5
+	 *
+	 * @uses do_action() Calls 'bp_{@link bp_Component::name}_add_rewrite_tags'
+	 */
+	function add_rewrite_tags() {
+		do_action( 'bp_' . $this->id . '_add_rewrite_tags' );
+	}
+
+	/**
+	 * Generate any additional rewrite rules
+	 *
+	 * @since 1.5
+	 *
+	 * @uses do_action() Calls 'bp_{@link bp_Component::name}_generate_rewrite_rules'
+	 */
+	function generate_rewrite_rules ( $wp_rewrite ) {
+		do_action( 'bp_' . $this->id . '_generate_rewrite_rules' );
+	}
+}
+endif; // BP_Component
+
+?>
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 12c3b154c03e1818b9b1e39f578bb4780082cb3c..0c6c7f83ad6a4de2940a3a371a30585188ea8b22 100644
--- a/wp-content/plugins/buddypress/bp-core/bp-core-cssjs.php
+++ b/wp-content/plugins/buddypress/bp-core/bp-core-cssjs.php
@@ -1,29 +1,6 @@
 <?php
-
-/**
- * bp_core_add_admin_bar_css()
- *
- * Add the CSS needed for the admin bar on blogs (other than the root) and in the admin area.
- *
- * @package BuddyPress Core
- * @uses get_option() Selects a site setting from the DB.
- */
-function bp_core_add_admin_bar_css() {
-	global $bp, $current_blog;
-
-	if ( defined( 'BP_DISABLE_ADMIN_BAR' ) )
-		return false;
-
-	if ( ( bp_core_is_multisite() && $current_blog->blog_id != BP_ROOT_BLOG ) || is_admin() ) {
-		$stylesheet = get_blog_option( BP_ROOT_BLOG, 'stylesheet' );
-
-		if ( file_exists( WP_CONTENT_DIR . '/themes/' . $stylesheet . '/_inc/css/adminbar.css' ) )
-			wp_enqueue_style( 'bp-admin-bar', apply_filters( 'bp_core_admin_bar_css', WP_CONTENT_URL . '/themes/' . $stylesheet . '/_inc/css/adminbar.css' ) );
-		else
-			wp_enqueue_style( 'bp-admin-bar', apply_filters( 'bp_core_admin_bar_css', BP_PLUGIN_URL . '/bp-themes/bp-default/_inc/css/adminbar.css' ) );
-	}
-}
-add_action( 'init', 'bp_core_add_admin_bar_css' );
+// Exit if accessed directly
+if ( !defined( 'ABSPATH' ) ) exit;
 
 /**
  * bp_core_admin_menu_icon_css()
@@ -33,13 +10,24 @@ add_action( 'init', 'bp_core_add_admin_bar_css' );
  * @package BuddyPress Core
  */
 function bp_core_admin_menu_icon_css() {
-	global $bp;
-?>
+	global $bp; ?>
 
 	<style type="text/css">
-		ul#adminmenu li.toplevel_page_bp-general-settings .wp-menu-image a { background-image: url( <?php echo BP_PLUGIN_URL . '/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; }
+		/* 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
@@ -47,11 +35,16 @@ function bp_core_admin_menu_icon_css() {
 add_action( 'admin_head', 'bp_core_admin_menu_icon_css' );
 
 function bp_core_confirmation_js() {
-	global $current_blog;
+	global $wpdb;
 
-	if ( bp_core_is_multisite() && $current_blog->blog_id != BP_ROOT_BLOG )
+	if ( is_multisite() && $wpdb->blogid != bp_get_root_blog_id() )
 		return false;
-?>
+
+	if ( !wp_script_is( 'jquery' ) )
+		wp_enqueue_script( 'jquery' );
+
+	if ( !wp_script_is( 'jquery', 'done' ) )
+		wp_print_scripts( 'jquery' ); ?>
 
 	<script type="text/javascript"> jQuery(document).ready( function() { jQuery("a.confirm").click( function() { if ( confirm( '<?php _e( 'Are you sure?', 'buddypress' ) ?>' ) ) return true; else return false; }); });</script>
 
@@ -82,12 +75,18 @@ function bp_core_add_jquery_cropper() {
 function bp_core_add_cropper_inline_js() {
 	global $bp;
 
-	$image = apply_filters( 'bp_inline_cropper_image', getimagesize( BP_AVATAR_UPLOAD_PATH . $bp->avatar_admin->image->dir ) );
+	$image = apply_filters( 'bp_inline_cropper_image', getimagesize( bp_core_avatar_upload_path() . $bp->avatar_admin->image->dir ) );
 	$aspect_ratio = 1;
 
+	$full_height = bp_core_avatar_full_height();
+	$full_width  = bp_core_avatar_full_width();
+
 	// Calculate Aspect Ratio
-	if ( (int) constant( 'BP_AVATAR_FULL_HEIGHT' ) && ( (int) constant( 'BP_AVATAR_FULL_WIDTH' ) != (int) constant( 'BP_AVATAR_FULL_HEIGHT' ) ) )
-		$aspect_ratio = (int) constant( 'BP_AVATAR_FULL_WIDTH' ) / (int) constant( 'BP_AVATAR_FULL_HEIGHT' );
+	if ( $full_height && ( $full_width != $full_height ) )
+		$aspect_ratio = $full_width / $full_height;
+
+	$width  = $image[0] / 2;
+	$height = $image[1] / 2;
 ?>
 
 	<script type="text/javascript">
@@ -97,8 +96,9 @@ function bp_core_add_cropper_inline_js() {
 				onSelect: showPreview,
 				onSelect: updateCoords,
 				aspectRatio: <?php echo $aspect_ratio ?>,
-				setSelect: [ 50, 50, <?php echo $image[0] / 2 ?>, <?php echo $image[1] / 2 ?> ]
+				setSelect: [ 50, 50, <?php echo $width ?>, <?php echo $height ?> ]
 			});
+			updateCoords({x: 50, y: 50, w: <?php echo $width ?>, h: <?php echo $height ?>});
 		});
 
 		function updateCoords(c) {
@@ -110,13 +110,13 @@ function bp_core_add_cropper_inline_js() {
 
 		function showPreview(coords) {
 			if ( parseInt(coords.w) > 0 ) {
-				var rx = <?php echo (int) constant( 'BP_AVATAR_FULL_WIDTH' ) ?> / coords.w;
-				var ry = <?php echo (int) constant( 'BP_AVATAR_FULL_HEIGHT' ) ?> / coords.h;
+				var rx = <?php echo $full_width; ?> / coords.w;
+				var ry = <?php echo $full_height; ?> / coords.h;
 
 				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 * <?php echo $image[0]; ?>) + 'px',
+					height: Math.round(ry * <?php echo $image[1]; ?>) + 'px',
 				<?php endif; ?>
 					marginLeft: '-' + Math.round(rx * coords.x) + 'px',
 					marginTop: '-' + Math.round(ry * coords.y) + 'px'
@@ -148,7 +148,7 @@ function bp_core_add_cropper_inline_css() {
 		.jcrop-tracker { width: 100%; height: 100%; }
 		.custom .jcrop-vline, .custom .jcrop-hline { background: yellow; }
 		.custom .jcrop-handle { border-color: black; background-color: #C7BB00; -moz-border-radius: 3px; -webkit-border-radius: 3px; }
-		#avatar-crop-pane { width: <?php echo BP_AVATAR_FULL_WIDTH ?>px; height: <?php echo BP_AVATAR_FULL_HEIGHT ?>px; overflow: hidden; }
+		#avatar-crop-pane { width: <?php echo bp_core_avatar_full_width() ?>px; height: <?php echo bp_core_avatar_full_height() ?>px; overflow: hidden; }
 		#avatar-crop-submit { margin: 20px 0; }
 		#avatar-upload-form img, #create-group-form img, #group-settings-form img { border: none !important; }
 	</style>
@@ -173,4 +173,4 @@ function bp_core_add_ajax_url_js() {
 }
 add_action( 'wp_head', 'bp_core_add_ajax_url_js' );
 
-?>
+?>
\ No newline at end of file
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 a33faef43313475a264e1778276d23bc2c8dedfa..99839fb94cf54c95e6644fccd70021f952f72c1d 100644
--- a/wp-content/plugins/buddypress/bp-core/bp-core-filters.php
+++ b/wp-content/plugins/buddypress/bp-core/bp-core-filters.php
@@ -1,4 +1,33 @@
 <?php
+// Exit if accessed directly
+if ( !defined( 'ABSPATH' ) ) exit;
+
+/**
+ * bp_core_exclude_pages()
+ *
+ * Excludes specific pages from showing on page listings, for example the "Activation" page.
+ *
+ * @package BuddyPress Core
+ * @uses bp_is_active() checks if a BuddyPress component is active.
+ * @return array The list of page ID's to exclude
+ */
+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;
+	}
+
+	return apply_filters( 'bp_core_exclude_pages', $pages );
+}
+add_filter( 'wp_list_pages_excludes', 'bp_core_exclude_pages' );
 
 /**
  * bp_core_email_from_name_filter()
@@ -10,7 +39,7 @@
  * @return The blog name for the root blog
  */
 function bp_core_email_from_name_filter() {
- 	return apply_filters( 'bp_core_email_from_name_filter', wp_specialchars_decode( get_blog_option( BP_ROOT_BLOG, 'blogname' ), ENT_QUOTES ) );
+ 	return apply_filters( 'bp_core_email_from_name_filter', wp_specialchars_decode( get_blog_option( bp_get_root_blog_id(), 'blogname' ), ENT_QUOTES ) );
 }
 add_filter( 'wp_mail_from_name', 'bp_core_email_from_name_filter' );
 
@@ -20,13 +49,12 @@ add_filter( 'wp_mail_from_name', 'bp_core_email_from_name_filter' );
  * Sets the "From" address in emails sent
  *
  * @package BuddyPress Core
- * @global $current_site Object containing current site metadata
  * @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', 'buddypress' ) . '@' . $domain[2] );
+	return apply_filters( 'bp_core_email_from_address_filter', 'noreply@' . $domain[2] );
 }
 add_filter( 'wp_mail_from', 'bp_core_email_from_address_filter' );
 
@@ -41,12 +69,12 @@ add_filter( 'wp_mail_from', 'bp_core_email_from_address_filter' );
  * @package BuddyPress Core
  */
 function bp_core_allow_default_theme( $themes ) {
-	global $bp, $current_blog;
+	global $bp, $wpdb;
 
 	if ( !is_super_admin() )
 		return $themes;
 
-	if ( $current_blog->ID == $bp->root_blog ) {
+	if ( $wpdb->blogid == bp_get_root_blog_id() ) {
 		$themes['bp-default'] = 1;
 	}
 
@@ -99,18 +127,20 @@ add_filter( 'comments_array', 'bp_core_filter_comments', 10, 2 );
  * @package BuddyPress Core
  */
 function bp_core_login_redirect( $redirect_to ) {
-	global $bp, $current_blog;
+	global $bp, $wpdb;
 
-	if ( bp_core_is_multisite() && $current_blog->blog_id != BP_ROOT_BLOG )
+	// Don't mess with the redirect if this is not the root blog
+	if ( is_multisite() && $wpdb->blogid != bp_get_root_blog_id() )
 		return $redirect_to;
 
-	if ( !empty( $_REQUEST['redirect_to'] ) || strpos( $_REQUEST['redirect_to'], 'wp-admin' ) )
+	// If the redirect doesn't contain 'wp-admin', it's OK
+	if ( !empty( $_REQUEST['redirect_to'] ) && false === strpos( $_REQUEST['redirect_to'], 'wp-admin' ) )
 		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->root_domain;
+	return bp_get_root_domain();
 }
 add_filter( 'login_redirect', 'bp_core_login_redirect' );
 
@@ -161,29 +191,30 @@ if ( !is_admin() && empty( $_GET['e'] ) )
 
 // Notify user of signup success.
 function bp_core_activation_signup_blog_notification( $domain, $path, $title, $user, $user_email, $key, $meta ) {
-	global $current_site;
 
 	// Send email with activation link.
 	$activate_url = bp_get_activation_page() ."?key=$key";
-	$activate_url = esc_url($activate_url);
+	$activate_url = esc_url( $activate_url );
 
-	$admin_email = get_site_option( "admin_email" );
+	$admin_email = get_site_option( 'admin_email' );
 
 	if ( empty( $admin_email ) )
 		$admin_email = 'support@' . $_SERVER['SERVER_NAME'];
 
-	$from_name = ( '' == get_site_option( "site_name" ) ) ? 'WordPress' : wp_specialchars( 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 and blog, please click the following link:\n\n%s\n\n\n\nAfter you activate, you can visit your blog here:\n\n%s", 'buddypress' ), $activate_url, esc_url("http://{$domain}{$path}" ) );
-	$subject = '[' . $from_name . '] ' . sprintf(__('Activate %s', 'buddypress' ), esc_url('http://' . $domain . $path));
+	$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 and blog, please click the following link:\n\n%1\$s\n\n\n\nAfter you activate, you can visit your blog here:\n\n%2\$s", 'buddypress' ), $activate_url, esc_url( "http://{$domain}{$path}" ) );
+	$subject         = '[' . $from_name . '] ' . sprintf(__( 'Activate %s', 'buddypress' ), esc_url( 'http://' . $domain . $path ) );
 
-	/* Send the message */
-	$to = apply_filters( 'bp_core_activation_signup_blog_notification_to', $user_email );
-	$subject = apply_filters( 'bp_core_activation_signup_blog_notification_subject', $subject );
-	$message = apply_filters( 'bp_core_activation_signup_blog_notification_message', $message );
+	// Send the message
+	$to              = apply_filters( 'bp_core_activation_signup_blog_notification_to',   $user_email, $domain, $path, $title, $user, $user_email, $key, $meta );
+	$subject         = apply_filters( 'bp_core_activation_signup_blog_notification_subject', $subject, $domain, $path, $title, $user, $user_email, $key, $meta );
+	$message         = apply_filters( 'bp_core_activation_signup_blog_notification_message', $message, $domain, $path, $title, $user, $user_email, $key, $meta );
 
 	wp_mail( $to, $subject, $message, $message_headers );
 
+	do_action( 'bp_core_sent_blog_signup_email', $admin_email, $subject, $message, $domain, $path, $title, $user, $user_email, $key, $meta );
+
 	// Return false to stop the original WPMU function from continuing
 	return false;
 }
@@ -191,35 +222,112 @@ if ( !is_admin() )
 	add_filter( 'wpmu_signup_blog_notification', 'bp_core_activation_signup_blog_notification', 1, 7 );
 
 function bp_core_activation_signup_user_notification( $user, $user_email, $key, $meta ) {
-	global $current_site;
 
-	$activate_url = bp_get_activation_page() ."?key=$key";
+	$activate_url = bp_get_activation_page() . "?key=$key";
 	$activate_url = esc_url($activate_url);
-	$admin_email = get_site_option( "admin_email" );
+	$admin_email  = get_site_option( 'admin_email' );
 
 	if ( empty( $admin_email ) )
 		$admin_email = 'support@' . $_SERVER['SERVER_NAME'];
 
-	/* If this is an admin generated activation, add a param to email the user login details */
-	if ( is_admin() )
-		$email = '&e=1';
+	// If this is an admin generated activation, add a param to email the
+	// user login details
+	$email = is_admin() ? '&e=1' : '';
 
-	$from_name = ( '' == get_site_option( "site_name" ) ) ? 'WordPress' : wp_specialchars( 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, esc_url( "http://{$domain}{$path}" ) );
-	$subject = '[' . $from_name . '] ' . __( 'Activate Your Account', 'buddypress' );
+	$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 );
+	$subject         = '[' . $from_name . '] ' . __( 'Activate Your Account', 'buddypress' );
 
-	/* Send the message */
-	$to = apply_filters( 'bp_core_activation_signup_user_notification_to', $user_email );
-	$subject = apply_filters( 'bp_core_activation_signup_user_notification_subject', $subject );
-	$message = apply_filters( 'bp_core_activation_signup_user_notification_message', $message );
+	// Send the message
+	$to      = apply_filters( 'bp_core_activation_signup_user_notification_to',   $user_email, $user, $user_email, $key, $meta );
+	$subject = apply_filters( 'bp_core_activation_signup_user_notification_subject', $subject, $user, $user_email, $key, $meta );
+	$message = apply_filters( 'bp_core_activation_signup_user_notification_message', $message, $user, $user_email, $key, $meta );
 
 	wp_mail( $to, $subject, $message, $message_headers );
 
+	do_action( 'bp_core_sent_user_signup_email', $admin_email, $subject, $message, $user, $user_email, $key, $meta );
+
 	// Return false to stop the original WPMU function from continuing
 	return false;
 }
 if ( !is_admin() || ( is_admin() && empty( $_POST['noconfirmation'] ) ) )
 	add_filter( 'wpmu_signup_user_notification', 'bp_core_activation_signup_user_notification', 1, 4 );
 
+/**
+ * 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
+ */
+function bp_modify_page_title( $title, $sep, $seplocation ) {
+	global $bp, $post, $wp_query;
+
+	// If this is not a BP page, just return the title produced by WP
+	if ( bp_is_blog_page() )
+		return $title;
+
+	// If this is the front page of the site, return WP's title
+	if ( is_front_page() || is_home() )
+		return $title;
+
+	$title = '';
+
+	// Displayed user
+	if ( !empty( $bp->displayed_user->fullname ) && !is_404() ) {
+		// 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' ) ) );
+
+	// 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'] : '';
+		// 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() ) );
+
+	// 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' ) );
+
+	// Sign up page
+	} elseif ( bp_is_register_page() ) {
+		$title = __( 'Create an Account', 'buddypress' );
+
+	// Activation page
+	} elseif ( bp_is_activation_page() ) {
+		$title = __( 'Activate your Account', 'buddypress' );
+
+	// Group creation page
+	} elseif ( bp_is_group_create() ) {
+		$title = __( 'Create a Group', 'buddypress' );
+
+	// Blog creation page
+	} elseif ( bp_is_create_blog() ) {
+		$title = __( 'Create a Site', 'buddypress' );
+	}
+
+	// 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 );
+}
+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
new file mode 100644
index 0000000000000000000000000000000000000000..6cd07430fd1dd83867867cd1a62a7407a573912e
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-core/bp-core-functions.php
@@ -0,0 +1,1469 @@
+<?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.
+ *
+ * @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
+ */
+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 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 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 );
+}
+
+/**
+ * Allow filtering of database prefix. Intended for use in multinetwork installations.
+ *
+ * @global object $wpdb WordPress database object
+ * @return string Filtered database prefix
+ */
+function bp_core_get_table_prefix() {
+	global $wpdb;
+
+	return apply_filters( 'bp_core_get_table_prefix', $wpdb->base_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.
+ */
+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( $component_name ) || empty( $page_id ) ) {
+				unset( $page_ids[$component_name] );
+			}
+		}
+	}
+
+	return apply_filters( 'bp_core_get_directory_page_ids', $page_ids );
+}
+
+/**
+ * Stores BP pages in the meta table, depending on setup
+ *
+ * bp-pages data is stored in site_options (falls back to options on non-MS), in an array keyed by
+ * 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
+ *
+ * @param array $blog_page_ids The IDs of the WP pages corresponding to BP component directories
+ */
+function bp_core_update_directory_page_ids( $blog_page_ids ) {
+	bp_update_option( 'bp-pages', $blog_page_ids );
+}
+
+/**
+ * Get bp-pages names and slugs
+ *
+ * @package BuddyPress Core
+ * @since 1.5
+ *
+ * @return obj $pages Page names, IDs, and slugs
+ */
+function bp_core_get_directory_pages() {
+	global $wpdb, $bp;
+
+	// Set pages as standard class
+	$pages = new stdClass;
+
+	// Get pages and IDs
+	if ( $page_ids = bp_core_get_directory_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' " ) );
+
+		foreach ( (array)$page_ids as $component_id => $page_id ) {
+			foreach ( (array)$page_names as $page_name ) {
+				if ( $page_name->ID == $page_id ) {
+					$pages->{$component_id}->name  = $page_name->post_name;
+					$pages->{$component_id}->id    = $page_name->ID;
+					$pages->{$component_id}->title = $page_name->post_title;
+					$slug[]                        = $page_name->post_name;
+
+					// Get the slug
+					while ( $page_name->post_parent != 0 ) {
+						$parent                 = $wpdb->get_results( $wpdb->prepare( "SELECT post_name, post_parent FROM {$posts_table_name} WHERE ID = %d", $page_name->post_parent ) );
+						$slug[]                 = $parent[0]->post_name;
+						$page_name->post_parent = $parent[0]->post_parent;
+					}
+
+					$pages->{$component_id}->slug = implode( '/', array_reverse( (array)$slug ) );
+				}
+
+				unset( $slug );
+			}
+		}
+	}
+
+	return apply_filters( 'bp_core_get_directory_pages', $pages );
+}
+
+/**
+ * Creates a default component slug from a WP page root_slug
+ *
+ * Since 1.5, BP components get their root_slug (the slug used immediately
+ * following the root domain) from the slug of a corresponding WP page.
+ *
+ * E.g. if your BP installation at example.com has its members page at
+ * example.com/community/people, $bp->members->root_slug will be 'community/people'.
+ *
+ * By default, this function creates a shorter version of the root_slug for
+ * use elsewhere in the URL, by returning the content after the final '/'
+ * in the root_slug ('people' in the example above).
+ *
+ * Filter on 'bp_core_component_slug_from_root_slug' to override this method
+ * in general, or define a specific component slug constant (e.g. BP_MEMBERS_SLUG)
+ * to override specific component slugs.
+ *
+ * @package BuddyPress Core
+ * @since 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
+ */
+function bp_core_component_slug_from_root_slug( $root_slug ) {
+	$slug_chunks = explode( '/', $root_slug );
+ 	$slug        = array_pop( $slug_chunks );
+
+ 	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
+ *
+ * @package BuddyPress Core
+ * @uses get_blog_option() WordPress function to fetch blog meta.
+ * @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() );
+
+	return apply_filters( 'bp_core_get_root_domain', $domain );
+}
+
+/**
+ * Get the current GMT time to save into the DB
+ *
+ * @package BuddyPress Core
+ * @since 1.2.6
+ */
+function bp_core_current_time( $gmt = true ) {
+	// Get current time in MYSQL format
+	$current_time = current_time( 'mysql', $gmt );
+
+	return apply_filters( 'bp_core_current_time', $current_time );
+}
+
+/**
+ * Adds a feedback (error/success) message to the WP cookie so it can be
+ * displayed after the page reloads.
+ *
+ * @package BuddyPress Core
+ *
+ * @global obj $bp
+ * @param str $message Feedback to give to user
+ * @param str $type updated|success|error|warning
+ */
+function bp_core_add_message( $message, $type = '' ) {
+	global $bp;
+
+	// Success is the default
+	if ( empty( $type ) )
+		$type = 'success';
+
+	// Send the values to the cookie for page reload display
+	@setcookie( 'bp-message',      $message, time() + 60 * 60 * 24, COOKIEPATH );
+	@setcookie( 'bp-message-type', $type,    time() + 60 * 60 * 24, COOKIEPATH );
+
+	/***
+	 * Send the values to the $bp global so we can still output messages
+	 * without a page reload
+	 */
+	$bp->template_message      = $message;
+	$bp->template_message_type = $type;
+}
+
+/**
+ * Checks if there is a feedback message in the WP cookie, if so, adds a
+ * "template_notices" action so that the message can be parsed into the template
+ * and displayed to the user.
+ *
+ * After the message is displayed, it removes the message vars from the cookie
+ * so that the message is not shown to the user multiple times.
+ *
+ * @package BuddyPress Core
+ * @global $bp_message The message text
+ * @global $bp_message_type The type of message (error/success)
+ * @uses setcookie() Sets a cookie value for the user.
+ */
+function bp_core_setup_message() {
+	global $bp;
+
+	if ( empty( $bp->template_message ) && isset( $_COOKIE['bp-message'] ) )
+		$bp->template_message = $_COOKIE['bp-message'];
+
+	if ( empty( $bp->template_message_type ) && isset( $_COOKIE['bp-message-type'] ) )
+		$bp->template_message_type = $_COOKIE['bp-message-type'];
+
+	add_action( 'template_notices', 'bp_core_render_message' );
+
+	@setcookie( 'bp-message',      false, time() - 1000, COOKIEPATH );
+	@setcookie( 'bp-message-type', false, time() - 1000, COOKIEPATH );
+}
+add_action( 'bp_actions', 'bp_core_setup_message', 5 );
+
+/**
+ * Renders a feedback message (either error or success message) to the theme template.
+ * 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
+ */
+function bp_core_render_message() {
+	global $bp;
+
+	if ( isset( $bp->template_message ) && $bp->template_message ) :
+		$type = ( 'success' == $bp->template_message_type ) ? 'updated' : 'error'; ?>
+
+		<div id="message" class="<?php echo $type; ?>">
+			<p><?php echo stripslashes( esc_attr( $bp->template_message ) ); ?></p>
+		</div>
+
+	<?php
+
+		do_action( 'bp_core_render_message' );
+
+	endif;
+}
+
+/**
+ * Format numbers the BuddyPress way
+ *
+ * @param str $number
+ * @param bool $decimals
+ * @return str
+ */
+function bp_core_number_format( $number, $decimals = false ) {
+	// Check we actually have a number first.
+	if ( empty( $number ) )
+		return $number;
+
+	return apply_filters( 'bp_core_number_format', number_format( $number, $decimals ), $number, $decimals );
+}
+
+/**
+ * Based on function created by Dunstan Orchard - http://1976design.com
+ *
+ * This function will return an English representation of the time elapsed
+ * since a given date.
+ * eg: 2 hours and 50 minutes
+ * eg: 4 days
+ * eg: 4 weeks and 6 days
+ *
+ * @package BuddyPress Core
+ * @param $older_date int Unix timestamp of date you want to calculate the time since for
+ * @param $newer_date int Unix timestamp of date to compare older date to. Default false (current time).
+ * @return str The time since.
+ */
+function bp_core_time_since( $older_date, $newer_date = false ) {
+
+	// Setup the strings
+	$unknown_text   = apply_filters( 'bp_core_time_since_unknown_text',   __( 'sometime',  'buddypress' ) );
+	$right_now_text = apply_filters( 'bp_core_time_since_right_now_text', __( 'right now', 'buddypress' ) );
+	$ago_text       = apply_filters( 'bp_core_time_since_ago_text',       __( '%s ago',    'buddypress' ) );
+
+	// array of time period chunks
+	$chunks = array(
+		array( 60 * 60 * 24 * 365 , __( 'year',   'buddypress' ), __( 'years',   'buddypress' ) ),
+		array( 60 * 60 * 24 * 30 ,  __( 'month',  'buddypress' ), __( 'months',  'buddypress' ) ),
+		array( 60 * 60 * 24 * 7,    __( 'week',   'buddypress' ), __( 'weeks',   'buddypress' ) ),
+		array( 60 * 60 * 24 ,       __( 'day',    'buddypress' ), __( 'days',    'buddypress' ) ),
+		array( 60 * 60 ,            __( 'hour',   'buddypress' ), __( 'hours',   'buddypress' ) ),
+		array( 60 ,                 __( 'minute', 'buddypress' ), __( 'minutes', 'buddypress' ) ),
+		array( 1,                   __( 'second', 'buddypress' ), __( 'seconds', 'buddypress' ) )
+	);
+
+	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] );
+	}
+
+	/**
+	 * $newer_date will equal false if we want to know the time elapsed between
+	 * a date and the current time. $newer_date will have a value if we want to
+	 * work out time elapsed between two known dates.
+	 */
+	$newer_date = ( !$newer_date ) ? strtotime( bp_core_current_time() ) : $newer_date;
+
+	// Difference in seconds
+	$since = $newer_date - $older_date;
+
+	// Something went wrong with date calculation and we ended up with a negative date.
+	if ( 0 > $since ) {
+		$output = $unknown_text;
+
+	/**
+	 * We only want to output two chunks of time here, eg:
+	 * x years, xx months
+	 * x days, xx hours
+	 * so there's only two bits of calculation below:
+	 */
+	} else {
+
+		// Step one: the first chunk
+		for ( $i = 0, $j = count( $chunks ); $i < $j; ++$i ) {
+			$seconds = $chunks[$i][0];
+
+			// Finding the biggest chunk (if the chunk fits, break)
+			if ( ( $count = floor($since / $seconds) ) != 0 ) {
+				break;
+			}
+		}
+
+		// If $i iterates all the way to $j, then the event happened 0 seconds ago
+		if ( !isset( $chunks[$i] ) ) {
+			$output = $right_now_text;
+
+		} else {
+
+			// Set output var
+			$output = ( 1 == $count ) ? '1 '. $chunks[$i][1] : $count . ' ' . $chunks[$i][2];
+
+			// Step two: the second chunk
+			if ( $i + 2 < $j ) {
+				$seconds2 = $chunks[$i + 1][0];
+				$name2 = $chunks[$i + 1][1];
+
+				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];
+				}
+			}
+
+			// No output, so happened right now
+			if ( !(int)trim( $output ) ) {
+				$output = $right_now_text;
+			}
+		}
+	}
+
+	// Append 'ago' to the end of time-since if not 'right now'
+	if ( $output != $right_now_text ) {
+		$output = sprintf( $ago_text, $output );
+	}
+
+	return $output;
+}
+
+/**
+ * Record user activity to the database. Many functions use a "last active" feature to
+ * show the length of time since the user was last active.
+ * This function will update that time as a usermeta setting for the user every 5 minutes.
+ *
+ * @package BuddyPress Core
+ * @global $userdata WordPress user data for the current logged in user.
+ * @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;
+
+	if ( bp_core_is_user_spammer( $user_id ) || bp_core_is_user_deleted( $user_id ) )
+		return false;
+
+	$activity = bp_get_user_meta( $user_id, 'last_activity', true );
+
+	if ( !is_numeric( $activity ) )
+		$activity = strtotime( $activity );
+
+	// Get current time
+	$current_time = bp_core_current_time();
+
+	if ( empty( $activity ) || strtotime( $current_time ) >= strtotime( '+5 minutes', $activity ) )
+		bp_update_user_meta( $user_id, 'last_activity', $current_time );
+}
+add_action( 'wp_head', 'bp_core_record_activity' );
+
+/**
+ * Formats last activity based on time since date given.
+ *
+ * @package BuddyPress Core
+ * @param last_activity_date The date of last activity.
+ * @param $before The text to prepend to the activity time since figure.
+ * @param $after The text to append to the activity time since figure.
+ * @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' );
+	else
+		$last_active = sprintf( $string, bp_core_time_since( $last_activity_date ) );
+
+	return apply_filters( 'bp_core_get_last_activity', $last_active, $last_activity_date, $string );
+}
+
+/**
+ * Get the path of of the current site.
+ *
+ * @package BuddyPress Core
+ *
+ * @global $bp $bp
+ * @global object $current_site
+ * @return string
+ */
+function bp_core_get_site_path() {
+	global $bp, $current_site;
+
+	if ( is_multisite() )
+		$site_path = $current_site->path;
+	else {
+		$site_path = (array) explode( '/', home_url() );
+
+		if ( count( $site_path ) < 2 )
+			$site_path = '/';
+		else {
+			// Unset the first three segments (http(s)://domain.com part)
+			unset( $site_path[0] );
+			unset( $site_path[1] );
+			unset( $site_path[2] );
+
+			if ( !count( $site_path ) )
+				$site_path = '/';
+			else
+				$site_path = '/' . implode( '/', $site_path ) . '/';
+		}
+	}
+
+	return apply_filters( 'bp_core_get_site_path', $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.
+ */
+function bp_core_redirect( $location, $status = 302 ) {
+	global $bp_no_status_set;
+
+	// 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;
+
+	wp_redirect( $location, $status );
+	die;
+}
+
+/**
+ * Returns the referrer URL without the http(s)://
+ *
+ * @package BuddyPress Core
+ * @return The referrer URL
+ */
+function bp_core_referrer() {
+	$referer = explode( '/', wp_get_referer() );
+	unset( $referer[0], $referer[1], $referer[2] );
+	return implode( '/', $referer );
+}
+
+/**
+ * Adds illegal names to WP so that root components will not conflict with
+ * blog names on a subdirectory installation.
+ *
+ * For example, it would stop someone creating a blog with the slug "groups".
+ */
+function bp_core_add_illegal_names() {
+	update_site_option( 'illegal_names', get_site_option( 'illegal_names' ), array() );
+}
+
+/**
+ * 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;
+
+	if ( empty( $_POST['search-terms'] ) ) {
+		bp_core_redirect( bp_get_root_domain() );
+		return;
+	}
+
+	$search_terms = stripslashes( $_POST['search-terms'] );
+	$search_which = !empty( $_POST['search-which'] ) ? $_POST['search-which'] : '';
+	$query_string = '/?s=';
+
+	if ( empty( $slug ) ) {
+		switch ( $search_which ) {
+			case 'posts':
+				$slug = '';
+				$var  = '/?s=';
+
+				// If posts aren't displayed on the front page, find the post page's slug.
+				if ( 'page' == get_option( 'show_on_front' ) ) {
+					$page = get_post( get_option( 'page_for_posts' ) );
+
+					if ( !is_wp_error( $page ) && !empty( $page->post_name ) ) {
+						$slug = $page->post_name;
+						$var  = '?s=';
+					}
+				}
+				break;
+
+			case 'blogs':
+				$slug = bp_is_active( 'blogs' )  ? bp_get_blogs_root_slug()  : '';
+				break;
+
+			case 'forums':
+				$slug = bp_is_active( 'forums' ) ? bp_get_forums_root_slug() : '';
+				$query_string = '/?fs=';
+				break;
+
+			case 'groups':
+				$slug = bp_is_active( 'groups' ) ? bp_get_groups_root_slug() : '';
+				break;
+
+			case 'members':
+			default:
+				$slug = bp_get_members_root_slug();
+				break;
+		}
+
+		if ( empty( $slug ) && 'posts' != $search_which ) {
+			bp_core_redirect( bp_get_root_domain() );
+			return;
+		}
+	}
+
+	bp_core_redirect( apply_filters( 'bp_core_search_site', home_url( $slug . $query_string . urlencode( $search_terms ) ), $search_terms ) );
+}
+add_action( 'bp_init', 'bp_core_action_search_site', 7 );
+
+/**
+ * Prints the generation time in the footer of the site.
+ *
+ * @package BuddyPress Core
+ */
+function bp_core_print_generation_time() {
+?>
+
+<!-- Generated in <?php timer_stop(1); ?> seconds. (<?php echo get_num_queries(); ?> q) -->
+
+	<?php
+}
+add_action( 'wp_footer', 'bp_core_print_generation_time' );
+
+/**
+ * Load the buddypress translation file for current language
+ *
+ * @package BuddyPress Core
+ */
+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;
+
+	if ( file_exists( $mofile_global ) )
+		return load_textdomain( 'buddypress', $mofile_global );
+	elseif ( file_exists( $mofile_local ) )
+		return load_textdomain( 'buddypress', $mofile_local );
+	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' );
+
+/**
+ * Initializes {@link BP_Embed} after everything is loaded.
+ *
+ * @global object $bp BuddyPress global settings
+ * @package BuddyPress Core
+ * @since 1.5
+ */
+function bp_embed_init() {
+	global $bp;
+
+	if ( empty( $bp->embed ) )
+		$bp->embed = new BP_Embed();
+}
+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
+ * a convenience for compatibility with the new method.
+ *
+ * @global $bp BuddyPress global settings
+ * @param $slug str The slug of the component
+ */
+function bp_core_add_root_component( $slug ) {
+	global $bp;
+
+	if ( empty( $bp->pages ) )
+		$bp->pages = bp_core_get_directory_pages();
+
+	$match = false;
+
+	// Check if the slug is registered in the $bp->pages global
+	foreach ( (array)$bp->pages as $key => $page ) {
+		if ( $key == $slug || $page->slug == $slug )
+			$match = true;
+	}
+
+	// If there was no match, add a page for this root component
+	if ( empty( $match ) ) {
+		$bp->add_root[] = $slug;
+	}
+
+	// Make sure that this component is registered as requiring a top-level directory
+	if ( isset( $bp->{$slug} ) ) {
+		$bp->loaded_components[$bp->{$slug}->slug] = $bp->{$slug}->id;
+		$bp->{$slug}->has_directory = true;
+	}
+}
+
+function bp_core_create_root_component_page() {
+	global $bp;
+
+	$new_page_ids = array();
+
+	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() );
+	bp_core_update_directory_page_ids( $page_ids );
+}
+
+/**
+ * Is this the root blog ID?
+ *
+ * @package BuddyPress
+ * @since 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;
+
+	// Use current blog if no ID is passed
+	if ( empty( $blog_id ) )
+		$blog_id = get_current_blog_id();
+
+	// Compare to root blog ID
+	if ( $blog_id == bp_get_root_blog_id() )
+		$is_root_blog = true;
+
+	return apply_filters( 'bp_is_root_blog', (bool) $is_root_blog );
+}
+
+/**
+ * Is this bp_get_root_blog_id()?
+ *
+ * @package BuddyPress
+ * @since 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_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;
+	}
+
+	return apply_filters( 'bp_get_root_blog_id', (int) $root_blog_id );
+}
+
+/**
+ * Get the meta_key for a given piece of user metadata
+ *
+ * BuddyPress stores a number of pieces of userdata in the WordPress central usermeta table. In
+ * order to allow plugins to enable multiple instances of BuddyPress on a single WP installation,
+ * BP's usermeta keys are filtered with this function, so that they can be altered on the fly.
+ *
+ * Plugin authors should use BP's _user_meta() functions, which bakes in bp_get_user_meta_key().
+ *    $last_active = bp_get_user_meta( $user_id, 'last_activity', true );
+ * If you have to use WP's _user_meta() functions for some reason, you should use this function, eg
+ *    $last_active = get_user_meta( $user_id, bp_get_user_meta_key( 'last_activity' ), true );
+ * If using the WP functions, do not not hardcode your meta keys.
+ *
+ * @package BuddyPress
+ * @since 1.5
+ *
+ * @uses apply_filters() Filter bp_get_user_meta_key to modify keys individually
+ * @param str $key
+ * @return str $key
+ */
+function bp_get_user_meta_key( $key = false ) {
+	return apply_filters( 'bp_get_user_meta_key', $key );
+}
+
+/**
+ * Get a piece of usermeta
+ *
+ * This is a wrapper for get_user_meta() that allows for easy use of bp_get_user_meta_key(), thereby
+ * increasing compatibility with non-standard BP setups.
+ *
+ * @package BuddyPress
+ * @since 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
+ * @param int $user_id The id of the user whose meta you're fetching
+ * @param string $key The meta key to retrieve.
+ * @param bool $single Whether to return a single value.
+ * @return mixed Will be an array if $single is false. Will be value of meta data field if $single
+ *  is true.
+ */
+function bp_get_user_meta( $user_id, $key, $single = false ) {
+	return get_user_meta( $user_id, bp_get_user_meta_key( $key ), $single );
+}
+
+/**
+ * Update a piece of usermeta
+ *
+ * This is a wrapper for update_user_meta() that allows for easy use of bp_get_user_meta_key(),
+ * thereby increasing compatibility with non-standard BP setups.
+ *
+ * @package BuddyPress
+ * @since 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
+ * @param int $user_id The id of the user whose meta you're setting
+ * @param string $key The meta key to set.
+ * @param mixed $value Metadata value.
+ * @param mixed $prev_value Optional. Previous value to check before removing.
+ * @return bool False on failure, true if success.
+ */
+function bp_update_user_meta( $user_id, $key, $value, $prev_value = '' ) {
+	return update_user_meta( $user_id, bp_get_user_meta_key( $key ), $value, $prev_value );
+}
+
+/**
+ * Delete a piece of usermeta
+ *
+ * This is a wrapper for delete_user_meta() that allows for easy use of bp_get_user_meta_key(),
+ * thereby increasing compatibility with non-standard BP setups.
+ *
+ * @package BuddyPress
+ * @since 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
+ * @param int $user_id The id of the user whose meta you're deleting
+ * @param string $key The meta key to delete.
+ * @param mixed $value Optional. Metadata value.
+ * @return bool False for failure. True for success.
+ */
+function bp_delete_user_meta( $user_id, $key, $value = '' ) {
+	return delete_user_meta( $user_id, bp_get_user_meta_key( $key ), $value );
+}
+
+/**
+ * Are we running username compatibility mode?
+ *
+ * @package BuddyPress
+ * @since 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
+ */
+function bp_is_username_compatibility_mode() {
+	return apply_filters( 'bp_is_username_compatibility_mode', defined( 'BP_ENABLE_USERNAME_COMPATIBILITY_MODE' ) && BP_ENABLE_USERNAME_COMPATIBILITY_MODE );
+}
+
+/**
+ * Are we running multiblog mode?
+ *
+ * Note that BP_ENABLE_MULTIBLOG is different from (but dependent on) WP Multisite. "Multiblog" is
+ * a BP setup that allows BP content to be viewed in the theme, and with the URL, of every blog
+ * on the network. Thus, instead of having all 'boonebgorges' links go to
+ *   http://example.com/members/boonebgorges
+ * on the root blog, each blog will have its own version of the same profile content, eg
+ *   http://site2.example.com/members/boonebgorges (for subdomains)
+ *   http://example.com/site2/members/boonebgorges (for subdirectories)
+ *
+ * Multiblog mode is disabled by default, meaning that all BP content must be viewed on the root
+ * blog.
+ *
+ * @package BuddyPress
+ * @since 1.5
+ *
+ * @uses apply_filters() Filter 'bp_is_multiblog_mode' to alter
+ * @return bool False when multiblog mode is disabled (default); true when enabled
+ */
+function bp_is_multiblog_mode() {
+	return apply_filters( 'bp_is_multiblog_mode', is_multisite() && defined( 'BP_ENABLE_MULTIBLOG' ) && BP_ENABLE_MULTIBLOG );
+}
+
+/**
+ * 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.
+ *
+ * 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
+ *
+ * @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 );
+}
+
+/**
+ * Are oembeds allowed in activity items?
+ *
+ * @return bool False when activity embed support is disabled; true when enabled (default)
+ * @since 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 );
+}
+
+/**
+ * Are oembeds allwoed in activity replies?
+ *
+ * @return bool False when activity replies embed support is disabled; true when enabled (default)
+ * @since 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 );
+}
+
+/**
+ * Are oembeds allowed in forum posts?
+ *
+ * @return bool False when form post embed support is disabled; true when enabled (default)
+ * @since 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 );
+}
+
+/**
+ * Are oembeds allowed in private messages?
+ *
+ * @return bool False when form post embed support is disabled; true when enabled (default)
+ * @since 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 );
+}
+
+/**
+ * Output the correct URL based on BuddyPress and WordPress configuration
+ *
+ * @package BuddyPress
+ * @since 1.5
+ *
+ * @param string $path
+ * @param string $scheme
+ *
+ * @uses bp_get_admin_url()
+ */
+function bp_admin_url( $path = '', $scheme = 'admin' ) {
+	echo bp_get_admin_url( $path, $scheme );
+}
+	/**
+	 * Return the correct URL based on BuddyPress and WordPress configuration
+	 *
+	 * @package BuddyPress
+	 * @since 1.5
+	 *
+	 * @param string $path
+	 * @param string $scheme
+	 *
+	 * @uses bp_core_do_network_admin()
+	 * @uses network_admin_url()
+	 * @uses admin_url()
+	 */
+	function bp_get_admin_url( $path = '', $scheme = 'admin' ) {
+
+		// Links belong in network admin
+		if ( bp_core_do_network_admin() )
+			$url = network_admin_url( $path, $scheme );
+
+		// Links belong in site admin
+		else
+			$url = admin_url( $path, $scheme );
+
+		return $url;
+	}
+
+/** Global Manipulators *******************************************************/
+
+/**
+ * Set the $bp->is_directory global
+ *
+ * @global obj $bp
+ * @param bool $is_directory
+ * @param str $component
+ */
+function bp_update_is_directory( $is_directory = false, $component = '' ) {
+	global $bp;
+
+	if ( empty( $component ) )
+		$component = bp_current_component();
+
+	$bp->is_directory = apply_filters( 'bp_update_is_directory', $is_directory, $component );
+}
+
+/**
+ * Set the $bp->is_item_admin global
+ *
+ * @global obj $bp
+ * @param bool $is_item_admin
+ * @param str $component
+ */
+function bp_update_is_item_admin( $is_item_admin = false, $component = '' ) {
+	global $bp;
+
+	if ( empty( $component ) )
+		$component = bp_current_component();
+
+	$bp->is_item_admin = apply_filters( 'bp_update_is_item_admin', $is_item_admin, $component );
+}
+
+/**
+ * Set the $bp->is_item_mod global
+ *
+ * @global obj $bp
+ * @param bool $is_item_mod
+ * @param str $component
+ */
+function bp_update_is_item_mod( $is_item_mod = false, $component = '' ) {
+	global $bp;
+
+	if ( empty( $component ) )
+		$component = bp_current_component();
+
+	$bp->is_item_mod = apply_filters( 'bp_update_is_item_mod', $is_item_mod, $component );
+}
+
+/**
+ * Trigger a 404
+ *
+ * @global object $bp Global BuddyPress settings object
+ * @global WP_Query $wp_query WordPress query object
+ * @param string $redirect If 'remove_canonical_direct', remove WordPress' "helpful" redirect_canonical action.
+ * @since 1.5
+ */
+function bp_do_404( $redirect = 'remove_canonical_direct' ) {
+	global $bp, $wp_query;
+
+	do_action( 'bp_do_404', $redirect );
+
+	$wp_query->set_404();
+	status_header( 404 );
+	nocache_headers();
+
+	if ( 'remove_canonical_direct' == $redirect )
+		remove_action( 'template_redirect', 'redirect_canonical' );
+}
+?>
diff --git a/wp-content/plugins/buddypress/bp-core/bp-core-hooks.php b/wp-content/plugins/buddypress/bp-core/bp-core-hooks.php
new file mode 100644
index 0000000000000000000000000000000000000000..b440490342646862daca591b2350d0c41970504d
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-core/bp-core-hooks.php
@@ -0,0 +1,114 @@
+<?php
+// Exit if accessed directly
+if ( !defined( 'ABSPATH' ) ) exit;
+
+/** Loaded ********************************************************************/
+
+add_action( 'plugins_loaded', 'bp_loaded',  10 );
+
+add_action( 'bp_loaded',      'bp_include', 2  );
+
+add_action( 'wp',             'bp_actions', 3  );
+
+add_action( 'wp',             'bp_screens', 4  );
+
+/** Init **********************************************************************/
+
+// Attach bp_init to WordPress init
+add_action( 'init',       'bp_init'                    );
+
+// Parse the URI and set globals
+add_action( 'bp_init',    'bp_core_set_uri_globals', 2 );
+
+// Setup component globals
+add_action( 'bp_init',    'bp_setup_globals',        4 );
+
+// Setup the navigation menu
+add_action( 'bp_init',    'bp_setup_nav',            7 );
+
+// Setup the navigation menu
+add_action( 'admin_bar_menu',    'bp_setup_admin_bar'  );
+
+// Setup the title
+add_action( 'bp_init',    'bp_setup_title',          9 );
+
+// Setup widgets
+add_action( 'bp_loaded',  'bp_setup_widgets'           );
+
+// Setup admin bar
+add_action( 'bp_loaded',  'bp_core_load_admin_bar'     );
+
+/** The hooks *****************************************************************/
+
+/**
+ * Include files on this action
+ */
+function bp_include() {
+	do_action( 'bp_include' );
+}
+
+/**
+ * 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 admin bar
+ */
+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' );
+}
+
+/**
+ * Attach potential template actions
+ */
+function bp_actions() {
+	do_action( 'bp_actions' );
+}
+
+/**
+ * Attach potential template screens
+ */
+function bp_screens() {
+	do_action( 'bp_screens' );
+}
+
+?>
\ No newline at end of file
diff --git a/wp-content/plugins/buddypress/bp-core/bp-core-loader.php b/wp-content/plugins/buddypress/bp-core/bp-core-loader.php
new file mode 100644
index 0000000000000000000000000000000000000000..3a167107df4ef76af1a50352d0f8d1d3ca2d1a89
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-core/bp-core-loader.php
@@ -0,0 +1,234 @@
+<?php
+// 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 {
+
+	function __construct() {
+		parent::start(
+			'_core',
+			__( 'BuddyPress Core', 'buddypress' )
+			, BP_PLUGIN_DIR
+		);
+
+		$this->bootstrap();
+	}
+
+	private function bootstrap() {
+		global $bp;
+
+		/**
+		 * At this point in the stack, BuddyPress core has been loaded but
+		 * individual components (friends/activity/groups/etc...) have not.
+		 *
+		 * The 'bp_core_loaded' action lets you execute code ahead of the
+		 * other components.
+		 */
+		do_action( 'bp_core_loaded' );
+
+		/** Components ********************************************************/
+
+		// Set the included and optional components.
+		$bp->optional_components = apply_filters( 'bp_optional_components', array( 'activity', 'blogs', 'forums', 'friends', 'groups', 'messages', 'settings', 'xprofile' ) );
+
+		// Set the required components
+		$bp->required_components = apply_filters( 'bp_required_components', array( 'members' ) );
+
+		// Get a list of activated components
+		if ( $active_components = bp_get_option( 'bp-active-components' ) ) {
+			$bp->active_components      = apply_filters( 'bp_active_components', $active_components );
+			$bp->deactivated_components = apply_filters( 'bp_deactivated_components', array_values( array_diff( array_values( array_merge( $bp->optional_components, $bp->required_components ) ), array_keys( $bp->active_components ) ) ) );
+
+		// 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 ) );
+
+			// Set globals
+			$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 );
+
+			// 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 );
+
+			// Set the active component global
+			$bp->active_components = apply_filters( 'bp_active_components', $bp->active_components );
+		}
+
+		// Loop through optional components
+		foreach( $bp->optional_components as $component )
+			if ( bp_is_active( $component ) && file_exists( BP_PLUGIN_DIR . '/bp-' . $component . '/bp-' . $component . '-loader.php' ) )
+				include( BP_PLUGIN_DIR . '/bp-' . $component . '/bp-' . $component . '-loader.php' );
+
+		// Loop through required components
+		foreach( $bp->required_components as $component )
+			if ( file_exists( BP_PLUGIN_DIR . '/bp-' . $component . '/bp-' . $component . '-loader.php' ) )
+				include( BP_PLUGIN_DIR . '/bp-' . $component . '/bp-' . $component . '-loader.php' );
+
+		// Add Core to required components
+		$bp->required_components[] = 'core';
+	}
+
+	function setup_globals() {
+		global $bp;
+
+		/** Database **********************************************************/
+
+		// Get the base database prefix
+		if ( empty( $bp->table_prefix ) )
+			$bp->table_prefix = bp_core_get_table_prefix();
+
+		// The domain for the root of the site where the main blog resides
+		if ( empty( $bp->root_domain ) )
+			$bp->root_domain = bp_core_get_root_domain();
+
+		// Fetches all of the core BuddyPress settings in one fell swoop
+		if ( empty( $bp->site_options ) )
+			$bp->site_options = bp_core_get_root_options();
+
+		// The names of the core WordPress pages used to display BuddyPress content
+		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;
+
+		/** Avatars ***********************************************************/
+
+		// Fetches the default Gravatar image to use if the user/group/blog has no avatar or gravatar
+		$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 );
+
+		// Notifications Table
+		$bp->core->table_name_notifications = $bp->table_prefix . 'bp_notifications';
+
+		/**
+		 * Used to determine if user has admin rights on current content. If the
+		 * logged in user is viewing their own profile and wants to delete
+		 * something, is_item_admin is used. This is a generic variable so it
+		 * can be used by other components. It can also be modified, so when
+		 * viewing a group 'is_item_admin' would be 'true' if they are a group
+		 * admin, and 'false' if they are not.
+		 */
+		bp_update_is_item_admin( bp_user_has_access(), 'core' );
+
+		// Is the logged in user is a mod for the current item?
+		bp_update_is_item_mod( false,                  'core' );
+
+		do_action( 'bp_core_setup_globals' );
+	}
+
+	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 ( !bp_is_active( 'xprofile' ) ) {
+
+			// Fallback values if xprofile is disabled
+			$bp->core->profile->slug = 'profile';
+			$bp->active_components[$bp->core->profile->slug] = $bp->core->profile->slug;
+
+			// Add 'Profile' to the main navigation
+			$main_nav = array(
+				'name'                => __( 'Profile', 'buddypress' ),
+				'slug'                => $bp->core->profile->slug,
+				'position'            => 20,
+				'screen_function'     => 'bp_core_catch_profile_uri',
+				'default_subnav_slug' => 'public'
+			);
+
+			$profile_link = trailingslashit( $bp->loggedin_user->domain . '/' . $bp->core->profile->slug );
+
+			// Add the subnav items to the profile
+			$sub_nav[] = array(
+				'name'            => __( 'Public', 'buddypress' ),
+				'slug'            => 'public',
+				'parent_url'      => $profile_link,
+				'parent_slug'     => $bp->core->profile->slug,
+				'screen_function' => 'bp_core_catch_profile_uri'
+			);
+		}
+	}
+}
+
+// Initialize the BuddyPress Core
+$bp->core = new BP_Core();
+
+?>
\ No newline at end of file
diff --git a/wp-content/plugins/buddypress/bp-core/bp-core-template.php b/wp-content/plugins/buddypress/bp-core/bp-core-template.php
new file mode 100644
index 0000000000000000000000000000000000000000..8cb969490abd7f3eded7c28ba90d8319f8541056
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-core/bp-core-template.php
@@ -0,0 +1,1661 @@
+<?php
+// Exit if accessed directly
+if ( !defined( 'ABSPATH' ) ) exit;
+
+/**
+ * Uses the $bp->bp_options_nav global to render out the sub navigation for the current component.
+ * Each component adds to its sub navigation array within its own setup_nav() function.
+ *
+ * This sub navigation array is the secondary level navigation, so for profile it contains:
+ *      [Public, Edit Profile, Change Avatar]
+ *
+ * The function will also analyze the current action for the current component to determine whether
+ * or not to highlight a particular sub nav item.
+ *
+ * @package BuddyPress Core
+ * @global object $bp Global BuddyPress settings object
+ * @uses bp_get_user_nav() Renders the navigation for a profile of a currently viewed user.
+ */
+function bp_get_options_nav() {
+	global $bp;
+
+	// 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 );
+
+	if ( !bp_is_single_item() ) {
+		if ( !isset( $bp->bp_options_nav[$component_index] ) || count( $bp->bp_options_nav[$component_index] ) < 1 ) {
+			return false;
+		} else {
+			$the_index = $component_index;
+		}
+	} else {
+		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;
+		}
+	}
+
+	// Loop through each navigation 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 ) {
+			$selected = ' class="current selected"';
+		} else {
+			$selected = '';
+		}
+
+		// List type depends on our current component
+		$list_type = bp_is_group() ? 'groups' : 'personal';
+
+		// echo out the final list item
+		echo apply_filters( 'bp_get_options_nav_' . $subnav_item['css_id'], '<li id="' . $subnav_item['css_id'] . '-' . $list_type . '-li" ' . $selected . '><a id="' . $subnav_item['css_id'] . '" href="' . $subnav_item['link'] . '">' . $subnav_item['name'] . '</a></li>', $subnav_item );
+	}
+}
+
+function bp_get_options_title() {
+	global $bp;
+
+	if ( empty( $bp->bp_options_title ) )
+		$bp->bp_options_title = __( 'Options', 'buddypress' );
+
+	echo apply_filters( 'bp_get_options_title', esc_attr( $bp->bp_options_title ) );
+}
+
+/** Avatars *******************************************************************/
+
+/**
+ * Check to see if there is an options avatar. An options avatar is an avatar for something
+ * 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
+ */
+function bp_has_options_avatar() {
+	global $bp;
+
+	if ( empty( $bp->bp_options_avatar ) )
+		return false;
+
+	return true;
+}
+
+function bp_get_options_avatar() {
+	global $bp;
+
+	echo apply_filters( 'bp_get_options_avatar', $bp->bp_options_avatar );
+}
+
+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' ) ) );
+	else if ( function_exists('get_avatar') )
+		get_avatar();
+}
+
+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' ) ) );
+	else if ( function_exists('get_avatar') )
+		get_avatar();
+}
+
+function bp_avatar_admin_step() {
+	echo bp_get_avatar_admin_step();
+}
+	function bp_get_avatar_admin_step() {
+		global $bp;
+
+		if ( isset( $bp->avatar_admin->step ) )
+			$step = $bp->avatar_admin->step;
+		else
+			$step = 'upload-image';
+
+		return apply_filters( 'bp_get_avatar_admin_step', $step );
+	}
+
+function bp_avatar_to_crop() {
+	echo bp_get_avatar_to_crop();
+}
+	function bp_get_avatar_to_crop() {
+		global $bp;
+
+		if ( isset( $bp->avatar_admin->image->url ) )
+			$url = $bp->avatar_admin->image->url;
+		else
+			$url = '';
+
+		return apply_filters( 'bp_get_avatar_to_crop', $url );
+	}
+
+function bp_avatar_to_crop_src() {
+	echo bp_get_avatar_to_crop_src();
+}
+	function bp_get_avatar_to_crop_src() {
+		global $bp;
+
+		return apply_filters( 'bp_get_avatar_to_crop_src', str_replace( WP_CONTENT_DIR, '', $bp->avatar_admin->image->dir ) );
+	}
+
+function bp_avatar_cropper() {
+	global $bp;
+
+	echo '<img id="avatar-to-crop" class="avatar" src="' . $bp->avatar_admin->image . '" />';
+}
+
+function bp_site_name() {
+	echo apply_filters( 'bp_site_name', get_bloginfo( 'name', 'display' ) );
+}
+
+function bp_get_profile_header() {
+	locate_template( array( '/profile/profile-header.php' ), true );
+}
+
+function bp_exists( $component_name ) {
+	if ( function_exists( $component_name . '_install' ) )
+		return true;
+
+	return false;
+}
+
+function bp_format_time( $time, $just_date = false, $localize_time = true ) {
+	if ( !isset( $time ) || !is_numeric( $time ) )
+		return false;
+
+	// Get GMT offset from root blog
+	$root_blog_offset = false;
+	if ( $localize_time )
+		$root_blog_offset = get_blog_option( bp_get_root_blog_id(), 'gmt_offset' );
+
+	// Calculate offset time
+	$time_offset = $time + ( $root_blog_offset * 3600 );
+
+	// Current date (January 1, 2010)
+	$date = date_i18n( get_option( 'date_format' ), $time_offset );
+
+	// Should we show the time also?
+	if ( !$just_date ) {
+		// Current time (9:50pm)
+		$time = date_i18n( get_option( 'time_format' ), $time_offset );
+
+		// Return string formatted with date and time
+		$date = sprintf( __( '%1$s at %2$s', 'buddypress' ), $date, $time );
+	}
+
+	return apply_filters( 'bp_format_time', $date );
+}
+
+function bp_word_or_name( $youtext, $nametext, $capitalize = true, $echo = true ) {
+	global $bp;
+
+	if ( $capitalize )
+		$youtext = bp_core_ucfirst($youtext);
+
+	if ( $bp->displayed_user->id == $bp->loggedin_user->id ) {
+		if ( $echo )
+			echo apply_filters( 'bp_word_or_name', $youtext );
+		else
+			return apply_filters( 'bp_word_or_name', $youtext );
+	} else {
+		$fullname = (array)explode( ' ', $bp->displayed_user->fullname );
+		$nametext = sprintf( $nametext, $fullname[0] );
+		if ( $echo )
+			echo apply_filters( 'bp_word_or_name', $nametext );
+		else
+			return apply_filters( 'bp_word_or_name', $nametext );
+	}
+}
+
+function bp_get_plugin_sidebar() {
+	locate_template( array( 'plugin-sidebar.php' ), true );
+}
+
+function bp_styles() {
+	do_action( 'bp_styles' );
+	wp_print_styles();
+}
+
+/** Search Form ***************************************************************/
+
+function bp_search_form_action() {
+	return apply_filters( 'bp_search_form_action', 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();
+
+	if ( bp_is_active( 'xprofile' ) )
+		$options['members'] = __( 'Members', 'buddypress' );
+
+	if ( bp_is_active( 'groups' ) )
+		$options['groups']  = __( 'Groups',  'buddypress' );
+
+	if ( bp_is_active( 'blogs' ) && is_multisite() )
+		$options['blogs']   = __( 'Blogs',   'buddypress' );
+
+	if ( bp_is_active( 'forums' ) && bp_forums_is_installed_correctly() && bp_forums_has_directory() )
+		$options['forums']  = __( 'Forums',  'buddypress' );
+
+	$options['posts'] = __( 'Posts', 'buddypress' );
+
+	// Eventually this won't be needed and a page will be built to integrate all search results.
+	$selection_box  = '<label for="search-which" class="accessibly-hidden">' . __( 'Search these:', 'buddypress' ) . '</label>';
+	$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 )
+		$selection_box .= sprintf( '<option value="%s">%s</option>', $option_value, $option_title );
+
+	$selection_box .= '</select>';
+
+	return apply_filters( 'bp_search_form_type_select', $selection_box );
+}
+
+/**
+ * Get the default text for the search box for a given component.
+ *
+ * @global object $bp BuddyPress global settings
+ * @return string
+ * @since 1.5
+ */
+function bp_search_default_text( $component = '' ) {
+	echo bp_get_search_default_text( $component );
+}
+	function bp_get_search_default_text( $component = '' ) {
+		global $bp;
+
+		if ( empty( $component ) )
+			$component = bp_current_component();
+
+		$default_text = __( 'Search anything...', 'buddypress' );
+
+		// Most of the time, $component will be the actual component ID
+		if ( !empty( $component ) ) {
+			if ( !empty( $bp->{$component}->search_string ) ) {
+				$default_text = $bp->{$component}->search_string;
+			} else {
+				// When the request comes through AJAX, we need to get the component
+				// name out of $bp->pages
+				if ( !empty( $bp->pages->{$component}->slug ) ) {
+					$key = $bp->pages->{$component}->slug;
+					if ( !empty( $bp->{$key}->search_string ) )
+						$default_text = $bp->{$key}->search_string;
+				}
+			}
+		}
+
+		return apply_filters( 'bp_get_search_default_text', $default_text, $component );
+	}
+
+function bp_custom_profile_boxes() {
+	do_action( 'bp_custom_profile_boxes' );
+}
+
+function bp_custom_profile_sidebar_boxes() {
+	do_action( 'bp_custom_profile_sidebar_boxes' );
+}
+
+/**
+ * Creates and outputs a button.
+ *
+ * @param array $args See bp_get_button() for the list of arguments.
+ * @see bp_get_button()
+ */
+function bp_button( $args = '' ) {
+	echo bp_get_button( $args );
+}
+	/**
+	 * Creates and returns a button.
+	 *
+	 * Args:
+	 * component: Which component this button is for
+	 * must_be_logged_in: Button only appears for logged in users
+	 * block_self: Button will not appear when viewing your own profile.
+	 * wrapper: div|span|p|li|
+	 * wrapper_id: The DOM ID of the button wrapper
+	 * wrapper_class: The DOM class of the button wrapper
+	 * link_href: The destination link of the button
+	 * link_title: Title of the button
+	 * link_id: The DOM ID of the button
+	 * link_class: The DOM class of the button
+	 * link_rel: The DOM rel of the button
+	 * link_text: The contents of the button
+	 *
+	 * @param array $button
+	 * @return string
+	 * @see bp_add_friend_button()
+	 * @see bp_send_public_message_button()
+	 * @see bp_send_private_message_button()
+	 */
+	function bp_get_button( $args = '' ) {
+		$button = new BP_Button( $args );
+		return apply_filters( 'bp_get_button', $button->contents, $args, $button );
+	}
+
+
+/**
+ * Truncates text.
+ *
+ * Cuts a string to the length of $length and replaces the last characters
+ * with the ending if the text is longer than length.
+ *
+ * This function is borrowed from CakePHP v2.0, under the MIT license. See
+ * http://book.cakephp.org/view/1469/Text#truncate-1625
+ *
+ * ### Options:
+ *
+ * - `ending` Will be used as Ending and appended to the trimmed string
+ * - `exact` If false, $text will not be cut mid-word
+ * - `html` If true, HTML tags would be handled correctly
+ * - `filter_shortcodes` If true, shortcodes will be stripped before truncating
+ *
+ * @package BuddyPress
+ *
+ * @param string  $text String to truncate.
+ * @param integer $length Length of returned string, including ellipsis.
+ * @param array $options An array of html attributes and options.
+ * @return string Trimmed string.
+ */
+function bp_create_excerpt( $text, $length = 225, $options = array() ) {
+	// Backward compatibility. The third argument used to be a boolean $filter_shortcodes
+	$filter_shortcodes_default = is_bool( $options ) ? $options : true;
+
+	$defaults = array(
+		'ending'            => __( ' [&hellip;]', 'buddypress' ),
+		'exact'             => false,
+		'html'              => true,
+		'filter_shortcodes' => $filter_shortcodes_default
+	);
+	$r = wp_parse_args( $options, $defaults );
+	extract( $r );
+
+	// Save the original text, to be passed along to the filter
+	$original_text = $text;
+
+	// Allow plugins to modify these values globally
+	$length = apply_filters( 'bp_excerpt_length', $length );
+	$ending = apply_filters( 'bp_excerpt_append_text', $ending );
+
+	// Remove shortcodes if necessary
+	if ( $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 ) {
+		// The text is short enough. No need to truncate
+		if ( mb_strlen( preg_replace( '/<.*?>/', '', $text ) ) <= $length ) {
+			return $text;
+		}
+
+		$totalLength = mb_strlen( strip_tags( $ending ) );
+		$openTags    = array();
+		$truncate    = '';
+
+		// Find all the tags and put them in a stack for later use
+		preg_match_all( '/(<\/?([\w+]+)[^>]*>)?([^<>]*)/', $text, $tags, PREG_SET_ORDER );
+		foreach ( $tags as $tag ) {
+			// Process tags that need to be closed
+			if ( !preg_match( '/img|br|input|hr|area|base|basefont|col|frame|isindex|link|meta|param/s',  $tag[2] ) ) {
+				if ( preg_match( '/<[\w]+[^>]*>/s', $tag[0] ) ) {
+					array_unshift( $openTags, $tag[2] );
+				} else if ( preg_match('/<\/([\w]+)[^>]*>/s', $tag[0], $closeTag ) ) {
+					$pos = array_search( $closeTag[1], $openTags );
+					if ( $pos !== false ) {
+						array_splice( $openTags, $pos, 1 );
+					}
+				}
+			}
+			$truncate .= $tag[1];
+
+			$contentLength = mb_strlen( preg_replace( '/&[0-9a-z]{2,8};|&#[0-9]{1,7};|&#x[0-9a-f]{1,6};/i', ' ', $tag[3] ) );
+			if ( $contentLength + $totalLength > $length ) {
+				$left = $length - $totalLength;
+				$entitiesLength = 0;
+				if ( preg_match_all( '/&[0-9a-z]{2,8};|&#[0-9]{1,7};|&#x[0-9a-f]{1,6};/i', $tag[3], $entities, PREG_OFFSET_CAPTURE ) ) {
+					foreach ( $entities[0] as $entity ) {
+						if ( $entity[1] + 1 - $entitiesLength <= $left ) {
+							$left--;
+							$entitiesLength += mb_strlen( $entity[0] );
+						} else {
+							break;
+						}
+					}
+				}
+
+				$truncate .= mb_substr( $tag[3], 0 , $left + $entitiesLength );
+				break;
+			} else {
+				$truncate .= $tag[3];
+				$totalLength += $contentLength;
+			}
+			if ( $totalLength >= $length ) {
+				break;
+			}
+		}
+	} else {
+		if ( mb_strlen( $text ) <= $length ) {
+			return $text;
+		} else {
+			$truncate = mb_substr( $text, 0, $length - mb_strlen( $ending ) );
+		}
+	}
+
+	// If $exact is false, we can't break on words
+	if ( !$exact ) {
+		$spacepos = mb_strrpos( $truncate, ' ' );
+		if ( isset( $spacepos ) ) {
+			if ( $html ) {
+				$bits = mb_substr( $truncate, $spacepos );
+				preg_match_all( '/<\/([a-z]+)>/', $bits, $droppedTags, PREG_SET_ORDER );
+				if ( !empty( $droppedTags ) ) {
+					foreach ( $droppedTags as $closingTag ) {
+						if ( !in_array( $closingTag[1], $openTags ) ) {
+							array_unshift( $openTags, $closingTag[1] );
+						}
+					}
+				}
+			}
+			$truncate = mb_substr( $truncate, 0, $spacepos );
+		}
+	}
+	$truncate .= $ending;
+
+	if ( $html ) {
+		foreach ( $openTags as $tag ) {
+			$truncate .= '</' . $tag . '>';
+		}
+	}
+
+	return apply_filters( 'bp_create_excerpt', $truncate, $original_text, $length, $options );
+
+}
+add_filter( 'bp_create_excerpt', 'stripslashes_deep' );
+add_filter( 'bp_create_excerpt', 'force_balance_tags' );
+
+function bp_total_member_count() {
+	echo bp_get_total_member_count();
+}
+	function bp_get_total_member_count() {
+		return apply_filters( 'bp_get_total_member_count', bp_core_get_total_member_count() );
+	}
+	add_filter( 'bp_get_total_member_count', 'bp_core_number_format' );
+
+function bp_blog_signup_allowed() {
+	echo bp_get_blog_signup_allowed();
+}
+	function bp_get_blog_signup_allowed() {
+		global $bp;
+
+		if ( !is_multisite() )
+			return false;
+
+		$status = $bp->site_options['registration'];
+		if ( 'none' != $status && 'user' != $status )
+			return true;
+
+		return false;
+	}
+
+function bp_account_was_activated() {
+	global $bp;
+
+	$activation_complete = !empty( $bp->activation_complete ) ? $bp->activation_complete : false;
+
+	return $activation_complete;
+}
+
+function bp_registration_needs_activation() {
+	return apply_filters( 'bp_registration_needs_activation', true );
+}
+
+/**
+ * Allow templates to pass parameters directly into the template loops via AJAX
+ *
+ * For the most part this will be filtered in a theme's functions.php for example
+ * in the default theme it is filtered via bp_dtheme_ajax_querystring()
+ *
+ * By using this template tag in the templates it will stop them from showing errors
+ * if someone copies the templates from the default theme into another WordPress theme
+ * without coping the functions from functions.php.
+ */
+function bp_ajax_querystring( $object = false ) {
+	global $bp;
+
+	if ( !isset( $bp->ajax_querystring ) )
+		$bp->ajax_querystring = '';
+
+	return apply_filters( 'bp_ajax_querystring', $bp->ajax_querystring, $object );
+}
+
+/** Template Classes and _is functions ****************************************/
+
+function bp_current_component() {
+	global $bp;
+	$current_component = !empty( $bp->current_component ) ? $bp->current_component : false;
+	return apply_filters( 'bp_current_component', $current_component );
+}
+
+function bp_current_action() {
+	global $bp;
+	$current_action = !empty( $bp->current_action ) ? $bp->current_action : false;
+	return apply_filters( 'bp_current_action', $current_action );
+}
+
+function bp_current_item() {
+	global $bp;
+	$current_item = !empty( $bp->current_item ) ? $bp->current_item : false;
+	return apply_filters( 'bp_current_item', $current_item );
+}
+
+/**
+ * Return the value of $bp->action_variables
+ *
+ * @package BuddyPress
+ *
+ * @param mixed $action_variables The action variables array, or false if the array is empty
+ */
+function bp_action_variables() {
+	global $bp;
+	$action_variables = !empty( $bp->action_variables ) ? $bp->action_variables : false;
+	return apply_filters( 'bp_action_variables', $action_variables );
+}
+
+/**
+ * Return the value of a given action variable
+ *
+ * @package BuddyPress
+ * @since 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
+ */
+function bp_action_variable( $position = 0 ) {
+	$action_variables = bp_action_variables();
+	$action_variable  = isset( $action_variables[$position] ) ? $action_variables[$position] : false;
+
+	return apply_filters( 'bp_action_variable', $action_variable, $position );
+}
+
+function bp_root_domain() {
+	echo bp_get_root_domain();
+}
+	function bp_get_root_domain() {
+		global $bp;
+
+		if ( isset( $bp->root_domain ) && !empty( $bp->root_domain ) ) {
+			$domain = $bp->root_domain;
+		} else {
+			$domain          = bp_core_get_root_domain();
+			$bp->root_domain = $domain;
+		}
+
+		return apply_filters( 'bp_get_root_domain', $domain );
+	}
+
+/**
+ * Echoes the output of bp_get_root_slug()
+ *
+ * @package BuddyPress Core
+ * @since 1.5
+ */
+function bp_root_slug( $component = '' ) {
+	echo bp_get_root_slug( $component );
+}
+	/**
+	 * Gets the root slug for a component slug
+	 *
+	 * In order to maintain backward compatibility, the following procedure is used:
+	 * 1) Use the short slug to get the canonical component name from the
+	 *    active component array
+	 * 2) Use the component name to get the root slug out of the appropriate part of the $bp
+	 *    global
+	 * 3) If nothing turns up, it probably means that $component is itself a root slug
+	 *
+	 * Example: If your groups directory is at /community/companies, this function first uses
+	 * the short slug 'companies' (ie the current component) to look up the canonical name
+	 * 'groups' in $bp->active_components. Then it uses 'groups' to get the root slug, from
+	 * $bp->groups->root_slug.
+	 *
+	 * @package BuddyPress Core
+	 * @since 1.5
+	 *
+	 * @global object $bp Global BuddyPress settings object
+	 * @param string $component Optional. Defaults to the current component
+	 * @return string $root_slug The root slug
+	 */
+	function bp_get_root_slug( $component = '' ) {
+		global $bp;
+
+		$root_slug = '';
+
+		// Use current global component if none passed
+		if ( empty( $component ) )
+			$component = $bp->current_component;
+
+		// Component is active
+		if ( !empty( $bp->active_components[$component] ) ) {
+			// Backward compatibility: in legacy plugins, the canonical component id
+			// was stored as an array value in $bp->active_components
+			$component_name = '1' == $bp->active_components[$component] ? $component : $bp->active_components[$component];
+
+			// Component has specific root slug
+			if ( !empty( $bp->{$component_name}->root_slug ) ) {
+				$root_slug = $bp->{$component_name}->root_slug;
+			}
+		}
+
+		// No specific root slug, so fall back to component slug
+		if ( empty( $root_slug ) )
+			$root_slug = $component;
+
+		return apply_filters( 'bp_get_root_slug', $root_slug, $component );
+	}
+
+/**
+ * Return the component name based on the current root slug
+ *
+ * @since BuddyPress {r3923}
+ * @global object $bp Global BuddyPress settings object
+ * @param str $root_slug Needle to our active component haystack
+ * @return mixed False if none found, component name if found
+ */
+function bp_get_name_from_root_slug( $root_slug = '' ) {
+	global $bp;
+
+	// If no slug is passed, look at current_component
+	if ( empty( $root_slug ) )
+		$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 )
+			return $bp->{$component}->name;
+
+	return false;
+}
+
+function bp_user_has_access() {
+	$has_access = ( is_super_admin() || bp_is_my_profile() ) ? true : false;
+
+	return apply_filters( 'bp_user_has_access', $has_access );
+}
+
+/**
+ * Output the search slug
+ *
+ * @package BuddyPress
+ * @since 1.5
+ *
+ * @uses bp_get_search_slug()
+ */
+function bp_search_slug() {
+	echo bp_get_search_slug();
+}
+	/**
+	 * Return the search slug
+	 *
+	 * @package BuddyPress
+	 * @since 1.5
+	 */
+	function bp_get_search_slug() {
+		return apply_filters( 'bp_get_search_slug', BP_SEARCH_SLUG );
+	}
+
+/** is_() functions to determine the current page *****************************/
+
+/**
+ * Checks to see whether the current page belongs to the specified component
+ *
+ * This function is designed to be generous, accepting several different kinds
+ * of value for the $component parameter. It checks $component_name against:
+ * - the component's root_slug, which matches the page slug in $bp->pages
+ * - the component's regular slug
+ * - the component's id, or 'canonical' name
+ *
+ * @package BuddyPress Core
+ * @since 1.5
+ * @return bool Returns true if the component matches, or else false.
+ */
+function bp_is_current_component( $component ) {
+	global $bp;
+
+	$is_current_component = false;
+
+	// Backward compatibility: 'xprofile' should be read as 'profile'
+	if ( 'xprofile' == $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 ) {
+			$is_current_component = true;
+
+		// Since the current component is based on the visible URL slug let's
+		// check the component being passed and see if its root_slug matches
+		} elseif ( isset( $bp->{$component}->root_slug ) && $bp->{$component}->root_slug == $bp->current_component ) {
+			$is_current_component = true;
+
+		// Because slugs can differ from root_slugs, we should check them too
+		} elseif ( isset( $bp->{$component}->slug ) && $bp->{$component}->slug == $bp->current_component ) {
+			$is_current_component = true;
+
+		// Next, check to see whether $component is a canonical,
+		// 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 ) )
+				$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
+		} else {
+			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 )
+					continue;
+
+				if ( $id == $component ) {
+					$is_current_component = true;
+					break;
+				}
+			}
+		}
+
+	// Page template fallback check if $bp->current_component is empty
+	} elseif ( !is_admin() && is_page() ) {
+		global $wp_query;
+		$page          = $wp_query->get_queried_object();
+		$custom_fields = get_post_custom_values( '_wp_page_template', $page->ID );
+		$page_template = $custom_fields[0];
+
+		// Component name is in the page template name
+		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 );
+}
+
+/**
+ * Check to see whether the current page matches a given action.
+ *
+ * Along with bp_is_current_component() and bp_is_action_variable(), this function is mostly used
+ * to help determine when to use a given screen function.
+ *
+ * In BP parlance, the current_action is the URL chunk that comes directly after the
+ * current item slug. E.g., in
+ *   http://example.com/groups/my-group/members
+ * the current_action is 'members'.
+ *
+ * @package BuddyPress
+ * @since 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 )
+		return true;
+
+	return false;
+}
+
+/**
+ * Check to see whether the current page matches a given action_variable.
+ *
+ * Along with bp_is_current_component() and bp_is_current_action(), this function is mostly used
+ * to help determine when to use a given screen function.
+ *
+ * In BP parlance, action_variables are an array made up of the URL chunks appearing after the
+ * current_action in a URL. For example,
+ *   http://example.com/groups/my-group/admin/group-settings
+ * $action_variables[0] is 'group-settings'.
+ *
+ * @package BuddyPress
+ * @since 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,
+ *   the function will return true if the $action_variable is found *anywhere* in the action
+ *   variables array.
+ * @return bool
+ */
+function bp_is_action_variable( $action_variable = '', $position = false ) {
+	$is_action_variable = false;
+
+	if ( false !== $position ) {
+		// When a $position is specified, check that slot in the action_variables array
+		if ( $action_variable ) {
+			$is_action_variable = $action_variable == bp_action_variable( $position );
+		} else {
+			// If no $action_variable is provided, we are essentially checking to see
+			// whether the slot is empty
+			$is_action_variable = !bp_action_variable( $position );
+		}
+	} else {
+		// When no $position is specified, check the entire array
+		$is_action_variable = in_array( $action_variable, (array)bp_action_variables() );
+	}
+
+	return apply_filters( 'bp_is_action_variable', $is_action_variable, $action_variable, $position );
+}
+
+function bp_is_current_item( $item = '' ) {
+	if ( !empty( $item ) && $item == bp_current_item() )
+		return true;
+
+	return false;
+}
+
+function bp_is_single_item() {
+	global $bp;
+
+	if ( !empty( $bp->is_single_item ) )
+		return true;
+
+	return false;
+}
+
+function bp_is_item_admin() {
+	global $bp;
+
+	if ( !empty( $bp->is_item_admin ) )
+		return true;
+
+	return false;
+}
+
+function bp_is_item_mod() {
+	global $bp;
+
+	if ( !empty( $bp->is_item_mod ) )
+		return true;
+
+	return false;
+}
+
+function bp_is_directory() {
+	global $bp;
+
+	if ( !empty( $bp->is_directory ) )
+		return true;
+
+	return false;
+}
+
+/**
+ * Checks to see if a component's URL should be in the root, not under a
+ * member page:
+ *
+ *   Yes: http://domain.com/groups/the-group
+ *   No:  http://domain.com/members/andy/groups/the-group
+ *
+ * @package BuddyPress Core
+ * @return true if root component, else false.
+ */
+function bp_is_root_component( $component_name ) {
+	global $bp;
+
+	if ( !isset( $bp->active_components ) )
+		return false;
+
+	foreach ( (array) $bp->active_components as $key => $slug ) {
+		if ( $key == $component_name || $slug == $component_name )
+			return true;
+	}
+
+	return false;
+}
+
+/**
+ * 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 $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
+ */
+function bp_is_component_front_page( $component = '' ) {
+	global $bp, $current_blog;
+
+	if ( !$component && !empty( $bp->current_component ) )
+		$component = $bp->current_component;
+
+	$path = is_main_site() ? bp_core_get_site_path() : $current_blog->path;
+
+	if ( 'page' != get_option( 'show_on_front' ) || !$component || empty( $bp->pages->{$component} ) || $_SERVER['REQUEST_URI'] != $path )
+		return false;
+
+	return apply_filters( 'bp_is_component_front_page', ( $bp->pages->{$component}->id == get_option( 'page_on_front' ) ), $component );
+}
+
+/**
+ * Is this a blog page, ie a non-BP page?
+ *
+ * You can tell if a page is displaying BP content by whether the current_component has been defined
+ *
+ * @package BuddyPress
+ *
+ * @return bool True if it's a non-BP page, false otherwise
+ */
+function bp_is_blog_page() {
+	global $wp_query;
+
+	$is_blog_page = false;
+
+	// Generally, we can just check to see that there's no current component. The one exception
+	// is single user home tabs, where $bp->current_component is unset. Thus the addition
+	// of the bp_is_user() check.
+	if ( !bp_current_component() && !bp_is_user() )
+		$is_blog_page = true;
+
+	return apply_filters( 'bp_is_blog_page', $is_blog_page );
+}
+
+function bp_is_page( $page ) {
+	if ( !bp_is_user() && bp_is_current_component( $page )  )
+		return true;
+
+	if ( 'home' == $page )
+		return is_front_page();
+
+	return false;
+}
+
+/** Components ****************************************************************/
+
+function bp_is_active( $component ) {
+	global $bp;
+
+	if ( isset( $bp->active_components[$component] ) )
+		return true;
+
+	return false;
+}
+
+function bp_is_members_component() {
+	if ( bp_is_current_component( 'members' ) )
+		return true;
+
+	return false;
+}
+
+function bp_is_profile_component() {
+	if ( bp_is_current_component( 'xprofile' ) )
+		return true;
+
+	return false;
+}
+
+function bp_is_activity_component() {
+	if ( bp_is_current_component( 'activity' ) )
+		return true;
+
+	return false;
+}
+
+function bp_is_blogs_component() {
+	if ( is_multisite() && bp_is_current_component( 'blogs' ) )
+		return true;
+
+	return false;
+}
+
+function bp_is_messages_component() {
+	if ( bp_is_current_component( 'messages' ) )
+		return true;
+
+	return false;
+}
+
+function bp_is_friends_component() {
+	if ( bp_is_current_component( 'friends' ) )
+		return true;
+
+	return false;
+}
+
+function bp_is_groups_component() {
+	if ( bp_is_current_component( 'groups' ) )
+		return true;
+
+	return false;
+}
+
+function bp_is_forums_component() {
+	if ( bp_is_current_component( 'forums' ) )
+		return true;
+
+	return false;
+}
+
+function bp_is_settings_component() {
+	if ( bp_is_current_component( 'settings' ) )
+		return true;
+
+	return false;
+}
+
+/** Activity ******************************************************************/
+
+function bp_is_single_activity() {
+	global $bp;
+
+	if ( bp_is_activity_component() && is_numeric( $bp->current_action ) )
+		return true;
+
+	return false;
+}
+
+/** User **********************************************************************/
+
+function bp_is_my_profile() {
+	global $bp;
+
+	if ( is_user_logged_in() && $bp->loggedin_user->id == $bp->displayed_user->id )
+		$my_profile = true;
+	else
+		$my_profile = false;
+
+	return apply_filters( 'bp_is_my_profile', $my_profile );
+}
+
+function bp_is_user() {
+	global $bp;
+
+	if ( !empty( $bp->displayed_user->id ) )
+		return true;
+
+	return false;
+}
+
+function bp_is_user_activity() {
+	if ( bp_is_user() && bp_is_activity_component() )
+		return true;
+
+	return false;
+}
+
+function bp_is_user_friends_activity() {
+
+	if ( !bp_is_active( 'friends' ) )
+		return false;
+
+	$slug = bp_get_friends_slug();
+
+	if ( empty( $slug ) )
+		$slug = 'friends';
+
+	if ( bp_is_user_activity() && bp_is_current_action( $slug ) )
+		return true;
+
+	return false;
+}
+
+function bp_is_user_groups_activity() {
+
+	if ( !bp_is_active( 'groups' ) )
+		return false;
+
+	$slug = bp_get_groups_slug();
+
+	if ( empty( $slug ) )
+		$slug = 'groups';
+
+	if ( bp_is_user_activity() && bp_is_current_action( $slug ) )
+		return true;
+
+	return false;
+}
+
+function bp_is_user_profile() {
+	if ( bp_is_profile_component() || bp_is_current_component( 'profile' ) )
+		return true;
+
+	return false;
+}
+
+function bp_is_user_profile_edit() {
+	if ( bp_is_profile_component() && bp_is_current_action( 'edit' ) )
+		return true;
+
+	return false;
+}
+
+function bp_is_user_change_avatar() {
+	if ( bp_is_profile_component() && bp_is_current_action( 'change-avatar' ) )
+		return true;
+
+	return false;
+}
+
+/**
+ * Is this a user's forums page?
+ *
+ * @package BuddyPress
+ *
+ * @return bool
+ */
+function bp_is_user_forums() {
+	if ( bp_is_user() && bp_is_forums_component() )
+		return true;
+
+	return false;
+}
+
+/**
+ * Is this a user's "Topics Started" page?
+ *
+ * @package BuddyPress
+ * @since 1.5
+ *
+ * @return bool
+ */
+function bp_is_user_forums_started() {
+	if ( bp_is_user_forums() && bp_is_current_action( 'topics' ) )
+		return true;
+
+	return false;
+}
+
+/**
+ * Is this a user's "Replied To" page?
+ *
+ * @package BuddyPress
+ * @since 1.5
+ *
+ * @return bool
+ */
+function bp_is_user_forums_replied_to() {
+	if ( bp_is_user_forums() && bp_is_current_action( 'replies' ) )
+		return true;
+
+	return false;
+}
+
+function bp_is_user_groups() {
+	if ( bp_is_user() && bp_is_groups_component() )
+		return true;
+
+	return false;
+}
+
+function bp_is_user_blogs() {
+	if ( bp_is_user() && bp_is_blogs_component() )
+		return true;
+
+	return false;
+}
+
+function bp_is_user_recent_posts() {
+	if ( bp_is_user_blogs() && bp_is_current_action( 'recent-posts' ) )
+		return true;
+
+	return false;
+}
+
+function bp_is_user_recent_commments() {
+	if ( bp_is_user_blogs() && bp_is_current_action( 'recent-comments' ) )
+		return true;
+
+	return false;
+}
+
+function bp_is_user_friends() {
+	if ( bp_is_user() && bp_is_friends_component() )
+		return true;
+
+	return false;
+}
+
+function bp_is_user_friend_requests() {
+	if ( bp_is_user_friends() && bp_is_current_action( 'requests' ) )
+		return true;
+
+	return false;
+}
+
+/**
+ * Is this a user's settings page?
+ *
+ * @package BuddyPress
+ *
+ * @return bool
+ */
+function bp_is_user_settings() {
+	if ( bp_is_user() && bp_is_settings_component() )
+		return true;
+
+	return false;
+}
+
+/**
+ * Is this a user's General Settings page?
+ *
+ * @package BuddyPress
+ * @since 1.5
+ *
+ * @return bool
+ */
+function bp_is_user_settings_general() {
+	if ( bp_is_user_settings() && bp_is_current_action( 'general' ) )
+		return true;
+
+	return false;
+}
+
+/**
+ * Is this a user's Notification Settings page?
+ *
+ * @package BuddyPress
+ * @since 1.5
+ *
+ * @return bool
+ */
+function bp_is_user_settings_notifications() {
+	if ( bp_is_user_settings() && bp_is_current_action( 'notifications' ) )
+		return true;
+
+	return false;
+}
+
+/**
+ * Is this a user's Account Deletion page?
+ *
+ * @package BuddyPress
+ * @since 1.5
+ *
+ * @return bool
+ */
+function bp_is_user_settings_account_delete() {
+	if ( bp_is_user_settings() && bp_is_current_action( 'delete-account' ) )
+		return true;
+
+	return false;
+}
+
+
+/** Groups ******************************************************************/
+
+function bp_is_group() {
+	global $bp;
+
+	if ( bp_is_groups_component() && isset( $bp->groups->current_group ) && $bp->groups->current_group )
+		return true;
+
+	return false;
+}
+
+function bp_is_group_home() {
+	if ( bp_is_single_item() && bp_is_groups_component() && ( !bp_current_action() || bp_is_current_action( 'home' ) ) )
+		return true;
+
+	return false;
+}
+
+function bp_is_group_create() {
+	if ( bp_is_groups_component() && bp_is_current_action( 'create' ) )
+		return true;
+
+	return false;
+}
+
+function bp_is_group_admin_page() {
+	if ( bp_is_single_item() && bp_is_groups_component() && bp_is_current_action( 'admin' ) )
+		return true;
+
+	return false;
+}
+
+function bp_is_group_forum() {
+	if ( bp_is_single_item() && bp_is_groups_component() && bp_is_current_action( 'forum' ) )
+		return true;
+
+	return false;
+}
+
+function bp_is_group_activity() {
+	if ( bp_is_single_item() && bp_is_groups_component() && bp_is_current_action( 'activity' ) )
+		return true;
+
+	return false;
+}
+
+function bp_is_group_forum_topic() {
+	if ( bp_is_single_item() && bp_is_groups_component() && bp_is_current_action( 'forum' ) && bp_is_action_variable( 'topic', 0 ) )
+		return true;
+
+	return false;
+}
+
+function bp_is_group_forum_topic_edit() {
+	if ( bp_is_single_item() && bp_is_groups_component() && bp_is_current_action( 'forum' ) && bp_is_action_variable( 'topic', 0 ) && bp_is_action_variable( 'edit', 2 ) )
+		return true;
+
+	return false;
+}
+
+function bp_is_group_members() {
+	if ( bp_is_single_item() && bp_is_groups_component() && bp_is_current_action( 'members' ) )
+		return true;
+
+	return false;
+}
+
+function bp_is_group_invites() {
+	if ( bp_is_groups_component() && bp_is_current_action( 'send-invites' ) )
+		return true;
+
+	return false;
+}
+
+function bp_is_group_membership_request() {
+	if ( bp_is_groups_component() && bp_is_current_action( 'request-membership' ) )
+		return true;
+
+	return false;
+}
+
+function bp_is_group_leave() {
+
+	if ( bp_is_groups_component() && bp_is_single_item() && bp_is_current_action( 'leave-group' ) )
+		return true;
+
+	return false;
+}
+
+function bp_is_group_single() {
+	if ( bp_is_groups_component() && bp_is_single_item() )
+		return true;
+
+	return false;
+}
+
+function bp_is_create_blog() {
+	if ( bp_is_blogs_component() && bp_is_current_action( 'create' ) )
+		return true;
+
+	return false;
+}
+
+/** Messages ******************************************************************/
+
+function bp_is_user_messages() {
+	if ( bp_is_user() && bp_is_messages_component() )
+		return true;
+
+	return false;
+}
+
+function bp_is_messages_inbox() {
+	if ( bp_is_user_messages() && ( !bp_current_action() || bp_is_current_action( 'inbox' ) ) )
+		return true;
+
+	return false;
+}
+
+function bp_is_messages_sentbox() {
+	if ( bp_is_user_messages() && bp_is_current_action( 'sentbox' ) )
+		return true;
+
+	return false;
+}
+
+function bp_is_messages_compose_screen() {
+	if ( bp_is_user_messages() && bp_is_current_action( 'compose' ) )
+		return true;
+
+	return false;
+}
+
+function bp_is_notices() {
+	if ( bp_is_user_messages() && bp_is_current_action( 'notices' ) )
+		return true;
+
+	return false;
+}
+
+
+function bp_is_single( $component, $callback ) {
+	if ( bp_is_current_component( $component ) && ( true === call_user_func( $callback ) ) )
+		return true;
+
+	return false;
+}
+
+/** Registration **************************************************************/
+
+function bp_is_activation_page() {
+	if ( bp_is_current_component( 'activate' ) )
+		return true;
+
+	return false;
+}
+
+function bp_is_register_page() {
+	if ( bp_is_current_component( 'register' ) )
+		return true;
+
+	return false;
+}
+
+/**
+ * Use the above is_() functions to output a body class for each scenario
+ *
+ * @package BuddyPress
+ * @subpackage Core Template
+ *
+ * @param array $wp_classes The body classes coming from WP
+ * @param array $custom_classes Classes that were passed to get_body_class()
+ * @return array $classes The BP-adjusted body classes
+ */
+function bp_the_body_class() {
+	echo bp_get_the_body_class();
+}
+	function bp_get_the_body_class( $wp_classes, $custom_classes = false ) {
+
+		$bp_classes = array();
+
+		/** Pages *************************************************************/
+
+		if ( is_front_page() )
+			$bp_classes[] = 'home-page';
+
+		if ( bp_is_directory() )
+			$bp_classes[] = 'directory';
+
+		if ( bp_is_single_item() )
+			$bp_classes[] = 'single-item';
+
+		/** Components ********************************************************/
+
+		if ( !bp_is_blog_page() ) :
+			if ( bp_is_user_profile() )
+				$bp_classes[] = 'xprofile';
+
+			if ( bp_is_activity_component() )
+				$bp_classes[] = 'activity';
+
+			if ( bp_is_blogs_component() )
+				$bp_classes[] = 'blogs';
+
+			if ( bp_is_messages_component() )
+				$bp_classes[] = 'messages';
+
+			if ( bp_is_friends_component() )
+				$bp_classes[] = 'friends';
+
+			if ( bp_is_groups_component() )
+				$bp_classes[] = 'groups';
+
+			if ( bp_is_settings_component()  )
+				$bp_classes[] = 'settings';
+		endif;
+
+		/** User **************************************************************/
+
+		if ( !bp_is_directory() ) :
+			if ( bp_is_user_blogs() )
+				$bp_classes[] = 'my-blogs';
+
+			if ( bp_is_user_groups() )
+				$bp_classes[] = 'my-groups';
+
+			if ( bp_is_user_activity() )
+				$bp_classes[] = 'my-activity';
+		endif;
+
+		if ( bp_is_my_profile() )
+			$bp_classes[] = 'my-account';
+
+		if ( bp_is_user_profile() )
+			$bp_classes[] = 'my-profile';
+
+		if ( bp_is_user_friends() )
+			$bp_classes[] = 'my-friends';
+
+		if ( bp_is_user_messages() )
+			$bp_classes[] = 'my-messages';
+
+		if ( bp_is_user_recent_commments() )
+			$bp_classes[] = 'recent-comments';
+
+		if ( bp_is_user_recent_posts() )
+			$bp_classes[] = 'recent-posts';
+
+		if ( bp_is_user_change_avatar() )
+			$bp_classes[] = 'change-avatar';
+
+		if ( bp_is_user_profile_edit() )
+			$bp_classes[] = 'profile-edit';
+
+		if ( bp_is_user_friends_activity() )
+			$bp_classes[] = 'friends-activity';
+
+		if ( bp_is_user_groups_activity() )
+			$bp_classes[] = 'groups-activity';
+
+		if ( is_user_logged_in() )
+			$bp_classes[] = 'logged-in';
+
+		/** Messages **********************************************************/
+
+		if ( bp_is_messages_inbox() )
+			$bp_classes[] = 'inbox';
+
+		if ( bp_is_messages_sentbox() )
+			$bp_classes[] = 'sentbox';
+
+		if ( bp_is_messages_compose_screen() )
+			$bp_classes[] = 'compose';
+
+		if ( bp_is_notices() )
+			$bp_classes[] = 'notices';
+
+		if ( bp_is_user_friend_requests() )
+			$bp_classes[] = 'friend-requests';
+
+		if ( bp_is_create_blog() )
+			$bp_classes[] = 'create-blog';
+
+		/** Groups ************************************************************/
+
+		if ( bp_is_group_leave() )
+			$bp_classes[] = 'leave-group';
+
+		if ( bp_is_group_invites() )
+			$bp_classes[] = 'group-invites';
+
+		if ( bp_is_group_members() )
+			$bp_classes[] = 'group-members';
+
+		if ( bp_is_group_forum_topic() )
+			$bp_classes[] = 'group-forum-topic';
+
+		if ( bp_is_group_forum_topic_edit() )
+			$bp_classes[] = 'group-forum-topic-edit';
+
+		if ( bp_is_group_forum() )
+			$bp_classes[] = 'group-forum';
+
+		if ( bp_is_group_admin_page() )
+			$bp_classes[] = 'group-admin';
+
+		if ( bp_is_group_create() )
+			$bp_classes[] = 'group-create';
+
+		if ( bp_is_group_home() )
+			$bp_classes[] = 'group-home';
+
+		if ( bp_is_single_activity() )
+			$bp_classes[] = 'activity-permalink';
+
+		/** Registration ******************************************************/
+
+		if ( bp_is_register_page() )
+			$bp_classes[] = 'registration';
+
+		if ( bp_is_activation_page() )
+			$bp_classes[] = 'activation';
+
+		/** Current Component & Action ****************************************/
+
+		if ( !bp_is_blog_page() ) {
+			$bp_classes[] = bp_current_component();
+			$bp_classes[] = bp_current_action();
+		}
+
+		/** Clean up***********************************************************/
+
+		// We don't want WordPress blog classes to appear on non-blog pages.
+		if ( !bp_is_blog_page() ) {
+
+			// Preserve any custom classes already set
+			if ( !empty( $custom_classes ) ) {
+				$wp_classes = (array) $custom_classes;
+			} else {
+				$wp_classes = array();
+			}
+		}
+
+		// Merge WP classes with BP classes
+		$classes = array_merge( (array) $bp_classes, (array) $wp_classes );
+
+		// Remove any duplicates
+		$classes = array_unique( $classes );
+
+		return apply_filters( 'bp_get_the_body_class', $classes, $bp_classes, $wp_classes, $custom_classes );
+	}
+	add_filter( 'body_class', 'bp_get_the_body_class', 10, 2 );
+
+?>
\ No newline at end of file
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 913ac5502b54dd283d9cee5453657bc71ef760b8..11dff4c26bbb259cc8dab522780900a35d3e2086 100644
--- a/wp-content/plugins/buddypress/bp-core/bp-core-widgets.php
+++ b/wp-content/plugins/buddypress/bp-core/bp-core-widgets.php
@@ -1,4 +1,6 @@
 <?php
+// Exit if accessed directly
+if ( !defined( 'ABSPATH' ) ) exit;
 
 /* Register widgets for the core component */
 function bp_core_register_widgets() {
@@ -11,47 +13,69 @@ add_action( 'bp_register_widgets', 'bp_core_register_widgets' );
 /*** MEMBERS WIDGET *****************/
 
 class BP_Core_Members_Widget extends WP_Widget {
+
 	function bp_core_members_widget() {
-		parent::WP_Widget( false, $name = __( 'Members', 'buddypress' ) );
+		$this->__construct();
+	}
 
-		if ( is_active_widget( false, false, $this->id_base ) )
-			wp_enqueue_script( 'bp_core_widget_members-js', BP_PLUGIN_URL . '/bp-core/js/widget-members.js', array('jquery') );
+	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' );
+		}
 	}
 
-	function widget($args, $instance) {
+	function widget( $args, $instance ) {
 		global $bp;
 
 		extract( $args );
 
+		if ( !$instance['member_default'] )
+			$instance['member_default'] = 'active';
+
 		echo $before_widget;
 		echo $before_title
-		   . $widget_name
+		   . $instance['title']
 		   . $after_title; ?>
 
-		<?php if ( bp_has_members( 'user_id=0&type=newest&max=' . $instance['max_members'] . '&populate_extras=0' ) ) : ?>
+		<?php if ( bp_has_members( 'user_id=0&type=' . $instance['member_default'] . '&max=' . $instance['max_members'] . '&populate_extras=0' ) ) : ?>
 			<div class="item-options" id="members-list-options">
-				<span class="ajax-loader" id="ajax-loader-members"></span>
-				<a href="<?php echo site_url() . '/' . BP_MEMBERS_SLUG ?>" id="newest-members" class="selected"><?php _e( 'Newest', 'buddypress' ) ?></a>
-				|  <a href="<?php echo site_url() . '/' . BP_MEMBERS_SLUG ?>" id="recently-active-members"><?php _e( 'Active', 'buddypress' ) ?></a>
+				<a href="<?php echo site_url( bp_get_members_root_slug() ); ?>" id="newest-members" <?php if ( $instance['member_default'] == 'newest' ) : ?>class="selected"<?php endif; ?>><?php _e( 'Newest', 'buddypress' ) ?></a>
+				|  <a href="<?php echo site_url( bp_get_members_root_slug() ); ?>" id="recently-active-members" <?php if ( $instance['member_default'] == 'active' ) : ?>class="selected"<?php endif; ?>><?php _e( 'Active', 'buddypress' ) ?></a>
 
 				<?php if ( bp_is_active( 'friends' ) ) : ?>
 
-					| <a href="<?php echo site_url() . '/' . BP_MEMBERS_SLUG ?>" id="popular-members"><?php _e( 'Popular', 'buddypress' ) ?></a>
+					| <a href="<?php echo site_url( bp_get_members_root_slug() ); ?>" id="popular-members" <?php if ( $instance['member_default'] == 'popular' ) : ?>class="selected"<?php endif; ?>><?php _e( 'Popular', 'buddypress' ) ?></a>
 
 				<?php endif; ?>
-
 			</div>
 
 			<ul id="members-list" class="item-list">
 				<?php while ( bp_members() ) : bp_the_member(); ?>
 					<li class="vcard">
 						<div class="item-avatar">
-							<a href="<?php bp_member_permalink() ?>"><?php bp_member_avatar() ?></a>
+							<a href="<?php bp_member_permalink() ?>" title="<?php bp_member_name() ?>"><?php bp_member_avatar() ?></a>
 						</div>
 
 						<div class="item">
 							<div class="item-title fn"><a href="<?php bp_member_permalink() ?>" title="<?php bp_member_name() ?>"><?php bp_member_name() ?></a></div>
-							<div class="item-meta"><span class="activity"><?php bp_member_registered() ?></span></div>
+							<div class="item-meta">
+								<span class="activity">
+								<?php
+									if ( 'newest' == $instance['member_default'] )
+										bp_member_registered();
+									if ( 'active' == $instance['member_default'] )
+										bp_member_last_active();
+									if ( 'popular' == $instance['member_default'] )
+										bp_member_total_friend_count();
+								?>
+								</span>
+							</div>
 						</div>
 					</li>
 
@@ -74,17 +98,40 @@ 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['member_default'] = strip_tags( $new_instance['member_default'] );
 
 		return $instance;
 	}
 
 	function form( $instance ) {
-		$instance = wp_parse_args( (array) $instance, array( 'max_members' => 5 ) );
+		$defaults = array(
+			'title' => __( 'Members', 'buddypress' ),
+			'max_members' => 5,
+			'member_default' => 'active'
+		);
+		$instance = wp_parse_args( (array) $instance, $defaults );
+
+		$title = strip_tags( $instance['title'] );
 		$max_members = strip_tags( $instance['max_members'] );
+		$member_default = strip_tags( $instance['member_default'] );
 		?>
 
-		<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><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="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>
+			<label for="bp-core-widget-groups-default"><?php _e('Default members to show:', 'buddypress'); ?>
+			<select name="<?php echo $this->get_field_name( 'member_default' ) ?>">
+				<option value="newest" <?php if ( $member_default == 'newest' ) : ?>selected="selected"<?php endif; ?>><?php _e( 'Newest', 'buddypress' ) ?></option>
+				<option value="active" <?php if ( $member_default == 'active' ) : ?>selected="selected"<?php endif; ?>><?php _e( 'Active', 'buddypress' ) ?></option>
+				<option value="popular"  <?php if ( $member_default == 'popular' ) : ?>selected="selected"<?php endif; ?>><?php _e( 'Popular', 'buddypress' ) ?></option>
+			</select>
+			</label>
+		</p>
+
 	<?php
 	}
 }
@@ -92,8 +139,14 @@ class BP_Core_Members_Widget extends WP_Widget {
 /*** WHO'S ONLINE WIDGET *****************/
 
 class BP_Core_Whos_Online_Widget extends WP_Widget {
+
 	function bp_core_whos_online_widget() {
-		parent::WP_Widget( false, $name = __( "Who's Online Avatars", 'buddypress' ) );
+		$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) {
@@ -103,14 +156,14 @@ class BP_Core_Whos_Online_Widget extends WP_Widget {
 
 		echo $before_widget;
 		echo $before_title
-		   . $widget_name
+		   . $instance['title']
 		   . $after_title; ?>
 
 		<?php if ( bp_has_members( 'user_id=0&type=online&per_page=' . $instance['max_members'] . '&max=' . $instance['max_members'] . '&populate_extras=0' ) ) : ?>
 			<div class="avatar-block">
 				<?php while ( bp_members() ) : bp_the_member(); ?>
 					<div class="item-avatar">
-						<a href="<?php bp_member_permalink() ?>"><?php bp_member_avatar() ?></a>
+						<a href="<?php bp_member_permalink() ?>" title="<?php bp_member_name() ?>"><?php bp_member_avatar() ?></a>
 					</div>
 				<?php endwhile; ?>
 			</div>
@@ -128,16 +181,25 @@ class BP_Core_Whos_Online_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'] );
 
 		return $instance;
 	}
 
 	function form( $instance ) {
-		$instance = wp_parse_args( (array) $instance, array( 'max_members' => 15 ) );
+		$defaults = array(
+			'title' => __( "Who's Online", 'buddypress' ),
+			'max_members' => 15
+		);
+		$instance = wp_parse_args( (array) $instance, $defaults );
+
+		$title = strip_tags( $instance['title'] );
 		$max_members = strip_tags( $instance['max_members'] );
 		?>
 
+		<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="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>
 	<?php
 	}
@@ -146,8 +208,14 @@ class BP_Core_Whos_Online_Widget extends WP_Widget {
 /*** RECENTLY ACTIVE WIDGET *****************/
 
 class BP_Core_Recently_Active_Widget extends WP_Widget {
+
 	function bp_core_recently_active_widget() {
-		parent::WP_Widget( false, $name = __( 'Recently Active Member Avatars', 'buddypress' ) );
+		$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) {
@@ -157,14 +225,14 @@ class BP_Core_Recently_Active_Widget extends WP_Widget {
 
 		echo $before_widget;
 		echo $before_title
-		   . $widget_name
+		   . $instance['title']
 		   . $after_title; ?>
 
 		<?php if ( bp_has_members( 'user_id=0&type=active&per_page=' . $instance['max_members'] . '&max=' . $instance['max_members'] . '&populate_extras=0' ) ) : ?>
 			<div class="avatar-block">
 				<?php while ( bp_members() ) : bp_the_member(); ?>
 					<div class="item-avatar">
-						<a href="<?php bp_member_permalink() ?>"><?php bp_member_avatar() ?></a>
+						<a href="<?php bp_member_permalink() ?>" title="<?php bp_member_name() ?>"><?php bp_member_avatar() ?></a>
 					</div>
 				<?php endwhile; ?>
 			</div>
@@ -182,16 +250,25 @@ class BP_Core_Recently_Active_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'] );
 
 		return $instance;
 	}
 
 	function form( $instance ) {
-		$instance = wp_parse_args( (array) $instance, array( 'max_members' => 15 ) );
+		$defaults = array(
+			'title' => 'Recently Active Members',
+			'max_members' => 15
+		);
+		$instance = wp_parse_args( (array) $instance, $defaults );
+
+		$title = strip_tags( $instance['title'] );
 		$max_members = strip_tags( $instance['max_members'] );
 		?>
 
+		<p><label for="bp-core-widget-members-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="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>
 	<?php
 	}
@@ -233,8 +310,10 @@ function bp_core_ajax_widget_members() {
 
 					<div class="item">
 						<div class="item-title fn"><a href="<?php bp_member_permalink() ?>" title="<?php bp_member_name() ?>"><?php bp_member_name() ?></a></div>
-						<?php if ( 'active' == $type || 'newest' == $type ) : ?>
+						<?php if ( 'active' == $type ) : ?>
 							<div class="item-meta"><span class="activity"><?php bp_member_last_active() ?></span></div>
+						<?php elseif ( 'newest' == $type ) : ?>
+							<div class="item-meta"><span class="activity"><?php bp_member_registered() ?></span></div>
 						<?php elseif ( bp_is_active( 'friends' ) ) : ?>
 							<div class="item-meta"><span class="activity"><?php bp_member_total_friend_count() ?></span></div>
 						<?php endif; ?>
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 6c132c12dbad4d15264371436a544b62a8c8165c..bef59de08620c8bbbb8ebcd7aef2d76d36953c3b 100644
--- a/wp-content/plugins/buddypress/bp-core/bp-core-wpabstraction.php
+++ b/wp-content/plugins/buddypress/bp-core/bp-core-wpabstraction.php
@@ -9,120 +9,167 @@
  * the 3.0 WordPress version merge takes place.
  */
 
-if ( !bp_core_is_multisite() ) {
-	$wpdb->base_prefix = $wpdb->prefix;
-	$wpdb->blogid = 1;
-}
-
-function bp_core_is_multisite() {
-	if ( function_exists( 'is_multisite' ) )
-		return is_multisite();
+// Exit if accessed directly
+if ( !defined( 'ABSPATH' ) ) exit;
 
-	if ( !function_exists( 'wpmu_signup_blog' ) )
-		return false;
-
-	return true;
+/**
+ * Parso the WordPress core version number into the major release
+ *
+ * @since BuddyPress (1.5.2)
+ * @global string $wp_version
+ * @return string 
+ */
+function bp_get_major_wp_version() {
+	global $wp_version;
+	
+	return substr( $wp_version, 0, ( strpos( $wp_version, '.' ) + 2 ) );
 }
 
 /**
- * bp_core_is_main_site
- *
- * Checks if current blog is root blog of site
- *
- * @since 1.2.6
- * @package BuddyPress
- *
- * @param int $blog_id optional blog id to test (default current blog)
- * @return bool True if not multisite or $blog_id is main site
+ * Only add abstraction functions if WordPress is not in multisite mode
  */
-function bp_core_is_main_site( $blog_id = '' ) {
-	global $current_site, $current_blog;
+if ( !is_multisite() ) {
+	global $wpdb;
 
-	if ( !bp_core_is_multisite() )
-		return true;
+	$wpdb->base_prefix = $wpdb->prefix;
+	$wpdb->blogid      = BP_ROOT_BLOG;
 
-	if ( empty( $blog_id ) )
-		$blog_id = $current_blog->blog_id;
+	if ( !function_exists( 'get_blog_option' ) ) {
+		function get_blog_option( $blog_id, $option_name, $default = false ) {
+			return get_option( $option_name, $default );
+		}
+	}
 
-	return $blog_id == $current_site->blog_id;
-}
+	if ( !function_exists( 'update_blog_option' ) ) {
+		function update_blog_option( $blog_id, $option_name, $value ) {
+			return update_option( $option_name, $value );
+		}
+	}
 
-function bp_core_get_status_sql( $prefix = false ) {
-	if ( !bp_core_is_multisite() )
-		return "{$prefix}user_status = 0";
-	else
-		return "{$prefix}spam = 0 AND {$prefix}deleted = 0 AND {$prefix}user_status = 0";
-}
+	if ( !function_exists( 'delete_blog_option' ) ) {
+		function delete_blog_option( $blog_id, $option_name ) {
+			return delete_option( $option_name );
+		}
+	}
 
-if ( !function_exists( 'get_blog_option' ) ) {
-	function get_blog_option( $blog_id, $option_name, $default = false ) {
-		return get_option( $option_name, $default );
+	if ( !function_exists( 'switch_to_blog' ) ) {
+		function switch_to_blog() {
+			return bp_get_root_blog_id();
+		}
 	}
-}
 
-if ( !function_exists( 'add_blog_option' ) ) {
-	function add_blog_option( $blog_id, $option_name, $option_value ) {
-		return add_option( $option_name, $option_value );
+	if ( !function_exists( 'restore_current_blog' ) ) {
+		function restore_current_blog() {
+			return bp_get_root_blog_id();
+		}
 	}
-}
 
-if ( !function_exists( 'update_blog_option' ) ) {
-	function update_blog_option( $blog_id, $option_name, $option_value ) {
-		return update_option( $option_name, $option_value );
+	if ( !function_exists( 'get_blogs_of_user' ) ) {
+		function get_blogs_of_user() {
+			return false;
+		}
 	}
-}
 
-if ( !function_exists( 'switch_to_blog' ) ) {
-	function switch_to_blog() {
-		return 1;
+	if ( !function_exists( 'update_blog_status' ) ) {
+		function update_blog_status() {
+			return true;
+		}
 	}
-}
 
-if ( !function_exists( 'restore_current_blog' ) ) {
-	function restore_current_blog() {
-		return 1;
+	if ( !function_exists( 'is_subdomain_install' ) ) {
+		function is_subdomain_install() {
+			if ( ( defined( 'VHOST' ) && 'yes' == VHOST ) || ( defined( 'SUBDOMAIN_INSTALL' ) && SUBDOMAIN_INSTALL ) )
+				return true;
+
+			return false;
+		}
 	}
 }
 
-if ( !function_exists( 'get_blogs_of_user' ) ) {
-	function get_blogs_of_user() {
-		return false;
-	}
+function bp_core_get_status_sql( $prefix = false ) {
+	if ( !is_multisite() )
+		return "{$prefix}user_status = 0";
+	else
+		return "{$prefix}spam = 0 AND {$prefix}deleted = 0 AND {$prefix}user_status = 0";
 }
 
-if ( !function_exists( 'update_blog_status' ) ) {
-	function update_blog_status() {
-		return true;
+/**
+ * Multibyte encoding fallback functions
+ *
+ * The PHP multibyte encoding extension is not enabled by default. In cases where it is not enabled,
+ * these functions provide a fallback.
+ *
+ * Borrowed from MediaWiki, under the GPLv2. Thanks!
+ */
+if ( !function_exists( 'mb_strlen' ) ) {
+	/**
+	 * Fallback implementation of mb_strlen, hardcoded to UTF-8.
+	 * @param string $str
+	 * @param string $enc optional encoding; ignored
+	 * @return int
+	 */
+	function mb_strlen( $str, $enc = '' ) {
+		$counts = count_chars( $str );
+		$total = 0;
+
+		// Count ASCII bytes
+		for( $i = 0; $i < 0x80; $i++ ) {
+			$total += $counts[$i];
+		}
+
+		// Count multibyte sequence heads
+		for( $i = 0xc0; $i < 0xff; $i++ ) {
+			$total += $counts[$i];
+		}
+		return $total;
 	}
 }
 
-if ( !function_exists( 'is_subdomain_install' ) ) {
-	function is_subdomain_install() {
-		if ( ( defined( 'VHOST' ) && 'yes' == VHOST ) || ( defined( 'SUBDOMAIN_INSTALL' ) && SUBDOMAIN_INSTALL ) )
-			return true;
+if ( !function_exists( 'mb_strpos' ) ) {
+	/**
+	 * Fallback implementation of mb_strpos, hardcoded to UTF-8.
+	 * @param $haystack String
+	 * @param $needle String
+	 * @param $offset String: optional start position
+	 * @param $encoding String: optional encoding; ignored
+	 * @return int
+	 */
+	function mb_strpos( $haystack, $needle, $offset = 0, $encoding = '' ) {
+		$needle = preg_quote( $needle, '/' );
 
-		return false;
-	}
-}
+		$ar = array();
+		preg_match( '/' . $needle . '/u', $haystack, $ar, PREG_OFFSET_CAPTURE, $offset );
 
-// Deprecated - 1.2.6
-if ( !function_exists( 'is_site_admin' ) ) {
-	function is_site_admin( $user_id = false ) {
-		return is_super_admin( $user_id );
+		if( isset( $ar[0][1] ) ) {
+			return $ar[0][1];
+		} else {
+			return false;
+		}
 	}
 }
 
-// Added for WordPress 3.1 support
-if ( !function_exists( 'get_dashboard_url' ) ) {
-
+if ( !function_exists( 'mb_strrpos' ) ) {
 	/**
-	 * Make sure the 'network_admin_menu' hook (which is new to 3.1) fires
-	 * on our reliable friend 'admin_menu'
+	 * Fallback implementation of mb_strrpos, hardcoded to UTF-8.
+	 * @param $haystack String
+	 * @param $needle String
+	 * @param $offset String: optional start position
+	 * @param $encoding String: optional encoding; ignored
+	 * @return int
 	 */
-	function bp_network_admin_menu() {
-		do_action( 'network_admin_menu' );
+	function mb_strrpos( $haystack, $needle, $offset = 0, $encoding = '' ) {
+		$needle = preg_quote( $needle, '/' );
+
+		$ar = array();
+		preg_match_all( '/' . $needle . '/u', $haystack, $ar, PREG_OFFSET_CAPTURE, $offset );
+
+		if( isset( $ar[0] ) && count( $ar[0] ) > 0 &&
+			isset( $ar[0][count( $ar[0] ) - 1][1] ) ) {
+			return $ar[0][count( $ar[0] ) - 1][1];
+		} else {
+			return false;
+		}
 	}
-	add_action( 'admin_menu', 'bp_network_admin_menu' );
 }
 
-?>
+?>
\ No newline at end of file
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
new file mode 100644
index 0000000000000000000000000000000000000000..3c33211afb4a14498bae9193b79e3571384fdea3
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-core/css/admin-bar-rtl.css
@@ -0,0 +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
diff --git a/wp-content/plugins/buddypress/bp-core/css/admin-bar-rtl.dev.css b/wp-content/plugins/buddypress/bp-core/css/admin-bar-rtl.dev.css
new file mode 100644
index 0000000000000000000000000000000000000000..389638405b578e2f2c1c2acdb3ce274e5ddd9146
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-core/css/admin-bar-rtl.dev.css
@@ -0,0 +1,27 @@
+#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
new file mode 100644
index 0000000000000000000000000000000000000000..a26d0cf6ec1c9e96144438e20949ed65cbcf8e07
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-core/css/admin-bar.css
@@ -0,0 +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
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
new file mode 100644
index 0000000000000000000000000000000000000000..78259bcf44fd4f3da28d54455457e5cce0a8f9fe
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-core/css/admin-bar.dev.css
@@ -0,0 +1,62 @@
+#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;
+	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;
+}
+
+/* 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;
+}
+#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
diff --git a/wp-content/plugins/buddypress/bp-core/css/admin.css b/wp-content/plugins/buddypress/bp-core/css/admin.css
new file mode 100644
index 0000000000000000000000000000000000000000..69c4cfc02f8c9c1905fd4994ebc876bdb77d537f
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-core/css/admin.css
@@ -0,0 +1 @@
+div#icon-buddypress{background:url(../images/icons32.png) no-repeat -4px 0;}div#bp-admin{color:#555;min-width:680px;}div#bp-admin p{line-height:170%;}form#bp-admin-form{margin:0 10px;}div#bp-admin-nav{background:#e0e0e0;margin:15px -10px 10px;padding:10px 10px 0 10px;height:30px;-moz-border-radius:6px;-webkit-border-radius:6px;border-radius:6px;}div#bp-admin-nav div.submit{position:relative;float:right;margin-top:-36px!important;}div#bp-admin-nav div.submit input{padding:6px 10px;}div#bp-admin-nav ol{list-style-type:decimal;margin:0;padding:0;}div#bp-admin-nav ol li{float:left;margin:0 10px 0 0;color:#666;}div#bp-admin-nav ol li{padding:8px 12px;display:block;-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;text-decoration:none;}div#bp-admin-nav ol li.current{background:#f9f9f9;color:#555;}div#bp-admin-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:6px;-webkit-border-radius:6px;border-radius:6px;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-admin div.prev-next,div#bp-admin div.prev-next p,div#bp-admin div.submit,div#bp-admin div.submit p{margin:0;padding:0;}div#bp-admin div.submit{margin-top:30px;}div#bp-admin div.prev-next{text-align:right;margin-top:0;}div#bp-admin div.prev-next{margin:0 -20px;padding:0 20px 10px;}div#bp-admin table td{font-family:helvetica,arial,tahoma,sans-serif;vertical-align:top;}div#bp-admin table.form-table th{border-right:1px solid #eee;padding:15px 25px 15px 0;color:#555;vertical-align:top;}div#bp-admin table.form-table tr{border-bottom:1px dotted #f0f0f0;}div#bp-admin table.form-table td{padding-left:25px;font-size:12px;}div#bp-admin table.form-table th h5{font-size:14px;margin:0;line-height:150%;}div#bp-admin table.form-table th img{margin-top:5px;}div#bp-admin table.form-table th p{margin:3px 0 0 0;}div#bp-admin code,div#bp-admin kbd{font-size:12px;background:#f0f0f0;}div#bp-admin div#message code,div#bp-admin 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/css/admin.dev.css b/wp-content/plugins/buddypress/bp-core/css/admin.dev.css
new file mode 100644
index 0000000000000000000000000000000000000000..8185b4a4c774417c91158bc08646a6ad95b30712
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-core/css/admin.dev.css
@@ -0,0 +1,160 @@
+div#icon-buddypress {
+	background: url( ../images/icons32.png ) no-repeat -4px 0px;
+}
+
+div#bp-admin {
+	color: #555;
+	min-width: 680px;
+	}
+	div#bp-admin p { line-height: 170%; }
+
+form#bp-admin-form {
+	margin: 0 10px;
+}
+
+div#bp-admin-nav {
+	background: #e0e0e0;
+	margin: 15px -10px 10px;
+	padding: 10px 10px 0 10px;
+	height: 30px;
+	-moz-border-radius: 6px;
+	-webkit-border-radius: 6px;
+	border-radius: 6px;
+}
+div#bp-admin-nav div.submit {
+	position: relative;
+	float: right;
+	margin-top: -36px !important;
+}
+div#bp-admin-nav div.submit input {
+	padding: 6px 10px;
+}
+	div#bp-admin-nav ol {
+		list-style-type: decimal;
+		margin: 0;
+		padding: 0;
+	}
+		div#bp-admin-nav ol li {
+			float: left;
+			margin: 0 10px 0 0;
+			color: #666;
+		}
+			div#bp-admin-nav ol li {
+				padding: 8px 12px;
+				display: block;
+				-moz-border-radius: 3px;
+				-webkit-border-radius: 3px;
+				border-radius: 3px;
+				text-decoration: none;
+			}
+				div#bp-admin-nav ol li.current {
+					background: #f9f9f9;
+					color: #555;
+				}
+	div#bp-admin-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: 6px;
+		-webkit-border-radius: 6px;
+		border-radius: 6px;
+		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-admin div.prev-next, div#bp-admin div.prev-next p,
+div#bp-admin div.submit, div#bp-admin div.submit p {
+	margin: 0;
+	padding: 0;
+}
+div#bp-admin div.submit { margin-top: 30px; }
+div#bp-admin div.prev-next { text-align: right; margin-top: 0; }
+
+div#bp-admin div.prev-next {
+	margin: 0 -20px;
+	padding: 0 20px 10px;
+}
+
+div#bp-admin table td {
+	font-family: helvetica, arial, tahoma, sans-serif;
+	vertical-align: top;
+}
+
+div#bp-admin table.form-table th {
+	border-right: 1px solid #eee;
+	padding: 15px 25px 15px 0;
+	color: #555;
+	vertical-align: top;
+}
+	div#bp-admin table.form-table tr {
+		border-bottom: 1px dotted #f0f0f0;
+	}
+	div#bp-admin table.form-table td { padding-left: 25px; font-size: 12px; }
+
+	div#bp-admin table.form-table th h5 {
+		font-size: 14px;
+		margin: 0;
+		line-height: 150%;
+	}
+
+	div#bp-admin table.form-table th img {
+		margin-top: 5px;
+	}
+
+	div#bp-admin table.form-table th p { margin: 3px 0 0 0; }
+
+div#bp-admin code, div#bp-admin kbd {
+	font-size: 12px;
+	background: #f0f0f0;
+}
+
+div#bp-admin div#message code, div#bp-admin 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/css/buddybar-rtl.css b/wp-content/plugins/buddypress/bp-core/css/buddybar-rtl.css
new file mode 100644
index 0000000000000000000000000000000000000000..425dff0f3e37f9eada35b0e56578b601d8fd0f94
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-core/css/buddybar-rtl.css
@@ -0,0 +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
diff --git a/wp-content/plugins/buddypress/bp-core/css/buddybar-rtl.dev.css b/wp-content/plugins/buddypress/bp-core/css/buddybar-rtl.dev.css
new file mode 100644
index 0000000000000000000000000000000000000000..57f713d2b699b8487fcd92bf23ac1459f420e14d
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-core/css/buddybar-rtl.dev.css
@@ -0,0 +1,77 @@
+#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 {/* all list items */
+	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;
+}
+
+/* second-level lists */
+#wp-admin-bar ul li ul {
+	right: -999em;
+	left: auto;
+	margin-right: 0;
+}
+#wp-admin-bar ul li ul li {
+	float: right;
+}
+
+/* third-and-above-level lists */
+#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 {/* lists nested under hovered list items */
+	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;
+}
+
+/* Menu item css */
+#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
new file mode 100644
index 0000000000000000000000000000000000000000..88b866f5b39032f5900927bf35deb2de09c3cd08
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-core/css/buddybar.css
@@ -0,0 +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
diff --git a/wp-content/plugins/buddypress/bp-core/css/buddybar.dev.css b/wp-content/plugins/buddypress/bp-core/css/buddybar.dev.css
new file mode 100644
index 0000000000000000000000000000000000000000..0c3ed9ad216039b8b71884430032ca376efd6352
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-core/css/buddybar.dev.css
@@ -0,0 +1,201 @@
+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 {
+	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;
+}
+
+/* all lists */
+#wp-admin-bar ul {
+	margin: 0;
+	list-style: none;
+	line-height: 1;
+	cursor: pointer;
+	height: auto;
+	padding: 0;
+}
+
+/* all list items */
+#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;
+}
+
+/* second-level lists */
+#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;
+}
+
+/* third-and-above-level lists */
+#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;
+}
+
+/* Menu item css */
+#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
diff --git a/wp-content/plugins/buddypress/bp-core/deprecated/1.5.php b/wp-content/plugins/buddypress/bp-core/deprecated/1.5.php
new file mode 100644
index 0000000000000000000000000000000000000000..03b03b82300032f66da089cce22bff28ff7f0c7b
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-core/deprecated/1.5.php
@@ -0,0 +1,536 @@
+<?php
+/**
+ * Deprecated Functions
+ *
+ * @package BuddyPress
+ * @subpackage Core
+ * @deprecated Since 1.5
+ */
+
+// Exit if accessed directly
+if ( !defined( 'ABSPATH' ) ) exit;
+
+/** Loader ********************************************************************/
+
+function bp_setup_root_components() {
+	do_action( 'bp_setup_root_components' );
+}
+add_action( 'bp_init', 'bp_setup_root_components', 6 );
+
+/** WP Abstraction ************************************************************/
+
+/**
+ * bp_core_is_multisite()
+ *
+ * This function originally served as a wrapper when WordPress and WordPress MU were separate entities.
+ * Use is_multisite() instead.
+ *
+ * @deprecated 1.5
+ * @deprecated Use is_multisite()
+ */
+function bp_core_is_multisite() {
+	_deprecated_function( __FUNCTION__, '1.5', 'is_multisite()' );
+	return is_multisite();
+}
+
+/**
+ * bp_core_is_main_site
+ *
+ * Checks if current blog is root blog of site. Deprecated in 1.5.
+ *
+ * @deprecated 1.5
+ * @deprecated Use is_main_site()
+ * @package BuddyPress
+ * @param int $blog_id optional blog id to test (default current blog)
+ * @return bool True if not multisite or $blog_id is main site
+ * @since 1.2.6
+ */
+function bp_core_is_main_site( $blog_id = '' ) {
+	_deprecated_function( __FUNCTION__, '1.5', 'is_main_site()' );
+	return is_main_site( $blog_id );
+}
+
+/**
+ * WPMU version of is_super_admin()
+ *
+ * @deprecated 1.5
+ * @deprecated Use is_super_admin()
+ * @param int $user_id Optional. Defaults to logged-in user
+ * @return bool True if is super admin
+ */
+if ( !function_exists( 'is_site_admin' ) ) {
+	function is_site_admin( $user_id = false ) {
+		_deprecated_function( __FUNCTION__, '1.5', 'is_super_admin()' );
+		return is_super_admin( $user_id );
+	}
+}
+
+/** Admin ******************************************************************/
+
+/**
+ * In BuddyPress 1.1 - 1.2.x, this function provided a better version of add_menu_page()
+ * that allowed positioning of menus. Deprecated in 1.5 in favour of a WP core function.
+ *
+ * @deprecated 1.5
+ * @deprecated Use add_menu_page().
+ * @since 1.1
+ */
+function bp_core_add_admin_menu_page( $args = '' ) {
+	global $_registered_pages, $admin_page_hooks, $menu;
+
+	_deprecated_function( __FUNCTION__, '1.5', 'Use add_menu_page()' );
+
+	$defaults = array(
+		'access_level' => 2,
+		'file'         => false,
+		'function'     => false,
+		'icon_url'     => false,
+		'menu_title'   => '',
+		'page_title'   => '',
+		'position'     => 100
+	);
+
+	$r = wp_parse_args( $args, $defaults );
+	extract( $r, EXTR_SKIP );
+
+	$file     = plugin_basename( $file );
+	$hookname = get_plugin_page_hookname( $file, '' );
+
+	$admin_page_hooks[$file] = sanitize_title( $menu_title );
+
+	if ( !empty( $function ) && !empty ( $hookname ) )
+		add_action( $hookname, $function );
+
+	if ( empty( $icon_url ) )
+		$icon_url = 'images/generic.png';
+	elseif ( is_ssl() && 0 === strpos( $icon_url, 'http://' ) )
+		$icon_url = 'https://' . substr( $icon_url, 7 );
+
+	do {
+		$position++;
+	} while ( !empty( $menu[$position] ) );
+
+	$menu[$position] = array ( $menu_title, $access_level, $file, $page_title, 'menu-top ' . $hookname, $hookname, $icon_url );
+	$_registered_pages[$hookname] = true;
+
+	return $hookname;
+}
+/** Activity ******************************************************************/
+
+function bp_is_activity_permalink() {
+	_deprecated_function( __FUNCTION__, '1.5', 'bp_is_single_activity' );
+	bp_is_single_activity();
+}
+
+/** Core **********************************************************************/
+
+function bp_core_get_wp_profile() {
+	_deprecated_function( __FUNCTION__, '1.5' );
+
+	global $bp;
+
+	$ud = get_userdata( $bp->displayed_user->id ); ?>
+
+<div class="bp-widget wp-profile">
+	<h4><?php _e( 'My Profile' ) ?></h4>
+
+	<table class="wp-profile-fields">
+
+		<?php if ( $ud->display_name ) : ?>
+
+			<tr id="wp_displayname">
+				<td class="label"><?php _e( 'Name', 'buddypress' ); ?></td>
+				<td class="data"><?php echo $ud->display_name; ?></td>
+			</tr>
+
+		<?php endif; ?>
+
+		<?php if ( $ud->user_description ) : ?>
+
+			<tr id="wp_desc">
+				<td class="label"><?php _e( 'About Me', 'buddypress' ); ?></td>
+				<td class="data"><?php echo $ud->user_description; ?></td>
+			</tr>
+
+		<?php endif; ?>
+
+		<?php if ( $ud->user_url ) : ?>
+
+			<tr id="wp_website">
+				<td class="label"><?php _e( 'Website', 'buddypress' ); ?></td>
+				<td class="data"><?php echo make_clickable( $ud->user_url ); ?></td>
+			</tr>
+
+		<?php endif; ?>
+
+		<?php if ( $ud->jabber ) : ?>
+
+			<tr id="wp_jabber">
+				<td class="label"><?php _e( 'Jabber', 'buddypress' ); ?></td>
+				<td class="data"><?php echo $ud->jabber; ?></td>
+			</tr>
+
+		<?php endif; ?>
+
+		<?php if ( $ud->aim ) : ?>
+
+			<tr id="wp_aim">
+				<td class="label"><?php _e( 'AOL Messenger', 'buddypress' ); ?></td>
+				<td class="data"><?php echo $ud->aim; ?></td>
+			</tr>
+
+		<?php endif; ?>
+
+		<?php if ( $ud->yim ) : ?>
+
+			<tr id="wp_yim">
+				<td class="label"><?php _e( 'Yahoo Messenger', 'buddypress' ); ?></td>
+				<td class="data"><?php echo $ud->yim; ?></td>
+			</tr>
+
+		<?php endif; ?>
+
+	</table>
+</div>
+
+<?php
+}
+
+function bp_is_home() {
+	_deprecated_function( __FUNCTION__, '1.5', 'bp_is_my_profile' );
+	return bp_is_my_profile();
+}
+
+/**
+ * Is the user on the front page of the site?
+ *
+ * @deprecated 1.5
+ * @deprecated Use is_front_page()
+ * @return bool
+ */
+function bp_is_front_page() {
+	_deprecated_function( __FUNCTION__, '1.5', "is_front_page()" );
+	return is_front_page();
+}
+
+/**
+ * Is the front page of the site set to the Activity component?
+ *
+ * @deprecated 1.5
+ * @deprecated Use bp_is_component_front_page( 'activity' )
+ * @return bool
+ */
+function bp_is_activity_front_page() {
+	_deprecated_function( __FUNCTION__, '1.5', "bp_is_component_front_page( 'activity' )" );
+	return bp_is_component_front_page( 'activity' );
+}
+
+function bp_is_member() {
+	_deprecated_function( __FUNCTION__, '1.5', 'bp_is_user' );
+	bp_is_user();
+}
+
+function bp_loggedinuser_link() {
+	_deprecated_function( __FUNCTION__, '1.5', 'bp_logged_in_user_link' );
+	bp_loggedin_user_link();
+}
+
+/**
+ * Only show the search form if there are available objects to search for.
+ * Deprecated in 1.5; not used anymore.
+ *
+ * @return bool
+ */
+function bp_search_form_enabled() {
+	_deprecated_function( __FUNCTION__, '1.5', 'No longer required.' );
+	return apply_filters( 'bp_search_form_enabled', true );
+}
+
+/**
+ * Template tag version of bp_get_page_title()
+ *
+ * @deprecated 1.5
+ * @deprecated Use wp_title()
+ * @since 1.0
+ */
+function bp_page_title() {
+	echo bp_get_page_title();
+}
+	/**
+	 * Prior to BuddyPress 1.5, this was used to generate the page's <title> text.
+	 * Now, just simply use wp_title().
+	 *
+	 * @deprecated 1.5
+	 * @deprecated Use wp_title()
+	 * @since 1.0
+	 */
+	function bp_get_page_title() {
+		_deprecated_function( __FUNCTION__, '1.5', 'wp_title()' );
+		$title = wp_title( '|', false, 'right' ) . get_bloginfo( 'name', 'display' );
+
+		// Backpat for BP 1.2 filter
+		$title = apply_filters( 'bp_page_title', esc_attr( $title ), esc_attr( $title ) );
+
+		return apply_filters( 'bp_get_page_title', $title );
+	}
+
+/**
+ * Generate a link to log out. Last used in BP 1.2-beta. You should be using wp_logout_url().
+ *
+ * @deprecated 1.5
+ * @deprecated Use wp_logout_url()
+ * @since 1.0
+ */
+function bp_log_out_link() {
+	_deprecated_function( __FUNCTION__, '1.5', 'wp_logout_url()' );
+
+	$logout_link = '<a href="' . wp_logout_url( bp_get_root_domain() ) . '">' . __( 'Log Out', 'buddypress' ) . '</a>';
+	echo apply_filters( 'bp_logout_link', $logout_link );
+}
+
+/**
+ * Send an email and a BP notification on receipt of an @-mention in a group
+ *
+ * @deprecated 1.5
+ * @deprecated Deprecated in favor of the more general bp_activity_at_message_notification()
+ */
+function groups_at_message_notification( $content, $poster_user_id, $group_id, $activity_id ) {
+	global $bp;
+
+	_deprecated_function( __FUNCTION__, '1.5', 'bp_activity_at_message_notification()' );
+
+	/* Scan for @username strings in an activity update. Notify each user. */
+	$pattern = '/[@]+([A-Za-z0-9-_\.@]+)/';
+	preg_match_all( $pattern, $content, $usernames );
+
+	/* Make sure there's only one instance of each username */
+	if ( !$usernames = array_unique( $usernames[1] ) )
+		return false;
+
+	$group = new BP_Groups_Group( $group_id );
+
+	foreach( (array)$usernames as $username ) {
+		if ( !$receiver_user_id = bp_core_get_userid( $username ) )
+			continue;
+
+		/* Check the user is a member of the group before sending the update. */
+		if ( !groups_is_user_member( $receiver_user_id, $group_id ) )
+			continue;
+
+		// Now email the user with the contents of the message (if they have enabled email notifications)
+		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/';
+
+			$poster_name = stripslashes( $poster_name );
+			$content = bp_groups_filter_kses( stripslashes( $content ) );
+
+			// Set up and send the message
+			$ud = bp_core_get_core_userdata( $receiver_user_id );
+			$to = $ud->user_email;
+			$sitename = wp_specialchars_decode( get_blog_option( bp_get_root_blog_id(), 'blogname' ), ENT_QUOTES );
+			$subject  = '[' . $sitename . '] ' . sprintf( __( '%1$s mentioned you in the group "%2$s"', 'buddypress' ), $poster_name, $group->name );
+
+$message = sprintf( __(
+'%1$s mentioned you in the group "%2$s":
+
+"%3$s"
+
+To view and respond to the message, log in and visit: %4$s
+
+---------------------
+', 'buddypress' ), $poster_name, $group->name, $content, $message_link );
+
+			$message .= sprintf( __( 'To disable these notifications please log in and go to: %s', 'buddypress' ), $settings_link );
+
+			/* Send the message */
+			$to = apply_filters( 'groups_at_message_notification_to', $to );
+			$subject = apply_filters( 'groups_at_message_notification_subject', $subject, $group, $poster_name );
+			$message = apply_filters( 'groups_at_message_notification_message', $message, $group, $poster_name, $content, $message_link, $settings_link );
+
+			wp_mail( $to, $subject, $message );
+		}
+	}
+
+	do_action( 'bp_groups_sent_mention_email', $usernames, $subject, $message, $content, $poster_user_id, $group_id, $activity_id );
+}
+
+/**
+ * BP 1.5 simplified notification functions a bit
+ */
+function bp_core_delete_notifications_for_user_by_type( $user_id, $component_name, $component_action ) {
+	_deprecated_function( __FUNCTION__, '1.5', 'bp_core_delete_notifications_by_type()' );
+	return BP_Core_Notification::delete_for_user_by_type( $user_id, $component_name, $component_action );
+}
+
+function bp_core_delete_notifications_for_user_by_item_id( $user_id, $item_id, $component_name, $component_action, $secondary_item_id = false ) {
+	_deprecated_function( __FUNCTION__, '1.5', 'bp_core_delete_notifications_by_item_id()' );
+	return BP_Core_Notification::delete_for_user_by_item_id( $user_id, $item_id, $component_name, $component_action, $secondary_item_id );
+}
+
+/**
+ * In BP 1.5, these functions were renamed for greater consistency
+ */
+function bp_forum_directory_permalink() {
+	_deprecated_function( __FUNCTION__, '1.5', 'bp_forums_directory_permalink()' );
+	bp_forums_directory_permalink();
+}
+	function bp_get_forum_directory_permalink() {
+		_deprecated_function( __FUNCTION__, '1.5', 'bp_get_forums_directory_permalink()' );
+		return bp_get_forums_directory_permalink();
+	}
+
+/**
+ * Last used by core in BP 1.1. The markup was merged into DTheme's header.php template.
+ */
+function bp_search_form() {
+	_deprecated_function( __FUNCTION__, '1.1', 'No longer required.' );
+
+	$form = '
+		<form action="' . bp_search_form_action() . '" method="post" id="search-form">
+			<input type="text" id="search-terms" name="search-terms" value="" />
+			' . bp_search_form_type_select() . '
+
+			<input type="submit" name="search-submit" id="search-submit" value="' . __( 'Search', 'buddypress' ) . '" />
+			' . wp_nonce_field( 'bp_search_form' ) . '
+		</form>
+	';
+
+	echo apply_filters( 'bp_search_form', $form );
+}
+
+/**
+ * Some _is_ function had their names normalized
+ */
+function bp_is_profile_edit() {
+	_deprecated_function( __FUNCTION__, '1.5', 'bp_is_user_profile_edit()' );
+	return bp_is_user_profile_edit();
+}
+
+function bp_is_change_avatar() {
+	_deprecated_function( __FUNCTION__, '1.5', 'bp_is_user_change_avatar()' );
+	return bp_is_user_change_avatar();
+}
+
+function bp_is_friend_requests() {
+	_deprecated_function( __FUNCTION__, '1.5', 'bp_is_user_friend_requests()' );
+	return bp_is_user_friend_requests();
+}
+
+/** Theme *********************************************************************/
+
+/**
+ * Contains functions which were moved out of BP-Default's functions.php
+ * in BuddyPress 1.5.
+ *
+ * @since 1.5
+ */
+function bp_dtheme_deprecated() {
+	if ( !function_exists( 'bp_dtheme_wp_pages_filter' ) ) :
+	/**
+	 * In BuddyPress 1.2.x, this function filtered the dropdown on the
+	 * Settings > Reading screen for selecting the page to show on front to
+	 * include "Activity Stream." As of 1.5.x, it is no longer required.
+	 *
+	 * @deprecated 1.5
+	 * @deprecated No longer required.
+	 * @param string $page_html A list of pages as a dropdown (select list)
+	 * @return string
+	 * @see wp_dropdown_pages()
+	 * @since 1.2
+	 */
+	function bp_dtheme_wp_pages_filter( $page_html ) {
+		_deprecated_function( __FUNCTION__, '1.5', "No longer required." );
+		return $page_html;
+	}
+	endif;
+
+	if ( !function_exists( 'bp_dtheme_page_on_front_update' ) ) :
+	/**
+	 * In BuddyPress 1.2.x, this function hijacked the saving of page on front setting to save the activity stream setting.
+	 * As of 1.5.x, it is no longer required.
+	 *
+	 * @deprecated 1.5
+	 * @deprecated No longer required.
+	 * @param $string $oldvalue Previous value of get_option( 'page_on_front' )
+	 * @param $string $oldvalue New value of get_option( 'page_on_front' )
+	 * @return string
+	 * @since 1.2
+	 */
+	function bp_dtheme_page_on_front_update( $oldvalue, $newvalue ) {
+		_deprecated_function( __FUNCTION__, '1.5', "No longer required." );
+		if ( !is_admin() || !is_super_admin() )
+			return false;
+
+		return $oldvalue;
+	}
+	endif;
+
+	if ( !function_exists( 'bp_dtheme_page_on_front_template' ) ) :
+	/**
+	 * In BuddyPress 1.2.x, this function loaded the activity stream template if the front page display settings allow.
+	 * As of 1.5.x, it is no longer required.
+	 *
+	 * @deprecated 1.5
+	 * @deprecated No longer required.
+	 * @param string $template Absolute path to the page template
+	 * @return string
+	 * @since 1.2
+	 */
+	function bp_dtheme_page_on_front_template( $template ) {
+		_deprecated_function( __FUNCTION__, '1.5', "No longer required." );
+		return $template;
+	}
+	endif;
+
+	if ( !function_exists( 'bp_dtheme_fix_get_posts_on_activity_front' ) ) :
+	/**
+	 * In BuddyPress 1.2.x, this forced the page ID as a string to stop the get_posts query from kicking up a fuss.
+	 * As of 1.5.x, it is no longer required.
+	 *
+	 * @deprecated 1.5
+	 * @deprecated No longer required.
+	 * @since 1.2
+	 */
+	function bp_dtheme_fix_get_posts_on_activity_front() {
+		_deprecated_function( __FUNCTION__, '1.5', "No longer required." );
+	}
+	endif;
+
+	if ( !function_exists( 'bp_dtheme_fix_the_posts_on_activity_front' ) ) :
+	/**
+	 * In BuddyPress 1.2.x, this was used as part of the code that set the activity stream to be on the front page.
+	 * As of 1.5.x, it is no longer required.
+	 *
+	 * @deprecated 1.5
+	 * @deprecated No longer required.
+	 * @param array $posts Posts as retrieved by WP_Query
+	 * @return array
+	 * @since 1.2.5
+	 */
+	function bp_dtheme_fix_the_posts_on_activity_front( $posts ) {
+		_deprecated_function( __FUNCTION__, '1.5', "No longer required." );
+		return $posts;
+	}
+	endif;
+
+	if ( !function_exists( 'bp_dtheme_add_blog_comments_js' ) ) :
+	/**
+	 * In BuddyPress 1.2.x, this added the javascript needed for blog comment replies.
+	 * As of 1.5.x, we recommend that you enqueue the comment-reply javascript in your theme's header.php.
+	 *
+	 * @deprecated 1.5
+	 * @deprecated Enqueue the comment-reply script in your theme's header.php.
+	 * @since 1.2
+	 */
+	function bp_dtheme_add_blog_comments_js() {
+		_deprecated_function( __FUNCTION__, '1.5', "Enqueue the comment-reply script in your theme's header.php." );
+		if ( is_singular() && bp_is_blog_page() && get_option( 'thread_comments' ) )
+			wp_enqueue_script( 'comment-reply' );
+	}
+	endif;
+}
+add_action( 'after_setup_theme', 'bp_dtheme_deprecated', 15 );
+?>
\ No newline at end of file
diff --git a/wp-content/plugins/buddypress/bp-core/images/60pc_black.png b/wp-content/plugins/buddypress/bp-core/images/60pc_black.png
new file mode 100644
index 0000000000000000000000000000000000000000..ce7c1c7330326b32e8767f4110d6527886a1deea
Binary files /dev/null and b/wp-content/plugins/buddypress/bp-core/images/60pc_black.png differ
diff --git a/wp-content/plugins/buddypress/bp-core/images/admin-bar-sprite-rtl.png b/wp-content/plugins/buddypress/bp-core/images/admin-bar-sprite-rtl.png
new file mode 100644
index 0000000000000000000000000000000000000000..f49aae7a01741631161df6df5e3175afeea69406
Binary files /dev/null and b/wp-content/plugins/buddypress/bp-core/images/admin-bar-sprite-rtl.png differ
diff --git a/wp-content/plugins/buddypress/bp-core/images/admin-bar-sprite.png b/wp-content/plugins/buddypress/bp-core/images/admin-bar-sprite.png
new file mode 100644
index 0000000000000000000000000000000000000000..8eb1c085b18d1bdd102e8151a48ef98974ac87b8
Binary files /dev/null and b/wp-content/plugins/buddypress/bp-core/images/admin-bar-sprite.png differ
diff --git a/wp-content/plugins/buddypress/bp-core/images/admin-menu-arrow.gif b/wp-content/plugins/buddypress/bp-core/images/admin-menu-arrow.gif
new file mode 100644
index 0000000000000000000000000000000000000000..ba8eab77cfc9761426220d1caf4510cfea3affca
Binary files /dev/null and b/wp-content/plugins/buddypress/bp-core/images/admin-menu-arrow.gif differ
diff --git a/wp-content/plugins/buddypress/bp-core/images/admin_menu_icon.png b/wp-content/plugins/buddypress/bp-core/images/admin_menu_icon.png
index d3624b2c49da35cb17605b19759a1a5d83175ebe..71677f2a4288f2539ccdf3953ef5608ec74cf3bd 100644
Binary files a/wp-content/plugins/buddypress/bp-core/images/admin_menu_icon.png and b/wp-content/plugins/buddypress/bp-core/images/admin_menu_icon.png differ
diff --git a/wp-content/plugins/buddypress/bp-core/images/completed.gif b/wp-content/plugins/buddypress/bp-core/images/completed.gif
new file mode 100644
index 0000000000000000000000000000000000000000..aaca9881da38c2d5040e23d004e140f8a68b3144
Binary files /dev/null and b/wp-content/plugins/buddypress/bp-core/images/completed.gif differ
diff --git a/wp-content/plugins/buddypress/bp-core/images/find.png b/wp-content/plugins/buddypress/bp-core/images/find.png
new file mode 100644
index 0000000000000000000000000000000000000000..7ef0e3746da73f097c9120f0b0ec58c45faf7d55
Binary files /dev/null and b/wp-content/plugins/buddypress/bp-core/images/find.png differ
diff --git a/wp-content/plugins/buddypress/bp-core/images/icons32.png b/wp-content/plugins/buddypress/bp-core/images/icons32.png
new file mode 100644
index 0000000000000000000000000000000000000000..d783073bc673e7643f66dfef443b0fccb67b8567
Binary files /dev/null and b/wp-content/plugins/buddypress/bp-core/images/icons32.png differ
diff --git a/wp-content/plugins/buddypress/bp-core/images/installed.gif b/wp-content/plugins/buddypress/bp-core/images/installed.gif
new file mode 100644
index 0000000000000000000000000000000000000000..878b8bd300326793fb0392e7f98d9577e6940f26
Binary files /dev/null and b/wp-content/plugins/buddypress/bp-core/images/installed.gif differ
diff --git a/wp-content/plugins/buddypress/bp-core/images/logo-column-header.png b/wp-content/plugins/buddypress/bp-core/images/logo-column-header.png
new file mode 100644
index 0000000000000000000000000000000000000000..a8f3b0b9b1042d118e46b316b811f85b7cf1d112
Binary files /dev/null and b/wp-content/plugins/buddypress/bp-core/images/logo-column-header.png differ
diff --git a/wp-content/plugins/buddypress/bp-core/images/logo.png b/wp-content/plugins/buddypress/bp-core/images/logo.png
new file mode 100644
index 0000000000000000000000000000000000000000..cdb41a49a84c7d9f1c2a02fc4dade3bc8d374eb7
Binary files /dev/null and b/wp-content/plugins/buddypress/bp-core/images/logo.png differ
diff --git a/wp-content/plugins/buddypress/bp-core/js/update.dev.js b/wp-content/plugins/buddypress/bp-core/js/update.dev.js
new file mode 100644
index 0000000000000000000000000000000000000000..9d87b47d1619ab8fa26c43c3bb8276df231c0ac6
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-core/js/update.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/js/update.js b/wp-content/plugins/buddypress/bp-core/js/update.js
new file mode 100644
index 0000000000000000000000000000000000000000..e6a007f4b99e005e591eb33612122294be2fb575
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-core/js/update.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/js/widget-members.dev.js b/wp-content/plugins/buddypress/bp-core/js/widget-members.dev.js
new file mode 100644
index 0000000000000000000000000000000000000000..fdd8925f7febca8436b3c4ca481eb2a329d1a5cc
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-core/js/widget-members.dev.js
@@ -0,0 +1,49 @@
+jQuery(document).ready( function() {
+	jQuery(".widget div#members-list-options a").live('click',
+		function() {
+			var link = this;
+			jQuery(link).addClass('loading');
+
+			jQuery(".widget div#members-list-options a").removeClass("selected");
+			jQuery(this).addClass('selected');
+
+			jQuery.post( ajaxurl, {
+				action: 'widget_members',
+				'cookie': encodeURIComponent(document.cookie),
+				'_wpnonce': jQuery("input#_wpnonce-members").val(),
+				'max-members': jQuery("input#members_widget_max").val(),
+				'filter': jQuery(this).attr('id')
+			},
+			function(response)
+			{
+				jQuery(link).removeClass('loading');
+				member_wiget_response(response);
+			});
+
+			return false;
+		}
+	);
+});
+
+function member_wiget_response(response) {
+	response = response.substr(0, response.length-1);
+	response = response.split('[[SPLIT]]');
+
+	if ( response[0] != "-1" ) {
+		jQuery(".widget ul#members-list").fadeOut(200,
+			function() {
+				jQuery(".widget ul#members-list").html(response[1]);
+				jQuery(".widget ul#members-list").fadeIn(200);
+			}
+		);
+
+	} else {
+		jQuery(".widget ul#members-list").fadeOut(200,
+			function() {
+				var message = '<p>' + response[1] + '</p>';
+				jQuery(".widget ul#members-list").html(message);
+				jQuery(".widget ul#members-list").fadeIn(200);
+			}
+		);
+	}
+}
\ No newline at end of file
diff --git a/wp-content/plugins/buddypress/bp-core/js/widget-members.js b/wp-content/plugins/buddypress/bp-core/js/widget-members.js
index e3eb5d75e3ad0ef3e2d57c811ecb4adddff7623f..cf2c8d29b8229f67ca2a58026f281e8bd573cf06 100644
--- a/wp-content/plugins/buddypress/bp-core/js/widget-members.js
+++ b/wp-content/plugins/buddypress/bp-core/js/widget-members.js
@@ -1,48 +1 @@
-jQuery(document).ready( function() {
-	jQuery(".widget div#members-list-options a").live('click',
-		function() {
-			jQuery('#ajax-loader-members').toggle();
-
-			jQuery(".widget div#members-list-options a").removeClass("selected");
-			jQuery(this).addClass('selected');
-
-			jQuery.post( ajaxurl, {
-				action: 'widget_members',
-				'cookie': encodeURIComponent(document.cookie),
-				'_wpnonce': jQuery("input#_wpnonce-members").val(),
-				'max-members': jQuery("input#members_widget_max").val(),
-				'filter': jQuery(this).attr('id')
-			},
-			function(response)
-			{
-				jQuery('#ajax-loader-members').toggle();
-				member_wiget_response(response);
-			});
-
-			return false;
-		}
-	);
-});
-
-function member_wiget_response(response) {
-	response = response.substr(0, response.length-1);
-	response = response.split('[[SPLIT]]');
-
-	if ( response[0] != "-1" ) {
-		jQuery(".widget ul#members-list").fadeOut(200,
-			function() {
-				jQuery(".widget ul#members-list").html(response[1]);
-				jQuery(".widget ul#members-list").fadeIn(200);
-			}
-		);
-
-	} else {
-		jQuery(".widget ul#members-list").fadeOut(200,
-			function() {
-				var message = '<p>' + response[1] + '</p>';
-				jQuery(".widget ul#members-list").html(message);
-				jQuery(".widget ul#members-list").fadeIn(200);
-			}
-		);
-	}
-}
\ No newline at end of file
+jQuery(document).ready(function(){jQuery(".widget div#members-list-options a").live("click",function(){var a=this;jQuery(a).addClass("loading");jQuery(".widget div#members-list-options a").removeClass("selected");jQuery(this).addClass("selected");jQuery.post(ajaxurl,{action:"widget_members",cookie:encodeURIComponent(document.cookie),_wpnonce:jQuery("input#_wpnonce-members").val(),"max-members":jQuery("input#members_widget_max").val(),filter:jQuery(this).attr("id")},function(b){jQuery(a).removeClass("loading");member_wiget_response(b)});return false})});function member_wiget_response(a){a=a.substr(0,a.length-1);a=a.split("[[SPLIT]]");if(a[0]!="-1"){jQuery(".widget ul#members-list").fadeOut(200,function(){jQuery(".widget ul#members-list").html(a[1]);jQuery(".widget ul#members-list").fadeIn(200)})}else{jQuery(".widget ul#members-list").fadeOut(200,function(){var b="<p>"+a[1]+"</p>";jQuery(".widget ul#members-list").html(b);jQuery(".widget ul#members-list").fadeIn(200)})}};
\ No newline at end of file
diff --git a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-admin/admin-ajax.php b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-admin/admin-ajax.php
index 0a141ca2a4a77c3cba1ee00a50990142f2922d49..efdf66946140f5b2c3fdde1d66821b8a8259966b 100644
--- a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-admin/admin-ajax.php
+++ b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-admin/admin-ajax.php
@@ -48,12 +48,13 @@ case 'add-tag' : // $id is topic_id
 				continue;
 			}
 		}
+		$tag->tag_id  = $tag_id;
 		$tag->user_id = bb_get_current_user_info( 'id' );
-		$tag_id_val = $tag->tag_id . '_' . $tag->user_id;
-		$tag->raw_tag = esc_attr( $tag->raw_tag );
+		$tag_id_val   = $tag->tag_id . '_' . $tag->user_id;
+		$tag->raw_tag = esc_attr( $tag_name );
 		$x->add( array(
 			'what' => 'tag',
-			'id' => $tag_id_val,
+			'id'   => $tag_id_val,
 			'data' => _bb_list_tag_item( $tag, array( 'list_id' => 'tags-list', 'format' => 'list' ) )
 		) );
 	}
@@ -118,8 +119,28 @@ case 'delete-post' : // $id is post_id
 	if ( $status == $bb_post->post_status )
 		die('1'); // We're already there
 
-	if ( bb_delete_post( $id, $status ) )
+	if ( bb_delete_post( $id, $status ) ) {
+		$topic = get_topic( $bb_post->topic_id );
+		if ( 0 == $topic->topic_posts ) {
+			// If we deleted the only post, send back a WP_Ajax_Response object with a URL to redirect to
+			if ( $ref = wp_get_referer() ) {
+				$ref_topic = bb_get_topic_from_uri( $ref );
+				if ( $ref_topic && $ref_topic->topic_id == $topic->topic_id )
+					$ref = add_query_arg( 'view', 'all', $ref );
+				if ( false === strpos( $ref, '#' ) )
+					$ref .= "#post-{$bb_post->post_id}";
+			} else {
+				$ref = add_query_arg( 'view', 'all', get_post_link( $topic->topic_id ) );
+			}
+			$x = new WP_Ajax_Response( array(
+				'what' => 'post',
+				'id' => $bb_post->post_id,
+				'data' => $ref,
+			) );
+			$x->send();
+		}
 		die('1');
+	}
 	break;
 /*
 case 'add-post' : // Can put last_modified stuff back in later
diff --git a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-admin/admin-header.php b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-admin/admin-header.php
index 1b69231d97f4aa6c2750cca4dc8a512aa38eb156..8fb5e5ba9ea44042349d5d4a7003ea68347f1783 100644
--- a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-admin/admin-header.php
+++ b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-admin/admin-header.php
@@ -8,6 +8,12 @@
 <?php if ( 'rtl' == bb_get_option( 'text_direction' ) ) : ?>
 	<link rel="stylesheet" href="<?php bb_uri('bb-admin/style-rtl.css', null, BB_URI_CONTEXT_LINK_STYLESHEET_HREF + BB_URI_CONTEXT_BB_ADMIN); ?>" type="text/css" />
 <?php endif; do_action('bb_admin_print_scripts'); ?>
+	<!--[if IE 6]>
+	<style type="text/css">
+	ul#bbAdminMenu{ margin: 15px 5px 15px -85px; } body.bb-menu-folded div#bbBody{ margin-left: 110px; }
+	</style>
+	<![endif]-->
+	<link rel="shortcut icon" type="image/ico" href="<?php bb_uri('bb-admin/images/favicon.ico', null, BB_URI_CONTEXT_BB_ADMIN); ?>" />
 	<script type="text/javascript">
 		//<![CDATA[
 		addLoadEvent = function(func){if(typeof jQuery!="undefined")jQuery(document).ready(func);else if(typeof wpOnload!='function'){wpOnload=func;}else{var oldonload=wpOnload;wpOnload=function(){oldonload();func();}}};
diff --git a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-admin/delete-post.php b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-admin/delete-post.php
index f18b546f12323d4fe56d95af20397c51c0fd9b4b..5c8e0b8380983bc353898fa57505d17106bfe28b 100644
--- a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-admin/delete-post.php
+++ b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-admin/delete-post.php
@@ -67,7 +67,10 @@ $topic = get_topic( $bb_post->topic_id );
 if ( $sendto = wp_get_referer() ) {
 	$sendto = remove_query_arg( 'message', $sendto );
 	$sendto = add_query_arg( 'message', $message, $sendto );
-} elseif ( $topic->topic_posts == 0 ) {
+	$send_to_topic = bb_get_topic_from_uri( $sendto );
+	if ( $send_to_topic && $topic->topic_id == $send_to_topic->topic_id )
+		$sendto = add_query_arg( 'view', 'all', $sendto );
+} else if ( $topic->topic_posts == 0 ) {
 	$sendto = get_forum_link( $topic->forum_id );
 } else {
 	$the_page = bb_get_page_number( $bb_post->post_position );
diff --git a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-admin/export.php b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-admin/export.php
index 3750d766976bc77a83fb6a2df5926536908e479d..49a3f03e2a0967aed7d84953f1e3417ecad9d3bd 100644
--- a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-admin/export.php
+++ b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-admin/export.php
@@ -243,7 +243,7 @@ function bb_export_topic_posts( $r, $topic_id ) {
 	$r .= "\n";
 
 	$page = 1;
-	while ( $posts = get_thread( $topic_id, $page++ ) ) {
+	while ( $posts = get_thread( $topic_id, array( 'post_status' => 'all', 'page' => $page++ ) ) ) {
 		foreach ( $posts as $post )
 			$r .= bb_export_post( $post->post_id );
 	}
@@ -297,7 +297,6 @@ add_filter( 'in_bb_export_object_topic', 'bb_export_topic_posts', 10, 2 );
 add_filter( 'get_forum_where', 'bb_no_where', 9999 );
 add_filter( 'get_forums_where', 'bb_no_where', 9999 );
 add_filter( 'get_latest_topics_where', 'bb_no_where', 9999 );
-add_filter( 'get_thread_where', 'bb_no_where', 9999 );
 add_filter( 'get_user_where', 'bb_no_where', 9999 );
 add_filter( 'cache_users_where', 'bb_no_where', 9999 );
 
diff --git a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-admin/images/favicon.ico b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-admin/images/favicon.ico
new file mode 100644
index 0000000000000000000000000000000000000000..6002cfa0c78dd5a6bb1f8d1a366a0b1b3061cf80
Binary files /dev/null and b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-admin/images/favicon.ico differ
diff --git a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-admin/includes/class.bb-install.php b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-admin/includes/class.bb-install.php
index 6e8e00cd9f0fc74f9bc30b70837feb12bd0cf7a5..2393a2ae408235a0b76a33f6519d1327baa4502e 100644
--- a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-admin/includes/class.bb-install.php
+++ b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-admin/includes/class.bb-install.php
@@ -899,7 +899,7 @@ class BB_Install
 					'uri' => array(
 						'value' => $this->guess_uri(),
 						'label' => __( 'Site address (URL)' ),
-						'note'  => __( 'We have attempted to guess this, it\'s usually correct, but change it here if you wish.' )
+						'note'  => __( 'We have attempted to guess this; it\'s usually correct, but change it here if you wish.' )
 					),
 					'keymaster_user_login' => array(
 						'value'     => '',
@@ -2144,14 +2144,14 @@ class BB_Install
 
 		if ( defined( 'BB_PLUGIN_DIR' ) && BB_PLUGIN_DIR && !file_exists( BB_PLUGIN_DIR ) ) {
 			// Just suppress errors as this is not critical
-			if ( @mkdir( BB_PLUGIN_DIR, 0750 ) ) {
+			if ( @mkdir( BB_PLUGIN_DIR, 0755 ) ) {
 				$installation_log[] = '>>> ' . sprintf( __( 'Making plugin directory at %s.' ),  BB_PLUGIN_DIR );
 			}
 		}
 
 		if ( defined( 'BB_THEME_DIR' ) && BB_THEME_DIR && !file_exists( BB_THEME_DIR ) ) {
 			// Just suppress errors as this is not critical
-			if ( @mkdir( BB_THEME_DIR, 0750 ) ) {
+			if ( @mkdir( BB_THEME_DIR, 0755 ) ) {
 				$installation_log[] = '>>> ' . sprintf( __( 'Making theme directory at %s.' ),  BB_THEME_DIR );
 			}
 		}
diff --git a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-admin/includes/defaults.bb-schema.php b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-admin/includes/defaults.bb-schema.php
index 9fbaf1e3c8d2891d6644b7e3e08266a293be35db..2e9d26fa5dc5390f0606b921ecd4e9e2f5ca5f11 100644
--- a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-admin/includes/defaults.bb-schema.php
+++ b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-admin/includes/defaults.bb-schema.php
@@ -52,7 +52,7 @@ $bb_queries['posts'] = "CREATE TABLE IF NOT EXISTS `$bbdb->posts` (
 	KEY `poster_time` (`poster_id`, `post_time`),
 	KEY `post_time` (`post_time`),
 	FULLTEXT KEY `post_text` (`post_text`)
-) TYPE = MYISAM;";
+) ENGINE = MYISAM;";
 
 // terms
 $bb_queries['terms'] = "CREATE TABLE IF NOT EXISTS `$bbdb->terms` (
diff --git a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-admin/includes/functions.bb-admin.php b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-admin/includes/functions.bb-admin.php
index b94c73bbd12796f702f31a817f65b06326edaaab..e3594f95dcaf6c83531d0c134f1d2025a820dc22 100644
--- a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-admin/includes/functions.bb-admin.php
+++ b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-admin/includes/functions.bb-admin.php
@@ -82,6 +82,7 @@ function bb_admin_menu_generator()
 		$bb_submenu['plugins.php'][5]  = array( __( 'Installed' ), 'manage_plugins', 'plugins.php' );
 	$bb_menu[310] = array( __( 'Users' ), 'moderate', 'users.php', '', 'bb-menu-users' );
 		$bb_submenu['users.php'][5]  = array( __( 'Users' ), 'moderate', 'users.php' );
+		$bb_submenu['users.php'][10]  = array( __( 'Add New' ), 'manage_options', 'user-add-new.php' );
 	$bb_menu[315] = array( __( 'Tools' ), 'recount', 'tools-recount.php', '', 'bb-menu-tools' );
 		$bb_submenu['tools-recount.php'][5] = array( __( 'Re-count' ), 'recount', 'tools-recount.php' );
 	$bb_menu[320] = array( __( 'Settings' ), 'manage_options', 'options-general.php', '', 'bb-menu-settings' );
@@ -289,6 +290,9 @@ function bb_admin_menu()
 			$sr .= "\t\t\t\t\t\t" . '<ul>' . "\n";
 			$sc = 0;
 			foreach ( $bb_submenu[$m[2]] as $skey => $sm ) {
+				if ( !bb_current_user_can( $sm[1] ) ) {
+					continue;
+				}
 				if ( $sc === 0 && $sm[2] === $m[2] ) {
 					$no_submenu = true;
 				}
@@ -374,6 +378,263 @@ function bb_get_recently_moderated_objects( $num = 5 ) {
 
 /* Users */
 
+function bb_manage_user_fields( $edit_user = '' ) {
+	global $wp_roles, $wp_users_object, $bbdb;
+
+	// Cap checks
+	$user_roles    = $wp_roles->role_names;
+	$can_keep_gate = bb_current_user_can( 'keep_gate' );
+
+	if ( 'post' == strtolower( $_SERVER['REQUEST_METHOD'] ) ) {
+
+		bb_check_admin_referer( 'user-manage' );
+
+		// Instantiate required vars
+		$_POST                   = stripslashes_deep( $_POST );
+		$create_user_errors      = new WP_Error;
+
+		// User login
+		$trimmed_user_login      = str_replace( ' ', '', $_POST['user_login'] );
+		$user_login              = sanitize_user( $_POST['user_login'], true );
+		$user_meta['first_name'] = $_POST['first_name'];
+		$user_meta['last_name']  = $_POST['last_name'];
+		$user_display_name       = $_POST['display_name'];
+		$user_email              = $_POST['user_email'];
+		$user_url                = $_POST['user_url'];
+		$user_meta['from']       = $_POST['from'];
+		$user_meta['occ']        = $_POST['occ'];
+		$user_meta['interest']   = $_POST['interest'];
+		$user_role               = $_POST['userrole'];
+		$user_meta['throttle']   = $_POST['throttle'];
+		$user_pass1              = $_POST['pass1'];
+		$user_pass2              = $_POST['pass2'];
+		$user_status             = 0;
+		$user_pass               = false;
+		$user_url                = $user_url ? bb_fix_link( $user_url ) : '';
+
+		// Check user_login
+		if ( !isset( $_GET['action'] ) && empty( $user_login ) ) {
+			$create_user_errors->add( 'user_login', __( 'Username is a required field.' ) );
+		} else {
+			if ( $user_login !== $trimmed_user_login ) {
+				$create_user_errors->add( 'user_login', sprintf( __( '%s is an invalid username. How\'s this one?' ), esc_html( $_POST['user_login'] ) ) );
+				$user_login = $trimmed_user_login;
+			}
+		}
+
+		// Check email
+		if ( isset( $user_email ) && empty( $user_email ) )
+			$create_user_errors->add( 'user_email', __( 'Email address is a required field.' ) );
+
+		// Password Sanity Check
+		if ( ( !empty( $user_pass1 ) || !empty( $user_pass2 ) ) && $user_pass1 !== $user_pass2 )
+			$create_user_errors->add( 'pass', __( 'You must enter the same password twice.' ) );
+		elseif ( !isset( $_GET['action'] ) && ( empty( $user_pass1 ) && empty( $user_pass2 ) ) )
+			$create_user_errors->add( 'pass', __( 'You must enter a password.' ) );
+		elseif ( isset( $_GET['action'] ) && ( empty( $user_pass1 ) && empty( $user_pass2 ) ) )
+			$user_pass = '';
+		else
+			$user_pass = $user_pass1;
+
+		// No errors
+		if ( !$create_user_errors->get_error_messages() ) {
+
+			// Create or udpate
+			switch ( $_POST['action'] ) {
+				case 'create' :
+					$goback = bb_get_uri( 'bb-admin/users.php', array( 'created' => 'true' ), BB_URI_CONTEXT_FORM_ACTION + BB_URI_CONTEXT_BB_ADMIN );
+					$user   = $wp_users_object->new_user( compact( 'user_login', 'user_email', 'user_url', 'user_nicename', 'user_status', 'user_pass' ) );
+
+					// Error handler
+					if ( is_wp_error( $user ) ) {
+						bb_admin_notice( $user );
+						unset( $goback );
+
+					// Update additional user data
+					} else {
+						// Update caps
+						bb_update_usermeta( $user['ID'], $bbdb->prefix . 'capabilities', array( $user_role => true ) );
+
+						// Update all user meta
+						foreach ( $user_meta as $key => $value )
+							bb_update_usermeta( $user['ID'], $key, $value );
+
+						// Don't send email if empty
+						if ( !empty( $user_pass ) )
+							bb_send_pass( $user['ID'], $user_pass );
+
+						do_action( 'bb_new_user',    $user['ID'], $user_pass );
+					}
+
+					break;
+
+				case 'update' :
+					$goback = bb_get_uri( 'bb-admin/users.php', array( 'updated' => 'true' ), BB_URI_CONTEXT_FORM_ACTION + BB_URI_CONTEXT_BB_ADMIN );
+					$user   = $wp_users_object->get_user( $_GET['user_id'], array( 'output' => ARRAY_A ) );
+					bb_update_user( $user['ID'], $user_email, $user_url, $user_display_name );
+
+					// Don't change PW if empty
+					if ( !empty( $user_pass ) )
+						bb_update_user_password( $user['ID'], $user_pass );
+
+					// Error handler
+					if ( is_wp_error( $user ) ) {
+						bb_admin_notice( $user );
+						unset( $goback );
+
+					// Update additional user data
+					} else {
+						// Update caps
+						bb_update_usermeta( $user['ID'], $bbdb->prefix . 'capabilities', array( $user_role => true ) );
+
+						// Update all user meta
+						foreach ( $user_meta as $key => $value )
+							bb_update_usermeta( $user['ID'], $key, $value );
+
+						// Don't send email if empty
+						if ( !empty( $user_pass ) )
+							bb_send_pass( $user['ID'], $user_pass );
+
+						do_action( 'bb_update_user', $user['ID'], $user_pass );
+					}
+
+					break;
+			}
+
+			// Redirect
+			if ( isset( $goback ) && !empty( $goback ) )
+				bb_safe_redirect( $goback );
+
+		// Error handler
+		} else {
+			bb_admin_notice( $create_user_errors );
+		}
+	} elseif ( isset( $_GET['action'] ) && $_GET['action'] == 'edit' ) {
+		if ( isset( $_GET['user_id'] ) && is_numeric( $_GET['user_id'] ) ) {
+			$disabled = true;
+
+			// Get the user
+			if ( empty( $edit_user ) )
+				$edit_user = bb_get_user( bb_get_user_id( $_GET['user_id'] ) );
+
+			// Instantiate required vars
+			$user_login              = $edit_user->user_login;
+			$user_meta['first_name'] = $edit_user->first_name;
+			$user_meta['last_name']  = $edit_user->last_name;
+			$user_display_name       = $edit_user->display_name;
+			$user_email              = $edit_user->user_email;
+			$user_url                = $edit_user->user_url;
+			$user_meta['from']       = $edit_user->from;
+			$user_meta['occ']        = $edit_user->occ;
+			$user_meta['interest']   = $edit_user->interest;
+			$user_role               = array_search( 'true', $edit_user->capabilities );
+			$user_meta['throttle']   = $edit_user->throttle;
+
+			// Keymasters can't demote themselves
+			if ( ( $edit_user->ID == bb_get_current_user_info( 'id' ) && $can_keep_gate ) || ( isset( $edit_user->capabilities ) && is_array( $edit_user->capabilities ) && array_key_exists( 'keymaster', $edit_user->capabilities ) && !$can_keep_gate ) )
+				$user_roles = array( 'keymaster' => $user_roles['keymaster'] );
+
+			// only keymasters can promote others to keymaster status
+			elseif ( !$can_keep_gate )
+				unset( $user_roles['keymaster'] );
+		}
+	}
+
+	// Load password strength checker
+	wp_enqueue_script( 'password-strength-meter' );
+	wp_enqueue_script( 'profile-edit' );
+
+	// Generate a few PW hints
+	$some_pass_hints = '';
+	for ( $l = 3; $l != 0; $l-- )
+		$some_pass_hints .= '<p>' . bb_generate_password() . '</p>';
+
+	// Create  the user fields
+	$user_fields = array(
+		'user_login' => array(
+			'title'    => __( 'Username' ),
+			'note'     => __( 'Required! Unique identifier for new user.' ),
+			'value'    => $user_login,
+			'disabled' => $disabled
+		),
+		'first_name' => array(
+			'title'    => __( 'First Name' ),
+			'value'    => $user_meta['first_name']
+		),
+		'last_name' => array(
+			'title'    => __( 'Last Name' ),
+			'value'    => $user_meta['last_name']
+		),
+		'display_name' => array(
+			'title'    => __( 'Display Name' ),
+			'value'    => $user_display_name
+		),
+		'user_email' => array(
+			'title'    => __( 'Email' ),
+			'note'     => __( 'Required! Will be used for notifications and profile settings changes.' ),
+			'value'    => $user_email
+		),
+		'user_url' => array(
+			'title'    => __( 'Website' ),
+			'class'    => array( 'long', 'code' ),
+			'note'     => __( 'The full URL of user\'s homepage or blog.' ),
+			'value'    => $user_url
+		),
+		'from' => array(
+			'title'    => __( 'Location' ),
+			'class'    => array( 'long' ),
+			'value'    => $user_meta['from']
+		),
+		'occ' => array(
+			'title'    => __( 'Occupation' ),
+			'class'    => array( 'long' ),
+			'value'    => $user_meta['occ']
+		),
+		'interest' => array(
+			'title'    => __( 'Interests' ),
+			'class'    => array( 'long' ),
+			'value'    => $user_meta['interest']
+		),
+		'userrole' => array(
+			'title'    => __( 'User Role' ),
+			'type'     => 'select',
+			'options'  => $user_roles,
+			'note'     => __( 'Allow user the above privileges.' ),
+			'value'    => $user_role,
+		),
+		'pass1' => array(
+			'title'    => __( 'New Password' ),
+			'type'     => 'password',
+			'class'    => array( 'short', 'text', 'code' ),
+			'note'     => __( 'Hints: ' ) . $some_pass_hints,
+			'value'    => $user_pass1,
+		),
+		'pass2' => array(
+			'title'    => __( 'Repeat New Password' ),
+			'type'     => 'password',
+			'class'    => array( 'short', 'text', 'code' ),
+			'note'     => __( 'If you ignore hints, remember: the password should be at least seven characters long. To make it stronger, use upper and lower case letters, numbers and symbols like ! " ? $ % ^ &amp; ).' ),
+			'value'    => $user_pass2,
+		),
+		'email_pass' => array(
+			'title'    => '',
+			'type'     => 'checkbox',
+			'options'  => array(
+				'1' => array(
+					'label'      => __( 'Email the new password.' ),
+					'attributes' => array( 'checked' => true )
+				)
+			),
+		),
+		'pass-strength-fake-input' => array(
+			'title' => __( 'Password Strength' ),
+			'type'  => 'hidden',
+		),
+	);
+
+	return apply_filters( 'bb_manage_user_fields', $user_fields );
+}
+
 // Not bbdb::prepared
 function bb_get_ids_by_role( $role = 'moderator', $sort = 0, $page = 1, $limit = 50 ) {
 	global $bbdb, $bb_last_countable_query;
@@ -415,7 +676,7 @@ function bb_user_row( $user, $role = '', $email = false ) {
 	$actions = "<a href='" . esc_attr( get_user_profile_link( $user->ID ) ) . "'>" . __('View') . "</a>";
 	$title = '';
 	if ( bb_current_user_can( 'edit_user', $user_id ) ) {
-		$actions .= " | <a href='" . esc_attr( get_profile_tab_link( $user->ID, 'edit' ) ) . "'>" . __('Edit') . "</a>";
+		$actions .= " | <a href='" . esc_attr( bb_get_user_admin_link( $user->ID ) ) . "'>" . __('Edit') . "</a>";
 		$title = " title='" . esc_attr( sprintf( __( 'User ID: %d' ), $user->ID ) ) . "'";
 	}
 	$r  = "\t<tr id='user-$user->ID'" . get_alt_class("user-$role") . ">\n";
@@ -603,7 +864,7 @@ class BB_User_Search {
 			$r .= "<div>\n";
 			$r .= "\t\t<label for='userrole'>" . __('Role') . "</label>";
 			$r .= "\t\t<div><select name='userrole[]' id='userrole'>\n";
-			$r .= "\t\t\t<option value=''>All</option>\n";
+			$r .= "\t\t\t<option value=''>" . _x( 'All', 'user roles' ) . "</option>\n";
 			
 			foreach ( $roles as $role => $display ) {
 				$selected = '';
@@ -707,7 +968,6 @@ class BB_Users_By_Role extends BB_User_Search {
 		if ( is_wp_error( $this->search_errors ) )
 			bb_admin_notice( $this->search_errors );
 	}
-
 }
 
 /* Forums */
@@ -909,7 +1169,7 @@ function bb_forum_form( $forum_id = 0 ) {
 
 	if ( $forum_id ) {
 		$forum_name = get_forum_name( $forum_id );
-		$forum_slug = $forum->forum_slug;
+	    	$forum_slug = apply_filters('editable_slug', $forum->forum_slug); 
 		$forum_description = get_forum_description( $forum_id );
 		$forum_position = get_forum_position( $forum_id );
 		$legend = __( 'Edit Forum' );
@@ -979,14 +1239,15 @@ foreach ( $forum_options as $option => $args ) {
 	bb_option_form_element( $option, $args );
 }
 ?>
-	<fieldset class="submit">
+		<fieldset class="submit">
 <?php if ( $forum_id ) : ?>
-		<input type="hidden" name="forum_id" value="<?php echo $forum_id; ?>" />
+			<input type="hidden" name="forum_id" value="<?php echo $forum_id; ?>" />
 <?php endif; ?>
-		<?php bb_nonce_field( 'order-forums', 'order-nonce' ); ?>
-		<?php bb_nonce_field( $action . '-forum' ); ?>
-		<input type="hidden" name="action" value="<?php echo $action; ?>" />
-		<input class="submit" type="submit" name="submit" value="<?php echo $submit; ?>" />
+			<?php bb_nonce_field( 'order-forums', 'order-nonce' ); ?>
+			<?php bb_nonce_field( $action . '-forum' ); ?>
+			<input type="hidden" name="action" value="<?php echo $action; ?>" />
+			<input class="submit" type="submit" name="submit" value="<?php echo $submit; ?>" />
+		</fieldset>
 	</fieldset>
 </form>
 <?php
@@ -1078,6 +1339,7 @@ function bb_admin_list_posts() {
 <table id="posts-list" class="widefat" cellspacing="0" cellpadding="0">
 <thead>
 	<tr>
+		<th scope="col" class="check-column"><input type="checkbox" /></th>
 		<th scope="col"><?php _e( 'Post' ); ?></th>
 		<th scope="col"><?php _e( 'Author' ); ?></th>
 		<th scope="col"><?php _e( 'Topic' ); ?></th>
@@ -1086,6 +1348,7 @@ function bb_admin_list_posts() {
 </thead>
 <tfoot>
 	<tr>
+		<th scope="col" class="check-column"><input type="checkbox" /></th>
 		<th scope="col"><?php _e( 'Post' ); ?></th>
 		<th scope="col"><?php _e( 'Author' ); ?></th>
 		<th scope="col"><?php _e( 'Topic' ); ?></th>
@@ -1097,6 +1360,7 @@ function bb_admin_list_posts() {
 		foreach ( $bb_posts as $bb_post ) {
 ?>
 	<tr id="post-<?php post_id(); ?>"<?php alt_class('post', post_del_class()); ?>>
+		<td class="check-column"><input type="checkbox" name="post[]" value="<?php post_id(); ?>" /></td>
 		<td class="post">
 			<?php post_text(); ?>
 			<div>
@@ -1120,10 +1384,21 @@ function bb_admin_list_posts() {
 		</td>
 
 		<td class="author">
-			<a href="<?php user_profile_link( get_post_author_id() ); ?>">
-				<?php post_author_avatar( '16' ); ?>
-				<?php post_author(); ?>
-			</a>
+			<?php if ( get_post_author_id() ) : ?>
+
+				<a href="<?php user_profile_link( get_post_author_id() ); ?>">
+					<?php post_author_avatar( '16' ); ?>
+					<?php post_author(); ?>
+				</a>
+
+			<?php else : ?>
+
+				<span>
+					<?php post_author_avatar( '16' ); ?>
+					<?php post_author(); ?>
+				</span>
+
+			<?php endif; ?>
 		</td>
 
 		<td class="topic">
@@ -1307,6 +1582,7 @@ function bb_option_form_element( $name = 'name', $args = null ) {
 		'after' => '',
 		'note' => false,
 		'attributes' => false,
+		'disabled' => false,
 	);
 
 	$args = wp_parse_args( $args, $defaults );
@@ -1324,7 +1600,11 @@ function bb_option_form_element( $name = 'name', $args = null ) {
 
 	$class = $args['class'] ? (array) $args['class'] : array();
 	array_unshift( $class, $args['type'] );
-	$disabled = $hardcoded ? ' disabled="disabled"' : '';
+
+	if ( $hardcoded || $args['disabled'] )
+		$disabled = ' disabled="disabled"';
+	else
+		$disabled = false;
 
 	if ( $args['attributes'] ) {
 		$attributes = array();
@@ -1337,7 +1617,7 @@ function bb_option_form_element( $name = 'name', $args = null ) {
 
 ?>
 
-		<div id="option-<?php echo $id; ?>"<?php if ( $hardcoded ) echo ' class="disabled"'; ?>>
+		<div id="option-<?php echo $id; ?>"<?php if ( !empty( $disabled ) ) echo ' class="disabled"'; ?>>
 <?php
 			switch ( $args['type'] ) {
 				case 'radio' :
diff --git a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-admin/includes/functions.bb-plugin.php b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-admin/includes/functions.bb-plugin.php
index d99c5c2e00b84c08e9ea50ee47e5559715bfae3b..1099b1362ab5171cc649e35bdfe78d8d7c81e1aa 100644
--- a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-admin/includes/functions.bb-plugin.php
+++ b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-admin/includes/functions.bb-plugin.php
@@ -295,7 +295,7 @@ function bb_get_plugin_data( $plugin_file, $markup = true, $translate = true ) {
 	$plugin_data = compact( array_keys( $fields ) );
 
 	if ( $translate )
-		$plugin_data = _bb_get_plugin_data_translate( $plugin_data );
+		$plugin_data = _bb_get_plugin_data_translate( $plugin_data, $plugin_file );
 
 	if ( $markup )
 		$plugin_data['description'] = bb_autop( preg_replace( '/[\r\n]+/', "\n", trim( $plugin_data['description'] ) ) );
@@ -310,7 +310,7 @@ function bb_get_plugin_data( $plugin_file, $markup = true, $translate = true ) {
 	return $plugin_data;
 }
 
-function _bb_get_plugin_data_translate( $plugin_data ) {
+function _bb_get_plugin_data_translate( $plugin_data, $plugin_file ) {
 	//Translate fields
 	if( !empty($plugin_data['text_domain']) ) {
 		if( ! empty( $plugin_data['domain_path'] ) )
diff --git a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-admin/includes/functions.bb-recount.php b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-admin/includes/functions.bb-recount.php
index 744bafc9fb1ee91fbd627af7af8f95839896fd4d..720e9cacb150e147544c9b6d420a875bd3344235 100644
--- a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-admin/includes/functions.bb-recount.php
+++ b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-admin/includes/functions.bb-recount.php
@@ -9,11 +9,11 @@ function bb_recount_topic_posts()
 
 	$sql = "INSERT INTO `$bbdb->topics` (`topic_id`, `topic_posts`) (SELECT `topic_id`, COUNT(`post_status`) as `topic_posts` FROM `$bbdb->posts` WHERE `post_status` = '0' GROUP BY `topic_id`) ON DUPLICATE KEY UPDATE `topic_posts` = VALUES(`topic_posts`);";
 	if ( is_wp_error( $bbdb->query( $sql ) ) ) {
-		return sprintf( $statement, $result );
+		return array( 1, sprintf( $statement, $result ) );
 	}
 
 	$result = __( 'Complete!' );
-	return sprintf( $statement, $result );
+	return array( 0, sprintf( $statement, $result ) );
 }
 
 function bb_recount_topic_voices()
@@ -25,16 +25,16 @@ function bb_recount_topic_voices()
 
 	$sql_delete = "DELETE FROM `$bbdb->meta` WHERE `object_type` = 'bb_topic' AND `meta_key` = 'voices_count';";
 	if ( is_wp_error( $bbdb->query( $sql_delete ) ) ) {
-		return sprintf( $statement, $result );
+		return array( 1, sprintf( $statement, $result ) );
 	}
 
 	$sql = "INSERT INTO `$bbdb->meta` (`object_type`, `object_id`, `meta_key`, `meta_value`) (SELECT 'bb_topic', `topic_id`, 'voices_count', COUNT(DISTINCT `poster_id`) as `meta_value` FROM `$bbdb->posts` WHERE `post_status` = '0' GROUP BY `topic_id`);";
 	if ( is_wp_error( $bbdb->query( $sql ) ) ) {
-		return sprintf( $statement, $result );
+		return array( 2, sprintf( $statement, $result ) );
 	}
 
 	$result = __( 'Complete!' );
-	return sprintf( $statement, $result );
+	return array( 0, sprintf( $statement, $result ) );
 }
 
 function bb_recount_topic_deleted_posts()
@@ -46,16 +46,16 @@ function bb_recount_topic_deleted_posts()
 
 	$sql_delete = "DELETE FROM `$bbdb->meta` WHERE `object_type` = 'bb_topic' AND `meta_key` = 'deleted_posts';";
 	if ( is_wp_error( $bbdb->query( $sql_delete ) ) ) {
-		return sprintf( $statement, $result );
+		return array( 1, sprintf( $statement, $result ) );
 	}
 
 	$sql = "INSERT INTO `$bbdb->meta` (`object_type`, `object_id`, `meta_key`, `meta_value`) (SELECT 'bb_topic', `topic_id`, 'deleted_posts', COUNT(`post_status`) as `meta_value` FROM `$bbdb->posts` WHERE `post_status` != '0' GROUP BY `topic_id`);";
 	if ( is_wp_error( $bbdb->query( $sql ) ) ) {
-		return sprintf( $statement, $result );
+		return array( 2, sprintf( $statement, $result ) );
 	}
 
 	$result = __( 'Complete!' );
-	return sprintf( $statement, $result );
+	return array( 0, sprintf( $statement, $result ) );
 }
 
 function bb_recount_forum_topics()
@@ -67,11 +67,11 @@ function bb_recount_forum_topics()
 
 	$sql = "INSERT INTO `$bbdb->forums` (`forum_id`, `topics`) (SELECT `forum_id`, COUNT(`topic_status`) as `topics` FROM `$bbdb->topics` WHERE `topic_status` = '0' GROUP BY `forum_id`) ON DUPLICATE KEY UPDATE `topics` = VALUES(`topics`);";
 	if ( is_wp_error( $bbdb->query( $sql ) ) ) {
-		return sprintf( $statement, $result );
+		return array( 1, sprintf( $statement, $result ) );
 	}
 
 	$result = __( 'Complete!' );
-	return sprintf( $statement, $result );
+	return array( 0, sprintf( $statement, $result ) );
 }
 
 function bb_recount_forum_posts()
@@ -83,11 +83,11 @@ function bb_recount_forum_posts()
 
 	$sql = "INSERT INTO `$bbdb->forums` (`forum_id`, `posts`) (SELECT `forum_id`, COUNT(`post_status`) as `posts` FROM `$bbdb->posts` WHERE `post_status` = '0' GROUP BY `forum_id`) ON DUPLICATE KEY UPDATE `posts` = VALUES(`posts`);";
 	if ( is_wp_error( $bbdb->query( $sql ) ) ) {
-		return sprintf( $statement, $result );
+		return array( 1, sprintf( $statement, $result ) );
 	}
 
 	$result = __( 'Complete!' );
-	return sprintf( $statement, $result );
+	return array( 0, sprintf( $statement, $result ) );
 }
 
 function bb_recount_user_topics_replied()
@@ -101,7 +101,7 @@ function bb_recount_user_topics_replied()
 	$insert_rows = $bbdb->get_results( $sql_select );
 
 	if ( is_wp_error( $insert_rows ) ) {
-		return sprintf( $statement, $result );
+		return array( 1, sprintf( $statement, $result ) );
 	}
 
 	$meta_key = $bbdb->prefix . 'topics_replied';
@@ -112,12 +112,12 @@ function bb_recount_user_topics_replied()
 	}
 
 	if ( !count( $insert_values ) ) {
-		return sprintf( $statement, $result );
+		return array( 2, sprintf( $statement, $result ) );
 	}
 
 	$sql_delete = "DELETE FROM `$bbdb->usermeta` WHERE `meta_key` = '$meta_key';";
 	if ( is_wp_error( $bbdb->query( $sql_delete ) ) ) {
-		return sprintf( $statement, $result );
+		return array( 3, sprintf( $statement, $result ) );
 	}
 
 	$insert_values = array_chunk( $insert_values, 10000 );
@@ -126,84 +126,282 @@ function bb_recount_user_topics_replied()
 		$sql_insert = "INSERT INTO `$bbdb->usermeta` (`user_id`, `meta_key`, `meta_value`) VALUES $chunk;";
 
 		if ( is_wp_error( $bbdb->query( $sql_insert ) ) ) {
-			return sprintf( $statement, $result );
+			return array( 4, sprintf( $statement, $result ) );
 		}
 	}
 
 	$result = __( 'Complete!' );
-	return sprintf( $statement, $result );
+	return array( 0, sprintf( $statement, $result ) );
 }
 
-// TODO - make fast - see #1146
+// This function bypasses the taxonomy API
 function bb_recount_topic_tags()
 {
-	// Reset tag count to zero
-	$bbdb->query( "UPDATE $bbdb->topics SET tag_count = 0" );
+	global $bbdb;
+
+	$statement = __( 'Counting the number of topic tags in each topic&hellip; %s' );
+	$result = __( 'Failed!' );
+
+	// Delete empty tags
+	$delete = bb_recount_tag_delete_empty();
+	if ( $delete[0] > 0 ) {
+		$result = __( 'Could not delete empty tags.' );
+		return array( 1, sprintf( $statement, $result ) );
+	}
 
 	// Get all tags
-	$terms = $wp_taxonomy_object->get_terms( 'bb_topic_tag' );
-
-	if ( !is_wp_error( $terms ) && is_array( $terms ) ) {
-		$message = __('Counted topic tags');
-		foreach ( $terms as $term ) {
-			$topic_ids = bb_get_tagged_topic_ids( $term->term_id );
-			if ( !is_wp_error( $topic_ids ) && is_array( $topic_ids ) ) {
-				$bbdb->query(
-					"UPDATE $bbdb->topics SET tag_count = tag_count + 1 WHERE topic_id IN (" . join( ',', $topic_ids ) . ")"
-				);
-			}
-			unset( $topic_ids );
+	$sql_terms = "SELECT
+		`$bbdb->term_relationships`.`object_id`,
+		`$bbdb->term_taxonomy`.`term_id`
+	FROM `$bbdb->term_relationships`
+	JOIN `$bbdb->term_taxonomy`
+		ON `$bbdb->term_taxonomy`.`term_taxonomy_id` = `$bbdb->term_relationships`.`term_taxonomy_id`
+	WHERE
+		`$bbdb->term_taxonomy`.`taxonomy` = 'bb_topic_tag'
+	ORDER BY
+		`$bbdb->term_relationships`.`object_id`,
+		`$bbdb->term_taxonomy`.`term_id`;";
+
+	$terms = $bbdb->get_results( $sql_terms );
+	if ( is_wp_error( $terms ) || !is_array( $terms ) ) {
+		return array( 2, sprintf( $statement, $result ) );
+	}
+	if ( empty( $terms ) ) {
+		$result = __( 'No topic tags found.' );
+		return array( 3, sprintf( $statement, $result ) );
+	}
+
+	// Count the tags in each topic
+	$topics = array();
+	foreach ( $terms as $term ) {
+		if ( !isset( $topics[$term->object_id] ) ) {
+			$topics[$term->object_id] = 1;
+		} else {
+			$topics[$term->object_id]++;
+		}
+	}
+	if ( empty( $topics ) ) {
+		return array( 4, sprintf( $statement, $result ) );
+	}
+
+	// Build the values to insert into the SQL statement
+	$values = array();
+	foreach ($topics as $topic_id => $tag_count) {
+		$values[] = '(' . $topic_id . ', ' . $tag_count . ')';
+	}
+	if ( empty( $values ) ) {
+		return array( 5, sprintf( $statement, $result ) );
+	}
+
+	// Update the topics with the new tag counts
+	$values = array_chunk( $values, 10000 );
+	foreach ($values as $chunk) {
+		$sql = "INSERT INTO `$bbdb->topics` (`topic_id`, `tag_count`) VALUES " . implode(", ", $chunk) . " ON DUPLICATE KEY UPDATE `tag_count` = VALUES(`tag_count`);";
+		if ( is_wp_error( $bbdb->query( $sql ) ) ) {
+			return array( 6, sprintf( $statement, $result ) );
 		}
 	}
-	unset( $terms, $term );
 
-	return $message;
+	$result = __( 'Complete!' );
+	return array( 0, sprintf( $statement, $result ) );
 }
 
-// TODO - make fast - see #1146
+// This function bypasses the taxonomy API
 function bb_recount_tag_topics()
 {
-	// Get all tags
-	$terms = $wp_taxonomy_object->get_terms( 'bb_topic_tag', array( 'hide_empty' => false ) );
+	global $bbdb;
+
+	$statement = __( 'Counting the number of topics in each topic tag&hellip; %s' );
+	$result = __( 'Failed!' );
 
-	if ( !is_wp_error( $terms ) && is_array( $terms ) ) {
-		$message = __('Counted tagged topics');
-		$_terms = array();
-		foreach ( $terms as $term ) {
-			$_terms[] = $term->term_id;
+	// Delete empty tags
+	$delete = bb_recount_tag_delete_empty();
+	if ( $delete[0] > 0 ) {
+		$result = __( 'Could not delete empty tags.' );
+		return array( 1, sprintf( $statement, $result ) );
+	}
+
+	// Get all tags
+	$sql_terms = "SELECT
+		`$bbdb->term_taxonomy`.`term_taxonomy_id`,
+		`$bbdb->term_relationships`.`object_id`
+	FROM `$bbdb->term_relationships`
+	JOIN `$bbdb->term_taxonomy`
+		ON `$bbdb->term_taxonomy`.`term_taxonomy_id` = `$bbdb->term_relationships`.`term_taxonomy_id`
+	WHERE
+		`$bbdb->term_taxonomy`.`taxonomy` = 'bb_topic_tag'
+	ORDER BY
+		`$bbdb->term_taxonomy`.`term_taxonomy_id`,
+		`$bbdb->term_relationships`.`object_id`;";
+
+	$terms = $bbdb->get_results( $sql_terms );
+	if ( is_wp_error( $terms ) || !is_array( $terms ) ) {
+		return array( 2, sprintf( $statement, $result ) );
+	}
+	if ( empty( $terms ) ) {
+		$result = __( 'No topic tags found.' );
+		return array( 3, sprintf( $statement, $result ) );
+	}
+	
+	// Count the topics in each tag
+	$tags = array();
+	foreach ( $terms as $term ) {
+		if ( !isset( $tags[$term->term_taxonomy_id] ) ) {
+			$tags[$term->term_taxonomy_id] = 1;
+		} else {
+			$tags[$term->term_taxonomy_id]++;
 		}
-		if ( count( $_terms ) ) {
-			$wp_taxonomy_object->update_term_count( $_terms, 'bb_topic_tag' );
+	}
+	if ( empty( $tags ) ) {
+		return array( 4, sprintf( $statement, $result ) );
+	}
+	
+	// Build the values to insert into the SQL statement
+	$values = array();
+	foreach ($tags as $term_taxonomy_id => $count) {
+		$values[] = '(' . $term_taxonomy_id . ', ' . $count . ')';
+	}
+	if ( empty( $values ) ) {
+		return array( 5, sprintf( $statement, $result ) );
+	}
+	
+	// Update the terms with the new tag counts
+	$values = array_chunk( $values, 10000 );
+	foreach ($values as $chunk) {
+		$sql = "INSERT INTO `$bbdb->term_taxonomy` (`term_taxonomy_id`, `count`) VALUES " . implode(", ", $chunk) . " ON DUPLICATE KEY UPDATE `count` = VALUES(`count`);";
+		if ( is_wp_error( $bbdb->query( $sql ) ) ) {
+			return array( 6, sprintf( $statement, $result ) );
 		}
 	}
-	unset( $term, $_terms );
 
-	return $message;
+	if ($return_boolean) {
+		return true;
+	}
+	$result = __( 'Complete!' );
+	return array( 0, sprintf( $statement, $result ) );
 }
 
-// TODO - make fast - see #1146
+// This function bypasses the taxonomy API
 function bb_recount_tag_delete_empty()
 {
-	// Get all tags
-	if ( !isset( $terms ) ) {
-		$terms = $wp_taxonomy_object->get_terms( 'bb_topic_tag', array( 'hide_empty' => false ) );
-	}
-
-	if ( !is_wp_error( $terms ) && is_array( $terms ) ) {
-		$message = __('Deleted tags with no topics');
-		foreach ( $terms as $term ) {
-			$topic_ids = bb_get_tagged_topic_ids( $term->term_id );
-			if ( !is_wp_error( $topic_ids ) && is_array( $topic_ids ) ) {
-				if ( false === $topic_ids || ( is_array( $topic_ids ) && !count( $topic_ids ) ) ) {
-					bb_destroy_tag( $term->term_taxonomy_id );
-				}
+	global $bbdb;
+
+	$statement = __( 'Deleting topic tags with no topics&hellip; %s' );
+	$result = __( 'Failed!' );
+
+	static $run_once;
+	if ( isset( $run_once ) ) {
+		if ($run_once > 0) {
+			$exit = sprintf( __( 'failure (returned code %s)' ), $run_once );
+		} else {
+			$exit = __( 'success' );
+		}
+		$result = sprintf( __( 'Already run with %s.' ), $exit );
+		return array( $run_once, sprintf( $statement, $result ) );
+	}
+
+	// Get all topic ids
+	$sql_topics = "SELECT `topic_id` FROM $bbdb->topics ORDER BY `topic_id`;";
+	$topics = $bbdb->get_results( $sql_topics );
+	if ( is_wp_error( $topics ) ) {
+		$result = __('No topics found.');
+		$run_once = 1;
+		return array( 1, sprintf( $statement, $result ) );
+	}
+	$topic_ids = array();
+	foreach ($topics as $topic) {
+		$topic_ids[] = $topic->topic_id;
+	}
+
+	// Get all topic tag term relationships without a valid topic id
+	$in_topic_ids = implode(', ', $topic_ids);
+	$sql_bad_term_relationships = "SELECT
+		`$bbdb->term_taxonomy`.`term_taxonomy_id`,
+		`$bbdb->term_taxonomy`.`term_id`,
+		`$bbdb->term_relationships`.`object_id`
+	FROM `$bbdb->term_relationships`
+	JOIN `$bbdb->term_taxonomy`
+		ON `$bbdb->term_taxonomy`.`term_taxonomy_id` = `$bbdb->term_relationships`.`term_taxonomy_id`
+	WHERE
+		`$bbdb->term_taxonomy`.`taxonomy` = 'bb_topic_tag' AND
+		`$bbdb->term_relationships`.`object_id` NOT IN ($in_topic_ids)
+	ORDER BY
+		`$bbdb->term_relationships`.`object_id`,
+		`$bbdb->term_taxonomy`.`term_id`,
+		`$bbdb->term_taxonomy`.`term_taxonomy_id`;";
+
+	$bad_term_relationships = $bbdb->get_results( $sql_bad_term_relationships );
+	if ( is_wp_error( $bad_term_relationships ) || !is_array( $bad_term_relationships ) ) {
+		$run_once = 2;
+		return array( 2, sprintf( $statement, $result ) );
+	}
+
+	// Delete those bad term relationships
+	if ( !empty( $bad_term_relationships ) ) {
+		$values = array();
+		foreach ( $bad_term_relationships as $bad_term_relationship ) {
+			$values[] = '(`object_id` = ' . $bad_term_relationship->object_id . ' AND `term_taxonomy_id` = ' . $bad_term_relationship->term_taxonomy_id . ')';
+		}
+		if ( !empty( $values ) ) {
+			$values = join(' OR ', $values);
+			$sql_bad_term_relationships_delete = "DELETE
+			FROM `$bbdb->term_relationships`
+			WHERE $values;";
+			if ( is_wp_error( $bbdb->query( $sql_bad_term_relationships_delete ) ) ) {
+				$run_once = 3;
+				return array( 3, sprintf( $statement, $result ) );
 			}
-			unset( $topic_ids );
 		}
 	}
-	unset( $terms, $term );
 
-	return $message;
+	// Now get all term taxonomy ids with term relationships
+	$sql_term_relationships = "SELECT `term_taxonomy_id` FROM $bbdb->term_relationships ORDER BY `term_taxonomy_id`;";
+	$term_taxonomy_ids = $bbdb->get_col($sql_term_relationships);
+	if ( is_wp_error( $term_taxonomy_ids ) ) {
+		$run_once = 4;
+		return array( 4, sprintf( $statement, $result ) );
+	}
+	$term_taxonomy_ids = array_unique( $term_taxonomy_ids );
+
+	// Delete topic tags that don't have any term relationships
+	if ( !empty( $term_taxonomy_ids ) ) {
+		$in_term_taxonomy_ids = implode(', ', $term_taxonomy_ids);
+		$sql_delete_term_relationships = "DELETE
+		FROM $bbdb->term_taxonomy
+		WHERE
+			`taxonomy` = 'bb_topic_tag' AND
+			`term_taxonomy_id` NOT IN ($in_term_taxonomy_ids);";
+		if ( is_wp_error( $bbdb->query( $sql_delete_term_relationships ) ) ) {
+			$run_once = 5;
+			return array( 5, sprintf( $statement, $result ) );
+		}
+	}
+
+	// Get all valid term ids
+	$sql_terms = "SELECT `term_id` FROM $bbdb->term_taxonomy ORDER BY `term_id`;";
+	$term_ids = $bbdb->get_col($sql_terms);
+	if ( is_wp_error( $term_ids ) ) {
+		$run_once = 6;
+		return array( 6, sprintf( $statement, $result ) );
+	}
+	$term_ids = array_unique( $term_ids );
+
+	// Delete terms that don't have any associated term taxonomies
+	if ( !empty( $term_ids ) ) {
+		$in_term_ids = implode(', ', $term_ids);
+		$sql_delete_terms = "DELETE
+		FROM $bbdb->terms
+		WHERE
+			`term_id` NOT IN ($in_term_ids);";
+		if ( is_wp_error( $bbdb->query( $sql_delete_terms ) ) ) {
+			$run_once = 7;
+			return array( 7, sprintf( $statement, $result ) );
+		}
+	}
+
+	$result = __( 'Complete!' );
+	$run_once = 0;
+	return array( 0, sprintf( $statement, $result ) );
 }
 
 function bb_recount_clean_favorites()
@@ -217,13 +415,13 @@ function bb_recount_clean_favorites()
 
 	$users = $bbdb->get_results( "SELECT `user_id`, `meta_value` AS `favorites` FROM `$bbdb->usermeta` WHERE `meta_key` = '$meta_key';" );
 	if ( is_wp_error( $users ) ) {
-		return sprintf( $statement, $result );
+		return array( 1, sprintf( $statement, $result ) );
 	}
 
 	$topics = $bbdb->get_col( "SELECT `topic_id` FROM `$bbdb->topics` WHERE `topic_status` = '0';" );
 
 	if ( is_wp_error( $topics ) ) {
-		return sprintf( $statement, $result );
+		return array( 2, sprintf( $statement, $result ) );
 	}
 
 	$values = array();
@@ -240,12 +438,13 @@ function bb_recount_clean_favorites()
 	}
 
 	if ( !count( $values ) ) {
-		return sprintf( $statement, $result );
+		$result = __( 'Nothing to remove!' );
+		return array( 0, sprintf( $statement, $result ) );
 	}
 
 	$sql_delete = "DELETE FROM `$bbdb->usermeta` WHERE `meta_key` = '$meta_key';";
 	if ( is_wp_error( $bbdb->query( $sql_delete ) ) ) {
-		return sprintf( $statement, $result );
+		return array( 4, sprintf( $statement, $result ) );
 	}
 
 	$values = array_chunk( $values, 10000 );
@@ -253,10 +452,10 @@ function bb_recount_clean_favorites()
 		$chunk = "\n" . join( ",\n", $chunk );
 		$sql_insert = "INSERT INTO `$bbdb->usermeta` (`user_id`, `meta_key`, `meta_value`) VALUES $chunk;";
 		if ( is_wp_error( $bbdb->query( $sql_insert ) ) ) {
-			return sprintf( $statement, $result );
+			return array( 5, sprintf( $statement, $result ) );
 		}
 	}
 
 	$result = __( 'Complete!' );
-	return sprintf( $statement, $result );
+	return array( 0, sprintf( $statement, $result ) );
 }
diff --git a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-admin/includes/functions.bb-upgrade.php b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-admin/includes/functions.bb-upgrade.php
index 4ca242a9de1e16a24bf8bf3ce9a0c44ee88212cf..d021c96d3321798dcb1ab7cc915ed68ec8146874 100644
--- a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-admin/includes/functions.bb-upgrade.php
+++ b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-admin/includes/functions.bb-upgrade.php
@@ -60,6 +60,7 @@ function bb_upgrade_all()
 	$bb_upgrade['messages'][] = bb_upgrade_1100(); // Replace forum_stickies index with stickies (#876)
 	$bb_upgrade['messages'][] = bb_upgrade_1110(); // Create plugin directory (#1083)
 	$bb_upgrade['messages'][] = bb_upgrade_1120(); // Create theme directory (#1083)
+	$bb_upgrade['messages'][] = bb_upgrade_1130(); // Add subscriptions option and set it to true (#1268)
 
 	bb_update_db_version();
 	wp_cache_flush();
@@ -493,6 +494,22 @@ function bb_upgrade_1120() {
 	return;
 }
 
+// Subscription Option
+function bb_upgrade_1130() {
+	if ( $dbv = bb_get_option_from_db( 'bb_db_version' ) && $dbv >= 2471 )
+		return;
+	
+	// If the option is already there, then return
+	if ( bb_get_option( 'enable_subscriptions' ) )
+		return;
+	
+	bb_update_option( 'enable_subscriptions', 1 );
+	
+	bb_update_option( 'bb_db_version', 2471 );
+	
+	return 'Added subscriptions option and set its value to true: ' . __FUNCTION__;
+}
+
 function bb_deslash($content) {
     // Note: \\\ inside a regex denotes a single backslash.
 
diff --git a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-admin/index.php b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-admin/index.php
index f2fd66c3fa1d3d56833191b4ba9ab5f885f6017a..da6ec45abf22dbbb7dee0e8cae8c2fc59519735b 100644
--- a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-admin/index.php
+++ b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-admin/index.php
@@ -1,34 +1,38 @@
 <?php
+
+// Get started
 require_once('admin.php');
 require_once( BB_PATH . BB_INC . 'functions.bb-statistics.php' );
 
-$rn_forums = get_total_forums();
-$rn_forums = sprintf(__ngettext('<span>%d</span> forum', '<span>%d</span> forums', $rn_forums), $rn_forums);
+// Get counts and format numbers
+$rn_forums             = number_format( get_total_forums() );
+$rn_forums             = sprintf(__ngettext('<span>%s</span> forum', '<span>%s</span> forums', $rn_forums), $rn_forums );
 
-$rn_topics = get_total_topics();
-$rn_topics = sprintf(__ngettext('<span>%d</span> topic', '<span>%d</span> topics', $rn_topics), $rn_topics);
+$rn_topics             = number_format( get_total_topics() );
+$rn_topics             = sprintf(__ngettext('<span>%s</span> topic', '<span>%s</span> topics', $rn_topics), $rn_topics );
 
-$rn_posts = get_total_posts();
-$rn_posts = sprintf(__ngettext('<span>%d</span> post', '<span>%d</span> posts', $rn_posts), $rn_posts);
+$rn_posts              = number_format( get_total_posts() );
+$rn_posts              = sprintf(__ngettext('<span>%s</span> post', '<span>%s</span> posts', $rn_posts), $rn_posts );
 
-$rn_users = bb_get_total_users();
-$rn_users = sprintf(__ngettext('<span>%d</span> user', '<span>%d</span> users', $rn_users), $rn_users);
+$rn_users              = number_format( bb_get_total_users() );
+$rn_users              = sprintf(__ngettext('<span>%s</span> user', '<span>%s</span> users', $rn_users), $rn_users );
 
-$rn_topic_tags = bb_get_total_topic_tags();
-$rn_topic_tags = sprintf(__ngettext('<span>%d</span> tag', '<span>%d</span> tags', $rn_topic_tags), $rn_topic_tags);
+$rn_topic_tags         = number_format( bb_get_total_topic_tags() );
+$rn_topic_tags         = sprintf(__ngettext('<span>%s</span> tag', '<span>%s</span> tags', $rn_topic_tags), $rn_topic_tags );
 
-$rn_topics_average = get_topics_per_day();
-$rn_topics_average = sprintf(__ngettext('<span>%d</span> topic', '<span>%d</span> topics', $rn_topics_average), $rn_topics_average);
+$rn_topics_average     = number_format( get_topics_per_day() );
+$rn_topics_average     = sprintf(__ngettext('<span>%s</span> topic', '<span>%s</span> topics', $rn_topics_average), $rn_topics_average );
 
-$rn_posts_average = get_posts_per_day();
-$rn_posts_average = sprintf(__ngettext('<span>%d</span> post', '<span>%d</span> posts', $rn_posts_average), $rn_posts_average);
+$rn_posts_average      = number_format( get_posts_per_day() );
+$rn_posts_average      = sprintf(__ngettext('<span>%s</span> post', '<span>%s</span> posts', $rn_posts_average), $rn_posts_average );
 
-$rn_users_average = get_registrations_per_day();
-$rn_users_average = sprintf(__ngettext('<span>%d</span> user', '<span>%d</span> users', $rn_users_average), $rn_users_average);
+$rn_users_average      = number_format( get_registrations_per_day() );
+$rn_users_average      = sprintf(__ngettext('<span>%s</span> user', '<span>%s</span> users', $rn_users_average), $rn_users_average );
 
-$rn_topic_tags_average = bb_get_topic_tags_per_day();
-$rn_topic_tags_average = sprintf(__ngettext('<span>%d</span> tag', '<span>%d</span> tags', $rn_topic_tags_average), $rn_topic_tags_average);
+$rn_topic_tags_average = number_format( bb_get_topic_tags_per_day() );
+$rn_topic_tags_average = sprintf(__ngettext('<span>%s</span> tag', '<span>%s</span> tags', $rn_topic_tags_average), $rn_topic_tags_average );
 
+// Filter the numbers
 $rn = apply_filters( 'bb_admin_right_now', array(
 	'forums'     => array( $rn_forums, '-' ),
 	'topics'     => array( $rn_topics, $rn_topics_average ),
@@ -39,11 +43,11 @@ $rn = apply_filters( 'bb_admin_right_now', array(
 
 $bb_admin_body_class = ' bb-admin-dashboard';
 
-bb_get_admin_header();
-?>
+bb_get_admin_header(); ?>
 
 <div class="wrap">
 	<h2><?php _e('Dashboard'); ?></h2>
+
 	<?php do_action( 'bb_admin_notices' ); ?>
 
 	<div id="dashboard-right-now" class="dashboard">
@@ -56,24 +60,23 @@ bb_get_admin_header();
 						<th><?php _e( 'Per Day' ); ?></th>
 					</tr>
 				</thead>
-<?php
-if ( !empty( $rn ) && is_array( $rn ) ) {
-?>
+
+<?php if ( !empty( $rn ) && is_array( $rn ) ) { ?>
+
 				<tbody>
-<?php
-	foreach ( $rn as $rn_row ) {
-?>
+
+	<?php foreach ( $rn as $rn_row ) { ?>
+
 					<tr>
 						<td><?php echo $rn_row[0]; ?></td>
 						<td><?php echo $rn_row[1]; ?></td>
 					</tr>
-<?php
-	}
-?>
+	<?php } ?>
+
 				</tbody>
-<?php
-}
-?>
+
+<?php } ?>
+
 			</table>
 		</div>
 
@@ -90,28 +93,47 @@ if ( !empty( $rn ) && is_array( $rn ) ) {
 			<?php add_filter( 'get_topic_where', 'bb_no_where' ); foreach ( $objects as $object ) : ?>
 			<?php if ( 'post' == $object['type'] ) : global $bb_post; $bb_post = $object['data']; ?>
 			<li>
-<?php
-					printf(
-						__( '<a href="%1$s">Post</a> on <a href="%2$s">%3$s</a> by <a href="%4$s">%5$s</a>' ),
-						esc_attr( add_query_arg( 'view', 'all', get_post_link() ) ),
-						get_topic_link( $bb_post->topic_id ),
-						get_topic_title( $bb_post->topic_id ),
-						get_user_profile_link( $bb_post->poster_id ),
-						get_post_author()
-					);
-?>
+			<?php
+					if ( $bb_post->poster_id ) {
+						printf(
+							__( '<a href="%1$s">Post</a> on <a href="%2$s">%3$s</a> by <a href="%4$s">%5$s</a>' ),
+							esc_attr( add_query_arg( 'view', 'all', get_post_link() ) ),
+							get_topic_link( $bb_post->topic_id ),
+							get_topic_title( $bb_post->topic_id ),
+							get_user_profile_link( $bb_post->poster_id ),
+							get_post_author()
+						);
+					} else {
+						printf(
+							__( '<a href="%1$s">Post</a> on <a href="%2$s">%3$s</a> by %4$s' ),
+							esc_attr( add_query_arg( 'view', 'all', get_post_link() ) ),
+							get_topic_link( $bb_post->topic_id ),
+							get_topic_title( $bb_post->topic_id ),
+							get_post_author()
+						);
+					}
+			?>
 			</li>
 			<?php elseif ( 'topic' == $object['type'] ) : global $topic; $topic = $object['data']; ?>
 			<li>
-<?php
-					printf(
-						__( 'Topic titled <a href="%1$s">%2$s</a> started by <a href="%3$s">%4$s</a>' ),
-						esc_attr( add_query_arg( 'view', 'all', get_topic_link() ) ),
-						get_topic_title(),
-						get_user_profile_link( $topic->topic_poster ),
-						get_topic_author()
-					);
-?>
+			<?php
+					if ( $topic->topic_poster ) {
+						printf(
+							__( 'Topic titled <a href="%1$s">%2$s</a> started by <a href="%3$s">%4$s</a>' ),
+							esc_attr( add_query_arg( 'view', 'all', get_topic_link() ) ),
+							get_topic_title( $topic->topic_id ),
+							get_user_profile_link( $topic->topic_poster ),
+							get_topic_author( $topic->topic_id )
+						);
+					} else {
+						printf(
+							__( 'Topic titled <a href="%1$s">%2$s</a> started by %3$s' ),
+							esc_attr( add_query_arg( 'view', 'all', get_topic_link() ) ),
+							get_topic_title( $topic->topic_id ),
+							get_topic_author( $topic->topic_id )
+						);
+					}
+			?>
 			</li>
 			<?php endif; endforeach; remove_filter( 'get_topic_where', 'bb_no_where' ); ?>
 		</ul>
diff --git a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-admin/install.php b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-admin/install.php
index 6bb98b3e7a2e8c638396b06a88173ca74979e88d..2d2e2f1e4a57dbb6b230ca7e6445c4f14b401821 100644
--- a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-admin/install.php
+++ b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-admin/install.php
@@ -1,6 +1,6 @@
 <?php
 // Modify error reporting levels
-error_reporting(E_ALL ^ E_NOTICE);
+error_reporting(E_ERROR | E_WARNING | E_PARSE | E_USER_ERROR | E_USER_WARNING);
 
 // Let everyone know we are installing
 define('BB_INSTALLING', true);
@@ -82,12 +82,12 @@ switch ($bb_install->step) {
 					$bb_install->input_text('bbdb_name');
 					$bb_install->input_text('bbdb_user');
 					$bb_install->input_text('bbdb_password');
+					$bb_install->input_text('bbdb_host');
 					$bb_install->select_language();
 					$bb_install->input_toggle('toggle_1');
 ?>
 						<div class="toggle" id="toggle_1_target" style="<?php echo esc_attr( 'display:' . $bb_install->data[$bb_install->step]['form']['toggle_1']['display'] ); ?>;">
 <?php
-					$bb_install->input_text('bbdb_host');
 					$bb_install->input_text('bbdb_charset');
 					$bb_install->input_text('bbdb_collate');
 					//$bb_install->input_text('bb_auth_key');
diff --git a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-admin/js/common.js b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-admin/js/common.js
index 60fdd246f51ad51f404ca6d65f0736f7c11d1ce4..d5eb81e0720fd9499a63099f0204cbb9a48eb466 100644
--- a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-admin/js/common.js
+++ b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-admin/js/common.js
@@ -82,6 +82,12 @@ adminMenu = {
 	}
 };
 
-$(document).ready(function(){adminMenu.init();});
+$(document).ready(function(){
+	adminMenu.init();
+	$('thead .check-column :checkbox, tfoot .check-column :checkbox').click( function() {
+		$(this).parents( 'table' ).find( '.check-column :checkbox' ).attr( 'checked', $(this).is( ':checked' ) ? 'checked' : false );
+	} );
+});
 
-})(jQuery);
\ No newline at end of file
+
+})(jQuery);
diff --git a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-admin/options-discussion.php b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-admin/options-discussion.php
index 34bdca0e4ee99f53c084f2720204e767b67d1777..28337d7a2f0b2275e26574a1b0b803628cd8c73d 100644
--- a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-admin/options-discussion.php
+++ b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-admin/options-discussion.php
@@ -7,17 +7,25 @@ if ( 'post' == strtolower( $_SERVER['REQUEST_METHOD'] ) && $_POST['action'] == '
 	bb_check_admin_referer( 'options-discussion-update' );
 	
 	// Deal with pingbacks checkbox when it isn't checked
-	if (!isset($_POST['enable_pingback'])) {
+	if ( !isset( $_POST['enable_pingback'] ) ) {
 		$_POST['enable_pingback'] = false;
 	}
+
+	if ( !isset( $_POST['enable_loginless'] ) ) {
+		$_POST['enable_loginless'] = false;
+	}
+	
+	if ( !isset( $_POST['enable_subscriptions'] ) ) {
+		$_POST['enable_subscriptions'] = false;
+	}
 	
 	// Deal with avatars checkbox when it isn't checked
-	if (!isset($_POST['avatars_show'])) {
+	if ( !isset( $_POST['avatars_show'] ) ) {
 		$_POST['avatars_show'] = false;
 	}
 	
 	foreach ( (array) $_POST as $option => $value ) {
-		if ( !in_array( $option, array('_wpnonce', '_wp_http_referer', 'action', 'submit') ) ) {
+		if ( !in_array( $option, array( '_wpnonce', '_wp_http_referer', 'action', 'submit' ) ) ) {
 			$option = trim( $option );
 			$value = is_array( $value ) ? $value : trim( $value );
 			$value = stripslashes_deep( $value );
@@ -38,7 +46,7 @@ if ( !empty($_GET['updated']) ) {
 	bb_admin_notice( __( '<strong>Settings saved.</strong>' ) );
 }
 
-$remote_options = array(
+$general_options = array(
 	'enable_pingback' => array(
 		'title' => __( 'Enable Pingbacks' ),
 		'type' => 'checkbox',
@@ -46,6 +54,22 @@ $remote_options = array(
 			1 => __( 'Allow link notifications from other sites.' )
 		)
 	),
+
+	'enable_loginless' => array(
+		'title' => __( 'Enable Login-less Posting' ),
+		'type' => 'checkbox',
+		'options' => array(
+			1 => __( 'Allow users to create topics and posts without logging in.' )
+		),
+	),
+	
+	'enable_subscriptions' => array(
+		'title' => __( 'Enable Subscriptions' ),
+		'type' => 'checkbox',
+		'options' => array(
+			1 => __( 'Allow users to subscribe to topics and receive new posts via email.' )
+		),
+	),
 );
 
 $bb_get_option_avatars_show = create_function( '$a', 'return 1;' );
@@ -78,10 +102,11 @@ $avatar_options = array(
 			'logo'      => bb_get_avatar( '',             32, 'logo' )      . ' ' . __( 'Gravatar Logo' ),
 			'identicon' => bb_get_avatar( rand( 0, 999 ), 32, 'identicon' ) . ' ' . __( 'Identicon (Generated)' ),
 			'wavatar'   => bb_get_avatar( rand( 0, 999 ), 32, 'wavatar' )   . ' ' . __( 'Wavatar (Generated)' ),
-			'monsterid' => bb_get_avatar( rand( 0, 999 ), 32, 'monsterid' ) . ' ' . __( 'MonsterID  (Generated)' )
+			'monsterid' => bb_get_avatar( rand( 0, 999 ), 32, 'monsterid' ) . ' ' . __( 'MonsterID  (Generated)' ),
+			'retro'     => bb_get_avatar( rand( 0, 999 ), 32, 'retro' )     . ' ' . __( 'Retro  (Generated)' )
 		),
 		'note' => array(
-			__( 'For users without a custom avatar of their own, you can either display a generic logo or a generated one based on their e-mail address.' )
+			__( '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.' )
 		),
 	)
 );
@@ -101,7 +126,7 @@ bb_get_admin_header();
 <form class="settings" method="post" action="<?php bb_uri( 'bb-admin/options-discussion.php', null, BB_URI_CONTEXT_FORM_ACTION + BB_URI_CONTEXT_BB_ADMIN ); ?>">
 	<fieldset>
 <?php
-foreach ( $remote_options as $option => $args ) {
+foreach ( $general_options as $option => $args ) {
 	bb_option_form_element( $option, $args );
 }
 ?>
diff --git a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-admin/options-permalinks.php b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-admin/options-permalinks.php
index 68e2b04826253a171609441826d0dcdc0911eb35..0f1f177f0a0231ba8256b29ddf821595682641b6 100644
--- a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-admin/options-permalinks.php
+++ b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-admin/options-permalinks.php
@@ -1,188 +1,188 @@
-<?php
-
-require_once('admin.php');
-
-$file_source = BB_PATH . 'bb-admin/includes/defaults.bb-htaccess.php';
-$file_target = BB_PATH . '.htaccess';
-include( $file_source );
-$file_source_rules = $_rules; // This is a string
-
-if ( 'post' == strtolower( $_SERVER['REQUEST_METHOD'] ) && $_POST['action'] == 'update') {
-
-	bb_check_admin_referer( 'options-permalinks-update' );
-
-	foreach ( (array) $_POST as $option => $value ) {
-		if ( !in_array( $option, array('_wpnonce', '_wp_http_referer', 'action', 'submit') ) ) {
-			$option = trim( $option );
-			$value = is_array( $value ) ? $value : trim( $value );
-			$value = stripslashes_deep( $value );
-			if ( $value ) {
-				bb_update_option( $option, $value );
-			} else {
-				bb_delete_option( $option );
-			}
-		}
-	}
-
-	$mod_rewrite = (string) bb_get_option( 'mod_rewrite' );
-
-	$goback = remove_query_arg( array( 'updated', 'notapache', 'notmodrewrite' ), wp_get_referer() );
-
-	// Make sure mod_rewrite is possible on the server
-	if ( !$is_apache ) {
-		bb_delete_option( 'mod_rewrite_writable' );
-		$goback = add_query_arg( 'notapache', 'true', $goback );
-		bb_safe_redirect( $goback );
-		exit;
-	} elseif ( '0' !== $mod_rewrite && !apache_mod_loaded( 'mod_rewrite', true ) ) {
-		bb_delete_option( 'mod_rewrite_writable' );
-		bb_update_option( 'mod_rewrite', '0' );
-		$goback = add_query_arg( 'notmodrewrite', 'true', $goback );
-		bb_safe_redirect( $goback );
-		exit;
-	}
-
-	$file_target_rules = array();
-
-	$file_target_exists = false;
-	$file_target_writable = true;
-	if ( file_exists( $file_target ) ) {
-		if ( is_readable( $file_target ) ) {
-			$file_target_rules = explode( "\n", implode( '', file(  $file_target ) ) );
-		}
-		$file_target_exists = true;
-		if ( !is_writable( $file_target ) ) {
-			$file_target_writable = false;
-		}
-	} else {
-		$file_target_dir = dirname( $file_target );
-		if ( file_exists( $file_target_dir ) ) {
-			if ( !is_writable( $file_target_dir ) || !is_dir( $file_target_dir ) ) {
-				$file_target_writable = false;
-			}
-		} else {
-			$file_target_writable = false;
-		}
-	}
-
-	// Strip out existing bbPress rules
-	$_keep_rule = true;
-	$_kept_rules = array();
-	foreach ( $file_target_rules as $_rule ) {
-		if ( false !== strpos( $_rule, '# BEGIN bbPress' ) ) {
-			$_keep_rule = false;
-			continue;
-		} elseif ( false !== strpos( $_rule, '# END bbPress' ) ) {
-			$_keep_rule = true;
-			continue;
-		}
-		if ( $_keep_rule ) {
-			$_kept_rules[] = $_rule;
-		}
-	}
-
-	$file_target_rules = join( "\n", $_kept_rules ) . "\n" . $file_source_rules;
-	
-	$file_target_written = 0;
-	if ( $file_target_writable ) {
-		// Open the file for writing - rewrites the whole file
-		if ( $file_target_handle = fopen( $file_target, 'w' ) ) {
-			if ( fwrite( $file_target_handle, $file_target_rules ) ) {
-				$file_target_written = 1;
-			}
-			// Close the file
-			fclose( $file_target_handle );
-			@chmod( $file_target, 0666 );
-		}
-	}
-
-	bb_update_option( 'mod_rewrite_writable', $file_target_writable );
-	$goback = add_query_arg( 'updated', 'true', $goback );
-	bb_safe_redirect( $goback );
-	exit;
-}
-
-if ( $is_apache && bb_get_option( 'mod_rewrite' ) && !bb_get_option( 'mod_rewrite_writable' ) ) {
-	$manual_instructions = true;
-}
-
-if ( !empty( $_GET['notmodrewrite'] ) ) {
-	$manual_instructions = false;
-	bb_admin_notice( __( '<strong>It appears that your server does not support custom permalink structures.</strong>' ), 'error' );
-}
-
-if ( !empty( $_GET['notapache'] ) ) {
-	$manual_instructions = false;
-	bb_admin_notice( __( '<strong>Rewriting on webservers other than Apache using mod_rewrite is currently unsupported, but we won&#8217;t stop you from trying.</strong>' ), 'error' );
-}
-
-if ( !empty( $_GET['updated'] ) ) {
-	if ( $manual_instructions ) {
-		bb_admin_notice( __( '<strong>You should update your .htaccess now.</strong>' ) );
-	} else {
-		bb_admin_notice( __( '<strong>Permalink structure updated.</strong>' ) );
-	}
-}
-
-$permalink_options = array(
-	'mod_rewrite' => array(
-		'title' => __( 'Permalink type' ),
-		'type' => 'radio',
-		'options' => array(
-			'0' => sprintf( __( '<span>None</span> <code>%s</code>' ), bb_get_uri( 'forums.php', array( 'id' => 1 ), BB_URI_CONTEXT_TEXT ) ),
-			'1' => sprintf( __( '<span>Numeric</span> <code>%s</code>' ), bb_get_uri( 'forums/1', null, BB_URI_CONTEXT_TEXT ) ),
-			'slugs' => sprintf( __( '<span>Name based</span> <code>%s</code>' ), bb_get_uri( '/forums/first-forum', null, BB_URI_CONTEXT_TEXT ) )
-		)
-	)
-);
-
-$bb_admin_body_class = ' bb-admin-settings';
-
-bb_get_admin_header();
-
-?>
-
-<div class="wrap">
-
-<h2><?php _e( 'Permalink Settings' ); ?></h2>
-<?php do_action( 'bb_admin_notices' ); ?>
-
-<form class="settings" method="post" action="<?php bb_uri( 'bb-admin/options-permalinks.php', null, BB_URI_CONTEXT_FORM_ACTION + BB_URI_CONTEXT_BB_ADMIN ); ?>">
-	<fieldset>
-		<p>
-			<?php _e( 'By default bbPress uses web URLs which have question marks and lots of numbers in them, however bbPress offers you the ability to choose an alternative URL structure for your permalinks. This can improve the aesthetics, usability, and forward-compatibility of your links.' ); ?>
-		</p>
-<?php
-foreach ( $permalink_options as $option => $args ) { 
-	bb_option_form_element( $option, $args );
-}
-?>
-	</fieldset>
-	<fieldset class="submit">
-		<?php bb_nonce_field( 'options-permalinks-update' ); ?>
-		<input type="hidden" name="action" value="update" />
-		<input class="submit" type="submit" name="submit" value="<?php _e('Save Changes') ?>" />
-	</fieldset>
-</form>
-
-<?php
-if ( $manual_instructions ) {
-?>
-<form class="settings" method="post" action="<?php bb_uri( 'bb-admin/options-permalinks.php', null, BB_URI_CONTEXT_FORM_ACTION + BB_URI_CONTEXT_BB_ADMIN ); ?>">
-	<fieldset>
-		<p>
-			<?php _e( '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.' ); ?>
-		</p>
-		<textarea dir="ltr" id="rewrite-rules" class="readonly" readonly="readonly" rows="6"><?php echo esc_html( trim( $file_source_rules ) ); ?></textarea>
-	</fieldset>
-</form>
-
-<?php
-}
-?>
-
-</div>
-
-<?php
-
-bb_get_admin_footer();
+<?php
+
+require_once('admin.php');
+
+$file_source = BB_PATH . 'bb-admin/includes/defaults.bb-htaccess.php';
+$file_target = BB_PATH . '.htaccess';
+include( $file_source );
+$file_source_rules = $_rules; // This is a string
+
+if ( 'post' == strtolower( $_SERVER['REQUEST_METHOD'] ) && $_POST['action'] == 'update') {
+
+	bb_check_admin_referer( 'options-permalinks-update' );
+
+	foreach ( (array) $_POST as $option => $value ) {
+		if ( !in_array( $option, array('_wpnonce', '_wp_http_referer', 'action', 'submit') ) ) {
+			$option = trim( $option );
+			$value = is_array( $value ) ? $value : trim( $value );
+			$value = stripslashes_deep( $value );
+			if ( $value ) {
+				bb_update_option( $option, $value );
+			} else {
+				bb_delete_option( $option );
+			}
+		}
+	}
+
+	$mod_rewrite = (string) bb_get_option( 'mod_rewrite' );
+
+	$goback = remove_query_arg( array( 'updated', 'notapache', 'notmodrewrite' ), wp_get_referer() );
+
+	// Make sure mod_rewrite is possible on the server
+	if ( !$is_apache ) {
+		bb_delete_option( 'mod_rewrite_writable' );
+		$goback = add_query_arg( 'notapache', 'true', $goback );
+		bb_safe_redirect( $goback );
+		exit;
+	} elseif ( '0' !== $mod_rewrite && !apache_mod_loaded( 'mod_rewrite', true ) ) {
+		bb_delete_option( 'mod_rewrite_writable' );
+		bb_update_option( 'mod_rewrite', '0' );
+		$goback = add_query_arg( 'notmodrewrite', 'true', $goback );
+		bb_safe_redirect( $goback );
+		exit;
+	}
+
+	$file_target_rules = array();
+
+	$file_target_exists = false;
+	$file_target_writable = true;
+	if ( file_exists( $file_target ) ) {
+		if ( is_readable( $file_target ) ) {
+			$file_target_rules = explode( "\n", implode( '', file(  $file_target ) ) );
+		}
+		$file_target_exists = true;
+		if ( !is_writable( $file_target ) ) {
+			$file_target_writable = false;
+		}
+	} else {
+		$file_target_dir = dirname( $file_target );
+		if ( file_exists( $file_target_dir ) ) {
+			if ( !is_writable( $file_target_dir ) || !is_dir( $file_target_dir ) ) {
+				$file_target_writable = false;
+			}
+		} else {
+			$file_target_writable = false;
+		}
+	}
+
+	// Strip out existing bbPress rules
+	$_keep_rule = true;
+	$_kept_rules = array();
+	foreach ( $file_target_rules as $_rule ) {
+		if ( false !== strpos( $_rule, '# BEGIN bbPress' ) ) {
+			$_keep_rule = false;
+			continue;
+		} elseif ( false !== strpos( $_rule, '# END bbPress' ) ) {
+			$_keep_rule = true;
+			continue;
+		}
+		if ( $_keep_rule ) {
+			$_kept_rules[] = $_rule;
+		}
+	}
+
+	$file_target_rules = join( "\n", $_kept_rules ) . "\n" . $file_source_rules;
+	
+	$file_target_written = 0;
+	if ( $file_target_writable ) {
+		// Open the file for writing - rewrites the whole file
+		if ( $file_target_handle = fopen( $file_target, 'w' ) ) {
+			if ( fwrite( $file_target_handle, $file_target_rules ) ) {
+				$file_target_written = 1;
+			}
+			// Close the file
+			fclose( $file_target_handle );
+			@chmod( $file_target, 0666 );
+		}
+	}
+
+	bb_update_option( 'mod_rewrite_writable', $file_target_writable );
+	$goback = add_query_arg( 'updated', 'true', $goback );
+	bb_safe_redirect( $goback );
+	exit;
+}
+
+if ( $is_apache && bb_get_option( 'mod_rewrite' ) && !bb_get_option( 'mod_rewrite_writable' ) ) {
+	$manual_instructions = true;
+}
+
+if ( !empty( $_GET['notmodrewrite'] ) ) {
+	$manual_instructions = false;
+	bb_admin_notice( __( '<strong>It appears that your server does not support custom permalink structures.</strong>' ), 'error' );
+}
+
+if ( !empty( $_GET['notapache'] ) ) {
+	$manual_instructions = false;
+	bb_admin_notice( __( '<strong>Rewriting on webservers other than Apache using mod_rewrite is currently unsupported, but we won&#8217;t stop you from trying.</strong>' ), 'error' );
+}
+
+if ( !empty( $_GET['updated'] ) ) {
+	if ( $manual_instructions ) {
+		bb_admin_notice( __( '<strong>You should update your .htaccess now.</strong>' ) );
+	} else {
+		bb_admin_notice( __( '<strong>Permalink structure updated.</strong>' ) );
+	}
+}
+
+$permalink_options = array(
+	'mod_rewrite' => array(
+		'title' => __( 'Permalink type' ),
+		'type' => 'radio',
+		'options' => array(
+			'0' => sprintf( __( '<span>None</span> <code>%s</code>' ), bb_get_uri( 'forum.php', array( 'id' => 1 ), BB_URI_CONTEXT_TEXT ) ),
+			'1' => sprintf( __( '<span>Numeric</span> <code>%s</code>' ), bb_get_uri( 'forum/1', null, BB_URI_CONTEXT_TEXT ) ),
+			'slugs' => sprintf( __( '<span>Name based</span> <code>%s</code>' ), bb_get_uri( '/forum/first-forum', null, BB_URI_CONTEXT_TEXT ) )
+		)
+	)
+);
+
+$bb_admin_body_class = ' bb-admin-settings';
+
+bb_get_admin_header();
+
+?>
+
+<div class="wrap">
+
+<h2><?php _e( 'Permalink Settings' ); ?></h2>
+<?php do_action( 'bb_admin_notices' ); ?>
+
+<form class="settings" method="post" action="<?php bb_uri( 'bb-admin/options-permalinks.php', null, BB_URI_CONTEXT_FORM_ACTION + BB_URI_CONTEXT_BB_ADMIN ); ?>">
+	<fieldset>
+		<p>
+			<?php _e( 'By default bbPress uses web URLs which have question marks and lots of numbers in them, however bbPress offers you the ability to choose an alternative URL structure for your permalinks. This can improve the aesthetics, usability, and forward-compatibility of your links.' ); ?>
+		</p>
+<?php
+foreach ( $permalink_options as $option => $args ) { 
+	bb_option_form_element( $option, $args );
+}
+?>
+	</fieldset>
+	<fieldset class="submit">
+		<?php bb_nonce_field( 'options-permalinks-update' ); ?>
+		<input type="hidden" name="action" value="update" />
+		<input class="submit" type="submit" name="submit" value="<?php _e('Save Changes') ?>" />
+	</fieldset>
+</form>
+
+<?php
+if ( $manual_instructions ) {
+?>
+<form class="settings" method="post" action="<?php bb_uri( 'bb-admin/options-permalinks.php', null, BB_URI_CONTEXT_FORM_ACTION + BB_URI_CONTEXT_BB_ADMIN ); ?>">
+	<fieldset>
+		<p>
+			<?php _e( '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.' ); ?>
+		</p>
+		<textarea dir="ltr" id="rewrite-rules" class="readonly" readonly="readonly" rows="6"><?php echo esc_html( trim( $file_source_rules ) ); ?></textarea>
+	</fieldset>
+</form>
+
+<?php
+}
+?>
+
+</div>
+
+<?php
+
+bb_get_admin_footer();
diff --git a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-admin/options-reading.php b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-admin/options-reading.php
index b70ac9333c746c3046d3c50b60e02b7b450774d7..2fa021c5b50b451573f26fe364ff6a6efc90dffb 100644
--- a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-admin/options-reading.php
+++ b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-admin/options-reading.php
@@ -1,6 +1,6 @@
 <?php
 
-require_once('admin.php');
+require_once( 'admin.php' );
 
 if ( 'post' == strtolower( $_SERVER['REQUEST_METHOD'] ) && $_POST['action'] == 'update') {
 	
@@ -24,15 +24,23 @@ if ( 'post' == strtolower( $_SERVER['REQUEST_METHOD'] ) && $_POST['action'] == '
 	exit;
 }
 
-if ( !empty($_GET['updated']) ) {
-	bb_admin_notice( __( '<strong>Settings saved.</strong>' ) );
-}
+if ( !empty( $_GET['updated'] ) )
+	bb_admin_notice( '<strong>' . __( 'Settings saved.' ) . '</strong>' );
 
 $reading_options = array(
 	'page_topics' => array(
 		'title' => __( 'Items per page' ),
 		'class' => 'short',
-		'note' => __( 'Number of topics, posts or tags to show per page.' ),
+		'note' => __( 'Number of topics, posts or tags to show per page.' )
+	),
+	'name_link_profile' => array(
+		'title' => __( 'Link name to' ),
+		'type' => 'radio',
+		'options' => array(
+			0 => __( 'Website' ),
+			1 => __( 'Profile' )
+		),
+		'note' => __( 'What should the user\'s name link to on the topic page? The user\'s title would automatically get linked to the option you don\'t choose. By default, the user\'s name is linked to his/her website.' )
 	)
 );
 
@@ -44,10 +52,10 @@ bb_get_admin_header();
 
 <div class="wrap">
 
-<h2><?php _e('Reading Settings'); ?></h2>
+<h2><?php _e( 'Reading Settings' ); ?></h2>
 <?php do_action( 'bb_admin_notices' ); ?>
 
-<form class="settings" method="post" action="<?php bb_uri('bb-admin/options-reading.php', null, BB_URI_CONTEXT_FORM_ACTION + BB_URI_CONTEXT_BB_ADMIN); ?>">
+<form class="settings" method="post" action="<?php bb_uri( 'bb-admin/options-reading.php', null, BB_URI_CONTEXT_FORM_ACTION + BB_URI_CONTEXT_BB_ADMIN ); ?>">
 	<fieldset>
 <?php
 foreach ( $reading_options as $option => $args ) {
@@ -58,7 +66,7 @@ foreach ( $reading_options as $option => $args ) {
 	<fieldset class="submit">
 		<?php bb_nonce_field( 'options-reading-update' ); ?>
 		<input type="hidden" name="action" value="update" />
-		<input class="submit" type="submit" name="submit" value="<?php _e('Save Changes') ?>" />
+		<input class="submit" type="submit" name="submit" value="<?php _e( 'Save Changes' ) ?>" />
 	</fieldset>
 </form>
 
diff --git a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-admin/options-wordpress.php b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-admin/options-wordpress.php
index 8994e7308b53995775c89038f5bb21a18f1925ae..7158f78e00b642a41c1f1d18857662c399591876 100644
--- a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-admin/options-wordpress.php
+++ b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-admin/options-wordpress.php
@@ -62,6 +62,8 @@ $wpRoles = array(
 	'subscriber'    => __('WordPress Subscriber')
 );
 
+$wpRoles = apply_filters( 'role_map_wp_roles', $wpRoles );
+
 $cookie_options = array(
 	'wp_siteurl' => array(
 		'title' => __( 'WordPress address (URL)' ),
diff --git a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-admin/options-writing.php b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-admin/options-writing.php
index a98e4271ad60b40acdae093dfecd4adb973bd58f..d8611f2b62e52e6a91dcba58ffe46e9cc51b8445 100644
--- a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-admin/options-writing.php
+++ b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-admin/options-writing.php
@@ -2,17 +2,17 @@
 
 require_once('admin.php');
 
-if ( 'post' == strtolower( $_SERVER['REQUEST_METHOD'] ) && $_POST['action'] == 'update') {
+if ( 'post' == strtolower( $_SERVER['REQUEST_METHOD'] ) && $_POST['action'] == 'update' ) {
 	
 	bb_check_admin_referer( 'options-writing-update' );
 	
 	// Deal with xmlrpc checkbox when it isn't checked
-	if (!isset($_POST['enable_xmlrpc'])) {
+	if ( !isset( $_POST['enable_xmlrpc'] ) ) {
 		$_POST['enable_xmlrpc'] = false;
 	}
 	
 	foreach ( (array) $_POST as $option => $value ) {
-		if ( !in_array( $option, array('_wpnonce', '_wp_http_referer', 'action', 'submit') ) ) {
+		if ( !in_array( $option, array( '_wpnonce', '_wp_http_referer', 'action', 'submit' ) ) ) {
 			$option = trim( $option );
 			$value = is_array( $value ) ? $value : trim( $value );
 			$value = stripslashes_deep( $value );
@@ -24,8 +24,8 @@ if ( 'post' == strtolower( $_SERVER['REQUEST_METHOD'] ) && $_POST['action'] == '
 		}
 	}
 	
-	$goback = add_query_arg('updated', 'true', wp_get_referer());
-	bb_safe_redirect($goback);
+	$goback = add_query_arg( 'updated', 'true', wp_get_referer() );
+	bb_safe_redirect( $goback );
 	exit;
 }
 
@@ -39,6 +39,12 @@ $general_options = array(
 		'class' => 'short',
 		'after' => __( 'minutes' ),
 		'note' => __( 'A user can edit a post for this many minutes after submitting.' ),
+	),
+	'throttle_time' => array(
+		'title' => __( 'Throttle time' ),
+		'class' => 'short',
+		'after' => __( 'seconds' ),
+		'note' => __( 'Users must wait this many seconds between posts. By default, moderators, administrators and keymasters are not throttled.' )
 	)
 );
 
@@ -60,13 +66,13 @@ bb_get_admin_header();
 
 <div class="wrap">
 
-<h2><?php _e('Writing Settings'); ?></h2>
+<h2><?php _e( 'Writing Settings' ); ?></h2>
 <?php do_action( 'bb_admin_notices' ); ?>
 
 <form class="settings" method="post" action="<?php bb_uri( 'bb-admin/options-writing.php', null, BB_URI_CONTEXT_FORM_ACTION + BB_URI_CONTEXT_BB_ADMIN ); ?>">
 	<fieldset><?php foreach ( $general_options as $option => $args ) bb_option_form_element( $option, $args ); ?></fieldset>
 	<fieldset>
-		<legend><?php _e('Remote Publishing'); ?></legend>
+		<legend><?php _e( 'Remote Publishing' ); ?></legend>
 		<p>
 			<?php _e( 'To interact with bbPress from a desktop client or remote website that uses the XML-RPC publishing interface you must enable it below.' ); ?>
 		</p>
@@ -75,7 +81,7 @@ bb_get_admin_header();
 	<fieldset class="submit">
 		<?php bb_nonce_field( 'options-writing-update' ); ?>
 		<input type="hidden" name="action" value="update" />
-		<input class="submit" type="submit" name="submit" value="<?php _e('Save Changes') ?>" />
+		<input class="submit" type="submit" name="submit" value="<?php _e( 'Save Changes' ); ?>" />
 	</fieldset>
 </form>
 
diff --git a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-admin/posts.php b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-admin/posts.php
index cb0f997bc3f7730b5d523b3f1a0b4db21841e841..1f26f1764bfa8ecc0efc6a10bec6afd6f6f7697c 100644
--- a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-admin/posts.php
+++ b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-admin/posts.php
@@ -1,22 +1,56 @@
 <?php
 require_once('admin.php');
 
+if ( 'post' == strtolower( $_SERVER['REQUEST_METHOD'] ) ) {
+	bb_check_admin_referer( 'post-bulk' );
+
+	$post_ids = array_map( 'absint', $_POST['post'] );
+
+	$count = 0;
+
+	$action = trim( $_POST['action'] );
+
+	switch ( $action ) {
+	case 'delete' :
+		foreach ( $post_ids as $post_id ) {
+			$count += (int) (bool) bb_delete_post( $post_id, 1 );
+		}
+		$query_vars = array( 'message' => 'deleted', 'count' => $count );
+		break;
+	case 'undelete' :
+		foreach ( $post_ids as $post_id ) {
+			$count += (int) (bool) bb_delete_post( $post_id, 0 );
+		}
+		$query_vars = array( 'message' => 'undeleted', 'count' => $count );
+		break;
+	default :
+		if ( $action )
+			$query_vars = apply_filters( "bulk_post__$action", array(), $post_ids, $action );
+		break;
+	}
+
+	bb_safe_redirect( add_query_arg( $query_vars ) );
+	exit;
+}
+
 if ( !empty( $_GET['message'] ) ) {
+	$message_count = isset( $_GET['count'] ) ? (int) $_GET['count'] : 1;
+
 	switch ( (string) $_GET['message'] ) {
 		case 'undeleted':
-			bb_admin_notice( __( '<strong>Post undeleted.</strong>' ) );
+			bb_admin_notice( sprintf( _n( '<strong>Post undeleted.</strong>', '<strong>%s posts undeleted.</strong>', $message_count ), bb_number_format_i18n( $message_count ) ) );
 			break;
 		case 'deleted':
-			bb_admin_notice( __( '<strong>Post deleted.</strong>' ) );
+			bb_admin_notice( sprintf( _n( '<strong>Post deleted.</strong>', '<strong>%s posts deleted.</strong>', $message_count ), bb_number_format_i18n( $message_count ) ) );
 			break;
 		case 'spammed':
-			bb_admin_notice( __( '<strong>Post spammed.</strong>' ) );
+			bb_admin_notice( sprintf( _n( '<strong>Post spammed.</strong>', '<strong>%s posts spammed.</strong>', $message_count ), bb_number_format_i18n( $message_count ) ) );
 			break;
 		case 'unspammed-normal':
-			bb_admin_notice( __( '<strong>Post removed from spam.</strong> It is now a normal post.' ) );
+			bb_admin_notice( sprintf( _n( '<strong>Post removed from spam.</strong> It is now a normal post.', '<strong>%s posts removed from spam.</strong> They are now normal posts.', $message_count ), bb_number_format_i18n( $message_count ) ) );
 			break;
 		case 'unspammed-deleted':
-			bb_admin_notice( __( '<strong>Post removed from spam.</strong> It is now a deleted post.' ) );
+			bb_admin_notice( sprintf( _n( '<strong>Post removed from spam.</strong> It is now a deleted post.', '<strong>%s posts removed from spam.</strong> They are nowdeleted posts.', $message_count ), bb_number_format_i18n( $message_count ) ) );
 			break;
 	}
 }
@@ -72,9 +106,48 @@ if ( $h2_search || $h2_forum || $h2_tag || $h2_author || $h2_ip ) {
 }
 ?>
 </h2>
-<?php do_action( 'bb_admin_notices' ); ?>
+<?php
 
-<?php $post_query->form( array( 'poster_ip' => $ip_available, 'tag' => true, 'post_author' => true, 'post_status' => true, 'submit' => __( 'Filter' ) ) ); ?>
+do_action( 'bb_admin_notices' );
+
+$post_query->form( array( 'poster_ip' => $ip_available, 'tag' => true, 'post_author' => true, 'post_status' => true, 'submit' => __( 'Filter' ) ) );
+
+$bulk_actions = array(
+	'delete' => __( 'Delete' ),
+	'undelete' => __( 'Undelete' ),
+);
+
+if ( is_numeric( $bulk_action = $post_query->get( 'post_status' ) ) ) {
+	switch ( $bulk_action ) {
+	case 0 :
+		unset( $bulk_actions['undelete'] );
+		break;
+	case 1 : 
+		unset( $bulk_actions['delete'] );
+	}
+}
+
+unset( $bulk_action );
+
+do_action_ref_array( 'bulk_post_actions', array( &$bulk_actions, &$post_query ) );
+
+?>
+
+<div class="clear"></div>
+
+<form class="table-form bulk-form" method="post" action="">
+
+<fieldset>
+	<select name="action">
+		<option><?php _e( 'Bulk Actions' ); ?></option>
+<?php	foreach ( $bulk_actions as $value => $label ) : ?>
+
+		<option value="<?php echo esc_attr( $value ); ?>"><?php echo esc_html( $label ); ?></option>
+<?php	endforeach; ?>
+	</select>
+	<input type="submit" value="<?php esc_attr_e( 'Apply' ); ?>" class="button submit-input" />
+	<?php bb_nonce_field( 'post-bulk' ); ?>
+</fieldset>
 
 <div class="tablenav">
 <?php if ( $total ) : ?>
@@ -100,10 +173,13 @@ echo $page_number_links = get_page_number_links( $_page_link_args );
 	</div>
 <?php endif; ?>
 </div>
+
 <div class="clear"></div>
 
 <?php bb_admin_list_posts(); ?>
 
+</form>
+
 <div class="tablenav bottom">
 <?php if ( $total ) : ?>
 	<div class="tablenav-pages">
diff --git a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-admin/style-rtl.css b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-admin/style-rtl.css
index 85a52a4296a9fd27757b50ee1142f90585cbb431..d9bff992fef9e93a6cf81b84b885b9706756959f 100644
--- a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-admin/style-rtl.css
+++ b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-admin/style-rtl.css
@@ -304,7 +304,8 @@ div.dashboard div.versions p.theme a.button {
 
 /* Search forms */
 
-form.search-form fieldset {
+form.search-form fieldset, form.bulk-form fieldset {
+	clear: right;
 	float: right;
 }
 
@@ -345,7 +346,10 @@ table#plugins-list.widefat tr.autoload td.plugin-name {
 	padding-left: 20px;
 }
 
-
+table.widefat .check-column {
+	padding-right: 7px;
+	padding-left: 0;
+}
 
 /* Forums */
 
@@ -432,6 +436,11 @@ form.settings a.cancel {
 	margin-left: 6px;
 }
 
+form.settings select#timezone-string option {
+	margin-left: auto;
+	margin-right: 1em;
+}
+
 
 
 /* Footer */
@@ -453,4 +462,4 @@ p#bbThanks {
 
 p#bbVersion {
 	text-align: left;
-}
\ No newline at end of file
+}
diff --git a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-admin/style.css b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-admin/style.css
index 4fc7e27f2c9473982b810e5529b8a34e9177e7af..9d359ce509fbd9ddb9b4cf4b605ac147c520eb52 100644
--- a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-admin/style.css
+++ b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-admin/style.css
@@ -60,6 +60,15 @@ div#bbContent {
 }
 
 
+pre {
+	/* http://www.longren.org/2006/09/27/wrapping-text-inside-pre-tags/ */
+	white-space: pre-wrap; /* css-3 */
+	white-space: -moz-pre-wrap !important; /* Mozilla, since 1999 */
+	white-space: -pre-wrap; /* Opera 4-6 */
+	white-space: -o-pre-wrap; /* Opera 7 */
+	word-wrap: break-word; /* Internet Explorer 5.5+ */
+}
+
 /* Header */
 
 div#bbHead {
@@ -203,6 +212,12 @@ body.bb-admin-users h2 {
 	background-position: 0 -891px;
 }
 
+body.bb-admin-user-manage h2 {
+       padding-left: 47px;
+       background-image: url('images/icons32.png');
+       background-position: 0 -891px;
+}
+
 body.bb-admin-tools h2 {
 	padding-left: 47px;
 	background-image: url('images/icons32.png');
@@ -822,8 +837,9 @@ div.dashboard ul li a {
 
 /* Search forms */
 
-form.search-form fieldset {
+form.search-form fieldset, form.bulk-form fieldset {
 	margin: 10px 0 0 0;
+	clear: left;
 	float: left;
 }
 
@@ -863,7 +879,7 @@ form.search-form fieldset div div input.checkbox-input {
 	margin: 4px;
 }
 
-form.search-form fieldset div div select {
+form.search-form select, form.bulk-form select {
 	height: 2.1em;
 	margin: 0;
 	padding: 3px;
@@ -887,7 +903,7 @@ form.search-form div.submit label {
 	overflow: hidden;
 }
 
-form.search-form div.submit input.button {
+form.search-form div.submit input.button, form.bulk-form input.button {
 	font-family: 'Lucida Grande', Verdana, Arial, 'Bitstream Vera Sans', sans-serif;
 	-moz-border-radius: 10px;
 	-khtml-border-radius: 10px;
@@ -902,12 +918,12 @@ form.search-form div.submit input.button {
 	font-size: 0.85em;
 }
 
-form.search-form div.submit input.button:hover {
+form.search-form div.submit input.button:hover, form.bulk-form input.button:hover {
 	border-color: rgb(102, 102, 102);
 	color: rgb(0, 0, 0);
 }
 
-form.search-form div.submit input.button:active {
+form.search-form div.submit input.button:active, form.bulk-form input.button:active {
 	background: url('images/white-grad-active.png') repeat-x scroll rgb(238, 238, 238);
 }
 
@@ -916,9 +932,14 @@ form.search-form div.submit input.button:active {
 /* Table nav */
 
 div.tablenav {
+	margin-top: -1em;
 	float: right;
 }
 
+div.bottom {
+	margin-top: 0;
+}
+
 div.tablenav a {
 	color: rgb(0, 102, 0);
 }
@@ -1108,6 +1129,11 @@ table.widefat tfoot tr th {
 	border-bottom-width: 0;
 }
 
+table.widefat .check-column {
+	width: 2.2em;
+	padding-right: 0;
+}
+	
 table#posts-list.widefat tr td.post {
 	width: 46%;
 	font-size: 0.9em;
@@ -1210,6 +1236,7 @@ table.widefat tr td code,
 table.widefat tr td kbd {
 	font-family: Consolas, Monaco, Courier, monospace;
 	font-size: 1.2em;
+	line-height: 1.4;
 	background: rgb(234, 234, 234);
 	margin: 0px 1px;
 	padding: 1px 3px;
@@ -1459,6 +1486,53 @@ table.theme-list-active td a:hover {
 }
 
 
+/* Users */
+
+.bb-admin-user-manage form {
+	width: 550px;
+}
+
+#option-pass-strength-fake-input {
+	clear: none;
+	width: 200px;
+}
+.bb-admin-user-manage #pass-strength-result {
+	clear: left;
+	float: left;
+	margin-top: -25px;
+}
+
+#pass-strength-result {
+	padding: 2px;
+	text-align: center;
+	width: 280px;
+	border: 1px solid #ccc;
+	background-color: #e3e3e3;
+	-moz-border-radius: 3px;
+	-khtml-border-radius: 3px;
+	-webkit-border-radius: 3px;
+	border-radius: 3px;
+}
+
+#pass-strength-result.bad {
+	background-color: #ffeff7;
+	border-color: #c69;
+}
+
+#pass-strength-result.good {
+	background-color: #effff4;
+	border-color: #66cc87;
+}
+
+#pass-strength-result.short {
+	background-color: #e3e3e3;
+}
+
+#pass-strength-result.strong {
+	background-color: #59ef86;
+	border-color: #319f52;
+}
+
 
 /* Options */
 
@@ -1644,7 +1718,7 @@ form.settings div.table {
 	border-radius: 4px;
 	border: 1px solid rgb(223, 223, 223);
 	background-color: rgb(221, 221, 221);
-	width: 300px;
+	width: 400px;
 }
 
 form.settings div.table table {
@@ -1744,6 +1818,10 @@ form.settings textarea#rewrite-rules {
 	width: 99%;
 }
 
+form.settings select#timezone-string option {
+	margin-left: 1em;
+}
+
 
 /* Footer */
 
diff --git a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-admin/tag-destroy.php b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-admin/tag-destroy.php
index 6a9b317065804424e234b321a20720d4992ebc7f..e4fc38e43f8e2803f5091922f9c908fc505ca434 100644
--- a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-admin/tag-destroy.php
+++ b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-admin/tag-destroy.php
@@ -1,22 +1,20 @@
 <?php
-require('admin.php');
 
-if ( !bb_current_user_can('manage_tags') )
-	bb_die(__('You are not allowed to manage tags.'));
+require( 'admin.php' );
+
+if ( !bb_current_user_can( 'manage_tags' ) )
+	bb_die( __( 'You are not allowed to manage tags.' ) );
 
 $tag_id = (int) $_POST['id' ];
 
 bb_check_admin_referer( 'destroy-tag_' . $tag_id );
 
-$old_tag = bb_get_tag( $tag_id );
-if ( !$old_tag )
-	bb_die(__('Tag not found.'));
+if ( !$old_tag = bb_get_tag( $tag_id ) )
+	bb_die( __( 'Tag not found.' ) );
+
+if ( bb_destroy_tag( $tag_id ) )
+	bb_die( __( 'That tag was successfully destroyed' ) );
+else
+	bb_die( printf( __( "Something odd happened when attempting to destroy that tag.<br />\n<a href=\"%s\">Try Again?</a>" ), wp_get_referer() ) ) ;
 
-if ( $destroyed = bb_destroy_tag( $tag_id ) ) {
-	printf(__("Rows deleted from tags table: %d <br />\n"), $destroyed['tags']);
-	printf(__("Rows deleted from tagged table: %d <br />\n"), $destroyed['tagged']);
-	printf(__('<a href="%s">Home</a>'), bb_get_uri());
-} else {
-   die(printf(__("Something odd happened when attempting to destroy that tag.<br />\n<a href=\"%s\">Try Again?</a>"), wp_get_referer()));
-}
 ?>
diff --git a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-admin/tag-merge.php b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-admin/tag-merge.php
index 6f7680e46ebe4fe1d1bf730f12145f28639690dd..2a44c6bb8012ac26d623dac3010139f64ebd2197 100644
--- a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-admin/tag-merge.php
+++ b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-admin/tag-merge.php
@@ -1,26 +1,29 @@
 <?php
-require('admin.php');
 
-if ( !bb_current_user_can('manage_tags') )
-	bb_die(__('You are not allowed to manage tags.'));
+require( 'admin.php' );
+
+if ( !bb_current_user_can( 'manage_tags' ) )
+	bb_die( __( 'You are not allowed to manage tags.' ) );
 
 $old_id = (int) $_POST['id' ];
-$tag = $_POST['tag'];
+$tag    =       $_POST['tag'];
 
 bb_check_admin_referer( 'merge-tag_' . $old_id );
 
 if ( ! $tag = bb_get_tag( $tag ) )
-	bb_die(__('Tag specified not found.'));
+	bb_die( __( 'The destination tag you specified could not be found.' ) );
 
 if ( ! bb_get_tag( $old_id ) )
-	bb_die(__('Tag to be merged not found.'));
-
-if ( $merged = bb_merge_tags( $old_id, $tag->tag_id ) ) {
-	printf(__("Number of topics from which the old tag was removed: %d <br />\n"),  $merged['old_count']);
-    printf(__("Number of topics to which the new tag was added: %d <br />\n"),$merged['diff_count']);
-	printf(__("Number of rows deleted from tags table:%d <br />\n"),$merged['destroyed']['tags']);
-	printf(__('<a href="%s">New Tag</a>'), bb_get_tag_link());
-} else {
-   die(printf(__("Something odd happened when attempting to merge those tags.<br />\n<a href=\"%s\">Try Again?</a>"), wp_get_referer()));
-}
+	bb_die( __( 'The original tag could not be found.' ) );
+
+if ( $merged = bb_merge_tags( $old_id, $tag->tag_id ) )
+	bb_die(
+		sprintf( __( "Number of topics from which the old tag was removed: %d <br />\n"),  $merged['old_count'] ) .
+		sprintf( __( "Number of topics to which the new tag was added: %d <br />\n"),$merged['diff_count'] ) .
+		sprintf( __( "Number of rows deleted from tags table:%d <br />\n"),$merged['destroyed']['tags'] ) .
+		sprintf( __( '<a href="%s">View Results of Merge</a>'), bb_get_tag_link() )
+	);
+else
+	bb_die( printf( __( "Something odd happened when attempting to merge those tags.<br />\n<a href=\"%s\">Try Again?</a>" ), wp_get_referer() ) );
+
 ?>
diff --git a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-admin/tag-rename.php b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-admin/tag-rename.php
index cf15cb2de644fa87733947019ae6aed383a1e1ae..19933db4a509394741fe641eb357171bad10777f 100644
--- a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-admin/tag-rename.php
+++ b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-admin/tag-rename.php
@@ -1,22 +1,23 @@
 <?php
-require('admin.php');
 
-if ( !bb_current_user_can('manage_tags') )
-	bb_die(__('You are not allowed to manage tags.'));
+require( 'admin.php' );
+
+if ( !bb_current_user_can( 'manage_tags' ) )
+	bb_die( __( 'You are not allowed to manage tags.' ) );
 
 $tag_id = (int) $_POST['id' ];
-$tag    =       $_POST['tag'];
+$tag    = stripslashes( $_POST['tag'] );
 
 bb_check_admin_referer( 'rename-tag_' . $tag_id );
 
-$old_tag = bb_get_tag( $tag_id );
-if ( !$old_tag )
-	bb_die(__('Tag not found.'));
+if ( !$old_tag = bb_get_tag( $tag_id ) )
+	bb_die( __( 'Tag not found.' ) );
 
-$tag = stripslashes( $tag );
 if ( $tag = bb_rename_tag( $tag_id, $tag ) )
 	wp_redirect( bb_get_tag_link() );
 else
-	die(printf(__('There already exists a tag by that name or the name is invalid. <a href="%s">Try Again</a>'), wp_get_referer()));
+	bb_die( printf( __( 'There already exists a tag by that name or the name is invalid. <a href="%s">Try Again</a>'), wp_get_referer() ) );
+
 exit;
+
 ?>
diff --git a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-admin/tools-recount.php b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-admin/tools-recount.php
index 6360864947915e2ab36a192efb711351269273ee..b1a486d67571ed708181c4844626e19e35fc30c7 100644
--- a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-admin/tools-recount.php
+++ b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-admin/tools-recount.php
@@ -9,46 +9,61 @@ if ( 'post' == strtolower( $_SERVER['REQUEST_METHOD'] ) ) {
 	$messages = array();
 
 	if ( !empty( $_POST['topic-posts'] ) ) {
-		$messages[] = bb_recount_topic_posts();
+		$message = bb_recount_topic_posts();
+		$messages[] = $message[1];
 	}
 
 	if ( !empty( $_POST['topic-voices'] ) ) {
-		$messages[] = bb_recount_topic_voices();
+		$message = bb_recount_topic_voices();
+		$messages[] = $message[1];
 	}
 
 	if ( !empty( $_POST['topic-deleted-posts'] ) ) {
-		$messages[] = bb_recount_topic_deleted_posts();
+		$message = bb_recount_topic_deleted_posts();
+		$messages[] = $message[1];
 	}
 
 	if ( !empty( $_POST['forums'] ) ) {
-		$messages[] = bb_recount_forum_topics();
-		$messages[] = bb_recount_forum_posts();
+		$message = bb_recount_forum_topics();
+		$messages[] = $message[1];
+		$message = bb_recount_forum_posts();
+		$messages[] = $message[1];
 	}
 
 	if ( !empty( $_POST['topics-replied'] ) ) {
-		$messages[] = bb_recount_user_topics_replied();
+		$message = bb_recount_user_topics_replied();
+		$messages[] = $message[1];
 	}
 
 	if ( !empty( $_POST['topic-tag-count'] ) ) {
-		$messages[] = bb_recount_topic_tags();
+		$message = bb_recount_topic_tags();
+		$messages[] = $message[1];
 	}
 
 	if ( !empty( $_POST['tags-tag-count'] ) ) {
-		$messages[] = bb_recount_tag_topics();
+		$message = bb_recount_tag_topics();
+		$messages[] = $message[1];
 	}
 
 	if ( !empty( $_POST['tags-delete-empty'] ) ) {
-		$messages[] = bb_recount_tag_delete_empty();
+		$message = bb_recount_tag_delete_empty();
+		$messages[] = $message[1];
 	}
 
 	if ( !empty( $_POST['clean-favorites'] ) ) {
-		$messages[] = bb_recount_clean_favorites();
+		$message = bb_recount_clean_favorites();
+		$messages[] = $message[1];
 	}
 
 	bb_recount_list();
 	foreach ( (array) $recount_list as $item ) {
 		if ( isset($item[2]) && isset($_POST[$item[0]]) && 1 == $_POST[$item[0]] && is_callable($item[2]) ) {
-			$messages[] = call_user_func( $item[2] );
+			$message = call_user_func( $item[2] );
+			if ( is_array( $message ) ) {
+				$messages[] = $message[1];
+			} else {
+				$messages[] = $message;
+			}
 		}
 	}
 
diff --git a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-admin/topics.php b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-admin/topics.php
index d74308f0c0562e8b48a491b7a3121c759d0756ae..c481f1a8817c0983f2c7d40565b0a02a5a689232 100644
--- a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-admin/topics.php
+++ b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-admin/topics.php
@@ -1,19 +1,65 @@
 <?php
 require_once('admin.php');
 
+if ( 'post' == strtolower( $_SERVER['REQUEST_METHOD'] ) ) {
+	bb_check_admin_referer( 'topic-bulk' );
+
+	$topic_ids = array_map( 'absint', $_POST['topic'] );
+
+	$affected = 0;
+
+	$action = trim( $_POST['action'] );
+
+	switch ( $action ) {
+	case 'close' :
+		foreach ( $topic_ids as $topic_id ) {
+			$affected += bb_close_topic( $topic_id );
+		}
+		$query_vars = array( 'message' => 'closed', 'count' => $affected );
+		break;
+	case 'open' :
+		foreach ( $topic_ids as $topic_id ) {
+			$affected += bb_open_topic( $topic_id );
+		}
+		$query_vars = array( 'message' => 'opened', 'count' => $affected );
+		break;
+	case 'delete' :
+		foreach ( $topic_ids as $topic_id ) {
+			$affected += (int) (bool) bb_delete_topic( $topic_id, 1 );
+		}
+		$query_vars = array( 'message' => 'deleted', 'count' => $affected );
+		break;
+	case 'undelete' :
+		foreach ( $topic_ids as $topic_id ) {
+			$affected += (int) (bool) bb_delete_topic( $topic_id, 0 );
+		}
+		$query_vars = array( 'message' => 'undeleted', 'count' => $affected );
+		break;
+	default :
+		if ( $action )
+			$query_vars = apply_filters( "bulk_topic__$action", array(), $topic_ids );
+		break;
+	}
+
+	bb_safe_redirect( add_query_arg( $query_vars ) );
+	exit;
+}
+
 if ( !empty( $_GET['message'] ) ) {
+	$message_count = isset( $_GET['count'] ) ? (int) $_GET['count'] : 1;
+
 	switch ( (string) $_GET['message'] ) {
 		case 'undeleted':
-			bb_admin_notice( __( '<strong>Topic undeleted.</strong>' ) );
+			bb_admin_notice( sprintf( _n( '<strong>Topic undeleted.</strong>', '<strong>%s topics undeleted.</strong>', $message_count ), bb_number_format_i18n( $message_count ) ) );
 			break;
 		case 'deleted':
-			bb_admin_notice( __( '<strong>Topic deleted.</strong>' ) );
+			bb_admin_notice( sprintf( _n( '<strong>Topic deleted.</strong>', '<strong>%s topics deleted.</strong>', $message_count ), bb_number_format_i18n( $message_count ) ) );
 			break;
 		case 'opened':
-			bb_admin_notice( __( '<strong>Topic opened.</strong>' ) );
+			bb_admin_notice( sprintf( _n( '<strong>Topic opened.</strong>', '<strong>%s topics opened.</strong>', $message_count ), bb_number_format_i18n( $message_count ) ) );
 			break;
 		case 'closed':
-			bb_admin_notice( __( '<strong>Topic closed.</strong>' ) );
+			bb_admin_notice( sprintf( _n( '<strong>Topic closed.</strong>', '<strong>%s topics closed.</strong>', $message_count ), bb_number_format_i18n( $message_count ) ) );
 			break;
 	}
 }
@@ -63,6 +109,49 @@ if ( $h2_search || $h2_forum || $h2_tag || $h2_author ) {
 
 <?php $topic_query->form( array('tag' => true, 'topic_author' => true, 'topic_status' => true, 'open' => true, 'submit' => __('Filter')) ); ?>
 
+<div class="clear"></div>
+
+<?php if ( !$topics ) : ?>
+
+<p class="no-results"><?php _e('No topics found.'); ?></p>
+
+<?php
+
+else :
+	bb_cache_first_posts( $topics ); bb_cache_last_posts( $topics );
+
+	$bulk_actions = array(
+		'delete' => __( 'Delete' ),
+		'undelete' => __( 'Undelete' ),
+		'open' => __( 'Open' ),
+		'close' => __( 'Close' ),
+	);
+
+	if ( is_numeric( $bulk_action = $topic_query->get( 'topic_status' ) ) )
+		unset( $bulk_actions[ $bulk_action ? 'delete' : 'undelete' ] );
+
+
+	if ( is_numeric( $bulk_action = $topic_query->get( 'open' ) ) )
+		unset( $bulk_actions[ $bulk_action ? 'open' : 'close' ] );
+
+	unset( $bulk_action );
+
+	do_action_ref_array( 'bulk_topic_actions', array( &$bulk_actions, $topic_query ) );
+?>
+
+<form class="table-form bulk-form" method="post" action="">
+<fieldset>
+	<select name="action">
+		<option><?php _e( 'Bulk Actions' ); ?></option>
+<?php	foreach ( $bulk_actions as $value => $label ) : ?>
+
+		<option value="<?php echo esc_attr( $value ); ?>"><?php echo esc_html( $label ); ?></option>
+<?php	endforeach; ?>
+	</select>
+	<input type="submit" value="<?php esc_attr_e( 'Apply' ); ?>" class="button submit-input" />
+	<?php bb_nonce_field( 'topic-bulk' ); ?>
+</fieldset>
+
 <div class="tablenav">
 <?php if ( $topic_query->found_rows ) : ?>
 	<div class="tablenav-pages">
@@ -87,17 +176,13 @@ echo $page_number_links = get_page_number_links( $_page_link_args );
 	</div>
 <?php endif; ?>
 </div>
-<div class="clear"></div>
-
-<?php if ( !$topics ) : ?>
 
-<p class="no-results"><?php _e('No topics found.'); ?></p>
-
-<?php else : bb_cache_first_posts( $topics ); bb_cache_last_posts( $topics ); ?>
+<div class="clear"></div>
 
 <table id="topics-list" class="widefat">
 <thead>
 <tr>
+	<th scope="col" class="check-column"><input type="checkbox" /></th>
 	<th scope="col"><?php _e('Topic') ?></th>
 	<th scope="col"><?php _e('Author') ?></th>
 	<th scope="col"><?php _e('Posts') ?></th>
@@ -107,6 +192,7 @@ echo $page_number_links = get_page_number_links( $_page_link_args );
 </thead>
 <tfoot>
 <tr>
+	<th scope="col" class="check-column"><input type="checkbox" /></th>
 	<th scope="col"><?php _e('Topic') ?></th>
 	<th scope="col"><?php _e('Author') ?></th>
 	<th scope="col"><?php _e('Posts') ?></th>
@@ -118,6 +204,7 @@ echo $page_number_links = get_page_number_links( $_page_link_args );
 <tbody>
 <?php foreach ( $topics as $topic ) : $first_post = bb_get_first_post( $topic ); ?>
 <tr id="topic-<?php echo $topic->topic_id; ?>"<?php topic_class(); ?>>
+	<td class="check-column"><input type="checkbox" name="topic[]" value="<?php echo $topic->topic_id; ?>" /></td>
 	<td class="topic">
 		<span class="row-title"><?php bb_topic_labels(); ?> <a href="<?php topic_link(); ?>"><?php topic_title(); ?></a></span>
 		<div>
@@ -162,7 +249,7 @@ echo $page_number_links = get_page_number_links( $_page_link_args );
 <?php endforeach; ?>
 </tbody>
 </table>
-
+</form>
 <?php endif; ?>
 
 <div class="tablenav bottom">
diff --git a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-admin/user-add-new.php b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-admin/user-add-new.php
new file mode 100644
index 0000000000000000000000000000000000000000..1ba092b617e693f4cfc93f56dbde5cfbec356a3d
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-admin/user-add-new.php
@@ -0,0 +1,49 @@
+<?php
+require_once('admin.php');
+
+$edit_user   = bb_get_user( bb_get_user_id( $_GET['user_id'] ) );
+$user_fields = bb_manage_user_fields( $edit_user );
+
+// Let it rip!
+
+// Header
+$bb_admin_body_class = 'bb-admin-user-manage';
+bb_get_admin_header();
+
+?>
+
+<div class="wrap">
+	<h2><?php _e( 'Add a new user' ); ?></h2>
+
+	<?php do_action( 'bb_admin_notices' ); ?>
+
+	<form class="settings" method="post" action="">
+		<fieldset>
+			<?php
+			foreach ( $user_fields as $field => $args ) {
+				bb_option_form_element( $field, $args );
+			}
+			?>
+			<noscript>
+				<?php _e( 'Disabled (requires JavaScript)' ); ?>
+			</noscript>
+			<script type="text/javascript" charset="utf-8">
+				if (typeof jQuery != 'undefined') {
+					jQuery('#user-login').attr( 'id', 'user_login' );
+					var meter = ('<div id="pass-strength-result">' + pwsL10n.short + '</div>');
+					jQuery('#option-pass-strength-fake-input div.inputs input').before( meter );
+				} else {
+					document.writeln('<?php echo str_replace( "'", "\'", __( 'Disabled.' ) ); ?>')
+				}
+			</script>
+		</fieldset>
+		<fieldset class="submit">
+			<?php bb_nonce_field( 'user-manage' ); ?>
+
+			<input type="hidden" name="action" value="create" />
+			<input class="submit" type="submit" name="submit" value="<?php _e( 'Create user' ); ?>" />
+		</fieldset>
+	</form>
+</div>
+
+<?php bb_get_admin_footer(); ?>
\ No newline at end of file
diff --git a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-admin/users.php b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-admin/users.php
index 6564a4d9aad64c46cf6440497fbc75817df7fa3c..284389f4140dcead878352ff59a8d9e8aee69cb8 100644
--- a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-admin/users.php
+++ b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-admin/users.php
@@ -1,22 +1,68 @@
 <?php
 require_once('admin.php');
 
-// Query the users
-$bb_user_search = new BB_User_Search(@$_GET['usersearch'], @$_GET['page'], @$_GET['userrole']);
+// Get all errors and print as notice
+if ( isset( $_GET['created'] ) )
+	bb_admin_notice( __( '<strong>User Created.</strong>' ) );
 
-$bb_admin_body_class = ' bb-admin-users';
+if ( isset( $_GET['updated'] ) )
+	bb_admin_notice( __( '<strong>User Updated.</strong>' ) );
 
-bb_get_admin_header();
-?>
+if ( isset( $_GET['action'] ) || isset( $_GET['user_id'] ) && ( 'edit' == $_GET['action'] || 'create' == $_GET['action'] ) ) {
 
-<div class="wrap">
+	$edit_user   = bb_get_user( bb_get_user_id( $_GET['user_id'] ) );
+	$user_fields = bb_manage_user_fields( $edit_user );
 
-<?php
-$bb_user_search->display( true, bb_current_user_can( 'edit_users' ) );
-?>
+	$bb_admin_body_class = 'bb-admin-user-manage';
+	bb_get_admin_header(); ?>
 
-</div>
+	<div class="wrap">
+		<h2><?php _e( 'Edit user' ); ?></h2>
 
-<?php
-bb_get_admin_footer();
-?>
+		<?php do_action( 'bb_admin_notices' ); ?>
+
+		<form class="settings" method="post" action="">
+			<fieldset>
+				<?php
+				foreach ( $user_fields as $field => $args ) {
+					bb_option_form_element( $field, $args );
+				}
+				?>
+				<noscript>
+					<?php _e( 'Disabled (requires JavaScript)' ); ?>
+				</noscript>
+				<script type="text/javascript" charset="utf-8">
+					if (typeof jQuery != 'undefined') {
+						jQuery('#user-login').attr( 'id', 'user_login' );
+						var meter = ('<div id="pass-strength-result">' + pwsL10n.short + '</div>');
+						jQuery('#option-pass-strength-fake-input div.inputs input').before( meter );
+					} else {
+						document.writeln('<?php echo str_replace( "'", "\'", __( 'Disabled.' ) ); ?>')
+					}
+				</script>
+			</fieldset>
+			<fieldset class="submit">
+				<?php bb_nonce_field( 'user-manage' ); ?>
+
+				<input type="hidden" name="action" value="update" />
+				<input class="submit" type="submit" name="submit" value="<?php _e( 'Update user' ); ?>" />
+			</fieldset>
+		</form>
+	</div>
+
+<?php } else {
+	// Query the users
+	$bb_user_search = new BB_User_Search( @$_GET['usersearch'], @$_GET['page'], @$_GET['userrole'] );
+
+	$bb_admin_body_class = ' bb-admin-users';
+	bb_get_admin_header(); ?>
+
+	<div class="wrap">
+
+		<?php $bb_user_search->display( true, bb_current_user_can( 'edit_users' ) ); ?>
+
+	</div>
+
+<?php } ?>
+
+<?php bb_get_admin_footer(); ?>
diff --git a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-config-sample.php b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-config-sample.php
index 0c1861a682ce14eb6999a3e6e52446af717b5a07..f073f06666a51d7911d31ec553f18c8798fd4a91 100644
--- a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-config-sample.php
+++ b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-config-sample.php
@@ -61,4 +61,3 @@ $bb_table_prefix = 'bb_';
  * BB_LANG to 'de' to enable German language support.
  */
 define( 'BB_LANG', '' );
-?>
diff --git a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-edit.php b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-edit.php
index 327a98aef595cbda9d4d27d6ccce9571ccdaa7cb..4c2a0791d5638994783ed7cfc7274910f240ae85 100644
--- a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-edit.php
+++ b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-edit.php
@@ -5,7 +5,7 @@ bb_auth('logged_in');
 
 $post_id = (int) $_POST['post_id'];
 
-$bb_post  = bb_get_post( $post_id );
+$bb_post = bb_get_post( $post_id );
 
 if ( !$bb_post ) {
 	wp_redirect( bb_get_uri(null, null, BB_URI_CONTEXT_HEADER) );
@@ -20,18 +20,40 @@ bb_check_admin_referer( 'edit-post_' . $post_id );
 if ( 0 != $bb_post->post_status && 'all' == $_GET['view'] ) // We're trying to edit a deleted post
 	add_filter('bb_is_first_where', 'bb_no_where');
 
+// Check possible anonymous user data
+$post_author = $post_email = $post_url = '';
+
+if ( !bb_get_user( get_post_author_id( $post_id ) ) ) {
+	if ( !$post_author = sanitize_user( trim( $_POST['author'] ) ) )
+		bb_die( __( 'Every post needs an author name!' ) );
+	elseif ( !$post_email = sanitize_email( trim( $_POST['email'] ) ) )
+		bb_die( __( 'Every post needs a valid email address!' ) );
+
+	if ( !empty( $_POST['url'] ) )
+		$post_url = esc_url( trim( $_POST['url'] ) );
+}
+
+// Loop through possible anonymous post data
+foreach( array('post_author', 'post_email', 'post_url') as $field ) {
+	if ( ! empty( $$field ) ) {
+		$post_data[$field] = $$field;
+	}
+}
+
+// Setup topic data
 if ( bb_is_first( $bb_post->post_id ) && bb_current_user_can( 'edit_topic', $bb_post->topic_id ) ) {
-	bb_insert_topic( array(
-		'topic_title' => stripslashes( $_POST['topic'] ),
-		'topic_id' => $bb_post->topic_id
-	) );
+
+	$post_data['topic_title'] = stripslashes( $_POST['topic'] );
+	$post_data['topic_id']    = $bb_post->topic_id;
+
+	bb_insert_topic( $post_data );
 }
 
-bb_insert_post( array(
-	'post_text' => stripslashes( $_POST['post_content'] ),
-	'post_id' => $post_id,
-	'topic_id' => $bb_post->topic_id
-) );
+// Setup post data
+$post_data['post_text'] = stripslashes( $_POST['post_content'] );
+$post_data['post_id']   = $post_id;
+
+bb_insert_post( $post_data );
 
 if ( $post_id ) {
 	if ( $_REQUEST['view'] === 'all' ) {
diff --git a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/action.subscribe.php b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/action.subscribe.php
new file mode 100644
index 0000000000000000000000000000000000000000..133f39ef77857624e694406c3950d1eae0e32c3d
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/action.subscribe.php
@@ -0,0 +1,29 @@
+<?php
+
+if ( !isset( $_GET['doit'] ) || 'bb-subscribe' != $_GET['doit'] ) // sanity check
+	bb_die( __( 'What are you trying to do, exactly?' ) );
+
+if ( !bb_is_subscriptions_active() )
+	bb_die( __( 'You can not subscribe to topics.' ) );
+
+if ( !isset( $_GET['topic_id'] ) )
+	bb_die( __( 'Missing topic ID!' ) );
+
+bb_auth( 'logged_in' );
+
+$topic_id = (int) $_GET['topic_id'];
+
+$topic = get_topic( $topic_id );
+if ( !$topic )
+	bb_die( __( 'Topic not found! What are you subscribing to?' ) );
+
+bb_check_admin_referer( 'toggle-subscribe_' . $topic_id );
+
+// Okay, we should be covered now
+
+if ( in_array( $_GET['and'], array( 'add', 'remove' ) ) )
+	bb_subscription_management( $topic->topic_id, $_GET['and'] );
+
+wp_redirect( get_topic_link( $topic_id, 1 ) );
+
+exit;
diff --git a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/backpress/class.bp-sql-schema-parser.php b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/backpress/class.bp-sql-schema-parser.php
index 86efec038c442a3f67d361af4e0bf93a7ba7ea12..a0eaeaf9853582f126134bdad3363e5892f83207 100644
--- a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/backpress/class.bp-sql-schema-parser.php
+++ b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/backpress/class.bp-sql-schema-parser.php
@@ -17,7 +17,7 @@ class BP_SQL_Schema_Parser
 		}
 
 		$null = '';
-		if ( $column_data['Null'] == 'NO' ) {
+		if ( $column_data['Null'] != 'YES' ) {
 			$null = 'NOT NULL';
 		}
 
@@ -440,7 +440,7 @@ class BP_SQL_Schema_Parser
 
 						if (
 							$_new_column_data['Type'] !== $_existing_table_columns[$_new_column_name]['Type'] ||
-							$_new_column_data['Null'] !== $_existing_table_columns[$_new_column_name]['Null'] ||
+							( 'YES' === $_new_column_data['Null'] xor 'YES' === $_existing_table_columns[$_new_column_name]['Null'] ) ||
 							$_new_column_data['Extra'] !== $_existing_table_columns[$_new_column_name]['Extra']
 						) {
 							// Change the structure for the column
diff --git a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/backpress/class.bp-user.php b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/backpress/class.bp-user.php
index 356e2bc4e2a3f0a36134950b4cab57e8de130c8f..584672f075e4f552d1f84a2f1dc6916a83016e84 100644
--- a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/backpress/class.bp-user.php
+++ b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/backpress/class.bp-user.php
@@ -184,7 +184,7 @@ class BP_User {
 		//Build $allcaps from role caps, overlay user's $caps
 		$this->allcaps = array();
 		foreach ( (array) $this->roles as $role ) {
-			$role =& $wp_roles->get_role( $role );
+			$role = $wp_roles->get_role( $role );
 			$this->allcaps = array_merge( (array) $this->allcaps, (array) $role->capabilities );
 		}
 		$this->allcaps = array_merge( (array) $this->allcaps, (array) $this->caps );
diff --git a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/backpress/class.ixr.php b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/backpress/class.ixr.php
index 86d62372c0183d9fa97f932cd41060be93355f2f..69c019e0547743ff96711e6302bf09dccc486672 100644
--- a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/backpress/class.ixr.php
+++ b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/backpress/class.ixr.php
@@ -1,18 +1,43 @@
 <?php
-// Last sync [WP11537]
-
+// Last sync [WP16063]
 /**
- * IXR - The Inutio XML-RPC Library
+ * IXR - The Incutio XML-RPC Library
+ *
+ * Copyright (c) 2010, Incutio Ltd.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ *  - Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *  - Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *  - Neither the name of Incutio Ltd. nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
+ * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
+ * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  *
  * @package IXR
  * @since 1.5
  *
- * @copyright Incutio Ltd 2002-2005
- * @version 1.7 (beta) 23rd May 2005
- * @author Simon Willison
- * @link http://scripts.incutio.com/xmlrpc/ Site
- * @link http://scripts.incutio.com/xmlrpc/manual.php Manual
- * @license BSD License http://www.opensource.org/licenses/bsd-license.php
+ * @copyright  Incutio Ltd 2010 (http://www.incutio.com)
+ * @version    1.7.4 7th September 2010
+ * @author     Simon Willison
+ * @link       http://scripts.incutio.com/xmlrpc/ Site/manual
+ * @license    http://www.opensource.org/licenses/bsd-license.php BSD
  */
 
 /**
@@ -25,14 +50,15 @@ class IXR_Value {
     var $data;
     var $type;
 
-    function IXR_Value ($data, $type = false) {
+    function IXR_Value($data, $type = false)
+    {
         $this->data = $data;
         if (!$type) {
             $type = $this->calculateType();
         }
         $this->type = $type;
         if ($type == 'struct') {
-            /* Turn all the values in the array in to new IXR_Value objects */
+            // Turn all the values in the array in to new IXR_Value objects
             foreach ($this->data as $key => $value) {
                 $this->data[$key] = new IXR_Value($value);
             }
@@ -44,7 +70,8 @@ class IXR_Value {
         }
     }
 
-    function calculateType() {
+    function calculateType()
+    {
         if ($this->data === true || $this->data === false) {
             return 'boolean';
         }
@@ -54,6 +81,7 @@ class IXR_Value {
         if (is_double($this->data)) {
             return 'double';
         }
+
         // Deal with IXR object types base64 and date
         if (is_object($this->data) && is_a($this->data, 'IXR_Date')) {
             return 'date';
@@ -61,16 +89,17 @@ class IXR_Value {
         if (is_object($this->data) && is_a($this->data, 'IXR_Base64')) {
             return 'base64';
         }
+
         // If it is a normal PHP object convert it in to a struct
         if (is_object($this->data)) {
-
             $this->data = get_object_vars($this->data);
             return 'struct';
         }
         if (!is_array($this->data)) {
             return 'string';
         }
-        /* We have an array - is it an array or a struct ? */
+
+        // We have an array - is it an array or a struct?
         if ($this->isStruct($this->data)) {
             return 'struct';
         } else {
@@ -78,8 +107,9 @@ class IXR_Value {
         }
     }
 
-    function getXml() {
-        /* Return XML for this value */
+    function getXml()
+    {
+        // Return XML for this value
         switch ($this->type) {
             case 'boolean':
                 return '<boolean>'.(($this->data) ? '1' : '0').'</boolean>';
@@ -119,8 +149,14 @@ class IXR_Value {
         return false;
     }
 
-    function isStruct($array) {
-        /* Nasty function to check if an array is a struct or not */
+    /**
+     * Checks whether or not the supplied array is a struct or not
+     *
+     * @param unknown_type $array
+     * @return boolean
+     */
+    function isStruct($array)
+    {
         $expected = 0;
         foreach ($array as $key => $value) {
             if ((string)$key != (string)$expected) {
@@ -133,18 +169,21 @@ class IXR_Value {
 }
 
 /**
- * IXR_Message
+ * IXR_MESSAGE
  *
  * @package IXR
  * @since 1.5
+ *
  */
-class IXR_Message {
+class IXR_Message
+{
     var $message;
     var $messageType;  // methodCall / methodResponse / fault
     var $faultCode;
     var $faultString;
     var $methodName;
     var $params;
+
     // Current variable stacks
     var $_arraystructs = array();   // The stack used to keep track of the current array/struct
     var $_arraystructstypes = array(); // Stack keeping track of if things are structs or array
@@ -155,12 +194,18 @@ class IXR_Message {
     var $_currentTagContents;
     // The XML parser
     var $_parser;
-    function IXR_Message ($message) {
-        $this->message = $message;
+
+    function IXR_Message($message)
+    {
+        $this->message =& $message;
     }
-    function parse() {
+
+    function parse()
+    {
         // first remove the XML declaration
-        $this->message = preg_replace('/<\?xml.*?\?'.'>/', '', $this->message);
+        // merged from WP #10698 - this method avoids the RAM usage of preg_replace on very large messages
+        $header = preg_replace( '/<\?xml.*?\?'.'>/', '', substr($this->message, 0, 100), 1);
+        $this->message = substr_replace($this->message, $header, 0, 100);
         if (trim($this->message) == '') {
             return false;
         }
@@ -171,13 +216,22 @@ class IXR_Message {
         xml_set_object($this->_parser, $this);
         xml_set_element_handler($this->_parser, 'tag_open', 'tag_close');
         xml_set_character_data_handler($this->_parser, 'cdata');
-        if (!xml_parse($this->_parser, $this->message)) {
-            /* die(sprintf('XML error: %s at line %d',
-                xml_error_string(xml_get_error_code($this->_parser)),
-                xml_get_current_line_number($this->_parser))); */
-            return false;
-        }
+        $chunk_size = 262144; // 256Kb, parse in chunks to avoid the RAM usage on very large messages
+        do {
+            if (strlen($this->message) <= $chunk_size) {
+                $final = true;
+            }
+            $part = substr($this->message, 0, $chunk_size);
+            $this->message = substr($this->message, $chunk_size);
+            if (!xml_parse($this->_parser, $part, $final)) {
+                return false;
+            }
+            if ($final) {
+                break;
+            }
+        } while (true);
         xml_parser_free($this->_parser);
+
         // Grab the error messages, if any
         if ($this->messageType == 'fault') {
             $this->faultCode = $this->params[0]['faultCode'];
@@ -185,7 +239,9 @@ class IXR_Message {
         }
         return true;
     }
-    function tag_open($parser, $tag, $attr) {
+
+    function tag_open($parser, $tag, $attr)
+    {
         $this->_currentTagContents = '';
         $this->currentTag = $tag;
         switch($tag) {
@@ -194,7 +250,7 @@ class IXR_Message {
             case 'fault':
                 $this->messageType = $tag;
                 break;
-            /* Deal with stacks of arrays and structs */
+                /* Deal with stacks of arrays and structs */
             case 'data':    // data is to all intents and puposes more interesting than array
                 $this->_arraystructstypes[] = 'array';
                 $this->_arraystructs[] = array();
@@ -205,28 +261,31 @@ class IXR_Message {
                 break;
         }
     }
-    function cdata($parser, $cdata) {
+
+    function cdata($parser, $cdata)
+    {
         $this->_currentTagContents .= $cdata;
     }
-    function tag_close($parser, $tag) {
+
+    function tag_close($parser, $tag)
+    {
         $valueFlag = false;
         switch($tag) {
             case 'int':
             case 'i4':
-                $value = (int) trim($this->_currentTagContents);
+                $value = (int)trim($this->_currentTagContents);
                 $valueFlag = true;
                 break;
             case 'double':
-                $value = (double) trim($this->_currentTagContents);
+                $value = (double)trim($this->_currentTagContents);
                 $valueFlag = true;
                 break;
             case 'string':
-                $value = $this->_currentTagContents;
+                $value = (string)trim($this->_currentTagContents);
                 $valueFlag = true;
                 break;
             case 'dateTime.iso8601':
                 $value = new IXR_Date(trim($this->_currentTagContents));
-                // $value = $iso->getTimestamp();
                 $valueFlag = true;
                 break;
             case 'value':
@@ -237,14 +296,14 @@ class IXR_Message {
                 }
                 break;
             case 'boolean':
-                $value = (boolean) trim($this->_currentTagContents);
+                $value = (boolean)trim($this->_currentTagContents);
                 $valueFlag = true;
                 break;
             case 'base64':
-                $value = base64_decode( trim( $this->_currentTagContents ) );
+                $value = base64_decode($this->_currentTagContents);
                 $valueFlag = true;
                 break;
-            /* Deal with stacks of arrays and structs */
+                /* Deal with stacks of arrays and structs */
             case 'data':
             case 'struct':
                 $value = array_pop($this->_arraystructs);
@@ -261,6 +320,7 @@ class IXR_Message {
                 $this->methodName = trim($this->_currentTagContents);
                 break;
         }
+
         if ($valueFlag) {
             if (count($this->_arraystructs) > 0) {
                 // Add value to struct or array
@@ -286,27 +346,40 @@ class IXR_Message {
  * @package IXR
  * @since 1.5
  */
-class IXR_Server {
+class IXR_Server
+{
     var $data;
     var $callbacks = array();
     var $message;
     var $capabilities;
-    function IXR_Server($callbacks = false, $data = false) {
+
+    function IXR_Server($callbacks = false, $data = false, $wait = false)
+    {
         $this->setCapabilities();
         if ($callbacks) {
             $this->callbacks = $callbacks;
         }
         $this->setCallbacks();
-        $this->serve($data);
+        if (!$wait) {
+            $this->serve($data);
+        }
     }
-    function serve($data = false) {
+
+    function serve($data = false)
+    {
         if (!$data) {
+            if (isset($_SERVER['REQUEST_METHOD']) && $_SERVER['REQUEST_METHOD'] !== 'POST') {
+            	header('Content-Type: text/plain'); // merged from WP #9093
+                die('XML-RPC server accepts POST requests only.');
+            }
+
             global $HTTP_RAW_POST_DATA;
-            if (!$HTTP_RAW_POST_DATA) {
-               header( 'Content-Type: text/plain' );
-               die('XML-RPC server accepts POST requests only.');
+            if (empty($HTTP_RAW_POST_DATA)) {
+                // workaround for a bug in PHP 5.2.2 - http://bugs.php.net/bug.php?id=41293
+                $data = file_get_contents('php://input');
+            } else {
+                $data =& $HTTP_RAW_POST_DATA;
             }
-            $data = $HTTP_RAW_POST_DATA;
         }
         $this->message = new IXR_Message($data);
         if (!$this->message->parse()) {
@@ -316,75 +389,83 @@ class IXR_Server {
             $this->error(-32600, 'server error. invalid xml-rpc. not conforming to spec. Request must be a methodCall');
         }
         $result = $this->call($this->message->methodName, $this->message->params);
+
         // Is the result an error?
         if (is_a($result, 'IXR_Error')) {
             $this->error($result);
         }
+
         // Encode the result
         $r = new IXR_Value($result);
         $resultxml = $r->getXml();
+
         // Create the XML
         $xml = <<<EOD
 <methodResponse>
   <params>
     <param>
       <value>
-        $resultxml
+      $resultxml
       </value>
     </param>
   </params>
 </methodResponse>
 
 EOD;
-        // Send it
-        $this->output($xml);
+      // Send it
+      $this->output($xml);
     }
-    function call($methodname, $args) {
+
+    function call($methodname, $args)
+    {
         if (!$this->hasMethod($methodname)) {
-            return new IXR_Error(-32601, 'server error. requested method '.
-                $methodname.' does not exist.');
+            return new IXR_Error(-32601, 'server error. requested method '.$methodname.' does not exist.');
         }
         $method = $this->callbacks[$methodname];
+
         // Perform the callback and send the response
         if (count($args) == 1) {
             // If only one paramater just send that instead of the whole array
             $args = $args[0];
         }
+
         // Are we dealing with a function or a method?
-        if (substr($method, 0, 5) == 'this:') {
+        if (is_string($method) && substr($method, 0, 5) == 'this:') {
             // It's a class method - check it exists
             $method = substr($method, 5);
             if (!method_exists($this, $method)) {
-                return new IXR_Error(-32601, 'server error. requested class method "'.
-                    $method.'" does not exist.');
+                return new IXR_Error(-32601, 'server error. requested class method "'.$method.'" does not exist.');
             }
-            // Call the method
+
+            //Call the method
             $result = $this->$method($args);
         } else {
             // It's a function - does it exist?
             if (is_array($method)) {
                 if (!method_exists($method[0], $method[1])) {
-                    return new IXR_Error(-32601, 'server error. requested object method "'.
-                        $method[1].'" does not exist.');
+                    return new IXR_Error(-32601, 'server error. requested object method "'.$method[1].'" does not exist.');
                 }
             } else if (!function_exists($method)) {
-                return new IXR_Error(-32601, 'server error. requested function "'.
-                    $method.'" does not exist.');
+                return new IXR_Error(-32601, 'server error. requested function "'.$method.'" does not exist.');
             }
+
             // Call the function
             $result = call_user_func($method, $args);
         }
         return $result;
     }
 
-    function error($error, $message = false) {
+    function error($error, $message = false)
+    {
         // Accepts either an error object or an error code and message
         if ($message && !is_object($error)) {
             $error = new IXR_Error($error, $message);
         }
         $this->output($error->getXml());
     }
-    function output($xml) {
+
+    function output($xml)
+    {
         $xml = '<?xml version="1.0"?>'."\n".$xml;
         $length = strlen($xml);
         header('Connection: close');
@@ -394,40 +475,52 @@ EOD;
         echo $xml;
         exit;
     }
-    function hasMethod($method) {
+
+    function hasMethod($method)
+    {
         return in_array($method, array_keys($this->callbacks));
     }
-    function setCapabilities() {
+
+    function setCapabilities()
+    {
         // Initialises capabilities array
         $this->capabilities = array(
             'xmlrpc' => array(
                 'specUrl' => 'http://www.xmlrpc.com/spec',
                 'specVersion' => 1
-            ),
+        ),
             'faults_interop' => array(
                 'specUrl' => 'http://xmlrpc-epi.sourceforge.net/specs/rfc.fault_codes.php',
                 'specVersion' => 20010516
-            ),
+        ),
             'system.multicall' => array(
                 'specUrl' => 'http://www.xmlrpc.com/discuss/msgReader$1208',
                 'specVersion' => 1
-            ),
+        ),
         );
     }
-    function getCapabilities($args) {
+
+    function getCapabilities($args)
+    {
         return $this->capabilities;
     }
-    function setCallbacks() {
+
+    function setCallbacks()
+    {
         $this->callbacks['system.getCapabilities'] = 'this:getCapabilities';
         $this->callbacks['system.listMethods'] = 'this:listMethods';
         $this->callbacks['system.multicall'] = 'this:multiCall';
     }
-    function listMethods($args) {
+
+    function listMethods($args)
+    {
         // Returns a list of methods - uses array_reverse to ensure user defined
         // methods are listed before server defined methods
         return array_reverse(array_keys($this->callbacks));
     }
-    function multiCall($methodcalls) {
+
+    function multiCall($methodcalls)
+    {
         // See http://www.xmlrpc.com/discuss/msgReader$1208
         $return = array();
         foreach ($methodcalls as $call) {
@@ -457,11 +550,14 @@ EOD;
  * @package IXR
  * @since 1.5
  */
-class IXR_Request {
+class IXR_Request
+{
     var $method;
     var $args;
     var $xml;
-    function IXR_Request($method, $args) {
+
+    function IXR_Request($method, $args)
+    {
         $this->method = $method;
         $this->args = $args;
         $this->xml = <<<EOD
@@ -479,10 +575,14 @@ EOD;
         }
         $this->xml .= '</params></methodCall>';
     }
-    function getLength() {
+
+    function getLength()
+    {
         return strlen($this->xml);
     }
-    function getXml() {
+
+    function getXml()
+    {
         return $this->xml;
     }
 }
@@ -492,26 +592,32 @@ EOD;
  *
  * @package IXR
  * @since 1.5
+ *
  */
-class IXR_Client {
+class IXR_Client
+{
     var $server;
     var $port;
     var $path;
     var $useragent;
-	var $headers;
     var $response;
     var $message = false;
     var $debug = false;
     var $timeout;
+    var $headers = array();
+
     // Storage place for an error message
     var $error = false;
-    function IXR_Client($server, $path = false, $port = 80, $timeout = false) {
+
+    function IXR_Client($server, $path = false, $port = 80, $timeout = 15)
+    {
         if (!$path) {
             // Assume we have been given a URL instead
             $bits = parse_url($server);
             $this->server = $bits['host'];
             $this->port = isset($bits['port']) ? $bits['port'] : 80;
             $this->path = isset($bits['path']) ? $bits['path'] : '/';
+
             // Make absolutely sure we have a path
             if (!$this->path) {
                 $this->path = '/';
@@ -524,7 +630,9 @@ class IXR_Client {
         $this->useragent = 'The Incutio XML-RPC PHP Library';
         $this->timeout = $timeout;
     }
-    function query() {
+
+    function query()
+    {
         $args = func_get_args();
         $method = array_shift($args);
         $request = new IXR_Request($method, $args);
@@ -533,33 +641,36 @@ class IXR_Client {
         $r = "\r\n";
         $request  = "POST {$this->path} HTTP/1.0$r";
 
-		$this->headers['Host']			= $this->server;
-		$this->headers['Content-Type']	= 'text/xml';
-		$this->headers['User-Agent']	= $this->useragent;
-		$this->headers['Content-Length']= $length;
+        // Merged from WP #8145 - allow custom headers
+        $this->headers['Host']          = $this->server;
+        $this->headers['Content-Type']  = 'text/xml';
+        $this->headers['User-Agent']    = $this->useragent;
+        $this->headers['Content-Length']= $length;
 
-		foreach( $this->headers as $header => $value ) {
-			$request .= "{$header}: {$value}{$r}";
-		}
-		$request .= $r;
+        foreach( $this->headers as $header => $value ) {
+            $request .= "{$header}: {$value}{$r}";
+        }
+        $request .= $r;
 
         $request .= $xml;
+
         // Now send the request
         if ($this->debug) {
             echo '<pre class="ixr_request">'.htmlspecialchars($request)."\n</pre>\n\n";
         }
+
         if ($this->timeout) {
             $fp = @fsockopen($this->server, $this->port, $errno, $errstr, $this->timeout);
         } else {
             $fp = @fsockopen($this->server, $this->port, $errno, $errstr);
         }
         if (!$fp) {
-            $this->error = new IXR_Error(-32300, "transport error - could not open socket: $errno $errstr");
+            $this->error = new IXR_Error(-32300, 'transport error - could not open socket');
             return false;
         }
         fputs($fp, $request);
         $contents = '';
-        $debug_contents = '';
+        $debugContents = '';
         $gotFirstLine = false;
         $gettingHeaders = true;
         while (!feof($fp)) {
@@ -567,7 +678,7 @@ class IXR_Client {
             if (!$gotFirstLine) {
                 // Check line for '200'
                 if (strstr($line, '200') === false) {
-                    $this->error = new IXR_Error(-32301, 'transport error - HTTP status code was not 200');
+                    $this->error = new IXR_Error(-32300, 'transport error - HTTP status code was not 200');
                     return false;
                 }
                 $gotFirstLine = true;
@@ -576,15 +687,17 @@ class IXR_Client {
                 $gettingHeaders = false;
             }
             if (!$gettingHeaders) {
-                $contents .= trim($line);
+            	// merged from WP #12559 - remove trim
+                $contents .= $line;
             }
             if ($this->debug) {
-                $debug_contents .= $line;
+            	$debugContents .= $line;
             }
         }
         if ($this->debug) {
-            echo '<pre class="ixr_response">'.htmlspecialchars($debug_contents)."\n</pre>\n\n";
+            echo '<pre class="ixr_response">'.htmlspecialchars($debugContents)."\n</pre>\n\n";
         }
+
         // Now parse what we've got back
         $this->message = new IXR_Message($contents);
         if (!$this->message->parse()) {
@@ -592,44 +705,59 @@ class IXR_Client {
             $this->error = new IXR_Error(-32700, 'parse error. not well formed');
             return false;
         }
+
         // Is the message a fault?
         if ($this->message->messageType == 'fault') {
             $this->error = new IXR_Error($this->message->faultCode, $this->message->faultString);
             return false;
         }
+
         // Message must be OK
         return true;
     }
-    function getResponse() {
+
+    function getResponse()
+    {
         // methodResponses can only have one param - return that
         return $this->message->params[0];
     }
-    function isError() {
+
+    function isError()
+    {
         return (is_object($this->error));
     }
-    function getErrorCode() {
+
+    function getErrorCode()
+    {
         return $this->error->code;
     }
-    function getErrorMessage() {
+
+    function getErrorMessage()
+    {
         return $this->error->message;
     }
 }
 
+
 /**
  * IXR_Error
  *
  * @package IXR
  * @since 1.5
  */
-class IXR_Error {
+class IXR_Error
+{
     var $code;
     var $message;
-    function IXR_Error($code, $message) {
+
+    function IXR_Error($code, $message)
+    {
         $this->code = $code;
-        // WP adds htmlspecialchars(). See #5666
         $this->message = htmlspecialchars($message);
     }
-    function getXml() {
+
+    function getXml()
+    {
         $xml = <<<EOD
 <methodResponse>
   <fault>
@@ -667,7 +795,9 @@ class IXR_Date {
     var $minute;
     var $second;
     var $timezone;
-    function IXR_Date($time) {
+
+    function IXR_Date($time)
+    {
         // $time can be a PHP timestamp or an ISO one
         if (is_numeric($time)) {
             $this->parseTimestamp($time);
@@ -675,34 +805,41 @@ class IXR_Date {
             $this->parseIso($time);
         }
     }
-    function parseTimestamp($timestamp) {
+
+    function parseTimestamp($timestamp)
+    {
         $this->year = date('Y', $timestamp);
         $this->month = date('m', $timestamp);
         $this->day = date('d', $timestamp);
         $this->hour = date('H', $timestamp);
         $this->minute = date('i', $timestamp);
         $this->second = date('s', $timestamp);
-        // WP adds timezone. See #2036
         $this->timezone = '';
     }
-    function parseIso($iso) {
+
+    function parseIso($iso)
+    {
         $this->year = substr($iso, 0, 4);
         $this->month = substr($iso, 4, 2);
         $this->day = substr($iso, 6, 2);
         $this->hour = substr($iso, 9, 2);
         $this->minute = substr($iso, 12, 2);
         $this->second = substr($iso, 15, 2);
-        // WP adds timezone. See #2036
         $this->timezone = substr($iso, 17);
     }
-    function getIso() {
-    	// WP adds timezone. See #2036
+
+    function getIso()
+    {
         return $this->year.$this->month.$this->day.'T'.$this->hour.':'.$this->minute.':'.$this->second.$this->timezone;
     }
-    function getXml() {
+
+    function getXml()
+    {
         return '<dateTime.iso8601>'.$this->getIso().'</dateTime.iso8601>';
     }
-    function getTimestamp() {
+
+    function getTimestamp()
+    {
         return mktime($this->hour, $this->minute, $this->second, $this->month, $this->day, $this->year);
     }
 }
@@ -713,12 +850,17 @@ class IXR_Date {
  * @package IXR
  * @since 1.5
  */
-class IXR_Base64 {
+class IXR_Base64
+{
     var $data;
-    function IXR_Base64($data) {
+
+    function IXR_Base64($data)
+    {
         $this->data = $data;
     }
-    function getXml() {
+
+    function getXml()
+    {
         return '<base64>'.base64_encode($this->data).'</base64>';
     }
 }
@@ -729,10 +871,13 @@ class IXR_Base64 {
  * @package IXR
  * @since 1.5
  */
-class IXR_IntrospectionServer extends IXR_Server {
+class IXR_IntrospectionServer extends IXR_Server
+{
     var $signatures;
     var $help;
-    function IXR_IntrospectionServer() {
+
+    function IXR_IntrospectionServer()
+    {
         $this->setCallbacks();
         $this->setCapabilities();
         $this->capabilities['introspection'] = array(
@@ -764,16 +909,21 @@ class IXR_IntrospectionServer extends IXR_Server {
             'Returns a documentation string for the specified method'
         );
     }
-    function addCallback($method, $callback, $args, $help) {
+
+    function addCallback($method, $callback, $args, $help)
+    {
         $this->callbacks[$method] = $callback;
         $this->signatures[$method] = $args;
         $this->help[$method] = $help;
     }
-    function call($methodname, $args) {
+
+    function call($methodname, $args)
+    {
         // Make sure it's in an array
         if ($args && !is_array($args)) {
             $args = array($args);
         }
+
         // Over-rides default call method, adds signature check
         if (!$this->hasMethod($methodname)) {
             return new IXR_Error(-32601, 'server error. requested method "'.$this->message->methodName.'" not specified.');
@@ -781,10 +931,12 @@ class IXR_IntrospectionServer extends IXR_Server {
         $method = $this->callbacks[$methodname];
         $signature = $this->signatures[$methodname];
         $returnType = array_shift($signature);
+
         // Check the number of arguments
         if (count($args) != count($signature)) {
             return new IXR_Error(-32602, 'server error. wrong number of method parameters');
         }
+
         // Check the argument types
         $ok = true;
         $argsbackup = $args;
@@ -829,7 +981,9 @@ class IXR_IntrospectionServer extends IXR_Server {
         // It passed the test - run the "real" method call
         return parent::call($methodname, $argsbackup);
     }
-    function methodSignature($method) {
+
+    function methodSignature($method)
+    {
         if (!$this->hasMethod($method)) {
             return new IXR_Error(-32601, 'server error. requested method "'.$method.'" not specified.');
         }
@@ -867,7 +1021,9 @@ class IXR_IntrospectionServer extends IXR_Server {
         }
         return $return;
     }
-    function methodHelp($method) {
+
+    function methodHelp($method)
+    {
         return $this->help[$method];
     }
 }
@@ -878,13 +1034,18 @@ class IXR_IntrospectionServer extends IXR_Server {
  * @package IXR
  * @since 1.5
  */
-class IXR_ClientMulticall extends IXR_Client {
+class IXR_ClientMulticall extends IXR_Client
+{
     var $calls = array();
-    function IXR_ClientMulticall($server, $path = false, $port = 80) {
+
+    function IXR_ClientMulticall($server, $path = false, $port = 80)
+    {
         parent::IXR_Client($server, $path, $port);
         $this->useragent = 'The Incutio XML-RPC PHP Library (multicall client)';
     }
-    function addCall() {
+
+    function addCall()
+    {
         $args = func_get_args();
         $methodName = array_shift($args);
         $struct = array(
@@ -893,8 +1054,12 @@ class IXR_ClientMulticall extends IXR_Client {
         );
         $this->calls[] = $struct;
     }
-    function query() {
+
+    function query()
+    {
         // Prepare multicall, then call the parent::query() method
         return parent::query('system.multicall', $this->calls);
     }
 }
+
+?>
diff --git a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/backpress/class.mailer-smtp.php b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/backpress/class.mailer-smtp.php
index 2dde26db3a154ee3e8a3b66b236c4889b242a0bb..0d473ce35370eae5e73b566b82a921370ba59d43 100644
--- a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/backpress/class.mailer-smtp.php
+++ b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/backpress/class.mailer-smtp.php
@@ -1,5 +1,5 @@
 <?php
-// Last sync [WP11537]
+// Last sync [WP13425]
 
 /*~ class.smtp.php
 .---------------------------------------------------------------------------.
@@ -267,7 +267,7 @@ class SMTP
    * finializing the mail transaction. $msg_data is the message
    * that is to be send with the headers. Each header needs to be
    * on a single line followed by a <CRLF> with the message headers
-   * and the message body being seperated by and additional <CRLF>.
+   * and the message body being separated by and additional <CRLF>.
    *
    * Implements rfc 821: DATA <CRLF>
    *
diff --git a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/backpress/class.passwordhash.php b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/backpress/class.passwordhash.php
index 1f851058e701e0069d6bc91f4e07c2b24a604bd5..c26cf574f546287def4100f55e611c7198c9e241 100644
--- a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/backpress/class.passwordhash.php
+++ b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/backpress/class.passwordhash.php
@@ -1,11 +1,11 @@
 <?php
-// Last sync [WP11537]
+// Last sync [WP13429]
 
 /**
  * Portable PHP password hashing framework.
  * @package phpass
  * @since 2.5
- * @version 0.1
+ * @version 0.2 / genuine.
  * @link http://www.openwall.com/phpass/
  */
 
@@ -31,7 +31,7 @@
  * Portable PHP password hashing framework.
  *
  * @package phpass
- * @version 0.1 / genuine
+ * @version 0.2 / genuine.
  * @link http://www.openwall.com/phpass/
  * @since 2.5
  */
@@ -51,14 +51,14 @@ class PasswordHash {
 
 		$this->portable_hashes = $portable_hashes;
 
-		$this->random_state = microtime() . (function_exists('getmypid') ? getmypid() : '') . uniqid(rand(), TRUE);
-
+		$this->random_state = microtime() . uniqid(rand(), TRUE); // removed getmypid() for compability reasons
 	}
 
 	function get_random_bytes($count)
 	{
 		$output = '';
-		if (($fh = @fopen('/dev/urandom', 'rb'))) {
+		if ( @is_readable('/dev/urandom') &&
+		    ($fh = @fopen('/dev/urandom', 'rb'))) {
 			$output = fread($fh, $count);
 			fclose($fh);
 		}
diff --git a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/backpress/class.wp-ajax-response.php b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/backpress/class.wp-ajax-response.php
index b1fbd56af40f918366ad869c1ce2a70641951806..ee25285386d945c56ef5df44fbfe586a5e09039b 100644
--- a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/backpress/class.wp-ajax-response.php
+++ b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/backpress/class.wp-ajax-response.php
@@ -1,5 +1,5 @@
 <?php
-// Last sync [WP11537]
+// Last sync [WP11537] - split out from wp-includes/classes.php
 
 /**
  * Send XML response back to AJAX request.
diff --git a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/backpress/class.wp-auth.php b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/backpress/class.wp-auth.php
index d23143e82fe3fc84554c01ae37f85751adac87c2..a121e75121cb1367f59d82b461423fc889252159 100644
--- a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/backpress/class.wp-auth.php
+++ b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/backpress/class.wp-auth.php
@@ -32,6 +32,13 @@ class WP_Auth
 	 * 	logged_in: whether or not a user is logged in.  Send everywhere.
 	 *	auth: used to authorize user's actions.  Send only to domains/paths that need it (e.g. wp-admin/)
 	 *	secure_auth: used to authorize user's actions.  Send only to domains/paths that need it and only over HTTPS
+	 *
+	 * You should be very careful when setting cookie domain to ensure that it always follows the rules set out in
+	 * the {@link http://curl.haxx.se/rfc/cookie_spec.html Set Cookie spec}.  In most cases it is best to leave cookie
+	 * set to false and allow for user configuration to define a cookie domain in a configuration file when
+	 * cross subdomain cookies are required.
+	 * 
+	 * @link 
 	 */
 	function __construct( &$db, &$users, $cookies )
 	{
@@ -270,10 +277,10 @@ class WP_Auth
 
 			// Set httponly if the php version is >= 5.2.0
 			if ( version_compare( phpversion(), '5.2.0', 'ge' ) ) {
-				setcookie( $_cookie['name'], $cookie, $expire, $_cookie['path'], $domain, $secure, true );
+				backpress_set_cookie( $_cookie['name'], $cookie, $expire, $_cookie['path'], $domain, $secure, true );
 			} else {
 				$domain = ( empty( $domain ) ) ? $domain : $domain . '; HttpOnly';
-				setcookie( $_cookie['name'], $cookie, $expire, $_cookie['path'], $domain, $secure );
+				backpress_set_cookie( $_cookie['name'], $cookie, $expire, $_cookie['path'], $domain, $secure );
 			}
 		}
 		unset( $_cookie );
@@ -289,7 +296,7 @@ class WP_Auth
 		do_action( 'clear_auth_cookie' );
 		foreach ( $this->cookies as $_scheme => $_scheme_cookies ) {
 			foreach ( $_scheme_cookies as $_cookie ) {
-				setcookie( $_cookie['name'], ' ', time() - 31536000, $_cookie['path'], $_cookie['domain'] );
+				backpress_set_cookie( $_cookie['name'], ' ', time() - 31536000, $_cookie['path'], $_cookie['domain'] );
 			}
 			unset( $_cookie );
 		}
diff --git a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/backpress/class.wp-dependencies.php b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/backpress/class.wp-dependencies.php
index af3808b8c7e05ae9c25211f02ebac35b7ead684b..ea607de2cf45e534e125e0155b449a4cefe5c151 100644
--- a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/backpress/class.wp-dependencies.php
+++ b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/backpress/class.wp-dependencies.php
@@ -171,8 +171,14 @@ class WP_Dependencies {
 	}
 
 	function dequeue( $handles ) {
-		foreach ( (array) $handles as $handle )
-			unset( $this->queue[$handle] );
+		foreach ( (array) $handles as $handle ) {
+			$handle = explode('?', $handle);
+			$key = array_search($handle[0], $this->queue);
+			if ( false !== $key ) {
+				unset($this->queue[$key]);
+				unset($this->args[$handle[0]]);
+			}
+		}
 	}
 
 	function query( $handle, $list = 'registered' ) { // registered, queue, done, to_do
@@ -226,8 +232,6 @@ class _WP_Dependency {
 		@list($this->handle, $this->src, $this->deps, $this->ver, $this->args) = func_get_args();
 		if ( !is_array($this->deps) )
 			$this->deps = array();
-		if ( !$this->ver )
-			$this->ver = false;
 	}
 
 	function add_data( $name, $data ) {
diff --git a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/backpress/class.wp-error.php b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/backpress/class.wp-error.php
index bcba3830cc9dff03bab15bca92b184877bbea4bc..e77d07e3c9a3164ba1c7efb0da193059c519d15c 100644
--- a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/backpress/class.wp-error.php
+++ b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/backpress/class.wp-error.php
@@ -1,5 +1,5 @@
 <?php
-// Last sync [WP11537]
+// Last sync [WP11537] - split out from wp-includes/classes.php
 
 /**
  * WordPress Error class.
diff --git a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/backpress/class.wp-http-ixr-client.php b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/backpress/class.wp-http-ixr-client.php
new file mode 100644
index 0000000000000000000000000000000000000000..6a1b2f8ac08ba7c71ab9868ff725da798a7c178a
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/backpress/class.wp-http-ixr-client.php
@@ -0,0 +1,97 @@
+<?php
+/**
+ * WP_HTTP_IXR_Client
+ *
+ * @package WordPress
+ * @since 3.1.0
+ *
+ */
+class WP_HTTP_IXR_Client extends IXR_Client
+{
+    function WP_HTTP_IXR_Client($server, $path = false, $port = 80, $timeout = 15)
+    {
+        if (!$path) {
+            // Assume we have been given a URL instead
+            $bits = parse_url($server);
+            $this->scheme = $bits['scheme'];
+            $this->server = $bits['host'];
+            $this->port = isset($bits['port']) ? $bits['port'] : 80;
+            $this->path = isset($bits['path']) ? $bits['path'] : '/';
+
+            // Make absolutely sure we have a path
+            if (!$this->path) {
+                $this->path = '/';
+            }
+        } else {
+        	$this->scheme = 'http'; 
+            $this->server = $server;
+            $this->path = $path;
+            $this->port = $port;
+        }
+        $this->useragent = 'The Incutio XML-RPC PHP Library';
+        $this->timeout = $timeout;
+    }
+
+    function query()
+    {
+        $args = func_get_args();
+        $method = array_shift($args);
+        $request = new IXR_Request($method, $args);
+        $xml = $request->getXml();
+
+        $url = $this->scheme . '://' . $this->server . ':' . $this->port . $this->path;
+        $args = array(
+            'headers'    => array('Content-Type' => 'text/xml'),
+            'user-agent' => $this->useragent,
+            'body'       => $xml,
+        );
+        
+        // Merge Custom headers ala #8145
+		foreach ( $this->headers as $header => $value )
+			$args['headers'][$header] = $value;
+        
+		if ( $this->timeout !== false )
+			$args['timeout'] = $this->timeout;
+        	
+        // Now send the request
+        if ($this->debug) {
+            echo '<pre class="ixr_request">'.htmlspecialchars($xml)."\n</pre>\n\n";
+        }
+
+		$response = wp_remote_post($url, $args); 
+
+		if ( is_wp_error($response) ) { 
+			$errno    = $response->get_error_code(); 
+			$errorstr = $response->get_error_message(); 
+			$this->error = new IXR_Error(-32300, "transport error: $errno $errstr"); 
+			return false;
+		}
+ 	
+		$code = $response['response']['code']; 
+		if ( $code != 200 ) { 
+			$this->error = new IXR_Error(-32301, "transport error - HTTP status code was not 200 ($code)");             return false;
+        }
+
+        if ($this->debug) {
+            echo '<pre class="ixr_response">'.htmlspecialchars($response['body'])."\n</pre>\n\n";
+        }
+
+        // Now parse what we've got back
+        $this->message = new IXR_Message( $response['body'] );
+        if (!$this->message->parse()) {
+            // XML error
+            $this->error = new IXR_Error(-32700, 'parse error. not well formed');
+            return false;
+        }
+
+        // Is the message a fault?
+        if ($this->message->messageType == 'fault') {
+            $this->error = new IXR_Error($this->message->faultCode, $this->message->faultString);
+            return false;
+        }
+
+        // Message must be OK
+        return true;
+    }
+}
+?>
\ No newline at end of file
diff --git a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/backpress/class.wp-object-cache-memcached.php b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/backpress/class.wp-object-cache-memcached.php
index 0a1961178271b1d1cd966f3ca9be4143d626d653..24b4bb8c13bc58f4d46fd371cb055bf3418864cd 100644
--- a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/backpress/class.wp-object-cache-memcached.php
+++ b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/backpress/class.wp-object-cache-memcached.php
@@ -116,7 +116,7 @@ class WP_Object_Cache
 
 		$this->cache[$key] = $value;
 
-		if ( 'checkthedatabaseplease' == $value ) {
+		if ( 'checkthedatabaseplease' === $value ) {
 			$value = false;
 		}
 
@@ -185,7 +185,7 @@ class WP_Object_Cache
 	{
 		$key = $this->key($id, $group);
 
-		if ( isset( $this->cache[$key] ) && 'checkthedatabaseplease' == $this->cache[$key] ) {
+		if ( isset( $this->cache[$key] ) && 'checkthedatabaseplease' === $this->cache[$key] ) {
 			return false;
 		}
 		$this->cache[$key] = $data;
@@ -207,6 +207,10 @@ class WP_Object_Cache
 
 	function replace($id, $data, $group = 'default', $expire = 0) {
 		$key = $this->key($id, $group);
+		if ( in_array( $group, $this->no_mc_groups ) ) {
+			$this->cache[$key] = $data;
+			return true;
+		}
 		$expire = ($expire == 0) ? $this->default_expiration : $expire;
 		$mc =& $this->get_mc($group);
 		$result = $mc->replace($key, $data, false, $expire);
diff --git a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/backpress/class.wp-pass.php b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/backpress/class.wp-pass.php
index c24aca4a117f107dca3927df4323e664ad7c2f0a..0581a8a981bc0a7ce9bbbc4da494682d38757ef1 100644
--- a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/backpress/class.wp-pass.php
+++ b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/backpress/class.wp-pass.php
@@ -1,5 +1,5 @@
 <?php
-// Last sync [WP10712]
+// Last sync [WP10712] - Refactored into a class from wp-incldues/pluggable.php
 
 class WP_Pass {
 	/**
diff --git a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/backpress/class.wp-scripts.php b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/backpress/class.wp-scripts.php
index 9fa96e9d020d5d22e3cb9039cecd9eeab7feaa84..45d2e54cb1f2891f03f69e886ad3962106d8baa7 100644
--- a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/backpress/class.wp-scripts.php
+++ b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/backpress/class.wp-scripts.php
@@ -90,9 +90,13 @@ class WP_Scripts extends WP_Dependencies {
 		if ( false === $group && in_array($handle, $this->in_footer, true) )
 			$this->in_footer = array_diff( $this->in_footer, (array) $handle );
 
-		$ver = $this->registered[$handle]->ver ? $this->registered[$handle]->ver : $this->default_version;
+		if ( null === $this->registered[$handle]->ver )
+			$ver = '';
+		else
+			$ver = $this->registered[$handle]->ver ? $this->registered[$handle]->ver : $this->default_version;
+
 		if ( isset($this->args[$handle]) )
-			$ver .= '&amp;' . $this->args[$handle];
+			$ver = $ver ? $ver . '&amp;' . $this->args[$handle] : $this->args[$handle];
 
 		$src = $this->registered[$handle]->src;
 
@@ -114,7 +118,8 @@ class WP_Scripts extends WP_Dependencies {
 			$src = $this->base_url . $src;
 		}
 
-		$src = add_query_arg('ver', $ver, $src);
+		if ( !empty($ver) )
+			$src = add_query_arg('ver', $ver, $src);
 		$src = esc_url(apply_filters( 'script_loader_src', $src, $handle ));
 
 		if ( $this->do_concat )
diff --git a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/backpress/class.wp-styles.php b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/backpress/class.wp-styles.php
index 731ae39cf47a6fcd6ecc9edffb16fee0739a185a..83b4addbc083116d4854963ec2ad62d220b5c36b 100644
--- a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/backpress/class.wp-styles.php
+++ b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/backpress/class.wp-styles.php
@@ -35,9 +35,13 @@ class WP_Styles extends WP_Dependencies {
 		if ( !parent::do_item($handle) )
 			return false;
 
-		$ver = $this->registered[$handle]->ver ? $this->registered[$handle]->ver : $this->default_version;
+		if ( null === $this->registered[$handle]->ver )
+			$ver = '';
+		else
+			$ver = $this->registered[$handle]->ver ? $this->registered[$handle]->ver : $this->default_version;
+
 		if ( isset($this->args[$handle]) )
-			$ver .= '&amp;' . $this->args[$handle];
+			$ver = $ver ? $ver . '&amp;' . $this->args[$handle] : $this->args[$handle];
 
 		if ( $this->do_concat ) {
 			if ( $this->in_default_dir($this->registered[$handle]->src) && !isset($this->registered[$handle]->extra['conditional']) && !isset($this->registered[$handle]->extra['alt']) ) {
@@ -100,7 +104,8 @@ class WP_Styles extends WP_Dependencies {
 			$src = $this->base_url . $src;
 		}
 
-		$src = add_query_arg('ver', $ver, $src);
+		if ( !empty($ver) )
+			$src = add_query_arg('ver', $ver, $src);
 		$src = apply_filters( 'style_loader_src', $src, $handle );
 		return esc_url( $src );
 	}
diff --git a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/backpress/class.wp-taxonomy.php b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/backpress/class.wp-taxonomy.php
index 167277500868a733ef42e7bfe8fa8f9826ec64ae..acb437770e4ef3a4913fd554849a19183d6b56e3 100644
--- a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/backpress/class.wp-taxonomy.php
+++ b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/backpress/class.wp-taxonomy.php
@@ -1,5 +1,5 @@
 <?php
-// Last sync [WP11537]
+// Last sync [WP11537] - Refactored into a class based on wp-includes/taxonomy.php
 
 /**
  * Taxonomy API
@@ -302,12 +302,14 @@ class WP_Taxonomy {
 
 		if ( is_object($term) ) {
 			wp_cache_add($term->term_id, $term, $taxonomy);
+			wp_cache_add($term->term_taxonomy_id, $term->term_id, "$taxonomy:tt_id" );
 			$_term = $term;
 		} else {
 			$term = (int) $term;
 			if ( ! $_term = wp_cache_get($term, $taxonomy) ) {
 				$_term = $this->db->get_row( $this->db->prepare( "SELECT t.*, tt.* FROM {$this->db->terms} AS t INNER JOIN {$this->db->term_taxonomy} AS tt ON t.term_id = tt.term_id WHERE tt.taxonomy = %s AND t.term_id = %s LIMIT 1", $taxonomy, $term) );
 				wp_cache_add($term, $_term, $taxonomy);
+				wp_cache_add($_term->term_taxonomy_id, $_term->term_id, "$taxonomy:tt_id" );
 			}
 		}
 
@@ -361,6 +363,8 @@ class WP_Taxonomy {
 		} else if ( 'tt_id' == $field ) {
 			$field = 'tt.term_taxonomy_id';
 			$value = (int) $value;
+			if ( $_term_id = wp_cache_get( $value, "$taxonomy:tt_id" ) )
+				return $this->get_term( $_term_id, $taxonomy, $output, $filter );
 		} else {
 			$field = 't.term_id';
 			$value = (int) $value;
@@ -371,6 +375,7 @@ class WP_Taxonomy {
 			return false;
 
 		wp_cache_add($term->term_id, $term, $taxonomy);
+		wp_cache_add($term->term_taxonomy_id, $term->term_id, "$taxonomy:tt_id" );
 
 		$term = $this->sanitize_term($term, $taxonomy, $filter);
 
@@ -1770,16 +1775,20 @@ class WP_Taxonomy {
 		$taxonomies = array();
 		// If no taxonomy, assume tt_ids.
 		if ( empty($taxonomy) ) {
-			$tt_ids = implode(', ', $ids);
-			$terms = $this->db->get_results("SELECT term_id, taxonomy FROM {$this->db->term_taxonomy} WHERE term_taxonomy_id IN ($tt_ids)");
+			$tt_ids = implode( ',', array_map( 'intval', $ids ) );
+			$terms = $this->db->get_results("SELECT term_id, term_taxonomy_id, taxonomy FROM {$this->db->term_taxonomy} WHERE term_taxonomy_id IN ($tt_ids)");
 			foreach ( (array) $terms as $term ) {
 				$taxonomies[] = $term->taxonomy;
 				wp_cache_delete($term->term_id, $term->taxonomy);
+				wp_cache_delete($term->term_taxonomy_id, "{$term->taxonomy}:tt_id");
 			}
 			$taxonomies = array_unique($taxonomies);
 		} else {
-			foreach ( $ids as $id ) {
-				wp_cache_delete($id, $taxonomy);
+			$tt_ids = implode( ',', array_map( 'intval', $ids ) );
+			$terms = $this->db->get_results("SELECT term_id, term_taxonomy_id FROM {$this->db->term_taxonomy} WHERE term_id IN ($tt_ids)");
+			foreach ( (array) $terms as $term ) {
+				wp_cache_delete($term->term_id, $taxonomy);
+				wp_cache_delete($term->term_taxonomy_id, "$taxonomy:tt_id");
 			}
 			$taxonomies = array($taxonomy);
 		}
@@ -1902,6 +1911,7 @@ class WP_Taxonomy {
 				$term_taxonomy = $term->taxonomy;
 
 			wp_cache_add($term->term_id, $term, $term_taxonomy);
+			wp_cache_add($term->term_taxonomy_id, $term->term_id, "$term_taxonomy:tt_id");
 		}
 	}
 
diff --git a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/backpress/class.wp-users.php b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/backpress/class.wp-users.php
index 3382060466588fd276502d27d9c6e9305aad3193..2adc1b609f8fb63140b4c94b14eb5610e1b22b09 100644
--- a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/backpress/class.wp-users.php
+++ b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/backpress/class.wp-users.php
@@ -215,6 +215,9 @@ class WP_Users {
 				default:
 					if ( is_numeric( $_user_id ) ) {
 						$safe_user_ids[] = (int) $_user_id;
+					} else { // If one $_user_id is non-numerical, treat all $user_ids as user_logins
+						$safe_user_ids[] = $this->sanitize_user( $_user_id, true );
+						$by = 'login';
 					}
 					break;
 			}
@@ -526,8 +529,9 @@ class WP_Users {
 		$args = wp_parse_args( $args, $defaults );
 		extract( $args, EXTR_SKIP );
 
-		if ( is_numeric($id) )
-			return false;
+		$user = $this->get_user( $id );
+		if ( !$user || is_wp_error($user) )
+			return $user;
 
 		$id = (int) $id;
 
diff --git a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/backpress/functions.core.php b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/backpress/functions.core.php
index 564222f5972dd8ddbbbad18914a83a832b21b92f..caa61223fe5a0d857fa49aa1a57ef73ed3b4650e 100644
--- a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/backpress/functions.core.php
+++ b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/backpress/functions.core.php
@@ -904,7 +904,7 @@ if ( !function_exists('wp_timezone_choice') ) :
 /**
  * Gives a nicely formatted list of timezone strings // temporary! Not in final
  *
- * @param string $selectedzone - which zone should be the selected one
+ * @param $selected_zone string Selected Zone
  *
  */
 function wp_timezone_choice( $selected_zone ) {
@@ -982,9 +982,9 @@ function wp_timezone_choice( $selected_zone ) {
 					$display = str_replace( 'GMT', '', $zone['city'] );
 					$display = strtr( $display, '+-', '-+' ) . ':00';
 				}
-				$display = '&nbsp;&nbsp;&nbsp;' . sprintf( __( 'UTC %s' ), $display );
+				$display = sprintf( __( 'UTC %s' ), $display );
 			} else {
-				$display = '&nbsp;&nbsp;&nbsp;' . $zone['t_city'];
+				$display = $zone['t_city'];
 				if ( !empty( $zone['subcity'] ) ) {
 					// Add the subcity to the value
 					$value[] = $zone['subcity'];
@@ -1002,7 +1002,7 @@ function wp_timezone_choice( $selected_zone ) {
 		$structure[] = '<option ' . $selected . 'value="' . esc_attr( $value ) . '">' . esc_html( $display ) . "</option>";
 		
 		// Close continent optgroup
-		if ( !empty( $zone['city'] ) && isset( $zonen[$key + 1] ) && $zonen[$key + 1]['continent'] !== $zone['continent'] ) {
+		if ( !empty( $zone['city'] ) && ( !isset($zonen[$key + 1]) || (isset( $zonen[$key + 1] ) && $zonen[$key + 1]['continent'] !== $zone['continent']) ) ) {
 			$structure[] = '</optgroup>';
 		}
 	}
@@ -1235,3 +1235,15 @@ function backpress_die( $message, $title = '', $args = array() )
 	die();
 }
 endif;
+
+/**
+ * Acts the same as core PHP setcookie() but its arguments are run through the backpress_set_cookie filter.
+ * 
+ * If the filter returns false, setcookie() isn't called.
+ */
+function backpress_set_cookie() {
+	$args = func_get_args();
+	$args = apply_filters( 'backpress_set_cookie', $args );
+	if ( $args === false ) return;
+	call_user_func_array( 'setcookie', $args );
+}
\ No newline at end of file
diff --git a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/backpress/functions.formatting.php b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/backpress/functions.formatting.php
index 3056c62238201ff34b9148d737fa30807d6a8c78..32d33e0d0832a10cf38e0907b37674f1023b8ee6 100644
--- a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/backpress/functions.formatting.php
+++ b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/backpress/functions.formatting.php
@@ -1,5 +1,5 @@
 <?php
-// Last sync [WP11616]
+// Last sync [WP12504]
 
 /**
  * From WP wp-includes/formatting.php
@@ -37,48 +37,67 @@ if ( !function_exists( 'wptexturize' ) ) :
  */
 function wptexturize($text) {
 	global $wp_cockneyreplace;
+	static $static_setup = false, $opening_quote, $closing_quote, $default_no_texturize_tags, $default_no_texturize_shortcodes, $static_characters, $static_replacements, $dynamic_characters, $dynamic_replacements;
 	$output = '';
 	$curl = '';
 	$textarr = preg_split('/(<.*>|\[.*\])/Us', $text, -1, PREG_SPLIT_DELIM_CAPTURE);
 	$stop = count($textarr);
 	
-	/* translators: opening curly quote */
-	$opening_quote = _x('&#8220;', 'opening curly quote');
-	/* translators: closing curly quote */
-	$closing_quote = _x('&#8221;', 'closing curly quote');
-	
-	$no_texturize_tags = apply_filters('no_texturize_tags', array('pre', 'code', 'kbd', 'style', 'script', 'tt'));
-	$no_texturize_shortcodes = apply_filters('no_texturize_shortcodes', array('code'));
-	$no_texturize_tags_stack = array();
-	$no_texturize_shortcodes_stack = array();
+	// No need to setup these variables more than once
+	if (!$static_setup) {
+		/* translators: opening curly quote */
+		$opening_quote = _x('&#8220;', 'opening curly quote');
+		/* translators: closing curly quote */
+		$closing_quote = _x('&#8221;', 'closing curly quote');
+
+		$default_no_texturize_tags = array('pre', 'code', 'kbd', 'style', 'script', 'tt');
+		$default_no_texturize_shortcodes = array('code');
+
+		// if a plugin has provided an autocorrect array, use it
+		if ( isset($wp_cockneyreplace) ) {
+			$cockney = array_keys($wp_cockneyreplace);
+			$cockneyreplace = array_values($wp_cockneyreplace);
+		} else {
+			$cockney = array("'tain't","'twere","'twas","'tis","'twill","'til","'bout","'nuff","'round","'cause");
+			$cockneyreplace = array("&#8217;tain&#8217;t","&#8217;twere","&#8217;twas","&#8217;tis","&#8217;twill","&#8217;til","&#8217;bout","&#8217;nuff","&#8217;round","&#8217;cause");
+		}
 
-	// if a plugin has provided an autocorrect array, use it
-	if ( isset($wp_cockneyreplace) ) {
-		$cockney = array_keys($wp_cockneyreplace);
-		$cockneyreplace = array_values($wp_cockneyreplace);
-	} else {
-		$cockney = array("'tain't","'twere","'twas","'tis","'twill","'til","'bout","'nuff","'round","'cause");
-		$cockneyreplace = array("&#8217;tain&#8217;t","&#8217;twere","&#8217;twas","&#8217;tis","&#8217;twill","&#8217;til","&#8217;bout","&#8217;nuff","&#8217;round","&#8217;cause");
+		$static_characters = array_merge(array('---', ' -- ', '--', ' - ', 'xn&#8211;', '...', '``', '\'s', '\'\'', ' (tm)'), $cockney);
+		$static_replacements = array_merge(array('&#8212;', ' &#8212; ', '&#8211;', ' &#8211; ', 'xn--', '&#8230;', $opening_quote, '&#8217;s', $closing_quote, ' &#8482;'), $cockneyreplace);
+
+		$dynamic_characters = array('/\'(\d\d(?:&#8217;|\')?s)/', '/(\s|\A|[([{<]|")\'/', '/(\d+)"/', '/(\d+)\'/', '/(\S)\'([^\'\s])/', '/(\s|\A|[([{<])"(?!\s)/', '/"(\s|\S|\Z)/', '/\'([\s.]|\Z)/', '/(\d+)x(\d+)/');
+		$dynamic_replacements = array('&#8217;$1','$1&#8216;', '$1&#8243;', '$1&#8242;', '$1&#8217;$2', '$1' . $opening_quote . '$2', $closing_quote . '$1', '&#8217;$1', '$1&#215;$2');
+
+		$static_setup = true;
 	}
 
-	$static_characters = array_merge(array('---', ' -- ', '--', ' - ', 'xn&#8211;', '...', '``', '\'s', '\'\'', ' (tm)'), $cockney);
-	$static_replacements = array_merge(array('&#8212;', ' &#8212; ', '&#8211;', ' &#8211; ', 'xn--', '&#8230;', $opening_quote, '&#8217;s', $closing_quote, ' &#8482;'), $cockneyreplace);
+	// Transform into regexp sub-expression used in _wptexturize_pushpop_element
+	// Must do this everytime in case plugins use these filters in a context sensitive manner
+	$no_texturize_tags = '(' . implode('|', apply_filters('no_texturize_tags', $default_no_texturize_tags) ) . ')';
+	$no_texturize_shortcodes = '(' . implode('|', apply_filters('no_texturize_shortcodes', $default_no_texturize_shortcodes) ) . ')';
 
-	$dynamic_characters = array('/\'(\d\d(?:&#8217;|\')?s)/', '/(\s|\A|")\'/', '/(\d+)"/', '/(\d+)\'/', '/(\S)\'([^\'\s])/', '/(\s|\A)"(?!\s)/', '/"(\s|\S|\Z)/', '/\'([\s.]|\Z)/', '/(\d+)x(\d+)/');
-	$dynamic_replacements = array('&#8217;$1','$1&#8216;', '$1&#8243;', '$1&#8242;', '$1&#8217;$2', '$1' . $opening_quote . '$2', $closing_quote . '$1', '&#8217;$1', '$1&#215;$2');
+	$no_texturize_tags_stack = array();
+	$no_texturize_shortcodes_stack = array();
 
 	for ( $i = 0; $i < $stop; $i++ ) {
 		$curl = $textarr[$i];
 
 		if ( !empty($curl) && '<' != $curl{0} && '[' != $curl{0}
-				&& empty($no_texturize_shortcodes_stack) && empty($no_texturize_tags_stack)) { // If it's not a tag
+				&& empty($no_texturize_shortcodes_stack) && empty($no_texturize_tags_stack)) { 
+			// This is not a tag, nor is the texturization disabled
 			// static strings
 			$curl = str_replace($static_characters, $static_replacements, $curl);
 			// regular expressions
 			$curl = preg_replace($dynamic_characters, $dynamic_replacements, $curl);
-		} else {
-			wptexturize_pushpop_element($curl, $no_texturize_tags_stack, $no_texturize_tags, '<', '>');
-			wptexturize_pushpop_element($curl, $no_texturize_shortcodes_stack, $no_texturize_shortcodes, '[', ']');
+		} elseif (!empty($curl)) {
+			/*
+			 * Only call _wptexturize_pushpop_element if first char is correct
+			 * tag opening
+			 */
+			if ('<' == $curl{0})
+				_wptexturize_pushpop_element($curl, $no_texturize_tags_stack, $no_texturize_tags, '<', '>');
+			elseif ('[' == $curl{0})
+				_wptexturize_pushpop_element($curl, $no_texturize_shortcodes_stack, $no_texturize_shortcodes, '[', ']');
 		}
 
 		$curl = preg_replace('/&([^#])(?![a-zA-Z1-4]{1,8};)/', '&#038;$1', $curl);
@@ -89,18 +108,45 @@ function wptexturize($text) {
 }
 endif;
 
-if ( !function_exists( 'wptexturize_pushpop_element' ) ) :
-function wptexturize_pushpop_element($text, &$stack, $disabled_elements, $opening = '<', $closing = '>') {
-	$o = preg_quote($opening);
-	$c = preg_quote($closing);
-	foreach($disabled_elements as $element) {
-		if (preg_match('/^'.$o.$element.'\b/', $text)) array_push($stack, $element);
-		if (preg_match('/^'.$o.'\/'.$element.$c.'/', $text)) {
+if ( !function_exists( '_wptexturize_pushpop_element' ) ) :
+/**
+ * Search for disabled element tags. Push element to stack on tag open and pop
+ * on tag close. Assumes first character of $text is tag opening.
+ *
+ * @access private
+ * @since 2.9.0
+ *
+ * @param string $text Text to check. First character is assumed to be $opening
+ * @param array $stack Array used as stack of opened tag elements
+ * @param string $disabled_elements Tags to match against formatted as regexp sub-expression
+ * @param string $opening Tag opening character, assumed to be 1 character long
+ * @param string $opening Tag closing  character
+ * @return object
+ */
+function _wptexturize_pushpop_element($text, &$stack, $disabled_elements, $opening = '<', $closing = '>') {
+	// Check if it is a closing tag -- otherwise assume opening tag
+	if (strncmp($opening . '/', $text, 2)) {
+		// Opening? Check $text+1 against disabled elements
+		if (preg_match('/^' . $disabled_elements . '\b/', substr($text, 1), $matches)) {
+			/*
+			 * This disables texturize until we find a closing tag of our type
+			 * (e.g. <pre>) even if there was invalid nesting before that
+			 * 
+			 * Example: in the case <pre>sadsadasd</code>"baba"</pre>
+			 *          "baba" won't be texturize
+			 */
+
+			array_push($stack, $matches[1]);
+		}
+	} else {
+		// Closing? Check $text+2 against disabled elements
+		$c = preg_quote($closing, '/');
+		if (preg_match('/^' . $disabled_elements . $c . '/', substr($text, 2), $matches)) {
 			$last = array_pop($stack);
-			// disable texturize until we find a closing tag of our type (e.g. <pre>)
-			// even if there was invalid nesting before that
-			// Example: in the case <pre>sadsadasd</code>"baba"</pre> "baba" won't be texturized
-			if ($last != $element) array_push($stack, $last);
+
+			// Make sure it matches the opening tag
+			if ($last != $matches[1])
+				array_push($stack, $last);
 		}
 	}
 }
@@ -579,7 +625,7 @@ if ( !function_exists('sanitize_user') ) :
  */
 function sanitize_user( $username, $strict = false ) {
 	$raw_username = $username;
-	$username = strip_tags($username);
+	$username = wp_strip_all_tags($username);
 	// Kill octets
 	$username = preg_replace('|%([a-fA-F0-9][a-fA-F0-9])|', '', $username);
 	$username = preg_replace('/&.+?;/', '', $username); // Kill entities
@@ -944,9 +990,11 @@ if ( !function_exists( '_make_url_clickable_cb' ) ) :
  */
 function _make_url_clickable_cb($matches) {
 	$url = $matches[2];
+
 	$url = esc_url($url);
 	if ( empty($url) )
 		return $matches[0];
+
 	return $matches[1] . "<a href=\"$url\" rel=\"nofollow\">$url</a>";
 }
 endif;
@@ -971,12 +1019,13 @@ function _make_web_ftp_clickable_cb($matches) {
 	$dest = esc_url($dest);
 	if ( empty($dest) )
 		return $matches[0];
-	// removed trailing [,;:] from URL
-	if ( in_array(substr($dest, -1), array('.', ',', ';', ':')) === true ) {
+
+	// removed trailing [.,;:)] from URL
+	if ( in_array( substr($dest, -1), array('.', ',', ';', ':', ')') ) === true ) {
 		$ret = substr($dest, -1);
 		$dest = substr($dest, 0, strlen($dest)-1);
 	}
-	return $matches[1] . "<a href=\"$dest\" rel=\"nofollow\">$dest</a>" . $ret;
+	return $matches[1] . "<a href=\"$dest\" rel=\"nofollow\">$dest</a>$ret";
 }
 endif;
 
@@ -1014,7 +1063,7 @@ if ( !function_exists( 'make_clickable' ) ) :
 function make_clickable($ret) {
 	$ret = ' ' . $ret;
 	// in testing, using arrays here was found to be faster
-	$ret = preg_replace_callback('#(?<=[\s>])(\()?([\w]+?://(?:[\w\\x80-\\xff\#$%&~/\-=?@\[\](+]|[.,;:](?![\s<])|(?(1)\)(?![\s<])|\)))+)#is', '_make_url_clickable_cb', $ret);
+	$ret = preg_replace_callback('#(?<=[\s>])(\()?([\w]+?://(?:[\w\\x80-\\xff\#$%&~/=?@\[\](+-]|[.,;:](?![\s<]|(\))?([\s]|$))|(?(1)\)(?![\s<.,;:]|$)|\)))+)#is', '_make_url_clickable_cb', $ret);
 	$ret = preg_replace_callback('#([\s>])((www|ftp)\.[\w\\x80-\\xff\#$%&~/.\-;:=,?@\[\]+]+)#is', '_make_web_ftp_clickable_cb', $ret);
 	$ret = preg_replace_callback('#([\s>])([.0-9a-z_+-]+)@(([0-9a-z-]+\.)+[0-9a-z]{2,})#i', '_make_email_clickable_cb', $ret);
 	// this one is not in an array because we need it to run last, for cleanup of accidental links within links
@@ -1529,14 +1578,14 @@ endif;
 if ( !function_exists( '_deep_replace' ) ) :
 /**
  * Perform a deep string replace operation to ensure the values in $search are no longer present
- * 
+ *
  * Repeats the replacement operation until it no longer replaces anything so as to remove "nested" values
  * e.g. $subject = '%0%0%0DDD', $search ='%0D', $result ='' rather than the '%0%0DD' that
  * str_replace would return
- * 
+ *
  * @since 2.8.1
  * @access private
- * 
+ *
  * @param string|array $search
  * @param string $subject
  * @return string The processed string
@@ -1552,7 +1601,7 @@ function _deep_replace($search, $subject){
 			}
 		}
 	}
-	
+
 	return $subject;
 }
 endif;
@@ -1619,8 +1668,10 @@ endif;
 
 if ( !function_exists( 'esc_js' ) ) :
 /**
- * Escape single quotes, specialchar double quotes, and fix line endings.
+ * Escape single quotes, htmlspecialchar " < > &, and fix line endings.
  *
+ * Escapes text strings for echoing in JS, both inline (for example in onclick="...")
+ * and inside <script> tag. Note that the strings have to be in single quotes.
  * The filter 'js_escape' is also applied here.
  *
  * @since 2.8.0
@@ -1632,7 +1683,8 @@ function esc_js( $text ) {
 	$safe_text = wp_check_invalid_utf8( $text );
 	$safe_text = _wp_specialchars( $safe_text, ENT_COMPAT );
 	$safe_text = preg_replace( '/&#(x)?0*(?(1)27|39);?/i', "'", stripslashes( $safe_text ) );
-	$safe_text = preg_replace( "/\r?\n/", "\\n", addslashes( $safe_text ) );
+	$safe_text = str_replace( "\r", '', $safe_text );
+	$safe_text = str_replace( "\n", '\\n', addslashes( $safe_text ) );
 	return apply_filters( 'js_escape', $safe_text, $text );
 }
 endif;
@@ -1734,7 +1786,7 @@ if ( !function_exists('like_escape') ) :
  * @return string text, safe for inclusion in LIKE query.
  */
 function like_escape($text) {
-	return str_replace(array("%", "_"), array("\\%", "\\_"), $text);
+	return addcslashes($text, '\\%_');
 }
 endif;
 
@@ -1762,8 +1814,38 @@ function wp_parse_str( $string, &$array ) {
 }
 endif;
 
-// ! function wp_pre_kses_less_than()
-// ! function wp_pre_kses_less_than_callback()
+if ( !function_exists('wp_pre_kses_less_than') ) :
+/**
+ * Convert lone less than signs.
+ *
+ * KSES already converts lone greater than signs.
+ *
+ * @uses wp_pre_kses_less_than_callback in the callback function.
+ * @since 2.3.0
+ *
+ * @param string $text Text to be converted.
+ * @return string Converted text.
+ */
+function wp_pre_kses_less_than( $text ) {
+	return preg_replace_callback('%<[^>]*?((?=<)|>|$)%', 'wp_pre_kses_less_than_callback', $text);
+}
+endif;
+if ( !function_exists('wp_pre_kses_less_than_callback') ) :
+/**
+ * Callback function used by preg_replace.
+ *
+ * @uses esc_html to format the $matches text.
+ * @since 2.3.0
+ *
+ * @param array $matches Populated by matches to preg_replace.
+ * @return string The text returned after esc_html if needed.
+ */
+function wp_pre_kses_less_than_callback( $matches ) {
+	if ( false === strpos($matches[0], '>') )
+		return esc_html($matches[0]);
+	return $matches[0];
+}
+endif;
 // ! function wp_sprintf()
 // ! function wp_sprintf_l()
 
@@ -1782,7 +1864,7 @@ if ( !function_exists('wp_html_excerpt') ) :
  * @return string The excerpt.
  */
 function wp_html_excerpt( $str, $count ) {
-	$str = strip_tags( $str );
+	$str = wp_strip_all_tags( $str, true );
 	$str = mb_substr( $str, 0, $count );
 	// remove part of an entity at the end
 	$str = preg_replace( '/&[^;\s]{0,6}$/', '', $str );
@@ -1795,3 +1877,66 @@ endif;
 // ! function links_add_target()
 // ! function _links_add_target()
 // ! function normalize_whitespace()
+
+if ( !function_exists('wp_strip_all_tags') ) :
+/**
+ * Properly strip all HTML tags including script and style
+ *
+ * @since 2.9.0
+ *
+ * @param string $string String containing HTML tags
+ * @param bool $remove_breaks optional Whether to remove left over line breaks and white space chars
+ * @return string The processed string.
+ */
+function wp_strip_all_tags($string, $remove_breaks = false) {
+	$string = preg_replace( '@<(script|style)[^>]*?>.*?</\\1>@si', '', $string );
+	$string = strip_tags($string);
+
+	if ( $remove_breaks )
+		$string = preg_replace('/[\r\n\t ]+/', ' ', $string);
+
+	return trim($string);
+}
+endif;
+
+if ( !function_exists('sanitize_text_field') ) :
+/**
+ * Sanitize a string from user input or from the db
+ *
+ * check for invalid UTF-8,
+ * Convert single < characters to entity,
+ * strip all tags,
+ * remove line breaks, tabs and extra whitre space,
+ * strip octets.
+ *
+ * @since 2.9
+ *
+ * @param string $str
+ * @return string
+ */
+function sanitize_text_field($str) {
+	$filtered = wp_check_invalid_utf8( $str );
+
+	if ( strpos($filtered, '<') !== false ) {
+		$filtered = wp_pre_kses_less_than( $filtered );
+		// This will strip extra whitespace for us.
+		$filtered = wp_strip_all_tags( $filtered, true );
+	} else {
+		$filtered = trim( preg_replace('/[\r\n\t ]+/', ' ', $filtered) );
+	}
+
+	$match = array();
+	$found = false;
+	while ( preg_match('/%[a-f0-9]{2}/i', $filtered, $match) ) {
+		$filtered = str_replace($match[0], '', $filtered);
+		$found = true;
+	}
+
+	if ( $found ) {
+		// Strip out the whitespace that may now exist after removing the octets.
+		$filtered = trim( preg_replace('/ +/', ' ', $filtered) );
+	}
+
+	return apply_filters('sanitize_text_field', $filtered, $str);
+}
+endif;
\ No newline at end of file
diff --git a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/backpress/functions.plugin-api.php b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/backpress/functions.plugin-api.php
index 787a02bb4364d3bdf40c9b11c82c5c5670642660..60d55313f8b221443094a699405bda47948af44a 100644
--- a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/backpress/functions.plugin-api.php
+++ b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/backpress/functions.plugin-api.php
@@ -1,5 +1,5 @@
 <?php
-// Last sync [WP11537]
+// Last sync [WP14924]
 
 /**
  * The plugin API is located in this file, which allows for creating actions
@@ -55,7 +55,7 @@
  * @subpackage Plugin
  * @since 0.71
  * @global array $wp_filter Stores all of the filters added in the form of
- *	wp_filter['tag']['array of priorities']['array of functions serialized']['array of ['array (functions, accepted_args)]']
+ *	wp_filter['tag']['array of priorities']['array of functions serialized']['array of ['array (functions, accepted_args)']']
  * @global array $merged_filters Tracks the tags that need to be merged for later. If the hook is added, it doesn't need to run through that process.
  *
  * @param string $tag The name of the filter to hook the $function_to_add to.
@@ -175,6 +175,59 @@ function apply_filters($tag, $value) {
 	return $value;
 }
 
+/**
+ * Execute functions hooked on a specific filter hook, specifying arguments in an array.
+ *
+ * @see apply_filters() This function is identical, but the arguments passed to the
+ * functions hooked to <tt>$tag</tt> are supplied using an array.
+ *
+ * @package WordPress
+ * @subpackage Plugin
+ * @since 3.0.0
+ * @global array $wp_filter Stores all of the filters
+ * @global array $merged_filters Merges the filter hooks using this function.
+ * @global array $wp_current_filter stores the list of current filters with the current one last
+ *
+ * @param string $tag The name of the filter hook.
+ * @param array $args The arguments supplied to the functions hooked to <tt>$tag</tt>
+ * @return mixed The filtered value after all hooked functions are applied to it.
+ */
+function apply_filters_ref_array($tag, $args) {
+	global $wp_filter, $merged_filters, $wp_current_filter;
+
+	$wp_current_filter[] = $tag;
+
+	// Do 'all' actions first
+	if ( isset($wp_filter['all']) ) {
+		$all_args = func_get_args();
+		_wp_call_all_hook($all_args);
+	}
+
+	if ( !isset($wp_filter[$tag]) ) {
+		array_pop($wp_current_filter);
+		return $args[0];
+	}
+
+	// Sort
+	if ( !isset( $merged_filters[ $tag ] ) ) {
+		ksort($wp_filter[$tag]);
+		$merged_filters[ $tag ] = true;
+	}
+
+	reset( $wp_filter[ $tag ] );
+
+	do {
+		foreach( (array) current($wp_filter[$tag]) as $the_ )
+			if ( !is_null($the_['function']) )
+				$args[0] = call_user_func_array($the_['function'], array_slice($args, 0, (int) $the_['accepted_args']));
+
+	} while ( next($wp_filter[$tag]) !== false );
+
+	array_pop( $wp_current_filter );
+
+	return $args[0];
+}
+
 /**
  * Removes a function from a specified filter hook.
  *
@@ -224,7 +277,7 @@ function remove_all_filters($tag, $priority = false) {
 	global $wp_filter, $merged_filters;
 
 	if( isset($wp_filter[$tag]) ) {
-		if( false !== $priority && isset($$wp_filter[$tag][$priority]) )
+		if( false !== $priority && isset($wp_filter[$tag][$priority]) )
 			unset($wp_filter[$tag][$priority]);
 		else
 			unset($wp_filter[$tag]);
@@ -301,10 +354,13 @@ function add_action($tag, $function_to_add, $priority = 10, $accepted_args = 1)
 function do_action($tag, $arg = '') {
 	global $wp_filter, $wp_actions, $merged_filters, $wp_current_filter;
 
-	if ( is_array($wp_actions) )
-		$wp_actions[] = $tag;
+	if ( ! isset($wp_actions) )
+		$wp_actions = array();
+
+	if ( ! isset($wp_actions[$tag]) )
+		$wp_actions[$tag] = 1;
 	else
-		$wp_actions = array($tag);
+		++$wp_actions[$tag];
 
 	$wp_current_filter[] = $tag;
 
@@ -320,7 +376,7 @@ function do_action($tag, $arg = '') {
 	}
 
 	$args = array();
-	if ( is_array($arg) && 1 == count($arg) && is_object($arg[0]) ) // array(&$this)
+	if ( is_array($arg) && 1 == count($arg) && isset($arg[0]) && is_object($arg[0]) ) // array(&$this)
 		$args[] =& $arg[0];
 	else
 		$args[] = $arg;
@@ -359,10 +415,10 @@ function do_action($tag, $arg = '') {
 function did_action($tag) {
 	global $wp_actions;
 
-	if ( empty($wp_actions) )
+	if ( ! isset( $wp_actions ) || ! isset( $wp_actions[$tag] ) )
 		return 0;
 
-	return count(array_keys($wp_actions, $tag));
+	return $wp_actions[$tag];
 }
 
 /**
@@ -384,10 +440,13 @@ function did_action($tag) {
 function do_action_ref_array($tag, $args) {
 	global $wp_filter, $wp_actions, $merged_filters, $wp_current_filter;
 
-	if ( !is_array($wp_actions) )
-		$wp_actions = array($tag);
+	if ( ! isset($wp_actions) )
+		$wp_actions = array();
+
+	if ( ! isset($wp_actions[$tag]) )
+		$wp_actions[$tag] = 1;
 	else
-		$wp_actions[] = $tag;
+		++$wp_actions[$tag];
 
 	$wp_current_filter[] = $tag;
 
@@ -497,6 +556,7 @@ function plugin_basename($file) {
 	$mu_plugin_dir = str_replace('\\','/',WPMU_PLUGIN_DIR); // sanitize for Win32 installs
 	$mu_plugin_dir = preg_replace('|/+|','/', $mu_plugin_dir); // remove any duplicate slash
 	$file = preg_replace('#^' . preg_quote($plugin_dir, '#') . '/|^' . preg_quote($mu_plugin_dir, '#') . '/#','',$file); // get relative path from plugins dir
+	$file = trim($file, '/');
 	return $file;
 }
 
@@ -676,22 +736,36 @@ function _wp_filter_build_unique_id($tag, $function, $priority) {
 	global $wp_filter;
 	static $filter_id_count = 0;
 
-	// If function then just skip all of the tests and not overwrite the following.
 	if ( is_string($function) )
 		return $function;
-	// Object Class Calling
-	else if (is_object($function[0]) ) {
-		$obj_idx = get_class($function[0]).$function[1];
-		if ( !isset($function[0]->wp_filter_id) ) {
-			if ( false === $priority )
-				return false;
-			$obj_idx .= isset($wp_filter[$tag][$priority]) ? count((array)$wp_filter[$tag][$priority]) : 0;
-			$function[0]->wp_filter_id = $filter_id_count++;
-		} else
-			$obj_idx .= $function[0]->wp_filter_id;
-		return $obj_idx;
+
+	if ( is_object($function) ) {
+		// Closures are currently implemented as objects
+		$function = array( $function, '' );
+	} else {
+		$function = (array) $function;
 	}
-	// Static Calling
-	else if ( is_string($function[0]) )
+
+	if (is_object($function[0]) ) {
+		// Object Class Calling
+		if ( function_exists('spl_object_hash') ) {
+			return spl_object_hash($function[0]) . $function[1];
+		} else {
+			$obj_idx = get_class($function[0]).$function[1];
+			if ( !isset($function[0]->wp_filter_id) ) {
+				if ( false === $priority )
+					return false;
+				$obj_idx .= isset($wp_filter[$tag][$priority]) ? count((array)$wp_filter[$tag][$priority]) : $filter_id_count;
+				$function[0]->wp_filter_id = $filter_id_count;
+				++$filter_id_count;
+			} else {
+				$obj_idx .= $function[0]->wp_filter_id;
+			}
+
+			return $obj_idx;
+		}
+	} else if ( is_string($function[0]) ) {
+		// Static Calling
 		return $function[0].$function[1];
+	}
 }
diff --git a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/backpress/functions.shortcodes.php b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/backpress/functions.shortcodes.php
index d3cf27f881af8e8250fe96a2b3cadb5159cd2f18..fda545c7bab3f43bd0188d4f0de8627afdba0cdb 100644
--- a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/backpress/functions.shortcodes.php
+++ b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/backpress/functions.shortcodes.php
@@ -1,5 +1,5 @@
 <?php
-// Last sync [WP11537]
+// Last sync [WP12206]
 
 /**
  * WordPress API for creating bbcode like tags or what WordPress calls
@@ -177,6 +177,7 @@ function get_shortcode_regex() {
 	$tagnames = array_keys($shortcode_tags);
 	$tagregexp = join( '|', array_map('preg_quote', $tagnames) );
 
+	// WARNING! Do not change this regex without changing do_shortcode_tag() and strip_shortcodes()
 	return '(.?)\[('.$tagregexp.')\b(.*?)(?:(\/))?\](?:(.+?)\[\/\2\])?(.?)';
 }
 
@@ -291,5 +292,5 @@ function strip_shortcodes( $content ) {
 
 	$pattern = get_shortcode_regex();
 
-	return preg_replace('/'.$pattern.'/s', '', $content);
+	return preg_replace('/'.$pattern.'/s', '$1$6', $content);
 }
diff --git a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/backpress/functions.wp-cron.php b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/backpress/functions.wp-cron.php
index 1b9b980b46b3db5e828d4fb49591286bd3d8acea..25c54181db4bd2a70074812ffbdbf645727cda0b 100644
--- a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/backpress/functions.wp-cron.php
+++ b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/backpress/functions.wp-cron.php
@@ -1,5 +1,5 @@
 <?php
-// Last sync [WP11537]
+// Last sync [WP12462]
 
 /**
  * WordPress CRON API
@@ -10,7 +10,7 @@
 /**
  * Schedules a hook to run only once.
  *
- * Schedules a hook which will be executed once by the Wordpress actions core at
+ * Schedules a hook which will be executed once by the WordPress actions core at
  * a time which you specify. The action will fire off when someone visits your
  * WordPress site, if the schedule time has passed.
  *
@@ -132,10 +132,13 @@ function wp_unschedule_event( $timestamp, $hook, $args = array() ) {
  * @since 2.1.0
  *
  * @param string $hook Action hook, the execution of which will be unscheduled.
- * @param mixed $args,... Optional. Event arguments.
+ * @param array $args Optional. Arguments that were to be pass to the hook's callback function.
  */
-function wp_clear_scheduled_hook( $hook ) {
-	$args = array_slice( func_get_args(), 1 );
+function wp_clear_scheduled_hook( $hook, $args = array() ) {
+	// Backward compatibility
+	// Previously this function took the arguments as discrete vars rather than an array like the rest of the API
+	if ( !is_array($args) )
+		$args = array_slice( func_get_args(), 1 );
 
 	while ( $timestamp = wp_next_scheduled( $hook, $args ) )
 		wp_unschedule_event( $timestamp, $hook, $args );
diff --git a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/backpress/functions.wp-scripts.php b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/backpress/functions.wp-scripts.php
index 0a60c96878c85fa2c798ef543c8dc5931304d797..f284435efd75c270668220250f0cb4c0c3bc040f 100644
--- a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/backpress/functions.wp-scripts.php
+++ b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/backpress/functions.wp-scripts.php
@@ -38,7 +38,12 @@ function wp_print_scripts( $handles = false ) {
  * Register new JavaScript file.
  *
  * @since r16
- * @see WP_Dependencies::add() For parameter information.
+ * @param string $handle Script name
+ * @param string $src Script url
+ * @param array $deps (optional) Array of script names on which this script depends
+ * @param string|bool $ver (optional) Script version (used for cache busting), set to NULL to disable
+ * @param bool (optional) Wether to enqueue the script before </head> or before </body>
+ * @return null
  */
 function wp_register_script( $handle, $src, $deps = array(), $ver = false, $in_footer = false ) {
 	global $wp_scripts;
@@ -56,7 +61,7 @@ function wp_register_script( $handle, $src, $deps = array(), $ver = false, $in_f
  * Localizes only if script has already been added.
  *
  * @since r16
- * @see WP_Script::localize()
+ * @see WP_Scripts::localize()
  */
 function wp_localize_script( $handle, $object_name, $l10n ) {
 	global $wp_scripts;
@@ -86,8 +91,8 @@ function wp_deregister_script( $handle ) {
  * Registers the script if src provided (does NOT overwrite) and enqueues.
  *
  * @since r16
- * @see WP_Script::add(), WP_Script::enqueue()
-*/
+ * @see wp_register_script() For parameter information.
+ */
 function wp_enqueue_script( $handle, $src = false, $deps = array(), $ver = false, $in_footer = false ) {
 	global $wp_scripts;
 	if ( !is_a($wp_scripts, 'WP_Scripts') )
diff --git a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/backpress/functions.wp-styles.php b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/backpress/functions.wp-styles.php
index 22d1e160d5d83827c99eed2142f5c0127f7318d0..af16cf160611ef188ac82b8e7e61cca4387c52fc 100644
--- a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/backpress/functions.wp-styles.php
+++ b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/backpress/functions.wp-styles.php
@@ -13,7 +13,8 @@
  * @uses do_action() Calls 'wp_print_styles' hook.
  * @global object $wp_styles The WP_Styles object for printing styles.
  *
- * @param array $handles (optional) Styles to be printed.  (void) prints queue, (string) prints that style, (array of strings) prints those styles.
+ * @param array|bool $handles Styles to be printed. An empty array prints the queue,
+ *  an array with one string prints that style, and an array of strings prints those styles.
  * @return bool True on success, false on failure.
  */
 function wp_print_styles( $handles = false ) {
@@ -36,7 +37,17 @@ function wp_print_styles( $handles = false ) {
  * Register CSS style file.
  *
  * @since r79
- * @see WP_Styles::add() For parameter and additional information.
+ * @see WP_Styles::add() For additional information.
+ * @global object $wp_styles The WP_Styles object for printing styles.
+ * @link http://www.w3.org/TR/CSS2/media.html#media-types List of CSS media types.
+ *
+ * @param string $handle Name of the stylesheet.
+ * @param string|bool $src Path to the stylesheet from the root directory of WordPress. Example: '/css/mystyle.css'.
+ * @param array $deps Array of handles of any stylesheet that this stylesheet depends on.
+ *  (Stylesheets that must be loaded before this stylesheet.) Pass an empty array if there are no dependencies.
+ * @param string|bool $ver String specifying the stylesheet version number. Set to NULL to disable.
+ *  Used to ensure that the correct version is sent to the client regardless of caching.
+ * @param string $media The media for which this stylesheet has been defined.
  */
 function wp_register_style( $handle, $src, $deps = array(), $ver = false, $media = 'all' ) {
 	global $wp_styles;
@@ -50,7 +61,10 @@ function wp_register_style( $handle, $src, $deps = array(), $ver = false, $media
  * Remove a registered CSS file.
  *
  * @since r79
- * @see WP_Styles::remove() For parameter and additional information.
+ * @see WP_Styles::remove() For additional information.
+ * @global object $wp_styles The WP_Styles object for printing styles.
+ *
+ * @param string $handle Name of the stylesheet.
  */
 function wp_deregister_style( $handle ) {
 	global $wp_styles;
@@ -63,8 +77,21 @@ function wp_deregister_style( $handle ) {
 /**
  * Enqueue a CSS style file.
  *
+ * Registers the style if src provided (does NOT overwrite) and enqueues.
+ *
  * @since r79
  * @see WP_Styles::add(), WP_Styles::enqueue()
+ * @global object $wp_styles The WP_Styles object for printing styles.
+ * @link http://www.w3.org/TR/CSS2/media.html#media-types List of CSS media types.
+ *
+ * @param string $handle Name of the stylesheet.
+ * @param string|bool $src Path to the stylesheet from the root directory of WordPress. Example: '/css/mystyle.css'.
+ * @param array $deps Array of handles (names) of any stylesheet that this stylesheet depends on.
+ *  (Stylesheets that must be loaded before this stylesheet.) Pass an empty array if there are no dependencies.
+ * @param string|bool $ver String specifying the stylesheet version number, if it has one. This parameter
+ *  is used to ensure that the correct version is sent to the client regardless of caching, and so should be included
+ *  if a version number is available and makes sense for the stylesheet.
+ * @param string $media The media for which this stylesheet has been defined.
  */
 function wp_enqueue_style( $handle, $src = false, $deps = array(), $ver = false, $media = false ) {
 	global $wp_styles;
@@ -81,18 +108,18 @@ function wp_enqueue_style( $handle, $src = false, $deps = array(), $ver = false,
 /**
  * Check whether style has been added to WordPress Styles.
  *
- * The values for list defaults to 'queue', which is the same as enqueue for
- * styles.
+ * The values for list defaults to 'queue', which is the same as wp_enqueue_style().
  *
  * @since WP unknown; BP unknown
+ * @global object $wp_styles The WP_Styles object for printing styles.
  *
- * @param string $handle Handle used to add style.
- * @param string $list Optional, defaults to 'queue'. Others values are 'registered', 'queue', 'done', 'to_do'
- * @return bool
+ * @param string $handle Name of the stylesheet.
+ * @param string $list Values are 'registered', 'done', 'queue' and 'to_do'.
+ * @return bool True on success, false on failure.
  */
 function wp_style_is( $handle, $list = 'queue' ) {
 	global $wp_styles;
-	if ( !is_a($wp_styles, 'WP_Scripts') )
+	if ( !is_a($wp_styles, 'WP_Styles') )
 		$wp_styles = new WP_Styles();
 
 	$query = $wp_styles->query( $handle, $list );
diff --git a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/backpress/interface.bp-options.php b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/backpress/interface.bp-options.php
index 9e77e4a1a1dd0c0be363482fa34a42b3a6437a17..bd200acd9575aaf93fa75dfa3c4b9952135b868c 100644
--- a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/backpress/interface.bp-options.php
+++ b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/backpress/interface.bp-options.php
@@ -34,7 +34,6 @@ interface BP_Options_Interface
 	 * - application_id     : An id for the application, use this when running multiple applications from the same code
 	 * - application_uri    : The base URI of the application
 	 * - cron_uri           : The URI that processes cron jobs
-	 * - cron_check         : A unique hash to check that the cron call is valid
 	 * - wp_http_version    : This is the version sent when making remote HTTP requests
 	 * - hash_function_name : The function used to create unique hashes ( see wp_hash() )
 	 * - language_locale    : The current locale
diff --git a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/backpress/license.txt b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/backpress/license.txt
new file mode 100644
index 0000000000000000000000000000000000000000..d511905c1647a1e311e8b20d5930a37a9c2531cd
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/backpress/license.txt
@@ -0,0 +1,339 @@
+		    GNU GENERAL PUBLIC LICENSE
+		       Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 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 Lesser 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
+
+	    How to Apply These Terms to Your New Programs
+
+  If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+  To do so, attach the following notices to the program.  It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+    <one line to give the program's name and a brief idea of what it does.>
+    Copyright (C) <year>  <name of author>
+
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License along
+    with this program; if not, write to the Free Software Foundation, Inc.,
+    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+    Gnomovision version 69, Copyright (C) year name of author
+    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+    This is free software, and you are welcome to redistribute it
+    under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License.  Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary.  Here is a sample; alter the names:
+
+  Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+  `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+  <signature of Ty Coon>, 1 April 1989
+  Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs.  If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library.  If this is what you want to do, use the GNU Lesser General
+Public License instead of this License.
diff --git a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/class.bb-dir-map.php b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/class.bb-dir-map.php
index 4f28bcf988b876a0bbc26fa45d01f276d03806b3..314e034056c7a42d6aeda9fc749421d508916cc1 100644
--- a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/class.bb-dir-map.php
+++ b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/class.bb-dir-map.php
@@ -66,7 +66,7 @@ class BB_Dir_Map {
 	function map( $root = false ) {
 		$return = array();
 		$_dir = dir($root ? $root : $this->_current_root);
-		while ( false !== ( $this->_current_file = $_dir->read() ) ) {
+		while ( $_dir && false !== ( $this->_current_file = $_dir->read() ) ) {
 			if ( in_array($this->_current_file, array('.', '..')) )
 				continue;
 			if ( !$this->dots && '.' == $this->_current_file{0} )
diff --git a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/class.bb-query.php b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/class.bb-query.php
index 50209fda845ec8d0824e128600f7f387c6123c96..8ce1b2b8091f61ea7df5bcc345bfce3420aeba4e 100644
--- a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/class.bb-query.php
+++ b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/class.bb-query.php
@@ -55,7 +55,7 @@ class BB_Query {
 		$key = md5( $this->request );
 		if ( false === $cached_ids = wp_cache_get( $key, 'bb_query' ) ) {
 			if ( 'post' == $this->type ) {
-				$this->results = bb_cache_posts( $this->request ); // This always appends meta
+				$this->results = bb_cache_posts( $this->request, $this->query_vars['post_id_only'] ); // This always appends meta
 				$_the_id = 'post_id';
 				$this->query_vars['append_meta'] = false;
 			} else {
@@ -198,10 +198,12 @@ class BB_Query {
 		// parameters commented out are handled farther down
 
 		$ints = array(
-//			'page',		// Defaults to global or number in URI
-//			'per_page',	// Defaults to page_topics
-			'tag_id',	// one tag ID
-			'favorites'	// one user ID
+//			'page',		 // Defaults to global or number in URI
+//			'per_page',	 // Defaults to page_topics
+			'tag_id',	 // one tag ID
+			'favorites', // one user ID,
+			'offset',	 // first item to query
+			'number'	 // number of items to retrieve
 		);
 
 		$parse_ints = array(
@@ -262,7 +264,8 @@ class BB_Query {
 //			'append_meta',	// *true, false: topics only
 //			'cache_users',	// *true, false
 //			'cache_topics,	// *true, false: posts only
-			'cache_posts'	// not implemented: none, first, last
+//			'post_id_only', // true, *false: this query is only returning post IDs
+			'cache_posts'	 // not implemented: none, first, last
 		);
 
 		foreach ( $ints as $key )
@@ -309,6 +312,7 @@ class BB_Query {
 		$array['append_meta']  = isset($array['append_meta'])  ? (int) (bool) $array['append_meta']  : 1;
 		$array['cache_users']  = isset($array['cache_users'])  ? (int) (bool) $array['cache_users']  : 1;
 		$array['cache_topics'] = isset($array['cache_topics']) ? (int) (bool) $array['cache_topics'] : 1;
+		$array['post_id_only'] = isset($array['post_id_only']) ? (int) (bool) $array['post_id_only'] : 1;
 
 		// Only one FULLTEXT search per query please
 		if ( $array['search'] )
@@ -434,16 +438,11 @@ class BB_Query {
 				$where .= " AND t.forum_id = $q[forum_id]";
 			endif;
 
-			/* Convert to JOIN after new taxonomy tables are in */
-
 			if ( $q['tag'] && !is_int($q['tag_id']) )
 				$q['tag_id'] = (int) bb_get_tag_id( $q['tag'] );
 
 			if ( is_numeric($q['tag_id']) ) :
-				if ( $tagged_topic_ids = bb_get_tagged_topic_ids( $q['tag_id'] ) )
-					$where .= " AND t.topic_id IN (" . join(',', $tagged_topic_ids) . ")";
-				else
-					$where .= " AND 0 /* No such tag */";
+				$join .= " JOIN `$bbdb->term_relationships` AS tr ON ( t.`topic_id` = tr.`object_id` AND tr.`term_taxonomy_id` = $q[tag_id] )";
 			endif;
 
 			if ( is_numeric($q['favorites']) && $f_user = bb_get_user( $q['favorites'] ) )
@@ -577,10 +576,7 @@ class BB_Query {
 				$q['tag_id'] = (int) bb_get_tag_id( $q['tag'] );
 
 			if ( is_numeric($q['tag_id']) ) :
-				if ( $tagged_topic_ids = bb_get_tagged_topic_ids( $q['tag_id'] ) )
-					$where .= " AND p.topic_id IN (" . join(',', $tagged_topic_ids) . ")";
-				else
-					$where .= " AND 0 /* No such tag */";
+				$join .= " JOIN `$bbdb->term_relationships` AS tr ON ( p.`topic_id` = tr.`object_id` AND tr.`term_taxonomy_id` = $q[tag_id] )";
 			endif;
 
 			if ( is_numeric($q['favorites']) && $f_user = bb_get_user( $q['favorites'] ) )
@@ -725,15 +721,25 @@ class BB_Query {
 		else
 			$bits['order_by'] .= " DESC";
 
-		if ( !$q['per_page'] )
-			$q['per_page'] = (int) bb_get_option( 'page_topics' );
-
 		$bits['limit'] = '';
-		if ( $q['per_page'] > 0 ) :
-			if ( $q['page'] > 1 )
-				$bits['limit'] .= $q['per_page'] * ( $q['page'] - 1 ) . ", ";
-			$bits['limit'] .= $q['per_page'];
-		endif;
+
+		// When offset and number are provided, skip per_page and limit checks
+		if ( !empty( $q['offset'] ) && !empty( $q['number'] ) ) {
+			$bits['limit'] .= $q['offset'] . ", " . $q['number'];
+
+		// Else proceed as normal
+		} else {
+			if ( !$q['per_page'] ) {
+				$q['per_page'] = (int) bb_get_option( 'page_topics' );
+			}
+	
+			if ( $q['per_page'] > 0 ) {
+				if ( $q['page'] > 1 ) {
+					$bits['limit'] .= $q['per_page'] * ( $q['page'] - 1 ) . ", ";
+				}
+				$bits['limit'] .= $q['per_page'];
+			}
+		}
 
 		$name = "get_{$this->type}s_";
 
@@ -940,7 +946,7 @@ class BB_Query_Form extends BB_Query {
 
 		if ( $forum ) {
 			$r .= "\t<div><label for=\"forum-id\">" . __('Forum')  . "</label>\n";
-			$r .= "\t\t<div>" . bb_get_forum_dropdown( array( 'selected' => $q_forum_id, 'none' => __('Any'), 'id' => 'forum-id' ) ) . "</div>\n";
+			$r .= "\t\t<div>" . bb_get_forum_dropdown( array( 'selected' => $q_forum_id, 'none' => __('Any') ) ) . "</div>\n";
 			$r .= "\t</div>\n\n";
 		}
 
@@ -965,7 +971,7 @@ class BB_Query_Form extends BB_Query {
 			$r .= "\t</div>\n\n";
 		}
 
-		$stati = apply_filters( 'bb_query_form_post_status', array( 'all' => __('All'), '0' => __('Normal'), '1' => __('Deleted') ), $this->type );
+		$stati = apply_filters( 'bb_query_form_post_status', array( 'all' => _x( 'All', 'post status' ), '0' => __('Normal'), '1' => __('Deleted') ), $this->type );
 
 		if ( $topic_status ) {
 			$r .= "\t<div><label for=\"topic-status\">" . __('Topic status') . "</label>\n";
@@ -998,7 +1004,7 @@ class BB_Query_Form extends BB_Query {
 		if ( $open ) {
 			$r .= "\t<div><label for=\"topic-open\">" . __('Open?') . "</label>\n";
 			$r .= "\t\t<div><select name='open' id='topic-open'>\n";
-			foreach ( array( 'all' => __('All'), '1' => _x( 'Open', 'posting status' ), '0' => __('Closed') ) as $status => $label ) {
+			foreach ( array( 'all' => _x( 'All', 'posting status' ), '1' => _x( 'Open', 'posting status' ), '0' => __('Closed') ) as $status => $label ) {
 				$label = esc_html( $label );
 				$selected = (string) $status == (string) $q_open ? " selected='selected'" : '';
 				$r .= "\t\t\t<option value='$status'$selected>$label</option>\n";
@@ -1014,6 +1020,8 @@ class BB_Query_Form extends BB_Query {
 			$r .= "\t</div>\n\n";
 		}
 
+		$r .= apply_filters( 'bb_query_form_inputs', '', $args, $query_vars );
+
 		$r .= "\t<div class=\"submit\"><label for=\"$id-submit\">" . __('Search') . "</label>\n";
 		$r .= "\t\t<div><input type='submit' class='button submit-input' value='$submit' id='$id-submit' /></div>\n";
 		$r .= "\t</div>\n";
diff --git a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/class.bb-walker.php b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/class.bb-walker.php
index 378e058dd6da316ba0991afd47dfa90b804bccc5..b398c9334a77a720acc5eea68f033e3a69805ed7 100644
--- a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/class.bb-walker.php
+++ b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/class.bb-walker.php
@@ -200,7 +200,7 @@ class BB_Loop {
 			return false;
 
 		foreach ( $array as $key )
-			$this->_preserve[$key] = $GLOBALS[$key];
+			$this->_preserve[$key] = isset( $GLOBALS[$key] ) ? $GLOBALS[$key] : null;
 	}
 
 	function reinstate() {
diff --git a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/defaults.bb-filters.php b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/defaults.bb-filters.php
index 937f5221d1ac4b2cb27139c6396064b389917c45..4ae3b3093e3df0df04e75cc64ddb6d61a0d4cec8 100644
--- a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/defaults.bb-filters.php
+++ b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/defaults.bb-filters.php
@@ -29,6 +29,7 @@ foreach ( $filters as $filter ) {
 
 // Slugs
 add_filter( 'pre_term_slug', 'bb_pre_term_slug' );
+add_filter( 'editable_slug', 'urldecode');
 
 // DB truncations
 add_filter( 'pre_topic_title', 'bb_trim_for_db_150', 9999 );
@@ -115,16 +116,23 @@ if ( !bb_get_option( 'mod_rewrite' ) ) {
 function bb_filter_feed_content()
 {
 	if ( bb_is_feed() ) {
-		add_filter( 'bb_title_rss', 'ent2ncr' );
-		add_filter( 'topic_title', 'ent2ncr' );
+		add_filter( 'bb_title_rss', 'strip_tags' );
+		add_filter( 'bb_title_rss', 'ent2ncr', 8 );
+		add_filter( 'bb_title_rss', 'esc_html' );
+
+		add_filter( 'bb_description_rss', 'strip_tags' );
+		add_filter( 'bb_description_rss', 'ent2ncr', 8 );
+		add_filter( 'bb_description_rss', 'esc_html' );
+
+		add_filter( 'post_author', 'ent2ncr', 8 );
 		add_filter( 'post_link', 'esc_html' );
-		add_filter( 'post_text', 'htmlspecialchars' ); // encode_bad should not be overruled by esc_html
-		add_filter( 'post_text', 'ent2ncr' );
+		add_filter( 'post_text', 'ent2ncr', 8 );
+		add_filter( 'post_text', 'bb_convert_chars' );
 	}
 }
 add_action( 'bb_init', 'bb_filter_feed_content' );
 
-add_filter( 'init_roles', 'bb_init_roles' );
+add_action( 'init_roles', 'bb_init_roles' );
 add_filter( 'map_meta_cap', 'bb_map_meta_cap', 1, 4 );
 
 // Actions
@@ -152,4 +160,16 @@ add_action( 'set_current_user', 'bb_apply_wp_role_map_to_user' );
 
 add_filter( 'bb_pre_get_option_gmt_offset', 'wp_timezone_override_offset' );
 
+// Subscriptions
+
+if ( bb_is_subscriptions_active() ) {
+	add_action( 'bb_new_post', 'bb_notify_subscribers' );
+	add_action( 'bb_insert_post', 'bb_user_subscribe_checkbox_update' );
+	add_action( 'topicmeta', 'bb_user_subscribe_link' );
+	add_action( 'edit_form', 'bb_user_subscribe_checkbox' ); 
+	add_action( 'post_form', 'bb_user_subscribe_checkbox' );
+}
+
+add_action( 'bb_post-form.php', 'bb_anonymous_post_form' );
+
 unset( $filters, $filter );
diff --git a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/functions.bb-capabilities.php b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/functions.bb-capabilities.php
index ffcf2152834d51d88276cd6495bb260c5a97c247..1a3ffeb6a046c9e325acc45788e5c959f38b746b 100644
--- a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/functions.bb-capabilities.php
+++ b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/functions.bb-capabilities.php
@@ -25,6 +25,8 @@ function bb_current_user_can($capability) {
 
 	if ( empty($bb_current_user) ) {
 		$retvalue = false;
+		if ( ( $capability == 'write_topic' || $capability == 'write_topics' ) && !bb_is_login_required() )
+			$retvalue = true;
 	} else {
 		$retvalue = call_user_func_array(array(&$bb_current_user, 'has_cap'), $args);
 	}
diff --git a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/functions.bb-core.php b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/functions.bb-core.php
index d7a12524c863cfed51d16ead280f893741145843..95f84eaa9895871846082a8c2112be50442ccf60 100644
--- a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/functions.bb-core.php
+++ b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/functions.bb-core.php
@@ -24,6 +24,20 @@
 function bb_log_deprecated( $type, $name, $replacement = 'none' ) {
 	global $bb_log;
 	$bb_log->notice( sprintf( __( 'Using deprecated bbPress %1$s - %2$s - replace with - %3$s' ), $type, $name, $replacement ) );
+
+	if ( $bb_log->level & BP_LOG_DEBUG && $bb_log->level & BP_LOG_NOTICE ) { // Only compute the location if we're going to log it.
+		$backtrace = debug_backtrace();
+
+		$file = $backtrace[2]['file'];
+
+		if ( substr( $file, 0, strlen( BB_PATH ) - 1 ) == rtrim( BB_PATH, '\\/') )
+			$file = substr( $file, strlen( BB_PATH ) );
+
+		$file = str_replace( '\\', '/', $file );
+
+		// 0 = this function, 1 = the deprecated function
+		$bb_log->notice( '    ' . sprintf( __( 'on line %1$d of file %2$s' ), $backtrace[2]['line'], $file ) );
+	}
 }
 
 /**
@@ -767,15 +781,13 @@ function bb_repermalink() {
 			$permalink = get_favorites_link();
 			break;
 		case 'tag-page': // It's not an integer and tags.php pulls double duty.
-			if ( isset($_GET['tag']) )
-				$id = $_GET['tag'];
-			$_original_id = $id;
-			if ( !$id )
+			$id = ( isset($_GET['tag']) ) ? $_GET['tag'] : false;
+			if ( ! $id || ! bb_get_tag( (string) $id ) )
 				$permalink = bb_get_tag_page_link();
 			else {
 				global $tag, $tag_name;
 				$tag_name = $id;
-				$tag = bb_get_tag( (string) $tag_name );
+				$tag = bb_get_tag( (string) $id );
 				$permalink = bb_get_tag_link( 0, $page ); // 0 => grabs $tag from global.
 			}
 			break;
@@ -819,7 +831,7 @@ function bb_repermalink() {
 	$bb_log->debug($uri, 'bb_repermalink() ' . __('REQUEST_URI'));
 	$bb_log->debug($check, 'bb_repermalink() ' . __('should be'));
 	$bb_log->debug($permalink, 'bb_repermalink() ' . __('full permalink'));
-	$bb_log->debug($_SERVER['PATH_INFO'], 'bb_repermalink() ' . __('PATH_INFO'));
+	$bb_log->debug(isset($_SERVER['PATH_INFO']) ? $_SERVER['PATH_INFO'] : null, 'bb_repermalink() ' . __('PATH_INFO'));
 
 	if ( $check != $uri && $check != str_replace(urlencode($_original_id), $_original_id, $uri) ) {
 		if ( $issue_404 && rtrim( $check, " \t\n\r\0\x0B/" ) !== rtrim( $uri, " \t\n\r\0\x0B/" ) ) {
@@ -1203,7 +1215,7 @@ function bb_die( $message, $title = '', $header = 0 ) {
 			break;
 		endswitch;
 	} elseif ( is_string( $message ) ) {
-		$message = "<p>$message</p>";
+		$message = bb_autop( $message );
 	}
 
 	if ( empty($title) )
@@ -1211,7 +1223,7 @@ function bb_die( $message, $title = '', $header = 0 ) {
 	
 	bb_install_header( $title );
 ?>
-	<p><?php echo $message; ?></p>
+	<?php echo $message; ?>
 <?php
 	if ($uri = bb_get_uri()) {
 ?>
diff --git a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/functions.bb-deprecated.php b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/functions.bb-deprecated.php
index 8cfcb98c880934455fffcbaff6dbef0de72d7b11..88dd1c76ed52baf0a29188a8a50342fc2972b19c 100644
--- a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/functions.bb-deprecated.php
+++ b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/functions.bb-deprecated.php
@@ -1180,3 +1180,14 @@ if ( !function_exists( 'update_user_status' ) ) {
 		return bb_update_user_status( $user_id, $user_status );
 	}
 }
+
+function bb_get_current_commenter() {
+	bb_log_deprecated( 'function', __FUNCTION__, 'bb_get_current_poster' );
+	extract( bb_get_current_poster() );
+	return array( 'comment_author' => $post_author, 'comment_email' => $post_author_email, 'comment_author_url' => $post_author_url );
+}
+
+function bb_check_comment_flood( $ip = '', $email = '', $date = '' ) {
+	bb_log_deprecated( 'function', __FUNCTION__, 'bb_check_post_flood' );
+	bb_check_post_flood();
+}
diff --git a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/functions.bb-formatting.php b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/functions.bb-formatting.php
index eae5e7d58a937b74f3f260debcdc84221200d09c..e4b8e1d914931441b38ebd14fe150f7ef75ad33d 100644
--- a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/functions.bb-formatting.php
+++ b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/functions.bb-formatting.php
@@ -271,15 +271,24 @@ function bb_pre_sanitize_with_dashes_utf8( $text, $_text = '', $length = 0 ) {
 	return $text;
 }
 
+function bb_show_topic_context( $term, $text ) {
+	$text = strip_tags( $text );
+	$term = preg_quote( $term );
+	$text = preg_replace( "|.*?(.{0,80})$term(.{0,80}).*|is", "$1<strong>$term</strong>$2", $text, 1 );
+	$text = substr( $text, 0, 210 );
+	return $text;
+}
+
 function bb_post_text_context( $post_text ) {
 	return bb_show_context( $GLOBALS['q'], $post_text );
 }
 
 function bb_show_context( $term, $text ) {
-	$text = strip_tags($text);
-	$term = preg_quote($term);
-	$text = preg_replace("|.*?(.{0,80})$term(.{0,80}).*|is", "... $1<strong>$term</strong>$2 ...", $text, 1);
-	$text = substr($text, 0, 210);
+	$text = strip_shortcodes( $text );
+	$text = strip_tags( $text );
+	$term = preg_quote( $term );
+	$text = preg_replace( "|.*?(.{0,80})$term(.{0,80}).*|is", "... $1<strong>$term</strong>$2 ...", $text, 1 );
+	$text = substr( $text, 0, 210 );
 	return $text;
 }
 
@@ -329,3 +338,68 @@ function bb_gmtstrtotime( $string ) {
 
 	return $time;
 }
+
+/**
+ * Converts a number of characters from a string.
+ *
+ * Metadata tags <<title>> and <<category>> are removed, <<br>> and <<hr>> are
+ * converted into correct XHTML and Unicode characters are converted to the
+ * valid range.
+ *
+ * @param string $content String of characters to be converted.
+ * 
+ * @return string Converted string.
+ */
+function bb_convert_chars( $content ) {
+	// Translation of invalid Unicode references range to valid range
+	$wp_htmltranswinuni = array(
+	'&#128;' => '&#8364;', // the Euro sign
+	'&#129;' => '',
+	'&#130;' => '&#8218;', // these are Windows CP1252 specific characters
+	'&#131;' => '&#402;',  // they would look weird on non-Windows browsers
+	'&#132;' => '&#8222;',
+	'&#133;' => '&#8230;',
+	'&#134;' => '&#8224;',
+	'&#135;' => '&#8225;',
+	'&#136;' => '&#710;',
+	'&#137;' => '&#8240;',
+	'&#138;' => '&#352;',
+	'&#139;' => '&#8249;',
+	'&#140;' => '&#338;',
+	'&#141;' => '',
+	'&#142;' => '&#382;',
+	'&#143;' => '',
+	'&#144;' => '',
+	'&#145;' => '&#8216;',
+	'&#146;' => '&#8217;',
+	'&#147;' => '&#8220;',
+	'&#148;' => '&#8221;',
+	'&#149;' => '&#8226;',
+	'&#150;' => '&#8211;',
+	'&#151;' => '&#8212;',
+	'&#152;' => '&#732;',
+	'&#153;' => '&#8482;',
+	'&#154;' => '&#353;',
+	'&#155;' => '&#8250;',
+	'&#156;' => '&#339;',
+	'&#157;' => '',
+	'&#158;' => '',
+	'&#159;' => '&#376;'
+	);
+
+	// Remove metadata tags
+	$content = preg_replace( '/<title>(.+?)<\/title>/', '', $content );
+	$content = preg_replace( '/<category>(.+?)<\/category>/', '', $content );
+
+	// Converts lone & characters into &#38; (a.k.a. &amp;)
+	$content = preg_replace( '/&([^#])(?![a-z1-4]{1,8};)/i', '&#038;$1', $content );
+
+	// Fix Word pasting
+	$content = strtr( $content, $wp_htmltranswinuni );
+
+	// Just a little XHTML help
+	$content = str_replace( '<br>', '<br />', $content );
+	$content = str_replace( '<hr>', '<hr />', $content );
+
+	return $content;
+}
\ No newline at end of file
diff --git a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/functions.bb-forums.php b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/functions.bb-forums.php
index 5ae3320fe4394e9bd4eebb570ce30f71d764cee4..85e6f1e320ce513d661846dbc78b8fc31e88e06b 100644
--- a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/functions.bb-forums.php
+++ b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/functions.bb-forums.php
@@ -44,9 +44,11 @@ function _bb_get_cached_data( $keys, $group, $callback ) {
 	$return = array();
 	foreach ( $keys as $key ) {
 		// should use wp_cache_get_multi if available
-		if ( false === $value = wp_cache_get( $key, $group ) )
-			if ( !$value = call_user_func( $group, $key ) )
+		if ( false === $value = wp_cache_get( $key, $group ) ) {
+			if ( !$value = call_user_func( $callback, $key ) ) {
 				continue;
+			}
+		}
 		$return[$key] = $value;
 	}
 	return $return;
@@ -75,7 +77,7 @@ function bb_get_forums( $args = null ) {
 	$where = apply_filters( 'get_forums_where', $where );
 	$key = md5( serialize( $where . '|' . $order_by ) ); // The keys that change the SQL query
 	if ( false !== $forum_ids = wp_cache_get( $key, 'bb_forums' ) ) {
-		$forums = _bb_get_cached_data( $forum_ids, 'bb_forum', 'get_forum' );
+		$forums = _bb_get_cached_data( $forum_ids, 'bb_forum', 'bb_get_forum' );
 	} else {
 		$forum_ids = array();
 		$forums = array();
@@ -131,27 +133,25 @@ function bb_get_forum( $id ) {
 	}
 
 	// not else
-	if ( is_numeric($id) ) {
-		$id = (int) $id;
-		$sql = "forum_id = $id";
-	}
+	if ( is_numeric($id) )
+		$sql = $bbdb->prepare( "forum_id = %d", $id );
 
-	if ( 0 === $id || !$sql )
+	if ( 0 === $id || empty( $sql ) )
 		return false;
 
 	// $where is NOT bbdb:prepared
 	if ( $where = apply_filters( 'get_forum_where', '' ) ) {
-		$forum = $bbdb->get_row( $bbdb->prepare( "SELECT * FROM $bbdb->forums WHERE forum_id = %d", $id ) . " $where" );
+		$forum = $bbdb->get_row( "SELECT * FROM $bbdb->forums WHERE $sql $where" );
 		return bb_append_meta( $forum, 'forum' );
 	}
 
 	if ( is_numeric($id) && false !== $forum = wp_cache_get( $id, 'bb_forum' ) )
 		return $forum;
 
-	$forum = $bbdb->get_row( $bbdb->prepare( "SELECT * FROM $bbdb->forums WHERE $sql", $id ) );
+	$forum = $bbdb->get_row( "SELECT * FROM $bbdb->forums WHERE $sql" );
 	$forum = bb_append_meta( $forum, 'forum' );
 	wp_cache_set( $forum->forum_id, $forum, 'bb_forum' );
-	wp_cache_add( $forum->forum_slug, $forum, 'bb_forum_slug' );
+	wp_cache_add( $forum->forum_slug, $forum->forum_id, 'bb_forum_slug' );
 
 	return $forum;
 }
diff --git a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/functions.bb-l10n.php b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/functions.bb-l10n.php
index a5c1bef3cf2a1dff8b16d39a556ef45af3ff6ee1..7eeb5bebd617483d235668ac862dda9f08ff8a71 100644
--- a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/functions.bb-l10n.php
+++ b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/functions.bb-l10n.php
@@ -481,7 +481,7 @@ if ( !function_exists( 'get_translations_for_domain' ) ) :
  */
 function &get_translations_for_domain( $domain ) {
 	global $l10n;
-	$empty = &new Translations;
+	$empty =& new Translations;
 	if ( isset($l10n[$domain]) )
 		return $l10n[$domain];
 	else
diff --git a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/functions.bb-meta.php b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/functions.bb-meta.php
index b48996cc2138a812b875140a12fa693446a74039..edcda6d9768699e6c498b5dab342c8ab73e332e0 100644
--- a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/functions.bb-meta.php
+++ b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/functions.bb-meta.php
@@ -2,7 +2,6 @@
 
 /* Options/Meta */
 
-
 /* Internal */
 
 function bb_sanitize_meta_key( $key )
@@ -60,7 +59,11 @@ function bb_update_meta( $object_id = 0, $meta_key, $meta_value, $type, $global
 
 	$cur = $bbdb->get_row( $bbdb->prepare( "SELECT * FROM `$bbdb->meta` WHERE `object_type` = %s AND `object_id` = %d AND `meta_key` = %s", $object_type, $object_id, $meta_key ) );
 	if ( !$cur ) {
-		$bbdb->insert( $bbdb->meta, array( 'object_type' => $object_type, 'object_id' => $object_id, 'meta_key' => $meta_key, 'meta_value' => $_meta_value ) );
+		$bbdb->query( $bbdb->prepare(
+			"INSERT INTO `$bbdb->meta` ( `object_type`, `object_id`, `meta_key`, `meta_value` ) VALUES( %s, %d, %s, %s )
+			ON DUPLICATE KEY UPDATE `meta_value` = VALUES( `meta_value` )",
+			$object_type, $object_id, $meta_key, $_meta_value
+		) );
 	} elseif ( $cur->meta_value != $meta_value ) {
 		$bbdb->update( $bbdb->meta, array( 'meta_value' => $_meta_value), array( 'object_type' => $object_type, 'object_id' => $object_id, 'meta_key' => $meta_key ) );
 	}
@@ -95,7 +98,7 @@ function bb_delete_meta( $object_id = 0, $meta_key, $meta_value, $type, $global
 		case 'user':
 			global $wp_users_object;
 			$id = $object_id;
-			return $wp_users_object->update_meta( compact( 'id', 'meta_key', 'meta_value' ) );
+			return $wp_users_object->delete_meta( compact( 'id', 'meta_key', 'meta_value' ) );
 			break;
 		case 'forum':
 			$object_type = 'bb_forum';
@@ -297,10 +300,10 @@ function bb_get_option( $option )
 			$r = $bb_locale->text_direction;
 			break;
 		case 'version':
-			return '1.0.3'; // Don't filter
+			return '1.1'; // Don't filter
 			break;
 		case 'bb_db_version' :
-			return '2078'; // Don't filter
+			return '2471'; // Don't filter
 			break;
 		case 'html_type':
 			$r = 'text/html';
@@ -465,6 +468,8 @@ function bb_cache_all_options()
 		'wp_admin_cookie_path',
 		'wp_plugins_cookie_path',
 		'wordpress_mu_primary_blog_id',
+		'enable_loginless',
+		'enable_subscriptions',
 		'enable_xmlrpc',
 		'enable_pingback',
 		'throttle_time',
@@ -475,7 +480,9 @@ function bb_cache_all_options()
 		'plugin_cookie_paths',
 		'wp_roles_map',
 		'gmt_offset',
-		'timezone_string'
+		'timezone_string',
+		'name_link_profile',
+		'bp_bbpress_cron_check',
 	);
 
 	// Check that these aren't already in the cache
@@ -504,7 +511,7 @@ function bb_cache_all_options()
 
 	if ( count( $base_options ) === count( $query_options ) && ( !$results || !is_array( $results ) || !count( $results ) ) ) {
 		// Let's assume that the options haven't been populated from the old topicmeta table
-		if ( !BB_INSTALLING ) {
+		if ( !BB_INSTALLING && ( !defined( 'BB_DO_NOT_UPGRADE_TOPICMETA' ) || !BB_DO_NOT_UPGRADE_TOPICMETA ) ) {
 			$topicmeta_exists = $bbdb->query( "SELECT * FROM $bbdb->topicmeta LIMIT 1" );
 			if ($topicmeta_exists) {
 				require_once( BB_PATH . 'bb-admin/includes/defaults.bb-schema.php' );
@@ -654,7 +661,8 @@ function bb_update_usermeta( $user_id, $meta_key, $meta_value )
 	return bb_update_meta( $user_id, $meta_key, $meta_value, 'user' );
 }
 
-function bb_delete_usermeta( $user_id, $meta_key, $meta_value = '' )
+// $meta_value defaults to null to conform to BackPress' WP_User::delete_meta()
+function bb_delete_usermeta( $user_id, $meta_key, $meta_value = null )
 {
 	return bb_delete_meta( $user_id, $meta_key, $meta_value, 'user' );
 }
diff --git a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/functions.bb-pluggable.php b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/functions.bb-pluggable.php
index dd4960a7b400f04a6a614d6f00758471d6eef1e0..18d02aff79f80f03b389a832618a141b0ccdca13 100644
--- a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/functions.bb-pluggable.php
+++ b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/functions.bb-pluggable.php
@@ -5,7 +5,11 @@ function bb_auth( $scheme = 'auth' ) { // Checks if a user has a valid cookie, i
 	if ( !bb_validate_auth_cookie( '', $scheme ) ) {
 		nocache_headers();
 		if ( 'auth' === $scheme && !bb_is_user_logged_in() ) {
-			wp_redirect( bb_get_uri( 'bb-login.php', array( 're' => $_SERVER['REQUEST_URI'] ), BB_URI_CONTEXT_HEADER + BB_URI_CONTEXT_BB_USER_FORMS ) );
+			$protocol = 'http://';
+			if ( is_ssl() ) {
+				$protocol = 'https://';
+			}
+			wp_redirect( bb_get_uri( 'bb-login.php', array( 'redirect_to' => $protocol . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] ), BB_URI_CONTEXT_HEADER + BB_URI_CONTEXT_BB_USER_FORMS ) );
 		} else {
 			wp_redirect( bb_get_uri( null, null, BB_URI_CONTEXT_HEADER ) );
 		}
@@ -899,6 +903,7 @@ function bb_get_avatar( $id_or_email, $size = 80, $default = '', $alt = false )
 		case 'monsterid':
 		case 'wavatar':
 		case 'identicon':
+		case 'retro':
 			break;
 		case 'default':
 		default:
diff --git a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/functions.bb-posts.php b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/functions.bb-posts.php
index dbbaeffa5b7c99306d70c6051b95dbab80834805..4a2fca32617b7a2860d327c4286294ae494543c4 100644
--- a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/functions.bb-posts.php
+++ b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/functions.bb-posts.php
@@ -2,6 +2,55 @@
 
 /* Posts */
 
+/**
+ * Check to make sure that a user is not making too many posts in a short amount of time.
+ */
+function bb_check_post_flood() {
+	global $bbdb;
+	$user_id = (int) $user_id;
+	$throttle_time = bb_get_option( 'throttle_time' );
+
+	if ( bb_current_user_can( 'manage_options' ) || empty( $throttle_time ) )
+		return;
+
+	if ( bb_is_user_logged_in() ) {
+		$bb_current_user = bb_get_current_user();
+		
+		if ( isset($bb_current_user->data->last_posted) && time() < $bb_current_user->data->last_posted + $throttle_time && ! bb_current_user_can( 'throttle' ) )
+			if ( defined( 'DOING_AJAX' ) && DOING_AJAX )
+				die( __( 'Slow down; you move too fast.' ) );
+			else
+				bb_die( __( 'Slow down; you move too fast.' ) );
+	} else {
+		if ( ( $last_posted = bb_get_transient($_SERVER['REMOTE_ADDR'] . '_last_posted') ) && time() < $last_posted + $throttle_time )
+			if ( defined('DOING_AJAX') && DOING_AJAX )
+				die( __( 'Slow down; you move too fast.' ) );
+			else
+				bb_die( __( 'Slow down; you move too fast.' ) );
+	}
+}
+
+/**
+ * Get the current, non-logged-in poster data.
+ * @return array The associative array of author, email, and url data.
+ */
+function bb_get_current_poster() {
+	// Cookies should already be sanitized.
+	$post_author = '';
+	if ( isset( $_COOKIE['post_author_' . BB_HASH] ) )
+		$post_author = $_COOKIE['post_author_' . BB_HASH];
+
+	$post_author_email = '';
+	if ( isset( $_COOKIE['post_author_email_' . BB_HASH] ) )
+		$post_author_email = $_COOKIE['post_author_email_' . BB_HASH];
+
+	$post_author_url = '';
+	if ( isset( $_COOKIE['post_author_url_' . BB_HASH] ) )
+		$post_author_url = $_COOKIE['post_author_url_' . BB_HASH];
+
+	return compact( 'post_author', 'post_author_email', 'post_author_url' );
+}
+
 function bb_get_post( $post_id ) {
 	global $bbdb;
 	$post_id = (int) $post_id;
@@ -77,7 +126,7 @@ function bb_cache_first_posts( $_topics = false, $author_cache = true ) {
 
 	$_topic_ids = join(',', $topic_ids);
 
-	$posts = (array) bb_cache_posts( "SELECT post_id FROM $bbdb->posts WHERE topic_id IN ($_topic_ids) AND post_position = 1 AND post_status = 0", true );
+	$posts = (array) bb_cache_posts( "SELECT post_id FROM $bbdb->posts WHERE topic_id IN ($_topic_ids) AND post_position = 1", true );
 
 	$first_posts = array();
 	foreach ( $posts as $post ) {
@@ -98,6 +147,7 @@ function bb_cache_posts( $query, $post_id_query = false ) {
 	$_query_post_ids = array();
 	$_query_posts = array();
 	$_cached_posts = array();
+	$ordered_post_ids = array();
 
 	if ( $post_id_query && is_string( $query ) ) {
 		// The query is a SQL query to retrieve post_ids only
@@ -112,7 +162,10 @@ function bb_cache_posts( $query, $post_id_query = false ) {
 	}
 
 	if ( is_array( $query ) ) {
+		$get_order_from_query = false;
+
 		foreach ( $query as $_post_id ) {
+			$ordered_post_ids[] = $_post_id;
 			if ( false === $_post = wp_cache_get( $_post_id, 'bb_post' ) ) {
 				$_query_post_ids[] = $_post_id;
 			} else {
@@ -131,12 +184,16 @@ function bb_cache_posts( $query, $post_id_query = false ) {
 		}
 	} else {
 		// The query is a full SQL query which needs to be executed
+		$get_order_from_query = true;
 		$_query = $query;
 	}
 
 	if ( $_query_posts = (array) $bbdb->get_results( $_query ) ) {
 		$_appendable_posts = array();
 		foreach ( $_query_posts as $_query_post ) {
+			if ( $get_order_from_query ) {
+				$ordered_post_ids[] = $_query_post->post_id;
+			}
 			if ( false === $_post = wp_cache_get( $_query_post->post_id, 'bb_post' ) ) {
 				$_appendable_posts[] = $_query_post;
 			} else {
@@ -148,12 +205,23 @@ function bb_cache_posts( $query, $post_id_query = false ) {
 			foreach( $_query_posts as $_query_post ) {
 				wp_cache_add( $_query_post->post_id, $_query_post, 'bb_post' );
 			}
+		} else {
+			$_query_posts = array();
 		}
 	} else {
 		$_query_posts = array();
 	}
 
-	return array_merge( $_cached_posts, $_query_posts );
+	foreach ( array_merge( $_cached_posts, $_query_posts ) as $_post ) {
+		$keyed_posts[$_post->post_id] = $_post;
+	}
+
+	$the_posts = array();
+	foreach ( $ordered_post_ids as $ordered_post_id ) {
+		$the_posts[] = $keyed_posts[$ordered_post_id];
+	}
+
+	return $the_posts;
 }
 
 // Globalizes the result
@@ -250,7 +318,7 @@ function bb_get_latest_forum_posts( $forum_id, $limit = 0, $page = 1 ) {
 }
 
 function bb_insert_post( $args = null ) {
-	global $bbdb, $bb_current_user;
+	global $bbdb, $bb_current_user, $bb;
 
 	if ( !$args = wp_parse_args( $args ) )
 		return false;
@@ -300,11 +368,13 @@ function bb_insert_post( $args = null ) {
 
 	$defaults['throttle'] = true;
 	extract( wp_parse_args( $args, $defaults ) );
+	
+	// If the user is not logged in and loginless posting is ON, then this function expects $post_author, $post_email and $post_url to be sanitized (check bb-post.php for example)
 
 	if ( !$topic = get_topic( $topic_id ) )
 		return false;
 
-	if ( !$user = bb_get_user( $poster_id ) )
+	if ( bb_is_login_required() && ! $user = bb_get_user( $poster_id ) )
 		return false;
 
 	$topic_id = (int) $topic->topic_id;
@@ -333,8 +403,8 @@ function bb_insert_post( $args = null ) {
 
 		if ( 0 == $post_status ) {
 			$topic_time = $post_time;
-			$topic_last_poster = $poster_id;
-			$topic_last_poster_name = $user->user_login;
+			$topic_last_poster = ( ! bb_is_user_logged_in() && ! bb_is_login_required() ) ? -1 : $poster_id;
+			$topic_last_poster_name = ( ! bb_is_user_logged_in() && ! bb_is_login_required() ) ? $post_author : $user->user_login;
 
 			$bbdb->query( $bbdb->prepare( "UPDATE $bbdb->forums SET posts = posts + 1 WHERE forum_id = %d;", $topic->forum_id ) );
 			$bbdb->update(
@@ -344,17 +414,37 @@ function bb_insert_post( $args = null ) {
 			);
 
 			$query = new BB_Query( 'post', array( 'post_author_id' => $poster_id, 'topic_id' => $topic_id, 'post_id' => "-$post_id" ) );
-			if ( !$query->results )
-				bb_update_usermeta( $poster_id, $bbdb->prefix . 'topics_replied', $user->topics_replied + 1 );
+			if ( !$query->results ) {
+				$topics_replied_key = $bbdb->prefix . 'topics_replied';
+				bb_update_usermeta( $poster_id, $topics_replied_key, $user->$topics_replied_key + 1 );
+			}
 
 		} else {
 			bb_update_topicmeta( $topic->topic_id, 'deleted_posts', isset($topic->deleted_posts) ? $topic->deleted_posts + 1 : 1 );
 		}
 	}
 	bb_update_topic_voices( $topic_id );
+
+	// if user not logged in, save user data as meta data
+	if ( !$user ) {
+		bb_update_meta($post_id, 'post_author', $post_author, 'post');
+		bb_update_meta($post_id, 'post_email', $post_email, 'post');
+		bb_update_meta($post_id, 'post_url', $post_url, 'post');
+	}
 	
-	if ( $throttle && !bb_current_user_can( 'throttle' ) )
-		bb_update_usermeta( $poster_id, 'last_posted', time() );
+	if ( $throttle && !bb_current_user_can( 'throttle' ) ) {
+		if ( $user )
+			bb_update_usermeta( $poster_id, 'last_posted', time() );
+		else
+			bb_set_transient( $_SERVER['REMOTE_ADDR'] . '_last_posted', time() );
+	}
+	
+	if ( !bb_is_login_required() && !$user = bb_get_user( $poster_id ) ) {
+		$post_cookie_lifetime = apply_filters( 'bb_post_cookie_lifetime', 30000000 );
+		setcookie( 'post_author_' . BB_HASH, $post_author, time() + $post_cookie_lifetime, $bb->cookiepath, $bb->cookiedomain );
+		setcookie( 'post_author_email_' . BB_HASH, $post_email, time() + $post_cookie_lifetime, $bb->cookiepath, $bb->cookiedomain );
+		setcookie( 'post_author_url_' . BB_HASH, $post_url, time() + $post_cookie_lifetime, $bb->cookiepath, $bb->cookiedomain );
+	}
 
 	wp_cache_delete( $topic_id, 'bb_topic' );
 	wp_cache_delete( $topic_id, 'bb_thread' );
@@ -449,8 +539,10 @@ function bb_delete_post( $post_id, $new_status = 0 ) {
 		$user = bb_get_user( $uid );
 
 		$user_posts = new BB_Query( 'post', array( 'post_author_id' => $user->ID, 'topic_id' => $topic_id ) );
-		if ( $new_status && !$user_posts->results )
-			bb_update_usermeta( $user->ID, $bbdb->prefix . 'topics_replied', $user->topics_replied - 1 );
+		if ( $new_status && !$user_posts->results ) {
+			$topics_replied_key = $bbdb->prefix . 'topics_replied';
+			bb_update_usermeta( $user->ID, $topics_replied_key, $user->$topics_replied_key - 1 );
+		}
 		wp_cache_delete( $topic_id, 'bb_topic' );
 		wp_cache_delete( $topic_id, 'bb_thread' );
 		wp_cache_flush( 'bb_forums' );
@@ -469,6 +561,7 @@ function _bb_delete_post( $post_id, $post_status ) {
 	$post_status = (int) $post_status;
 	$bbdb->update( $bbdb->posts, compact( 'post_status' ), compact( 'post_id' ) );
 	wp_cache_delete( $post_id, 'bb_post' );
+	do_action( '_bb_delete_post', $post_id, $post_status );
 }
 
 function bb_topics_replied_on_undelete_post( $post_id ) {
@@ -478,8 +571,10 @@ function bb_topics_replied_on_undelete_post( $post_id ) {
 
 	$user_posts = new BB_Query( 'post', array( 'post_author_id' => $bb_post->poster_id, 'topic_id' => $topic->topic_id ) );
 
-	if ( 1 == count($user_posts) && $user = bb_get_user( $bb_post->poster_id ) )
-		bb_update_usermeta( $user->ID, $bbdb->prefix . 'topics_replied', $user->topics_replied + 1 );
+	if ( 1 == count($user_posts) && $user = bb_get_user( $bb_post->poster_id ) ) {
+		$topics_replied_key = $bbdb->prefix . 'topics_replied';
+		bb_update_usermeta( $user->ID, $topics_replied_key, $user->$topics_replied_key + 1 );
+	}
 }
 
 function bb_post_author_cache($posts) {
@@ -496,7 +591,7 @@ function bb_post_author_cache($posts) {
 
 // These two filters are lame.  It'd be nice if we could do this in the query parameters
 function bb_get_recent_user_replies_fields( $fields ) {
-	return $fields . ', MAX(post_time) as post_time';
+	return 'MAX( p.post_id ) AS post_id';
 }
 
 function bb_get_recent_user_replies_group_by() {
@@ -507,7 +602,138 @@ function bb_get_recent_user_replies( $user_id ) {
 	global $bbdb;
 	$user_id = (int) $user_id;
 
-	$post_query = new BB_Query( 'post', array( 'post_author_id' => $user_id, 'order_by' => 'post_time' ), 'get_recent_user_replies' );
+	$post_query = new BB_Query(
+		'post',
+		array(
+			'post_author_id' => $user_id,
+			'order_by' => 'post_id',
+			'post_id_only' => true,
+		),
+		'get_recent_user_replies'
+	);
 
 	return $post_query->results;
 }
+
+/**
+ * Sends notification emails for new posts.
+ *
+ * Gets new post's ID and check if there are subscribed
+ * user to that topic, and if there are, send notifications
+ *
+ * @since 1.1
+ *
+ * @param int $post_id ID of new post
+ */
+function bb_notify_subscribers( $post_id ) {
+	global $bbdb, $bb_ksd_pre_post_status;
+
+	if ( !empty( $bb_ksd_pre_post_status ) )
+		return false;
+
+	if ( !$post = bb_get_post( $post_id ) )
+		return false;
+
+	if ( !$topic = get_topic( $post->topic_id ) )
+		return false;
+	
+	$post_id = $post->post_id;
+	$topic_id = $topic->topic_id;
+
+	if ( !$poster_name = get_post_author( $post_id ) )
+		return false;
+	
+	do_action( 'bb_pre_notify_subscribers', $post_id, $topic_id );
+
+	if ( !$user_ids = $bbdb->get_col( $bbdb->prepare( "SELECT `$bbdb->term_relationships`.`object_id`
+		FROM $bbdb->term_relationships, $bbdb->term_taxonomy, $bbdb->terms
+		WHERE `$bbdb->term_relationships`.`term_taxonomy_id` = `$bbdb->term_taxonomy`.`term_taxonomy_id`
+		AND `$bbdb->term_taxonomy`.`term_id` = `$bbdb->terms`.`term_id`
+		AND `$bbdb->term_taxonomy`.`taxonomy` = 'bb_subscribe'
+		AND `$bbdb->terms`.`slug` = 'topic-%d'",
+		$topic_id ) ) )
+		return false;
+
+	foreach ( (array) $user_ids as $user_id ) {
+		if ( $user_id == $post->poster_id )
+			continue; // don't send notifications to the person who made the post
+		
+		$user = bb_get_user( $user_id );
+		
+		if ( !$message = apply_filters( 'bb_subscription_mail_message', __( "%1\$s wrote:\n\n%2\$s\n\nRead this post on the forums: %3\$s\n\nYou're getting this email because you subscribed to '%4\$s.'\nPlease click the link above, login, and click 'Unsubscribe' at the top of the page to stop receiving emails from this topic." ), $post_id, $topic_id ) )
+			continue; /* For plugins */
+		
+		bb_mail(
+			$user->user_email,
+			apply_filters( 'bb_subscription_mail_title', '[' . bb_get_option( 'name' ) . '] ' . $topic->topic_title, $post_id, $topic_id ),
+			sprintf( $message, $poster_name, strip_tags( $post->post_text ), get_post_link( $post_id ), strip_tags( $topic->topic_title ) )
+		);
+	}
+	
+	do_action( 'bb_post_notify_subscribers', $post_id, $topic_id );
+}
+
+/**
+ * Updates user's subscription status in database.
+ *
+ * Gets user's new subscription status for topic and
+ * adds new status to database.
+ *
+ * @since 1.1
+ *
+ * @param int $topic_id ID of topic for subscription
+ * @param string $new_status New subscription status
+ * @param int $user_id Optional. ID of user for subscription
+ */
+function bb_subscription_management( $topic_id, $new_status, $user_id = '' ) {
+	global $bbdb, $wp_taxonomy_object;
+	
+	$topic = get_topic( $topic_id );
+	if (!$user_id) {
+		$user_id = bb_get_current_user_info( 'id' );
+	}
+	
+	do_action( 'bb_subscripton_management', $topic_id, $new_status, $user_id );
+	
+	switch ( $new_status ) {
+		case 'add':
+			$tt_ids = $wp_taxonomy_object->set_object_terms( $user_id, 'topic-' . $topic->topic_id, 'bb_subscribe', array( 'append' => true, 'user_id' => $user_id ) );
+			break;
+		case 'remove':
+			// I hate this with the passion of a thousand suns
+			$term_id = $bbdb->get_var( "SELECT term_id FROM $bbdb->terms WHERE slug = 'topic-$topic->topic_id'" );
+			$term_taxonomy_id = $bbdb->get_var( "SELECT term_taxonomy_id FROM $bbdb->term_taxonomy WHERE term_id = $term_id AND taxonomy = 'bb_subscribe'" );
+			$bbdb->query( "DELETE FROM $bbdb->term_relationships WHERE object_id = $user_id AND term_taxonomy_id = $term_taxonomy_id" );
+			$bbdb->query( "DELETE FROM $bbdb->term_taxonomy WHERE term_id = $term_id AND taxonomy = 'bb_subscribe'" );
+			break;
+	}
+	
+}
+
+/**
+ * Process subscription checkbox submission.
+ *
+ * Get ID of and new subscription status and pass values to
+ * bb_user_subscribe_checkbox_update function
+ *
+ * @since 1.1
+ *
+ * @param int $post_id ID of new/edited post
+ */
+function bb_user_subscribe_checkbox_update( $post_id ) {
+	if ( !bb_is_user_logged_in() )
+		return false;
+	
+	$post		= bb_get_post( $post_id );
+	$topic_id	= (int) $post->topic_id;
+	$subscribed	= bb_is_user_subscribed( array( 'topic_id' => $topic_id, 'user_id' => $post->poster_id ) ) ? true : false;
+	$check		= $_REQUEST['subscription_checkbox'];
+	
+	do_action( 'bb_user_subscribe_checkbox_update', $post_id, $topic_id, $subscribe, $check );
+	
+	if ( 'subscribe' == $check && !$subscribed )
+		bb_subscription_management( $topic_id, 'add' );
+	elseif ( !$check && $subscribed )
+		bb_subscription_management( $topic_id, 'remove' );
+	
+}
diff --git a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/functions.bb-script-loader.php b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/functions.bb-script-loader.php
index 19a19da238e2def56d942294abe5eeedb37e3645..c90e70cbfcfc3fee2a952c49ccb565b60ba9ae79 100644
--- a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/functions.bb-script-loader.php
+++ b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/functions.bb-script-loader.php
@@ -1,11 +1,11 @@
 <?php
 
 function bb_default_scripts( &$scripts ) {
-	$scripts->base_url = bb_get_uri(BB_INC, null, BB_URI_CONTEXT_SCRIPT_SRC);
-	$scripts->base_url_admin = bb_get_uri('bb-admin/', null, BB_URI_CONTEXT_SCRIPT_SRC + BB_URI_CONTEXT_BB_ADMIN);
+	$scripts->base_url = bb_get_uri( BB_INC, null, BB_URI_CONTEXT_SCRIPT_SRC );
+	$scripts->base_url_admin = bb_get_uri( 'bb-admin/', null, BB_URI_CONTEXT_SCRIPT_SRC + BB_URI_CONTEXT_BB_ADMIN );
 	$scripts->content_url = ''; // May not work - might need to specify plugin and theme urls
 	$scripts->default_version = bb_get_option( 'version' );
-	$scripts->default_dirs = array('/bb-admin/js/', '/bb-includes/js/');
+	$scripts->default_dirs = array( '/bb-admin/js/', '/bb-includes/js/' );
 
 	// These are our enqueued scripts
 	$scripts->add( 'topic', $scripts->base_url . 'js/topic.js', array('wp-lists'), '20090602' );
@@ -15,7 +15,7 @@ function bb_default_scripts( &$scripts ) {
 	$scripts->add( 'common', $scripts->base_url_admin . 'js/common.js', array('jquery', 'hoverIntent', 'utils'), '20090517' );
 	$scripts->add_data( 'common', 'group', 1 );
 	$scripts->localize( 'common', 'commonL10n', array(
-		'warnDelete' => __("You are about to delete the selected items.\n  'Cancel' to stop, 'OK' to delete."),
+		'warnDelete' => __( "You are about to delete the selected items.\n  'Cancel' to stop, 'OK' to delete." ),
 		'l10n_print_after' => 'try{convertEntities(commonL10n);}catch(e){};'
 	) );
 	$scripts->localize( 'admin-forums', 'bbSortForumsL10n', array(
@@ -36,9 +36,9 @@ function bb_default_scripts( &$scripts ) {
 	) );
 
 	// jQuery and friends
-	$scripts->add( 'jquery', $scripts->base_url . 'js/jquery/jquery.js', false, '1.2.6');
+	$scripts->add( 'jquery', $scripts->base_url . 'js/jquery/jquery.js', false, '1.4.2' );
 	$scripts->add( 'jquery-color', $scripts->base_url . 'js/jquery/jquery.color.js', array('jquery'), '2.0-4561' );
-	$scripts->add( 'interface', $scripts->base_url . 'js/jquery/interface.js', array('jquery'), '1.2.3');
+	$scripts->add( 'interface', $scripts->base_url . 'js/jquery/interface.js', array('jquery'), '1.2.3' );
 	$scripts->add( 'password-strength-meter', $scripts->base_url . 'js/jquery/password-strength-meter.js', array('jquery'), '20070405' );
 	$scripts->localize( 'password-strength-meter', 'pwsL10n', array(
 		'short' => __('Too short'),
@@ -84,8 +84,8 @@ function bb_just_in_time_script_localization() {
 		'topicId' => get_topic_id(),
 		'favoritesLink' => get_favorites_link(),
 		'isFav' => (int) is_user_favorite( bb_get_current_user_info( 'id' ) ),
-		'confirmPostDelete' => __("Are you sure you wanna delete this post?"),
-		'confirmPostUnDelete' => __("Are you sure you wanna undelete this post?"),
+		'confirmPostDelete' => __("Are you sure you want to delete this post?"),
+		'confirmPostUnDelete' => __("Are you sure you want to undelete this post?"),
 		'favLinkYes' => __( 'favorites' ),
 		'favLinkNo' => __( '?' ),
 		'favYes' => __( 'This topic is one of your %favLinkYes% [%favDel%]' ),
diff --git a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/functions.bb-template.php b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/functions.bb-template.php
index da7cf67ec88f7422ff45ccd48013f90d27cc1da5..187fd2fa8527cd741d1a50f93129a7a44018c3c4 100644
--- a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/functions.bb-template.php
+++ b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/functions.bb-template.php
@@ -291,6 +291,7 @@ function post_form( $args = array() ) {
 	do_action( 'pre_post_form' );
 
 	if (
+		( false === bb_is_login_required() ) ||
 		( bb_is_topic() && bb_current_user_can( 'write_post', $topic->topic_id ) && ( $page == $last_page || !$last_page_only ) ) ||
 		( !bb_is_topic() && bb_current_user_can( 'write_topic', isset( $forum->forum_id ) ? $forum->forum_id : 0 ) )
 	) {
@@ -331,6 +332,11 @@ function edit_form() {
 	do_action('post_edit_form');
 }
 
+function bb_anonymous_post_form() {
+	if ( !bb_is_user_logged_in() && !bb_is_login_required() )
+		bb_load_template( 'post-form-anonymous.php' );
+}
+
 function alt_class( $key, $others = '' ) {
 	echo get_alt_class( $key, $others );
 }
@@ -427,6 +433,14 @@ function bb_is_forum() {
 	return 'forum-page' == bb_get_location();
 }
 
+/**
+ * Whether a user is required to log in in order to create posts and forums.
+ * @return bool Whether a user must be logged in.
+ */
+function bb_is_login_required() {
+	return ! (bool) bb_get_option('enable_loginless');
+}
+
 function bb_is_tags() {
 	return 'tag-page' == bb_get_location();
 }
@@ -475,7 +489,7 @@ function bb_is_admin() {
 }
 
 function bb_title( $args = '' ) {
-	echo apply_filters( 'bb_title', bb_get_title( $args ) );
+	echo apply_filters( 'bb_title', bb_get_title( $args ), $args );
 }
 
 function bb_get_title( $args = '' ) {
@@ -488,6 +502,12 @@ function bb_get_title( $args = '' ) {
 	$title = array();
 	
 	switch ( bb_get_location() ) {
+		case 'search-page':
+			if ( !$q = trim( @$_GET['search'] ) )
+				if ( !$q = trim( @$_GET['q'] ) )
+					break;
+			$title[] = sprintf( __( 'Search for %s' ), esc_html( $q ) );
+			break;
 		case 'front-page':
 			if ( !empty( $args['front'] ) )
 				$title[] = $args['front'];
@@ -506,7 +526,7 @@ function bb_get_title( $args = '' ) {
 			if ( bb_is_tag() )
 				$title[] = esc_html( bb_get_tag_name() );
 			
-			$title[] = __('Tags');
+			$title[] = __( 'Tags' );
 			break;
 		
 		case 'profile-page':
@@ -526,7 +546,7 @@ function bb_get_title( $args = '' ) {
 	if ( 'reversed' == $args['order'] )
 		$title = array_reverse( $title );
 	
-	return apply_filters( 'bb_get_title', implode( $args['separator'], $title ) );
+	return apply_filters( 'bb_get_title', implode( $args['separator'], $title ), $args, $title );
 }
 
 function bb_feed_head() {
@@ -663,7 +683,7 @@ function bb_latest_topics_pages( $args = null )
 	static $bb_latest_topics_count;
 	if ( !$bb_latest_topics_count) {
 		global $bbdb;
-		$bb_latest_topics_count = $bbdb->get_var('SELECT COUNT(`topic_id`) FROM `' . $bbdb->topics . '` WHERE `topic_open` = 1 AND `topic_status` = 0 AND `topic_sticky` != 2;');
+		$bb_latest_topics_count = $bbdb->get_var('SELECT COUNT(`topic_id`) FROM `' . $bbdb->topics . '` WHERE `topic_status` = 0 AND `topic_sticky` != 2;');
 	}
 	if ( $pages = apply_filters( 'bb_latest_topics_pages', get_page_number_links( $page, $bb_latest_topics_count ), $bb_latest_topics_count ) ) {
 		echo $args['before'] . $pages . $args['after'];
@@ -1120,12 +1140,13 @@ function get_topic_page_links( $id = 0, $args = null ) {
 
 	$links = $_links;
 
+	$r = '';
+
 	if ( $links ) {
 		if ( !$show_first ) {
 			unset( $links[0] );
 		}
 
-		$r = '';
 		if ( $args['before'] ) {
 			$r .= $args['before'];
 		}
@@ -1186,7 +1207,7 @@ function topic_last_poster( $id = 0 ) {
 
 function get_topic_last_poster( $id = 0 ) {
 	$topic = get_topic( get_topic_id( $id ) );
-	$user_display_name = get_user_display_name($topic->topic_last_poster);
+	$user_display_name = get_post_author( $topic->topic_last_post_id );
 	return apply_filters( 'get_topic_last_poster', $user_display_name, $topic->topic_last_poster, $topic->topic_id ); // $topic->topic_last_poster = user ID
 }
 
@@ -1197,7 +1218,8 @@ function topic_author( $id = 0 ) {
 
 function get_topic_author( $id = 0 ) {
 	$topic = get_topic( get_topic_id( $id ) );
-	$user_display_name = get_user_display_name($topic->topic_poster);
+	$first_post = bb_get_first_post( $topic );
+	$user_display_name = get_post_author( $first_post->post_id );
 	return apply_filters( 'get_topic_author', $user_display_name, $topic->topic_poster, $topic->topic_id ); // $topic->topic_poster = user ID
 }
 
@@ -1356,8 +1378,7 @@ function get_page_number_links( $args ) {
 	return $links;
 }
 
-function bb_topic_admin( $args = '' )
-{
+function bb_topic_admin( $args = '' ) {
 	$parts = array(
 		'delete' => bb_get_topic_delete_link( $args ),
 		'close'  => bb_get_topic_close_link( $args ),
@@ -1365,7 +1386,7 @@ function bb_topic_admin( $args = '' )
 		'move'   => bb_get_topic_move_dropdown( $args )
 	);
 
-	echo join( "\n", apply_filters( 'bb_topic_admin', $parts ) );
+	echo join( "\n", apply_filters( 'bb_topic_admin', $parts, $args ) );
 }
 
 function topic_delete_link( $args = '' ) {
@@ -1382,16 +1403,19 @@ function bb_get_topic_delete_link( $args = '' ) {
 	if ( !$topic || !bb_current_user_can( 'delete_topic', $topic->topic_id ) )
 		return;
 
-	if ( true === $redirect )
-		$redirect = $_SERVER['REQUEST_URI'];
-
 	if ( 0 == $topic->topic_status ) {
+		if ( true === $redirect )
+			$redirect = add_query_arg( bb_is_admin() ? array() : array( 'view' => 'all'  ) );
+
 		$query   = array( 'id' => $topic->topic_id, '_wp_http_referer' => $redirect ? rawurlencode( $redirect ) : false );
-		$confirm = __('Are you sure you wanna delete that?');
+		$confirm = __('Are you sure you want to delete that?');
 		$display = esc_html( $delete_text ? $delete_text : __('Delete entire topic') );
 	} else {
+		if ( true === $redirect )
+			$redirect = remove_query_arg( bb_is_admin() ? array() : 'view' );
+
 		$query   = array('id' => $topic->topic_id, 'view' => 'all', '_wp_http_referer' => $redirect ? rawurlencode( $redirect ) : false );
-		$confirm = __('Are you sure you wanna undelete that?');
+		$confirm = __('Are you sure you want to undelete that?');
 		$display = esc_html( $undelete_text ? $undelete_text : __('Undelete entire topic') );
 	}
 	$uri = bb_get_uri('bb-admin/delete-topic.php', $query, BB_URI_CONTEXT_A_HREF + BB_URI_CONTEXT_BB_ADMIN);
@@ -1545,7 +1569,7 @@ function topic_class( $class = '', $key = 'topic', $id = 0 ) {
 		$class[] = 'closed';
 	if ( 1 == $topic->topic_sticky && ( bb_is_forum() || bb_is_view() ) )
 		$class[] = 'sticky';
-	elseif ( 2 == $topic->topic_sticky && ( bb_is_front() || bb_is_forum() ) )
+	elseif ( 2 == $topic->topic_sticky && ( bb_is_front() || bb_is_forum() || bb_is_view() ) )
 		$class[] = 'sticky super-sticky';
 	$class = apply_filters( 'topic_class', $class, $topic->topic_id );
 	$class = join(' ', $class);
@@ -1582,8 +1606,8 @@ function bb_get_new_topic_link( $args = null ) {
 	elseif ( bb_is_front() )
 		$url = bb_get_uri(null, array('new' => 1));
 
-	if ( !bb_is_user_logged_in() )
-		$url = bb_get_uri('bb-login.php', array('re' => $url), BB_URI_CONTEXT_A_HREF + BB_URI_CONTEXT_BB_USER_FORMS);
+	if ( !bb_is_user_logged_in() && bb_is_login_required() )
+		$url = bb_get_uri('bb-login.php', array('redirect_to' => $url), BB_URI_CONTEXT_A_HREF + BB_URI_CONTEXT_BB_USER_FORMS);
 	elseif ( bb_is_forum() || bb_is_topic() ) {
 		if ( !bb_current_user_can( 'write_topic', get_forum_id() ) )
 			return;
@@ -1624,6 +1648,16 @@ function bb_topic_search_form( $args = null, $query_obj = null ) {
 	$query_obj->form( $args );
 }
 
+function bb_search_pages( $args = null ) {
+	global $page, $search_count, $per_page;
+	
+	$defaults = array( 'before' => '', 'after' => '' );
+ 	$args = wp_parse_args( $args, $defaults );
+	
+	if ( $pages = apply_filters( 'bb_search_pages', get_page_number_links( array( 'page' => $page, 'total' => $search_count, 'per_page' => $per_page, 'mod_rewrite' => false ) ) ) )
+		echo $args['before'] . $pages . $args['after'];
+}
+
 /**
  * bb_topic_pagecount() - Print the total page count for a topic
  *
@@ -1733,17 +1767,21 @@ function post_author( $post_id = 0 ) {
 function get_post_author( $post_id = 0 ) {
 	if ( $user = bb_get_user( get_post_author_id( $post_id ) ) )
 		return apply_filters( 'get_post_author', $user->display_name, $user->ID, $post_id );
-	elseif ( $title = bb_get_post_meta( 'pingback_title' ) )
+	elseif ( $title = bb_get_post_meta( 'pingback_title', $post_id ) )
 		return apply_filters( 'bb_get_pingback_title', $title, $post_id );
+	elseif ( $title = bb_get_post_meta( 'post_author', $post_id ) )
+		return apply_filters( 'get_post_author', $title, 0, $post_id );
 	else
 		return apply_filters( 'get_post_author', __('Anonymous'), 0, $post_id );
 }
 
 function post_author_link( $post_id = 0 ) {
-	if ( $link = get_user_link( get_post_author_id( $post_id ) ) ) {
+	if ( $link = ( bb_get_option( 'name_link_profile' ) ? get_user_profile_link( get_post_author_id( $post_id ) ) : get_user_link( get_post_author_id( $post_id ) ) ) ) {
 		echo '<a href="' . esc_attr( $link ) . '">' . get_post_author( $post_id ) . '</a>';
 	} elseif ( $link = bb_get_post_meta( 'pingback_uri' )) {
 		echo '<a href="' . esc_attr( $link ) . '">' . get_post_author( $post_id ) . '</a>';
+	} elseif ( $link = bb_get_post_meta( 'post_url' ) ) {
+		echo '<a href="' . esc_attr( $link ) . '">' . get_post_author( $post_id ) . '</a>';
 	} else {
 		post_author( $post_id );
 	}
@@ -2124,8 +2162,12 @@ function get_post_author_title_link( $post_id = 0 ) {
 			$r = __('PingBack');
 		else
 			$r = __('Unregistered'); // This should never happen
-	} else
-		$r = '<a href="' . esc_attr( get_user_profile_link( get_post_author_id( $post_id ) ) ) . '">' . $title . '</a>';
+	} else {
+		if ( $link = bb_get_option( 'name_link_profile' ) ? get_user_link( get_post_author_id( $post_id ) ) : get_user_profile_link( get_post_author_id( $post_id ) ) )
+			$r = '<a href="' . esc_attr( $link ) . '">' . $title . '</a>';
+		else
+			$r = $title;
+	}
 
 	return apply_filters( 'get_post_author_title_link', $r, get_post_id( $post_id ) );
 }
@@ -2220,6 +2262,11 @@ function get_user_profile_link( $id = 0, $page = 1, $context = BB_URI_CONTEXT_A_
 
 function user_delete_button() {
 	global $user;
+	
+	$user_obj = new BP_User( $user->ID );
+	if ( !bb_current_user_can( 'keep_gate' ) && 'keymaster' == $user_obj->roles[0] )
+		return;
+	
 	if ( bb_current_user_can( 'edit_users' ) && bb_get_current_user_info( 'id' ) != (int) $user->ID )
 		echo apply_filters( 'user_delete_button', get_user_delete_button() );
 }
@@ -2399,6 +2446,8 @@ function bb_profile_data_form( $id = 0 ) {
 	$error_codes = $errors->get_error_codes();
 	$profile_info_keys = bb_get_profile_info_keys();
 	$required = false;
+	if ( in_array( 'delete', $error_codes ) )
+		echo '<div class="form-invalid error">' . $errors->get_error_message( 'delete' ) . '</div>';
 ?>
 <table id="userinfo">
 <?php
@@ -2532,7 +2581,7 @@ function bb_profile_admin_form( $id = 0 ) {
 	$can_keep_gate = bb_current_user_can( 'keep_gate' );
 
 	// Keymasters can't demote themselves
-	if ( ( $bb_current_id == $user->ID && $can_keep_gate ) || ( isset( $user->capabilities ) && is_array( $user->capabilities ) && array_key_exists('keymaster', $user->capabilities) && !$can_keep_gate ) ) {
+	if ( ( $bb_current_id == $user->ID && $can_keep_gate ) || ( isset( $user->capabilities ) && is_array( $user->capabilities ) && array_key_exists( 'keymaster', $user->capabilities ) && !$can_keep_gate ) ) {
 		$roles = array( 'keymaster' => $roles['keymaster'] );
 	} elseif ( !$can_keep_gate ) { // only keymasters can promote others to keymaster status
 		unset($roles['keymaster']);
@@ -2705,7 +2754,7 @@ function bb_profile_password_form( $id = 0 ) {
 			if (typeof jQuery != 'undefined') {
 				document.writeln('<div id="pass-strength-result">' + pwsL10n.short + '</div>');
 			} else {
-				document.writeln('<?php echo str_replace("'", "\'", __('Disabled (requires jQuery)')); ?>')
+				document.writeln('<?php echo str_replace("'", "\'", __('Disabled.')); ?>')
 			}
 		</script>
 	</td>
@@ -2730,9 +2779,9 @@ function bb_get_logout_link( $args = '' ) {
 	$args = wp_parse_args( $args, $defaults );
 	extract($args, EXTR_SKIP);
 
-	$query = array( 'logout' => 1 );
+	$query = array( 'action' => 'logout' );
 	if ( $redirect ) {
-		$query['re'] = $redirect;
+		$query['redirect_to'] = $redirect;
 	}
 
 	$uri = esc_attr( bb_get_uri('bb-login.php', $query, BB_URI_CONTEXT_A_HREF + BB_URI_CONTEXT_BB_USER_FORMS) );
@@ -2761,6 +2810,18 @@ function bb_get_admin_link( $args = '' ) {
 	return apply_filters( 'bb_get_admin_link', $before . '<a href="' . $uri . '">' . $text . '</a>' . $after, $args );
 }
 
+function bb_get_user_admin_link( $user_id = null ) { 
+	if( !$user_id || !bb_current_user_can( 'edit_user', $user_id ) )
+		return;
+
+	if( !bb_get_user_id( $user_id ) )
+		return;
+
+	$uri = bb_get_uri( 'bb-admin/users.php', array( 'action' => 'edit', 'user_id' => $user_id ) );
+
+	return apply_filters( 'bb_get_user_admin_link', $uri, $user_id );
+}
+
 function bb_profile_link( $args = '' ) {
 	echo apply_filters( 'bb_profile_link', bb_get_profile_link( $args ), $args );
 }
@@ -3280,7 +3341,7 @@ function bb_get_forum_dropdown( $args = '' ) {
 		} else {
 			$tab = '';
 		}
-		$r .= '<select name="' . $name . '" id="' . $id . '"' . $tab . '">' . "\n";
+		$r .= '<select name="' . $name . '" id="' . $id . '"' . $tab . '>' . "\n";
 	}
 	if ( $none )
 		$r .= "\n" . '<option value="0">' . $none . '</option>' . "\n";
@@ -3427,6 +3488,105 @@ function favorites_pages( $args = null )
 	}
 }
 
+//SUBSCRIPTION
+
+/** 
+ * Checks if subscription is enabled.
+ * 
+ * @since 1.1 
+ *  
+ * @return bool is subscription enabled or not 
+ */
+function bb_is_subscriptions_active() { 
+	return (bool) bb_get_option( 'enable_subscriptions' ); 
+}
+
+/**
+ * Checks if user is subscribed to current topic.
+ *
+ * @since 1.1
+ *
+ * @return bool is user subscribed or not
+ */
+function bb_is_user_subscribed( $args = null ) {
+	global $bbdb;
+	
+	$defaults = array(
+		'user_id'  => bb_is_topic_edit() ? bb_get_user_id( get_post_author_id() ) : bb_get_current_user_info( 'id' ),
+		'topic_id' => get_topic_id()
+	);
+	$args = wp_parse_args( $args, $defaults );
+	extract( $args, EXTR_SKIP );
+	
+	$there = $bbdb->get_var( $bbdb->prepare( "SELECT `$bbdb->term_relationships`.`object_id`
+				FROM $bbdb->term_relationships, $bbdb->term_taxonomy, $bbdb->terms
+				WHERE `$bbdb->term_relationships`.`object_id` = %d
+				AND `$bbdb->term_relationships`.`term_taxonomy_id` = `$bbdb->term_taxonomy`.`term_taxonomy_id`
+				AND `$bbdb->term_taxonomy`.`term_id` = `$bbdb->terms`.`term_id`
+				AND `$bbdb->term_taxonomy`.`taxonomy` = 'bb_subscribe'
+				AND `$bbdb->terms`.`slug` = 'topic-%d'",
+				$user_id, $topic_id ) );
+	
+	$there = apply_filters( 'bb_is_user_subscribed', $there, $args );
+	
+	if ( $there )
+		return true;
+	
+	return false;
+}
+
+/**
+ * Outputs the subscribe/unsubscibe link.
+ *
+ * Checks if user is subscribed and outputs link based on status.
+ *
+ * @since 1.1
+ */
+function bb_user_subscribe_link() {
+	$topic_id = get_topic_id();
+
+	if ( !bb_is_user_logged_in() )
+		return false;
+
+	if ( bb_is_user_subscribed() )
+		echo '<li id="subscription-toggle"><a href="'. bb_nonce_url( bb_get_uri( null, array( 'doit' => 'bb-subscribe', 'topic_id' => $topic_id, 'and' => 'remove' ) ), 'toggle-subscribe_' . $topic_id ) .'">' . apply_filters( 'bb_user_subscribe_link_unsubscribe', __( 'Unsubscribe from Topic' ) ) . '</a></li>';
+	else
+		echo '<li id="subscription-toggle"><a href="'. bb_nonce_url( bb_get_uri( null, array( 'doit' => 'bb-subscribe', 'topic_id' => $topic_id, 'and' => 'add' ) ), 'toggle-subscribe_' . $topic_id ) .'">' . apply_filters( 'bb_user_subscribe_link_subscribe', __( 'Subscribe to Topic' ) ) . '</a></li>';
+
+}
+
+/**
+ * Outputs the post form subscription checkbox.
+ *
+ * Checks if user is subscribed and outputs checkbox based on status.
+ *
+ * @since 1.1
+ */
+function bb_user_subscribe_checkbox( $args = null ) {
+	
+	if ( !bb_is_user_logged_in() )
+		return false;
+
+	$is_current = false;
+	$defaults   = array( 'tab' => false );
+	$args       = wp_parse_args( $args, $defaults );
+	$tab        = $args['tab'] !== false ? ' tabindex="' . $args['tab'] . '"' : '';
+	$is_current = bb_get_user_id( get_post_author_id() ) == bb_get_current_user_info( 'id' );
+
+	// Change subscription checkbox message if current or moderating
+	if ( bb_is_topic_edit() && !$is_current )
+		$text = __( 'This user should be notified of follow-up posts via email' );
+	else
+		$text = __( 'Notify me of follow-up posts via email' );
+
+	echo '
+	<label for="subscription_checkbox">
+		<input name="subscription_checkbox" id="subscription_checkbox" type="checkbox" value="subscribe" ' . checked( true, bb_is_user_subscribed(), false ) . $tab . ' />
+		' .  apply_filters( 'bb_user_subscribe_checkbox_label', $text, (bool) $is_current ) . '
+	</label>';
+
+}
+
 //VIEWS
 function view_name( $view = '' ) { // Filtration should be done at bb_register_view()
 	echo get_view_name( $view );
@@ -3507,11 +3667,7 @@ function _bb_time_function_return( $time, $args ) {
 		break;
 	endswitch;
 
-	if ( $args['localize'] ) {
-		return bb_gmdate_i18n( $format, $time );
-	} else {
-		return gmdate( $format, $time );
-	}
+	return $args['localize'] ? bb_gmdate_i18n( $format, $time ) : gmdate( $format, $time );
 }
 
 function bb_template_scripts() {
@@ -3524,3 +3680,85 @@ function bb_template_scripts() {
 		}
 	}
 }
+
+if ( !function_exists( 'checked' ) ) :
+/**
+ * Outputs the html checked attribute.
+ *
+ * Compares the first two arguments and if identical marks as checked
+ *
+ * @since 1.1
+ *
+ * @param mixed $checked One of the values to compare
+ * @param mixed $current (true) The other value to compare if not just true
+ * @param bool $echo Whether to echo or just return the string
+ * @return string html attribute or empty string
+ */
+function checked( $checked, $current = true, $echo = true ) {
+	return __checked_selected_helper( $checked, $current, $echo, 'checked' );
+}
+endif;
+
+if ( !function_exists( 'selected' ) ) :
+/**
+ * Outputs the html selected attribute.
+ *
+ * Compares the first two arguments and if identical marks as selected
+ *
+ * @since 1.1
+ *
+ * @param mixed selected One of the values to compare
+ * @param mixed $current (true) The other value to compare if not just true
+ * @param bool $echo Whether to echo or just return the string
+ * @return string html attribute or empty string
+ */
+function selected( $selected, $current = true, $echo = true ) {
+	return __checked_selected_helper( $selected, $current, $echo, 'selected' );
+}
+endif;
+
+if ( !function_exists( 'disabled' ) ) :
+/**
+ * Outputs the html disabled attribute.
+ *
+ * Compares the first two arguments and if identical marks as disabled
+ *
+ * @since 1.1
+ *
+ * @param mixed $disabled One of the values to compare
+ * @param mixed $current (true) The other value to compare if not just true
+ * @param bool $echo Whether to echo or just return the string
+ * @return string html attribute or empty string
+ */
+function disabled( $disabled, $current = true, $echo = true ) {
+	return __checked_selected_helper( $disabled, $current, $echo, 'disabled' );
+}
+endif;
+
+if ( !function_exists( '__checked_selected_helper' ) ) :
+/**
+ * Private helper function for checked, selected, and disabled.
+ *
+ * Compares the first two arguments and if identical marks as $type
+ *
+ * @since 1.1
+ * @access private
+ *
+ * @param any $helper One of the values to compare
+ * @param any $current (true) The other value to compare if not just true
+ * @param bool $echo Whether to echo or just return the string
+ * @param string $type The type of checked|selected|disabled we are doing
+ * @return string html attribute or empty string
+ */
+function __checked_selected_helper( $helper, $current, $echo, $type ) {
+	if ( (string) $helper === (string) $current )
+		$result = " $type='$type'";
+	else
+		$result = '';
+
+	if ( $echo )
+		echo $result;
+
+	return $result;
+}
+endif;
diff --git a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/functions.bb-topic-tags.php b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/functions.bb-topic-tags.php
index 022c02178a2a6cc0daef7435e7ad9df40d35898e..a06bb72aa71fcc66c3f9b71f41e6eeb062b389ef 100644
--- a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/functions.bb-topic-tags.php
+++ b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/functions.bb-topic-tags.php
@@ -94,18 +94,26 @@ function bb_remove_topic_tag( $tt_id, $user_id, $topic_id ) {
 	$_tag = bb_get_tag( $tt_id );
 
 	do_action('bb_pre_tag_removed', $tt_id, $user_id, $topic_id);
-	$current_tag_ids = $wp_taxonomy_object->get_object_terms( $topic_id, 'bb_topic_tag', array( 'user_id' => $user_id, 'fields' => 'tt_ids' ) );
-	if ( !is_array($current_tag_ids) )
+	$currents = $wp_taxonomy_object->get_object_terms( $topic_id, 'bb_topic_tag', array( 'user_id' => $user_id, 'fields' => 'all' ) );
+	if ( !is_array( $currents ) )
 		return false;
 
-	$current_tag_ids = array_map( 'intval', $current_tag_ids );
+	$found_tag_to_remove = false;
+	$current_tag_term_ids = array();
+	foreach ( $currents as $current ) {
+		if ( $current->term_taxonomy_id == $tt_id ) {
+			$found_tag_to_remove = true;
+			continue;
+		}
+		$current_tag_term_ids[] = $current->term_id;
+	}
 
-	if ( false === $pos = array_search( $tt_id, $current_tag_ids ) )
+	if ( !$found_tag_to_remove )
 		return false;
 
-	unset($current_tag_ids[$pos]);
+	$current_tag_term_ids = array_map( 'intval', $current_tag_term_ids );
 
-	$tt_ids = $wp_taxonomy_object->set_object_terms( $topic_id, array_values($current_tag_ids), 'bb_topic_tag', array( 'user_id' => $user_id ) );
+	$tt_ids = $wp_taxonomy_object->set_object_terms( $topic_id, array_values($current_tag_term_ids), 'bb_topic_tag', array( 'user_id' => $user_id ) );
 	if ( is_array( $tt_ids ) ) {
 		global $bbdb;
 		$bbdb->query( $bbdb->prepare(
@@ -173,6 +181,9 @@ function bb_destroy_tag( $tt_id, $recount_topics = true ) {
 	if ( !$tag = bb_get_tag( $tt_id ) )
 		return false;
 
+	if ( is_wp_error($tag) )
+		return false;
+
 	$topic_ids = bb_get_tagged_topic_ids( $tag->term_id );
 
 	$return = $wp_taxonomy_object->delete_term( $tag->term_id, 'bb_topic_tag' );
@@ -270,7 +281,7 @@ function bb_get_topic_tags( $topic_id = 0, $args = null ) {
 	$cache_id = $topic_id . serialize( $args );
 
 	$terms = wp_cache_get( $cache_id, 'bb_topic_tag_terms' );
-	if ( empty( $terms ) ) {
+	if ( false === $terms ) {
 		$terms = $wp_taxonomy_object->get_object_terms( (int) $topic->topic_id, 'bb_topic_tag', $args );
 		wp_cache_set( $cache_id, $terms, 'bb_topic_tag_terms' );
 	}
@@ -339,7 +350,8 @@ function bb_get_tagged_topic_ids( $tag_id ) {
 }
 
 function get_tagged_topics( $args ) {
-	$defaults = array( 'tag_id' => false, 'page' => 1, 'number' => false );
+	global $tagged_topic_count;
+	$defaults = array( 'tag_id' => false, 'page' => 1, 'number' => false, 'count' => true );
 	if ( is_numeric( $args ) )
 		$args = array( 'tag_id' => $args );
 	else
@@ -352,9 +364,11 @@ function get_tagged_topics( $args ) {
 	$args = wp_parse_args( $args, $defaults );
 	extract( $args, EXTR_SKIP );
 
-	$q = array('tag_id' => (int) $tag_id, 'page' => (int) $page, 'per_page' => (int) $number);
+	$q = array('tag_id' => (int) $tag_id, 'page' => (int) $page, 'per_page' => (int) $number, 'count' => $count );
 
 	$query = new BB_Query( 'topic', $q, 'get_tagged_topics' );
+	$tagged_topic_count = $query->found_rows;
+
 	return $query->results;
 }
 
@@ -395,23 +409,33 @@ function bb_get_top_tags( $args = null ) {
 	if ( is_wp_error( $terms ) )
 		return false;
 
-	for ( $i = 0; isset($terms[$i]); $i++ )
-		_bb_make_tag_compat( $terms[$i] );
+	foreach ( $terms as $term )
+	       	_bb_make_tag_compat( $term );
 
 	return $terms;
 }
 
+/**
+ * Adds some back-compat properties/elements to a term.
+ *
+ * Casting $tag->term_taxonomy_id to an integer is important since
+ * we check it against is_integer() in bb_get_tag()
+ *
+ * @internal
+ */
 function _bb_make_tag_compat( &$tag ) {
 	if ( is_object($tag) && isset($tag->term_id) ) {
+		$tag->term_taxonomy_id = (int) $tag->term_taxonomy_id;
 		$tag->tag_id    =& $tag->term_taxonomy_id;
 		$tag->tag       =& $tag->slug;
 		$tag->raw_tag   =& $tag->name;
 		$tag->tag_count =& $tag->count;
 	} elseif ( is_array($tag) && isset($tag['term_id']) ) {
-		$tag->tag_id    =& $tag['term_taxonomy_id'];
-		$tag->tag       =& $tag['slug'];
-		$tag->raw_tag   =& $tag['name'];
-		$tag->tag_count =& $tag['count'];
+		$tag['term_taxonomy_id'] = (int) $tag['term_taxonomy_id'];
+		$tag['tag_id']    =& $tag['term_taxonomy_id'];
+		$tag['tag']       =& $tag['slug'];
+		$tag['raw_tag']   =& $tag['name'];
+		$tag['tag_count'] =& $tag['count'];
 	}
 }
 
diff --git a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/functions.bb-topics.php b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/functions.bb-topics.php
index 92db5329846e83672c58a463112be179a2f38369..d4baa5d4f5b45a3902e58e52f07a5d3fe3d060db 100644
--- a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/functions.bb-topics.php
+++ b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/functions.bb-topics.php
@@ -73,7 +73,7 @@ function get_latest_topics( $args = null ) {
 	extract( $args, EXTR_SKIP );
 
 	if ( $exclude ) {
-		$exclude = '-' . str_replace(',', '-,', $exclude);
+		$exclude = '-' . str_replace(',', ',-', $exclude);
 		$exclude = str_replace('--', '-', $exclude);
 		if ( $forum )
 			$forum = (string) $forum . ",$exclude";
@@ -176,16 +176,20 @@ function bb_insert_topic( $args = null ) {
 	$forum_id = (int) $forum->forum_id;
 
 	if ( !$user = bb_get_user( $topic_poster ) )
-		if ( !$user = bb_get_user( $topic_poster_name, array( 'by' => 'login' ) ) )
-			return false;
-	$topic_poster = $user->ID;
-	$topic_poster_name = $user->user_login;
+		$user = bb_get_user( $topic_poster_name, array( 'by' => 'login' ) );
+
+	if ( !empty( $user ) ) {
+		$topic_poster      = $user->ID;
+		$topic_poster_name = $user->user_login;
+	}
 
 	if ( !$last_user = bb_get_user( $topic_last_poster ) )
-		if ( !$last_user = bb_get_user( $topic_last_poster_name, array( 'by' => 'login' ) ) )
-			return false;
-	$topic_last_poster = $last_user->ID;
-	$topic_last_poster_name = $last_user->user_login;
+		$last_user = bb_get_user( $topic_last_poster_name, array( 'by' => 'login' ) );
+
+	if ( !empty( $last_user ) ) {
+		$topic_last_poster      = $last_user->ID;
+		$topic_last_poster_name = $last_user->user_login;
+	}
 
 	if ( in_array( 'topic_title', $fields ) ) {
 		$topic_title = apply_filters( 'pre_topic_title', $topic_title, $topic_id );
@@ -234,11 +238,11 @@ function bb_insert_topic( $args = null ) {
 }
 
 // Deprecated: expects $title to be pre-escaped
-function bb_new_topic( $title, $forum, $tags = '' ) {
+function bb_new_topic( $title, $forum, $tags = '', $args = '' ) {
 	$title = stripslashes( $title );
 	$tags  = stripslashes( $tags );
 	$forum = (int) $forum;
-	return bb_insert_topic( array( 'topic_title' => $title, 'forum_id' => $forum, 'tags' => $tags ) );
+	return bb_insert_topic( wp_parse_args( $args ) + array( 'topic_title' => $title, 'forum_id' => $forum, 'tags' => $tags ) );
 }
 
 // Deprecated: expects $title to be pre-escaped
@@ -257,23 +261,26 @@ function bb_delete_topic( $topic_id, $new_status = 0 ) {
 		if ( $new_status == $old_status )
 			return;
 
+		$thread_args = array( 'per_page' => -1, 'order' => 'DESC' );
 		if ( 0 != $old_status && 0 == $new_status )
-			add_filter('get_thread_where', 'bb_no_where');
+			$thread_args['post_status'] = 'all';
 		$poster_ids = array();
-		$posts = get_thread( $topic_id, array( 'per_page' => -1, 'order' => 'DESC' ) );
+		$posts = get_thread( $topic_id, $thread_args );
 		if ( $posts && count( $posts ) ) {
 			foreach ( $posts as $post ) {
 				_bb_delete_post( $post->post_id, $new_status );
 				$poster_ids[] = $post->poster_id;
 			}
 		}
-		if ( 0 != $old_status && 0 == $new_status )
-			remove_filter('get_thread_where', 'bb_no_where');
 
-		if ( count( $poster_ids ) )
-			foreach ( array_unique( $poster_ids ) as $id )
-				if ( $user = bb_get_user( $id ) )
-					bb_update_usermeta( $user->ID, $bbdb->prefix . 'topics_replied', ( $old_status ? $user->topics_replied + 1 : $user->topics_replied - 1 ) );
+		if ( count( $poster_ids ) ) {
+			foreach ( array_unique( $poster_ids ) as $id ) {
+				if ( $user = bb_get_user( $id ) ) {
+					$topics_replied_key = $bbdb->prefix . 'topics_replied';
+					bb_update_usermeta( $user->ID, $topics_replied_key, ( $old_status ? $user->$topics_replied_key + 1 : $user->$topics_replied_key - 1 ) );
+				}
+			}
+		}
 
 		if ( $ids = $bbdb->get_col( "SELECT user_id, meta_value FROM $bbdb->usermeta WHERE meta_key = 'favorites' and FIND_IN_SET('$topic_id', meta_value) > 0" ) )
 			foreach ( $ids as $id )
diff --git a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/functions.bb-users.php b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/functions.bb-users.php
index 938b0c459abfc1efdce677260a31645bb51e151e..186d488c7676aa1f4d1d7a19a2082ad24bd0f881 100644
--- a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/functions.bb-users.php
+++ b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/functions.bb-users.php
@@ -6,14 +6,30 @@ function bb_block_current_user() {
 	global $bbdb;
 	if ( $id = bb_get_current_user_info( 'id' ) )
 		bb_update_usermeta( $id, $bbdb->prefix . 'been_blocked', 1 ); // Just for logging.
+	bb_logout();
 	bb_die(__("You've been blocked.  If you think a mistake has been made, contact this site's administrator."));
 }
 
 function bb_get_user( $user_id, $args = null ) {
-	global $wp_users_object;
+	global $bbdb, $wp_users_object;
+
+	// Get user
 	$user = $wp_users_object->get_user( $user_id, $args );
-	if ( is_wp_error($user) )
+
+	// Return on no user or error object
+	if ( !is_object( $user ) || is_wp_error( $user ) )
 		return false;
+
+	// Re calculate the user's meta in case we're pulling from a value cached on another site
+	if ( $user_vars = get_object_vars( $user ) ) {
+		$prefix_length = strlen( $bbdb->prefix );
+		foreach ( $user_vars as $k => $v ) {
+			if ( 0 === strpos( $k, $bbdb->prefix ) ) {
+				$user->{substr( $k, $prefix_length )} = $v;
+			}
+		}
+	}
+
 	return $user;
 }
 
@@ -449,11 +465,12 @@ function bb_add_user_favorite( $user_id, $topic_id ) {
 	if ( !$user || !$topic )
 		return false;
 
-	$fav = $user->favorites ? explode(',', $user->favorites) : array();
+	$favorites_key = $bbdb->prefix . 'favorites';
+	$fav = $user->$favorites_key ? explode(',', $user->$favorites_key) : array();
 	if ( ! in_array( $topic_id, $fav ) ) {
 		$fav[] = $topic_id;
 		$fav = implode(',', $fav);
-		bb_update_usermeta( $user->ID, $bbdb->prefix . 'favorites', $fav);
+		bb_update_usermeta( $user->ID, $favorites_key, $fav );
 	}
 	do_action('bb_add_user_favorite', $user_id, $topic_id);
 	return true;
@@ -467,11 +484,12 @@ function bb_remove_user_favorite( $user_id, $topic_id ) {
 	if ( !$user )
 		return false;
 
-	$fav = explode(',', $user->favorites);
+	$favorites_key = $bbdb->prefix . 'favorites';
+	$fav = explode(',', $user->$favorites_key);
 	if ( is_int( $pos = array_search($topic_id, $fav) ) ) {
 		array_splice($fav, $pos, 1);
 		$fav = implode(',', $fav);
-		bb_update_usermeta( $user->ID, $bbdb->prefix . 'favorites', $fav);
+		bb_update_usermeta( $user->ID, $favorites_key, $fav);
 	}
 	do_action('bb_remove_user_favorite', $user_id, $topic_id);
 	return true;
diff --git a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/js/jquery/interface.js b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/js/jquery/interface.js
index 1cd5fa7fae4a128ca9ab1bb06332f79acf1a5df8..ba04a17cadca794614b88c618cb874d4ed96fa7a 100644
--- a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/js/jquery/interface.js
+++ b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/js/jquery/interface.js
@@ -9,5 +9,4 @@
  *   
  *
  */
-
  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}('k.f2={2r:u(M){E q.1E(u(){if(!M.aR||!M.aZ)E;D el=q;el.2l={aq:M.aq||cO,aR:M.aR,aZ:M.aZ,8e:M.8e||\'fV\',aJ:M.aJ||\'fV\',2Y:M.2Y&&2g M.2Y==\'u\'?M.2Y:I,3i:M.2Y&&2g M.3i==\'u\'?M.3i:I,7U:M.7U&&2g M.7U==\'u\'?M.7U:I,as:k(M.aR,q),8f:k(M.aZ,q),H:M.H||8J,67:M.67||0};el.2l.8f.2G().B(\'W\',\'9R\').eq(0).B({W:el.2l.aq+\'U\',19:\'2B\'}).2T();el.2l.as.1E(u(2N){q.7X=2N}).gC(u(){k(q).2R(el.2l.aJ)},u(){k(q).4i(el.2l.aJ)}).1J(\'5h\',u(e){if(el.2l.67==q.7X)E;el.2l.as.eq(el.2l.67).4i(el.2l.8e).2T().eq(q.7X).2R(el.2l.8e).2T();el.2l.8f.eq(el.2l.67).5w({W:0},el.2l.H,u(){q.14.19=\'1o\';if(el.2l.3i){el.2l.3i.1D(el,[q])}}).2T().eq(q.7X).1Y().5w({W:el.2l.aq},el.2l.H,u(){q.14.19=\'2B\';if(el.2l.2Y){el.2l.2Y.1D(el,[q])}}).2T();if(el.2l.7U){el.2l.7U.1D(el,[q,el.2l.8f.K(q.7X),el.2l.as.K(el.2l.67),el.2l.8f.K(el.2l.67)])}el.2l.67=q.7X}).eq(0).2R(el.2l.8e).2T();k(q).B(\'W\',k(q).B(\'W\')).B(\'2U\',\'2K\')})}};k.fn.gN=k.f2.2r;k.aA={2r:u(M){E q.1E(u(){D el=q;D 7E=2*18.2Q/f1;D an=2*18.2Q;if(k(el).B(\'Y\')!=\'2s\'&&k(el).B(\'Y\')!=\'1P\'){k(el).B(\'Y\',\'2s\')}el.1l={1R:k(M.1R,q),2F:M.2F,6q:M.6q,aD:M.aD,an:an,1N:k.1a.2o(q),Y:k.1a.3w(q),26:18.2Q/2,bi:M.bi,8p:M.6r,6r:[],aG:I,7E:2*18.2Q/f1};el.1l.fB=(el.1l.1N.w-el.1l.2F)/2;el.1l.7D=(el.1l.1N.h-el.1l.6q-el.1l.6q*el.1l.8p)/2;el.1l.2D=2*18.2Q/el.1l.1R.1N();el.1l.ba=el.1l.1N.w/2;el.1l.b9=el.1l.1N.h/2-el.1l.6q*el.1l.8p;D ak=1h.3F(\'22\');k(ak).B({Y:\'1P\',3I:1,Q:0,O:0});k(el).1S(ak);el.1l.1R.1E(u(2N){a6=k(\'1T\',q).K(0);W=T(el.1l.6q*el.1l.8p);if(k.3a.4t){3E=1h.3F(\'1T\');k(3E).B(\'Y\',\'1P\');3E.2J=a6.2J;3E.14.5E=\'gE 9n:9w.9y.cC(1G=60, 14=1, gB=0, gA=0, gv=0, gF=0)\'}P{3E=1h.3F(\'3E\');if(3E.fD){4L=3E.fD("2d");3E.14.Y=\'1P\';3E.14.W=W+\'U\';3E.14.Z=el.1l.2F+\'U\';3E.W=W;3E.Z=el.1l.2F;4L.gu();4L.gO(0,W);4L.gk(1,-1);4L.gp(a6,0,0,el.1l.2F,W);4L.6H();4L.gm="gG-4l";D ap=4L.hy(0,0,0,W);ap.fs(1,"fr(1V, 1V, 1V, 1)");ap.fs(0,"fr(1V, 1V, 1V, 0.6)");4L.hx=ap;if(hA.hB.3J(\'hw\')!=-1){4L.hv()}P{4L.hu(0,0,el.1l.2F,W)}}}el.1l.6r[2N]=3E;k(ak).1S(3E)}).1J(\'9z\',u(e){el.1l.aG=1b;el.1l.H=el.1l.7E*0.1*el.1l.H/18.3S(el.1l.H);E I}).1J(\'8B\',u(e){el.1l.aG=I;E I});k.aA.7T(el);el.1l.H=el.1l.7E*0.2;el.1l.ht=1X.6V(u(){el.1l.26+=el.1l.H;if(el.1l.26>an)el.1l.26=0;k.aA.7T(el)},20);k(el).1J(\'8B\',u(){el.1l.H=el.1l.7E*0.2*el.1l.H/18.3S(el.1l.H)}).1J(\'3D\',u(e){if(el.1l.aG==I){1s=k.1a.4a(e);fz=el.1l.1N.w-1s.x+el.1l.Y.x;el.1l.H=el.1l.bi*el.1l.7E*(el.1l.1N.w/2-fz)/(el.1l.1N.w/2)}})})},7T:u(el){el.1l.1R.1E(u(2N){b8=el.1l.26+2N*el.1l.2D;x=el.1l.fB*18.5H(b8);y=el.1l.7D*18.83(b8);f9=T(2a*(el.1l.7D+y)/(2*el.1l.7D));fk=(el.1l.7D+y)/(2*el.1l.7D);Z=T((el.1l.2F-el.1l.aD)*fk+el.1l.aD);W=T(Z*el.1l.6q/el.1l.2F);q.14.Q=el.1l.b9+y-W/2+"U";q.14.O=el.1l.ba+x-Z/2+"U";q.14.Z=Z+"U";q.14.W=W+"U";q.14.3I=f9;el.1l.6r[2N].14.Q=T(el.1l.b9+y+W-1-W/2)+"U";el.1l.6r[2N].14.O=T(el.1l.ba+x-Z/2)+"U";el.1l.6r[2N].14.Z=Z+"U";el.1l.6r[2N].14.W=T(W*el.1l.8p)+"U"})}};k.fn.hI=k.aA.2r;k.23({G:{c8:u(p,n,1W,1H,1m){E((-18.5H(p*18.2Q)/2)+0.5)*1H+1W},hK:u(p,n,1W,1H,1m){E 1H*(n/=1m)*n*n+1W},fl:u(p,n,1W,1H,1m){E-1H*((n=n/1m-1)*n*n*n-1)+1W},hm:u(p,n,1W,1H,1m){if((n/=1m/2)<1)E 1H/2*n*n*n*n+1W;E-1H/2*((n-=2)*n*n*n-2)+1W},8l:u(p,n,1W,1H,1m){if((n/=1m)<(1/2.75)){E 1H*(7.aB*n*n)+1W}P if(n<(2/2.75)){E 1H*(7.aB*(n-=(1.5/2.75))*n+.75)+1W}P if(n<(2.5/2.75)){E 1H*(7.aB*(n-=(2.25/2.75))*n+.gY)+1W}P{E 1H*(7.aB*(n-=(2.h2/2.75))*n+.gX)+1W}},cr:u(p,n,1W,1H,1m){if(k.G.8l)E 1H-k.G.8l(p,1m-n,0,1H,1m)+1W;E 1W+1H},gW:u(p,n,1W,1H,1m){if(k.G.cr&&k.G.8l)if(n<1m/2)E k.G.cr(p,n*2,0,1H,1m)*.5+1W;E k.G.8l(p,n*2-1m,0,1H,1m)*.5+1H*.5+1W;E 1W+1H},gQ:u(p,n,1W,1H,1m){D a,s;if(n==0)E 1W;if((n/=1m)==1)E 1W+1H;a=1H*0.3;p=1m*.3;if(a<18.3S(1H)){a=1H;s=p/4}P{s=p/(2*18.2Q)*18.cb(1H/a)}E-(a*18.6b(2,10*(n-=1))*18.83((n*1m-s)*(2*18.2Q)/p))+1W},gT:u(p,n,1W,1H,1m){D a,s;if(n==0)E 1W;if((n/=1m/2)==2)E 1W+1H;a=1H*0.3;p=1m*.3;if(a<18.3S(1H)){a=1H;s=p/4}P{s=p/(2*18.2Q)*18.cb(1H/a)}E a*18.6b(2,-10*n)*18.83((n*1m-s)*(2*18.2Q)/p)+1H+1W},gV:u(p,n,1W,1H,1m){D a,s;if(n==0)E 1W;if((n/=1m/2)==2)E 1W+1H;a=1H*0.3;p=1m*.3;if(a<18.3S(1H)){a=1H;s=p/4}P{s=p/(2*18.2Q)*18.cb(1H/a)}if(n<1){E-.5*(a*18.6b(2,10*(n-=1))*18.83((n*1m-s)*(2*18.2Q)/p))+1W}E a*18.6b(2,-10*(n-=1))*18.83((n*1m-s)*(2*18.2Q)/p)*.5+1H+1W}}});k.6n={2r:u(M){E q.1E(u(){D el=q;el.1F={1R:k(M.1R,q),1Z:k(M.1Z,q),1M:k.1a.3w(q),2F:M.2F,ax:M.ax,7Y:M.7Y,ge:M.ge,51:M.51,6x:M.6x};k.6n.aH(el,0);k(1X).1J(\'gU\',u(){el.1F.1M=k.1a.3w(el);k.6n.aH(el,0);k.6n.7T(el)});k.6n.7T(el);el.1F.1R.1J(\'9z\',u(){k(el.1F.ax,q).K(0).14.19=\'2B\'}).1J(\'8B\',u(){k(el.1F.ax,q).K(0).14.19=\'1o\'});k(1h).1J(\'3D\',u(e){D 1s=k.1a.4a(e);D 5s=0;if(el.1F.51&&el.1F.51==\'cv\')D aI=1s.x-el.1F.1M.x-(el.4c-el.1F.2F*el.1F.1R.1N())/2-el.1F.2F/2;P if(el.1F.51&&el.1F.51==\'2L\')D aI=1s.x-el.1F.1M.x-el.4c+el.1F.2F*el.1F.1R.1N();P D aI=1s.x-el.1F.1M.x;D fP=18.6b(1s.y-el.1F.1M.y-el.5W/2,2);el.1F.1R.1E(u(2N){45=18.ez(18.6b(aI-2N*el.1F.2F,2)+fP);45-=el.1F.2F/2;45=45<0?0:45;45=45>el.1F.7Y?el.1F.7Y:45;45=el.1F.7Y-45;bB=el.1F.6x*45/el.1F.7Y;q.14.Z=el.1F.2F+bB+\'U\';q.14.O=el.1F.2F*2N+5s+\'U\';5s+=bB});k.6n.aH(el,5s)})})},aH:u(el,5s){if(el.1F.51)if(el.1F.51==\'cv\')el.1F.1Z.K(0).14.O=(el.4c-el.1F.2F*el.1F.1R.1N())/2-5s/2+\'U\';P if(el.1F.51==\'O\')el.1F.1Z.K(0).14.O=-5s/el.1F.1R.1N()+\'U\';P if(el.1F.51==\'2L\')el.1F.1Z.K(0).14.O=(el.4c-el.1F.2F*el.1F.1R.1N())-5s/2+\'U\';el.1F.1Z.K(0).14.Z=el.1F.2F*el.1F.1R.1N()+5s+\'U\'},7T:u(el){el.1F.1R.1E(u(2N){q.14.Z=el.1F.2F+\'U\';q.14.O=el.1F.2F*2N+\'U\'})}};k.fn.hi=k.6n.2r;k.N={1c:S,8R:S,3A:S,2I:S,4y:S,cl:S,1d:S,2h:S,1R:S,5o:u(){k.N.8R.5o();if(k.N.3A){k.N.3A.2G()}},4w:u(){k.N.1R=S;k.N.2h=S;k.N.4y=k.N.1d.2y;if(k.N.1c.B(\'19\')==\'2B\'){if(k.N.1d.1f.fx){3m(k.N.1d.1f.fx.1u){1e\'c6\':k.N.1c.7a(k.N.1d.1f.fx.1m,k.N.5o);1r;1e\'1z\':k.N.1c.fq(k.N.1d.1f.fx.1m,k.N.5o);1r;1e\'a7\':k.N.1c.g3(k.N.1d.1f.fx.1m,k.N.5o);1r}}P{k.N.1c.2G()}if(k.N.1d.1f.3i)k.N.1d.1f.3i.1D(k.N.1d,[k.N.1c,k.N.3A])}P{k.N.5o()}1X.bH(k.N.2I)},dQ:u(){D 1d=k.N.1d;D 4d=k.N.aY(1d);if(1d&&4d.3o!=k.N.4y&&4d.3o.1g>=1d.1f.aL){k.N.4y=4d.3o;k.N.cl=4d.3o;81={2n:k(1d).1p(\'hj\')||\'2n\',2y:4d.3o};k.hl({1u:\'hk\',81:k.hf(81),he:u(fZ){1d.1f.4e=k(\'3o\',fZ);1N=1d.1f.4e.1N();if(1N>0){D 5p=\'\';1d.1f.4e.1E(u(2N){5p+=\'<8P 4I="\'+k(\'2y\',q).3g()+\'" 8K="\'+2N+\'" 14="9b: ad;">\'+k(\'3g\',q).3g()+\'</8P>\'});if(1d.1f.aU){D 3M=k(\'2y\',1d.1f.4e.K(0)).3g();1d.2y=4d.3j+3M+1d.1f.3N+4d.66;k.N.6J(1d,4d.3o.1g!=3M.1g?(4d.3j.1g+4d.3o.1g):3M.1g,4d.3o.1g!=3M.1g?(4d.3j.1g+3M.1g):3M.1g)}if(1N>0){k.N.cj(1d,5p)}P{k.N.4w()}}P{k.N.4w()}},5N:1d.1f.aN})}},cj:u(1d,5p){k.N.8R.3x(5p);k.N.1R=k(\'8P\',k.N.8R.K(0));k.N.1R.9z(k.N.di).1J(\'5h\',k.N.dj);D Y=k.1a.3w(1d);D 1N=k.1a.2o(1d);k.N.1c.B(\'Q\',Y.y+1N.hb+\'U\').B(\'O\',Y.x+\'U\').2R(1d.1f.aM);if(k.N.3A){k.N.3A.B(\'19\',\'2B\').B(\'Q\',Y.y+1N.hb+\'U\').B(\'O\',Y.x+\'U\').B(\'Z\',k.N.1c.B(\'Z\')).B(\'W\',k.N.1c.B(\'W\'))}k.N.2h=0;k.N.1R.K(0).3l=1d.1f.7H;k.N.8Q(1d,1d.1f.4e.K(0),\'7J\');if(k.N.1c.B(\'19\')==\'1o\'){if(1d.1f.bV){D cp=k.1a.aT(1d,1b);D cm=k.1a.6U(1d,1b);k.N.1c.B(\'Z\',1d.4c-(k.dF?(cp.l+cp.r+cm.l+cm.r):0)+\'U\')}if(1d.1f.fx){3m(1d.1f.fx.1u){1e\'c6\':k.N.1c.7f(1d.1f.fx.1m);1r;1e\'1z\':k.N.1c.fo(1d.1f.fx.1m);1r;1e\'a7\':k.N.1c.gb(1d.1f.fx.1m);1r}}P{k.N.1c.1Y()}if(k.N.1d.1f.2Y)k.N.1d.1f.2Y.1D(k.N.1d,[k.N.1c,k.N.3A])}},dO:u(){D 1d=q;if(1d.1f.4e){k.N.4y=1d.2y;k.N.cl=1d.2y;D 5p=\'\';1d.1f.4e.1E(u(2N){2y=k(\'2y\',q).3g().6c();fY=1d.2y.6c();if(2y.3J(fY)==0){5p+=\'<8P 4I="\'+k(\'2y\',q).3g()+\'" 8K="\'+2N+\'" 14="9b: ad;">\'+k(\'3g\',q).3g()+\'</8P>\'}});if(5p!=\'\'){k.N.cj(1d,5p);q.1f.9x=1b;E}}1d.1f.4e=S;q.1f.9x=I},6J:u(2n,26,2T){if(2n.b1){D 6t=2n.b1();6t.hp(1b);6t.dI("ck",26);6t.ha("ck",-2T+26);6t.8C()}P if(2n.aF){2n.aF(26,2T)}P{if(2n.5q){2n.5q=26;2n.dN=2T}}2n.6K()},f0:u(2n){if(2n.5q)E 2n.5q;P if(2n.b1){D 6t=1h.6J.dZ();D eX=6t.h9();E 0-eX.dI(\'ck\',-h6)}},aY:u(2n){D 4P={2y:2n.2y,3j:\'\',66:\'\',3o:\'\'};if(2n.1f.aQ){D 8N=I;D 5q=k.N.f0(2n)||0;D 4T=4P.2y.7C(2n.1f.3N);24(D i=0;i<4T.1g;i++){if((4P.3j.1g+4T[i].1g>=5q||5q==0)&&!8N){if(4P.3j.1g<=5q)4P.3o=4T[i];P 4P.66+=4T[i]+(4T[i]!=\'\'?2n.1f.3N:\'\');8N=1b}P if(8N){4P.66+=4T[i]+(4T[i]!=\'\'?2n.1f.3N:\'\')}if(!8N){4P.3j+=4T[i]+(4T.1g>1?2n.1f.3N:\'\')}}}P{4P.3o=4P.2y}E 4P},bU:u(e){1X.bH(k.N.2I);D 1d=k.N.aY(q);D 3K=e.7L||e.7K||-1;if(/13|27|35|36|38|40|9/.48(3K)&&k.N.1R){if(1X.2k){1X.2k.bT=1b;1X.2k.c0=I}P{e.aP();e.aW()}if(k.N.2h!=S)k.N.1R.K(k.N.2h||0).3l=\'\';P k.N.2h=-1;3m(3K){1e 9:1e 13:if(k.N.2h==-1)k.N.2h=0;D 2h=k.N.1R.K(k.N.2h||0);D 3M=2h.5C(\'4I\');q.2y=1d.3j+3M+q.1f.3N+1d.66;k.N.4y=1d.3o;k.N.6J(q,1d.3j.1g+3M.1g+q.1f.3N.1g,1d.3j.1g+3M.1g+q.1f.3N.1g);k.N.4w();if(q.1f.68){4u=T(2h.5C(\'8K\'))||0;k.N.8Q(q,q.1f.4e.K(4u),\'68\')}if(q.7W)q.7W(I);E 3K!=13;1r;1e 27:q.2y=1d.3j+k.N.4y+q.1f.3N+1d.66;q.1f.4e=S;k.N.4w();if(q.7W)q.7W(I);E I;1r;1e 35:k.N.2h=k.N.1R.1N()-1;1r;1e 36:k.N.2h=0;1r;1e 38:k.N.2h--;if(k.N.2h<0)k.N.2h=k.N.1R.1N()-1;1r;1e 40:k.N.2h++;if(k.N.2h==k.N.1R.1N())k.N.2h=0;1r}k.N.8Q(q,q.1f.4e.K(k.N.2h||0),\'7J\');k.N.1R.K(k.N.2h||0).3l=q.1f.7H;if(k.N.1R.K(k.N.2h||0).7W)k.N.1R.K(k.N.2h||0).7W(I);if(q.1f.aU){D aK=k.N.1R.K(k.N.2h||0).5C(\'4I\');q.2y=1d.3j+aK+q.1f.3N+1d.66;if(k.N.4y.1g!=aK.1g)k.N.6J(q,1d.3j.1g+k.N.4y.1g,1d.3j.1g+aK.1g)}E I}k.N.dO.1D(q);if(q.1f.9x==I){if(1d.3o!=k.N.4y&&1d.3o.1g>=q.1f.aL)k.N.2I=1X.9T(k.N.dQ,q.1f.54);if(k.N.1R){k.N.4w()}}E 1b},8Q:u(2n,3o,1u){if(2n.1f[1u]){D 81={};ar=3o.f3(\'*\');24(i=0;i<ar.1g;i++){81[ar[i].4Y]=ar[i].7c.h4}2n.1f[1u].1D(2n,[81])}},di:u(e){if(k.N.1R){if(k.N.2h!=S)k.N.1R.K(k.N.2h||0).3l=\'\';k.N.1R.K(k.N.2h||0).3l=\'\';k.N.2h=T(q.5C(\'8K\'))||0;k.N.1R.K(k.N.2h||0).3l=k.N.1d.1f.7H}},dj:u(2k){1X.bH(k.N.2I);2k=2k||k.2k.gS(1X.2k);2k.aP();2k.aW();D 1d=k.N.aY(k.N.1d);D 3M=q.5C(\'4I\');k.N.1d.2y=1d.3j+3M+k.N.1d.1f.3N+1d.66;k.N.4y=q.5C(\'4I\');k.N.6J(k.N.1d,1d.3j.1g+3M.1g+k.N.1d.1f.3N.1g,1d.3j.1g+3M.1g+k.N.1d.1f.3N.1g);k.N.4w();if(k.N.1d.1f.68){4u=T(q.5C(\'8K\'))||0;k.N.8Q(k.N.1d,k.N.1d.1f.4e.K(4u),\'68\')}E I},eJ:u(e){3K=e.7L||e.7K||-1;if(/13|27|35|36|38|40/.48(3K)&&k.N.1R){if(1X.2k){1X.2k.bT=1b;1X.2k.c0=I}P{e.aP();e.aW()}E I}},2r:u(M){if(!M.aN||!k.1a){E}if(!k.N.1c){if(k.3a.4t){k(\'2e\',1h).1S(\'<3A 14="19:1o;Y:1P;5E:9n:9w.9y.cC(1G=0);" id="ds" 2J="ek:I;" ej="0" ep="cD"></3A>\');k.N.3A=k(\'#ds\')}k(\'2e\',1h).1S(\'<22 id="dr" 14="Y: 1P; Q: 0; O: 0; z-cZ: h3; 19: 1o;"><9h 14="6w: 0;8F: 0; h1-14: 1o; z-cZ: h0;">&7k;</9h></22>\');k.N.1c=k(\'#dr\');k.N.8R=k(\'9h\',k.N.1c)}E q.1E(u(){if(q.4Y!=\'ch\'&&q.5C(\'1u\')!=\'3g\')E;q.1f={};q.1f.aN=M.aN;q.1f.aL=18.3S(T(M.aL)||1);q.1f.aM=M.aM?M.aM:\'\';q.1f.7H=M.7H?M.7H:\'\';q.1f.68=M.68&&M.68.1K==2A?M.68:S;q.1f.2Y=M.2Y&&M.2Y.1K==2A?M.2Y:S;q.1f.3i=M.3i&&M.3i.1K==2A?M.3i:S;q.1f.7J=M.7J&&M.7J.1K==2A?M.7J:S;q.1f.bV=M.bV||I;q.1f.aQ=M.aQ||I;q.1f.3N=q.1f.aQ?(M.3N||\', \'):\'\';q.1f.aU=M.aU?1b:I;q.1f.54=18.3S(T(M.54)||aC);if(M.fx&&M.fx.1K==7M){if(!M.fx.1u||!/c6|1z|a7/.48(M.fx.1u)){M.fx.1u=\'1z\'}if(M.fx.1u==\'1z\'&&!k.fx.1z)E;if(M.fx.1u==\'a7\'&&!k.fx.61)E;M.fx.1m=18.3S(T(M.fx.1m)||8J);if(M.fx.1m>q.1f.54){M.fx.1m=q.1f.54-2a}q.1f.fx=M.fx}q.1f.4e=S;q.1f.9x=I;k(q).1p(\'bU\',\'eN\').6K(u(){k.N.1d=q;k.N.4y=q.2y}).dH(k.N.eJ).6y(k.N.bU).5B(u(){k.N.2I=1X.9T(k.N.4w,hM)})})}};k.fn.hR=k.N.2r;k.1y={2I:S,4Q:S,29:S,2D:10,26:u(el,4J,2D,eG){k.1y.4Q=el;k.1y.29=4J;k.1y.2D=T(2D)||10;k.1y.2I=1X.6V(k.1y.eF,T(eG)||40)},eF:u(){24(i=0;i<k.1y.29.1g;i++){if(!k.1y.29[i].2X){k.1y.29[i].2X=k.23(k.1a.7G(k.1y.29[i]),k.1a.74(k.1y.29[i]),k.1a.6z(k.1y.29[i]))}P{k.1y.29[i].2X.t=k.1y.29[i].3d;k.1y.29[i].2X.l=k.1y.29[i].3c}if(k.1y.4Q.A&&k.1y.4Q.A.7q==1b){69={x:k.1y.4Q.A.2v,y:k.1y.4Q.A.2q,1C:k.1y.4Q.A.1B.1C,hb:k.1y.4Q.A.1B.hb}}P{69=k.23(k.1a.7G(k.1y.4Q),k.1a.74(k.1y.4Q))}if(k.1y.29[i].2X.t>0&&k.1y.29[i].2X.y+k.1y.29[i].2X.t>69.y){k.1y.29[i].3d-=k.1y.2D}P if(k.1y.29[i].2X.t<=k.1y.29[i].2X.h&&k.1y.29[i].2X.t+k.1y.29[i].2X.hb<69.y+69.hb){k.1y.29[i].3d+=k.1y.2D}if(k.1y.29[i].2X.l>0&&k.1y.29[i].2X.x+k.1y.29[i].2X.l>69.x){k.1y.29[i].3c-=k.1y.2D}P if(k.1y.29[i].2X.l<=k.1y.29[i].2X.hP&&k.1y.29[i].2X.l+k.1y.29[i].2X.1C<69.x+69.1C){k.1y.29[i].3c+=k.1y.2D}}},8o:u(){1X.5T(k.1y.2I);k.1y.4Q=S;k.1y.29=S;24(i in k.1y.29){k.1y.29[i].2X=S}}};k.11={1c:S,F:S,4U:u(){E q.1E(u(){if(q.9I){q.A.5e.3q(\'5v\',k.11.bN);q.A=S;q.9I=I;if(k.3a.4t){q.bE="eN"}P{q.14.hq=\'\';q.14.e1=\'\';q.14.e7=\'\'}}})},bN:u(e){if(k.11.F!=S){k.11.9A(e);E I}D C=q.3U;k(1h).1J(\'3D\',k.11.bX).1J(\'5P\',k.11.9A);C.A.1s=k.1a.4a(e);C.A.4B=C.A.1s;C.A.7q=I;C.A.ho=q!=q.3U;k.11.F=C;if(C.A.5i&&q!=q.3U){bS=k.1a.3w(C.31);bQ=k.1a.2o(C);bR={x:T(k.B(C,\'O\'))||0,y:T(k.B(C,\'Q\'))||0};dx=C.A.4B.x-bS.x-bQ.1C/2-bR.x;dy=C.A.4B.y-bS.y-bQ.hb/2-bR.y;k.3b.5c(C,[dx,dy])}E k.7n||I},ea:u(e){D C=k.11.F;C.A.7q=1b;D 9G=C.14;C.A.7V=k.B(C,\'19\');C.A.4n=k.B(C,\'Y\');if(!C.A.cz)C.A.cz=C.A.4n;C.A.2c={x:T(k.B(C,\'O\'))||0,y:T(k.B(C,\'Q\'))||0};C.A.9B=0;C.A.ai=0;if(k.3a.4t){D bW=k.1a.6U(C,1b);C.A.9B=bW.l||0;C.A.ai=bW.t||0}C.A.1B=k.23(k.1a.3w(C),k.1a.2o(C));if(C.A.4n!=\'2s\'&&C.A.4n!=\'1P\'){9G.Y=\'2s\'}k.11.1c.5o();D 5g=C.fI(1b);k(5g).B({19:\'2B\',O:\'2P\',Q:\'2P\'});5g.14.5K=\'0\';5g.14.5z=\'0\';5g.14.5k=\'0\';5g.14.5j=\'0\';k.11.1c.1S(5g);D 3Y=k.11.1c.K(0).14;if(C.A.bD){3Y.Z=\'9F\';3Y.W=\'9F\'}P{3Y.W=C.A.1B.hb+\'U\';3Y.Z=C.A.1B.1C+\'U\'}3Y.19=\'2B\';3Y.5K=\'2P\';3Y.5z=\'2P\';3Y.5k=\'2P\';3Y.5j=\'2P\';k.23(C.A.1B,k.1a.2o(5g));if(C.A.2V){if(C.A.2V.O){C.A.2c.x+=C.A.1s.x-C.A.1B.x-C.A.2V.O;C.A.1B.x=C.A.1s.x-C.A.2V.O}if(C.A.2V.Q){C.A.2c.y+=C.A.1s.y-C.A.1B.y-C.A.2V.Q;C.A.1B.y=C.A.1s.y-C.A.2V.Q}if(C.A.2V.2L){C.A.2c.x+=C.A.1s.x-C.A.1B.x-C.A.1B.hb+C.A.2V.2L;C.A.1B.x=C.A.1s.x-C.A.1B.1C+C.A.2V.2L}if(C.A.2V.4D){C.A.2c.y+=C.A.1s.y-C.A.1B.y-C.A.1B.hb+C.A.2V.4D;C.A.1B.y=C.A.1s.y-C.A.1B.hb+C.A.2V.4D}}C.A.2v=C.A.2c.x;C.A.2q=C.A.2c.y;if(C.A.8s||C.A.2p==\'94\'){8U=k.1a.6U(C.31,1b);C.A.1B.x=C.8t+(k.3a.4t?0:k.3a.7I?-8U.l:8U.l);C.A.1B.y=C.8G+(k.3a.4t?0:k.3a.7I?-8U.t:8U.t);k(C.31).1S(k.11.1c.K(0))}if(C.A.2p){k.11.c5(C);C.A.5t.2p=k.11.ce}if(C.A.5i){k.3b.ct(C)}3Y.O=C.A.1B.x-C.A.9B+\'U\';3Y.Q=C.A.1B.y-C.A.ai+\'U\';3Y.Z=C.A.1B.1C+\'U\';3Y.W=C.A.1B.hb+\'U\';k.11.F.A.9E=I;if(C.A.gx){C.A.5t.6a=k.11.c7}if(C.A.3I!=I){k.11.1c.B(\'3I\',C.A.3I)}if(C.A.1G){k.11.1c.B(\'1G\',C.A.1G);if(1X.71){k.11.1c.B(\'5E\',\'8V(1G=\'+C.A.1G*2a+\')\')}}if(C.A.7O){k.11.1c.2R(C.A.7O);k.11.1c.K(0).7c.14.19=\'1o\'}if(C.A.4o)C.A.4o.1D(C,[5g,C.A.2c.x,C.A.2c.y]);if(k.1x&&k.1x.8D>0){k.1x.ed(C)}if(C.A.46==I){9G.19=\'1o\'}E I},c5:u(C){if(C.A.2p.1K==b0){if(C.A.2p==\'94\'){C.A.28=k.23({x:0,y:0},k.1a.2o(C.31));D 8S=k.1a.6U(C.31,1b);C.A.28.w=C.A.28.1C-8S.l-8S.r;C.A.28.h=C.A.28.hb-8S.t-8S.b}P if(C.A.2p==\'1h\'){D bY=k.1a.bm();C.A.28={x:0,y:0,w:bY.w,h:bY.h}}}P if(C.A.2p.1K==7F){C.A.28={x:T(C.A.2p[0])||0,y:T(C.A.2p[1])||0,w:T(C.A.2p[2])||0,h:T(C.A.2p[3])||0}}C.A.28.dx=C.A.28.x-C.A.1B.x;C.A.28.dy=C.A.28.y-C.A.1B.y},9H:u(F){if(F.A.8s||F.A.2p==\'94\'){k(\'2e\',1h).1S(k.11.1c.K(0))}k.11.1c.5o().2G().B(\'1G\',1);if(1X.71){k.11.1c.B(\'5E\',\'8V(1G=2a)\')}},9A:u(e){k(1h).3q(\'3D\',k.11.bX).3q(\'5P\',k.11.9A);if(k.11.F==S){E}D F=k.11.F;k.11.F=S;if(F.A.7q==I){E I}if(F.A.44==1b){k(F).B(\'Y\',F.A.4n)}D 9G=F.14;if(F.5i){k.11.1c.B(\'9b\',\'8j\')}if(F.A.7O){k.11.1c.4i(F.A.7O)}if(F.A.6N==I){if(F.A.fx>0){if(!F.A.1O||F.A.1O==\'4j\'){D x=12 k.fx(F,{1m:F.A.fx},\'O\');x.1L(F.A.2c.x,F.A.8y)}if(!F.A.1O||F.A.1O==\'49\'){D y=12 k.fx(F,{1m:F.A.fx},\'Q\');y.1L(F.A.2c.y,F.A.8v)}}P{if(!F.A.1O||F.A.1O==\'4j\')F.14.O=F.A.8y+\'U\';if(!F.A.1O||F.A.1O==\'49\')F.14.Q=F.A.8v+\'U\'}k.11.9H(F);if(F.A.46==I){k(F).B(\'19\',F.A.7V)}}P if(F.A.fx>0){F.A.9E=1b;D dh=I;if(k.1x&&k.1t&&F.A.44){dh=k.1a.3w(k.1t.1c.K(0))}k.11.1c.5w({O:dh?dh.x:F.A.1B.x,Q:dh?dh.y:F.A.1B.y},F.A.fx,u(){F.A.9E=I;if(F.A.46==I){F.14.19=F.A.7V}k.11.9H(F)})}P{k.11.9H(F);if(F.A.46==I){k(F).B(\'19\',F.A.7V)}}if(k.1x&&k.1x.8D>0){k.1x.eO(F)}if(k.1t&&F.A.44){k.1t.fC(F)}if(F.A.2Z&&(F.A.8y!=F.A.2c.x||F.A.8v!=F.A.2c.y)){F.A.2Z.1D(F,F.A.b3||[0,0,F.A.8y,F.A.8v])}if(F.A.3T)F.A.3T.1D(F);E I},c7:u(x,y,dx,dy){if(dx!=0)dx=T((dx+(q.A.gx*dx/18.3S(dx))/2)/q.A.gx)*q.A.gx;if(dy!=0)dy=T((dy+(q.A.gy*dy/18.3S(dy))/2)/q.A.gy)*q.A.gy;E{dx:dx,dy:dy,x:0,y:0}},ce:u(x,y,dx,dy){dx=18.3L(18.3r(dx,q.A.28.dx),q.A.28.w+q.A.28.dx-q.A.1B.1C);dy=18.3L(18.3r(dy,q.A.28.dy),q.A.28.h+q.A.28.dy-q.A.1B.hb);E{dx:dx,dy:dy,x:0,y:0}},bX:u(e){if(k.11.F==S||k.11.F.A.9E==1b){E}D F=k.11.F;F.A.4B=k.1a.4a(e);if(F.A.7q==I){45=18.ez(18.6b(F.A.1s.x-F.A.4B.x,2)+18.6b(F.A.1s.y-F.A.4B.y,2));if(45<F.A.6M){E}P{k.11.ea(e)}}D dx=F.A.4B.x-F.A.1s.x;D dy=F.A.4B.y-F.A.1s.y;24(D i in F.A.5t){D 3y=F.A.5t[i].1D(F,[F.A.2c.x+dx,F.A.2c.y+dy,dx,dy]);if(3y&&3y.1K==7M){dx=i!=\'7R\'?3y.dx:(3y.x-F.A.2c.x);dy=i!=\'7R\'?3y.dy:(3y.y-F.A.2c.y)}}F.A.2v=F.A.1B.x+dx-F.A.9B;F.A.2q=F.A.1B.y+dy-F.A.ai;if(F.A.5i&&(F.A.3H||F.A.2Z)){k.3b.3H(F,F.A.2v,F.A.2q)}if(F.A.4m)F.A.4m.1D(F,[F.A.2c.x+dx,F.A.2c.y+dy]);if(!F.A.1O||F.A.1O==\'4j\'){F.A.8y=F.A.2c.x+dx;k.11.1c.K(0).14.O=F.A.2v+\'U\'}if(!F.A.1O||F.A.1O==\'49\'){F.A.8v=F.A.2c.y+dy;k.11.1c.K(0).14.Q=F.A.2q+\'U\'}if(k.1x&&k.1x.8D>0){k.1x.al(F)}E I},2r:u(o){if(!k.11.1c){k(\'2e\',1h).1S(\'<22 id="e8"></22>\');k.11.1c=k(\'#e8\');D el=k.11.1c.K(0);D 4J=el.14;4J.Y=\'1P\';4J.19=\'1o\';4J.9b=\'8j\';4J.eu=\'1o\';4J.2U=\'2K\';if(1X.71){el.bE="e4"}P{4J.gi=\'1o\';4J.e7=\'1o\';4J.e1=\'1o\'}}if(!o){o={}}E q.1E(u(){if(q.9I||!k.1a)E;if(1X.71){q.gh=u(){E I};q.gj=u(){E I}}D el=q;D 5e=o.3v?k(q).gf(o.3v):k(q);if(k.3a.4t){5e.1E(u(){q.bE="e4"})}P{5e.B(\'-gI-7R-8C\',\'1o\');5e.B(\'7R-8C\',\'1o\');5e.B(\'-gH-7R-8C\',\'1o\')}q.A={5e:5e,6N:o.6N?1b:I,46:o.46?1b:I,44:o.44?o.44:I,5i:o.5i?o.5i:I,8s:o.8s?o.8s:I,3I:o.3I?T(o.3I)||0:I,1G:o.1G?2m(o.1G):I,fx:T(o.fx)||S,6R:o.6R?o.6R:I,5t:{},1s:{},4o:o.4o&&o.4o.1K==2A?o.4o:I,3T:o.3T&&o.3T.1K==2A?o.3T:I,2Z:o.2Z&&o.2Z.1K==2A?o.2Z:I,1O:/49|4j/.48(o.1O)?o.1O:I,6M:o.6M?T(o.6M)||0:0,2V:o.2V?o.2V:I,bD:o.bD?1b:I,7O:o.7O||I};if(o.5t&&o.5t.1K==2A)q.A.5t.7R=o.5t;if(o.4m&&o.4m.1K==2A)q.A.4m=o.4m;if(o.2p&&((o.2p.1K==b0&&(o.2p==\'94\'||o.2p==\'1h\'))||(o.2p.1K==7F&&o.2p.1g==4))){q.A.2p=o.2p}if(o.2O){q.A.2O=o.2O}if(o.6a){if(2g o.6a==\'gz\'){q.A.gx=T(o.6a)||1;q.A.gy=T(o.6a)||1}P if(o.6a.1g==2){q.A.gx=T(o.6a[0])||1;q.A.gy=T(o.6a[1])||1}}if(o.3H&&o.3H.1K==2A){q.A.3H=o.3H}q.9I=1b;5e.1E(u(){q.3U=el});5e.1J(\'5v\',k.11.bN)})}};k.fn.23({aS:k.11.4U,7t:k.11.2r});k.1x={du:u(5J,5G,7Q,7S){E 5J<=k.11.F.A.2v&&(5J+7Q)>=(k.11.F.A.2v+k.11.F.A.1B.w)&&5G<=k.11.F.A.2q&&(5G+7S)>=(k.11.F.A.2q+k.11.F.A.1B.h)?1b:I},cV:u(5J,5G,7Q,7S){E!(5J>(k.11.F.A.2v+k.11.F.A.1B.w)||(5J+7Q)<k.11.F.A.2v||5G>(k.11.F.A.2q+k.11.F.A.1B.h)||(5G+7S)<k.11.F.A.2q)?1b:I},1s:u(5J,5G,7Q,7S){E 5J<k.11.F.A.4B.x&&(5J+7Q)>k.11.F.A.4B.x&&5G<k.11.F.A.4B.y&&(5G+7S)>k.11.F.A.4B.y?1b:I},5r:I,3Q:{},8D:0,3P:{},ed:u(C){if(k.11.F==S){E}D i;k.1x.3Q={};D bJ=I;24(i in k.1x.3P){if(k.1x.3P[i]!=S){D 1j=k.1x.3P[i].K(0);if(k(k.11.F).is(\'.\'+1j.1i.a)){if(1j.1i.m==I){1j.1i.p=k.23(k.1a.7G(1j),k.1a.74(1j));1j.1i.m=1b}if(1j.1i.ac){k.1x.3P[i].2R(1j.1i.ac)}k.1x.3Q[i]=k.1x.3P[i];if(k.1t&&1j.1i.s&&k.11.F.A.44){1j.1i.el=k(\'.\'+1j.1i.a,1j);C.14.19=\'1o\';k.1t.cT(1j);1j.1i.ay=k.1t.8x(k.1p(1j,\'id\')).7l;C.14.19=C.A.7V;bJ=1b}if(1j.1i.9i){1j.1i.9i.1D(k.1x.3P[i].K(0),[k.11.F])}}}}if(bJ){k.1t.26()}},dS:u(){k.1x.3Q={};24(i in k.1x.3P){if(k.1x.3P[i]!=S){D 1j=k.1x.3P[i].K(0);if(k(k.11.F).is(\'.\'+1j.1i.a)){1j.1i.p=k.23(k.1a.7G(1j),k.1a.74(1j));if(1j.1i.ac){k.1x.3P[i].2R(1j.1i.ac)}k.1x.3Q[i]=k.1x.3P[i];if(k.1t&&1j.1i.s&&k.11.F.A.44){1j.1i.el=k(\'.\'+1j.1i.a,1j);C.14.19=\'1o\';k.1t.cT(1j);C.14.19=C.A.7V}}}}},al:u(e){if(k.11.F==S){E}k.1x.5r=I;D i;D bK=I;D eQ=0;24(i in k.1x.3Q){D 1j=k.1x.3Q[i].K(0);if(k.1x.5r==I&&k.1x[1j.1i.t](1j.1i.p.x,1j.1i.p.y,1j.1i.p.1C,1j.1i.p.hb)){if(1j.1i.hc&&1j.1i.h==I){k.1x.3Q[i].2R(1j.1i.hc)}if(1j.1i.h==I&&1j.1i.7x){bK=1b}1j.1i.h=1b;k.1x.5r=1j;if(k.1t&&1j.1i.s&&k.11.F.A.44){k.1t.1c.K(0).3l=1j.1i.eV;k.1t.al(1j)}eQ++}P if(1j.1i.h==1b){if(1j.1i.7y){1j.1i.7y.1D(1j,[e,k.11.1c.K(0).7c,1j.1i.fx])}if(1j.1i.hc){k.1x.3Q[i].4i(1j.1i.hc)}1j.1i.h=I}}if(k.1t&&!k.1x.5r&&k.11.F.44){k.1t.1c.K(0).14.19=\'1o\'}if(bK){k.1x.5r.1i.7x.1D(k.1x.5r,[e,k.11.1c.K(0).7c])}},eO:u(e){D i;24(i in k.1x.3Q){D 1j=k.1x.3Q[i].K(0);if(1j.1i.ac){k.1x.3Q[i].4i(1j.1i.ac)}if(1j.1i.hc){k.1x.3Q[i].4i(1j.1i.hc)}if(1j.1i.s){k.1t.7s[k.1t.7s.1g]=i}if(1j.1i.9l&&1j.1i.h==1b){1j.1i.h=I;1j.1i.9l.1D(1j,[e,1j.1i.fx])}1j.1i.m=I;1j.1i.h=I}k.1x.3Q={}},4U:u(){E q.1E(u(){if(q.9j){if(q.1i.s){id=k.1p(q,\'id\');k.1t.5L[id]=S;k(\'.\'+q.1i.a,q).aS()}k.1x.3P[\'d\'+q.c2]=S;q.9j=I;q.f=S}})},2r:u(o){E q.1E(u(){if(q.9j==1b||!o.3C||!k.1a||!k.11){E}q.1i={a:o.3C,ac:o.9J||I,hc:o.a5||I,eV:o.58||I,9l:o.gq||o.9l||I,7x:o.7x||o.dC||I,7y:o.7y||o.fO||I,9i:o.9i||I,t:o.6I&&(o.6I==\'du\'||o.6I==\'cV\')?o.6I:\'1s\',fx:o.fx?o.fx:I,m:I,h:I};if(o.cQ==1b&&k.1t){id=k.1p(q,\'id\');k.1t.5L[id]=q.1i.a;q.1i.s=1b;if(o.2Z){q.1i.2Z=o.2Z;q.1i.ay=k.1t.8x(id).7l}}q.9j=1b;q.c2=T(18.6o()*c9);k.1x.3P[\'d\'+q.c2]=k(q);k.1x.8D++})}};k.fn.23({dR:k.1x.4U,do:k.1x.2r});k.gD=k.1x.dS;k.3B={1c:S,8L:u(){3g=q.2y;if(!3g)E;14={dz:k(q).B(\'dz\')||\'\',4A:k(q).B(\'4A\')||\'\',8Z:k(q).B(\'8Z\')||\'\',dP:k(q).B(\'dP\')||\'\',dT:k(q).B(\'dT\')||\'\',dU:k(q).B(\'dU\')||\'\',c3:k(q).B(\'c3\')||\'\',dY:k(q).B(\'dY\')||\'\'};k.3B.1c.B(14);3x=k.3B.dX(3g);3x=3x.4E(12 bb("\\\\n","g"),"<br />");k.3B.1c.3x(\'gL\');ci=k.3B.1c.K(0).4c;k.3B.1c.3x(3x);Z=k.3B.1c.K(0).4c+ci;if(q.6l.2M&&Z>q.6l.2M[0]){Z=q.6l.2M[0]}q.14.Z=Z+\'U\';if(q.4Y==\'cf\'){W=k.3B.1c.K(0).5W+ci;if(q.6l.2M&&W>q.6l.2M[1]){W=q.6l.2M[1]}q.14.W=W+\'U\'}},dX:u(3g){cg={\'&\':\'&gK;\',\'<\':\'&gJ;\',\'>\':\'&gt;\',\'"\':\'&gs;\'};24(i in cg){3g=3g.4E(12 bb(i,\'g\'),cg[i])}E 3g},2r:u(2M){if(k.3B.1c==S){k(\'2e\',1h).1S(\'<22 id="dE" 14="Y: 1P; Q: 0; O: 0; 3n: 2K;"></22>\');k.3B.1c=k(\'#dE\')}E q.1E(u(){if(/cf|ch/.48(q.4Y)){if(q.4Y==\'ch\'){dB=q.5C(\'1u\');if(!/3g|gr/.48(dB)){E}}if(2M&&(2M.1K==bn||(2M.1K==7F&&2M.1g==2))){if(2M.1K==bn)2M=[2M,2M];P{2M[0]=T(2M[0])||8J;2M[1]=T(2M[1])||8J}q.6l={2M:2M}}k(q).5B(k.3B.8L).6y(k.3B.8L).dH(k.3B.8L);k.3B.8L.1D(q)}})}};k.fn.kc=k.3B.2r;k.4K=u(e){if(/^kd$|^ke$|^ka$|^6L$|^k9$|^k5$|^k4$|^k6$|^k7$|^2e$|^k8$|^kf$|^kg$|^kn$|^ko$|^kp$|^kq$/i.48(e.9N))E I;P E 1b};k.fx.a0=u(e,65){D c=e.7c;D cs=c.14;cs.Y=65.Y;cs.5K=65.3G.t;cs.5j=65.3G.l;cs.5k=65.3G.b;cs.5z=65.3G.r;cs.Q=65.Q+\'U\';cs.O=65.O+\'U\';e.31.ew(c,e);e.31.km(e)};k.fx.9P=u(e){if(!k.4K(e))E I;D t=k(e);D es=e.14;D 73=I;if(t.B(\'19\')==\'1o\'){5Y=t.B(\'3n\');t.B(\'3n\',\'2K\').1Y();73=1b}D V={};V.Y=t.B(\'Y\');V.1q=k.1a.2o(e);V.3G=k.1a.cy(e);D co=e.4Z?e.4Z.ei:t.B(\'hU\');V.Q=T(t.B(\'Q\'))||0;V.O=T(t.B(\'O\'))||0;D eo=\'kl\'+T(18.6o()*c9);D 6u=1h.3F(/^1T$|^br$|^kh$|^hr$|^8C$|^kj$|^8T$|^3A$|^kk$|^k3$|^k2$|^9h$|^dl$|^jM$/i.48(e.9N)?\'22\':e.9N);k.1p(6u,\'id\',eo);D jN=k(6u).2R(\'jO\');D 4h=6u.14;D Q=0;D O=0;if(V.Y==\'2s\'||V.Y==\'1P\'){Q=V.Q;O=V.O}4h.Q=Q+\'U\';4h.O=O+\'U\';4h.Y=V.Y!=\'2s\'&&V.Y!=\'1P\'?\'2s\':V.Y;4h.W=V.1q.hb+\'U\';4h.Z=V.1q.1C+\'U\';4h.5K=V.3G.t;4h.5z=V.3G.r;4h.5k=V.3G.b;4h.5j=V.3G.l;4h.2U=\'2K\';if(k.3a.4t){4h.ei=co}P{4h.jK=co}if(k.3a=="4t"){es.5E="8V(1G="+0.ex*2a+")"}es.1G=0.ex;e.31.ew(6u,e);6u.jF(e);es.5K=\'2P\';es.5z=\'2P\';es.5k=\'2P\';es.5j=\'2P\';es.Y=\'1P\';es.eu=\'1o\';es.Q=\'2P\';es.O=\'2P\';if(73){t.2G();es.3n=5Y}E{V:V,3p:k(6u)}};k.fx.8E={jE:[0,1V,1V],jG:[eD,1V,1V],jH:[e6,e6,jI],jP:[0,0,0],ks:[0,0,1V],jY:[dv,42,42],jZ:[0,1V,1V],k0:[0,0,7w],k1:[0,7w,7w],jX:[cn,cn,cn],jS:[0,2a,0],jR:[jT,jU,eb],jV:[7w,0,7w],kr:[85,eb,47],kP:[1V,eA,0],kN:[kO,50,kx],kF:[7w,0,0],kD:[ku,f8,kt],ky:[kH,0,9C],kL:[1V,0,1V],kM:[1V,kJ,0],kv:[0,6C,0],kA:[75,0,kE],kC:[eD,eB,eA],kG:[kI,kB,eB],kw:[e0,1V,1V],kz:[eL,kK,eL],kQ:[9C,9C,9C],jC:[1V,iy,iz],iA:[1V,1V,e0],iB:[0,1V,0],ix:[1V,0,1V],iv:[6C,0,0],iq:[0,0,6C],ip:[6C,6C,0],ir:[1V,dv,0],it:[1V,ah,iu],iC:[6C,0,6C],iD:[1V,0,0],iK:[ah,ah,ah],iL:[1V,1V,1V],iM:[1V,1V,0]};k.fx.6D=u(4x,dm){if(k.fx.8E[4x])E{r:k.fx.8E[4x][0],g:k.fx.8E[4x][1],b:k.fx.8E[4x][2]};P if(2W=/^6Y\\(\\s*([0-9]{1,3})\\s*,\\s*([0-9]{1,3})\\s*,\\s*([0-9]{1,3})\\s*\\)$/.a4(4x))E{r:T(2W[1]),g:T(2W[2]),b:T(2W[3])};P if(2W=/6Y\\(\\s*([0-9]+(?:\\.[0-9]+)?)\\%\\s*,\\s*([0-9]+(?:\\.[0-9]+)?)\\%\\s*,\\s*([0-9]+(?:\\.[0-9]+)?)\\%\\s*\\)$/.a4(4x))E{r:2m(2W[1])*2.55,g:2m(2W[2])*2.55,b:2m(2W[3])*2.55};P if(2W=/^#([a-fA-79-9])([a-fA-79-9])([a-fA-79-9])$/.a4(4x))E{r:T("77"+2W[1]+2W[1]),g:T("77"+2W[2]+2W[2]),b:T("77"+2W[3]+2W[3])};P if(2W=/^#([a-fA-79-9]{2})([a-fA-79-9]{2})([a-fA-79-9]{2})$/.a4(4x))E{r:T("77"+2W[1]),g:T("77"+2W[2]),b:T("77"+2W[3])};P E dm==1b?I:{r:1V,g:1V,b:1V}};k.fx.dD={5Q:1,5b:1,5O:1,4S:1,4D:1,4A:1,W:1,O:1,c3:1,iI:1,5k:1,5j:1,5z:1,5K:1,8b:1,6x:1,8c:1,av:1,1G:1,iE:1,iF:1,5n:1,4X:1,5U:1,5M:1,2L:1,jD:1,Q:1,Z:1,3I:1};k.fx.dA={7i:1,iG:1,iH:1,io:1,im:1,4x:1,i2:1};k.fx.8A=[\'i3\',\'i4\',\'i5\',\'i1\'];k.fx.cc={\'cd\':[\'2E\',\'dK\'],\'a8\':[\'2E\',\'bh\'],\'6w\':[\'6w\',\'\'],\'8F\':[\'8F\',\'\']};k.fn.23({5w:u(5X,H,G,J){E q.1w(u(){D a1=k.H(H,G,J);D e=12 k.dM(q,a1,5X)})},c4:u(H,J){E q.1w(u(){D a1=k.H(H,J);D e=12 k.c4(q,a1)})},8o:u(2D){E q.1E(u(){if(q.6d)k.by(q,2D)})},i0:u(2D){E q.1E(u(){if(q.6d)k.by(q,2D);if(q.1w&&q.1w[\'fx\'])q.1w.fx=[]})}});k.23({c4:u(2f,M){D z=q,3t;z.2D=u(){if(k.fQ(M.21))M.21.1D(2f)};z.2I=6V(u(){z.2D()},M.1m);2f.6d=z},G:{c8:u(p,n,1W,1H,1m){E((-18.5H(p*18.2Q)/2)+0.5)*1H+1W}},dM:u(2f,M,5X){D z=q,3t;D y=2f.14;D fR=k.B(2f,"2U");D 72=k.B(2f,"19");D 2j={};z.9O=(12 7g()).7z();M.G=M.G&&k.G[M.G]?M.G:\'c8\';z.ag=u(2w,43){if(k.fx.dD[2w]){if(43==\'1Y\'||43==\'2G\'||43==\'3R\'){if(!2f.6v)2f.6v={};D r=2m(k.6E(2f,2w));2f.6v[2w]=r&&r>-c9?r:(2m(k.B(2f,2w))||0);43=43==\'3R\'?(72==\'1o\'?\'1Y\':\'2G\'):43;M[43]=1b;2j[2w]=43==\'1Y\'?[0,2f.6v[2w]]:[2f.6v[2w],0];if(2w!=\'1G\')y[2w]=2j[2w][0]+(2w!=\'3I\'&&2w!=\'8Z\'?\'U\':\'\');P k.1p(y,"1G",2j[2w][0])}P{2j[2w]=[2m(k.6E(2f,2w)),2m(43)||0]}}P if(k.fx.dA[2w])2j[2w]=[k.fx.6D(k.6E(2f,2w)),k.fx.6D(43)];P if(/^6w$|8F$|2E$|a8$|cd$/i.48(2w)){D m=43.4E(/\\s+/g,\' \').4E(/6Y\\s*\\(\\s*/g,\'6Y(\').4E(/\\s*,\\s*/g,\',\').4E(/\\s*\\)/g,\')\').d5(/([^\\s]+)/g);3m(2w){1e\'6w\':1e\'8F\':1e\'cd\':1e\'a8\':m[3]=m[3]||m[1]||m[0];m[2]=m[2]||m[0];m[1]=m[1]||m[0];24(D i=0;i<k.fx.8A.1g;i++){D 64=k.fx.cc[2w][0]+k.fx.8A[i]+k.fx.cc[2w][1];2j[64]=2w==\'a8\'?[k.fx.6D(k.6E(2f,64)),k.fx.6D(m[i])]:[2m(k.6E(2f,64)),2m(m[i])]}1r;1e\'2E\':24(D i=0;i<m.1g;i++){D bd=2m(m[i]);D a9=!hX(bd)?\'dK\':(!/cu|1o|2K|hY|hZ|i6|i7|ii|ij|ik|il/i.48(m[i])?\'bh\':I);if(a9){24(D j=0;j<k.fx.8A.1g;j++){64=\'2E\'+k.fx.8A[j]+a9;2j[64]=a9==\'bh\'?[k.fx.6D(k.6E(2f,64)),k.fx.6D(m[i])]:[2m(k.6E(2f,64)),bd]}}P{y[\'ie\']=m[i]}}1r}}P{y[2w]=43}E I};24(p in 5X){if(p==\'14\'){D 5f=k.bl(5X[p]);24(7A in 5f){q.ag(7A,5f[7A])}}P if(p==\'3l\'){if(1h.af)24(D i=0;i<1h.af.1g;i++){D 7e=1h.af[i].7e||1h.af[i].i9||S;if(7e){24(D j=0;j<7e.1g;j++){if(7e[j].i8==\'.\'+5X[p]){D 6X=12 bb(\'\\.\'+5X[p]+\' {\');D 5Z=7e[j].14.9X;D 5f=k.bl(5Z.4E(6X,\'\').4E(/}/g,\'\'));24(7A in 5f){q.ag(7A,5f[7A])}}}}}}P{q.ag(p,5X[p])}}y.19=72==\'1o\'?\'2B\':72;y.2U=\'2K\';z.2D=u(){D t=(12 7g()).7z();if(t>M.1m+z.9O){5T(z.2I);z.2I=S;24(p in 2j){if(p=="1G")k.1p(y,"1G",2j[p][1]);P if(2g 2j[p][1]==\'8T\')y[p]=\'6Y(\'+2j[p][1].r+\',\'+2j[p][1].g+\',\'+2j[p][1].b+\')\';P y[p]=2j[p][1]+(p!=\'3I\'&&p!=\'8Z\'?\'U\':\'\')}if(M.2G||M.1Y)24(D p in 2f.6v)if(p=="1G")k.1p(y,p,2f.6v[p]);P y[p]="";y.19=M.2G?\'1o\':(72!=\'1o\'?72:\'2B\');y.2U=fR;2f.6d=S;if(k.fQ(M.21))M.21.1D(2f)}P{D n=t-q.9O;D 8w=n/M.1m;24(p in 2j){if(2g 2j[p][1]==\'8T\'){y[p]=\'6Y(\'+T(k.G[M.G](8w,n,2j[p][0].r,(2j[p][1].r-2j[p][0].r),M.1m))+\',\'+T(k.G[M.G](8w,n,2j[p][0].g,(2j[p][1].g-2j[p][0].g),M.1m))+\',\'+T(k.G[M.G](8w,n,2j[p][0].b,(2j[p][1].b-2j[p][0].b),M.1m))+\')\'}P{D bz=k.G[M.G](8w,n,2j[p][0],(2j[p][1]-2j[p][0]),M.1m);if(p=="1G")k.1p(y,"1G",bz);P y[p]=bz+(p!=\'3I\'&&p!=\'8Z\'?\'U\':\'\')}}}};z.2I=6V(u(){z.2D()},13);2f.6d=z},by:u(2f,2D){if(2D)2f.6d.9O-=iO;P{1X.5T(2f.6d.2I);2f.6d=S;k.2H(2f,"fx")}}});k.bl=u(5Z){D 5f={};if(2g 5Z==\'4V\'){5Z=5Z.6c().7C(\';\');24(D i=0;i<5Z.1g;i++){6X=5Z[i].7C(\':\');if(6X.1g==2){5f[k.g6(6X[0].4E(/\\-(\\w)/g,u(m,c){E c.jo()}))]=k.g6(6X[1])}}}E 5f};k.fn.23({g3:u(H,J,G){E q.1w(\'1n\',u(){12 k.fx.61(q,H,J,\'4F\',G)})},gb:u(H,J,G){E q.1w(\'1n\',u(){12 k.fx.61(q,H,J,\'4r\',G)})},jl:u(H,J,G){E q.1w(\'1n\',u(){12 k.fx.61(q,H,J,\'fJ\',G)})},jk:u(H,J,G){E q.1w(\'1n\',u(){12 k.fx.61(q,H,J,\'O\',G)})},jg:u(H,J,G){E q.1w(\'1n\',u(){12 k.fx.61(q,H,J,\'2L\',G)})},jf:u(H,J,G){E q.1w(\'1n\',u(){12 k.fx.61(q,H,J,\'fh\',G)})}});k.fx.61=u(e,H,J,2S,G){if(!k.4K(e)){k.2H(e,\'1n\');E I}D z=q;z.el=k(e);z.1N=k.1a.2o(e);z.G=2g J==\'4V\'?J:G||S;if(!e.4s)e.4s=z.el.B(\'19\');if(2S==\'fJ\'){2S=z.el.B(\'19\')==\'1o\'?\'4r\':\'4F\'}P if(2S==\'fh\'){2S=z.el.B(\'19\')==\'1o\'?\'2L\':\'O\'}z.el.1Y();z.H=H;z.J=2g J==\'u\'?J:S;z.fx=k.fx.9P(e);z.2S=2S;z.21=u(){if(z.J&&z.J.1K==2A){z.J.1D(z.el.K(0))}if(z.2S==\'4r\'||z.2S==\'2L\'){z.el.B(\'19\',z.el.K(0).4s==\'1o\'?\'2B\':z.el.K(0).4s)}P{z.el.2G()}k.fx.a0(z.fx.3p.K(0),z.fx.V);k.2H(z.el.K(0),\'1n\')};3m(z.2S){1e\'4F\':63=12 k.fx(z.fx.3p.K(0),k.H(z.H,z.G,z.21),\'W\');63.1L(z.fx.V.1q.hb,0);1r;1e\'4r\':z.fx.3p.B(\'W\',\'9R\');z.el.1Y();63=12 k.fx(z.fx.3p.K(0),k.H(z.H,z.G,z.21),\'W\');63.1L(0,z.fx.V.1q.hb);1r;1e\'O\':63=12 k.fx(z.fx.3p.K(0),k.H(z.H,z.G,z.21),\'Z\');63.1L(z.fx.V.1q.1C,0);1r;1e\'2L\':z.fx.3p.B(\'Z\',\'9R\');z.el.1Y();63=12 k.fx(z.fx.3p.K(0),k.H(z.H,z.G,z.21),\'Z\');63.1L(0,z.fx.V.1q.1C);1r}};k.fn.ji=u(5D,J){E q.1w(\'1n\',u(){if(!k.4K(q)){k.2H(q,\'1n\');E I}D e=12 k.fx.f4(q,5D,J);e.bp()})};k.fx.f4=u(e,5D,J){D z=q;z.el=k(e);z.el.1Y();z.J=J;z.5D=T(5D)||40;z.V={};z.V.Y=z.el.B(\'Y\');z.V.Q=T(z.el.B(\'Q\'))||0;z.V.O=T(z.el.B(\'O\'))||0;if(z.V.Y!=\'2s\'&&z.V.Y!=\'1P\'){z.el.B(\'Y\',\'2s\')}z.3V=5;z.5y=1;z.bp=u(){z.5y++;z.e=12 k.fx(z.el.K(0),{1m:jj,21:u(){z.e=12 k.fx(z.el.K(0),{1m:80,21:u(){z.5D=T(z.5D/2);if(z.5y<=z.3V)z.bp();P{z.el.B(\'Y\',z.V.Y).B(\'Q\',z.V.Q+\'U\').B(\'O\',z.V.O+\'U\');k.2H(z.el.K(0),\'1n\');if(z.J&&z.J.1K==2A){z.J.1D(z.el.K(0))}}}},\'Q\');z.e.1L(z.V.Q-z.5D,z.V.Q)}},\'Q\');z.e.1L(z.V.Q,z.V.Q-z.5D)}};k.fn.23({jy:u(H,J,G){E q.1w(\'1n\',u(){12 k.fx.4f(q,H,J,\'4r\',\'4l\',G)})},jz:u(H,J,G){E q.1w(\'1n\',u(){12 k.fx.4f(q,H,J,\'4r\',\'in\',G)})},jA:u(H,J,G){E q.1w(\'1n\',u(){12 k.fx.4f(q,H,J,\'4r\',\'3R\',G)})},jB:u(H,J,G){E q.1w(\'1n\',u(){12 k.fx.4f(q,H,J,\'4F\',\'4l\',G)})},jx:u(H,J,G){E q.1w(\'1n\',u(){12 k.fx.4f(q,H,J,\'4F\',\'in\',G)})},jw:u(H,J,G){E q.1w(\'1n\',u(){12 k.fx.4f(q,H,J,\'4F\',\'3R\',G)})},js:u(H,J,G){E q.1w(\'1n\',u(){12 k.fx.4f(q,H,J,\'O\',\'4l\',G)})},jt:u(H,J,G){E q.1w(\'1n\',u(){12 k.fx.4f(q,H,J,\'O\',\'in\',G)})},ju:u(H,J,G){E q.1w(\'1n\',u(){12 k.fx.4f(q,H,J,\'O\',\'3R\',G)})},jv:u(H,J,G){E q.1w(\'1n\',u(){12 k.fx.4f(q,H,J,\'2L\',\'4l\',G)})},je:u(H,J,G){E q.1w(\'1n\',u(){12 k.fx.4f(q,H,J,\'2L\',\'in\',G)})},jd:u(H,J,G){E q.1w(\'1n\',u(){12 k.fx.4f(q,H,J,\'2L\',\'3R\',G)})}});k.fx.4f=u(e,H,J,2S,1u,G){if(!k.4K(e)){k.2H(e,\'1n\');E I}D z=q;z.el=k(e);z.G=2g J==\'4V\'?J:G||S;z.V={};z.V.Y=z.el.B(\'Y\');z.V.Q=z.el.B(\'Q\');z.V.O=z.el.B(\'O\');if(!e.4s)e.4s=z.el.B(\'19\');if(1u==\'3R\'){1u=z.el.B(\'19\')==\'1o\'?\'in\':\'4l\'}z.el.1Y();if(z.V.Y!=\'2s\'&&z.V.Y!=\'1P\'){z.el.B(\'Y\',\'2s\')}z.1u=1u;J=2g J==\'u\'?J:S;8H=1;3m(2S){1e\'4F\':z.e=12 k.fx(z.el.K(0),k.H(H-15,z.G,J),\'Q\');z.62=2m(z.V.Q)||0;z.9K=z.fG;8H=-1;1r;1e\'4r\':z.e=12 k.fx(z.el.K(0),k.H(H-15,z.G,J),\'Q\');z.62=2m(z.V.Q)||0;z.9K=z.fG;1r;1e\'2L\':z.e=12 k.fx(z.el.K(0),k.H(H-15,z.G,J),\'O\');z.62=2m(z.V.O)||0;z.9K=z.fy;1r;1e\'O\':z.e=12 k.fx(z.el.K(0),k.H(H-15,z.G,J),\'O\');z.62=2m(z.V.O)||0;z.9K=z.fy;8H=-1;1r}z.e2=12 k.fx(z.el.K(0),k.H(H,z.G,u(){z.el.B(z.V);if(z.1u==\'4l\'){z.el.B(\'19\',\'1o\')}P z.el.B(\'19\',z.el.K(0).4s==\'1o\'?\'2B\':z.el.K(0).4s);k.2H(z.el.K(0),\'1n\')}),\'1G\');if(1u==\'in\'){z.e.1L(z.62+2a*8H,z.62);z.e2.1L(0,1)}P{z.e.1L(z.62,z.62+2a*8H);z.e2.1L(1,0)}};k.fn.23({j0:u(H,W,J,G){E q.1w(\'1n\',u(){12 k.fx.9L(q,H,W,J,\'fp\',G)})},iW:u(H,W,J,G){E q.1w(\'1n\',u(){12 k.fx.9L(q,H,W,J,\'9M\',G)})},iV:u(H,W,J,G){E q.1w(\'1n\',u(){12 k.fx.9L(q,H,W,J,\'3R\',G)})}});k.fx.9L=u(e,H,W,J,1u,G){if(!k.4K(e)){k.2H(e,\'1n\');E I}D z=q;z.el=k(e);z.G=2g J==\'4V\'?J:G||S;z.J=2g J==\'u\'?J:S;if(1u==\'3R\'){1u=z.el.B(\'19\')==\'1o\'?\'9M\':\'fp\'}z.H=H;z.W=W&&W.1K==bn?W:20;z.fx=k.fx.9P(e);z.1u=1u;z.21=u(){if(z.J&&z.J.1K==2A){z.J.1D(z.el.K(0))}if(z.1u==\'9M\'){z.el.1Y()}P{z.el.2G()}k.fx.a0(z.fx.3p.K(0),z.fx.V);k.2H(z.el.K(0),\'1n\')};if(z.1u==\'9M\'){z.el.1Y();z.fx.3p.B(\'W\',z.W+\'U\').B(\'Z\',\'9R\');z.ef=12 k.fx(z.fx.3p.K(0),k.H(z.H,z.G,u(){z.ef=12 k.fx(z.fx.3p.K(0),k.H(z.H,z.G,z.21),\'W\');z.ef.1L(z.W,z.fx.V.1q.hb)}),\'Z\');z.ef.1L(0,z.fx.V.1q.1C)}P{z.ef=12 k.fx(z.fx.3p.K(0),k.H(z.H,z.G,u(){z.ef=12 k.fx(z.fx.3p.K(0),k.H(z.H,z.G,z.21),\'Z\');z.ef.1L(z.fx.V.1q.1C,0)}),\'W\');z.ef.1L(z.fx.V.1q.hb,z.W)}};k.fn.iR=u(H,4x,J,G){E q.1w(\'fv\',u(){q.6W=k(q).1p("14")||\'\';G=2g J==\'4V\'?J:G||S;J=2g J==\'u\'?J:S;D 9S=k(q).B(\'7i\');D 8I=q.31;7d(9S==\'cu\'&&8I){9S=k(8I).B(\'7i\');8I=8I.31}k(q).B(\'7i\',4x);if(2g q.6W==\'8T\')q.6W=q.6W["9X"];k(q).5w({\'7i\':9S},H,G,u(){k.2H(q,\'fv\');if(2g k(q).1p("14")==\'8T\'){k(q).1p("14")["9X"]="";k(q).1p("14")["9X"]=q.6W}P{k(q).1p("14",q.6W)}if(J)J.1D(q)})})};k.fn.23({iT:u(H,J,G){E q.1w(\'1n\',u(){12 k.fx.5m(q,H,J,\'49\',\'6g\',G)})},iU:u(H,J,G){E q.1w(\'1n\',u(){12 k.fx.5m(q,H,J,\'4j\',\'6g\',G)})},j1:u(H,J,G){E q.1w(\'1n\',u(){if(k.B(q,\'19\')==\'1o\'){12 k.fx.5m(q,H,J,\'4j\',\'6Z\',G)}P{12 k.fx.5m(q,H,J,\'4j\',\'6g\',G)}})},j2:u(H,J,G){E q.1w(\'1n\',u(){if(k.B(q,\'19\')==\'1o\'){12 k.fx.5m(q,H,J,\'49\',\'6Z\',G)}P{12 k.fx.5m(q,H,J,\'49\',\'6g\',G)}})},j9:u(H,J,G){E q.1w(\'1n\',u(){12 k.fx.5m(q,H,J,\'49\',\'6Z\',G)})},ja:u(H,J,G){E q.1w(\'1n\',u(){12 k.fx.5m(q,H,J,\'4j\',\'6Z\',G)})}});k.fx.5m=u(e,H,J,2S,1u,G){if(!k.4K(e)){k.2H(e,\'1n\');E I}D z=q;D 73=I;z.el=k(e);z.G=2g J==\'4V\'?J:G||S;z.J=2g J==\'u\'?J:S;z.1u=1u;z.H=H;z.2i=k.1a.2o(e);z.V={};z.V.Y=z.el.B(\'Y\');z.V.19=z.el.B(\'19\');if(z.V.19==\'1o\'){5Y=z.el.B(\'3n\');z.el.1Y();73=1b}z.V.Q=z.el.B(\'Q\');z.V.O=z.el.B(\'O\');if(73){z.el.2G();z.el.B(\'3n\',5Y)}z.V.Z=z.2i.w+\'U\';z.V.W=z.2i.h+\'U\';z.V.2U=z.el.B(\'2U\');z.2i.Q=T(z.V.Q)||0;z.2i.O=T(z.V.O)||0;if(z.V.Y!=\'2s\'&&z.V.Y!=\'1P\'){z.el.B(\'Y\',\'2s\')}z.el.B(\'2U\',\'2K\').B(\'W\',1u==\'6Z\'&&2S==\'49\'?1:z.2i.h+\'U\').B(\'Z\',1u==\'6Z\'&&2S==\'4j\'?1:z.2i.w+\'U\');z.21=u(){z.el.B(z.V);if(z.1u==\'6g\')z.el.2G();P z.el.1Y();k.2H(z.el.K(0),\'1n\')};3m(2S){1e\'49\':z.eh=12 k.fx(z.el.K(0),k.H(H-15,z.G,J),\'W\');z.et=12 k.fx(z.el.K(0),k.H(z.H,z.G,z.21),\'Q\');if(z.1u==\'6g\'){z.eh.1L(z.2i.h,0);z.et.1L(z.2i.Q,z.2i.Q+z.2i.h/2)}P{z.eh.1L(0,z.2i.h);z.et.1L(z.2i.Q+z.2i.h/2,z.2i.Q)}1r;1e\'4j\':z.eh=12 k.fx(z.el.K(0),k.H(H-15,z.G,J),\'Z\');z.et=12 k.fx(z.el.K(0),k.H(z.H,z.G,z.21),\'O\');if(z.1u==\'6g\'){z.eh.1L(z.2i.w,0);z.et.1L(z.2i.O,z.2i.O+z.2i.w/2)}P{z.eh.1L(0,z.2i.w);z.et.1L(z.2i.O+z.2i.w/2,z.2i.O)}1r}};k.fn.bg=u(H,3V,J){E q.1w(\'1n\',u(){if(!k.4K(q)){k.2H(q,\'1n\');E I}D fx=12 k.fx.bg(q,H,3V,J);fx.bf()})};k.fx.bg=u(el,H,3V,J){D z=q;z.3V=3V;z.5y=1;z.el=el;z.H=H;z.J=J;k(z.el).1Y();z.bf=u(){z.5y++;z.e=12 k.fx(z.el,k.H(z.H,u(){z.ef=12 k.fx(z.el,k.H(z.H,u(){if(z.5y<=z.3V)z.bf();P{k.2H(z.el,\'1n\');if(z.J&&z.J.1K==2A){z.J.1D(z.el)}}}),\'1G\');z.ef.1L(0,1)}),\'1G\');z.e.1L(1,0)}};k.fn.23({jb:u(H,J,G){E q.1w(\'1n\',u(){12 k.fx.6G(q,H,1,2a,1b,J,\'fa\',G)})},jc:u(H,J,G){E q.1w(\'1n\',u(){12 k.fx.6G(q,H,2a,1,1b,J,\'b4\',G)})},j8:u(H,J,G){E q.1w(\'1n\',u(){D G=G||\'fl\';12 k.fx.6G(q,H,2a,f8,1b,J,\'6h\',G)})},6G:u(H,57,30,6H,J,G){E q.1w(\'1n\',u(){12 k.fx.6G(q,H,57,30,6H,J,\'6G\',G)})}});k.fx.6G=u(e,H,57,30,6H,J,1u,G){if(!k.4K(e)){k.2H(e,\'1n\');E I}D z=q;z.el=k(e);z.57=T(57)||2a;z.30=T(30)||2a;z.G=2g J==\'4V\'?J:G||S;z.J=2g J==\'u\'?J:S;z.1m=k.H(H).1m;z.6H=6H||S;z.2i=k.1a.2o(e);z.V={Z:z.el.B(\'Z\'),W:z.el.B(\'W\'),4A:z.el.B(\'4A\')||\'2a%\',Y:z.el.B(\'Y\'),19:z.el.B(\'19\'),Q:z.el.B(\'Q\'),O:z.el.B(\'O\'),2U:z.el.B(\'2U\'),4S:z.el.B(\'4S\'),5O:z.el.B(\'5O\'),5Q:z.el.B(\'5Q\'),5b:z.el.B(\'5b\'),5M:z.el.B(\'5M\'),5U:z.el.B(\'5U\'),5n:z.el.B(\'5n\'),4X:z.el.B(\'4X\')};z.Z=T(z.V.Z)||e.4c||0;z.W=T(z.V.W)||e.5W||0;z.Q=T(z.V.Q)||0;z.O=T(z.V.O)||0;1q=[\'em\',\'U\',\'j7\',\'%\'];24(i in 1q){if(z.V.4A.3J(1q[i])>0){z.fg=1q[i];z.4A=2m(z.V.4A)}if(z.V.4S.3J(1q[i])>0){z.fc=1q[i];z.bw=2m(z.V.4S)||0}if(z.V.5O.3J(1q[i])>0){z.fe=1q[i];z.bc=2m(z.V.5O)||0}if(z.V.5Q.3J(1q[i])>0){z.fL=1q[i];z.bA=2m(z.V.5Q)||0}if(z.V.5b.3J(1q[i])>0){z.g8=1q[i];z.bt=2m(z.V.5b)||0}if(z.V.5M.3J(1q[i])>0){z.g4=1q[i];z.bx=2m(z.V.5M)||0}if(z.V.5U.3J(1q[i])>0){z.g9=1q[i];z.bv=2m(z.V.5U)||0}if(z.V.5n.3J(1q[i])>0){z.gc=1q[i];z.bj=2m(z.V.5n)||0}if(z.V.4X.3J(1q[i])>0){z.fK=1q[i];z.b7=2m(z.V.4X)||0}}if(z.V.Y!=\'2s\'&&z.V.Y!=\'1P\'){z.el.B(\'Y\',\'2s\')}z.el.B(\'2U\',\'2K\');z.1u=1u;3m(z.1u){1e\'fa\':z.4b=z.Q+z.2i.h/2;z.5a=z.Q;z.4k=z.O+z.2i.w/2;z.59=z.O;1r;1e\'b4\':z.5a=z.Q+z.2i.h/2;z.4b=z.Q;z.59=z.O+z.2i.w/2;z.4k=z.O;1r;1e\'6h\':z.5a=z.Q-z.2i.h/4;z.4b=z.Q;z.59=z.O-z.2i.w/4;z.4k=z.O;1r}z.be=I;z.t=(12 7g).7z();z.4w=u(){5T(z.2I);z.2I=S};z.2D=u(){if(z.be==I){z.el.1Y();z.be=1b}D t=(12 7g).7z();D n=t-z.t;D p=n/z.1m;if(t>=z.1m+z.t){9T(u(){o=1;if(z.1u){t=z.5a;l=z.59;if(z.1u==\'6h\')o=0}z.bs(z.30,l,t,1b,o)},13);z.4w()}P{o=1;if(!k.G||!k.G[z.G]){s=((-18.5H(p*18.2Q)/2)+0.5)*(z.30-z.57)+z.57}P{s=k.G[z.G](p,n,z.57,(z.30-z.57),z.1m)}if(z.1u){if(!k.G||!k.G[z.G]){t=((-18.5H(p*18.2Q)/2)+0.5)*(z.5a-z.4b)+z.4b;l=((-18.5H(p*18.2Q)/2)+0.5)*(z.59-z.4k)+z.4k;if(z.1u==\'6h\')o=((-18.5H(p*18.2Q)/2)+0.5)*(-0.9Y)+0.9Y}P{t=k.G[z.G](p,n,z.4b,(z.5a-z.4b),z.1m);l=k.G[z.G](p,n,z.4k,(z.59-z.4k),z.1m);if(z.1u==\'6h\')o=k.G[z.G](p,n,0.9Y,-0.9Y,z.1m)}}z.bs(s,l,t,I,o)}};z.2I=6V(u(){z.2D()},13);z.bs=u(4q,O,Q,fM,1G){z.el.B(\'W\',z.W*4q/2a+\'U\').B(\'Z\',z.Z*4q/2a+\'U\').B(\'O\',O+\'U\').B(\'Q\',Q+\'U\').B(\'4A\',z.4A*4q/2a+z.fg);if(z.bw)z.el.B(\'4S\',z.bw*4q/2a+z.fc);if(z.bc)z.el.B(\'5O\',z.bc*4q/2a+z.fe);if(z.bA)z.el.B(\'5Q\',z.bA*4q/2a+z.fL);if(z.bt)z.el.B(\'5b\',z.bt*4q/2a+z.g8);if(z.bx)z.el.B(\'5M\',z.bx*4q/2a+z.g4);if(z.bv)z.el.B(\'5U\',z.bv*4q/2a+z.g9);if(z.bj)z.el.B(\'5n\',z.bj*4q/2a+z.gc);if(z.b7)z.el.B(\'4X\',z.b7*4q/2a+z.fK);if(z.1u==\'6h\'){if(1X.71)z.el.K(0).14.5E="8V(1G="+1G*2a+")";z.el.K(0).14.1G=1G}if(fM){if(z.6H){z.el.B(z.V)}if(z.1u==\'b4\'||z.1u==\'6h\'){z.el.B(\'19\',\'1o\');if(z.1u==\'6h\'){if(1X.71)z.el.K(0).14.5E="8V(1G="+2a+")";z.el.K(0).14.1G=1}}P z.el.B(\'19\',\'2B\');if(z.J)z.J.1D(z.el.K(0));k.2H(z.el.K(0),\'1n\')}}};k.fn.23({9U:u(H,1O,G){o=k.H(H);E q.1w(\'1n\',u(){12 k.fx.9U(q,o,1O,G)})},j6:u(H,1O,G){E q.1E(u(){k(\'a[@3h*="#"]\',q).5h(u(e){fW=q.3h.7C(\'#\');k(\'#\'+fW[1]).9U(H,1O,G);E I})})}});k.fx.9U=u(e,o,1O,G){D z=q;z.o=o;z.e=e;z.1O=/fT|gd/.48(1O)?1O:I;z.G=G;p=k.1a.3w(e);s=k.1a.6z();z.4w=u(){5T(z.2I);z.2I=S;k.2H(z.e,\'1n\')};z.t=(12 7g).7z();s.h=s.h>s.ih?(s.h-s.ih):s.h;s.w=s.w>s.iw?(s.w-s.iw):s.w;z.5a=p.y>s.h?s.h:p.y;z.59=p.x>s.w?s.w:p.x;z.4b=s.t;z.4k=s.l;z.2D=u(){D t=(12 7g).7z();D n=t-z.t;D p=n/z.o.1m;if(t>=z.o.1m+z.t){z.4w();9T(u(){z.d3(z.5a,z.59)},13)}P{if(!z.1O||z.1O==\'fT\'){if(!k.G||!k.G[z.G]){9V=((-18.5H(p*18.2Q)/2)+0.5)*(z.5a-z.4b)+z.4b}P{9V=k.G[z.G](p,n,z.4b,(z.5a-z.4b),z.o.1m)}}P{9V=z.4b}if(!z.1O||z.1O==\'gd\'){if(!k.G||!k.G[z.G]){9W=((-18.5H(p*18.2Q)/2)+0.5)*(z.59-z.4k)+z.4k}P{9W=k.G[z.G](p,n,z.4k,(z.59-z.4k),z.o.1m)}}P{9W=z.4k}z.d3(9V,9W)}};z.d3=u(t,l){1X.j4(l,t)};z.2I=6V(u(){z.2D()},13)};k.fn.cY=u(3V,J){E q.1w(\'1n\',u(){if(!k.4K(q)){k.2H(q,\'1n\');E I}D e=12 k.fx.cY(q,3V,J);e.cG()})};k.fx.cY=u(e,3V,J){D z=q;z.el=k(e);z.el.1Y();z.3V=T(3V)||3;z.J=J;z.5y=1;z.V={};z.V.Y=z.el.B(\'Y\');z.V.Q=T(z.el.B(\'Q\'))||0;z.V.O=T(z.el.B(\'O\'))||0;if(z.V.Y!=\'2s\'&&z.V.Y!=\'1P\'){z.el.B(\'Y\',\'2s\')}z.cG=u(){z.5y++;z.e=12 k.fx(z.el.K(0),{1m:60,21:u(){z.e=12 k.fx(z.el.K(0),{1m:60,21:u(){z.e=12 k.fx(e,{1m:60,21:u(){if(z.5y<=z.3V)z.cG();P{z.el.B(\'Y\',z.V.Y).B(\'Q\',z.V.Q+\'U\').B(\'O\',z.V.O+\'U\');k.2H(z.el.K(0),\'1n\');if(z.J&&z.J.1K==2A){z.J.1D(z.el.K(0))}}}},\'O\');z.e.1L(z.V.O-20,z.V.O)}},\'O\');z.e.1L(z.V.O+20,z.V.O-20)}},\'O\');z.e.1L(z.V.O,z.V.O+20)}};k.fn.23({fo:u(H,J,G){E q.1w(\'1n\',u(){12 k.fx.1z(q,H,J,\'4F\',\'in\',G)})},fq:u(H,J,G){E q.1w(\'1n\',u(){12 k.fx.1z(q,H,J,\'4F\',\'4l\',G)})},iY:u(H,J,G){E q.1w(\'1n\',u(){12 k.fx.1z(q,H,J,\'4F\',\'3R\',G)})},iX:u(H,J,G){E q.1w(\'1n\',u(){12 k.fx.1z(q,H,J,\'4r\',\'in\',G)})},jr:u(H,J,G){E q.1w(\'1n\',u(){12 k.fx.1z(q,H,J,\'4r\',\'4l\',G)})},jq:u(H,J,G){E q.1w(\'1n\',u(){12 k.fx.1z(q,H,J,\'4r\',\'3R\',G)})},jp:u(H,J,G){E q.1w(\'1n\',u(){12 k.fx.1z(q,H,J,\'O\',\'in\',G)})},jn:u(H,J,G){E q.1w(\'1n\',u(){12 k.fx.1z(q,H,J,\'O\',\'4l\',G)})},jm:u(H,J,G){E q.1w(\'1n\',u(){12 k.fx.1z(q,H,J,\'O\',\'3R\',G)})},iP:u(H,J,G){E q.1w(\'1n\',u(){12 k.fx.1z(q,H,J,\'2L\',\'in\',G)})},ic:u(H,J,G){E q.1w(\'1n\',u(){12 k.fx.1z(q,H,J,\'2L\',\'4l\',G)})},ib:u(H,J,G){E q.1w(\'1n\',u(){12 k.fx.1z(q,H,J,\'2L\',\'3R\',G)})}});k.fx.1z=u(e,H,J,2S,1u,G){if(!k.4K(e)){k.2H(e,\'1n\');E I}D z=q;z.el=k(e);z.G=2g J==\'4V\'?J:G||S;z.J=2g J==\'u\'?J:S;if(1u==\'3R\'){1u=z.el.B(\'19\')==\'1o\'?\'in\':\'4l\'}if(!e.4s)e.4s=z.el.B(\'19\');z.el.1Y();z.H=H;z.fx=k.fx.9P(e);z.1u=1u;z.2S=2S;z.21=u(){if(z.1u==\'4l\')z.el.B(\'3n\',\'2K\');k.fx.a0(z.fx.3p.K(0),z.fx.V);if(z.1u==\'in\'){z.el.B(\'19\',z.el.K(0).4s==\'1o\'?\'2B\':z.el.K(0).4s)}P{z.el.B(\'19\',\'1o\');z.el.B(\'3n\',\'dd\')}if(z.J&&z.J.1K==2A){z.J.1D(z.el.K(0))}k.2H(z.el.K(0),\'1n\')};3m(z.2S){1e\'4F\':z.ef=12 k.fx(z.el.K(0),k.H(z.H,z.G,z.21),\'Q\');z.7v=12 k.fx(z.fx.3p.K(0),k.H(z.H,z.G),\'W\');if(z.1u==\'in\'){z.ef.1L(-z.fx.V.1q.hb,0);z.7v.1L(0,z.fx.V.1q.hb)}P{z.ef.1L(0,-z.fx.V.1q.hb);z.7v.1L(z.fx.V.1q.hb,0)}1r;1e\'4r\':z.ef=12 k.fx(z.el.K(0),k.H(z.H,z.G,z.21),\'Q\');if(z.1u==\'in\'){z.ef.1L(z.fx.V.1q.hb,0)}P{z.ef.1L(0,z.fx.V.1q.hb)}1r;1e\'O\':z.ef=12 k.fx(z.el.K(0),k.H(z.H,z.G,z.21),\'O\');z.7v=12 k.fx(z.fx.3p.K(0),k.H(z.H,z.G),\'Z\');if(z.1u==\'in\'){z.ef.1L(-z.fx.V.1q.1C,0);z.7v.1L(0,z.fx.V.1q.1C)}P{z.ef.1L(0,-z.fx.V.1q.1C);z.7v.1L(z.fx.V.1q.1C,0)}1r;1e\'2L\':z.ef=12 k.fx(z.el.K(0),k.H(z.H,z.G,z.21),\'O\');if(z.1u==\'in\'){z.ef.1L(z.fx.V.1q.1C,0)}P{z.ef.1L(0,z.fx.V.1q.1C)}1r}};k.3f=S;k.fn.ig=u(o){E q.1w(\'1n\',u(){12 k.fx.dG(q,o)})};k.fx.dG=u(e,o){if(k.3f==S){k(\'2e\',1h).1S(\'<22 id="3f"></22>\');k.3f=k(\'#3f\')}k.3f.B(\'19\',\'2B\').B(\'Y\',\'1P\');D z=q;z.el=k(e);if(!o||!o.30){E}if(o.30.1K==b0&&1h.9e(o.30)){o.30=1h.9e(o.30)}P if(!o.30.dq){E}if(!o.1m){o.1m=g5}z.1m=o.1m;z.30=o.30;z.8r=o.3l;z.21=o.21;if(z.8r){k.3f.2R(z.8r)}z.a3=0;z.a2=0;if(k.dF){z.a3=(T(k.3f.B(\'5b\'))||0)+(T(k.3f.B(\'5O\'))||0)+(T(k.3f.B(\'4X\'))||0)+(T(k.3f.B(\'5U\'))||0);z.a2=(T(k.3f.B(\'4S\'))||0)+(T(k.3f.B(\'5Q\'))||0)+(T(k.3f.B(\'5M\'))||0)+(T(k.3f.B(\'5n\'))||0)}z.26=k.23(k.1a.3w(z.el.K(0)),k.1a.2o(z.el.K(0)));z.2T=k.23(k.1a.3w(z.30),k.1a.2o(z.30));z.26.1C-=z.a3;z.26.hb-=z.a2;z.2T.1C-=z.a3;z.2T.hb-=z.a2;z.J=o.21;k.3f.B(\'Z\',z.26.1C+\'U\').B(\'W\',z.26.hb+\'U\').B(\'Q\',z.26.y+\'U\').B(\'O\',z.26.x+\'U\').5w({Q:z.2T.y,O:z.2T.x,Z:z.2T.1C,W:z.2T.hb},z.1m,u(){if(z.8r)k.3f.4i(z.8r);k.3f.B(\'19\',\'1o\');if(z.21&&z.21.1K==2A){z.21.1D(z.el.K(0),[z.30])}k.2H(z.el.K(0),\'1n\')})};k.1v={M:{2E:10,ec:\'1Q/iJ.eZ\',e3:\'<1T 2J="1Q/6g.da" />\',eW:0.8,d8:\'iN a6\',dc:\'57\',3W:8J},jQ:I,jW:I,6j:S,8m:I,8k:I,d1:u(2k){if(!k.1v.8k||k.1v.8m)E;D 3K=2k.7L||2k.7K||-1;3m(3K){1e 35:if(k.1v.6j)k.1v.26(S,k(\'a[@4I=\'+k.1v.6j+\']:jJ\').K(0));1r;1e 36:if(k.1v.6j)k.1v.26(S,k(\'a[@4I=\'+k.1v.6j+\']:jL\').K(0));1r;1e 37:1e 8:1e 33:1e 80:1e kb:D 9p=k(\'#87\');if(9p.K(0).53!=S){9p.K(0).53.1D(9p.K(0))}1r;1e 38:1r;1e 39:1e 34:1e 32:1e gl:1e 78:D 9k=k(\'#88\');if(9k.K(0).53!=S){9k.K(0).53.1D(9k.K(0))}1r;1e 40:1r;1e 27:k.1v.au();1r}},7q:u(M){if(M)k.23(k.1v.M,M);if(1X.2k){k(\'2e\',1h).1J(\'6y\',k.1v.d1)}P{k(1h).1J(\'6y\',k.1v.d1)}k(\'a\').1E(u(){el=k(q);en=el.1p(\'4I\')||\'\';e9=el.1p(\'3h\')||\'\';ev=/\\.da|\\.gw|\\.8X|\\.eZ|\\.gn/g;if(e9.6c().d5(ev)!=S&&en.6c().3J(\'eU\')==0){el.1J(\'5h\',k.1v.26)}});if(k.3a.4t){3A=1h.3F(\'3A\');k(3A).1p({id:\'cN\',2J:\'ek:I;\',ej:\'cD\',ep:\'cD\'}).B({19:\'1o\',Y:\'1P\',Q:\'0\',O:\'0\',5E:\'9n:9w.9y.cC(1G=0)\'});k(\'2e\').1S(3A)}8n=1h.3F(\'22\');k(8n).1p(\'id\',\'cP\').B({Y:\'1P\',19:\'1o\',Q:\'0\',O:\'0\',1G:0}).1S(1h.8M(\' \')).1J(\'5h\',k.1v.au);6A=1h.3F(\'22\');k(6A).1p(\'id\',\'eK\').B({4X:k.1v.M.2E+\'U\'}).1S(1h.8M(\' \'));cE=1h.3F(\'22\');k(cE).1p(\'id\',\'dg\').B({4X:k.1v.M.2E+\'U\',5n:k.1v.M.2E+\'U\'}).1S(1h.8M(\' \'));cF=1h.3F(\'a\');k(cF).1p({id:\'gg\',3h:\'#\'}).B({Y:\'1P\',2L:k.1v.M.2E+\'U\',Q:\'0\'}).1S(k.1v.M.e3).1J(\'5h\',k.1v.au);7m=1h.3F(\'22\');k(7m).1p(\'id\',\'cM\').B({Y:\'2s\',cA:\'O\',6w:\'0 9F\',3I:1}).1S(6A).1S(cE).1S(cF);2b=1h.3F(\'1T\');2b.2J=k.1v.M.ec;k(2b).1p(\'id\',\'eM\').B({Y:\'1P\'});4G=1h.3F(\'a\');k(4G).1p({id:\'87\',3h:\'#\'}).B({Y:\'1P\',19:\'1o\',2U:\'2K\',ey:\'1o\'}).1S(1h.8M(\' \'));4M=1h.3F(\'a\');k(4M).1p({id:\'88\',3h:\'#\'}).B({Y:\'1P\',2U:\'2K\',ey:\'1o\'}).1S(1h.8M(\' \'));1Z=1h.3F(\'22\');k(1Z).1p(\'id\',\'eE\').B({19:\'1o\',Y:\'2s\',2U:\'2K\',cA:\'O\',6w:\'0 9F\',Q:\'0\',O:\'0\',3I:2}).1S([2b,4G,4M]);6F=1h.3F(\'22\');k(6F).1p(\'id\',\'ao\').B({19:\'1o\',Y:\'1P\',2U:\'2K\',Q:\'0\',O:\'0\',cA:\'cv\',7i:\'cu\',hC:\'0\'}).1S([1Z,7m]);k(\'2e\').1S(8n).1S(6F)},26:u(e,C){el=C?k(C):k(q);9t=el.1p(\'4I\');D 6B,4u,4G,4M;if(9t!=\'eU\'){k.1v.6j=9t;8Y=k(\'a[@4I=\'+9t+\']\');6B=8Y.1N();4u=8Y.cZ(C?C:q);4G=8Y.K(4u-1);4M=8Y.K(4u+1)}89=el.1p(\'3h\');6A=el.1p(\'4g\');3O=k.1a.6z();8n=k(\'#cP\');if(!k.1v.8k){k.1v.8k=1b;if(k.3a.4t){k(\'#cN\').B(\'W\',18.3r(3O.ih,3O.h)+\'U\').B(\'Z\',18.3r(3O.iw,3O.w)+\'U\').1Y()}8n.B(\'W\',18.3r(3O.ih,3O.h)+\'U\').B(\'Z\',18.3r(3O.iw,3O.w)+\'U\').1Y().fX(cO,k.1v.M.eW,u(){k.1v.cw(89,6A,3O,6B,4u,4G,4M)});k(\'#ao\').B(\'Z\',18.3r(3O.iw,3O.w)+\'U\')}P{k(\'#87\').K(0).53=S;k(\'#88\').K(0).53=S;k.1v.cw(89,6A,3O,6B,4u,4G,4M)}E I},cw:u(89,gP,3O,6B,4u,4G,4M){k(\'#cW\').bk();aX=k(\'#87\');aX.2G();aO=k(\'#88\');aO.2G();2b=k(\'#eM\');1Z=k(\'#eE\');6F=k(\'#ao\');7m=k(\'#cM\').B(\'3n\',\'2K\');k(\'#eK\').3x(6A);k.1v.8m=1b;if(6B)k(\'#dg\').3x(k.1v.M.d8+\' \'+(4u+1)+\' \'+k.1v.M.dc+\' \'+6B);if(4G){aX.K(0).53=u(){q.5B();k.1v.26(S,4G);E I}}if(4M){aO.K(0).53=u(){q.5B();k.1v.26(S,4M);E I}}2b.1Y();82=k.1a.2o(1Z.K(0));56=18.3r(82.1C,2b.K(0).Z+k.1v.M.2E*2);6f=18.3r(82.hb,2b.K(0).W+k.1v.M.2E*2);2b.B({O:(56-2b.K(0).Z)/2+\'U\',Q:(6f-2b.K(0).W)/2+\'U\'});1Z.B({Z:56+\'U\',W:6f+\'U\'}).1Y();dw=k.1a.bm();6F.B(\'Q\',3O.t+(dw.h/15)+\'U\');if(6F.B(\'19\')==\'1o\'){6F.1Y().7f(k.1v.M.3W)}6k=12 9s;k(6k).1p(\'id\',\'cW\').1J(\'hJ\',u(){56=6k.Z+k.1v.M.2E*2;6f=6k.W+k.1v.M.2E*2;2b.2G();1Z.5w({W:6f},82.hb!=6f?k.1v.M.3W:1,u(){1Z.5w({Z:56},82.1C!=56?k.1v.M.3W:1,u(){1Z.bG(6k);k(6k).B({Y:\'1P\',O:k.1v.M.2E+\'U\',Q:k.1v.M.2E+\'U\'}).7f(k.1v.M.3W,u(){db=k.1a.2o(7m.K(0));if(4G){aX.B({O:k.1v.M.2E+\'U\',Q:k.1v.M.2E+\'U\',Z:56/2-k.1v.M.2E*3+\'U\',W:6f-k.1v.M.2E*2+\'U\'}).1Y()}if(4M){aO.B({O:56/2+k.1v.M.2E*2+\'U\',Q:k.1v.M.2E+\'U\',Z:56/2-k.1v.M.2E*3+\'U\',W:6f-k.1v.M.2E*2+\'U\'}).1Y()}7m.B({Z:56+\'U\',Q:-db.hb+\'U\',3n:\'dd\'}).5w({Q:-1},k.1v.M.3W,u(){k.1v.8m=I})})})})});6k.2J=89},au:u(){k(\'#cW\').bk();k(\'#ao\').2G();k(\'#cM\').B(\'3n\',\'2K\');k(\'#cP\').fX(cO,0,u(){k(q).2G();if(k.3a.4t){k(\'#cN\').2G()}});k(\'#87\').K(0).53=S;k(\'#88\').K(0).53=S;k.1v.6j=S;k.1v.8k=I;k.1v.8m=I;E I}};k.R={1A:S,41:S,F:S,1s:S,1q:S,Y:S,9a:u(e){k.R.F=(q.d0)?q.d0:q;k.R.1s=k.1a.4a(e);k.R.1q={Z:T(k(k.R.F).B(\'Z\'))||0,W:T(k(k.R.F).B(\'W\'))||0};k.R.Y={Q:T(k(k.R.F).B(\'Q\'))||0,O:T(k(k.R.F).B(\'O\'))||0};k(1h).1J(\'3D\',k.R.cR).1J(\'5P\',k.R.cK);if(2g k.R.F.1k.g2===\'u\'){k.R.F.1k.g2.1D(k.R.F)}E I},cK:u(e){k(1h).3q(\'3D\',k.R.cR).3q(\'5P\',k.R.cK);if(2g k.R.F.1k.fN===\'u\'){k.R.F.1k.fN.1D(k.R.F)}k.R.F=S},cR:u(e){if(!k.R.F){E}1s=k.1a.4a(e);7p=k.R.Y.Q-k.R.1s.y+1s.y;7r=k.R.Y.O-k.R.1s.x+1s.x;7p=18.3r(18.3L(7p,k.R.F.1k.8g-k.R.1q.W),k.R.F.1k.7h);7r=18.3r(18.3L(7r,k.R.F.1k.8h-k.R.1q.Z),k.R.F.1k.70);if(2g k.R.F.1k.4m===\'u\'){D 8a=k.R.F.1k.4m.1D(k.R.F,[7r,7p]);if(2g 8a==\'hh\'&&8a.1g==2){7r=8a[0];7p=8a[1]}}k.R.F.14.Q=7p+\'U\';k.R.F.14.O=7r+\'U\';E I},26:u(e){k(1h).1J(\'3D\',k.R.8j).1J(\'5P\',k.R.8o);k.R.1A=q.1A;k.R.41=q.41;k.R.1s=k.1a.4a(e);k.R.1q={Z:T(k(q.1A).B(\'Z\'))||0,W:T(k(q.1A).B(\'W\'))||0};k.R.Y={Q:T(k(q.1A).B(\'Q\'))||0,O:T(k(q.1A).B(\'O\'))||0};if(k.R.1A.1k.4o){k.R.1A.1k.4o.1D(k.R.1A,[q])}E I},8o:u(){k(1h).3q(\'3D\',k.R.8j).3q(\'5P\',k.R.8o);if(k.R.1A.1k.3T){k.R.1A.1k.3T.1D(k.R.1A,[k.R.41])}k.R.1A=S;k.R.41=S},6i:u(dx,az){E 18.3L(18.3r(k.R.1q.Z+dx*az,k.R.1A.1k.av),k.R.1A.1k.6x)},6m:u(dy,az){E 18.3L(18.3r(k.R.1q.W+dy*az,k.R.1A.1k.8c),k.R.1A.1k.8b)},fb:u(W){E 18.3L(18.3r(W,k.R.1A.1k.8c),k.R.1A.1k.8b)},8j:u(e){if(k.R.1A==S){E}1s=k.1a.4a(e);dx=1s.x-k.R.1s.x;dy=1s.y-k.R.1s.y;1I={Z:k.R.1q.Z,W:k.R.1q.W};2z={Q:k.R.Y.Q,O:k.R.Y.O};3m(k.R.41){1e\'e\':1I.Z=k.R.6i(dx,1);1r;1e\'fj\':1I.Z=k.R.6i(dx,1);1I.W=k.R.6m(dy,1);1r;1e\'w\':1I.Z=k.R.6i(dx,-1);2z.O=k.R.Y.O-1I.Z+k.R.1q.Z;1r;1e\'5F\':1I.Z=k.R.6i(dx,-1);2z.O=k.R.Y.O-1I.Z+k.R.1q.Z;1I.W=k.R.6m(dy,1);1r;1e\'76\':1I.W=k.R.6m(dy,-1);2z.Q=k.R.Y.Q-1I.W+k.R.1q.W;1I.Z=k.R.6i(dx,-1);2z.O=k.R.Y.O-1I.Z+k.R.1q.Z;1r;1e\'n\':1I.W=k.R.6m(dy,-1);2z.Q=k.R.Y.Q-1I.W+k.R.1q.W;1r;1e\'at\':1I.W=k.R.6m(dy,-1);2z.Q=k.R.Y.Q-1I.W+k.R.1q.W;1I.Z=k.R.6i(dx,1);1r;1e\'s\':1I.W=k.R.6m(dy,1);1r}if(k.R.1A.1k.4v){if(k.R.41==\'n\'||k.R.41==\'s\')4p=1I.W*k.R.1A.1k.4v;P 4p=1I.Z;4W=k.R.fb(4p*k.R.1A.1k.4v);4p=4W/k.R.1A.1k.4v;3m(k.R.41){1e\'n\':1e\'76\':1e\'at\':2z.Q+=1I.W-4W;1r}3m(k.R.41){1e\'76\':1e\'w\':1e\'5F\':2z.O+=1I.Z-4p;1r}1I.W=4W;1I.Z=4p}if(2z.Q<k.R.1A.1k.7h){4W=1I.W+2z.Q-k.R.1A.1k.7h;2z.Q=k.R.1A.1k.7h;if(k.R.1A.1k.4v){4p=4W/k.R.1A.1k.4v;3m(k.R.41){1e\'76\':1e\'w\':1e\'5F\':2z.O+=1I.Z-4p;1r}1I.Z=4p}1I.W=4W}if(2z.O<k.R.1A.1k.70){4p=1I.Z+2z.O-k.R.1A.1k.70;2z.O=k.R.1A.1k.70;if(k.R.1A.1k.4v){4W=4p*k.R.1A.1k.4v;3m(k.R.41){1e\'n\':1e\'76\':1e\'at\':2z.Q+=1I.W-4W;1r}1I.W=4W}1I.Z=4p}if(2z.Q+1I.W>k.R.1A.1k.8g){1I.W=k.R.1A.1k.8g-2z.Q;if(k.R.1A.1k.4v){1I.Z=1I.W/k.R.1A.1k.4v}}if(2z.O+1I.Z>k.R.1A.1k.8h){1I.Z=k.R.1A.1k.8h-2z.O;if(k.R.1A.1k.4v){1I.W=1I.Z*k.R.1A.1k.4v}}D 6p=I;if(k.R.1A.1k.f7){6p=k.R.1A.1k.f7.1D(k.R.1A,[1I,2z]);if(6p){if(6p.1q){k.23(1I,6p.1q)}if(6p.Y){k.23(2z,6p.Y)}}}8d=k.R.1A.14;8d.O=2z.O+\'U\';8d.Q=2z.Q+\'U\';8d.Z=1I.Z+\'U\';8d.W=1I.W+\'U\';E I},2r:u(M){if(!M||!M.3Z||M.3Z.1K!=7M){E}E q.1E(u(){D el=q;el.1k=M;el.1k.av=M.av||10;el.1k.8c=M.8c||10;el.1k.6x=M.6x||6P;el.1k.8b=M.8b||6P;el.1k.7h=M.7h||-aC;el.1k.70=M.70||-aC;el.1k.8h=M.8h||6P;el.1k.8g=M.8g||6P;d6=k(el).B(\'Y\');if(!(d6==\'2s\'||d6==\'1P\')){el.14.Y=\'2s\'}fS=/n|at|e|fj|s|5F|w|76/g;24(i in el.1k.3Z){if(i.6c().d5(fS)!=S){if(el.1k.3Z[i].1K==b0){3v=k(el.1k.3Z[i]);if(3v.1N()>0){el.1k.3Z[i]=3v.K(0)}}if(el.1k.3Z[i].4Y){el.1k.3Z[i].1A=el;el.1k.3Z[i].41=i;k(el.1k.3Z[i]).1J(\'5v\',k.R.26)}}}if(el.1k.5S){if(2g el.1k.5S===\'4V\'){aV=k(el.1k.5S);if(aV.1N()>0){aV.1E(u(){q.d0=el});aV.1J(\'5v\',k.R.9a)}}P if(el.1k.5S==1b){k(q).1J(\'5v\',k.R.9a)}}})},4U:u(){E q.1E(u(){D el=q;24(i in el.1k.3Z){el.1k.3Z[i].1A=S;el.1k.3Z[i].41=S;k(el.1k.3Z[i]).3q(\'5v\',k.R.26)}if(el.1k.5S){if(2g el.1k.5S===\'4V\'){3v=k(el.1k.5S);if(3v.1N()>0){3v.3q(\'5v\',k.R.9a)}}P if(el.1k.5S==1b){k(q).3q(\'5v\',k.R.9a)}}el.1k=S})}};k.fn.23({hz:k.R.2r,hs:k.R.4U});k.2C=S;k.7n=I;k.3k=S;k.7o=[];k.9v=u(e){D 3K=e.7L||e.7K||-1;if(3K==17||3K==16){k.7n=1b}};k.9u=u(e){k.7n=I};k.dL=u(e){q.f.1s=k.1a.4a(e);q.f.1M=k.23(k.1a.3w(q),k.1a.2o(q));q.f.3e=k.1a.6z(q);q.f.1s.x-=q.f.1M.x;q.f.1s.y-=q.f.1M.y;k(q).1S(k.2C.K(0));if(q.f.hc)k.2C.2R(q.f.hc).B(\'19\',\'2B\');k.2C.B({19:\'2B\',Z:\'2P\',W:\'2P\'});if(q.f.o){k.2C.B(\'1G\',q.f.o)}k.3k=q;k.96=I;k.7o=[];q.f.el.1E(u(){q.1M={x:q.8t+(q.4Z&&!k.3a.7I?T(q.4Z.5b)||0:0)+(k.3k.3c||0),y:q.8G+(q.4Z&&!k.3a.7I?T(q.4Z.4S)||0:0)+(k.3k.3d||0),1C:q.4c,hb:q.5W};if(q.s==1b){if(k.7n==I){q.s=I;k(q).4i(k.3k.f.7j)}P{k.96=1b;k.7o[k.7o.1g]=k.1p(q,\'id\')}}});k.am.1D(q,[e]);k(1h).1J(\'3D\',k.am).1J(\'5P\',k.cX);E I};k.am=u(e){if(!k.3k)E;k.fd.1D(k.3k,[e])};k.fd=u(e){if(!k.3k)E;D 1s=k.1a.4a(e);D 3e=k.1a.6z(k.3k);1s.x+=3e.l-q.f.3e.l-q.f.1M.x;1s.y+=3e.t-q.f.3e.t-q.f.1M.y;D 93=18.3L(1s.x,q.f.1s.x);D 5F=18.3L(18.3S(1s.x-q.f.1s.x),18.3S(q.f.3e.w-93));D 99=18.3L(1s.y,q.f.1s.y);D 9g=18.3L(18.3S(1s.y-q.f.1s.y),18.3S(q.f.3e.h-99));if(q.3d>0&&1s.y-20<q.3d){D 3X=18.3L(3e.t,10);99-=3X;9g+=3X;q.3d-=3X}P if(q.3d+q.f.1M.h<q.f.3e.h&&1s.y+20>q.3d+q.f.1M.h){D 3X=18.3L(q.f.3e.h-q.3d,10);q.3d+=3X;if(q.3d!=3e.t)9g+=3X}if(q.3c>0&&1s.x-20<q.3c){D 3X=18.3L(3e.l,10);93-=3X;5F+=3X;q.3c-=3X}P if(q.3c+q.f.1M.w<q.f.3e.w&&1s.x+20>q.3c+q.f.1M.w){D 3X=18.3L(q.f.3e.w-q.3c,10);q.3c+=3X;if(q.3c!=3e.l)5F+=3X}k.2C.B({O:93+\'U\',Q:99+\'U\',Z:5F+\'U\',W:9g+\'U\'});k.2C.l=93+q.f.3e.l;k.2C.t=99+q.f.3e.t;k.2C.r=k.2C.l+5F;k.2C.b=k.2C.t+9g;k.96=I;q.f.el.1E(u(){aw=k.7o.3J(k.1p(q,\'id\'));if(!(q.1M.x>k.2C.r||(q.1M.x+q.1M.1C)<k.2C.l||q.1M.y>k.2C.b||(q.1M.y+q.1M.hb)<k.2C.t)){k.96=1b;if(q.s!=1b){q.s=1b;k(q).2R(k.3k.f.7j)}if(aw!=-1){q.s=I;k(q).4i(k.3k.f.7j)}}P if((q.s==1b)&&(aw==-1)){q.s=I;k(q).4i(k.3k.f.7j)}P if((!q.s)&&(k.7n==1b)&&(aw!=-1)){q.s=1b;k(q).2R(k.3k.f.7j)}});E I};k.cX=u(e){if(!k.3k)E;k.g0.1D(k.3k,[e])};k.g0=u(e){k(1h).3q(\'3D\',k.am).3q(\'5P\',k.cX);if(!k.3k)E;k.2C.B(\'19\',\'1o\');if(q.f.hc)k.2C.4i(q.f.hc);k.3k=I;k(\'2e\').1S(k.2C.K(0));if(k.96==1b){if(q.f.98)q.f.98(k.cJ(k.1p(q,\'id\')))}P{if(q.f.9d)q.f.9d(k.cJ(k.1p(q,\'id\')))}k.7o=[]};k.cJ=u(s){D h=\'\';D o=[];if(a=k(\'#\'+s)){a.K(0).f.el.1E(u(){if(q.s==1b){if(h.1g>0){h+=\'&\'}h+=s+\'[]=\'+k.1p(q,\'id\');o[o.1g]=k.1p(q,\'id\')}})}E{7l:h,o:o}};k.fn.gZ=u(o){if(!k.2C){k(\'2e\',1h).1S(\'<22 id="2C"></22>\').1J(\'7B\',k.9v).1J(\'6y\',k.9u);k.2C=k(\'#2C\');k.2C.B({Y:\'1P\',19:\'1o\'});if(1X.2k){k(\'2e\',1h).1J(\'7B\',k.9v).1J(\'6y\',k.9u)}P{k(1h).1J(\'7B\',k.9v).1J(\'6y\',k.9u)}}if(!o){o={}}E q.1E(u(){if(q.eP)E;q.eP=1b;q.f={a:o.3C,o:o.1G?2m(o.1G):I,7j:o.eS?o.eS:I,hc:o.58?o.58:I,98:o.98?o.98:I,9d:o.9d?o.9d:I};q.f.el=k(\'.\'+o.3C);k(q).1J(\'5v\',k.dL).B(\'Y\',\'2s\')})};k.3b={bM:1,eH:u(3t){D 3t=3t;E q.1E(u(){q.4z.6s.1E(u(ab){k.3b.5c(q,3t[ab])})})},K:u(){D 3t=[];q.1E(u(cL){if(q.bI){3t[cL]=[];D C=q;D 1q=k.1a.2o(q);q.4z.6s.1E(u(ab){D x=q.8t;D y=q.8G;92=T(x*2a/(1q.w-q.4c));91=T(y*2a/(1q.h-q.5W));3t[cL][ab]=[92||0,91||0,x||0,y||0]})}});E 3t},ct:u(C){C.A.fu=C.A.28.w-C.A.1B.1C;C.A.fw=C.A.28.h-C.A.1B.hb;if(C.9r.4z.bC){9Z=C.9r.4z.6s.K(C.bF+1);if(9Z){C.A.28.w=(T(k(9Z).B(\'O\'))||0)+C.A.1B.1C;C.A.28.h=(T(k(9Z).B(\'Q\'))||0)+C.A.1B.hb}9Q=C.9r.4z.6s.K(C.bF-1);if(9Q){D cU=T(k(9Q).B(\'O\'))||0;D cH=T(k(9Q).B(\'O\'))||0;C.A.28.x+=cU;C.A.28.y+=cH;C.A.28.w-=cU;C.A.28.h-=cH}}C.A.g7=C.A.28.w-C.A.1B.1C;C.A.eC=C.A.28.h-C.A.1B.hb;if(C.A.2O){C.A.gx=((C.A.28.w-C.A.1B.1C)/C.A.2O)||1;C.A.gy=((C.A.28.h-C.A.1B.hb)/C.A.2O)||1;C.A.fU=C.A.g7/C.A.2O;C.A.fH=C.A.eC/C.A.2O}C.A.28.dx=C.A.28.x-C.A.2c.x;C.A.28.dy=C.A.28.y-C.A.2c.y;k.11.1c.B(\'9b\',\'ad\')},3H:u(C,x,y){if(C.A.2O){fE=T(x/C.A.fU);92=fE*2a/C.A.2O;ft=T(y/C.A.fH);91=ft*2a/C.A.2O}P{92=T(x*2a/C.A.fu);91=T(y*2a/C.A.fw)}C.A.b3=[92||0,91||0,x||0,y||0];if(C.A.3H)C.A.3H.1D(C,C.A.b3)},eI:u(2k){3K=2k.7L||2k.7K||-1;3m(3K){1e 35:k.3b.5c(q.3U,[ae,ae]);1r;1e 36:k.3b.5c(q.3U,[-ae,-ae]);1r;1e 37:k.3b.5c(q.3U,[-q.3U.A.gx||-1,0]);1r;1e 38:k.3b.5c(q.3U,[0,-q.3U.A.gy||-1]);1r;1e 39:k.3b.5c(q.3U,[q.3U.A.gx||1,0]);1r;1e 40:k.11.5c(q.3U,[0,q.3U.A.gy||1]);1r}},5c:u(C,Y){if(!C.A){E}C.A.1B=k.23(k.1a.3w(C),k.1a.2o(C));C.A.2c={x:T(k.B(C,\'O\'))||0,y:T(k.B(C,\'Q\'))||0};C.A.4n=k.B(C,\'Y\');if(C.A.4n!=\'2s\'&&C.A.4n!=\'1P\'){C.14.Y=\'2s\'}k.11.c5(C);k.3b.ct(C);dx=T(Y[0])||0;dy=T(Y[1])||0;2v=C.A.2c.x+dx;2q=C.A.2c.y+dy;if(C.A.2O){3y=k.11.c7.1D(C,[2v,2q,dx,dy]);if(3y.1K==7M){dx=3y.dx;dy=3y.dy}2v=C.A.2c.x+dx;2q=C.A.2c.y+dy}3y=k.11.ce.1D(C,[2v,2q,dx,dy]);if(3y&&3y.1K==7M){dx=3y.dx;dy=3y.dy}2v=C.A.2c.x+dx;2q=C.A.2c.y+dy;if(C.A.5i&&(C.A.3H||C.A.2Z)){k.3b.3H(C,2v,2q)}2v=!C.A.1O||C.A.1O==\'4j\'?2v:C.A.2c.x||0;2q=!C.A.1O||C.A.1O==\'49\'?2q:C.A.2c.y||0;C.14.O=2v+\'U\';C.14.Q=2q+\'U\'},2r:u(o){E q.1E(u(){if(q.bI==1b||!o.3C||!k.1a||!k.11||!k.1x){E}5x=k(o.3C,q);if(5x.1N()==0){E}D 4N={2p:\'94\',5i:1b,3H:o.3H&&o.3H.1K==2A?o.3H:S,2Z:o.2Z&&o.2Z.1K==2A?o.2Z:S,3v:q,1G:o.1G||I};if(o.2O&&T(o.2O)){4N.2O=T(o.2O)||1;4N.2O=4N.2O>0?4N.2O:1}if(5x.1N()==1)5x.7t(4N);P{k(5x.K(0)).7t(4N);4N.3v=S;5x.7t(4N)}5x.7B(k.3b.eI);5x.1p(\'bM\',k.3b.bM++);q.bI=1b;q.4z={};q.4z.er=4N.er;q.4z.2O=4N.2O;q.4z.6s=5x;q.4z.bC=o.bC?1b:I;bZ=q;bZ.4z.6s.1E(u(2N){q.bF=2N;q.9r=bZ});if(o.3t&&o.3t.1K==7F){24(i=o.3t.1g-1;i>=0;i--){if(o.3t[i].1K==7F&&o.3t[i].1g==2){el=q.4z.6s.K(i);if(el.4Y){k.3b.5c(el,o.3t[i])}}}}})}};k.fn.23({hN:k.3b.2r,hS:k.3b.eH,hG:k.3b.K});k.2u={5I:[],eg:u(){q.5B();X=q.31;id=k.1p(X,\'id\');if(k.2u.5I[id]!=S){1X.5T(k.2u.5I[id])}1z=X.L.3u+1;if(X.L.1Q.1g<1z){1z=1}1Q=k(\'1T\',X.L.5u);X.L.3u=1z;if(1Q.1N()>0){1Q.7a(X.L.3W,k.2u.95)}},dp:u(){q.5B();X=q.31;id=k.1p(X,\'id\');if(k.2u.5I[id]!=S){1X.5T(k.2u.5I[id])}1z=X.L.3u-1;1Q=k(\'1T\',X.L.5u);if(1z<1){1z=X.L.1Q.1g}X.L.3u=1z;if(1Q.1N()>0){1Q.7a(X.L.3W,k.2u.95)}},2I:u(c){X=1h.9e(c);if(X.L.6o){1z=X.L.3u;7d(1z==X.L.3u){1z=1+T(18.6o()*X.L.1Q.1g)}}P{1z=X.L.3u+1;if(X.L.1Q.1g<1z){1z=1}}1Q=k(\'1T\',X.L.5u);X.L.3u=1z;if(1Q.1N()>0){1Q.7a(X.L.3W,k.2u.95)}},go:u(o){D X;if(o&&o.1K==7M){if(o.2b){X=1h.9e(o.2b.X);5N=1X.hn.3h.7C("#");o.2b.6S=S;if(5N.1g==2){1z=T(5N[1]);1Y=5N[1].4E(1z,\'\');if(k.1p(X,\'id\')!=1Y){1z=1}}P{1z=1}}if(o.90){o.90.5B();X=o.90.31.31;id=k.1p(X,\'id\');if(k.2u.5I[id]!=S){1X.5T(k.2u.5I[id])}5N=o.90.3h.7C("#");1z=T(5N[1]);1Y=5N[1].4E(1z,\'\');if(k.1p(X,\'id\')!=1Y){1z=1}}if(X.L.1Q.1g<1z||1z<1){1z=1}X.L.3u=1z;52=k.1a.2o(X);dt=k.1a.aT(X);d9=k.1a.6U(X);if(X.L.3z){X.L.3z.o.B(\'19\',\'1o\')}if(X.L.3s){X.L.3s.o.B(\'19\',\'1o\')}if(X.L.2b){y=T(dt.t)+T(d9.t);if(X.L.1U){if(X.L.1U.5A==\'Q\'){y+=X.L.1U.4C.hb}P{52.h-=X.L.1U.4C.hb}}if(X.L.2x){if(X.L.2x&&X.L.2x.6Q==\'Q\'){y+=X.L.2x.4C.hb}P{52.h-=X.L.2x.4C.hb}}if(!X.L.c1){X.L.df=o.2b?o.2b.W:(T(X.L.2b.B(\'W\'))||0);X.L.c1=o.2b?o.2b.Z:(T(X.L.2b.B(\'Z\'))||0)}X.L.2b.B(\'Q\',y+(52.h-X.L.df)/2+\'U\');X.L.2b.B(\'O\',(52.1C-X.L.c1)/2+\'U\');X.L.2b.B(\'19\',\'2B\')}1Q=k(\'1T\',X.L.5u);if(1Q.1N()>0){1Q.7a(X.L.3W,k.2u.95)}P{aj=k(\'a\',X.L.1U.o).K(1z-1);k(aj).2R(X.L.1U.5R);D 1T=12 9s();1T.X=k.1p(X,\'id\');1T.1z=1z-1;1T.2J=X.L.1Q[X.L.3u-1].2J;if(1T.21){1T.6S=S;k.2u.19.1D(1T)}P{1T.6S=k.2u.19}if(X.L.2x){X.L.2x.o.3x(X.L.1Q[1z-1].6L)}}}},95:u(){X=q.31.31;X.L.5u.B(\'19\',\'1o\');if(X.L.1U.5R){aj=k(\'a\',X.L.1U.o).4i(X.L.1U.5R).K(X.L.3u-1);k(aj).2R(X.L.1U.5R)}D 1T=12 9s();1T.X=k.1p(X,\'id\');1T.1z=X.L.3u-1;1T.2J=X.L.1Q[X.L.3u-1].2J;if(1T.21){1T.6S=S;k.2u.19.1D(1T)}P{1T.6S=k.2u.19}if(X.L.2x){X.L.2x.o.3x(X.L.1Q[X.L.3u-1].6L)}},19:u(){X=1h.9e(q.X);if(X.L.3z){X.L.3z.o.B(\'19\',\'1o\')}if(X.L.3s){X.L.3s.o.B(\'19\',\'1o\')}52=k.1a.2o(X);y=0;if(X.L.1U){if(X.L.1U.5A==\'Q\'){y+=X.L.1U.4C.hb}P{52.h-=X.L.1U.4C.hb}}if(X.L.2x){if(X.L.2x&&X.L.2x.6Q==\'Q\'){y+=X.L.2x.4C.hb}P{52.h-=X.L.2x.4C.hb}}hg=k(\'.ca\',X);y=y+(52.h-q.W)/2;x=(52.1C-q.Z)/2;X.L.5u.B(\'Q\',y+\'U\').B(\'O\',x+\'U\').3x(\'<1T 2J="\'+q.2J+\'" />\');X.L.5u.7f(X.L.3W);3s=X.L.3u+1;if(3s>X.L.1Q.1g){3s=1}3z=X.L.3u-1;if(3z<1){3z=X.L.1Q.1g}X.L.3s.o.B(\'19\',\'2B\').B(\'Q\',y+\'U\').B(\'O\',x+2*q.Z/3+\'U\').B(\'Z\',q.Z/3+\'U\').B(\'W\',q.W+\'U\').1p(\'4g\',X.L.1Q[3s-1].6L);X.L.3s.o.K(0).3h=\'#\'+3s+k.1p(X,\'id\');X.L.3z.o.B(\'19\',\'2B\').B(\'Q\',y+\'U\').B(\'O\',x+\'U\').B(\'Z\',q.Z/3+\'U\').B(\'W\',q.W+\'U\').1p(\'4g\',X.L.1Q[3z-1].6L);X.L.3z.o.K(0).3h=\'#\'+3z+k.1p(X,\'id\')},2r:u(o){if(!o||!o.1Z||k.2u.5I[o.1Z])E;D 1Z=k(\'#\'+o.1Z);D el=1Z.K(0);if(el.14.Y!=\'1P\'&&el.14.Y!=\'2s\'){el.14.Y=\'2s\'}el.14.2U=\'2K\';if(1Z.1N()==0)E;el.L={};el.L.1Q=o.1Q?o.1Q:[];el.L.6o=o.6o&&o.6o==1b||I;97=el.f3(\'hL\');24(i=0;i<97.1g;i++){7Z=el.L.1Q.1g;el.L.1Q[7Z]={2J:97[i].2J,6L:97[i].4g||97[i].hD||\'\'}}if(el.L.1Q.1g==0){E}el.L.4n=k.23(k.1a.3w(el),k.1a.2o(el));el.L.b5=k.1a.aT(el);el.L.bu=k.1a.6U(el);t=T(el.L.b5.t)+T(el.L.bu.t);b=T(el.L.b5.b)+T(el.L.bu.b);k(\'1T\',el).bk();el.L.3W=o.3W?o.3W:g5;if(o.5A||o.9f||o.5R){el.L.1U={};1Z.1S(\'<22 6T="g1"></22>\');el.L.1U.o=k(\'.g1\',el);if(o.9f){el.L.1U.9f=o.9f;el.L.1U.o.2R(o.9f)}if(o.5R){el.L.1U.5R=o.5R}el.L.1U.o.B(\'Y\',\'1P\').B(\'Z\',el.L.4n.w+\'U\');if(o.5A&&o.5A==\'Q\'){el.L.1U.5A=\'Q\';el.L.1U.o.B(\'Q\',t+\'U\')}P{el.L.1U.5A=\'4D\';el.L.1U.o.B(\'4D\',b+\'U\')}el.L.1U.aE=o.aE?o.aE:\' \';24(D i=0;i<el.L.1Q.1g;i++){7Z=T(i)+1;el.L.1U.o.1S(\'<a 3h="#\'+7Z+o.1Z+\'" 6T="gR" 4g="\'+el.L.1Q[i].6L+\'">\'+7Z+\'</a>\'+(7Z!=el.L.1Q.1g?el.L.1U.aE:\'\'))}k(\'a\',el.L.1U.o).1J(\'5h\',u(){k.2u.go({90:q})});el.L.1U.4C=k.1a.2o(el.L.1U.o.K(0))}if(o.6Q||o.9c){el.L.2x={};1Z.1S(\'<22 6T="dn">&7k;</22>\');el.L.2x.o=k(\'.dn\',el);if(o.9c){el.L.2x.9c=o.9c;el.L.2x.o.2R(o.9c)}el.L.2x.o.B(\'Y\',\'1P\').B(\'Z\',el.L.4n.w+\'U\');if(o.6Q&&o.6Q==\'Q\'){el.L.2x.6Q=\'Q\';el.L.2x.o.B(\'Q\',(el.L.1U&&el.L.1U.5A==\'Q\'?el.L.1U.4C.hb+t:t)+\'U\')}P{el.L.2x.6Q=\'4D\';el.L.2x.o.B(\'4D\',(el.L.1U&&el.L.1U.5A==\'4D\'?el.L.1U.4C.hb+b:b)+\'U\')}el.L.2x.4C=k.1a.2o(el.L.2x.o.K(0))}if(o.9D){el.L.3s={9D:o.9D};1Z.1S(\'<a 3h="#2\'+o.1Z+\'" 6T="eY">&7k;</a>\');el.L.3s.o=k(\'.eY\',el);el.L.3s.o.B(\'Y\',\'1P\').B(\'19\',\'1o\').B(\'2U\',\'2K\').B(\'4A\',\'eR\').2R(el.L.3s.9D);el.L.3s.o.1J(\'5h\',k.2u.eg)}if(o.9o){el.L.3z={9o:o.9o};1Z.1S(\'<a 3h="#0\'+o.1Z+\'" 6T="ee">&7k;</a>\');el.L.3z.o=k(\'.ee\',el);el.L.3z.o.B(\'Y\',\'1P\').B(\'19\',\'1o\').B(\'2U\',\'2K\').B(\'4A\',\'eR\').2R(el.L.3z.9o);el.L.3z.o.1J(\'5h\',k.2u.dp)}1Z.bG(\'<22 6T="ca"></22>\');el.L.5u=k(\'.ca\',el);el.L.5u.B(\'Y\',\'1P\').B(\'Q\',\'2P\').B(\'O\',\'2P\').B(\'19\',\'1o\');if(o.2b){1Z.bG(\'<22 6T="dW" 14="19: 1o;"><1T 2J="\'+o.2b+\'" /></22>\');el.L.2b=k(\'.dW\',el);el.L.2b.B(\'Y\',\'1P\');D 1T=12 9s();1T.X=o.1Z;1T.2J=o.2b;if(1T.21){1T.6S=S;k.2u.go({2b:1T})}P{1T.6S=u(){k.2u.go({2b:q})}}}P{k.2u.go({1Z:el})}if(o.cS){fi=T(o.cS)*aC}k.2u.5I[o.1Z]=o.cS?1X.6V(\'k.2u.2I(\\\'\'+o.1Z+\'\\\')\',fi):S}};k.X=k.2u.2r;k.1t={7s:[],5L:{},1c:I,7u:S,26:u(){if(k.11.F==S){E}D 4O,3G,c,cs;k.1t.1c.K(0).3l=k.11.F.A.6R;4O=k.1t.1c.K(0).14;4O.19=\'2B\';k.1t.1c.1B=k.23(k.1a.3w(k.1t.1c.K(0)),k.1a.2o(k.1t.1c.K(0)));4O.Z=k.11.F.A.1B.1C+\'U\';4O.W=k.11.F.A.1B.hb+\'U\';3G=k.1a.cy(k.11.F);4O.5K=3G.t;4O.5z=3G.r;4O.5k=3G.b;4O.5j=3G.l;if(k.11.F.A.46==1b){c=k.11.F.fI(1b);cs=c.14;cs.5K=\'2P\';cs.5z=\'2P\';cs.5k=\'2P\';cs.5j=\'2P\';cs.19=\'2B\';k.1t.1c.5o().1S(c)}k(k.11.F).f5(k.1t.1c.K(0));k.11.F.14.19=\'1o\'},fC:u(e){if(!e.A.44&&k.1x.5r.cQ){if(e.A.3T)e.A.3T.1D(F);k(e).B(\'Y\',e.A.cz||e.A.4n);k(e).aS();k(k.1x.5r).f6(e)}k.1t.1c.4i(e.A.6R).3x(\'&7k;\');k.1t.7u=S;D 4O=k.1t.1c.K(0).14;4O.19=\'1o\';k.1t.1c.f5(e);if(e.A.fx>0){k(e).7f(e.A.fx)}k(\'2e\').1S(k.1t.1c.K(0));D 86=[];D 8q=I;24(D i=0;i<k.1t.7s.1g;i++){D 1j=k.1x.3P[k.1t.7s[i]].K(0);D id=k.1p(1j,\'id\');D 8i=k.1t.8x(id);if(1j.1i.ay!=8i.7l){1j.1i.ay=8i.7l;if(8q==I&&1j.1i.2Z){8q=1j.1i.2Z}8i.id=id;86[86.1g]=8i}}k.1t.7s=[];if(8q!=I&&86.1g>0){8q(86)}},al:u(e,o){if(!k.11.F)E;D 6e=I;D i=0;if(e.1i.el.1N()>0){24(i=e.1i.el.1N();i>0;i--){if(e.1i.el.K(i-1)!=k.11.F){if(!e.5V.b2){if((e.1i.el.K(i-1).1M.y+e.1i.el.K(i-1).1M.hb/2)>k.11.F.A.2q){6e=e.1i.el.K(i-1)}P{1r}}P{if((e.1i.el.K(i-1).1M.x+e.1i.el.K(i-1).1M.1C/2)>k.11.F.A.2v&&(e.1i.el.K(i-1).1M.y+e.1i.el.K(i-1).1M.hb/2)>k.11.F.A.2q){6e=e.1i.el.K(i-1)}}}}}if(6e&&k.1t.7u!=6e){k.1t.7u=6e;k(6e).h5(k.1t.1c.K(0))}P if(!6e&&(k.1t.7u!=S||k.1t.1c.K(0).31!=e)){k.1t.7u=S;k(e).1S(k.1t.1c.K(0))}k.1t.1c.K(0).14.19=\'2B\'},cT:u(e){if(k.11.F==S){E}e.1i.el.1E(u(){q.1M=k.23(k.1a.74(q),k.1a.7G(q))})},8x:u(s){D i;D h=\'\';D o={};if(s){if(k.1t.5L[s]){o[s]=[];k(\'#\'+s+\' .\'+k.1t.5L[s]).1E(u(){if(h.1g>0){h+=\'&\'}h+=s+\'[]=\'+k.1p(q,\'id\');o[s][o[s].1g]=k.1p(q,\'id\')})}P{24(a in s){if(k.1t.5L[s[a]]){o[s[a]]=[];k(\'#\'+s[a]+\' .\'+k.1t.5L[s[a]]).1E(u(){if(h.1g>0){h+=\'&\'}h+=s[a]+\'[]=\'+k.1p(q,\'id\');o[s[a]][o[s[a]].1g]=k.1p(q,\'id\')})}}}}P{24(i in k.1t.5L){o[i]=[];k(\'#\'+i+\' .\'+k.1t.5L[i]).1E(u(){if(h.1g>0){h+=\'&\'}h+=i+\'[]=\'+k.1p(q,\'id\');o[i][o[i].1g]=k.1p(q,\'id\')})}}E{7l:h,o:o}},fF:u(e){if(!e.dq){E}E q.1E(u(){if(!q.5V||!k(e).is(\'.\'+q.5V.3C))k(e).2R(q.5V.3C);k(e).7t(q.5V.A)})},4U:u(){E q.1E(u(){k(\'.\'+q.5V.3C).aS();k(q).dR();q.5V=S;q.fm=S})},2r:u(o){if(o.3C&&k.1a&&k.11&&k.1x){if(!k.1t.1c){k(\'2e\',1h).1S(\'<22 id="e5">&7k;</22>\');k.1t.1c=k(\'#e5\');k.1t.1c.K(0).14.19=\'1o\'}q.do({3C:o.3C,9J:o.9J?o.9J:I,a5:o.a5?o.a5:I,58:o.58?o.58:I,7x:o.7x||o.dC,7y:o.7y||o.fO,cQ:1b,2Z:o.2Z||o.ia,fx:o.fx?o.fx:I,46:o.46?1b:I,6I:o.6I?o.6I:\'cV\'});E q.1E(u(){D A={6N:o.6N?1b:I,ff:6P,1G:o.1G?2m(o.1G):I,6R:o.58?o.58:I,fx:o.fx?o.fx:I,44:1b,46:o.46?1b:I,3v:o.3v?o.3v:S,2p:o.2p?o.2p:S,4o:o.4o&&o.4o.1K==2A?o.4o:I,4m:o.4m&&o.4m.1K==2A?o.4m:I,3T:o.3T&&o.3T.1K==2A?o.3T:I,1O:/49|4j/.48(o.1O)?o.1O:I,6M:o.6M?T(o.6M)||0:I,2V:o.2V?o.2V:I};k(\'.\'+o.3C,q).7t(A);q.fm=1b;q.5V={3C:o.3C,6N:o.6N?1b:I,ff:6P,1G:o.1G?2m(o.1G):I,6R:o.58?o.58:I,fx:o.fx?o.fx:I,44:1b,46:o.46?1b:I,3v:o.3v?o.3v:S,2p:o.2p?o.2p:S,b2:o.b2?1b:I,A:A}})}}};k.fn.23({j3:k.1t.2r,f6:k.1t.fF,iS:k.1t.4U});k.iZ=k.1t.8x;k.2t={6O:S,7b:I,9m:S,6K:u(e){k.2t.7b=1b;k.2t.1Y(e,q,1b)},cq:u(e){if(k.2t.6O!=q)E;k.2t.7b=I;k.2t.2G(e,q)},1Y:u(e,el,7b){if(k.2t.6O!=S)E;if(!el){el=q}k.2t.6O=el;1M=k.23(k.1a.3w(el),k.1a.2o(el));8u=k(el);4g=8u.1p(\'4g\');3h=8u.1p(\'3h\');if(4g){k.2t.9m=4g;8u.1p(\'4g\',\'\');k(\'#eT\').3x(4g);if(3h)k(\'#bL\').3x(3h.4E(\'jh://\',\'\'));P k(\'#bL\').3x(\'\');1c=k(\'#8z\');if(el.4H.3l){1c.K(0).3l=el.4H.3l}P{1c.K(0).3l=\'\'}bo=k.1a.2o(1c.K(0));ga=7b&&el.4H.Y==\'bO\'?\'4D\':el.4H.Y;3m(ga){1e\'Q\':2q=1M.y-bo.hb;2v=1M.x;1r;1e\'O\':2q=1M.y;2v=1M.x-bo.1C;1r;1e\'2L\':2q=1M.y;2v=1M.x+1M.1C;1r;1e\'bO\':k(\'2e\').1J(\'3D\',k.2t.3D);1s=k.1a.4a(e);2q=1s.y+15;2v=1s.x+15;1r;ad:2q=1M.y+1M.hb;2v=1M.x;1r}1c.B({Q:2q+\'U\',O:2v+\'U\'});if(el.4H.54==I){1c.1Y()}P{1c.7f(el.4H.54)}if(el.4H.2Y)el.4H.2Y.1D(el);8u.1J(\'8B\',k.2t.2G).1J(\'5B\',k.2t.cq)}},3D:u(e){if(k.2t.6O==S){k(\'2e\').3q(\'3D\',k.2t.3D);E}1s=k.1a.4a(e);k(\'#8z\').B({Q:1s.y+15+\'U\',O:1s.x+15+\'U\'})},2G:u(e,el){if(!el){el=q}if(k.2t.7b!=1b&&k.2t.6O==el){k.2t.6O=S;k(\'#8z\').7a(1);k(el).1p(\'4g\',k.2t.9m).3q(\'8B\',k.2t.2G).3q(\'5B\',k.2t.cq);if(el.4H.3i)el.4H.3i.1D(el);k.2t.9m=S}},2r:u(M){if(!k.2t.1c){k(\'2e\').1S(\'<22 id="8z"><22 id="eT"></22><22 id="bL"></22></22>\');k(\'#8z\').B({Y:\'1P\',3I:6P,19:\'1o\'});k.2t.1c=1b}E q.1E(u(){if(k.1p(q,\'4g\')){q.4H={Y:/Q|4D|O|2L|bO/.48(M.Y)?M.Y:\'4D\',3l:M.3l?M.3l:I,54:M.54?M.54:I,2Y:M.2Y&&M.2Y.1K==2A?M.2Y:I,3i:M.3i&&M.3i.1K==2A?M.3i:I};D el=k(q);el.1J(\'9z\',k.2t.1Y);el.1J(\'6K\',k.2t.6K)}})}};k.fn.hO=k.2t.2r;k.84={bq:u(e){3K=e.7L||e.7K||-1;if(3K==9){if(1X.2k){1X.2k.bT=1b;1X.2k.c0=I}P{e.aP();e.aW()}if(q.b1){1h.6J.dZ().3g="\\t";q.dV=u(){q.6K();q.dV=S}}P if(q.aF){26=q.5q;2T=q.dN;q.2y=q.2y.hd(0,26)+"\\t"+q.2y.h8(2T);q.aF(26+1,26+1);q.6K()}E I}},4U:u(){E q.1E(u(){if(q.7P&&q.7P==1b){k(q).3q(\'7B\',k.84.bq);q.7P=I}})},2r:u(){E q.1E(u(){if(q.4Y==\'cf\'&&(!q.7P||q.7P==I)){k(q).1J(\'7B\',k.84.bq);q.7P=1b}})}};k.fn.23({j5:k.84.2r,hH:k.84.4U});k.1a={3w:u(e){D x=0;D y=0;D es=e.14;D bP=I;if(k(e).B(\'19\')==\'1o\'){D 5Y=es.3n;D 9q=es.Y;bP=1b;es.3n=\'2K\';es.19=\'2B\';es.Y=\'1P\'}D el=e;7d(el){x+=el.8t+(el.4Z&&!k.3a.7I?T(el.4Z.5b)||0:0);y+=el.8G+(el.4Z&&!k.3a.7I?T(el.4Z.4S)||0:0);el=el.dJ}el=e;7d(el&&el.4Y&&el.4Y.6c()!=\'2e\'){x-=el.3c||0;y-=el.3d||0;el=el.31}if(bP==1b){es.19=\'1o\';es.Y=9q;es.3n=5Y}E{x:x,y:y}},7G:u(el){D x=0,y=0;7d(el){x+=el.8t||0;y+=el.8G||0;el=el.dJ}E{x:x,y:y}},2o:u(e){D w=k.B(e,\'Z\');D h=k.B(e,\'W\');D 1C=0;D hb=0;D es=e.14;if(k(e).B(\'19\')!=\'1o\'){1C=e.4c;hb=e.5W}P{D 5Y=es.3n;D 9q=es.Y;es.3n=\'2K\';es.19=\'2B\';es.Y=\'1P\';1C=e.4c;hb=e.5W;es.19=\'1o\';es.Y=9q;es.3n=5Y}E{w:w,h:h,1C:1C,hb:hb}},74:u(el){E{1C:el.4c||0,hb:el.5W||0}},bm:u(e){D h,w,de;if(e){w=e.8W;h=e.8O}P{de=1h.5d;w=1X.d4||aa.d4||(de&&de.8W)||1h.2e.8W;h=1X.cB||aa.cB||(de&&de.8O)||1h.2e.8O}E{w:w,h:h}},6z:u(e){D t=0,l=0,w=0,h=0,iw=0,ih=0;if(e&&e.9N.6c()!=\'2e\'){t=e.3d;l=e.3c;w=e.d7;h=e.d2;iw=0;ih=0}P{if(1h.5d){t=1h.5d.3d;l=1h.5d.3c;w=1h.5d.d7;h=1h.5d.d2}P if(1h.2e){t=1h.2e.3d;l=1h.2e.3c;w=1h.2e.d7;h=1h.2e.d2}iw=aa.d4||1h.5d.8W||1h.2e.8W||0;ih=aa.cB||1h.5d.8O||1h.2e.8O||0}E{t:t,l:l,w:w,h:h,iw:iw,ih:ih}},cy:u(e,7N){D el=k(e);D t=el.B(\'5K\')||\'\';D r=el.B(\'5z\')||\'\';D b=el.B(\'5k\')||\'\';D l=el.B(\'5j\')||\'\';if(7N)E{t:T(t)||0,r:T(r)||0,b:T(b)||0,l:T(l)};P E{t:t,r:r,b:b,l:l}},aT:u(e,7N){D el=k(e);D t=el.B(\'5M\')||\'\';D r=el.B(\'5U\')||\'\';D b=el.B(\'5n\')||\'\';D l=el.B(\'4X\')||\'\';if(7N)E{t:T(t)||0,r:T(r)||0,b:T(b)||0,l:T(l)};P E{t:t,r:r,b:b,l:l}},6U:u(e,7N){D el=k(e);D t=el.B(\'4S\')||\'\';D r=el.B(\'5O\')||\'\';D b=el.B(\'5Q\')||\'\';D l=el.B(\'5b\')||\'\';if(7N)E{t:T(t)||0,r:T(r)||0,b:T(b)||0,l:T(l)||0};P E{t:t,r:r,b:b,l:l}},4a:u(2k){D x=2k.hT||(2k.gM+(1h.5d.3c||1h.2e.3c))||0;D y=2k.ki||(2k.iQ+(1h.5d.3d||1h.2e.3d))||0;E{x:x,y:y}},cI:u(4R,cx){cx(4R);4R=4R.7c;7d(4R){k.1a.cI(4R,cx);4R=4R.hQ}},h7:u(4R){k.1a.cI(4R,u(el){24(D 1p in el){if(2g el[1p]===\'u\'){el[1p]=S}}})},hV:u(el,1O){D 5l=k.1a.6z();D b6=k.1a.2o(el);if(!1O||1O==\'49\')k(el).B({Q:5l.t+((18.3r(5l.h,5l.ih)-5l.t-b6.hb)/2)+\'U\'});if(!1O||1O==\'4j\')k(el).B({O:5l.l+((18.3r(5l.w,5l.iw)-5l.l-b6.1C)/2)+\'U\'})},hW:u(el,dk){D 1Q=k(\'1T[@2J*="8X"]\',el||1h),8X;1Q.1E(u(){8X=q.2J;q.2J=dk;q.14.5E="9n:9w.9y.hE(2J=\'"+8X+"\')"})}};[].3J||(7F.hF.3J=u(v,n){n=(n==S)?0:n;D m=q.1g;24(D i=n;i<m;i++)if(q[i]==v)E i;E-1});',62,1293,'||||||||||||||||||||jQuery||||||this||||function||||||dragCfg|css|elm|var|return|dragged|easing|speed|false|callback|get|ss|options|iAuto|left|else|top|iResize|null|parseInt|px|oldStyle|height|slideshow|position|width||iDrag|new||style||||Math|display|iUtil|true|helper|subject|case|autoCFG|length|document|dropCfg|iEL|resizeOptions|carouselCfg|duration|interfaceFX|none|attr|sizes|break|pointer|iSort|type|ImageBox|queue|iDrop|iAutoscroller|slide|resizeElement|oC|wb|apply|each|fisheyeCfg|opacity|delta|newSizes|bind|constructor|custom|pos|size|axis|absolute|images|items|append|img|slideslinks|255|firstNum|window|show|container||complete|div|extend|for||start||cont|elsToScroll|100|loader|oR||body|elem|typeof|selectedItem|oldP|props|event|accordionCfg|parseFloat|field|getSize|containment|ny|build|relative|iTooltip|islideshow|nx|tp|slideCaption|value|newPosition|Function|block|selectHelper|step|border|itemWidth|hide|dequeue|timer|src|hidden|right|limit|nr|fractions|0px|PI|addClass|direction|end|overflow|cursorAt|result|parentData|onShow|onChange|to|parentNode|||||||||browser|iSlider|scrollLeft|scrollTop|scr|transferHelper|text|href|onHide|pre|selectdrug|className|switch|visibility|item|wrapper|unbind|max|nextslide|values|currentslide|handle|getPosition|html|newCoords|prevslide|iframe|iExpander|accept|mousemove|canvas|createElement|margins|onSlide|zIndex|indexOf|pressedKey|min|valueToAdd|multipleSeparator|pageSize|zones|highlighted|toggle|abs|onStop|dragElem|times|fadeDuration|diff|dhs|handlers||resizeDirection||vp|so|distance|ghosting||test|vertically|getPointer|startTop|offsetWidth|subjectValue|lastSuggestion|DropOutDirectiont|title|wrs|removeClass|horizontally|startLeft|out|onDrag|oP|onStart|nWidth|percent|down|ifxFirstDisplay|msie|iteration|ratio|clear|color|lastValue|slideCfg|fontSize|currentPointer|dimm|bottom|replace|up|prevImage|tooltipCFG|rel|els|fxCheckTag|context|nextImage|params|shs|fieldData|elToScroll|nodeEl|borderTopWidth|chunks|destroy|string|nHeight|paddingLeft|tagName|currentStyle||halign|slidePos|onclick|delay||containerW|from|helperclass|endLeft|endTop|borderLeftWidth|dragmoveBy|documentElement|dhe|newStyles|clonedEl|click|si|marginLeft|marginBottom|clientScroll|OpenClose|paddingBottom|empty|toWrite|selectionStart|overzone|toAdd|onDragModifier|holder|mousedown|animate|toDrag|cnt|marginRight|linksPosition|blur|getAttribute|hight|filter|sw|zoney|cos|slideshows|zonex|marginTop|collected|paddingTop|url|borderRightWidth|mouseup|borderBottomWidth|activeLinkClass|dragHandle|clearInterval|paddingRight|sortCfg|offsetHeight|prop|oldVisibility|styles||BlindDirection|point|fxh|nmp|old|post|currentPanel|onSelect|elementData|grid|pow|toLowerCase|animationHandler|cur|containerH|close|puff|getWidth|currentRel|imageEl|Expander|getHeight|iFisheye|random|newDimensions|itemHeight|reflections|sliders|selRange|wr|orig|margin|maxWidth|keyup|getScroll|captionText|totalImages|128|parseColor|curCSS|outerContainer|Scale|restore|tolerance|selection|focus|caption|snapDistance|revert|current|3000|captionPosition|hpc|onload|class|getBorder|setInterval|oldStyleAttr|rule|rgb|open|minLeft|ActiveXObject|oldDisplay|restoreStyle|getSizeLite||nw|0x||F0|fadeOut|focused|firstChild|while|cssRules|fadeIn|Date|minTop|backgroundColor|sc|nbsp|hash|captionEl|selectKeyHelper|selectCurrent|newTop|init|newLeft|changed|Draggable|inFrontOf|efx|139|onHover|onOut|getTime|np|keydown|split|radiusY|increment|Array|getPositionLite|selectClass|opera|onHighlight|keyCode|charCode|Object|toInteger|frameClass|hasTabsEnabled|zonew|user|zoneh|positionItems|onClick|oD|scrollIntoView|accordionPos|proximity|indic||data|containerSize|sin|iTTabs||ts|ImageBoxPrevImage|ImageBoxNextImage|imageSrc|newPos|maxHeight|minHeight|elS|activeClass|panels|maxBottom|maxRight|ser|move|opened|bounceout|animationInProgress|overlay|stop|reflectionSize|fnc|classname|insideParent|offsetLeft|jEl|nRy|pr|serialize|nRx|tooltipHelper|cssSides|mouseout|select|count|namedColors|padding|offsetTop|directionIncrement|parentEl|400|dir|expand|createTextNode|finishedPre|clientHeight|li|applyOn|content|contBorders|object|parentBorders|alpha|clientWidth|png|gallery|fontWeight|link|yproc|xproc|sx|parent|showImage|selectedone|imgs|onselect|sy|startDrag|cursor|captionClass|onselectstop|getElementById|linksClass|sh|ul|onActivate|isDroppable|nextEl|onDrop|oldTitle|progid|prevslideClass|prevEl|oldPosition|SliderContainer|Image|linkRel|selectKeyUp|selectKeyDown|DXImageTransform|inCache|Microsoft|mouseover|dragstop|diffX|211|nextslideClass|prot|auto|dEs|hidehelper|isDraggable|activeclass|unit|DoFold|unfold|nodeName|startTime|buildWrapper|prev|1px|oldColor|setTimeout|ScrollTo|st|sl|cssText|9999|next|destroyWrapper|opt|diffHeight|diffWidth|exec|hoverclass|image|blind|borderColor|sideEnd|self|key||default|2000|styleSheets|getValues|192|diffY|lnk|reflexions|checkhover|selectcheck|maxRotation|ImageBoxOuterContainer|gradient|panelHeight|childs|headers|ne|hideImage|minWidth|iIndex|itemsText|os|side|iCarousel|5625|1000|itemMinWidth|linksSeparator|setSelectionRange|protectRotation|positionContainer|posx|hoverClass|valToAdd|minchars|helperClass|source|nextImageEl|preventDefault|multiple|headerSelector|DraggableDestroy|getPadding|autofill|handleEl|stopPropagation|prevImageEl|getFieldValues|panelSelector|String|createTextRange|floats|lastSi|shrink|oPad|windowSize|paddingLeftSize|angle|paddingY|paddingX|RegExp|borderRightSize|floatVal|firstStep|pulse|Pulsate|Color|rotationSpeed|paddingBottomSize|remove|parseStyle|getClient|Number|helperSize|bounce|doTab||zoom|borderLeftSize|oBor|paddingRightSize|borderTopSize|paddingTopSize|stopAnim|pValue|borderBottomSize|extraWidth|restricted|autoSize|unselectable|SliderIteration|prepend|clearTimeout|isSlider|oneIsSortable|applyOnHover|tooltipURL|tabindex|draginit|mouse|restoreStyles|sliderSize|sliderPos|parentPos|cancelBubble|autocomplete|inputWidth|oldBorder|dragmove|clnt|sliderEl|returnValue|loaderWidth|idsa|letterSpacing|pause|getContainment|fade|snapToGrid|linear|10000|slideshowHolder|asin|cssSidesEnd|borderWidth|fitToContainer|TEXTAREA|entities|INPUT|spacer|writeItems|character|currentValue|paddings|169|oldFloat|borders|hidefocused|bouncein||modifyContainer|transparent|center|loadImage|func|getMargins|initialPosition|textAlign|innerHeight|Alpha|no|captionImages|closeEl|shake|prevTop|traverseDOM|Selectserialize|stopDrag|slider|ImageBoxCaption|ImageBoxIframe|300|ImageBoxOverlay|sortable|moveDrag|autoplay|measure|prevLeft|intersect|ImageBoxCurrentImage|selectstop|Shake|index|dragEl|keyPressed|scrollHeight|scroll|innerWidth|match|elPosition|scrollWidth|textImage|slideBor|jpg|captionSize|textImageFrom|visible||loaderHeight|ImageBoxCaptionImages||hoverItem|clickItem|emptyGIF||notColor|slideshowCaption|Droppable|goprev|childNodes|autocompleteHelper|autocompleteIframe|slidePad|fit|165|clientSize|||fontFamily|colorCssProps|elType|onhover|cssProps|expanderHelper|boxModel|itransferTo|keypress|moveStart|offsetParent|Width|selectstart|fxe|selectionEnd|checkCache|fontStyle|update|DroppableDestroy|remeasure|fontStretch|fontVariant|onblur|slideshowLoader|htmlEntities|wordSpacing|createRange|224|KhtmlUserSelect||closeHTML|on|sortHelper|245|userSelect|dragHelper|hrefAttr|dragstart|107|loaderSRC|highlight|slideshowPrevslide||gonext||styleFloat|frameborder|javascript|||relAttr|wid|scrolling||onslide|||listStyle|imageTypes|insertBefore|999|textDecoration|sqrt|140|230|maxy|240|ImageBoxContainer|doScroll|interval|set|dragmoveByKey|protect|ImageBoxCaptionText|144|ImageBoxLoader|off|checkdrop|isSelectable|hlt|30px|selectedclass|tooltipTitle|imagebox|shc|overlayOpacity|selRange2|slideshowNextSlide|gif|getSelectionStart|360|iAccordion|getElementsByTagName|iBounce|after|SortableAddItem|onResize|150|itemZIndex|grow|getHeightMinMax|borderTopUnit|selectcheckApply|borderRightUnit|zindex|fontUnit|togglehor|time|se|parte|easeout|isSortable||SlideInUp|fold|SlideOutUp|rgba|addColorStop|yfrac|containerMaxx|interfaceColorFX|containerMaxy||leftUnit|mousex||radiusX|check|getContext|xfrac|addItem|topUnit|fracH|cloneNode|togglever|paddingLeftUnit|borderBottomUnit|finish|onDragStop|onout|posy|isFunction|oldOverflow|directions|vertical|fracW|fakeAccordionClass|parts|fadeTo|inputValue|xml|selectstopApply|slideshowLinks|onDragStart|BlindUp|paddingTopUnit|500|trim|maxx|borderLeftUnit|paddingRightUnit|filteredPosition|BlindDown|paddingBottomUnit|horizontal|valign|find|ImageBoxClose|onselectstart|mozUserSelect|ondragstart|scale|110|globalCompositeOperation|bmp||drawImage|ondrop|password|quot||save|starty|jpeg|||number|startx|finishOpacity|hover|recallDroppables|flipv|finishx|destination|khtml|moz|lt|amp|pW|clientX|Accordion|translate|captiontext|elasticin|slideshowLink|fix|elasticout|resize|elasticboth|bounceboth|984375|9375|Selectable|30002|list|625|30001|nodeValue|before|100000|purgeEvents|substr|duplicate|moveEnd|||substring|success|param|par|array|Fisheye|name|POST|ajax|easeboth|location|fromHandler|collapse|MozUserSelect||ResizableDestroy|rotationTimer|fillRect|fill|WebKit|fillStyle|createLinearGradient|Resizable|navigator|appVersion|lineHeigt|alt|AlphaImageLoader|prototype|SliderGetValues|DisableTabs|Carousel|load|easein|IMG|200|Slider|ToolTip|wh|nextSibling|Autocomplete|SliderSetValues|pageX|float|centerEl|fixPNG|isNaN|dotted|dashed|stopAll|Left|outlineColor|Top|Right|Bottom|solid|double|selectorText|rules|onchange|SlideToggleRight|SlideOutRight||borderStyle||TransferTo||groove|ridge|inset|outset|borderTopColor||borderRightColor|olive|navy|orange||pink|203|maroon||magenta|182|193|lightyellow|lime|purple|red|outlineOffset|outlineWidth|borderBottomColor|borderLeftColor|lineHeight|loading|silver|white|yellow|Showing|100000000|SlideInRight|clientY|Highlight|SortableDestroy|CloseVertically|CloseHorizontally|FoldToggle|UnFold|SlideInDown|SlideToggleUp|SortSerialize|Fold|SwitchHorizontally|SwitchVertically|Sortable|scrollTo|EnableTabs|ScrollToAnchors|pt|Puff|OpenVertically|OpenHorizontally|Grow|Shrink|DropToggleRight|DropInRight|BlindToggleHorizontally|BlindRight|http|Bounce|120|BlindLeft|BlindToggleVertically|SlideToggleLeft|SlideOutLeft|toUpperCase|SlideInLeft|SlideToggleDown|SlideOutDown|DropOutLeft|DropInLeft|DropToggleLeft|DropOutRight|DropToggleUp|DropInUp|DropOutDown|DropInDown|DropToggleDown|DropOutUp|lightpink|textIndent|aqua|appendChild|azure|beige|220|last|cssFloat|first|ol|wrapEl|fxWrapper|black|imageLoaded|darkkhaki|darkgreen|189|183|darkmagenta|firstResize|darkgrey|brown|cyan|darkblue|darkcyan|table|form|col|tfoot|colgroup|th|header|thead|tbody|112|Autoexpand|tr|td|script|frame|input|pageY|textarea|button|w_|removeChild|frameset|option|optgroup|meta|darkolivegreen|blue|122|233|green|lightcyan|204|darkviolet|lightgreen|indigo|216|khaki|darksalmon|130|darkred|lightblue|148|173|215|238|fuchsia|gold|darkorchid|153|darkorange|lightgrey'.split('|'),0,{}))
diff --git a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/js/jquery/jquery.js b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/js/jquery/jquery.js
index 82f3e9ef4f8011b809de5a31e5cf9b6c8927ffee..00999f685a75edbe60c5970ec3b8616cfdcaba63 100644
--- a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/js/jquery/jquery.js
+++ b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/js/jquery/jquery.js
@@ -1,33 +1,154 @@
-/*
- * jQuery 1.2.6 - New Wave Javascript
+/*!
+ * jQuery JavaScript Library v1.4.2
+ * http://jquery.com/
  *
- * Copyright (c) 2008 John Resig (jquery.com)
- * Dual licensed under the MIT (MIT-LICENSE.txt)
- * and GPL (GPL-LICENSE.txt) licenses.
+ * Copyright 2010, John Resig
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
  *
- * $Date: 2008-05-24 14:22:17 -0400 (Sat, 24 May 2008) $
- * $Rev: 5685 $
+ * Includes Sizzle.js
+ * http://sizzlejs.com/
+ * Copyright 2010, The Dojo Foundation
+ * Released under the MIT, BSD, and GPL Licenses.
+ *
+ * Date: Sat Feb 13 22:33:48 2010 -0500
  */
-(function(){var _jQuery=window.jQuery,_$=window.$;var jQuery=window.jQuery=window.$=function(selector,context){return new jQuery.fn.init(selector,context);};var quickExpr=/^[^<]*(<(.|\s)+>)[^>]*$|^#(\w+)$/,isSimple=/^.[^:#\[\.]*$/,undefined;jQuery.fn=jQuery.prototype={init:function(selector,context){selector=selector||document;if(selector.nodeType){this[0]=selector;this.length=1;return this;}if(typeof selector=="string"){var match=quickExpr.exec(selector);if(match&&(match[1]||!context)){if(match[1])selector=jQuery.clean([match[1]],context);else{var elem=document.getElementById(match[3]);if(elem){if(elem.id!=match[3])return jQuery().find(selector);return jQuery(elem);}selector=[];}}else
-return jQuery(context).find(selector);}else if(jQuery.isFunction(selector))return jQuery(document)[jQuery.fn.ready?"ready":"load"](selector);return this.setArray(jQuery.makeArray(selector));},jquery:"1.2.6",size:function(){return this.length;},length:0,get:function(num){return num==undefined?jQuery.makeArray(this):this[num];},pushStack:function(elems){var ret=jQuery(elems);ret.prevObject=this;return ret;},setArray:function(elems){this.length=0;Array.prototype.push.apply(this,elems);return this;},each:function(callback,args){return jQuery.each(this,callback,args);},index:function(elem){var ret=-1;return jQuery.inArray(elem&&elem.jquery?elem[0]:elem,this);},attr:function(name,value,type){var options=name;if(name.constructor==String)if(value===undefined)return this[0]&&jQuery[type||"attr"](this[0],name);else{options={};options[name]=value;}return this.each(function(i){for(name in options)jQuery.attr(type?this.style:this,name,jQuery.prop(this,options[name],type,i,name));});},css:function(key,value){if((key=='width'||key=='height')&&parseFloat(value)<0)value=undefined;return this.attr(key,value,"curCSS");},text:function(text){if(typeof text!="object"&&text!=null)return this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(text));var ret="";jQuery.each(text||this,function(){jQuery.each(this.childNodes,function(){if(this.nodeType!=8)ret+=this.nodeType!=1?this.nodeValue:jQuery.fn.text([this]);});});return ret;},wrapAll:function(html){if(this[0])jQuery(html,this[0].ownerDocument).clone().insertBefore(this[0]).map(function(){var elem=this;while(elem.firstChild)elem=elem.firstChild;return elem;}).append(this);return this;},wrapInner:function(html){return this.each(function(){jQuery(this).contents().wrapAll(html);});},wrap:function(html){return this.each(function(){jQuery(this).wrapAll(html);});},append:function(){return this.domManip(arguments,true,false,function(elem){if(this.nodeType==1)this.appendChild(elem);});},prepend:function(){return this.domManip(arguments,true,true,function(elem){if(this.nodeType==1)this.insertBefore(elem,this.firstChild);});},before:function(){return this.domManip(arguments,false,false,function(elem){this.parentNode.insertBefore(elem,this);});},after:function(){return this.domManip(arguments,false,true,function(elem){this.parentNode.insertBefore(elem,this.nextSibling);});},end:function(){return this.prevObject||jQuery([]);},find:function(selector){var elems=jQuery.map(this,function(elem){return jQuery.find(selector,elem);});return this.pushStack(/[^+>] [^+>]/.test(selector)||selector.indexOf("..")>-1?jQuery.unique(elems):elems);},clone:function(events){var ret=this.map(function(){if(jQuery.browser.msie&&!jQuery.isXMLDoc(this)){var clone=this.cloneNode(true),container=document.createElement("div");container.appendChild(clone);return jQuery.clean([container.innerHTML])[0];}else
-return this.cloneNode(true);});var clone=ret.find("*").andSelf().each(function(){if(this[expando]!=undefined)this[expando]=null;});if(events===true)this.find("*").andSelf().each(function(i){if(this.nodeType==3)return;var events=jQuery.data(this,"events");for(var type in events)for(var handler in events[type])jQuery.event.add(clone[i],type,events[type][handler],events[type][handler].data);});return ret;},filter:function(selector){return this.pushStack(jQuery.isFunction(selector)&&jQuery.grep(this,function(elem,i){return selector.call(elem,i);})||jQuery.multiFilter(selector,this));},not:function(selector){if(selector.constructor==String)if(isSimple.test(selector))return this.pushStack(jQuery.multiFilter(selector,this,true));else
-selector=jQuery.multiFilter(selector,this);var isArrayLike=selector.length&&selector[selector.length-1]!==undefined&&!selector.nodeType;return this.filter(function(){return isArrayLike?jQuery.inArray(this,selector)<0:this!=selector;});},add:function(selector){return this.pushStack(jQuery.unique(jQuery.merge(this.get(),typeof selector=='string'?jQuery(selector):jQuery.makeArray(selector))));},is:function(selector){return!!selector&&jQuery.multiFilter(selector,this).length>0;},hasClass:function(selector){return this.is("."+selector);},val:function(value){if(value==undefined){if(this.length){var elem=this[0];if(jQuery.nodeName(elem,"select")){var index=elem.selectedIndex,values=[],options=elem.options,one=elem.type=="select-one";if(index<0)return null;for(var i=one?index:0,max=one?index+1:options.length;i<max;i++){var option=options[i];if(option.selected){value=jQuery.browser.msie&&!option.attributes.value.specified?option.text:option.value;if(one)return value;values.push(value);}}return values;}else
-return(this[0].value||"").replace(/\r/g,"");}return undefined;}if(value.constructor==Number)value+='';return this.each(function(){if(this.nodeType!=1)return;if(value.constructor==Array&&/radio|checkbox/.test(this.type))this.checked=(jQuery.inArray(this.value,value)>=0||jQuery.inArray(this.name,value)>=0);else if(jQuery.nodeName(this,"select")){var values=jQuery.makeArray(value);jQuery("option",this).each(function(){this.selected=(jQuery.inArray(this.value,values)>=0||jQuery.inArray(this.text,values)>=0);});if(!values.length)this.selectedIndex=-1;}else
-this.value=value;});},html:function(value){return value==undefined?(this[0]?this[0].innerHTML:null):this.empty().append(value);},replaceWith:function(value){return this.after(value).remove();},eq:function(i){return this.slice(i,i+1);},slice:function(){return this.pushStack(Array.prototype.slice.apply(this,arguments));},map:function(callback){return this.pushStack(jQuery.map(this,function(elem,i){return callback.call(elem,i,elem);}));},andSelf:function(){return this.add(this.prevObject);},data:function(key,value){var parts=key.split(".");parts[1]=parts[1]?"."+parts[1]:"";if(value===undefined){var data=this.triggerHandler("getData"+parts[1]+"!",[parts[0]]);if(data===undefined&&this.length)data=jQuery.data(this[0],key);return data===undefined&&parts[1]?this.data(parts[0]):data;}else
-return this.trigger("setData"+parts[1]+"!",[parts[0],value]).each(function(){jQuery.data(this,key,value);});},removeData:function(key){return this.each(function(){jQuery.removeData(this,key);});},domManip:function(args,table,reverse,callback){var clone=this.length>1,elems;return this.each(function(){if(!elems){elems=jQuery.clean(args,this.ownerDocument);if(reverse)elems.reverse();}var obj=this;if(table&&jQuery.nodeName(this,"table")&&jQuery.nodeName(elems[0],"tr"))obj=this.getElementsByTagName("tbody")[0]||this.appendChild(this.ownerDocument.createElement("tbody"));var scripts=jQuery([]);jQuery.each(elems,function(){var elem=clone?jQuery(this).clone(true)[0]:this;if(jQuery.nodeName(elem,"script"))scripts=scripts.add(elem);else{if(elem.nodeType==1)scripts=scripts.add(jQuery("script",elem).remove());callback.call(obj,elem);}});scripts.each(evalScript);});}};jQuery.fn.init.prototype=jQuery.fn;function evalScript(i,elem){if(elem.src)jQuery.ajax({url:elem.src,async:false,dataType:"script"});else
-jQuery.globalEval(elem.text||elem.textContent||elem.innerHTML||"");if(elem.parentNode)elem.parentNode.removeChild(elem);}function now(){return+new Date;}jQuery.extend=jQuery.fn.extend=function(){var target=arguments[0]||{},i=1,length=arguments.length,deep=false,options;if(target.constructor==Boolean){deep=target;target=arguments[1]||{};i=2;}if(typeof target!="object"&&typeof target!="function")target={};if(length==i){target=this;--i;}for(;i<length;i++)if((options=arguments[i])!=null)for(var name in options){var src=target[name],copy=options[name];if(target===copy)continue;if(deep&&copy&&typeof copy=="object"&&!copy.nodeType)target[name]=jQuery.extend(deep,src||(copy.length!=null?[]:{}),copy);else if(copy!==undefined)target[name]=copy;}return target;};var expando="jQuery"+now(),uuid=0,windowData={},exclude=/z-?index|font-?weight|opacity|zoom|line-?height/i,defaultView=document.defaultView||{};jQuery.extend({noConflict:function(deep){window.$=_$;if(deep)window.jQuery=_jQuery;return jQuery;},isFunction:function(fn){return!!fn&&typeof fn!="string"&&!fn.nodeName&&fn.constructor!=Array&&/^[\s[]?function/.test(fn+"");},isXMLDoc:function(elem){return elem.documentElement&&!elem.body||elem.tagName&&elem.ownerDocument&&!elem.ownerDocument.body;},globalEval:function(data){data=jQuery.trim(data);if(data){var head=document.getElementsByTagName("head")[0]||document.documentElement,script=document.createElement("script");script.type="text/javascript";if(jQuery.browser.msie)script.text=data;else
-script.appendChild(document.createTextNode(data));head.insertBefore(script,head.firstChild);head.removeChild(script);}},nodeName:function(elem,name){return elem.nodeName&&elem.nodeName.toUpperCase()==name.toUpperCase();},cache:{},data:function(elem,name,data){elem=elem==window?windowData:elem;var id=elem[expando];if(!id)id=elem[expando]=++uuid;if(name&&!jQuery.cache[id])jQuery.cache[id]={};if(data!==undefined)jQuery.cache[id][name]=data;return name?jQuery.cache[id][name]:id;},removeData:function(elem,name){elem=elem==window?windowData:elem;var id=elem[expando];if(name){if(jQuery.cache[id]){delete jQuery.cache[id][name];name="";for(name in jQuery.cache[id])break;if(!name)jQuery.removeData(elem);}}else{try{delete elem[expando];}catch(e){if(elem.removeAttribute)elem.removeAttribute(expando);}delete jQuery.cache[id];}},each:function(object,callback,args){var name,i=0,length=object.length;if(args){if(length==undefined){for(name in object)if(callback.apply(object[name],args)===false)break;}else
-for(;i<length;)if(callback.apply(object[i++],args)===false)break;}else{if(length==undefined){for(name in object)if(callback.call(object[name],name,object[name])===false)break;}else
-for(var value=object[0];i<length&&callback.call(value,i,value)!==false;value=object[++i]){}}return object;},prop:function(elem,value,type,i,name){if(jQuery.isFunction(value))value=value.call(elem,i);return value&&value.constructor==Number&&type=="curCSS"&&!exclude.test(name)?value+"px":value;},className:{add:function(elem,classNames){jQuery.each((classNames||"").split(/\s+/),function(i,className){if(elem.nodeType==1&&!jQuery.className.has(elem.className,className))elem.className+=(elem.className?" ":"")+className;});},remove:function(elem,classNames){if(elem.nodeType==1)elem.className=classNames!=undefined?jQuery.grep(elem.className.split(/\s+/),function(className){return!jQuery.className.has(classNames,className);}).join(" "):"";},has:function(elem,className){return jQuery.inArray(className,(elem.className||elem).toString().split(/\s+/))>-1;}},swap:function(elem,options,callback){var old={};for(var name in options){old[name]=elem.style[name];elem.style[name]=options[name];}callback.call(elem);for(var name in options)elem.style[name]=old[name];},css:function(elem,name,force){if(name=="width"||name=="height"){var val,props={position:"absolute",visibility:"hidden",display:"block"},which=name=="width"?["Left","Right"]:["Top","Bottom"];function getWH(){val=name=="width"?elem.offsetWidth:elem.offsetHeight;var padding=0,border=0;jQuery.each(which,function(){padding+=parseFloat(jQuery.curCSS(elem,"padding"+this,true))||0;border+=parseFloat(jQuery.curCSS(elem,"border"+this+"Width",true))||0;});val-=Math.round(padding+border);}if(jQuery(elem).is(":visible"))getWH();else
-jQuery.swap(elem,props,getWH);return Math.max(0,val);}return jQuery.curCSS(elem,name,force);},curCSS:function(elem,name,force){var ret,style=elem.style;function color(elem){if(!jQuery.browser.safari)return false;var ret=defaultView.getComputedStyle(elem,null);return!ret||ret.getPropertyValue("color")=="";}if(name=="opacity"&&jQuery.browser.msie){ret=jQuery.attr(style,"opacity");return ret==""?"1":ret;}if(jQuery.browser.opera&&name=="display"){var save=style.outline;style.outline="0 solid black";style.outline=save;}if(name.match(/float/i))name=styleFloat;if(!force&&style&&style[name])ret=style[name];else if(defaultView.getComputedStyle){if(name.match(/float/i))name="float";name=name.replace(/([A-Z])/g,"-$1").toLowerCase();var computedStyle=defaultView.getComputedStyle(elem,null);if(computedStyle&&!color(elem))ret=computedStyle.getPropertyValue(name);else{var swap=[],stack=[],a=elem,i=0;for(;a&&color(a);a=a.parentNode)stack.unshift(a);for(;i<stack.length;i++)if(color(stack[i])){swap[i]=stack[i].style.display;stack[i].style.display="block";}ret=name=="display"&&swap[stack.length-1]!=null?"none":(computedStyle&&computedStyle.getPropertyValue(name))||"";for(i=0;i<swap.length;i++)if(swap[i]!=null)stack[i].style.display=swap[i];}if(name=="opacity"&&ret=="")ret="1";}else if(elem.currentStyle){var camelCase=name.replace(/\-(\w)/g,function(all,letter){return letter.toUpperCase();});ret=elem.currentStyle[name]||elem.currentStyle[camelCase];if(!/^\d+(px)?$/i.test(ret)&&/^\d/.test(ret)){var left=style.left,rsLeft=elem.runtimeStyle.left;elem.runtimeStyle.left=elem.currentStyle.left;style.left=ret||0;ret=style.pixelLeft+"px";style.left=left;elem.runtimeStyle.left=rsLeft;}}return ret;},clean:function(elems,context){var ret=[];context=context||document;if(typeof context.createElement=='undefined')context=context.ownerDocument||context[0]&&context[0].ownerDocument||document;jQuery.each(elems,function(i,elem){if(!elem)return;if(elem.constructor==Number)elem+='';if(typeof elem=="string"){elem=elem.replace(/(<(\w+)[^>]*?)\/>/g,function(all,front,tag){return tag.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i)?all:front+"></"+tag+">";});var tags=jQuery.trim(elem).toLowerCase(),div=context.createElement("div");var wrap=!tags.indexOf("<opt")&&[1,"<select multiple='multiple'>","</select>"]||!tags.indexOf("<leg")&&[1,"<fieldset>","</fieldset>"]||tags.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"<table>","</table>"]||!tags.indexOf("<tr")&&[2,"<table><tbody>","</tbody></table>"]||(!tags.indexOf("<td")||!tags.indexOf("<th"))&&[3,"<table><tbody><tr>","</tr></tbody></table>"]||!tags.indexOf("<col")&&[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"]||jQuery.browser.msie&&[1,"div<div>","</div>"]||[0,"",""];div.innerHTML=wrap[1]+elem+wrap[2];while(wrap[0]--)div=div.lastChild;if(jQuery.browser.msie){var tbody=!tags.indexOf("<table")&&tags.indexOf("<tbody")<0?div.firstChild&&div.firstChild.childNodes:wrap[1]=="<table>"&&tags.indexOf("<tbody")<0?div.childNodes:[];for(var j=tbody.length-1;j>=0;--j)if(jQuery.nodeName(tbody[j],"tbody")&&!tbody[j].childNodes.length)tbody[j].parentNode.removeChild(tbody[j]);if(/^\s/.test(elem))div.insertBefore(context.createTextNode(elem.match(/^\s*/)[0]),div.firstChild);}elem=jQuery.makeArray(div.childNodes);}if(elem.length===0&&(!jQuery.nodeName(elem,"form")&&!jQuery.nodeName(elem,"select")))return;if(elem[0]==undefined||jQuery.nodeName(elem,"form")||elem.options)ret.push(elem);else
-ret=jQuery.merge(ret,elem);});return ret;},attr:function(elem,name,value){if(!elem||elem.nodeType==3||elem.nodeType==8)return undefined;var notxml=!jQuery.isXMLDoc(elem),set=value!==undefined,msie=jQuery.browser.msie;name=notxml&&jQuery.props[name]||name;if(elem.tagName){var special=/href|src|style/.test(name);if(name=="selected"&&jQuery.browser.safari)elem.parentNode.selectedIndex;if(name in elem&&notxml&&!special){if(set){if(name=="type"&&jQuery.nodeName(elem,"input")&&elem.parentNode)throw"type property can't be changed";elem[name]=value;}if(jQuery.nodeName(elem,"form")&&elem.getAttributeNode(name))return elem.getAttributeNode(name).nodeValue;return elem[name];}if(msie&&notxml&&name=="style")return jQuery.attr(elem.style,"cssText",value);if(set)elem.setAttribute(name,""+value);var attr=msie&&notxml&&special?elem.getAttribute(name,2):elem.getAttribute(name);return attr===null?undefined:attr;}if(msie&&name=="opacity"){if(set){elem.zoom=1;elem.filter=(elem.filter||"").replace(/alpha\([^)]*\)/,"")+(parseInt(value)+''=="NaN"?"":"alpha(opacity="+value*100+")");}return elem.filter&&elem.filter.indexOf("opacity=")>=0?(parseFloat(elem.filter.match(/opacity=([^)]*)/)[1])/100)+'':"";}name=name.replace(/-([a-z])/ig,function(all,letter){return letter.toUpperCase();});if(set)elem[name]=value;return elem[name];},trim:function(text){return(text||"").replace(/^\s+|\s+$/g,"");},makeArray:function(array){var ret=[];if(array!=null){var i=array.length;if(i==null||array.split||array.setInterval||array.call)ret[0]=array;else
-while(i)ret[--i]=array[i];}return ret;},inArray:function(elem,array){for(var i=0,length=array.length;i<length;i++)if(array[i]===elem)return i;return-1;},merge:function(first,second){var i=0,elem,pos=first.length;if(jQuery.browser.msie){while(elem=second[i++])if(elem.nodeType!=8)first[pos++]=elem;}else
-while(elem=second[i++])first[pos++]=elem;return first;},unique:function(array){var ret=[],done={};try{for(var i=0,length=array.length;i<length;i++){var id=jQuery.data(array[i]);if(!done[id]){done[id]=true;ret.push(array[i]);}}}catch(e){ret=array;}return ret;},grep:function(elems,callback,inv){var ret=[];for(var i=0,length=elems.length;i<length;i++)if(!inv!=!callback(elems[i],i))ret.push(elems[i]);return ret;},map:function(elems,callback){var ret=[];for(var i=0,length=elems.length;i<length;i++){var value=callback(elems[i],i);if(value!=null)ret[ret.length]=value;}return ret.concat.apply([],ret);}});var userAgent=navigator.userAgent.toLowerCase();jQuery.browser={version:(userAgent.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[])[1],safari:/webkit/.test(userAgent),opera:/opera/.test(userAgent),msie:/msie/.test(userAgent)&&!/opera/.test(userAgent),mozilla:/mozilla/.test(userAgent)&&!/(compatible|webkit)/.test(userAgent)};var styleFloat=jQuery.browser.msie?"styleFloat":"cssFloat";jQuery.extend({boxModel:!jQuery.browser.msie||document.compatMode=="CSS1Compat",props:{"for":"htmlFor","class":"className","float":styleFloat,cssFloat:styleFloat,styleFloat:styleFloat,readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing"}});jQuery.each({parent:function(elem){return elem.parentNode;},parents:function(elem){return jQuery.dir(elem,"parentNode");},next:function(elem){return jQuery.nth(elem,2,"nextSibling");},prev:function(elem){return jQuery.nth(elem,2,"previousSibling");},nextAll:function(elem){return jQuery.dir(elem,"nextSibling");},prevAll:function(elem){return jQuery.dir(elem,"previousSibling");},siblings:function(elem){return jQuery.sibling(elem.parentNode.firstChild,elem);},children:function(elem){return jQuery.sibling(elem.firstChild);},contents:function(elem){return jQuery.nodeName(elem,"iframe")?elem.contentDocument||elem.contentWindow.document:jQuery.makeArray(elem.childNodes);}},function(name,fn){jQuery.fn[name]=function(selector){var ret=jQuery.map(this,fn);if(selector&&typeof selector=="string")ret=jQuery.multiFilter(selector,ret);return this.pushStack(jQuery.unique(ret));};});jQuery.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(name,original){jQuery.fn[name]=function(){var args=arguments;return this.each(function(){for(var i=0,length=args.length;i<length;i++)jQuery(args[i])[original](this);});};});jQuery.each({removeAttr:function(name){jQuery.attr(this,name,"");if(this.nodeType==1)this.removeAttribute(name);},addClass:function(classNames){jQuery.className.add(this,classNames);},removeClass:function(classNames){jQuery.className.remove(this,classNames);},toggleClass:function(classNames){jQuery.className[jQuery.className.has(this,classNames)?"remove":"add"](this,classNames);},remove:function(selector){if(!selector||jQuery.filter(selector,[this]).r.length){jQuery("*",this).add(this).each(function(){jQuery.event.remove(this);jQuery.removeData(this);});if(this.parentNode)this.parentNode.removeChild(this);}},empty:function(){jQuery(">*",this).remove();while(this.firstChild)this.removeChild(this.firstChild);}},function(name,fn){jQuery.fn[name]=function(){return this.each(fn,arguments);};});jQuery.each(["Height","Width"],function(i,name){var type=name.toLowerCase();jQuery.fn[type]=function(size){return this[0]==window?jQuery.browser.opera&&document.body["client"+name]||jQuery.browser.safari&&window["inner"+name]||document.compatMode=="CSS1Compat"&&document.documentElement["client"+name]||document.body["client"+name]:this[0]==document?Math.max(Math.max(document.body["scroll"+name],document.documentElement["scroll"+name]),Math.max(document.body["offset"+name],document.documentElement["offset"+name])):size==undefined?(this.length?jQuery.css(this[0],type):null):this.css(type,size.constructor==String?size:size+"px");};});function num(elem,prop){return elem[0]&&parseInt(jQuery.curCSS(elem[0],prop,true),10)||0;}var chars=jQuery.browser.safari&&parseInt(jQuery.browser.version)<417?"(?:[\\w*_-]|\\\\.)":"(?:[\\w\u0128-\uFFFF*_-]|\\\\.)",quickChild=new RegExp("^>\\s*("+chars+"+)"),quickID=new RegExp("^("+chars+"+)(#)("+chars+"+)"),quickClass=new RegExp("^([#.]?)("+chars+"*)");jQuery.extend({expr:{"":function(a,i,m){return m[2]=="*"||jQuery.nodeName(a,m[2]);},"#":function(a,i,m){return a.getAttribute("id")==m[2];},":":{lt:function(a,i,m){return i<m[3]-0;},gt:function(a,i,m){return i>m[3]-0;},nth:function(a,i,m){return m[3]-0==i;},eq:function(a,i,m){return m[3]-0==i;},first:function(a,i){return i==0;},last:function(a,i,m,r){return i==r.length-1;},even:function(a,i){return i%2==0;},odd:function(a,i){return i%2;},"first-child":function(a){return a.parentNode.getElementsByTagName("*")[0]==a;},"last-child":function(a){return jQuery.nth(a.parentNode.lastChild,1,"previousSibling")==a;},"only-child":function(a){return!jQuery.nth(a.parentNode.lastChild,2,"previousSibling");},parent:function(a){return a.firstChild;},empty:function(a){return!a.firstChild;},contains:function(a,i,m){return(a.textContent||a.innerText||jQuery(a).text()||"").indexOf(m[3])>=0;},visible:function(a){return"hidden"!=a.type&&jQuery.css(a,"display")!="none"&&jQuery.css(a,"visibility")!="hidden";},hidden:function(a){return"hidden"==a.type||jQuery.css(a,"display")=="none"||jQuery.css(a,"visibility")=="hidden";},enabled:function(a){return!a.disabled;},disabled:function(a){return a.disabled;},checked:function(a){return a.checked;},selected:function(a){return a.selected||jQuery.attr(a,"selected");},text:function(a){return"text"==a.type;},radio:function(a){return"radio"==a.type;},checkbox:function(a){return"checkbox"==a.type;},file:function(a){return"file"==a.type;},password:function(a){return"password"==a.type;},submit:function(a){return"submit"==a.type;},image:function(a){return"image"==a.type;},reset:function(a){return"reset"==a.type;},button:function(a){return"button"==a.type||jQuery.nodeName(a,"button");},input:function(a){return/input|select|textarea|button/i.test(a.nodeName);},has:function(a,i,m){return jQuery.find(m[3],a).length;},header:function(a){return/h\d/i.test(a.nodeName);},animated:function(a){return jQuery.grep(jQuery.timers,function(fn){return a==fn.elem;}).length;}}},parse:[/^(\[) *@?([\w-]+) *([!*$^~=]*) *('?"?)(.*?)\4 *\]/,/^(:)([\w-]+)\("?'?(.*?(\(.*?\))?[^(]*?)"?'?\)/,new RegExp("^([:.#]*)("+chars+"+)")],multiFilter:function(expr,elems,not){var old,cur=[];while(expr&&expr!=old){old=expr;var f=jQuery.filter(expr,elems,not);expr=f.t.replace(/^\s*,\s*/,"");cur=not?elems=f.r:jQuery.merge(cur,f.r);}return cur;},find:function(t,context){if(typeof t!="string")return[t];if(context&&context.nodeType!=1&&context.nodeType!=9)return[];context=context||document;var ret=[context],done=[],last,nodeName;while(t&&last!=t){var r=[];last=t;t=jQuery.trim(t);var foundToken=false,re=quickChild,m=re.exec(t);if(m){nodeName=m[1].toUpperCase();for(var i=0;ret[i];i++)for(var c=ret[i].firstChild;c;c=c.nextSibling)if(c.nodeType==1&&(nodeName=="*"||c.nodeName.toUpperCase()==nodeName))r.push(c);ret=r;t=t.replace(re,"");if(t.indexOf(" ")==0)continue;foundToken=true;}else{re=/^([>+~])\s*(\w*)/i;if((m=re.exec(t))!=null){r=[];var merge={};nodeName=m[2].toUpperCase();m=m[1];for(var j=0,rl=ret.length;j<rl;j++){var n=m=="~"||m=="+"?ret[j].nextSibling:ret[j].firstChild;for(;n;n=n.nextSibling)if(n.nodeType==1){var id=jQuery.data(n);if(m=="~"&&merge[id])break;if(!nodeName||n.nodeName.toUpperCase()==nodeName){if(m=="~")merge[id]=true;r.push(n);}if(m=="+")break;}}ret=r;t=jQuery.trim(t.replace(re,""));foundToken=true;}}if(t&&!foundToken){if(!t.indexOf(",")){if(context==ret[0])ret.shift();done=jQuery.merge(done,ret);r=ret=[context];t=" "+t.substr(1,t.length);}else{var re2=quickID;var m=re2.exec(t);if(m){m=[0,m[2],m[3],m[1]];}else{re2=quickClass;m=re2.exec(t);}m[2]=m[2].replace(/\\/g,"");var elem=ret[ret.length-1];if(m[1]=="#"&&elem&&elem.getElementById&&!jQuery.isXMLDoc(elem)){var oid=elem.getElementById(m[2]);if((jQuery.browser.msie||jQuery.browser.opera)&&oid&&typeof oid.id=="string"&&oid.id!=m[2])oid=jQuery('[@id="'+m[2]+'"]',elem)[0];ret=r=oid&&(!m[3]||jQuery.nodeName(oid,m[3]))?[oid]:[];}else{for(var i=0;ret[i];i++){var tag=m[1]=="#"&&m[3]?m[3]:m[1]!=""||m[0]==""?"*":m[2];if(tag=="*"&&ret[i].nodeName.toLowerCase()=="object")tag="param";r=jQuery.merge(r,ret[i].getElementsByTagName(tag));}if(m[1]==".")r=jQuery.classFilter(r,m[2]);if(m[1]=="#"){var tmp=[];for(var i=0;r[i];i++)if(r[i].getAttribute("id")==m[2]){tmp=[r[i]];break;}r=tmp;}ret=r;}t=t.replace(re2,"");}}if(t){var val=jQuery.filter(t,r);ret=r=val.r;t=jQuery.trim(val.t);}}if(t)ret=[];if(ret&&context==ret[0])ret.shift();done=jQuery.merge(done,ret);return done;},classFilter:function(r,m,not){m=" "+m+" ";var tmp=[];for(var i=0;r[i];i++){var pass=(" "+r[i].className+" ").indexOf(m)>=0;if(!not&&pass||not&&!pass)tmp.push(r[i]);}return tmp;},filter:function(t,r,not){var last;while(t&&t!=last){last=t;var p=jQuery.parse,m;for(var i=0;p[i];i++){m=p[i].exec(t);if(m){t=t.substring(m[0].length);m[2]=m[2].replace(/\\/g,"");break;}}if(!m)break;if(m[1]==":"&&m[2]=="not")r=isSimple.test(m[3])?jQuery.filter(m[3],r,true).r:jQuery(r).not(m[3]);else if(m[1]==".")r=jQuery.classFilter(r,m[2],not);else if(m[1]=="["){var tmp=[],type=m[3];for(var i=0,rl=r.length;i<rl;i++){var a=r[i],z=a[jQuery.props[m[2]]||m[2]];if(z==null||/href|src|selected/.test(m[2]))z=jQuery.attr(a,m[2])||'';if((type==""&&!!z||type=="="&&z==m[5]||type=="!="&&z!=m[5]||type=="^="&&z&&!z.indexOf(m[5])||type=="$="&&z.substr(z.length-m[5].length)==m[5]||(type=="*="||type=="~=")&&z.indexOf(m[5])>=0)^not)tmp.push(a);}r=tmp;}else if(m[1]==":"&&m[2]=="nth-child"){var merge={},tmp=[],test=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(m[3]=="even"&&"2n"||m[3]=="odd"&&"2n+1"||!/\D/.test(m[3])&&"0n+"+m[3]||m[3]),first=(test[1]+(test[2]||1))-0,last=test[3]-0;for(var i=0,rl=r.length;i<rl;i++){var node=r[i],parentNode=node.parentNode,id=jQuery.data(parentNode);if(!merge[id]){var c=1;for(var n=parentNode.firstChild;n;n=n.nextSibling)if(n.nodeType==1)n.nodeIndex=c++;merge[id]=true;}var add=false;if(first==0){if(node.nodeIndex==last)add=true;}else if((node.nodeIndex-last)%first==0&&(node.nodeIndex-last)/first>=0)add=true;if(add^not)tmp.push(node);}r=tmp;}else{var fn=jQuery.expr[m[1]];if(typeof fn=="object")fn=fn[m[2]];if(typeof fn=="string")fn=eval("false||function(a,i){return "+fn+";}");r=jQuery.grep(r,function(elem,i){return fn(elem,i,m,r);},not);}}return{r:r,t:t};},dir:function(elem,dir){var matched=[],cur=elem[dir];while(cur&&cur!=document){if(cur.nodeType==1)matched.push(cur);cur=cur[dir];}return matched;},nth:function(cur,result,dir,elem){result=result||1;var num=0;for(;cur;cur=cur[dir])if(cur.nodeType==1&&++num==result)break;return cur;},sibling:function(n,elem){var r=[];for(;n;n=n.nextSibling){if(n.nodeType==1&&n!=elem)r.push(n);}return r;}});jQuery.event={add:function(elem,types,handler,data){if(elem.nodeType==3||elem.nodeType==8)return;if(jQuery.browser.msie&&elem.setInterval)elem=window;if(!handler.guid)handler.guid=this.guid++;if(data!=undefined){var fn=handler;handler=this.proxy(fn,function(){return fn.apply(this,arguments);});handler.data=data;}var events=jQuery.data(elem,"events")||jQuery.data(elem,"events",{}),handle=jQuery.data(elem,"handle")||jQuery.data(elem,"handle",function(){if(typeof jQuery!="undefined"&&!jQuery.event.triggered)return jQuery.event.handle.apply(arguments.callee.elem,arguments);});handle.elem=elem;jQuery.each(types.split(/\s+/),function(index,type){var parts=type.split(".");type=parts[0];handler.type=parts[1];var handlers=events[type];if(!handlers){handlers=events[type]={};if(!jQuery.event.special[type]||jQuery.event.special[type].setup.call(elem)===false){if(elem.addEventListener)elem.addEventListener(type,handle,false);else if(elem.attachEvent)elem.attachEvent("on"+type,handle);}}handlers[handler.guid]=handler;jQuery.event.global[type]=true;});elem=null;},guid:1,global:{},remove:function(elem,types,handler){if(elem.nodeType==3||elem.nodeType==8)return;var events=jQuery.data(elem,"events"),ret,index;if(events){if(types==undefined||(typeof types=="string"&&types.charAt(0)=="."))for(var type in events)this.remove(elem,type+(types||""));else{if(types.type){handler=types.handler;types=types.type;}jQuery.each(types.split(/\s+/),function(index,type){var parts=type.split(".");type=parts[0];if(events[type]){if(handler)delete events[type][handler.guid];else
-for(handler in events[type])if(!parts[1]||events[type][handler].type==parts[1])delete events[type][handler];for(ret in events[type])break;if(!ret){if(!jQuery.event.special[type]||jQuery.event.special[type].teardown.call(elem)===false){if(elem.removeEventListener)elem.removeEventListener(type,jQuery.data(elem,"handle"),false);else if(elem.detachEvent)elem.detachEvent("on"+type,jQuery.data(elem,"handle"));}ret=null;delete events[type];}}});}for(ret in events)break;if(!ret){var handle=jQuery.data(elem,"handle");if(handle)handle.elem=null;jQuery.removeData(elem,"events");jQuery.removeData(elem,"handle");}}},trigger:function(type,data,elem,donative,extra){data=jQuery.makeArray(data);if(type.indexOf("!")>=0){type=type.slice(0,-1);var exclusive=true;}if(!elem){if(this.global[type])jQuery("*").add([window,document]).trigger(type,data);}else{if(elem.nodeType==3||elem.nodeType==8)return undefined;var val,ret,fn=jQuery.isFunction(elem[type]||null),event=!data[0]||!data[0].preventDefault;if(event){data.unshift({type:type,target:elem,preventDefault:function(){},stopPropagation:function(){},timeStamp:now()});data[0][expando]=true;}data[0].type=type;if(exclusive)data[0].exclusive=true;var handle=jQuery.data(elem,"handle");if(handle)val=handle.apply(elem,data);if((!fn||(jQuery.nodeName(elem,'a')&&type=="click"))&&elem["on"+type]&&elem["on"+type].apply(elem,data)===false)val=false;if(event)data.shift();if(extra&&jQuery.isFunction(extra)){ret=extra.apply(elem,val==null?data:data.concat(val));if(ret!==undefined)val=ret;}if(fn&&donative!==false&&val!==false&&!(jQuery.nodeName(elem,'a')&&type=="click")){this.triggered=true;try{elem[type]();}catch(e){}}this.triggered=false;}return val;},handle:function(event){var val,ret,namespace,all,handlers;event=arguments[0]=jQuery.event.fix(event||window.event);namespace=event.type.split(".");event.type=namespace[0];namespace=namespace[1];all=!namespace&&!event.exclusive;handlers=(jQuery.data(this,"events")||{})[event.type];for(var j in handlers){var handler=handlers[j];if(all||handler.type==namespace){event.handler=handler;event.data=handler.data;ret=handler.apply(this,arguments);if(val!==false)val=ret;if(ret===false){event.preventDefault();event.stopPropagation();}}}return val;},fix:function(event){if(event[expando]==true)return event;var originalEvent=event;event={originalEvent:originalEvent};var props="altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode metaKey newValue originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target timeStamp toElement type view wheelDelta which".split(" ");for(var i=props.length;i;i--)event[props[i]]=originalEvent[props[i]];event[expando]=true;event.preventDefault=function(){if(originalEvent.preventDefault)originalEvent.preventDefault();originalEvent.returnValue=false;};event.stopPropagation=function(){if(originalEvent.stopPropagation)originalEvent.stopPropagation();originalEvent.cancelBubble=true;};event.timeStamp=event.timeStamp||now();if(!event.target)event.target=event.srcElement||document;if(event.target.nodeType==3)event.target=event.target.parentNode;if(!event.relatedTarget&&event.fromElement)event.relatedTarget=event.fromElement==event.target?event.toElement:event.fromElement;if(event.pageX==null&&event.clientX!=null){var doc=document.documentElement,body=document.body;event.pageX=event.clientX+(doc&&doc.scrollLeft||body&&body.scrollLeft||0)-(doc.clientLeft||0);event.pageY=event.clientY+(doc&&doc.scrollTop||body&&body.scrollTop||0)-(doc.clientTop||0);}if(!event.which&&((event.charCode||event.charCode===0)?event.charCode:event.keyCode))event.which=event.charCode||event.keyCode;if(!event.metaKey&&event.ctrlKey)event.metaKey=event.ctrlKey;if(!event.which&&event.button)event.which=(event.button&1?1:(event.button&2?3:(event.button&4?2:0)));return event;},proxy:function(fn,proxy){proxy.guid=fn.guid=fn.guid||proxy.guid||this.guid++;return proxy;},special:{ready:{setup:function(){bindReady();return;},teardown:function(){return;}},mouseenter:{setup:function(){if(jQuery.browser.msie)return false;jQuery(this).bind("mouseover",jQuery.event.special.mouseenter.handler);return true;},teardown:function(){if(jQuery.browser.msie)return false;jQuery(this).unbind("mouseover",jQuery.event.special.mouseenter.handler);return true;},handler:function(event){if(withinElement(event,this))return true;event.type="mouseenter";return jQuery.event.handle.apply(this,arguments);}},mouseleave:{setup:function(){if(jQuery.browser.msie)return false;jQuery(this).bind("mouseout",jQuery.event.special.mouseleave.handler);return true;},teardown:function(){if(jQuery.browser.msie)return false;jQuery(this).unbind("mouseout",jQuery.event.special.mouseleave.handler);return true;},handler:function(event){if(withinElement(event,this))return true;event.type="mouseleave";return jQuery.event.handle.apply(this,arguments);}}}};jQuery.fn.extend({bind:function(type,data,fn){return type=="unload"?this.one(type,data,fn):this.each(function(){jQuery.event.add(this,type,fn||data,fn&&data);});},one:function(type,data,fn){var one=jQuery.event.proxy(fn||data,function(event){jQuery(this).unbind(event,one);return(fn||data).apply(this,arguments);});return this.each(function(){jQuery.event.add(this,type,one,fn&&data);});},unbind:function(type,fn){return this.each(function(){jQuery.event.remove(this,type,fn);});},trigger:function(type,data,fn){return this.each(function(){jQuery.event.trigger(type,data,this,true,fn);});},triggerHandler:function(type,data,fn){return this[0]&&jQuery.event.trigger(type,data,this[0],false,fn);},toggle:function(fn){var args=arguments,i=1;while(i<args.length)jQuery.event.proxy(fn,args[i++]);return this.click(jQuery.event.proxy(fn,function(event){this.lastToggle=(this.lastToggle||0)%i;event.preventDefault();return args[this.lastToggle++].apply(this,arguments)||false;}));},hover:function(fnOver,fnOut){return this.bind('mouseenter',fnOver).bind('mouseleave',fnOut);},ready:function(fn){bindReady();if(jQuery.isReady)fn.call(document,jQuery);else
-jQuery.readyList.push(function(){return fn.call(this,jQuery);});return this;}});jQuery.extend({isReady:false,readyList:[],ready:function(){if(!jQuery.isReady){jQuery.isReady=true;if(jQuery.readyList){jQuery.each(jQuery.readyList,function(){this.call(document);});jQuery.readyList=null;}jQuery(document).triggerHandler("ready");}}});var readyBound=false;function bindReady(){if(readyBound)return;readyBound=true;if(document.addEventListener&&!jQuery.browser.opera)document.addEventListener("DOMContentLoaded",jQuery.ready,false);if(jQuery.browser.msie&&window==top)(function(){if(jQuery.isReady)return;try{document.documentElement.doScroll("left");}catch(error){setTimeout(arguments.callee,0);return;}jQuery.ready();})();if(jQuery.browser.opera)document.addEventListener("DOMContentLoaded",function(){if(jQuery.isReady)return;for(var i=0;i<document.styleSheets.length;i++)if(document.styleSheets[i].disabled){setTimeout(arguments.callee,0);return;}jQuery.ready();},false);if(jQuery.browser.safari){var numStyles;(function(){if(jQuery.isReady)return;if(document.readyState!="loaded"&&document.readyState!="complete"){setTimeout(arguments.callee,0);return;}if(numStyles===undefined)numStyles=jQuery("style, link[rel=stylesheet]").length;if(document.styleSheets.length!=numStyles){setTimeout(arguments.callee,0);return;}jQuery.ready();})();}jQuery.event.add(window,"load",jQuery.ready);}jQuery.each(("blur,focus,load,resize,scroll,unload,click,dblclick,"+"mousedown,mouseup,mousemove,mouseover,mouseout,change,select,"+"submit,keydown,keypress,keyup,error").split(","),function(i,name){jQuery.fn[name]=function(fn){return fn?this.bind(name,fn):this.trigger(name);};});var withinElement=function(event,elem){var parent=event.relatedTarget;while(parent&&parent!=elem)try{parent=parent.parentNode;}catch(error){parent=elem;}return parent==elem;};jQuery(window).bind("unload",function(){jQuery("*").add(document).unbind();});jQuery.fn.extend({_load:jQuery.fn.load,load:function(url,params,callback){if(typeof url!='string')return this._load(url);var off=url.indexOf(" ");if(off>=0){var selector=url.slice(off,url.length);url=url.slice(0,off);}callback=callback||function(){};var type="GET";if(params)if(jQuery.isFunction(params)){callback=params;params=null;}else{params=jQuery.param(params);type="POST";}var self=this;jQuery.ajax({url:url,type:type,dataType:"html",data:params,complete:function(res,status){if(status=="success"||status=="notmodified")self.html(selector?jQuery("<div/>").append(res.responseText.replace(/<script(.|\s)*?\/script>/g,"")).find(selector):res.responseText);self.each(callback,[res.responseText,status,res]);}});return this;},serialize:function(){return jQuery.param(this.serializeArray());},serializeArray:function(){return this.map(function(){return jQuery.nodeName(this,"form")?jQuery.makeArray(this.elements):this;}).filter(function(){return this.name&&!this.disabled&&(this.checked||/select|textarea/i.test(this.nodeName)||/text|hidden|password/i.test(this.type));}).map(function(i,elem){var val=jQuery(this).val();return val==null?null:val.constructor==Array?jQuery.map(val,function(val,i){return{name:elem.name,value:val};}):{name:elem.name,value:val};}).get();}});jQuery.each("ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","),function(i,o){jQuery.fn[o]=function(f){return this.bind(o,f);};});var jsc=now();jQuery.extend({get:function(url,data,callback,type){if(jQuery.isFunction(data)){callback=data;data=null;}return jQuery.ajax({type:"GET",url:url,data:data,success:callback,dataType:type});},getScript:function(url,callback){return jQuery.get(url,null,callback,"script");},getJSON:function(url,data,callback){return jQuery.get(url,data,callback,"json");},post:function(url,data,callback,type){if(jQuery.isFunction(data)){callback=data;data={};}return jQuery.ajax({type:"POST",url:url,data:data,success:callback,dataType:type});},ajaxSetup:function(settings){jQuery.extend(jQuery.ajaxSettings,settings);},ajaxSettings:{url:location.href,global:true,type:"GET",timeout:0,contentType:"application/x-www-form-urlencoded",processData:true,async:true,data:null,username:null,password:null,accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},ajax:function(s){s=jQuery.extend(true,s,jQuery.extend(true,{},jQuery.ajaxSettings,s));var jsonp,jsre=/=\?(&|$)/g,status,data,type=s.type.toUpperCase();if(s.data&&s.processData&&typeof s.data!="string")s.data=jQuery.param(s.data);if(s.dataType=="jsonp"){if(type=="GET"){if(!s.url.match(jsre))s.url+=(s.url.match(/\?/)?"&":"?")+(s.jsonp||"callback")+"=?";}else if(!s.data||!s.data.match(jsre))s.data=(s.data?s.data+"&":"")+(s.jsonp||"callback")+"=?";s.dataType="json";}if(s.dataType=="json"&&(s.data&&s.data.match(jsre)||s.url.match(jsre))){jsonp="jsonp"+jsc++;if(s.data)s.data=(s.data+"").replace(jsre,"="+jsonp+"$1");s.url=s.url.replace(jsre,"="+jsonp+"$1");s.dataType="script";window[jsonp]=function(tmp){data=tmp;success();complete();window[jsonp]=undefined;try{delete window[jsonp];}catch(e){}if(head)head.removeChild(script);};}if(s.dataType=="script"&&s.cache==null)s.cache=false;if(s.cache===false&&type=="GET"){var ts=now();var ret=s.url.replace(/(\?|&)_=.*?(&|$)/,"$1_="+ts+"$2");s.url=ret+((ret==s.url)?(s.url.match(/\?/)?"&":"?")+"_="+ts:"");}if(s.data&&type=="GET"){s.url+=(s.url.match(/\?/)?"&":"?")+s.data;s.data=null;}if(s.global&&!jQuery.active++)jQuery.event.trigger("ajaxStart");var remote=/^(?:\w+:)?\/\/([^\/?#]+)/;if(s.dataType=="script"&&type=="GET"&&remote.test(s.url)&&remote.exec(s.url)[1]!=location.host){var head=document.getElementsByTagName("head")[0];var script=document.createElement("script");script.src=s.url;if(s.scriptCharset)script.charset=s.scriptCharset;if(!jsonp){var done=false;script.onload=script.onreadystatechange=function(){if(!done&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){done=true;success();complete();head.removeChild(script);}};}head.appendChild(script);return undefined;}var requestDone=false;var xhr=window.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest();if(s.username)xhr.open(type,s.url,s.async,s.username,s.password);else
-xhr.open(type,s.url,s.async);try{if(s.data)xhr.setRequestHeader("Content-Type",s.contentType);if(s.ifModified)xhr.setRequestHeader("If-Modified-Since",jQuery.lastModified[s.url]||"Thu, 01 Jan 1970 00:00:00 GMT");xhr.setRequestHeader("X-Requested-With","XMLHttpRequest");xhr.setRequestHeader("Accept",s.dataType&&s.accepts[s.dataType]?s.accepts[s.dataType]+", */*":s.accepts._default);}catch(e){}if(s.beforeSend&&s.beforeSend(xhr,s)===false){s.global&&jQuery.active--;xhr.abort();return false;}if(s.global)jQuery.event.trigger("ajaxSend",[xhr,s]);var onreadystatechange=function(isTimeout){if(!requestDone&&xhr&&(xhr.readyState==4||isTimeout=="timeout")){requestDone=true;if(ival){clearInterval(ival);ival=null;}status=isTimeout=="timeout"&&"timeout"||!jQuery.httpSuccess(xhr)&&"error"||s.ifModified&&jQuery.httpNotModified(xhr,s.url)&&"notmodified"||"success";if(status=="success"){try{data=jQuery.httpData(xhr,s.dataType,s.dataFilter);}catch(e){status="parsererror";}}if(status=="success"){var modRes;try{modRes=xhr.getResponseHeader("Last-Modified");}catch(e){}if(s.ifModified&&modRes)jQuery.lastModified[s.url]=modRes;if(!jsonp)success();}else
-jQuery.handleError(s,xhr,status);complete();if(s.async)xhr=null;}};if(s.async){var ival=setInterval(onreadystatechange,13);if(s.timeout>0)setTimeout(function(){if(xhr){xhr.abort();if(!requestDone)onreadystatechange("timeout");}},s.timeout);}try{xhr.send(s.data);}catch(e){jQuery.handleError(s,xhr,null,e);}if(!s.async)onreadystatechange();function success(){if(s.success)s.success(data,status);if(s.global)jQuery.event.trigger("ajaxSuccess",[xhr,s]);}function complete(){if(s.complete)s.complete(xhr,status);if(s.global)jQuery.event.trigger("ajaxComplete",[xhr,s]);if(s.global&&!--jQuery.active)jQuery.event.trigger("ajaxStop");}return xhr;},handleError:function(s,xhr,status,e){if(s.error)s.error(xhr,status,e);if(s.global)jQuery.event.trigger("ajaxError",[xhr,s,e]);},active:0,httpSuccess:function(xhr){try{return!xhr.status&&location.protocol=="file:"||(xhr.status>=200&&xhr.status<300)||xhr.status==304||xhr.status==1223||jQuery.browser.safari&&xhr.status==undefined;}catch(e){}return false;},httpNotModified:function(xhr,url){try{var xhrRes=xhr.getResponseHeader("Last-Modified");return xhr.status==304||xhrRes==jQuery.lastModified[url]||jQuery.browser.safari&&xhr.status==undefined;}catch(e){}return false;},httpData:function(xhr,type,filter){var ct=xhr.getResponseHeader("content-type"),xml=type=="xml"||!type&&ct&&ct.indexOf("xml")>=0,data=xml?xhr.responseXML:xhr.responseText;if(xml&&data.documentElement.tagName=="parsererror")throw"parsererror";if(filter)data=filter(data,type);if(type=="script")jQuery.globalEval(data);if(type=="json")data=eval("("+data+")");return data;},param:function(a){var s=[];if(a.constructor==Array||a.jquery)jQuery.each(a,function(){s.push(encodeURIComponent(this.name)+"="+encodeURIComponent(this.value));});else
-for(var j in a)if(a[j]&&a[j].constructor==Array)jQuery.each(a[j],function(){s.push(encodeURIComponent(j)+"="+encodeURIComponent(this));});else
-s.push(encodeURIComponent(j)+"="+encodeURIComponent(jQuery.isFunction(a[j])?a[j]():a[j]));return s.join("&").replace(/%20/g,"+");}});jQuery.fn.extend({show:function(speed,callback){return speed?this.animate({height:"show",width:"show",opacity:"show"},speed,callback):this.filter(":hidden").each(function(){this.style.display=this.oldblock||"";if(jQuery.css(this,"display")=="none"){var elem=jQuery("<"+this.tagName+" />").appendTo("body");this.style.display=elem.css("display");if(this.style.display=="none")this.style.display="block";elem.remove();}}).end();},hide:function(speed,callback){return speed?this.animate({height:"hide",width:"hide",opacity:"hide"},speed,callback):this.filter(":visible").each(function(){this.oldblock=this.oldblock||jQuery.css(this,"display");this.style.display="none";}).end();},_toggle:jQuery.fn.toggle,toggle:function(fn,fn2){return jQuery.isFunction(fn)&&jQuery.isFunction(fn2)?this._toggle.apply(this,arguments):fn?this.animate({height:"toggle",width:"toggle",opacity:"toggle"},fn,fn2):this.each(function(){jQuery(this)[jQuery(this).is(":hidden")?"show":"hide"]();});},slideDown:function(speed,callback){return this.animate({height:"show"},speed,callback);},slideUp:function(speed,callback){return this.animate({height:"hide"},speed,callback);},slideToggle:function(speed,callback){return this.animate({height:"toggle"},speed,callback);},fadeIn:function(speed,callback){return this.animate({opacity:"show"},speed,callback);},fadeOut:function(speed,callback){return this.animate({opacity:"hide"},speed,callback);},fadeTo:function(speed,to,callback){return this.animate({opacity:to},speed,callback);},animate:function(prop,speed,easing,callback){var optall=jQuery.speed(speed,easing,callback);return this[optall.queue===false?"each":"queue"](function(){if(this.nodeType!=1)return false;var opt=jQuery.extend({},optall),p,hidden=jQuery(this).is(":hidden"),self=this;for(p in prop){if(prop[p]=="hide"&&hidden||prop[p]=="show"&&!hidden)return opt.complete.call(this);if(p=="height"||p=="width"){opt.display=jQuery.css(this,"display");opt.overflow=this.style.overflow;}}if(opt.overflow!=null)this.style.overflow="hidden";opt.curAnim=jQuery.extend({},prop);jQuery.each(prop,function(name,val){var e=new jQuery.fx(self,opt,name);if(/toggle|show|hide/.test(val))e[val=="toggle"?hidden?"show":"hide":val](prop);else{var parts=val.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/),start=e.cur(true)||0;if(parts){var end=parseFloat(parts[2]),unit=parts[3]||"px";if(unit!="px"){self.style[name]=(end||1)+unit;start=((end||1)/e.cur(true))*start;self.style[name]=start+unit;}if(parts[1])end=((parts[1]=="-="?-1:1)*end)+start;e.custom(start,end,unit);}else
-e.custom(start,val,"");}});return true;});},queue:function(type,fn){if(jQuery.isFunction(type)||(type&&type.constructor==Array)){fn=type;type="fx";}if(!type||(typeof type=="string"&&!fn))return queue(this[0],type);return this.each(function(){if(fn.constructor==Array)queue(this,type,fn);else{queue(this,type).push(fn);if(queue(this,type).length==1)fn.call(this);}});},stop:function(clearQueue,gotoEnd){var timers=jQuery.timers;if(clearQueue)this.queue([]);this.each(function(){for(var i=timers.length-1;i>=0;i--)if(timers[i].elem==this){if(gotoEnd)timers[i](true);timers.splice(i,1);}});if(!gotoEnd)this.dequeue();return this;}});var queue=function(elem,type,array){if(elem){type=type||"fx";var q=jQuery.data(elem,type+"queue");if(!q||array)q=jQuery.data(elem,type+"queue",jQuery.makeArray(array));}return q;};jQuery.fn.dequeue=function(type){type=type||"fx";return this.each(function(){var q=queue(this,type);q.shift();if(q.length)q[0].call(this);});};jQuery.extend({speed:function(speed,easing,fn){var opt=speed&&speed.constructor==Object?speed:{complete:fn||!fn&&easing||jQuery.isFunction(speed)&&speed,duration:speed,easing:fn&&easing||easing&&easing.constructor!=Function&&easing};opt.duration=(opt.duration&&opt.duration.constructor==Number?opt.duration:jQuery.fx.speeds[opt.duration])||jQuery.fx.speeds.def;opt.old=opt.complete;opt.complete=function(){if(opt.queue!==false)jQuery(this).dequeue();if(jQuery.isFunction(opt.old))opt.old.call(this);};return opt;},easing:{linear:function(p,n,firstNum,diff){return firstNum+diff*p;},swing:function(p,n,firstNum,diff){return((-Math.cos(p*Math.PI)/2)+0.5)*diff+firstNum;}},timers:[],timerId:null,fx:function(elem,options,prop){this.options=options;this.elem=elem;this.prop=prop;if(!options.orig)options.orig={};}});jQuery.fx.prototype={update:function(){if(this.options.step)this.options.step.call(this.elem,this.now,this);(jQuery.fx.step[this.prop]||jQuery.fx.step._default)(this);if(this.prop=="height"||this.prop=="width")this.elem.style.display="block";},cur:function(force){if(this.elem[this.prop]!=null&&this.elem.style[this.prop]==null)return this.elem[this.prop];var r=parseFloat(jQuery.css(this.elem,this.prop,force));return r&&r>-10000?r:parseFloat(jQuery.curCSS(this.elem,this.prop))||0;},custom:function(from,to,unit){this.startTime=now();this.start=from;this.end=to;this.unit=unit||this.unit||"px";this.now=this.start;this.pos=this.state=0;this.update();var self=this;function t(gotoEnd){return self.step(gotoEnd);}t.elem=this.elem;jQuery.timers.push(t);if(jQuery.timerId==null){jQuery.timerId=setInterval(function(){var timers=jQuery.timers;for(var i=0;i<timers.length;i++)if(!timers[i]())timers.splice(i--,1);if(!timers.length){clearInterval(jQuery.timerId);jQuery.timerId=null;}},13);}},show:function(){this.options.orig[this.prop]=jQuery.attr(this.elem.style,this.prop);this.options.show=true;this.custom(0,this.cur());if(this.prop=="width"||this.prop=="height")this.elem.style[this.prop]="1px";jQuery(this.elem).show();},hide:function(){this.options.orig[this.prop]=jQuery.attr(this.elem.style,this.prop);this.options.hide=true;this.custom(this.cur(),0);},step:function(gotoEnd){var t=now();if(gotoEnd||t>this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;var done=true;for(var i in this.options.curAnim)if(this.options.curAnim[i]!==true)done=false;if(done){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;this.elem.style.display=this.options.display;if(jQuery.css(this.elem,"display")=="none")this.elem.style.display="block";}if(this.options.hide)this.elem.style.display="none";if(this.options.hide||this.options.show)for(var p in this.options.curAnim)jQuery.attr(this.elem.style,p,this.options.orig[p]);}if(done)this.options.complete.call(this.elem);return false;}else{var n=t-this.startTime;this.state=n/this.options.duration;this.pos=jQuery.easing[this.options.easing||(jQuery.easing.swing?"swing":"linear")](this.state,n,0,1,this.options.duration);this.now=this.start+((this.end-this.start)*this.pos);this.update();}return true;}};jQuery.extend(jQuery.fx,{speeds:{slow:600,fast:200,def:400},step:{scrollLeft:function(fx){fx.elem.scrollLeft=fx.now;},scrollTop:function(fx){fx.elem.scrollTop=fx.now;},opacity:function(fx){jQuery.attr(fx.elem.style,"opacity",fx.now);},_default:function(fx){fx.elem.style[fx.prop]=fx.now+fx.unit;}}});jQuery.fn.offset=function(){var left=0,top=0,elem=this[0],results;if(elem)with(jQuery.browser){var parent=elem.parentNode,offsetChild=elem,offsetParent=elem.offsetParent,doc=elem.ownerDocument,safari2=safari&&parseInt(version)<522&&!/adobeair/i.test(userAgent),css=jQuery.curCSS,fixed=css(elem,"position")=="fixed";if(elem.getBoundingClientRect){var box=elem.getBoundingClientRect();add(box.left+Math.max(doc.documentElement.scrollLeft,doc.body.scrollLeft),box.top+Math.max(doc.documentElement.scrollTop,doc.body.scrollTop));add(-doc.documentElement.clientLeft,-doc.documentElement.clientTop);}else{add(elem.offsetLeft,elem.offsetTop);while(offsetParent){add(offsetParent.offsetLeft,offsetParent.offsetTop);if(mozilla&&!/^t(able|d|h)$/i.test(offsetParent.tagName)||safari&&!safari2)border(offsetParent);if(!fixed&&css(offsetParent,"position")=="fixed")fixed=true;offsetChild=/^body$/i.test(offsetParent.tagName)?offsetChild:offsetParent;offsetParent=offsetParent.offsetParent;}while(parent&&parent.tagName&&!/^body|html$/i.test(parent.tagName)){if(!/^inline|table.*$/i.test(css(parent,"display")))add(-parent.scrollLeft,-parent.scrollTop);if(mozilla&&css(parent,"overflow")!="visible")border(parent);parent=parent.parentNode;}if((safari2&&(fixed||css(offsetChild,"position")=="absolute"))||(mozilla&&css(offsetChild,"position")!="absolute"))add(-doc.body.offsetLeft,-doc.body.offsetTop);if(fixed)add(Math.max(doc.documentElement.scrollLeft,doc.body.scrollLeft),Math.max(doc.documentElement.scrollTop,doc.body.scrollTop));}results={top:top,left:left};}function border(elem){add(jQuery.curCSS(elem,"borderLeftWidth",true),jQuery.curCSS(elem,"borderTopWidth",true));}function add(l,t){left+=parseInt(l,10)||0;top+=parseInt(t,10)||0;}return results;};jQuery.fn.extend({position:function(){var left=0,top=0,results;if(this[0]){var offsetParent=this.offsetParent(),offset=this.offset(),parentOffset=/^body|html$/i.test(offsetParent[0].tagName)?{top:0,left:0}:offsetParent.offset();offset.top-=num(this,'marginTop');offset.left-=num(this,'marginLeft');parentOffset.top+=num(offsetParent,'borderTopWidth');parentOffset.left+=num(offsetParent,'borderLeftWidth');results={top:offset.top-parentOffset.top,left:offset.left-parentOffset.left};}return results;},offsetParent:function(){var offsetParent=this[0].offsetParent;while(offsetParent&&(!/^body|html$/i.test(offsetParent.tagName)&&jQuery.css(offsetParent,'position')=='static'))offsetParent=offsetParent.offsetParent;return jQuery(offsetParent);}});jQuery.each(['Left','Top'],function(i,name){var method='scroll'+name;jQuery.fn[method]=function(val){if(!this[0])return;return val!=undefined?this.each(function(){this==window||this==document?window.scrollTo(!i?val:jQuery(window).scrollLeft(),i?val:jQuery(window).scrollTop()):this[method]=val;}):this[0]==window||this[0]==document?self[i?'pageYOffset':'pageXOffset']||jQuery.boxModel&&document.documentElement[method]||document.body[method]:this[0][method];};});jQuery.each(["Height","Width"],function(i,name){var tl=i?"Left":"Top",br=i?"Right":"Bottom";jQuery.fn["inner"+name]=function(){return this[name.toLowerCase()]()+num(this,"padding"+tl)+num(this,"padding"+br);};jQuery.fn["outer"+name]=function(margin){return this["inner"+name]()+num(this,"border"+tl+"Width")+num(this,"border"+br+"Width")+(margin?num(this,"margin"+tl)+num(this,"margin"+br):0);};});})();
-jQuery.noConflict();
+(function(A,w){function ma(){if(!c.isReady){try{s.documentElement.doScroll("left")}catch(a){setTimeout(ma,1);return}c.ready()}}function Qa(a,b){b.src?c.ajax({url:b.src,async:false,dataType:"script"}):c.globalEval(b.text||b.textContent||b.innerHTML||"");b.parentNode&&b.parentNode.removeChild(b)}function X(a,b,d,f,e,j){var i=a.length;if(typeof b==="object"){for(var o in b)X(a,o,b[o],f,e,d);return a}if(d!==w){f=!j&&f&&c.isFunction(d);for(o=0;o<i;o++)e(a[o],b,f?d.call(a[o],o,e(a[o],b)):d,j);return a}return i?
+e(a[0],b):w}function J(){return(new Date).getTime()}function Y(){return false}function Z(){return true}function na(a,b,d){d[0].type=a;return c.event.handle.apply(b,d)}function oa(a){var b,d=[],f=[],e=arguments,j,i,o,k,n,r;i=c.data(this,"events");if(!(a.liveFired===this||!i||!i.live||a.button&&a.type==="click")){a.liveFired=this;var u=i.live.slice(0);for(k=0;k<u.length;k++){i=u[k];i.origType.replace(O,"")===a.type?f.push(i.selector):u.splice(k--,1)}j=c(a.target).closest(f,a.currentTarget);n=0;for(r=
+j.length;n<r;n++)for(k=0;k<u.length;k++){i=u[k];if(j[n].selector===i.selector){o=j[n].elem;f=null;if(i.preType==="mouseenter"||i.preType==="mouseleave")f=c(a.relatedTarget).closest(i.selector)[0];if(!f||f!==o)d.push({elem:o,handleObj:i})}}n=0;for(r=d.length;n<r;n++){j=d[n];a.currentTarget=j.elem;a.data=j.handleObj.data;a.handleObj=j.handleObj;if(j.handleObj.origHandler.apply(j.elem,e)===false){b=false;break}}return b}}function pa(a,b){return"live."+(a&&a!=="*"?a+".":"")+b.replace(/\./g,"`").replace(/ /g,
+"&")}function qa(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function ra(a,b){var d=0;b.each(function(){if(this.nodeName===(a[d]&&a[d].nodeName)){var f=c.data(a[d++]),e=c.data(this,f);if(f=f&&f.events){delete e.handle;e.events={};for(var j in f)for(var i in f[j])c.event.add(this,j,f[j][i],f[j][i].data)}}})}function sa(a,b,d){var f,e,j;b=b&&b[0]?b[0].ownerDocument||b[0]:s;if(a.length===1&&typeof a[0]==="string"&&a[0].length<512&&b===s&&!ta.test(a[0])&&(c.support.checkClone||!ua.test(a[0]))){e=
+true;if(j=c.fragments[a[0]])if(j!==1)f=j}if(!f){f=b.createDocumentFragment();c.clean(a,b,f,d)}if(e)c.fragments[a[0]]=j?f:1;return{fragment:f,cacheable:e}}function K(a,b){var d={};c.each(va.concat.apply([],va.slice(0,b)),function(){d[this]=a});return d}function wa(a){return"scrollTo"in a&&a.document?a:a.nodeType===9?a.defaultView||a.parentWindow:false}var c=function(a,b){return new c.fn.init(a,b)},Ra=A.jQuery,Sa=A.$,s=A.document,T,Ta=/^[^<]*(<[\w\W]+>)[^>]*$|^#([\w-]+)$/,Ua=/^.[^:#\[\.,]*$/,Va=/\S/,
+Wa=/^(\s|\u00A0)+|(\s|\u00A0)+$/g,Xa=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,P=navigator.userAgent,xa=false,Q=[],L,$=Object.prototype.toString,aa=Object.prototype.hasOwnProperty,ba=Array.prototype.push,R=Array.prototype.slice,ya=Array.prototype.indexOf;c.fn=c.prototype={init:function(a,b){var d,f;if(!a)return this;if(a.nodeType){this.context=this[0]=a;this.length=1;return this}if(a==="body"&&!b){this.context=s;this[0]=s.body;this.selector="body";this.length=1;return this}if(typeof a==="string")if((d=Ta.exec(a))&&
+(d[1]||!b))if(d[1]){f=b?b.ownerDocument||b:s;if(a=Xa.exec(a))if(c.isPlainObject(b)){a=[s.createElement(a[1])];c.fn.attr.call(a,b,true)}else a=[f.createElement(a[1])];else{a=sa([d[1]],[f]);a=(a.cacheable?a.fragment.cloneNode(true):a.fragment).childNodes}return c.merge(this,a)}else{if(b=s.getElementById(d[2])){if(b.id!==d[2])return T.find(a);this.length=1;this[0]=b}this.context=s;this.selector=a;return this}else if(!b&&/^\w+$/.test(a)){this.selector=a;this.context=s;a=s.getElementsByTagName(a);return c.merge(this,
+a)}else return!b||b.jquery?(b||T).find(a):c(b).find(a);else if(c.isFunction(a))return T.ready(a);if(a.selector!==w){this.selector=a.selector;this.context=a.context}return c.makeArray(a,this)},selector:"",jquery:"1.4.2",length:0,size:function(){return this.length},toArray:function(){return R.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this.slice(a)[0]:this[a]},pushStack:function(a,b,d){var f=c();c.isArray(a)?ba.apply(f,a):c.merge(f,a);f.prevObject=this;f.context=this.context;if(b===
+"find")f.selector=this.selector+(this.selector?" ":"")+d;else if(b)f.selector=this.selector+"."+b+"("+d+")";return f},each:function(a,b){return c.each(this,a,b)},ready:function(a){c.bindReady();if(c.isReady)a.call(s,c);else Q&&Q.push(a);return this},eq:function(a){return a===-1?this.slice(a):this.slice(a,+a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(R.apply(this,arguments),"slice",R.call(arguments).join(","))},map:function(a){return this.pushStack(c.map(this,
+function(b,d){return a.call(b,d,b)}))},end:function(){return this.prevObject||c(null)},push:ba,sort:[].sort,splice:[].splice};c.fn.init.prototype=c.fn;c.extend=c.fn.extend=function(){var a=arguments[0]||{},b=1,d=arguments.length,f=false,e,j,i,o;if(typeof a==="boolean"){f=a;a=arguments[1]||{};b=2}if(typeof a!=="object"&&!c.isFunction(a))a={};if(d===b){a=this;--b}for(;b<d;b++)if((e=arguments[b])!=null)for(j in e){i=a[j];o=e[j];if(a!==o)if(f&&o&&(c.isPlainObject(o)||c.isArray(o))){i=i&&(c.isPlainObject(i)||
+c.isArray(i))?i:c.isArray(o)?[]:{};a[j]=c.extend(f,i,o)}else if(o!==w)a[j]=o}return a};c.extend({noConflict:function(a){A.$=Sa;if(a)A.jQuery=Ra;return c},isReady:false,ready:function(){if(!c.isReady){if(!s.body)return setTimeout(c.ready,13);c.isReady=true;if(Q){for(var a,b=0;a=Q[b++];)a.call(s,c);Q=null}c.fn.triggerHandler&&c(s).triggerHandler("ready")}},bindReady:function(){if(!xa){xa=true;if(s.readyState==="complete")return c.ready();if(s.addEventListener){s.addEventListener("DOMContentLoaded",
+L,false);A.addEventListener("load",c.ready,false)}else if(s.attachEvent){s.attachEvent("onreadystatechange",L);A.attachEvent("onload",c.ready);var a=false;try{a=A.frameElement==null}catch(b){}s.documentElement.doScroll&&a&&ma()}}},isFunction:function(a){return $.call(a)==="[object Function]"},isArray:function(a){return $.call(a)==="[object Array]"},isPlainObject:function(a){if(!a||$.call(a)!=="[object Object]"||a.nodeType||a.setInterval)return false;if(a.constructor&&!aa.call(a,"constructor")&&!aa.call(a.constructor.prototype,
+"isPrototypeOf"))return false;var b;for(b in a);return b===w||aa.call(a,b)},isEmptyObject:function(a){for(var b in a)return false;return true},error:function(a){throw a;},parseJSON:function(a){if(typeof a!=="string"||!a)return null;a=c.trim(a);if(/^[\],:{}\s]*$/.test(a.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))return A.JSON&&A.JSON.parse?A.JSON.parse(a):(new Function("return "+
+a))();else c.error("Invalid JSON: "+a)},noop:function(){},globalEval:function(a){if(a&&Va.test(a)){var b=s.getElementsByTagName("head")[0]||s.documentElement,d=s.createElement("script");d.type="text/javascript";if(c.support.scriptEval)d.appendChild(s.createTextNode(a));else d.text=a;b.insertBefore(d,b.firstChild);b.removeChild(d)}},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,b,d){var f,e=0,j=a.length,i=j===w||c.isFunction(a);if(d)if(i)for(f in a){if(b.apply(a[f],
+d)===false)break}else for(;e<j;){if(b.apply(a[e++],d)===false)break}else if(i)for(f in a){if(b.call(a[f],f,a[f])===false)break}else for(d=a[0];e<j&&b.call(d,e,d)!==false;d=a[++e]);return a},trim:function(a){return(a||"").replace(Wa,"")},makeArray:function(a,b){b=b||[];if(a!=null)a.length==null||typeof a==="string"||c.isFunction(a)||typeof a!=="function"&&a.setInterval?ba.call(b,a):c.merge(b,a);return b},inArray:function(a,b){if(b.indexOf)return b.indexOf(a);for(var d=0,f=b.length;d<f;d++)if(b[d]===
+a)return d;return-1},merge:function(a,b){var d=a.length,f=0;if(typeof b.length==="number")for(var e=b.length;f<e;f++)a[d++]=b[f];else for(;b[f]!==w;)a[d++]=b[f++];a.length=d;return a},grep:function(a,b,d){for(var f=[],e=0,j=a.length;e<j;e++)!d!==!b(a[e],e)&&f.push(a[e]);return f},map:function(a,b,d){for(var f=[],e,j=0,i=a.length;j<i;j++){e=b(a[j],j,d);if(e!=null)f[f.length]=e}return f.concat.apply([],f)},guid:1,proxy:function(a,b,d){if(arguments.length===2)if(typeof b==="string"){d=a;a=d[b];b=w}else if(b&&
+!c.isFunction(b)){d=b;b=w}if(!b&&a)b=function(){return a.apply(d||this,arguments)};if(a)b.guid=a.guid=a.guid||b.guid||c.guid++;return b},uaMatch:function(a){a=a.toLowerCase();a=/(webkit)[ \/]([\w.]+)/.exec(a)||/(opera)(?:.*version)?[ \/]([\w.]+)/.exec(a)||/(msie) ([\w.]+)/.exec(a)||!/compatible/.test(a)&&/(mozilla)(?:.*? rv:([\w.]+))?/.exec(a)||[];return{browser:a[1]||"",version:a[2]||"0"}},browser:{}});P=c.uaMatch(P);if(P.browser){c.browser[P.browser]=true;c.browser.version=P.version}if(c.browser.webkit)c.browser.safari=
+true;if(ya)c.inArray=function(a,b){return ya.call(b,a)};T=c(s);if(s.addEventListener)L=function(){s.removeEventListener("DOMContentLoaded",L,false);c.ready()};else if(s.attachEvent)L=function(){if(s.readyState==="complete"){s.detachEvent("onreadystatechange",L);c.ready()}};(function(){c.support={};var a=s.documentElement,b=s.createElement("script"),d=s.createElement("div"),f="script"+J();d.style.display="none";d.innerHTML="   <link/><table></table><a href='/a' style='color:red;float:left;opacity:.55;'>a</a><input type='checkbox'/>";
+var e=d.getElementsByTagName("*"),j=d.getElementsByTagName("a")[0];if(!(!e||!e.length||!j)){c.support={leadingWhitespace:d.firstChild.nodeType===3,tbody:!d.getElementsByTagName("tbody").length,htmlSerialize:!!d.getElementsByTagName("link").length,style:/red/.test(j.getAttribute("style")),hrefNormalized:j.getAttribute("href")==="/a",opacity:/^0.55$/.test(j.style.opacity),cssFloat:!!j.style.cssFloat,checkOn:d.getElementsByTagName("input")[0].value==="on",optSelected:s.createElement("select").appendChild(s.createElement("option")).selected,
+parentNode:d.removeChild(d.appendChild(s.createElement("div"))).parentNode===null,deleteExpando:true,checkClone:false,scriptEval:false,noCloneEvent:true,boxModel:null};b.type="text/javascript";try{b.appendChild(s.createTextNode("window."+f+"=1;"))}catch(i){}a.insertBefore(b,a.firstChild);if(A[f]){c.support.scriptEval=true;delete A[f]}try{delete b.test}catch(o){c.support.deleteExpando=false}a.removeChild(b);if(d.attachEvent&&d.fireEvent){d.attachEvent("onclick",function k(){c.support.noCloneEvent=
+false;d.detachEvent("onclick",k)});d.cloneNode(true).fireEvent("onclick")}d=s.createElement("div");d.innerHTML="<input type='radio' name='radiotest' checked='checked'/>";a=s.createDocumentFragment();a.appendChild(d.firstChild);c.support.checkClone=a.cloneNode(true).cloneNode(true).lastChild.checked;c(function(){var k=s.createElement("div");k.style.width=k.style.paddingLeft="1px";s.body.appendChild(k);c.boxModel=c.support.boxModel=k.offsetWidth===2;s.body.removeChild(k).style.display="none"});a=function(k){var n=
+s.createElement("div");k="on"+k;var r=k in n;if(!r){n.setAttribute(k,"return;");r=typeof n[k]==="function"}return r};c.support.submitBubbles=a("submit");c.support.changeBubbles=a("change");a=b=d=e=j=null}})();c.props={"for":"htmlFor","class":"className",readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",colspan:"colSpan",tabindex:"tabIndex",usemap:"useMap",frameborder:"frameBorder"};var G="jQuery"+J(),Ya=0,za={};c.extend({cache:{},expando:G,noData:{embed:true,object:true,
+applet:true},data:function(a,b,d){if(!(a.nodeName&&c.noData[a.nodeName.toLowerCase()])){a=a==A?za:a;var f=a[G],e=c.cache;if(!f&&typeof b==="string"&&d===w)return null;f||(f=++Ya);if(typeof b==="object"){a[G]=f;e[f]=c.extend(true,{},b)}else if(!e[f]){a[G]=f;e[f]={}}a=e[f];if(d!==w)a[b]=d;return typeof b==="string"?a[b]:a}},removeData:function(a,b){if(!(a.nodeName&&c.noData[a.nodeName.toLowerCase()])){a=a==A?za:a;var d=a[G],f=c.cache,e=f[d];if(b){if(e){delete e[b];c.isEmptyObject(e)&&c.removeData(a)}}else{if(c.support.deleteExpando)delete a[c.expando];
+else a.removeAttribute&&a.removeAttribute(c.expando);delete f[d]}}}});c.fn.extend({data:function(a,b){if(typeof a==="undefined"&&this.length)return c.data(this[0]);else if(typeof a==="object")return this.each(function(){c.data(this,a)});var d=a.split(".");d[1]=d[1]?"."+d[1]:"";if(b===w){var f=this.triggerHandler("getData"+d[1]+"!",[d[0]]);if(f===w&&this.length)f=c.data(this[0],a);return f===w&&d[1]?this.data(d[0]):f}else return this.trigger("setData"+d[1]+"!",[d[0],b]).each(function(){c.data(this,
+a,b)})},removeData:function(a){return this.each(function(){c.removeData(this,a)})}});c.extend({queue:function(a,b,d){if(a){b=(b||"fx")+"queue";var f=c.data(a,b);if(!d)return f||[];if(!f||c.isArray(d))f=c.data(a,b,c.makeArray(d));else f.push(d);return f}},dequeue:function(a,b){b=b||"fx";var d=c.queue(a,b),f=d.shift();if(f==="inprogress")f=d.shift();if(f){b==="fx"&&d.unshift("inprogress");f.call(a,function(){c.dequeue(a,b)})}}});c.fn.extend({queue:function(a,b){if(typeof a!=="string"){b=a;a="fx"}if(b===
+w)return c.queue(this[0],a);return this.each(function(){var d=c.queue(this,a,b);a==="fx"&&d[0]!=="inprogress"&&c.dequeue(this,a)})},dequeue:function(a){return this.each(function(){c.dequeue(this,a)})},delay:function(a,b){a=c.fx?c.fx.speeds[a]||a:a;b=b||"fx";return this.queue(b,function(){var d=this;setTimeout(function(){c.dequeue(d,b)},a)})},clearQueue:function(a){return this.queue(a||"fx",[])}});var Aa=/[\n\t]/g,ca=/\s+/,Za=/\r/g,$a=/href|src|style/,ab=/(button|input)/i,bb=/(button|input|object|select|textarea)/i,
+cb=/^(a|area)$/i,Ba=/radio|checkbox/;c.fn.extend({attr:function(a,b){return X(this,a,b,true,c.attr)},removeAttr:function(a){return this.each(function(){c.attr(this,a,"");this.nodeType===1&&this.removeAttribute(a)})},addClass:function(a){if(c.isFunction(a))return this.each(function(n){var r=c(this);r.addClass(a.call(this,n,r.attr("class")))});if(a&&typeof a==="string")for(var b=(a||"").split(ca),d=0,f=this.length;d<f;d++){var e=this[d];if(e.nodeType===1)if(e.className){for(var j=" "+e.className+" ",
+i=e.className,o=0,k=b.length;o<k;o++)if(j.indexOf(" "+b[o]+" ")<0)i+=" "+b[o];e.className=c.trim(i)}else e.className=a}return this},removeClass:function(a){if(c.isFunction(a))return this.each(function(k){var n=c(this);n.removeClass(a.call(this,k,n.attr("class")))});if(a&&typeof a==="string"||a===w)for(var b=(a||"").split(ca),d=0,f=this.length;d<f;d++){var e=this[d];if(e.nodeType===1&&e.className)if(a){for(var j=(" "+e.className+" ").replace(Aa," "),i=0,o=b.length;i<o;i++)j=j.replace(" "+b[i]+" ",
+" ");e.className=c.trim(j)}else e.className=""}return this},toggleClass:function(a,b){var d=typeof a,f=typeof b==="boolean";if(c.isFunction(a))return this.each(function(e){var j=c(this);j.toggleClass(a.call(this,e,j.attr("class"),b),b)});return this.each(function(){if(d==="string")for(var e,j=0,i=c(this),o=b,k=a.split(ca);e=k[j++];){o=f?o:!i.hasClass(e);i[o?"addClass":"removeClass"](e)}else if(d==="undefined"||d==="boolean"){this.className&&c.data(this,"__className__",this.className);this.className=
+this.className||a===false?"":c.data(this,"__className__")||""}})},hasClass:function(a){a=" "+a+" ";for(var b=0,d=this.length;b<d;b++)if((" "+this[b].className+" ").replace(Aa," ").indexOf(a)>-1)return true;return false},val:function(a){if(a===w){var b=this[0];if(b){if(c.nodeName(b,"option"))return(b.attributes.value||{}).specified?b.value:b.text;if(c.nodeName(b,"select")){var d=b.selectedIndex,f=[],e=b.options;b=b.type==="select-one";if(d<0)return null;var j=b?d:0;for(d=b?d+1:e.length;j<d;j++){var i=
+e[j];if(i.selected){a=c(i).val();if(b)return a;f.push(a)}}return f}if(Ba.test(b.type)&&!c.support.checkOn)return b.getAttribute("value")===null?"on":b.value;return(b.value||"").replace(Za,"")}return w}var o=c.isFunction(a);return this.each(function(k){var n=c(this),r=a;if(this.nodeType===1){if(o)r=a.call(this,k,n.val());if(typeof r==="number")r+="";if(c.isArray(r)&&Ba.test(this.type))this.checked=c.inArray(n.val(),r)>=0;else if(c.nodeName(this,"select")){var u=c.makeArray(r);c("option",this).each(function(){this.selected=
+c.inArray(c(this).val(),u)>=0});if(!u.length)this.selectedIndex=-1}else this.value=r}})}});c.extend({attrFn:{val:true,css:true,html:true,text:true,data:true,width:true,height:true,offset:true},attr:function(a,b,d,f){if(!a||a.nodeType===3||a.nodeType===8)return w;if(f&&b in c.attrFn)return c(a)[b](d);f=a.nodeType!==1||!c.isXMLDoc(a);var e=d!==w;b=f&&c.props[b]||b;if(a.nodeType===1){var j=$a.test(b);if(b in a&&f&&!j){if(e){b==="type"&&ab.test(a.nodeName)&&a.parentNode&&c.error("type property can't be changed");
+a[b]=d}if(c.nodeName(a,"form")&&a.getAttributeNode(b))return a.getAttributeNode(b).nodeValue;if(b==="tabIndex")return(b=a.getAttributeNode("tabIndex"))&&b.specified?b.value:bb.test(a.nodeName)||cb.test(a.nodeName)&&a.href?0:w;return a[b]}if(!c.support.style&&f&&b==="style"){if(e)a.style.cssText=""+d;return a.style.cssText}e&&a.setAttribute(b,""+d);a=!c.support.hrefNormalized&&f&&j?a.getAttribute(b,2):a.getAttribute(b);return a===null?w:a}return c.style(a,b,d)}});var O=/\.(.*)$/,db=function(a){return a.replace(/[^\w\s\.\|`]/g,
+function(b){return"\\"+b})};c.event={add:function(a,b,d,f){if(!(a.nodeType===3||a.nodeType===8)){if(a.setInterval&&a!==A&&!a.frameElement)a=A;var e,j;if(d.handler){e=d;d=e.handler}if(!d.guid)d.guid=c.guid++;if(j=c.data(a)){var i=j.events=j.events||{},o=j.handle;if(!o)j.handle=o=function(){return typeof c!=="undefined"&&!c.event.triggered?c.event.handle.apply(o.elem,arguments):w};o.elem=a;b=b.split(" ");for(var k,n=0,r;k=b[n++];){j=e?c.extend({},e):{handler:d,data:f};if(k.indexOf(".")>-1){r=k.split(".");
+k=r.shift();j.namespace=r.slice(0).sort().join(".")}else{r=[];j.namespace=""}j.type=k;j.guid=d.guid;var u=i[k],z=c.event.special[k]||{};if(!u){u=i[k]=[];if(!z.setup||z.setup.call(a,f,r,o)===false)if(a.addEventListener)a.addEventListener(k,o,false);else a.attachEvent&&a.attachEvent("on"+k,o)}if(z.add){z.add.call(a,j);if(!j.handler.guid)j.handler.guid=d.guid}u.push(j);c.event.global[k]=true}a=null}}},global:{},remove:function(a,b,d,f){if(!(a.nodeType===3||a.nodeType===8)){var e,j=0,i,o,k,n,r,u,z=c.data(a),
+C=z&&z.events;if(z&&C){if(b&&b.type){d=b.handler;b=b.type}if(!b||typeof b==="string"&&b.charAt(0)==="."){b=b||"";for(e in C)c.event.remove(a,e+b)}else{for(b=b.split(" ");e=b[j++];){n=e;i=e.indexOf(".")<0;o=[];if(!i){o=e.split(".");e=o.shift();k=new RegExp("(^|\\.)"+c.map(o.slice(0).sort(),db).join("\\.(?:.*\\.)?")+"(\\.|$)")}if(r=C[e])if(d){n=c.event.special[e]||{};for(B=f||0;B<r.length;B++){u=r[B];if(d.guid===u.guid){if(i||k.test(u.namespace)){f==null&&r.splice(B--,1);n.remove&&n.remove.call(a,u)}if(f!=
+null)break}}if(r.length===0||f!=null&&r.length===1){if(!n.teardown||n.teardown.call(a,o)===false)Ca(a,e,z.handle);delete C[e]}}else for(var B=0;B<r.length;B++){u=r[B];if(i||k.test(u.namespace)){c.event.remove(a,n,u.handler,B);r.splice(B--,1)}}}if(c.isEmptyObject(C)){if(b=z.handle)b.elem=null;delete z.events;delete z.handle;c.isEmptyObject(z)&&c.removeData(a)}}}}},trigger:function(a,b,d,f){var e=a.type||a;if(!f){a=typeof a==="object"?a[G]?a:c.extend(c.Event(e),a):c.Event(e);if(e.indexOf("!")>=0){a.type=
+e=e.slice(0,-1);a.exclusive=true}if(!d){a.stopPropagation();c.event.global[e]&&c.each(c.cache,function(){this.events&&this.events[e]&&c.event.trigger(a,b,this.handle.elem)})}if(!d||d.nodeType===3||d.nodeType===8)return w;a.result=w;a.target=d;b=c.makeArray(b);b.unshift(a)}a.currentTarget=d;(f=c.data(d,"handle"))&&f.apply(d,b);f=d.parentNode||d.ownerDocument;try{if(!(d&&d.nodeName&&c.noData[d.nodeName.toLowerCase()]))if(d["on"+e]&&d["on"+e].apply(d,b)===false)a.result=false}catch(j){}if(!a.isPropagationStopped()&&
+f)c.event.trigger(a,b,f,true);else if(!a.isDefaultPrevented()){f=a.target;var i,o=c.nodeName(f,"a")&&e==="click",k=c.event.special[e]||{};if((!k._default||k._default.call(d,a)===false)&&!o&&!(f&&f.nodeName&&c.noData[f.nodeName.toLowerCase()])){try{if(f[e]){if(i=f["on"+e])f["on"+e]=null;c.event.triggered=true;f[e]()}}catch(n){}if(i)f["on"+e]=i;c.event.triggered=false}}},handle:function(a){var b,d,f,e;a=arguments[0]=c.event.fix(a||A.event);a.currentTarget=this;b=a.type.indexOf(".")<0&&!a.exclusive;
+if(!b){d=a.type.split(".");a.type=d.shift();f=new RegExp("(^|\\.)"+d.slice(0).sort().join("\\.(?:.*\\.)?")+"(\\.|$)")}e=c.data(this,"events");d=e[a.type];if(e&&d){d=d.slice(0);e=0;for(var j=d.length;e<j;e++){var i=d[e];if(b||f.test(i.namespace)){a.handler=i.handler;a.data=i.data;a.handleObj=i;i=i.handler.apply(this,arguments);if(i!==w){a.result=i;if(i===false){a.preventDefault();a.stopPropagation()}}if(a.isImmediatePropagationStopped())break}}}return a.result},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),
+fix:function(a){if(a[G])return a;var b=a;a=c.Event(b);for(var d=this.props.length,f;d;){f=this.props[--d];a[f]=b[f]}if(!a.target)a.target=a.srcElement||s;if(a.target.nodeType===3)a.target=a.target.parentNode;if(!a.relatedTarget&&a.fromElement)a.relatedTarget=a.fromElement===a.target?a.toElement:a.fromElement;if(a.pageX==null&&a.clientX!=null){b=s.documentElement;d=s.body;a.pageX=a.clientX+(b&&b.scrollLeft||d&&d.scrollLeft||0)-(b&&b.clientLeft||d&&d.clientLeft||0);a.pageY=a.clientY+(b&&b.scrollTop||
+d&&d.scrollTop||0)-(b&&b.clientTop||d&&d.clientTop||0)}if(!a.which&&(a.charCode||a.charCode===0?a.charCode:a.keyCode))a.which=a.charCode||a.keyCode;if(!a.metaKey&&a.ctrlKey)a.metaKey=a.ctrlKey;if(!a.which&&a.button!==w)a.which=a.button&1?1:a.button&2?3:a.button&4?2:0;return a},guid:1E8,proxy:c.proxy,special:{ready:{setup:c.bindReady,teardown:c.noop},live:{add:function(a){c.event.add(this,a.origType,c.extend({},a,{handler:oa}))},remove:function(a){var b=true,d=a.origType.replace(O,"");c.each(c.data(this,
+"events").live||[],function(){if(d===this.origType.replace(O,""))return b=false});b&&c.event.remove(this,a.origType,oa)}},beforeunload:{setup:function(a,b,d){if(this.setInterval)this.onbeforeunload=d;return false},teardown:function(a,b){if(this.onbeforeunload===b)this.onbeforeunload=null}}}};var Ca=s.removeEventListener?function(a,b,d){a.removeEventListener(b,d,false)}:function(a,b,d){a.detachEvent("on"+b,d)};c.Event=function(a){if(!this.preventDefault)return new c.Event(a);if(a&&a.type){this.originalEvent=
+a;this.type=a.type}else this.type=a;this.timeStamp=J();this[G]=true};c.Event.prototype={preventDefault:function(){this.isDefaultPrevented=Z;var a=this.originalEvent;if(a){a.preventDefault&&a.preventDefault();a.returnValue=false}},stopPropagation:function(){this.isPropagationStopped=Z;var a=this.originalEvent;if(a){a.stopPropagation&&a.stopPropagation();a.cancelBubble=true}},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=Z;this.stopPropagation()},isDefaultPrevented:Y,isPropagationStopped:Y,
+isImmediatePropagationStopped:Y};var Da=function(a){var b=a.relatedTarget;try{for(;b&&b!==this;)b=b.parentNode;if(b!==this){a.type=a.data;c.event.handle.apply(this,arguments)}}catch(d){}},Ea=function(a){a.type=a.data;c.event.handle.apply(this,arguments)};c.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(a,b){c.event.special[a]={setup:function(d){c.event.add(this,b,d&&d.selector?Ea:Da,a)},teardown:function(d){c.event.remove(this,b,d&&d.selector?Ea:Da)}}});if(!c.support.submitBubbles)c.event.special.submit=
+{setup:function(){if(this.nodeName.toLowerCase()!=="form"){c.event.add(this,"click.specialSubmit",function(a){var b=a.target,d=b.type;if((d==="submit"||d==="image")&&c(b).closest("form").length)return na("submit",this,arguments)});c.event.add(this,"keypress.specialSubmit",function(a){var b=a.target,d=b.type;if((d==="text"||d==="password")&&c(b).closest("form").length&&a.keyCode===13)return na("submit",this,arguments)})}else return false},teardown:function(){c.event.remove(this,".specialSubmit")}};
+if(!c.support.changeBubbles){var da=/textarea|input|select/i,ea,Fa=function(a){var b=a.type,d=a.value;if(b==="radio"||b==="checkbox")d=a.checked;else if(b==="select-multiple")d=a.selectedIndex>-1?c.map(a.options,function(f){return f.selected}).join("-"):"";else if(a.nodeName.toLowerCase()==="select")d=a.selectedIndex;return d},fa=function(a,b){var d=a.target,f,e;if(!(!da.test(d.nodeName)||d.readOnly)){f=c.data(d,"_change_data");e=Fa(d);if(a.type!=="focusout"||d.type!=="radio")c.data(d,"_change_data",
+e);if(!(f===w||e===f))if(f!=null||e){a.type="change";return c.event.trigger(a,b,d)}}};c.event.special.change={filters:{focusout:fa,click:function(a){var b=a.target,d=b.type;if(d==="radio"||d==="checkbox"||b.nodeName.toLowerCase()==="select")return fa.call(this,a)},keydown:function(a){var b=a.target,d=b.type;if(a.keyCode===13&&b.nodeName.toLowerCase()!=="textarea"||a.keyCode===32&&(d==="checkbox"||d==="radio")||d==="select-multiple")return fa.call(this,a)},beforeactivate:function(a){a=a.target;c.data(a,
+"_change_data",Fa(a))}},setup:function(){if(this.type==="file")return false;for(var a in ea)c.event.add(this,a+".specialChange",ea[a]);return da.test(this.nodeName)},teardown:function(){c.event.remove(this,".specialChange");return da.test(this.nodeName)}};ea=c.event.special.change.filters}s.addEventListener&&c.each({focus:"focusin",blur:"focusout"},function(a,b){function d(f){f=c.event.fix(f);f.type=b;return c.event.handle.call(this,f)}c.event.special[b]={setup:function(){this.addEventListener(a,
+d,true)},teardown:function(){this.removeEventListener(a,d,true)}}});c.each(["bind","one"],function(a,b){c.fn[b]=function(d,f,e){if(typeof d==="object"){for(var j in d)this[b](j,f,d[j],e);return this}if(c.isFunction(f)){e=f;f=w}var i=b==="one"?c.proxy(e,function(k){c(this).unbind(k,i);return e.apply(this,arguments)}):e;if(d==="unload"&&b!=="one")this.one(d,f,e);else{j=0;for(var o=this.length;j<o;j++)c.event.add(this[j],d,i,f)}return this}});c.fn.extend({unbind:function(a,b){if(typeof a==="object"&&
+!a.preventDefault)for(var d in a)this.unbind(d,a[d]);else{d=0;for(var f=this.length;d<f;d++)c.event.remove(this[d],a,b)}return this},delegate:function(a,b,d,f){return this.live(b,d,f,a)},undelegate:function(a,b,d){return arguments.length===0?this.unbind("live"):this.die(b,null,d,a)},trigger:function(a,b){return this.each(function(){c.event.trigger(a,b,this)})},triggerHandler:function(a,b){if(this[0]){a=c.Event(a);a.preventDefault();a.stopPropagation();c.event.trigger(a,b,this[0]);return a.result}},
+toggle:function(a){for(var b=arguments,d=1;d<b.length;)c.proxy(a,b[d++]);return this.click(c.proxy(a,function(f){var e=(c.data(this,"lastToggle"+a.guid)||0)%d;c.data(this,"lastToggle"+a.guid,e+1);f.preventDefault();return b[e].apply(this,arguments)||false}))},hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}});var Ga={focus:"focusin",blur:"focusout",mouseenter:"mouseover",mouseleave:"mouseout"};c.each(["live","die"],function(a,b){c.fn[b]=function(d,f,e,j){var i,o=0,k,n,r=j||this.selector,
+u=j?this:c(this.context);if(c.isFunction(f)){e=f;f=w}for(d=(d||"").split(" ");(i=d[o++])!=null;){j=O.exec(i);k="";if(j){k=j[0];i=i.replace(O,"")}if(i==="hover")d.push("mouseenter"+k,"mouseleave"+k);else{n=i;if(i==="focus"||i==="blur"){d.push(Ga[i]+k);i+=k}else i=(Ga[i]||i)+k;b==="live"?u.each(function(){c.event.add(this,pa(i,r),{data:f,selector:r,handler:e,origType:i,origHandler:e,preType:n})}):u.unbind(pa(i,r),e)}}return this}});c.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error".split(" "),
+function(a,b){c.fn[b]=function(d){return d?this.bind(b,d):this.trigger(b)};if(c.attrFn)c.attrFn[b]=true});A.attachEvent&&!A.addEventListener&&A.attachEvent("onunload",function(){for(var a in c.cache)if(c.cache[a].handle)try{c.event.remove(c.cache[a].handle.elem)}catch(b){}});(function(){function a(g){for(var h="",l,m=0;g[m];m++){l=g[m];if(l.nodeType===3||l.nodeType===4)h+=l.nodeValue;else if(l.nodeType!==8)h+=a(l.childNodes)}return h}function b(g,h,l,m,q,p){q=0;for(var v=m.length;q<v;q++){var t=m[q];
+if(t){t=t[g];for(var y=false;t;){if(t.sizcache===l){y=m[t.sizset];break}if(t.nodeType===1&&!p){t.sizcache=l;t.sizset=q}if(t.nodeName.toLowerCase()===h){y=t;break}t=t[g]}m[q]=y}}}function d(g,h,l,m,q,p){q=0;for(var v=m.length;q<v;q++){var t=m[q];if(t){t=t[g];for(var y=false;t;){if(t.sizcache===l){y=m[t.sizset];break}if(t.nodeType===1){if(!p){t.sizcache=l;t.sizset=q}if(typeof h!=="string"){if(t===h){y=true;break}}else if(k.filter(h,[t]).length>0){y=t;break}}t=t[g]}m[q]=y}}}var f=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,
+e=0,j=Object.prototype.toString,i=false,o=true;[0,0].sort(function(){o=false;return 0});var k=function(g,h,l,m){l=l||[];var q=h=h||s;if(h.nodeType!==1&&h.nodeType!==9)return[];if(!g||typeof g!=="string")return l;for(var p=[],v,t,y,S,H=true,M=x(h),I=g;(f.exec(""),v=f.exec(I))!==null;){I=v[3];p.push(v[1]);if(v[2]){S=v[3];break}}if(p.length>1&&r.exec(g))if(p.length===2&&n.relative[p[0]])t=ga(p[0]+p[1],h);else for(t=n.relative[p[0]]?[h]:k(p.shift(),h);p.length;){g=p.shift();if(n.relative[g])g+=p.shift();
+t=ga(g,t)}else{if(!m&&p.length>1&&h.nodeType===9&&!M&&n.match.ID.test(p[0])&&!n.match.ID.test(p[p.length-1])){v=k.find(p.shift(),h,M);h=v.expr?k.filter(v.expr,v.set)[0]:v.set[0]}if(h){v=m?{expr:p.pop(),set:z(m)}:k.find(p.pop(),p.length===1&&(p[0]==="~"||p[0]==="+")&&h.parentNode?h.parentNode:h,M);t=v.expr?k.filter(v.expr,v.set):v.set;if(p.length>0)y=z(t);else H=false;for(;p.length;){var D=p.pop();v=D;if(n.relative[D])v=p.pop();else D="";if(v==null)v=h;n.relative[D](y,v,M)}}else y=[]}y||(y=t);y||k.error(D||
+g);if(j.call(y)==="[object Array]")if(H)if(h&&h.nodeType===1)for(g=0;y[g]!=null;g++){if(y[g]&&(y[g]===true||y[g].nodeType===1&&E(h,y[g])))l.push(t[g])}else for(g=0;y[g]!=null;g++)y[g]&&y[g].nodeType===1&&l.push(t[g]);else l.push.apply(l,y);else z(y,l);if(S){k(S,q,l,m);k.uniqueSort(l)}return l};k.uniqueSort=function(g){if(B){i=o;g.sort(B);if(i)for(var h=1;h<g.length;h++)g[h]===g[h-1]&&g.splice(h--,1)}return g};k.matches=function(g,h){return k(g,null,null,h)};k.find=function(g,h,l){var m,q;if(!g)return[];
+for(var p=0,v=n.order.length;p<v;p++){var t=n.order[p];if(q=n.leftMatch[t].exec(g)){var y=q[1];q.splice(1,1);if(y.substr(y.length-1)!=="\\"){q[1]=(q[1]||"").replace(/\\/g,"");m=n.find[t](q,h,l);if(m!=null){g=g.replace(n.match[t],"");break}}}}m||(m=h.getElementsByTagName("*"));return{set:m,expr:g}};k.filter=function(g,h,l,m){for(var q=g,p=[],v=h,t,y,S=h&&h[0]&&x(h[0]);g&&h.length;){for(var H in n.filter)if((t=n.leftMatch[H].exec(g))!=null&&t[2]){var M=n.filter[H],I,D;D=t[1];y=false;t.splice(1,1);if(D.substr(D.length-
+1)!=="\\"){if(v===p)p=[];if(n.preFilter[H])if(t=n.preFilter[H](t,v,l,p,m,S)){if(t===true)continue}else y=I=true;if(t)for(var U=0;(D=v[U])!=null;U++)if(D){I=M(D,t,U,v);var Ha=m^!!I;if(l&&I!=null)if(Ha)y=true;else v[U]=false;else if(Ha){p.push(D);y=true}}if(I!==w){l||(v=p);g=g.replace(n.match[H],"");if(!y)return[];break}}}if(g===q)if(y==null)k.error(g);else break;q=g}return v};k.error=function(g){throw"Syntax error, unrecognized expression: "+g;};var n=k.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF-]|\\.)+)/,
+CLASS:/\.((?:[\w\u00c0-\uFFFF-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(g){return g.getAttribute("href")}},
+relative:{"+":function(g,h){var l=typeof h==="string",m=l&&!/\W/.test(h);l=l&&!m;if(m)h=h.toLowerCase();m=0;for(var q=g.length,p;m<q;m++)if(p=g[m]){for(;(p=p.previousSibling)&&p.nodeType!==1;);g[m]=l||p&&p.nodeName.toLowerCase()===h?p||false:p===h}l&&k.filter(h,g,true)},">":function(g,h){var l=typeof h==="string";if(l&&!/\W/.test(h)){h=h.toLowerCase();for(var m=0,q=g.length;m<q;m++){var p=g[m];if(p){l=p.parentNode;g[m]=l.nodeName.toLowerCase()===h?l:false}}}else{m=0;for(q=g.length;m<q;m++)if(p=g[m])g[m]=
+l?p.parentNode:p.parentNode===h;l&&k.filter(h,g,true)}},"":function(g,h,l){var m=e++,q=d;if(typeof h==="string"&&!/\W/.test(h)){var p=h=h.toLowerCase();q=b}q("parentNode",h,m,g,p,l)},"~":function(g,h,l){var m=e++,q=d;if(typeof h==="string"&&!/\W/.test(h)){var p=h=h.toLowerCase();q=b}q("previousSibling",h,m,g,p,l)}},find:{ID:function(g,h,l){if(typeof h.getElementById!=="undefined"&&!l)return(g=h.getElementById(g[1]))?[g]:[]},NAME:function(g,h){if(typeof h.getElementsByName!=="undefined"){var l=[];
+h=h.getElementsByName(g[1]);for(var m=0,q=h.length;m<q;m++)h[m].getAttribute("name")===g[1]&&l.push(h[m]);return l.length===0?null:l}},TAG:function(g,h){return h.getElementsByTagName(g[1])}},preFilter:{CLASS:function(g,h,l,m,q,p){g=" "+g[1].replace(/\\/g,"")+" ";if(p)return g;p=0;for(var v;(v=h[p])!=null;p++)if(v)if(q^(v.className&&(" "+v.className+" ").replace(/[\t\n]/g," ").indexOf(g)>=0))l||m.push(v);else if(l)h[p]=false;return false},ID:function(g){return g[1].replace(/\\/g,"")},TAG:function(g){return g[1].toLowerCase()},
+CHILD:function(g){if(g[1]==="nth"){var h=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(g[2]==="even"&&"2n"||g[2]==="odd"&&"2n+1"||!/\D/.test(g[2])&&"0n+"+g[2]||g[2]);g[2]=h[1]+(h[2]||1)-0;g[3]=h[3]-0}g[0]=e++;return g},ATTR:function(g,h,l,m,q,p){h=g[1].replace(/\\/g,"");if(!p&&n.attrMap[h])g[1]=n.attrMap[h];if(g[2]==="~=")g[4]=" "+g[4]+" ";return g},PSEUDO:function(g,h,l,m,q){if(g[1]==="not")if((f.exec(g[3])||"").length>1||/^\w/.test(g[3]))g[3]=k(g[3],null,null,h);else{g=k.filter(g[3],h,l,true^q);l||m.push.apply(m,
+g);return false}else if(n.match.POS.test(g[0])||n.match.CHILD.test(g[0]))return true;return g},POS:function(g){g.unshift(true);return g}},filters:{enabled:function(g){return g.disabled===false&&g.type!=="hidden"},disabled:function(g){return g.disabled===true},checked:function(g){return g.checked===true},selected:function(g){return g.selected===true},parent:function(g){return!!g.firstChild},empty:function(g){return!g.firstChild},has:function(g,h,l){return!!k(l[3],g).length},header:function(g){return/h\d/i.test(g.nodeName)},
+text:function(g){return"text"===g.type},radio:function(g){return"radio"===g.type},checkbox:function(g){return"checkbox"===g.type},file:function(g){return"file"===g.type},password:function(g){return"password"===g.type},submit:function(g){return"submit"===g.type},image:function(g){return"image"===g.type},reset:function(g){return"reset"===g.type},button:function(g){return"button"===g.type||g.nodeName.toLowerCase()==="button"},input:function(g){return/input|select|textarea|button/i.test(g.nodeName)}},
+setFilters:{first:function(g,h){return h===0},last:function(g,h,l,m){return h===m.length-1},even:function(g,h){return h%2===0},odd:function(g,h){return h%2===1},lt:function(g,h,l){return h<l[3]-0},gt:function(g,h,l){return h>l[3]-0},nth:function(g,h,l){return l[3]-0===h},eq:function(g,h,l){return l[3]-0===h}},filter:{PSEUDO:function(g,h,l,m){var q=h[1],p=n.filters[q];if(p)return p(g,l,h,m);else if(q==="contains")return(g.textContent||g.innerText||a([g])||"").indexOf(h[3])>=0;else if(q==="not"){h=
+h[3];l=0;for(m=h.length;l<m;l++)if(h[l]===g)return false;return true}else k.error("Syntax error, unrecognized expression: "+q)},CHILD:function(g,h){var l=h[1],m=g;switch(l){case "only":case "first":for(;m=m.previousSibling;)if(m.nodeType===1)return false;if(l==="first")return true;m=g;case "last":for(;m=m.nextSibling;)if(m.nodeType===1)return false;return true;case "nth":l=h[2];var q=h[3];if(l===1&&q===0)return true;h=h[0];var p=g.parentNode;if(p&&(p.sizcache!==h||!g.nodeIndex)){var v=0;for(m=p.firstChild;m;m=
+m.nextSibling)if(m.nodeType===1)m.nodeIndex=++v;p.sizcache=h}g=g.nodeIndex-q;return l===0?g===0:g%l===0&&g/l>=0}},ID:function(g,h){return g.nodeType===1&&g.getAttribute("id")===h},TAG:function(g,h){return h==="*"&&g.nodeType===1||g.nodeName.toLowerCase()===h},CLASS:function(g,h){return(" "+(g.className||g.getAttribute("class"))+" ").indexOf(h)>-1},ATTR:function(g,h){var l=h[1];g=n.attrHandle[l]?n.attrHandle[l](g):g[l]!=null?g[l]:g.getAttribute(l);l=g+"";var m=h[2];h=h[4];return g==null?m==="!=":m===
+"="?l===h:m==="*="?l.indexOf(h)>=0:m==="~="?(" "+l+" ").indexOf(h)>=0:!h?l&&g!==false:m==="!="?l!==h:m==="^="?l.indexOf(h)===0:m==="$="?l.substr(l.length-h.length)===h:m==="|="?l===h||l.substr(0,h.length+1)===h+"-":false},POS:function(g,h,l,m){var q=n.setFilters[h[2]];if(q)return q(g,l,h,m)}}},r=n.match.POS;for(var u in n.match){n.match[u]=new RegExp(n.match[u].source+/(?![^\[]*\])(?![^\(]*\))/.source);n.leftMatch[u]=new RegExp(/(^(?:.|\r|\n)*?)/.source+n.match[u].source.replace(/\\(\d+)/g,function(g,
+h){return"\\"+(h-0+1)}))}var z=function(g,h){g=Array.prototype.slice.call(g,0);if(h){h.push.apply(h,g);return h}return g};try{Array.prototype.slice.call(s.documentElement.childNodes,0)}catch(C){z=function(g,h){h=h||[];if(j.call(g)==="[object Array]")Array.prototype.push.apply(h,g);else if(typeof g.length==="number")for(var l=0,m=g.length;l<m;l++)h.push(g[l]);else for(l=0;g[l];l++)h.push(g[l]);return h}}var B;if(s.documentElement.compareDocumentPosition)B=function(g,h){if(!g.compareDocumentPosition||
+!h.compareDocumentPosition){if(g==h)i=true;return g.compareDocumentPosition?-1:1}g=g.compareDocumentPosition(h)&4?-1:g===h?0:1;if(g===0)i=true;return g};else if("sourceIndex"in s.documentElement)B=function(g,h){if(!g.sourceIndex||!h.sourceIndex){if(g==h)i=true;return g.sourceIndex?-1:1}g=g.sourceIndex-h.sourceIndex;if(g===0)i=true;return g};else if(s.createRange)B=function(g,h){if(!g.ownerDocument||!h.ownerDocument){if(g==h)i=true;return g.ownerDocument?-1:1}var l=g.ownerDocument.createRange(),m=
+h.ownerDocument.createRange();l.setStart(g,0);l.setEnd(g,0);m.setStart(h,0);m.setEnd(h,0);g=l.compareBoundaryPoints(Range.START_TO_END,m);if(g===0)i=true;return g};(function(){var g=s.createElement("div"),h="script"+(new Date).getTime();g.innerHTML="<a name='"+h+"'/>";var l=s.documentElement;l.insertBefore(g,l.firstChild);if(s.getElementById(h)){n.find.ID=function(m,q,p){if(typeof q.getElementById!=="undefined"&&!p)return(q=q.getElementById(m[1]))?q.id===m[1]||typeof q.getAttributeNode!=="undefined"&&
+q.getAttributeNode("id").nodeValue===m[1]?[q]:w:[]};n.filter.ID=function(m,q){var p=typeof m.getAttributeNode!=="undefined"&&m.getAttributeNode("id");return m.nodeType===1&&p&&p.nodeValue===q}}l.removeChild(g);l=g=null})();(function(){var g=s.createElement("div");g.appendChild(s.createComment(""));if(g.getElementsByTagName("*").length>0)n.find.TAG=function(h,l){l=l.getElementsByTagName(h[1]);if(h[1]==="*"){h=[];for(var m=0;l[m];m++)l[m].nodeType===1&&h.push(l[m]);l=h}return l};g.innerHTML="<a href='#'></a>";
+if(g.firstChild&&typeof g.firstChild.getAttribute!=="undefined"&&g.firstChild.getAttribute("href")!=="#")n.attrHandle.href=function(h){return h.getAttribute("href",2)};g=null})();s.querySelectorAll&&function(){var g=k,h=s.createElement("div");h.innerHTML="<p class='TEST'></p>";if(!(h.querySelectorAll&&h.querySelectorAll(".TEST").length===0)){k=function(m,q,p,v){q=q||s;if(!v&&q.nodeType===9&&!x(q))try{return z(q.querySelectorAll(m),p)}catch(t){}return g(m,q,p,v)};for(var l in g)k[l]=g[l];h=null}}();
+(function(){var g=s.createElement("div");g.innerHTML="<div class='test e'></div><div class='test'></div>";if(!(!g.getElementsByClassName||g.getElementsByClassName("e").length===0)){g.lastChild.className="e";if(g.getElementsByClassName("e").length!==1){n.order.splice(1,0,"CLASS");n.find.CLASS=function(h,l,m){if(typeof l.getElementsByClassName!=="undefined"&&!m)return l.getElementsByClassName(h[1])};g=null}}})();var E=s.compareDocumentPosition?function(g,h){return!!(g.compareDocumentPosition(h)&16)}:
+function(g,h){return g!==h&&(g.contains?g.contains(h):true)},x=function(g){return(g=(g?g.ownerDocument||g:0).documentElement)?g.nodeName!=="HTML":false},ga=function(g,h){var l=[],m="",q;for(h=h.nodeType?[h]:h;q=n.match.PSEUDO.exec(g);){m+=q[0];g=g.replace(n.match.PSEUDO,"")}g=n.relative[g]?g+"*":g;q=0;for(var p=h.length;q<p;q++)k(g,h[q],l);return k.filter(m,l)};c.find=k;c.expr=k.selectors;c.expr[":"]=c.expr.filters;c.unique=k.uniqueSort;c.text=a;c.isXMLDoc=x;c.contains=E})();var eb=/Until$/,fb=/^(?:parents|prevUntil|prevAll)/,
+gb=/,/;R=Array.prototype.slice;var Ia=function(a,b,d){if(c.isFunction(b))return c.grep(a,function(e,j){return!!b.call(e,j,e)===d});else if(b.nodeType)return c.grep(a,function(e){return e===b===d});else if(typeof b==="string"){var f=c.grep(a,function(e){return e.nodeType===1});if(Ua.test(b))return c.filter(b,f,!d);else b=c.filter(b,f)}return c.grep(a,function(e){return c.inArray(e,b)>=0===d})};c.fn.extend({find:function(a){for(var b=this.pushStack("","find",a),d=0,f=0,e=this.length;f<e;f++){d=b.length;
+c.find(a,this[f],b);if(f>0)for(var j=d;j<b.length;j++)for(var i=0;i<d;i++)if(b[i]===b[j]){b.splice(j--,1);break}}return b},has:function(a){var b=c(a);return this.filter(function(){for(var d=0,f=b.length;d<f;d++)if(c.contains(this,b[d]))return true})},not:function(a){return this.pushStack(Ia(this,a,false),"not",a)},filter:function(a){return this.pushStack(Ia(this,a,true),"filter",a)},is:function(a){return!!a&&c.filter(a,this).length>0},closest:function(a,b){if(c.isArray(a)){var d=[],f=this[0],e,j=
+{},i;if(f&&a.length){e=0;for(var o=a.length;e<o;e++){i=a[e];j[i]||(j[i]=c.expr.match.POS.test(i)?c(i,b||this.context):i)}for(;f&&f.ownerDocument&&f!==b;){for(i in j){e=j[i];if(e.jquery?e.index(f)>-1:c(f).is(e)){d.push({selector:i,elem:f});delete j[i]}}f=f.parentNode}}return d}var k=c.expr.match.POS.test(a)?c(a,b||this.context):null;return this.map(function(n,r){for(;r&&r.ownerDocument&&r!==b;){if(k?k.index(r)>-1:c(r).is(a))return r;r=r.parentNode}return null})},index:function(a){if(!a||typeof a===
+"string")return c.inArray(this[0],a?c(a):this.parent().children());return c.inArray(a.jquery?a[0]:a,this)},add:function(a,b){a=typeof a==="string"?c(a,b||this.context):c.makeArray(a);b=c.merge(this.get(),a);return this.pushStack(qa(a[0])||qa(b[0])?b:c.unique(b))},andSelf:function(){return this.add(this.prevObject)}});c.each({parent:function(a){return(a=a.parentNode)&&a.nodeType!==11?a:null},parents:function(a){return c.dir(a,"parentNode")},parentsUntil:function(a,b,d){return c.dir(a,"parentNode",
+d)},next:function(a){return c.nth(a,2,"nextSibling")},prev:function(a){return c.nth(a,2,"previousSibling")},nextAll:function(a){return c.dir(a,"nextSibling")},prevAll:function(a){return c.dir(a,"previousSibling")},nextUntil:function(a,b,d){return c.dir(a,"nextSibling",d)},prevUntil:function(a,b,d){return c.dir(a,"previousSibling",d)},siblings:function(a){return c.sibling(a.parentNode.firstChild,a)},children:function(a){return c.sibling(a.firstChild)},contents:function(a){return c.nodeName(a,"iframe")?
+a.contentDocument||a.contentWindow.document:c.makeArray(a.childNodes)}},function(a,b){c.fn[a]=function(d,f){var e=c.map(this,b,d);eb.test(a)||(f=d);if(f&&typeof f==="string")e=c.filter(f,e);e=this.length>1?c.unique(e):e;if((this.length>1||gb.test(f))&&fb.test(a))e=e.reverse();return this.pushStack(e,a,R.call(arguments).join(","))}});c.extend({filter:function(a,b,d){if(d)a=":not("+a+")";return c.find.matches(a,b)},dir:function(a,b,d){var f=[];for(a=a[b];a&&a.nodeType!==9&&(d===w||a.nodeType!==1||!c(a).is(d));){a.nodeType===
+1&&f.push(a);a=a[b]}return f},nth:function(a,b,d){b=b||1;for(var f=0;a;a=a[d])if(a.nodeType===1&&++f===b)break;return a},sibling:function(a,b){for(var d=[];a;a=a.nextSibling)a.nodeType===1&&a!==b&&d.push(a);return d}});var Ja=/ jQuery\d+="(?:\d+|null)"/g,V=/^\s+/,Ka=/(<([\w:]+)[^>]*?)\/>/g,hb=/^(?:area|br|col|embed|hr|img|input|link|meta|param)$/i,La=/<([\w:]+)/,ib=/<tbody/i,jb=/<|&#?\w+;/,ta=/<script|<object|<embed|<option|<style/i,ua=/checked\s*(?:[^=]|=\s*.checked.)/i,Ma=function(a,b,d){return hb.test(d)?
+a:b+"></"+d+">"},F={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,"",""]};F.optgroup=F.option;F.tbody=F.tfoot=F.colgroup=F.caption=F.thead;F.th=F.td;if(!c.support.htmlSerialize)F._default=[1,"div<div>","</div>"];c.fn.extend({text:function(a){if(c.isFunction(a))return this.each(function(b){var d=
+c(this);d.text(a.call(this,b,d.text()))});if(typeof a!=="object"&&a!==w)return this.empty().append((this[0]&&this[0].ownerDocument||s).createTextNode(a));return c.text(this)},wrapAll:function(a){if(c.isFunction(a))return this.each(function(d){c(this).wrapAll(a.call(this,d))});if(this[0]){var b=c(a,this[0].ownerDocument).eq(0).clone(true);this[0].parentNode&&b.insertBefore(this[0]);b.map(function(){for(var d=this;d.firstChild&&d.firstChild.nodeType===1;)d=d.firstChild;return d}).append(this)}return this},
+wrapInner:function(a){if(c.isFunction(a))return this.each(function(b){c(this).wrapInner(a.call(this,b))});return this.each(function(){var b=c(this),d=b.contents();d.length?d.wrapAll(a):b.append(a)})},wrap:function(a){return this.each(function(){c(this).wrapAll(a)})},unwrap:function(){return this.parent().each(function(){c.nodeName(this,"body")||c(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.appendChild(a)})},
+prepend:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(b){this.parentNode.insertBefore(b,this)});else if(arguments.length){var a=c(arguments[0]);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(b){this.parentNode.insertBefore(b,
+this.nextSibling)});else if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,c(arguments[0]).toArray());return a}},remove:function(a,b){for(var d=0,f;(f=this[d])!=null;d++)if(!a||c.filter(a,[f]).length){if(!b&&f.nodeType===1){c.cleanData(f.getElementsByTagName("*"));c.cleanData([f])}f.parentNode&&f.parentNode.removeChild(f)}return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++)for(b.nodeType===1&&c.cleanData(b.getElementsByTagName("*"));b.firstChild;)b.removeChild(b.firstChild);
+return this},clone:function(a){var b=this.map(function(){if(!c.support.noCloneEvent&&!c.isXMLDoc(this)){var d=this.outerHTML,f=this.ownerDocument;if(!d){d=f.createElement("div");d.appendChild(this.cloneNode(true));d=d.innerHTML}return c.clean([d.replace(Ja,"").replace(/=([^="'>\s]+\/)>/g,'="$1">').replace(V,"")],f)[0]}else return this.cloneNode(true)});if(a===true){ra(this,b);ra(this.find("*"),b.find("*"))}return b},html:function(a){if(a===w)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(Ja,
+""):null;else if(typeof a==="string"&&!ta.test(a)&&(c.support.leadingWhitespace||!V.test(a))&&!F[(La.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Ka,Ma);try{for(var b=0,d=this.length;b<d;b++)if(this[b].nodeType===1){c.cleanData(this[b].getElementsByTagName("*"));this[b].innerHTML=a}}catch(f){this.empty().append(a)}}else c.isFunction(a)?this.each(function(e){var j=c(this),i=j.html();j.empty().append(function(){return a.call(this,e,i)})}):this.empty().append(a);return this},replaceWith:function(a){if(this[0]&&
+this[0].parentNode){if(c.isFunction(a))return this.each(function(b){var d=c(this),f=d.html();d.replaceWith(a.call(this,b,f))});if(typeof a!=="string")a=c(a).detach();return this.each(function(){var b=this.nextSibling,d=this.parentNode;c(this).remove();b?c(b).before(a):c(d).append(a)})}else return this.pushStack(c(c.isFunction(a)?a():a),"replaceWith",a)},detach:function(a){return this.remove(a,true)},domManip:function(a,b,d){function f(u){return c.nodeName(u,"table")?u.getElementsByTagName("tbody")[0]||
+u.appendChild(u.ownerDocument.createElement("tbody")):u}var e,j,i=a[0],o=[],k;if(!c.support.checkClone&&arguments.length===3&&typeof i==="string"&&ua.test(i))return this.each(function(){c(this).domManip(a,b,d,true)});if(c.isFunction(i))return this.each(function(u){var z=c(this);a[0]=i.call(this,u,b?z.html():w);z.domManip(a,b,d)});if(this[0]){e=i&&i.parentNode;e=c.support.parentNode&&e&&e.nodeType===11&&e.childNodes.length===this.length?{fragment:e}:sa(a,this,o);k=e.fragment;if(j=k.childNodes.length===
+1?(k=k.firstChild):k.firstChild){b=b&&c.nodeName(j,"tr");for(var n=0,r=this.length;n<r;n++)d.call(b?f(this[n],j):this[n],n>0||e.cacheable||this.length>1?k.cloneNode(true):k)}o.length&&c.each(o,Qa)}return this}});c.fragments={};c.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){c.fn[a]=function(d){var f=[];d=c(d);var e=this.length===1&&this[0].parentNode;if(e&&e.nodeType===11&&e.childNodes.length===1&&d.length===1){d[b](this[0]);
+return this}else{e=0;for(var j=d.length;e<j;e++){var i=(e>0?this.clone(true):this).get();c.fn[b].apply(c(d[e]),i);f=f.concat(i)}return this.pushStack(f,a,d.selector)}}});c.extend({clean:function(a,b,d,f){b=b||s;if(typeof b.createElement==="undefined")b=b.ownerDocument||b[0]&&b[0].ownerDocument||s;for(var e=[],j=0,i;(i=a[j])!=null;j++){if(typeof i==="number")i+="";if(i){if(typeof i==="string"&&!jb.test(i))i=b.createTextNode(i);else if(typeof i==="string"){i=i.replace(Ka,Ma);var o=(La.exec(i)||["",
+""])[1].toLowerCase(),k=F[o]||F._default,n=k[0],r=b.createElement("div");for(r.innerHTML=k[1]+i+k[2];n--;)r=r.lastChild;if(!c.support.tbody){n=ib.test(i);o=o==="table"&&!n?r.firstChild&&r.firstChild.childNodes:k[1]==="<table>"&&!n?r.childNodes:[];for(k=o.length-1;k>=0;--k)c.nodeName(o[k],"tbody")&&!o[k].childNodes.length&&o[k].parentNode.removeChild(o[k])}!c.support.leadingWhitespace&&V.test(i)&&r.insertBefore(b.createTextNode(V.exec(i)[0]),r.firstChild);i=r.childNodes}if(i.nodeType)e.push(i);else e=
+c.merge(e,i)}}if(d)for(j=0;e[j];j++)if(f&&c.nodeName(e[j],"script")&&(!e[j].type||e[j].type.toLowerCase()==="text/javascript"))f.push(e[j].parentNode?e[j].parentNode.removeChild(e[j]):e[j]);else{e[j].nodeType===1&&e.splice.apply(e,[j+1,0].concat(c.makeArray(e[j].getElementsByTagName("script"))));d.appendChild(e[j])}return e},cleanData:function(a){for(var b,d,f=c.cache,e=c.event.special,j=c.support.deleteExpando,i=0,o;(o=a[i])!=null;i++)if(d=o[c.expando]){b=f[d];if(b.events)for(var k in b.events)e[k]?
+c.event.remove(o,k):Ca(o,k,b.handle);if(j)delete o[c.expando];else o.removeAttribute&&o.removeAttribute(c.expando);delete f[d]}}});var kb=/z-?index|font-?weight|opacity|zoom|line-?height/i,Na=/alpha\([^)]*\)/,Oa=/opacity=([^)]*)/,ha=/float/i,ia=/-([a-z])/ig,lb=/([A-Z])/g,mb=/^-?\d+(?:px)?$/i,nb=/^-?\d/,ob={position:"absolute",visibility:"hidden",display:"block"},pb=["Left","Right"],qb=["Top","Bottom"],rb=s.defaultView&&s.defaultView.getComputedStyle,Pa=c.support.cssFloat?"cssFloat":"styleFloat",ja=
+function(a,b){return b.toUpperCase()};c.fn.css=function(a,b){return X(this,a,b,true,function(d,f,e){if(e===w)return c.curCSS(d,f);if(typeof e==="number"&&!kb.test(f))e+="px";c.style(d,f,e)})};c.extend({style:function(a,b,d){if(!a||a.nodeType===3||a.nodeType===8)return w;if((b==="width"||b==="height")&&parseFloat(d)<0)d=w;var f=a.style||a,e=d!==w;if(!c.support.opacity&&b==="opacity"){if(e){f.zoom=1;b=parseInt(d,10)+""==="NaN"?"":"alpha(opacity="+d*100+")";a=f.filter||c.curCSS(a,"filter")||"";f.filter=
+Na.test(a)?a.replace(Na,b):b}return f.filter&&f.filter.indexOf("opacity=")>=0?parseFloat(Oa.exec(f.filter)[1])/100+"":""}if(ha.test(b))b=Pa;b=b.replace(ia,ja);if(e)f[b]=d;return f[b]},css:function(a,b,d,f){if(b==="width"||b==="height"){var e,j=b==="width"?pb:qb;function i(){e=b==="width"?a.offsetWidth:a.offsetHeight;f!=="border"&&c.each(j,function(){f||(e-=parseFloat(c.curCSS(a,"padding"+this,true))||0);if(f==="margin")e+=parseFloat(c.curCSS(a,"margin"+this,true))||0;else e-=parseFloat(c.curCSS(a,
+"border"+this+"Width",true))||0})}a.offsetWidth!==0?i():c.swap(a,ob,i);return Math.max(0,Math.round(e))}return c.curCSS(a,b,d)},curCSS:function(a,b,d){var f,e=a.style;if(!c.support.opacity&&b==="opacity"&&a.currentStyle){f=Oa.test(a.currentStyle.filter||"")?parseFloat(RegExp.$1)/100+"":"";return f===""?"1":f}if(ha.test(b))b=Pa;if(!d&&e&&e[b])f=e[b];else if(rb){if(ha.test(b))b="float";b=b.replace(lb,"-$1").toLowerCase();e=a.ownerDocument.defaultView;if(!e)return null;if(a=e.getComputedStyle(a,null))f=
+a.getPropertyValue(b);if(b==="opacity"&&f==="")f="1"}else if(a.currentStyle){d=b.replace(ia,ja);f=a.currentStyle[b]||a.currentStyle[d];if(!mb.test(f)&&nb.test(f)){b=e.left;var j=a.runtimeStyle.left;a.runtimeStyle.left=a.currentStyle.left;e.left=d==="fontSize"?"1em":f||0;f=e.pixelLeft+"px";e.left=b;a.runtimeStyle.left=j}}return f},swap:function(a,b,d){var f={};for(var e in b){f[e]=a.style[e];a.style[e]=b[e]}d.call(a);for(e in b)a.style[e]=f[e]}});if(c.expr&&c.expr.filters){c.expr.filters.hidden=function(a){var b=
+a.offsetWidth,d=a.offsetHeight,f=a.nodeName.toLowerCase()==="tr";return b===0&&d===0&&!f?true:b>0&&d>0&&!f?false:c.curCSS(a,"display")==="none"};c.expr.filters.visible=function(a){return!c.expr.filters.hidden(a)}}var sb=J(),tb=/<script(.|\s)*?\/script>/gi,ub=/select|textarea/i,vb=/color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week/i,N=/=\?(&|$)/,ka=/\?/,wb=/(\?|&)_=.*?(&|$)/,xb=/^(\w+:)?\/\/([^\/?#]+)/,yb=/%20/g,zb=c.fn.load;c.fn.extend({load:function(a,b,d){if(typeof a!==
+"string")return zb.call(this,a);else if(!this.length)return this;var f=a.indexOf(" ");if(f>=0){var e=a.slice(f,a.length);a=a.slice(0,f)}f="GET";if(b)if(c.isFunction(b)){d=b;b=null}else if(typeof b==="object"){b=c.param(b,c.ajaxSettings.traditional);f="POST"}var j=this;c.ajax({url:a,type:f,dataType:"html",data:b,complete:function(i,o){if(o==="success"||o==="notmodified")j.html(e?c("<div />").append(i.responseText.replace(tb,"")).find(e):i.responseText);d&&j.each(d,[i.responseText,o,i])}});return this},
+serialize:function(){return c.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?c.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||ub.test(this.nodeName)||vb.test(this.type))}).map(function(a,b){a=c(this).val();return a==null?null:c.isArray(a)?c.map(a,function(d){return{name:b.name,value:d}}):{name:b.name,value:a}}).get()}});c.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),
+function(a,b){c.fn[b]=function(d){return this.bind(b,d)}});c.extend({get:function(a,b,d,f){if(c.isFunction(b)){f=f||d;d=b;b=null}return c.ajax({type:"GET",url:a,data:b,success:d,dataType:f})},getScript:function(a,b){return c.get(a,null,b,"script")},getJSON:function(a,b,d){return c.get(a,b,d,"json")},post:function(a,b,d,f){if(c.isFunction(b)){f=f||d;d=b;b={}}return c.ajax({type:"POST",url:a,data:b,success:d,dataType:f})},ajaxSetup:function(a){c.extend(c.ajaxSettings,a)},ajaxSettings:{url:location.href,
+global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:A.XMLHttpRequest&&(A.location.protocol!=="file:"||!A.ActiveXObject)?function(){return new A.XMLHttpRequest}:function(){try{return new A.ActiveXObject("Microsoft.XMLHTTP")}catch(a){}},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},etag:{},ajax:function(a){function b(){e.success&&
+e.success.call(k,o,i,x);e.global&&f("ajaxSuccess",[x,e])}function d(){e.complete&&e.complete.call(k,x,i);e.global&&f("ajaxComplete",[x,e]);e.global&&!--c.active&&c.event.trigger("ajaxStop")}function f(q,p){(e.context?c(e.context):c.event).trigger(q,p)}var e=c.extend(true,{},c.ajaxSettings,a),j,i,o,k=a&&a.context||e,n=e.type.toUpperCase();if(e.data&&e.processData&&typeof e.data!=="string")e.data=c.param(e.data,e.traditional);if(e.dataType==="jsonp"){if(n==="GET")N.test(e.url)||(e.url+=(ka.test(e.url)?
+"&":"?")+(e.jsonp||"callback")+"=?");else if(!e.data||!N.test(e.data))e.data=(e.data?e.data+"&":"")+(e.jsonp||"callback")+"=?";e.dataType="json"}if(e.dataType==="json"&&(e.data&&N.test(e.data)||N.test(e.url))){j=e.jsonpCallback||"jsonp"+sb++;if(e.data)e.data=(e.data+"").replace(N,"="+j+"$1");e.url=e.url.replace(N,"="+j+"$1");e.dataType="script";A[j]=A[j]||function(q){o=q;b();d();A[j]=w;try{delete A[j]}catch(p){}z&&z.removeChild(C)}}if(e.dataType==="script"&&e.cache===null)e.cache=false;if(e.cache===
+false&&n==="GET"){var r=J(),u=e.url.replace(wb,"$1_="+r+"$2");e.url=u+(u===e.url?(ka.test(e.url)?"&":"?")+"_="+r:"")}if(e.data&&n==="GET")e.url+=(ka.test(e.url)?"&":"?")+e.data;e.global&&!c.active++&&c.event.trigger("ajaxStart");r=(r=xb.exec(e.url))&&(r[1]&&r[1]!==location.protocol||r[2]!==location.host);if(e.dataType==="script"&&n==="GET"&&r){var z=s.getElementsByTagName("head")[0]||s.documentElement,C=s.createElement("script");C.src=e.url;if(e.scriptCharset)C.charset=e.scriptCharset;if(!j){var B=
+false;C.onload=C.onreadystatechange=function(){if(!B&&(!this.readyState||this.readyState==="loaded"||this.readyState==="complete")){B=true;b();d();C.onload=C.onreadystatechange=null;z&&C.parentNode&&z.removeChild(C)}}}z.insertBefore(C,z.firstChild);return w}var E=false,x=e.xhr();if(x){e.username?x.open(n,e.url,e.async,e.username,e.password):x.open(n,e.url,e.async);try{if(e.data||a&&a.contentType)x.setRequestHeader("Content-Type",e.contentType);if(e.ifModified){c.lastModified[e.url]&&x.setRequestHeader("If-Modified-Since",
+c.lastModified[e.url]);c.etag[e.url]&&x.setRequestHeader("If-None-Match",c.etag[e.url])}r||x.setRequestHeader("X-Requested-With","XMLHttpRequest");x.setRequestHeader("Accept",e.dataType&&e.accepts[e.dataType]?e.accepts[e.dataType]+", */*":e.accepts._default)}catch(ga){}if(e.beforeSend&&e.beforeSend.call(k,x,e)===false){e.global&&!--c.active&&c.event.trigger("ajaxStop");x.abort();return false}e.global&&f("ajaxSend",[x,e]);var g=x.onreadystatechange=function(q){if(!x||x.readyState===0||q==="abort"){E||
+d();E=true;if(x)x.onreadystatechange=c.noop}else if(!E&&x&&(x.readyState===4||q==="timeout")){E=true;x.onreadystatechange=c.noop;i=q==="timeout"?"timeout":!c.httpSuccess(x)?"error":e.ifModified&&c.httpNotModified(x,e.url)?"notmodified":"success";var p;if(i==="success")try{o=c.httpData(x,e.dataType,e)}catch(v){i="parsererror";p=v}if(i==="success"||i==="notmodified")j||b();else c.handleError(e,x,i,p);d();q==="timeout"&&x.abort();if(e.async)x=null}};try{var h=x.abort;x.abort=function(){x&&h.call(x);
+g("abort")}}catch(l){}e.async&&e.timeout>0&&setTimeout(function(){x&&!E&&g("timeout")},e.timeout);try{x.send(n==="POST"||n==="PUT"||n==="DELETE"?e.data:null)}catch(m){c.handleError(e,x,null,m);d()}e.async||g();return x}},handleError:function(a,b,d,f){if(a.error)a.error.call(a.context||a,b,d,f);if(a.global)(a.context?c(a.context):c.event).trigger("ajaxError",[b,a,f])},active:0,httpSuccess:function(a){try{return!a.status&&location.protocol==="file:"||a.status>=200&&a.status<300||a.status===304||a.status===
+1223||a.status===0}catch(b){}return false},httpNotModified:function(a,b){var d=a.getResponseHeader("Last-Modified"),f=a.getResponseHeader("Etag");if(d)c.lastModified[b]=d;if(f)c.etag[b]=f;return a.status===304||a.status===0},httpData:function(a,b,d){var f=a.getResponseHeader("content-type")||"",e=b==="xml"||!b&&f.indexOf("xml")>=0;a=e?a.responseXML:a.responseText;e&&a.documentElement.nodeName==="parsererror"&&c.error("parsererror");if(d&&d.dataFilter)a=d.dataFilter(a,b);if(typeof a==="string")if(b===
+"json"||!b&&f.indexOf("json")>=0)a=c.parseJSON(a);else if(b==="script"||!b&&f.indexOf("javascript")>=0)c.globalEval(a);return a},param:function(a,b){function d(i,o){if(c.isArray(o))c.each(o,function(k,n){b||/\[\]$/.test(i)?f(i,n):d(i+"["+(typeof n==="object"||c.isArray(n)?k:"")+"]",n)});else!b&&o!=null&&typeof o==="object"?c.each(o,function(k,n){d(i+"["+k+"]",n)}):f(i,o)}function f(i,o){o=c.isFunction(o)?o():o;e[e.length]=encodeURIComponent(i)+"="+encodeURIComponent(o)}var e=[];if(b===w)b=c.ajaxSettings.traditional;
+if(c.isArray(a)||a.jquery)c.each(a,function(){f(this.name,this.value)});else for(var j in a)d(j,a[j]);return e.join("&").replace(yb,"+")}});var la={},Ab=/toggle|show|hide/,Bb=/^([+-]=)?([\d+-.]+)(.*)$/,W,va=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];c.fn.extend({show:function(a,b){if(a||a===0)return this.animate(K("show",3),a,b);else{a=0;for(b=this.length;a<b;a++){var d=c.data(this[a],"olddisplay");
+this[a].style.display=d||"";if(c.css(this[a],"display")==="none"){d=this[a].nodeName;var f;if(la[d])f=la[d];else{var e=c("<"+d+" />").appendTo("body");f=e.css("display");if(f==="none")f="block";e.remove();la[d]=f}c.data(this[a],"olddisplay",f)}}a=0;for(b=this.length;a<b;a++)this[a].style.display=c.data(this[a],"olddisplay")||"";return this}},hide:function(a,b){if(a||a===0)return this.animate(K("hide",3),a,b);else{a=0;for(b=this.length;a<b;a++){var d=c.data(this[a],"olddisplay");!d&&d!=="none"&&c.data(this[a],
+"olddisplay",c.css(this[a],"display"))}a=0;for(b=this.length;a<b;a++)this[a].style.display="none";return this}},_toggle:c.fn.toggle,toggle:function(a,b){var d=typeof a==="boolean";if(c.isFunction(a)&&c.isFunction(b))this._toggle.apply(this,arguments);else a==null||d?this.each(function(){var f=d?a:c(this).is(":hidden");c(this)[f?"show":"hide"]()}):this.animate(K("toggle",3),a,b);return this},fadeTo:function(a,b,d){return this.filter(":hidden").css("opacity",0).show().end().animate({opacity:b},a,d)},
+animate:function(a,b,d,f){var e=c.speed(b,d,f);if(c.isEmptyObject(a))return this.each(e.complete);return this[e.queue===false?"each":"queue"](function(){var j=c.extend({},e),i,o=this.nodeType===1&&c(this).is(":hidden"),k=this;for(i in a){var n=i.replace(ia,ja);if(i!==n){a[n]=a[i];delete a[i];i=n}if(a[i]==="hide"&&o||a[i]==="show"&&!o)return j.complete.call(this);if((i==="height"||i==="width")&&this.style){j.display=c.css(this,"display");j.overflow=this.style.overflow}if(c.isArray(a[i])){(j.specialEasing=
+j.specialEasing||{})[i]=a[i][1];a[i]=a[i][0]}}if(j.overflow!=null)this.style.overflow="hidden";j.curAnim=c.extend({},a);c.each(a,function(r,u){var z=new c.fx(k,j,r);if(Ab.test(u))z[u==="toggle"?o?"show":"hide":u](a);else{var C=Bb.exec(u),B=z.cur(true)||0;if(C){u=parseFloat(C[2]);var E=C[3]||"px";if(E!=="px"){k.style[r]=(u||1)+E;B=(u||1)/z.cur(true)*B;k.style[r]=B+E}if(C[1])u=(C[1]==="-="?-1:1)*u+B;z.custom(B,u,E)}else z.custom(B,u,"")}});return true})},stop:function(a,b){var d=c.timers;a&&this.queue([]);
+this.each(function(){for(var f=d.length-1;f>=0;f--)if(d[f].elem===this){b&&d[f](true);d.splice(f,1)}});b||this.dequeue();return this}});c.each({slideDown:K("show",1),slideUp:K("hide",1),slideToggle:K("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(a,b){c.fn[a]=function(d,f){return this.animate(b,d,f)}});c.extend({speed:function(a,b,d){var f=a&&typeof a==="object"?a:{complete:d||!d&&b||c.isFunction(a)&&a,duration:a,easing:d&&b||b&&!c.isFunction(b)&&b};f.duration=c.fx.off?0:typeof f.duration===
+"number"?f.duration:c.fx.speeds[f.duration]||c.fx.speeds._default;f.old=f.complete;f.complete=function(){f.queue!==false&&c(this).dequeue();c.isFunction(f.old)&&f.old.call(this)};return f},easing:{linear:function(a,b,d,f){return d+f*a},swing:function(a,b,d,f){return(-Math.cos(a*Math.PI)/2+0.5)*f+d}},timers:[],fx:function(a,b,d){this.options=b;this.elem=a;this.prop=d;if(!b.orig)b.orig={}}});c.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this);(c.fx.step[this.prop]||
+c.fx.step._default)(this);if((this.prop==="height"||this.prop==="width")&&this.elem.style)this.elem.style.display="block"},cur:function(a){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null))return this.elem[this.prop];return(a=parseFloat(c.css(this.elem,this.prop,a)))&&a>-10000?a:parseFloat(c.curCSS(this.elem,this.prop))||0},custom:function(a,b,d){function f(j){return e.step(j)}this.startTime=J();this.start=a;this.end=b;this.unit=d||this.unit||"px";this.now=this.start;
+this.pos=this.state=0;var e=this;f.elem=this.elem;if(f()&&c.timers.push(f)&&!W)W=setInterval(c.fx.tick,13)},show:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.show=true;this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur());c(this.elem).show()},hide:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.hide=true;this.custom(this.cur(),0)},step:function(a){var b=J(),d=true;if(a||b>=this.options.duration+this.startTime){this.now=
+this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;for(var f in this.options.curAnim)if(this.options.curAnim[f]!==true)d=false;if(d){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;a=c.data(this.elem,"olddisplay");this.elem.style.display=a?a:this.options.display;if(c.css(this.elem,"display")==="none")this.elem.style.display="block"}this.options.hide&&c(this.elem).hide();if(this.options.hide||this.options.show)for(var e in this.options.curAnim)c.style(this.elem,
+e,this.options.orig[e]);this.options.complete.call(this.elem)}return false}else{e=b-this.startTime;this.state=e/this.options.duration;a=this.options.easing||(c.easing.swing?"swing":"linear");this.pos=c.easing[this.options.specialEasing&&this.options.specialEasing[this.prop]||a](this.state,e,0,1,this.options.duration);this.now=this.start+(this.end-this.start)*this.pos;this.update()}return true}};c.extend(c.fx,{tick:function(){for(var a=c.timers,b=0;b<a.length;b++)a[b]()||a.splice(b--,1);a.length||
+c.fx.stop()},stop:function(){clearInterval(W);W=null},speeds:{slow:600,fast:200,_default:400},step:{opacity:function(a){c.style(a.elem,"opacity",a.now)},_default:function(a){if(a.elem.style&&a.elem.style[a.prop]!=null)a.elem.style[a.prop]=(a.prop==="width"||a.prop==="height"?Math.max(0,a.now):a.now)+a.unit;else a.elem[a.prop]=a.now}}});if(c.expr&&c.expr.filters)c.expr.filters.animated=function(a){return c.grep(c.timers,function(b){return a===b.elem}).length};c.fn.offset="getBoundingClientRect"in s.documentElement?
+function(a){var b=this[0];if(a)return this.each(function(e){c.offset.setOffset(this,a,e)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return c.offset.bodyOffset(b);var d=b.getBoundingClientRect(),f=b.ownerDocument;b=f.body;f=f.documentElement;return{top:d.top+(self.pageYOffset||c.support.boxModel&&f.scrollTop||b.scrollTop)-(f.clientTop||b.clientTop||0),left:d.left+(self.pageXOffset||c.support.boxModel&&f.scrollLeft||b.scrollLeft)-(f.clientLeft||b.clientLeft||0)}}:function(a){var b=
+this[0];if(a)return this.each(function(r){c.offset.setOffset(this,a,r)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return c.offset.bodyOffset(b);c.offset.initialize();var d=b.offsetParent,f=b,e=b.ownerDocument,j,i=e.documentElement,o=e.body;f=(e=e.defaultView)?e.getComputedStyle(b,null):b.currentStyle;for(var k=b.offsetTop,n=b.offsetLeft;(b=b.parentNode)&&b!==o&&b!==i;){if(c.offset.supportsFixedPosition&&f.position==="fixed")break;j=e?e.getComputedStyle(b,null):b.currentStyle;
+k-=b.scrollTop;n-=b.scrollLeft;if(b===d){k+=b.offsetTop;n+=b.offsetLeft;if(c.offset.doesNotAddBorder&&!(c.offset.doesAddBorderForTableAndCells&&/^t(able|d|h)$/i.test(b.nodeName))){k+=parseFloat(j.borderTopWidth)||0;n+=parseFloat(j.borderLeftWidth)||0}f=d;d=b.offsetParent}if(c.offset.subtractsBorderForOverflowNotVisible&&j.overflow!=="visible"){k+=parseFloat(j.borderTopWidth)||0;n+=parseFloat(j.borderLeftWidth)||0}f=j}if(f.position==="relative"||f.position==="static"){k+=o.offsetTop;n+=o.offsetLeft}if(c.offset.supportsFixedPosition&&
+f.position==="fixed"){k+=Math.max(i.scrollTop,o.scrollTop);n+=Math.max(i.scrollLeft,o.scrollLeft)}return{top:k,left:n}};c.offset={initialize:function(){var a=s.body,b=s.createElement("div"),d,f,e,j=parseFloat(c.curCSS(a,"marginTop",true))||0;c.extend(b.style,{position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"});b.innerHTML="<div style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;'><div></div></div><table style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;' cellpadding='0' cellspacing='0'><tr><td></td></tr></table>";
+a.insertBefore(b,a.firstChild);d=b.firstChild;f=d.firstChild;e=d.nextSibling.firstChild.firstChild;this.doesNotAddBorder=f.offsetTop!==5;this.doesAddBorderForTableAndCells=e.offsetTop===5;f.style.position="fixed";f.style.top="20px";this.supportsFixedPosition=f.offsetTop===20||f.offsetTop===15;f.style.position=f.style.top="";d.style.overflow="hidden";d.style.position="relative";this.subtractsBorderForOverflowNotVisible=f.offsetTop===-5;this.doesNotIncludeMarginInBodyOffset=a.offsetTop!==j;a.removeChild(b);
+c.offset.initialize=c.noop},bodyOffset:function(a){var b=a.offsetTop,d=a.offsetLeft;c.offset.initialize();if(c.offset.doesNotIncludeMarginInBodyOffset){b+=parseFloat(c.curCSS(a,"marginTop",true))||0;d+=parseFloat(c.curCSS(a,"marginLeft",true))||0}return{top:b,left:d}},setOffset:function(a,b,d){if(/static/.test(c.curCSS(a,"position")))a.style.position="relative";var f=c(a),e=f.offset(),j=parseInt(c.curCSS(a,"top",true),10)||0,i=parseInt(c.curCSS(a,"left",true),10)||0;if(c.isFunction(b))b=b.call(a,
+d,e);d={top:b.top-e.top+j,left:b.left-e.left+i};"using"in b?b.using.call(a,d):f.css(d)}};c.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),d=this.offset(),f=/^body|html$/i.test(b[0].nodeName)?{top:0,left:0}:b.offset();d.top-=parseFloat(c.curCSS(a,"marginTop",true))||0;d.left-=parseFloat(c.curCSS(a,"marginLeft",true))||0;f.top+=parseFloat(c.curCSS(b[0],"borderTopWidth",true))||0;f.left+=parseFloat(c.curCSS(b[0],"borderLeftWidth",true))||0;return{top:d.top-
+f.top,left:d.left-f.left}},offsetParent:function(){return this.map(function(){for(var a=this.offsetParent||s.body;a&&!/^body|html$/i.test(a.nodeName)&&c.css(a,"position")==="static";)a=a.offsetParent;return a})}});c.each(["Left","Top"],function(a,b){var d="scroll"+b;c.fn[d]=function(f){var e=this[0],j;if(!e)return null;if(f!==w)return this.each(function(){if(j=wa(this))j.scrollTo(!a?f:c(j).scrollLeft(),a?f:c(j).scrollTop());else this[d]=f});else return(j=wa(e))?"pageXOffset"in j?j[a?"pageYOffset":
+"pageXOffset"]:c.support.boxModel&&j.document.documentElement[d]||j.document.body[d]:e[d]}});c.each(["Height","Width"],function(a,b){var d=b.toLowerCase();c.fn["inner"+b]=function(){return this[0]?c.css(this[0],d,false,"padding"):null};c.fn["outer"+b]=function(f){return this[0]?c.css(this[0],d,false,f?"margin":"border"):null};c.fn[d]=function(f){var e=this[0];if(!e)return f==null?null:this;if(c.isFunction(f))return this.each(function(j){var i=c(this);i[d](f.call(this,j,i[d]()))});return"scrollTo"in
+e&&e.document?e.document.compatMode==="CSS1Compat"&&e.document.documentElement["client"+b]||e.document.body["client"+b]:e.nodeType===9?Math.max(e.documentElement["client"+b],e.body["scroll"+b],e.documentElement["scroll"+b],e.body["offset"+b],e.documentElement["offset"+b]):f===w?c.css(e,d):this.css(d,typeof f==="string"?f:f+"px")}});A.jQuery=A.$=c})(window);jQuery.noConflict();
diff --git a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/js/topic.js b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/js/topic.js
index e010e367f8a0c4ae90bc99fc087ec6e9e4aef7f2..a05c5a971cc5dee141299e13b2fa29904003e0fe 100644
--- a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/js/topic.js
+++ b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/js/topic.js
@@ -3,7 +3,7 @@ bbTopicJS = jQuery.extend( {
 	topicId: '0',
 	favoritesLink: '',
 	isFav: 0,
-	confirmPostDelete: 'Are you sure you wanna delete this post?',
+	confirmPostDelete: 'Are you sure you want to delete this post?',
 	favLinkYes: 'favorites',
 	favLinkNo: '?',
 	favYes: 'This topic is one of your %favLinkYes% [%favDel%]',
@@ -30,7 +30,6 @@ jQuery( function($) {
 	var favoritesToggleSpan = favoritesToggle.children( 'span' )
 		[bbTopicJS.isFav ? 'addClass' : 'removeClass' ]( 'is-favorite' );
 	
-
 	function favLinkSetup() {
 		bbTopicJS.isFav = favoritesToggleSpan.is('.is-favorite');
 		var aLink = "<a href='" + bbTopicJS.favoritesLink + "'>";
@@ -56,5 +55,10 @@ jQuery( function($) {
 		return confirm( bbTopicJS[ $('#' + s.element).is('.deleted') ? 'confirmPostUnDelete' : 'confirmPostDelete'] );
 	};
 
-	$('#thread').addClass( 'list:post' ).wpList( { alt: 'alt', altOffset: 1, confirm: postConfirm } );
+	$('#thread').addClass( 'list:post' ).wpList( { alt: 'alt', altOffset: 1, confirm: postConfirm, delAfter: function( r, s ) {
+		try {
+			// If we deleted the only post, we got an WP AJAX Response object back with a URL to redirect to
+			document.location = s.parsed.responses[0].data;
+		} catch ( e ) {}
+	} } );
 } );
diff --git a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-load.php b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-load.php
index 9d63ddbcf882106c59dcc487a5ec9912b29d5f19..9c41ec0160e25a1eba1f7dd6ea079206e52c0aa5 100644
--- a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-load.php
+++ b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-load.php
@@ -22,8 +22,7 @@ if ( version_compare( PHP_VERSION, '4.3', '<' ) ) {
 
 
 // Modify error reporting levels to exclude PHP notices
-error_reporting( E_ALL ^ E_NOTICE );
-
+error_reporting(E_ERROR | E_WARNING | E_PARSE | E_USER_ERROR | E_USER_WARNING);
 
 
 /**
@@ -180,3 +179,6 @@ if ( file_exists( BB_PATH . 'bb-config.php') ) {
 	die();
 
 }
+
+if ( isset( $_GET['doit'] ) && 'bb-subscribe' == $_GET['doit'] )
+	require( BB_PATH . 'bb-includes/action.subscribe.php' );
diff --git a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-login.php b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-login.php
index 32b542f2a9c0dd4faf7befe6433a3d037630565f..775e0eb5910bc8fc72e6126c5d14837eeca6b6d1 100644
--- a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-login.php
+++ b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-login.php
@@ -91,7 +91,7 @@ if ( $user = bb_login( @$_POST['log'], @$_POST['pwd'], @$_POST['rememberme'] ) )
 	} else {
 		$bb_login_error =& $user;
 	}
-
+	
 // No login so prepare the error
 } else {
 	$bb_login_error = new WP_Error;
@@ -110,7 +110,7 @@ else
 
 // Check for errors on post method
 if ( 'post' == strtolower( $_SERVER['REQUEST_METHOD'] ) ) {
-
+	
 	// If the user doesn't exist then add that error
 	if ( empty( $user_exists ) ) {
 		if ( !empty( $_POST['log'] ) ) {
diff --git a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-plugins/akismet.php b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-plugins/akismet.php
index 13fd91d971e5724582b2a8c800637537c97b58e8..add8df79acf9d426740acf76d329fd328ea31648 100644
--- a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-plugins/akismet.php
+++ b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-plugins/akismet.php
@@ -100,7 +100,7 @@ function bb_ksd_configuration_page()
 
 function bb_ksd_configuration_page_add()
 {
-	bb_admin_add_submenu( __( 'Akismet' ), 'moderate', 'bb_ksd_configuration_page', 'options-general.php' );
+	bb_admin_add_submenu( __( 'Akismet' ), 'use_keys', 'bb_ksd_configuration_page', 'options-general.php' );
 }
 add_action( 'bb_admin_menu_generator', 'bb_ksd_configuration_page_add' );
 
@@ -215,7 +215,7 @@ function bb_ksd_stats_page()
 		return;
 	}
 	if ( function_exists( 'bb_admin_add_submenu' ) ) {
-		bb_admin_add_submenu( __( 'Akismet Stats' ), 'use_keys', 'bb_ksd_stats_display', 'index.php' );
+		bb_admin_add_submenu( __( 'Akismet Stats' ), 'moderate', 'bb_ksd_stats_display', 'index.php' );
 	}
 }
 add_action( 'bb_admin_menu_generator', 'bb_ksd_stats_page' );
@@ -319,19 +319,10 @@ function bb_ksd_submit_spam( $post_id )
 
 function bb_ksd_check_post( $post_text )
 {
-	global $bb_current_user;
-	global $bb_ksd_pre_post_status;
+	global $bb_ksd_pre_post_status, $bb_ksd_pre_post;
 
-	// Don't filter content from users with a trusted role
-	if ( in_array( $bb_current_user->roles[0], bb_trusted_roles() ) ) {
-		return $post_text;
-	}
+	$bb_ksd_pre_post = $post_text;
 
-	$response = bb_ksd_submit( $post_text );
-	if ( 'true' == $response[1] ) {
-		$bb_ksd_pre_post_status = '2';
-	}
-	bb_akismet_delete_old();
 	return $post_text;
 }
 add_action( 'pre_post', 'bb_ksd_check_post', 1 );
@@ -393,9 +384,17 @@ function bb_akismet_delete_old()
 
 function bb_ksd_pre_post_status( $post_status )
 {
-	global $bb_ksd_pre_post_status;
-	if ( '2' == $bb_ksd_pre_post_status ) {
-		$post_status = $bb_ksd_pre_post_status;
+	global $bb_current_user, $bb_ksd_pre_post_status, $bb_ksd_pre_post;
+
+	// Don't filter content from users with a trusted role
+	if ( in_array( $bb_current_user->roles[0], bb_trusted_roles() ) ) {
+		return $post_status;
+	}
+
+	$response = bb_ksd_submit( $bb_ksd_pre_post );
+	if ( 'true' == $response[1] ) {
+		$bb_ksd_pre_post_status = '2';
+		return $bb_ksd_pre_post_status;
 	}
 	return $post_status;
 }
@@ -470,6 +469,40 @@ function bb_ksd_post_delete_link( $parts, $args )
 }
 add_filter( 'bb_post_admin', 'bb_ksd_post_delete_link', 10, 2 );
 
+function bb_ksd_bulk_post_actions( &$bulk_actions, &$post_query ) {
+	$status = $post_query->get( 'post_status' );
+
+	$bulk_actions['unspam'] = __( 'Not Spam' );
+	$bulk_actions['spam'] = __( 'Mark as Spam' );
+
+	if ( 2 == $status )
+		unset( $bulk_actions['undelete'], $bulk_actions['spam'] );
+	elseif ( is_numeric( $status ) )
+		unset( $bulk_actions['unspam'] );
+}
+
+add_action( 'bulk_post_actions', 'bb_ksd_bulk_post_actions', 10, 2 );
+
+function bb_ksd_bulk_post__action( $query_vars, $post_ids, $action ) {
+	$count = 0;
+
+	switch ( $action ) {
+	case 'spam' :
+		foreach ( $post_ids as $post_id ) {
+			$count += (int) (bool) bb_delete_post( $post_id, 2 );
+		}
+		return array( 'message' => 'spammed', 'count' => $count );
+	case 'unspam' :
+		foreach ( $post_ids as $post_id ) {
+			$count += (int) (bool) bb_delete_post( $post_id, 0 );
+		}
+		return array( 'message' => 'unspammed-normal', 'count' => $count );
+	}
+}
+
+add_action( 'bulk_post__spam', 'bb_ksd_bulk_post__action', 10, 3 );
+add_action( 'bulk_post__unspam', 'bb_ksd_bulk_post__action', 10, 3 );
+
 function bb_ksd_add_post_status_to_forms( $stati, $type )
 {
 	if ( 'post' === $type ) {
diff --git a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-plugins/bozo.php b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-plugins/bozo.php
index 5510998abfef7564873d00f8d7a424877ff8b13d..c48ed6c8ab425b756bf92434b596140a7a84652a 100644
--- a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-plugins/bozo.php
+++ b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-plugins/bozo.php
@@ -227,6 +227,8 @@ function bb_bozon( $user_id, $topic_id = 0 ) {
 		$topic = get_topic( $topic_id );
 		$user = bb_get_user( $user_id );
 
+		$bozo_topics_key = $bbdb->prefix . 'bozo_topics';
+
 		if ( isset($topic->bozos[$user_id]) )
 			$topic->bozos[$user_id]++;
 		elseif ( is_array($topic->bozos) )
@@ -235,13 +237,13 @@ function bb_bozon( $user_id, $topic_id = 0 ) {
 			$topic->bozos = array($user_id => 1);
 		bb_update_topicmeta( $topic_id, 'bozos', $topic->bozos );
 		
-		if ( isset($user->bozo_topics[$topic_id]) )
-			$user->bozo_topics[$topic_id]++;
+		if ( isset($user->{$bozo_topics_key}[$topic_id]) )
+			$user->{$bozo_topics_key}[$topic_id]++;
 		elseif ( is_array($user->bozo_topics) )
-			$user->bozo_topics[$topic_id] = 1;
+			$user->{$bozo_topics_key}[$topic_id] = 1;
 		else
-			$user->bozo_topics = array($topic_id => 1);
-		bb_update_usermeta( $user_id, $bbdb->prefix . 'bozo_topics', $user->bozo_topics );
+			$user->$bozo_topics_key = array($topic_id => 1);
+		bb_update_usermeta( $user_id, $bozo_topics_key, $user->$bozo_topics_key );
 	}
 }
 
@@ -256,13 +258,16 @@ function bb_fermion( $user_id, $topic_id = 0 ) {
 	else {
 		$topic = get_topic( $topic_id );
 		$user = bb_get_user( $user_id );
+
+		$bozo_topics_key = $bbdb->prefix . 'bozo_topics';
+
 		if ( --$topic->bozos[$user_id] < 1 )
 			unset($topic->bozos[$user_id]);
 		bb_update_topicmeta( $topic_id, 'bozos', $topic->bozos );
 		
-		if ( --$user->bozo_topics[$topic_id] < 1 )
-			unset($user->bozo_topics[$topic_id]);
-		bb_update_usermeta( $user_id, $bbdb->prefix . 'bozo_topics', $user->bozo_topics );
+		if ( --$user->{$bozo_topics_key}[$topic_id] < 1 )
+			unset($user->{$bozo_topics_key}[$topic_id]);
+		bb_update_usermeta( $user_id, $bozo_topics_key, $user->$bozo_topics_key );
 	}
 }
 
diff --git a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-post.php b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-post.php
index acb97563ddf2747e951b3bd52c0559f13637c094..5d40d1f61cccdfdb3e2a2b2de2cbb046e217df0c 100644
--- a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-post.php
+++ b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-post.php
@@ -1,20 +1,37 @@
 <?php
-require('./bb-load.php');
+require( './bb-load.php' );
 
-bb_auth('logged_in');
+if ( bb_is_login_required() )
+	bb_auth( 'logged_in' );
+
+bb_check_post_flood();
+
+if ( !$post_content = trim( $_POST['post_content'] ) )
+	bb_die( __( 'You need to actually submit some content!' ) );
+
+$post_author = $post_email = $post_url = '';
+
+if ( !bb_is_user_logged_in() ) {
+	if ( bb_is_login_required() ) {
+		bb_die( __( 'You are not allowed to post.  Are you logged in?' ) );
+	} else {
+		if ( !$post_author = sanitize_user( trim( $_POST['author'] ) ) )
+			bb_die( __( 'You need to submit your name!' ) );
+		elseif ( !$post_email = sanitize_email( trim( $_POST['email'] ) ) )
+			bb_die( __( 'You need to submit a valid email address!' ) );
+
+		if ( !empty( $_POST['url'] ) )
+			$post_url = esc_url( trim( $_POST['url'] ) );
+	}
+}
 
-if ( $throttle_time = bb_get_option( 'throttle_time' ) )
-	if ( isset($bb_current_user->data->last_posted) && time() < $bb_current_user->data->last_posted + $throttle_time && !bb_current_user_can('throttle') )
-		bb_die(__('Slow down; you move too fast.'));
 
-if ( !$post_content = trim($_POST['post_content']) )
-	bb_die(__('You need to actually submit some content!'));
 
 if ( isset($_POST['topic']) && $forum_id = (int) $_POST['forum_id'] ) {
-	if ( !bb_current_user_can('write_posts') )
+	if ( bb_is_login_required() && ! bb_current_user_can('write_posts') )
 		bb_die(__('You are not allowed to post.  Are you logged in?'));
 
-	if ( !bb_current_user_can( 'write_topic', $forum_id ) )
+	if ( bb_is_login_required() && ! bb_current_user_can( 'write_topic', $forum_id ) )
 		bb_die(__('You are not allowed to write new topics.'));
 
 	bb_check_admin_referer( 'create-topic' );
@@ -25,27 +42,42 @@ if ( isset($_POST['topic']) && $forum_id = (int) $_POST['forum_id'] ) {
 	if ('' == $topic)
 		bb_die(__('Please enter a topic title'));
 
-	$topic_id = bb_new_topic( $topic, $forum_id, $tags );
+	$args = array();
+
+	if ( isset( $post_author ) )
+		$args['topic_poster_name'] = $args['topic_last_poster_name'] = $post_author;
+
+	$topic_id = bb_new_topic( $topic, $forum_id, $tags, $args );
 
 } elseif ( isset($_POST['topic_id'] ) ) {
 	$topic_id = (int) $_POST['topic_id'];
 	bb_check_admin_referer( 'create-post_' . $topic_id );
 }
 
-if ( !bb_current_user_can( 'write_post', $topic_id ) )
+if ( bb_is_login_required() && ! bb_current_user_can( 'write_post', $topic_id ) )
 	bb_die(__('You are not allowed to post.  Are you logged in?'));
 
 if ( !topic_is_open( $topic_id ) )
 	bb_die(__('This topic has been closed'));
 
-$post_id = bb_new_post( $topic_id, $_POST['post_content'] );
+$post_data = array(
+	'post_text' => stripslashes($_POST['post_content']),
+	'topic_id' => $topic_id,
+);
+
+foreach( array('post_author', 'post_email', 'post_url') as $field ) {
+	if ( ! empty( $$field ) ) {
+		$post_data[$field] = $$field;
+	}
+}
+
+$post_id = bb_insert_post($post_data);
 
 $tags  = trim( $_POST['tags']  );
 bb_add_topic_tags( $topic_id, $tags );
 
-$link = get_post_link($post_id);
-
 $topic = get_topic( $topic_id, false );
+$link = get_post_link($post_id);
 
 if ( $topic->topic_posts )
 	$link = add_query_arg( 'replies', $topic->topic_posts, $link );
@@ -57,5 +89,3 @@ if ($post_id)
 else
 	wp_redirect( bb_get_uri(null, null, BB_URI_CONTEXT_HEADER) );
 exit;
-
-?>
diff --git a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-settings.php b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-settings.php
index b06a5a5e0203af3da88b9184a36a19d482d50e4b..608663c077677dd03e74702ceb77a7cf2061398c 100644
--- a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-settings.php
+++ b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-settings.php
@@ -16,7 +16,9 @@ if ( !defined( 'BB_PATH' ) ) {
 	die( 'This file cannot be called directly.' );
 }
 
-
+// Set default timezone in PHP 5.
+if ( function_exists( 'date_default_timezone_set' ) )
+        date_default_timezone_set( 'UTC' );
 
 /**
  * bb_unregister_GLOBALS() - Turn register globals off
@@ -477,12 +479,14 @@ require_once( BB_PATH . BB_INC . 'defaults.bb-filters.php' );
 // Load default scripts
 require_once( BB_PATH . BB_INC . 'functions.bb-script-loader.php' );
 
-// Sanitise external input
-$_GET    = bb_global_sanitize( $_GET );
-$_POST   = bb_global_sanitize( $_POST );
-$_COOKIE = bb_global_sanitize( $_COOKIE, false );
-$_SERVER = bb_global_sanitize( $_SERVER );
-
+/* Check if the globals have been sanitized by WordPress or not (else there would be extra slashes while deep integration) */
+if ( !function_exists( 'wp_magic_quotes' ) ) {
+	// Sanitise external input
+	$_GET    = bb_global_sanitize( $_GET );
+	$_POST   = bb_global_sanitize( $_POST );
+	$_COOKIE = bb_global_sanitize( $_COOKIE, false );
+	$_SERVER = bb_global_sanitize( $_SERVER );
+}
 
 
 /**
@@ -738,7 +742,9 @@ $bb->admin_cookie_path = bb_get_option( 'admin_cookie_path' );
 if ( !$bb->admin_cookie_path ) {
 	$bb->admin_cookie_path = $bb->path . 'bb-admin';
 }
-$bb->admin_cookie_path = rtrim( trim( $bb->admin_cookie_path ), " \t\n\r\0\x0B/" );
+if ( '/' !== $bb->admin_cookie_path = trim( $bb->admin_cookie_path ) ) {
+	$bb->admin_cookie_path = rtrim( $bb->admin_cookie_path, " \t\n\r\0\x0B/" );
+}
 
 if ( BB_LOAD_DEPRECATED ) {
 	$_plugin_cookie_paths = bb_get_option( 'plugin_cookie_paths' );
@@ -797,14 +803,18 @@ if ( !$bb->wp_admin_cookie_path && $bb->wp_cookies_integrated ) {
 		$bb->wp_admin_cookie_path = $_bb_sitecookiepath . '/wp-admin';
 	}
 }
-$bb->wp_admin_cookie_path = rtrim( trim( $bb->wp_admin_cookie_path ), " \t\n\r\0\x0B/" );
+if ( '/' !== $bb->wp_admin_cookie_path = trim( $bb->wp_admin_cookie_path ) ) {
+	$bb->wp_admin_cookie_path = rtrim( $bb->wp_admin_cookie_path, " \t\n\r\0\x0B/" );
+}
 
 $bb->wp_plugins_cookie_path = bb_get_option( 'wp_plugins_cookie_path' );
 if ( !$bb->wp_plugins_cookie_path && $bb->wp_cookies_integrated ) {
 	// This is a best guess only, should be manually set to match WP_PLUGIN_URL
 	$bb->wp_plugins_cookie_path = $_bb_sitecookiepath . '/wp-content/plugins';
 }
-$bb->wp_plugins_cookie_path = rtrim( trim( $bb->wp_plugins_cookie_path ), " \t\n\r\0\x0B/" );
+if ( '/' !== $bb->wp_plugins_cookie_path = trim( $bb->wp_plugins_cookie_path ) ) {
+	$bb->wp_plugins_cookie_path = rtrim( $bb->wp_plugins_cookie_path, " \t\n\r\0\x0B/" );
+}
 unset( $_bb_sitecookiepath );
 
 /**
@@ -903,26 +913,36 @@ if ( !class_exists( 'WP_Auth' ) ) {
 		} else {
 			$_cookie_path = $_plugin_cookie_paths[$_name];
 		}
-		$_cookie_path = rtrim( trim( $_cookie_path ), " \t\n\r\0\x0B/" );
+		if ( '/' !== $_cookie_path = trim( $_cookie_path ) ) {
+			$_cookie_path = rtrim( $_cookie_path, " \t\n\r\0\x0B/" );
+		}
 
 		if ( !$_cookie_path ) {
 			continue;
 		}
 
-		$cookies['auth'][] = array(
+		$_auth = array(
 			'domain' => $bb->cookiedomain,
 			'path' => $_cookie_path,
 			'name' => $bb->authcookie
 		);
 
-		$cookies['secure_auth'][] = array(
+		if ( !in_array( $_auth, $cookies['auth'] ) ) {
+			$cookies['auth'][] = $_auth;
+		}
+
+		$_secure_auth = array(
 			'domain' => $bb->cookiedomain,
 			'path' => $_cookie_path,
 			'name' => $bb->secure_auth_cookie,
 			'secure' => true
 		);
+
+		if ( !in_array( $_secure_auth, $cookies['secure_auth'] ) ) {
+			$cookies['secure_auth'][] = $_secure_auth;
+		}
 	}
-	unset( $_plugin_cookie_paths, $_type, $_data, $_cookie_path );
+	unset( $_plugin_cookie_paths, $_type, $_data, $_cookie_path, $_auth, $_secure_auth );
 
 	if ( $bb->wp_admin_cookie_path ) {
 		$cookies['auth'][] = array(
@@ -1017,8 +1037,11 @@ if ( !isset( $wp_taxonomy_object ) ) {
 	$wp_taxonomy_object->taxonomies =& $tax;
 	unset( $tax );
 }
+
 $wp_taxonomy_object->register_taxonomy( 'bb_topic_tag', 'bb_topic' );
 
+$wp_taxonomy_object->register_taxonomy( 'bb_subscribe', 'bb_user' );
+
 do_action( 'bb_options_loaded' );
 
 
diff --git a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-templates/kakumei-blue/functions.php b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-templates/kakumei-blue/functions.php
new file mode 100644
index 0000000000000000000000000000000000000000..8f1b6e9aa400ba850700745fbbceca5e41613c45
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-templates/kakumei-blue/functions.php
@@ -0,0 +1,6 @@
+<?php
+/* Functions for Kakumei Blue Theme */
+
+/* The below actions are removed because we add our own checkbox (check post-form.php and edit-form.php) */
+remove_action( 'post_form', 'bb_user_subscribe_checkbox' );
+remove_action( 'edit_form', 'bb_user_subscribe_checkbox' );
diff --git a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-templates/kakumei/edit-form.php b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-templates/kakumei/edit-form.php
index cb62b89b12189ea33e0259f7c3d830f69276e091..2a71e4a13a4e22fe2e2acff11e21451223c48efb 100644
--- a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-templates/kakumei/edit-form.php
+++ b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-templates/kakumei/edit-form.php
@@ -1,19 +1,33 @@
+<?php if ( !bb_get_user( get_post_author_id() ) ) : ?>
+
+	<?php bb_load_template( 'post-form-anonymous.php' ); ?>
+
+<?php endif; ?>
 
 <?php if ( $topic_title ) : ?>
 <p role="main">
-  <label><?php _e('Topic:'); ?><br />
-
-  <input name="topic" type="text" id="topic" size="50" maxlength="80"  value="<?php echo esc_attr( get_topic_title() ); ?>" />
-</label>
+	<label for="topic"><?php _e( 'Topic:' ); ?><br />
+		<input name="topic" type="text" id="topic" size="50" maxlength="80" tabindex="31" value="<?php echo esc_attr( get_topic_title() ); ?>" />
+	</label>
 </p>
 <?php endif; do_action( 'edit_form_pre_post' ); ?>
-<p><label><?php _e('Post:'); ?><br />
-  <textarea name="post_content" cols="50" rows="8" id="post_content"><?php echo apply_filters('edit_text', get_post_text() ); ?></textarea>
-  </label>
+
+<p>
+	<label for="post_content"><?php _e( 'Post:' ); ?><br />
+		<textarea name="post_content" cols="50" rows="8" tabindex="32" id="post_content"><?php echo apply_filters( 'edit_text', get_post_text() ); ?></textarea>
+	</label>
 </p>
+
+<?php if ( bb_get_user( get_post_author_id() ) && bb_is_subscriptions_active() ) : ?>
+<p id="post-form-subscription-container" class="left">
+	<?php bb_user_subscribe_checkbox( 'tab=33' ); ?>
+</p>
+<?php endif; ?>
+
 <p class="submit">
-<input type="submit" name="Submit" value="<?php echo esc_attr__( 'Edit Post &raquo;' ); ?>" />
-<input type="hidden" name="post_id" value="<?php post_id(); ?>" />
-<input type="hidden" name="topic_id" value="<?php topic_id(); ?>" />
+	<input type="submit" name="Submit" value="<?php esc_attr_e( 'Edit Post &raquo;' ); ?>" tabindex="34" />
+	<input type="hidden" name="post_id" value="<?php post_id(); ?>" />
+	<input type="hidden" name="topic_id" value="<?php topic_id(); ?>" />
 </p>
-<p><?php _e('Allowed markup:'); ?> <code><?php allowed_markup(); ?></code>. <br /><?php _e('Put code in between <code>`backticks`</code>.'); ?></p>
+
+<p><?php _e( 'Allowed markup:' ); ?> <code><?php allowed_markup(); ?></code>. <br /><?php _e( 'Put code in between <code>`backticks`</code>.' ); ?></p>
diff --git a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-templates/kakumei/functions.php b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-templates/kakumei/functions.php
new file mode 100644
index 0000000000000000000000000000000000000000..3b61c02b21bd5e23999d05df4e2c86512a90b737
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-templates/kakumei/functions.php
@@ -0,0 +1,6 @@
+<?php
+/* Functions for Kakumei Theme */
+
+/* The below actions are removed because we add our own checkbox (check post-form.php and edit-form.php) */
+remove_action( 'post_form', 'bb_user_subscribe_checkbox' );
+remove_action( 'edit_form', 'bb_user_subscribe_checkbox' );
diff --git a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-templates/kakumei/login-form.php b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-templates/kakumei/login-form.php
index f5cef5241ace8e7f1d2325a990df803bacb2f304..cb9ac4b20733a739122d407f92c893f4e997b9cb 100644
--- a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-templates/kakumei/login-form.php
+++ b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-templates/kakumei/login-form.php
@@ -4,7 +4,7 @@
 	printf(
 		__( '<a href="%1$s">Register</a> or log in - <a href="%2$s">lost password?</a>' ),
 		bb_get_uri( 'register.php', null, BB_URI_CONTEXT_A_HREF + BB_URI_CONTEXT_BB_USER_FORMS ),
-		bb_get_uri( 'bb-login.php', null, BB_URI_CONTEXT_FORM_ACTION + BB_URI_CONTEXT_BB_USER_FORMS )
+		bb_get_uri( 'bb-login.php', array( 'action' => 'lostpassword' ), BB_URI_CONTEXT_A_HREF + BB_URI_CONTEXT_BB_USER_FORMS )
 	);
 	?>
 
@@ -12,20 +12,20 @@
 	<div>
 		<label>
 			<?php _e('Username'); ?><br />
-			<input name="user_login" type="text" id="quick_user_login" size="13" maxlength="40" value="<?php if (!is_bool($user_login)) echo $user_login; ?>" tabindex="1" />
+			<input name="log" type="text" id="quick_user_login" size="13" maxlength="40" value="<?php if (!is_bool($user_login)) echo $user_login; ?>" tabindex="10" />
 		</label>
 		<label>
 			<?php _e( 'Password' ); ?><br />
-			<input name="password" type="password" id="quick_password" size="13" maxlength="40" tabindex="2" />
+			<input name="pwd" type="password" id="quick_password" size="13" maxlength="40" tabindex="11" />
 		</label>
-		<input name="re" type="hidden" value="<?php echo $re; ?>" />
+		<input name="redirect_to" type="hidden" value="<?php echo $re; ?>" />
 		<?php wp_referer_field(); ?>
 
-		<input type="submit" name="Submit" class="submit" value="<?php echo esc_attr__( 'Log in &raquo;' ); ?>" tabindex="4" />
+		<input type="submit" name="Submit" class="submit" value="<?php echo esc_attr__( 'Log in &raquo;' ); ?>" tabindex="13" />
 	</div>
 	<div class="remember">
 		<label>
-			<input name="remember" type="checkbox" id="quick_remember" value="1" tabindex="3"<?php echo $remember_checked; ?> />
+			<input name="rememberme" type="checkbox" id="quick_remember" value="1" tabindex="12"<?php echo $remember_checked; ?> />
 			<?php _e('Remember me'); ?>
 
 		</label>
diff --git a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-templates/kakumei/login.php b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-templates/kakumei/login.php
index ff4446cd3a52d85a501aae44bda0b6541d271ec6..1f5fc0b8d5dabd9a89751771e123113eda098ac5 100644
--- a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-templates/kakumei/login.php
+++ b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-templates/kakumei/login.php
@@ -2,7 +2,7 @@
 
 <div class="bbcrumb"><a href="<?php bb_uri(); ?>"><?php bb_option('name'); ?></a> &raquo; <?php _e('Log in'); ?></div>
 
-<h2 id="userlogin" role="main"><?php isset($_POST['user_login']) ? _e('Log in Failed') : _e('Log in') ; ?></h2>
+<h2 id="userlogin" role="main"><?php !empty( $user_login ) ? _e('Log in Failed') : _e('Log in') ; ?></h2>
 
 <form method="post" action="<?php bb_uri('bb-login.php', null, BB_URI_CONTEXT_FORM_ACTION + BB_URI_CONTEXT_BB_USER_FORMS); ?>">
 <fieldset>
@@ -19,7 +19,7 @@
 			<?php if ( $user_email_error ) echo "<em>$user_email_error</em>"; ?>
 		</th>
 		<td>
-			<input name="user_login" id="user_login" type="text" value="<?php echo $user_login; ?>" />
+			<input name="log" id="user_login" type="text" value="<?php echo $user_login; ?>" />
 		</td>
 	</tr>
 	<tr valign="top" class="form-field <?php if ( $user_password_error ) echo 'form-invalid error'; ?>">
@@ -28,19 +28,19 @@
 			<?php if ( $user_password_error ) echo "<em>$user_password_error</em>"; ?>
 		</th>
 		<td>
-			<input name="password" id="password" type="password" />
+			<input name="pwd" id="password" type="password" />
 		</td>
 	</tr>
 
 	<tr valign="top" class="form-field">
 		<th scope="row"><label for="remember"><?php _e('Remember me'); ?></label></th>
-		<td><input name="remember" type="checkbox" id="remember" value="1"<?php echo $remember_checked; ?> /></td>
+		<td><input name="rememberme" type="checkbox" id="remember" value="1"<?php echo $remember_checked; ?> /></td>
 	</tr>
 	<tr>
 		<th scope="row">&nbsp;</th>
 		<td>
-			<input name="re" type="hidden" value="<?php echo $redirect_to; ?>" />
-			<input type="submit" value="<?php echo esc_attr( isset($_POST['user_login']) ? __('Try Again &raquo;'): __('Log in &raquo;') ); ?>" />
+			<input name="redirect_to" type="hidden" value="<?php echo $redirect_to; ?>" />
+			<input type="submit" value="<?php echo esc_attr( !empty( $user_login ) ? __( 'Try Again &raquo;' ): __( 'Log in &raquo;' ) ); ?>" />
 			<?php wp_referer_field(); ?>
 		</td>
 	</tr>
diff --git a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-templates/kakumei/post-form-anonymous.php b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-templates/kakumei/post-form-anonymous.php
new file mode 100644
index 0000000000000000000000000000000000000000..9888954ed9ae858b59ee7af29f8ce6af07a752e2
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-templates/kakumei/post-form-anonymous.php
@@ -0,0 +1,31 @@
+<?php
+		// Setup $current_poster varaible on post edit
+		if ( bb_is_topic_edit() ) :
+			foreach( array( 'post_author', 'post_email', 'post_url' ) as $post_author_meta )
+				$current_poster[$post_author_meta] = bb_get_post_meta( $post_author_meta, $post_id );
+
+		// Shift $current_poster values from cookie
+		else :
+			$current_poster               = bb_get_current_poster();
+			$current_poster['post_email'] = $current_poster['post_author_email'];
+			$current_poster['post_url']   = $current_poster['post_author_url'];
+		endif;
+?>
+
+	<p id="post-form-author-container">
+		<label for="author"><?php _e( 'Author' ); ?>
+			<input type="text" name="author" id="author" size="50" tabindex="30" aria-required="true" value="<?php echo esc_attr( $current_poster['post_author'] ); ?>" />
+		</label>
+	</p>
+
+	<p id="post-form-email-container">
+		<label for="email"><?php _e( 'Email' ); ?>
+			<input type="text" name="email" id="email" size="50" tabindex="31" aria-required="true" value="<?php echo esc_attr( $current_poster['post_email'] ); ?>" />
+		</label>
+	</p>
+
+	<p id="post-form-url-container">
+		<label for="url"><?php _e( 'Website' ); ?>
+			<input type="text" name="url" id="url" size="50" tabindex="32" value="<?php echo esc_attr( $current_poster['post_url'] ); ?>" />
+		</label>
+	</p>
diff --git a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-templates/kakumei/post-form.php b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-templates/kakumei/post-form.php
index 3d8154b62ea25c9cada8239acdb97cd82b55f57d..4c360f0ae54a5cef9145c6e86c1857468afac2d7 100644
--- a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-templates/kakumei/post-form.php
+++ b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-templates/kakumei/post-form.php
@@ -1,29 +1,43 @@
 <?php if ( !bb_is_topic() ) : ?>
 <p id="post-form-title-container">
-	<label for="topic"><?php _e('Title'); ?>
-		<input name="topic" type="text" id="topic" size="50" maxlength="100" tabindex="1" />
+	<label for="topic"><?php _e( 'Title' ); ?>
+		<input name="topic" type="text" id="topic" size="50" maxlength="100" tabindex="34" />
 	</label>
 </p>
 <?php endif; do_action( 'post_form_pre_post' ); ?>
+
 <p id="post-form-post-container">
-	<label for="post_content"><?php _e('Post'); ?>
-		<textarea name="post_content" cols="50" rows="8" id="post_content" tabindex="3"></textarea>
+	<label for="post_content"><?php _e( 'Post' ); ?>
+		<textarea name="post_content" cols="50" rows="8" id="post_content" tabindex="35"></textarea>
 	</label>
 </p>
+
+<?php if ( bb_is_user_logged_in() ) : /* Display Tags box to only logged in users */ ?>
 <p id="post-form-tags-container">
-	<label for="tags-input"><?php printf(__('Tags (comma separated)'), bb_get_tag_page_link()) ?>
-		<input id="tags-input" name="tags" type="text" size="50" maxlength="100" value="<?php bb_tag_name(); ?>" tabindex="4" />
+	<label for="tags-input"><?php _e( 'Tags (comma separated)' ); ?>
+		<input id="tags-input" name="tags" type="text" size="50" maxlength="100" value="<?php bb_tag_name(); ?>" tabindex="36" />
 	</label>
 </p>
+<?php endif; ?>
+
 <?php if ( bb_is_tag() || bb_is_front() ) : ?>
 <p id="post-form-forum-container">
-	<label for="forum-id"><?php _e('Forum'); ?>
-		<?php bb_new_topic_forum_dropdown(); ?>
+	<label for="forum-id"><?php _e( 'Forum' ); ?>
+		<?php bb_new_topic_forum_dropdown( 'tab=37' ); ?>
 	</label>
 </p>
 <?php endif; ?>
+
+<?php if ( bb_is_user_logged_in() && bb_is_subscriptions_active() ) : ?>
+<p id="post-form-subscription-container" class="left">
+	<?php bb_user_subscribe_checkbox( 'tab=38' ); ?>
+</p>
+<?php endif; ?>
+
 <p id="post-form-submit-container" class="submit">
-  <input type="submit" id="postformsub" name="Submit" value="<?php echo esc_attr__( 'Send Post &raquo;' ); ?>" tabindex="4" />
+	<input type="submit" id="postformsub" name="Submit" value="<?php esc_attr_e( 'Send Post &raquo;' ); ?>" tabindex="39" />
 </p>
 
-<p id="post-form-allowed-container" class="allowed"><?php _e('Allowed markup:'); ?> <code><?php allowed_markup(); ?></code>. <br /><?php _e('You can also put code in between backtick ( <code>`</code> ) characters.'); ?></p>
+<div class="clear"></div>
+
+<p id="post-form-allowed-container" class="allowed"><?php _e( 'Allowed markup:' ); ?> <code><?php allowed_markup(); ?></code>. <br /><?php _e( 'You can also put code in between backtick ( <code>`</code> ) characters.' ); ?></p>
diff --git a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-templates/kakumei/profile-edit.php b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-templates/kakumei/profile-edit.php
index 8a8ac4d71c485f1635f2f75e1e7b3234a3633ed9..eecd28fc799f26600c7672aa879a9ad7880dd2c2 100644
--- a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-templates/kakumei/profile-edit.php
+++ b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-templates/kakumei/profile-edit.php
@@ -1,36 +1,51 @@
 <?php bb_get_header(); ?>
 
-<div class="bbcrumb"><a href="<?php bb_uri(); ?>"><?php bb_option('name'); ?></a> &raquo; <a href="<?php user_profile_link( $user_id ); ?>"><?php echo get_user_display_name( $user_id ); ?></a> &raquo; <?php _e('Edit Profile'); ?></div>
-<h2 id="userlogin" role="main"><?php echo get_user_display_name( $user->ID ); ?> <small>(<?php echo get_user_name( $user->ID ); ?>)</small></h2>
+<div class="bbcrumb">
+	<a href="<?php bb_uri(); ?>"><?php bb_option('name'); ?></a> &raquo; <a href="<?php user_profile_link( $user_id ); ?>"><?php echo get_user_display_name( $user_id ); ?></a> &raquo; <?php _e( 'Edit Profile' ); ?>
+</div>
+
+<h2 id="userlogin" role="main">
+	<?php echo get_user_display_name( $user->ID ); ?> <small>(<?php echo get_user_name( $user->ID ); ?>)</small>
+</h2>
+
 <form method="post" action="<?php profile_tab_link( $user->ID, 'edit', BB_URI_CONTEXT_FORM_ACTION + BB_URI_CONTEXT_BB_USER_FORMS ); ?>">
-<fieldset>
-<legend><?php _e('Profile Info'); ?></legend>
-<?php bb_profile_data_form(); ?>
-</fieldset>
+
+	<fieldset>
+		<legend><?php _e( 'Profile Info' ); ?></legend>
+		<?php bb_profile_data_form(); ?>
+	</fieldset>
 
 <?php if ( bb_current_user_can( 'edit_users' ) ) : ?>
-<fieldset>
-<legend><?php _e('Administration'); ?></legend>
-<?php bb_profile_admin_form(); ?>
-</fieldset>
+	<fieldset>
+		<legend><?php _e( 'Administration' ); ?></legend>
+		<?php bb_profile_admin_form(); ?>
+	</fieldset>
 <?php endif; ?>
 
-<?php if ( bb_current_user_can( 'change_user_password', $user->ID ) ) : ?>
-<fieldset>
-<legend><?php _e('Password'); ?></legend>
-<p><?php _e('To change your password, enter a new password twice below:'); ?></p>
-<?php bb_profile_password_form(); ?>
-</fieldset>
-<?php endif; ?>
-<p class="submit right">
-  <input type="submit" name="Submit" value="<?php echo esc_attr__( 'Update Profile &raquo;' ); ?>" />
-</p>
+<?php
+if ( !( array_key_exists( 'keymaster', $user->capabilities ) && !bb_current_user_can( 'keep_gate' ) ) ) :
+	if ( bb_current_user_can( 'change_user_password', $user->ID ) ) :
+?>
+	<fieldset>
+		<legend><?php _e( 'Password' ); ?></legend>
+		<p><?php _e( 'To change your password, enter a new password twice below:' ); ?></p>
+		<?php bb_profile_password_form(); ?>
+	</fieldset>
+<?php endif; endif; ?>
+
+	<p class="submit right">
+		<input type="submit" name="Submit" value="<?php echo esc_attr__( 'Update Profile &raquo;' ); ?>" />
+	</p>
+
 </form>
-<form method="post" action="<?php profile_tab_link($user->ID, 'edit');  ?>">
-<p class="submit left">
-<?php bb_nonce_field( 'edit-profile_' . $user->ID ); ?>
-<?php user_delete_button(); ?>
-</p>
+
+<form method="post" action="<?php profile_tab_link( $user->ID, 'edit' );  ?>">
+
+	<p class="submit left">
+		<?php bb_nonce_field( 'edit-profile_' . $user->ID ); ?>
+		<?php user_delete_button(); ?>
+	</p>
+
 </form>
 
 <?php bb_get_footer(); ?>
diff --git a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-templates/kakumei/profile.php b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-templates/kakumei/profile.php
index 00dff4049adf7bdb57e7816813fb1dc075bb6053..bf415321f31164cb802e48b22761f2b20639f8fb 100644
--- a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-templates/kakumei/profile.php
+++ b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-templates/kakumei/profile.php
@@ -39,11 +39,11 @@
 <?php foreach ($posts as $bb_post) : $topic = get_topic( $bb_post->topic_id ) ?>
 <li<?php alt_class('replies'); ?>>
 	<a href="<?php topic_link(); ?>"><?php topic_title(); ?></a> -
-	<?php if ( $user->ID == bb_get_current_user_info( 'id' ) ) printf(__('You last replied: %s ago'), bb_get_post_time()); else printf(__('User last replied: %s ago'), bb_get_post_time()); ?> |
+	<?php if ( $user->ID == bb_get_current_user_info( 'id' ) ) printf(__('You last replied: <a href="%1$s">%2$s ago</a>'), get_post_link(), bb_get_post_time()); else printf(__('User last replied: <a href="%1$s">%2$s ago</a>'), get_post_link(), bb_get_post_time()); ?> |
 
 	<span class="freshness"><?php
 		if ( bb_get_post_time( 'timestamp' ) < get_topic_time( 'timestamp' ) )
-			printf(__('Most recent reply: %s ago'), get_topic_time());
+			printf(__('Most recent reply: <a href="%1$s">%2$s ago</a>'), get_topic_last_post_link(),  get_topic_time());
 		else
 			_e('No replies since');
 	?></span>
@@ -68,9 +68,9 @@
 
 	<span class="freshness"><?php
 		if ( get_topic_start_time( 'timestamp' ) < get_topic_time( 'timestamp' ) )
-			printf(__('Most recent reply: %s ago'), get_topic_time());
+			printf(__('Most recent reply: <a href="%1$s">%2$s ago</a>'), get_topic_last_post_link(), get_topic_time());
 		else
-			_e('No replies.');
+			_e('No replies since');
 	?></span>
 </li>
 <?php endforeach; ?>
diff --git a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-templates/kakumei/rss2.php b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-templates/kakumei/rss2.php
index b102afced9b71f94d91e06980c8e6a4c866e9b4a..b9f4c930e67cf78645411a7b3e6c3bb183f35cd5 100644
--- a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-templates/kakumei/rss2.php
+++ b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-templates/kakumei/rss2.php
@@ -6,30 +6,28 @@ bb_generator( 'comment' );
 <rss version="2.0"
 	xmlns:content="http://purl.org/rss/1.0/modules/content/"
 	xmlns:dc="http://purl.org/dc/elements/1.1/"
-	xmlns:atom="http://www.w3.org/2005/Atom">
+	xmlns:atom="http://www.w3.org/2005/Atom"
+	<?php do_action( 'bb_rss2_ns'); ?>
+	>
 	<channel>
 		<title><?php echo $title; ?></title>
 		<link><?php echo $link; ?></link>
 		<description><?php echo $description; ?></description>
-		<language><?php esc_html( bb_option('language') ); ?></language>
-		<pubDate><?php echo gmdate('D, d M Y H:i:s +0000'); ?></pubDate>
+		<language><?php echo esc_html( bb_get_option( 'language' ) ); ?></language>
+		<pubDate><?php echo gmdate( 'D, d M Y H:i:s +0000' ); ?></pubDate>
 		<?php bb_generator( 'rss2' ); ?>
-		<textInput>
-			<title><![CDATA[<?php _e('Search'); ?>]]></title>
-			<description><![CDATA[<?php _e('Search all topics from these forums.'); ?>]]></description>
-			<name>q</name>
-			<link><?php bb_uri('search.php'); ?></link>
-		</textInput>
+		<?php do_action( 'bb_rss2_head' ); ?>
 		<atom:link href="<?php echo $link_self; ?>" rel="self" type="application/rss+xml" />
 
-<?php foreach ($posts as $bb_post) : ?>
+<?php foreach ( (array) $posts as $bb_post ) : ?>
 		<item>
-			<title><?php post_author(); ?> <?php _e('on')?> "<?php topic_title( $bb_post->topic_id ); ?>"</title>
+			<title><?php post_author(); ?> <?php _e( 'on' ); ?> "<?php topic_title( $bb_post->topic_id ); ?>"</title>
 			<link><?php post_link(); ?></link>
-			<pubDate><?php bb_post_time('D, d M Y H:i:s +0000', array( 'localize' => false ) ); ?></pubDate>
+			<pubDate><?php bb_post_time( array( 'format' => 'D, d M Y H:i:s +0000', 'localize' => false ) ); ?></pubDate>
 			<dc:creator><?php post_author(); ?></dc:creator>
 			<guid isPermaLink="false"><?php post_id(); ?>@<?php bb_uri(); ?></guid>
-			<description><?php post_text(); ?></description>
+			<description><![CDATA[<?php post_text(); ?>]]></description>
+			<?php do_action( 'bb_rss2_item' ); ?>
 		</item>
 <?php endforeach; ?>
 
diff --git a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-templates/kakumei/search.php b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-templates/kakumei/search.php
index d8430d9e4d6b5fbc089807e867c15c6a82ef6728..37153bad5aa13b918dec0a7fd282cdf0a9ffb641 100644
--- a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-templates/kakumei/search.php
+++ b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-templates/kakumei/search.php
@@ -4,18 +4,18 @@
 <?php bb_topic_search_form(); ?>
 
 <?php if ( !empty ( $q ) ) : ?>
-<h3 id="search-for"><?php _e('Search for')?> &#8220;<?php echo esc_html($q); ?>&#8221;</h3>
+<h3 id="search-for"><?php printf( __( 'Search for %s' ), '&#8220;' . esc_html( $q ) . '&#8221;' ); ?></h3>
 <?php endif; ?>
 
 <?php if ( $recent ) : ?>
 <div id="results-recent" class="search-results">
-	<h4><?php _e('Recent Posts')?></h4>
+	<h4><?php _e( 'Recent Posts' )?></h4>
 	<ol>
 <?php foreach ( $recent as $bb_post ) : ?>
 		<li<?php alt_class( 'recent' ); ?>>
-			<a href="<?php post_link(); ?>"><?php topic_title($bb_post->topic_id); ?></a>
-			<span class="freshness"><?php printf( __('Posted %s'), bb_datetime_format_i18n( bb_get_post_time( array( 'format' => 'timestamp' ) ) ) ); ?></span>
-			<p><?php echo bb_show_context($q, $bb_post->post_text); ?></p>
+			<a class="result" href="<?php post_link(); ?>"><?php echo bb_show_topic_context( $q, get_topic_title( $bb_post->topic_id ) ); ?></a>
+			<span class="freshness"><?php printf( __( 'By <a href="%1$s">%2$s</a> on %3$s'), get_user_profile_link( $bb_post->poster_id ), get_post_author(), bb_datetime_format_i18n( bb_get_post_time( array( 'format' => 'timestamp' ) ) ) ); ?></span>
+			<p><?php echo bb_show_context( $q, $bb_post->post_text ); ?></p>
 		</li>
 <?php endforeach; ?>
 	</ol>
@@ -24,22 +24,32 @@
 
 <?php if ( $relevant ) : ?>
 <div id="results-relevant" class="search-results">
-	<h4><?php _e('Relevant posts')?></h4>
+	<h4><?php _e( 'Relevant Topics' )?></h4>
 	<ol>
-<?php foreach ( $relevant as $bb_post ) : ?>
+<?php foreach ( $relevant as $topic ) : ?>
+<?php $bb_post = bb_get_first_post( $topic ); ?>
 		<li<?php alt_class( 'relevant' ); ?>>
-			<a href="<?php post_link(); ?>"><?php topic_title($bb_post->topic_id); ?></a>
-			<span class="freshness"><?php printf( __('Posted %s'), bb_datetime_format_i18n( bb_get_post_time( array( 'format' => 'timestamp' ) ) ) ); ?></span>
-			<p><?php post_text(); ?></p>
+			<a class="result" href="<?php post_link(); ?>"><?php echo bb_show_topic_context( $q, get_topic_title() ); ?></a>
+			<span class="freshness"><?php printf( __( 'By <a href="%1$s">%2$s</a> on %3$s' ), get_user_profile_link( $topic->topic_poster ), get_topic_author(), bb_datetime_format_i18n( get_topic_start_time( array( 'format' => 'timestamp' ) ) ) ); ?></span>
+			<p><?php echo bb_show_context( $q, $bb_post->post_text ); ?></p>
 		</li>
 <?php endforeach; ?>
 	</ol>
 </div>
 <?php endif; ?>
 
+<?php bb_search_pages( array( 'before' => '<div class="nav">', 'after' => '</div>' ) ); ?> 
+
 <?php if ( $q && !$recent && !$relevant ) : ?>
-<p><?php _e('No results found.') ?></p>
+<p><?php printf( __( 'Your search %s did not return any results. Here are some suggestions:' ), '&#8220;<em>' . esc_html( $q ) . '</em>&#8221;' ); ?></p>
+<ul id="search-suggestions">
+	<li><?php _e( 'Make sure all words are spelled correctly' ); ?></li>
+	<li><?php _e( 'Try different keywords' ); ?></li>
+	<li><?php _e( 'Try more general keywords' ); ?></li>
+</ul>
 <?php endif; ?>
+
 <br />
-<p><?php printf(__('You may also try your <a href="http://google.com/search?q=site:%1$s %2$s">search at Google</a>'), bb_get_uri(null, null, BB_URI_CONTEXT_TEXT), urlencode($q)) ?></p>
-<?php bb_get_footer(); ?>
+<p><?php printf( __( 'You may also try your <a href="%s">search at Google</a>.' ), 'http://google.com/search?q=site:' . bb_get_uri( null, null, BB_URI_CONTEXT_TEXT ) . urlencode( ' ' . $q ) ); ?></p>
+
+<?php bb_get_footer(); ?>
\ No newline at end of file
diff --git a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-templates/kakumei/stats.php b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-templates/kakumei/stats.php
index 0fe3374b7561842f9c0c79c8e9c45d29e9bb736e..96df659dd73fec8b3a3774982e48697809b6c546 100644
--- a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-templates/kakumei/stats.php
+++ b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-templates/kakumei/stats.php
@@ -1,21 +1,26 @@
 <?php bb_get_header(); ?>
 
-<div class="bbcrumb"><a href="<?php bb_uri(); ?>"><?php bb_option('name'); ?></a> &raquo; <?php _e('Statistics'); ?></div>
+<div class="bbcrumb"><a href="<?php bb_uri(); ?>"><?php bb_option( 'name' ); ?></a> &raquo; <?php _e( 'Statistics' ); ?></div>
 
-<dl role="main">
-	<dt><?php _e('Registered Users'); ?></dt>
-	<dd><strong><?php total_users(); ?></strong></dd>
-	<dt><?php _e('Posts'); ?></dt>
+<dl role="main" class="left">
+	<dt><?php _e( 'Registered Users' ); ?></dt>
+	<dd><strong><?php bb_total_users(); ?></strong></dd>
+	<dt><?php _e( 'Posts' ); ?></dt>
 	<dd><strong><?php total_posts(); ?></strong></dd>
+<?php do_action( 'bb_stats_left' ); ?>
 </dl>
 
-<?php if ($popular) : ?>
-<h3><?php _e('Most Popular Topics'); ?></h3>
-<ol>
-<?php foreach ($popular as $topic) : ?>
-<li><?php bb_topic_labels(); ?> <a href="<?php topic_link(); ?>"><?php topic_title(); ?></a> &#8212; <?php topic_posts(); ?> posts</li>
+<div class="right">
+<?php if ( $popular ) : ?>
+	<h3><?php _e( 'Most Popular Topics' ); ?></h3>
+	<ol>
+<?php foreach ( $popular as $topic ) : ?>
+		<li><?php bb_topic_labels(); ?> <a href="<?php topic_link(); ?>"><?php topic_title(); ?></a> &#8212; <?php printf( _n( '%s post', '%s posts', get_topic_posts() ), bb_number_format_i18n( get_topic_posts() ) ); ?></li>
 <?php endforeach; ?>
-
+	</ol>
 <?php endif; ?>
-</ol>
+
+<?php do_action( 'bb_stats_right' ); ?>
+</div>
+
 <?php bb_get_footer(); ?>
diff --git a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-templates/kakumei/style.css b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-templates/kakumei/style.css
index 0a0dda3cd85ea77c2e7cd6e0df3c64b6f0022776..9902b80f776c37d3ac5a3a7748f7843c97e5e882 100644
--- a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-templates/kakumei/style.css
+++ b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-templates/kakumei/style.css
@@ -31,6 +31,8 @@ pre, p { margin-bottom: 1.0em; }
 
 .right { float: right; }
 
+.clear { clear: both; }
+
 .delete:hover {
 	background-color: #c00;
 	color: #fff;
@@ -239,6 +241,7 @@ form.login input {
 	-khtml-border-radius: 3px;
 	-webkit-border-radius: 3px;
 	border-radius: 3px;
+	background-color:#fff;
 }
 
 form.login input.submit {
@@ -588,12 +591,16 @@ h2.post-form {
 	-khtml-border-radius: 3px;
 	-webkit-border-radius: 3px;
 	border-radius: 3px;
+	background-color:#fff;
 }
 
 .postform label { display: block; }
 
+.postform #author,
+.postform #email,
 .postform #topic,
-.postform #tags-input {
+.postform #tags-input,
+.postform #url {
 	margin: 5px 0;
 	padding: 5px;
 	width: 724px;
@@ -603,6 +610,7 @@ h2.post-form {
 	-khtml-border-radius: 3px;
 	-webkit-border-radius: 3px;
 	border-radius: 3px;
+	background-color:#fff;
 }
 
 .postform p#post-form-forum-container label span {
@@ -840,11 +848,21 @@ tr.bb-category td {
 
 #search-for { margin: 15px 0 5px; }
 
+ul#search-suggestions { margin-left: 25px; }
+
 .search-results { margin: 0 0 10px; }
 
 .search-results ol { margin: 5px 0 0 28px; }
 
-.search-results ol li { margin: 0 0 3px; }
+.search-results ol li { border-bottom: 1px solid #ccc; padding: 2px 5px 0 5px; min-height: 50px; }
+
+.search-results ol li.alt { background-color: #f8f8f8; }
+
+.search-results ol li:hover { background-color: #e4f3e1; }
+
+.search-results ol li a.result { font-size: 15px; }
+
+.search-results ol li span.freshness { float: right; font-style: italic; }
 
 /* Login, Register, Profile Edit
 =================================== */
@@ -925,6 +943,7 @@ tr.bb-category td {
 	-khtml-border-radius: 3px;
 	-webkit-border-radius: 3px;
 	border-radius: 3px;
+	background-color:#fff;
 }
 
 #login-page fieldset p,
@@ -1008,4 +1027,4 @@ p.submit input:hover {
 
 p.submit input:active {
 	border-color: rgb(0, 100, 0);
-}
\ No newline at end of file
+}
diff --git a/wp-content/plugins/buddypress/bp-forums/bbpress/favorites.php b/wp-content/plugins/buddypress/bp-forums/bbpress/favorites.php
index 1cab01c2e7b9fe63d66be5a520f55baa091f1453..41b1e53c6bf5914af0c2dd26b32f7c86d9d839e7 100644
--- a/wp-content/plugins/buddypress/bp-forums/bbpress/favorites.php
+++ b/wp-content/plugins/buddypress/bp-forums/bbpress/favorites.php
@@ -46,4 +46,3 @@ if ( $topics = get_user_favorites( $user->ID, true ) ) {
 $favorites_total = isset( $user->favorites ) ? count( explode( ',', $user->favorites ) ) : 0;
 
 bb_load_template( 'favorites.php', array( 'favorites_total', 'self' ) );
-?>
diff --git a/wp-content/plugins/buddypress/bp-forums/bbpress/profile-edit.php b/wp-content/plugins/buddypress/bp-forums/bbpress/profile-edit.php
index f47f1b5bce0507e756ac598cf6654b4d1a33598f..dc3b622e0d47fa6faa4e19c247f817215cc3ef6f 100644
--- a/wp-content/plugins/buddypress/bp-forums/bbpress/profile-edit.php
+++ b/wp-content/plugins/buddypress/bp-forums/bbpress/profile-edit.php
@@ -64,15 +64,19 @@ if ( 'post' == strtolower($_SERVER['REQUEST_METHOD']) ) {
 
 	// Deal with errors for users who can edit others data
 	if ( bb_current_user_can('edit_users') ) {
-		// If we are deleting just do it and redirect
-		if ( isset($_POST['delete-user']) && $_POST['delete-user'] && $bb_current_id != $user->ID ) {
-			bb_delete_user( $user->ID );
-			wp_redirect( bb_get_uri(null, null, BB_URI_CONTEXT_HEADER) );
-			exit;
-		}
-
 		// Get the user object
 		$user_obj = new BP_User( $user->ID );
+		
+		// If we are deleting just do it and redirect
+		if ( isset( $_POST['delete-user'] ) && $_POST['delete-user'] && $bb_current_id != $user->ID ) {
+			if ( !bb_current_user_can( 'keep_gate' ) && 'keymaster' == $user_obj->roles[0] ) { /* Only a keymaster can delete another keymaster */
+				$errors->add( 'delete', __( 'You can not delete this user!' ) );
+			} else {
+				bb_delete_user( $user->ID );
+				wp_redirect( bb_get_uri(null, null, BB_URI_CONTEXT_HEADER) );
+				exit;
+			}
+		}
 
 		// Store the new role
 		$role = $_POST['role'];
@@ -138,7 +142,7 @@ if ( 'post' == strtolower($_SERVER['REQUEST_METHOD']) ) {
 				$user_obj->set_role($role); // Only support one role for now
 				if ( 'blocked' == $role && 'blocked' != $old_role )
 					bb_break_password( $user->ID );
-				elseif ( 'blocked' != $role && 'blocked' == $old_role )
+				elseif ( 'blocked' != $role && array_key_exists( 'blocked', $user->capabilities ) )
 					bb_fix_password( $user->ID );
 			}
 			foreach( $profile_admin_keys as $key => $label )
diff --git a/wp-content/plugins/buddypress/bp-forums/bbpress/rss.php b/wp-content/plugins/buddypress/bp-forums/bbpress/rss.php
index 03b4763ddf7255701c8283ff8c78b7c54badea80..a99b6a9edffc31f0718efc23abf345a5c9539d9a 100644
--- a/wp-content/plugins/buddypress/bp-forums/bbpress/rss.php
+++ b/wp-content/plugins/buddypress/bp-forums/bbpress/rss.php
@@ -73,15 +73,13 @@ if ( !$bb_db_override ) {
 				die();
 			
 			$topics = $topics_object->results;
-			if ( !$topics || !is_array($topics) )
-				die();
 			
 			$posts = array();
-			foreach ($topics as $topic) {
+			foreach ( (array) $topics as $topic ) {
 				$posts[] = bb_get_first_post($topic->topic_id);
 			}
 			
-			$title = esc_html( sprintf( __( '%1$s &raquo; View: %2$s' ), bb_get_option( 'name' ), $bb_views[$feed_id]['title'] ) );
+			$title = sprintf( __( '%1$s &raquo; View: %2$s' ), bb_get_option( 'name' ), $bb_views[$feed_id]['title'] );
 			$link = get_view_link($feed_id);
 			$link_self = bb_get_view_rss_link($feed_id);
 			break;
@@ -90,41 +88,41 @@ if ( !$bb_db_override ) {
 			if ( !$topic = get_topic ( $feed_id ) )
 				die();
 			if ( !$posts = get_thread( $feed_id, 0, 1 ) )
-				die();
-			$title = esc_html( sprintf( __( '%1$s &raquo; Topic: %2$s' ), bb_get_option( 'name' ), get_topic_title() ) );
+				die(); /* Should die here, as the topic posts aren't there, so the topic is most probably deleted/empty */
+			$title = sprintf( __( '%1$s &raquo; Topic: %2$s' ), bb_get_option( 'name' ), get_topic_title() );
 			$link = get_topic_link($feed_id);
 			$link_self = get_topic_rss_link($feed_id);
 			break;
 		
 		case 'profile':
-			if ( bb_get_option( 'mod_rewrite' ) === 'slugs' ) {
-				$user = bb_get_user_by_nicename( $feed_id );
+			if ( bb_get_option( 'mod_rewrite' ) === 'slugs') {
+				if ( !$user = bb_get_user_by_nicename( $feed_id ) )
+					$user = bb_get_user( $feed_id );
 			} else {
-				$user = bb_get_user( $feed_id );
+ 	                        if ( !$user = bb_get_user( $feed_id ) )
+				        $user = bb_get_user_by_nicename( $feed_id ); 
 			}
 			if ( !$user ) {
 				die();
 			}
-			if ( !$posts = get_user_favorites( $user->ID ) ) {
-				die();
-			}
-			$title = esc_html( sprintf( __( '%1$s &raquo; User Favorites: %2$s' ), bb_get_option( 'name' ), $user->user_nicename ) );
-			$link = bb_get_profile_link($feed_id);
+			$posts = get_user_favorites( $user->ID );
+			
+			$title = sprintf( __( '%1$s &raquo; User Favorites: %2$s' ), bb_get_option( 'name' ), $user->user_nicename );
+			$link = get_user_profile_link($feed_id);
 			$link_self = get_favorites_rss_link($feed_id);
 			break;
 		
 		case 'tag-topics':
 			if ( !$tag = bb_get_tag( $feed_id ) )
 				die();
-			if ( !$topics = get_tagged_topics( array( 'tag_id' => $tag->tag_id, 'page' => 0 ) ) )
-				die();
+			$topics = get_tagged_topics( array( 'tag_id' => $tag->tag_id, 'page' => 0 ) );
 			
 			$posts = array();
-			foreach ($topics as $topic) {
+			foreach ( (array) $topics as $topic ) {
 				$posts[] = bb_get_first_post($topic->topic_id);
 			}
 			
-			$title = esc_html( sprintf( __( '%1$s &raquo; Tag: %2$s - Recent Topics' ), bb_get_option( 'name' ), bb_get_tag_name() ) );
+			$title = sprintf( __( '%1$s &raquo; Tag: %2$s - Recent Topics' ), bb_get_option( 'name' ), bb_get_tag_name() );
 			$link = bb_get_tag_link($feed_id);
 			$link_self = bb_get_tag_topics_rss_link($feed_id);
 			break;
@@ -132,46 +130,42 @@ if ( !$bb_db_override ) {
 		case 'tag-posts':
 			if ( !$tag = bb_get_tag( $feed_id ) )
 				die();
-			if ( !$posts = get_tagged_topic_posts( array( 'tag_id' => $tag->tag_id, 'page' => 0 ) ) )
-				die();
-			$title = esc_html( sprintf( __( '%1$s &raquo; Tag: %2$s - Recent Posts' ), bb_get_option( 'name' ), bb_get_tag_name() ) );
+			$posts = get_tagged_topic_posts( array( 'tag_id' => $tag->tag_id, 'page' => 0 ) );
+			$title = sprintf( __( '%1$s &raquo; Tag: %2$s - Recent Posts' ), bb_get_option( 'name' ), bb_get_tag_name() );
 			$link = bb_get_tag_link($feed_id);
 			$link_self = bb_get_tag_posts_rss_link($feed_id);
 			break;
 		
 		case 'forum-topics':
-			if ( !$topics = get_latest_topics( $feed_id ) )
-				die();
+			$topics = get_latest_topics( $feed_id );
 			
 			$posts = array();
-			foreach ($topics as $topic) {
+			foreach ( (array) $topics as $topic) {
 				$posts[] = bb_get_first_post($topic->topic_id);
 			}
 			
-			$title = esc_html( sprintf( __( '%1$s &raquo; Forum: %2$s - Recent Topics' ), bb_get_option( 'name' ), get_forum_name( $feed_id ) ) );
+			$title = sprintf( __( '%1$s &raquo; Forum: %2$s - Recent Topics' ), bb_get_option( 'name' ), get_forum_name( $feed_id ) );
 			$link = get_forum_link($feed_id);
 			$link_self = bb_get_forum_topics_rss_link($feed_id);
 			break;
 		
 		case 'forum-posts':
-			if ( !$posts = bb_get_latest_forum_posts( $feed_id ) )
-				die();
-			$title = esc_html( sprintf( __( '%1$s &raquo; Forum: %2$s - Recent Posts' ), bb_get_option( 'name' ), get_forum_name( $feed_id ) ) );
+			$posts = bb_get_latest_forum_posts( $feed_id );
+			$title = sprintf( __( '%1$s &raquo; Forum: %2$s - Recent Posts' ), bb_get_option( 'name' ), get_forum_name( $feed_id ) );
 			$link = get_forum_link($feed_id);
 			$link_self = bb_get_forum_posts_rss_link($feed_id);
 			break;
 		
 		// Get just the first post from the latest topics
 		case 'all-topics':
-			if ( !$topics = get_latest_topics() )
-				die();
+			$topics = get_latest_topics();
 			
 			$posts = array();
-			foreach ($topics as $topic) {
+			foreach ( (array) $topics as $topic ) {
 				$posts[] = bb_get_first_post($topic->topic_id);
 			}
 			
-			$title = esc_html( sprintf( __( '%1$s &raquo; Recent Topics' ), bb_get_option( 'name' ) ) );
+			$title = sprintf( __( '%1$s &raquo; Recent Topics' ), bb_get_option( 'name' ) );
 			$link = bb_get_uri();
 			$link_self = bb_get_topics_rss_link();
 			break;
@@ -179,18 +173,20 @@ if ( !$bb_db_override ) {
 		// Get latest posts by default
 		case 'all-posts':
 		default:
-			if ( !$posts = bb_get_latest_posts( 35 ) )
-				die();
-			$title = esc_html( sprintf( __( '%1$s &raquo; Recent Posts' ), bb_get_option( 'name' ) ) );
+			$posts = bb_get_latest_posts( 35 );
+			$title = sprintf( __( '%1$s &raquo; Recent Posts' ), bb_get_option( 'name' ) );
 			$link = bb_get_uri();
 			$link_self = bb_get_posts_rss_link();
 			break;
 	}
 }
 
-bb_send_304( $posts[0]->post_time );
+if ( !$posts ) /* We do typecasting in the template, but all themes don't have that! */
+	$posts = array();
+else /* Only send 304 if there are posts */
+	bb_send_304( $posts[0]->post_time );
 
-if (!$description = esc_html( bb_get_option('description') )) {
+if (!$description = bb_get_option( 'description' ) ) {
 	$description = $title;
 }
 $title = apply_filters( 'bb_title_rss', $title, $feed );
diff --git a/wp-content/plugins/buddypress/bp-forums/bbpress/search.php b/wp-content/plugins/buddypress/bp-forums/bbpress/search.php
index d455dd608164ea1d4a302bb3be21f473567886ad..8bf9278545fec629fa7b06c87710620a7df9cbd5 100644
--- a/wp-content/plugins/buddypress/bp-forums/bbpress/search.php
+++ b/wp-content/plugins/buddypress/bp-forums/bbpress/search.php
@@ -1,5 +1,5 @@
 <?php
-require_once('./bb-load.php');
+require_once( './bb-load.php' );
 
 if ( !$q = trim( @$_GET['search'] ) )
 	$q = trim( @$_GET['q'] );
@@ -7,14 +7,22 @@ if ( !$q = trim( @$_GET['search'] ) )
 $bb_query_form = new BB_Query_Form;
 
 if ( $q = stripslashes( $q ) ) {
+	$per_page = ceil( (int) bb_get_option( 'page_topics' ) / 2 );
+	
+	/* Recent */
 	add_filter( 'bb_recent_search_fields',   create_function( '$f', 'return $f . ", MAX(post_time) AS post_time";' ) );
 	add_filter( 'bb_recent_search_group_by', create_function( '', 'return "t.topic_id";' ) );
-	$bb_query_form->BB_Query_Form( 'post', array(), array( 'per_page' => 5, 'post_status' => 0, 'topic_status' => 0, 'post_text' => $q, 'forum_id', 'tag', 'topic_author', 'post_author' ), 'bb_recent_search' );
+	$bb_query_form->BB_Query_Form( 'post', array(), array( 'order_by' => 'p.post_time', 'count' => true, 'per_page' => $per_page, 'post_status' => 0, 'topic_status' => 0, 'post_text' => $q, 'forum_id', 'tag', 'topic_author', 'post_author' ), 'bb_recent_search' );
 	$recent = $bb_query_form->results;
-
-	$bb_query_form->BB_Query_Form( 'topic', array( 'search' => $q ), array( 'post_status' => 0, 'topic_status' => 0, 'search', 'forum_id', 'tag', 'topic_author', 'post_author' ), 'bb_relevant_search' );
+	$recent_count = $recent ? $bb_query_form->found_rows : 0;
+	
+	/* Relevant */
+	$bb_query_form->BB_Query_Form( 'topic', array( 'search' => $q ), array( 'per_page' => $per_page, 'count' => true, 'post_status' => 0, 'topic_status' => 0, 'search', 'forum_id', 'tag', 'topic_author', 'post_author' ), 'bb_relevant_search' );
 	$relevant = $bb_query_form->results;
-
+	$relevant_count = $relevant ? $bb_query_form->found_rows : 0;
+	
+	$search_count = max( $recent_count, $relevant_count );
+	
 	$q = $bb_query_form->get( 'search' );
 }
 
@@ -32,6 +40,4 @@ if ( $recent ) :
 		$topics = bb_append_meta( $topics, 'topic' );
 endif;
 
-bb_load_template( 'search.php', array('q', 'recent', 'relevant'), $q );
-
-?>
+bb_load_template( 'search.php', array( 'q', 'recent', 'relevant', 'per_page', 'search_count' ), $q );
diff --git a/wp-content/plugins/buddypress/bp-forums/bbpress/tag-add.php b/wp-content/plugins/buddypress/bp-forums/bbpress/tag-add.php
index d2c82d0c51e031753fdeb499623f8e7b7f137b70..764f5fbbb9f14ca59bd41780ddaf8ffd948c5a9c 100644
--- a/wp-content/plugins/buddypress/bp-forums/bbpress/tag-add.php
+++ b/wp-content/plugins/buddypress/bp-forums/bbpress/tag-add.php
@@ -1,10 +1,11 @@
 <?php
-require('./bb-load.php');
 
-bb_auth('logged_in');
+require( './bb-load.php' );
+
+bb_auth( 'logged_in' );
 
 if ( !bb_is_user_logged_in() )
-	bb_die(__('You need to be logged in to add a tag.'));
+	bb_die( __( 'You need to be logged in to add a tag.' ) );
 
 $topic_id = (int) @$_POST['id' ];
 $page     = (int) @$_POST['page'];
@@ -13,13 +14,14 @@ $tag      =       stripslashes( $tag );
 
 bb_check_admin_referer( 'add-tag_' . $topic_id );
 
-$topic = get_topic ( $topic_id );
-if ( !$topic )
-	bb_die(__('Topic not found.'));
+if ( !$topic = get_topic ( $topic_id ) )
+	bb_die( __( 'Topic not found.' ) );
 
 if ( bb_add_topic_tags( $topic_id, $tag ) )
 	wp_redirect( get_topic_link( $topic_id, $page ) );
 else
-	bb_die(__('The tag was not added.  Either the tag name was invalid or the topic is closed.'));
+	bb_die( __( 'The tag was not added.  Either the tag name was invalid or the topic is closed.' ) );
+
 exit;
+
 ?>
diff --git a/wp-content/plugins/buddypress/bp-forums/bbpress/tag-remove.php b/wp-content/plugins/buddypress/bp-forums/bbpress/tag-remove.php
index 9135a217e164bf4408c5f7b117ccd784b185e9ef..5cd9827beb5469afbac32b514a5f6bf83e77099f 100644
--- a/wp-content/plugins/buddypress/bp-forums/bbpress/tag-remove.php
+++ b/wp-content/plugins/buddypress/bp-forums/bbpress/tag-remove.php
@@ -1,27 +1,30 @@
 <?php
-require('./bb-load.php');
 
-bb_auth('logged_in');
+require( './bb-load.php' );
 
-$tag_id = (int) @$_GET['tag'];
-$user_id = (int) @$_GET['user'];
+bb_auth( 'logged_in' );
+
+$tag_id   = (int) @$_GET['tag'];
+$user_id  = (int) @$_GET['user'];
 $topic_id = (int) @$_GET['topic'];
 
 bb_check_admin_referer( 'remove-tag_' . $tag_id . '|' . $topic_id );
 
-$tag    =  bb_get_tag ( $tag_id );
-$topic	=  get_topic ( $topic_id );
-$user	=  bb_get_user( $user_id );
+$tag   = bb_get_tag ( $tag_id );
+$topic = get_topic  ( $topic_id );
+$user  = bb_get_user( $user_id );
 
 if ( !$tag || !$topic )
-	bb_die(__('Invalid tag or topic.'));
+	bb_die( __( 'Invalid tag or topic.' ) );
 
 if ( false !== bb_remove_topic_tag( $tag_id, $user_id, $topic_id ) ) {
 	if ( !$redirect = wp_get_referer() )
 		$redirect = get_topic_link( $topic_id );
 	bb_safe_redirect( $redirect );
 } else {
-	bb_die(__('The tag was not removed.'));
+	bb_die( __( 'The tag was not removed.' ) );
 }
+
 exit;
+
 ?>
diff --git a/wp-content/plugins/buddypress/bp-forums/bbpress/tags.php b/wp-content/plugins/buddypress/bp-forums/bbpress/tags.php
index 5e349c2155797091889aec300cb5534a36991239..234c7f9fd96d147f15b4149edafc528da689aadb 100644
--- a/wp-content/plugins/buddypress/bp-forums/bbpress/tags.php
+++ b/wp-content/plugins/buddypress/bp-forums/bbpress/tags.php
@@ -3,11 +3,6 @@ require_once('./bb-load.php');
 
 bb_repermalink();
 
-// Temporary, refactor this!
-
-if ( !$tag && $tag_name )
-	bb_die(__('Tag not found'));
-
 if ( $tag_name && $tag ) :
 
 	if ( $topics = get_tagged_topics($tag->tag_id, $page) ) {
diff --git a/wp-content/plugins/buddypress/bp-forums/bbpress/xmlrpc.php b/wp-content/plugins/buddypress/bp-forums/bbpress/xmlrpc.php
index 6a205239f145a2fb11079b1d7752db5417bc3841..cca1b684122ae285fa1f5fd389e636465c4774e6 100644
--- a/wp-content/plugins/buddypress/bp-forums/bbpress/xmlrpc.php
+++ b/wp-content/plugins/buddypress/bp-forums/bbpress/xmlrpc.php
@@ -158,7 +158,7 @@ class BB_XMLRPC_Server extends IXR_Server
 
 		// Pingback
 		if ( bb_get_option( 'enable_pingback' ) ) {
-			$this->methods = array_merge( $this->methods, array(
+			$this->methods = array_merge( (array)$this->methods, array(
 				'pingback.ping' => 'this:pingback_ping',
 				'pingback.extensions.getPingbacks' => 'this:pingback_extensions_getPingbacks'
 			) );
diff --git a/wp-content/plugins/buddypress/bp-forums/bp-forums-actions.php b/wp-content/plugins/buddypress/bp-forums/bp-forums-actions.php
new file mode 100644
index 0000000000000000000000000000000000000000..6f2585e659d88a3301641593e206f7683f33fb61
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-forums/bp-forums-actions.php
@@ -0,0 +1,5 @@
+<?php
+// Exit if accessed directly
+if ( !defined( 'ABSPATH' ) ) exit;
+
+?>
\ 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 5c319fec09772da5f8be221dd2ce521be12bc4f0..3e96bd53abbd7c2cd7595ae037592a2ecde12378 100644
--- a/wp-content/plugins/buddypress/bp-forums/bp-forums-admin.php
+++ b/wp-content/plugins/buddypress/bp-forums/bp-forums-admin.php
@@ -1,30 +1,85 @@
 <?php
+// Exit if accessed directly
+if ( !defined( 'ABSPATH' ) ) exit;
+
+function bp_forums_add_admin_menu() {
+	global $bp;
+
+	if ( !is_super_admin() )
+		return false;
+
+	// 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' );
+}
+add_action( bp_core_admin_hook(), 'bp_forums_add_admin_menu' );
 
 function bp_forums_bbpress_admin() {
 	global $bp;
-?>
+
+	$action = bp_get_admin_url( 'admin.php?page=bb-forums-setup&reinstall=1' ); ?>
+
 	<div class="wrap">
+		<?php screen_icon( 'buddypress' ); ?>
 
-		<h2><?php _e( 'Forums Setup', 'buddypress' ) ?></h2>
+		<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;
 
-		if ( isset( $_REQUEST['reinstall'] ) || !bp_forums_is_installed_correctly() ) {
-			update_site_option( 'bb-config-location', false );
+		<?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 {
-			$reinstall = network_admin_url( 'admin.php?page=bb-forums-setup&reinstall=1' ); ?>
 
-			<p><?php printf( __( 'bbPress forum integration in BuddyPress has been set up correctly. If you are having problems you can <a href="%s" title="Reinstall bbPress">re-install</a>', 'buddypress' ), $reinstall ); ?>
-			<p><?php _e( 'NOTE: The forums directory will only work if your bbPress tables are in the same database as your WordPress tables. If you are not using an existing bbPress install you can ignore this message.', 'buddypress' ) ?></p>
+		else : ?>
+
+			<div style="width: 45%; float: left; margin-top: 20px;">
+				<h3><?php _e( '(Installed)', 'buddypress' ); ?> <?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( 'Uninstall 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; ?>
 
-		<?php
-		}
-		?>
 	</div>
 <?php
 }
@@ -32,9 +87,11 @@ function bp_forums_bbpress_admin() {
 function bp_forums_bbpress_install_wizard() {
 	$post_url = network_admin_url( 'admin.php?page=bb-forums-setup' );
 
-	switch( $_REQUEST['step'] ) {
+	$step = isset( $_REQUEST['step'] ) ? $_REQUEST['step'] : '';
+
+	switch( $step ) {
 		case 'existing':
-			if ( 1 == (int)$_REQUEST['doinstall'] ) {
+			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 {
@@ -42,8 +99,8 @@ function bp_forums_bbpress_install_wizard() {
 					<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 {
-				?>
+			} 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>
@@ -53,45 +110,91 @@ function bp_forums_bbpress_install_wizard() {
 						<input type="hidden" name="doinstall" value="1" />
 						<?php wp_nonce_field( 'bp_forums_existing_install_init' ) ?>
 					</form>
+
 				<?php
 			}
 		break;
 
 		case 'new':
-			if ( 1 == (int)$_REQUEST['doinstall'] ) {
+			if ( isset( $_REQUEST['doinstall'] ) && 1 == (int)$_REQUEST['doinstall'] ) {
 				$result = bp_forums_bbpress_install();
 
 				switch ( $result ) {
 					case 1:
-						_e( 'All done! Configuration settings have been saved to the file <code>bb-config.php</code> in the root of your WordPress install.', 'buddypress' );
+						_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( '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.', 'buddypress' );
-						?><br /><textarea cols="110" rows="50" style="margin: 10px 0 50px 0;"><?php echo htmlspecialchars( $result ) ?></textarea><?php
+						_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 {
-			?>
+			} 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
+
+				<?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 { ?>
 
-				<p><?php _e( 'Forums in BuddyPress make use of a bbPress installation to function. You can choose to either let BuddyPress set up a new bbPress install, or use an already existing bbPress install. Please choose one of the options below.', 'buddypress' ) ?></p>
+			<?php } else {
 
-				<a class="button" href="<?php echo $post_url . '&step=new' ?>"><?php _e( 'Set up a new bbPress installation', 'buddypress' ) ?></a> &nbsp;
-				<a class="button" href="<?php echo $post_url . '&step=existing' ?>"><?php _e( 'Use an existing bbPress installation', 'buddypress' ) ?></a>
+				// 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;
@@ -103,7 +206,7 @@ function bp_forums_configure_existing_install() {
 
 	check_admin_referer( 'bp_forums_existing_install_init' );
 
-	/* Sanitize $_REQUEST['bbconfigloc'] */
+	// Sanitize $_REQUEST['bbconfigloc']
 	$_REQUEST['bbconfigloc'] = apply_filters( 'bp_forums_bbconfig_location', $_REQUEST['bbconfigloc'] );
 
 	if ( false === strpos( $_REQUEST['bbconfigloc'], 'bb-config.php' ) ) {
@@ -113,11 +216,11 @@ function bp_forums_configure_existing_install() {
 		$_REQUEST['bbconfigloc'] .= 'bb-config.php';
 	}
 
+	bp_update_option( 'bb-config-location', $_REQUEST['bbconfigloc'] );
+
 	if ( !file_exists( $_REQUEST['bbconfigloc'] ) )
 		return false;
 
-	update_site_option( 'bb-config-location', $_REQUEST['bbconfigloc'] );
-
 	return true;
 }
 
@@ -126,41 +229,43 @@ function bp_forums_bbpress_install() {
 
 	check_admin_referer( 'bp_forums_new_install_init' );
 
-	/* Create the bb-config.php file */
+	// 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',
 		array(
-			"define( 'BBDB_NAME',"  		=> array( "'bbpress'",                     	"'" . DB_NAME . "'" ),
-			"define( 'BBDB_USER',"  		=> array( "'username'",                    	"'" . DB_USER . "'" ),
-			"define( 'BBDB_PASSWO"  		=> array( "'password'",                    	"'" . DB_PASSWORD . "'" ),
-			"define( 'BBDB_HOST',"  		=> array( "'localhost'",                   	"'" . DB_HOST . "'" ),
-			"define( 'BBDB_CHARSE"  		=> array( "'utf8'",                        	"'" . DB_CHARSET . "'" ),
-			"define( 'BBDB_COLLAT"  		=> array( "''",                            	"'" . DB_COLLATE . "'" ),
-			"define( 'BB_AUTH_KEY"  		=> array( "'put your unique phrase here'",  "'" . addslashes( AUTH_KEY ) . "'" ),
-			"define( 'BB_SECURE_A"  		=> array( "'put your unique phrase here'",  "'" . addslashes( SECURE_AUTH_KEY ) . "'" ),
-			"define( 'BB_LOGGED_I"  		=> array( "'put your unique phrase here'",  "'" . addslashes( LOGGED_IN_KEY ) . "'" ),
-			"define( 'BB_NONCE_KE"  		=> array( "'put your unique phrase here'",  "'" . addslashes( NONCE_KEY ) . "'" ),
-			"\$bb_table_prefix = '" 		=> array( "'bb_'",                          "'" . $bp->table_prefix . "bb_'" ),
-			"define( 'BB_LANG', '" 			=> array( "''",                          	"'" . WPLANG . "'" )
+			"define( 'BBDB_NAME',"  => array( "'bbpress'",                     	"'" . DB_NAME . "'" ),
+			"define( 'BBDB_USER',"  => array( "'username'",                    	"'" . DB_USER . "'" ),
+			"define( 'BBDB_PASSWO"  => array( "'password'",                    	"'" . DB_PASSWORD . "'" ),
+			"define( 'BBDB_HOST',"  => array( "'localhost'",                   	"'" . DB_HOST . "'" ),
+			"define( 'BBDB_CHARSE"  => array( "'utf8'",                        	"'" . DB_CHARSET . "'" ),
+			"define( 'BBDB_COLLAT"  => array( "''",                            	"'" . DB_COLLATE . "'" ),
+			"define( 'BB_AUTH_KEY"  => array( "'put your unique phrase here'",  "'" . addslashes( AUTH_KEY ) . "'" ),
+			"define( 'BB_SECURE_A"  => array( "'put your unique phrase here'",  "'" . addslashes( SECURE_AUTH_KEY ) . "'" ),
+			"define( 'BB_LOGGED_I"  => array( "'put your unique phrase here'",  "'" . addslashes( LOGGED_IN_KEY ) . "'" ),
+			"define( 'BB_NONCE_KE"  => array( "'put your unique phrase here'",  "'" . addslashes( NONCE_KEY ) . "'" ),
+			"\$bb_table_prefix = '" => array( "'bb_'",                          "'" . $bp->table_prefix . "bb_'" ),
+			"define( 'BB_LANG', '"  => array( "''",                             "'" . get_locale() . "'" )
 		)
 	);
 
-	/* Add the custom user and usermeta entries to the config file */
-	if ( $initial_write == 1 ) {
+	// Add the custom user and usermeta entries to the config file
+	if ( $initial_write == 1 )
 		$file = file_get_contents( ABSPATH . 'bb-config.php' );
-	} else {
+	else
 		$file = &$initial_write;
-	}
 
-	$file = substr( $file, 0, -2 );
+	$file = trim( $file );
+	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_ROOT_BLOG, 'name' ) . ' ' . __( 'Forums', 'buddypress' ) . '\';';
+	$file .= "\n" .   '$bb->name = \'' . get_blog_option( bp_get_root_blog_id(), 'blogname' ) . ' ' . __( 'Forums', 'buddypress' ) . '\';';
 
-	if ( bp_core_is_multisite() )
-		$file .= "\n" .   '$bb->wordpress_mu_primary_blog_id = ' . BP_ROOT_BLOG . ';';
+	if ( is_multisite() )
+		$file .= "\n" .   '$bb->wordpress_mu_primary_blog_id = ' . bp_get_root_blog_id() . ';';
 
 	if ( defined( 'AUTH_SALT' ) )
 		$file .= "\n\n" . 'define(\'BB_AUTH_SALT\', \'' . addslashes( AUTH_SALT ) . '\');';
@@ -182,22 +287,20 @@ function bp_forums_bbpress_install() {
 		$initial_write = $file;
 	}
 
-	update_site_option( 'bb-config-location', ABSPATH . 'bb-config.php' );
+	bp_update_option( 'bb-config-location', ABSPATH . 'bb-config.php' );
 	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 ( !$file_source || !file_exists( $file_source ) || !is_file( $file_source ) )
 		return -1;
-	}
 
-	if ( !$file_target ) {
+	if ( !$file_target )
 		$file_target = $file_source;
-	}
 
-	if ( !$alterations || !is_array( $alterations ) ) {
+	if ( !$alterations || !is_array( $alterations ) )
 		return -2;
-	}
 
 	// Get the existing lines in the file
 	$lines = file( $file_source );
@@ -232,7 +335,7 @@ function bp_forums_bbpress_write( $file_source, $file_target, $alterations ) {
 		}
 	}
 
-	if ( !$writable )
+	if ( empty( $writable ) )
 		return trim( join( null, $modified_lines ) );
 
 	// Open the file for writing - rewrites the whole file
@@ -256,4 +359,5 @@ 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
new file mode 100644
index 0000000000000000000000000000000000000000..1c700d8419cfa3c916861f4bb1aa28819b021b49
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-forums/bp-forums-bbpress-sa.php
@@ -0,0 +1,428 @@
+<?php
+// Exit if accessed directly
+if ( !defined( 'ABSPATH' ) ) exit;
+
+function bp_forums_load_bbpress() {
+	global $bp, $wpdb, $wp_roles, $current_user, $wp_users_object;
+	global $bb, $bbdb, $bb_table_prefix, $bb_current_user;
+	global $bb_roles, $wp_taxonomy_object, $bb_queries;
+
+	// Return if we've already run this function.
+	if ( is_object( $bbdb ) )
+		return;
+
+	if ( !bp_forums_is_installed_correctly() )
+		return false;
+
+	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_INC', 'bb-includes/' );
+
+	require( BB_PATH . BB_INC . 'class.bb-query.php' );
+	require( BB_PATH . BB_INC . 'class.bb-walker.php' );
+
+	require( BB_PATH . BB_INC . 'functions.bb-core.php' );
+	require( BB_PATH . BB_INC . 'functions.bb-forums.php' );
+	require( BB_PATH . BB_INC . 'functions.bb-topics.php' );
+	require( BB_PATH . BB_INC . 'functions.bb-posts.php' );
+	require( BB_PATH . BB_INC . 'functions.bb-topic-tags.php' );
+	require( BB_PATH . BB_INC . 'functions.bb-capabilities.php' );
+	require( BB_PATH . BB_INC . 'functions.bb-meta.php' );
+	require( BB_PATH . BB_INC . 'functions.bb-pluggable.php' );
+	require( BB_PATH . BB_INC . 'functions.bb-formatting.php' );
+	require( BB_PATH . BB_INC . 'functions.bb-template.php' );
+
+	require( BACKPRESS_PATH . 'class.wp-taxonomy.php' );
+	require( BB_PATH . BB_INC . 'class.bb-taxonomy.php' );
+
+	require( BB_PATH . 'bb-admin/includes/functions.bb-admin.php' );
+
+	$bb = new stdClass();
+	require( $bp->forums->bbconfig );
+
+	// Setup the global database connection
+	$bbdb = new BPDB ( BBDB_USER, BBDB_PASSWORD, BBDB_NAME, BBDB_HOST );
+
+	// Set the table names
+	$bbdb->forums             = $bb_table_prefix . 'forums';
+	$bbdb->meta               = $bb_table_prefix . 'meta';
+	$bbdb->posts              = $bb_table_prefix . 'posts';
+	$bbdb->terms              = $bb_table_prefix . 'terms';
+	$bbdb->term_relationships = $bb_table_prefix . 'term_relationships';
+	$bbdb->term_taxonomy      = $bb_table_prefix . 'term_taxonomy';
+	$bbdb->topics             = $bb_table_prefix . 'topics';
+
+	if ( isset( $bb->custom_user_table ) )
+		$bbdb->users = $bb->custom_user_table;
+	else
+		$bbdb->users = $wpdb->users;
+
+	if ( isset( $bb->custom_user_meta_table ) )
+		$bbdb->usermeta = $bb->custom_user_meta_table;
+	else
+		$bbdb->usermeta = $wpdb->usermeta;
+
+	$bbdb->prefix = $bb_table_prefix;
+
+	define( 'BB_INSTALLING', false );
+
+	if ( is_object( $wp_roles ) ) {
+		$bb_roles = $wp_roles;
+		bb_init_roles( $bb_roles );
+	}
+
+	do_action( 'bb_got_roles' );
+	do_action( 'bb_init'      );
+	do_action( 'init_roles'   );
+
+	$bb_current_user = $current_user;
+	$wp_users_object = new BP_Forums_BB_Auth;
+
+	if ( !isset( $wp_taxonomy_object ) )
+		$wp_taxonomy_object = new BB_Taxonomy( $bbdb );
+
+	$wp_taxonomy_object->register_taxonomy( 'bb_topic_tag', 'bb_topic' );
+
+	// Set a site id if there isn't one already
+	if ( !isset( $bb->site_id ) )
+		$bb->site_id = bp_get_root_blog_id();
+
+	// Check if the tables are installed, if not, install them
+	if ( !$tables_installed = (boolean) $bbdb->get_results( 'DESCRIBE `' . $bbdb->forums . '`;', ARRAY_A ) ) {
+		require( BB_PATH . 'bb-admin/includes/defaults.bb-schema.php' );
+
+		// Backticks and "IF NOT EXISTS" break the dbDelta function.
+		bp_bb_dbDelta( str_replace( ' IF NOT EXISTS', '', str_replace( '`', '', $bb_queries ) ) );
+
+		require( BB_PATH . 'bb-admin/includes/functions.bb-upgrade.php' );
+		bb_update_db_version();
+
+		// 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 ) );
+
+		// Create the first forum.
+		bb_new_forum( array( 'forum_name' => 'Default Forum' ) );
+
+		// Set the site URI
+		bb_update_option( 'uri', BB_URL );
+	}
+
+	register_shutdown_function( create_function( '', 'do_action("bb_shutdown");' ) );
+}
+add_action( 'bbpress_init', 'bp_forums_load_bbpress' );
+
+/* WP to bbP wrapper functions */
+function bb_get_current_user() { global $current_user; return $current_user; }
+function bb_get_user( $user_id ) { return get_userdata( $user_id ); }
+function bb_cache_users( $users ) {}
+
+/**
+ * bbPress needs this class for its usermeta manipulation.
+ */
+class BP_Forums_BB_Auth {
+	function update_meta( $args = '' ) {
+		$defaults = array( 'id' => 0, 'meta_key' => null, 'meta_value' => null, 'meta_table' => 'usermeta', 'meta_field' => 'user_id', 'cache_group' => 'users' );
+		$args = wp_parse_args( $args, $defaults );
+		extract( $args, EXTR_SKIP );
+
+		return update_user_meta( $id, $meta_key, $meta_value );
+	}
+}
+
+/**
+ * bbPress needs the DB class to be BPDB, but we want to use WPDB, so we can
+ * extend it and use this.
+ *
+ * The class is pluggable, so that plugins that swap out WPDB with a custom
+ * database class (such as HyperDB and SharDB) can provide their own versions
+ * of BPDB which extend the appropriate base class.
+ */
+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 );
+
+			$args = func_get_args();
+			$args = call_user_func_array( array( &$this, 'init' ), $args );
+
+			if ( $args['host'] )
+				$this->db_servers['dbh_global'] = $args;
+		}
+
+		/**
+		 * Determine if a database supports a particular feature.
+		 *
+		 * Overriden here to work around differences between bbPress', and WordPress', implementation differences.
+		 * In particular, when BuddyPress tries to run bbPress' SQL installation script, the collation check always
+		 * failed. The capability is long supported by WordPress' minimum required MySQL version, so this is safe.
+		 */
+		function has_cap( $db_cap, $_table_name='' ) {
+			if ( 'collation' == $db_cap )
+				return true;
+
+			return parent::has_cap( $db_cap );
+		}
+
+		/**
+		 * Initialises the class variables based on provided arguments.
+		 * Based on, and taken from, the BackPress class in turn taken from the 1.0 branch of bbPress.
+		 */
+		function init( $args ) {
+			if ( 4 == func_num_args() ) {
+				$args = array(
+						'user'     => $args,
+						'password' => func_get_arg( 1 ),
+						'name'     => func_get_arg( 2 ),
+						'host'     => func_get_arg( 3 ),
+						'charset'  => defined( 'BBDB_CHARSET' ) ? BBDB_CHARSET : false,
+						'collate'  => defined( 'BBDB_COLLATE' ) ? BBDB_COLLATE : false,
+					     );
+			}
+
+			$defaults = array(
+					'user'     => false,
+					'password' => false,
+					'name'     => false,
+					'host'     => 'localhost',
+					'charset'  => false,
+					'collate'  => false,
+					'errors'   => false
+					);
+
+			return wp_parse_args( $args, $defaults );
+		}
+
+		function escape_deep( $data ) {
+			return $this->escape( $data );
+		}
+	}
+endif; // class_exists( 'BPDB' )
+
+/* BBPress needs this function to convert vars */
+function backpress_convert_object( &$object, $output ) {
+	if ( is_array( $object ) ) {
+		foreach ( array_keys( $object ) as $key )
+			backpress_convert_object( $object[$key], $output );
+	} else {
+		switch ( $output ) {
+			case OBJECT  : break;
+			case ARRAY_A : $object = get_object_vars($object); break;
+			case ARRAY_N : $object = array_values(get_object_vars($object)); break;
+		}
+	}
+}
+
+/**
+ * Copied from wp-admin/includes/upgrade.php, this will take care of creating
+ * the bbPress stand-alone tables without loading a conflicting WP Admin.
+ *
+ * @param unknown_type $queries
+ * @param unknown_type $execute
+ * @return unknown
+ */
+function bp_bb_dbDelta($queries, $execute = true) {
+	global $wpdb;
+
+	// Separate individual queries into an array
+	if ( !is_array($queries) ) {
+		$queries = explode( ';', $queries );
+		if ('' == $queries[count($queries) - 1]) array_pop($queries);
+	}
+
+	$cqueries = array(); // Creation Queries
+	$iqueries = array(); // Insertion Queries
+	$for_update = array();
+
+	// Create a tablename index for an array ($cqueries) of queries
+	foreach($queries as $qry) {
+		if (preg_match("|CREATE TABLE ([^ ]*)|", $qry, $matches)) {
+			$cqueries[trim( strtolower($matches[1]), '`' )] = $qry;
+			$for_update[$matches[1]] = 'Created table '.$matches[1];
+		} else if (preg_match("|CREATE DATABASE ([^ ]*)|", $qry, $matches)) {
+			array_unshift($cqueries, $qry);
+		} else if (preg_match("|INSERT INTO ([^ ]*)|", $qry, $matches)) {
+			$iqueries[] = $qry;
+		} else if (preg_match("|UPDATE ([^ ]*)|", $qry, $matches)) {
+			$iqueries[] = $qry;
+		} else {
+			// Unrecognized query type
+		}
+	}
+
+	// Check to see which tables and fields exist
+	if ($tables = $wpdb->get_col('SHOW TABLES;')) {
+		// For every table in the database
+		foreach ($tables as $table) {
+			// Upgrade global tables only for the main site. Don't upgrade at all if DO_NOT_UPGRADE_GLOBAL_TABLES is defined.
+			if ( in_array($table, $wpdb->tables('global')) && ( !is_main_site() || defined('DO_NOT_UPGRADE_GLOBAL_TABLES') ) )
+				continue;
+
+			// If a table query exists for the database table...
+			if ( array_key_exists(strtolower($table), $cqueries) ) {
+				// Clear the field and index arrays
+				$cfields = $indices = array();
+				// Get all of the field names in the query from between the parens
+				preg_match("|\((.*)\)|ms", $cqueries[strtolower($table)], $match2);
+				$qryline = trim($match2[1]);
+
+				// Separate field lines into an array
+				$flds = explode("\n", $qryline);
+
+				//echo "<hr/><pre>\n".print_r(strtolower($table), true).":\n".print_r($cqueries, true)."</pre><hr/>";
+
+				// For every field line specified in the query
+				foreach ($flds as $fld) {
+					// Extract the field name
+					preg_match("|^([^ ]*)|", trim($fld), $fvals);
+					$fieldname = trim( $fvals[1], '`' );
+
+					// Verify the found field name
+					$validfield = true;
+					switch (strtolower($fieldname)) {
+					case '':
+					case 'primary':
+					case 'index':
+					case 'fulltext':
+					case 'unique':
+					case 'key':
+						$validfield = false;
+						$indices[] = trim(trim($fld), ", \n");
+						break;
+					}
+					$fld = trim($fld);
+
+					// If it's a valid field, add it to the field array
+					if ($validfield) {
+						$cfields[strtolower($fieldname)] = trim($fld, ", \n");
+					}
+				}
+
+				// Fetch the table column structure from the database
+				$tablefields = $wpdb->get_results("DESCRIBE {$table};");
+
+				// For every field in the table
+				foreach ($tablefields as $tablefield) {
+					// If the table field exists in the field array...
+					if (array_key_exists(strtolower($tablefield->Field), $cfields)) {
+						// Get the field type from the query
+						preg_match("|".$tablefield->Field." ([^ ]*( unsigned)?)|i", $cfields[strtolower($tablefield->Field)], $matches);
+						$fieldtype = $matches[1];
+
+						// Is actual field type different from the field type in query?
+						if ($tablefield->Type != $fieldtype) {
+							// Add a query to change the column type
+							$cqueries[] = "ALTER TABLE {$table} CHANGE COLUMN {$tablefield->Field} " . $cfields[strtolower($tablefield->Field)];
+							$for_update[$table.'.'.$tablefield->Field] = "Changed type of {$table}.{$tablefield->Field} from {$tablefield->Type} to {$fieldtype}";
+						}
+
+						// Get the default value from the array
+							//echo "{$cfields[strtolower($tablefield->Field)]}<br>";
+						if (preg_match("| DEFAULT '(.*)'|i", $cfields[strtolower($tablefield->Field)], $matches)) {
+							$default_value = $matches[1];
+							if ($tablefield->Default != $default_value) {
+								// Add a query to change the column's default value
+								$cqueries[] = "ALTER TABLE {$table} ALTER COLUMN {$tablefield->Field} SET DEFAULT '{$default_value}'";
+								$for_update[$table.'.'.$tablefield->Field] = "Changed default value of {$table}.{$tablefield->Field} from {$tablefield->Default} to {$default_value}";
+							}
+						}
+
+						// Remove the field from the array (so it's not added)
+						unset($cfields[strtolower($tablefield->Field)]);
+					} else {
+						// This field exists in the table, but not in the creation queries?
+					}
+				}
+
+				// For every remaining field specified for the table
+				foreach ($cfields as $fieldname => $fielddef) {
+					// Push a query line into $cqueries that adds the field to that table
+					$cqueries[] = "ALTER TABLE {$table} ADD COLUMN $fielddef";
+					$for_update[$table.'.'.$fieldname] = 'Added column '.$table.'.'.$fieldname;
+				}
+
+				// Index stuff goes here
+				// Fetch the table index structure from the database
+				$tableindices = $wpdb->get_results("SHOW INDEX FROM {$table};");
+
+				if ($tableindices) {
+					// Clear the index array
+					unset($index_ary);
+
+					// For every index in the table
+					foreach ($tableindices as $tableindex) {
+						// Add the index to the index data array
+						$keyname = $tableindex->Key_name;
+						$index_ary[$keyname]['columns'][] = array('fieldname' => $tableindex->Column_name, 'subpart' => $tableindex->Sub_part);
+						$index_ary[$keyname]['unique'] = ($tableindex->Non_unique == 0)?true:false;
+					}
+
+					// For each actual index in the index array
+					foreach ($index_ary as $index_name => $index_data) {
+						// Build a create string to compare to the query
+						$index_string = '';
+						if ($index_name == 'PRIMARY') {
+							$index_string .= 'PRIMARY ';
+						} else if($index_data['unique']) {
+							$index_string .= 'UNIQUE ';
+						}
+						$index_string .= 'KEY ';
+						if ($index_name != 'PRIMARY') {
+							$index_string .= $index_name;
+						}
+						$index_columns = '';
+						// For each column in the index
+						foreach ($index_data['columns'] as $column_data) {
+							if ($index_columns != '') $index_columns .= ',';
+							// Add the field to the column list string
+							$index_columns .= $column_data['fieldname'];
+							if ($column_data['subpart'] != '') {
+								$index_columns .= '('.$column_data['subpart'].')';
+							}
+						}
+						// Add the column list to the index create string
+						$index_string .= ' ('.$index_columns.')';
+						if (!(($aindex = array_search($index_string, $indices)) === false)) {
+							unset($indices[$aindex]);
+							//echo "<pre style=\"border:1px solid #ccc;margin-top:5px;\">{$table}:<br />Found index:".$index_string."</pre>\n";
+						}
+						//else echo "<pre style=\"border:1px solid #ccc;margin-top:5px;\">{$table}:<br /><b>Did not find index:</b>".$index_string."<br />".print_r($indices, true)."</pre>\n";
+					}
+				}
+
+				// For every remaining index specified for the table
+				foreach ( (array) $indices as $index ) {
+					// Push a query line into $cqueries that adds the index to that table
+					$cqueries[] = "ALTER TABLE {$table} ADD $index";
+					$for_update[$table.'.'.$fieldname] = 'Added index '.$table.' '.$index;
+				}
+
+				// Remove the original table creation query from processing
+				unset($cqueries[strtolower($table)]);
+				unset($for_update[strtolower($table)]);
+			} else {
+				// This table exists in the database, but not in the creation queries?
+			}
+		}
+	}
+
+	$allqueries = array_merge($cqueries, $iqueries);
+	if ($execute) {
+		foreach ($allqueries as $query) {
+			//echo "<pre style=\"border:1px solid #ccc;margin-top:5px;\">".print_r($query, true)."</pre>\n";
+			$wpdb->query($query);
+		}
+	}
+
+	return $for_update;
+}
+
+?>
diff --git a/wp-content/plugins/buddypress/bp-forums/bp-forums-bbpress.php b/wp-content/plugins/buddypress/bp-forums/bp-forums-bbpress.php
index 539f70984bbef84d1db67465ad893b2e24cd3106..71da6c37338f2fe4fd9c03cdfbdea71385cde742 100644
--- a/wp-content/plugins/buddypress/bp-forums/bp-forums-bbpress.php
+++ b/wp-content/plugins/buddypress/bp-forums/bp-forums-bbpress.php
@@ -1,227 +1,8 @@
 <?php
-function bp_forums_load_bbpress() {
-	global $bp, $wpdb, $wp_roles, $current_user, $wp_users_object;
-	global $bb, $bbdb, $bb_table_prefix, $bb_current_user;
-	global $bb_roles, $wp_taxonomy_object;
-
-	/* Return if we've already run this function. */
-	if ( is_object( $bbdb ) && is_object( $bb_roles ) )
-		return;
-
-	if ( !bp_forums_is_installed_correctly() )
-		return false;
-
-	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_INC', 'bb-includes/' );
-
-	require_once( BB_PATH . BB_INC . 'class.bb-query.php' );
-	require_once( BB_PATH . BB_INC . 'class.bb-walker.php' );
-
-	require_once( BB_PATH . BB_INC . 'functions.bb-core.php' );
-	require_once( BB_PATH . BB_INC . 'functions.bb-forums.php' );
-	require_once( BB_PATH . BB_INC . 'functions.bb-topics.php' );
-	require_once( BB_PATH . BB_INC . 'functions.bb-posts.php' );
-	require_once( BB_PATH . BB_INC . 'functions.bb-topic-tags.php' );
-	require_once( BB_PATH . BB_INC . 'functions.bb-capabilities.php' );
-	require_once( BB_PATH . BB_INC . 'functions.bb-meta.php' );
-	require_once( BB_PATH . BB_INC . 'functions.bb-pluggable.php' );
-	require_once( BB_PATH . BB_INC . 'functions.bb-formatting.php' );
-	require_once( BB_PATH . BB_INC . 'functions.bb-template.php' );
-
-	require_once( BACKPRESS_PATH . 'class.wp-taxonomy.php' );
-	require_once( BB_PATH . BB_INC . 'class.bb-taxonomy.php' );
-
-	$bb = new stdClass();
-	require_once( $bp->forums->bbconfig );
-
-	// Setup the global database connection
-	$bbdb = new BPDB ( BBDB_USER, BBDB_PASSWORD, BBDB_NAME, BBDB_HOST );
-
-	/* Set the table names */
-	$bbdb->forums = $bb_table_prefix . 'forums';
-	$bbdb->meta = $bb_table_prefix . 'meta';
-	$bbdb->posts = $bb_table_prefix . 'posts';
-	$bbdb->terms = $bb_table_prefix . 'terms';
-	$bbdb->term_relationships = $bb_table_prefix . 'term_relationships';
-	$bbdb->term_taxonomy = $bb_table_prefix . 'term_taxonomy';
-	$bbdb->topics = $bb_table_prefix . 'topics';
-
-	if ( isset( $bb->custom_user_table ) )
-		$bbdb->users = $bb->custom_user_table;
-	else
-		$bbdb->users = $wpdb->users;
-
-	if ( isset( $bb->custom_user_meta_table ) )
-		$bbdb->usermeta = $bb->custom_user_meta_table;
-	else
-		$bbdb->usermeta = $wpdb->usermeta;
-
-	$bbdb->prefix = $bb_table_prefix;
-
-	define( 'BB_INSTALLING', false );
-
-	/* This must be loaded before functionss.bb-admin.php otherwise we get a function conflict. */
-	if ( !$tables_installed = (boolean) $bbdb->get_results( 'DESCRIBE `' . $bbdb->forums . '`;', ARRAY_A ) )
-		require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
-
-	require_once( BB_PATH . 'bb-admin/includes/functions.bb-admin.php' );
-
-	if ( is_object( $wp_roles ) ) {
-		$bb_roles = $wp_roles;
-		bb_init_roles( $bb_roles );
-	}
-
-	do_action( 'bb_got_roles' );
-	do_action( 'bb_init' );
-	do_action( 'init_roles' );
-
-	$bb_current_user = $current_user;
-	$wp_users_object = new BP_Forums_BB_Auth;
-
-	if ( !isset( $wp_taxonomy_object ) )
-		$wp_taxonomy_object = new BB_Taxonomy( $bbdb );
-
-	$wp_taxonomy_object->register_taxonomy( 'bb_topic_tag', 'bb_topic' );
-
-	// Set a site id if there isn't one already
-	if ( !isset( $bb->site_id ) )
-		$bb->site_id = BP_ROOT_BLOG;
-
-	/* Check if the tables are installed, if not, install them */
-	if ( !$tables_installed ) {
-		require_once( BB_PATH . 'bb-admin/includes/defaults.bb-schema.php' );
-
-		/* Backticks and "IF NOT EXISTS" break the dbDelta function. */
-		dbDelta( str_replace( ' IF NOT EXISTS', '', str_replace( '`', '', $bb_queries ) ) );
-
-		require_once( BB_PATH . 'bb-admin/includes/functions.bb-upgrade.php' );
-		bb_update_db_version();
-
-		/* 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 ) );
-
-		// Create the first forum.
-		bb_new_forum( array( 'forum_name' => 'Default Forum' ) );
-
-		// Set the site URI
-		bb_update_option( 'uri', BB_URL );
-	}
-
-	register_shutdown_function( create_function( '', 'do_action("bb_shutdown");' ) );
-}
-add_action( 'bbpress_init', 'bp_forums_load_bbpress' );
-
-/* WP to bbP wrapper functions */
-function bb_get_current_user() { global $current_user; return $current_user; }
-function bb_get_user( $user_id ) { return get_userdata( $user_id ); }
-function bb_cache_users( $users ) {}
-
-/**
- * bbPress needs this class for its usermeta manipulation.
- */
-class BP_Forums_BB_Auth {
-	function update_meta( $args = '' ) {
-		$defaults = array( 'id' => 0, 'meta_key' => null, 'meta_value' => null, 'meta_table' => 'usermeta', 'meta_field' => 'user_id', 'cache_group' => 'users' );
-		$args = wp_parse_args( $args, $defaults );
-		extract( $args, EXTR_SKIP );
-
-		return update_user_meta( $id, $meta_key, $meta_value );
-	}
-}
-
 /**
- * bbPress needs the DB class to be BPDB, but we want to use WPDB, so we can
- * extend it and use this.
+ * Placeholder for bbPress plugin bridge
  */
-class BPDB extends WPDB {
-	var $db_servers = array();
-
-	function BPDB( $dbuser, $dbpassword, $dbname, $dbhost ) {
-		parent::WPDB( $dbuser, $dbpassword, $dbname, $dbhost );
-
-		$args = func_get_args();
-		$args = call_user_func_array( array( &$this, '_init' ), $args );
-
-		if ( $args['host'] )
-			$this->db_servers['dbh_global'] = $args;
-	}
-
-	/**
-	 * Determine if a database supports a particular feature.
-	 *
-	 * Overriden here to work around differences between bbPress', and WordPress', implementation differences.
-	 * In particular, when BuddyPress tries to run bbPress' SQL installation script, the collation check always
-	 * failed. The capability is long supported by WordPress' minimum required MySQL version, so this is safe.
-	 */
-	function has_cap( $db_cap, $_table_name='' ) {
-		if ( 'collation' == $db_cap )
-			return true;
-
-		return parent::has_cap( $db_cap );
-	}
-
-	/**
-	 * Initialises the class variables based on provided arguments.
-	 * Based on, and taken from, the BackPress class in turn taken from the 1.0 branch of bbPress.
-	 */
-	function _init( $args )
-	{
-		if ( 4 == func_num_args() ) {
-			$args = array(
-				'user'     => $args,
-				'password' => func_get_arg( 1 ),
-				'name'     => func_get_arg( 2 ),
-				'host'     => func_get_arg( 3 ),
-				'charset'  => defined( 'BBDB_CHARSET' ) ? BBDB_CHARSET : false,
-				'collate'  => defined( 'BBDB_COLLATE' ) ? BBDB_COLLATE : false,
-			);
-		}
-
-		$defaults = array(
-			'user'     => false,
-			'password' => false,
-			'name'     => false,
-			'host'     => 'localhost',
-			'charset'  => false,
-			'collate'  => false,
-			'errors'   => false
-		);
-
-		return wp_parse_args( $args, $defaults );
-	}
-
-	function escape_deep( $data ) {
-		if ( is_array( $data ) ) {
-			foreach ( (array) $data as $k => $v ) {
-				if ( is_array( $v ) ) {
-					$data[$k] = $this->_escape( $v );
-				} else {
-					$data[$k] = $this->_real_escape( $v );
-				}
-			}
-		} else {
-			$data = $this->_real_escape( $data );
-		}
-
-		return $data;
-	}
-}
 
-/* BBPress needs this function to convert vars */
-function backpress_convert_object( &$object, $output ) {
-	if ( is_array( $object ) ) {
-		foreach ( array_keys( $object ) as $key )
-			backpress_convert_object( $object[$key], $output );
-	} else {
-		switch ( $output ) {
-			case OBJECT  : break;
-			case ARRAY_A : $object = get_object_vars($object); break;
-			case ARRAY_N : $object = array_values(get_object_vars($object)); break;
-		}
-	}
-}
+// Exit if accessed directly
+if ( !defined( 'ABSPATH' ) ) exit;
 ?>
\ No newline at end of file
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 3c34946c608b86f1e2d32d7162f7140c8bfae7d6..008dc534f069e12f0dc1273f652ad8bff758f36b 100644
--- a/wp-content/plugins/buddypress/bp-forums/bp-forums-filters.php
+++ b/wp-content/plugins/buddypress/bp-forums/bp-forums-filters.php
@@ -1,4 +1,6 @@
 <?php
+// Exit if accessed directly
+if ( !defined( 'ABSPATH' ) ) exit;
 
 /* Apply WordPress defined filters */
 add_filter( 'bp_forums_bbconfig_location', 'wp_filter_kses', 1 );
@@ -8,7 +10,7 @@ add_filter( 'bp_get_the_topic_title', 'wp_filter_kses', 1 );
 add_filter( 'bp_get_the_topic_latest_post_excerpt', 'bp_forums_filter_kses', 1 );
 add_filter( 'bp_get_the_topic_post_content', 'bp_forums_filter_kses', 1 );
 
-add_filter( 'bp_get_the_topic_title', 'force_balance_tags' ); 
+add_filter( 'bp_get_the_topic_title', 'force_balance_tags' );
 add_filter( 'bp_get_the_topic_latest_post_excerpt', 'force_balance_tags' );
 add_filter( 'bp_get_the_topic_post_content', 'force_balance_tags' );
 
@@ -36,7 +38,7 @@ add_filter( 'bp_get_the_topic_poster_name', 'stripslashes_deep' );
 add_filter( 'bp_get_the_topic_last_poster_name', 'stripslashes_deep' );
 add_filter( 'bp_get_the_topic_object_name', 'stripslashes_deep' );
 
-add_filter( 'bp_get_the_topic_post_content', 'make_clickable' );
+add_filter( 'bp_get_the_topic_post_content', 'make_clickable', 9 );
 
 add_filter( 'bp_get_forum_topic_count_for_user', 'bp_core_number_format' );
 add_filter( 'bp_get_forum_topic_count', 'bp_core_number_format' );
@@ -75,7 +77,7 @@ function bp_forums_filter_kses( $content ) {
 function bp_forums_filter_tag_link( $link, $tag, $page, $context ) {
 	global $bp;
 
-	return apply_filters( 'bp_forums_filter_tag_link', $bp->root_domain . '/' . $bp->forums->slug . '/tag/' . $tag . '/' );
+	return apply_filters( 'bp_forums_filter_tag_link', bp_get_root_domain() . '/' . bp_get_forums_root_slug() . '/tag/' . $tag . '/' );
 }
 add_filter( 'bb_get_tag_link', 'bp_forums_filter_tag_link', 10, 4);
 
@@ -94,20 +96,114 @@ function bp_forums_make_nofollow_filter( $text ) {
  * Append forum topic to page title
  *
  * @global object $bp
- * @param string $title
+ * @param string $title New page title; see bp_modify_page_title()
+ * @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
+ * @see bp_modify_page_title()
  */
-function bp_forums_add_forum_topic_to_page_title( $title ) {
+function bp_forums_add_forum_topic_to_page_title( $title, $original_title, $sep, $seplocation  ) {
 	global $bp;
 
-	if ( $bp->current_action == 'forum' && $bp->action_variables[0] == 'topic' ) {
-		if ( bp_has_forum_topic_posts() ) {
-			$title .= ' &#124; ' . bp_get_the_topic_title();
-		}
-	}
+	if ( bp_is_current_action( 'forum' ) && bp_is_action_variable( 'topic', 0 ) )
+		if ( bp_has_forum_topic_posts() )
+			$title .= bp_get_the_topic_title() . " $sep ";
 
 	return $title;
 }
-add_filter( 'bp_page_title', 'bp_forums_add_forum_topic_to_page_title' );
+add_filter( 'bp_modify_page_title', 'bp_forums_add_forum_topic_to_page_title', 9, 4 );
+
+/**
+ * bp_forums_strip_mentions_on_post_edit( $title )
+ *
+ * Removes the anchor tag autogenerated for at-mentions when forum topics and posts are edited.
+ * Prevents embedded anchor tags.
+ *
+ * @global object $bp
+ * @param string $content
+ * @return string $content
+ */
+function bp_forums_strip_mentions_on_post_edit( $content ) {
+	global $bp;
+
+	$content = htmlspecialchars_decode( $content );
+
+	$pattern = "|<a href=&#039;" . bp_get_root_domain() . "/" . bp_get_members_root_slug() . "/[A-Za-z0-9-_\.]+/&#039; rel=&#039;nofollow&#039;>(@[A-Za-z0-9-_\.@]+)</a>|";
+
+	$content = preg_replace( $pattern, "$1", $content );
+
+	return $content;
+}
+add_filter( 'bp_get_the_topic_post_edit_text', 'bp_forums_strip_mentions_on_post_edit' );
+add_filter( 'bp_get_the_topic_text', 'bp_forums_strip_mentions_on_post_edit' );
+
+/**
+ * "REPLIED TO" SQL FILTERS
+ */
+
+/**
+ * Filters the get_topics_distinct portion of the Forums sql when on a user's Replied To page.
+ *
+ * This filter is added in bp_has_forum_topics()
+ *
+ * @package BuddyPress
+ * @since 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, " );
+
+	return $sql;
+}
+
+/**
+ * Filters the get_topics_join portion of the Forums sql when on a user's Replied To page.
+ *
+ * This filter is added in bp_has_forum_topics()
+ *
+ * @package BuddyPress
+ * @since 1.5
+ *
+ * @global object $bbdb The bbPress database global
+ * @global object $wpdb The WordPress database global
+ * @param string $sql
+ * @return string $sql
+ */
+function bp_forums_add_replied_join_sql( $sql ) {
+	global $bbdb, $wpdb;
+
+	$sql .= $wpdb->prepare( " LEFT JOIN $bbdb->posts p ON p.topic_id = t.topic_id " );
+
+	return $sql;
+}
+
+/**
+ * Filters the get_topics_where portion of the Forums sql when on a user's Replied To page.
+ *
+ * This filter is added in bp_has_forum_topics()
+ *
+ * @package BuddyPress
+ * @since 1.5
+ *
+ * @global object $wpdb The WordPress database global
+ * @param string $sql
+ * @return string $sql
+ */
+function bp_forums_add_replied_where_sql( $sql ) {
+	global $wpdb;
+
+	$sql .= $wpdb->prepare( " AND p.poster_id = %s ", bp_displayed_user_id() );
+
+	// Remove any topic_author information
+	$sql = str_replace( " AND t.topic_poster = '" . bp_displayed_user_id() . "'", '', $sql );
+
+	return $sql;
+}
 
-?>
+?>
\ No newline at end of file
diff --git a/wp-content/plugins/buddypress/bp-forums/bp-forums-functions.php b/wp-content/plugins/buddypress/bp-forums/bp-forums-functions.php
new file mode 100644
index 0000000000000000000000000000000000000000..e56911c0cb941b02678cdc42a27b1ba9ec79cdf1
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-forums/bp-forums-functions.php
@@ -0,0 +1,676 @@
+<?php
+// Exit if accessed directly
+if ( !defined( 'ABSPATH' ) ) exit;
+
+function bp_forums_is_installed_correctly() {
+	global $bp;
+
+	if ( isset( $bp->forums->bbconfig ) && is_file( $bp->forums->bbconfig ) )
+		return true;
+
+	return false;
+}
+
+/**
+ * Checks $bp pages global and looks for directory page
+ *
+ * @since 1.5
+ *
+ * @global object $bp Global BuddyPress settings object
+ * @return bool True if set, False if empty
+ */
+function bp_forums_has_directory() {
+	global $bp;
+
+	return (bool) !empty( $bp->pages->forums->id );
+}
+
+/** Forum Functions ***********************************************************/
+
+function bp_forums_get_forum( $forum_id ) {
+	do_action( 'bbpress_init' );
+	return bb_get_forum( $forum_id );
+}
+
+function bp_forums_new_forum( $args = '' ) {
+	do_action( 'bbpress_init' );
+
+	$defaults = array(
+		'forum_name'        => '',
+		'forum_desc'        => '',
+		'forum_parent_id'   => bp_forums_parent_forum_id(),
+		'forum_order'       => false,
+		'forum_is_category' => 0
+	);
+
+	$r = wp_parse_args( $args, $defaults );
+	extract( $r, EXTR_SKIP );
+
+	return bb_new_forum( array( 'forum_name' => stripslashes( $forum_name ), 'forum_desc' => stripslashes( $forum_desc ), 'forum_parent' => $forum_parent_id, 'forum_order' => $forum_order, 'forum_is_category' => $forum_is_category ) );
+}
+
+function bp_forums_update_forum( $args = '' ) {
+	do_action( 'bbpress_init' );
+
+	$defaults = array(
+		'forum_id'          => '',
+		'forum_name'        => '',
+		'forum_desc'        => '',
+		'forum_slug'        => '',
+		'forum_parent_id'   => bp_forums_parent_forum_id(),
+		'forum_order'       => false,
+		'forum_is_category' => 0
+	);
+
+	$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 ) );
+}
+
+/** Topic Functions ***********************************************************/
+
+function bp_forums_get_forum_topics( $args = '' ) {
+	global $bp;
+
+	do_action( 'bbpress_init' );
+
+	$defaults = array(
+		'type'          => 'newest',
+		'forum_id'      => false,
+		'user_id'       => false,
+		'page'          => 1,
+		'per_page'      => 15,
+		'offset'        => false,
+		'number'        => false,
+		'exclude'       => false,
+		'show_stickies' => 'all',
+		'filter'        => false // if $type = tag then filter is the tag name, otherwise it's terms to search on.
+	);
+
+	$r = wp_parse_args( $args, $defaults );
+	extract( $r, EXTR_SKIP );
+
+	if ( class_exists( 'BB_Query' ) ) {
+		switch ( $type ) {
+			case 'newest':
+				$query = new BB_Query( 'topic', array( 'forum_id' => $forum_id, 'topic_author_id' => $user_id, 'per_page' => $per_page, 'page' => $page, 'number' => $per_page, 'exclude' => $exclude, 'topic_title' => $filter, 'sticky' => $show_stickies, 'offset' => $offset, 'number' => $number ), 'get_latest_topics' );
+				$topics =& $query->results;
+				break;
+
+			case 'popular':
+				$query = new BB_Query( 'topic', array( 'forum_id' => $forum_id, 'topic_author_id' => $user_id, 'per_page' => $per_page, 'page' => $page, 'order_by' => 't.topic_posts', 'topic_title' => $filter, 'sticky' => $show_stickies, 'offset' => $offset, 'number' => $number ) );
+				$topics =& $query->results;
+				break;
+
+			case 'unreplied':
+				$query = new BB_Query( 'topic', array( 'forum_id' => $forum_id, 'topic_author_id' => $user_id, 'post_count' => 1, 'per_page' => $per_page, 'page' => $page, 'order_by' => 't.topic_time', 'topic_title' => $filter, 'sticky' => $show_stickies, 'offset' => $offset, 'number' => $number ) );
+				$topics =& $query->results;
+				break;
+
+			case 'tags':
+				$query = new BB_Query( 'topic', array( 'forum_id' => $forum_id, 'topic_author_id' => $user_id, 'tag' => $filter, 'per_page' => $per_page, 'page' => $page, 'order_by' => 't.topic_time', 'sticky' => $show_stickies, 'offset' => $offset, 'number' => $number ) );
+				$topics =& $query->results;
+				break;
+		}
+	} else {
+		$topics = array();
+	}
+
+	return apply_filters_ref_array( 'bp_forums_get_forum_topics', array( &$topics, &$r ) );
+}
+
+function bp_forums_get_topic_details( $topic_id ) {
+	do_action( 'bbpress_init' );
+
+	$query = new BB_Query( 'topic', 'topic_id=' . $topic_id . '&page=1' /* Page override so bbPress doesn't use the URI */ );
+
+	return $query->results[0];
+}
+
+function bp_forums_get_topic_id_from_slug( $topic_slug ) {
+	do_action( 'bbpress_init' );
+
+	if ( empty( $topic_slug ) )
+		return false;
+
+	return bb_get_id_from_slug( 'topic', $topic_slug );
+}
+
+function bp_forums_new_topic( $args = '' ) {
+	global $bp;
+
+	do_action( 'bbpress_init' );
+
+	$defaults = array(
+		'topic_title'            => '',
+		'topic_slug'             => '',
+		'topic_text'             => '',
+		'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_name' => $bp->loggedin_user->fullname, // accept names
+		'topic_start_time'       => bp_core_current_time(),
+		'topic_time'             => bp_core_current_time(),
+		'topic_open'             => 1,
+		'topic_tags'             => false, // accepts array or comma delim
+		'forum_id'               => 0      // accepts ids or slugs
+	);
+
+	$r = wp_parse_args( $args, $defaults );
+	extract( $r, EXTR_SKIP );
+
+	$topic_title = strip_tags( $topic_title );
+
+	if ( empty( $topic_title ) || !strlen( trim( $topic_title ) ) )
+		return false;
+
+	if ( empty( $topic_poster ) )
+		return false;
+
+	if ( bp_core_is_user_spammer( $topic_poster ) || bp_core_is_user_deleted( $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 ) ) )
+		return false;
+
+	// Now insert the first post.
+	if ( !bp_forums_insert_post( array( 'topic_id' => $topic_id, 'post_text' => $topic_text, 'post_time' => $topic_time, 'poster_id' => $topic_poster ) ) )
+		return false;
+
+	do_action( 'bp_forums_new_topic', $topic_id );
+
+	return $topic_id;
+}
+
+function bp_forums_update_topic( $args = '' ) {
+	global $bp;
+
+	do_action( 'bbpress_init' );
+
+	$defaults = array(
+		'topic_id'    => false,
+		'topic_title' => '',
+		'topic_text'  => '',
+		'topic_tags'  => false
+	);
+
+	$r = wp_parse_args( $args, $defaults );
+	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 ) ) 
+		return false;
+
+	// bb_insert_topic() will append tags, but not remove them. So we remove all existing tags.
+	bb_remove_topic_tags( $topic_id );
+
+	if ( !$topic_id = bb_insert_topic( array( 'topic_id' => $topic_id, 'topic_title' => stripslashes( $topic_title ), 'tags' => $topic_tags ) ) )
+		return false;
+
+	if ( !$post = bb_get_first_post( $topic_id ) )
+		return false;
+
+	// Update the first post
+	if ( !$post = bp_forums_insert_post( array( 'post_id' => $post->post_id, 'topic_id' => $topic_id, 'post_text' => $topic_text, 'post_time' => $post->post_time, 'poster_id' => $post->poster_id, 'poster_ip' => $post->poster_ip, 'post_status' => $post->post_status, 'post_position' => $post->post_position ) ) )
+		return false;
+
+	return bp_forums_get_topic_details( $topic_id );
+}
+
+function bp_forums_sticky_topic( $args = '' ) {
+	global $bp;
+
+	do_action( 'bbpress_init' );
+
+	$defaults = array(
+		'topic_id' => false,
+		'mode'     => 'stick' // stick/unstick
+	);
+
+	$r = wp_parse_args( $args, $defaults );
+	extract( $r, EXTR_SKIP );
+
+	if ( 'stick' == $mode )
+		return bb_stick_topic( $topic_id );
+	else if ( 'unstick' == $mode )
+		return bb_unstick_topic( $topic_id );
+
+	return false;
+}
+
+function bp_forums_openclose_topic( $args = '' ) {
+	global $bp;
+
+	do_action( 'bbpress_init' );
+
+	$defaults = array(
+		'topic_id' => false,
+		'mode'     => 'close' // stick/unstick
+	);
+
+	$r = wp_parse_args( $args, $defaults );
+	extract( $r, EXTR_SKIP );
+
+	if ( 'close' == $mode )
+		return bb_close_topic( $topic_id );
+	else if ( 'open' == $mode )
+		return bb_open_topic( $topic_id );
+
+	return false;
+}
+
+function bp_forums_delete_topic( $args = '' ) {
+	global $bp;
+
+	do_action( 'bbpress_init' );
+
+	$defaults = array(
+		'topic_id' => false
+	);
+
+	$r = wp_parse_args( $args, $defaults );
+	extract( $r, EXTR_SKIP );
+
+	return bb_delete_topic( $topic_id, 1 );
+}
+
+function bp_forums_total_topic_count() {
+	global $bbdb;
+
+	do_action( 'bbpress_init' );
+
+	if ( isset( $bbdb ) ) {
+		if ( bp_is_active( 'groups' ) ) {
+			$groups_table_sql = groups_add_forum_tables_sql();
+			$groups_where_sql = groups_add_forum_where_sql( "t.topic_status = 0" );
+		} else {
+			$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 );
+	} else {
+		$count = 0;
+	}
+
+	return apply_filters( 'bp_forums_total_topic_count', $count );
+}
+
+/**
+ * Get a total "Topics Started" count for a given user
+ *
+ * @package BuddyPress
+ *
+ * @param int $user_id ID of the user being queried. Falls back on displayed user, then loggedin
+ * @param str $type The current filter/sort type. 'active', 'popular', 'unreplied'
+ * @return int $count The topic count
+ */
+function bp_forums_total_topic_count_for_user( $user_id = 0, $type = 'active' ) {
+	global $bp;
+
+	do_action( 'bbpress_init' );
+
+	if ( !$user_id )
+		$user_id = ( $bp->displayed_user->id ) ? $bp->displayed_user->id : $bp->loggedin_user->id;
+
+	if ( class_exists( 'BB_Query' ) ) {
+		$args = array(
+			'topic_author_id' => $user_id,
+			'page' 		  => 1,
+			'per_page'	  => -1,
+			'count'		  => true
+		);
+
+		if ( 'unreplied' == $type )
+			$args['post_count'] = 1;
+
+		$query = new BB_Query( 'topic', $args );
+		$count = $query->count;
+		$query = null;
+	} else {
+		$count = 0;
+	}
+
+	return $count;
+}
+
+/**
+ * Return the total number of topics replied to by a given user
+ *
+ * Uses an unfortunate technique to count unique topics, due to limitations in BB_Query.
+ *
+ * @package BuddyPress
+ * @since 1.5
+ *
+ * @param int $user_id Defaults to displayed user, then to logged-in user
+ * @return int $count
+ */
+function bp_forums_total_replied_count_for_user( $user_id = 0, $type = 'active' ) {
+	global $bp;
+
+	do_action( 'bbpress_init' );
+
+	if ( !$user_id )
+		$user_id = ( bp_displayed_user_id() ) ? bp_displayed_user_id() : bp_loggedin_user_id();
+
+	if ( !$user_id )
+		return 0;
+
+	if ( class_exists( 'BB_Query' ) ) {
+		$query = new BB_Query( 'post', array( 'post_author_id' => $user_id, 'page' => 1, 'per_page' => -1, 'count' => true ) );
+
+		// Count the unique topics. No better way to do this in the bbPress query API
+		$topics = array();
+		foreach( $query->results as $result ) {
+			if ( !in_array( $result->topic_id, $topics ) )
+				$topics[] = $result->topic_id;
+		}
+
+		// Even more unfortunate. If this is filtered by 'unreplied', we have to requery
+		if ( 'unreplied' == $type ) {
+			$topic_ids = implode( ',', $topics );
+			$topics_query = new BB_Query( 'topic', array( 'topic_id' => $topic_ids, 'page' => 1, 'per_page' => -1, 'post_count' => 1 ) );
+			$count = count( $topics_query->results );
+		} else {
+			$count = count( $topics );
+		}
+		$query = null;
+	} else {
+		$count = 0;
+	}
+
+	return apply_filters( 'bp_forums_total_replied_count_for_user', $count, $user_id );
+}
+
+function bp_forums_get_topic_extras( $topics ) {
+	global $bp, $wpdb, $bbdb;
+
+	if ( empty( $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 ) );
+
+	// 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} )" ) );
+	for ( $i = 0, $count = count( $topics ); $i < $count; ++$i ) {
+		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;
+				$topics[$i]->topic_last_poster_login       = $poster->user_login;
+				$topics[$i]->topic_last_poster_displayname = $poster->display_name;
+			}
+		}
+	}
+
+	// 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} )" ) );
+		for ( $i = 0, $count = count( $topics ); $i < $count; ++$i ) {
+			foreach ( (array)$poster_names as $name ) {
+				if ( $name->topic_id == $topics[$i]->topic_id )
+					$topics[$i]->topic_last_poster_displayname = $name->value;
+			}
+		}
+	}
+
+	// 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 ) {
+		if ( !isset( $topic->topic_last_poster_email ) )
+			$topics[$key]->topic_last_poster_email = '';
+
+		if ( !isset( $topic->topic_last_poster_nicename ) )
+			$topics[$key]->topic_last_poster_nicename = '';
+
+		if ( !isset( $topic->topic_last_poster_login ) )
+			$topics[$key]->topic_last_poster_login = '';
+
+		if ( !isset( $topic->topic_last_poster_displayname ) )
+			$topics[$key]->topic_last_poster_displayname = '';
+	}
+
+	return $topics;
+}
+
+/** Post Functions ************************************************************/
+
+function bp_forums_get_topic_posts( $args = '' ) {
+	do_action( 'bbpress_init' );
+
+	$defaults = array(
+		'topic_id' => false,
+		'page'     => 1,
+		'per_page' => 15,
+		'order'    => 'ASC'
+	);
+
+	$args  = wp_parse_args( $args, $defaults );
+	$query = new BB_Query( 'post', $args, 'get_thread' );
+
+	return bp_forums_get_post_extras( $query->results );
+}
+
+function bp_forums_get_post( $post_id ) {
+	do_action( 'bbpress_init' );
+	return bb_get_post( $post_id );
+}
+
+function bp_forums_delete_post( $args = '' ) {
+	global $bp;
+
+	do_action( 'bbpress_init' );
+
+	$defaults = array(
+		'post_id' => false
+	);
+
+	$r = wp_parse_args( $args, $defaults );
+	extract( $r, EXTR_SKIP );
+
+	return bb_delete_post( $post_id, 1 );
+}
+
+function bp_forums_insert_post( $args = '' ) {
+	global $bp;
+
+	do_action( 'bbpress_init' );
+
+	$defaults = array(
+		'post_id'       => false,
+		'topic_id'      => false,
+		'post_text'     => '',
+		'post_time'     => bp_core_current_time(),
+		'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
+	);
+
+	$r = wp_parse_args( $args, $defaults );
+	extract( $r, EXTR_SKIP );
+
+	if ( !$post = bp_forums_get_post( $post_id ) )
+		$post_id = false;
+
+	if ( !isset( $topic_id ) )
+		$topic_id = $post->topic_id;
+
+	if ( empty( $post_text ) )
+		$post_text = $post->post_text;
+
+	if ( !isset( $post_time ) )
+		$post_time = $post->post_time;
+
+	if ( !isset( $post_position ) )
+		$post_position = $post->post_position;
+
+	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 ) )
+		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 ) );
+
+	if ( !empty( $post_id ) )
+		do_action( 'bp_forums_new_post', $post_id );
+
+	return $post_id;
+}
+
+function bp_forums_get_post_extras( $posts ) {
+	global $bp, $wpdb;
+
+	if ( empty( $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 ) );
+
+	// 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} )" ) );
+
+	for ( $i = 0, $count = count( $posts ); $i < $count; ++$i ) {
+		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_name     = $poster->display_name;
+			}
+		}
+	}
+
+	// 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} )" ) );
+		for ( $i = 0, $count = count( $posts ); $i < $count; ++$i ) {
+			foreach ( (array)$poster_names as $name ) {
+				if ( isset( $topics[$i] ) && $name->user_id == $topics[$i]->user_id )
+				$posts[$i]->poster_name = $poster->value;
+			}
+		}
+	}
+
+	return apply_filters( 'bp_forums_get_post_extras', $posts );
+}
+
+function bp_forums_get_forum_topicpost_count( $forum_id ) {
+	global $wpdb, $bbdb;
+
+	do_action( 'bbpress_init' );
+
+	// Need to find a bbPress function that does this
+	return $wpdb->get_results( $wpdb->prepare( "SELECT topics, posts from {$bbdb->forums} WHERE forum_id = %d", $forum_id ) );
+}
+
+function bp_forums_filter_caps( $allcaps ) {
+	global $bp, $wp_roles, $bb_table_prefix;
+
+	if ( !isset( $bp->loggedin_user->id ) )
+		return $allcaps;
+
+	$bb_cap = get_user_meta( $bp->loggedin_user->id, $bb_table_prefix . 'capabilities', true );
+
+	if ( empty( $bb_cap ) )
+		return $allcaps;
+
+	$bb_cap = array_keys($bb_cap);
+	$bb_cap = $wp_roles->get_role( $bb_cap[0] );
+	$bb_cap = $bb_cap->capabilities;
+
+	return array_merge( (array) $allcaps, (array) $bb_cap );
+}
+add_filter( 'user_has_cap', 'bp_forums_filter_caps' );
+
+/**
+ * Returns the parent forum id for the bbPress abstraction layer
+ *
+ * @package BuddyPress
+ * @since 1.5
+ *
+ * @return int
+ */
+function bp_forums_parent_forum_id() {
+	return apply_filters( 'bp_forums_parent_forum_id', BP_FORUMS_PARENT_FORUM_ID );
+}
+
+/**
+ * Should sticky topics be broken out of regular topic order on forum directories?
+ *
+ * Defaults to false. Define BP_FORUMS_ENABLE_GLOBAL_DIRECTORY_STICKIES, or filter
+ * bp_forums_enable_global_directory_stickies, to change this behavior.
+ *
+ * @package BuddyPress
+ * @since 1.5
+ *
+ * @return bool True if stickies should be displayed at the top of the global directory, false
+ *    otherwise.
+ */
+function bp_forums_enable_global_directory_stickies() {
+	return apply_filters( 'bp_forums_enable_global_directory_stickies', defined( 'BP_FORUMS_ENABLE_GLOBAL_DIRECTORY_STICKIES' ) && BP_FORUMS_ENABLE_GLOBAL_DIRECTORY_STICKIES );
+}
+
+
+/********************************************************************************
+ * Caching
+ *
+ * Caching functions handle the clearing of cached objects and pages on specific
+ * actions throughout BuddyPress.
+ */
+
+// List actions to clear super cached pages on, if super cache is installed
+add_action( 'bp_forums_new_forum', 'bp_core_clear_cache' );
+add_action( 'bp_forums_new_topic', 'bp_core_clear_cache' );
+add_action( 'bp_forums_new_post',  'bp_core_clear_cache' );
+
+
+/** Embeds *******************************************************************/
+
+/**
+ * Grabs the topic post ID and attempts to retrieve the oEmbed cache (if it exists)
+ * during the forum topic loop.  If no cache and link is embeddable, cache it.
+ *
+ * @see BP_Embed
+ * @see bp_embed_forum_cache()
+ * @see bp_embed_forum_save_cache()
+ * @package BuddyPress_Forums
+ * @since 1.5
+ */
+function bp_forums_embed() {
+	add_filter( 'embed_post_id',         'bp_get_the_topic_post_id'         );
+	add_filter( 'bp_embed_get_cache',    'bp_embed_forum_cache',      10, 3 );
+	add_action( 'bp_embed_update_cache', 'bp_embed_forum_save_cache', 10, 3 );
+}
+add_action( 'topic_loop_start', 'bp_forums_embed' );
+
+/**
+ * Wrapper function for {@link bb_get_postmeta()}.
+ * Used during {@link BP_Embed::parse_oembed()} via {@link bp_forums_embed()}.
+ *
+ * @package BuddyPress_Forums
+ * @since 1.5
+ */
+function bp_embed_forum_cache( $cache, $id, $cachekey ) {
+	return bb_get_postmeta( $id, $cachekey );
+}
+
+/**
+ * Wrapper function for {@link bb_update_postmeta()}.
+ * Used during {@link BP_Embed::parse_oembed()} via {@link bp_forums_embed()}.
+ *
+ * @package BuddyPress_Forums
+ * @since 1.5
+ */
+function bp_embed_forum_save_cache( $cache, $cachekey, $id ) {
+	bb_update_postmeta( $id, $cachekey, $cache );
+}
+?>
\ No newline at end of file
diff --git a/wp-content/plugins/buddypress/bp-forums/bp-forums-loader.php b/wp-content/plugins/buddypress/bp-forums/bp-forums-loader.php
new file mode 100644
index 0000000000000000000000000000000000000000..d27d881519cd55f10ca9d9733c2a41d3862ba76b
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-forums/bp-forums-loader.php
@@ -0,0 +1,253 @@
+<?php
+/**
+ * BuddyPress Forums Loader
+ *
+ * A discussion forums component. Comes bundled with bbPress stand-alone.
+ *
+ * @package BuddyPress
+ * @subpackage Forums Core
+ */
+
+// Exit if accessed directly
+if ( !defined( 'ABSPATH' ) ) exit;
+
+class BP_Forums_Component extends BP_Component {
+
+	/**
+	 * Start the forums component creation process
+	 *
+	 * @since 1.5
+	 */
+	function __construct() {
+		parent::start(
+			'forums',
+			__( 'Discussion Forums', 'buddypress' ),
+			BP_PLUGIN_DIR
+		);
+	}
+
+	/**
+	 * Setup globals
+	 *
+	 * The BP_FORUMS_SLUG constant is deprecated, and only used here for
+	 * backwards compatibility.
+	 *
+	 * @since 1.5
+	 * @global obj $bp
+	 */
+	function setup_globals() {
+		global $bp;
+
+		// Define the parent forum ID
+		if ( !defined( 'BP_FORUMS_PARENT_FORUM_ID' ) )
+			define( 'BP_FORUMS_PARENT_FORUM_ID', 1 );
+
+		// Define a slug, if necessary
+		if ( !defined( 'BP_FORUMS_SLUG' ) )
+			define( 'BP_FORUMS_SLUG', $this->id );
+
+		// The location of the bbPress stand-alone config file
+		if ( isset( $bp->site_options['bb-config-location'] ) )
+			$this->bbconfig = $bp->site_options['bb-config-location'];
+
+		// 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,
+			'notification_callback' => 'messages_format_notifications',
+			'search_string'         => __( 'Search Forums...', 'buddypress' ),
+		);
+
+		parent::setup_globals( $globals );
+	}
+
+	/**
+	 * Include files
+	 */
+	function includes() {
+
+		// Files to include
+		$includes = array(
+			'actions',
+			'screens',
+			'classes',
+			'filters',
+			'template',
+			'functions',
+		);
+
+		// Admin area
+		if ( is_admin() )
+			$includes[] = 'admin';
+
+		// bbPress stand-alone
+		if ( !defined( 'BB_PATH' ) )
+			$includes[] = 'bbpress-sa';
+
+		parent::includes( $includes );
+	}
+
+	/**
+	 * Setup BuddyBar navigation
+	 *
+	 * @global obj $bp
+	 */
+	function setup_nav() {
+		global $bp;
+
+		// Stop if forums haven't been set up yet
+		if ( !bp_forums_is_installed_correctly() )
+			return;
+
+		// Stop if there is no user displayed or logged in
+		if ( !is_user_logged_in() && !isset( $bp->displayed_user->id ) )
+			return;
+
+		// Add 'Forums' to the main navigation
+		$main_nav = array(
+			'name'                => __( 'Forums', 'buddypress' ),
+			'slug'                => $this->slug,
+			'position'            => 80,
+			'screen_function'     => 'bp_member_forums_screen_topics',
+			'default_subnav_slug' => 'topics',
+			'item_css_id'         => $this->id
+		);
+
+		// 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;
+		} else {
+			return;
+		}
+
+		// User link
+		$forums_link = trailingslashit( $user_domain . $this->slug );
+
+		// Additional menu if friends is active
+		$sub_nav[] = array(
+			'name'            => __( 'Topics Started', 'buddypress' ),
+			'slug'            => 'topics',
+			'parent_url'      => $forums_link,
+			'parent_slug'     => $this->slug,
+			'screen_function' => 'bp_member_forums_screen_topics',
+			'position'        => 20,
+			'item_css_id'     => 'topics'
+		);
+
+		// Additional menu if friends is active
+		$sub_nav[] = array(
+			'name'            => __( 'Replied To', 'buddypress' ),
+			'slug'            => 'replies',
+			'parent_url'      => $forums_link,
+			'parent_slug'     => $this->slug,
+			'screen_function' => 'bp_member_forums_screen_replies',
+			'position'        => 40,
+			'item_css_id'     => 'replies'
+		);
+
+		// Favorite forums items. Disabled until future release.
+		/*
+		$sub_nav[] = array(
+			'name'            => __( 'Favorites', 'buddypress' ),
+			'slug'            => 'favorites',
+			'parent_url'      => $forums_link,
+			'parent_slug'     => $this->slug,
+			'screen_function' => 'bp_member_forums_screen_favorites',
+			'position'        => 60,
+			'item_css_id'     => 'favorites'
+		);
+		*/
+
+		parent::setup_nav( $main_nav, $sub_nav );
+	}
+
+	/**
+	 * Set up the admin bar
+	 *
+	 * @global obj $bp
+	 */
+	function setup_admin_bar() {
+		global $bp;
+
+		// Prevent debug notices
+		$wp_admin_nav = array();
+
+		// Menus for logged in user
+		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 );
+
+			// Add the "My Account" sub menus
+			$wp_admin_nav[] = array(
+				'parent' => $bp->my_account_menu_id,
+				'id'     => 'my-account-' . $this->id,
+				'title'  => __( 'Forums', 'buddypress' ),
+				'href'   => trailingslashit( $forums_link )
+			);
+
+			// Topics
+			$wp_admin_nav[] = array(
+				'parent' => 'my-account-' . $this->id,
+				'id'     => 'my-account-' . $this->id . '-topics-started',
+				'title'  => __( 'Topics Started', 'buddypress' ),
+				'href'   => trailingslashit( $forums_link . 'topics' )
+			);
+
+			// Replies
+			$wp_admin_nav[] = array(
+				'parent' => 'my-account-' . $this->id,
+				'id'     => 'my-account-' . $this->id . '-replies',
+				'title'  => __( 'Replies', 'buddypress' ),
+				'href'   => trailingslashit( $forums_link . 'replies' )
+			);
+
+			// Favorites
+			$wp_admin_nav[] = array(
+				'parent' => 'my-account-' . $this->id,
+				'id'     => 'my-account-' . $this->id . '-favorite-topics',
+				'title'  => __( 'Favorite Topics', 'buddypress' ),
+				'href'   => trailingslashit( $forums_link . 'favorites' )
+			);
+		}
+
+		parent::setup_admin_bar( $wp_admin_nav );
+	}
+
+	/**
+	 * Sets up the title for pages and <title>
+	 *
+	 * @global obj $bp
+	 */
+	function setup_title() {
+		global $bp;
+
+		// Adjust title based on view
+		if ( bp_is_forums_component() ) {
+			if ( bp_is_my_profile() ) {
+				$bp->bp_options_title = __( 'Forums', 'buddypress' );
+			} else {
+				$bp->bp_options_avatar = bp_core_fetch_avatar( array(
+					'item_id' => $bp->displayed_user->id,
+					'type'    => 'thumb'
+				) );
+				$bp->bp_options_title  = $bp->displayed_user->fullname;
+			}
+		}
+
+		parent::setup_title();
+	}
+}
+// Create the forums component
+$bp->forums = new BP_Forums_Component();
+
+?>
\ 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
new file mode 100644
index 0000000000000000000000000000000000000000..026b231970feba6827abfa1ad6b4275c56cba631
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-forums/bp-forums-screens.php
@@ -0,0 +1,127 @@
+<?php
+// Exit if accessed directly
+if ( !defined( 'ABSPATH' ) ) exit;
+
+function bp_forums_directory_forums_setup() {
+	global $bp;
+
+	if ( bp_is_forums_component() && ( !bp_current_action() || ( 'tag' == bp_current_action() && bp_action_variables() ) ) && !bp_current_item() ) {
+		if ( !bp_forums_has_directory() )
+			return false;
+
+		if ( !bp_forums_is_installed_correctly() ) {
+			bp_core_add_message( __( 'The forums component has not been set up yet.', 'buddypress' ), 'error' );
+			bp_core_redirect( bp_get_root_domain() );
+		}
+
+		bp_update_is_directory( true, 'forums' );
+
+		do_action( 'bbpress_init' );
+
+		// Check to see if the user has posted a new topic from the forums page.
+		if ( isset( $_POST['submit_topic'] ) && bp_is_active( 'forums' ) ) {
+			check_admin_referer( 'bp_forums_new_topic' );
+
+			$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 ) )
+					groups_join_group( $bp->groups->current_group->id );
+
+				$error_message = '';
+
+				$forum_id = groups_get_groupmeta( $bp->groups->current_group->id, 'forum_id' );
+				if ( !empty( $forum_id ) ) {
+					if ( empty( $_POST['topic_title'] ) )
+						$error_message = __( 'Please provide a title for your forum topic.', 'buddypress' );
+					else if ( empty( $_POST['topic_text'] ) )
+						$error_message = __( 'Forum posts cannot be empty. Please enter some text.', 'buddypress' );
+
+					if ( $error_message ) {
+						bp_core_add_message( $error_message, 'error' );
+						$redirect = bp_get_group_permalink( $bp->groups->current_group ) . 'forum';
+					} else {
+						if ( !$topic = groups_new_group_forum_topic( $_POST['topic_title'], $_POST['topic_text'], $_POST['topic_tags'], $forum_id ) ) {
+							bp_core_add_message( __( 'There was an error when creating the topic', 'buddypress'), 'error' );
+							$redirect = bp_get_group_permalink( $bp->groups->current_group ) . 'forum';
+						} else {
+							bp_core_add_message( __( 'The topic was created successfully', 'buddypress') );
+							$redirect = bp_get_group_permalink( $bp->groups->current_group ) . 'forum/topic/' . $topic->topic_slug . '/';
+						}
+					}
+
+					bp_core_redirect( $redirect );
+
+				} 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_forums_directory_permalink() ) );
+				}
+
+			}	 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() ) );
+			}
+		}
+
+		do_action( 'bp_forums_directory_forums_setup' );
+
+		bp_core_load_template( apply_filters( 'bp_forums_template_directory_forums_setup', 'forums/index' ) );
+	}
+}
+add_action( 'bp_screens', 'bp_forums_directory_forums_setup', 2 );
+
+function bp_member_forums_screen_topics() {
+	global $bp;
+
+	do_action( 'bp_member_forums_screen_topics' );
+
+	bp_core_load_template( apply_filters( 'bp_member_forums_screen_topics', 'members/single/home' ) );
+}
+
+function bp_member_forums_screen_replies() {
+	global $bp;
+
+	do_action( 'bp_member_forums_screen_replies' );
+
+	bp_core_load_template( apply_filters( 'bp_member_forums_screen_replies', 'members/single/home' ) );
+}
+
+/**
+ * Loads the template content for a user's Favorites forum tab.
+ *
+ * Note that this feature is not fully implemented at the moment.
+ *
+ * @package BuddyPress Forums
+ */
+function bp_member_forums_screen_favorites() {
+	global $bp;
+
+	do_action( 'bp_member_forums_screen_favorites' );
+
+	bp_core_load_template( apply_filters( 'bp_member_forums_screen_favorites', 'members/single/home' ) );
+}
+
+function bp_forums_screen_single_forum() {
+	global $bp;
+
+	if ( !bp_is_forums_component() || !bp_is_current_action( 'forum' ) || !bp_action_variable( 0 ) )
+		return false;
+
+	do_action( 'bp_forums_screen_single_forum' );
+
+	bp_core_load_template( apply_filters( 'bp_forums_screen_single_forum', 'forums/single/forum' ) );
+}
+add_action( 'bp_screens', 'bp_forums_screen_single_forum' );
+
+function bp_forums_screen_single_topic() {
+	global $bp;
+
+	if ( !bp_is_forums_component() || !bp_is_current_action( 'topic' ) || !bp_action_variable( 0 ) )
+		return false;
+
+	do_action( '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
new file mode 100644
index 0000000000000000000000000000000000000000..265cd9f30517dc154c7708758d03b063ca4c27f1
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-forums/bp-forums-template.php
@@ -0,0 +1,1460 @@
+<?php
+// Exit if accessed directly
+if ( !defined( 'ABSPATH' ) ) exit;
+
+/**
+ * Output the forums component slug
+ *
+ * @package BuddyPress
+ * @subpackage Forums Template
+ * @since 1.5
+ *
+ * @uses bp_get_forums_slug()
+ */
+function bp_forums_slug() {
+	echo bp_get_forums_slug();
+}
+	/**
+	 * Return the forums component slug
+	 *
+	 * @package BuddyPress
+	 * @subpackage Forums Template
+	 * @since 1.5
+	 */
+	function bp_get_forums_slug() {
+		global $bp;
+		return apply_filters( 'bp_get_forums_slug', $bp->forums->slug );
+	}
+
+/**
+ * Output the forums component root slug
+ *
+ * @package BuddyPress
+ * @subpackage Forums Template
+ * @since 1.5
+ *
+ * @uses bp_get_forums_root_slug()
+ */
+function bp_forums_root_slug() {
+	echo bp_get_forums_root_slug();
+}
+	/**
+	 * Return the forums component root slug
+	 *
+	 * @package BuddyPress
+	 * @subpackage Forums Template
+	 * @since 1.5
+	 */
+	function bp_get_forums_root_slug() {
+		global $bp;
+		return apply_filters( 'bp_get_forums_root_slug', $bp->forums->root_slug );
+	}
+
+/**
+ * Output forum directory permalink
+ *
+ * @package BuddyPress
+ * @subpackage Forums Template
+ * @since 1.5
+ * @uses bp_get_forums_directory_permalink()
+ */
+function bp_forums_directory_permalink() {
+	echo bp_get_forums_directory_permalink();
+}
+	/**
+	 * Return forum directory permalink
+	 *
+	 * @package BuddyPress
+	 * @subpackage Forums Template
+	 * @since 1.5
+	 * @uses apply_filters()
+	 * @uses traisingslashit()
+	 * @uses bp_get_root_domain()
+	 * @uses bp_get_forums_root_slug()
+	 * @return string
+	 */
+	function bp_get_forums_directory_permalink() {
+		return apply_filters( 'bp_get_forums_directory_permalink', trailingslashit( bp_get_root_domain() . '/' . bp_get_forums_root_slug() ) );
+	}
+
+class BP_Forums_Template_Forum {
+	var $current_topic = -1;
+	var $topic_count;
+	var $topics;
+	var $topic;
+
+	var $forum_id;
+
+	var $in_the_loop;
+
+	var $pag_page;
+	var $pag_num;
+	var $pag_links;
+	var $total_topic_count;
+
+	var $single_topic = false;
+
+	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;
+
+		$this->pag_page     = $page;
+		$this->pag_num      = $per_page;
+		$this->type         = $type;
+		$this->search_terms = $search_terms;
+		$this->forum_id     = $forum_id;
+		$this->offset	    = $offset;
+		$this->number	    = $number;
+
+		switch ( $type ) {
+			case 'newest': default:
+				$this->topics = bp_forums_get_forum_topics( array( 'user_id' => $user_id, 'forum_id' => $forum_id, 'filter' => $search_terms, 'page' => $this->pag_page, 'per_page' => $this->pag_num, 'show_stickies' => $no_stickies, 'offset' => $offset, 'number' => $number ) );
+				break;
+
+			case 'popular':
+				$this->topics = bp_forums_get_forum_topics( array( 'user_id' => $user_id, 'type' => 'popular', 'filter' => $search_terms, 'forum_id' => $forum_id, 'page' => $this->pag_page, 'per_page' => $this->pag_num, 'show_stickies' => $no_stickies, 'offset' => $offset, 'number' => $number ) );
+				break;
+
+			case 'unreplied':
+				$this->topics = bp_forums_get_forum_topics( array( 'user_id' => $user_id, 'type' => 'unreplied', 'filter' => $search_terms, 'forum_id' => $forum_id, 'page' => $this->pag_page, 'per_page' => $this->pag_num, 'show_stickies' => $no_stickies, 'offset' => $offset, 'number' => $number ) );
+				break;
+
+			case 'tags':
+				$this->topics = bp_forums_get_forum_topics( array( 'user_id' => $user_id, 'type' => 'tags', 'filter' => $search_terms, 'forum_id' => $forum_id, 'page' => $this->pag_page, 'per_page' => $this->pag_num, 'show_stickies' => $no_stickies, 'offset' => $offset, 'number' => $number ) );
+				break;
+		}
+
+		$this->topics = apply_filters( 'bp_forums_template_topics', $this->topics, $type, $forum_id, $per_page, $max, $no_stickies );
+
+		if ( !(int)$this->topics ) {
+			$this->topic_count       = 0;
+			$this->total_topic_count = 0;
+		} else {
+			// Get a total topic count, for use in pagination. This value will differ
+			// depending on scope
+			if ( !empty( $forum_id ) ) {
+				// Group forums
+				$topic_count = bp_forums_get_forum( $forum_id );
+				$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 ) ) {
+				// This covers the case of Profile > Forums > Topics Started, as
+				// well as Forum Directory > My Topics
+				$topic_count = bp_forums_total_topic_count_for_user( bp_displayed_user_id(), $type );
+			} 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 {
+				// For forum directories (All Topics), get a true count
+				$status = is_super_admin() ? '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;
+			}
+
+			if ( $max ) {
+				if ( $max >= count($this->topics) ) {
+					$this->topic_count = count( $this->topics );
+				} else {
+					$this->topic_count = (int)$max;
+				}
+			} else {
+				$this->topic_count = count( $this->topics );
+			}
+		}
+
+		$this->topic_count       = apply_filters_ref_array( 'bp_forums_template_topic_count',                                 array( $this->topic_count, &$this->topics, $type, $forum_id, $per_page, $max, $no_stickies ) );
+		$this->total_topic_count = apply_filters_ref_array( 'bp_forums_template_total_topic_count', array( $this->total_topic_count, $this->topic_count, &$this->topics, $type, $forum_id, $per_page, $max, $no_stickies ) );
+
+		// 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 ) {
+			$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),
+				'current'   => $this->pag_page,
+				'prev_text' => _x( '&larr;', 'Forum topic pagination previous text', 'buddypress' ),
+				'next_text' => _x( '&rarr;', 'Forum topic pagination next text', 'buddypress' ),
+				'mid_size'  => 1
+			) );
+		}
+	}
+
+	function has_topics() {
+		if ( $this->topic_count )
+			return true;
+
+		return false;
+	}
+
+	function next_topic() {
+		$this->current_topic++;
+		$this->topic = $this->topics[$this->current_topic];
+
+		return $this->topic;
+	}
+
+	function rewind_topics() {
+		$this->current_topic = -1;
+		if ( $this->topic_count > 0 ) {
+			$this->topic = $this->topics[0];
+		}
+	}
+
+	function user_topics() {
+		if ( $this->current_topic + 1 < $this->topic_count ) {
+			return true;
+		} elseif ( $this->current_topic + 1 == $this->topic_count ) {
+			do_action('forum_loop_end');
+			// Do some cleaning up after the loop
+			$this->rewind_topics();
+		}
+
+		$this->in_the_loop = false;
+		return false;
+	}
+
+	function the_topic() {
+		global $topic;
+
+		$this->in_the_loop = true;
+		$this->topic = $this->next_topic();
+		$this->topic = (object)$this->topic;
+
+		if ( $this->current_topic == 0 ) // loop has just started
+			do_action('forum_loop_start');
+	}
+}
+
+/**
+ * Initiate the forum topics loop.
+ *
+ * Like other BuddyPress custom loops, the default arguments for this function are determined
+ * dynamically, depending on your current page. All of these $defaults can be overridden in the
+ * $args parameter.
+ *
+ * @package BuddyPress
+ * @uses apply_filters() Filter bp_has_topics to manipulate the $forums_template global before
+ *   it's rendered, or to modify the value of has_topics().
+ *
+ * @param array $args See inline definition of $defaults for explanation of arguments
+ * @return bool Returns true when forum topics are found corresponding to the args, false otherwise.
+ */
+function bp_has_forum_topics( $args = '' ) {
+	global $forum_template, $bp;
+
+	/***
+	 * Set the defaults based on the current page. Any of these will be overridden
+	 * if arguments are directly passed into the loop. Custom plugins should always
+	 * pass their parameters directly to the loop.
+	 */
+	$type         = 'newest';
+	$user_id      = 0;
+	$forum_id     = false;
+	$search_terms = false;
+	$do_stickies  = false;
+
+	// User filtering
+	if ( !empty( $bp->displayed_user->id ) )
+		$user_id = $bp->displayed_user->id;
+
+	// "Replied" query must be manually modified
+	if ( 'replies' == bp_current_action() ) {
+		$user_id = 0; // User id must be handled manually by the filter, not by BB_Query
+
+		add_filter( 'get_topics_distinct',   'bp_forums_add_replied_distinct_sql', 20 );
+		add_filter( 'get_topics_join', 	     'bp_forums_add_replied_join_sql', 20 );
+		add_filter( 'get_topics_where',      'bp_forums_add_replied_where_sql', 20  );
+	}
+
+	// If we're in a single group, set this group's forum_id
+	if ( !$forum_id && !empty( $bp->groups->current_group ) ) {
+		$bp->groups->current_group->forum_id = groups_get_groupmeta( $bp->groups->current_group->id, 'forum_id' );
+
+		// If it turns out there is no forum for this group, return false so
+		// we don't fetch all global topics
+		if ( empty( $bp->groups->current_group->forum_id ) )
+			return false;
+
+		$forum_id = $bp->groups->current_group->forum_id;
+	}
+
+	// If $_GET['fs'] is set, let's auto populate the search_terms var
+	if ( bp_is_directory() && !empty( $_GET['fs'] ) )
+		$search_terms = $_GET['fs'];
+
+	// Get the pagination arguments from $_REQUEST
+	$page     = isset( $_REQUEST['p'] ) ? intval( $_REQUEST['p'] ) : 1;
+	$per_page = isset( $_REQUEST['n'] ) ? intval( $_REQUEST['n'] ) : 20;
+
+	// By default, stickies are only pushed to the top of the order on individual group forums
+	if ( bp_is_group_forum() )
+		$do_stickies = true;
+
+	$defaults = array(
+		'type'         => $type,
+		'forum_id'     => $forum_id,
+		'user_id'      => $user_id,
+		'page'         => $page,
+		'per_page'     => $per_page,
+		'max'          => false,
+		'number'       => false,
+		'offset'       => false,
+		'search_terms' => $search_terms,
+		'do_stickies'  => $do_stickies
+	);
+
+	$r = wp_parse_args( $args, $defaults );
+	extract( $r );
+
+	// If we're viewing a tag URL in the directory, let's override the type and
+	// set it to tags and the filter to the tag name
+	if ( bp_is_current_action( 'tag' ) && $search_terms = bp_action_variable( 0 ) ) {
+		$type = 'tags';
+	}
+
+	/** Sticky logic ******************************************************************/
+
+	if ( $do_stickies ) {
+		// Fetch the stickies
+		$stickies_template = new BP_Forums_Template_Forum( $type, $forum_id, $user_id, 0, 0, $max, 'sticky', $search_terms );
+
+		// If stickies are found, try merging them
+		if ( $stickies_template->has_topics() ) {
+
+			// If stickies are for current $page
+			$page_start_num = ( ( $page - 1 ) * $per_page ) + 1;
+			$page_end_num 	= $page * $per_page <= $stickies_template->total_topic_count ? $page * $per_page : $stickies_template->total_topic_count;
+
+			// Calculate the number of sticky topics that will be shown on this page
+			if ( $stickies_template->topic_count < $page_start_num ) {
+				$this_page_stickies = 0;
+			} else {
+				$this_page_stickies = $stickies_template->topic_count - $per_page * floor( $stickies_template->topic_count / $per_page ) * ( $page - 1 ); // Total stickies minus sticky count through this page
+
+				// $this_page_stickies cannot be more than $per_page or less than 0
+				if ( $this_page_stickies > $per_page )
+					$this_page_stickies = $per_page;
+				else if ( $this_page_stickies < 0 )
+					$this_page_stickies = 0;
+			}
+
+			// Calculate the total number of topics that will be shown on this page
+			$this_page_topics = $stickies_template->total_topic_count >= ( $page * $per_page ) ? $per_page : $page_end_num - ( $page_start_num - 1 );
+
+			// If the number of stickies to be shown is less than $per_page, fetch some
+			// non-stickies to fill in the rest
+			if ( $this_page_stickies < $this_page_topics ) {
+				// How many non-stickies do we need?
+				$non_sticky_number = $this_page_topics - $this_page_stickies;
+
+				// Calculate the non-sticky offset
+				// How many non-stickies on all pages up to this point?
+				$non_sticky_total = $page_end_num - $stickies_template->topic_count;
+
+				// The offset is the number of total non-stickies, less the number
+				// to be shown on this page
+				$non_sticky_offset = $non_sticky_total - $non_sticky_number;
+
+				// Fetch the non-stickies
+				$forum_template = new BP_Forums_Template_Forum( $type, $forum_id, $user_id, 1, $per_page, $max, 'no', $search_terms, $non_sticky_offset, $non_sticky_number );
+
+				// 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;
+
+					// 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 );
+				}
+			} else {
+				// This page has no non-stickies
+				$forum_template = $stickies_template;
+
+				// Adjust the topic count and trim the topics
+				$forum_template->topic_count = $this_page_stickies;
+				$forum_template->topics      = array_slice( $forum_template->topics, $page - 1 );
+			}
+
+			// Because we're using a manual offset and number for the topic query, we
+			// must set the page number manually, and recalculate the pagination links
+			$forum_template->pag_num     = $per_page;
+			$forum_template->pag_page    = $page;
+
+			$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 ),
+				'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' ),
+				'mid_size'  => 1
+			) );
+
+		} else {
+			// Fetch the non-sticky topics if no stickies were found
+			$forum_template = new BP_Forums_Template_Forum( $type, $forum_id, $user_id, $page, $per_page, $max, 'all', $search_terms );
+		}
+	} else {
+		// When skipping the sticky logic, just pull up the forum topics like usual
+		$forum_template = new BP_Forums_Template_Forum( $type, $forum_id, $user_id, $page, $per_page, $max, 'all', $search_terms );
+	}
+
+	return apply_filters( 'bp_has_topics', $forum_template->has_topics(), $forum_template );
+}
+
+function bp_forum_topics() {
+	global $forum_template;
+	return $forum_template->user_topics();
+}
+
+function bp_the_forum_topic() {
+	global $forum_template;
+	return $forum_template->the_topic();
+}
+
+function bp_the_topic_id() {
+	echo bp_get_the_topic_id();
+}
+	function bp_get_the_topic_id() {
+		global $forum_template;
+
+		return apply_filters( 'bp_get_the_topic_id', $forum_template->topic->topic_id );
+	}
+
+function bp_the_topic_title() {
+	echo bp_get_the_topic_title();
+}
+	function bp_get_the_topic_title() {
+		global $forum_template;
+
+		return apply_filters( 'bp_get_the_topic_title', stripslashes( $forum_template->topic->topic_title ) );
+	}
+
+function bp_the_topic_slug() {
+	echo bp_get_the_topic_slug();
+}
+	function bp_get_the_topic_slug() {
+		global $forum_template;
+
+		return apply_filters( 'bp_get_the_topic_slug', $forum_template->topic->topic_slug );
+	}
+
+function bp_the_topic_text() {
+	echo bp_get_the_topic_text();
+}
+	function bp_get_the_topic_text() {
+		global $forum_template;
+
+		$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 ) );
+	}
+
+function bp_the_topic_poster_id() {
+	echo bp_get_the_topic_poster_id();
+}
+	function bp_get_the_topic_poster_id() {
+		global $forum_template;
+
+		return apply_filters( 'bp_get_the_topic_poster_id', $forum_template->topic->topic_poster );
+	}
+
+function bp_the_topic_poster_avatar( $args = '' ) {
+	echo bp_get_the_topic_poster_avatar( $args );
+}
+	function bp_get_the_topic_poster_avatar( $args = '' ) {
+		global $forum_template;
+
+		$defaults = array(
+			'type'   => 'thumb',
+			'width'  => false,
+			'height' => false,
+			'alt'    => __( 'Profile picture of %s', 'buddypress' )
+		);
+
+		$r = wp_parse_args( $args, $defaults );
+		extract( $r, EXTR_SKIP );
+
+		return apply_filters( 'bp_get_the_topic_poster_avatar', bp_core_fetch_avatar( array( 'item_id' => $forum_template->topic->topic_poster, 'type' => $type, 'width' => $width, 'height' => $height, 'alt' => $alt ) ) );
+	}
+
+function bp_the_topic_poster_name() {
+	echo bp_get_the_topic_poster_name();
+}
+	function bp_get_the_topic_poster_name() {
+		global $forum_template;
+
+		$poster_id = ( empty( $forum_template->topic->poster_id ) ) ? $forum_template->topic->topic_poster : $forum_template->topic->poster_id;
+
+		if ( !$name = bp_core_get_userlink( $poster_id ) )
+			return __( 'Deleted User', 'buddypress' );
+
+		return apply_filters( 'bp_get_the_topic_poster_name', $name );
+	}
+
+function bp_the_topic_object_id() {
+	echo bp_get_the_topic_object_id();
+}
+	function bp_get_the_topic_object_id() {
+		global $forum_template;
+
+		return apply_filters( 'bp_get_the_topic_object_id', $forum_template->topic->object_id );
+	}
+
+function bp_the_topic_object_name() {
+	echo bp_get_the_topic_object_name();
+}
+	function bp_get_the_topic_object_name() {
+		global $forum_template;
+
+		if ( isset( $forum_template->topic->object_name ) )
+			$retval = $forum_template->topic->object_name;
+		else
+			$retval = '';
+
+		return apply_filters( 'bp_get_the_topic_object_name', $retval );
+	}
+
+function bp_the_topic_object_slug() {
+	echo bp_get_the_topic_object_slug();
+}
+	function bp_get_the_topic_object_slug() {
+		global $forum_template;
+
+		return apply_filters( 'bp_get_the_topic_object_slug', $forum_template->topic->object_slug );
+	}
+
+function bp_the_topic_object_permalink() {
+	echo bp_get_the_topic_object_permalink();
+}
+	function bp_get_the_topic_object_permalink() {
+
+		// Currently this will only work with group forums, extended support in the future
+		if ( bp_is_active( 'groups' ) )
+			$permalink = trailingslashit( bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/' . bp_get_the_topic_object_slug() . '/forum' );
+		else
+			$permalink = '';
+
+		return apply_filters( 'bp_get_the_topic_object_permalink', $permalink );
+	}
+
+function bp_the_topic_last_poster_name() {
+	echo bp_get_the_topic_last_poster_name();
+}
+	function bp_get_the_topic_last_poster_name() {
+		global $forum_template;
+
+		$domain = bp_core_get_user_domain( $forum_template->topic->topic_last_poster, $forum_template->topic->topic_last_poster_nicename, $forum_template->topic->topic_last_poster_login ) ;
+
+		// In the case where no user is found, bp_core_get_user_domain() may return the URL
+		// of the Members directory
+		if ( !$domain || $domain == bp_core_get_root_domain() . '/' . bp_get_members_root_slug() . '/' )
+			return __( 'Deleted User', 'buddypress' );
+
+		return apply_filters( 'bp_get_the_topic_last_poster_name', '<a href="' . $domain . '">' . $forum_template->topic->topic_last_poster_displayname . '</a>' );
+	}
+
+function bp_the_topic_object_avatar( $args = '' ) {
+	echo bp_get_the_topic_object_avatar( $args );
+}
+	function bp_get_the_topic_object_avatar( $args = '' ) {
+		global $forum_template;
+
+		if ( !isset( $forum_template->topic->object_id ) )
+			return false;
+
+		$defaults = array(
+			'type'   => 'thumb',
+			'width'  => false,
+			'height' => false,
+			'alt'    => __( 'Group logo for %s', 'buddypress' )
+		);
+
+		$r = wp_parse_args( $args, $defaults );
+		extract( $r, EXTR_SKIP );
+
+		return apply_filters( 'bp_get_the_topic_object_avatar', bp_core_fetch_avatar( array( 'item_id' => $forum_template->topic->object_id, 'type' => $type, 'object' => 'group', 'width' => $width, 'height' => $height, 'alt' => $alt ) ) );
+	}
+
+function bp_the_topic_last_poster_avatar( $args = '' ) {
+	echo bp_get_the_topic_last_poster_avatar( $args );
+}
+	function bp_get_the_topic_last_poster_avatar( $args = '' ) {
+		global $forum_template;
+
+		$defaults = array(
+			'type'   => 'thumb',
+			'width'  => false,
+			'height' => false,
+			'alt'    => __( 'Profile picture of %s', 'buddypress' )
+		);
+
+		$r = wp_parse_args( $args, $defaults );
+		extract( $r, EXTR_SKIP );
+
+		return apply_filters( 'bp_get_the_topic_last_poster_avatar', bp_core_fetch_avatar( array( 'email' => $forum_template->topic->topic_last_poster_email, 'item_id' => $forum_template->topic->topic_last_poster, 'type' => $type, 'width' => $width, 'height' => $height, 'alt' => $alt ) ) );
+	}
+
+function bp_the_topic_start_time() {
+	echo bp_get_the_topic_start_time();
+}
+	function bp_get_the_topic_start_time() {
+		global $forum_template;
+
+		return apply_filters( 'bp_get_the_topic_start_time', $forum_template->topic->topic_start_time );
+	}
+
+function bp_the_topic_time() {
+	echo bp_get_the_topic_time();
+}
+	function bp_get_the_topic_time() {
+		global $forum_template;
+
+		return apply_filters( 'bp_get_the_topic_time', $forum_template->topic->topic_time );
+	}
+
+function bp_the_topic_forum_id() {
+	echo bp_get_the_topic_forum_id();
+}
+	function bp_get_the_topic_forum_id() {
+		global $forum_template;
+
+		return apply_filters( 'bp_get_the_topic_forum_id', $forum_template->topic->forum_id );
+	}
+
+function bp_the_topic_status() {
+	echo bp_get_the_topic_status();
+}
+	function bp_get_the_topic_status() {
+		global $forum_template;
+
+		return apply_filters( 'bp_get_the_topic_status', $forum_template->topic->topic_status );
+	}
+
+function bp_the_topic_is_topic_open() {
+	echo bp_get_the_topic_is_topic_open();
+}
+	function bp_get_the_topic_is_topic_open() {
+		global $forum_template;
+
+		return apply_filters( 'bp_get_the_topic_is_topic_open', $forum_template->topic->topic_open );
+	}
+
+function bp_the_topic_last_post_id() {
+	echo bp_get_the_topic_last_post_id();
+}
+	function bp_get_the_topic_last_post_id() {
+		global $forum_template;
+
+		return apply_filters( 'bp_get_the_topic_last_post_id', $forum_template->topic->topic_last_post_id );
+	}
+
+function bp_the_topic_is_sticky() {
+	echo bp_get_the_topic_is_sticky();
+}
+	function bp_get_the_topic_is_sticky() {
+		global $forum_template;
+
+		return apply_filters( 'bp_get_the_topic_is_sticky', $forum_template->topic->topic_sticky );
+	}
+
+function bp_the_topic_total_post_count() {
+	echo bp_get_the_topic_total_post_count();
+}
+	function bp_get_the_topic_total_post_count() {
+		global $forum_template;
+
+		if ( $forum_template->topic->topic_posts == 1 )
+			return apply_filters( 'bp_get_the_topic_total_post_count', sprintf( __( '%d post', 'buddypress' ), $forum_template->topic->topic_posts ) );
+		else
+			return apply_filters( 'bp_get_the_topic_total_post_count', sprintf( __( '%d posts', 'buddypress' ), $forum_template->topic->topic_posts ) );
+	}
+
+function bp_the_topic_total_posts() {
+	echo bp_get_the_topic_total_posts();
+}
+	function bp_get_the_topic_total_posts() {
+		global $forum_template;
+
+		return apply_filters( 'bp_get_the_topic_total_posts', $forum_template->topic->topic_posts );
+	}
+
+function bp_the_topic_tag_count() {
+	echo bp_get_the_topic_tag_count();
+}
+	function bp_get_the_topic_tag_count() {
+		global $forum_template;
+
+		return apply_filters( 'bp_get_the_topic_tag_count', $forum_template->topic->tag_count );
+	}
+
+function bp_the_topic_permalink() {
+	echo bp_get_the_topic_permalink();
+}
+	function bp_get_the_topic_permalink() {
+		global $forum_template, $bp;
+
+		// The topic is in a loop where its parent object is loaded
+		if ( bp_get_the_topic_object_slug() ) {
+			$permalink = trailingslashit( bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/' . bp_get_the_topic_object_slug() . '/forum' );
+
+		// We are viewing a single group topic, so use the current item
+		} elseif ( bp_is_group_forum_topic() ) {
+			$permalink = trailingslashit( bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/' . bp_current_item() . '/forum' );
+
+		// We are unsure what the context is, so fallback to forum root slug
+		} elseif ( bp_is_single_item() ) {
+			$permalink = trailingslashit( bp_get_root_domain() . '/' . bp_get_forums_root_slug() . '/' . bp_current_item() );
+
+		// This is some kind of error situation, so use forum root
+		} else {
+			$permalink = trailingslashit( bp_get_root_domain() . '/' . bp_get_forums_root_slug() );
+		}
+
+		return apply_filters( 'bp_get_the_topic_permalink', trailingslashit( $permalink . 'topic/' . $forum_template->topic->topic_slug ) );
+	}
+
+function bp_the_topic_time_since_created() {
+	echo bp_get_the_topic_time_since_created();
+}
+	function bp_get_the_topic_time_since_created() {
+		global $forum_template;
+
+		return apply_filters( 'bp_get_the_topic_time_since_created', bp_core_time_since( strtotime( $forum_template->topic->topic_start_time ) ) );
+	}
+
+function bp_the_topic_latest_post_excerpt( $args = '' ) {
+	echo bp_get_the_topic_latest_post_excerpt( $args );
+}
+	function bp_get_the_topic_latest_post_excerpt( $args = '' ) {
+		global $forum_template;
+
+		$defaults = array(
+			'length' => 225
+		);
+
+		$r = wp_parse_args( $args, $defaults );
+		extract( $r, EXTR_SKIP );
+
+		$post = bp_forums_get_post( $forum_template->topic->topic_last_post_id );
+		$post = bp_create_excerpt( $post->post_text, $length );
+
+		return apply_filters( 'bp_get_the_topic_latest_post_excerpt', $post, $length );
+	}
+
+function bp_the_topic_time_since_last_post() {
+	echo bp_get_the_topic_time_since_last_post();
+}
+	function bp_get_the_topic_time_since_last_post() {
+		global $forum_template;
+
+		return apply_filters( 'bp_get_the_topic_time_since_last_post', bp_core_time_since( strtotime( $forum_template->topic->topic_time ) ) );
+	}
+
+function bp_the_topic_is_mine() {
+	echo bp_get_the_topic_is_mine();
+}
+	function bp_get_the_topic_is_mine() {
+		global $bp, $forum_template;
+
+		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;
+
+		$defaults = array(
+			'seperator' => '|'
+		);
+
+		$r = wp_parse_args( $args, $defaults );
+		extract( $r, EXTR_SKIP );
+
+		$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 )
+				$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 )
+				$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>';
+
+			$links[] = '<a class="confirm" id="topic-delete-link" href="' . wp_nonce_url( bp_get_the_topic_permalink() . 'delete', 'bp_forums_delete_topic' ) . '">' . __( 'Delete Topic', 'buddypress' ) . '</a>';
+		}
+
+		return implode( ' ' . $seperator . ' ', (array) $links );
+	}
+
+function bp_the_topic_css_class() {
+	echo bp_get_the_topic_css_class();
+}
+
+	function bp_get_the_topic_css_class() {
+		global $forum_template;
+
+		$class = false;
+
+		if ( $forum_template->current_topic % 2 == 1 )
+			$class .= 'alt';
+
+		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 )
+			$class .= ' closed';
+
+		return apply_filters( 'bp_get_the_topic_css_class', trim( $class ) );
+	}
+
+function bp_my_forum_topics_link() {
+	echo bp_get_my_forum_topics_link();
+}
+	function bp_get_my_forum_topics_link() {
+		global $bp;
+
+		return apply_filters( 'bp_get_my_forum_topics_link', bp_get_root_domain() . '/' . bp_get_forums_root_slug() . '/personal/' );
+	}
+
+function bp_unreplied_forum_topics_link() {
+	echo bp_get_unreplied_forum_topics_link();
+}
+	function bp_get_unreplied_forum_topics_link() {
+		global $bp;
+
+		return apply_filters( 'bp_get_unreplied_forum_topics_link', bp_get_root_domain() . '/' . bp_get_forums_root_slug() . '/unreplied/' );
+	}
+
+
+function bp_popular_forum_topics_link() {
+	echo bp_get_popular_forum_topics_link();
+}
+	function bp_get_popular_forum_topics_link() {
+		global $bp;
+
+		return apply_filters( 'bp_get_popular_forum_topics_link', bp_get_root_domain() . '/' . bp_get_forums_root_slug() . '/popular/' );
+	}
+
+function bp_newest_forum_topics_link() {
+	echo bp_get_newest_forum_topics_link();
+}
+	function bp_get_newest_forum_topics_link() {
+		global $bp;
+
+		return apply_filters( 'bp_get_newest_forum_topics_link', bp_get_root_domain() . '/' . bp_get_forums_root_slug() . '/' );
+	}
+
+function bp_forum_topic_type() {
+	echo bp_get_forum_topic_type();
+}
+	function bp_get_forum_topic_type() {
+		global $bp;
+
+		if ( !bp_is_directory() || !bp_current_action() )
+			return 'newest';
+
+		return apply_filters( 'bp_get_forum_topic_type', bp_current_action() );
+	}
+
+/**
+ * Echoes the output of bp_get_forum_topic_new_reply_link()
+ *
+ * @package BuddyPress
+ * @since 1.5
+ */
+function bp_forum_topic_new_reply_link() {
+	echo bp_get_forum_topic_new_reply_link();
+}
+	/**
+	 * Returns the permalink for the New Reply button at the top of forum topics
+	 *
+	 * @package BuddyPress
+	 * @since 1.5
+	 *
+	 * @uses apply_filters() Filter bp_get_forum_topic_new_reply_link to modify
+	 * @return str The URL for the New Reply link
+	 */
+	function bp_get_forum_topic_new_reply_link() {
+		global $topic_template;
+
+		if ( $topic_template->pag->total_pages == $topic_template->pag_page ) {
+			// If we are on the last page, no need for a URL base
+			$link = '';
+		} else {
+			// Create a link to the last page for the topic
+			$link = add_query_arg( array(
+				'topic_page' =>	$topic_template->pag->total_pages,
+				'num'        => $topic_template->pag_num
+			), bp_get_the_topic_permalink() );
+		}
+
+		// Tack on the #post-topic-reply anchor before returning
+		return apply_filters( 'bp_get_forum_topic_new_reply_link', $link . '#post-topic-reply', $link );
+	}
+
+/**
+ * Echoes the output of bp_get_forums_tag_name()
+ *
+ * @package BuddyPress
+ * @todo Deprecate?
+ */
+function bp_forums_tag_name() {
+	echo bp_get_forums_tag_name();
+}
+	/**
+	 * Outputs the currently viewed tag name
+	 *
+	 * @package BuddyPress
+	 * @todo Deprecate? Seems unused
+	 */
+	function bp_get_forums_tag_name() {
+		$tag_name = bp_is_directory() && bp_is_forums_component() ? bp_action_variable( 0 ) : false;
+
+		return apply_filters( 'bp_get_forums_tag_name', $tag_name );
+	}
+
+function bp_forum_pagination() {
+	echo bp_get_forum_pagination();
+}
+	function bp_get_forum_pagination() {
+		global $forum_template;
+
+		return apply_filters( 'bp_get_forum_pagination', $forum_template->pag_links );
+	}
+
+function bp_forum_pagination_count() {
+	echo bp_get_forum_pagination_count();
+}
+	function bp_get_forum_pagination_count() {
+		global $bp, $forum_template;
+
+		$start_num  = intval( ( $forum_template->pag_page - 1 ) * $forum_template->pag_num ) + 1;
+		$from_num   = bp_core_number_format( $start_num );
+		$to_num     = bp_core_number_format( ( $start_num + ( $forum_template->pag_num - 1  ) > $forum_template->total_topic_count ) ? $forum_template->total_topic_count : $start_num + ( $forum_template->pag_num - 1 ) );
+		$total      = bp_core_number_format( $forum_template->total_topic_count );
+		$pag_filter = false;
+
+		if ( 'tags' == $forum_template->type && !empty( $forum_template->search_terms ) )
+			$pag_filter = sprintf( __( ' matching tag "%s"', 'buddypress' ), $forum_template->search_terms );
+
+		return apply_filters( 'bp_get_forum_pagination_count', sprintf( __( 'Viewing topic %s to %s (of %s total topics%s)', 'buddypress' ), $from_num, $to_num, $total, $pag_filter ) );
+	}
+
+function bp_is_edit_topic() {
+	global $bp;
+
+	if ( bp_is_action_variable( 'post' ) && bp_is_action_variable( 'edit' ) )
+		return false;
+
+	return true;
+}
+
+
+class BP_Forums_Template_Topic {
+	var $current_post = -1;
+	var $post_count;
+	var $posts;
+	var $post;
+
+	var $forum_id;
+	var $topic_id;
+	var $topic;
+
+	var $in_the_loop;
+
+	var $pag_page;
+	var $pag_num;
+	var $pag_links;
+	var $total_post_count;
+
+	var $single_post = false;
+
+	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;
+
+		$this->pag_page        = isset( $_REQUEST['topic_page'] ) ? intval( $_REQUEST['topic_page'] ) : 1;
+		$this->pag_num         = isset( $_REQUEST['num'] ) ? intval( $_REQUEST['num'] ) : $per_page;
+
+		$this->order           = $order;
+		$this->topic_id        = $topic_id;
+		$forum_template->topic = (object) bp_forums_get_topic_details( $this->topic_id );
+		$this->forum_id        = $forum_template->topic->forum_id;
+
+		$this->posts           = bp_forums_get_topic_posts( array( 'topic_id' => $this->topic_id, 'page' => $this->pag_page, 'per_page' => $this->pag_num, 'order' => $this->order ) );
+
+		if ( !$this->posts ) {
+			$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;
+			} else {
+				$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;
+				}
+			} else {
+				$this->post_count = count( $this->posts );
+			}
+		}
+
+		// 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_links = paginate_links( array(
+				'base'      => add_query_arg( array( 'topic_page' => '%#%', 'num' => (int)$this->pag_num ) ),
+				'format'    => '',
+				'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 );
+		} else {
+			$this->pag->total_pages = 1;
+		}
+	}
+
+	function has_posts() {
+		if ( $this->post_count )
+			return true;
+
+		return false;
+	}
+
+	function next_post() {
+		$this->current_post++;
+		$this->post = $this->posts[$this->current_post];
+
+		return $this->post;
+	}
+
+	function rewind_posts() {
+		$this->current_post = -1;
+		if ( $this->post_count > 0 ) {
+			$this->post = $this->posts[0];
+		}
+	}
+
+	function user_posts() {
+		if ( $this->current_post + 1 < $this->post_count ) {
+			return true;
+		} elseif ( $this->current_post + 1 == $this->post_count ) {
+			do_action('topic_loop_end');
+			// Do some cleaning up after the loop
+			$this->rewind_posts();
+		}
+
+		$this->in_the_loop = false;
+		return false;
+	}
+
+	function the_post() {
+		global $post;
+
+		$this->in_the_loop = true;
+		$this->post = $this->next_post();
+		$this->post = (object)$this->post;
+
+		if ( $this->current_post == 0 ) // loop has just started
+			do_action('topic_loop_start');
+	}
+}
+
+function bp_has_forum_topic_posts( $args = '' ) {
+	global $topic_template;
+
+	$defaults = array(
+		'topic_id' => false,
+		'per_page' => 15,
+		'max'      => false,
+		'order'    => 'ASC'
+	);
+
+	$r = wp_parse_args( $args, $defaults );
+	extract( $r, EXTR_SKIP );
+
+	if ( empty( $topic_id ) && bp_is_groups_component() && bp_is_current_action( 'forum' ) && bp_is_action_variable( 'topic', 0 ) && bp_action_variable( 1 ) )
+		$topic_id = bp_forums_get_topic_id_from_slug( bp_action_variable( 1 ) );
+	elseif ( empty( $topic_id ) && bp_is_forums_component() && bp_is_current_action( 'topic' ) && bp_action_variable( 0 ) )
+		$topic_id = bp_forums_get_topic_id_from_slug( bp_action_variable( 0 ) );
+
+	if ( empty( $topic_id ) ) {
+		return false;
+
+	} else {
+		$topic_template = new BP_Forums_Template_Topic( (int) $topic_id, $per_page, $max, $order );
+
+		// Current topic forum_id needs to match current_group forum_id
+		if ( bp_is_groups_component() && $topic_template->forum_id != groups_get_groupmeta( bp_get_current_group_id(), 'forum_id' ) )
+			return false;
+	}
+
+	return apply_filters( 'bp_has_topic_posts', $topic_template->has_posts(), $topic_template );
+}
+
+function bp_forum_topic_posts() {
+	global $topic_template;
+	return $topic_template->user_posts();
+}
+
+function bp_the_forum_topic_post() {
+	global $topic_template;
+	return $topic_template->the_post();
+}
+
+function bp_the_topic_post_id() {
+	echo bp_get_the_topic_post_id();
+}
+	function bp_get_the_topic_post_id() {
+		global $topic_template;
+
+		return apply_filters( 'bp_get_the_topic_post_id', $topic_template->post->post_id );
+	}
+
+function bp_the_topic_post_content() {
+	echo bp_get_the_topic_post_content();
+}
+	function bp_get_the_topic_post_content() {
+		global $topic_template;
+
+		return apply_filters( 'bp_get_the_topic_post_content', stripslashes( $topic_template->post->post_text ) );
+	}
+
+function bp_the_topic_post_css_class() {
+	echo bp_get_the_topic_post_css_class();
+}
+
+	function bp_get_the_topic_post_css_class() {
+		global $topic_template;
+
+		$class = false;
+
+		if ( $topic_template->current_post % 2 == 1 )
+			$class .= 'alt';
+
+		if ( 1 == (int)$topic_template->post->post_status )
+			$class .= ' deleted';
+
+		if ( 0 == (int)$topic_template->post->post_status )
+			$class .= ' open';
+
+		return apply_filters( 'bp_get_the_topic_post_css_class', trim( $class ) );
+	}
+
+function bp_the_topic_post_poster_avatar( $args = '' ) {
+	echo bp_get_the_topic_post_poster_avatar( $args );
+}
+	function bp_get_the_topic_post_poster_avatar( $args = '' ) {
+		global $topic_template;
+
+		$defaults = array(
+			'type' => 'thumb',
+			'width' => 20,
+			'height' => 20,
+			'alt' => __( 'Profile picture of %s', 'buddypress' )
+		);
+
+		$r = wp_parse_args( $args, $defaults );
+		extract( $r, EXTR_SKIP );
+
+		return apply_filters( 'bp_get_the_topic_post_poster_avatar', bp_core_fetch_avatar( array( 'item_id' => $topic_template->post->poster_id, 'type' => $type, 'width' => $width, 'height' => $height, 'alt' => $alt ) ) );
+	}
+
+function bp_the_topic_post_poster_name() {
+	echo bp_get_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 ) )
+			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>' );
+	}
+
+function bp_the_topic_post_poster_link() {
+	echo bp_get_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 ) );
+	}
+
+function bp_the_topic_post_time_since() {
+	echo bp_get_the_topic_post_time_since();
+}
+	function bp_get_the_topic_post_time_since() {
+		global $topic_template;
+
+		return apply_filters( 'bp_get_the_topic_post_time_since', bp_core_time_since( strtotime( $topic_template->post->post_time ) ) );
+	}
+
+function bp_the_topic_post_is_mine() {
+	echo 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;
+	}
+
+function bp_the_topic_post_admin_links( $args = '' ) {
+	echo bp_get_the_topic_post_admin_links( $args );
+}
+	function bp_get_the_topic_post_admin_links( $args = '' ) {
+		global $topic_template;
+
+		// Never show for the first post in a topic.
+		if ( 0 == $topic_template->current_post && 1 == $topic_template->pag_page )
+			return;
+
+		$defaults = array(
+			'separator' => ' | '
+		);
+
+		$r = wp_parse_args( $args, $defaults );
+		extract( $r, EXTR_SKIP );
+
+		$query_vars = '';
+		if ( $_SERVER['QUERY_STRING'] )
+			$query_vars = '?' . $_SERVER['QUERY_STRING'];
+
+		$links    = array();
+		$links[]  = '<a href="' . wp_nonce_url( bp_get_the_topic_permalink() . 'edit/post/' . $topic_template->post->post_id . '/' . $query_vars, 'bp_forums_edit_post' ) . '">' . __( 'Edit', 'buddypress' ) . '</a>';
+		$links[] .= '<a class="confirm" id="post-delete-link" href="' . wp_nonce_url( bp_get_the_topic_permalink() . 'delete/post/' . $topic_template->post->post_id, 'bp_forums_delete_post' ) . '">' . __( 'Delete', 'buddypress' ) . '</a>';
+
+		return apply_filters( 'bp_get_the_topic_post_admin_links', implode( $separator, $links ), $links, $r );
+	}
+
+function bp_the_topic_post_edit_text() {
+	echo bp_get_the_topic_post_edit_text();
+}
+	function bp_get_the_topic_post_edit_text() {
+		$post = bp_forums_get_post( bp_action_variable( 4 ) );
+		return apply_filters( 'bp_get_the_topic_post_edit_text', esc_attr( $post->post_text ) );
+	}
+
+function bp_the_topic_pagination() {
+	echo bp_get_the_topic_pagination();
+}
+	function bp_get_the_topic_pagination() {
+		global $topic_template;
+
+		return apply_filters( 'bp_get_the_topic_pagination', $topic_template->pag_links );
+	}
+
+function bp_the_topic_pagination_count() {
+	global $bp, $topic_template;
+
+	$start_num = intval( ( $topic_template->pag_page - 1 ) * $topic_template->pag_num ) + 1;
+	$from_num = bp_core_number_format( $start_num );
+	$to_num = bp_core_number_format( ( $start_num + ( $topic_template->pag_num - 1  ) > $topic_template->total_post_count ) ? $topic_template->total_post_count : $start_num + ( $topic_template->pag_num - 1 ) );
+	$total = bp_core_number_format( $topic_template->total_post_count );
+
+	echo apply_filters( 'bp_the_topic_pagination_count', sprintf( __( 'Viewing post %1$s to %2$s (%3$s total posts)', 'buddypress' ), $from_num, $to_num, $total ) );
+}
+
+function bp_the_topic_is_last_page() {
+	echo bp_get_the_topic_is_last_page();
+}
+	function bp_get_the_topic_is_last_page() {
+		global $topic_template;
+
+		return apply_filters( 'bp_get_the_topic_is_last_page', $topic_template->pag_page == $topic_template->pag->total_pages );
+	}
+
+function bp_directory_forums_search_form() {
+	global $bp;
+
+	$default_search_value = bp_get_search_default_text( 'forums' );
+	$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>
+		<input type="submit" id="forums_search_submit" name="forums_search_submit" value="<?php _e( 'Search', 'buddypress' ); ?>" />
+	</form>
+
+<?php
+}
+
+function bp_forum_permalink( $forum_id = 0 ) {
+	echo bp_get_forum_permalink( $forum_id );
+}
+	function bp_get_forum_permalink( $forum_id = 0 ) {
+		global $bp;
+
+		if ( bp_is_groups_component() ) {
+			$permalink = trailingslashit( bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/' . bp_current_item() . '/forum' );
+		} else {
+			if ( empty( $forum_id ) ) {
+				global $topic_template;
+				if ( isset( $topic_template->forum_id ) )
+					$forum_id = $topic_template->forum_id;
+			}
+
+			if ( $forum = bp_forums_get_forum( $forum_id ) )
+				$permalink = trailingslashit( bp_get_root_domain() . '/' . bp_get_forums_root_slug() . '/forum/' . $forum->forum_slug );
+			else
+				return false;
+		}
+
+		return apply_filters( 'bp_get_forum_permalink', trailingslashit( $permalink ) );
+	}
+
+function bp_forum_name( $forum_id = 0 ) {
+	echo bp_get_forum_name( $forum_id );
+}
+	function bp_get_forum_name( $forum_id = 0 ) {
+		global $bp;
+
+		if ( empty( $forum_id ) ) {
+			global $topic_template;
+			if ( isset( $topic_template->forum_id ) )
+				$forum_id = $topic_template->forum_id;
+		}
+
+		if ( $forum = bp_forums_get_forum( $forum_id ) )
+			return apply_filters( 'bp_get_forum_name', $forum->forum_name, $forum->forum_id );
+		else
+			return false;
+	}
+
+function bp_forums_tag_heat_map( $args = '' ) {
+	$defaults = array(
+		'smallest' => '10',
+		'largest'  => '42',
+		'sizing'   => 'px',
+		'limit'    => '50'
+	);
+
+	$r = wp_parse_args( $args, $defaults );
+	extract( $r, EXTR_SKIP );
+
+	bb_tag_heat_map( $smallest, $largest, $sizing, $limit );
+}
+
+/**
+ * Echo the current topic's tag list, comma-separated
+ *
+ * @package BuddyPress
+ * @since 1.5
+ */
+function bp_forum_topic_tag_list() {
+	echo bp_get_forum_topic_tag_list();
+}
+	/**
+	 * Get the current topic's tag list
+	 *
+	 * @package BuddyPress
+	 * @since 1.5
+	 *
+	 * @param str $format 'string' returns comma-separated string; otherwise returns array
+	 * @return mixed $tags
+	 */
+	function bp_get_forum_topic_tag_list( $format = 'string' ) {
+		global $topic_template;
+
+		$tags_data = !empty( $topic_template->topic_tags ) ? $topic_template->topic_tags : false;
+
+		$tags = array();
+
+		if ( $tags_data ) {
+			foreach( $tags_data as $tag_data ) {
+				$tags[] = $tag_data->name;
+			}
+		}
+
+		if ( 'string' == $format )
+			$tags = implode( ', ', $tags );
+
+		return apply_filters( 'bp_forum_topic_tag_list', $tags, $format );
+	}
+
+/**
+ * Returns true if the current topic has tags
+ *
+ * @package BuddyPress
+ * @since 1.5
+ *
+ * @return bool
+ */
+function bp_forum_topic_has_tags() {
+	global $topic_template;
+
+	$has_tags = false;
+
+	if ( !empty( $topic_template->topic_tags ) )
+		$has_tags = true;
+
+	return apply_filters( 'bp_forum_topic_has_tags', $has_tags );
+}
+
+function bp_forum_action() {
+	echo bp_get_forum_action();
+}
+	function bp_get_forum_action() {
+		global $topic_template;
+
+		return apply_filters( 'bp_get_forum_action', bp_get_root_domain() . esc_attr( $_SERVER['REQUEST_URI'] ) );
+	}
+
+function bp_forum_topic_action() {
+	echo bp_get_forum_topic_action();
+}
+	function bp_get_forum_topic_action() {
+		return apply_filters( 'bp_get_forum_topic_action', $_SERVER['REQUEST_URI'] );
+	}
+
+function bp_forum_topic_count_for_user( $user_id = 0 ) {
+	echo bp_get_forum_topic_count_for_user( $user_id );
+}
+	function bp_get_forum_topic_count_for_user( $user_id = 0 ) {
+		return apply_filters( 'bp_get_forum_topic_count_for_user', bp_forums_total_topic_count_for_user( $user_id ) );
+	}
+
+function bp_forum_topic_count( $user_id = 0 ) {
+	echo bp_get_forum_topic_count( $user_id );
+}
+	function bp_get_forum_topic_count( $user_id = 0 ) {
+		return apply_filters( 'bp_get_forum_topic_count', bp_forums_total_topic_count( $user_id ) );
+	}
+?>
diff --git a/wp-content/plugins/buddypress/bp-friends/bp-friends-actions.php b/wp-content/plugins/buddypress/bp-friends/bp-friends-actions.php
new file mode 100644
index 0000000000000000000000000000000000000000..65a75154f7a9c2772ca3a6092ce89e71c9dca3e0
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-friends/bp-friends-actions.php
@@ -0,0 +1,81 @@
+<?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.
+ */
+
+// Exit if accessed directly
+if ( !defined( 'ABSPATH' ) ) exit;
+
+function friends_action_add_friend() {
+	if ( !bp_is_friends_component() || !bp_is_current_action( 'add-friend' ) )
+		return false;
+
+	if ( !$potential_friend_id = (int)bp_action_variable( 0 ) )
+		return false;
+
+	if ( $potential_friend_id == bp_loggedin_user_id() )
+		return false;
+
+	$friendship_status = BP_Friends_Friendship::check_is_friend( bp_loggedin_user_id(), $potential_friend_id );
+
+	if ( 'not_friends' == $friendship_status ) {
+
+		if ( !check_admin_referer( 'friends_add_friend' ) )
+			return false;
+
+		if ( !friends_add_friend( bp_loggedin_user_id(), $potential_friend_id ) ) {
+			bp_core_add_message( __( 'Friendship could not be requested.', 'buddypress' ), 'error' );
+		} else {
+			bp_core_add_message( __( 'Friendship requested', 'buddypress' ) );
+		}
+
+	} else if ( 'is_friend' == $friendship_status ) {
+		bp_core_add_message( __( 'You are already friends with this user', 'buddypress' ), 'error' );
+	} else {
+		bp_core_add_message( __( 'You already have a pending friendship request with this user', 'buddypress' ), 'error' );
+	}
+
+	bp_core_redirect( wp_get_referer() );
+
+	return false;
+}
+add_action( 'bp_init', 'friends_action_add_friend' );
+
+function friends_action_remove_friend() {
+	if ( !bp_is_friends_component() || !bp_is_current_action( 'remove-friend' ) )
+		return false;
+
+	if ( !$potential_friend_id = (int)bp_action_variable( 0 ) )
+		return false;
+
+	if ( $potential_friend_id == bp_loggedin_user_id() )
+		return false;
+
+	$friendship_status = BP_Friends_Friendship::check_is_friend( bp_loggedin_user_id(), $potential_friend_id );
+
+	if ( 'is_friend' == $friendship_status ) {
+
+		if ( !check_admin_referer( 'friends_remove_friend' ) )
+			return false;
+
+		if ( !friends_remove_friend( bp_loggedin_user_id(), $potential_friend_id ) ) {
+			bp_core_add_message( __( 'Friendship could not be canceled.', 'buddypress' ), 'error' );
+		} else {
+			bp_core_add_message( __( 'Friendship canceled', 'buddypress' ) );
+		}
+
+	} else if ( 'is_friends' == $friendship_status ) {
+		bp_core_add_message( __( 'You are not yet friends with this user', 'buddypress' ), 'error' );
+	} else {
+		bp_core_add_message( __( 'You have a pending friendship request with this user', 'buddypress' ), 'error' );
+	}
+
+	bp_core_redirect( wp_get_referer() );
+
+	return false;
+}
+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
new file mode 100644
index 0000000000000000000000000000000000000000..82f717a1701405c59708583e6e2489686472300f
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-friends/bp-friends-activity.php
@@ -0,0 +1,115 @@
+<?php
+/**
+ * These functions handle the recording, deleting and formatting of activity and
+ * notifications for the user and for this specific component.
+ */
+
+// Exit if accessed directly
+if ( !defined( 'ABSPATH' ) ) exit;
+
+function friends_record_activity( $args = '' ) {
+	global $bp;
+
+	if ( !bp_is_active( 'activity' ) )
+		return false;
+
+	$defaults = array (
+		'user_id'           => $bp->loggedin_user->id,
+		'action'            => '',
+		'content'           => '',
+		'primary_link'      => '',
+		'component'         => $bp->friends->id,
+		'type'              => false,
+		'item_id'           => false,
+		'secondary_item_id' => false,
+		'recorded_time'     => bp_core_current_time(),
+		'hide_sitewide'     => false
+	);
+
+	$r = wp_parse_args( $args, $defaults );
+	extract( $r, EXTR_SKIP );
+
+	return bp_activity_add( array( '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 ) );
+}
+
+function friends_delete_activity( $args ) {
+	global $bp;
+
+	if ( bp_is_active( 'activity' ) ) {
+		extract( (array)$args );
+		bp_activity_delete_by_item_id( array( 'item_id' => $item_id, 'component' => $bp->friends->id, 'type' => $type, 'user_id' => $user_id ) );
+	}
+}
+
+function friends_register_activity_actions() {
+	global $bp;
+
+	if ( !bp_is_active( 'activity' ) )
+		return false;
+
+	bp_activity_set_action( $bp->friends->id, 'friends_register_activity_action', __( 'New friendship created', 'buddypress' ) );
+
+	do_action( 'friends_register_activity_actions' );
+}
+add_action( 'bp_register_activity_actions', 'friends_register_activity_actions' );
+
+/**
+ * Format the BuddyBar/admin bar notifications for the Friends component
+ *
+ * @package BuddyPress
+ *
+ * @param str $action The kind of notification being rendered
+ * @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
+ */
+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';
+
+			// Set up the string and the filter
+			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 ) );
+				$filter = 'bp_friends_single_friendship_accepted_notification';
+			}
+
+			break;
+
+		case 'friendship_request':
+			$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 );
+				$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 ) );
+				$filter = 'bp_friends_single_friendship_request_notification';
+			}
+
+			break;
+	}
+
+	// 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 );
+	} else {
+		$return = apply_filters( $filter, array(
+			'link' => $link,
+			'text' => $text
+		), (int)$total_items );
+	}
+
+	do_action( 'friends_format_notifications', $action, $item_id, $secondary_item_id, $total_items, $return );
+
+	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
new file mode 100644
index 0000000000000000000000000000000000000000..c2b52a651008dc3bad15fb775a745d9567334c04
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-friends/bp-friends-cache.php
@@ -0,0 +1,38 @@
+<?php
+/**
+ * Caching functions handle the clearing of cached objects and pages on specific
+ * actions throughout BuddyPress.
+ */
+
+// Exit if accessed directly
+if ( !defined( 'ABSPATH' ) ) exit;
+
+function friends_clear_friend_object_cache( $friendship_id ) {
+	if ( !$friendship = new BP_Friends_Friendship( $friendship_id ) )
+		return false;
+
+	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' );
+}
+add_action( 'bp_activity_screen_my_activity', 'friends_clear_friend_notifications' );
+
+// List actions to clear object caches on
+add_action( 'friends_friendship_accepted', 'friends_clear_friend_object_cache' );
+add_action( 'friends_friendship_deleted',  'friends_clear_friend_object_cache' );
+
+// List actions to clear super cached pages on, if super cache is installed
+add_action( 'friends_friendship_rejected',  'bp_core_clear_cache' );
+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 c0b258d4b51ee70cd4ed682c8e28d32f25fc051f..c762e2224d7fb5667676fc98b10c2bd4e1e01169 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,6 @@
 <?php
+// Exit if accessed directly
+if ( !defined( 'ABSPATH' ) ) exit;
 
 class BP_Friends_Friendship {
 	var $id;
@@ -14,6 +16,10 @@ 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 ) {
@@ -28,10 +34,10 @@ class BP_Friends_Friendship {
 
 		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;
-			$this->friend_user_id = $friendship->friend_user_id;
-			$this->is_confirmed = $friendship->is_confirmed;
-			$this->is_limited = $friendship->is_limited;
-			$this->date_created = $friendship->date_created;
+			$this->friend_user_id    = $friendship->friend_user_id;
+			$this->is_confirmed      = $friendship->is_confirmed;
+			$this->is_limited        = $friendship->is_limited;
+			$this->date_created      = $friendship->date_created;
 		}
 
 		// if running from ajax.
@@ -51,12 +57,12 @@ class BP_Friends_Friendship {
 		global $wpdb, $bp;
 
 		$this->initiator_user_id = apply_filters( 'friends_friendship_initiator_user_id_before_save', $this->initiator_user_id, $this->id );
-		$this->friend_user_id = apply_filters( 'friends_friendship_friend_user_id_before_save', $this->friend_user_id, $this->id );
-		$this->is_confirmed = apply_filters( 'friends_friendship_is_confirmed_before_save', $this->is_confirmed, $this->id );
-		$this->is_limited = apply_filters( 'friends_friendship_is_limited_before_save', $this->is_limited, $this->id );
-		$this->date_created = apply_filters( 'friends_friendship_date_created_before_save', $this->date_created, $this->id );
+		$this->friend_user_id    = apply_filters( 'friends_friendship_friend_user_id_before_save',    $this->friend_user_id,    $this->id );
+		$this->is_confirmed      = apply_filters( 'friends_friendship_is_confirmed_before_save',      $this->is_confirmed,      $this->id );
+		$this->is_limited        = apply_filters( 'friends_friendship_is_limited_before_save',        $this->is_limited,        $this->id );
+		$this->date_created      = apply_filters( 'friends_friendship_date_created_before_save',      $this->date_created,      $this->id );
 
-		do_action( 'friends_friendship_before_save', $this );
+		do_action_ref_array( 'friends_friendship_before_save', array( &$this ) );
 
 		if ( $this->id ) {
 			// Update
@@ -67,7 +73,7 @@ class BP_Friends_Friendship {
 			$this->id = $wpdb->insert_id;
 		}
 
-		do_action( 'friends_friendship_after_save', $this );
+		do_action( 'friends_friendship_after_save', array( &$this ) );
 
 		return $result;
 	}
@@ -92,8 +98,9 @@ class BP_Friends_Friendship {
 		}
 
 		$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" ) );
+		$fids = array();
 
-		for ( $i = 0; $i < count($friends); $i++ ) {
+		for ( $i = 0, $count = count( $friends ); $i < $count; ++$i ) {
 			if ( $assoc_arr )
 				$fids[] = array( 'user_id' => ( $friends[$i]->friend_user_id == $user_id ) ? $friends[$i]->initiator_user_id : $friends[$i]->friend_user_id );
 			else
@@ -115,7 +122,7 @@ class BP_Friends_Friendship {
 		return $wpdb->get_col( $wpdb->prepare( "SELECT initiator_user_id FROM {$bp->friends->table_name} WHERE friend_user_id = %d AND is_confirmed = 0", $user_id ) );
 	}
 
-	function total_friend_count( $user_id = false ) {
+	function total_friend_count( $user_id = 0 ) {
 		global $wpdb, $bp;
 
 		if ( !$user_id )
@@ -127,10 +134,10 @@ 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 && !get_user_meta( $user_id, 'total_friend_count', true ) )
+		if ( !$count && !bp_get_user_meta( $user_id, 'total_friend_count', true ) )
 			return 0;
 
-		update_user_meta( $user_id, 'total_friend_count', (int)$count );
+		bp_update_user_meta( $user_id, 'total_friend_count', (int)$count );
 		return (int)$count;
 	}
 
@@ -157,12 +164,12 @@ class BP_Friends_Friendship {
 			return false;
 
 		// filter the user_ids based on the search criteria.
-		if ( function_exists('xprofile_install') ) {
+		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%%'";
 		} else {
-			$sql = "SELECT DISTINCT user_id FROM " . CUSTOM_USER_META_TABLE . " WHERE user_id IN ($fids) AND meta_key = 'nickname' AND meta_value LIKE '$filter%%' {$pag_sql}";
-			$total_sql = "SELECT COUNT(DISTINCT user_id) FROM " . CUSTOM_USER_META_TABLE . " 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);
@@ -196,7 +203,7 @@ class BP_Friends_Friendship {
 	function get_bulk_last_active( $user_ids ) {
 		global $wpdb, $bp;
 
-		return $wpdb->get_results( $wpdb->prepare( "SELECT meta_value as last_activity, user_id FROM " . CUSTOM_USER_META_TABLE . " WHERE meta_key = 'last_activity' AND user_id IN ( {$user_ids} ) ORDER BY meta_value DESC" ) );
+		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' ) ) );
 	}
 
 	function accept($friendship_id) {
@@ -220,10 +227,10 @@ class BP_Friends_Friendship {
 		$users_table = $wpdb->base_prefix . 'users';
 
 		if ( $limit && $page )
-			$pag_sql = $wpdb->prepare( " LIMIT %d, %d", intval( ( $page - 1 ) * $limit), intval( $limit ) );
+			$pag_sql = $wpdb->prepare( " LIMIT %d, %d", intval( ( $page - 1 ) * intval( $limit ) ), intval( $limit ) );
 
 		// filter the user_ids based on the search criteria.
-		if ( function_exists('xprofile_install') ) {
+		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" );
 		} 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" );
@@ -246,7 +253,7 @@ class BP_Friends_Friendship {
 		$users_table = $wpdb->base_prefix . 'users';
 
 		// filter the user_ids based on the search criteria.
-		if ( function_exists('xprofile_install') ) {
+		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%%'" );
 		} else {
 			$sql = $wpdb->prepare( "SELECT COUNT(DISTINCT user_id) FROM $usermeta_table WHERE meta_value LIKE '$filter%%'" );
@@ -263,10 +270,10 @@ class BP_Friends_Friendship {
 	function sort_by_name( $user_ids ) {
 		global $wpdb, $bp;
 
-		if ( !function_exists( 'xprofile_install') )
+		if ( !bp_is_active( 'xprofile' ) )
 			return false;
 
-		return $wpdb->get_results( $wpdb->prepare( "SELECT user_id FROM {$bp->profile->table_name_data} pd, {$bp->profile->table_name_fields} pf WHERE pf.id = pd.field_id AND pf.name = %s AND pd.user_id IN ( {$user_ids} ) ORDER BY pd.value ASC", BP_XPROFILE_FULLNAME_FIELD_NAME ) );
+		return $wpdb->get_results( $wpdb->prepare( "SELECT user_id FROM {$bp->profile->table_name_data} pd, {$bp->profile->table_name_fields} pf WHERE pf.id = pd.field_id AND pf.name = %s AND pd.user_id IN ( {$user_ids} ) ORDER BY pd.value ASC", bp_xprofile_fullname_field_name() ) );
 	}
 
 	function get_random_friends( $user_id, $total_friends = 5 ) {
@@ -275,12 +282,12 @@ class BP_Friends_Friendship {
 		$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; $i < count($results); $i++ ) {
+		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;
 		}
 
 		// remove duplicates
-		if ( count($fids) > 0 )
+		if ( count( $fids ) > 0 )
 			return array_flip(array_flip($fids));
 		else
 			return false;
@@ -292,7 +299,7 @@ class BP_Friends_Friendship {
 		$friend_ids = BP_Friends_Friendship::get_friend_user_ids( $user_id );
 
 		$invitable_count = 0;
-		for ( $i = 0; $i < count($friend_ids); $i++ ) {
+		for ( $i = 0, $count = count( $friend_ids ); $i < $count; ++$i ) {
 
 			if ( BP_Groups_Member::check_is_member( (int)$friend_ids[$i], $group_id ) )
 				continue;
@@ -330,5 +337,4 @@ class BP_Friends_Friendship {
 		}
 	}
 }
-
 ?>
\ 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
new file mode 100644
index 0000000000000000000000000000000000000000..bc8cc959e8aaa52d5c22f0919a1362b6f58b8c7a
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-friends/bp-friends-functions.php
@@ -0,0 +1,288 @@
+<?php
+/********************************************************************************
+ * Business 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.
+ */
+
+// Exit if accessed directly
+if ( !defined( 'ABSPATH' ) ) exit;
+
+function friends_add_friend( $initiator_userid, $friend_userid, $force_accept = false ) {
+	global $bp;
+
+	$friendship = new BP_Friends_Friendship;
+
+	if ( (int)$friendship->is_confirmed )
+		return true;
+
+	$friendship->initiator_user_id = $initiator_userid;
+	$friendship->friend_user_id    = $friend_userid;
+	$friendship->is_confirmed      = 0;
+	$friendship->is_limited        = 0;
+	$friendship->date_created      = bp_core_current_time();
+
+	if ( $force_accept )
+		$friendship->is_confirmed = 1;
+
+	if ( $friendship->save() ) {
+
+		if ( !$force_accept ) {
+			// Add the on screen notification
+			bp_core_add_notification( $friendship->initiator_user_id, $friendship->friend_user_id, $bp->friends->id, 'friendship_request' );
+
+			// Send the email notification
+			friends_notification_new_request( $friendship->id, $friendship->initiator_user_id, $friendship->friend_user_id );
+
+			do_action( 'friends_friendship_requested', $friendship->id, $friendship->initiator_user_id, $friendship->friend_user_id );
+		} else {
+			do_action( 'friends_friendship_accepted', $friendship->id, $friendship->initiator_user_id, $friendship->friend_user_id );
+		}
+
+		return true;
+	}
+
+	return false;
+}
+
+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 );
+
+	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 ) );
+
+	do_action( 'friends_friendship_deleted', $friendship_id, $initiator_userid, $friend_userid );
+
+	if ( $friendship->delete() ) {
+		friends_update_friend_totals( $initiator_userid, $friend_userid, 'remove' );
+
+		return true;
+	}
+
+	return false;
+}
+
+function friends_accept_friendship( $friendship_id ) {
+	global $bp;
+
+	$friendship = new BP_Friends_Friendship( $friendship_id, true, false );
+
+	if ( !$friendship->is_confirmed && BP_Friends_Friendship::accept( $friendship_id ) ) {
+		friends_update_friend_totals( $friendship->initiator_user_id, $friendship->friend_user_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' );
+
+		// Add a friend accepted notice for the initiating user
+		bp_core_add_notification( $friendship->friend_user_id, $friendship->initiator_user_id, $bp->friends->id, 'friendship_accepted' );
+
+		$initiator_link = bp_core_get_userlink( $friendship->initiator_user_id );
+		$friend_link = bp_core_get_userlink( $friendship->friend_user_id );
+
+		// Record in activity streams for the initiator
+		friends_record_activity( array(
+			'user_id'           => $friendship->initiator_user_id,
+			'type'              => 'friendship_created',
+			'action'            => apply_filters( 'friends_activity_friendship_accepted_action', sprintf( __( '%1$s and %2$s are now friends', 'buddypress' ), $initiator_link, $friend_link ), $friendship ),
+			'item_id'           => $friendship_id,
+			'secondary_item_id' => $friendship->friend_user_id
+		) );
+
+		// Record in activity streams for the friend
+		friends_record_activity( array(
+			'user_id'           => $friendship->friend_user_id,
+			'type'              => 'friendship_created',
+			'action'            => apply_filters( 'friends_activity_friendship_accepted_action', sprintf( __( '%1$s and %2$s are now friends', 'buddypress' ), $friend_link, $initiator_link ), $friendship ),
+			'item_id'           => $friendship_id,
+			'secondary_item_id' => $friendship->initiator_user_id,
+			'hide_sitewide'     => true // We've already got the first entry site wide
+		) );
+
+		// Send the email notification
+		friends_notification_accepted_request( $friendship->id, $friendship->initiator_user_id, $friendship->friend_user_id );
+
+		do_action( 'friends_friendship_accepted', $friendship->id, $friendship->initiator_user_id, $friendship->friend_user_id );
+
+		return true;
+	}
+
+	return false;
+}
+
+function friends_reject_friendship( $friendship_id ) {
+	global $bp;
+
+	$friendship = new BP_Friends_Friendship( $friendship_id, true, false );
+
+	if ( !$friendship->is_confirmed && BP_Friends_Friendship::reject( $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_rejected', array( $friendship_id, &$friendship ) );
+		return true;
+	}
+
+	return false;
+}
+
+function friends_check_friendship( $user_id, $possible_friend_id ) {
+	global $bp;
+
+	if ( 'is_friend' == BP_Friends_Friendship::check_is_friend( $user_id, $possible_friend_id ) )
+		return true;
+
+	return false;
+}
+
+// Returns - 'is_friend', 'not_friends', 'pending'
+function friends_check_friendship_status( $user_id, $possible_friend_id ) {
+	return BP_Friends_Friendship::check_is_friend( $user_id, $possible_friend_id );
+}
+
+function friends_get_total_friend_count( $user_id = 0 ) {
+	global $bp;
+
+	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' );
+	}
+
+	return apply_filters( 'friends_get_total_friend_count', $count );
+}
+
+function friends_check_user_has_friends( $user_id ) {
+	$friend_count = friends_get_total_friend_count( $user_id );
+
+	if ( empty( $friend_count ) )
+		return false;
+
+	if ( !(int)$friend_count )
+		return false;
+
+	return true;
+}
+
+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 ) {
+	return BP_Friends_Friendship::get_friend_user_ids( $user_id, $friend_requests_only, $assoc_arr );
+}
+
+function friends_search_friends( $search_terms, $user_id, $pag_num = 10, $pag_page = 1 ) {
+	return BP_Friends_Friendship::search_friends( $search_terms, $user_id, $pag_num, $pag_page );
+}
+
+function friends_get_friendship_request_user_ids( $user_id ) {
+	return BP_Friends_Friendship::get_friendship_request_user_ids( $user_id );
+}
+
+function friends_get_recently_active( $user_id, $per_page = 0, $page = 0, $filter = '' ) {
+	return apply_filters( 'friends_get_recently_active', BP_Core_User::get_users( 'active', $per_page, $page, $user_id, $filter ) );
+}
+
+function friends_get_alphabetically( $user_id, $per_page = 0, $page = 0, $filter = '' ) {
+	return apply_filters( 'friends_get_alphabetically', BP_Core_User::get_users( 'alphabetical', $per_page, $page, $user_id, $filter ) );
+}
+
+function friends_get_newest( $user_id, $per_page = 0, $page = 0, $filter = '' ) {
+	return apply_filters( 'friends_get_newest', BP_Core_User::get_users( 'newest', $per_page, $page, $user_id, $filter ) );
+}
+
+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;
+
+	if ( !$user_id )
+		$user_id = $bp->loggedin_user->id;
+
+	if ( bp_has_members( 'user_id=' . $user_id . '&type=alphabetical&per_page=0' ) ) {
+		while ( bp_members() ) : bp_the_member();
+			$friends[] = array(
+				'id' => bp_get_member_user_id(),
+				'full_name' => bp_get_member_name()
+			);
+		endwhile;
+	}
+
+	if ( empty($friends) )
+		return false;
+
+	return $friends;
+}
+
+function friends_count_invitable_friends( $user_id, $group_id ) {
+	return BP_Friends_Friendship::get_invitable_friend_count( $user_id, $group_id );
+}
+
+function friends_get_friend_count_for_user( $user_id ) {
+	return BP_Friends_Friendship::total_friend_count( $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 )
+		return false;
+
+	for ( $i = 0, $count = count( $user_ids ); $i < $count; ++$i )
+		$users[] = new BP_Core_User( $user_ids[$i] );
+
+	return array( 'users' => $users, 'count' => BP_Friends_Friendship::search_users_count( $search_terms ) );
+}
+
+function friends_is_friendship_confirmed( $friendship_id ) {
+	$friendship = new BP_Friends_Friendship( $friendship_id );
+	return $friendship->is_confirmed;
+}
+
+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 );
+		bp_update_user_meta( $friend_user_id, 'total_friend_count', (int)bp_get_user_meta( $friend_user_id, 'total_friend_count', true ) + 1 );
+	} else {
+		bp_update_user_meta( $initiator_user_id, 'total_friend_count', (int)bp_get_user_meta( $initiator_user_id, 'total_friend_count', true ) - 1 );
+		bp_update_user_meta( $friend_user_id, 'total_friend_count', (int)bp_get_user_meta( $friend_user_id, 'total_friend_count', true ) - 1 );
+	}
+}
+
+function friends_remove_data( $user_id ) {
+	global $bp;
+
+	do_action( 'friends_before_remove_data', $user_id );
+
+	BP_Friends_Friendship::delete_all_for_user($user_id);
+
+	// Remove usermeta
+	bp_delete_user_meta( $user_id, 'total_friend_count' );
+
+	// Remove friendship requests FROM user
+	bp_core_delete_notifications_from_user( $user_id, $bp->friends->id, 'friendship_request' );
+
+	do_action( 'friends_remove_data', $user_id );
+}
+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
new file mode 100644
index 0000000000000000000000000000000000000000..83e9641a63924eff5b46ba65a9e8ce28eefcbdb4
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-friends/bp-friends-loader.php
@@ -0,0 +1,212 @@
+<?php
+/**
+ * BuddyPress Friends Streams Loader
+ *
+ * The friends component is for users to create relationships with each other
+ *
+ * @package BuddyPress
+ * @subpackage Friends Core
+ */
+
+// Exit if accessed directly
+if ( !defined( 'ABSPATH' ) ) exit;
+
+class BP_Friends_Component extends BP_Component {
+
+	/**
+	 * Start the friends component creation process
+	 *
+	 * @since 1.5
+	 */
+	function __construct() {
+		parent::start(
+			'friends',
+			__( 'Friend Connections', 'buddypress' ),
+			BP_PLUGIN_DIR
+		);
+	}
+
+	/**
+	 * Include files
+	 */
+	function includes() {
+		// Files to include
+		$includes = array(
+			'actions',
+			'screens',
+			'filters',
+			'classes',
+			'activity',
+			'template',
+			'functions',
+			'notifications',
+		);
+
+		parent::includes( $includes );
+	}
+
+	/**
+	 * Setup globals
+	 *
+	 * The BP_FRIENDS_SLUG constant is deprecated, and only used here for
+	 * backwards compatibility.
+	 *
+	 * @since 1.5
+	 * @global obj $bp
+	 */
+	function setup_globals() {
+		global $bp;
+
+		define ( 'BP_FRIENDS_DB_VERSION', '1800' );
+
+		// Define a slug, if necessary
+		if ( !defined( 'BP_FRIENDS_SLUG' ) )
+			define( 'BP_FRIENDS_SLUG', $this->id );
+
+		// Global tables for the friends component
+		$global_tables = array(
+			'table_name'      => $bp->table_prefix . 'bp_friends',
+			'table_name_meta' => $bp->table_prefix . 'bp_friends_meta',
+		);
+
+		// 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' ),
+			'notification_callback' => 'friends_format_notifications',
+			'global_tables'         => $global_tables
+		);
+
+		parent::setup_globals( $globals );
+	}
+
+	/**
+	 * Setup BuddyBar navigation
+	 *
+	 * @global obj $bp
+	 */
+	function setup_nav() {
+		global $bp;
+
+		// Add 'Friends' to the main navigation
+		$main_nav = array(
+			'name'                => sprintf( __( 'Friends <span>%d</span>', 'buddypress' ), friends_get_total_friend_count() ),
+			'slug'                => $this->slug,
+			'position'            => 60,
+			'screen_function'     => 'friends_screen_my_friends',
+			'default_subnav_slug' => 'my-friends',
+			'item_css_id'         => $bp->friends->id
+		);
+
+		$friends_link = trailingslashit( $bp->loggedin_user->domain . bp_get_friends_slug() );
+
+		// Add the subnav items to the friends nav item
+		$sub_nav[] = array(
+			'name'            => __( 'Friendships', 'buddypress' ),
+			'slug'            => 'my-friends',
+			'parent_url'      => $friends_link,
+			'parent_slug'     => bp_get_friends_slug(),
+			'screen_function' => 'friends_screen_my_friends',
+			'position'        => 10,
+			'item_css_id'     => 'friends-my-friends'
+		);
+
+		$sub_nav[] = array(
+			'name'            => __( 'Requests',   'buddypress' ),
+			'slug'            => 'requests',
+			'parent_url'      => $friends_link,
+			'parent_slug'     => bp_get_friends_slug(),
+			'screen_function' => 'friends_screen_requests',
+			'position'        => 20,
+			'user_has_access' => bp_is_my_profile()
+		);
+
+		parent::setup_nav( $main_nav, $sub_nav );
+	}
+
+	/**
+	 * Set up the admin bar
+	 *
+	 * @global obj $bp
+	 */
+	function setup_admin_bar() {
+		global $bp;
+
+		// Prevent debug notices
+		$wp_admin_nav = array();
+
+		// Menus for logged in user
+		if ( is_user_logged_in() ) {
+
+			// Setup the logged in user variables
+			$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 );
+			} else {
+				$title   = __( 'Friends',             'buddypress' );
+				$pending = __( 'No Pending Requests', 'buddypress' );
+			}
+
+			// Add the "My Account" sub menus
+			$wp_admin_nav[] = array(
+				'parent' => $bp->my_account_menu_id,
+				'id'     => 'my-account-' . $this->id,
+				'title'  => $title,
+				'href'   => trailingslashit( $friends_link )
+			);
+
+			// My Groups
+			$wp_admin_nav[] = array(
+				'parent' => 'my-account-' . $this->id,
+				'id'     => 'my-account-' . $this->id . '-friendships',
+				'title'  => __( 'Friendships', 'buddypress' ),
+				'href'   => trailingslashit( $friends_link )
+			);
+
+			// Requests
+			$wp_admin_nav[] = array(
+				'parent' => 'my-account-' . $this->id,
+				'id'     => 'my-account-' . $this->id . '-requests',
+				'title'  => $pending,
+				'href'   => trailingslashit( $friends_link . 'requests' )
+			);
+		}
+
+		parent::setup_admin_bar( $wp_admin_nav );
+	}
+
+	/**
+	 * Sets up the title for pages and <title>
+	 *
+	 * @global obj $bp
+	 */
+	function setup_title() {
+		global $bp;
+
+		// Adjust title
+		if ( bp_is_friends_component() ) {
+			if ( bp_is_my_profile() ) {
+				$bp->bp_options_title = __( 'Friendships', 'buddypress' );
+			} else {
+				$bp->bp_options_avatar = bp_core_fetch_avatar( array(
+					'item_id' => $bp->displayed_user->id,
+					'type'    => 'thumb'
+				) );
+				$bp->bp_options_title  = $bp->displayed_user->fullname;
+			}
+		}
+
+		parent::setup_title();
+	}
+}
+// Create the friends component
+$bp->friends = new BP_Friends_Component();
+
+?>
\ 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 8fd4a7ccadbd59d3761cac0d116175b8e009a2b8..59b2487929c25d729e1034aa56024d4a8d29d85a 100644
--- a/wp-content/plugins/buddypress/bp-friends/bp-friends-notifications.php
+++ b/wp-content/plugins/buddypress/bp-friends/bp-friends-notifications.php
@@ -1,44 +1,48 @@
 <?php
+// 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' == 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 );
 
-	$all_requests_link = bp_core_get_user_domain( $friend_id ) . BP_FRIENDS_SLUG . '/requests/';
-	$settings_link = bp_core_get_user_domain( $friend_id ) .  BP_SETTINGS_SLUG . '/notifications';
+	$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 );
 
 	// Set up and send the message
 	$to       = $ud->user_email;
-	$sitename = wp_specialchars_decode( get_blog_option( BP_ROOT_BLOG, 'blogname' ), ENT_QUOTES );
+	$sitename = wp_specialchars_decode( get_blog_option( bp_get_root_blog_id(), 'blogname' ), ENT_QUOTES );
 	$subject  = '[' . $sitename . '] ' . sprintf( __( 'New friendship request from %s', 'buddypress' ), $initiator_name );
 
 	$message = sprintf( __(
-"%s wants to add you as a friend.
+'%1$s wants to add you as a friend.
 
-To view all of your pending friendship requests: %s
+To view all of your pending friendship requests: %2$s
 
-To view %s's profile: %s
+To view %3$s\'s profile: %4$s
 
 ---------------------
-", 'buddypress' ), $initiator_name, $all_requests_link, $initiator_name, $initiator_link );
+', 'buddypress' ), $initiator_name, $all_requests_link, $initiator_name, $initiator_link );
 
 	$message .= sprintf( __( 'To disable these notifications please log in and go to: %s', 'buddypress' ), $settings_link );
 
 	/* Send the message */
 	$to = apply_filters( 'friends_notification_new_request_to', $to );
 	$subject = apply_filters( 'friends_notification_new_request_subject', $subject, $initiator_name );
-	$message = apply_filters( 'friends_notification_new_request_message', $message, $initiator_name, $initiator_link, $all_requests_link );
+	$message = apply_filters( 'friends_notification_new_request_message', $message, $initiator_name, $initiator_link, $all_requests_link, $settings_link );
 
 	wp_mail( $to, $subject, $message );
+
+	do_action( 'bp_friends_sent_request_email', $friend_id, $subject, $message, $friendship_id, $initiator_id );
 }
 
 function friends_notification_accepted_request( $friendship_id, $initiator_id, $friend_id ) {
@@ -48,23 +52,23 @@ function friends_notification_accepted_request( $friendship_id, $initiator_id, $
 
 	$friend_name = bp_core_get_user_displayname( $friend_id );
 
-	if ( 'no' == 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_SETTINGS_SLUG . '/notifications';
+	$settings_link = bp_core_get_user_domain( $initiator_id ) . bp_get_settings_slug() . '/notifications';
 
 	// Set up and send the message
 	$to       = $ud->user_email;
-	$sitename = wp_specialchars_decode( get_blog_option( BP_ROOT_BLOG, 'blogname' ), ENT_QUOTES );
+	$sitename = wp_specialchars_decode( get_blog_option( bp_get_root_blog_id(), 'blogname' ), ENT_QUOTES );
 	$subject  = '[' . $sitename . '] ' . sprintf( __( '%s accepted your friendship request', 'buddypress' ), $friend_name );
 
 	$message = sprintf( __(
-'%s accepted your friend request.
+'%1$s accepted your friend request.
 
-To view %s\'s profile: %s
+To view %2$s\'s profile: %3$s
 
 ---------------------
 ', 'buddypress' ), $friend_name, $friend_name, $friend_link );
@@ -74,9 +78,11 @@ To view %s\'s profile: %s
 	/* Send the message */
 	$to = apply_filters( 'friends_notification_accepted_request_to', $to );
 	$subject = apply_filters( 'friends_notification_accepted_request_subject', $subject, $friend_name );
-	$message = apply_filters( 'friends_notification_accepted_request_message', $message, $friend_name, $friend_link );
+	$message = apply_filters( 'friends_notification_accepted_request_message', $message, $friend_name, $friend_link, $settings_link );
 
 	wp_mail( $to, $subject, $message );
+
+	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
new file mode 100644
index 0000000000000000000000000000000000000000..5afbd07310ca261d0ab8d6f65670edf4cd83041b
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-friends/bp-friends-screens.php
@@ -0,0 +1,97 @@
+<?php
+/**
+ * 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.
+ */
+
+// Exit if accessed directly
+if ( !defined( 'ABSPATH' ) ) exit;
+
+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' );
+
+	do_action( 'friends_screen_my_friends' );
+
+	bp_core_load_template( apply_filters( 'friends_template_my_friends', 'members/single/home' ) );
+}
+
+function friends_screen_requests() {
+	if ( bp_is_action_variable( 'accept', 0 ) && is_numeric( bp_action_variable( 1 ) ) ) {
+		// Check the nonce
+		check_admin_referer( 'friends_accept_friendship' );
+
+		if ( friends_accept_friendship( bp_action_variable( 1 ) ) )
+			bp_core_add_message( __( 'Friendship accepted', 'buddypress' ) );
+		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() );
+
+	} elseif ( bp_is_action_variable( 'reject', 0 ) && is_numeric( bp_action_variable( 1 ) ) ) {
+		// Check the nonce
+		check_admin_referer( 'friends_reject_friendship' );
+
+		if ( friends_reject_friendship( bp_action_variable( 1 ) ) )
+			bp_core_add_message( __( 'Friendship rejected', 'buddypress' ) );
+		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() );
+	}
+
+	do_action( 'friends_screen_requests' );
+
+	if ( isset( $_GET['new'] ) )
+		bp_core_delete_notifications_by_type( bp_loggedin_user_id(), 'friends', 'friendship_request' );
+
+	bp_core_load_template( apply_filters( 'friends_template_requests', 'members/single/home' ) );
+}
+
+function friends_screen_notification_settings() {
+	global $bp;
+
+	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';
+?>
+
+	<table class="notification-settings" id="friends-notification-settings">
+		<thead>
+			<tr>
+				<th class="icon"></th>
+				<th class="title"><?php _e( 'Friends', 'buddypress' ) ?></th>
+				<th class="yes"><?php _e( 'Yes', 'buddypress' ) ?></th>
+				<th class="no"><?php _e( 'No', 'buddypress' )?></th>
+			</tr>
+		</thead>
+
+		<tbody>
+			<tr id="friends-notification-settings-request">
+				<td></td>
+				<td><?php _e( 'A member sends you a friendship request', 'buddypress' ) ?></td>
+				<td class="yes"><input type="radio" name="notifications[notification_friends_friendship_request]" value="yes" <?php checked( $send_requests, 'yes', true ) ?>/></td>
+				<td class="no"><input type="radio" name="notifications[notification_friends_friendship_request]" value="no" <?php checked( $send_requests, 'no', true ) ?>/></td>
+			</tr>
+			<tr id="friends-notification-settings-accepted">
+				<td></td>
+				<td><?php _e( 'A member accepts your friendship request', 'buddypress' ) ?></td>
+				<td class="yes"><input type="radio" name="notifications[notification_friends_friendship_accepted]" value="yes" <?php checked( $accept_requests, 'yes', true ) ?>/></td>
+				<td class="no"><input type="radio" name="notifications[notification_friends_friendship_accepted]" value="no" <?php checked( $accept_requests, 'no', true ) ?>/></td>
+			</tr>
+
+			<?php do_action( 'friends_screen_notification_settings' ); ?>
+
+		</tbody>
+	</table>
+
+<?php
+}
+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
new file mode 100644
index 0000000000000000000000000000000000000000..71833bdd327bc002815ef7894670f0b07929ac04
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-friends/bp-friends-template.php
@@ -0,0 +1,449 @@
+<?php
+// Exit if accessed directly
+if ( !defined( 'ABSPATH' ) ) exit;
+
+/**
+ * Output the friends component slug
+ *
+ * @package BuddyPress
+ * @subpackage Friends Template
+ * @since 1.5
+ *
+ * @uses bp_get_friends_slug()
+ */
+function bp_friends_slug() {
+	echo bp_get_friends_slug();
+}
+	/**
+	 * Return the friends component slug
+	 *
+	 * @package BuddyPress
+	 * @subpackage Friends Template
+	 * @since 1.5
+	 */
+	function bp_get_friends_slug() {
+		global $bp;
+		return apply_filters( 'bp_get_friends_slug', $bp->friends->slug );
+	}
+
+/**
+ * Output the friends component root slug
+ *
+ * @package BuddyPress
+ * @subpackage Friends Template
+ * @since 1.5
+ *
+ * @uses bp_get_friends_root_slug()
+ */
+function bp_friends_root_slug() {
+	echo bp_get_friends_root_slug();
+}
+	/**
+	 * Return the friends component root slug
+	 *
+	 * @package BuddyPress
+	 * @subpackage Friends Template
+	 * @since 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' );
+	} ?>
+
+	<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>
+
+		<?php if ( $friend_ids ) { ?>
+
+			<ul class="horiz-gallery">
+
+			<?php for ( $i = 0, $count = count( $friend_ids ); $i < $count; ++$i ) { ?>
+
+				<li>
+					<a href="<?php echo bp_core_get_user_domain( $friend_ids[$i] ) ?>"><?php echo bp_core_fetch_avatar( array( 'item_id' => $friend_ids[$i], 'type' => 'thumb' ) ) ?></a>
+					<h5><?php echo bp_core_get_userlink($friend_ids[$i]) ?></h5>
+				</li>
+
+			<?php } ?>
+
+			</ul>
+
+		<?php } else { ?>
+
+			<div id="message" class="info">
+				<p><?php bp_word_or_name( __( "You haven't added any friend connections yet.", 'buddypress' ), __( "%s hasn't created any friend connections yet.", 'buddypress' ) ) ?></p>
+			</div>
+
+		<?php } ?>
+		<div class="clear"></div>
+	</div>
+<?php
+}
+
+/**
+ * Pull up a group of random members, and display some profile data about them
+ *
+ * This function is no longer used by BuddyPress core.
+ *
+ * @package BuddyPress
+ *
+ * @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 );
+		wp_cache_set( 'friends_random_users', $user_ids, 'bp' );
+	}
+
+	?>
+
+	<?php if ( $user_ids['users'] ) { ?>
+
+		<ul class="item-list" id="random-members-list">
+
+		<?php for ( $i = 0, $count = count( $user_ids['users'] ); $i < $count; ++$i ) { ?>
+
+			<li>
+				<a href="<?php echo bp_core_get_user_domain( $user_ids['users'][$i]->id ) ?>"><?php echo bp_core_fetch_avatar( array( 'item_id' => $user_ids['users'][$i]->id, 'type' => 'thumb' ) ) ?></a>
+				<h5><?php echo bp_core_get_userlink( $user_ids['users'][$i]->id ) ?></h5>
+
+				<?php if ( bp_is_active( 'xprofile' ) ) { ?>
+
+					<?php $random_data = xprofile_get_random_profile_data( $user_ids['users'][$i]->id, true ); ?>
+
+					<div class="profile-data">
+						<p class="field-name"><?php echo $random_data[0]->name ?></p>
+
+						<?php echo $random_data[0]->value ?>
+
+					</div>
+
+				<?php } ?>
+
+				<div class="action">
+
+					<?php if ( bp_is_active( 'friends' ) ) { ?>
+
+						<?php bp_add_friend_button( $user_ids['users'][$i]->id ) ?>
+
+					<?php } ?>
+
+				</div>
+			</li>
+
+		<?php } ?>
+
+		</ul>
+
+	<?php } else { ?>
+
+		<div id="message" class="info">
+			<p><?php _e( "There aren't enough site members to show a random sample just yet.", 'buddypress' ) ?></p>
+		</div>
+
+	<?php } ?>
+<?php
+}
+
+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' ); ?>
+
+		<form action="<?php echo $action ?>" id="friend-search-form" method="post">
+
+			<label for="friend-search-box" id="friend-search-label"><?php echo $label ?></label>
+			<input type="search" name="friend-search-box" id="friend-search-box" value="<?php echo $value ?>"<?php echo $disabled ?> />
+
+			<?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 ) ?>" />
+
+		</form>
+
+	<?php
+}
+
+function bp_member_add_friend_button() {
+	global $members_template;
+
+	if ( !isset( $members_template->member->is_friend ) || null === $members_template->member->is_friend )
+		$friend_status = 'not_friends';
+	else
+		$friend_status = ( 0 == $members_template->member->is_friend ) ? 'pending' : 'is_friend';
+
+	echo bp_get_add_friend_button( $members_template->member->id, $friend_status );
+}
+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() {
+		global $members_template;
+
+		if ( 1 == (int) $members_template->member->total_friend_count )
+			return apply_filters( 'bp_get_member_total_friend_count', sprintf( __( '%d friend', 'buddypress' ), (int) $members_template->member->total_friend_count ) );
+		else
+			return apply_filters( 'bp_get_member_total_friend_count', sprintf( __( '%d friends', 'buddypress' ), (int) $members_template->member->total_friend_count ) );
+	}
+
+/**
+ * bp_potential_friend_id( $user_id )
+ *
+ * Outputs the ID of the potential friend
+ *
+ * @uses bp_get_potential_friend_id()
+ * @param <type> $user_id
+ */
+function bp_potential_friend_id( $user_id = 0 ) {
+	echo bp_get_potential_friend_id( $user_id );
+}
+	/**
+	 * bp_get_potential_friend_id( $user_id )
+	 *
+	 * 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;
+
+		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;
+
+		return apply_filters( 'bp_get_potential_friend_id', (int)$user_id );
+	}
+
+/**
+ * bp_is_friend( $user_id )
+ *
+ * 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;
+
+	if ( empty( $user_id ) )
+		$user_id = bp_get_potential_friend_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 );
+}
+
+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 );
+
+		$is_friend = bp_is_friend( $potential_friend_id );
+
+		if ( empty( $is_friend ) )
+			return false;
+
+		switch ( $is_friend ) {
+			case 'pending' :
+				$button = array(
+					'id'                => 'pending',
+					'component'         => 'friends',
+					'must_be_logged_in' => true,
+					'block_self'        => true,
+					'wrapper_class'     => 'friendship-button pending',
+					'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'
+				);
+				break;
+
+			case 'is_friend' :
+				$button = array(
+					'id'                => 'is_friend',
+					'component'         => 'friends',
+					'must_be_logged_in' => true,
+					'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_text'         => __( 'Cancel Friendship', 'buddypress' ),
+					'link_title'        => __( 'Cancel Friendship', 'buddypress' ),
+					'link_id'           => 'friend-' . $potential_friend_id,
+					'link_rel'          => 'remove',
+					'link_class'        => 'friendship-button is_friend remove'
+				);
+				break;
+
+			default:
+				$button = array(
+					'id'                => 'not_friends',
+					'component'         => 'friends',
+					'must_be_logged_in' => true,
+					'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_text'         => __( 'Add Friend', 'buddypress' ),
+					'link_title'        => __( 'Add Friend', 'buddypress' ),
+					'link_id'           => 'friend-' . $potential_friend_id,
+					'link_rel'          => 'add',
+					'link_class'        => 'friendship-button not_friends add'
+				);
+				break;
+		}
+
+		// Filter and return the HTML button
+		return bp_get_button( apply_filters( 'bp_get_add_friend_button', $button ) );
+	}
+
+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;
+
+	$friend_ids = friends_get_friend_user_ids( $user_id );
+
+	if ( empty( $friend_ids ) )
+		return false;
+
+	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 ) ) );
+}
+
+function bp_friend_friendship_id() {
+	echo bp_get_friend_friendship_id();
+}
+	function bp_get_friend_friendship_id() {
+		global $members_template, $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 );
+	}
+
+function bp_friend_accept_request_link() {
+	echo bp_get_friend_accept_request_link();
+}
+	function bp_get_friend_accept_request_link() {
+		global $members_template, $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' ) );
+	}
+
+function bp_friend_reject_request_link() {
+	echo bp_get_friend_reject_request_link();
+}
+	function bp_get_friend_reject_request_link() {
+		global $members_template, $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' ) );
+	}
+
+function bp_total_friend_count( $user_id = 0 ) {
+	echo bp_get_total_friend_count( $user_id );
+}
+	function bp_get_total_friend_count( $user_id = 0 ) {
+		return apply_filters( 'bp_get_total_friend_count', friends_get_total_friend_count( $user_id ) );
+	}
+	add_filter( 'bp_get_total_friend_count', 'bp_core_number_format' );
+
+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;
+
+		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
new file mode 100644
index 0000000000000000000000000000000000000000..74766e2a4dcec8984a1a68d2a1e94709d104b4d8
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-groups/bp-groups-actions.php
@@ -0,0 +1,318 @@
+<?php
+/********************************************************************************
+ * Action Functions
+ *
+ * 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.
+ */
+
+// Exit if accessed directly
+if ( !defined( 'ABSPATH' ) ) exit;
+
+function groups_action_create_group() {
+	global $bp;
+
+	// If we're not at domain.org/groups/create/ then return false
+	if ( !bp_is_groups_component() || !bp_is_current_action( 'create' ) )
+		return false;
+
+	if ( !is_user_logged_in() )
+		return false;
+
+ 	if ( !bp_user_can_create_groups() ) {
+		bp_core_add_message( __( 'Sorry, you are not allowed to create groups.', 'buddypress' ), 'error' );
+		bp_core_redirect( trailingslashit( bp_get_root_domain() . '/' . bp_get_groups_root_slug() ) );
+	}
+
+	// Make sure creation steps are in the right order
+	groups_action_sort_creation_steps();
+
+	// 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 ) {
+		unset( $bp->groups->current_create_step );
+		unset( $bp->groups->completed_create_steps );
+
+		setcookie( 'bp_new_group_id', false, time() - 1000, COOKIEPATH );
+		setcookie( 'bp_completed_create_steps', false, time() - 1000, COOKIEPATH );
+
+		$reset_steps = true;
+		bp_core_redirect( bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/create/step/' . array_shift( array_keys( $bp->groups->group_creation_steps ) ) . '/' );
+	}
+
+	// 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] ) ) {
+		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/' );
+	}
+
+	// Fetch the currently completed steps variable
+	if ( isset( $_COOKIE['bp_completed_create_steps'] ) && !isset( $reset_steps ) )
+		$bp->groups->completed_create_steps = unserialize( stripslashes( $_COOKIE['bp_completed_create_steps'] ) );
+
+	// 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 );
+	}
+
+	// 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 );
+
+		if ( 'group-details' == $bp->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 . '/' );
+			}
+
+			$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 . '/' );
+			}
+
+			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 ) {
+			$group_status = 'public';
+			$group_enable_forum = 1;
+
+			if ( !isset($_POST['group-show-forum']) ) {
+				$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' ) ) {
+					groups_new_group_forum();
+				}
+			}
+
+			if ( 'private' == $_POST['group-status'] )
+				$group_status = 'private';
+			else if ( 'hidden' == $_POST['group-status'] )
+				$group_status = 'hidden';
+
+			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 . '/' );
+			}
+
+			// 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';
+
+			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 );
+
+		do_action( 'groups_create_group_step_save_' . $bp->groups->current_create_step );
+		do_action( 'groups_create_group_step_complete' ); // Mostly for clearing cache on a generic action name
+
+		/**
+		 * Once we have successfully saved the details for this step of the creation process
+		 * we need to add the current step to the array of completed steps, then update the cookies
+		 * 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;
+
+		// Reset cookie info
+		setcookie( 'bp_new_group_id', $bp->groups->new_group_id, time()+60*60*24, COOKIEPATH );
+		setcookie( 'bp_completed_create_steps', serialize( $bp->groups->completed_create_steps ), time()+60*60*24, COOKIEPATH );
+
+		// 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 ) ) ) {
+			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>' ) ),
+				'type' => 'created_group',
+				'item_id' => $bp->groups->new_group_id
+			) );
+
+			do_action( 'groups_group_create_complete', $bp->groups->new_group_id );
+
+			bp_core_redirect( bp_get_group_permalink( $bp->groups->current_group ) );
+		} else {
+			/**
+			 * 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 ) {
+					$next = 1;
+					continue;
+				}
+
+				if ( isset( $next ) ) {
+					$next_step = $key;
+					break;
+				}
+			}
+
+			bp_core_redirect( bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/create/step/' . $next_step . '/' );
+		}
+	}
+
+	// Group avatar is handled separately
+	if ( 'group-avatar' == $bp->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
+
+			// Pass the file to the avatar upload handler
+			if ( bp_core_avatar_handle_upload( $_FILES, 'groups_avatar_upload_dir' ) ) {
+				$bp->avatar_admin->step = 'crop-image';
+
+				// Make sure we include the jQuery jCrop file for image cropping
+				add_action( 'wp_print_scripts', 'bp_core_add_jquery_cropper' );
+			}
+		}
+
+		// If the image cropping is done, crop the image and save a full/thumb version
+		if ( isset( $_POST['avatar-crop-submit'] ) && isset( $_POST['upload'] ) ) {
+			// Normally we would check a nonce here, but the group save nonce is used instead
+
+			if ( !bp_core_avatar_handle_crop( array( 'object' => 'group', 'avatar_dir' => 'group-avatars', 'item_id' => $bp->groups->current_group->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 an error saving the group avatar, please try uploading again.', 'buddypress' ), 'error' );
+			else
+				bp_core_add_message( __( 'The group avatar was uploaded successfully!', 'buddypress' ) );
+		}
+	}
+
+ 	bp_core_load_template( apply_filters( 'groups_template_create_group', 'groups/create' ) );
+}
+add_action( 'bp_actions', 'groups_action_create_group' );
+
+function groups_action_join_group() {
+	global $bp;
+
+	if ( !bp_is_single_item() || !bp_is_groups_component() || !bp_is_current_action( 'join' ) )
+		return false;
+
+	// Nonce check
+	if ( !check_admin_referer( 'groups_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 ) ) {
+
+		// 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 ) ) {
+				bp_core_add_message( __( 'There was an error joining the group.', 'buddypress' ), 'error' );
+				bp_core_redirect( bp_get_group_permalink( $bp->groups->current_group ) );
+			}
+		}
+
+		// User wants to join any group
+		if ( !groups_join_group( $bp->groups->current_group->id ) )
+			bp_core_add_message( __( 'There was an error joining the group.', 'buddypress' ), 'error' );
+		else
+			bp_core_add_message( __( 'You joined the group!', 'buddypress' ) );
+
+		bp_core_redirect( bp_get_group_permalink( $bp->groups->current_group ) );
+	}
+
+	bp_core_load_template( apply_filters( 'groups_template_group_home', 'groups/single/home' ) );
+}
+add_action( 'bp_actions', 'groups_action_join_group' );
+
+
+function groups_action_leave_group() {
+	global $bp;
+
+	if ( !bp_is_single_item() || !bp_is_groups_component() || !bp_is_current_action( 'leave-group' ) )
+		return false;
+
+	// Nonce check
+	if ( !check_admin_referer( 'groups_leave_group' ) )
+		return false;
+
+	// User wants to leave any group
+	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 )
+			bp_core_add_message( __( 'This group must have at least one admin', 'buddypress' ), 'error' );
+
+		elseif ( !groups_leave_group( $bp->groups->current_group->id ) )
+			bp_core_add_message( __( 'There was an error leaving the group.', 'buddypress' ), 'error' );
+		else
+			bp_core_add_message( __( 'You successfully left the group.', 'buddypress' ) );
+
+		bp_core_redirect( bp_get_group_permalink( $bp->groups->current_group ) );
+	}
+
+	bp_core_load_template( apply_filters( 'groups_template_group_home', 'groups/single/home' ) );
+}
+add_action( 'bp_actions', 'groups_action_leave_group' );
+
+
+function groups_action_sort_creation_steps() {
+	global $bp;
+
+	if ( !bp_is_groups_component() || !bp_is_current_action( 'create' ) )
+		return false;
+
+	if ( !is_array( $bp->groups->group_creation_steps ) )
+		return false;
+
+	foreach ( (array)$bp->groups->group_creation_steps as $slug => $step ) {
+		while ( !empty( $temp[$step['position']] ) )
+			$step['position']++;
+
+		$temp[$step['position']] = array( 'name' => $step['name'], 'slug' => $slug );
+	}
+
+	// Sort the steps by their position key
+	ksort($temp);
+	unset($bp->groups->group_creation_steps);
+
+	foreach( (array)$temp as $position => $step )
+		$bp->groups->group_creation_steps[$step['slug']] = array( 'name' => $step['name'], 'position' => $position );
+}
+
+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 ) );
+
+		bp_core_redirect( bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/' . $group['groups'][0]->slug . '/' );
+	}
+}
+add_action( 'bp_actions', 'groups_action_redirect_to_random_group' );
+
+function groups_action_group_feed() {
+	global $bp, $wp_query;
+
+	if ( !bp_is_active( 'activity' ) || !bp_is_groups_component() || !isset( $bp->groups->current_group ) || !bp_is_current_action( 'feed' ) )
+		return false;
+
+	$wp_query->is_404 = false;
+	status_header( 200 );
+
+	if ( 'public' != $bp->groups->current_group->status ) {
+		if ( !groups_is_user_member( $bp->loggedin_user->id, $bp->groups->current_group->id ) )
+			return false;
+	}
+
+	include_once( BP_PLUGIN_DIR . '/bp-activity/feeds/bp-activity-group-feed.php' );
+	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
new file mode 100644
index 0000000000000000000000000000000000000000..a09b7f8e7f2aac81b0194d4233c66ce3a1d8d910
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-groups/bp-groups-activity.php
@@ -0,0 +1,307 @@
+<?php
+/**
+ * BuddyPress Groups Activity & Notification Functions
+ *
+ * These functions handle the recording, deleting and formatting of activity and
+ * notifications for the user and for this specific component.
+ *
+ * @package BuddyPress
+ * @subpackage Groups
+ */
+
+// Exit if accessed directly
+if ( !defined( 'ABSPATH' ) ) exit;
+
+function groups_register_activity_actions() {
+	global $bp;
+
+	if ( !bp_is_active( 'activity' ) )
+		return false;
+
+	bp_activity_set_action( $bp->groups->id, 'created_group',   __( 'Created a group',       'buddypress' ) );
+	bp_activity_set_action( $bp->groups->id, 'joined_group',    __( 'Joined a group',        'buddypress' ) );
+	bp_activity_set_action( $bp->groups->id, 'new_forum_topic', __( 'New group forum topic', 'buddypress' ) );
+	bp_activity_set_action( $bp->groups->id, 'new_forum_post',  __( 'New group forum post',  'buddypress' ) );
+
+	do_action( 'groups_register_activity_actions' );
+}
+add_action( 'bp_register_activity_actions', 'groups_register_activity_actions' );
+
+function groups_record_activity( $args = '' ) {
+	global $bp;
+
+	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;
+
+	$defaults = array (
+		'id'                => false,
+		'user_id'           => $bp->loggedin_user->id,
+		'action'            => '',
+		'content'           => '',
+		'primary_link'      => '',
+		'component'         => $bp->groups->id,
+		'type'              => false,
+		'item_id'           => false,
+		'secondary_item_id' => false,
+		'recorded_time'     => bp_core_current_time(),
+		'hide_sitewide'     => $hide_sitewide
+	);
+
+	$r = wp_parse_args( $args, $defaults );
+	extract( $r );
+
+	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 ) );
+}
+
+function groups_update_last_activity( $group_id = 0 ) {
+	global $bp;
+
+	if ( !$group_id )
+		$group_id = $bp->groups->current_group->id;
+
+	if ( !$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_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_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 );
+				$filter = 'bp_groups_multiple_new_membership_requests_notification';
+				$notification_link = $group_link . 'admin/membership-requests/?n=1';
+
+				if ( 'string' == $format ) {
+					return apply_filters( $filter, '<a href="' . $notification_link . '" title="' . __( 'Group Membership Requests', 'buddypress' ) . '">' . $text . '</a>', $group_link, $total_items, $group->name, $text, $notification_link );
+				} else {
+					return apply_filters( $filter, array(
+						'link' => $notification_link,
+						'text' => $text
+					), $group_link, $total_items, $group->name, $text, $notification_link );
+				}
+			} else {
+				$user_fullname = bp_core_get_user_displayname( $requesting_user_id );
+				$text = sprintf( __( '%s requests group membership', 'buddypress' ), $user_fullname );
+				$filter = 'bp_groups_single_new_membership_request_notification';
+				$notification_link = $group_link . 'admin/membership-requests/?n=1';
+
+				if ( 'string' == $format ) {
+					return apply_filters( $filter, '<a href="' . $notification_link . '" title="' . sprintf( __( '%s requests group membership', 'buddypress' ), $user_fullname ) . '">' . $text . '</a>', $group_link, $user_fullname, $group->name, $text, $notification_link );
+				} else {
+					return apply_filters( $filter, array(
+						'link' => $notification_link,
+						'text' => $text
+					), $group_link, $user_fullname, $group->name, $text, $notification_link );
+				}
+			}
+
+			break;
+
+		case 'membership_request_accepted':
+			$group_id = $item_id;
+
+			$group = new BP_Groups_Group( $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 );
+				$filter = 'bp_groups_multiple_membership_request_accepted_notification';
+				$notification_link = 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 );
+				} else {
+					return apply_filters( $filter, array(
+						'link' => $notification_link,
+						'text' => $text
+					), $total_items, $group->name, $text, $notification_link );
+				}
+			} else {
+				$text = sprintf( __( 'Membership for group "%s" accepted', 'buddypress' ), $group->name );
+				$filter = 'bp_groups_single_membership_request_accepted_notification';
+				$notification_link = $group_link . '?n=1';
+
+				if ( 'string' == $format ) {
+					return apply_filters( $filter, '<a href="' . $notification_link . '">' . $text . '</a>', $group_link, $group->name, $text, $notification_link );
+				} else {
+					return apply_filters( $filter, array(
+						'link' => $notification_link,
+						'text' => $text
+					), $group_link, $group->name, $text, $notification_link );
+				}
+			}
+
+			break;
+
+		case 'membership_request_rejected':
+			$group_id = $item_id;
+
+			$group = new BP_Groups_Group( $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 );
+				$filter = 'bp_groups_multiple_membership_request_rejected_notification';
+				$notification_link = 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 );
+				} else {
+					return apply_filters( $filter, array(
+						'link' => $notification_link,
+						'text' => $text
+					), $total_items, $group->name, $text, $notification_link );
+				}
+			} else {
+				$text = sprintf( __( 'Membership for group "%s" rejected', 'buddypress' ), $group->name );
+				$filter = 'bp_groups_single_membership_request_rejected_notification';
+				$notification_link = $group_link . '?n=1';
+
+				if ( 'string' == $format ) {
+					return apply_filters( $filter, '<a href="' . $notification_link . '">' . $text . '</a>', $group_link, $group->name, $text, $notification_link );
+				} else {
+					return apply_filters( $filter, array(
+						'link' => $notification_link,
+						'text' => $text
+					), $group_link, $group->name, $text, $notification_link );
+				}
+			}
+
+			break;
+
+		case 'member_promoted_to_admin':
+			$group_id = $item_id;
+
+			$group = new BP_Groups_Group( $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 );
+				$filter = 'bp_groups_multiple_member_promoted_to_admin_notification';
+				$notification_link = 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 );
+				} else {
+					return apply_filters( $filter, array(
+						'link' => $notification_link,
+						'text' => $text
+					), $total_items, $text, $notification_link );
+				}
+			} else {
+				$text = sprintf( __( 'You were promoted to an admin in the group "%s"', 'buddypress' ), $group->name );
+				$filter = 'bp_groups_single_member_promoted_to_admin_notification';
+				$notification_link = $group_link . '?n=1';
+
+				if ( 'string' == $format ) {
+					return apply_filters( $filter, '<a href="' . $notification_link . '">' . $text . '</a>', $group_link, $group->name, $text, $notification_link );
+				} else {
+					return apply_filters( $filter, array(
+						'link' => $notification_link,
+						'text' => $text
+					), $group_link, $group->name, $text, $notification_link );
+				}
+			}
+
+			break;
+
+		case 'member_promoted_to_mod':
+			$group_id = $item_id;
+
+			$group = new BP_Groups_Group( $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 );
+				$filter = 'bp_groups_multiple_member_promoted_to_mod_notification';
+				$notification_link = 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 );
+				} else {
+					return apply_filters( $filter, array(
+						'link' => $notification_link,
+						'text' => $text
+					), $total_items, $text, $notification_link );
+				}
+			} else {
+				$text = sprintf( __( 'You were promoted to a mod in the group "%s"', 'buddypress' ), $group->name );
+				$filter = 'bp_groups_single_member_promoted_to_mod_notification';
+				$notification_link = $group_link . '?n=1';
+
+				if ( 'string' == $format ) {
+					return apply_filters( $filter, '<a href="' . $notification_link . '">' . $text . '</a>', $group_link, $group->name, $text, $notification_link );
+				} else {
+					return apply_filters( $filter, array(
+						'link' => $notification_link,
+						'text' => $text
+					), $group_link, $group->name, $text, $notification_link );
+				}
+			}
+
+			break;
+
+		case 'group_invite':
+			$group_id = $item_id;
+			$group = new BP_Groups_Group( $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 );
+				$filter = 'bp_groups_multiple_group_invite_notification';
+
+				if ( 'string' == $format ) {
+					return apply_filters( $filter, '<a href="' . $notification_link . '" title="' . __( 'Group Invites', 'buddypress' ) . '">' . $text . '</a>', $total_items, $text, $notification_link );
+				} else {
+					return apply_filters( $filter, array(
+						'link' => $notification_link,
+						'text' => $text
+					), $total_items, $text, $notification_link );
+				}
+			} else {
+				$text = sprintf( __( 'You have an invitation to the group: %s', 'buddypress' ), $group->name );
+				$filter = 'bp_groups_single_group_invite_notification';
+
+				if ( 'string' == $format ) {
+					return apply_filters( $filter, '<a href="' . $notification_link . '">' . $text . '</a>', $group_link, $group->name, $text, $notification_link );
+				} else {
+					return apply_filters( $filter, array(
+						'link' => $notification_link,
+						'text' => $text
+					), $group_link, $group->name, $text, $notification_link );
+				}
+			}
+
+			break;
+	}
+
+	do_action( 'groups_format_notifications', $action, $item_id, $secondary_item_id, $total_items );
+
+	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
new file mode 100644
index 0000000000000000000000000000000000000000..2d2c346b70586125f4b409b05447cdf5f8d3956b
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-groups/bp-groups-adminbar.php
@@ -0,0 +1,146 @@
+<?php
+/**
+ * BuddyPress Groups Admin Bar
+ *
+ * Handles the groups functions related to the WordPress Admin Bar
+ *
+ * @package BuddyPress
+ * @subpackage Groups
+ */
+
+// 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
+ *
+ * @todo Add dynamic menu items for group extensions
+ */
+function bp_groups_group_admin_menu() {
+	global $wp_admin_bar, $bp;
+
+	// Only show if viewing a group
+	if ( !bp_is_group() )
+		return false;
+
+	// Only show this menu to group admins and super admins
+	if ( !is_super_admin() && !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 )
+		) );
+
+	} 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 )
+		) );
+	}
+
+	// Group Admin > Edit details
+	$wp_admin_bar->add_menu( array(
+		'parent' => $bp->group_admin_menu_id,
+		'id'     => 'edit-details',
+		'title'  => __( 'Edit Details', 'buddypress' ),
+		'href'   =>  bp_get_groups_action_link( 'admin/edit-details' )
+	) );
+
+	// Group Admin > Group settings
+	$wp_admin_bar->add_menu( array(
+		'parent' => $bp->group_admin_menu_id,
+		'id'     => 'group-settings',
+		'title'  => __( 'Edit Settings', 'buddypress' ),
+		'href'   =>  bp_get_groups_action_link( 'admin/group-settings' )
+	) );
+
+	// Group Admin > Group avatar
+	if ( !(int)bp_get_option( 'bp-disable-avatar-uploads' ) ) {
+		$wp_admin_bar->add_menu( array(
+			'parent' => $bp->group_admin_menu_id,
+			'id'     => 'group-avatar',
+			'title'  => __( 'Edit Avatar', 'buddypress' ),
+			'href'   =>  bp_get_groups_action_link( 'admin/group-avatar' )
+		) );
+	}
+
+	// Group Admin > Manage invitations
+	if ( bp_is_active( 'friends' ) ) {
+		$wp_admin_bar->add_menu( array(
+			'parent' => $bp->group_admin_menu_id,
+			'id'     => 'manage-invitations',
+			'title'  => __( 'Manage Invitations', 'buddypress' ),
+			'href'   =>  bp_get_groups_action_link( 'send-invites' )
+		) );
+	}
+
+	// Group Admin > Manage members
+	$wp_admin_bar->add_menu( array(
+		'parent' => $bp->group_admin_menu_id,
+		'id'     => 'manage-members',
+		'title'  => __( 'Manage Members', 'buddypress' ),
+		'href'   =>  bp_get_groups_action_link( 'admin/manage-members' )
+	) );
+
+	// Group Admin > Membership Requests
+	if ( bp_get_group_status( $bp->groups->current_group ) == 'private' ) {
+		$wp_admin_bar->add_menu( array(
+			'parent' => $bp->group_admin_menu_id,
+			'id'     => 'membership-requests',
+			'title'  => __( 'Membership Requests', 'buddypress' ),
+			'href'   =>  bp_get_groups_action_link( 'admin/membership-requests' )
+		) );
+	}
+
+	// Delete Group
+	$wp_admin_bar->add_menu( array(
+		'parent' => $bp->group_admin_menu_id,
+		'id'     => 'delete-group',
+		'title'  => __( 'Delete Group', 'buddypress' ),
+		'href'   =>  bp_get_groups_action_link( 'admin/delete-group' )
+	) );
+}
+
+?>
\ 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
new file mode 100644
index 0000000000000000000000000000000000000000..da4a61c25a2c4914774cc9346e275d4322b97077
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-groups/bp-groups-buddybar.php
@@ -0,0 +1,54 @@
+<?php
+// Exit if accessed directly
+if ( !defined( 'ABSPATH' ) ) exit;
+
+function bp_groups_adminbar_admin_menu() {
+	global $bp, $groups_template;
+
+	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 ) )
+		return false; ?>
+
+	<li id="bp-adminbar-adminoptions-menu">
+		<a href="<?php bp_groups_action_link( 'admin' ); ?>"><?php _e( 'Admin Options', 'buddypress' ); ?></a>
+
+		<ul>
+			<li><a href="<?php bp_groups_action_link( 'admin/edit-details' ); ?>"><?php _e( 'Edit Details', 'buddypress' ); ?></a></li>
+
+			<li><a href="<?php bp_groups_action_link( 'admin/group-settings' );  ?>"><?php _e( 'Group Settings', 'buddypress' ); ?></a></li>
+
+			<?php if ( !(int)bp_get_option( 'bp-disable-avatar-uploads' ) ) : ?>
+
+				<li><a href="<?php bp_groups_action_link( 'admin/group-avatar' ); ?>"><?php _e( 'Group Avatar', 'buddypress' ); ?></a></li>
+
+			<?php endif; ?>
+
+			<?php if ( bp_is_active( 'friends' ) ) : ?>
+
+				<li><a href="<?php bp_groups_action_link( 'send-invites' ); ?>"><?php _e( 'Manage Invitations', 'buddypress' ); ?></a></li>
+
+			<?php endif; ?>
+
+			<li><a href="<?php bp_groups_action_link( 'admin/manage-members' ); ?>"><?php _e( 'Manage Members', 'buddypress' ); ?></a></li>
+
+			<?php if ( $bp->groups->current_group->status == 'private' ) : ?>
+
+				<li><a href="<?php bp_groups_action_link( 'admin/membership-requests' ); ?>"><?php _e( 'Membership Requests', 'buddypress' ); ?></a></li>
+
+			<?php endif; ?>
+
+			<li><a class="confirm" href="<?php echo wp_nonce_url( bp_get_group_permalink( $bp->groups->current_group ) . 'admin/delete-group/', 'groups_delete_group' ); ?>&amp;delete-group-button=1&amp;delete-group-understand=1"><?php _e( "Delete Group", 'buddypress' ) ?></a></li>
+
+			<?php do_action( 'bp_groups_adminbar_admin_menu' ) ?>
+
+		</ul>
+	</li>
+
+	<?php
+}
+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
new file mode 100644
index 0000000000000000000000000000000000000000..908df53b9aa3f693b84c2b3e57ebc903cf7b7e0b
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-groups/bp-groups-cache.php
@@ -0,0 +1,52 @@
+<?php
+/**
+ * BuddyPress Groups Caching
+ *
+ * Caching functions handle the clearing of cached objects and pages on specific
+ * actions throughout BuddyPress.
+ *
+ * @package BuddyPress
+ * @subpackage Groups
+ */
+
+// Exit if accessed directly
+if ( !defined( 'ABSPATH' ) ) exit;
+
+function groups_clear_group_object_cache( $group_id ) {
+	wp_cache_delete( 'bp_total_group_count', 'bp' );
+}
+add_action( 'groups_group_deleted',              'groups_clear_group_object_cache' );
+add_action( 'groups_settings_updated',           'groups_clear_group_object_cache' );
+add_action( 'groups_details_updated',            'groups_clear_group_object_cache' );
+add_action( 'groups_group_avatar_updated',       'groups_clear_group_object_cache' );
+add_action( 'groups_create_group_step_complete', 'groups_clear_group_object_cache' );
+
+function groups_clear_group_user_object_cache( $group_id, $user_id ) {
+	wp_cache_delete( 'bp_total_groups_for_user_' . $user_id );
+}
+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 );
+add_action( 'groups_ban_member',   'groups_clear_group_user_object_cache', 10, 2 );
+add_action( 'groups_unban_member', 'groups_clear_group_user_object_cache', 10, 2 );
+
+/* List actions to clear super cached pages on, if super cache is installed */
+add_action( 'groups_join_group',                 'bp_core_clear_cache' );
+add_action( 'groups_leave_group',                'bp_core_clear_cache' );
+add_action( 'groups_accept_invite',              'bp_core_clear_cache' );
+add_action( 'groups_reject_invite',              'bp_core_clear_cache' );
+add_action( 'groups_invite_user',                'bp_core_clear_cache' );
+add_action( 'groups_uninvite_user',              'bp_core_clear_cache' );
+add_action( 'groups_details_updated',            'bp_core_clear_cache' );
+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_membership_rejected',        'bp_core_clear_cache' );
+add_action( 'groups_membership_accepted',        'bp_core_clear_cache' );
+add_action( 'groups_membership_requested',       'bp_core_clear_cache' );
+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 c33d29e465ae8d2ca90073ad5c99fb089a452e47..f4467022c3030a7c0cbc3005360a9dbb19864a12 100644
--- a/wp-content/plugins/buddypress/bp-groups/bp-groups-classes.php
+++ b/wp-content/plugins/buddypress/bp-groups/bp-groups-classes.php
@@ -1,4 +1,6 @@
 <?php
+// Exit if accessed directly
+if ( !defined( 'ABSPATH' ) ) exit;
 
 Class BP_Groups_Group {
 	var $id;
@@ -11,9 +13,14 @@ Class BP_Groups_Group {
 	var $date_created;
 
 	var $admins;
+	var $mods;
 	var $total_member_count;
 
 	function bp_groups_group( $id = null ) {
+		$this->__construct($id);
+	}
+
+	function __construct( $id = null ) {
 		if ( $id ) {
 			$this->id = $id;
 			$this->populate();
@@ -24,20 +31,20 @@ Class BP_Groups_Group {
 		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 ) ) ) {
-			$this->id = $group->id;
-			$this->creator_id = $group->creator_id;
-			$this->name = stripslashes($group->name);
-			$this->slug = $group->slug;
-			$this->description = stripslashes($group->description);
-			$this->status = $group->status;
-			$this->enable_forum = $group->enable_forum;
-			$this->date_created = $group->date_created;
-			$this->last_activity = $group->last_activity;
+			$this->id                 = $group->id;
+			$this->creator_id         = $group->creator_id;
+			$this->name               = stripslashes($group->name);
+			$this->slug               = $group->slug;
+			$this->description        = stripslashes($group->description);
+			$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->is_member          = BP_Groups_Member::check_is_member( $bp->loggedin_user->id, $this->id );
 
-			/* Get group admins and mods */
-			$admin_mods = $wpdb->get_results( $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 ) );
+			// 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 )
 					$this->admins[] = $user;
@@ -50,17 +57,17 @@ Class BP_Groups_Group {
 	function save() {
 		global $wpdb, $bp;
 
-		$this->creator_id = apply_filters( 'groups_group_creator_id_before_save', $this->creator_id, $this->id );
-		$this->name = apply_filters( 'groups_group_name_before_save', $this->name, $this->id );
- 		$this->slug = apply_filters( 'groups_group_slug_before_save', $this->slug, $this->id );
-		$this->description = apply_filters( 'groups_group_description_before_save', $this->description, $this->id );
- 		$this->status = apply_filters( 'groups_group_status_before_save', $this->status, $this->id );
+		$this->creator_id   = apply_filters( 'groups_group_creator_id_before_save',   $this->creator_id,   $this->id );
+		$this->name         = apply_filters( 'groups_group_name_before_save',         $this->name,         $this->id );
+ 		$this->slug         = apply_filters( 'groups_group_slug_before_save',         $this->slug,         $this->id );
+		$this->description  = apply_filters( 'groups_group_description_before_save',  $this->description,  $this->id );
+ 		$this->status       = apply_filters( 'groups_group_status_before_save',       $this->status,       $this->id );
 		$this->enable_forum = apply_filters( 'groups_group_enable_forum_before_save', $this->enable_forum, $this->id );
 		$this->date_created = apply_filters( 'groups_group_date_created_before_save', $this->date_created, $this->id );
 
-		do_action( 'groups_group_before_save', $this );
+		do_action_ref_array( 'groups_group_before_save', array( &$this ) );
 
-		if ( $this->id ) {
+		if ( !empty( $this->id ) ) {
 			$sql = $wpdb->prepare(
 				"UPDATE {$bp->groups->table_name} SET
 					creator_id = %d,
@@ -108,11 +115,10 @@ Class BP_Groups_Group {
 		if ( false === $wpdb->query($sql) )
 			return false;
 
-		if ( !$this->id ) {
+		if ( empty( $this->id ) )
 			$this->id = $wpdb->insert_id;
-		}
 
-		do_action( 'groups_group_after_save', $this );
+		do_action_ref_array( 'groups_group_after_save', array( &$this ) );
 
 		return true;
 	}
@@ -120,20 +126,20 @@ Class BP_Groups_Group {
 	function delete() {
 		global $wpdb, $bp;
 
-		/* Delete groupmeta for the group */
+		// Delete groupmeta for the group
 		groups_delete_groupmeta( $this->id );
 
-		/* Fetch the user IDs of all the members of the group */
+		// 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 );
 
-		/* Modify group count usermeta for members */
+		// 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} )" ) );
 
-		/* Now delete all group member entries */
+		// Now delete all group member entries
 		BP_Groups_Member::delete_all( $this->id );
 
-		do_action( 'bp_groups_delete_group', $this );
+		do_action_ref_array( 'bp_groups_delete_group', array( &$this ) );
 
 		// Finally remove the group entry from the DB
 		if ( !$wpdb->query( $wpdb->prepare( "DELETE FROM {$bp->groups->table_name} WHERE id = %d", $this->id ) ) )
@@ -165,7 +171,7 @@ Class BP_Groups_Group {
 		return $wpdb->get_col( $wpdb->prepare( "SELECT user_id FROM {$bp->groups->table_name_members} WHERE group_id = %d and is_confirmed = 0 AND inviter_id = %d", $group_id, $user_id ) );
 	}
 
-	function filter_user_groups( $filter, $user_id = false, $order = false, $limit = null, $page = null ) {
+	function filter_user_groups( $filter, $user_id = 0, $order = false, $limit = null, $page = null ) {
 		global $wpdb, $bp;
 
 		if ( !$user_id )
@@ -255,138 +261,122 @@ Class BP_Groups_Group {
 		return array( 'requests' => $paged_requests, 'total' => $total_requests );
 	}
 
-	/* TODO: Merge all these get_() functions into one. */
-
-	function get_newest( $limit = null, $page = null, $user_id = false, $search_terms = false, $populate_extras = true ) {
+	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;
 
-		if ( $limit && $page )
-			$pag_sql = $wpdb->prepare( " LIMIT %d, %d", intval( ( $page - 1 ) * $limit), intval( $limit ) );
+		$sql = array();
 
-		if ( !is_user_logged_in() || ( !is_super_admin() && ( $user_id != $bp->loggedin_user->id ) ) )
-			$hidden_sql = "AND g.status != 'hidden'";
+		$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,";
 
-		if ( $search_terms ) {
-			$search_terms = like_escape( $wpdb->escape( $search_terms ) );
-			$search_sql = " AND ( g.name LIKE '%%{$search_terms}%%' OR g.description LIKE '%%{$search_terms}%%' )";
-		}
+		if ( !empty( $user_id ) )
+			$sql['members_from'] = " {$bp->groups->table_name_members} m,";
 
-		if ( $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 ORDER BY g.date_created DESC {$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" );
-		} else {
-			$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' {$hidden_sql} {$search_sql} ORDER BY g.date_created DESC {$pag_sql}" );
-			$total_groups = $wpdb->get_var( "SELECT COUNT(DISTINCT g.id) FROM {$bp->groups->table_name_groupmeta} gm INNER JOIN {$bp->groups->table_name} g ON gm.group_id = g.id WHERE gm.meta_key = 'last_activity'{$hidden_sql} {$search_sql}" );
-		}
+		$sql['group_from'] = " {$bp->groups->table_name} g WHERE";
 
-		if ( !empty( $populate_extras ) ) {
-			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' );
-		}
+		if ( !empty( $user_id ) )
+			$sql['user_where'] = " g.id = m.group_id AND";
 
-		return array( 'groups' => $paged_groups, 'total' => $total_groups );
-	}
+		$sql['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'";
 
-	function get_active( $limit = null, $page = null, $user_id = false, $search_terms = false, $populate_extras = true ) {
-		global $wpdb, $bp;
-
-		if ( $limit && $page )
-			$pag_sql = $wpdb->prepare( " LIMIT %d, %d", intval( ( $page - 1 ) * $limit), intval( $limit ) );
+		if ( empty( $show_hidden ) )
+			$sql['hidden'] = " AND g.status != 'hidden'";
 
-		if ( !is_user_logged_in() || ( !is_super_admin() && ( $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}%%' )";
+			$sql['search'] = " AND ( g.name LIKE '%%{$search_terms}%%' OR g.description LIKE '%%{$search_terms}%%' )";
 		}
 
-		if ( $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 ORDER BY last_activity DESC {$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" );
-		} else {
-			$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' {$hidden_sql} {$search_sql} ORDER BY last_activity DESC {$pag_sql}" );
-			$total_groups = $wpdb->get_var( "SELECT COUNT(DISTINCT g.id) FROM {$bp->groups->table_name_groupmeta} gm INNER JOIN {$bp->groups->table_name} g ON gm.group_id = g.id WHERE gm.meta_key = 'last_activity'{$hidden_sql} {$search_sql}" );
-		}
-
-		if ( !empty( $populate_extras ) ) {
-			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' );
-		}
-
-		return array( 'groups' => $paged_groups, 'total' => $total_groups );
-	}
+		if ( !empty( $user_id ) )
+			$sql['user'] = $wpdb->prepare( " AND m.user_id = %d AND m.is_confirmed = 1 AND m.is_banned = 0", $user_id );
 
-	function get_popular( $limit = null, $page = null, $user_id = false, $search_terms = false, $populate_extras = true ) {
-		global $wpdb, $bp;
+		if ( !empty( $include ) ) {
+			if ( is_array( $include ) )
+				$include = implode( ',', $include );
 
-		if ( $limit && $page ) {
-			$pag_sql = $wpdb->prepare( " LIMIT %d, %d", intval( ( $page - 1 ) * $limit), intval( $limit ) );
+			$include = $wpdb->escape( $include );
+			$sql['include'] = " AND g.id IN ({$include})";
 		}
 
-		if ( !is_user_logged_in() || ( !is_super_admin() && ( $user_id != $bp->loggedin_user->id ) ) )
-			$hidden_sql = "AND g.status != 'hidden'";
+		if ( !empty( $exclude ) ) {
+			if ( is_array( $exclude ) )
+				$exclude = implode( ',', $exclude );
 
-		if ( $search_terms ) {
-			$search_terms = like_escape( $wpdb->escape( $search_terms ) );
-			$search_sql = " AND ( g.name LIKE '%%{$search_terms}%%' OR g.description LIKE '%%{$search_terms}%%' )";
+			$exclude = $wpdb->escape( $exclude );
+			$sql['exclude'] = " AND g.id NOT IN ({$exclude})";
 		}
 
-		if ( $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 ORDER BY CONVERT(gm1.meta_value, SIGNED) DESC {$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" );
-		} else {
-			$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' {$hidden_sql} {$search_sql} ORDER BY CONVERT(gm1.meta_value, SIGNED) 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} 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' {$hidden_sql} {$search_sql}" );
+		switch ( $type ) {
+			case 'newest': default:
+				$sql['order'] = " ORDER BY g.date_created DESC";
+				break;
+			case 'active':
+				$sql[] = "ORDER BY last_activity DESC";
+				break;
+			case 'popular':
+				$sql[] = "ORDER BY CONVERT(gm1.meta_value, SIGNED) DESC";
+				break;
+			case 'alphabetical':
+				$sql[] = "ORDER BY g.name ASC";
+				break;
+			case 'random':
+				$sql[] = "ORDER BY rand()";
+				break;
 		}
 
-		if ( !empty( $populate_extras ) ) {
-			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' );
-		}
+		if ( $per_page && $page )
+			$sql['pagination'] = $wpdb->prepare( "LIMIT %d, %d", intval( ( $page - 1 ) * $per_page), intval( $per_page ) );
 
-		return array( 'groups' => $paged_groups, 'total' => $total_groups );
-	}
+		/* 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 );
 
-	function get_alphabetically( $limit = null, $page = null, $user_id = false, $search_terms = false, $populate_extras = true ) {
-		global $wpdb, $bp;
+		$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";
 
-		if ( $limit && $page )
-			$pag_sql = $wpdb->prepare( " LIMIT %d, %d", intval( ( $page - 1 ) * $limit), intval( $limit ) );
+		if ( !empty( $user_id ) )
+			$total_sql['select'] .= ", {$bp->groups->table_name_members} m";
 
-		if ( !is_user_logged_in() || ( !is_super_admin() && ( $user_id != $bp->loggedin_user->id ) ) )
-			$hidden_sql = " AND g.status != 'hidden'";
+		if ( !empty( $sql['hidden'] ) )
+			$total_sql['where'][] = "g.status != 'hidden'";
 
-		if ( $search_terms ) {
-			$search_terms = like_escape( $wpdb->escape( $search_terms ) );
-			$search_sql = " AND ( g.name LIKE '%%{$search_terms}%%' OR g.description LIKE '%%{$search_terms}%%' )";
-		}
+		if ( !empty( $sql['search'] ) )
+			$total_sql['where'][] = "( g.name LIKE '%%{$search_terms}%%' OR g.description LIKE '%%{$search_terms}%%' )";
 
-		if ( $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 ORDER BY g.name ASC {$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" );
-		} else {
-			$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' {$hidden_sql} {$search_sql} ORDER BY g.name ASC {$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} 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' {$hidden_sql} {$search_sql}" );
+		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})";
 		}
 
+		$total_sql['where'][] = "g.id = gm1.group_id";
+		$total_sql['where'][] = "g.id = gm2.group_id";
+		$total_sql['where'][] = "gm2.meta_key = 'last_activity'";
+
+		$t_sql = $total_sql['select'];
+
+		if ( !empty( $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 );
+		$total_groups     = $wpdb->get_var( $total_groups_sql );
+
+		/* 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 ) );
-			$paged_groups = BP_Groups_Group::get_group_extras( &$paged_groups, $group_ids, 'newest' );
+			$paged_groups = BP_Groups_Group::get_group_extras( $paged_groups, $group_ids, $type );
 		}
 
+		unset( $sql, $total_sql );
+
 		return array( 'groups' => $paged_groups, 'total' => $total_groups );
 	}
 
-	function get_by_most_forum_topics( $limit = null, $page = null, $user_id = false, $search_terms = false, $populate_extras = true ) {
+	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 )
@@ -399,30 +389,35 @@ Class BP_Groups_Group {
 		if ( !is_user_logged_in() || ( !is_super_admin() && ( $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}%%' )";
 		}
 
+		if ( !empty( $exclude ) ) {
+			$exclude = $wpdb->escape( $exclude );
+			$exclude_sql = " AND g.id NOT IN ({$exclude})";
+		}
+
 		if ( $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 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" );
+			$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}" );
 		} else {
-			$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, {$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} 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}" );
+			$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, {$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} {$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} {$exclude_sql}" );
 		}
 
 		if ( !empty( $populate_extras ) ) {
 			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' );
+			$paged_groups = BP_Groups_Group::get_group_extras( $paged_groups, $group_ids, 'newest' );
 		}
 
 		return array( 'groups' => $paged_groups, 'total' => $total_groups );
 	}
 
-	function get_by_most_forum_posts( $limit = null, $page = null, $search_terms = false, $populate_extras = true ) {
+	function get_by_most_forum_posts( $limit = null, $page = null, $search_terms = false, $populate_extras = true, $exclude = false ) {
 		global $wpdb, $bp, $bbdb;
 
 		if ( !$bbdb )
@@ -440,69 +435,30 @@ Class BP_Groups_Group {
 			$search_sql = " AND ( g.name LIKE '%%{$search_terms}%%' OR g.description LIKE '%%{$search_terms}%%' )";
 		}
 
+		if ( !empty( $exclude ) ) {
+			$exclude = $wpdb->escape( $exclude );
+			$exclude_sql = " AND g.id NOT IN ({$exclude})";
+		}
+
 		if ( $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 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" );
+			$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} " );
 		} else {
-			$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, {$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.posts > 0 {$hidden_sql} {$search_sql} ORDER BY f.posts ASC {$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) {$hidden_sql} {$search_sql}" );
+			$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, {$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.posts > 0 {$hidden_sql} {$search_sql} {$exclude_sql} ORDER BY f.posts ASC {$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) {$hidden_sql} {$search_sql} {$exclude_sql}" );
 		}
 
 		if ( !empty( $populate_extras ) ) {
 			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' );
+			$paged_groups = BP_Groups_Group::get_group_extras( $paged_groups, $group_ids, 'newest' );
 		}
 
 		return array( 'groups' => $paged_groups, 'total' => $total_groups );
 	}
 
-	function get_all( $limit = null, $page = null, $only_public = true, $sort_by = false, $order = false ) {
-		global $wpdb, $bp;
-
-		// Default sql WHERE conditions are blank. TODO: generic handler function.
-		$where_sql = null;
-		$where_conditions = array();
-
-		// Limit results to public status
-		if ( $only_public )
-			$where_conditions[] = $wpdb->prepare( "g.status = 'public'" );
-
-		if ( !is_super_admin() )
-			$where_conditions[] = $wpdb->prepare( "g.status != 'hidden'");
-
-		// Build where sql statement if necessary
-		if ( !empty( $where_conditions ) )
-			$where_sql = 'WHERE ' . join( ' AND ', $where_conditions );
-
-		if ( $limit && $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 );
-			$order_sql = "ORDER BY g.$sort_by $order";
-
-			switch ( $sort_by ) {
-				default:
-					$sql = $wpdb->prepare( "SELECT * FROM {$bp->groups->table_name} g {$where_sql} {$order_sql} {$pag_sql}" );
-					break;
-				case 'members':
-					$sql = $wpdb->prepare( "SELECT * FROM {$bp->groups->table_name} g, {$bp->groups->table_name_groupmeta} gm WHERE g.id = gm.group_id AND gm.meta_key = 'total_member_count' {$hidden_sql} {$public_sql} ORDER BY CONVERT(gm.meta_value, SIGNED) {$order} {$pag_sql}" );
-					break;
-				case 'last_active':
-					$sql = $wpdb->prepare( "SELECT * FROM {$bp->groups->table_name} g, {$bp->groups->table_name_groupmeta} gm WHERE g.id = gm.group_id AND gm.meta_key = 'last_activity' {$hidden_sql} {$public_sql} ORDER BY CONVERT(gm.meta_value, SIGNED) {$order} {$pag_sql}" );
-					break;
-			}
-		} else {
-			$sql = $wpdb->prepare( "SELECT * FROM {$bp->groups->table_name} g {$where_sql} {$order_sql} {$pag_sql}" );
-		}
-
-		return $wpdb->get_results($sql);
-	}
-
-	function get_by_letter( $letter, $limit = null, $page = null, $populate_extras = true ) {
+	function get_by_letter( $letter, $limit = null, $page = null, $populate_extras = true, $exclude = false ) {
 		global $wpdb, $bp;
 
 		// Multibyte compliance
@@ -516,6 +472,11 @@ Class BP_Groups_Group {
 			}
 		}
 
+		if ( !empty( $exclude ) ) {
+			$exclude = $wpdb->escape( $exclude );
+			$exclude_sql = " AND g.id NOT IN ({$exclude})";
+		}
+
 		if ( !is_super_admin() )
 			$hidden_sql = $wpdb->prepare( " AND status != 'hidden'");
 
@@ -523,21 +484,21 @@ Class BP_Groups_Group {
 
 		if ( $limit && $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}" ) );
+			$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}" ) );
 		}
 
-		$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} ORDER BY g.name ASC {$pag_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}"  ) );
 
 		if ( !empty( $populate_extras ) ) {
 			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' );
+			$paged_groups = BP_Groups_Group::get_group_extras( $paged_groups, $group_ids, 'newest' );
 		}
 
 		return array( 'groups' => $paged_groups, 'total' => $total_groups );
 	}
 
-	function get_random( $limit = null, $page = null, $user_id = false, $search_terms = false, $populate_extras = true ) {
+	function get_random( $limit = null, $page = null, $user_id = 0, $search_terms = false, $populate_extras = true, $exclude = false ) {
 		global $wpdb, $bp;
 
 		if ( $limit && $page )
@@ -551,25 +512,30 @@ Class BP_Groups_Group {
 			$search_sql = " AND ( g.name LIKE '%%{$search_terms}%%' OR g.description LIKE '%%{$search_terms}%%' )";
 		}
 
+		if ( !empty( $exclude ) ) {
+			$exclude = $wpdb->escape( $exclude );
+			$exclude_sql = " AND g.id NOT IN ({$exclude})";
+		}
+
 		if ( $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 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" );
+			$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}" );
 		} else {
-			$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' {$hidden_sql} {$search_sql} ORDER BY rand() {$pag_sql}" );
-			$total_groups = $wpdb->get_var( "SELECT COUNT(DISTINCT g.id) FROM {$bp->groups->table_name_groupmeta} gm INNER JOIN {$bp->groups->table_name} g ON gm.group_id = g.id WHERE gm.meta_key = 'last_activity'{$hidden_sql} {$search_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' {$hidden_sql} {$search_sql} {$exclude_sql} ORDER BY rand() {$pag_sql}" );
+			$total_groups = $wpdb->get_var( "SELECT COUNT(DISTINCT g.id) FROM {$bp->groups->table_name_groupmeta} gm INNER JOIN {$bp->groups->table_name} g ON gm.group_id = g.id WHERE gm.meta_key = 'last_activity'{$hidden_sql} {$search_sql} {$exclude_sql}" );
 		}
 
 		if ( !empty( $populate_extras ) ) {
 			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' );
+			$paged_groups = BP_Groups_Group::get_group_extras( $paged_groups, $group_ids, 'newest' );
 		}
 
 		return array( 'groups' => $paged_groups, 'total' => $total_groups );
 	}
 
-	function get_group_extras( $paged_groups, $group_ids, $type = false ) {
+	function get_group_extras( &$paged_groups, &$group_ids, $type = false ) {
 		global $bp, $wpdb;
 
 		if ( empty( $group_ids ) )
@@ -577,7 +543,9 @@ Class BP_Groups_Group {
 
 		/* 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; $i < count( $paged_groups ); $i++ ) {
+		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 )
 					$paged_groups[$i]->is_member = true;
@@ -585,7 +553,9 @@ Class BP_Groups_Group {
 		}
 
 		$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; $i < count( $paged_groups ); $i++ ) {
+		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 )
 					$paged_groups[$i]->is_banned = true;
@@ -604,6 +574,7 @@ Class BP_Groups_Group {
 	function get_total_group_count() {
 		global $wpdb, $bp;
 
+		$hidden_sql = '';
 		if ( !is_super_admin() )
 			$hidden_sql = "WHERE status != 'hidden'";
 
@@ -626,6 +597,54 @@ 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
+	 *
+	 * @param str $status 'public', 'private', 'hidden', 'all' Which group types to count
+	 * @return int The topic count
+	 */
+	function get_global_topic_count( $status = 'public', $search_terms = false ) {
+		global $bbdb, $wpdb, $bp;
+
+		switch ( $status ) {
+			case 'all' :
+				$status_sql = '';
+				break;
+
+			case 'hidden' :
+				$status_sql = $wpdb->prepare( "AND g.status = 'hidden'" );
+				break;
+
+			case 'private' :
+				$status_sql = $wpdb->prepare( "AND g.status = 'private'" );
+				break;
+
+			case 'public' :
+			default :
+				$status_sql = $wpdb->prepare( "AND g.status = 'public'" );
+				break;
+		}
+
+		$sql = array();
+
+		$sql['select'] = "SELECT COUNT(t.topic_id)";
+
+		$sql['from'] = "FROM {$bbdb->topics} AS t INNER JOIN {$bp->groups->table_name_groupmeta} AS gm ON t.forum_id = gm.meta_value INNER JOIN {$bp->groups->table_name} AS g ON gm.group_id = g.id";
+
+		$sql['where'] = "WHERE gm.meta_key = 'forum_id' {$status_sql} AND t.topic_status = '0' AND t.topic_sticky != '2'";
+
+		if ( $search_terms ) {
+			$st = like_escape( $search_terms );
+			$sql['where'] .= " AND (  t.topic_title LIKE '%{$st}%' )";
+		}
+
+		return $wpdb->get_var( implode( ' ', $sql ) );
+	}
 }
 
 Class BP_Groups_Member {
@@ -644,7 +663,11 @@ Class BP_Groups_Member {
 
 	var $user;
 
-	function bp_groups_member( $user_id = false, $group_id = false, $id = false, $populate = true ) {
+	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;
 			$this->group_id = $group_id;
@@ -673,18 +696,18 @@ Class BP_Groups_Member {
 		$member = $wpdb->get_row($sql);
 
 		if ( $member ) {
-			$this->id = $member->id;
-			$this->group_id = $member->group_id;
-			$this->user_id = $member->user_id;
-			$this->inviter_id = $member->inviter_id;
-			$this->is_admin = $member->is_admin;
-			$this->is_mod = $member->is_mod;
-			$this->is_banned = $member->is_banned;
-			$this->user_title = $member->user_title;
+			$this->id            = $member->id;
+			$this->group_id      = $member->group_id;
+			$this->user_id       = $member->user_id;
+			$this->inviter_id    = $member->inviter_id;
+			$this->is_admin      = $member->is_admin;
+			$this->is_mod        = $member->is_mod;
+			$this->is_banned     = $member->is_banned;
+			$this->user_title    = $member->user_title;
 			$this->date_modified = $member->date_modified;
-			$this->is_confirmed = $member->is_confirmed;
-			$this->comments = $member->comments;
-			$this->invite_sent = $member->invite_sent;
+			$this->is_confirmed  = $member->is_confirmed;
+			$this->comments      = $member->comments;
+			$this->invite_sent   = $member->invite_sent;
 
 			$this->user = new BP_Core_User( $this->user_id );
 		}
@@ -693,32 +716,31 @@ Class BP_Groups_Member {
 	function save() {
 		global $wpdb, $bp;
 
-		$this->user_id = apply_filters( 'groups_member_user_id_before_save', $this->user_id, $this->id );
-		$this->group_id = apply_filters( 'groups_member_group_id_before_save', $this->group_id, $this->id );
-		$this->inviter_id = apply_filters( 'groups_member_inviter_id_before_save', $this->inviter_id, $this->id );
-		$this->is_admin = apply_filters( 'groups_member_is_admin_before_save', $this->is_admin, $this->id );
-		$this->is_mod = apply_filters( 'groups_member_is_mod_before_save', $this->is_mod, $this->id );
-		$this->is_banned = apply_filters( 'groups_member_is_banned_before_save', $this->is_banned, $this->id );
-		$this->user_title = apply_filters( 'groups_member_user_title_before_save', $this->user_title, $this->id );
+		$this->user_id       = apply_filters( 'groups_member_user_id_before_save',       $this->user_id,       $this->id );
+		$this->group_id      = apply_filters( 'groups_member_group_id_before_save',      $this->group_id,      $this->id );
+		$this->inviter_id    = apply_filters( 'groups_member_inviter_id_before_save',    $this->inviter_id,    $this->id );
+		$this->is_admin      = apply_filters( 'groups_member_is_admin_before_save',      $this->is_admin,      $this->id );
+		$this->is_mod        = apply_filters( 'groups_member_is_mod_before_save',        $this->is_mod,        $this->id );
+		$this->is_banned     = apply_filters( 'groups_member_is_banned_before_save',     $this->is_banned,     $this->id );
+		$this->user_title    = apply_filters( 'groups_member_user_title_before_save',    $this->user_title,    $this->id );
 		$this->date_modified = apply_filters( 'groups_member_date_modified_before_save', $this->date_modified, $this->id );
-		$this->is_confirmed = apply_filters( 'groups_member_is_confirmed_before_save', $this->is_confirmed, $this->id );
-		$this->comments = apply_filters( 'groups_member_comments_before_save', $this->comments, $this->id );
-		$this->invite_sent = apply_filters( 'groups_member_invite_sent_before_save', $this->invite_sent, $this->id );
+		$this->is_confirmed  = apply_filters( 'groups_member_is_confirmed_before_save',  $this->is_confirmed,  $this->id );
+		$this->comments      = apply_filters( 'groups_member_comments_before_save',      $this->comments,      $this->id );
+		$this->invite_sent   = apply_filters( 'groups_member_invite_sent_before_save',   $this->invite_sent,   $this->id );
 
-		do_action( 'groups_member_before_save', $this );
+		do_action_ref_array( 'groups_member_before_save', array( &$this ) );
 
-		if ( $this->id ) {
+		if ( $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
 			$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) )
 			return false;
 
 		$this->id = $wpdb->insert_id;
 
-		do_action( 'groups_member_after_save', $this );
+		do_action_ref_array( 'groups_member_after_save', array( &$this ) );
 
 		return true;
 	}
@@ -748,6 +770,8 @@ Class BP_Groups_Member {
 	}
 
 	function ban() {
+		global $bp;
+
 		if ( $this->is_admin )
 			return false;
 
@@ -756,38 +780,44 @@ Class BP_Groups_Member {
 
 		groups_update_groupmeta( $this->group_id, 'total_member_count', ( (int) groups_get_groupmeta( $this->group_id, 'total_member_count' ) - 1 ) );
 
-		$group_count = get_user_meta( $this->user_id, 'total_group_count', true );
+		$group_count = bp_get_user_meta( $this->user_id, 'total_group_count', true );
 		if ( !empty( $group_count ) )
-			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 )
 			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 ) );
-		update_user_meta( $this->user_id, 'total_group_count', (int)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();
 
-		update_user_meta( $this->user_id, 'total_group_count', (int)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();
 
-		update_user_meta( $this->user_id, 'total_group_count', (int)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() {
@@ -800,9 +830,9 @@ Class BP_Groups_Member {
 
 		groups_update_groupmeta( $this->group_id, 'total_member_count', ( (int) groups_get_groupmeta( $this->group_id, 'total_member_count' ) - 1 ) );
 
-		$group_count = get_user_meta( $this->user_id, 'total_group_count', true );
+		$group_count = bp_get_user_meta( $this->user_id, 'total_group_count', true );
 		if ( !empty( $group_count ) )
-			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;
 	}
@@ -818,6 +848,7 @@ Class BP_Groups_Member {
 	function get_group_ids( $user_id, $limit = false, $page = false ) {
 		global $wpdb, $bp;
 
+		$pag_sql = '';
 		if ( $limit && $page )
 			$pag_sql = $wpdb->prepare( " LIMIT %d, %d", intval( ( $page - 1 ) * $limit), intval( $limit ) );
 
@@ -838,6 +869,8 @@ Class BP_Groups_Member {
 	function get_recently_joined( $user_id, $limit = false, $page = false, $filter = false ) {
 		global $wpdb, $bp;
 
+		$pag_sql = $hidden_sql = $filter_sql = '';
+
 		if ( $limit && $page )
 			$pag_sql = $wpdb->prepare( " LIMIT %d, %d", intval( ( $page - 1 ) * $limit), intval( $limit ) );
 
@@ -858,6 +891,8 @@ Class BP_Groups_Member {
 	function get_is_admin_of( $user_id, $limit = false, $page = false, $filter = false ) {
 		global $wpdb, $bp;
 
+		$pag_sql = $hidden_sql = $filter_sql = '';
+
 		if ( $limit && $page )
 			$pag_sql = $wpdb->prepare( " LIMIT %d, %d", intval( ( $page - 1 ) * $limit), intval( $limit ) );
 
@@ -878,6 +913,8 @@ Class BP_Groups_Member {
 	function get_is_mod_of( $user_id, $limit = false, $page = false, $filter = false ) {
 		global $wpdb, $bp;
 
+		$pag_sql = $hidden_sql = $filter_sql = '';
+
 		if ( $limit && $page )
 			$pag_sql = $wpdb->prepare( " LIMIT %d, %d", intval( ( $page - 1 ) * $limit), intval( $limit ) );
 
@@ -895,7 +932,7 @@ Class BP_Groups_Member {
 		return array( 'groups' => $paged_groups, 'total' => $total_groups );
 	}
 
-	function total_group_count( $user_id = false ) {
+	function total_group_count( $user_id = 0 ) {
 		global $bp, $wpdb;
 
 		if ( !$user_id )
@@ -908,25 +945,31 @@ Class BP_Groups_Member {
 		}
 	}
 
-	function get_invites( $user_id, $limit = false, $page = false ) {
+	function get_invites( $user_id, $limit = false, $page = false, $exclude = false ) {
 		global $wpdb, $bp;
 
-		if ( $limit && $page )
-			$pag_sql = $wpdb->prepare( " LIMIT %d, %d", intval( ( $page - 1 ) * $limit), intval( $limit ) );
+		$pag_sql = ( !empty( $limit ) && !empty( $page ) ) ? $wpdb->prepare( " LIMIT %d, %d", intval( ( $page - 1 ) * $limit), intval( $limit ) ) : '';
+
+		$exclude_sql = !empty( $exclude ) ? $wpdb->prepare( " AND g.id NOT IN (%s)", $exclude ) : '';
 
-		$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' AND m.is_confirmed = 0 AND m.inviter_id != 0 AND m.invite_sent = 1 AND m.user_id = %d ORDER BY m.date_modified ASC {$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 m.group_id = g.id AND m.is_confirmed = 0 AND m.inviter_id != 0 AND m.invite_sent = 1 AND m.user_id = %d ORDER BY date_modified ASC", $user_id ) );
+		$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' AND m.is_confirmed = 0 AND m.inviter_id != 0 AND m.invite_sent = 1 AND m.user_id = %d {$exclude_sql} ORDER BY m.date_modified ASC {$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 m.group_id = g.id AND m.is_confirmed = 0 AND m.inviter_id != 0 AND m.invite_sent = 1 AND m.user_id = %d {$exclude_sql} ORDER BY date_modified ASC", $user_id ) );
 
 		return array( 'groups' => $paged_groups, 'total' => $total_groups );
 	}
 
-	function check_has_invite( $user_id, $group_id ) {
+	function check_has_invite( $user_id, $group_id, $type = 'sent' ) {
 		global $wpdb, $bp;
 
 		if ( !$user_id )
 			return false;
 
-		return $wpdb->get_var( $wpdb->prepare( "SELECT id 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 ) );
+		$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";
+
+		if ( 'sent' == $type )
+			$sql .= " AND invite_sent = 1";
+
+		return $wpdb->get_var( $wpdb->prepare( $sql, $user_id, $group_id ) );
 	}
 
 	function delete_invite( $user_id, $group_id ) {
@@ -1045,38 +1088,45 @@ Class BP_Groups_Member {
 		return $wpdb->get_col( $wpdb->prepare( "SELECT user_id FROM {$bp->groups->table_name_members} WHERE group_id = %d AND is_confirmed = 0 AND inviter_id = 0", $group_id ) );
 	}
 
-	function get_all_for_group( $group_id, $limit = false, $page = false, $exclude_admins_mods = true, $exclude_banned = true ) {
+	function get_all_for_group( $group_id, $limit = false, $page = false, $exclude_admins_mods = true, $exclude_banned = true, $exclude = false ) {
 		global $bp, $wpdb;
 
+		$pag_sql = '';
 		if ( $limit && $page )
 			$pag_sql = $wpdb->prepare( "LIMIT %d, %d", intval( ( $page - 1 ) * $limit), intval( $limit ) );
 
+		$exclude_admins_sql = '';
 		if ( $exclude_admins_mods )
-			$exclude_sql = $wpdb->prepare( "AND is_admin = 0 AND is_mod = 0" );
+			$exclude_admins_sql = $wpdb->prepare( "AND is_admin = 0 AND is_mod = 0" );
 
+		$banned_sql = '';
 		if ( $exclude_banned )
 			$banned_sql = $wpdb->prepare( " AND is_banned = 0" );
 
+		$exclude_sql = '';
+		if ( $exclude )
+			$exclude_sql = $wpdb->prepare( " AND m.user_id NOT IN ({$exclude})" );
+
 		if ( bp_is_active( 'xprofile' ) )
-			$members = $wpdb->get_results( $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_sql} ORDER BY m.date_modified DESC {$pag_sql}", $group_id ) );
+			$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( $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_sql} ORDER BY m.date_modified DESC {$pag_sql}", $group_id ) );
+			$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 )
 			return false;
 
-		if ( !isset($pag_sql) )
-			$total_member_count = count($members);
+		if ( empty( $pag_sql ) )
+			$total_member_count = count( $members );
 		else
-			$total_member_count = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(user_id) FROM {$bp->groups->table_name_members} WHERE group_id = %d AND is_confirmed = 1 {$banned_sql} {$exclude_sql}", $group_id ) );
+			$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 ) );
 
-		if ( function_exists( 'friends_install' ) ) {
+		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 ) );
-			for ( $i = 0; $i < count( $members ); $i++ ) {
+			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 )
 						$members[$i]->is_friend = $status->is_confirmed;
@@ -1154,36 +1204,24 @@ class BP_Group_Extension {
 
 	// Methods you should override
 
-	function display() {
-		die( 'function BP_Group_Extension::display() must be over-ridden in a sub-class.' );
-	}
+	function display() {}
 
-	function widget_display() {
-		die( 'function BP_Group_Extension::widget_display() must be over-ridden in a sub-class.' );
-	}
+	function widget_display() {}
 
-	function edit_screen() {
-		die( 'function BP_Group_Extension::edit_screen() must be over-ridden in a sub-class.' );
-	}
+	function edit_screen() {}
 
-	function edit_screen_save() {
-		die( 'function BP_Group_Extension::edit_screen_save() must be over-ridden in a sub-class.' );
-	}
+	function edit_screen_save() {}
 
-	function create_screen() {
-		die( 'function BP_Group_Extension::create_screen() must be over-ridden in a sub-class.' );
-	}
+	function create_screen() {}
 
-	function create_screen_save() {
-		die( 'function BP_Group_Extension::create_screen_save() must be over-ridden in a sub-class.' );
-	}
+	function create_screen_save() {}
 
 	// Private Methods
 
 	function _register() {
 		global $bp;
 
-		if ( $this->enable_create_step ) {
+		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 );
 
@@ -1194,13 +1232,34 @@ class BP_Group_Extension {
 			add_action( 'groups_create_group_step_save_' . $this->slug, array( &$this, 'create_screen_save' ) );
 		}
 
+		// When we are viewing a single group, add the group extension nav item
+		if ( bp_is_group() ) {
+			if ( $this->visibility == 'public' || ( $this->visibility != 'public' && $bp->groups->current_group->user_has_access ) ) {
+				if ( $this->enable_nav_item ) {
+					bp_core_new_subnav_item( array( 'name' => ( !$this->nav_item_name ) ? $this->name : $this->nav_item_name, 'slug' => $this->slug, 'parent_slug' => $bp->groups->current_group->slug, 'parent_url' => bp_get_group_permalink( $bp->groups->current_group ), 'position' => $this->nav_item_position, 'item_css_id' => 'nav-' . $this->slug, 'screen_function' => array( &$this, '_display_hook' ), 'user_has_access' => $this->enable_nav_item ) );
+
+					// When we are viewing the extension display page, set the title and options title
+					if ( bp_is_current_action( $this->slug ) ) {
+						add_action( 'bp_template_content_header', create_function( '', 'echo "' . esc_attr( $this->name ) . '";' ) );
+						add_action( 'bp_template_title', create_function( '', 'echo "' . esc_attr( $this->name ) . '";' ) );
+					}
+				}
+
+				// Hook the group home widget
+				if ( !bp_current_action() && bp_is_current_action( 'home' ) )
+					add_action( $this->display_hook, array( &$this, 'widget_display' ) );
+			}
+		}
+
 		// Construct the admin edit tab for the new group extension
-		if ( $this->enable_edit_item && $bp->is_item_admin ) {
-			add_action( 'groups_admin_tabs', create_function( '$current, $group_slug', 'if ( "' . esc_attr( $this->slug ) . '" == $current ) $selected = " class=\"current\""; echo "<li{$selected}><a href=\"' . $bp->root_domain . '/' . $bp->groups->slug . '/{$group_slug}/admin/' . esc_attr( $this->slug ) . '\">' . esc_attr( $this->name ) . '</a></li>";' ), 10, 2 );
+		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 );
 
 			// Catch the edit screen and forward it to the plugin template
-			if ( $bp->current_component == $bp->groups->slug && 'admin' == $bp->current_action && $this->slug == $bp->action_variables[0] ) {
-				add_action( 'wp', array( &$this, 'edit_screen_save' ) );
+			if ( bp_is_groups_component() && bp_is_current_action( 'admin' ) && bp_is_action_variable( $this->slug, 0 ) ) {
+				// Check whether the user is saving changes
+				$this->edit_screen_save();
+
 				add_action( 'groups_custom_edit_steps', array( &$this, 'edit_screen' ) );
 
 				if ( '' != locate_template( array( 'groups/single/home.php' ), false ) ) {
@@ -1212,24 +1271,6 @@ class BP_Group_Extension {
 				}
 			}
 		}
-
-		// When we are viewing a single group, add the group extension nav item
-		if ( $this->visibility == 'public' || ( $this->visibility != 'public' && $bp->groups->current_group->user_has_access ) ) {
-			if ( $this->enable_nav_item ) {
-				if ( $bp->current_component == $bp->groups->slug && $bp->is_single_item )
-					bp_core_new_subnav_item( array( 'name' => ( !$this->nav_item_name ) ? $this->name : $this->nav_item_name, 'slug' => $this->slug, 'parent_slug' => BP_GROUPS_SLUG, 'parent_url' => bp_get_group_permalink( $bp->groups->current_group ), 'position' => $this->nav_item_position, 'item_css_id' => 'nav-' . $this->slug, 'screen_function' => array( &$this, '_display_hook' ), 'user_has_access' => $this->enable_nav_item ) );
-
-				// When we are viewing the extension display page, set the title and options title
-				if ( $bp->current_component == $bp->groups->slug && $bp->is_single_item && $bp->current_action == $this->slug ) {
-					add_action( 'bp_template_content_header', create_function( '', 'echo "' . esc_attr( $this->name ) . '";' ) );
-			 		add_action( 'bp_template_title', create_function( '', 'echo "' . esc_attr( $this->name ) . '";' ) );
-				}
-			}
-
-			// Hook the group home widget
-			if ( $bp->current_component == $bp->groups->slug && $bp->is_single_item && ( !$bp->current_action || 'home' == $bp->current_action ) )
-				add_action( $this->display_hook, array( &$this, 'widget_display' ) );
-		}
 	}
 
 	function _display_hook() {
@@ -1245,8 +1286,7 @@ function bp_register_group_extension( $group_extension_class ) {
 		return false;
 
 	/* 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( "wp", array( &$extension, "_register" ), 2 );' ), 11 );
+	add_action( 'bp_init', create_function( '', '$extension = new ' . $group_extension_class . '; add_action( "bp_actions", array( &$extension, "_register" ), 8 );' ), 11 );
 }
 
-
-?>
+?>
\ No newline at end of file
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 9c60f3ce4ab140de2e46940dbe5ea084ba7ad050..fdbd32b528d3df2e93e48f10d55c58434fe0784f 100644
--- a/wp-content/plugins/buddypress/bp-groups/bp-groups-filters.php
+++ b/wp-content/plugins/buddypress/bp-groups/bp-groups-filters.php
@@ -1,59 +1,61 @@
 <?php
+// Exit if accessed directly
+if ( !defined( 'ABSPATH' ) ) exit;
 
 /* Apply WordPress defined filters */
-add_filter( 'bp_get_group_description', 'wptexturize' );
+add_filter( 'bp_get_group_description',         'wptexturize' );
 add_filter( 'bp_get_group_description_excerpt', 'wptexturize' );
-add_filter( 'bp_get_group_name', 'wptexturize' );
+add_filter( 'bp_get_group_name',                'wptexturize' );
 
-add_filter( 'bp_get_group_description', 'convert_smilies' );
+add_filter( 'bp_get_group_description',         'convert_smilies' );
 add_filter( 'bp_get_group_description_excerpt', 'convert_smilies' );
 
-add_filter( 'bp_get_group_description', 'convert_chars' );
+add_filter( 'bp_get_group_description',         'convert_chars' );
 add_filter( 'bp_get_group_description_excerpt', 'convert_chars' );
-add_filter( 'bp_get_group_name', 'convert_chars' );
+add_filter( 'bp_get_group_name',                'convert_chars' );
 
-add_filter( 'bp_get_group_description', 'wpautop' );
+add_filter( 'bp_get_group_description',         'wpautop' );
 add_filter( 'bp_get_group_description_excerpt', 'wpautop' );
 
-add_filter( 'bp_get_group_description', 'make_clickable' );
-add_filter( 'bp_get_group_description_excerpt', 'make_clickable' );
+add_filter( 'bp_get_group_description',         'make_clickable', 9 );
+add_filter( 'bp_get_group_description_excerpt', 'make_clickable', 9 );
 
-add_filter( 'bp_get_group_name', 'wp_filter_kses', 1 );
-add_filter( 'bp_get_group_permalink', 'wp_filter_kses', 1 );
-add_filter( 'bp_get_group_description', 'bp_groups_filter_kses', 1 );
-add_filter( 'bp_get_group_description_excerpt', 'wp_filter_kses', 1 );
-add_filter( 'groups_group_name_before_save', 'wp_filter_kses', 1 );
+add_filter( 'bp_get_group_name',                    'wp_filter_kses', 1 );
+add_filter( 'bp_get_group_permalink',               'wp_filter_kses', 1 );
+add_filter( 'bp_get_group_description',             'bp_groups_filter_kses', 1 );
+add_filter( 'bp_get_group_description_excerpt',     'wp_filter_kses', 1 );
+add_filter( 'groups_group_name_before_save',        'wp_filter_kses', 1 );
 add_filter( 'groups_group_description_before_save', 'wp_filter_kses', 1 );
 
-add_filter( 'bp_get_group_description', 'stripslashes' );
+add_filter( 'bp_get_group_description',         'stripslashes' );
 add_filter( 'bp_get_group_description_excerpt', 'stripslashes' );
-add_filter( 'bp_get_group_name', 'stripslashes' );
-add_filter( 'bp_get_group_member_name', 'stripslashes' );
-add_filter( 'bp_get_group_member_link', 'stripslashes' );
+add_filter( 'bp_get_group_name',                'stripslashes' );
+add_filter( 'bp_get_group_member_name',         'stripslashes' );
+add_filter( 'bp_get_group_member_link',         'stripslashes' );
 
 add_filter( 'groups_new_group_forum_desc', 'bp_create_excerpt' );
 
-add_filter( 'groups_group_name_before_save', 'force_balance_tags' );
+add_filter( 'groups_group_name_before_save',        'force_balance_tags' );
 add_filter( 'groups_group_description_before_save', 'force_balance_tags' );
 
-add_filter( 'bp_get_total_group_count', 'bp_core_number_format' );
+add_filter( 'bp_get_total_group_count',      'bp_core_number_format' );
 add_filter( 'bp_get_group_total_for_member', 'bp_core_number_format' );
-add_filter( 'bp_get_group_total_members', 'bp_core_number_format' );
+add_filter( 'bp_get_group_total_members',    'bp_core_number_format' );
 
 function bp_groups_filter_kses( $content ) {
 	global $allowedtags;
 
-	$groups_allowedtags = $allowedtags;
-	$groups_allowedtags['a']['class'] = array();
-	$groups_allowedtags['img'] = array();
-	$groups_allowedtags['img']['src'] = array();
-	$groups_allowedtags['img']['alt'] = array();
-	$groups_allowedtags['img']['class'] = array();
-	$groups_allowedtags['img']['width'] = array();
+	$groups_allowedtags                  = $allowedtags;
+	$groups_allowedtags['a']['class']    = array();
+	$groups_allowedtags['img']           = array();
+	$groups_allowedtags['img']['src']    = array();
+	$groups_allowedtags['img']['alt']    = array();
+	$groups_allowedtags['img']['class']  = array();
+	$groups_allowedtags['img']['width']  = array();
 	$groups_allowedtags['img']['height'] = array();
-	$groups_allowedtags['img']['class'] = array();
-	$groups_allowedtags['img']['id'] = array();
-	$groups_allowedtags['code'] = array();
+	$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 );
@@ -64,29 +66,63 @@ function bp_groups_filter_kses( $content ) {
 function groups_add_forum_privacy_sql() {
 	global $bp;
 
-	/* Only filter the forum SQL on group pages or on the forums directory */
-	if ( ( $bp->groups->current_group && 'public' == $bp->groups->current_group->status ) || !$bp->groups->current_group ) {
-		add_filter( 'get_topics_fields', 'groups_add_forum_fields_sql' );
-		add_filter( 'get_topics_index_hint', 'groups_add_forum_tables_sql' );
-		add_filter( 'get_topics_where', 'groups_add_forum_where_sql' );
-	}
+	// 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( 'bbpress_init', 'groups_add_forum_privacy_sql' );
 
-function groups_add_forum_fields_sql( $sql ) {
-	return $sql . ', g.id as object_id, g.name as object_name, g.slug as object_slug';
+function groups_add_forum_fields_sql( $sql = '' ) {
+	return 't.*, g.id as object_id, g.name as object_name, g.slug as object_slug';
 }
 
-function groups_add_forum_tables_sql( $sql ) {
+function groups_add_forum_tables_sql( $sql = '' ) {
 	global $bp;
-	return ', ' . $bp->groups->table_name . ' AS g LEFT JOIN ' . $bp->groups->table_name_groupmeta . ' AS gm ON g.id = gm.group_id ';
+
+	$sql .= 'JOIN ' . $bp->groups->table_name . ' AS g LEFT JOIN ' . $bp->groups->table_name_groupmeta . ' AS gm ON g.id = gm.group_id ';
+
+	return $sql;
 }
 
-function groups_add_forum_where_sql( $sql ) {
+function groups_add_forum_where_sql( $sql = '' ) {
 	global $bp;
 
-	$bp->groups->filter_sql = ' AND ' . $sql;
-	return "(gm.meta_key = 'forum_id' AND gm.meta_value = t.forum_id) AND g.status = 'public' AND " . $sql;
+	// Set this for groups
+	$parts['groups'] = "(gm.meta_key = 'forum_id' AND gm.meta_value = t.forum_id)";
+
+	// Restrict to public...
+	$parts['private'] = "g.status = 'public'";
+
+	/**
+	 * ...but do some checks to possibly remove public restriction.
+	 *
+	 * Decide if private are visible
+	 */
+	// Are we in our own profile?
+	if ( bp_is_my_profile() )
+		unset( $parts['private'] );
+
+	// Are we a super admin?
+	elseif ( is_super_admin() )
+		unset( $parts['private'] );
+
+	// No need to filter on a single item
+	elseif ( bp_is_single_item() )
+		unset( $parts['private'] );
+
+	// Check the SQL filter that was passed
+	if ( !empty( $sql ) )
+		$parts['passed'] = $sql;
+
+	// Assemble Voltron
+	$parts_string = implode( ' AND ', $parts );
+
+	// Set it to the global filter
+	$bp->groups->filter_sql = $parts_string;
+
+	// Return the global filter
+	return $bp->groups->filter_sql;
 }
 
 function groups_filter_bbpress_caps( $value, $cap, $args ) {
@@ -105,4 +141,15 @@ function groups_filter_bbpress_caps( $value, $cap, $args ) {
 }
 add_filter( 'bb_current_user_can', 'groups_filter_bbpress_caps', 10, 3 );
 
+/**
+ * Amends the forum directory's "last active" bbPress SQL query to stop it fetching
+ * information we aren't going to use. This speeds up the query.
+ *
+ * @see BB_Query::_filter_sql()
+ * @since 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
new file mode 100644
index 0000000000000000000000000000000000000000..082d9e35ca0abd26df313bfc5a1ceb42fce05865
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-groups/bp-groups-forums.php
@@ -0,0 +1,291 @@
+<?php
+/*** Group Forums **************************************************************/
+
+// Exit if accessed directly
+if ( !defined( 'ABSPATH' ) ) exit;
+
+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;
+
+	if ( empty( $group_name ) )
+		$group_name = $bp->groups->current_group->name;
+
+	if ( empty( $group_desc ) )
+		$group_desc = $bp->groups->current_group->description;
+
+	$forum_id = bp_forums_new_forum( array( 'forum_name' => $group_name, 'forum_desc' => $group_desc ) );
+
+	groups_update_groupmeta( $group_id, 'forum_id', $forum_id );
+
+	do_action( 'groups_new_group_forum', $forum_id, $group_id );
+}
+
+/**
+ * Updates group forum metadata (title, description, slug) when the group's details are edited
+ *
+ * @package BuddyPress
+ * @subpackage Groups
+ *
+ * @param int $group_id Group id, passed from groups_details_updated
+ */
+function groups_update_group_forum( $group_id ) {
+
+	$group = new BP_Groups_Group( $group_id );
+
+	/**
+	 * Bail in the following three situations:
+	 *  1. Forums are not enabled for this group
+	 *  2. The BP Forum component is not enabled
+	 *  3. The built-in bbPress forums are not correctly installed (usually means they've been
+	 *     uninstalled)
+	 */
+	if ( empty( $group->enable_forum ) || !bp_is_active( 'forums' ) || ( function_exists( 'bp_forums_is_installed_correctly' ) && !bp_forums_is_installed_correctly() ) )
+		return false;
+
+	$args = array(
+		'forum_id'      => groups_get_groupmeta( $group_id, 'forum_id' ),
+		'forum_name'    => $group->name,
+		'forum_desc'    => $group->description,
+		'forum_slug'    => $group->slug
+	);
+
+	bp_forums_update_forum( apply_filters( 'groups_update_group_forum', $args ) );
+}
+add_action( 'groups_details_updated', 'groups_update_group_forum' );
+
+function groups_new_group_forum_post( $post_text, $topic_id, $page = false ) {
+	global $bp;
+
+	if ( empty( $post_text ) )
+		return false;
+
+	$post_text = apply_filters( 'group_forum_post_text_before_save', $post_text );
+	$topic_id  = apply_filters( 'group_forum_post_topic_id_before_save', $topic_id );
+
+	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_content = bp_create_excerpt( $post_text );
+		$primary_link = bp_get_group_permalink( $bp->groups->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 ) ),
+			'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,
+			'secondary_item_id' => $post_id
+		) );
+
+		do_action( 'groups_new_forum_topic_post', $bp->groups->current_group->id, $post_id );
+
+		return $post_id;
+	}
+
+	return false;
+}
+
+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;
+
+	$topic_title = apply_filters( 'group_forum_topic_title_before_save', $topic_title );
+	$topic_text  = apply_filters( 'group_forum_topic_text_before_save', $topic_text );
+	$topic_tags  = apply_filters( 'group_forum_topic_tags_before_save', $topic_tags );
+	$forum_id    = apply_filters( 'group_forum_topic_forum_id_before_save', $forum_id );
+
+	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_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 . '/' ),
+			'type'              => 'new_forum_topic',
+			'item_id'           => $bp->groups->current_group->id,
+			'secondary_item_id' => $topic->topic_id
+		) );
+
+	  do_action_ref_array( 'groups_new_forum_topic', array( $bp->groups->current_group->id, &$topic ) );
+
+		return $topic;
+	}
+
+	return false;
+}
+
+function groups_update_group_forum_topic( $topic_id, $topic_title, $topic_text, $topic_tags = false ) {
+	global $bp;
+
+	$topic_title = apply_filters( 'group_forum_topic_title_before_save', $topic_title );
+	$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>' );
+		$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 . '/' ),
+			'type'              => 'new_forum_topic',
+			'item_id'           => (int)$bp->groups->current_group->id,
+			'user_id'           => (int)$topic->topic_poster,
+			'secondary_item_id' => $topic->topic_id,
+			'recorded_time '    => $topic->topic_time
+		) );
+
+		do_action_ref_array( 'groups_update_group_forum_topic', array( &$topic ) );
+
+		return $topic;
+	}
+
+	return false;
+}
+
+function groups_update_group_forum_post( $post_id, $post_text, $topic_id, $page = false ) {
+	global $bp;
+
+	$post_text = apply_filters( 'group_forum_post_text_before_save', $post_text );
+	$topic_id  = apply_filters( 'group_forum_post_topic_id_before_save', $topic_id );
+	$post      = bp_forums_get_post( $post_id );
+
+	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_content = bp_create_excerpt( $post_text );
+		$primary_link = bp_get_group_permalink( $bp->groups->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 ) );
+
+		// 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 ) ),
+			'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,
+			'secondary_item_id' => $post_id,
+			'recorded_time'     => $post->post_time
+		) );
+
+		do_action_ref_array( 'groups_update_group_forum_post', array( $post, &$topic ) );
+
+		return $post_id;
+	}
+
+	return false;
+}
+
+/**
+ * Handles the forum topic deletion routine
+ *
+ * @package BuddyPress
+ *
+ * @uses bp_activity_delete() to delete corresponding activity items
+ * @uses bp_forums_get_topic_posts() to get the child posts
+ * @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
+ */
+function groups_delete_group_forum_topic( $topic_id ) {
+	global $bp;
+
+	// Before deleting the thread, get the post ids so that their activity items can be deleted
+	$posts = bp_forums_get_topic_posts( array( 'topic_id' => $topic_id, 'per_page' => -1 ) );
+
+	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
+		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' ) );
+
+			// 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' ) );
+			}
+		}
+
+		do_action( 'groups_delete_group_forum_topic', $topic_id );
+
+		return true;
+	}
+
+	return false;
+}
+
+/**
+ * Delete a forum post
+ *
+ * @package BuddyPress
+ *
+ * @param int $post_id The id of the post you want to delete
+ * @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.
+ */
+function groups_delete_group_forum_post( $post_id, $topic_id = false ) {
+	global $bp;
+
+	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
+		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' ) );
+
+		do_action( 'groups_delete_group_forum_post', $post_id, $topic_id );
+
+		return true;
+	}
+
+	return false;
+}
+
+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 ) );
+}
+
+/**
+ * Get a total count of all topics of a given status, across groups/forums
+ *
+ * @package BuddyPress
+ * @since 1.5
+ *
+ * @param str $status 'public', 'private', 'hidden', 'all' Which group types to count
+ * @return int The topic count
+ */
+function groups_total_forum_topic_count( $status = 'public', $search_terms = false ) {
+	return apply_filters( 'groups_total_forum_topic_count', BP_Groups_Group::get_global_topic_count( $status, $search_terms ) );
+}
+
+?>
\ No newline at end of file
diff --git a/wp-content/plugins/buddypress/bp-groups/bp-groups-functions.php b/wp-content/plugins/buddypress/bp-groups/bp-groups-functions.php
new file mode 100644
index 0000000000000000000000000000000000000000..2d0b569eac9778f4b3520f92bfa6511e3b65beed
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-groups/bp-groups-functions.php
@@ -0,0 +1,969 @@
+<?php
+/**
+ * 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.
+ */
+
+// Exit if accessed directly
+if ( !defined( 'ABSPATH' ) ) exit;
+
+/**
+ * Checks $bp pages global and looks for directory page
+ *
+ * @since 1.5
+ *
+ * @global object $bp Global BuddyPress settings object
+ * @return bool True if set, False if empty
+ */
+function bp_groups_has_directory() {
+	global $bp;
+
+	return (bool) !empty( $bp->pages->groups->id );
+}
+
+function groups_get_group( $args = '' ) {
+	$defaults = array(
+		'group_id'   => false,
+		'load_users' => false
+	);
+
+	$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 ) );
+}
+
+/*** Group Creation, Editing & Deletion *****************************************/
+
+function groups_create_group( $args = '' ) {
+	global $bp;
+
+	extract( $args );
+
+	/**
+	 * Possible parameters (pass as assoc array):
+	 *	'group_id'
+	 *	'creator_id'
+	 *	'name'
+	 *	'description'
+	 *	'slug'
+	 *	'status'
+	 *	'enable_forum'
+	 *	'date_created'
+	 */
+
+	if ( isset( $group_id ) && $group_id )
+		$group = new BP_Groups_Group( $group_id );
+	else
+		$group = new BP_Groups_Group;
+
+	if ( isset( $creator_id ) && $creator_id )
+		$group->creator_id = $creator_id;
+	else
+		$group->creator_id = $bp->loggedin_user->id;
+
+	if ( isset( $name ) )
+		$group->name = $name;
+
+	if ( isset( $description ) )
+		$group->description = $description;
+
+	if ( isset( $slug ) && groups_check_slug( $slug ) )
+		$group->slug = $slug;
+
+	if ( isset( $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 ) )
+		$group->enable_forum = 1;
+
+	if ( isset( $date_created ) )
+		$group->date_created = $date_created;
+
+	if ( !$group->save() )
+		return false;
+
+	// If this is a new group, set up the creator as the first member and admin
+	if ( empty( $group_id ) ) {
+		$member                = new BP_Groups_Member;
+		$member->group_id      = $group->id;
+		$member->user_id       = $group->creator_id;
+		$member->is_admin      = 1;
+		$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 );
+
+	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->name        = $group_name;
+	$group->description = $group_desc;
+
+	if ( !$group->save() )
+		return false;
+
+	if ( $notify_members ) {
+		groups_notification_group_updated( $group->id );
+	}
+
+	do_action( 'groups_details_updated', $group->id );
+
+	return true;
+}
+
+function groups_edit_group_settings( $group_id, $enable_forum, $status, $invite_status = false ) {
+	global $bp;
+
+	$group = new BP_Groups_Group( $group_id );
+	$group->enable_forum = $enable_forum;
+
+	/***
+	 * Before we potentially switch the group status, if it has been changed to public
+	 * from private and there are outstanding membership requests, auto-accept those requests.
+	 */
+	if ( 'private' == $group->status && 'public' == $status )
+		groups_accept_all_pending_membership_requests( $group->id );
+
+	// Now update the status
+	$group->status = $status;
+
+	if ( !$group->save() )
+		return false;
+
+	// If forums have been enabled, and a forum does not yet exist, we need to create one.
+	if ( $group->enable_forum ) {
+		if ( bp_is_active( 'forums' ) && !groups_get_groupmeta( $group->id, 'forum_id' ) ) {
+			groups_new_group_forum( $group->id, $group->name, $group->description );
+		}
+	}
+
+	// Set the invite status
+	if ( $invite_status )
+		groups_update_groupmeta( $group->id, 'invite_status', $invite_status );
+
+	groups_update_groupmeta( $group->id, 'last_activity', bp_core_current_time() );
+	do_action( 'groups_settings_updated', $group->id );
+
+	return true;
+}
+
+/**
+ * Delete a group and all of its associated meta
+ *
+ * @global object $bp BuddyPress global settings
+ * @param int $group_id
+ * @since 1.0
+ */
+function groups_delete_group( $group_id ) {
+	global $bp;
+
+	// Check the user is the group admin.
+	if ( !$bp->is_item_admin )
+		return false;
+
+	// Get the group object
+	$group = new BP_Groups_Group( $group_id );
+	if ( !$group->delete() )
+		return false;
+
+	do_action( 'groups_before_delete_group', $group_id );
+
+	// Delete all group activity from activity streams
+	if ( bp_is_active( 'activity' ) )
+		bp_activity_delete_by_item_id( array( 'item_id' => $group_id, 'component' => $bp->groups->id ) );
+
+	// Remove all outstanding invites for this group
+	groups_delete_all_group_invites( $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;
+}
+
+function groups_is_valid_status( $status ) {
+	global $bp;
+
+	return in_array( $status, (array)$bp->groups->valid_status );
+}
+
+function groups_check_slug( $slug ) {
+	global $bp;
+
+	if ( 'wp' == substr( $slug, 0, 2 ) )
+		$slug = substr( $slug, 2, strlen( $slug ) - 2 );
+
+	if ( in_array( $slug, (array)$bp->groups->forbidden_names ) )
+		$slug = $slug . '-' . rand();
+
+	if ( BP_Groups_Group::check_slug( $slug ) ) {
+		do {
+			$slug = $slug . '-' . rand();
+		}
+		while ( BP_Groups_Group::check_slug( $slug ) );
+	}
+
+	return $slug;
+}
+
+function groups_get_slug( $group_id ) {
+	$group = new BP_Groups_Group( $group_id );
+	return $group->slug;
+}
+
+/*** User Actions ***************************************************************/
+
+function groups_leave_group( $group_id, $user_id = 0 ) {
+	global $bp;
+
+	if ( !$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 ) {
+		if ( groups_is_user_admin( $user_id, $group_id ) ) {
+			bp_core_add_message( __( 'As the only Admin, you cannot leave the group.', 'buddypress' ), 'error' );
+			return false;
+		}
+	}
+
+	$membership = new BP_Groups_Member( $user_id, $group_id );
+
+	// This is exactly the same as deleting an invite, just is_confirmed = 1 NOT 0.
+	if ( !groups_uninvite_user( $user_id, $group_id ) )
+		return false;
+
+	// Modify group member count
+	groups_update_groupmeta( $group_id, 'total_member_count', (int) groups_get_groupmeta( $group_id, 'total_member_count') - 1 );
+
+	// Modify user's group memberhip count
+	bp_update_user_meta( $user_id, 'total_group_count', (int) bp_get_user_meta( $user_id, 'total_group_count', true ) - 1 );
+
+	/**
+	 * If the user joined this group less than five minutes ago, remove the
+	 * joined_group activity so users cannot flood the activity stream by
+	 * joining/leaving the group in quick succession.
+	 */
+	if ( bp_is_active( 'activity' ) && gmmktime() <= strtotime( '+5 minutes', (int)strtotime( $membership->date_modified ) ) )
+		bp_activity_delete( array( 'component' => $bp->groups->id, 'type' => 'joined_group', 'user_id' => $user_id, 'item_id' => $group_id ) );
+
+	bp_core_add_message( __( 'You successfully left the group.', 'buddypress' ) );
+
+	do_action( 'groups_leave_group', $group_id, $user_id );
+
+	return true;
+}
+
+function groups_join_group( $group_id, $user_id = 0 ) {
+	global $bp;
+
+	if ( !$user_id )
+		$user_id = $bp->loggedin_user->id;
+
+	// Check if the user has an outstanding invite, is 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.
+	if ( groups_check_for_membership_request( $user_id, $group_id ) )
+		groups_delete_membership_request( $user_id, $group_id );
+
+	// User is already a member, just return true
+	if ( groups_is_user_member( $user_id, $group_id ) )
+		return true;
+
+	$new_member                = new BP_Groups_Member;
+	$new_member->group_id      = $group_id;
+	$new_member->user_id       = $user_id;
+	$new_member->inviter_id    = 0;
+	$new_member->is_admin      = 0;
+	$new_member->user_title    = '';
+	$new_member->date_modified = bp_core_current_time();
+	$new_member->is_confirmed  = 1;
+
+	if ( !$new_member->save() )
+		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 );
+	else
+		$group = $bp->groups->current_group;
+
+	// Record this in activity streams
+	groups_record_activity( array(
+		'action'  => apply_filters( 'groups_activity_joined_group', sprintf( __( '%1$s joined the group %2$s', 'buddypress'), bp_core_get_userlink( $user_id ), '<a href="' . bp_get_group_permalink( $group ) . '">' . esc_attr( bp_get_group_name( $group ) ) . '</a>' ) ),
+		'type'    => 'joined_group',
+		'item_id' => $group_id,
+		'user_id' => $user_id
+	) );
+
+	// Modify group meta
+	groups_update_groupmeta( $group_id, 'total_member_count', (int) groups_get_groupmeta( $group_id, 'total_member_count') + 1 );
+	groups_update_groupmeta( $group_id, 'last_activity', bp_core_current_time() );
+
+	do_action( 'groups_join_group', $group_id, $user_id );
+
+	return true;
+}
+
+/*** 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 );
+}
+
+function groups_get_group_mods( $group_id ) {
+	return BP_Groups_Member::get_group_moderator_ids( $group_id );
+}
+
+function groups_get_group_members( $group_id, $limit = false, $page = false ) {
+	return BP_Groups_Member::get_all_for_group( $group_id, $limit, $page );
+}
+
+function groups_get_total_member_count( $group_id ) {
+	return BP_Groups_Group::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
+		'user_id'         => false,    // Pass a user_id to limit to only groups that this user is a member of
+		'include'         => false,    // Only include these specific groups (group_ids)
+		'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
+	);
+
+	$params = wp_parse_args( $args, $defaults );
+	extract( $params, EXTR_SKIP );
+
+	$groups = BP_Groups_Group::get( $type, $per_page, $page, $user_id, $search_terms, $include, $populate_extras, $exclude, $show_hidden );
+
+	return apply_filters_ref_array( 'groups_get_groups', array( &$groups, &$params ) );
+}
+
+function groups_get_total_group_count() {
+	if ( !$count = wp_cache_get( 'bp_total_group_count', 'bp' ) ) {
+		$count = BP_Groups_Group::get_total_group_count();
+		wp_cache_set( 'bp_total_group_count', $count, 'bp' );
+	}
+
+	return $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;
+
+	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 ( !$count = wp_cache_get( 'bp_total_groups_for_user_' . $user_id, 'bp' ) ) {
+		$count = BP_Groups_Member::total_group_count( $user_id );
+		wp_cache_set( 'bp_total_groups_for_user_' . $user_id, $count, 'bp' );
+	}
+
+	return $count;
+}
+
+/**
+ * Returns the group object for the group currently being viewed
+ *
+ * @package BuddyPress
+ * @since 1.5
+ *
+ * @return obj The current group object
+ */
+function groups_get_current_group() {
+	global $bp;
+
+	$current_group = isset( $bp->groups->current_group ) ? $bp->groups->current_group : false;
+
+	return apply_filters( 'groups_get_current_group', $current_group );
+}
+
+/*** Group Avatars *************************************************************/
+
+function groups_avatar_upload_dir( $group_id = 0 ) {
+	global $bp;
+
+	if ( !$group_id )
+		$group_id = $bp->groups->current_group->id;
+
+	$path    = bp_core_avatar_upload_path() . '/group-avatars/' . $group_id;
+	$newbdir = $path;
+
+	if ( !file_exists( $path ) )
+		@wp_mkdir_p( $path );
+
+	$newurl    = bp_core_avatar_url() . '/group-avatars/' . $group_id;
+	$newburl   = $newurl;
+	$newsubdir = '/group-avatars/' . $group_id;
+
+	return apply_filters( 'groups_avatar_upload_dir', array( 'path' => $path, 'url' => $newurl, 'subdir' => $newsubdir, 'basedir' => $newbdir, 'baseurl' => $newburl, 'error' => false ) );
+}
+
+/*** Group Member Status Checks ************************************************/
+
+function groups_is_user_admin( $user_id, $group_id ) {
+	return BP_Groups_Member::check_is_admin( $user_id, $group_id );
+}
+
+function groups_is_user_mod( $user_id, $group_id ) {
+	return BP_Groups_Member::check_is_mod( $user_id, $group_id );
+}
+
+function groups_is_user_member( $user_id, $group_id ) {
+	return BP_Groups_Member::check_is_member( $user_id, $group_id );
+}
+
+function groups_is_user_banned( $user_id, $group_id ) {
+	return BP_Groups_Member::check_is_banned( $user_id, $group_id );
+}
+
+/**
+ * Is the specified user the creator of the group?
+ *
+ * @param int $user_id
+ * @param int $group_id
+ * @since 1.2.6
+ * @uses BP_Groups_Member
+ */
+function groups_is_user_creator( $user_id, $group_id ) {
+	return BP_Groups_Member::check_is_creator( $user_id, $group_id );
+}
+
+/*** Group Activity Posting **************************************************/
+
+function groups_post_update( $args = '' ) {
+	global $bp;
+
+	$defaults = array(
+		'content'  => false,
+		'user_id'  => $bp->loggedin_user->id,
+		'group_id' => 0
+	);
+
+	$r = wp_parse_args( $args, $defaults );
+	extract( $r, EXTR_SKIP );
+
+	if ( empty( $group_id ) && !empty( $bp->groups->current_group->id ) )
+		$group_id = $bp->groups->current_group->id;
+
+	if ( empty( $content ) || !strlen( trim( $content ) ) || empty( $user_id ) || empty( $group_id ) )
+		return false;
+
+	$bp->groups->current_group = new BP_Groups_Group( $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 ) )
+		return false;
+
+	// Record this in activity streams
+	$activity_action  = sprintf( __( '%1$s posted an update in the group %2$s', 'buddypress'), bp_core_get_userlink( $user_id ), '<a href="' . bp_get_group_permalink( $bp->groups->current_group ) . '">' . esc_attr( $bp->groups->current_group->name ) . '</a>' );
+	$activity_content = $content;
+
+	$activity_id = groups_record_activity( array(
+		'user_id' => $user_id,
+		'action'  => apply_filters( 'groups_activity_new_update_action',  $activity_action  ),
+		'content' => apply_filters( 'groups_activity_new_update_content', $activity_content ),
+		'type'    => 'activity_update',
+		'item_id' => $group_id
+	) );
+
+	groups_update_groupmeta( $group_id, 'last_activity', bp_core_current_time() );
+	do_action( 'bp_groups_posted_update', $content, $user_id, $group_id, $activity_id );
+
+	return $activity_id;
+}
+
+/*** 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;
+
+	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,
+		'date_modified' => bp_core_current_time(),
+		'is_confirmed'  => 0
+	);
+
+	$args = wp_parse_args( $args, $defaults );
+	extract( $args, EXTR_SKIP );
+
+	if ( !$user_id || !$group_id )
+		return false;
+
+	if ( !groups_is_user_member( $user_id, $group_id ) && !groups_check_user_has_invite( $user_id, $group_id, 'all' ) ) {
+		$invite                = new BP_Groups_Member;
+		$invite->group_id      = $group_id;
+		$invite->user_id       = $user_id;
+		$invite->date_modified = $date_modified;
+		$invite->inviter_id    = $inviter_id;
+		$invite->is_confirmed  = $is_confirmed;
+
+		if ( !$invite->save() )
+			return false;
+
+		do_action( 'groups_invite_user', $args );
+	}
+
+	return true;
+}
+
+function groups_uninvite_user( $user_id, $group_id ) {
+	global $bp;
+
+	if ( !BP_Groups_Member::delete( $user_id, $group_id ) )
+		return false;
+
+	do_action( 'groups_uninvite_user', $group_id, $user_id );
+
+	return true;
+}
+
+function groups_accept_invite( $user_id, $group_id ) {
+	global $bp;
+
+	if ( groups_is_user_member( $user_id, $group_id ) )
+		return false;
+
+	$member = new BP_Groups_Member( $user_id, $group_id );
+	$member->accept_invite();
+
+	if ( !$member->save() )
+		return false;
+
+	// Remove request to join
+	if ( $member->check_for_membership_request( $user_id, $group_id ) )
+		$member->delete_request( $user_id, $group_id );
+
+	// Modify group meta
+	groups_update_groupmeta( $group_id, 'total_member_count', (int) groups_get_groupmeta( $group_id, 'total_member_count') + 1 );
+	groups_update_groupmeta( $group_id, 'last_activity', bp_core_current_time() );
+
+	bp_core_delete_notifications_by_item_id( $user_id, $group_id, $bp->groups->id, 'group_invite' );
+
+	do_action( 'groups_accept_invite', $user_id, $group_id );
+	return true;
+}
+
+function groups_reject_invite( $user_id, $group_id ) {
+	if ( !BP_Groups_Member::delete( $user_id, $group_id ) )
+		return false;
+
+	do_action( 'groups_reject_invite', $user_id, $group_id );
+
+	return true;
+}
+
+function groups_delete_invite( $user_id, $group_id ) {
+	global $bp;
+
+	$delete = BP_Groups_Member::delete_invite( $user_id, $group_id );
+
+	if ( $delete )
+		bp_core_delete_notifications_by_item_id( $user_id, $group_id, $bp->groups->id, 'group_invite' );
+
+	return $delete;
+}
+
+function groups_send_invites( $user_id, $group_id ) {
+	global $bp;
+
+	if ( !$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 );
+
+	for ( $i = 0, $count = count( $invited_users ); $i < $count; ++$i ) {
+		$member = new BP_Groups_Member( $invited_users[$i], $group_id );
+
+		// Send the actual invite
+		groups_notification_group_invites( $group, $member, $user_id );
+
+		$member->invite_sent = 1;
+		$member->save();
+	}
+
+	do_action( 'groups_send_invites', $group_id, $invited_users );
+}
+
+function groups_get_invites_for_group( $user_id, $group_id ) {
+	return BP_Groups_Group::get_invites( $user_id, $group_id );
+}
+
+/**
+ * Check to see whether a user has already been invited to a group
+ *
+ * By default, the function checks for invitations that have been sent. Entering 'all' as the $type
+ * parameter will return unsent invitations as well (useful to make sure AJAX requests are not
+ * duplicated)
+ *
+ * @package BuddyPress Groups
+ *
+ * @param int $user_id Potential group member
+ * @param int $group_id Potential group
+ * @param str $type Optional. Use 'sent' to check for sent invites, 'all' to check for all
+ * @return bool Returns true if an invitation is found
+ */
+function groups_check_user_has_invite( $user_id, $group_id, $type = 'sent' ) {
+	return BP_Groups_Member::check_has_invite( $user_id, $group_id, $type );
+}
+
+function groups_delete_all_group_invites( $group_id ) {
+	return BP_Groups_Group::delete_all_invites( $group_id );
+}
+
+/*** Group Promotion & Banning *************************************************/
+
+function groups_promote_member( $user_id, $group_id, $status ) {
+	global $bp;
+
+	if ( !$bp->is_item_admin )
+		return false;
+
+	$member = new BP_Groups_Member( $user_id, $group_id );
+
+	do_action( 'groups_premote_member', $group_id, $user_id, $status );
+
+	return $member->promote( $status );
+}
+
+function groups_demote_member( $user_id, $group_id ) {
+	global $bp;
+
+	$member = new BP_Groups_Member( $user_id, $group_id );
+
+	do_action( 'groups_demote_member', $group_id, $user_id );
+
+	return $member->demote();
+}
+
+function groups_ban_member( $user_id, $group_id ) {
+	global $bp;
+
+	if ( !$bp->is_item_admin )
+		return false;
+
+	$member = new BP_Groups_Member( $user_id, $group_id );
+
+	do_action( 'groups_ban_member', $group_id, $user_id );
+
+	return $member->ban();
+}
+
+function groups_unban_member( $user_id, $group_id ) {
+	global $bp;
+
+	if ( !$bp->is_item_admin )
+		return false;
+
+	$member = new BP_Groups_Member( $user_id, $group_id );
+
+	do_action( 'groups_unban_member', $group_id, $user_id );
+
+	return $member->unban();
+}
+
+/*** Group Removal *******************************************************/
+
+function groups_remove_member( $user_id, $group_id ) {
+	global $bp;
+
+	if ( !$bp->is_item_admin )
+		return false;
+
+	$member = new BP_Groups_Member( $user_id, $group_id );
+
+	do_action( 'groups_remove_member', $group_id, $user_id );
+
+	return $member->remove();
+}
+
+/*** 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 ) )
+		return false;
+
+	// Check if the user is already a member or is banned
+	if ( groups_is_user_member( $requesting_user_id, $group_id ) || groups_is_user_banned( $requesting_user_id, $group_id ) )
+		return false;
+
+	$requesting_user                = new BP_Groups_Member;
+	$requesting_user->group_id      = $group_id;
+	$requesting_user->user_id       = $requesting_user_id;
+	$requesting_user->inviter_id    = 0;
+	$requesting_user->is_admin      = 0;
+	$requesting_user->user_title    = '';
+	$requesting_user->date_modified = bp_core_current_time();
+	$requesting_user->is_confirmed  = 0;
+	$requesting_user->comments      = isset( $_POST['group-request-membership-comments'] ) ? $_POST['group-request-membership-comments'] : '';
+
+	if ( $requesting_user->save() ) {
+		$admins = groups_get_group_admins( $group_id );
+
+		// Saved okay, now send the email notification
+		for ( $i = 0, $count = count( $admins ); $i < $count; ++$i )
+			groups_notification_new_membership_request( $requesting_user_id, $admins[$i]->user_id, $group_id, $requesting_user->id );
+
+		do_action( 'groups_membership_requested', $requesting_user_id, $admins, $group_id, $requesting_user->id );
+
+		return true;
+	}
+
+	return false;
+}
+
+function groups_accept_membership_request( $membership_id, $user_id = 0, $group_id = 0 ) {
+	global $bp;
+
+	if ( $user_id && $group_id )
+		$membership = new BP_Groups_Member( $user_id, $group_id );
+	else
+		$membership = new BP_Groups_Member( false, false, $membership_id );
+
+	$membership->accept_request();
+
+	if ( !$membership->save() )
+		return false;
+
+	// Check if the user has an outstanding invite, if so delete it.
+	if ( groups_check_user_has_invite( $membership->user_id, $membership->group_id ) )
+		groups_delete_invite( $membership->user_id, $membership->group_id );
+
+	// Modify group member count
+	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 );
+
+	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 ) ),
+		'type'    => 'joined_group',
+		'item_id' => $membership->group_id,
+		'user_id' => $membership->user_id
+	) );
+
+	// Send a notification to the user.
+	groups_notification_membership_request_completed( $membership->user_id, $membership->group_id, true );
+
+	do_action( 'groups_membership_accepted', $membership->user_id, $membership->group_id );
+
+	return true;
+}
+
+function groups_reject_membership_request( $membership_id, $user_id = 0, $group_id = 0 ) {
+	if ( !$membership = groups_delete_membership_request( $membership_id, $user_id, $group_id ) )
+		return false;
+
+	// Send a notification to the user.
+	groups_notification_membership_request_completed( $membership->user_id, $membership->group_id, false );
+
+	do_action( 'groups_membership_rejected', $membership->user_id, $membership->group_id );
+
+	return true;
+}
+
+function groups_delete_membership_request( $membership_id, $user_id = 0, $group_id = 0 ) {
+	if ( $user_id && $group_id )
+		$membership = new BP_Groups_Member( $user_id, $group_id );
+	else
+		$membership = new BP_Groups_Member( false, false, $membership_id );
+
+	if ( !BP_Groups_Member::delete( $membership->user_id, $membership->group_id ) )
+		return false;
+
+	return $membership;
+}
+
+function groups_check_for_membership_request( $user_id, $group_id ) {
+	return BP_Groups_Member::check_for_membership_request( $user_id, $group_id );
+}
+
+function groups_accept_all_pending_membership_requests( $group_id ) {
+	$user_ids = BP_Groups_Member::get_all_membership_request_user_ids( $group_id );
+
+	if ( !$user_ids )
+		return false;
+
+	foreach ( (array) $user_ids as $user_id )
+		groups_accept_membership_request( false, $user_id, $group_id );
+
+	do_action( 'groups_accept_all_pending_membership_requests', $group_id );
+
+	return true;
+}
+
+/*** Group Meta ****************************************************/
+
+function groups_delete_groupmeta( $group_id, $meta_key = false, $meta_value = false ) {
+	global $wpdb, $bp;
+
+	if ( !is_numeric( $group_id ) )
+		return false;
+
+	$meta_key = preg_replace( '|[^a-z0-9_]|i', '', $meta_key );
+
+	if ( is_array( $meta_value ) || is_object( $meta_value ) )
+		$meta_value = serialize($meta_value);
+
+	$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 ) );
+	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 ) );
+	else
+		$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' );
+
+	return true;
+}
+
+function groups_get_groupmeta( $group_id, $meta_key = '') {
+	global $wpdb, $bp;
+
+	$group_id = (int) $group_id;
+
+	if ( !$group_id )
+		return false;
+
+	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) );
+			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) );
+	}
+
+	if ( empty( $metas ) ) {
+		if ( empty( $meta_key ) )
+			return array();
+		else
+			return '';
+	}
+
+	$metas = array_map( 'maybe_unserialize', (array)$metas );
+
+	if ( 1 == count( $metas ) )
+		return $metas[0];
+	else
+		return $metas;
+}
+
+function groups_update_groupmeta( $group_id, $meta_key, $meta_value ) {
+	global $wpdb, $bp;
+
+	if ( !is_numeric( $group_id ) )
+		return false;
+
+	$meta_key = preg_replace( '|[^a-z0-9_]|i', '', $meta_key );
+
+	if ( is_string( $meta_value ) )
+		$meta_value = stripslashes( $wpdb->escape( $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 ) );
+
+	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 ) );
+	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 ) );
+	else
+		return false;
+
+	// Update the cached object and recache
+	wp_cache_set( 'bp_groups_groupmeta_' . $group_id . '_' . $meta_key, $meta_value, 'bp' );
+
+	return true;
+}
+
+/*** Group Cleanup Functions ****************************************************/
+
+function groups_remove_data_for_user( $user_id ) {
+	BP_Groups_Member::delete_all_for_user( $user_id );
+
+	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
new file mode 100644
index 0000000000000000000000000000000000000000..80243d040330680513927911b118befbff367237
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-groups/bp-groups-loader.php
@@ -0,0 +1,471 @@
+<?php
+/**
+ * BuddyPress Groups Loader
+ *
+ * A groups component, for users to group themselves together. Includes a
+ * robust sub-component API that allows Groups to be extended.
+ * Comes preconfigured with an activity stream, discussion forums, and settings.
+ *
+ * @package BuddyPress
+ * @subpackage Groups Core
+ */
+
+// Exit if accessed directly
+if ( !defined( 'ABSPATH' ) ) exit;
+
+class BP_Groups_Component extends BP_Component {
+
+	/**
+	 * Start the groups component creation process
+	 *
+	 * @since 1.5
+	 */
+	function __construct() {
+		parent::start(
+			'groups',
+			__( 'User Groups', 'buddypress' ),
+			BP_PLUGIN_DIR
+		);
+	}
+
+	/**
+	 * Include files
+	 */
+	function includes() {
+		$includes = array(
+			'cache',
+			'forums',
+			'actions',
+			'filters',
+			'screens',
+			'classes',
+			'widgets',
+			'activity',
+			'template',
+			'buddybar',
+			'adminbar',
+			'functions',
+			'notifications'
+		);
+		parent::includes( $includes );
+	}
+
+	/**
+	 * Setup globals
+	 *
+	 * The BP_GROUPS_SLUG constant is deprecated, and only used here for
+	 * backwards compatibility.
+	 *
+	 * @since 1.5
+	 * @global obj $bp
+	 */
+	function setup_globals() {
+		global $bp;
+
+		// Define a slug, if necessary
+		if ( !defined( 'BP_GROUPS_SLUG' ) )
+			define( 'BP_GROUPS_SLUG', $this->id );
+
+		// Global tables for messaging component
+		$global_tables = array(
+			'table_name'           => $bp->table_prefix . 'bp_groups',
+			'table_name_members'   => $bp->table_prefix . 'bp_groups_members',
+			'table_name_groupmeta' => $bp->table_prefix . 'bp_groups_groupmeta'
+		);
+
+		// 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,
+			'notification_callback' => 'groups_format_notifications',
+			'search_string'         => __( 'Search Groups...', 'buddypress' ),
+			'global_tables'         => $global_tables
+		);
+
+		parent::setup_globals( $globals );
+
+		/** Single Group Globals **********************************************/
+
+		// Are we viewing a single group?
+		if ( bp_is_groups_component() && $group_id = BP_Groups_Group::group_exists( bp_current_action() ) ) {
+
+			$bp->is_single_item  = true;
+			$current_group_class = apply_filters( 'bp_groups_current_group_class', 'BP_Groups_Group' );
+			$this->current_group = apply_filters( 'bp_groups_current_group_object', new $current_group_class( $group_id ) );
+
+			// When in a single group, the first action is bumped down one because of the
+			// group name, so we need to adjust this and set the group name to current_item.
+			$bp->current_item   = bp_current_action();
+			$bp->current_action = bp_action_variable( 0 );
+			array_shift( $bp->action_variables );
+
+			// Using "item" not "group" for generic support in other components.
+			if ( is_super_admin() )
+				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' );
+
+			// 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' );
+
+			// 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 ) ) )
+				$this->current_group->is_user_member = true;
+			else
+				$this->current_group->is_user_member = false;
+
+			// Should this group be visible to the logged in user?
+			if ( 'public' == $this->current_group->status || $this->current_group->is_user_member )
+				$this->current_group->is_visible = true;
+			else
+				$this->current_group->is_visible = false;
+
+			// 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() )
+					$this->current_group->user_has_access = true;
+				else
+					$this->current_group->user_has_access = false;
+			} else {
+				$this->current_group->user_has_access = true;
+			}
+
+		// Set current_group to 0 to prevent debug errors
+		} else {
+			$this->current_group = 0;
+		}
+
+		// Illegal group names/slugs
+		$this->forbidden_names = apply_filters( 'groups_forbidden_names', array(
+			'my-groups',
+			'create',
+			'invites',
+			'send-invites',
+			'forum',
+			'delete',
+			'add',
+			'admin',
+			'request-membership',
+			'members',
+			'settings',
+			'avatar',
+			$this->slug,
+			$this->root_slug,
+		) );
+
+		// 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 ) ) {
+			bp_do_404();
+			return;
+		}
+
+		// 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
+				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
+				) );
+			} else {
+				// Allow the user to log in
+				bp_core_no_access();
+			}
+		}
+
+		// Preconfigured group creation steps
+		$this->group_creation_steps = apply_filters( 'groups_create_group_steps', array(
+			'group-details'  => array(
+				'name'       => __( 'Details',  'buddypress' ),
+				'position'   => 0
+			),
+			'group-settings' => array(
+				'name'       => __( 'Settings', 'buddypress' ),
+				'position'   => 10
+			)
+		) );
+
+		// If avatar uploads are not disabled, add avatar option
+		if ( !(int)bp_get_option( 'bp-disable-avatar-uploads' ) ) {
+			$this->group_creation_steps['group-avatar'] = array(
+				'name'     => __( 'Avatar',   'buddypress' ),
+				'position' => 20
+			);
+		}
+
+		// If friends component is active, add invitations
+		if ( bp_is_active( 'friends' ) ) {
+			$this->group_creation_steps['group-invites'] = array(
+				'name'     => __( 'Invites', 'buddypress' ),
+				'position' => 30
+			);
+		}
+
+		// Groups statuses
+		$this->valid_status = apply_filters( 'groups_valid_status', array(
+			'public',
+			'private',
+			'hidden'
+		) );
+
+		// Auto join group when non group member performs group activity
+		$this->auto_join = defined( 'BP_DISABLE_AUTO_GROUP_JOIN' ) && BP_DISABLE_AUTO_GROUP_JOIN ? false : true;
+	}
+
+	/**
+	 * Setup BuddyBar navigation
+	 *
+	 * @global obj $bp
+	 */
+	function setup_nav() {
+		global $bp;
+
+		// Add 'Groups' to the main navigation
+		$main_nav = array(
+			'name'                => sprintf( __( 'Groups <span>%d</span>', 'buddypress' ), groups_total_groups_for_user() ),
+			'slug'                => $this->slug,
+			'position'            => 70,
+			'screen_function'     => 'groups_screen_my_groups',
+			'default_subnav_slug' => 'my-groups',
+			'item_css_id'         => $this->id
+		);
+
+		$groups_link = trailingslashit( $bp->loggedin_user->domain . $this->slug );
+
+		// Add the My Groups nav item
+		$sub_nav[] = array(
+			'name'            => __( 'Memberships', 'buddypress' ),
+			'slug'            => 'my-groups',
+			'parent_url'      => $groups_link,
+			'parent_slug'     => $this->slug,
+			'screen_function' => 'groups_screen_my_groups',
+			'position'        => 10,
+			'item_css_id'     => 'groups-my-groups'
+		);
+
+		// Add the Group Invites nav item
+		$sub_nav[] = array(
+			'name'            => __( 'Invitations', 'buddypress' ),
+			'slug'            => 'invites',
+			'parent_url'      => $groups_link,
+			'parent_slug'     => $this->slug,
+			'screen_function' => 'groups_screen_group_invites',
+			'user_has_access' =>  bp_is_my_profile(),
+			'position'        => 30
+		);
+
+		parent::setup_nav( $main_nav, $sub_nav );
+
+		if ( bp_is_groups_component() && bp_is_single_item() ) {
+
+			unset( $main_nav ); unset( $sub_nav );
+
+			// Add 'Groups' to the main navigation
+			$main_nav = array(
+				'name'                => __( 'Memberships', 'buddypress' ),
+				'slug'                => $this->current_group->slug,
+				'position'            => -1, // Do not show in BuddyBar
+				'screen_function'     => 'groups_screen_group_home',
+				'default_subnav_slug' => 'home',
+				'item_css_id'         => $this->id
+			);
+
+			$group_link = trailingslashit( bp_get_root_domain() . '/' . $this->root_slug . '/' . $this->current_group->slug );
+
+			// Add the "Home" subnav item, as this will always be present
+			$sub_nav[] = array(
+				'name'            =>  _x( 'Home', 'Group home navigation title', 'buddypress' ),
+				'slug'            => 'home',
+				'parent_url'      => $group_link,
+				'parent_slug'     => $this->current_group->slug,
+				'screen_function' => 'groups_screen_group_home',
+				'position'        => 10,
+				'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() &&
+				 !$this->current_group->is_user_member &&
+				 !groups_check_for_membership_request( $bp->loggedin_user->id, $this->current_group->id ) &&
+				 $this->current_group->status == 'private'
+				) {
+				$sub_nav[] = array(
+					'name'               => __( 'Request Membership', 'buddypress' ),
+					'slug'               => 'request-membership',
+					'parent_url'         => $group_link,
+					'parent_slug'        => $this->current_group->slug,
+					'screen_function'    => 'groups_screen_group_request_membership',
+					'position'           => 30
+				);
+			}
+
+			// Forums are enabled and turned on
+			if ( $this->current_group->enable_forum && bp_is_active( 'forums' ) ) {
+				$sub_nav[] = array(
+					'name'            => __( 'Forum', 'buddypress' ),
+					'slug'            => 'forum',
+					'parent_url'      => $group_link,
+					'parent_slug'     => $this->current_group->slug,
+					'screen_function' => 'groups_screen_group_forum',
+					'position'        => 40,
+					'user_has_access' => $this->current_group->user_has_access,
+					'item_css_id'     => 'forums'
+				);
+			}
+
+			$sub_nav[] = array(
+				'name'            => sprintf( __( 'Members <span>%s</span>', 'buddypress' ), number_format( $this->current_group->total_member_count ) ),
+				'slug'            => 'members',
+				'parent_url'      => $group_link,
+				'parent_slug'     => $this->current_group->slug,
+				'screen_function' => 'groups_screen_group_members',
+				'position'        => 60,
+				'user_has_access' => $this->current_group->user_has_access,
+				'item_css_id'     => 'members'
+			);
+
+			if ( bp_is_active( 'friends' ) && bp_groups_user_can_send_invites() ) {
+				$sub_nav[] = array(
+					'name'            => __( 'Send Invites', 'buddypress' ),
+					'slug'            => 'send-invites',
+					'parent_url'      => $group_link,
+					'parent_slug'     => $this->current_group->slug,
+					'screen_function' => 'groups_screen_group_invite',
+					'item_css_id'     => 'invite',
+					'position'        => 70,
+					'user_has_access' => $this->current_group->user_has_access
+				);
+			}
+
+			parent::setup_nav( $main_nav, $sub_nav );
+		}
+
+		if ( isset( $this->current_group->user_has_access ) )
+			do_action( 'groups_setup_nav', $this->current_group->user_has_access );
+		else
+			do_action( 'groups_setup_nav');
+	}
+
+	/**
+	 * Set up the admin bar
+	 *
+	 * @global obj $bp
+	 */
+	function setup_admin_bar() {
+		global $bp;
+
+		// Prevent debug notices
+		$wp_admin_nav = array();
+
+		// Menus for logged in user
+		if ( is_user_logged_in() ) {
+
+			// Setup the logged in user variables
+			$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 );
+
+			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' );
+			}
+
+			// Add the "My Account" sub menus
+			$wp_admin_nav[] = array(
+				'parent' => $bp->my_account_menu_id,
+				'id'     => 'my-account-' . $this->id,
+				'title'  => $title,
+				'href'   => trailingslashit( $groups_link )
+			);
+
+			// My Groups
+			$wp_admin_nav[] = array(
+				'parent' => 'my-account-' . $this->id,
+				'id'     => 'my-account-' . $this->id . '-memberships',
+				'title'  => __( 'Memberships', 'buddypress' ),
+				'href'   => trailingslashit( $groups_link )
+			);
+
+			// Invitations
+			$wp_admin_nav[] = array(
+				'parent' => 'my-account-' . $this->id,
+				'id'     => 'my-account-' . $this->id . '-invites',
+				'title'  => $pending,
+				'href'   => trailingslashit( $groups_link . 'invites' )
+			);
+		}
+
+		parent::setup_admin_bar( $wp_admin_nav );
+	}
+
+	/**
+	 * Sets up the title for pages and <title>
+	 *
+	 * @global obj $bp
+	 */
+	function setup_title() {
+		global $bp;
+
+		if ( bp_is_groups_component() ) {
+
+			if ( bp_is_my_profile() && !bp_is_single_item() ) {
+
+				$bp->bp_options_title = __( 'Memberships', 'buddypress' );
+
+			} 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'
+				) );
+				$bp->bp_options_title  = $bp->displayed_user->fullname;
+
+			// We are viewing a single group, so set up the
+			// group navigation menu using the $this->current_group global.
+			} else if ( bp_is_single_item() ) {
+				$bp->bp_options_title  = $this->current_group->name;
+				$bp->bp_options_avatar = bp_core_fetch_avatar( array(
+					'item_id'    => $this->current_group->id,
+					'object'     => 'group',
+					'type'       => 'thumb',
+					'avatar_dir' => 'group-avatars',
+					'alt'        => __( 'Group Avatar', 'buddypress' )
+				) );
+				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();
+
+?>
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 cdebf5ab060a9e285528e8a6ad600ddc492f2b9e..f5076dd352cb943e0df97b609331cc9b8ded3b98 100644
--- a/wp-content/plugins/buddypress/bp-groups/bp-groups-notifications.php
+++ b/wp-content/plugins/buddypress/bp-groups/bp-groups-notifications.php
@@ -1,28 +1,30 @@
 <?php
+// Exit if accessed directly
+if ( !defined( 'ABSPATH' ) ) exit;
 
 function groups_notification_group_updated( $group_id ) {
 	global $bp;
 
 	$group    = new BP_Groups_Group( $group_id );
-	$sitename = wp_specialchars_decode( get_blog_option( BP_ROOT_BLOG, 'blogname' ), ENT_QUOTES );
+	$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 ) {
-		if ( 'no' == get_user_meta( $user_id, 'notification_groups_group_updated', true ) ) continue;
+		if ( 'no' == bp_get_user_meta( $user_id, 'notification_groups_group_updated', true ) ) continue;
 
 		$ud = bp_core_get_core_userdata( $user_id );
 
 		// Set up and send the message
 		$to = $ud->user_email;
 
-		$group_link = site_url( $bp->groups->slug . '/' . $group->slug );
-		$settings_link = bp_core_get_user_domain( $user_id ) .  BP_SETTINGS_SLUG . '/notifications/';
+		$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/';
 
 		$message = sprintf( __(
-'Group details for the group "%s" were updated:
+'Group details for the group "%1$s" were updated:
 
-To view the group: %s
+To view the group: %2$s
 
 ---------------------
 ', 'buddypress' ), $group->name, $group_link );
@@ -30,14 +32,16 @@ To view the group: %s
 		$message .= sprintf( __( 'To disable these notifications please log in and go to: %s', 'buddypress' ), $settings_link );
 
 		/* Send the message */
-		$to = apply_filters( 'groups_notification_group_updated_to', $to );
-		$subject = apply_filters( 'groups_notification_group_updated_subject', $subject, &$group );
-		$message = apply_filters( 'groups_notification_group_updated_message', $message, &$group, $group_link );
+		$to      = apply_filters( 'groups_notification_group_updated_to', $to );
+		$subject = apply_filters_ref_array( 'groups_notification_group_updated_subject', array( $subject, &$group ) );
+		$message = apply_filters_ref_array( 'groups_notification_group_updated_message', array( $message, &$group, $group_link, $settings_link ) );
 
 		wp_mail( $to, $subject, $message );
 
 		unset( $message, $to );
 	}
+
+	do_action( 'bp_groups_sent_updated_email', $user_ids, $subject, '', $group_id );
 }
 
 function groups_notification_new_membership_request( $requesting_user_id, $admin_id, $group_id, $membership_id ) {
@@ -45,7 +49,7 @@ function groups_notification_new_membership_request( $requesting_user_id, $admin
 
 	bp_core_add_notification( $requesting_user_id, $admin_id, 'groups', 'new_membership_request', $group_id );
 
-	if ( 'no' == get_user_meta( $admin_id, 'notification_groups_membership_request', true ) )
+	if ( 'no' == bp_get_user_meta( $admin_id, 'notification_groups_membership_request', true ) )
 		return false;
 
 	$requesting_user_name = bp_core_get_user_displayname( $requesting_user_id );
@@ -56,7 +60,7 @@ function groups_notification_new_membership_request( $requesting_user_id, $admin
 
 	$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_SETTINGS_SLUG . '/notifications/';
+	$settings_link = bp_core_get_user_domain( $requesting_user_id ) . bp_get_settings_slug() . '/notifications/';
 
 	// Set up and send the message
 	$to       = $ud->user_email;
@@ -64,14 +68,14 @@ function groups_notification_new_membership_request( $requesting_user_id, $admin
 	$subject  = '[' . $sitename . '] ' . sprintf( __( 'Membership request for group: %s', 'buddypress' ), $group->name );
 
 $message = sprintf( __(
-'%s wants to join the group "%s".
+'%1$s wants to join the group "%2$s".
 
 Because you are the administrator of this group, you must either accept or reject the membership request.
 
 To view all pending membership requests for this group, please visit:
-%s
+%3$s
 
-To view %s\'s profile: %s
+To view %4$s\'s profile: %5$s
 
 ---------------------
 ', 'buddypress' ), $requesting_user_name, $group->name, $group_requests, $requesting_user_name, $profile_link );
@@ -79,11 +83,13 @@ To view %s\'s profile: %s
 	$message .= sprintf( __( 'To disable these notifications please log in and go to: %s', 'buddypress' ), $settings_link );
 
 	/* Send the message */
-	$to = apply_filters( 'groups_notification_new_membership_request_to', $to );
-	$subject = apply_filters( 'groups_notification_new_membership_request_subject', $subject, &$group );
-	$message = apply_filters( 'groups_notification_new_membership_request_message', $message, &$group, $requesting_user_name, $profile_link, $group_requests );
+	$to      = apply_filters( 'groups_notification_new_membership_request_to', $to );
+	$subject = apply_filters_ref_array( 'groups_notification_new_membership_request_subject', array( $subject, &$group ) );
+	$message = apply_filters_ref_array( 'groups_notification_new_membership_request_message', array( $message, &$group, $requesting_user_name, $profile_link, $group_requests, $settings_link ) );
 
 	wp_mail( $to, $subject, $message );
+
+	do_action( 'bp_groups_sent_membership_request_email', $admin_id, $subject, $message, $requesting_user_id, $group_id, $membership_id );
 }
 
 function groups_notification_membership_request_completed( $requesting_user_id, $group_id, $accepted = true ) {
@@ -95,7 +101,7 @@ function groups_notification_membership_request_completed( $requesting_user_id,
 	else
 		bp_core_add_notification( $group_id, $requesting_user_id, 'groups', 'membership_request_rejected' );
 
-	if ( 'no' == get_user_meta( $requesting_user_id, 'notification_membership_request_completed', true ) )
+	if ( 'no' == bp_get_user_meta( $requesting_user_id, 'notification_membership_request_completed', true ) )
 		return false;
 
 	$group = new BP_Groups_Group( $group_id );
@@ -103,18 +109,18 @@ function groups_notification_membership_request_completed( $requesting_user_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_SETTINGS_SLUG . '/notifications/';
+	$settings_link = bp_core_get_user_domain( $requesting_user_id ) . bp_get_settings_slug() . '/notifications/';
 
 	// Set up and send the message
 	$to       = $ud->user_email;
-	$sitename = wp_specialchars_decode( get_blog_option( BP_ROOT_BLOG, 'blogname' ), ENT_QUOTES );
+	$sitename = wp_specialchars_decode( get_blog_option( bp_get_root_blog_id(), 'blogname' ), ENT_QUOTES );
 
 	if ( $accepted ) {
-		$subject  = '[' . $sitename . '] ' . sprintf( __( 'Membership request for group "%s" accepted', 'buddypress' ), $group->name );
-		$message  = sprintf( __(
-'Your membership request for the group "%s" has been accepted.
+		$subject = '[' . $sitename . '] ' . sprintf( __( 'Membership request for group "%s" accepted', 'buddypress' ), $group->name );
+		$message = sprintf( __(
+'Your membership request for the group "%1$s" has been accepted.
 
-To view the group please login and visit: %s
+To view the group please login and visit: %2$s
 
 ---------------------
 ', 'buddypress' ), $group->name, $group_link );
@@ -122,9 +128,9 @@ To view the group please login and visit: %s
 	} else {
 		$subject = '[' . $sitename . '] ' . sprintf( __( 'Membership request for group "%s" rejected', 'buddypress' ), $group->name );
 		$message = sprintf( __(
-'Your membership request for the group "%s" has been rejected.
+'Your membership request for the group "%1$s" has been rejected.
 
-To submit another request please log in and visit: %s
+To submit another request please log in and visit: %2$s
 
 ---------------------
 ', 'buddypress' ), $group->name, $group_link );
@@ -133,11 +139,13 @@ To submit another request please log in and visit: %s
 	$message .= sprintf( __( 'To disable these notifications please log in and go to: %s', 'buddypress' ), $settings_link );
 
 	/* Send the message */
-	$to = apply_filters( 'groups_notification_membership_request_completed_to', $to );
-	$subject = apply_filters( 'groups_notification_membership_request_completed_subject', $subject, &$group );
-	$message = apply_filters( 'groups_notification_membership_request_completed_message', $message, &$group, $group_link  );
+	$to      = apply_filters( 'groups_notification_membership_request_completed_to', $to );
+	$subject = apply_filters_ref_array( 'groups_notification_membership_request_completed_subject', array( $subject, &$group ) );
+	$message = apply_filters_ref_array( 'groups_notification_membership_request_completed_message', array( $message, &$group, $group_link, $settings_link ) );
 
 	wp_mail( $to, $subject, $message );
+
+	do_action( 'bp_groups_sent_membership_approved_email', $requesting_user_id, $subject, $message, $group_id );
 }
 
 function groups_notification_promoted_member( $user_id, $group_id ) {
@@ -154,24 +162,24 @@ function groups_notification_promoted_member( $user_id, $group_id ) {
 	// Post a screen notification first.
 	bp_core_add_notification( $group_id, $user_id, 'groups', $type );
 
-	if ( 'no' == get_user_meta( $user_id, 'notification_groups_admin_promotion', true ) )
+	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_SETTINGS_SLUG . '/notifications/';
+	$settings_link = bp_core_get_user_domain( $user_id ) . bp_get_settings_slug() . '/notifications/';
 
 	// Set up and send the message
 	$to       = $ud->user_email;
-	$sitename = wp_specialchars_decode( get_blog_option( BP_ROOT_BLOG, 'blogname' ), ENT_QUOTES );
+	$sitename = wp_specialchars_decode( get_blog_option( bp_get_root_blog_id(), 'blogname' ), ENT_QUOTES );
 	$subject  = '[' . $sitename . '] ' . sprintf( __( 'You have been promoted in the group: "%s"', 'buddypress' ), $group->name );
 
 	$message = sprintf( __(
-'You have been promoted to %s for the group: "%s".
+'You have been promoted to %1$s for the group: "%2$s".
 
-To view the group please visit: %s
+To view the group please visit: %3$s
 
 ---------------------
 ', 'buddypress' ), $promoted_to, $group->name, $group_link );
@@ -179,11 +187,13 @@ To view the group please visit: %s
 	$message .= sprintf( __( 'To disable these notifications please log in and go to: %s', 'buddypress' ), $settings_link );
 
 	/* Send the message */
-	$to = apply_filters( 'groups_notification_promoted_member_to', $to );
-	$subject = apply_filters( 'groups_notification_promoted_member_subject', $subject, &$group );
-	$message = apply_filters( 'groups_notification_promoted_member_message', $message, &$group, $promoted_to, $group_link );
+	$to      = apply_filters( 'groups_notification_promoted_member_to', $to );
+	$subject = apply_filters_ref_array( 'groups_notification_promoted_member_subject', array( $subject, &$group ) );
+	$message = apply_filters_ref_array( 'groups_notification_promoted_member_message', array( $message, &$group, $promoted_to, $group_link, $settings_link ) );
 
 	wp_mail( $to, $subject, $message );
+
+	do_action( 'bp_groups_sent_promoted_email', $user_id, $subject, $message, $group_id );
 }
 add_action( 'groups_promoted_member', 'groups_notification_promoted_member', 10, 2 );
 
@@ -202,28 +212,28 @@ function groups_notification_group_invites( &$group, &$member, $inviter_user_id
 		// Post a screen notification first.
 		bp_core_add_notification( $group->id, $invited_user_id, 'groups', 'group_invite' );
 
-		if ( 'no' == get_user_meta( $invited_user_id, 'notification_groups_invite', true ) )
+		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_SETTINGS_SLUG . '/notifications/';
+		$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->groups->slug . '/invites';
+		$invites_link = $invited_link . bp_get_groups_slug() . '/invites';
 
 		// Set up and send the message
 		$to       = $invited_ud->user_email;
-		$sitename = wp_specialchars_decode( get_blog_option( BP_ROOT_BLOG, 'blogname' ), ENT_QUOTES );
+		$sitename = wp_specialchars_decode( get_blog_option( bp_get_root_blog_id(), 'blogname' ), ENT_QUOTES );
 		$subject  = '[' . $sitename . '] ' . sprintf( __( 'You have an invitation to the group: "%s"', 'buddypress' ), $group->name );
 
 		$message = sprintf( __(
-'One of your friends %s has invited you to the group: "%s".
+'One of your friends %1$s has invited you to the group: "%2$s".
 
-To view your group invites visit: %s
+To view your group invites visit: %3$s
 
-To view the group visit: %s
+To view the group visit: %4$s
 
-To view %s\'s profile visit: %s
+To view %5$s\'s profile visit: %6$s
 
 ---------------------
 ', 'buddypress' ), $inviter_name, $group->name, $invites_link, $group_link, $inviter_name, $inviter_link );
@@ -231,73 +241,14 @@ To view %s\'s profile visit: %s
 		$message .= sprintf( __( 'To disable these notifications please log in and go to: %s', 'buddypress' ), $settings_link );
 
 		/* Send the message */
-		$to = apply_filters( 'groups_notification_group_invites_to', $to );
-		$subject = apply_filters( 'groups_notification_group_invites_subject', $subject, &$group );
-		$message = apply_filters( 'groups_notification_group_invites_message', $message, &$group, $inviter_name, $inviter_link, $invites_link, $group_link );
+		$to      = apply_filters( 'groups_notification_group_invites_to', $to );
+		$subject = apply_filters_ref_array( 'groups_notification_group_invites_subject', array( $subject, &$group ) );
+		$message = apply_filters_ref_array( 'groups_notification_group_invites_message', array( $message, &$group, $inviter_name, $inviter_link, $invites_link, $group_link, $settings_link ) );
 
 		wp_mail( $to, $subject, $message );
-	}
-}
-
-function groups_at_message_notification( $content, $poster_user_id, $group_id, $activity_id ) {
-	global $bp;
-
-	/* Scan for @username strings in an activity update. Notify each user. */
-	$pattern = '/[@]+([A-Za-z0-9-_\.]+)/';
-	preg_match_all( $pattern, $content, $usernames );
-
-	/* Make sure there's only one instance of each username */
-	if ( !$usernames = array_unique( $usernames[1] ) )
-		return false;
-
-	$group = new BP_Groups_Group( $group_id );
-
-	foreach( (array)$usernames as $username ) {
-		if ( !$receiver_user_id = bp_core_get_userid($username) )
-			continue;
 
-		/* Check the user is a member of the group before sending the update. */
-		if ( !groups_is_user_member( $receiver_user_id, $group_id ) )
-			continue;
-
-		// Now email the user with the contents of the message (if they have enabled email notifications)
-		if ( 'no' != get_user_meta( $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_SETTINGS_SLUG . '/notifications/';
-
-			$poster_name = stripslashes( $poster_name );
-			$content = bp_groups_filter_kses( stripslashes( $content ) );
-
-			// Set up and send the message
-			$ud       = bp_core_get_core_userdata( $receiver_user_id );
-			$to       = $ud->user_email;
-			$sitename = wp_specialchars_decode( get_blog_option( BP_ROOT_BLOG, 'blogname' ), ENT_QUOTES );
-			$subject  = '[' . $sitename . '] ' . sprintf( __( '%s mentioned you in the group "%s"', 'buddypress' ), $poster_name, $group->name );
-
-$message = sprintf( __(
-'%s mentioned you in the group "%s":
-
-"%s"
-
-To view and respond to the message, log in and visit: %s
-
----------------------
-', 'buddypress' ), $poster_name, $group->name, $content, $message_link );
-
-			$message .= sprintf( __( 'To disable these notifications please log in and go to: %s', 'buddypress' ), $settings_link );
-
-			/* Send the message */
-			$to = apply_filters( 'groups_at_message_notification_to', $to );
-			$subject = apply_filters( 'groups_at_message_notification_subject', $subject, &$group, $poster_name );
-			$message = apply_filters( 'groups_at_message_notification_message', $message, &$group, $poster_name, $content, $message_link );
-
-			wp_mail( $to, $subject, $message );
-		}
+		do_action( 'bp_groups_sent_invited_email', $invited_user_id, $subject, $message, $group );
 	}
 }
-add_action( 'bp_groups_posted_update', 'groups_at_message_notification', 10, 4 );
-
 
-?>
+?>
\ No newline at end of file
diff --git a/wp-content/plugins/buddypress/bp-groups/bp-groups-screens.php b/wp-content/plugins/buddypress/bp-groups/bp-groups-screens.php
new file mode 100644
index 0000000000000000000000000000000000000000..aaf7980c510daf8babc29a1c2d534af967d48ba3
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-groups/bp-groups-screens.php
@@ -0,0 +1,871 @@
+<?php
+/********************************************************************************
+ * 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.
+ */
+
+// Exit if accessed directly
+if ( !defined( 'ABSPATH' ) ) exit;
+
+function groups_directory_groups_setup() {
+	if ( bp_is_groups_component() && !bp_current_action() && !bp_current_item() ) {
+		bp_update_is_directory( true, 'groups' );
+
+		do_action( 'groups_directory_groups_setup' );
+
+		bp_core_load_template( apply_filters( 'groups_template_directory_groups', 'groups/index' ) );
+	}
+}
+add_action( 'bp_screens', 'groups_directory_groups_setup', 2 );
+
+function groups_screen_my_groups() {
+	global $bp;
+
+	// 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'    );
+	}
+
+	do_action( 'groups_screen_my_groups' );
+
+	bp_core_load_template( apply_filters( 'groups_template_my_groups', 'members/single/home' ) );
+}
+
+function groups_screen_group_invites() {
+	$group_id = (int)bp_action_variable( 1 );
+
+	if ( bp_is_action_variable( 'accept' ) && is_numeric( $group_id ) ) {
+		// Check the nonce
+		if ( !check_admin_referer( 'groups_accept_invite' ) )
+			return false;
+
+		if ( !groups_accept_invite( bp_loggedin_user_id(), $group_id ) ) {
+			bp_core_add_message( __('Group invite could not be accepted', 'buddypress'), 'error' );
+		} else {
+			bp_core_add_message( __('Group invite accepted', 'buddypress') );
+
+			// Record this in activity streams
+			$group = new BP_Groups_Group( $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 ) ),
+				'type'    => 'joined_group',
+				'item_id' => $group->id
+			) );
+		}
+
+		bp_core_redirect( 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
+		if ( !check_admin_referer( 'groups_reject_invite' ) )
+			return false;
+
+		if ( !groups_reject_invite( bp_loggedin_user_id(), $group_id ) )
+			bp_core_add_message( __('Group invite could not be rejected', 'buddypress'), 'error' );
+		else
+			bp_core_add_message( __('Group invite rejected', 'buddypress') );
+
+		bp_core_redirect( bp_loggedin_user_domain() . bp_get_groups_slug() . '/' . bp_current_action() );
+	}
+
+	// Remove notifications
+	bp_core_delete_notifications_by_type( bp_loggedin_user_id(), 'groups', 'group_invite' );
+
+	do_action( 'groups_screen_group_invites', $group_id );
+
+	bp_core_load_template( apply_filters( 'groups_template_group_invites', 'members/single/home' ) );
+}
+
+function groups_screen_group_home() {
+	global $bp;
+
+	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'    );
+		}
+
+		do_action( 'groups_screen_group_home' );
+
+		bp_core_load_template( apply_filters( 'groups_template_group_home', 'groups/single/home' ) );
+	}
+}
+
+/**
+ * This screen function handles actions related to group forums
+ *
+ * @package BuddyPress
+ */
+function groups_screen_group_forum() {
+	global $bp;
+
+	if ( !bp_is_active( 'forums' ) || !bp_forums_is_installed_correctly() )
+		return false;
+
+	if ( bp_action_variable( 0 ) && !bp_is_action_variable( 'topic', 0 ) ) {
+		bp_do_404();
+		return;
+	}
+
+	if ( !$bp->groups->current_group->user_has_access ) {
+		bp_core_no_access();
+		return;
+	}
+
+	if ( bp_is_single_item() ) {
+
+		// Fetch the details we need
+		$topic_slug	= (string)bp_action_variable( 1 );
+		$topic_id       = bp_forums_get_topic_id_from_slug( $topic_slug );
+		$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 ) )
+			$user_is_banned = true;
+
+		if ( !empty( $topic_slug ) && !empty( $topic_id ) ) {
+
+			// Posting a reply
+			if ( !$user_is_banned && !bp_action_variable( 2 ) && isset( $_POST['submit_reply'] ) ) {
+				// Check the nonce
+				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 );
+
+				$topic_page = isset( $_GET['topic_page'] ) ? $_GET['topic_page'] : false;
+
+				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 ( isset( $_SERVER['QUERY_STRING'] ) )
+					$query_vars = '?' . $_SERVER['QUERY_STRING'];
+
+				bp_core_redirect( bp_get_group_permalink( groups_get_current_group() ) . 'forum/topic/' . $topic_slug . '/' . $query_vars . '#post-' . $post_id );
+			}
+
+			// Sticky a topic
+			else if ( bp_is_action_variable( 'stick', 2 ) && ( isset( $bp->is_item_admin ) || isset( $bp->is_item_mod ) ) ) {
+				// Check the nonce
+				check_admin_referer( 'bp_forums_stick_topic' );
+
+				if ( !bp_forums_sticky_topic( array( 'topic_id' => $topic_id ) ) )
+					bp_core_add_message( __( 'There was an error when making that topic a sticky', 'buddypress' ), 'error' );
+				else
+					bp_core_add_message( __( 'The topic was made sticky successfully', 'buddypress' ) );
+
+				do_action( 'groups_stick_forum_topic', $topic_id );
+				bp_core_redirect( wp_get_referer() );
+			}
+
+			// Un-Sticky a topic
+			else if ( bp_is_action_variable( 'unstick', 2 ) && ( isset( $bp->is_item_admin ) || isset( $bp->is_item_mod ) ) ) {
+				// Check the nonce
+				check_admin_referer( 'bp_forums_unstick_topic' );
+
+				if ( !bp_forums_sticky_topic( array( 'topic_id' => $topic_id, 'mode' => 'unstick' ) ) )
+					bp_core_add_message( __( 'There was an error when unsticking that topic', 'buddypress'), 'error' );
+				else
+					bp_core_add_message( __( 'The topic was unstuck successfully', 'buddypress') );
+
+				do_action( 'groups_unstick_forum_topic', $topic_id );
+				bp_core_redirect( wp_get_referer() );
+			}
+
+			// Close a topic
+			else if ( bp_is_action_variable( 'close', 2 ) && ( isset( $bp->is_item_admin ) || isset( $bp->is_item_mod ) ) ) {
+				// Check the nonce
+				check_admin_referer( 'bp_forums_close_topic' );
+
+				if ( !bp_forums_openclose_topic( array( 'topic_id' => $topic_id ) ) )
+					bp_core_add_message( __( 'There was an error when closing that topic', 'buddypress'), 'error' );
+				else
+					bp_core_add_message( __( 'The topic was closed successfully', 'buddypress') );
+
+				do_action( 'groups_close_forum_topic', $topic_id );
+				bp_core_redirect( wp_get_referer() );
+			}
+
+			// Open a topic
+			else if ( bp_is_action_variable( 'open', 2 ) && ( isset( $bp->is_item_admin ) || isset( $bp->is_item_mod ) ) ) {
+				// Check the nonce
+				check_admin_referer( 'bp_forums_open_topic' );
+
+				if ( !bp_forums_openclose_topic( array( 'topic_id' => $topic_id, 'mode' => 'open' ) ) )
+					bp_core_add_message( __( 'There was an error when opening that topic', 'buddypress'), 'error' );
+				else
+					bp_core_add_message( __( 'The topic was opened successfully', 'buddypress') );
+
+				do_action( 'groups_open_forum_topic', $topic_id );
+				bp_core_redirect( wp_get_referer() );
+			}
+
+			// Delete a topic
+			else if ( empty( $user_is_banned ) && bp_is_action_variable( 'delete', 2 ) && !bp_action_variable( 3 ) ) {
+				// Fetch the topic
+				$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 )
+					bp_core_redirect( wp_get_referer() );
+
+				// Check the nonce
+				check_admin_referer( 'bp_forums_delete_topic' );
+
+				do_action( 'groups_before_delete_forum_topic', $topic_id );
+
+				if ( !groups_delete_group_forum_topic( $topic_id ) )
+					bp_core_add_message( __( 'There was an error deleting the topic', 'buddypress' ), 'error' );
+				else
+					bp_core_add_message( __( 'The topic was deleted successfully', 'buddypress' ) );
+
+				do_action( 'groups_delete_forum_topic', $topic_id );
+				bp_core_redirect( bp_get_group_permalink( groups_get_current_group() ) . 'forum/' );
+			}
+
+			// Editing a topic
+			else if ( empty( $user_is_banned ) && bp_is_action_variable( 'edit', 2 ) && !bp_action_variable( 3 ) ) {
+				// Fetch the topic
+				$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 )
+					bp_core_redirect( wp_get_referer() );
+
+				if ( isset( $_POST['save_changes'] ) ) {
+					// Check the nonce
+					check_admin_referer( 'bp_forums_edit_topic' );
+
+					$topic_tags = !empty( $_POST['topic_tags'] ) ? $_POST['topic_tags'] : false;
+
+					if ( !groups_update_group_forum_topic( $topic_id, $_POST['topic_title'], $_POST['topic_text'], $topic_tags ) )
+						bp_core_add_message( __( 'There was an error when editing that topic', 'buddypress'), 'error' );
+					else
+						bp_core_add_message( __( 'The topic was edited successfully', 'buddypress') );
+
+					do_action( 'groups_edit_forum_topic', $topic_id );
+					bp_core_redirect( bp_get_group_permalink( groups_get_current_group() ) . 'forum/topic/' . $topic_slug . '/' );
+				}
+
+				bp_core_load_template( apply_filters( 'groups_template_group_forum_topic_edit', 'groups/single/home' ) );
+			}
+
+			// Delete a post
+			else if ( empty( $user_is_banned ) && bp_is_action_variable( 'delete', 2 ) && $post_id = bp_action_variable( 4 ) ) {
+				// Fetch the post
+				$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 )
+					bp_core_redirect( wp_get_referer() );
+
+				// Check the nonce
+				check_admin_referer( 'bp_forums_delete_post' );
+
+				do_action( 'groups_before_delete_forum_post', $post_id );
+
+				if ( !groups_delete_group_forum_post( $post_id ) )
+					bp_core_add_message( __( 'There was an error deleting that post', 'buddypress'), 'error' );
+				else
+					bp_core_add_message( __( 'The post was deleted successfully', 'buddypress') );
+
+				do_action( 'groups_delete_forum_post', $post_id );
+				bp_core_redirect( wp_get_referer() );
+			}
+
+			// Editing a post
+			else if ( empty( $user_is_banned ) && bp_is_action_variable( 'edit', 2 ) && $post_id = bp_action_variable( 4 ) ) {
+				// Fetch the post
+				$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 )
+					bp_core_redirect( wp_get_referer() );
+
+				if ( isset( $_POST['save_changes'] ) ) {
+					// Check the nonce
+					check_admin_referer( 'bp_forums_edit_post' );
+
+					$topic_page = isset( $_GET['topic_page'] ) ? $_GET['topic_page'] : false;
+
+					if ( !$post_id = groups_update_group_forum_post( $post_id, $_POST['post_text'], $topic_id, $topic_page ) )
+						bp_core_add_message( __( 'There was an error when editing that post', 'buddypress'), 'error' );
+					else
+						bp_core_add_message( __( 'The post was edited successfully', 'buddypress') );
+
+					if ( $_SERVER['QUERY_STRING'] )
+						$query_vars = '?' . $_SERVER['QUERY_STRING'];
+
+					do_action( 'groups_edit_forum_post', $post_id );
+					bp_core_redirect( bp_get_group_permalink( $bp->groups->current_group ) . 'forum/topic/' . $topic_slug . '/' . $query_vars . '#post-' . $post_id );
+				}
+
+				bp_core_load_template( apply_filters( 'groups_template_group_forum_topic_edit', 'groups/single/home' ) );
+			}
+
+			// Standard topic display
+			else {
+				if ( !empty( $user_is_banned ) )
+					bp_core_add_message( __( "You have been banned from this group.", 'buddypress' ) );
+
+				bp_core_load_template( apply_filters( 'groups_template_group_forum_topic', 'groups/single/home' ) );
+			}
+
+		// Forum topic does not exist
+		} elseif ( !empty( $topic_slug ) && empty( $topic_id ) ) {
+			bp_do_404();
+			return;
+
+		} else {
+			// Posting a topic
+			if ( isset( $_POST['submit_topic'] ) && bp_is_active( 'forums' ) ) {
+				// Check the nonce
+				check_admin_referer( 'bp_forums_new_topic' );
+
+				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 ) ) {
+					// 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 );
+				}
+
+				if ( empty( $_POST['topic_title'] ) )
+					$error_message = __( 'Please provide a title for your forum topic.', 'buddypress' );
+				else if ( empty( $_POST['topic_text'] ) )
+					$error_message = __( 'Forum posts cannot be empty. Please enter some text.', 'buddypress' );
+
+				if ( empty( $forum_id ) )
+					$error_message = __( 'This group does not have a forum setup yet.', 'buddypress' );
+
+				if ( isset( $error_message ) ) {
+					bp_core_add_message( $error_message, 'error' );
+					$redirect = bp_get_group_permalink( $bp->groups->current_group ) . 'forum';
+				} else {
+					if ( !$topic = groups_new_group_forum_topic( $_POST['topic_title'], $_POST['topic_text'], $_POST['topic_tags'], $forum_id ) ) {
+						bp_core_add_message( __( 'There was an error when creating the topic', 'buddypress'), 'error' );
+						$redirect = bp_get_group_permalink( $bp->groups->current_group ) . 'forum';
+					} else {
+						bp_core_add_message( __( 'The topic was created successfully', 'buddypress') );
+						$redirect = bp_get_group_permalink( $bp->groups->current_group ) . 'forum/topic/' . $topic->topic_slug . '/';
+					}
+				}
+
+				bp_core_redirect( $redirect );
+			}
+
+			do_action( 'groups_screen_group_forum', $topic_id, $forum_id );
+
+			bp_core_load_template( apply_filters( 'groups_template_group_forum', 'groups/single/home' ) );
+		}
+	}
+}
+
+function groups_screen_group_members() {
+	global $bp;
+
+	if ( $bp->is_single_item ) {
+		// Refresh the group member count meta
+		groups_update_groupmeta( $bp->groups->current_group->id, 'total_member_count', groups_get_total_member_count( $bp->groups->current_group->id ) );
+
+		do_action( 'groups_screen_group_members', $bp->groups->current_group->id );
+		bp_core_load_template( apply_filters( 'groups_template_group_members', 'groups/single/home' ) );
+	}
+}
+
+function groups_screen_group_invite() {
+	global $bp;
+
+	if ( $bp->is_single_item ) {
+		if ( bp_is_action_variable( 'send', 0 ) ) {
+
+			if ( !check_admin_referer( 'groups_send_invites', '_wpnonce_send_invites' ) )
+				return false;
+
+			if ( !empty( $_POST['friends'] ) ) {
+				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 );
+			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 ) );
+
+		} elseif ( !bp_action_variable( 0 ) ) {
+			// Show send invite page
+			bp_core_load_template( apply_filters( 'groups_template_group_invite', 'groups/single/home' ) );
+
+		} else {
+			bp_do_404();
+		}
+	}
+}
+
+function groups_screen_group_request_membership() {
+	global $bp;
+
+	if ( !is_user_logged_in() )
+		return false;
+
+	if ( 'private' == $bp->groups->current_group->status ) {
+		// If the user has submitted a request, send it.
+		if ( isset( $_POST['group-request-send']) ) {
+			// Check the nonce
+			if ( !check_admin_referer( 'groups_request_membership' ) )
+				return false;
+
+			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' ) );
+			}
+			bp_core_redirect( bp_get_group_permalink( $bp->groups->current_group ) );
+		}
+
+		do_action( 'groups_screen_group_request_membership', $bp->groups->current_group->id );
+
+		bp_core_load_template( apply_filters( 'groups_template_group_request_membership', 'groups/single/home' ) );
+	}
+}
+
+function groups_screen_group_activity_permalink() {
+	global $bp;
+
+	if ( !bp_is_groups_component() || !bp_is_active( 'activity' ) || ( bp_is_active( 'activity' ) && !bp_is_current_action( bp_get_activity_slug() ) ) || !bp_action_variable( 0 ) )
+		return false;
+
+	$bp->is_single_item = true;
+
+	bp_core_load_template( apply_filters( 'groups_template_group_home', 'groups/single/home' ) );
+}
+add_action( 'bp_screens', 'groups_screen_group_activity_permalink' );
+
+function groups_screen_group_admin() {
+	if ( !bp_is_groups_component() || !bp_is_current_action( 'admin' ) )
+		return false;
+
+	if ( bp_action_variables() )
+		return false;
+
+	bp_core_redirect( bp_get_group_permalink( groups_get_current_group() ) . 'admin/edit-details/' );
+}
+
+function groups_screen_group_admin_edit_details() {
+	global $bp;
+
+	if ( bp_is_groups_component() && bp_is_action_variable( 'edit-details', 0 ) ) {
+
+		if ( $bp->is_item_admin || $bp->is_item_mod  ) {
+
+			// If the edit form has been submitted, save the edited details
+			if ( isset( $_POST['save'] ) ) {
+				// Check the nonce
+				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'] ) ) {
+					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' ) );
+				}
+
+				do_action( 'groups_group_details_edited', $bp->groups->current_group->id );
+
+				bp_core_redirect( bp_get_group_permalink( groups_get_current_group() ) . 'admin/edit-details/' );
+			}
+
+			do_action( 'groups_screen_group_admin_edit_details', $bp->groups->current_group->id );
+
+			bp_core_load_template( apply_filters( 'groups_template_group_admin', 'groups/single/home' ) );
+		}
+	}
+}
+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 ( !$bp->is_item_admin )
+			return false;
+
+		// If the edit form has been submitted, save the edited details
+		if ( isset( $_POST['save'] ) ) {
+			$enable_forum   = ( isset($_POST['group-show-forum'] ) ) ? 1 : 0;
+
+			// 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';
+
+			// 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';
+
+			// Check the nonce
+			if ( !check_admin_referer( 'groups_edit_group_settings' ) )
+				return false;
+
+			if ( !groups_edit_group_settings( $_POST['group-id'], $enable_forum, $status, $invite_status ) ) {
+				bp_core_add_message( __( 'There was an error updating group settings, please try again.', 'buddypress' ), 'error' );
+			} else {
+				bp_core_add_message( __( 'Group settings were successfully updated.', 'buddypress' ) );
+			}
+
+			do_action( 'groups_group_settings_edited', $bp->groups->current_group->id );
+
+			bp_core_redirect( bp_get_group_permalink( groups_get_current_group() ) . 'admin/group-settings/' );
+		}
+
+		do_action( 'groups_screen_group_admin_settings', $bp->groups->current_group->id );
+
+		bp_core_load_template( apply_filters( 'groups_template_group_admin_settings', 'groups/single/home' ) );
+	}
+}
+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 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' ) )
+			return false;
+
+		// If the group admin has deleted the admin avatar
+		if ( bp_is_action_variable( 'delete', 1 ) ) {
+
+			// Check the nonce
+			check_admin_referer( 'bp_group_avatar_delete' );
+
+			if ( bp_core_delete_existing_avatar( array( 'item_id' => $bp->groups->current_group->id, 'object' => 'group' ) ) )
+				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' );
+
+		}
+
+		$bp->avatar_admin->step = 'upload-image';
+
+		if ( !empty( $_FILES ) ) {
+
+			// Check the nonce
+			check_admin_referer( 'bp_avatar_upload' );
+
+			// Pass the file to the avatar upload handler
+			if ( bp_core_avatar_handle_upload( $_FILES, 'groups_avatar_upload_dir' ) ) {
+				$bp->avatar_admin->step = 'crop-image';
+
+				// Make sure we include the jQuery jCrop file for image cropping
+				add_action( 'wp_print_scripts', 'bp_core_add_jquery_cropper' );
+			}
+
+		}
+
+		// If the image cropping is done, crop the image and save a full/thumb version
+		if ( isset( $_POST['avatar-crop-submit'] ) ) {
+
+			// Check the nonce
+			check_admin_referer( 'bp_avatar_cropstore' );
+
+			if ( !bp_core_avatar_handle_crop( array( 'object' => 'group', 'avatar_dir' => 'group-avatars', 'item_id' => $bp->groups->current_group->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 the avatar, please try uploading it again', 'buddypress' ) );
+			else
+				bp_core_add_message( __( 'The new group avatar was uploaded successfully!', 'buddypress' ) );
+
+		}
+
+		do_action( 'groups_screen_group_admin_avatar', $bp->groups->current_group->id );
+
+		bp_core_load_template( apply_filters( 'groups_template_group_admin_avatar', 'groups/single/home' ) );
+	}
+}
+add_action( 'bp_screens', 'groups_screen_group_admin_avatar' );
+
+/**
+ * This function handles actions related to member management on the group admin.
+ *
+ * @package BuddyPress
+ */
+function groups_screen_group_admin_manage_members() {
+	global $bp;
+
+	if ( bp_is_groups_component() && bp_is_action_variable( 'manage-members', 0 ) ) {
+
+		if ( !$bp->is_item_admin )
+			return false;
+
+		if ( bp_action_variable( 1 ) && bp_action_variable( 2 ) && bp_action_variable( 3 ) ) {
+			if ( bp_is_action_variable( 'promote', 1 ) && ( bp_is_action_variable( 'mod', 2 ) || bp_is_action_variable( 'admin', 2 ) ) && is_numeric( bp_action_variable( 3 ) ) ) {
+				$user_id = bp_action_variable( 3 );
+				$status  = bp_action_variable( 2 );
+
+				// Check the nonce first.
+				if ( !check_admin_referer( 'groups_promote_member' ) )
+					return false;
+
+				// Promote a user.
+				if ( !groups_promote_member( $user_id, $bp->groups->current_group->id, $status ) )
+					bp_core_add_message( __( 'There was an error when promoting that user, please try again', 'buddypress' ), 'error' );
+				else
+					bp_core_add_message( __( 'User promoted successfully', 'buddypress' ) );
+
+				do_action( 'groups_promoted_member', $user_id, $bp->groups->current_group->id );
+
+				bp_core_redirect( bp_get_group_permalink( groups_get_current_group() ) . 'admin/manage-members/' );
+			}
+		}
+
+		if ( bp_action_variable( 1 ) && bp_action_variable( 2 ) ) {
+			if ( bp_is_action_variable( 'demote', 1 ) && is_numeric( bp_action_variable( 2 ) ) ) {
+				$user_id = bp_action_variable( 2 );
+
+				// Check the nonce first.
+				if ( !check_admin_referer( 'groups_demote_member' ) )
+					return false;
+
+				// 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 == $user_id )
+					bp_core_add_message( __( 'This group must have at least one admin', 'buddypress' ), 'error' );
+
+				// Demote a user.
+				elseif ( !groups_demote_member( $user_id, $bp->groups->current_group->id ) )
+					bp_core_add_message( __( 'There was an error when demoting that user, please try again', 'buddypress' ), 'error' );
+				else
+					bp_core_add_message( __( 'User demoted successfully', 'buddypress' ) );
+
+				do_action( 'groups_demoted_member', $user_id, $bp->groups->current_group->id );
+
+				bp_core_redirect( bp_get_group_permalink( groups_get_current_group() ) . 'admin/manage-members/' );
+			}
+
+			if ( bp_is_action_variable( 'ban', 1 ) && is_numeric( bp_action_variable( 2 ) ) ) {
+				$user_id = bp_action_variable( 2 );
+
+				// Check the nonce first.
+				if ( !check_admin_referer( 'groups_ban_member' ) )
+					return false;
+
+				// Ban a user.
+				if ( !groups_ban_member( $user_id, $bp->groups->current_group->id ) )
+					bp_core_add_message( __( 'There was an error when banning that user, please try again', 'buddypress' ), 'error' );
+				else
+					bp_core_add_message( __( 'User banned successfully', 'buddypress' ) );
+
+				do_action( 'groups_banned_member', $user_id, $bp->groups->current_group->id );
+
+				bp_core_redirect( bp_get_group_permalink( groups_get_current_group() ) . 'admin/manage-members/' );
+			}
+
+			if ( bp_is_action_variable( 'unban', 1 ) && is_numeric( bp_action_variable( 2 ) ) ) {
+				$user_id = bp_action_variable( 2 );
+
+				// Check the nonce first.
+				if ( !check_admin_referer( 'groups_unban_member' ) )
+					return false;
+
+				// Remove a ban for user.
+				if ( !groups_unban_member( $user_id, $bp->groups->current_group->id ) )
+					bp_core_add_message( __( 'There was an error when unbanning that user, please try again', 'buddypress' ), 'error' );
+				else
+					bp_core_add_message( __( 'User ban removed successfully', 'buddypress' ) );
+
+				do_action( 'groups_unbanned_member', $user_id, $bp->groups->current_group->id );
+
+				bp_core_redirect( bp_get_group_permalink( groups_get_current_group() ) . 'admin/manage-members/' );
+			}
+
+			if ( bp_is_action_variable( 'remove', 1 ) && is_numeric( bp_action_variable( 2 ) ) ) {
+				$user_id = bp_action_variable( 2 );
+
+				// Check the nonce first.
+				if ( !check_admin_referer( 'groups_remove_member' ) )
+					return false;
+
+				// Remove a user.
+				if ( !groups_remove_member( $user_id, $bp->groups->current_group->id ) )
+					bp_core_add_message( __( 'There was an error removing that user from the group, please try again', 'buddypress' ), 'error' );
+				else
+					bp_core_add_message( __( 'User removed successfully', 'buddypress' ) );
+
+				do_action( 'groups_removed_member', $user_id, $bp->groups->current_group->id );
+
+				bp_core_redirect( bp_get_group_permalink( groups_get_current_group() ) . 'admin/manage-members/' );
+			}
+		}
+
+		do_action( 'groups_screen_group_admin_manage_members', $bp->groups->current_group->id );
+
+		bp_core_load_template( apply_filters( 'groups_template_group_admin_manage_members', 'groups/single/home' ) );
+	}
+}
+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 ( !$bp->is_item_admin || 'public' == $bp->groups->current_group->status )
+			return false;
+
+		// Remove any screen notifications
+		bp_core_delete_notifications_by_type( bp_loggedin_user_id(), $bp->groups->id, 'new_membership_request' );
+
+		$request_action = (string)bp_action_variable( 1 );
+		$membership_id  = (int)bp_action_variable( 2 );
+
+		if ( !empty( $request_action ) && !empty( $membership_id ) ) {
+			if ( 'accept' == $request_action && is_numeric( $membership_id ) ) {
+
+				// Check the nonce first.
+				if ( !check_admin_referer( 'groups_accept_membership_request' ) )
+					return false;
+
+				// Accept the membership request
+				if ( !groups_accept_membership_request( $membership_id ) )
+					bp_core_add_message( __( 'There was an error accepting the membership request, please try again.', 'buddypress' ), 'error' );
+				else
+					bp_core_add_message( __( 'Group membership request accepted', 'buddypress' ) );
+
+			} elseif ( 'reject' == $request_action && is_numeric( $membership_id ) ) {
+				/* Check the nonce first. */
+				if ( !check_admin_referer( 'groups_reject_membership_request' ) )
+					return false;
+
+				// Reject the membership request
+				if ( !groups_reject_membership_request( $membership_id ) )
+					bp_core_add_message( __( 'There was an error rejecting the membership request, please try again.', 'buddypress' ), 'error' );
+				else
+					bp_core_add_message( __( 'Group membership request rejected', 'buddypress' ) );
+			}
+
+			do_action( 'groups_group_request_managed', $bp->groups->current_group->id, $request_action, $membership_id );
+			bp_core_redirect( bp_get_group_permalink( groups_get_current_group() ) . 'admin/membership-requests/' );
+		}
+
+		do_action( 'groups_screen_group_admin_requests', $bp->groups->current_group->id );
+		bp_core_load_template( apply_filters( 'groups_template_group_admin_requests', 'groups/single/home' ) );
+	}
+}
+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 ( !$bp->is_item_admin && !is_super_admin() )
+			return false;
+
+		if ( isset( $_REQUEST['delete-group-button'] ) && isset( $_REQUEST['delete-group-understand'] ) ) {
+			// Check the nonce first.
+			if ( !check_admin_referer( 'groups_delete_group' ) )
+				return false;
+
+			do_action( 'groups_before_group_deleted', $bp->groups->current_group->id );
+
+			// Group admin has deleted the group, now do it.
+			if ( !groups_delete_group( $bp->groups->current_group->id ) ) {
+				bp_core_add_message( __( 'There was an error deleting the group, please try again.', 'buddypress' ), 'error' );
+			} else {
+				bp_core_add_message( __( 'The group was deleted successfully', 'buddypress' ) );
+
+				do_action( 'groups_group_deleted', $bp->groups->current_group->id );
+
+				bp_core_redirect( bp_loggedin_user_domain() . bp_get_groups_slug() . '/' );
+			}
+
+			bp_core_redirect( bp_loggedin_user_domain() . bp_get_groups_slug() );
+		}
+
+		do_action( 'groups_screen_group_admin_delete_group', $bp->groups->current_group->id );
+
+		bp_core_load_template( apply_filters( 'groups_template_group_admin_delete_group', 'groups/single/home' ) );
+	}
+}
+add_action( 'bp_screens', 'groups_screen_group_admin_delete_group' );
+
+/**
+ * Renders the group settings fields on the Notification Settings page
+ *
+ * @package BuddyPress
+ */
+function groups_screen_notification_settings() {
+	global $bp;
+
+	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 ) )
+		$group_update  = 'yes';
+
+	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 ) )
+		$group_request = 'yes';
+?>
+
+	<table class="notification-settings" id="groups-notification-settings">
+		<thead>
+			<tr>
+				<th class="icon"></th>
+				<th class="title"><?php _e( 'Groups', 'buddypress' ) ?></th>
+				<th class="yes"><?php _e( 'Yes', 'buddypress' ) ?></th>
+				<th class="no"><?php _e( 'No', 'buddypress' )?></th>
+			</tr>
+		</thead>
+
+		<tbody>
+			<tr id="groups-notification-settings-invitation">
+				<td></td>
+				<td><?php _e( 'A member invites you to join a group', 'buddypress' ) ?></td>
+				<td class="yes"><input type="radio" name="notifications[notification_groups_invite]" value="yes" <?php checked( $group_invite, 'yes', true ) ?>/></td>
+				<td class="no"><input type="radio" name="notifications[notification_groups_invite]" value="no" <?php checked( $group_invite, 'no', true ) ?>/></td>
+			</tr>
+			<tr id="groups-notification-settings-info-updated">
+				<td></td>
+				<td><?php _e( 'Group information is updated', 'buddypress' ) ?></td>
+				<td class="yes"><input type="radio" name="notifications[notification_groups_group_updated]" value="yes" <?php checked( $group_update, 'yes', true ) ?>/></td>
+				<td class="no"><input type="radio" name="notifications[notification_groups_group_updated]" value="no" <?php checked( $group_update, 'no', true ) ?>/></td>
+			</tr>
+			<tr id="groups-notification-settings-promoted">
+				<td></td>
+				<td><?php _e( 'You are promoted to a group administrator or moderator', 'buddypress' ) ?></td>
+				<td class="yes"><input type="radio" name="notifications[notification_groups_admin_promotion]" value="yes" <?php checked( $group_promo, 'yes', true ) ?>/></td>
+				<td class="no"><input type="radio" name="notifications[notification_groups_admin_promotion]" value="no" <?php checked( $group_promo, 'no', true ) ?>/></td>
+			</tr>
+			<tr id="groups-notification-settings-request">
+				<td></td>
+				<td><?php _e( 'A member requests to join a private group for which you are an admin', 'buddypress' ) ?></td>
+				<td class="yes"><input type="radio" name="notifications[notification_groups_membership_request]" value="yes" <?php checked( $group_request, 'yes', true ) ?>/></td>
+				<td class="no"><input type="radio" name="notifications[notification_groups_membership_request]" value="no" <?php checked( $group_request, 'no', true ) ?>/></td>
+			</tr>
+
+			<?php do_action( 'groups_screen_notification_settings' ); ?>
+
+		</tbody>
+	</table>
+
+<?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
new file mode 100644
index 0000000000000000000000000000000000000000..87f63b322f009ec4e2129c13eca76e78ad52e7ae
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-groups/bp-groups-template.php
@@ -0,0 +1,2860 @@
+<?php
+// Exit if accessed directly
+if ( !defined( 'ABSPATH' ) ) exit;
+
+/**
+ * Output the groups component slug
+ *
+ * @package BuddyPress
+ * @subpackage Groups Template
+ * @since 1.5
+ *
+ * @uses bp_get_groups_slug()
+ */
+function bp_groups_slug() {
+	echo bp_get_groups_slug();
+}
+	/**
+	 * Return the groups component slug
+	 *
+	 * @package BuddyPress
+	 * @subpackage Groups Template
+	 * @since 1.5
+	 */
+	function bp_get_groups_slug() {
+		global $bp;
+		return apply_filters( 'bp_get_groups_slug', $bp->groups->slug );
+	}
+
+/**
+ * Output the groups component root slug
+ *
+ * @package BuddyPress
+ * @subpackage Groups Template
+ * @since 1.5
+ *
+ * @uses bp_get_groups_root_slug()
+ */
+function bp_groups_root_slug() {
+	echo bp_get_groups_root_slug();
+}
+	/**
+	 * Return the groups component root slug
+	 *
+	 * @package BuddyPress
+	 * @subpackage Groups Template
+	 * @since 1.5
+	 */
+	function bp_get_groups_root_slug() {
+		global $bp;
+		return apply_filters( 'bp_get_groups_root_slug', $bp->groups->root_slug );
+	}
+
+/**
+ * Output group directory permalink
+ *
+ * @package BuddyPress
+ * @subpackage Groups Template
+ * @since 1.5
+ * @uses bp_get_groups_directory_permalink()
+ */
+function bp_groups_directory_permalink() {
+	echo bp_get_groups_directory_permalink();
+}
+	/**
+	 * Return group directory permalink
+	 *
+	 * @package BuddyPress
+	 * @subpackage Groups Template
+	 * @since 1.5
+	 * @uses apply_filters()
+	 * @uses traisingslashit()
+	 * @uses bp_get_root_domain()
+	 * @uses bp_get_groups_root_slug()
+	 * @return string
+	 */
+	function bp_get_groups_directory_permalink() {
+		return apply_filters( 'bp_get_groups_directory_permalink', trailingslashit( bp_get_root_domain() . '/' . bp_get_groups_root_slug() ) );
+	}
+
+/*****************************************************************************
+ * Groups Template Class/Tags
+ **/
+
+class BP_Groups_Template {
+	var $current_group = -1;
+	var $group_count;
+	var $groups;
+	var $group;
+
+	var $in_the_loop;
+
+	var $pag_page;
+	var $pag_num;
+	var $pag_links;
+	var $total_group_count;
+
+	var $single_group = false;
+
+	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;
+
+		$this->pag_page = isset( $_REQUEST['grpage'] ) ? intval( $_REQUEST['grpage'] ) : $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 ) )
+			$show_hidden = true;
+
+		if ( 'invites' == $type ) {
+			$this->groups = groups_get_invites_for_user( $user_id, $this->pag_num, $this->pag_page, $exclude );
+		} else if ( 'single-group' == $type ) {
+			$group           = new stdClass;
+			$group->group_id = BP_Groups_Group::get_id_from_slug( $slug );
+			$this->groups    = array( $group );
+		} else {
+			$this->groups = groups_get_groups( array(
+				'type'            => $type,
+				'per_page'        => $this->pag_num,
+				'page'            => $this->pag_page,
+				'user_id'         => $user_id,
+				'search_terms'    => $search_terms,
+				'include'         => $include,
+				'exclude'         => $exclude,
+				'populate_extras' => $populate_extras,
+				'show_hidden'     => $show_hidden
+			) );
+		}
+
+		if ( 'invites' == $type ) {
+			$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'];
+			} else {
+				$this->total_group_count = (int)$max;
+			}
+
+			$this->groups = $this->groups['groups'];
+
+			if ( !empty( $max ) ) {
+				if ( $max >= count( $this->groups ) ) {
+					$this->group_count = count( $this->groups );
+				} else {
+					$this->group_count = (int)$max;
+				}
+			} else {
+				$this->group_count = count( $this->groups );
+			}
+		}
+
+		// Build pagination links
+		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 ) ),
+				'format'    => '',
+				'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' ),
+				'mid_size'  => 1
+			) );
+		}
+	}
+
+	function has_groups() {
+		if ( $this->group_count )
+			return true;
+
+		return false;
+	}
+
+	function next_group() {
+		$this->current_group++;
+		$this->group = $this->groups[$this->current_group];
+
+		return $this->group;
+	}
+
+	function rewind_groups() {
+		$this->current_group = -1;
+		if ( $this->group_count > 0 ) {
+			$this->group = $this->groups[0];
+		}
+	}
+
+	function groups() {
+		if ( $this->current_group + 1 < $this->group_count ) {
+			return true;
+		} elseif ( $this->current_group + 1 == $this->group_count ) {
+			do_action('group_loop_end');
+			// Do some cleaning up after the loop
+			$this->rewind_groups();
+		}
+
+		$this->in_the_loop = false;
+		return false;
+	}
+
+	function the_group() {
+		global $group;
+
+		$this->in_the_loop = true;
+		$this->group = $this->next_group();
+
+		if ( $this->single_group )
+			$this->group = new BP_Groups_Group( $this->group->group_id );
+
+		if ( 0 == $this->current_group ) // loop has just started
+			do_action('group_loop_start');
+	}
+}
+
+function bp_has_groups( $args = '' ) {
+	global $groups_template, $bp;
+
+	/***
+	 * Set the defaults based on the current page. Any of these will be overridden
+	 * if arguments are directly passed into the loop. Custom plugins should always
+	 * pass their parameters directly to the loop.
+	 */
+	$slug    = false;
+	$type    = 'active';
+	$user_id = 0;
+	$order   = '';
+
+	// User filtering
+	if ( !empty( $bp->displayed_user->id ) )
+		$user_id = $bp->displayed_user->id;
+
+	// Type
+	if ( 'my-groups' == $bp->current_action ) {
+		if ( 'most-popular' == $order ) {
+			$type = 'popular';
+		} elseif ( 'alphabetically' == $order ) {
+			$type = 'alphabetical';
+		}
+	} elseif ( 'invites' == $bp->current_action ) {
+		$type = 'invites';
+	} elseif ( isset( $bp->groups->current_group->slug ) && $bp->groups->current_group->slug ) {
+		$type = 'single-group';
+		$slug = $bp->groups->current_group->slug;
+	}
+
+	$defaults = array(
+		'type'            => $type,
+		'page'            => 1,
+		'per_page'        => 20,
+		'max'             => false,
+		'show_hidden'     => false,
+
+		'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
+		'include'         => false,    // Pass comma separated list or array of group ID's to return only these groups
+		'exclude'         => false,    // Pass comma separated list or array of group ID's to exclude these groups
+
+		'populate_extras' => true      // Get extra meta - is_member, is_banned
+	);
+
+	$r = wp_parse_args( $args, $defaults );
+	extract( $r );
+
+	if ( empty( $search_terms ) ) {
+		if ( isset( $_REQUEST['group-filter-box'] ) && !empty( $_REQUEST['group-filter-box'] ) )
+			$search_terms = $_REQUEST['group-filter-box'];
+		elseif ( isset( $_REQUEST['s'] ) && !empty( $_REQUEST['s'] ) )
+			$search_terms = $_REQUEST['s'];
+		else
+			$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 );
+	return apply_filters( 'bp_has_groups', $groups_template->has_groups(), $groups_template );
+}
+
+function bp_groups() {
+	global $groups_template;
+	return $groups_template->groups();
+}
+
+function bp_the_group() {
+	global $groups_template;
+	return $groups_template->the_group();
+}
+
+function bp_group_is_visible( $group = false ) {
+	global $bp, $groups_template;
+
+	if ( $bp->loggedin_user->is_super_admin )
+		return true;
+
+	if ( !$group )
+		$group =& $groups_template->group;
+
+	if ( 'public' == $group->status ) {
+		return true;
+	} else {
+		if ( groups_is_user_member( $bp->loggedin_user->id, $group->id ) ) {
+			return true;
+		}
+	}
+
+	return false;
+}
+
+function bp_group_id() {
+	echo bp_get_group_id();
+}
+	function bp_get_group_id( $group = false ) {
+		global $groups_template;
+
+		if ( !$group )
+			$group =& $groups_template->group;
+
+		return apply_filters( 'bp_get_group_id', $group->id );
+	}
+
+function bp_group_name() {
+	echo bp_get_group_name();
+}
+	function bp_get_group_name( $group = false ) {
+		global $groups_template;
+
+		if ( !$group )
+			$group =& $groups_template->group;
+
+		return apply_filters( 'bp_get_group_name', $group->name );
+	}
+
+function bp_group_type() {
+	echo bp_get_group_type();
+}
+	function bp_get_group_type( $group = false ) {
+		global $groups_template;
+
+		if ( !$group )
+			$group =& $groups_template->group;
+
+		if ( 'public' == $group->status ) {
+			$type = __( "Public Group", "buddypress" );
+		} else if ( 'hidden' == $group->status ) {
+			$type = __( "Hidden Group", "buddypress" );
+		} else if ( 'private' == $group->status ) {
+			$type = __( "Private Group", "buddypress" );
+		} else {
+			$type = ucwords( $group->status ) . ' ' . __( 'Group', 'buddypress' );
+		}
+
+		return apply_filters( 'bp_get_group_type', $type );
+	}
+
+function bp_group_status() {
+	echo bp_get_group_status();
+}
+	function bp_get_group_status( $group = false ) {
+		global $groups_template;
+
+		if ( !$group )
+			$group =& $groups_template->group;
+
+		return apply_filters( 'bp_get_group_status', $group->status );
+	}
+
+function bp_group_avatar( $args = '' ) {
+	echo bp_get_group_avatar( $args );
+}
+	function bp_get_group_avatar( $args = '' ) {
+		global $bp, $groups_template;
+
+		$defaults = array(
+			'type' => 'full',
+			'width' => false,
+			'height' => false,
+			'class' => 'avatar',
+			'id' => false,
+			'alt' => __( 'Group logo of %s', 'buddypress' )
+		);
+
+		$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 ) ) )
+			$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 );
+	}
+
+function bp_group_avatar_thumb() {
+	echo bp_get_group_avatar_thumb();
+}
+	function bp_get_group_avatar_thumb( $group = false ) {
+		return bp_get_group_avatar( 'type=thumb' );
+	}
+
+function bp_group_avatar_mini() {
+	echo bp_get_group_avatar_mini();
+}
+	function bp_get_group_avatar_mini( $group = false ) {
+		return bp_get_group_avatar( 'type=thumb&width=30&height=30' );
+	}
+
+function bp_group_last_active() {
+	echo bp_get_group_last_active();
+}
+	function bp_get_group_last_active( $group = false ) {
+		global $groups_template;
+
+		if ( !$group )
+			$group =& $groups_template->group;
+
+		$last_active = $group->last_activity;
+
+		if ( !$last_active )
+			$last_active = groups_get_groupmeta( $group->id, 'last_activity' );
+
+		if ( empty( $last_active ) ) {
+			return __( 'not yet active', 'buddypress' );
+		} else {
+			return apply_filters( 'bp_get_group_last_active', bp_core_time_since( $last_active ) );
+		}
+	}
+
+function bp_group_permalink() {
+	echo bp_get_group_permalink();
+}
+	function bp_get_group_permalink( $group = false ) {
+		global $groups_template, $bp;
+
+		if ( !$group )
+			$group =& $groups_template->group;
+
+		return apply_filters( 'bp_get_group_permalink', 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;
+
+		if ( !$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' );
+	}
+
+function bp_group_slug() {
+	echo bp_get_group_slug();
+}
+	function bp_get_group_slug( $group = false ) {
+		global $groups_template;
+
+		if ( !$group )
+			$group =& $groups_template->group;
+
+		return apply_filters( 'bp_get_group_slug', $group->slug );
+	}
+
+function bp_group_description() {
+	echo bp_get_group_description();
+}
+	function bp_get_group_description( $group = false ) {
+		global $groups_template;
+
+		if ( !$group )
+			$group =& $groups_template->group;
+
+		return apply_filters( 'bp_get_group_description', stripslashes($group->description) );
+	}
+
+function bp_group_description_editable() {
+	echo bp_get_group_description_editable();
+}
+	function bp_get_group_description_editable( $group = false ) {
+		global $groups_template;
+
+		if ( !$group )
+			$group =& $groups_template->group;
+
+		return apply_filters( 'bp_get_group_description_editable', $group->description );
+	}
+
+function bp_group_description_excerpt() {
+	echo bp_get_group_description_excerpt();
+}
+	function bp_get_group_description_excerpt( $group = false ) {
+		global $groups_template;
+
+		if ( !$group )
+			$group =& $groups_template->group;
+
+		return apply_filters( 'bp_get_group_description_excerpt', bp_create_excerpt( $group->description ) );
+	}
+
+
+function bp_group_public_status() {
+	echo bp_get_group_public_status();
+}
+	function bp_get_group_public_status( $group = false ) {
+		global $groups_template;
+
+		if ( !$group )
+			$group =& $groups_template->group;
+
+		if ( $group->is_public ) {
+			return __( 'Public', 'buddypress' );
+		} else {
+			return __( 'Private', 'buddypress' );
+		}
+	}
+
+function bp_group_is_public() {
+	echo bp_get_group_is_public();
+}
+	function bp_get_group_is_public( $group = false ) {
+		global $groups_template;
+
+		if ( !$group )
+			$group =& $groups_template->group;
+
+		return apply_filters( 'bp_get_group_is_public', $group->is_public );
+	}
+
+function bp_group_date_created() {
+	echo bp_get_group_date_created();
+}
+	function bp_get_group_date_created( $group = false ) {
+		global $groups_template;
+
+		if ( !$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;
+}
+
+function bp_group_is_mod() {
+	global $bp;
+
+	return $bp->is_item_mod;
+}
+
+function bp_group_list_admins( $group = false ) {
+	global $groups_template;
+
+	if ( !$group )
+		$group =& $groups_template->group;
+
+	if ( $group->admins ) { ?>
+		<ul id="group-admins">
+			<?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>
+				</li>
+			<?php } ?>
+		</ul>
+	<?php } else { ?>
+		<span class="activity"><?php _e( 'No Admins', 'buddypress' ) ?></span>
+	<?php } ?>
+<?php
+}
+
+function bp_group_list_mods( $group = false ) {
+	global $groups_template;
+
+	if ( empty( $group ) )
+		$group =& $groups_template->group;
+
+	if ( !empty( $group->mods ) ) : ?>
+
+		<ul id="group-mods">
+
+			<?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>
+				</li>
+
+			<?php } ?>
+
+		</ul>
+
+<?php else : ?>
+
+		<span class="activity"><?php _e( 'No Mods', 'buddypress' ) ?></span>
+
+<?php endif;
+
+}
+
+/**
+ * Return a list of user_ids for a group's admins
+ *
+ * @package BuddyPress
+ * @since 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
+ * @return mixed $admin_ids A string or array of user_ids
+ */
+function bp_group_admin_ids( $group = false, $format = 'string' ) {
+	global $groups_template;
+
+	if ( !$group )
+		$group =& $groups_template->group;
+
+	$admin_ids = array();
+
+	if ( $group->admins ) {
+		foreach( $group->admins as $admin ) {
+			$admin_ids[] = $admin->user_id;
+		}
+	}
+
+	if ( 'string' == $format )
+		$admin_ids = implode( ',', $admin_ids );
+
+	return apply_filters( 'bp_group_admin_ids', $admin_ids );
+}
+
+/**
+ * Return a list of user_ids for a group's moderators
+ *
+ * @package BuddyPress
+ * @since 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
+ * @return mixed $mod_ids A string or array of user_ids
+ */
+function bp_group_mod_ids( $group = false, $format = 'string' ) {
+	global $groups_template;
+
+	if ( !$group )
+		$group =& $groups_template->group;
+
+	$mod_ids = array();
+
+	if ( $group->mods ) {
+		foreach( $group->mods as $mod ) {
+			$mod_ids[] = $mod->user_id;
+		}
+	}
+
+	if ( 'string' == $format )
+		$mod_ids = implode( ',', $mod_ids );
+
+	return apply_filters( 'bp_group_mod_ids', $mod_ids );
+}
+
+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;
+
+		if ( !$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;
+
+	$action = $bp->displayed_user->domain . bp_get_groups_slug() . '/my-groups/search/';
+	$label = __('Filter Groups', 'buddypress');
+	$name = 'group-filter-box';
+
+?>
+	<form action="<?php echo $action ?>" id="group-search-form" method="post">
+		<label for="<?php echo $name ?>" id="<?php echo $name ?>-label"><?php echo $label ?></label>
+		<input type="search" name="<?php echo $name ?>" id="<?php echo $name ?>" value="<?php echo $value ?>"<?php echo $disabled ?> />
+
+		<?php wp_nonce_field( 'group-filter-box', '_wpnonce_group_filter' ) ?>
+	</form>
+<?php
+}
+
+function bp_group_show_no_groups_message() {
+	global $bp;
+
+	if ( !groups_total_groups_for_user( $bp->displayed_user->id ) )
+		return true;
+
+	return false;
+}
+
+function bp_group_is_activity_permalink() {
+
+	if ( !bp_is_single_item() || !bp_is_groups_component() || !bp_is_current_action( bp_get_activity_slug() ) )
+		return false;
+
+	return true;
+}
+
+function bp_groups_pagination_links() {
+	echo bp_get_groups_pagination_links();
+}
+	function bp_get_groups_pagination_links() {
+		global $groups_template;
+
+		return apply_filters( 'bp_get_groups_pagination_links', $groups_template->pag_links );
+	}
+
+function bp_groups_pagination_count() {
+	echo bp_get_groups_pagination_count();
+}
+	function bp_get_groups_pagination_count() {
+		global $bp, $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 );
+
+		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 ) );
+	}
+
+function bp_groups_auto_join() {
+	global $bp;
+
+	return apply_filters( 'bp_groups_auto_join', (bool)$bp->groups->auto_join );
+}
+
+function bp_group_total_members( $group = false ) {
+	echo bp_get_group_total_members( $group );
+}
+	function bp_get_group_total_members( $group = false ) {
+		global $groups_template;
+
+		if ( !$group )
+			$group =& $groups_template->group;
+
+		return apply_filters( 'bp_get_group_total_members', $group->total_member_count );
+	}
+
+function bp_group_member_count() {
+	echo bp_get_group_member_count();
+}
+	function bp_get_group_member_count() {
+		global $groups_template;
+
+		if ( 1 == (int) $groups_template->group->total_member_count )
+			return apply_filters( 'bp_get_group_member_count', sprintf( __( '%s member', 'buddypress' ), bp_core_number_format( $groups_template->group->total_member_count ) ) );
+		else
+			return apply_filters( 'bp_get_group_member_count', sprintf( __( '%s members', 'buddypress' ), bp_core_number_format( $groups_template->group->total_member_count ) ) );
+	}
+
+function bp_group_forum_permalink() {
+	echo bp_get_group_forum_permalink();
+}
+	function bp_get_group_forum_permalink( $group = false ) {
+		global $groups_template;
+
+		if ( !$group )
+			$group =& $groups_template->group;
+
+		return apply_filters( 'bp_get_group_forum_permalink', bp_get_group_permalink( $group ) . 'forum' );
+	}
+
+function bp_group_forum_topic_count( $args = '' ) {
+	echo bp_get_group_forum_topic_count( $args );
+}
+	function bp_get_group_forum_topic_count( $args = '' ) {
+		global $groups_template;
+
+		$defaults = array(
+			'showtext' => false
+		);
+
+		$r = wp_parse_args( $args, $defaults );
+		extract( $r, EXTR_SKIP );
+
+		if ( !$forum_id = groups_get_groupmeta( $groups_template->group->id, 'forum_id' ) )
+			return false;
+
+		if ( !bp_is_active( 'forums' ) )
+			return false;
+
+		if ( !$groups_template->group->forum_counts )
+			$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 )
+				$total_topics = sprintf( __( '%d topic', 'buddypress' ), (int) $groups_template->group->forum_counts[0]->topics );
+			else
+				$total_topics = sprintf( __( '%d topics', 'buddypress' ), (int) $groups_template->group->forum_counts[0]->topics );
+		} else {
+			$total_topics = (int) $groups_template->group->forum_counts[0]->topics;
+		}
+
+		return apply_filters( 'bp_get_group_forum_topic_count', $total_topics, (bool)$showtext );
+	}
+
+function bp_group_forum_post_count( $args = '' ) {
+	echo bp_get_group_forum_post_count( $args );
+}
+	function bp_get_group_forum_post_count( $args = '' ) {
+		global $groups_template;
+
+		$defaults = array(
+			'showtext' => false
+		);
+
+		$r = wp_parse_args( $args, $defaults );
+		extract( $r, EXTR_SKIP );
+
+		if ( !$forum_id = groups_get_groupmeta( $groups_template->group->id, 'forum_id' ) )
+			return false;
+
+		if ( !bp_is_active( 'forums' ) )
+			return false;
+
+		if ( !$groups_template->group->forum_counts )
+			$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 )
+				$total_posts = sprintf( __( '%d post', 'buddypress' ), (int) $groups_template->group->forum_counts[0]->posts );
+			else
+				$total_posts = sprintf( __( '%d posts', 'buddypress' ), (int) $groups_template->group->forum_counts[0]->posts );
+		} else {
+			$total_posts = (int) $groups_template->group->forum_counts[0]->posts;
+		}
+
+		return apply_filters( 'bp_get_group_forum_post_count', $total_posts, (bool)$showtext );
+	}
+
+function bp_group_is_forum_enabled( $group = false ) {
+	global $groups_template;
+
+	if ( !$group )
+		$group =& $groups_template->group;
+
+	if ( bp_is_active( 'forums' ) ) {
+		if ( bp_forums_is_installed_correctly() ) {
+			if ( $group->enable_forum )
+				return true;
+
+			return false;
+		} else {
+			return false;
+		}
+	}
+
+	return false;
+}
+
+function bp_group_show_forum_setting( $group = false ) {
+	global $groups_template;
+
+	if ( !$group )
+		$group =& $groups_template->group;
+
+	if ( $group->enable_forum )
+		echo ' checked="checked"';
+}
+
+function bp_group_show_status_setting( $setting, $group = false ) {
+	global $groups_template;
+
+	if ( !$group )
+		$group =& $groups_template->group;
+
+	if ( $setting == $group->status )
+		echo ' checked="checked"';
+}
+
+/**
+ * Get the 'checked' value, if needed, for a given invite_status on the group create/admin screens
+ *
+ * @package BuddyPress
+ * @subpackage Groups Template
+ * @since 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
+ */
+function bp_group_show_invite_status_setting( $setting, $group = false ) {
+	$group_id = isset( $group->id ) ? $group->id : false;
+
+	$invite_status = bp_group_get_invite_status( $group_id );
+
+	if ( $setting == $invite_status )
+		echo ' checked="checked"';
+}
+
+/**
+ * Get the invite status of a group
+ *
+ * 'invite_status' became part of BuddyPress in BP 1.5. In order to provide backward compatibility,
+ * groups without a status set will default to 'members', ie all members in a group can send
+ * invitations. Filter 'bp_group_invite_status_fallback' to change this fallback behavior.
+ *
+ * This function can be used either in or out of the loop.
+ *
+ * @package BuddyPress
+ * @subpackage Groups Template
+ * @since 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
+ *    status, from among 'members', 'mods', and 'admins'
+ */
+function bp_group_get_invite_status( $group_id = false ) {
+	global $bp, $groups_template;
+
+	if ( !$group_id ) {
+		if ( isset( $bp->groups->current_group->id ) ) {
+			// Default to the current group first
+			$group_id = $bp->groups->current_group->id;
+		} else if ( isset( $groups_template->group->id ) ) {
+			// Then see if we're in the loop
+			$group_id = $groups_template->group->id;
+		} else {
+			return false;
+		}
+	}
+
+	$invite_status = groups_get_groupmeta( $group_id, 'invite_status' );
+
+	// Backward compatibility. When 'invite_status' is not set, fall back to a default value
+	if ( !$invite_status ) {
+		$invite_status = apply_filters( 'bp_group_invite_status_fallback', 'members' );
+	}
+
+	return apply_filters( 'bp_group_get_invite_status', $invite_status, $group_id );
+}
+
+/**
+ * Can the logged-in user send invitations in the specified group?
+ *
+ * @package BuddyPress
+ * @subpackage Groups Template
+ * @since 1.5
+ *
+ * @param int $group_id (optional) The id of the group whose status you want to check
+ * @return bool $can_send_invites
+ */
+function bp_groups_user_can_send_invites( $group_id = false ) {
+	global $bp;
+
+	$can_send_invites = false;
+	$invite_status    = false;
+
+	if ( is_user_logged_in() ) {
+		if ( is_super_admin() ) {
+			// Super admins can always send invitations
+			$can_send_invites = true;
+
+		} else {
+			// If no $group_id is provided, default to the current group id
+			if ( !$group_id )
+				$group_id = isset( $bp->groups->current_group->id ) ? $bp->groups->current_group->id : 0;
+
+			// If no group has been found, bail
+			if ( !$group_id )
+				return false;
+
+			$invite_status = bp_group_get_invite_status( $group_id );
+			if ( !$invite_status )
+				return false;
+
+			switch ( $invite_status ) {
+				case 'admins' :
+					if ( groups_is_user_admin( bp_loggedin_user_id(), $group_id ) )
+						$can_send_invites = true;
+					break;
+
+				case 'mods' :
+					if ( groups_is_user_mod( bp_loggedin_user_id(), $group_id ) || groups_is_user_admin( bp_loggedin_user_id(), $group_id ) )
+						$can_send_invites = true;
+					break;
+
+				case 'members' :
+					if ( groups_is_user_member( bp_loggedin_user_id(), $group_id ) )
+						$can_send_invites = true;
+					break;
+			}
+		}
+	}
+
+	return apply_filters( 'bp_groups_user_can_send_invites', $can_send_invites, $group_id, $invite_status );
+}
+
+/**
+ * Since BuddyPress 1.0, this generated the group settings admin/member screen.
+ * As of BuddyPress 1.5 (r4489), and because this function outputs HTML, it was moved into /bp-default/groups/single/admin.php.
+ *
+ * @deprecated 1.5
+ * @deprecated No longer used.
+ * @since 1.0
+ * @todo Remove in 1.4
+ */
+function bp_group_admin_memberlist( $admin_list = false, $group = false ) {
+	global $groups_template;
+
+	_deprecated_function( __FUNCTION__, '1.5', 'No longer used. See /bp-default/groups/single/admin.php' );
+
+	if ( empty( $group ) )
+		$group =& $groups_template->group;
+
+
+	if ( $admins = groups_get_group_admins( $group->id ) ) : ?>
+
+		<ul id="admins-list" class="item-list<?php if ( !empty( $admin_list ) ) : ?> single-line<?php endif; ?>">
+
+		<?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' ) ) ) ?>
+
+				<h5>
+
+					<?php echo bp_core_get_userlink( $admin->user_id ); ?>
+
+					<span class="small">
+						<a class="button confirm admin-demote-to-member" href="<?php bp_group_member_demote_link($admin->user_id) ?>"><?php _e( 'Demote to Member', 'buddypress' ) ?></a>
+					</span>
+				</h5>
+			</li>
+
+			<?php else : ?>
+
+			<li>
+
+				<?php echo bp_core_fetch_avatar( array( 'item_id' => $admin->user_id, 'type' => 'thumb', 'alt' => __( 'Profile picture of %s', 'buddypress' ) ) ) ?>
+
+				<h5><?php echo bp_core_get_userlink( $admin->user_id ) ?></h5>
+				<span class="activity">
+					<?php echo bp_core_get_last_activity( strtotime( $admin->date_modified ), __( 'joined %s', 'buddypress') ); ?>
+				</span>
+
+				<?php if ( bp_is_active( 'friends' ) ) : ?>
+
+					<div class="action">
+
+						<?php bp_add_friend_button( $admin->user_id ); ?>
+
+					</div>
+
+				<?php endif; ?>
+
+			</li>
+
+			<?php endif;
+		} ?>
+
+		</ul>
+
+	<?php else : ?>
+
+		<div id="message" class="info">
+			<p><?php _e( 'This group has no administrators', 'buddypress' ); ?></p>
+		</div>
+
+	<?php endif;
+}
+
+function bp_group_mod_memberlist( $admin_list = false, $group = false ) {
+	global $groups_template, $group_mods;
+
+	if ( empty( $group ) )
+		$group =& $groups_template->group;
+
+	if ( $group_mods = groups_get_group_mods( $group->id ) ) { ?>
+
+		<ul id="mods-list" class="item-list<?php if ( $admin_list ) { ?> single-line<?php } ?>">
+
+		<?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' ) ) ) ?>
+
+				<h5>
+					<?php echo bp_core_get_userlink( $mod->user_id ); ?>
+
+					<span class="small">
+						<a href="<?php bp_group_member_promote_admin_link( array( 'user_id' => $mod->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($mod->user_id) ?>"><?php _e( 'Demote to Member', 'buddypress' ) ?></a>
+					</span>
+				</h5>
+			</li>
+
+			<?php } else { ?>
+
+			<li>
+
+				<?php echo bp_core_fetch_avatar( array( 'item_id' => $mod->user_id, 'type' => 'thumb', 'alt' => __( 'Profile picture of %s', 'buddypress' ) ) ) ?>
+
+				<h5><?php echo bp_core_get_userlink( $mod->user_id ) ?></h5>
+
+				<span class="activity"><?php echo bp_core_get_last_activity( strtotime( $mod->date_modified ), __( 'joined %s', 'buddypress') ); ?></span>
+
+				<?php if ( bp_is_active( 'friends' ) ) : ?>
+
+					<div class="action">
+						<?php bp_add_friend_button( $mod->user_id ) ?>
+					</div>
+
+				<?php endif; ?>
+
+			</li>
+
+			<?php } ?>
+		<?php } ?>
+
+		</ul>
+
+	<?php } else { ?>
+
+		<div id="message" class="info">
+			<p><?php _e( 'This group has no moderators', 'buddypress' ); ?></p>
+		</div>
+
+	<?php }
+}
+
+function bp_group_has_moderators( $group = false ) {
+	global $group_mods, $groups_template;
+
+	if ( !$group )
+		$group =& $groups_template->group;
+
+	return apply_filters( 'bp_group_has_moderators', groups_get_group_mods( $group->id ) );
+}
+
+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;
+
+		$defaults = array(
+			'user_id' => $members_template->member->user_id,
+			'group'   => &$groups_template->group
+		);
+
+		$r = wp_parse_args( $args, $defaults );
+		extract( $r, EXTR_SKIP );
+
+		return apply_filters( 'bp_get_group_member_promote_mod_link', wp_nonce_url( bp_get_group_permalink( $group ) . 'admin/manage-members/promote/mod/' . $user_id, 'groups_promote_member' ) );
+	}
+
+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;
+
+		$defaults = array(
+			'user_id' => !empty( $members_template->member->user_id ) ? $members_template->member->user_id : false,
+			'group'   => &$groups_template->group
+		);
+
+		$r = wp_parse_args( $args, $defaults );
+		extract( $r, EXTR_SKIP );
+
+		return apply_filters( 'bp_get_group_member_promote_admin_link', wp_nonce_url( bp_get_group_permalink( $group ) . 'admin/manage-members/promote/admin/' . $user_id, 'groups_promote_member' ) );
+	}
+
+function bp_group_member_demote_link( $user_id = 0 ) {
+	global $members_template;
+
+	if ( !$user_id )
+		$user_id = $members_template->member->user_id;
+
+	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;
+
+		if ( !$group )
+			$group =& $groups_template->group;
+
+		if ( !$user_id )
+			$user_id = $members_template->member->user_id;
+
+		return apply_filters( 'bp_get_group_member_demote_link', wp_nonce_url( bp_get_group_permalink( $group ) . 'admin/manage-members/demote/' . $user_id, 'groups_demote_member' ) );
+	}
+
+function bp_group_member_ban_link( $user_id = 0 ) {
+	global $members_template;
+
+	if ( !$user_id )
+		$user_id = $members_template->member->user_id;
+
+	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;
+
+		if ( !$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' ) );
+	}
+
+function bp_group_member_unban_link( $user_id = 0 ) {
+	global $members_template;
+
+	if ( !$user_id )
+		$user_id = $members_template->member->user_id;
+
+	echo bp_get_group_member_unban_link( $user_id );
+}
+	function bp_get_group_member_unban_link( $user_id = 0, $group = false ) {
+		global $members_template, $groups_template;
+
+		if ( !$user_id )
+			$user_id = $members_template->member->user_id;
+
+		if ( !$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' ) );
+	}
+
+
+function bp_group_member_remove_link( $user_id = 0 ) {
+	global $members_template;
+
+	if ( !$user_id )
+		$user_id = $members_template->member->user_id;
+
+	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;
+
+		if ( !$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' ) );
+	}
+
+function bp_group_admin_tabs( $group = false ) {
+	global $bp, $groups_template;
+
+	if ( !$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 } ?>
+
+	<?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>
+
+	<?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>
+	<?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>
+
+	<?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>
+	<?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>
+<?php
+}
+
+function bp_group_total_for_member() {
+	echo bp_get_group_total_for_member();
+}
+	function bp_get_group_total_for_member() {
+		return apply_filters( 'bp_get_group_total_for_member', BP_Groups_Member::total_group_count() );
+	}
+
+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;
+
+		if ( !$group )
+			$group =& $groups_template->group;
+
+		return apply_filters( 'bp_group_form_action', bp_get_group_permalink( $group ) . $page );
+	}
+
+function bp_group_admin_form_action( $page = false ) {
+	echo bp_get_group_admin_form_action( $page );
+}
+	function bp_get_group_admin_form_action( $page = false, $group = false ) {
+		global $groups_template;
+
+		if ( !$group )
+			$group =& $groups_template->group;
+
+		if ( !$page )
+			$page = bp_action_variable( 0 );
+
+		return apply_filters( 'bp_group_admin_form_action', bp_get_group_permalink( $group ) . 'admin/' . $page );
+	}
+
+function bp_group_has_requested_membership( $group = false ) {
+	global $groups_template;
+
+	if ( !$group )
+		$group =& $groups_template->group;
+
+	if ( groups_check_for_membership_request( bp_loggedin_user_id(), $group->id ) )
+		return true;
+
+	return false;
+}
+
+/**
+ * bp_group_is_member()
+ *
+ * Checks if current user is member of a group.
+ *
+ * @uses is_super_admin 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;
+
+	// Site admins always have access
+	if ( $bp->loggedin_user->is_super_admin )
+		return true;
+
+	if ( !$group )
+		$group =& $groups_template->group;
+
+	return apply_filters( 'bp_group_is_member', !empty( $group->is_member ) );
+}
+
+/**
+ * Checks if a user is banned from a group.
+ *
+ * If this function is invoked inside the groups template loop (e.g. the group directory), then
+ * 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
+ */
+function bp_group_is_user_banned( $group = false, $user_id = 0 ) {
+	global $bp, $groups_template;
+
+	// Site admins always have access
+	if ( $bp->loggedin_user->is_super_admin )
+		return false;
+
+	if ( !$group ) {
+		$group =& $groups_template->group;
+
+		if ( !$user_id && isset( $group->is_banned ) )
+			return apply_filters( 'bp_group_is_user_banned', $group->is_banned );
+	}
+
+	if ( !$user_id )
+		$user_id = $bp->loggedin_user->id;
+
+	return apply_filters( 'bp_group_is_user_banned', groups_is_user_banned( $user_id, $group->id ) );
+}
+
+function bp_group_accept_invite_link() {
+	echo bp_get_group_accept_invite_link();
+}
+	function bp_get_group_accept_invite_link( $group = false ) {
+		global $groups_template, $bp;
+
+		if ( !$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' ) );
+	}
+
+function bp_group_reject_invite_link() {
+	echo bp_get_group_reject_invite_link();
+}
+	function bp_get_group_reject_invite_link( $group = false ) {
+		global $groups_template, $bp;
+
+		if ( !$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' ) );
+	}
+
+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;
+
+		if ( !$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' ) );
+	}
+
+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;
+
+		if ( !$group )
+			$group =& $groups_template->group;
+
+		return apply_filters( 'bp_get_group_leave_reject_link', bp_get_group_permalink( $group ) );
+	}
+
+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;
+
+		if ( !$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;
+
+	if ( !bp_is_active( 'friends' ) )
+		return false;
+
+	if ( !$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 ) )
+		return false;
+
+	return true;
+}
+
+function bp_group_new_topic_button( $group = false ) {
+	echo bp_get_group_new_topic_button();
+}
+	function bp_get_group_new_topic_button( $group = false ) {
+		global $groups_template;
+
+		if ( !$group )
+			$group =& $groups_template->group;
+
+		if ( !is_user_logged_in() || bp_group_is_user_banned() || !bp_is_group_forum() || bp_is_group_forum_topic() )
+			return false;
+
+		$button = bp_button( array (
+			'id'                => 'new_topic',
+			'component'         => 'groups',
+			'must_be_logged_in' => true,
+			'block_self'        => true,
+			'wrapper_class'     => 'group-button',
+			'link_href'         => '#post-new',
+			'link_class'        => 'group-button show-hide-new',
+			'link_id'           => 'new-topic-button',
+			'link_text'         => __( 'New Topic', 'buddypress' ),
+			'link_title'        => __( 'New Topic', 'buddypress' ),
+		) );
+
+		// Filter and return the HTML button
+		return bp_get_button( apply_filters( 'bp_get_group_new_topic_button', $button ) );
+	}
+
+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;
+
+		if ( !$group )
+			$group =& $groups_template->group;
+
+		if ( !is_user_logged_in() || bp_group_is_user_banned( $group ) )
+			return false;
+
+		// Group creation was not completed or status is unknown
+		if ( !$group->status )
+			return false;
+
+		// Already a member
+		if ( $group->is_member ) {
+
+			// 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 )
+				return false;
+
+			$button = array(
+				'id'                => 'leave_group',
+				'component'         => 'groups',
+				'must_be_logged_in' => true,
+				'block_self'        => false,
+				'wrapper_class'     => 'group-button ' . $group->status,
+				'wrapper_id'        => 'groupbutton-' . $group->id,
+				'link_href'         => wp_nonce_url( bp_get_group_permalink( $group ) . 'leave-group', 'groups_leave_group' ),
+				'link_text'         => __( 'Leave Group', 'buddypress' ),
+				'link_title'        => __( 'Leave Group', 'buddypress' ),
+				'link_class'        => 'group-button leave-group',
+			);
+
+		// Not a member
+		} else {
+
+			// Show different buttons based on group status
+			switch ( $group->status ) {
+				case 'hidden' :
+					return false;
+					break;
+
+				case 'public':
+					$button = array(
+						'id'                => 'join_group',
+						'component'         => 'groups',
+						'must_be_logged_in' => true,
+						'block_self'        => false,
+						'wrapper_class'     => 'group-button ' . $group->status,
+						'wrapper_id'        => 'groupbutton-' . $group->id,
+						'link_href'         => wp_nonce_url( bp_get_group_permalink( $group ) . 'join', 'groups_join_group' ),
+						'link_text'         => __( 'Join Group', 'buddypress' ),
+						'link_title'        => __( 'Join Group', 'buddypress' ),
+						'link_class'        => 'group-button join-group',
+					);
+					break;
+
+				case 'private' :
+
+					// Member has not requested membership yet
+					if ( !bp_group_has_requested_membership( $group ) ) {
+						$button = array(
+							'id'                => 'request_membership',
+							'component'         => 'groups',
+							'must_be_logged_in' => true,
+							'block_self'        => false,
+							'wrapper_class'     => 'group-button ' . $group->status,
+							'wrapper_id'        => 'groupbutton-' . $group->id,
+							'link_href'         => wp_nonce_url( bp_get_group_permalink( $group ) . 'request-membership', 'groups_request_membership' ),
+							'link_text'         => __( 'Request Membership', 'buddypress' ),
+							'link_title'        => __( 'Request Membership', 'buddypress' ),
+							'link_class'        => 'group-button request-membership',
+						);
+
+					// Member has requested membership already
+					} else {
+						$button = array(
+							'id'                => 'membership_requested',
+							'component'         => 'groups',
+							'must_be_logged_in' => true,
+							'block_self'        => false,
+							'wrapper_class'     => 'group-button pending ' . $group->status,
+							'wrapper_id'        => 'groupbutton-' . $group->id,
+							'link_href'         => bp_get_group_permalink( $group ),
+							'link_text'         => __( 'Request Sent', 'buddypress' ),
+							'link_title'        => __( 'Request Sent', 'buddypress' ),
+							'link_class'        => 'group-button pending membership-requested',
+						);
+					}
+
+					break;
+			}
+		}
+
+		// Filter and return the HTML button
+		return bp_get_button( apply_filters( 'bp_get_group_join_button', $button ) );
+	}
+
+function bp_group_status_message( $group = false ) {
+	global $groups_template;
+
+	if ( !$group )
+		$group =& $groups_template->group;
+
+	if ( 'private' == $group->status ) {
+		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' );
+			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' );
+	} else {
+		_e( 'This is a hidden group and only invited members can join.', 'buddypress' );
+	}
+}
+
+function bp_group_hidden_fields() {
+	if ( isset( $_REQUEST['s'] ) ) {
+		echo '<input type="hidden" id="search_terms" value="' . esc_attr( $_REQUEST['s'] ) . '" name="search_terms" />';
+	}
+
+	if ( isset( $_REQUEST['letter'] ) ) {
+		echo '<input type="hidden" id="selected_letter" value="' . esc_attr( $_REQUEST['letter'] ) . '" name="selected_letter" />';
+	}
+
+	if ( isset( $_REQUEST['groups_search'] ) ) {
+		echo '<input type="hidden" id="search_terms" value="' . esc_attr( $_REQUEST['groups_search'] ) . '" name="search_terms" />';
+	}
+}
+
+function bp_total_group_count() {
+	echo bp_get_total_group_count();
+}
+	function bp_get_total_group_count() {
+		return apply_filters( 'bp_get_total_group_count', groups_get_total_group_count() );
+	}
+
+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 ) );
+	}
+
+
+/***************************************************************************
+ * Group Members Template Tags
+ **/
+
+class BP_Groups_Group_Members_Template {
+	var $current_member = -1;
+	var $member_count;
+	var $members;
+	var $member;
+
+	var $in_the_loop;
+
+	var $pag_page;
+	var $pag_num;
+	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 );
+
+		if ( !$max || $max >= (int)$this->members['count'] )
+			$this->total_member_count = (int)$this->members['count'];
+		else
+			$this->total_member_count = (int)$max;
+
+		$this->members = $this->members['members'];
+
+		if ( $max ) {
+			if ( $max >= count($this->members) )
+				$this->member_count = count($this->members);
+			else
+				$this->member_count = (int)$max;
+		} else {
+			$this->member_count = count($this->members);
+		}
+
+		$this->pag_links = paginate_links( array(
+			'base' => add_query_arg( 'mlpage', '%#%' ),
+			'format' => '',
+			'total' => ceil( $this->total_member_count / $this->pag_num ),
+			'current' => $this->pag_page,
+			'prev_text' => '&larr;',
+			'next_text' => '&rarr;',
+			'mid_size' => 1
+		));
+	}
+
+	function has_members() {
+		if ( $this->member_count )
+			return true;
+
+		return false;
+	}
+
+	function next_member() {
+		$this->current_member++;
+		$this->member = $this->members[$this->current_member];
+
+		return $this->member;
+	}
+
+	function rewind_members() {
+		$this->current_member = -1;
+		if ( $this->member_count > 0 ) {
+			$this->member = $this->members[0];
+		}
+	}
+
+	function members() {
+		if ( $this->current_member + 1 < $this->member_count ) {
+			return true;
+		} elseif ( $this->current_member + 1 == $this->member_count ) {
+			do_action('loop_end');
+			// Do some cleaning up after the loop
+			$this->rewind_members();
+		}
+
+		$this->in_the_loop = false;
+		return false;
+	}
+
+	function the_member() {
+		global $member;
+
+		$this->in_the_loop = true;
+		$this->member = $this->next_member();
+
+		if ( 0 == $this->current_member ) // loop has just started
+			do_action('loop_start');
+	}
+}
+
+function bp_group_has_members( $args = '' ) {
+	global $bp, $members_template;
+
+	$defaults = array(
+		'group_id' => bp_get_current_group_id(),
+		'per_page' => 20,
+		'max' => false,
+		'exclude' => false,
+		'exclude_admins_mods' => 1,
+		'exclude_banned' => 1
+	);
+
+	$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 );
+	return apply_filters( 'bp_group_has_members', $members_template->has_members(), $members_template );
+}
+
+function bp_group_members() {
+	global $members_template;
+
+	return $members_template->members();
+}
+
+function bp_group_the_member() {
+	global $members_template;
+
+	return $members_template->the_member();
+}
+
+function bp_group_member_avatar() {
+	echo bp_get_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' ) ) ) );
+	}
+
+function bp_group_member_avatar_thumb() {
+	echo bp_get_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' ) ) ) );
+	}
+
+function bp_group_member_avatar_mini( $width = 30, $height = 30 ) {
+	echo bp_get_group_member_avatar_mini( $width, $height );
+}
+	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' ) ) ) );
+	}
+
+function bp_group_member_name() {
+	echo bp_get_group_member_name();
+}
+	function bp_get_group_member_name() {
+		global $members_template;
+
+		return apply_filters( 'bp_get_group_member_name', $members_template->member->display_name );
+	}
+
+function bp_group_member_url() {
+	echo bp_get_group_member_url();
+}
+	function bp_get_group_member_url() {
+		global $members_template;
+
+		return apply_filters( 'bp_get_group_member_url', bp_core_get_user_domain( $members_template->member->user_id, $members_template->member->user_nicename, $members_template->member->user_login ) );
+	}
+
+function bp_group_member_link() {
+	echo bp_get_group_member_link();
+}
+	function bp_get_group_member_link() {
+		global $members_template;
+
+		return apply_filters( 'bp_get_group_member_link', '<a href="' . bp_core_get_user_domain( $members_template->member->user_id, $members_template->member->user_nicename, $members_template->member->user_login ) . '">' . $members_template->member->display_name . '</a>' );
+	}
+
+function bp_group_member_domain() {
+	echo bp_get_group_member_domain();
+}
+	function bp_get_group_member_domain() {
+		global $members_template;
+
+		return apply_filters( 'bp_get_group_member_domain', bp_core_get_user_domain( $members_template->member->user_id, $members_template->member->user_nicename, $members_template->member->user_login ) );
+	}
+
+function bp_group_member_is_friend() {
+	echo bp_get_group_member_is_friend();
+}
+	function bp_get_group_member_is_friend() {
+		global $members_template;
+
+		if ( !isset( $members_template->member->is_friend ) )
+			$friend_status = 'not_friends';
+		else
+			$friend_status = ( 0 == $members_template->member->is_friend ) ? 'pending' : 'is_friend';
+
+		return apply_filters( 'bp_get_group_member_is_friend', $friend_status );
+	}
+
+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;
+
+		return apply_filters( 'bp_get_group_member_is_banned', $members_template->member->is_banned );
+	}
+
+function bp_group_member_css_class() {
+	global $members_template;
+
+	if ( $members_template->member->is_banned )
+		echo apply_filters( 'bp_group_member_css_class', 'banned-user' );
+}
+
+function bp_group_member_joined_since() {
+	echo bp_get_group_member_joined_since();
+}
+	function bp_get_group_member_joined_since() {
+		global $members_template;
+
+		return apply_filters( 'bp_get_group_member_joined_since', bp_core_get_last_activity( $members_template->member->date_modified, __( 'joined %s', 'buddypress') ) );
+	}
+
+function bp_group_member_id() {
+	echo bp_get_group_member_id();
+}
+	function bp_get_group_member_id() {
+		global $members_template;
+
+		return apply_filters( 'bp_get_group_member_id', $members_template->member->user_id );
+	}
+
+function bp_group_member_needs_pagination() {
+	global $members_template;
+
+	if ( $members_template->total_member_count > $members_template->pag_num )
+		return true;
+
+	return false;
+}
+
+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' );
+	}
+
+function bp_group_member_pagination() {
+	echo bp_get_group_member_pagination();
+	wp_nonce_field( 'bp_groups_member_list', '_member_pag_nonce' );
+}
+	function bp_get_group_member_pagination() {
+		global $members_template;
+		return apply_filters( 'bp_get_group_member_pagination', $members_template->pag_links );
+	}
+
+function bp_group_member_pagination_count() {
+	echo bp_get_group_member_pagination_count();
+}
+	function bp_get_group_member_pagination_count() {
+		global $members_template;
+
+		$start_num = intval( ( $members_template->pag_page - 1 ) * $members_template->pag_num ) + 1;
+		$from_num = bp_core_number_format( $start_num );
+		$to_num = bp_core_number_format( ( $start_num + ( $members_template->pag_num - 1 ) > $members_template->total_member_count ) ? $members_template->total_member_count : $start_num + ( $members_template->pag_num - 1 ) );
+		$total = bp_core_number_format( $members_template->total_member_count );
+
+		return apply_filters( 'bp_get_group_member_pagination_count', sprintf( __( 'Viewing members %1$s to %2$s (of %3$s members)', 'buddypress' ), $from_num, $to_num, $total ) );
+	}
+
+function bp_group_member_admin_pagination() {
+	echo bp_get_group_member_admin_pagination();
+	wp_nonce_field( 'bp_groups_member_admin_list', '_member_admin_pag_nonce' );
+}
+	function bp_get_group_member_admin_pagination() {
+		global $members_template;
+
+		return $members_template->pag_links;
+	}
+
+
+/***************************************************************************
+ * Group Creation Process Template Tags
+ **/
+
+/**
+ * Determine if the current logged in user can create groups.
+ *
+ * @package BuddyPress Groups
+ * @since 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.
+ *
+ * @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() )
+		return true;
+
+	// Get group creation option, default to 0 (allowed)
+	$restricted = (int) bp_get_option( 'bp_restrict_group_creation', 0 );
+
+	// Allow by default
+	$can_create = true;
+
+	// Are regular users restricted?
+	if ( $restricted )
+		$can_create = false;
+
+	return apply_filters( 'bp_user_can_create_groups', $can_create, $restricted );
+}
+
+function bp_group_creation_tabs() {
+	global $bp;
+
+	if ( !is_array( $bp->groups->group_creation_steps ) )
+		return false;
+
+	if ( !$bp->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 ) {
+		$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
+		$counter++;
+	}
+
+	unset( $is_enabled );
+
+	do_action( 'groups_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>' );
+}
+
+function bp_group_creation_form_action() {
+	echo bp_get_group_creation_form_action();
+}
+	function bp_get_group_creation_form_action() {
+		global $bp;
+
+		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 ) );
+	}
+
+function bp_is_group_creation_step( $step_slug ) {
+	global $bp;
+
+	/* Make sure we are in the groups component */
+	if ( !bp_is_groups_component() || !bp_is_current_action( 'create' ) )
+		return false;
+
+	/* If this the first step, we can just accept and return true */
+	if ( !bp_action_variable( 1 ) && array_shift( array_keys( $bp->groups->group_creation_steps ) ) == $step_slug )
+		return true;
+
+	/* Before allowing a user to see a group creation step we must make sure previous steps are completed */
+	if ( !bp_is_first_group_creation_step() ) {
+		if ( !bp_are_previous_group_creation_steps_complete( $step_slug ) )
+			return false;
+	}
+
+	/* Check the current step against the step parameter */
+	if ( bp_is_action_variable( $step_slug ) )
+		return true;
+
+	return false;
+}
+
+function bp_is_group_creation_step_complete( $step_slugs ) {
+	global $bp;
+
+	if ( !isset( $bp->groups->completed_create_steps ) )
+		return false;
+
+	if ( is_array( $step_slugs ) ) {
+		$found = true;
+
+		foreach ( (array)$step_slugs as $step_slug ) {
+			if ( !in_array( $step_slug, $bp->groups->completed_create_steps ) )
+				$found = false;
+		}
+
+		return $found;
+	} else {
+		return in_array( $step_slugs, $bp->groups->completed_create_steps );
+	}
+
+	return true;
+}
+
+function bp_are_previous_group_creation_steps_complete( $step_slug ) {
+	global $bp;
+
+	/* If this is the first group creation step, return true */
+	if ( array_shift( array_keys( $bp->groups->group_creation_steps ) ) == $step_slug )
+		return true;
+
+	reset( $bp->groups->group_creation_steps );
+	unset( $previous_steps );
+
+	/* Get previous steps */
+	foreach ( (array)$bp->groups->group_creation_steps as $slug => $name ) {
+		if ( $slug == $step_slug )
+			break;
+
+		$previous_steps[] = $slug;
+	}
+
+	return bp_is_group_creation_step_complete( $previous_steps );
+}
+
+function bp_new_group_id() {
+	echo bp_get_new_group_id();
+}
+	function bp_get_new_group_id() {
+		global $bp;
+
+		if ( isset( $bp->groups->new_group_id ) )
+			$new_group_id = $bp->groups->new_group_id;
+		else
+			$new_group_id = 0;
+
+		return apply_filters( 'bp_get_new_group_id', $new_group_id );
+	}
+
+function bp_new_group_name() {
+	echo bp_get_new_group_name();
+}
+	function bp_get_new_group_name() {
+		global $bp;
+
+		if ( isset( $bp->groups->current_group->name ) )
+			$name = $bp->groups->current_group->name;
+		else
+			$name = '';
+
+		return apply_filters( 'bp_get_new_group_name', $name );
+	}
+
+function bp_new_group_description() {
+	echo bp_get_new_group_description();
+}
+	function bp_get_new_group_description() {
+		global $bp;
+
+		if ( isset( $bp->groups->current_group->description ) )
+			$description = $bp->groups->current_group->description;
+		else
+			$description = '';
+
+		return apply_filters( 'bp_get_new_group_description', $description );
+	}
+
+function bp_new_group_enable_forum() {
+	echo bp_get_new_group_enable_forum();
+}
+	function bp_get_new_group_enable_forum() {
+		global $bp;
+		return (int) apply_filters( 'bp_get_new_group_enable_forum', $bp->groups->current_group->enable_forum );
+	}
+
+function bp_new_group_status() {
+	echo bp_get_new_group_status();
+}
+	function bp_get_new_group_status() {
+		global $bp;
+		return apply_filters( 'bp_get_new_group_status', $bp->groups->current_group->status );
+	}
+
+function bp_new_group_avatar( $args = '' ) {
+	echo bp_get_new_group_avatar( $args );
+}
+	function bp_get_new_group_avatar( $args = '' ) {
+		global $bp;
+
+		$defaults = array(
+			'type' => 'full',
+			'width' => false,
+			'height' => false,
+			'class' => 'avatar',
+			'id' => 'avatar-crop-preview',
+			'alt' => __( 'Group avatar', 'buddypress' ),
+			'no_grav' => false
+		);
+
+		$r = wp_parse_args( $args, $defaults );
+		extract( $r, EXTR_SKIP );
+
+		return apply_filters( 'bp_get_new_group_avatar', bp_core_fetch_avatar( array( 'item_id' => $bp->groups->current_group->id, 'object' => 'group', 'type' => $type, 'avatar_dir' => 'group-avatars', 'alt' => $alt, 'width' => $width, 'height' => $height, 'class' => $class, 'no_grav' => $no_grav ) ) );
+	}
+
+function bp_group_creation_previous_link() {
+	echo bp_get_group_creation_previous_link();
+}
+	function bp_get_group_creation_previous_link() {
+		global $bp;
+
+		foreach ( (array)$bp->groups->group_creation_steps as $slug => $name ) {
+			if ( bp_is_action_variable( $slug ) )
+				break;
+
+			$previous_steps[] = $slug;
+		}
+
+		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 ) );
+	}
+
+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 )
+		return true;
+
+	return false;
+}
+
+function bp_is_first_group_creation_step() {
+	global $bp;
+
+	$first_step = array_shift( array_keys( $bp->groups->group_creation_steps ) );
+
+	if ( $first_step == $bp->groups->current_create_step )
+		return true;
+
+	return false;
+}
+
+function bp_new_group_invite_friend_list() {
+	echo bp_get_new_group_invite_friend_list();
+}
+	function bp_get_new_group_invite_friend_list( $args = '' ) {
+		global $bp;
+
+		if ( !bp_is_active( 'friends' ) )
+			return false;
+
+		$defaults = array(
+			'group_id'  => false,
+			'separator' => 'li'
+		);
+
+		$r = wp_parse_args( $args, $defaults );
+		extract( $r, EXTR_SKIP );
+
+		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 );
+
+			for ( $i = 0, $count = count( $friends ); $i < $count; ++$i ) {
+				$checked = '';
+
+				if ( !empty( $invites ) ) {
+					if ( in_array( $friends[$i]['id'], $invites ) )
+						$checked = ' checked="checked"';
+				}
+
+				$items[] = '<' . $separator . '><input' . $checked . ' type="checkbox" name="friends[]" id="f-' . $friends[$i]['id'] . '" value="' . esc_attr( $friends[$i]['id'] ) . '" /> ' . $friends[$i]['full_name'] . '</' . $separator . '>';
+			}
+		}
+
+		if ( !empty( $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>
+		<input type="submit" id="groups_search_submit" name="groups_search_submit" value="<?php _e( 'Search', 'buddypress' ) ?>" />
+	</form>
+
+<?php
+}
+
+/**
+ * Displays group header tabs
+ *
+ * @package BuddyPress
+ * @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>
+<?php
+	do_action( 'groups_header_tabs' );
+}
+
+/**
+ * Displays group filter titles
+ *
+ * @package BuddyPress
+ * @todo Deprecate?
+ */
+function bp_groups_filter_title() {
+	$current_filter = bp_action_variable( 0 );
+
+	switch ( $current_filter ) {
+		case 'recently-active': default:
+			_e( 'Recently Active', 'buddypress' );
+			break;
+		case 'recently-joined':
+			_e( 'Recently Joined', 'buddypress' );
+			break;
+		case 'most-popular':
+			_e( 'Most Popular', 'buddypress' );
+			break;
+		case 'admin-of':
+			_e( 'Administrator Of', 'buddypress' );
+			break;
+		case 'mod-of':
+			_e( 'Moderator Of', 'buddypress' );
+			break;
+		case 'alphabetically':
+			_e( 'Alphabetically', 'buddypress' );
+		break;
+	}
+	do_action( 'bp_groups_filter_title' );
+}
+
+function bp_is_group_admin_screen( $slug ) {
+	if ( !bp_is_groups_component() || !bp_is_current_action( 'admin' ) )
+		return false;
+
+	if ( bp_is_action_variable( $slug ) )
+		return true;
+
+	return false;
+}
+
+/************************************************************************************
+ * Group Avatar Template Tags
+ **/
+
+function bp_group_current_avatar() {
+	global $bp;
+
+	if ( $bp->groups->current_group->avatar_full ) { ?>
+
+		<img src="<?php echo esc_attr( $bp->groups->current_group->avatar_full ) ?>" alt="<?php _e( 'Group Avatar', 'buddypress' ) ?>" class="avatar" />
+
+	<?php } else { ?>
+
+		<img src="<?php echo $bp->groups->image_base . '/none.gif' ?>" alt="<?php _e( 'No Group Avatar', 'buddypress' ) ?>" class="avatar" />
+
+	<?php }
+}
+
+function bp_get_group_has_avatar() {
+	global $bp;
+
+	if ( !empty( $_FILES ) || !bp_core_fetch_avatar( array( 'item_id' => $bp->groups->current_group->id, 'object' => 'group', 'no_grav' => true ) ) )
+		return false;
+
+	return true;
+}
+
+function bp_group_avatar_delete_link() {
+	echo bp_get_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' ) );
+	}
+
+function bp_group_avatar_edit_form() {
+	groups_avatar_upload();
+}
+
+function bp_custom_group_boxes() {
+	do_action( 'groups_custom_group_boxes' );
+}
+
+function bp_custom_group_admin_tabs() {
+	do_action( 'groups_custom_group_admin_tabs' );
+}
+
+function bp_custom_group_fields_editable() {
+	do_action( 'groups_custom_group_fields_editable' );
+}
+
+function bp_custom_group_fields() {
+	do_action( 'groups_custom_group_fields' );
+}
+
+
+/************************************************************************************
+ * Membership Requests Template Tags
+ **/
+
+class BP_Groups_Membership_Requests_Template {
+	var $current_request = -1;
+	var $request_count;
+	var $requests;
+	var $request;
+
+	var $in_the_loop;
+
+	var $pag_page;
+	var $pag_num;
+	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->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'];
+		else
+			$this->total_request_count = (int)$max;
+
+		$this->requests = $this->requests['requests'];
+
+		if ( $max ) {
+			if ( $max >= count($this->requests) )
+				$this->request_count = count($this->requests);
+			else
+				$this->request_count = (int)$max;
+		} else {
+			$this->request_count = count($this->requests);
+		}
+
+		$this->pag_links = paginate_links( array(
+			'base' => add_query_arg( 'mrpage', '%#%' ),
+			'format' => '',
+			'total' => ceil( $this->total_request_count / $this->pag_num ),
+			'current' => $this->pag_page,
+			'prev_text' => '&larr;',
+			'next_text' => '&rarr;',
+			'mid_size' => 1
+		) );
+	}
+
+	function has_requests() {
+		if ( $this->request_count )
+			return true;
+
+		return false;
+	}
+
+	function next_request() {
+		$this->current_request++;
+		$this->request = $this->requests[$this->current_request];
+
+		return $this->request;
+	}
+
+	function rewind_requests() {
+		$this->current_request = -1;
+
+		if ( $this->request_count > 0 )
+			$this->request = $this->requests[0];
+	}
+
+	function requests() {
+		if ( $this->current_request + 1 < $this->request_count ) {
+			return true;
+		} elseif ( $this->current_request + 1 == $this->request_count ) {
+			do_action('group_request_loop_end');
+			// Do some cleaning up after the loop
+			$this->rewind_requests();
+		}
+
+		$this->in_the_loop = false;
+		return false;
+	}
+
+	function the_request() {
+		global $request;
+
+		$this->in_the_loop = true;
+		$this->request = $this->next_request();
+
+		if ( 0 == $this->current_request ) // loop has just started
+			do_action('group_request_loop_start');
+	}
+}
+
+function bp_group_has_membership_requests( $args = '' ) {
+	global $requests_template, $groups_template;
+
+	$defaults = array(
+		'group_id' => $groups_template->group->id,
+		'per_page' => 10,
+		'max'      => false
+	);
+
+	$r = wp_parse_args( $args, $defaults );
+	extract( $r, EXTR_SKIP );
+
+	$requests_template = new BP_Groups_Membership_Requests_Template( $group_id, $per_page, $max );
+	return apply_filters( 'bp_group_has_membership_requests', $requests_template->has_requests(), $requests_template );
+}
+
+function bp_group_membership_requests() {
+	global $requests_template;
+
+	return $requests_template->requests();
+}
+
+function bp_group_the_membership_request() {
+	global $requests_template;
+
+	return $requests_template->the_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' ) ) ) );
+}
+
+function bp_group_request_reject_link() {
+	echo bp_get_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' ) );
+	}
+
+function bp_group_request_accept_link() {
+	echo bp_get_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' ) );
+	}
+
+function bp_group_request_user_link() {
+	echo bp_get_group_request_user_link();
+}
+	function bp_get_group_request_user_link() {
+		global $requests_template;
+
+		return apply_filters( 'bp_get_group_request_user_link', bp_core_get_userlink( $requests_template->request->user_id ) );
+	}
+
+function bp_group_request_time_since_requested() {
+	global $requests_template;
+
+	echo apply_filters( 'bp_group_request_time_since_requested', sprintf( __( 'requested %s', 'buddypress' ), bp_core_time_since( strtotime( $requests_template->request->date_modified ) ) ) );
+}
+
+function bp_group_request_comment() {
+	global $requests_template;
+
+	echo apply_filters( 'bp_group_request_comment', strip_tags( stripslashes( $requests_template->request->comments ) ) );
+}
+
+/************************************************************************************
+ * Invite Friends Template Tags
+ **/
+
+class BP_Groups_Invite_Template {
+	var $current_invite = -1;
+	var $invite_count;
+	var $invites;
+	var $invite;
+
+	var $in_the_loop;
+
+	var $pag_page;
+	var $pag_num;
+	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->invite_count = count( $this->invites );
+
+	}
+
+	function has_invites() {
+		if ( $this->invite_count )
+			return true;
+
+		return false;
+	}
+
+	function next_invite() {
+		$this->current_invite++;
+		$this->invite = $this->invites[$this->current_invite];
+
+		return $this->invite;
+	}
+
+	function rewind_invites() {
+		$this->current_invite = -1;
+		if ( $this->invite_count > 0 )
+			$this->invite = $this->invites[0];
+	}
+
+	function invites() {
+		if ( $this->current_invite + 1 < $this->invite_count ) {
+			return true;
+		} elseif ( $this->current_invite + 1 == $this->invite_count ) {
+			do_action('loop_end');
+			// Do some cleaning up after the loop
+			$this->rewind_invites();
+		}
+
+		$this->in_the_loop = false;
+		return false;
+	}
+
+	function the_invite() {
+		global $invite, $group_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
+			do_action('loop_start');
+	}
+}
+
+function bp_group_has_invites( $args = '' ) {
+	global $bp, $invites_template, $group_id;
+
+	$defaults = array(
+		'group_id' => false,
+		'user_id' => $bp->loggedin_user->id
+	);
+
+	$r = wp_parse_args( $args, $defaults );
+	extract( $r, EXTR_SKIP );
+
+	if ( !$group_id ) {
+		// Backwards compatibility
+		if ( !empty( $bp->groups->current_group ) )
+			$group_id = $bp->groups->current_group->id;
+
+		if ( !empty( $bp->groups->new_group_id ) )
+			$group_id = $bp->groups->new_group_id;
+	}
+
+	if ( !$group_id )
+		return false;
+
+	$invites_template = new BP_Groups_Invite_Template( $user_id, $group_id );
+	return apply_filters( 'bp_group_has_invites', $invites_template->has_invites(), $invites_template );
+}
+
+function bp_group_invites() {
+	global $invites_template;
+
+	return $invites_template->invites();
+}
+
+function bp_group_the_invite() {
+	global $invites_template;
+
+	return $invites_template->the_invite();
+}
+
+function bp_group_invite_item_id() {
+	echo bp_get_group_invite_item_id();
+}
+	function bp_get_group_invite_item_id() {
+		global $invites_template;
+
+		return apply_filters( 'bp_get_group_invite_item_id', 'uid-' . $invites_template->invite->user->id );
+	}
+
+function bp_group_invite_user_avatar() {
+	echo bp_get_group_invite_user_avatar();
+}
+	function bp_get_group_invite_user_avatar() {
+		global $invites_template;
+
+		return apply_filters( 'bp_get_group_invite_user_avatar', $invites_template->invite->user->avatar_thumb );
+	}
+
+function bp_group_invite_user_link() {
+	echo bp_get_group_invite_user_link();
+}
+	function bp_get_group_invite_user_link() {
+		global $invites_template;
+
+		return apply_filters( 'bp_get_group_invite_user_link', bp_core_get_userlink( $invites_template->invite->user->id ) );
+	}
+
+function bp_group_invite_user_last_active() {
+	echo bp_get_group_invite_user_last_active();
+}
+	function bp_get_group_invite_user_last_active() {
+		global $invites_template;
+
+		return apply_filters( 'bp_get_group_invite_user_last_active', $invites_template->invite->user->last_active );
+	}
+
+function bp_group_invite_user_remove_invite_url() {
+	echo bp_get_group_invite_user_remove_invite_url();
+}
+	function bp_get_group_invite_user_remove_invite_url() {
+		global $invites_template;
+
+		return wp_nonce_url( site_url( bp_get_groups_slug() . '/' . $invites_template->invite->group_id . '/invites/remove/' . $invites_template->invite->user->id ), 'groups_invite_uninvite_user' );
+	}
+
+/***
+ * Groups RSS Feed Template Tags
+ */
+
+/**
+ * Hook group activity feed to <head>
+ *
+ * @since 1.5
+ */
+function bp_groups_activity_feed() {
+	if ( !bp_is_active( 'groups' ) || !bp_is_active( 'activity' ) || !bp_is_group() )
+		return; ?>
+
+	<link rel="alternate" type="application/rss+xml" title="<?php bloginfo( 'name' ) ?> | <?php bp_current_group_name() ?> | <?php _e( 'Group Activity RSS Feed', 'buddypress' ) ?>" href="<?php bp_group_activity_feed_link() ?>" />
+
+<?php
+}
+add_action( 'bp_head', 'bp_groups_activity_feed' );
+
+function bp_group_activity_feed_link() {
+	echo bp_get_group_activity_feed_link();
+}
+	function bp_get_group_activity_feed_link() {
+		global $bp;
+
+		return apply_filters( 'bp_get_group_activity_feed_link', bp_get_group_permalink( $bp->groups->current_group ) . 'feed/' );
+	}
+
+/**
+ * Echoes the output of bp_get_current_group_id()
+ *
+ * @package BuddyPress
+ * @since 1.5
+ */
+function bp_current_group_id() {
+	echo bp_get_current_group_id();
+}
+	/**
+	 * Returns the ID of the current group
+	 *
+	 * @package BuddyPress
+	 * @since 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
+	 */
+	function bp_get_current_group_id() {
+		$current_group = groups_get_current_group();
+
+		$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 );
+	}
+
+/**
+ * Echoes the output of bp_get_current_group_slug()
+ *
+ * @package BuddyPress
+ * @since 1.5
+ */
+function bp_current_group_slug() {
+	echo bp_get_current_group_slug();
+}
+	/**
+	 * Returns the slug of the current group
+	 *
+	 * @package BuddyPress
+	 * @since 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
+	 */
+	function bp_get_current_group_slug() {
+		$current_group = groups_get_current_group();
+
+		$current_group_slug = isset( $current_group->slug ) ? $current_group->slug : '';
+
+		return apply_filters( 'bp_get_current_group_slug', $current_group_slug, $current_group );
+	}
+
+/**
+ * Echoes the output of bp_get_current_group_name()
+ *
+ * @package BuddyPress
+ */
+function bp_current_group_name() {
+	echo bp_get_current_group_name();
+}
+	/**
+	 * Returns the name of the current group
+	 *
+	 * @package BuddyPress
+	 * @since 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
+	 */
+	function bp_get_current_group_name() {
+		global $bp;
+
+		$name = apply_filters( 'bp_get_group_name', $bp->groups->current_group->name );
+		return apply_filters( 'bp_get_current_group_name', $name );
+	}
+
+function bp_groups_action_link( $action = '', $query_args = '', $nonce = false ) {
+	echo bp_get_groups_action_link( $action, $query_args, $nonce );
+}
+	function bp_get_groups_action_link( $action = '', $query_args = '', $nonce = false ) {
+		global $bp;
+
+		// Must be displayed user
+		if ( empty( $bp->groups->current_group->id ) )
+			return;
+
+		// Append $action to $url if there is no $type
+		if ( !empty( $action ) )
+			$url = bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/' . $bp->groups->current_group->slug . '/' . $action;
+		else
+			$url = bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/' . $bp->groups->current_group->slug;
+
+		// Add a slash at the end of our user url
+		$url = trailingslashit( $url );
+
+		// Add possible query arg
+		if ( !empty( $query_args ) && is_array( $query_args ) )
+			$url = add_query_arg( $query_args, $url );
+
+		// To nonce, or not to nonce...
+		if ( true === $nonce )
+			$url = wp_nonce_url( $url );
+		elseif ( is_string( $nonce ) )
+			$url = wp_nonce_url( $url, $nonce );
+
+		// Return the url, if there is one
+		if ( !empty( $url ) )
+			return $url;
+	}
+?>
\ No newline at end of file
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 c8784feeeced2ab6ac9a157d1e23c9952cbea958..2ceaef6370a9ff9ce66089469ca2fe9f61c3abdf 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,6 @@
 <?php
+// Exit if accessed directly
+if ( !defined( 'ABSPATH' ) ) exit;
 
 /* Register widgets for groups component */
 function groups_register_widgets() {
@@ -10,40 +12,67 @@ add_action( 'bp_register_widgets', 'groups_register_widgets' );
 
 class BP_Groups_Widget extends WP_Widget {
 	function bp_groups_widget() {
-		parent::WP_Widget( false, $name = __( 'Groups', 'buddypress' ) );
+		$this->_construct();
+	}
+
+	function __construct() {
+		$widget_ops = array( 'description' => __( 'A dynamic list of recently active, popular, and newest groups', 'buddypress' ) );
+		parent::__construct( false, __( 'Groups', 'buddypress' ), $widget_ops );
 
-		if ( is_active_widget( false, false, $this->id_base ) )
-			wp_enqueue_script( 'groups_widget_groups_list-js', BP_PLUGIN_URL . '/bp-groups/js/widget-groups.js', array('jquery') );
+		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' ) );
+		}
 	}
 
-	function widget($args, $instance) {
+	function widget( $args, $instance ) {
 		global $bp;
 
-	    extract( $args );
+		$user_id = apply_filters( 'bp_group_widget_user_id', '0' );
+
+		extract( $args );
+
+		if ( empty( $instance['group_default'] ) )
+			$instance['group_default'] = 'popular';
+
+		if ( empty( $instance['title'] ) )
+			$instance['title'] = __( 'Groups', 'buddypress' );
 
 		echo $before_widget;
 		echo $before_title
-		   . $widget_name
+		   . $instance['title']
 		   . $after_title; ?>
 
-		<?php if ( bp_has_groups( 'type=popular&per_page=' . $instance['max_groups'] . '&max=' . $instance['max_groups'] ) ) : ?>
+		<?php if ( bp_has_groups( 'user_id=' . $user_id . '&type=' . $instance['group_default'] . '&max=' . $instance['max_groups'] ) ) : ?>
 			<div class="item-options" id="groups-list-options">
-				<span class="ajax-loader" id="ajax-loader-groups"></span>
-				<a href="<?php echo site_url() . '/' . $bp->groups->slug ?>" id="newest-groups"><?php _e("Newest", 'buddypress') ?></a> |
-				<a href="<?php echo site_url() . '/' . $bp->groups->slug ?>" id="recently-active-groups"><?php _e("Active", 'buddypress') ?></a> |
-				<a href="<?php echo site_url() . '/' . $bp->groups->slug ?>" id="popular-groups" class="selected"><?php _e("Popular", 'buddypress') ?></a>
+				<a href="<?php echo site_url( bp_get_groups_root_slug() ); ?>" id="newest-groups"<?php if ( $instance['group_default'] == 'newest' ) : ?> class="selected"<?php endif; ?>><?php _e("Newest", 'buddypress') ?></a> |
+				<a href="<?php echo site_url( bp_get_groups_root_slug() ); ?>" id="recently-active-groups"<?php if ( $instance['group_default'] == 'active' ) : ?> class="selected"<?php endif; ?>><?php _e("Active", 'buddypress') ?></a> |
+				<a href="<?php echo site_url( bp_get_groups_root_slug() ); ?>" id="popular-groups" <?php if ( $instance['group_default'] == 'popular' ) : ?> class="selected"<?php endif; ?>><?php _e("Popular", 'buddypress') ?></a>
 			</div>
 
 			<ul id="groups-list" class="item-list">
 				<?php while ( bp_groups() ) : bp_the_group(); ?>
 					<li>
 						<div class="item-avatar">
-							<a href="<?php bp_group_permalink() ?>"><?php bp_group_avatar_thumb() ?></a>
+							<a href="<?php bp_group_permalink() ?>" title="<?php bp_group_name() ?>"><?php bp_group_avatar_thumb() ?></a>
 						</div>
 
 						<div class="item">
 							<div class="item-title"><a href="<?php bp_group_permalink() ?>" title="<?php bp_group_name() ?>"><?php bp_group_name() ?></a></div>
-							<div class="item-meta"><span class="activity"><?php bp_group_member_count() ?></span></div>
+							<div class="item-meta">
+								<span class="activity">
+								<?php
+									if ( 'newest' == $instance['group_default'] )
+										printf( __( 'created %s', 'buddypress' ), bp_get_group_date_created() );
+									if ( 'active' == $instance['group_default'] )
+										printf( __( 'active %s', 'buddypress' ), bp_get_group_last_active() );
+									else if ( 'popular' == $instance['group_default'] )
+										bp_group_member_count();
+								?>
+								</span>
+							</div>
 						</div>
 					</li>
 
@@ -66,17 +95,39 @@ 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['group_default'] = strip_tags( $new_instance['group_default'] );
 
 		return $instance;
 	}
 
 	function form( $instance ) {
-		$instance = wp_parse_args( (array) $instance, array( 'max_groups' => 5 ) );
+		$defaults = array(
+			'title'         => __( 'Groups', 'buddypress' ),
+			'max_groups'    => 5,
+			'group_default' => 'active'
+		);
+		$instance = wp_parse_args( (array) $instance, $defaults );
+
+		$title = strip_tags( $instance['title'] );
 		$max_groups = strip_tags( $instance['max_groups'] );
+		$group_default = strip_tags( $instance['group_default'] );
 		?>
 
+		<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="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>
+
+		<p>
+			<label for="bp-groups-widget-groups-default"><?php _e('Default groups to show:', 'buddypress'); ?>
+			<select name="<?php echo $this->get_field_name( 'group_default' ); ?>">
+				<option value="newest" <?php if ( $group_default == 'newest' ) : ?>selected="selected"<?php endif; ?>><?php _e( 'Newest', 'buddypress' ) ?></option>
+				<option value="active" <?php if ( $group_default == 'active' ) : ?>selected="selected"<?php endif; ?>><?php _e( 'Active', 'buddypress' ) ?></option>
+				<option value="popular"  <?php if ( $group_default == 'popular' ) : ?>selected="selected"<?php endif; ?>><?php _e( 'Popular', 'buddypress' ) ?></option>
+			</select>
+			</label>
+		</p>
 	<?php
 	}
 }
@@ -114,9 +165,9 @@ function groups_ajax_widget_groups_list() {
 							<span class="activity">
 								<?php
 								if ( 'newest-groups' == $_POST['filter'] ) {
-									printf( __( 'created %s ago', 'buddypress' ), bp_get_group_date_created() );
+									printf( __( 'created %s', 'buddypress' ), bp_get_group_date_created() );
 								} else if ( 'recently-active-groups' == $_POST['filter'] ) {
-									printf( __( 'active %s ago', 'buddypress' ), bp_get_group_last_active() );
+									printf( __( 'active %s', 'buddypress' ), bp_get_group_last_active() );
 								} else if ( 'popular-groups' == $_POST['filter'] ) {
 									bp_group_member_count();
 								}
@@ -139,4 +190,4 @@ function groups_ajax_widget_groups_list() {
 
 }
 add_action( 'wp_ajax_widget_groups_list', 'groups_ajax_widget_groups_list' );
-?>
+?>
\ No newline at end of file
diff --git a/wp-content/plugins/buddypress/bp-groups/js/widget-groups.dev.js b/wp-content/plugins/buddypress/bp-groups/js/widget-groups.dev.js
new file mode 100644
index 0000000000000000000000000000000000000000..52ed66cbf2abe9c1944f50d375a51d0e570ade24
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-groups/js/widget-groups.dev.js
@@ -0,0 +1,49 @@
+jQuery(document).ready( function() {
+	jQuery(".widget div#groups-list-options a").live('click',
+		function() {
+			var link = this;
+			jQuery(link).addClass('loading');
+
+			jQuery(".widget div#groups-list-options a").removeClass("selected");
+			jQuery(this).addClass('selected');
+
+			jQuery.post( ajaxurl, {
+				action: 'widget_groups_list',
+				'cookie': encodeURIComponent(document.cookie),
+				'_wpnonce': jQuery("input#_wpnonce-groups").val(),
+				'max_groups': jQuery("input#groups_widget_max").val(),
+				'filter': jQuery(this).attr('id')
+			},
+			function(response)
+			{
+				jQuery(link).removeClass('loading');
+				groups_wiget_response(response);
+			});
+
+			return false;
+		}
+	);
+});
+
+function groups_wiget_response(response) {
+	response = response.substr(0, response.length-1);
+	response = response.split('[[SPLIT]]');
+
+	if ( response[0] != "-1" ) {
+		jQuery(".widget ul#groups-list").fadeOut(200,
+			function() {
+				jQuery(".widget ul#groups-list").html(response[1]);
+				jQuery(".widget ul#groups-list").fadeIn(200);
+			}
+		);
+
+	} else {
+		jQuery(".widget ul#groups-list").fadeOut(200,
+			function() {
+				var message = '<p>' + response[1] + '</p>';
+				jQuery(".widget ul#groups-list").html(message);
+				jQuery(".widget ul#groups-list").fadeIn(200);
+			}
+		);
+	}
+}
\ No newline at end of file
diff --git a/wp-content/plugins/buddypress/bp-groups/js/widget-groups.js b/wp-content/plugins/buddypress/bp-groups/js/widget-groups.js
index 5748ef65a8a1dc92d008521b42ab1c1d67891463..f893d060eb9e9af5f07da7bf431b68f7503e2480 100644
--- a/wp-content/plugins/buddypress/bp-groups/js/widget-groups.js
+++ b/wp-content/plugins/buddypress/bp-groups/js/widget-groups.js
@@ -1,48 +1 @@
-jQuery(document).ready( function() {
-	jQuery(".widget div#groups-list-options a").live('click',
-		function() {
-			jQuery('#ajax-loader-groups').toggle();
-
-			jQuery(".widget div#groups-list-options a").removeClass("selected");
-			jQuery(this).addClass('selected');
-
-			jQuery.post( ajaxurl, {
-				action: 'widget_groups_list',
-				'cookie': encodeURIComponent(document.cookie),
-				'_wpnonce': jQuery("input#_wpnonce-groups").val(),
-				'max_groups': jQuery("input#groups_widget_max").val(),
-				'filter': jQuery(this).attr('id')
-			},
-			function(response)
-			{
-				jQuery('#ajax-loader-groups').toggle();
-				groups_wiget_response(response);
-			});
-
-			return false;
-		}
-	);
-});
-
-function groups_wiget_response(response) {
-	response = response.substr(0, response.length-1);
-	response = response.split('[[SPLIT]]');
-
-	if ( response[0] != "-1" ) {
-		jQuery(".widget ul#groups-list").fadeOut(200,
-			function() {
-				jQuery(".widget ul#groups-list").html(response[1]);
-				jQuery(".widget ul#groups-list").fadeIn(200);
-			}
-		);
-
-	} else {
-		jQuery(".widget ul#groups-list").fadeOut(200,
-			function() {
-				var message = '<p>' + response[1] + '</p>';
-				jQuery(".widget ul#groups-list").html(message);
-				jQuery(".widget ul#groups-list").fadeIn(200);
-			}
-		);
-	}
-}
\ No newline at end of file
+jQuery(document).ready(function(){jQuery(".widget div#groups-list-options a").live("click",function(){var a=this;jQuery(a).addClass("loading");jQuery(".widget div#groups-list-options a").removeClass("selected");jQuery(this).addClass("selected");jQuery.post(ajaxurl,{action:"widget_groups_list",cookie:encodeURIComponent(document.cookie),_wpnonce:jQuery("input#_wpnonce-groups").val(),max_groups:jQuery("input#groups_widget_max").val(),filter:jQuery(this).attr("id")},function(b){jQuery(a).removeClass("loading");groups_wiget_response(b)});return false})});function groups_wiget_response(a){a=a.substr(0,a.length-1);a=a.split("[[SPLIT]]");if(a[0]!="-1"){jQuery(".widget ul#groups-list").fadeOut(200,function(){jQuery(".widget ul#groups-list").html(a[1]);jQuery(".widget ul#groups-list").fadeIn(200)})}else{jQuery(".widget ul#groups-list").fadeOut(200,function(){var b="<p>"+a[1]+"</p>";jQuery(".widget ul#groups-list").html(b);jQuery(".widget ul#groups-list").fadeIn(200)})}};
\ No newline at end of file
diff --git a/wp-content/plugins/buddypress/bp-languages/buddypress.pot b/wp-content/plugins/buddypress/bp-languages/buddypress.pot
index 7830e3113e9ae3e2d52125f71bd1f6a71db118b2..36c46b55d220de37e49e4d0048e50bb2dafdf7ec 100644
--- a/wp-content/plugins/buddypress/bp-languages/buddypress.pot
+++ b/wp-content/plugins/buddypress/bp-languages/buddypress.pot
@@ -4,7 +4,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: BuddyPress \n"
 "Report-Msgid-Bugs-To: wp-polyglots@lists.automattic.com\n"
-"POT-Creation-Date: 2011-02-23 11:30:34+00:00\n"
+"POT-Creation-Date: 2011-12-23 20:31:22+00:00\n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=UTF-8\n"
 "Content-Transfer-Encoding: 8bit\n"
@@ -12,3247 +12,4029 @@ msgstr ""
 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
 "Language-Team: LANGUAGE <LL@li.org>\n"
 
-#: bp-friends.php:70
-msgid "Friends <span>(%d)</span>"
+#: bp-blogs/bp-blogs-loader.php:24 bp-core/admin/bp-core-admin.php:370
+msgid "Site Tracking"
 msgstr ""
 
-#: bp-friends.php:75 bp-friends.php:80 bp-friends.php:320
-#: bp-friends/bp-friends-templatetags.php:40
-msgid "My Friends"
-msgstr ""
-
-#: bp-friends.php:76
-msgid "Requests"
-msgstr ""
-
-#: bp-friends.php:118
-msgid "Friendship accepted"
-msgstr ""
-
-#: bp-friends.php:120
-msgid "Friendship could not be accepted"
+#: bp-blogs/bp-blogs-loader.php:58
+msgid "Search sites..."
 msgstr ""
 
-#: bp-friends.php:129
-msgid "Friendship rejected"
+#: bp-blogs/bp-blogs-loader.php:108
+msgid "Sites <span>%d</span>"
 msgstr ""
 
-#: bp-friends.php:131
-msgid "Friendship could not be rejected"
+#: bp-blogs/bp-blogs-loader.php:148 bp-core/admin/bp-core-update.php:501
+msgid "Sites"
 msgstr ""
 
-#: bp-friends.php:150 bp-core/bp-core-admin.php:201 bp-activity.php:123
-msgid "Friends"
+#: 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"
 msgstr ""
 
-#: bp-friends.php:151 bp-blogs/bp-blogs-templatetags.php:409
-#: bp-core/bp-core-admin.php:60 bp-core/bp-core-admin.php:68
-#: bp-core/bp-core-admin.php:75 bp-core/bp-core-admin.php:82
-#: bp-core/bp-core-admin.php:90 bp-core/bp-core-admin.php:99
-#: bp-activity.php:271 bp-xprofile/bp-xprofile-admin.php:93 bp-groups.php:987
-#: bp-messages.php:245 bp-themes/bp-default/registration/register.php:196
-#: bp-themes/bp-default/groups/single/admin.php:26
-msgid "Yes"
+#: bp-blogs/bp-blogs-activity.php:17
+msgid "New site created"
 msgstr ""
 
-#: bp-friends.php:152 bp-blogs/bp-blogs-templatetags.php:413
-#: bp-core/bp-core-admin.php:61 bp-core/bp-core-admin.php:69
-#: bp-core/bp-core-admin.php:76 bp-core/bp-core-admin.php:83
-#: bp-core/bp-core-admin.php:91 bp-core/bp-core-admin.php:100
-#: bp-activity.php:272 bp-groups.php:988 bp-messages.php:246
-#: bp-themes/bp-default/registration/register.php:197
-#: bp-themes/bp-default/groups/single/admin.php:27
-msgid "No"
+#: bp-blogs/bp-blogs-activity.php:18
+msgid "New post published"
 msgstr ""
 
-#: bp-friends.php:159
-msgid "A member sends you a friendship request"
+#: bp-blogs/bp-blogs-activity.php:19
+msgid "New post comment posted"
 msgstr ""
 
-#: bp-friends.php:165
-msgid "A member accepts your friendship request"
+#: bp-blogs/bp-blogs-buddybar.php:37 bp-core/bp-core-adminbar.php:133
+#: bp-core/bp-core-buddybar.php:481
+msgid "Dashboard"
 msgstr ""
 
-#: bp-friends.php:208 bp-themes/bp-default/_inc/ajax.php:351
-msgid "Friendship could not be requested."
+#: bp-blogs/bp-blogs-buddybar.php:38 bp-core/bp-core-adminbar.php:136
+#: bp-core/bp-core-buddybar.php:485
+msgid "New Post"
 msgstr ""
 
-#: bp-friends.php:210
-msgid "Friendship requested"
+#: bp-blogs/bp-blogs-buddybar.php:39 bp-core/bp-core-buddybar.php:486
+msgid "Manage Posts"
 msgstr ""
 
-#: bp-friends.php:213
-msgid "You are already friends with this user"
+#: bp-blogs/bp-blogs-buddybar.php:40 bp-core/bp-core-adminbar.php:137
+#: bp-core/bp-core-buddybar.php:487
+msgid "Manage Comments"
 msgstr ""
 
-#: bp-friends.php:215
-msgid "You already have a pending friendship request with this user"
+#: bp-blogs/bp-blogs-buddybar.php:53
+msgid "Create a Site!"
 msgstr ""
 
-#: bp-friends.php:246 bp-themes/bp-default/_inc/ajax.php:341
-msgid "Friendship could not be canceled."
+#: bp-blogs/bp-blogs-template.php:135
+msgctxt "Blog pagination previous text"
+msgid "&larr;"
 msgstr ""
 
-#: bp-friends.php:248
-msgid "Friendship canceled"
+#: bp-blogs/bp-blogs-template.php:136
+msgctxt "Blog pagination next text"
+msgid "&rarr;"
 msgstr ""
 
-#: bp-friends.php:251
-msgid "You are not yet friends with this user"
+#: bp-blogs/bp-blogs-template.php:258
+msgid "Viewing site %1$s to %2$s (of %3$s sites)"
 msgstr ""
 
-#: bp-friends.php:253
-msgid "You have a pending friendship request with this user"
+#: bp-blogs/bp-blogs-template.php:282 bp-activity/bp-activity-template.php:1000
+msgid "Site authored by %s"
 msgstr ""
 
-#: bp-friends.php:308
-msgid "New friendship created"
+#: 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"
 msgstr ""
 
-#: bp-friends.php:320
-msgid "%d friends accepted your friendship requests"
+#: bp-blogs/bp-blogs-template.php:357
+msgid "Latest Post: %s"
 msgstr ""
 
-#: bp-friends.php:324 bp-friends/bp-friends-notifications.php:62
-msgid "%s accepted your friendship request"
+#: bp-blogs/bp-blogs-template.php:421
+msgid "There was a problem, please correct the form below and try again."
 msgstr ""
 
-#: bp-friends.php:330 bp-friends.php:334
-msgid "Friendship requests"
+#: 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!"
 msgstr ""
 
-#: bp-friends.php:330
-msgid "You have %d pending friendship requests"
+#: 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!"
 msgstr ""
 
-#: bp-friends.php:334
-msgid "You have a friendship request from %s"
+#: bp-blogs/bp-blogs-template.php:435
+msgid "Create Site"
 msgstr ""
 
-#: bp-friends.php:433 bp-friends.php:442
-msgid "%s and %s are now friends"
+#: bp-blogs/bp-blogs-template.php:449
+msgid "Site Name:"
 msgstr ""
 
-#: bp-blogs/bp-blogs-widgets.php:18
-msgid "Recent Site Wide Posts"
+#: bp-blogs/bp-blogs-template.php:451
+msgid "Site Domain:"
 msgstr ""
 
-#: bp-blogs/bp-blogs-widgets.php:60
-msgid "Sorry, there were no blog posts found. Why not write one?"
+#: bp-blogs/bp-blogs-template.php:465
+msgid "Your address will be "
 msgstr ""
 
-#: bp-blogs/bp-blogs-widgets.php:80
-msgid "Max posts to show:"
+#: bp-blogs/bp-blogs-template.php:468
+msgid "blogname"
 msgstr ""
 
-#: bp-blogs/bp-blogs-templatetags.php:173
-msgid "Viewing blog %1$s to %2$s (of %3$s blogs)"
+#: bp-blogs/bp-blogs-template.php:470
+msgid "domain."
 msgstr ""
 
-#: bp-blogs/bp-blogs-templatetags.php:198
-msgid "Blog avatar"
+#: 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!)"
 msgstr ""
 
-#: bp-blogs/bp-blogs-templatetags.php:256 bp-core/bp-core-templatetags.php:355
-#: bp-core/bp-core-templatetags.php:1327 bp-core/bp-core-classes.php:82
-#: bp-groups/bp-groups-widgets.php:119
-#: bp-themes/bp-default/groups/groups-loop.php:31
-#: bp-themes/bp-default/groups/single/group-header.php:31
-msgid "active %s ago"
+#: bp-blogs/bp-blogs-template.php:479
+msgid "Site Title:"
 msgstr ""
 
-#: bp-blogs/bp-blogs-templatetags.php:268
-msgid "Latest Post: %s"
+#: bp-blogs/bp-blogs-template.php:490
+msgid "Privacy:"
 msgstr ""
 
-#: bp-blogs/bp-blogs-templatetags.php:340
-msgid "There was a problem, please correct the form below and try again."
+#: 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."
 msgstr ""
 
-#: bp-blogs/bp-blogs-templatetags.php:343
-msgid "By filling out the form below, you can <strong>add a blog to your account</strong>. There is no limit to the number of blogs you can have, so create to your heart's content, but blog responsibly."
+#: 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"
 msgstr ""
 
-#: bp-blogs/bp-blogs-templatetags.php:345
-msgid "If you&#8217;re not going to use a great blog domain, leave it for a new user. Now have at it!"
+#: 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"
 msgstr ""
 
-#: bp-blogs/bp-blogs-templatetags.php:354
-msgid "Create Blog &rarr;"
+#: bp-blogs/bp-blogs-template.php:574
+msgid "Congratulations! You have successfully registered a new site."
 msgstr ""
 
-#: bp-blogs/bp-blogs-templatetags.php:368
-msgid "Blog Name:"
+#: 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."
 msgstr ""
 
-#: bp-blogs/bp-blogs-templatetags.php:370
-msgid "Blog Domain:"
+#: 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"
 msgstr ""
 
-#: bp-blogs/bp-blogs-templatetags.php:382
-msgid "Your address will be "
+#: bp-blogs/bp-blogs-template.php:600
+msgid "%s's Sites"
 msgstr ""
 
-#: bp-blogs/bp-blogs-templatetags.php:385
-msgid "blogname"
+#: bp-blogs/bp-blogs-template.php:601
+msgid "%s's Recent Posts"
 msgstr ""
 
-#: bp-blogs/bp-blogs-templatetags.php:387
-msgid "domain."
+#: bp-blogs/bp-blogs-template.php:602
+msgid "%s's Recent Comments"
 msgstr ""
 
-#: bp-blogs/bp-blogs-templatetags.php:390
-msgid "Must be at least 4 characters, letters and numbers only. It cannot be changed so choose carefully!)"
+#: 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"
 msgstr ""
 
-#: bp-blogs/bp-blogs-templatetags.php:395
-msgid "Blog Title:"
+#: bp-blogs/bp-blogs-template.php:650 bp-blogs/bp-blogs-template.php:651
+#: bp-core/bp-core-adminbar.php:140
+msgid "Visit Site"
 msgstr ""
 
-#: bp-blogs/bp-blogs-templatetags.php:403
-msgid "Privacy:"
+#: bp-blogs/bp-blogs-functions.php:115
+msgid "%s created the site %s"
 msgstr ""
 
-#: bp-blogs/bp-blogs-templatetags.php:404
-msgid "I would like my blog to appear in search engines like Google and Technorati, and in public listings around this site."
+#: bp-blogs/bp-blogs-functions.php:187
+msgid "%1$s wrote a new post, %2$s, on the site %3$s"
 msgstr ""
 
-#: bp-blogs/bp-blogs-templatetags.php:464
-msgid "Congratulations! You have successfully registered a new blog."
+#: bp-blogs/bp-blogs-functions.php:189
+msgid "%1$s wrote a new post, %2$s"
 msgstr ""
 
-#: bp-blogs/bp-blogs-templatetags.php:466
-msgid "<a href=\"http://%1$s\">http://%2$s</a> is your new blog.  <a href=\"%3$s\">Login</a> as \"%4$s\" using your existing password."
+#: bp-blogs/bp-blogs-functions.php:272
+msgid "%1$s commented on the post, %2$s, on the site %3$s"
 msgstr ""
 
-#: bp-blogs/bp-blogs-templatetags.php:476 bp-core/bp-core-templatetags.php:928
-#: bp-themes/bp-default/blogs/index.php:8
-#: bp-themes/bp-default/blogs/create.php:10
-msgid "Create a Blog"
+#: bp-blogs/bp-blogs-functions.php:274
+msgid "%1$s commented on the post, %2$s"
 msgstr ""
 
-#: bp-blogs/bp-blogs-templatetags.php:490
-msgid "%s's Blogs"
+#: bp-blogs/bp-blogs-widgets.php:25
+msgid "Recent Networkwide Posts"
 msgstr ""
 
-#: bp-blogs/bp-blogs-templatetags.php:491
-msgid "%s's Recent Posts"
+#: bp-blogs/bp-blogs-widgets.php:68
+msgid "Sorry, there were no posts found. Why not write one?"
 msgstr ""
 
-#: bp-blogs/bp-blogs-templatetags.php:492
-msgid "%s's Recent Comments"
+#: bp-blogs/bp-blogs-widgets.php:88
+msgid "Max posts to show:"
 msgstr ""
 
-#: bp-blogs/bp-blogs-templatetags.php:501 bp-core/bp-core-templatetags.php:447
-#: bp-core/bp-core-templatetags.php:453
-#: bp-groups/bp-groups-templatetags.php:1810
-#: bp-groups/bp-groups-templatetags.php:1816
-#: bp-forums/bp-forums-templatetags.php:1028
-#: bp-forums/bp-forums-templatetags.php:1034
-#: bp-themes/bp-default/_inc/ajax.php:56
-msgid "Search anything..."
+#: bp-core/bp-core-widgets.php:22
+msgid "A dynamic list of recently active, popular, and newest members"
 msgstr ""
 
-#: bp-blogs/bp-blogs-templatetags.php:502 bp-core/bp-core-templatetags.php:454
-#: bp-core/bp-core-templatetags.php:1048
-#: bp-groups/bp-groups-templatetags.php:1817
-#: bp-forums/bp-forums-templatetags.php:1035 bp-themes/bp-default/header.php:93
-#: bp-themes/bp-default/searchform.php:5
-msgid "Search"
+#: 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"
 msgstr ""
 
-#: bp-blogs/bp-blogs-templatetags.php:534
-#: bp-blogs/bp-blogs-templatetags.php:535
-msgid "Visit Blog"
+#: 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"
 msgstr ""
 
-#: bp-forums.php:56
-msgid "The forums component has not been set up yet."
+#: 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"
 msgstr ""
 
-#: bp-forums.php:76 bp-groups.php:554
-msgid "There was an error when creating the topic"
+#: 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"
 msgstr ""
 
-#: bp-forums.php:78 bp-groups.php:556
-msgid "The topic was created successfully"
+#: bp-core/bp-core-widgets.php:90
+msgid "No one has signed up yet!"
 msgstr ""
 
-#: bp-forums.php:82
-msgid "Please pick the group forum where you would like to post this topic."
+#: 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:"
 msgstr ""
 
-#: bp-forums.php:103 bp-forums/bp-forums-admin.php:8
-msgid "Forums Setup"
+#: bp-core/bp-core-widgets.php:123
+msgid "Max members to show:"
 msgstr ""
 
-#: bp-core/bp-core-widgets.php:15 bp-core/bp-core-templatetags.php:1026
-#: bp-themes/bp-default/header.php:58
-#: bp-themes/bp-default/groups/single/admin.php:174
-msgid "Members"
+#: bp-core/bp-core-widgets.php:126
+msgid "Default members to show:"
 msgstr ""
 
-#: bp-core/bp-core-widgets.php:34 bp-friends/bp-friends-templatetags.php:7
-#: bp-friends/bp-friends-templatetags.php:23 bp-groups/bp-groups-widgets.php:32
-#: bp-themes/bp-default/members/single/blogs.php:9
-#: bp-themes/bp-default/blogs/index.php:31
-msgid "Newest"
+#: bp-core/bp-core-widgets.php:148
+msgid "Avatars of users who are currently online"
 msgstr ""
 
-#: bp-core/bp-core-widgets.php:35 bp-groups/bp-groups-widgets.php:33
-msgid "Active"
+#: bp-core/bp-core-widgets.php:149
+msgid "Who's Online Avatars"
 msgstr ""
 
-#: bp-core/bp-core-widgets.php:39 bp-groups/bp-groups-widgets.php:34
-msgid "Popular"
+#: bp-core/bp-core-widgets.php:173
+msgid "There are no users currently online"
 msgstr ""
 
-#: bp-core/bp-core-widgets.php:66
-msgid "No one has signed up yet!"
+#: bp-core/bp-core-widgets.php:192
+msgid "Who's Online"
 msgstr ""
 
-#: bp-core/bp-core-widgets.php:87 bp-core/bp-core-widgets.php:141
-#: bp-core/bp-core-widgets.php:195
+#: bp-core/bp-core-widgets.php:203 bp-core/bp-core-widgets.php:272
 msgid "Max Members to show:"
 msgstr ""
 
-#: bp-core/bp-core-widgets.php:96
-msgid "Who's Online Avatars"
-msgstr ""
-
-#: bp-core/bp-core-widgets.php:120
-msgid "There are no users currently online"
+#: bp-core/bp-core-widgets.php:217
+msgid "Avatars of recently active members"
 msgstr ""
 
-#: bp-core/bp-core-widgets.php:150
+#: bp-core/bp-core-widgets.php:218
 msgid "Recently Active Member Avatars"
 msgstr ""
 
-#: bp-core/bp-core-widgets.php:174
+#: bp-core/bp-core-widgets.php:242
 msgid "There are no recently active members"
 msgstr ""
 
-#: bp-core/bp-core-widgets.php:249
+#: bp-core/bp-core-widgets.php:328
 msgid "There were no members found, please try another filter."
 msgstr ""
 
-#: bp-core/bp-core-adminbar.php:44 bp-themes/bp-default/sidebar.php:50
-msgid "Log In"
+#: bp-core/bp-core-adminbar.php:92
+msgid "Admin Dashboard"
 msgstr ""
 
-#: bp-core/bp-core-adminbar.php:48
-msgid "Sign Up"
+#: bp-core/bp-core-adminbar.php:103
+msgid "Network Dashboard"
 msgstr ""
 
-#: bp-core/bp-core-adminbar.php:61
-msgid "My Account"
+#: bp-core/bp-core-adminbar.php:128
+msgid "Blavatar"
 msgstr ""
 
-#: bp-core/bp-core-adminbar.php:93 bp-core/bp-core-templatetags.php:516
-#: bp-core/bp-core-templatetags.php:518 bp-core/bp-core-templatetags.php:1059
-#: bp-core/bp-core-templatetags.php:1061 bp-themes/bp-default/sidebar.php:18
-msgid "Log Out"
+#: bp-core/bp-core-adminbar.php:157
+msgid "Comments %s"
 msgstr ""
 
-#: bp-core/bp-core-adminbar.php:115 bp-blogs.php:117
-msgid "My Blogs"
+#: bp-core/bp-core-adminbar.php:170
+msgid "Appearance"
 msgstr ""
 
-#: bp-core/bp-core-adminbar.php:129 bp-core/bp-core-adminbar.php:155
-msgid "Dashboard"
+#: bp-core/bp-core-adminbar.php:176
+msgid "Themes"
 msgstr ""
 
-#: bp-core/bp-core-adminbar.php:130 bp-core/bp-core-adminbar.php:160
-msgid "New Post"
+#: bp-core/bp-core-adminbar.php:179
+msgid "Widgets"
 msgstr ""
 
-#: bp-core/bp-core-adminbar.php:131 bp-core/bp-core-adminbar.php:161
-msgid "Manage Posts"
+#: bp-core/bp-core-adminbar.php:182
+msgid "Menus"
 msgstr ""
 
-#: bp-core/bp-core-adminbar.php:132 bp-core/bp-core-adminbar.php:162
-msgid "Manage Comments"
+#: bp-core/bp-core-adminbar.php:185
+msgid "Background"
 msgstr ""
 
-#: bp-core/bp-core-adminbar.php:143
-msgid "Create a Blog!"
+#: bp-core/bp-core-adminbar.php:188
+msgid "Header"
 msgstr ""
 
-#: bp-core/bp-core-adminbar.php:179 bp-core/bp-core-settings.php:22
-msgid "Notifications"
+#: bp-core/bp-core-adminbar.php:220
+msgid "%d WordPress Update"
 msgstr ""
 
-#: bp-core/bp-core-adminbar.php:200
-msgid "No new notifications."
-msgstr ""
+#: bp-core/bp-core-adminbar.php:222
+msgid "%d Plugin Update"
+msgid_plural "%d Plugin Updates"
+msgstr[0] ""
+msgstr[1] ""
 
-#: bp-core/bp-core-adminbar.php:227
-msgid "Blog Authors"
+#: bp-core/bp-core-adminbar.php:224
+msgid "%d Theme Update"
+msgid_plural "%d Theme Updates"
+msgstr[0] ""
+msgstr[1] ""
+
+#: bp-core/bp-core-adminbar.php:229
+msgid "Updates %s"
 msgstr ""
 
-#: bp-core/bp-core-adminbar.php:252
-msgid "Visit"
+#: bp-core/admin/bp-core-schema.php:208
+msgctxt "First XProfile group name"
+msgid "Base"
 msgstr ""
 
-#: bp-core/bp-core-adminbar.php:254
-msgid "Random Member"
+#: bp-core/admin/bp-core-schema.php:209
+msgctxt "XProfile fullname field name"
+msgid "Name"
 msgstr ""
 
-#: bp-core/bp-core-adminbar.php:258
-msgid "Random Group"
+#: 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>"
 msgstr ""
 
-#: bp-core/bp-core-adminbar.php:264
-msgid "Random Blog"
+#: 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"
 msgstr ""
 
-#: bp-core/bp-core-avatars.php:67
-msgid "Avatar Image"
+#: 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"
 msgstr ""
 
-#: bp-core/bp-core-avatars.php:332
-msgid "There is no error, the file uploaded with success"
+#: 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"
 msgstr ""
 
-#: bp-core/bp-core-avatars.php:333 bp-core/bp-core-avatars.php:334
-msgid "Your image was bigger than the maximum allowed file size of: "
+#: 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"
 msgstr ""
 
-#: bp-core/bp-core-avatars.php:335
-msgid "The uploaded file was only partially uploaded"
+#: 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"
 msgstr ""
 
-#: bp-core/bp-core-avatars.php:336
-msgid "No file was uploaded"
+#: bp-core/admin/bp-core-admin.php:109
+msgid "Disable BuddyPress to WordPress profile syncing?"
 msgstr ""
 
-#: bp-core/bp-core-avatars.php:337
-msgid "Missing a temporary folder"
+#: bp-core/admin/bp-core-admin.php:119
+msgid "Hide admin bar for logged out users?"
 msgstr ""
 
-#: bp-core/bp-core-avatars.php:341
-msgid "Your upload failed, please try again. Error was: %s"
+#: bp-core/admin/bp-core-admin.php:127
+msgid "Disable avatar uploads? (Gravatars will still work)"
 msgstr ""
 
-#: bp-core/bp-core-avatars.php:346
-msgid "The file you uploaded is too big. Please upload a file under %s"
+#: bp-core/admin/bp-core-admin.php:135
+msgid "Disable user account deletion?"
 msgstr ""
 
-#: bp-core/bp-core-avatars.php:351
-msgid "Please upload only JPG, GIF or PNG photos."
+#: bp-core/admin/bp-core-admin.php:145
+msgid "Disable activity stream commenting on blog and forum posts?"
 msgstr ""
 
-#: bp-core/bp-core-avatars.php:362 bp-core/bp-core-avatars.php:375
-msgid "Upload Failed! Error was: %s"
+#: bp-core/admin/bp-core-admin.php:157
+msgid "Restrict group creation to Site Admins?"
 msgstr ""
 
-#: bp-core/bp-core-filters.php:29
-msgid "noreply"
+#: bp-core/admin/bp-core-admin.php:174 bp-core/admin/bp-core-admin.php:268
+msgid "Save Settings"
 msgstr ""
 
-#: bp-core/bp-core-filters.php:133 bp-core/bp-core-filters.php:157
-msgid "[User Set]"
+#: bp-core/admin/bp-core-admin.php:310
+msgid "Save All"
 msgstr ""
 
-#: bp-core/bp-core-filters.php:177
-msgid ""
-"Thanks for registering! To complete the activation of your account and blog, please click the following link:\n"
-"\n"
-"%s\n"
-"\n"
-"\n"
-"\n"
-"After you activate, you can visit your blog here:\n"
-"\n"
-"%s"
+#: bp-core/admin/bp-core-admin.php:342 bp-xprofile/bp-xprofile-loader.php:25
+msgid "Extended Profiles"
 msgstr ""
 
-#: bp-core/bp-core-filters.php:178
-msgid "Activate %s"
+#: bp-core/admin/bp-core-admin.php:343
+msgid "Customize your community with fully editable profile fields that allow your users to describe themselves."
 msgstr ""
 
-#: bp-core/bp-core-filters.php:209 bp-core/bp-core-signup.php:542
-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-admin.php:346
+msgid "Account Settings"
 msgstr ""
 
-#: bp-core/bp-core-filters.php:210 bp-core/bp-core-signup.php:543
-msgid "Activate Your Account"
+#: bp-core/admin/bp-core-admin.php:347
+msgid "Allow your users to modify their account and notification settings directly from within their profiles."
 msgstr ""
 
-#: bp-core/bp-core-signup.php:47
-msgid "Please make sure you enter your password twice"
+#: bp-core/admin/bp-core-admin.php:350 bp-friends/bp-friends-loader.php:24
+msgid "Friend Connections"
 msgstr ""
 
-#: bp-core/bp-core-signup.php:51
-msgid "The passwords you entered do not match."
+#: 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."
 msgstr ""
 
-#: bp-core/bp-core-signup.php:74
-msgid "This is a required field"
+#: bp-core/admin/bp-core-admin.php:354
+msgid "Private Messaging"
 msgstr ""
 
-#: bp-core/bp-core-signup.php:168
-msgid "There was a problem uploading your avatar, please try uploading it again"
+#: 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."
 msgstr ""
 
-#: bp-core/bp-core-signup.php:198 bp-xprofile.php:386
-msgid "There was a problem cropping your avatar, please try uploading it again"
+#: bp-core/admin/bp-core-admin.php:358 bp-activity/bp-activity-loader.php:34
+msgid "Activity Streams"
 msgstr ""
 
-#: bp-core/bp-core-signup.php:200
-msgid "Your new avatar was uploaded successfully"
+#: 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."
 msgstr ""
 
-#: bp-core/bp-core-signup.php:222 bp-core/bp-core-signup.php:412
-msgid "There was an error activating your account, please try again."
+#: bp-core/admin/bp-core-admin.php:362 bp-groups/bp-groups-loader.php:26
+msgid "User Groups"
 msgstr ""
 
-#: bp-core/bp-core-signup.php:236
-msgid "Your account is now active!"
+#: 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 ""
 
-#: bp-core/bp-core-signup.php:275
-msgid "Please enter a username"
+#: bp-core/admin/bp-core-admin.php:366 bp-forums/bp-forums-loader.php:24
+msgid "Discussion Forums"
 msgstr ""
 
-#: bp-core/bp-core-signup.php:284
-msgid "Only lowercase letters and numbers allowed"
+#: 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."
 msgstr ""
 
-#: bp-core/bp-core-signup.php:287
-msgid "Username must be at least 4 characters"
+#: bp-core/admin/bp-core-admin.php:371
+msgid "Make BuddyPress aware of new posts and new comments from your site."
 msgstr ""
 
-#: bp-core/bp-core-signup.php:290
-msgid "Sorry, usernames may not contain the character \"_\"!"
+#: 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."
 msgstr ""
 
-#: bp-core/bp-core-signup.php:297
-msgid "Sorry, usernames must have letters too!"
+#: bp-core/admin/bp-core-admin.php:400 bp-core/bp-core-loader.php:38
+msgid "BuddyPress Core"
 msgstr ""
 
-#: bp-core/bp-core-signup.php:300
-msgid "Please check your email address."
+#: bp-core/admin/bp-core-admin.php:401
+msgid "It&#8216;s what makes <del>time travel</del> BuddyPress possible!"
 msgstr ""
 
-#: bp-core/bp-core-signup.php:308
-msgid "Sorry, that email address is not allowed!"
+#: bp-core/admin/bp-core-admin.php:404
+msgid "Community Members"
 msgstr ""
 
-#: bp-core/bp-core-signup.php:313
-msgid "Sorry, that username already exists!"
+#: bp-core/admin/bp-core-admin.php:405
+msgid "Everything in a BuddyPress community revolves around its members."
 msgstr ""
 
-#: bp-core/bp-core-signup.php:317
-msgid "Sorry, that email address is already used!"
+#: bp-core/admin/bp-core-admin.php:418
+msgid "Available Components"
 msgstr ""
 
-#: bp-core/bp-core-signup.php:352
-msgid "<strong>ERROR</strong>: Couldn&#8217;t register you... please contact the <a href=\"mailto:%s\">webmaster</a> !"
+#: bp-core/admin/bp-core-admin.php:420
+msgid "Each component has a unique purpose, and your community may not need each one."
 msgstr ""
 
-#: bp-core/bp-core-signup.php:437 bp-core/bp-core-signup.php:441
-msgid "Invalid activation key"
+#: bp-core/admin/bp-core-admin.php:450
+msgid "Required Components"
 msgstr ""
 
-#: bp-core/bp-core-signup.php:484
-msgid "%s became a registered member"
+#: bp-core/admin/bp-core-admin.php:452
+msgid "The following components are required by BuddyPress and cannot be turned off."
 msgstr ""
 
-#: bp-core/bp-core-templatetags.php:184
-msgid "Viewing member %1$s to %2$s (of %3$s active members)"
+#: bp-core/admin/bp-core-admin.php:520
+msgid "Directories"
 msgstr ""
 
-#: bp-core/bp-core-templatetags.php:186
-msgid "Viewing member %1$s to %2$s (of %3$s members with friends)"
+#: bp-core/admin/bp-core-admin.php:522
+msgid "Associate a WordPress Page with each BuddyPress component directory."
 msgstr ""
 
-#: bp-core/bp-core-templatetags.php:188
-msgid "Viewing member %1$s to %2$s (of %3$s members online)"
+#: bp-core/admin/bp-core-admin.php:542 bp-core/admin/bp-core-admin.php:595
+msgid "- None -"
 msgstr ""
 
-#: bp-core/bp-core-templatetags.php:190
-msgid "Viewing member %1$s to %2$s (of %3$s members)"
+#: bp-core/admin/bp-core-admin.php:546 bp-core/admin/bp-core-admin.php:599
+msgid "New Page"
 msgstr ""
 
-#: bp-core/bp-core-templatetags.php:314
-msgid "Member avatar"
+#: 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"
 msgstr ""
 
-#: bp-core/bp-core-templatetags.php:379
-#: bp-themes/bp-default/activity/entry.php:46
-#: bp-activity/bp-activity-templatetags.php:580
-#: bp-activity/bp-activity-templatetags.php:817
+#: 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"
 msgstr ""
 
-#: bp-core/bp-core-templatetags.php:415
-msgid "registered %s ago"
+#: 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"
 msgstr ""
 
-#: bp-core/bp-core-templatetags.php:599
-msgid "Options"
+#: 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"
 msgstr ""
 
-#: bp-core/bp-core-templatetags.php:736 bp-core.php:383 bp-xprofile.php:183
-#: bp-themes/bp-default/activity/post-form.php:41
-msgid "My Profile"
+#: bp-core/admin/bp-core-admin.php:577
+msgid "Registration"
 msgstr ""
 
-#: bp-core/bp-core-templatetags.php:742 bp-themes/bp-default/comments.php:120
-msgid "Name"
+#: bp-core/admin/bp-core-admin.php:579
+msgid "Associate WordPress Pages with the following BuddyPress Registration pages."
 msgstr ""
 
-#: bp-core/bp-core-templatetags.php:752
-msgid "About Me"
+#: bp-core/admin/bp-core-update.php:74 bp-core/admin/bp-core-update.php:227
+msgid "Permalinks"
 msgstr ""
 
-#: bp-core/bp-core-templatetags.php:762 bp-themes/bp-default/comments.php:130
-msgid "Website"
+#: bp-core/admin/bp-core-update.php:75 bp-core/admin/bp-core-update.php:231
+msgid "Theme"
 msgstr ""
 
-#: bp-core/bp-core-templatetags.php:772
-msgid "Jabber"
+#: 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"
 msgstr ""
 
-#: bp-core/bp-core-templatetags.php:782
-msgid "AOL Messenger"
+#: bp-core/admin/bp-core-update.php:82 bp-core/admin/bp-core-update.php:211
+msgid "Multisite Update"
 msgstr ""
 
-#: bp-core/bp-core-templatetags.php:792
-msgid "Yahoo Messenger"
+#: bp-core/admin/bp-core-update.php:85 bp-core/admin/bp-core-update.php:207
+msgid "Database Update"
 msgstr ""
 
-#: bp-core/bp-core-templatetags.php:834
-msgid "%1$s at %2$s"
+#: bp-core/admin/bp-core-update.php:145 bp-core/admin/bp-core-update.php:1231
+msgid "Update"
 msgstr ""
 
-#: bp-core/bp-core-templatetags.php:892 bp-groups.php:201
-#: bp-themes/bp-default/header.php:44 bp-themes/bp-default/header.php:48
-msgid "Home"
+#: bp-core/admin/bp-core-update.php:145 bp-core/admin/bp-core-update.php:1229
+msgid "Setup"
 msgstr ""
 
-#: bp-core/bp-core-templatetags.php:904 bp-themes/bp-default/attachment.php:9
-#: bp-themes/bp-default/search.php:10
-msgid "Blog"
+#: bp-core/admin/bp-core-update.php:153
+msgid "BuddyPress %s"
 msgstr ""
 
-#: bp-core/bp-core-templatetags.php:914 bp-core/bp-core-templatetags.php:916
-msgid "%s Directory"
+#: bp-core/admin/bp-core-update.php:191
+msgid "Finish &amp; Activate"
 msgstr ""
 
-#: bp-core/bp-core-templatetags.php:919
-#: bp-themes/bp-default/registration/register.php:14
-msgid "Create an Account"
+#: bp-core/admin/bp-core-update.php:197
+msgid "Save &amp; Next"
 msgstr ""
 
-#: bp-core/bp-core-templatetags.php:922
-#: bp-themes/bp-default/registration/activate.php:28
-msgid "Activate your Account"
+#: 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"
 msgstr ""
 
-#: bp-core/bp-core-templatetags.php:925 bp-themes/bp-default/groups/index.php:7
-#: bp-themes/bp-default/groups/create.php:7
-msgid "Create a Group"
+#: 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."
 msgstr ""
 
-#: bp-core/bp-core-templatetags.php:1029 bp-core/bp-core-admin.php:210
-#: bp-activity.php:126 bp-groups/bp-groups-widgets.php:13 bp-groups.php:986
-#: bp-groups.php:1410 bp-groups.php:1423 bp-groups.php:1436 bp-groups.php:1449
-#: bp-themes/bp-default/header.php:63
-msgid "Groups"
+#: 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>."
 msgstr ""
 
-#: bp-core/bp-core-templatetags.php:1032 bp-forums/bp-forums-admin.php:160
-#: bp-themes/bp-default/header.php:68
-msgid "Forums"
+#: 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 ""
 
-#: bp-core/bp-core-templatetags.php:1035 bp-themes/bp-default/header.php:75
-msgid "Blogs"
+#: bp-core/admin/bp-core-update.php:306 bp-core/admin/bp-core-update.php:436
+msgid "Please Note:"
 msgstr ""
 
-#: bp-core/bp-core-templatetags.php:1213
-msgid "Your Avatar"
+#: 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."
 msgstr ""
 
-#: bp-core/bp-core-templatetags.php:1286
-msgid "a user"
+#: 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?"
 msgstr ""
 
-#: bp-core/bp-core-cssjs.php:56
-msgid "Are you sure?"
+#: bp-core/admin/bp-core-update.php:313
+msgid "Enable Site Tracking?"
 msgstr ""
 
-#: bp-core/bp-core-classes.php:96
-msgid "group"
+#: bp-core/admin/bp-core-update.php:319
+msgid "Track new sites, new posts and new comments across your entire network."
 msgstr ""
 
-#: bp-core/bp-core-classes.php:98 bp-activity/bp-activity-templatetags.php:877
-msgid "groups"
+#: bp-core/admin/bp-core-update.php:327
+msgid "Select a WordPress page for the Sites directory."
 msgstr ""
 
-#: bp-core/bp-core-catchuri.php:262
-msgid "This user has been marked as a spammer. Only site admins can view this profile."
+#: 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:"
 msgstr ""
 
-#: bp-core/bp-core-admin.php:32
-msgid "BuddyPress Settings"
+#: 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 ""
 
-#: bp-core/bp-core-admin.php:36 bp-core/bp-core-admin.php:160
-msgid "Settings Saved"
+#: 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 -"
 msgstr ""
 
-#: bp-core/bp-core-admin.php:46
-msgid "Base profile group name"
+#: 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."
 msgstr ""
 
-#: bp-core/bp-core-admin.php:52
-msgid "Full Name field name"
+#: bp-core/admin/bp-core-update.php:402
+msgid "members"
 msgstr ""
 
-#: bp-core/bp-core-admin.php:58
-msgid "Disable BuddyPress to WordPress profile syncing?"
+#: bp-core/admin/bp-core-update.php:405
+#: bp-activity/bp-activity-template.php:2142
+msgid "groups"
 msgstr ""
 
-#: bp-core/bp-core-admin.php:66
-msgid "Hide admin bar for logged out users?"
+#: bp-core/admin/bp-core-update.php:408
+msgid "activity"
 msgstr ""
 
-#: bp-core/bp-core-admin.php:73
-msgid "Disable avatar uploads? (Gravatars will still work)"
+#: bp-core/admin/bp-core-update.php:411
+msgid "forums"
 msgstr ""
 
-#: bp-core/bp-core-admin.php:80
-msgid "Disable user account deletion?"
+#: bp-core/admin/bp-core-update.php:414
+msgid "blogs"
 msgstr ""
 
-#: bp-core/bp-core-admin.php:88
-msgid "Disable global forum directory?"
+#: bp-core/admin/bp-core-update.php:417
+msgid "register"
 msgstr ""
 
-#: bp-core/bp-core-admin.php:97
-msgid "Disable activity stream commenting on blog and forum posts?"
+#: bp-core/admin/bp-core-update.php:420
+msgid "activate"
 msgstr ""
 
-#: bp-core/bp-core-admin.php:106
-msgid "Default User Avatar"
+#: 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."
 msgstr ""
 
-#: bp-core/bp-core-admin.php:108
-msgid "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"
+#: 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."
 msgstr ""
 
-#: bp-core/bp-core-admin.php:110
-msgid "Mystery Man"
+#: bp-core/admin/bp-core-update.php:443
+msgid "Displays member profiles, and a directory of all site members."
 msgstr ""
 
-#: bp-core/bp-core-admin.php:111
-msgid "Identicon (Generated)"
+#: bp-core/admin/bp-core-update.php:455
+#: bp-themes/bp-default/activity/index.php:23
+msgid "Site Activity"
 msgstr ""
 
-#: bp-core/bp-core-admin.php:112
-msgid "Wavatar (Generated)"
+#: bp-core/admin/bp-core-update.php:456
+msgid "Displays the activity for the entire site, a member's friends, groups and @mentions."
 msgstr ""
 
-#: bp-core/bp-core-admin.php:113
-msgid "MonsterID (Generated)"
+#: 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"
 msgstr ""
 
-#: bp-core/bp-core-admin.php:124 bp-core/bp-core-admin.php:239
-msgid "Save Settings"
+#: bp-core/admin/bp-core-update.php:471
+msgid "Displays individual groups as well as a directory of groups."
 msgstr ""
 
-#: bp-core/bp-core-admin.php:156
-msgid "BuddyPress Component Setup"
+#: bp-core/admin/bp-core-update.php:486
+msgid "Displays a directory of public forum topics."
 msgstr ""
 
-#: bp-core/bp-core-admin.php:166
-msgid "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."
+#: bp-core/admin/bp-core-update.php:502
+msgid "Displays a directory of the sites in your network."
 msgstr ""
 
-#: bp-core/bp-core-admin.php:174
-msgid "Activity Streams"
+#: bp-core/admin/bp-core-update.php:515
+msgid "Displays a site registration page where users can create new accounts."
 msgstr ""
 
-#: bp-core/bp-core-admin.php:174
-msgid "Allow users to post activity updates and track all activity across the entire site."
+#: bp-core/admin/bp-core-update.php:526
+msgid "The page users will visit to activate their account once they have registered."
 msgstr ""
 
-#: bp-core/bp-core-admin.php:176 bp-core/bp-core-admin.php:185
-#: bp-core/bp-core-admin.php:194 bp-core/bp-core-admin.php:203
-#: bp-core/bp-core-admin.php:212 bp-core/bp-core-admin.php:221
-#: bp-core/bp-core-admin.php:230
-msgid "Enabled"
+#: 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."
 msgstr ""
 
-#: bp-core/bp-core-admin.php:177 bp-core/bp-core-admin.php:186
-#: bp-core/bp-core-admin.php:195 bp-core/bp-core-admin.php:204
-#: bp-core/bp-core-admin.php:213 bp-core/bp-core-admin.php:222
-#: bp-core/bp-core-admin.php:231
-msgid "Disabled"
+#: 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."
 msgstr ""
 
-#: bp-core/bp-core-admin.php:183
-msgid "Blog Tracking"
+#: 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."
 msgstr ""
 
-#: bp-core/bp-core-admin.php:183
-msgid "Tracks blogs, blog posts and blogs comments for a user across a WPMU installation."
+#: bp-core/admin/bp-core-update.php:571
+msgid "Day and name"
 msgstr ""
 
-#: bp-core/bp-core-admin.php:192
-msgid "bbPress Forums"
+#: bp-core/admin/bp-core-update.php:575
+msgid "Month and name"
 msgstr ""
 
-#: bp-core/bp-core-admin.php:192
-msgid "Activates bbPress forum support within BuddyPress groups or any other custom component."
+#: bp-core/admin/bp-core-update.php:579
+msgid "Numeric"
 msgstr ""
 
-#: bp-core/bp-core-admin.php:201
-msgid "Allows the creation of friend connections between users."
+#: 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."
 msgstr ""
 
-#: bp-core/bp-core-admin.php:210
-msgid "Let users create, join and participate in groups."
+#: bp-core/admin/bp-core-update.php:649
+msgid "Use BuddyPress Default"
 msgstr ""
 
-#: bp-core/bp-core-admin.php:219
-msgid "Private Messaging"
+#: bp-core/admin/bp-core-update.php:650
+msgid "BuddyPress Default"
 msgstr ""
 
-#: bp-core/bp-core-admin.php:219
-msgid "Let users send private messages to one another. Site admins can also send site-wide notices."
+#: 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."
 msgstr ""
 
-#: bp-core/bp-core-admin.php:228
-msgid "Extended Profiles"
+#: 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."
 msgstr ""
 
-#: bp-core/bp-core-admin.php:228
-msgid "Activates customizable profiles and avatars for site users."
+#: bp-core/admin/bp-core-update.php:655
+msgid "Yes, please!"
 msgstr ""
 
-#: bp-core/bp-core-settings.php:17 bp-groups.php:92
-msgid "Settings"
+#: bp-core/admin/bp-core-update.php:662
+msgid "Other themes"
 msgstr ""
 
-#: bp-core/bp-core-settings.php:21
-msgid "General"
+#: bp-core/admin/bp-core-update.php:663
+msgid "A BuddyPress theme"
 msgstr ""
 
-#: bp-core/bp-core-settings.php:25 bp-core/bp-core-settings.php:176
-msgid "Delete Account"
+#: 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."
 msgstr ""
 
-#: bp-core/bp-core-settings.php:69 bp-core.php:316
-msgid "General Settings"
+#: bp-core/admin/bp-core-update.php:669
+msgid "Use this theme"
 msgstr ""
 
-#: bp-core/bp-core-settings.php:77 bp-core/bp-core-settings.php:138
-msgid "Changes Saved."
+#: bp-core/admin/bp-core-update.php:685
+msgid "Manually update current theme"
 msgstr ""
 
-#: bp-core/bp-core-settings.php:83
-msgid "Your passwords did not match"
+#: bp-core/admin/bp-core-update.php:687
+msgid "Your existing theme"
 msgstr ""
 
-#: bp-core/bp-core-settings.php:88
-msgid "Account Email"
+#: 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."
 msgstr ""
 
-#: bp-core/bp-core-settings.php:91
-msgid "Change Password <span>(leave blank for no change)</span>"
+#: bp-core/admin/bp-core-update.php:695
+msgid "Install BuddyPress Template Pack"
 msgstr ""
 
-#: bp-core/bp-core-settings.php:92
-msgid "New Password"
+#: bp-core/admin/bp-core-update.php:699
+msgid "Choose this option (go to Appearance &rarr; BP Compatibility after setup is complete)"
 msgstr ""
 
-#: bp-core/bp-core-settings.php:93
-msgid "Repeat New Password"
+#: bp-core/admin/bp-core-update.php:700
+msgid "Plugin Installed"
 msgstr ""
 
-#: bp-core/bp-core-settings.php:96 bp-core/bp-core-settings.php:149
-#: bp-themes/bp-default/members/single/profile/edit.php:111
-#: bp-themes/bp-default/groups/single/forum/edit.php:34
-#: bp-themes/bp-default/groups/single/forum/edit.php:52
-#: bp-themes/bp-default/groups/single/admin.php:32
-#: bp-themes/bp-default/groups/single/admin.php:100
-msgid "Save Changes"
+#: bp-core/admin/bp-core-update.php:709
+msgid "Do not change theme"
 msgstr ""
 
-#: bp-core/bp-core-settings.php:130
-msgid "Notification Settings"
+#: bp-core/admin/bp-core-update.php:712
+msgid "You are happy with your current theme and plan on changing it later."
 msgstr ""
 
-#: bp-core/bp-core-settings.php:143
-msgid "Email Notifications"
+#: 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."
 msgstr ""
 
-#: bp-core/bp-core-settings.php:144
-msgid "Send a notification by email when:"
+#: bp-core/admin/bp-core-update.php:715
+msgid "Don't change my current theme"
 msgstr ""
 
-#: bp-core/bp-core-settings.php:185
-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-core/admin/bp-core-update.php:737
+msgid "setup"
 msgstr ""
 
-#: bp-core/bp-core-settings.php:188
-msgid "I understand the consequences of deleting my account."
+#: bp-core/admin/bp-core-update.php:737
+msgid "update"
 msgstr ""
 
-#: bp-core/bp-core-settings.php:191
-msgid "Delete My Account"
+#: bp-core/admin/bp-core-update.php:739
+msgid "The BuddyPress %1$s is complete, and your site is ready to go!"
 msgstr ""
 
-#: bp-core.php:309 bp-core.php:310
-msgid "BuddyPress"
+#: bp-core/admin/bp-core-update.php:919
+msgid "Oops, there was a problem creating a configuration file. "
 msgstr ""
 
-#: bp-core.php:317
-msgid "Component Setup"
+#: 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."
 msgstr ""
 
-#: bp-core.php:362 bp-xprofile.php:172
-msgid "Profile"
+#: bp-core/admin/bp-core-update.php:934
+msgid "Permalink structure updated. Remove write access on web.config file now!"
 msgstr ""
 
-#: bp-core.php:373 bp-groups/bp-groups-templatetags.php:419 bp-xprofile.php:177
-msgid "Public"
+#: 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."
 msgstr ""
 
-#: bp-core.php:479
-msgid "User marked as spammer. Spam users are visible only to site admins."
+#: 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."
 msgstr ""
 
-#: bp-core.php:481
-msgid "User removed as spammer."
+#: bp-core/admin/bp-core-update.php:1175
+msgid "Installation was successful. The available options have now been updated, please continue with your selection."
 msgstr ""
 
-#: bp-core.php:515
-msgid "%s has been deleted from the system."
+#: bp-core/admin/bp-core-update.php:1234 bp-core/bp-core-functions.php:252
+#: bp-members/bp-members-signup.php:572
+msgid "BuddyPress"
 msgstr ""
 
-#: bp-core.php:517
-msgid "There was an error deleting %s from the system. Please try again."
+#: bp-core/admin/bp-core-update.php:1330
+msgid "BuddyPress has been updated! Please run the <a href=\"%s\">update wizard</a>."
 msgstr ""
 
-#: bp-core.php:1420
-msgid "year"
+#: bp-core/admin/bp-core-update.php:1335
+msgid "BuddyPress was successfully installed! Please run the <a href=\"%s\">installation wizard</a>."
 msgstr ""
 
-#: bp-core.php:1420
-msgid "years"
+#: bp-core/bp-core-avatars.php:91
+msgid "Avatar Image"
 msgstr ""
 
-#: bp-core.php:1421
-msgid "month"
+#: bp-core/bp-core-avatars.php:401
+msgid "There is no error, the file uploaded with success"
 msgstr ""
 
-#: bp-core.php:1421
-msgid "months"
+#: 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: "
 msgstr ""
 
-#: bp-core.php:1422
-msgid "week"
+#: bp-core/bp-core-avatars.php:404
+msgid "The uploaded file was only partially uploaded"
 msgstr ""
 
-#: bp-core.php:1422
-msgid "weeks"
+#: bp-core/bp-core-avatars.php:405
+msgid "No file was uploaded"
 msgstr ""
 
-#: bp-core.php:1423
-msgid "day"
+#: bp-core/bp-core-avatars.php:406
+msgid "Missing a temporary folder"
 msgstr ""
 
-#: bp-core.php:1423
-msgid "days"
+#: bp-core/bp-core-avatars.php:410
+msgid "Your upload failed, please try again. Error was: %s"
 msgstr ""
 
-#: bp-core.php:1424
-msgid "hour"
+#: bp-core/bp-core-avatars.php:415
+msgid "The file you uploaded is too big. Please upload a file under %s"
 msgstr ""
 
-#: bp-core.php:1424
-msgid "hours"
+#: bp-core/bp-core-avatars.php:420
+msgid "Please upload only JPG, GIF or PNG photos."
 msgstr ""
 
-#: bp-core.php:1425
-msgid "minute"
+#: bp-core/bp-core-avatars.php:431 bp-core/bp-core-avatars.php:444
+msgid "Upload Failed! Error was: %s"
 msgstr ""
 
-#: bp-core.php:1425
-msgid "minutes"
+#: bp-core/bp-core-avatars.php:462
+msgid "Upload failed! Error was: %s"
 msgstr ""
 
-#: bp-core.php:1426
+#: bp-core/bp-core-avatars.php:595
+msgid "Avatar of %s"
+msgstr ""
+
+#: bp-core/bp-core-template.php:64
+msgid "Options"
+msgstr ""
+
+#: bp-core/bp-core-template.php:190
+msgid "%1$s at %2$s"
+msgstr ""
+
+#: bp-core/bp-core-template.php:251
+msgid "Blogs"
+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"
+msgstr ""
+
+#: bp-core/bp-core-template.php:259
+msgid "Search these:"
+msgstr ""
+
+#: bp-core/bp-core-template.php:287
+msgid "Search anything..."
+msgstr ""
+
+#: bp-core/bp-core-template.php:381
+msgid " [&hellip;]"
+msgstr ""
+
+#: bp-core/bp-core-filters.php:163 bp-core/bp-core-filters.php:187
+msgid "[User Set]"
+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"
+msgstr ""
+
+#: bp-core/bp-core-filters.php:207
+msgid "Activate %s"
+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"
+msgstr ""
+
+#: bp-core/bp-core-filters.php:240 bp-members/bp-members-signup.php:575
+msgid "Activate Your Account"
+msgstr ""
+
+#. translators: "displayed user's name | canonicalised component name"
+#. translators: "group name | group nav section name"
+
+#: bp-core/bp-core-filters.php:286 bp-core/bp-core-filters.php:292
+msgid "%1$s | %2$s"
+msgstr ""
+
+#. translators: "component item name | component nav section name | root
+#. component name"
+
+#: bp-core/bp-core-filters.php:297
+msgid "%1$s | %2$s | %3$s"
+msgstr ""
+
+#: bp-core/bp-core-filters.php:302 bp-core/bp-core-filters.php:304
+msgid "%s Directory"
+msgstr ""
+
+#: bp-core/bp-core-filters.php:308
+#: bp-themes/bp-default/registration/register.php:23
+msgid "Create an Account"
+msgstr ""
+
+#: bp-core/bp-core-filters.php:312
+#: bp-themes/bp-default/registration/activate.php:24
+msgid "Activate your Account"
+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"
+msgstr ""
+
+#: bp-core/bp-core-cssjs.php:49
+msgid "Are you sure?"
+msgstr ""
+
+#: bp-core/bp-core-classes.php:191
+msgid "%d group"
+msgid_plural "%d groups"
+msgstr[0] ""
+msgstr[1] ""
+
+#: 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"
+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"
+msgstr ""
+
+#: bp-core/deprecated/1.5.php:151
+#: bp-themes/bp-default/members/single/profile/profile-wp.php:24
+msgid "About Me"
+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"
+msgstr ""
+
+#: bp-core/deprecated/1.5.php:169
+#: bp-themes/bp-default/members/single/profile/profile-wp.php:42
+msgid "Jabber"
+msgstr ""
+
+#: bp-core/deprecated/1.5.php:178
+#: bp-themes/bp-default/members/single/profile/profile-wp.php:51
+msgid "AOL Messenger"
+msgstr ""
+
+#: bp-core/deprecated/1.5.php:187
+#: bp-themes/bp-default/members/single/profile/profile-wp.php:60
+msgid "Yahoo Messenger"
+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"
+msgstr ""
+
+#: bp-core/deprecated/1.5.php:334
+msgid "%1$s mentioned you in the group \"%2$s\""
+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"
+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"
+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."
+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>."
+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>"
+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>"
+msgstr ""
+
+#: bp-core/bp-core-functions.php:601
+msgid "sometime"
+msgstr ""
+
+#: bp-core/bp-core-functions.php:602
+msgid "right now"
+msgstr ""
+
+#: bp-core/bp-core-functions.php:603
+msgid "%s ago"
+msgstr ""
+
+#: bp-core/bp-core-functions.php:607
+msgid "year"
+msgstr ""
+
+#: bp-core/bp-core-functions.php:607
+msgid "years"
+msgstr ""
+
+#: bp-core/bp-core-functions.php:608
+msgid "month"
+msgstr ""
+
+#: bp-core/bp-core-functions.php:608
+msgid "months"
+msgstr ""
+
+#: bp-core/bp-core-functions.php:609
+msgid "week"
+msgstr ""
+
+#: bp-core/bp-core-functions.php:609
+msgid "weeks"
+msgstr ""
+
+#: bp-core/bp-core-functions.php:610
+msgid "day"
+msgstr ""
+
+#: bp-core/bp-core-functions.php:610
+msgid "days"
+msgstr ""
+
+#: bp-core/bp-core-functions.php:611
+msgid "hour"
+msgstr ""
+
+#: bp-core/bp-core-functions.php:611
+msgid "hours"
+msgstr ""
+
+#: bp-core/bp-core-functions.php:612
+msgid "minute"
+msgstr ""
+
+#: bp-core/bp-core-functions.php:612
+msgid "minutes"
+msgstr ""
+
+#: bp-core/bp-core-functions.php:613
 msgid "second"
 msgstr ""
 
-#: bp-core.php:1426 bp-core.php:1478
-msgid "seconds"
+#: bp-core/bp-core-functions.php:613
+msgid "seconds"
+msgstr ""
+
+#: bp-core/bp-core-functions.php:670
+msgctxt "Separator in time since"
+msgid ","
+msgstr ""
+
+#: bp-core/bp-core-functions.php:733
+msgid "not recently active"
+msgstr ""
+
+#: bp-core/bp-core-catchuri.php:258
+msgid "This user has been marked as a spammer. Only site admins can view this profile."
+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."
+msgstr ""
+
+#: bp-core/bp-core-buddybar.php:244
+msgid "You do not have access to this page."
+msgstr ""
+
+#: bp-core/bp-core-buddybar.php:415 bp-themes/bp-default/sidebar.php:53
+msgid "Log In"
+msgstr ""
+
+#: bp-core/bp-core-buddybar.php:419
+msgid "Sign Up"
+msgstr ""
+
+#: bp-core/bp-core-buddybar.php:431
+msgid "My Account"
+msgstr ""
+
+#: bp-core/bp-core-buddybar.php:502
+msgid "Visit"
+msgstr ""
+
+#: bp-core/bp-core-buddybar.php:504
+msgid "Random Member"
+msgstr ""
+
+#: bp-core/bp-core-buddybar.php:508
+msgid "Random Group"
+msgstr ""
+
+#: bp-core/bp-core-buddybar.php:514
+msgid "Random Site"
+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"
+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"
+msgstr ""
+
+#: bp-friends/bp-friends-loader.php:78
+msgid "Search Friends..."
+msgstr ""
+
+#: bp-friends/bp-friends-loader.php:96
+msgid "Friends <span>%d</span>"
+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"
+msgstr ""
+
+#: bp-friends/bp-friends-loader.php:118 bp-groups/bp-groups-template.php:1288
+msgid "Requests"
+msgstr ""
+
+#: bp-friends/bp-friends-loader.php:150
+msgid "Friends <span class=\"count\">%s</span>"
+msgstr ""
+
+#: bp-friends/bp-friends-loader.php:151
+msgid "Pending Requests <span class=\"count\">%s</span>"
+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"
+msgstr ""
+
+#: bp-friends/bp-friends-loader.php:154
+msgid "No Pending Requests"
+msgstr ""
+
+#: bp-friends/bp-friends-notifications.php:24
+msgid "New friendship request from %s"
+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"
+msgstr ""
+
+#: bp-friends/bp-friends-notifications.php:66
+#: bp-friends/bp-friends-activity.php:79
+msgid "%s accepted your friendship request"
+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"
+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"
+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"
+msgstr ""
+
+#: bp-friends/bp-friends-template.php:101
+msgid "My Friends"
+msgstr ""
+
+#: bp-friends/bp-friends-template.php:101
+msgid "%s's Friends"
+msgstr ""
+
+#: bp-friends/bp-friends-template.php:101
+msgid "See All"
+msgstr ""
+
+#: bp-friends/bp-friends-template.php:121
+msgid "You haven't added any friend connections yet."
+msgstr ""
+
+#: bp-friends/bp-friends-template.php:121
+msgid "%s hasn't created any friend connections yet."
+msgstr ""
+
+#: bp-friends/bp-friends-template.php:190
+msgid "There aren't enough site members to show a random sample just yet."
+msgstr ""
+
+#: bp-friends/bp-friends-template.php:201
+msgid "Filter Friends"
+msgstr ""
+
+#: bp-friends/bp-friends-template.php:238
+msgid "%d friend"
+msgstr ""
+
+#: bp-friends/bp-friends-template.php:240
+msgid "%d friends"
+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"
+msgstr ""
+
+#: bp-friends/bp-friends-template.php:338
+#: bp-friends/bp-friends-template.php:339
+msgid "Cancel Friendship"
+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"
+msgstr ""
+
+#: bp-friends/bp-friends-actions.php:29 bp-themes/bp-default/_inc/ajax.php:429
+msgid "Friendship could not be requested."
+msgstr ""
+
+#: bp-friends/bp-friends-actions.php:31
+msgid "Friendship requested"
+msgstr ""
+
+#: bp-friends/bp-friends-actions.php:35
+msgid "You are already friends with this user"
+msgstr ""
+
+#: bp-friends/bp-friends-actions.php:37
+msgid "You already have a pending friendship request with this user"
+msgstr ""
+
+#: bp-friends/bp-friends-actions.php:64 bp-themes/bp-default/_inc/ajax.php:419
+msgid "Friendship could not be canceled."
+msgstr ""
+
+#: bp-friends/bp-friends-actions.php:66
+msgid "Friendship canceled"
+msgstr ""
+
+#: bp-friends/bp-friends-actions.php:70
+msgid "You are not yet friends with this user"
+msgstr ""
+
+#: bp-friends/bp-friends-actions.php:72
+msgid "You have a pending friendship request with this user"
+msgstr ""
+
+#: bp-friends/bp-friends-functions.php:94
+#: bp-friends/bp-friends-functions.php:103
+msgid "%1$s and %2$s are now friends"
+msgstr ""
+
+#: bp-friends/bp-friends-screens.php:28
+msgid "Friendship accepted"
+msgstr ""
+
+#: bp-friends/bp-friends-screens.php:30
+msgid "Friendship could not be accepted"
+msgstr ""
+
+#: bp-friends/bp-friends-screens.php:39
+msgid "Friendship rejected"
+msgstr ""
+
+#: bp-friends/bp-friends-screens.php:41
+msgid "Friendship could not be rejected"
+msgstr ""
+
+#: bp-friends/bp-friends-screens.php:77
+msgid "A member sends you a friendship request"
+msgstr ""
+
+#: bp-friends/bp-friends-screens.php:83
+msgid "A member accepts your friendship request"
+msgstr ""
+
+#: bp-friends/bp-friends-activity.php:50
+msgid "New friendship created"
+msgstr ""
+
+#: bp-friends/bp-friends-activity.php:76
+msgid "%d friends accepted your friendship requests"
+msgstr ""
+
+#: bp-friends/bp-friends-activity.php:90
+msgid "You have %d pending friendship requests"
+msgstr ""
+
+#: bp-friends/bp-friends-activity.php:93
+msgid "You have a friendship request from %s"
+msgstr ""
+
+#: bp-settings/bp-settings-loader.php:92 bp-settings/bp-settings-loader.php:158
+msgid "General"
+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"
+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"
+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."
+msgstr ""
+
+#: bp-settings/bp-settings-actions.php:105
+msgid "Your new passwords did not match."
+msgstr ""
+
+#: bp-settings/bp-settings-actions.php:108
+msgid "Your existing password is incorrect."
+msgstr ""
+
+#: bp-settings/bp-settings-actions.php:111
+msgid "Sorry, that email address is already used or is invalid."
+msgstr ""
+
+#: bp-groups/bp-groups-actions.php:24
+msgid "Sorry, you are not allowed to create groups."
+msgstr ""
+
+#: bp-groups/bp-groups-actions.php:46
+msgid "There was an error saving group details. Please try again."
+msgstr ""
+
+#: bp-groups/bp-groups-actions.php:68
+msgid "Please fill in all of the required fields"
+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."
+msgstr ""
+
+#: bp-groups/bp-groups-actions.php:141
+msgid "%1$s created the group %2$s"
+msgstr ""
+
+#: bp-groups/bp-groups-actions.php:189
+msgid "There was an error saving the group avatar, please try uploading again."
+msgstr ""
+
+#: bp-groups/bp-groups-actions.php:191
+msgid "The group avatar was uploaded successfully!"
+msgstr ""
+
+#: bp-groups/bp-groups-actions.php:215 bp-groups/bp-groups-actions.php:222
+msgid "There was an error joining the group."
+msgstr ""
+
+#: bp-groups/bp-groups-actions.php:224
+msgid "You joined the group!"
+msgstr ""
+
+#: bp-groups/bp-groups-actions.php:250 bp-groups/bp-groups-screens.php:646
+msgid "This group must have at least one admin"
+msgstr ""
+
+#: bp-groups/bp-groups-actions.php:253
+msgid "There was an error leaving the group."
+msgstr ""
+
+#: bp-groups/bp-groups-actions.php:255 bp-groups/bp-groups-functions.php:280
+msgid "You successfully left the group."
+msgstr ""
+
+#: bp-groups/bp-groups-activity.php:21
+msgid "Created a group"
+msgstr ""
+
+#: bp-groups/bp-groups-activity.php:22
+msgid "Joined a group"
+msgstr ""
+
+#: bp-groups/bp-groups-activity.php:23
+msgid "New group forum topic"
+msgstr ""
+
+#: bp-groups/bp-groups-activity.php:24
+msgid "New group forum post"
+msgstr ""
+
+#: bp-groups/bp-groups-activity.php:93
+msgid "%1$d new membership requests for the group \"%2$s\""
+msgstr ""
+
+#: bp-groups/bp-groups-activity.php:98
+msgid "Group Membership Requests"
+msgstr ""
+
+#: bp-groups/bp-groups-activity.php:107 bp-groups/bp-groups-activity.php:112
+msgid "%s requests group membership"
+msgstr ""
+
+#: bp-groups/bp-groups-activity.php:130
+msgid "%d accepted group membership requests"
+msgstr ""
+
+#: bp-groups/bp-groups-activity.php:143
+msgid "Membership for group \"%s\" accepted"
+msgstr ""
+
+#: bp-groups/bp-groups-activity.php:166
+msgid "%d rejected group membership requests"
+msgstr ""
+
+#: bp-groups/bp-groups-activity.php:179
+msgid "Membership for group \"%s\" rejected"
+msgstr ""
+
+#: bp-groups/bp-groups-activity.php:202
+msgid "You were promoted to an admin in %d groups"
+msgstr ""
+
+#: bp-groups/bp-groups-activity.php:215
+msgid "You were promoted to an admin in the group \"%s\""
+msgstr ""
+
+#: bp-groups/bp-groups-activity.php:238
+msgid "You were promoted to a mod in %d groups"
+msgstr ""
+
+#: bp-groups/bp-groups-activity.php:251
+msgid "You were promoted to a mod in the group \"%s\""
+msgstr ""
+
+#: bp-groups/bp-groups-activity.php:275
+msgid "You have %d new group invitations"
+msgstr ""
+
+#: bp-groups/bp-groups-activity.php:279
+msgid "Group Invites"
+msgstr ""
+
+#: bp-groups/bp-groups-activity.php:287
+msgid "You have an invitation to the group: %s"
+msgstr ""
+
+#: bp-groups/bp-groups-loader.php:84
+msgid "Search Groups..."
+msgstr ""
+
+#: bp-groups/bp-groups-loader.php:172
+msgid "You do not have access to this group."
+msgstr ""
+
+#: bp-groups/bp-groups-loader.php:185 bp-groups/bp-groups-template.php:1272
+msgid "Details"
+msgstr ""
+
+#: bp-groups/bp-groups-loader.php:197 bp-groups/bp-groups-template.php:1282
+msgid "Avatar"
+msgstr ""
+
+#: bp-groups/bp-groups-loader.php:205
+msgid "Invites"
+msgstr ""
+
+#: bp-groups/bp-groups-loader.php:231
+msgid "Groups <span>%d</span>"
+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"
+msgstr ""
+
+#: bp-groups/bp-groups-loader.php:254
+msgid "Invitations"
+msgstr ""
+
+#: bp-groups/bp-groups-loader.php:283
+msgctxt "Group home navigation title"
+msgid "Home"
+msgstr ""
+
+#: bp-groups/bp-groups-loader.php:295
+msgid "Admin"
+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"
+msgstr ""
+
+#: bp-groups/bp-groups-loader.php:326
+msgid "Forum"
+msgstr ""
+
+#: bp-groups/bp-groups-loader.php:338
+msgid "Members <span>%s</span>"
+msgstr ""
+
+#: bp-groups/bp-groups-loader.php:350
+#: bp-themes/bp-default/groups/single/send-invites.php:60
+msgid "Send Invites"
+msgstr ""
+
+#: bp-groups/bp-groups-loader.php:392
+msgid "Groups <span class=\"count\">%s</span>"
+msgstr ""
+
+#: bp-groups/bp-groups-loader.php:393
+msgid "Pending Invites <span class=\"count\">%s</span>"
+msgstr ""
+
+#: bp-groups/bp-groups-loader.php:396
+msgid "No Pending Invites"
+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"
+msgstr ""
+
+#: bp-groups/bp-groups-classes.php:752
+msgid "Group Mod"
+msgstr ""
+
+#: bp-groups/bp-groups-classes.php:758 bp-groups/bp-groups-functions.php:98
+msgid "Group Admin"
+msgstr ""
+
+#: bp-groups/bp-groups-notifications.php:10
+msgid "Group Details Updated"
+msgstr ""
+
+#: bp-groups/bp-groups-notifications.php:24
+msgid ""
+"Group details for the group \"%1$s\" were updated:\n"
+"\n"
+"To view the group: %2$s\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"
+"\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-groups/bp-groups-notifications.php:119
+msgid "Membership request for group \"%s\" accepted"
+msgstr ""
+
+#: bp-groups/bp-groups-notifications.php:120
+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-groups/bp-groups-notifications.php:129
+msgid "Membership request for group \"%s\" rejected"
+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 ""
+
+#: bp-groups/bp-groups-notifications.php:155
+msgid "an administrator"
+msgstr ""
+
+#: bp-groups/bp-groups-notifications.php:158
+msgid "a moderator"
+msgstr ""
+
+#: bp-groups/bp-groups-notifications.php:177
+msgid "You have been promoted in the group: \"%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"
+msgstr ""
+
+#: bp-groups/bp-groups-notifications.php:227
+msgid "You have an invitation to the group: \"%s\""
+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"
+msgstr ""
+
+#: bp-groups/bp-groups-adminbar.php:78 bp-xprofile/bp-xprofile-admin.php:121
+msgid "Edit Group"
+msgstr ""
+
+#: bp-groups/bp-groups-adminbar.php:87 bp-groups/bp-groups-buddybar.php:19
+msgid "Edit Details"
+msgstr ""
+
+#: bp-groups/bp-groups-adminbar.php:95
+msgid "Edit Settings"
+msgstr ""
+
+#: bp-groups/bp-groups-adminbar.php:104 bp-members/bp-members-adminbar.php:169
+msgid "Edit Avatar"
+msgstr ""
+
+#: bp-groups/bp-groups-adminbar.php:114 bp-groups/bp-groups-buddybar.php:31
+msgid "Manage Invitations"
+msgstr ""
+
+#: bp-groups/bp-groups-adminbar.php:123 bp-groups/bp-groups-buddybar.php:35
+msgid "Manage Members"
+msgstr ""
+
+#: bp-groups/bp-groups-adminbar.php:132 bp-groups/bp-groups-buddybar.php:39
+msgid "Membership Requests"
+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"
+msgstr ""
+
+#: bp-groups/bp-groups-widgets.php:19
+msgid "A dynamic list of recently active, popular, and newest groups"
+msgstr ""
+
+#: bp-groups/bp-groups-widgets.php:68 bp-groups/bp-groups-widgets.php:168
+msgid "created %s"
+msgstr ""
+
+#: bp-groups/bp-groups-widgets.php:87
+msgid "There are no groups to display."
+msgstr ""
+
+#: bp-groups/bp-groups-widgets.php:120
+msgid "Max groups to show:"
 msgstr ""
 
-#: bp-core.php:1445
-msgid "sometime"
+#: bp-groups/bp-groups-widgets.php:123
+msgid "Default groups to show:"
 msgstr ""
 
-#: bp-core.php:1473
-msgctxt "Separator in time since"
-msgid ","
+#: bp-groups/bp-groups-widgets.php:187
+msgid "No groups matched the current filter."
 msgstr ""
 
-#: bp-core.php:1528
-msgid "not recently active"
+#: 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"
 msgstr ""
 
-#: bp-core.php:2038
-msgid "IMPORTANT: <a href=\"http://codex.buddypress.org/getting-started/upgrading-from-10x/\">Read this before attempting to update BuddyPress</a>"
+#: 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"
 msgstr ""
 
-#: bp-core.php:2067
-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-groups/bp-groups-screens.php:49
+msgid "Group invite could not be accepted"
 msgstr ""
 
-#: bp-core.php:2076
-msgid "<strong>BuddyPress is ready</strong>. You'll need to <a href='%s'>activate a BuddyPress compatible theme</a> to take advantage of all of the features. We've bundled a default theme, but you can always <a href='%s'>install some other compatible themes</a> or <a href='%s'>upgrade your existing WordPress theme</a>."
+#: bp-groups/bp-groups-screens.php:51
+msgid "Group invite accepted"
 msgstr ""
 
-#: bp-friends/bp-friends-templatetags.php:6
-#: bp-friends/bp-friends-templatetags.php:20
-#: bp-groups/bp-groups-templatetags.php:1825
-#: bp-groups/bp-groups-templatetags.php:1842
-msgid "Recently Active"
+#: 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"
 msgstr ""
 
-#: bp-friends/bp-friends-templatetags.php:8
-#: bp-friends/bp-friends-templatetags.php:26
-#: bp-groups/bp-groups-templatetags.php:1830
-#: bp-groups/bp-groups-templatetags.php:1857
-msgid "Alphabetically"
+#: bp-groups/bp-groups-screens.php:71
+msgid "Group invite could not be rejected"
 msgstr ""
 
-#: bp-friends/bp-friends-templatetags.php:40
-msgid "%s's Friends"
+#: bp-groups/bp-groups-screens.php:73
+msgid "Group invite rejected"
 msgstr ""
 
-#: bp-friends/bp-friends-templatetags.php:40
-msgid "See All"
+#: bp-groups/bp-groups-screens.php:149
+msgid "There was an error when replying to that topic"
 msgstr ""
 
-#: bp-friends/bp-friends-templatetags.php:53
-msgid "You haven't added any friend connections yet."
+#: bp-groups/bp-groups-screens.php:151
+msgid "Your reply was posted successfully"
 msgstr ""
 
-#: bp-friends/bp-friends-templatetags.php:53
-msgid "%s hasn't created any friend connections yet."
+#: bp-groups/bp-groups-screens.php:165
+msgid "There was an error when making that topic a sticky"
 msgstr ""
 
-#: bp-friends/bp-friends-templatetags.php:93
-msgid "There aren't enough site members to show a random sample just yet."
+#: bp-groups/bp-groups-screens.php:167
+msgid "The topic was made sticky successfully"
 msgstr ""
 
-#: bp-friends/bp-friends-templatetags.php:103
-msgid "Filter Friends"
+#: bp-groups/bp-groups-screens.php:179
+msgid "There was an error when unsticking that topic"
 msgstr ""
 
-#: bp-friends/bp-friends-templatetags.php:138
-msgid "%d friend"
+#: bp-groups/bp-groups-screens.php:181
+msgid "The topic was unstuck successfully"
 msgstr ""
 
-#: bp-friends/bp-friends-templatetags.php:140
-msgid "%d friends"
+#: bp-groups/bp-groups-screens.php:193
+msgid "There was an error when closing that topic"
 msgstr ""
 
-#: bp-friends/bp-friends-templatetags.php:224
-#: bp-friends/bp-friends-templatetags.php:225
-#: bp-themes/bp-default/_inc/ajax.php:353
-msgid "Friendship Requested"
+#: bp-groups/bp-groups-screens.php:195
+msgid "The topic was closed successfully"
 msgstr ""
 
-#: bp-friends/bp-friends-templatetags.php:239
-#: bp-friends/bp-friends-templatetags.php:240
-msgid "Cancel Friendship"
+#: bp-groups/bp-groups-screens.php:207
+msgid "There was an error when opening that topic"
 msgstr ""
 
-#: bp-friends/bp-friends-templatetags.php:257
-#: bp-friends/bp-friends-templatetags.php:258
-#: bp-themes/bp-default/_inc/ajax.php:343
-msgid "Add Friend"
+#: bp-groups/bp-groups-screens.php:209
+msgid "The topic was opened successfully"
 msgstr ""
 
-#: bp-friends/bp-friends-notifications.php:22
-msgid "New friendship request from %s"
+#: bp-groups/bp-groups-screens.php:230
+msgid "There was an error deleting the topic"
 msgstr ""
 
-#: bp-friends/bp-friends-notifications.php:24
-msgid ""
-"%s wants to add you as a friend.\n"
-"\n"
-"To view all of your pending friendship requests: %s\n"
-"\n"
-"To view %s's profile: %s\n"
-"\n"
-"---------------------\n"
+#: bp-groups/bp-groups-screens.php:232
+msgid "The topic was deleted successfully"
 msgstr ""
 
-#: bp-friends/bp-friends-notifications.php:34
-#: bp-friends/bp-friends-notifications.php:72
-#: bp-groups/bp-groups-notifications.php:30
-#: bp-groups/bp-groups-notifications.php:79
-#: bp-groups/bp-groups-notifications.php:133
-#: bp-groups/bp-groups-notifications.php:179
-#: bp-groups/bp-groups-notifications.php:231
-#: bp-groups/bp-groups-notifications.php:289
-#: bp-messages/bp-messages-notifications.php:37
-#: bp-activity/bp-activity-notifications.php:44
-#: bp-activity/bp-activity-notifications.php:88
-#: bp-activity/bp-activity-notifications.php:131
-msgid "To disable these notifications please log in and go to: %s"
+#: bp-groups/bp-groups-screens.php:254
+msgid "There was an error when editing that topic"
 msgstr ""
 
-#: bp-friends/bp-friends-notifications.php:64
-msgid ""
-"%s accepted your friend request.\n"
-"\n"
-"To view %s's profile: %s\n"
-"\n"
-"---------------------\n"
+#: bp-groups/bp-groups-screens.php:256
+msgid "The topic was edited successfully"
 msgstr ""
 
-#: bp-activity.php:113 bp-activity.php:270 bp-themes/bp-default/header.php:53
-#: bp-activity/feeds/bp-activity-personal-feed.php:21
-msgid "Activity"
+#: bp-groups/bp-groups-screens.php:280
+msgid "There was an error deleting that post"
 msgstr ""
 
-#: bp-activity.php:120
-msgid "Personal"
+#: bp-groups/bp-groups-screens.php:282
+msgid "The post was deleted successfully"
 msgstr ""
 
-#: bp-activity.php:128
-msgid "Favorites"
+#: bp-groups/bp-groups-screens.php:304
+msgid "There was an error when editing that post"
 msgstr ""
 
-#: bp-activity.php:129 bp-themes/bp-default/activity/index.php:50
-msgid "@%s Mentions"
+#: bp-groups/bp-groups-screens.php:306
+msgid "The post was edited successfully"
 msgstr ""
 
-#: bp-activity.php:133
-msgid "My Activity"
+#: bp-groups/bp-groups-screens.php:321 bp-groups/bp-groups-screens.php:338
+msgid "You have been banned from this group."
 msgstr ""
 
-#: bp-activity.php:251
-msgid "You do not have access to this activity."
+#: bp-groups/bp-groups-screens.php:346 bp-forums/bp-forums-screens.php:36
+msgid "Please provide a title for your forum topic."
 msgstr ""
 
-#: bp-activity.php:279
-msgid "A member mentions you in an update using \"@%s\""
+#: bp-groups/bp-groups-screens.php:348 bp-forums/bp-forums-screens.php:38
+msgid "Forum posts cannot be empty. Please enter some text."
 msgstr ""
 
-#: bp-activity.php:285
-msgid "A member replies to an update or comment you've posted"
+#: bp-groups/bp-groups-screens.php:351
+msgid "This group does not have a forum setup yet."
 msgstr ""
 
-#: bp-activity.php:366
-msgid "Activity deleted"
+#: bp-groups/bp-groups-screens.php:358 bp-forums/bp-forums-screens.php:45
+msgid "There was an error when creating the topic"
 msgstr ""
 
-#: bp-activity.php:368
-msgid "There was an error when deleting that activity"
+#: bp-groups/bp-groups-screens.php:361 bp-forums/bp-forums-screens.php:48
+msgid "The topic was created successfully"
 msgstr ""
 
-#: bp-activity.php:388 bp-themes/bp-default/_inc/ajax.php:124
-msgid "Please enter some content to post."
+#: bp-groups/bp-groups-screens.php:405
+msgid "Group invites sent."
 msgstr ""
 
-#: bp-activity.php:403
-msgid "Update Posted!"
+#: bp-groups/bp-groups-screens.php:433
+msgid "There was an error sending your group membership request, please try again."
 msgstr ""
 
-#: bp-activity.php:405
-msgid "There was an error when posting your update, please try again."
+#: 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."
 msgstr ""
 
-#: bp-activity.php:424 bp-themes/bp-default/_inc/ajax.php:162
-msgid "Please do not leave the comment area blank."
+#: bp-groups/bp-groups-screens.php:482
+msgid "There was an error updating group details, please try again."
 msgstr ""
 
-#: bp-activity.php:435
-msgid "Reply Posted!"
+#: bp-groups/bp-groups-screens.php:484
+msgid "Group details were successfully updated."
 msgstr ""
 
-#: bp-activity.php:437 bp-themes/bp-default/_inc/ajax.php:167
-#: bp-themes/bp-default/_inc/ajax.php:178
-msgid "There was an error posting that reply, please try again."
+#: bp-groups/bp-groups-screens.php:525
+msgid "There was an error updating group settings, please try again."
 msgstr ""
 
-#: bp-activity.php:453
-msgid "Activity marked as favorite."
+#: bp-groups/bp-groups-screens.php:527
+msgid "Group settings were successfully updated."
 msgstr ""
 
-#: bp-activity.php:455
-msgid "There was an error marking that activity as a favorite, please try again."
+#: bp-groups/bp-groups-screens.php:558 bp-xprofile/bp-xprofile-actions.php:36
+msgid "Your avatar was deleted successfully!"
 msgstr ""
 
-#: bp-activity.php:471
-msgid "Activity removed as favorite."
+#: 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."
 msgstr ""
 
-#: bp-activity.php:473
-msgid "There was an error removing that activity as a favorite, please try again."
+#: bp-groups/bp-groups-screens.php:588
+msgid "There was a problem cropping the avatar, please try uploading it again"
+msgstr ""
+
+#: bp-groups/bp-groups-screens.php:590
+msgid "The new group avatar was uploaded successfully!"
 msgstr ""
 
-#: bp-activity.php:699
-msgid "%s posted an update:"
+#: bp-groups/bp-groups-screens.php:625
+msgid "There was an error when promoting that user, please try again"
 msgstr ""
 
-#: bp-activity.php:752
-msgid "%s posted a new activity comment:"
+#: bp-groups/bp-groups-screens.php:627
+msgid "User promoted successfully"
 msgstr ""
 
-#: bp-activity.php:967
-msgid "Thumbnail"
+#: bp-groups/bp-groups-screens.php:650
+msgid "There was an error when demoting that user, please try again"
 msgstr ""
 
-#: bp-activity.php:1195
-msgid "Posted an update"
+#: bp-groups/bp-groups-screens.php:652
+msgid "User demoted successfully"
+msgstr ""
+
+#: bp-groups/bp-groups-screens.php:668
+msgid "There was an error when banning that user, please try again"
+msgstr ""
+
+#: bp-groups/bp-groups-screens.php:670
+msgid "User banned successfully"
+msgstr ""
+
+#: bp-groups/bp-groups-screens.php:686
+msgid "There was an error when unbanning that user, please try again"
+msgstr ""
+
+#: bp-groups/bp-groups-screens.php:688
+msgid "User ban removed successfully"
+msgstr ""
+
+#: bp-groups/bp-groups-screens.php:704
+msgid "There was an error removing that user from the group, please try again"
+msgstr ""
+
+#: bp-groups/bp-groups-screens.php:706
+msgid "User removed successfully"
+msgstr ""
+
+#: bp-groups/bp-groups-screens.php:744
+msgid "There was an error accepting the membership request, please try again."
+msgstr ""
+
+#: bp-groups/bp-groups-screens.php:746
+msgid "Group membership request accepted"
+msgstr ""
+
+#: bp-groups/bp-groups-screens.php:755
+msgid "There was an error rejecting the membership request, please try again."
+msgstr ""
+
+#: bp-groups/bp-groups-screens.php:757
+msgid "Group membership request rejected"
+msgstr ""
+
+#: bp-groups/bp-groups-screens.php:787
+msgid "There was an error deleting the group, please try again."
+msgstr ""
+
+#: bp-groups/bp-groups-screens.php:789
+msgid "The group was deleted successfully"
+msgstr ""
+
+#: bp-groups/bp-groups-screens.php:840
+msgid "A member invites you to join a group"
+msgstr ""
+
+#: bp-groups/bp-groups-screens.php:846
+msgid "Group information is updated"
+msgstr ""
+
+#: bp-groups/bp-groups-screens.php:852
+msgid "You are promoted to a group administrator or moderator"
+msgstr ""
+
+#: bp-groups/bp-groups-screens.php:858
+msgid "A member requests to join a private group for which you are an admin"
 msgstr ""
 
-#: bp-groups/bp-groups-templatetags.php:252
+#: bp-groups/bp-groups-buddybar.php:16 bp-members/bp-members-buddybar.php:103
+msgid "Admin Options"
+msgstr ""
+
+#: bp-groups/bp-groups-buddybar.php:21
+msgid "Group Settings"
+msgstr ""
+
+#: bp-groups/bp-groups-template.php:171
+msgctxt "Group pagination previous text"
+msgid "&larr;"
+msgstr ""
+
+#: bp-groups/bp-groups-template.php:172
+msgctxt "Group pagination next text"
+msgid "&rarr;"
+msgstr ""
+
+#: bp-groups/bp-groups-template.php:353
 msgid "Public Group"
 msgstr ""
 
-#: bp-groups/bp-groups-templatetags.php:254
+#: bp-groups/bp-groups-template.php:355
 msgid "Hidden Group"
 msgstr ""
 
-#: bp-groups/bp-groups-templatetags.php:256
+#: bp-groups/bp-groups-template.php:357
 msgid "Private Group"
 msgstr ""
 
-#: bp-groups/bp-groups-templatetags.php:258
+#: bp-groups/bp-groups-template.php:359
 msgid "Group"
 msgstr ""
 
-#: bp-groups/bp-groups-templatetags.php:288
-#: bp-groups/bp-groups-templatetags.php:1718
-msgid "Group avatar"
+#: bp-groups/bp-groups-template.php:389
+#: bp-activity/bp-activity-template.php:992
+msgid "Group logo of %s"
 msgstr ""
 
-#: bp-groups/bp-groups-templatetags.php:330
+#: bp-groups/bp-groups-template.php:431
 msgid "not yet active"
 msgstr ""
 
-#: bp-groups/bp-groups-templatetags.php:421
+#: bp-groups/bp-groups-template.php:522
 msgid "Private"
 msgstr ""
 
-#: bp-groups/bp-groups-templatetags.php:476
+#: 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"
+msgstr ""
+
+#: bp-groups/bp-groups-template.php:577
 msgid "No Admins"
 msgstr ""
 
-#: bp-groups/bp-groups-templatetags.php:496
+#: bp-groups/bp-groups-template.php:604
 msgid "No Mods"
 msgstr ""
 
-#: bp-groups/bp-groups-templatetags.php:517
+#: bp-groups/bp-groups-template.php:686
 msgid "Filter Groups"
 msgstr ""
 
-#: bp-groups/bp-groups-templatetags.php:565
+#: bp-groups/bp-groups-template.php:736
 msgid "Viewing group %1$s to %2$s (of %3$s groups)"
 msgstr ""
 
-#: bp-groups/bp-groups-templatetags.php:594
+#: bp-groups/bp-groups-template.php:764
 msgid "%s member"
 msgstr ""
 
-#: bp-groups/bp-groups-templatetags.php:596
-#: bp-themes/bp-default/members/single/groups/invites.php:11
+#: bp-groups/bp-groups-template.php:766
+#: bp-themes/bp-default/members/single/groups/invites.php:14
 msgid "%s members"
 msgstr ""
 
-#: bp-groups/bp-groups-templatetags.php:635
+#: bp-groups/bp-groups-template.php:805
 msgid "%d topic"
 msgstr ""
 
-#: bp-groups/bp-groups-templatetags.php:637
+#: bp-groups/bp-groups-template.php:807
 msgid "%d topics"
 msgstr ""
 
-#: bp-groups/bp-groups-templatetags.php:669
-#: bp-forums/bp-forums-templatetags.php:464
+#: bp-groups/bp-groups-template.php:839 bp-forums/bp-forums-template.php:684
 msgid "%d post"
 msgstr ""
 
-#: bp-groups/bp-groups-templatetags.php:671
-#: bp-forums/bp-forums-templatetags.php:466
+#: bp-groups/bp-groups-template.php:841 bp-forums/bp-forums-template.php:686
 msgid "%d posts"
 msgstr ""
 
-#: bp-groups/bp-groups-templatetags.php:733
-#: bp-groups/bp-groups-templatetags.php:771
+#: 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"
 msgstr ""
 
-#: bp-groups/bp-groups-templatetags.php:739
-#: bp-groups/bp-groups-templatetags.php:777
-#: bp-groups/bp-groups-templatetags.php:1490
-msgid "joined %s ago"
+#: bp-groups/bp-groups-template.php:1054 bp-groups/bp-groups-template.php:1119
+#: bp-groups/bp-groups-template.php:1888
+msgid "joined %s"
 msgstr ""
 
-#: bp-groups/bp-groups-templatetags.php:752
+#: bp-groups/bp-groups-template.php:1077
 msgid "This group has no administrators"
 msgstr ""
 
-#: bp-groups/bp-groups-templatetags.php:771
-#: bp-themes/bp-default/groups/single/admin.php:215
+#: 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"
 msgstr ""
 
-#: bp-groups/bp-groups-templatetags.php:790
+#: bp-groups/bp-groups-template.php:1139
 msgid "This group has no moderators"
 msgstr ""
 
-#: bp-groups/bp-groups-templatetags.php:922
-msgid "Edit Details"
-msgstr ""
-
-#: bp-groups/bp-groups-templatetags.php:929
-msgid "Group Settings"
-msgstr ""
-
-#: bp-groups/bp-groups-templatetags.php:930
-#: bp-groups/bp-groups-templatetags.php:1883 bp-groups.php:179
-msgid "Group Avatar"
-msgstr ""
-
-#: bp-groups/bp-groups-templatetags.php:931
-msgid "Manage Members"
-msgstr ""
-
-#: bp-groups/bp-groups-templatetags.php:934
-msgid "Membership Requests"
-msgstr ""
-
-#: bp-groups/bp-groups-templatetags.php:939 bp-groups.php:253
-#: bp-themes/bp-default/groups/single/admin.php:303
-msgid "Delete Group"
+#: 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"
 msgstr ""
 
-#: bp-groups/bp-groups-templatetags.php:1108
-#: bp-groups/bp-groups-templatetags.php:1109
-#: bp-themes/bp-default/forums/index.php:8
+#: 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-groups/bp-groups-templatetags.php:1147
-#: bp-groups/bp-groups-templatetags.php:1148
-#: bp-themes/bp-default/_inc/ajax.php:407
+#: 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"
 msgstr ""
 
-#: bp-groups/bp-groups-templatetags.php:1170
-#: bp-groups/bp-groups-templatetags.php:1171
-#: bp-themes/bp-default/_inc/ajax.php:429
+#: 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"
 msgstr ""
 
-#: bp-groups/bp-groups-templatetags.php:1188
-#: bp-groups/bp-groups-templatetags.php:1189 bp-groups.php:209
-#: bp-themes/bp-default/_inc/ajax.php:431
-msgid "Request Membership"
-msgstr ""
-
-#: bp-groups/bp-groups-templatetags.php:1203
-#: bp-groups/bp-groups-templatetags.php:1204
+#: bp-groups/bp-groups-template.php:1595 bp-groups/bp-groups-template.php:1596
 msgid "Request Sent"
 msgstr ""
 
-#: bp-groups/bp-groups-templatetags.php:1225
+#: bp-groups/bp-groups-template.php:1618
 msgid "This is a private group and you must request group membership in order to join."
 msgstr ""
 
-#: bp-groups/bp-groups-templatetags.php:1227
+#: 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."
 msgstr ""
 
-#: bp-groups/bp-groups-templatetags.php:1229
+#: bp-groups/bp-groups-template.php:1622
 msgid "This is a private group. Your membership request is awaiting approval from the group administrator."
 msgstr ""
 
-#: bp-groups/bp-groups-templatetags.php:1231
+#: bp-groups/bp-groups-template.php:1624
 msgid "This is a hidden group and only invited members can join."
 msgstr ""
 
-#: bp-groups/bp-groups-templatetags.php:1540
+#: bp-groups/bp-groups-template.php:1938
 msgid "Viewing members %1$s to %2$s (of %3$s members)"
 msgstr ""
 
-#: bp-groups/bp-groups-templatetags.php:1826
-#: bp-groups/bp-groups-templatetags.php:1845
+#: bp-groups/bp-groups-template.php:2164
+msgid "Group avatar"
+msgstr ""
+
+#: bp-groups/bp-groups-template.php:2277 bp-groups/bp-groups-template.php:2300
 msgid "Recently Joined"
 msgstr ""
 
-#: bp-groups/bp-groups-templatetags.php:1827
-#: bp-groups/bp-groups-templatetags.php:1848
+#: bp-groups/bp-groups-template.php:2278 bp-groups/bp-groups-template.php:2303
 msgid "Most Popular"
 msgstr ""
 
-#: bp-groups/bp-groups-templatetags.php:1828
-#: bp-groups/bp-groups-templatetags.php:1851
+#: bp-groups/bp-groups-template.php:2279 bp-groups/bp-groups-template.php:2306
 msgid "Administrator Of"
 msgstr ""
 
-#: bp-groups/bp-groups-templatetags.php:1829
-#: bp-groups/bp-groups-templatetags.php:1854
+#: bp-groups/bp-groups-template.php:2280 bp-groups/bp-groups-template.php:2309
 msgid "Moderator Of"
 msgstr ""
 
-#: bp-groups/bp-groups-templatetags.php:1885
+#: bp-groups/bp-groups-template.php:2341
 msgid "No Group Avatar"
 msgstr ""
 
-#: bp-groups/bp-groups-templatetags.php:2089
-msgid "requested %s ago"
-msgstr ""
-
-#: bp-groups/bp-groups-classes.php:730
-msgid "Group Mod"
-msgstr ""
-
-#: bp-groups/bp-groups-classes.php:736 bp-groups.php:1556
-msgid "Group Admin"
-msgstr ""
-
-#: bp-groups/bp-groups-notifications.php:8
-msgid "Group Details Updated"
-msgstr ""
-
-#: bp-groups/bp-groups-notifications.php:22
-msgid ""
-"Group details for the group \"%s\" were updated:\n"
-"\n"
-"To view the group: %s\n"
-"\n"
-"---------------------\n"
-msgstr ""
-
-#: bp-groups/bp-groups-notifications.php:64
-msgid "Membership request for group: %s"
-msgstr ""
-
-#: bp-groups/bp-groups-notifications.php:66
-msgid ""
-"%s wants to join the group \"%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"
-"%s\n"
-"\n"
-"To view %s's profile: %s\n"
-"\n"
-"---------------------\n"
-msgstr ""
-
-#: bp-groups/bp-groups-notifications.php:113
-msgid "Membership request for group \"%s\" accepted"
-msgstr ""
-
-#: bp-groups/bp-groups-notifications.php:114
-msgid ""
-"Your membership request for the group \"%s\" has been accepted.\n"
-"\n"
-"To view the group please login and visit: %s\n"
-"\n"
-"---------------------\n"
+#: bp-groups/bp-groups-template.php:2552
+msgid "requested %s"
 msgstr ""
 
-#: bp-groups/bp-groups-notifications.php:123
-msgid "Membership request for group \"%s\" rejected"
+#: bp-groups/bp-groups-template.php:2736
+msgid "Group Activity RSS Feed"
 msgstr ""
 
-#: bp-groups/bp-groups-notifications.php:124
-msgid ""
-"Your membership request for the group \"%s\" has been rejected.\n"
-"\n"
-"To submit another request please log in and visit: %s\n"
-"\n"
-"---------------------\n"
+#: bp-groups/bp-groups-functions.php:255
+msgid "As the only Admin, you cannot leave the group."
 msgstr ""
 
-#: bp-groups/bp-groups-notifications.php:147
-msgid "an administrator"
+#: bp-groups/bp-groups-functions.php:513
+msgid "%1$s posted an update in the group %2$s"
 msgstr ""
 
-#: bp-groups/bp-groups-notifications.php:150
-msgid "a moderator"
+#: 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"
 msgstr ""
 
-#: bp-groups/bp-groups-notifications.php:169
-msgid "You have been promoted in the group: \"%s\""
+#: 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"
 msgstr ""
 
-#: bp-groups/bp-groups-notifications.php:171
-msgid ""
-"You have been promoted to %s for the group: \"%s\".\n"
-"\n"
-"To view the group please visit: %s\n"
-"\n"
-"---------------------\n"
+#: bp-xprofile/bp-xprofile-screens.php:85
+msgid "Please make sure you fill in all required fields in this profile field group before saving."
 msgstr ""
 
-#: bp-groups/bp-groups-notifications.php:217
-msgid "You have an invitation to the group: \"%s\""
+#: bp-xprofile/bp-xprofile-screens.php:111
+msgid "There was a problem updating some of your profile information, please try again."
 msgstr ""
 
-#: bp-groups/bp-groups-notifications.php:219
-msgid ""
-"One of your friends %s has invited you to the group: \"%s\".\n"
-"\n"
-"To view your group invites visit: %s\n"
-"\n"
-"To view the group visit: %s\n"
-"\n"
-"To view %s's profile visit: %s\n"
-"\n"
-"---------------------\n"
+#: bp-xprofile/bp-xprofile-screens.php:165
+msgid "There was a problem cropping your avatar, please try uploading it again"
 msgstr ""
 
-#: bp-groups/bp-groups-notifications.php:277
-msgid "%s mentioned you in the group \"%s\""
+#: bp-xprofile/bp-xprofile-screens.php:167
+msgid "Your new avatar was uploaded successfully!"
 msgstr ""
-
-#: bp-groups/bp-groups-notifications.php:279
-msgid ""
-"%s mentioned you in the group \"%s\":\n"
-"\n"
-"\"%s\"\n"
-"\n"
-"To view and respond to the message, log in and visit: %s\n"
-"\n"
-"---------------------\n"
+
+#: bp-xprofile/bp-xprofile-classes.php:244
+msgid "Please make sure you give the group a name."
 msgstr ""
 
-#: bp-groups/bp-groups-widgets.php:58
-msgid "There are no groups to display."
+#: bp-xprofile/bp-xprofile-classes.php:268
+msgid "Add New Field Group"
 msgstr ""
 
-#: bp-groups/bp-groups-widgets.php:79
-msgid "Max groups to show:"
+#: bp-xprofile/bp-xprofile-classes.php:270
+msgid "Create Field Group"
 msgstr ""
 
-#: bp-groups/bp-groups-widgets.php:117
-msgid "created %s ago"
+#: bp-xprofile/bp-xprofile-classes.php:272
+msgid "Edit Field Group"
 msgstr ""
 
-#: bp-groups/bp-groups-widgets.php:136
-msgid "No groups matched the current filter."
+#: 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"
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-classes.php:158
-msgid "Please make sure you give the group a name."
+#: bp-xprofile/bp-xprofile-classes.php:282
+#: bp-xprofile/bp-xprofile-classes.php:702
+msgid "Fields marked * are required"
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-classes.php:171
-#: bp-xprofile/bp-xprofile-admin.php:124
-msgid "Add New Field Group"
+#: bp-xprofile/bp-xprofile-classes.php:293
+msgid "Field Group Title"
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-classes.php:174
-msgid "Edit Field Group"
+#: bp-xprofile/bp-xprofile-classes.php:301
+msgid "Group Description"
+msgstr ""
+
+#: bp-xprofile/bp-xprofile-classes.php:311
+#: bp-xprofile/bp-xprofile-classes.php:761
+msgid "or"
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-classes.php:195
-msgid "Field Group Name"
+#: bp-xprofile/bp-xprofile-classes.php:311
+#: bp-xprofile/bp-xprofile-classes.php:761
+#: bp-themes/bp-default/forums/index.php:134
+msgid "Cancel"
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-classes.php:494
+#: bp-xprofile/bp-xprofile-classes.php:619
 msgid "Please enter options for this Field:"
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-classes.php:495
-#: bp-themes/bp-default/members/index.php:28
-#: bp-themes/bp-default/members/single/friends.php:9
-#: bp-themes/bp-default/members/single/groups.php:10
-#: bp-themes/bp-default/members/single/blogs.php:6
-#: bp-themes/bp-default/blogs/index.php:28
-#: bp-themes/bp-default/forums/index.php:91
-#: bp-themes/bp-default/groups/index.php:27
+#: 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:"
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-classes.php:498
+#: bp-xprofile/bp-xprofile-classes.php:622
 msgid "Order Entered"
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-classes.php:499
+#: bp-xprofile/bp-xprofile-classes.php:623
 msgid "Name - Ascending"
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-classes.php:500
+#: bp-xprofile/bp-xprofile-classes.php:624
 msgid "Name - Descending"
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-classes.php:529
-#: bp-xprofile/bp-xprofile-classes.php:550
+#: bp-xprofile/bp-xprofile-classes.php:651
+#: bp-xprofile/bp-xprofile-classes.php:668
 msgid "Option"
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-classes.php:531
-#: bp-xprofile/bp-xprofile-classes.php:551
+#: bp-xprofile/bp-xprofile-classes.php:653
+#: bp-xprofile/bp-xprofile-classes.php:669
 msgid "Default Value"
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-classes.php:557
+#: bp-xprofile/bp-xprofile-classes.php:675
 msgid "Add Another Option"
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-classes.php:565
+#: bp-xprofile/bp-xprofile-classes.php:683
 msgid "Add Field"
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-classes.php:574
+#: bp-xprofile/bp-xprofile-classes.php:695
 msgid "Edit Field"
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-classes.php:595
+#: bp-xprofile/bp-xprofile-classes.php:715
 msgid "Field Title"
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-classes.php:602
+#: bp-xprofile/bp-xprofile-classes.php:724
 msgid "Field Description"
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-classes.php:609
+#: bp-xprofile/bp-xprofile-classes.php:731
 msgid "Is This Field Required?"
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-classes.php:611
+#: bp-xprofile/bp-xprofile-classes.php:733
 msgid "Not Required"
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-classes.php:612
+#: bp-xprofile/bp-xprofile-classes.php:734
 msgid "Required"
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-classes.php:617 bp-xprofile/bp-xprofile-admin.php:74
+#: bp-xprofile/bp-xprofile-classes.php:739
 msgid "Field Type"
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-classes.php:619
+#: bp-xprofile/bp-xprofile-classes.php:741
 msgid "Text Box"
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-classes.php:620
+#: bp-xprofile/bp-xprofile-classes.php:742
 msgid "Multi-line Text Box"
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-classes.php:621
+#: bp-xprofile/bp-xprofile-classes.php:743
 msgid "Date Selector"
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-classes.php:622
+#: bp-xprofile/bp-xprofile-classes.php:744
 msgid "Radio Buttons"
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-classes.php:623
+#: bp-xprofile/bp-xprofile-classes.php:745
 msgid "Drop Down Select Box"
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-classes.php:624
+#: bp-xprofile/bp-xprofile-classes.php:746
 msgid "Multi Select Box"
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-classes.php:625
+#: bp-xprofile/bp-xprofile-classes.php:747
 msgid "Checkboxes"
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-classes.php:632
-msgid "Save"
-msgstr ""
-
-#: bp-xprofile/bp-xprofile-classes.php:633
-msgid "or"
-msgstr ""
-
-#: bp-xprofile/bp-xprofile-classes.php:633
-#: bp-themes/bp-default/forums/index.php:59
-msgid "Cancel"
-msgstr ""
-
-#: bp-xprofile/bp-xprofile-classes.php:655
+#: bp-xprofile/bp-xprofile-classes.php:779
 msgid "Please make sure you fill out all required fields."
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-classes.php:658
+#: bp-xprofile/bp-xprofile-classes.php:782
 msgid "Radio button field types require at least one option. Please add options below."
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-classes.php:661
-#: bp-xprofile/bp-xprofile-classes.php:664
+#: 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."
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-classes.php:667
+#: bp-xprofile/bp-xprofile-classes.php:791
 msgid "Checkbox field types require at least one option. Please add options below."
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-admin.php:38 bp-xprofile.php:148
-msgid "Profile Field Setup"
-msgstr ""
-
-#: bp-xprofile/bp-xprofile-admin.php:40
-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."
-msgstr ""
-
-#: bp-xprofile/bp-xprofile-admin.php:41
-msgid "NOTE: Any fields in the first group will appear on the signup page."
-msgstr ""
-
-#: bp-xprofile/bp-xprofile-admin.php:67 bp-xprofile/bp-xprofile-admin.php:94
-#: bp-forums/bp-forums-templatetags.php:977
-#: bp-themes/bp-default/functions.php:91
-msgid "Edit"
+#: bp-xprofile/bp-xprofile-admin.php:25
+msgid "Profile Fields"
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-admin.php:68 bp-xprofile/bp-xprofile-admin.php:95
-#: bp-forums/bp-forums-templatetags.php:978
-#: bp-themes/bp-default/_inc/ajax.php:192
-#: bp-activity/bp-activity-templatetags.php:668
-#: bp-activity/bp-activity-templatetags.php:801
-msgid "Delete"
+#: bp-xprofile/bp-xprofile-admin.php:74
+msgid "Extended Profile Fields"
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-admin.php:73
-msgid "Field Name"
+#: bp-xprofile/bp-xprofile-admin.php:76 bp-xprofile/bp-xprofile-admin.php:178
+msgid "Add New Group"
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-admin.php:75
-msgid "Required?"
+#: 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."
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-admin.php:76
-msgid "Action"
+#: bp-xprofile/bp-xprofile-admin.php:80
+msgid "NOTE: Any fields in the \"%s\" group will appear on the signup page."
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-admin.php:90
-msgid "Drag"
+#: bp-xprofile/bp-xprofile-admin.php:103 bp-xprofile/bp-xprofile-admin.php:399
+msgid "(Primary)"
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-admin.php:91
-msgid "(Core Field)"
+#: bp-xprofile/bp-xprofile-admin.php:120
+msgid "Add New Field"
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-admin.php:103
+#: bp-xprofile/bp-xprofile-admin.php:160
 msgid "There are no fields in this group."
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-admin.php:113
-msgid "Add New Field"
-msgstr ""
-
-#: bp-xprofile/bp-xprofile-admin.php:128
+#: bp-xprofile/bp-xprofile-admin.php:177
 msgid "You have no groups."
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-admin.php:129
-msgid "Add New Group"
-msgstr ""
-
-#: bp-xprofile/bp-xprofile-admin.php:157
+#: bp-xprofile/bp-xprofile-admin.php:209
 msgid "There was an error saving the group. Please try again"
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-admin.php:160
+#: bp-xprofile/bp-xprofile-admin.php:212
 msgid "The group was saved successfully."
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-admin.php:189
+#: bp-xprofile/bp-xprofile-admin.php:244
 msgid "There was an error deleting the group. Please try again"
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-admin.php:192
+#: bp-xprofile/bp-xprofile-admin.php:247
 msgid "The group was deleted successfully."
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-admin.php:231
+#: bp-xprofile/bp-xprofile-admin.php:288
 msgid "There was an error saving the field. Please try again"
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-admin.php:237
+#: bp-xprofile/bp-xprofile-admin.php:294
 msgid "The field was saved successfully."
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-admin.php:265
+#: bp-xprofile/bp-xprofile-admin.php:324
 msgid "field"
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-admin.php:267
+#: bp-xprofile/bp-xprofile-admin.php:326
 msgid "option"
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-admin.php:273
+#: bp-xprofile/bp-xprofile-admin.php:331
 msgid "There was an error deleting the %s. Please try again"
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-admin.php:276
+#: bp-xprofile/bp-xprofile-admin.php:334
 msgid "The %s was deleted successfully!"
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-templatetags.php:490
+#: bp-xprofile/bp-xprofile-admin.php:399
+msgid "(Required)"
+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"
+msgstr ""
+
+#. translators: no option picked in select box
+
+#: bp-xprofile/bp-xprofile-template.php:432
+#: bp-themes/bp-default/forums/index.php:116
+msgid "----"
+msgstr ""
+
+#: bp-xprofile/bp-xprofile-template.php:615
 msgid "January"
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-templatetags.php:490
+#: bp-xprofile/bp-xprofile-template.php:616
 msgid "February"
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-templatetags.php:490
+#: bp-xprofile/bp-xprofile-template.php:617
 msgid "March"
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-templatetags.php:491
+#: bp-xprofile/bp-xprofile-template.php:618
 msgid "April"
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-templatetags.php:491
+#: bp-xprofile/bp-xprofile-template.php:619
 msgid "May"
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-templatetags.php:491
+#: bp-xprofile/bp-xprofile-template.php:620
 msgid "June"
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-templatetags.php:492
+#: bp-xprofile/bp-xprofile-template.php:621
 msgid "July"
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-templatetags.php:492
+#: bp-xprofile/bp-xprofile-template.php:622
 msgid "August"
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-templatetags.php:492
+#: bp-xprofile/bp-xprofile-template.php:623
 msgid "September"
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-templatetags.php:493
+#: bp-xprofile/bp-xprofile-template.php:624
 msgid "October"
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-templatetags.php:493
+#: bp-xprofile/bp-xprofile-template.php:625
 msgid "November"
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-templatetags.php:493
+#: bp-xprofile/bp-xprofile-template.php:626
 msgid "December"
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-templatetags.php:634
+#: 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?"
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-templatetags.php:643
+#: bp-xprofile/bp-xprofile-template.php:768
 msgid "Profile not recently updated"
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-templatetags.php:654
-msgid "Profile updated %s ago"
+#: bp-xprofile/bp-xprofile-template.php:779
+msgid "Profile updated %s"
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-templatetags.php:697
-#: bp-xprofile/bp-xprofile-templatetags.php:698 bp-xprofile.php:178
+#: bp-xprofile/bp-xprofile-template.php:822
+#: bp-xprofile/bp-xprofile-template.php:823
+#: bp-members/bp-members-adminbar.php:161
 msgid "Edit Profile"
 msgstr ""
 
-#: bp-forums/bp-forums-templatetags.php:304
-#: bp-forums/bp-forums-templatetags.php:353
-#: bp-forums/bp-forums-templatetags.php:923
-msgid "Deleted User"
-msgstr ""
-
-#: bp-forums/bp-forums-templatetags.php:563
-msgid "Edit Topic"
-msgstr ""
-
-#: bp-forums/bp-forums-templatetags.php:567
-msgid "Sticky Topic"
-msgstr ""
-
-#: bp-forums/bp-forums-templatetags.php:569
-msgid "Un-stick Topic"
-msgstr ""
-
-#: bp-forums/bp-forums-templatetags.php:572
-msgid "Open Topic"
-msgstr ""
-
-#: bp-forums/bp-forums-templatetags.php:574
-msgid "Close Topic"
-msgstr ""
-
-#: bp-forums/bp-forums-templatetags.php:576
-msgid "Delete Topic"
-msgstr ""
-
-#: bp-forums/bp-forums-templatetags.php:682
-msgid " matching tag \"%s\""
+#: bp-xprofile/bp-xprofile-activity.php:22
+msgid "New member registered"
 msgstr ""
 
-#: bp-forums/bp-forums-templatetags.php:684
-msgid "Viewing topic %1$s to %2$s (%3$s total topics%4$s)"
+#: bp-xprofile/bp-xprofile-activity.php:23
+msgid "Updated Profile"
 msgstr ""
 
-#: bp-forums/bp-forums-templatetags.php:1010
-msgid "Viewing post %1$s to %2$s (%3$s total posts)"
+#: bp-xprofile/bp-xprofile-activity.php:128
+msgid "%s changed their profile picture"
 msgstr ""
 
-#: bp-forums/bp-forums-admin.php:12
+#: bp-forums/bp-forums-admin.php:30
 msgid "Settings Saved."
 msgstr ""
 
-#: bp-forums/bp-forums-admin.php:22
-msgid "bbPress forum integration in BuddyPress has been set up correctly. If you are having problems you can <a href=\"%s\" title=\"Reinstall bbPress\">re-install</a>"
-msgstr ""
-
-#: bp-forums/bp-forums-admin.php:23
-msgid "NOTE: The forums directory will only work if your bbPress tables are in the same database as your WordPress tables. If you are not using an existing bbPress install you can ignore this message."
-msgstr ""
-
-#: bp-forums/bp-forums-admin.php:39
-msgid "The bb-config.php file was not found at that location, please try again."
-msgstr ""
-
-#: bp-forums/bp-forums-admin.php:42
-msgid "Forums were set up correctly using your existing bbPress install!"
-msgstr ""
-
-#: bp-forums/bp-forums-admin.php:43
-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-forums/bp-forums-admin.php:48
-msgid "Existing bbPress Installation"
-msgstr ""
-
-#: bp-forums/bp-forums-admin.php:49
-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-forums/bp-forums-admin.php:51 bp-forums/bp-forums-admin.php:79
-msgid "Complete Installation"
-msgstr ""
-
-#: bp-forums/bp-forums-admin.php:66
-msgid "All done! Configuration settings have been saved to the file <code>bb-config.php</code> in the root of your WordPress install."
-msgstr ""
-
-#. Just write the contents to screen
-
-#: bp-forums/bp-forums-admin.php:70
-msgid "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."
-msgstr ""
-
-#: bp-forums/bp-forums-admin.php:76
-msgid "New bbPress Installation"
-msgstr ""
-
-#: bp-forums/bp-forums-admin.php:77
-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-forums/bp-forums-admin.php:87
-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-forums/bp-forums-admin.php:91
-msgid "Forums in BuddyPress make use of a bbPress installation to function. You can choose to either let BuddyPress set up a new bbPress install, or use an already existing bbPress install. Please choose one of the options below."
+#: bp-forums/bp-forums-admin.php:46
+msgid "(Installed)"
 msgstr ""
 
-#: bp-forums/bp-forums-admin.php:93
-msgid "Set up a new bbPress installation"
+#: bp-forums/bp-forums-admin.php:46 bp-forums/bp-forums-admin.php:163
+msgid "Forums for Groups"
 msgstr ""
 
-#: bp-forums/bp-forums-admin.php:94
-msgid "Use an existing bbPress installation"
+#: 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."
 msgstr ""
 
-#: bp-xprofile.php:179
-#: bp-themes/bp-default/members/single/profile/change-avatar.php:1
-msgid "Change Avatar"
-msgstr ""
-
-#: bp-xprofile.php:213 bp-groups.php:250
-msgid "Admin Options"
-msgstr ""
-
-#: bp-xprofile.php:216
-msgid "Edit %s's Profile"
-msgstr ""
-
-#: bp-xprofile.php:217
-msgid "Edit %s's Avatar"
-msgstr ""
-
-#: bp-xprofile.php:220
-msgid "Mark as Spammer"
-msgstr ""
-
-#: bp-xprofile.php:222
-msgid "Not a Spammer"
-msgstr ""
-
-#: bp-xprofile.php:225
-msgid "Delete %s"
-msgstr ""
-
-#: bp-xprofile.php:318
-msgid "Please make sure you fill in all required fields in this profile field group before saving."
-msgstr ""
-
-#: bp-xprofile.php:335
-msgid "There was a problem updating some of your profile information, please try again."
-msgstr ""
-
-#: bp-xprofile.php:337
-msgid "Changes saved."
-msgstr ""
-
-#: bp-xprofile.php:388
-msgid "Your new avatar was uploaded successfully!"
-msgstr ""
-
-#: bp-xprofile.php:433 bp-groups.php:739
-msgid "Your avatar was deleted successfully!"
+#: 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."
 msgstr ""
 
-#: bp-xprofile.php:435 bp-groups.php:741
-msgid "There was a problem deleting that avatar, please try again."
+#: 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"
 msgstr ""
 
-#: bp-xprofile.php:455
-msgid "New member registered"
+#: bp-forums/bp-forums-admin.php:53 bp-forums/bp-forums-admin.php:170
+msgid "Group Integration"
 msgstr ""
 
-#: bp-xprofile.php:456
-msgid "Updated Profile"
+#: bp-forums/bp-forums-admin.php:54 bp-forums/bp-forums-admin.php:171
+msgid "Member Profile Integration"
 msgstr ""
 
-#: bp-messages/bp-messages-classes.php:193
-msgid " Recipients"
+#: 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"
 msgstr ""
 
-#: bp-messages/bp-messages-templatetags.php:335
-msgid "Viewing message %1$s to %2$s (of %3$s messages)"
+#: 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"
 msgstr ""
 
-#: bp-messages/bp-messages-templatetags.php:376
-msgid "Select:"
+#: bp-forums/bp-forums-admin.php:60
+msgid "Uninstall Group Forums"
 msgstr ""
 
-#: bp-messages/bp-messages-templatetags.php:379
-msgid "Read"
+#: bp-forums/bp-forums-admin.php:65 bp-forums/bp-forums-admin.php:183
+msgid "New! Site Wide Forums"
 msgstr ""
 
-#: bp-messages/bp-messages-templatetags.php:380
-msgid "Unread"
+#: 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."
 msgstr ""
 
-#: bp-messages/bp-messages-templatetags.php:381
-msgid "All"
+#: 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."
 msgstr ""
 
-#: bp-messages/bp-messages-templatetags.php:384
-msgid "Mark as Read"
+#: bp-forums/bp-forums-admin.php:71 bp-forums/bp-forums-admin.php:189
+msgid "Central Discussion Area"
 msgstr ""
 
-#: bp-messages/bp-messages-templatetags.php:385
-msgid "Mark as Unread"
+#: bp-forums/bp-forums-admin.php:72 bp-forums/bp-forums-admin.php:190
+msgid "Forum Plugins Available"
 msgstr ""
 
-#: bp-messages/bp-messages-templatetags.php:387
-msgid "Delete Selected"
+#: bp-forums/bp-forums-admin.php:77 bp-forums/bp-forums-admin.php:195
+msgid "Install Site Wide Forums"
 msgstr ""
 
-#: bp-messages/bp-messages-templatetags.php:396
-msgid "Currently Active"
+#: bp-forums/bp-forums-admin.php:96
+msgid "The bb-config.php file was not found at that location, please try again."
 msgstr ""
 
-#: bp-messages/bp-messages-templatetags.php:463
-msgid "Deactivate"
+#: bp-forums/bp-forums-admin.php:99
+msgid "Forums were set up correctly using your existing bbPress install!"
 msgstr ""
 
-#: bp-messages/bp-messages-templatetags.php:465
-#: bp-themes/bp-default/registration/activate.php:40
-msgid "Activate"
+#: 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."
 msgstr ""
 
-#: bp-messages/bp-messages-templatetags.php:490
-#: bp-themes/bp-default/functions.php:32
-msgid "Close"
+#: bp-forums/bp-forums-admin.php:105
+msgid "Existing bbPress Installation"
 msgstr ""
 
-#: bp-messages/bp-messages-templatetags.php:535
-msgid "Send a private message to this user."
+#: 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."
 msgstr ""
 
-#: bp-messages/bp-messages-templatetags.php:536
-msgid "Send Private Message"
+#: bp-forums/bp-forums-admin.php:108 bp-forums/bp-forums-admin.php:140
+msgid "Complete Installation"
 msgstr ""
 
-#: bp-messages/bp-messages-templatetags.php:708
-msgid "%d Recipients"
+#: 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>"
 msgstr ""
 
-#: bp-messages/bp-messages-templatetags.php:774
-#: bp-themes/bp-default/_inc/ajax.php:468
-msgid "Sent %s ago"
+#: 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>"
 msgstr ""
 
-#: bp-messages/bp-messages-notifications.php:23
-msgid "New message from %s"
+#: bp-forums/bp-forums-admin.php:137
+msgid "New bbPress Installation"
 msgstr ""
 
-#: bp-messages/bp-messages-notifications.php:25
+#: bp-forums/bp-forums-admin.php:138
 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"
-msgstr ""
-
-#: bp-groups.php:91
-msgid "Details"
+"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.php:93 bp-activity/bp-activity-templatetags.php:430
-#: bp-activity/bp-activity-templatetags.php:476
-msgid "Avatar"
+#: 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\""
 msgstr ""
 
-#: bp-groups.php:97 bp-groups.php:154
-msgid "Invites"
+#: bp-forums/bp-forums-admin.php:177
+msgid "Install Group Forums"
 msgstr ""
 
-#: bp-groups.php:148
-msgid "Groups <span>(%d)</span>"
+#: bp-forums/bp-forums-admin.php:178
+msgid "Use Existing Installation"
 msgstr ""
 
-#: bp-groups.php:153 bp-groups.php:160
-msgid "My Groups"
+#: bp-forums/bp-forums-loader.php:61
+msgid "Search Forums..."
 msgstr ""
 
-#: bp-groups.php:205
-msgid "Admin"
+#: bp-forums/bp-forums-loader.php:135 bp-forums/bp-forums-loader.php:202
+msgid "Topics Started"
 msgstr ""
 
-#: bp-groups.php:212
-msgid "Forum"
+#: bp-forums/bp-forums-loader.php:146
+msgid "Replied To"
 msgstr ""
 
-#: bp-groups.php:214
-msgid "Members (%s)"
+#: bp-forums/bp-forums-loader.php:210
+msgid "Replies"
 msgstr ""
 
-#: bp-groups.php:218 bp-themes/bp-default/groups/single/send-invites.php:60
-msgid "Send Invites"
+#: bp-forums/bp-forums-loader.php:218
+msgid "Favorite Topics"
 msgstr ""
 
-#: bp-groups.php:298
-msgid "Group invite could not be accepted"
+#: bp-forums/bp-forums-template.php:189 bp-forums/bp-forums-template.php:405
+msgctxt "Forum topic pagination previous text"
+msgid "&larr;"
 msgstr ""
 
-#: bp-groups.php:300
-msgid "Group invite accepted"
+#: bp-forums/bp-forums-template.php:190 bp-forums/bp-forums-template.php:406
+msgctxt "Forum topic pagination next text"
+msgid "&rarr;"
 msgstr ""
 
-#: bp-groups.php:306 bp-groups.php:1774 bp-groups.php:2479
-msgid "%s joined the group %s"
+#: bp-forums/bp-forums-template.php:506 bp-forums/bp-forums-template.php:568
+#: bp-forums/bp-forums-template.php:1208
+msgid "Deleted User"
 msgstr ""
 
-#: bp-groups.php:320
-msgid "Group invite could not be rejected"
+#: bp-forums/bp-forums-template.php:586
+msgid "Group logo for %s"
 msgstr ""
 
-#: bp-groups.php:322
-msgid "Group invite rejected"
+#: bp-forums/bp-forums-template.php:792
+msgid "Edit Topic"
 msgstr ""
 
-#: bp-groups.php:376
-msgid "There was an error when replying to that topic"
+#: bp-forums/bp-forums-template.php:796
+msgid "Sticky Topic"
 msgstr ""
 
-#: bp-groups.php:378
-msgid "Your reply was posted successfully"
+#: bp-forums/bp-forums-template.php:798
+msgid "Un-stick Topic"
 msgstr ""
 
-#: bp-groups.php:392
-msgid "There was an error when making that topic a sticky"
+#: bp-forums/bp-forums-template.php:801
+msgid "Open Topic"
 msgstr ""
 
-#: bp-groups.php:394
-msgid "The topic was made sticky successfully"
+#: bp-forums/bp-forums-template.php:803
+msgid "Close Topic"
 msgstr ""
 
-#: bp-groups.php:406
-msgid "There was an error when unsticking that topic"
+#: bp-forums/bp-forums-template.php:805
+msgid "Delete Topic"
 msgstr ""
 
-#: bp-groups.php:408
-msgid "The topic was unstuck successfully"
+#: bp-forums/bp-forums-template.php:960
+msgid " matching tag \"%s\""
 msgstr ""
 
-#: bp-groups.php:420
-msgid "There was an error when closing that topic"
+#: bp-forums/bp-forums-template.php:962
+msgid "Viewing topic %s to %s (of %s total topics%s)"
 msgstr ""
 
-#: bp-groups.php:422
-msgid "The topic was closed successfully"
+#: bp-forums/bp-forums-template.php:1044
+msgctxt "Forum thread pagination previous text"
+msgid "&larr;"
 msgstr ""
 
-#: bp-groups.php:434
-msgid "There was an error when opening that topic"
+#: bp-forums/bp-forums-template.php:1045
+msgctxt "Forum thread pagination next text"
+msgid "&rarr;"
 msgstr ""
 
-#: bp-groups.php:436
-msgid "The topic was opened successfully"
+#: bp-forums/bp-forums-template.php:1293
+msgid "Viewing post %1$s to %2$s (%3$s total posts)"
 msgstr ""
 
-#: bp-groups.php:455
-msgid "There was an error deleting the topic"
+#: bp-forums/bp-forums-screens.php:13
+msgid "The forums component has not been set up yet."
 msgstr ""
 
-#: bp-groups.php:457
-msgid "The topic was deleted successfully"
+#: 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.php:477
-msgid "There was an error when editing that topic"
+#: bp-messages/bp-messages-loader.php:24
+msgid "Private Messages"
 msgstr ""
 
-#: bp-groups.php:479
-msgid "The topic was edited successfully"
+#: bp-messages/bp-messages-loader.php:79
+msgid "Search Messages..."
 msgstr ""
 
-#: bp-groups.php:501
-msgid "There was an error deleting that post"
+#: bp-messages/bp-messages-loader.php:96 bp-messages/bp-messages-actions.php:41
+msgid "Messages <span>%s</span>"
 msgstr ""
 
-#: bp-groups.php:503
-msgid "The post was deleted successfully"
+#: bp-messages/bp-messages-loader.php:114
+#: bp-messages/bp-messages-loader.php:182
+#: bp-messages/bp-messages-functions.php:237
+msgid "Inbox"
 msgstr ""
 
-#: bp-groups.php:523
-msgid "There was an error when editing that post"
+#: bp-messages/bp-messages-loader.php:124
+#: bp-messages/bp-messages-loader.php:205
+msgid "Sent"
 msgstr ""
 
-#: bp-groups.php:525
-msgid "The post was edited successfully"
+#: bp-messages/bp-messages-loader.php:134
+#: bp-messages/bp-messages-loader.php:213
+msgid "Compose"
 msgstr ""
 
-#: bp-groups.php:592
-msgid "Group invites sent."
+#: bp-messages/bp-messages-loader.php:145
+msgid "Notices"
 msgstr ""
 
-#: bp-groups.php:618
-msgid "There was an error sending your group membership request, please try again."
+#: bp-messages/bp-messages-loader.php:178
+msgid "Messages <span class=\"count\">%s</span>"
 msgstr ""
 
-#: bp-groups.php:620
-msgid "Your membership request was sent to the group administrator successfully. You will be notified when the group administrator responds to your request."
+#: bp-messages/bp-messages-loader.php:179
+msgid "Inbox <span class=\"count\">%s</span>"
 msgstr ""
 
-#: bp-groups.php:669
-msgid "There was an error updating group details, please try again."
+#: bp-messages/bp-messages-loader.php:181
+#: bp-messages/bp-messages-screens.php:149
+msgid "Messages"
 msgstr ""
 
-#: bp-groups.php:671
-msgid "Group details were successfully updated."
+#: bp-messages/bp-messages-loader.php:222
+msgid "All Member Notices"
 msgstr ""
 
-#: bp-groups.php:707
-msgid "There was an error updating group settings, please try again."
+#: bp-messages/bp-messages-loader.php:241
+msgid "My Messages"
 msgstr ""
 
-#: bp-groups.php:709
-msgid "Group settings were successfully updated."
+#: bp-messages/bp-messages-template.php:75
+msgctxt "Message pagination previous text"
+msgid "&larr;"
 msgstr ""
 
-#: bp-groups.php:769
-msgid "There was a problem cropping the avatar, please try uploading it again"
+#: bp-messages/bp-messages-template.php:76
+msgctxt "Message pagination next text"
+msgid "&rarr;"
 msgstr ""
 
-#: bp-groups.php:771
-msgid "The new group avatar was uploaded successfully!"
+#: bp-messages/bp-messages-template.php:343
+msgid "Viewing message %1$s to %2$s (of %3$s messages)"
 msgstr ""
 
-#: bp-groups.php:800
-msgid "There was an error when promoting that user, please try again"
+#: bp-messages/bp-messages-template.php:401
+msgid "Select:"
 msgstr ""
 
-#: bp-groups.php:802
-msgid "User promoted successfully"
+#: bp-messages/bp-messages-template.php:404
+msgid "Read"
 msgstr ""
 
-#: bp-groups.php:818
-msgid "There was an error when demoting that user, please try again"
+#: bp-messages/bp-messages-template.php:405
+msgid "Unread"
 msgstr ""
 
-#: bp-groups.php:820
-msgid "User demoted successfully"
+#: bp-messages/bp-messages-template.php:406
+msgid "All"
 msgstr ""
 
-#: bp-groups.php:836
-msgid "There was an error when banning that user, please try again"
+#: bp-messages/bp-messages-template.php:409
+msgid "Mark as Read"
 msgstr ""
 
-#: bp-groups.php:838
-msgid "User banned successfully"
+#: bp-messages/bp-messages-template.php:410
+msgid "Mark as Unread"
 msgstr ""
 
-#: bp-groups.php:854
-msgid "There was an error when unbanning that user, please try again"
+#: bp-messages/bp-messages-template.php:412
+msgid "Delete Selected"
 msgstr ""
 
-#: bp-groups.php:856
-msgid "User ban removed successfully"
+#: bp-messages/bp-messages-template.php:421
+msgid "Currently Active"
 msgstr ""
 
-#: bp-groups.php:872
-msgid "There was an error removing that user from the group, please try again"
+#: bp-messages/bp-messages-template.php:496
+msgid "Deactivate"
 msgstr ""
 
-#: bp-groups.php:874
-msgid "User removed successfully"
+#: bp-messages/bp-messages-template.php:547
+#: bp-themes/bp-default/functions.php:155
+msgid "Close"
 msgstr ""
 
-#: bp-groups.php:915
-msgid "There was an error accepting the membership request, please try again."
+#: bp-messages/bp-messages-template.php:591
+msgid "Send a private message to this user."
 msgstr ""
 
-#: bp-groups.php:917
-msgid "Group membership request accepted"
+#: bp-messages/bp-messages-template.php:592
+msgid "Private Message"
 msgstr ""
 
-#: bp-groups.php:927
-msgid "There was an error rejecting the membership request, please try again."
+#: bp-messages/bp-messages-template.php:782
+msgid "%d Recipients"
 msgstr ""
 
-#: bp-groups.php:929
-msgid "Group membership request rejected"
+#: bp-messages/bp-messages-template.php:857
+#: bp-themes/bp-default/_inc/ajax.php:543
+msgid "Sent %s"
 msgstr ""
 
-#: bp-groups.php:961
-msgid "There was an error deleting the group, please try again."
+#: bp-messages/bp-messages-actions.php:30
+msgid "Your reply was sent successfully"
 msgstr ""
 
-#: bp-groups.php:963
-msgid "The group was deleted successfully"
+#: bp-messages/bp-messages-actions.php:32
+msgid "There was a problem sending your reply, please try again"
 msgstr ""
 
-#: bp-groups.php:995
-msgid "A member invites you to join a group"
+#: bp-messages/bp-messages-actions.php:48
+msgid "From: %s"
 msgstr ""
 
-#: bp-groups.php:1001
-msgid "Group information is updated"
+#: bp-messages/bp-messages-actions.php:78
+msgid "There was an error deleting that message."
 msgstr ""
 
-#: bp-groups.php:1007
-msgid "You are promoted to a group administrator or moderator"
+#: bp-messages/bp-messages-actions.php:80
+msgid "Message deleted."
 msgstr ""
 
-#: bp-groups.php:1013
-msgid "A member requests to join a private group for which you are an admin"
+#: bp-messages/bp-messages-actions.php:102
+msgid "There was an error deleting messages."
 msgstr ""
 
-#: bp-groups.php:1062
-msgid "There was an error saving group details. Please try again."
+#: bp-messages/bp-messages-actions.php:104
+#: bp-themes/bp-default/_inc/ajax.php:609
+msgid "Messages deleted."
 msgstr ""
 
-#: bp-groups.php:1084
-msgid "Please fill in all of the required fields"
+#: bp-messages/bp-messages-classes.php:203
+msgid " Recipients"
 msgstr ""
 
-#: bp-groups.php:1089 bp-groups.php:1116
-msgid "There was an error saving group details, please try again."
+#: 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"
 msgstr ""
 
-#: bp-groups.php:1147
-msgid "%s created the group %s"
+#: bp-messages/bp-messages-screens.php:59
+msgid "Notice sent successfully!"
 msgstr ""
 
-#: bp-groups.php:1195
-msgid "There was an error saving the group avatar, please try uploading again."
+#: bp-messages/bp-messages-screens.php:62
+msgid "There was an error sending that notice, please try again"
 msgstr ""
 
-#: bp-groups.php:1197
-msgid "The group avatar was uploaded successfully!"
+#: bp-messages/bp-messages-screens.php:73
+msgid "Message sent successfully!"
 msgstr ""
 
-#: bp-groups.php:1221 bp-groups.php:1228
-msgid "There was an error joining the group."
+#: bp-messages/bp-messages-screens.php:100
+msgid "There was a problem deactivating that notice."
 msgstr ""
 
-#: bp-groups.php:1230
-msgid "You joined the group!"
+#: bp-messages/bp-messages-screens.php:102
+msgid "Notice deactivated."
 msgstr ""
 
-#: bp-groups.php:1253
-msgid "There was an error leaving the group."
+#: bp-messages/bp-messages-screens.php:106
+msgid "There was a problem activating that notice."
 msgstr ""
 
-#: bp-groups.php:1255 bp-groups.php:1732
-msgid "You successfully left the group."
+#: bp-messages/bp-messages-screens.php:108
+msgid "Notice activated."
 msgstr ""
 
-#: bp-groups.php:1333
-msgid "Created a group"
+#: bp-messages/bp-messages-screens.php:112
+msgid "There was a problem deleting that notice."
 msgstr ""
 
-#: bp-groups.php:1334
-msgid "Joined a group"
+#: bp-messages/bp-messages-screens.php:114
+msgid "Notice deleted."
 msgstr ""
 
-#: bp-groups.php:1335
-msgid "New group forum topic"
+#: bp-messages/bp-messages-screens.php:158
+msgid "A member sends you a new message"
 msgstr ""
 
-#: bp-groups.php:1336
-msgid "New group forum post"
+#: bp-messages/bp-messages-screens.php:164
+msgid "A new site notice is posted"
 msgstr ""
 
-#: bp-groups.php:1396
-msgid "Group Membership Requests"
+#: bp-messages/bp-messages-notifications.php:30
+msgid "New message from %s"
 msgstr ""
 
-#: bp-groups.php:1396
-msgid "%d new membership requests for the group \"%s\""
+#: 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"
 msgstr ""
 
-#: bp-groups.php:1399
-msgid "%s requests membership for the group \"%s\""
+#: bp-messages/bp-messages-functions.php:48
+msgid "Re: %s"
 msgstr ""
 
-#: bp-groups.php:1410
-msgid "%d accepted group membership requests"
+#: bp-messages/bp-messages-functions.php:56
+msgid "No Subject"
 msgstr ""
 
-#: bp-groups.php:1412
-msgid "Membership for group \"%s\" accepted"
+#: bp-messages/bp-messages-functions.php:240
+msgid "You have %d new messages"
 msgstr ""
 
-#: bp-groups.php:1423
-msgid "%d rejected group membership requests"
+#: bp-messages/bp-messages-functions.php:243
+msgid "You have %d new message"
 msgstr ""
 
-#: bp-groups.php:1425
-msgid "Membership for group \"%s\" rejected"
+#: bp-members/bp-members-adminbar.php:92
+msgid "Log in"
 msgstr ""
 
-#: bp-groups.php:1436
-msgid "You were promoted to an admin in %d groups"
+#: bp-members/bp-members-adminbar.php:152
+msgid "Edit Member"
 msgstr ""
 
-#: bp-groups.php:1438
-msgid "You were promoted to an admin in the group %s"
+#: bp-members/bp-members-adminbar.php:178
+#: bp-members/bp-members-buddybar.php:116
+msgid "Mark as Spammer"
 msgstr ""
 
-#: bp-groups.php:1449
-msgid "You were promoted to a mod in %d groups"
+#: bp-members/bp-members-adminbar.php:180
+msgid "Are you sure you want to mark this user as a spammer?"
 msgstr ""
 
-#: bp-groups.php:1451
-msgid "You were promoted to a mod in the group %s"
+#: bp-members/bp-members-adminbar.php:186
+#: bp-members/bp-members-buddybar.php:120
+msgid "Not a Spammer"
 msgstr ""
 
-#: bp-groups.php:1462 bp-groups.php:1464
-msgid "Group Invites"
+#: bp-members/bp-members-adminbar.php:188
+msgid "Are you sure you want to mark this user as not a spammer?"
 msgstr ""
 
-#: bp-groups.php:1462
-msgid "You have %d new group invitations"
+#: bp-members/bp-members-adminbar.php:198
+msgid "Are you sure you want to delete this user's account?"
 msgstr ""
 
-#: bp-groups.php:1464
-msgid "You have an invitation to the group: %s"
+#: bp-members/bp-members-adminbar.php:215
+msgid "Notifications <span id=\"ab-pending-notifications\" class=\"pending-count\">%s</span>"
 msgstr ""
 
-#: bp-groups.php:1709
-msgid "As the only Admin, you cannot leave the group."
+#: bp-members/bp-members-adminbar.php:253
+msgid "No new notifications"
 msgstr ""
 
-#: bp-groups.php:1962
-msgid "%s posted an update in the group %s:"
+#: bp-members/bp-members-actions.php:87
+msgid "User marked as spammer. Spam users are visible only to site admins."
 msgstr ""
 
-#: bp-groups.php:2033 bp-groups.php:2138
-msgid "%s posted on the forum topic %s in the group %s:"
+#: bp-members/bp-members-actions.php:89
+msgid "User removed as spammer."
 msgstr ""
 
-#: bp-groups.php:2072 bp-groups.php:2104
-msgid "%s started the forum topic %s in the group %s:"
+#: bp-members/bp-members-actions.php:136
+msgid "%s has been deleted from the system."
 msgstr ""
 
-#: bp-messages.php:105
-msgid "Messages <strong>(%s)</strong>"
+#: bp-members/bp-members-actions.php:138
+msgid "There was an error deleting %s from the system. Please try again."
 msgstr ""
 
-#: bp-messages.php:107
-msgid "Messages <strong></strong>"
+#: bp-members/bp-members-buddybar.php:34
+msgid "No new notifications."
 msgstr ""
 
-#: bp-messages.php:115
-msgid "Inbox"
+#: bp-members/bp-members-buddybar.php:62
+msgid "Blog Authors"
 msgstr ""
 
-#: bp-messages.php:116
-msgid "Sent Messages"
+#: bp-members/bp-members-buddybar.php:108
+msgid "Edit %s's Profile"
 msgstr ""
 
-#: bp-messages.php:117
-msgid "Compose"
+#: bp-members/bp-members-buddybar.php:112
+msgid "Edit %s's Avatar"
 msgstr ""
 
-#: bp-messages.php:120
-msgid "Notices"
+#: bp-members/bp-members-buddybar.php:124
+msgid "Delete %s's Account"
 msgstr ""
 
-#: bp-messages.php:124
-msgid "My Messages"
+#: bp-members/bp-members-loader.php:70
+msgid "Search Members..."
 msgstr ""
 
-#: bp-messages.php:167 bp-messages.php:189
-msgid "There was an error sending that message, please try again"
+#: bp-members/bp-members-loader.php:177
+msgid "You"
 msgstr ""
 
-#: bp-messages.php:172
-msgid "Notice sent successfully!"
+#: bp-members/bp-members-functions.php:671
+msgid "<strong>ERROR</strong>: Your account has been marked as a spammer."
 msgstr ""
 
-#: bp-messages.php:175
-msgid "There was an error sending that notice, please try again"
+#: bp-members/bp-members-signup.php:59
+msgid "Please make sure you enter your password twice"
 msgstr ""
 
-#: bp-messages.php:186
-msgid "Message sent successfully!"
+#: bp-members/bp-members-signup.php:63
+msgid "The passwords you entered do not match."
 msgstr ""
 
-#: bp-messages.php:213
-msgid "There was a problem deactivating that notice."
+#: bp-members/bp-members-signup.php:86
+msgid "This is a required field"
 msgstr ""
 
-#: bp-messages.php:215
-msgid "Notice deactivated."
+#: bp-members/bp-members-signup.php:199
+msgid "Your account is now active!"
 msgstr ""
 
-#: bp-messages.php:219
-msgid "There was a problem activating that notice."
+#: bp-members/bp-members-signup.php:308
+msgid "Please enter a username"
 msgstr ""
 
-#: bp-messages.php:221
-msgid "Notice activated."
+#: bp-members/bp-members-signup.php:319
+msgid "Only lowercase letters and numbers allowed"
 msgstr ""
 
-#: bp-messages.php:225
-msgid "There was a problem deleting that notice."
+#: bp-members/bp-members-signup.php:322
+msgid "Username must be at least 4 characters"
 msgstr ""
 
-#: bp-messages.php:227
-msgid "Notice deleted."
+#: bp-members/bp-members-signup.php:325
+msgid "Sorry, usernames may not contain the character \"_\"!"
 msgstr ""
 
-#: bp-messages.php:244
-msgid "Messages"
+#: bp-members/bp-members-signup.php:332
+msgid "Sorry, usernames must have letters too!"
 msgstr ""
 
-#: bp-messages.php:253
-msgid "A member sends you a new message"
+#: bp-members/bp-members-signup.php:335
+msgid "Please check your email address."
 msgstr ""
 
-#: bp-messages.php:259
-msgid "A new site notice is posted"
+#: bp-members/bp-members-signup.php:338 bp-members/bp-members-signup.php:346
+msgid "Sorry, that email address is not allowed!"
 msgstr ""
 
-#: bp-messages.php:299
-msgid "Your reply was sent successfully"
+#: bp-members/bp-members-signup.php:351
+msgid "Sorry, that username already exists!"
 msgstr ""
 
-#: bp-messages.php:301
-msgid "There was a problem sending your reply, please try again"
+#: bp-members/bp-members-signup.php:355
+msgid "Sorry, that email address is already used!"
 msgstr ""
 
-#: bp-messages.php:311
-msgid "From: %s"
+#: 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> !"
 msgstr ""
 
-#: bp-messages.php:332
-msgid "There was an error deleting that message."
+#: bp-members/bp-members-signup.php:479 bp-members/bp-members-signup.php:483
+msgid "Invalid activation key"
 msgstr ""
 
-#: bp-messages.php:334
-msgid "Message deleted."
+#: bp-members/bp-members-signup.php:523
+msgid "%s became a registered member"
 msgstr ""
 
-#: bp-messages.php:356
-msgid "There was an error deleting messages."
+#: bp-members/bp-members-signup.php:597
+msgid "<strong>ERROR</strong>: Your account has not been activated. Check your email for the activation link."
 msgstr ""
 
-#: bp-messages.php:358 bp-themes/bp-default/_inc/ajax.php:534
-msgid "Messages deleted."
+#: bp-members/bp-members-template.php:212
+msgctxt "Member pagination previous text"
+msgid "&larr;"
 msgstr ""
 
-#: bp-messages.php:378
-msgid "You have %d new messages"
+#: bp-members/bp-members-template.php:213
+msgctxt "Member pagination next text"
+msgid "&rarr;"
 msgstr ""
 
-#: bp-messages.php:380
-msgid "You have %d new message"
+#: bp-members/bp-members-template.php:354
+msgid "Viewing member %1$s to %2$s (of %3$s active members)"
 msgstr ""
 
-#: bp-messages.php:434
-msgid "Re: %s"
+#: bp-members/bp-members-template.php:356
+msgid "Viewing member %1$s to %2$s (of %3$s members with friends)"
 msgstr ""
 
-#: bp-messages.php:442
-msgid "No Subject"
+#: bp-members/bp-members-template.php:358
+msgid "Viewing member %1$s to %2$s (of %3$s members online)"
 msgstr ""
 
-#: bp-blogs.php:109
-msgid "Blogs <span>(%d)</span>"
+#: bp-members/bp-members-template.php:360
+msgid "Viewing member %1$s to %2$s (of %3$s members)"
 msgstr ""
 
-#: bp-blogs.php:190
-msgid "New blog created"
+#: bp-members/bp-members-template.php:561
+msgid "Never active"
 msgstr ""
 
-#: bp-blogs.php:191
-msgid "New blog post published"
+#: bp-members/bp-members-template.php:583
+msgctxt "member latest update in member directory"
+msgid "- &quot;%s &quot;"
 msgstr ""
 
-#: bp-blogs.php:192
-msgid "New blog post comment posted"
+#: bp-members/bp-members-template.php:640
+msgid "registered %s"
 msgstr ""
 
-#: bp-blogs.php:360
-msgid "%s created the blog %s"
+#: bp-members/bp-members-template.php:1091
+msgid "Your Avatar"
 msgstr ""
 
-#: bp-blogs.php:422
-msgid "%s wrote a new blog post: %s"
+#: bp-members/bp-members-template.php:1159
+msgid "Activity RSS Feed"
 msgstr ""
 
-#: bp-blogs.php:498
-msgid "%s commented on the blog post %s"
+#: 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"
 msgstr ""
 
-#: bp-themes/bp-default/index.php:20 bp-themes/bp-default/index.php:26
-#: bp-themes/bp-default/search.php:29 bp-themes/bp-default/search.php:35
-#: bp-themes/bp-default/archive.php:29 bp-themes/bp-default/archive.php:35
-#: bp-themes/bp-default/single.php:23 bp-themes/bp-default/single.php:29
-msgid "by %s"
+#: bp-themes/bp-default/index.php:27
+msgctxt "Sticky post"
+msgid "Featured"
 msgstr ""
 
-#: bp-themes/bp-default/index.php:24 bp-themes/bp-default/search.php:33
-#: bp-themes/bp-default/archive.php:33 bp-themes/bp-default/single.php:27
+#: 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"
 msgstr ""
 
-#: bp-themes/bp-default/index.php:26 bp-themes/bp-default/search.php:35
-#: bp-themes/bp-default/archive.php:35 bp-themes/bp-default/single.php:29
-msgid "in"
+#: 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>"
 msgstr ""
 
-#: bp-themes/bp-default/index.php:29 bp-themes/bp-default/search.php:38
-#: bp-themes/bp-default/archive.php:38 bp-themes/bp-default/single.php:32
+#: 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;"
 msgstr ""
 
-#: bp-themes/bp-default/index.php:32 bp-themes/bp-default/search.php:41
-#: bp-themes/bp-default/archive.php:41 bp-themes/bp-default/single.php:37
+#: 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: "
+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: "
 msgstr ""
 
-#: bp-themes/bp-default/index.php:32 bp-themes/bp-default/search.php:41
-#: bp-themes/bp-default/archive.php:41 bp-themes/bp-default/single.php:37
+#: 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;"
 msgstr ""
 
-#: bp-themes/bp-default/index.php:32 bp-themes/bp-default/search.php:41
-#: bp-themes/bp-default/archive.php:41 bp-themes/bp-default/single.php:37
+#: 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;"
 msgstr ""
 
-#: bp-themes/bp-default/index.php:32 bp-themes/bp-default/search.php:41
-#: bp-themes/bp-default/archive.php:41 bp-themes/bp-default/single.php:37
+#: bp-themes/bp-default/index.php:41 bp-themes/bp-default/search.php:38
+#: bp-themes/bp-default/archive.php:37
 msgid "% Comments &#187;"
 msgstr ""
 
-#: bp-themes/bp-default/index.php:43 bp-themes/bp-default/search.php:17
-#: bp-themes/bp-default/search.php:51 bp-themes/bp-default/archive.php:16
-#: bp-themes/bp-default/archive.php:52 bp-themes/bp-default/single.php:14
-msgid "&larr; Previous Entries"
-msgstr ""
-
-#: bp-themes/bp-default/index.php:44 bp-themes/bp-default/search.php:18
-#: bp-themes/bp-default/search.php:52 bp-themes/bp-default/archive.php:17
-#: bp-themes/bp-default/archive.php:53 bp-themes/bp-default/single.php:15
-msgid "Next Entries &rarr;"
-msgstr ""
-
-#: bp-themes/bp-default/index.php:50 bp-themes/bp-default/archive.php:59
+#: bp-themes/bp-default/index.php:54 bp-themes/bp-default/archive.php:50
 msgid "Not Found"
 msgstr ""
 
-#: bp-themes/bp-default/index.php:51
+#: bp-themes/bp-default/index.php:55
 msgid "Sorry, but you are looking for something that isn't here."
 msgstr ""
 
-#: bp-themes/bp-default/registration/activate.php:16
+#: bp-themes/bp-default/registration/activate.php:12
 msgid "Account Activated"
 msgstr ""
 
-#: bp-themes/bp-default/registration/activate.php:21
+#: 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:23
+#: 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:32
+#: bp-themes/bp-default/registration/activate.php:28
 msgid "Please provide a valid activation key."
 msgstr ""
 
-#: bp-themes/bp-default/registration/activate.php:36
+#: bp-themes/bp-default/registration/activate.php:32
 msgid "Activation Key:"
 msgstr ""
 
-#: bp-themes/bp-default/registration/register.php:18
+#: 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:26
+#: bp-themes/bp-default/registration/register.php:35
 msgid "Account Details"
 msgstr ""
 
-#: bp-themes/bp-default/registration/register.php:28
-#: bp-themes/bp-default/sidebar.php:41
+#: 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:28
-#: bp-themes/bp-default/registration/register.php:32
-#: bp-themes/bp-default/registration/register.php:36
-#: bp-themes/bp-default/registration/register.php:40
-#: bp-themes/bp-default/registration/register.php:67
-#: bp-themes/bp-default/registration/register.php:75
-#: bp-themes/bp-default/registration/register.php:83
-#: bp-themes/bp-default/registration/register.php:93
-#: bp-themes/bp-default/registration/register.php:104
-#: bp-themes/bp-default/registration/register.php:119
-#: bp-themes/bp-default/registration/register.php:130
-#: bp-themes/bp-default/registration/register.php:180
+#: 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/members/single/profile/edit.php:23
-#: bp-themes/bp-default/members/single/profile/edit.php:30
-#: bp-themes/bp-default/members/single/profile/edit.php:37
-#: bp-themes/bp-default/members/single/profile/edit.php:46
-#: bp-themes/bp-default/members/single/profile/edit.php:60
-#: bp-themes/bp-default/members/single/profile/edit.php:74
-#: bp-themes/bp-default/members/single/profile/edit.php:84
-#: bp-themes/bp-default/groups/create.php:26
-#: bp-themes/bp-default/groups/create.php:29
+#: 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)"
 msgstr ""
 
-#: bp-themes/bp-default/registration/register.php:32
+#: bp-themes/bp-default/registration/register.php:41
 msgid "Email Address"
 msgstr ""
 
-#: bp-themes/bp-default/registration/register.php:36
+#: bp-themes/bp-default/registration/register.php:45
 msgid "Choose a Password"
 msgstr ""
 
-#: bp-themes/bp-default/registration/register.php:40
+#: bp-themes/bp-default/registration/register.php:49
 msgid "Confirm Password"
 msgstr ""
 
-#: bp-themes/bp-default/registration/register.php:56
+#: bp-themes/bp-default/registration/register.php:65
 msgid "Profile Details"
 msgstr ""
 
-#: bp-themes/bp-default/registration/register.php:110
-#: bp-themes/bp-default/members/single/profile/edit.php:52
-#: bp-themes/bp-default/members/single/profile/edit.php:65
-msgid "Clear"
-msgstr ""
-
-#: bp-themes/bp-default/registration/register.php:174
+#: bp-themes/bp-default/registration/register.php:183
 msgid "Blog Details"
 msgstr ""
 
-#: bp-themes/bp-default/registration/register.php:176
-msgid "Yes, I'd like to create a new blog"
-msgstr ""
-
-#: bp-themes/bp-default/registration/register.php:180
-msgid "Blog URL"
+#: bp-themes/bp-default/registration/register.php:185
+msgid "Yes, I'd like to create a new site"
 msgstr ""
 
 #: bp-themes/bp-default/registration/register.php:189
-msgid "Blog Title"
+msgid "Blog URL"
 msgstr ""
 
-#: bp-themes/bp-default/registration/register.php:193
-msgid "I would like my blog to appear in search engines, and in public listings around this site"
+#: bp-themes/bp-default/registration/register.php:198
+msgid "Site Title"
 msgstr ""
 
-#: bp-themes/bp-default/registration/register.php:210
+#: bp-themes/bp-default/registration/register.php:219
 msgid "Complete Sign Up"
 msgstr ""
 
-#: bp-themes/bp-default/registration/register.php:221
+#: bp-themes/bp-default/registration/register.php:230
 msgid "Sign Up Complete!"
 msgstr ""
 
-#: bp-themes/bp-default/registration/register.php:226
+#: 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."
 msgstr ""
 
-#: bp-themes/bp-default/registration/register.php:228
+#: 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."
 msgstr ""
 
-#: bp-themes/bp-default/registration/register.php:235
-msgid "Your Current Avatar"
-msgstr ""
-
-#: bp-themes/bp-default/registration/register.php:236
-msgid "We've fetched an avatar for your new account. If you'd like to change this, why not upload a new one?"
-msgstr ""
-
-#: bp-themes/bp-default/registration/register.php:244
-#: bp-themes/bp-default/members/single/profile/change-avatar.php:17
-#: bp-themes/bp-default/groups/single/admin.php:114
-#: bp-themes/bp-default/groups/create.php:118
-msgid "Upload Image"
-msgstr ""
-
-#: bp-themes/bp-default/registration/register.php:256
-#: bp-themes/bp-default/members/single/profile/change-avatar.php:32
-msgid "Crop Your New Avatar"
-msgstr ""
-
-#: bp-themes/bp-default/registration/register.php:258
-#: bp-themes/bp-default/members/single/profile/change-avatar.php:34
-#: bp-themes/bp-default/groups/single/admin.php:134
-#: bp-themes/bp-default/groups/create.php:131
-msgid "Avatar to crop"
-msgstr ""
-
-#: bp-themes/bp-default/registration/register.php:261
-#: bp-themes/bp-default/members/single/profile/change-avatar.php:37
-#: bp-themes/bp-default/groups/single/admin.php:137
-#: bp-themes/bp-default/groups/create.php:134
-msgid "Avatar preview"
-msgstr ""
-
-#: bp-themes/bp-default/registration/register.php:264
-#: bp-themes/bp-default/members/single/profile/change-avatar.php:40
-#: bp-themes/bp-default/groups/single/admin.php:140
-#: bp-themes/bp-default/groups/create.php:137
-msgid "Crop Image"
+#: bp-themes/bp-default/_inc/ajax.php:160
+#: bp-activity/bp-activity-actions.php:206
+msgid "Please enter some content to post."
 msgstr ""
 
-#: bp-themes/bp-default/_inc/ajax.php:137
+#: bp-themes/bp-default/_inc/ajax.php:177
 msgid "There was a problem posting your update, please try again."
 msgstr ""
 
-#: bp-themes/bp-default/_inc/ajax.php:190
-#: bp-activity/bp-activity-templatetags.php:660
-msgid "%s ago"
+#: bp-themes/bp-default/_inc/ajax.php:202
+#: bp-activity/bp-activity-actions.php:268
+msgid "Please do not leave the comment area blank."
 msgstr ""
 
-#: bp-themes/bp-default/_inc/ajax.php:191
-#: bp-themes/bp-default/activity/entry.php:28
-#: bp-activity/bp-activity-templatetags.php:664
-msgid "Reply"
+#: 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."
 msgstr ""
 
-#: bp-themes/bp-default/_inc/ajax.php:229
-#: bp-themes/bp-default/_inc/ajax.php:262
+#: 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."
 msgstr ""
 
-#: bp-themes/bp-default/_inc/ajax.php:275
-#: bp-themes/bp-default/activity/entry.php:35
+#: 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"
 msgstr ""
 
-#: bp-themes/bp-default/_inc/ajax.php:284
-#: bp-themes/bp-default/activity/entry.php:33
+#: 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"
 msgstr ""
 
-#: bp-themes/bp-default/_inc/ajax.php:315
+#: 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:191
+#: bp-themes/bp-default/groups/create.php:234
 msgid "Remove Invite"
 msgstr ""
 
-#: bp-themes/bp-default/_inc/ajax.php:356
+#: bp-themes/bp-default/_inc/ajax.php:434
 msgid "Request Pending"
 msgstr ""
 
-#: bp-themes/bp-default/_inc/ajax.php:368
+#: bp-themes/bp-default/_inc/ajax.php:446
 msgid "There was a problem accepting that request. Please try again."
 msgstr ""
 
-#: bp-themes/bp-default/_inc/ajax.php:379
+#: bp-themes/bp-default/_inc/ajax.php:457
 msgid "There was a problem rejecting that request. Please try again."
 msgstr ""
 
-#: bp-themes/bp-default/_inc/ajax.php:405
+#: bp-themes/bp-default/_inc/ajax.php:480
 msgid "Error joining group"
 msgstr ""
 
-#: bp-themes/bp-default/_inc/ajax.php:415
+#: bp-themes/bp-default/_inc/ajax.php:490
 msgid "Error requesting membership"
 msgstr ""
 
-#: bp-themes/bp-default/_inc/ajax.php:417
+#: bp-themes/bp-default/_inc/ajax.php:492
 msgid "Membership Requested"
 msgstr ""
 
-#: bp-themes/bp-default/_inc/ajax.php:426
+#: bp-themes/bp-default/_inc/ajax.php:501
 msgid "Error leaving group"
 msgstr ""
 
-#: bp-themes/bp-default/_inc/ajax.php:443
+#: bp-themes/bp-default/_inc/ajax.php:518
 msgid "There was a problem closing the notice."
 msgstr ""
 
-#: bp-themes/bp-default/_inc/ajax.php:485
+#: bp-themes/bp-default/_inc/ajax.php:560
 msgid "There was a problem sending that reply. Please try again."
 msgstr ""
 
-#: bp-themes/bp-default/_inc/ajax.php:495
+#: bp-themes/bp-default/_inc/ajax.php:570
 msgid "There was a problem marking messages as unread."
 msgstr ""
 
-#: bp-themes/bp-default/_inc/ajax.php:511
+#: bp-themes/bp-default/_inc/ajax.php:586
 msgid "There was a problem marking messages as read."
 msgstr ""
 
-#: bp-themes/bp-default/_inc/ajax.php:527
+#: bp-themes/bp-default/_inc/ajax.php:602
 msgid "There was a problem deleting messages."
 msgstr ""
 
-#: bp-themes/bp-default/_inc/options.php:9
-#: bp-themes/bp-default/_inc/options.php:27
-msgid "Theme Options"
+#: 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/_inc/options.php:22
-msgid "Settings saved."
+#: 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/_inc/options.php:34
-msgid "On front page show:"
+#: bp-themes/bp-default/sidebar.php:47
+msgid "Password"
 msgstr ""
 
-#: bp-themes/bp-default/_inc/options.php:36
-msgid "Blog Posts"
+#: bp-themes/bp-default/sidebar.php:50
+msgid "Remember Me"
 msgstr ""
 
-#: bp-themes/bp-default/_inc/options.php:38
-#: bp-themes/bp-default/functions.php:120
-msgid "Activity Stream"
+#: bp-themes/bp-default/sidebar.php:64
+msgid "Forum Topic Tags"
 msgstr ""
 
-#: bp-themes/bp-default/_inc/options.php:46
-msgid "Update Settings"
+#: bp-themes/bp-default/comments.php:3
+msgid "Password Protected"
 msgstr ""
 
-#: bp-themes/bp-default/footer.php:7
-msgid "%s is proudly powered by <a href=\"http://wordpress.org\">WordPress</a> and <a href=\"http://buddypress.org\">BuddyPress</a>"
+#: bp-themes/bp-default/comments.php:4
+msgid "Enter the password to view comments."
 msgstr ""
 
-#: bp-themes/bp-default/sidebar.php:34
-msgid "To start connecting please log in first."
+#: 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."
 msgstr ""
 
-#: bp-themes/bp-default/sidebar.php:36
-msgid " You can also <a href=\"%s\" title=\"Create an account\">create an account</a>."
+#: bp-themes/bp-default/comments.php:50
+msgid "Comments are closed."
 msgstr ""
 
-#: bp-themes/bp-default/sidebar.php:44
-msgid "Password"
+#: 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"
 msgstr ""
 
-#: bp-themes/bp-default/sidebar.php:47
-msgid "Remember Me"
+#: 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/sidebar.php:62
-msgid "Forum Topic Tags"
+#: bp-themes/bp-default/functions.php:81
+msgid "Primary Navigation"
 msgstr ""
 
-#: bp-themes/bp-default/comments.php:3
-msgid "Password Protected"
+#: bp-themes/bp-default/functions.php:149
+msgid "My Favorites"
 msgstr ""
 
-#: bp-themes/bp-default/comments.php:4
-msgid "Enter the password to view comments."
+#: bp-themes/bp-default/functions.php:150
+msgid "Accepted"
 msgstr ""
 
-#: bp-themes/bp-default/comments.php:28
-msgid "One Response to %2$s"
-msgid_plural "%1$s Responses to %2$s"
-msgstr[0] ""
-msgstr[1] ""
+#: bp-themes/bp-default/functions.php:151
+msgid "Rejected"
+msgstr ""
 
-#: bp-themes/bp-default/comments.php:58
-msgid "Comments are closed, but <a href=\"%1$s\" title=\"Trackback URL for this post\">trackbacks</a> and pingbacks are open."
+#: bp-themes/bp-default/functions.php:152
+msgid "Show all comments for this thread"
 msgstr ""
 
-#: bp-themes/bp-default/comments.php:64
-msgid "Comments are closed."
+#: bp-themes/bp-default/functions.php:153
+msgid "Show all"
 msgstr ""
 
-#: bp-themes/bp-default/comments.php:90
-msgid "Leave a Reply"
+#: bp-themes/bp-default/functions.php:154
+msgid "comments"
 msgstr ""
 
-#: bp-themes/bp-default/comments.php:90
-msgid "Leave a Reply to %s"
+#: bp-themes/bp-default/functions.php:377
+msgid "The sidebar widget area"
 msgstr ""
 
-#: bp-themes/bp-default/comments.php:94
-msgid "Click here to cancel reply."
+#: bp-themes/bp-default/functions.php:386
+msgid "First Footer Widget Area"
 msgstr ""
 
-#: bp-themes/bp-default/comments.php:100
-msgid "You must be <a href=\"%1$s\" title=\"Log in\">logged in</a> to post a comment."
+#: bp-themes/bp-default/functions.php:388
+msgid "The first footer widget area"
 msgstr ""
 
-#: bp-themes/bp-default/comments.php:112
-msgid "Logged in as <a href=\"%1$s\" title=\"%2$s\">%2$s</a>."
+#: bp-themes/bp-default/functions.php:397
+msgid "Second Footer Widget Area"
 msgstr ""
 
-#: bp-themes/bp-default/comments.php:112
-msgid "Log out of this account"
+#: bp-themes/bp-default/functions.php:399
+msgid "The second footer widget area"
 msgstr ""
 
-#: bp-themes/bp-default/comments.php:112
-msgid "Log out &rarr;"
+#: bp-themes/bp-default/functions.php:408
+msgid "Third Footer Widget Area"
 msgstr ""
 
-#: bp-themes/bp-default/comments.php:120 bp-themes/bp-default/comments.php:125
-msgid "*"
+#: bp-themes/bp-default/functions.php:410
+msgid "The third footer widget area"
 msgstr ""
 
-#: bp-themes/bp-default/comments.php:125
-msgid "Email"
+#: bp-themes/bp-default/functions.php:419
+msgid "Fourth Footer Widget Area"
 msgstr ""
 
-#: bp-themes/bp-default/comments.php:137
-msgid "Comment"
+#: bp-themes/bp-default/functions.php:421
+msgid "The fourth footer widget area"
 msgstr ""
 
-#: bp-themes/bp-default/comments.php:144
-msgid "Submit"
+#. 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>"
 msgstr ""
 
-#: bp-themes/bp-default/comments.php:169
-msgid "%d Trackback"
+#: bp-themes/bp-default/functions.php:483
+msgid "Your comment is awaiting moderation."
 msgstr ""
 
-#: bp-themes/bp-default/comments.php:171
-msgid "%d Trackbacks"
+#: bp-themes/bp-default/functions.php:495
+msgid "Edit comment"
 msgstr ""
 
-#: bp-themes/bp-default/404.php:10
-msgid "Page Not Found"
+#: 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>."
 msgstr ""
 
-#: bp-themes/bp-default/404.php:14
-msgid "The page you were looking for was not found."
+#: bp-themes/bp-default/functions.php:636
+msgid "Email"
 msgstr ""
 
-#: bp-themes/bp-default/functions.php:26
-msgid "My Favorites"
+#: bp-themes/bp-default/functions.php:646
+msgid "You must be <a href=\"%1$s\">logged in</a> to post a comment."
 msgstr ""
 
-#: bp-themes/bp-default/functions.php:27
-msgid "Accepted"
+#: bp-themes/bp-default/functions.php:647
+msgid "Leave a reply"
+msgstr ""
+
+#: bp-themes/bp-default/functions.php:731
+msgid "&larr; Previous Entries"
+msgstr ""
+
+#: bp-themes/bp-default/functions.php:732
+msgid "Next Entries &rarr;"
+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>"
 msgstr ""
 
-#: bp-themes/bp-default/functions.php:28
-msgid "Rejected"
+#: bp-themes/bp-default/page.php:21 bp-themes/bp-default/onecolumn-page.php:32
+msgid "Edit this page."
 msgstr ""
 
-#: bp-themes/bp-default/functions.php:29
-msgid "Show all comments for this thread"
+#: bp-themes/bp-default/header.php:27
+msgctxt "Home page banner link title"
+msgid "Home"
 msgstr ""
 
-#: bp-themes/bp-default/functions.php:30
-msgid "Show all"
+#: bp-themes/bp-default/header.php:30
+msgid "Search for:"
 msgstr ""
 
-#: bp-themes/bp-default/functions.php:31
-msgid "comments"
+#: bp-themes/bp-default/members/index.php:23
+msgid "Members Directory"
 msgstr ""
 
-#: bp-themes/bp-default/functions.php:33
-msgid "%s is a unique identifier for %s that you can type into any message on this site. %s will be sent a notification and a link to your message any time you use it."
+#: bp-themes/bp-default/members/index.php:35
+#: bp-themes/bp-default/activity/index.php:41
+msgid "All Members <span>%s</span>"
 msgstr ""
 
-#: bp-themes/bp-default/functions.php:79
-msgid "said:"
+#: bp-themes/bp-default/members/index.php:39
+#: bp-themes/bp-default/activity/index.php:51
+msgid "My Friends <span>%s</span>"
 msgstr ""
 
-#: bp-themes/bp-default/functions.php:80
-msgid "On"
+#: 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"
 msgstr ""
 
-#: bp-themes/bp-default/functions.php:84
-msgid "Your comment is awaiting moderation."
+#: bp-themes/bp-default/members/index.php:58
+#: bp-themes/bp-default/members/single/friends.php:23
+msgid "Newest Registered"
 msgstr ""
 
-#: bp-themes/bp-default/functions.php:329
-msgid "Theme activated! This theme contains <a href=\"%s\">custom header image</a> support and <a href=\"%s\">sidebar widgets</a>."
+#: 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"
 msgstr ""
 
-#: bp-themes/bp-default/page.php:18
-msgid "<p class=\"serif\">Read the rest of this page &rarr;</p>"
+#: bp-themes/bp-default/members/members-loop.php:108
+msgid "Sorry, no members were found."
 msgstr ""
 
-#: bp-themes/bp-default/page.php:20 bp-themes/bp-default/attachment.php:27
-#: bp-themes/bp-default/single.php:34
-msgid "<p><strong>Pages:</strong> "
+#: bp-themes/bp-default/members/single/settings/notifications.php:50
+msgid "Email Notification"
 msgstr ""
 
-#: bp-themes/bp-default/page.php:21
-msgid "Edit this entry."
+#: bp-themes/bp-default/members/single/settings/notifications.php:55
+msgid "Send a notification by email when:"
 msgstr ""
 
-#: bp-themes/bp-default/header.php:18
-msgid "Site Wide Activity RSS Feed"
+#: 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."
 msgstr ""
 
-#: bp-themes/bp-default/header.php:22
-msgid "Activity RSS Feed"
+#: bp-themes/bp-default/members/single/settings/delete-account.php:58
+msgid "I understand the consequences of deleting my account."
 msgstr ""
 
-#: bp-themes/bp-default/header.php:26
-msgid "Group Activity RSS Feed"
+#: bp-themes/bp-default/members/single/settings/delete-account.php:63
+msgid "Delete My Account"
 msgstr ""
 
-#: bp-themes/bp-default/header.php:29
-msgid "Blog Posts RSS Feed"
+#: bp-themes/bp-default/members/single/settings/general.php:50
+msgid "General Settings"
 msgstr ""
 
-#: bp-themes/bp-default/header.php:30
-msgid "Blog Posts Atom Feed"
+#: 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/index.php:8
-msgid "Members Directory"
+#: bp-themes/bp-default/members/single/settings/general.php:57
+msgid "Password Lost and Found"
 msgstr ""
 
-#: bp-themes/bp-default/members/index.php:18
-#: bp-themes/bp-default/activity/index.php:22
-msgid "All Members (%s)"
+#: bp-themes/bp-default/members/single/settings/general.php:57
+msgid "Lost your password?"
 msgstr ""
 
-#: bp-themes/bp-default/members/index.php:21
-#: bp-themes/bp-default/activity/index.php:30
-msgid "My Friends (%s)"
+#: bp-themes/bp-default/members/single/settings/general.php:59
+msgid "Account Email"
 msgstr ""
 
-#: bp-themes/bp-default/members/index.php:30
-#: bp-themes/bp-default/members/single/friends.php:11
-#: bp-themes/bp-default/members/single/groups.php:12
-#: bp-themes/bp-default/members/single/blogs.php:8
-#: bp-themes/bp-default/blogs/index.php:30
-#: bp-themes/bp-default/forums/index.php:93
-#: bp-themes/bp-default/groups/index.php:29
-msgid "Last Active"
+#: 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/index.php:31
-#: bp-themes/bp-default/members/single/friends.php:12
-msgid "Newest Registered"
+#: bp-themes/bp-default/members/single/settings/general.php:63
+msgid "New Password"
 msgstr ""
 
-#: bp-themes/bp-default/members/index.php:34
-#: bp-themes/bp-default/members/single/friends.php:13
-#: bp-themes/bp-default/members/single/groups.php:15
-#: bp-themes/bp-default/members/single/blogs.php:10
-#: bp-themes/bp-default/blogs/index.php:32
-#: bp-themes/bp-default/groups/index.php:32
-msgid "Alphabetical"
+#: bp-themes/bp-default/members/single/settings/general.php:64
+msgid "Repeat New Password"
 msgstr ""
 
-#: bp-themes/bp-default/members/members-loop.php:87
-msgid "Sorry, no members were found."
+#: bp-themes/bp-default/members/single/profile/profile-wp.php:8
+msgid "%s's Profile"
 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:13
+#: 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:22
-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/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"
 msgstr ""
 
 #: bp-themes/bp-default/members/single/profile/change-avatar.php:23
-#: bp-themes/bp-default/groups/single/admin.php:122
+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
+#: bp-themes/bp-default/groups/single/admin.php:139
 msgid "Delete Avatar"
 msgstr ""
 
-#: bp-themes/bp-default/members/single/profile/change-avatar.php:23
+#: 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:56
+#: 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:33
+#: bp-themes/bp-default/groups/single/admin.php:151
+#: bp-themes/bp-default/groups/create.php:171
+msgid "Avatar to crop"
+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"
+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"
+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:9
+#: bp-themes/bp-default/members/single/profile/edit.php:10
 msgid "Editing '%s' Profile Group"
 msgstr ""
 
-#: bp-themes/bp-default/members/single/groups.php:13
-#: bp-themes/bp-default/groups/index.php:30
+#: bp-themes/bp-default/members/single/groups.php:23
+#: bp-themes/bp-default/groups/index.php:60
 msgid "Most Members"
 msgstr ""
 
-#: bp-themes/bp-default/members/single/groups.php:14
-#: bp-themes/bp-default/groups/index.php:31
+#: bp-themes/bp-default/members/single/groups.php:24
+#: bp-themes/bp-default/groups/index.php:61
 msgid "Newly Created"
 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"
+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 ""
+
 #: bp-themes/bp-default/members/single/messages/compose.php:5
 msgid "Send To (Username or Friend's Name)"
 msgstr ""
@@ -3279,6 +4061,7 @@ 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"
 msgstr ""
 
@@ -3302,361 +4085,353 @@ msgstr ""
 msgid "Sorry, no messages were found."
 msgstr ""
 
-#: bp-themes/bp-default/members/single/messages/single.php:11
-msgid "Sent between %s and %s"
+#: 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:63
+#: bp-themes/bp-default/members/single/messages/single.php:75
 msgid "Send a Reply"
 msgstr ""
 
-#: bp-themes/bp-default/members/single/messages/single.php:79
+#: bp-themes/bp-default/members/single/messages/single.php:91
 msgid "Send Reply"
 msgstr ""
 
-#: bp-themes/bp-default/members/single/groups/invites.php:20
-#: bp-themes/bp-default/members/single/friends/requests.php:21
-#: bp-themes/bp-default/groups/single/admin.php:263
+#: 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"
 msgstr ""
 
-#: bp-themes/bp-default/members/single/groups/invites.php:21
-#: bp-themes/bp-default/members/single/friends/requests.php:22
-#: bp-themes/bp-default/groups/single/admin.php:265
+#: 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"
 msgstr ""
 
-#: bp-themes/bp-default/members/single/groups/invites.php:34
+#: bp-themes/bp-default/members/single/groups/invites.php:37
 msgid "You have no outstanding group invites."
 msgstr ""
 
-#: bp-themes/bp-default/members/single/friends/requests.php:36
+#: bp-themes/bp-default/members/single/friends/requests.php:68
 msgid "You have no pending friendship requests."
 msgstr ""
 
-#: bp-themes/bp-default/members/single/activity.php:7
-#: bp-themes/bp-default/activity/index.php:66
-#: bp-themes/bp-default/groups/single/activity.php:9
-msgid "No Filter"
+#: bp-themes/bp-default/members/single/activity.php:18
+#: bp-themes/bp-default/activity/index.php:94
+#: bp-themes/bp-default/groups/single/activity.php:8
+msgid "Show:"
 msgstr ""
 
-#: bp-themes/bp-default/members/single/activity.php:8
-#: bp-themes/bp-default/activity/index.php:67
+#: bp-themes/bp-default/members/single/activity.php:20
+#: bp-themes/bp-default/activity/index.php:96
 #: bp-themes/bp-default/groups/single/activity.php:10
-msgid "Show Updates"
-msgstr ""
-
-#: bp-themes/bp-default/members/single/activity.php:12
-#: bp-themes/bp-default/activity/index.php:70
-msgid "Show Blog Posts"
-msgstr ""
-
-#: bp-themes/bp-default/members/single/activity.php:13
-#: bp-themes/bp-default/activity/index.php:71
-msgid "Show Blog Comments"
+msgid "Everything"
 msgstr ""
 
-#: bp-themes/bp-default/members/single/activity.php:17
-#: bp-themes/bp-default/activity/index.php:85
-msgid "Show Friendship Connections"
+#: bp-themes/bp-default/members/single/activity.php:21
+#: bp-themes/bp-default/activity/index.php:97
+#: bp-themes/bp-default/groups/single/activity.php:11
+msgid "Updates"
 msgstr ""
 
-#: bp-themes/bp-default/members/single/activity.php:22
-#: bp-themes/bp-default/activity/index.php:75
-#: bp-themes/bp-default/groups/single/activity.php:13
-msgid "Show New Forum Topics"
+#: 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:23
-#: bp-themes/bp-default/activity/index.php:76
+#: bp-themes/bp-default/members/single/activity.php:43
+#: bp-themes/bp-default/activity/index.php:108
 #: bp-themes/bp-default/groups/single/activity.php:14
-msgid "Show Forum Replies"
+msgid "Forum Topics"
 msgstr ""
 
-#: bp-themes/bp-default/members/single/activity.php:27
-#: bp-themes/bp-default/activity/index.php:80
-msgid "Show New Groups"
+#: bp-themes/bp-default/members/single/activity.php:44
+#: bp-themes/bp-default/activity/index.php:109
+#: bp-themes/bp-default/groups/single/activity.php:15
+msgid "Forum Replies"
 msgstr ""
 
-#: bp-themes/bp-default/members/single/activity.php:28
-#: bp-themes/bp-default/activity/index.php:81
-#: bp-themes/bp-default/groups/single/activity.php:17
-msgid "Show New Group Memberships"
+#: 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/activity/index.php:7
-msgid "Site Activity"
+#: bp-themes/bp-default/members/single/activity.php:51
+#: bp-themes/bp-default/activity/index.php:116
+#: bp-themes/bp-default/groups/single/activity.php:18
+msgid "Group Memberships"
 msgstr ""
 
-#: bp-themes/bp-default/activity/index.php:22
+#: 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:30
+#: bp-themes/bp-default/activity/index.php:51
 msgid "The activity of my friends only."
 msgstr ""
 
-#: bp-themes/bp-default/activity/index.php:38
+#: 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:38
-#: bp-themes/bp-default/groups/index.php:20
-msgid "My Groups (%s)"
+#: bp-themes/bp-default/activity/index.php:63
+#: bp-themes/bp-default/groups/index.php:41
+msgid "My Groups <span>%s</span>"
 msgstr ""
 
-#: bp-themes/bp-default/activity/index.php:45
+#: bp-themes/bp-default/activity/index.php:73
 msgid "The activity I've marked as a favorite."
 msgstr ""
 
-#: bp-themes/bp-default/activity/index.php:45
-msgid "My Favorites (<span>%s</span>)"
+#: bp-themes/bp-default/activity/index.php:73
+msgid "My Favorites <span>%s</span>"
 msgstr ""
 
-#: bp-themes/bp-default/activity/index.php:50
+#: bp-themes/bp-default/activity/index.php:79
 msgid "Activity that I have been mentioned in."
 msgstr ""
 
-#: bp-themes/bp-default/activity/index.php:50
-msgid "(%s new)"
+#: 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"
+msgstr ""
+
+#: bp-themes/bp-default/activity/index.php:79
+msgid "<span>%s new</span>"
 msgstr ""
 
-#: bp-themes/bp-default/activity/index.php:60
+#: bp-themes/bp-default/activity/index.php:89
 #: bp-themes/bp-default/groups/single/activity.php:3
 msgid "RSS Feed"
 msgstr ""
 
-#: bp-themes/bp-default/activity/index.php:60
+#: bp-themes/bp-default/activity/index.php:89
 #: bp-themes/bp-default/groups/single/activity.php:3
 msgid "RSS"
 msgstr ""
 
-#: bp-themes/bp-default/activity/index.php:88
-msgid "Show New Members"
+#: bp-themes/bp-default/activity/index.php:126
+msgid "New Members"
+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>"
 msgstr ""
 
-#: bp-themes/bp-default/activity/post-form.php:7
-msgid "You are mentioning %s in a new update, this user will be sent a notification of your message."
+#: bp-themes/bp-default/activity/comment.php:37
+#: bp-themes/bp-default/groups/single/forum/edit.php:10
+msgid "Reply"
 msgstr ""
 
-#: bp-themes/bp-default/activity/post-form.php:19
+#: bp-themes/bp-default/activity/post-form.php:23
 msgid "What's new in %s, %s?"
 msgstr ""
 
-#: bp-themes/bp-default/activity/post-form.php:21
-msgid "What's new %s?"
+#: bp-themes/bp-default/activity/post-form.php:25
+msgid "What's new, %s?"
 msgstr ""
 
-#: bp-themes/bp-default/activity/post-form.php:33
+#: bp-themes/bp-default/activity/post-form.php:35
 msgid "Post Update"
 msgstr ""
 
-#: bp-themes/bp-default/activity/post-form.php:38
+#: bp-themes/bp-default/activity/post-form.php:42
 msgid "Post in"
 msgstr ""
 
-#: bp-themes/bp-default/activity/entry.php:33
-msgid "Mark as Favorite"
+#: bp-themes/bp-default/activity/entry.php:37
+msgid "In reply to: "
 msgstr ""
 
-#: bp-themes/bp-default/activity/entry.php:45
-#: bp-activity/feeds/bp-activity-friends-feed.php:48
-#: bp-activity/feeds/bp-activity-mentions-feed.php:47
-#: bp-activity/feeds/bp-activity-personal-feed.php:47
-#: bp-activity/feeds/bp-activity-favorites-feed.php:52
-msgid "In reply to"
+#: bp-themes/bp-default/activity/entry.php:37
+msgid "View Thread / Permalink"
 msgstr ""
 
-#: bp-themes/bp-default/activity/entry.php:46
-#: bp-activity/bp-activity-templatetags.php:580
-msgid "View Thread / Permalink"
+#: bp-themes/bp-default/activity/entry.php:60
+msgid "Comment <span>%s</span>"
+msgstr ""
+
+#: bp-themes/bp-default/activity/entry.php:68
+msgid "Mark as Favorite"
 msgstr ""
 
-#: bp-themes/bp-default/activity/entry.php:63
+#: bp-themes/bp-default/activity/entry.php:104
 msgid "Post"
 msgstr ""
 
-#: bp-themes/bp-default/activity/entry.php:63
+#: bp-themes/bp-default/activity/entry.php:104
 msgid "or press esc to cancel."
 msgstr ""
 
-#: bp-themes/bp-default/activity/activity-loop.php:27
+#: bp-themes/bp-default/activity/activity-loop.php:41
 msgid "Load More"
 msgstr ""
 
-#: bp-themes/bp-default/activity/activity-loop.php:37
+#: 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/blogs/index.php:8
-#: bp-themes/bp-default/blogs/create.php:10
-msgid "Blogs Directory"
+#: bp-themes/bp-default/blogs/index.php:35
+msgid "All Sites <span>%s</span>"
 msgstr ""
 
-#: bp-themes/bp-default/blogs/index.php:18
-msgid "All Blogs (%s)"
+#: bp-themes/bp-default/blogs/index.php:39
+msgid "My Sites <span>%s</span>"
 msgstr ""
 
-#: bp-themes/bp-default/blogs/index.php:21
-msgid "My Blogs (%s)"
+#: bp-themes/bp-default/blogs/blogs-loop.php:90
+msgid "Sorry, there were no sites found."
 msgstr ""
 
-#: bp-themes/bp-default/blogs/blogs-loop.php:71
-msgid "Sorry, there were no blogs found."
+#: bp-themes/bp-default/blogs/create.php:32
+msgid "Site registration is currently disabled"
 msgstr ""
 
-#: bp-themes/bp-default/blogs/create.php:21
-msgid "Blog registration is currently disabled"
+#: bp-themes/bp-default/forums/index.php:23
+msgid "Forums Directory"
 msgstr ""
 
-#: bp-themes/bp-default/forums/index.php:8
-msgid "Group Forums Directory"
+#: bp-themes/bp-default/forums/index.php:40
+msgid "All Topics <span>%s</span>"
 msgstr ""
 
-#: bp-themes/bp-default/forums/index.php:27
-#: bp-themes/bp-default/groups/single/forum.php:33
-msgid "Post a New Topic:"
+#: bp-themes/bp-default/forums/index.php:44
+msgid "My Topics <span>%s</span>"
 msgstr ""
 
-#: bp-themes/bp-default/forums/index.php:29
-#: bp-themes/bp-default/groups/single/forum/edit.php:26
-#: bp-themes/bp-default/groups/single/forum.php:35
-msgid "Title:"
+#: bp-themes/bp-default/forums/index.php:100
+msgid "Create New Topic:"
 msgstr ""
 
-#: bp-themes/bp-default/forums/index.php:32
-#: bp-themes/bp-default/groups/single/forum/edit.php:29
-#: bp-themes/bp-default/groups/single/forum.php:38
+#: 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/forums/index.php:35
-#: bp-themes/bp-default/groups/single/forum.php:41
+#: 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):"
 msgstr ""
 
-#: bp-themes/bp-default/forums/index.php:38
+#: bp-themes/bp-default/forums/index.php:113
 msgid "Post In Group Forum:"
 msgstr ""
 
-#: bp-themes/bp-default/forums/index.php:58
-#: bp-themes/bp-default/groups/single/forum.php:47
+#: 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/forums/index.php:69
+#: 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/forums/index.php:81
-msgid "All Topics (%s)"
-msgstr ""
-
-#: bp-themes/bp-default/forums/index.php:84
-msgid "My Topics (%s)"
-msgstr ""
-
-#: bp-themes/bp-default/forums/index.php:94
-msgid "Most Posts"
-msgstr ""
-
-#: bp-themes/bp-default/forums/index.php:95
-msgid "Unreplied"
+#: bp-themes/bp-default/forums/forums-loop.php:39
+msgid "Topic"
 msgstr ""
 
-#: bp-themes/bp-default/forums/forums-loop.php:24
-msgid "Topic Title"
+#: bp-themes/bp-default/forums/forums-loop.php:41
+msgid "Freshness"
 msgstr ""
 
-#: bp-themes/bp-default/forums/forums-loop.php:25
-msgid "Latest Poster"
+#: bp-themes/bp-default/forums/forums-loop.php:54
+msgid "Permalink"
 msgstr ""
 
-#: bp-themes/bp-default/forums/forums-loop.php:28
-msgid "Posted In Group"
-msgstr ""
+#. translators: "started by [poster] in [forum]"
 
-#: bp-themes/bp-default/forums/forums-loop.php:31
-msgid "Posts"
+#: bp-themes/bp-default/forums/forums-loop.php:61
+msgid "Started by %1$s"
 msgstr ""
 
-#: bp-themes/bp-default/forums/forums-loop.php:32
-msgid "Freshness"
-msgstr ""
+#. translators: "started by [poster] in [forum]"
 
-#: bp-themes/bp-default/forums/forums-loop.php:45
-msgid "Permalink"
+#: bp-themes/bp-default/forums/forums-loop.php:72
+msgid "in %1$s"
 msgstr ""
 
-#: bp-themes/bp-default/forums/forums-loop.php:95
+#: bp-themes/bp-default/forums/forums-loop.php:122
 msgid "Sorry, there were no forum topics found."
 msgstr ""
 
-#: bp-themes/bp-default/groups/index.php:7
-#: bp-themes/bp-default/groups/create.php:7
+#: bp-themes/bp-default/groups/index.php:23
+#: bp-themes/bp-default/groups/create.php:18
 msgid "Groups Directory"
 msgstr ""
 
-#: bp-themes/bp-default/groups/index.php:17
-msgid "All Groups (%s)"
+#: bp-themes/bp-default/groups/index.php:37
+msgid "All Groups <span>%s</span>"
 msgstr ""
 
-#: bp-themes/bp-default/groups/groups-loop.php:74
+#: bp-themes/bp-default/groups/groups-loop.php:95
 msgid "There were no groups found."
 msgstr ""
 
-#: bp-themes/bp-default/groups/single/members.php:51
-#: bp-themes/bp-default/groups/single/admin.php:233
+#: bp-themes/bp-default/groups/single/members.php:87
+#: bp-themes/bp-default/groups/single/admin.php:288
 msgid "This group has no members."
 msgstr ""
 
-#: bp-themes/bp-default/groups/single/forum/edit.php:9
-#: bp-themes/bp-default/groups/single/forum/topic.php:21
-msgid "Group Forum"
+#: 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"
 msgstr ""
 
-#: bp-themes/bp-default/groups/single/forum/edit.php:9
-#: bp-themes/bp-default/groups/single/forum/topic.php:21
-msgid "Group Forum Directory"
+#: bp-themes/bp-default/groups/single/forum/edit.php:25
+msgid "Edit:"
 msgstr ""
 
-#: bp-themes/bp-default/groups/single/forum/edit.php:24
-msgid "Edit Topic:"
+#: bp-themes/bp-default/groups/single/forum/edit.php:91
+msgid "This topic does not exist."
 msgstr ""
 
-#: bp-themes/bp-default/groups/single/forum/edit.php:46
-msgid "Edit Post:"
+#: bp-themes/bp-default/groups/single/forum/topic.php:12
+msgid "New Reply"
 msgstr ""
 
-#: bp-themes/bp-default/groups/single/forum/edit.php:67
-msgid "This topic does not exist."
+#: bp-themes/bp-default/groups/single/forum/topic.php:35
+msgid "Topic tags:"
 msgstr ""
 
-#: bp-themes/bp-default/groups/single/forum/topic.php:42
-msgid "%s said %s ago:"
+#: 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:56
+#: 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:87
+#: bp-themes/bp-default/groups/single/forum/topic.php:126
 msgid "You will auto join this group when you reply to this topic."
 msgstr ""
 
-#: bp-themes/bp-default/groups/single/forum/topic.php:92
+#: bp-themes/bp-default/groups/single/forum/topic.php:131
 msgid "Add a reply:"
 msgstr ""
 
-#: bp-themes/bp-default/groups/single/forum/topic.php:97
+#: bp-themes/bp-default/groups/single/forum/topic.php:136
 msgid "Post Reply"
 msgstr ""
 
-#: bp-themes/bp-default/groups/single/forum/topic.php:108
+#: bp-themes/bp-default/groups/single/forum/topic.php:147
 msgid "This topic is closed, replies are no longer accepted."
 msgstr ""
 
-#: bp-themes/bp-default/groups/single/forum/topic.php:121
+#: bp-themes/bp-default/groups/single/forum/topic.php:161
 msgid "There are no posts for this topic."
 msgstr ""
 
@@ -3673,222 +4448,248 @@ msgid "Send Request"
 msgstr ""
 
 #: bp-themes/bp-default/groups/single/send-invites.php:22
-#: bp-themes/bp-default/groups/create.php:175
+#: bp-themes/bp-default/groups/create.php:216
 msgid "Select people to invite from your friends list."
 msgstr ""
 
 #: bp-themes/bp-default/groups/single/send-invites.php:73
-#: bp-themes/bp-default/groups/create.php:206
+#: 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."
 msgstr ""
 
-#: bp-themes/bp-default/groups/single/forum.php:29
+#: 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/group-header.php:6
+#: 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:14
+#: bp-themes/bp-default/groups/single/group-header.php:20
 msgid "Group Mods"
 msgstr ""
 
 #: bp-themes/bp-default/groups/single/admin.php:16
-msgid "Group Name"
+#: bp-themes/bp-default/groups/create.php:39
+msgid "Group Name (required)"
 msgstr ""
 
 #: bp-themes/bp-default/groups/single/admin.php:19
-msgid "Group Description"
+#: bp-themes/bp-default/groups/create.php:42
+msgid "Group Description (required)"
 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:45
-#: bp-themes/bp-default/groups/create.php:45
-msgid "Enable comment wire"
-msgstr ""
-
-#: bp-themes/bp-default/groups/single/admin.php:55
-#: bp-themes/bp-default/groups/create.php:52
+#: bp-themes/bp-default/groups/single/admin.php:47
+#: bp-themes/bp-default/groups/create.php:62
 msgid "Enable discussion forum"
 msgstr ""
 
-#: bp-themes/bp-default/groups/single/admin.php:64
-#: bp-themes/bp-default/groups/create.php:65
+#: 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/single/admin.php:69
-#: bp-themes/bp-default/groups/create.php:69
+#: 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/single/admin.php:71
-#: bp-themes/bp-default/groups/create.php:71
+#: 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/single/admin.php:72
-#: bp-themes/bp-default/groups/single/admin.php:82
-#: bp-themes/bp-default/groups/create.php:72
-#: bp-themes/bp-default/groups/create.php:81
+#: 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/single/admin.php:73
-#: bp-themes/bp-default/groups/create.php:73
+#: 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/single/admin.php:79
-#: bp-themes/bp-default/groups/create.php:78
+#: 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/single/admin.php:81
-#: bp-themes/bp-default/groups/create.php:80
+#: 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/single/admin.php:83
-#: bp-themes/bp-default/groups/single/admin.php:93
-#: bp-themes/bp-default/groups/create.php:82
-#: bp-themes/bp-default/groups/create.php:91
+#: 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:89
-#: bp-themes/bp-default/groups/create.php:87
+#: bp-themes/bp-default/groups/single/admin.php:81
+#: bp-themes/bp-default/groups/create.php:100
 msgid "This is a hidden group"
 msgstr ""
 
-#: bp-themes/bp-default/groups/single/admin.php:91
-#: bp-themes/bp-default/groups/create.php:89
+#: 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."
 msgstr ""
 
-#: bp-themes/bp-default/groups/single/admin.php:92
-#: bp-themes/bp-default/groups/create.php:90
+#: 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."
 msgstr ""
 
-#: bp-themes/bp-default/groups/single/admin.php:110
-#: bp-themes/bp-default/groups/create.php:114
+#: bp-themes/bp-default/groups/single/admin.php:92
+#: bp-themes/bp-default/groups/create.php:111
+msgid "Group Invitations"
+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?"
+msgstr ""
+
+#: bp-themes/bp-default/groups/single/admin.php:99
+#: bp-themes/bp-default/groups/create.php:118
+msgid "All group members"
+msgstr ""
+
+#: bp-themes/bp-default/groups/single/admin.php:104
+#: bp-themes/bp-default/groups/create.php:123
+msgid "Group admins and mods only"
+msgstr ""
+
+#: bp-themes/bp-default/groups/single/admin.php:109
+#: bp-themes/bp-default/groups/create.php:128
+msgid "Group admins only"
+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."
 msgstr ""
 
-#: bp-themes/bp-default/groups/single/admin.php:120
+#: 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:132
+#: bp-themes/bp-default/groups/single/admin.php:149
 msgid "Crop Avatar"
 msgstr ""
 
-#: bp-themes/bp-default/groups/single/admin.php:160
+#: bp-themes/bp-default/groups/single/admin.php:177
 msgid "Administrators"
 msgstr ""
 
-#: bp-themes/bp-default/groups/single/admin.php:167
+#: bp-themes/bp-default/groups/single/admin.php:203
 msgid "Moderators"
 msgstr ""
 
-#: bp-themes/bp-default/groups/single/admin.php:203
+#: bp-themes/bp-default/groups/single/admin.php:258
 msgid "(banned)"
 msgstr ""
 
-#: bp-themes/bp-default/groups/single/admin.php:209
+#: bp-themes/bp-default/groups/single/admin.php:264
 msgid "Unban this member"
 msgstr ""
 
-#: bp-themes/bp-default/groups/single/admin.php:209
+#: bp-themes/bp-default/groups/single/admin.php:264
 msgid "Remove Ban"
 msgstr ""
 
-#: bp-themes/bp-default/groups/single/admin.php:213
+#: bp-themes/bp-default/groups/single/admin.php:268
 msgid "Kick and ban this member"
 msgstr ""
 
-#: bp-themes/bp-default/groups/single/admin.php:213
+#: bp-themes/bp-default/groups/single/admin.php:268
 msgid "Kick &amp; Ban"
 msgstr ""
 
-#: bp-themes/bp-default/groups/single/admin.php:214
+#: bp-themes/bp-default/groups/single/admin.php:269
 msgid "Promote to Mod"
 msgstr ""
 
-#: bp-themes/bp-default/groups/single/admin.php:219
+#: bp-themes/bp-default/groups/single/admin.php:274
 msgid "Remove this member"
 msgstr ""
 
-#: bp-themes/bp-default/groups/single/admin.php:219
+#: bp-themes/bp-default/groups/single/admin.php:274
 msgid "Remove from group"
 msgstr ""
 
-#: bp-themes/bp-default/groups/single/admin.php:278
+#: bp-themes/bp-default/groups/single/admin.php:333
 msgid "There are no pending membership requests."
 msgstr ""
 
-#: bp-themes/bp-default/groups/single/admin.php:295
+#: 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."
 msgstr ""
 
-#: bp-themes/bp-default/groups/single/admin.php:298
+#: bp-themes/bp-default/groups/single/admin.php:353
 msgid "I understand the consequences of deleting this group."
 msgstr ""
 
-#: bp-themes/bp-default/groups/create.php:26
-msgid "* Group Name"
-msgstr ""
-
-#: bp-themes/bp-default/groups/create.php:29
-msgid "* Group Description"
-msgstr ""
-
-#: bp-themes/bp-default/groups/create.php:57
+#: 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."
 msgstr ""
 
-#: bp-themes/bp-default/groups/create.php:122
+#: bp-themes/bp-default/groups/create.php:162
 msgid "To skip the avatar upload process, hit the \"Next Step\" button."
 msgstr ""
 
-#: bp-themes/bp-default/groups/create.php:129
+#: bp-themes/bp-default/groups/create.php:169
 msgid "Crop Group Avatar"
 msgstr ""
 
-#: bp-themes/bp-default/groups/create.php:224
-msgid "Previous Step"
+#: bp-themes/bp-default/groups/create.php:273
+msgid "Back to Previous Step"
 msgstr ""
 
-#: bp-themes/bp-default/groups/create.php:229
+#: bp-themes/bp-default/groups/create.php:280
 msgid "Next Step"
 msgstr ""
 
-#: bp-themes/bp-default/groups/create.php:234
+#: bp-themes/bp-default/groups/create.php:287
 msgid "Create Group and Continue"
 msgstr ""
 
-#: bp-themes/bp-default/groups/create.php:239
-msgid "Finish"
+#: bp-themes/bp-default/attachment.php:26 bp-themes/bp-default/single.php:24
+msgid "Edit this entry"
 msgstr ""
 
-#: bp-themes/bp-default/attachment.php:25
-msgid "<p class=\"serif\">Read the rest of this entry &rarr;</p>"
+#: bp-themes/bp-default/attachment.php:40
+msgid "Full size is %s pixels"
 msgstr ""
 
-#: bp-themes/bp-default/attachment.php:38
+#: bp-themes/bp-default/attachment.php:43
+msgid "Link to full size image"
+msgstr ""
+
+#: bp-themes/bp-default/attachment.php:62
 msgid "Sorry, no attachments matched your criteria."
 msgstr ""
 
+#: bp-themes/bp-default/search.php:10
+msgid "Site"
+msgstr ""
+
 #: bp-themes/bp-default/search.php:14
 msgid "Search Results"
 msgstr ""
 
-#: bp-themes/bp-default/search.php:57
+#: bp-themes/bp-default/search.php:51
 msgid "No posts found. Try a different search?"
 msgstr ""
 
@@ -3900,144 +4701,283 @@ msgstr ""
 msgid "Links"
 msgstr ""
 
-#: bp-themes/bp-default/single.php:29
-msgid "Edit this entry"
+#: bp-themes/bp-default/single.php:35
+msgctxt "Previous post link"
+msgid "&larr;"
+msgstr ""
+
+#: bp-themes/bp-default/single.php:36
+msgctxt "Next post link"
+msgid "&rarr;"
 msgstr ""
 
-#: bp-themes/bp-default/single.php:46
+#: bp-themes/bp-default/single.php:45
 msgid "Sorry, no posts matched your criteria."
 msgstr ""
 
-#: bp-activity/bp-activity-notifications.php:32
+#: bp-activity/bp-activity-template.php:173
+msgctxt "Activity pagination previous text"
+msgid "&larr;"
+msgstr ""
+
+#: bp-activity/bp-activity-template.php:174
+msgctxt "Activity pagination next text"
+msgid "&rarr;"
+msgstr ""
+
+#: bp-activity/bp-activity-template.php:453
+msgid "Viewing item %1$s to %2$s (of %3$s items)"
+msgstr ""
+
+#: bp-activity/bp-activity-template.php:1191
+msgid "View Discussion"
+msgstr ""
+
+#: bp-activity/bp-activity-template.php:2142
+msgid "xprofile"
+msgstr ""
+
+#: bp-activity/bp-activity-template.php:2142
+msgid "friends"
+msgstr ""
+
+#: bp-activity/bp-activity-template.php:2142
+msgid "status"
+msgstr ""
+
+#: bp-activity/bp-activity-template.php:2142
+msgid "sites"
+msgstr ""
+
+#: bp-activity/bp-activity-template.php:2150
+msgid "Clear Filter"
+msgstr ""
+
+#: bp-activity/bp-activity-template.php:2340
+msgid "a user"
+msgstr ""
+
+#: bp-activity/bp-activity-template.php:2380
+msgid "Send a public message on your activity stream."
+msgstr ""
+
+#: bp-activity/bp-activity-template.php:2381
+msgid "Public Message"
+msgstr ""
+
+#: bp-activity/bp-activity-template.php:2690
+msgid "Site Wide Activity RSS Feed"
+msgstr ""
+
+#: bp-activity/bp-activity-loader.php:89
+msgid "Search Activity..."
+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"
+msgstr ""
+
+#: bp-activity/bp-activity-loader.php:138
+#: bp-activity/bp-activity-loader.php:251
+msgid "Personal"
+msgstr ""
+
+#: bp-activity/bp-activity-loader.php:159
+#: bp-activity/bp-activity-loader.php:259
+msgid "Favorites"
+msgstr ""
+
+#: bp-activity/bp-activity-loader.php:226
+msgid "Mentions <span class=\"count\">%s</span>"
+msgstr ""
+
+#: bp-activity/bp-activity-loader.php:303
+msgid "My Activity"
+msgstr ""
+
+#: bp-activity/bp-activity-notifications.php:66
 msgid "%s mentioned you in an update"
 msgstr ""
 
-#: bp-activity/bp-activity-notifications.php:34
+#: bp-activity/bp-activity-notifications.php:79
 msgid ""
-"%s mentioned you in an update:\n"
+"%1$s mentioned you in an update:\n"
 "\n"
-"\"%s\"\n"
+"\"%2$s\"\n"
 "\n"
-"To view and respond to the message, log in and visit: %s\n"
+"To view and respond to the message, log in and visit: %3$s\n"
 "\n"
 "---------------------\n"
 msgstr ""
 
-#: bp-activity/bp-activity-notifications.php:76
+#: bp-activity/bp-activity-notifications.php:152
 msgid "%s replied to one of your updates"
 msgstr ""
 
-#: bp-activity/bp-activity-notifications.php:78
+#: bp-activity/bp-activity-notifications.php:154
 msgid ""
-"%s replied to one of your updates:\n"
+"%1$s replied to one of your updates:\n"
 "\n"
-"\"%s\"\n"
+"\"%2$s\"\n"
 "\n"
-"To view your original update and all comments, log in and visit: %s\n"
+"To view your original update and all comments, log in and visit: %3$s\n"
 "\n"
 "---------------------\n"
 msgstr ""
 
-#: bp-activity/bp-activity-notifications.php:116
+#: bp-activity/bp-activity-notifications.php:194
 msgid "%s replied to one of your comments"
 msgstr ""
 
-#: bp-activity/bp-activity-notifications.php:121
+#: bp-activity/bp-activity-notifications.php:199
 msgid ""
-"%s replied to one of your comments:\n"
+"%1$s replied to one of your comments:\n"
 "\n"
-"\"%s\"\n"
+"\"%2$s\"\n"
 "\n"
-"To view the original activity, your comment and all replies, log in and visit: %s\n"
+"To view the original activity, your comment and all replies, log in and visit: %3$s\n"
 "\n"
 "---------------------\n"
 msgstr ""
 
-#: bp-activity/bp-activity-templatetags.php:278
-msgid "Viewing item %1$s to %2$s (of %3$s items)"
+#: bp-activity/bp-activity-filters.php:248
+msgid "[Read more]"
 msgstr ""
 
-#: bp-activity/bp-activity-templatetags.php:577
-msgid "&nbsp; %s ago"
+#: bp-activity/bp-activity-filters.php:253
+msgid "&hellip;"
 msgstr ""
 
-#: bp-activity/bp-activity-templatetags.php:877
-msgid "profile"
+#: bp-activity/bp-activity-functions.php:151
+msgid "@%s Mentions"
 msgstr ""
 
-#: bp-activity/bp-activity-templatetags.php:877
-msgid "friends"
+#: bp-activity/bp-activity-functions.php:154
+msgid "You have %1$d new activity mentions"
 msgstr ""
 
-#: bp-activity/bp-activity-templatetags.php:877
-msgid "status"
+#: bp-activity/bp-activity-functions.php:158
+msgid "%1$s mentioned you in an activity update"
 msgstr ""
 
-#: bp-activity/bp-activity-templatetags.php:877
-msgid "blogs"
+#: bp-activity/bp-activity-functions.php:664
+msgid "Posted an update"
 msgstr ""
 
-#: bp-activity/bp-activity-templatetags.php:885
-msgid "Clear Filter"
+#: bp-activity/bp-activity-functions.php:872
+msgid "%s posted an update"
 msgstr ""
 
-#: bp-activity/bp-activity-templatetags.php:956
-msgid "Mention this user in a new public message, this will send the user a notification to get their attention."
+#: bp-activity/bp-activity-functions.php:939
+msgid "%s posted a new activity comment"
 msgstr ""
 
-#: bp-activity/bp-activity-templatetags.php:957
-msgid "Mention this User"
+#: bp-activity/bp-activity-functions.php:1310
+msgid "Thumbnail"
 msgstr ""
 
-#: bp-activity/feeds/bp-activity-friends-feed.php:21
+#: bp-activity/feeds/bp-activity-friends-feed.php:27
 msgid "Friends Activity"
 msgstr ""
 
-#: bp-activity/feeds/bp-activity-friends-feed.php:24
+#: bp-activity/feeds/bp-activity-friends-feed.php:30
 msgid "%s - Friends Activity Feed"
 msgstr ""
 
-#: bp-activity/feeds/bp-activity-friends-feed.php:44
-#: bp-activity/feeds/bp-activity-mentions-feed.php:43
-#: bp-activity/feeds/bp-activity-personal-feed.php:43
-#: bp-activity/feeds/bp-activity-favorites-feed.php:48
-#: bp-activity/feeds/bp-activity-group-feed.php:43
-#: bp-activity/feeds/bp-activity-sitewide-feed.php:44
-#: bp-activity/feeds/bp-activity-mygroups-feed.php:48
+#: 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"
 msgstr ""
 
-#: bp-activity/feeds/bp-activity-mentions-feed.php:21
-#: bp-activity/feeds/bp-activity-mentions-feed.php:24
-msgid "Mentions"
+#: 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"
 msgstr ""
 
-#: bp-activity/feeds/bp-activity-personal-feed.php:24
+#: bp-activity/feeds/bp-activity-personal-feed.php:30
 msgid "%s - Activity Feed"
 msgstr ""
 
-#: bp-activity/feeds/bp-activity-favorites-feed.php:21
-#: bp-activity/feeds/bp-activity-favorites-feed.php:24
+#: bp-activity/feeds/bp-activity-favorites-feed.php:27
+#: bp-activity/feeds/bp-activity-favorites-feed.php:30
 msgid "Favorite Activity"
 msgstr ""
 
-#: bp-activity/feeds/bp-activity-group-feed.php:21
+#: bp-activity/feeds/bp-activity-group-feed.php:27
 msgid "Group Activity"
 msgstr ""
 
-#: bp-activity/feeds/bp-activity-group-feed.php:24
+#: bp-activity/feeds/bp-activity-group-feed.php:30
 msgid "%s - Group Activity Feed"
 msgstr ""
 
-#: bp-activity/feeds/bp-activity-sitewide-feed.php:22
+#: bp-activity/feeds/bp-activity-sitewide-feed.php:27
 msgid "Site Wide Activity"
 msgstr ""
 
-#: bp-activity/feeds/bp-activity-sitewide-feed.php:25
+#: bp-activity/feeds/bp-activity-sitewide-feed.php:30
 msgid "Site Wide Activity Feed"
 msgstr ""
 
-#: bp-activity/feeds/bp-activity-mygroups-feed.php:21
-#: bp-activity/feeds/bp-activity-mygroups-feed.php:24
+#: bp-activity/feeds/bp-activity-mygroups-feed.php:27
+#: bp-activity/feeds/bp-activity-mygroups-feed.php:30
 msgid "My Groups - Public Activity"
+msgstr ""
+
+#: bp-activity/bp-activity-screens.php:245
+msgid "You do not have access to this activity."
+msgstr ""
+
+#: bp-activity/bp-activity-screens.php:289
+msgid "A member mentions you in an update using \"@%s\""
+msgstr ""
+
+#: bp-activity/bp-activity-screens.php:295
+msgid "A member replies to an update or comment you've posted"
+msgstr ""
+
+#: bp-activity/bp-activity-actions.php:153
+msgid "Activity deleted successfully"
+msgstr ""
+
+#: bp-activity/bp-activity-actions.php:155
+msgid "There was an error when deleting that activity"
+msgstr ""
+
+#: bp-activity/bp-activity-actions.php:227
+msgid "Update Posted!"
+msgstr ""
+
+#: bp-activity/bp-activity-actions.php:229
+msgid "There was an error when posting your update, please try again."
+msgstr ""
+
+#: bp-activity/bp-activity-actions.php:279
+msgid "Reply Posted!"
+msgstr ""
+
+#: bp-activity/bp-activity-actions.php:315
+msgid "Activity marked as favorite."
+msgstr ""
+
+#: bp-activity/bp-activity-actions.php:317
+msgid "There was an error marking that activity as a favorite, please try again."
+msgstr ""
+
+#: bp-activity/bp-activity-actions.php:351
+msgid "Activity removed as favorite."
+msgstr ""
+
+#: bp-activity/bp-activity-actions.php:353
+msgid "There was an error removing that activity as a favorite, please try again."
 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 58dd30ae5caad1f996a6e1796016b7822ac84cbf..8c8bd64cfe46dea99d242aa70e8e33b72e0b59d5 100644
--- a/wp-content/plugins/buddypress/bp-loader.php
+++ b/wp-content/plugins/buddypress/bp-loader.php
@@ -1,100 +1,136 @@
 <?php
-/*
-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.2.8
-Author URI: http://buddypress.org/community/members/
-Network: true
-*/
+/**
+ * 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
+ */
 
-define( 'BP_VERSION', '1.2.8' );
+// Exit if accessed directly
+if ( !defined( 'ABSPATH' ) ) exit;
 
-/***
- * This file will load in each BuddyPress component based on which
- * of the components have been activated on the "BuddyPress" admin menu.
- */
+/** Constants *****************************************************************/
+global $wpdb;
 
-require_once( WP_PLUGIN_DIR . '/buddypress/bp-core.php' );
-$bp_deactivated = apply_filters( 'bp_deactivated_components', get_site_option( 'bp-deactivated-components' ) );
+// Define the BuddyPress version
+if ( !defined( 'BP_VERSION' ) )
+	define( 'BP_VERSION', '1.5.3.1' );
 
-do_action( 'bp_core_loaded' );
+// Define the database version
+if ( !defined( 'BP_DB_VERSION' ) )
+	define( 'BP_DB_VERSION', 3820 );
 
-/* Activity Streams */
-if ( !isset( $bp_deactivated['bp-activity.php'] ) && file_exists( BP_PLUGIN_DIR . '/bp-activity.php') )
-	include( BP_PLUGIN_DIR . '/bp-activity.php' );
+// 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' );
 
-/* Blog Tracking */
-if ( !isset( $bp_deactivated['bp-blogs.php'] ) && file_exists( BP_PLUGIN_DIR . '/bp-blogs.php') )
-	include( BP_PLUGIN_DIR . '/bp-blogs.php' );
+// Define on which blog ID BuddyPress should run
+if ( !defined( 'BP_ROOT_BLOG' ) ) {
 
-/* bbPress Forum Integration */
-if ( !isset( $bp_deactivated['bp-forums.php'] ) && file_exists( BP_PLUGIN_DIR . '/bp-forums.php') )
-	include( BP_PLUGIN_DIR . '/bp-forums.php' );
+	// 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;
 
-/* Friend Connections */
-if ( !isset( $bp_deactivated['bp-friends.php'] ) && file_exists( BP_PLUGIN_DIR . '/bp-friends.php') )
-	include( BP_PLUGIN_DIR . '/bp-friends.php' );
+	// Root blog is every site on this network
+	} elseif ( is_multisite() && defined( 'BP_ENABLE_MULTIBLOG' ) ) {
+		$root_blog_id = get_current_blog_id();
 
-/* Groups Support */
-if ( !isset( $bp_deactivated['bp-groups.php'] ) && file_exists( BP_PLUGIN_DIR . '/bp-groups.php') )
-	include( BP_PLUGIN_DIR . '/bp-groups.php' );
+	// Root blog is the only blog on this network
+	} elseif( !is_multisite() ) {
+		$root_blog_id = 1;
+	}
 
-/* Private Messaging */
-if ( !isset( $bp_deactivated['bp-messages.php'] ) && file_exists( BP_PLUGIN_DIR . '/bp-messages.php') )
-	include( BP_PLUGIN_DIR . '/bp-messages.php' );
+	define( 'BP_ROOT_BLOG', $root_blog_id );
+}
 
-/* Extended Profiles */
-if ( !isset( $bp_deactivated['bp-xprofile.php'] ) && file_exists( BP_PLUGIN_DIR . '/bp-xprofile.php') )
-	include( BP_PLUGIN_DIR . '/bp-xprofile.php' );
+// Path and URL
+if ( !defined( 'BP_PLUGIN_DIR' ) )
+	define( 'BP_PLUGIN_DIR', WP_PLUGIN_DIR . '/buddypress' );
 
-/**
- * bp_loaded()
- * 
- * Allow dependent plugins and core actions to attach themselves in a safe way.
- *
- * See bp-core.php for the following core actions:
- *	- bp_init|bp_setup_globals|bp_setup_root_components|bp_setup_nav|bp_register_widgets
- */
-function bp_loaded() {
-	do_action( 'bp_loaded' );
+if ( !defined( 'BP_PLUGIN_URL' ) )
+	define( 'BP_PLUGIN_URL', plugins_url( 'buddypress' ) );
+
+// 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' );
+
+// Setup the BuddyPress theme directory
+register_theme_directory( BP_PLUGIN_DIR . '/bp-themes' );
+
+/** Loader ********************************************************************/
+
+// Load the WP abstraction file so BuddyPress can run on all WordPress setups.
+require( BP_PLUGIN_DIR . '/bp-core/bp-core-wpabstraction.php' );
+
+// 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
+	}
+}
+
+// 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' );
+
+// There is a previous installation
+} else {
+	// Load core
+	require( BP_PLUGIN_DIR . '/bp-core/bp-core-loader.php' );
+
+	// 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' );
+	}
 }
-add_action( 'plugins_loaded', 'bp_loaded', 20 );
 
-/* Activation Function */
+/** Activation ****************************************************************/
+
+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. */
+	// Force refresh theme roots.
 	delete_site_transient( 'theme_roots' );
 
-	/* 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_ROOT_BLOG, 'template' ) && 'bp-default' == get_blog_option( BP_ROOT_BLOG, 'stylesheet' ) )
-		switch_theme( 'bp-default', 'bp-default' );
+	if ( !function_exists( 'get_blog_option' ) )
+		require ( WP_PLUGIN_DIR . '/buddypress/bp-core/bp-core-wpabstraction.php' );
 
-	/* Install site options on activation */
-	bp_core_activate_site_options( array( 'bp-disable-account-deletion' => 0, 'bp-disable-avatar-uploads' => 0, 'bp-disable-blogforum-comments' => 0,  'bp-disable-forum-directory' => 0,  'bp-disable-profile-sync' => 0 ) );
+	if ( !function_exists( 'bp_get_root_blog_id' ) )
+		require ( WP_PLUGIN_DIR . '/buddypress/bp-core/bp-core-functions.php' );
+
+	// 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' );
 
 	do_action( 'bp_loader_activate' );
 }
 register_activation_hook( 'buddypress/bp-loader.php', 'bp_loader_activate' );
+endif;
 
-/* Deactivation Function */
+if ( !function_exists( 'bp_loader_deactivate' ) ) :
+// Deactivation Function
 function bp_loader_deactivate() {
-	if ( !function_exists( 'delete_site_option') )
-		return false;
-
-	delete_site_option( 'bp-core-db-version' );
-	delete_site_option( 'bp-activity-db-version' );
-	delete_site_option( 'bp-blogs-db-version' );
-	delete_site_option( 'bp-friends-db-version' );
-	delete_site_option( 'bp-groups-db-version' );
-	delete_site_option( 'bp-messages-db-version' );
-	delete_site_option( 'bp-xprofile-db-version' );
-	delete_site_option( 'bp-deactivated-components' );
-	delete_site_option( 'bp-blogs-first-install' );
-
 	do_action( 'bp_loader_deactivate' );
 }
 register_deactivation_hook( 'buddypress/bp-loader.php', 'bp_loader_deactivate' );
+endif;
 
-?>
\ No newline at end of file
+?>
diff --git a/wp-content/plugins/buddypress/bp-members/bp-members-actions.php b/wp-content/plugins/buddypress/bp-members/bp-members-actions.php
new file mode 100644
index 0000000000000000000000000000000000000000..785165e68457d00cd115f33065edd1a04b530e16
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-members/bp-members-actions.php
@@ -0,0 +1,169 @@
+<?php
+/*******************************************************************************
+ * Action Functions
+ *
+ * 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.
+ */
+
+// 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.
+ * Must be a site admin for this function to run.
+ *
+ * @package BuddyPress Core
+ * @param int $user_id Optional user ID to mark as spam
+ * @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;
+
+	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;
+
+		// 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 ) );
+
+		// Add feedback message
+		if ( $is_spam ) {
+			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
+		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' );
+
+/**
+ * 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 )
+		return false;
+
+	if ( 'admin' == $bp->current_component && 'delete-user' == $bp->current_action ) {
+		// 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 ) );
+		} else {
+			bp_core_add_message( sprintf( __( 'There was an error deleting %s from the system. Please try again.', 'buddypress' ), $bp->displayed_user->fullname ), 'error' );
+			$errors = true;
+		}
+
+		do_action( 'bp_core_action_delete_user', $errors );
+
+		if ( $errors )
+			bp_core_redirect( $bp->displayed_user->domain );
+		else
+			bp_core_redirect( $bp->loggedin_user->domain );
+	}
+}
+add_action( 'bp_actions', 'bp_core_action_delete_user' );
+
+/**
+ * Returns the user_id for a user based on their username.
+ *
+ * @package BuddyPress Core
+ * @param $username str Username to check.
+ * @return false on no match
+ * @return int the user ID of the matched user.
+ */
+function bp_core_get_random_member() {
+	global $bp;
+
+	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 ) );
+	}
+}
+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
new file mode 100644
index 0000000000000000000000000000000000000000..80e7a5bac4a2aa79a2610f65df8a080c99d5e920
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-members/bp-members-adminbar.php
@@ -0,0 +1,287 @@
+<?php
+/**
+ * BuddyPress Members Admin Bar
+ *
+ * Handles the member functions related to the WordPress Admin Bar
+ *
+ * @package BuddyPress
+ * @subpackage Core
+ */
+
+// 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)
+ */
+function bp_members_admin_bar_my_account_menu() {
+	global $bp, $wp_admin_bar, $wp_version;
+
+	// Bail if this is an ajax request
+	if ( defined( 'DOING_AJAX' ) )
+		return;
+
+	// Logged in user
+	if ( is_user_logged_in() ) {
+
+		if ( '3.2' == bp_get_major_wp_version() ) {
+
+			// 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' )
+			) );
+		}
+
+	// Show login and sign-up links
+	} elseif ( !empty( $wp_admin_bar ) ) {
+
+		add_filter ( 'show_admin_bar', '__return_true' );
+
+		// Create the main 'My Account' menu
+		$wp_admin_bar->add_menu( array(
+			'id'    => 'bp-login',
+			'title' => __( 'Log in', 'buddypress' ),
+			'href'  => wp_login_url()
+		) );
+
+		// Sign up
+		if ( bp_get_signup_allowed() ) {
+			$wp_admin_bar->add_menu( array(
+				'id'    => 'bp-register',
+				'title' => __( 'Register', 'buddypress' ),
+				'href'  => bp_get_signup_page()
+			) );
+		}
+	}
+}
+
+/**
+ * Adds the User Admin top-level menu to user pages
+ *
+ * @package BuddyPress
+ * @since 1.5
+ */
+function bp_members_admin_bar_user_admin_menu() {
+	global $bp, $wp_admin_bar;
+
+	// Only show if viewing a user
+	if ( !bp_is_user() )
+		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' ) || 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()
+		) );
+
+	} 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()
+		) );
+	}
+
+	// User Admin > Edit this user's profile
+	$wp_admin_bar->add_menu( array(
+		'parent' => $bp->user_admin_menu_id,
+		'id'     => 'edit-profile',
+		'title'  => __( "Edit Profile", 'buddypress' ),
+		'href'   => bp_get_members_component_link( 'profile', 'edit' )
+	) );
+
+	// User Admin > Edit this user's avatar
+	$wp_admin_bar->add_menu( array(
+		'parent' => $bp->user_admin_menu_id,
+		'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' ) . '");' )
+		) );
+	}
+
+	// User Admin > Delete Account
+	$wp_admin_bar->add_menu( array(
+		'parent' => $bp->user_admin_menu_id,
+		'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' ) . '");' )
+	) );
+}
+
+/**
+ * Build the "Notifications" dropdown
+ *
+ * @package Buddypress
+ * @since 1.5
+ */
+function bp_members_admin_bar_notifications_menu() {
+	global $bp, $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()
+		) );
+
+	} 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()
+		) );
+	}
+
+	if ( !empty( $notifications ) ) {
+		foreach ( (array)$notifications as $notification ) {
+			$wp_admin_bar->add_menu( array(
+				'parent' => 'bp-notifications',
+				'id'     => 'notification-' . $notification->id,
+				'title'  => $notification->content,
+				'href'   => $notification->href
+			) );
+		}
+	} else {
+		$wp_admin_bar->add_menu( array(
+			'parent' => 'bp-notifications',
+			'id'     => 'no-notifications',
+			'title'  => __( 'No new notifications', 'buddypress' ),
+			'href'   => bp_loggedin_user_domain()
+		) );
+	}
+
+	return;
+}
+
+/**
+ * Make sure the logout link is at the bottom of the "My Account" menu
+ *
+ * @since BuddyPress (r4151)
+ *
+ * @global obj $bp
+ * @global obj $wp_admin_bar
+ */
+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()
+		) );
+	}
+}
+
+?>
\ 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
new file mode 100644
index 0000000000000000000000000000000000000000..ed94a5238e9bd807805aa944aa108918207220e8
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-members/bp-members-buddybar.php
@@ -0,0 +1,135 @@
+<?php
+// Exit if accessed directly
+if ( !defined( 'ABSPATH' ) ) exit;
+
+// **** "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 . '">';
+	_e( 'Notifications', 'buddypress' );
+
+	if ( $notifications = bp_core_get_notifications_for_user( $bp->loggedin_user->id ) ) { ?>
+		<span><?php echo count( $notifications ) ?></span>
+	<?php
+	}
+
+	echo '</a>';
+	echo '<ul>';
+
+	if ( $notifications ) {
+		$counter = 0;
+		for ( $i = 0, $count = count( $notifications ); $i < $count; ++$i ) {
+			$alt = ( 0 == $counter % 2 ) ? ' class="alt"' : ''; ?>
+
+			<li<?php echo $alt ?>><?php echo $notifications[$i] ?></li>
+
+			<?php $counter++;
+		}
+	} else { ?>
+
+		<li><a href="<?php echo $bp->loggedin_user->domain ?>"><?php _e( 'No new notifications.', 'buddypress' ); ?></a></li>
+
+	<?php
+	}
+
+	echo '</ul>';
+	echo '</li>';
+}
+add_action( 'bp_adminbar_menus', 'bp_adminbar_notifications_menu', 8 );
+
+// **** "Blog Authors" Menu (visible when not logged in) ********
+function bp_adminbar_authors_menu() {
+	global $bp, $wpdb;
+
+	// Only for multisite
+	if ( !is_multisite() )
+		return false;
+
+	// Hide on root blog
+	if ( $wpdb->blogid == bp_get_root_blog_id() || !bp_is_active( 'blogs' ) )
+		return false;
+
+	$blog_prefix = $wpdb->get_blog_prefix( $wpdb->blogid );
+	$authors     = $wpdb->get_results( "SELECT user_id, user_login, user_nicename, display_name, user_email, meta_value as caps FROM $wpdb->users u, $wpdb->usermeta um WHERE u.ID = um.user_id AND meta_key = '{$blog_prefix}capabilities' ORDER BY um.user_id" );
+
+	if ( !empty( $authors ) ) {
+		// This is a blog, render a menu with links to all authors
+		echo '<li id="bp-adminbar-authors-menu"><a href="/">';
+		_e('Blog Authors', 'buddypress');
+		echo '</a>';
+
+		echo '<ul class="author-list">';
+		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 ' ' . $author->display_name . '</a>';
+			echo '<div class="admin-bar-clear"></div>';
+			echo '</li>';
+		}
+		echo '</ul>';
+		echo '</li>';
+	}
+}
+add_action( 'bp_adminbar_menus', 'bp_adminbar_authors_menu', 12 );
+
+/**
+ * Adds an admin bar 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 )
+		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' ) || bp_is_my_profile() )
+		return false; ?>
+
+	<li id="bp-adminbar-adminoptions-menu">
+
+		<a href=""><?php _e( 'Admin Options', 'buddypress' ) ?></a>
+
+		<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>
+
+			<?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>
+
+			<?php if ( !bp_core_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>
+
+			<?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>
+
+			<?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>
+
+			<?php do_action( 'bp_members_adminbar_admin_menu' ) ?>
+
+		</ul>
+	</li>
+
+	<?php
+}
+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
new file mode 100644
index 0000000000000000000000000000000000000000..1601fb097861c8405bf4475cbfbf9f3d69ef2e85
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-members/bp-members-filters.php
@@ -0,0 +1,75 @@
+<?php
+/**
+ * BuddyPress Members Filters
+ *
+ * Member specific filters
+ *
+ * @package BuddyPress
+ * @subpackage Member Core
+ */
+
+// Exit if accessed directly
+if ( !defined( 'ABSPATH' ) ) exit;
+
+/**
+ * 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)
+ * @uses add_filter()
+ */
+function bp_members_signup_sanitization() {
+
+	// Filters on sign-up fields
+	$fields = array (
+		'bp_get_signup_username_value',
+		'bp_get_signup_email_value',
+		'bp_get_signup_with_blog_value',
+		'bp_get_signup_blog_url_value',
+		'bp_get_signup_blog_title_value',
+		'bp_get_signup_blog_privacy_value',
+		'bp_get_signup_avatar_dir_value',
+	);
+
+	// Add the filters to each field
+	foreach( $fields as $filter ) {
+		add_filter( $filter, 'esc_html',       1 );
+		add_filter( $filter, 'wp_filter_kses', 2 );
+		add_filter( $filter, 'stripslashes',   3 );
+	}
+
+	// Sanitize email
+	add_filter( 'bp_get_signup_email_value', 'sanitize_email' );
+}
+add_action( 'bp_loaded', 'bp_members_signup_sanitization' );
+
+/**
+ * Filter the user profile URL to point to BuddyPress profile edit
+ *
+ * @since BuddyPress 1.5.2
+ *
+ * @global BuddyPress $bp
+ * @param string $url
+ * @param int $user_id
+ * @param string $scheme
+ * @return string
+ */
+function bp_members_edit_profile_url( $url, $user_id, $scheme = 'admin' ) {
+	global $bp;
+
+	// Default to $url
+	$profile_link = $url;
+
+	// If xprofile is active, use profile domain link
+	if ( bp_is_active( 'xprofile' ) ) {
+		$user_domain  = bp_core_get_user_domain( $user_id );
+		$profile_link = trailingslashit( $user_domain . $bp->profile->slug . '/edit' );
+	}
+	
+	return apply_filters( 'bp_members_edit_profile_url', $profile_link, $url, $user_id, $scheme );
+}
+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
new file mode 100644
index 0000000000000000000000000000000000000000..a259d0a71f5dd59a16ab18cabbea7e9dfab4ec73
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-members/bp-members-functions.php
@@ -0,0 +1,705 @@
+<?php
+/**
+ * BuddyPress Member Functions
+ *
+ * Functions specific to the members component.
+ *
+ * @package BuddyPress
+ * @subpackage Members
+ */
+
+// Exit if accessed directly
+if ( !defined( 'ABSPATH' ) ) exit;
+
+/**
+ * Checks $bp pages global and looks for directory page
+ *
+ * @since 1.5
+ *
+ * @global object $bp Global BuddyPress settings object
+ * @return bool True if set, False if empty
+ */
+function bp_members_has_directory() {
+	global $bp;
+
+	return (bool) !empty( $bp->pages->members->id );
+}
+
+/**
+ * Define the slugs used for BuddyPress pages, based on the slugs of the WP pages used.
+ * These can be overridden manually by defining these slugs in wp-config.php.
+ *
+ * The fallback values are only used during initial BP page creation, when no slugs have been
+ * explicitly defined.
+ *
+ * @package BuddyPress Core Core
+ * @global object $bp Global BuddyPress settings object
+ */
+function bp_core_define_slugs() {
+	global $bp;
+
+	// No custom members slug
+	if ( !defined( 'BP_MEMBERS_SLUG' ) )
+		if ( !empty( $bp->pages->members ) )
+			define( 'BP_MEMBERS_SLUG', $bp->pages->members->slug );
+		else
+			define( 'BP_MEMBERS_SLUG', 'members' );
+
+	// No custom registration slug
+	if ( !defined( 'BP_REGISTER_SLUG' ) )
+		if ( !empty( $bp->pages->register ) )
+			define( 'BP_REGISTER_SLUG', $bp->pages->register->slug );
+		else
+			define( 'BP_REGISTER_SLUG', 'register' );
+
+	// No custom activation slug
+	if ( !defined( 'BP_ACTIVATION_SLUG' ) )
+		if ( !empty( $bp->pages->activate ) )
+			define( 'BP_ACTIVATION_SLUG', $bp->pages->activate->slug );
+		else
+			define( 'BP_ACTIVATION_SLUG', 'activate' );
+
+}
+add_action( 'bp_setup_globals', 'bp_core_define_slugs' );
+
+/**
+ * Return an array of users IDs based on the parameters passed.
+ *
+ * @package BuddyPress Core
+ */
+function bp_core_get_users( $args = '' ) {
+	global $bp;
+
+	$defaults = array(
+		'type'            => 'active', // active, newest, alphabetical, random or popular
+		'user_id'         => false,    // Pass a user_id to limit to only friend connections for this user
+		'exclude'         => false,    // Users to exclude from results
+		'search_terms'    => false,    // Limit to users that match these search terms
+		'meta_key'        => false,    // Limit to users who have this piece of usermeta
+		'meta_value'      => false,    // With meta_key, limit to users where usermeta matches this value
+
+		'include'         => false,    // Pass comma separated list of user_ids to limit to only these users
+		'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 the last active, where the user is a friend, total friend count, latest update
+	);
+
+	$params = wp_parse_args( $args, $defaults );
+	extract( $params, EXTR_SKIP );
+
+	return apply_filters( 'bp_core_get_users', BP_Core_User::get_users( $type, $per_page, $page, $user_id, $include, $search_terms, $populate_extras, $exclude, $meta_key, $meta_value ), $params );
+}
+
+/**
+ * Returns the domain for the passed user: e.g. http://domain.com/members/andy/
+ *
+ * @package BuddyPress Core
+ * @global $current_user WordPress global variable containing current logged in user information
+ * @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;
+
+	if ( !$domain = wp_cache_get( 'bp_user_domain_' . $user_id, 'bp' ) ) {
+		$username = bp_core_get_username( $user_id, $user_nicename, $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 );
+
+		// Cache the link
+		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 );
+}
+
+/**
+ * Fetch everything in the wp_users table for a user, without any usermeta.
+ *
+ * @package BuddyPress Core
+ * @param user_id The ID of the user.
+ * @uses BP_Core_User::get_core_userdata() Performs the query.
+ */
+function bp_core_get_core_userdata( $user_id ) {
+	if ( empty( $user_id ) )
+		return false;
+
+	if ( !$userdata = wp_cache_get( 'bp_core_userdata_' . $user_id, 'bp' ) ) {
+		$userdata = BP_Core_User::get_core_userdata( $user_id );
+		wp_cache_set( 'bp_core_userdata_' . $user_id, $userdata, 'bp' );
+	}
+	return apply_filters( 'bp_core_get_core_userdata', $userdata );
+}
+
+/**
+ * Returns the user id for the user that is currently being displayed.
+ * eg: http://andy.domain.com/ or http://domain.com/andy/
+ *
+ * @package BuddyPress Core
+ * @uses bp_core_get_userid_from_user_login() Returns the user id for the username passed
+ * @return The user id for the user that is currently being displayed, return zero if this is not a user home and just a normal blog.
+ */
+function bp_core_get_displayed_userid( $user_login ) {
+	return apply_filters( 'bp_core_get_displayed_userid', bp_core_get_userid( $user_login ) );
+}
+
+/**
+ * Returns the user_id for a user based on their username.
+ *
+ * @package BuddyPress Core
+ * @param $username str Username to check.
+ * @global $wpdb WordPress DB access object.
+ * @return false on no match
+ * @return int the user ID of the matched user.
+ */
+function bp_core_get_userid( $username ) {
+	global $wpdb;
+
+	if ( empty( $username ) )
+		return false;
+
+	return apply_filters( 'bp_core_get_userid', $wpdb->get_var( $wpdb->prepare( "SELECT ID FROM $wpdb->users WHERE user_login = %s", $username ) ) );
+}
+
+/**
+ * Returns the user_id for a user based on their user_nicename.
+ *
+ * @package BuddyPress Core
+ * @param $username str Username to check.
+ * @global $wpdb WordPress DB access object.
+ * @return false on no match
+ * @return int the user ID of the matched user.
+ */
+function bp_core_get_userid_from_nicename( $user_nicename ) {
+	global $wpdb;
+
+	if ( empty( $user_nicename ) )
+		return false;
+
+	return apply_filters( 'bp_core_get_userid_from_nicename', $wpdb->get_var( $wpdb->prepare( "SELECT ID FROM $wpdb->users WHERE user_nicename = %s", $user_nicename ) ) );
+}
+
+/**
+ * Returns the username for a user based on their user id.
+ *
+ * @package BuddyPress Core
+ * @param $uid int User ID to check.
+ * @global $userdata WordPress user data for the current logged in user.
+ * @uses get_userdata() WordPress function to fetch the userdata for a user ID
+ * @return false on no match
+ * @return str the username of the matched user.
+ */
+function bp_core_get_username( $user_id, $user_nicename = false, $user_login = false ) {
+	global $bp;
+
+	if ( !$username = wp_cache_get( 'bp_user_username_' . $user_id, 'bp' ) ) {
+		// Cache not found so prepare to update it
+		$update_cache = true;
+
+		// Nicename and login were not passed
+		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 ) {
+				$userdata = &$bp->loggedin_user->userdata;
+
+			// User ID matches displayed in user
+			} elseif ( isset( $bp->displayed_user->id ) && $bp->displayed_user->id == $user_id ) {
+				$userdata = &$bp->displayed_user->userdata;
+
+			// No user ID match
+			} else {
+				$userdata = false;
+			}
+
+			// No match so go dig
+			if ( empty( $userdata ) ) {
+
+				// User not found so return false
+				if ( !$userdata = bp_core_get_core_userdata( $user_id ) ) {
+					return false;
+				}
+			}
+
+			// Update the $user_id for later
+			$user_id       = $userdata->ID;
+
+			// Two possible options
+			$user_nicename = $userdata->user_nicename;
+			$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;
+
+	// Username found in cache so don't update it again
+	} else {
+		$update_cache = false;
+	}
+
+	// Check $username for empty spaces and default to nicename if found
+	if ( strstr( $username, ' ' ) )
+		$username = bp_members_get_user_nicename( $user_id );
+
+	// Add this to cache
+	if ( ( true == $update_cache ) && !empty( $username ) )
+		wp_cache_set( 'bp_user_username_' . $user_id, $username, 'bp' );
+
+	return apply_filters( 'bp_core_get_username', $username );
+}
+
+/**
+ * Returns the user_nicename for a user based on their user_id. This should be
+ * used for linking to user profiles and anywhere else a sanitized and unique
+ * slug to a user is needed.
+ *
+ * @since BuddyPress (1.5)
+ *
+ * @package BuddyPress Core
+ * @param $uid int User ID to check.
+ * @global $userdata WordPress user data for the current logged in user.
+ * @uses get_userdata() WordPress function to fetch the userdata for a user ID
+ * @return false on no match
+ * @return str the username of the matched user.
+ */
+function bp_members_get_user_nicename( $user_id ) {
+	global $bp;
+
+	if ( !$user_nicename = wp_cache_get( 'bp_members_user_nicename_' . $user_id, 'bp' ) ) {
+		$update_cache = true;
+
+		// User ID matches logged in user
+		if ( isset( $bp->loggedin_user->id ) && $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 ) {
+			$userdata = &$bp->displayed_user->userdata;
+
+		// No user ID match
+		} else {
+			$userdata = false;
+		}
+
+		// No match so go dig
+		if ( empty( $userdata ) ) {
+
+			// User not found so return false
+			if ( !$userdata = bp_core_get_core_userdata( $user_id ) ) {
+				return false;
+			}
+		}
+
+		// User nicename found
+		$user_nicename = $userdata->user_nicename;
+
+	// Nicename found in cache so don't update it again
+	} else {
+		$update_cache = false;
+	}
+
+	// Add this to cache
+	if ( true == $update_cache && !empty( $user_nicename ) )
+		wp_cache_set( 'bp_members_user_nicename_' . $user_id, $user_nicename, 'bp' );
+
+	return apply_filters( 'bp_members_get_user_nicename', $user_nicename );
+}
+
+/**
+ * Returns the email address for the user based on user ID
+ *
+ * @package BuddyPress Core
+ * @param $uid int User ID to check.
+ * @uses get_userdata() WordPress function to fetch the userdata for a user ID
+ * @return false on no match
+ * @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 ) )
+			$email = $ud->user_email;
+
+		// User was deleted
+		else
+			$email = '';
+
+		wp_cache_set( 'bp_user_email_' . $uid, $email, 'bp' );
+	}
+
+	return apply_filters( 'bp_core_get_user_email', $email );
+}
+
+/**
+ * Returns a HTML formatted link for a user with the user's full name as the link text.
+ * eg: <a href="http://andy.domain.com/">Andy Peatling</a>
+ * Optional parameters will return just the name or just the URL.
+ *
+ * @param int $user_id User ID to check.
+ * @param $no_anchor bool Disable URL and HTML and just return full name. Default false.
+ * @param $just_link bool Disable full name and HTML and just return the URL text. Default false.
+ * @return false on no match
+ * @return str The link text based on passed parameters.
+ * @todo This function needs to be cleaned up or split into separate functions
+ */
+function bp_core_get_userlink( $user_id, $no_anchor = false, $just_link = false ) {
+	$display_name = bp_core_get_user_displayname( $user_id );
+
+	if ( empty( $display_name ) )
+		return false;
+
+	if ( $no_anchor )
+		return $display_name;
+
+	if ( !$url = bp_core_get_user_domain( $user_id ) )
+		return false;
+
+	if ( $just_link )
+		return $url;
+
+	return apply_filters( 'bp_core_get_userlink', '<a href="' . $url . '" title="' . $display_name . '">' . $display_name . '</a>', $user_id );
+}
+
+
+/**
+ * Fetch the display name for a user. This will use the "Name" field in xprofile if it is installed.
+ * 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
+ * @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.
+ * @uses wp_cache_set() Adds a value to the cache.
+ * @return str The display name for the user in question.
+ */
+function bp_core_get_user_displayname( $user_id_or_username ) {
+	global $bp;
+
+	$fullname = '';
+
+	if ( !$user_id_or_username )
+		return false;
+
+	if ( !is_numeric( $user_id_or_username ) )
+		$user_id = bp_core_get_userid( $user_id_or_username );
+	else
+		$user_id = $user_id_or_username;
+
+	if ( !$user_id )
+		return false;
+
+	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 );
+
+			if ( empty($fullname) ) {
+				$ud = bp_core_get_core_userdata( $user_id );
+
+				if ( !empty( $ud->display_name ) )
+					$fullname = $ud->display_name;
+				elseif ( !empty( $ud->user_nicename ) )
+					$fullname = $ud->user_nicename;
+
+				xprofile_set_field_data( 1, $user_id, $fullname );
+			}
+		} else {
+			$ud = bp_core_get_core_userdata($user_id);
+
+			if ( !empty( $ud->display_name ) )
+				$fullname = $ud->display_name;
+			elseif ( !empty( $ud->user_nicename ) )
+				$fullname = $ud->user_nicename;
+		}
+
+		if ( !empty( $fullname ) )
+			wp_cache_set( 'bp_user_fullname_' . $user_id, $fullname, 'bp' );
+	}
+
+	return apply_filters( 'bp_core_get_user_displayname', $fullname, $user_id );
+}
+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'  );
+
+
+/**
+ * Returns the user link for the user based on user email address
+ *
+ * @package BuddyPress Core
+ * @param $email str The email address for the user.
+ * @uses bp_core_get_userlink() BuddyPress function to get a userlink by user ID.
+ * @uses get_user_by() WordPress function to get userdata via an email address
+ * @return str The link to the users home base. False on no match.
+ */
+function bp_core_get_userlink_by_email( $email ) {
+	$user = get_user_by( 'email', $email );
+	return apply_filters( 'bp_core_get_userlink_by_email', bp_core_get_userlink( $user->ID, false, false, true ) );
+}
+
+/**
+ * Returns the user link for the user based on the supplied identifier
+ *
+ * @param $username str If BP_ENABLE_USERNAME_COMPATIBILITY_MODE is set, this will be user_login, otherwise it will be user_nicename.
+ * @return str The link to the users home base. False on no match.
+ */
+function bp_core_get_userlink_by_username( $username ) {
+	if ( bp_is_username_compatibility_mode() )
+		$user_id = bp_core_get_userid( $username );
+	else
+		$user_id = bp_core_get_userid_from_nicename( $username );
+
+	return apply_filters( 'bp_core_get_userlink_by_username', bp_core_get_userlink( $user_id, false, false, true ) );
+}
+
+/**
+ * Returns the total number of members for the installation.
+ *
+ * @package BuddyPress Core
+ * @return int The total number of members.
+ */
+function bp_core_get_total_member_count() {
+	global $wpdb, $bp;
+
+	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}" ) );
+		wp_cache_set( 'bp_total_member_count', $count, 'bp' );
+	}
+
+	return apply_filters( 'bp_core_get_total_member_count', $count );
+}
+
+/**
+ * Checks if the user has been marked as a spammer.
+ *
+ * @package BuddyPress Core
+ * @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;
+
+	// No user to check
+	if ( empty( $user_id ) )
+		return false;
+
+	// Assume user is not spam
+	$is_spammer = false;
+
+	// Get user data
+	$user = get_userdata( $user_id );
+
+	// No user found
+	if ( empty( $user ) ) {
+		$is_spammer = false;
+
+	// User found
+	} else {
+
+		// Check if spam
+		if ( !empty( $user->spam ) )
+			$is_spammer = true;
+
+		if ( 1 == $user->user_status )
+			$is_spammer = true;
+	}
+
+	return apply_filters( 'bp_core_is_user_spammer', (bool) $is_spammer );
+}
+
+/**
+ * Checks if the user has been marked as deleted.
+ *
+ * @package BuddyPress Core
+ * @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;
+
+	// No user to check
+	if ( empty( $user_id ) )
+		return false;
+
+	// Assume user is not deleted
+	$is_deleted = false;
+
+	// Get user data
+	$user = get_userdata( $user_id );
+
+	// No user found
+	if ( empty( $user ) ) {
+		$is_deleted = true;
+
+	// User found
+	} else {
+
+		// Check if deleted
+		if ( !empty( $user->deleted ) )
+			$is_deleted = true;
+
+		if ( 2 == $user->user_status )
+			$is_deleted = true;
+
+	}
+
+	return apply_filters( 'bp_core_is_user_deleted', (bool) $is_deleted );
+}
+
+/**
+ * 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;
+
+	if ( empty( $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 ) ) );
+}
+
+/**
+ * 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;
+
+	// Make sure account deletion is not disabled
+	if ( !empty( $bp->site_options['bp-disable-account-deletion'] ) && !$bp->loggedin_user->is_super_admin )
+		return false;
+
+	// Site admins cannot be deleted
+	if ( is_super_admin( bp_core_get_username( $user_id ) ) )
+		return false;
+
+	// 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/user.php' );
+
+		return wpmu_delete_user( $user_id );
+
+	// Single site user deletion
+	} else {
+		require( ABSPATH . '/wp-admin/includes/user.php' );
+		return wp_delete_user( $user_id );
+	}
+}
+
+/**
+ * Localization safe ucfirst() support.
+ *
+ * @package BuddyPress Core
+ */
+function bp_core_ucfirst( $str ) {
+	if ( function_exists( 'mb_strtoupper' ) && function_exists( 'mb_substr' ) ) {
+		$fc = mb_strtoupper( mb_substr( $str, 0, 1 ) );
+		return $fc.mb_substr( $str, 1 );
+	} else {
+		return ucfirst( $str );
+	}
+}
+
+/**
+ * Strips spaces from usernames that are created using add_user() and wp_insert_user()
+ *
+ * @package BuddyPress Core
+ */
+function bp_core_strip_username_spaces( $username ) {
+	// Don't alter the user_login of existing users, as it causes user_nicename problems.
+	// See http://trac.buddypress.org/ticket/2642
+	if ( username_exists( $username ) && ( !bp_is_username_compatibility_mode() ) )
+		return $username;
+
+	return str_replace( ' ', '-', $username );
+}
+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
+ */
+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 )
+		return new WP_Error( 'invalid_username', __( '<strong>ERROR</strong>: Your account has been marked as a spammer.', 'buddypress' ) );
+	else
+		return $auth_obj;
+}
+add_filter( 'authenticate', 'bp_core_boot_spammer', 30, 2 );
+
+/**
+ * Deletes usermeta for the user when the user is deleted.
+ *
+ * @package BuddyPress Core
+ * @param $user_id The user id for the user to delete usermeta for
+ * @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' );
+
+	// Flush the cache to remove the user from all cached objects
+	wp_cache_flush();
+}
+add_action( 'wpmu_delete_user',  'bp_core_remove_data' );
+add_action( 'delete_user',       'bp_core_remove_data' );
+add_action( 'bp_make_spam_user', 'bp_core_remove_data' );
+
+function bp_core_can_edit_settings() {
+	if ( bp_is_my_profile() )
+		return true;
+
+	if ( is_super_admin() || current_user_can( 'edit_users' ) )
+		return true;
+
+	return false;
+}
+
+?>
\ No newline at end of file
diff --git a/wp-content/plugins/buddypress/bp-members/bp-members-loader.php b/wp-content/plugins/buddypress/bp-members/bp-members-loader.php
new file mode 100644
index 0000000000000000000000000000000000000000..07f9bcd1f21a30d539733662d17920a1cd90c3f9
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-members/bp-members-loader.php
@@ -0,0 +1,193 @@
+<?php
+/**
+ * BuddyPress Member Loader
+ *
+ * A members component to help contain all of the user specific slugs
+ *
+ * @package BuddyPress
+ * @subpackage Members
+ */
+
+// Exit if accessed directly
+if ( !defined( 'ABSPATH' ) ) exit;
+
+class BP_Members_Component extends BP_Component {
+
+	/**
+	 * Start the members component creation process
+	 *
+	 * @since 1.5
+	 */
+	function __construct() {
+		parent::start(
+			'members',
+			__( 'Members', 'buddypress' ),
+			BP_PLUGIN_DIR
+		);
+	}
+
+	/**
+	 * Include files
+	 *
+	 * @global obj $bp
+	 */
+	function includes() {
+		$includes = array(
+			'signup',
+			'actions',
+			'filters',
+			'screens',
+			'template',
+			'buddybar',
+			'adminbar',
+			'functions',
+			'notifications',
+		);
+		parent::includes( $includes );
+	}
+
+	/**
+	 * Setup globals
+	 *
+	 * The BP_MEMBERS_SLUG constant is deprecated, and only used here for
+	 * backwards compatibility.
+	 *
+	 * @since 1.5
+	 * @global obj $bp
+	 */
+	function setup_globals() {
+		global $bp, $current_user, $displayed_user_id;
+
+		// 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,
+			'search_string' => __( 'Search Members...', 'buddypress' ),
+		);
+
+		parent::setup_globals( $globals );
+
+		/** 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 );
+
+		// 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();
+
+		// 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 );
+
+		// The core userdata of the user who is currently logged in.
+		$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 );
+
+		// The core userdata of the user who is currently being displayed
+		$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 );
+
+		/** Profiles Fallback *************************************************/
+		if ( !bp_is_active( 'xprofile' ) ) {
+			$bp->profile->slug = 'profile';
+			$bp->profile->id   = 'profile';
+		}
+
+		/** Default Profile Component *****************************************/
+		if ( !defined( 'BP_DEFAULT_COMPONENT' ) ) {
+			if ( bp_is_active( 'activity' ) && isset( $bp->pages->activity ) )
+				$bp->default_component = bp_get_activity_slug();
+			else
+				$bp->default_component = ( 'xprofile' == $bp->profile->id ) ? 'profile' : $bp->profile->id;
+
+		} else {
+			$bp->default_component = BP_DEFAULT_COMPONENT;
+		}
+
+		if ( !$bp->current_component && $bp->displayed_user->id )
+			$bp->current_component = $bp->default_component;
+	}
+
+	/**
+	 * Setup BuddyBar navigation
+	 *
+	 * @global obj $bp
+	 */
+	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;
+
+			$main_nav = array(
+				'name'                => __( 'Profile', 'buddypress' ),
+				'slug'                => $bp->profile->slug,
+				'position'            => 20,
+				'screen_function'     => 'bp_members_screen_display_profile',
+				'default_subnav_slug' => 'public',
+				'item_css_id'         => $bp->profile->id
+			);
+
+			// 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;
+			$profile_link  = trailingslashit( $user_domain . $bp->profile->slug );
+
+			// Add the subnav items to the profile
+			$sub_nav[] = array(
+				'name'            => __( 'Public', 'buddypress' ),
+				'slug'            => 'public',
+				'parent_url'      => $profile_link,
+				'parent_slug'     => $bp->profile->slug,
+				'screen_function' => 'bp_members_screen_display_profile',
+				'position'        => 10
+			);
+
+			parent::setup_nav( $main_nav, $sub_nav );
+		}
+	}
+
+	/**
+	 * Sets up the title for pages and <title>
+	 *
+	 * @global obj $bp
+	 */
+	function setup_title() {
+		global $bp;
+
+		if ( bp_is_my_profile() ) {
+			$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'
+			) );
+			$bp->bp_options_title  = $bp->displayed_user->fullname;
+		}
+
+		parent::setup_title();
+	}
+
+}
+// Create the users component
+$bp->members = new BP_Members_Component();
+
+?>
\ 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
new file mode 100644
index 0000000000000000000000000000000000000000..3635827b1b89c71fb8771d04e933a8ee13b5bdf6
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-members/bp-members-notifications.php
@@ -0,0 +1,131 @@
+<?php
+/**
+ * BuddyPress Member Notifications
+ *
+ * Functions and filters used for member notification
+ *
+ * @package BuddyPress
+ * @subpackage Members
+ */
+
+// Exit if accessed directly
+if ( !defined( 'ABSPATH' ) ) exit;
+
+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;
+
+	if ( !empty( $secondary_item_id ) )
+		$notification->secondary_item_id = $secondary_item_id;
+
+	if ( !$notification->save() )
+		return false;
+
+	return true;
+}
+
+function bp_core_delete_notification( $id ) {
+	if ( !bp_core_check_notification_access( $bp->loggedin_user->id, $id ) )
+		return false;
+
+	return BP_Core_Notification::delete( $id );
+}
+
+function bp_core_get_notification( $id ) {
+	return new BP_Core_Notification( $id );
+}
+
+function bp_core_get_notifications_for_user( $user_id, $format = 'simple' ) {
+	global $bp;
+
+	$notifications = BP_Core_Notification::get_all_for_user( $user_id );
+
+	// Group notifications by component and component_action and provide totals
+	for ( $i = 0, $count = count( $notifications ); $i < $count; ++$i ) {
+		$notification = $notifications[$i];
+		$grouped_notifications[$notification->component_name][$notification->component_action][] = $notification;
+	}
+
+	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 )
+			continue;
+
+		foreach ( (array)$action_arrays as $component_action_name => $component_action_items ) {
+			$action_item_count = count($component_action_items);
+
+			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 ) ) {
+				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' );
+
+					$notification_object = new stdClass;
+
+					// Minimal backpat with non-compatible notification
+					// callback functions
+					if ( is_string( $content ) ) {
+						$notification_object->content = $content;
+						$notification_object->href    = bp_loggedin_user_domain();
+					} else {
+						$notification_object->content = $content['text'];
+						$notification_object->href    = $content['link'];
+					}
+
+					$notification_object->id = $component_action_items[0]->id;
+
+					$renderable[] 	  = $notification_object;
+				} 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 );
+					$renderable[] = $content;
+				}
+			}
+		}
+	}
+
+	return isset( $renderable ) ? $renderable : false;
+}
+
+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 );
+}
+
+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 );
+}
+
+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 );
+}
+
+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 );
+}
+
+function bp_core_check_notification_access( $user_id, $notification_id ) {
+	if ( !BP_Core_Notification::check_access( $user_id, $notification_id ) )
+		return false;
+
+	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
new file mode 100644
index 0000000000000000000000000000000000000000..cac072e80fa4a49bc5990fd0ac435ab299ec376c
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-members/bp-members-screens.php
@@ -0,0 +1,48 @@
+<?php
+/**
+ * BuddyPress Member Screens
+ *
+ * Handlers for member screens that aren't handled elsewhere
+ *
+ * @package BuddyPress
+ * @subpackage Members
+ */
+
+// Exit if accessed directly
+if ( !defined( 'ABSPATH' ) ) exit;
+
+/**
+ * Handles the display of the profile page by loading the correct template file.
+ *
+ * @package BuddyPress Members
+ * @uses bp_core_load_template() Looks for and loads a template file within the current member theme (folder/filename)
+ */
+function bp_members_screen_display_profile() {
+	do_action( 'bp_members_screen_display_profile' );
+	bp_core_load_template( apply_filters( 'bp_members_screen_display_profile', 'members/single/home' ) );
+}
+
+/**
+ * Handles the display of the members directory index
+ *
+ * @global object $bp
+ *
+ * @uses bp_is_user()
+ * @uses bp_is_current_component()
+ * @uses do_action()
+ * @uses bp_core_load_template()
+ * @uses apply_filters()
+ */
+function bp_members_screen_index() {
+	if ( !bp_is_user() && bp_is_members_component() ) {
+		bp_update_is_directory( true, 'members' );
+
+		do_action( 'bp_members_screen_index' );
+
+		bp_core_load_template( apply_filters( 'bp_members_screen_index', 'members/index' ) );
+	}
+}
+add_action( 'bp_screens', 'bp_members_screen_index' );
+
+
+?>
diff --git a/wp-content/plugins/buddypress/bp-members/bp-members-signup.php b/wp-content/plugins/buddypress/bp-members/bp-members-signup.php
new file mode 100644
index 0000000000000000000000000000000000000000..991e7e8038890c7da0a653396c9ff8143324019e
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-members/bp-members-signup.php
@@ -0,0 +1,616 @@
+<?php
+/**
+ * BuddyPress Member Sign-up
+ *
+ * Functions and filters specific to the member sign-up process
+ *
+ * @package BuddyPress
+ * @subpackage Members
+ */
+
+// Exit if accessed directly
+if ( !defined( 'ABSPATH' ) ) exit;
+
+function bp_core_screen_signup() {
+	global $bp, $wpdb;
+
+	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 = 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;
+	}
+
+	$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'] ) ) {
+
+		// Check the nonce
+		check_admin_referer( '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 )
+				add_action( 'bp_' . $fieldname . '_errors', create_function( '', 'echo apply_filters(\'bp_members_signup_error_message\', "<div class=\"error\">' . $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
+				foreach ( (array) $profile_field_ids as $field_id ) {
+					if ( !isset( $_POST['field_' . $field_id] ) ) {
+						if ( isset( $_POST['field_' . $field_id . '_day'] ) )
+							$_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'] ) );
+					}
+
+					if ( !empty( $_POST['field_' . $field_id] ) )
+						$usermeta['field_' . $field_id] = $_POST['field_' . $field_id];
+				}
+
+				// 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() )
+					bp_core_signup_blog( $blog_details['domain'], $blog_details['path'], $blog_details['blog_title'], $_POST['signup_username'], $_POST['signup_email'], $usermeta );
+				else
+					bp_core_signup_user( $_POST['signup_username'], $_POST['signup_password'], $_POST['signup_email'], $usermeta );
+
+				$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, $wpdb;
+
+	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' );
+
+
+/********************************************************************************
+ * Business 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.
+ */
+
+/**
+ * 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 );
+
+/**
+ * Validate a user name and email address when creating a new user.
+ *
+ * @global object $wpdb DB Layer
+ * @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 ) {
+	global $wpdb;
+
+	$errors = new WP_Error();
+	$user_email = sanitize_email( $user_email );
+
+	if ( empty( $user_name ) )
+		$errors->add( 'user_name', __( 'Please enter a username', 'buddypress' ) );
+
+	$maybe = array();
+	preg_match( "/[a-z0-9]+/", $user_name, $maybe );
+
+	// 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 ) || ( !empty( $maybe[0] ) && $user_name != $maybe[0] ) )
+		$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 ( 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' ), 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 );
+				}
+			}
+		}
+	}
+	$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.
+	 */
+	if ( apply_filters( 'bp_core_signup_send_activation_key', true ) ) {
+		if ( !is_multisite() ) {
+			$activation_key = wp_hash( $user_id );
+			update_user_meta( $user_id, 'activation_key', $activation_key );
+			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 $bp, $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 );
+				}
+			}
+		}
+
+	} 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 ) );
+
+	// Delete the total member cache
+	wp_cache_delete( 'bp_total_member_count', 'bp' );
+
+	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 = get_user_meta( $user_id, 'first_name', true );
+		$lastname = ' ' . get_user_meta( $user_id, 'last_name', true );
+		$name = $firstname . $lastname;
+
+		if ( empty( $name ) || ' ' == $name )
+			$name = 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 = ( '' == get_option( 'blogname' ) ) ? __( 'BuddyPress', 'buddypress' ) : esc_html( get_option( 'blogname' ) );
+
+	$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 );
+	$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 (user_status = 2)
+function bp_core_signup_disable_inactive( $auth_obj, $username ) {
+	global $bp, $wpdb;
+
+	if ( !$user_id = bp_core_get_userid( $username ) )
+		return $auth_obj;
+
+	$user_status = (int) $wpdb->get_var( $wpdb->prepare( "SELECT user_status FROM $wpdb->users WHERE ID = %d", $user_id ) );
+
+	if ( 2 == $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' ) );
+	else
+		return $auth_obj;
+}
+add_filter( 'authenticate', 'bp_core_signup_disable_inactive', 30, 2 );
+
+// Kill the wp-signup.php if custom registration signup templates are present
+function bp_core_wpsignup_redirect() {
+	$action = !empty( $_GET['action'] ) ? $_GET['action'] : '';
+
+	// Not at the WP core signup page and action is not register
+	if ( 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' );
+?>
\ No newline at end of file
diff --git a/wp-content/plugins/buddypress/bp-members/bp-members-template.php b/wp-content/plugins/buddypress/bp-members/bp-members-template.php
new file mode 100644
index 0000000000000000000000000000000000000000..158927c25c2398f3c0d6eb66275fb77110fc68a4
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-members/bp-members-template.php
@@ -0,0 +1,1200 @@
+<?php
+/**
+ * BuddyPress Member Template Tags
+ *
+ * Functions that are safe to use inside your template files and themes
+ *
+ * @package BuddyPress
+ * @subpackage Members
+ */
+
+// Exit if accessed directly
+if ( !defined( 'ABSPATH' ) ) exit;
+
+/**
+ * Output the members component slug
+ *
+ * @package BuddyPress
+ * @subpackage Members Template
+ * @since 1.5
+ *
+ * @uses bp_get_members_slug()
+ */
+function bp_members_slug() {
+	echo bp_get_members_slug();
+}
+	/**
+	 * Return the members component slug
+	 *
+	 * @package BuddyPress
+	 * @subpackage Members Template
+	 * @since 1.5
+	 */
+	function bp_get_members_slug() {
+		global $bp;
+		return apply_filters( 'bp_get_members_slug', $bp->members->slug );
+	}
+
+/**
+ * Output the members component root slug
+ *
+ * @package BuddyPress
+ * @subpackage Members Template
+ * @since 1.5
+ *
+ * @uses bp_get_members_root_slug()
+ */
+function bp_members_root_slug() {
+	echo bp_get_members_root_slug();
+}
+	/**
+	 * Return the members component root slug
+	 *
+	 * @package BuddyPress
+	 * @subpackage Members Template
+	 * @since 1.5
+	 */
+	function bp_get_members_root_slug() {
+		global $bp;
+		return apply_filters( 'bp_get_members_root_slug', $bp->members->root_slug );
+	}
+
+/**
+ * Output member directory permalink
+ *
+ * @package BuddyPress
+ * @subpackage Members Template
+ * @since 1.5
+ * @uses bp_get_members_directory_permalink()
+ */
+function bp_members_directory_permalink() {
+	echo bp_get_members_directory_permalink();
+}
+	/**
+	 * Return member directory permalink
+	 *
+	 * @package BuddyPress
+	 * @subpackage Members Template
+	 * @since 1.5
+	 * @uses apply_filters()
+	 * @uses traisingslashit()
+	 * @uses bp_get_root_domain()
+	 * @uses bp_get_members_root_slug()
+	 * @return string
+	 */
+	function bp_get_members_directory_permalink() {
+		return apply_filters( 'bp_get_members_directory_permalink', trailingslashit( bp_get_root_domain() . '/' . bp_get_members_root_slug() ) );
+	}
+
+/**
+ * Output the sign-up slug
+ *
+ * @package BuddyPress
+ * @subpackage Members Template
+ * @since 1.5
+ *
+ * @uses bp_get_signup_slug()
+ */
+function bp_signup_slug() {
+	echo bp_get_signup_slug();
+}
+	/**
+	 * Return the sign-up slug
+	 *
+	 * @package BuddyPress
+	 * @subpackage Members Template
+	 * @since 1.5
+	 */
+	function bp_get_signup_slug() {
+		global $bp;
+
+		if ( !empty( $bp->pages->register->slug ) )
+			$slug = $bp->pages->register->slug;
+		elseif ( defined( 'BP_REGISTER_SLUG' ) )
+			$slug = BP_REGISTER_SLUG;
+		else
+			$slug = 'register';
+
+		return apply_filters( 'bp_get_signup_slug', $slug );
+	}
+
+/**
+ * Output the activation slug
+ *
+ * @package BuddyPress
+ * @subpackage Members Template
+ * @since 1.5
+ *
+ * @uses bp_get_activate_slug()
+ */
+function bp_activate_slug() {
+	echo bp_get_activate_slug();
+}
+	/**
+	 * Return the activation slug
+	 *
+	 * @package BuddyPress
+	 * @subpackage Members Template
+	 * @since 1.5
+	 */
+	function bp_get_activate_slug() {
+		global $bp;
+
+		if ( !empty( $bp->pages->activate->slug ) )
+			$slug = $bp->pages->activate->slug;
+		elseif ( defined( 'BP_ACTIVATION_SLUG' ) )
+			$slug = BP_ACTIVATION_SLUG;
+		else
+			$slug = 'activate';
+
+		return apply_filters( 'bp_get_activate_slug', $slug );
+	}
+
+/***
+ * Members template loop that will allow you to loop all members or friends of a member
+ * if you pass a user_id.
+ */
+
+class BP_Core_Members_Template {
+	var $current_member = -1;
+	var $member_count;
+	var $members;
+	var $member;
+
+	var $in_the_loop;
+
+	var $pag_page;
+	var $pag_num;
+	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;
+
+		$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;
+
+		if ( isset( $_REQUEST['letter'] ) && '' != $_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'];
+		else
+			$this->total_member_count = (int)$max;
+
+		$this->members = $this->members['users'];
+
+		if ( $max ) {
+			if ( $max >= count( $this->members ) ) {
+				$this->member_count = count( $this->members );
+			} else {
+				$this->member_count = (int)$max;
+			}
+		} else {
+			$this->member_count = count( $this->members );
+		}
+
+		if ( (int)$this->total_member_count && (int)$this->pag_num ) {
+			$this->pag_links = paginate_links( array(
+				'base'      => add_query_arg( 'upage', '%#%' ),
+				'format'    => '',
+				'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' ),
+				'mid_size'   => 1
+			) );
+		}
+	}
+
+	function has_members() {
+		if ( $this->member_count )
+			return true;
+
+		return false;
+	}
+
+	function next_member() {
+		$this->current_member++;
+		$this->member = $this->members[$this->current_member];
+
+		return $this->member;
+	}
+
+	function rewind_members() {
+		$this->current_member = -1;
+		if ( $this->member_count > 0 ) {
+			$this->member = $this->members[0];
+		}
+	}
+
+	function members() {
+		if ( $this->current_member + 1 < $this->member_count ) {
+			return true;
+		} elseif ( $this->current_member + 1 == $this->member_count ) {
+			do_action('member_loop_end');
+			// Do some cleaning up after the loop
+			$this->rewind_members();
+		}
+
+		$this->in_the_loop = false;
+		return false;
+	}
+
+	function the_member() {
+		global $member, $bp;
+
+		$this->in_the_loop = true;
+		$this->member = $this->next_member();
+
+		if ( 0 == $this->current_member ) // loop has just started
+			do_action('member_loop_start');
+	}
+}
+
+function bp_rewind_members() {
+	global $members_template;
+
+	return $members_template->rewind_members();
+}
+
+function bp_has_members( $args = '' ) {
+	global $bp, $members_template;
+
+	/***
+	 * Set the defaults based on the current page. Any of these will be overridden
+	 * if arguments are directly passed into the loop. Custom plugins should always
+	 * pass their parameters directly to the loop.
+	 */
+	$type         = 'active';
+	$user_id      = 0;
+	$page         = 1;
+	$search_terms = null;
+
+	// User filtering
+	if ( !empty( $bp->displayed_user->id ) )
+		$user_id = $bp->displayed_user->id;
+
+	// type: active ( default ) | random | newest | popular | online | alphabetical
+	$defaults = array(
+		'type'            => $type,
+		'page'            => $page,
+		'per_page'        => 20,
+		'max'             => false,
+
+		'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
+
+		'user_id'         => $user_id,      // Pass a user_id to only show friends of this user
+		'search_terms'    => $search_terms, // Pass search_terms to filter users by their profile data
+
+		'meta_key'        => false,	        // Only return users with this usermeta
+		'meta_value'	  => false,	        // Only return users where the usermeta value matches. Requires meta_key
+
+		'populate_extras' => true           // Fetch usermeta? Friend count, last active etc.
+	);
+
+	$r = wp_parse_args( $args, $defaults );
+	extract( $r );
+
+	// Pass a filter if ?s= is set.
+	if ( is_null( $search_terms ) ) {
+		if ( !empty( $_REQUEST['s'] ) )
+			$search_terms = $_REQUEST['s'];
+		else
+			$search_terms = false;
+	}
+
+	// Set per_page to max if max is larger than per_page
+	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 );
+	return apply_filters( 'bp_has_members', $members_template->has_members(), $members_template );
+}
+
+function bp_the_member() {
+	global $members_template;
+	return $members_template->the_member();
+}
+
+function bp_members() {
+	global $members_template;
+	return $members_template->members();
+}
+
+function bp_members_pagination_count() {
+	echo bp_get_members_pagination_count();
+}
+	function bp_get_members_pagination_count() {
+		global $bp, $members_template;
+
+		if ( empty( $members_template->type ) )
+			$members_template->type = '';
+
+		$start_num = intval( ( $members_template->pag_page - 1 ) * $members_template->pag_num ) + 1;
+		$from_num  = bp_core_number_format( $start_num );
+		$to_num    = bp_core_number_format( ( $start_num + ( $members_template->pag_num - 1 ) > $members_template->total_member_count ) ? $members_template->total_member_count : $start_num + ( $members_template->pag_num - 1 ) );
+		$total     = bp_core_number_format( $members_template->total_member_count );
+
+		if ( 'active' == $members_template->type )
+			$pag = sprintf( __( 'Viewing member %1$s to %2$s (of %3$s active members)', 'buddypress' ), $from_num, $to_num, $total );
+		else if ( 'popular' == $members_template->type )
+			$pag = sprintf( __( 'Viewing member %1$s to %2$s (of %3$s members with friends)', 'buddypress' ), $from_num, $to_num, $total );
+		else if ( 'online' == $members_template->type )
+			$pag = sprintf( __( 'Viewing member %1$s to %2$s (of %3$s members online)', 'buddypress' ), $from_num, $to_num, $total );
+		else
+			$pag = sprintf( __( 'Viewing member %1$s to %2$s (of %3$s members)', 'buddypress' ), $from_num, $to_num, $total );
+
+		return apply_filters( 'bp_members_pagination_count', $pag );
+	}
+
+function bp_members_pagination_links() {
+	echo bp_get_members_pagination_links();
+}
+	function bp_get_members_pagination_links() {
+		global $members_template;
+
+		return apply_filters( 'bp_get_members_pagination_links', $members_template->pag_links );
+	}
+
+/**
+ * bp_member_user_id()
+ *
+ * Echo id from bp_get_member_user_id()
+ *
+ * @uses bp_get_member_user_id()
+ */
+function bp_member_user_id() {
+	echo bp_get_member_user_id();
+}
+	/**
+	 * bp_get_member_user_id()
+	 *
+	 * Get the id of the user in a members loop
+	 *
+	 * @global object $members_template
+	 * @return string Members id
+	 */
+	function bp_get_member_user_id() {
+		global $members_template;
+
+		return apply_filters( 'bp_get_member_user_id', $members_template->member->id );
+	}
+
+/**
+ * bp_member_user_nicename()
+ *
+ * Echo nicename from bp_get_member_user_nicename()
+ *
+ * @uses bp_get_member_user_nicename()
+ */
+function bp_member_user_nicename() {
+	echo bp_get_member_user_nicename();
+}
+	/**
+	 * bp_get_member_user_nicename()
+	 *
+	 * Get the nicename of the user in a members loop
+	 *
+	 * @global object $members_template
+	 * @return string Members nicename
+	 */
+	function bp_get_member_user_nicename() {
+		global $members_template;
+		return apply_filters( 'bp_get_member_user_nicename', $members_template->member->user_nicename );
+	}
+
+/**
+ * bp_member_user_login()
+ *
+ * Echo login from bp_get_member_user_login()
+ *
+ * @uses bp_get_member_user_login()
+ */
+function bp_member_user_login() {
+	echo bp_get_member_user_login();
+}
+	/**
+	 * bp_get_member_user_login()
+	 *
+	 * Get the login of the user in a members loop
+	 *
+	 * @global object $members_template
+	 * @return string Members login
+	 */
+	function bp_get_member_user_login() {
+		global $members_template;
+		return apply_filters( 'bp_get_member_user_login', $members_template->member->user_login );
+	}
+
+/**
+ * bp_member_user_email()
+ *
+ * Echo email address from bp_get_member_user_email()
+ *
+ * @uses bp_get_member_user_email()
+ */
+function bp_member_user_email() {
+	echo bp_get_member_user_email();
+}
+	/**
+	 * bp_get_member_user_email()
+	 *
+	 * Get the email address of the user in a members loop
+	 *
+	 * @global object $members_template
+	 * @return string Members email address
+	 */
+	function bp_get_member_user_email() {
+		global $members_template;
+		return apply_filters( 'bp_get_member_user_email', $members_template->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 );
+}
+
+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;
+
+		$defaults = array(
+			'type' => 'thumb',
+			'width' => false,
+			'height' => false,
+			'class' => 'avatar',
+			'id' => false,
+			'alt' => __( 'Profile picture of %s', 'buddypress' )
+		);
+
+		$r = wp_parse_args( $args, $defaults );
+		extract( $r, EXTR_SKIP );
+
+		return apply_filters( 'bp_get_member_avatar', bp_core_fetch_avatar( array( 'item_id' => $members_template->member->id, 'type' => $type, 'alt' => $alt, 'css_id' => $id, 'class' => $class, 'width' => $width, 'height' => $height, 'email' => $members_template->member->user_email ) ) );
+	}
+
+function bp_member_permalink() {
+	echo bp_get_member_permalink();
+}
+	function bp_get_member_permalink() {
+		global $members_template;
+
+		return apply_filters( 'bp_get_member_permalink', bp_core_get_user_domain( $members_template->member->id, $members_template->member->user_nicename, $members_template->member->user_login ) );
+	}
+	function bp_member_link() { echo bp_get_member_permalink(); }
+	function bp_get_member_link() { return bp_get_member_permalink(); }
+
+/**
+ * Echoes bp_get_member_name()
+ *
+ * @package BuddyPress
+ */
+function bp_member_name() {
+	echo apply_filters( 'bp_member_name', bp_get_member_name() );
+}
+	/**
+	 * Used inside a bp_has_members() loop, this function returns a user's full name
+	 *
+	 * Full name is, by default, pulled from xprofile's Full Name field. When this field is
+	 * empty, we try to get an alternative name from the WP users table, in the following order
+	 * of preference: display_name, user_nicename, user_login.
+	 *
+	 * @package BuddyPress
+	 *
+	 * @uses apply_filters() Filter bp_get_the_member_name() to alter the function's output
+	 * @return str The user's fullname for display
+	 */
+	function bp_get_member_name() {
+		global $members_template;
+
+		// Generally, this only fires when xprofile is disabled
+		if ( empty( $members_template->member->fullname ) ) {
+			// Our order of preference for alternative fullnames
+			$name_stack = array(
+				'display_name',
+				'user_nicename',
+				'user_login'
+			);
+
+			foreach ( $name_stack as $source ) {
+				if ( !empty( $members_template->member->{$source} ) ) {
+					// When a value is found, set it as fullname and be done
+					// with it
+					$members_template->member->fullname = $members_template->member->{$source};
+					break;
+				}
+			}
+		}
+
+		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' );
+
+function bp_member_last_active() {
+	echo bp_get_member_last_active();
+}
+	function bp_get_member_last_active() {
+		global $members_template;
+
+		if ( isset( $members_template->member->last_activity ) )
+			$last_activity = bp_core_get_last_activity( $members_template->member->last_activity, __( 'active %s', 'buddypress' ) );
+		else
+			$last_activity = __( 'Never active', 'buddypress' );
+
+		return apply_filters( 'bp_member_last_active', $last_activity );
+	}
+
+function bp_member_latest_update( $args = '' ) {
+	echo bp_get_member_latest_update( $args );
+}
+	function bp_get_member_latest_update( $args = '' ) {
+		global $bp, $members_template;
+
+		$defaults = array(
+			'length'    => 225,
+			'view_link' => true
+		);
+
+		$r = wp_parse_args( $args, $defaults );
+		extract( $r );
+
+		if ( !bp_is_active( 'activity' ) || empty( $members_template->member->latest_update ) || !$update = maybe_unserialize( $members_template->member->latest_update ) )
+			return false;
+
+		$update_content = apply_filters( 'bp_get_activity_latest_update_excerpt', sprintf( _x( '- &quot;%s &quot;', 'member latest update in member directory', 'buddypress' ), trim( strip_tags( bp_create_excerpt( $update['content'], $length ) ) ) ) );
+
+		// If $view_link is true and the text returned by bp_create_excerpt() is different from the original text (ie it's
+		// been truncated), add the "View" link.
+		if ( $view_link && ( $update_content != $update['content'] ) ) {
+			$view = __( 'View', 'buddypress' );
+
+			$update_content .= '<span class="activity-read-more"><a href="' . bp_activity_get_permalink( $update['id'] ) . '" rel="nofollow">' . $view . '</a></span>';
+		}
+
+		return apply_filters( 'bp_get_member_latest_update', $update_content );
+	}
+
+function bp_member_profile_data( $args = '' ) {
+	echo bp_get_member_profile_data( $args );
+}
+	function bp_get_member_profile_data( $args = '' ) {
+		global $bp, $members_template;
+
+		if ( !bp_is_active( 'xprofile' ) )
+			return false;
+
+		// Declare local variables
+		$data    = false;
+		$user_id = 0;
+
+		// 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;
+
+		$defaults = array(
+			'field'   => false,   // Field name
+			'user_id' => $user_id
+		);
+
+		$r = wp_parse_args( $args, $defaults );
+		extract( $r, EXTR_SKIP );
+
+		// Populate the user if it hasn't been already.
+		if ( empty( $members_template->member->profile_data ) && method_exists( 'BP_XProfile_ProfileData', 'get_all_for_user' ) )
+			$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 ) )
+			$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 );
+	}
+
+function bp_member_registered() {
+	echo bp_get_member_registered();
+}
+	function bp_get_member_registered() {
+		global $members_template;
+
+		$registered = esc_attr( bp_core_get_last_activity( $members_template->member->user_registered, __( 'registered %s', 'buddypress' ) ) );
+
+		return apply_filters( 'bp_member_last_active', $registered );
+	}
+
+function bp_member_random_profile_data() {
+	global $members_template;
+
+	if ( bp_is_active( 'xprofile' ) ) { ?>
+		<?php $random_data = xprofile_get_random_profile_data( $members_template->member->id, true ); ?>
+			<strong><?php echo wp_filter_kses( $random_data[0]->name ) ?></strong>
+			<?php echo wp_filter_kses( $random_data[0]->value ) ?>
+	<?php }
+}
+
+function bp_member_hidden_fields() {
+	if ( isset( $_REQUEST['s'] ) )
+		echo '<input type="hidden" id="search_terms" value="' . esc_attr( $_REQUEST['s'] ) . '" name="search_terms" />';
+
+	if ( isset( $_REQUEST['letter'] ) )
+		echo '<input type="hidden" id="selected_letter" value="' . esc_attr( $_REQUEST['letter'] ) . '" name="selected_letter" />';
+
+	if ( isset( $_REQUEST['members_search'] ) )
+		echo '<input type="hidden" id="search_terms" value="' . esc_attr( $_REQUEST['members_search'] ) . '" name="search_terms" />';
+}
+
+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>
+		<input type="submit" id="members_search_submit" name="members_search_submit" value="<?php _e( 'Search', 'buddypress' ) ?>" />
+	</form>
+
+<?php
+}
+
+function bp_total_site_member_count() {
+	echo bp_get_total_site_member_count();
+}
+	function bp_get_total_site_member_count() {
+		return apply_filters( 'bp_get_total_site_member_count', bp_core_number_format( bp_core_get_total_member_count() ) );
+	}
+
+/** Navigation and other misc template tags **/
+
+/**
+ * Uses the $bp->bp_nav global to render out the navigation within a BuddyPress install.
+ * Each component adds to this navigation array within its own [component_name]setup_nav() function.
+ *
+ * This navigation array is the top level navigation, so it contains items such as:
+ *      [Blog, Profile, Messages, Groups, Friends] ...
+ *
+ * The function will also analyze the current component the user is in, to determine whether
+ * or not to highlight a particular nav item.
+ *
+ * @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
+ */
+function bp_get_loggedin_user_nav() {
+	global $bp;
+
+	// Loop through each navigation item
+	foreach( (array) $bp->bp_nav as $nav_item ) {
+		// 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'] )
+			$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 ) {
+			$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 ) )
+						$selected = ' class="current selected"';
+				}
+			}
+		}
+
+		// echo out the final list item
+		echo apply_filters_ref_array( 'bp_get_loggedin_user_nav_' . $nav_item['css_id'], array( '<li id="li-nav-' . $nav_item['css_id'] . '" ' . $selected . '><a id="my-' . $nav_item['css_id'] . '" href="' . $nav_item['link'] . '">' . $nav_item['name'] . '</a></li>', &$nav_item ) );
+	}
+
+	// Always add a log out list item to the end of the navigation
+	$logout_link = '<li><a id="wp-logout" href="' .  wp_logout_url( bp_get_root_domain() ) . '">' . __( 'Log Out', 'buddypress' ) . '</a></li>';
+
+	echo apply_filters( 'bp_logout_nav_link', $logout_link );
+}
+
+/**
+ * Uses the $bp->bp_nav global to render out the user navigation when viewing another user other than
+ * yourself.
+ *
+ * @package BuddyPress Core
+ * @global object $bp Global BuddyPress settings object
+ */
+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() )
+			continue;
+
+		if ( $bp->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'];
+
+		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 ) );
+	}
+}
+
+/** Avatars *******************************************************************/
+
+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' )
+		);
+
+		$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 ) ) );
+	}
+
+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' )
+		);
+
+		$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 ) ) );
+	}
+
+function bp_displayed_user_email() {
+	echo bp_get_displayed_user_email();
+}
+	function bp_get_displayed_user_email() {
+		global $bp;
+
+		// If displayed user exists, return email address
+		if ( isset( $bp->displayed_user->userdata->user_email ) )
+			$retval = $bp->displayed_user->userdata->user_email;
+		else
+			$retval = '';
+
+		return apply_filters( 'bp_get_displayed_user_email', esc_attr( $retval ) );
+	}
+
+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;
+
+		$last_activity = bp_core_get_last_activity( bp_get_user_meta( $user_id, 'last_activity', true ), __('active %s', 'buddypress') );
+
+		return apply_filters( 'bp_get_last_activity', $last_activity );
+	}
+
+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;
+
+		// Fall back on logged in user
+		if ( empty( $name ) )
+			$name = $bp->loggedin_user->fullname;
+
+		$fullname = (array)explode( ' ', $name );
+
+		return apply_filters( 'bp_get_user_firstname', $fullname[0], $fullname );
+	}
+
+function bp_loggedin_user_link() {
+	echo bp_get_loggedin_user_link();
+}
+	function bp_get_loggedin_user_link() {
+		return apply_filters( 'bp_get_loggedin_user_link', bp_loggedin_user_domain() );
+	}
+
+function bp_displayed_user_link() {
+	echo bp_get_displayed_user_link();
+}
+	function bp_get_displayed_user_link() {
+		return apply_filters( 'bp_get_displayed_user_link', bp_displayed_user_domain() );
+	}
+	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_displayed_user_domain() {
+	global $bp;
+	return apply_filters( 'bp_displayed_user_domain', isset( $bp->displayed_user->domain ) ? $bp->displayed_user->domain : '' );
+}
+
+function bp_loggedin_user_domain() {
+	global $bp;
+	return apply_filters( 'bp_loggedin_user_domain', isset( $bp->loggedin_user->domain ) ? $bp->loggedin_user->domain : '' );
+}
+
+function bp_displayed_user_fullname() {
+	echo bp_get_displayed_user_fullname();
+}
+	function bp_get_displayed_user_fullname() {
+		global $bp;
+		return apply_filters( 'bp_displayed_user_fullname', isset( $bp->displayed_user->fullname ) ? $bp->displayed_user->fullname : '' );
+	}
+	function bp_user_fullname() { echo bp_get_displayed_user_fullname(); }
+
+
+function bp_loggedin_user_fullname() {
+	echo bp_get_loggedin_user_fullname();
+}
+	function bp_get_loggedin_user_fullname() {
+		global $bp;
+		return apply_filters( 'bp_get_loggedin_user_fullname', isset( $bp->loggedin_user->fullname ) ? $bp->loggedin_user->fullname : '' );
+	}
+
+function bp_displayed_user_username() {
+	echo bp_get_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 );
+		} else {
+			$username = '';
+		}
+
+		return apply_filters( 'bp_get_displayed_user_username', $username );
+	}
+
+function bp_loggedin_user_username() {
+	echo bp_get_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 );
+		} else {
+			$username = '';
+		}
+
+		return apply_filters( 'bp_get_loggedin_user_username', $username );
+	}
+
+/** Signup Form ***************************************************************/
+
+function bp_has_custom_signup_page() {
+	if ( locate_template( array( 'register.php' ), false ) || locate_template( array( '/registration/register.php' ), false ) )
+		return true;
+
+	return false;
+}
+
+function bp_signup_page() {
+	echo bp_get_signup_page();
+}
+	function bp_get_signup_page() {
+		global $bp;
+
+		if ( bp_has_custom_signup_page() ) {
+			$page = trailingslashit( bp_get_root_domain() . '/' . bp_get_signup_slug() );
+		} else {
+			$page = bp_get_root_domain() . '/wp-signup.php';
+		}
+
+		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() )
+			$page = trailingslashit( bp_get_root_domain() . '/' . $bp->pages->activate->slug );
+		else
+			$page = trailingslashit( bp_get_root_domain() ) . 'wp-activate.php';
+
+		return apply_filters( 'bp_get_activation_page', $page );
+	}
+
+function bp_signup_username_value() {
+	echo bp_get_signup_username_value();
+}
+	function bp_get_signup_username_value() {
+		$value = '';
+		if ( isset( $_POST['signup_username'] ) )
+			$value = $_POST['signup_username'];
+
+		return apply_filters( 'bp_get_signup_username_value', $value );
+	}
+
+function bp_signup_email_value() {
+	echo bp_get_signup_email_value();
+}
+	function bp_get_signup_email_value() {
+		$value = '';
+		if ( isset( $_POST['signup_email'] ) )
+			$value = $_POST['signup_email'];
+
+		return apply_filters( 'bp_get_signup_email_value', $value );
+	}
+
+function bp_signup_with_blog_value() {
+	echo bp_get_signup_with_blog_value();
+}
+	function bp_get_signup_with_blog_value() {
+		$value = '';
+		if ( isset( $_POST['signup_with_blog'] ) )
+			$value = $_POST['signup_with_blog'];
+
+		return apply_filters( 'bp_get_signup_with_blog_value', $value );
+	}
+
+function bp_signup_blog_url_value() {
+	echo bp_get_signup_blog_url_value();
+}
+	function bp_get_signup_blog_url_value() {
+		$value = '';
+		if ( isset( $_POST['signup_blog_url'] ) )
+			$value = $_POST['signup_blog_url'];
+
+		return apply_filters( 'bp_get_signup_blog_url_value', $value );
+	}
+
+function bp_signup_blog_title_value() {
+	echo bp_get_signup_blog_title_value();
+}
+	function bp_get_signup_blog_title_value() {
+		$value = '';
+		if ( isset( $_POST['signup_blog_title'] ) )
+			$value = $_POST['signup_blog_title'];
+
+		return apply_filters( 'bp_get_signup_blog_title_value', $value );
+	}
+
+function bp_signup_blog_privacy_value() {
+	echo bp_get_signup_blog_privacy_value();
+}
+	function bp_get_signup_blog_privacy_value() {
+		$value = '';
+		if ( isset( $_POST['signup_blog_privacy'] ) )
+			$value = $_POST['signup_blog_privacy'];
+
+		return apply_filters( 'bp_get_signup_blog_privacy_value', $value );
+	}
+
+function bp_signup_avatar_dir_value() {
+	echo bp_get_signup_avatar_dir_value();
+}
+	function bp_get_signup_avatar_dir_value() {
+		global $bp;
+
+		// Check if signup_avatar_dir is passed
+		if ( !empty( $_POST['signup_avatar_dir'] ) )
+			$signup_avatar_dir = $_POST['signup_avatar_dir'];
+
+		// If not, check if global is set
+		elseif ( !empty( $bp->signup->avatar_dir ) )
+			$signup_avatar_dir = $bp->signup->avatar_dir;
+
+		// If not, set false
+		else
+			$signup_avatar_dir = false;
+
+		return apply_filters( 'bp_get_signup_avatar_dir_value', $bp->signup->avatar_dir );
+	}
+
+function bp_current_signup_step() {
+	echo bp_get_current_signup_step();
+}
+	function bp_get_current_signup_step() {
+		global $bp;
+
+		return $bp->signup->step;
+	}
+
+function bp_signup_avatar( $args = '' ) {
+	echo bp_get_signup_avatar( $args );
+}
+	function bp_get_signup_avatar( $args = '' ) {
+		global $bp;
+
+		$defaults = array(
+			'size' => bp_core_avatar_full_width(),
+			'class' => 'avatar',
+			'alt' => __( 'Your Avatar', 'buddypress' )
+		);
+
+		$r = wp_parse_args( $args, $defaults );
+		extract( $r, EXTR_SKIP );
+
+		// Avatar DIR is found
+		if ( $signup_avatar_dir = bp_get_signup_avatar_dir_value() ) {
+			$gravatar_img = bp_core_fetch_avatar( array(
+				'item_id'    => $signup_avatar_dir,
+				'object'     => 'signup',
+				'avatar_dir' => 'avatars/signups',
+				'type'       => 'full',
+				'width'      => $size,
+				'height'     => $size,
+				'alt'        => $alt,
+				'class'      => $class
+			) );
+
+		// No avatar DIR was found
+		} else {
+
+			// Set default gravatar type
+			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';
+			else
+				$default_grav = $bp->grav_default->user;
+
+			// Create
+			$gravatar_url    = apply_filters( 'bp_gravatar_url', 'http://www.gravatar.com/avatar/' );
+			$md5_lcase_email = md5( strtolower( bp_get_signup_email_value() ) );
+			$gravatar_img    = '<img src="' . $gravatar_url . $md5_lcase_email . '?d=' . $default_grav . '&amp;s=' . $size . '" width="' . $size . '" height="' . $size . '" alt="' . $alt . '" class="' . $class . '" />';
+		}
+
+		return apply_filters( 'bp_get_signup_avatar', $gravatar_img, $args );
+	}
+
+function bp_signup_allowed() {
+	echo bp_get_signup_allowed();
+}
+	function bp_get_signup_allowed() {
+		global $bp;
+
+		$signup_allowed = false;
+
+		if ( is_multisite() ) {
+			if ( in_array( $bp->site_options['registration'], array( 'all', 'user' ) ) )
+				$signup_allowed = true;
+
+		} else {
+			if ( get_option( 'users_can_register') )
+				$signup_allowed = true;
+		}
+
+		return apply_filters( 'bp_get_signup_allowed', $signup_allowed );
+	}
+
+/**
+ * Hook member activity feed to <head>
+ *
+ * @since 1.5
+ */
+function bp_members_activity_feed() {
+	if ( !bp_is_active( 'activity' ) || !bp_is_user() )
+		return; ?>
+
+	<link rel="alternate" type="application/rss+xml" title="<?php bloginfo( 'name' ) ?> | <?php bp_displayed_user_fullname() ?> | <?php _e( 'Activity RSS Feed', 'buddypress' ) ?>" href="<?php bp_member_activity_feed_link() ?>" />
+
+<?php
+}
+add_action( 'bp_head', 'bp_members_activity_feed' );
+
+
+function bp_members_component_link( $component, $action = '', $query_args = '', $nonce = false ) {
+	echo bp_get_members_component_link( $component, $action, $query_args, $nonce );
+}
+	function bp_get_members_component_link( $component, $action = '', $query_args = '', $nonce = false ) {
+		global $bp;
+
+		// Must be displayed user
+		if ( empty( $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;
+		else
+			$url = $bp->displayed_user->domain . $bp->{$component}->slug;
+
+		// Add a slash at the end of our user url
+		$url = trailingslashit( $url );
+
+		// Add possible query arg
+		if ( !empty( $query_args ) && is_array( $query_args ) )
+			$url = add_query_arg( $query_args, $url );
+
+		// To nonce, or not to nonce...
+		if ( true === $nonce )
+			$url = wp_nonce_url( $url );
+		elseif ( is_string( $nonce ) )
+			$url = wp_nonce_url( $url, $nonce );
+
+		// Return the url, if there is one
+		if ( !empty( $url ) )
+			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
new file mode 100644
index 0000000000000000000000000000000000000000..bdc3e1ad077833c108908c4e053604b1983675a6
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-messages/bp-messages-actions.php
@@ -0,0 +1,110 @@
+<?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.
+ */
+
+// Exit if accessed directly
+if ( !defined( 'ABSPATH' ) ) exit;
+
+function messages_action_view_message() {
+	global $thread_id, $bp;
+
+	if ( !bp_is_messages_component() || !bp_is_current_action( 'view' ) )
+		return false;
+
+	$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() );
+
+	// Check if a new reply has been submitted
+	if ( isset( $_POST['send'] ) ) {
+
+		// Check the nonce
+		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'] ) ) )
+			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' );
+
+		bp_core_redirect( bp_displayed_user_domain() . bp_get_messages_slug() . '/view/' . $thread_id . '/' );
+	}
+
+	// Mark message read
+	messages_mark_thread_read( $thread_id );
+
+	// Decrease the unread count in the nav before it's rendered
+	$name = sprintf( __( 'Messages <span>%s</span>', 'buddypress' ), bp_get_total_unread_messages_count() );
+
+	$bp->bp_nav[$bp->messages->slug]['name'] = $name;
+
+	do_action( 'messages_action_view_message' );
+
+	bp_core_new_subnav_item( array(
+		'name'            => sprintf( __( 'From: %s', 'buddypress' ), BP_Messages_Thread::get_last_sender( $thread_id ) ),
+		'slug'            => 'view',
+		'parent_url'      => trailingslashit( bp_displayed_user_domain() . bp_get_messages_slug() ),
+		'parent_slug'     => bp_get_messages_slug(),
+		'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
+	) );
+
+	bp_core_load_template( apply_filters( 'messages_template_view_message', 'members/single/home' ) );
+}
+add_action( 'bp_actions', 'messages_action_view_message' );
+
+function messages_action_delete_message() {
+	global $thread_id;
+
+	if ( !bp_is_messages_component() || bp_is_current_action( 'notices' ) || !bp_is_action_variable( 'delete', 0 ) )
+		return false;
+
+	$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() );
+	} else {
+		if ( !check_admin_referer( 'messages_delete_thread' ) )
+			return false;
+
+		// Delete message
+		if ( !messages_delete_thread( $thread_id ) ) {
+			bp_core_add_message( __('There was an error deleting that message.', 'buddypress'), 'error' );
+		} else {
+			bp_core_add_message( __('Message deleted.', 'buddypress') );
+		}
+		bp_core_redirect( bp_displayed_user_domain() . bp_get_messages_slug() . '/' . bp_current_action() );
+	}
+}
+add_action( 'bp_actions', 'messages_action_delete_message' );
+
+function messages_action_bulk_delete() {
+	global $thread_ids;
+
+	if ( !bp_is_messages_component() || !bp_is_action_variable( 'bulk-delete', 0 ) )
+		return false;
+
+	$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() );
+	} else {
+		if ( !check_admin_referer( 'messages_delete_thread' ) )
+			return false;
+
+		if ( !messages_delete_thread( $thread_ids ) )
+			bp_core_add_message( __('There was an error deleting messages.', 'buddypress'), 'error' );
+		else
+			bp_core_add_message( __('Messages deleted.', 'buddypress') );
+
+		bp_core_redirect( 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
new file mode 100644
index 0000000000000000000000000000000000000000..77c8114310a840b6ea6428425f07a3c32e67ea86
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-messages/bp-messages-cache.php
@@ -0,0 +1,20 @@
+<?php
+/*******************************************************************************
+ * Caching functions handle the clearing of cached objects and pages on specific
+ * actions throughout BuddyPress.
+ */
+
+// Exit if accessed directly
+if ( !defined( 'ABSPATH' ) ) exit;
+
+// List actions to clear super cached pages on, if super cache is installed
+add_action( 'messages_delete_thread',  'bp_core_clear_cache' );
+add_action( 'messages_send_notice',    'bp_core_clear_cache' );
+add_action( 'messages_message_sent',   'bp_core_clear_cache' );
+
+// Don't cache message inbox/sentbox/compose as it's too problematic
+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 80caa004ac70370e59121f36f9287b4b4a544df1..9f9c77a2816aad035cbed91e7d15f3aaa27a274f 100644
--- a/wp-content/plugins/buddypress/bp-messages/bp-messages-classes.php
+++ b/wp-content/plugins/buddypress/bp-messages/bp-messages-classes.php
@@ -1,4 +1,6 @@
 <?php
+// Exit if accessed directly
+if ( !defined( 'ABSPATH' ) ) exit;
 
 Class BP_Messages_Thread {
 	var $thread_id;
@@ -8,26 +10,34 @@ Class BP_Messages_Thread {
 
 	var $unread_count;
 
-	function bp_messages_thread ( $thread_id = false ) {
+	function bp_messages_thread ( $thread_id = false, $order = 'ASC' ) {
+		$this->__construct( $thread_id, $order);
+	}
+
+	function __construct( $thread_id = false, $order = 'ASC' ) {
 		if ( $thread_id )
-			$this->populate( $thread_id );
+			$this->populate( $thread_id, $order );
 	}
 
-	function populate( $thread_id ) {
+	function populate( $thread_id, $order ) {
 		global $wpdb, $bp;
 
-		$this->thread_id = $thread_id;
+		if( 'ASC' != $order && 'DESC' != $order )
+			$order= 'ASC';
+
+		$this->messages_order = $order;
+		$this->thread_id      = $thread_id;
 
-		if ( !$this->messages = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM {$bp->messages->table_name_messages} WHERE thread_id = %d ORDER BY date_sent ASC", $this->thread_id ) ) )
+		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 )
 			$this->sender_ids[$message->sender_id] = $message->sender_id;
 
-		/* Fetch the recipients */
+		// Fetch the recipients
 		$this->recipients = $this->get_recipients();
 
-		/* Get the unread count for the logged in user */
+		// 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;
 	}
@@ -63,10 +73,10 @@ Class BP_Messages_Thread {
 		$recipients = $wpdb->get_results( $wpdb->prepare( "SELECT id FROM {$bp->messages->table_name_recipients} WHERE thread_id = %d AND is_deleted = 0", $thread_id ) );
 
 		if ( empty( $recipients ) ) {
-			/* Delete all the messages */
+			// Delete all the messages
 			$wpdb->query( $wpdb->prepare( "DELETE FROM {$bp->messages->table_name_messages} WHERE thread_id = %d", $thread_id ) );
 
-			/* Delete all the recipients */
+			// Delete all the recipients
 			$wpdb->query( $wpdb->prepare( "DELETE FROM {$bp->messages->table_name_recipients} WHERE thread_id = %d", $thread_id ) );
 		}
 
@@ -76,30 +86,31 @@ Class BP_Messages_Thread {
 	function get_current_threads_for_user( $user_id, $box = 'inbox', $type = 'all', $limit = null, $page = null ) {
 		global $wpdb, $bp;
 
+		$pag_sql = $type_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 " );
-		else if ( $type == 'read' )
+		elseif ( $type == 'read' )
 			$type_sql = $wpdb->prepare( " AND r.unread_count = 0 " );
 
 		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 m.date_sent DESC {$pag_sql}", $bp->loggedin_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 ", $bp->loggedin_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 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 ) );
 		} 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 m.date_sent DESC {$pag_sql}", $bp->loggedin_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}", $bp->loggedin_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} 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 ) );
 		}
 
 		if ( empty( $thread_ids ) )
 			return false;
 
-		/* Sort threads by date_sent */
-		foreach( (array)$thread_ids as $thread ) {
-			$sorted_threads[$thread->thread_id] = strtotime($thread->date_sent);
-		}
-		arsort($sorted_threads);
+		// Sort threads by date_sent
+		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 )
@@ -157,26 +168,25 @@ Class BP_Messages_Thread {
 		return bp_core_get_userlink( $sender_id, true );
 	}
 
-	function get_inbox_count() {
+	function get_inbox_count( $user_id = 0 ) {
 		global $wpdb, $bp;
 
-		$sql = $wpdb->prepare( "SELECT unread_count FROM {$bp->messages->table_name_recipients} WHERE user_id = %d AND is_deleted = 0 AND sender_only = 0", $bp->loggedin_user->id );
+		if ( empty( $user_id ) )
+			$user_id = $bp->loggedin_user->id;
 
-		if ( !$unread_counts = $wpdb->get_results($sql) )
-			return false;
+		$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 );
 
-		$count = 0;
-		for ( $i = 0; $i < count($unread_counts); $i++ ) {
-			$count += $unread_counts[$i]->unread_count;
-		}
+		if ( empty( $unread_count ) || is_wp_error( $unread_count ) )
+			return 0;
 
-		return $count;
+		return (int) $unread_count;
 	}
 
-	function check_access( $thread_id, $user_id = false ) {
+	function check_access( $thread_id, $user_id = 0 ) {
 		global $wpdb, $bp;
 
-		if ( !$user_id )
+		if ( empty( $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 ) );
@@ -192,22 +202,22 @@ Class BP_Messages_Thread {
 		if ( count($recipients) >= 5 )
 			return count( $recipients ) . __(' Recipients', 'buddypress');
 
-		foreach ( (array)$recipients as $recipient ) {
+		foreach ( (array)$recipients as $recipient )
 			$recipient_links[] = bp_core_get_userlink( $recipient->user_id );
-		}
 
 		return implode( ', ', (array) $recipient_links );
 	}
 
-	/* Upgrade Functions */
+	// Update Functions
 
-	function upgrade_tables() {
+	function update_tables() {
 		global $wpdb, $bp;
 
-		$errors = false;
-		$threads = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM {$wpdb->base_prefix}bp_messages_threads" ) );
+		$bp_prefix = bp_core_get_table_prefix();
+		$errors    = false;
+		$threads   = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM {$bp_prefix}bp_messages_threads" ) );
 
-		/* Nothing to upgrade, just return true to remove the table */
+		// Nothing to update, just return true to remove the table
 		if ( empty( $threads ) )
 			return true;
 
@@ -217,7 +227,7 @@ Class BP_Messages_Thread {
 			if ( !empty( $message_ids ) ) {
 				$message_ids = implode( ',', $message_ids );
 
-				/* Add the thread_id to the messages table */
+				// Add the thread_id to the messages table
 				if ( !$wpdb->query( $wpdb->prepare( "UPDATE {$bp->messages->table_name_messages} SET thread_id = %d WHERE id IN ({$message_ids})", $thread->id ) ) )
 					$errors = true;
 			}
@@ -241,25 +251,28 @@ 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;
 
-		if ( $id ) {
-			$this->populate($id);
-		}
+		if ( !empty( $id ) )
+			$this->populate( $id );
 	}
 
 	function populate( $id ) {
 		global $wpdb, $bp;
 
 		if ( $message = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM {$bp->messages->table_name_messages} WHERE id = %d", $id ) ) ) {
-			$this->id = $message->id;
+			$this->id        = $message->id;
 			$this->thread_id = $message->thread_id;
 			$this->sender_id = $message->sender_id;
-			$this->subject = $message->subject;
-			$this->message = $message->message;
+			$this->subject   = $message->subject;
+			$this->message   = $message->message;
 			$this->date_sent = $message->date_sent;
 		}
 	}
@@ -269,19 +282,19 @@ Class BP_Messages_Message {
 
 		$this->sender_id = apply_filters( 'messages_message_sender_id_before_save', $this->sender_id, $this->id );
 		$this->thread_id = apply_filters( 'messages_message_thread_id_before_save', $this->thread_id, $this->id );
-		$this->subject = apply_filters( 'messages_message_subject_before_save', $this->subject, $this->id );
-		$this->message = apply_filters( 'messages_message_content_before_save', $this->message, $this->id );
+		$this->subject   = apply_filters( 'messages_message_subject_before_save',   $this->subject,   $this->id );
+		$this->message   = apply_filters( 'messages_message_content_before_save',   $this->message,   $this->id );
 		$this->date_sent = apply_filters( 'messages_message_date_sent_before_save', $this->date_sent, $this->id );
 
-		do_action( 'messages_message_before_save', $this );
+		do_action_ref_array( 'messages_message_before_save', array( &$this ) );
 
-		/* Make sure we have at least one recipient before sending. */
+		// Make sure we have at least one recipient before sending.
 		if ( empty( $this->recipients ) )
 			return false;
 
 		$new_thread = false;
 
-		/* If we have no thread_id then this is the first message of a new thread. */
+		// 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;
 			$new_thread = true;
@@ -291,23 +304,27 @@ Class BP_Messages_Message {
 		if ( !$wpdb->query( $wpdb->prepare( "INSERT INTO {$bp->messages->table_name_messages} ( thread_id, sender_id, subject, message, date_sent ) VALUES ( %d, %d, %s, %s, %s )", $this->thread_id, $this->sender_id, $this->subject, $this->message, $this->date_sent ) ) )
 			return false;
 
+		$recipient_ids = array();
+
 		if ( $new_thread ) {
-			/* Add an recipient entry for all recipients */
-			foreach ( (array)$this->recipients as $recipient )
+			// Add an recipient entry for all recipients
+			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;
+			}
 
-			/* Add a sender recipient entry if the sender is not in the list of recipients */
-			if ( !in_array( $this->sender_id, $this->recipients ) )
+			// Add a sender recipient entry if the sender is not in the list of recipients
+			if ( !in_array( $this->sender_id, $recipient_ids ) )
 				$wpdb->query( $wpdb->prepare( "INSERT INTO {$bp->messages->table_name_recipients} ( user_id, thread_id, sender_only ) VALUES ( %d, %d, 1 )", $this->sender_id, $this->thread_id ) );
 		} else {
-			/* Update the unread count for all recipients */
+			// Update the unread count for all recipients
 			$wpdb->query( $wpdb->prepare( "UPDATE {$bp->messages->table_name_recipients} SET unread_count = unread_count + 1, sender_only = 0, is_deleted = 0 WHERE thread_id = %d AND user_id != %d", $this->thread_id, $this->sender_id ) );
 		}
 
 		$this->id = $wpdb->insert_id;
 		messages_remove_callback_values();
 
-		do_action( 'messages_message_after_save', $this );
+		do_action_ref_array( 'messages_message_after_save', array( &$this ) );
 
 		return $this->id;
 	}
@@ -325,7 +342,7 @@ Class BP_Messages_Message {
 			return false;
 
 		if ( is_array( $recipient_usernames ) ) {
-			for ( $i = 0; $i < count($recipient_usernames); $i++ ) {
+			for ( $i = 0, $count = count( $recipient_usernames ); $i < $count; ++$i ) {
 				if ( $rid = bp_core_get_userid( trim($recipient_usernames[$i]) ) )
 					$recipient_ids[] = $rid;
 			}
@@ -358,7 +375,11 @@ Class BP_Messages_Notice {
 	var $date_sent;
 	var $is_active;
 
-	function bp_messages_notice($id = null) {
+	function bp_messages_notice( $id = null ) {
+		$this->__construct($id);
+	}
+
+	function __construct( $id = null ) {
 		if ( $id ) {
 			$this->id = $id;
 			$this->populate($id);
@@ -371,8 +392,8 @@ Class BP_Messages_Notice {
 		$notice = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM {$bp->messages->table_name_notices} WHERE id = %d", $this->id ) );
 
 		if ( $notice ) {
-			$this->subject = $notice->subject;
-			$this->message = $notice->message;
+			$this->subject   = $notice->subject;
+			$this->message   = $notice->message;
 			$this->date_sent = $notice->date_sent;
 			$this->is_active = $notice->is_active;
 		}
@@ -384,15 +405,14 @@ Class BP_Messages_Notice {
 		$this->subject = apply_filters( 'messages_notice_subject_before_save', $this->subject, $this->id );
 		$this->message = apply_filters( 'messages_notice_message_before_save', $this->message, $this->id );
 
-		do_action( 'messages_notice_before_save', $this );
+		do_action_ref_array( 'messages_notice_before_save', array( &$this ) );
 
-		if ( !$this->id ) {
+		if ( empty( $this->id ) )
 			$sql = $wpdb->prepare( "INSERT INTO {$bp->messages->table_name_notices} (subject, message, date_sent, is_active) VALUES (%s, %s, %s, %d)", $this->subject, $this->message, $this->date_sent, $this->is_active );
-		} else {
+		else
 			$sql = $wpdb->prepare( "UPDATE {$bp->messages->table_name_notices} SET subject = %s, message = %s, is_active = %d WHERE id = %d", $this->subject, $this->message, $this->is_active, $this->id );
-		}
 
-		if ( !$wpdb->query($sql) )
+		if ( !$wpdb->query( $sql ) )
 			return false;
 
 		if ( !$id = $this->id )
@@ -401,9 +421,9 @@ 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 ) );
 
-		update_user_meta( $bp->loggedin_user->id, 'last_activity', date( 'Y-m-d H:i:s' ) );
+		bp_update_user_meta( $bp->loggedin_user->id, 'last_activity', bp_core_current_time() );
 
-		do_action( 'messages_notice_after_save', $this );
+		do_action_ref_array( 'messages_notice_after_save', array( &$this ) );
 
 		return true;
 	}
@@ -429,7 +449,7 @@ Class BP_Messages_Notice {
 
 		$sql = $wpdb->prepare( "DELETE FROM {$bp->messages->table_name_notices} WHERE id = %d", $this->id );
 
-		if ( !$wpdb->query($sql) )
+		if ( !$wpdb->query( $sql ) )
 			return false;
 
 		return true;
@@ -456,7 +476,7 @@ Class BP_Messages_Notice {
 		global $wpdb, $bp;
 
 		$notice_id = $wpdb->get_var( $wpdb->prepare( "SELECT id FROM {$bp->messages->table_name_notices} WHERE is_active = 1") );
-		return new BP_Messages_Notice($notice_id);
+		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 1ff9734ddd9ab20468158da4d5f0cdc1369ae97f..59b8de28f7e0fd4827df3a1c7ddbf253433c78e4 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,50 @@
 <?php
+// 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->current_component == $bp->messages->slug && 'compose' == $bp->current_action ) {
+	if ( bp_is_messages_component() && bp_is_current_action( 'compose' ) ) {
 		add_action( 'wp_head', 'messages_autocomplete_init_jsblock' );
 
-		wp_enqueue_script( 'bp-jquery-autocomplete', BP_PLUGIN_URL . '/bp-messages/js/autocomplete/jquery.autocomplete.js', array( 'jquery' ) );
-		wp_enqueue_script( 'bp-jquery-autocomplete-fb', BP_PLUGIN_URL . '/bp-messages/js/autocomplete/jquery.autocompletefb.js' );
-		wp_enqueue_script( 'bp-jquery-bgiframe', BP_PLUGIN_URL . '/bp-messages/js/autocomplete/jquery.bgiframe.min.js' );
-		wp_enqueue_script( 'bp-jquery-dimensions', BP_PLUGIN_URL . '/bp-messages/js/autocomplete/jquery.dimensions.js' );
+		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' );
+
+		} 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' );
+		}
 	}
-
 }
-add_action( 'wp', 'messages_add_autocomplete_js', 2 );
+add_action( 'bp_actions', 'messages_add_autocomplete_js' );
 
 function messages_add_autocomplete_css() {
 	global $bp;
 
-	if ( $bp->current_component == $bp->messages->slug && 'compose' == $bp->current_action ) {
-		wp_enqueue_style( 'bp-messages-autocomplete', BP_PLUGIN_URL . '/bp-messages/css/autocomplete/jquery.autocompletefb.css' );
+	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' );
+
 		wp_print_styles();
 	}
 }
 add_action( 'wp_head', 'messages_add_autocomplete_css' );
 
 function messages_autocomplete_init_jsblock() {
-	global $bp;
 ?>
 	<script type="text/javascript">
 		jQuery(document).ready(function() {
 			var acfb =
-			jQuery("ul.first").autoCompletefb({urlLookup:'<?php echo $bp->root_domain . str_replace( 'index.php', 'wp-load.php', $_SERVER['SCRIPT_NAME'] ) ?>'});
+			jQuery("ul.first").autoCompletefb({urlLookup:'<?php echo site_url( 'wp-load.php' ) ?>'});
 
 			jQuery('#send_message_form').submit( function() {
 				var users = document.getElementById('send-to-usernames').className;
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 1752fe5c167551a126ab59d7ddd063f45e58fc92..9ee113df6b8cb547822e9c8662d15c11a95dac4a 100644
--- a/wp-content/plugins/buddypress/bp-messages/bp-messages-filters.php
+++ b/wp-content/plugins/buddypress/bp-messages/bp-messages-filters.php
@@ -1,4 +1,6 @@
 <?php
+// Exit if accessed directly
+if ( !defined( 'ABSPATH' ) ) exit;
 
 /* Apply WordPress defined filters */
 add_filter( 'bp_get_message_notice_subject', 'wp_filter_kses', 1 );
@@ -40,9 +42,9 @@ 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' );
-add_filter( 'bp_get_message_thread_excerpt', 'make_clickable' );
-add_filter( 'bp_get_the_thread_message_content', 'make_clickable' );
+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_the_thread_message_content', 'wpautop' );
diff --git a/wp-content/plugins/buddypress/bp-messages/bp-messages-functions.php b/wp-content/plugins/buddypress/bp-messages/bp-messages-functions.php
new file mode 100644
index 0000000000000000000000000000000000000000..ca7383a9ef779dbe995efbf474bcb0a61318c4fc
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-messages/bp-messages-functions.php
@@ -0,0 +1,261 @@
+<?php
+/*******************************************************************************
+ * 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.
+ */
+
+// Exit if accessed directly
+if ( !defined( 'ABSPATH' ) ) exit;
+
+function messages_new_message( $args = '' ) {
+	global $bp;
+
+	$defaults = array (
+		'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,
+		'content'    => false,
+		'date_sent'  => bp_core_current_time()
+	);
+
+	$r = wp_parse_args( $args, $defaults );
+	extract( $r, EXTR_SKIP );
+
+	if ( empty( $sender_id ) || empty( $content ) )
+		return false;
+
+	// Create a new message object
+	$message            = new BP_Messages_Message;
+	$message->thread_id = $thread_id;
+	$message->sender_id = $sender_id;
+	$message->subject   = $subject;
+	$message->message   = $content;
+	$message->date_sent = $date_sent;
+
+	// If we have a thread ID, use the existing recipients, otherwise use the recipients passed
+	if ( !empty( $thread_id ) ) {
+		$thread = new BP_Messages_Thread( $thread_id );
+		$message->recipients = $thread->get_recipients();
+
+		// Strip the sender from the recipient list if they exist
+		if ( isset( $message->recipients[$sender_id] ) )
+			unset( $message->recipients[$sender_id] );
+
+		if ( empty( $message->subject ) )
+			$message->subject = sprintf( __( 'Re: %s', 'buddypress' ), $thread->messages[0]->subject );
+
+	// No thread ID, so make some adjustments
+	} else {
+		if ( empty( $recipients ) )
+			return false;
+
+		if ( empty( $message->subject ) )
+			$message->subject = __( 'No Subject', 'buddypress' );
+
+		$recipient_ids 	    = array();
+
+		// Invalid recipients are added to an array, for future enhancements
+		$invalid_recipients = array();
+
+		// Loop the recipients and convert all usernames to user_ids where needed
+		foreach( (array) $recipients as $recipient ) {
+			$recipient = trim( $recipient );
+			if ( empty( $recipient ) )
+				continue;
+
+			if ( is_numeric( $recipient ) ) {
+				if ( bp_core_get_core_userdata( (int) $recipient ) )
+					$recipient_id = (int) $recipient;
+
+			} else {
+				if ( bp_is_username_compatibility_mode() )
+					$recipient_id = bp_core_get_userid( $recipient );
+				else
+					$recipient_id = bp_core_get_userid_from_nicename( $recipient );
+			}
+
+			if ( !$recipient_id )
+				$invalid_recipients[] = $recipient;
+			else
+				$recipient_ids[] = (int) $recipient_id;
+		}
+
+		// Strip the sender from the recipient list if they exist
+		if ( $key = array_search( $sender_id, (array)$recipient_ids ) )
+			unset( $recipient_ids[$key] );
+
+		// Remove duplicates
+		$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 ) {
+			$message->recipients[$i]          = new stdClass;
+			$message->recipients[$i]->user_id = $recipient_id;
+		}
+	}
+
+	if ( $message->send() ) {
+
+		// Send screen notifications to the recipients
+		foreach ( (array)$message->recipients as $recipient )
+			bp_core_add_notification( $message->id, $recipient->user_id, 'messages', 'new_message' );
+
+		// Send email notifications to the recipients
+		messages_notification_new_message( array( 'message_id' => $message->id, 'sender_id' => $message->sender_id, 'subject' => $message->subject, 'content' => $message->message, 'recipients' => $message->recipients, 'thread_id' => $message->thread_id) );
+
+		do_action_ref_array( 'messages_message_sent', array( &$message ) );
+
+		return $message->thread_id;
+	}
+
+	return false;
+}
+
+
+function messages_send_notice( $subject, $message ) {
+	if ( !is_super_admin() || empty( $subject ) || empty( $message ) ) {
+		return false;
+
+	// Has access to send notices, lets do it.
+	} else {
+		$notice            = new BP_Messages_Notice;
+		$notice->subject   = $subject;
+		$notice->message   = $message;
+		$notice->date_sent = bp_core_current_time();
+		$notice->is_active = 1;
+		$notice->save(); // send it.
+
+		do_action_ref_array( 'messages_send_notice', array( $subject, $message ) );
+
+		return true;
+	}
+}
+
+function messages_delete_thread( $thread_ids ) {
+	do_action( 'messages_before_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]) )
+				$error = 1;
+		}
+
+		if ( !empty( $error ) )
+			return false;
+
+		do_action( 'messages_delete_thread', $thread_ids );
+
+		return true;
+	} else {
+		if ( !BP_Messages_Thread::delete( $thread_ids ) )
+			return false;
+
+		do_action( 'messages_delete_thread', $thread_ids );
+
+		return true;
+	}
+}
+
+function messages_check_thread_access( $thread_id, $user_id = 0 ) {
+	global $bp;
+
+	if ( empty( $user_id ) )
+		$user_id = $bp->loggedin_user->id;
+
+	return BP_Messages_Thread::check_access( $thread_id, $user_id );
+}
+
+function messages_mark_thread_read( $thread_id ) {
+	return BP_Messages_Thread::mark_as_read( $thread_id );
+}
+
+function messages_mark_thread_unread( $thread_id ) {
+	return BP_Messages_Thread::mark_as_unread( $thread_id );
+}
+
+function messages_add_callback_values( $recipients, $subject, $content ) {
+	@setcookie( 'bp_messages_send_to', $recipients, time() + 60 * 60 * 24, COOKIEPATH );
+	@setcookie( 'bp_messages_subject', $subject,    time() + 60 * 60 * 24, COOKIEPATH );
+	@setcookie( 'bp_messages_content', $content,    time() + 60 * 60 * 24, COOKIEPATH );
+}
+
+function messages_remove_callback_values() {
+	@setcookie( 'bp_messages_send_to', false, time() - 1000, COOKIEPATH );
+	@setcookie( 'bp_messages_subject', false, time() - 1000, COOKIEPATH );
+	@setcookie( 'bp_messages_content', false, time() - 1000, COOKIEPATH );
+}
+
+function messages_get_unread_count( $user_id = 0 ) {
+	global $bp;
+
+	if ( empty( $user_id ) )
+		$user_id = $bp->loggedin_user->id;
+
+	return BP_Messages_Thread::get_inbox_count( $user_id );
+}
+
+function messages_is_user_sender( $user_id, $message_id ) {
+	return BP_Messages_Message::is_user_sender( $user_id, $message_id );
+}
+
+function messages_get_message_sender( $message_id ) {
+	return BP_Messages_Message::get_message_sender( $message_id );
+}
+
+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
+ *
+ * @package BuddyPress
+ *
+ * @param str $action The kind of notification being rendered
+ * @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
+ */
+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';
+		$title = __( 'Inbox', 'buddypress' );
+
+		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 );
+			$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 );
+	} else {
+		$return = apply_filters( $filter, array(
+			'text' => $text,
+			'link' => $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
new file mode 100644
index 0000000000000000000000000000000000000000..ce6a2c6c98a1a6934e61cd2d5f888f29ccb85fa6
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-messages/bp-messages-loader.php
@@ -0,0 +1,257 @@
+<?php
+/**
+ * BuddyPress Private Messages Loader
+ *
+ * A private messages component, for users to send messages to each other
+ *
+ * @package BuddyPress
+ * @subpackage Messages Core
+ */
+
+// Exit if accessed directly
+if ( !defined( 'ABSPATH' ) ) exit;
+
+class BP_Messages_Component extends BP_Component {
+
+	/**
+	 * Start the messages component creation process
+	 *
+	 * @since 1.5
+	 */
+	function __construct() {
+		parent::start(
+			'messages',
+			__( 'Private Messages', 'buddypress' ),
+			BP_PLUGIN_DIR
+		);
+	}
+
+	/**
+	 * Include files
+	 */
+	function includes() {
+		// Files to include
+		$includes = array(
+			'cssjs',
+			'cache',
+			'actions',
+			'screens',
+			'classes',
+			'filters',
+			'template',
+			'functions',
+			'notifications'
+		);
+
+		parent::includes( $includes );
+	}
+
+	/**
+	 * Setup globals
+	 *
+	 * The BP_MESSAGES_SLUG constant is deprecated, and only used here for
+	 * backwards compatibility.
+	 *
+	 * @since 1.5
+	 * @global obj $bp
+	 */
+	function setup_globals() {
+		global $bp;
+
+		// Define a slug, if necessary
+		if ( !defined( 'BP_MESSAGES_SLUG' ) )
+			define( 'BP_MESSAGES_SLUG', $this->id );
+
+		// Global tables for messaging component
+		$global_tables = array(
+			'table_name_notices'    => $bp->table_prefix . 'bp_messages_notices',
+			'table_name_messages'   => $bp->table_prefix . 'bp_messages_messages',
+			'table_name_recipients' => $bp->table_prefix . 'bp_messages_recipients'
+		);
+
+		// 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',
+			'search_string'         => __( 'Search Messages...', 'buddypress' ),
+			'global_tables'         => $global_tables
+		);
+
+		$this->autocomplete_all = defined( 'BP_MESSAGES_AUTOCOMPLETE_ALL' );
+
+		parent::setup_globals( $globals );
+	}
+
+	/**
+	 * Setup BuddyBar navigation
+	 *
+	 * @global obj $bp
+	 */
+	function setup_nav() {
+		global $bp;
+
+		$name = sprintf( __( 'Messages <span>%s</span>', 'buddypress' ), bp_get_total_unread_messages_count() );
+
+		// Add 'Messages' to the main navigation
+		$main_nav = array(
+			'name'                    => $name,
+			'slug'                    => $this->slug,
+			'position'                => 50,
+			'show_for_displayed_user' => false,
+			'screen_function'         => 'messages_screen_inbox',
+			'default_subnav_slug'     => 'inbox',
+			'item_css_id'             => $this->id
+		);
+
+		// Link to user messages
+		$messages_link = trailingslashit( $bp->loggedin_user->domain . $this->slug );
+
+		// Add the subnav items to the profile
+		$sub_nav[] = array(
+			'name'            => __( 'Inbox', 'buddypress' ),
+			'slug'            => 'inbox',
+			'parent_url'      => $messages_link,
+			'parent_slug'     => $this->slug,
+			'screen_function' => 'messages_screen_inbox',
+			'position'        => 10,
+			'user_has_access' => bp_is_my_profile()
+		);
+
+		$sub_nav[] = array(
+			'name'            => __( 'Sent', 'buddypress' ),
+			'slug'            => 'sentbox',
+			'parent_url'      => $messages_link,
+			'parent_slug'     => $this->slug,
+			'screen_function' => 'messages_screen_sentbox',
+			'position'        => 20,
+			'user_has_access' => bp_is_my_profile()
+		);
+
+		$sub_nav[] = array(
+			'name'            => __( 'Compose', 'buddypress' ),
+			'slug'            => 'compose',
+			'parent_url'      => $messages_link,
+			'parent_slug'     => $this->slug,
+			'screen_function' => 'messages_screen_compose',
+			'position'        => 30,
+			'user_has_access' => bp_is_my_profile()
+		);
+
+		if ( is_super_admin() ) {
+			$sub_nav[] = array(
+				'name'            => __( 'Notices', 'buddypress' ),
+				'slug'            => 'notices',
+				'parent_url'      => $messages_link,
+				'parent_slug'     => $this->slug,
+				'screen_function' => 'messages_screen_notices',
+				'position'        => 90,
+				'user_has_access' => is_super_admin()
+			);
+		}
+
+		parent::setup_nav( $main_nav, $sub_nav );
+	}
+
+	/**
+	 * Set up the admin bar
+	 *
+	 * @global obj $bp
+	 */
+	function setup_admin_bar() {
+		global $bp;
+
+		// Prevent debug notices
+		$wp_admin_nav = array();
+
+		// Menus for logged in user
+		if ( is_user_logged_in() ) {
+
+			// Setup the logged in user variables
+			$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 );
+			} else {
+				$title = __( 'Messages', 'buddypress' );
+				$inbox = __( 'Inbox',    'buddypress' );
+			}
+
+			// Add main Messages menu
+			$wp_admin_nav[] = array(
+				'parent' => $bp->my_account_menu_id,
+				'id'     => 'my-account-' . $this->id,
+				'title'  => $title,
+				'href'   => trailingslashit( $messages_link )
+			);
+
+			// Inbox
+			$wp_admin_nav[] = array(
+				'parent' => 'my-account-' . $this->id,
+				'id'     => 'my-account-' . $this->id . '-inbox',
+				'title'  => $inbox,
+				'href'   => trailingslashit( $messages_link . 'inbox' )
+			);
+
+			// Sent Messages
+			$wp_admin_nav[] = array(
+				'parent' => 'my-account-' . $this->id,
+				'id'     => 'my-account-' . $this->id . '-sentbox',
+				'title'  => __( 'Sent', 'buddypress' ),
+				'href'   => trailingslashit( $messages_link . 'sentbox' )
+			);
+
+			// Compose Message
+			$wp_admin_nav[] = array(
+				'parent' => 'my-account-' . $this->id,
+				'id'     => 'my-account-' . $this->id . '-compose',
+				'title'  => __( 'Compose', 'buddypress' ),
+				'href'   => trailingslashit( $messages_link . 'compose' )
+			);
+
+			// Site Wide Notices
+			if ( is_super_admin() ) {
+				$wp_admin_nav[] = array(
+					'parent' => 'my-account-' . $this->id,
+					'id'     => 'my-account-' . $this->id . '-notices',
+					'title'  => __( 'All Member Notices', 'buddypress' ),
+					'href'   => trailingslashit( $messages_link . 'notices' )
+				);
+			}
+		}
+
+		parent::setup_admin_bar( $wp_admin_nav );
+	}
+
+	/**
+	 * Sets up the title for pages and <title>
+	 *
+	 * @global obj $bp
+	 */
+	function setup_title() {
+		global $bp;
+
+		if ( bp_is_messages_component() ) {
+			if ( bp_is_my_profile() ) {
+				$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'
+				) );
+				$bp->bp_options_title = $bp->displayed_user->fullname;
+			}
+		}
+
+		parent::setup_title();
+	}
+}
+// Create the messages component
+$bp->messages = new BP_Messages_Component();
+
+?>
\ 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 87c821314fca41fe69dfe11044ac336c3c351577..1e09b556d936f5036a8f91354a7357f325906b83 100644
--- a/wp-content/plugins/buddypress/bp-messages/bp-messages-notifications.php
+++ b/wp-content/plugins/buddypress/bp-messages/bp-messages-notifications.php
@@ -1,25 +1,32 @@
 <?php
+// Exit if accessed directly
+if ( !defined( 'ABSPATH' ) ) exit;
 
 function messages_notification_new_message( $args ) {
 	global $bp;
+
 	extract($args);
 
-	$sender_name = bp_core_get_user_displayname( $sender_id );
+	$email_subject = $email_content = $args = '';
+	$sender_name   = bp_core_get_user_displayname( $sender_id );
 
 	foreach( $recipients as $recipient ) {
-		if ( $sender_id == $recipient->user_id || 'no' == 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;
 
-		$ud = get_userdata( $recipient->user_id );
-		$message_link = bp_core_get_user_domain( $recipient->user_id ) . BP_MESSAGES_SLUG .'/';
-		$settings_link = bp_core_get_user_domain( $recipient->user_id ) .  BP_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_link = bp_core_get_user_domain( $recipient->user_id ) . bp_get_settings_slug() . '/notifications/';
 
-		$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_ROOT_BLOG, 'blogname' ), ENT_QUOTES );
+		$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( __(
@@ -36,13 +43,15 @@ To view and read your messages please log in and visit: %s
 
 		$email_content .= sprintf( __( 'To disable these notifications please log in and go to: %s', 'buddypress' ), $settings_link );
 
-		/* Send the message */
+		// 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 );
+		$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 );
 	}
+
+	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
new file mode 100644
index 0000000000000000000000000000000000000000..62a6f49e2d6f45915eea2a5cd1b1b69e9e6eea5f
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-messages/bp-messages-screens.php
@@ -0,0 +1,177 @@
+<?php
+/*******************************************************************************
+ * 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.
+ */
+
+// Exit if accessed directly
+if ( !defined( 'ABSPATH' ) ) exit;
+
+function messages_screen_inbox() {
+	global $bp;
+
+	if ( bp_action_variables() ) {
+		bp_do_404();
+		return;
+	}
+
+	do_action( 'messages_screen_inbox' );
+	bp_core_load_template( apply_filters( 'messages_template_inbox', 'members/single/home' ) );
+}
+
+function messages_screen_sentbox() {
+	global $bp;
+
+	if ( bp_action_variables() ) {
+		bp_do_404();
+		return;
+	}
+
+	do_action( 'messages_screen_sentbox' );
+	bp_core_load_template( apply_filters( 'messages_template_sentbox', 'members/single/home' ) );
+}
+
+function messages_screen_compose() {
+	global $bp;
+
+	if ( bp_action_variables() ) {
+		bp_do_404();
+		return;
+	}
+
+	// Remove any saved message data from a previous session.
+	messages_remove_callback_values();
+
+	// Check if the message form has been submitted
+	if ( isset( $_POST['send'] ) ) {
+
+		// Check the nonce
+		check_admin_referer( 'messages_send_message' );
+
+		// Check we have what we need
+		if ( empty( $_POST['subject'] ) || empty( $_POST['content'] ) ) {
+			bp_core_add_message( __( 'There was an error sending that message, please try again', 'buddypress' ), 'error' );
+		} else {
+			// If this is a notice, send it
+			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/' );
+				} else {
+					bp_core_add_message( __( 'There was an error sending that notice, please try again', 'buddypress' ), 'error' );
+				}
+			} else {
+				// Filter recipients into the format we need - array( 'username/userid', 'username/userid' )
+				$autocomplete_recipients = explode( ',', $_POST['send-to-input'] );
+				$typed_recipients        = explode( ' ', $_POST['send_to_usernames'] );
+				$recipients              = array_merge( (array) $autocomplete_recipients, (array) $typed_recipients );
+				$recipients              = apply_filters( 'bp_messages_recipients', $recipients );
+
+				// 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 . '/' );
+				} else {
+					bp_core_add_message( __( 'There was an error sending that message, please try again', 'buddypress' ), 'error' );
+				}
+			}
+		}
+	}
+
+	do_action( 'messages_screen_compose' );
+
+	bp_core_load_template( apply_filters( 'messages_template_compose', 'members/single/home' ) );
+}
+
+function messages_screen_notices() {
+	global $notice_id;
+
+	if ( !is_super_admin() )
+		return false;
+
+	$notice_id = (int)bp_action_variable( 1 );
+
+	if ( !empty( $notice_id ) && is_numeric( $notice_id ) ) {
+		$notice = new BP_Messages_Notice( $notice_id );
+
+		if ( bp_is_action_variable( 'deactivate', 0 ) ) {
+			if ( !$notice->deactivate() ) {
+				bp_core_add_message( __('There was a problem deactivating that notice.', 'buddypress'), 'error' );
+			} else {
+				bp_core_add_message( __('Notice deactivated.', 'buddypress') );
+			}
+		} else if ( bp_is_action_variable( 'activate', 0 ) ) {
+			if ( !$notice->activate() ) {
+				bp_core_add_message( __('There was a problem activating that notice.', 'buddypress'), 'error' );
+			} else {
+				bp_core_add_message( __('Notice activated.', 'buddypress') );
+			}
+		} else if ( bp_is_action_variable( 'delete' ) ) {
+			if ( !$notice->delete() ) {
+				bp_core_add_message( __('There was a problem deleting that notice.', 'buddypress'), 'buddypress' );
+			} else {
+				bp_core_add_message( __('Notice deleted.', 'buddypress') );
+			}
+		}
+		bp_core_redirect( bp_loggedin_user_domain() . bp_get_messages_slug() . '/notices' );
+	}
+
+	if ( bp_action_variables() ) {
+		bp_do_404();
+		return;
+	}
+
+	do_action( 'messages_screen_notices' );
+
+	bp_core_load_template( apply_filters( 'messages_template_notices', 'members/single/home' ) );
+}
+
+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 ) )
+		$new_messages = '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>
+			<tr>
+				<th class="icon"></th>
+				<th class="title"><?php _e( 'Messages', 'buddypress' ) ?></th>
+				<th class="yes"><?php _e( 'Yes', 'buddypress' ) ?></th>
+				<th class="no"><?php _e( 'No', 'buddypress' )?></th>
+			</tr>
+		</thead>
+
+		<tbody>
+			<tr id="messages-notification-settings-new-message">
+				<td></td>
+				<td><?php _e( 'A member sends you a new message', 'buddypress' ) ?></td>
+				<td class="yes"><input type="radio" name="notifications[notification_messages_new_message]" value="yes" <?php checked( $new_messages, 'yes', true ) ?>/></td>
+				<td class="no"><input type="radio" name="notifications[notification_messages_new_message]" value="no" <?php checked( $new_messages, 'no', true ) ?>/></td>
+			</tr>
+			<tr id="messages-notification-settings-new-site-notice">
+				<td></td>
+				<td><?php _e( 'A new site notice is posted', 'buddypress' ) ?></td>
+				<td class="yes"><input type="radio" name="notifications[notification_messages_new_notice]" value="yes" <?php checked( $new_notices, 'yes', true ) ?>/></td>
+				<td class="no"><input type="radio" name="notifications[notification_messages_new_notice]" value="no" <?php checked( $new_notices, 'no', true ) ?>/></td>
+			</tr>
+
+			<?php do_action( 'messages_screen_notification_settings' ) ?>
+		</tbody>
+	</table>
+
+<?php
+}
+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
new file mode 100644
index 0000000000000000000000000000000000000000..bbe812ce65edabfcad33987bb5001adead0003ce
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-messages/bp-messages-template.php
@@ -0,0 +1,884 @@
+<?php
+// Exit if accessed directly
+if ( !defined( 'ABSPATH' ) ) exit;
+
+/*****************************************************************************
+ * Message Box Template Class
+ **/
+Class BP_Messages_Box_Template {
+	var $current_thread = -1;
+	var $current_thread_count;
+	var $total_thread_count;
+	var $threads;
+	var $thread;
+
+	var $in_the_loop;
+	var $user_id;
+	var $box;
+
+	var $pag_page;
+	var $pag_num;
+	var $pag_links;
+
+	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;
+
+		$this->user_id  = $user_id;
+		$this->box      = $box;
+		$this->type     = $type;
+
+		if ( 'notices' == $this->box ) {
+			$this->threads = BP_Messages_Notice::get_notices();
+		} else {
+			$threads = BP_Messages_Thread::get_current_threads_for_user( $this->user_id, $this->box, $this->type, $this->pag_num, $this->pag_page );
+
+			$this->threads            = $threads['threads'];
+			$this->total_thread_count = $threads['total'];
+		}
+
+		if ( !$this->threads ) {
+			$this->thread_count       = 0;
+			$this->total_thread_count = 0;
+		} else {
+			$total_notice_count = BP_Messages_Notice::get_total_notice_count();
+
+			if ( !$max || $max >= (int)$total_notice_count ) {
+				if ( 'notices' == $this->box ) {
+					$this->total_thread_count = (int)$total_notice_count;
+				}
+			} else {
+				$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;
+				}
+			} else {
+				$this->thread_count = count( $this->threads );
+			}
+		}
+
+		if ( (int)$this->total_thread_count && (int)$this->pag_num ) {
+			$this->pag_links = paginate_links( array(
+				'base'      => add_query_arg( 'mpage', '%#%' ),
+				'format'    => '',
+				'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' ),
+				'mid_size'  => 1
+			) );
+		}
+	}
+
+	function has_threads() {
+		if ( $this->thread_count )
+			return true;
+
+		return false;
+	}
+
+	function next_thread() {
+		$this->current_thread++;
+		$this->thread = $this->threads[$this->current_thread];
+
+		return $this->thread;
+	}
+
+	function rewind_threads() {
+		$this->current_thread = -1;
+		if ( $this->thread_count > 0 ) {
+			$this->thread = $this->threads[0];
+		}
+	}
+
+	function message_threads() {
+		if ( $this->current_thread + 1 < $this->thread_count ) {
+			return true;
+		} elseif ( $this->current_thread + 1 == $this->thread_count ) {
+			do_action('messages_box_loop_end');
+			// Do some cleaning up after the loop
+			$this->rewind_threads();
+		}
+
+		$this->in_the_loop = false;
+		return false;
+	}
+
+	function the_message_thread() {
+		global $bp;
+
+		$this->in_the_loop = true;
+		$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 );
+
+			// 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 ) {
+							$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 ) {
+							$last_message_index = $key;
+							break;
+						}
+					}
+				}
+			}
+
+			$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
+			do_action('messages_box_loop_start');
+	}
+}
+
+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'
+	);
+
+	$r = wp_parse_args( $args, $defaults );
+	extract( $r, EXTR_SKIP );
+
+	if ( 'notices' == $bp->current_action && !is_super_admin() ) {
+		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 ( 'sentbox' == $bp->current_action )
+			$box = 'sentbox';
+
+		if ( 'notices' == $bp->current_action )
+			$box = 'notices';
+
+		$messages_template = new BP_Messages_Box_Template( $user_id, $box, $per_page, $max, $type );
+	}
+
+	return apply_filters( 'bp_has_message_threads', $messages_template->has_threads(), $messages_template );
+}
+
+function bp_message_threads() {
+	global $messages_template;
+	return $messages_template->message_threads();
+}
+
+function bp_message_thread() {
+	global $messages_template;
+	return $messages_template->the_message_thread();
+}
+
+function bp_message_thread_id() {
+	echo bp_get_message_thread_id();
+}
+	function bp_get_message_thread_id() {
+		global $messages_template;
+
+		return apply_filters( 'bp_get_message_thread_id', $messages_template->thread->thread_id );
+	}
+
+function bp_message_thread_subject() {
+	echo bp_get_message_thread_subject();
+}
+	function bp_get_message_thread_subject() {
+		global $messages_template, $message_template_subject;
+
+		return apply_filters( 'bp_get_message_thread_subject', stripslashes_deep( $messages_template->thread->last_message_subject ) );
+	}
+
+function bp_message_thread_excerpt() {
+	echo bp_get_message_thread_excerpt();
+}
+	function bp_get_message_thread_excerpt() {
+		global $messages_template;
+
+		return apply_filters( 'bp_get_message_thread_excerpt', strip_tags( bp_create_excerpt( $messages_template->thread->last_message_content, 75 ) ) );
+	}
+
+function bp_message_thread_from() {
+	echo bp_get_message_thread_from();
+}
+	function bp_get_message_thread_from() {
+		global $messages_template, $bp;
+
+		return apply_filters( 'bp_get_message_thread_from', bp_core_get_userlink( $messages_template->thread->last_sender_id ) );
+	}
+
+function bp_message_thread_to() {
+	echo bp_get_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) );
+	}
+
+function bp_message_thread_view_link() {
+	echo bp_get_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 ) );
+	}
+
+function bp_message_thread_delete_link() {
+	echo bp_get_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' ) );
+	}
+
+function bp_message_css_class() {
+	echo bp_get_message_css_class();
+}
+
+	function bp_get_message_css_class() {
+		global $messages_template;
+
+		$class = false;
+
+		if ( $messages_template->current_thread % 2 == 1 )
+			$class .= 'alt';
+
+		return apply_filters( 'bp_get_message_css_class', trim( $class ) );
+	}
+
+function bp_message_thread_has_unread() {
+	global $messages_template;
+
+	if ( $messages_template->thread->unread_count )
+		return true;
+
+	return false;
+}
+
+function bp_message_thread_unread_count() {
+	echo bp_get_message_thread_unread_count();
+}
+	function bp_get_message_thread_unread_count() {
+		global $messages_template;
+
+		if ( (int)$messages_template->thread->unread_count )
+			return apply_filters( 'bp_get_message_thread_unread_count', $messages_template->thread->unread_count );
+
+		return false;
+	}
+
+function bp_message_thread_last_post_date() {
+	echo bp_get_message_thread_last_post_date();
+}
+	function bp_get_message_thread_last_post_date() {
+		global $messages_template;
+
+		return apply_filters( 'bp_get_message_thread_last_post_date', bp_format_time( strtotime( $messages_template->thread->last_message_date ) ) );
+	}
+
+function bp_message_thread_avatar() {
+	echo bp_get_message_thread_avatar();
+}
+	function bp_get_message_thread_avatar() {
+		global $messages_template, $bp;
+
+		return apply_filters( 'bp_get_message_thread_avatar', bp_core_fetch_avatar( array( 'item_id' => $messages_template->thread->last_sender_id, 'type' => 'thumb' ) ) );
+	}
+
+function bp_message_thread_view() {
+	global $thread_id;
+
+	messages_view_thread($thread_id);
+}
+
+function bp_total_unread_messages_count() {
+	echo bp_get_total_unread_messages_count();
+}
+	function bp_get_total_unread_messages_count() {
+		return apply_filters( 'bp_get_total_unread_messages_count', BP_Messages_Thread::get_inbox_count() );
+	}
+
+function bp_messages_pagination() {
+	echo bp_get_messages_pagination();
+}
+	function bp_get_messages_pagination() {
+		global $messages_template;
+		return apply_filters( 'bp_get_messages_pagination', $messages_template->pag_links );
+	}
+
+function bp_messages_pagination_count() {
+	global $messages_template;
+
+	$start_num = intval( ( $messages_template->pag_page - 1 ) * $messages_template->pag_num ) + 1;
+	$from_num = bp_core_number_format( $start_num );
+	$to_num = bp_core_number_format( ( $start_num + ( $messages_template->pag_num - 1 ) > $messages_template->total_thread_count ) ? $messages_template->total_thread_count : $start_num + ( $messages_template->pag_num - 1 ) );
+	$total = bp_core_number_format( $messages_template->total_thread_count );
+
+	echo sprintf( __( 'Viewing message %1$s to %2$s (of %3$s messages)', 'buddypress' ), $from_num, $to_num, $total ); ?><?php
+}
+
+/**
+ * Echoes the form action for Messages HTML forms
+ *
+ * @package BuddyPress
+ */
+function bp_messages_form_action() {
+	echo bp_get_messages_form_action();
+}
+	/**
+	 * Returns the form action for Messages HTML forms
+	 *
+	 * @package BuddyPress
+	 *
+	 * @return str The form action
+	 */
+	function bp_get_messages_form_action() {
+		return apply_filters( 'bp_get_messages_form_action', trailingslashit( bp_loggedin_user_domain() . bp_get_messages_slug() . '/' . bp_current_action() . '/' . bp_action_variable( 0 ) ) );
+	}
+
+function bp_messages_username_value() {
+	echo bp_get_messages_username_value();
+}
+	function bp_get_messages_username_value() {
+		if ( isset( $_COOKIE['bp_messages_send_to'] ) ) {
+			return apply_filters( 'bp_get_messages_username_value', $_COOKIE['bp_messages_send_to'] );
+		} else if ( isset( $_GET['r'] ) && !isset( $_COOKIE['bp_messages_send_to'] ) ) {
+			return apply_filters( 'bp_get_messages_username_value', $_GET['r'] );
+		}
+	}
+
+function bp_messages_subject_value() {
+	echo bp_get_messages_subject_value();
+}
+	function bp_get_messages_subject_value() {
+		$subject = '';
+		if ( !empty( $_POST['subject'] ) )
+			$subject = $_POST['subject'];
+
+		return apply_filters( 'bp_get_messages_subject_value', $subject );
+	}
+
+function bp_messages_content_value() {
+	echo bp_get_messages_content_value();
+}
+	function bp_get_messages_content_value() {
+		$content = '';
+		if ( !empty( $_POST['content'] ) )
+			$content = $_POST['content'];
+
+		return apply_filters( 'bp_get_messages_content_value', $content );
+	}
+
+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' ) : ?>
+		<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;
+<?php
+}
+
+function bp_message_is_active_notice() {
+	global $messages_template;
+
+	if ( $messages_template->thread->is_active ) {
+		echo "<strong>";
+		_e( 'Currently Active', 'buddypress' );
+		echo "</strong>";
+	}
+}
+	function bp_get_message_is_active_notice() {
+		global $messages_template;
+
+		if ( $messages_template->thread->is_active )
+			return true;
+
+		return false;
+	}
+
+function bp_message_notice_id() {
+	echo bp_get_message_notice_id();
+}
+	function bp_get_message_notice_id() {
+		global $messages_template;
+		return apply_filters( 'bp_get_message_notice_id', $messages_template->thread->id );
+	}
+
+function bp_message_notice_post_date() {
+	echo bp_get_message_notice_post_date();
+}
+	function bp_get_message_notice_post_date() {
+		global $messages_template;
+		return apply_filters( 'bp_get_message_notice_post_date', bp_format_time( strtotime($messages_template->thread->date_sent) ) );
+	}
+
+function bp_message_notice_subject() {
+	echo bp_get_message_notice_subject();
+}
+	function bp_get_message_notice_subject() {
+		global $messages_template;
+		return apply_filters( 'bp_get_message_notice_subject', $messages_template->thread->subject );
+	}
+
+function bp_message_notice_text() {
+	echo bp_get_message_notice_text();
+}
+	function bp_get_message_notice_text() {
+		global $messages_template;
+		return apply_filters( 'bp_get_message_notice_text', $messages_template->thread->message );
+	}
+
+function bp_message_notice_delete_link() {
+	echo bp_get_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' ) );
+	}
+
+function bp_message_activate_deactivate_link() {
+	echo bp_get_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' );
+		} else {
+			$link = wp_nonce_url( $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 );
+	}
+
+function bp_message_activate_deactivate_text() {
+	echo bp_get_message_activate_deactivate_text();
+}
+	function bp_get_message_activate_deactivate_text() {
+		global $messages_template;
+
+		if ( 1 == (int)$messages_template->thread->is_active  ) {
+			$text = __('Deactivate', 'buddypress');
+		} else {
+			$text = __('Activate', 'buddypress');
+		}
+		return apply_filters( 'bp_message_activate_deactivate_text', $text );
+	}
+
+/**
+ * Output the messages component slug
+ *
+ * @package BuddyPress
+ * @subpackage Messages Template
+ * @since 1.5
+ *
+ * @uses bp_get_messages_slug()
+ */
+function bp_messages_slug() {
+	echo bp_get_messages_slug();
+}
+	/**
+	 * Return the messages component slug
+	 *
+	 * @package BuddyPress
+	 * @subpackage Messages Template
+	 * @since 1.5
+	 */
+	function bp_get_messages_slug() {
+		global $bp;
+		return apply_filters( 'bp_get_messages_slug', $bp->messages->slug );
+	}
+
+function bp_message_get_notices() {
+	global $userdata;
+
+	$notice = BP_Messages_Notice::get_active();
+
+	if ( empty( $notice ) )
+		return false;
+
+	$closed_notices = bp_get_user_meta( $userdata->ID, 'closed_notices', true );
+
+	if ( !$closed_notices )
+		$closed_notices = array();
+
+	if ( is_array($closed_notices) ) {
+		if ( !in_array( $notice->id, $closed_notices ) && $notice->id ) {
+			?>
+			<div id="message" class="info notice" rel="n-<?php echo $notice->id ?>">
+				<p>
+					<strong><?php echo stripslashes( wp_filter_kses( $notice->subject ) ) ?></strong><br />
+					<?php echo stripslashes( wp_filter_kses( $notice->message) ) ?>
+					<a href="#" id="close-notice"><?php _e( 'Close', 'buddypress' ) ?></a>
+				</p>
+			</div>
+			<?php
+		}
+	}
+}
+
+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 ) ) );
+	}
+
+/**
+ * bp_send_private_message_button()
+ *
+ * Explicitly named function to avoid confusion with public messages.
+ *
+ * @uses bp_get_send_message_button()
+ * @since 1.2.6
+ */
+function bp_send_private_message_button() {
+	echo bp_get_send_message_button();
+}
+
+function bp_send_message_button() {
+	echo bp_get_send_message_button();
+}
+	function bp_get_send_message_button() {
+		return apply_filters( 'bp_get_send_message_button',
+			bp_get_button( array(
+				'id'                => 'private_message',
+				'component'         => 'messages',
+				'must_be_logged_in' => true,
+				'block_self'        => true,
+				'wrapper_id'        => 'send-private-message',
+				'link_href'         => bp_get_send_private_message_link(),
+				'link_title'        => __( 'Send a private message to this user.', 'buddypress' ),
+				'link_text'         => __( 'Private Message', 'buddypress' ),
+				'link_class'        => 'send-message',
+			) )
+		);
+	}
+
+function bp_message_loading_image_src() {
+	echo bp_get_message_loading_image_src();
+}
+	function bp_get_message_loading_image_src() {
+		global $bp;
+		return apply_filters( 'bp_get_message_loading_image_src', $bp->messages->image_base . '/ajax-loader.gif' );
+	}
+
+function bp_message_get_recipient_tabs() {
+	$recipients = explode( ' ', bp_get_message_get_recipient_usernames() );
+
+	foreach ( $recipients as $recipient ) {
+		$user_id = bp_is_username_compatibility_mode() ? bp_core_get_userid( $recipient ) : bp_core_get_userid_from_nicename( $recipient );
+
+		if ( $user_id ) : ?>
+
+			<li id="un-<?php echo esc_attr( $recipient ); ?>" class="friend-tab">
+				<span><?php
+					echo bp_core_fetch_avatar( array( 'item_id' => $user_id, 'type' => 'thumb', 'width' => 15, 'height' => 15 ) );
+					echo bp_core_get_userlink( $user_id );
+				?></span>
+			</li>
+
+		<?php endif;
+	}
+}
+
+function bp_message_get_recipient_usernames() {
+	echo bp_get_message_get_recipient_usernames();
+}
+	function bp_get_message_get_recipient_usernames() {
+		$recipients = isset( $_GET['r'] ) ? stripslashes( $_GET['r'] ) : '';
+
+		return apply_filters( 'bp_get_message_get_recipient_usernames', $recipients );
+	}
+
+
+/*****************************************************************************
+ * Message Thread Template Class
+ **/
+
+class BP_Messages_Thread_Template {
+	var $current_message = -1;
+	var $message_count;
+	var $message;
+
+	var $thread;
+
+	var $in_the_loop;
+
+	var $pag_page;
+	var $pag_num;
+	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->message_count = count( $this->thread->messages );
+
+		$last_message_index = $this->message_count - 1;
+		$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;
+	}
+
+	function has_messages() {
+		if ( $this->message_count )
+			return true;
+
+		return false;
+	}
+
+	function next_message() {
+		$this->current_message++;
+		$this->message = $this->thread->messages[$this->current_message];
+
+		return $this->message;
+	}
+
+	function rewind_messages() {
+		$this->current_message = -1;
+		if ( $this->message_count > 0 ) {
+			$this->message = $this->thread->messages[0];
+		}
+	}
+
+	function messages() {
+		if ( $this->current_message + 1 < $this->message_count ) {
+			return true;
+		} elseif ( $this->current_message + 1 == $this->message_count ) {
+			do_action('thread_loop_end');
+			// Do some cleaning up after the loop
+			$this->rewind_messages();
+		}
+
+		$this->in_the_loop = false;
+		return false;
+	}
+
+	function the_message() {
+		global $message;
+
+		$this->in_the_loop = true;
+		$this->message = $this->next_message();
+
+		if ( 0 == $this->current_message ) // loop has just started
+			do_action('thread_loop_start');
+	}
+}
+
+function bp_thread_has_messages( $args = '' ) {
+	global $bp, $thread_template, $group_id;
+
+	$defaults = array(
+		'thread_id' => false,
+		'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 );
+
+	$thread_template = new BP_Messages_Thread_Template( $thread_id, $order );
+	return $thread_template->has_messages();
+}
+
+function bp_thread_messages_order() {
+	echo bp_get_thread_messages_order();
+}
+
+	function bp_get_thread_messages_order() {
+		global $thread_template;
+		return $thread_template->thread->messages_order;
+	}
+
+function bp_thread_messages() {
+	global $thread_template;
+
+	return $thread_template->messages();
+}
+
+function bp_thread_the_message() {
+	global $thread_template;
+
+	return $thread_template->the_message();
+}
+
+function bp_the_thread_id() {
+	echo bp_get_the_thread_id();
+}
+	function bp_get_the_thread_id() {
+		global $thread_template;
+
+		return apply_filters( 'bp_get_the_thread_id', $thread_template->thread->thread_id );
+	}
+
+function bp_the_thread_subject() {
+	echo bp_get_the_thread_subject();
+}
+	function bp_get_the_thread_subject() {
+		global $thread_template;
+
+		return apply_filters( 'bp_get_the_thread_subject', $thread_template->thread->last_message_subject );
+	}
+
+function bp_the_thread_recipients() {
+	echo bp_get_the_thread_recipients();
+}
+	function bp_get_the_thread_recipients() {
+		global $thread_template, $bp;
+
+		$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 );
+		}
+
+		return apply_filters( 'bp_get_the_thread_recipients', implode( ', ', $recipient_links ) );
+	}
+
+function bp_the_thread_message_alt_class() {
+	echo bp_get_the_thread_message_alt_class();
+}
+	function bp_get_the_thread_message_alt_class() {
+		global $thread_template;
+
+		if ( $thread_template->current_message % 2 == 1 )
+			$class = ' alt';
+		else
+			$class = '';
+
+		return apply_filters( 'bp_get_the_thread_message_alt_class', $class );
+	}
+
+function bp_the_thread_message_sender_avatar( $args = '' ) {
+	echo bp_get_the_thread_message_sender_avatar_thumb( $args );
+}
+	function bp_get_the_thread_message_sender_avatar_thumb( $args = '' ) {
+		global $thread_template;
+
+		$defaults = array(
+			'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 ) ) );
+	}
+
+function bp_the_thread_message_sender_link() {
+	echo bp_get_the_thread_message_sender_link();
+}
+	function bp_get_the_thread_message_sender_link() {
+		global $thread_template;
+
+		return apply_filters( 'bp_get_the_thread_message_sender_link', bp_core_get_userlink( $thread_template->message->sender_id, false, true ) );
+	}
+
+function bp_the_thread_message_sender_name() {
+	echo bp_get_the_thread_message_sender_name();
+}
+	function bp_get_the_thread_message_sender_name() {
+		global $thread_template;
+
+		return apply_filters( 'bp_get_the_thread_message_sender_name', bp_core_get_user_displayname( $thread_template->message->sender_id ) );
+	}
+
+function bp_the_thread_delete_link() {
+	echo bp_get_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' ) );
+	}
+
+function bp_the_thread_message_time_since() {
+	echo bp_get_the_thread_message_time_since();
+}
+	function bp_get_the_thread_message_time_since() {
+		global $thread_template;
+
+		return apply_filters( 'bp_get_the_thread_message_time_since', sprintf( __( 'Sent %s', 'buddypress' ), bp_core_time_since( strtotime( $thread_template->message->date_sent ) ) ) );
+	}
+
+function bp_the_thread_message_content() {
+	echo bp_get_the_thread_message_content();
+}
+	function bp_get_the_thread_message_content() {
+		global $thread_template;
+
+		return apply_filters( 'bp_get_the_thread_message_content', $thread_template->message->message );
+	}
+
+/** Embeds *******************************************************************/
+
+/**
+ * Enable oembed support for Messages.
+ *
+ * There's no caching as BP 1.5 does not have a Messages meta API.
+ *
+ * @see BP_Embed
+ * @since 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 467d362b504b026d741db7fc11b25eb39c9da0a6..51ad7112e74a2475506e977c7c1a2ceb41969c45 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,85 +1 @@
-.ac_results {
-	padding: 0px;
-	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: 0px;
-		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: 0.8em;
-			cursor: pointer;
-		}
-
-input#send-to-input { width: 275px !important; }
-
+.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/css/autocomplete/jquery.autocompletefb.dev.css b/wp-content/plugins/buddypress/bp-messages/css/autocomplete/jquery.autocompletefb.dev.css
new file mode 100644
index 0000000000000000000000000000000000000000..8006cc12c0dfc96363f0bb049bf7ab9c53520e04
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-messages/css/autocomplete/jquery.autocompletefb.dev.css
@@ -0,0 +1,85 @@
+.ac_results {
+	padding: 0px;
+	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: 0px;
+		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: 0.8em;
+			cursor: pointer;
+		}
+
+input#send-to-input { width: 275px; }
+
diff --git a/wp-content/plugins/buddypress/bp-messages/js/autocomplete/jquery.autocomplete.dev.js b/wp-content/plugins/buddypress/bp-messages/js/autocomplete/jquery.autocomplete.dev.js
new file mode 100644
index 0000000000000000000000000000000000000000..b3116293773e1e0a970c57eeca41fb8b3b6b659c
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-messages/js/autocomplete/jquery.autocomplete.dev.js
@@ -0,0 +1,730 @@
+/*!
+ * Autocomplete - jQuery plugin 1.0 Beta
+ *
+ * Copyright (c) 2007 Dylan Verheul, Dan G. Switzer, Anjesh Tuladhar, Jörn Zaefferer
+ *
+ * Dual licensed under the MIT and GPL licenses:
+ *   http://www.opensource.org/licenses/mit-license.php
+ *   http://www.gnu.org/licenses/gpl.html
+ *
+ * Revision: $Id: jquery.autocomplete.js 4485 2008-01-20 13:52:47Z joern.zaefferer $
+ *
+ */
+
+;(function($) {
+
+$.fn.extend({
+	autocomplete: function(urlOrData, options) {
+		var isUrl = typeof urlOrData == "string";
+		options = $.extend({}, $.Autocompleter.defaults, {
+			url: isUrl ? urlOrData : null,
+			data: isUrl ? null : urlOrData,
+			delay: isUrl ? $.Autocompleter.defaults.delay : 10,
+			max: options && !options.scroll ? 10 : 150
+		}, options);
+
+		// if highlight is set to false, replace it with a do-nothing function
+		options.highlight = options.highlight || function(value) { return value; };
+
+		return this.each(function() {
+			new $.Autocompleter(this, options);
+		});
+	},
+	result: function(handler) {
+		return this.bind("result", handler);
+	},
+	search: function(handler) {
+		return this.trigger("search", [handler]);
+	},
+	flushCache: function() {
+		return this.trigger("flushCache");
+	},
+	setOptions: function(options){
+		return this.trigger("setOptions", [options]);
+	},
+	unautocomplete: function() {
+		return this.trigger("unautocomplete");
+	}
+});
+
+$.Autocompleter = function(input, options) {
+
+	var KEY = {
+		UP: 38,
+		DOWN: 40,
+		DEL: 46,
+		TAB: 9,
+		RETURN: 13,
+		ESC: 27,
+		COMMA: 188,
+		PAGEUP: 33,
+		PAGEDOWN: 34
+	};
+
+	// Create $ object for input element
+	var $input = $(input).attr("autocomplete", "off").addClass(options.inputClass);
+
+	var timeout;
+	var previousValue = "";
+	var cache = $.Autocompleter.Cache(options);
+	var hasFocus = 0;
+	var lastKeyPressCode;
+	var config = {
+		mouseDownOnSelect: false
+	};
+	var select = $.Autocompleter.Select(options, input, selectCurrent, config);
+
+	$input.keydown(function(event) {
+		// track last key pressed
+		lastKeyPressCode = event.keyCode;
+		switch(event.keyCode) {
+
+			case KEY.UP:
+				event.preventDefault();
+				if ( select.visible() ) {
+					select.prev();
+				} else {
+					onChange(0, true);
+				}
+				break;
+
+			case KEY.DOWN:
+				event.preventDefault();
+				if ( select.visible() ) {
+					select.next();
+				} else {
+					onChange(0, true);
+				}
+				break;
+
+			case KEY.PAGEUP:
+				event.preventDefault();
+				if ( select.visible() ) {
+					select.pageUp();
+				} else {
+					onChange(0, true);
+				}
+				break;
+
+			case KEY.PAGEDOWN:
+				event.preventDefault();
+				if ( select.visible() ) {
+					select.pageDown();
+				} else {
+					onChange(0, true);
+				}
+				break;
+
+			// matches also semicolon
+			case options.multiple && $.trim(options.multipleSeparator) == "," && KEY.COMMA:
+			case KEY.TAB:
+			case KEY.RETURN:
+				if( selectCurrent() ){
+					// make sure to blur off the current field
+					if( !options.multiple )
+						$input.blur();
+					event.preventDefault();
+						$input.focus();
+				}
+				break;
+
+			case KEY.ESC:
+				select.hide();
+				break;
+
+			default:
+				clearTimeout(timeout);
+				timeout = setTimeout(onChange, options.delay);
+				break;
+		}
+	}).keypress(function() {
+		// having fun with opera - remove this binding and Opera submits the form when we select an entry via return
+	}).focus(function(){
+		// track whether the field has focus, we shouldn't process any
+		// results if the field no longer has focus
+		hasFocus++;
+	}).blur(function() {
+		hasFocus = 0;
+		if (!config.mouseDownOnSelect) {
+			hideResults();
+		}
+	}).click(function() {
+		// show select when clicking in a focused field
+		if ( hasFocus++ > 1 && !select.visible() ) {
+			onChange(0, true);
+		}
+	}).bind("search", function() {
+		// TODO why not just specifying both arguments?
+		var fn = (arguments.length > 1) ? arguments[1] : null;
+		function findValueCallback(q, data) {
+			var result;
+			if( data && data.length ) {
+				for (var i=0; i < data.length; i++) {
+					if( data[i].result.toLowerCase() == q.toLowerCase() ) {
+						result = data[i];
+						break;
+					}
+				}
+			}
+			if( typeof fn == "function" ) fn(result);
+			else $input.trigger("result", result && [result.data, result.value]);
+		}
+		$.each(trimWords($input.val()), function(i, value) {
+			request(value, findValueCallback, findValueCallback);
+		});
+	}).bind("flushCache", function() {
+		cache.flush();
+	}).bind("setOptions", function() {
+		$.extend(options, arguments[1]);
+		// if we've updated the data, repopulate
+		if ( "data" in arguments[1] )
+			cache.populate();
+	}).bind("unautocomplete", function() {
+		select.unbind();
+		$input.unbind();
+	});
+
+
+	function selectCurrent() {
+		var selected = select.selected();
+		if( !selected )
+			return false;
+
+		var v = selected.result;
+		previousValue = v;
+
+		if ( options.multiple ) {
+			var words = trimWords($input.val());
+			if ( words.length > 1 ) {
+				v = words.slice(0, words.length - 1).join( options.multipleSeparator ) + options.multipleSeparator + v;
+			}
+			v += options.multipleSeparator;
+		}
+
+		$input.val(v);
+		hideResultsNow();
+		$input.trigger("result", [selected.data, selected.value]);
+		return true;
+	}
+
+	function onChange(crap, skipPrevCheck) {
+		if( lastKeyPressCode == KEY.DEL ) {
+			select.hide();
+			return;
+		}
+
+		var currentValue = $input.val();
+
+		if ( !skipPrevCheck && currentValue == previousValue )
+			return;
+
+		previousValue = currentValue;
+
+		currentValue = lastWord(currentValue);
+		if ( currentValue.length >= options.minChars) {
+			$input.addClass(options.loadingClass);
+			jQuery('#send-to-input').addClass('loading');
+			if (!options.matchCase)
+				currentValue = currentValue.toLowerCase();
+			request(currentValue, receiveData, hideResultsNow);
+		} else {
+			stopLoading();
+			select.hide();
+		}
+	};
+
+	function trimWords(value) {
+		if ( !value ) {
+			return [""];
+		}
+		var words = value.split( $.trim( options.multipleSeparator ) );
+		var result = [];
+		$.each(words, function(i, value) {
+			if ( $.trim(value) )
+				result[i] = $.trim(value);
+		});
+		return result;
+	}
+
+	function lastWord(value) {
+		if ( !options.multiple )
+			return value;
+		var words = trimWords(value);
+		return words[words.length - 1];
+	}
+
+	// fills in the input box w/the first match (assumed to be the best match)
+	function autoFill(q, sValue){
+		// autofill in the complete box w/the first match as long as the user hasn't entered in more data
+		// if the last user key pressed was backspace, don't autofill
+		if( options.autoFill && (lastWord($input.val()).toLowerCase() == q.toLowerCase()) && lastKeyPressCode != 8 ) {
+			// fill in the value (keep the case the user has typed)
+			$input.val($input.val() + sValue.substring(lastWord(previousValue).length));
+			// select the portion of the value not typed by the user (so the next character will erase)
+			$.Autocompleter.Selection(input, previousValue.length, previousValue.length + sValue.length);
+		}
+	};
+
+	function hideResults() {
+		clearTimeout(timeout);
+		timeout = setTimeout(hideResultsNow, 200);
+	};
+
+	function hideResultsNow() {
+		select.hide();
+		clearTimeout(timeout);
+		stopLoading();
+		if (options.mustMatch) {
+			// call search and run callback
+			$input.search(
+				function (result){
+					// if no value found, clear the input box
+					if( !result ) $input.val("");
+				}
+			);
+		}
+	};
+
+	function receiveData(q, data) {
+		if ( data && data.length && hasFocus ) {
+			stopLoading();
+			select.display(data, q);
+
+			var newData = data[0].value.split(';');
+			data.value = newData[0];
+
+			autoFill(q, data.value);
+			select.show();
+		} else {
+			hideResultsNow();
+		}
+	};
+
+	function request(term, success, failure) {
+		if (!options.matchCase)
+			term = term.toLowerCase();
+		var data = cache.load(term);
+		// recieve the cached data
+		if (data && data.length) {
+			success(term, data);
+		// if an AJAX url has been supplied, try loading the data now
+		} else if( (typeof options.url == "string") && (options.url.length > 0) ){
+
+			var extraParams = {};
+			$.each(options.extraParams, function(key, param) {
+				extraParams[key] = typeof param == "function" ? param() : param;
+			});
+
+			$.ajax({
+				// try to leverage ajaxQueue plugin to abort previous requests
+				mode: "abort",
+				// limit abortion to this input
+				port: "autocomplete" + input.name,
+				dataType: options.dataType,
+				url: options.url,
+				data: $.extend({
+					q: lastWord(term),
+					limit: options.max,
+					action: 'messages_autocomplete_results',
+					'cookie': encodeURIComponent(document.cookie)
+				}, extraParams),
+				success: function(data) {
+					var parsed = options.parse && options.parse(data) || parse(data);
+					cache.add(term, parsed);
+					success(term, parsed);
+				}
+			});
+		} else {
+			failure(term);
+		}
+	};
+
+	function parse(data) {
+		var parsed = [];
+		var rows = data.split("\n");
+		for (var i=0; i < rows.length; i++) {
+			var row = $.trim(rows[i]);
+			if (row) {
+				row = row.split("|");
+				parsed[parsed.length] = {
+					data: row,
+					value: row[0],
+					result: options.formatResult && options.formatResult(row, row[0]) || row[0]
+				};
+			}
+		}
+		return parsed;
+	};
+
+	function stopLoading() {
+		$input.removeClass(options.loadingClass);
+		jQuery('#send-to-input').removeClass('loading');
+	};
+
+};
+
+$.Autocompleter.defaults = {
+	inputClass: "ac_input",
+	resultsClass: "ac_results",
+	loadingClass: "ac_loading",
+	minChars: 1,
+	delay: 400,
+	matchCase: false,
+	matchSubset: true,
+	matchContains: false,
+	cacheLength: 10,
+	max: 100,
+	mustMatch: false,
+	extraParams: {},
+	selectFirst: true,
+	formatItem: function(row) { return row[0]; },
+	autoFill: false,
+	width: 0,
+	multiple: false,
+	multipleSeparator: ", ",
+	highlight: function(value, term) {
+		return value.replace(new RegExp("(?![^&;]+;)(?!<[^<>]*)(" + term.replace(/([\^\$\(\)\[\]\{\}\*\.\+\?\|\\])/gi, "\\$1") + ")(?![^<>]*>)(?![^&;]+;)", "gi"), "<strong>$1</strong>");
+	},
+    scroll: true,
+    scrollHeight: 250,
+	attachTo: 'body'
+};
+
+$.Autocompleter.Cache = function(options) {
+
+	var data = {};
+	var length = 0;
+
+	function matchSubset(s, sub) {
+		if (!options.matchCase)
+			s = s.toLowerCase();
+		var i = s.indexOf(sub);
+		if (i == -1) return false;
+		return i == 0 || options.matchContains;
+	};
+
+	function add(q, value) {
+		if (length > options.cacheLength){
+			flush();
+		}
+		if (!data[q]){
+			length++;
+		}
+		data[q] = value;
+	}
+
+	function populate(){
+		if( !options.data ) return false;
+		// track the matches
+		var stMatchSets = {},
+			nullData = 0;
+
+		// no url was specified, we need to adjust the cache length to make sure it fits the local data store
+		if( !options.url ) options.cacheLength = 1;
+
+		// track all options for minChars = 0
+		stMatchSets[""] = [];
+
+		// loop through the array and create a lookup structure
+		for ( var i = 0, ol = options.data.length; i < ol; i++ ) {
+			var rawValue = options.data[i];
+			// if rawValue is a string, make an array otherwise just reference the array
+			rawValue = (typeof rawValue == "string") ? [rawValue] : rawValue;
+
+			var value = options.formatItem(rawValue, i+1, options.data.length);
+			if ( value === false )
+				continue;
+
+			var firstChar = value.charAt(0).toLowerCase();
+			// if no lookup array for this character exists, look it up now
+			if( !stMatchSets[firstChar] )
+				stMatchSets[firstChar] = [];
+
+			// if the match is a string
+			var row = {
+				value: value,
+				data: rawValue,
+				result: options.formatResult && options.formatResult(rawValue) || value
+			};
+
+			// push the current match into the set list
+			stMatchSets[firstChar].push(row);
+
+			// keep track of minChars zero items
+			if ( nullData++ < options.max ) {
+				stMatchSets[""].push(row);
+			}
+		};
+
+		// add the data items to the cache
+		$.each(stMatchSets, function(i, value) {
+			// increase the cache size
+			options.cacheLength++;
+			// add to the cache
+			add(i, value);
+		});
+	}
+
+	// populate any existing data
+	setTimeout(populate, 25);
+
+	function flush(){
+		data = {};
+		length = 0;
+	}
+
+	return {
+		flush: flush,
+		add: add,
+		populate: populate,
+		load: function(q) {
+			if (!options.cacheLength || !length)
+				return null;
+			/*
+			 * if dealing w/local data and matchContains than we must make sure
+			 * to loop through all the data collections looking for matches
+			 */
+			if( !options.url && options.matchContains ){
+				// track all matches
+				var csub = [];
+				// loop through all the data grids for matches
+				for( var k in data ){
+					// don't search through the stMatchSets[""] (minChars: 0) cache
+					// this prevents duplicates
+					if( k.length > 0 ){
+						var c = data[k];
+						$.each(c, function(i, x) {
+							// if we've got a match, add it to the array
+							if (matchSubset(x.value, q)) {
+								csub.push(x);
+							}
+						});
+					}
+				}
+				return csub;
+			} else
+			// if the exact item exists, use it
+			if (data[q]){
+				return data[q];
+			} else
+			if (options.matchSubset) {
+				for (var i = q.length - 1; i >= options.minChars; i--) {
+					var c = data[q.substr(0, i)];
+					if (c) {
+						var csub = [];
+						$.each(c, function(i, x) {
+							if (matchSubset(x.value, q)) {
+								csub[csub.length] = x;
+							}
+						});
+						return csub;
+					}
+				}
+			}
+			return null;
+		}
+	};
+};
+
+$.Autocompleter.Select = function (options, input, select, config) {
+	var CLASSES = {
+		ACTIVE: "ac_over"
+	};
+
+	var listItems,
+		active = -1,
+		data,
+		term = "",
+		needsInit = true,
+		element,
+		list;
+
+	// Create results
+	function init() {
+		if (!needsInit)
+			return;
+		element = $("<div/>")
+		.hide()
+		.addClass(options.resultsClass)
+		.css("position", "absolute")
+		.appendTo(options.attachTo);
+
+		list = $("<ul>").appendTo(element).mouseover( function(event) {
+			if(target(event).nodeName && target(event).nodeName.toUpperCase() == 'LI') {
+	            active = $("li", list).removeClass(CLASSES.ACTIVE).index(target(event));
+			    $(target(event)).addClass(CLASSES.ACTIVE);
+	        }
+		}).click(function(event) {
+			$(target(event)).addClass(CLASSES.ACTIVE);
+			select();
+			input.focus();
+			return false;
+		}).mousedown(function() {
+			config.mouseDownOnSelect = true;
+		}).mouseup(function() {
+			config.mouseDownOnSelect = false;
+		});
+
+		if( options.width > 0 )
+			element.css("width", options.width);
+
+		needsInit = false;
+	}
+
+	function target(event) {
+		var element = event.target;
+		while(element && element.tagName != "LI")
+			element = element.parentNode;
+		// more fun with IE, sometimes event.target is empty, just ignore it then
+		if(!element)
+			return [];
+		return element;
+	}
+
+	function moveSelect(step) {
+		listItems.slice(active, active + 1).removeClass();
+		movePosition(step);
+        var activeItem = listItems.slice(active, active + 1).addClass(CLASSES.ACTIVE);
+        if(options.scroll) {
+            var offset = 0;
+            listItems.slice(0, active).each(function() {
+				offset += this.offsetHeight;
+			});
+            if((offset + activeItem[0].offsetHeight - list.scrollTop()) > list[0].clientHeight) {
+                list.scrollTop(offset + activeItem[0].offsetHeight - list.innerHeight());
+            } else if(offset < list.scrollTop()) {
+                list.scrollTop(offset);
+            }
+        }
+	};
+
+	function movePosition(step) {
+		active += step;
+		if (active < 0) {
+			active = listItems.size() - 1;
+		} else if (active >= listItems.size()) {
+			active = 0;
+		}
+	}
+
+	function limitNumberOfItems(available) {
+		return options.max && options.max < available
+			? options.max
+			: available;
+	}
+
+	function fillList() {
+		list.empty();
+		var max = limitNumberOfItems(data.length);
+		for (var i=0; i < max; i++) {
+			if (!data[i])
+				continue;
+			var formatted = options.formatItem(data[i].data, i+1, max, data[i].value, term);
+			if ( formatted === false )
+				continue;
+			var li = $("<li>").html( options.highlight(formatted, term) ).addClass(i%2 == 0 ? "ac_event" : "ac_odd").appendTo(list)[0];
+			$.data(li, "ac_data", data[i]);
+		}
+		listItems = list.find("li");
+		if ( options.selectFirst ) {
+			listItems.slice(0, 1).addClass(CLASSES.ACTIVE);
+			active = 0;
+		}
+		list.bgiframe();
+	}
+
+	return {
+		display: function(d, q) {
+			init();
+			data = d;
+			term = q;
+			fillList();
+		},
+		next: function() {
+			moveSelect(1);
+		},
+		prev: function() {
+			moveSelect(-1);
+		},
+		pageUp: function() {
+			if (active != 0 && active - 8 < 0) {
+				moveSelect( -active );
+			} else {
+				moveSelect(-8);
+			}
+		},
+		pageDown: function() {
+			if (active != listItems.size() - 1 && active + 8 > listItems.size()) {
+				moveSelect( listItems.size() - 1 - active );
+			} else {
+				moveSelect(8);
+			}
+		},
+		hide: function() {
+			element && element.hide();
+			active = -1;
+		},
+		visible : function() {
+			return element && element.is(":visible");
+		},
+		current: function() {
+			return this.visible() && (listItems.filter("." + CLASSES.ACTIVE)[0] || options.selectFirst && listItems[0]);
+		},
+		show: function() {
+			var offset = $(input).offset();
+			element.css({
+				width: typeof options.width == "string" || options.width > 0 ? options.width : $(input).width(),
+				top: offset.top + input.offsetHeight,
+				left: offset.left
+			}).show();
+            if(options.scroll) {
+                list.scrollTop(0);
+                list.css({
+					maxHeight: options.scrollHeight,
+					overflow: 'auto'
+				});
+
+                if($.browser.msie && typeof document.body.style.maxHeight === "undefined") {
+					var listHeight = 0;
+					listItems.each(function() {
+						listHeight += this.offsetHeight;
+					});
+					var scrollbarsVisible = listHeight > options.scrollHeight;
+                    list.css('height', scrollbarsVisible ? options.scrollHeight : listHeight );
+					if (!scrollbarsVisible) {
+						// IE doesn't recalculate width when scrollbar disappears
+						listItems.width( list.width() - parseInt(listItems.css("padding-left")) - parseInt(listItems.css("padding-right")) );
+					}
+                }
+
+            }
+		},
+		selected: function() {
+			var selected = listItems && listItems.filter("." + CLASSES.ACTIVE).removeClass(CLASSES.ACTIVE);
+			return selected && selected.length && $.data(selected[0], "ac_data");
+		},
+		unbind: function() {
+			element && element.remove();
+		}
+	};
+};
+
+$.Autocompleter.Selection = function(field, start, end) {
+	if( field.createTextRange ){
+		var selRange = field.createTextRange();
+		selRange.collapse(true);
+		selRange.moveStart("character", start);
+		selRange.moveEnd("character", end);
+		selRange.select();
+	} else if( field.setSelectionRange ){
+		field.setSelectionRange(start, end);
+	} else {
+		if( field.selectionStart ){
+			field.selectionStart = start;
+			field.selectionEnd = end;
+		}
+	}
+	field.focus();
+};
+
+})(jQuery);
\ 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 1d9aee445c920c4a3eccce3849531130d1352753..4192cb76b5ebc4ed82803b18dc4552d29bcdb05b 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
@@ -10,721 +10,4 @@
  * Revision: $Id: jquery.autocomplete.js 4485 2008-01-20 13:52:47Z joern.zaefferer $
  *
  */
-
-;(function($) {
-
-$.fn.extend({
-	autocomplete: function(urlOrData, options) {
-		var isUrl = typeof urlOrData == "string";
-		options = $.extend({}, $.Autocompleter.defaults, {
-			url: isUrl ? urlOrData : null,
-			data: isUrl ? null : urlOrData,
-			delay: isUrl ? $.Autocompleter.defaults.delay : 10,
-			max: options && !options.scroll ? 10 : 150
-		}, options);
-
-		// if highlight is set to false, replace it with a do-nothing function
-		options.highlight = options.highlight || function(value) { return value; };
-
-		return this.each(function() {
-			new $.Autocompleter(this, options);
-		});
-	},
-	result: function(handler) {
-		return this.bind("result", handler);
-	},
-	search: function(handler) {
-		return this.trigger("search", [handler]);
-	},
-	flushCache: function() {
-		return this.trigger("flushCache");
-	},
-	setOptions: function(options){
-		return this.trigger("setOptions", [options]);
-	},
-	unautocomplete: function() {
-		return this.trigger("unautocomplete");
-	}
-});
-
-$.Autocompleter = function(input, options) {
-
-	var KEY = {
-		UP: 38,
-		DOWN: 40,
-		DEL: 46,
-		TAB: 9,
-		RETURN: 13,
-		ESC: 27,
-		COMMA: 188,
-		PAGEUP: 33,
-		PAGEDOWN: 34
-	};
-
-	// Create $ object for input element
-	var $input = $(input).attr("autocomplete", "off").addClass(options.inputClass);
-
-	var timeout;
-	var previousValue = "";
-	var cache = $.Autocompleter.Cache(options);
-	var hasFocus = 0;
-	var lastKeyPressCode;
-	var config = {
-		mouseDownOnSelect: false
-	};
-	var select = $.Autocompleter.Select(options, input, selectCurrent, config);
-
-	$input.keydown(function(event) {
-		// track last key pressed
-		lastKeyPressCode = event.keyCode;
-		switch(event.keyCode) {
-
-			case KEY.UP:
-				event.preventDefault();
-				if ( select.visible() ) {
-					select.prev();
-				} else {
-					onChange(0, true);
-				}
-				break;
-
-			case KEY.DOWN:
-				event.preventDefault();
-				if ( select.visible() ) {
-					select.next();
-				} else {
-					onChange(0, true);
-				}
-				break;
-
-			case KEY.PAGEUP:
-				event.preventDefault();
-				if ( select.visible() ) {
-					select.pageUp();
-				} else {
-					onChange(0, true);
-				}
-				break;
-
-			case KEY.PAGEDOWN:
-				event.preventDefault();
-				if ( select.visible() ) {
-					select.pageDown();
-				} else {
-					onChange(0, true);
-				}
-				break;
-
-			// matches also semicolon
-			case options.multiple && $.trim(options.multipleSeparator) == "," && KEY.COMMA:
-			case KEY.TAB:
-			case KEY.RETURN:
-				if( selectCurrent() ){
-					// make sure to blur off the current field
-					if( !options.multiple )
-						$input.blur();
-					event.preventDefault();
-						$input.focus();
-				}
-				break;
-
-			case KEY.ESC:
-				select.hide();
-				break;
-
-			default:
-				clearTimeout(timeout);
-				timeout = setTimeout(onChange, options.delay);
-				break;
-		}
-	}).keypress(function() {
-		// having fun with opera - remove this binding and Opera submits the form when we select an entry via return
-	}).focus(function(){
-		// track whether the field has focus, we shouldn't process any
-		// results if the field no longer has focus
-		hasFocus++;
-	}).blur(function() {
-		hasFocus = 0;
-		if (!config.mouseDownOnSelect) {
-			hideResults();
-		}
-	}).click(function() {
-		// show select when clicking in a focused field
-		if ( hasFocus++ > 1 && !select.visible() ) {
-			onChange(0, true);
-		}
-	}).bind("search", function() {
-		// TODO why not just specifying both arguments?
-		var fn = (arguments.length > 1) ? arguments[1] : null;
-		function findValueCallback(q, data) {
-			var result;
-			if( data && data.length ) {
-				for (var i=0; i < data.length; i++) {
-					if( data[i].result.toLowerCase() == q.toLowerCase() ) {
-						result = data[i];
-						break;
-					}
-				}
-			}
-			if( typeof fn == "function" ) fn(result);
-			else $input.trigger("result", result && [result.data, result.value]);
-		}
-		$.each(trimWords($input.val()), function(i, value) {
-			request(value, findValueCallback, findValueCallback);
-		});
-	}).bind("flushCache", function() {
-		cache.flush();
-	}).bind("setOptions", function() {
-		$.extend(options, arguments[1]);
-		// if we've updated the data, repopulate
-		if ( "data" in arguments[1] )
-			cache.populate();
-	}).bind("unautocomplete", function() {
-		select.unbind();
-		$input.unbind();
-	});
-
-
-	function selectCurrent() {
-		var selected = select.selected();
-		if( !selected )
-			return false;
-
-		var v = selected.result;
-		previousValue = v;
-
-		if ( options.multiple ) {
-			var words = trimWords($input.val());
-			if ( words.length > 1 ) {
-				v = words.slice(0, words.length - 1).join( options.multipleSeparator ) + options.multipleSeparator + v;
-			}
-			v += options.multipleSeparator;
-		}
-
-		$input.val(v);
-		hideResultsNow();
-		$input.trigger("result", [selected.data, selected.value]);
-		return true;
-	}
-
-	function onChange(crap, skipPrevCheck) {
-		if( lastKeyPressCode == KEY.DEL ) {
-			select.hide();
-			return;
-		}
-
-		var currentValue = $input.val();
-
-		if ( !skipPrevCheck && currentValue == previousValue )
-			return;
-
-		previousValue = currentValue;
-
-		currentValue = lastWord(currentValue);
-		if ( currentValue.length >= options.minChars) {
-			$input.addClass(options.loadingClass);
-			jQuery('.ajax-loader').show();
-			if (!options.matchCase)
-				currentValue = currentValue.toLowerCase();
-			request(currentValue, receiveData, hideResultsNow);
-		} else {
-			stopLoading();
-			select.hide();
-		}
-	};
-
-	function trimWords(value) {
-		if ( !value ) {
-			return [""];
-		}
-		var words = value.split( $.trim( options.multipleSeparator ) );
-		var result = [];
-		$.each(words, function(i, value) {
-			if ( $.trim(value) )
-				result[i] = $.trim(value);
-		});
-		return result;
-	}
-
-	function lastWord(value) {
-		if ( !options.multiple )
-			return value;
-		var words = trimWords(value);
-		return words[words.length - 1];
-	}
-
-	// fills in the input box w/the first match (assumed to be the best match)
-	function autoFill(q, sValue){
-		// autofill in the complete box w/the first match as long as the user hasn't entered in more data
-		// if the last user key pressed was backspace, don't autofill
-		if( options.autoFill && (lastWord($input.val()).toLowerCase() == q.toLowerCase()) && lastKeyPressCode != 8 ) {
-			// fill in the value (keep the case the user has typed)
-			$input.val($input.val() + sValue.substring(lastWord(previousValue).length));
-			// select the portion of the value not typed by the user (so the next character will erase)
-			$.Autocompleter.Selection(input, previousValue.length, previousValue.length + sValue.length);
-		}
-	};
-
-	function hideResults() {
-		clearTimeout(timeout);
-		timeout = setTimeout(hideResultsNow, 200);
-	};
-
-	function hideResultsNow() {
-		select.hide();
-		clearTimeout(timeout);
-		stopLoading();
-		if (options.mustMatch) {
-			// call search and run callback
-			$input.search(
-				function (result){
-					// if no value found, clear the input box
-					if( !result ) $input.val("");
-				}
-			);
-		}
-	};
-
-	function receiveData(q, data) {
-		if ( data && data.length && hasFocus ) {
-			stopLoading();
-			select.display(data, q);
-
-			var newData = data[0].value.split(';');
-			data.value = newData[0];
-
-			autoFill(q, data.value);
-			select.show();
-		} else {
-			hideResultsNow();
-		}
-	};
-
-	function request(term, success, failure) {
-		if (!options.matchCase)
-			term = term.toLowerCase();
-		var data = cache.load(term);
-		// recieve the cached data
-		if (data && data.length) {
-			success(term, data);
-		// if an AJAX url has been supplied, try loading the data now
-		} else if( (typeof options.url == "string") && (options.url.length > 0) ){
-
-			var extraParams = {};
-			$.each(options.extraParams, function(key, param) {
-				extraParams[key] = typeof param == "function" ? param() : param;
-			});
-
-			$.ajax({
-				// try to leverage ajaxQueue plugin to abort previous requests
-				mode: "abort",
-				// limit abortion to this input
-				port: "autocomplete" + input.name,
-				dataType: options.dataType,
-				url: options.url,
-				data: $.extend({
-					q: lastWord(term),
-					limit: options.max,
-					action: 'messages_autocomplete_results',
-					'cookie': encodeURIComponent(document.cookie)
-				}, extraParams),
-				success: function(data) {
-					var parsed = options.parse && options.parse(data) || parse(data);
-					cache.add(term, parsed);
-					success(term, parsed);
-				}
-			});
-		} else {
-			failure(term);
-		}
-	};
-
-	function parse(data) {
-		var parsed = [];
-		var rows = data.split("\n");
-		for (var i=0; i < rows.length; i++) {
-			var row = $.trim(rows[i]);
-			if (row) {
-				row = row.split("|");
-				parsed[parsed.length] = {
-					data: row,
-					value: row[0],
-					result: options.formatResult && options.formatResult(row, row[0]) || row[0]
-				};
-			}
-		}
-		return parsed;
-	};
-
-	function stopLoading() {
-		$input.removeClass(options.loadingClass);
-		jQuery('.ajax-loader').hide();
-	};
-
-};
-
-$.Autocompleter.defaults = {
-	inputClass: "ac_input",
-	resultsClass: "ac_results",
-	loadingClass: "ac_loading",
-	minChars: 1,
-	delay: 400,
-	matchCase: false,
-	matchSubset: true,
-	matchContains: false,
-	cacheLength: 10,
-	max: 100,
-	mustMatch: false,
-	extraParams: {},
-	selectFirst: true,
-	formatItem: function(row) { return row[0]; },
-	autoFill: false,
-	width: 0,
-	multiple: false,
-	multipleSeparator: ", ",
-	highlight: function(value, term) {
-		return value.replace(new RegExp("(?![^&;]+;)(?!<[^<>]*)(" + term.replace(/([\^\$\(\)\[\]\{\}\*\.\+\?\|\\])/gi, "\\$1") + ")(?![^<>]*>)(?![^&;]+;)", "gi"), "<strong>$1</strong>");
-	},
-    scroll: true,
-    scrollHeight: 250,
-	attachTo: 'body'
-};
-
-$.Autocompleter.Cache = function(options) {
-
-	var data = {};
-	var length = 0;
-
-	function matchSubset(s, sub) {
-		if (!options.matchCase)
-			s = s.toLowerCase();
-		var i = s.indexOf(sub);
-		if (i == -1) return false;
-		return i == 0 || options.matchContains;
-	};
-
-	function add(q, value) {
-		if (length > options.cacheLength){
-			flush();
-		}
-		if (!data[q]){
-			length++;
-		}
-		data[q] = value;
-	}
-
-	function populate(){
-		if( !options.data ) return false;
-		// track the matches
-		var stMatchSets = {},
-			nullData = 0;
-
-		// no url was specified, we need to adjust the cache length to make sure it fits the local data store
-		if( !options.url ) options.cacheLength = 1;
-
-		// track all options for minChars = 0
-		stMatchSets[""] = [];
-
-		// loop through the array and create a lookup structure
-		for ( var i = 0, ol = options.data.length; i < ol; i++ ) {
-			var rawValue = options.data[i];
-			// if rawValue is a string, make an array otherwise just reference the array
-			rawValue = (typeof rawValue == "string") ? [rawValue] : rawValue;
-
-			var value = options.formatItem(rawValue, i+1, options.data.length);
-			if ( value === false )
-				continue;
-
-			var firstChar = value.charAt(0).toLowerCase();
-			// if no lookup array for this character exists, look it up now
-			if( !stMatchSets[firstChar] )
-				stMatchSets[firstChar] = [];
-
-			// if the match is a string
-			var row = {
-				value: value,
-				data: rawValue,
-				result: options.formatResult && options.formatResult(rawValue) || value
-			};
-
-			// push the current match into the set list
-			stMatchSets[firstChar].push(row);
-
-			// keep track of minChars zero items
-			if ( nullData++ < options.max ) {
-				stMatchSets[""].push(row);
-			}
-		};
-
-		// add the data items to the cache
-		$.each(stMatchSets, function(i, value) {
-			// increase the cache size
-			options.cacheLength++;
-			// add to the cache
-			add(i, value);
-		});
-	}
-
-	// populate any existing data
-	setTimeout(populate, 25);
-
-	function flush(){
-		data = {};
-		length = 0;
-	}
-
-	return {
-		flush: flush,
-		add: add,
-		populate: populate,
-		load: function(q) {
-			if (!options.cacheLength || !length)
-				return null;
-			/*
-			 * if dealing w/local data and matchContains than we must make sure
-			 * to loop through all the data collections looking for matches
-			 */
-			if( !options.url && options.matchContains ){
-				// track all matches
-				var csub = [];
-				// loop through all the data grids for matches
-				for( var k in data ){
-					// don't search through the stMatchSets[""] (minChars: 0) cache
-					// this prevents duplicates
-					if( k.length > 0 ){
-						var c = data[k];
-						$.each(c, function(i, x) {
-							// if we've got a match, add it to the array
-							if (matchSubset(x.value, q)) {
-								csub.push(x);
-							}
-						});
-					}
-				}
-				return csub;
-			} else
-			// if the exact item exists, use it
-			if (data[q]){
-				return data[q];
-			} else
-			if (options.matchSubset) {
-				for (var i = q.length - 1; i >= options.minChars; i--) {
-					var c = data[q.substr(0, i)];
-					if (c) {
-						var csub = [];
-						$.each(c, function(i, x) {
-							if (matchSubset(x.value, q)) {
-								csub[csub.length] = x;
-							}
-						});
-						return csub;
-					}
-				}
-			}
-			return null;
-		}
-	};
-};
-
-$.Autocompleter.Select = function (options, input, select, config) {
-	var CLASSES = {
-		ACTIVE: "ac_over"
-	};
-
-	var listItems,
-		active = -1,
-		data,
-		term = "",
-		needsInit = true,
-		element,
-		list;
-
-	// Create results
-	function init() {
-		if (!needsInit)
-			return;
-		element = $("<div/>")
-		.hide()
-		.addClass(options.resultsClass)
-		.css("position", "absolute")
-		.appendTo(options.attachTo);
-
-		list = $("<ul>").appendTo(element).mouseover( function(event) {
-			if(target(event).nodeName && target(event).nodeName.toUpperCase() == 'LI') {
-	            active = $("li", list).removeClass(CLASSES.ACTIVE).index(target(event));
-			    $(target(event)).addClass(CLASSES.ACTIVE);
-	        }
-		}).click(function(event) {
-			$(target(event)).addClass(CLASSES.ACTIVE);
-			select();
-			input.focus();
-			return false;
-		}).mousedown(function() {
-			config.mouseDownOnSelect = true;
-		}).mouseup(function() {
-			config.mouseDownOnSelect = false;
-		});
-
-		if( options.width > 0 )
-			element.css("width", options.width);
-
-		needsInit = false;
-	}
-
-	function target(event) {
-		var element = event.target;
-		while(element && element.tagName != "LI")
-			element = element.parentNode;
-		// more fun with IE, sometimes event.target is empty, just ignore it then
-		if(!element)
-			return [];
-		return element;
-	}
-
-	function moveSelect(step) {
-		listItems.slice(active, active + 1).removeClass();
-		movePosition(step);
-        var activeItem = listItems.slice(active, active + 1).addClass(CLASSES.ACTIVE);
-        if(options.scroll) {
-            var offset = 0;
-            listItems.slice(0, active).each(function() {
-				offset += this.offsetHeight;
-			});
-            if((offset + activeItem[0].offsetHeight - list.scrollTop()) > list[0].clientHeight) {
-                list.scrollTop(offset + activeItem[0].offsetHeight - list.innerHeight());
-            } else if(offset < list.scrollTop()) {
-                list.scrollTop(offset);
-            }
-        }
-	};
-
-	function movePosition(step) {
-		active += step;
-		if (active < 0) {
-			active = listItems.size() - 1;
-		} else if (active >= listItems.size()) {
-			active = 0;
-		}
-	}
-
-	function limitNumberOfItems(available) {
-		return options.max && options.max < available
-			? options.max
-			: available;
-	}
-
-	function fillList() {
-		list.empty();
-		var max = limitNumberOfItems(data.length);
-		for (var i=0; i < max; i++) {
-			if (!data[i])
-				continue;
-			var formatted = options.formatItem(data[i].data, i+1, max, data[i].value, term);
-			if ( formatted === false )
-				continue;
-			var li = $("<li>").html( options.highlight(formatted, term) ).addClass(i%2 == 0 ? "ac_event" : "ac_odd").appendTo(list)[0];
-			$.data(li, "ac_data", data[i]);
-		}
-		listItems = list.find("li");
-		if ( options.selectFirst ) {
-			listItems.slice(0, 1).addClass(CLASSES.ACTIVE);
-			active = 0;
-		}
-		list.bgiframe();
-	}
-
-	return {
-		display: function(d, q) {
-			init();
-			data = d;
-			term = q;
-			fillList();
-		},
-		next: function() {
-			moveSelect(1);
-		},
-		prev: function() {
-			moveSelect(-1);
-		},
-		pageUp: function() {
-			if (active != 0 && active - 8 < 0) {
-				moveSelect( -active );
-			} else {
-				moveSelect(-8);
-			}
-		},
-		pageDown: function() {
-			if (active != listItems.size() - 1 && active + 8 > listItems.size()) {
-				moveSelect( listItems.size() - 1 - active );
-			} else {
-				moveSelect(8);
-			}
-		},
-		hide: function() {
-			element && element.hide();
-			active = -1;
-		},
-		visible : function() {
-			return element && element.is(":visible");
-		},
-		current: function() {
-			return this.visible() && (listItems.filter("." + CLASSES.ACTIVE)[0] || options.selectFirst && listItems[0]);
-		},
-		show: function() {
-			var offset = $(input).offset();
-			element.css({
-				width: typeof options.width == "string" || options.width > 0 ? options.width : $(input).width(),
-				top: offset.top + input.offsetHeight,
-				left: offset.left
-			}).show();
-            if(options.scroll) {
-                list.scrollTop(0);
-                list.css({
-					maxHeight: options.scrollHeight,
-					overflow: 'auto'
-				});
-
-                if($.browser.msie && typeof document.body.style.maxHeight === "undefined") {
-					var listHeight = 0;
-					listItems.each(function() {
-						listHeight += this.offsetHeight;
-					});
-					var scrollbarsVisible = listHeight > options.scrollHeight;
-                    list.css('height', scrollbarsVisible ? options.scrollHeight : listHeight );
-					if (!scrollbarsVisible) {
-						// IE doesn't recalculate width when scrollbar disappears
-						listItems.width( list.width() - parseInt(listItems.css("padding-left")) - parseInt(listItems.css("padding-right")) );
-					}
-                }
-
-            }
-		},
-		selected: function() {
-			var selected = listItems && listItems.filter("." + CLASSES.ACTIVE).removeClass(CLASSES.ACTIVE);
-			return selected && selected.length && $.data(selected[0], "ac_data");
-		},
-		unbind: function() {
-			element && element.remove();
-		}
-	};
-};
-
-$.Autocompleter.Selection = function(field, start, end) {
-	if( field.createTextRange ){
-		var selRange = field.createTextRange();
-		selRange.collapse(true);
-		selRange.moveStart("character", start);
-		selRange.moveEnd("character", end);
-		selRange.select();
-	} else if( field.setSelectionRange ){
-		field.setSelectionRange(start, end);
-	} else {
-		if( field.selectionStart ){
-			field.selectionStart = start;
-			field.selectionEnd = end;
-		}
-	}
-	field.focus();
-};
-
-})(jQuery);
\ No newline at end of file
+(function(a){a.fn.extend({autocomplete:function(b,c){var d=typeof b=="string";c=a.extend({},a.Autocompleter.defaults,{url:d?b:null,data:d?null:b,delay:d?a.Autocompleter.defaults.delay:10,max:c&&!c.scroll?10:150},c);c.highlight=c.highlight||function(e){return e};return this.each(function(){new a.Autocompleter(this,c)})},result:function(b){return this.bind("result",b)},search:function(b){return this.trigger("search",[b])},flushCache:function(){return this.trigger("flushCache")},setOptions:function(b){return this.trigger("setOptions",[b])},unautocomplete:function(){return this.trigger("unautocomplete")}});a.Autocompleter=function(l,g){var c={UP:38,DOWN:40,DEL:46,TAB:9,RETURN:13,ESC:27,COMMA:188,PAGEUP:33,PAGEDOWN:34};var b=a(l).attr("autocomplete","off").addClass(g.inputClass);var j;var p="";var m=a.Autocompleter.Cache(g);var e=0;var u;var w={mouseDownOnSelect:false};var r=a.Autocompleter.Select(g,l,d,w);b.keydown(function(x){u=x.keyCode;switch(x.keyCode){case c.UP:x.preventDefault();if(r.visible()){r.prev()}else{t(0,true)}break;case c.DOWN:x.preventDefault();if(r.visible()){r.next()}else{t(0,true)}break;case c.PAGEUP:x.preventDefault();if(r.visible()){r.pageUp()}else{t(0,true)}break;case c.PAGEDOWN:x.preventDefault();if(r.visible()){r.pageDown()}else{t(0,true)}break;case g.multiple&&a.trim(g.multipleSeparator)==","&&c.COMMA:case c.TAB:case c.RETURN:if(d()){if(!g.multiple){b.blur()}x.preventDefault();b.focus()}break;case c.ESC:r.hide();break;default:clearTimeout(j);j=setTimeout(t,g.delay);break}}).keypress(function(){}).focus(function(){e++}).blur(function(){e=0;if(!w.mouseDownOnSelect){s()}}).click(function(){if(e++>1&&!r.visible()){t(0,true)}}).bind("search",function(){var x=(arguments.length>1)?arguments[1]:null;function y(C,B){var z;if(B&&B.length){for(var A=0;A<B.length;A++){if(B[A].result.toLowerCase()==C.toLowerCase()){z=B[A];break}}}if(typeof x=="function"){x(z)}else{b.trigger("result",z&&[z.data,z.value])}}a.each(h(b.val()),function(z,A){f(A,y,y)})}).bind("flushCache",function(){m.flush()}).bind("setOptions",function(){a.extend(g,arguments[1]);if("data" in arguments[1]){m.populate()}}).bind("unautocomplete",function(){r.unbind();b.unbind()});function d(){var y=r.selected();if(!y){return false}var x=y.result;p=x;if(g.multiple){var z=h(b.val());if(z.length>1){x=z.slice(0,z.length-1).join(g.multipleSeparator)+g.multipleSeparator+x}x+=g.multipleSeparator}b.val(x);v();b.trigger("result",[y.data,y.value]);return true}function t(z,y){if(u==c.DEL){r.hide();return}var x=b.val();if(!y&&x==p){return}p=x;x=i(x);if(x.length>=g.minChars){b.addClass(g.loadingClass);jQuery("#send-to-input").addClass("loading");if(!g.matchCase){x=x.toLowerCase()}f(x,k,v)}else{n();r.hide()}}function h(y){if(!y){return[""]}var z=y.split(a.trim(g.multipleSeparator));var x=[];a.each(z,function(A,B){if(a.trim(B)){x[A]=a.trim(B)}});return x}function i(x){if(!g.multiple){return x}var y=h(x);return y[y.length-1]}function q(x,y){if(g.autoFill&&(i(b.val()).toLowerCase()==x.toLowerCase())&&u!=8){b.val(b.val()+y.substring(i(p).length));a.Autocompleter.Selection(l,p.length,p.length+y.length)}}function s(){clearTimeout(j);j=setTimeout(v,200)}function v(){r.hide();clearTimeout(j);n();if(g.mustMatch){b.search(function(x){if(!x){b.val("")}})}}function k(z,y){if(y&&y.length&&e){n();r.display(y,z);var x=y[0].value.split(";");y.value=x[0];q(z,y.value);r.show()}else{v()}}function f(y,A,x){if(!g.matchCase){y=y.toLowerCase()}var z=m.load(y);if(z&&z.length){A(y,z)}else{if((typeof g.url=="string")&&(g.url.length>0)){var B={};a.each(g.extraParams,function(C,D){B[C]=typeof D=="function"?D():D});a.ajax({mode:"abort",port:"autocomplete"+l.name,dataType:g.dataType,url:g.url,data:a.extend({q:i(y),limit:g.max,action:"messages_autocomplete_results",cookie:encodeURIComponent(document.cookie)},B),success:function(D){var C=g.parse&&g.parse(D)||o(D);m.add(y,C);A(y,C)}})}else{x(y)}}}function o(A){var x=[];var z=A.split("\n");for(var y=0;y<z.length;y++){var B=a.trim(z[y]);if(B){B=B.split("|");x[x.length]={data:B,value:B[0],result:g.formatResult&&g.formatResult(B,B[0])||B[0]}}}return x}function n(){b.removeClass(g.loadingClass);jQuery("#send-to-input").removeClass("loading")}};a.Autocompleter.defaults={inputClass:"ac_input",resultsClass:"ac_results",loadingClass:"ac_loading",minChars:1,delay:400,matchCase:false,matchSubset:true,matchContains:false,cacheLength:10,max:100,mustMatch:false,extraParams:{},selectFirst:true,formatItem:function(b){return b[0]},autoFill:false,width:0,multiple:false,multipleSeparator:", ",highlight:function(c,b){return c.replace(new RegExp("(?![^&;]+;)(?!<[^<>]*)("+b.replace(/([\^\$\(\)\[\]\{\}\*\.\+\?\|\\])/gi,"\\$1")+")(?![^<>]*>)(?![^&;]+;)","gi"),"<strong>$1</strong>")},scroll:true,scrollHeight:250,attachTo:"body"};a.Autocompleter.Cache=function(c){var f={};var d=0;function h(l,k){if(!c.matchCase){l=l.toLowerCase()}var j=l.indexOf(k);if(j==-1){return false}return j==0||c.matchContains}function g(j,i){if(d>c.cacheLength){b()}if(!f[j]){d++}f[j]=i}function e(){if(!c.data){return false}var k={},j=0;if(!c.url){c.cacheLength=1}k[""]=[];for(var m=0,l=c.data.length;m<l;m++){var p=c.data[m];p=(typeof p=="string")?[p]:p;var o=c.formatItem(p,m+1,c.data.length);if(o===false){continue}var n=o.charAt(0).toLowerCase();if(!k[n]){k[n]=[]}var q={value:o,data:p,result:c.formatResult&&c.formatResult(p)||o};k[n].push(q);if(j++<c.max){k[""].push(q)}}a.each(k,function(r,s){c.cacheLength++;g(r,s)})}setTimeout(e,25);function b(){f={};d=0}return{flush:b,add:g,populate:e,load:function(n){if(!c.cacheLength||!d){return null}if(!c.url&&c.matchContains){var m=[];for(var j in f){if(j.length>0){var o=f[j];a.each(o,function(p,k){if(h(k.value,n)){m.push(k)}})}}return m}else{if(f[n]){return f[n]}else{if(c.matchSubset){for(var l=n.length-1;l>=c.minChars;l--){var o=f[n.substr(0,l)];if(o){var m=[];a.each(o,function(p,k){if(h(k.value,n)){m[m.length]=k}});return m}}}}}return null}}};a.Autocompleter.Select=function(e,j,l,p){var i={ACTIVE:"ac_over"};var k,f=-1,r,m="",s=true,c,o;function n(){if(!s){return}c=a("<div/>").hide().addClass(e.resultsClass).css("position","absolute").appendTo(e.attachTo);o=a("<ul>").appendTo(c).mouseover(function(t){if(q(t).nodeName&&q(t).nodeName.toUpperCase()=="LI"){f=a("li",o).removeClass(i.ACTIVE).index(q(t));a(q(t)).addClass(i.ACTIVE)}}).click(function(t){a(q(t)).addClass(i.ACTIVE);l();j.focus();return false}).mousedown(function(){p.mouseDownOnSelect=true}).mouseup(function(){p.mouseDownOnSelect=false});if(e.width>0){c.css("width",e.width)}s=false}function q(u){var t=u.target;while(t&&t.tagName!="LI"){t=t.parentNode}if(!t){return[]}return t}function h(t){k.slice(f,f+1).removeClass();g(t);var v=k.slice(f,f+1).addClass(i.ACTIVE);if(e.scroll){var u=0;k.slice(0,f).each(function(){u+=this.offsetHeight});if((u+v[0].offsetHeight-o.scrollTop())>o[0].clientHeight){o.scrollTop(u+v[0].offsetHeight-o.innerHeight())}else{if(u<o.scrollTop()){o.scrollTop(u)}}}}function g(t){f+=t;if(f<0){f=k.size()-1}else{if(f>=k.size()){f=0}}}function b(t){return e.max&&e.max<t?e.max:t}function d(){o.empty();var u=b(r.length);for(var v=0;v<u;v++){if(!r[v]){continue}var w=e.formatItem(r[v].data,v+1,u,r[v].value,m);if(w===false){continue}var t=a("<li>").html(e.highlight(w,m)).addClass(v%2==0?"ac_event":"ac_odd").appendTo(o)[0];a.data(t,"ac_data",r[v])}k=o.find("li");if(e.selectFirst){k.slice(0,1).addClass(i.ACTIVE);f=0}o.bgiframe()}return{display:function(u,t){n();r=u;m=t;d()},next:function(){h(1)},prev:function(){h(-1)},pageUp:function(){if(f!=0&&f-8<0){h(-f)}else{h(-8)}},pageDown:function(){if(f!=k.size()-1&&f+8>k.size()){h(k.size()-1-f)}else{h(8)}},hide:function(){c&&c.hide();f=-1},visible:function(){return c&&c.is(":visible")},current:function(){return this.visible()&&(k.filter("."+i.ACTIVE)[0]||e.selectFirst&&k[0])},show:function(){var v=a(j).offset();c.css({width:typeof e.width=="string"||e.width>0?e.width:a(j).width(),top:v.top+j.offsetHeight,left:v.left}).show();if(e.scroll){o.scrollTop(0);o.css({maxHeight:e.scrollHeight,overflow:"auto"});if(a.browser.msie&&typeof document.body.style.maxHeight==="undefined"){var t=0;k.each(function(){t+=this.offsetHeight});var u=t>e.scrollHeight;o.css("height",u?e.scrollHeight:t);if(!u){k.width(o.width()-parseInt(k.css("padding-left"))-parseInt(k.css("padding-right")))}}}},selected:function(){var t=k&&k.filter("."+i.ACTIVE).removeClass(i.ACTIVE);return t&&t.length&&a.data(t[0],"ac_data")},unbind:function(){c&&c.remove()}}};a.Autocompleter.Selection=function(d,e,c){if(d.createTextRange){var b=d.createTextRange();b.collapse(true);b.moveStart("character",e);b.moveEnd("character",c);b.select()}else{if(d.setSelectionRange){d.setSelectionRange(e,c)}else{if(d.selectionStart){d.selectionStart=e;d.selectionEnd=c}}}d.focus()}})(jQuery);
\ No newline at end of file
diff --git a/wp-content/plugins/buddypress/bp-messages/js/autocomplete/jquery.autocompletefb.dev.js b/wp-content/plugins/buddypress/bp-messages/js/autocomplete/jquery.autocompletefb.dev.js
new file mode 100644
index 0000000000000000000000000000000000000000..df125ea39e3892e74bb3b9e9b528c925411c3651
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-messages/js/autocomplete/jquery.autocompletefb.dev.js
@@ -0,0 +1,76 @@
+/*!
+ * jQuery plugin: autoCompletefb(AutoComplete Facebook)
+ * @requires jQuery v1.2.2 or later
+ * using plugin:jquery.autocomplete.js
+ *
+ * Credits:
+ * - Idea: Facebook
+ * - Guillermo Rauch: Original MooTools script
+ * - InteRiders <http://interiders.com/>
+ *
+ * Copyright (c) 2008 Widi Harsojo <wharsojo@gmail.com>, http://wharsojo.wordpress.com/
+ * Dual licensed under the MIT and GPL licenses:
+ *   http://www.opensource.org/licenses/mit-license.php
+ *   http://www.gnu.org/licenses/gpl.html
+ */
+
+jQuery.fn.autoCompletefb = function(options)
+{
+	var tmp = this;
+	var settings =
+	{
+		ul         : tmp,
+		urlLookup  : [""],
+		acOptions  : {},
+		foundClass : ".friend-tab",
+		inputClass : ".send-to-input"
+	}
+
+	if(options) jQuery.extend(settings, options);
+
+	var acfb =
+	{
+		params  : settings,
+		removeFind : function(o){
+			acfb.removeUsername(o);
+			jQuery(o).unbind('click').parent().remove();
+			jQuery(settings.inputClass,tmp).focus();
+			return tmp.acfb;
+		},
+		removeUsername: function(o){
+			var newID = o.parentNode.id.split('-');
+			jQuery('#send-to-usernames').removeClass(newID[1]);
+		}
+	}
+
+	jQuery(settings.foundClass+" img.p").click(function(){
+		acfb.removeFind(this);
+	});
+
+	jQuery(settings.inputClass,tmp).autocomplete(settings.urlLookup,settings.acOptions);
+	jQuery(settings.inputClass,tmp).result(function(e,d,f){
+		var f = settings.foundClass.replace(/\./,'');
+		var d = String(d).split(' (');
+		var un = d[1].substr(0, d[1].length-1);
+		
+		/* Don't add the same user multiple times */
+		if( 0 === jQuery(settings.inputClass).siblings('#un-' + un).length ) {		
+			var ln = '#link-' + un;
+			var l = jQuery(ln).attr('href');
+			var v = '<li class="'+f+'" id="un-'+un+'"><span><a href="'+l+'">'+d[0]+'</a></span> <span class="p">X</span></li>';
+			
+			var x = jQuery(settings.inputClass,tmp).before(v);
+			jQuery('#send-to-usernames').addClass(un);
+				
+			jQuery('.p',x[0].previousSibling).click(function(){
+				acfb.removeFind(this);
+			});
+		} 
+			
+		jQuery(settings.inputClass,tmp).val('');
+
+	});
+
+	jQuery(settings.inputClass,tmp).focus();
+	return acfb;
+}
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 d94e43c52b2696adda1e685acb9a270dc0ddfbb0..c8c92e8488d04e9c55ad55fc37042f636210865d 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
@@ -6,63 +6,11 @@
  * Credits:
  * - Idea: Facebook
  * - Guillermo Rauch: Original MooTools script
- * - InteRiders <http://interiders.com/> 
+ * - InteRiders <http://interiders.com/>
  *
  * Copyright (c) 2008 Widi Harsojo <wharsojo@gmail.com>, http://wharsojo.wordpress.com/
  * Dual licensed under the MIT and GPL licenses:
  *   http://www.opensource.org/licenses/mit-license.php
  *   http://www.gnu.org/licenses/gpl.html
  */
- 
-jQuery.fn.autoCompletefb = function(options) 
-{
-	var tmp = this;
-	var settings = 
-	{
-		ul         : tmp,
-		urlLookup  : [""],
-		acOptions  : {},
-		foundClass : ".friend-tab",
-		inputClass : ".send-to-input"
-	}
-	
-	if(options) jQuery.extend(settings, options);
-	
-	var acfb = 
-	{
-		params  : settings,
-		removeFind : function(o){
-			acfb.removeUsername(o);
-			jQuery(o).unbind('click').parent().remove();
-			jQuery(settings.inputClass,tmp).focus();
-			return tmp.acfb;
-		},
-		removeUsername: function(o){
-			var newID = o.parentNode.id.split('-');
-			jQuery('#send-to-usernames').removeClass(newID[1]);
-		}
-	}
-	
-	jQuery(settings.foundClass+" img.p").click(function(){
-		acfb.removeFind(this);
-	});
-	
-	jQuery(settings.inputClass,tmp).autocomplete(settings.urlLookup,settings.acOptions);
-	jQuery(settings.inputClass,tmp).result(function(e,d,f){
-		var f = settings.foundClass.replace(/\./,'');
-		var d = String(d).split(' (');
-		var un = d[1].substr(0, d[1].length-1);
-		var v = '<li class="'+f+'" id="un-'+un+'"><span>'+d[0]+'</span> <span class="p">X</span></li>';
-		var x = jQuery(settings.inputClass,tmp).before(v);
-		
-		jQuery('#send-to-usernames').addClass(un);
-		
-		jQuery('.p',x[0].previousSibling).click(function(){
-			acfb.removeFind(this);
-		});
-		jQuery(settings.inputClass,tmp).val('');
-	});
-	
-	jQuery(settings.inputClass,tmp).focus();
-	return acfb;
-}
+jQuery.fn.autoCompletefb=function(b){var c=this;var d={ul:c,urlLookup:[""],acOptions:{},foundClass:".friend-tab",inputClass:".send-to-input"};if(b){jQuery.extend(d,b)}var a={params:d,removeFind:function(e){a.removeUsername(e);jQuery(e).unbind("click").parent().remove();jQuery(d.inputClass,c).focus();return c.acfb},removeUsername:function(f){var e=f.parentNode.id.split("-");jQuery("#send-to-usernames").removeClass(e[1])}};jQuery(d.foundClass+" img.p").click(function(){a.removeFind(this)});jQuery(d.inputClass,c).autocomplete(d.urlLookup,d.acOptions);jQuery(d.inputClass,c).result(function(n,o,m){var m=d.foundClass.replace(/\./,"");var o=String(o).split(" (");var j=o[1].substr(0,o[1].length-1);if(0===jQuery(d.inputClass).siblings("#un-"+j).length){var k="#link-"+j;var h=jQuery(k).attr("href");var i='<li class="'+m+'" id="un-'+j+'"><span><a href="'+h+'">'+o[0]+'</a></span> <span class="p">X</span></li>';var g=jQuery(d.inputClass,c).before(i);jQuery("#send-to-usernames").addClass(j);jQuery(".p",g[0].previousSibling).click(function(){a.removeFind(this)})}jQuery(d.inputClass,c).val("")});jQuery(d.inputClass,c).focus();return a};
\ No newline at end of file
diff --git a/wp-content/plugins/buddypress/bp-messages/js/autocomplete/jquery.bgiframe.dev.js b/wp-content/plugins/buddypress/bp-messages/js/autocomplete/jquery.bgiframe.dev.js
new file mode 100644
index 0000000000000000000000000000000000000000..ef2a9e218f0ecd6257af54fb0a0f854be0b95be9
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-messages/js/autocomplete/jquery.bgiframe.dev.js
@@ -0,0 +1,39 @@
+/*! Copyright (c) 2010 Brandon Aaron (http://brandonaaron.net)
+ * Licensed under the MIT License (license.bgiframe.txt).
+ *
+ * Version 2.1.2
+ */
+
+(function($){
+
+$.fn.bgiframe = ($.browser.msie && /msie 6\.0/i.test(navigator.userAgent) ? function(s) {
+    s = $.extend({
+        top     : 'auto', // auto == .currentStyle.borderTopWidth
+        left    : 'auto', // auto == .currentStyle.borderLeftWidth
+        width   : 'auto', // auto == offsetWidth
+        height  : 'auto', // auto == offsetHeight
+        opacity : true,
+        src     : 'javascript:false;'
+    }, s);
+    var html = '<iframe class="bgiframe"frameborder="0"tabindex="-1"src="'+s.src+'"'+
+                   'style="display:block;position:absolute;z-index:-1;'+
+                       (s.opacity !== false?'filter:Alpha(Opacity=\'0\');':'')+
+                       'top:'+(s.top=='auto'?'expression(((parseInt(this.parentNode.currentStyle.borderTopWidth)||0)*-1)+\'px\')':prop(s.top))+';'+
+                       'left:'+(s.left=='auto'?'expression(((parseInt(this.parentNode.currentStyle.borderLeftWidth)||0)*-1)+\'px\')':prop(s.left))+';'+
+                       'width:'+(s.width=='auto'?'expression(this.parentNode.offsetWidth+\'px\')':prop(s.width))+';'+
+                       'height:'+(s.height=='auto'?'expression(this.parentNode.offsetHeight+\'px\')':prop(s.height))+';'+
+                '"/>';
+    return this.each(function() {
+        if ( $(this).children('iframe.bgiframe').length === 0 )
+            this.insertBefore( document.createElement(html), this.firstChild );
+    });
+} : function() { return this; });
+
+// old alias
+$.fn.bgIframe = $.fn.bgiframe;
+
+function prop(n) {
+    return n && n.constructor === Number ? n + 'px' : n;
+}
+
+})(jQuery);
\ No newline at end of file
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
new file mode 100644
index 0000000000000000000000000000000000000000..e54882f3e182669f96f04a4f1baebcd2d999a978
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-messages/js/autocomplete/jquery.bgiframe.js
@@ -0,0 +1,6 @@
+/* Copyright (c) 2010 Brandon Aaron (http://brandonaaron.net)
+ * Licensed under the MIT License (license.bgiframe.txt).
+ *
+ * Version 2.1.2
+ */
+(function(a){a.fn.bgiframe=(a.browser.msie&&/msie 6\.0/i.test(navigator.userAgent)?function(d){d=a.extend({top:"auto",left:"auto",width:"auto",height:"auto",opacity:true,src:"javascript:false;"},d);var c='<iframe class="bgiframe"frameborder="0"tabindex="-1"src="'+d.src+'"style="display:block;position:absolute;z-index:-1;'+(d.opacity!==false?"filter:Alpha(Opacity='0');":"")+"top:"+(d.top=="auto"?"expression(((parseInt(this.parentNode.currentStyle.borderTopWidth)||0)*-1)+'px')":b(d.top))+";left:"+(d.left=="auto"?"expression(((parseInt(this.parentNode.currentStyle.borderLeftWidth)||0)*-1)+'px')":b(d.left))+";width:"+(d.width=="auto"?"expression(this.parentNode.offsetWidth+'px')":b(d.width))+";height:"+(d.height=="auto"?"expression(this.parentNode.offsetHeight+'px')":b(d.height))+';"/>';return this.each(function(){if(a(this).children("iframe.bgiframe").length===0){this.insertBefore(document.createElement(c),this.firstChild)}})}:function(){return this});a.fn.bgIframe=a.fn.bgiframe;function b(c){return c&&c.constructor===Number?c+"px":c}})(jQuery);
\ No newline at end of file
diff --git a/wp-content/plugins/buddypress/bp-messages/js/autocomplete/jquery.dimensions.dev.js b/wp-content/plugins/buddypress/bp-messages/js/autocomplete/jquery.dimensions.dev.js
new file mode 100644
index 0000000000000000000000000000000000000000..544c918b53ff22cf97d7604f93f950bfafcfa540
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-messages/js/autocomplete/jquery.dimensions.dev.js
@@ -0,0 +1,117 @@
+/*!
+ * 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.
+ *
+ * $LastChangedDate: 2007-09-11 05:38:31 +0300 (Вт, 11 сен 2007) $
+ * $Rev: 3238 $
+ *
+ * Version: @VERSION
+ *
+ * Requires: jQuery 1.2+
+ */
+
+(function($){
+
+$.dimensions = {
+	version: '@VERSION'
+};
+
+// Create innerHeight, innerWidth, outerHeight and outerWidth methods
+$.each( [ 'Height', 'Width' ], function(i, name){
+
+	// innerHeight and innerWidth
+	$.fn[ 'inner' + name ] = function() {
+		if (!this[0]) return;
+
+		var torl = name == 'Height' ? 'Top'    : 'Left',  // top or left
+		    borr = name == 'Height' ? 'Bottom' : 'Right'; // bottom or right
+
+		return this[ name.toLowerCase() ]() + num(this, 'padding' + torl) + num(this, 'padding' + borr);
+	};
+
+	// outerHeight and outerWidth
+	$.fn[ 'outer' + name ] = function(options) {
+		if (!this[0]) return;
+
+		var torl = name == 'Height' ? 'Top'    : 'Left',  // top or left
+		    borr = name == 'Height' ? 'Bottom' : 'Right'; // bottom or right
+
+		options = $.extend({ margin: false }, options || {});
+
+		return this[ name.toLowerCase() ]()
+				+ num(this, 'border' + torl + 'Width') + num(this, 'border' + borr + 'Width')
+				+ num(this, 'padding' + torl) + num(this, 'padding' + borr)
+				+ (options.margin ? (num(this, 'margin' + torl) + num(this, 'margin' + borr)) : 0);
+	};
+});
+
+// Create scrollLeft and scrollTop methods
+$.each( ['Left', 'Top'], function(i, name) {
+	$.fn[ 'scroll' + name ] = function(val) {
+		if (!this[0]) return;
+
+		return val != undefined ?
+
+			// Set the scroll offset
+			this.each(function() {
+				this == window || this == document ?
+					window.scrollTo(
+						name == 'Left' ? val : $(window)[ 'scrollLeft' ](),
+						name == 'Top'  ? val : $(window)[ 'scrollTop'  ]()
+					) :
+					this[ 'scroll' + name ] = val;
+			}) :
+
+			// Return the scroll offset
+			this[0] == window || this[0] == document ?
+				self[ (name == 'Left' ? 'pageXOffset' : 'pageYOffset') ] ||
+					$.boxModel && document.documentElement[ 'scroll' + name ] ||
+					document.body[ 'scroll' + name ] :
+				this[0][ 'scroll' + name ];
+	};
+});
+
+$.fn.extend({
+	position: function() {
+		var left = 0, top = 0, elem = this[0], offset, parentOffset, offsetParent, results;
+
+		if (elem) {
+			// Get *real* offsetParent
+			offsetParent = this.offsetParent();
+
+			// Get correct offsets
+			offset       = this.offset();
+			parentOffset = offsetParent.offset();
+
+			// Subtract element margins
+			offset.top  -= num(elem, 'marginTop');
+			offset.left -= num(elem, 'marginLeft');
+
+			// Add offsetParent borders
+			parentOffset.top  += num(offsetParent, 'borderTopWidth');
+			parentOffset.left += num(offsetParent, 'borderLeftWidth');
+
+			// Subtract the two offsets
+			results = {
+				top:  offset.top  - parentOffset.top,
+				left: offset.left - parentOffset.left
+			};
+		}
+
+		return results;
+	},
+
+	offsetParent: function() {
+		var offsetParent = this[0].offsetParent;
+		while ( offsetParent && (!/^body|html$/i.test(offsetParent.tagName) && $.css(offsetParent, 'position') == 'static') )
+			offsetParent = offsetParent.offsetParent;
+		return $(offsetParent);
+	}
+});
+
+var num = function(el, prop) {
+	return parseInt($.css(el.jquery?el[0]:el,prop))||0;
+};
+
+})(jQuery);
\ No newline at end of file
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 4c80c2f2b86a3f92d0b9e4e33645f01121183a4e..024853f47c0961b0b060e5b1ffd793fb081051cd 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,5 @@
-/* Copyright (c) 2007 Paul Bakaus (paul.bakaus@googlemail.com) and Brandon Aaron (brandon.aaron@gmail.com || http://brandonaaron.net)
+/*
+ * 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.
  *
@@ -9,108 +10,4 @@
  *
  * Requires: jQuery 1.2+
  */
-
-(function($){
-	
-$.dimensions = {
-	version: '@VERSION'
-};
-
-// Create innerHeight, innerWidth, outerHeight and outerWidth methods
-$.each( [ 'Height', 'Width' ], function(i, name){
-	
-	// innerHeight and innerWidth
-	$.fn[ 'inner' + name ] = function() {
-		if (!this[0]) return;
-		
-		var torl = name == 'Height' ? 'Top'    : 'Left',  // top or left
-		    borr = name == 'Height' ? 'Bottom' : 'Right'; // bottom or right
-		
-		return this[ name.toLowerCase() ]() + num(this, 'padding' + torl) + num(this, 'padding' + borr);
-	};
-	
-	// outerHeight and outerWidth
-	$.fn[ 'outer' + name ] = function(options) {
-		if (!this[0]) return;
-		
-		var torl = name == 'Height' ? 'Top'    : 'Left',  // top or left
-		    borr = name == 'Height' ? 'Bottom' : 'Right'; // bottom or right
-		
-		options = $.extend({ margin: false }, options || {});
-		
-		return this[ name.toLowerCase() ]()
-				+ num(this, 'border' + torl + 'Width') + num(this, 'border' + borr + 'Width')
-				+ num(this, 'padding' + torl) + num(this, 'padding' + borr)
-				+ (options.margin ? (num(this, 'margin' + torl) + num(this, 'margin' + borr)) : 0);
-	};
-});
-
-// Create scrollLeft and scrollTop methods
-$.each( ['Left', 'Top'], function(i, name) {
-	$.fn[ 'scroll' + name ] = function(val) {
-		if (!this[0]) return;
-		
-		return val != undefined ?
-		
-			// Set the scroll offset
-			this.each(function() {
-				this == window || this == document ?
-					window.scrollTo( 
-						name == 'Left' ? val : $(window)[ 'scrollLeft' ](),
-						name == 'Top'  ? val : $(window)[ 'scrollTop'  ]()
-					) :
-					this[ 'scroll' + name ] = val;
-			}) :
-			
-			// Return the scroll offset
-			this[0] == window || this[0] == document ?
-				self[ (name == 'Left' ? 'pageXOffset' : 'pageYOffset') ] ||
-					$.boxModel && document.documentElement[ 'scroll' + name ] ||
-					document.body[ 'scroll' + name ] :
-				this[0][ 'scroll' + name ];
-	};
-});
-
-$.fn.extend({
-	position: function() {
-		var left = 0, top = 0, elem = this[0], offset, parentOffset, offsetParent, results;
-		
-		if (elem) {
-			// Get *real* offsetParent
-			offsetParent = this.offsetParent();
-			
-			// Get correct offsets
-			offset       = this.offset();
-			parentOffset = offsetParent.offset();
-			
-			// Subtract element margins
-			offset.top  -= num(elem, 'marginTop');
-			offset.left -= num(elem, 'marginLeft');
-			
-			// Add offsetParent borders
-			parentOffset.top  += num(offsetParent, 'borderTopWidth');
-			parentOffset.left += num(offsetParent, 'borderLeftWidth');
-			
-			// Subtract the two offsets
-			results = {
-				top:  offset.top  - parentOffset.top,
-				left: offset.left - parentOffset.left
-			};
-		}
-		
-		return results;
-	},
-	
-	offsetParent: function() {
-		var offsetParent = this[0].offsetParent;
-		while ( offsetParent && (!/^body|html$/i.test(offsetParent.tagName) && $.css(offsetParent, 'position') == 'static') )
-			offsetParent = offsetParent.offsetParent;
-		return $(offsetParent);
-	}
-});
-
-var num = function(el, prop) {
-	return parseInt($.css(el.jquery?el[0]:el,prop))||0;
-};
-
-})(jQuery);
\ No newline at end of file
+(function(b){b.dimensions={version:"@VERSION"};b.each(["Height","Width"],function(d,c){b.fn["inner"+c]=function(){if(!this[0]){return}var f=c=="Height"?"Top":"Left",e=c=="Height"?"Bottom":"Right";return this[c.toLowerCase()]()+a(this,"padding"+f)+a(this,"padding"+e)};b.fn["outer"+c]=function(f){if(!this[0]){return}var g=c=="Height"?"Top":"Left",e=c=="Height"?"Bottom":"Right";f=b.extend({margin:false},f||{});return this[c.toLowerCase()]()+a(this,"border"+g+"Width")+a(this,"border"+e+"Width")+a(this,"padding"+g)+a(this,"padding"+e)+(f.margin?(a(this,"margin"+g)+a(this,"margin"+e)):0)}});b.each(["Left","Top"],function(d,c){b.fn["scroll"+c]=function(e){if(!this[0]){return}return e!=undefined?this.each(function(){this==window||this==document?window.scrollTo(c=="Left"?e:b(window)["scrollLeft"](),c=="Top"?e:b(window)["scrollTop"]()):this["scroll"+c]=e}):this[0]==window||this[0]==document?self[(c=="Left"?"pageXOffset":"pageYOffset")]||b.boxModel&&document.documentElement["scroll"+c]||document.body["scroll"+c]:this[0]["scroll"+c]}});b.fn.extend({position:function(){var h=0,g=0,f=this[0],i,c,e,d;if(f){e=this.offsetParent();i=this.offset();c=e.offset();i.top-=a(f,"marginTop");i.left-=a(f,"marginLeft");c.top+=a(e,"borderTopWidth");c.left+=a(e,"borderLeftWidth");d={top:i.top-c.top,left:i.left-c.left}}return d},offsetParent:function(){var c=this[0].offsetParent;while(c&&(!/^body|html$/i.test(c.tagName)&&b.css(c,"position")=="static")){c=c.offsetParent}return b(c)}});var a=function(c,d){return parseInt(b.css(c.jquery?c[0]:c,d))||0}})(jQuery);
\ No newline at end of file
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
new file mode 100644
index 0000000000000000000000000000000000000000..21f87ae7a5ff34c4bb9584be4b84fbd315e805cb
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-messages/js/autocomplete/license.bgiframe.txt
@@ -0,0 +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
+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
new file mode 100644
index 0000000000000000000000000000000000000000..dfed7125ae2ca666366a3f6e7c606ee7229076fd
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-settings/bp-settings-actions.php
@@ -0,0 +1,174 @@
+<?php
+// Exit if accessed directly
+if ( !defined( 'ABSPATH' ) ) exit;
+
+/** General *******************************************************************/
+
+function bp_core_screen_general_settings() {
+	global $bp;
+
+	if ( bp_action_variables() ) {
+		bp_do_404();
+		return;
+	}
+
+	// Setup private variables
+	$bp_settings_updated = $pass_error = $email_error = $pwd_error = false;
+
+	if ( isset( $_POST['submit'] ) ) {
+
+		// Nonce check
+		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 ) ) ) {
+
+			$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;
+			}
+
+			// Make sure changing an email address does not already exist
+			if ( $_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;
+
+				// Get blocked email domains
+				$limited_email_domains = get_site_option( 'limited_email_domains', 'buddypress' );
+
+				// 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 ( in_array( $emaildomain, (array)$limited_email_domains ) == false ) {
+						$email_error = true;
+					}
+				}
+
+				// No errors, and email address doesn't match
+				if ( ( false === $email_error ) && ( $bp->displayed_user->userdata->user_email != $user_email ) ) {
+
+					// We don't want email dupes in the system
+					if ( email_exists( $user_email ) )
+						$email_error = true;
+
+					// Set updated user email to this email address
+					$update_user->user_email = $user_email;
+				}
+			}
+
+			// Password change
+			if ( !empty( $_POST['pass1'] ) && !empty( $_POST['pass2'] ) ) {
+
+				// Password change attempt is successful
+				if ( $_POST['pass1'] == $_POST['pass2'] && !strpos( " " . $_POST['pass1'], "\\" ) ) {
+					$update_user->user_pass = $_POST['pass1'];
+
+				// Password change attempt was unsuccessful
+				} else {
+					$pass_error = true;
+				}
+
+			// 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;
+
+			// Not a password change attempt so empty the user_pass
+			} else {
+				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;
+			}
+
+		// Password Error
+		} else {
+			$pwd_error = true;
+		}
+
+		// Add user feedback messages
+		if ( empty( $pass_error ) && empty( $pwd_error ) && ( empty( $email_error ) ) )
+			bp_core_add_message( __( 'Changes saved.', 'buddypress' ), 'success' );
+
+		elseif ( !empty( $pass_error ) )
+			bp_core_add_message( __( 'Your new passwords did not match.', 'buddypress' ), 'error' );
+
+		elseif ( !empty( $pwd_error ) )
+			bp_core_add_message( __( 'Your existing password is incorrect.', 'buddypress' ), 'error' );
+
+		elseif ( !empty( $email_error ) )
+			bp_core_add_message( __( 'Sorry, that email address is already used or is invalid.', 'buddypress' ), 'error' );
+
+		// Execute additional code
+		do_action( 'bp_core_general_settings_after_save' );
+		
+		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' ) );
+}
+
+/** Notifications *************************************************************/
+
+function bp_core_screen_notification_settings() {
+	global $bp;
+
+	if ( bp_action_variables() ) {
+		bp_do_404();
+		return;
+	}
+
+	if ( isset( $_POST['submit'] ) ) {
+		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 );
+			}
+		}
+
+		bp_core_add_message( __( 'Changes saved.', 'buddypress' ), 'success' );
+
+		do_action( 'bp_core_notification_settings_after_save' );
+	}
+
+	bp_core_load_template( apply_filters( 'bp_core_screen_notification_settings', 'members/single/settings/notifications' ) );
+}
+
+/** Delete Account ************************************************************/
+
+function bp_core_screen_delete_account() {
+	global $bp;
+
+	if ( bp_action_variables() ) {
+		bp_do_404();
+		return;
+	}
+
+	if ( isset( $_POST['delete-account-understand'] ) ) {
+		// Nonce check
+		check_admin_referer( 'delete-account' );
+
+		// delete the users account
+		if ( bp_core_delete_account( $bp->displayed_user->id ) ) {
+			bp_core_redirect( home_url() );
+		}
+	}
+
+	// Load the template
+	bp_core_load_template( apply_filters( 'bp_core_screen_delete_account', 'members/single/settings/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
new file mode 100644
index 0000000000000000000000000000000000000000..9b66e1b6d430b220fe20cded59cf07baddb45e31
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-settings/bp-settings-functions.php
@@ -0,0 +1,4 @@
+<?php
+// 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
new file mode 100644
index 0000000000000000000000000000000000000000..7f726150016f0b2af7553e62b42cda76141a3a21
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-settings/bp-settings-loader.php
@@ -0,0 +1,187 @@
+<?php
+// Exit if accessed directly
+if ( !defined( 'ABSPATH' ) ) exit;
+
+class BP_Settings_Component extends BP_Component {
+
+	/**
+	 * Start the settings component creation process
+	 *
+	 * @since 1.5
+	 */
+	function __construct() {
+		parent::start(
+			'settings',
+			__( 'Settings', 'buddypress' ),
+			BP_PLUGIN_DIR
+		);
+	}
+
+	/**
+	 * Include files
+	 *
+	 * @global obj $bp
+	 */
+	function includes() {
+		// Files to include
+		$includes = array(
+			'actions',
+			'screens',
+			'template',
+			'functions',
+		);
+
+		parent::includes( $includes );
+	}
+
+	/**
+	 * Setup globals
+	 *
+	 * The BP_SETTINGS_SLUG constant is deprecated, and only used here for
+	 * backwards compatibility.
+	 *
+	 * @since 1.5
+	 * @global obj $bp
+	 */
+	function setup_globals() {
+		global $bp;
+
+		// Define a slug, if necessary
+		if ( !defined( 'BP_SETTINGS_SLUG' ) )
+			define( 'BP_SETTINGS_SLUG', $this->id );
+
+		// All globals for settings component.
+		$globals = array(
+			'slug'          => BP_SETTINGS_SLUG,
+			'has_directory' => false,
+		);
+
+		parent::setup_globals( $globals );
+	}
+
+	/**
+	 * Setup BuddyBar navigation
+	 *
+	 * @global obj $bp
+	 */
+	function setup_nav() {
+		global $bp;
+
+		// Add the settings navigation item
+		$main_nav = array(
+			'name'                    => __( 'Settings', 'buddypress' ),
+			'slug'                    => $this->slug,
+			'position'                => 100,
+			'show_for_displayed_user' => bp_core_can_edit_settings(),
+			'screen_function'         => 'bp_core_screen_general_settings',
+			'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;
+		else
+			return;
+
+		$settings_link = trailingslashit( $user_domain . $this->slug );
+
+		// Add General Settings nav item
+		$sub_nav[] = array(
+			'name'            => __( 'General', 'buddypress' ),
+			'slug'            => 'general',
+			'parent_url'      => $settings_link,
+			'parent_slug'     => $this->slug,
+			'screen_function' => 'bp_core_screen_general_settings',
+			'position'        => 10,
+			'user_has_access' => bp_core_can_edit_settings()
+		);
+
+		// Add Notifications nav item
+		$sub_nav[] = array(
+			'name'            => __( 'Notifications', 'buddypress' ),
+			'slug'            => 'notifications',
+			'parent_url'      => $settings_link,
+			'parent_slug'     => $this->slug,
+			'screen_function' => 'bp_core_screen_notification_settings',
+			'position'        => 20,
+			'user_has_access' => bp_core_can_edit_settings()
+		);
+
+		// Add Delete Account nav item
+		if ( !is_super_admin() && empty( $bp->site_options['bp-disable-account-deletion'] ) ) {
+			$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',
+				'position'        => 90,
+				'user_has_access' => bp_is_my_profile()
+			);
+		}
+
+		parent::setup_nav( $main_nav, $sub_nav );
+	}
+
+	/**
+	 * Set up the admin bar
+	 *
+	 * @global obj $bp
+	 */
+	function setup_admin_bar() {
+		global $bp;
+
+		// Prevent debug notices
+		$wp_admin_nav = array();
+
+		// Menus for logged in user
+		if ( is_user_logged_in() ) {
+
+			// Setup the logged in user variables
+			$user_domain   = $bp->loggedin_user->domain;
+			$settings_link = trailingslashit( $user_domain . $this->slug );
+
+			// Add main Settings menu
+			$wp_admin_nav[] = array(
+				'parent' => $bp->my_account_menu_id,
+				'id'     => 'my-account-' . $this->id,
+				'title'  => __( 'Settings', 'buddypress' ),
+				'href'   => trailingslashit( $settings_link )
+			);
+
+			// General Account
+			$wp_admin_nav[] = array(
+				'parent' => 'my-account-' . $this->id,
+				'id'     => 'my-account-' . $this->id . '-general',
+				'title'  => __( 'General', 'buddypress' ),
+				'href'   => trailingslashit( $settings_link . 'general' )
+			);
+
+			// Notifications
+			$wp_admin_nav[] = array(
+				'parent' => 'my-account-' . $this->id,
+				'id'     => 'my-account-' . $this->id . '-notifications',
+				'title'  => __( 'Notifications', 'buddypress' ),
+				'href'   => trailingslashit( $settings_link . 'notifications' )
+			);
+
+			// Delete Account
+			if ( !is_super_admin() && empty( $bp->site_options['bp-disable-account-deletion'] ) ) {
+				$wp_admin_nav[] = array(
+					'parent' => 'my-account-' . $this->id,
+					'id'     => 'my-account-' . $this->id . '-delete-account',
+					'title'  => __( 'Delete Account', 'buddypress' ),
+					'href'   => trailingslashit( $settings_link . 'delete-account' )
+				);
+			}
+		}
+
+		parent::setup_admin_bar( $wp_admin_nav );
+	}
+}
+// Create the settingss component
+$bp->settings = new BP_Settings_Component();
+
+?>
diff --git a/wp-content/plugins/buddypress/bp-settings/bp-settings-screens.php b/wp-content/plugins/buddypress/bp-settings/bp-settings-screens.php
new file mode 100644
index 0000000000000000000000000000000000000000..9b66e1b6d430b220fe20cded59cf07baddb45e31
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-settings/bp-settings-screens.php
@@ -0,0 +1,4 @@
+<?php
+// 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-template.php b/wp-content/plugins/buddypress/bp-settings/bp-settings-template.php
new file mode 100644
index 0000000000000000000000000000000000000000..7303775530f762a99b86abf8a1c285fbb0987435
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-settings/bp-settings-template.php
@@ -0,0 +1,60 @@
+<?php
+/**
+ * BuddyPress Settings Template Functions
+ *
+ * @package BuddyPress
+ * @subpackage Settings Template
+ */
+
+// Exit if accessed directly
+if ( !defined( 'ABSPATH' ) ) exit;
+
+/**
+ * Output the settings component slug
+ *
+ * @package BuddyPress
+ * @subpackage Settings Template
+ * @since 1.5
+ *
+ * @uses bp_get_settings_slug()
+ */
+function bp_settings_slug() {
+	echo bp_get_settings_slug();
+}
+	/**
+	 * Return the settings component slug
+	 *
+	 * @package BuddyPress
+	 * @subpackage Settings Template
+	 * @since 1.5
+	 */
+	function bp_get_settings_slug() {
+		global $bp;
+		return apply_filters( 'bp_get_settings_slug', $bp->settings->slug );
+	}
+
+/**
+ * Output the settings component root slug
+ *
+ * @package BuddyPress
+ * @subpackage Settings Template
+ * @since 1.5
+ *
+ * @uses bp_get_settings_root_slug()
+ */
+function bp_settings_root_slug() {
+	echo bp_get_settings_root_slug();
+}
+	/**
+	 * Return the settings component root slug
+	 *
+	 * @package BuddyPress
+	 * @subpackage Settings Template
+	 * @since 1.5
+	 */
+	function bp_get_settings_root_slug() {
+		global $bp;
+		return apply_filters( 'bp_get_settings_root_slug', $bp->settings->root_slug );
+	}
+
+?>
\ No newline at end of file
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 387bc746f7375f1783909d7d768b766e8fd44a12..bba9b09698e0080ebb9920876753fc4ae2fc4e96 100644
--- a/wp-content/plugins/buddypress/bp-themes/bp-default/404.php
+++ b/wp-content/plugins/buddypress/bp-themes/bp-default/404.php
@@ -1,29 +1,19 @@
-<?php get_header(); ?>
+<?php get_header() ?>
 
 	<div id="content">
-		<div class="padder">
+		<div class="padder one-column">
+			<?php do_action( 'bp_before_404' ); ?>
+			<div id="post-0" class="post page-404 error404 not-found" role="main">
+				<h2 class="posttitle"><?php _e( "Page not found", 'buddypress' ); ?></h2>
 
-		<?php do_action( 'bp_before_404' ) ?>
-
-		<div class="page 404">
-
-			<h2 class="pagetitle"><?php _e( 'Page Not Found', 'buddypress' ) ?></h2>
-
-			<div id="message" class="info">
-
-				<p><?php _e( 'The page you were looking for was not found.', 'buddypress' ) ?>
+				<p><?php _e( "We're sorry, but we can't find the page that you're looking for. Perhaps searching will help.", 'buddypress' ); ?></p>
+				<?php get_search_form(); ?>
 
+				<?php do_action( 'bp_404' ); ?>
 			</div>
 
-			<?php do_action( 'bp_404' ) ?>
-
-		</div>
-
-		<?php do_action( 'bp_after_404' ) ?>
-
+			<?php do_action( 'bp_after_404' ) ?>
 		</div><!-- .padder -->
 	</div><!-- #content -->
 
-	<?php locate_template( array( 'sidebar.php' ), true ) ?>
-
-<?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 8e633fd044fc4b74fef50cf7bea1d012c342881b..4c9ceb1b4e185531b5de6b057c9204d7292ccc06 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
@@ -4,9 +4,6 @@
  *
  * All of these functions enhance the responsiveness of the user interface in the default
  * theme by adding AJAX functionality.
- *
- * By default your child theme will inherit this AJAX functionality. You can however create
- * your own _inc/ajax.php file and add/remove AJAX functionality as you see fit.
  */
 
 /***
@@ -53,46 +50,85 @@ function bp_dtheme_ajax_querystring( $query_string, $object ) {
 	if ( !empty( $_POST['page'] ) && '-1' != $_POST['page'] )
 		$qs[] = 'page=' . $_POST['page'];
 
-	if ( !empty( $_POST['search_terms'] ) && __( 'Search anything...', 'buddypress' ) != $_POST['search_terms'] && 'false' != $_POST['search_terms'] && 'undefined' != $_POST['search_terms'] )
+	$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'] )
 		$qs[] = 'search_terms=' . $_POST['search_terms'];
 
 	/* Now pass the querystring to override default values. */
 	$query_string = empty( $qs ) ? '' : join( '&', (array)$qs );
 
-	return apply_filters( 'bp_dtheme_ajax_querystring', $query_string, $object, $_BP_COOKIE['bp-' . $object . '-filter'], $_BP_COOKIE['bp-' . $object . '-scope'], $_BP_COOKIE['bp-' . $object . '-page'], $_BP_COOKIE['bp-' . $object . '-search-terms'], $_BP_COOKIE['bp-' . $object . '-extras'] );
+	$object_filter = '';
+	if ( isset( $_BP_COOKIE['bp-' . $object . '-filter'] ) )
+		$object_filter = $_BP_COOKIE['bp-' . $object . '-filter'];
+
+	$object_scope = '';
+	if ( isset( $_BP_COOKIE['bp-' . $object . '-scope'] ) )
+		$object_scope = $_BP_COOKIE['bp-' . $object . '-scope'];
+
+	$object_page = '';
+	if ( isset( $_BP_COOKIE['bp-' . $object . '-page'] ) )
+		$object_page = $_BP_COOKIE['bp-' . $object . '-page'];
+
+	$object_search_terms = '';
+	if ( isset( $_BP_COOKIE['bp-' . $object . '-search-terms'] ) )
+		$object_search_terms = $_BP_COOKIE['bp-' . $object . '-search-terms'];
+
+	$object_extras = '';
+	if ( isset( $_BP_COOKIE['bp-' . $object . '-extras'] ) )
+		$object_extras = $_BP_COOKIE['bp-' . $object . '-extras'];
+
+	return apply_filters( 'bp_dtheme_ajax_querystring', $query_string, $object, $object_filter, $object_scope, $object_page, $object_search_terms, $object_extras );
 }
 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 */
 function bp_dtheme_object_template_loader() {
+
+ 	/**
+	 * AJAX requests happen too early to be seen by bp_update_is_directory()
+	 * so we do it manually here to ensure templates load with the correct
+	 * context. Without this check, templates will load the 'single' version
+	 * of themselves rather than the directory version.
+	 */
+	if ( !bp_current_action() )
+		bp_update_is_directory( true, bp_current_component() );
+
+	// Sanitize the post object
 	$object = esc_attr( $_POST['object'] );
+
+	// Locate the object template
 	locate_template( array( "$object/$object-loop.php" ), true );
 }
 add_action( 'wp_ajax_members_filter', 'bp_dtheme_object_template_loader' );
-add_action( 'wp_ajax_groups_filter', 'bp_dtheme_object_template_loader' );
-add_action( 'wp_ajax_blogs_filter', 'bp_dtheme_object_template_loader' );
-add_action( 'wp_ajax_forums_filter', 'bp_dtheme_object_template_loader' );
+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 */
+// This function will load the activity loop template when activity is requested via AJAX
 function bp_dtheme_activity_template_loader() {
 	global $bp;
 
-	/* We need to calculate and return the feed URL for each scope */
-	$feed_url = site_url( BP_ACTIVITY_SLUG . '/feed/' );
+	$scope = '';
+	if ( !empty( $_POST['scope'] ) )
+		$scope = $_POST['scope'];
 
-	switch ( $_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_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_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_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_ACTIVITY_SLUG . '/mentions/feed/';
-			delete_usermeta( $bp->loggedin_user->id, 'bp_new_mention_count' );
+			$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;
 	}
 
@@ -100,7 +136,7 @@ function bp_dtheme_activity_template_loader() {
 	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, $_POST['scope'] );
+	$result['feed_url'] = apply_filters( 'bp_dtheme_activity_feed_url', $feed_url, $scope );
 	ob_end_clean();
 
 	echo json_encode( $result );
@@ -112,7 +148,7 @@ add_action( 'wp_ajax_activity_get_older_updates', 'bp_dtheme_activity_template_l
 function bp_dtheme_post_update() {
 	global $bp;
 
-	/* Check the nonce */
+	// Check the nonce
 	check_admin_referer( 'post_update', '_wpnonce_post_update' );
 
 	if ( !is_user_logged_in() ) {
@@ -125,15 +161,19 @@ function bp_dtheme_post_update() {
 		return false;
 	}
 
-	if ( empty( $_POST['object'] ) && function_exists( 'bp_activity_post_update' ) ) {
+	$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'] ) && function_exists( 'groups_post_update' ) )
+		if ( !empty( $_POST['item_id'] ) && bp_is_active( 'groups' ) )
 			$activity_id = groups_post_update( array( 'content' => $_POST['content'], 'group_id' => $_POST['item_id'] ) );
-	} else
+
+	} else {
 		$activity_id = apply_filters( 'bp_activity_custom_update', $_POST['object'], $_POST['item_id'], $_POST['content'] );
+	}
 
-	if ( !$activity_id ) {
+	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;
 	}
@@ -150,7 +190,7 @@ add_action( 'wp_ajax_post_update', 'bp_dtheme_post_update' );
 function bp_dtheme_new_activity_comment() {
 	global $bp;
 
-	/* Check the nonce */
+	// Check the nonce
 	check_admin_referer( 'new_activity_comment', '_wpnonce_new_activity_comment' );
 
 	if ( !is_user_logged_in() ) {
@@ -169,35 +209,37 @@ function bp_dtheme_new_activity_comment() {
 	}
 
 	$comment_id = bp_activity_new_comment( array(
-		'content' => $_POST['content'],
 		'activity_id' => $_POST['form_id'],
-		'parent_id' => $_POST['comment_id']
-	));
+		'content'     => $_POST['content'],
+		'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;
 	}
 
-	if ( bp_has_activities ( 'include=' . $comment_id ) ) : ?>
-		<?php while ( bp_activities() ) : bp_the_activity(); ?>
-			<li id="acomment-<?php bp_activity_id() ?>">
-				<div class="acomment-avatar">
-					<?php bp_activity_avatar() ?>
-				</div>
-
-				<div class="acomment-meta">
-					<?php echo bp_core_get_userlink( bp_get_activity_user_id() ) ?> &middot; <?php printf( __( '%s ago', 'buddypress' ), bp_core_time_since( bp_core_current_time() ) ) ?> &middot;
-					<a class="acomment-reply" href="#acomment-<?php bp_activity_id() ?>" id="acomment-reply-<?php echo esc_attr( $_POST['form_id'] ) ?>"><?php _e( 'Reply', 'buddypress' ) ?></a>
-					 &middot; <a href="<?php echo wp_nonce_url( $bp->root_domain . '/' . $bp->activity->slug . '/delete/' . bp_get_activity_id() . '?cid=' . $comment_id, 'bp_activity_delete_link' ) ?>" class="delete acomment-delete confirm"><?php _e( 'Delete', 'buddypress' ) ?></a>
-				</div>
-
-				<div class="acomment-content">
-					<?php bp_activity_content_body() ?>
-				</div>
-			</li>
-		<?php endwhile; ?>
-	 <?php endif;
+	global $activities_template;
+
+	// Load the new activity item into the $activities_template global
+	bp_has_activities( 'display_comments=stream&include=' . $comment_id );
+
+	// Swap the current comment with the activity item we just loaded
+	$activities_template->activity->id              = $activities_template->activities[0]->item_id;
+	$activities_template->activity->current_comment = $activities_template->activities[0];
+
+	$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.
+	if ( empty( $template ) )
+		$template = BP_PLUGIN_DIR . '/bp-themes/bp-default/activity/comment.php';
+
+	load_template( $template, false );
+
+	unset( $activities_template );
 }
 add_action( 'wp_ajax_new_activity_comment', 'bp_dtheme_new_activity_comment' );
 
@@ -205,7 +247,7 @@ add_action( 'wp_ajax_new_activity_comment', 'bp_dtheme_new_activity_comment' );
 function bp_dtheme_delete_activity() {
 	global $bp;
 
-	/* Check the nonce */
+	// Check the nonce
 	check_admin_referer( 'bp_activity_delete_link' );
 
 	if ( !is_user_logged_in() ) {
@@ -213,23 +255,29 @@ function bp_dtheme_delete_activity() {
 		return false;
 	}
 
-	$activity = new BP_Activity_Activity( $_POST['id'] );
-
-	/* Check access */
-	if ( !is_super_admin() && $activity->user_id != $bp->loggedin_user->id )
+	if ( empty( $_POST['id'] ) || !is_numeric( $_POST['id'] ) ) {
+		echo '-1';
 		return false;
+	}
 
-	if ( empty( $_POST['id'] ) || !is_numeric( $_POST['id'] ) )
+	$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;
+	}
 
-	/* Call the action before the delete so plugins can still fetch information about it */
-	do_action( 'bp_activity_action_delete_activity', $_POST['id'], $activity->user_id );
+	// 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' => $_POST['id'], 'user_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;
 	}
 
+	do_action( 'bp_activity_action_delete_activity', $activity->id, $activity->user_id );
+
 	return true;
 }
 add_action( 'wp_ajax_delete_activity', 'bp_dtheme_delete_activity' );
@@ -256,13 +304,15 @@ function bp_dtheme_delete_activity_comment() {
 		return false;
 
 	/* Call the action before the delete so plugins can still fetch information about it */
-	do_action( 'bp_activity_action_delete_activity', $_POST['id'], $comment->user_id );
+	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;
 	}
 
+	do_action( 'bp_activity_action_delete_activity', $_POST['id'], $comment->user_id );
+
 	return true;
 }
 add_action( 'wp_ajax_delete_activity_comment', 'bp_dtheme_delete_activity_comment' );
@@ -285,6 +335,34 @@ function bp_dtheme_unmark_activity_favorite() {
 }
 add_action( 'wp_ajax_activity_mark_unfav', 'bp_dtheme_unmark_activity_favorite' );
 
+/**
+ * AJAX handler for Read More link on long activity items
+ *
+ * @package BuddyPress
+ * @since 1.5
+ */
+function bp_dtheme_get_single_activity_content() {
+	$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;
+
+	if ( !$activity )
+		exit(); // todo: error?
+
+	do_action_ref_array( 'bp_dtheme_get_single_activity_content', array( &$activity ) );
+
+	// Activity content retrieved through AJAX should run through normal filters, but not be truncated
+	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();
+}
+add_action( 'wp_ajax_get_single_activity_content', 'bp_dtheme_get_single_activity_content' );
+
 /* AJAX invite a friend to a group functionality */
 function bp_dtheme_ajax_invite_user() {
 	global $bp;
@@ -294,7 +372,7 @@ function bp_dtheme_ajax_invite_user() {
 	if ( !$_POST['friend_id'] || !$_POST['friend_action'] || !$_POST['group_id'] )
 		return false;
 
-	if ( !groups_is_user_admin( $bp->loggedin_user->id, $_POST['group_id'] ) )
+	if ( !bp_groups_user_can_send_invites( $_POST['group_id'] ) )
 		return false;
 
 	if ( !friends_check_friendship( $bp->loggedin_user->id, $_POST['friend_id'] ) )
@@ -312,7 +390,7 @@ 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="remove" href="' . wp_nonce_url( $bp->loggedin_user->domain . $bp->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>';
 
@@ -340,7 +418,7 @@ function bp_dtheme_ajax_addremove_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->friends->slug . '/add-friend/' . $_POST['fid'], 'friends_add_friend' ) . '">' . __( 'Add Friend', 'buddypress' ) . '</a>';
+			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 if ( 'not_friends' == BP_Friends_Friendship::check_is_friend( $bp->loggedin_user->id, $_POST['fid'] ) ) {
@@ -350,7 +428,7 @@ function bp_dtheme_ajax_addremove_friend() {
 		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->friends->slug . '" class="requested">' . __( 'Friendship Requested', 'buddypress' ) . '</a>';
+			echo '<a href="' . $bp->loggedin_user->domain . bp_get_friends_slug() . '/requests" class="requested">' . __( 'Friendship Requested', 'buddypress' ) . '</a>';
 		}
 	} else {
 		echo __( 'Request Pending', 'buddypress' );
@@ -392,9 +470,6 @@ function bp_dtheme_ajax_joinleave_group() {
 	if ( !$group = new BP_Groups_Group( $_POST['gid'], false, false ) )
 		return false;
 
-	if ( 'hidden' == $group->status )
-		return false;
-
 	if ( !groups_is_user_member( $bp->loggedin_user->id, $group->id ) ) {
 
 		if ( 'public' == $group->status ) {
@@ -442,11 +517,11 @@ function bp_dtheme_ajax_close_notice() {
 	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 = get_user_meta( $userdata->ID, 'closed_notices', true );
+		$notice_ids = bp_get_user_meta( $userdata->ID, 'closed_notices', true );
 
 		$notice_ids[] = (int) $_POST['notice_id'];
 
-		update_user_meta( $userdata->ID, 'closed_notices', $notice_ids );
+		bp_update_user_meta( $userdata->ID, 'closed_notices', $notice_ids );
 	}
 }
 add_action( 'wp_ajax_messages_close_notice', 'bp_dtheme_ajax_close_notice' );
@@ -465,7 +540,7 @@ function bp_dtheme_ajax_messages_send_reply() {
 				<?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 ago', 'buddypress' ), bp_core_time_since( bp_core_current_time() ) ) ?></span></strong>
+				<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>
 
 				<?php do_action( 'bp_after_message_meta' ) ?>
 			</div>
@@ -496,7 +571,7 @@ function bp_dtheme_ajax_message_markunread() {
 	} else {
 		$thread_ids = explode( ',', $_POST['thread_ids'] );
 
-		for ( $i = 0; $i < count($thread_ids); $i++ ) {
+		for ( $i = 0, $count = count( $thread_ids ); $i < $count; ++$i ) {
 			BP_Messages_Thread::mark_as_unread($thread_ids[$i]);
 		}
 	}
@@ -512,7 +587,7 @@ function bp_dtheme_ajax_message_markread() {
 	} else {
 		$thread_ids = explode( ',', $_POST['thread_ids'] );
 
-		for ( $i = 0; $i < count($thread_ids); $i++ ) {
+		for ( $i = 0, $count = count( $thread_ids ); $i < $count; ++$i ) {
 			BP_Messages_Thread::mark_as_read($thread_ids[$i]);
 		}
 	}
@@ -528,31 +603,72 @@ function bp_dtheme_ajax_messages_delete() {
 	} else {
 		$thread_ids = explode( ',', $_POST['thread_ids'] );
 
-		for ( $i = 0; $i < count($thread_ids); $i++ )
+		for ( $i = 0, $count = count( $thread_ids ); $i < $count; ++$i )
 			BP_Messages_Thread::delete($thread_ids[$i]);
 
-		_e('Messages deleted.', 'buddypress');
+		_e( 'Messages deleted.', 'buddypress' );
 	}
 }
 add_action( 'wp_ajax_messages_delete', 'bp_dtheme_ajax_messages_delete' );
 
-/* AJAX autocomplete your friends names on the compose screen */
+/**
+ * bp_dtheme_ajax_messages_autocomplete_results()
+ *
+ * AJAX handler for autocomplete. Displays friends only, unless BP_MESSAGES_AUTOCOMPLETE_ALL is defined
+ *
+ * @global object object $bp Global BuddyPress settings object
+ * @return none
+ */
 function bp_dtheme_ajax_messages_autocomplete_results() {
 	global $bp;
 
-	$friends = false;
+	// Include everyone in the autocomplete, or just friends?
+	if ( $bp->messages->slug == $bp->current_component )
+		$autocomplete_all = $bp->messages->autocomplete_all;
+
+	$friends  = false;
+	$pag_page = 1;
+
+	$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 ) ) {
+		$users = BP_Core_User::search_users( $_GET['q'], $limit, $pag_page );
+
+		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 )
+					$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 );
+
+			// 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'] ) )
+				$user_ids = apply_filters( 'bp_friends_autocomplete_ids', $users['friends'], $_GET['q'], $limit );
+		}
+	}
 
-	// Get the friend ids based on the search terms
-	if ( function_exists( 'friends_search_friends' ) )
-		$friends = friends_search_friends( $_GET['q'], $bp->loggedin_user->id, $_GET['limit'], 1 );
+	if ( !empty( $user_ids ) ) {
+		foreach ( $user_ids as $user_id ) {
+			$ud = get_userdata( $user_id );
+			if ( !$ud )
+				continue;
 
-	$friends = apply_filters( 'bp_friends_autocomplete_list', $friends, $_GET['q'], $_GET['limit'] );
+			if ( bp_is_username_compatibility_mode() )
+				$username = $ud->user_login;
+			else
+				$username = $ud->user_nicename;
 
-	if ( $friends['friends'] ) {
-		foreach ( (array)$friends['friends'] as $user_id ) {
-			$ud = get_userdata($user_id);
-			$username = $ud->user_login;
-			echo bp_core_fetch_avatar( array( 'item_id' => $user_id, 'type' => 'thumb', 'width' => 15, 'height' => 15 ) ) . ' &nbsp;' . bp_core_get_user_displayname( $user_id ) . ' (' . $username . ')
+			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 . ')
 			';
 		}
 	}
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
new file mode 100644
index 0000000000000000000000000000000000000000..a3c75ae11e2965055edcb5cc07ea27de0192afdd
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-themes/bp-default/_inc/css/default-rtl.css
@@ -0,0 +1,769 @@
+/*--------------------------------------------------------------
+Hello, this is the BuddyPress Default rtl stylesheet.
+Right to left styles. This will transform the theme to read from
+right to left for languages that support this method.
+
+----------------------------------------------------------------
+>>> TABLE OF CONTENTS:
+----------------------------------------------------------------
+1.0 - Structural
+	1.1 - Content
+	1.2 - Header
+	1.3 - Footer
+	1.4 - Sidebar
+2.0 - Non-structural
+	2.1 - Text
+	2.2 - Headers
+	2.3 - Lists
+3.0 - Navigation
+	3.1 - Pagination
+4.0 - WordPress
+	4.1 - Alignments
+	4.2 - Comments
+	4.3 - Gallery
+	4.4 - Images
+	4.5 - Posts
+5.0 - BuddyPress
+	5.1 - Activity
+		5.1.1 - Activity Listing
+		5.1.2 - Activity Comments
+	5.2 - Admin Bar
+	5.3 - Ajax Loading
+	5.4 - Directories - Members, Groups, Blogs, Forums
+	5.5 - Error / Success Messages
+	5.6 - Forms
+	5.7 - Topics and Tables - Forums and General
+	5.8 - Headers, Lists and Tabs - Activity, Groups, Blogs, Forums
+	5.9 - Private Messaging Threads
+--------------------------------------------------------------*/
+/*--------------------------------------------------------------
+1.0 - Structure
+--------------------------------------------------------------*/
+body {
+	direction: rtl;
+	unicode-bidi: embed;
+}
+body {
+	background: #eaeaea url( ../images/background.gif ) top right repeat-x;
+}
+
+
+/*--------------------------------------------------------------
+1.1 - Content
+--------------------------------------------------------------*/
+div#container {
+	border-left: 1px solid #e0e0e0;
+	border-right: 0;
+}
+div#content {
+	float: right;
+	-moz-border-radius-topleft: 0;
+	-moz-border-radius-topright: 6px;
+	-webkit-border-top-right-radius: 6px;
+	-webkit-border-top-left-radius: 0;
+	-moz-border-radius-bottomleft: 0;
+	-moz-border-radius-bottomright: 6px;
+	-webkit-border-bottom-right-radius: 6px;
+	-webkit-border-bottom-left-radius: 0;
+}
+div#content .padder {
+	margin-left: 225px;
+	margin-right: 0;
+	border-left: 1px solid #e4e4e4;
+	border-right: 0;
+	-moz-border-radius-topright: 6px;
+	-moz-border-radius-topleft: 0;
+	-webkit-border-top-right-radius: 6px;
+	-webkit-border-top-left-radius: 0;
+	-moz-border-radius-bottomright: 6px;
+	-moz-border-radius-bottomleft: 0;
+	-webkit-border-bottom-right-radius: 6px;
+	-webkit-border-bottom-left-radius: 0;
+}
+div#content .left-menu {
+	float: right;
+}
+div#content .main-column {
+	margin-right: 190px;
+	margin-left: 0;
+}
+
+
+/*--------------------------------------------------------------
+1.2 - Header
+--------------------------------------------------------------*/
+#header #search-bar {
+	left: 0;
+	right: auto;
+	text-align: left;
+}
+#header #search-bar input[type=text] {
+	margin-left: 4px;
+	margin-right: 0;
+}
+#header #search-bar input[type=submit] {
+	margin-right: 4px;
+	margin-left: 0;
+}
+#header h1 {
+	float: right;
+	left: auto;
+	right: 20px;
+}
+
+
+/*--------------------------------------------------------------
+1.3 - Footer
+--------------------------------------------------------------*/
+#footer-widget-area div.widget-area > ul {
+	float: right;
+	margin-left: 19px;
+	margin-right: 0;
+}
+#footer-widget-area ul.item-list li img.avatar {
+	margin-right: 15px; /* border is 4px */
+	margin-left: 0;
+}
+
+
+/*--------------------------------------------------------------
+1.4 - Sidebar
+--------------------------------------------------------------*/
+div#sidebar {
+	float: right;
+	margin-right: -226px;
+	margin-left: 0;
+	border-right: 1px solid #e4e4e4;
+	border-left: 0;
+	-moz-border-radius-topleft: 3px;
+	-webkit-border-top-left-radius: 3px;
+	-moz-border-radius-topright: 0;
+	-webkit-border-top-right-radius: 0;
+}
+div#sidebar div#sidebar-me img.avatar {
+	float: right;
+	margin: 0 0 15px 10px;
+}
+div#sidebar ul#bp-nav {
+	clear: right;
+}
+#footer-widget-area h3.widgettitle,
+div#sidebar h3.widgettitle {
+	margin: 25px -19px 10px -20px;
+	clear: right;
+}
+#footer-widget-area ul.item-list img.avatar,
+div#sidebar ul.item-list img.avatar {
+	margin-left: 10px;
+	margin-right: 0;
+}
+#footer-widget-area div.item-options,
+div#sidebar div.item-options {
+	margin: -10px -19px 0 -20px;
+}
+#footer-widget-area div.item-meta,
+#footer-widget-area div.item-content,
+div#sidebar div.item-meta,
+div#sidebar div.item-content {
+	margin-right: 38px;
+	margin-left: 0;
+}
+
+
+/*--------------------------------------------------------------
+2.0 - Non-structural
+--------------------------------------------------------------*/
+p.postmetadata {
+	clear: right;
+}
+
+
+/*--------------------------------------------------------------
+2.1 - Text
+--------------------------------------------------------------*/
+code {
+	font-family: "Monaco", courier, sans-serif;
+}
+blockquote {
+	font-family: sans-serif;
+}
+table th {
+	text-align: right;
+}
+div.author-box,
+div.comment-avatar-box {
+	float: right;
+	margin: 0 0 15px 15px;
+	font-family: sans-serif;
+}
+div.post-content {
+	margin-right: 105px;
+	margin-left: 0;
+}
+p.date,
+p.postmetadata,
+div.comment-meta,
+div.comment-options {
+	font-family: sans-serif;
+}
+
+
+/*--------------------------------------------------------------
+2.2 - Headers
+--------------------------------------------------------------*/
+/*--------------------------------------------------------------
+2.3 - Lists
+--------------------------------------------------------------*/
+div.page ul,
+div.page ol,
+div.page dl,
+div.post ul,
+div.post ol,
+div.post dl {
+	margin: 0 1.5em 18px 0;
+}
+dl {
+	margin-right: 0;
+}
+
+
+/*--------------------------------------------------------------
+3.0 - Navigation
+--------------------------------------------------------------*/
+#navigation {
+	text-align: left;
+}
+#nav {
+	margin: 40px 0 0 20px;
+}
+#nav li {
+	margin-left: auto;
+	margin-right: 5px;
+}
+#nav li a {
+	text-align: right;
+}
+#nav li li {
+	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;
+	right: 125px;
+}
+.navigation,
+.paged-navigation,
+.comment-navigation {
+	font-family: sans-serif;
+}
+
+
+/*--------------------------------------------------------------
+3.1 - Pagination
+--------------------------------------------------------------*/
+div.pagination .pag-count {
+	float: right;
+}
+div.pagination .pagination-links {
+	float: left;
+}
+
+
+/*--------------------------------------------------------------
+4.0 - WordPress
+--------------------------------------------------------------*/
+/*--------------------------------------------------------------
+4.1 - Alignments
+--------------------------------------------------------------*/
+.alignright {
+	float: left;
+}
+.alignleft {
+	float: right;
+}
+.clear {
+	clear: right;
+}
+img.avatar {
+	float: right;
+}
+.accessibly-hidden {
+	left: auto;
+	right: -999em;
+}
+
+
+/*--------------------------------------------------------------
+4.2 - Comments
+--------------------------------------------------------------*/
+.comments {
+	float: left;
+}
+ol.commentlist li.comment {
+	clear: right;
+}
+.commentlist ul.children {
+	margin: 15px 70px 15px 0;
+}
+.commentlist ul.children ul {
+	margin: 0 25px 0 0;
+	padding-left: 0;
+}
+ol.commentlist #respond {
+	clear: right;
+	margin-left: auto;
+	margin-right: 70px;
+}
+.commentlist ul.children #respond {
+	margin-left: 20px;
+	margin-right: 35px;
+}
+ol.commentlist div.comment-avatar-box {
+	float: right;
+	margin: 15px 0 0 15px;
+}
+.commentlist ul.children div.comment-avatar-box {
+	float: right;
+	margin: 0 0 0 10px;
+}
+#comments ol.commentlist ol {
+	margin: 0 2.5em 18px 0;
+}
+#reply-title small {
+	float: left;
+}
+#reply-title small a {
+	margin-right: auto;
+	margin-left: 0;
+}
+#respond .comment-avatar-box {
+	float: right;
+	margin: 0 0 0 15px;
+}
+.acomment-options {
+	float: right;
+	margin-right: 40px;
+	margin-left: auto;
+}
+.comment-options .comment-reply-link,
+.comment-options .comment-edit-link {
+	margin-left: 5px;
+	margin-right: auto;
+}
+
+
+/*--------------------------------------------------------------
+4.3 - Gallery
+--------------------------------------------------------------*/
+dd.wp-caption p.wp-caption-text,
+.wp-caption p.wp-caption-text {
+	padding: 0 0 5px 4px;
+}
+
+
+/*--------------------------------------------------------------
+4.4 - Images
+--------------------------------------------------------------*/
+/*--------------------------------------------------------------
+4.5 - Posts
+--------------------------------------------------------------*/
+.page .tags,
+.post .tags {
+	float: right;
+}
+
+
+/*--------------------------------------------------------------
+5.0 - BuddyPress
+--------------------------------------------------------------*/
+/*--------------------------------------------------------------
+5.1 - Activity
+--------------------------------------------------------------*/
+form#whats-new-form h5 {
+	margin-right: 76px;
+	margin-left: 0;
+}
+form#whats-new-form #whats-new-avatar {
+	float: right;
+}
+form#whats-new-form #whats-new-content {
+	margin-right: 54px;
+	padding-right: 22px;
+}
+form#whats-new-form #whats-new-submit {
+	float: left;
+}
+
+
+/*--------------------------------------------------------------
+5.1.1 - Activity Listing
+--------------------------------------------------------------*/
+.activity-header {
+	margin-left: 20px;
+	margin-right: auto;
+}
+.activity-list .activity-avatar {
+	float: right;
+}
+.activity-list li.mini .activity-avatar img.avatar,
+.activity-list li.mini .activity-avatar img.FB_profile_pic {
+	margin-right: 30px;
+	margin-left: 0;
+}
+body.activity-permalink .activity-list li .activity-header > p {
+	margin-left: auto;
+	margin-right: -35px;
+	padding: 5px 35px 0 0;
+}
+.activity-list li.mini .activity-content p {
+	float: right;
+}
+.activity-list li.mini .activity-meta {
+	left: 0;
+	right: auto;
+}
+body.activity-permalink .activity-list li.mini .activity-meta {
+	left: 15px;
+	right: auto;
+}
+.activity-list li.mini .activity-comments {
+	clear: right;
+}
+.activity-list li .activity-inreplyto {
+	margin-right: 5px;
+	margin-left: 0;
+	padding-right: 25px;
+	padding-left: 0;
+	background-position: 100% 0;
+}
+.activity-list .activity-content {
+	margin-right: 70px;
+	margin-left: 0;
+}
+.activity-list li.new_forum_post .activity-content .activity-inner,
+.activity-list li.new_forum_topic .activity-content .activity-inner {
+	border-left: none;
+	margin-left: 0;
+	padding-left: 0;
+	border-right: 2px solid #EAEAEA;
+	margin-right: 5px;
+	padding-right: 10px;
+}
+body.activity-permalink .activity-list li .activity-content {
+	margin-right: 185px;
+	margin-left: 0;
+}
+body.activity-permalink .activity-list li .activity-content > p {
+	background-position: top right;
+	margin-right: -35px;
+	margin-left: 0;
+	padding: 5px 38px 0 0;
+}
+.activity-list .activity-content > p > a:first-child,
+span.highlight,
+.activity-list .activity-content > .comment-header > a:first-child {
+	margin-left: 3px;
+	margin-right: 0;
+}
+.activity-list .activity-content img.thumbnail {
+	float: right;
+	margin: 0 0 5px 10px;
+}
+.activity-list li.load-more {
+	border-left: 1px solid #ddd;
+	border-right: 0;
+}
+a.bp-secondary-action,
+span.highlight {
+	margin-left: 5px;
+	margin-right: auto;
+}
+.activity-list .activity-content .activity-inner,
+.activity-list .activity-content blockquote {
+	margin-left: 10px;
+	margin-right: 0;
+}
+
+
+/*--------------------------------------------------------------
+5.1.2 - Activity Comments
+--------------------------------------------------------------*/
+div.activity-comments {
+	margin: 0 70px 0 0;
+}
+body.activity-permalink div.activity-comments {
+	margin-right: 185px;
+	margin-left: 0;
+}
+div.activity-comments ul {
+	clear: right;
+}
+div.activity-comments > ul {
+	padding: 0 10px 0 0;
+}
+div.activity-comments ul li > ul {
+	margin-left: 0;
+	margin-right: 30px;
+	padding-left: 0;
+	padding-right: 10px;
+}
+div.activity-comments div.acomment-avatar img {
+	float: right;
+	margin-left: 10px;
+	margin-right: 0;
+}
+div.activity-comments div.acomment-content {
+	margin-left: 0;
+	margin-right: 40px;
+}
+div.activity-comments form.ac-form {
+	margin: 10px 33px 10px 0;
+	border-left: 1px solid #ddd;
+	border-right: 0;
+}
+div.activity-comments li form.ac-form {
+	margin-left: 15px;
+	margin-right: 0;
+}
+div.activity-comments form.root {
+	margin-right: 0;
+}
+div.activity-comments form.loading {
+	background-position: 88% 95%;
+}
+div.activity-comments form div.ac-reply-avatar {
+	float: right;
+}
+div.activity-comments form div.ac-reply-content {
+	margin-right: 50px;
+	margin-left: 0;
+	padding-right: 15px;
+	padding-left: 0;
+}
+body.activity-permalink div.activity-comments > ul {
+	padding: 0 15px 0 10px;
+}
+
+
+/*--------------------------------------------------------------
+5.2 - Admin Bar
+--------------------------------------------------------------*/
+/*--------------------------------------------------------------
+5.3 - Ajax Loading
+--------------------------------------------------------------*/
+a.loading {
+	background-position: 5% 50% !important;
+	padding-left: 25px !important;
+	padding-right: 0 !important;
+}
+
+
+/*--------------------------------------------------------------
+5.4 - Directories - Members, Groups, Blogs, Forums
+--------------------------------------------------------------*/
+div.dir-search {
+	float: left;
+}
+
+
+/*--------------------------------------------------------------
+5.5 - Error / Success Messages
+--------------------------------------------------------------*/
+span.activity,
+div#message p {
+	border-left: 1px solid #FFE8C4;
+	border-right: 0;
+}
+
+
+/*--------------------------------------------------------------
+5.6 - Forms
+--------------------------------------------------------------*/
+.standard-form#signup_form div.submit {
+	float: left;
+}
+.standard-form#signup_form div.signup-avatar {
+	margin-left: 15px;
+	margin-right: 0;
+}
+.standard-form div.submit input {
+	margin-left: 15px;
+	margin-right: 0;
+}
+.standard-form div.radio ul {
+	margin: 10px 38px 15px 0;
+}
+.standard-form #basic-details-section,
+.standard-form #blog-details-section,
+.standard-form #profile-details-section {
+	float: right;
+}
+.standard-form #profile-details-section {
+	float: left;
+}
+.standard-form #blog-details-section {
+	clear: right;
+}
+a.button,
+input[type=submit],
+input[type=button],
+ul.button-nav li a,
+div.generic-button a {
+	background-position: right top;
+}
+div.accept, div.reject {
+	float: right;
+	margin-left: 0;
+	margin-right: 10px;
+}
+ul.button-nav li {
+	float: right;
+	margin: 0 0 10px 10px;
+}
+
+
+/*--------------------------------------------------------------
+5.7 - Topics and Tables - Forums and General
+--------------------------------------------------------------*/
+table tr td.label {
+	border-left: 1px solid #eaeaea;
+	border-right: 0;
+}
+table.forum tr.closed td.td-title {
+	padding-right: 35px;
+	padding-left: 0;
+	background-position: 5% 50%;
+}
+table.forum tr > td:first-child,
+table.forum tr > th:first-child {
+	padding-right: 15px;
+	padding-left: 0;
+}
+table.forum tr > td:last-child,
+table.forum tr > th:last-child {
+	padding-left: 15px;
+	padding-right: 0;
+}
+table.forum tr th#th-title,
+table.forum tr th#th-poster,
+table.forum tr th#th-group,
+table.forum td.td-poster,
+table.forum td.td-group,
+table.forum td.td-title {
+	text-align: right;
+}
+table.forum td img.avatar {
+	margin-left: 5px;
+	margin-right: 0;
+}
+ul#topic-post-list li div.post-content {
+	margin-right: 54px;
+	margin-left: 0;
+}
+div.admin-links {
+	left: 25px;
+	right: auto
+}
+div#topic-meta div.admin-links {
+	left: 0;
+	right: auto;
+}
+
+
+/*--------------------------------------------------------------
+5.8 - Headers, Lists and Tabs - Activity, Groups, Blogs, Forums
+--------------------------------------------------------------*/
+div#item-header img.avatar {
+	float: right;
+	margin: 0 0 25px 15px;
+}
+div#item-header span.activity {
+	margin: 0 4px 5px 0;
+}
+div#item-header div#item-actions {
+	float: left;
+	margin: 0 15px 15px 0;
+	text-align: left;
+}
+div#item-header ul li {
+	float: left;
+}
+div#item-header div.generic-button,
+div#item-header a.button {
+	float: right;
+	margin: 10px 0 0 10px;
+}
+ul.item-list li img.avatar {
+	float: right;
+	margin: 0 0 0 10px;
+}
+ul.item-list li div.item-desc {
+	margin: 10px 64px 0 0;
+}
+ul.item-list li div.action {
+	left: 0;
+	right: auto;
+	text-align: left;
+}
+div.item-list-tabs {
+	clear: right;
+}
+div.item-list-tabs ul li {
+	float: right;
+	margin: 5px 5px 0 0;
+}
+div.item-list-tabs ul li:first-child {
+	margin-left: 0;
+	margin-right: 20px;
+}
+div.item-list-tabs ul li.last {
+	float: left;
+	margin: 7px 0 0 20px;
+}
+ul li.loading a {
+	background-position: 8% 50%;
+	padding-left: 30px !important;
+	padding-right: 0 !important;
+}
+div#item-nav ul li.loading a {
+	background-position: 12% 50%;
+}
+div.item-list-tabs ul li.feed a {
+	background-position: right center;
+	padding-right: 20px;
+	padding-left: 0;
+}
+
+
+/*--------------------------------------------------------------
+5.9 - Private Messaging Threads
+--------------------------------------------------------------*/
+div.messages-options-nav {
+	text-align: left;
+}
+div#message-thread img.avatar {
+	float: right;
+	margin: 0 0 0 10px;
+}
+div#message-thread strong span.activity {
+	margin: 4px 10px 0 0;
+}
+div#message-thread div.message-content {
+	margin-right: 45px;
+	margin-left: 0;
+}
+div#message-thread div.message-options {
+	text-align: left;
+}
\ No newline at end of file
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 746b5b97a2bb5c870254d0402968d9bf65842e27..9df949266b1c6f5120ca77a381a30512827c0862 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
@@ -1,1763 +1,2359 @@
-@import url( reset.css ); /* Reset browser defaults */
-
-/* > Global Elements
--------------------------------------------------------------- */
-
+/*--------------------------------------------------------------
+Hello, this is the BuddyPress Default theme stylesheet.
+
+----------------------------------------------------------------
+>>> TABLE OF CONTENTS:
+----------------------------------------------------------------
+1.0 - Reset - Based on work by Eric Meyer
+2.0 - Structural
+	2.1 - Content
+	2.2 - Header
+	2.3 - Footer
+	2.4 - Sidebar
+3.0 - Non-structural
+	3.1 - Text
+	3.2 - Headers
+	3.3 - Lists
+4.0 - Navigation
+	4.1 - Pagination
+5.0 - WordPress
+	5.1 - Alignments
+	5.2 - Comments
+	5.3 - Gallery
+	5.4 - Images
+	5.5 - Posts
+6.0 - BuddyPress
+	6.1 - Activity
+		6.1.1 - Activity Listing
+		6.1.2 - Activity Comments
+	6.2 - Admin Bar
+	6.3 - Directories - Members, Groups, Blogs, Forums
+	6.4 - Error / Success Messages
+	6.5 - Forms
+	6.6 - Ajax Loading
+	6.7 - Topics and Tables - Forums and General
+	6.8 - Headers, Lists and Tabs - Activity, Groups, Blogs, Forums
+	6.9 - Private Messaging Threads
+--------------------------------------------------------------*/
+
+/*--------------------------------------------------------------
+1.0 - Reset - Reset default browser CSS. Based on work by Eric
+Meyer: v1.0  http://meyerweb.com/eric/tools/css/reset/index.html
+--------------------------------------------------------------*/
+html,body,div,span,applet,object,iframe,
+h1,h2,h3,h4,h5,h6,p,blockquote,pre,
+a,abbr,acronym,address,big,cite,code,
+del,dfn,em,font,img,ins,kbd,q,s,samp,
+small,strike,strong,sub,sup,tt,var,
+b,u,i,center,
+dl,dt,dd,ol,ul,li,
+fieldset,form,label,legend,
+table,caption,tbody,tfoot,thead,tr,th,td{margin:0;padding:0;border:0;outline:0;font-size:100%;vertical-align:baseline;background:transparent;}
+body{background:#fff;line-height:1;}
+ol,ul{list-style:none;}
+blockquote,q{quotes:none;}
+blockquote:before,blockquote:after,
+q:before,q:after{content:'';content:none;}
+:focus{outline:0;}
+ins{text-decoration:none;}
+del{text-decoration:line-through;}
+table{border-collapse:collapse;border-spacing:0;}
+a img{border:none;}
+
+
+/*--------------------------------------------------------------
+2.0 - Structural
+--------------------------------------------------------------*/
 body {
-	background: #eaeaea url( ../images/background.gif ) top left repeat-x;
+	background-color: #eaeaea;
+	background-image: url( ../images/background.gif );
+	background-repeat: repeat-x;
+	background-position: top left;
+	color: #555;
 	font-size: 12px;
 	font-family: Arial, Tahoma, Verdana, sans-serif;
 	line-height: 170%;
-	color: #555;
-	width: 90%;
-	min-width: 960px;
 	max-width: 1250px;
 	margin: 0 auto;
-	padding-top: 0 !important; /* Remove the top padding space for the admin bar in this theme */
+	width: 95%;
 }
-	body.activity-permalink {
-		min-width: 960px;
-		max-width: 960px;
-	}
-
-h1, h2, h3, h4, h5, h6 {
-	margin: 5px 0 15px 0;
+.padder {
+	padding: 19px;
+}
+div#container {
+	background: #fff;
+	border-right: 1px solid #e0e0e0;
+	border-bottom: 1px solid #e0e0e0;
+	-moz-border-radius: 6px;
+	-webkit-border-radius: 6px;
+	border-radius: 6px;
+	overflow: hidden;
+	position: relative;
+	width: 100%;
+}
+body.activity-permalink div#container {
+	background: none;
+	border: none;
 }
 
-h1 { font-size: 28px; margin-bottom: 25px; }
-h2 { font-size: 24px; margin-bottom: 20px; }
-h3 { font-size: 20px; }
-h4 { font-size: 16px; margin-bottom: 15px; }
-h5 { font-size: 14px; margin-bottom: 0; }
-h6 { font-size: 12px; margin-bottom: 0; }
-
-a { color: #1fb3dd; }
-a:hover, a:active { color: #888; }
-a:focus { outline: 1px dotted #ccc; }
-
-.padder { padding: 19px; }
-.clear { clear: left; }
-
-p {	margin-bottom: 15px; }
-p:last-child { margin-bottom: 0; }
 
-hr {
-	background-color:#E7E7E7;
-	border:0 none;
-	clear:both;
-	height:1px;
-	margin: 20px 0;
+/*--------------------------------------------------------------
+2.1 - Content
+--------------------------------------------------------------*/
+div#content {
+	-moz-border-radius-topleft: 6px;
+	-webkit-border-top-left-radius: 6px;
+	-moz-border-radius-bottomleft: 6px;
+	-webkit-border-bottom-left-radius: 6px;
+	border-top-left-radius: 6px;
+	border-top-right-radius: 6px;
+	float: left;
+	width: 100%;
 }
-
-img.avatar {
+div#content .padder {
+	border-right: 1px solid #ddd;
+	-moz-border-radius-topleft: 6px;
+	-webkit-border-top-left-radius: 6px;
+	-moz-border-radius-bottomleft: 6px;
+	-webkit-border-bottom-left-radius: 6px;
+	border-top-left-radius: 6px;
+	border-bottom-left-radius: 6px;
+	margin-right: 225px;
+}
+div#content .one-column {
+	border-right: 0 none;
+	margin-right: 0;
+}
+div#content .left-menu {
 	float: left;
-	border: 2px solid #eee;
+	width: 170px;
 }
-
-/* > Admin Bar
--------------------------------------------------------------- */
-
-#wp-admin-bar .padder {
-	width: 90% !important; /* Line up the admin bar with the content body in this theme */
+div#content .main-column {
+	margin-left: 190px;
 }
 
-/* > Header
--------------------------------------------------------------- */
 
+/*--------------------------------------------------------------
+2.2 - Header
+--------------------------------------------------------------*/
 #header {
-	position: relative;
-	color: #fff;
-	background: url( ../images/default_header.jpg);
+	background: #1fb3dd; /* Old browsers */
+	background: -moz-linear-gradient(top, #1fb3dd 0%, #1fb3dd 15%, #394c79 100%); /* FF3.6+ */
+	background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#1fb3dd), color-stop(15%,#1fb3dd), color-stop(100%,#394c79)); /* Chrome,Safari4+ */
+	background: -webkit-linear-gradient(top, #1fb3dd 0%,#1fb3dd 15%,#394c79 100%); /* Chrome10+,Safari5.1+ */
+	background: -o-linear-gradient(top, #1fb3dd 0%,#1fb3dd 15%,#394c79 100%); /* Opera11.10+ */
+	background: -ms-linear-gradient(top, #1fb3dd 0%,#1fb3dd 15%,#394c79 100%); /* IE10+ */
+	background: linear-gradient(top, #1fb3dd 0%,#1fb3dd 15%,#394c79 100%); /* W3C */
 	-moz-border-radius-bottomleft: 6px;
 	-webkit-border-bottom-left-radius: 6px;
+	border-bottom-left-radius: 6px;
 	-moz-border-radius-bottomright: 6px;
 	-webkit-border-bottom-right-radius: 6px;
+	border-bottom-right-radius: 6px;
+	color: #fff;
+	height: auto;
 	margin-bottom: 20px;
-	height: 100px;
 	padding-top: 25px;
+	position: relative;
+	z-index: 1000;
+}
+#header #search-bar {
+	margin-top: 5px;
+	text-align: right;
+	width: 100%;
+}
+#header #search-bar .padder {
+	padding: 10px 15px 0 20px;
+	height: auto;
+}
+#header #search-bar input[type=text] {
+	border: 1px inset #888;
+	-moz-border-radius: 3px;
+	-webkit-border-radius: 3px;
+	border-radius: 3px;
+	margin-right: 4px;
+	padding: 2px;
+}
+#header #search-bar input[type=submit] {
+	font-size: 11px;
+	padding: 1px 4px;
+	margin-left: 4px;
+}
+#header h1 {
+	float: left;
+	margin-bottom: 0;
+	margin-top: 0;
+}
+#header h1 a {
+	color: #fff;
+	font-size: 26px;
+	text-decoration: none;
 }
-	#header #search-bar {
-		position: absolute;
-		top: 25px;
-		right: 0;
-		width: 100%;
-		text-align: right;
-	}
-
-		#header h1 {
-			line-height: 230%;
-		}
-
-		#header #search-bar .padder {
-			padding: 10px 20px;
-		}
-
-		#header #search-bar input[type=text] {
-			-moz-border-radius: 3px;
-			-webkit-border-radius: 3px;
-			border-radius: 3px;
-			border: 1px inset #888;
-			padding: 2px;
-			margin-right: 4px;
-		}
-
-		#header #search-bar input[type=submit] {
-			font-size: 11px;
-			padding: 1px 4px;
-			margin-left: 4px;
-		}
-
-	#header h1 {
-		position: absolute;
-		bottom: 0;
-		left: 20px;
-		width: 44%;
-		margin: 0 0 -5px 0;
-	}
-		#header h1 a {
-			color: #fff;
-			font-size: 26px;
-			text-decoration: none;
-		}
-
-/* > Navigation
--------------------------------------------------------------- */
-
-ul#nav {
-	margin: 0;
-	padding: 0;
-	position: absolute;
-	right: 15px;
-	list-style: none;
-	bottom: 0;
-	max-width: 65%;
-}
-	ul#nav li {
-		float: left;
-		margin: 0 5px 0 0;
-	}
-		ul#nav li a {
-			display: block;
-			color: #fff;
-			text-decoration: none;
-			padding: 5px 15px;
-			background: url( ../images/60pc_black.png );
-			-moz-border-radius-topleft: 3px;
-			-webkit-border-top-left-radius: 3px;
-			-moz-border-radius-topright: 3px;
-			-webkit-border-top-right-radius: 3px;
-		}
-			ul#nav li.selected a, ul#nav li.current_page_item a {
-				background: #f5f5f5;
-				color: #555;
-			}
-			ul#nav a:focus { outline: none; }
 
-/* > Container
--------------------------------------------------------------- */
 
-div#container {
-	position: relative;
-	width: 100%;
+/*--------------------------------------------------------------
+2.3 - Footer
+--------------------------------------------------------------*/
+#footer {
+	margin: 20px 0;
+}
+#footer-widgets {
+	background: #fff;
+	border-bottom: 1px solid #e0e0e0;
+	border-right: 1px solid #e0e0e0;
 	-moz-border-radius: 6px;
 	-webkit-border-radius: 6px;
-	border-right: 1px solid #e0e0e0;
-	border-bottom: 1px solid #e0e0e0;
-	background: #fff;
+	border-radius: 6px;
+	padding: 19px;
+}
+#site-generator {
+	color: #4D4D4D;
+	margin: 20px 20px;
+	text-align: center;
+	text-shadow: #fafafa 1px 1px 0;
+}
+#footer-widget-area {
+	margin-top: -19px;
 	overflow: hidden;
 }
-	body.activity-permalink div#container {
-		background: none;
-		border: none;
-	}
+#footer-widget-area div.widget-area > ul {
+	float: left;
+	margin-right: 2.5%;
+	width: 23%;
+}
+#footer-widget-area div.widget-area > ul > li {
+	margin-top: 19px;
+}
+#footer-widget-area h3.widgettitle {
+	background: #eaeaea;
+	clear: left;
+	padding: 5px 15px;
+	font-size: 12px;
+	margin: 0 0 10px 0;
+}
+#footer-widget-area div div.item-options {
+	margin-left: 0;
+	margin-right: 0;
+}
+#footer-widget-area ul.item-list li img.avatar {
+	margin-left: 15px; /* border is 4px */
+}
+div#fourth ul.xoxo { margin-right: 0; }
 
-/* > Sidebar
--------------------------------------------------------------- */
 
+/*--------------------------------------------------------------
+2.4 - Sidebar
+--------------------------------------------------------------*/
 div#sidebar {
-	float: left;
-	width: 224px;
-	margin-left: -226px;
-	margin-top: 1px;
 	border-left: 1px solid #ddd;
 	-moz-border-radius-topright: 3px;
 	-webkit-border-top-right-radius: 3px;
-	background: url( ../images/sidebar_back.gif ) top left repeat-x;
+	border-top-right-radius: 3px;
+	float: left;
+	margin-left: -226px;
+	margin-top: 1px;
+	width: 224px;
 }
-	div#sidebar div#sidebar-me img.avatar {
-		float: left;
-		margin: 0 10px 15px 0;
-	}
-
-	div#sidebar div#sidebar-me h4 {
-		font-size: 16px;
-		margin: 0 0 8px 0;
-		font-weight: normal;
-	}
-
-
-	div#sidebar ul#bp-nav {
-		clear: left;
-		margin: 15px -16px;
-	}
-		div#sidebar ul#bp-nav li {
-			padding: 10px 15px;
-		}
-
-	div#sidebar h3.widgettitle {
-		margin: 25px -20px 10px -19px;
-		background: #eaeaea;
-		padding: 5px 15px;
-		font-size: 12px;
-		clear: left;
-	}
-
-	div#sidebar .widget_search {
-		margin-top: 20px;
-	}
-		div#sidebar .widget_search input[type=text] {
-			width: 110px;
-			padding: 2px;
-		}
-
-	div#sidebar ul#recentcomments li, div#sidebar .widget_recent_entries ul li {
-		margin-bottom: 15px;
-	}
-
-	div#sidebar ul.item-list img.avatar {
-		width: 20px;
-		height: 20px;
-		margin-right: 10px;
-	}
-		div#sidebar div.item-avatar img {
-			width: 40px;
-			height: 40px;
-			margin: 1px;
-		}
-
-		div#sidebar .avatar-block { overflow: hidden; }
-
-	div#sidebar ul.item-list div.item-title {
-		font-size: 12px;
-	}
-
-	div#sidebar div.item-options {
-		margin: -10px -20px 0 -19px;
-		background: #f8f8f8;
-		padding: 5px 15px;
-		font-size: 11px;
-	}
-
-	div#sidebar div.item-meta, div#sidebar div.item-content {
-		margin-left: 38px;
-		font-size: 11px;
-	}
-
-	div#sidebar div.tags div#tag-text {
-		font-size: 1.4em;
-		line-height: 140%;
-		padding-top: 10px;
-	}
-
-/* > Content
--------------------------------------------------------------- */
-
-div#content {
+div#sidebar div#sidebar-me {
+	margin-bottom: 15px;
+}
+div#sidebar div#sidebar-me img.avatar {
 	float: left;
-	width: 100%;
-	-moz-border-radius-topleft: 6px;
-	-webkit-border-top-left-radius: 6px;
-	-moz-border-radius-bottomleft: 6px;
-	-webkit-border-bottom-left-radius: 6px;
+	margin: 0 10px 15px 0;
 }
-
-div#content .padder {
-	margin-right: 225px;
-	border-right: 1px solid #ddd;
-	-moz-border-radius-topleft: 6px;
-	-webkit-border-top-left-radius: 6px;
-	-moz-border-radius-bottomleft: 6px;
-	-webkit-border-bottom-left-radius: 6px;
+div#sidebar div#sidebar-me h4 {
+	font-size: 16px;
+	margin: 0 0 8px 0;
+	font-weight: normal;
 }
-	div#content .left-menu {
-		float: left;
-		width: 170px;
-	}
-
-	div#content .main-column {
-		margin-left: 190px;
-	}
-
-/* > Item Headers (Profiles, Groups)
--------------------------------------------------------------- */
-
-div#item-header {
-	overflow: hidden;
+div#sidebar ul#bp-nav {
+	clear: left;
+	margin: 15px -16px;
 }
-	div#item-header div#item-header-content { margin-left: 170px; }
-
-	div#item-header h2 {
-		font-size: 28px;
-		margin: 0 0 15px 0;
-		line-height: 120%;
-	}
-		div#item-header h2 a {
-			text-decoration: none;
-			color: #777;
-		}
-
-	div#item-header img.avatar {
-		float: left;
-		margin: 0 15px 25px 0;
-	}
-
-	div#item-header h2 { margin-bottom: 5px; }
-
-	div#item-header span.activity, div#item-header h2 span.highlight {
-		vertical-align: middle;
-		font-size: 11px;
-		font-weight: normal;
-		line-height: 170%;
-		margin-bottom: 7px;
-	}
-
-	div#item-header h2 span.highlight { font-size: 16px; }
-	div#item-header h2 span.highlight span {
-		position: relative;
-		top: -2px;
-		right: -2px;
-		font-weight: bold;
-		font-size: 11px;
-		background: #a1dcfa;
-		color: #fff;
-		padding: 1px 4px;
-		margin-bottom: 2px;
-		-moz-border-radius: 3px;
-		-webkit-border-radius: 3px;
-		vertical-align: middle;
-		cursor: pointer;
-		display: none;
-	}
-
-	div#item-header div#item-meta {
-		font-size: 14px;
-		color: #aaa;
-		padding-bottom: 10px;
-		overflow: hidden;
-		margin: 15px 0 5px 0;
-	}
-
-	div#item-header div#item-actions {
-		float: right;
-		width: 20%;
-		margin: 0 0 15px 15px;
-		text-align: right;
-	}
-		div#item-header div#item-actions h3 {
-			font-size: 12px;
-			margin: 0 0 5px 0;
-		}
-
-		div#item-header ul {
-			overflow: hidden;
-			margin-bottom: 15px;
-		}
-
-		div#item-header ul h5, div#item-header ul span, div#item-header ul hr {
-			display: none;
-		}
-
-		div#item-header ul li {
-			float: right;
-		}
-
-		div#item-header ul img.avatar, div#item-header ul.avatars img.avatar {
-			width: 30px;
-			height: 30px;
-			margin: 2px;
-		}
-
-	div#item-header div.generic-button, div#item-header a.button {
-		float: left;
-		margin: 10px 10px 0 0;
-	}
-
-	div#item-header div#message.info {
-		line-height: 80%;
-	}
-
-
-/* > Item Lists (Activity, Friend, Group lists)
--------------------------------------------------------------- */
-
-ul.item-list {
-	width: 100%;
+div#sidebar ul#bp-nav li {
+	padding: 10px 15px;
 }
-	ul.item-list li {
-		position: relative;
-		padding: 15px 0;
-		border-bottom: 1px solid #eaeaea;
-	}
-		ul.single-line li { border: none; }
-
-		ul.item-list li img.avatar {
-			float: left;
-			margin: 0 10px 10px 0;
-		}
-
-		ul.item-list li div.item-title, ul.item-list li h4 {
-			font-weight: normal;
-			font-size: 14px;
-			width: 75%;
-			margin: 0;
-		}
-			ul.item-list li div.item-title span {
-				font-size: 12px;
-				color: #999;
-			}
-
-		ul.item-list li div.item-desc {
-			margin: 10px 0 0 64px;
-			font-size: 11px;
-			color: #888;
-			width: 50%;
-		}
-
-		ul.item-list li div.action {
-			position: absolute;
-			top: 15px;
-			right: 0;
-			text-align: right;
-		}
-
-		ul.item-list li div.meta {
-			margin-top: 10px;
-			color: #888;
-			font-size: 11px;
-		}
-
-		ul.item-list li h5 span.small {
-			font-weight: normal;
-			font-size: 11px;
-		}
-
-/* > Item Tabs
--------------------------------------------------------------- */
-
-div.item-list-tabs {
+div#sidebar h3.widgettitle {
+	background: #eaeaea;
 	clear: left;
+	font-size: 12px;
+	margin: 25px -20px 10px -19px;
+	padding: 5px 15px;
+}
+#footer-widget-area .widget_search,
+div#sidebar .widget_search {
+	margin-top: 20px;
+}
+#footer-widget-area .widget_search input[type=text],
+div#sidebar .widget_search input[type=text] {
+	padding: 2px;
+	width: 110px;
+}
+#footer-widget-area ul.item-list img.avatar,
+div#sidebar ul.item-list img.avatar {
+	height: 20px;
+	margin-right: 10px;
+	width: 20px;
+}
+#footer-widget-area div.item-avatar img,
+div#sidebar div.item-avatar img {
+	height: 40px;
+	margin: 1px;
+	width: 40px;
+}
+#footer-widget-area .avatar-block,
+div#sidebar .avatar-block {
 	overflow: hidden;
-	margin: 25px -19px 20px -19px;
-	background: #eaeaea;
 }
-	div.item-list-tabs ul li a {
-		text-decoration: none;
-	}
-
-	div.item-list-tabs ul {
-		width: 100%;
-	}
-		div.item-list-tabs ul li {
-			float: left;
-			margin: 5px 0 0 5px;
-		}
-			div.item-list-tabs#subnav ul li {
-				margin-top: 0;
-			}
-
-			div.item-list-tabs ul li:first-child {
-				margin-left: 20px;
-			}
-
-			div.item-list-tabs ul li.last {
-				float: right;
-				margin: 7px 20px 0 0;
-			}
-				div.item-list-tabs#subnav ul li.last {
-					margin-top: 4px;
-				}
-
-				div.item-list-tabs ul li.last select {
-					max-width: 175px;
-				}
-
-		div.item-list-tabs ul li a,
-		div.item-list-tabs ul li span {
-			display: block;
-			padding: 5px 10px;
-			text-decoration: none;
-		}
-			div.item-list-tabs ul li span {
-				color: #aaa;
-			}
-
-			div.item-list-tabs ul li a span {
-				display: inline;
-				padding: 0;
-				color: inherit;
-			}
-
-		div.item-list-tabs ul li.selected a,
-		div.item-list-tabs ul li.current a {
-			background-color: #fff;
-			color: #555;
-			font-weight: bold;
-			-moz-border-radius-topleft: 3px;
-			-webkit-border-top-left-radius: 3px;
-			-moz-border-radius-topright: 3px;
-			-webkit-border-top-right-radius: 3px;
-		}
-			ul li.loading a {
-				background-image: url( ../images/ajax-loader.gif );
-				background-position: 92% 50%;
-				background-repeat: no-repeat;
-				padding-right: 30px !important;
-			}
-				div#item-nav ul li.loading a {
-					background-position: 88% 50%;
-				}
-
-	div.item-list-tabs#object-nav {
-		margin-top: 0;
-	}
-
-	div.item-list-tabs#subnav {
-		background: #fff;
-		margin: -15px -19px 15px -19px;
-		border-bottom: 1px solid #eaeaea;
-		min-height: 35px;
-		overflow: hidden;
-	}
-
-	div.item-list-tabs ul li.feed a {
-		background: url( ../images/rss.png ) center left no-repeat;
-		padding-left: 20px;
-	}
+#footer-widget-area ul.item-list div.item-title,
+div#sidebar ul.item-list div.item-title {
+	font-size: 12px;
+}
+#footer-widget-area div.item-options,
+div#sidebar div.item-options {
+	background: #f5f5f5;
+	font-size: 11px;
+	margin: -10px -20px 0 -19px;
+	padding: 5px 15px;
+}
+#footer-widget-area div.item-content {
+	margin-left: 38px;
+}
+#footer-widget-area div.item-meta,
+div#sidebar div.item-meta,
+div#sidebar div.item-content {
+	font-size: 11px;
+	margin-left: 38px;
+}
+#footer-widget-area div.tags div#tag-text,
+div#sidebar div.tags div#tag-text {
+	font-size: 1.4em;
+	line-height: 140%;
+	padding: 10px 0 15px;
+}
 
-/* > Item Body
--------------------------------------------------------------- */
 
-.item-body {
+/*--------------------------------------------------------------
+3.0 - Non-structural
+--------------------------------------------------------------*/
+p {
+	margin-bottom: 15px;
+}
+p:last-child {
+	margin-bottom: 0;
+}
+.accessibly-hidden {
+	left: -999em;
+	position: absolute;
+}
+hr {
+	background-color: #e7e7e7;
+	border: 0 none;
+	clear: both;
+	height: 1px;
 	margin: 20px 0;
 }
+textarea {
+	resize: vertical;
+}
 
-span.activity, div#message p {
-	display: inline-block;
-	font-size: 11px;
-	font-weight: normal;
-	background: #FFF9DB;
-	border-bottom: 1px solid #FFE8C4;
-	border-right: 1px solid #FFE8C4;
-	color: #ffa200;
-	padding: 1px 8px;
-	margin-top: 6px;
+
+/*--------------------------------------------------------------
+3.1 - Text
+--------------------------------------------------------------*/
+big {
+	font-size: 18px;
+}
+del {
+	text-decoration: line-through;
+}
+ins {
+	background: #fff9db;
 	text-decoration: none;
+}
+sub {
+	top: .5ex;
+}
+sup {
+	bottom: 1ex;
+}
+sub,
+sup {
+	height: 0;
+	line-height: 1;
+	position: relative;
+	vertical-align: baseline;
+}
+pre, blockquote {
+	margin-bottom: 20px;
+}
+pre,
+code p {
+	background: #f4f4f4;
 	-moz-border-radius: 3px;
 	-webkit-border-radius: 3px;
 	border-radius: 3px;
+	padding: 15px;
+	overflow: auto;
 }
-
-/* > Directories (Members, Groups, Blogs, Forums)
--------------------------------------------------------------- */
-
-div.dir-search {
-	float: right;
-	margin: -37px 0 0 0;
+code {
+	font-family: "Monaco", courier, sans-serif;
+}
+blockquote {
+	font-family: georgia, times, serif;
+	font-size: 16px;
+	font-style: italic;
+	line-height: 150%;
+	padding: 0 3em;
+	quotes: none;
+}
+blockquote p {
+	margin-bottom: 15px !important;
 }
-	div.dir-search input[type=text] {
-		padding: 4px;
-		font-size: 12px;
-	}
-
-/* > Pagination
--------------------------------------------------------------- */
-
-div.pagination {
-	margin: -20px -20px 9px -20px;
-	border-bottom: 1px solid #eaeaea;
-	padding: 10px 20px 10px 20px;
-	color: #888;
-	font-size: 11px;
-	height: 16px;
-}
-	div.pagination#user-pag, .friends div.pagination,
-	.mygroups div.pagination, .myblogs div.pagination, noscript div.pagination {
-		background: #f8f8f8;
-		border: none;
-		padding: 8px 15px;
-	}
-
-	div.pagination .pag-count {
-		float: left;
-	}
 
-	div.pagination .pagination-links {
-		float: right;
-	}
-		div.pagination .pagination-links span,
-		div.pagination .pagination-links a {
-			font-size: 12px;
-			padding: 0 5px;
-		}
-			div.pagination .pagination-links a:hover {
-				font-weight: bold;
-			}
 
-div#pag-bottom {
-	margin-top: 0;
+/*--------------------------------------------------------------
+3.2 - Headers
+--------------------------------------------------------------*/
+h1,
+h2,
+h3,
+h4,
+h5,
+h6 {
+	margin: 5px 0 15px 0;
+}
+h1 {
+	font-size: 28px;
+	margin-bottom: 25px;
+}
+h2 {
+	font-size: 24px;
+	margin-bottom: 20px;
+}
+h3 {
+	font-size: 20px;
+}
+h4 {
+	font-size: 16px;
+	margin-bottom: 15px;
+}
+h5 {
+	font-size: 14px;
+	margin-bottom: 0;
+}
+h6 {
+	font-size: 12px;
+	margin-bottom: 0;
 }
 
-/* > Error / Success Messages
--------------------------------------------------------------- */
 
-div#message {
-	margin: 15px 0;
+/*--------------------------------------------------------------
+3.3 - Lists
+--------------------------------------------------------------*/
+div.page ul,
+div.page ol,
+div.page dl,
+div.post ul,
+div.post ol,
+div.post dl {
+	margin: 0 0 18px 1.5em;
+}
+div.page ul,
+div.post ul {
+	list-style: square;
+}
+div.page ol,
+div.post ol {
+	list-style: decimal;
+}
+div.page ol ol,
+div.post ol ol {
+	list-style: lower-alpha;
+}
+div.page ol ol ol,
+div.post ol ol ol {
+	list-style: lower-roman;
+}
+dl {
+	margin-left: 0;
+}
+dt {
+	font-size: 14px;
+	font-weight: bold;
+}
+dd {
+	margin: 0 0 15px 0;
+}
+div.post ul ul,
+div.post ol ol,
+div.post ol ul,
+div.post ul ol,
+div.page ul ul,
+div.page ol ol,
+div.page ol ul,
+div.page ul ol {
+	margin-bottom: 0px;
 }
-	div#message.updated { clear: both; }
-
-div#message p {
-	padding: 10px 15px;
-	font-size: 12px;
-	display:block;
-}
-	div#message.error p {
-		background: #e41717;
-		color: #fff;
-		border-color: #a71a1a;
-		clear: left;
-	}
 
-	div#message.updated p {
-		background: #dffcd9;
-		color: #1a9b00;
-		border-color: #c4e9bd;
-	}
 
-form.standard-form#signup_form div div.error {
+/*--------------------------------------------------------------
+4.0 - Navigation
+--------------------------------------------------------------*/
+a {
+	color: #1fb3dd;
+}
+a:hover,
+a:active {
+	color: #888;
+}
+a:focus {
+	outline: 1px dotted #ccc;
+}
+#navigation {
+	position: relative;
+	text-align: right;
+	width: 100%;
+}
+#nav {
+	margin: 40px 20px 0 0;
+	list-style: none;
+	padding: 0;
+	position: relative;
+	right: auto;
+	bottom: 0;
+}
+#nav li a {
+	background: url( ../images/60pc_black.png );
 	color: #fff;
-	background: #e41717;
+	display: block;
+	padding: 5px 15px;
+	text-decoration: none;
+	text-align: left;
+}
+#nav li {
+	margin-left: 5px;
+	display: inline-block;
+}
+#nav li li {
+	margin-left: 0;
+}
+#nav > li > a {
+	-moz-border-radius-topleft: 3px;
+	-webkit-border-top-left-radius: 3px;
+	-moz-border-radius-topright: 3px;
+	-webkit-border-top-right-radius: 3px;
+	border-top-left-radius: 3px;
+	border-top-right-radius: 3px;
+}
+#nav li.selected a,
+#nav > li.current-menu-item a,
+#nav > li.current_page_item a,
+#nav > li.current_page_ancestor a {
+	background: #f5f5f5;
+	color: #4D4D4D;
+}
+#nav > li > ul {
+	border-top-width: 0;
+}
+#nav > ul li.sfhover a,
+#nav > ul li:hover a {
+	background: #333;
+	color: #fff;
+}
+#nav li.sfhover,
+#nav li:hover {
+	position: relative;
+	z-index: 1000;
+}
+#nav ul {
+	border: 1px solid #222;
 	-moz-border-radius: 3px;
 	-webkit-border-radius: 3px;
-	border-radius: 3px;
-	padding: 6px;
-	width: 90%;
-	margin: 0 0 10px 0;
+	-moz-border-radius-topleft: 0;
+	-moz-border-radius-topright: 0;
+	-webkit-border-top-left-radius: 0;
+	-webkit-border-top-right-radius: 0;
+	border-top-left-radius: 0;
+	border-top-right-radius: 0;
+	-moz-box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
+	-webkit-box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
+	box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
 }
-
-/* > Buttons
--------------------------------------------------------------- */
-
-a.button, input[type=submit], input[type=button], input[type=reset],
-ul.button-nav li a, div.generic-button a {
-	background: url( ../images/white-grad.png ) top left repeat-x;
-	border: 1px solid #ddd;
-	padding: 3px 10px;
+#nav ul li ul {
 	-moz-border-radius: 3px;
 	-webkit-border-radius: 3px;
 	border-radius: 3px;
-	text-decoration: none;
-	color: #888;
-	font-size: 12px;
-	font-weight: normal;
-	vertical-align: bottom;
-	cursor: pointer;
 }
-	a.button:hover, a.button:focus, input[type=submit]:hover, input[type=button]:hover, input[type=reset]:hover,
-	ul.button-nav li a:hover, ul.button-nav li.current a,
-	div.generic-button a:hover {
-		border-color: #aaa;
-		color: #555;
-		outline: none;
-	}
-
-	/* Buttons that are disabled */
-	div.pending a, a.disabled {
-		border-color: #eee;
-		color: #bbb;
-		cursor: default;
-	}
-	div.pending a:hover, a.disabled:hover { border-color: #eee; color: #bbb; }
+#nav ul,
+#nav .sfhover ul ul,
+#nav :hover ul ul {
+	left: -9999px;
+	position: absolute;
+}
+#nav .sfhover ul,
+#nav :hover ul {
+	left: 0;
+	top: 100%;
+	width: 128px;
+}
+#nav .sfhover ul li > a,
+#nav :hover ul li > a {
+	background: #333;
+	color: #fff;
+}
+#nav .sfhover ul .sfhover > ul,
+#nav :hover ul :hover > ul {
+	left: 125px;
+	top: -1px;
+	width: 128px;
+}
+#nav ul li.sfhover > a,
+#nav ul li:hover > a {
+	background-color: #222;
+	color: #fff;
+}
+#nav .sfhover ul li,
+#nav :hover ul li {
+	height: 30px;
+	line-height: 30px;
+	text-indent: 10px;
+	width: 128px;
+}
+#nav .sfhover ul li a,
+#nav :hover ul li a {
+	padding: 0 0;
+}
 
-	div.accept, div.reject {
-		float: left;
-		margin-left: 10px;
-	}
 
-ul.button-nav li {
+/*--------------------------------------------------------------
+4.1 - Pagination
+--------------------------------------------------------------*/
+div.pagination {
+	background: #f4f4f4;
+	border: none;
+	color: #888;
+	font-size: 11px;
+	height: 19px;
+	margin: -20px -19px 0px -19px;
+	padding: 8px 20px;
+	position: relative;
+}
+div.pagination .pag-count {
 	float: left;
-	margin: 0 10px 10px 0;
 }
-	ul.button-nav li.current a {
-		font-weight: bold;
-	}
-
-/* > AJAX Loaders
--------------------------------------------------------------- */
-
-.ajax-loader {
-	background: url( ../images/ajax-loader.gif ) center left no-repeat !important;
-	padding: 8px;
+div.pagination .pagination-links {
+	float: right;
+}
+div.pagination .pagination-links span,
+div.pagination .pagination-links a {
+	font-size: 12px;
+	padding: 0 5px;
+}
+div.pagination .pagination-links a:hover {
+	font-weight: bold;
+}
+div#pag-bottom {
+	margin-top: -1px;
+}
+#nav-above {
 	display: none;
 }
-
-a.loading {
-	background-image: url( ../images/ajax-loader.gif ) !important;
-	background-position: 95% 50% !important;
-	background-repeat: no-repeat !important;
-	padding-right: 25px !important;
+.paged #nav-above {
+	display: block;
 }
 
-/* > Input Forms
--------------------------------------------------------------- */
-
-form.standard-form {
 
+/*--------------------------------------------------------------
+5.0 - WordPress
+--------------------------------------------------------------*/
+/*--------------------------------------------------------------
+5.1 - Alignments
+--------------------------------------------------------------*/
+.alignright {
+	float: right;
+	margin-left: 15px;
 }
-	form.standard-form textarea, form.standard-form input[type=text],
-	form.standard-form select, form.standard-form input[type=password],
-	.dir-search input[type=text] {
-		border: 1px inset #ccc;
-		-moz-border-radius: 3px;
-		-webkit-border-radius: 3px;
-		border-radius: 3px;
-		padding: 6px;
-		font: inherit;
-		font-size: 14px;
-		color: #888;
-	}
-		form.standard-form select {
-			padding: 3px;
-		}
-
-		form.standard-form input[type=password] {
-			margin-bottom: 5px;
-		}
-
-	form.standard-form label, form.standard-form span.label {
-		display: block;
-		font-weight: bold;
-		margin: 15px 0 5px 0;
-	}
-		form.standard-form div.checkbox label,
-		form.standard-form div.radio label {
-			font-weight: normal;
-			margin: 5px 0 0 0;
-			font-size: 14px;
-			color: #888;
-		}
-
-		form.standard-form#sidebar-login-form label {
-			margin-top: 5px;
-		}
-
-	form.standard-form input[type=text] {
-		width: 75%;
-	}
-		form.standard-form#sidebar-login-form input[type=text],
-		form.standard-form#sidebar-login-form input[type=password] {
-			padding: 4px;
-			width: 95%;
-		}
-
-		form.standard-form #basic-details-section input[type=password],
-		form.standard-form #blog-details-section input#signup_blog_url {
-			width: 35%;
-		}
-
-		form.standard-form#signup_form input[type=text],
-		form.standard-form#signup_form textarea {
-			width: 90%;
-		}
-			form.standard-form#signup_form div.submit { float: right; }
-			div#signup-avatar img { margin: 0 15px 10px 0; }
-
-	form.standard-form textarea {
-		width: 75%;
-		height: 120px;
-	}
-		form.standard-form textarea#message_content {
-			height: 200px;
-		}
-
-		form.standard-form#send-reply textarea {
-			width: 97.5%;
-		}
-
-	form.standard-form p.description {
-		font-size: 11px;
-		color: #888;
-		margin: 5px 0;
-	}
-
-	form.standard-form div.submit {
-		padding: 15px 0;
-		clear: both;
-	}
-		form.standard-form div.submit input {
-			margin-right: 15px;
-		}
-
-	form.standard-form div.radio ul {
-		margin: 10px 0 15px 38px;
-		list-style: disc;
-	}
-		form.standard-form div.radio ul li {
-			margin-bottom: 5px;
-		}
-
-	form.standard-form a.clear-value {
-		display: block;
-		margin-top: 5px;
-		outline: none;
-	}
-
-form.standard-form #basic-details-section, form.standard-form #blog-details-section,
-form.standard-form #profile-details-section {
+.alignleft {
 	float: left;
-	width: 48%;
+	margin-right: 15px;
 }
-	form.standard-form #profile-details-section { float: right; }
-	form.standard-form #blog-details-section {
-		clear: left;
-	}
-
-form.standard-form input:focus, form.standard-form textarea:focus, form.standard-form select:focus {
-	background: #fafafa;
-	color: #555;
+.aligncenter {
+	display: block;
+	margin-left: auto;
+	margin-right: auto;
 }
-
-form#send-invite-form {
-	margin-top: 20px;
+.clear {
+	clear: left;
 }
-	div#invite-list {
-		height: 400px;
-		overflow: scroll;
-		-moz-border-radius: 3px;
-		-webkit-border-radius: 3px;
-		border-radius: 3px;
-		padding: 5px;
-		background: #f5f5f5;
-		width: 160px;
-		border: 1px solid #e4e4e4;
-		margin: 10px 0;
-	}
 
 
-/* > Data Tables
--------------------------------------------------------------- */
-
-table {
-	width: 100%;
+/*--------------------------------------------------------------
+5.2 - Comments
+--------------------------------------------------------------*/
+.navigation,
+.paged-navigation,
+.comment-navigation {
+	overflow: hidden;
+	font-family: georgia, times, serif;
+	font-size: 14px;
+	font-style: italic;
+	margin: 5px 0 25px 0;
+	padding: 5px 0;
 }
-	table thead tr {
-		background: #eaeaea;
-	}
-
-	table#message-threads {
-		margin: 0 -20px;
-		width: auto;
-	}
-
-	table.profile-fields { margin-bottom: 20px; }
-
-	div#sidebar table {
-		margin: 0 -16px;
-		width: 117%;
-	}
-
-	table tr td, table tr th {
-		padding: 8px;
-		vertical-align: middle;
-	}
-		table tr td.label {
-			border-right: 1px solid #eaeaea;
-			font-weight: bold;
-			width: 25%;
-		}
-
-		table tr td.thread-info p { margin: 0; }
-
-			table tr td.thread-info p.thread-excerpt {
-				color: #888;
-				font-size: 11px;
-				margin-top: 3px;
-			}
-
-		div#sidebar table td, table.forum td { text-align: center; }
-
-	table tr.alt {
-		background: #f4f4f4;
-	}
-
-table.notification-settings {
-	margin-bottom: 20px;
-	text-align: left;
+.comments {
+	float: right;
 }
-	table.notification-settings th.icon, table.notification-settings td:first-child { display: none; }
-	table.notification-settings th.title { width: 80%; }
-	table.notification-settings .yes, table.notification-settings .no { width: 40px; text-align: center; }
-
-table.forum {
-	margin: -9px -20px 20px -20px;
-	width: auto;
+#trackbacks {
+	margin-top: 30px;
 }
-	table.forum tr.sticky td {
-		background: #FFF9DB;
-		border-top: 1px solid #FFE8C4;
-		border-bottom: 1px solid #FFE8C4;
-	}
-
-	table.forum tr.closed td.td-title {
-		padding-left: 35px;
-		background-image: url( ../images/closed.png );
-		background-position: 15px 50%;
-		background-repeat: no-repeat;
-	}
-
-	table.forum td p.topic-text {
-		color: #888;
-		font-size: 11px;
-	}
-
-	table.forum tr > td:first-child, table.forum tr > th:first-child {
-		padding-left: 15px;
-	}
-
-	table.forum tr > td:last-child, table.forum tr > th:last-child {
-		padding-right: 15px;
-	}
-
-	table.forum tr th#th-title, table.forum tr th#th-poster,
-	table.forum tr th#th-group, table.forum td.td-poster,
-	table.forum td.td-group, table.forum td.td-title { text-align: left; }
-
-	table.forum td.td-freshness {
-		font-size: 11px;
-		color: #888;
-	}
-
-	table.forum td img.avatar {
-		margin-right: 5px;
-	}
-
-	table.forum td.td-poster, table.forum td.td-group  {
-		min-width: 130px;
-	}
-
-	table.forum th#th-title {
-		width: 40%;
-	}
-
-	table.forum th#th-postcount {
-		width: 1%;
-	}
-
-/* > Activity Stream Posting
--------------------------------------------------------------- */
-
-form#whats-new-form {
-	margin-bottom: 5px;
-	border-bottom: 1px solid #f0f0f0;
-	overflow: hidden;
-	padding-bottom: 20px;
+.commentlist .bypostauthor {
 }
-	#item-body form#whats-new-form {
-		margin-top: 20px;
-		border: none;
-	}
-
-	.home-page form#whats-new-form {
-		border-bottom: none;
-		padding-bottom: 0;
-	}
-
-	form#whats-new-form h5 {
-		margin: 0;
-		font-weight: normal;
-		font-size: 12px;
-		color: #888;
-		margin-left: 76px;
-		padding: 0 0 3px 0;
-	}
-
-	form#whats-new-form #whats-new-avatar {
-		float: left;
-	}
-
-	form#whats-new-form #whats-new-content {
-		margin-left: 54px;
-		padding-left: 22px;
-	}
-
-	form#whats-new-form #whats-new-textarea {
-		padding: 8px;
-		border: 1px inset #ccc;
-		background: #fff;
-		margin-bottom: 10px;
-		-moz-border-radius: 3px;
-		-webkit-border-radius: 3px;
-		border-radius: 3px;
-	}
-	form#whats-new-form textarea {
-		width: 100%;
-		height: 50px;
-		font-size: 14px;
-		font-family: inherit;
-		color: #555;
-		border: none;
-		margin: 0;
-		padding: 0;
-	}
-
-	form#whats-new-form #whats-new-options select {
-		max-width: 200px;
-	}
-
-	form#whats-new-form #whats-new-submit {
-		float: right;
-		margin: 0;
-	}
-
-/* > Activity Stream Listing
--------------------------------------------------------------- */
-
-ul.activity-list li {
-	padding: 20px 0 0 0;
+#comments {
+	margin-top: 30px;
+}
+#comments ol.commentlist {
+	border-bottom: 1px solid #e4e4e4;
+	margin: 0 0 30px 0;
+}
+#comments ol.commentlist ol {
+	list-style-type: decimal;
+	margin: 0 0 18px 2.5em;
+}
+#comments ol.commentlist ol ol {
+	list-style: lower-alpha;
+	margin-bottom: 0px;
+}
+#comments ol.commentlist ol ol ol {
+	list-style: lower-roman;
+}
+ol.commentlist li.comment {
+	border-top: 1px solid #e4e4e4;
+	clear: left;
+	list-style: none;
+	margin-bottom: 15px;
+}
+ol.commentlist ul.children li {
+	margin-bottom: 0;
+}
+ol.commentlist div.comment-avatar-box {
+	float: left;
+	margin: 15px 15px 0 0;
+}
+.commentlist ul.children div.comment-avatar-box {
+	float: left;
+	margin: 0 10px 0 0;
+}
+div.comment-avatar-box img {
+	border: 2px solid #eee;
+}
+div.comment-content {
 	overflow: hidden;
 }
-	ul.activity-list > li:first-child {
-		padding-top: 5px;
-	}
-
-	ul.activity-list li.has-comments {
-		padding-bottom: 20px;
-	}
-
-.activity-list li.mini {
-	position: relative;
-	font-size: 11px;
-	min-height: 35px;
-	padding: 12px 0 0 0;
+ul.children .comment-entry {
+	margin-bottom: 10px;
 }
-	.activity-list li.mini div.activity-meta {
-		margin: 0;
-	}
-
-	.activity-list li.mini div.activity-meta a {
-		padding: 3px 8px;
-	}
-
-	.activity-list li.mini .activity-avatar img.avatar,
-	.activity-list li.mini .activity-avatar img.FB_profile_pic {
-		width: 20px;
-		height: 20px;
-		margin-left: 36px;
-	}
-		.activity-list li.activity_comment .activity-avatar img.avatar,
-		.activity-list li.activity_comment .activity-avatar img.FB_profile_pic {
-			width: 40px;
-			height: 40px;
-			margin-left: 20px;
-		}
-
-		body.activity-permalink .activity-list li .activity-avatar img.avatar,
-		body.activity-permalink .activity-list li .activity-avatar img.FB_profile_pic {
-			width: 100px;
-			height: 100px;
-			margin-left: 0;
-		}
-
-	.activity-list li.mini .activity-content {
-		margin-right: 175px;
-	}
-
-	.activity-list li.mini .activity-content p {
-		margin: 0;
-		float: left;
-	}
-
-	.activity-list li.mini .activity-meta {
-		position: absolute;
-		right: 0;
-	}
-		body.activity-permalink .activity-list li.mini .activity-meta {
-			position: absolute;
-			right: 15px;
-		}
-
-	.activity-list li.mini .activity-comments {
-		clear: left;
-		font-size: 12px;
-		margin-top: 30px;
-	}
-
-.activity-list li .activity-inreplyto {
-	font-size: 11px;
+div.comment-meta {
 	color: #888;
-	margin-left: 70px;
-	margin-bottom: 15px;
-	padding-left: 25px;
-	background: url( ../images/replyto_arrow.gif ) 7px 0 no-repeat;
+	font-size: 11px;
+	margin: 15px 0;
+	width: 100%;
 }
-	.activity-list li .activity-inreplyto > p {
-		margin: 0;
-		display: inline;
-	}
-
-	.activity-list li .activity-inreplyto blockquote,
-	.activity-list li .activity-inreplyto div.activity-inner {
-		background: none;
-		border: none;
-		display: inline;
-		padding: 0;
-		margin: 0;
-		overflow: hidden;
-	}
-
-.activity-list .activity-avatar img {
-	width: 50px;
-	height: 50px;
+div.comment-meta em {
+	font-style: normal;
 }
-		body.activity-permalink .activity-list .activity-avatar img {
-			width: 100px;
-			height: 100px;
-		}
-
-.activity-list .activity-content {
-	margin-left: 70px;
+#reply-title {
+	margin-top: 0;
 }
-	body.activity-permalink .activity-list li .activity-content {
-		-moz-border-radius: 4px;
-		-webkit-border-radius: 4px;
-		border-radius: 4px;
-		background: #fff;
-		padding: 15px;
-		border-bottom: 1px solid #ddd;
-		border-right: 1px solid #ddd;
-		margin-left: 135px;
-		font-size: 16px;
-		line-height: 150%;
-		min-height: 35px;
-		margin-right: 0;
-	}
-		body.activity-permalink .activity-list li .activity-header > p {
-			background: url( ../images/activity_arrow.gif ) top left no-repeat;
-			margin-left: -35px;
-			padding: 5px 0 0 38px;
-			height: 35px;
-			margin-bottom: 0;
-		}
-
-	.activity-list .activity-content .activity-header,
-	.activity-list .activity-content .comment-header {
-		font-size: 11px;
-		color: #888;
-		line-height: 220%;
-	}
-	
-	.activity-list .activity-content .activity-header img.avatar {
-		float: none !important;
-		margin: 0 5px -8px 0 !important;
-	}
-
-	.activity-list .activity-header a:first-child, span.highlight {
-		background: #EBF7FF;
-		border-bottom: 1px solid #a1dcfa;
-		border-right: 1px solid #a1dcfa;
-		color: #059AE7;
-		padding: 3px 8px;
-		text-decoration: none;
-		-moz-border-radius: 4px;
-		-webkit-border-radius: 4px;
-		border-radius: 4px;
-		margin-right: 3px;
-	}
-		.activity-list .activity-header a:first-child:hover {
-			background: #059AE7 !important;
-			color: #fff !important;
-		}
-		.activity-list .activity-content a:first-child:focus { outline: none; }
-
-		.activity-list .activity-content span.time-since {
-			color: #bbb;
-		}
-
-	.activity-list .activity-content span.activity-header-meta a {
-		background: none;
-		padding: 0;
-		font-size: 11px;
-		margin: 0;
-		border: none;
-		color: #aaa;
-		text-decoration: underline;
-	}
-		.activity-list .activity-content span.activity-header-meta a:hover {
-			color: inherit;
-			text-decoration: none;
-		}
-
-	.activity-list .activity-content .activity-inner,
-	.activity-list .activity-content blockquote {
-		margin: 15px 0 15px 5px;
-		overflow: hidden;
-	}
-		body.activity-permalink .activity-content .activity-inner,
-		body.activity-permalink .activity-content blockquote {
-			margin-top: 5px;
-		}
-
-		/* Backwards compatibility. */
-		.activity-inner > .activity-inner { margin: 0 !important; }
-		.activity-inner > blockquote { margin: 0 !important; }
-
-	.activity-list .activity-content img.thumbnail {
-		float: left;
-		margin: 0 10px 5px 0;
-		border: 2px solid #eee;
-	}
-
-.activity-list li.load-more {
-	margin: 15px  0 !important;
-	padding: 10px 15px !important;
-	background: #f0f0f0 !important;
-	text-align: center;
-	font-size: 1.2em;
-	border-right: 1px solid #ddd;
-	border-bottom: 1px solid #ddd;
+#reply-title small {
+	float: right;
+	font-size: 11px;
+	font-weight: normal;
+}
+#reply-title small a {
+	margin-right: 0;
+}
+.commentlist ul.children {
+	background: #f5f5f5;
 	-moz-border-radius: 4px;
 	-webkit-border-radius: 4px;
 	border-radius: 4px;
+	margin: 15px 0 15px 70px;
+	padding: 0 10px;
 }
-	.activity-list li.load-more a {
-		color: #555;
-	}
-
-/* > Activity Stream Comments
--------------------------------------------------------------- */
-
-div.activity-meta {
-	margin: 0 0 20px 3px;
-	clear: left;
+.commentlist ul.children ul {
+	margin: 0 0 0 25px;
+	padding-right: 0;
 }
-
-.activity-list div.activity-meta a {
+.commentlist ul.children img.avatar {
+	border-style: none;
+	height: 25px;
+	margin: 0;
+	width: 25px;
+}
+.commentlist ul.children div.comment-meta {
 	font-size: 11px;
-	background: #f4f4f4;
-	border-bottom: 1px solid #ddd;
-	border-right: 1px solid #ddd;
-	color: #999;
-	padding: 4px 8px;
-	text-decoration: none;
+	margin: 0 0 10px 0;
+}
+.commentlist ul.children li {
+	border-top: 2px solid #fffeff;
+	padding-top: 10px;
+}
+.commentlist ul.children li:first-child {
+	border-top: none;
+}
+.commentlist ul.children ul li:first-child {
+	border-top: 2px solid #fffeff;
+}
+#respond {
+	background-color: #fafafa;
+	border: 1px solid #e5e5e5;
 	-moz-border-radius: 4px;
 	-webkit-border-radius: 4px;
 	border-radius: 4px;
-	margin-right: 3px;
-}
-	.activity-list div.activity-meta a.acomment-reply {
-		background: #FFF9DB;
-		border-bottom: 1px solid #FFE8C4;
-		border-right: 1px solid #FFE8C4;
-		color: #ffa200;
-	}
-
-	div.activity-meta a:focus { outline: none; }
-	div.activity-meta a:hover {
-		background: #aaa;
-		color: #fff;
-		border-color: #aaa;
-	}
-		div.activity-meta a.acomment-reply:hover {
-			background: #f7740a;
-			color: #fff;
-			border-color: #f7740a;
-		}
-
-div.activity-comments {
-	position: relative;
-	margin: 0 0 0 75px;
-	width: auto;
-	overflow: hidden; /* IE fix */
+	padding: 15px;
 }
-
-	body.activity-permalink div.activity-comments {
-		width: auto;
-		margin-left: 135px;
-		background: none;
-	}
-
-div.activity-comments > ul {
-	background: #f5f5f5;
-	-moz-border-radius: 4px;
-	-webkit-border-radius: 4px;
-	padding: 0 10px 0;
+#respond .avb img {
+	float: inherit;
 }
-div.activity-comments ul, div.activity-comments ul li {
-	border: none;
-	list-style: none;
+#respond .comment-avatar-box {
+	float: left;
+	margin: 0 15px 0 0;
+}
+#respond .form-submit {
+	margin-bottom: 0;
+}
+ol.commentlist #respond {
+	clear: left;
+	margin-left: 70px;
+}
+.commentlist ul.children #respond {
+	margin-bottom: 10px;
+	margin-left: 35px;
+	margin-right: 20px;
+}
+h3#reply .comments-header {
+	font-size: 14px;
+}
+#respond div.comment-content {
+	border-style: none;
+}
+#nav-below {
+	margin: 0 0;
+	padding: 0 0;
+}
+#nav-above {
+	margin: 0 0 15px;
+	padding: 0;
+}
+.comment-options {
+	margin: 10px 0 2px;
+}
+.comment-options .comment-reply-link,
+.comment-options .comment-edit-link {
+	font: normal 11px/20px Arial, Tahoma, Verdana, sans-serif;
+	margin-right: 5px;
+	padding: 4px 8px;
+}
+.commentlist ul.children div.comment-options {
+	margin-bottom: 10px;
 }
 
-	div.activity-comments ul {
-		clear: left;
-	}
-
-	div.activity-comments ul li {
-		border-top: 2px solid #fff;
-		padding: 10px 0 0;
-	}
-		body.activity-permalink div.activity-comments ul li {
-			border-width: 1px;
-			padding: 10px 0 0;
-		}
-
-		div.activity-comments ul li p:last-child {
-			margin-bottom: 10px;
-		}
-
-		div.activity-comments > ul > li:first-child {
-			border-top: none;
-		}
-
-		div.activity-comments ul li:last-child {
-			margin-bottom: 0;
-		}
-
-	div.activity-comments ul li > ul {
-		margin-top: 0;
-		margin-left: 20px;
-	}
-		body.activity-permalink div.activity-comments ul li > ul {
-			margin-top: 15px;
-		}
-
-	div.activity-comments div.acomment-avatar img {
-		border-width: 2px !important;
-		float: left;
-		margin-right: 10px;
-	}
-
-	div.activity-comments div.acomment-content {
-		font-size: 11px;
-		margin-left: 39px;
-		margin-top: 5px;
-	}
-		div.acomment-content .time-since { display: none; }
-		div.acomment-content .activity-delete-link { display: none; }
-		div.acomment-content .comment-header { display: none; }
-
-		body.activity-permalink div.activity-comments div.acomment-content {
-			font-size: 14px;
-		}
-
-	div.activity-comments div.acomment-meta {
-		font-size: 11px;
-		color: #888;
-	}
-
-	div.activity-comments form.ac-form {
-		display: none;
-		margin: 10px 0 10px 33px;
-		background: #fafafa;
-		border: 1px solid #ddd;
-		-moz-border-radius: 4px;
-		-webkit-border-radius: 4px;
-		border-radius: 4px;
-		padding: 8px;
-	}
-		div.activity-comments li form.ac-form {
-			margin-right: 15px;
-		}
-
-		div.activity-comments form.root {
-			margin-left: 0;
-		}
 
-		div.activity-comments div#message {
-			margin-top: 15px;
-			margin-bottom: 0;
-		}
+/*--------------------------------------------------------------
+5.3 - Gallery
+--------------------------------------------------------------*/
+.wp-caption {
+	background-color: #f3f3f3;
+	border: 1px solid #ddd;
+	-moz-border-radius: 3px;
+	-webkit-border-radius: 3px;
+	border-radius: 3px;
+	margin-bottom: 15px;
+	padding-top: 4px;
+	text-align: center;
 
-		div.activity-comments form.loading {
-			background-image: url( ../images/ajax-loader.gif );
-			background-position: 2% 95%;
-			background-repeat: no-repeat;
-		}
+}
+.wp-caption img {
+	border: 0 none;
+	margin: 0;
+	padding: 0;
 
-		div.activity-comments form .ac-textarea {
-			padding: 8px;
-			border: 1px inset #ccc;
-			background: #fff;
-			margin-bottom: 10px;
-			-moz-border-radius: 3px;
-			-webkit-border-radius: 3px;
-			border-radius: 3px;
-		}
-			div.activity-comments form textarea {
-				width: 100%;
-				font-family: inherit;
-				font-size: 11px;
-				color: #555;
-				height: 60px;
-				border: none;
-				padding: 0;
-			}
-				div.activity-comments form input {
-					margin-top: 5px;
-				}
+}
+dd.wp-caption p.wp-caption-text,
+.wp-caption p.wp-caption-text {
+	font-size: 0.9em;
+	line-height: 17px;
+	margin: 0;
+	padding: 5px 4px 5px 0;
+}
+#content .gallery {
+	margin: 0 auto 15px;
+}
+#content .gallery .gallery-item {
+	margin-bottom: 0;
+	margin-left: 0;
+}
+.gallery-item img {
+	margin-bottom: 15px;
+}
+.gallery .gallery-caption {
+	color: #555;
+}
 
-		div.activity-comments form div.ac-reply-avatar {
-			float: left;
-		}
-			div.ac-reply-avatar img {
-				border: 2px solid #fff !important;
-			}
 
-		div.activity-comments form div.ac-reply-content {
-			margin-left: 50px;
-			padding-left: 15px;
-			color: #888;
-			font-size: 11px;
-		}
+/*--------------------------------------------------------------
+5.4 - Images
+--------------------------------------------------------------*/
+img.avatar {
+	border: 2px solid #eee;
+	float: left;
+}
+img.wp-smiley {
+	border: none !important;
+	clear: none !important;
+	float: none !important;
+	margin: 0 !important;
+	padding: 0 !important;
+}
+img.centered,
+img.aligncenter {
+	display: block;
+	margin-left: auto;
+	margin-right: auto;
+}
+img.alignright {
+	display: inline;
+	margin: 0 0 2px 7px;
+	padding: 4px;
+}
+img.alignleft {
+	display: inline;
+	margin: 0 7px 2px 0;
+	padding: 4px;
+}
 
-/* > Private Message Threads
--------------------------------------------------------------- */
 
-table#message-threads tr.unread td {
-	background: #FFF9DB;
-	border-top: 1px solid #FFE8C4;
-	border-bottom: 1px solid #FFE8C4;
+/*--------------------------------------------------------------
+5.5 - Posts
+--------------------------------------------------------------*/
+div.page,
+div.post,
+div.attachment {
+	margin: 0 0 15px 0;
+	overflow: hidden;
+}
+div.page:last-child,
+div.post:last-child,
+#item-body:last-child,
+#trackbacklist {
+	margin-bottom: 0;
+}
+h2.posttitle {
+	line-height: 120%;
+	margin: 0;
+}
+h2.pagetitle {
+	line-height: 120%;
+}
+h2.pagetitle a,
+h2.posttitle a {
+	color: #666;
+	text-decoration: none;
+}
+.edit-link,
+.page-link {
+	clear: both;
 	font-weight: bold;
 }
-	table#message-threads tr.unread td span.activity {
-		background: #fff;
-	}
-
-	li span.unread-count, tr.unread span.unread-count {
-		background: #dd0000;
-		padding: 2px 8px;
-		color: #fff;
-		font-weight: bold;
-		-moz-border-radius: 3px;
-		-webkit-border-radius: 3px;
-		border-radius: 3px;
-	}
-		div.item-list-tabs ul li a span.unread-count {
-			padding: 1px 6px;
-			color: #fff;
-		}
-
-	div.messages-options-nav {
-		font-size: 11px;
-		background: #eee;
-		text-align: right;
-		margin: 0 -20px;
-		padding: 5px 15px;
-	}
-
-div#message-thread div.message-box {
-	margin: 0 -20px;
-	padding: 15px;
+div.post table,
+div.page table {
+	border: 1px solid #eee;
+	border-collapse: collapse;
+	border-spacing: 0;
+	margin-bottom: 15px;
+}
+div.post table th,
+div.page table th {
+	border-top: 1px solid #eee;
+	text-align: left;
+}
+div.post table td,
+div.page table td {
+	border-top: 1px solid #eee;
+}
+div.author-box {
+	background: #f0f0f0;
+	-moz-border-radius: 3px;
+	-webkit-border-radius: 3px;
+	border-radius: 3px;
+	float: left;
+	font-family: georgia, times, serif;
+	font-style: italic;
+	margin: 0 15px 15px 0;
+	padding: 10px;
+	text-align: center;
+	width: 70px;
+}
+div.author-box p {
+	word-wrap: break-word;
+}
+div.author-box p,
+div.comment-avatar-box p {
+	margin: 5px 0 0;
+}
+div.author-box a,
+div.comment-avatar-box a {
+	text-decoration: none;
+}
+div.author-box img {
+	float: none;
+	border: 4px solid #fff;
+	margin: 0;
+}
+div.post-content {
+	margin-left: 105px;
+}
+p.date span:first-child {
+	font-style: italic;
+}
+div.post .entry {
+	margin-bottom: 15px;
+}
+p.date,
+p.postmetadata {
+	border-bottom: 1px solid #e4e4e4;
+	border-top: 1px solid #e4e4e4;
+	color: #888;
+	font-family: Georgia, times, serif;
+	font-size: 12px;
+	margin: 10px 0;
+	padding: 3px 0;
+}
+p.postmetadata {
+	clear: left;
+	overflow: hidden;
+}
+.page .tags,
+.post .tags {
+	float: left;
+}
+span.sticky-post {
+	font-style: normal;
 }
-	div#message-thread div.alt {
-		background: #f4f4f4;
-	}
-
-	div#message-thread p#message-recipients {
-		margin: 10px 0 20px 0;
-	}
-
-	div#message-thread img.avatar {
-		float: left;
-		margin: 0 10px 0 0;
-		vertical-align: middle;
-	}
-
-	div#message-thread strong {
-		margin: 0;
-		font-size: 16px;
-	}
-		div#message-thread strong a {
-			text-decoration: none;
-		}
-
-		div#message-thread strong span.activity {
-			margin: 4px 0 0 10px;
-		}
-
-	div#message-thread div.message-metadata {
-		overflow: hidden;
-	}
-
-	div#message-thread div.message-content {
-		margin-left: 45px;
-	}
 
-	div#message-thread div.message-options {
-		text-align: right;
-	}
 
-/* > Group Forum Topics
--------------------------------------------------------------- */
+/*--------------------------------------------------------------
+6.0 - BuddyPress
+--------------------------------------------------------------*/
+/*--------------------------------------------------------------
+6.1 - Activity
+--------------------------------------------------------------*/
+#activity-stream {
+	margin-top: -5px;
+}
+#item-body form#whats-new-form {
+	border-bottom: 1px solid #ddd;
+	margin: 20px 0 10px;
+	padding-bottom: 20px;
+}
+.home-page form#whats-new-form {
+	border-bottom: none;
+	padding-bottom: 0;
+}
+form#whats-new-form h5 {
+	font-weight: normal;
+	font-size: 12px;
+	color: #888;
+	margin: 0;
+	margin-left: 76px;
+	padding: 0 0 3px 0;
+}
+form#whats-new-form #whats-new-avatar {
+	float: left;
+}
+form#whats-new-form #whats-new-content {
+	margin-left: 54px;
+	padding-left: 22px;
+}
+form#whats-new-form textarea {
+	background: #fff;
+	border: 1px inset #ccc;
+	-moz-border-radius: 3px;
+	-webkit-border-radius: 3px;
+	border-radius: 3px;
+	color: #555;
+	font-family: inherit;
+	font-size: 14px;
+	height: 20px;
+	padding: 6px;
+	width: 98%;
+}
+body.no-js form#whats-new-form textarea {
+	height: 50px;
+}
+form#whats-new-form #whats-new-options select {
+	max-width: 200px;
+	margin-top: 12px;
+}
+form#whats-new-form #whats-new-submit {
+	float: right;
+	margin-top: 12px;
+}
+#whats-new-options {
+	overflow: auto;
+	height: 0;
+}
+body.no-js #whats-new-options {
+	height: auto;
+}
+#whats-new:focus {
+	border-color: rgba(31, 179, 221, 0.9) !important;
+	outline-color: rgba(31, 179, 221, 0.9);
+	box-shadow: 0 0 7px         rgba(31, 179, 221, 0.7);
+	-moz-box-shadow: 0 0 7px    rgba(31, 179, 221, 0.7);
+	-webkit-box-shadow: 0 0 7px rgba(31, 179, 221, 0.7);
+}
 
-ul#topic-post-list {
-	margin: 15px -20px;
+/*--------------------------------------------------------------
+6.1.1 - Activity Listing
+--------------------------------------------------------------*/
+ul.activity-list li {
+	overflow: hidden;
+	padding: 15px 0 0;
+}
+.activity-list .activity-avatar {
+	float: left;
+}
+ul.activity-list > li:first-child {
+	padding-top: 5px;
+}
+ul.item-list.activity-list li.has-comments {
+	padding-bottom: 15px;
+}
+body.activity-permalink ul.activity-list li.has-comments {
+	padding-bottom: 0;
+}
+.activity-list li.mini {
+	font-size: 11px;
+	min-height: 35px;
+	padding: 15px 0 0 0;
+	position: relative;
+}
+.activity-list li.mini .activity-avatar img.avatar,
+.activity-list li.mini .activity-avatar img.FB_profile_pic {
+	height: 20px;
+	margin-left: 30px;
+	width: 20px;
+}
+.activity-permalink .activity-list li.mini .activity-avatar img.avatar,
+.activity-permalink .activity-list li.mini .activity-avatar img.FB_profile_pic {
+	height: auto;
+	margin-left: 0;
 	width: auto;
 }
-	ul#topic-post-list li {
-		padding: 15px;
-		position: relative;
-	}
-
-	ul#topic-post-list li.alt {
-		background: #f4f4f4;
-	}
-
-	ul#topic-post-list li div.poster-meta {
-		margin-bottom: 10px;
-		color: #888;
-	}
-
-	ul#topic-post-list li div.post-content {
-		margin-left: 54px;
-	}
-
-div.admin-links {
-	position: absolute;
-	top: 15px;
-	right: 25px;
+body.activity-permalink .activity-list > li:first-child {
+	padding-top: 0;
+}
+.activity-list li .activity-content {
+	position: relative;
+}
+.activity-list li.mini .activity-content p {
+	margin: 0;
+}
+.activity-list li.mini .activity-comments {
+	clear: both;
+	font-size: 12px;
+}
+body.activity-permalink li.mini .activity-meta {
+	margin-top: 4px;
+}
+.activity-list li .activity-inreplyto {
+	background: url( ../images/replyto_arrow.gif ) 7px 0 no-repeat;
 	color: #888;
 	font-size: 11px;
+	margin-left: 5px;
+	margin-top: 5px;
+	padding-left: 25px;
 }
-	div#topic-meta div.admin-links {
-		bottom: 0;
-		right: 0;
-		top: auto;
-	}
-
-div#topic-meta {
-	position: relative;
-	padding: 5px 0;
+.activity-list li .activity-inreplyto > p {
+	margin: 0;
+	display: inline;
 }
-	div#topic-meta h3 {
-		font-size: 20px;
-	}
-
-div#new-topic-post {
+.activity-list li .activity-inreplyto blockquote,
+.activity-list li .activity-inreplyto div.activity-inner {
+	background: none;
+	border: none;
+	display: inline;
 	margin: 0;
-	padding: 1px 0 0 0;
+	overflow: hidden;
+	padding: 0;
 }
-
-/* > WordPress Blog Styles
--------------------------------------------------------------- */
-
-div.post {
-	margin: 0 0 40px 0;
+.activity-list .activity-content {
+	margin-left: 70px;
+	margin-bottom: 15px;
+}
+body.activity-permalink .activity-list li .activity-content {
+	background: #fff;
+	border-bottom: 1px solid #ddd;
+	border-right: 1px solid #ddd;
+	-moz-border-radius: 4px;
+	-webkit-border-radius: 4px;
+	border-radius: 4px;
+	font-size: 16px;
+	line-height: 150%;
+	min-height: 35px;
+	margin-left: 185px;
+	margin-right: 0;
+	padding: 15px;
+}
+body.activity-permalink .activity-list li .activity-header > p {
+	background: url( ../images/activity_arrow.gif ) top left no-repeat;
+	height: 35px;
+	margin-bottom: 0;
+	margin-left: -35px;
+	padding: 5px 0 0 35px;
+}
+.activity-list .activity-content .activity-header,
+.activity-list .activity-content .comment-header {
+	color: #888;
+	font-size: 11px;
+	line-height: 220%;
+}
+.activity-header {
+	margin-right: 20px;
+}
+.activity-header a,
+.comment-meta a,
+.acomment-meta a {
+	text-decoration: none;
+}
+.activity-list .activity-content .activity-header img.avatar {
+	float: none !important;
+	margin: 0 5px -8px 0 !important;
+}
+a.bp-secondary-action,
+span.highlight {
+	font-size: 11px;
+	padding: 0;
+	margin-right: 5px;
+	text-decoration: none;
+}
+.activity-list .activity-content .activity-inner,
+.activity-list .activity-content blockquote {
+	margin: 10px 10px 5px 0;
 	overflow: hidden;
 }
-	div.post h2.pagetitle, div.post h2.posttitle {
-		margin: 0;
-		line-height: 120%;
-	}
-		div.post h2.pagetitle a, div.post h2.posttitle a {
-			color: #666;
-			text-decoration: none;
-		}
-
-	.navigation, .paged-navigation, .comment-navigation {
-		overflow: hidden;
-		font-family: georgia, times, serif;
-		font-style: italic;
-		font-size: 14px;
-		padding: 5px 0;
-		margin: 5px 0 25px 0;
-	}
-		.alignright {
-			float: right;
-			margin-left: 15px;
-		}
-
-		.alignleft {
-			float: left;
-			margin-right: 15px;
-		}
-
-	div.post p { margin: 0 0 20px 0; }
-	div.post ul, div.post ol, div.post dl { margin: 0 0 18px 1.5em; }
-	div.post ul { list-style: square; }
-	div.post ol { list-style: decimal; }
-	div.post ol ol { list-style: upper-alpha; }
-	div.post dl { margin-left: 0; }
-	div.post dt { font-size: 14px; font-weight: bold; }
-	div.post dd { margin: 0 0 15px 0;}
-
-	div.post pre, div.post code p {
-		padding: 15px;
-		background: #f4f4f4;
-		-moz-border-radius: 3px;
-		-webkit-border-radius: 3px;
-		border-radius: 3px;
-	}
-
-	div.post code { font-family: "Monaco", courier, sans-serif; }
-	div.post blockquote {
-		quotes: none;
-		font-style:italic;
-		padding:0 3em;
-		font-family: georgia, times, serif;
-		font-size: 16px;
-		line-height: 150%;
-	}
-
-	div.post table {
-		border-collapse:collapse;
-		border-spacing:0;
-		border: 1px solid #eee;
-	}
-		div.post table th { border-top: 1px solid #eee; text-align: left; }
-		div.post table td { border-top: 1px solid #eee; }
-
-	div.post div.author-box, div.comment-avatar-box {
-		background: #f0f0f0;
-		padding: 10px;
-		float: left;
-		margin: 0 15px 15px 0;
-		font-family: georgia, times, serif;
-		font-style: italic;
-		text-align: center;
-		width: 70px;
-		-moz-border-radius: 3px;
-		-webkit-border-radius: 3px;
-		border-radius: 3px;
-	}
-		div.author-box p, div.comment-avatar-box p { margin: 5px 0 0; }
-		div.author-box a, div.comment-avatar-box a { text-decoration: none; }
-
-		div.post div.author-box img, div.comment-avatar-box img {
-			float: none;
-			border: 4px solid #fff;
-			margin: 0;
-		}
-
-	div.post div.post-content, div.comment-content {
-		margin-left: 105px;
-	}
-
-	div.post p.date, div.post p.postmetadata, div.comment-meta, div.comment-options {
-		color: #888;
-		font-size: 12px;
-		font-family: Georgia, times, serif;
-		padding: 3px 0;
-		margin: 10px 0;
-		border-bottom: 1px solid #e4e4e4;
-		border-top: 1px solid #e4e4e4;
-	}
-
-	div.post p.postmetadata {
-		margin-top: 15px;
-		clear: left;
-		overflow: hidden;
-	}
-
-	div.post .tags { float: left; }
-	div.post .comments { float: right; }
-
-	div.post img { margin-bottom: 15px; }
-	div.post img.wp-smiley { padding: 0 !important; margin: 0 !important; border: none !important; float: none !important; clear: none !important; }
-
-	div.post img.centered, img.aligncenter {
-		display: block;
-		margin-left: auto;
-		margin-right: auto;
-	}
-
-	div.post img.alignright {
-		padding: 4px;
-		margin: 0 0 2px 7px;
-		display: inline;
-	}
-
-	div.post img.alignleft {
-		padding: 4px;
-		margin: 0 7px 2px 0;
-		display: inline;
-	}
-
-	div.post .aligncenter, div.post div.aligncenter {
-		display: block;
-		margin-left: auto;
-		margin-right: auto;
-	}
-
-	div.post .wp-caption {
-		border: 1px solid #ddd;
-		text-align: center;
-		background-color: #f3f3f3;
-		padding-top: 4px;
-		-moz-border-radius: 3px;
-		-webkit-border-radius: 3px;
-		border-radius: 3px;
-	}
-
-	div.post .wp-caption img {
-		margin: 0;
-		padding: 0;
-		border: 0 none;
-	}
-
-	div.post dd.wp-caption p.wp-caption-text, div.post .wp-caption p.wp-caption-text {
-		font-size: 0.9em;
-		line-height: 17px;
-		padding: 0 4px 5px 0;
-		margin: 0;
-	}
-
-/* > WordPress Blog Comment Styles
--------------------------------------------------------------- */
-
-#trackbacks {
-	margin-top: 30px;
+.activity-list li.new_forum_post .activity-content .activity-inner,
+.activity-list li.new_forum_topic .activity-content .activity-inner {
+	border-left: 2px solid #EAEAEA;
+	margin-left: 5px;
+	padding-left: 10px;
 }
-
-#comments h3, #trackbacks h3, #respond h3 {
-	font-size: 20px;
-	margin: 5px 0 25px 0;
-	font-weight: normal;
-	color: #555;
+body.activity-permalink .activity-content .activity-inner,
+body.activity-permalink .activity-content blockquote {
+	margin-left: 0;
+	margin-top: 5px;
 }
-
-#comments span.title, #trackbacks span.title {
-	color: #aaa;
+.activity-inner > p {
+	word-wrap: break-word;
 }
-
-ol.commentlist li {
-	margin: 0 0 30px 0;
+.activity-inner > .activity-inner {
+	margin: 0 !important;
+}
+.activity-inner > blockquote {
+	margin: 0 !important;
+}
+.activity-list .activity-content img.thumbnail {
+	border: 2px solid #eee;
+	float: left;
+	margin: 0 10px 5px 0;
+}
+.activity-read-more {
+	margin-left: 1em;
+	white-space: nowrap;
+}
+.activity-list li.load-more {
+	background: #f0f0f0 !important;
+	border-right: 1px solid #ddd;
+	border-bottom: 1px solid #ddd;
+	-moz-border-radius: 4px;
+	-webkit-border-radius: 4px;
+	border-radius: 4px;
+	font-size: 1.2em;
+	margin: 15px 0 !important;
+	padding: 10px 15px !important;
+	text-align: center;
+}
+.activity-list li.load-more a {
+	color: #4D4D4D;
 }
 
-	div.comment-meta {
-		border-top: none;
-		padding-top: 0;
-	}
 
-	div.comment-meta h5 {
-		font-weight: normal;
-	}
+/*--------------------------------------------------------------
+6.1.2 - Activity Comments
+--------------------------------------------------------------*/
+div.activity-meta {
+	margin: 18px 0;
+}
+body.activity-permalink div.activity-meta {
+	margin-bottom: 6px;
+}
+div.activity-meta a {
+	font: normal 11px/20px Arial, Tahoma, Verdana, sans-serif;
+	padding: 4px 8px;
+}
+a.activity-time-since {
+	color: #aaa;
+	text-decoration: none;
+}
+a.activity-time-since:hover {
+	color: #888;
+	text-decoration: underline;
+}
+a.bp-primary-action,
+#reply-title small a {
+	font-size: 11px;
+	margin-right: 5px;
+	text-decoration: none;
+}
+a.bp-primary-action span,
+#reply-title small a span {
+	background: #999;
+	-moz-border-radius: 3px;
+	-webkit-border-radius: 3px;
+	border-radius: 3px;
+	color: #fff;
+	font-size: 90%;
+	margin-left: 2px;
+	padding: 0 5px;
+}
+a.bp-primary-action:hover span,
+#reply-title small a:hover span {
+	background: #555;
+	color: #fff;
+}
+div.activity-comments {
+	margin: 0 0 0 70px;
+	overflow: hidden; /* IE fix */
+	position: relative;
+	width: auto;
+	clear: both;
+}
+body.activity-permalink div.activity-comments {
+	background: none;
+	margin-left: 185px;
+	width: auto;
+}
+div.activity-comments > ul {
+	background: #f5f5f5;
+	-moz-border-radius: 4px;
+	-webkit-border-radius: 4px;
+	border-radius: 4px;
+	padding: 0 0 0 10px;
+}
+div.activity-comments ul,
+div.activity-comments ul li {
+	border: none;
+	list-style: none;
+}
+div.activity-comments ul {
+	clear: both;
+}
+div.activity-comments ul li {
+	border-top: 2px solid #fff;
+	padding: 10px 0 0;
+}
+body.activity-permalink .activity-list li.mini .activity-comments {
+	clear: none;
+	margin-top: 0;
+}
+body.activity-permalink div.activity-comments ul li {
+	border-width: 1px;
+	padding: 10px 0 0 0;
+}
+div.activity-comments > ul > li:first-child {
+	border-top: none;
+}
+div.activity-comments ul li:last-child {
+	margin-bottom: 0;
+}
+div.activity-comments ul li > ul {
+	margin-left: 30px;
+	margin-top: 0;
+	padding-left: 10px;
+}
+body.activity-permalink div.activity-comments ul li > ul {
+	margin-top: 10px;
+}
+body.activity-permalink div.activity-comments > ul {
+	padding: 0 10px 0 15px;
+}
+div.activity-comments div.acomment-avatar img {
+	border-width: 2px !important;
+	float: left;
+	height: 25px;
+	margin-right: 10px;
+	width: 25px;
+}
+div.activity-comments div.acomment-content {
+	font-size: 11px;
+	margin: 5px 0 0 40px;
+}
+div.acomment-content .time-since,
+div.acomment-content .activity-delete-link,
+div.acomment-content .comment-header {
+	display: none;
+}
+body.activity-permalink div.activity-comments div.acomment-content {
+	font-size: 14px;
+}
+div.activity-comments div.acomment-meta {
+	color: #888;
+	font-size: 11px;
+}
+div.activity-comments form.ac-form {
+	background: #fafafa;
+	border: 1px solid #ddd;
+	-moz-border-radius: 4px;
+	-webkit-border-radius: 4px;
+	border-radius: 4px;
+	display: none;
+	margin: 0 0 15px 33px;
+	padding: 8px;
+}
+div.activity-comments li form.ac-form {
+	margin-right: 15px;
+	clear: both;
+}
+div.activity-comments form.root {
+	margin-left: 0;
+}
+div.activity-comments div#message {
+	margin-top: 15px;
+	margin-bottom: 0;
+}
+div.activity-comments form.loading {
+	background-image: url( ../images/ajax-loader.gif );
+	background-position: 2% 95%;
+	background-repeat: no-repeat;
+}
+div.activity-comments form .ac-textarea {
+	background: #fff;
+	border: 1px inset #ccc;
+	-moz-border-radius: 3px;
+	-webkit-border-radius: 3px;
+	border-radius: 3px;
+	margin-bottom: 10px;
+	padding: 8px;
+}
+div.activity-comments form textarea {
+	border: none;
+	color: #555;
+	font-family: inherit;
+	font-size: 11px;
+	height: 60px;
+	padding: 0;
+	width: 100%;
+}
+div.activity-comments form input {
+	margin-top: 5px;
+}
+div.activity-comments form div.ac-reply-avatar {
+	float: left;
+}
+div.ac-reply-avatar img {
+	border: 2px solid #fff !important;
+}
+div.activity-comments form div.ac-reply-content {
+	color: #888;
+	font-size: 11px;
+	margin-left: 50px;
+	padding-left: 15px;
+}
+.acomment-options {
+	float: left;
+	margin: 5px 0 5px 40px;
+}
+.acomment-options a {
+	color: #999;
+}
+.acomment-options a:hover {
+	color: inherit;
+}
 
-	div.comment-meta em {
-		float: right;
-	}
 
-	div.comment-options {
-		border-bottom: none;
-	}
+/*--------------------------------------------------------------
+6.2 - Admin Bar
+--------------------------------------------------------------*/
+#wp-admin-bar .padder {
+	width: 95% !important; /* Line up the admin bar with the content body in this theme */
+}
 
-/* > Footer
--------------------------------------------------------------- */
 
-#footer {
-	padding: 25px;
+/*--------------------------------------------------------------
+6.3 - Directories - Members, Groups, Blogs, Forums
+--------------------------------------------------------------*/
+div.dir-search {
+	float: right;
+	margin: -39px 0 0 0;
+}
+div.dir-search input[type=text] {
+	font-size: 12px;
+	padding: 1px 3px;
+}
+
+
+/*--------------------------------------------------------------
+6.4 - Errors / Success Messages
+--------------------------------------------------------------*/
+div#message {
+	margin: 0 0 15px;
+}
+#message.info {
+	margin-bottom: 0;
+}
+div#message.updated {
+	clear: both;
+}
+div#message p {
+	font-size: 12px;
+	display: block;
+	padding: 10px 15px;
+}
+div#message.error p {
+	background-color: #db1717;
+	border-color: #a71a1a;
+	clear: left;
+	color: #fff;
+}
+div#message.updated p {
+	background-color: #8ff57a;
+	border-color: #80cf70;
+	color: #1a6a00;
+}
+.standard-form#signup_form div div.error {
+	background: #e41717;
+	-moz-border-radius: 3px;
+	-webkit-border-radius: 3px;
+	border-radius: 3px;
+	color: #fff;
+	margin: 0 0 10px 0;
+	padding: 6px;
+	width: 90%;
+}
+div.accept,
+div.reject {
+	float: left;
+	margin-left: 10px;
+}
+ul.button-nav li {
+	float: left;
+	margin: 0 10px 10px 0;
+}
+ul.button-nav li.current a {
+	font-weight: bold;
+}
+
+
+/*--------------------------------------------------------------
+6.5 - Forms
+--------------------------------------------------------------*/
+.standard-form textarea,
+.standard-form input[type=text],
+.standard-form select,
+.standard-form input[type=password],
+.dir-search input[type=text] {
+	border: 1px inset #ccc;
+	-moz-border-radius: 3px;
+	-webkit-border-radius: 3px;
+	border-radius: 3px;
+	color: #888;
+	font: inherit;
+	font-size: 14px;
+	padding: 6px;
+}
+.standard-form select {
+	padding: 3px;
+}
+.standard-form input[type=password] {
+	margin-bottom: 5px;
+}
+.standard-form label,
+.standard-form span.label {
+	display: block;
+	font-weight: bold;
+	margin: 15px 0 5px 0;
+}
+.standard-form div.checkbox label,
+.standard-form div.radio label {
+	color: #888;
+	font-size: 14px;
+	font-weight: normal;
+	margin: 5px 0 0 0;
+}
+.standard-form#sidebar-login-form label {
+	margin-top: 5px;
+}
+.standard-form input[type=text] {
+	width: 75%;
+}
+.standard-form#sidebar-login-form input[type=text],
+.standard-form#sidebar-login-form input[type=password] {
+	padding: 4px;
+	width: 95%;
+}
+.standard-form #basic-details-section input[type=password],
+.standard-form #blog-details-section input#signup_blog_url {
+	width: 35%;
+}
+.standard-form#signup_form input[type=text],
+.standard-form#signup_form textarea,
+.form-allowed-tags,
+#commentform input[type=text],
+#commentform textarea {
+	width: 90%;
+}
+.standard-form#signup_form div.submit {
+	float: right;
+}
+div#signup-avatar img {
+	margin: 0 15px 10px 0;
+}
+.standard-form textarea {
+	width: 75%;
+	height: 120px;
+}
+.standard-form textarea#message_content {
+	height: 200px;
+}
+.standard-form#send-reply textarea {
+	width: 97.5%;
+}
+.standard-form p.description {
+	color: #888;
+	font-size: 11px;
+	margin: 5px 0;
+}
+.standard-form div.submit {
+	clear: both;
+	padding: 15px 0 0 0;
+}
+.standard-form p.submit {
+	margin-bottom: 0;
+	padding: 15px 0 0 0;
+}
+.standard-form div.submit input {
+	margin-right: 15px;
+}
+.standard-form div.radio ul {
+	margin: 10px 0 15px 38px;
+	list-style: disc;
+}
+.standard-form div.radio ul li {
+	margin-bottom: 5px;
+}
+.standard-form a.clear-value {
+	display: block;
+	margin-top: 5px;
+	outline: none;
+}
+.standard-form #basic-details-section,
+.standard-form #blog-details-section,
+.standard-form #profile-details-section {
+	float: left;
+	width: 48%;
+}
+.standard-form #profile-details-section {
+	float: right;
+}
+.standard-form #blog-details-section {
+	clear: left;
+}
+.standard-form input:focus,
+.standard-form textarea:focus,
+.standard-form select:focus {
+	background: #fafafa;
+	color: #555;
+}
+form#send-invite-form {
+	margin-top: 20px;
+}
+div#invite-list {
+	background: #f5f5f5;
+	border: 1px solid #e4e4e4;
+	-moz-border-radius: 3px;
+	-webkit-border-radius: 3px;
+	border-radius: 3px;
+	height: 400px;
+	margin: 0 0 10px;
+	overflow: auto;
+	padding: 5px;
+	width: 160px;
+}
+button,
+a.button,
+input[type=submit],
+input[type=button],
+input[type=reset],
+ul.button-nav li a,
+div.generic-button a,
+.comment-reply-link {
+	background: #fff; /* Old browsers */
+	background: -moz-linear-gradient(top, #ffffff 0%, #ededed 100%); /* FF3.6+ */
+	background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#ffffff), color-stop(100%,#ededed)); /* Chrome,Safari4+ */
+	background: -webkit-linear-gradient(top, #ffffff 0%,#ededed 100%); /* Chrome10+,Safari5.1+ */
+	background: -o-linear-gradient(top, #ffffff 0%,#ededed 100%); /* Opera11.10+ */
+	background: -ms-linear-gradient(top, #ffffff 0%,#ededed 100%); /* IE10+ */
+	filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#ededed',GradientType=0 ); /* IE6-9 */
+	background: linear-gradient(top, #ffffff 0%,#ededed 100%); /* W3C */
+	border: 1px solid #ccc;
+	-moz-border-radius: 3px;
+	-webkit-border-radius: 3px;
+	border-radius: 3px;
+	color: #777;
+	cursor: pointer;
+	font: normal 12px/20px Arial, Tahoma, Verdana, sans-serif;
+	outline: none;
+	padding: 4px 10px;
 	text-align: center;
-	color: #bbb;
-	text-shadow: #fafafa 1px 1px 0;
+	text-decoration: none;
+	line-height: 14px;
+}
+button:hover,
+a.button:hover,
+a.button:focus,
+input[type=submit]:hover,
+input[type=button]:hover,
+input[type=reset]:hover,
+ul.button-nav li a:hover,
+ul.button-nav li.current a,
+div.generic-button a:hover,
+.comment-reply-link:hover {
+	background: #ededed;
+	background: -moz-linear-gradient(top, #ffffff 0%, #e0e0e0 100%); /* FF3.6+ */
+	background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#ffffff), color-stop(100%,#e0e0e0)); /* Chrome,Safari4+ */
+	background: -webkit-linear-gradient(top, #ffffff 0%,#e0e0e0 100%); /* Chrome10+,Safari5.1+ */
+	background: -o-linear-gradient(top, #ffffff 0%,#e0e0e0 100%); /* Opera11.10+ */
+	background: -ms-linear-gradient(top, #ffffff 0%,#e0e0e0 100%); /* IE10+ */
+	filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#e0e0e0',GradientType=0 ); /* IE6-9 */
+	background: linear-gradient(top, #ffffff 0%,#e0e0e0 100%); /* W3C */
+	border: 1px solid #bbb;
+	color: #555;
+	outline: none;
+	text-decoration: none;
+}
+
+/*--------------------------------------------------------------
+6.6 - Ajax Loading
+--------------------------------------------------------------*/
+a.loading,
+input.loading {
+    background-image: url( ../images/ajax-loader.gif );
+    background-position: 95% 50%;
+    background-repeat: no-repeat;
+    padding-right: 25px;
+}
+a.loading:hover,
+input.loading:hover {
+    background-image: url( ../images/ajax-loader.gif );
+    background-position: 95% 50%;
+    background-repeat: no-repeat;
+    padding-right: 25px;
+    color: #777;
+}
+a.button.loading,
+input[type="submit"].loading,
+input[type="button"].loading,
+input[type="reset"].loading {
+	background-image: url( ../images/ajax-loader.gif ), -moz-linear-gradient(top, #ffffff 0%, #e0e0e0 100%); /* FF3.6+ */
+	background-image: url( ../images/ajax-loader.gif ), -webkit-gradient(linear, left top, left bottom, color-stop(0%,#ffffff), color-stop(100%,#e0e0e0)); /* Chrome,Safari4+ */
+	background-image: url( ../images/ajax-loader.gif ), -webkit-linear-gradient(top, #ffffff 0%,#e0e0e0 100%); /* Chrome10+,Safari5.1+ */
+	background-image: url( ../images/ajax-loader.gif ), -o-linear-gradient(top, #ffffff 0%,#e0e0e0 100%); /* Opera11.10+ */
+	background-image: url( ../images/ajax-loader.gif ), -ms-linear-gradient(top, #ffffff 0%,#e0e0e0 100%); /* IE10+ */
+	filter: progid:DXImageTransform.Microsoft.gradient( enabled=0 ); /* IE6-9 */
+	background-image: url( ../images/ajax-loader.gif ), linear-gradient(top, #ffffff 0%,#e0e0e0 100%); /* W3C */
+	background-position: 95% 50%;
+	background-repeat: no-repeat;
+	padding-right: 25px;
+}
+a.button.loading:hover,
+input[type="submit"].loading:hover,
+input[type="button"].loading:hover,
+input[type="reset"].loading:hover {
+  	background-image: url( ../images/ajax-loader.gif ), -moz-linear-gradient(top, #ffffff 0%, #e0e0e0 100%); /* FF3.6+ */
+	background-image: url( ../images/ajax-loader.gif ), -webkit-gradient(linear, left top, left bottom, color-stop(0%,#ffffff), color-stop(100%,#e0e0e0)); /* Chrome,Safari4+ */
+	background-image: url( ../images/ajax-loader.gif ), -webkit-linear-gradient(top, #ffffff 0%,#e0e0e0 100%); /* Chrome10+,Safari5.1+ */
+	background-image: url( ../images/ajax-loader.gif ), -o-linear-gradient(top, #ffffff 0%,#e0e0e0 100%); /* Opera11.10+ */
+	background-image: url( ../images/ajax-loader.gif ), -ms-linear-gradient(top, #ffffff 0%,#e0e0e0 100%); /* IE10+ */
+	filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#e0e0e0',GradientType=0 ); /* IE6-9 */
+	background-image: url( ../images/ajax-loader.gif ), linear-gradient(top, #ffffff 0%,#e0e0e0 100%); /* W3C */
+	border: 1px solid #ccc;
+	padding-right: 25px;
+}
+input[type="submit"].pending,
+input[type="button"].pending,
+input[type="reset"].pending,
+input[type="submit"].disabled,
+input[type="button"].disabled,
+input[type="reset"].disabled,
+button.pending,
+button.disabled,
+div.pending a,
+a.disabled {
+    border-color: #eee;
+    color: #bbb;
+    cursor: default;
+}
+input[type="submit"]:hover.pending,
+input[type="button"]:hover.pending,
+input[type="reset"]:hover.pending,
+input[type="submit"]:hover.disabled,
+input[type="button"]:hover.disabled,
+input[type="reset"]:hover.disabled,
+button.pending:hover,
+button.disabled:hover,
+div.pending a:hover,
+a.disabled:hover {
+	background: -moz-linear-gradient(top, #ffffff 0%, #ededed 100%); /* FF3.6+ */
+	background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#ffffff), color-stop(100%,#ededed)); /* Chrome,Safari4+ */
+	background: -webkit-linear-gradient(top, #ffffff 0%,#ededed 100%); /* Chrome10+,Safari5.1+ */
+	background: -o-linear-gradient(top, #ffffff 0%,#ededed 100%); /* Opera11.10+ */
+	background: -ms-linear-gradient(top, #ffffff 0%,#ededed 100%); /* IE10+ */
+	filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#ededed',GradientType=0 ); /* IE6-9 */
+	background: linear-gradient(top, #ffffff 0%,#ededed 100%); /* W3C */
+    border-color: #eee;
+    color: #bbb;
+}
+
+
+/*--------------------------------------------------------------
+6.7 - Forums, Tables and Topics
+--------------------------------------------------------------*/
+ul#topic-post-list {
+	margin: 0px -19px 15px;
+	width: auto;
+}
+ul#topic-post-list li {
+	padding: 15px;
+	position: relative;
+}
+ul#topic-post-list li.alt {
+	background: #f5f5f5;
+}
+ul#topic-post-list li div.poster-meta {
+	color: #888;
+	margin-bottom: 10px;
+}
+ul#topic-post-list li div.post-content {
+	margin-left: 54px;
+}
+div.topic-tags {
+	font-size: 11px;
+	float: right;
+	margin-top: -25px;
+}
+div.admin-links {
+	color: #888;
+	font-size: 11px;
+	position: absolute;
+	top: 15px;
+	right: 25px;
+}
+div#topic-meta {
+	margin: -10px -19px;
+	padding: 5px 19px 30px;
+	position: relative;
+}
+div#topic-meta div.admin-links {
+	right: 19px;
+	top: -36px;
+}
+div#topic-meta h3 {
+	font-size: 20px;
+	margin: 5px 0;
+}
+div#new-topic-post {
+	display: none;
+	margin: 20px 0 0 0;
+	padding: 1px 0 0 0;
+}
+table {
+	width: 100%;
+}
+table thead tr {
+	background: #eaeaea;
+}
+table#message-threads {
+	margin: 0 -19px;
+	width: auto;
+}
+table.profile-fields {
+	margin-bottom: 20px;
+}
+table.profile-fields:last-child {
+	margin-bottom: 0;
+}
+table.profile-fields p {
+	margin-top: 15px;
+}
+table.profile-fields p:last-child {
+	margin-top: 0;
+}
+div#sidebar table {
+	margin: 0 -16px;
+	width: 117%;
+}
+table tr td,
+table tr th {
+	padding: 8px;
+	vertical-align: middle;
+}
+table tr td.label {
+	border-right: 1px solid #eaeaea;
+	font-weight: bold;
+	width: 25%;
+}
+table tr td.thread-info p {
+	margin: 0;
+}
+table tr td.thread-info p.thread-excerpt {
+	color: #888;
+	font-size: 11px;
+	margin-top: 3px;
+}
+div#sidebar table td,
+table.forum td {
+	text-align: center;
+}
+table tr.alt td {
+	background: #f5f5f5;
+}
+table.notification-settings {
+	margin-bottom: 20px;
+	text-align: left;
+}
+#groups-notification-settings {
+	margin-bottom: 0;
+}
+table.notification-settings th.icon,
+table.notification-settings td:first-child {
+	display: none;
+}
+table.notification-settings th.title {
+	width: 80%;
+}
+table.notification-settings .yes,
+table.notification-settings .no {
+	text-align: center;
+	width: 40px;
+}
+table.forum {
+	margin: 0 -19px;
+	width: auto;
+}
+table.forum tr.sticky td {
+	font-size: 1.2em;
+	background: #fff9db;
+	border-top: 1px solid #ffe8c4;
+	border-bottom: 1px solid #ffe8c4;
+}
+table.forum tr.closed td.td-title {
+	background-image: url( ../images/closed.png );
+	background-position: 15px 50%;
+	background-repeat: no-repeat;
+	padding-left: 35px;
+}
+table.forum td p.topic-text {
+	color: #888;
+	font-size: 13px;
+}
+table.forum tr > td:first-child,
+table.forum tr > th:first-child {
+	padding-left: 15px;
+}
+table.forum tr > td:last-child,
+table.forum tr > th:last-child {
+	padding-right: 15px;
+}
+table.forum tr th#th-title,
+table.forum tr th#th-poster,
+table.forum tr th#th-group,
+table.forum td.td-poster,
+table.forum td.td-group,
+table.forum td.td-title {
+	text-align: left;
+}
+table.forum tr td.td-title a.topic-title {
+	font-size: 1.2em;
+}
+table.forum td.td-freshness {
+	white-space: nowrap;
+}
+table.forum td.td-freshness span.time-since {
+	font-size: 0.9em;
+	color: #888;
+}
+table.forum td img.avatar {
+	float: none;
+	margin: 0 5px -8px 0;
+}
+table.forum td.td-poster,
+table.forum td.td-group {
+	min-width: 140px;
+}
+table.forum th#th-title {
+	width: 80%;
+}
+table.forum th#th-freshness {
+	width: 25%;
+}
+table.forum th#th-postcount {
+	width: 15%;
+}
+table.forum p.topic-meta {
+	font-size: 0.9em;
+	margin: 5px 0 0 0;
+}
+
+/*--------------------------------------------------------------
+6.8 - Headers, Lists and Tabs - Activity, Groups, Blogs, Forums
+--------------------------------------------------------------*/
+.item-body {
+	margin: 20px 0;
+}
+span.activity {
+	display: inline-block;
+	font-size: 11px;
+	opacity: 0.8;
+	padding: 1px 8px;
+}
+span.user-nicename {
+	color: #777;
+	display: inline-block;
+	font-size: 16px;
+	font-weight: bold;
+}
+span.activity,
+div#message p {
+	border: 1px solid #e1ca82;
+	-moz-border-radius: 3px;
+	-webkit-border-radius: 3px;
+	border-radius: 3px;
+	font-weight: normal;
+	margin-top: 3px;
+	text-decoration: none;
+	background: #ffeaa6;
+	background-image: -webkit-linear-gradient(rgba(255, 255, 255, .5), rgba(255, 255, 255, 0));
+	background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(255, 255, 255, .5)), color-stop(100%,rgba(255, 255, 255, 0))); /* Chrome,Safari4+ */
+	background-image: -moz-linear-gradient(rgba(255, 255, 255, .5), rgba(255, 255, 255, 0));
+	background-image: -ms-linear-gradient(rgba(255, 255, 255, .5), rgba(255, 255, 255, 0));
+	background-image: -o-linear-gradient(rgba(255, 255, 255, .5), rgba(255, 255, 255, 0));
+	background-image: linear-gradient(rgba(255, 255, 255, .5), rgba(255, 255, 255, 0));
+}
+div#item-header {
+	overflow: hidden;
+}
+div#item-header div#item-header-content {
+	margin-left: 170px;
+}
+div#item-header h2 {
+	font-size: 28px;
+	line-height: 120%;
+	margin: 0 0 15px 0;
+}
+div#item-header h2 a {
+	color: #777;
+	text-decoration: none;
+}
+div#item-header img.avatar {
+	float: left;
+	margin: 0 15px 19px 0;
+}
+div#item-header h2 {
+	margin-bottom: 5px;
+}
+div#item-header span.activity,
+div#item-header h2 span.highlight {
+	font-size: 11px;
+	font-weight: normal;
+	line-height: 170%;
+	margin-bottom: 7px;
+	vertical-align: middle;
+}
+div#item-header h2 span.highlight {
+	font-size: 16px;
+}
+div#item-header h2 span.highlight span {
+	background: #a1dcfa;
+	-moz-border-radius: 3px;
+	-webkit-border-radius: 3px;
+	border-radius: 3px;
+	color: #fff;
+	cursor: pointer;
+	font-weight: bold;
+	font-size: 11px;
+	margin-bottom: 2px;
+	padding: 1px 4px;
+	position: relative;
+	right: -2px;
+	top: -2px;
+	vertical-align: middle;
+}
+div#item-header div#item-meta {
+	font-size: 14px;
+	color: #aaa;
+	overflow: hidden;
+	margin: 15px 0 5px 0;
+	padding-bottom: 10px;
+}
+div#item-header div#item-actions {
+	float: right;
+	margin: 0 0 15px 15px;
+	text-align: right;
+	width: 20%;
+}
+div#item-header div#item-actions h3 {
+	font-size: 12px;
+	margin: 0 0 5px 0;
+}
+div#item-header ul {
+	margin-bottom: 15px;
+	overflow: hidden;
+}
+div#item-header ul h5,
+div#item-header ul span,
+div#item-header ul hr {
+	display: none;
+}
+div#item-header ul li {
+	float: right;
+}
+div#item-header ul img.avatar,
+div#item-header ul.avatars img.avatar {
+	height: 30px;
+	margin: 2px;
+	width: 30px;
+}
+div#item-header div.generic-button,
+div#item-header a.button {
+	float: left;
+	margin: 10px 10px 0 0;
+}
+div#item-header div#message.info {
+	line-height: 80%;
+}
+ul.item-list {
+	width: 100%;
+}
+ul.item-list li {
+	border-bottom: 1px solid #eaeaea;
+	padding: 15px 0;
+	position: relative;
+}
+ul.item-list.activity-list li {
+	padding-bottom: 0;
+}
+ul.single-line li {
+	border: none;
+}
+ul.item-list li img.avatar {
+	float: left;
+	margin: 0 10px 0 0;
+}
+ul.item-list li div.item-title,
+ul.item-list li h4 {
+	font-weight: normal;
+	font-size: 14px;
+	margin: 0;
+	width: 75%;
+}
+ul.item-list li div.item-title span {
+	color: #999;
+	font-size: 12px;
+}
+ul.item-list li div.item-desc {
+	color: #888;
+	font-size: 11px;
+	margin: 10px 0 0 64px;
+	width: 50%;
+}
+ul.item-list li div.action {
+	position: absolute;
+	top: 15px;
+	right: 0;
+	text-align: right;
+}
+ul.item-list li div.meta {
+	color: #888;
+	font-size: 11px;
+	margin-top: 10px;
+}
+ul.item-list li h5 span.small {
+	float: right;
+	font-size: 11px;
+	font-weight: normal;
+}
+div.item-list-tabs {
+	background: #eaeaea;
+	clear: left;
+	margin: 25px -19px 20px -19px;
+	overflow: hidden;
+}
+div.item-list-tabs ul li a {
+	text-decoration: none;
+	height: 20px;
+}
+div.item-list-tabs ul {
+	width: 100%;
+}
+div.item-list-tabs ul li {
+	float: left;
+	margin: 5px 0 0 5px;
+}
+div.item-list-tabs#subnav ul li {
+	margin-top: 0;
+}
+div.item-list-tabs ul li:first-child {
+	margin-left: 20px;
+}
+div.item-list-tabs ul li.last {
+	float: right;
+	margin: 7px 20px 0 0;
+}
+div.item-list-tabs#subnav ul li.last {
+	margin-top: 4px;
+}
+div.item-list-tabs ul li.last select {
+	max-width: 175px;
+}
+div.item-list-tabs ul li a,
+div.item-list-tabs ul li span {
+	display: block;
+	padding: 5px 10px;
+	text-decoration: none;
+}
+div.item-list-tabs ul li a span {
+	background: #1fb3dd;
+	-moz-border-radius: 3px;
+	-webkit-border-radius: 3px;
+	border-radius: 3px;
+	color: #fff;
+	display: inline;
+	font-size: 90%;
+	margin-left: 2px;
+	padding: 1px 6px;
+}
+div.item-list-tabs ul li.selected a,
+div.item-list-tabs ul li.current a {
+	background-color: #fff;
+	-moz-border-radius-topleft: 3px;
+	-webkit-border-top-left-radius: 3px;
+	-moz-border-radius-topright: 3px;
+	-webkit-border-top-right-radius: 3px;
+	border-top-left-radius: 3px;
+	border-top-right-radius: 3px;
+	color: #555;
+	font-weight: bold;
+}
+div.item-list-tabs ul li.selected a span,
+div.item-list-tabs ul li.current a span,
+div.item-list-tabs ul li a:hover span {
+	background-color: #999;
+}
+div.item-list-tabs ul li.selected a span,
+div.item-list-tabs ul li.current a span {
+	background-color: #555;
+}
+ul li.loading a {
+	background-image: url( ../images/ajax-loader.gif );
+	background-position: 92% 50%;
+	background-repeat: no-repeat;
+	padding-right: 30px !important;
+}
+div#item-nav ul li.loading a {
+	background-position: 88% 50%;
+}
+div.item-list-tabs#object-nav {
+	margin-top: 0;
+}
+div.item-list-tabs#subnav {
+	background: #fff;
+	border-bottom: 1px solid #eaeaea;
+	margin: -15px -19px 15px -19px;
+	min-height: 35px;
+	overflow: hidden;
+}
+div.item-list-tabs ul li.feed a {
+	background: url( ../images/rss.png ) center left no-repeat;
+	padding-left: 20px;
+}
+#admins-list li {
+	overflow: auto;
+}
+
+
+/*--------------------------------------------------------------
+6.9 - Private Messaging Threads
+--------------------------------------------------------------*/
+table#message-threads tr.unread td {
+	background: #fff9db;
+	border-top: 1px solid #ffe8c4;
+	border-bottom: 1px solid #ffe8c4;
+	font-weight: bold;
+}
+li span.unread-count,
+tr.unread span.unread-count {
+	background: #dd0000;
+	-moz-border-radius: 3px;
+	-webkit-border-radius: 3px;
+	border-radius: 3px;
+	color: #fff;
+	font-weight: bold;
+	padding: 2px 8px;
+}
+div.item-list-tabs ul li a span.unread-count {
+	padding: 1px 6px;
+	color: #fff;
+}
+div.messages-options-nav {
+	background: #eee;
+	font-size: 11px;
+	margin: 0 -19px;
+	padding: 5px 15px;
+	text-align: right;
+}
+div#message-thread div.message-box {
+	margin: 0 -19px;
+	padding: 15px;
+}
+div#message-thread div.alt {
+	background: #f4f4f4;
+}
+div#message-thread p#message-recipients {
+	margin: 10px 0 20px 0;
+}
+div#message-thread img.avatar {
+	float: left;
+	margin: 0 10px 0 0;
+	vertical-align: middle;
+}
+div#message-thread strong {
+	font-size: 16px;
+	margin: 0;
+}
+div#message-thread strong a {
+	text-decoration: none;
+}
+div#message-thread strong span.activity {
+	margin: 4px 0 0 10px;
+}
+div#message-thread div.message-metadata {
+	overflow: hidden;
+}
+div#message-thread div.message-content {
+	margin-left: 45px;
 }
-	#footer a {
-		color: #bbb;
-	}
+div#message-thread div.message-options {
+	text-align: right;
+}
\ No newline at end of file
diff --git a/wp-content/plugins/buddypress/bp-themes/bp-default/_inc/css/responsive-rtl.css b/wp-content/plugins/buddypress/bp-themes/bp-default/_inc/css/responsive-rtl.css
new file mode 100644
index 0000000000000000000000000000000000000000..213a3160181c5b17057603a7e5a40fe1bd705474
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-themes/bp-default/_inc/css/responsive-rtl.css
@@ -0,0 +1,54 @@
+/*--------------------------------------------------------------
+Hello, this is the BuddyPress Reponsive theme rtl stylesheet.
+Right to left styles. This will transform the theme to read from
+right to left for languages that support this method.
+
+----------------------------------------------------------------
+>>> TABLE OF CONTENTS:
+----------------------------------------------------------------
+1.0 - iPad
+	1.1 - Landscape
+	1.2 - Portrait
+2.0 - iPhone
+--------------------------------------------------------------*/
+
+/*--------------------------------------------------------------
+1.1 - iPad Landscape
+--------------------------------------------------------------*/
+@media only screen and (max-width: 768px) {
+	div#content .padder {
+		margin-left: 0;
+		margin-right: auto;
+	}
+	ul#nav li {
+		margin-left: 0;
+		margin-right: auto;
+	}
+	ul#nav li:nth-child(even) {
+		margin-left: 0;
+		margin-right: 3%;
+	}
+}
+
+
+/*--------------------------------------------------------------
+1.2 - iPad Portrait
+--------------------------------------------------------------*/
+@media only screen and (max-width: 640px) {
+	ul.item-list li div.action {
+		padding-left: auto;
+		padding-right: 64px;
+	}
+}
+
+
+/*--------------------------------------------------------------
+2.0 - iPhone
+--------------------------------------------------------------*/
+@media only screen and (max-width: 320px) {
+	div.post div.post-content,
+	div.comment-content {
+		margin-left: auto;
+		margin-right: 0px;
+	}
+}
\ 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
new file mode 100644
index 0000000000000000000000000000000000000000..77ddaed38b2811d6dbf4d23f46d8587df8ccc7c6
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-themes/bp-default/_inc/css/responsive.css
@@ -0,0 +1,200 @@
+/*--------------------------------------------------------------
+Hello, this is the BuddyPress Responsive theme stylesheet
+
+----------------------------------------------------------------
+>>> TABLE OF CONTENTS:
+----------------------------------------------------------------
+1.0 - iPad
+	1.1 - Landscape
+	1.2 - Portrait
+2.0 - Smartphone
+3.0 - iPhone
+--------------------------------------------------------------*/
+
+/*--------------------------------------------------------------
+1.1 - iPad Landscape
+--------------------------------------------------------------*/
+@media only screen and (max-width: 768px) {
+	html {
+		background-color: #eaeaea;
+	}
+	body {
+		margin-top: -28px !important;
+		background: #eaeaea;
+	}
+	#wpadminbar {
+		display: none;
+	}
+	div#content .padder {
+		margin-right: 0;
+		width: auto;
+		float: none;
+		border: none;
+	}
+	div#sidebar {
+		width: auto;
+		float: none;
+		margin: 2em 0 0 0;
+		border: none;
+	}
+	ul#nav {
+		padding-bottom: 1em;
+	}
+	ul#nav li {
+		width: 46%;
+		margin-bottom: 1em;
+		margin-right: 0;
+	}
+	ul#nav li:nth-child(even) {
+		margin-left: 3%;
+		margin-right: 0;
+	}
+	ul#nav li a {
+		-moz-border-radius: 0.25em;
+		-webkit-border-radius: 0.25em;
+		border-radius: 0.25em;
+		margin-bottom: 0;
+	}
+}
+
+
+/*--------------------------------------------------------------
+1.2 - iPad Portrait
+--------------------------------------------------------------*/
+@media only screen and (max-width: 640px) {
+	div.dir-search {
+		float: none;
+		margin: 1.25em 0 0;
+	}
+	ul.item-list li div.action {
+		padding-left: 64px;
+		position: relative;
+		right: auto;
+		text-align: left;
+		top: 1em;
+		margin-bottom: 1.25em;
+	}
+}
+
+
+/*--------------------------------------------------------------
+2.0 - Smartphone (any)
+--------------------------------------------------------------*/
+@media screen and (max-device-width: 480px), screen and (-webkit-min-device-pixel-ratio: 2) {
+	-webkit-text-size-adjust: none;
+}
+
+@media only screen and (max-width: 480px) {
+	body {
+		width: 100%;
+		margin: 0;
+	}
+	#container {
+		border: none;
+	}
+	div.item-list-tabs ul li {
+		float: none;
+		margin: 0.3em 0.6em;
+		background:none;
+	}
+	div.item-list-tabs ul li.last {
+		float: none;
+		margin: 0.3em 0.6em;
+	}
+	div#subnav.item-list-tabs ul li.last {
+		margin-top: 1em;
+	}
+	div.item-list-tabs ul li.selected,
+	div.item-list-tabs ul li.current {
+		margin: 0.3em 0.6em;
+	}
+	div.item-list-tabs ul li.selected a,
+	div.item-list-tabs ul li.current a {
+		background: #eee;
+		font-weight: bold;
+	}
+	div.item-list-tabs {
+		background: none;
+	}
+	div.item-list-tabs ul li:first-child {
+		margin: 0.6em 0.6em 0.5em 0.6em;
+	}
+	div.item-list-tabs ul li a,
+	div.item-list-tabs ul li span {
+		padding: 0.3em;
+	}
+	div#subnav ul {
+		padding-top: 0.6em;
+	}
+	div.pagination {
+		padding: 0.6em;
+	}
+	div.item-list-tabs ul {
+		border-top: 1px solid #EAEAEA;
+		padding-top: 0;
+	}
+	div.item-list-tabs ul li {
+		margin-top: 0;
+	}
+	form.standard-form #basic-details-section,
+	form.standard-form #blog-details-section,
+	form.standard-form #profile-details-section {
+		float: none;
+		width: 100%;
+	}
+}
+
+
+/*--------------------------------------------------------------
+3.0 - iPhone
+--------------------------------------------------------------*/
+@media only screen and (max-width: 320px) {
+	ul#nav li {
+		float: none;
+		width: 100%;
+		margin-bottom: 0.6em;
+		margin-right: 0;
+		margin-left: 0;
+	}
+	ul#nav li:nth-child(even) {
+		margin-left: 0;
+		margin-right: 0;
+	}
+	ul#nav li a {
+		-moz-border-radius: 0.25em;
+		-webkit-border-radius: 0.25em;
+		border-radius: 0.25em;
+		margin-bottom: 0;
+	}
+	form#groups-directory-form h3 a {
+		display: block;
+		margin-top: 0.6em;
+	}
+	div.post div.author-box,
+	div.comment-avatar-box {
+		display: none;
+	}
+	div.post div.post-content,
+	div.comment-content {
+		margin-left: 0px;
+	}
+	form#whats-new-form div#whats-new-avatar {
+		display:none;
+	}
+	form#whats-new-form h5 {
+		margin: 0 0 0 0px;
+	}
+	form#whats-new-form #whats-new-content {
+		margin-left: 0px;
+		padding-left: 0px;
+	}
+	ul#activity-stream.item-list li div.activity-avatar {
+		display: none;
+	}
+	body.activity-permalink .activity-list li .activity-content {
+		margin-left: 0;
+	}
+	body.activity-permalink .activity-list li.mini .activity-meta {
+		left: 0;
+	}
+}
\ 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 c52df49568677535d39828e9ffdc43754ddedeff..fe781047cf93d6bdeeae6bcf9ac82c9f6ab28bf9 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
@@ -8,8 +8,10 @@ jq(document).ready( function() {
 	/**** Page Load Actions *******************************************************/
 
 	/* Hide Forums Post Form */
-	if ( jq('div.forums').length )
+	if ( '-1' == window.location.search.indexOf('new') && jq('div.forums').length )
 		jq('div#new-topic-post').hide();
+	else
+		jq('div#new-topic-post').show();
 
 	/* Activity filter and scope set */
 	bp_init_activity();
@@ -19,19 +21,22 @@ jq(document).ready( function() {
 	bp_init_objects( objects );
 
 	/* @mention Compose Scrolling */
-	if ( jq.query.get('r') ) {
-		if ( jq('textarea#whats-new').length ) {
-			jq.scrollTo( jq('textarea#whats-new'), 500, { offset:-125, easing:'easeout' } );
-			jq('textarea#whats-new').focus();
-		}
+	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('textarea#whats-new').focus();
 	}
 
-	/* @mention username help button display */
-	if ( jq( 'span.highlight span' ).length )
-		jq( 'span.highlight span' ).toggle();
-
 	/**** Activity Posting ********************************************************/
 
+	/* Textarea focus */
+	jq('#whats-new').focus( function(){
+		jq("#whats-new-options").animate({height:'40px'});
+		jq("form#whats-new-form textarea").animate({height:'50px'});
+		jq("#aw-whats-new-submit").prop("disabled", false);
+	});
+
 	/* New posts */
 	jq("input#aw-whats-new-submit").click( function() {
 		var button = jq(this);
@@ -39,14 +44,13 @@ jq(document).ready( function() {
 
 		form.children().each( function() {
 			if ( jq.nodeName(this, "textarea") || jq.nodeName(this, "input") )
-				jq(this).attr( 'disabled', 'disabled' );
+				jq(this).prop( 'disabled', true );
 		});
 
-		jq( 'form#' + form.attr('id') + ' span.ajax-loader' ).show();
-
 		/* Remove any errors */
 		jq('div.error').remove();
-		button.attr('disabled','disabled');
+		button.addClass('loading');
+		button.prop('disabled', true);
 
 		/* Default POST values */
 		var object = '';
@@ -66,20 +70,18 @@ jq(document).ready( function() {
 			'object': object,
 			'item_id': item_id
 		},
-		function(response)
-		{
-			jq( 'form#' + form.attr('id') + ' span.ajax-loader' ).hide();
+		function(response) {
 
 			form.children().each( function() {
-				if ( jq.nodeName(this, "textarea") || jq.nodeName(this, "input") )
-					jq(this).attr( 'disabled', '' );
+				if ( jq.nodeName(this, "textarea") || jq.nodeName(this, "input") ) {
+					jq(this).prop( 'disabled', false );
+				}
 			});
 
 			/* Check for errors and append if found. */
 			if ( response[0] + response[1] == '-1' ) {
 				form.prepend( response.substr( 2, response.length ) );
 				jq( 'form#' + form.attr('id') + ' div.error').hide().fadeIn( 200 );
-				button.attr("disabled", '');
 			} else {
 				if ( 0 == jq("ul.activity-list").length ) {
 					jq("div.error").slideUp(100).remove();
@@ -87,15 +89,35 @@ jq(document).ready( function() {
 					jq("div.activity").append( '<ul id="activity-stream" class="activity-list item-list">' );
 				}
 
-				jq("ul.activity-list").prepend(response);
-				jq("ul.activity-list li:first").addClass('new-update');
+				jq("ul#activity-stream").prepend(response);
+				jq("ul#activity-stream li:first").addClass('new-update');
+
+				if ( 0 != jq("div#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');
+
+					var ltext = jq("ul#activity-stream li.new-update .activity-content .activity-inner p").text();
+
+					var u = '';
+					if ( ltext != '' )
+						u = '&quot;' + l + '&quot; ';
+
+					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("li.new-update").hide().slideDown( 300 );
 				jq("li.new-update").removeClass( 'new-update' );
 				jq("textarea#whats-new").val('');
-
-				/* Re-enable the submit button after 8 seconds. */
-				setTimeout( function() { button.attr("disabled", ''); }, 8000 );
 			}
+
+			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');
 		});
 
 		return false;
@@ -120,7 +142,7 @@ jq(document).ready( function() {
 		if ( scope == 'mentions' )
 			jq( 'li#' + target.attr('id') + ' a strong' ).remove();
 
-		bp_activity_request(scope, filter, target);
+		bp_activity_request(scope, filter);
 
 		return false;
 	});
@@ -146,8 +168,8 @@ jq(document).ready( function() {
 		var target = jq(event.target);
 
 		/* Favoriting activity stream items */
-		if ( target.attr('class') == 'fav' || target.attr('class') == 'unfav' ) {
-			var type = target.attr('class')
+		if ( target.hasClass('fav') || target.hasClass('unfav') ) {
+			var type = target.hasClass('fav') ? 'fav' : 'unfav';
 			var parent = target.parent().parent().parent();
 			var parent_id = parent.attr('id').substr( 9, parent.attr('id').length );
 
@@ -163,12 +185,13 @@ jq(document).ready( function() {
 
 				target.fadeOut( 100, function() {
 					jq(this).html(response);
+					jq(this).attr('title', 'fav' == type ? BP_DTheme.remove_fav : BP_DTheme.mark_as_fav);
 					jq(this).fadeIn(100);
 				});
 
 				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>');
+						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>');
 
 					target.removeClass('fav');
 					target.addClass('unfav');
@@ -197,12 +220,12 @@ jq(document).ready( function() {
 
 		/* Delete activity stream items */
 		if ( target.hasClass('delete-activity') ) {
-			var li = target.parents('div.activity ul li');
-			var id = li.attr('id').substr( 9, li.attr('id').length );
+			var li        = target.parents('div.activity ul li');
+			var id        = li.attr('id').substr( 9, li.attr('id').length );
 			var link_href = target.attr('href');
+			var nonce     = link_href.split('_wpnonce=');
 
-			var nonce = link_href.split('_wpnonce=');
-				nonce = nonce[1];
+			nonce = nonce[1];
 
 			target.addClass('loading');
 
@@ -213,13 +236,12 @@ jq(document).ready( function() {
 				'_wpnonce': nonce
 			},
 			function(response) {
-				target.removeClass('loading');
 
 				if ( response[0] + response[1] == '-1' ) {
 					li.prepend( response.substr( 2, response.length ) );
-					li.children('div#message').hide().fadeIn(200);
+					li.children('div#message').hide().fadeIn(300);
 				} else {
-					li.slideUp(200);
+					li.slideUp(300);
 				}
 			});
 
@@ -227,7 +249,7 @@ jq(document).ready( function() {
 		}
 
 		/* Load more updates at the end of the page */
-		if ( target.parent().attr('class') == 'load-more' ) {
+		if ( target.parent().hasClass('load-more') ) {
 			jq("#content li.load-more").addClass('loading');
 
 			if ( null == jq.cookie('bp-activity-oldestpage') )
@@ -253,6 +275,28 @@ jq(document).ready( function() {
 		}
 	});
 
+	// Activity "Read More" links
+	jq('.activity-read-more a').live('click', function(event) {
+		var target = jq(event.target);
+		var link_id = target.parent().attr('id').split('-');
+		var a_id = link_id[3];
+		var type = link_id[0]; /* activity or acomment */
+
+		var inner_class = type == 'acomment' ? 'acomment-content' : 'activity-inner';
+		var a_inner = jq('li#' + type + '-' + a_id + ' .' + inner_class + ':first' );
+		jq(target).addClass('loading');
+
+		jq.post( ajaxurl, {
+			action: 'get_single_activity_content',
+			'activity_id': a_id
+		},
+		function(response) {
+			jq(a_inner).slideUp(300).html(response).slideDown(300);
+		});
+
+		return false;
+	});
+
 	/**** Activity Comments *******************************************************/
 
 	/* Hide all activity comment forms */
@@ -267,8 +311,8 @@ jq(document).ready( function() {
 		var target = jq(event.target);
 
 		/* Comment / comment reply links */
-		if ( target.attr('class') == 'acomment-reply' || target.parent().attr('class') == 'acomment-reply' ) {
-			if ( target.parent().attr('class') == 'acomment-reply' )
+		if ( target.hasClass('acomment-reply') || target.parent().hasClass('acomment-reply') ) {
+			if ( target.parent().hasClass('acomment-reply') )
 				target = target.parent();
 
 			var id = target.attr('id');
@@ -278,8 +322,6 @@ jq(document).ready( function() {
 			var c_id = target.attr('href').substr( 10, target.attr('href').length );
 			var form = jq( '#ac-form-' + a_id );
 
-			var form = jq( '#ac-form-' + ids[2] );
-
 			form.css( 'display', 'none' );
 			form.removeClass('root');
 			jq('.ac-form').hide();
@@ -296,11 +338,11 @@ jq(document).ready( function() {
 				jq('li#activity-' + a_id + ' div.activity-comments').append( form );
 			}
 
-	 		if ( form.parent().attr( 'class' ) == 'activity-comments' )
+	 		if ( form.parent().hasClass( 'activity-comments' ) )
 				form.addClass('root');
 
 			form.slideDown( 200 );
-			jq.scrollTo( form, 500, { offset:-100, easing:'easeout' } );
+			jq.scrollTo( form, 500, { offset:-100, easing:'easeOutQuad' } );
 			jq('#ac-form-' + ids[2] + ' textarea').focus();
 
 			return false;
@@ -312,7 +354,7 @@ jq(document).ready( function() {
 			var form_parent = form.parent();
 			var form_id = form.attr('id').split('-');
 
-			if ( 'activity-comments' !== form_parent.attr('class') ) {
+			if ( !form_parent.hasClass('activity-comments') ) {
 				var tmp_id = form_parent.attr('id').split('-');
 				var comment_id = tmp_id[1];
 			} else {
@@ -321,8 +363,7 @@ jq(document).ready( function() {
 
 			/* Hide any error messages */
 			jq( 'form#' + form + ' div.error').hide();
-			form.addClass('loading');
-			target.css('disabled', 'disabled');
+			target.addClass('loading').prop('disabled', true);
 
 			jq.post( ajaxurl, {
 				action: 'new_activity_comment',
@@ -334,17 +375,16 @@ jq(document).ready( function() {
 			},
 			function(response)
 			{
-				form.removeClass('loading');
+				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 );
-					target.attr("disabled", '');
 				} else {
 					form.fadeOut( 200,
 						function() {
 							if ( 0 == form.parent().children('ul').length ) {
-								if ( form.parent().attr('class') == 'activity-comments' )
+								if ( form.parent().hasClass('activity-comments') )
 									form.parent().prepend('<ul></ul>');
 								else
 									form.parent().append('<ul></ul>');
@@ -359,10 +399,9 @@ jq(document).ready( function() {
 
 					/* 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 );
-
-					/* Re-enable the submit button after 5 seconds. */
-					setTimeout( function() { target.attr("disabled", ''); }, 5000 );
 				}
+
+				jq(target).prop("disabled", false);
 			});
 
 			return false;
@@ -450,23 +489,12 @@ jq(document).ready( function() {
 
 		if ( keyCode == 27 ) {
 			if (element.tagName == 'TEXTAREA') {
-				if ( jq(element).attr('class') == 'ac-input' )
+				if ( jq(element).hasClass('ac-input') )
 					jq(element).parent().parent().parent().slideUp( 200 );
 			}
 		}
 	});
 
-	/**** @mention username help tooltip **************************************/
-
-	jq('span.highlight span').click( function() {
-		if ( !jq('div.help').length ) {
-			jq(this).parent().after( '<div id="message" class="info help"><p>' + BP_DTheme.mention_explain + '</p></div>' );
-			jq('div.help').hide().slideDown(200);
-		} else {
-			jq('div.help').hide().remove();
-		}
-	})
-
 	/**** Directory Search ****************************************************/
 
 	/* The search form on all directory pages */
@@ -577,14 +605,14 @@ jq(document).ready( function() {
 	/**** New Forum Directory Post **************************************/
 
 	/* Hit the "New Topic" button on the forums directory page */
-	jq('a#new-topic-button').click( function() {
+	jq('a.show-hide-new').click( function() {
 		if ( !jq('div#new-topic-post').length )
 			return false;
 
 		if ( jq('div#new-topic-post').is(":visible") )
 			jq('div#new-topic-post').slideUp(200);
 		else
-			jq('div#new-topic-post').slideDown(200);
+			jq('div#new-topic-post').slideDown(200, function() { jq('#topic_title').focus(); } );
 
 		return false;
 	});
@@ -612,7 +640,7 @@ jq(document).ready( function() {
 
 		var friend_id = jq(this).val();
 
-		if ( jq(this).attr('checked') == true )
+		if ( jq(this).prop('checked') == true )
 			var friend_action = 'invite';
 		else
 			var friend_action = 'uninvite';
@@ -664,7 +692,7 @@ jq(document).ready( function() {
 		{
 			jq('.ajax-loader').toggle();
 			jq('#friend-list li#uid-' + friend_id).remove();
-			jq('#invite-list input#f-' + friend_id).attr('checked', false);
+			jq('#invite-list input#f-' + friend_id).prop('checked', false);
 		});
 
 		return false;
@@ -712,9 +740,11 @@ jq(document).ready( function() {
 			} else {
 				button.fadeOut( 100, function() {
 					if ( jq(this).hasClass('accept') ) {
+						action_div.children('a.reject').hide();
 						jq(this).html( BP_DTheme.accepted ).fadeIn(50);
 						jq(this).addClass('accepted');
 					} else {
+						action_div.children('a.accept').hide();
 						jq(this).html( BP_DTheme.rejected ).fadeIn(50);
 						jq(this).addClass('rejected');
 					}
@@ -817,27 +847,16 @@ jq(document).ready( function() {
 		return false;
 	});
 
-	/** Alternate Highlighting ******************************************/
-
-	jq('body#bp-default table.zebra tbody tr').mouseover( function() {
-		jq(this).addClass('over');
-	}).mouseout( function() {
-		jq(this).removeClass('over');
-	});
-		
-	jq('body#bp-default table.zebra tbody tr:odd').addClass('alt');
-
-	jq('div.message-box').each( function(i) {
-		if ( i % 2 == 1 )
-			jq(this).addClass('alt');
-	});
-
 	/** Private Messaging ******************************************/
 
 	/* AJAX send reply functionality */
 	jq("input#send_reply_button").click(
 		function() {
-			jq('form#send-reply span.ajax-loader').toggle();
+			var order = jq('#messages_order').val() || 'ASC',
+				offset = jq('#message-recipients').offset();
+
+			var button = jq("input#send_reply_button");
+			jq(button).addClass('loading');
 
 			jq.post( ajaxurl, {
 				action: 'messages_send_reply',
@@ -856,19 +875,19 @@ jq(document).ready( function() {
 				} else {
 					jq('form#send-reply div#message').remove();
 					jq("#message_content").val('');
-					jq('form#send-reply').before( response );
+
+					if ( 'ASC' == order ) {
+						jq('form#send-reply').before( response );
+					} else {
+						jq('#message-recipients').after( response );
+						jq(window).scrollTop(offset.top);
+					}
 
 					jq("div.new-message").hide().slideDown( 200, function() {
 						jq('div.new-message').removeClass('new-message');
 					});
-
-					jq('div.message-box').each( function(i) {
-						jq(this).removeClass('alt');
-						if ( i % 2 != 1 )
-							jq(this).addClass('alt');
-					});
 				}
-				jq('form#send-reply span.ajax-loader').toggle();
+				jq(button).removeClass('loading');
 			});
 
 			return false;
@@ -906,20 +925,10 @@ jq(document).ready( function() {
 
 					jq('tr#m-' + jq(this).attr('value') + ' td span.unread-count').html(unreadCount);
 					jq('tr#m-' + jq(this).attr('value') + ' td span.unread-count').css('display', unreadCountDisplay);
-					var inboxcount = jq('a#user-messages strong').html().substr( 1, jq('a#user-messages strong').html().length );
-					var inboxcount = inboxcount.substr( 0, inboxcount.length - 1 );
-
-					if ( !inboxcount.length )
-						inboxcount = 0;
-					if ( parseInt(inboxcount) == inboxCount ) {
-						jq('a#user-messages strong').css('display', unreadCountDisplay);
-						jq('a#user-messages strong').html( '(' + unreadCount + ')' );
-					} else {
-						if ( 'read' == currentClass )
-							jq('a#user-messages strong').html('(' + ( parseInt(inboxcount) + 1 ) + ')');
-						else
-							jq('a#user-messages strong').html('(' + ( parseInt(inboxcount) - thread_count ) + ')');
-					}
+
+					var inboxcount = jq('tr.unread').length;
+
+					jq('a#user-messages span').html( inboxcount );
 
 					if ( i != checkboxes.length - 1 ) {
 						checkboxes_tosend += ','
@@ -1024,12 +1033,12 @@ jq(document).ready( function() {
 		return false;
 	});
 
-	/* Admin Bar Javascript */
-	jq("#wp-admin-bar ul.main-nav li").mouseover( function() {
+	/* Admin Bar & wp_list_pages Javascript IE6 hover class */
+	jq("#wp-admin-bar ul.main-nav li, #nav li").mouseover( function() {
 		jq(this).addClass('sfhover');
 	});
 
-	jq("#wp-admin-bar ul.main-nav li").mouseout( function() {
+	jq("#wp-admin-bar ul.main-nav li, #nav li").mouseout( function() {
 		jq(this).removeClass('sfhover');
 	});
 
@@ -1054,7 +1063,7 @@ function bp_init_activity() {
 	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') + ']').attr( 'selected', 'selected' );
+		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 ) {
@@ -1069,7 +1078,7 @@ function bp_init_activity() {
 function bp_init_objects(objects) {
 	jq(objects).each( function(i) {
 		if ( null != jq.cookie('bp-' + objects[i] + '-filter') && jq('li#' + objects[i] + '-order-select select').length )
-			jq('li#' + objects[i] + '-order-select select option[value=' + jq.cookie('bp-' + objects[i] + '-filter') + ']').attr( 'selected', 'selected' );
+			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() {
@@ -1102,7 +1111,7 @@ function bp_filter_request( object, filter, scope, target, search_terms, page, e
 	});
 	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 + ']').attr( 'selected', 'selected' );
+	jq('div.item-list-tabs select option[value="' + filter + '"]').prop( 'selected', true );
 
 	if ( 'friends' == object )
 		object = 'members';
@@ -1135,7 +1144,7 @@ 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 );
+	jq.cookie( 'bp-activity-oldestpage', 1, {path: '/'} );
 
 	/* Remove selected and loading classes from tabs */
 	jq('div.item-list-tabs li').each( function() {
@@ -1144,7 +1153,7 @@ function bp_activity_request(scope, filter) {
 	/* 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('#activity-filter-select select option[value=' + filter + ']').attr( 'selected', 'selected' );
+	jq('#activity-filter-select select option[value="' + filter + '"]').prop( 'selected', true );
 
 	/* Reload the activity stream based on the selection */
 	jq('.widget_bp_activity_widget h2 span.ajax-loader').show();
@@ -1250,10 +1259,12 @@ function clear(container) {
 
 /* ScrollTo plugin - just inline and minified */
 ;(function(d){var k=d.scrollTo=function(a,i,e){d(window).scrollTo(a,i,e)};k.defaults={axis:'xy',duration:parseFloat(d.fn.jquery)>=1.3?0:1};k.window=function(a){return d(window)._scrollable()};d.fn._scrollable=function(){return this.map(function(){var a=this,i=!a.nodeName||d.inArray(a.nodeName.toLowerCase(),['iframe','#document','html','body'])!=-1;if(!i)return a;var e=(a.contentWindow||a).document||a.ownerDocument||a;return d.browser.safari||e.compatMode=='BackCompat'?e.body:e.documentElement})};d.fn.scrollTo=function(n,j,b){if(typeof j=='object'){b=j;j=0}if(typeof b=='function')b={onAfter:b};if(n=='max')n=9e9;b=d.extend({},k.defaults,b);j=j||b.speed||b.duration;b.queue=b.queue&&b.axis.length>1;if(b.queue)j/=2;b.offset=p(b.offset);b.over=p(b.over);return this._scrollable().each(function(){var q=this,r=d(q),f=n,s,g={},u=r.is('html,body');switch(typeof f){case'number':case'string':if(/^([+-]=)?\d+(\.\d+)?(px|%)?$/.test(f)){f=p(f);break}f=d(f,this);case'object':if(f.is||f.style)s=(f=d(f)).offset()}d.each(b.axis.split(''),function(a,i){var e=i=='x'?'Left':'Top',h=e.toLowerCase(),c='scroll'+e,l=q[c],m=k.max(q,i);if(s){g[c]=s[h]+(u?0:l-r.offset()[h]);if(b.margin){g[c]-=parseInt(f.css('margin'+e))||0;g[c]-=parseInt(f.css('border'+e+'Width'))||0}g[c]+=b.offset[h]||0;if(b.over[h])g[c]+=f[i=='x'?'width':'height']()*b.over[h]}else{var o=f[h];g[c]=o.slice&&o.slice(-1)=='%'?parseFloat(o)/100*m:o}if(/^\d+$/.test(g[c]))g[c]=g[c]<=0?0:Math.min(g[c],m);if(!a&&b.queue){if(l!=g[c])t(b.onAfterFirst);delete g[c]}});t(b.onAfter);function t(a){r.animate(g,j,b.easing,a&&function(){a.call(this,n,b)})}}).end()};k.max=function(a,i){var e=i=='x'?'Width':'Height',h='scroll'+e;if(!d(a).is('html,body'))return a[h]-d(a)[e.toLowerCase()]();var c='client'+e,l=a.ownerDocument.documentElement,m=a.ownerDocument.body;return Math.max(l[h],m[h])-Math.min(l[c],m[c])};function p(a){return typeof a=='object'?a:{top:a,left:a}}})(jQuery);
-jQuery.extend({easing:{easein:function(x,t,b,c,d){return c*(t/=d)*t+b},easeinout:function(x,t,b,c,d){if(t<d/2)return 2*c*t*t/(d*d)+b;var ts=t-d/2;return-2*c*ts*ts/(d*d)+2*c*ts/d+c/2+b},easeout:function(x,t,b,c,d){return-c*t*t/(d*d)+2*c*t/d+b},expoin:function(x,t,b,c,d){var flip=1;if(c<0){flip*=-1;c*=-1}return flip*(Math.exp(Math.log(c)/d*t))+b},expoout:function(x,t,b,c,d){var flip=1;if(c<0){flip*=-1;c*=-1}return flip*(-Math.exp(-Math.log(c)/d*(t-d))+c+1)+b},expoinout:function(x,t,b,c,d){var flip=1;if(c<0){flip*=-1;c*=-1}if(t<d/2)return flip*(Math.exp(Math.log(c/2)/(d/2)*t))+b;return flip*(-Math.exp(-2*Math.log(c/2)/d*(t-d))+c+1)+b},bouncein:function(x,t,b,c,d){return c-jQuery.easing['bounceout'](x,d-t,0,c,d)+b},bounceout:function(x,t,b,c,d){if((t/=d)<(1/2.75)){return c*(7.5625*t*t)+b}else if(t<(2/2.75)){return c*(7.5625*(t-=(1.5/2.75))*t+.75)+b}else if(t<(2.5/2.75)){return c*(7.5625*(t-=(2.25/2.75))*t+.9375)+b}else{return c*(7.5625*(t-=(2.625/2.75))*t+.984375)+b}},bounceinout:function(x,t,b,c,d){if(t<d/2)return jQuery.easing['bouncein'](x,t*2,0,c,d)*.5+b;return jQuery.easing['bounceout'](x,t*2-d,0,c,d)*.5+c*.5+b},elasin:function(x,t,b,c,d){var s=1.70158;var p=0;var a=c;if(t==0)return b;if((t/=d)==1)return b+c;if(!p)p=d*.3;if(a<Math.abs(c)){a=c;var s=p/4}else var s=p/(2*Math.PI)*Math.asin(c/a);return-(a*Math.pow(2,10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p))+b},elasout:function(x,t,b,c,d){var s=1.70158;var p=0;var a=c;if(t==0)return b;if((t/=d)==1)return b+c;if(!p)p=d*.3;if(a<Math.abs(c)){a=c;var s=p/4}else var s=p/(2*Math.PI)*Math.asin(c/a);return a*Math.pow(2,-10*t)*Math.sin((t*d-s)*(2*Math.PI)/p)+c+b},elasinout:function(x,t,b,c,d){var s=1.70158;var p=0;var a=c;if(t==0)return b;if((t/=d/2)==2)return b+c;if(!p)p=d*(.3*1.5);if(a<Math.abs(c)){a=c;var s=p/4}else var s=p/(2*Math.PI)*Math.asin(c/a);if(t<1)return-.5*(a*Math.pow(2,10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p))+b;return a*Math.pow(2,-10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p)*.5+c+b},backin:function(x,t,b,c,d){var s=1.70158;return c*(t/=d)*t*((s+1)*t-s)+b},backout:function(x,t,b,c,d){var s=1.70158;return c*((t=t/d-1)*t*((s+1)*t+s)+1)+b},backinout:function(x,t,b,c,d){var s=1.70158;if((t/=d/2)<1)return c/2*(t*t*(((s*=(1.525))+1)*t-s))+b;return c/2*((t-=2)*t*(((s*=(1.525))+1)*t+s)+2)+b},linear:function(x,t,b,c,d){return c*t/d+b}}});
+
+/* jQuery Easing Plugin, v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/ */
+jQuery.easing.jswing=jQuery.easing.swing;jQuery.extend(jQuery.easing,{def:"easeOutQuad",swing:function(e,f,a,h,g){return jQuery.easing[jQuery.easing.def](e,f,a,h,g)},easeInQuad:function(e,f,a,h,g){return h*(f/=g)*f+a},easeOutQuad:function(e,f,a,h,g){return -h*(f/=g)*(f-2)+a},easeInOutQuad:function(e,f,a,h,g){if((f/=g/2)<1){return h/2*f*f+a}return -h/2*((--f)*(f-2)-1)+a},easeInCubic:function(e,f,a,h,g){return h*(f/=g)*f*f+a},easeOutCubic:function(e,f,a,h,g){return h*((f=f/g-1)*f*f+1)+a},easeInOutCubic:function(e,f,a,h,g){if((f/=g/2)<1){return h/2*f*f*f+a}return h/2*((f-=2)*f*f+2)+a},easeInQuart:function(e,f,a,h,g){return h*(f/=g)*f*f*f+a},easeOutQuart:function(e,f,a,h,g){return -h*((f=f/g-1)*f*f*f-1)+a},easeInOutQuart:function(e,f,a,h,g){if((f/=g/2)<1){return h/2*f*f*f*f+a}return -h/2*((f-=2)*f*f*f-2)+a},easeInQuint:function(e,f,a,h,g){return h*(f/=g)*f*f*f*f+a},easeOutQuint:function(e,f,a,h,g){return h*((f=f/g-1)*f*f*f*f+1)+a},easeInOutQuint:function(e,f,a,h,g){if((f/=g/2)<1){return h/2*f*f*f*f*f+a}return h/2*((f-=2)*f*f*f*f+2)+a},easeInSine:function(e,f,a,h,g){return -h*Math.cos(f/g*(Math.PI/2))+h+a},easeOutSine:function(e,f,a,h,g){return h*Math.sin(f/g*(Math.PI/2))+a},easeInOutSine:function(e,f,a,h,g){return -h/2*(Math.cos(Math.PI*f/g)-1)+a},easeInExpo:function(e,f,a,h,g){return(f==0)?a:h*Math.pow(2,10*(f/g-1))+a},easeOutExpo:function(e,f,a,h,g){return(f==g)?a+h:h*(-Math.pow(2,-10*f/g)+1)+a},easeInOutExpo:function(e,f,a,h,g){if(f==0){return a}if(f==g){return a+h}if((f/=g/2)<1){return h/2*Math.pow(2,10*(f-1))+a}return h/2*(-Math.pow(2,-10*--f)+2)+a},easeInCirc:function(e,f,a,h,g){return -h*(Math.sqrt(1-(f/=g)*f)-1)+a},easeOutCirc:function(e,f,a,h,g){return h*Math.sqrt(1-(f=f/g-1)*f)+a},easeInOutCirc:function(e,f,a,h,g){if((f/=g/2)<1){return -h/2*(Math.sqrt(1-f*f)-1)+a}return h/2*(Math.sqrt(1-(f-=2)*f)+1)+a},easeInElastic:function(f,h,e,l,k){var i=1.70158;var j=0;var g=l;if(h==0){return e}if((h/=k)==1){return e+l}if(!j){j=k*0.3}if(g<Math.abs(l)){g=l;var i=j/4}else{var i=j/(2*Math.PI)*Math.asin(l/g)}return -(g*Math.pow(2,10*(h-=1))*Math.sin((h*k-i)*(2*Math.PI)/j))+e},easeOutElastic:function(f,h,e,l,k){var i=1.70158;var j=0;var g=l;if(h==0){return e}if((h/=k)==1){return e+l}if(!j){j=k*0.3}if(g<Math.abs(l)){g=l;var i=j/4}else{var i=j/(2*Math.PI)*Math.asin(l/g)}return g*Math.pow(2,-10*h)*Math.sin((h*k-i)*(2*Math.PI)/j)+l+e},easeInOutElastic:function(f,h,e,l,k){var i=1.70158;var j=0;var g=l;if(h==0){return e}if((h/=k/2)==2){return e+l}if(!j){j=k*(0.3*1.5)}if(g<Math.abs(l)){g=l;var i=j/4}else{var i=j/(2*Math.PI)*Math.asin(l/g)}if(h<1){return -0.5*(g*Math.pow(2,10*(h-=1))*Math.sin((h*k-i)*(2*Math.PI)/j))+e}return g*Math.pow(2,-10*(h-=1))*Math.sin((h*k-i)*(2*Math.PI)/j)*0.5+l+e},easeInBack:function(e,f,a,i,h,g){if(g==undefined){g=1.70158}return i*(f/=h)*f*((g+1)*f-g)+a},easeOutBack:function(e,f,a,i,h,g){if(g==undefined){g=1.70158}return i*((f=f/h-1)*f*((g+1)*f+g)+1)+a},easeInOutBack:function(e,f,a,i,h,g){if(g==undefined){g=1.70158}if((f/=h/2)<1){return i/2*(f*f*(((g*=(1.525))+1)*f-g))+a}return i/2*((f-=2)*f*(((g*=(1.525))+1)*f+g)+2)+a},easeInBounce:function(e,f,a,h,g){return h-jQuery.easing.easeOutBounce(e,g-f,0,h,g)+a},easeOutBounce:function(e,f,a,h,g){if((f/=g)<(1/2.75)){return h*(7.5625*f*f)+a}else{if(f<(2/2.75)){return h*(7.5625*(f-=(1.5/2.75))*f+0.75)+a}else{if(f<(2.5/2.75)){return h*(7.5625*(f-=(2.25/2.75))*f+0.9375)+a}else{return h*(7.5625*(f-=(2.625/2.75))*f+0.984375)+a}}}},easeInOutBounce:function(e,f,a,h,g){if(f<g/2){return jQuery.easing.easeInBounce(e,f*2,0,h,g)*0.5+a}return jQuery.easing.easeOutBounce(e,f*2-g,0,h,g)*0.5+h*0.5+a}});
 
 /* jQuery Cookie plugin */
 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,{}))
+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
diff --git a/wp-content/plugins/buddypress/bp-themes/bp-default/activity/activity-loop.php b/wp-content/plugins/buddypress/bp-themes/bp-default/activity/activity-loop.php
index 0f85e86f02c30fb47554df08324b2476f8f207c7..52a5c0e60d66215f0cfb6db298095fc86d9a6eb8 100644
--- a/wp-content/plugins/buddypress/bp-themes/bp-default/activity/activity-loop.php
+++ b/wp-content/plugins/buddypress/bp-themes/bp-default/activity/activity-loop.php
@@ -1,45 +1,66 @@
-<?php /* Querystring is set via AJAX in _inc/ajax.php - bp_dtheme_activity_loop() */ ?>
+<?php
 
-<?php do_action( 'bp_before_activity_loop' ) ?>
+/**
+ * BuddyPress - Activity Loop
+ *
+ * Querystring is set via AJAX in _inc/ajax.php - bp_dtheme_object_filter()
+ *
+ * @package BuddyPress
+ * @subpackage bp-default
+ */
+
+?>
+
+<?php do_action( 'bp_before_activity_loop' ); ?>
 
 <?php if ( bp_has_activities( bp_ajax_querystring( 'activity' ) ) ) : ?>
 
 	<?php /* Show pagination if JS is not enabled, since the "Load More" link will do nothing */ ?>
 	<noscript>
 		<div class="pagination">
-			<div class="pag-count"><?php bp_activity_pagination_count() ?></div>
-			<div class="pagination-links"><?php bp_activity_pagination_links() ?></div>
+			<div class="pag-count"><?php bp_activity_pagination_count(); ?></div>
+			<div class="pagination-links"><?php bp_activity_pagination_links(); ?></div>
 		</div>
 	</noscript>
 
 	<?php if ( empty( $_POST['page'] ) ) : ?>
+
 		<ul id="activity-stream" class="activity-list item-list">
+
 	<?php endif; ?>
 
 	<?php while ( bp_activities() ) : bp_the_activity(); ?>
 
-		<?php include( locate_template( array( 'activity/entry.php' ), false ) ) ?>
+		<?php locate_template( array( 'activity/entry.php' ), true, false ); ?>
 
 	<?php endwhile; ?>
 
-	<?php if ( bp_get_activity_count() == bp_get_activity_per_page() ) : ?>
+	<?php if ( bp_activity_has_more_items() ) : ?>
+
 		<li class="load-more">
-			<a href="#more"><?php _e( 'Load More', 'buddypress' ) ?></a> &nbsp; <span class="ajax-loader"></span>
+			<a href="#more"><?php _e( 'Load More', 'buddypress' ); ?></a>
 		</li>
+
 	<?php endif; ?>
 
 	<?php if ( empty( $_POST['page'] ) ) : ?>
+
 		</ul>
+
 	<?php endif; ?>
 
 <?php else : ?>
+
 	<div id="message" class="info">
-		<p><?php _e( 'Sorry, there was no activity found. Please try a different filter.', 'buddypress' ) ?></p>
+		<p><?php _e( 'Sorry, there was no activity found. Please try a different filter.', 'buddypress' ); ?></p>
 	</div>
+
 <?php endif; ?>
 
-<?php do_action( 'bp_after_activity_loop' ) ?>
+<?php do_action( 'bp_after_activity_loop' ); ?>
 
 <form action="" name="activity-loop-form" id="activity-loop-form" method="post">
-	<?php wp_nonce_field( 'activity_filter', '_wpnonce_activity_filter' ) ?>
+
+	<?php wp_nonce_field( 'activity_filter', '_wpnonce_activity_filter' ); ?>
+
 </form>
\ No newline at end of file
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
new file mode 100644
index 0000000000000000000000000000000000000000..d807ca193b678cb79a98bc384e35e0d131e4102e
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-themes/bp-default/activity/comment.php
@@ -0,0 +1,52 @@
+<?php
+
+/**
+ * BuddyPress - Activity Stream Comment
+ *
+ * This template is used by bp_activity_comments() functions to show
+ * each activity.
+ *
+ * @package BuddyPress
+ * @subpackage bp-default
+ */
+
+?>
+
+<?php do_action( 'bp_before_activity_comment' ); ?>
+
+<li id="acomment-<?php bp_activity_comment_id(); ?>">
+	<div class="acomment-avatar">
+		<a href="<?php bp_activity_comment_user_link(); ?>">
+			<?php bp_activity_avatar( 'type=thumb&user_id=' . bp_get_activity_comment_user_id() ); ?>
+		</a>
+	</div>
+
+	<div class="acomment-meta">
+		<?php
+		/* translators: 1: user profile link, 2: user name, 3: activity permalink, 3: 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>
+
+	<div class="acomment-content"><?php bp_activity_comment_content(); ?></div>
+
+	<div class="acomment-options">
+
+		<?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>
+
+		<?php endif; ?>
+
+		<?php if ( bp_activity_user_can_delete() ) : ?>
+
+			<a href="<?php bp_activity_comment_delete_link(); ?>" class="delete acomment-delete confirm bp-secondary-action" rel="nofollow"><?php _e( 'Delete', 'buddypress' ); ?></a>
+
+		<?php endif; ?>
+
+	</div>
+
+	<?php bp_activity_recurse_comments( bp_activity_current_comment() ); ?>
+</li>
+
+<?php do_action( 'bp_after_activity_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 80073943c80c26e7040539cd11b9bcabcfcb6dc9..ed9527284d3c360764035ae2df92d1042400fc3c 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
@@ -1,76 +1,124 @@
-<?php /* This template is used by activity-loop.php and AJAX functions to show each activity */ ?>
+<?php
 
-<?php do_action( 'bp_before_activity_entry' ) ?>
+/**
+ * BuddyPress - Activity Stream (Single Item)
+ *
+ * This template is used by activity-loop.php and AJAX functions to show
+ * each activity.
+ *
+ * @package BuddyPress
+ * @subpackage bp-default
+ */
 
-<li class="<?php bp_activity_css_class() ?>" id="activity-<?php bp_activity_id() ?>">
+?>
+
+<?php do_action( 'bp_before_activity_entry' ); ?>
+
+<li class="<?php bp_activity_css_class(); ?>" id="activity-<?php bp_activity_id(); ?>">
 	<div class="activity-avatar">
-		<a href="<?php bp_activity_user_link() ?>">
-			<?php bp_activity_avatar( 'type=full&width=100&height=100' ) ?>
+		<a href="<?php bp_activity_user_link(); ?>">
+
+			<?php bp_activity_avatar(); ?>
+
 		</a>
 	</div>
 
 	<div class="activity-content">
 
 		<div class="activity-header">
-			<?php bp_activity_action() ?>
+
+			<?php bp_activity_action(); ?>
+
 		</div>
 
+		<?php if ( 'activity_comment' == bp_get_activity_type() ) : ?>
+
+			<div class="activity-inreplyto">
+				<strong><?php _e( 'In reply to: ', 'buddypress' ); ?></strong><?php bp_activity_parent_content(); ?> <a href="<?php bp_activity_thread_permalink(); ?>" class="view" title="<?php _e( 'View Thread / Permalink', 'buddypress' ); ?>"><?php _e( 'View', 'buddypress' ); ?></a>
+			</div>
+
+		<?php endif; ?>
+
 		<?php if ( bp_activity_has_content() ) : ?>
+
 			<div class="activity-inner">
-				<?php bp_activity_content_body() ?>
+
+				<?php bp_activity_content_body(); ?>
+
 			</div>
+
 		<?php endif; ?>
 
-		<?php do_action( 'bp_activity_entry_content' ) ?>
+		<?php do_action( 'bp_activity_entry_content' ); ?>
 
-		<div class="activity-meta">
-			<?php if ( is_user_logged_in() && bp_activity_can_comment() ) : ?>
-				<a href="<?php bp_activity_comment_link() ?>" class="acomment-reply" id="acomment-comment-<?php bp_activity_id() ?>"><?php _e( 'Reply', 'buddypress' ) ?> (<span><?php bp_activity_comment_count() ?></span>)</a>
-			<?php endif; ?>
+		<?php if ( is_user_logged_in() ) : ?>
+
+			<div class="activity-meta">
+
+				<?php if ( bp_activity_can_comment() ) : ?>
+
+					<a href="<?php bp_get_activity_comment_link(); ?>" class="button acomment-reply bp-primary-action" id="acomment-comment-<?php bp_activity_id(); ?>"><?php printf( __( 'Comment <span>%s</span>', 'buddypress' ), bp_activity_get_comment_count() ); ?></a>
 
-			<?php if ( is_user_logged_in() ) : ?>
-				<?php if ( !bp_get_activity_is_favorite() ) : ?>
-					<a href="<?php bp_activity_favorite_link() ?>" class="fav" title="<?php _e( 'Mark as Favorite', 'buddypress' ) ?>"><?php _e( 'Favorite', 'buddypress' ) ?></a>
-				<?php else : ?>
-					<a href="<?php bp_activity_unfavorite_link() ?>" class="unfav" title="<?php _e( 'Remove Favorite', 'buddypress' ) ?>"><?php _e( 'Remove Favorite', 'buddypress' ) ?></a>
 				<?php endif; ?>
-			<?php endif;?>
 
-			<?php do_action( 'bp_activity_entry_meta' ) ?>
-		</div>
+				<?php if ( bp_activity_can_favorite() ) : ?>
+
+					<?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>
+
+					<?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>
+
+					<?php endif; ?>
+
+				<?php endif; ?>
+
+				<?php if ( bp_activity_user_can_delete() ) bp_activity_delete_link(); ?>
+
+				<?php do_action( 'bp_activity_entry_meta' ); ?>
+
+			</div>
+
+		<?php endif; ?>
+
 	</div>
 
-	<?php if ( 'activity_comment' == bp_get_activity_type() ) : ?>
-		<div class="activity-inreplyto">
-			<strong><?php _e( 'In reply to', 'buddypress' ) ?></strong> - <?php bp_activity_parent_content() ?> &middot;
-			<a href="<?php bp_activity_thread_permalink() ?>" class="view" title="<?php _e( 'View Thread / Permalink', 'buddypress' ) ?>"><?php _e( 'View', 'buddypress' ) ?></a>
-		</div>
-	<?php endif; ?>
+	<?php do_action( 'bp_before_activity_entry_comments' ); ?>
 
-	<?php do_action( 'bp_before_activity_entry_comments' ) ?>
+	<?php if ( ( is_user_logged_in() && bp_activity_can_comment() ) || bp_activity_get_comment_count() ) : ?>
 
-	<?php if ( bp_activity_can_comment() ) : ?>
 		<div class="activity-comments">
-			<?php bp_activity_comments() ?>
+
+			<?php bp_activity_comments(); ?>
 
 			<?php if ( is_user_logged_in() ) : ?>
-			<form action="<?php bp_activity_comment_form_action() ?>" method="post" id="ac-form-<?php bp_activity_id() ?>" class="ac-form"<?php bp_activity_comment_form_nojs_display() ?>>
-				<div class="ac-reply-avatar"><?php bp_loggedin_user_avatar( 'width=' . BP_AVATAR_THUMB_WIDTH . '&height=' . BP_AVATAR_THUMB_HEIGHT ) ?></div>
-				<div class="ac-reply-content">
-					<div class="ac-textarea">
-						<textarea id="ac-input-<?php bp_activity_id() ?>" class="ac-input" name="ac_input_<?php bp_activity_id() ?>"></textarea>
+
+				<form action="<?php bp_activity_comment_form_action(); ?>" method="post" id="ac-form-<?php bp_activity_id(); ?>" class="ac-form"<?php bp_activity_comment_form_nojs_display(); ?>>
+					<div class="ac-reply-avatar"><?php bp_loggedin_user_avatar( 'width=' . BP_AVATAR_THUMB_WIDTH . '&height=' . BP_AVATAR_THUMB_HEIGHT ); ?></div>
+					<div class="ac-reply-content">
+						<div class="ac-textarea">
+							<textarea id="ac-input-<?php bp_activity_id(); ?>" class="ac-input" name="ac_input_<?php bp_activity_id(); ?>"></textarea>
+						</div>
+						<input type="submit" name="ac_form_submit" value="<?php _e( 'Post', 'buddypress' ); ?>" /> &nbsp; <?php _e( 'or press esc to cancel.', 'buddypress' ); ?>
+						<input type="hidden" name="comment_form_id" value="<?php bp_activity_id(); ?>" />
 					</div>
-					<input type="submit" name="ac_form_submit" value="<?php _e( 'Post', 'buddypress' ) ?> &rarr;" /> &nbsp; <?php _e( 'or press esc to cancel.', 'buddypress' ) ?>
-					<input type="hidden" name="comment_form_id" value="<?php bp_activity_id() ?>" />
-				</div>
-				<?php wp_nonce_field( 'new_activity_comment', '_wpnonce_new_activity_comment' ) ?>
-			</form>
+
+					<?php do_action( 'bp_activity_entry_comments' ); ?>
+
+					<?php wp_nonce_field( 'new_activity_comment', '_wpnonce_new_activity_comment' ); ?>
+
+				</form>
+
 			<?php endif; ?>
+
 		</div>
+
 	<?php endif; ?>
 
-	<?php do_action( 'bp_after_activity_entry_comments' ) ?>
-</li>
+	<?php do_action( 'bp_after_activity_entry_comments' ); ?>
 
-<?php do_action( 'bp_after_activity_entry' ) ?>
+</li>
 
+<?php do_action( 'bp_after_activity_entry' ); ?>
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 2757ae62822897bf1a1f37e76e0440f62c9cb565..9332f7abf9114f504f32177c38648b8240f0d344 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
@@ -1,107 +1,157 @@
-<?php get_header() ?>
+<?php
+
+/**
+ * Template Name: BuddyPress - Activity Directory
+ *
+ * @package BuddyPress
+ * @subpackage Theme
+ */
+
+?>
+
+<?php get_header( 'buddypress' ); ?>
+
+	<?php do_action( 'bp_before_directory_activity_page' ); ?>
 
 	<div id="content">
 		<div class="padder">
 
+			<?php do_action( 'bp_before_directory_activity' ); ?>
+
 			<?php if ( !is_user_logged_in() ) : ?>
-				<h3><?php _e( 'Site Activity', 'buddypress' ) ?></h3>
+
+				<h3><?php _e( 'Site Activity', 'buddypress' ); ?></h3>
+
 			<?php endif; ?>
 
-			<?php do_action( 'bp_before_directory_activity_content' ) ?>
+			<?php do_action( 'bp_before_directory_activity_content' ); ?>
 
 			<?php if ( is_user_logged_in() ) : ?>
-				<?php locate_template( array( 'activity/post-form.php'), true ) ?>
+
+				<?php locate_template( array( 'activity/post-form.php'), true ); ?>
+
 			<?php endif; ?>
 
-			<?php do_action( 'template_notices' ) ?>
+			<?php do_action( 'template_notices' ); ?>
 
-			<div class="item-list-tabs activity-type-tabs">
+			<div class="item-list-tabs activity-type-tabs" role="navigation">
 				<ul>
-					<?php do_action( 'bp_before_activity_type_tab_all' ) ?>
+					<?php do_action( 'bp_before_activity_type_tab_all' ); ?>
 
-					<li class="selected" id="activity-all"><a href="<?php echo bp_loggedin_user_domain() . BP_ACTIVITY_SLUG . '/' ?>" title="<?php _e( 'The public activity for everyone on this site.', 'buddypress' ) ?>"><?php printf( __( 'All Members (%s)', 'buddypress' ), bp_get_total_site_member_count() ) ?></a></li>
+					<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>
 
 					<?php if ( is_user_logged_in() ) : ?>
 
 						<?php do_action( 'bp_before_activity_type_tab_friends' ) ?>
 
-						<?php if ( function_exists( 'bp_get_total_friend_count' ) ) : ?>
+						<?php if ( bp_is_active( 'friends' ) ) : ?>
+
 							<?php if ( bp_get_total_friend_count( bp_loggedin_user_id() ) ) : ?>
-								<li id="activity-friends"><a href="<?php echo bp_loggedin_user_domain() . BP_ACTIVITY_SLUG . '/' . BP_FRIENDS_SLUG . '/' ?>" title="<?php _e( 'The activity of my friends only.', 'buddypress' ) ?>"><?php printf( __( 'My Friends (%s)', 'buddypress' ), bp_get_total_friend_count( bp_loggedin_user_id() ) ) ?></a></li>
+
+								<li id="activity-friends"><a href="<?php echo bp_loggedin_user_domain() . bp_get_activity_slug() . '/' . bp_get_friends_slug() . '/'; ?>" title="<?php _e( 'The activity of my friends only.', 'buddypress' ); ?>"><?php printf( __( 'My Friends <span>%s</span>', 'buddypress' ), bp_get_total_friend_count( bp_loggedin_user_id() ) ); ?></a></li>
+
 							<?php endif; ?>
+
 						<?php endif; ?>
 
 						<?php do_action( 'bp_before_activity_type_tab_groups' ) ?>
 
-						<?php if ( function_exists( 'bp_get_total_group_count_for_user' ) ) : ?>
+						<?php if ( bp_is_active( 'groups' ) ) : ?>
+
 							<?php if ( bp_get_total_group_count_for_user( bp_loggedin_user_id() ) ) : ?>
-								<li id="activity-groups"><a href="<?php echo bp_loggedin_user_domain() . BP_ACTIVITY_SLUG . '/' . BP_GROUPS_SLUG . '/' ?>" title="<?php _e( 'The activity of groups I am a member of.', 'buddypress' ) ?>"><?php printf( __( 'My Groups (%s)', 'buddypress' ), bp_get_total_group_count_for_user( bp_loggedin_user_id() ) ) ?></a></li>
+
+								<li id="activity-groups"><a href="<?php echo bp_loggedin_user_domain() . bp_get_activity_slug() . '/' . bp_get_groups_slug() . '/'; ?>" title="<?php _e( 'The activity of groups I am a member of.', 'buddypress' ); ?>"><?php printf( __( 'My Groups <span>%s</span>', 'buddypress' ), bp_get_total_group_count_for_user( bp_loggedin_user_id() ) ); ?></a></li>
+
 							<?php endif; ?>
+
 						<?php endif; ?>
 
-						<?php do_action( 'bp_before_activity_type_tab_favorites' ) ?>
+						<?php do_action( 'bp_before_activity_type_tab_favorites' ); ?>
 
 						<?php if ( bp_get_total_favorite_count_for_user( bp_loggedin_user_id() ) ) : ?>
-							<li id="activity-favorites"><a href="<?php echo bp_loggedin_user_domain() . BP_ACTIVITY_SLUG . '/favorites/' ?>" title="<?php _e( "The activity I've marked as a favorite.", 'buddypress' ) ?>"><?php printf( __( 'My Favorites (<span>%s</span>)', 'buddypress' ), bp_get_total_favorite_count_for_user( bp_loggedin_user_id() ) ) ?></a></li>
+
+							<li id="activity-favorites"><a href="<?php echo bp_loggedin_user_domain() . bp_get_activity_slug() . '/favorites/'; ?>" title="<?php _e( "The activity I've marked as a favorite.", 'buddypress' ); ?>"><?php printf( __( 'My Favorites <span>%s</span>', 'buddypress' ), bp_get_total_favorite_count_for_user( bp_loggedin_user_id() ) ); ?></a></li>
+
 						<?php endif; ?>
 
-						<?php do_action( 'bp_before_activity_type_tab_mentions' ) ?>
+						<?php do_action( 'bp_before_activity_type_tab_mentions' ); ?>
 
-						<li id="activity-mentions"><a href="<?php echo bp_loggedin_user_domain() . BP_ACTIVITY_SLUG . '/mentions/' ?>" title="<?php _e( 'Activity that I have been mentioned in.', 'buddypress' ) ?>"><?php printf( __( '@%s Mentions', 'buddypress' ), bp_get_loggedin_user_username() ) ?><?php if ( bp_get_total_mention_count_for_user( bp_loggedin_user_id() ) ) : ?> <strong><?php printf( __( '(%s new)', 'buddypress' ), bp_get_total_mention_count_for_user( bp_loggedin_user_id() ) ) ?></strong><?php endif; ?></a></li>
+						<li id="activity-mentions"><a href="<?php echo bp_loggedin_user_domain() . bp_get_activity_slug() . '/mentions/'; ?>" title="<?php _e( 'Activity that I have been mentioned in.', 'buddypress' ); ?>"><?php _e( 'Mentions', 'buddypress' ); ?><?php if ( bp_get_total_mention_count_for_user( bp_loggedin_user_id() ) ) : ?> <strong><?php printf( __( '<span>%s new</span>', 'buddypress' ), bp_get_total_mention_count_for_user( bp_loggedin_user_id() ) ); ?></strong><?php endif; ?></a></li>
 
 					<?php endif; ?>
 
-					<?php do_action( 'bp_activity_type_tabs' ) ?>
+					<?php do_action( 'bp_activity_type_tabs' ); ?>
 				</ul>
 			</div><!-- .item-list-tabs -->
 
-			<div class="item-list-tabs no-ajax" id="subnav">
+			<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' ) ?>
+					<?php do_action( 'bp_activity_syndication_options' ); ?>
 
 					<li id="activity-filter-select" class="last">
-						<select>
-							<option value="-1"><?php _e( 'No Filter', 'buddypress' ) ?></option>
-							<option value="activity_update"><?php _e( 'Show Updates', 'buddypress' ) ?></option>
+						<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>
 
 							<?php if ( bp_is_active( 'blogs' ) ) : ?>
-								<option value="new_blog_post"><?php _e( 'Show Blog Posts', 'buddypress' ) ?></option>
-								<option value="new_blog_comment"><?php _e( 'Show Blog 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; ?>
 
 							<?php if ( bp_is_active( 'forums' ) ) : ?>
-								<option value="new_forum_topic"><?php _e( 'Show New Forum Topics', 'buddypress' ) ?></option>
-								<option value="new_forum_post"><?php _e( 'Show 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; ?>
 
 							<?php if ( bp_is_active( 'groups' ) ) : ?>
-								<option value="created_group"><?php _e( 'Show New Groups', 'buddypress' ) ?></option>
-								<option value="joined_group"><?php _e( 'Show New 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; ?>
 
 							<?php if ( bp_is_active( 'friends' ) ) : ?>
-								<option value="friendship_accepted,friendship_created"><?php _e( 'Show Friendship Connections', 'buddypress' ) ?></option>
+
+								<option value="friendship_accepted,friendship_created"><?php _e( 'Friendships', 'buddypress' ); ?></option>
+
 							<?php endif; ?>
 
-							<option value="new_member"><?php _e( 'Show New Members', 'buddypress' ) ?></option>
+							<option value="new_member"><?php _e( 'New Members', 'buddypress' ); ?></option>
+
+							<?php do_action( 'bp_activity_filter_options' ); ?>
 
-							<?php do_action( 'bp_activity_filter_options' ) ?>
 						</select>
 					</li>
 				</ul>
 			</div><!-- .item-list-tabs -->
 
-			<div class="activity">
-				<?php locate_template( array( 'activity/activity-loop.php' ), true ) ?>
+			<?php do_action( 'bp_before_directory_activity_list' ); ?>
+
+			<div class="activity" role="main">
+
+				<?php locate_template( array( 'activity/activity-loop.php' ), true ); ?>
+
 			</div><!-- .activity -->
 
-			<?php do_action( 'bp_after_directory_activity_content' ) ?>
+			<?php do_action( 'bp_after_directory_activity_list' ); ?>
+
+			<?php do_action( 'bp_directory_activity_content' ); ?>
+
+			<?php do_action( 'bp_after_directory_activity_content' ); ?>
+
+			<?php do_action( 'bp_after_directory_activity' ); ?>
 
 		</div><!-- .padder -->
 	</div><!-- #content -->
 
-	<?php locate_template( array( 'sidebar.php' ), true ) ?>
+	<?php do_action( 'bp_after_directory_activity_page' ); ?>
 
-<?php get_footer() ?>
\ No newline at end of file
+<?php get_sidebar( 'buddypress' ); ?>
+<?php get_footer( 'buddypress' ); ?>
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 823f775546ec1452b57f31b2a9fed25db5a96113..7bf1880ba94112a4f023b4876f0a1bdb90a68a99 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
@@ -1,62 +1,74 @@
-<form action="<?php bp_activity_post_form_action() ?>" method="post" id="whats-new-form" name="whats-new-form">
+<?php
 
-	<?php do_action( 'bp_before_activity_post_form' ) ?>
+/**
+ * BuddyPress - Activity Post Form
+ *
+ * @package BuddyPress
+ * @subpackage bp-default
+ */
 
-	<?php if ( isset( $_GET['r'] ) ) : ?>
-		<div id="message" class="info">
-			<p><?php printf( __( 'You are mentioning %s in a new update, this user will be sent a notification of your message.', 'buddypress' ), bp_get_mentioned_user_display_name( $_GET['r'] ) ) ?></p>
-		</div>
-	<?php endif; ?>
+?>
+
+<form action="<?php bp_activity_post_form_action(); ?>" method="post" id="whats-new-form" name="whats-new-form" role="complementary">
+
+	<?php do_action( 'bp_before_activity_post_form' ); ?>
 
 	<div id="whats-new-avatar">
-		<a href="<?php echo bp_loggedin_user_domain() ?>">
-			<?php bp_loggedin_user_avatar( 'width=' . BP_AVATAR_THUMB_WIDTH . '&height=' . BP_AVATAR_THUMB_HEIGHT ) ?>
+		<a href="<?php echo bp_loggedin_user_domain(); ?>">
+			<?php bp_loggedin_user_avatar( 'width=' . bp_core_avatar_thumb_width() . '&height=' . bp_core_avatar_thumb_height() ); ?>
 		</a>
 	</div>
 
-	<h5>
-		<?php if ( bp_is_group() ) : ?>
-			<?php printf( __( "What's new in %s, %s?", 'buddypress' ), bp_get_group_name(), bp_get_user_firstname() ) ?>
-		<?php else : ?>
-			<?php printf( __( "What's new %s?", 'buddypress' ), bp_get_user_firstname() ) ?>
-		<?php endif; ?>
-	</h5>
+	<h5><?php if ( bp_is_group() )
+			printf( __( "What's new in %s, %s?", 'buddypress' ), bp_get_group_name(), bp_get_user_firstname() );
+		else
+			printf( __( "What's new, %s?", 'buddypress' ), bp_get_user_firstname() );
+	?></h5>
 
 	<div id="whats-new-content">
 		<div id="whats-new-textarea">
-			<textarea name="whats-new" id="whats-new" cols="50" rows="10"><?php if ( isset( $_GET['r'] ) ) : ?>@<?php echo esc_attr( $_GET['r'] ) ?> <?php endif; ?></textarea>
+			<textarea name="whats-new" id="whats-new" cols="50" rows="10"><?php if ( isset( $_GET['r'] ) ) : ?>@<?php echo esc_attr( $_GET['r'] ); ?> <?php endif; ?></textarea>
 		</div>
 
 		<div id="whats-new-options">
 			<div id="whats-new-submit">
-				<span class="ajax-loader"></span> &nbsp;
-				<input type="submit" name="aw-whats-new-submit" id="aw-whats-new-submit" value="<?php _e( 'Post Update', 'buddypress' ) ?>" />
+				<input type="submit" name="aw-whats-new-submit" id="aw-whats-new-submit" value="<?php _e( 'Post Update', 'buddypress' ); ?>" />
 			</div>
 
-			<?php if ( function_exists('bp_has_groups') && !bp_is_my_profile() && !bp_is_group() ) : ?>
+			<?php if ( bp_is_active( 'groups' ) && !bp_is_my_profile() && !bp_is_group() ) : ?>
+
 				<div id="whats-new-post-in-box">
+
 					<?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>
+						<option selected="selected" value="0"><?php _e( 'My Profile', 'buddypress' ); ?></option>
+
+						<?php if ( bp_has_groups( 'user_id=' . bp_loggedin_user_id() . '&type=alphabetical&max=100&per_page=100&populate_extras=0' ) ) :
+							while ( bp_groups() ) : bp_the_group(); ?>
+
+								<option value="<?php bp_group_id(); ?>"><?php bp_group_name(); ?></option>
+
+							<?php endwhile;
+						endif; ?>
 
-						<?php if ( bp_has_groups( 'user_id=' . bp_loggedin_user_id() . '&type=alphabetical&max=100&per_page=100&populate_extras=0' ) ) : while ( bp_groups() ) : bp_the_group(); ?>
-							<option value="<?php bp_group_id() ?>"><?php bp_group_name() ?></option>
-						<?php endwhile; endif; ?>
 					</select>
 				</div>
 				<input type="hidden" id="whats-new-post-object" name="whats-new-post-object" value="groups" />
+
 			<?php elseif ( bp_is_group_home() ) : ?>
+
 				<input type="hidden" id="whats-new-post-object" name="whats-new-post-object" value="groups" />
-				<input type="hidden" id="whats-new-post-in" name="whats-new-post-in" value="<?php bp_group_id() ?>" />
+				<input type="hidden" id="whats-new-post-in" name="whats-new-post-in" value="<?php bp_group_id(); ?>" />
+
 			<?php endif; ?>
 
-			<?php do_action( 'bp_activity_post_form_options' ) ?>
+			<?php do_action( 'bp_activity_post_form_options' ); ?>
 
 		</div><!-- #whats-new-options -->
 	</div><!-- #whats-new-content -->
 
 	<?php wp_nonce_field( 'post_update', '_wpnonce_post_update' ); ?>
-	<?php do_action( 'bp_after_activity_post_form' ) ?>
+	<?php do_action( 'bp_after_activity_post_form' ); ?>
 
 </form><!-- #whats-new-form -->
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 016e7043dc5a0ac3cae89395a892094ea903b15b..921eaea4b445c34d31741b3f7bfd31ad478262ca 100644
--- a/wp-content/plugins/buddypress/bp-themes/bp-default/archive.php
+++ b/wp-content/plugins/buddypress/bp-themes/bp-default/archive.php
@@ -5,40 +5,36 @@
 
 		<?php do_action( 'bp_before_archive' ) ?>
 
-		<div class="page" id="blog-archives">
+		<div class="page" id="blog-archives" role="main">
 
 			<h3 class="pagetitle"><?php printf( __( 'You are browsing the archive for %1$s.', 'buddypress' ), wp_title( false, false ) ); ?></h3>
 
 			<?php if ( have_posts() ) : ?>
 
-				<div 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 bp_dtheme_content_nav( 'nav-above' ); ?>
 
 				<?php while (have_posts()) : the_post(); ?>
 
 					<?php do_action( 'bp_before_blog_post' ) ?>
 
-					<div class="post" id="post-<?php the_ID(); ?>">
+					<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( __( 'by %s', '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>
 
-							<p class="date"><?php the_time() ?> <em><?php _e( 'in', 'buddypress' ) ?> <?php the_category(', ') ?> <?php printf( __( 'by %s', 'buddypress' ), bp_core_get_userlink( $post->post_author ) ) ?></em></p>
+							<p class="date"><?php printf( __( '%1$s <span>in %2$s</span>', 'buddypress' ), get_the_date(), get_the_category_list( ', ' ) ); ?></p>
 
 							<div class="entry">
 								<?php the_content( __( 'Read the rest of this entry &rarr;', 'buddypress' ) ); ?>
+								<?php wp_link_pages( array( 'before' => '<div class="page-link"><p>' . __( 'Pages: ', 'buddypress' ), 'after' => '</p></div>', 'next_or_number' => 'number' ) ); ?>
 							</div>
 
-							<p class="postmetadata"><span class="tags"><?php the_tags( __( 'Tags: ', 'buddypress' ), ', ', '<br />'); ?></span> <span class="comments"><?php comments_popup_link( __( 'No Comments &#187;', 'buddypress' ), __( '1 Comment &#187;', 'buddypress' ), __( '% Comments &#187;', 'buddypress' ) ); ?></span></p>
+							<p class="postmetadata"><?php the_tags( '<span class="tags">' . __( 'Tags: ', 'buddypress' ), ', ', '</span>' ); ?> <span class="comments"><?php comments_popup_link( __( 'No Comments &#187;', 'buddypress' ), __( '1 Comment &#187;', 'buddypress' ), __( '% Comments &#187;', 'buddypress' ) ); ?></span></p>
 						</div>
 
 					</div>
@@ -47,17 +43,12 @@
 
 				<?php endwhile; ?>
 
-				<div 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 bp_dtheme_content_nav( 'nav-below' ); ?>
 
 			<?php else : ?>
 
 				<h2 class="center"><?php _e( 'Not Found', 'buddypress' ) ?></h2>
-				<?php locate_template( array( 'searchform.php' ), true ) ?>
+				<?php get_search_form() ?>
 
 			<?php endif; ?>
 
@@ -68,6 +59,6 @@
 		</div><!-- .padder -->
 	</div><!-- #content -->
 
-	<?php locate_template( array( 'sidebar.php' ), true ) ?>
+	<?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 f302ece754e04971cdee60ca797b5f565081b75c..f50841b5cb1383d3b78ba696ef6d5bb4f894a4fd 100644
--- a/wp-content/plugins/buddypress/bp-themes/bp-default/attachment.php
+++ b/wp-content/plugins/buddypress/bp-themes/bp-default/attachment.php
@@ -1,47 +1,75 @@
 <?php get_header(); ?>
 
 	<div id="content">
+		<div class="padder">
 
-		<?php do_action( 'bp_before_attachment' ) ?>
+			<?php do_action( 'bp_before_attachment' ); ?>
 
-		<div class="page" id="attachments-page">
-
-			<h2 class="pagetitle"><?php _e( 'Blog', 'buddypress' ) ?></h2>
+			<div class="page" id="attachments-page" role="main">
 
 				<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
 
 					<?php do_action( 'bp_before_blog_post' ) ?>
 
-					<?php $attachment_link = get_the_attachment_link($post->ID, true, array(450, 800)); // This also populates the iconsize for the next line ?>
-					<?php $_post = &get_post($post->ID); $classname = ($_post->iconsize[0] <= 128 ? 'small' : '') . 'attachment'; // This lets us style narrow icons specially ?>
-
-					<div class="post" id="post-<?php the_ID(); ?>">
-
-						<h2 class="posttitle"><a href="<?php echo get_permalink($post->post_parent); ?>" rev="attachment"><?php echo get_the_title($post->post_parent); ?></a> &rarr; <a href="<?php echo get_permalink() ?>" rel="bookmark" title="Permanent Link: <?php the_title(); ?>"><?php the_title(); ?></a></h2>
-
-						<div class="entry">
-							<p class="<?php echo $classname; ?>"><?php echo $attachment_link; ?><br /><?php echo basename($post->guid); ?></p>
+					<div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
 
-							<?php the_content( __('<p class="serif">Read the rest of this entry &rarr;</p>', 'buddypress' ) ); ?>
+						<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' ), str_replace( '<a href=', '<a rel="author" href=', bp_core_get_userlink( $post->post_author ) ) ); ?></p>
+						</div>
 
-							<?php wp_link_pages( array( 'before' => __( '<p><strong>Pages:</strong> ', 'buddypress' ), 'after' => '</p>', 'next_or_number' => 'number')); ?>
+						<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>
+
+							<p class="date">
+								<?php the_date(); ?>
+								<span class="post-utility alignright"><?php edit_post_link( __( 'Edit this entry', 'buddypress' ) ); ?></span>
+							</p>
+
+							<div class="entry">
+								<?php echo wp_get_attachment_image( $post->ID, 'large', false, array( 'class' => 'size-large aligncenter' ) ); ?>
+
+								<div class="entry-caption"><?php if ( !empty( $post->post_excerpt ) ) the_excerpt(); ?></div>
+								<?php the_content(); ?>
+							</div>
+
+							<p class="postmetadata">
+								<?php
+									if ( wp_attachment_is_image() ) :
+										$metadata = wp_get_attachment_metadata();
+										printf( __( 'Full size is %s pixels', 'buddypress' ),
+											sprintf( '<a href="%1$s" title="%2$s">%3$s &times; %4$s</a>',
+												wp_get_attachment_url(),
+												esc_attr( __( 'Link to full size image', 'buddypress' ) ),
+												$metadata['width'],
+												$metadata['height']
+											)
+										);
+									endif;
+								?>
+								&nbsp;
+							</p>
 						</div>
 
 					</div>
 
 					<?php do_action( 'bp_after_blog_post' ) ?>
 
-				<?php comments_template(); ?>
+					<?php comments_template(); ?>
 
 				<?php endwhile; else: ?>
 
 					<p><?php _e( 'Sorry, no attachments matched your criteria.', 'buddypress' ) ?></p>
 
 				<?php endif; ?>
-		</div>
+
+			</div>
 
 		<?php do_action( 'bp_after_attachment' ) ?>
 
-	</div>
+		</div><!-- .padder -->
+	</div><!-- #content -->
+
+	<?php get_sidebar(); ?>
 
-<?php get_footer(); ?>
+<?php get_footer(); ?>
\ No newline at end of file
diff --git a/wp-content/plugins/buddypress/bp-themes/bp-default/blogs/blogs-loop.php b/wp-content/plugins/buddypress/bp-themes/bp-default/blogs/blogs-loop.php
index 60112df9545a0ce95a02effb65374e51ee9eaa82..d48e3abbf33aca477060f5fb24df6707b2f31f02 100644
--- a/wp-content/plugins/buddypress/bp-themes/bp-default/blogs/blogs-loop.php
+++ b/wp-content/plugins/buddypress/bp-themes/bp-default/blogs/blogs-loop.php
@@ -1,44 +1,58 @@
-<?php /* Querystring is set via AJAX in _inc/ajax.php - bp_dtheme_object_filter() */ ?>
+<?php
 
-<?php do_action( 'bp_before_blogs_loop' ) ?>
+/**
+ * BuddyPress - Blogs Loop
+ *
+ * Querystring is set via AJAX in _inc/ajax.php - bp_dtheme_object_filter()
+ *
+ * @package BuddyPress
+ * @subpackage bp-default
+ */
+
+?>
+
+<?php do_action( 'bp_before_blogs_loop' ); ?>
 
 <?php if ( bp_has_blogs( bp_ajax_querystring( 'blogs' ) ) ) : ?>
 
 	<div id="pag-top" class="pagination">
 
 		<div class="pag-count" id="blog-dir-count-top">
-			<?php bp_blogs_pagination_count() ?>
+			<?php bp_blogs_pagination_count(); ?>
 		</div>
 
 		<div class="pagination-links" id="blog-dir-pag-top">
-			<?php bp_blogs_pagination_links() ?>
+			<?php bp_blogs_pagination_links(); ?>
 		</div>
 
 	</div>
 
-	<?php do_action( 'bp_before_directory_blogs_list' ) ?>
+	<?php do_action( 'bp_before_directory_blogs_list' ); ?>
+
+	<ul id="blogs-list" class="item-list" role="main">
 
-	<ul id="blogs-list" class="item-list">
 	<?php while ( bp_blogs() ) : bp_the_blog(); ?>
 
 		<li>
 			<div class="item-avatar">
-				<a href="<?php bp_blog_permalink() ?>"><?php bp_blog_avatar('type=thumb') ?></a>
+				<a href="<?php bp_blog_permalink(); ?>"><?php bp_blog_avatar( 'type=thumb' ); ?></a>
 			</div>
 
 			<div class="item">
-				<div class="item-title"><a href="<?php bp_blog_permalink() ?>"><?php bp_blog_name() ?></a></div>
-				<div class="item-meta"><span class="activity"><?php bp_blog_last_active() ?></span></div>
+				<div class="item-title"><a href="<?php bp_blog_permalink(); ?>"><?php bp_blog_name(); ?></a></div>
+				<div class="item-meta"><span class="activity"><?php bp_blog_last_active(); ?></span></div>
 
-				<?php do_action( 'bp_directory_blogs_item' ) ?>
+				<?php do_action( 'bp_directory_blogs_item' ); ?>
 			</div>
 
 			<div class="action">
 
-				<?php do_action( 'bp_directory_blogs_actions' ) ?>
+				<?php do_action( 'bp_directory_blogs_actions' ); ?>
 
 				<div class="meta">
-					<?php bp_blog_latest_post() ?>
+
+					<?php bp_blog_latest_post(); ?>
+
 				</div>
 
 			</div>
@@ -47,20 +61,25 @@
 		</li>
 
 	<?php endwhile; ?>
+
 	</ul>
 
-	<?php do_action( 'bp_after_directory_blogs_list' ) ?>
+	<?php do_action( 'bp_after_directory_blogs_list' ); ?>
 
-	<?php bp_blog_hidden_fields() ?>
+	<?php bp_blog_hidden_fields(); ?>
 
 	<div id="pag-bottom" class="pagination">
 
 		<div class="pag-count" id="blog-dir-count-bottom">
-			<?php bp_blogs_pagination_count() ?>
+
+			<?php bp_blogs_pagination_count(); ?>
+
 		</div>
 
 		<div class="pagination-links" id="blog-dir-pag-bottom">
-			<?php bp_blogs_pagination_links() ?>
+
+			<?php bp_blogs_pagination_links(); ?>
+
 		</div>
 
 	</div>
@@ -68,9 +87,9 @@
 <?php else: ?>
 
 	<div id="message" class="info">
-		<p><?php _e( 'Sorry, there were no blogs found.', 'buddypress' ) ?></p>
+		<p><?php _e( 'Sorry, there were no sites found.', 'buddypress' ); ?></p>
 	</div>
 
 <?php endif; ?>
 
-<?php do_action( 'bp_after_blogs_loop' ) ?>
+<?php do_action( 'bp_after_blogs_loop' ); ?>
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 9006c17f92863efb2e84078c40b3531b99754d0a..0260fd9fa384312cb3327d618c75f7a332efb8c9 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
@@ -1,36 +1,46 @@
-<?php get_header() ?>
+<?php
 
-	<?php do_action( 'bp_before_directory_blogs_content' ) ?>
+/**
+ * BuddyPress - Create Blog
+ *
+ * @package BuddyPress
+ * @subpackage bp-default
+ */
+
+?>
+
+<?php get_header( 'buddypress' ); ?>
+
+	<?php do_action( 'bp_before_directory_blogs_content' ); ?>
 
 	<div id="content">
-		<div class="padder">
+		<div class="padder" role="main">
 
-		<?php do_action( 'template_notices' ) ?>
+		<?php do_action( 'template_notices' ); ?>
 
-		<h3><?php _e( 'Create a Blog', 'buddypress' ) ?> &nbsp;<a class="button" href="<?php echo bp_get_root_domain() . '/' . BP_BLOGS_SLUG . '/' ?>"><?php _e( 'Blogs 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' ) ?>
+		<?php do_action( 'bp_before_create_blog_content' ); ?>
 
 		<?php if ( bp_blog_signup_enabled() ) : ?>
 
-			<?php bp_show_blog_signup_form() ?>
+			<?php bp_show_blog_signup_form(); ?>
 
 		<?php else: ?>
 
 			<div id="message" class="info">
-				<p><?php _e( 'Blog registration is currently disabled', 'buddypress' ); ?></p>
+				<p><?php _e( 'Site registration is currently disabled', 'buddypress' ); ?></p>
 			</div>
 
 		<?php endif; ?>
 
-		<?php do_action( 'bp_after_create_blog_content' ) ?>
+		<?php do_action( 'bp_after_create_blog_content' ); ?>
 
 		</div><!-- .padder -->
 	</div><!-- #content -->
 
-	<?php locate_template( array( 'sidebar.php' ), true ) ?>
-
-	<?php do_action( 'bp_after_directory_blogs_content' ) ?>
+	<?php do_action( 'bp_after_directory_blogs_content' ); ?>
 
-<?php get_footer() ?>
+<?php get_sidebar( 'buddypress' ); ?>
+<?php get_footer( 'buddypress' ); ?>
 
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 a20708742517fd5dced15fc001f17eedb936e914..186c5abd924ceea3faa451f3170caf311db52120 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
@@ -1,55 +1,90 @@
-<?php get_header() ?>
+<?php
+
+/**
+ * BuddyPress - Blogs Directory
+ *
+ * @package BuddyPress
+ * @subpackage bp-default
+ */
+
+?>
+
+<?php get_header( 'buddypress' ); ?>
+
+	<?php do_action( 'bp_before_directory_blogs_page' ); ?>
 
 	<div id="content">
 		<div class="padder">
 
+		<?php do_action( 'bp_before_directory_blogs' ); ?>
+
 		<form action="" method="post" id="blogs-directory-form" class="dir-form">
 
-			<h3><?php _e( 'Blogs Directory', 'buddypress' ) ?><?php if ( is_user_logged_in() && bp_blog_signup_enabled() ) : ?> &nbsp;<a class="button" href="<?php echo bp_get_root_domain() . '/' . BP_BLOGS_SLUG . '/create/' ?>"><?php _e( 'Create a Blog', 'buddypress' ) ?></a><?php endif; ?></h3>
+			<h3><?php _e( 'Site Directory', 'buddypress' ); ?><?php if ( is_user_logged_in() && bp_blog_signup_enabled() ) : ?> &nbsp;<a class="button" href="<?php echo bp_get_root_domain() . '/' . bp_get_blogs_root_slug() . '/create/' ?>"><?php _e( 'Create a Site', 'buddypress' ); ?></a><?php endif; ?></h3>
+
+			<?php do_action( 'bp_before_directory_blogs_content' ); ?>
 
-			<?php do_action( 'bp_before_directory_blogs_content' ) ?>
+			<div id="blog-dir-search" class="dir-search" role="search">
+
+				<?php bp_directory_blogs_search_form(); ?>
 
-			<div id="blog-dir-search" class="dir-search">
-				<?php bp_directory_blogs_search_form() ?>
 			</div><!-- #blog-dir-search -->
 
-			<div class="item-list-tabs">
+			<div class="item-list-tabs" role="navigation">
 				<ul>
-					<li class="selected" id="blogs-all"><a href="<?php bp_root_domain() ?>"><?php printf( __( 'All Blogs (%s)', '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_BLOGS_SLUG . '/my-blogs/' ?>"><?php printf( __( 'My Blogs (%s)', '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; ?>
 
-					<?php do_action( 'bp_blogs_directory_blog_types' ) ?>
+					<?php do_action( 'bp_blogs_directory_blog_types' ); ?>
+
+				</ul>
+			</div><!-- .item-list-tabs -->
+
+			<div class="item-list-tabs" id="subnav" role="navigation">
+				<ul>
+
+					<?php do_action( 'bp_blogs_directory_blog_sub_types' ); ?>
 
 					<li id="blogs-order-select" class="last filter">
 
-						<?php _e( 'Order By:', 'buddypress' ) ?>
-						<select>
-							<option value="active"><?php _e( 'Last Active', 'buddypress' ) ?></option>
-							<option value="newest"><?php _e( 'Newest', 'buddypress' ) ?></option>
-							<option value="alphabetical"><?php _e( 'Alphabetical', 'buddypress' ) ?></option>
+						<label for="blogs-order-by"><?php _e( 'Order By:', 'buddypress' ); ?></label>
+						<select id="blogs-order-by">
+							<option value="active"><?php _e( 'Last Active', 'buddypress' ); ?></option>
+							<option value="newest"><?php _e( 'Newest', 'buddypress' ); ?></option>
+							<option value="alphabetical"><?php _e( 'Alphabetical', 'buddypress' ); ?></option>
+
+							<?php do_action( 'bp_blogs_directory_order_options' ); ?>
 
-							<?php do_action( 'bp_blogs_directory_order_options' ) ?>
 						</select>
 					</li>
 				</ul>
-			</div><!-- .item-list-tabs -->
+			</div>
 
 			<div id="blogs-dir-list" class="blogs dir-list">
-				<?php locate_template( array( 'blogs/blogs-loop.php' ), true ) ?>
+
+				<?php locate_template( array( 'blogs/blogs-loop.php' ), true ); ?>
+
 			</div><!-- #blogs-dir-list -->
 
-			<?php do_action( 'bp_after_directory_blogs_content' ) ?>
+			<?php do_action( 'bp_directory_blogs_content' ); ?>
 
-			<?php wp_nonce_field( 'directory_blogs', '_wpnonce-blogs-filter' ) ?>
+			<?php wp_nonce_field( 'directory_blogs', '_wpnonce-blogs-filter' ); ?>
+
+			<?php do_action( 'bp_after_directory_blogs_content' ); ?>
 
 		</form><!-- #blogs-directory-form -->
 
+		<?php do_action( 'bp_after_directory_blogs' ); ?>
+
 		</div><!-- .padder -->
 	</div><!-- #content -->
 
-	<?php locate_template( array( 'sidebar.php' ), true ) ?>
+	<?php do_action( 'bp_after_directory_blogs_page' ); ?>
 
-<?php get_footer() ?>
\ No newline at end of file
+<?php get_sidebar( 'buddypress' ); ?>
+<?php get_footer( 'buddypress' ); ?>
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 62dec24b69aadd132af6e29432872eacaf2ae887..e4f16626769e4e5a94241f569428355b542a7ad0 100644
--- a/wp-content/plugins/buddypress/bp-themes/bp-default/comments.php
+++ b/wp-content/plugins/buddypress/bp-themes/bp-default/comments.php
@@ -1,183 +1,78 @@
-	<?php
-		if ( post_password_required() ) :
-			echo '<h3 class="comments-header">' . __('Password Protected', 'buddypress') . '</h3>';
-			echo '<p class="alert password-protected">' . __('Enter the password to view comments.', 'buddypress') . '</p>';
-			return;
-		endif;
-
-		if ( is_page() && !have_comments() && !comments_open() && !pings_open() )
-			return;
-	?>
-
-	<?php if ( have_comments() ) : ?>
-
-		<div id="comments">
-
-			<?php
-				// Only include comments
-				$numTrackBacks = 0; $numComments = 0;
-				foreach ( (array)$comments as $comment )
-					if ( 'comment' != get_comment_type() )
-						$numTrackBacks++; 
-					else
-						$numComments++;
-			?>
-
-			<h3 id="comments">
-				<?php
-					printf( _n( 'One Response to %2$s', '%1$s Responses to %2$s', $numComments, 'buddypress' ),
-					number_format_i18n( $numComments ), '<em>' . get_the_title() . '</em>' );
-				?>
-			</h3>
-
-			<?php do_action( 'bp_before_blog_comment_list' ) ?>
-
-			<ol class="commentlist">
-				<?php wp_list_comments( array( 'callback' => 'bp_dtheme_blog_comments' ) ); ?>
-			</ol><!-- .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(); ?>
-
-				</div>
-
-			<?php endif; ?>
-
-		</div><!-- #comments -->
-
-	<?php else : ?>
-
-		<?php if ( pings_open() && !comments_open() && is_single() ) : ?>
-
-			<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' ) ); ?>
-			</p>
-
-		<?php elseif ( !comments_open() && is_single() ) : ?>
-
-			<p class="comments-closed">
-				<?php _e('Comments are closed.', 'buddypress'); ?>
-			</p>
-
+<?php
+	if ( post_password_required() ) {
+		echo '<h3 class="comments-header">' . __( 'Password Protected', 'buddypress' ) . '</h3>';
+		echo '<p class="alert password-protected">' . __( 'Enter the password to view comments.', 'buddypress' ) . '</p>';
+		return;
+	}
+
+	if ( is_page() && !have_comments() && !comments_open() && !pings_open() )
+		return;
+
+	if ( have_comments() ) :
+		$num_comments = 0;
+		$num_trackbacks = 0;
+		foreach ( (array)$comments as $comment ) {
+			if ( 'comment' != get_comment_type() )
+				$num_trackbacks++;
+			else
+				$num_comments++;
+		}
+?>
+	<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>' ) ?>
+		</h3>
+
+		<?php do_action( 'bp_before_blog_comment_list' ) ?>
+
+		<ol class="commentlist">
+			<?php wp_list_comments( array( 'callback' => 'bp_dtheme_blog_comments', 'type' => 'comment' ) ) ?>
+		</ol><!-- .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() ?>
+			</div>
 		<?php endif; ?>
 
+	</div><!-- #comments -->
+<?php else : ?>
+
+	<?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' ) ) ?>
+		</p>
+	<?php elseif ( !comments_open() && ( is_single() || is_page() ) ) : ?>
+		<p class="comments-closed">
+			<?php _e( 'Comments are closed.', 'buddypress' ) ?>
+		</p>
 	<?php endif; ?>
 
-		<?php if ( comments_open() ) : ?>
-
-		<div id="respond">
-
-			<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>
-					<?php else : ?>
-						<?php echo get_avatar( 0, 50 ); ?>
-					<?php endif; ?>
-				</div>
-			</div>
-
-			<div class="comment-content">
-
-				<h3 id="reply" class="comments-header">
-					<?php comment_form_title( __( 'Leave a Reply', 'buddypress' ), __( 'Leave a Reply to %s', 'buddypress' ), true ); ?>
-				</h3>
+<?php endif; ?>
 
-				<p id="cancel-comment-reply">
-					<?php cancel_comment_reply_link( __( 'Click here to cancel reply.', 'buddypress' ) ); ?>
-				</p>
+<?php if ( comments_open() ) : ?>
+	<?php comment_form() ?>
+<?php endif; ?>
 
-				<?php if ( get_option( 'comment_registration' ) && !$user_ID ) : ?>
+<?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>
 
-					<p class="alert">
-						<?php printf( __('You must be <a href="%1$s" title="Log in">logged in</a> to post a comment.', 'buddypress'), wp_login_url( get_permalink() ) ); ?>
-					</p>
+		<ul id="trackbacklist">
+			<?php foreach ( (array)$comments as $comment ) : ?>
 
-				<?php else : ?>
+				<?php if ( 'comment' != get_comment_type() ) : ?>
+					<li>
+						<h5><?php comment_author_link() ?></h5>
+						<em>on <?php comment_date() ?></em>
+					</li>
+ 				<?php endif; ?>
 
-					<?php do_action( 'bp_before_blog_comment_form' ) ?>
+			<?php endforeach; ?>
+		</ul>
 
-					<form action="<?php echo site_url( 'wp-comments-post.php' ) ?>" method="post" id="commentform" class="standard-form">
-
-						<?php if ( $user_ID ) : ?>
-
-							<p class="log-in-out">
-								<?php printf( __('Logged in as <a href="%1$s" title="%2$s">%2$s</a>.', 'buddypress'), bp_loggedin_user_domain(), $user_identity ); ?> <a href="<?php echo wp_logout_url( get_permalink() ); ?>" title="<?php _e('Log out of this account', 'buddypress'); ?>"><?php _e('Log out &rarr;', 'buddypress'); ?></a>
-							</p>
-
-						<?php else : ?>
-
-							<?php $req = get_option( 'require_name_email' ); ?>
-
-							<p class="form-author">
-								<label for="author"><?php _e('Name', 'buddypress'); ?> <?php if ( $req ) : ?><span class="required"><?php _e('*', 'buddypress'); ?></span><?php endif; ?></label>
-								<input type="text" class="text-input" name="author" id="author" value="<?php echo $comment_author; ?>" size="40" tabindex="1" />
-							</p>
-
-							<p class="form-email">
-								<label for="email"><?php _e('Email', 'buddypress'); ?>  <?php if ( $req ) : ?><span class="required"><?php _e('*', 'buddypress'); ?></span><?php endif; ?></label>
-								<input type="text" class="text-input" name="email" id="email" value="<?php echo $comment_author_email; ?>" size="40" tabindex="2" />
-							</p>
-
-							<p class="form-url">
-								<label for="url"><?php _e('Website', 'buddypress'); ?></label>
-								<input type="text" class="text-input" name="url" id="url" value="<?php echo $comment_author_url; ?>" size="40" tabindex="3" />
-							</p>
-
-						<?php endif; ?>
-
-						<p class="form-textarea">
-							<label for="comment"><?php _e('Comment', 'buddypress'); ?></label>
-							<textarea name="comment" id="comment" cols="60" rows="10" tabindex="4"></textarea>
-						</p>
-
-						<?php do_action( 'bp_blog_comment_form' ) ?>
-
-						<p class="form-submit">
-							<input class="submit-comment button" name="submit" type="submit" id="submit" tabindex="5" value="<?php _e('Submit', 'buddypress'); ?>" />
-							<?php comment_id_fields(); ?>
-						</p>
-
-						<div class="comment-action">
-							<?php do_action( 'comment_form', $post->ID ); ?>
-						</div>
-
-					</form>
-
-					<?php do_action( 'bp_after_blog_comment_form' ) ?>
-
-				<?php endif; ?>
-
-			</div><!-- .comment-content -->
-		</div><!-- #respond -->
-
-		<?php endif; ?>
-
-		<?php if ( $numTrackBacks ) : ?>
-			<div id="trackbacks">
-
-				<span class="title"><?php the_title() ?></span>
-
-				<?php if ( 1 == $numTrackBacks ) : ?>
-					<h3><?php printf( __( '%d Trackback', 'buddypress' ), $numTrackBacks ) ?></h3>
-				<?php else : ?>
-					<h3><?php printf( __( '%d Trackbacks', 'buddypress' ), $numTrackBacks ) ?></h3>
-				<?php endif; ?>
-
-				<ul id="trackbacklist">
-					<?php foreach ( (array)$comments as $comment ) : ?>
-
-						<?php if ( get_comment_type() != 'comment' ) : ?>
-							<li><h5><?php comment_author_link() ?></h5><em>on <?php comment_date() ?></em></li>
-	  					<?php endif; ?>
-					<?php endforeach; ?>
-				</ul>
-			</div>
-		<?php endif; ?>
+	</div>
+<?php endif; ?>
\ No newline at end of file
diff --git a/wp-content/plugins/buddypress/bp-themes/bp-default/editor-style-rtl.css b/wp-content/plugins/buddypress/bp-themes/bp-default/editor-style-rtl.css
new file mode 100644
index 0000000000000000000000000000000000000000..df07d31ddbdb5411f058ebcda87d13fe2088a599
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-themes/bp-default/editor-style-rtl.css
@@ -0,0 +1,43 @@
+/*
+Theme Name: BuddyPress Default
+Description: Used to style the TinyMCE editor (RTL version).
+*/
+
+html .mceContentBody .alignright {
+	float: left;
+	margin-left: auto;
+	margin-right: 15px;
+}
+html .mceContentBody .alignleft {
+	float: right;
+	margin-left: 15px;
+	margin-right: auto;
+}
+dl {
+	margin-left: auto;
+	margin-right: 0;
+}
+html .mceContentBody img.alignright {
+	margin: 0 7px 2px 0;
+}
+html .mceContentBody img.alignleft {
+	margin: 0 0 2px 7px;
+}
+dd.wp-caption p.wp-caption-text,
+.wp-caption p.wp-caption-text {
+	padding: 0 0 5px 4px;
+}
+html .mceContentBody ul,
+html .mceContentBody ol,
+html .mceContentBody dl {
+	margin: 0 1.5em 18px 0;
+}
+
+html .mceContentBody table th:first {
+	border-left: 1px solid #eaeaea;
+	border-right: 0;
+}
+html .mceContentBody table tr td.label {
+	border-left: 1px solid #eaeaea;
+	border-right: 0;
+}
\ No newline at end of file
diff --git a/wp-content/plugins/buddypress/bp-themes/bp-default/editor-style.css b/wp-content/plugins/buddypress/bp-themes/bp-default/editor-style.css
new file mode 100644
index 0000000000000000000000000000000000000000..bfdd5673d6deb4807fb9b91be45604ee2ab71d26
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-themes/bp-default/editor-style.css
@@ -0,0 +1,272 @@
+/*
+Theme Name: BuddyPress Default
+Description: Used to style the TinyMCE editor.
+*/
+
+html .mceContentBody {
+	font-family: Arial, Tahoma, Verdana, sans-serif;
+	font-size: 12px;
+	color: #555;
+}
+ul,
+ol {
+	margin: 0;
+	padding: 0;
+}
+h1,
+h2,
+h3,
+h4,
+h5,
+h6 {
+	margin: 5px 0 15px 0;
+}
+h1 {
+	font-size: 28px;
+	margin-bottom: 25px;
+}
+h2 {
+	font-size: 24px;
+	margin-bottom: 20px;
+}
+h3 {
+	font-size: 20px;
+}
+h4 {
+	font-size: 16px;
+	margin-bottom: 15px;
+}
+h5 {
+	font-size: 14px;
+	margin-bottom: 0;
+}
+h6 {
+	font-size: 12px;
+	margin-bottom: 0;
+}
+a {
+	color: #1fb3dd;
+}
+a:hover,
+a:active {
+	color: #888;
+}
+a:focus {
+	outline: 1px dotted #ccc;
+}
+p {
+	margin-bottom: 15px;
+}
+p:last-child {
+	margin-bottom: 0;
+}
+hr {
+	background-color: #e7e7e7;
+	border: 0 none;
+	clear: both;
+	height: 1px;
+	margin: 20px 0;
+}
+big {
+	font-size: 18px;
+}
+acronym {
+	border-bottom: 0;
+	cursor: normal;
+}
+acronym:hover {
+	cursor: normal;
+}
+del {
+	text-decoration: line-through;
+	color: #555;
+}
+ins {
+	background: #fff9db;
+	border: 0;
+	color: #555;
+	text-decoration: none;
+}
+sub {
+	top: .5ex;
+}
+sup {
+	bottom: 1ex;
+}
+sub,
+sup {
+	height: 0;
+	line-height: 1;
+	vertical-align: baseline;
+	position: relative;
+}
+html .mceContentBody .alignright {
+	float: right;
+	margin-left: 15px;
+}
+html .mceContentBody .alignleft {
+	float: left;
+	margin-right: 15px;
+}
+p {
+	margin: 0 0 20px 0;
+}
+dl {
+	margin-left: 0;
+}
+dt {
+	font-size: 14px;
+	font-weight: bold;
+}
+dd {
+	margin: 0 0 15px 0;
+}
+pre,
+code p {
+	padding: 15px;
+	background: #f4f4f4;
+	-moz-border-radius: 3px;
+	-webkit-border-radius: 3px;
+	border-radius: 3px;
+}
+code {
+	font-family: "Monaco", courier, sans-serif;
+}
+cite {
+	border: 0;
+}
+blockquote {
+	quotes: none;
+	font-style: italic;
+	margin: 0 0;
+	padding: 0 3em;
+	font-family: georgia, times, serif;
+	font-size: 16px;
+	line-height: 150%;
+}
+blockquote p {
+	margin-bottom: 15px !important;
+}
+p.date {
+	color: #888;
+	font-size: 12px;
+	font-family: Georgia, times, serif;
+	padding: 3px 0;
+	margin: 10px 0;
+	border-bottom: 1px solid #e4e4e4;
+	border-top: 1px solid #e4e4e4;
+}
+img.wp-smiley {
+	padding: 0 !important;
+	margin: 0 !important;
+	border: none !important;
+	float: none !important;
+	clear: none !important;
+}
+html .mceContentBody img.centered,
+html .mceContentBody img.aligncenter {
+	display: block;
+	margin-left: auto;
+	margin-right: auto;
+}
+html .mceContentBody img.alignright {
+	padding: 4px;
+	margin: 0 0 2px 7px;
+	display: inline;
+}
+html .mceContentBody img.alignleft {
+	padding: 4px;
+	margin: 0 7px 2px 0;
+	display: inline;
+}
+html .mceContentBody .aligncenter {
+	display: block;
+	margin-left: auto;
+	margin-right: auto;
+}
+.wp-caption {
+	border: 1px solid #ddd;
+	text-align: center;
+	background-color: #f3f3f3;
+	padding-top: 4px;
+	-moz-border-radius: 3px;
+	-webkit-border-radius: 3px;
+	border-radius: 3px;
+}
+.wp-caption img {
+	margin: 0;
+	padding: 0;
+	border: 0 none;
+}
+dd.wp-caption p.wp-caption-text,
+.wp-caption p.wp-caption-text {
+	font-size: 0.9em;
+	line-height: 17px;
+	padding: 0 4px 5px 0;
+	margin: 0;
+}
+.gallery .gallery-caption {
+	color: #555;
+}
+table {
+	width: 100%;
+}
+table thead tr {
+	background: #eaeaea;
+}
+td {
+	color: #555;
+	font-size: 12px;
+}
+table tr td,
+table tr th {
+	padding: 8px;
+	vertical-align: middle;
+}
+table tr.alt td {
+	background: #f5f5f5;
+}
+html .mceContentBody ul,
+html .mceContentBody ol,
+html .mceContentBody dl {
+	margin: 0 0 18px 1.5em;
+}
+html .mceContentBody ul {
+	list-style: square;
+}
+html .mceContentBody ol {
+	list-style: decimal;
+}
+html .mceContentBody ol ol {
+	list-style: upper-alpha;
+}
+html .mceContentBody table {
+	border-collapse: collapse;
+	border-spacing: 0;
+	border: 1px solid #eee;
+}
+html .mceContentBody table th {
+	border-top: 1px solid #eee;
+	border-left: 0 none;
+	border-right: 0 none;
+	font-size: 12px;
+	text-align: left;
+}
+html .mceContentBody table th:first {
+	border-right: 1px solid #eaeaea;
+}
+html .mceContentBody table td {
+	border-top: 1px solid #eee;
+}
+html .mceContentBody img {
+	margin-bottom: 15px;
+}
+html .mceContentBody table tr td {
+	border-left: 0 none;
+	border-right: 0 none;
+}
+html .mceContentBody table tr td.label {
+	border-right: 1px solid #eaeaea;
+	font-weight: bold;
+	width: 25%;
+}
\ No newline at end of file
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 2bfb40041426ff227a8daf94d541e8aeb2c47f67..b521d58838b7e733f20a7ffb8594400a63cf778b 100644
--- a/wp-content/plugins/buddypress/bp-themes/bp-default/footer.php
+++ b/wp-content/plugins/buddypress/bp-themes/bp-default/footer.php
@@ -4,7 +4,16 @@
 		<?php do_action( 'bp_before_footer' ) ?>
 
 		<div id="footer">
-	    	<p><?php printf( __( '%s is proudly powered by <a href="http://wordpress.org">WordPress</a> and <a href="http://buddypress.org">BuddyPress</a>', 'buddypress' ), get_bloginfo( 'name' ) ); ?></p>
+			<?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' ) ?>
+				</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>
+			</div>
 
 			<?php do_action( 'bp_footer' ) ?>
 		</div><!-- #footer -->
diff --git a/wp-content/plugins/buddypress/bp-themes/bp-default/forums/forums-loop.php b/wp-content/plugins/buddypress/bp-themes/bp-default/forums/forums-loop.php
index 157141e45250a9374c1216e7617ed813d58a06fc..0aa9c459cd95ab1c23426a7ffb1a6bd579a7d33b 100644
--- a/wp-content/plugins/buddypress/bp-themes/bp-default/forums/forums-loop.php
+++ b/wp-content/plugins/buddypress/bp-themes/bp-default/forums/forums-loop.php
@@ -1,37 +1,46 @@
-<?php /* Querystring is set via AJAX in _inc/ajax.php - bp_dtheme_object_filter() */ ?>
+<?php
 
-<?php do_action( 'bp_before_forums_loop' ) ?>
+/**
+ * BuddyPress - Forums Loop
+ *
+ * Querystring is set via AJAX in _inc/ajax.php - bp_dtheme_object_filter()
+ *
+ * @package BuddyPress
+ * @subpackage bp-default
+ */
+
+?>
+
+<?php do_action( 'bp_before_forums_loop' ); ?>
 
 <?php if ( bp_has_forum_topics( bp_ajax_querystring( 'forums' ) ) ) : ?>
 
 	<div id="pag-top" class="pagination">
 
 		<div class="pag-count" id="topic-count-top">
-			<?php bp_forum_pagination_count() ?>
+
+			<?php bp_forum_pagination_count(); ?>
+
 		</div>
 
 		<div class="pagination-links" id="topic-pag-top">
-			<?php bp_forum_pagination() ?>
+
+			<?php bp_forum_pagination(); ?>
+
 		</div>
 
 	</div>
 
-	<?php do_action( 'bp_before_directory_forums_list' ) ?>
+	<?php do_action( 'bp_before_directory_forums_list' ); ?>
 
-	<table class="forum zebra">
+	<table class="forum">
 		<thead>
 			<tr>
-				<th id="th-title"><?php _e( 'Topic Title', 'buddypress' ) ?></th>
-				<th id="th-poster"><?php _e( 'Latest Poster', 'buddypress' ) ?></th>
-
-				<?php if ( !bp_is_group_forum() ) : ?>
-					<th id="th-group"><?php _e( 'Posted In Group', 'buddypress' ) ?></th>
-				<?php endif; ?>
-
-				<th id="th-postcount"><?php _e( 'Posts', 'buddypress' ) ?></th>
-				<th id="th-freshness"><?php _e( 'Freshness', 'buddypress' ) ?></th>
+				<th id="th-title"><?php _e( 'Topic', 'buddypress' ); ?></th>
+				<th id="th-postcount"><?php _e( 'Posts', 'buddypress' ); ?></th>
+				<th id="th-freshness"><?php _e( 'Freshness', 'buddypress' ); ?></th>
 
-				<?php do_action( 'bp_directory_forums_extra_cell_head' ) ?>
+				<?php do_action( 'bp_directory_forums_extra_cell_head' ); ?>
 
 			</tr>
 		</thead>
@@ -40,51 +49,69 @@
 
 			<?php while ( bp_forum_topics() ) : bp_the_forum_topic(); ?>
 
-			<tr class="<?php bp_the_topic_css_class() ?>">
+			<tr class="<?php bp_the_topic_css_class(); ?>">
 				<td class="td-title">
-					<a class="topic-title" href="<?php bp_the_topic_permalink() ?>" title="<?php bp_the_topic_title() ?> - <?php _e( 'Permalink', 'buddypress' ) ?>">
-						<?php bp_the_topic_title() ?>
+					<a class="topic-title" href="<?php bp_the_topic_permalink(); ?>" title="<?php bp_the_topic_title(); ?> - <?php _e( 'Permalink', 'buddypress' ); ?>">
+
+						<?php bp_the_topic_title(); ?>
+
 					</a>
-				</td>
-				<td class="td-poster">
-					<a href="<?php bp_the_topic_permalink() ?>"><?php bp_the_topic_last_poster_avatar( 'type=thumb&width=20&height=20' ) ?></a>
-					<div class="poster-name"><?php bp_the_topic_last_poster_name() ?></div>
-				</td>
 
-				<?php if ( !bp_is_group_forum() ) : ?>
-					<td class="td-group">
-						<a href="<?php bp_the_topic_object_permalink() ?>"><?php bp_the_topic_object_avatar( 'type=thumb&width=20&height=20' ) ?></a>
-						<div class="object-name"><a href="<?php bp_the_topic_object_permalink() ?>" title="<?php bp_the_topic_object_name() ?>"><?php bp_the_topic_object_name() ?></a></div>
-					</td>
-				<?php endif; ?>
+					<p class="topic-meta">
+						<span class="topic-by"><?php /* translators: "started by [poster] in [forum]" */ printf( __( 'Started by %1$s', 'buddypress' ), bp_get_the_topic_poster_avatar( 'height=20&width=20') . bp_get_the_topic_poster_name() ); ?></span>
+
+						<?php if ( !bp_is_group_forum() ) : ?>
+
+							<span class="topic-in">
+
+								<?php
+									$topic_in = '<a href="' . bp_get_the_topic_object_permalink() . '">' . bp_get_the_topic_object_avatar( 'type=thumb&width=20&height=20' ) . '</a>' .
+													'<a href="' . bp_get_the_topic_object_permalink() . '" title="' . bp_get_the_topic_object_name() . '">' . bp_get_the_topic_object_name() .'</a>';
 
+									/* translators: "started by [poster] in [forum]" */
+									printf( __( 'in %1$s', 'buddypress' ), $topic_in );
+								?>
+
+							</span>
+
+						<?php endif; ?>
+
+					</p>
+				</td>
 				<td class="td-postcount">
-					<?php bp_the_topic_total_posts() ?>
+					<?php bp_the_topic_total_posts(); ?>
 				</td>
 				<td class="td-freshness">
-					<?php bp_the_topic_time_since_last_post() ?>
+					<span class="time-since"><?php bp_the_topic_time_since_last_post(); ?></span>
+					<p class="topic-meta">
+						<span class="freshness-author">
+							<a href="<?php bp_the_topic_permalink(); ?>"><?php bp_the_topic_last_poster_avatar( 'type=thumb&width=20&height=20' ); ?></a>
+							<?php bp_the_topic_last_poster_name(); ?>
+						</span>
+					</p>
 				</td>
 
-				<?php do_action( 'bp_directory_forums_extra_cell' ) ?>
+				<?php do_action( 'bp_directory_forums_extra_cell' ); ?>
+
 			</tr>
 
-			<?php do_action( 'bp_directory_forums_extra_row' ) ?>
+			<?php do_action( 'bp_directory_forums_extra_row' ); ?>
 
 			<?php endwhile; ?>
 
 		</tbody>
 	</table>
 
-	<?php do_action( 'bp_after_directory_forums_list' ) ?>
+	<?php do_action( 'bp_after_directory_forums_list' ); ?>
 
 	<div id="pag-bottom" class="pagination">
 
 		<div class="pag-count" id="topic-count-bottom">
-			<?php bp_forum_pagination_count() ?>
+			<?php bp_forum_pagination_count(); ?>
 		</div>
 
 		<div class="pagination-links" id="topic-pag-bottom">
-			<?php bp_forum_pagination() ?>
+			<?php bp_forum_pagination(); ?>
 		</div>
 
 	</div>
@@ -92,9 +119,9 @@
 <?php else: ?>
 
 	<div id="message" class="info">
-		<p><?php _e( 'Sorry, there were no forum topics found.', 'buddypress' ) ?></p>
+		<p><?php _e( 'Sorry, there were no forum topics found.', 'buddypress' ); ?></p>
 	</div>
 
-<?php endif;?>
+<?php endif; ?>
 
-<?php do_action( 'bp_after_forums_loop' ) ?>
+<?php do_action( 'bp_after_forums_loop' ); ?>
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 d7604c18f7f27c64b51d65876adc835841e878d3..19a1f5af6ee50b23ef91ac20e753a490b40fae89 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
@@ -1,120 +1,164 @@
-<?php get_header() ?>
+<?php
+
+/**
+ * BuddyPress - Forums Directory
+ *
+ * @package BuddyPress
+ * @subpackage bp-default
+ */
+
+?>
+
+<?php get_header( 'buddypress' ); ?>
+
+	<?php do_action( 'bp_before_directory_forums_page' ); ?>
 
 	<div id="content">
 		<div class="padder">
 
-		<form action="" method="post" id="forums-search-form" class="dir-form">
+			<?php do_action( 'bp_before_directory_forums' ); ?>
 
-			<h3><?php _e( 'Group Forums Directory', 'buddypress' ) ?><?php if ( is_user_logged_in() ) : ?> &nbsp;<a class="button" href="#new-topic" id="new-topic-button"><?php _e( 'New Topic', 'buddypress' ) ?></a><?php endif; ?></h3>
+			<form action="" method="post" id="forums-search-form" class="dir-form">
 
-			<?php do_action( 'bp_before_directory_forums_content' ) ?>
+				<h3><?php _e( 'Forums Directory', 'buddypress' ); ?><?php if ( is_user_logged_in() ) : ?> &nbsp;<a class="button show-hide-new" href="#new-topic" id="new-topic-button"><?php _e( 'New Topic', 'buddypress' ); ?></a><?php endif; ?></h3>
 
-			<div id="forums-dir-search" class="dir-search">
-				<?php bp_directory_forums_search_form() ?>
-			</div>
-		</form>
+				<?php do_action( 'bp_before_directory_forums_content' ); ?>
 
-		<div id="new-topic-post">
-			<?php if ( is_user_logged_in() ) : ?>
+				<div id="forums-dir-search" class="dir-search" role="search">
 
-				<?php if ( bp_has_groups( 'user_id=' . bp_loggedin_user_id() . '&type=alphabetical&max=100&per_page=100' ) ) : ?>
+					<?php bp_directory_forums_search_form(); ?>
 
-					<form action="" method="post" id="forum-topic-form" class="standard-form">
+				</div>
+			</form>
 
-						<?php do_action( 'groups_forum_new_topic_before' ) ?>
+			<?php do_action( 'bp_before_topics' ); ?>
 
-						<a name="post-new"></a>
-						<h5><?php _e( 'Post a New Topic:', 'buddypress' ) ?></h5>
+			<form action="" method="post" id="forums-directory-form" class="dir-form">
 
-						<label><?php _e( 'Title:', 'buddypress' ) ?></label>
-						<input type="text" name="topic_title" id="topic_title" value="" />
+				<div class="item-list-tabs" role="navigation">
+					<ul>
+						<li class="selected" id="forums-all"><a href="<?php echo trailingslashit( bp_get_root_domain() . '/' . bp_get_forums_root_slug() ); ?>"><?php printf( __( 'All Topics <span>%s</span>', 'buddypress' ), bp_get_forum_topic_count() ); ?></a></li>
 
-						<label><?php _e( 'Content:', 'buddypress' ) ?></label>
-						<textarea name="topic_text" id="topic_text"></textarea>
+						<?php if ( is_user_logged_in() && bp_get_forum_topic_count_for_user( bp_loggedin_user_id() ) ) : ?>
 
-						<label><?php _e( 'Tags (comma separated):', 'buddypress' ) ?></label>
-						<input type="text" name="topic_tags" id="topic_tags" value="" />
+							<li id="forums-personal"><a href="<?php echo trailingslashit( bp_loggedin_user_domain() . bp_get_forums_slug() . '/topics' ); ?>"><?php printf( __( 'My Topics <span>%s</span>', 'buddypress' ), bp_get_forum_topic_count_for_user( bp_loggedin_user_id() ) ); ?></a></li>
 
-						<label><?php _e( 'Post In Group Forum:', 'buddypress' ) ?></label>
-						<select id="topic_group_id" name="topic_group_id">
+						<?php endif; ?>
 
-							<option value="">----</option>
+						<?php do_action( 'bp_forums_directory_group_types' ); ?>
 
-							<?php while ( bp_groups() ) : bp_the_group(); ?>
+					</ul>
+				</div>
 
-								<?php if ( bp_group_is_forum_enabled() && 'public' == bp_get_group_status() ) : ?>
+				<div class="item-list-tabs" id="subnav" role="navigation">
+					<ul>
 
-									<option value="<?php bp_group_id() ?>"><?php bp_group_name() ?></option>
+						<?php do_action( 'bp_forums_directory_group_sub_types' ); ?>
 
-								<?php endif; ?>
+						<li id="forums-order-select" class="last filter">
 
-							<?php endwhile; ?>
+							<label for="forums-order-by"><?php _e( 'Order By:', 'buddypress' ); ?></label>
+							<select id="forums-order-by">
+								<option value="active"><?php _e( 'Last Active', 'buddypress' ); ?></option>
+								<option value="popular"><?php _e( 'Most Posts', 'buddypress' ); ?></option>
+								<option value="unreplied"><?php _e( 'Unreplied', 'buddypress' ); ?></option>
 
-						</select><!-- #topic_group_id -->
+								<?php do_action( 'bp_forums_directory_order_options' ); ?>
 
-						<?php do_action( 'groups_forum_new_topic_after' ) ?>
+							</select>
+						</li>
+					</ul>
+				</div>
 
-						<div class="submit">
-							<input type="submit" name="submit_topic" id="submit" value="<?php _e( 'Post Topic', 'buddypress' ) ?>" />
-							<input type="button" name="submit_topic_cancel" id="submit_topic_cancel" value="<?php _e( 'Cancel', 'buddypress' ) ?>" />
-						</div>
+				<div id="forums-dir-list" class="forums dir-list" role="main">
 
-						<?php wp_nonce_field( 'bp_forums_new_topic' ) ?>
+					<?php locate_template( array( 'forums/forums-loop.php' ), true ); ?>
 
-					</form><!-- #forum-topic-form -->
+				</div>
 
-				<?php else : ?>
+				<?php do_action( 'bp_directory_forums_content' ); ?>
 
-					<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_GROUPS_SLUG . '/create/' ) ) ?></p>
-					</div>
+				<?php wp_nonce_field( 'directory_forums', '_wpnonce-forums-filter' ); ?>
 
-				<?php endif; ?>
+			</form>
 
-			<?php endif; ?>
-		</div><!-- #new-topic-post -->
+			<?php do_action( 'bp_after_directory_forums' ); ?>
 
-		<form action="" method="post" id="forums-directory-form" class="dir-form">
+			<?php do_action( 'bp_before_new_topic_form' ); ?>
 
-			<div class="item-list-tabs">
-				<ul>
-					<li class="selected" id="forums-all"><a href="<?php bp_root_domain() ?>"><?php printf( __( 'All Topics (%s)', 'buddypress' ), bp_get_forum_topic_count() ) ?></a></li>
+			<div id="new-topic-post">
 
-					<?php if ( is_user_logged_in() && bp_get_forum_topic_count_for_user( bp_loggedin_user_id() ) ) : ?>
-						<li id="forums-personal"><a href="<?php echo bp_loggedin_user_domain() . BP_GROUPS_SLUG . '/' ?>"><?php printf( __( 'My Topics (%s)', 'buddypress' ), bp_get_forum_topic_count_for_user( bp_loggedin_user_id() ) ) ?></a></li>
-					<?php endif; ?>
+				<?php if ( is_user_logged_in() ) : ?>
+
+					<?php if ( bp_is_active( 'groups' ) && bp_has_groups( 'user_id=' . bp_loggedin_user_id() . '&type=alphabetical&max=100&per_page=100' ) ) : ?>
+
+						<form action="" method="post" id="forum-topic-form" class="standard-form">
+
+							<?php do_action( 'groups_forum_new_topic_before' ) ?>
+
+							<a name="post-new"></a>
+							<h5><?php _e( 'Create New Topic:', 'buddypress' ); ?></h5>
+
+							<?php do_action( 'template_notices' ); ?>
+
+							<label><?php _e( 'Title:', 'buddypress' ); ?></label>
+							<input type="text" name="topic_title" id="topic_title" value="" />
+
+							<label><?php _e( 'Content:', 'buddypress' ); ?></label>
+							<textarea name="topic_text" id="topic_text"></textarea>
+
+							<label><?php _e( 'Tags (comma separated):', 'buddypress' ); ?></label>
+							<input type="text" name="topic_tags" id="topic_tags" value="" />
 
-					<?php do_action( 'bp_forums_directory_group_types' ) ?>
+							<label><?php _e( 'Post In Group Forum:', 'buddypress' ); ?></label>
+							<select id="topic_group_id" name="topic_group_id">
 
-					<li id="forums-order-select" class="last filter">
+								<option value=""><?php /* translators: no option picked in select box */ _e( '----', 'buddypress' ); ?></option>
 
-						<?php _e( 'Order By:', 'buddypress' ) ?>
-						<select>
-							<option value="active"><?php _e( 'Last Active', 'buddypress' ) ?></option>
-							<option value="popular"><?php _e( 'Most Posts', 'buddypress' ) ?></option>
-							<option value="unreplied"><?php _e( 'Unreplied', 'buddypress' ) ?></option>
+								<?php while ( bp_groups() ) : bp_the_group(); ?>
 
-							<?php do_action( 'bp_forums_directory_order_options' ) ?>
-						</select>
-					</li>
-				</ul>
-			</div>
+									<?php if ( bp_group_is_forum_enabled() && ( is_super_admin() || 'public' == bp_get_group_status() || bp_group_is_member() ) ) : ?>
 
-			<div id="forums-dir-list" class="forums dir-list">
-				<?php locate_template( array( 'forums/forums-loop.php' ), true ) ?>
-			</div>
+										<option value="<?php bp_group_id(); ?>"><?php bp_group_name(); ?></option>
 
-			<?php do_action( 'bp_directory_forums_content' ) ?>
+									<?php endif; ?>
 
-			<?php wp_nonce_field( 'directory_forums', '_wpnonce-forums-filter' ) ?>
+								<?php endwhile; ?>
+
+							</select><!-- #topic_group_id -->
+
+							<?php do_action( 'groups_forum_new_topic_after' ); ?>
+
+							<div class="submit">
+								<input type="submit" name="submit_topic" id="submit" value="<?php _e( 'Post Topic', 'buddypress' ); ?>" />
+								<input type="button" name="submit_topic_cancel" id="submit_topic_cancel" value="<?php _e( 'Cancel', 'buddypress' ); ?>" />
+							</div>
+
+							<?php wp_nonce_field( 'bp_forums_new_topic' ); ?>
+
+						</form><!-- #forum-topic-form -->
+
+					<?php elseif ( bp_is_active( 'groups' ) ) : ?>
+
+						<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>
+
+						</div>
+
+					<?php endif; ?>
+
+				<?php endif; ?>
+			</div><!-- #new-topic-post -->
 
-			<?php do_action( 'bp_after_directory_forums_content' ) ?>
+			<?php do_action( 'bp_after_new_topic_form' ); ?>
 
-		</form>
+			<?php do_action( 'bp_after_directory_forums_content' ); ?>
 
 		</div><!-- .padder -->
 	</div><!-- #content -->
 
-	<?php locate_template( array( 'sidebar.php' ), true ) ?>
+	<?php do_action( 'bp_after_directory_forums_page' ); ?>
 
-<?php get_footer() ?>
\ No newline at end of file
+<?php get_sidebar( 'buddypress' ); ?>
+<?php get_footer( 'buddypress' ); ?>
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 eaed8c9c95feab723baf575d77951be6db531ee9..c1042a26efb6abd9ba056764de319cd67c874fd0 100644
--- a/wp-content/plugins/buddypress/bp-themes/bp-default/functions.php
+++ b/wp-content/plugins/buddypress/bp-themes/bp-default/functions.php
@@ -1,224 +1,531 @@
 <?php
+/**
+ * BP-Default theme functions and definitions
+ *
+ * Sets up the theme and provides some helper functions. Some helper functions
+ * are used in the theme as custom template tags. Others are attached to action and
+ * filter hooks in WordPress and BuddyPress to change core functionality.
+ *
+ * The first function, bp_dtheme_setup(), sets up the theme by registering support
+ * for various features in WordPress, such as post thumbnails and navigation menus, and
+ * for BuddyPress, action buttons and javascript localisation.
+ *
+ * When using a child theme (see http://codex.wordpress.org/Theme_Development, http://codex.wordpress.org/Child_Themes
+ * and http://codex.buddypress.org/theme-development/building-a-buddypress-child-theme/), you can override
+ * certain functions (those wrapped in a function_exists() call) by defining them first in your
+ * child theme's functions.php file. The child theme's functions.php file is included before the
+ * parent theme's file, so the child theme functions would be used.
+ *
+ * Functions that are not pluggable (not wrapped in function_exists()) are instead attached
+ * to a filter or action hook. The hook can be removed by using remove_action() or
+ * remove_filter() and you can attach your own function to the hook.
+ *
+ * For more information on hooks, actions, and filters, see http://codex.wordpress.org/Plugin_API.
+ *
+ * @package BuddyPress
+ * @subpackage BP-Default
+ * @since 1.2
+ */
 
-// Stop the theme from killing WordPress if BuddyPress is not enabled.
-if ( !class_exists( 'BP_Core_User' ) )
-	return false;
+if ( !function_exists( 'bp_is_active' ) )
+	return;
 
-// Register the widget columns
-register_sidebars( 1,
-	array(
-		'name'          => 'Sidebar',
-		'before_widget' => '<div id="%1$s" class="widget %2$s">',
-		'after_widget'  => '</div>',
-		'before_title'  => '<h3 class="widgettitle">',
-		'after_title'   => '</h3>'
-	)
-);
-
-// Load the AJAX functions for the theme
-require_once( TEMPLATEPATH . '/_inc/ajax.php' );
-
-// Load the javascript for the theme
-wp_enqueue_script( 'dtheme-ajax-js', get_template_directory_uri() . '/_inc/global.js', array( 'jquery' ) );
-
-// 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(
-	'my_favs'           => __( 'My Favorites', 'buddypress' ),
-	'accepted'          => __( 'Accepted', 'buddypress' ),
-	'rejected'          => __( 'Rejected', 'buddypress' ),
-	'show_all_comments' => __( 'Show all comments for this thread', 'buddypress' ),
-	'show_all'          => __( 'Show all', 'buddypress' ),
-	'comments'          => __( 'comments', 'buddypress' ),
-	'close'             => __( 'Close', 'buddypress' ),
-	'mention_explain'   => sprintf( __( "%s is a unique identifier for %s that you can type into any message on this site. %s will be sent a notification and a link to your message any time you use it.", 'buddypress' ), '@' . bp_get_displayed_user_username(), bp_get_user_firstname( bp_get_displayed_user_fullname() ), bp_get_user_firstname( bp_get_displayed_user_fullname() ) )
-);
-wp_localize_script( 'dtheme-ajax-js', 'BP_DTheme', $params );
+// If BuddyPress is not activated, switch back to the default WP theme
+if ( !defined( 'BP_VERSION' ) )
+	switch_theme( WP_DEFAULT_THEME, WP_DEFAULT_THEME );
 
 /**
- * Add the JS needed for blog comment replies
+ * Set the content width based on the theme's design and stylesheet.
  *
- * @package BuddyPress Theme
- * @since 1.2
+ * Used to set the width of images and content. Should be equal to the width the theme
+ * is designed for, generally via the style.css stylesheet.
  */
-function bp_dtheme_add_blog_comments_js() {
-	if ( is_singular() ) wp_enqueue_script( 'comment-reply' );
-}
-add_action( 'template_redirect', 'bp_dtheme_add_blog_comments_js' );
+if ( ! isset( $content_width ) )
+	$content_width = 591;
 
+if ( !function_exists( 'bp_dtheme_setup' ) ) :
 /**
- * HTML for outputting blog comments as defined by the WP comment API
+ * Sets up theme defaults and registers support for various WordPress and BuddyPress features.
  *
- * @param mixed $comment Comment record from database
- * @param array $args Arguments from wp_list_comments() call
- * @param int $depth Comment nesting level
- * @see wp_list_comments()
- * @package BuddyPress Theme
- * @since 1.2
+ * Note that this function is hooked into the after_setup_theme hook, which runs
+ * before the init hook. The init hook is too late for some features, such as indicating
+ * support post thumbnails.
+ *
+ * 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
  */
-function bp_dtheme_blog_comments( $comment, $args, $depth ) {
-	$GLOBALS['comment'] = $comment; ?>
+function bp_dtheme_setup() {
+	global $bp;
 
-	<?php if ( 'pingback' == $comment->comment_type ) return false; ?>
+	// Load the AJAX functions for the theme
+	require( TEMPLATEPATH . '/_inc/ajax.php' );
 
-	<li id="comment-<?php comment_ID(); ?>">
-		<div class="comment-avatar-box">
-			<div class="avb">
-				<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' => 50, 'height' => 50, 'email' => $comment->comment_author_email ) ); ?>
-					<?php else : ?>
-						<?php echo get_avatar( $comment, 50 ) ?>
-					<?php endif; ?>
-				</a>
-			</div>
-		</div>
+	// This theme styles the visual editor with editor-style.css to match the theme style.
+	add_editor_style();
 
-		<div class="comment-content">
+	// This theme uses post thumbnails
+	add_theme_support( 'post-thumbnails' );
 
-			<div class="comment-meta">
-				<a href="<?php echo get_comment_author_url() ?>" rel="nofollow"><?php echo get_comment_author(); ?></a> <?php _e( 'said:', 'buddypress' ) ?>
-				<em><?php _e( 'On', 'buddypress' ) ?> <a href="#comment-<?php comment_ID() ?>" title=""><?php comment_date() ?></a></em>
-			</div>
+	// Add default posts and comments RSS feed links to head
+	add_theme_support( 'automatic-feed-links' );
 
-			<?php if ( $comment->comment_approved == '0' ) : ?>
-			 	<em class="moderate"><?php _e('Your comment is awaiting moderation.'); ?></em><br />
-			<?php endif; ?>
+	// Add responsive layout support to bp-default without forcing child
+	// themes to inherit it if they don't want to
+	add_theme_support( 'bp-default-responsive' );
 
-			<?php comment_text() ?>
+	// This theme uses wp_nav_menu() in one location.
+	register_nav_menus( array(
+		'primary' => __( 'Primary Navigation', 'buddypress' ),
+	) );
 
-			<div class="comment-options">
-				<?php echo comment_reply_link( array('depth' => $depth, 'max_depth' => $args['max_depth'] ) ) ?>
-				<?php edit_comment_link( __( 'Edit' ),'','' ); ?>
-			</div>
+	// This theme allows users to set a custom background
+	add_custom_background( 'bp_dtheme_custom_background_style' );
 
-		</div>
-<?php
+	// Add custom header support if allowed
+	if ( !defined( 'BP_DTHEME_DISABLE_CUSTOM_HEADER' ) ) {
+		define( 'HEADER_TEXTCOLOR', 'FFFFFF' );
+
+		// The height and width of your custom header. You can hook into the theme's own filters to change these values.
+		// Add a filter to bp_dtheme_header_image_width and bp_dtheme_header_image_height to change these values.
+		define( 'HEADER_IMAGE_WIDTH',  apply_filters( 'bp_dtheme_header_image_width',  1250 ) );
+		define( 'HEADER_IMAGE_HEIGHT', apply_filters( 'bp_dtheme_header_image_height', 133  ) );
+
+		// We'll be using post thumbnails for custom header images on posts and pages. We want them to be 1250 pixels wide by 133 pixels tall.
+		// Larger images will be auto-cropped to fit, smaller ones will be ignored.
+		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' );
+	}
+
+	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' );
+
+		// Activity button
+		if ( bp_is_active( 'activity' ) )
+			add_action( 'bp_member_header_actions',    'bp_send_public_message_button' );
+
+		// Messages button
+		if ( bp_is_active( 'messages' ) )
+			add_action( 'bp_member_header_actions',    'bp_send_private_message_button' );
+
+		// 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_directory_groups_actions', 'bp_group_join_button' );
+		}
+
+		// Blog button
+		if ( bp_is_active( 'blogs' ) )
+			add_action( 'bp_directory_blogs_actions',  'bp_blogs_visit_blog_button' );
+	}
 }
+add_action( 'after_setup_theme', 'bp_dtheme_setup' );
+endif;
 
+if ( !function_exists( 'bp_dtheme_enqueue_scripts' ) ) :
 /**
- * Filter the dropdown for selecting the page to show on front to include "Activity Stream"
+ * Enqueue theme javascript safely
  *
- * @param string $page_html A list of pages as a dropdown (select list)
- * @see wp_dropdown_pages()
- * @return string
- * @package BuddyPress Theme
- * @since 1.2
+ * @see http://codex.wordpress.org/Function_Reference/wp_enqueue_script
+ * @since 1.5
  */
-function bp_dtheme_wp_pages_filter( $page_html ) {
-	if ( !bp_is_active( 'activity' ) )
-		return $page_html;
+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 );
+
+	// 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(
+		'my_favs'           => __( 'My Favorites', 'buddypress' ),
+		'accepted'          => __( 'Accepted', 'buddypress' ),
+		'rejected'          => __( 'Rejected', 'buddypress' ),
+		'show_all_comments' => __( 'Show all comments for this thread', 'buddypress' ),
+		'show_all'          => __( 'Show all', 'buddypress' ),
+		'comments'          => __( 'comments', 'buddypress' ),
+		'close'             => __( 'Close', 'buddypress' ),
+		'view'              => __( 'View', 'buddypress' ),
+		'mark_as_fav'	    => __( 'Favorite', 'buddypress' ),
+		'remove_fav'	    => __( 'Remove Favorite', 'buddypress' )
+	);
+
+	wp_localize_script( 'dtheme-ajax-js', 'BP_DTheme', $params );
+}
+add_action( 'wp_enqueue_scripts', 'bp_dtheme_enqueue_scripts' );
+endif;
+
+if ( !function_exists( 'bp_dtheme_enqueue_styles' ) ) :
+/**
+ * Enqueue theme CSS safely
+ *
+ * For maximum flexibility, BuddyPress Default's stylesheet is enqueued, using wp_enqueue_style().
+ * If you're building a child theme of bp-default, your stylesheet will also be enqueued,
+ * automatically, as dependent on bp-default's CSS. For this reason, bp-default child themes are
+ * not recommended to include bp-default's stylesheet using @import.
+ *
+ * If you would prefer to use @import, or would like to change the way in which stylesheets are
+ * enqueued, you can override bp_dtheme_enqueue_styles() in your theme's functions.php file.
+ *
+ * @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
+ */
+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 );
+
+	// 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 );
+	}
 
-	if ( 'page_on_front' != substr( $page_html, 14, 13 ) )
-		return $page_html;
+	// Enqueue the main stylesheet
+	wp_enqueue_style( 'bp-default-main' );
 
-	$selected = false;
-	$page_html = str_replace( '</select>', '', $page_html );
+	// 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 );
 
-	if ( bp_dtheme_page_on_front() == 'activity' )
-		$selected = ' selected="selected"';
+	// 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 );
 
-	$page_html .= '<option class="level-0" value="activity"' . $selected . '>' . __( 'Activity Stream', 'buddypress' ) . '</option></select>';
-	return $page_html;
+		if ( is_rtl() )
+			wp_enqueue_style( 'bp-default-responsive-rtl', get_template_directory_uri() . '/_inc/css/responsive-rtl.css', array( 'bp-default-responsive' ), $version );
+	}
 }
-add_filter( 'wp_dropdown_pages', 'bp_dtheme_wp_pages_filter' );
+add_action( 'wp_enqueue_scripts', 'bp_dtheme_enqueue_styles' );
+endif;
 
+if ( !function_exists( 'bp_dtheme_admin_header_style' ) ) :
 /**
- * Hijack the saving of page on front setting to save the activity stream setting
+ * Styles the header image displayed on the Appearance > Header admin panel.
+ *
+ * Referenced via add_custom_image_header() in bp_dtheme_setup().
  *
- * @param $string $oldvalue Previous value of get_option( 'page_on_front' )
- * @param $string $oldvalue New value of get_option( 'page_on_front' )
- * @return string
- * @package BuddyPress Theme
  * @since 1.2
  */
-function bp_dtheme_page_on_front_update( $oldvalue, $newvalue ) {
-	if ( !is_admin() || !is_super_admin() )
-		return false;
-
-	if ( 'activity' == $_POST['page_on_front'] )
-		return 'activity';
-	else
-		return $oldvalue;
+function bp_dtheme_admin_header_style() {
+?>
+	<style type="text/css">
+		#headimg {
+			position: relative;
+			color: #fff;
+			background: url(<?php header_image() ?>);
+			-moz-border-radius-bottomleft: 6px;
+			-webkit-border-bottom-left-radius: 6px;
+			-moz-border-radius-bottomright: 6px;
+			-webkit-border-bottom-right-radius: 6px;
+			margin-bottom: 20px;
+			height: 133px;
+		}
+
+		#headimg h1{
+			position: absolute;
+			bottom: 15px;
+			left: 15px;
+			width: 44%;
+			margin: 0;
+			font-family: Arial, Tahoma, sans-serif;
+		}
+		#headimg h1 a{
+			color:#<?php header_textcolor() ?>;
+			text-decoration: none;
+			border-bottom: none;
+		}
+		#headimg #desc{
+			color:#<?php header_textcolor() ?>;
+			font-size:1em;
+			margin-top:-0.5em;
+		}
+
+		#desc {
+			display: none;
+		}
+
+		<?php if ( 'blank' == get_header_textcolor() ) { ?>
+		#headimg h1, #headimg #desc {
+			display: none;
+		}
+		#headimg h1 a, #headimg #desc {
+			color:#<?php echo HEADER_TEXTCOLOR ?>;
+		}
+		<?php } ?>
+	</style>
+<?php
 }
-add_action( 'pre_update_option_page_on_front', 'bp_dtheme_page_on_front_update', 10, 2 );
+endif;
 
+if ( !function_exists( 'bp_dtheme_custom_background_style' ) ) :
 /**
- * Load the activity stream template if settings allow
+ * The style for the custom background image or colour.
  *
- * @param string $template Absolute path to the page template 
- * @return string
- * @global WP_Query $wp_query WordPress query object
- * @package BuddyPress Theme
- * @since 1.2
+ * Referenced via add_custom_background() in bp_dtheme_setup().
+ *
+ * @see _custom_background_cb()
+ * @since 1.5
  */
-function bp_dtheme_page_on_front_template( $template ) {
-	global $wp_query;
+function bp_dtheme_custom_background_style() {
+	$background = get_background_image();
+	$color = get_background_color();
+	if ( ! $background && ! $color )
+		return;
 
-	if ( empty( $wp_query->post->ID ) )
-		return locate_template( array( 'activity/index.php' ), false );
-	else
-		return $template;
+	$style = $color ? "background-color: #$color;" : '';
+
+	if ( $style && !$background ) {
+		$style .= ' background-image: none;';
+
+	} elseif ( $background ) {
+		$image = " background-image: url('$background');";
+
+		$repeat = get_theme_mod( 'background_repeat', 'repeat' );
+		if ( ! in_array( $repeat, array( 'no-repeat', 'repeat-x', 'repeat-y', 'repeat' ) ) )
+			$repeat = 'repeat';
+		$repeat = " background-repeat: $repeat;";
+
+		$position = get_theme_mod( 'background_position_x', 'left' );
+		if ( ! in_array( $position, array( 'center', 'right', 'left' ) ) )
+			$position = 'left';
+		$position = " background-position: top $position;";
+
+		$attachment = get_theme_mod( 'background_attachment', 'scroll' );
+		if ( ! in_array( $attachment, array( 'fixed', 'scroll' ) ) )
+			$attachment = 'scroll';
+		$attachment = " background-attachment: $attachment;";
+
+		$style .= $image . $repeat . $position . $attachment;
+	}
+?>
+	<style type="text/css">
+		body { <?php echo trim( $style ); ?> }
+	</style>
+<?php
 }
-add_filter( 'page_template', 'bp_dtheme_page_on_front_template' );
+endif;
 
+if ( !function_exists( 'bp_dtheme_header_style' ) ) :
 /**
- * Return the ID of a page set as the home page.
+ * The styles for the post thumbnails / custom page headers.
  *
- * @return false|int ID of page set as the home page
- * @package BuddyPress Theme
+ * Referenced via add_custom_image_header() in bp_dtheme_setup().
+ *
+ * @global WP_Query $post The current WP_Query object for the current post or page
  * @since 1.2
  */
-function bp_dtheme_page_on_front() {
-	if ( 'page' != get_option( 'show_on_front' ) )
-		return false;
+function bp_dtheme_header_style() {
+	global $post;
 
-	return apply_filters( 'bp_dtheme_page_on_front', get_option( 'page_on_front' ) );
+	$header_image = '';
+
+	if ( is_singular() && current_theme_supports( 'post-thumbnails' ) && has_post_thumbnail( $post->ID ) ) {
+		$image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'post-thumbnail' );
+
+		// $src, $width, $height
+		if ( !empty( $image ) && $image[1] >= HEADER_IMAGE_WIDTH )
+			$header_image = $image[0];
+
+	} else {
+		$header_image = get_header_image();
+	}
+?>
+
+	<style type="text/css">
+		<?php if ( !empty( $header_image ) ) : ?>
+			#header { background-image: url(<?php echo $header_image ?>); }
+		<?php endif; ?>
+
+		<?php if ( 'blank' == get_header_textcolor() ) { ?>
+		#header h1, #header #desc { display: none; }
+		<?php } else { ?>
+		#header h1 a, #desc { color:#<?php header_textcolor() ?>; }
+		<?php } ?>
+	</style>
+
+<?php
 }
+endif;
 
+if ( !function_exists( 'bp_dtheme_widgets_init' ) ) :
 /**
- * Force the page ID as a string to stop the get_posts query from kicking up a fuss.
+ * Register widgetised areas, including one sidebar and four widget-ready columns in the footer.
  *
- * @global WP_Query $wp_query WordPress query object
- * @package BuddyPress Theme
- * @since 1.2
+ * 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
  */
-function bp_dtheme_fix_get_posts_on_activity_front() {
-	global $wp_query;
-
-	if ( !empty($wp_query->query_vars['page_id']) && 'activity' == $wp_query->query_vars['page_id'] )
-		$wp_query->query_vars['page_id'] = '"activity"';
+function bp_dtheme_widgets_init() {
+	// Register the widget columns
+	// Area 1, located in the sidebar. Empty by default.
+	register_sidebar( array(
+		'name'          => 'Sidebar',
+		'id'            => 'sidebar-1',
+		'description'   => __( 'The sidebar widget area', 'buddypress' ),
+		'before_widget' => '<div id="%1$s" class="widget %2$s">',
+		'after_widget'  => '</div>',
+		'before_title'  => '<h3 class="widgettitle">',
+		'after_title'   => '</h3>'
+	) );
+
+	// Area 2, located in the footer. Empty by default.
+	register_sidebar( array(
+		'name' => __( 'First Footer Widget Area', 'buddypress' ),
+		'id' => 'first-footer-widget-area',
+		'description' => __( 'The first footer widget area', 'buddypress' ),
+		'before_widget' => '<li id="%1$s" class="widget %2$s">',
+		'after_widget' => '</li>',
+		'before_title' => '<h3 class="widgettitle">',
+		'after_title' => '</h3>',
+	) );
+
+	// Area 3, located in the footer. Empty by default.
+	register_sidebar( array(
+		'name' => __( 'Second Footer Widget Area', 'buddypress' ),
+		'id' => 'second-footer-widget-area',
+		'description' => __( 'The second footer widget area', 'buddypress' ),
+		'before_widget' => '<li id="%1$s" class="widget %2$s">',
+		'after_widget' => '</li>',
+		'before_title' => '<h3 class="widgettitle">',
+		'after_title' => '</h3>',
+	) );
+
+	// Area 4, located in the footer. Empty by default.
+	register_sidebar( array(
+		'name' => __( 'Third Footer Widget Area', 'buddypress' ),
+		'id' => 'third-footer-widget-area',
+		'description' => __( 'The third footer widget area', 'buddypress' ),
+		'before_widget' => '<li id="%1$s" class="widget %2$s">',
+		'after_widget' => '</li>',
+		'before_title' => '<h3 class="widgettitle">',
+		'after_title' => '</h3>',
+	) );
+
+	// Area 5, located in the footer. Empty by default.
+	register_sidebar( array(
+		'name' => __( 'Fourth Footer Widget Area', 'buddypress' ),
+		'id' => 'fourth-footer-widget-area',
+		'description' => __( 'The fourth footer widget area', 'buddypress' ),
+		'before_widget' => '<li id="%1$s" class="widget %2$s">',
+		'after_widget' => '</li>',
+		'before_title' => '<h3 class="widgettitle">',
+		'after_title' => '</h3>',
+	) );
 }
-add_action( 'pre_get_posts', 'bp_dtheme_fix_get_posts_on_activity_front' );
+add_action( 'widgets_init', 'bp_dtheme_widgets_init' );
+endif;
 
+if ( !function_exists( 'bp_dtheme_blog_comments' ) ) :
 /**
- * WP 3.0 requires there to be a non-null post in the posts array
+ * Template for comments and pingbacks.
  *
- * @param array $posts Posts as retrieved by WP_Query
- * @global WP_Query $wp_query WordPress query object
- * @return array
- * @package BuddyPress Theme
- * @since 1.2.5
+ * To override this walker in a child theme without modifying the comments template
+ * simply create your own bp_dtheme_blog_comments(), and that function will be used instead.
+ *
+ * Used as a callback by wp_list_comments() for displaying the comments.
+ *
+ * @param mixed $comment Comment record from database
+ * @param array $args Arguments from wp_list_comments() call
+ * @param int $depth Comment nesting level
+ * @see wp_list_comments()
+ * @since 1.2
  */
-function bp_dtheme_fix_the_posts_on_activity_front( $posts ) {
-	global $wp_query;
+function bp_dtheme_blog_comments( $comment, $args, $depth ) {
+	$GLOBALS['comment'] = $comment;
+
+	if ( 'pingback' == $comment->comment_type )
+		return false;
+
+	if ( 1 == $depth )
+		$avatar_size = 50;
+	else
+		$avatar_size = 25;
+	?>
 
-	// NOTE: the double quotes around '"activity"' are thanks to our previous function bp_dtheme_fix_get_posts_on_activity_front()
-	if ( empty( $posts ) && !empty( $wp_query->query_vars['page_id'] ) && '"activity"' == $wp_query->query_vars['page_id'] )
-		$posts = array( (object) array( 'ID' => 'activity' ) );
+	<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">
+					<?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 else : ?>
+						<?php echo get_avatar( $comment, $avatar_size ) ?>
+					<?php endif; ?>
+				</a>
+			</div>
+		</div>
 
-	return $posts;
+		<div class="comment-content">
+			<div class="comment-meta">
+				<p>
+					<?php
+						/* translators: 1: comment author url, 2: comment author name, 3: comment permalink, 4: comment date/timestamp*/
+						printf( __( '<a href="%1$s" rel="nofollow">%2$s</a> said on <a href="%3$s"><span class="time-since">%4$s</span></a>', 'buddypress' ), get_comment_author_url(), get_comment_author(), get_comment_link(), get_comment_date() );
+					?>
+				</p>
+			</div>
+
+			<div class="comment-entry">
+				<?php if ( $comment->comment_approved == '0' ) : ?>
+				 	<em class="moderate"><?php _e( 'Your comment is awaiting moderation.', 'buddypress' ); ?></em>
+				<?php endif; ?>
+
+				<?php comment_text() ?>
+			</div>
+
+			<div class="comment-options">
+					<?php if ( comments_open() ) : ?>
+						<?php comment_reply_link( array( 'depth' => $depth, 'max_depth' => $args['max_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 endif; ?>
+
+			</div>
+
+		</div>
+
+<?php
 }
-add_filter( 'the_posts', 'bp_dtheme_fix_the_posts_on_activity_front' );
+endif;
 
+if ( !function_exists( 'bp_dtheme_page_on_front' ) ) :
 /**
- * bp_dtheme_activity_secondary_avatars()
+ * Return the ID of a page set as the home page.
  *
- * Add secondary avatar image to this activity stream's record, if supported
+ * @return false|int ID of page set as the home page
+ * @since 1.2
+ */
+function bp_dtheme_page_on_front() {
+	if ( 'page' != get_option( 'show_on_front' ) )
+		return false;
+
+	return apply_filters( 'bp_dtheme_page_on_front', get_option( 'page_on_front' ) );
+}
+endif;
+
+if ( !function_exists( 'bp_dtheme_activity_secondary_avatars' ) ) :
+/**
+ * Add secondary avatar image to this activity stream's record, if supported.
  *
  * @param string $action The text of this activity
  * @param BP_Activity_Activity $activity Activity object
- * @return string
  * @package BuddyPress Theme
+ * @return string
  * @since 1.2.6
  */
 function bp_dtheme_activity_secondary_avatars( $action, $activity ) {
@@ -237,124 +544,237 @@ function bp_dtheme_activity_secondary_avatars( $action, $activity ) {
 	return $action;
 }
 add_filter( 'bp_get_activity_action_pre_meta', 'bp_dtheme_activity_secondary_avatars', 10, 2 );
+endif;
 
+if ( !function_exists( 'bp_dtheme_show_notice' ) ) :
 /**
- * Custom header image support. You can remove this entirely in a child theme by adding this line
- * to your functions.php: define( 'BP_DTHEME_DISABLE_CUSTOM_HEADER', true );
+ * Show a notice when the theme is activated - workaround by Ozh (http://old.nabble.com/Activation-hook-exist-for-themes--td25211004.html)
  *
- * @package BuddyPress Theme
  * @since 1.2
  */
-function bp_dtheme_add_custom_header_support() {
-	// Set the defaults for the custom header image (http://ryan.boren.me/2007/01/07/custom-image-header-api/)
-	define( 'HEADER_TEXTCOLOR', 'FFFFFF' );
-	define( 'HEADER_IMAGE', '%s/_inc/images/default_header.jpg' ); // %s is theme dir uri
-	define( 'HEADER_IMAGE_WIDTH', 1250 );
-	define( 'HEADER_IMAGE_HEIGHT', 125 );
-
-	function bp_dtheme_header_style() { ?>
-		<style type="text/css">
-			#header { background-image: url(<?php header_image() ?>); }
-			<?php if ( 'blank' == get_header_textcolor() ) { ?>
-			#header h1, #header #desc { display: none; }
-			<?php } else { ?>
-			#header h1 a, #desc { color:#<?php header_textcolor() ?>; }
-			<?php } ?>
-		</style>
-	<?php
-	}
+function bp_dtheme_show_notice() {
+	global $pagenow;
 
-	function bp_dtheme_admin_header_style() { ?>
-		<style type="text/css">
-			#headimg {
-				position: relative;
-				color: #fff;
-				background: url(<?php header_image() ?>);
-				-moz-border-radius-bottomleft: 6px;
-				-webkit-border-bottom-left-radius: 6px;
-				-moz-border-radius-bottomright: 6px;
-				-webkit-border-bottom-right-radius: 6px;
-				margin-bottom: 20px;
-				height: 100px;
-				padding-top: 25px;
-			}
+	// Bail if bp-default theme was not just activated
+	if ( empty( $_GET['activated'] ) || ( 'themes.php' != $pagenow ) || !is_admin() )
+		return;
 
-			#headimg h1{
-				position: absolute;
-				bottom: 15px;
-				left: 15px;
-				width: 44%;
-				margin: 0;
-				font-family: Arial, Tahoma, sans-serif;
-			}
-			#headimg h1 a{
-				color:#<?php header_textcolor() ?>;
-				text-decoration: none;
-				border-bottom: none;
-			}
-			#headimg #desc{
-				color:#<?php header_textcolor() ?>;
-				font-size:1em;
-				margin-top:-0.5em;
-			}
+	?>
 
-			#desc {
-				display: none;
-			}
+	<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>
+	</div>
+
+	<style type="text/css">#message2, #message0 { display: none; }</style>
 
-			<?php if ( 'blank' == get_header_textcolor() ) { ?>
-			#headimg h1, #headimg #desc {
-				display: none;
-			}
-			#headimg h1 a, #headimg #desc {
-				color:#<?php echo HEADER_TEXTCOLOR ?>;
-			}
-			<?php } ?>
-		</style>
 	<?php
-	}
-	add_custom_image_header( 'bp_dtheme_header_style', 'bp_dtheme_admin_header_style' );
 }
-if ( !defined( 'BP_DTHEME_DISABLE_CUSTOM_HEADER' ) )
-	add_action( 'init', 'bp_dtheme_add_custom_header_support' );
+add_action( 'admin_notices', 'bp_dtheme_show_notice' );
+endif;
 
+if ( !function_exists( 'bp_dtheme_main_nav' ) ) :
 /**
- * Show a notice when the theme is activated - workaround by Ozh (http://old.nabble.com/Activation-hook-exist-for-themes--td25211004.html)
+ * wp_nav_menu() callback from the main navigation in header.php
  *
- * @package BuddyPress Theme
- * @since 1.2
+ * 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
  */
-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>
+function bp_dtheme_main_nav( $args ) {
+	global $bp;
+
+	$pages_args = array(
+		'depth'      => 0,
+		'echo'       => false,
+		'exclude'    => '',
+		'title_li'   => ''
+	);
+	$menu = wp_page_menu( $pages_args );
+	$menu = str_replace( array( '<div class="menu"><ul>', '</ul></div>' ), array( '<ul id="nav">', '</ul><!-- #nav -->' ), $menu );
+	echo $menu;
+
+	do_action( 'bp_nav_items' );
+}
+endif;
+
+if ( !function_exists( 'bp_dtheme_page_menu_args' ) ) :
+/**
+ * Get our wp_nav_menu() fallback, bp_dtheme_main_nav(), to show a home link.
+ *
+ * @param array $args Default values for wp_page_menu()
+ * @see wp_page_menu()
+ * @since 1.5
+ */
+function bp_dtheme_page_menu_args( $args ) {
+	$args['show_home'] = true;
+	return $args;
+}
+add_filter( 'wp_page_menu_args', 'bp_dtheme_page_menu_args' );
+endif;
+
+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
+ */
+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(
+		'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> ' .
+		            '<input id="email" name="email" type="text" value="' . esc_attr(  $commenter['comment_author_email'] ) . '" size="30"' . $aria_req . ' /></p>',
+		'url'    => '<p class="comment-form-url"><label for="url">' . __( 'Website', 'buddypress' ) . '</label>' .
+		            '<input id="url" name="url" type="text" value="' . esc_attr( $commenter['comment_author_url'] ) . '" size="30" /></p>',
+	);
+
+	$new_labels = array(
+		'comment_field'  => '<p class="form-textarea"><textarea name="comment" id="comment" cols="60" rows="10" aria-required="true"></textarea></p>',
+		'fields'         => apply_filters( 'comment_form_default_fields', $fields ),
+		'logged_in_as'   => '',
+		'must_log_in'    => '<p class="alert">' . sprintf( __( 'You must be <a href="%1$s">logged in</a> to post a comment.', 'buddypress' ), wp_login_url( get_permalink() ) )	. '</p>',
+		'title_reply'    => __( 'Leave a reply', 'buddypress' )
+	);
+
+	return apply_filters( 'bp_dtheme_comment_form', array_merge( $default_labels, $new_labels ) );
+}
+add_filter( 'comment_form_defaults', 'bp_dtheme_comment_form', 10 );
+endif;
+
+if ( !function_exists( 'bp_dtheme_before_comment_form' ) ) :
+/**
+ * Adds the user's avatar before the comment form box.
+ *
+ * The 'comment_form_top' action is used to insert our HTML within <div id="reply">
+ * so that the nested comments comment-reply javascript moves the entirety of the comment reply area.
+ *
+ * @see comment_form()
+ * @since 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>
+			<?php else : ?>
+				<?php echo get_avatar( 0, 50 ) ?>
+			<?php endif; ?>
+		</div>
 	</div>
 
-	<style type="text/css">#message2, #message0 { display: none; }</style>
-	<?php
+	<div class="comment-content standard-form">
+<?php
 }
-if ( is_admin() && isset($_GET['activated'] ) && $pagenow == "themes.php" )
-	add_action( 'admin_notices', 'bp_dtheme_show_notice' );
+add_action( 'comment_form_top', 'bp_dtheme_before_comment_form' );
+endif;
 
+if ( !function_exists( 'bp_dtheme_after_comment_form' ) ) :
+/**
+ * Closes tags opened in bp_dtheme_before_comment_form().
+ *
+ * @see bp_dtheme_before_comment_form()
+ * @see comment_form()
+ * @since 1.5
+ */
+function bp_dtheme_after_comment_form() {
+?>
+
+	</div><!-- .comment-content standard-form -->
 
-// Member Buttons
-if ( bp_is_active( 'friends' ) )
-	add_action( 'bp_member_header_actions',    'bp_add_friend_button' );
+<?php
+}
+add_action( 'comment_form', 'bp_dtheme_after_comment_form' );
+endif;
 
-if ( bp_is_active( 'activity' ) )
-	add_action( 'bp_member_header_actions',    'bp_send_public_message_button' );
+if ( !function_exists( 'bp_dtheme_sidebar_login_redirect_to' ) ) :
+/**
+ * Adds a hidden "redirect_to" input field to the sidebar login form.
+ *
+ * @since 1.5
+ */
+function bp_dtheme_sidebar_login_redirect_to() {
+	$redirect_to = apply_filters( 'bp_no_access_redirect', !empty( $_REQUEST['redirect_to'] ) ? $_REQUEST['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' );
+endif;
+
+if ( !function_exists( 'bp_dtheme_content_nav' ) ) :
+/**
+ * Display navigation to next/previous pages when applicable
+ *
+ * @global unknown $wp_query
+ * @param string $nav_id DOM ID for this navigation
+ * @since 1.5
+ */
+function bp_dtheme_content_nav( $nav_id ) {
+	global $wp_query;
 
-if ( bp_is_active( 'messages' ) )
-	add_action( 'bp_member_header_actions',    'bp_send_private_message_button' );
+	if ( $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;
 
-// 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_directory_groups_actions', 'bp_group_join_button' );
+/**
+ * Adds the no-js class to the body tag.
+ *
+ * This function ensures that the <body> element will have the 'no-js' class by default. If you're
+ * using JavaScript for some visual functionality in your theme, and you want to provide noscript
+ * support, apply those styles to body.no-js.
+ *
+ * The no-js class is removed by the JavaScript created in bp_dtheme_remove_nojs_body_class().
+ *
+ * @package BuddyPress
+ * @since 1.5.1
+ * @see bp_dtheme_remove_nojs_body_class()
+ */
+function bp_dtheme_add_nojs_body_class( $classes ) {
+	$classes[] = 'no-js';
+	return array_unique( $classes );
 }
+add_filter( 'bp_get_the_body_class', 'bp_dtheme_add_nojs_body_class' );
 
-// Blog Buttons
-if ( bp_is_active( 'blogs' ) )
-	add_action( 'bp_directory_blogs_actions',  'bp_blogs_visit_blog_button' );
+/**
+ * Dynamically removes the no-js class from the <body> element.
+ *
+ * By default, the no-js class is added to the body (see bp_dtheme_add_no_js_body_class()). The
+ * JavaScript in this function is loaded into the <body> element immediately after the <body> tag
+ * (note that it's hooked to bp_before_header), and uses JavaScript to switch the 'no-js' body class
+ * to 'js'. If your theme has styles that should only apply for JavaScript-enabled users, apply them
+ * to body.js.
+ *
+ * This technique is borrowed from WordPress, wp-admin/admin-header.php.
+ *
+ * @package BuddyPress
+ * @since 1.5.1
+ * @see bp_dtheme_add_nojs_body_class()
+ */
+function bp_dtheme_remove_nojs_body_class() {
+?><script type="text/javascript">//<![CDATA[
+(function(){var c=document.body.className;c=c.replace(/no-js/,'js');document.body.className=c;})();
+//]]></script>
+<?php
+}
+add_action( 'bp_before_header', '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 b795a942e8e3f8530765446494c9ca49c7cf0b8a..84cefe5cc124dd0f50b11f9f694a887fcb04a13d 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
@@ -1,20 +1,33 @@
-<?php get_header() ?>
+<?php
+
+/**
+ * BuddyPress - Create Group
+ *
+ * @package BuddyPress
+ * @subpackage bp-default
+ */
+
+?>
+
+<?php get_header( 'buddypress' ); ?>
 
 	<div id="content">
 		<div class="padder">
 
-		<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 bp_get_root_domain() . '/' . BP_GROUPS_SLUG . '/' ?>"><?php _e( 'Groups Directory', 'buddypress' ) ?></a></h3>
+		<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>
 
-			<?php do_action( 'bp_before_create_group' ) ?>
+			<?php do_action( 'bp_before_create_group' ); ?>
 
-			<div class="item-list-tabs no-ajax" id="group-create-tabs">
+			<div class="item-list-tabs no-ajax" id="group-create-tabs" role="navigation">
 				<ul>
+
 					<?php bp_group_creation_tabs(); ?>
+
 				</ul>
 			</div>
 
-			<?php do_action( 'template_notices' ) ?>
+			<?php do_action( 'template_notices' ); ?>
 
 			<div class="item-body" id="group-create-body">
 
@@ -23,15 +36,17 @@
 
 					<?php do_action( 'bp_before_group_details_creation_step' ); ?>
 
-					<label for="group-name"><?php _e('* Group Name', 'buddypress') ?> <?php _e( '(required)', 'buddypress' )?></label>
-					<input type="text" name="group-name" id="group-name" value="<?php bp_new_group_name() ?>" />
+					<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', 'buddypress') ?> <?php _e( '(required)', 'buddypress' )?></label>
-					<textarea name="group-desc" id="group-desc"><?php bp_new_group_description() ?></textarea>
+					<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 do_action( 'bp_after_group_details_creation_step' ); /* Deprecated -> */ do_action( 'groups_custom_group_fields_editable' ); ?>
+					<?php
+					do_action( 'bp_after_group_details_creation_step' );
+					do_action( 'groups_custom_group_fields_editable' ); // @Deprecated
 
-					<?php wp_nonce_field( 'groups_create_save_group-details' ) ?>
+					wp_nonce_field( 'groups_create_save_group-details' ); ?>
 
 				<?php endif; ?>
 
@@ -40,22 +55,20 @@
 
 					<?php do_action( 'bp_before_group_settings_creation_step' ); ?>
 
-					<?php if ( function_exists('bp_wire_install') ) : ?>
-					<div class="checkbox">
-						<label><input type="checkbox" name="group-show-wire" id="group-show-wire" value="1"<?php if ( bp_get_new_group_enable_wire() ) { ?> checked="checked"<?php } ?> /> <?php _e('Enable comment wire', 'buddypress') ?></label>
-					</div>
-					<?php endif; ?>
-
-					<?php if ( function_exists('bp_forums_is_installed_correctly') ) : ?>
+					<?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 if ( bp_get_new_group_enable_forum() ) { ?> checked="checked"<?php } ?> /> <?php _e('Enable discussion forum', 'buddypress') ?></label>
+								<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>
+									<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; ?>
@@ -66,36 +79,61 @@
 
 					<div class="radio">
 						<label><input type="radio" name="group-status" value="public"<?php if ( 'public' == bp_get_new_group_status() || !bp_get_new_group_status() ) { ?> checked="checked"<?php } ?> />
-							<strong><?php _e( 'This is a public group', 'buddypress' ) ?></strong>
+							<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 if ( 'private' == bp_get_new_group_status() ) { ?> checked="checked"<?php } ?> />
-							<strong><?php _e( 'This is a private group', 'buddypress' ) ?></strong>
+							<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 if ( 'hidden' == bp_get_new_group_status() ) { ?> checked="checked"<?php } ?> />
-							<strong><?php _e('This is a hidden group', 'buddypress') ?></strong>
+							<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>
 
+					<hr />
+
+					<h4><?php _e( 'Group Invitations', 'buddypress' ); ?></h4>
+
+					<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>
+						</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>
+						</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>
+						</label>
+					</div>
+
+					<hr />
+
 					<?php do_action( 'bp_after_group_settings_creation_step' ); ?>
 
-					<?php wp_nonce_field( 'groups_create_save_group-settings' ) ?>
+					<?php wp_nonce_field( 'groups_create_save_group-settings' ); ?>
 
 				<?php endif; ?>
 
@@ -104,39 +142,41 @@
 
 					<?php do_action( 'bp_before_group_avatar_creation_step' ); ?>
 
-					<?php if ( !bp_get_avatar_admin_step() ) : ?>
+					<?php if ( 'upload-image' == bp_get_avatar_admin_step() ) : ?>
 
 						<div class="left-menu">
-							<?php bp_new_group_avatar() ?>
+
+							<?php bp_new_group_avatar(); ?>
+
 						</div><!-- .left-menu -->
 
 						<div class="main-column">
-							<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>
 
-							<p><?php _e( 'To skip the avatar upload process, hit the "Next Step" button.', 'buddypress' ) ?></p>
+							<p><?php _e( 'To skip the avatar upload process, hit the "Next Step" button.', 'buddypress' ); ?></p>
 						</div><!-- .main-column -->
 
 					<?php endif; ?>
 
 					<?php if ( 'crop-image' == bp_get_avatar_admin_step() ) : ?>
 
-						<h3><?php _e( 'Crop Group Avatar', 'buddypress' ) ?></h3>
+						<h3><?php _e( 'Crop Group 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" name="upload" id="upload" />
 						<input type="hidden" id="x" name="x" />
 						<input type="hidden" id="y" name="y" />
@@ -147,7 +187,7 @@
 
 					<?php do_action( 'bp_after_group_avatar_creation_step' ); ?>
 
-					<?php wp_nonce_field( 'groups_create_save_group-avatar' ) ?>
+					<?php wp_nonce_field( 'groups_create_save_group-avatar' ); ?>
 
 				<?php endif; ?>
 
@@ -156,15 +196,16 @@
 
 					<?php do_action( 'bp_before_group_invites_creation_step' ); ?>
 
-					<?php if ( function_exists( 'bp_get_total_friend_count' ) && bp_get_total_friend_count( bp_loggedin_user_id() ) ) : ?>
+					<?php if ( bp_is_active( 'friends' ) && bp_get_total_friend_count( bp_loggedin_user_id() ) ) : ?>
+
 						<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 -->
@@ -176,26 +217,30 @@
 							</div>
 
 							<?php /* The ID 'friend-list' is important for AJAX support. */ ?>
-							<ul id="friend-list" class="item-list">
+							<ul id="friend-list" class="item-list" role="main">
+
 							<?php if ( bp_group_has_invites() ) : ?>
 
 								<?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>
 
 										<div class="action">
-											<a class="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="remove" href="<?php bp_group_invite_user_remove_invite_url(); ?>" id="<?php bp_group_invite_item_id(); ?>"><?php _e( 'Remove Invite', 'buddypress' ); ?></a>
 										</div>
 									</li>
 
 								<?php endwhile; ?>
 
-								<?php wp_nonce_field( 'groups_send_invites', '_wpnonce_send_invites' ) ?>
+								<?php wp_nonce_field( 'groups_send_invites', '_wpnonce_send_invites' ); ?>
+
 							<?php endif; ?>
+
 							</ul>
 
 						</div><!-- .main-column -->
@@ -208,55 +253,66 @@
 
 					<?php endif; ?>
 
-					<?php wp_nonce_field( 'groups_create_save_group-invites' ) ?>
+					<?php wp_nonce_field( 'groups_create_save_group-invites' ); ?>
+
 					<?php do_action( 'bp_after_group_invites_creation_step' ); ?>
 
 				<?php endif; ?>
 
-				<?php do_action( 'groups_custom_create_steps' ) // Allow plugins to add custom group creation steps ?>
+				<?php do_action( 'groups_custom_create_steps' ); // Allow plugins to add custom group creation steps ?>
 
 				<?php do_action( 'bp_before_group_creation_step_buttons' ); ?>
 
 				<?php if ( 'crop-image' != bp_get_avatar_admin_step() ) : ?>
+
 					<div class="submit" id="previous-next">
+
 						<?php /* Previous Button */ ?>
 						<?php if ( !bp_is_first_group_creation_step() ) : ?>
-							<input type="button" value="&larr; <?php _e('Previous Step', 'buddypress') ?>" id="group-creation-previous" name="previous" onclick="location.href='<?php bp_group_creation_previous_link() ?>'" />
+
+							<input type="button" value="<?php _e( 'Back to Previous Step', 'buddypress' ); ?>" id="group-creation-previous" name="previous" onclick="location.href='<?php bp_group_creation_previous_link(); ?>'" />
+
 						<?php endif; ?>
 
 						<?php /* Next Button */ ?>
 						<?php if ( !bp_is_last_group_creation_step() && !bp_is_first_group_creation_step() ) : ?>
-							<input type="submit" value="<?php _e('Next Step', 'buddypress') ?> &rarr;" id="group-creation-next" name="save" />
+
+							<input type="submit" value="<?php _e( 'Next Step', 'buddypress' ); ?>" id="group-creation-next" name="save" />
+
 						<?php endif;?>
 
 						<?php /* Create Button */ ?>
 						<?php if ( bp_is_first_group_creation_step() ) : ?>
-							<input type="submit" value="<?php _e('Create Group and Continue', 'buddypress') ?> &rarr;" id="group-creation-create" name="save" />
+
+							<input type="submit" value="<?php _e( 'Create Group and Continue', 'buddypress' ); ?>" id="group-creation-create" name="save" />
+
 						<?php endif; ?>
 
 						<?php /* Finish Button */ ?>
 						<?php if ( bp_is_last_group_creation_step() ) : ?>
-							<input type="submit" value="<?php _e('Finish', 'buddypress') ?> &rarr;" id="group-creation-finish" name="save" />
+
+							<input type="submit" value="<?php _e( 'Finish', 'buddypress' ); ?>" id="group-creation-finish" name="save" />
+
 						<?php endif; ?>
 					</div>
+
 				<?php endif;?>
 
 				<?php do_action( 'bp_after_group_creation_step_buttons' ); ?>
 
 				<?php /* Don't leave out this hidden field */ ?>
-				<input type="hidden" name="group_id" id="group_id" value="<?php bp_new_group_id() ?>" />
+				<input type="hidden" name="group_id" id="group_id" value="<?php bp_new_group_id(); ?>" />
 
-				<?php do_action( 'bp_directory_groups_content' ) ?>
+				<?php do_action( 'bp_directory_groups_content' ); ?>
 
 			</div><!-- .item-body -->
 
-			<?php do_action( 'bp_after_create_group' ) ?>
+			<?php do_action( 'bp_after_create_group' ); ?>
 
 		</form>
 
 		</div><!-- .padder -->
 	</div><!-- #content -->
 
-	<?php locate_template( array( 'sidebar.php' ), true ) ?>
-
-<?php get_footer() ?>
+<?php get_sidebar( 'buddypress' ); ?>
+<?php get_footer( 'buddypress' ); ?>
diff --git a/wp-content/plugins/buddypress/bp-themes/bp-default/groups/groups-loop.php b/wp-content/plugins/buddypress/bp-themes/bp-default/groups/groups-loop.php
index c846d1b666e6a71673bf59cc0a0c43a4b93d5095..7059eb98629ff9111dd6f8d46e0535e3c279e9d2 100644
--- a/wp-content/plugins/buddypress/bp-themes/bp-default/groups/groups-loop.php
+++ b/wp-content/plugins/buddypress/bp-themes/bp-default/groups/groups-loop.php
@@ -1,48 +1,64 @@
-<?php /* Querystring is set via AJAX in _inc/ajax.php - bp_dtheme_object_filter() */ ?>
+<?php
 
-<?php do_action( 'bp_before_groups_loop' ) ?>
+/**
+ * BuddyPress - Groups Loop
+ *
+ * Querystring is set via AJAX in _inc/ajax.php - bp_dtheme_object_filter()
+ *
+ * @package BuddyPress
+ * @subpackage bp-default
+ */
+
+?>
+
+<?php do_action( 'bp_before_groups_loop' ); ?>
 
 <?php if ( bp_has_groups( bp_ajax_querystring( 'groups' ) ) ) : ?>
 
 	<div id="pag-top" class="pagination">
 
 		<div class="pag-count" id="group-dir-count-top">
-			<?php bp_groups_pagination_count() ?>
+
+			<?php bp_groups_pagination_count(); ?>
+
 		</div>
 
 		<div class="pagination-links" id="group-dir-pag-top">
-			<?php bp_groups_pagination_links() ?>
+
+			<?php bp_groups_pagination_links(); ?>
+
 		</div>
 
 	</div>
 
-	<?php do_action( 'bp_before_directory_groups_list' ) ?>
+	<?php do_action( 'bp_before_directory_groups_list' ); ?>
+
+	<ul id="groups-list" class="item-list" role="main">
 
-	<ul id="groups-list" class="item-list">
 	<?php while ( bp_groups() ) : bp_the_group(); ?>
 
 		<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>
 
 			<div class="item">
-				<div class="item-title"><a href="<?php bp_group_permalink() ?>"><?php bp_group_name() ?></a></div>
-				<div class="item-meta"><span class="activity"><?php printf( __( 'active %s ago', 'buddypress' ), bp_get_group_last_active() ) ?></span></div>
+				<div class="item-title"><a href="<?php bp_group_permalink(); ?>"><?php bp_group_name(); ?></a></div>
+				<div class="item-meta"><span class="activity"><?php printf( __( 'active %s', 'buddypress' ), bp_get_group_last_active() ); ?></span></div>
 
-				<div class="item-desc"><?php bp_group_description_excerpt() ?></div>
+				<div class="item-desc"><?php bp_group_description_excerpt(); ?></div>
 
-				<?php do_action( 'bp_directory_groups_item' ) ?>
+				<?php do_action( 'bp_directory_groups_item' ); ?>
 
 			</div>
 
 			<div class="action">
 
-				<?php do_action( 'bp_directory_groups_actions' ) ?>
+				<?php do_action( 'bp_directory_groups_actions' ); ?>
 
 				<div class="meta">
 
-					<?php bp_group_type() ?> / <?php bp_group_member_count() ?>
+					<?php bp_group_type(); ?> / <?php bp_group_member_count(); ?>
 
 				</div>
 
@@ -52,18 +68,23 @@
 		</li>
 
 	<?php endwhile; ?>
+
 	</ul>
 
-	<?php do_action( 'bp_after_directory_groups_list' ) ?>
+	<?php do_action( 'bp_after_directory_groups_list' ); ?>
 
 	<div id="pag-bottom" class="pagination">
 
 		<div class="pag-count" id="group-dir-count-bottom">
-			<?php bp_groups_pagination_count() ?>
+
+			<?php bp_groups_pagination_count(); ?>
+
 		</div>
 
 		<div class="pagination-links" id="group-dir-pag-bottom">
-			<?php bp_groups_pagination_links() ?>
+
+			<?php bp_groups_pagination_links(); ?>
+
 		</div>
 
 	</div>
@@ -71,9 +92,9 @@
 <?php else: ?>
 
 	<div id="message" class="info">
-		<p><?php _e( 'There were no groups found.', 'buddypress' ) ?></p>
+		<p><?php _e( 'There were no groups found.', 'buddypress' ); ?></p>
 	</div>
 
 <?php endif; ?>
 
-<?php do_action( 'bp_after_groups_loop' ) ?>
+<?php do_action( 'bp_after_groups_loop' ); ?>
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 64eb9fd34b58e20cc96570f6f728af7afba882f1..7da62e9ce56ed9a86297a3edb59b71d4f23e6795 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
@@ -1,57 +1,94 @@
-<?php get_header() ?>
+<?php
+
+/**
+ * BuddyPress - Groups Directory
+ *
+ * @package BuddyPress
+ * @subpackage bp-default
+ */
+
+?>
+
+<?php get_header( 'buddypress' ); ?>
+
+	<?php do_action( 'bp_before_directory_groups_page' ); ?>
 
 	<div id="content">
 		<div class="padder">
 
+		<?php do_action( 'bp_before_directory_groups' ); ?>
+
 		<form action="" method="post" id="groups-directory-form" class="dir-form">
-			<h3><?php _e( 'Groups Directory', 'buddypress' ) ?><?php if ( is_user_logged_in() ) : ?> &nbsp;<a class="button" href="<?php echo bp_get_root_domain() . '/' . BP_GROUPS_SLUG . '/create/' ?>"><?php _e( 'Create a Group', 'buddypress' ) ?></a><?php endif; ?></h3>
 
-			<?php do_action( 'bp_before_directory_groups_content' ) ?>
+			<h3><?php _e( 'Groups Directory', 'buddypress' ); ?><?php if ( is_user_logged_in() && bp_user_can_create_groups() ) : ?> &nbsp;<a class="button" href="<?php echo trailingslashit( bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/create' ); ?>"><?php _e( 'Create a Group', 'buddypress' ); ?></a><?php endif; ?></h3>
+
+			<?php do_action( 'bp_before_directory_groups_content' ); ?>
+
+			<div id="group-dir-search" class="dir-search" role="search">
 
-			<div id="group-dir-search" class="dir-search">
 				<?php bp_directory_groups_search_form() ?>
+
 			</div><!-- #group-dir-search -->
 
-			<div class="item-list-tabs">
+			<?php do_action( 'template_notices' ); ?>
+
+			<div class="item-list-tabs" role="navigation">
 				<ul>
-					<li class="selected" id="groups-all"><a href="<?php echo bp_get_root_domain() . '/' . BP_GROUPS_SLUG ?>"><?php printf( __( 'All Groups (%s)', 'buddypress' ), bp_get_total_group_count() ) ?></a></li>
+					<li class="selected" id="groups-all"><a href="<?php echo trailingslashit( bp_get_root_domain() . '/' . bp_get_groups_root_slug() ); ?>"><?php printf( __( 'All Groups <span>%s</span>', 'buddypress' ), bp_get_total_group_count() ); ?></a></li>
 
 					<?php if ( is_user_logged_in() && bp_get_total_group_count_for_user( bp_loggedin_user_id() ) ) : ?>
-						<li id="groups-personal"><a href="<?php echo bp_loggedin_user_domain() . BP_GROUPS_SLUG . '/my-groups/' ?>"><?php printf( __( 'My Groups (%s)', 'buddypress' ), bp_get_total_group_count_for_user( bp_loggedin_user_id() ) ) ?></a></li>
+
+						<li id="groups-personal"><a href="<?php echo trailingslashit( bp_loggedin_user_domain() . bp_get_groups_slug() . '/my-groups' ); ?>"><?php printf( __( 'My Groups <span>%s</span>', 'buddypress' ), bp_get_total_group_count_for_user( bp_loggedin_user_id() ) ); ?></a></li>
+
 					<?php endif; ?>
 
-					<?php do_action( 'bp_groups_directory_group_types' ) ?>
+					<?php do_action( 'bp_groups_directory_group_filter' ); ?>
+
+				</ul>
+			</div><!-- .item-list-tabs -->
+
+			<div class="item-list-tabs" id="subnav" role="navigation">
+				<ul>
+
+					<?php do_action( 'bp_groups_directory_group_types' ); ?>
 
 					<li id="groups-order-select" class="last filter">
 
-						<?php _e( 'Order By:', 'buddypress' ) ?>
-						<select>
-							<option value="active"><?php _e( 'Last Active', 'buddypress' ) ?></option>
-							<option value="popular"><?php _e( 'Most Members', 'buddypress' ) ?></option>
-							<option value="newest"><?php _e( 'Newly Created', 'buddypress' ) ?></option>
-							<option value="alphabetical"><?php _e( 'Alphabetical', 'buddypress' ) ?></option>
+						<label for="groups-order-by"><?php _e( 'Order By:', 'buddypress' ); ?></label>
+						<select id="groups-order-by">
+							<option value="active"><?php _e( 'Last Active', 'buddypress' ); ?></option>
+							<option value="popular"><?php _e( 'Most Members', 'buddypress' ); ?></option>
+							<option value="newest"><?php _e( 'Newly Created', 'buddypress' ); ?></option>
+							<option value="alphabetical"><?php _e( 'Alphabetical', 'buddypress' ); ?></option>
+
+							<?php do_action( 'bp_groups_directory_order_options' ); ?>
 
-							<?php do_action( 'bp_groups_directory_order_options' ) ?>
 						</select>
 					</li>
 				</ul>
-			</div><!-- .item-list-tabs -->
+			</div>
 
 			<div id="groups-dir-list" class="groups dir-list">
-				<?php locate_template( array( 'groups/groups-loop.php' ), true ) ?>
+
+				<?php locate_template( array( 'groups/groups-loop.php' ), true ); ?>
+
 			</div><!-- #groups-dir-list -->
 
-			<?php do_action( 'bp_directory_groups_content' ) ?>
+			<?php do_action( 'bp_directory_groups_content' ); ?>
 
-			<?php wp_nonce_field( 'directory_groups', '_wpnonce-groups-filter' ) ?>
+			<?php wp_nonce_field( 'directory_groups', '_wpnonce-groups-filter' ); ?>
+
+			<?php do_action( 'bp_after_directory_groups_content' ); ?>
 
 		</form><!-- #groups-directory-form -->
 
-		<?php do_action( 'bp_after_directory_groups_content' ) ?>
+		<?php do_action( 'bp_after_directory_groups' ); ?>
 
 		</div><!-- .padder -->
 	</div><!-- #content -->
 
-	<?php locate_template( array( 'sidebar.php' ), true ) ?>
+	<?php do_action( 'bp_after_directory_groups_page' ); ?>
+
+<?php get_sidebar( 'buddypress' ); ?>
+<?php get_footer( 'buddypress' ); ?>
 
-<?php get_footer() ?>
\ 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 c8f4c825cc1643071b7e11d7a9b43d2fd2241801..57f30c7f3daa75ccbcfcdc0a0dea24f7f42f8a66 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,20 +1,21 @@
-<div class="item-list-tabs no-ajax" id="subnav">
+<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>
 
 		<?php do_action( 'bp_group_activity_syndication_options' ) ?>
 
 		<li id="activity-filter-select" class="last">
-			<select>
-				<option value="-1"><?php _e( 'No Filter', 'buddypress' ) ?></option>
-				<option value="activity_update"><?php _e( 'Show Updates', 'buddypress' ) ?></option>
+			<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>
 
 				<?php if ( bp_is_active( 'forums' ) ) : ?>
-					<option value="new_forum_topic"><?php _e( 'Show New Forum Topics', 'buddypress' ) ?></option>
-					<option value="new_forum_post"><?php _e( 'Show 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( 'Show New Group Memberships', 'buddypress' ) ?></option>
+				<option value="joined_group"><?php _e( 'Group Memberships', 'buddypress' ) ?></option>
 
 				<?php do_action( 'bp_group_activity_filter_options' ) ?>
 			</select>
@@ -31,7 +32,7 @@
 <?php do_action( 'bp_after_group_activity_post_form' ) ?>
 <?php do_action( 'bp_before_group_activity_content' ) ?>
 
-<div class="activity single-group">
+<div class="activity single-group" role="main">
 	<?php locate_template( array( 'activity/activity-loop.php' ), true ) ?>
 </div><!-- .activity.single-group -->
 
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 b0474c46f8bd421a50a158898675892ab919fbd8..29264175e4114caa9804a7d577dce3700fe3308b 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
@@ -1,10 +1,10 @@
-<div class="item-list-tabs no-ajax" id="subnav">
+<div class="item-list-tabs no-ajax" id="subnav" role="navigation">
 	<ul>
 		<?php bp_group_admin_tabs(); ?>
 	</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">
+<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' ) ?>
 
@@ -13,11 +13,11 @@
 
 	<?php do_action( 'bp_before_group_details_admin' ); ?>
 
-	<label for="group-name">* <?php _e( 'Group Name', 'buddypress' ) ?></label>
-	<input type="text" name="group-name" id="group-name" value="<?php bp_group_name() ?>" />
+	<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" />
 
-	<label for="group-desc">* <?php _e( 'Group Description', 'buddypress' ) ?></label>
-	<textarea name="group-desc" id="group-desc"><?php bp_group_description_editable() ?></textarea>
+	<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>
 
 	<?php do_action( 'groups_custom_group_fields_editable' ) ?>
 
@@ -29,7 +29,7 @@
 
 	<?php do_action( 'bp_after_group_details_admin' ); ?>
 
-	<p><input type="submit" value="<?php _e( 'Save Changes', 'buddypress' ) ?> &rarr;" id="save" name="save" /></p>
+	<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; ?>
@@ -39,15 +39,7 @@
 
 	<?php do_action( 'bp_before_group_settings_admin' ); ?>
 
-	<?php if ( function_exists('bp_wire_install') ) : ?>
-
-		<div class="checkbox">
-			<label><input type="checkbox" name="group-show-wire" id="group-show-wire" value="1"<?php bp_group_show_wire_setting() ?>/> <?php _e( 'Enable comment wire', 'buddypress' ) ?></label>
-		</div>
-
-	<?php endif; ?>
-
-	<?php if ( function_exists('bp_forums_is_installed_correctly') ) : ?>
+	<?php if ( bp_is_active( 'forums' ) ) : ?>
 
 		<?php if ( bp_forums_is_installed_correctly() ) : ?>
 
@@ -55,17 +47,17 @@
 				<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 />
+
 		<?php endif; ?>
 
 	<?php endif; ?>
 
-	<hr />
-
 	<h4><?php _e( 'Privacy Options', 'buddypress' ); ?></h4>
 
 	<div class="radio">
 		<label>
-			<input type="radio" name="group-status" value="public"<?php bp_group_show_status_setting('public') ?> />
+			<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>
@@ -75,7 +67,7 @@
 		</label>
 
 		<label>
-			<input type="radio" name="group-status" value="private"<?php bp_group_show_status_setting('private') ?> />
+			<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>
@@ -85,7 +77,7 @@
 		</label>
 
 		<label>
-			<input type="radio" name="group-status" value="hidden"<?php bp_group_show_status_setting('hidden') ?> />
+			<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>
@@ -95,9 +87,34 @@
 		</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> 
+
+	<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> 
+		</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> 
+		</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> 
+		</label> 
+ 	</div> 
+
+	<hr /> 
+
 	<?php do_action( 'bp_after_group_settings_admin' ); ?>
 
-	<p><input type="submit" value="<?php _e( 'Save Changes', 'buddypress' ) ?> &rarr;" id="save" name="save" /></p>
+	<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; ?>
@@ -155,20 +172,58 @@
 <?php if ( bp_is_group_admin_screen( 'manage-members' ) ) : ?>
 
 	<?php do_action( 'bp_before_group_manage_members_admin' ); ?>
-
+	
 	<div class="bp-widget">
 		<h4><?php _e( 'Administrators', 'buddypress' ); ?></h4>
-		<?php bp_group_admin_memberlist( true ) ?>
-	</div>
 
-	<?php if ( bp_group_has_moderators() ) : ?>
+		<?php if ( bp_has_members( '&include='. bp_group_admin_ids() ) ) : ?>
+		
+		<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' ) ) ) ?>
+				<h5>
+					<a href="<?php bp_member_permalink(); ?>"> <?php bp_member_name(); ?></a>
+					<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>
+					</span>			
+				</h5>		
+			</li>
+			<?php endwhile; ?>
+		
+		</ul>
+		
+		<?php endif; ?>
 
+	</div>
+	
+	<?php if ( bp_group_has_moderators() ) : ?>
 		<div class="bp-widget">
-			<h4><?php _e( 'Moderators', 'buddypress' ) ?></h4>
-			<?php bp_group_mod_memberlist( true ) ?>
+			<h4><?php _e( 'Moderators', 'buddypress' ) ?></h4>		
+			
+			<?php if ( bp_has_members( '&include=' . bp_group_mod_ids() ) ) : ?>
+				<ul id="mods-list" class="item-list">
+				
+					<?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' ) ) ) ?>
+						<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>
+							</span>		
+						</h5>		
+					</li>	
+					<?php endwhile; ?>			
+				
+				</ul>
+			
+			<?php endif; ?>
 		</div>
+	<?php endif ?>
 
-	<?php endif; ?>
 
 	<div class="bp-widget">
 		<h4><?php _e("Members", "buddypress"); ?></h4>
@@ -199,24 +254,24 @@
 
 						<h5>
 							<?php bp_group_member_link() ?>
-							
+
 							<?php if ( bp_get_group_member_is_banned() ) _e( '(banned)', 'buddypress'); ?>
 
-							<span class="small"> - 
-							
+							<span class="small">
+
 							<?php if ( bp_get_group_member_is_banned() ) : ?>
-								
-								<a href="<?php bp_group_member_unban_link() ?>" class="confirm" 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="confirm" 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="confirm" title="<?php _e( 'Promote to Mod', 'buddypress' ); ?>"><?php _e( 'Promote to Mod', 'buddypress' ); ?></a>
-								| <a href="<?php bp_group_member_promote_admin_link() ?>" class="confirm" 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="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' ); ?>
 
@@ -295,16 +350,14 @@
 		<p><?php _e( 'WARNING: Deleting this group will completely remove ALL content associated with it. There is no way back, please be careful with this option.', 'buddypress' ); ?></p>
 	</div>
 
-	<input type="checkbox" name="delete-group-understand" id="delete-group-understand" value="1" onclick="if(this.checked) { document.getElementById('delete-group-button').disabled = ''; } else { document.getElementById('delete-group-button').disabled = 'disabled'; }" /> <?php _e( 'I understand the consequences of deleting this group.', 'buddypress' ); ?>
+	<label><input type="checkbox" name="delete-group-understand" id="delete-group-understand" value="1" onclick="if(this.checked) { document.getElementById('delete-group-button').disabled = ''; } else { document.getElementById('delete-group-button').disabled = 'disabled'; }" /> <?php _e( 'I understand the consequences of deleting this group.', 'buddypress' ); ?></label>
 
 	<?php do_action( 'bp_after_group_delete_admin' ); ?>
 
 	<div class="submit">
-		<input type="submit" disabled="disabled" value="<?php _e( 'Delete Group', 'buddypress' ) ?> &rarr;" 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>
 
-	<input type="hidden" name="group-id" id="group-id" value="<?php bp_group_id() ?>" />
-
 	<?php wp_nonce_field( 'groups_delete_group' ) ?>
 
 <?php endif; ?>
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 8b9212b5943d82a458b34d284a43c316d8696449..f376e2803ea88ad27024b28da50e2c3c1148bcb5 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
@@ -1,15 +1,55 @@
-<?php do_action( 'bp_before_group_forum_content' ) ?>
+<?php
 
-<?php if ( bp_is_group_forum_topic_edit() ) : ?>
-	<?php locate_template( array( 'groups/single/forum/edit.php' ), true ) ?>
+do_action( 'bp_before_group_forum_content' );
 
-<?php elseif ( bp_is_group_forum_topic() ) : ?>
-	<?php locate_template( array( 'groups/single/forum/topic.php' ), true ) ?>
+if ( bp_is_group_forum_topic_edit() ) :
+	locate_template( array( 'groups/single/forum/edit.php' ), true );
 
-<?php else : ?>
+elseif ( bp_is_group_forum_topic() ) :
+	locate_template( array( 'groups/single/forum/topic.php' ), true );
+
+else : ?>
+
+	<div class="item-list-tabs no-ajax" id="subnav" role="navigation">
+		<ul>
+
+			<?php if ( is_user_logged_in() ) : ?>
+
+				<li>
+					<a href="#post-new" class="show-hide-new"><?php _e( 'New Topic', '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; ?>
+
+			<?php do_action( 'bp_forums_directory_group_sub_types' ); ?>
+
+			<li id="forums-order-select" class="last filter">
+
+				<label for="forums-order-by"><?php _e( 'Order By:', 'buddypress' ); ?></label>
+				<select id="forums-order-by">
+					<option value="active"><?php _e( 'Last Active', 'buddypress' ); ?></option>
+					<option value="popular"><?php _e( 'Most Posts', 'buddypress' ); ?></option>
+					<option value="unreplied"><?php _e( 'Unreplied', 'buddypress' ); ?></option>
+
+					<?php do_action( 'bp_forums_directory_order_options' ); ?>
+
+				</select>
+			</li>
+		</ul>
+	</div>
+
+	<div class="forums single-forum" role="main">
 
-	<div class="forums single-forum">
 		<?php locate_template( array( 'forums/forums-loop.php' ), true ) ?>
+
 	</div><!-- .forums.single-forum -->
 
 <?php endif; ?>
@@ -18,10 +58,10 @@
 
 <?php if ( !bp_is_group_forum_topic_edit() && !bp_is_group_forum_topic() ) : ?>
 
-	<?php if ( ( is_user_logged_in() && 'public' == bp_get_group_status() ) || bp_group_is_member() ) : ?>
+	<?php if ( !bp_group_is_user_banned() && ( ( is_user_logged_in() && 'public' == bp_get_group_status() ) || bp_group_is_member() ) ) : ?>
 
 		<form action="" method="post" id="forum-topic-form" class="standard-form">
-			<div id="post-new-topic">
+			<div id="new-topic-post">
 
 				<?php do_action( 'bp_before_group_forum_post_new' ) ?>
 
@@ -48,7 +88,7 @@
 				</div>
 
 				<?php wp_nonce_field( 'bp_forums_new_topic' ) ?>
-			</div><!-- #post-new-topic -->
+			</div><!-- #new-topic-post -->
 		</form><!-- #forum-topic-form -->
 
 	<?php endif; ?>
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 72ea20b613cab71e8416dbde41486f98f4296bf9..1db8ca22312b39c1f0bdc213d15a4e30a70b3b51 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
@@ -1,16 +1,41 @@
-<?php do_action( 'bp_before_group_forum_edit_form' ) ?>
+<?php do_action( 'bp_before_group_forum_edit_form' ); ?>
 
 <?php if ( bp_has_forum_topic_posts() ) : ?>
 
-	<form action="<?php bp_forum_topic_action() ?>" method="post" id="forum-topic-form" class="standard-form">
+	<form action="<?php bp_forum_topic_action(); ?>" method="post" id="forum-topic-form" class="standard-form">
+
+		<div class="item-list-tabs" id="subnav" role="navigation">
+			<ul>
+				<li>
+					<a href="#post-topic-reply"><?php _e( 'Reply', 'buddypress' ); ?></a>
+				</li>
+
+				<?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>
-			<a class="button" href="<?php bp_forum_permalink() ?>/">&larr; <?php _e( 'Group Forum', 'buddypress' ) ?></a> &nbsp; <a class="button" href="<?php bp_forum_directory_permalink() ?>/"><?php _e( 'Group Forum Directory', 'buddypress') ?></a>
+			<h3><?php _e( 'Edit:', 'buddypress' ); ?> <?php bp_the_topic_title(); ?> (<?php bp_the_topic_total_post_count(); ?>)</h3>
 
 			<?php if ( bp_group_is_admin() || bp_group_is_mod() || bp_get_the_topic_is_mine() ) : ?>
-				<div class="admin-links"><?php bp_the_topic_admin_links() ?></div>
+
+				<div class="last admin-links">
+
+					<?php bp_the_topic_admin_links(); ?>
+
+				</div>
+
 			<?php endif; ?>
+
+			<?php do_action( 'bp_group_forum_topic_meta' ); ?>
+
 		</div>
 
 		<?php if ( bp_group_is_member() ) : ?>
@@ -19,21 +44,22 @@
 
 				<div id="edit-topic">
 
-					<?php do_action( 'bp_group_before_edit_forum_topic' ) ?>
+					<?php do_action( 'bp_group_before_edit_forum_topic' ); ?>
 
-					<p><strong><?php _e( 'Edit Topic:', 'buddypress' ) ?></strong></p>
+					<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_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() ?>" />
 
-					<?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>
 
@@ -41,17 +67,15 @@
 
 				<div id="edit-post">
 
-					<?php do_action( 'bp_group_before_edit_forum_post' ) ?>
-
-					<p><strong><?php _e( 'Edit Post:', 'buddypress' ) ?></strong></p>
+					<?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' ) ?>
 
-					<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>
 
@@ -64,9 +88,9 @@
 <?php else: ?>
 
 	<div id="message" class="info">
-		<p><?php _e( 'This topic does not exist.', 'buddypress' ) ?></p>
+		<p><?php _e( 'This topic does not exist.', 'buddypress' ); ?></p>
 	</div>
 
 <?php endif;?>
 
-<?php do_action( 'bp_after_group_forum_edit_form' ) ?>
+<?php do_action( 'bp_after_group_forum_edit_form' ); ?>
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 0f941968b2b6d0545a7558c00427b5e57c7e0bf4..14b7f0b99ed485fc3f15092d11154cdf09cb4087 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,37 +1,76 @@
-<?php do_action( 'bp_before_group_forum_topic' ) ?>
+<?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="pagination no-ajax">
+		<div class="item-list-tabs no-ajax" id="subnav" role="navigation">
+			<ul>
+				<?php if ( is_user_logged_in() ) : ?>
 
-			<div id="post-count" class="pag-count">
-				<?php bp_the_topic_pagination_count() ?>
-			</div>
+					<li>
+						<a href="<?php bp_forum_topic_new_reply_link() ?>" class="new-reply-link"><?php _e( 'New Reply', 'buddypress' ) ?></a>
+					</li>
 
-			<div class="pagination-links" id="topic-pag">
-				<?php bp_the_topic_pagination() ?>
-			</div>
+				<?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>
-			<a class="button" href="<?php bp_forum_permalink() ?>/">&larr; <?php _e( 'Group Forum', 'buddypress' ) ?></a> &nbsp; <a class="button" href="<?php bp_forum_directory_permalink() ?>/"><?php _e( 'Group Forum Directory', 'buddypress') ?></a>
 
-			<div class="admin-links">
-				<?php if ( bp_group_is_admin() || bp_group_is_mod() || bp_get_the_topic_is_mine() ) : ?>
+			<?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() ?>
-				<?php endif; ?>
 
-				<?php do_action( 'bp_group_forum_topic_meta' ); ?>
+				</div>
+
+			<?php endif; ?>
+
+			<?php do_action( 'bp_group_forum_topic_meta' ); ?>
+
+		</div>
+
+		<div class="pagination no-ajax">
+
+			<div id="post-count-top" class="pag-count">
+
+				<?php bp_the_topic_pagination_count() ?>
+
 			</div>
+
+			<div class="pagination-links" id="topic-pag-top">
+
+				<?php bp_the_topic_pagination() ?>
+
+			</div>
+
 		</div>
 
 		<?php do_action( 'bp_before_group_forum_topic_posts' ) ?>
 
-		<ul id="topic-post-list" class="item-list">
+		<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() ?>">
@@ -39,7 +78,7 @@
 						<a href="<?php bp_the_topic_post_poster_link() ?>">
 							<?php bp_the_topic_post_poster_avatar( 'width=40&height=40' ) ?>
 						</a>
-						<?php echo sprintf( __( '%s said %s ago:', '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">
@@ -64,11 +103,11 @@
 
 		<div class="pagination no-ajax">
 
-			<div id="post-count" class="pag-count">
+			<div id="post-count-bottom" class="pag-count">
 				<?php bp_the_topic_pagination_count() ?>
 			</div>
 
-			<div class="pagination-links" id="topic-pag">
+			<div class="pagination-links" id="topic-pag-bottom">
 				<?php bp_the_topic_pagination() ?>
 			</div>
 
@@ -78,7 +117,7 @@
 
 			<?php if ( bp_get_the_topic_is_last_page() ) : ?>
 
-				<?php if ( bp_get_the_topic_is_topic_open() ) : ?>
+				<?php if ( bp_get_the_topic_is_topic_open() && !bp_group_is_user_banned() ) : ?>
 
 					<div id="post-topic-reply">
 						<p id="post-reply"></p>
@@ -102,7 +141,7 @@
 						<?php wp_nonce_field( 'bp_forums_new_reply' ) ?>
 					</div>
 
-				<?php else : ?>
+				<?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>
@@ -115,6 +154,7 @@
 		<?php endif; ?>
 
 	</form><!-- #forum-topic-form -->
+
 <?php else: ?>
 
 	<div id="message" class="info">
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 bb0a1cf7711022d4d84d4a94c172baa150033a98..7d7263cd7dd8ff296464a38e287ed27696074061 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
@@ -1,39 +1,51 @@
-<?php do_action( 'bp_before_group_header' ) ?>
+<?php
+
+do_action( 'bp_before_group_header' );
+
+?>
 
 <div id="item-actions">
+
 	<?php if ( bp_group_is_visible() ) : ?>
 
-		<h3><?php _e( 'Group Admins', 'buddypress' ) ?></h3>
-		<?php bp_group_list_admins() ?>
+		<h3><?php _e( 'Group Admins', 'buddypress' ); ?></h3>
 
-		<?php do_action( 'bp_after_group_menu_admins' ) ?>
+		<?php bp_group_list_admins();
 
-		<?php if ( bp_group_has_moderators() ) : ?>
-			<?php do_action( 'bp_before_group_menu_mods' ) ?>
+		do_action( 'bp_after_group_menu_admins' );
+
+		if ( bp_group_has_moderators() ) :
+			do_action( 'bp_before_group_menu_mods' ); ?>
 
 			<h3><?php _e( 'Group Mods' , 'buddypress' ) ?></h3>
-			<?php bp_group_list_mods() ?>
 
-			<?php do_action( 'bp_after_group_menu_mods' ) ?>
-		<?php endif; ?>
+			<?php bp_group_list_mods();
+
+			do_action( 'bp_after_group_menu_mods' );
+
+		endif;
+
+	endif; ?>
 
-	<?php endif; ?>
 </div><!-- #item-actions -->
 
 <div id="item-header-avatar">
-	<a href="<?php bp_group_permalink() ?>" title="<?php bp_group_name() ?>">
-		<?php bp_group_avatar() ?>
+	<a href="<?php bp_group_permalink(); ?>" title="<?php bp_group_name(); ?>">
+
+		<?php bp_group_avatar(); ?>
+
 	</a>
 </div><!-- #item-header-avatar -->
 
 <div id="item-header-content">
-	<h2><a href="<?php bp_group_permalink() ?>" title="<?php bp_group_name() ?>"><?php bp_group_name() ?></a></h2>
-	<span class="highlight"><?php bp_group_type() ?></span> <span class="activity"><?php printf( __( 'active %s ago', 'buddypress' ), bp_get_group_last_active() ) ?></span>
+	<h2><a href="<?php bp_group_permalink(); ?>" title="<?php bp_group_name(); ?>"><?php bp_group_name(); ?></a></h2>
+	<span class="highlight"><?php bp_group_type(); ?></span> <span class="activity"><?php printf( __( 'active %s', 'buddypress' ), bp_get_group_last_active() ); ?></span>
 
-	<?php do_action( 'bp_before_group_header_meta' ) ?>
+	<?php do_action( 'bp_before_group_header_meta' ); ?>
 
 	<div id="item-meta">
-		<?php bp_group_description() ?>
+
+		<?php bp_group_description(); ?>
 
 		<div id="item-buttons">
 
@@ -41,10 +53,12 @@
 
 		</div><!-- #item-buttons -->
 
-		<?php do_action( 'bp_group_header_meta' ) ?>
+		<?php do_action( 'bp_group_header_meta' ); ?>
+
 	</div>
 </div><!-- #item-header-content -->
 
-<?php do_action( 'bp_after_group_header' ) ?>
-
-<?php do_action( 'template_notices' ) ?>
\ No newline at end of file
+<?php
+do_action( 'bp_after_group_header' );
+do_action( 'template_notices' );
+?>
\ No newline at end of file
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 f8e98ea8534c1cd982886511708fa408c06e213c..b02d55c1357a5ef6fcd8b087c2396fdf6729046b 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
@@ -1,73 +1,82 @@
-<?php get_header() ?>
+<?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_home_content' ) ?>
 
-			<div id="item-header">
-				<?php locate_template( array( 'groups/single/group-header.php' ), true ) ?>
+			<div id="item-header" role="complementary">
+
+				<?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">
+				<div class="item-list-tabs no-ajax" id="object-nav" role="navigation">
 					<ul>
-						<?php bp_get_options_nav() ?>
 
-						<?php do_action( 'bp_group_options_nav' ) ?>
+						<?php bp_get_options_nav(); ?>
+
+						<?php do_action( 'bp_group_options_nav' ); ?>
+
 					</ul>
 				</div>
 			</div><!-- #item-nav -->
 
 			<div id="item-body">
-				<?php do_action( 'bp_before_group_body' ) ?>
 
-				<?php if ( bp_is_group_admin_page() && bp_group_is_visible() ) : ?>
-					<?php locate_template( array( 'groups/single/admin.php' ), true ) ?>
+				<?php do_action( 'bp_before_group_body' );
+
+				if ( bp_is_group_admin_page() && bp_group_is_visible() ) :
+					locate_template( array( 'groups/single/admin.php' ), true );
 
-				<?php elseif ( bp_is_group_members() && bp_group_is_visible() ) : ?>
-					<?php locate_template( array( 'groups/single/members.php' ), true ) ?>
+				elseif ( bp_is_group_members() && bp_group_is_visible() ) :
+					locate_template( array( 'groups/single/members.php' ), true );
 
-				<?php elseif ( bp_is_group_invites() && bp_group_is_visible() ) : ?>
-					<?php locate_template( array( 'groups/single/send-invites.php' ), true ) ?>
+				elseif ( bp_is_group_invites() && bp_group_is_visible() ) :
+					locate_template( array( 'groups/single/send-invites.php' ), true );
 
-				<?php elseif ( bp_is_group_forum() && bp_group_is_visible() ) : ?>
-					<?php locate_template( array( 'groups/single/forum.php' ), true ) ?>
+					elseif ( bp_is_group_forum() && bp_group_is_visible() && bp_is_active( 'forums' ) && bp_forums_is_installed_correctly() ) :
+						locate_template( array( 'groups/single/forum.php' ), true );
 
-				<?php elseif ( bp_is_group_membership_request() ) : ?>
-					<?php locate_template( array( 'groups/single/request-membership.php' ), true ) ?>
+				elseif ( bp_is_group_membership_request() ) :
+					locate_template( array( 'groups/single/request-membership.php' ), true );
 
-				<?php elseif ( bp_group_is_visible() && bp_is_active( 'activity' ) ) : ?>
-					<?php locate_template( array( 'groups/single/activity.php' ), true ) ?>
+				elseif ( bp_group_is_visible() && bp_is_active( 'activity' ) ) :
+					locate_template( array( 'groups/single/activity.php' ), true );
 
-				<?php elseif ( !bp_group_is_visible() ) : ?>
-					<?php /* The group is not visible, show the status message */ ?>
+				elseif ( bp_group_is_visible() ) :
+					locate_template( array( 'groups/single/members.php' ), true );
 
-					<?php do_action( 'bp_before_group_status_message' ) ?>
+				elseif ( !bp_group_is_visible() ) :
+					// The group is not visible, show the status message
+
+					do_action( 'bp_before_group_status_message' ); ?>
 
 					<div id="message" class="info">
-						<p><?php bp_group_status_message() ?></p>
+						<p><?php bp_group_status_message(); ?></p>
 					</div>
 
-					<?php do_action( 'bp_after_group_status_message' ) ?>
+					<?php do_action( 'bp_after_group_status_message' );
+
+				else :
+					// If nothing sticks, just load a group front template if one exists.
+					locate_template( array( 'groups/single/front.php' ), true );
+
+				endif;
 
-				<?php else : ?>
-					<?php
-						/* If nothing sticks, just load a group front template if one exists. */
-						locate_template( array( 'groups/single/front.php' ), true );
-					?>
-				<?php endif; ?>
+				do_action( 'bp_after_group_body' ); ?>
 
-				<?php do_action( 'bp_after_group_body' ) ?>
 			</div><!-- #item-body -->
 
-			<?php do_action( 'bp_after_group_home_content' ) ?>
+			<?php do_action( 'bp_after_group_home_content' ); ?>
 
 			<?php endwhile; endif; ?>
+
 		</div><!-- .padder -->
 	</div><!-- #content -->
 
-	<?php locate_template( array( 'sidebar.php' ), true ) ?>
-
-<?php get_footer() ?>
+<?php get_sidebar( 'buddypress' ); ?>
+<?php get_footer( 'buddypress' ); ?>
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 c1e7d6469384aebd28dfb759acec73381ee15f21..3d9c7f5c6a05a0c7239d8c6d1d1141dd93f87709 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
@@ -1,39 +1,57 @@
 <?php if ( bp_group_has_members( 'exclude_admins_mods=0' ) ) : ?>
 
-	<?php do_action( 'bp_before_group_members_content' ) ?>
+	<?php do_action( 'bp_before_group_members_content' ); ?>
 
-	<div class="pagination no-ajax">
+	<div class="item-list-tabs" id="subnav" role="navigation">
+		<ul>
+
+			<?php do_action( 'bp_members_directory_member_sub_types' ); ?>
+
+		</ul>
+	</div>
+
+	<div id="pag-top" class="pagination no-ajax">
+
+		<div class="pag-count" id="member-count-top">
+
+			<?php bp_members_pagination_count(); ?>
 
-		<div id="member-count" class="pag-count">
-			<?php bp_group_member_pagination_count() ?>
 		</div>
 
-		<div id="member-pagination" class="pagination-links">
-			<?php bp_group_member_pagination() ?>
+		<div class="pagination-links" id="member-pag-top">
+
+			<?php bp_members_pagination_links(); ?>
+
 		</div>
 
 	</div>
 
-	<?php do_action( 'bp_before_group_members_list' ) ?>
+	<?php do_action( 'bp_before_group_members_list' ); ?>
+
+	<ul id="member-list" class="item-list" role="main">
 
-	<ul id="member-list" class="item-list">
 		<?php while ( bp_group_members() ) : bp_group_the_member(); ?>
 
 			<li>
-				<a href="<?php bp_group_member_domain() ?>">
-					<?php bp_group_member_avatar_thumb() ?>
+				<a href="<?php bp_group_member_domain(); ?>">
+
+					<?php bp_group_member_avatar_thumb(); ?>
+
 				</a>
-				<h5><?php bp_group_member_link() ?></h5>
-				<span class="activity"><?php bp_group_member_joined_since() ?></span>
 
-				<?php do_action( 'bp_group_members_list_item' ) ?>
+				<h5><?php bp_group_member_link(); ?></h5>
+				<span class="activity"><?php bp_group_member_joined_since(); ?></span>
+
+				<?php do_action( 'bp_group_members_list_item' ); ?>
 
-				<?php if ( function_exists( 'friends_install' ) ) : ?>
+				<?php if ( bp_is_active( 'friends' ) ) : ?>
 
 					<div class="action">
-						<?php bp_add_friend_button( bp_get_group_member_id(), bp_get_group_member_is_friend() ) ?>
 
-						<?php do_action( 'bp_group_members_list_item_action' ) ?>
+						<?php bp_add_friend_button( bp_get_group_member_id(), bp_get_group_member_is_friend() ); ?>
+
+						<?php do_action( 'bp_group_members_list_item_action' ); ?>
+
 					</div>
 
 				<?php endif; ?>
@@ -43,7 +61,25 @@
 
 	</ul>
 
-	<?php do_action( 'bp_after_group_members_content' ) ?>
+	<?php do_action( 'bp_after_group_members_list' ); ?>
+
+	<div id="pag-bottom" class="pagination">
+
+		<div class="pag-count" id="member-count-bottom">
+
+			<?php bp_members_pagination_count(); ?>
+
+		</div>
+
+		<div class="pagination-links" id="member-pag-bottom">
+
+			<?php bp_members_pagination_links(); ?>
+
+		</div>
+
+	</div>
+
+	<?php do_action( 'bp_after_group_members_content' ); ?>
 
 <?php else: ?>
 
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 693506565076bb0c3552e9041b3fa1c1bc852d46..5579b3421a2b789e46bac32acb69a7500cc5001e 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,4 +1,4 @@
-<?php get_header() ?>
+<?php get_header( 'buddypress' ) ?>
 
 	<div id="content">
 		<div class="padder">
@@ -11,7 +11,7 @@
 			</div><!-- #item-header -->
 
 			<div id="item-nav">
-				<div class="item-list-tabs no-ajax" id="object-nav">
+				<div class="item-list-tabs no-ajax" id="object-nav" role="navigation">
 					<ul>
 						<?php bp_get_options_nav() ?>
 
@@ -29,13 +29,13 @@
 				<?php do_action( 'bp_after_group_body' ) ?>
 			</div><!-- #item-body -->
 
-			<?php endwhile; endif; ?>
-
 			<?php do_action( 'bp_after_group_plugin_template' ) ?>
 
+			<?php endwhile; endif; ?>
+
 		</div><!-- .padder -->
 	</div><!-- #content -->
 
-	<?php locate_template( array( 'sidebar.php' ), true ) ?>
+	<?php get_sidebar( 'buddypress' ) ?>
 
-<?php get_footer() ?>
\ 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 824489e7ac3acfda7eb5b4f7b4948a7fbb9775db..55b548d37ce96e0a9eafe96ce13e6f32a3b0b6f6 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
@@ -9,7 +9,7 @@
 
 		<?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' ) ?> &rarr;" />
+		<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' ) ?>
 	</form><!-- #request-membership-form -->
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 9c72e51613ba3b3793aedb8f02858e1e6d4e27d0..c6562e37503ad7cd4cb257ac2e76973fa534f204 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
@@ -2,7 +2,7 @@
 
 <?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">
+	<form action="<?php bp_group_send_invite_form_action() ?>" method="post" id="send-invite-form" class="standard-form" role="main">
 
 		<div class="left-menu">
 
@@ -39,7 +39,7 @@
 						<?php do_action( 'bp_group_send_invites_item' ) ?>
 
 						<div class="action">
-							<a class="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' ) ?>
 						</div>
@@ -69,7 +69,7 @@
 
 <?php else : ?>
 
-	<div id="message" class="info">
+	<div id="message" class="info" role="main">
 		<p><?php _e( '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.', 'buddypress' ); ?></p>
 	</div>
 
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 158053d6892ba57d21ac291d01a0a625bc776df2..7835d115e370f963d8fd933808971865b3ef8cf7 100644
--- a/wp-content/plugins/buddypress/bp-themes/bp-default/header.php
+++ b/wp-content/plugins/buddypress/bp-themes/bp-default/header.php
@@ -1,38 +1,20 @@
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 
 <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'); ?>" />
-
-		<title><?php bp_page_title() ?></title>
+		<meta http-equiv="Content-Type" content="<?php bloginfo( 'html_type' ) ?>; charset=<?php bloginfo( 'charset' ) ?>" />
+		<title><?php wp_title( '|', true, 'right' ); bloginfo( 'name' ); ?></title>
 
 		<?php do_action( 'bp_head' ) ?>
 
-		<meta name="generator" content="WordPress <?php bloginfo('version'); ?>" /> <!-- leave this for stats -->
-
-		<link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" media="screen" />
-
-		<?php if ( function_exists( 'bp_sitewide_activity_feed_link' ) ) : ?>
-			<link rel="alternate" type="application/rss+xml" title="<?php bloginfo('name'); ?> | <?php _e('Site Wide Activity RSS Feed', 'buddypress' ) ?>" href="<?php bp_sitewide_activity_feed_link() ?>" />
-		<?php endif; ?>
-
-		<?php if ( function_exists( 'bp_member_activity_feed_link' ) && bp_is_member() ) : ?>
-			<link rel="alternate" type="application/rss+xml" title="<?php bloginfo('name'); ?> | <?php bp_displayed_user_fullname() ?> | <?php _e( 'Activity RSS Feed', 'buddypress' ) ?>" href="<?php bp_member_activity_feed_link() ?>" />
-		<?php endif; ?>
+		<link rel="pingback" href="<?php bloginfo( 'pingback_url' ) ?>" />
 
-		<?php if ( function_exists( 'bp_group_activity_feed_link' ) && bp_is_group() ) : ?>
-			<link rel="alternate" type="application/rss+xml" title="<?php bloginfo('name'); ?> | <?php bp_current_group_name() ?> | <?php _e( 'Group Activity RSS Feed', 'buddypress' ) ?>" href="<?php bp_group_activity_feed_link() ?>" />
-		<?php endif; ?>
-
-		<link rel="alternate" type="application/rss+xml" title="<?php bloginfo('name'); ?> <?php _e( 'Blog Posts RSS Feed', 'buddypress' ) ?>" href="<?php bloginfo('rss2_url'); ?>" />
-		<link rel="alternate" type="application/atom+xml" title="<?php bloginfo('name'); ?> <?php _e( 'Blog Posts Atom Feed', 'buddypress' ) ?>" href="<?php bloginfo('atom_url'); ?>" />
-
-		<link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />
-
-		<?php wp_head(); ?>
+		<?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">
@@ -40,67 +22,31 @@
 		<?php do_action( 'bp_before_header' ) ?>
 
 		<div id="header">
-
-			<h1 id="logo"><a href="<?php echo site_url() ?>" title="<?php _e( 'Home', 'buddypress' ) ?>"><?php bp_site_name() ?></a></h1>
-
-			<ul id="nav">
-				<li<?php if ( bp_is_front_page() ) : ?> class="selected"<?php endif; ?>>
-					<a href="<?php echo site_url() ?>" title="<?php _e( 'Home', 'buddypress' ) ?>"><?php _e( 'Home', 'buddypress' ) ?></a>
-				</li>
-
-				<?php if ( 'activity' != bp_dtheme_page_on_front() && bp_is_active( 'activity' ) ) : ?>
-					<li<?php if ( bp_is_page( BP_ACTIVITY_SLUG ) ) : ?> class="selected"<?php endif; ?>>
-						<a href="<?php echo site_url() ?>/<?php echo BP_ACTIVITY_SLUG ?>/" title="<?php _e( 'Activity', 'buddypress' ) ?>"><?php _e( 'Activity', 'buddypress' ) ?></a>
-					</li>
-				<?php endif; ?>
-
-				<li<?php if ( bp_is_page( BP_MEMBERS_SLUG ) || bp_is_member() ) : ?> class="selected"<?php endif; ?>>
-					<a href="<?php echo site_url() ?>/<?php echo BP_MEMBERS_SLUG ?>/" title="<?php _e( 'Members', 'buddypress' ) ?>"><?php _e( 'Members', 'buddypress' ) ?></a>
-				</li>
-
-				<?php if ( bp_is_active( 'groups' ) ) : ?>
-					<li<?php if ( bp_is_page( BP_GROUPS_SLUG ) || bp_is_group() ) : ?> class="selected"<?php endif; ?>>
-						<a href="<?php echo site_url() ?>/<?php echo BP_GROUPS_SLUG ?>/" title="<?php _e( 'Groups', 'buddypress' ) ?>"><?php _e( 'Groups', 'buddypress' ) ?></a>
-					</li>
-
-					<?php if ( bp_is_active( 'forums' ) && ( function_exists( 'bp_forums_is_installed_correctly' ) && !(int) bp_get_option( 'bp-disable-forum-directory' ) ) && bp_forums_is_installed_correctly() ) : ?>
-						<li<?php if ( bp_is_page( BP_FORUMS_SLUG ) ) : ?> class="selected"<?php endif; ?>>
-							<a href="<?php echo site_url() ?>/<?php echo BP_FORUMS_SLUG ?>/" title="<?php _e( 'Forums', 'buddypress' ) ?>"><?php _e( 'Forums', 'buddypress' ) ?></a>
-						</li>
-					<?php endif; ?>
-				<?php endif; ?>
-
-				<?php if ( bp_is_active( 'blogs' ) && bp_core_is_multisite() ) : ?>
-					<li<?php if ( bp_is_page( BP_BLOGS_SLUG ) ) : ?> class="selected"<?php endif; ?>>
-						<a href="<?php echo site_url() ?>/<?php echo BP_BLOGS_SLUG ?>/" title="<?php _e( 'Blogs', 'buddypress' ) ?>"><?php _e( 'Blogs', 'buddypress' ) ?></a>
-					</li>
-				<?php endif; ?>
-
-				<?php wp_list_pages( 'title_li=&depth=1&exclude=' . bp_dtheme_page_on_front() ); ?>
-
-				<?php do_action( 'bp_nav_items' ); ?>
-			</ul><!-- #nav -->
-
-			<div id="search-bar">
+			<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>
 
-				<?php if ( bp_search_form_enabled() ) : ?>
+						<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'] ) : ''; ?>" />
 
-					<form action="<?php echo bp_search_form_action() ?>" method="post" id="search-form">
-						<input type="text" id="search-terms" name="search-terms" value="" />
-						<?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' ) ?>" />
-						<?php wp_nonce_field( 'bp_search_form' ) ?>
-					</form><!-- #search-form -->
+							<input type="submit" name="search-submit" id="search-submit" value="<?php _e( 'Search', 'buddypress' ) ?>" />
 
-				<?php endif; ?>
+							<?php wp_nonce_field( 'bp_search_form' ) ?>
+
+						</form><!-- #search-form -->
 
 				<?php do_action( 'bp_search_login_bar' ) ?>
 
 				</div><!-- .padder -->
 			</div><!-- #search-bar -->
 
+			<div id="navigation" role="navigation">
+				<?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' ) ?>
 
 		</div><!-- #header -->
@@ -108,4 +54,4 @@
 		<?php do_action( 'bp_after_header' ) ?>
 		<?php do_action( 'bp_before_container' ) ?>
 
-		<div id="container">
\ No newline at end of file
+		<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 ebcb2c6586880eb2049462e50d6e93e1fb2149af..80110247b1e09186ba234895f44a113d43dba537 100644
--- a/wp-content/plugins/buddypress/bp-themes/bp-default/index.php
+++ b/wp-content/plugins/buddypress/bp-themes/bp-default/index.php
@@ -5,31 +5,40 @@
 
 		<?php do_action( 'bp_before_blog_home' ) ?>
 
-		<div class="page" id="blog-latest">
+		<?php do_action( 'template_notices' ) ?>
+
+		<div class="page" id="blog-latest" role="main">
 
 			<?php if ( have_posts() ) : ?>
 
+				<?php bp_dtheme_content_nav( 'nav-above' ); ?>
+
 				<?php while (have_posts()) : the_post(); ?>
 
 					<?php do_action( 'bp_before_blog_post' ) ?>
 
-					<div class="post" id="post-<?php the_ID(); ?>">
+					<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( __( 'by %s', '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>
+							<?php endif; ?>
 						</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>
 
-							<p class="date"><?php the_time() ?> <em><?php _e( 'in', 'buddypress' ) ?> <?php the_category(', ') ?> <?php printf( __( 'by %s', 'buddypress' ), bp_core_get_userlink( $post->post_author ) ) ?></em></p>
+							<p class="date"><?php printf( __( '%1$s <span>in %2$s</span>', 'buddypress' ), get_the_date(), get_the_category_list( ', ' ) ); ?></p>
 
 							<div class="entry">
 								<?php the_content( __( 'Read the rest of this entry &rarr;', 'buddypress' ) ); ?>
+								<?php wp_link_pages( array( 'before' => '<div class="page-link"><p>' . __( 'Pages: ', 'buddypress' ), 'after' => '</p></div>', 'next_or_number' => 'number' ) ); ?>
 							</div>
 
-							<p class="postmetadata"><span class="tags"><?php the_tags( __( 'Tags: ', 'buddypress' ), ', ', '<br />'); ?></span> <span class="comments"><?php comments_popup_link( __( 'No Comments &#187;', 'buddypress' ), __( '1 Comment &#187;', 'buddypress' ), __( '% Comments &#187;', 'buddypress' ) ); ?></span></p>
+							<p class="postmetadata"><?php the_tags( '<span class="tags">' . __( 'Tags: ', 'buddypress' ), ', ', '</span>' ); ?> <span class="comments"><?php comments_popup_link( __( 'No Comments &#187;', 'buddypress' ), __( '1 Comment &#187;', 'buddypress' ), __( '% Comments &#187;', 'buddypress' ) ); ?></span></p>
 						</div>
 
 					</div>
@@ -38,19 +47,14 @@
 
 				<?php endwhile; ?>
 
-				<div 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 bp_dtheme_content_nav( 'nav-below' ); ?>
 
 			<?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>
 
-				<?php locate_template( array( 'searchform.php' ), true ) ?>
+				<?php get_search_form() ?>
 
 			<?php endif; ?>
 		</div>
@@ -60,6 +64,6 @@
 		</div><!-- .padder -->
 	</div><!-- #content -->
 
-	<?php locate_template( array( 'sidebar.php' ), true ) ?>
+	<?php get_sidebar() ?>
 
 <?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
new file mode 100644
index 0000000000000000000000000000000000000000..b5fcfa6e7a5343eec02d2d25805773efbdf65121
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-themes/bp-default/license.txt
@@ -0,0 +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
+
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 b5439689494c28578f4646c4fcc274145eb499c7..c2c7cd37d7922a69005f03da7f8e908ae30a3a48 100644
--- a/wp-content/plugins/buddypress/bp-themes/bp-default/links.php
+++ b/wp-content/plugins/buddypress/bp-themes/bp-default/links.php
@@ -11,12 +11,12 @@ Template Name: Links
 
 		<?php do_action( 'bp_before_blog_links' ) ?>
 
-		<div class="page" id="blog-latest">
+		<div class="page" id="blog-latest" role="main">
 
 			<h2 class="pagetitle"><?php _e( 'Links', 'buddypress' ) ?></h2>
 
 			<ul id="links-list">
-				<?php get_links_list(); ?>
+				<?php wp_list_bookmarks(); ?>
 			</ul>
 
 		</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 5fd734c742cabbb35f5a5e7cdcde8a53a0ed1acf..52f3413b42bfaab629e435579fe9c7bce4fdd238 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
@@ -1,60 +1,95 @@
-<?php get_header() ?>
+<?php
+
+/**
+ * BuddyPress - Members Directory
+ *
+ * @package BuddyPress
+ * @subpackage bp-default
+ */
+
+?>
+
+<?php get_header( 'buddypress' ); ?>
+
+	<?php do_action( 'bp_before_directory_members_page' ); ?>
 
 	<div id="content">
 		<div class="padder">
 
+		<?php do_action( 'bp_before_directory_members' ); ?>
+
 		<form action="" method="post" id="members-directory-form" class="dir-form">
 
-			<h3><?php _e( 'Members Directory', 'buddypress' ) ?></h3>
+			<h3><?php _e( 'Members Directory', 'buddypress' ); ?></h3>
+
+			<?php do_action( 'bp_before_directory_members_content' ); ?>
 
-			<?php do_action( 'bp_before_directory_members_content' ) ?>
+			<div id="members-dir-search" class="dir-search" role="search">
+
+				<?php bp_directory_members_search_form(); ?>
 
-			<div id="members-dir-search" class="dir-search">
-				<?php bp_directory_members_search_form() ?>
 			</div><!-- #members-dir-search -->
 
-			<div class="item-list-tabs">
+			<div class="item-list-tabs" role="navigation">
 				<ul>
-					<li class="selected" id="members-all"><a href="<?php bp_root_domain() ?>"><?php printf( __( 'All Members (%s)', 'buddypress' ), bp_get_total_member_count() ) ?></a></li>
+					<li class="selected" id="members-all"><a href="<?php echo trailingslashit( bp_get_root_domain() . '/' . bp_get_members_root_slug() ); ?>"><?php printf( __( 'All Members <span>%s</span>', 'buddypress' ), bp_get_total_member_count() ); ?></a></li>
+
+					<?php if ( is_user_logged_in() && bp_is_active( 'friends' ) && bp_get_total_friend_count( bp_loggedin_user_id() ) ) : ?>
+
+						<li id="members-personal"><a href="<?php echo bp_loggedin_user_domain() . bp_get_friends_slug() . '/my-friends/' ?>"><?php printf( __( 'My Friends <span>%s</span>', 'buddypress' ), bp_get_total_friend_count( bp_loggedin_user_id() ) ); ?></a></li>
 
-					<?php if ( is_user_logged_in() && function_exists( 'bp_get_total_friend_count' ) && bp_get_total_friend_count( bp_loggedin_user_id() ) ) : ?>
-						<li id="members-personal"><a href="<?php echo bp_loggedin_user_domain() . BP_FRIENDS_SLUG . '/my-friends/' ?>"><?php printf( __( 'My Friends (%s)', 'buddypress' ), bp_get_total_friend_count( bp_loggedin_user_id() ) ) ?></a></li>
 					<?php endif; ?>
 
-					<?php do_action( 'bp_members_directory_member_types' ) ?>
+					<?php do_action( 'bp_members_directory_member_types' ); ?>
+
+				</ul>
+			</div><!-- .item-list-tabs -->
+
+			<div class="item-list-tabs" id="subnav" role="navigation">
+				<ul>
+
+					<?php do_action( 'bp_members_directory_member_sub_types' ); ?>
 
 					<li id="members-order-select" class="last filter">
 
-						<?php _e( 'Order By:', 'buddypress' ) ?>
-						<select>
-							<option value="active"><?php _e( 'Last Active', 'buddypress' ) ?></option>
-							<option value="newest"><?php _e( 'Newest Registered', 'buddypress' ) ?></option>
+						<label for="members-order-by"><?php _e( 'Order By:', 'buddypress' ); ?></label>
+						<select id="members-order-by">
+							<option value="active"><?php _e( 'Last Active', 'buddypress' ); ?></option>
+							<option value="newest"><?php _e( 'Newest Registered', 'buddypress' ); ?></option>
 
 							<?php if ( bp_is_active( 'xprofile' ) ) : ?>
-								<option value="alphabetical"><?php _e( 'Alphabetical', 'buddypress' ) ?></option>
+
+								<option value="alphabetical"><?php _e( 'Alphabetical', 'buddypress' ); ?></option>
+
 							<?php endif; ?>
 
-							<?php do_action( 'bp_members_directory_order_options' ) ?>
+							<?php do_action( 'bp_members_directory_order_options' ); ?>
+
 						</select>
 					</li>
 				</ul>
-			</div><!-- .item-list-tabs -->
+			</div>
 
 			<div id="members-dir-list" class="members dir-list">
-				<?php locate_template( array( 'members/members-loop.php' ), true ) ?>
+
+				<?php locate_template( array( 'members/members-loop.php' ), true ); ?>
+
 			</div><!-- #members-dir-list -->
 
-			<?php do_action( 'bp_directory_members_content' ) ?>
+			<?php do_action( 'bp_directory_members_content' ); ?>
 
-			<?php wp_nonce_field( 'directory_members', '_wpnonce-member-filter' ) ?>
+			<?php wp_nonce_field( 'directory_members', '_wpnonce-member-filter' ); ?>
 
-			<?php do_action( 'bp_after_directory_members_content' ) ?>
+			<?php do_action( 'bp_after_directory_members_content' ); ?>
 
 		</form><!-- #members-directory-form -->
 
+		<?php do_action( 'bp_after_directory_members' ); ?>
+
 		</div><!-- .padder -->
 	</div><!-- #content -->
 
-	<?php locate_template( array( 'sidebar.php' ), true ) ?>
+	<?php do_action( 'bp_after_directory_members_page' ); ?>
 
-<?php get_footer() ?>
\ No newline at end of file
+<?php get_sidebar( 'buddypress' ); ?>
+<?php get_footer( 'buddypress' ); ?>
diff --git a/wp-content/plugins/buddypress/bp-themes/bp-default/members/members-loop.php b/wp-content/plugins/buddypress/bp-themes/bp-default/members/members-loop.php
index 60a16ac512b1e4daa1328af6946a0c8f29a72893..dafb5e7b7e1fc879554481c91715135bf44f7bfa 100644
--- a/wp-content/plugins/buddypress/bp-themes/bp-default/members/members-loop.php
+++ b/wp-content/plugins/buddypress/bp-themes/bp-default/members/members-loop.php
@@ -1,46 +1,62 @@
-<?php /* Querystring is set via AJAX in _inc/ajax.php - bp_dtheme_object_filter() */ ?>
+<?php
 
-<?php do_action( 'bp_before_members_loop' ) ?>
+/**
+ * BuddyPress - Members Loop
+ *
+ * Querystring is set via AJAX in _inc/ajax.php - bp_dtheme_object_filter()
+ *
+ * @package BuddyPress
+ * @subpackage bp-default
+ */
+
+?>
+
+<?php do_action( 'bp_before_members_loop' ); ?>
 
 <?php if ( bp_has_members( bp_ajax_querystring( 'members' ) ) ) : ?>
 
 	<div id="pag-top" class="pagination">
 
 		<div class="pag-count" id="member-dir-count-top">
-			<?php bp_members_pagination_count() ?>
+
+			<?php bp_members_pagination_count(); ?>
+
 		</div>
 
 		<div class="pagination-links" id="member-dir-pag-top">
-			<?php bp_members_pagination_links() ?>
+
+			<?php bp_members_pagination_links(); ?>
+
 		</div>
 
 	</div>
 
-	<?php do_action( 'bp_before_directory_members_list' ) ?>
+	<?php do_action( 'bp_before_directory_members_list' ); ?>
+
+	<ul id="members-list" class="item-list" role="main">
 
-	<ul id="members-list" class="item-list">
 	<?php while ( bp_members() ) : bp_the_member(); ?>
 
 		<li>
 			<div class="item-avatar">
-				<a href="<?php bp_member_permalink() ?>"><?php bp_member_avatar() ?></a>
+				<a href="<?php bp_member_permalink(); ?>"><?php bp_member_avatar(); ?></a>
 			</div>
 
 			<div class="item">
 				<div class="item-title">
-					<a href="<?php bp_member_permalink() ?>"><?php bp_member_name() ?></a>
+					<a href="<?php bp_member_permalink(); ?>"><?php bp_member_name(); ?></a>
 
 					<?php if ( bp_get_member_latest_update() ) : ?>
 
-						<span class="update"> - <?php bp_member_latest_update( 'length=10' ) ?></span>
+						<span class="update"> <?php bp_member_latest_update(); ?></span>
 
 					<?php endif; ?>
 
 				</div>
 
-				<div class="item-meta"><span class="activity"><?php bp_member_last_active() ?></span></div>
+				<div class="item-meta"><span class="activity"><?php bp_member_last_active(); ?></span></div>
 
-				<?php do_action( 'bp_directory_members_item' ) ?>
+				<?php do_action( 'bp_directory_members_item' ); ?>
 
 				<?php
 				 /***
@@ -63,20 +79,25 @@
 		</li>
 
 	<?php endwhile; ?>
+
 	</ul>
 
-	<?php do_action( 'bp_after_directory_members_list' ) ?>
+	<?php do_action( 'bp_after_directory_members_list' ); ?>
 
-	<?php bp_member_hidden_fields() ?>
+	<?php bp_member_hidden_fields(); ?>
 
 	<div id="pag-bottom" class="pagination">
 
 		<div class="pag-count" id="member-dir-count-bottom">
-			<?php bp_members_pagination_count() ?>
+
+			<?php bp_members_pagination_count(); ?>
+
 		</div>
 
 		<div class="pagination-links" id="member-dir-pag-bottom">
-			<?php bp_members_pagination_links() ?>
+
+			<?php bp_members_pagination_links(); ?>
+
 		</div>
 
 	</div>
@@ -84,9 +105,9 @@
 <?php else: ?>
 
 	<div id="message" class="info">
-		<p><?php _e( "Sorry, no members were found.", 'buddypress' ) ?></p>
+		<p><?php _e( "Sorry, no members were found.", 'buddypress' ); ?></p>
 	</div>
 
 <?php endif; ?>
 
-<?php do_action( 'bp_after_members_loop' ) ?>
+<?php do_action( 'bp_after_members_loop' ); ?>
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 4370ca1ab791ad7a016b166069b033d0adde89cd..de5a67575e7abd6b910677258a7b42dde5cee2a8 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
@@ -1,50 +1,77 @@
-<div class="item-list-tabs no-ajax" id="subnav">
+<?php
+
+/**
+ * BuddyPress - Users Activity
+ *
+ * @package BuddyPress
+ * @subpackage bp-default
+ */
+
+?>
+
+<div class="item-list-tabs no-ajax" id="subnav" role="navigation">
 	<ul>
+
 		<?php bp_get_options_nav() ?>
 
 		<li id="activity-filter-select" class="last">
-			<select>
-				<option value="-1"><?php _e( 'No Filter', 'buddypress' ) ?></option>
-				<option value="activity_update"><?php _e( 'Show Updates', 'buddypress' ) ?></option>
-
-				<?php if ( 'groups' != bp_current_action() ) : ?>
-					<?php if ( bp_is_active( 'blogs' ) ) : ?>
-						<option value="new_blog_post"><?php _e( 'Show Blog Posts', 'buddypress' ) ?></option>
-						<option value="new_blog_comment"><?php _e( 'Show Blog Comments', 'buddypress' ) ?></option>
-					<?php endif; ?>
-
-					<?php if ( bp_is_active( 'friends' ) ) : ?>
-						<option value="friendship_accepted,friendship_created"><?php _e( 'Show Friendship Connections', 'buddypress' ) ?></option>
-					<?php endif; ?>
-				<?php endif; ?>
-
-				<?php if ( bp_is_active( 'forums' ) ) : ?>
-					<option value="new_forum_topic"><?php _e( 'Show New Forum Topics', 'buddypress' ) ?></option>
-					<option value="new_forum_post"><?php _e( 'Show Forum Replies', 'buddypress' ) ?></option>
-				<?php endif; ?>
-
-				<?php if ( bp_is_active( 'groups' ) ) : ?>
-					<option value="created_group"><?php _e( 'Show New Groups', 'buddypress' ) ?></option>
-					<option value="joined_group"><?php _e( 'Show New Group Memberships', 'buddypress' ) ?></option>
-				<?php endif; ?>
-
-				<?php do_action( 'bp_member_activity_filter_options' ) ?>
+			<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>
+
+				<?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>
+
+					<?php
+					endif;
+
+					if ( bp_is_active( 'friends' ) ) : ?>
+
+						<option value="friendship_accepted,friendship_created"><?php _e( 'Friendships', 'buddypress' ) ?></option>
+
+					<?php endif;
+
+				endif;
+
+				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>
+
+				<?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>
+
+				<?php endif;
+
+				do_action( 'bp_member_activity_filter_options' ); ?>
+
 			</select>
 		</li>
 	</ul>
 </div><!-- .item-list-tabs -->
 
-<?php do_action( 'bp_before_member_activity_post_form' ) ?>
+<?php do_action( 'bp_before_member_activity_post_form' ); ?>
+
+<?php
+if ( is_user_logged_in() && bp_is_my_profile() && ( !bp_current_action() || bp_is_current_action( 'just-me' ) ) )
+	locate_template( array( 'activity/post-form.php'), true );
+
+do_action( 'bp_after_member_activity_post_form' );
+do_action( 'bp_before_member_activity_content' ); ?>
 
-<?php if ( is_user_logged_in() && bp_is_my_profile() && ( '' == bp_current_action() || 'just-me' == bp_current_action() ) ) : ?>
-	<?php locate_template( array( 'activity/post-form.php'), true ) ?>
-<?php endif; ?>
+<div class="activity" role="main">
 
-<?php do_action( 'bp_after_member_activity_post_form' ) ?>
-<?php do_action( 'bp_before_member_activity_content' ) ?>
+	<?php locate_template( array( 'activity/activity-loop.php' ), true ); ?>
 
-<div class="activity">
-	<?php locate_template( array( 'activity/activity-loop.php' ), true ) ?>
 </div><!-- .activity -->
 
-<?php do_action( 'bp_after_member_activity_content' ) ?>
+<?php do_action( 'bp_after_member_activity_content' ); ?>
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 f55cf33857c3ea9ab71262929d5dff4c0bd3f721..ad4beecf30e3ab1209659ca132ff8b24d2adc453 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,7 +1,7 @@
-<?php get_header() ?>
+<?php get_header( 'buddypress' ) ?>
 
-<div class="activity no-ajax">
-	<?php if ( bp_has_activities( 'display_comments=threaded&include=' . bp_current_action() ) ) : ?>
+<div class="activity no-ajax" role="main">
+	<?php if ( bp_has_activities( 'display_comments=threaded&show_hidden=true&include=' . bp_current_action() ) ) : ?>
 
 		<ul id="activity-stream" class="activity-list item-list">
 		<?php while ( bp_activities() ) : bp_the_activity(); ?>
@@ -14,4 +14,4 @@
 	<?php endif; ?>
 </div>
 
-<?php get_footer() ?>
\ 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/blogs.php b/wp-content/plugins/buddypress/bp-themes/bp-default/members/single/blogs.php
index 6e134228785c2014014f563b91df2162d206e72a..971d7168e1c73f0cedf15d4836646c6ab4208a9a 100644
--- a/wp-content/plugins/buddypress/bp-themes/bp-default/members/single/blogs.php
+++ b/wp-content/plugins/buddypress/bp-themes/bp-default/members/single/blogs.php
@@ -1,24 +1,40 @@
-<div class="item-list-tabs" id="subnav">
+<?php
+
+/**
+ * BuddyPress - Users Blogs
+ *
+ * @package BuddyPress
+ * @subpackage bp-default
+ */
+
+?>
+
+<div class="item-list-tabs" id="subnav" role="navigation">
 	<ul>
-		<?php bp_get_options_nav() ?>
+
+		<?php bp_get_options_nav(); ?>
 
 		<li id="blogs-order-select" class="last filter">
-			<?php _e( 'Order By:', 'buddypress' ) ?>
+
+			<label for="blogs-all"><?php _e( 'Order By:', 'buddypress' ); ?></label>
 			<select id="blogs-all">
-				<option value="active"><?php _e( 'Last Active', 'buddypress' ) ?></option>
-				<option value="newest"><?php _e( 'Newest', 'buddypress' ) ?></option>
-				<option value="alphabetical"><?php _e( 'Alphabetical', 'buddypress' ) ?></option>
+				<option value="active"><?php _e( 'Last Active', 'buddypress' ); ?></option>
+				<option value="newest"><?php _e( 'Newest', '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>
 	</ul>
 </div><!-- .item-list-tabs -->
 
-<?php do_action( 'bp_before_member_blogs_content' ) ?>
+<?php do_action( 'bp_before_member_blogs_content' ); ?>
+
+<div class="blogs myblogs" role="main">
+
+	<?php locate_template( array( 'blogs/blogs-loop.php' ), true ); ?>
 
-<div class="blogs myblogs">
-	<?php locate_template( array( 'blogs/blogs-loop.php' ), true ) ?>
 </div><!-- .blogs.myblogs -->
 
-<?php do_action( 'bp_after_member_blogs_content' ) ?>
+<?php do_action( 'bp_after_member_blogs_content' ); ?>
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
new file mode 100644
index 0000000000000000000000000000000000000000..6131c1cbf377b079f8d073bf001d998c4dcada49
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-themes/bp-default/members/single/forums.php
@@ -0,0 +1,47 @@
+<?php
+
+/**
+ * BuddyPress - Users Forums
+ *
+ * @package BuddyPress
+ * @subpackage bp-default
+ */
+
+?>
+
+<div class="item-list-tabs no-ajax" id="subnav" role="navigation">
+	<ul>
+		<?php bp_get_options_nav() ?>
+
+		<li id="forums-order-select" class="last filter">
+
+			<label for="forums-order-by"><?php _e( 'Order By:', 'buddypress' ); ?></label>
+			<select id="forums-order-by">
+				<option value="active"><?php _e( 'Last Active', 'buddypress' ); ?></option>
+				<option value="popular"><?php _e( 'Most Posts', 'buddypress' ); ?></option>
+				<option value="unreplied"><?php _e( 'Unreplied', 'buddypress' ); ?></option>
+
+				<?php do_action( 'bp_forums_directory_order_options' ); ?>
+
+			</select>
+		</li>
+	</ul>
+</div><!-- .item-list-tabs -->
+
+<?php
+
+if ( bp_is_current_action( 'favorites' ) ) :
+	locate_template( array( 'members/single/forums/topics.php' ), true );
+
+else :
+	do_action( 'bp_before_member_forums_content' ); ?>
+
+	<div class="forums myforums">
+
+		<?php locate_template( array( 'forums/forums-loop.php' ), true ); ?>
+
+	</div>
+
+	<?php do_action( 'bp_after_member_forums_content' ); ?>
+
+<?php endif; ?>
diff --git a/wp-content/plugins/buddypress/bp-themes/bp-default/members/single/forums/topics.php b/wp-content/plugins/buddypress/bp-themes/bp-default/members/single/forums/topics.php
new file mode 100644
index 0000000000000000000000000000000000000000..a202e9e730719fb3edd6bae27dd4cf59f6ba832b
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-themes/bp-default/members/single/forums/topics.php
@@ -0,0 +1,7 @@
+<?php
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+
+?>
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 4d499cd3a531a99dbf2997eac91af7fa80ab68a8..6975e78e96de5197484a6516fc1346347d85b0e0 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
@@ -1,34 +1,52 @@
-<div class="item-list-tabs no-ajax" id="subnav">
+<?php
+
+/**
+ * BuddyPress - Users Friends
+ *
+ * @package BuddyPress
+ * @subpackage bp-default
+ */
+
+?>
+
+<div class="item-list-tabs no-ajax" id="subnav" role="navigation">
 	<ul>
-		<?php if ( bp_is_my_profile() ) : ?>
-			<?php bp_get_options_nav() ?>
-		<?php endif; ?>
+		<?php if ( bp_is_my_profile() ) bp_get_options_nav(); ?>
+
+		<?php if ( !bp_is_current_action( 'requests' ) ) : ?>
+
+			<li id="members-order-select" class="last filter">
 
-		<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>
 
-			<?php _e( 'Order By:', 'buddypress' ) ?>
-			<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>
+					<?php do_action( 'bp_member_blog_order_options' ) ?>
+
+				</select>
+			</li>
+
+		<?php endif; ?>
 
-				<?php do_action( 'bp_member_blog_order_options' ) ?>
-			</select>
-		</li>
 	</ul>
 </div>
 
-<?php if ( 'requests' == bp_current_action() ) : ?>
-	<?php locate_template( array( 'members/single/friends/requests.php' ), true ) ?>
+<?php
 
-<?php else : ?>
+if ( bp_is_current_action( 'requests' ) ) :
+	 locate_template( array( 'members/single/friends/requests.php' ), true );
 
-	<?php do_action( 'bp_before_member_friends_content' ) ?>
+else :
+	do_action( 'bp_before_member_friends_content' ); ?>
 
 	<div class="members friends">
-		<?php locate_template( array( 'members/members-loop.php' ), true ) ?>
+
+		<?php locate_template( array( 'members/members-loop.php' ), true ); ?>
+
 	</div><!-- .members.friends -->
 
-	<?php do_action( 'bp_after_member_friends_content' ) ?>
+	<?php do_action( 'bp_after_member_friends_content' ); ?>
 
 <?php endif; ?>
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 f4b88af2e70ed3a08a501d7a9889615a09b6084e..874d0dfcb166cd1bb929974a3c44bb6ec8270018 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,8 +1,24 @@
 <?php do_action( 'bp_before_member_friend_requests_content' ) ?>
 
-<?php if ( bp_has_members( 'include=' . bp_get_friendship_requests() . '&per_page=0' ) ) : ?>
+<?php if ( bp_has_members( 'include=' . bp_get_friendship_requests() ) ) : ?>
 
-	<ul id="friend-list" class="item-list">
+	<div id="pag-top" class="pagination no-ajax">
+
+		<div class="pag-count" id="member-dir-count-top">
+
+			<?php bp_members_pagination_count(); ?>
+
+		</div>
+
+		<div class="pagination-links" id="member-dir-pag-top">
+
+			<?php bp_members_pagination_links(); ?>
+
+		</div>
+
+	</div>
+
+	<ul id="friend-list" class="item-list" role="main">
 		<?php while ( bp_members() ) : bp_the_member(); ?>
 
 			<li id="friendship-<?php bp_friend_friendship_id() ?>">
@@ -30,6 +46,22 @@
 
 	<?php do_action( 'bp_friend_requests_content' ) ?>
 
+	<div id="pag-bottom" class="pagination no-ajax">
+
+		<div class="pag-count" id="member-dir-count-bottom">
+
+			<?php bp_members_pagination_count(); ?>
+
+		</div>
+
+		<div class="pagination-links" id="member-dir-pag-bottom">
+
+			<?php bp_members_pagination_links(); ?>
+
+		</div>
+
+	</div>
+
 <?php else: ?>
 
 	<div id="message" class="info">
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 4df84c183263a8833da5712c89cd6716f59dceb4..143436c2bd23c12ad57a8eb7879affae0930ec7c 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
@@ -1,37 +1,53 @@
-<div class="item-list-tabs no-ajax" id="subnav">
+<?php
+
+/**
+ * BuddyPress - Users Groups
+ *
+ * @package BuddyPress
+ * @subpackage bp-default
+ */
+
+?>
+
+<div class="item-list-tabs no-ajax" id="subnav" role="navigation">
 	<ul>
-		<?php if ( bp_is_my_profile() ) : ?>
-			<?php bp_get_options_nav() ?>
-		<?php endif; ?>
+		<?php if ( bp_is_my_profile() ) bp_get_options_nav(); ?>
+
+		<?php if ( !bp_is_current_action( 'invites' ) ) : ?>
 
-		<?php if ( 'invites' != bp_current_action() ) : ?>
-		<li id="groups-order-select" class="last filter">
+			<li id="groups-order-select" class="last filter">
 
-			<?php _e( 'Order By:', 'buddypress' ) ?>
-			<select id="groups-sort-by">
-				<option value="active"><?php _e( 'Last Active', 'buddypress' ) ?></option>
-				<option value="popular"><?php _e( 'Most Members', 'buddypress' ) ?></option>
-				<option value="newest"><?php _e( 'Newly Created', 'buddypress' ) ?></option>
-				<option value="alphabetical"><?php _e( 'Alphabetical', 'buddypress' ) ?></option>
+				<label for="groups-sort-by"><?php _e( 'Order By:', 'buddypress' ); ?></label>
+				<select id="groups-sort-by">
+					<option value="active"><?php _e( 'Last Active', 'buddypress' ); ?></option>
+					<option value="popular"><?php _e( 'Most Members', 'buddypress' ); ?></option>
+					<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' ) ?>
+
+				</select>
+			</li>
 
-				<?php do_action( 'bp_member_group_order_options' ) ?>
-			</select>
-		</li>
 		<?php endif; ?>
+
 	</ul>
 </div><!-- .item-list-tabs -->
 
-<?php if ( 'invites' == bp_current_action() ) : ?>
-	<?php locate_template( array( 'members/single/groups/invites.php' ), true ) ?>
+<?php
 
-<?php else : ?>
+if ( bp_is_current_action( 'invites' ) ) :
+	locate_template( array( 'members/single/groups/invites.php' ), true );
 
-	<?php do_action( 'bp_before_member_groups_content' ) ?>
+else :
+	do_action( 'bp_before_member_groups_content' ); ?>
 
 	<div class="groups mygroups">
-		<?php locate_template( array( 'groups/groups-loop.php' ), true ) ?>
+
+		<?php locate_template( array( 'groups/groups-loop.php' ), true ); ?>
+
 	</div>
 
-	<?php do_action( 'bp_after_member_groups_content' ) ?>
+	<?php do_action( 'bp_after_member_groups_content' ); ?>
 
 <?php endif; ?>
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 777b153b822cf699f78b067da4a07fc62426dc83..dcf2d697b1b2ffcd98c18cc22835665ed803283d 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
@@ -2,12 +2,15 @@
 
 <?php if ( bp_has_groups( 'type=invites&user_id=' . bp_loggedin_user_id() ) ) : ?>
 
-	<ul id="group-list" class="invites item-list">
+	<ul id="group-list" class="invites item-list" role="main">
 
 		<?php while ( bp_groups() ) : bp_the_group(); ?>
 
 			<li>
-				<?php bp_group_avatar_thumb() ?>
+				<div class="item-avatar">
+					<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>
 
 				<p class="desc">
@@ -30,7 +33,7 @@
 
 <?php else: ?>
 
-	<div id="message" class="info">
+	<div id="message" class="info" role="main">
 		<p><?php _e( 'You have no outstanding group invites.', 'buddypress' ) ?></p>
 	</div>
 
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 647895e839f1bd0d20c7794b38959c95604c8692..bc2ac2a3a8506233ce939b9f6d587f63522e6db4 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
@@ -1,61 +1,81 @@
-<?php get_header() ?>
+<?php
+
+/**
+ * BuddyPress - Users Home
+ *
+ * @package BuddyPress
+ * @subpackage bp-default
+ */
+
+?>
+
+<?php get_header( 'buddypress' ); ?>
 
 	<div id="content">
 		<div class="padder">
 
-			<?php do_action( 'bp_before_member_home_content' ) ?>
+			<?php do_action( 'bp_before_member_home_content' ); ?>
+
+			<div id="item-header" role="complementary">
+
+				<?php locate_template( array( 'members/single/member-header.php' ), true ); ?>
 
-			<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">
+				<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' ) ?>
+						<?php bp_get_displayed_user_nav(); ?>
+
+						<?php do_action( 'bp_member_options_nav' ); ?>
+
 					</ul>
 				</div>
 			</div><!-- #item-nav -->
 
 			<div id="item-body">
-				<?php do_action( 'bp_before_member_body' ) ?>
 
-				<?php if ( bp_is_user_activity() || !bp_current_component() ) : ?>
-					<?php locate_template( array( 'members/single/activity.php' ), true ) ?>
+				<?php do_action( 'bp_before_member_body' );
+
+				if ( bp_is_user_activity() || !bp_current_component() ) :
+					locate_template( array( 'members/single/activity.php'  ), true );
+
+				 elseif ( bp_is_user_blogs() ) :
+					locate_template( array( 'members/single/blogs.php'     ), true );
 
-				<?php elseif ( bp_is_user_blogs() ) : ?>
-					<?php locate_template( array( 'members/single/blogs.php' ), true ) ?>
+				elseif ( bp_is_user_friends() ) :
+					locate_template( array( 'members/single/friends.php'   ), true );
 
-				<?php elseif ( bp_is_user_friends() ) : ?>
-					<?php locate_template( array( 'members/single/friends.php' ), true ) ?>
+				elseif ( bp_is_user_groups() ) :
+					locate_template( array( 'members/single/groups.php'    ), true );
 
-				<?php elseif ( bp_is_user_groups() ) : ?>
-					<?php locate_template( array( 'members/single/groups.php' ), true ) ?>
+				elseif ( bp_is_user_messages() ) :
+					locate_template( array( 'members/single/messages.php'  ), true );
 
-				<?php elseif ( bp_is_user_messages() ) : ?>
-					<?php locate_template( array( 'members/single/messages.php' ), true ) ?>
+				elseif ( bp_is_user_profile() ) :
+					locate_template( array( 'members/single/profile.php'   ), true );
 
-				<?php elseif ( bp_is_user_profile() ) : ?>
-					<?php locate_template( array( 'members/single/profile.php' ), true ) ?>
+				elseif ( bp_is_user_forums() ) :
+					locate_template( array( 'members/single/forums.php'    ), true );
 
-				<?php else : ?>
-					<?php
-						/* If nothing sticks, just load a member front template if one exists. */
-						locate_template( array( 'members/single/front.php' ), true );
-					?>
-				<?php endif; ?>
+				elseif ( bp_is_user_settings() ) :
+					locate_template( array( 'members/single/settings.php'  ), true );
 
-				<?php do_action( 'bp_after_member_body' ) ?>
+				// If nothing sticks, load a generic template
+				else :
+					locate_template( array( 'members/single/plugins.php'   ), true );
+
+				endif;
+
+				do_action( 'bp_after_member_body' ); ?>
 
 			</div><!-- #item-body -->
 
-			<?php do_action( 'bp_after_member_home_content' ) ?>
+			<?php do_action( 'bp_after_member_home_content' ); ?>
 
 		</div><!-- .padder -->
 	</div><!-- #content -->
 
-	<?php locate_template( array( 'sidebar.php' ), true ) ?>
-
-<?php get_footer() ?>
\ No newline at end of file
+<?php get_sidebar( 'buddypress' ); ?>
+<?php get_footer( 'buddypress' ); ?>
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 e58766cc3a0a335ae7f7c76217b812b8d45038b5..902bc654cd657f5e3dc9248384eff3eb25130ae0 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
@@ -1,23 +1,45 @@
-<?php do_action( 'bp_before_member_header' ) ?>
+<?php
+
+/**
+ * BuddyPress - Users Header
+ *
+ * @package BuddyPress
+ * @subpackage bp-default
+ */
+
+?>
+
+<?php do_action( 'bp_before_member_header' ); ?>
 
 <div id="item-header-avatar">
-	<a href="<?php bp_user_link() ?>">
-		<?php bp_displayed_user_avatar( 'type=full' ) ?>
+	<a href="<?php bp_user_link(); ?>">
+
+		<?php bp_displayed_user_avatar( 'type=full' ); ?>
+
 	</a>
 </div><!-- #item-header-avatar -->
 
 <div id="item-header-content">
 
-	<h2 class="fn"><a href="<?php bp_displayed_user_link() ?>"><?php bp_displayed_user_fullname() ?></a> <span class="highlight">@<?php bp_displayed_user_username() ?> <span>?</span></span></h2>
-	<span class="activity"><?php bp_last_activity( bp_displayed_user_id() ) ?></span>
+	<h2>
+		<a href="<?php bp_displayed_user_link(); ?>"><?php bp_displayed_user_fullname(); ?></a>
+	</h2>
+
+	<span class="user-nicename">@<?php bp_displayed_user_username(); ?></span>
+	<span class="activity"><?php bp_last_activity( bp_displayed_user_id() ); ?></span>
 
-	<?php do_action( 'bp_before_member_header_meta' ) ?>
+	<?php do_action( 'bp_before_member_header_meta' ); ?>
 
 	<div id="item-meta">
-		<?php if ( function_exists( 'bp_activity_latest_update' ) ) : ?>
+
+		<?php if ( bp_is_active( 'activity' ) ) : ?>
+
 			<div id="latest-update">
-				<?php bp_activity_latest_update( bp_displayed_user_id() ) ?>
+
+				<?php bp_activity_latest_update( bp_displayed_user_id() ); ?>
+
 			</div>
+
 		<?php endif; ?>
 
 		<div id="item-buttons">
@@ -27,18 +49,18 @@
 		</div><!-- #item-buttons -->
 
 		<?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
-		  */
-		?>
+		/***
+		 * If you'd like to show specific profile fields here use:
+		 * bp_profile_field_data( 'field=About Me' ); -- Pass the name of the field
+		 */
+		 do_action( 'bp_profile_header_meta' );
 
-		<?php do_action( 'bp_profile_header_meta' ) ?>
+		 ?>
 
 	</div><!-- #item-meta -->
 
 </div><!-- #item-header-content -->
 
-<?php do_action( 'bp_after_member_header' ) ?>
+<?php do_action( 'bp_after_member_header' ); ?>
 
-<?php do_action( 'template_notices' ) ?>
\ No newline at end of file
+<?php do_action( 'template_notices' ); ?>
\ No newline at end of file
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 2c3ef6b0aa21965e129fa73e1965896adf4f40e3..2426fd82eb6f45c9aee7b2f8cc8446712e6559fa 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
@@ -1,29 +1,44 @@
-<div class="item-list-tabs no-ajax" id="subnav">
+<?php
+
+/**
+ * BuddyPress - Users Messages
+ *
+ * @package BuddyPress
+ * @subpackage bp-default
+ */
+
+?>
+
+<div class="item-list-tabs no-ajax" id="subnav" role="navigation">
 	<ul>
-		<?php bp_get_options_nav() ?>
+
+		<?php bp_get_options_nav(); ?>
+
 	</ul>
 </div><!-- .item-list-tabs -->
 
-<?php if ( 'compose' == bp_current_action() ) : ?>
-	<?php locate_template( array( 'members/single/messages/compose.php' ), true ) ?>
+<?php
 
-<?php elseif ( 'view' == bp_current_action() ) : ?>
-	<?php locate_template( array( 'members/single/messages/single.php' ), true ) ?>
+	if ( bp_is_current_action( 'compose' ) ) :
+		locate_template( array( 'members/single/messages/compose.php' ), true );
 
-<?php else : ?>
+	elseif ( bp_is_current_action( 'view' ) ) :
+		locate_template( array( 'members/single/messages/single.php' ), true );
 
-	<?php do_action( 'bp_before_member_messages_content' ) ?>
+	else :
+		do_action( 'bp_before_member_messages_content' ); ?>
 
-	<div class="messages">
-		<?php if ( 'notices' == bp_current_action() ) : ?>
-			<?php locate_template( array( 'members/single/messages/notices-loop.php' ), true ) ?>
+	<div class="messages" role="main">
 
-		<?php else : ?>
-			<?php locate_template( array( 'members/single/messages/messages-loop.php' ), true ) ?>
+		<?php
+			if ( bp_is_current_action( 'notices' ) )
+				locate_template( array( 'members/single/messages/notices-loop.php' ), true );
+			else
+				locate_template( array( 'members/single/messages/messages-loop.php' ), true );
+		?>
 
-		<?php endif; ?>
 	</div><!-- .messages -->
 
-	<?php do_action( 'bp_after_member_messages_content' ) ?>
+	<?php do_action( 'bp_after_member_messages_content' ); ?>
 
 <?php endif; ?>
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 3fc3720467dcefb4ec1361f4bb2796b1293c7267..00a840bc80cead9cf581bf5c8dba5597e81f96a6 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,8 +1,8 @@
-<form action="<?php bp_messages_form_action('compose') ?>" method="post" id="send_message_form" class="standard-form">
+<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' ) ?>
 
-	<label for="send-to-input"><?php _e("Send To (Username or Friend's Name)", 'buddypress') ?> &nbsp; <span class="ajax-loader"></span></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() ?>
@@ -25,8 +25,7 @@
 	<?php do_action( 'bp_after_messages_compose_content' ) ?>
 
 	<div class="submit">
-		<input type="submit" value="<?php _e( "Send Message", 'buddypress' ) ?> &rarr;" name="send" id="send" />
-		<span class="ajax-loader"></span>
+		<input type="submit" value="<?php _e( "Send Message", 'buddypress' ) ?>" name="send" id="send" />
 	</div>
 
 	<?php wp_nonce_field( 'messages_send_message' ) ?>
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 576a8311c24c6b91734ce248c6cc69b8c2e3c2d6..8c26abece2d6f4429a779046ef4e5a0b2079a006 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
@@ -17,10 +17,10 @@
 	<?php do_action( 'bp_after_member_messages_pagination' ) ?>
 	<?php do_action( 'bp_before_member_messages_threads' ) ?>
 
-	<table id="message-threads" class="zebra">
+	<table id="message-threads" class="messages-notices">
 		<?php while ( bp_message_threads() ) : bp_message_thread(); ?>
 
-			<tr id="m-<?php bp_message_thread_id() ?>"<?php if ( bp_message_thread_has_unread() ) : ?> class="unread"<?php else: ?> class="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>
 				</td>
@@ -47,7 +47,7 @@
 
 				<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" ); ?>">x</a> &nbsp;
+					<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>
 
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 77702dcb3cd67908710d2f116c52d5471a73a8e7..29d0eb1e8db0af820749d3c611eaa6812250d202 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
@@ -17,9 +17,9 @@
 	<?php do_action( 'bp_after_notices_pagination' ) ?>
 	<?php do_action( 'bp_before_notices' ) ?>
 
-	<table id="message-threads" class="zebra">
+	<table id="message-threads" class="messages-notices">
 		<?php while ( bp_message_threads() ) : bp_message_thread(); ?>
-			<tr>
+			<tr id="notice-<?php bp_message_notice_id() ?>" class="<?php bp_message_css_class(); ?>">
 				<td width="1%">
 				</td>
 				<td width="38%">
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 0dbce0ce12aaf74a690ac087e01bf273bf9b462c..35de17b7226c9e15218f3d269a1fa610897cf03b 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,4 +1,4 @@
-<div id="message-thread">
+<div id="message-thread" role="main">
 
 	<?php do_action( 'bp_before_message_thread_content' ) ?>
 
@@ -8,15 +8,27 @@
 
 		<p id="message-recipients">
 			<span class="highlight">
-				<?php printf( __('Sent between %s and %s', 'buddypress'), bp_get_the_thread_recipients(), '<a href="' . bp_get_loggedin_user_link() . '" title="' . bp_get_loggedin_user_fullname() . '">' . bp_get_loggedin_user_fullname() . '</a>' ) ?>
+
+				<?php if ( !bp_get_the_thread_recipients() ) : ?>
+
+					<?php _e( 'You are alone in this conversation.', 'buddypress' ); ?>
+
+				<?php else : ?>
+
+					<?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;
 		</p>
 
 		<?php do_action( 'bp_before_message_thread_list' ) ?>
 
 		<?php while ( bp_thread_messages() ) : bp_thread_the_message(); ?>
 
-			<div class="message-box">
+			<div class="message-box <?php bp_the_thread_message_alt_class(); ?>">
 
 				<div class="message-metadata">
 
@@ -76,11 +88,11 @@
 					<?php do_action( 'bp_after_message_reply_box' ) ?>
 
 					<div class="submit">
-						<input type="submit" name="send" value="<?php _e( 'Send Reply', 'buddypress' ) ?> &rarr;" id="send_reply_button"/>
-						<span class="ajax-loader"></span>
+						<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' ) ?>
 
 				</div><!-- .message-content -->
diff --git a/wp-content/plugins/buddypress/bp-themes/bp-default/members/single/plugins.php b/wp-content/plugins/buddypress/bp-themes/bp-default/members/single/plugins.php
index 67ef4ce90202cca561d344a4879f8c11768fecfd..aab002fbffdadc41b8258a9df27b4296b875b016 100644
--- a/wp-content/plugins/buddypress/bp-themes/bp-default/members/single/plugins.php
+++ b/wp-content/plugins/buddypress/bp-themes/bp-default/members/single/plugins.php
@@ -1,48 +1,69 @@
-<?php get_header() ?>
+<?php
+
+/**
+ * BuddyPress - Users Plugins
+ *
+ * This is a fallback file that external plugins can use if the template they
+ * need is not installed in the current theme. Use the actions in this template
+ * to output everything your plugin needs.
+ *
+ * @package BuddyPress
+ * @subpackage bp-default
+ */
+
+?>
+
+<?php get_header( 'buddypress' ); ?>
 
 	<div id="content">
 		<div class="padder">
 
-			<?php do_action( 'bp_before_member_plugin_template' ) ?>
+			<?php do_action( 'bp_before_member_plugin_template' ); ?>
 
 			<div id="item-header">
-				<?php locate_template( array( 'members/single/member-header.php' ), true ) ?>
+
+				<?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">
+				<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' ) ?>
+						<?php bp_get_displayed_user_nav(); ?>
+
+						<?php do_action( 'bp_member_options_nav' ); ?>
+
 					</ul>
 				</div>
 			</div><!-- #item-nav -->
 
-			<div id="item-body">
-				<?php do_action( 'bp_before_member_body' ) ?>
+			<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' ) ?>
+						<?php bp_get_options_nav(); ?>
+
+						<?php do_action( 'bp_member_plugin_options_nav' ); ?>
+
 					</ul>
 				</div><!-- .item-list-tabs -->
 
-				<?php do_action( 'bp_template_title' ) ?>
+				<h3><?php do_action( 'bp_template_title' ); ?></h3>
 
-				<?php do_action( 'bp_template_content' ) ?>
+				<?php do_action( 'bp_template_content' ); ?>
 
-				<?php do_action( 'bp_after_member_body' ) ?>
+				<?php do_action( 'bp_after_member_body' ); ?>
 
 			</div><!-- #item-body -->
 
-			<?php do_action( 'bp_after_member_plugin_template' ) ?>
+			<?php do_action( 'bp_after_member_plugin_template' ); ?>
 
 		</div><!-- .padder -->
 	</div><!-- #content -->
 
-	<?php locate_template( array( 'sidebar.php' ), true ) ?>
-
-<?php get_footer() ?>
\ No newline at end of file
+<?php get_sidebar( 'buddypress' ); ?>
+<?php get_footer( 'buddypress' ); ?>
diff --git a/wp-content/plugins/buddypress/bp-themes/bp-default/members/single/profile.php b/wp-content/plugins/buddypress/bp-themes/bp-default/members/single/profile.php
index 4118c3a4df3df3550d1a572b4c474c0ff6286754..8c023e11ba2f20682af4c29ee4085ef123162934 100644
--- a/wp-content/plugins/buddypress/bp-themes/bp-default/members/single/profile.php
+++ b/wp-content/plugins/buddypress/bp-themes/bp-default/members/single/profile.php
@@ -1,24 +1,48 @@
+<?php
+
+/**
+ * BuddyPress - Users Profile
+ *
+ * @package BuddyPress
+ * @subpackage bp-default
+ */
+
+?>
+
 <?php if ( bp_is_my_profile() ) : ?>
-	<div class="item-list-tabs no-ajax" id="subnav">
+
+	<div class="item-list-tabs no-ajax" id="subnav" role="navigation">
 		<ul>
-			<?php bp_get_options_nav() ?>
+
+			<?php bp_get_options_nav(); ?>
+
 		</ul>
 	</div><!-- .item-list-tabs -->
+
 <?php endif; ?>
 
-<?php do_action( 'bp_before_profile_content' ) ?>
+<?php do_action( 'bp_before_profile_content' ); ?>
+
+<div class="profile" role="main">
+
+	<?php
+		// Profile Edit
+		if ( bp_is_current_action( 'edit' ) )
+			locate_template( array( 'members/single/profile/edit.php' ), true );
 
-<div class="profile">
-	<?php if ( 'edit' == bp_current_action() ) : ?>
-		<?php locate_template( array( 'members/single/profile/edit.php' ), true ) ?>
+		// Change Avatar
+		elseif ( bp_is_current_action( 'change-avatar' ) )
+			locate_template( array( 'members/single/profile/change-avatar.php' ), true );
 
-	<?php elseif ( 'change-avatar' == bp_current_action() ) : ?>
-		<?php locate_template( array( 'members/single/profile/change-avatar.php' ), true ) ?>
+		// Display XProfile
+		elseif ( bp_is_active( 'xprofile' ) )
+			locate_template( array( 'members/single/profile/profile-loop.php' ), true );
 
-	<?php else : ?>
-		<?php locate_template( array( 'members/single/profile/profile-loop.php' ), true ) ?>
+		// Display WordPress profile (fallback)
+		else
+			locate_template( array( 'members/single/profile/profile-wp.php' ), true );
+	?>
 
-	<?php endif; ?>
 </div><!-- .profile -->
 
-<?php do_action( 'bp_after_profile_content' ) ?>
\ No newline at end of file
+<?php do_action( 'bp_after_profile_content' ); ?>
\ 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 6e6a0527b2c6775b06a13415f81638d579363365..b7a351e3dbcca7918892e79e97bf2900cc31dc20 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
@@ -6,10 +6,11 @@
 
 	<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" enctype="multipart/form-data">
+	<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>
 
 			<p id="avatar-upload">
@@ -23,8 +24,6 @@
 				<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 wp_nonce_field( 'bp_avatar_upload' ) ?>
-
 		<?php endif; ?>
 
 		<?php if ( 'crop-image' == bp_get_avatar_admin_step() ) : ?>
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 cab1c71639f8ff64d0d5694e638794e4d08978fa..e863b1a0aa43ad67378d1a63feae98f66ee2cc18 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
@@ -1,15 +1,18 @@
-<?php do_action( 'bp_before_profile_edit_content' ) ?>
+<?php do_action( 'bp_before_profile_edit_content' );
 
-<?php if ( bp_has_profile( 'profile_group_id=' . bp_get_current_profile_group_id() ) ) : while ( bp_profile_groups() ) : bp_the_profile_group(); ?>
+if ( bp_has_profile( 'profile_group_id=' . bp_get_current_profile_group_id() ) ) :
+	while ( bp_profile_groups() ) : bp_the_profile_group(); ?>
 
-<form action="<?php bp_the_profile_group_edit_form_action() ?>" method="post" id="profile-edit-form" class="standard-form <?php bp_the_profile_group_slug() ?>">
+<form action="<?php bp_the_profile_group_edit_form_action(); ?>" method="post" id="profile-edit-form" class="standard-form <?php bp_the_profile_group_slug(); ?>">
 
-	<?php do_action( 'bp_before_profile_field_content' ) ?>
+	<?php do_action( 'bp_before_profile_field_content' ); ?>
 
 		<h4><?php printf( __( "Editing '%s' Profile Group", "buddypress" ), bp_get_the_profile_group_name() ); ?></h4>
 
 		<ul class="button-nav">
+
 			<?php bp_profile_group_tabs(); ?>
+
 		</ul>
 
 		<div class="clear"></div>
@@ -20,22 +23,22 @@
 
 				<?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>
-					<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>
+					<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 if ( bp_get_the_profile_field_is_required() ) : ?>aria-required="true"<?php endif; ?>/>
 
 				<?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>
-					<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>
+					<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; ?>
 
 				<?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>
-					<select name="<?php bp_the_profile_field_input_name() ?>" id="<?php bp_the_profile_field_input_name() ?>">
+					<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() ?>
 					</select>
 
@@ -43,13 +46,17 @@
 
 				<?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 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>
+					<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(); ?>
+
 					</select>
 
 					<?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; ?>
 
 				<?php endif; ?>
@@ -57,12 +64,14 @@
 				<?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 bp_the_profile_field_options() ?>
+						<?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>
 
@@ -71,9 +80,9 @@
 				<?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 bp_the_profile_field_options() ?>
+						<?php bp_the_profile_field_options(); ?>
 					</div>
 
 				<?php endif; ?>
@@ -81,41 +90,48 @@
 				<?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>
+						<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>
+
+						<select name="<?php bp_the_profile_field_input_name(); ?>_day" id="<?php bp_the_profile_field_input_name(); ?>_day" <?php if ( bp_get_the_profile_field_is_required() ) : ?>aria-required="true"<?php endif; ?>>
+
+							<?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 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 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 if ( bp_get_the_profile_field_is_required() ) : ?>aria-required="true"<?php endif; ?>>
+
+							<?php bp_the_profile_field_options( 'type=year' ); ?>
+
 						</select>
 					</div>
 
 				<?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; ?>
 
-	<?php do_action( 'bp_after_profile_field_content' ) ?>
+	<?php do_action( 'bp_after_profile_field_content' ); ?>
 
 	<div class="submit">
-		<input type="submit" name="profile-group-edit-submit" id="profile-group-edit-submit" value="<?php _e( 'Save Changes', 'buddypress' ) ?> " />
+		<input type="submit" name="profile-group-edit-submit" id="profile-group-edit-submit" value="<?php _e( 'Save Changes', 'buddypress' ); ?> " />
 	</div>
 
-	<input type="hidden" name="field_ids" id="field_ids" value="<?php bp_the_profile_group_field_ids() ?>" />
-	<?php wp_nonce_field( 'bp_xprofile_edit' ) ?>
+	<input type="hidden" name="field_ids" id="field_ids" value="<?php bp_the_profile_group_field_ids(); ?>" />
+
+	<?php wp_nonce_field( 'bp_xprofile_edit' ); ?>
 
 </form>
 
 <?php endwhile; endif; ?>
 
-<?php do_action( 'bp_after_profile_edit_content' ) ?>
\ No newline at end of file
+<?php do_action( 'bp_after_profile_edit_content' ); ?>
diff --git a/wp-content/plugins/buddypress/bp-themes/bp-default/members/single/profile/profile-loop.php b/wp-content/plugins/buddypress/bp-themes/bp-default/members/single/profile/profile-loop.php
index d2459aa01a34da761aa27bd2c9a971712c16a4b3..b90d0a882d526c6dada04065e196d808d09c5b76 100644
--- a/wp-content/plugins/buddypress/bp-themes/bp-default/members/single/profile/profile-loop.php
+++ b/wp-content/plugins/buddypress/bp-themes/bp-default/members/single/profile/profile-loop.php
@@ -1,59 +1,48 @@
-<?php do_action( 'bp_before_profile_loop_content' ) ?>
+<?php do_action( 'bp_before_profile_loop_content' ); ?>
 
-<?php if ( function_exists('xprofile_get_profile') ) : ?>
+<?php if ( bp_has_profile() ) : ?>
 
-	<?php if ( bp_has_profile() ) : ?>
+	<?php while ( bp_profile_groups() ) : bp_the_profile_group(); ?>
 
-		<?php while ( bp_profile_groups() ) : bp_the_profile_group(); ?>
+		<?php if ( bp_profile_group_has_fields() ) : ?>
 
-			<?php if ( bp_profile_group_has_fields() ) : ?>
+			<?php do_action( 'bp_before_profile_field_content' ); ?>
 
-				<?php do_action( 'bp_before_profile_field_content' ) ?>
+			<div class="bp-widget <?php bp_the_profile_group_slug(); ?>">
 
-				<div class="bp-widget <?php bp_the_profile_group_slug() ?>">
-					<?php if ( 1 != bp_get_the_profile_group_id() ) : ?>
-						<h4><?php bp_the_profile_group_name() ?></h4>
-					<?php endif; ?>
+				<h4><?php bp_the_profile_group_name(); ?></h4>
 
-					<table class="profile-fields zebra">
-						<?php while ( bp_profile_fields() ) : bp_the_profile_field(); ?>
+				<table class="profile-fields">
 
-							<?php if ( bp_field_has_data() ) : ?>
-								<tr<?php bp_field_css_class() ?>>
+					<?php while ( bp_profile_fields() ) : bp_the_profile_field(); ?>
 
-									<td class="label">
-										<?php bp_the_profile_field_name() ?>
-									</td>
+						<?php if ( bp_field_has_data() ) : ?>
 
-									<td class="data">
-										<?php bp_the_profile_field_value() ?>
-									</td>
+							<tr<?php bp_field_css_class(); ?>>
 
-								</tr>
-							<?php endif; ?>
+								<td class="label"><?php bp_the_profile_field_name(); ?></td>
 
-							<?php do_action( 'bp_profile_field_item' ) ?>
+								<td class="data"><?php bp_the_profile_field_value(); ?></td>
 
-						<?php endwhile; ?>
-					</table>
-				</div>
+							</tr>
 
-				<?php do_action( 'bp_after_profile_field_content' ) ?>
+						<?php endif; ?>
 
-			<?php endif; ?>
+						<?php do_action( 'bp_profile_field_item' ); ?>
 
-		<?php endwhile; ?>
+					<?php endwhile; ?>
 
-		<?php do_action( 'bp_profile_field_buttons' ) ?>
+				</table>
+			</div>
 
-	<?php endif; ?>
+			<?php do_action( 'bp_after_profile_field_content' ); ?>
 
-<?php else : ?>
+		<?php endif; ?>
 
-	<?php /* Just load the standard WP profile information, if BP extended profiles are not loaded. */ ?>
-	<?php bp_core_get_wp_profile() ?>
+	<?php endwhile; ?>
 
-<?php endif; ?>
+	<?php do_action( 'bp_profile_field_buttons' ); ?>
 
-<?php do_action( 'bp_after_profile_loop_content' ) ?>
+<?php endif; ?>
 
+<?php do_action( 'bp_after_profile_loop_content' ); ?>
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
new file mode 100644
index 0000000000000000000000000000000000000000..9756265b683e3f05f0d595902e24b2850fc3d39d
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-themes/bp-default/members/single/profile/profile-wp.php
@@ -0,0 +1,73 @@
+<?php do_action( 'bp_before_profile_loop_content' ) ?>
+
+<?php $ud = get_userdata( bp_displayed_user_id() ); ?>
+
+<?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>
+
+		<table class="wp-profile-fields">
+
+			<?php if ( $ud->display_name ) : ?>
+
+				<tr id="wp_displayname">
+					<td class="label"><?php _e( 'Name', 'buddypress' ); ?></td>
+					<td class="data"><?php echo $ud->display_name; ?></td>
+				</tr>
+
+			<?php endif; ?>
+
+			<?php if ( $ud->user_description ) : ?>
+
+				<tr id="wp_desc">
+					<td class="label"><?php _e( 'About Me', 'buddypress' ); ?></td>
+					<td class="data"><?php echo $ud->user_description; ?></td>
+				</tr>
+
+			<?php endif; ?>
+
+			<?php if ( $ud->user_url ) : ?>
+
+				<tr id="wp_website">
+					<td class="label"><?php _e( 'Website', 'buddypress' ); ?></td>
+					<td class="data"><?php echo make_clickable( $ud->user_url ); ?></td>
+				</tr>
+
+			<?php endif; ?>
+
+			<?php if ( $ud->jabber ) : ?>
+
+				<tr id="wp_jabber">
+					<td class="label"><?php _e( 'Jabber', 'buddypress' ); ?></td>
+					<td class="data"><?php echo $ud->jabber; ?></td>
+				</tr>
+
+			<?php endif; ?>
+
+			<?php if ( $ud->aim ) : ?>
+
+				<tr id="wp_aim">
+					<td class="label"><?php _e( 'AOL Messenger', 'buddypress' ); ?></td>
+					<td class="data"><?php echo $ud->aim; ?></td>
+				</tr>
+
+			<?php endif; ?>
+
+			<?php if ( $ud->yim ) : ?>
+
+				<tr id="wp_yim">
+					<td class="label"><?php _e( 'Yahoo Messenger', 'buddypress' ); ?></td>
+					<td class="data"><?php echo $ud->yim; ?></td>
+				</tr>
+
+			<?php endif; ?>
+
+		</table>
+	</div>
+
+<?php do_action( 'bp_after_profile_field_content' ) ?>
+
+<?php do_action( 'bp_profile_field_buttons' ) ?>
+
+<?php do_action( 'bp_after_profile_loop_content' ) ?>
diff --git a/wp-content/plugins/buddypress/bp-themes/bp-default/members/single/settings.php b/wp-content/plugins/buddypress/bp-themes/bp-default/members/single/settings.php
new file mode 100644
index 0000000000000000000000000000000000000000..b981df8aac157f5974f52d1d4afd76956d75dcc8
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-themes/bp-default/members/single/settings.php
@@ -0,0 +1,38 @@
+<?php
+
+/**
+ * BuddyPress - Users Settings
+ *
+ * @package BuddyPress
+ * @subpackage bp-default
+ */
+
+?>
+
+<div class="item-list-tabs no-ajax" id="subnav" role="navigation">
+	<ul>
+		<?php if ( bp_is_my_profile() ) : ?>
+		
+			<?php bp_get_options_nav(); ?>
+		
+		<?php endif; ?>
+	</ul>
+</div>
+
+<?php
+
+if ( bp_is_current_action( 'notifications' ) ) :
+	 locate_template( array( 'members/single/settings/notifications.php' ), true );
+
+elseif ( bp_is_current_action( 'delete-account' ) ) :
+	 locate_template( array( 'members/single/settings/delete-account.php' ), true );
+
+elseif ( bp_is_current_action( 'general' ) ) :
+	locate_template( array( 'members/single/settings/general.php' ), true );
+
+else :
+	locate_template( array( 'members/single/plugins.php' ), true );
+
+endif;
+
+?>
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
new file mode 100644
index 0000000000000000000000000000000000000000..d67f4835502898a4217ef51e7c789f8473c79324
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-themes/bp-default/members/single/settings/delete-account.php
@@ -0,0 +1,82 @@
+<?php
+
+/**
+ * BuddyPress Delete Account
+ *
+ * @package BuddyPress
+ * @subpackage bp-default
+ */
+?>
+
+<?php 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( '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">
+						<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>
+
+					<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 do_action( 'bp_members_delete_account_before_submit' ); ?>
+
+					<div class="submit">
+						<input type="submit" disabled="disabled" value="<?php _e( 'Delete My 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' ); ?>
+
+			</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/general.php b/wp-content/plugins/buddypress/bp-themes/bp-default/members/single/settings/general.php
new file mode 100644
index 0000000000000000000000000000000000000000..2bef2a1b4a0eee217b1e2f6c03af2c32c0494bab
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-themes/bp-default/members/single/settings/general.php
@@ -0,0 +1,89 @@
+<?php
+
+/**
+ * BuddyPress Member Settings
+ *
+ * @package BuddyPress
+ * @subpackage bp-default
+ */
+?>
+
+<?php 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( 'General Settings', 'buddypress' ); ?></h3>
+
+				<?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>
+
+					<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" />
+
+					<label for="pass1"><?php _e( 'Change Password <span>(leave blank for no change)</span>', 'buddypress' ); ?></label>
+					<input type="password" name="pass1" id="pass1" size="16" value="" class="settings-input small" /> &nbsp;<?php _e( 'New Password', 'buddypress' ); ?><br />
+					<input type="password" name="pass2" id="pass2" size="16" value="" class="settings-input small" /> &nbsp;<?php _e( 'Repeat New Password', 'buddypress' ); ?>
+
+					<?php do_action( 'bp_core_general_settings_before_submit' ); ?>
+
+					<div class="submit">
+						<input type="submit" name="submit" value="<?php _e( 'Save Changes', 'buddypress' ); ?>" id="submit" class="auto" />
+					</div>
+
+					<?php do_action( 'bp_core_general_settings_after_submit' ); ?>
+
+					<?php wp_nonce_field( 'bp_settings_general' ); ?>
+
+				</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/notifications.php b/wp-content/plugins/buddypress/bp-themes/bp-default/members/single/settings/notifications.php
new file mode 100644
index 0000000000000000000000000000000000000000..7a51f7b01013dbeb954b7586310f9a704dbaad5f
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-themes/bp-default/members/single/settings/notifications.php
@@ -0,0 +1,82 @@
+<?php
+
+/**
+ * BuddyPress Notification Settings
+ *
+ * @package BuddyPress
+ * @subpackage bp-default
+ */
+?>
+
+<?php 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( 'Email Notification', 'buddypress' ); ?></h3>
+
+				<?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>
+
+					<?php do_action( 'bp_notification_settings' ); ?>
+
+					<?php do_action( 'bp_members_notification_settings_before_submit' ); ?>
+
+					<div class="submit">
+						<input type="submit" name="submit" value="<?php _e( 'Save Changes', 'buddypress' ); ?>" id="submit" class="auto" />
+					</div>
+
+					<?php do_action( 'bp_members_notification_settings_after_submit' ); ?>
+
+					<?php wp_nonce_field('bp_settings_notifications'); ?>
+
+				</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/onecolumn-page.php b/wp-content/plugins/buddypress/bp-themes/bp-default/onecolumn-page.php
new file mode 100644
index 0000000000000000000000000000000000000000..f5d3261d043157701b933dfa3df9a6ac02b4b3ee
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-themes/bp-default/onecolumn-page.php
@@ -0,0 +1,49 @@
+<?php
+/*
+ * Template Name: One column, no sidebar
+ *
+ * A custom page template without sidebar.
+ *
+ * @package BuddyPress
+ * @subpackage BP_Default
+ * @since 1.5
+ */
+
+get_header() ?>
+
+	<div id="content">
+		<div class="padder one-column">
+
+		<?php do_action( 'bp_before_blog_page' ) ?>
+
+		<div class="page" id="blog-page" role="main">
+
+			<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
+
+				<h2 class="pagetitle"><?php the_title(); ?></h2>
+
+				<div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
+
+					<div class="entry">
+
+						<?php the_content( __( '<p class="serif">Read the rest of this page &rarr;</p>', 'buddypress' ) ); ?>
+
+						<?php wp_link_pages( array( 'before' => '<div class="page-link"><p>' . __( 'Pages: ', 'buddypress' ), 'after' => '</p></div>', 'next_or_number' => 'number' ) ); ?>
+						<?php edit_post_link( __( 'Edit this page.', 'buddypress' ), '<p class="edit-link">', '</p>'); ?>
+
+					</div>
+
+				</div>
+
+			<?php comments_template(); ?>
+
+			<?php endwhile; endif; ?>
+
+		</div><!-- .page -->
+
+		<?php do_action( 'bp_after_blog_page' ) ?>
+
+		</div><!-- .padder -->
+	</div><!-- #content -->
+
+<?php get_footer(); ?>
\ No newline at end of file
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 b64c7c4110fd0b84fc2015da3f5bec6a2ca10667..af0c10954c35ac96e8b5b431bdc8f78063706881 100644
--- a/wp-content/plugins/buddypress/bp-themes/bp-default/page.php
+++ b/wp-content/plugins/buddypress/bp-themes/bp-default/page.php
@@ -5,25 +5,27 @@
 
 		<?php do_action( 'bp_before_blog_page' ) ?>
 
-		<div class="page" id="blog-page">
+		<div class="page" id="blog-page" role="main">
 
 			<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
 
 				<h2 class="pagetitle"><?php the_title(); ?></h2>
 
-				<div class="post" id="post-<?php the_ID(); ?>">
+				<div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
 
 					<div class="entry">
 
 						<?php the_content( __( '<p class="serif">Read the rest of this page &rarr;</p>', 'buddypress' ) ); ?>
 
-						<?php wp_link_pages( array( 'before' => __( '<p><strong>Pages:</strong> ', 'buddypress' ), 'after' => '</p>', 'next_or_number' => 'number')); ?>
-						<?php edit_post_link( __( 'Edit this entry.', 'buddypress' ), '<p>', '</p>'); ?>
+						<?php wp_link_pages( array( 'before' => '<div class="page-link"><p>' . __( 'Pages: ', 'buddypress' ), 'after' => '</p></div>', 'next_or_number' => 'number' ) ); ?>
+						<?php edit_post_link( __( 'Edit this page.', 'buddypress' ), '<p class="edit-link">', '</p>'); ?>
 
 					</div>
 
 				</div>
 
+			<?php comments_template(); ?>
+
 			<?php endwhile; endif; ?>
 
 		</div><!-- .page -->
@@ -33,6 +35,6 @@
 		</div><!-- .padder -->
 	</div><!-- #content -->
 
-	<?php locate_template( array( 'sidebar.php' ), true ) ?>
+	<?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
new file mode 100644
index 0000000000000000000000000000000000000000..ab411eeafce4bde629e65ef9314a257255a40c16
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-themes/bp-default/readme.txt
@@ -0,0 +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 ---
+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 fb20fd087162c6d12f846d5fbad9657e6e5c050d..f7fcf19d4672cf309172909738f313e8d3e3d6d5 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
@@ -1,6 +1,4 @@
-<?php /* This template is only used on multisite installations */ ?>
-
-<?php get_header(); ?>
+<?php get_header( 'buddypress' ); ?>
 
 	<div id="content">
 		<div class="padder">
@@ -9,8 +7,6 @@
 
 		<div class="page" id="activate-page">
 
-			<?php do_action( 'template_notices' ) ?>
-
 			<?php if ( bp_account_was_activated() ) : ?>
 
 				<h2 class="widgettitle"><?php _e( 'Account Activated', 'buddypress' ) ?></h2>
@@ -37,7 +33,7 @@
 					<input type="text" name="key" id="key" value="" />
 
 					<p class="submit">
-						<input type="submit" name="submit" value="<?php _e( 'Activate', 'buddypress' ) ?> &rarr;" />
+						<input type="submit" name="submit" value="<?php _e( 'Activate', 'buddypress' ) ?>" />
 					</p>
 
 				</form>
@@ -53,6 +49,6 @@
 		</div><!-- .padder -->
 	</div><!-- #content -->
 
-	<?php locate_template( array( 'sidebar.php' ), true ) ?>
+	<?php get_sidebar( 'buddypress' ) ?>
 
-<?php get_footer(); ?>
+<?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 d50d195851b969f0a711f43c53fa874f7e4e4f74..c841cf6fb32b26af4b7dab30d5ecb05968222add 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,4 +1,4 @@
-<?php get_header() ?>
+<?php get_header( 'buddypress' ) ?>
 
 	<div id="content">
 		<div class="padder">
@@ -9,6 +9,15 @@
 
 			<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' ) ?>
+
+					<p><?php _e( 'User registration is currently not allowed.', 'buddypress' ); ?></p>
+
+				<?php do_action( 'bp_after_registration_disabled' ); ?>
+			<?php endif; // registration-disabled signup setp ?>
+
 			<?php if ( 'request-details' == bp_get_current_signup_step() ) : ?>
 
 				<h2><?php _e( 'Create an Account', 'buddypress' ) ?></h2>
@@ -56,7 +65,7 @@
 						<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 ( function_exists( 'bp_has_profile' ) ) : if ( bp_has_profile( 'profile_group_id=1' ) ) : while ( bp_profile_groups() ) : bp_the_profile_group(); ?>
+						<?php if ( bp_is_active( 'xprofile' ) ) : if ( bp_has_profile( 'profile_group_id=1' ) ) : while ( bp_profile_groups() ) : bp_the_profile_group(); ?>
 
 						<?php while ( bp_profile_fields() ) : bp_the_profile_field(); ?>
 
@@ -162,7 +171,7 @@
 					<?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' ) ?>
@@ -173,7 +182,7 @@
 
 						<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 blog', '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; ?>>
 
@@ -181,20 +190,20 @@
 							<?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 echo str_replace( 'http://', '', site_url() ) ?>
+								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 endif; ?>
 
-							<label for="signup_blog_title"><?php _e( 'Blog Title', 'buddypress' ) ?> <?php _e( '(required)', 'buddypress' ) ?></label>
+							<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 blog to appear in search engines, and in public listings around this site', 'buddypress' ) ?>:</span>
+							<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' ) ?></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' ) ?></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>
 
@@ -207,7 +216,7 @@
 				<?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' ) ?> &rarr;" />
+					<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' ) ?>
@@ -221,6 +230,7 @@
 				<h2><?php _e( 'Sign Up Complete!', 'buddypress' ) ?></h2>
 
 				<?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>
@@ -228,56 +238,7 @@
 					<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 if ( bp_is_active( 'xprofile' ) && !(int)bp_get_option( 'bp-disable-avatar-uploads' ) ) : ?>
-
-					<?php if ( 'upload-image' == bp_get_avatar_admin_step() ) : ?>
-
-						<h4><?php _e( 'Your Current Avatar', 'buddypress' ) ?></h4>
-						<p><?php _e( "We've fetched an avatar for your new account. If you'd like to change this, why not upload a new one?", 'buddypress' ) ?></p>
-
-						<div id="signup-avatar">
-							<?php bp_signup_avatar() ?>
-						</div>
-
-						<p>
-							<input type="file" name="file" id="file" />
-							<input type="submit" name="upload" id="upload" value="<?php _e( 'Upload Image', 'buddypress' ) ?>" />
-							<input type="hidden" name="action" id="action" value="bp_avatar_upload" />
-							<input type="hidden" name="signup_email" id="signup_email" value="<?php bp_signup_email_value() ?>" />
-							<input type="hidden" name="signup_username" id="signup_username" value="<?php bp_signup_username_value() ?>" />
-						</p>
-
-						<?php wp_nonce_field( 'bp_avatar_upload' ) ?>
-
-					<?php endif; ?>
-
-					<?php if ( 'crop-image' == bp_get_avatar_admin_step() ) : ?>
-
-						<h3><?php _e( 'Crop Your New Avatar', 'buddypress' ) ?></h3>
-
-						<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' ) ?>" />
-						</div>
-
-						<input type="submit" name="avatar-crop-submit" id="avatar-crop-submit" value="<?php _e( 'Crop Image', 'buddypress' ) ?>" />
-
-						<input type="hidden" name="signup_email" id="signup_email" value="<?php bp_signup_email_value() ?>" />
-						<input type="hidden" name="signup_username" id="signup_username" value="<?php bp_signup_username_value() ?>" />
-						<input type="hidden" name="signup_avatar_dir" id="signup_avatar_dir" value="<?php bp_signup_avatar_dir_value() ?>" />
-
-						<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 endif; ?>
-
-				<?php endif; ?>
+				<?php do_action( 'bp_after_registration_confirmed' ) ?>
 
 			<?php endif; // completed-confirmation signup step ?>
 
@@ -292,9 +253,7 @@
 		</div><!-- .padder -->
 	</div><!-- #content -->
 
-	<?php locate_template( array( 'sidebar.php' ), true ) ?>
-
-	<?php do_action( 'bp_after_directory_activity_content' ) ?>
+	<?php get_sidebar( 'buddypress' ) ?>
 
 	<script type="text/javascript">
 		jQuery(document).ready( function() {
@@ -307,4 +266,4 @@
 		});
 	</script>
 
-<?php get_footer() ?>
\ 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 09ce7e947a05838777de90dacc014ecedb888a46..23c5fec327c406bf4d32af329202515b9b5e650a 100644
--- a/wp-content/plugins/buddypress/bp-themes/bp-default/rtl.css
+++ b/wp-content/plugins/buddypress/bp-themes/bp-default/rtl.css
@@ -1,743 +1,24 @@
-/*
-Theme Name: BuddyPress Default
-*/
-
-/***
- * Right to left styles. This will transform the theme to read from right to left
- * for languages that support this method.
+/**
+ * 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
+ * Author: the BuddyPress team
+ * Author URI: http://buddypress.org
+ * License: GNU General Public License
+ * License URI: license.txt
+ * Tags: blue, buddypress, custom-background, custom-header, custom-menu, editor-style, featured-image-header, featured-images, fixed-width, light, right-sidebar, rtl-language-support, sticky-post, threaded-comments, translation-ready, two-columns, white
+ *
+ *** IMPORTANT - DO NOT COPY THIS THEME **
+ *
+ * If you want to make a custom theme based on this theme, DO NOT copy and edit it. By
+ * doing this you will make updates and maintainence much harder for yourself.
+ * Instead, please read this codex page on how to build a BuddyPress child theme:
+ *
+ * http://codex.buddypress.org/how-to-guides/building-a-buddypress-child-theme/
+ *
+ ***
+ *
+ * This file intentionally left blank. CSS is enqueued in functions.php
+ *
  */
-
-body {
-	direction:rtl;
-	unicode-bidi:embed;
-}
-
-/***
- * The default theme styles.
- */
-/* > Global Elements
--------------------------------------------------------------- */
-
-body {
-	background: #eaeaea url( _inc/images/background.gif ) top right repeat-x;
-}
-.clear { clear: right; }
-
-img.avatar {
-	float: right;
-}
-
-/* > Header
--------------------------------------------------------------- */
-
-	#header #search-bar {
-		left: 0;
-		right:auto;
-		text-align: left;
-	}
-
-		#header #search-bar input[type=text] {
-			margin-left: 4px;
-			margin-right: 0;
-		}
-
-		#header #search-bar input[type=submit] {
-			margin-right: 4px;
-			margin-left: 0;
-		}
-
-	#header h1 {
-		left: auto;
-		right: 20px;
-	}
-
-/* > Navigation
--------------------------------------------------------------- */
-
-ul#nav {
-	left: 15px;
-	right: auto;
-}
-	ul#nav li {
-		float: right;
-		margin: 0 0 0 5px;
-	}
-/* > Container
--------------------------------------------------------------- */
-
-div#container {
-	border-left: 0;
-	border-right: 1px solid #e0e0e0;
-}
-
-/* > Sidebar
--------------------------------------------------------------- */
-
-div#sidebar {
-	float: right;
-	margin-right: -226px;
-	margin-left:0;
-	border-right: 1px solid #e4e4e4;
-	border-left: 0;
-	-moz-border-radius-topleft: 3px;
-	-webkit-border-top-left-radius: 3px;
-	-moz-border-radius-topright: 0;
-	-webkit-border-top-right-radius: 0;
-	background: url( _inc/images/sidebar_back.gif ) top right repeat-x;
-}
-	div#sidebar div#sidebar-me img.avatar {
-		float: right;
-		margin: 0 0 15px 10px;
-	}
-
-	div#sidebar ul#bp-nav {
-		clear: right;
-	}
-
-	div#sidebar h3.widgettitle {
-		margin: 25px -19px 10px -20px;
-		clear: right;
-	}
-
-	div#sidebar ul.item-list img.avatar {
-		margin-left: 10px;
-		margin-right: 0;
-	}
-
-	div#sidebar div.item-options {
-		margin: -10px -19px 0 -20px;
-	}
-
-	div#sidebar div.item-meta, div#sidebar div.item-content {
-		margin-right: 38px;
-		margin-left: 0;
-	}
-
-/* > Content
--------------------------------------------------------------- */
-
-div#content {
-	float: right;
-	-moz-border-radius-topleft: 0;
-	-moz-border-radius-topright: 6px;
-	-webkit-border-top-right-radius: 6px;
-	-webkit-border-top-left-radius: 0;
-	-moz-border-radius-bottomleft: 0;
-	-moz-border-radius-bottomright: 6px;
-	-webkit-border-bottom-right-radius: 6px;
-	-webkit-border-bottom-left-radius: 0;
-}
-
-div#content .padder {
-	margin-left: 225px;
-	margin-right: 0;
-	border-left: 1px solid #e4e4e4;
-	border-right: 0;
-	-moz-border-radius-topright: 6px;
-	-moz-border-radius-topleft: 0;
-	-webkit-border-top-right-radius: 6px;
-	-webkit-border-top-left-radius: 0;
-	-moz-border-radius-bottomright: 6px;
-	-moz-border-radius-bottomleft: 0;
-	-webkit-border-bottom-right-radius: 6px;
-	-webkit-border-bottom-left-radius: 0;
-}
-	div#content .left-menu {
-		float: right;
-	}
-
-	div#content .main-column {
-		margin-right: 190px;
-		margin-left: 0;
-	}
-
-/* > Item Headers (Profiles, Groups)
--------------------------------------------------------------- */
-
-	div#item-header img.avatar {
-		float: right;
-		margin: 0 0 25px 15px;
-	}
-
-	div#item-header span.activity {
-		margin: 0 4px 5px 0;
-	}
-
-	div#item-header div#item-actions {
-		float: left;
-		margin: 0 15px 15px 0;
-		text-align: left;
-	}
-		div#item-header ul li {
-			float: left;
-		}
-
-	div#item-header div.generic-button, div#item-header a.button {
-		float: right;
-		margin: 10px 0 0 10px;
-	}
-
-
-/* > Item Lists (Activity, Friend, Group lists)
--------------------------------------------------------------- */
-
-		ul.item-list li img.avatar {
-			float: right;
-			margin: 0 0 10px 10px;
-		}
-
-		ul.item-list li div.item-desc {
-			margin: 10px 64px 0 0;
-		}
-
-		ul.item-list li div.action {
-			left: 0;
-			right:auto;
-			text-align: left;
-		}
-
-/* > Item Tabs
--------------------------------------------------------------- */
-
-div.item-list-tabs {
-	clear: right;
-}
-		div.item-list-tabs ul li {
-			float: right;
-			margin: 5px 5px 0 0;
-		}
-			div.item-list-tabs ul li:first-child {
-				margin-left:0;
-				margin-right: 20px;
-			}
-
-			div.item-list-tabs ul li.last {
-				float: left;
-				margin: 7px 0 0 20px;
-			}
-
-			ul li.loading a {
-				background-position: 8% 50%;
-				padding-left: 30px !important;
-				padding-right: 0 !important;
-			}
-				div#item-nav ul li.loading a {
-					background-position: 12% 50%;
-				}
-
-	div.item-list-tabs ul li.feed a {
-		background-position:right center;
-		padding-right: 20px;
-		padding-left: 0;
-	}
-
-/* > Item Body
--------------------------------------------------------------- */
-
-span.activity, div#message p {
-	border-left: 1px solid #FFE8C4;
-	border-right: 0;
-}
-
-/* > Directories (Members, Groups, Blogs, Forums)
--------------------------------------------------------------- */
-
-div.dir-search {
-	float: left;
-}
-
-/* > Pagination
--------------------------------------------------------------- */
-
-	div.pagination .pag-count {
-		float: right;
-	}
-
-	div.pagination .pagination-links {
-		float: left;
-	}
-
-/* > Buttons
--------------------------------------------------------------- */
-
-a.button, input[type=submit], input[type=button],
-ul.button-nav li a, div.generic-button a {
-	background-position:right top;
-}
-	div.accept, div.reject {
-		float: right;
-		margin-left: 0;
-		margin-right: 10px;
-	}
-
-ul.button-nav li {
-	float: right;
-	margin: 0 0 10px 10px;
-}
-
-/* > AJAX Loaders
--------------------------------------------------------------- */
-
-.ajax-loader {
-	background-position:right center !important;
-}
-
-a.loading {
-	background-position: 5% 50% !important;
-	padding-left: 25px !important;
-	padding-right: 0 !important;
-}
-
-/* > Input Forms
--------------------------------------------------------------- */
-
-			form.standard-form#signup_form div.submit { float: left; }
-			form.standard-form#signup_form div.signup-avatar { margin-left: 15px; margin-right:0;}
-
-		form.standard-form div.submit input {
-			margin-left: 15px;
-			margin-right: 0;
-		}
-
-	form.standard-form div.radio ul {
-		margin: 10px 38px 15px 0;
-	}
-
-form.standard-form #basic-details-section, form.standard-form #blog-details-section,
-form.standard-form #profile-details-section {
-	float: right;
-}
-	form.standard-form #profile-details-section { float: left; }
-	form.standard-form #blog-details-section {
-		clear: right;
-	}
-
-
-/* > Data Tables
--------------------------------------------------------------- */
-		table tr td.label {
-			border-left: 1px solid #eaeaea;
-			border-right: 0;
-		}
-
-
-	table.forum tr.closed td.td-title {
-		padding-right: 35px;
-		padding-left: 0;
-		background-position: 5% 50%;
-	}
-
-	table.forum tr > td:first-child, table.forum tr > th:first-child {
-		padding-right: 15px;
-		padding-left: 0;
-	}
-
-	table.forum tr > td:last-child, table.forum tr > th:last-child {
-		padding-left: 15px;
-		padding-right: 0;
-	}
-
-	table.forum tr th#th-title, table.forum tr th#th-poster,
-	table.forum tr th#th-group, table.forum td.td-poster,
-	table.forum td.td-group, table.forum td.td-title { text-align: right; }
-
-	table.forum td img.avatar {
-		margin-left: 5px;
-		margin-right: 0;
-	}
-
-/* > Activity Stream Posting
--------------------------------------------------------------- */
-
-	form#whats-new-form h5 {
-		margin-right: 76px;
-		margin-left: 0;
-	}
-
-	form#whats-new-form #whats-new-avatar {
-		float: right;
-	}
-
-	form#whats-new-form #whats-new-content {
-		margin-right: 54px;
-		padding-right: 22px;
-	}
-
-	form#whats-new-form #whats-new-submit {
-		float: left;
-	}
-
-/* > Activity Stream Listing
--------------------------------------------------------------- */
-
-	.activity-list li.mini .activity-avatar img.avatar,
-	.activity-list li.mini .activity-avatar img.FB_profile_pic {
-		margin-right: 36px;
-		margin-left: 0;
-	}
-		.activity-list li.activity_comment .activity-avatar img.avatar,
-		.activity-list li.activity_comment .activity-avatar img.FB_profile_pic {
-			margin-right: 20px;
-			margin-left: 0;
-		}
-
-		body.activity-permalink .activity-list li .activity-avatar img.avatar,
-		body.activity-permalink .activity-list li .activity-avatar img.FB_profile_pic {
-			margin-right: 0;
-		}
-
-	.activity-list li.mini .activity-content {
-		margin-left: 175px;
-		margin-right: 0;
-	}
-
-	.activity-list li.mini .activity-content p {
-		float: right;
-	}
-
-	.activity-list li.mini .activity-meta {
-		left: 0;
-		right: auto;
-	}
-		body.activity-permalink .activity-list li.mini .activity-meta {
-			left: 15px;
-			right: auto;
-		}
-
-	.activity-list li.mini .activity-comments {
-		clear: right;
-	}
-
-.activity-list li .activity-inreplyto {
-	margin-right: 70px;
-	margin-left: 0;
-	padding-right: 25px;
-	padding-left: 0;
-	background-position: 5% 0;
-}
-
-.activity-list .activity-content {
-	margin-right: 70px;
-	margin-left: 0;
-}
-	body.activity-permalink .activity-list li .activity-content {
-		border-left: 1px solid #ddd;
-		border-right: 0;
-		margin-right: 135px;
-		margin-left: 0;
-	}
-		body.activity-permalink .activity-list li .activity-content > p {
-			background-position: top right;
-			margin-right: -35px;
-			margin-left: 0;
-			padding: 5px 38px 0 0;
-		}
-
-	.activity-list .activity-content > p > a:first-child, span.highlight,
-	.activity-list .activity-content > .comment-header > a:first-child {
-		border-left: 1px solid #a1dcfa;
-		border-right: 0;
-		margin-left: 3px;
-		margin-right: 0;
-	}
-
-	.activity-list .activity-content .activity-inner,
-	.activity-list .activity-content blockquote {
-		margin: 15px 5px 15px 0;
-		overflow: hidden;
-	}
-
-	.activity-list .activity-content img.thumbnail {
-		float: right;
-		margin: 0 0 5px 10px;
-	}
-
-.activity-list li.load-more {
-	border-left: 1px solid #ddd;
-	border-right: 0;
-}
-
-/* > Activity Stream Comments
--------------------------------------------------------------- */
-
-div.activity-meta {
-	margin: 0 3px 20px 0;
-	clear: right;
-}
-
-.activity-list div.activity-meta a {
-	border-left: 1px solid #ddd;
-	border-right: 0;
-	margin-left: 3px;
-	margin-right: 0;
-}
-	.activity-list div.activity-meta a.acomment-reply {
-		border-left: 1px solid #FFE8C4;
-		border-right: 0;
-	}
-
-
-div.activity-comments {
-	margin: 0 75px 0 0;
-}
-
-	body.activity-permalink div.activity-comments {
-		margin-right: 135px;
-		margin-left: 0;
-	}
-
-	div.activity-comments ul {
-		clear: right;
-	}
-
-	div.activity-comments ul li {
-		padding: 10px 0 10px 15px;
-		margin-right: 15px;
-		margin-left: 0;
-	}
-		body.activity-permalink div.activity-comments ul li {
-			padding: 15px 0 15px 15px;
-		}
-
-	div.activity-comments ul li > ul {
-		margin-right: 25px;
-		margin-left: 0;
-	}
-
-	div.activity-comments div.acomment-avatar img {
-		float: right;
-		margin-left: 10px;
-		margin-right: 0;
-	}
-
-	div.activity-comments div.acomment-content {
-		margin-right: 39px;
-		margin-right: 0;
-	}
-
-	div.activity-comments form.ac-form {
-		margin: 10px 33px 10px 0;
-		border-left: 1px solid #ddd;
-		border-right: 0;
-	}
-		div.activity-comments li form.ac-form {
-			margin-left: 15px;
-			margin-right: 0;
-		}
-
-		div.activity-comments form.root {
-			margin-right: 0;
-		}
-
-		div.activity-comments form.loading {
-			background-position: 88% 95%;
-		}
-
-		div.activity-comments form div.ac-reply-avatar {
-			float: right;
-		}
-
-		div.activity-comments form div.ac-reply-content {
-			margin-right: 25px;
-			margin-left: 0;
-			padding-right: 15px;
-			padding-left: 0;
-		}
-
-/* > Private Message Threads
--------------------------------------------------------------- */
-
-	div.messages-options-nav {
-		text-align: left;
-}
-
-	div#message-thread img.avatar {
-		float: right;
-		margin: 0 0 0 10px;
-	}
-
-		div#message-thread strong span.activity {
-			margin: 4px 10px 0 0;
-		}
-
-	div#message-thread div.message-content {
-		margin-right: 45px;
-		margin-left: 0;
-	}
-
-	div#message-thread div.message-options {
-		text-align: left;
-	}
-
-/* > Group Forum Topics
--------------------------------------------------------------- */
-
-	ul#topic-post-list li div.post-content {
-		margin-right: 54px;
-		margin-left: 0;
-	}
-
-div.admin-links {
-	left: 25px;
-	right: auto
-}
-	div#topic-meta div.admin-links {
-		left: 0;
-		right: auto;
-	}
-
-
-/* > WordPress Blog Styles
--------------------------------------------------------------- */
-
-	.navigation, .paged-navigation, .comment-navigation {
-		font-family: sans-serif;
-	}
-		div.navigation .alignright {
-			float: left;
-		}
-
-		div.navigation .alignleft {
-			float: right;
-		}
-
-	div.post ul, div.post ol, div.post dl { margin: 0 1.5em 18px 0; }
-	div.post dl { margin-right: 0; }
-
-	div.post code { font-family: "Monaco", courier, sans-serif; }
-	div.post blockquote {
-		font-family: sans-serif;
-	}
-
-		div.post table th { text-align: right; }
-
-	div.post div.author-box, div.comment-avatar-box {
-		float: right;
-		margin: 0 0 15px 15px;
-		font-family: sans-serif;
-	}
-
-	div.post div.post-content, div.comment-content {
-		margin-right: 105px;
-		margin-left: 0;
-	}
-
-	div.post p.date, div.post p.postmetadata, div.comment-meta, div.comment-options {
-		font-family: sans-serif;
-	}
-
-	div.post p.postmetadata {
-		clear: right;
-	}
-
-	div.post .tags { float: right; }
-	div.post .comments { float: left; }
-
-
-	div.post dd.wp-caption p.wp-caption-text, div.post .wp-caption p.wp-caption-text {
-		padding: 0 0 5px 4px;
-	}
-
-/* > WordPress Blog Comment Styles
--------------------------------------------------------------- */
-
-	div.comment-meta em {
-		float: left;
-	}
-
-/***
- * The admin bar styles.
- */
-
-#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 { /* all list items */
-	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;
-}
-
-
-/* second-level lists */
-
-#wp-admin-bar ul li ul {
-	right: -999em;
-	left:auto;
-	margin-right: 0;
-}
-
-#wp-admin-bar ul li ul li {
-	float: right;
-}
-
-/* third-and-above-level lists */
-
-#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 { /* lists nested under hovered list items */
-	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;
-}
-
-/* Menu item css */
-
-#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-themes/bp-default/search.php b/wp-content/plugins/buddypress/bp-themes/bp-default/search.php
index e226cbd8a103667154726d8cdd1bd6a1e2c9a375..54eae9f65e5e3e8d55edc143f1821b87fd2ac299 100644
--- a/wp-content/plugins/buddypress/bp-themes/bp-default/search.php
+++ b/wp-content/plugins/buddypress/bp-themes/bp-default/search.php
@@ -5,40 +5,37 @@
 
 		<?php do_action( 'bp_before_blog_search' ) ?>
 
-		<div class="page" id="blog-search">
+		<div class="page" id="blog-search" role="main">
 
-			<h2 class="pagetitle"><?php _e( 'Blog', 'buddypress' ) ?></h2>
+			<h2 class="pagetitle"><?php _e( 'Site', 'buddypress' ) ?></h2>
 
 			<?php if (have_posts()) : ?>
 
 				<h3 class="pagetitle"><?php _e( 'Search Results', 'buddypress' ) ?></h3>
 
-				<div 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 bp_dtheme_content_nav( 'nav-above' ); ?>
 
 				<?php while (have_posts()) : the_post(); ?>
 
 					<?php do_action( 'bp_before_blog_post' ) ?>
 
-					<div class="post" id="post-<?php the_ID(); ?>">
+					<div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
 
 						<div class="author-box">
-							<?php echo get_avatar( get_the_author_email(), '50' ); ?>
-							<p><?php printf( __( 'by %s', 'buddypress' ), bp_core_get_userlink( $post->post_author ) ) ?></p>
+							<?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>
 						</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>
 
-							<p class="date"><?php the_time() ?> <em><?php _e( 'in', 'buddypress' ) ?> <?php the_category(', ') ?> <?php printf( __( 'by %s', 'buddypress' ), bp_core_get_userlink( $post->post_author ) ) ?></em></p>
+							<p class="date"><?php printf( __( '%1$s <span>in %2$s</span>', 'buddypress' ), get_the_date(), get_the_category_list( ', ' ) ); ?></p>
 
 							<div class="entry">
 								<?php the_content( __( 'Read the rest of this entry &rarr;', 'buddypress' ) ); ?>
 							</div>
 
-							<p class="postmetadata"><span class="tags"><?php the_tags( __( 'Tags: ', 'buddypress' ), ', ', '<br />'); ?></span> <span class="comments"><?php comments_popup_link( __( 'No Comments &#187;', 'buddypress' ), __( '1 Comment &#187;', 'buddypress' ), __( '% Comments &#187;', 'buddypress' ) ); ?></span></p>
+							<p class="postmetadata"><?php the_tags( '<span class="tags">' . __( 'Tags: ', 'buddypress' ), ', ', '</span>' ); ?> <span class="comments"><?php comments_popup_link( __( 'No Comments &#187;', 'buddypress' ), __( '1 Comment &#187;', 'buddypress' ), __( '% Comments &#187;', 'buddypress' ) ); ?></span></p>
 						</div>
 
 					</div>
@@ -47,15 +44,12 @@
 
 				<?php endwhile; ?>
 
-				<div 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 bp_dtheme_content_nav( 'nav-below' ); ?>
 
 			<?php else : ?>
 
 				<h2 class="center"><?php _e( 'No posts found. Try a different search?', 'buddypress' ) ?></h2>
-				<?php locate_template( array( '/searchform.php'), true ) ?>
+				<?php get_search_form() ?>
 
 			<?php endif; ?>
 
@@ -66,6 +60,6 @@
 		</div><!-- .padder -->
 	</div><!-- #content -->
 
-	<?php locate_template( array( 'sidebar.php' ), true ) ?>
+	<?php get_sidebar() ?>
 
 <?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 cbcdaeda7f76376ee0ae1a1948623ce7b626d66c..633dcff041a1589fbc0524ba5504caccd5ed8b1c 100755
--- a/wp-content/plugins/buddypress/bp-themes/bp-default/searchform.php
+++ b/wp-content/plugins/buddypress/bp-themes/bp-default/searchform.php
@@ -1,6 +1,6 @@
 <?php do_action( 'bp_before_blog_search_form' ) ?>
 
-<form method="get" id="searchform" action="<?php bloginfo('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' ) ?>" />
 
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
new file mode 100644
index 0000000000000000000000000000000000000000..2a04443c70e6d3f4d6ccffbf2f1d704dc7da33b2
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-themes/bp-default/sidebar-footer.php
@@ -0,0 +1,50 @@
+<?php
+	/* The footer widget area is triggered if any of the areas
+	 * have widgets. So let's check that first.
+	 *
+	 * If none of the sidebars have widgets, then let's 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.
+?>
+
+			<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; ?>
+
+			</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 c1579d7c0cd6a15243b0cf61a59c5b755f338b7d..42fae58874bba7b8277fe9fa07d2af3740dc1ec5 100644
--- a/wp-content/plugins/buddypress/bp-themes/bp-default/sidebar.php
+++ b/wp-content/plugins/buddypress/bp-themes/bp-default/sidebar.php
@@ -1,6 +1,6 @@
 <?php do_action( 'bp_before_sidebar' ) ?>
 
-<div id="sidebar">
+<div id="sidebar" role="complementary">
 	<div class="padder">
 
 	<?php do_action( 'bp_inside_before_sidebar' ) ?>
@@ -22,7 +22,7 @@
 
 		<?php do_action( 'bp_after_sidebar_me' ) ?>
 
-		<?php if ( function_exists( 'bp_message_get_notices' ) ) : ?>
+		<?php if ( bp_is_active( 'messages' ) ) : ?>
 			<?php bp_message_get_notices(); /* Site wide notices to all users */ ?>
 		<?php endif; ?>
 
@@ -30,16 +30,19 @@
 
 		<?php do_action( 'bp_before_sidebar_login_form' ) ?>
 
-		<p id="login-text">
-			<?php _e( 'To start connecting please log in first.', 'buddypress' ) ?>
-			<?php if ( bp_get_signup_allowed() ) : ?>
-				<?php printf( __( ' You can also <a href="%s" title="Create an account">create an account</a>.', 'buddypress' ), site_url( BP_REGISTER_SLUG . '/' ) ) ?>
-			<?php endif; ?>
-		</p>
+		<?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() . '/' ) ) ?>
+
+			</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 />
-			<input type="text" name="log" id="sidebar-user-login" class="input" value="<?php echo esc_attr(stripslashes($user_login)); ?>" tabindex="97" /></label>
+			<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 />
 			<input type="password" name="pwd" id="sidebar-user-pass" class="input" value="" tabindex="98" /></label>
@@ -47,7 +50,7 @@
 			<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' ) ?>
-			<input type="submit" name="wp-submit" id="sidebar-wp-submit" value="<?php _e('Log In'); ?>" tabindex="100" />
+			<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>
 
@@ -56,17 +59,14 @@
 	<?php endif; ?>
 
 	<?php /* Show forum tags on the forums directory */
-	if ( BP_FORUMS_SLUG == bp_current_component() && bp_is_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>
-			<?php if ( function_exists('bp_forums_tag_heat_map') ) : ?>
-				<div id="tag-text"><?php bp_forums_tag_heat_map(); ?></div>
-			<?php endif; ?>
+			<div id="tag-text"><?php bp_forums_tag_heat_map(); ?></div>
 		</div>
 	<?php endif; ?>
 
-	<?php dynamic_sidebar( 'sidebar' ) ?>
+	<?php dynamic_sidebar( 'sidebar-1' ) ?>
 
 	<?php do_action( 'bp_inside_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 82716ad625611ba820013a84beb3f0fe65f33be6..c2aee9d76bd840b803e1dbf76e398b891b6de4be 100644
--- a/wp-content/plugins/buddypress/bp-themes/bp-default/single.php
+++ b/wp-content/plugins/buddypress/bp-themes/bp-default/single.php
@@ -3,38 +3,37 @@
 	<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">
+			<div class="page" id="blog-single" role="main">
 
 			<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
 
-				<div class="item-options">
-
-					<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>
-
-				<div class="post" id="post-<?php the_ID(); ?>">
+				<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( __( 'by %s', 'buddypress' ), bp_core_get_userlink( $post->post_author ) ) ?></p>
+						<p><?php printf( _x( 'by %s', 'Post written by...', 'buddypress' ), str_replace( '<a href=', '<a rel="author" href=', 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"><?php the_title(); ?></h2>
 
-						<p class="date"><?php the_time() ?> <em><?php _e( 'in', 'buddypress' ) ?> <?php the_category(', ') ?> <?php printf( __( 'by %s', 'buddypress' ), bp_core_get_userlink( $post->post_author ) ) ?></em> <?php edit_post_link( __( 'Edit this entry', 'buddypress' ), '<em class="edit-link">', '</em>' ); ?></p>
+						<p class="date">
+							<?php printf( __( '%1$s <span>in %2$s</span>', 'buddypress' ), get_the_date(), get_the_category_list( ', ' ) ); ?>
+							<span class="post-utility alignright"><?php edit_post_link( __( 'Edit this entry', 'buddypress' ) ); ?></span>
+						</p>
 
 						<div class="entry">
 							<?php the_content( __( 'Read the rest of this entry &rarr;', 'buddypress' ) ); ?>
 
-							<?php wp_link_pages(array('before' => __( '<p><strong>Pages:</strong> ', 'buddypress' ), 'after' => '</p>', 'next_or_number' => 'number')); ?>
+							<?php wp_link_pages( array( 'before' => '<div class="page-link"><p>' . __( 'Pages: ', 'buddypress' ), 'after' => '</p></div>', 'next_or_number' => 'number' ) ); ?>
 						</div>
 
-						<p class="postmetadata"><span class="tags"><?php the_tags( __( 'Tags: ', 'buddypress' ), ', ', '<br />'); ?></span> <span class="comments"><?php comments_popup_link( __( 'No Comments &#187;', 'buddypress' ), __( '1 Comment &#187;', 'buddypress' ), __( '% Comments &#187;', 'buddypress' ) ); ?></span></p>
+						<p class="postmetadata"><?php the_tags( '<span class="tags">' . __( 'Tags: ', 'buddypress' ), ', ', '</span>' ); ?>&nbsp;</p>
+
+						<div class="alignleft"><?php previous_post_link( '%link', '<span class="meta-nav">' . _x( '&larr;', 'Previous post link', 'buddypress' ) . '</span> %title' ); ?></div>
+						<div class="alignright"><?php next_post_link( '%link', '%title <span class="meta-nav">' . _x( '&rarr;', 'Next post link', 'buddypress' ) . '</span>' ); ?></div>
 					</div>
 
 				</div>
@@ -54,6 +53,6 @@
 		</div><!-- .padder -->
 	</div><!-- #content -->
 
-	<?php locate_template( array( 'sidebar.php' ), true ) ?>
+	<?php get_sidebar() ?>
 
 <?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 03ccd06692afa949632de5c1d22852a74fc1056b..23c5fec327c406bf4d32af329202515b9b5e650a 100644
--- a/wp-content/plugins/buddypress/bp-themes/bp-default/style.css
+++ b/wp-content/plugins/buddypress/bp-themes/bp-default/style.css
@@ -1,26 +1,24 @@
-/*
-Theme Name: BuddyPress Default
-Theme URI: http://buddypress.org/extend/themes/
-Description: The default theme for BuddyPress.
-Version: 1.2.7
-Author: BuddyPress.org
-Author URI: http://buddypress.org
-Tags: buddypress, two-columns, custom-header, white, blue
-
-** IMPORTANT - DO NOT COPY THIS THEME **
-If you want to make a custom theme based on this theme, DO NOT copy and edit it. By
-doing this you will make upgrades and maintainence much harder for yourself.
-Instead, please read this codex page on how to build a BuddyPress child theme:
-
-http://codex.buddypress.org/how-to-guides/building-a-buddypress-child-theme/
-*/
-
-/***
- * The default theme styles.
+/**
+ * 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
+ * Author: the BuddyPress team
+ * Author URI: http://buddypress.org
+ * License: GNU General Public License
+ * License URI: license.txt
+ * Tags: blue, buddypress, custom-background, custom-header, custom-menu, editor-style, featured-image-header, featured-images, fixed-width, light, right-sidebar, rtl-language-support, sticky-post, threaded-comments, translation-ready, two-columns, white
+ *
+ *** IMPORTANT - DO NOT COPY THIS THEME **
+ *
+ * If you want to make a custom theme based on this theme, DO NOT copy and edit it. By
+ * doing this you will make updates and maintainence much harder for yourself.
+ * Instead, please read this codex page on how to build a BuddyPress child theme:
+ *
+ * http://codex.buddypress.org/how-to-guides/building-a-buddypress-child-theme/
+ *
+ ***
+ *
+ * This file intentionally left blank. CSS is enqueued in functions.php
+ *
  */
-@import url( _inc/css/default.css );
-
-/***
- * The admin bar default styles
- */
-@import url( _inc/css/adminbar.css );
\ No newline at end of file
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 b766abfcbba0964ae3a0d6752b21e6d11d3eed88..a84c0e764c1a31d8b84ffa442399ebf98ac2f9cd 100644
--- a/wp-content/plugins/buddypress/bp-xprofile/admin/css/admin.css
+++ b/wp-content/plugins/buddypress/bp-xprofile/admin/css/admin.css
@@ -1,92 +1 @@
-table.field-group tbody {
-	cursor: move;
-}
-	table.field-group tbody tr.nodrag {
-		cursor: default !important;
-	}
-
-table.field-group tbody tr:hover {
-	background-color: #fffee9;
-}
-	
-table.field-group tr.header td {
-	border-bottom: 2px solid #eee;
-	font-weight: bold;
-}
-
-tr.core td { color: #999; }
-
-	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 0px;
-	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
+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
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
new file mode 100644
index 0000000000000000000000000000000000000000..5845c7ee60a1debf418eac2ab3905c991472a2e2
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-xprofile/admin/css/admin.dev.css
@@ -0,0 +1,266 @@
+/* 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%;
+	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;
+	}
+
+	/* Field group tabs */
+	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;
+		}
+
+		/* Selected tab */
+		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;
+		}
+
+	/* 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;
+		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 0px;
+	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/images/cross.gif b/wp-content/plugins/buddypress/bp-xprofile/admin/images/cross.gif
new file mode 100644
index 0000000000000000000000000000000000000000..4ec7be8ba97a21aa964aba41601a5213947381df
Binary files /dev/null and b/wp-content/plugins/buddypress/bp-xprofile/admin/images/cross.gif differ
diff --git a/wp-content/plugins/buddypress/bp-xprofile/admin/images/move-x.gif b/wp-content/plugins/buddypress/bp-xprofile/admin/images/move-x.gif
new file mode 100644
index 0000000000000000000000000000000000000000..684d667dd16ae4602660166350bd3cebb7662265
Binary files /dev/null and b/wp-content/plugins/buddypress/bp-xprofile/admin/images/move-x.gif differ
diff --git a/wp-content/plugins/buddypress/bp-xprofile/admin/images/move.gif b/wp-content/plugins/buddypress/bp-xprofile/admin/images/move.gif
index 748fbf9b74bd84a57a6828fa68198c67f2fed4f5..fd2dac159ab6e5c707e521c9818c6f26789bd4c1 100644
Binary files a/wp-content/plugins/buddypress/bp-xprofile/admin/images/move.gif and b/wp-content/plugins/buddypress/bp-xprofile/admin/images/move.gif differ
diff --git a/wp-content/plugins/buddypress/bp-xprofile/admin/images/move.png b/wp-content/plugins/buddypress/bp-xprofile/admin/images/move.png
new file mode 100644
index 0000000000000000000000000000000000000000..4894c75f0b87da677f32a94466bc67da6486deb8
Binary files /dev/null and b/wp-content/plugins/buddypress/bp-xprofile/admin/images/move.png differ
diff --git a/wp-content/plugins/buddypress/bp-xprofile/admin/images/plus.gif b/wp-content/plugins/buddypress/bp-xprofile/admin/images/plus.gif
new file mode 100644
index 0000000000000000000000000000000000000000..726c92cabe1aa0de1b3fa5bc4347c2a44a40ed68
Binary files /dev/null and b/wp-content/plugins/buddypress/bp-xprofile/admin/images/plus.gif differ
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
new file mode 100644
index 0000000000000000000000000000000000000000..d4e64a929143d4499bb53ac540336af4e46b07a1
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-xprofile/admin/js/admin.dev.js
@@ -0,0 +1,218 @@
+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 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');
+	label.setAttribute('for', forWhat + '_option' + theId);
+
+	var txt = document.createTextNode("Option " + theId + ": ");
+	label.appendChild(txt);
+
+	var isDefault = document.createElement('input');
+
+	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('value', theId);
+
+	var label1 = document.createElement('label');
+	var txt1 = document.createTextNode(" Default Value ");
+
+	label1.appendChild(txt1);
+	label1.setAttribute('for', 'isDefault_' + forWhat + '_option[]');
+	toDelete = document.createElement('a');
+
+	toDeleteText = document.createTextNode('[x]');
+	toDelete.setAttribute('href',"javascript:hide('" + forWhat + '_div' + theId + "')");
+
+	toDelete.setAttribute('class','delete');
+
+	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);
+
+
+	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";
+
+	if(forWhat == "radio")
+		document.getElementById("radio").style.display = "";
+
+	if(forWhat == "selectbox")
+		document.getElementById("selectbox").style.display = "";
+
+	if(forWhat == "multiselectbox")
+		document.getElementById("multiselectbox").style.display = "";
+
+	if(forWhat == "checkbox")
+		document.getElementById("checkbox").style.display = "";
+}
+
+function hide(id) {
+	if ( !document.getElementById(id) ) return false;
+
+	document.getElementById(id).style.display = "none";
+	document.getElementById(id).value = '';
+}
+
+// Set up deleting options ajax
+jQuery(document).ready( function() {
+
+	jQuery("a.ajax-option-delete").click(
+		function() {
+			var theId = this.id.split('-');
+			theId = theId[1];
+
+			jQuery.post( ajaxurl, {
+				action: 'xprofile_delete_option',
+				'cookie': encodeURIComponent(document.cookie),
+				'_wpnonce': jQuery("input#_wpnonce").val(),
+
+				'option_id': theId
+			},
+			function(response)
+			{});
+		}
+	);
+});
+
+var fixHelper = function(e, ui) {
+	ui.children().each(function() {
+		jQuery(this).width( jQuery(this).width() );
+	});
+	return ui;
+};
+
+// 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( {
+		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(response){});
+		}
+	}).disableSelection();
+
+	/* Allow reordering of fields within groups */
+	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(response)
+			{});
+		}
+	})
+
+	/* Disallow text selection */
+	.disableSelection()
+
+	/* 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 */
+	var $tab_items;
+	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 */
+			drop: function( ev, ui ) {
+				/* The tab */
+				var $item = jQuery(this);
+
+				/* The tab body */
+				var $list = jQuery( $item.find( 'a' ).attr( 'href' ) ).find( '.connectedSortable' );
+
+				/* Remove helper class */
+				jQuery($item).removeClass( 'drop-candidate' );
+
+				/* Hide field, change selected tab, and show new placement */
+				ui.draggable.hide( 'slow', function() {
+
+					/* Select new tab as current */
+					$tabs.tabs( 'select', $tab_items.index( $item ) );
+
+					/* Show new placement */
+					jQuery(this).appendTo($list).show( 'slow' ).animate( {opacity: "1"}, 500 );
+
+					/* 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 */
+					jQuery.post( ajaxurl, {
+						action: 'xprofile_reorder_fields',
+						'cookie': encodeURIComponent(document.cookie),
+						'_wpnonce_reorder_fields': jQuery( "input#_wpnonce_reorder_fields" ).val(),
+						'field_order': jQuery( $list ).sortable( 'serialize' ),
+						'field_group_id': jQuery( $list ).attr( 'id' )
+					},
+					function(response){});
+				});
+			},
+			over: function( event, ui ) {
+				jQuery(this).addClass( 'drop-candidate' );
+			},
+			out: function( event, ui ) {
+				jQuery(this).removeClass( 'drop-candidate' );
+			}
+		});
+	}
+});
\ No newline at end of file
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 6302caad3fe99719368b698fe866aa86c9139ec6..3efa1d023bf35ea1fd8ab430155bfb75c1359c12 100644
--- a/wp-content/plugins/buddypress/bp-xprofile/admin/js/admin.js
+++ b/wp-content/plugins/buddypress/bp-xprofile/admin/js/admin.js
@@ -1,136 +1 @@
-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 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');
-	label.setAttribute('for', forWhat + '_option' + theId);
-	
-	var txt = document.createTextNode("Option " + theId + ": ");
-	label.appendChild(txt);
-	
-	var isDefault = document.createElement('input');
-	
-	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('value', theId);
-	
-	var label1 = document.createElement('label');
-	var txt1 = document.createTextNode(" Default Value ");
-	
-	label1.appendChild(txt1);
-	label1.setAttribute('for', 'isDefault_' + forWhat + '_option[]');
-	toDelete = document.createElement('a');
-	
-	toDeleteText = document.createTextNode('[x]');
-	toDelete.setAttribute('href',"javascript:hide('" + forWhat + '_div' + theId + "')");
-	
-	toDelete.setAttribute('class','delete');
-
-	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);
-	
-	
-	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";
-	
-	if(forWhat == "radio") {
-		document.getElementById("radio").style.display = "";
-	}
-	
-	if(forWhat == "selectbox") {
-		document.getElementById("selectbox").style.display = "";						
-	}
-	
-	if(forWhat == "multiselectbox") {
-		document.getElementById("multiselectbox").style.display = "";						
-	}
-	
-	if(forWhat == "checkbox") {
-		document.getElementById("checkbox").style.display = "";						
-	}
-}
-
-function hide(id) {
-	if ( !document.getElementById(id) ) return false;
-	
-	document.getElementById(id).style.display = "none";
-	document.getElementById(id).value = '';
-}
-
-// Set up deleting options ajax
-jQuery(document).ready( function() {
-	
-	jQuery("a.ajax-option-delete").click( 
-		function() {
-			var theId = this.id.split('-');
-			theId = theId[1];
-			
-			jQuery.post( ajaxurl, {
-				action: 'xprofile_delete_option',
-				'cookie': encodeURIComponent(document.cookie),
-				'_wpnonce': jQuery("input#_wpnonce").val(),
-				
-				'option_id': theId
-			},
-			function(response)
-			{});
-		}
-	);				
-});
-
-var fixHelper = function(e, ui) {
-	ui.children().each(function() {
-		jQuery(this).width( jQuery(this).width() );
-	});
-	return ui;
-};
-
-jQuery(document).ready( function() {
-	jQuery("table.field-group tbody").sortable( {
-		cursor: 'move',
-		axis: 'y',
-		helper: fixHelper,
-		distance: 1,
-		cancel: 'tr.nodrag',
-		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')
-			},
-			function(response)
-			{});
-
-		}
-	});
-} );
+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
diff --git a/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-actions.php b/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-actions.php
new file mode 100644
index 0000000000000000000000000000000000000000..7eecdc18f105274b6f041f00d40a7bc836f1be2d
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-actions.php
@@ -0,0 +1,44 @@
+<?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.
+ */
+
+// Exit if accessed directly
+if ( !defined( 'ABSPATH' ) ) exit;
+
+/**
+ * This function runs when an action is set for a screen:
+ * example.com/members/andy/profile/change-avatar/ [delete-avatar]
+ *
+ * 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;
+
+	// Check the nonce
+	check_admin_referer( 'bp_delete_avatar_link' );
+
+	if ( !bp_is_my_profile() && !is_super_admin() )
+		return false;
+
+	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' );
+
+	bp_core_redirect( wp_get_referer() );
+}
+add_action( 'bp_actions', 'xprofile_action_delete_avatar' );
+
+?>
diff --git a/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-activity.php b/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-activity.php
new file mode 100644
index 0000000000000000000000000000000000000000..9a3c5e61148365aeaf580630a11a76b26854dfc5
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-activity.php
@@ -0,0 +1,134 @@
+<?php
+/**
+ * BuddyPress XProfile Activity & Notification Functions
+ *
+ * These functions handle the recording, deleting and formatting of activity and
+ * notifications for the user and for this specific component.
+ *
+ * @package BuddyPress
+ * @subpackage XProfile
+ */
+
+// Exit if accessed directly
+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_member',      __( 'New member registered', 'buddypress' ) );
+	bp_activity_set_action( $bp->profile->id, 'updated_profile', __( 'Updated Profile',       'buddypress' ) );
+
+	do_action( 'xprofile_register_activity_actions' );
+}
+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
+ * @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;
+
+	$defaults = array (
+		'user_id'           => $bp->loggedin_user->id,
+		'action'            => '',
+		'content'           => '',
+		'primary_link'      => '',
+		'component'         => $bp->profile->id,
+		'type'              => false,
+		'item_id'           => false,
+		'secondary_item_id' => false,
+		'recorded_time'     => bp_core_current_time(),
+		'hide_sitewide'     => false
+	);
+
+	$r = wp_parse_args( $args, $defaults );
+	extract( $r, EXTR_SKIP );
+
+	return bp_activity_add( array(
+		'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
+	) );
+}
+
+/**
+ * Deletes activity for a user within the profile component so that
+ * it will be removed from the users activity stream and sitewide stream (if installed)
+ *
+ * @package BuddyPress XProfile
+ * @param $args Array containing all variables used after extract() call
+ * @global object $bp Global BuddyPress settings object
+ * @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' ) ) {
+
+		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
+		) );
+	}
+}
+
+function xprofile_register_activity_action( $key, $value ) {
+	global $bp;
+
+	if ( !bp_is_active( 'activity' ) )
+		return false;
+
+	return apply_filters( 'xprofile_register_activity_action', bp_activity_set_action( $bp->profile->id, $key, $value ), $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
+ * @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 );
+
+	$userlink = bp_core_get_userlink( $user_id );
+
+	bp_activity_add( array(
+		'user_id' => $user_id,
+		'action' => apply_filters( 'bp_xprofile_new_avatar_action', sprintf( __( '%s changed their profile picture', 'buddypress' ), $userlink ), $user_id ),
+		'component' => 'profile',
+		'type' => 'new_avatar'
+	) );
+}
+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 41f0342affd55192ed65d7a5dfad881ec72a7768..6836ca915b6a594cdfbe702ec64d9f3737f0dfde 100644
--- a/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-admin.php
+++ b/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-admin.php
@@ -1,13 +1,37 @@
 <?php
+// Exit if accessed directly
+if ( !defined( 'ABSPATH' ) ) exit;
+
+/**
+ * Creates the administration interface menus and checks to see if the DB
+ * 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
+ * @return
+ */
+function xprofile_add_admin_menu() {
+	global $wpdb, $bp;
+
+	if ( !is_super_admin() )
+		return false;
 
+	$hook = add_submenu_page( 'bp-general-settings', __( 'Profile Fields', 'buddypress' ), __( 'Profile Fields', 'buddypress' ), 'manage_options', 'bp-profile-setup', 'xprofile_admin' );
 
-/**************************************************************************
- xprofile_admin()
-
- Handles all actions for the admin area for creating, editing and deleting
- profile groups and fields.
- **************************************************************************/
+	add_action( "admin_print_styles-$hook", 'bp_core_add_admin_menu_styles' );
+}
+add_action( bp_core_admin_hook(), 'xprofile_add_admin_menu' );
 
+/**
+ * Handles all actions for the admin area for creating, editing and deleting
+ * profile groups and fields.
+ */
 function xprofile_admin( $message = '', $type = 'error' ) {
 	global $bp;
 
@@ -15,128 +39,156 @@ function xprofile_admin( $message = '', $type = 'error' ) {
 
 	$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']);
-	} else if ( isset($_GET['mode']) && isset($_GET['group_id']) && isset($_GET['field_id']) && 'edit_field' == $_GET['mode'] ) {
-		xprofile_admin_manage_field($_GET['group_id'], $_GET['field_id']);
-	} else if ( isset($_GET['mode']) && isset($_GET['field_id']) && 'delete_field' == $_GET['mode'] ) {
-		xprofile_admin_delete_field($_GET['field_id'], 'field');
-	} else if ( isset($_GET['mode']) && isset($_GET['option_id']) && 'delete_option' == $_GET['mode'] ) {
-		xprofile_admin_delete_field($_GET['option_id'], 'option');
-	} else if ( isset($_GET['mode']) && 'add_group' == $_GET['mode'] ) {
+	));
+
+	if ( isset( $_GET['mode'] ) && isset( $_GET['group_id'] ) && 'add_field' == $_GET['mode'] )
+		xprofile_admin_manage_field( $_GET['group_id'] );
+
+	else if ( isset( $_GET['mode'] ) && isset( $_GET['group_id'] ) && isset( $_GET['field_id'] ) && 'edit_field' == $_GET['mode'] )
+		xprofile_admin_manage_field( $_GET['group_id'], $_GET['field_id'] );
+
+	else if ( isset( $_GET['mode'] ) && isset( $_GET['field_id'] ) && 'delete_field' == $_GET['mode'] )
+		xprofile_admin_delete_field( $_GET['field_id'], 'field');
+
+	else if ( isset( $_GET['mode'] ) && isset( $_GET['option_id'] ) && 'delete_option' == $_GET['mode'] )
+		xprofile_admin_delete_field( $_GET['option_id'], 'option' );
+
+	else if ( isset( $_GET['mode'] ) && 'add_group' == $_GET['mode'] )
 		xprofile_admin_manage_group();
-	} else if ( isset($_GET['mode']) && isset($_GET['group_id']) && 'delete_group' == $_GET['mode'] ) {
-		xprofile_admin_delete_group($_GET['group_id']);
-	} else if ( isset($_GET['mode']) && isset($_GET['group_id']) && 'edit_group' == $_GET['mode'] ) {
-		xprofile_admin_manage_group($_GET['group_id']);
-	} else {
+
+	else if ( isset( $_GET['mode'] ) && isset( $_GET['group_id'] ) && 'delete_group' == $_GET['mode'] )
+		xprofile_admin_delete_group( $_GET['group_id'] );
+
+	else if ( isset( $_GET['mode'] ) && isset( $_GET['group_id'] ) && 'edit_group' == $_GET['mode'] )
+		xprofile_admin_manage_group( $_GET['group_id'] );
+
+	else {
 ?>
+
 	<div class="wrap">
 
-		<h2><?php _e( 'Profile Field Setup', 'buddypress') ?></h2>
-		<br />
-		<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 _e('NOTE: Any fields in the first group will appear on the signup page.', 'buddypress'); ?></p>
+		<?php screen_icon( 'buddypress' ); ?>
+
+		<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>
+		</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>
 
 		<form action="" id="profile-field-form" method="post">
 
 			<?php wp_nonce_field( 'bp_reorder_fields', '_wpnonce_reorder_fields' ); ?>
 
-			<?php
-				if ( $message != '' ) {
-					$type = ( $type == 'error' ) ? 'error' : 'updated';
-			?>
+			<?php wp_nonce_field( 'bp_reorder_groups', '_wpnonce_reorder_groups', false );
+
+			if ( !empty( $message ) ) :
+				$type = ( $type == 'error' ) ? 'error' : 'updated'; ?>
+
 				<div id="message" class="<?php echo $type; ?> fade">
-					<p><?php echo wp_specialchars( esc_attr( $message ) ); ?></p>
+					<p><?php echo esc_html( esc_attr( $message ) ); ?></p>
 				</div>
-			<?php }
-
-			if ( $groups ) { ?>
-				<?php
-				for ( $i = 0; $i < count($groups); $i++ ) { // TODO: foreach
-				?>
-					<p>
-					<table id="group_<?php echo $groups[$i]->id;?>" class="widefat field-group">
-						<thead>
-						    <tr>
-								<th scope="col" width="10">&nbsp;</th>
-						    	<th scope="col" colspan="<?php if ( $groups[$i]->can_delete ) { ?>3<?php } else { ?>5<?php } ?>"><?php echo esc_attr( $groups[$i]->name ); ?></th>
-								<?php if ( $groups[$i]->can_delete ) { ?>
-									<th scope="col"><a class="edit" href="admin.php?page=bp-profile-setup&amp;mode=edit_group&amp;group_id=<?php echo esc_attr( $groups[$i]->id ); ?>"><?php _e( 'Edit', 'buddypress' ) ?></a></th>
-						    		<th scope="col"><a class="delete" href="admin.php?page=bp-profile-setup&amp;mode=delete_group&amp;group_id=<?php echo esc_attr( $groups[$i]->id ); ?>"><?php _e( 'Delete', 'buddypress' ) ?></a></th>
-								<?php } ?>
-							</tr>
-							<tr class="header">
-								<td>&nbsp;</td>
-						    	<td><?php _e( 'Field Name', 'buddypress' ) ?></td>
-						    	<td width="14%"><?php _e( 'Field Type', 'buddypress' ) ?></td>
-						    	<td width="6%"><?php _e( 'Required?', 'buddypress' ) ?></td>
-						    	<td colspan="2" width="10%" style="text-align:center;"><?php _e( 'Action', 'buddypress' ) ?></td>
-						    </tr>
-						</thead>
-						<tbody id="the-list">
-
-						  <?php if ( $groups[$i]->fields ) { ?>
-
-						    	<?php for ( $j = 0; $j < count($groups[$i]->fields); $j++ ) { ?>
-
-									<?php if ( 0 == $j % 2 ) { $class = ""; } else { $class = "alternate"; } ?>
-									<?php $field = new BP_XProfile_Field($groups[$i]->fields[$j]->id); ?>
-									<?php if ( !$field->can_delete ) { $class .= ' core'; } ?>
-
-									<tr id="field_<?php echo esc_attr( $field->id ); ?>" class="sortable<?php if ( $class ) { echo ' ' . $class; } ?>">
-								    	<td width="10"><img src="<?php echo BP_PLUGIN_URL ?>/bp-xprofile/admin/images/move.gif" alt="<?php _e( 'Drag', 'buddypress' ) ?>" /></td>
-										<td><span title="<?php echo $field->description; ?>"><?php echo esc_attr( $field->name ); ?> <?php if(!$field->can_delete) { ?> <?php _e( '(Core Field)', 'buddypress' ) ?><?php } ?></span></td>
-								    	<td><?php echo esc_attr( $field->type ); ?></td>
-								    	<td style="text-align:center;"><?php if ( $field->is_required ) { echo '<img src="' . BP_PLUGIN_URL . '/bp-xprofile/admin/images/tick.gif" alt="' . __( 'Yes', 'buddypress' ) . '" />'; } else { ?>--<?php } ?></td>
-								    	<td style="text-align:center;"><?php if ( !$field->can_delete ) { ?><strike><?php _e( 'Edit', 'buddypress' ) ?></strike><?php } else { ?><a class="edit" href="admin.php?page=bp-profile-setup&amp;group_id=<?php echo esc_attr( $groups[$i]->id ); ?>&amp;field_id=<?php echo esc_attr( $field->id ); ?>&amp;mode=edit_field"><?php _e( 'Edit', 'buddypress' ) ?></a><?php } ?></td>
-								    	<td style="text-align:center;"><?php if ( !$field->can_delete ) { ?><strike><?php _e( 'Delete', 'buddypress' ) ?></strike><?php } else { ?><a class="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 } ?></td>
-								    </tr>
-
-								<?php } ?>
-
-							<?php } else { ?>
-
-								<tr class="nodrag">
-									<td colspan="6"><?php _e( 'There are no fields in this group.', 'buddypress' ) ?></td>
-								</tr>
-
-							<?php } ?>
-
-						</tbody>
-
-						<tfoot>
-
-								<tr class="nodrag">
-									<td colspan="6"><a href="admin.php?page=bp-profile-setup&amp;group_id=<?php echo esc_attr( $groups[$i]->id ); ?>&amp;mode=add_field"><?php _e( 'Add New Field', 'buddypress' ) ?></a></td>
-								</tr>
-
-						</tfoot>
-
-					</table>
-					</p>
-
-				<?php } /* End For */ ?>
-
-					<p>
-						<a class="button" href="admin.php?page=bp-profile-setup&amp;mode=add_group"><?php _e( 'Add New Field Group', 'buddypress' ) ?></a>
-					</p>
-
-			<?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>
-			<?php } ?>
-
-		</form>
-
-	</div>
+
+<?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			}
+			endif; ?>
+
+				</ul>
+
+<?php		if ( !empty( $groups ) ) :
+				foreach ( $groups as $group ) { ?>
+
+					<noscript>
+						<h3><?php echo esc_attr( $group->name ); ?></h3>
+					</noscript>
+
+					<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 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 ) : ?>
+
+								<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>
+
+<?php				endif; ?>
+
+							</div>
+						</div>
+
+						<fieldset id="<?php echo $group->id; ?>" class="connectedSortable field-group">
+
+<?php				if( $group->description ) : ?>
+
+							<legend><?php echo esc_attr( $group->description ) ?></legend>
+
+<?php				endif;
+
+					if ( !empty( $group->fields ) ) :
+						foreach ( $group->fields as $field ) {
+
+							// Load the field
+							$field = new BP_XProfile_Field( $field->id );
+
+							$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 );
+
+						} // end for
+
+					else : // !$group->fields
+?>
+
+							<p class="nodrag nofields"><?php _e( 'There are no fields in this group.', 'buddypress' ); ?></p>
+
+<?php
+					endif; // end $group->fields
+?>
+
+						</fieldset>
+					</div>
+
+<?php
+					} // End For ?>
+
+				</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>
+
+<?php
+				endif;
+?>
+				<div id="tabs-bottom">
+					&nbsp;
+				</div>
+			</form>
+		</div>
 <?php
 	}
 }
 
-
 /**************************************************************************
  xprofile_admin_manage_group()
 
@@ -146,28 +198,31 @@ function xprofile_admin( $message = '', $type = 'error' ) {
 function xprofile_admin_manage_group( $group_id = null ) {
 	global $message, $type;
 
-	$group = new BP_XProfile_Group($group_id);
+	$group = new BP_XProfile_Group( $group_id );
 
-	if ( isset($_POST['saveGroup']) ) {
-		if ( BP_XProfile_Group::admin_validate($_POST) ) {
-			$group->name = wp_filter_kses( $_POST['group_name'] );
-			$group->description = wp_filter_kses( $_POST['group_desc'] );
+	if ( isset( $_POST['save_group'] ) ) {
+		if ( BP_XProfile_Group::admin_validate( $_POST ) ) {
+			$group->name		= wp_filter_kses( $_POST['group_name'] );
+			$group->description	= !empty( $_POST['group_description'] ) ? wp_filter_kses( $_POST['group_description'] ) : '';
 
 			if ( !$group->save() ) {
-				$message = __('There was an error saving the group. Please try again', 'buddypress');
-				$type = 'error';
+				$message = __( 'There was an error saving the group. Please try again', 'buddypress' );
+				$type    = 'error';
 			} else {
-				$message = __('The group was saved successfully.', 'buddypress');
-				$type = 'success';
+				$message = __( 'The group was saved successfully.', 'buddypress' );
+				$type    = 'success';
+
+				if ( 1 == $group_id )
+					bp_update_option( 'bp-xprofile-base-group-name', $group->name );
 
 				do_action( 'xprofile_groups_saved_group', $group );
 			}
 
-			unset($_GET['mode']);
+			unset( $_GET['mode'] );
 			xprofile_admin( $message, $type );
 
 		} else {
-			$group->render_admin_form($message);
+			$group->render_admin_form( $message );
 		}
 	} else {
 		$group->render_admin_form();
@@ -183,19 +238,19 @@ function xprofile_admin_manage_group( $group_id = null ) {
 function xprofile_admin_delete_group( $group_id ) {
 	global $message, $type;
 
-	$group = new BP_XProfile_Group($group_id);
+	$group = new BP_XProfile_Group( $group_id );
 
 	if ( !$group->delete() ) {
-		$message = __('There was an error deleting the group. Please try again', 'buddypress');
-		$type = 'error';
+		$message = __( 'There was an error deleting the group. Please try again', 'buddypress' );
+		$type    = 'error';
 	} else {
-		$message = __('The group was deleted successfully.', 'buddypress');
-		$type = 'success';
+		$message = __( 'The group was deleted successfully.', 'buddypress' );
+		$type    = 'success';
 
 		do_action( 'xprofile_groups_deleted_group', $group );
 	}
 
-	unset($_GET['mode']); // TODO: wtf?
+	unset( $_GET['mode'] );
 	xprofile_admin( $message, $type );
 }
 
@@ -209,16 +264,18 @@ function xprofile_admin_delete_group( $group_id ) {
 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']) ) {
+	if ( isset( $_POST['saveField'] ) ) {
 		if ( BP_XProfile_Field::admin_validate() ) {
-			$field->name = wp_filter_kses( $_POST['title'] );
-			$field->description = wp_filter_kses( $_POST['description'] );
+			$field->name        = wp_filter_kses( $_POST['title'] );
+			$field->description = !empty( $_POST['description'] ) ? wp_filter_kses( $_POST['description'] ) : '';
 			$field->is_required = wp_filter_kses( $_POST['required'] );
-			$field->type = wp_filter_kses( $_POST['fieldtype'] );
-			$field->order_by = wp_filter_kses( $_POST["sort_order_{$field->type}"] );
+			$field->type        = wp_filter_kses( $_POST['fieldtype'] );
+
+			if ( !empty( $_POST["sort_order_{$field->type}"] ) )
+				$field->order_by = wp_filter_kses( $_POST["sort_order_{$field->type}"] );
 
 			$field->field_order = $wpdb->get_var( $wpdb->prepare( "SELECT field_order FROM {$bp->profile->table_name_fields} WHERE id = %d", $field_id ) );
 
@@ -228,16 +285,19 @@ function xprofile_admin_manage_field( $group_id, $field_id = null ) {
 			}
 
 			if ( !$field->save() ) {
-				$message = __('There was an error saving the field. Please try again', 'buddypress');
+				$message = __( 'There was an error saving the field. Please try again', 'buddypress' );
 				$type = 'error';
 
-				unset($_GET['mode']);
-				xprofile_admin($message, $type);
+				unset( $_GET['mode'] );
+				xprofile_admin( $message, $type );
 			} else {
-				$message = __('The field was saved successfully.', 'buddypress');
+				$message = __( 'The field was saved successfully.', 'buddypress' );
 				$type = 'success';
 
-				unset($_GET['mode']);
+				if ( 1 == $field_id )
+					bp_update_option( 'bp-xprofile-fullname-field-name', $field->name );
+
+				unset( $_GET['mode'] );
 
 				do_action( 'xprofile_fields_saved_field', $field );
 
@@ -245,7 +305,7 @@ function xprofile_admin_manage_field( $group_id, $field_id = null ) {
 				xprofile_admin( $message, $type );
 			}
 		} else {
-			$field->render_admin_form($message);
+			$field->render_admin_form( $message );
 		}
 	} else {
 		$field->render_admin_form();
@@ -257,45 +317,161 @@ function xprofile_admin_manage_field( $group_id, $field_id = null ) {
 
  Handles the deletion of a profile field [or option].
 **************************************************************************/
-
 function xprofile_admin_delete_field( $field_id, $type = 'field' ) {
 	global $message, $type;
 
-	if ( 'field' == $type ) {
+	if ( 'field' == $type )
 		$type = __('field', 'buddypress');
-	} else {
+	else
 		$type = __('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);
+		$message = sprintf( __('There was an error deleting the %s. Please try again', 'buddypress' ), $type );
 		$type = 'error';
 	} else {
-		$message = sprintf( __('The %s was deleted successfully!', 'buddypress'), $type);
+		$message = sprintf( __('The %s was deleted successfully!', 'buddypress' ), $type );
 		$type = 'success';
 
 		do_action( 'xprofile_fields_deleted_field', $field );
 	}
 
-	unset($_GET['mode']);
-	xprofile_admin($message, $type);
+	unset( $_GET['mode'] );
+	xprofile_admin( $message, $type );
 }
 
+/**************************************************************************
+ xprofile_ajax_reorder_fields()
+
+ Handles the ajax reordering of fields within a group
+**************************************************************************/
 function xprofile_ajax_reorder_fields() {
 	global $bp;
 
-	/* Check the nonce */
+	// Check the nonce
 	check_admin_referer( 'bp_reorder_fields', '_wpnonce_reorder_fields' );
 
 	if ( empty( $_POST['field_order'] ) )
 		return false;
 
-	parse_str($_POST['field_order'], $order );
+	parse_str( $_POST['field_order'], $order );
+	$field_group_id = $_POST['field_group_id'];
+
+	foreach ( (array) $order['field'] as $position => $field_id )
+		xprofile_update_field_position( (int) $field_id, (int) $position, (int) $field_group_id );
 
-	foreach ( (array) $order['field'] as $position => $field_id ) {
-		xprofile_update_field_position( (int) $field_id, (int) $position );
-	}
 }
 add_action( 'wp_ajax_xprofile_reorder_fields', 'xprofile_ajax_reorder_fields' );
+
+/**************************************************************************
+ xprofile_ajax_reorder_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' );
+
+	if ( empty( $_POST['group_order'] ) )
+		return false;
+
+	parse_str( $_POST['group_order'], $order );
+
+	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='' ) {
+	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' : ?>
+
+								<input type="text" name="<?php bp_the_profile_field_input_name() ?>" id="<?php bp_the_profile_field_input_name() ?>" value="" />
+
+<?php		break; case 'textarea' : ?>
+
+								<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 'selectbox' : ?>
+
+								<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		break; case 'multiselectbox' : ?>
+
+								<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		break; case 'radio' : ?>
+
+								<?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>
+
+<?php			endif; ?>
+
+<?php		break; case 'checkbox' : ?>
+
+<?php bp_the_profile_field_options(); ?>
+
+<?php		break; case 'datebox' : ?>
+
+								<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>
+
+								<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>
+
+<?php		break; default : ?>
+
+<?php	do_action( 'xprofile_admin_field', $field, 1 ); ?>
+
+<?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; ?>
+
+								</div>
+
+<?php if ( $field->description ) : ?>
+
+								<p class="description"><?php echo esc_attr( $field->description ); ?></p>
+
+<?php endif; ?>
+
+							</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
new file mode 100644
index 0000000000000000000000000000000000000000..9b66e1b6d430b220fe20cded59cf07baddb45e31
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-buddybar.php
@@ -0,0 +1,4 @@
+<?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
new file mode 100644
index 0000000000000000000000000000000000000000..a4afa6fad4d534bcb216ae84c5a088f3830a3117
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-cache.php
@@ -0,0 +1,30 @@
+<?php
+/********************************************************************************
+ * Caching
+ *
+ * Caching functions handle the clearing of cached objects and pages on specific
+ * actions throughout BuddyPress.
+ */
+
+// 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 );
+}
+
+function xprofile_clear_profile_data_object_cache( $group_id ) {
+	global $bp;
+	wp_cache_delete( 'bp_user_fullname_' . $bp->loggedin_user->id, 'bp' );
+}
+
+// List actions to clear object caches on
+add_action( 'xprofile_groups_deleted_group', 'xprofile_clear_profile_groups_object_cache' );
+add_action( 'xprofile_groups_saved_group',   'xprofile_clear_profile_groups_object_cache' );
+add_action( 'xprofile_updated_profile',      'xprofile_clear_profile_data_object_cache'   );
+
+// 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-classes.php b/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-classes.php
index bad3246bebc0d97a4315ec79ebb9392a6ec80a60..cf75798ea3dd3d14302228eb4f27a988e4a0ca74 100644
--- a/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-classes.php
+++ b/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-classes.php
@@ -1,18 +1,25 @@
 <?php
+// Exit if accessed directly
+if ( !defined( 'ABSPATH' ) ) exit;
 
 Class BP_XProfile_Group {
 	var $id = null;
 	var $name;
 	var $description;
 	var $can_delete;
+	var $group_order;
 	var $fields;
 
 	function bp_xprofile_group( $id = null ) {
+		$this->__construct( $id );
+	}
+
+	function __construct( $id = null ) {
 		global $bp, $wpdb;
 
-		if ( $id ) {
+		if ( $id )
 			$this->populate( $id );
-		}
+
 	}
 
 	function populate( $id ) {
@@ -20,33 +27,33 @@ Class BP_XProfile_Group {
 
 		$sql = $wpdb->prepare( "SELECT * FROM {$bp->profile->table_name_groups} WHERE id = %d", $id );
 
-		if ( !$group = $wpdb->get_row($sql) )
+		if ( !$group = $wpdb->get_row( $sql ) )
 			return false;
 
-		$this->id = $group->id;
-		$this->name = $group->name;
-		$this->description = $group->description;
-		$this->can_delete = $group->can_delete;
+		$this->id          = $group->id;
+		$this->name        = stripslashes( $group->name );
+		$this->description = stripslashes( $group->description );
+		$this->can_delete  = $group->can_delete;
+		$this->group_order = $group->group_order;
 	}
 
 	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( 'xprofile_group_before_save', $this );
+		do_action_ref_array( 'xprofile_group_before_save', array( &$this ) );
 
-		if ( $this->id ) {
+		if ( $this->id )
 			$sql = $wpdb->prepare( "UPDATE {$bp->profile->table_name_groups} SET name = %s, description = %s WHERE id = %d", $this->name, $this->description, $this->id );
-		} else {
+		else
 			$sql = $wpdb->prepare( "INSERT INTO {$bp->profile->table_name_groups} (name, description, can_delete) VALUES (%s, %s, 1)", $this->name, $this->description );
-		}
 
-		if ( !$wpdb->query($sql) )
+		if ( is_wp_error( $wpdb->query( $sql ) ) )
 			return false;
 
-		do_action( 'xprofile_group_after_save', $this );
+		do_action_ref_array( 'xprofile_group_after_save', array( &$this ) );
 
 		if ( $this->id )
 			return $this->id;
@@ -60,16 +67,15 @@ Class BP_XProfile_Group {
 		if ( !$this->can_delete )
 			return false;
 
-		$sql = $wpdb->prepare( "DELETE FROM {$bp->profile->table_name_groups} WHERE id = %d", $this->id );
-
-		if ( !$wpdb->query($sql) ) {
+		/* Delete field group */
+		if ( !$wpdb->query( $wpdb->prepare( "DELETE FROM {$bp->profile->table_name_groups} WHERE id = %d", $this->id ) ) ) {
 			return false;
 		} else {
-			// Now the group is deleted, remove the group's fields.
-			if ( BP_XProfile_Field::delete_for_group($this->id) ) {
-				// Now delete all the profile data for the groups fields
-				for ( $i = 0; $i < count($this->fields); $i++ ) {
-					BP_XProfile_ProfileData::delete_for_field($this->fields[$i]->id);
+			/* Remove the group's fields. */
+			if ( BP_XProfile_Field::delete_for_group( $this->id ) ) {
+				/* 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 );
 				}
 			}
 
@@ -79,59 +85,125 @@ Class BP_XProfile_Group {
 
 	/** Static Functions **/
 
+	/**
+	 * get()
+	 *
+	 * Populates the BP_XProfile_Group object with profile field groups, fields, and field data
+	 *
+	 * @package BuddyPress XProfile
+	 *
+	 * @global $wpdb WordPress DB access object.
+	 * @global object $bp Global BuddyPress settings object
+	 *
+	 * @param array $args Takes an array of parameters:
+	 *		'profile_group_id' - Limit results to a single profile group
+	 *		'user_id' - Required if you want to load a specific user's data
+	 *		'hide_empty_groups' - Hide groups without any fields
+	 *		'hide_empty_fields' - Hide fields where the user has not provided data
+	 *		'fetch_fields' - Load each group's fields
+	 *		'fetch_field_data' - Load each field's data. Requires a user_id
+	 *		'exclude_groups' - Comma-separated list of groups to exclude
+	 *		'exclude_fields' - Comma-separated list of fields to exclude
+	 *
+	 * @return array $groups
+	 */
 	function get( $args = '' ) {
 		global $wpdb, $bp;
 
 		$defaults = array(
-			'profile_group_id' => false,
-			'user_id' => $bp->displayed_user->id,
+			'profile_group_id'  => false,
+			'user_id'           => $bp->displayed_user->id,
 			'hide_empty_groups' => false,
-			'fetch_fields' => false,
-			'fetch_field_data' => false
+			'hide_empty_fields' => false,
+			'fetch_fields'      => false,
+			'fetch_field_data'  => false,
+			'exclude_groups'    => false,
+			'exclude_fields'    => false
 		);
 
 		$r = wp_parse_args( $args, $defaults );
 		extract( $r, EXTR_SKIP );
+		$where_sql = '';
 
 		if ( $profile_group_id )
-			$group_id_sql = $wpdb->prepare( 'WHERE g.id = %d', $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})");
 
 		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 {$group_id_sql} ORDER BY g.id ASC" ) );
+			$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" ) );
 		else
-			$groups = $wpdb->get_results( $wpdb->prepare( "SELECT DISTINCT g.* FROM {$bp->profile->table_name_groups} g {$group_id_sql} ORDER BY g.id ASC" ) );
+			$groups = $wpdb->get_results( $wpdb->prepare( "SELECT DISTINCT g.* FROM {$bp->profile->table_name_groups} g {$where_sql} ORDER BY g.group_order ASC" ) );
 
 		if ( !$fetch_fields )
 			return $groups;
 
-		/* Get the group ids */
-		foreach( (array)$groups as $group )
+		// Get the group ids
+		$group_ids = array();
+		foreach( (array)$groups as $group ) {
 			$group_ids[] = $group->id;
+		}
 
 		$group_ids = implode( ',', (array) $group_ids );
 
 		if ( empty( $group_ids ) )
 			return $groups;
 
-		/* 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 ORDER BY field_order" ) );
+		$exclude_fields_sql = '';
+		if ( $exclude_fields )
+			$exclude_fields_sql = $wpdb->prepare( "AND id NOT IN ({$exclude_fields})" );
+
+		// 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" ) );
 
 		if ( empty( $fields ) )
 			return $groups;
 
 		if ( $fetch_field_data ) {
-			/* Fetch the field data for the user. */
+			// Fetch the field data for the user.
 			foreach( (array)$fields as $field )
 				$field_ids[] = $field->id;
 
-			$field_ids = implode( ',', (array) $field_ids );
+			$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} ) AND user_id = %d", $user_id ) );
+				$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 ) );
+
+			// Remove data-less fields, if necessary
+			if ( $hide_empty_fields ) {
+
+				// Loop through the results and find the fields that have 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 ) ) {
+						// Fields that have data get removed from the list
+						unset( $field_ids[$key] );
+					}
+				}
+
+				// The remaining members of $field_ids are empty. Remove them.
+				foreach( $fields as $field_key => $field ) {
+					if ( in_array( $field->id, $field_ids ) ) {
+						unset( $fields[$field_key] );
+					}
+				}
+
+				// Reset indexes
+				$fields = array_values( $fields );
 
-			if ( !empty( $field_data ) ) {
+			}
+
+			// Field data was found
+			if ( !empty( $field_data ) && !is_wp_error( $field_data ) ) {
+
+				// Loop through fields
 				foreach( (array)$fields as $field_key => $field ) {
+
+					// Loop throught the data in each field
 					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;
 					}
@@ -139,12 +211,26 @@ Class BP_XProfile_Group {
 			}
 		}
 
-		/* Merge the field array back in with the group array */
-		foreach( (array)$groups as $group_key => $group ) {
-			foreach( (array)$fields as $field ) {
+		// Merge the field array back in with the group array
+		foreach( (array) $groups as $group ) {
+
+			// Indexes may have been shifted after previous deletions, so we get a
+			// fresh one each time through the loop
+			$index = array_search( $group, $groups );
+
+			foreach( (array) $fields as $field ) {
 				if ( $group->id == $field->group_id )
-					$groups[$group_key]->fields[] = $field;
+					$groups[$index]->fields[] = $field;
 			}
+
+			// When we unset fields above, we may have created empty groups.
+			// Remove them, if necessary.
+			if ( empty( $group->fields ) && $hide_empty_groups ) {
+				unset( $groups[$index] );
+			}
+
+			// Reset indexes
+			$groups = array_values( $groups );
 		}
 
 		return $groups;
@@ -153,59 +239,81 @@ Class BP_XProfile_Group {
 	function admin_validate() {
 		global $message;
 
-		// Validate Form
+		/* Validate Form */
 		if ( empty( $_POST['group_name'] ) ) {
-			$message = __('Please make sure you give the group a name.', 'buddypress');
+			$message = __( 'Please make sure you give the group a name.', 'buddypress' );
 			return false;
 		} else {
 			return true;
 		}
 	}
 
-	// ADMIN AREA HTML. TODO: Get this out of here.
+	function update_position( $field_group_id, $position ) {
+		global $wpdb, $bp;
+
+		if ( !is_numeric( $position ) )
+			return false;
+
+		return $wpdb->query( $wpdb->prepare( "UPDATE {$bp->profile->table_name_groups} SET group_order = %d WHERE id = %d", $position, $field_group_id ) );
+	}
+
+	/* ADMIN AREA HTML.
+	* TODO: Get this out of here and replace with standard loops
+	*/
 
 	function render_admin_form() {
 		global $message;
 
 		if ( !$this->id ) {
-			$title = __('Add New Field Group', 'buddypress');
-			$action = "admin.php?page=bp-profile-setup&amp;mode=add_group";
+			$title	= __( 'Add New Field Group', 'buddypress' );
+			$action	= "admin.php?page=bp-profile-setup&amp;mode=add_group";
+			$button	= __( 'Create Field Group', 'buddypress' );
 		} else {
-			$title = __('Edit Field Group', 'buddypress');
+			$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' ); ?>
+
 			<h2><?php echo $title; ?></h2>
-			<br />
+			<p><?php _e( 'Fields marked * are required', 'buddypress' ) ?></p>
 
-			<?php
-				if ( $message != '' ) {
-					$type = ( 'error' == $type ) ? 'error' : 'updated';
-			?>
+<?php if ( $message != '' ) :
+		$type = ( 'error' == $type ) ? 'error' : 'updated'; ?>
 				<div id="message" class="<?php echo $type; ?> fade">
 					<p><?php echo $message; ?></p>
 				</div>
-			<?php } ?>
-
-			<form action="<?php echo esc_attr( $action ); ?>" method="post">
-
-				<div id="titlediv">
-					<label for="group_name"><?php _e( "Field Group Name", 'buddypress') ?></label>
-					<div>
-						<input type="text" name="group_name" id="group_name" value="<?php echo esc_attr( $this->name ) ?>" style="width:50%" />
+<?php endif; ?>
+			<div id="poststuff">
+				<form action="<?php echo esc_attr( $action ); ?>" method="post">
+					<div id="titlediv">
+						<h3><label for="group_name"><?php _e( "Field Group Title", 'buddypress') ?> *</label></h3>
+						<div id="titlewrap">
+							<input type="text" name="group_name" id="title" value="<?php echo esc_attr( $this->name ); ?>" style="width:50%" />
+						</div>
 					</div>
-				</div>
-
-				<p class="submit" style="text-align: left">
-					<input type="submit" name="saveGroup" value="<?php echo esc_attr( $title ); ?> &rarr;" />
-				</p>
 
-			</form>
+<?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>
+<?php endif; ?>
+
+					<p class="submit">
+						<input type="hidden" name="group_order" id="group_order" value="<?php echo esc_attr( $this->group_order ); ?>" />
+						<input type="submit" name="save_group" value="<?php echo esc_attr( $button ); ?>" class="button-primary"/>
+						<?php _e( 'or', 'buddypress' ); ?> <a href="admin.php?page=bp-profile-setup" class="deletion"><?php _e( 'Cancel', 'buddypress' ); ?></a>
+					</p>
+				</form>
+			</div>
 		</div>
-
-		<?php
+<?php
 	}
 }
 
@@ -229,37 +337,39 @@ Class BP_XProfile_Field {
 	var $message_type = 'err';
 
 	function bp_xprofile_field( $id = null, $user_id = null, $get_data = true ) {
-		if ( $id ) {
+		$this->__construct( $id, $user_id, $get_data );
+	}
+
+	function __construct( $id = null, $user_id = null, $get_data = true ) {
+		if ( $id )
 			$this->populate( $id, $user_id, $get_data );
-		}
 	}
 
 	function populate( $id, $user_id, $get_data ) {
 		global $wpdb, $userdata, $bp;
 
-		if ( is_null($user_id) ) {
+		$user_id = 0;
+		if ( is_null( $user_id ) )
 			$user_id = $userdata->ID;
-		}
 
 		$sql = $wpdb->prepare( "SELECT * FROM {$bp->profile->table_name_fields} WHERE id = %d", $id );
 
-		if ( $field = $wpdb->get_row($sql) ) {
-			$this->id = $field->id;
-			$this->group_id = $field->group_id;
-			$this->parent_id = $field->parent_id;
-			$this->type = $field->type;
-			$this->name = stripslashes($field->name);
-			$this->description = stripslashes($field->description);
-			$this->is_required = $field->is_required;
-			$this->can_delete = $field->can_delete;
-			$this->field_order = $field->field_order;
-			$this->option_order = $field->option_order;
-			$this->order_by = $field->order_by;
+		if ( $field = $wpdb->get_row( $sql ) ) {
+			$this->id               = $field->id;
+			$this->group_id          = $field->group_id;
+			$this->parent_id         = $field->parent_id;
+			$this->type              = $field->type;
+			$this->name              = stripslashes( $field->name );
+			$this->description       = stripslashes( $field->description );
+			$this->is_required       = $field->is_required;
+			$this->can_delete        = $field->can_delete;
+			$this->field_order       = $field->field_order;
+			$this->option_order      = $field->option_order;
+			$this->order_by          = $field->order_by;
 			$this->is_default_option = $field->is_default_option;
 
-			if ( $get_data ) {
-				$this->data = $this->get_field_data($user_id);
-			}
+			if ( $get_data && $user_id )
+				$this->data            = $this->get_field_data( $user_id );
 		}
 	}
 
@@ -267,17 +377,17 @@ Class BP_XProfile_Field {
 		global $wpdb, $bp;
 
 		if ( !$this->id ||
-			// Prevent deletion by url when can_delete is false.
+			/* Prevent deletion by url when can_delete is false. */
 			!$this->can_delete ||
-			// Prevent deletion of option 1 since this invalidates fields with options.
+			/* Prevent deletion of option 1 since this invalidates fields with options. */
 			( $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 */
+		BP_XProfile_ProfileData::delete_for_field( $this->id );
 
 		return true;
 	}
@@ -287,69 +397,80 @@ Class BP_XProfile_Field {
 
 		$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( 'xprofile_field_before_save', $this );
+		do_action_ref_array( 'xprofile_field_before_save', array( &$this ) );
 
 		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);
+			$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
-			$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 ) {
+			$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 )
 				$field_id = $this->id;
 			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
-				// field from a radio button field to a text box.
+				/*
+				 * 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
+				 * field from a radio button field to a text box.
+				 */
 				$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.
+			/*
+			 * 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 ( $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']           : '';
+					$post_default = !empty( $_POST['isDefault_radio_option'] ) ? $_POST['isDefault_radio_option'] : '';
 
-					$options = $_POST['radio_option'];
-					$defaults = $_POST['isDefault_radio_option'];
+					$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 ) {
+					$post_option  = !empty( $_POST['selectbox_option']           ) ? $_POST['selectbox_option']           : '';
+					$post_default = !empty( $_POST['isDefault_selectbox_option'] ) ? $_POST['isDefault_selectbox_option'] : '';
 
-					$options = $_POST['selectbox_option'];
-					$defaults = $_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 ) {
+					$post_option  = !empty( $_POST['multiselectbox_option']           ) ? $_POST['multiselectbox_option']           : '';
+					$post_default = !empty( $_POST['isDefault_multiselectbox_option'] ) ? $_POST['isDefault_multiselectbox_option'] : '';
 
-					$options = $_POST['multiselectbox_option'];
-					$defaults = $_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 ) {
+					$post_option  = !empty( $_POST['checkbox_option']           ) ? $_POST['checkbox_option']           : '';
+					$post_default = !empty( $_POST['isDefault_checkbox_option'] ) ? $_POST['isDefault_checkbox_option'] : '';
 
-					$options = $_POST['checkbox_option'];
-					$defaults = $_POST['isDefault_checkbox_option'];
-
+					$options	= apply_filters( 'xprofile_field_options_before_save', $post_option, 'checkbox' );
+					$defaults	= apply_filters( 'xprofile_field_default_before_save', $post_default, 'checkbox' );
 				}
 
 				$counter = 1;
@@ -357,8 +478,8 @@ Class BP_XProfile_Field {
 					foreach ( (array)$options as $option_key => $option_value ) {
 						$is_default = 0;
 
-						if ( is_array($defaults) ) {
-							if ( isset($defaults[$option_key]) )
+						if ( is_array( $defaults ) ) {
+							if ( isset( $defaults[$option_key] ) )
 								$is_default = 1;
 						} else {
 							if ( (int) $defaults == $option_key )
@@ -366,7 +487,7 @@ 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, is_default_option, field_order, option_order, order_by, can_delete) VALUES (%d, %d, 'option', %s, '', 0, %d, 0, %d, '', 1)", (int)$this->group_id, (int)$parent_id, $option_value, (int)$is_default, (int)$counter ) ) )
+							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;
 						}
 
@@ -374,44 +495,39 @@ Class BP_XProfile_Field {
 					}
 				}
 			}
-		} else {
-			$error = true;
-		}
 
-		if ( !$error ) {
-			do_action( 'xprofile_field_after_save', $this );
+			do_action_ref_array( 'xprofile_field_after_save', array( &$this ) );
+
 			return $field_id;
 		} else {
 			return false;
 		}
 	}
 
-	function get_field_data($user_id) {
-		return new BP_XProfile_ProfileData($this->id, $user_id);
+	function get_field_data( $user_id ) {
+		return new BP_XProfile_ProfileData( $this->id, $user_id );
 	}
 
-	 function get_children($for_editing = false) {
+	function get_children( $for_editing = false ) {
 		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 && !$for_editing )
 			$sort_sql = 'ORDER BY name ASC';
-		} else if ( 'desc' == $this->order_by && !$for_editing ) {
+		else if ( 'desc' == $this->order_by && !$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 ) {
+		// This eliminates a problem with getting all fields when there is no id for the object
+		if ( !$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 );
 
-		if ( !$children = $wpdb->get_results($sql) )
+		if ( !$children = $wpdb->get_results( $sql ) )
 			return false;
 
 		return apply_filters( 'bp_xprofile_field_get_children', $children );
@@ -420,12 +536,12 @@ Class BP_XProfile_Field {
 	function delete_children() {
 		global $wpdb, $bp;
 
-		$sql = $wpdb->prepare("DELETE FROM {$bp->profile->table_name_fields} WHERE parent_id = %d", $this->id);
+		$sql = $wpdb->prepare( "DELETE FROM {$bp->profile->table_name_fields} WHERE parent_id = %d", $this->id );
 
-		$wpdb->query($sql);
+		$wpdb->query( $sql );
 	}
 
-	// Static Functions
+	/* Static Functions */
 
 	function get_type( $field_id ) {
 		global $wpdb, $bp;
@@ -433,7 +549,7 @@ Class BP_XProfile_Field {
 		if ( $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;
@@ -448,9 +564,8 @@ Class BP_XProfile_Field {
 		if ( $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;
 		}
@@ -461,47 +576,55 @@ Class BP_XProfile_Field {
 	function get_id_from_name( $field_name ) {
 		global $wpdb, $bp;
 
-		if ( !$bp->profile->table_name_fields || !$field_name )
+		if ( empty( $bp->profile->table_name_fields ) || !isset( $field_name ) )
 			return false;
 
 		return $wpdb->get_var( $wpdb->prepare( "SELECT id FROM {$bp->profile->table_name_fields} WHERE name = %s", $field_name ) );
 	}
 
-	function update_position( $field_id, $position ) {
+	function update_position( $field_id, $position, $field_group_id ) {
 		global $wpdb, $bp;
 
-		if ( !is_numeric( $position ) )
+		if ( !is_numeric( $position ) || !is_numeric( $field_group_id ) )
 			return false;
 
-		return $wpdb->query( $wpdb->prepare( "UPDATE {$bp->profile->table_name_fields} SET field_order = %d WHERE id = %d", $position, $field_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 */
+			$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;
+		}
+
+		return false;
 	}
 
-	// ADMIN AREA HTML. TODO: Get this out of here.
+	/* ADMIN AREA HTML.
+	* TODO: Get this out of here and replace with standard template loops
+	*/
 
+	/* This function populates the items for radio buttons checkboxes and drop down boxes */
 	function render_admin_form_children() {
-		//This function populates the items for radio buttons checkboxes and drop down boxes
 		$input_types = array( 'checkbox', 'selectbox', 'multiselectbox', 'radio' );
 
-		foreach ( $input_types as $type ) {
+		foreach ($input_types as $type) {
 			$default_name = '';
 
 			if ( 'multiselectbox' == $type || 'checkbox' == $type )
 				$default_input = 'checkbox';
 			else
-				$default_input = 'radio'; ?>
-
-			<div id="<?php echo $type ?>" class="options-box" style="<?php if ( $this->type != $type ) { ?>display: none;<?php } ?> margin-left: 15px;">
-				<h4><?php _e('Please enter options for this Field:', 'buddypress') ?></h4>
-				<p><?php _e( 'Order By:', 'buddypress' ) ?>
-
-					<select name="sort_order_<?php echo $type ?>" id="sort_order_<?php echo $type ?>" >
-						<option value="default" <?php if ( 'default' == $this->order_by ) {?> selected="selected"<?php } ?> ><?php _e( 'Order Entered', 'buddypress' ) ?></option>
-						<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>
+				$default_input = 'radio';
+?>
+			<div id="<?php echo $type; ?>" class="options-box" style="<?php if ( $this->type != $type ) { ?>display: none;<?php } ?> 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; ?>" >
+						<option value="default" <?php if ( 'default' == $this->order_by ) {?> selected="selected"<?php } ?> ><?php _e( 'Order Entered', 'buddypress' ); ?></option>
+						<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(
@@ -514,47 +637,42 @@ Class BP_XProfile_Field {
 									$_POST["isDefault_{$type}_option"][$i]
 						);
 
-						$i++;
+						++$i;
 					}
 				}
 
 				if ( !empty( $options ) ) {
-					for ( $i = 0; $i < count( $options ); $i++ ) {
+					for ( $i = 0, $count = count( $options ); $i < $count; ++$i ) {
 						$j = $i + 1;
 
 						if ( 'multiselectbox' == $type || 'checkbox' == $type )
-							$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 ?>
-
+							$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; ?>
 						</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
+					<input type="hidden" name="<?php echo $type; ?>_option_number" id="<?php echo $type; ?>_option_number" value="<?php echo $j + 1; ?>" />
+<?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" />
+					<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>
+				<div id="<?php echo $type; ?>_more"></div>
+				<p><a href="javascript:add_option('<?php echo $type; ?>')"><?php _e('Add Another Option', 'buddypress'); ?></a></p>
 			</div>
 
 		<?php }
@@ -562,109 +680,115 @@ Class BP_XProfile_Field {
 
 	function render_admin_form( $message = '' ) {
 		if ( !$this->id ) {
-			$title = __('Add Field', 'buddypress');
-			$action = "admin.php?page=bp-profile-setup&amp;group_id=" . $this->group_id . "&amp;mode=add_field";
-
-			$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}"];
+			$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'];
+			}
 		} 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;
+			$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>
-		<br />
+		<p><?php _e( 'Fields marked * are required', 'buddypress' ) ?></p>
 
-		<?php
-			if ( $message != '' ) {
-		?>
+<?php
+		if ( $message != '' ) {
+?>
 			<div id="message" class="error fade">
 				<p><?php echo $message; ?></p>
 			</div>
-		<?php } ?>
+<?php	} ?>
 
-		<form action="<?php echo $action ?>" method="post">
+		<form action="<?php echo $action; ?>" method="post">
 			<div id="poststuff">
 				<div id="titlediv">
-					<h3><label for="title"><?php _e("Field Title", 'buddypress') ?> *</label></h3>
+					<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%" />
+						<input type="text" name="title" id="title" value="<?php echo esc_attr( $this->name ); ?>" style="width:50%" />
 					</div>
 				</div>
-
-				<div id="titlediv" class="inside">
-					<h3><label for="description"><?php _e("Field Description", 'buddypress') ?></label></h3>
+<?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>
 					</div>
 				</div>
 
 				<div id="titlediv">
-					<h3><label for="required"><?php _e("Is This Field Required?", 'buddypress') ?> *</label></h3>
+					<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>
+						<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="fieldtype"><?php _e("Field Type", 'buddypress') ?> *</label></h3>
+					<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>
+						<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 $this->render_admin_form_children() ?>
+				<?php do_action( 'xprofile_field_additional_options', $this ) ?>
 
+				<?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">
-						&nbsp;<input type="submit" value="<?php _e("Save", 'buddypress') ?> &rarr;" name="saveField" id="saveField" style="font-weight: bold" />
-						 <?php _e('or', 'buddypress') ?> <a href="admin.php?page=bp-profile-setup" style="color: red"><?php _e( 'Cancel', 'buddypress' ) ?></a>
+					<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>
 
-			<div class="clear"></div>
-
-			<?php if ( function_exists('wp_nonce_field') )
-				wp_nonce_field('xprofile_delete_option');
-			?>
+			<?php wp_nonce_field( 'xprofile_delete_option' ); ?>
 
 		</form>
 	</div>
 
-	<?php
+<?php
 	}
 
 	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');
+			$message = __( 'Please make sure you fill out all required fields.', 'buddypress' );
 			return false;
-		} else if ( empty($_POST['field_file']) && $_POST['fieldtype'] == 'radio' && empty($_POST['radio_option'][1]) ) {
-			$message = __('Radio button field types require at least one option. Please add options below.', 'buddypress');
+		} else if ( empty( $_POST['field_file'] ) && $_POST['fieldtype'] == 'radio' && empty( $_POST['radio_option'][1] ) ) {
+			$message = __( 'Radio button field types require at least one option. Please add options below.', 'buddypress' );
 			return false;
-		} else if ( empty($_POST['field_file']) && $_POST['fieldtype'] == 'selectbox' && empty($_POST['selectbox_option'][1]) ) {
-			$message = __('Select box field types require at least one option. Please add options below.', 'buddypress');
+		} else if ( empty( $_POST['field_file'] ) && $_POST['fieldtype'] == 'selectbox' && empty( $_POST['selectbox_option'][1] ) ) {
+			$message = __( 'Select box field types require at least one option. Please add options below.', 'buddypress' );
 			return false;
-		} else if ( empty($_POST['field_file']) && $_POST['fieldtype'] == 'multiselectbox' && empty($_POST['multiselectbox_option'][1]) ) {
-			$message = __('Select box field types require at least one option. Please add options below.', 'buddypress');
+		} else if ( empty( $_POST['field_file'] ) && $_POST['fieldtype'] == 'multiselectbox' && empty( $_POST['multiselectbox_option'][1] ) ) {
+			$message = __( 'Select box field types require at least one option. Please add options below.', 'buddypress' );
 			return false;
-		} else if ( empty($_POST['field_file']) && $_POST['fieldtype'] == 'checkbox' && empty($_POST['checkbox_option'][1]) ) {
-			$message = __('Checkbox field types require at least one option. Please add options below.', 'buddypress');
+		} else if ( empty( $_POST['field_file'] ) && $_POST['fieldtype'] == 'checkbox' && empty( $_POST['checkbox_option'][1] ) ) {
+			$message = __( 'Checkbox field types require at least one option. Please add options below.', 'buddypress' );
 			return false;
 		} else {
 			return true;
@@ -681,9 +805,12 @@ Class BP_XProfile_ProfileData {
 	var $last_updated;
 
 	function bp_xprofile_profiledata( $field_id = null, $user_id = null ) {
-		if ( $field_id ) {
+		$this->__construct( $field_id, $user_id );
+	}
+
+	function __construct( $field_id = null, $user_id = null ) {
+		if ( $field_id )
 			$this->populate( $field_id, $user_id );
-		}
 	}
 
 	function populate( $field_id, $user_id )  {
@@ -691,13 +818,16 @@ Class BP_XProfile_ProfileData {
 
 		$sql = $wpdb->prepare( "SELECT * FROM {$bp->profile->table_name_data} WHERE field_id = %d AND user_id = %d", $field_id, $user_id );
 
-		if ( $profiledata = $wpdb->get_row($sql) ) {
-
+		if ( $profiledata = $wpdb->get_row( $sql ) ) {
 			$this->id           = $profiledata->id;
 			$this->user_id      = $profiledata->user_id;
 			$this->field_id     = $profiledata->field_id;
-			$this->value        = stripslashes($profiledata->value);
+			$this->value        = stripslashes( $profiledata->value );
 			$this->last_updated = $profiledata->last_updated;
+		} else {
+			// When no row is found, we'll need to set these properties manually
+			$this->field_id	    = $field_id;
+			$this->user_id	    = $user_id;
 		}
 	}
 
@@ -715,7 +845,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( 'xprofile_data_exists', (bool)$retval, $this );
+		return apply_filters_ref_array( 'xprofile_data_exists', array( (bool)$retval, &$this ) );
 	}
 
 	/**
@@ -732,34 +862,36 @@ 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( 'xprofile_data_is_valid_field', (bool)$retval, $this );
+		return apply_filters_ref_array( 'xprofile_data_is_valid_field', array( (bool)$retval, &$this ) );
 	}
 
 	function save() {
 		global $wpdb, $bp;
 
-		$this->user_id      = apply_filters( 'xprofile_data_user_id_before_save', $this->user_id, $this->id );
-		$this->field_id     = apply_filters( 'xprofile_data_field_id_before_save', $this->field_id, $this->id );
-		$this->value        = apply_filters( 'xprofile_data_value_before_save', $this->value, $this->id );
-		$this->last_updated = apply_filters( 'xprofile_data_last_updated_before_save', date( 'Y-m-d H:i:s' ), $this->id );
+		$this->user_id      = apply_filters( 'xprofile_data_user_id_before_save',      $this->user_id,         $this->id );
+		$this->field_id     = apply_filters( 'xprofile_data_field_id_before_save',     $this->field_id,        $this->id );
+		$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( 'xprofile_data_before_save', $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 ) ) )
-				$result = $wpdb->query( $wpdb->prepare( "UPDATE {$bp->profile->table_name_data} SET value = %s, last_updated = %s WHERE user_id = %d AND field_id = %d", $this->value, $this->last_updated, $this->user_id, $this->field_id ) );
+			if ( $this->exists() && !empty( $this->value ) && strlen( trim( $this->value ) ) ) {
+				$result   = $wpdb->query( $wpdb->prepare( "UPDATE {$bp->profile->table_name_data} SET value = %s, last_updated = %s WHERE user_id = %d AND field_id = %d", $this->value, $this->last_updated, $this->user_id, $this->field_id ) );
 
-			// Data removed, delete the entry.
-			elseif ( $this->exists() && empty( $this->value ) )				
-				$result = $this->delete();
+			} else if ( $this->exists() && empty( $this->value ) ) {
+				// Data removed, delete the entry.
+				$result   = $this->delete();
 
-			else
-				$result = $wpdb->query( $wpdb->prepare("INSERT INTO {$bp->profile->table_name_data} (user_id, field_id, value, last_updated) VALUES (%d, %d, %s, %s)", $this->user_id, $this->field_id, $this->value, $this->last_updated ) );
+			} else {
+				$result   = $wpdb->query( $wpdb->prepare("INSERT INTO {$bp->profile->table_name_data} (user_id, field_id, value, last_updated) VALUES (%d, %d, %s, %s)", $this->user_id, $this->field_id, $this->value, $this->last_updated ) );
+				$this->id = $wpdb->insert_id;
+			}
 
 			if ( !$result )
 				return false;
 
-			do_action( 'xprofile_data_after_save', $this );
+			do_action_ref_array( 'xprofile_data_after_save', array( &$this ) );
 
 			return true;
 		}
@@ -786,20 +918,21 @@ Class BP_XProfile_ProfileData {
 	function get_all_for_user( $user_id ) {
 		global $wpdb, $bp;
 
-		$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 ) );
+		$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 ) {
-			$profile_data['user_login'] = $results[0]->user_login;
-			$profile_data['user_nicename'] = $results[0]->user_nicename;
-			$profile_data['user_email'] = $results[0]->user_email;
+			$profile_data['user_login']		= $results[0]->user_login;
+			$profile_data['user_nicename']	= $results[0]->user_nicename;
+			$profile_data['user_email']		= $results[0]->user_email;
 
 			foreach( (array) $results as $field ) {
 				$profile_data[$field->field_name] = array(
-					'field_group_id' => $field->field_group_id,
+					'field_group_id'   => $field->field_group_id,
 					'field_group_name' => $field->field_group_name,
-					'field_id' => $field->field_id,
-					'field_type' => $field->field_type,
-					'field_data' => $field->field_data
+					'field_id'         => $field->field_id,
+					'field_type'       => $field->field_type,
+					'field_data'       => $field->field_data
 				);
 			}
 		}
@@ -813,11 +946,8 @@ Class BP_XProfile_ProfileData {
 		if ( !$user_ids )
 			$user_ids = $bp->displayed_user->id;
 
-		if ( !$bp->profile )
-			xprofile_setup_globals();
-
 		if ( is_array( $user_ids ) ) {
-			$user_ids = implode( ',', (array)$user_ids );
+			$user_ids = implode( ',', (array) $user_ids );
 			$data = $wpdb->get_results( $wpdb->prepare( "SELECT user_id, value FROM {$bp->profile->table_name_data} WHERE field_id = %d AND user_id IN ({$user_ids})", $field_id ) );
 		} else {
 			$data = $wpdb->get_var( $wpdb->prepare( "SELECT value FROM {$bp->profile->table_name_data} WHERE field_id = %d AND user_id = %d", $field_id, $user_ids ) );
@@ -835,13 +965,10 @@ Class BP_XProfile_ProfileData {
 		if ( !$user_id )
 			$user_id = $bp->displayed_user->id;
 
-		if ( !$bp->profile )
-			xprofile_setup_globals();
-
 		$field_sql = '';
 
-		if ( is_array($fields) ) {
-			for ( $i = 0; $i < count($fields); $i++ ) {
+		if ( is_array( $fields ) ) {
+			for ( $i = 0, $count = count( $fields ); $i < $count; ++$i ) {
 				if ( $i == 0 )
 					$field_sql .= $wpdb->prepare( "AND ( f.name = %s ", $fields[$i] );
 				else
@@ -855,19 +982,18 @@ Class BP_XProfile_ProfileData {
 
 		$sql = $wpdb->prepare( "SELECT d.value, f.name FROM {$bp->profile->table_name_data} d, {$bp->profile->table_name_fields} f WHERE d.field_id = f.id AND d.user_id = %d AND f.parent_id = 0 $field_sql", $user_id );
 
-		if ( !$values = $wpdb->get_results($sql) )
+		if ( !$values = $wpdb->get_results( $sql ) )
 			return false;
 
 		$new_values = array();
 
-		if ( is_array($fields) ) {
-			for ( $i = 0; $i < count($values); $i++ ) {
-				for ( $j = 0; $j < count($fields); $j++ ) {
-					if ( $values[$i]->name == $fields[$j] ) {
+		if ( is_array( $fields ) ) {
+			for ( $i = 0, $count = count( $values ); $i < $count; ++$i ) {
+				for ( $j = 0; $j < count( $fields ); $j++ ) {
+					if ( $values[$i]->name == $fields[$j] )
 						$new_values[$fields[$j]] = $values[$i]->value;
-					} else if ( !array_key_exists( $fields[$j], $new_values ) ) {
+					else if ( !array_key_exists( $fields[$j], $new_values ) )
 						$new_values[$fields[$j]] = NULL;
-					}
 				}
 			}
 		} else {
@@ -909,15 +1035,18 @@ Class BP_XProfile_ProfileData {
 		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 = false ) {
+	function get_fullname( $user_id = 0 ) {
 		global $bp;
 
 		if ( !$user_id )
 			$user_id = $bp->displayed_user->id;
 
-		$data = xprofile_get_field_data( BP_XPROFILE_FULLNAME_FIELD_NAME, $user_id );
+		$field_name = bp_xprofile_fullname_field_name();
 
-		return $data[BP_XPROFILE_FULLNAME_FIELD_NAME];
+		$data = xprofile_get_field_data( $field_name, $user_id );
+
+		return $data[$field_name];
 	}
 }
-?>
+
+?>
\ 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 51c03faccac946740d1c349ef4ac6ec7d7db67ed..4d401a7ee386298a2a8fb900cfe3ea0ddb51843d 100644
--- a/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-cssjs.php
+++ b/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-cssjs.php
@@ -1,25 +1,31 @@
 <?php
+// Exit if accessed directly
+if ( !defined( 'ABSPATH' ) ) exit;
 
 function xprofile_add_admin_css() {
-	// If this is WP 3.1+ and multisite is enabled, only load on the Network Admin
-	if ( is_multisite() && function_exists( 'is_network_admin' ) && ! is_network_admin()  )
-		return false;
-
-	if ( !empty( $_GET['page'] ) && strpos( $_GET['page'], 'bp-profile-setup' ) !== false )
-		wp_enqueue_style( 'xprofile-admin-css', BP_PLUGIN_URL . '/bp-xprofile/admin/css/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' );
+	}
 }
-add_action( is_multisite() ? 'network_admin_menu' : 'admin_menu', 'xprofile_add_admin_css' );
+add_action( bp_core_admin_hook(), 'xprofile_add_admin_css' );
 
 function xprofile_add_admin_js() {
-	// If this is WP 3.1+ and multisite is enabled, only load on the Network Admin
-	if ( is_multisite() && function_exists( 'is_network_admin' ) && ! is_network_admin()  )
-		return false;
-
 	if ( !empty( $_GET['page'] ) && strpos( $_GET['page'], 'bp-profile-setup' ) !== false ) {
-		wp_enqueue_script( array( "jquery-ui-sortable" ) );
-		wp_enqueue_script( 'xprofile-admin-js', BP_PLUGIN_URL . '/bp-xprofile/admin/js/admin.js', array( 'jquery' ) );
+		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' );
+
+		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' );
 	}
 }
-add_action( is_multisite() ? 'network_admin_menu' : 'admin_menu', 'xprofile_add_admin_js', 1 );
-
+add_action( bp_core_admin_hook(), 'xprofile_add_admin_js', 1 );
 ?>
\ No newline at end of file
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 0fd053ef501f567cfab7261b2d2579e3e9102138..e7e4ed525af94f2eae2bc799728e05c391ef9886 100644
--- a/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-filters.php
+++ b/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-filters.php
@@ -1,19 +1,28 @@
 <?php
+// Exit if accessed directly
+if ( !defined( 'ABSPATH' ) ) exit;
 
 /* Apply WordPress defined filters */
 
-add_filter( 'bp_get_the_profile_field_value',         'wp_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_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'     );
+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' );
@@ -33,9 +42,28 @@ 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', 50, 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 );
+
+/**
+ * xprofile_filter_kses ( $content )
+ *
+ * Run profile field values through kses with filterable allowed tags.
+ *
+ * @param string $content
+ * @return string $content
+ */
+function xprofile_filter_kses( $content ) {
+	global $allowedtags;
+
+	$xprofile_allowedtags             = $allowedtags;
+	$xprofile_allowedtags['a']['rel'] = array();
+
+	$xprofile_allowedtags = apply_filters( 'xprofile_allowed_tags', $xprofile_allowedtags );
+	return wp_kses( $content, $xprofile_allowedtags );
+}
 
 /**
  * xprofile_sanitize_data_value_before_save ( $field_value, $field_id )
@@ -44,9 +72,10 @@ add_filter( 'xprofile_data_value_before_save',        'xprofile_sanitize_data_va
  *
  * @param string $field_value
  * @param int $field_id
+ * @param bool $reserialize Whether to reserialize arrays before returning. Defaults to true
  * @return string
  */
-function xprofile_sanitize_data_value_before_save ( $field_value, $field_id ) {
+function xprofile_sanitize_data_value_before_save ( $field_value, $field_id, $reserialize = true ) {
 
 	// Return if empty
 	if ( empty( $field_value ) )
@@ -57,30 +86,61 @@ function xprofile_sanitize_data_value_before_save ( $field_value, $field_id ) {
 
 	// Filter single value
 	if ( !is_array( $field_value ) ) {
-		$kses_field_value     = wp_filter_kses( $field_value );
-		$filtered_field_value = force_balance_tags( $kses_field_value );
+		$kses_field_value     = xprofile_filter_kses( $field_value );
+		$filtered_field_value = wp_rel_nofollow( force_balance_tags( $kses_field_value ) );
+		$filtered_field_value = apply_filters( 'xprofile_filtered_data_value_before_save', $filtered_field_value, $field_value );
 
 	// Filter each array item independently
 	} else {
+		$filtered_values = array();
 		foreach ( (array)$field_value as $value ) {
-			$kses_field_value       = wp_filter_kses( $value );
-			$filtered_values[] = force_balance_tags( $kses_field_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 );
+
 		}
 
-		$filtered_field_value = serialize( $filtered_values );
+		if ( $reserialize )
+			$filtered_field_value = serialize( $filtered_values );
+		else
+			$filtered_field_value = $filtered_values;
 	}
 
 	return $filtered_field_value;
 }
 
+/**
+ * xprofile_filter_format_field_value()
+ *
+ * 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
+ *
+ * @param string $field_value XProfile field_value to be filtered.
+ * @param string $field_type XProfile field_type to be filtered.
+ *
+ * @uses bp_format_time()
+ *
+ * @return string $field_value Filtered XProfile field_value. False on failure.
+ */
 function xprofile_filter_format_field_value( $field_value, $field_type = '' ) {
 	if ( !isset( $field_value ) || empty( $field_value ) )
 		return false;
 
-	if ( 'datebox' == $field_type )
-		$field_value = bp_format_time( $field_value, true );
-	else
+	if ( 'datebox' == $field_type ) {
+
+		// If Unix timestamp
+		if ( is_numeric( $field_value ) )
+			$field_value = bp_format_time( $field_value, true, false );
+
+		// If MySQL timestamp
+		else
+			$field_value = bp_format_time( strtotime( $field_value ), true, false );
+
+	} else {
 		$field_value = str_replace(']]>', ']]&gt;', $field_value );
+	}
 
 	return stripslashes( $field_value );
 }
@@ -105,7 +165,7 @@ function xprofile_filter_link_profile_data( $field_value, $field_type = 'textbox
 				if ( count( explode( ' ', $value ) ) > 5 ) {
 					$new_values[] = $value;
 				} else {
-					$new_values[] = '<a href="' . site_url( BP_MEMBERS_SLUG ) . '/?s=' . strip_tags( $value ) . '">' . $value . '</a>';
+					$new_values[] = '<a href="' . site_url( bp_get_members_root_slug() ) . '/?s=' . strip_tags( $value ) . '" rel="nofollow">' . $value . '</a>';
 				}
 			}
 		}
@@ -144,4 +204,4 @@ 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
new file mode 100644
index 0000000000000000000000000000000000000000..19988e8a1df3667f0a50e0e0523b8b33bf2986b4
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-functions.php
@@ -0,0 +1,605 @@
+<?php
+/********************************************************************************
+ * Business 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.
+ */
+
+// Exit if accessed directly
+if ( !defined( 'ABSPATH' ) ) exit;
+
+/*** Field Group Management **************************************************/
+
+function xprofile_insert_field_group( $args = '' ) {
+	$defaults = array(
+		'field_group_id' => false,
+		'name'           => false,
+		'description'    => '',
+		'can_delete'     => true
+	);
+
+	$r = wp_parse_args( $args, $defaults );
+	extract( $r, EXTR_SKIP );
+
+	if ( !$name )
+		return false;
+
+	$field_group              = new BP_XProfile_Group( $field_group_id );
+	$field_group->name        = $name;
+	$field_group->description = $description;
+	$field_group->can_delete  = $can_delete;
+
+	return $field_group->save();
+}
+
+function xprofile_get_field_group( $field_group_id ) {
+	$field_group = new BP_XProfile_Group( $field_group_id );
+
+	if ( empty( $field_group->id ) )
+		return false;
+
+	return $field_group;
+}
+
+function xprofile_delete_field_group( $field_group_id ) {
+	$field_group = new BP_XProfile_Group( $field_group_id );
+	return $field_group->delete();
+}
+
+function xprofile_update_field_group_position( $field_group_id, $position ) {
+	return BP_XProfile_Group::update_position( $field_group_id, $position );
+}
+
+
+/*** Field Management *********************************************************/
+
+function xprofile_insert_field( $args = '' ) {
+	global $bp;
+
+	extract( $args );
+
+	/**
+	 * Possible parameters (pass as assoc array):
+	 *	'field_id'
+	 *	'field_group_id'
+	 *	'parent_id'
+	 *	'type'
+	 *	'name'
+	 *	'description'
+	 *	'is_required'
+	 *	'can_delete'
+	 *	'field_order'
+	 *	'order_by'
+	 *	'is_default_option'
+	 *	'option_order'
+	 */
+
+	// Check we have the minimum details
+	if ( !$field_group_id )
+		return false;
+
+	// Check this is a valid field type
+	if ( !in_array( $type, (array) $bp->profile->field_types ) )
+		return false;
+
+	// Instantiate a new field object
+	if ( $field_id )
+		$field = new BP_XProfile_Field( $field_id );
+	else
+		$field = new BP_XProfile_Field;
+
+	$field->group_id = $field_group_id;
+
+	if ( !empty( $parent_id ) )
+		$field->parent_id = $parent_id;
+
+	if ( !empty( $type ) )
+		$field->type = $type;
+
+	if ( !empty( $name ) )
+		$field->name = $name;
+
+	if ( !empty( $description ) )
+		$field->description = $description;
+
+	if ( !empty( $is_required ) )
+		$field->is_required = $is_required;
+
+	if ( !empty( $can_delete ) )
+		$field->can_delete = $can_delete;
+
+	if ( !empty( $field_order ) )
+		$field->field_order = $field_order;
+
+	if ( !empty( $order_by ) )
+		$field->order_by = $order_by;
+
+	if ( !empty( $is_default_option ) )
+		$field->is_default_option = $is_default_option;
+
+	if ( !empty( $option_order ) )
+		$field->option_order = $option_order;
+
+	return $field->save();
+}
+
+function xprofile_get_field( $field_id ) {
+	return new BP_XProfile_Field( $field_id );
+}
+
+function xprofile_delete_field( $field_id ) {
+	$field = new BP_XProfile_Field( $field_id );
+	return $field->delete();
+}
+
+
+/*** Field Data Management *****************************************************/
+
+/**
+ * Fetches profile data for a specific field for the user.
+ *
+ * When the field value is serialized, this function unserializes and filters each item in the array
+ * that results.
+ *
+ * @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
+ * @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;
+
+	if ( empty( $user_id ) )
+		$user_id = $bp->displayed_user->id;
+
+	if ( empty( $user_id ) )
+		return false;
+
+	if ( is_numeric( $field ) )
+		$field_id = $field;
+	else
+		$field_id = xprofile_get_field_id_from_name( $field );
+
+	if ( empty( $field_id ) )
+		return false;
+
+	$values = maybe_unserialize( BP_XProfile_ProfileData::get_value_byid( $field_id, $user_id ) );
+
+	if ( is_array( $values ) ) {
+		$data = array();
+		foreach( (array)$values as $value ) {
+			$data[] = apply_filters( 'xprofile_get_field_data', $value, $field_id, $user_id );
+		}
+	} else {
+		$data = apply_filters( 'xprofile_get_field_data', $values, $field_id, $user_id );
+	}
+
+	return $data;
+}
+
+/**
+ * A simple function to set profile data for a specific field for a specific user.
+ *
+ * @package BuddyPress Core
+ * @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
+ * @uses xprofile_get_field_id_from_name() Gets the ID for the field based on the name.
+ * @return true on success, false on failure.
+ */
+function xprofile_set_field_data( $field, $user_id, $value, $is_required = false ) {
+
+	if ( is_numeric( $field ) )
+		$field_id = $field;
+	else
+		$field_id = xprofile_get_field_id_from_name( $field );
+
+	if ( empty( $field_id ) )
+		return false;
+
+	if ( $is_required && ( empty( $value ) || !is_array( $value ) && !strlen( trim( $value ) ) ) )
+		return false;
+
+	$field = new BP_XProfile_Field( $field_id );
+
+	// If the value is empty, then delete any field data that exists, unless the field is of a
+	// type where null values are semantically meaningful
+	if ( empty( $value ) && 'checkbox' != $field->type && 'multiselectbox' != $field->type ) {
+		xprofile_delete_field_data( $field_id, $user_id );
+		return true;
+	}
+
+	// Check the value is an acceptable value
+	if ( 'checkbox' == $field->type || 'radio' == $field->type || 'selectbox' == $field->type || 'multiselectbox' == $field->type ) {
+		$options = $field->get_children();
+
+		foreach( $options as $option )
+			$possible_values[] = $option->name;
+
+		if ( is_array( $value ) ) {
+			foreach( $value as $i => $single ) {
+				if ( !in_array( $single, (array)$possible_values ) ) {
+					unset( $value[$i] );
+				}
+			}
+
+			// Reset the keys by merging with an empty array
+			$value = array_merge( array(), $value );
+		} else {
+			if ( !in_array( $value, (array)$possible_values ) ) {
+				return false;
+			}
+		}
+	}
+
+	$field           = new BP_XProfile_ProfileData();
+	$field->field_id = $field_id;
+	$field->user_id  = $user_id;
+	$field->value    = maybe_serialize( $value );
+
+	return $field->save();
+}
+
+function xprofile_delete_field_data( $field, $user_id ) {
+	if ( is_numeric( $field ) )
+		$field_id = $field;
+	else
+		$field_id = xprofile_get_field_id_from_name( $field );
+
+	if ( empty( $field_id ) || empty( $user_id ) )
+		return false;
+
+	$field = new BP_XProfile_ProfileData( $field_id, $user_id );
+	return $field->delete();
+}
+
+function xprofile_check_is_required_field( $field_id ) {
+	$field = new BP_Xprofile_Field( $field_id );
+
+	// Define locale variable(s)
+	$retval = false;
+
+	// Super admins can skip required check
+	if ( is_super_admin() && !is_admin() )
+		$retval = false;
+
+	// All other users will use the field's setting
+	elseif ( isset( $field->is_required ) )
+		$retval = $field->is_required;
+
+	return (bool) $retval;
+}
+
+/**
+ * Returns the ID for the field based on the field name.
+ *
+ * @package BuddyPress Core
+ * @param $field_name The name of the field to get the ID for.
+ * @return int $field_id on success, false on failure.
+ */
+function xprofile_get_field_id_from_name( $field_name ) {
+	return BP_Xprofile_Field::get_id_from_name( $field_name );
+}
+
+/**
+ * Fetches a random piece of profile data for the user.
+ *
+ * @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 $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 );
+
+	if ( !$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 ) )
+		return false;
+
+	return apply_filters( 'xprofile_get_random_profile_data', $field_data );
+}
+
+/**
+ * Formats a profile field according to its type. [ TODO: Should really be moved to filters ]
+ *
+ * @package BuddyPress Core
+ * @param $field_type The type of field: datebox, selectbox, textbox etc
+ * @param $field_value The actual value
+ * @uses bp_format_time() Formats a time value based on the WordPress date format setting
+ * @return $field_value The formatted value
+ */
+function xprofile_format_profile_field( $field_type, $field_value ) {
+	if ( !isset( $field_value ) || empty( $field_value ) )
+		return false;
+
+	$field_value = bp_unserialize_profile_field( $field_value );
+
+	if ( 'datebox' == $field_type ) {
+		$field_value = bp_format_time( $field_value, true );
+	} else {
+		$content = $field_value;
+		$field_value = str_replace( ']]>', ']]&gt;', $content );
+	}
+
+	return stripslashes_deep( $field_value );
+}
+
+function xprofile_update_field_position( $field_id, $position, $field_group_id ) {
+	return BP_XProfile_Field::update_position( $field_id, $position, $field_group_id );
+}
+
+/**
+ * Setup the avatar upload directory for a user.
+ *
+ * @package BuddyPress Core
+ * @param $directory The root directory name
+ * @param $user_id The user 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;
+
+	if ( empty( $directory ) )
+		$directory = 'avatars';
+
+	$path    = bp_core_avatar_upload_path() . '/avatars/' . $user_id;
+	$newbdir = $path;
+
+	if ( !file_exists( $path ) )
+		@wp_mkdir_p( $path );
+
+	$newurl    = bp_core_avatar_url() . '/avatars/' . $user_id;
+	$newburl   = $newurl;
+	$newsubdir = '/avatars/' . $user_id;
+
+	return apply_filters( 'xprofile_avatar_upload_dir', array(
+		'path'    => $path,
+		'url'     => $newurl,
+		'subdir'  => $newsubdir,
+		'basedir' => $newbdir,
+		'baseurl' => $newburl,
+		'error'   => false
+	) );
+}
+
+/**
+ * Syncs Xprofile data to the standard built in WordPress profile data.
+ *
+ * @package BuddyPress Core
+ */
+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'] )
+		return true;
+
+	if ( empty( $user_id ) )
+		$user_id = $bp->loggedin_user->id;
+
+	if ( empty( $user_id ) )
+		return false;
+
+	$fullname = xprofile_get_field_data( bp_xprofile_fullname_field_name(), $user_id );
+	$space    = strpos( $fullname, ' ' );
+
+	if ( false === $space ) {
+		$firstname = $fullname;
+		$lastname = '';
+	} else {
+		$firstname = substr( $fullname, 0, $space );
+		$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  );
+
+	$wpdb->query( $wpdb->prepare( "UPDATE {$wpdb->users} SET display_name = %s WHERE ID = %d", $fullname, $user_id ) );
+}
+add_action( 'xprofile_updated_profile', 'xprofile_sync_wp_profile' );
+add_action( 'bp_core_signup_user', 'xprofile_sync_wp_profile' );
+
+
+/**
+ * Syncs the standard built in WordPress profile data to XProfile.
+ *
+ * @since 1.2.4
+ * @package BuddyPress Core
+ */
+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() )
+		return;
+
+	xprofile_set_field_data( bp_xprofile_fullname_field_name(), $user->ID, $user->display_name );
+}
+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.
+ *
+ * @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' );
+add_action( 'bp_make_spam_user', 'xprofile_remove_data' );
+
+/*** XProfile Meta ****************************************************/
+
+function bp_xprofile_delete_meta( $object_id, $object_type, $meta_key = false, $meta_value = false ) {
+	global $wpdb, $bp;
+
+	$object_id = (int) $object_id;
+
+	if ( !$object_id )
+		return false;
+
+	if ( !isset( $object_type ) )
+		return false;
+
+	if ( !in_array( $object_type, array( 'group', 'field', 'data' ) ) )
+		return false;
+
+	$meta_key = preg_replace( '|[^a-z0-9_]|i', '', $meta_key );
+
+	if ( is_array( $meta_value ) || is_object( $meta_value ) )
+		$meta_value = serialize( $meta_value );
+
+	$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 ) );
+	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 ) );
+	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 ) );
+
+	// Delete the cached object
+	wp_cache_delete( 'bp_xprofile_meta_' . $object_type . '_' . $object_id . '_' . $meta_key, 'bp' );
+
+	return true;
+}
+
+function bp_xprofile_get_meta( $object_id, $object_type, $meta_key = '') {
+	global $wpdb, $bp;
+
+	$object_id = (int) $object_id;
+
+	if ( !$object_id )
+		return false;
+
+	if ( !isset( $object_type ) )
+		return false;
+
+	if ( !in_array( $object_type, array( 'group', 'field', 'data' ) ) )
+		return false;
+
+	if ( !empty( $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 ) );
+			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 ) );
+	}
+
+	if ( empty( $metas ) ) {
+		if ( empty( $meta_key ) ) {
+			return array();
+		} else {
+			return '';
+		}
+	}
+
+	$metas = array_map( 'maybe_unserialize', (array)$metas );
+
+	if ( 1 == count( $metas ) )
+		return $metas[0];
+	else
+		return $metas;
+}
+
+function bp_xprofile_update_meta( $object_id, $object_type, $meta_key, $meta_value ) {
+	global $wpdb, $bp;
+
+	$object_id = (int) $object_id;
+
+	if ( empty( $object_id ) )
+		return false;
+
+	if ( !isset( $object_type ) )
+		return false;
+
+	if ( !in_array( $object_type, array( 'group', 'field', 'data' ) ) )
+		return false;
+
+	$meta_key = preg_replace( '|[^a-z0-9_]|i', '', $meta_key );
+
+	if ( is_string( $meta_value ) )
+		$meta_value = stripslashes( $wpdb->escape( $meta_value ) );
+
+	$meta_value = maybe_serialize( $meta_value );
+
+	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 ) );
+
+	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 ) );
+	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 ) );
+	else
+		return false;
+
+	// Update the cached object and recache
+	wp_cache_set( 'bp_xprofile_meta_' . $object_type . '_' . $object_id . '_' . $meta_key, $meta_value, 'bp' );
+
+	return true;
+}
+
+function bp_xprofile_update_fieldgroup_meta( $field_group_id, $meta_key, $meta_value ) {
+	return bp_xprofile_update_meta( $field_group_id, 'group', $meta_key, $meta_value );
+}
+
+function bp_xprofile_update_field_meta( $field_id, $meta_key, $meta_value ) {
+	return bp_xprofile_update_meta( $field_id, 'field', $meta_key, $meta_value );
+}
+
+function bp_xprofile_update_fielddata_meta( $field_data_id, $meta_key, $meta_value ) {
+	return bp_xprofile_update_meta( $field_data_id, 'data', $meta_key, $meta_value );
+}
+
+/**
+ * Return the field name for the Full Name xprofile field
+ *
+ * @package BuddyPress
+ * @since 1.5
+ *
+ * @return str The field name
+ */
+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
diff --git a/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-loader.php b/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-loader.php
new file mode 100644
index 0000000000000000000000000000000000000000..f7506de8c4d1c6ecf59bde5f8900ff49d11213a1
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-loader.php
@@ -0,0 +1,237 @@
+<?php
+/**
+ * BuddyPress XProfile Loader
+ *
+ * An extended profile component for users. This allows site admins to create
+ * groups of fields for users to enter information about themselves.
+ *
+ * @package BuddyPress
+ * @subpackage XProfile Core
+ */
+
+// Exit if accessed directly
+if ( !defined( 'ABSPATH' ) ) exit;
+
+class BP_XProfile_Component extends BP_Component {
+
+	/**
+	 * Start the xprofile component creation process
+	 *
+	 * @since 1.5
+	 */
+	function __construct() {
+		parent::start(
+			'xprofile',
+			__( 'Extended Profiles', 'buddypress' ),
+			BP_PLUGIN_DIR
+		);
+	}
+
+	/**
+	 * Include files
+	 */
+	function includes() {
+		$includes = array(
+			'cssjs',
+			'cache',
+			'actions',
+			'activity',
+			'screens',
+			'classes',
+			'filters',
+			'template',
+			'buddybar',
+			'functions',
+		);
+
+		if ( is_admin() )
+			$includes[] = 'admin';
+
+		parent::includes( $includes );
+	}
+
+	/**
+	 * Setup globals
+	 *
+	 * The BP_XPROFILE_SLUG constant is deprecated, and only used here for
+	 * backwards compatibility.
+	 *
+	 * @since 1.5
+	 * @global obj $bp
+	 */
+	function setup_globals() {
+		global $bp;
+
+		// Define a slug, if necessary
+		if ( !defined( 'BP_XPROFILE_SLUG' ) )
+			define( 'BP_XPROFILE_SLUG', 'profile' );
+
+		// Assign the base group and fullname field names to constants to use
+		// in SQL statements
+		define ( 'BP_XPROFILE_BASE_GROUP_NAME',     stripslashes( $bp->site_options['bp-xprofile-base-group-name']     ) );
+		define ( 'BP_XPROFILE_FULLNAME_FIELD_NAME', stripslashes( $bp->site_options['bp-xprofile-fullname-field-name'] ) );
+
+		// Set the support field type ids
+		$this->field_types = apply_filters( 'xprofile_field_types', array(
+			'textbox',
+			'textarea',
+			'radio',
+			'checkbox',
+			'selectbox',
+			'multiselectbox',
+			'datebox'
+		) );
+
+		// Tables
+		$global_tables = array(
+			'table_name_data'   => $bp->table_prefix . 'bp_xprofile_data',
+			'table_name_groups' => $bp->table_prefix . 'bp_xprofile_groups',
+			'table_name_fields' => $bp->table_prefix . 'bp_xprofile_fields',
+			'table_name_meta'   => $bp->table_prefix . 'bp_xprofile_meta',
+		);
+
+		$globals = array(
+			'slug'                  => BP_XPROFILE_SLUG,
+			'has_directory'         => false,
+			'notification_callback' => 'xprofile_format_notifications',
+			'global_tables'         => $global_tables
+		);
+
+		parent::setup_globals( $globals );
+	}
+
+	/**
+	 * Setup BuddyBar navigation
+	 *
+	 * @global obj $bp
+	 */
+	function setup_nav() {
+		global $bp;
+
+		// Add 'Profile' to the main navigation
+		$main_nav = array(
+			'name'                => __( 'Profile', 'buddypress' ),
+			'slug'                => $this->slug,
+			'position'            => 20,
+			'screen_function'     => 'xprofile_screen_display_profile',
+			'default_subnav_slug' => 'public',
+			'item_css_id'         => $this->id
+		);
+
+		$profile_link = trailingslashit( $bp->loggedin_user->domain . $this->slug );
+
+		// Add the subnav items to the profile
+		$sub_nav[] = array(
+			'name'            => __( 'Public', 'buddypress' ),
+			'slug'            => 'public',
+			'parent_url'      => $profile_link,
+			'parent_slug'     => $this->slug,
+			'screen_function' => 'xprofile_screen_display_profile',
+			'position'        => 10
+		);
+
+		// Edit Profile
+		$sub_nav[] = array(
+			'name'            => __( 'Edit', 'buddypress' ),
+			'slug'            => 'edit',
+			'parent_url'      => $profile_link,
+			'parent_slug'     => $this->slug,
+			'screen_function' => 'xprofile_screen_edit_profile',
+			'position'        => 20
+		);
+
+		// Change Avatar
+		$sub_nav[] = array(
+			'name'            => __( 'Change Avatar', 'buddypress' ),
+			'slug'            => 'change-avatar',
+			'parent_url'      => $profile_link,
+			'parent_slug'     => $this->slug,
+			'screen_function' => 'xprofile_screen_change_avatar',
+			'position'        => 30
+		);
+
+		parent::setup_nav( $main_nav, $sub_nav );
+	}
+
+	/**
+	 * Set up the admin bar
+	 *
+	 * @global obj $bp
+	 */
+	function setup_admin_bar() {
+		global $bp;
+
+		// Prevent debug notices
+		$wp_admin_nav = array();
+
+		// Menus for logged in user
+		if ( is_user_logged_in() ) {
+
+			// Profile link
+			$profile_link = trailingslashit( $bp->loggedin_user->domain . $this->slug );
+
+			// Add the "Profile" sub menu
+			$wp_admin_nav[] = array(
+				'parent' => $bp->my_account_menu_id,
+				'id'     => 'my-account-' . $this->id,
+				'title'  => __( 'Profile', 'buddypress' ),
+				'href'   => trailingslashit( $profile_link )
+			);
+
+			// View Profile
+			$wp_admin_nav[] = array(
+				'parent' => 'my-account-' . $this->id,
+				'id'     => 'my-account-' . $this->id . '-view',
+				'title'  => __( 'View', 'buddypress' ),
+				'href'   => trailingslashit( $profile_link . 'public' )
+			);
+
+			// Edit Profile
+			$wp_admin_nav[] = array(
+				'parent' => 'my-account-' . $this->id,
+				'id'     => 'my-account-' . $this->id . '-edit',
+				'title'  => __( 'Edit', 'buddypress' ),
+				'href'   => trailingslashit( $profile_link . 'edit' )
+			);
+
+			// Edit Profile
+			$wp_admin_nav[] = array(
+				'parent' => 'my-account-' . $this->id,
+				'id'     => 'my-account-' . $this->id . '-change-avatar',
+				'title'  => __( 'Change Avatar', 'buddypress' ),
+				'href'   => trailingslashit( $profile_link . 'change-avatar' )
+			);
+
+		}
+
+		parent::setup_admin_bar( $wp_admin_nav );
+	}
+
+	/**
+	 * Sets up the title for pages and <title>
+	 *
+	 * @global obj $bp
+	 */
+	function setup_title() {
+		global $bp;
+
+		if ( bp_is_profile_component() ) {
+			if ( bp_is_my_profile() ) {
+				$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'
+				) );
+				$bp->bp_options_title = $bp->displayed_user->fullname;
+			}
+		}
+
+		parent::setup_title();
+	}
+}
+// Create the xprofile component
+if ( !isset( $bp->profile->id ) )
+	$bp->profile = new BP_XProfile_Component();
+
+?>
diff --git a/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-screens.php b/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-screens.php
new file mode 100644
index 0000000000000000000000000000000000000000..f01a947370205bf4a84ebb8d8efc2cdc26b4f8cb
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-screens.php
@@ -0,0 +1,177 @@
+<?php
+/*******************************************************************************
+ * 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.
+ */
+
+// Exit if accessed directly
+if ( !defined( 'ABSPATH' ) ) exit;
+
+/**
+ * Handles the display of the profile page by loading the correct template file.
+ *
+ * @package BuddyPress XProfile
+ * @uses bp_core_load_template() Looks for and loads a template file within the current member theme (folder/filename)
+ */
+function xprofile_screen_display_profile() {
+	$new = isset( $_GET['new'] ) ? $_GET['new'] : '';
+
+	do_action( 'xprofile_screen_display_profile', $new );
+	bp_core_load_template( apply_filters( 'xprofile_template_display_profile', 'members/single/home' ) );
+}
+
+/**
+ * Handles the display of the profile edit page by loading the correct template file.
+ * Also checks to make sure this can only be accessed for the logged in users profile.
+ *
+ * @package BuddyPress XProfile
+ * @uses bp_is_my_profile() Checks to make sure the current user being viewed equals the logged in user
+ * @uses bp_core_load_template() Looks for and loads a template file within the current member theme (folder/filename)
+ */
+function xprofile_screen_edit_profile() {
+	global $bp;
+
+	if ( !bp_is_my_profile() && !is_super_admin() )
+		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' );
+
+	// Check the field group exists
+	if ( !bp_is_action_variable( 'group' ) || !xprofile_get_field_group( bp_action_variable( 1 ) ) ) {
+		bp_do_404();
+		return;
+	}
+
+	// Check to see if any new information has been submitted
+	if ( isset( $_POST['field_ids'] ) ) {
+
+		// Check the nonce
+		check_admin_referer( 'bp_xprofile_edit' );
+
+		// 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 ) ) );
+
+		// Explode the posted field IDs into an array so we know which
+		// fields have been submitted
+		$posted_field_ids = explode( ',', $_POST['field_ids'] );
+		$is_required      = array();
+
+		// Loop through the posted fields formatting any datebox values
+		// then validate the field
+		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'] ) ) {
+					// 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 ) );
+				}
+
+			}
+
+			$is_required[$field_id] = xprofile_check_is_required_field( $field_id );
+			if ( $is_required[$field_id] && empty( $_POST['field_' . $field_id] ) )
+				$errors = true;
+		}
+
+		// There are errors
+		if ( !empty( $errors ) ) {
+			bp_core_add_message( __( 'Please make sure you fill in all required fields in this profile field group before saving.', 'buddypress' ), 'error' );
+
+		// 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 ) {
+
+				// 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] ) )
+					$value = array();
+				else
+					$value = $_POST['field_' . $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 );
+			}
+
+			do_action( 'xprofile_updated_profile', $bp->displayed_user->id, $posted_field_ids, $errors );
+
+			// Set the feedback messages
+			if ( $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' ) );
+
+			// Redirect back to the edit screen to display the updates and message
+			bp_core_redirect( trailingslashit( bp_displayed_user_domain() . $bp->profile->slug . '/edit/group/' . bp_action_variable( 1 ) ) );
+		}
+	}
+
+	do_action( 'xprofile_screen_edit_profile' );
+	bp_core_load_template( apply_filters( 'xprofile_template_edit_profile', 'members/single/home' ) );
+}
+
+/**
+ * Handles the uploading and cropping of a user avatar. Displays the change avatar page.
+ *
+ * @package BuddyPress XProfile
+ * @uses bp_is_my_profile() Checks to make sure the current user being viewed equals the logged in user
+ * @uses bp_core_load_template() Looks for and loads a template file within the current member theme (folder/filename)
+ */
+function xprofile_screen_change_avatar() {
+	global $bp;
+
+	if ( !bp_is_my_profile() && !is_super_admin() )
+		return false;
+
+	if ( bp_action_variables() ) {
+		bp_do_404();
+		return;
+	}
+
+	$bp->avatar_admin->step = 'upload-image';
+
+	if ( !empty( $_FILES ) ) {
+
+		// Check the nonce
+		check_admin_referer( 'bp_avatar_upload' );
+
+		// Pass the file to the avatar upload handler
+		if ( bp_core_avatar_handle_upload( $_FILES, 'xprofile_avatar_upload_dir' ) ) {
+			$bp->avatar_admin->step = 'crop-image';
+
+			// Make sure we include the jQuery jCrop file for image cropping
+			add_action( 'wp_print_scripts', 'bp_core_add_jquery_cropper' );
+		}
+	}
+
+	// If the image cropping is done, crop the image and save a full/thumb version
+	if ( isset( $_POST['avatar-crop-submit'] ) ) {
+
+		// 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'] ) ) )
+			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' ) );
+			do_action( 'xprofile_avatar_uploaded' );
+		}
+	}
+
+	do_action( '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
new file mode 100644
index 0000000000000000000000000000000000000000..f7ebceb04490f2c33bd80be90d3722cd5aed7391
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-template.php
@@ -0,0 +1,826 @@
+<?php
+/***************************************************************************
+ * XProfile Data Display Template Tags
+ **/
+
+// Exit if accessed directly
+if ( !defined( 'ABSPATH' ) ) exit;
+
+Class BP_XProfile_Data_Template {
+	var $current_group = -1;
+	var $group_count;
+	var $groups;
+	var $group;
+
+	var $current_field = -1;
+	var $field_count;
+	var $field_has_data;
+	var $field;
+
+	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 ) {
+		$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
+		) );
+
+		$this->group_count = count($this->groups);
+		$this->user_id = $user_id;
+	}
+
+	function has_groups() {
+		if ( $this->group_count )
+			return true;
+
+		return false;
+	}
+
+	function next_group() {
+		$this->current_group++;
+
+		$this->group         = $this->groups[$this->current_group];
+		$this->group->fields = apply_filters( 'xprofile_group_fields', $this->group->fields, $this->group->id );
+		$this->field_count   = count( $this->group->fields );
+
+		return $this->group;
+	}
+
+	function rewind_groups() {
+		$this->current_group = -1;
+		if ( $this->group_count > 0 ) {
+			$this->group = $this->groups[0];
+		}
+	}
+
+	function profile_groups() {
+		if ( $this->current_group + 1 < $this->group_count ) {
+			return true;
+		} elseif ( $this->current_group + 1 == $this->group_count ) {
+			do_action('xprofile_template_loop_end');
+			// Do some cleaning up after the loop
+			$this->rewind_groups();
+		}
+
+		$this->in_the_loop = false;
+		return false;
+	}
+
+	function the_profile_group() {
+		global $group;
+
+		$this->in_the_loop = true;
+		$group = $this->next_group();
+
+		if ( 0 == $this->current_group ) // loop has just started
+			do_action('xprofile_template_loop_start');
+	}
+
+	/**** FIELDS ****/
+
+	function next_field() {
+		$this->current_field++;
+
+		$this->field = $this->group->fields[$this->current_field];
+		return $this->field;
+	}
+
+	function rewind_fields() {
+		$this->current_field = -1;
+		if ( $this->field_count > 0 ) {
+			$this->field = $this->group->fields[0];
+		}
+	}
+
+	function has_fields() {
+		$has_data = false;
+
+		for ( $i = 0, $count = count( $this->group->fields ); $i < $count; ++$i ) {
+			$field = &$this->group->fields[$i];
+
+			if ( !empty( $field->data ) && $field->data->value != null ) {
+				$has_data = true;
+			}
+		}
+
+		if ( $has_data )
+			return true;
+
+		return false;
+	}
+
+	function profile_fields() {
+		if ( $this->current_field + 1 < $this->field_count ) {
+			return true;
+		} elseif ( $this->current_field + 1 == $this->field_count ) {
+			// Do some cleaning up after the loop
+			$this->rewind_fields();
+		}
+
+		return false;
+	}
+
+	function the_profile_field() {
+		global $field;
+
+		$field = $this->next_field();
+
+		$value = !empty( $field->data ) && !empty( $field->data->value ) ? maybe_unserialize( $field->data->value ) : false;
+
+		if ( !empty( $value ) ) {
+			$this->field_has_data = true;
+		} else {
+			$this->field_has_data = false;
+		}
+	}
+}
+
+function xprofile_get_profile() {
+	locate_template( array( 'profile/profile-loop.php'), true );
+}
+
+function bp_has_profile( $args = '' ) {
+	global $bp, $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() );
+
+	$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
+	);
+
+	$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 );
+	return apply_filters( 'bp_has_profile', $profile_template->has_groups(), $profile_template );
+}
+
+function bp_profile_groups() {
+	global $profile_template;
+	return $profile_template->profile_groups();
+}
+
+function bp_the_profile_group() {
+	global $profile_template;
+	return $profile_template->the_profile_group();
+}
+
+function bp_profile_group_has_fields() {
+	global $profile_template;
+	return $profile_template->has_fields();
+}
+
+function bp_field_css_class( $class = false ) {
+	echo bp_get_field_css_class( $class );
+}
+	function bp_get_field_css_class( $class = false ) {
+		global $profile_template;
+
+		$css_classes = array();
+
+		if ( $class )
+			$css_classes[] = sanitize_title( esc_attr( $class ) );
+
+		// Set a class with the field ID
+		$css_classes[] = 'field_' . $profile_template->field->id;
+
+		// Set a class with the field name (sanitized)
+		$css_classes[] = 'field_' . sanitize_title( $profile_template->field->name );
+
+		if ( $profile_template->current_field % 2 == 1 )
+			$css_classes[] = 'alt';
+
+		$css_classes = apply_filters_ref_array( 'bp_field_css_classes', array( &$css_classes ) );
+
+		return apply_filters( 'bp_get_field_css_class', ' class="' . implode( ' ', $css_classes ) . '"' );
+	}
+
+function bp_field_has_data() {
+	global $profile_template;
+	return $profile_template->field_has_data;
+}
+
+function bp_field_has_public_data() {
+	global $profile_template;
+
+	if ( $profile_template->field_has_data )
+		return true;
+
+	return false;
+}
+
+function bp_the_profile_group_id() {
+	echo bp_get_the_profile_group_id();
+}
+	function bp_get_the_profile_group_id() {
+		global $group;
+		return apply_filters( 'bp_get_the_profile_group_id', $group->id );
+	}
+
+function bp_the_profile_group_name() {
+	echo bp_get_the_profile_group_name();
+}
+	function bp_get_the_profile_group_name() {
+		global $group;
+		return apply_filters( 'bp_get_the_profile_group_name', $group->name );
+	}
+
+function bp_the_profile_group_slug() {
+	echo bp_get_the_profile_group_slug();
+}
+	function bp_get_the_profile_group_slug() {
+		global $group;
+		return apply_filters( 'bp_get_the_profile_group_slug', sanitize_title( $group->name ) );
+	}
+
+function bp_the_profile_group_description() {
+	echo bp_get_the_profile_group_description();
+}
+	function bp_get_the_profile_group_description() {
+		global $group;
+		echo apply_filters( 'bp_get_the_profile_group_description', $group->description );
+	}
+
+function bp_the_profile_group_edit_form_action() {
+	echo bp_get_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 ) );
+	}
+
+function bp_the_profile_group_field_ids() {
+	echo bp_get_the_profile_group_field_ids();
+}
+	function bp_get_the_profile_group_field_ids() {
+		global $group;
+
+		$field_ids = '';
+		foreach ( (array) $group->fields as $field )
+			$field_ids .= $field->id . ',';
+
+		return substr( $field_ids, 0, -1 );
+	}
+
+function bp_profile_fields() {
+	global $profile_template;
+	return $profile_template->profile_fields();
+}
+
+function bp_the_profile_field() {
+	global $profile_template;
+	return $profile_template->the_profile_field();
+}
+
+function bp_the_profile_field_id() {
+	echo bp_get_the_profile_field_id();
+}
+	function bp_get_the_profile_field_id() {
+		global $field;
+		return apply_filters( 'bp_get_the_profile_field_id', $field->id );
+	}
+
+function bp_the_profile_field_name() {
+	echo bp_get_the_profile_field_name();
+}
+	function bp_get_the_profile_field_name() {
+		global $field;
+
+		return apply_filters( 'bp_get_the_profile_field_name', $field->name );
+	}
+
+function bp_the_profile_field_value() {
+	echo bp_get_the_profile_field_value();
+}
+	function bp_get_the_profile_field_value() {
+		global $field;
+
+		$field->data->value = bp_unserialize_profile_field( $field->data->value );
+
+		return apply_filters( 'bp_get_the_profile_field_value', $field->data->value, $field->type, $field->id );
+	}
+
+function bp_the_profile_field_edit_value() {
+	echo bp_get_the_profile_field_edit_value();
+}
+	function bp_get_the_profile_field_edit_value() {
+		global $field;
+
+		/**
+		 * 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 ) )
+			$field->data->value = '';
+
+		if ( isset( $_POST['field_' . $field->id] ) && $field->data->value != $_POST['field_' . $field->id] ) {
+			if ( !empty( $_POST['field_' . $field->id] ) )
+				$field->data->value = $_POST['field_' . $field->id];
+			else
+				$field->data->value = '';
+		}
+
+		$field_value = isset( $field->data->value ) ? bp_unserialize_profile_field( $field->data->value ) : '';
+
+		return apply_filters( 'bp_get_the_profile_field_edit_value', $field_value, $field->type, $field->id );
+	}
+
+function bp_the_profile_field_type() {
+	echo bp_get_the_profile_field_type();
+}
+	function bp_get_the_profile_field_type() {
+		global $field;
+
+		return apply_filters( 'bp_the_profile_field_type', $field->type );
+	}
+
+function bp_the_profile_field_description() {
+	echo bp_get_the_profile_field_description();
+}
+	function bp_get_the_profile_field_description() {
+		global $field;
+
+		return apply_filters( 'bp_get_the_profile_field_description', $field->description );
+	}
+
+function bp_the_profile_field_input_name() {
+	echo bp_get_the_profile_field_input_name();
+}
+	function bp_get_the_profile_field_input_name() {
+		global $field;
+
+		$array_box = false;
+		if ( 'multiselectbox' == $field->type )
+			$array_box = '[]';
+
+		return apply_filters( 'bp_get_the_profile_field_input_name', 'field_' . $field->id . $array_box );
+	}
+
+/**
+ * bp_the_profile_field_options()
+ *
+ * Displays field options HTML for field types of 'selectbox', 'multiselectbox',
+ * 'radio', 'checkbox', and 'datebox'.
+ *
+ * @package BuddyPress Xprofile
+ * @since 1.1
+ *
+ * @uses bp_get_the_profile_field_options()
+ *
+ * @param array $args Specify type for datebox. Allowed 'day', 'month', 'year'.
+ */
+function bp_the_profile_field_options( $args = '' ) {
+	echo bp_get_the_profile_field_options( $args );
+}
+	/**
+	 * bp_get_the_profile_field_options()
+	 *
+	 * Retrieves field options HTML for field types of 'selectbox', 'multiselectbox',
+	 * 'radio', 'checkbox', and 'datebox'.
+	 *
+	 * @package BuddyPress Xprofile
+	 * @since 1.1
+	 *
+	 * @uses BP_XProfile_Field::get_children()
+	 * @uses BP_XProfile_ProfileData::get_value_byid()
+	 *
+	 * @param array $args Specify type for datebox. Allowed 'day', 'month', 'year'.
+	 */
+	function bp_get_the_profile_field_options( $args = '' ) {
+		global $field;
+
+		$defaults = array(
+			'type' => false
+		);
+
+		$r = wp_parse_args( $args, $defaults );
+		extract( $r, EXTR_SKIP );
+
+		if ( !method_exists( $field, 'get_children' ) )
+			$field = new BP_XProfile_Field( $field->id );
+
+		$options = $field->get_children();
+
+		// Setup some defaults
+		$html     = '';
+		$selected = '';
+
+		switch ( $field->type ) {
+			case 'selectbox':
+				if ( !$field->is_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] ) )
+					$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] ) )
+								$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 ) )
+						$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 )
+						$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 );
+				}
+				break;
+
+			case 'multiselectbox':
+				$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] ) )
+					$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] ) )
+								$option_values[] = $_POST['field_' . $field->id][$i];
+						}
+					}
+					$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 ) )
+						$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 )
+						$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 );
+				}
+				break;
+
+			case 'radio':
+				$html .= '<div id="field_' . $field->id . '">';
+				$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] ) )
+							$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 = '';
+					if ( $option_value == $allowed_options || !empty( $value ) && $value == $allowed_options || ( empty( $option_value ) && $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 );
+				}
+
+				$html .= '</div>';
+				break;
+
+			case 'checkbox':
+				$option_values = BP_XProfile_ProfileData::get_value_byid( $field->id );
+				$option_values = 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] ) ) {
+					if ( !empty( $_POST['field_' . $field->id] ) )
+						$option_values = $_POST['field_' . $field->id];
+				}
+
+				for ( $k = 0, $count = count( $options ); $k < $count; ++$k ) {
+					$selected = '';
+
+					// First, check to see whether the user's saved values
+					// match the option
+					for ( $j = 0, $count_values = count( $option_values ); $j < $count_values; ++$j ) {
+
+						// 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 );
+
+						if ( $option_values[$j] == $allowed_options || @in_array( $allowed_options, $value ) ) {
+							$selected = ' checked="checked"';
+							break;
+						}
+					}
+
+					// 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) {
+						$selected = ' checked="checked"';
+					}
+
+					$html .= apply_filters( 'bp_get_the_profile_field_options_checkbox', '<label><input' . $selected . ' type="checkbox" name="field_' . $field->id . '[]" id="field_' . $options[$k]->id . '_' . $k . '" value="' . esc_attr( stripslashes( $options[$k]->name ) ) . '"> ' . esc_attr( stripslashes( $options[$k]->name ) ) . '</label>', $options[$k], $field->id, $selected, $k );
+				}
+				break;
+
+			case 'datebox':
+				$date = BP_XProfile_ProfileData::get_value_byid( $field->id );
+
+				// Set day, month, year defaults
+				$day   = '';
+				$month = '';
+				$year  = '';
+
+				if ( !empty( $date ) ) {
+					// If Unix timestamp
+					if ( is_numeric( $date ) ) {
+						$day   = date( 'j', $date );
+						$month = date( 'F', $date );
+						$year  = date( 'Y', $date );
+
+					// If MySQL timestamp
+					} else {
+						$day   = mysql2date( 'j', $date );
+						$month = mysql2date( 'F', $date, false ); // Not localized, so that selected() works below
+						$year  = mysql2date( 'Y', $date );
+					}
+				}
+
+				// Check for updated posted values, but errors preventing them from being saved first time
+				if ( !empty( $_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'] )
+						$month = $_POST['field_' . $field->id . '_month'];
+				}
+
+				if ( !empty( $_POST['field_' . $field->id . '_year'] ) ) {
+					if ( $year != date( "j", $_POST['field_' . $field->id . '_year'] ) )
+						$year = $_POST['field_' . $field->id . '_year'];
+				}
+
+				switch ( $type ) {
+					case 'day':
+						$html .= '<option value=""' . selected( $day, '', false ) . '>--</option>';
+
+						for ( $i = 1; $i < 32; ++$i ) {
+							$html .= '<option value="' . $i .'"' . selected( $day, $i, false ) . '>' . $i . '</option>';
+						}
+						break;
+
+					case 'month':
+						$eng_months = array( 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December' );
+
+						$months = array(
+							__( 'January', 'buddypress' ),
+							__( 'February', 'buddypress' ),
+							__( 'March', 'buddypress' ),
+							__( 'April', 'buddypress' ),
+							__( 'May', 'buddypress' ),
+							__( 'June', 'buddypress' ),
+							__( 'July', 'buddypress' ),
+							__( 'August', 'buddypress' ),
+							__( 'September', 'buddypress' ),
+							__( 'October', 'buddypress' ),
+							__( 'November', 'buddypress' ),
+							__( 'December', 'buddypress' )
+						);
+
+						$html .= '<option value=""' . selected( $month, '', false ) . '>------</option>';
+
+						for ( $i = 0; $i < 12; ++$i ) {
+							$html .= '<option value="' . $eng_months[$i] . '"' . selected( $month, $eng_months[$i], false ) . '>' . $months[$i] . '</option>';
+						}
+						break;
+
+					case 'year':
+						$html .= '<option value=""' . selected( $year, '', false ) . '>----</option>';
+
+						for ( $i = 2037; $i > 1901; $i-- ) {
+							$html .= '<option value="' . $i .'"' . selected( $year, $i, false ) . '>' . $i . '</option>';
+						}
+						break;
+				}
+
+				$html = apply_filters( 'bp_get_the_profile_field_datebox', $html, $type, $day, $month, $year, $field->id, $date );
+
+				break;
+		}
+
+		return $html;
+	}
+
+function bp_the_profile_field_is_required() {
+	echo bp_get_the_profile_field_is_required();
+}
+	function bp_get_the_profile_field_is_required() {
+		global $field;
+
+		// Define locale variable(s)
+		$retval = false;
+
+		// Super admins can skip required check
+		if ( is_super_admin() && !is_admin() )
+			$retval = false;
+
+		// All other users will use the field's setting
+		elseif ( isset( $field->is_required ) )
+			$retval = $field->is_required;
+
+		return apply_filters( 'bp_get_the_profile_field_is_required', (bool) $retval );
+	}
+
+function bp_unserialize_profile_field( $value ) {
+	if ( is_serialized($value) ) {
+		$field_value = maybe_unserialize($value);
+		$field_value = implode( ', ', $field_value );
+		return $field_value;
+	}
+
+	return $value;
+}
+
+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
+		);
+
+		$r = wp_parse_args( $args, $defaults );
+		extract( $r, EXTR_SKIP );
+
+		return apply_filters( 'bp_get_profile_field_data', xprofile_get_field_data( $field, $user_id ) );
+	}
+
+function bp_profile_group_tabs() {
+	global $bp, $group_name;
+
+	if ( !$groups = wp_cache_get( 'xprofile_groups_inc_empty', 'bp' ) ) {
+		$groups = BP_XProfile_Group::get( array( 'fetch_fields' => true ) );
+		wp_cache_set( 'xprofile_groups_inc_empty', $groups, 'bp' );
+	}
+
+	if ( empty( $group_name ) )
+		$group_name = bp_profile_group_name(false);
+
+	$tabs = array();
+	for ( $i = 0, $count = count( $groups ); $i < $count; ++$i ) {
+		if ( $group_name == $groups[$i]->name )
+			$selected = ' class="current"';
+		else
+			$selected = '';
+
+		if ( !empty( $groups[$i]->fields ) ) {
+			$link = $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 ) );
+		}
+	}
+
+	$tabs = apply_filters( 'xprofile_filter_profile_group_tabs', $tabs, $groups, $group_name );
+	foreach ( (array) $tabs as $tab )
+		echo $tab;
+
+	do_action( 'xprofile_profile_group_tabs' );
+}
+
+function bp_profile_group_name( $deprecated = true ) {
+	if ( !$deprecated ) {
+		return bp_get_profile_group_name();
+	} else {
+		echo bp_get_profile_group_name();
+	}
+}
+	function bp_get_profile_group_name() {
+		if ( !$group_id = bp_action_variable( 1 ) )
+			$group_id = 1;
+
+		if ( !is_numeric( $group_id ) )
+			$group_id = 1;
+
+		if ( !$group = wp_cache_get( 'xprofile_group_' . $group_id, 'bp' ) ) {
+			$group = new BP_XProfile_Group($group_id);
+			wp_cache_set( 'xprofile_group_' . $group_id, $group, 'bp' );
+		}
+
+		return apply_filters( 'bp_get_profile_group_name', $group->name );
+	}
+
+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/' );
+	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();
+
+	if ( !$last_updated ) {
+		_e( 'Profile not recently updated', 'buddypress' ) . '.';
+	} else {
+		echo $last_updated;
+	}
+}
+	function bp_get_profile_last_updated() {
+		global $bp;
+
+		$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 ) ) ) );
+
+		return false;
+	}
+
+function bp_current_profile_group_id() {
+	echo bp_get_current_profile_group_id();
+}
+	function bp_get_current_profile_group_id() {
+		if ( !$profile_group_id = bp_action_variable( 1 ) )
+			$profile_group_id = 1;
+
+		return apply_filters( 'bp_get_current_profile_group_id', $profile_group_id ); // admin/profile/edit/[group-id]
+	}
+
+function bp_avatar_delete_link() {
+	echo bp_get_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' ) );
+	}
+
+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;
+
+	bp_button( array (
+		'id'                => 'edit_profile',
+		'component'         => 'xprofile',
+		'must_be_logged_in' => true,
+		'block_self'        => true,
+		'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
diff --git a/wp-content/plugins/buddypress/favicon.ico b/wp-content/plugins/buddypress/favicon.ico
index 3f5eadcbc5c7bc36eead0f6eb6be212e9445aac5..056d2de41f95c2a91886e2aee286db7f0e656046 100644
Binary files a/wp-content/plugins/buddypress/favicon.ico and b/wp-content/plugins/buddypress/favicon.ico differ
diff --git a/wp-content/plugins/buddypress/humans.txt b/wp-content/plugins/buddypress/humans.txt
new file mode 100644
index 0000000000000000000000000000000000000000..390b2a2be46a1fbec4a77b954732aa5f66b23802
--- /dev/null
+++ b/wp-content/plugins/buddypress/humans.txt
@@ -0,0 +1,54 @@
+               .$$$$$$$Z$.
+          .~$$7...........$$$.
+        .$$...?$$$$$$$$$$Z....$Z.
+      .Z$..Z$$$$$$$$$$$$$$$$Z:..$$.
+     ,$..$$$$$$$$$$$$$7...$$$$$?..$.
+   .$Z .$$$$$$$$$$..?$$.....$$$$$..Z:
+  .$$.$$$$$$$$$........$$....Z$$$$..Z,
+  :$.7$$$$$$$$..........$$....$$$$$..$.
+ .$. $$$$$$$$$...........$....$$$$$$..$.
+.$$.$$$$$$$$$$...........$...$$$$$$$$.$.
+.$. $$$$$$$$$$ ..........Z..$$$$$$$$$.$$.
+.$.,$$$$$$$$$$$.........$$$$Z$$$$$$$$..$.
+.Z $$$$$$$$$$$$$$....+$$$$$,,,,~$$$$$..$.
+.$.=$$$$$$Z,,,,,?$$$$$,,,,,Z$,,,,$$$$..$.
+.$..$$$$$$,,,,,,,,Z$$,,,,,,,,$:,,~$$$.:$.
+.$$.$$$$$,,,,,,,,,,,,,,,,,,,,:$,,:$$$.Z.
+ .$..$$$$,,,,,,,,,,,,,,,,,,,,:$,,,$$..$.
+ .$$.$$$:,,,,,,,,,,,,,,,,,,,,,Z$$$$+.$.
+  .$= $$~,,,,,,:::,:,,:,,::,:,$$$$Z.$Z.
+   .$+.$$$$$$$$$$$$$$$$$$$$$$$$$$:.$$.
+    .$$..Z$$$$$$$$$$$$$$$$$$$$$Z..$7.
+      .$...$$$$$$$$$$$$$$$$$$$..Z$.
+        .Z$=..?Z$$$$$$$$$$$Z...$$.
+          .$$7.............Z$$.
+             .7Z$$$$$$$$$$~
+
+   We are the humans behind BuddyPress
+
+/* TEAM */
+Name: Andy Peatling
+Title: Founding Developer
+Twitter: apeatling
+
+Name: John James Jacoby
+Title: Lead Developer
+Twitter: johnjamesjacoby
+Favorite Food: Pizza
+
+Name: Boone B. Gorges
+Title: Developer
+Twitter: boone
+Favorite Pudgy Pie Filling: Cherry
+
+Name: Paul Gibbs
+Title: Developer
+Twitter: pgibbs
+Favourite Food: Pizza
+
+/* THANKS */
+r-a-y, hnla, mercime, modemlooper, cnorris23
+
+/* META */
+Updated: 2011/08/29
+See: http://humanstxt.org/
\ No newline at end of file
diff --git a/wp-content/plugins/buddypress/license.txt b/wp-content/plugins/buddypress/license.txt
index 18d6a6afd3bd22fbcbf31631634a392aefdc1717..b5fcfa6e7a5343eec02d2d25805773efbdf65121 100644
--- a/wp-content/plugins/buddypress/license.txt
+++ b/wp-content/plugins/buddypress/license.txt
@@ -1,281 +1,280 @@
-		    GNU GENERAL PUBLIC LICENSE
-		       Version 2, June 1991
-
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.
- 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, 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 cdbc3ed4d1bf056e9d2f06f954e6ca3a2c60c6cf..723676f92cd69d98de3e71cb92739fa1a11124d6 100644
--- a/wp-content/plugins/buddypress/readme.txt
+++ b/wp-content/plugins/buddypress/readme.txt
@@ -1,130 +1,117 @@
-=== Plugin Name ===
-Contributors: apeatling, johnjamesjacoby, MrMaz, DJPaul, boonebgorges
-Tags: buddypress, social networking, activity, profiles, messaging, friends, groups, forums, microblogging, twitter, facebook, mingle, social, community, networks, networking, cms
-Requires at least: 3.1
-Tested up to: 3.1
-Stable tag: 1.2.8
-
-== 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.
-
-BuddyPress will let users register on your site and start creating profiles, posting messages, making connections, creating and interacting in groups and much more.
-
-<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 WordPress with BuddyPress powered sites are popping up. You can take a look at some of the best sites on the <a href="http://buddypress.org/demo/">BuddyPress demo page</a> or the <a href="http://wordpress.org/showcase/flavor/buddypress/">BuddyPress section of the WordPress showcase</a>.
-
-<h4>Plugins: Adding So Much More</h4>
-
-BuddyPress boasts an ever growing array of new features developed by the awesome plugin development community. Some of most popular BuddyPress plugins currently available are:
-
-*	<a href="http://wordpress.org/extend/plugins/buddypress-like">BuddyPress Like</a> - add a "like" button to site activity.
-*	<a href="http://wordpress.org/extend/plugins/buddypress-links">BuddyPress Links</a> - rich media embedding for your BuddyPress powered site.
-*	<a href="http://wordpress.org/extend/plugins/buddystream/">BuddyStream</a> - synchronizes all of your favorite social networks to the BuddyPress activity stream.
-*	<a href="http://wordpress.org/extend/plugins/bp-album">BuddyPress Album+</a> - allow your users to upload photos and create albums.
-*	<a href="http://wordpress.org/extend/plugins/buddypress-group-documents">BuddyPress Group Documents</a> - add file upload and document repositories to your groups.
-*	<a href="http://wordpress.org/extend/plugins/bp-profile-privacy">BuddyPress Profile Privacy</a> - allow your users to set privacy options on their profile data.
-*	<a href="http://wordpress.org/extend/plugins/welcome-pack">BuddyPress Welcome Pack</a> - set defaults for new users, auto join them to groups or send welcome messages.
-*	<a href="http://wordpress.org/extend/plugins/bp-groupblog">BuddyPress Group Blog</a> (WordPress MU only) - allow your groups to include a fully functional WordPress blog.
-*	<a href="http://wordpress.org/extend/plugins/bp-wiki/">BuddyPress Wiki Component</a> - adds wiki functionality.
-
-There are more than 300 BuddyPress plugins available, the list is growing every day. For a full list of plugins, please visit the <a href="http://buddypress.org/extend/plugins/">BuddyPress.org plugins page</a>. You can also install any of these plugins automatically through the plugin installer menu inside of your WordPress installation.
-
-<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 will need to enable permalink support in your WordPress installation for BuddyPress pages to function correctly. You can set this up using the "Settings > Permalinks" menu in your WordPress admin area.
-
-Finally, you will need to activate a BuddyPress compatible theme. Two BuddyPress themes are bundled with the plugin, you can activate these using the "Appearance > Themes" menu in your WordPress admin area. To install other BuddyPress compatible themes, use the "Appearance > Add New Themes" menu and select the "buddypress" checkbox before hitting the "Find Themes" button.
-
---- Forums Support ---
-
-BuddyPress also includes support for discussion forums. Each group created on your site can have its own discussion forum. If you'd like to enable this feature please use the "BuddyPress > Forums Setup" menu in your WordPress admin area and follow the on screen instructions.
-
-== Frequently Asked Questions ==
-
-= Can I use my existing WordPress theme? =
-
-Of course! First install and activate BuddyPress, then download and activate the <a href="http://wordpress.org/extend/plugins/bp-template-pack/">template extension pack</a>. This plugin will run you through the process step-by-step.
-
-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 the BuddyPress features both seamlessly and beautifully. It's also really easy to modify with custom header support, widget support and via a <a href="http://codex.buddypress.org/how-to-guides/building-a-buddypress-child-theme/">child theme</a>.
-
-= Will this work on standard WordPress and WordPress MU? =
-
-Yes! BuddyPress will run on both versions of WordPress. If you are using WordPress MU then BuddyPress will support the global tracking of blogs, posts and comments.
-
-= Where can I get support? =
-
-The support forums can be found here: http://buddypress.org/forums/
-
-= Where can I find documentation? =
-
-The documentation codex can be found here: http://codex.buddypress.org/
-
-= Where can I report a bug? =
-
-Bugs can be reported here: http://trac.buddypress.org/newticket/
-
-= Where can checkout the latest bleeding edge? =
-
-BuddyPress subversion trunk can be found at: http://svn.buddypress.org/trunk/
-
-== Screenshots ==
-
-1. **Activity Streams** - Global, personal and group activity streams with threaded commenting, direct posting, favoriting and @mentions. All with full RSS feed 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** - Start a blog built on the best blogging software in the world. Even allow each of your users to start their own full powered WordPress blog (with WordPress MU). Track new posts and comments across your site.
-
-== Languages ==
-
-BuddyPress is available in more than 20 languages. For more information about BuddyPress in your language please select a language site from the list below. Is your language missing? Please send a message to the <a href="http://lists.automattic.com/mailman/listinfo/wp-polyglots">WP-Polygots</a> mailing list and request for your language to be set up.
-
-*	<a href="http://br.buddypress.org/">Brasil</a>
-*	<a href="http://ca.buddypress.org/">Català</a>
-*	<a href="http://de.buddypress.org/">Deutsch</a>
-*	<a href="http://es.buddypress.org/">Español</a>
-*	<a href="http://fr.buddypress.org/">Français</a>
-*	<a href="http://id.buddypress.org/">Indonesia</a>
-*	<a href="http://it.buddypress.org/">Italia</a>
-*	<a href="http://lv.buddypress.org/">Latviešu valodā</a>
-*	<a href="http://nl.buddypress.org/">Nederland</a>
-*	<a href="http://pl.buddypress.org/">Polska</a>
-*	<a href="http://pt.buddypress.org/">Portugal</a>
-*	<a href="http://ru.buddypress.org/">Русский</a>
-*	<a href="http://fi.buddypress.org/">Suomi</a>
-*	<a href="http://th.buddypress.org/">Thai</a>
-*	<a href="http://uk.buddypress.org/">Україна</a>
-*	<a href="http://ja.buddypress.org/">日本語</a>
-*	<a href="http://cn.buddypress.org/">简体中文</a>
-*	<a href="http://ko.buddypress.org/">한국어</a>
-*	<a href="http://tw.buddypress.org/">正體中文</a>
-
-The <a href="http://i18n.svn.buddypress.org/">BuddyPress language file repository</a> includes some language that have not yet set up a localization site.
-
-== Upgrade Notice ==
-
-= 1.2.8 =
-Compatibility with WordPress 3.1
-
-== Changelog ==
-
-See http://buddypress.org/about/release-history/ for a list of changes.
-
+=== 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.
diff --git a/wp-content/plugins/buddypress/screenshot-1.gif b/wp-content/plugins/buddypress/screenshot-1.gif
index 79f178d37a80a3687bbcf4fb9e7584a2927d8ac2..cd4f07b7e4595d9f09201ea28b67bbc6ba28ae2d 100644
Binary files a/wp-content/plugins/buddypress/screenshot-1.gif and b/wp-content/plugins/buddypress/screenshot-1.gif differ
diff --git a/wp-content/plugins/buddypress/screenshot-2.gif b/wp-content/plugins/buddypress/screenshot-2.gif
index c50923288c72e389d549754e86bd31384259583b..957ba146bdd7314ec36de447910356841a583efb 100644
Binary files a/wp-content/plugins/buddypress/screenshot-2.gif and b/wp-content/plugins/buddypress/screenshot-2.gif differ
diff --git a/wp-content/plugins/buddypress/screenshot-3.gif b/wp-content/plugins/buddypress/screenshot-3.gif
index 63bdbff95975784cb073dc0936ff217703e44119..683267d718b7a354ba021eb82b57aba6d762a73f 100644
Binary files a/wp-content/plugins/buddypress/screenshot-3.gif and b/wp-content/plugins/buddypress/screenshot-3.gif differ
diff --git a/wp-content/plugins/buddypress/screenshot-4.gif b/wp-content/plugins/buddypress/screenshot-4.gif
index d63126f9de04a3847eba8eb274d221cbd9ca95c0..c42946cfa55c8e1952b2a58791d04d019f1686c8 100644
Binary files a/wp-content/plugins/buddypress/screenshot-4.gif and b/wp-content/plugins/buddypress/screenshot-4.gif differ
diff --git a/wp-content/plugins/buddypress/screenshot-5.gif b/wp-content/plugins/buddypress/screenshot-5.gif
index ff8ff65dd1d9716df1cff602b5768571b834c858..c8ecbab192b9e6fc57cc77d6ebb877393f092cb1 100644
Binary files a/wp-content/plugins/buddypress/screenshot-5.gif and b/wp-content/plugins/buddypress/screenshot-5.gif differ
diff --git a/wp-content/plugins/buddypress/screenshot-6.gif b/wp-content/plugins/buddypress/screenshot-6.gif
index 45dce03f06bfef3a2596f96833a26265062506b4..d96b62b1a93a8c4c03116ebdf01396de842caf63 100644
Binary files a/wp-content/plugins/buddypress/screenshot-6.gif and b/wp-content/plugins/buddypress/screenshot-6.gif differ
diff --git a/wp-content/plugins/buddypress/screenshot-7.gif b/wp-content/plugins/buddypress/screenshot-7.gif
index 2410089858343790f0ec499db91f1d29d82e2931..d251ad40c4ecb1d61ee2346075e5f887af83529a 100644
Binary files a/wp-content/plugins/buddypress/screenshot-7.gif and b/wp-content/plugins/buddypress/screenshot-7.gif differ
diff --git a/wp-content/plugins/buddypress/screenshot-8.gif b/wp-content/plugins/buddypress/screenshot-8.gif
new file mode 100644
index 0000000000000000000000000000000000000000..ed1cda236416f6d4a812fd36680a581b247e7f22
Binary files /dev/null and b/wp-content/plugins/buddypress/screenshot-8.gif differ