Embed YouTube (my little forum)
I did it!!!
You have to add in the "some new tags" section from my previous post and then
instead of the bottom section, you use the follow...
$string = preg_replace(
"#[youtube](.*)youtube.com/watch?v=(.*)
[/youtube]#is", "<object width="425" height="344">
<param name="movie" value="http://www.youtube.com/v/2&hl=de&fs=1">
</param><param name="allowFullScreen" value="true">
</param><embed src=
"http://www.youtube.com/v/2&hl=de&fs=1"
type="application/x-shockwave-flash"
allowfullscreen="true" width="425" height="344">
</embed></object>", $string);
(note: I had to break up the code to avoid the word length rule for this forum but you need to press delete at the end of each line to make the code one long "phrase" from the $ to the ; before you paste it into the file.)
I pasted the code just below the bottom of the function bbcode($string)
{
global $settings;
section in the function.php file.
The bbcode that you use is the url link between [youtube][/youtube]
[youtube]http://www.youtube.com/watch?v=8cWje-8b-ug[/youtube]
I hope this helps others with this issue.
Thanks.
Paul
Complete thread:
- Embed YouTube - Rollo, 16.10.2007, 20:57 (my little forum)
- Embed YouTube - paullecorde, 18.01.2009, 19:20
- Embed YouTube - paullecorde, 18.01.2009, 20:19
- Embed YouTube - paullecorde, 18.01.2009, 19:20
Mix view