Open main menu

lensowiki β

Help:EasyTimeline activation

Revision as of 05:34, 19 July 2006 by Wadmin (talk | contribs) (1 revision(s))

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 ("how" explained below).

Important: Ploticus 2.30 has (Oct 29, 2004) a critical bug. Upgrade to 2.31 2.32.

Mind that, at 12:57, 31 August 2005 (UTC),

  • the last version of ploticus is 2.32 (Aug 22 & 23, 2005)
  • the last version in the Ubuntu (a.k.a. Debian) GNU/Linux distro is still 2.20 (Aug 14, 2004)

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: [1], perl file: [2]

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.

Configure MediaWiki

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:

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

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

Known problems

Charts not clickable

Ploticus 2.30 is buggy and does never produce a html map file, so no clickable images.

Ploticus 2.31 has fixed this but has changed behaviour: map file is now written to stdout instead of file :(

So you need to apply the patch described below or download Timeline.php 1.7 with patch applied here.

Patch by Twhite

[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);
<                 }

Note: This bug has been resolved in Ploticus 2.32


Windows only: Timeline error: Executable not found. Command line was:

If you are getting an error something like

Timeline error: Executable not found. Command line was:
"C:/Perl/bin/perl.exe" "C:/Apache2/htdocs/wiki/extensions/timeline/EasyTimeline.pl"
-i "C:/Apache2/htdocs/wiki/images/timeline/bebc64ea32049f9fe1f251640849a318"
-m -P "C:/pl232win32/bin/pl.exe"
-T "C:/Apache2/htdocs/wiki/images/tmp" -A "/wiki/$1"

try going into your php file (usually at Timeline.php or EasyTimeline.php) and changing

$ret = `{$cmdline}`; 

into

$ret = `"{$cmdline}"`;

Windows only: set path to perl

When your mediawiki installation runs on Windows you will need to update Timeline.php. Set $wgTimelineSettings->perlCommand to the path to perl.exe. The default is /usr/bin/perl, this needs to be changed for Windows.

No texts displayed

The newest release of EasyTimeline contains a quick fix for unicode support. This requires free font FreeSans.ttf. If easytimeline.pl mentions FreeSans.ttf you have this recent version and maybe do not have that font in a directory where Ploticus looks. You might try to find where that is on your system: see Ploticus docs online, or revert to previous EasyTimeline.pl 1.13 at http://cvs.sourceforge.net/viewcvs.py/wikipedia/extensions/timeline/EasyTimeline.pl.