Index: bp-activity/bp-activity-templatetags.php
--- bp-activity/bp-activity-templatetags.php Base (BASE)
+++ bp-activity/bp-activity-templatetags.php Locally Modified (Based On LOCAL)
@@ -921,9 +921,25 @@
 	function bp_get_send_public_message_link() {
 		global $bp;
 
-		return apply_filters( 'bp_get_send_public_message_link', $bp->loggedin_user->domain . $bp->activity->slug . '/?r=' . bp_core_get_username( $bp->displayed_user->user_id, $bp->displayed_user->userdata->user_nicename, $bp->displayed_user->userdata->user_login ) );
+		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->activity->slug . '/?r=' . bp_core_get_username( $bp->displayed_user->user_id, $bp->displayed_user->userdata->user_nicename, $bp->displayed_user->userdata->user_login ) ) );
 	}
 
+function bp_send_public_message_button() {
+	bp_button( 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'        => __( 'Mention this user in a new public message, this will send the user a notification to get their attention.', 'buddypress' ),
+		'link_text'         => __( 'Mention this User', 'buddypress' )
+	) );
+}
+
\ No newline at end of file
 function bp_activity_post_form_action() {
 	echo bp_get_activity_post_form_action();
 }
Index: bp-blogs/bp-blogs-templatetags.php
--- bp-blogs/bp-blogs-templatetags.php Base (BASE)
+++ bp-blogs/bp-blogs-templatetags.php Locally Modified (Based On LOCAL)
@@ -504,4 +504,25 @@
 <?php
 }
 
+/**
+ * bp_blogs_visit_blog_button()
+ *
+ * Button for visiting a blog in a loop
+ */
+function bp_blogs_visit_blog_button() {
+	bp_button( 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'        => 'visit',
+		'link_text'         => __( 'Visit Blog', 'buddypress' ),
+		'link_title'        => __( 'Visit Blog', 'buddypress' ),
+	) );
+}
+
 ?>
Index: bp-core/bp-core-classes.php
--- bp-core/bp-core-classes.php Base (BASE)
+++ bp-core/bp-core-classes.php Locally Modified (Based On LOCAL)
@@ -495,5 +495,158 @@
 	}
 }
 
