The Wayback Machine - https://web.archive.org/web/20110514024336/http://www.mediawiki.org/wiki/Extension:CentralNotice

Extension:CentralNotice

From MediaWiki.org
Jump to: navigation, search
Manual on MediaWiki Extensions
List of MediaWiki Extensions
Crystal Clear action run.png
CentralNotice

Release status: stable

Implementation Special page
Description Adds a central sitenotice
Author(s) Brion Vibber, Tomasz Finc, Trevor Parscal, Kaldari
License GPL
Download Download snapshot
Subversion [Help]

Browse source code

Parameters
  • $wgNoticeInfrastructure
  • $wgNoticeLang
  • $wgNoticeProject
  • $wgNoticeProjects
  • $wgCentralDBname
  • $wgCentralPagePath
  • $wgCentralNoticeLoader
  • $wgNoticeCookieDomain
  • $wgNoticeCounterSource
Added rights
  • centralnotice-admin
Hooks used
BeforePageDisplay

SiteNoticeAfter
MakeGlobalVariablesScript
LoadExtensionSchemaUpdates
SkinAfterBottomScripts

check usage (experimental)

CentralNotice adds the possibility to manage sitenotices from one central wiki. If you only need to post one global message (sitenotice) to a single wiki, you may want to use MediaWiki:Sitenotice instead.

Contents

[edit] Installation

  1. Download the latest snapshot and extract it to your extensions directory.
  2. From the wiki root, run php maintenance/sql.php extensions/CentralNotice/CentralNotice.sql
  3. Add
    require_once( "$IP/extensions/CentralNotice/CentralNotice.php" );
    to LocalSettings.php.
  4. The extension should now be active.

[edit] Design

The CentralNotice system consists of both campaigns (a.k.a. notices) and banners (a.k.a. templates).

CentralNotice may work on a single wiki, but Wikimedia has a centralized setup, having CentralNotice extension installed on all wikis, but the designated wiki instance (currently Meta) is used to provide management interface as well. This designated wiki is called infrastructure wiki and has $wgNoticeInfrastructure set to "true". All sister wikis use should have $wgCentralDBname set to the database name of the infrastructure wiki in order to be able to roll out the centrally defined campaigns. Actual banners are served from the central wiki, as defined by $wgCentralPagePath (this is also Meta in case of Wikimedia wikis).

[edit] Settings

[edit] Permissions

[edit] New Banner

  1. Load Special:NoticeTemplate
  2. Click on the add banner link at the bottom of the page (must be logged in as an admin).
  3. Enter in a name and the raw HTML for the given banner.
    1. If this banner is going to be translated then enclose any text to be translated with triple parens - {{{FOO}}}.
  4. Submit

[edit] New Campaign

  1. Load Special:CentralNotice
  2. Add a campaign with a given start time at the bottom portion of the page and click submit.
    1. If this campaign is only run on a specific wiki and or language then select it from the pull downs.
  3. Click on the new campaign and add the banners you want within this running campaign and their respective weights.
  4. If all looks well then set this campaign to enabled and it will show at the corresponding time.

[edit] Shared messages

It was quickly realized that we were duplicating work when messages were copied over for such strings as Hide to each banner. Instead of this, the accepted practice to is to use a shared message for commonly used messages. Then use the following to reference it:

{{int:centralnotice-shared-message-name}}

Note only 2 curly brackets.

If there is a need to only do this for two banners then you might want to use the clone feature at the bottom of any banner page.

[edit] Testing

You can test-load any banner on any wiki by adding ?banner=<bannername> to the end of the URL.

You can simulate loading a wiki page from any country (to test campaign geotargeting) by adding ?country=<countrycode> to the end of the URL. (Use the 2-letter ISO 3166-1 code.)

[edit] File descriptions

CentralNotice includes the following files:

[edit] Development

[edit] See also

Personal tools
Namespaces
Variants
Actions
Site
Support
Download
Development
Communication
Toolbox