安装两套mediawiki怎么设置一下?大侠请进 [技术论坛 - 安装设置] imag1

正在浏览:   1 名游客






安装两套mediawiki怎么设置一下?大侠请进
新进会员
注册日期:
12/29 19:52
所属群组:
注册会员
帖子: 20 | 精华: 1
等级: 3; EXP: 20
HP: 0 / 55
MP: 6 / 19
离线
我要在一个xoops上安装两套mediawiki,提示已经有模块无法安装,我不知道需要设置那些参数,请大侠指教!我知道肯定行,因为我安装相册安装了好几个,改了几个设置就可以了,mediawiki太复杂,请指教


我已经作的是
1、把/modules/mediawiki/改成了/modules/mediawiki2/

2、把$wgScriptPath= "/mediawiki"改成$wgScriptPath= "/mediawiki2";

还是不行!

1/24 22:10
工具箱 短消息 Email 书签 打印 WordPress 举报 回顶部


回复: 安装两套mediawiki怎么设置一下?大侠请进
网站管理员
注册日期:
2004/6/25 19:16
所属群组:
网站管理员
注册会员
Dev+Hack
帖子: 5513 | 精华: 11
等级: 53; EXP: 37
HP: 1309 / 1309
MP: 1837 / 10065
离线
表的前缀也需要改

1/24 22:18
_________________
XOOPS Project -- |自由|开源|共享|
工具箱 短消息 Email 书签 打印 WordPress 举报 回顶部


回复: 安装两套mediawiki怎么设置一下?大侠请进
新进会员
注册日期:
12/29 19:52
所属群组:
注册会员
帖子: 20 | 精华: 1
等级: 3; EXP: 20
HP: 0 / 55
MP: 6 / 19
离线
具体怎么设置呢?麻烦稍微详细点指点啊

1/26 15:18
工具箱 短消息 Email 书签 打印 WordPress 举报 回顶部


回复: 安装两套mediawiki怎么设置一下?大侠请进
中级会员
注册日期:
2006/6/26 6:38
所属群组:
注册会员
帖子: 47
等级: 5; EXP: 67
HP: 0 / 116
MP: 15 / 215
离线
引文:

vggu 写道:
具体怎么设置呢?麻烦稍微详细点指点啊


模块克隆指南
作者简介: bestjovi
bestjovi为 Xoops China 活跃会员文章管理模块支持方便的模块克隆复制。(Revised by Oread555 on December 21, 2006)

复制步骤如下:

第一步:拷贝模块的完整目录,目录改名为新建模块目录名,比如article2
第二步:修改新建模块目录中所有/templates/和/templates/blocks/目录下的文件,将"article"前缀修改为新建模块目录名的前缀。例如,重命名article_index.html为article2_index.html

第三步:打开新建模块目录中的文件"/include/var.php",设置变量值$GLOBALS["ART_DB_PREFIX"], 把原来的值“art”改写成一个新值,例如“art2”

第四步:编辑新建模块目录中/sql/mysql.sql,把所有数据表的前缀修改为第三步中设定的值,比如说刚才所举的例子“art2”

具体修改举例说明:把 "CREATE TABLE `art_article`" 改为 "CREATE TABLE `art2_article`" (必要步骤)。尤其请新手注意, 除数据表名称以外,数据表中的字段名称务必保持不变。

第五步:安装修改后的模块。完成!

以上每步都是必须步骤。


http://xoops.org.cn/modules/article/v ... tegory=2&article=3&page=2

1/27 12:44
工具箱 短消息 Email 书签 打印 WordPress 举报 回顶部


回复: 安装两套mediawiki怎么设置一下?大侠请进
Support Team
注册日期:
2006/6/26 10:17
来自 北京
所属群组:
注册会员
Dev+Hack
帖子: 427
等级: 19; EXP: 20
HP: 182 / 455
MP: 142 / 837
离线
引文:
vggu 写道: 具体怎么设置呢?麻烦稍微详细点指点啊

目录
[隐藏]

* 1 克隆维基百科模块
o 1.1 修改LocalSettings.php文件
o 1.2 修改xoops_version.php文件
o 1.3 修改include/action.module.php文件
o 1.4 增加pre.install.php临时文件

[编辑]
克隆维基百科模块
[编辑]
修改LocalSettings.php文件
<?php
/**
 * Config file for mediawiki
 *
 * The file is composed of XOOPS basic preferences and mediawiki LocalSettings.php
 * You are not supposed to change most of the parameters
 *
 * @copyright    The XOOPS project http://www.xoops.org/
 * @license        http://www.fsf.org/copyleft/gpl.html GNU public license
 * @author        Taiwen Jiang (phppp or D.J.) <[email protected]>
 * @since        1.58
 * @version        $Id$
 * @package        module::mediawiki
 */
 
global $xoopsUser$xoopsModule$xoopsConfig$xoopsOption$xoopsLogger$xoopsTpl;
global 
$wgUsePathInfo;

# If PHP's memory limit is very low, some operations may fail.
@ini_set'memory_limit''20M' );

$mainfile dirname(dirname(dirname(__FILE__)))."/mainfile.php";
include_once 
$mainfile;
define("MEDIAWIKI_DIRNAME"basename(dirname(__FILE__)));
require_once(
XOOPS_ROOT_PATH."/modules/".MEDIAWIKI_DIRNAME."/include/functions.php");

if(!
defined("NS_MAIN")) {
    require_once(
XOOPS_ROOT_PATH."/modules/".MEDIAWIKI_DIRNAME."/includes/Defines.php");
}

// define user name prefix for the module, must be capitalized!
define("MEDIAWIKI_USERPREFIX""Xo.");

