帝國7.5整合discuzX3.2同時登陸退出_帝國Cms教程

      編輯Tag賺U幣
      教程Tag:暫無Tag,歡迎添加,賺取U幣!
      今天給大家說一下帝國CMS7.5整合DiscuzX3.2完美實現(xiàn)同步登陸和退出,看看對你有沒有幫助

      1、首先參照下載帝國CMS7.5安裝在網(wǎng)站根目錄,同時安裝完畢,另外在下載DiscuzX3.2到網(wǎng)站目錄club文件夾。并安裝完畢

      2、按照帝國論壇教程http://bbs.phome.net/showthread-35-78648-0.html

      3、在修改帝國CMS目錄下的e/config.inc.php文件配置:(UTF-8版要用dreamweaver或editplus修改,用記事本會將文件轉(zhuǎn)為gbk)

      參照Discuz目錄下:config/config_ucenter.php 配置帝國e/config.inc.php文件

      最后實現(xiàn)后,發(fā)現(xiàn)在帝國上登陸和退出都可以在discuz里實現(xiàn),但是當在discuz上登陸退出,在帝國就不行了。

      解決辦法:

      在DISCUZ的client.php文件中(默認在uc_client目錄下):

      找到365行左右

      將以下代碼

      1. function uc_user_synlogin($uid) { 
      2.         $uid = intval($uid); 
      3.         if(@include UC_ROOT.'./data/cache/apps.php') { 
      4.                 if(count($_CACHE['apps']) > 1) { 
      5.                         $return = uc_api_post('user', 'synlogin', array('uid'=>$uid)); 
      6.                 } else { 
      7.                         $return = ''
      8.                 } 
      9.         } 
      10.         return $return; 
      11. function uc_user_synlogout() { 
      12.         if(@include UC_ROOT.'./data/cache/apps.php') { 
      13.                 if(count($_CACHE['apps']) > 1) { 
      14.                         $return = uc_api_post('user', 'synlogout', array()); 
      15.                 } else { 
      16.                         $return = ''
      17.                 } 
      18.         } 
      19.         return $return; 

      改為:

      1. function uc_user_synlogin($uid) { 
      2.         $uid = intval($uid); 
      3.         if(@include UC_ROOT.'./data/cache/apps.php') { 
      4.                 if(count($_CACHE['apps']) > 1) { 
      5.                         $return = uc_api_post('user', 'synlogin', array('uid'=>$uid)); 
      6.                 } else { 
      7.                         $return = uc_api_post('user', 'synlogin', array('uid'=>$uid)); 
      8.                 } 
      9.         } 
      10.         return $return; 
      11. function uc_user_synlogout() { 
      12.         if(@include UC_ROOT.'./data/cache/apps.php') { 
      13.                 if(count($_CACHE['apps']) > 1) { 
      14.                         $return = uc_api_post('user', 'synlogout', array()); 
      15.                 } else { 
      16.                         $return = uc_api_post('user', 'synlogout', array()); 
      17.                 } 
      18.         } 
      19.         return $return; 

      僅供大家學(xué)習(xí)參考。

      查看更多 帝國cms教程  帝國cms模板

      來源:模板無憂//所屬分類:帝國Cms教程/更新時間:2020-04-23
      相關(guān)帝國Cms教程