帝国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行左右
将以下代码:
01 |
function uc_user_synlogin( $uid ) { |
03 |
if (@ include UC_ROOT. './data/cache/apps.php' ) { |
04 |
if ( count ( $_CACHE [ 'apps' ]) > 1) { |
05 |
$return = uc_api_post( 'user' , 'synlogin' , array ( 'uid' => $uid )); |
12 |
function uc_user_synlogout() { |
13 |
if (@ include UC_ROOT. './data/cache/apps.php' ) { |
14 |
if ( count ( $_CACHE [ 'apps' ]) > 1) { |
15 |
$return = uc_api_post( 'user' , 'synlogout' , array ()); |
改为:
01 |
function uc_user_synlogin( $uid ) { |
03 |
if (@ include UC_ROOT. './data/cache/apps.php' ) { |
04 |
if ( count ( $_CACHE [ 'apps' ]) > 1) { |
05 |
$return = uc_api_post( 'user' , 'synlogin' , array ( 'uid' => $uid )); |
07 |
$return = uc_api_post( 'user' , 'synlogin' , array ( 'uid' => $uid )); |
12 |
function uc_user_synlogout() { |
13 |
if (@ include UC_ROOT. './data/cache/apps.php' ) { |
14 |
if ( count ( $_CACHE [ 'apps' ]) > 1) { |
15 |
$return = uc_api_post( 'user' , 'synlogout' , array ()); |
17 |
$return = uc_api_post( 'user' , 'synlogout' , array ()); |