[Pmwiki-users] help needed for custom markup
Tue Dec 28 17:45:13 CST 2004
How elegant and efficient!
Le 28 d?c. 04, ? 20:34, Patrick R. Michaud a ?crit :
> On Tue, Dec 28, 2004 at 12:22:09AM +0100, Benoit Pointet wrote:
>> i'm using PmWiki as part of an electronic music band website, the
>> part being a mp3 browser/player.
>> i want to have a new markup:
>> that will create such a HTML tag:
>> <a href="player.php?path=RELPATH" target="player"><img
>> but i've never really studied regexps and need help concerning this
>> - could somebody be kind enough to hack a markup declaration for me?
>> - where should i add it? in local/config.php?
> You can actually do this without using regexps or the markup function.
> Just set the following variables in local/config.php:
> $LinkFunctions['play:'] = 'LinkIMap';
> $IMap['play:'] = 'player.php?path=$1';
> $IMapLinkFmt['play:'] =
> "<a target='player' href='\$LinkUrl'><img src='track.png' /></a>";
> The nice thing about doing it this way (as opposed to using Markup() )
> is that PmWiki automatically knows which characters are valid in urls,
> will url-encode characters as needed, and automatically handles markup
> [[play:some path with spaces]] and [[(play:)mysong.mp3]].
More information about the pmwiki-users