Autor Tópico: Auto Embed Video Clips  (Lida 7125 vezes)

0 Membros e 4 Visitantes estão a ver este tópico.

Offline candidosa2

  • Suporte Tecnico
  • Fundador
  • *
  • Mensagens: 5072
  • Rank: 1658
  • Sexo: Masculino
  • Suporte
    • Hosting Moçambique
Auto Embed Video Clips
« em: 10 de Novembro de 2008, 07:03 »

Load.php

Pesquisar
Código: [Seleccione]
$profile['signature'] = parse_bbc($profile['signature'], true, 'sig' . $profile['ID_MEMBER']);
Colocar por baixo
Código: [Seleccione]
$context['disableautoembedvideo'] = 1 ;
Subs.php
Pesquisar por
Código: [Seleccione]
$message = strtr($message, array('  ' => ' &nbsp;', "\r" => '', "\n" => '<br />', '<br /> ' => '<br />&nbsp;', '' => "\n"));
Colocar por Baixo
Código: [Seleccione]
// START OF AUTO EMBED VIDEO CLIPS MOD

// Disables if on printer friendly page or if told to disable eg signatures
if($smileys !== "print" && empty($context['disableautoembedvideo']))
{
$embed = array();
 
$embed[] = array(
'name' => '123video.nl',
'enabled' => 1,
'pattern' => 'http://(?:www\.|)123video\.nl/playvideos\.asp\?MovieID=([0-9]{1,8})(?:.*?)',
'embedlink' => 'http://www.123video.nl/123video_share.swf?mediaSrc=$1',
'width' => '420',
'height' => '339',
'classid' => 'clsid:d27cdb6e-ae6d-11cf-96b8-444553540000',
);
$embed[] = array(
'name' => 'Aniboom',
'enabled' => 1,
'pattern' => 'http://(?:www\.|)aniboom\.com/Player.aspx\?v=([0-9]{1,8})(?:.*?)',
'embedlink' => 'http://api.aniboom.com/embedded.swf?videoar=$1',
'width' => '448',
'height' => '372',
);
$embed[] = array(
'name' => 'AOL Uncut',
'enabled' => 1,
'pattern' => 'http://uncutvideo\.aol\.com/videos/([0-9a-f]{32})(?:.*?)',
'embedlink' => 'http://uncutvideo.aol.com/v6.220/en-US/uc_videoplayer.swf?aID=1$1&site=http://uncutvideo.aol.com/',
'width' => '415',
'height' => '347',
'extraparams' => array('allowFullScreen' => 'true'),
);
$embed[] = array(
'name' => 'AtomFilms',
'enabled' => 1,
'pattern' => 'http://(?:www\.|)atomfilms\.com/film/([0-9a-z_-]{1,40})\.jsp(?:.*?)',
'embedlink' => 'http://www.atomfilms.com:80/a/autoplayer/shareEmbed.swf?keyword=$1',
'width' => '426',
'height' => '350',
'extraparams' => array('allowFullScreen' => 'true'),
);
$embed[] = array(
'name' => 'AtomFilms Uploads',
'enabled' => 1,
'pattern' => 'http://uploads\.atomfilms\.com/Clip\.aspx\?key=([0-9a-f]{1,16})(?:.*?)',
'embedlink' => 'http://uploads.atomfilms.com/player.swf?key=$1',
'width' => '430',
'height' => '354',
'extraparams' => array('allowFullScreen' => 'true'),
);
$embed[] = array(
'name' => 'Biku',
'enabled' => 1,
'pattern' => 'http://(?:www\.|)biku\.com/opus/(?:player.swf\?VideoID=|)([0-9]{1,8})(?:.*?)',
'embedlink' => 'http://www.biku.com/opus/player.swf?VideoID=$1&embed=true&autoStart=false',
'width' => '480',
'height' => '395',
);
$embed[] = array(
'name' => 'BrightCove',
'enabled' => 1,
'pattern' => 'http://(?:www\.|)brightcove\.(tv|com)/title.jsp\?title=([0-9]{1,12})(?:.*?)',
'embedlink' => 'http://www.brightcove.$1/playerswf?allowFullScreen=true&initVideoId=$2&servicesURL=http://www.brightcove.tv'
.'&viewerSecureGatewayURL=https://www.brightcove.tv&cdnURL=http://admin.brightcove.com&autoStart=false',
'width' => '486',
'height' => '412',
'extraparams' => array('swLiveConnect' => 'true'),
);
$embed[] = array(
'name' => 'CellFish',
'enabled' => 1,
'pattern' => 'http://cellfish\.cellfish\.com/(?:video|multimedia)/([0-9]{1,8})(?:.*?)',
'embedlink' => 'http://cellfish.com/static/swf/player.swf?Id=$1',
'width' => '420',
'height' => '315',
);
$embed[] = array(
'name' => 'ClipFish.de',
'enabled' => 1,
'pattern' => 'http://(?:www\.|)clipfish\.de/(?:player.php|videoplayer\.swf)\?(?:.*?)videoid=([a-z0-9]{1,20})(?:.*?)',
'embedlink' => 'http://www.clipfish.de/videoplayer.swf?as=0&videoid=$1&r=1&c=0067B3',
'width' => '464',
'height' => '380',
'classid' => 'clsid:d27cdb6e-ae6d-11cf-96b8-444553540000',
'extraparams' => array('allowFullScreen' => 'true'),
);
$embed[] = array(
'name' => 'CollegeHumor',
'enabled' => 1,
'pattern' => 'http://(?:www\.|)collegehumor\.com/video:([0-9]{1,12})(?:.*?)',
'embedlink' => 'http://www.collegehumor.com/moogaloop/moogaloop.swf?clip_id=$1',
'width' => '480',
'height' => '360',
'extraparams' => array('allowFullScreen' => 'true'),
);
$embed[] = array(
'name' => 'Dave.tv',
'enabled' => 1,
'pattern' => 'http://(?:www\.|)dave\.tv/MediaPlayer.aspx\?contentItemId=([0-9]{1,10})(?:.*?)',
'embedlink' => 'http://dave.tv/dbox/dbox_small.swf?configURI=http://dave.tv/dbox/config.ashx&volume=50&channelContentId=$1',
'width' => '300',
'height' => '260',
'extraparams' => array('allowFullScreen' => 'true'),
);
$embed[] = array(
'name' => 'dv.ouou',
'enabled' => 1,
'pattern' => 'http://dv\.ouou\.com/(?:play/v_|v/)([a-f0-9]{14})(?:.*?)',
'embedlink' => 'http://dv.ouou.com/v/$1',
'width' => '480',
'height' => '385',
);
$embed[] = array(
'name' => 'ESPN',
'enabled' => 1,
'pattern' => 'http://sports\.espn\.go\.com/broadband/video/videopage\?(?:.*?)videoId=([0-9]{1,10})(?:.*?)',
'embedlink' => 'http://sports.espn.go.com/broadband/player.swf?mediaId=$1',
'width' => '440',
'height' => '361',
'extraparams' => array('allowFullScreen' => 'true'),
);
$embed[] = array(
'name' => 'Gametrailers',
'enabled' => 1,
'pattern' => 'http://(?:www\.|)gametrailers\.com/player/([0-9]{1,8})\.html(?:.*?)',
'embedlink' => 'http://www.gametrailers.com/remote_wrap.php?mid=$1',
'width' => '480',
'height' => '392',
'classid' => 'clsid:d27cdb6e-ae6d-11cf-96b8-444553540000',
'extraparams' => array('swLiveConnect' => 'true'),
);
$embed[] = array(
'name' => 'GameVideos',
'enabled' => 1,
'pattern' => 'http://(?:www\.|)gamevideos\.com/(?:video/id/|video/embed\?video=)([0-9]{1,8})(?:.*?)',
'embedlink' => 'http://gamevideos.com:80/swf/gamevideos11.swf?embedded=1&autoplay=0&src=http://gamevideos.com:80/video/videoListXML%3Fid%3D$1%26adPlay%3Dfalse',
'width' => '420',
'height' => '405',
);
$embed[] = array(
'name' => 'Glumbert',
'enabled' => 1,
'pattern' => 'http://(?:www\.|)glumbert\.com/media/([a-z0-9_-]{1,30})(?:.*?)',
'embedlink' => 'http://www.glumbert.com/embed/$1',
'width' => '425',
'height' => '335',
);
$embed[] = array(
'name' => 'Godtube',
'enabled' => 1,
'pattern' => 'http://(?:www\.|)godtube\.com/view_video\.php\?viewkey=([0-9a-f]{20})(?:.*?)',
'embedlink' => 'http://godtube.com/flvplayer.swf?viewkey=$1',
'width' => '330',
'height' => '270',
'extraparams' => array('allowFullScreen' => 'true'),
);
$embed[] = array(
'name' => 'Google Video',
'enabled' => 1,
'pattern' => 'http://video\.google\.(com|com\.au|co\.uk|de|es|fr|it|nl|pl|ca)/(?:videoplay|url)\?docid=([0-9a-z-_]{1,20})(?:.*?)',
'embedlink' => 'http://video.google.$1/googleplayer.swf?docId=$2',
'width' => '400',
'height' => '326',
);
$embed[] = array(
'name' => 'Guba',
'enabled' => 1,
'pattern' => 'http://(?:www\.|)guba\.com/watch/([0-9]{1,12})(?:.*?)',
'embedlink' => 'http://www.guba.com/f/root.swf?video_url=http://free.guba.com/uploaditem/$1/flash.flv&amp;isEmbeddedPlayer=true',
'width' => '525',
'height' => '360',
);
$embed[] = array(
'name' => 'IFilm',
'enabled' => 1,
'pattern' => 'http://(?:www\.|)ifilm.com/video/([0-9]{1,8})(?:.*?)',
'embedlink' => 'http://www.ifilm.com/efp?flvbaseclip=$1',
'width' => '448',
'height' => '365',
);
$embed[] = array(
'name' => 'Koreus',
'enabled' => 1,
'pattern' => 'http://(?:www\.|)koreus\.com/video/([0-9a-z-]{1,50})\.html(?:.*?)',
'embedlink' => 'http://www.koreus.com/video/$1',
'width' => '400',
'height' => '300',
'extraparams' => array('allowFullScreen' => 'true'),
);
$embed[] = array(
'name' => 'Libero.it',
'enabled' => 1,
'pattern' => 'http://video\.libero\.it/app/play(?:/index.html|)\?id=([a-f0-9]{32})(?:.*?)',
'embedlink' => 'http://video.libero.it/static/swf/eltvplayer.swf?id=$1.flv&ap=0',
'width' => '400',
'height' => '333',
);
$embed[] = array(
'name' => 'LiveLeak',
'enabled' => 1,
'pattern' => 'http://(?:www\.|)liveleak\.com/view\?i=([0-9a-z]{3}_|)([a-z0-9]{10})(?:.*?)',
'embedlink' => 'http://www.liveleak.com/player.swf?autostart=false&token=$1$2',
'width' => '450',
'height' => '370',
);
$embed[] = array(
'name' => 'LiveVideo',
'enabled' => 1,
'pattern' => 'http://(?:www\.|)livevideo\.com/video/(?:view/|)(?:(?:.*?)/|)([0-9a-f]{32})(?:.*?)',
'embedlink' => 'http://www.livevideo.com/flvplayer/embed/$1',
'width' => '445',
'height' => '369',
'extraparams' => array('allowFullScreen' => 'true'),
);
$embed[] = array(
'name' => 'Megavideo',
'enabled' => 1,
'pattern' => 'http://(?:www\.|)megavideo\.com/\?v=([0-9a-z]{8})(?:.*?)',
'embedlink' => 'http://www.megavideo.com/v/$1.0.0',
'width' => '432',
'height' => '351',
'extraparams' => array('allowFullScreen' => 'true'),
);
$embed[] = array(
'name' => 'MetaCafe',
'enabled' => 1,
'pattern' => 'http://(?:www\.|)metacafe\.com/(?:watch|fplayer)/([0-9]{1,10})/(?:.*?)',
'embedlink' => 'http://www.metacafe.com/fplayer/$1/metacafe.swf',
'width' => '400',
'height' => '345',
);
$embed[] = array(
'name' => 'MSN Live/Soapbox Video',
'enabled' => 1,
'pattern' => 'http://(?:soapbox|video)\.msn\.com/video\.aspx\?(?:(?:.*?)vid=|from=msnvideo&showPlaylist=true&playlist=videoByUuids:uuids:)((?:[0-9a-z]{8})(?:(?:-(?:[0-9a-z]{4})){3})-(?:[0-9a-z]{12}))(?:.*?)',
'embedlink' => 'http://images.video.msn.com/flash/soapbox1_1.swf?c=v&v=$1',
'width' => '432',
'height' => '364',
'extraparams' => array('allowFullScreen' => 'true'),
);
$embed[] = array(
'name' => 'Mofile',
'enabled' => 1,
'pattern' => 'http://(?:www\.|tv\.|)mofile\.com/([0-9a-z]{8})(?:.*?)',
'embedlink' => 'http://tv.mofile.com/cn/xplayer.swf?v=$1',
'width' => '480',
'height' => '395',
'extraparams' => array('allowFullScreen' => 'true'),
);
$embed[] = array(
'name' => 'MySpaceTv',
'enabled' => 1,
'pattern' => 'http://(?:vids\.myspace|myspacetv)\.com/index\.cfm\?fuseaction=vids\.individual&amp;VideoID=([0-9]{1,10})(?:.*?)',
'embedlink' => 'http://lads.myspace.com/videos/myspacetv_vplayer0005.swf?m=$1&amp;type=video',
'width' => '480',
'height' => '386',
);
$embed[] = array(
'name' => 'MyVideo.de',
'enabled' => 1,
'pattern' => 'http://(?:www\.|)myvideo\.de/watch/([0-9]{1,8})(?:.*?)',
'embedlink' => 'http://www.myvideo.de/movie/$1',
'width' => '470',
'height' => '406',
'extraparams' => array('allowFullScreen' => 'true'),
);
$embed[] = array(
'name' => 'OnSmash',
'enabled' => 1,
'pattern' => 'http://(?:www\.|videos\.|)onsmash\.com/(?:v|e)/([0-9a-z]{16})(?:.*?)',
'embedlink' => 'http://videos.onsmash.com/e/$1',
'width' => '448',
'height' => '374',
'extraparams' => array('allowFullScreen' => 'true'),
);
$embed[] = array(
'name' => 'Revver',
'enabled' => 1,
'pattern' => 'http://(?:one\.|www\.|)revver\.com/watch/([0-9]{1,8})(?:.*?)',
'embedlink' => 'http://flash.revver.com/player/1.0/player.swf?mediaId=$1&affiliateId=0&allowFullScreen=true',
'width' => '480',
'height' => '392',
);
$embed[] = array(
'name' => 'Sevenload',
'enabled' => 1,
'pattern' => 'http://(en\.|tr\.|de\.|www\.|)sevenload\.com/(?:videos|videolar)/([0-9a-z]{1,8})(?:.*?)',
'embedlink' => 'http://$1sevenload.com/pl/$2/425x350/swf',
'width' => '425',
'height' => '350',
);
$embed[] = array(
'name' => 'Stage6',
'enabled' => 1,
'pattern' => 'http://(?:(?:www\.)stage6|stage6\.divx)\.com/(?:.*?)/video/([0-9]{1,11})/(?:.*?)',
'embedlink' => 'http://video.stage6.com/$1/.divx',
'src' => 1, // Special, Stage6 use src rather than video, this bool, tells me to use src instead
'width' => '640',
'height' => '480',
'codebase' => 'http://go.divx.com/plugin/DivXBrowserPlugin.cab',
'pluginspage' => 'http://go.divx.com/plugin/download/',
'classid' => 'clsid:67DABFBF-D0AB-41fa-9C46-CC0F21721616',
'type' => 'video/divx',
'extraparams' => array(
'custommode' => 'false',
'showpostplaybackad' => 'false',
'autoPlay' => 'false',
),
);
$embed[] = array(
'name' => 'Streetfire.net',
'enabled' => 1,
'pattern' => 'http://(?:www\.|videos\.|)streetfire\.net/video/((?:[0-9a-z]{8})(?:(?:-(?:[0-9a-z]{4})){3})-(?:[0-9a-z]{12}))\.htm(?:.*?)',
'embedlink' => 'http://videos.streetfire.net/vidiac.swf?video=$1',
'width' => '428',
'height' => '352',
'extraparams' => array('allowFullScreen' => 'true'),
);
$embed[] = array(
'name' => 'Tudou',
'enabled' => 1,
'pattern' => 'http://(?:www\.|)tudou\.com/(?:programs/view/|v/)([a-z0-9-]{1,12})(?:.*?)',
'embedlink' => 'http://www.tudou.com/v/$1',
'width' => '400',
'height' => '300',
);
$embed[] = array(
'name' => 'Veoh',
'enabled' => 1,
'pattern' => 'http://(?:www\.|)veoh\.com/videos/([0-9a-z]{14,16})(?:.*?)',
'embedlink' => 'http://www.veoh.com/videodetails2.swf?permalinkId=$1&id=anonymous&player=videodetailsembedded&videoAutoPlay=0',
'width' => '540',
'height' => '438',
'extraparams' => array('allowFullScreen' => 'true'),
);
$embed[] = array(
'name' => 'videotube.de',
'enabled' => 1,
'pattern' => 'http://(?:www\.|)videotube\.de/watch/([0-9]{1,8})(?:.*?)',
'embedlink' => 'http://www.videotube.de/flash/player.swf?baseURL=http%3A%2F%2Fwww.videotube.de%2Fwatch%2F$1',
'width' => '480',
'height' => '400',
'extraparams' => array('allowFullScreen' => 'true'),
);
$embed[] = array(
'name' => 'Vidiac',
'enabled' => 1,
'pattern' => 'http://(?:www\.|)vidiac\.com/video/((?:[0-9a-z]{8})(?:(?:-(?:[0-9a-z]{4})){3})-(?:[0-9a-z]{12}))\.htm(?:.*?)',
'embedlink' => 'http://www.vidiac.com/vidiac.swf?video=$1',
'width' => '428',
'height' => '352',
);
$embed[] = array(
'name' => 'VidMax',
'enabled' => 1,
'pattern' => 'http://(?:www\.|)vidmax\.com/index\.php/videos/view/([0-9]{1,10})(?:.*?)',
'embedlink' => 'http://vidmax.com/img/vidmax_player.swf?xml=http://vidmax.com/index.php/videos/playlist/&id=$1&autoPlay=true&bg=http://vidmax.com/img/back.jpg',
'width' => '450',
'height' => '447',
'extraparams' => array('allowFullScreen' => 'true'),
);
$embed[] = array(
'name' => 'Vimeo',
'enabled' => 1,
'pattern' => 'http://(?:www\.|)vimeo\.com/([0-9]{1,12})(?:.*?)',
'embedlink' => 'http://vimeo.com/moogaloop.swf?clip_id=$1&amp;server=vimeo.com&amp;fullscreen=1&amp;show_title=1'
.'&amp;show_byline=1&amp;show_portrait=0&amp;color=01AAEA',
'width' => '400',
'height' => '225',
);
$embed[] = array(
'name' => 'VSocial',
'enabled' => 1,
'pattern' => 'http://(?:www\.|)vsocial\.com/video/\?d=([0-9]{1,8})(?:.*?)',
'embedlink' => 'http://static.vsocial.com/flash/ups.swf?d=$1&a=0',
'width' => '410',
'height' => '400',
);
$embed[] = array(
'name' => 'Yahoo (Except HK)',
'enabled' => 1,
'pattern' => 'http://(?:(?:www|uk|fr|it|es|br|au|mx|de|ca)\.|)video\.yahoo\.com/video/play\?vid=([0-9]{1,10})(?:.*?)',
'embedlink' => 'http://us.i1.yimg.com/cosmos.bcst.yahoo.com/player/media/swf/FLVVideoSolo.swf?id=$1',
'width' => '425',
'height' => '350',
'extraparams' => array('allowFullScreen' => 'true'),
);
$embed[] = array(
'name' => 'Yahoo HK Only',
'enabled' => 1,
'pattern' => 'http://hk\.video\.yahoo\.com/video/video\.html\?id=([0-9]{1,10})(?:.*?)',
'embedlink' => 'http://w.video.hk.yahoo.net/video/dplayer.html?vid=$1',
'width' => '420',
'height' => '370',
'extraparams' => array('allowFullScreen' => 'true'),
);
$embed[] = array(
'name' => 'Youku',
'enabled' => 1,
'pattern' => 'http://(?:v\.youku\.com/v_show/id_(?:[0-9a-z]{4})|player\.youku\.com/player\.php/sid/)([0-9a-z]{6,14})(?:.*?)',
'embedlink' => 'http://player.youku.com/player.php/sid/$1=/v.swf',
'width' => '450',
'height' => '372',
);
$embed[] = array(
'name' => 'YouTube',
'enabled' => 1,
'pattern' => 'http://(?:(?:www|uk|fr|ie|it|jp|pl|es|nl|br|au|hk|mx|nz|de|ca)\.|)youtube\.com/(?:(?:watch|)\?v=|v/|jp\.swf\?video_id=)([0-9A-Za-z-_]{11})(?:.*?)',
'embedlink' => 'http://www.youtube.com/v/$1',
'width' => '425',
'height' => '350',
);
$embed[] = array(
'name' => 'YouTube Playlist',
'enabled' => 1,
'pattern' => 'http://(?:(?:www|uk|fr|ie|it|jp|pl|es|nl|br|au|hk|mx|nz|de|ca)\.|)youtube\.com/(?:ep\.swf\?id=|view_play_list\?p=|p/)([0-9a-f]{16})(?:.*?)',
'embedlink' => 'http://www.youtube.com/p/$1',
'width' => '425',
'height' => '355',
);

// Max auto embeds *per page* to avoid flash overload. It only applies to this mod, and not other video mods
// Use -1 for no-limit (not recommended)
static $autoembedmax = 12 ;
 
// Protect any noembed links
if(preg_match_all('#\[noembed\](.*?)\[/noembed\]#im', $message, $noembed, PREG_SET_ORDER))
{
foreach ($noembed as $a => $b)
// Including the [noembed] ensures it will always be unique (since we are replacing [noembed])
$message = str_replace($b[0],'[noembed]###NOEMBEDPROTECTED#'.$a.'##[/noembed]',$message);
unset($a,$b);
}

// Now do the magic, convert those links in messages to automatically embed the videos
foreach($embed as $id => $arr)
{
// If this site is enabled and if we haven't reached our max replacements
if($arr['enabled'] && $autoembedmax != 0)
{
// Build the extraparams for <object> & <embed>
$object = $objectparams = $embedparams = '';
if(isset($arr['extraparams']) && is_array($arr['extraparams']))
{
foreach($arr['extraparams'] as $a => $b)
{
$objectparams .= '
<param name="'.$a.'" value="'.$b.'" />';
$embedparams .= ' '.$a.'="'.$b.'"';
}
}
// Build the <object> (Non-Mac IE Only)
if($context['browser']['is_ie'] && !$context['browser']['is_mac_ie'])
{
$object = '<object' .
' codebase="'.(empty($arr['codebase']) ? 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0' : $arr['codebase'] ) .'" '.
( empty($arr['classid']) ? '' : 'classid="'.$arr['classid'].'" ' ) .
'type="'. (empty($arr['type']) ? 'application/x-shockwave-flash' : $arr['type'] ) .'" '.
'width="'.$arr['width'].'px" height="'.$arr['height'].'px">'.
'<param name="'.( empty($arr['src']) ? 'movie' : 'src' ).'" value="'.$arr['embedlink'].'" />'.
( !empty($objectparams) ? $objectparams : '' ) .
'<param name="wmode" value="transparent" /><param name="allowScriptAccess" value="never" />'.
'<param name="quality" value="high" /><param name="pluginspage" value="'.( empty($arr['pluginspage']) ? 'http://www.macromedia.com/go/getflashplayer' : $arr['pluginspage'] ) .'" />';
}

// Build the <embed>
$object .= '
<embed type="'. (empty($arr['type']) ? 'application/x-shockwave-flash' : $arr['type'] ) .'" '.
'src="'.$arr['embedlink'].'" width="'.$arr['width'].'px" height="'.$arr['height'].'px" '.
'AllowScriptAccess="never" quality="high" wmode="transparent"'.
( !empty($embedparams) ? $embedparams : '' ) .
' />'.
'<noembed><a href="'.$arr['embedlink'].'" target="_blank">'.$arr['embedlink'].'</a></noembed>';

// If using <object> remember to close it
if($context['browser']['is_ie'] && !$context['browser']['is_mac_ie'])
$object .= '</object>';

// Tidy up
unset($objectparams, $embedparams);

// Build the pattern/(re)set the count
$pattern = '#<a href="'.$arr['pattern'].'"(?:.*?)</a>#i'.($context['utf8'] ? 'u' : '') ;
$count = 0;
 
// Pre php 5.1.0, No count parameter, so do it the slower, inefficient way
if (@version_compare(PHP_VERSION, '5.1.0') == -1)
{
// Grab all the matches to count the no. of replacements that will be made
if(preg_match_all($pattern, $message, $out, PREG_PATTERN_ORDER))
{
$count = count($out[0]);
unset($out);
$message = preg_replace($pattern, $object, $message, $autoembedmax);
}
}
else
// Fantastic! From 5.1.0 we can use the count parameter
$message = preg_replace($pattern, $object, $message, $autoembedmax, $count);
 
// Reduce remaining replacements allowed
if($autoembedmax != -1)
$autoembedmax = $autoembedmax - $count;

// Tidy up
unset($object, $count);
}
}

// Reverse protection of noembed stuff
if(!empty($noembed))
{
foreach ($noembed as $a => $b)
$message = str_replace('[noembed]###NOEMBEDPROTECTED#'.$a.'##[/noembed]',$b[1] , $message);
}
// Tidy up
unset($embed,$pattern,$object,$arr,$count,$protect,$a,$b);
}
// Reset the status
$context['disableautoembedvideo'] = 0 ;
// END OF AUTO EMBED VIDEO CLIPS MOD

O Link do video demo esta aqui...
Citar
http://www.youtube.com/watch?v=d8IlHHK7oZ8


Offline candidosa2

  • Suporte Tecnico
  • Fundador
  • *
  • Mensagens: 5072
  • Rank: 1658
  • Sexo: Masculino
  • Suporte
    • Hosting Moçambique
Re: Auto Embed Video Clips
« Responder #1 em: 17 de Fevereiro de 2009, 21:25 »
se tiver algumas dificuldades isso e não funcionar pode usar esta opção

Subs.php

Pesquisar
Código: [Seleccione]
$message = strtr($message, array('  ' => ' &nbsp;', "\r" => '', "\n" => '<br />', '<br /> ' => '<br />&nbsp;', ' ' => "\n"));

Adicionar por Baixo
Código: [Seleccione]
// AUTO EMBED VIDEO CLIPS MOD
// Disables if on print page
if($smileys !== "print") {
$embed = array();

/* ######################################################
# COMMENTED VERSION EXPLAINING EACH LINE
$embed[] = array(
'name' => 'YouTube', // OPTIONAL, JUST FOR ASTETIC/NAMING/QUICK REFERENCE PURPOSES
'enabled' => 1, // 1 = ENABLED, 0 = DISABLED, ALLOWS YOU TO QUICKLY DISABLE/ENABLE SPECIFIC SITES
// THE PATTERN/REGEX FOR THE PREG_MATCH (ALL dots need escaping)
'pattern' => 'http://(www\.|uk\.|fr\.|ie\.|it\.|jp\.|pl\.|es\.|nl\.|br\.|)youtube\.com/(watch\?v=|v/|jp\.swf\?video_id=)([0-9A-Za-z-_]{11})(.*?)',
// EMBED = $1,$2,$3 are replaced by the video id.  eg the video id in the youtube link is the 3rd variable matched (basically the third in brackets)
// IS REQUIRED, EXCEPT BY STAGE6 WHICH USES A PARAM CALLED SRC INSTEAD
'embedlink' => 'http://www.youtube.com/v/$3',
'width' => '425', // WIDTH (WITHOUT PX, THAT IS ADDED LATER)
'height' => '350', // HEIGHT (AGAIN WITHOUT PX)
'codebase' => '', // SPECIAL CODECS HAVE CODEBASES, IF NOT LEAVE BLANK
'type' => '', // UNLESS DIFFERENT TO application/x-shockwave-flash, LEAVE BLANK
'pluginspage' => '', // A LINK TO OBTAIN THE PLUGIN/CODEC, ELSE LEAVE BLANK
'classid' => '', // IF HAS A CLASS ID, ELSE LEAVE BLANK
'extraparams' => '', // IF ANY IMPORTANT EXTRA PARAMS, FOR MOST VIDEO SITES YOU WON'T NEED TO TOUCH THIS
);
######################################################*/

$embed[] = array(
'name' => 'YouTube',
'enabled' => 1,
'pattern' => 'http://(www\.|uk\.|fr\.|ie\.|it\.|jp\.|pl\.|es\.|nl\.|br\.|)youtube\.com/(watch\?v=|v/|jp\.swf\?video_id=)([0-9A-Za-z-_]{11})(.*?)',
'embedlink' => 'http://www.youtube.com/v/$3',
'width' => '425',
'height' => '350',
);
$embed[] = array(
'name' => 'YouTube Playlist',
'enabled' => 1,
'pattern' => 'http://(www\.|uk\.|fr\.|ie\.|it\.|jp\.|pl\.|es\.|nl\.|br\.|)youtube\.com/(ep\.swf\?id=|view_play_list\?p=|p/)([0-9a-f]{16})(.*?)',
'embedlink' => 'http://www.youtube.com/p/$3',
'width' => '530',
'height' => '370',
);
$embed[] = array(
'name' => 'Google Video',
'enabled' => 1,
'pattern' => 'http://video\.google\.(com|com\.au|co\.uk|de|es|fr|it|nl|pl|ca)/(videoplay|url)\?docid=([0-9a-z-_]{1,20})(.*?)',
'embedlink' => 'http://video.google.$1/googleplayer.swf?docId=$3',
'width' => '530',
'height' => '370',
);
$embed[] = array(
'name' => 'MetaCafe',
'enabled' => 1,
'pattern' => 'http://(www\.|)metacafe\.com/(watch|fplayer)/([0-9]{1,10})/(.*?)',
'embedlink' => 'http://www.metacafe.com/fplayer/$3/metacafe.swf',
'width' => '530',
'height' => '370',
);
$embed[] = array(
'name' => 'MySpaceTv',
'enabled' => 1,
'pattern' => 'http://(vids\.myspace|myspacetv)\.com/index\.cfm\?fuseaction=vids\.individual&amp;VideoID=([0-9]{1,10})(.*?)',
'embedlink' => 'http://lads.myspace.com/videos/myspacetv_vplayer0005.swf?m=$2&amp;type=video',
'width' => '480',
'height' => '386',
);
$embed[] = array(
'name' => 'Stage6',
'enabled' => 1,
'pattern' => 'http://stage6\.divx\.com/(.*?)/video/([0-9]{1,11})/(.*?)',
'embedlink' => '', // STAGE6 DON'T USE THIS TYPE, IT MUST BE A PARAM
'width' => '640',
'height' => '480',
'codebase' => 'http://go.divx.com/plugin/DivXBrowserPlugin.cab',
'pluginspage' => 'http://go.divx.com/plugin/download/',
'classid' => 'clsid:67DABFBF-D0AB-41fa-9C46-CC0F21721616',
'type' => 'video/divx',
'extraparams' => '<param name="src" value="http://video.stage6.com/$2/.divx" />'
.'<param name="custommode" value="Stage6" />'
.'<param name="autoplay" value="false" />'
.'<param name="showpostplaybackad" value="false" />',
);
$embed[] = array(
'name' => 'Veoh',
'enabled' => 1,
'pattern' => 'http://(www\.|)veoh\.com/videos/([0-9a-z]{15})(.*?)',
'embedlink' => 'http://www.veoh.com/videodetails2.swf?permalinkId=$2&id=anonymous&player=videodetailsembedded&videoAutoPlay=0',
'width' => '540',
'height' => '438',
'extraparams' => '<param name="allowFullScreen" value="true">',
);
$embed[] = array(
'name' => 'Gametrailers',
'enabled' => 1,
'pattern' => 'http://(www\.|)gametrailers\.com/player/([0-9]{1,8})\.html(.*?)',
'embedlink' => 'http://www.gametrailers.com/remote_wrap.php?mid=$2',
'width' => '480',
'height' => '392',
'classid' => 'clsid:d27cdb6e-ae6d-11cf-96b8-444553540000',
'extraparams' => '<param name="swLiveConnect" value="true"><param name="quality" value="high" />',
);
$embed[] = array(
'name' => 'LiveLeak',
'enabled' => 1,
'pattern' => 'http://(www\.|)liveleak\.com/view\?i=([0-9a-z]{3}_|)([a-z0-9]{10})(.*?)',
'embedlink' => 'http://www.liveleak.com/player.swf?autostart=false&token=$2$3',
'width' => '450',
'height' => '370',
'extraparams' => '<param name="quality" value="high" />',
);
$embed[] = array(
'name' => 'CellFish',
'enabled' => 1,
'pattern' => 'http://cellfish\.cellfish\.com/(video|multimedia)/([0-9]{1,8})(.*?)',
'embedlink' => 'http://cellfish.com/static/swf/player.swf?Id=$2',
'width' => '420',
'height' => '315',
);
$embed[] = array(
'name' => 'MyVideo.de',
'enabled' => 1,
'pattern' => 'http://(www\.|)myvideo\.de/watch/([0-9]{1,8})(.*?)',
'embedlink' => 'http://www.myvideo.de/movie/$2',
'width' => '470',
'height' => '406',
'extraparams' => '<param name="AllowFullscreen" value="true" />',
);
$embed[] = array(
'name' => 'ClipFish.de',
'enabled' => 1,
'pattern' => 'http://(www\.|)clipfish\.de/(player.php|videoplayer\.swf)\?(.*?)videoid=([a-z0-9]{1,20})(.*?)',
'embedlink' => 'http://www.clipfish.de/videoplayer.swf?as=0&videoid=$4&r=1&c=0067B3',
'width' => '464',
'height' => '380',
'classid' => 'clsid:d27cdb6e-ae6d-11cf-96b8-444553540000',
'extraparams' => '<param name="AllowFullscreen" value="true" />',
);
$embed[] = array(
'name' => 'Libero.it',
'enabled' => 1,
'pattern' => 'http://video\.libero\.it/app/play(|/index.html)\?id=([a-f0-9]{32})(.*?)',
'embedlink' => 'http://video.libero.it/static/swf/eltvplayer.swf?id=$2.flv&ap=0',
'width' => '400',
'height' => '333',
);
$embed[] = array(
'name' => '123video.nl',
'enabled' => 1,
'pattern' => 'http://(www\.|)123video\.nl/playvideos\.asp\?MovieID=([0-9]{1,8})(.*?)',
'embedlink' => 'http://www.123video.nl/123video_share.swf?mediaSrc=$2',
'width' => '420',
'height' => '339',
'classid' => 'clsid:d27cdb6e-ae6d-11cf-96b8-444553540000',
'extraparams' => '<param name="quality" value="high" />',
);
$embed[] = array(
'name' => 'VSocial',
'enabled' => 1,
'pattern' => 'http://(www\.|)vsocial\.com/video/\?d=([0-9]{1,8})(.*?)',
'embedlink' => 'http://static.vsocial.com/flash/ups.swf?d=$2&a=0',
'width' => '410',
'height' => '400',
);
$embed[] = array(
'name' => 'IFilm',
'enabled' => 1,
'pattern' => 'http://(www\.|)ifilm.com/video/([0-9]{1,8})(.*?)',
'embedlink' => 'http://www.ifilm.com/efp?flvbaseclip=$2',
'width' => '448',
'height' => '365',
);
$embed[] = array(
'name' => 'Sevenload',
'enabled' => 1,
'pattern' => 'http://(en\.|tr\.|de\.|www\.|)sevenload\.com/(videos|videolar)/([0-9a-z]{1,8})(.*?)',
'embedlink' => 'http://$1sevenload.com/pl/$3/425x350/swf',
'width' => '425',
'height' => '350',
);
$embed[] = array(
'name' => 'Revver',
'enabled' => 1,
'pattern' => 'http://(one\.|www\.|)revver\.com/watch/([0-9]{1,8})(.*?)',
'embedlink' => 'http://flash.revver.com/player/1.0/player.swf?mediaId=$2&affiliateId=0&allowFullScreen=true',
'width' => '480',
'height' => '392',
);
$embed[] = array(
'name' => 'BrightCove',
'enabled' => 1,
'pattern' => 'http://(www\.|)brightcove\.(tv|com)/title.jsp\?title=([0-9]{1,12})(.*?)',
'embedlink' => 'http://www.brightcove.$2/playerswf?allowFullScreen=true&initVideoId=$3&servicesURL=http://www.brightcove.tv'
.'&viewerSecureGatewayURL=https://www.brightcove.tv&cdnURL=http://admin.brightcove.com&autoStart=false',
'width' => '486',
'height' => '412',
'extraparams' => '<param name="swLiveConnect" value="true" /><param name="quality" value="high" />',
);
$embed[] = array(
'name' => 'Aniboom',
'enabled' => 1,
'pattern' => 'http://(www\.|)aniboom\.com/Player.aspx\?v=([0-9]{1,8})(.*?)',
'embedlink' => 'http://api.aniboom.com/embedded.swf?videoar=',
'width' => '448',
'height' => '372',
'extraparams' => '<param name="quality" value="high" />',
);
$embed[] = array(
'name' => 'Vimeo',
'enabled' => 1,
'pattern' => 'http://(www\.|)vimeo\.com/([0-9]{1,12})(.*?)',
'embedlink' => 'http://vimeo.com/moogaloop.swf?clip_id=$2&amp;server=vimeo.com&amp;fullscreen=1&amp;show_title=1'
.'&amp;show_byline=1&amp;show_portrait=0&amp;color=01AAEA',
'width' => '400',
'height' => '225',
);
$embed[] = array(
'name' => 'Guba',
'enabled' => 1,
'pattern' => 'http://(www\.|)guba\.com/watch/([0-9]{1,12})(.*?)',
'embedlink' => 'http://www.guba.com/f/root.swf?video_url=http://free.guba.com/uploaditem/$2/flash.flv&amp;isEmbeddedPlayer=true',
'width' => '525',
'height' => '360',
);
$embed[] = array(
'name' => 'Glumbert',
'enabled' => 1,
'pattern' => 'http://(www\.|)glumbert\.com/media/([a-z0-9_-]{1,30})(.*?)',
'embedlink' => 'http://www.glumbert.com/embed/$2',
'width' => '425',
'height' => '335',
);
$embed[] = array(
'name' => 'Tudou',
'enabled' => 1,
'pattern' => 'http://(www\.|)tudou\.com/(programs/view/|v/)([a-z0-9-]{1,12})(.*?)',
'embedlink' => 'http://www.tudou.com/v/$3',
'width' => '400',
'height' => '300',
);
$embed[] = array(
'name' => 'dv.ouou',
'enabled' => 1,
'pattern' => 'http://dv\.ouou\.com/(play/v_|v/)([a-f0-9]{14})(.*?)',
'embedlink' => 'http://dv.ouou.com/v/$2',
'width' => '480',
'height' => '385',
);
$embed[] = array(
'name' => 'Biku',
'enabled' => 1,
'pattern' => 'http://(www\.|)biku\.com/opus/(|player.swf\?VideoID=)([0-9]{1,8})(.*?)',
'embedlink' => 'http://www.biku.com/opus/player.swf?VideoID=$3&embed=true&autoStart=false',
'width' => '480',
'height' => '395',
);
$embed[] = array(
'name' => 'GameVideos',
'enabled' => 1,
'pattern' => 'http://(www\.|)gamevideos\.com/(video/id/|video/embed\?video=)([0-9]{1,8})(.*?)',
'embedlink' => 'http://gamevideos.com:80/swf/gamevideos11.swf?embedded=1&amp;autoplay=0&amp;src=http://gamevideos.com:80/video/videoListXML%3Fid%3D$3%26adPlay%3Dfalse',
'width' => '420',
'height' => '405',
);
 
// NOW DO THE MAGIC, CONVERT THOSE LINKS IN MESSAGES TO AUTOMATICALLY EMBED THE VIDEOS
foreach($embed as $id => $arr) {
if($arr['enabled']) {
// BUILD THE <OBJECT> FOR EACH VIDEO SITE
$object = '<object' .
' codebase="'.(empty($arr['codebase']) ? 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0' : $arr['codebase'] ) .'" '.
( empty($arr['classid']) ? '' : 'classid="'.$arr['classid'].'"' ) .
' type="'. (empty($arr['type']) ? 'application/x-shockwave-flash' : $arr['type'] ) .'" '.
( empty($arr['embedlink']) ? '' : 'data="'.$arr['embedlink'].'"' ) .
' width="'.$arr['width'].'px" height="'.$arr['height'].'px">'.
'<param name="movie" value="'.$arr['embedlink'].'" />'.
'<param name="wmode" value="transparent" />'.
'<param name="allowScriptAccess" value="never" />'.
( empty($arr['extraparams']) ? '' : $arr['extraparams'] ) .
'<param name="pluginspage" value="'.( empty($arr['pluginspage']) ? 'http://www.macromedia.com/go/getflashplayer' : $arr['pluginspage'] ) .'">'.
'</object>';
// NOW SWITCH THE LINK FOR THE OBJECT
$message = preg_replace('#<a href="'.$arr['pattern'].'"(.*?)</a>#i'.($context['utf8'] ? 'u' : '') , $object, $message);
}
}
unset($embed,$object,$arr);
}
// END OF AUTO EMBED VIDEO CLIPS MOD