# This file was automatically generated by the MediaWiki installer.
# If you make manual changes, please keep track in case you need to
# recreate them later.

# If you customize your file layout, set $IP to the directory that contains
# the other MediaWiki files. It will be used as a base to locate files.
if( defined'MW_INSTALL_PATH' ) ) {
    
$IP MW_INSTALL_PATH;
} else {
    
$IP dirname__FILE__ );
}

$path = array( $IP"$IP/includes""$IP/languages" );
set_include_pathimplodePATH_SEPARATOR$path ) . PATH_SEPARATOR get_include_path() );

require_once( 
"includes/DefaultSettings.php" );

/** We speak UTF-8 all the time now, unless some oddities happen */
//$wgInputEncoding    = 'UTF-8';
$wgOutputEncoding    = empty($GLOBALS["xlanguage"]['charset_base'])?_CHARSET:$GLOBALS["xlanguage"]['charset_base'];
//$wgEditEncoding        = '';

if ( $wgCommandLineMode ) {
    if ( isset( 
$_SERVER ) && array_key_exists'REQUEST_METHOD'$_SERVER ) ) {
        
//die( "This script must be run from the command linen" );
    
}
} elseif ( empty( 
$wgNoOutputBuffer ) ) {
    
## Compress output if the browser supports it
    //if( !ini_get( 'zlib.output_compression' ) ) @ob_start( 'ob_gzhandler' );
}

$wgSitename         mediawiki_encoding_xoops2mediawiki($xoopsConfig["sitename"]);

$wgServer preg_replace'{^(http[s]?://[^/]*).*$}''$1'XOOPS_URL );
$wgInternalServer $wgServer;

$ScriptPath str_replace$wgServer''XOOPS_URL."/modules/".MEDIAWIKI_DIRNAME ); # was SCRIPT_NAME
$wgScriptPath        $ScriptPath;
$wgScript           "$wgScriptPath/index.php";
$wgRedirectScript   "$wgScriptPath/redirect.php";

## For more information on customizing the URLs please see:
## http://meta.wikimedia.org/wiki/Eliminating_index.php_from_the_url
## If using PHP as a CGI module, the ?title= style usually must be used.
if($wgUsePathInfo){
    
$wgArticlePath      "$wgScript/$1";
   
    
// $_SERVER['PATH_INFO'] used in WebRequest::WebRequest() would escape trailing "delimitors"
    
if(!empty($_SERVER['PATH_INFO'])){
        if(
preg_match("/([.?]+)$/"$_SERVER['REQUEST_URI'], $matches)){
            
$_SERVER['PATH_INFO'] .= $matches[1];
        }
    }
}else{
    
$wgArticlePath      "$wgScript?title=$1";
}
$wgStylePath        "$wgScriptPath/skins";
$wgStyleDirectory   "$IP/skins";
$wgLogo             "$wgScriptPath/images/mediawiki.png";

$wgUploadPath       str_replace$wgServer''XOOPS_UPLOAD_URL )."/".MEDIAWIKI_DIRNAME;
$wgUploadDirectory  XOOPS_UPLOAD_PATH."/".MEDIAWIKI_DIRNAME;

/**
 * This will cache static pages for non-logged-in users to reduce
 * database traffic on public sites.
 * Must set $wgShowIPinHeader = false
 */
$wgUseFileCache = @(mediawiki_getStyle())?false: ( is_object($xoopsModule) && $xoopsModule->getVar('dirname') == MEDIAWIKI_DIRNAME && @$xoopsConfig['module_cache'][$xoopsModule->getVar('mid')] > );
/** Directory where the cached page will be saved */
$wgFileCacheDirectory XOOPS_CACHE_PATH."/".MEDIAWIKI_DIRNAME;
if(
$wgUseFileCache && !$xoopsUser && !file_exists($wgFileCacheDirectory)) { mkdir($wgFileCacheDirectory,0775); } # create if necessary

$wgShowIPinHeader    false# For non-logged in users

$wgEnableEmail true;
$wgEnableUserEmail true;

$wgEmergencyContact $xoopsConfig["adminmail"];
$wgPasswordSender    $xoopsConfig["adminmail"];

## For a detailed description of the following switches see
## http://meta.wikimedia.org/Enotif and http://meta.wikimedia.org/Eauthent
## There are many more options for fine tuning available see
## /includes/DefaultSettings.php
## UPO means: this is also a user preference option
$wgEnotifUserTalk true# UPO
$wgEnotifWatchlist true# UPO
$wgEmailAuthentication true;

$wgDBserver         XOOPS_DB_HOST;
$wgDBname           XOOPS_DB_NAME;
$wgDBuser           XOOPS_DB_USER;
$wgDBpassword       XOOPS_DB_PASS;
$wgDBprefix         $GLOBALS["xoopsDB"]->prefix(basename(dirname(__FILE__)))."_";//Cloneable
$wgDBtype           "mysql";
$wgDBport           "5432";

# Experimental charset support for MySQL 4.1/5.0.
/**
 * Enabling the parameter will call "SET NAMES 'utf8'" in database connection, which could cause conflicts with xoopsDB->conn,
 * so just disable it and leave MySQL 4.1/5.0 handling to XOOPS
 */
$wgDBmysql5 false;

## Shared memory settings
$wgMainCacheType CACHE_NONE;
$wgMemCachedServers = array();

## To enable image uploads, make sure the 'images' directory
## is writable, then set this to true:
$wgEnableUploads        true;
$wgUseImageResize        true;
# $wgUseImageMagick = true;
# $wgImageMagickConvertCommand = "/usr/bin/convert";

