[Mediawiki-l] Extension help

Grinfeder, Kim grinfeder at miami.edu
Thu Oct 19 01:22:48 UTC 2006

I am writing an extension to add WAV files to Wiki pages. I am allowing people to upload WAV files to the media library by adding this to LocalSettings.php

$wgFileExtensions = array('gif','png','jpg','jpeg','swf','wav');

My extension is very simple, I want to embed a WAV file and add a caption under it. This is what I have: 


$wgExtensionFunctions[] = "wfwavExtension";

function wfwavExtension() {
    global $wgParser;
    $wgParser->setHook( "wav", "WavInput" );

# The callback function for converting the input text to HTML output
function WavInput( $input, $argv, &$parser ) {
    $output = '<table bgcolor="#efefef" cellpadding="5" border="1" bordercolor="#CCCCCC"><tr><td><EMBED SRC="'. $argv["file"]. '" CONTROLS="console" WIDTH=200 HEIGHT=260 AUTOSTART=false></EMBED><br />'. $input . '</td></tr></table>';
    return $output;

To call the extension I plan to use: <wav file="file.wav">Caption</wav> but I am stuck trying to access the wav file in the library. I was wondering if someone can point me in the right direction or help me out. 


More information about the MediaWiki-l mailing list