+/**
+ * BP_Button
+ *
+ * API to create BuddyPress buttons
+ *
+ * @package BuddyPress Core
+ * @since 1.2.6
+ */
+class BP_Button {
 
+	// Button properties
+	var $id;
+	var $component;
+	var $must_be_logged_in;
+	var $block_self;
+
+	// Wrapper div
+	var $wrapper_class;
+	var $wrapper_id;
+
+	// Button
+	var $link_href;
+	var $link_class;
+	var $link_id;
+	var $link_rel;
+	var $link_title;
+	var $link_text;
+
+	// HTML result
+	var $contents;
+
+	/**
+	 * bp_button()
+	 *
+	 * Builds the button based on passed parameters:
+	 *
+	 * 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_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 $args
+	 * @return bool False if not allowed
+	 */
+	function bp_button( $args = '' ) {
+
+		$defaults = array(
+			'id'                => '',
+			'component'         => 'core',
+			'must_be_logged_in' => true,
+			'block_self'        => true,
+
+			'wrapper_id'        => '',
+			'wrapper_class'     => '',
+
+			'link_href'         => '',
+			'link_title'        => '',
+			'link_id'           => '',
+			'link_class'        => '',
+			'link_rel'          => '',
+			'link_text'         => '',
+		);
+
+		$r = wp_parse_args( $args, $defaults );
+		extract( $r, EXTR_SKIP );
+
+		// Required button properties
+		$this->id                = $id;
+		$this->component         = $component;
+		$this->must_be_logged_in = (bool)$must_be_logged_in;
+		$this->block_self        = (bool)$block_self;
+
+		// $id and $component are required
+		if ( empty( $id ) || empty( $component ) )
+			return false;
+
+		// No button if component is not active
+		if ( !bp_is_active( $this->component ) )
+			return false;
+
+		// No button for guests if must be logged in
+		if ( true == $this->must_be_logged_in && !is_user_logged_in )
+			return false;
+
+		// No button if viewing your own profile
+		if ( true == $this->block_self && bp_is_my_profile() )
+			return false;
+
+		// Wrapper properties
+		if ( !empty( $wrapper_id ) )
+			$this->wrapper_id    = ' id="' . $wrapper_id . '"';
+
+		if ( !empty( $wrapper_class ) )
+			$this->wrapper_class = ' class="generic-button ' . $wrapper_class . '"';
+		else
+			$this->wrapper_class = ' class="generic-button"';
+
+		// Link properties
+		if ( !empty( $link_id ) )
+			$this->link_id       = ' id="' . $link_id . '"';
+
+		if ( !empty( $link_href ) )
+			$this->link_href     = ' href="' . $link_href . '"';
+
+		if ( !empty( $link_title ) )
+			$this->link_title    = ' title="' . $link_title . '"';
+
+		if ( !empty( $link_rel ) )
+			$this->link_rel      = ' rel="' . $link_rel . '"';
+
+		if ( !empty( $link_class ) )
+			$this->link_class    = ' class="' . $link_class . '"';
+
+		if ( !empty( $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>';
+
+		// Allow button to be manipulated externally
+		$this->contents = apply_filters( 'bp_button_' . $component . '_' . $id, $this->contents, $this );
+	}
+
+	/**
+	 * contents()
+	 *
+	 * Return contents of button
+	 *
+	 * @return string
+	 */
+	function contents() {
+		return $this->contents;
+	}
+
+	/**
+	 * display()
+	 *
+	 * Output contents of button
+	 */
+	function display() {
+		if ( !empty( $this->contents ) )
+			echo $this->contents;
+	}
+}
+
 ?>
Index: bp-core/bp-core-templatetags.php
--- bp-core/bp-core-templatetags.php Base (BASE)
+++ bp-core/bp-core-templatetags.php Locally Modified (Based On LOCAL)
@@ -417,33 +417,6 @@
 		return apply_filters( 'bp_member_last_active', $registered );
 	}
 
-function bp_member_add_friend_button() {
-	global $members_template;
-
-	if ( function_exists( 'bp_add_friend_button' ) ) {
-		if ( null === $members_template->member->is_friend )
-			$friend_status = 'not_friends';
-		else
-			$friend_status = ( 0 == $members_template->member->is_friend ) ? 'pending' : 'is_friend';
-
-		echo bp_add_friend_button( $members_template->member->id, $friend_status );
-	}
-}
-
-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 ) );
-	}
-
 function bp_member_random_profile_data() {
 	global $members_template;
 
@@ -1099,6 +1072,31 @@
 }
 
 /**
+ * bp_button( $button )
+ *
+ * Creates and outputs a button.
+ * Args: div_id | div_class | a_href | a_title | a_id | a_class | a_rel | a_text
+ *
+ * @param array $button
+ */
+function bp_button( $button = '' ) {
+	echo bp_get_button( $button );
+}
+	/**
+	 * bp_get_button( $button )
+	 *
+	 * Creates and returns a button.
+	 * Args: div_id | div_class | a_href | a_title | a_id | a_class | a_rel | a_text
+	 *
+	 * @param array $button
+	 * @return string
+	 */
+	function bp_get_button( $button = '' ) {
+		$btn = new BP_Button( $button );
+		return apply_filters( 'bp_get_button', $btn->contents, $button );
+	}
+
+/**
\ No newline at end of file
  * bp_create_excerpt()
  *
  * Fakes an excerpt on any content. Will not truncate words.
Index: bp-core/bp-core-widgets.php
--- bp-core/bp-core-widgets.php Base (BASE)
+++ bp-core/bp-core-widgets.php Locally Modified (Based On LOCAL)
@@ -21,7 +21,7 @@
 	function widget($args, $instance) {
 		global $bp;
 
-	    extract( $args );
+		extract( $args );
 
 		echo $before_widget;
 		echo $before_title
@@ -31,9 +31,15 @@
 		<?php if ( bp_has_members( 'user_id=0&type=newest&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_MEMBERS_SLUG ?>" id="popular-members"><?php _e( 'Popular', 'buddypress' ) ?></a>
+				<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>
+
+				<?php if ( bp_is_active( 'friends' ) ) : ?>
+
+					| <a href="<?php echo site_url() . '/' . BP_MEMBERS_SLUG ?>" id="popular-members"><?php _e( 'Popular', 'buddypress' ) ?></a>
+
+				<?php endif; ?>
+
 			</div>
 
 			<ul id="members-list" class="item-list">
@@ -147,7 +153,7 @@
 	function widget($args, $instance) {
 		global $bp;
 
-	    extract( $args );
+		extract( $args );
 
 		echo $before_widget;
 		echo $before_title
@@ -201,13 +207,19 @@
 	switch ( $_POST['filter'] ) {
 		case 'newest-members':
 			$type = 'newest';
-		break;
+			break;
+
 		case 'recently-active-members':
 			$type = 'active';
-		break;
+			break;
+
 		case 'popular-members':
-			$type = 'popular';
-		break;
+			if ( bp_is_active( 'friends' ) )
+				$type = 'popular';
+			else
+				$type = 'active';
+
+			break;
 	}
 
 	if ( bp_has_members( 'user_id=0&type=' . $type . '&per_page=' . $_POST['max-members'] . '&max=' . $_POST['max-members'] . '&populate_extras=0' ) ) : ?>
@@ -223,7 +235,7 @@
 						<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 ) : ?>
 							<div class="item-meta"><span class="activity"><?php bp_member_last_active() ?></span></div>
-						<?php else : ?>
\ No newline at end of file
+						<?php elseif ( bp_is_active( 'friends' ) ) : ?>
\ No newline at end of file
 							<div class="item-meta"><span class="activity"><?php bp_member_total_friend_count() ?></span></div>
 						<?php endif; ?>
 					</div>
Index: bp-friends/bp-friends-templatetags.php
--- bp-friends/bp-friends-templatetags.php Base (BASE)
+++ bp-friends/bp-friends-templatetags.php Locally Modified (Based On LOCAL)
@@ -104,48 +104,170 @@
 	?>
 		<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 ?> />
+			<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 ) ?>" />
+			<?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 ( function_exists( 'bp_add_friend_button' ) ) {
+		if ( null === $members_template->member->is_friend )
+			$friend_status = 'not_friends';
+		else
+			$friend_status = ( 0 == $members_template->member->is_friend ) ? 'pending' : 'is_friend';
+
+		echo bp_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 = false, $friend_status = false ) {
 	echo bp_get_add_friend_button( $potential_friend_id, $friend_status );
 }
 	function bp_get_add_friend_button( $potential_friend_id = false, $friend_status = false ) {
 		global $bp, $friends_template;
 
-		if ( !is_user_logged_in() )
-			return false;
+		if ( empty( $potential_friend_id ) )
+			$potential_friend_id = bp_get_potential_friend_id( $potential_friend_id );
 
-		if ( !$potential_friend_id && $friends_template->friendship->friend )
-			$potential_friend_id = $friends_template->friendship->friend->id;
-		else if ( !$potential_friend_id && !$friends_template->friendship->friend )
-			$potential_friend_id = $bp->displayed_user->id;
+		$is_friend = bp_is_friend( $potential_friend_id );
 
-		if ( $bp->loggedin_user->id == $potential_friend_id )
+		if ( empty( $is_friend ) )
 			return false;
 
-		if ( empty( $friend_status ) )
-			$friend_status = friends_check_friendship_status( $bp->loggedin_user->id, $potential_friend_id );
+		switch ( $is_friend ) {
+			case 'pending' :
+				$btn = 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_class'        => 'requested',
+					'link_href'         => trailingslashit( $bp->loggedin_user->domain . $bp->friends->slug ),
+					'link_text'         => __( 'Friendship Requested', 'buddypress' ),
+					'link_title'        => __( 'Friendship Requested', 'buddypress' )
+				);
+				break;
 
-		$button = '<div class="generic-button friendship-button ' . $friend_status . '" id="friendship-button-' . $potential_friend_id . '">';
+			case 'is_friend' :
+				$btn = array(
+					'id'                => 'is_friend',
+					'component'         => 'friends',
+					'must_be_logged_in' => true,
+					'block_self'        => true,
+					'wrapper_class'     => 'friendship-button is_friend',
+					'wrapper_id'        => 'friendship-button-' . $potential_friend_id,
+					'link_class'        => '',
+					'link_href'         => wp_nonce_url( $bp->loggedin_user->domain . $bp->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'        => 'remove'
+				);
+				break;
 
-		if ( 'pending' == $friend_status )
-			$button .= '<a class="requested" href="' . $bp->loggedin_user->domain . $bp->friends->slug . '/">' . __( 'Friendship Requested', 'buddypress' ) . '</a>';
-		else if ( 'is_friend' == $friend_status )
-			$button .= '<a href="' . wp_nonce_url( $bp->loggedin_user->domain . $bp->friends->slug . '/remove-friend/' . $potential_friend_id . '/', 'friends_remove_friend' ) . '" title="' . __('Cancel Friendship', 'buddypress') . '" id="friend-' . $potential_friend_id . '" rel="remove" class="remove">' . __('Cancel Friendship', 'buddypress') . '</a>';
-		else
-			$button .= '<a href="' . wp_nonce_url( $bp->loggedin_user->domain . $bp->friends->slug . '/add-friend/' . $potential_friend_id . '/', 'friends_add_friend' ) . '" title="' . __('Add Friend', 'buddypress') . '" id="friend-' . $potential_friend_id . '" rel="add" class="add">' . __('Add Friend', 'buddypress') . '</a>';
+			default:
+				$btn = 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_class'        => '',
+					'link_href'         => wp_nonce_url( $bp->loggedin_user->domain . $bp->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'        => 'add'
+				);
+				break;
+		}
 
-		$button .= '</div>';
+		$button = new BP_Button( $btn );
 
-		return apply_filters( 'bp_get_add_friend_button', $button, $potential_friend_id, $friend_status );
+		return apply_filters( 'bp_get_add_friend_button', $button->contents, $potential_friend_id, $friend_status );
 	}
 
 function bp_get_friend_ids( $user_id = false ) {
@@ -181,6 +303,137 @@
 		return apply_filters( 'bp_get_friend_friendship_id', $friendship_id );
 	}
 
+function bp_friend_request_link() {
+	echo bp_get_friend_request_link();
+}
+	function bp_get_friend_request_link() {
+		global $bp;
+
+		$friend_id = bp_get_potential_friend_id();
+		$is_friend = bp_is_friend();
+
+		if ( empty( $is_friend ) )
+			return false;
+
+		switch ( $is_friend ) {
+			case 'pending' :
+				$link = $bp->loggedin_user->domain . $bp->friends->slug;
+				break;
+			case 'is_friend' :
+				$link = wp_nonce_url( $bp->loggedin_user->domain . $bp->friends->slug . '/remove-friend/' . $friend_id . '/', 'friends_remove_friend' );
+				break;
+			default:
+				$link = wp_nonce_url( $bp->loggedin_user->domain . $bp->friends->slug . '/add-friend/' . $friend_id . '/', 'friends_add_friend' );
+				break;
+		}
+
+		return apply_filters( 'bp_get_friend_request_link', $link, $friend_id, $is_friend );
+	}
+
+function bp_friend_request_id() {
+	echo bp_get_friend_request_id();
+}
+	function bp_get_friend_request_id() {
+
+		$friend_id = bp_get_potential_friend_id();
+		$is_friend = bp_is_friend();
+
+		if ( empty( $is_friend ) )
+			return false;
+
+		switch ( $is_friend ) {
+			case 'pending' :
+				$id = '';
+				break;
+			case 'is_friend' :
+				$id = 'friend-' . $friend_id;
+				break;
+			default:
+				$id = 'friend-' . $friend_id;
+				break;
+		}
+
+		return apply_filters( 'bp_get_friend_request_id', $id, $friend_id, $is_friend );
+	}
+
+function bp_friend_request_rel() {
+	echo bp_get_friend_request_rel();
+}
+	function bp_get_friend_request_rel() {
+
+		$friend_id = bp_get_potential_friend_id();
+		$is_friend = bp_is_friend();
+
+		if ( empty( $is_friend ) )
+			return false;
+
+		switch ( $is_friend ) {
+			case 'pending' :
+				$rel = '';
+				break;
+			case 'is_friend' :
+				$rel = 'remove';
+				break;
+			default:
+				$rel = 'add';
+				break;
+		}
+
+		return apply_filters( 'bp_get_friend_request_rel', $rel, $friend_id, $is_friend );
+	}
+
+function bp_friend_request_class() {
+	echo bp_get_friend_request_class();
+}
+	function bp_get_friend_request_class() {
+
+		$friend_id = bp_get_potential_friend_id();
+		$is_friend = bp_is_friend();
+
+		if ( empty( $is_friend ) )
+			return false;
+
+		switch ( $is_friend ) {
+			case 'pending' :
+				$class = 'pending';
+				break;
+			case 'is_friend' :
+				$class = 'remove';
+				break;
+			default:
+				$class = 'add';
+				break;
+		}
+
+		return apply_filters( 'bp_get_friend_request_class', $class, $friend_id, $is_friend );
+	}
+
+function bp_friend_request_link_text() {
+	echo bp_get_friend_request_link_text();
+}
+	function bp_get_friend_request_link_text() {
+
+		$friend_id = bp_get_potential_friend_id();
+		$is_friend = bp_is_friend();
+
+		if ( empty( $is_friend ) )
+			return false;
+
+		switch ( $is_friend ) {
+			case 'pending' :
+				$text = __( 'Friendship Requested', 'buddypress' );
+				break;
+			case 'is_friend' :
+				$text = __( 'Cancel Friendship', 'buddypress' );
+				break;
+			default:
+				$text = __( 'Add Friend', 'buddypress' );
+				break;
+		}
+
+		return apply_filters( 'bp_get_friend_request_link_text', $text, $friend_id, $is_friend );
+	}
+
\ No newline at end of file
 function bp_friend_accept_request_link() {
 	echo bp_get_friend_accept_request_link();
 }
Index: bp-groups/bp-groups-templatetags.php
--- bp-groups/bp-groups-templatetags.php Base (BASE)
+++ bp-groups/bp-groups-templatetags.php Locally Modified (Based On LOCAL)
@@ -1095,52 +1095,118 @@
 	return true;
 }
 
+function bp_group_new_topic_button() {
+	if ( bp_is_group_forum() && is_user_logged_in() && !bp_is_group_forum_topic() ) {
+		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'        => '',
+			'link_text'         => __( 'New Topic', 'buddypress' ),
+			'link_title'        => __( 'New Topic', 'buddypress' ),
+		) );
+	}
+}
+
 function bp_group_join_button( $group = false ) {
-	global $bp, $groups_template;
+	echo bp_get_group_join_button();
+}
+	function bp_get_group_join_button( $group = false ) {
+		global $bp, $groups_template;
 
-	if ( !$group )
-		$group =& $groups_template->group;
+		if ( !$group )
+			$group =& $groups_template->group;
 
-	// If they're not logged in or are banned from the group, no join button.
-	if ( !is_user_logged_in() || $group->is_banned )
-		return false;
+		// If they're not logged in or are banned from the group, no join button.
+		if ( !is_user_logged_in() || $group->is_banned )
+			return false;
 
-	if ( !$group->status )
-		return false;
+		if ( !$group->status )
+			return false;
 
-	if ( 'hidden' == $group->status && !$group->is_member )
-		return false;
+		if ( 'hidden' == $group->status && !$group->is_member )
+			return false;
 
-	echo '<div class="generic-button group-button ' . $group->status . '" id="groupbutton-' . $group->id . '">';
+		// Already a member
+		if ( $group->is_member ) {
+			$btn = 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_class'        => 'leave-group',
+				'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' )
+			);
 
-	switch ( $group->status ) {
-		case 'public':
-			if ( $group->is_member )
-				echo '<a class="leave-group" href="' . wp_nonce_url( bp_get_group_permalink( $group ) . 'leave-group', 'groups_leave_group' ) . '">' . __( 'Leave Group', 'buddypress' ) . '</a>';
-			else
-				echo '<a class="join-group" href="' . wp_nonce_url( bp_get_group_permalink( $group ) . 'join', 'groups_join_group' ) . '">' . __( 'Join Group', 'buddypress' ) . '</a>';
-		break;
+		// Not a member
+		} else {
 
-		case 'private':
-			if ( $group->is_member ) {
-				echo '<a class="leave-group" href="' . wp_nonce_url( bp_get_group_permalink( $group ) . 'leave-group', 'groups_leave_group' ) . '">' . __( 'Leave Group', 'buddypress' ) . '</a>';
-			} else {
-				if ( !bp_group_has_requested_membership( $group ) )
-					echo '<a class="request-membership" href="' . wp_nonce_url( bp_get_group_permalink( $group ) . 'request-membership', 'groups_request_membership' ) . '">' . __('Request Membership', 'buddypress') . '</a>';
-				else
-					echo '<a class="membership-requested" href="' . bp_get_group_permalink( $group ) . '">' . __( 'Request Sent', 'buddypress' ) . '</a>';
+			// Show different buttons based on group status
+			switch ( $group->status ) {
+				case 'public':
+					$btn = 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_class'        => 'join-group',
+						'link_href'         => wp_nonce_url( bp_get_group_permalink( $group ) . 'join', 'groups_join_group' ),
+						'link_text'         => __( 'Join Group', 'buddypress' ),
+						'link_title'        => __( 'Join Group', 'buddypress' )
+					);
+					break;
+
+				case 'private' :
+
+					// Member has not requested membership yet
+					if ( !bp_group_has_requested_membership( $group ) ) {
+						$btn = array(
+							'id'                => 'requeste_membership',
+							'component'         => 'groups',
+							'must_be_logged_in' => true,
+							'block_self'        => false,
+							'wrapper_class'     => 'group-button ' . $group->status,
+							'wrapper_id'        => 'groupbutton-' . $group->id,
+							'link_class'        => 'request-membership',
+							'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' ),
+						);
+
+					// Member has requested membership already
+					} else {
+						$btn = array(
+							'id'                => 'membership_requested',
+							'component'         => 'groups',
+							'must_be_logged_in' => true,
+							'block_self'        => false,
+							'wrapper_class'     => 'group-button ' . $group->status,
+							'wrapper_id'        => 'groupbutton-' . $group->id,
+							'link_class'        => 'membership-requested',
+							'link_href'         => bp_get_group_permalink( $group ),
+							'link_text'         => __( 'Request Sent', 'buddypress' ),
+							'link_title'        => __( 'Request Sent', 'buddypress' ),
+						);
+					}
+
+					break;
 			}
-		break;
+		}
 
-		case 'hidden':
-			if ( $group->is_member )
-				echo '<a class="leave-group" href="' . wp_nonce_url( bp_get_group_permalink( $group ) . 'leave-group', 'groups_leave_group' ) . '">' . __( 'Leave Group', 'buddypress' ) . '</a>';
-		break;
+		$button = new BP_Button( $btn );
+
+		return apply_filters( 'bp_group_join_button', $button->contents, $group );
 	}
 
-	echo '</div>';
-}
-
 function bp_group_status_message( $group = false ) {
 	global $groups_template;
 
@@ -1985,17 +2051,32 @@
 }
 
 function bp_group_request_reject_link() {
-	global $requests_template, $groups_template;
-
-	echo apply_filters( 'bp_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' ) );
+	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() {
-	global $requests_template, $groups_template;
+	echo bp_get_group_request_accept_link();
+}
+	function bp_get_group_request_accept_link() {
+		global $requests_template, $groups_template;
 
-	echo apply_filters( 'bp_group_request_accept_link', wp_nonce_url( bp_get_group_permalink( $groups_template->group ) . '/admin/membership-requests/accept/' . $requests_template->request->id, 'groups_accept_membership_request' ) );
+		return apply_filters( 'bp_get_group_request_accept_link', wp_nonce_url( bp_get_group_permalink( $groups_template->group ) . '/admin/membership-requests/accept/' . $requests_template->request->id, 'groups_accept_membership_request' ) );
+	}
+
+function bp_group_request_user_link() {
+	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;
 
@@ -2008,13 +2089,6 @@
 	echo apply_filters( 'bp_group_request_comment', strip_tags( stripslashes( $requests_template->request->comments ) ) );
 }
 
-function bp_group_request_user_link() {
-	global $requests_template;
-
-	echo apply_filters( 'bp_group_request_user_link', bp_core_get_userlink( $requests_template->request->user_id ) );
-}
-
-
\ No newline at end of file
 /************************************************************************************
  * Invite Friends Template Tags
  **/
