Topic: [Extension] Video BBCodes

Extension Name: Video BBCodes
Authors: Lamonte & PhaxeNor
Description: Adds Video BBCodes to allow video embeding on your forum
Download: Zip - SVN (Coming soon)

-- Supported Sites --
http://tinypic.com
http://google.com
http://youtube.com
http://veoh.com
http://yahoo.com
http://metacafe.com
http://dailymotion.com
http://gametrailers.com
http://myspace.com
http://videovat.com
http://youku.com

Examples (Warning! Lots of flash movies on 1 page!)

-- Help Section (Next release) --
The help section will have an example for all the supported sites, but with an nice layout for it so that it doesn't fill up your BBCode help page smile

-- Hooks (1) --

    //custom hook if you want to add your own video parser
    ($hook = get_hook('video_bbcode_parser')) ? eval($hook) : null;

-- BBCode Examples --

[video=tinypic]http://tinypic.com/player.php?v=b3v4ug[/video]
[video=metacafe]http://www.metacafe.com/watch/1323474/amazing_flying_helicopter/[/video]
[video=yahoo]http://video.yahoo.com/watch/2046463/6461422[/video]
[video=videovat]http://www.videovat.com/videos/16816/stewie-and-brian-griffin-walkie-talkie.aspx[/video]
[video=veoh]http://www.veoh.com/videos/v11129281NHM7fhh6[/video]
[video=google]http://video.google.com/videoplay?docid=-4919190530858653293[/video]
[video=google]http://video.google.com/videoplay?docid=5013906039351042769&q=dailymotion&ei=er0wSOWdNpzA4ALHhuHUCQ[/video]
[video=youtube]http://youtube.com/watch?v=wZHmsVRshwU[/video]
[video=youtube]http://jp.youtube.com/watch?v=z7vFbUmMFao[/video]
[video=gtrailers]http://www.gametrailers.com/player/31803.html[/video]
[video=gametrailers]http://www.gametrailers.com/player/31803.html[/video]
[video=myspace]http://vids.myspace.com/index.cfm?fuseaction=vids.individual&VideoID=7959149[/video]
[video=youku]http://v.youku.com/v_show/id_ca00XMjUyNTMxMDA=.html[/video]
[video=dailymotion]http://www.dailymotion.com/video/x50l7z_indiana-jones-indys-hat-and-jacket_shortfilms[/video]

-- Updates --
18.05.08 - Video BBCode - 1.0.0 - Release

Re: [Extension] Video BBCodes

Hmm 2 hours aye? smile

Re: [Extension] Video BBCodes

It would probably best to put the include at the start of parser.php instead of inside the function.

Re: [Extension] Video BBCodes

woo big one ...

Sports2All: Watch Online all the Sports (Wrestling, Football, Cricket & All other Sports)

Re: [Extension] Video BBCodes

megavideo.com

Sports2All: Watch Online all the Sports (Wrestling, Football, Cricket & All other Sports)

Re: [Extension] Video BBCodes

Delete your last post^ and edit the one above it.  Megavideo we tried, but there was weird problem, they got this encryption junk -.-..I might make it an extension where it fetches for the url using curl or some other method then display the embedded content, might take few more seconds longer to load.

Re: [Extension] Video BBCodes

Lamonte wrote:

Delete your last post^ and edit the one above it.  Megavideo we tried, but there was weird problem, they got this encryption junk -.-..I might make it an extension where it fetches for the url using curl or some other method then display the embedded content, might take few more seconds longer to load.

oh no problem ... then when some one make the ALLOW HTML EXTENSION (i cant beleave no one thought of doing this one) ... i will use the orignal embed code for megavedio ... as i do in my current 1.2 site

Sports2All: Watch Online all the Sports (Wrestling, Football, Cricket & All other Sports)

Re: [Extension] Video BBCodes

wouldn't it be simpler to just use [video] and have it detect what player to use via the url?

~Gizzmo

Re: [Extension] Video BBCodes

Gizzmo wrote:

wouldn't it be simpler to just use [video] and have it detect what player to use via the url?

yea, some coding but it should work. Will add it to the list and try get it working.

Re: [Extension] Video BBCodes

Why not for Vimeo? This is the best HD video website. sad

Chita, a feral furry paradise.