## If you want to use image uploads under safe mode,
## create the directories images/archive, images/thumb and
## images/temp, and make them all writable. Then uncomment
## this, if it's not already uncommented:
# $wgHashedUploadDirectory = false;

## If you have the appropriate support software installed
## you can enable inline LaTeX equations:
$wgUseTeX             false;
$wgMathPath         "{$wgUploadPath}/math";
$wgMathDirectory    "{$wgUploadDirectory}/math";
$wgTmpDirectory     "{$wgUploadDirectory}/tmp";

$wgLocalInterwiki   $wgSitename;

$wgLanguageCode strtolower(_LANGCODE);

//$wgProxyKey = "72eb0f8e1449e71e20d38d9a79d596a27d96c33f747de07872ce348049dae627";

## Default skin: you can change the default skin. Use the internal symbolic
## names, ie 'standard', 'nostalgia', 'cologneblue', 'monobook':
$wgDefaultSkin 'monobook';

## For attaching licensing metadata to pages, and displaying an
## appropriate copyright notice / icon. GNU Free Documentation
## License and Creative Commons licenses are supported so far.
$wgEnableCreativeCommonsRdf true;
$wgRightsPage ""# Set to the title of a wiki page that describes your license/copyright
$wgRightsUrl XOOPS_URL;
$wgRightsText $wgSitename;
$wgRightsIcon XOOPS_URL."/images/s_poweredby.gif";
# $wgRightsCode = ""; # Not yet used

$wgDiff3 "";

# When you make changes to this configuration file, this will make
# sure that cached pages are cleared.
$configdate gmdate'YmdHis', @filemtime__FILE__ ) );
$wgCacheEpoch max$wgCacheEpoch$configdate );

// TODO: convertor for Xoops group -> mediawiki group
// Implicit group for all visitors
$wgGroupPermissions['*'    ]['createaccount']   = true;
$wgGroupPermissions['*'    ]['read']            = true;
$wgGroupPermissions['*'    ]['edit']            = false;
$wgGroupPermissions['*'    ]['createpage']      = false;
$wgGroupPermissions['*'    ]['createtalk']      = false;

// Implicit group for all logged-in accounts
$wgGroupPermissions['user' ]['move']            = true;
$wgGroupPermissions['user' ]['read']            = true;
$wgGroupPermissions['user' ]['edit']            = true;
$wgGroupPermissions['user' ]['createpage']      = true;
$wgGroupPermissions['user' ]['createtalk']      = true;
$wgGroupPermissions['user' ]['upload']          = true;
$wgGroupPermissions['user' ]['reupload']        = true;
$wgGroupPermissions['user' ]['reupload-shared'] = true;
$wgGroupPermissions['user' ]['minoredit']       = true;

// Implicit group for accounts that pass $wgAutoConfirmAge
$wgGroupPermissions['autoconfirmed']['autoconfirmed'] = true;

// Users with bot privilege can have their edits hidden
// from various log pages by default
$wgGroupPermissions['bot'  ]['bot']             = true;
$wgGroupPermissions['bot'  ]['autoconfirmed']   = true;

// Most extra permission abilities go to this group
$wgGroupPermissions['sysop']['block']           = true;
$wgGroupPermissions['sysop']['createaccount']   = true;
$wgGroupPermissions['sysop']['delete']          = true;
$wgGroupPermissions['sysop']['deletedhistory']  = true// can view deleted history entries, but not see or restore the text
$wgGroupPermissions['sysop']['editinterface']   = true;
$wgGroupPermissions['sysop']['import']          = true;
$wgGroupPermissions['sysop']['importupload']    = true;
$wgGroupPermissions['sysop']['move']            = true;
$wgGroupPermissions['sysop']['patrol']          = true;
$wgGroupPermissions['sysop']['protect']         = true;
$wgGroupPermissions['sysop']['rollback']        = true;
$wgGroupPermissions['sysop']['upload']          = true;
$wgGroupPermissions['sysop']['reupload']        = true;
$wgGroupPermissions['sysop']['reupload-shared'] = true;
$wgGroupPermissions['sysop']['unwatchedpages']    = true;
$wgGroupPermissions['sysop']['autoconfirmed']   = true;

// Permission to change users' group assignments
$wgGroupPermissions['bureaucrat']['userrights'] = true;

// Experimental permissions, not ready for production use
//$wgGroupPermissions['sysop']['deleterevision'] = true;
//$wgGroupPermissions['bureaucrat']['hiderevision'] = true;

/**
 * Set an offset from UTC in hours to use for the default timezone setting
 * for anonymous users and new user accounts.
 *
 */
$timeoffset_xoops = empty($xoopsUser)?$xoopsConfig['default_TZ']:$xoopsUser->getVar("timezone_offset");
$wgLocalTZoffset = @(floatval($timeoffset_xoops) + floatval($xoopsConfig['server_TZ']));

/* Installing this extension may lead to security and technical problems
 * as well as data corruption.
 */
require_once("extensions/FCKeditor.php");

$wgFCKUseEditor          true;      // When set to 'true' the FCKeditor is the default editor.
$wgFCKEditorDir          XOOPS_URL."/class/xoopseditor/FCKeditor";
$wgFCKEditorToken        "__USE_EDITOR__"
$wgFCKEditorToolbarSet   "Wiki";
$wgFCKEditorHeight       "600";
$wgFCKEditorAllow_a_tags      true// <a> </a>   : Set this to true if you want to use the **external** link
                                       // generator of the FCKeditor.
$wgFCKEditorAllow_img_tags    true// <img />    : Set this to true if you want to use the
                                       // file browser and/or the smilies of the FCKeditor.
$wgFCKexcludedNamespaces = array(8,1,-1);    // eg. "8" for disabling the editor within the MediaWiki namespace.

