欢迎光临景诺科技软件开发淘宝店

进店请收藏,谢谢

Ucenter同步注册后无需激活登录论坛

在你当前应用下注册的用户需同步到ucenter和论坛。

在uc_client/model/user.php 文件内修改 add_user

在return 上方新增:

以下代码是 DZX的论坛:


$this->db->query("INSERT INTO `dz32`.pre_common_member SET uid='$uid', username='$username', password='$password', email='$email', adminid='0', groupid='10', regdate='".$this->base->time."', credits='0', timeoffset='9999'");
$this->db->query("INSERT INTO `dz32`.pre_common_member_status SET uid='$uid', regip='$regip', lastip='$regip', lastvisit='".$this->base->time."', lastactivity='".$this->base->time."', lastpost='0', lastsendmail='0'");
$this->db->query("INSERT INTO `dz32`.pre_common_member_profile SET uid='$uid'");
$this->db->query("INSERT INTO `dz32`.pre_common_member_field_forum SET uid='$uid'");
$this->db->query("INSERT INTO `dz32`.pre_common_member_field_home SET uid='$uid'");
$this->db->query("INSERT INTO `dz32`.pre_common_member_count SET uid='$uid', extcredits1='0', extcredits2='0', extcredits3='0', extcredits4='0', extcredits5='0', extcredits6='0', extcredits7='0', extcredits8='0'");

即可实现注册写入到论坛数据。 其中的数据库名 dz32 数据库前缀 pre  自行修改。

 

改进了下:


$this->db->query("INSERT INTO ".UC_DBNAME.".pre_common_member SET uid='$uid', username='$username', password='$password', email='$email', adminid='0', groupid='10', regdate='".$this->base->time."', credits='0', timeoffset='9999'");
$this->db->query("INSERT INTO ".UC_DBNAME.".pre_common_member_status SET uid='$uid', regip='$regip', lastip='$regip', lastvisit='".$this->base->time."', lastactivity='".$this->base->time."', lastpost='0', lastsendmail='0'");
$this->db->query("INSERT INTO ".UC_DBNAME.".pre_common_member_profile SET uid='$uid'");
$this->db->query("INSERT INTO ".UC_DBNAME.".pre_common_member_field_forum SET uid='$uid'");
$this->db->query("INSERT INTO ".UC_DBNAME.".pre_common_member_field_home SET uid='$uid'");
$this->db->query("INSERT INTO ".UC_DBNAME.".pre_common_member_count SET uid='$uid', extcredits1='0', extcredits2='0', extcredits3='0', extcredits4='0', extcredits5='0', extcredits6='0', extcredits7='0', extcredits8='0'");

更多

本文固定链接: http://shanmao.me/web-system/discuz/ucenter-tong-bu-zhu-ce-hou-wu-xu-ji-huo-deng-lu-lun-tan | 山猫的博客

该日志由 admin 于2014年11月19日发表在 discuz 分类下,
原创文章转载请注明: Ucenter同步注册后无需激活登录论坛 | 山猫的博客