Extension:DismissableSiteNotice
|
DismissableSiteNotice Release status: stable |
|||
|---|---|---|---|
| Implementation | Skin | ||
| Description | Allows users to close the sitenotice | ||
| Author(s) | Brion Vibber (Brion VIBBERTalk) | ||
| Last version | continuous updates | ||
| Database changes | no | ||
| License | GPLv2+ | ||
| Download | Download snapshot Subversion [Help] |
||
| Example | Wikimedia sites Wikia sites |
||
|
|||
|
Check usage (experimental) |
|||
The DismissableSiteNotice extension allows users to close the sitenotice, using cookies. 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).
[edit] Installation
- Download the files from SVN or download a snapshot (select your version of MediaWiki) and place the files under $IP/extensions/DismissableSiteNotice
- Add to the end of LocalSettings.php:
require_once("$IP/extensions/DismissableSiteNotice/DismissableSiteNotice.php");
- Installation can now be verified through Special:Version on your wiki
[edit] Redisplay the sitenotice whenever sitenoticed edited
The default behavior allows the site notice to be updated without forcing people who have dismissed it to see it again. Some sites may not need this as they may never make tweaks, updates or corrections to existing notices.
The below code change redisplays the sitenotice whenever the mediawiki:sitenotice content is edited. This eliminates the need for the "sitenotice_id" message entirely.
In DismissableSiteNotice.php change the one line of extension code:
$id = intval( $wgMajorSiteNoticeID ) . "." . intval( wfMsgForContent( 'sitenotice_id' ) );
to:
$id = intval( $wgMajorSiteNoticeID ) . "." . crc32( wfMsgForContent( 'sitenotice' ) );
|
|
This extension is being used on one or more of Wikimedia's wikis. This means that the extension is stable and works well enough to be used by such high traffic websites. A full list of the extensions installed on a particular wiki can be seen on the wiki's Special:Version page. |