/**
 * Enable use of AJAX features.
 */
$wgUseAjax true;
$wgAjaxExportList[] = 'wfSajaxSearchImageFCKeditor';
?>

[编辑]
修改xoops_version.php文件
<?php
/**
 * Mediawiki module for XOOPS
 *
 * Integrating the mediawiki into XOOPS system
 *
 * @copyright    The XOOPS project http://www.xoops.org/
 * @license        http://www.fsf.org/copyleft/gpl.html GNU public license
 * @author        Taiwen Jiang (phppp or D.J.) <[email protected]>
 * @since        1.58
 * @version        $Id$
 * @package        module
 */
if( ! defined'XOOPS_ROOT_PATH' ) ) exit ;

$modversion['name'] = _MI_MEDIAWIKI_NAME;
$modversion['description'] = _MI_MEDIAWIKI_DESC;
$modversion['version'] = "1.71";
$modversion['credits'] = "MediaWiki DEV (http://wikimedia.org/); A.D.Horse (test, http://www.cctv3g.com)";
$modversion['author'] = "D.J. (phppp, http://xoops.org.cn, http://xoopsforge.com)";
$modversion['license'] = "GPL see LICENSE";
$modversion['image'] = "images/mediawiki.png";
$modversion['dirname'] = basename(dirname(__FILE__));//cloneable

// status
$modversion['codename'] = "";

$modversion['onInstall'] = 'include/action.module.php';
$modversion['onUpdate'] = 'include/action.module.php';

// Templates
$modversion['templates'][0]['file'] = basename(dirname(__FILE__)).'_content.html';//cloneable
$modversion['templates'][0]['description'] = '';

// Sql file (must contain sql generated by phpMyAdmin or phpPgAdmin)
//$modversion['sqlfile']['mysql'] = "";

$modversion['tables'] = array(
    
basename(dirname(__FILE__))."_user",//cloneable
    
basename(dirname(__FILE__))."_user_groups",//cloneable
    
basename(dirname(__FILE__))."_user_newtalk",//cloneable
    
basename(dirname(__FILE__))."_page",//cloneable
    
basename(dirname(__FILE__))."_revision",//cloneable
    
basename(dirname(__FILE__))."_text",//cloneable
    
basename(dirname(__FILE__))."_archive",//cloneable
    
basename(dirname(__FILE__))."_pagelinks",//cloneable
    
basename(dirname(__FILE__))."_imagelinks",//cloneable
    
basename(dirname(__FILE__))."_categorylinks",//cloneable
    
basename(dirname(__FILE__))."_site_stats",//cloneable
    
basename(dirname(__FILE__))."_hitcounter",//cloneable
    
basename(dirname(__FILE__))."_ipblocks",//cloneable
    
basename(dirname(__FILE__))."_image",//cloneable
    
basename(dirname(__FILE__))."_oldimage",//cloneable
    
basename(dirname(__FILE__))."_recentchanges",//cloneable
    
basename(dirname(__FILE__))."_watchlist",//cloneable
    
basename(dirname(__FILE__))."_math",//cloneable
    
basename(dirname(__FILE__))."_searchindex",//cloneable
    
basename(dirname(__FILE__))."_interwiki",//cloneable
    
basename(dirname(__FILE__))."_querycache",//cloneable
    
basename(dirname(__FILE__))."_objectcache",//cloneable
    //basename(dirname(__FILE__))."_validate",//cloneable
    
basename(dirname(__FILE__))."_logging",//cloneable
    
basename(dirname(__FILE__))."_trackbacks",//cloneable
    
basename(dirname(__FILE__))."_transcache",//cloneable
    
basename(dirname(__FILE__))."_externallinks",//cloneable
    
basename(dirname(__FILE__))."_job",//cloneable
    
basename(dirname(__FILE__))."_templatelinks",//cloneable
    
basename(dirname(__FILE__))."_langlinks",//cloneable
    
basename(dirname(__FILE__))."_filearchive",//cloneable
    
basename(dirname(__FILE__))."_querycache_info",//cloneable
    
);

// Search
$modversion['hasSearch'] = 1;
$modversion['search']['file'] = "include/search.php";
$modversion['search']['func'] = "mediawiki_search";

// Blocks
$i=0;
$modversion["blocks"] = array();

$i++;
$modversion["blocks"][$i]["file"] = "block.php";
$modversion["blocks"][$i]["name"] = _MI_MEDIAWIKI_BLOCK_RECENTCHANGES;
$modversion["blocks"][$i]["description"] = "";
$modversion["blocks"][$i]["show_func"] = "mediawiki_recentchanges_show";
$modversion["blocks"][$i]["options"] = "10"// MaxItems
$modversion["blocks"][$i]["edit_func"] = "mediawiki_recentchanges_edit";
$modversion["blocks"][$i]["template"] = basename(dirname(__FILE__))."_block_recentchanges.html";//cloneable

$i++;
$modversion["blocks"][$i]["file"] = "block.php";
$modversion["blocks"][$i]["name"] = _MI_MEDIAWIKI_BLOCK_TOP;
$modversion["blocks"][$i]["description"] = "";
$modversion["blocks"][$i]["show_func"] = "mediawiki_top_show";
$modversion["blocks"][$i]["options"] = "10"// MaxItems
$modversion["blocks"][$i]["edit_func"] = "mediawiki_top_edit";
$modversion["blocks"][$i]["template"] = basename(dirname(__FILE__))."_block_top.html";//cloneable

