Extension:Events

This extension provides the ability to create events on any page of your MediaWiki. Also included is a highly configurable Special page for aggregating events on your site by various criteria. All events are stored in MySQL or pgSQL, so the Special page is extremely fast.

Original author is Aran Deltac but he decided to no longer maintain it. Thanks to Google cache I've found the instructions, I copy them here, because Aran's wiki has changed. Iubito 16:51, 10 February 2006 (UTC)

Since August 2010, version 2.0 is released on Arakhn&ecirc;.org website. Major contribution is the support of PostgreSQL database.

News

 * 2010-08-26: Version 3.1 available on Arakhn&ecirc;.org website.
 * 2010-08-25: Version 3.0 available on Arakhn&ecirc;.org website.
 * 2010-08-09: Version 2.0 available on Arakhn&ecirc;.org website.
 * 2007-03-06: Added a version for mediaWiki 1.9
 * 2006-03-12: Added code snipped to make it compatible with Christof Damian's Calendar extension.
 * 2006-02-10: Released version 0.2. Aran no longer maintain code, instructions copied here by Iubito with slight changes that make this extension work on MediaWiki 1.4 but no tested.
 * 2005-11-02: Released version 0.1.
 * 2005-11-02: First version of MediaWiki Events released.

Version 2.0 and higher
Version 2.0 of Events introduces the following changes:
 * Add pgSQL support.
 * Add automatic creation of the event tables in pgSQL and MySQL databases.
 * Add visibility level for events.
 * Apply recent Mediawiki extension writing rules.
 * Add output customization with CSS classes.

Usage
Each event must be on its own line and start with a date and separator. All the tasks must be grouped with a ... . This tag must be put in a wiki page.

The separator character should be one of:
 * for important events which are visible to every one (not yet rendered in a special way),
 * for standard events which are visible to every one,
 * for standard events which are visible only to connected users,
 * for events which are invisible.

Example: 2062-02-14 ! This is a very important public event. 1453-07-12 : This is a public event. 1423-12-25 # This is an event for connected guys. 1423-12-25 - This is an event which is never rendered.

Remember: the tags must be put inside the wiki text of an article.

Configuration
Events extension provides several configuration variables. these variables should be defined in your LocalSettings.php.
 * $wgEventsOldAge: Number of days in the past before which events are discarted. null means default value ie. 30.
 * $wgEventsYoungAge: Number of days in the future after which events are discarted. null means default value ie. 365.
 * $wgEventExtensionRenderImportantEventBox: Indicates if the box for important events should be rendered. To enable this event box, this global variable must be true, AND the current skin must implement a function named isEventsExtensionImportantEventEnabled which replies a boolean value indicating if the skin support the event box CSS style or not.
 * $wgEventsCloseButtonIcon: Is the URL to the icon which is displayed to close the event popup box. Expected sizes: 12x12 or 16x16.

Special Page to List the Events
As for previous version, all the events of the site are visible on the special page.

Special Page to Clear the Database
Since version 3.0, all the event related tables in the database could be removed by the special page.

Database Schema
Events extension is now supporting pgSQL and MySQL. The 'events' table is automatically created for both databases.

PostgreSQL Schema
DROP TYPE IF EXISTS eventVisibility CASCADE; DROP TABLE IF EXISTS events CASCADE; DROP TABLE IF EXISTS eventglobal CASCADE; CREATE TYPE eventVisibility AS ENUM ('public', 'connected', 'invisible'); CREATE TABLE events (  page_id integer NOT NULL DEFAULT 0,   date date NOT NULL,   description text NOT NULL,   visibility eventVisibility DEFAULT 'invisible' NOT NULL ); CREATE TABLE eventglobal (  popuphtml text NOT NULL );

MySQL Schema
DROP TABLE IF EXISTS events CASCADE; DROP TABLE IF EXISTS eventglobal CASCADE; CREATE TABLE events (  page_id INT UNSIGNED NOT NULL DEFAULT 0,   date DATE NOT NULL DEFAULT '0000-00-00',   description TEXT NOT NULL,   visibility ENUM('public','connected','invisible') DEFAULT 'invisible' NOT NULL,   KEY date_idx (page_id,date) ); CREATE TABLE events (  popuphtml TEXT NOT NULL, );

Compatibility
Aran has only tested this on MediaWiki 1.5.1. Iubito and has applied changes to be compatible with MediaWiki 1.4, but it is not tested. Use at your own risk.

Note I tested this on my MediaWiki installation version 1.9.1 and it didn't work. - Random user

I had the same problem on MediaWiki version 1.9.3. Will there probably be an update? Events are shown on the pages but there are no entries on the special page.

Cstehly 06:47, 24 August 2007 (UTC) Tested with 1.7, it works with following update on Events.php (<1.9) : Replace with

Usage
Each event must be on its own line and start with a date and colon. All the tasks must be grouped with a ..

2062-02-14: When I buy my first hover car. 1453-07-12: Joe was born.

Events Special Page
This page finds all events on all pages of your site and displays them all on one page: Special:Events. You can provide an argument to limit the number of events that are returned:
 * limit - Maximum number of events to list.

Installation
Copy/paste codes below in files.

LocalSettings.php
Add these lines at the end of LocalSettings.php :

extensions/events/Events.php
--Mchansy 19:44, 6 March 2007 (UTC)

includes/SpecialEvents.php
--Mchansy 19:44, 6 March 2007 (UTC)

LocalSettings.php
--Mchansy 19:44, 6 March 2007 (UTC)

Add these lines at the end of LocalSettings.php :

Create the SQL table
Do not forget to add the prefixe to the table name !

Not quite clear what the warning in the previous line means; do you mean:

If you use a prefix for your MediaWiki MySQL tables, such as

then replace the line

with

''If this is what is meant, do you also need to change the code in the above php snippets? I'd be more accurate, but I'm not sufficiently familiar with PHP/MySQL''

''No, this isn't necessary because the prefix is specified during installation. so operating on a table in the database via medawiki-db-functions always appends the prefix in front of the tablename.'' 85.125.245.194 14:45, 12 July 2006 (UTC)

CREATE TABLE events (   page_id INT(8) UNSIGNED NOT NULL DEFAULT 0,    date DATE NOT NULL DEFAULT '0000-00-00',    description TEXT NOT NULL,    KEY date_idx (DATE) );

All done !

License
This code is distributed under GPLv2 or higher.