views:

29

answers:

1

I'm trying to write a simple extension for MediaWiki but I can't anywhere find in simple terms, how to call functions within the application to give me the 'hashed' path to an uploaded file.

I've tried the following function call which some searching indicated would return the path but it results in an undefined function error.

//$input is set to 'Image:Test.png' or similar
function noxmagicSVG($input, $args) {
    global $wgUploadPath;

    $imagePathi = $wgUploadDirectory . wfGetHashPath($input, false) . $input;

    return $imagePathi;
}
+1  A: 

The following worked for me in a pre-release of MediaWiki 1.16:

$url = Image::imageUrl( 'Ballarddesk.png' );
Joshua C. Lerner