$i++;
$modversion["blocks"][$i]["file"] = "block.php";
$modversion["blocks"][$i]["name"] = _MI_MEDIAWIKI_BLOCK_HOT;
$modversion["blocks"][$i]["description"] = "";
$modversion["blocks"][$i]["show_func"] = "mediawiki_hot_show";
$modversion["blocks"][$i]["options"] = "10"// MaxItems
$modversion["blocks"][$i]["edit_func"] = "mediawiki_hot_edit";
$modversion["blocks"][$i]["template"] = basename(dirname(__FILE__))."_block_hot.html";//cloneable

//Admin things
$modversion['hasAdmin'] = 1;
$modversion['adminindex'] = "admin/index.php";
$modversion['adminmenu'] = "admin/menu.php";

$modversion['hasMain'] = 1;

$modversion['hasconfig'] = 1;

$modversion['config'][] = array(
    
'name'            => 'style' ,
    
'title'            => '_MI_MEDIAWIKI_STYLE' ,
    
'description'    => '_MI_MEDIAWIKI_STYLE_DESC' ,
    
'formtype'        => 'select' ,
    
'valuetype'        => 'int' ,
    
'default'        => 0,
    
'options'        => array("XOOPS"=>1"mediawiki"=>2"Selectable"=>0)
);
?>

[编辑]
修改include/action.module.php文件
<?php
/**
 * Mediawiki module for XOOPS
 *
 * @copyright    The XOOPS project http://www.xoops.org/
 * @license        http://www.fsf.org/copyleft/gpl.html GNU public license
 * @author        Taiwen Jiang (phppp or D.J.) <[email protected]>
 * @since        1.58
 * @version        $Id$
 * @package        module
 */
//begin cloneable
$original_dirname "mediawiki";
$module_dir dirname(dirname(__FILE__));
$module_dirname basename($module_dir);
if(
$original_dirname !== $module_dirname) {
    eval(
"function xoops_module_install_".$module_dirname."(&$module) {xoops_module_install_mediawiki(&$module);};");
    eval(
"function xoops_module_update_".$module_dirname."(&$module) {xoops_module_update_mediawiki(&$module);};");
}
//end cloneable
function xoops_module_install_mediawiki(&$module)
{
    
header("location: ".XOOPS_URL."/modules/".$module->getVar("dirname")."/admin/install.mediawiki.php?mid=".$module->getVar("mid"));
    return 
true;
}

function 
xoops_module_update_mediawiki(&$module$oldversion null)
{
    
header("location: ".XOOPS_URL."/modules/".$module->getVar("dirname")."/admin/update.mediawiki.php?mid=".$module->getVar("mid"));
    return 
true;
}
?>

[编辑]
增加pre.install.php临时文件
<?php
$original_dirname 
"mediawiki";
$module_dir dirname(__FILE__);
$module_dirname basename($module_dir);
if (
$module_dirname !== $original_dirname) {
    
$template_list scandir($module_dir."/templates/");
    foreach(
$template_list as $template) {
        if (
false === is_dir($module_dir."/templates/".$template)) {
            if (
substr($template0strlen($original_dirname) + 1) === $original_dirname."_") {
                
copy($module_dir."/templates/".$template,
                     
$module_dir."/templates/".substr_replace($template$module_dirnamestrpos($template$original_dirname), strlen($original_dirname)));
            }
        }
    }
    
$block_list scandir($module_dir."/templates/blocks/");
    foreach(
$block_list as $block) {
        if (
false === is_dir($module_dir."/templates/blocks/".$block)) {
            if (
substr($block0strlen($original_dirname) + 1) === $original_dirname."_") {
                
copy($module_dir."/templates/blocks/".$block,
                     
$module_dir."/templates/blocks/".substr_replace($block$module_dirnamestrpos($block$original_dirname), strlen($original_dirname)));
            }
        }
    }
}
?>

请在克隆后上传该文件到模块根目录,并运行,运行后请及时删除。

1/31 17:40
工具箱 短消息 Email 书签 打印 WordPress 举报 回顶部