Index: bp-messages/bp-messages-templatetags.php
--- bp-messages/bp-messages-templatetags.php Base (BASE)
+++ bp-messages/bp-messages-templatetags.php Locally Modified (Based On LOCAL)
@@ -501,19 +501,41 @@
 	function bp_get_send_private_message_link() {
 		global $bp;
 
-		return apply_filters( 'bp_get_send_private_message_link', $bp->loggedin_user->domain . $bp->messages->slug . '/compose/?r=' . bp_core_get_username( $bp->displayed_user->user_id, $bp->displayed_user->userdata->user_nicename, $bp->displayed_user->userdata->user_login ) );
+		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->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() {
-		global $bp;
-
-		if ( bp_is_my_profile() || !is_user_logged_in() )
-			return false;
-
-		return apply_filters( 'bp_get_send_message_button', '<div class="generic-button"><a class="send-message" title="' . __( 'Send Message', 'buddypress' ) . '" href="' . $bp->loggedin_user->domain . $bp->messages->slug . '/compose/?r=' . bp_core_get_username( $bp->displayed_user->user_id, $bp->displayed_user->userdata->user_nicename, $bp->displayed_user->userdata->user_login ) . '">' . __( 'Send Message', 'buddypress' ) . '</a></div>' );
\ No newline at end of file
+		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_class'        => 'send-message',
+				'link_title'        => __( 'Send a private message to this user.', 'buddypress' ),
+				'link_text'         => __( 'Send Private Message', 'buddypress' )
+			) )
+		);
\ No newline at end of file
 	}
 
 function bp_message_loading_image_src() {
Index: bp-themes/bp-default/blogs/blogs-loop.php
--- bp-themes/bp-default/blogs/blogs-loop.php Base (BASE)
+++ bp-themes/bp-default/blogs/blogs-loop.php Locally Modified (Based On LOCAL)
@@ -34,15 +34,13 @@
 			</div>
 
 			<div class="action">
-				<div class="generic-button blog-button visit">
-					<a href="<?php bp_blog_permalink() ?>" class="visit" title="<?php _e( 'Visit Blog', 'buddypress' ) ?>"><?php _e( 'Visit Blog', 'buddypress' ) ?></a>
-				</div>
 
+				<?php do_action( 'bp_directory_blogs_actions' ) ?>
+
 				<div class="meta">
 					<?php bp_blog_latest_post() ?>
 				</div>
 
-				<?php do_action( 'bp_directory_blogs_actions' ) ?>
 			</div>
 
 			<div class="clear"></div>
Index: bp-themes/bp-default/functions.php
--- bp-themes/bp-default/functions.php Base (BASE)
+++ bp-themes/bp-default/functions.php Locally Modified (Based On LOCAL)
@@ -333,4 +333,19 @@
 }
 if ( is_admin() && isset($_GET['activated'] ) && $pagenow == "themes.php" )
 	add_action( 'admin_notices', 'bp_dtheme_show_notice' );
