Extension:EmbedNews

What can this extension do?
Embed News allows the most current news to be displayed. A page is created to contain all the news that is to be displayed and on which dates it is to be displayed on. The extensions tag is placed on the page you wish the most current news to be displayed on. The extension will search the page for most current news it can find and display it on the page. This is helpful if you have a lot of news of future events but only want visitors to see the current event.


 * You can have news for any day.
 * Only the event happening today or about to happen is displayed.
 * Events must be in order of happening.
 * Titles are picked up as well, not just subheadings
 * Empty sections are ignored

Need help or request features, edit my discussion page.

Usage
To start displaying news on the page:

__NOCACHE__ news

Where news inside the tags is the news page. If the page does not exist yet, the extension will provide a link to create the page.

The news page is structured with the date as the title and the news for that date is written below. Example below

23 November 2007
Longer dates work

2007-11-15
Short dates are picked up

2007-11-10
Wiki links work as well

=2007-11-15=

titles work fine

= 2008 =

And many more!

Quite a few date representations can be detected by the extension.

For the regex minded person the following is used to find dates in a wiki page:

/[=]*=[\[]*([^\]\n=]*)[\]]*=*/

Example wiki
See the extension working... Current News Shown News page

Download instructions
I have provided the sources in a zip and tar file.

Unpack the files with the appropriate command. $ tar -xjvf embednews.tar.bz2 $ unzip embednews.zip

The following files will be unpacked:


 * CHANGELOG Changes that I have made, read before installing
 * COPYING GNU License
 * MonoBook.php Patched MonoBook file
 * README Installation and usage documentation
 * embednews.css Calendar Styling file
 * embednews.php Main extension

Installation
To install you need to place the following files into the following locations. From mediawiki root directory. $ cp embednews.php extensions/ $ mkdir skins/embednews/ $ cp embednews.css skins/embednews/

To your LocalSettings.php file append the following:

Where $embednewsfeed is optional if you wish to see the calendar explained below.

Calendar Install
To install the calendar you need to make a patch to your skin. Currently Monobook for version 1.11.0 is provided. Replace your old version with this new version and make a backup of the original.

$ cp -b MonoBook.php skins/MonoBook.php

Or you can make a manual patch by inserting the following lines into your skin files where you wish the calendar to be displayed.

This will create a new portlet.

Once installed set $embednewsfeed in your LocalSettings to the name of the page containing your news.

Required Extensions
You will need magic no cache extension provided here to allow the page to be updated automatically.

http://www.mediawiki.org/wiki/Extension:MagicNoCache

This extension has been tested to work on mediawiki 1.11.0 with little changes

Customization
A css file for the calendar styling is provided. The calendar html code is found within the extension file.

Feature Requests

 * Scroll through other months
 * Add in a tunnel view, show 2 weeks before and 2 weeks after current date
 * Ignore empty dates
 * Implemented
 * if there is no text under a heading, it will keep going back through future headings until it gets back to the top.
 * detect titles as end of text
 * Implemented
 * do not embed a title after a subheading