Index: bp-friends.php
===================================================================
--- bp-friends.php	(revision 3148)
+++ bp-friends.php	(working copy)
@@ -11,7 +11,7 @@
 	/* For internal identification */
 	$bp->friends->id = 'friends';
 
-	$bp->friends->table_name = $wpdb->base_prefix . 'bp_friends';
+	$bp->friends->table_name = bp_get_table_name( 'bp_friends' );
 	$bp->friends->format_notification_function = 'friends_format_notifications';
 	$bp->friends->slug = BP_FRIENDS_SLUG;
 
@@ -609,4 +609,4 @@
 add_action( 'friends_friendship_deleted', 'bp_core_clear_cache' );
 add_action( 'friends_friendship_requested', 'bp_core_clear_cache' );
 
-?>
\ No newline at end of file
+?>
Index: bp-activity.php
===================================================================
--- bp-activity.php	(revision 3148)
+++ bp-activity.php	(working copy)
@@ -14,8 +14,8 @@
 	$bp->activity->name = $bp->pages->activity->name;
 	$bp->activity->slug = BP_ACTIVITY_SLUG;
 
-	$bp->activity->table_name = $wpdb->base_prefix . 'bp_activity';
-	$bp->activity->table_name_meta = $wpdb->base_prefix . 'bp_activity_meta';
+	$bp->activity->table_name = bp_get_table_name( 'bp_activity' );
+	$bp->activity->table_name_meta = bp_get_table_name( 'bp_activity_meta' );
 	$bp->activity->format_notification_function = 'bp_activity_format_notifications';
 
 	/* Register this in the active components array */
@@ -1112,4 +1112,4 @@
 add_action( 'plugins_loaded', 'bp_register_activity_actions' );
 
 
-?>
\ No newline at end of file
+?>
Index: bp-blogs.php
===================================================================
--- bp-blogs.php	(revision 3148)
+++ bp-blogs.php	(working copy)
@@ -17,8 +17,8 @@
 	$bp->blogs->name = $bp->pages->blogs->name;
 	$bp->blogs->slug = BP_BLOGS_SLUG;
 
-	$bp->blogs->table_name = $wpdb->base_prefix . 'bp_user_blogs';
-	$bp->blogs->table_name_blogmeta = $wpdb->base_prefix . 'bp_user_blogs_blogmeta';
+	$bp->blogs->table_name = bp_get_table_name( 'bp_user_blogs' );
+	$bp->blogs->table_name_blogmeta = bp_get_table_name( 'bp_user_blogs_blogmeta' );
 	$bp->blogs->format_notification_function = 'bp_blogs_format_notifications';
 
 	/* Register this in the active components array */
@@ -691,4 +691,4 @@
 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
+?>
Index: bp-messages.php
===================================================================
--- bp-messages.php	(revision 3148)
+++ bp-messages.php	(working copy)
@@ -13,9 +13,9 @@
 	/* For internal identification */
 	$bp->messages->id = 'messages';
 
-	$bp->messages->table_name_messages = $wpdb->base_prefix . 'bp_messages_messages';
-	$bp->messages->table_name_recipients = $wpdb->base_prefix . 'bp_messages_recipients';
-	$bp->messages->table_name_notices = $wpdb->base_prefix . 'bp_messages_notices';
+	$bp->messages->table_name_messages = bp_get_table_name( 'bp_messages_messages' );
+	$bp->messages->table_name_recipients = bp_get_table_name( 'bp_messages_recipients' );
+	$bp->messages->table_name_notices = bp_get_table_name( 'bp_messages_notices' );
 	$bp->messages->format_notification_function = 'messages_format_notifications';
 	$bp->messages->slug = BP_MESSAGES_SLUG;
 
@@ -515,4 +515,4 @@
 add_action( 'messages_screen_sentbox', 'bp_core_clear_cache' );
 add_action( 'messages_screen_inbox', 'bp_core_clear_cache' );
 
-?>
\ No newline at end of file
+?>
Index: bp-groups.php
===================================================================
--- bp-groups.php	(revision 3148)
+++ bp-groups.php	(working copy)
@@ -15,9 +15,9 @@
 	$bp->groups->name = $bp->pages->groups->name;
 	$bp->groups->slug = BP_GROUPS_SLUG;
 
-	$bp->groups->table_name = $wpdb->base_prefix . 'bp_groups';
-	$bp->groups->table_name_members = $wpdb->base_prefix . 'bp_groups_members';
-	$bp->groups->table_name_groupmeta = $wpdb->base_prefix . 'bp_groups_groupmeta';
+	$bp->groups->table_name = bp_get_table_name( 'bp_groups' );
+	$bp->groups->table_name_members = bp_get_table_name( 'bp_groups_members' );
+	$bp->groups->table_name_groupmeta = bp_get_table_name( 'bp_groups_groupmeta' );
 	$bp->groups->format_notification_function = 'groups_format_notifications';
 
 	/* Register this in the active components array */
@@ -2471,4 +2471,4 @@
 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
+?>
Index: bp-core.php
===================================================================
--- bp-core.php	(revision 3148)
+++ bp-core.php	(working copy)
@@ -159,7 +159,7 @@
 	/* Used to determine if the logged in user is a moderator for the current content. */
 	$bp->is_item_mod = false;
 
-	$bp->core->table_name_notifications = $wpdb->base_prefix . 'bp_notifications';
+	$bp->core->table_name_notifications = bp_get_table_name( 'bp_notifications' );
 
 	if ( !$bp->current_component && $bp->displayed_user->id )
 		$bp->current_component = $bp->default_component;
@@ -2063,4 +2063,8 @@
 	return false;
 }
 
-?>
\ No newline at end of file
+function bp_get_table_name( $bp_table ) {
+	global $wpdb;
+	return apply_filters( 'table_name_' . $bp_table, $wpdb->base_prefix . $bp_table );
+}
+?>
Index: bp-xprofile.php
===================================================================
--- bp-xprofile.php	(revision 3148)
+++ bp-xprofile.php	(working copy)
@@ -28,9 +28,9 @@
 	/* For internal identification */
 	$bp->profile->id = 'profile';
 
-	$bp->profile->table_name_groups = $wpdb->base_prefix . 'bp_xprofile_groups';
-	$bp->profile->table_name_fields = $wpdb->base_prefix . 'bp_xprofile_fields';
-	$bp->profile->table_name_data = $wpdb->base_prefix . 'bp_xprofile_data';
+	$bp->profile->table_name_groups = bp_get_table_name( 'bp_xprofile_groups' );
+	$bp->profile->table_name_fields = bp_get_table_name( 'bp_xprofile_fields' );
+	$bp->profile->table_name_data = bp_get_table_name( 'bp_xprofile_data' );
 
 	$bp->profile->format_notification_function = 'xprofile_format_notifications';
 	$bp->profile->slug = BP_XPROFILE_SLUG;
