mediawiki 常见配置功能

1.修改默认logo

mediawiki站点默认logo图片路径名:$WIKI_HOME/skins/common/images/wiki.png,可以通过以下两种方式修改默认logo:

(1)用图片编辑工作打开wiki.png图片,进行修改后覆盖即可;或者自己新建一个135 x 135像素,图片格式为.png的同名图片覆盖即可,建议使用透明背景,否则将严重影响视觉效果。

(2)将logo文件放在目录$WIKI_HOME/skins/common/images下,再在根目录下打开 LocalSettings.php文件,找到$wgLogo= "$wgStylePath/common/images/wiki.png",修改为$wglogo="$wgStylePath/common /images/logo文件名"

注:可以使用默认logo图片同目录下的mediawiki.png替代。

 

#个人wiki,禁止创建帐号功能,除非登陆才能访问

$wgGroupPermissions['*']['createaccount'] = false;

$wgGroupPermissions['*']['edit'] = false;

$wgGroupPermissions['*']['read'] = false;

   

#启用详细异常显示.

$wgShowExceptionDetails = true;

#去除底部powered by图标

unset($wgFooterIcons['poweredby']);

#增加网站访问统计(51la)

1.找到\includes\skins\Skin.php并打开,找到bottomScripts这个函数,修改$extraHtml为要添加的代码

2.找到皮肤模板文件(例如\skins\Vector\includes\VectorTemplate.php)在</body>和</html>之间增加代码

#底部footerlinker设置

As of 1.17 and after you can modify the list of links in the footer using the SkinTemplateOutputPageBeforeExec to modify the footerlinks arrays and setting new template keys for the values.

For example, putting this in your LocalSettings.php file will add a new "Terms of Use" link after the disclaimer link.

$wgHooks['SkinTemplateOutputPageBeforeExec'][] = function( $sk, &$tpl ) {
	$tpl->set( 'termsofuse', $sk->footerLink( 'termsofuse', 'termsofusepage' ) );
    // or to add non-link text:
    $tpl->set( 'footertext', 'Text to show in footer' );
	$tpl->data['footerlinks']['places'][] = 'termsofuse';
	return true;
};

From there you can put "Terms of Use" in the page MediaWiki:Termsofuse on your wiki, for the link's text and in MediaWiki:Termsofusepage define the title of the page that you want the Terms of Use link to point to. Note, if you do not create these pages on your wiki, then nothing will appear in the footer.

#隐藏工具栏Toolbox

文件:skins\Vector\VectorTemplate.php 中,case 'TOOLBox' 条件执行语句中加入 if ( $this->data['loggedin'] ) 判断,如下:

 

case 'TOOLBOX':

    if ( $this->data['loggedin'] ) {

        $this->renderPortal( 'tb', $this->getToolbox(), 'toolbox', 'SkinTemplateToolboxEnd' );

    }

posted @ 2019-04-25 14:54  黑水龙虾  阅读(1402)  评论(0编辑  收藏  举报