Mediawiki Image Gallery Extension – WikiGallery

I was working with MediaWiki Gallery extension named “Smooth Gallery” which is based on JonDesign’s SmoothGallery . It was almost the thing i was looking for but not the exact one for my purpose. As a result I had to hack the code and modify it to fit my needs. You can download the extension and install it for your purpose. I have named it as WikiGallery as lots of things has been changed in this extension. This extension supports external images as well and hence give you more options to create a nice gallery.

A very special thanks to Ryan Lane & Jon

Details of the extension is given below:

Screenshot:

smoothgallery1.jpg

 

smoothgallery2.jpg

 

Requirements: Mediawiki 1.9.0  and above [ I have not tested with earlier versions. ]

Steps:

  1. Download the wikigallery files from here.
  2. unzip it to your extensions directory
  3. download wikigallery extension file from here
  4. unzip it and drop it into your extensions directory
  5. make sure $wgUseImageResize is enabled in your LocalSettings.php file
  6. add the following lines to your LocalSettings.php file and save

include(“extensions/WikiGallery.php”);
$wgWikiGalleryExtensionPath = “/mediawiki/extensions/wikigallery”;
$wgWikiGalleryDelimiter = “n”;

Now the extension is ready and we can use it to our wiki pages. Edit a wiki page and add the following tag with image names delimited by the wikigallery delimiter as mentioned on LocalSettings.php file (in this case its n , but it can be , # etc). For local files (uploaded in the wiki), we do not have to put anything. but for external images the http:// must be there.

<wikigallery>
http://www.google.com/intl/en_ALL/images/logo.gif
http://ecx.images-amazon.com/images/I/41ug%2BrrN4YL._AA280_.jpg
myhome.gif
</wikigallery>

Now save and check your page , you will see the gallery is there.

Note:

  •     I will try to keep the code updated with smooth gallery. But can not promise that.
  •     If you have any download issue, please inform me with your email address. I will send you the scripts in email.

Mediawiki tutorials coming soon…

Currently I am working with Mediawiki version 1.11 and lots of things have changed and new things emerged during last 1 year. So i feel that my book “Mediawiki administrator’s tutorial guide” requires some additional writings as well. From April 2008, i will be writing new tutorials every week on Mediawiki including some hacks, extensions and template design.

I hope it will be helpful for all Mediawiki users and administrators 🙂

Hack: Editing headers in MediaWiki Template.

Have you ever tried to put headers in MediaWiki and tried to edit them from page view? You might have been forwarded to template edit section instead of section edit. If you want to go to section edit section rather than template edit section then this small hack is for you.

here are the steps you have to perform:

1. open includes/Parser.php file from MediaWiki installed directory.

2. find the following line inside the formatHadings function.

# give headline the correct <h#> tag
if( $showEditLink && ( !$istemplate || $templatetitle !== “” ) ) {
if( $istemplate )
$editlink = $sk->editSectionLinkForOther($templatetitle, $templatesection);
else
$editlink = $sk->editSectionLink($this->mTitle, $sectionCount+1, $headline_hint);
} else {
$editlink = ”;
}
$head[$headlineCount] = $sk->makeHeadline( $level, $matches[‘attrib’][$headlineCount], $anchor, $headline, $editlink );

$headlineCount++;
if( !$istemplate )
$sectionCount++;

and replace with

if( $showEditLink && ( !$istemplate || $templatetitle !== “” ) ) {
$editlink = $sk->editSectionLink($this->mTitle, $sectionCount+1, $headline_hint);
} else {
$editlink = ”;
}
$head[$headlineCount] = $sk->makeHeadline( $level, $matches[‘attrib’][$headlineCount], $anchor, $headline, $editlink );

$headlineCount++;
$sectionCount++;

3. now save the file and test the feature.

you are all done to use this hack…