MyBB Community Forums
YouTube MyCode (now with MyBB popup support!) - Printable Version

+- MyBB Community Forums (https://community.mybb.com)
+-- Forum: Resources (https://community.mybb.com/forum-8.html)
+--- Forum: MyCodes (https://community.mybb.com/forum-117.html)
+--- Thread: YouTube MyCode (now with MyBB popup support!) (/thread-53516.html)

Pages: 1 2 3 4


YouTube MyCode (now with MyBB popup support!) - querschlaeger - 2009-07-24

Hi,
this simple MyCode will embed a YouTube video (ok, nothing special...) but with the "new" popup support by Youtube!

Regex:
\[youtube\](.*?)\[/youtube\]
(or whatever you want)

Replacement:
<div style="margin:0;padding:0;width:512px;"><div style="float:right;"><button onclick="MyBB.popupWindow('http://www.youtube.com/watch_popup?v=$1','youtube_$1',640,480);" style="background:url(http://s.ytimg.com/yt/img/master-vfl102488.png) 0 -658px;border:0;height:22px;width:27px;" /></div><object type="application/x-shockwave-flash" data="http://www.youtube.com/v/$1&amp;fs=1&amp;rel=0" width="512" height="384"><param name="movie" value="http://www.youtube.com/v/$1&amp;fs=1&amp;rel=0" /><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="wmode" value="transparent" /></object></div>

Usage:
[youtube]i9Z8gW8NBks[/youtube]
(it's the video ID by youtube)

Demo: Short Films (click on the image at the top on the right of a video)
(or view this screenshot)


RE: YouTube MyCode (now with MyBB popup support!) - faviouz - 2009-07-24

WOW That's amazing. But can you make this plugin url compatible? Like [youtube]link of the video[/youtube] ???

Thanks,
faviouz


RE: YouTube MyCode (now with MyBB popup support!) - querschlaeger - 2009-07-24

(2009-07-24, 03:36 PM)faviouz Wrote: WOW That's amazing. But can you make this plugin url compatible? Like [youtube]link of the video[/youtube] ???

Thanks,
faviouz

Just use this regex:
\[youtube\]http://www.youtube.com/watch\?v=(.*)\[/youtube\]



RE: YouTube MyCode (now with MyBB popup support!) - faviouz - 2009-07-24

Does it work? Toungue (didn't feel like testing it)


RE: YouTube MyCode (now with MyBB popup support!) - querschlaeger - 2009-07-24

I've tested it in my board and it works.
btw there is a nice testing feature of mycode in admin cp. Wink


RE: YouTube MyCode (now with MyBB popup support!) - FBI - 2009-07-25

have tried form Opera 10 browser? Smile


RE: YouTube MyCode (now with MyBB popup support!) - Lo. - 2009-07-26

Umm Does this do HQ videos?


RE: YouTube MyCode (now with MyBB popup support!) - querschlaeger - 2009-07-26

HQ is available.

If want to try it out (different browser, ...) use the demo link in my first post (FF3, FF3.5, IE7, IE8 Operas 9, Chrome 2 works without any problem - other browser I haven't tested yet).


RE: YouTube MyCode (now with MyBB popup support!) - marcgo15 - 2009-08-03

Added.

Thanks for the code querschlaeger Smile.


RE: YouTube MyCode (now with MyBB popup support!) - Gat Dat - 2009-08-06

can u add we add the forum css for a border ?