+
+
+// Member Buttons
+add_action( 'bp_member_header_actions',    'bp_add_friend_button' );
+add_action( 'bp_member_header_actions',    'bp_send_public_message_button' );
+add_action( 'bp_member_header_actions',    'bp_send_private_message_button' );
+
+// Group Buttons
+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 Buttons
+add_action( 'bp_directory_blogs_actions',  'bp_blogs_visit_blog_button' );
+
 ?>
Index: bp-themes/bp-default/groups/groups-loop.php
--- bp-themes/bp-default/groups/groups-loop.php Base (BASE)
+++ bp-themes/bp-default/groups/groups-loop.php Locally Modified (Based On LOCAL)
@@ -33,16 +33,19 @@
 				<div class="item-desc"><?php bp_group_description_excerpt() ?></div>
 
 				<?php do_action( 'bp_directory_groups_item' ) ?>
+
 			</div>
 
 			<div class="action">
-				<?php bp_group_join_button() ?>
 
+				<?php do_action( 'bp_directory_groups_actions' ) ?>
+
 				<div class="meta">
+
 					<?php bp_group_type() ?> / <?php bp_group_member_count() ?>
+
 				</div>
 
-				<?php do_action( 'bp_directory_groups_actions' ) ?>
 			</div>
 
 			<div class="clear"></div>
