Re: [Release] VideoTag (v0.2.0)

can any one give few tips, or convert just one type of video code, so i can do the rest my self. it would be really appreciated, thanks in advance.

MyFootballCafe.com  is Now Online!

27

Re: [Release] VideoTag (v0.2.0)

Supermag... what up with the spamming links for download on your neoshares site... i find it very useful for the templates but as for the spammmmmm attacks from the ads...

I can live with out...


Q

My stuff or my style might sux, but atleast I'm willing to help when I can.
Don't be stupid and help ! We are the stupid one's !!!

Re: [Release] VideoTag (v0.2.0)

huh, what spam. its a download site. it was just a sentence. smile

MyFootballCafe.com  is Now Online!

29

Re: [Release] VideoTag (v0.2.0)

one of your wordpress template that i posted on at your site. tried to install some spyware software and about 20 windows tried to open up...

err..

Q

My stuff or my style might sux, but atleast I'm willing to help when I can.
Don't be stupid and help ! We are the stupid one's !!!

Re: [Release] VideoTag (v0.2.0)

mmm have no idea what you talking about, can you show me a link or something

MyFootballCafe.com  is Now Online!

31

Re: [Release] VideoTag (v0.2.0)

sent you and email via punbb...

scott @ nalan dot org

My stuff or my style might sux, but atleast I'm willing to help when I can.
Don't be stupid and help ! We are the stupid one's !!!

Re: [Release] VideoTag (v0.2.0)

replied

MyFootballCafe.com  is Now Online!

Re: [Release] VideoTag (v0.2.0)

hey quaker, do u know a little bit about php.

i realy need to add these features. may be you can give me few tips by converting only one type of these videos.


SuperMAG wrote:

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)

how can i add the button, anyone know?

I have instyall the ext, but when i do a post, there is no video tag button?

35 (edited by ingram 2009-08-24 18:27)

Re: [Release] VideoTag (v0.2.0)

how to make this specific video tag to not work in signatures? Without affecting other textformatting...

Re: [Release] VideoTag (v0.2.0)

Hi, thanks for this extension.
Is it possible to add a button to put the video tag easily :=)?

Re: [Release] VideoTag (v0.2.0)

lbouriez wrote:

Hi, thanks for this extension.
Is it possible to add a button to put the video tag easily :=)?

Hi

open extensions/pun_bbcode/bar.php and find



// List of tags, which may have attribute
    $tags_without_attr = array('b', 'i', 'u', 'email', 'list', 'li' => '*', 'quote', 'code', 'url');


add 'video', into this just after 'quote',

Then upload the icon you wish to use as a button to extensions/pun_bbcode/buttons/THEME NAME/



hope that helps

Re: [Release] VideoTag (v0.2.0)

It's perfect and the video icon was already there big_smile

Thanks

39

Re: [Release] VideoTag (v0.2.0)

Dont seem too be working in latest version of punbb.


all i get is
[video (unkown provider)]

from an youtube link (the example one in first post=

40

Re: [Release] VideoTag (v0.2.0)

@tokyo Weird, just tried it out, and works fine for me neutral

Eraversum - scifi browser-based online webgame

41

Re: [Release] VideoTag (v0.2.0)

Just realized i got hide referer on all urls...probably the reason to why it dont work

42

Re: [Release] VideoTag (v0.2.0)

has this extension been updated?