Home > php教程 > php手册 > ucenter整理tipask问答系统与discuz单项同步问题解决方法

ucenter整理tipask问答系统与discuz单项同步问题解决方法

WBOY
Release: 2016-05-26 08:21:12
Original
1779 people have browsed it

UCenter是Comsenz旗下各个产品之间信息直接传递的一个桥梁,通过UCenter 站长可以无缝整合Comsenz系列产品,实现用户的一站式登录以及社区其他数据的交互,但很多站长在使用它时会碰到一些问题了,下文就ucenter整理tipask问答系统与discuz单项同步问题解决方法

今天整合了一下论坛discuz+问答系统tipask,按照官方后台操作配置了ucenter,实现的会员数据同步的功能

后来测试发现,只有从tipask(登录、注册)可以同步到discuz

从discuz登录确不能同步到tipask上面,于是在网上找了很多资料,也有很多网友出现了跟我一样的问题;都没有解决

实在没办法了,只能一点点的解读代码

发现uc_client下的client.php文件有这样一段话

====================================

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;
}
Copy after login

====================================

上面意思是只有应用数大于一才会执行其他同步操作

于是去找了一下/data/cache/apps.php这个文件发现了问题;

默认配置好tipask+discuz的时候,这个文件并没有增加应用数,以前默认只有一个,下面那个应用是我手动加上了,

====================================

<?php
$_CACHE[&#39;apps&#39;] = array (
  1 => 
  array (
    &#39;appid&#39; => &#39;1&#39;,
    &#39;type&#39; => &#39;DISCUZX&#39;,
    &#39;name&#39; => &#39;Discuz! Board&#39;,
    &#39;url&#39; => &#39;http://127.0.0.12&#39;,
    &#39;ip&#39; => &#39;&#39;,
    &#39;viewprourl&#39; => &#39;&#39;,
    &#39;apifilename&#39; => &#39;uc.php&#39;,
    &#39;charset&#39; => &#39;&#39;,
    &#39;dbcharset&#39; => &#39;&#39;,
    &#39;synlogin&#39; => &#39;1&#39;,
    &#39;recvnote&#39; => &#39;1&#39;,
    &#39;extra&#39; => false,
    &#39;tagtemplates&#39; => &#39;&#39;,
    &#39;allowips&#39; => &#39;&#39;,
  ),
  2 => 
  array (
    &#39;appid&#39; => &#39;2&#39;,
    &#39;type&#39; => &#39;OTHER&#39;,
    &#39;name&#39; => &#39;ask&#39;,
    &#39;url&#39; => &#39;http://127.0.0.12/ask&#39;,
    &#39;ip&#39; => &#39;&#39;,
    &#39;viewprourl&#39; => &#39;&#39;,
    &#39;apifilename&#39; => &#39;uc.php&#39;,
    &#39;charset&#39; => &#39;&#39;,
    &#39;dbcharset&#39; => &#39;&#39;,
    &#39;synlogin&#39; => &#39;1&#39;,
    &#39;recvnote&#39; => &#39;1&#39;,
    &#39;extra&#39; => false,
    &#39;tagtemplates&#39; => &#39;&#39;,
    &#39;allowips&#39; => &#39;&#39;,    
  ),  
);
?>
Copy after login

=============================

上面的相关配置需要根据实际配置修改,这样问题就解决了;


教程地址:

欢迎转载!但请带上文章地址^^

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template