帝國CMS7.5整合DiscuzX3.2完美實現同步登陸和退出
1、首先參照下載帝國CMS7.5安裝在網站根目錄,同時安裝完畢,另外在下載DiscuzX3.2到網站目錄club文件夾。并安裝完畢
2、按照帝國論壇教程http://bbs.phome.net/showthread-35-78648-0.html
3、在修改帝國CMS目錄下的e/config.inc.php文件配置:(UTF-8版要用dreamweaver或editplus修改,用記事本會將文件轉為gbk)
參照Discuz目錄下:config/config_ucenter.php 配置帝國e/config.inc.php文件
最后實現后,發現在帝國上登陸和退出都可以在discuz里實現,但是當在discuz上登陸退出,在帝國就不行了。
解決辦法:
在DISCUZ的client.php文件中(默認在uc_client目錄下):
找到365行左右
將以下代碼:
function uc_user_synlogin($uid) { $uid = intval($uid); if(@include UC_ROOT.'./data/cache/apps.php') { if(count($_CACHE['apps']) > 1) { $return = uc_api_post('user', 'synlogin', array('uid'=>$uid)); } else { $return = ''; } } return $return;}function uc_user_synlogout() { if(@include UC_ROOT.'./data/cache/apps.php') { if(count($_CACHE['apps']) > 1) { $return = uc_api_post('user', 'synlogout', array()); } else { $return = ''; } } return $return;}
改為:
function uc_user_synlogin($uid) { $uid = intval($uid); if(@include UC_ROOT.'./data/cache/apps.php') { if(count($_CACHE['apps']) > 1) { $return = uc_api_post('user', 'synlogin', array('uid'=>$uid)); } else { $return = uc_api_post('user', 'synlogin', array('uid'=>$uid)); } } return $return;}function uc_user_synlogout() { if(@include UC_ROOT.'./data/cache/apps.php') { if(count($_CACHE['apps']) > 1) { $return = uc_api_post('user', 'synlogout', array()); } else { $return = uc_api_post('user', 'synlogout', array()); } } return $return;}
新聞熱點
疑難解答