Jump to content

扩展:DismissableSiteNotice

From mediawiki.org
This page is a translated version of the page Extension:DismissableSiteNotice and the translation is 71% complete.
MediaWiki扩展手册
DismissableSiteNotice
发行状态: 稳定版
实现 皮肤 , MyWiki
描述 允许用户关闭站点通知
作者 Brooke Vibber留言
最新版本 continuous updates
兼容性政策 快照跟随MediaWiki发布。 master分支不向后兼容。
数据库更改
许可协议 GNU通用公眾授權條款2.0或更新版本
下載
  • $wgMajorSiteNoticeID
  • $wgDismissableSiteNoticeForAnons
前往translatewiki.net翻譯DismissableSiteNotice扩展
問題 开启的任务 · 报告错误

DismissableSiteNotice扩展允许用户通过cookies关闭站点通知

安装

  • 下载文件,并解压DismissableSiteNotice文件夹到extensions/目录中。
    开发者和代码贡献人员应改从Git安装此扩展,输入:
    cd extensions/
    git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/DismissableSiteNotice
    
  • 請新增下列代码到您的LocalSettings.php 文件的底部:
    wfLoadExtension( 'DismissableSiteNotice' );
    
  • 按需求配置。
  • Yes 完成 – 請导航至您的wiki上的Special:Version,以验证此扩展已成功安装。

配置

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

$wgMajorSiteNoticeID
整数。 该值被保存于cookie中。 当用户关闭站点通知时,当前的$wgMajorSiteNoticeID会被保存,并且被关闭的通知将不再显示。 $wgMajorSiteNoticeID可以在新的站点通知被设置时增加。 If $wgMajorSiteNoticeID has in-between been incremented, then the site notice is shown again, even if the user closed an older site notice before.
$wgDismissableSiteNoticeForAnons
This allows setting whether or not it should be possible for anonymous visitors of the wiki to dismiss the site notice shown. 默认值为“false”。 适用于MW 1.25 +

用法

When you add a new site notice 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. 这允许一个维基对通知进行小编辑而不导致它重新显示给所有人。