Extension:LinkedImage

LinkedImage is a MediaWiki extension that requires at least version 1.5 of MediaWiki.

Usually any displayed image in MediaWiki is linked to its own article. This extension was created to provide a possibility to display an image that is linked to an article other than its own one.

The image to be used must reside on the local wiki, not a 'commons'-style repository.

Usage - Example
wikipage=Main_Page tooltip=Main Page img_src=Image:Sample.gif img_width=10% img_height=10px img_alt=Sampletext

Installation

 * copy LinkedImages.php to the extensions folder
 * add require_once($IP . '/extensions/LinkedImages.php'); to the end of LocalSettings.php

LinkedImages.php code
Version: 0.3

Suggested Changing
I suggest to modify this for more usage, please help improve it.


 * Enable external-linked images
 * Enable non-linked images
 * Cancel the default height/width, so that the image will keep the ratio unless both height and width are set (or make a function to calculate it)

Parameters:


 * exlink - make an external link, such as exlink=http://www.mediawiki.org/
 * wikipage - optional now, the image will have no link if both wikipage and exlink is unset

Unfortunately, I worked it under v2.0, please help moving it to the current version. I have marked all my changes with /////.

I publish it into Public Domain. -- zayoo

Changelog

 * Version 0.3: fixed XSS vulnerbility, cleaned up code, added support for in URL