1 (edited by Neck 2008-12-13 18:24)

Topic: [Release] VideoTag (v0.2.0)

VideoTag extension for PunBB 1.3
This extension adds BBcode tag ([video]) to display videos from various provider.


VideoTag 0.2.0


Installation:
Download the zip and extract it in your PunBB's extensions folder, then access administration and launch install.

Upgrade:
Replace content of ek_videotag folder (in extensions) with the one of the last version's zip, then launch upgrade in administration.


Features:

  • All you need to to is to past the URI of a video, see example below.

  • Currently supports: youtube, dailymotion, vimeo, google video.
    I might add support for more services, ask for them and give me links.

  • Works with or without auto-link feature. If its turned on you will see url tags inside video tags this is normal I cant do nothing about it at the moment.

Example of use:

[video]http://www.youtube.com/watch?v=3aqO07MqLiE[/video]

Notes:
If a specific video isn't working while the extension in general is, please provide the link you used when reporting.

It would be great if the PunBB team could make auto-link a bit more accurate and/or customizable, I had to use dirty trick to support it. wink

Licensed under GPL.


Old versions:
VideoTag 0.1.1
VideoTag 0.1.0

Re: [Release] VideoTag (v0.2.0)

I think you could place the function inside the hook instead of including a file:

require($ext_info['path'].'/handle_video_tag.php');

By the way, a extension can't be released under a GPL-incompatible license since the forum is under GPL. Creative Commons is incompatible.

3

Re: [Release] VideoTag (v0.2.0)

parpalak wrote:

I think you could place the function inside the hook instead of including a file
require($ext_info['path'].'/handle_video_tag.php');
By the way, a extension can't be released under a GPL-incompatible license since the forum is under GPL. Creative Commons is incompatible.

Well... I prefer to have a separate file, dont think it matters big_smile

About licensing, its not that simple. From what I read it depends how you consider the extension. In this case it is strongly bound to PunBB's functionality and wouldnt work without them, so might change license in next release (altho I dont think there's much diff between cc-by and gpl).
For my chat extension, the chat could run completely out of PunBB (what it was doing originally tongue) so it can be considered as a separate (javascript) application.
see GPL faq

Re: [Release] VideoTag (v0.2.0)

Neck wrote:

Well... I prefer to have a separate file, dont think it matters

require may be a bit slower. Though it's just an advise, make as you like smile

Neck wrote:

In this case it is strongly bound to PunBB's functionality and wouldnt work without them, so might change license in next release (altho I dont think there's much diff between cc-by and gpl).

Maybe. But it's a law.

Neck wrote:

the chat could run completely out of PunBB (what it was doing originally ) so it can be considered as a separate (javascript) application.

I agree.

5

Re: [Release] VideoTag (v0.2.0)

Updated it:
-inclued function in manifest.
-added support for google video.
-changed licence for GPL.

6 (edited by whatrevolution 2008-12-12 23:41)

Re: [Release] VideoTag (v0.2.0)

Thanks for this. _o_O/

Edit:  Can you add documentation to /help/bbcode/?

Re: [Release] VideoTag (v0.2.0)

NICE!!!

Re: [Release] VideoTag (v0.2.0)

Neat.

Would it be possible for the extension to check if pun_bbcode is installed and, if it is, add a button for the video tag?

Re: [Release] VideoTag (v0.2.0)

thanks

10 (edited by KeyDog 2008-12-13 15:00)

Re: [Release] VideoTag (v0.2.0)

As I'm using latest version;
you can add this now

<maxtestedon>1.3.2</maxtestedon> 


in manifest.xml
gave me warning my version wasn't tested yet.
Thanks.


EDIT: Just added some code to help.php and lang/help.php and changed maxtestedon to 1.3.2  in manifest.xml and have released it here:
http://rapidshare.com/files/172997934/e … _.rar.html

help now looks like this in 2nd paragraph:

You can create links to other documents, e-mail addresses or embed video(new!) using the following tags:

then last item in that paragraph:

[video]http://www.youtube.com/watch?v=3aqO07MqLiE[/video] produces  the embedded video in your post. 

suited me. maybe someone finds it usefull.... works in 1.3.2.

2ND EDIT: added words embed and embedded to lang/help  (from prior post)

11