Index: bp-themes/bp-default/groups/single/admin.php
--- bp-themes/bp-default/groups/single/admin.php Base (BASE)
+++ bp-themes/bp-default/groups/single/admin.php Locally Modified (Based On LOCAL)
@@ -116,11 +116,11 @@
 			</p>
 
 			<?php if ( bp_get_group_has_avatar() ) : ?>
+
 				<p><?php _e( "If you'd like to remove the existing avatar but not upload a new one, please use the delete avatar button.", 'buddypress' ) ?></p>
 
-				<div class="generic-button" id="delete-group-avatar-button">
-					<a class="edit" href="<?php bp_group_avatar_delete_link() ?>" title="<?php _e( 'Delete Avatar', 'buddypress' ) ?>"><?php _e( 'Delete Avatar', 'buddypress' ) ?></a>
-				</div>
+				<?php bp_button( array( 'id' => 'delete_group_avatar', 'component' => 'groups', 'wrapper_id' => 'delete-group-avatar-button', 'link_class' => 'edit', 'link_href' => bp_get_group_avatar_delete_link(), 'link_title' => __( 'Delete Avatar', 'buddypress' ), 'link_text' => __( 'Delete Avatar', 'buddypress' ) ) ); ?>
+
 			<?php endif; ?>
 
 			<?php wp_nonce_field( 'bp_avatar_upload' ) ?>