Re: [Extension] Video BBCodes

Meow wrote:

Why not for Vimeo? This is the best HD video website. sad

added for next update wink

Re: [Extension] Video BBCodes

to be running that latest SVN ?

Re: [Extension] Video BBCodes

achos wrote:

to be running that latest SVN ?

It should be, let me check

edit: works fine on the latest svn

Last edited by PhaxeNor (2008-06-03 21:24:54)

Re: [Extension] Video BBCodes

super... i can see easy bbcode ?
http://img33.picoodle.com/img/img33/4/6/4/f_AAm_33f270e.jpg

Last edited by achos (2008-06-04 08:27:54)

Re: [Extension] Video BBCodes

no, it doesn't show as an easy bbcode button

Re: [Extension] Video BBCodes

Some smalls issues with Dailymotion

http://www.dailymotion.com/fr/cluster/f … issa_music --> Ko

http://www.dailymotion.com/video/x5rktl … issa_music --> Ok

Re: [Extension] Video BBCodes

Issue added smile

Re: [Extension] Video BBCodes

PhaxeNor wrote:
Gizzmo wrote:

wouldn't it be simpler to just use [video] and have it detect what player to use via the url?

yea, some coding but it should work. Will add it to the list and try get it working.


Just wondering if you're still aiming to do this? I could do with a video bbcode for my site, if you're planning on making it work using just [video] then that is great, otherwise I'll code my own that does.

Cheers

Edit: Nevermind, decided to edit your code myself because I was bored tongue Here is the updated code, also with a few security issues fixed, and I renamed your hook to follow guidelines (should start with xn_).

