Vuzit MediaWiki extension
From Evan Sultanik
(Redirected from Vuzit MediaWiki plugin)
Contents |
What's vuzit?
vuzit is a free online document viewer implemented using ajax. For an example, see my CV.
Usage
<vuzit>Document URL</vuzit>
Installation
Create a new file called "extensions/vuzit.php" in your MediaWiki installation directory and populate it with the following:
<?php $wgExtensionFunctions[] = 'wfVuzit'; $wgExtensionCredits['parserhook'][] = array( 'name' => 'vuzit', 'version' => 0.2, 'description' => 'Display Documents using [http://www.vuzit.com/ vuzit]', 'author' => '[http://www.sultanik.com Evan Sultanik]', 'url' => 'http://www.sultanik.com/vuzit_MediaWiki_extension' ); function wfVuzit() { global $wgParser; $wgParser->setHook('vuzit', 'renderVuzit'); } # The callback function for converting the input text to HTML output function renderVuzit($input, $args) { $input = htmlspecialchars($input); $width = $args['width']; $height = $args['height']; if($width <= 0) { $width = 510; } if($height <= 0) { $height = 660; } $output = '<iframe type="text/html" width="'.$width.'px" height="'.$height.'px" src="http://vuzit.com/view/?url='.$input.'&output=embed&z=0&key='.$wgVuzitKey.'" frameborder="0" ></iframe>'; return $output; } ?>
Then, in your "LocalSettings.php" file, add:
require_once("$IP/extensions/vuzit.php"); $wgVuzitKey = 'XXXX';
Where 'XXXX' should be replaced with your vuzit developer key (acquired from here).
Acknowledgments
This plugin was adapted from Kasper Souren's Google Calendar extension.