Re: [Release] VideoTag (v0.2.0)

New version:
includes help.php addition
upgrade compatibility to punbb 1.3.2.


@Mogger: no, the pun_bbcode extension's design does not allow such modification to be done automatically.

Re: [Release] VideoTag (v0.2.0)

Neck wrote:

the pun_bbcode extension's design does not allow such modification to be done automatically.

We can add hooks to pun_bbcode. Just say where they should be placed.

13

Re: [Release] VideoTag (v0.2.0)

I guess one after the foreach() loop in bar.php would do the trick big_smile

14

Re: [Release] VideoTag (v0.2.0)

I wondered if DivX Web Player can be supported with this excellent tag tool.
Or what I need to replace to maybe get a Divx/Avi Tag working?

Example I need help with
Actual Web URL which has adress:

www.mywebsite.bla/20081121826/blablabli.html

___________________________________________________________
and within that post .html this html code is placed:

<object width="480" height="360" 
codebase="http://go.divx.com/plugin/DivXBrowserPlugin.cab"
classid="clsid:67DABFBF-D0AB-41fa-9C46-CC0F21721616">
<param value="http://www.mywebsite.bla/Divx/blabla.jpg" name="previewImage" />
<param value="false" name="autoPlay" />
<param value="true" name="loop" />
<param value="http://www.mywebsite.bla/Divx/blabla.avi"
 name="src" />  

<embed width="480" height="360" 
previewimage="http://www.mywebsite.bla/Divx/blabla.jpg" 
pluginspage="http://go.divx.com/plugin/download/" 
autoplay="false"
loop="true" 
src="http://www.mywebsite.bla/Divx/blabla.avi" 
type="video/divx"></embed>  </object><br />

No video? Get the DivX Web Player for 
<a href="http://download.divx.com/player/DivXWebPlayerInstaller.exe" 
style="text-decoration: underline;">Windows</a>   
or <a href="http://download.divx.com/player/DivXWebPlayer.dmg" 
style="text-decoration: underline;">Mac</a>

___________________________________________________________

How can I integrate DivX Vids with above information.
I tried fiddling round with manifest.xml but

1. I didn't know what to put in array of match or url (lines 70 or so)

2. insted of display flash player one would need something like this?

 return
'<object type="video/divx" data="'.$playerUri.'" width="'.$s['width'].'" 
height="'.$s['height'].'">'.
'<param name="src" value="'.$playerUri.'" />'.    
'<param name="autoPlay" value="false" />'.
'<param name="loop" value="true" />'.
'<p><a href="'.$videoUri.'">[divx (divx web player not installed)]</a></p>'.
'</object>';

So is there a possibility to add .avi support or any ideas?
Thanks a lot!

Re: [Release] VideoTag (v0.2.0)

hi KeyDog, I've integrated divx web player into my punBB.
I found an old mod of punBB 1.2 with and tried into my punBB with small changes and its working fine for me wink
here is the code to add to the parser.php at line 706 after "replace[] = '</p><h5>$1</h5><p>';"

to add divx support :

    //DivX 
    $pattern[] = '#\[divx width=([0-9]*) height=([0-9]*)\](.*?)\[/divx\]#';
    $replace[] = '<object width="$1" height="$2" classid="clsid:67DABFBF-D0AB-41fa-9C46-CC0F21721616" codebase="http://go.divx.com/plugin/DivXBrowserPlugin.cab"><param name="autoPlay" value="false" /><param name="src" value="$3" /><embed src="$3" width="$1" height="$2" autoPlay="true" type="video/divx" pluginspage="http://go.divx.com/plugin/download/"></embed></object>';

you just have to put the link to the .avi file between [divx width=xx height=xx]URL[/divx]

16

Re: [Release] VideoTag (v0.2.0)

I wondered if DivX Web Player can be supported with this excellent tag tool.
Or what I need to replace to maybe get a Divx/Avi Tag working?

I think it would be easier to make a completely new tag since its not the same code at all for most part of the process wink

17 (edited by KeyDog 2008-12-13 21:47)

Re: [Release] VideoTag (v0.2.0)

@SkyLine: Thanks a lot for that info. Not working for me just yet. Is it possible that the divx tag needs to be defined somewhere?
Posted this code:

[divx width=480 height=360]http://www.mywebsite.bla/xyz/Test.avi[/divx]

and just get this in post at the moment:

http://www.mywebsite.bla/xyz/Test.avi" />http://www.mywebsite.bla/xyz/Test.avi" width="480" height="360" autoPlay="true" type="video/divx" pluginspage="http://go.divx.com/plugin/download/">

@Neck: Yes. I agree. big_smile piece of cake for you no?


EDIT: it keeps wrapping url tags around the path to file... is that normal?

[divx width=480 height=360][url] xxxx [/url][/divx]

Re: [Release] VideoTag (v0.2.0)

oh yeah I got it.
You should disable automatic URL detection.
You will find it under Admin--> Settings--> Features : and uncheck it.

Allow BBCode parser to detect URLs and put them into tag.

19 (edited by KeyDog 2008-12-14 00:56)

Re: [Release] VideoTag (v0.2.0)

Great. Now it works. Just added the 'divx' to /extensions/pun_bbcode/bar.php aswell - as I'm using  bbcode official extension.  (as explained in this forum post for youtube etc). Thx a lot for help! download of step by step instruction for bbcode divx addition in 1.3.2 with pun_bbcode extension.

Re: [Release] VideoTag (v0.2.0)

Neck wrote:

I might add support for more services, ask for them and give me links.

Don't forget imeem.com, a popular video/music hosting.

21

Re: [Release] VideoTag (v0.2.0)

@neck
Found this code written (GPL) for phpBB by fraev - if you could add those services to your next release would be cool.

Video Sites

Chrs.

Re: [Release] VideoTag (v0.2.0)

KeyDog wrote:

@neck
Found this code written (GPL) for phpBB by fraev - if you could add those services to your next release would be cool.

Video Sites

Chrs.

can any one make extension out of that. it will be very usefull.

MyFootballCafe.com  is Now Online!

23

Re: [Release] VideoTag (v0.2.0)

Thank you so much Neck, this is just what I needed. I will have to add the video button in the pun_bbcode now, I hope I will find a way with a little search on the forum. I just tried downloading the "step by step instruction for bbcode divx addition in 1.3.2 with pun_bbcode extension" but the link posted by KeyDog above is dead.

I was thinking, most user's won't take the time to use the center quotes when they will post a video, and it looks cleaner when the video is at the center of the forum. Is there a way to automatically center the videos?

Anyway, thank you again for this awesome extension smile

24 (edited by SuperMAG 2009-03-19 11:12)

Re: [Release] VideoTag (v0.2.0)

looks like Neck is not developing this anymore.

Can any one please help add this to the original code.

These are to be added:

<?php
foreach ($_GET as $key => $item){
if ($key!='link' and $key!='debug'){
$_GET['link'].='&'.$key.'='.$item;
}
}
If ($_GET['link']){
If ($_GET['debug']) echo '<script>';
echo "window.document.write('".preg_replace('/<\/script>/', '</scr\'+\'ipt>', addslashes(get_video($_GET['link'])))."');";
If ($_GET['debug']) echo '</script>';
}
function get_video($link){
$values = array (
//http://www.youtube.com
array('/youtube\.com.*v=([^&]*)/i', '<object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/{ID_VIDEO}"></param><embed src="http://www.youtube.com/v/{ID_VIDEO}" type="application/x-shockwave-flash" width="425" height="344"></embed></object>'),

//http://video.google.it
array('/video.google.*docid=([^&]*)/i', '<embed id="VideoPlayback" style="width:400px;height:326px" allowFullScreen="true" flashvars="fs=true" src="http://video.google.com/googleplayer.swf?docid={ID_VIDEO}" type="application/x-shockwave-flash"></embed>'),

//http://dailymotion.alice.it
array('/(dailymotion)/i', '{DOWNLOAD%/<textarea id="video_player_embed_code_text" class="text" onclick="this\.select\(\)" type="text">(.*?)<\/textarea>/ism%html_entity_decode|}'),

//http://www.metacafe.com
array('/metacafe\.com\/watch\/(.*)\//i', '<embed src="http://www.metacafe.com/fplayer/{ID_VIDEO}.swf" width="400" height="345" wmode="transparent" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash"></embed>'),

//http://www.starsclips.net
array('/starsclips\.net\/videos\.aspx\/(.*)/i', '<object width="400" height="320"><param name="movie" value="http://www.starsclips.net/emb.aspx/{ID_VIDEO}"></param><param name="wmode" value="transparent"></param><embed src="http://www.starsclips.net/emb.aspx/{ID_VIDEO}" type="application/x-shockwave-flash" wmode="transparent" width="400" height="320"></embed></object>'),

//http://vids.myspace.com
array('/vids\.myspace\.com.*?videoID=([^&]*)/i', '<object width="430px" height="386px"><param name="wmode" value="transparent"/><param name="allowscriptaccess" value="always"/><param name="movie" value="http://lads.myspace.com/videos/vplayer.swf"/><param name="flashvars" value="m={ID_VIDEO}"/><embed src="http://lads.myspace.com/videos/vplayer.swf" width="430" height="386" flashvars="m={ID_VIDEO}" type="application/x-shockwave-flash" allowscriptaccess="always" /></object>'),

array('/myspacetv\.com.*?videoID=([^&]*)/i', '<object width="430px" height="386px"><param name="wmode" value="transparent"/><param name="allowscriptaccess" value="always"/><param name="movie" value="http://lads.myspace.com/videos/vplayer.swf"/><param name="flashvars" value="m={ID_VIDEO}"/><embed src="http://lads.myspace.com/videos/vplayer.swf" width="430" height="386" flashvars="m={ID_VIDEO}" type="application/x-shockwave-flash" allowscriptaccess="always" /></object>'),

//http://video.yahoo.com
array('/video\.yahoo.*vid=([^&]*)/i','<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={DOWNLOAD%/so\.addVariable\("id", "(.*?)"\);/%}&vid={ID_VIDEO}&thumbUrl={DOWNLOAD%/so\.addVariable\("thumbUrl", "(.*?)"\);/%}&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={DOWNLOAD%/so\.addVariable\("id", "(.*?)"\);/%}&vid={ID_VIDEO}&thumbUrl={DOWNLOAD%/so\.addVariable\("thumbUrl", "(.*?)"\);/%}&embed=1" ></embed></object>'),

//http://photobucket.com
array ('/(photobucket\.com)/i', '{DOWNLOAD%/<input name="txtThumbTag2" id="txtThumbTag2".*?value="(.*?)"/ism%html_entity_decode}'),

//http://files.filefront.com
array ('/(filefront\.com)/i','{DOWNLOAD%/<input type"text" id="embedSrc" value=\'(.*?)\'/ism%}'), 

//http://www.veoh.com
array ('/veoh\.com\/videos\/([^\?]*)/i', '<embed src="http://www.veoh.com/videodetails2.swf?permalinkId={ID_VIDEO}&id=anonymous&player=videodetailsembedded&videoAutoPlay=0" allowFullScreen="true" width="540" height="438" bgcolor="#000000" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"></embed>'),

//http://www.vidilife.com
array ('/(vidilife\.com)/i','{DOWNLOAD%/<input type="text" name="url1" value="(.*?)"/%}'),

//http://www.gametrailers.com
array ('/gametrailers\.com\/player\/(.*?).html/i', '<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={ID_VIDEO}"/> <param name="quality" value="high" /> <embed src="http://www.gametrailers.com/remote_wrap.php?mid={ID_VIDEO}" 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>'),

//http://www.vidiac.com
array ('/vidiac\.com\/video\/(.*?)\.htm/i', '<embed src="http://www.vidiac.com/vidiac.swf" FlashVars="video={ID_VIDEO}" quality="high" bgcolor="#ffffff" width="428" height="352" name="ePlayer" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"></embed>'),

//http://www.gamespot.com
array ('/gamespot\.com\/video\//i', '<embed id="mymovie" width="432" height="362" flashvars="playerMode=embedded&movieAspect=4.3&flavor=EmbeddedPlayerVersion&skin=http://image.com.com/gamespot/images/cne_flash/production/media_player/proteus/one/skins/gamespot.png&paramsURI={DOWNLOAD%/so\.addVariable\(\'paramsURI\', \'(.*?)\'\);/ism%}" wmode="transparent" allowscriptaccess="always" quality="high" name="mymovie" style="" src="http://image.com.com/gamespot/images/cne_flash/production/media_player/proteus/one/proteus2.swf" type="application/x-shockwave-flash"/>'),

//http://www.megavideo.com
array ('/(megavideo\.com)/i', '{DOWNLOAD%/<input type="text" value=\'(.*?)\'/%}'),

//http://www.vimeo.com
array ('/vimeo\.com\/([^&]*)/i', '<object class="swf_holder" type="application/x-shockwave-flash" width="506" height="380" data="http://www.vimeo.com/moogaloop_local.swf?clip_id={ID_VIDEO}&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="><param name="quality" value="high" /><param name="allowfullscreen" value="true" /><param name="scale" value="showAll" /><param name="movie" value="http://www.vimeo.com/moogaloop_local.swf?clip_id={ID_VIDEO}&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=" /></object>'),

//http://www.gamevideos.com
array ('/(gamevideos\.com)/i', '{DOWNLOAD%/Embed: <input.*value="(.*?)"/%html_entity_decode}'),

//http://www.tu.tv
array ('/(tu\.tv)/i', '{DOWNLOAD%/<input name="html".*value=\'(.*?)\'/%}'),

//http://www.godtube.com
array ('/godtube\.com.*viewkey=([^&]*)/i', '<embed src="http://godtube.com/flvplayer.swf" FlashVars="viewkey={ID_VIDEO}" wmode="transparent" quality="high" width="330" height="270" name="godtube" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></embed>'),

//http://www.myvideo.de
array ('/myvideo.de\/watch\/(.*?)\//i', "<object style='width:470px;height:406px;' width='470' height='406' type='application/x-shockwave-flash' data='http://www.myvideo.de/movie/{ID_VIDEO}'><param name='movie' value='http://www.myvideo.de/movie/{ID_VIDEO}'/><param name='AllowFullscreen' value='true' /><embed src='http://www.myvideo.de/movie/{ID_VIDEO}' width='470' height='406'></embed></object>"),

//http://www.collegehumor.com/
array ('/collegehumor.*video:(.*)/i', '<object type="application/x-shockwave-flash" data="http://www.collegehumor.com/moogaloop/moogaloop.swf?clip_id=1819139&fullscreen=1" width="480" height="360" ><param name="allowfullscreen" value="true" /><param name="movie" quality="best" value="http://www.collegehumor.com/moogaloop/moogaloop.swf?clip_id={ID_VIDEO}&fullscreen=1" /></object>'),

//http://www.comedycentral.com
array ('/comedycentral.*videoId=([^&]*)/i', "<embed FlashVars='videoId={ID_VIDEO}' src='http://www.comedycentral.com/sitewide/video_player/view/default/swf.jhtml' quality='high' bgcolor='#cccccc' width='332' height='316' name='comedy_central_player' align='middle' allowScriptAccess='always' allownetworking='external' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer'></embed>"),

//http://www.slideshare.net
array ('/(slideshare\.net)/i', '{DOWNLOAD%/<input.*?id="embedded_code" value="(.*?)"/%html_entity_decode}'),

//http://www.revver.com
array ('/revver\.com\/video\/(.*?)\//i', '<script src="http://flash.revver.com/player/1.0/player.js?mediaId:{ID_VIDEO};width:480;height:392;" type="text/javascript"></script>'),

//http://de.sevenload.com
array ('/sevenload\.com\/videos\/(.*?)-/i', '<script type="text/javascript" src="http://de.sevenload.com/pl/{ID_VIDEO}/500x408"></script>'),

//http://www.clipfish.de
array ('/clipfish\.de.*?videoid=([^&]*)/i', "<object width='464' height='380'><param name='movie' value='http://www.clipfish.de/videoplayer.swf?videoid={ID_VIDEO}' /><param name='allowFullScreen' value='true' /><embed src='http://www.clipfish.de/videoplayer.swf?videoid=MTMyNzg4fDI0NTY3MzM' width='464' height='380' name='player' allowFullScreen='true' type='application/x-shockwave-flash'></embed></object>"),

);
foreach ($values as $value){
if (preg_match($value[0], $link, $matches)){
$id_video=$matches[1];
return preg_replace_callback('/{.*?}/', create_function('$matches', 'switch (true){
case preg_match("/\{ID_VIDEO\}/", $matches[0]):
return "'.$id_video.'";
break;
case preg_match("/\{LINK\}/", $matches[0]):
return "'.$link.'";
break;
case preg_match("/\{DOWNLOAD(.*?)%(.*?)%(.*?)\}/", $matches[0], $matches2):
if (empty($matches2[1])) $matches2[1]="'.$link.'";
preg_match($matches2[2], file_get_contents(str_replace(" ","+",$matches2[1])), $matches3);
if (empty($matches2[3])){
return $matches3[1];
}else{
$t=$matches3[1];
foreach(explode("|", $matches2[3]) as $e){
eval(\'$t=\'.$e.\'($t);\');
}
return $t;
}
break;
}
return $matches[0];'), $value[1]);
}
}
return 'Error, site not recognized';
}
?>

These it will produce

[video]http://youtube.com/watch?v=IiJdn6bg3fs[/video]
[video]http://video.google.it/videoplay?docid=-1807566009355608301[/video]
[video]http://dailymotion.alice.it/video/x3gvg0_baby-break-dance_fun[/video]
[video]http://www.metacafe.com/watch/976183/amazing_denver_zoo_lights_2007/[/video]
[video]http://starsclips.net/videos.aspx/video~no_break_girls_boxing_824/No_break_girls_boxing/Funny_videos/[/video]
[video]http://vids.myspace.com/index.cfm?fuseaction=vids.individual&videoID=1590276358[/video]
[video]http://video.yahoo.com/video/play?vid=1845135&fr=&cache=1[/video]
[video]http://photobucket.com/mediadetail/?media=%2Fplayer.swf%3Ffile%3Dhttp%3A%2F%2Fvid209.photobucket.com%2Falbums%2Fbb146%2Fgirlsrule619_photo%2FCIMG1214.flv&searchTerm=&pageOffset=[/video]
[video]http://files.filefront.com/Conflict+Denied+Ops+Launch+Trailer/;9506302;/fileinfo.html[/video]
[video]http://www.veoh.com/videos/v3307355BSa7tBwK?source=featured&cmpTag=featured&rank=3[/video]
[video]http://www.vidilife.com/video_play_1125851_Not_Karate.htm?hmtrk=Not_Karate[/video]
[video]http://www.gametrailers.com/player/30032.html[/video]
[video]http://www.vidiac.com/video/7fd7de8b-67e8-4ffb-a5bd-991900422e1a.htm[/video]
[video]http://www.gamespot.com/video/938343/6185167/videoplayerpop?[/video]
[video]http://www.megavideo.com/?v=QZ4O9C8P[/video]
[video]http://www.vimeo.com/173714[/video]
[video]http://www.gamevideos.com/video/id/17281[/video]
[video]http://www.tu.tv/videos/nuco-diga-no-a-una-mujer[/video]
[video]http://www.godtube.com/view_video.php?viewkey=9c72e4dcbe79c288680e[/video]
[video]http://www.myvideo.de/watch/4276644/Handys_boese[/video]
[video]http://www.collegehumor.com/video:1819139[/video]
[video]http://www.comedycentral.com/videos/index.jhtml?videoId=173093[/video]
[video]http://www.slideshare.net/ewan.mcintosh/unleasing-the-tribe/[/video]
[video]http://www.revver.com/video/129859/poker-player/[/video]
[video]http://de.sevenload.com/videos/7oREPw6-Simpsons-Intro-mit-Schauspielern[/video]
t=ft_2_unset_video&utm_campaign=cf[/video]
[video]http://www.clipfish.de/player.php?videoid=MTMyNzg4fDI0NTY3MzM%3D&tl=4712&utm_source=ft&utm_medium=ft_2&utm_term=ft_2_unset&utm_content=ft_2_unset_video&utm_campaign=cf[/video]

That Code was written for phpBB by Fraev.

This is the current manifest.xml by neck.

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE extension SYSTEM "ext-1.0.dtd">

<!--
/**
 * VideoTag extension for PunBB forum
 * Offer a new BBcode tag to display embedded flash videos.
 *
 * @author Neck - http://www.eikylon.net
 * @license GPL - http://www.gnu.org/copyleft/gpl.html
 * @package ek_videotag
 */
-->

<extension engine="1.0">
    <id>ek_videotag</id>
    <title>VideoTag</title>
    <version>0.2.0</version>
    <description>New BBcode tag ([video]) to display embedded flash videos.</description>
    <author>Neck - http://www.eikylon.net</author>
    <minversion>1.3</minversion>
    <maxtestedon>1.3.2</maxtestedon>

    <hooks>
        <hook id="he_new_bbcode_link"><![CDATA[

// add our lang file
if (file_exists($ext_info['path'].'/lang/'.$forum_user['language'].'.php')) {
    require($ext_info['path'].'/lang/'.$forum_user['language'].'.php');
} else {
    require($ext_info['path'].'/lang/English.php');
}
$lang_help = array_merge($lang_help, $lang_help_video);
?>
<div class="entry-content">
    <code>[video]<?php echo $lang_help['video_uri'] ?>[/video]</code><span><?php echo $lang_help['produces'] ?></span>
    <?php echo $lang_help['video_display'] ?>
</div><?php

        ]]></hook>
        <hook id="ps_start"><![CDATA[

// tag handling function
function handle_video_tag($videoUri) {
    global $forum_config;
    $match = array();

    // dirty trick to play arround do_clickable
    preg_match('`href="([^"]+)"`', stripslashes($videoUri), $match);
    if(!empty($match[1])) {
        $videoUri = $match[1];
    }

    // the services list
    $service = array(
        'youtube' => array(
            'match'=>'`watch\?v=([-_a-z0-9]+)`i',
            'uri'=>'http://www.youtube.com/v/%s&amp;rel=0',
            'width'=>425,
            'height'=>344
        ),
        'dailymotion' => array(
            'match'=>'`video/([a-z0-9]+)_`i',
            'uri'=>'http://www.dailymotion.com/swf/%s&amp;amp;related=0&amp;amp;canvas=medium',
            'width'=>480,
            'height'=>381
        ),
        'vimeo' => array(
            'match'=>'`/([0-9]+)`',
            'uri'=>'http://www.vimeo.com/moogaloop.swf?clip_id=%s&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;fullscreen=1',
            'width'=>400,
            'height'=>302
        ),
        'google' => array(
            'match'=>'`\?docid=(-?[0-9]+)`',
            'uri'=>'http://video.google.com/googleplayer.swf?docId=%s',
            'width'=>425,
            'height'=>364
        )
    );

    // extract service's name and check for support
    preg_match('`^http://(?:[^\.]*\.)?([^\.]*)\.[^/]*/`i', $videoUri, $match);
    if(empty($match[1]) || !array_key_exists($match[1], $service)) {
        return '<a href="'.$videoUri.'">[video (unkown provider)]</a>';
    }
    $s = $service[$match[1]];

    // extract videoId
    preg_match($s['match'], $videoUri, $match);
    if(empty($match[1])) {
        return '<a href="'.$videoUri.'">[video (cant extract ID)]</a>';
    }
    $playerUri = sprintf($s['uri'], $match[1]);

    // display flash player
    return
        '<object type="application/x-shockwave-flash" data="'.$playerUri.'" width="'.$s['width'].'" height="'.$s['height'].'">'.
            '<param name="movie" value="'.$playerUri.'" />'.
            '<param name="wmode" value="transparent" />'.
            '<param name="allowfullscreen" value="true" />'.
            '<p><a href="'.$videoUri.'">[video (flash player not installed)]</a></p>'.
        '</object>';
}

        ]]></hook>
        <hook id="ps_preparse_tags_start"><![CDATA[

// add our tag to the list
$tags[] = 'video';
$tags_opened[] = 'video';
$tags_closed[] = 'video';
$tags_inline[] = 'video';
$tags_trim[] = 'video';
// we must allow url due to do_clickable
$tags_limit_bbcode['video'] = array('url');

        ]]></hook>

        <hook id="ps_do_bbcode_replace"><![CDATA[

// add pattern to catch [video]blahblah[/video]
$pattern[] = '`\[video\]([^\[]+)\[/video\]`e';
$replace[] = 'handle_video_tag(\'$1\')';

        ]]></hook>
    </hooks>

</extension>

I hope its easy to add those to the list.

Thanks

MyFootballCafe.com  is Now Online!

Re: [Release] VideoTag (v0.2.0)

bump big_smile

MyFootballCafe.com  is Now Online!