经过借鉴国外网友的整合代码,终于搞定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数据库创建一个对应的用户。且支持非英文用户名。