BP profile data

<?php xprofile_set_field_data('City',$user_id,'LocoMoco'); //Change Simple Field ?>

<?php echo bp_profile_field_data( 'field=City' ); //Get Data ?>

<?php //Use for checkboxes and dropdowns - Have not tested this, xprofile_set_field_data seems to work to change value set in a dropdown
$value = maybe_serialize( [An Array of your values] );
xprofile_set_field_data( $field_name, $user_set_id, $value);

Signup Redirect

function bp_redirect($user) {

$redirect_url = 'http://www.mysite.com/yeah';



add_action('bp_core_signup_user', 'bp_redirect', 100, 1);

Comet Chat Friend of All

// friend_user_id is the id of the global friend
function create_global_comet_chat_friend($user_ID) {
global $wpdb;
$now = date('Y-m-d H:i:s');
$wpdb->insert($wpdb->prefix . "bp_friends", array('initiator_user_id' => $user_ID,'friend_user_id' => '21','is_confirmed' => '1','date_created' => $now));

add_action('user_register', 'create_global_comet_chat_friend');

BP fix for WP 3.1

add_action( is_multisite() ? 'network_admin_menu' : 'admin_menu', 'MYCALLBACKFUNCTION' ); //Replace callback with the name of your function that adds the submenu page.

Add tab to activity page

function my_theme_add_activity_tab() {
if ( !is_user_logged_in() )
return false;
<li id="activity-myclass">
<a href="<?php echo site_url( BP_ACTIVITY_SLUG . '/#myclass/' ) ?>" title="<?php _e( 'Activity for my Class Year.', 'buddypress' ) ?>">
<?php printf( __( 'My Class', 'buddypress' ) ) ?>
add_action( 'bp_activity_type_tabs', 'my_theme_add_activity_tab' );

User blogs

//Call the function from the members-loop.php file within the members loop
<?php lmc_get_user_blogs(bp_get_member_user_id());?>

//Add to your functions.php file
function lmc_get_user_blogs($user_id){
global $wpdb;

$blog_query = $wpdb->get_results("SELECT blog_id FROM wp_bp_user_blogs
WHERE user_id = $user_id");
if(!$blog_query) return;
else echo bp_member_name() . ''s Blogs:</span>';
foreach($blog_query as $blog){
if($blog->blog_id == 1) continue;
$domain_query = $wpdb->get_results("SELECT domain FROM wp_blogs
WHERE blog_id = $blog->blog_id");
$complete_url = $domain_query[0]->domain;
$pos = strpos($complete_url,'.');
$subdomain = substr_replace($complete_url,"",$pos);
<a class="lmc-blog-link" href="<?php echo 'http://' . $complete_url ?>" title="Visit Blog"><?php echo $subdomain ?></a>

Activity Default to My Friends

//Put this in your functions.php

function lmc_query_filter( $query_string ) {
$query_string .= '&scope=friends';
return $query_string;

//Change the loop in activity-loop.php
//Default to My Friends
if($_GET['friends'] == 'true'){
} <?php if (bp_has_activities(lmc_activity_default())) : ?>

//Change the main activity link to include the 'friends=true' query string, in header.php
<li<?php if ( bp_is_page( BP_ACTIVITY_SLUG ) ) : ?> class="selected"<?php endif; ?>>
<a href="<?php echo site_url() ?>/<?php echo BP_ACTIVITY_SLUG ?>/?friends=true" title="<?php _e( 'Activity', 'buddypress' ) ?>"><?php _e( 'Activity', 'buddypress' ) ?></a>

Intercept Ajax Query

//Members query switch
function lmc_members_query($members_query){
case 'fans':
$members_query .= "&search_terms=Fan Account";
case 'bands':
$members_query .= "&search_terms=Band Account";
case 'venues':
$members_query .= "&search_terms=Venue Account";
return $members_query;
return $members_query;

//Add the above to your functions.php and then modify the bp loop within whatever area you want, for instance this is the modified version for the members loop:

<?php $members_query = lmc_members_query(bp_ajax_querystring('members'));?>

<?php if (bp_has_members($members_query)) :?>