User:Simsong/Calendar

From MediaWiki.org

Jump to: navigation, search

Current Version: 2.0.3

Quick Jumps:

User:Simsong/Calendar-BugsAndFeatureRequests -- bugs and feature requests

Contents

[edit] New Developer / Mediawiki 1.11+ Support

This page was previously User:Hex2bit/Calendar. I have taken over development and will be creating new features for the extension as time progresses.

[edit] Description

This extension implements a calendar in PHP, designed to integrate into the MediaWiki wiki. This calendar supports custom themes (via a template), generation of wiki articles for events, listing the events for a day including a "summary" of the events, and allows you to name calendars to make them unique or to share them within multiple articles.

Note: This extension requires MediaWiki 1.11. It may run on earlier versions, but no promises. This has also been tested under Windows using IIS and under Linux using Apache.

[edit] Installation

Download the zip file below and extract the files into the extensions folder of your MediaWiki install, or subfolder if you wish. You will need to add the following line to your LocalSettings.php file located in the root of your MediaWiki install.

include("<path to the Calendar.php file>");

Typically, it will look something like this:

include("extensions/Calendar/Calendar.php");

A BUG HAS TO BE FIXED TO GET THIS TO WORK IN MEDIAWIKI 1.8.5!

  • Change htmlspecialchars($title) to htmlspecialchars($title->getText()) on line 529 of Calendar.php.

A FEW BUGS HAVE TO BE FIXED TO GET THIS TO WORK IN MEDIAWIKI 1.1!

  • Change $his to $this in Line 430 of Calendar.php.
  • Line 543 from: $title = $article->getTitle(); to $title = $article->getTitle()->getText();
  • Extension must be installed under "/extensions/Calendar/..."

[edit] Usage

[edit] Basic

To use this calendar, simply place a calendar tag into an article:

<calendar></calendar>

If you wish to name your calendar, you can add a name attribute.

<calendar name="IT Calendar"></calendar>

By giving a calendar a name, the events won't show up on other calendars with different names or no name.

Note, the names have to be simple and valid for article titles. Some characters will cause the attribute to be ignored completely, like an apostrophe.

You can also set other attributes in the calendar tag:

startyear
The first year to shown on the calendar, defaults to this year.
yearshead
The number of years to include ahead of the current year, defaults to 3.
noadd="1"
Suppresses the "Add Event" tags. You will need to have the same calendar on two wiki pages, one with the Add Event tags, and one without.
date='today'
Just print the calendar for today
date='tomorrow'
Just print the calendar for tomorrow
date="2006-07-04"
Just print the calendar for July 4th, 2006

[edit] Events

Events are listed on the calendar in two different ways. The calendar will try to build a title for the event from the first section heading in the article. The text under that should would appear when you put your mouse over the name. An example of an event article would be:

== Summer Picnic ==
Our department will be holding a summer picnic at the park.  Bring your families and your appetites!

In the above example, Summer Picnic will appear on the calendar, and the text within the section will appear if you were to hold your mouse over the link.

If you don't put a section in your article, the calendar will show the word Event, with the text in the article displayed when you have your mouse over the link.

Version 2.0.2 allows multiple events to be put on one page:

 == Summer Picnic ==
 Our department will be holding a summer picnic at the park. Bring your families and your appetites!
  
 == Summer Star Watch==
 Bring your blankets and spend the night with us under the stars!

[edit] More Info

You can find more information in the readme.txt file included with the download, as well as in the source code and calendar template file.

[edit] Download

Here's a direct link to his download:

Simson's Calendar Extension (Zip file)

For those who are interested the original code, you can download it if you wish. This does NOT work on Mediawiki 1.11 or higher, but has been tested and works on earlier versions:

Original Calendar Extension (Zip file)

[edit] Questions or Comments

If you have any questions or comments, feel free to email Simson Garfinkel at the email address listed in the readme.txt and source files.

[edit] Screen Shots

Here's a screen capture of the calendar using the default template. You can of course edit the template and style to make the calendar the way you want it to look.

Image:Hex2Bit_Calendar.jpg

Personal tools