回复: 安装两套mediawiki怎么设置一下?大侠请进
新进会员
注册日期:
12/29 19:52
所属群组:
注册会员
帖子: 20 | 精华: 1
等级: 3; EXP: 20
HP: 0 / 55
MP: 6 / 19
离线
谢谢上面二位指点,安装显示成功:Version: 1.71
Author: D.J. (phppp, http://xoops.org.cn, http://xoopsforge.com)

Module data inserted successfully. Module ID: 13
Adding templates...
Template mediawiki2_content.html added to the database. (ID: 378)
Template mediawiki2_content.html compiled.
Adding blocks...
Block MediaWiki 最近更新 added. Block ID: 51
Block 热点条目 added. Block ID: 52
Block Wiki热点 added. Block ID: 53
Adding module config data...
Config style added to the database.
Config option added. Name: XOOPS Value: 1
Config option added. Name: mediawiki Value: 2
Config option added. Name: Selectable Value: 0
Setting group rights...
Added admin access right for Group ID 1
Added user access right for Group ID: 1
Added block access right. Block ID: 52 Group ID: 1
Added block access right. Block ID: 53 Group ID: 1
Added block access right. Block ID: 51 Group ID: 1
Added user access right for Group ID: 2
Added block access right. Block ID: 52 Group ID: 2
Added block access right. Block ID: 53 Group ID: 2
Added block access right. Block ID: 51 Group ID: 2

模块 MediaWiki 安装成功。


回到模块管理页面



但是,进入管理发现问题:



A database error has occurred
Query: SELECT user_name,user_password,user_newpassword,user_email,user_email_authenticated,user_real_name,user_options,user_touched,user_token,user_registration FROM `xoops_mediawiki2_user` WHERE user_id = '1' LIMIT 1
Function: User::loadFromDatabase
Error: 1146 Table 'vklecom_vggu.xoops_mediawiki2_user' doesn't exist (localhost)

2/2 20:18
工具箱 短消息 Email 书签 打印 WordPress 举报 回顶部


回复: 安装两套mediawiki怎么设置一下?大侠请进
新进会员
注册日期:
12/29 19:52
所属群组:
注册会员
帖子: 20 | 精华: 1
等级: 3; EXP: 20
HP: 0 / 55
MP: 6 / 19
离线
卸载后发现红色部分(应该是数据库未创建)
Deleting templates...
Template mediawiki2_content.html deleted from the database. Template ID: 378
Deleting block...
Block 热点条目 deleted. Block ID: 52
Block Wiki热点 deleted. Block ID: 53
Block MediaWiki 最近更新 deleted. Block ID: 51
Deleting module tables...
ERROR: Could not drop table xoops_mediawiki2_user.
ERROR: Could not drop table xoops_mediawiki2_user_groups.
ERROR: Could not drop table xoops_mediawiki2_user_newtalk.
ERROR: Could not drop table xoops_mediawiki2_page.
ERROR: Could not drop table xoops_mediawiki2_revision.
ERROR: Could not drop table xoops_mediawiki2_text.
ERROR: Could not drop table xoops_mediawiki2_archive.
ERROR: Could not drop table xoops_mediawiki2_pagelinks.
ERROR: Could not drop table xoops_mediawiki2_imagelinks.
ERROR: Could not drop table xoops_mediawiki2_categorylinks.
ERROR: Could not drop table xoops_mediawiki2_site_stats.
ERROR: Could not drop table xoops_mediawiki2_hitcounter.
ERROR: Could not drop table xoops_mediawiki2_ipblocks.
ERROR: Could not drop table xoops_mediawiki2_image.
ERROR: Could not drop table xoops_mediawiki2_oldimage.
ERROR: Could not drop table xoops_mediawiki2_recentchanges.
ERROR: Could not drop table xoops_mediawiki2_watchlist.
ERROR: Could not drop table xoops_mediawiki2_math.
ERROR: Could not drop table xoops_mediawiki2_searchindex.
ERROR: Could not drop table xoops_mediawiki2_interwiki.
ERROR: Could not drop table xoops_mediawiki2_querycache.
ERROR: Could not drop table xoops_mediawiki2_objectcache.
ERROR: Could not drop table xoops_mediawiki2_logging.
ERROR: Could not drop table xoops_mediawiki2_trackbacks.
ERROR: Could not drop table xoops_mediawiki2_transcache.
ERROR: Could not drop table xoops_mediawiki2_externallinks.
ERROR: Could not drop table xoops_mediawiki2_job.
ERROR: Could not drop table xoops_mediawiki2_templatelinks.
ERROR: Could not drop table xoops_mediawiki2_langlinks.
ERROR: Could not drop table xoops_mediawiki2_filearchive.
ERROR: Could not drop table xoops_mediawiki2_querycache_info.
Group permissions deleted

Deleting module config options...
Config data deleted from the database. Config ID: 289

模块 MediaWiki 卸载成功。

2/2 20:22
工具箱 短消息 Email 书签 打印 WordPress 举报 回顶部


回复: 安装两套mediawiki怎么设置一下?大侠请进
Support Team
注册日期:
2006/6/26 10:17
来自 北京
所属群组:
注册会员
Dev+Hack
帖子: 427
等级: 19; EXP: 20
HP: 182 / 455
MP: 142 / 837
离线
修改LocalSettings.php文件
本文件修改了MediaWiki数据库表名的前缀,所修改的代码行已用Cloneable标记出。
<?php
/**
 * Config file for mediawiki
 *
 * The file is composed of XOOPS basic preferences and mediawiki LocalSettings.php
 * You are not supposed to change most of the parameters
 *
 * @copyright    The XOOPS project http://www.xoops.org/
 * @license        http://www.fsf.org/copyleft/gpl.html GNU public license
 * @author        Taiwen Jiang (phppp or D.J.) <[email protected]>
 * @since        1.58
 * @version        $Id$
 * @package        module::mediawiki
 */
 
global $xoopsUser$xoopsModule$xoopsConfig$xoopsOption$xoopsLogger$xoopsTpl;
global 
$wgUsePathInfo;

# If PHP's memory limit is very low, some operations may fail.
@ini_set'memory_limit''20M' );

$mainfile dirname(dirname(dirname(__FILE__)))."/mainfile.php";
include_once 
$mainfile;
define("MEDIAWIKI_DIRNAME"basename(dirname(__FILE__)));
require_once(
XOOPS_ROOT_PATH."/modules/".MEDIAWIKI_DIRNAME."/include/functions.php");

if(!
defined("NS_MAIN")) {
    require_once(
XOOPS_ROOT_PATH."/modules/".MEDIAWIKI_DIRNAME."/includes/Defines.php");
}

// define user name prefix for the module, must be capitalized!
define("MEDIAWIKI_USERPREFIX""Xo.");

# This file was automatically generated by the MediaWiki installer.
# If you make manual changes, please keep track in case you need to
# recreate them later.

# If you customize your file layout, set $IP to the directory that contains
# the other MediaWiki files. It will be used as a base to locate files.
if( defined'MW_INSTALL_PATH' ) ) {
    
$IP MW_INSTALL_PATH;
} else {
    
$IP dirname__FILE__ );
}

$path = array( $IP"$IP/includes""$IP/languages" );
set_include_pathimplodePATH_SEPARATOR$path ) . PATH_SEPARATOR get_include_path() );

require_once( 
"includes/DefaultSettings.php" );

