1,创建表handy_profile
create table handy_profile
(
id int not null auto_increment primary key,
gender varchar(10),
email varchar(100),
contact varchar(100),
age int,
eventid varchar(50),
message varchar(500),
imageurl varchar(100),
lat double,
lng double,
birthday date,
createdate datetime) DEFAULT CHARSET=utf8;
2, user_register_submit() //表单的提交事件调用了user_save()来创建或更新用户。
3, user_save() in the user module
创建用户的同时,触发hook_user,让其他module可以处理用户事件。
user_module_invoke('insert', $array, $user, $category);//会调用hook_user,并且传入insert作为$type参数。
4,
/*
$edit['personalinfo']
$edit['profile_gender']
*/
function hook_user($type, &$edit, &$user, $category = NULL) {
switch($type)
{
case "insert":
save_customprofile($edit,$user,$categorty,TRUE);
break;
}
}
function profile_save_profile(&$edit, &$user, $category, $register = FALSE) {
db_query("INSERT INTO {profile_values} (fid, uid, value) VALUES (%d, %d, '%s')"
}