using mediawiki...
I want to be able to link to non image files.
Image files seem to work with [[image:....]]
I couldn't get media files to work

So, I hacked in

$path = '';
if (preg_match("/^media:(.*)$/",$page,$match)) {
$path=file_directory_path().'/'.($match[1]);
}
// When wikitools is enabled, just create a wikitools link.
elseif

in the pearwiki_filter_page_path function

This isn't cleaver, and it's not funny, and dont try it at home... it's not how it should be done. But how SHOULD it be done?

Comments

markfoodyburton’s picture

Status: Active » Fixed

Nice easy answer.... Hope somebody else is as stupid as me and finds this helpful

Dont go hacking the module - simply go to the config page and put a
line in, like
Media | media | /files/%s
under the "interwiki" section
GEEZE thats nice !!!!!

Well done module writer :-)

BTW, did find a small issue in the Interwiki code - the regexp excludes ()'s, my URL's happen to have ()'s in them (dont ask) - anyway, patching the regexp has fixed it for me, but I am not sure that this is the right thing to do - looks to me like the regex should just simplified in that module....

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.