[Pmwiki-users] Need some help for custom markup

pyg_listes pyg_listes
Sat Dec 18 09:43:17 CST 2004


Hello world
I'm trying to create some custom markup, and I have some difficulties 
with 2 of them.

My goal is to integrate a flash movie in pmWiki2 and to ease some 
javascript link creation (links using "onclick").

Creation of the player code markup was quite simple :
Markup("mp3player", ">links", "/\\(:mp3player:\\)/",  '<object 
id="mp3player" type="application/x-shockwave-flash" 
data="http://pyg.keonox.com/wiki/framaplayer.swf" width="150" 
height="75" style="vertical-align: bottom;">
      <!-- MP3 Flash player. Credits, license, contact & examples: 
http://pyg.keonox.com/flashmp3player/ -->
      <param name="type" value="application/x-shockwave-flash" />
      <param name="codebase" 
value="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0" 
/>
      <param name="movie" 
value="http://pyg.keonox.com/wiki/framaplayer.swf" />
      [ <a href="http://www.macromedia.com/go/getflashplayer/">Flash 
Player</a> requis ]
    </object>');

First (little) problem : I wanted to replace the movie url 
(http://pyg.keonox.com/wiki/framaplayer.swf) with 
'$ScriptUrl/framaplayer.swf' but $scriptUrl return 
http://pyg.keonox.com/wiki/pmwiki.php.
I look into pmWiki Documentation, but I didn't find a standard "script 
path url", is there one somwhere, or do I need to create one in my 
config.php manually ?

Second question :
I want to create a (quite complex, I admit) markup : to launch a sound 
in my flash mp3 player, I may use 2 procedure :
1- <a href="javascript:void(0);" 
onClick="playmp3('03-Shift-Roots_of_Rebellion.mp3', 'Shift', 'ROOTS OF 
REBELLION', 'http://www.website.com/', '32');">link</a>
wich will launch an mp3 sound with some infos (title, artist, website, 
and bitrate) or
2- <a href="javascript:void(0);" 
onClick="playmp3('http://pyg.keonox.com/flashmp3player/framaplayer/exemple/test1.xml');">link</a>
wich will launch a playlist containing all the necessary infos.

So I create :
Markup("playmp3", "directive", "/\\(:playmp3 
(.*)\\s*-+&gt;\\s*(.*):\\)/", "<a href=\"javascript:void(0);\" 
onClick=\"playmp3($2);\">$1</a>");

and entered in my page :
(:playmp3 
mylink->'http://pyg.keonox.com/flashmp3player/framaplayer/exemple/test1.xml':)
But it returns :

<a href="javascript:void(0);" onClick="playmp3('<a class='urllink' href='http://pyg.keonox.com/flashmp3player/framaplayer/exemple/test1.xml'>http://pyg.keonox.com/flashmp3player/framaplayer/exemple/test1.xml</a>');">mylink</a>

So my second question is simple (but I'm trying for some hours now without success) : How can I prevent links (starting with "http://(...)") to be interpreted ?
I've tried using the Keep() function, without success...

Could someone help me ?

pyg








More information about the pmwiki-users mailing list