Extension:Slideshow

What can this extension do?
Makes a slide show from your wiki images. This requires the FLASH plugin.

Usage
image1.jpg|image2.gif|image3.png

Width is optional. The default width is 720 pixels.

To advance, click on the right side of the slide. Click on the left side to see previous slides. Click 'play' on the bottom to automatically go through all of the slide.

Installing it on your wiki
Download Slideshow folder which includes Slideshow.php, slideshow.swf. and slideshow.fla. The flash source file is not necessary for the wiki. It's for anybody to modify.


 * Place the Slideshow folder in the wiki's extension folder
 * In LocalSettings.php, add require_once("$IP/extensions/Slideshow/Slidshow.php");

Code
setHook( "slideshow", "RenderSlideshow" ); }

function RenderSlideshow($input, $argv) { global $wgServer, $wgScriptPath; $output = ""; $width = isset($argv['width']) ? $argv['width'] : 720; $height = $width * (550/720);

$url = $wgServer. $wgScriptPath. "/extensions/Slideshow/slideshow.swf"; $id = "slideshow";

$imageUrl = array; $images = explode("|", $input);

foreach( $images as $i ) { array_push($imageUrl, urlencode(getSlideshowViewPath($i))); }

$param = "img=". join("|", $imageUrl); $output .=<<       

EOM; $output = str_replace("\n", "", $output); return $output; }

function getSlideshowViewPath($file) { $title = Title::makeTitleSafe("Image",$file); $img = new Image($title); $path = $img->getViewURL(false); return $path; }