<?xml version="1.0" encoding="UTF-8"?>
<extension engine="1.0">
    <id>video_bbcode</id>
    <title>VideoBBCodes</title>
    <version>1.1.2</version>
    <description>Adds VideoBBCodes to allow video embeding on your forum.</description>
    <author>PhaxeNor, Lamonte Harris</author>
    <minversion>1.3 Beta</minversion>
    <maxtestedon>1.3 Beta</maxtestedon>
    <hooks>
        <hook id="ps_start"><![CDATA[
            function do_video($url)
            {
                //custom hook if you want to add your own video parser
                ($hook = get_hook('xn_video_bbcode_parser')) ? eval($hook) : null;
                
                if(preg_match('#http://www\.videovat\.com/videos/(\d+)/.*#', $url, $matches))
                    return '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="424" height="373" id="videovatPlayer"><param name="allowScriptAccess" value="always" /><param name="movie" value="http://www.videovat.com/videoPlayer.swf" /><param name="quality" value="high" /><param name="flashvars" value="videoId='.forum_htmlencode($matches[1]).'" /><param name="allowFullscreen" value="true" /><param name="wmode" value="transparent" /><embed src="http://www.videovat.com/videoPlayer.swf" quality="high" wmode="transparent" flashvars="videoId=16816" width="424" height="373" name="videovatPlayer" align="middle" allowScriptAccess="always" allowFullscreen="true" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></embed></object>';
                else if(preg_match('#http://.*youtube\.com/watch\?v=(\w+)#s', $url, $matches))
                    return '<object width="425" height="355"><param name="movie" value="http://www.youtube.com/v/'.forum_htmlencode($matches[1]).'" /><param name="wmode" value="transparent" /><embed src="http://www.youtube.com/v/'.forum_htmlencode($matches[1]).'" type="application/x-shockwave-flash" wmode="transparent" width="425" height="355"></embed></object>';
                else if(preg_match('#http://www\.veoh\.com/videos/(.*)#', $url, $matches))
                    return '<embed src="http://www.veoh.com/videodetails2.swf?permalinkId='.forum_htmlencode($matches[1]).'&amp;id=anonymous&amp;player=videodetailsembedded&amp;videoAutoPlay=0" allowFullScreen="true" width="540" height="438" bgcolor="#FFFFFF" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"></embed>';
                else if(preg_match('#http://tinypic\.com/player\.php\?v=(.*)#s', $url, $matches))
                    return '<embed width="440" height="380" type="application/x-shockwave-flash" src="http://v3.tinypic.com/player.swf?file='.forum_htmlencode($matches[1]).'"></embed>';
                else if(preg_match('#http://www\.metacafe\.com/watch/(\d+)/(.*)/#', $url, $matches))
                    return '<embed src="http://www.metacafe.com/fplayer/'.forum_htmlencode($matches[1]).'/'.forum_htmlencode($matches[2]).'.swf" width="400" height="345" wmode="transparent" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash"></embed>';
                else if(preg_match('#http://www\.gametrailers\.com/player/(\d+)\.html#s', $url, $matches))
                    return '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"  codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" id="gtembed" width="480" height="392"><param name="allowScriptAccess" value="sameDomain" /><param name="allowFullScreen" value="true" /> <param name="movie" value="http://www.gametrailers.com/remote_wrap.php?mid='.forum_htmlencode($matches[1]).'"/> <param name="quality" value="high" /> <embed src="http://www.gametrailers.com/remote_wrap.php?mid='.forum_htmlencode($matches[1]).'" swLiveConnect="true" name="gtembed" align="middle" allowScriptAccess="sameDomain" allowFullScreen="true" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="480" height="392"></embed> </object>';
                else if(preg_match('#http://video.yahoo.com/watch/(\d+)/(\d+)#', $url, $matches))
                    return '<object width="512" height="323"><param name="movie" value="http://d.yimg.com/static.video.yahoo.com/yep/YV_YEP.swf?ver=2.2.2" /><param name="allowFullScreen" value="true" /><param name="flashVars" value="id='.forum_htmlencode($matches[2]).'&amp;vid='.forum_htmlencode($matches[1]).'&amp;lang=en-us&amp;intl=us&amp;embed=1" /><embed src="http://d.yimg.com/static.video.yahoo.com/yep/YV_YEP.swf?ver=2.2.2" type="application/x-shockwave-flash" width="512" height="323" allowFullScreen="true" flashVars="id='.forum_htmlencode($matches[2]).'&amp;vid='.forum_htmlencode($matches[1]).'&amp;lang=en-us&amp;intl=us&amp;embed=1" ></embed></object>';
                else if(preg_match('#http://v\.youku\.com/v_show/id_ca00XMj([a-zA-Z0-9]+)=\.html#s', $url, $matches))
                    return '<embed src="http://player.youku.com/player.php/sid/XMj'.forum_htmlencode($matches[1]).'=/v.swf" quality="high" width="480" height="400" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash"></embed>';
                else if(preg_match('#http://vids\.myspace\.com/index\.cfm\?fuseaction=vids\.individual\&amp;VideoID=(\d+)#s', $url, $matches))
                    return '<embed pluginspage="http://www.macromedia.com/go/getflashplayer" src="http://lads.myspace.com/videos/vplayer.swf" width="430" height="346" type=application/x-shockwave-flash allownetworking="internal" allowscriptaccess="never" flashvars="m='.forum_htmlencode($matches[1]).'&amp;v=2&amp;type=video" wmode="opaque">';
                else if(preg_match('#http://video\.google\.com/videoplay\?docid=(-?\d+)(.*)?#s', $url, $matches))
                    return '<embed id="VideoPlayback" style="width:400px;height:326px" flashvars="" src="http://video.google.com/googleplayer.swf?docid='.forum_htmlencode($matches[1]).'&amp;hl=en" type="application/x-shockwave-flash"></embed>';
                else if(preg_match('#http://www\.dailymotion\.com/video/(.*?)_#', $url, $matches))
                    return '<object width="520" height="406" align="top" data="http://www.dailymotion.com/swf/'.forum_htmlencode($matches[1]).'.swf" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0"><param name="allowScriptAccess" value="sameDomain" /><param name="movie" value="http://www.dailymotion.com/swf/'.forum_htmlencode($matches[1]).'.swf" /><param name="quality" value="best" /><embed src="http://www.dailymotion.com/swf/'.forum_htmlencode($matches[1]).'" width="520" height="406" quality="best" align="top" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></embed></object>';
                else if(preg_match('#http://www\.collegehumor\.com/video:([0-9]+)#', $url, $matches))
                    return '<object id="video_1820056" type="application/x-shockwave-flash" data="http://www.collegehumor.com/moogaloop/moogaloop.internal.swf?clip_id='.forum_htmlencode($matches[1]).'&amp;autostart=true&amp;fullscreen=1" width="480" height="360"><param name="allowfullscreen" value="true" /><param name="movie" quality="best" value="http://www.collegehumor.com/moogaloop/moogaloop.internal.swf?clip_id='.forum_htmlencode($matches[1]).'&amp;autostart=true&amp;fullscreen=1" /></object>';
                else if(preg_match('#http://www\.vimeo\.com/([0-9]+)#', $url, $matches))
                    return '<object class="swf_holder" type="application/x-shockwave-flash" width="506" height="382" data="http://www.vimeo.com/moogaloop_local.swf?clip_id='.forum_htmlencode($matches[1]).'&amp;server=www.vimeo.com&amp;autoplay=0&amp;fullscreen=1&amp;show_portrait=0&amp;show_title=0&amp;show_byline=0&amp;md5=&amp;color=&amp;context=&amp;context_id=&amp;hd_off=0"><param name="quality" value="high" /><param name="allowfullscreen" value="true" /><param name="AllowScriptAccess" value="always" /><param name="scale" value="showAll" /><param name="movie" value="http://www.vimeo.com/moogaloop_local.swf?clip_id='.forum_htmlencode($matches[1]).'&amp;server=www.vimeo.com&amp;autoplay=0&amp;fullscreen=1&amp;show_portrait=0&amp;show_title=0&amp;show_byline=0&amp;md5=&amp;color=&amp;context=&amp;context_id=&amp;hd_off=0" /></object>';
                else
                    return forum_htmlencode($url);
            }
        ]]></hook>
        <hook id="ps_preparse_tags_start"><![CDATA[
            $tags[] = 'video';
            
            $tags_opened[] = 'video';
            $tags_closed[] = 'video';
        ]]></hook>
        <hook id="ps_do_bbcode_replace"><![CDATA[
            $pattern[] = '#\[video\](.+)\[/video\]#e';
            $replace[] = 'do_video(\'$1\')';
        ]]></hook>
    </hooks>