@@ -260,16 +260,10 @@
 
 					<div class="action">
 
-						<div class="generic-button accept">
-							<a href="<?php bp_group_request_accept_link() ?>"><?php _e( 'Accept', 'buddypress' ); ?></a>
-						</div>
+						<?php bp_button( array( 'id' => 'group_membership_accept', 'component' => 'groups', 'wrapper_class' => 'accept', 'link_href' => bp_get_group_request_accept_link(), 'link_title' => __( 'Accept', 'buddypress' ), 'link_text' => __( 'Accept', 'buddypress' ) ) ); ?>
 
-					 &nbsp;
+						<?php bp_button( array( 'id' => 'group_membership_reject', 'component' => 'groups', 'wrapper_class' => 'reject', 'link_href' => bp_get_group_request_reject_link(), 'link_title' => __( 'Reject', 'buddypress' ), 'link_text' => __( 'Reject', 'buddypress' ) ) ); ?>
 
-						<div class="generic-button reject">
-							<a href="<?php bp_group_request_reject_link() ?>"><?php _e( 'Reject', 'buddypress' ); ?></a>
-						</div>
-
 						<?php do_action( 'bp_group_membership_requests_admin_item_action' ); ?>
 
 					</div>
Index: bp-themes/bp-default/groups/single/group-header.php
--- bp-themes/bp-default/groups/single/group-header.php Base (BASE)
+++ bp-themes/bp-default/groups/single/group-header.php Locally Modified (Based On LOCAL)
@@ -35,14 +35,12 @@
 	<div id="item-meta">
 		<?php bp_group_description() ?>
 
