[[media:...]] support

markfoodyburton - January 4, 2008 - 22:09
Project:PEAR Wiki Filter
Version:5.x-1.0
Component:Documentation
Category:feature request
Priority:normal
Assigned:Unassigned
Status:closed
Description

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?

#1

markfoodyburton - January 5, 2008 - 21:15
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....

#2

Anonymous - January 19, 2008 - 21:21
Status:fixed» closed

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

 
 

Drupal is a registered trademark of Dries Buytaert.