</extension>

Might also be a good idea to make it add the [video] to the help page, though I can't be bothered doing that for you tongue

Edit: Also added support for collegehumor and vimeo.

Last edited by Reines (2008-06-24 21:15:35)

Re: [Extension] Video BBCodes

+1 with Reines end Gizzmo = +3 smile

Thanks for the issue with dailymotion

Re: [Extension] Video BBCodes

Reines, yes I am, just a bit busy with the personal life tongue But now that you have done it I can update.

Will update and test within the next 2 days. I'm away the rest of today and tomorrow.

Re: [Extension] Video BBCodes

Good extension thanks

Re: [Extension] Video BBCodes

Wonderful reines, thanks a lot, it works tongue

Re: [Extension] Video BBCodes

downloadlink of the video bbcodes is down

i've fluxbb 1.2.20

Re: [Extension] Video BBCodes

Reines wrote:
PhaxeNor wrote:
Gizzmo wrote:

wouldn't it be simpler to just use [video] and have it detect what player to use via the url?

yea, some coding but it should work. Will add it to the list and try get it working.


Just wondering if you're still aiming to do this? I could do with a video bbcode for my site, if you're planning on making it work using just [video] then that is great, otherwise I'll code my own that does.

Cheers

Edit: Nevermind, decided to edit your code myself because I was bored tongue Here is the updated code, also with a few security issues fixed, and I renamed your hook to follow guidelines (should start with xn_).

