Skip to:
Content
Pages
Categories
Search
Top
Bottom

Re: New FB Autoconnect Plugin for WP…will it work with MU/BP?


peterverkooijen
Participant

@peterverkooijen

Thanks justin_k. The discussion mentions this function from “Andy”:

<?php
function bp_fbconnect_modify_userdata( $userdata, $userinfo ) {
$userdata = array(
'user_pass' => wp_generate_password(),
'user_login' => $fbusername,
'display_name' => fbc_get_displayname($userinfo),
'user_url' => fbc_make_public_url($userinfo),
'user_email' => $userinfo['proxied_email']
);

$fb_bp_user_login = strtolower( str_replace( ' ', '', fbc_get_displayname($userinfo) ) );

$counter = 1;
if ( username_exists( $fb_bp_user_login ) ) {
do {
$username = $fb_bp_user_login;
$counter++;
$username = $username . $counter;
} while ( username_exists( $username ) );

$userdata['user_login'] = $username;
} else {
$userdata['user_login'] = $fb_bp_user_login;
}

return $userdata;
}
add_filter( 'fbc_insert_user_userdata', 'bp_fbconnect_modify_userdata', 10, 2 );
?>

Where should I add this? Does this use ‘firstnamelastname’ as username and check for doubles? Does it synchronize and update all the fields in wp_users, wp_usermeta and xprofile?

Usernames like this, ‘community.net/members/fb_100000441950350’, are really not acceptable imho.

Where is the query that actually stores the new user data in the database? Is it in the plugin or does the plugin send data back to WP/BP files? I also need to that data stored in mailinglist tables.

Skip to toolbar