Extension:CentralNotice

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

Installation

 * 1) Download the latest snapshot and extract it to your extensions directory.
 * 2) Run CentralNotice.sql
 * 3) Add  to your periodic scheduler (cron).
 * 4) Add  to LocalSettings.php.
 * 5) Add  to LocalSettings.php. This is the path that the static js files for each project and language will be written to by rebuildTemplates.php.
 * 6) The extension should now be active.

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


 * Template - a single text/css/image that will display at the top of all set wiki pages.
 * Notices - a collection of templates that are set to show according to a specified weight.

You can configure as many notices at the same time as you want and each one will show with its configured templates at their own weighted percentages.

''This was used during the 2008 fundraiser when we wanted a new notice to exist only for EN even though it overlapped with another for EN. This highlighted a limitation in the system because the old notice was set to all languages and any new notice would have shown all templates instead of just the new subset.'' This is currently only available for EN wiki.
 * Preferred - A notice with preferred set will always replace any other notice that happens to have the same language & wiki combo.
 * Locked - A locked notice can not be deleted unless it is unset.
 * Enabled - when rebuildTemplates.php is run, only notices with enabled will be written out.

Required Settings

 * wgNoticeCentralDirectory - Where we store the static js files
 * wgNoticeInfrastructure - True if we're using the extension

New Template

 * 1) Load Special:NoticeTemplate
 * 2) Click on the add template 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 notice.
 * 4) If this notice is going to be translated then enclose any text lines with triple parens.
 * 5) Submit

New Notice

 * Each template has its template definition stored in MediaWiki:Centralnotice-template_name
 * All of its messages are stored below the template def ala MediaWiki:Centralnotice-template_name-dismiss/language_code


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

Centralized Message Store
It was quickly realized that we were duplicating work when messages were copied over for such strings as Dismiss to each template. Instead of this, the accepted practice to is to use a shared message for commonly used messages. Then use the following to reference it: 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.

Addendum

 * Each notice will be as fresh as the last run of rebuildTemplates.php