create user with custom profile

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')"

}


转载于:https://www.cnblogs.com/datasci/archive/2009/12/07/1618817.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值