phpBB youtube BBCode

The standard response to how do I create a YouTube BBCode is

Use the following BBCode usage:


Then use the following HTML Replacement:

<object width=”425&#8243; height=”350&#8243;>
	<param name=”movie” value=”{SIMPLETEXT}”></param>
	<param name=”wmode” value=”transparent”></param>
	<embed src=”{SIMPLETEXT}” type=”application/x-shockwave-flash” wmode=”transparent” width=”425&#8243; height=”350&#8243;></embed>

Of course when you try this you will run into a problem. When your users attempt to try it with a YouTube url they copy pasted from YouTube they may be using https or there may be extra query parameters which will mean that the YouTube simply won’t work.

A quick change will allow you to support that issue and as an added bonus all YouTube references will automatically use https

BBCode usage:


<object width="425" height="350">
	<param name="movie" value="{SIMPLETEXT}"></param>
	<param name="wmode" value="transparent"></param>
	<embed src="{SIMPLETEXT}" type="application/x-shockwave-flash" wmode="transparent" width="425" height="350"></embed>