扩展:DismissableSiteNotice

This page is a translated version of the page Extension:DismissableSiteNotice and the translation is 56% complete.
Other languages:
English • ‎中文 • ‎日本語
MediaWiki扩展手册
OOjs UI icon advanced.svg
DismissableSiteNotice
发布状态: 稳定版
实现 皮肤 , 我的Wiki
描述 允许用户关闭站点通知
作者 Brion Vibber (Brion VIBBERtalk)
最新版本 continuous updates
兼容性方针 发行分支
MediaWiki 1.25+
数据庫更新
许可协议 GNU通用公眾授權條款2.0或更新版本
下载
例子 Wikimedia sites
  • $wgMajorSiteNoticeID
  • $wgDismissableSiteNoticeForAnons
翻译DismissableSiteNotice扩展如果在translatewiki.net可用
检查使用和版本矩阵。
问题 开放的工作 · 报告错误

The DismissableSiteNotice extension allows users to close the sitenotice, using cookies.

安装

  • 下载文件,并将其放置在您extensions/文件夹中的DismissableSiteNotice目录内。

致使用MediaWiki 1.25或更早版本的用户:

上面的说明介绍的是安装此扩展的新方法,它使用wfLoadExtension()。 如果您需要在早期版本(MediaWiki 1.25和更早版本)中安装此扩展,而不是wfLoadExtension( 'DismissableSiteNotice' );,您需要使用:

require_once "$IP/extensions/DismissableSiteNotice/DismissableSiteNotice.php";

配置

该扩展提供了两个配置参数:

$wgMajorSiteNoticeID

整数。 The value is stored inside a cookie. When a user decides to close the sitenotice, the current value of $wgMajorSiteNoticeID is saved as well and the closed notice is not shown again. $wgMajorSiteNoticeID now can be incremented when a new text is set up as sitenotice. If $wgMajorSiteNoticeID has inbetween been incremented, then the sitenotice is shown again, even if the user closed an older sitenotice before.

$wgDismissableSiteNoticeForAnons

This allows to set whether or not it should be possible for anonymous visitors of the wiki to dismiss the sitenotice shown. 默认为“false”。 适用于MW 1.25 +

用法

When you add a new sitenotice and want everyone to see it, change the number on the created page "MediaWiki:Sitenotice id" by one (e.g. if it would be 5, you'd replace the page with the number 6 and so on).

The extension behavior is that it will remember the dismissal by the user and only reset after the number in MediaWiki:sitenotice_id has been raised. This allows a wiki to make minor updates to a notice without causing it to show again for everybody.