Transfer FB profile to Drupal profile
Hello,
I want to copy some information like firstname, lastname, birthdate etc of the users Facebook profile to the Drupal user account.
How can I do this with Drupal for Facebook
Thanks in advance.
- Forums:
Hello,
I want to copy some information like firstname, lastname, birthdate etc of the users Facebook profile to the Drupal user account.
How can I do this with Drupal for Facebook
Thanks in advance.
Please move all profile
Please move all profile saving discussion to this thread, I see on the forum a lot of people asking for this and i'm working with a friend to try to add this into the FB module, however time is limited on our end, so maybe if we work together we could get this done.
http://www.drupalforfacebook.org/node/2070
Power to the community :)
Short answer... look up on
Short answer... look up on drupal.org how to manage profile fields. Create the fields you want for each user.
Then implement a custom module. In there, implement hook_fb() This will be called, among other times, when a new account is created. In your code, query facebook for the values and set them on drupal.
There's no really easy way to do this, because in the past it was a violation of facebook's terms of service to save this data. They only just changed that a couple weeks ago.
How to define the permissions you want to fetch ?
Hi,
I'd like to fetch the first +last + dob + image. How to set up the permissions list so the application ask and get them ?
I understand the hook, but was looking for a slightly different workflow:
When I go to /user/register, Got a FB connect button, when I click on it, can log in on FB, grant the permissions, then have the /user/register form pre-filled with the informations pulled from facebook, but still can update them, before saving the account.
Is this possible ? Does it make sense ?
See
See modules/fb/contrib/fb_permission.module. In the 3.x branch, it is now using the new data model to ask for permissions when the user first authorizes the app.
I have updated the function,
I have updated the function, but need to know what fields to create for the drupal profile. It would also be nice to seperate these a bit so you dont have one long list..
* @TODO - update this list and/or make it customizable.
*/
function fb_permission_map() {
static $perms;
if (!isset($perms)) {
// http://wiki.developers.facebook.com/index.php/Extended_permissions
$perms = array(
// Publishing Permissions
'publish_stream' => 'Allow %application to publish to your stream.',
'create_event' => 'Allow %application to create events on your behalf.',
'rsvp_event' => 'Allow %application to RSVP to events on your behalf',
'sms' => 'Allow %application to send you SMS text messages.',
'offline_access' => 'Grant %application access to your Facebook profile.',
// User Data Permissions
'email' => 'Allow %application to send you email',
'read_stream' => 'Allow %application to display your stream.',
'user_about_me' => 'Allow %application to access your "About Me" section of your profile',
'user_activities' => 'Allow %application access to the users list of activities as the activities connection',
'user_birthday' => 'Allow %application access to the full birthday',
'user_education_history' => 'Allow %application access to education history',
'user_events' => 'Allow %application access to the list of events the user is attending',
'user_groups' => 'Allow %application access to the list of groups the user is a member of',
'user_hometown' => 'Allow %application access to the users hometown',
'user_interests' => 'Allow %application access to the users list of interests',
'user_likes' => 'Allow %application access to the list of all of the pages the user has liked',
'user_location' => 'Allow %application access to the users current location',
'user_notes' => 'Allow %application access to the users notes',
'user_online_presence' => 'Allow %application access to the users online/offline presence',
'user_photo_video_tags' => 'Allow %application access to the photos the user has been tagged in',
'user_photos' => 'Allow %application access to the photos the user has uploaded',
'user_relationships' => 'Allow %application access to the users family and personal relationships and relationship status',
'user_religion_politics' => 'Allow %application access to the users religious and political affiliations',
'user_status' => 'Allow %application access to the users most recent status message',
'user_videos' => 'Allow %application access to the videos the user has uploaded',
'user_website' => 'Allow %application ccess to the users web site URL',
'user_work_histor' => 'Allow %application access to work history',
// Misc Permissions
'create_listing' => 'Allow %application to create marketplace listings on your behalf.',
'photo_upload' => 'Allow %application to upload photos.',
'status_update' => 'Allow %application to set your status.',
);
}
return $perms;
}
This array worked, but where
This array worked, but where would the information like birthday be stored?
If you want a change like
If you want a change like this to actually get into the module, submit a patch to the issue queue.