<?xml version="1.0" encoding="UTF-8"?>
<extension engine="1.0">
    <id>video_bbcode</id>
    <title>VideoBBCodes</title>
    <version>1.1.2</version>
    <description>Adds VideoBBCodes to allow video embeding on your forum.</description>
    <author>PhaxeNor, Lamonte Harris</author>
    <minversion>1.3 Beta</minversion>
    <maxtestedon>1.3 Beta</maxtestedon>
    <hooks>
        <hook id="ps_start"><![CDATA[
            function do_video($url)
            {
                //custom hook if you want to add your own video parser
                ($hook = get_hook('xn_video_bbcode_parser')) ? eval($hook) : null;
                
                if(preg_match('#http://www\.videovat\.com/videos/(\d+)/.*#', $url, $matches))
                    return '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="424" height="373" id="videovatPlayer"><param name="allowScriptAccess" value="always" /><param name="movie" value="http://www.videovat.com/videoPlayer.swf" /><param name="quality" value="high" /><param name="flashvars" value="videoId='.forum_htmlencode($matches[1]).'" /><param name="allowFullscreen" value="true" /><param name="wmode" value="transparent" /><embed src="http://www.videovat.com/videoPlayer.swf" quality="high" wmode="transparent" flashvars="videoId=16816" width="424" height="373" name="videovatPlayer" align="middle" allowScriptAccess="always" allowFullscreen="true" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></embed></object>';
                else if(preg_match('#http://.*youtube\.com/watch\?v=(\w+)#s', $url, $matches))
                    return '<object width="425" height="355"><param name="movie" value="http://www.youtube.com/v/'.forum_htmlencode($matches[1]).'" /><param name="wmode" value="transparent" /><embed src="http://www.youtube.com/v/'.forum_htmlencode($matches[1]).'" type="application/x-shockwave-flash" wmode="transparent" width="425" height="355"></embed></object>';
                else if(preg_match('#http://www\.veoh\.com/videos/(.*)#', $url, $matches))
                    return '<embed src="http://www.veoh.com/videodetails2.swf?permalinkId='.forum_htmlencode($matches[1]).'&amp;id=anonymous&amp;player=videodetailsembedded&amp;videoAutoPlay=0" allowFullScreen="true" width="540" height="438" bgcolor="#FFFFFF" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"></embed>';
                else if(preg_match('#http://tinypic\.com/player\.php\?v=(.*)#s', $url, $matches))
                    return '<embed width="440" height="380" type="application/x-shockwave-flash" src="http://v3.tinypic.com/player.swf?file='.forum_htmlencode($matches[1]).'"></embed>';
                else if(preg_match('#http://www\.metacafe\.com/watch/(\d+)/(.*)/#', $url, $matches))
                    return '<embed src="http://www.metacafe.com/fplayer/'.forum_htmlencode($matches[1]).'/'.forum_htmlencode($matches[2]).'.swf" width="400" height="345" wmode="transparent" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash"></embed>';
                else if(preg_match('#http://www\.gametrailers\.com/player/(\d+)\.html#s', $url, $matches))
                    return '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"  codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" id="gtembed" width="480" height="392"><param name="allowScriptAccess" value="sameDomain" /><param name="allowFullScreen" value="true" /> <param name="movie" value="http://www.gametrailers.com/remote_wrap.php?mid='.forum_htmlencode($matches[1]).'"/> <param name="quality" value="high" /> <embed src="http://www.gametrailers.com/remote_wrap.php?mid='.forum_htmlencode($matches[1]).'" swLiveConnect="true" name="gtembed" align="middle" allowScriptAccess="sameDomain" allowFullScreen="true" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="480" height="392"></embed> </object>';
                else if(preg_match('#http://video.yahoo.com/watch/(\d+)/(\d+)#', $url, $matches))
                    return '<object width="512" height="323"><param name="movie" value="http://d.yimg.com/static.video.yahoo.com/yep/YV_YEP.swf?ver=2.2.2" /><param name="allowFullScreen" value="true" /><param name="flashVars" value="id='.forum_htmlencode($matches[2]).'&amp;vid='.forum_htmlencode($matches[1]).'&amp;lang=en-us&amp;intl=us&amp;embed=1" /><embed src="http://d.yimg.com/static.video.yahoo.com/yep/YV_YEP.swf?ver=2.2.2" type="application/x-shockwave-flash" width="512" height="323" allowFullScreen="true" flashVars="id='.forum_htmlencode($matches[2]).'&amp;vid='.forum_htmlencode($matches[1]).'&amp;lang=en-us&amp;intl=us&amp;embed=1" ></embed></object>';
                else if(preg_match('#http://v\.youku\.com/v_show/id_ca00XMj([a-zA-Z0-9]+)=\.html#s', $url, $matches))
                    return '<embed src="http://player.youku.com/player.php/sid/XMj'.forum_htmlencode($matches[1]).'=/v.swf" quality="high" width="480" height="400" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash"></embed>';
                else if(preg_match('#http://vids\.myspace\.com/index\.cfm\?fuseaction=vids\.individual\&amp;VideoID=(\d+)#s', $url, $matches))
                    return '<embed pluginspage="http://www.macromedia.com/go/getflashplayer" src="http://lads.myspace.com/videos/vplayer.swf" width="430" height="346" type=application/x-shockwave-flash allownetworking="internal" allowscriptaccess="never" flashvars="m='.forum_htmlencode($matches[1]).'&amp;v=2&amp;type=video" wmode="opaque">';
                else if(preg_match('#http://video\.google\.com/videoplay\?docid=(-?\d+)(.*)?#s', $url, $matches))
                    return '<embed id="VideoPlayback" style="width:400px;height:326px" flashvars="" src="http://video.google.com/googleplayer.swf?docid='.forum_htmlencode($matches[1]).'&amp;hl=en" type="application/x-shockwave-flash"></embed>';
                else if(preg_match('#http://www\.dailymotion\.com/video/(.*?)_#', $url, $matches))
                    return '<object width="520" height="406" align="top" data="http://www.dailymotion.com/swf/'.forum_htmlencode($matches[1]).'.swf" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0"><param name="allowScriptAccess" value="sameDomain" /><param name="movie" value="http://www.dailymotion.com/swf/'.forum_htmlencode($matches[1]).'.swf" /><param name="quality" value="best" /><embed src="http://www.dailymotion.com/swf/'.forum_htmlencode($matches[1]).'" width="520" height="406" quality="best" align="top" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></embed></object>';
                else if(preg_match('#http://www\.collegehumor\.com/video:([0-9]+)#', $url, $matches))
                    return '<object id="video_1820056" type="application/x-shockwave-flash" data="http://www.collegehumor.com/moogaloop/moogaloop.internal.swf?clip_id='.forum_htmlencode($matches[1]).'&amp;autostart=true&amp;fullscreen=1" width="480" height="360"><param name="allowfullscreen" value="true" /><param name="movie" quality="best" value="http://www.collegehumor.com/moogaloop/moogaloop.internal.swf?clip_id='.forum_htmlencode($matches[1]).'&amp;autostart=true&amp;fullscreen=1" /></object>';
                else if(preg_match('#http://www\.vimeo\.com/([0-9]+)#', $url, $matches))
                    return '<object class="swf_holder" type="application/x-shockwave-flash" width="506" height="382" data="http://www.vimeo.com/moogaloop_local.swf?clip_id='.forum_htmlencode($matches[1]).'&amp;server=www.vimeo.com&amp;autoplay=0&amp;fullscreen=1&amp;show_portrait=0&amp;show_title=0&amp;show_byline=0&amp;md5=&amp;color=&amp;context=&amp;context_id=&amp;hd_off=0"><param name="quality" value="high" /><param name="allowfullscreen" value="true" /><param name="AllowScriptAccess" value="always" /><param name="scale" value="showAll" /><param name="movie" value="http://www.vimeo.com/moogaloop_local.swf?clip_id='.forum_htmlencode($matches[1]).'&amp;server=www.vimeo.com&amp;autoplay=0&amp;fullscreen=1&amp;show_portrait=0&amp;show_title=0&amp;show_byline=0&amp;md5=&amp;color=&amp;context=&amp;context_id=&amp;hd_off=0" /></object>';
                else
                    return forum_htmlencode($url);
            }
        ]]></hook>
        <hook id="ps_preparse_tags_start"><![CDATA[
            $tags[] = 'video';
            
            $tags_opened[] = 'video';
            $tags_closed[] = 'video';
        ]]></hook>
        <hook id="ps_do_bbcode_replace"><![CDATA[
            $pattern[] = '#\[video\](.+)\[/video\]#e';
            $replace[] = 'do_video(\'$1\')';
        ]]></hook>
    </hooks>
</extension>

Might also be a good idea to make it add the [video] to the help page, though I can't be bothered doing that for you tongue

Edit: Also added support for collegehumor and vimeo.


how do i use this xml?

i've fluxbb 1.2.20

Re: [Extension] Video BBCodes

Good exstention, thanks

achos wrote:

super... i can see easy bbcode ?
http://img33.picoodle.com/img/img33/4/6/4/f_AAm_33f270e.jpg

Please help how to do it ?

Last edited by Zer0 (2008-08-27 07:47:57)