MediaWiki与Discuz整合方案

经过借鉴国外网友的整合代码,终于搞定MediaWiki与Discuz的整合。具体如下:

一、软件环境:
wiki: MediaWiki 1.9.3 (allwiki.com汉化版)
BBS: Discuz 5.5 utf-8 中文版

二、整合方法:
1.首先安装MediaWiki
2.修改localsettings.php,在尾部增加以下代码(其中设置请按自己的实际情况设置):

// Discuz User Database Plugin. (Requires MySQL Database)
require_once ‘./extensions/Auth_Discuz.php’;

$wgDiscuz_WikiGroupID = ‘9,10,11,12,13,14,15’; // GroupID of your Discuz group
$wgDiscuz_WikiGroupName = ”; // Name of your Discuz group
// users need to be a member
// of to use the wiki. (i.e. wiki)

$wgDiscuz_UseWikiGroup = true; // This tells the Plugin to require
// a user to be a member of the above
// Discuz group. (ie. wiki) Setting
// this to false will let any Discuz
// user edit the wiki.

$wgDiscuz_UseExtDatabase = true; // This tells the plugin that the Discuz tables
// are in a different database then the wiki.
// The default settings is false.

$wgDiscuz_Version = ‘6’; // This is what version of Discuz you are using.
// Current valid values are 5.5 and 6

/*-[NOTE: You only need the next four settings if you set $wgDiscuz_UseExtDatabase to true.]-*/
$wgDiscuz_MySQL_Host = ‘localhost’; // Discuz MySQL Host Name.
$wgDiscuz_MySQL_Username = ‘your username’; // Discuz MySQL Username.
$wgDiscuz_MySQL_Password = ‘your password’; // Discuz MySQL Password.
$wgDiscuz_MySQL_Database = ‘your database name’; // Discuz MySQL Database Name.

$wgDiscuz_Charset = ‘utf8’; // Discuz MySQL Database Name.
$wgDiscuz_UserTB = ‘bbs_members’; // Name of your Discuz user table. (i.e. bbs_members)
$wgDiscuz_UserFieldTB = ‘bbs_memberfields’; // Name of your SMF user table. (i.e. bbs_memberfields)
$wgDiscuz_GroupsTB = ‘bbs_usergroups’; // Name of your Discuz groups table. (i.e. bbs_usergroups)
$wgAuth = new Auth_Discuz(); // Auth_Discuz Plugin.

3.下载此文件保存在extensions目录下
Auth_Discuz.php

三、参考资源:
MediaWiki_SMF_Auth_v1.3

四、说明:
经过上面步骤修改后,请关闭MediaWiki的注册,将注册网址链接到论坛的注册页面,当用户在论坛注册后再登录Wiki时,系统会自动在Wiki数据库创建一个对应的用户。且支持非英文用户名。

MediaWiki与Discuz整合方案》上有10条评论

  1. 我用了这个,DISCUZ是6.0, MEDIAWIKI是1.11.0, 安装完成后出现下面的错误,
    请帮忙.谢谢.

    Warning: require_once(./extensions/Auth_Discuz.php) [function.require-once]: failed to open stream: No such file or directory in C:\xampp\htdocs\taoke\LocalSettings.php on line 129

    Fatal error: require_once() [function.require]: Failed opening required ‘./extensions/Auth_Discuz.php’ (include_path=’C:\xampp\htdocs\taoke;C:\xampp\htdocs\taoke/includes;C:\xampp\htdocs\taoke/languages;.;C:\xampp\php\pear\’) in C:\xampp\htdocs\taoke\LocalSettings.php on line 129

  2. 不好意思….我用了

    但是DIS的帳號無法再WIKI使用…

    這是因為捨麼呀

  3. /*-[NOTE: You only need the next four settings if you set $wgDiscuz_UseExtDatabase to true.]-*/
    $wgDiscuz_MySQL_Host = ‘localhost’; // Discuz MySQL Host Name. (Discuz数据库地址)
    $wgDiscuz_MySQL_Username = ‘root’; // Discuz MySQL Username. (Discuz数据库用户名)
    $wgDiscuz_MySQL_Password = ‘lenovo’; // Discuz MySQL Password. (Discuz数据库密码)
    $wgDiscuz_MySQL_Database = ‘ultrax’; // Discuz MySQL Database Name. (Discuz数据库名)
    //上面说需要设4条setting就可以了,那下面这4条是不是可以不设置?因为我是dx1.5的系统,没有下面这3个表,主要是没有usergroups。
    $wgDiscuz_Charset = ‘gbk’; // Discuz MySQL Database Name. 数据库编码(UTF-8编码的填写utf8, GBK编码填写gbk)
    $wgDiscuz_UserTB = ‘cdb_members’; // Name of your Discuz user table. (i.e. bbs_members)
    $wgDiscuz_UserFieldTB = ‘cdb_memberfields’; // Name of your SMF user table. (i.e. bbs_memberfields)
    $wgDiscuz_GroupsTB = ‘cdb_usergroups’; // Name of your Discuz groups table. (i.e. bbs_usergroups)
    $wgAuth = new Auth_Discuz();

  4. 您的文章很好!可是我也遇到:/上面说需要设4条setting就可以了,那下面这4条是不是可以不设置?因为我是dx1.5的系统,没有下面这3个表,主要是没有usergroups。不知怎么处理?谢谢

FORREST进行回复 取消回复

电子邮件地址不会被公开。 必填项已用*标注