PHP

设置MediaWiki页脚

字号+ 编辑: 种花家 修订: 种花家 来源: 站长百科 2023-09-11 我要说两句(0)

MediaWiki是个人博客建站者喜闻乐见的一套系统,可是调整起界面来不像普通MVC框架那么好搞,本文讲解如何修改其中的页脚。

页脚文字设置

在Mediawiki的的模板中,例如/skins/MonoBook.php,页脚是通过下面的代码设置的:

$footerlinks = array(
    'lastmod',
    'viewcount',
    'numberofwatchingusers',
    'credits',
    'copyright',
    'privacy',
    'about',
    'disclaimer',
    'tagline',
);

根据需要可以添加和删除上面的每一项内容。下面具体说明每一项的含义以及设置方法:

lastmod - 最后修订,通过编辑 MediaWiki:Lastmodifiedat (版本 1.8 或更新) 或者 MediaWiki:Lastmodified (版本 1.7 and 更老)来修改显示的内容. 如果$wgMaxCredits 启用(设置要显示几位最后的编辑者), 那么通过编辑 MediaWiki:Lastmodifiedatby (verison 1.8 and after) 或者 MediaWiki:Lastmodifiedby (version 1.7 and before)来修改。$wgMaxCredits 不启用,仅显示最后的修正日期,启用以后会显示最后的修正日期已经最后几位编辑者(显示几位编辑者通过$wgMaxCredits设置)。

viewcount - 页面的浏览次数,通过编辑 MediaWiki:Viewcount页面来修改。

numberofwatchingusers - 关注用户,通过编辑 MediaWiki:Number 来修改显示方式. 只有在LocalSettings.php中设置 $wgPageShowWatchingUsers = true; 以后才会显示这项内容。

copyright - 版权edit MediaWiki:Copyright. The parameter $1 on that page is replaced with a link to the details of copyright for your wiki. In LocalSettings.php $wgRightsText for the link text and set either $wgRightsPage or $wgRightsUrl with the location of a wiki page or external URL.

privacy - 隐私政策this is a link only. Edit MediaWiki:Privacy for the link text and MediaWiki:Privacypage for the wiki page to which to link.

about -关于 this is a link only. Edit MediaWiki:Aboutsite for the link text and MediaWiki:Aboutpage for the wiki page to which to link.

disclaimer - 免责声明this is a link only. Edit MediaWiki:Disclaimers for the link text and MediaWiki:Disclaimerpage for the wiki page to which to link.

tagline - 目前没有使用

页脚图片设置

左侧图片: copyright图标, 通过$wgCopyrightIcon进行设置,设置方法如下:

在网站根目录所在的配置文件LocalSettings.php中设置$wgCopyrightIcon,例如:

$wgCopyrightIcon = '<a href="http://www.wkwkk.com"><img src="images/logo.gif" width="117" height="37" alt="我看" /></a>';

设置的时候注意内层和外层不能同时用双引号,内层用单引号或者是外层用单引号,否则会引起unexpected T_CONSTANT_ENCAPSED_STRING 的错误。

右侧图片: poweredby图标

阅完此文,您的感想如何?
  • 有用

    1

  • 没用

    1

  • 开心

    2

  • 愤怒

    1

  • 可怜

    1

1.如文章侵犯了您的版权,请发邮件通知本站,该文章将在24小时内删除;
2.本站标注原创的文章,转发时烦请注明来源;
3.交流群: PHP+JS聊天群

相关课文
  • mac开发接入微信公众号接口返回报错 cURL error 56: SSLRead() return error -9806

  • pecl安装程序时报错Array and string offset access syntax with curly braces is no longer supported

  • PHP的换行符是什么

  • 由于商家传入的H5交易参数有误,该笔交易暂时无法完成,请联系商家解决

我要说说
网上宾友点评