Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php /*
- **************************************************************************
- Plugin Name: My Videotag
- Plugin URI: http://toxigeek.com/plugin-my-videotag
- Description: This Plugin will add a Tag called "video", which automatically identifies videos from sites like: youtube, googlevideo, dailymotion, metacafe, myspace, yahoo, megavideo, vimeo, tu.tv, etc... and add them to your Wordpress post.
- Version: 1.1.1
- Author: giObanii
- Author URI: http://toxigeek.com
- @copyright Copyright (c) 2010, giObanii
- *************************************************************************
- Copyright (C) 2010 giObanii
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
- **************************************************************************/
- function mvt_url( $path = '' ) {
- global $wp_version;
- if ( version_compare( $wp_version, '3.0', '<' ) ) { // Using WordPress 3.0
- $folder = dirname( plugin_basename( __FILE__ ) );
- if ( '.' != $folder )
- $path = path_join( ltrim( $folder, '/' ), $path );
- return plugins_url( $path );
- }
- return plugins_url( $path, __FILE__ );
- }
- //on activation, your My VideoTag options will be populated. Here a single option is used which is actually an array of multiple options
- function activate_mvt() {
- $mvt_opts1 = get_option('mvt_options');
- $mvt_opts2 =array('width' => '640',
- 'height' => '390');
- if ($mvt_opts1) {
- $mvt = $mvt_opts1 + $mvt_opts2;
- update_option('mvt_options',$mvt);
- }
- else {
- $mvt_opts1 = array();
- $mvt = $mvt_opts1 + $mvt_opts2;
- add_option('mvt_options',$mvt);
- }
- }
- register_activation_hook( __FILE__, 'activate_mvt' );
- global $mvt;
- $mvt = get_option('mvt_options');
- define("MVT_VER","1.1.1",false);
- define('MVT_URLPATH', trailingslashit( WP_PLUGIN_URL . '/' . plugin_basename( dirname(__FILE__) ) ) );
- include_once (dirname (__FILE__) . '/tinymce/tinymce.php');
- //External CSS in the header
- //function mvt_scripts_styles() {
- //global $mvt;
- // wp_enqueue_style( 'mvt_css_file', mvt_url( 'css/mvt.css' ),
- // false, MVT_VER, 'all');
- //}
- // add_action( 'init', 'mvt_scripts_styles' );
- // function for adding settings page to wp-admin
- function mvt_settings() {
- // Add a new submenu under Options:
- add_options_page('Settings', 'My VideoTag', 9, basename(__FILE__), 'mvt_settings_page');
- }
- // This function displays the page content for the My VideoTag Options submenu
- function mvt_settings_page() {
- ?>
- <div class="wrap">
- <h2>My VideoTag Settings</h2>
- <strong>Supported Sites:</strong> youtube, googlevideo, dailymotion, metacafe, myspace, yahoo, megavideo, vimeo, gamevideos, tu.tv, godtube, myvideo, collegehumor, comedycentral, colbertnation, revver, de.sevenload, clipfish ... Soon more.
- <div style="clear:both;"></div>
- <form method="post" action="options.php">
- <div id="poststuff" class="metabox-holder has-right-sidebar">
- <div style="float:left;width:55%;">
- <?php
- settings_fields('mvt-group');
- $mvt = get_option('mvt_options');
- ?>
- <h2>Dimensions of the videos</h2>
- <p>Enter the dimensions of the videos depending upon the width of your theme</p>
- <table class="form-table">
- <tr valign="top">
- <th scope="row"><label for="mvt_options[width]">Width</label></th>
- <td><input type="text" name="mvt_options[width]" class="small-text" value="<?php echo $mvt['width']; ?>" /> px</td>
- </tr>
- <tr valign="top">
- <th scope="row"><label for="mvt_options[height]">Height</label></th>
- <td><input type="text" name="mvt_options[height]" class="small-text" value="<?php echo $mvt['height']; ?>" /> px</td>
- </tr>
- </table>
- <p class="submit">
- <input type="submit" class="button-primary" value="<?php _e('Save Changes') ?>" />
- </p>
- </div>
- <style>
- #twitter {clear: both;height: auto;width: auto;}
- #twitterinner {padding: 5px;}
- #twitter #twitter-heading {clear: both;height: 39px;width: auto;background-image: url(<?php echo MVT_URLPATH ?>images/twitter.png);background-repeat: no-repeat;background-position: left top;padding-top: 0px;padding-right: 0px;padding-bottom: 5px;padding-left: 55px;font-size: 10px;border-bottom-width: 1px;border-bottom-style: solid;border-bottom-color: #d5d5d5;margin-top: 5px;margin-right: 0px;margin-bottom: 0px;margin-left: 0px;line-height: 39px;font-weight: bold;}
- #twitter #twitter-heading a {color: #00CCFF;text-decoration: none;text-transform: uppercase;}
- #twitter #twitter-heading a:hover {text-decoration: underline;}
- #twitter_update_list {width: auto;clear: both;height: auto;margin: 0px;padding: 5px;}
- #twitter_update_list p {width: 100%;display: block;clear: both;height: auto;font-size: 10px;line-height: 14px;margin-top: 0px;margin-right: 0px;margin-bottom: 5px;margin-left: 0px;border-bottom-width: 1px;border-bottom-style: solid;border-bottom-color: #d5d5d5;padding-top: 0px;padding-right: 0px;padding-bottom: 5px;padding-left: 0px;}
- #twitter_update_list span {margin: 0px;padding: 0px;}
- #twitter_update_list a {color: #00CCFF;text-decoration: none;font-weight: bold;}
- #twitter_update_list a:hover {text-decoration: underline;}
- #twitter_update_list li {list-style: none outside none;}
- </style>
- <div id="side-info-column" class="inner-sidebar">
- <div class="postbox">
- <h3 class="hndle"><span>About this Plugin:</span></h3>
- <div class="inside">
- <ul>
- <li><a href="http://toxigeek.com/" title="Author Page" >About the Author</a></li>
- <li><a href="http://toxigee.com/plugin-my-videotag" title="My VideoTag" >Plugin Homepage</a></li>
- <li><a href="http://wordpress.org/extend/plugins/my-videotag/" title="" >Wordpress plugin site</a></li>
- <li><a href="http://toxigeek.com/help/support-plugins-group7/my-videotag-youtube-googlevideo-dailymotion-etc-forum9" title="Support Plugin" >Support Plugin</a></li>
- <li></li>
- <li><a href="https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=3motronik%40gmail%2ecom&lc=US&item_name=Plugin%20My%2dVideoTag&no_note=0¤cy_code=USD&bn=PP%2dDonationsBF%3abtn_donateCC_LG%2egif%3aNonHostedGuest" target="_blank" rel="nofollow"><img src="https://www.paypal.com/en_US/i/btn/btn_donateCC_LG.gif" /></a></li>
- </ul>
- </div>
- </div>
- </div>
- <div id="side-info-column" class="inner-sidebar">
- <div class="postbox">
- <h3 class="hndle"><span>What's New in My Twitter!:</span></h3>
- <div class="inside">
- <div id="twitter">
- <div id="twitter-heading">Follow to <a href="http://twitter.com/giObanii" target="_blank">giObanii</a> on Twitter</div>
- <div id="twitter_update_list">
- <script type="text/javascript" src="http://twitter.com/javascripts/blogger.js"></script>
- <script type="text/javascript" src="http://twitter.com/statuses/user_timeline/giObanii.json?callback=twitterCallback2&count=3"></script>
- </div>
- </div>
- </div>
- </div>
- </div> <!--end of poststuff -->
- </form>
- </div> <!--end of float wrap -->
- <?php
- }
- // Hook for adding admin menus
- if ( is_admin() ){ // admin actions
- add_action('admin_menu', 'mvt_settings');
- add_action( 'admin_init', 'register_mvt_settings' );
- }
- function register_mvt_settings() { // whitelist options
- register_setting( 'mvt-group', 'mvt_options' );
- }
- // Shortcode *******************
- class MyTagVideo {
- function MyTagVideo() {
- if ( !function_exists('add_shortcode') ) return;
- add_shortcode( 'video' , array(&$this, 'shortcode_video') );
- }
- function attributefix( $atts = array() ) {
- if ( empty($atts[0]) ) return $atts;
- if ( 0 !== preg_match( '#=("|\')(.*?)("|\')#', $atts[0], $match ) )
- $atts[0] = $match[2];
- return $atts;
- }
- function shortcode_video( $atts = array(), $content = NULL ) {
- if ( NULL === $content ) return '';
- return '' .get_video($content). '';
- }
- }
- add_action( 'plugins_loaded', create_function( '', 'global $MyTagVideo; $MyTagVideo = new MyTagVideo();' ) );
- function get_video($content){
- global $mvt;
- $values = array (
- //youtube.com
- array('/youtube.*v=([^&]*)/i', '<object width="'.$mvt['width'].'" height="'.$mvt['height'].'"><param name="movie" value="http://www.youtube.com/v/{ID_VIDEO}&feature=player_embedded&version=3"></param><param name="allowFullScreen" value="true"></param><param name="allowScriptAccess" value="always"></param><embed src="http://www.youtube.com/v/{ID_VIDEO}&feature=player_embedded&version=3" type="application/x-shockwave-flash" allowfullscreen="true" allowScriptAccess="always" width="'.$mvt['width'].'" height="'.$mvt['height'].'"></embed></object>'),
- array('/youtube.*?p=(.*)/i', '<object width="'.$mvt['width'].'" height="'.$mvt['height'].'"><param name="movie" value="http://www.youtube.com/p/{ID_VIDEO}?hl=es_ES&fs=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/p/{ID_VIDEO}?hl=es_ES&fs=1" type="application/x-shockwave-flash" width="'.$mvt['width'].'" height="'.$mvt['height'].'" allowscriptaccess="always" allowfullscreen="true"></embed></object>'),
- //video.google.com
- array('/video.google.*docid=([^&]*)/i', '<embed id="VideoPlayback" style="width:'.$mvt['width'].'px;height:'.$mvt['height'].'px" allowFullScreen="true" flashvars="fs=true" src="http://video.google.com/googleplayer.swf?docid={ID_VIDEO}" type="application/x-shockwave-flash"></embed>'),
- //dailymotion.com
- array('/dailymotion\.com\/video\/([^_]*)/i', '<object width="'.$mvt['width'].'" height="'.$mvt['height'].'"><param name="movie" value="http://www.dailymotion.com/swf/video/{ID_VIDEO}?additionalInfos=0"></param><param name="allowFullScreen" value="true"></param><param name="allowScriptAccess" value="always"></param><embed type="application/x-shockwave-flash" src="http://www.dailymotion.com/swf/video/{ID_VIDEO}?additionalInfos=0" width="'.$mvt['width'].'" height="'.$mvt['height'].'" allowfullscreen="true" allowscriptaccess="always"></embed></object>'),
- //metacafe.com
- array('/metacafe\.com\/watch\/(.*)/i', '<div style="background:#000000;width:'.$mvt['width'].'px;height:'.$mvt['height'].'px"><embed flashVars="playerVars=showStats=yes|autoPlay=no" src="http://www.metacafe.com/fplayer/{ID_VIDEO}.swf" width="'.$mvt['width'].'" height="'.$mvt['height'].'" wmode="transparent" allowFullScreen="true" allowScriptAccess="always" name="Metacafe_5384657" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash"></embed></div>'),
- //allocine.fr
- array('/allocine.*player_gen_cmedia=([^&]*)/i', '<div id="allocine_blog" style="width:'.$mvt['width'].'px; height:'.$mvt['height'].'px"><object height='.$mvt['height'].'px width="100%"><param name="movie" value="http://www.allocine.fr/blogvision/{ID_VIDEO}"></param><param name="allowFullScreen" value="true"></param><param name="allowScriptAccess" value="always"></param><embed src="http://www.allocine.fr/blogvision/{ID_VIDEO}" type="application/x-shockwave-flash" width="100%" height="100%" allowFullScreen="true" allowScriptAccess="always"></embed></object></div>'),
- //Myspace
- //myspace.com
- array('/myspace\.com.*?videoID=([^&]*)/i', '<object width="'.$mvt['width'].'" height="'.$mvt['height'].'" ><param name="allowFullScreen" value="true"/><param name="wmode" value="transparent"/><param name="movie" value="http://mediaservices.myspace.com/services/media/embed.aspx/m={ID_VIDEO},t=1,mt=video"/><embed src="http://mediaservices.myspace.com/services/media/embed.aspx/m={ID_VIDEO},t=1,mt=video" width="'.$mvt['width'].'" height="'.$mvt['height'].'" allowFullScreen="true" type="application/x-shockwave-flash" wmode="transparent"></embed></object>'),
- //vids.myspace.com
- array('/vids\.myspace\.com.*?videoID=([^&]*)/i', '<object width="'.$mvt['width'].'" height="'.$mvt['height'].'" ><param name="allowFullScreen" value="true"/><param name="wmode" value="transparent"/><param name="movie" value="http://mediaservices.myspace.com/services/media/embed.aspx/m={ID_VIDEO},t=1,mt=video"/><embed src="http://mediaservices.myspace.com/services/media/embed.aspx/m={ID_VIDEO},t=1,mt=video" width="'.$mvt['width'].'" height="'.$mvt['height'].'" allowFullScreen="true" type="application/x-shockwave-flash" wmode="transparent"></embed></object>'),
- //myspacetv.com
- array('/myspacetv\.com.*?videoID=([^&]*)/i', '<object width="'.$mvt['width'].'" height="'.$mvt['height'].'"><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="'.$mvt['width'].'" height="'.$mvt['height'].'" flashvars="m={ID_VIDEO}" type="application/x-shockwave-flash" allowscriptaccess="always" /></object>'),
- //video.yahoo.com
- array('/video\.yahoo.*v=([^&]*)/i','<object width="'.$mvt['width'].'" height="'.$mvt['height'].'"><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="'.$mvt['width'].'" height="'.$mvt['height'].'" allowFullScreen="true" flashVars="id={DOWNLOAD%/so\.addVariable\("id", "(.*?)"\);/%}&vid={ID_VIDEO}&thumbUrl={DOWNLOAD%/so\.addVariable\("thumbUrl", "(.*?)"\);/%}&embed=1" ></embed></object>'),
- //video.yahoo.com/watch/
- array('/video\.yahoo\.com\/watch\/([^\/]*)/i','<object width="'.$mvt['width'].'" height="'.$mvt['height'].'"><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="'.$mvt['width'].'" height="'.$mvt['height'].'" allowFullScreen="true" flashVars="id={DOWNLOAD%/so\.addVariable\("id", "(.*?)"\);/%}&vid={ID_VIDEO}&thumbUrl={DOWNLOAD%/so\.addVariable\("thumbUrl", "(.*?)"\);/%}&embed=1" ></embed></object>'),
- //megavideo.com
- array ('/megavideo.*v=(.*)/i', '<object width="'.$mvt['width'].'" height="'.$mvt['height'].'"><param name="movie" value="http://www.megavideo.com/v/{ID_VIDEO}"></param><param name="allowFullScreen" value="true"></param><embed src="http://www.megavideo.com/v/{ID_VIDEO}" type="application/x-shockwave-flash" allowfullscreen="true" width="'.$mvt['width'].'" height="'.$mvt['height'].'"></embed></object>'),
- //vimeo.com
- array ('/vimeo\.com\/([^&]*)/i', '<object width="'.$mvt['width'].'" height="'.$mvt['height'].'"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id={ID_VIDEO}&server=vimeo.com&show_title=0&show_byline=0&show_portrait=0&color=00ADEF&fullscreen=1&autoplay=0&loop=0" /><embed src="http://vimeo.com/moogaloop.swf?clip_id={ID_VIDEO}&server=vimeo.com&show_title=0&show_byline=0&show_portrait=0&color=00ADEF&fullscreen=1&autoplay=0&loop=0" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="'.$mvt['width'].'" height="'.$mvt['height'].'"></embed></object>'),
- //gamevideos.1up.com
- array ('/gamevideos.1up.com\/video\/id\/(.*)/i', '<div style="width:500px; text-align:center"><embed type="application/x-shockwave-flash" width="'.$mvt['width'].'" height="'.$mvt['height'].'" src="http://gamevideos.1up.com/swf/gamevideos12.swf?embedded=1&fullscreen=1&autoplay=0&src=http://gamevideos.1up.com/do/videoListXML%3Fid%3D{ID_VIDEO}%26adPlay%3Dtrue" align="middle"></embed></div>'),
- //tu.tv
- array ('/(tu\.tv)/i', '{DOWNLOAD%/<input name="html".*value=\'(.*?)\'/%}'),
- //godtube.com
- array ('/godtube\.com.*v=(.*)/i', '<object width="'.$mvt['width'].'" height="'.$mvt['height'].'" type="application/x-shockwave-flash" data="http://www.godtube.com/resource/mediaplayer/player-licensed.swf" id="tempIdforMediaPlayer" style="visibility: visible;"><param name="allowacriptaccess" value="always"><param name="allowfullscreen" value="true"><param name="wmode" value="transparent"><param name="flashvars" value="screencolor=000000&controlbar=over&type=video&autostart=false&playonce=false&skin=http://www.godtube.com/resource/mediaplayer/skin/dangdang/dangdang.swf&plugins=http://www.godtube.com/resource/mediaplayer/plugins/ova/ova.swf,http://www.godtube.com/resource/mediaplayer/plugins/d-related/d-related.swf&config=http://www.godtube.com/resource/mediaplayer/{ID_VIDEO}.xml&logo.link=undefined&logo.position=top-left&logo.hide=false&logo.file=http://media.salemwebnetwork.com/spacer.gif"></object>'),
- //myvideo.de
- array ('/myvideo\.de\/watch\/(.*)\//i', '<object style="width:'.$mvt['width'].'px;height:'.$mvt['height'].'px;" width="'.$mvt['width'].'" height="'.$mvt['height'].'" data="http://www.myvideo.de/movie/{ID_VIDEO}"><embed src="http://www.myvideo.de/movie/{ID_VIDEO}" width="'.$mvt['width'].'" height="'.$mvt['height'].'" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true"></embed><param name="movie" value="http://www.myvideo.de/movie/{ID_VIDEO}"/><param name="AllowFullscreen" value="true"></param><param name="AllowScriptAccess" value="always"></param></object>'),
- //collegehumor.com
- array ('/collegehumor.*video:(.*)/i', '<object type="application/x-shockwave-flash" data="http://www.collegehumor.com/moogaloop/moogaloop.swf?clip_id={ID_VIDEO}&fullscreen=1" width="'.$mvt['width'].'" height="'.$mvt['height'].'" ><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>'),
- //comedycentral.com
- array ('/comedycentral.*videoId=([^&]*)/i', '<embed style="display:block" src="http://media.mtvnservices.com/mgid:cms:item:comedycentral.com:{ID_VIDEO}" width="'.$mvt['width'].'" height="'.$mvt['height'].'" type="application/x-shockwave-flash" wmode="window" allowFullscreen="true" flashvars="autoPlay=false" allowscriptaccess="always" allownetworking="all" bgcolor="#000000"></embed>'),
- //revver.com
- array ('/revver\.com\/video\/([^\/]*)/i', '<script src="http://flash.revver.com/player/1.0/player.js?mediaId:{ID_VIDEO};width:'.$mvt['width'].';height:'.$mvt['height'].';" type="text/javascript"></script>'),
- //clipfish.de
- array ('/clipfish\.de\/video\/([^\/]*)/i', '<object codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="'.$mvt['width'].'" height="'.$mvt['height'].'" > <param name="allowScriptAccess" value="always" /> <param name="movie" value="http://www.clipfish.de/cfng/flash/clipfish_player_3.swf?as=0&vid={ID_VIDEO}&r=1&area=e&c=990000" /> <param name="bgcolor" value="#ffffff" /> <param name="allowFullScreen" value="true" /> <embed src="http://www.clipfish.de/cfng/flash/clipfish_player_3.swf?as=0&vid={ID_VIDEO}&r=1&area=e&c=990000" quality="high" bgcolor="#990000" width="'.$mvt['width'].'" height="'.$mvt['height'].'" name="player" align="middle" allowFullScreen="true" allowScriptAccess="always" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"></embed></object>'),
- //aniboom.com
- array ('/aniboom\.com\/animation-video\/([^\/]*)/i', '<object width="'.$mvt['width'].'" height="'.$mvt['height'].'"><param name="movie" value="http://api.aniboom.com/e/{ID_VIDEO}" /><param name="allowScriptAccess" value="sameDomain" /><param name="allowfullscreen" value="true" /><param name="quality" value="high" /><embed src="http://api.aniboom.com/e/{ID_VIDEO}" quality="high" width="'.$mvt['width'].'" height="'.$mvt['height'].'" allowscriptaccess="sameDomain" allowfullscreen="true" type="application/x-shockwave-flash"></embed></object>'),
- //facebook.com
- array ('/facebook.*v=([^&]*)/i', '<object type="application/x-shockwave-flash"
- data="http://www.facebook.com/v/{ID_VIDEO}\" width="'.$mvt['width'].'"
- height="'.$mvt['height'].'"><param name="autostart" value="false" /><param
- name="movie" value="http://www.facebook.com/v/{ID_VIDEO}" /></object>'),
- //funnyordie.com
- array ('/funnyordie\.com\/videos\/(.*)\//i', '<object width="'.$mvt['width'].'" height="'.$mvt['height'].'" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" id="ordie_player_ef76e75bcf"><param name="movie" value="http://player.ordienetworks.com/flash/fodplayer.swf" /><param name="flashvars" value="key={ID_VIDEO}" /><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always"></param><embed width="'.$mvt['width'].'" height="'.$mvt['height'].'" flashvars="key={ID_VIDEO}" allowfullscreen="true" allowscriptaccess="always" quality="high" src="http://player.ordienetworks.com/flash/fodplayer.swf" name="ordie_player_{ID_VIDEO}" type="application/x-shockwave-flash"></embed></object>'),
- //dotsub.com
- array ('/dotsub\.com\/view\/(.*)/i', '<object width="'.$mvt['width'].'" height="'.$mvt['height'].'" type="application/x-shockwave-flash" id="mpl" name="mpl" data="http://dotsub.com/static/players/portalplayer.swf?v=2886"><param name="swliveconnect" value="true"><param name="allowFullScreen" value="true"><param name="allowScriptAccess" value="always"><param name="flashvars" value="uuid={ID_VIDEO}&lang=spa&type=flv&plugins=dotsub&tid=UA-3684979-1&debug=none&embedded=false"></object>'),
- //dorkly.com
- array ('/dorkly\.com\/video\/(.*)\//i', '<object type="application/x-shockwave-flash" data="http://www.dorkly.com/moogaloop/noobtube.swf?clip_id={ID_VIDEO}&fullscreen=1" width="'.$mvt['width'].'" height="'.$mvt['height'].'"><param name="allowfullscreen" value="true"/><param name="wmode" value="transparent"/><param name="allowScriptAccess" value="always"/><param name="movie" quality="best" value="http://www.dorkly.com/moogaloop/noobtube.swf?clip_id={ID_VIDEO}&fullscreen=1"/><embed src="http://www.dorkly.com/moogaloop/noobtube.swf?clip_id={ID_VIDEO}&fullscreen=1" type="application/x-shockwave-flash" wmode="transparent" width="'.$mvt['width'].'" height="'.$mvt['height'].'" allowScriptAccess="always"></embed></object>'),
- //scribd.com
- array ('/cribd\.com\/doc\/([^\/]*)/i', '<object height="'.$mvt['height'].'" width="'.$mvt['width'].'" type="application/x-shockwave-flash" data="http://d1.scribdassets.com/ScribdViewer.swf" style="outline:none;" ><param name="movie" value="http://d1.scribdassets.com/ScribdViewer.swf"><param name="wmode" value="opaque"> <param name="bgcolor" value="#ffffff"><param name="allowFullScreen" value="true"><param name="allowScriptAccess" value="always"><param name="FlashVars" value="document_id={ID_VIDEO}&access_key=key-w2khk4pt761e0d60hb2&page=1&viewMode=slideshow"><embed src="http://d1.scribdassets.com/ScribdViewer.swf?document_id={ID_VIDEO}&access_key=key-w2khk4pt761e0d60hb2&page=1&viewMode=slideshow" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" height="'.$mvt['height'].'" width="'.$mvt['width'].'" wmode="opaque" bgcolor="#ffffff"></embed></object>'),
- //justin.tv
- array ('/justin\.tv\/(.*)/i', '<object type="application/x-shockwave-flash" height="'.$mvt['height'].'" width="'.$mvt['width'].'" id="live_embed_player_flash" data="http://www.justin.tv/widgets/live_embed_player.swf?channel={ID_VIDEO}" bgcolor="#000000"><param name="allowFullScreen" value="true" /><param name="allowScriptAccess" value="always" /><param name="allowNetworking" value="all" /><param name="movie" value="http://www.justin.tv/widgets/live_embed_player.swf" /><param name="flashvars" value="channel={ID_VIDEO}&auto_play=false&start_volume=25" /></object>'),
- //citytv.com.co
- array ('/citytv\.com\.co\/videos\/(.*)\//i', '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,115,0" id="videocom_{ID_VIDEO}" height="'.$mvt['height'].'" width="'.$mvt['width'].'"><param name="movie" value="http://www.citytv.com.co/media/swf/Videocom.swf"></param><param name="allowfullscreen" value="true"></param><param name="allowscriptaccess" value="always"></param><param name="flashvars" value="videoID={ID_VIDEO}&showTools=false&autoPlay=false"></param><param name=wmode value=transparent><embed wmode=transparent name="videocom_{ID_VIDEO}" src="http://www.citytv.com.co/media/swf/Videocom.swf" flashvars= "videoID={ID_VIDEO}&showTools=false&autoPlay=false" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" height="'.$mvt['height'].'" width="'.$mvt['width'].'"/></embed></object>'),
- array ('/citytv\.com\.co\/videos\/(.*)/i', '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,115,0" id="videocom_{ID_VIDEO}" height="'.$mvt['height'].'" width="'.$mvt['width'].'"><param name="movie" value="http://www.citytv.com.co/media/swf/Videocom.swf"></param><param name="allowfullscreen" value="true"></param><param name="allowscriptaccess" value="always"></param><param name="flashvars" value="videoID={ID_VIDEO}&showTools=false&autoPlay=false"></param><param name=wmode value=transparent><embed wmode=transparent name="videocom_{ID_VIDEO}" src="http://www.citytv.com.co/media/swf/Videocom.swf" flashvars= "videoID={ID_VIDEO}&showTools=false&autoPlay=false" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" height="'.$mvt['height'].'" width="'.$mvt['width'].'"/></embed></object>'),
- );
- foreach ($values as $value){
- if (preg_match($value[0], $content, $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 "'.$content.'";
- break;
- case preg_match("/\{DOWNLOAD(.*?)%(.*?)%(.*?)\}/", $matches[0], $matches2):
- if (empty($matches2[1])) $matches2[1]="'.$content.'";
- 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 'Sorry, site not recognized - - Lo sentimos, no se reconoce el sitio';
- }
- //Add quick tag for normal editor
- function myvideotag_quicktag_footer(){
- echo '<script type="text/javascript">'."\n";
- echo "\t".'function insertmyvideotag_qt( myField ) {'."\n";
- echo "\t\t".'var myvideotag_startPos = myField.selectionStart;'."\n";
- echo "\t\t".'var myvideotag_endPos = myField.selectionEnd;'."\n";
- echo "\t\t".'var myvideotag_selection = myField.value.substring( myvideotag_startPos, myvideotag_endPos );'."\n";
- echo "\t\t".'edInsertContent(myField, "[video]" + myvideotag_selection + "[/video]");'."\n";
- echo "\t".'}'."\n";
- echo "\t".'if(document.getElementById("ed_toolbar")){'."\n";
- echo "\t\t".'qt_toolbar = document.getElementById("ed_toolbar");'."\n";
- echo "\t\t".'edButtons[edButtons.length] = new edButton("ed_myvideotag","myvideotag","","","");'."\n";
- echo "\t\t".'var qt_button = qt_toolbar.lastChild;'."\n";
- echo "\t\t".'while (qt_button.nodeType != 1){'."\n";
- echo "\t\t"."\t".'qt_button = qt_button.previousSibling;'."\n";
- echo "\t".'}'."\n";
- echo "\t".'qt_button = qt_button.cloneNode(true);'."\n";
- echo "\t".'qt_button.value = "video";'."\n";
- echo "\t".'qt_button.title = "Insert myvideotag Tag";'."\n";
- echo "\t".'qt_button.onclick = function () { insertmyvideotag_qt( edCanvas); }'."\n";
- echo "\t".'qt_button.id = "ed_myvideotag";'."\n";
- echo "\t".'qt_toolbar.appendChild(qt_button);'."\n";
- echo "\t".'}'."\n";
- echo '</script>'."\n";
- }
- add_action('admin_footer', 'myvideotag_quicktag_footer');
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement