PDA

View Full Version : Custom BB Code trouble


Jesse
Fri 8th Dec '00, 12:45am
Please don't be put off by the length, this is prolly a pretty simple question :)

Hi all. OK I want to allow users to embed a shockwave flash file in their messages. I can do this using just the embed code and a custom BB code, and it works fine, but the code itself is sloppy so I want to use the entire, embed and object format.

Here I'm using my custom BB code (), the syntax is:
[swf]http://www.myurl.com/mymovie.swf

I need that to return the following (embeded within the page source, not echoed):


<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://...
<PARAM NAME=movie VALUE="http://www.myurl.com/mymovie.swf">
<PARAM NAME=quality VALUE=high>
<PARAM NAME=bgcolor VALUE="#FFDDBB">
<EMBED src="http://www.myurl.com/mymovie.swf" quality=high bgcolor="#FFDDBB" ...
</EMBED>
</OBJECT>

(The code is too long to fit on the screen so I put in "...", what comes after that doesn't matter the question any way).
Note that the URL (http://www.myurl.com/mymovie.swf) is needed twice). This is what I'm stuck on. I can't figure out how to get the URL inserted in both appropriate places using only one command... I tried making it replace "[swf]" with a PHP command which takes the URL and stores it as a variable, then prints out the above code with that variable inserted but my code comes out escaped so it doesn't get processed (like <\? php ;> as text on screen)

Any help greatly appreciated.

Cheers

Jesse