function myfb_fboauth_user_save($account, $fbuser)
{
$time = time();
$profile_node = new stdClass();
$profile_node->title = $account->name;
$profile_node->body = '';
$profile_node->type = 'profile'; // Your specified content type
$profile_node->created = $time;
$profile_node->changed = $time;
$profile_node->status = 1;
$profile_node->promote = 0;
$profile_node->sticky = 0;
$profile_node->format = 1; // Filtered HTML
$profile_node->uid = $account->uid; // UID of content owner
$hometown=$fbuser->hometown->name;
if(!isset($hometown))
{
$hometown=$fbuser->location->name;
}
$profile_node->field_country[0]['value']=$hometown;
$profile_node->field_city[0]['value'] =$hometown;
node_save($profile_node);
}
No comments:
Post a Comment