我在这里: 首页 » 程序人生 » 浏览文章: Discuz!6.0与Dede4.0Rc1完美整合。
« 兽族所有单位的声音翻译!! [小苦工的work work]手机里舍不得删除的49条搞笑短信 »

Discuz!6.0与Dede4.0Rc1完美整合。

毋庸置疑,DZ6.0是php论坛史上一个新的里程碑,Dede作为一套优秀的cms系统也已经被很多站长所认可。因为两套系统都是近期才推出的,所以官方的整合程序都暂时还没出来,小弟不才,就照葫芦画了个瓢,希望各位朋友能用的上。

废话不多说了,开工:

1. 将附件的bbsroot.rar解压缩得到的四个文件替换到你的bbs根目录(2添加,2修改);

2. 进入Dede后台:DedeCms系统配置参数 - 通行证设置(反向整合接口),设置如下图:


3.修改pp_dederemote_interface.php里的参数(这个文件在我的压缩包里)
代码:
/*--------------------------------------
本文件用于第三方系统反向整合DedeCms在相关程序调用的接口

调用本文件的接口函数前必须不能输出任何字符,本API不需要导入被整合系统的数据

使用本接口的系统必须支持 file_get_contents 函数
--------------------------------------*/

//这里请填写DedeCms系统的cookie加密码(通行证密钥)

$cfg_cookie_encode = "NwAMf4558A";

//Cookie主域名(用 "abc.com" 形式,不要加主机名,本地域名留空)

$domain = "";

//DedeCms通行证接口网址
//如果程序装在根目录,一般为 http://localhost/member/passport/pp_dederemote_new.php
//如果你不想让人知道dedecms这个接口(pp_dederemote.php)的真实网址,你也可以把它改其它名称

$DedeAPI_Url = "http://127.0.0.1/cms/member/passport/pp_dederemote_new.php";


//登录成功后跳转的网址     (空按第三方系统默认)

$cfg_loginJumpUrl = "http://127.0.0.1/cms/member/index.php";

//注册成功后跳转的网址     (空按第三方系统默认)

$cfg_regJumpUrl = "http://127.0.0.1/cms/member/index.php";

//更改资料成功后跳转的网址 (空按第三方系统默认)

$cfg_editJump = "";      

//退出后跳转到的网址       (空按第三方系统默认)

$cfg_exitJump = "";

通过上面三步的操作,你的两个系统可以达到同步注册,修改,同步退出的效果了;但是,如果通过Dede登录,就会出问题了(当然,此时通过BBS登录是没问题的),所以,接着来......

4. 修改Dede的登陆代码。比如主页上面的登陆窗口,编辑templets\default\index.htm,查找这个span标签,并替换:
引用:
<span id="_loginform">
                        <table width="100%" border="0" cellspacing="0" cellpadding="0">
                                < form id="loginform" method="post" name="login" action="http://127.0.0.1/cms/bbs/logging.php?action=login&loginsubmit=true">
                                <input type="hidden" name="formhash" value="b96b539a" />
                                <input type="hidden" name="cookietime" value="2592000" />
                                <input type="hidden" name="loginfield" value="username" />
<tr>
<td height="28"> </td>
<td width="30%">用户名:</td>
<td width="63%"><input name="username" type="text" id="username" style="width:120px;height:20px;border:1px solid #cccccc"></td>
</tr>
<tr>
<td height="28"></td>
<td>密 码:</td>
<td><input type="password" id="password" name="password" style="width:120px;height:20px;border:1px solid #cccccc"></td>
</tr>
<tr>
<td width="4%" height="57"> </td>
<td height="57" colspan="2" align="center">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="50%" align="center">
<input name="loginsubmit" type="image" src="{dede:field _fcksavedurl=""{dede:field" name='templeturl'/}/img/loginbt.gif" width="75" height="28" border="0">
</td>
<td> <a href="{dede:field _fcksavedurl=""{dede:field" name='memberurl'/}/index_do.php?fmdo=user&dopost=regnew"><img src="{dede:field name='templeturl'/}/img/regbt.gif" width="75" height="28" border="0"></a>
</td>
</tr>
</table></td>
</tr>
< /form>
</table>
</span>

到此,DZ6与Dede4就能实现通过注册,登录,更新,退出了...............效果如下:


修改:ATK
转载请注明:www.2astudio.com

附:
为了大家对照图片设置参数,我的测试站点目录结构如下:
                 Root
                |
        cms    others...
         |
        bbs  blog others...

bbsroot.rar

  • 相关文章

发表评论

为了防止SPAM,含链接的评论需要审核后才能显示。

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。

日历

支持我们

最新评论及回复

最近发表

Search