zoukankan      html  css  js  c++  java
  • 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.找到includesskinsSkin.php并打开,找到bottomScripts这个函数,修改$extraHtml为要添加的代码

    2.找到皮肤模板文件(例如skinsVectorincludesVectorTemplate.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

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

    case 'TOOLBOX':

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

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

        }

  • 相关阅读:
    phpcms v9模板制作常用代码集合
    phpcms v9模板制作教程
    cookie 和session 的区别
    PHP的加密方式
    php基础
    复习 语句
    empty 和 isset的区别和联系
    MySQL数据库引擎介绍、区别、创建和性能测试的深入分析
    ThinkPHP增删改查--改
    使用ajax提交form表单,包括ajax文件上传
  • 原文地址:https://www.cnblogs.com/w1618/p/10768430.html
Copyright © 2011-2022 走看看