I added a generic message called 'sitenotice' to Language.php that replaces fundraising_notice and shows up in Special:Allmessages. It's parsed as normal wiki syntax now. The code that does this is a live tweak in Setup.php on Zwinger currently, imo it would make sense to replace $wgSiteNotice with it, with a default of '-' = switched off. Opinions?
Gabriel Wicke wrote:
I added a generic message called 'sitenotice' to Language.php that replaces fundraising_notice and shows up in Special:Allmessages. It's parsed as normal wiki syntax now. The code that does this is a live tweak in Setup.php on Zwinger currently, imo it would make sense to replace $wgSiteNotice with it, with a default of '-' = switched off. Opinions?
You're a bit unclear -- I'm not sure if you're saying you're replacing one "live tweak" with another, or a live tweak with a "proper" UI. My opinion is obvious: Make a proper UI. ;-) If you're saying that you're planning to make it so that any sysop can activate the site notice by setting [[MediaWiki:Sidenotice]] to some text other than '-', then yes, please go for it.
Timwi
Gabriel Wicke wrote:
I added a generic message called 'sitenotice' to Language.php that replaces fundraising_notice and shows up in Special:Allmessages. It's parsed as normal wiki syntax now. The code that does this is a live tweak in Setup.php on Zwinger currently, imo it would make sense to replace $wgSiteNotice with it, with a default of '-' = switched off. Opinions?
$wgSiteNotice isn't just used for fundraising. It's intended as a way developers can inform users about site-wide downtime. It's also displayed if there's a database connection error. That's why we have outage.php. It was accidentally used for a short time as a multi-lingual fundraising notice, and to that end I wrote a feature allowing the site notice to be drawn from a message. I made the message which it draws it from configurable, so that developers still have the ability to announce downtime. This is done with an initial colon in $wgSiteNotice, for example ":fundraising_notice". The reason it is "fundraising_notice" instead of "sitenotice" is so that users can translate a number of important messages developers might want to issue in advance, allowing a developer to select the one relevant to the occasion. Not only can they set it, but they don't have to clear the message cache when they do so.
If I thought it was a good idea to replace $wgSiteNotice with wfMsg('sitenotice'), I would have done so, instead of writing something more complicated and more flexible.
-- Tim Starling
Tim Starling wrote:
I made the message which it draws it from configurable, so that developers still have the ability to announce downtime. This is done with an initial colon in $wgSiteNotice, for example ":fundraising_notice". [...] If I thought it was a good idea to replace $wgSiteNotice with wfMsg('sitenotice'), I would have done so, instead of writing something more complicated and more flexible.
Wouldn't replacing $wgSiteNotice with wfMsg('sitenotice') still allow for this flexibility since, now that it is wiki-parsed, it can contain something like "{{fundraising_notice}}"?
Timwi
On Wed, 2004-07-28 at 23:57 +1000, Tim Starling wrote:
If I thought it was a good idea to replace $wgSiteNotice with wfMsg('sitenotice'), I would have done so, instead of writing something more complicated and more flexible.
I've done this for now:
$notice = wfMsg( 'sitenotice' ); if($notice == '<sitenotice>') $notice = ''; if($wgSiteNotice) $notice .= $wgSiteNotice; if($notice != '-' && $notice != '') { $parserOutput = $wgParser->parse( $notice, $wgTitle, $wgOut->mParserOptions, true ); $wgSiteNotice = $parserOutput->getText(); }
It allows you to append arbitrary site-wide informations with the possibility to use templates (need to be pulled from the MW NS to provide a non-localized fallback) for recurring events.
And projects can set up their own message on top of that my modifying MediaWiki:Sitenotice to something non-empty and non-'-'.
wikitech-l@lists.wikimedia.org