Extension:EasyTimeline/installation

This section deals with issues on how to activate EasyTimeline in other MediaWiki installations.

EasyTimeline is part of the MediaWiki software. However you need to do a few things in order to activate it.

Note: when you run MediaWiki on another platform than Linux, the following may not apply or be incomplete.

Download Ploticus
EasyTimeline uses open source program Ploticus, which is not included in the MediaWiki installation. Download the proper version for your OS here.

If you can't put the Ploticus executable pl in /usr/local/bin, or any of the other suggested locations, just make sure it's executable and put the appropriate location in LocalSettings.php.

Important: Ploticus 2.30 has a critical bug. Upgrade to 2.31

Download PHP/PERL scripts
EasyTimeline.pl is the actual plug-in, written in perl.

Timeline.php is the MediaWiki php wrapper that invokes the perl script with proper arguments, and feeds generated image and image map (if applicable) to the html output.

Follow these links to get the latest revision of both files : php file:, perl file:

Do not use the EasyTimeline.pl script, or its compiled version, from the authors support page. These are meant for offline usage (= outside WikiMedia).

Important: Newest Ploticus (from 2.31) has changed behaviour. You'll need to patch the php file, see Charts not clickable below.

Settings
For background info see also Write_your_own_MediaWiki_extension

Some rename the php file from Timeline.php to EasyTimeline.php to match the perl file name. In any case make sure to refer to it correctly in the LocalSettings.php file:

include("extensions/EasyTimeline.php"); $wgTimelineSettings->ploticusCommand = "/usr/local/bin/pl"; $wgTimelineSettings->perlCommand = "/usr/local/bin/perl";
 * 1) Add support for EasyTimeline extension

Obviously, the path specified is just an example, you may need to set these parameters differently.

Script location
EasyTimeline.pl needs to be installed in WIKIDIR/extensions/timeline/EasyTimeline.pl (or make a symlink, of course)

Image directory
Create a directory for timeline images:

mkdir WIKIDIR/images/timeline chmod 777 WIKIDIR/images/timeline

Charts not clickable
Several reports have been received that EasyTimeline charts are not clickable on other MediaWiki installations.

The generated html will look like this:  

The empty  tag signals that the php wrapper [Easy]Timeline.php was not able to find a .map file that EasyTimeline.pl should have generated.

Cause 1: If you use Ploticus 2.30 the explanation is simple: no map file is ever written, see bug report. Upgrade to Ploticus 2.31 here

Cause 2: From Ploticus change history: "version 2.30 - with -csmap (client-side image maps PNG/GIF/JPEG) the default is now for map content to be written to stdout since this seems to be what is usually wanted. Previously the default had been for it to be written to a file. Server-side image maps (-map) and SVG are not affected by this change. 2.30 the map file is no more written to file, but rather to stdout by default."

Solution: For now see below at hacks for a fix to the php file.

Image map workaround
Suggested by Twhite: "This mostly worked for me under 1.4beta6, but the imagemaps weren't working. I traced this down to the fact that EasyTimeline.pl was spitting out the imagemaps on stdout, while (Easy)Timeline.php expected them in a file called $fname.map. I patched up my EasyTimeline.php as follows to stuff the expected lines into the expected file:"

[twhite@home]$ diff EasyTimeline.php Timeline-1.7.php 48,58d47 <                else { <                   $lines = split("\n", $ret); <                   $handle = fopen($fname.".map", "w"); <                   for($i=0;$i < count($lines);$i++) { <                      // check if string is area part <                      if(strpos($lines[$i], "area shape") == 1) { <                         fwrite($handle, $lines[$i] . "\n"); <                      } <                    } <                    fclose($handle); <                }

Text flow
Hack for Timeline.php, suggested by Jan Steinman: "I've found the following hack to be useful. It allows one to have text flow around a timeline without having to build a table, and is much easier to maintain than a table."

$wgParser->setHook( 'timelinel', 'renderTimelineLeft' ); $wgParser->setHook( 'timeliner', 'renderTimelineRight' ); } function renderTimelineLeft($timelinesrc) { return renderTimeline($timelinesrc, 'style="float:left"'); } function renderTimelineRight($timelinesrc) { return renderTimeline($timelinesrc, 'style="float:right"'); } function renderTimeline( $timelinesrc, $style='' ) ... $txt = "{$map} ". "";

Update, also by Jan: "It is probably best to wait for 1.5, when I've been assured the enhancement request I put in for extension parameters will be part of MediaWiki, so you could do: for example. In fact, that bug is marked as "complete," so it is probably already in CVS HEAD."