From MediaWiki.org
Jump to navigation Jump to search
MediaWiki extensions manualManual:Extensions
Crystal Clear action run.svg

Release status:Extension status stable

ImplementationTemplate:Extension#type Special page, Tag, MyWiki
DescriptionTemplate:Extension#description Media RSS support for gallery tag, and PicLens integration
Author(s)Template:Extension#username (Cchanteptalk)
Latest versionTemplate:Extension#version 1.0-SNAPSHOT
MediaWikiTemplate:Extension#mediawiki 1.11.x-1.16.0
LicenseTemplate:Extension#license No license specified
Download here
ExampleTemplate:Extension#example Example 1


Hooks usedTemplate:Extension#hook

Translate the PicLens extension if it is available at translatewiki.net

Check usage and version matrix.

This extension adds support to Mediawiki's standard <gallery /> tag. This allows it to generate Media RSS content from any article that contains such tags. It allows you to add a RSS Media link to any article that does not have gallery with a special comment. It also allows the PicLens plugin to be used with such RSS with another particular tag.


Download instructions[edit]

You can download extension from there.


  1. Extract extension
  2. Move PicLens to your extensions directory
  3. Copy LocalSettings.part content into your LocalSettings.php :
/* If you want custom MediaRSS logo, displayed in PicLens topbar
global $wgMediaRssLogo;
$wgMediaRssLogo = "{$wgScriptPath}/logo_height26px.png";
require_once( "$IP/extensions/PicLens/PicLens.setup.php" );

Configuration parameters[edit]

  • $wgMediaRssLogo specify an image file that can be used as Media RSS icon. This is displayed in PicLens topbar.


Article with gallery tag[edit]

From article you add some gallery, you can launch PicLens plugin with button added in your browser personnal bar.

You can also add a JavaScript link in your article with a tag provided by this extension :

<picLensLauncher>My launch text</picLensLauncher>

… which will display such HTML content :

<a href="#" onclick="javascript:PicLensLite.start();" class="picLensLauncher" title="PicLensLite">My launch text</a>

JavaScript object PicLensLite is maid available by an head script also automatically provided by this extension.

With generated html attribute class="picLensLauncher" you can customize this link with some CSS selector.

Other article[edit]

If you can to add a Media RSS to an article that does not use any gallery, you can do it with the special comment <!-- PicLensRSS: url -->.

You just have to replace url by an absolute (<!-- PicLensRSS: http://www.mysite.com/photo.rss -->) or by another wiki article that contains <gallery /> tag(s) (<!-- PicLensRSS: OtherArticleWithGallery -->).


The default code will not include gallery images without a description in the generated RSS feed used to display the images. To do so, change the following code in PicLens.body.php:

        foreach ($parts as $p) {
          $pos = strpos($p, '|');
#change starts here
          # If it doesn't have a description, use the image title
          if ($pos === false)
            $it = $p;
            $descr = substr($p, strpos($p, ':')+1);
            $it = trim( substr($p, 0, $pos) );
            $descr = trim( substr($p, $pos+1) );
#change ends here
          $title = Title::newFromText($it);
          $img = wfFindFile( $title, false );