WordPress.org

Plugin Directory

Changeset 530527


Ignore:
Timestamp:
04/13/12 03:14:35 (2 years ago)
Author:
Viper007Bond
Message:

v6.4.0

The "I should have done this a long time ago but have been neglecting this plugin" release.

  • FLV: Don't bundle JW Player with this plugin. It isn't GPL compatible. You'll now need to install it on your own.
  • YouTube: youtu.be short URL support.
  • General: Move SWFObject calls to the footer so <!--nextpage--> doesn't break this plugin.
  • Localization: Added Romanian translation thanks to Web Hosting Geeks.
Location:
vipers-video-quicktags/trunk
Files:
2 added
1 deleted
2 edited

Legend:

Unmodified
Added
Removed
  • vipers-video-quicktags/trunk/readme.txt

    r487177 r530527  
    44Tags: video, quicktags, wysiwyg, tinymce, youtube, google video, dailymotion, vimeo, veoh, viddler, metacafe, blip.tv, flickr, ifilm, myspace, flv, quicktime 
    55Requires at least: 2.8 
    6 Tested up to: 3.3 
     6Tested up to: 3.4 
    77Stable tag: trunk 
    88 
     
    9999 
    100100== Changelog == 
     101 
     102= v6.4.0 = 
     103 
     104The "I should have done this a long time ago but have been neglecting this plugin" release. 
     105 
     106* **FLV:** Don't bundle JW's FLV Player with this plugin. It isn't GPL compatible. You'll now need to install it on your own. 
     107* **YouTube:** youtu.be short URL support. 
     108* **General:** Move SWFObject calls to the footer so `<!--nextpage-->` doesn't break this plugin. 
     109* **Localization:** Added Romanian translation thanks to Web Hosting Geeks. 
    101110 
    102111= v6.3.4 = 
  • vipers-video-quicktags/trunk/vipers-video-quicktags.php

    r487177 r530527  
    66Plugin URI:   http://www.viper007bond.com/wordpress-plugins/vipers-video-quicktags/ 
    77Description:  Easily embed videos from various video websites such as YouTube, DailyMotion, and Vimeo into your posts. 
    8 Version:      6.3.4 
     8Version:      6.4.0 
    99Author:       Viper007Bond 
    1010Author URI:   http://www.viper007bond.com/ 
     
    1212************************************************************************** 
    1313 
    14 Copyright (C) 2006-2011 Viper007Bond 
     14Copyright (C) 2006-2012 Viper007Bond 
    1515 
    1616This program is free software: you can redistribute it and/or modify 
     
    5656 
    5757class VipersVideoQuicktags { 
    58     var $version = '6.3.4'; 
     58    var $version = '6.4.0'; 
    5959    var $settings = array(); 
    6060    var $defaultsettings = array(); 
     
    278278        } 
    279279        if ( -1 == version_compare( $usersettings['version'], '6.2.10' ) ) { 
    280             if ( false !== strpos( $usersettings['customfeedtext'], '<p>' ) || false !== strpos( $usersettings['customfeedtext'], '</p>' ) ) 
     280            if ( ! empty( $usersettings['customfeedtext'] ) && ( false !== strpos( $usersettings['customfeedtext'], '<p>' ) || false !== strpos( $usersettings['customfeedtext'], '</p>' ) ) ) 
    281281                $usersettings['customfeedtext'] = str_replace( array( '<p>', '</p>' ), '', $usersettings['customfeedtext'] ); 
    282282            $upgrade = true; 
     
    307307        add_action( 'wp_head', array(&$this, 'Head') ); 
    308308        add_action( 'admin_head', array(&$this, 'Head') ); 
    309         add_action( 'the_content', array(&$this, 'SWFObjectCalls'), 50 ); 
     309        add_action( 'wp_footer', array(&$this, 'SWFObjectCalls'), 50 ); 
    310310        add_filter( 'widget_text', 'do_shortcode', 11 ); // Videos in the text widget 
    311         add_action( 'widget_text', array(&$this, 'SWFObjectCalls'), 50 ); 
    312311 
    313312        // Hide the donate button on WPMU installs as admins probably don't want it there 
     
    384383                    add_action( 'admin_footer-post-new.php', array( &$this, 'quicktag_buttons' ) ); 
    385384                } 
     385            } 
     386 
     387            // Display a warning if FLV button is showing but player isn't installed 
     388            if ( 1 == $this->settings['flv']['button'] && ! $this->is_jw_flv_player_installed() ) { 
     389                add_action( 'admin_notices', array( &$this, 'admin_notices_install_jw_player_warning' ) ); 
    386390            } 
    387391        } 
     
    473477 
    474478 
     479    function is_jw_flv_player_installed() { 
     480        return file_exists( WP_CONTENT_DIR . '/jw-flv-player/player.swf' ); 
     481    } 
     482 
     483 
     484    function admin_notices_install_jw_player_warning() { 
     485        global $parent_file; 
     486 
     487        add_settings_error( 'vvq_options', 'vvq_jw_flv_player_not_installed', sprintf( __( 'IMPORTANT MESSAGE FROM THE VIPER\'S VIDEO QUICKTAGS PLUGIN: In order for your <code>[flv]</code> video embeds to continue to work, you must manually reinstall the JW FLV Player! Please download <a href="%1$s">this ZIP file</a> and then upload the <code>jw-flv-player</code> folder inside of the ZIP to your <code>wp-content</code> folder (%2$s). For details about this change, please see <a href="%3$s">this blog post</a> on the plugin author\'s website.', 'a8c-developer' ), 'http://v007.me/jwflvplayer', '<code>' . WP_CONTENT_DIR . '/</code>', 'http://v007.me/9a4' ) ); 
     488 
     489        // Avoid a double message 
     490        if ( 'options-general.php' != $parent_file ) 
     491            settings_errors( 'vvq_options' ); 
     492    } 
     493 
     494 
    475495    // Check the posts to be displayed looking for the QuickTime tag. If found, load the JS script. 
    476496    function MaybeEnqueueQuicktimeJavascript() { 
     
    542562        if ( 1 != $this->settings['spike']['button'] )       $buttons2hide[] = 'Spike'; 
    543563        if ( 1 != $this->settings['myspace']['button'] )     $buttons2hide[] = 'MySpace'; 
    544         if ( 1 != $this->settings['flv']['button'] )         $buttons2hide[] = 'FLV'; 
    545564        if ( 1 != $this->settings['quicktime']['button'] )   $buttons2hide[] = 'Quicktime'; 
    546565        if ( 1 != $this->settings['videofile']['button'] )   $buttons2hide[] = 'VideoFile'; 
     566 
     567        if ( 1 != $this->settings['flv']['button'] || ! $this->is_jw_flv_player_installed() ) 
     568            $buttons2hide[] = 'FLV'; 
    547569 
    548570        if ( ! empty( $buttons2hide ) ) 
     
    644666        $buttonshtml = $datajs = ''; 
    645667        foreach ( $this->buttons as $type => $strings ) { 
     668            if ( 'flv' == $type && ! $this->is_jw_flv_player_installed() ) 
     669                continue; 
     670 
    646671            // HTML for quicktag button 
    647672            if ( 1 == $this->settings[$type]['button'] ) 
     
    828853    // No way to figure out what button is pressed from the callback, so gotta make wrappers 
    829854    foreach ( $this->buttons as $id => $details ) { 
     855        if ( 'flv' == $id && ! $this->is_jw_flv_player_installed() ) 
     856            continue; 
     857 
    830858        if ( 1 != $this->settings[$id]['button'] ) 
    831859            continue; 
     
    12031231            'dailymotion' => __('DailyMotion', 'vipers-video-quicktags'), 
    12041232            'vimeo'       => __('Vimeo', 'vipers-video-quicktags'), 
    1205             'flv'         => __('Flash Video (FLV)', 'vipers-video-quicktags'), 
     1233        ); 
     1234 
     1235        if ( $this->is_jw_flv_player_installed() ) 
     1236            $tabs['flv'] = __('Flash Video (FLV)', 'vipers-video-quicktags'); 
     1237 
     1238        $tabs = array_merge( $tabs, array( 
    12061239            'help'        => __('Help', 'vipers-video-quicktags'), 
    12071240            'credits'     => __('Credits', 'vipers-video-quicktags'), 
    1208         ); 
     1241        ) ); 
     1242 
    12091243        $tabhtml = array(); 
    12101244 
     
    18961930                vvqflvparams["volume"] = "100"; 
    18971931                vvqflvparams["bufferlength"] = "15"; 
    1898                 vvqflvparams["skin"] = "<?php echo plugins_url('/vipers-video-quicktags/resources/jw-flv-player/skins/'); ?>" + jQuery("#vvq-flv-skin").val() + ".swf"; 
     1932                vvqflvparams["skin"] = "<?php echo content_url('/jw-flv-player/skins/'); ?>" + jQuery("#vvq-flv-skin").val() + ".swf"; 
    18991933                vvqflvparams["wmode"] = "transparent"; 
    19001934                vvqflvparams["allowfullscreen"] = "true"; 
     
    19091943 
    19101944                swfobject.embedSWF( 
    1911                     "<?php echo plugins_url('/vipers-video-quicktags/resources/jw-flv-player/player.swf'); ?>", 
     1945                    "<?php echo content_url('/jw-flv-player/player.swf'); ?>", 
    19121946                    "vvqvideopreview", 
    19131947                    jQuery("#vvq-width").val(), 
     
    24302464        <li><?php printf( __('<strong>Hungarian:</strong> %s', 'vipers-video-quicktags'), '<a href="http://filmhirek.com/">jamesb</a>' ); ?></li> 
    24312465        <li><?php printf( __('<strong>Italian:</strong> %s', 'vipers-video-quicktags'), '<a href="http://gidibao.net/">Gianni Diurno</a>' ); ?></li> 
    2432         <!--<li><?php printf( __('<strong>Polish:</strong> %s', 'vipers-video-quicktags'), '<a href="http://www.brt12.eu/">Bartosz Sobczyk</a>' ); ?></li>--> 
     2466        <!--<li><?php //printf( __('<strong>Polish:</strong> %s', 'vipers-video-quicktags'), '<a href="http://www.brt12.eu/">Bartosz Sobczyk</a>' ); ?></li>--> 
     2467        <li><?php printf( __('<strong>Romanian:</strong> %s', 'vipers-video-quicktags'), '<a href="http://webhostinggeeks.com/">Web Hosting Geeks</a>' ); ?></li> 
    24332468        <li><?php printf( __('<strong>Russian:</strong> %s', 'vipers-video-quicktags'), '<a href="http://handynotes.ru/">Dennis Bri</a>' ); ?></li> 
    24342469        <li><?php printf( __('<strong>Spanish:</strong> %s', 'vipers-video-quicktags'), '<a href="http://equipajedemano.info/">Omi</a>' ); ?></li> 
     
    24762511                if ( true != jQuery(this).attr("checked") ) return; 
    24772512                var agree = confirm("<?php echo esc_js( __("Do you agree to the Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported license? A link to it can be found to the left.\n\nIn short though, you cannot use JW's FLV Media Player on a commercial site without purchasing a commercial license.", 'vipers-video-quicktags') ); ?>"); 
     2513                // ' 
    24782514                if ( true != agree ) return false; 
    24792515            }); 
     
    24942530        </thead> 
    24952531        <tbody> 
    2496             <tr class="alternate"> 
     2532            <tr> 
    24972533                <td style="text-align:left"><a href="http://www.youtube.com/"><?php _e('YouTube', 'vipers-video-quicktags'); ?></a></td> 
    24982534                <td><input name="vvq[youtube][button]" type="checkbox" value="1"<?php checked($this->settings['youtube']['button'], 1); ?> /></td> 
     
    25202556                <td><input name="vvq[googlevideo][aspectratio]" class="vvq-aspectratio" type="checkbox" value="1"<?php checked($this->settings['googlevideo']['aspectratio'], 1); ?> /></td> 
    25212557            </tr> 
    2522             <tr class="alternate"> 
     2558            <tr> 
    25232559                <td style="text-align:left"><a href="http://www.dailymotion.com/"><?php _e('DailyMotion', 'vipers-video-quicktags'); ?></a></td> 
    25242560                <td><input name="vvq[dailymotion][button]" type="checkbox" value="1"<?php checked($this->settings['dailymotion']['button'], 1); ?> /></td> 
     
    25462582                <td><input name="vvq[vimeo][aspectratio]" class="vvq-aspectratio" type="checkbox" value="1"<?php checked($this->settings['vimeo']['aspectratio'], 1); ?> /></td> 
    25472583            </tr> 
    2548             <tr class="alternate"> 
     2584            <tr> 
    25492585                <td style="text-align:left"><a href="http://www.veoh.com/"><?php _e('Veoh', 'vipers-video-quicktags'); ?></a></td> 
    25502586                <td><input name="vvq[veoh][button]" type="checkbox" value="1"<?php checked($this->settings['veoh']['button'], 1); ?> /></td> 
     
    25662602                <td>&nbsp;</td> 
    25672603            </tr> 
    2568             <tr class="alternate"> 
     2604            <tr> 
    25692605                <td style="text-align:left"><a href="http://www.metacafe.com/"><?php _e('Metacafe', 'vipers-video-quicktags'); ?></a></td> 
    25702606                <td><input name="vvq[metacafe][button]" type="checkbox" value="1"<?php checked($this->settings['metacafe']['button'], 1); ?> /></td> 
     
    25922628                <td><input name="vvq[bliptv][aspectratio]" class="vvq-aspectratio" type="checkbox" value="1"<?php checked($this->settings['bliptv']['aspectratio'], 1); ?> /></td> 
    25932629            </tr> 
    2594             <tr class="alternate"> 
     2630            <tr> 
    25952631                <td style="text-align:left"><a href="http://www.flickr.com/"><?php _e('Flickr Video', 'vipers-video-quicktags'); ?></a></td> 
    25962632                <td><input name="vvq[flickrvideo][button]" type="checkbox" value="1"<?php checked($this->settings['flickrvideo']['button'], 1); ?> /></td> 
     
    26182654                <td><input name="vvq[spike][aspectratio]" class="vvq-aspectratio" type="checkbox" value="1"<?php checked($this->settings['spike']['aspectratio'], 1); ?> /></td> 
    26192655            </tr> 
    2620             <tr class="alternate"> 
     2656            <tr> 
    26212657                <td style="text-align:left"><a href="http://vids.myspace.com/"><?php _e('MySpaceTV', 'vipers-video-quicktags'); ?></a></td> 
    26222658                <td><input name="vvq[myspace][button]" type="checkbox" value="1"<?php checked($this->settings['myspace']['button'], 1); ?> /></td> 
     
    26312667                <td><input name="vvq[myspace][aspectratio]" class="vvq-aspectratio" type="checkbox" value="1"<?php checked($this->settings['myspace']['aspectratio'], 1); ?> /></td> 
    26322668            </tr> 
     2669<?php 
     2670    // Only show the FLV row if the player is installed or the button was already checked 
     2671    // This effectively disables it for new users 
     2672    if ( $this->is_jw_flv_player_installed() || 1 == $this->settings['flv']['button'] ) : 
     2673?> 
    26332674            <tr> 
    26342675                <td style="text-align:left"><?php 
     
    26382679                        echo '<br /><small>' . sprintf( __('<a href="%1$s">JW\'s FLV Media Player</a> is covered by the <a href="%2$s">Creative Commons Noncommercial<br />license</a> which means you cannot use it on a <a href="%3$s">commercial website</a>.', 'vipers-video-quicktags'), 'http://www.jeroenwijering.com/?item=JW_FLV_Media_Player', 'http://creativecommons.org/licenses/by-nc-sa/3.0/', 'http://www.jeroenwijering.com/?page=order' ); 
    26392680                ?></small></td> 
    2640                 <td><input name="vvq[flv][button]" id="vvq-flvbutton" type="checkbox" value="1"<?php checked($this->settings['flv']['button'], 1); ?> /></td> 
     2681                <td><input name="vvq[flv][button]" id="vvq-flvbutton" type="checkbox" value="1" <?php checked($this->settings['flv']['button'], 1); disabled( $this->is_jw_flv_player_installed(), false ); ?> /></td> 
    26412682                <td><input name="vvq[flv][width]" type="text" size="5" value="<?php echo $this->settings['flv']['width']; ?>" /></td> 
    26422683                <td><input name="vvq[flv][height]" type="text" size="5" value="<?php echo $this->settings['flv']['height']; ?>" /></td> 
    26432684                <td>&nbsp;</td> 
    26442685            </tr> 
    2645             <tr class="alternate"> 
     2686<?php endif; ?> 
     2687            <tr> 
    26462688                <td style="text-align:left"><?php _e('Quicktime', 'vipers-video-quicktags'); ?></td> 
    26472689                <td><input name="vvq[quicktime][button]" type="checkbox" value="1"<?php checked($this->settings['quicktime']['button'], 1); ?> /></td> 
     
    28542896            // Playlist URL ( http://www.youtube.com/playlist?list=PLXXXXX ) 
    28552897            if ( false !== stristr( $content, 'playlist' ) ) { 
    2856                 preg_match( '#http://(www.youtube|youtube|[A-Za-z]{2}.youtube)\.com/playlist\?list=([\w-]+)(.*?)#i', $content, $matches ); 
     2898                preg_match( '#https?://(www.youtube|youtube|[A-Za-z]{2}.youtube)\.com/playlist\?list=([\w-]+)(.*?)#i', $content, $matches ); 
    28572899                if ( empty( $matches ) || empty( $matches[2] ) ) 
    28582900                    return $this->error( sprintf( __( 'Unable to parse URL, check for correct %s format', 'vipers-video-quicktags' ), __( 'YouTube' ) ) ); 
     
    28632905            // Legacy playlists ( http://www.youtube.com/view_play_list?p=XXX ) 
    28642906            elseif ( FALSE !== stristr( $content, 'view_play_list' ) ) { 
    2865                 preg_match( '#http://(www.youtube|youtube|[A-Za-z]{2}.youtube)\.com/view_play_list\?p=([\w-]+)(.*?)#i', $content, $matches ); 
     2907                preg_match( '#https?://(www.youtube|youtube|[A-Za-z]{2}.youtube)\.com/view_play_list\?p=([\w-]+)(.*?)#i', $content, $matches ); 
    28662908                if ( empty($matches) || empty($matches[2]) ) return $this->error( sprintf( __('Unable to parse URL, check for correct %s format', 'vipers-video-quicktags'), __('YouTube') ) ); 
    28672909 
     
    28692911                $fallbacklink = $fallbackcontent = 'http://www.youtube.com/view_play_list?p=' . $matches[2]; 
    28702912            } 
     2913            // Short youtu.be URL 
     2914            elseif ( FALSE !== stristr( $content, 'youtu.be' ) ) { 
     2915                preg_match( '#https?://youtu\.be/([\w-]+)#i', $content, $matches ); 
     2916                if ( empty($matches) || empty($matches[1]) ) 
     2917                    return $this->error( sprintf( __('Unable to parse URL, check for correct %s format', 'vipers-video-quicktags'), __('YouTube') ) ); 
     2918 
     2919                $embedpath = 'v/' . $matches[1]; 
     2920                $fallbacklink = 'http://www.youtube.com/watch?v=' . $matches[1]; 
     2921                $fallbackcontent = '<img src="http://img.youtube.com/vi/' . $matches[1] . '/0.jpg" alt="' . __('YouTube Preview Image', 'vipers-video-quicktags') . '" />'; 
     2922            } 
    28712923            // Normal video URL 
    28722924            else { 
    2873                 preg_match( '#http://(www.youtube|youtube|[A-Za-z]{2}.youtube)\.com/(watch\?v=|w/\?v=|\?v=)([\w-]+)(.*?)#i', $content, $matches ); 
     2925                preg_match( '#https?://(www.youtube|youtube|[A-Za-z]{2}.youtube)\.com/(watch\?v=|w/\?v=|\?v=)([\w-]+)(.*?)#i', $content, $matches ); 
    28742926                if ( empty($matches) || empty($matches[3]) ) return $this->error( sprintf( __('Unable to parse URL, check for correct %s format', 'vipers-video-quicktags'), __('YouTube') ) ); 
    28752927 
     
    34633515    // Handle FLV videos 
    34643516    function shortcode_flv( $atts, $content = '' ) { 
     3517        if ( ! $this->is_jw_flv_player_installed() ) 
     3518            return $this->error( __( 'FLV shortcode is disabled until you install JW FLV Player! See the admin area for details.', 'vipers-video-quicktags' ) ); 
     3519 
    34653520        $origatts = $atts; 
    34663521        $content = $this->wpuntexturize( $content ); 
     
    35003555        // Skin 
    35013556        if ( !empty($this->settings['flv']['skin']) && !empty($this->flvskins[$this->settings['flv']['skin']]) ) 
    3502             $flashvars['skin'] = plugins_url('/vipers-video-quicktags/resources/jw-flv-player/skins/' . $this->settings['flv']['skin'] . '.swf'); 
     3557            $flashvars['skin'] = content_url('/jw-flv-player/skins/' . $this->settings['flv']['skin'] . '.swf'); 
    35033558 
    35043559        // Custom colors 
     
    35473602        $objectid = $this->videoid('flv'); 
    35483603 
    3549         $swfurl = plugins_url('/vipers-video-quicktags/resources/jw-flv-player/player.swf'); 
     3604        $swfurl = content_url('/jw-flv-player/player.swf'); 
    35503605 
    35513606        $this->swfobjects[$objectid] = array( 'width' => $atts['width'], 'height' => $atts['height'], 'url' => $swfurl, 'flashvars' => $flashvars ); 
     
    36913746 
    36923747 
    3693     // Output the SWFObject calls that replace all of the placeholders created by the shortcode handlers with the Flash videos (this is per post now) 
    3694     function SWFObjectCalls( $content ) { 
    3695         global $wpmu_version; 
    3696  
    3697         if ( is_feed() || empty($this->swfobjects) ) return $content; 
     3748    // Output the SWFObject calls that replace all of the placeholders created by the shortcode handlers with the Flash videos 
     3749    function SWFObjectCalls() { 
     3750        if ( is_feed() || empty($this->swfobjects) ) 
     3751            return; 
    36983752 
    36993753        // Abort if wp_head() is missing from the theme 
    37003754        //if ( FALSE == $this->wpheadrun ) return $content; 
    37013755 
    3702         $content .= "\n<script type=\"text/javascript\">\n"; 
     3756        $content = "\n<script type=\"text/javascript\">\n"; 
    37033757        //$content .= "// <![CDATA[\n"; 
    37043758 
     
    37343788        $this->swfobjects = array(); 
    37353789 
    3736         return $content; 
     3790        echo $content; 
    37373791    } 
    37383792 
Note: See TracChangeset for help on using the changeset viewer.