转成DX2一个星期又退回去了,丢了几天的数据,SNS功能还是要靠UCH才行
把修改经验发出来给大家,欢迎和我一样坚守UCH的朋友一起交流,自力更生,如果你发现其他问题欢迎跟贴
目的:在DX注册后(不管论坛注册还是QQ注册),自动同步登录UCH。
整合步骤:升级UCenter至1.6,将新版uc_client覆盖到UCH中,升级DiscuzX2,修改cookiedomain为“.xxx.com”
\uc_client\model\user.php
找到:
- $this->db->query("INSERT INTO ".UC_DBTABLEPRE."memberfields SET uid='$uid'");
复制代码 在这行下面添加(修改代码中的UCH数据库名):
- $this->db->query("insert into UCH数据库名.uchome_member SET uid='$uid',username='$username',password='$password'");
- $this->db->query("insert into UCH数据库名.uchome_space SET uid='$uid',username='$username',ip='".$this->base->onlineip."', dateline='".$this->base->time."'");
- $this->db->query("insert into UCH数据库名.uchome_spacefield SET uid='$uid',email='$email',css='',privacy='',friend='',feedfriend='',sendmail=''");
复制代码
\source\class\class_member.php
在底下找到:
- $extra = array(
- 'showid' => 'succeedmessage',
- 'extrajs' => '<script type="text/javascript">'.
- 'setTimeout("window.location.href =\''.$href.'\';", 3000);'.
- '$(\'succeedmessage_href\').href = \''.$href.'\';'.
- '$(\'main_message\').style.display = \'none\';'.
- '$(\'main_succeed\').style.display = \'\';'.
- '$(\'succeedlocation\').innerHTML = \''.lang('message', $locationmessage).'\';'.
- '</script>',
- 'striptags' => false,
- );
复制代码
修改为:
- $ucsynlogin = '';
- if($_G['setting']['allowsynlogin']) {
- loaducenter();
- $ucsynlogin = uc_user_synlogin($_G['uid']);
- }
- $extra = array(
- 'showid' => 'succeedmessage',
- 'extrajs' => '<script type="text/javascript">'.
- 'setTimeout("window.location.href =\''.$href.'\';", 3000);'.
- '$(\'succeedmessage_href\').href = \''.$href.'\';'.
- '$(\'main_message\').style.display = \'none\';'.
- '$(\'main_succeed\').style.display = \'\';'.
- '$(\'succeedlocation\').innerHTML = \''.lang('message', $locationmessage).'\';'.
- '</script>'.$ucsynlogin,
- 'striptags' => false,
- );
复制代码
|