0 Üye ve 2 Ziyaretçi konuyu incelemekte.
$message = strtr($message, array(' ' => ' ', "\r" => '', "\n" => '<br />', '<br /> ' => '<br /> ', ' ' => "\n"));
// 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&VideoID=([0-9]{1,10})(.*?)', 'embedlink' => 'http://lads.myspace.com/videos/myspacetv_vplayer0005.swf?m=$2&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&server=vimeo.com&fullscreen=1&show_title=1' .'&show_byline=1&show_portrait=0&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&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&autoplay=0&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