跳到主要内容

设置

Favicon

$wgFavicon = "$wgScriptPath/path/to/your/favicon.ico";

或./favicon.ico,直接放在根目录放上

新窗口打开

$wgExternalLinkTarget = '_blank';

图片的链接地址

图片的链接地址,使用[[File:PHP.jpg|35px|PHP|link=PHP]]的话,那么链接会是http://www.php.sx/index.php?title=PHP,所以改为

[[File:PHP.jpg|35px|PHP|link={{SERVER}}/PHP]]

$wgCopyrightIcon = ' 小李世界';

折叠

边栏折叠效果

$wgVectorFeatures['expandablesearch'] = true;

添加统计

在配置文件中添加

$wgHooks['BeforePageDisplay'][] ='onBeforePageDisplay';

function onBeforePageDisplay( OutputPage &$out, Skin &$skin )
{
$script = '<script> var _hmt = _hmt || []; (function() { var hm = document.createElement("script"); hm.src = "//hm.baidu.com/hm.js?1f7a005d8b9d7b6985603864bbf3bb89"; var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(hm, s); })(); </script>';
$out->addHeadItem("wowhead script", $script);
return true;
};

隐藏"查看源代码"、"历史"、"讨论"


<!-- No [view source] tab for users who can not edit -->
<?php global $wgUser; if( !$wgUser->isAllowed('edit') ) { ?>
<style type="text/css">
#ca-viewsource { display: none !important; }
</style>
<?php } ?>

<!-- No [history] tab for users who can not edit -->
<?php global $wgUser; if( !$wgUser->isAllowed('edit') ) { ?>
<style type="text/css">
#ca-history { display: none !important; }
</style>
<?php } ?>

<!-- No [talk] tab for users who can not edit -->
<?php global $wgUser; if( !$wgUser->isAllowed('edit') ) { ?>
<style type="text/css">
#ca-talk { display: none !important; }
</style>
<?php } ?>

上传

与检测到的文件MIME类型(application/zip)不匹配

更改includes目录下的DefaultSettings.php文件,其中的 $wgVerifyMimeType = false

Debug

$wgShowExceptionDetails=true;

底部

参考