MyBB Community Forums

Full Version: How to use custom MyCode?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hey,
I've read the wiki and done a search, but still don't understand how MyCode works. For example, I used phpBB before now, and to add a YouTube code you would do something similar to the following:

BBCode
[youtube]{simpletext}[/youtube]
HTML Replacement
<object width="425" height="350"><param name="movie" value="http://www.youtube.com/v/{simpletext}"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/{simpletext}" type="application/x-shockwave-flash" wmode="transparent" width="425" height="350"></embed></object>
How would I change that into a MyCode? Thanks for all your help.
Here's the MyCode version.

BBCode
\[youtube\](.*?)\[/youtube\]

HTML Replacement
<object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/$1"></param><param name="allowFullScreen" value="true"></param><embed src="http://www.youtube.com/v/$1" type="application/x-shockwave-flash" allowfullscreen="true" width="425" height="344"></embed></object>
Aha, I get it now. Thank you Smile