-		<?php if ( bp_is_group_forum() && is_user_logged_in() && !bp_is_group_forum_topic() ) : ?>
-			<div class="generic-button group-button">
-				<a href="#post-new" class=""><?php _e( 'New Topic', 'buddypress' ) ?></a>
-			</div>
-		<?php endif; ?>
+		<div id="item-buttons">
 
-		<?php bp_group_join_button() ?>
+			<?php do_action( 'bp_group_header_actions' ); ?>
 
+		</div><!-- #item-buttons -->
+
\ No newline at end of file
 		<?php do_action( 'bp_group_header_meta' ) ?>
 	</div>
 </div><!-- #item-header-content -->
Index: bp-themes/bp-default/members/members-loop.php
--- bp-themes/bp-default/members/members-loop.php Base (BASE)
+++ bp-themes/bp-default/members/members-loop.php Locally Modified (Based On LOCAL)
@@ -29,10 +29,15 @@
 			<div class="item">
 				<div class="item-title">
 					<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>
+
 					<?php endif; ?>
+
 				</div>
+
 				<div class="item-meta"><span class="activity"><?php bp_member_last_active() ?></span></div>
 
 				<?php do_action( 'bp_directory_members_item' ) ?>
@@ -41,7 +46,7 @@
 				 /***
 				  * If you want to show specific profile fields here you can,
 				  * but it'll add an extra query for each member in the loop
-				  * (only one regadless of the number of fields you show):
+				  * (only one regardless of the number of fields you show):
 				  *
 				  * bp_member_profile_data( 'field=the field name' );
 				  */
