Extension:SimpleCalendar

Introduction
This is a very simple calendar extension which renders a table of all the months in the year with each day being a wiki article (see Calendar for example). Days which have nothing in them show up as a red link, clicking on it will create a new article as usual. It installs as a parser function, so the following syntax is used:
 *  

When used like this with no parameters, a calendar of all twelve months will be rendered with each day pointing to an article using the date as its title.

Note: in MediaWiki version 1.6.x you need to remove the # character from the syntax.

Installation
Copy the code from OrganicDesign:Extension:SimpleCalendar.php and save into your extensions directory then include in your LocalSettings.php file, for example:

Parameters
There are a number of parameters which allow calendars for different specific purposes.

title: The name of the article which each day in a calendar table links to is by default the date, eg 27 Jan 2008. If you want to have different calendars for different purposes, then the title parameter will precede the names with a separating slash character, for example, setting title to "Harry" will cause the dates to format as Harry/27 Jan 2008.

year: This changes the year of the calendar table, the default if no year is specified is the current year.

month: If a month is supplied, then only a single month will be rendered instead of a table containing all twelve months.

query: This allows extra query-string information to be appended to the links for days which don't exist. The main use for this would be to allow some preloaded content in the newly created calendar articles. See examples below - the syntax looks a little strange because it has two equals characters in it.

format: The default date format for date-articles linked to from the days in the calendar tables is, eg. 2 February 1972, but can be adjusted by supplying a PHP date format in the format parameter. See PHP-Manual/strftime for details about how to specify a date format.

dayformat: This sets the format of the titles of each day of the week at the top of the month tables. The default setting is M T W T F S S, but can be set to %a for abbreviated names in the current language such as Mon Tue..., or %A for full names in the current language.

Examples
Note: the examples above use the CURRENTUSER variable which is not installed by default. See Extension:Variables if you're interested in adding variables.


 *  


 *  


 *  

this example renders the May table for the current year
 *  

this example uses the new query parameter to pre-load the NewDay'' template article into newly created dates. It looks a little confusing, but what it's saying is: add "preload=template" to the link''
 *  </tt>

CSS Styles
The generated calendar table uses CSS to allow customization of the look. Add the CSS rules to your MediaWiki:Common.css article (MediaWiki:Monobook.css on older wiki's). Here's the CSS we use which you can use and adjust:

Change history

 * Version 1.2.4 (2007-10-18): Don't die if generated title is invalid
 * Version 1.2.3 (2007-10-13): Use language settings for day and month names and add dayformat parameter
 * Version 1.2 (2007-05-03): Added format parameter.
 * Version 1.1 (2007-05-02): Changed to named parameters and added the query parameter. The style of the day-links are now handled by two new CSS classes, day-active and day-empty.