/** We speak UTF-8 all the time now, unless some oddities happen */
//$wgInputEncoding    = 'UTF-8';
$wgOutputEncoding    = empty($GLOBALS["xlanguage"]['charset_base'])?_CHARSET:$GLOBALS["xlanguage"]['charset_base'];
//$wgEditEncoding        = '';

if ( $wgCommandLineMode ) {
    if ( isset( 
$_SERVER ) && array_key_exists'REQUEST_METHOD'$_SERVER ) ) {
        
//die( "This script must be run from the command linen" );
    
}
} elseif ( empty( 
$wgNoOutputBuffer ) ) {
    
## Compress output if the browser supports it
    //if( !ini_get( 'zlib.output_compression' ) ) @ob_start( 'ob_gzhandler' );
}

$wgSitename         mediawiki_encoding_xoops2mediawiki($xoopsConfig["sitename"]);

$wgServer preg_replace'{^(http[s]?://[^/]*).*$}''$1'XOOPS_URL );
$wgInternalServer $wgServer;

$ScriptPath str_replace$wgServer''XOOPS_URL."/modules/".MEDIAWIKI_DIRNAME ); # was SCRIPT_NAME
$wgScriptPath        $ScriptPath;
$wgScript           "$wgScriptPath/index.php";
$wgRedirectScript   "$wgScriptPath/redirect.php";

## For more information on customizing the URLs please see:
## http://meta.wikimedia.org/wiki/Eliminating_index.php_from_the_url
## If using PHP as a CGI module, the ?title= style usually must be used.
if($wgUsePathInfo){
    
$wgArticlePath      "$wgScript/$1";
   
    
// $_SERVER['PATH_INFO'] used in WebRequest::WebRequest() would escape trailing "delimitors"
    
if(!empty($_SERVER['PATH_INFO'])){
        if(
preg_match("/([.?]+)$/"$_SERVER['REQUEST_URI'], $matches)){
            
$_SERVER['PATH_INFO'] .= $matches[1];
        }
    }
}else{
    
$wgArticlePath      "$wgScript?title=$1";
}
$wgStylePath        "$wgScriptPath/skins";
$wgStyleDirectory   "$IP/skins";
$wgLogo             "$wgScriptPath/images/mediawiki.png";

$wgUploadPath       str_replace$wgServer''XOOPS_UPLOAD_URL )."/".MEDIAWIKI_DIRNAME;
$wgUploadDirectory  XOOPS_UPLOAD_PATH."/".MEDIAWIKI_DIRNAME;

/**
 * This will cache static pages for non-logged-in users to reduce
 * database traffic on public sites.
 * Must set $wgShowIPinHeader = false
 */
$wgUseFileCache = @(mediawiki_getStyle())?false: ( is_object($xoopsModule) && $xoopsModule->getVar('dirname') == MEDIAWIKI_DIRNAME && @$xoopsConfig['module_cache'][$xoopsModule->getVar('mid')] > );
/** Directory where the cached page will be saved */
$wgFileCacheDirectory XOOPS_CACHE_PATH."/".MEDIAWIKI_DIRNAME;
if(
$wgUseFileCache && !$xoopsUser && !file_exists($wgFileCacheDirectory)) { mkdir($wgFileCacheDirectory,0775); } # create if necessary

$wgShowIPinHeader    false# For non-logged in users

$wgEnableEmail true;
$wgEnableUserEmail true;

$wgEmergencyContact $xoopsConfig["adminmail"];
$wgPasswordSender    $xoopsConfig["adminmail"];

## For a detailed description of the following switches see
## http://meta.wikimedia.org/Enotif and http://meta.wikimedia.org/Eauthent
## There are many more options for fine tuning available see
## /includes/DefaultSettings.php
## UPO means: this is also a user preference option
$wgEnotifUserTalk true# UPO
$wgEnotifWatchlist true# UPO
$wgEmailAuthentication true;

$wgDBserver         XOOPS_DB_HOST;
$wgDBname           XOOPS_DB_NAME;
$wgDBuser           XOOPS_DB_USER;
$wgDBpassword       XOOPS_DB_PASS;
$wgDBprefix         $GLOBALS["xoopsDB"]->prefix(basename(dirname(__FILE__)))."_";//Cloneable
$wgDBtype           "mysql";
$wgDBport           "5432";

# Experimental charset support for MySQL 4.1/5.0.
/**
 * Enabling the parameter will call "SET NAMES 'utf8'" in database connection, which could cause conflicts with xoopsDB->conn,
 * so just disable it and leave MySQL 4.1/5.0 handling to XOOPS
 */
$wgDBmysql5 false;

## Shared memory settings
$wgMainCacheType CACHE_NONE;
$wgMemCachedServers = array();

## To enable image uploads, make sure the 'images' directory
## is writable, then set this to true:
$wgEnableUploads        true;
$wgUseImageResize        true;
# $wgUseImageMagick = true;
# $wgImageMagickConvertCommand = "/usr/bin/convert";

## If you want to use image uploads under safe mode,
## create the directories images/archive, images/thumb and
## images/temp, and make them all writable. Then uncomment
## this, if it's not already uncommented:
# $wgHashedUploadDirectory = false;

## If you have the appropriate support software installed
## you can enable inline LaTeX equations:
$wgUseTeX             false;
$wgMathPath         "{$wgUploadPath}/math";
$wgMathDirectory    "{$wgUploadDirectory}/math";
$wgTmpDirectory     "{$wgUploadDirectory}/tmp";

$wgLocalInterwiki   $wgSitename;

$wgLanguageCode strtolower(_LANGCODE);

//$wgProxyKey = "72eb0f8e1449e71e20d38d9a79d596a27d96c33f747de07872ce348049dae627";

