Custom BBcode to embed vdeo's from my clipbucket site to my smf forum

Cancelled

Job Description

I currently run a smf forum and we have a clipbucket ( video hosting ) site dedicated to our forum however we currently have to embed video's using [html] bbcodes that are only usable by admins ( security reasons ) and this makes it annoying when regular users wish to post a video.

we've tried many modifications to get around this and none have worked so far due to clipbuckets strange code.

so what we need is a way to easily embed video's either by simply puting a link in the forum post ( http://defiledstudios.com/watch_video.php?v=N5K5GWHDD8S8 ) for example or a bbcode that would take a link like [dvid]N5K5GWHDD8S8[/dvid] and parse that to display the correct video


OR

I've been trying to get this chunk of code to work with the links

[code]
array(
'tag' => 'embed',
'type' => 'unparsed_commas_content',
'test' => '\d+,\d+\]',
'content' => ($context['browser']['is_ie'] && !$context['browser']['is_mac_ie'] ? '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="$2" height="$3"><param name="movie" value="$1" /><param name="AllowScriptAccess" value="always" /><param name="AllowFullScreen" value="true" /><embed src="$1" width="$2" height="$3" AllowScriptAccess="always" AllowFullScreen="true" /><noembed><a href="$1" target="_blank" class="new_win">$1</a></noembed></object>' : '<embed type="application/x-shockwave-flash" src="$1" width="$2" height="$3" AllowScriptAccess="always" AllowFullScreen="true" /><noembed><a href="$1" target="_blank" class="new_win">$1</a></noembed>'),
'validate' => create_function('&$tag, &$data, $disabled', '
if (isset($disabled[\'embed\']))
$tag[\'content\'] = \'$1\';
global $context;
if (preg_match(\'~iframe.+src=(?:&quot;|[\\\'"])(?:http|https)://www.(?:youtube|youtube-nocookie).com/embed/(.*?)(?:&quot;|[\\\'"])~i\'.($context[\'utf8\'] ? \'u\' : \'\'), $data[0], $matches))
$data[0] = \'http://www.youtube.com/v/\' . $matches[1];
elseif (preg_match(\'~iframe.+src=(?:&quot;|[\\\'"])http://www.dailymotion.com/embed/video/(.*?)(?:&quot;|[\\\'"])~i\'.($context[\'utf8\'] ? \'u\' : \'\'), $data[0], $matches))
$data[0] = \'http://www.dailymotion.com/swf/video/\' . $matches[1];
elseif (preg_match(\'~iframe.+src=(?:&quot;|[\\\'"])http://player.vimeo.com/video/(.*?)\?.+(?:&quot;|[\\\'"])~i\'.($context[\'utf8\'] ? \'u\' : \'\'), $data[0], $matches))
$data[0] = \'http://vimeo.com/moogaloop.swf?clip_id=\' . $matches[1];
elseif (preg_match(\'~http://www.youtube.com/watch[?]v=(.+)~i\'.($context[\'utf8\'] ? \'u\' : \'\'), $data[0], $matches))
$data[0] = \'http://www.youtube.com/v/\' . $matches[1] . \'&fs=1\';
elseif (preg_match(\'~http://youtu.be/(.+)~i\'.($context[\'utf8\'] ? \'u\' : \'\'), $data[0], $matches))
$data[0] = \'http://www.youtube.com/v/\' . $matches[1] . \'&fs=1\';
elseif (preg_match(\'~embed.+src=(?:&quot;|[\\\'"])((?:http|https)://(?:www.)?(?:youtube|youtube-nocookie|dailymotion|vimeo|metacafe|megavideo|veoh).com/.*?)(?:&quot;|[\\\'"])~i\'.($context[\'utf8\'] ? \'u\' : \'\'), $data[0], $matches))
$data[0] = $matches[1];
elseif (preg_match(\'~http://defiledstudios.com/watchvideo.php[?]v=(.+)~i\'.($context[\'utf8\'] ? \'u\' : \'\'), $data[0], $matches))
$data[0] = \'http://defiledstudios.com/watchvideo.php/v/\' . $matches[1] . \'&fs=1\';
else
$tag[\'content\'] = \'$1\';
'),
'disabled_content' => '<a href="$1" target="_blank" class="new_win">$1</a>',[/code]

so if you can make that correctly parse the links that would be preferred.

---
Skills: video, test