@@ -49,9 +54,9 @@
 			</div>
 
 			<div class="action">
-				<?php bp_member_add_friend_button() ?>
 
-				<?php do_action( 'bp_directory_members_actions' ) ?>
+				<?php do_action( 'bp_directory_members_actions' ); ?>
+
 			</div>
 
 			<div class="clear"></div>
Index: bp-themes/bp-default/members/single/member-header.php
--- bp-themes/bp-default/members/single/member-header.php Base (BASE)
+++ bp-themes/bp-default/members/single/member-header.php Locally Modified (Based On LOCAL)
@@ -21,21 +21,9 @@
 		<?php endif; ?>
 
 		<div id="item-buttons">
-			<?php if ( function_exists( 'bp_add_friend_button' ) ) : ?>
-				<?php bp_add_friend_button() ?>
-			<?php endif; ?>
 
-			<?php if ( is_user_logged_in() && !bp_is_my_profile() && function_exists( 'bp_send_public_message_link' ) ) : ?>
-				<div class="generic-button" id="post-mention">
-					<a href="<?php bp_send_public_message_link() ?>" title="<?php _e( 'Mention this user in a new public message, this will send the user a notification to get their attention.', 'buddypress' ) ?>"><?php _e( 'Mention this User', 'buddypress' ) ?></a>
-				</div>
-			<?php endif; ?>
+			<?php do_action( 'bp_member_header_actions' ); ?>
 
-			<?php if ( is_user_logged_in() && !bp_is_my_profile() && function_exists( 'bp_send_private_message_link' ) ) : ?>
-				<div class="generic-button" id="send-private-message">
-					<a href="<?php bp_send_private_message_link() ?>" title="<?php _e( 'Send a private message to this user.', 'buddypress' ) ?>"><?php _e( 'Send Private Message', 'buddypress' ) ?></a>
-				</div>
-			<?php endif; ?>
\ No newline at end of file
 		</div><!-- #item-buttons -->
 
 		<?php
Index: bp-xprofile/bp-xprofile-templatetags.php
--- bp-xprofile/bp-xprofile-templatetags.php Base (BASE)
+++ bp-xprofile/bp-xprofile-templatetags.php Locally Modified (Based On LOCAL)
@@ -685,12 +685,16 @@
 function bp_edit_profile_button() {
 	global $bp;
 
-	?>
-	<div class="generic-button">
-		<a class="edit" title="<?php _e( 'Edit Profile', 'buddypress' ) ?>" href="<?php echo $bp->displayed_user->domain . $bp->profile->slug ?>/edit"><?php _e( 'Edit Profile', 'buddypress' ) ?></a>
-	</div>
-	<?php
+	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' ),
+	) );
 }
 
-
 ?>
