MyBB Community Forums

Full Version: YouTube Plugin Help
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello i have installed the pluging Tube v, 1.1

Have followed all the instructions and double checked everything, have actived it and can see the YouTube button in the toolbar and when clicked it inserts the [youtube] [/youtube] BBcode but once the post is submitted nothing?

it just deplayed the BBcode and the link then the close BBcode

Please have a look
http://forum.hudsoncarpentry.co.uk/forum...d=94#pid94

Cheers
The plugin doesn't look for UK version of youtube. You also can't have all that extra info in the url.

[youtube]http://uk.youtube.com/watch?v=CbLr2NEV_7o&locale=en_GB&persist_locale=1[/youtube]

Should be

[youtube]http://www.youtube.com/watch?v=CbLr2NEV_7o[/youtube]
Thanks for your reply, i did try it without the extra at the end the first time but still with the UK one.

I did also read that the links didn't need to be shortened??

So how can i get it to work with the UK YouTube, i take it somewhere in the code its told to reconise the www.youtube.com so im guessing if im right i could change that bit of code to uk.youtube.com and all would be well??

Cheers
Did it.. Works with the UK one now.

I changed this in the youtube.php file placed in inc/plugin/
 $message = preg_replace("#\[youtube\]http://(www\.)?youtube.com/watch\?v=([A-Za-z0-9\-\_]+)\[/youtube\]#i", "<object width=\"425\" height=\"350\"><param name=\"movie\" value=\"http://www.youtube.com/v/$2\"></param><embed src=\"http://www.youtube.com/v/$2\" type=\"application/x-shockwave-flash\" width=\"425\" height=\"350\"></embed></object>", $message);

to this
 $message = preg_replace("#\[youtube\]http://(uk\.)?youtube.com/watch\?v=([A-Za-z0-9\-\_]+)\[/youtube\]#i", "<object width=\"425\" height=\"350\"><param name=\"movie\" value=\"http://uk.youtube.com/v/$2\"></param><embed src=\"http://www.youtube.com/v/$2\" type=\"application/x-shockwave-flash\" width=\"425\" height=\"350\"></embed></object>", $message);

Now it works a treat, Credit to Labrocca as without knowing its only for US youtube i woudn't have thought to look for a work around.

Cheers
This might work better:


$message = preg_replace("#\[youtube\]http://(*)?youtube.com/watch\?v=([A-Za-z0-9\-\_]+)\[/youtube\]#i", "<object width=\"425\" height=\"350\"><param name=\"movie\" value=\"http://www.youtube.com/v/$2\"></param><embed src=\"http://www.youtube.com/v/$2\" type=\"application/x-shockwave-flash\" width=\"425\" height=\"350\"></embed></object>", $message)
I am us and i installed the one file downloaded to inc/plugin/ deal but i dont see it in my plugins. so how do i activate it?
Youtube is banned in my country! for some political reasons