## Default skin: you can change the default skin. Use the internal symbolic
## names, ie 'standard', 'nostalgia', 'cologneblue', 'monobook':
$wgDefaultSkin 'monobook';

## For attaching licensing metadata to pages, and displaying an
## appropriate copyright notice / icon. GNU Free Documentation
## License and Creative Commons licenses are supported so far.
$wgEnableCreativeCommonsRdf true;
$wgRightsPage ""# Set to the title of a wiki page that describes your license/copyright
$wgRightsUrl XOOPS_URL;
$wgRightsText $wgSitename;
$wgRightsIcon XOOPS_URL."/images/s_poweredby.gif";
# $wgRightsCode = ""; # Not yet used

$wgDiff3 "";

# When you make changes to this configuration file, this will make
# sure that cached pages are cleared.
$configdate gmdate'YmdHis', @filemtime__FILE__ ) );
$wgCacheEpoch max$wgCacheEpoch$configdate );

// TODO: convertor for Xoops group -> mediawiki group
// Implicit group for all visitors
$wgGroupPermissions['*'    ]['createaccount']   = true;
$wgGroupPermissions['*'    ]['read']            = true;
$wgGroupPermissions['*'    ]['edit']            = false;
$wgGroupPermissions['*'    ]['createpage']      = false;
$wgGroupPermissions['*'    ]['createtalk']      = false;

// Implicit group for all logged-in accounts
$wgGroupPermissions['user' ]['move']            = true;
$wgGroupPermissions['user' ]['read']            = true;
$wgGroupPermissions['user' ]['edit']            = true;
$wgGroupPermissions['user' ]['createpage']      = true;
$wgGroupPermissions['user' ]['createtalk']      = true;
$wgGroupPermissions['user' ]['upload']          = true;
$wgGroupPermissions['user' ]['reupload']        = true;
$wgGroupPermissions['user' ]['reupload-shared'] = true;
$wgGroupPermissions['user' ]['minoredit']       = true;

// Implicit group for accounts that pass $wgAutoConfirmAge
$wgGroupPermissions['autoconfirmed']['autoconfirmed'] = true;

// Users with bot privilege can have their edits hidden
// from various log pages by default
$wgGroupPermissions['bot'  ]['bot']             = true;
$wgGroupPermissions['bot'  ]['autoconfirmed']   = true;

// Most extra permission abilities go to this group
$wgGroupPermissions['sysop']['block']           = true;
$wgGroupPermissions['sysop']['createaccount']   = true;
$wgGroupPermissions['sysop']['delete']          = true;
$wgGroupPermissions['sysop']['deletedhistory']  = true// can view deleted history entries, but not see or restore the text
$wgGroupPermissions['sysop']['editinterface']   = true;
$wgGroupPermissions['sysop']['import']          = true;
$wgGroupPermissions['sysop']['importupload']    = true;
$wgGroupPermissions['sysop']['move']            = true;
$wgGroupPermissions['sysop']['patrol']          = true;
$wgGroupPermissions['sysop']['protect']         = true;
$wgGroupPermissions['sysop']['rollback']        = true;
$wgGroupPermissions['sysop']['upload']          = true;
$wgGroupPermissions['sysop']['reupload']        = true;
$wgGroupPermissions['sysop']['reupload-shared'] = true;
$wgGroupPermissions['sysop']['unwatchedpages']    = true;
$wgGroupPermissions['sysop']['autoconfirmed']   = true;

// Permission to change users' group assignments
$wgGroupPermissions['bureaucrat']['userrights'] = true;

// Experimental permissions, not ready for production use
//$wgGroupPermissions['sysop']['deleterevision'] = true;
//$wgGroupPermissions['bureaucrat']['hiderevision'] = true;

/**
 * Set an offset from UTC in hours to use for the default timezone setting
 * for anonymous users and new user accounts.
 *
 */
$timeoffset_xoops = empty($xoopsUser)?$xoopsConfig['default_TZ']:$xoopsUser->getVar("timezone_offset");
$wgLocalTZoffset = @(floatval($timeoffset_xoops) + floatval($xoopsConfig['server_TZ']));

/* Installing this extension may lead to security and technical problems
 * as well as data corruption.
 */
require_once("extensions/FCKeditor.php");

$wgFCKUseEditor          true;      // When set to 'true' the FCKeditor is the default editor.
$wgFCKEditorDir          XOOPS_URL."/class/xoopseditor/FCKeditor";
$wgFCKEditorToken        "__USE_EDITOR__"
$wgFCKEditorToolbarSet   "Wiki";
$wgFCKEditorHeight       "600";
$wgFCKEditorAllow_a_tags      true// <a> </a>   : Set this to true if you want to use the **external** link
                                       // generator of the FCKeditor.
$wgFCKEditorAllow_img_tags    true// <img />    : Set this to true if you want to use the
                                       // file browser and/or the smilies of the FCKeditor.
$wgFCKexcludedNamespaces = array(8,1,-1);    // eg. "8" for disabling the editor within the MediaWiki namespace.

/**
 * Enable use of AJAX features.
 */
$wgUseAjax true;
$wgAjaxExportList[] = 'wfSajaxSearchImageFCKeditor';
?>

2/4 5:34
工具箱 短消息 Email 书签 打印 WordPress 举报 回顶部





可以查看帖子。
不可发帖。
不可回复。
不可编辑自己的帖子。
不可删除自己的帖子。
不可发起投票调查。
不可在投票调查中投票。
不可上传附件。
不可不经审核直接发帖。
不可使用主题类别。
不可以使用HTML语法。
不可以使用签名档。

[高级搜索]