Featured Video Plus - Version 1.4

Version Description

WP3.5 Media Manager, time-links...

Download this release

Release Info

Developer a.hoereth
Plugin Icon 128x128 Featured Video Plus
Version 1.4
Comparing to
See all releases

Code changes from version 1.3 to 1.4

css/backend-min.css CHANGED
@@ -1 +1 @@
1
- .wp-picker-holder{position:absolute;bottom:2.5em;left:-1em;z-index:1;-webkit-box-shadow:3px 3px 5px #ddd;-moz-box-shadow:3px 3px 5px #ddd;box-shadow:3px 3px 5px #ddd;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.fvp_colorpicker{position:absolute;bottom:0;right:-197px;background-color:#fff;z-index:100;border:1px solid #ccc}.defaultTextActive{color:#a1a1a1;font-style:italic}#fvp_activation_notification{border-color:#00adef!important;background-color:whiteSmoke!important}.fvp_hidden{display:none}.fvp_notice{-webkit-border-radius:3px;border-radius:3px;border-width:1px;border-style:solid;background-color:white;border-color:gray;margin:.5em 0;padding:.4em .6em .2em}.fvp_warning{-webkit-border-radius:3px;border-radius:3px;border-width:1px;border-style:solid;background-color:lightYellow;border-color:#e6db55;margin:.5em 0;padding:.4em .6em .2em}#featured_video_plus-box textarea{resize:none;width:100%;height:1.1em;line-height:1.1em;font-size:1em}.fvp_grouplable{width:100px;float:left;padding-top:2px}.fvp_grouppart1{width:200px;float:left;padding-top:2px}.fvp_readonly{color:gray!important}.fvp_invalid{background-color:#fa8072}
1
+ .wp-picker-holder{position:absolute;bottom:2.5em;left:-1em;z-index:1;-webkit-box-shadow:3px 3px 5px #ddd;-moz-box-shadow:3px 3px 5px #ddd;box-shadow:3px 3px 5px #ddd;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.fvp_colorpicker{position:absolute;bottom:0;right:-197px;background-color:#fff;z-index:100;border:1px solid #ccc}.defaultTextActive{color:#a1a1a1;font-style:italic}#fvp_activation_notification{border-color:#00adef!important;background-color:whiteSmoke!important}.fvp_hidden{display:none}.fvp_notice{-webkit-border-radius:3px;border-radius:3px;border-width:1px;border-style:solid;background-color:white;border-color:gray;margin:.5em 0;padding:.4em .6em .2em}.fvp_warning{-webkit-border-radius:3px;border-radius:3px;border-width:1px;border-style:solid;background-color:lightYellow;border-color:#e6db55;margin:.5em 0;padding:.4em .6em .2em}#featured_video_plus-box textarea{resize:none;width:100%;height:1.1em;line-height:1.1em;font-size:1em}.fvp_grouplable{width:100px;float:left;padding-top:2px}.fvp_grouppart1{width:200px;float:left;padding-top:2px}.fvp_readonly{color:gray!important}.fvp_invalid{background-color:#fa8072}.fvp_radio_bumper{float:left;width:100px}.fvp_input_wrapper{position:relative}#featured_video_plus-box .fvp_input{padding-right:21px}.fvp_media_icon{background:transparent no-repeat top left;display:block;width:15px;height:15px;position:absolute;top:4px;right:4px}.fvp_code_list li{margin-bottom:0}.box_topright{float:right;width:20px;height:30px;line-height:30px;text-align:center}.box_topright #fvp_remove{display:block;height:10px;width:10px;margin-top:10px;background:url('/wordpress/wp-admin/images/xit.gif') no-repeat center left}.box_topright #fvp_remove:hover{background:url('/wordpress/wp-admin/images/xit.gif') no-repeat center right}
css/backend.css CHANGED
@@ -74,4 +74,45 @@
74
  }
75
  .fvp_invalid {
76
  background-color: #FA8072;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
77
  }
74
  }
75
  .fvp_invalid {
76
  background-color: #FA8072;
77
+ }
78
+
79
+ .fvp_radio_bumper {
80
+ float: left;
81
+ width: 100px;
82
+ }
83
+
84
+ .fvp_input_wrapper {
85
+ position: relative;
86
+ }
87
+ #featured_video_plus-box .fvp_input {
88
+ padding-right: 21px;
89
+ }
90
+ .fvp_media_icon {
91
+ background: transparent no-repeat top left;
92
+ display: block;
93
+ width: 15px;
94
+ height: 15px;
95
+ position: absolute; top: 4px; right: 4px;
96
+ }
97
+
98
+ .fvp_code_list li {
99
+ margin-bottom: 0;
100
+ }
101
+
102
+ .box_topright {
103
+ float: right;
104
+ width: 20px;
105
+ height: 30px;
106
+ line-height: 30px;
107
+ text-align: center;
108
+ }
109
+ .box_topright #fvp_remove {
110
+ display: block;
111
+ height: 10px;
112
+ width: 10px;
113
+ margin-top: 10px;
114
+ background: url('/wordpress/wp-admin/images/xit.gif') no-repeat center left;
115
+ }
116
+ .box_topright #fvp_remove:hover {
117
+ background: url('/wordpress/wp-admin/images/xit.gif') no-repeat center right;
118
  }
featured-video-plus.php CHANGED
@@ -4,7 +4,7 @@ Plugin Name: Featured Video Plus
4
  Plugin URI: https://github.com/ahoereth/featured-video-plus
5
  Description: Add Featured Videos to your posts and pages.
6
  Author: Alexander Höreth
7
- Version: 1.3
8
  Author URI: http://ahoereth.yrnxt.com
9
  License: GPL2
10
 
@@ -27,56 +27,57 @@ License: GPL2
27
  */
28
 
29
  if (!defined('FVP_VERSION'))
30
- define('FVP_VERSION', '1.3');
31
 
32
  // symlink proof
33
  $pathinfo = pathinfo(dirname(plugin_basename(__FILE__)));
34
  if (!defined('FVP_NAME'))
35
  define('FVP_NAME', $pathinfo['filename']);
36
-
37
  if (!defined('FVP_DIR'))
38
  define('FVP_DIR', plugin_dir_path(__FILE__));
39
-
40
  if (!defined('FVP_URL'))
41
- define('FVP_URL', plugins_url(FVP_NAME) . '/'); //
42
 
43
  // init general class, located in php/general.php
44
  include_once( FVP_DIR . 'php/general.php' );
45
  $featured_video_plus = new featured_video_plus();
46
 
 
 
 
47
  // init translations
48
  add_action( 'plugins_loaded', array( &$featured_video_plus, 'language' ) );
49
 
50
- // only on backend / administration interface
51
- if( is_admin() ) {
52
- // plugin upgrade/setup
53
- include_once( FVP_DIR . '/php/upgrade.php' );
54
- add_action( 'admin_init', 'featured_video_plus_upgrade' );
55
-
56
 
 
 
57
  // init backend class, located in php/backend.php
58
  include_once( FVP_DIR . 'php/backend.php' );
59
  $featured_video_plus_backend = new featured_video_plus_backend($featured_video_plus);
60
 
 
 
 
 
61
  // admin meta box
62
  add_action('admin_menu', array( &$featured_video_plus_backend, 'metabox_register' ) );
63
  add_action('save_post', array( &$featured_video_plus_backend, 'metabox_save' ) );
64
 
65
  // enqueue admin scripts and styles
66
- add_action('admin_enqueue_scripts', array( &$featured_video_plus_backend, 'enqueue' ) );
67
- add_action('admin_enqueue_scripts', array( &$featured_video_plus, 'enqueue' ) );
68
 
69
  // link to media settings on plugins overview
70
- add_filter('plugin_action_links', array( &$featured_video_plus_backend, 'plugin_action_link' ), 10, 2);
71
 
72
  // add upload mime types for HTML5 videos
73
- add_filter('upload_mimes', array( &$featured_video_plus_backend, 'add_upload_mimes' ) );
74
 
75
  // post edit help
76
- add_action('admin_init', array( &$featured_video_plus_backend, 'help' ) );
77
- add_action( 'load-post.php', array( &$featured_video_plus_backend, 'tabs' ), 20 ); // $GLOBALS['pagenow']
78
  if( get_bloginfo('version') < 3.3 )
79
- add_filter( 'contextual_help', array( &$featured_video_plus_backend, 'help_pre_33' ), 10, 3 );
80
 
81
  // admin settings
82
  include_once( FVP_DIR . 'php/settings.php' );
@@ -84,10 +85,10 @@ if( is_admin() ) {
84
  add_action( 'admin_init', array( &$featured_video_plus_settings, 'settings_init' ) );
85
 
86
  // media settings help
87
- add_action('admin_init', array( &$featured_video_plus_settings, 'help' ) );
88
  add_action( 'load-options-media.php', array( &$featured_video_plus_settings, 'tabs' ), 20 ); // $GLOBALS['pagenow']
89
  if( get_bloginfo('version') < 3.3 )
90
- add_filter( 'contextual_help', array( &$featured_video_plus_settings, 'help_pre_33' ), 10, 3 );
91
  }
92
 
93
 
@@ -99,32 +100,13 @@ if( !is_admin() ) {
99
 
100
  // enqueue scripts and styles
101
  add_action( 'wp_enqueue_scripts', array( &$featured_video_plus_frontend, 'enqueue' ) );
102
- add_action( 'wp_enqueue_scripts', array( &$featured_video_plus, 'enqueue' ) );
103
 
104
  // filter get_post_thumbnail output
105
- add_filter('post_thumbnail_html', array( &$featured_video_plus_frontend, 'filter_post_thumbnail'), 99, 5);
106
-
107
-
108
- // functions which are available to theme developers follow here:
109
- // echos the current posts featured video
110
- function the_post_video( $size = null) {
111
- echo get_the_post_video(null, $size);
112
- }
113
-
114
- // returns the posts featured video
115
- function get_the_post_video($post_id = null, $size = null) {
116
- global $featured_video_plus;
117
- return $featured_video_plus->get_the_post_video($post_id, $size);
118
- }
119
-
120
- // checks if post has a featured video
121
- function has_post_video($post_id = null){
122
- global $featured_video_plus;
123
- return $featured_video_plus->has_post_video($post_id);
124
- }
125
- }
126
 
127
- // shortcode
128
- add_shortcode( 'featured-video-plus', array( &$featured_video_plus, 'shortcode' ) );
 
129
 
130
  ?>
4
  Plugin URI: https://github.com/ahoereth/featured-video-plus
5
  Description: Add Featured Videos to your posts and pages.
6
  Author: Alexander Höreth
7
+ Version: 1.4
8
  Author URI: http://ahoereth.yrnxt.com
9
  License: GPL2
10
 
27
  */
28
 
29
  if (!defined('FVP_VERSION'))
30
+ define('FVP_VERSION', '1.4');
31
 
32
  // symlink proof
33
  $pathinfo = pathinfo(dirname(plugin_basename(__FILE__)));
34
  if (!defined('FVP_NAME'))
35
  define('FVP_NAME', $pathinfo['filename']);
 
36
  if (!defined('FVP_DIR'))
37
  define('FVP_DIR', plugin_dir_path(__FILE__));
 
38
  if (!defined('FVP_URL'))
39
+ define('FVP_URL', plugins_url(FVP_NAME) . '/');
40
 
41
  // init general class, located in php/general.php
42
  include_once( FVP_DIR . 'php/general.php' );
43
  $featured_video_plus = new featured_video_plus();
44
 
45
+ // include api functions which are intended to be used by developers
46
+ include_once( FVP_DIR . 'php/functions.php' );
47
+
48
  // init translations
49
  add_action( 'plugins_loaded', array( &$featured_video_plus, 'language' ) );
50
 
 
 
 
 
 
 
51
 
52
+ // only on backend / administration interface
53
+ if( is_admin() ) {
54
  // init backend class, located in php/backend.php
55
  include_once( FVP_DIR . 'php/backend.php' );
56
  $featured_video_plus_backend = new featured_video_plus_backend($featured_video_plus);
57
 
58
+ // plugin upgrade/setup
59
+ include_once( FVP_DIR . '/php/upgrade.php' );
60
+ add_action( 'admin_init', 'featured_video_plus_upgrade' );
61
+
62
  // admin meta box
63
  add_action('admin_menu', array( &$featured_video_plus_backend, 'metabox_register' ) );
64
  add_action('save_post', array( &$featured_video_plus_backend, 'metabox_save' ) );
65
 
66
  // enqueue admin scripts and styles
67
+ add_action('admin_enqueue_scripts', array( &$featured_video_plus_backend, 'enqueue' ) );
68
+ add_action('admin_enqueue_scripts', array( &$featured_video_plus, 'enqueue' ) );
69
 
70
  // link to media settings on plugins overview
71
+ add_filter('plugin_action_links', array( &$featured_video_plus_backend, 'plugin_action_link' ), 10, 2);
72
 
73
  // add upload mime types for HTML5 videos
74
+ add_filter('upload_mimes', array( &$featured_video_plus_backend, 'add_upload_mimes' ) );
75
 
76
  // post edit help
77
+ add_action('admin_init', array( &$featured_video_plus_backend, 'help' ) );
78
+ add_action( 'load-post.php', array( &$featured_video_plus_backend, 'tabs' ), 20 ); // $GLOBALS['pagenow']
79
  if( get_bloginfo('version') < 3.3 )
80
+ add_filter( 'contextual_help', array( &$featured_video_plus_backend, 'help_pre_33' ), 10, 3 );
81
 
82
  // admin settings
83
  include_once( FVP_DIR . 'php/settings.php' );
85
  add_action( 'admin_init', array( &$featured_video_plus_settings, 'settings_init' ) );
86
 
87
  // media settings help
88
+ add_action('admin_init', array( &$featured_video_plus_settings, 'help' ) );
89
  add_action( 'load-options-media.php', array( &$featured_video_plus_settings, 'tabs' ), 20 ); // $GLOBALS['pagenow']
90
  if( get_bloginfo('version') < 3.3 )
91
+ add_filter( 'contextual_help', array( &$featured_video_plus_settings, 'help_pre_33' ), 10, 3 );
92
  }
93
 
94
 
100
 
101
  // enqueue scripts and styles
102
  add_action( 'wp_enqueue_scripts', array( &$featured_video_plus_frontend, 'enqueue' ) );
103
+ add_action( 'wp_enqueue_scripts', array( &$featured_video_plus, 'enqueue' ) );
104
 
105
  // filter get_post_thumbnail output
106
+ add_filter( 'post_thumbnail_html', array( &$featured_video_plus_frontend, 'filter_post_thumbnail'), 99, 5);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
107
 
108
+ // shortcode
109
+ add_shortcode( 'featured-video-plus', array( &$featured_video_plus_frontend, 'shortcode' ) );
110
+ }
111
 
112
  ?>
js/backend-min.js CHANGED
@@ -1 +1 @@
1
- jQuery(document).ready(function(d){d(".fvp_input").focus(function(){if(d(this).val()==d(this)[0].title){d(this).removeClass("defaultTextActive");d(this).val("")}});d(".fvp_input").blur(function(){if((d(this).val().length===0)||(d(this).val()==d(this)[0].title)){d(this).addClass("defaultTextActive");d(this).val(d(this)[0].title)}});d(".fvp_input").autosize().blur().keypress(function(f){if(f.keyCode==13){f.preventDefault()}});d(".fvp_input").click(function(){d(this).select()});var c=d("#fvp_video").val();if(c.length===0||c==fvp_backend_data.default_value||!c.match(fvp_backend_data.wp_upload_dir.replace(/\//g,"\\/"))){d("#fvp_sec").val(fvp_backend_data.default_value_sec).hide()}d("#fvp_video").bind("change paste keyup",function(){setTimeout(e(d(this)),200)});function e(i){var h=d.trim(i.val());var g=d.trim(d("#fvp_sec").val());d("#fvp_help_notice").show("fast");if(h.length===0||h==fvp_backend_data.default_value){d("#fvp_video").css("backgroundColor","white");d("#fvp_sec").val(fvp_backend_data.default_value_sec).blur().hide("fast");d("#fvp_localvideo_format_warning").hide("fast")}if(h.match(fvp_backend_data.wp_upload_dir.replace(/\//g,"\\/"))){var j=/^.*\/(.*)\.(.*)$/g;var f=j.exec(h);if(f[2]=="webm"||f[2]=="mp4"||f[2]=="ogg"||f[2]=="ogv"){d("#fvp_sec").show("fast");d("#fvp_video").css("backgroundColor","white");d("#fvp_localvideo_format_warning").hide("fast")}else{d("#fvp_sec").val(fvp_backend_data.default_value_sec).blur().hide("fast");d("#fvp_video").css("backgroundColor","lightYellow");d("#fvp_localvideo_format_warning").show("fast")}b()}else{d("#fvp_sec").hide("fast");d("#fvp_video").css("backgroundColor","white");d("#fvp_localvideo_format_warning").hide("fast")}}d("#fvp_sec").bind("change paste keyup",function(){setTimeout(a(d(this)),200)});function a(i){var h=d.trim(i.val());var f=d.trim(d("#fvp_video").val());if(h.length===0||h==fvp_backend_data.default_value){d("#fvp_localvideo_format_warning").hide("fast");d("#fvp_sec").css("backgroundColor","white")}if(h.match(fvp_backend_data.wp_upload_dir.replace(/\//g,"\\/"))){var j=/^.*\/(.*)\.(.*)$/g;var g=j.exec(h);if(g[2]=="webm"||g[2]=="mp4"||g[2]=="ogg"||g[2]=="ogv"){b();d("#fvp_sec").css("backgroundColor","white");d("#fvp_localvideo_format_warning").hide("fast")}else{b();d("#fvp_sec").css("backgroundColor","lightYellow");d("#fvp_localvideo_format_warning").show("fast")}}else{if(h.length!==0){d("#fvp_sec").css("backgroundColor","lightYellow");d("#fvp_localvideo_notdistinct_warning").show("fast")}}}function b(){if(d("#fvp_video").val()==d("#fvp_sec").val()){d("#fvp_sec").css("backgroundColor","lightYellow");d("#fvp_localvideo_notdistinct_warning").show("fast")}else{d("#fvp_localvideo_notdistinct_warning").hide("fast");d("#fvp_sec").css("backgroundColor","white")}}d("#fvp_set_featimg_link").show();d("#fvp_set_featimg_input").hide();d("#fvp_set_featimg_link, #fvp_warning_set_featimg").click(function(){d("#fvp_set_featimg").attr("checked",true);d("#fvp_set_featimg").closest("form").submit();return false});d("#remove-post-thumbnail").click(function(){d("#fvp_featimg_box_warning").removeClass("fvp_hidden")});d("#set-post-thumbnail").click(function(){d("#fvp_featimg_box_warning").addClass("fvp_hidden")});d("#fvp_help_toggle").bind("click",function(){d("#contextual-help-link").trigger("click")})});
1
+ jQuery(document).ready(function(f){f(".fvp_input").blur(function(){f(this).val(f.trim(f(this).val()));e=f(this).val();if((e.length===0)||(e==fvp_backend_data.default_value)||(e==fvp_backend_data.default_value_sec)){f(this).addClass("defaultTextActive");if(f(this).attr("id")=="fvp_video"){f(this).val(fvp_backend_data.default_value)}else{f(this).val(fvp_backend_data.default_value_sec)}}f(this).trigger("autosize")});f(".fvp_input").focus(function(){e=f(this).val();if((e==fvp_backend_data.default_value)||(e==fvp_backend_data.default_value_sec)){f(this).removeClass("defaultTextActive");f(this).val("")}});f(".fvp_input").autosize().trigger("blur").keypress(function(i){if(i.keyCode==13){i.preventDefault()}});f(".fvp_input").click(function(){f(this).select()});var e=f("#fvp_video").val();if(e.length===0||e==fvp_backend_data.default_value||!e.match(fvp_backend_data.wp_upload_dir.replace(/\//g,"\\/"))){f("#fvp_sec").val(fvp_backend_data.default_value_sec);f("#fvp_sec_wrapper").hide()}f("#fvp_video").bind("change paste keyup",function(){setTimeout(h(f(this)),200)});function h(l){var k=f.trim(l.val());var j=f.trim(f("#fvp_sec").val());f("#fvp_help_notice").show("fast");if(k.length===0||k==fvp_backend_data.default_value){f("#fvp_video").css("backgroundColor","white");f("#fvp_sec").val(fvp_backend_data.default_value_sec).blur();f("#fvp_sec_wrapper").hide("fast","linear");f("#fvp_localvideo_format_warning").hide("fast","linear")}if(k.match(fvp_backend_data.wp_upload_dir.replace(/\//g,"\\/"))){var m=/^.*\/(.*)\.(.*)$/g;var i=m.exec(k);if(i[2]=="webm"||i[2]=="mp4"||i[2]=="ogg"||i[2]=="ogv"){f("#fvp_sec_wrapper").show("fast","linear");f("#fvp_video").css("backgroundColor","white");f("#fvp_localvideo_format_warning").hide("fast","linear")}else{f("#fvp_sec").val(fvp_backend_data.default_value_sec).blur();f("#fvp_sec_wrapper").hide("fast","linear");f("#fvp_video").css("backgroundColor","lightYellow");f("#fvp_localvideo_format_warning").show("fast","linear")}d()}else{f("#fvp_sec_wrapper").hide("fast","linear");f("#fvp_video").css("backgroundColor","white");f("#fvp_localvideo_format_warning").hide("fast","linear")}}f("#fvp_sec").bind("change paste keyup",function(){setTimeout(a(f(this)),200)});function a(l){var k=f.trim(l.val());var i=f.trim(f("#fvp_video").val());if(k.length===0||k==fvp_backend_data.default_value){f("#fvp_localvideo_format_warning").hide("fast");f("#fvp_sec").css("backgroundColor","white")}if(k.match(fvp_backend_data.wp_upload_dir.replace(/\//g,"\\/"))){var m=/^.*\/(.*)\.(.*)$/g;var j=m.exec(k);if(j[2]=="webm"||j[2]=="mp4"||j[2]=="ogg"||j[2]=="ogv"){d();f("#fvp_sec").css("backgroundColor","white");f("#fvp_localvideo_format_warning").hide("fast")}else{d();f("#fvp_sec").css("backgroundColor","lightYellow");f("#fvp_localvideo_format_warning").show("fast")}}else{if(k.length!==0){f("#fvp_sec").css("backgroundColor","lightYellow");f("#fvp_localvideo_notdistinct_warning").show("fast")}}}function d(){if(f("#fvp_video").val()==f("#fvp_sec").val()){f("#fvp_sec").css("backgroundColor","lightYellow");f("#fvp_localvideo_notdistinct_warning").show("fast")}else{f("#fvp_localvideo_notdistinct_warning").hide("fast");f("#fvp_sec").css("backgroundColor","white")}}f("#fvp_set_featimg_link").show();f("#fvp_set_featimg_input").hide();f("#fvp_set_featimg_link, #fvp_warning_set_featimg").click(function(){f("#fvp_set_featimg").attr("checked",true);f("#fvp_set_featimg").closest("form").submit();return false});f("#remove-post-thumbnail").click(function(){f("#fvp_featimg_box_warning").removeClass("fvp_hidden")});f("#set-post-thumbnail").click(function(){f("#fvp_featimg_box_warning").addClass("fvp_hidden")});f("#fvp_help_toggle").bind("click",function(){f("#contextual-help-link").trigger("click")});var c,g,b;b={frame:function(){if(this._frame){return this._frame}this._frame=wp.media({title:c.data("title"),library:{type:"video"},button:{text:c.data("button")},multiple:false});this._frame.on("open",this.updateFrame).state("library").on("select",this.select);return this._frame},select:function(){var j=this.get("selection"),i="url";f(c.data("target")).val(j.pluck(i)).trigger("autosize").change().removeClass("defaultTextActive")},updateFrame:function(){},init:function(){f("#wpbody").on("click",".fvp_video_choose",function(i){i.preventDefault();c=f(this).closest(".fvp_input_wrapper");b.frame().open()})}};if(fvp_backend_data.wp_35==1){b.init()}});
js/backend.js CHANGED
@@ -1,40 +1,50 @@
1
  jQuery(document).ready(function($){
2
 
3
  /**
4
- * remove default value on focus
5
  * @since 1.0
6
  */
7
- $(".fvp_input").focus(function() {
8
- if ($(this).val() == $(this)[0].title) {
9
- $(this).removeClass("defaultTextActive");
10
- $(this).val("");
 
 
 
 
 
 
 
11
  }
 
12
  });
13
 
14
  /**
15
- * add default value on blur if empty
16
  * @since 1.0
17
  */
18
- $(".fvp_input").blur(function() {
19
- if ( ($(this).val().length === 0) || ($(this).val() == $(this)[0].title) ) {
20
- $(this).addClass("defaultTextActive");
21
- $(this).val($(this)[0].title);
 
 
22
  }
23
  });
24
 
25
  /**
26
- * blur both input fields on page load, autosize them and prevent enter
27
  * @see http://www.jacklmoore.com/autosize
28
  * @since 1.0
29
  */
30
- $(".fvp_input").autosize().blur().keypress(function(event) {
31
  if (event.keyCode == 13) { // enter
32
  event.preventDefault();
33
  }
34
  });
35
 
36
  /**
37
- * select whole input field content on click
38
  * @since 1.2
39
  */
40
  $(".fvp_input").click(function() {
@@ -46,8 +56,10 @@ jQuery(document).ready(function($){
46
  * @since 1.2
47
  */
48
  var value = $("#fvp_video").val();
49
- if ( value.length === 0 || value == fvp_backend_data.default_value || !value.match( fvp_backend_data.wp_upload_dir.replace(/\//g, "\\\/") ) )
50
- $("#fvp_sec").val( fvp_backend_data.default_value_sec ).hide();
 
 
51
 
52
  /**
53
  * recognize change on the primary video input
@@ -68,27 +80,29 @@ jQuery(document).ready(function($){
68
 
69
  if ( value.length === 0 || value == fvp_backend_data.default_value ) {
70
  $("#fvp_video").css('backgroundColor', 'white');
71
- $("#fvp_sec").val( fvp_backend_data.default_value_sec ).blur().hide('fast');
72
- $("#fvp_localvideo_format_warning").hide('fast');
 
73
  }
74
 
75
  if ( value.match( fvp_backend_data.wp_upload_dir.replace(/\//g, "\\\/") ) ) {
76
  var file_extension = /^.*\/(.*)\.(.*)$/g;
77
  var match = file_extension.exec(value);
78
  if ( match[2] == 'webm' || match[2] == 'mp4' || match[2] == 'ogg' || match[2] == 'ogv' ) {
79
- $("#fvp_sec").show('fast');
80
  $("#fvp_video").css('backgroundColor', 'white');
81
- $("#fvp_localvideo_format_warning").hide('fast');
82
  } else {
83
- $("#fvp_sec").val( fvp_backend_data.default_value_sec ).blur().hide('fast');
 
84
  $("#fvp_video").css('backgroundColor', 'lightYellow');
85
- $("#fvp_localvideo_format_warning").show('fast');
86
  }
87
  distinctContent();
88
  } else {
89
- $("#fvp_sec").hide('fast');
90
  $("#fvp_video").css('backgroundColor', 'white');
91
- $("#fvp_localvideo_format_warning").hide('fast');
92
  }
93
  }
94
 
@@ -175,4 +189,68 @@ jQuery(document).ready(function($){
175
  $('#fvp_help_toggle').bind( 'click', function() {
176
  $('#contextual-help-link').trigger('click');
177
  });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
178
  });
1
  jQuery(document).ready(function($){
2
 
3
  /**
4
+ * Set input field values to default on blur if empty
5
  * @since 1.0
6
  */
7
+ $(".fvp_input").blur(function() {
8
+ $(this).val( $.trim($(this).val()) );
9
+ value = $(this).val();
10
+ if((value.length === 0) ||
11
+ (value == fvp_backend_data.default_value ) ||
12
+ (value == fvp_backend_data.default_value_sec) ){
13
+ $(this).addClass("defaultTextActive");
14
+ if( $(this).attr('id') == 'fvp_video' )
15
+ $(this).val( fvp_backend_data.default_value );
16
+ else
17
+ $(this).val( fvp_backend_data.default_value_sec );
18
  }
19
+ $(this).trigger('autosize');
20
  });
21
 
22
  /**
23
+ * Remove default values of input fields on focus
24
  * @since 1.0
25
  */
26
+ $(".fvp_input").focus(function() {
27
+ value = $(this).val();
28
+ if((value == fvp_backend_data.default_value ) ||
29
+ (value == fvp_backend_data.default_value_sec) ){
30
+ $(this).removeClass("defaultTextActive");
31
+ $(this).val("");
32
  }
33
  });
34
 
35
  /**
36
+ * Blur both input fields on page load, autosize them and prevent enter-keypress
37
  * @see http://www.jacklmoore.com/autosize
38
  * @since 1.0
39
  */
40
+ $(".fvp_input").autosize().trigger("blur").keypress(function(event) { //{append: "\n"}
41
  if (event.keyCode == 13) { // enter
42
  event.preventDefault();
43
  }
44
  });
45
 
46
  /**
47
+ * Select whole input field content on click
48
  * @since 1.2
49
  */
50
  $(".fvp_input").click(function() {
56
  * @since 1.2
57
  */
58
  var value = $("#fvp_video").val();
59
+ if ( value.length === 0 || value == fvp_backend_data.default_value || !value.match( fvp_backend_data.wp_upload_dir.replace(/\//g, "\\\/") ) ) {
60
+ $("#fvp_sec").val( fvp_backend_data.default_value_sec );
61
+ $("#fvp_sec_wrapper").hide();
62
+ }
63
 
64
  /**
65
  * recognize change on the primary video input
80
 
81
  if ( value.length === 0 || value == fvp_backend_data.default_value ) {
82
  $("#fvp_video").css('backgroundColor', 'white');
83
+ $("#fvp_sec").val( fvp_backend_data.default_value_sec ).blur();
84
+ $("#fvp_sec_wrapper").hide('fast', 'linear');
85
+ $("#fvp_localvideo_format_warning").hide('fast', 'linear');
86
  }
87
 
88
  if ( value.match( fvp_backend_data.wp_upload_dir.replace(/\//g, "\\\/") ) ) {
89
  var file_extension = /^.*\/(.*)\.(.*)$/g;
90
  var match = file_extension.exec(value);
91
  if ( match[2] == 'webm' || match[2] == 'mp4' || match[2] == 'ogg' || match[2] == 'ogv' ) {
92
+ $("#fvp_sec_wrapper").show('fast', 'linear');
93
  $("#fvp_video").css('backgroundColor', 'white');
94
+ $("#fvp_localvideo_format_warning").hide('fast', 'linear');
95
  } else {
96
+ $("#fvp_sec").val( fvp_backend_data.default_value_sec ).blur();
97
+ $("#fvp_sec_wrapper").hide('fast', 'linear');
98
  $("#fvp_video").css('backgroundColor', 'lightYellow');
99
+ $("#fvp_localvideo_format_warning").show('fast', 'linear');
100
  }
101
  distinctContent();
102
  } else {
103
+ $("#fvp_sec_wrapper").hide('fast', 'linear');
104
  $("#fvp_video").css('backgroundColor', 'white');
105
+ $("#fvp_localvideo_format_warning").hide('fast', 'linear');
106
  }
107
  }
108
 
189
  $('#fvp_help_toggle').bind( 'click', function() {
190
  $('#contextual-help-link').trigger('click');
191
  });
192
+
193
+
194
+ /**
195
+ * Button in the top right of the Featured Video box. Planned for a feature release.
196
+ *
197
+ * @since 1.#
198
+ */
199
+ //$('#featured_video_plus-box .handlediv').after('<div class="box_topright"><a href="#" id="fvp_remove" title="Remove Featured Video"><br /></div></div>');
200
+
201
+ /**
202
+ * Making use of the WordPress 3.5 Media Manager
203
+ *
204
+ * @see http://www.blazersix.com/blog/wordpress-image-widget/
205
+ * @see https://github.com/blazersix/simple-image-widget/blob/master/js/simple-image-widget.js
206
+ */
207
+ var $control, $controlTarget, mediaControl;
208
+
209
+ mediaControl = {
210
+ // Initializes a new media manager or returns an existing frame.
211
+ // @see wp.media.featuredImage.frame()
212
+ frame: function() {
213
+ if ( this._frame )
214
+ return this._frame;
215
+
216
+ this._frame = wp.media({
217
+ title: $control.data('title'),
218
+ library: {
219
+ type: 'video'
220
+ },
221
+ button: {
222
+ text: $control.data('button')
223
+ },
224
+ multiple: false
225
+ });
226
+
227
+ this._frame.on( 'open', this.updateFrame ).state('library').on( 'select', this.select );
228
+
229
+ return this._frame;
230
+ },
231
+
232
+ select: function() {
233
+ var selection = this.get('selection'),
234
+ returnProperty = 'url';
235
+
236
+ $( $control.data('target') ).val( selection.pluck( returnProperty ) ).trigger('autosize').change().removeClass("defaultTextActive");
237
+ },
238
+
239
+ updateFrame: function() {
240
+ // Do something when the media frame is opened.
241
+ },
242
+
243
+ init: function() {
244
+ $('#wpbody').on('click', '.fvp_video_choose', function(e) {
245
+ e.preventDefault();
246
+
247
+ $control = $(this).closest('.fvp_input_wrapper');
248
+
249
+ mediaControl.frame().open();
250
+ });
251
+ }
252
+ };
253
+
254
+ if(fvp_backend_data.wp_35 == 1)
255
+ mediaControl.init();
256
  });
js/backend_pre35.js CHANGED
@@ -13,5 +13,41 @@ jQuery(document).ready(function($){
13
  if ( display == 'block' )
14
  $(this).fadeOut();
15
  });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
16
  });
 
 
 
 
 
 
 
 
17
  });
13
  if ( display == 'block' )
14
  $(this).fadeOut();
15
  });
16
+ $('#fvp-settings-dailymotion-foreground-colorpicker').each(function() {
17
+ var display = $(this).css('display');
18
+ if ( display == 'block' )
19
+ $(this).fadeOut();
20
+ });
21
+ $('#fvp-settings-dailymotion-background-colorpicker').each(function() {
22
+ var display = $(this).css('display');
23
+ if ( display == 'block' )
24
+ $(this).fadeOut();
25
+ });
26
+ $('#fvp-settings-dailymotion-highlight-colorpicker').each(function() {
27
+ var display = $(this).css('display');
28
+ if ( display == 'block' )
29
+ $(this).fadeOut();
30
+ });
31
+ });
32
+
33
+
34
+ $('#fvp-settings-dailymotion-foreground-colorpicker').hide();
35
+ $('#fvp-settings-dailymotion-foreground-colorpicker').farbtastic('#fvp-settings-dailymotion-foreground');
36
+ $('#fvp-settings-dailymotion-foreground').click(function() {
37
+ $('#fvp-settings-dailymotion-foreground-colorpicker').fadeIn();
38
+ });
39
+
40
+ $('#fvp-settings-dailymotion-background-colorpicker').hide();
41
+ $('#fvp-settings-dailymotion-background-colorpicker').farbtastic('#fvp-settings-dailymotion-background');
42
+ $('#fvp-settings-dailymotion-background').click(function() {
43
+ $('#fvp-settings-dailymotion-background-colorpicker').fadeIn();
44
  });
45
+
46
+
47
+ $('#fvp-settings-dailymotion-highlight-colorpicker').hide();
48
+ $('#fvp-settings-dailymotion-highlight-colorpicker').farbtastic('#fvp-settings-dailymotion-highlight');
49
+ $('#fvp-settings-dailymotion-highlight').click(function() {
50
+ $('#fvp-settings-dailymotion-highlight-colorpicker').fadeIn();
51
+ });
52
+
53
  });
js/backend_settings.js CHANGED
@@ -1,6 +1,6 @@
1
  jQuery(document).ready(function($){
2
 
3
- $('.fvp_toggle_input .fvp_toggle').bind('click', function () {
4
  var input = $(this).closest('.fvp_toggle_input').children('.fvp_input');
5
 
6
  if ($(this).attr('checked')) {
@@ -10,7 +10,26 @@ jQuery(document).ready(function($){
10
  }
11
  });
12
 
 
 
 
 
 
 
 
 
13
  $('#fvp_help_toggle').bind( 'click', function() {
14
  $('#contextual-help-link').trigger('click');
15
  });
 
 
 
 
 
 
 
 
 
 
 
16
  });
1
  jQuery(document).ready(function($){
2
 
3
+ $('.fvp_toggle_input .fvp_toggle').bind('click change', function() {
4
  var input = $(this).closest('.fvp_toggle_input').children('.fvp_input');
5
 
6
  if ($(this).attr('checked')) {
10
  }
11
  });
12
 
13
+ $('#fvp-settings-youtube-color').click(function() {
14
+ if ($('#fvp-settings-youtube-color:checked').length == 1) {
15
+ $('#youtube_logoinput_wrapper').fadeOut('slow', function() { $(this).addClass( 'fvp_hidden'); } );
16
+ } else {
17
+ $('#youtube_logoinput_wrapper').fadeIn( 'slow', function() { $(this).removeClass('fvp_hidden'); } );
18
+ }
19
+ });
20
+
21
  $('#fvp_help_toggle').bind( 'click', function() {
22
  $('#contextual-help-link').trigger('click');
23
  });
24
+
25
+ if( $('#fvp-settings-width-auto:checked').length == 1 )
26
+ $('#fvp-settings-align-1').closest('tr').hide();
27
+
28
+ $('#fvp-settings-width-auto').click(function() {
29
+ if( $('#fvp-settings-width-auto:checked').length == 1 ) {
30
+ $('#fvp-settings-align-1').closest('tr').fadeOut('slow');
31
+ } else {
32
+ $('#fvp-settings-align-1').closest('tr').fadeIn('slow');
33
+ }
34
+ });
35
  });
js/jquery.autosize-min.js CHANGED
@@ -1,4 +1,7 @@
1
- // Autosize 1.15.2 - jQuery plugin for textareas
2
- // (c) 2013 Jack Moore - jacklmoore.com
3
- // license: www.opensource.org/licenses/mit-license.php
4
- (function(a){var j,b={className:"autosizejs",append:"",callback:!1},c="hidden",d="border-box",e="lineHeight",f='<textarea tabindex="-1" style="position:absolute; top:-9999px; left:-9999px; right:auto; bottom:auto; border:0; -moz-box-sizing:content-box; -webkit-box-sizing:content-box; box-sizing:content-box; word-wrap:break-word; height:0 !important; min-height:0 !important; overflow:hidden;"/>',g=["fontFamily","fontSize","fontWeight","fontStyle","letterSpacing","textTransform","wordSpacing","textIndent"],h="oninput",i="onpropertychange",k=a(f).data("autosize",!0)[0];k.style.lineHeight="99px","99px"===a(k).css(e)&&g.push(e),k.style.lineHeight="",a.fn.autosize=function(e){return e=a.extend({},b,e||{}),k.parentNode!==document.body&&a(document.body).append(k),this.each(function(){function s(){j=b,k.className=e.className,a.each(g,function(a,b){k.style[b]=f.css(b)})}function t(){var a,d,g;j!==b&&s(),n||(n=!0,k.value=b.value+e.append,k.style.overflowY=b.style.overflowY,g=parseInt(b.style.height,10),k.style.width=f.width()+"px",k.scrollTop=0,k.scrollTop=9e4,a=k.scrollTop,a>m?(a=m,d="scroll"):l>a&&(a=l),a+=p,b.style.overflowY=d||c,g!==a&&(b.style.height=a+"px",r&&e.callback.call(b)),setTimeout(function(){n=!1},1))}var n,o,b=this,f=a(b),l=f.height(),m=parseInt(f.css("maxHeight"),10),p=0,q=b.value,r=a.isFunction(e.callback);f.data("autosize")||((f.css("box-sizing")===d||f.css("-moz-box-sizing")===d||f.css("-webkit-box-sizing")===d)&&(p=f.outerHeight()-f.height()),o="none"===f.css("resize")?"none":"horizontal",f.css({overflow:c,overflowY:c,wordWrap:"break-word",resize:o}).data("autosize",!0),m=m&&m>0?m:9e4,i in b?h in b?b[h]=b.onkeyup=t:b[i]=t:(b[h]=t,b.value="",b.value=q),a(window).resize(t),f.bind("autosize",t),t())})}})(window.jQuery||window.Zepto);
 
 
 
1
+ /*
2
+ jQuery Autosize v1.16.5
3
+ (c) 2013 Jack Moore - jacklmoore.com
4
+ updated: 2013-02-11
5
+ license: http://www.opensource.org/licenses/mit-license.php
6
+ */
7
+ (function(e){var t,o={className:"autosizejs",append:"",callback:!1},i="hidden",n="border-box",s="lineHeight",a='<textarea tabindex="-1" style="position:absolute; top:-999px; left:0; right:auto; bottom:auto; border:0; -moz-box-sizing:content-box; -webkit-box-sizing:content-box; box-sizing:content-box; word-wrap:break-word; height:0 !important; min-height:0 !important; overflow:hidden;"/>',r=["fontFamily","fontSize","fontWeight","fontStyle","letterSpacing","textTransform","wordSpacing","textIndent"],l="oninput",c="onpropertychange",h=e(a).data("autosize",!0)[0];h.style.lineHeight="99px","99px"===e(h).css(s)&&r.push(s),h.style.lineHeight="",e.fn.autosize=function(s){return s=e.extend({},o,s||{}),h.parentNode!==document.body&&e(document.body).append(h),this.each(function(){function o(){t=b,h.className=s.className,e.each(r,function(e,t){h.style[t]=f.css(t)})}function a(){var e,n,a;if(t!==b&&o(),!d){d=!0,h.value=b.value+s.append,h.style.overflowY=b.style.overflowY,a=parseInt(b.style.height,10),h.style.width=Math.max(f.width(),0)+"px",h.scrollTop=0,h.scrollTop=9e4,e=h.scrollTop;var r=parseInt(f.css("maxHeight"),10);r=r&&r>0?r:9e4,e>r?(e=r,n="scroll"):p>e&&(e=p),e+=g,b.style.overflowY=n||i,a!==e&&(b.style.height=e+"px",x&&s.callback.call(b)),setTimeout(function(){d=!1},1)}}var p,d,u,b=this,f=e(b),g=0,x=e.isFunction(s.callback);f.data("autosize")||((f.css("box-sizing")===n||f.css("-moz-box-sizing")===n||f.css("-webkit-box-sizing")===n)&&(g=f.outerHeight()-f.height()),p=Math.max(parseInt(f.css("minHeight"),10)-g,f.height()),u="none"===f.css("resize")||"vertical"===f.css("resize")?"none":"horizontal",f.css({overflow:i,overflowY:i,wordWrap:"break-word",resize:u}).data("autosize",!0),c in b?l in b?b[l]=b.onkeyup=a:b[c]=a:b[l]=a,e(window).resize(function(){d=!1,a()}),f.bind("autosize",function(){d=!1,a()}),a())})}})(window.jQuery||window.Zepto);
js/jquery.autosize.js CHANGED
@@ -1,12 +1,16 @@
1
- // Autosize 1.15.2 - jQuery plugin for textareas
2
- // (c) 2013 Jack Moore - jacklmoore.com
3
- // license: www.opensource.org/licenses/mit-license.php
 
 
 
 
4
 
5
  (function ($) {
6
  var
7
  defaults = {
8
  className: 'autosizejs',
9
- append: "",
10
  callback: false
11
  },
12
  hidden = 'hidden',
@@ -14,8 +18,8 @@
14
  lineHeight = 'lineHeight',
15
 
16
  // border:0 is unnecessary, but avoids a bug in FireFox on OSX (http://www.jacklmoore.com/autosize#comment-851)
17
- copy = '<textarea tabindex="-1" style="position:absolute; top:-9999px; left:-9999px; right:auto; bottom:auto; border:0; -moz-box-sizing:content-box; -webkit-box-sizing:content-box; box-sizing:content-box; word-wrap:break-word; height:0 !important; min-height:0 !important; overflow:hidden;"/>',
18
-
19
  // line-height is conditionally included because IE7/IE8/old Opera do not return the correct value.
20
  copyStyle = [
21
  'fontFamily',
@@ -29,7 +33,7 @@
29
  ],
30
  oninput = 'oninput',
31
  onpropertychange = 'onpropertychange',
32
-
33
  // to keep track which textarea is being mirrored when adjust() is called.
34
  mirrored,
35
 
@@ -54,12 +58,10 @@
54
  var
55
  ta = this,
56
  $ta = $(ta),
57
- minHeight = $ta.height(),
58
- maxHeight = parseInt($ta.css('maxHeight'), 10),
59
  active,
60
  resize,
61
  boxOffset = 0,
62
- value = ta.value,
63
  callback = $.isFunction(options.callback);
64
 
65
  if ($ta.data('autosize')) {
@@ -71,7 +73,9 @@
71
  boxOffset = $ta.outerHeight() - $ta.height();
72
  }
73
 
74
- resize = $ta.css('resize') === 'none' ? 'none' : 'horizontal';
 
 
75
 
76
  $ta.css({
77
  overflow: hidden,
@@ -80,9 +84,6 @@
80
  resize: resize
81
  }).data('autosize', true);
82
 
83
- // Opera returns '-1px' when max-height is set to 'none'.
84
- maxHeight = maxHeight && maxHeight > 0 ? maxHeight : 9e4;
85
-
86
  function initMirror() {
87
  mirrored = ta;
88
  mirror.className = options.className;
@@ -115,16 +116,17 @@
115
  original = parseInt(ta.style.height,10);
116
 
117
  // Update the width in case the original textarea width has changed
118
- mirror.style.width = $ta.width() + 'px';
 
119
 
120
- // Needed for IE7 to reliably return the correct scrollHeight
121
  mirror.scrollTop = 0;
122
- // Set a very high value for scrollTop to be sure the
123
- // mirror is scrolled all the way to the bottom.
124
  mirror.scrollTop = 9e4;
125
  height = mirror.scrollTop;
126
- // Note to self: replace the previous 3 lines with 'height = mirror.scrollHeight' when dropping IE7 support.
127
 
 
 
 
128
  if (height > maxHeight) {
129
  height = maxHeight;
130
  overflow = 'scroll';
@@ -140,7 +142,7 @@
140
  options.callback.call(ta);
141
  }
142
  }
143
-
144
  // This small timeout gives IE a chance to draw it's scrollbar
145
  // before adjust can be run again (prevents an infinite loop).
146
  setTimeout(function () {
@@ -162,20 +164,21 @@
162
  } else {
163
  // Modern Browsers
164
  ta[oninput] = adjust;
165
-
166
- // The textarea overflow is now hidden, but Chrome doesn't reflow the text to account for the
167
- // new space made available by removing the scrollbars. This workaround causes Chrome to reflow the text.
168
- ta.value = '';
169
- ta.value = value;
170
  }
171
 
172
- $(window).resize(adjust);
 
 
 
173
 
174
  // Allow for manual triggering if needed.
175
- $ta.bind('autosize', adjust);
 
 
 
176
 
177
  // Call adjust in case the textarea already contains text.
178
  adjust();
179
  });
180
  };
181
- }(window.jQuery || window.Zepto));
1
+ /*
2
+ jQuery Autosize v1.16.5
3
+ (c) 2013 Jack Moore - jacklmoore.com
4
+ updated: 2013-02-11
5
+ license: http://www.opensource.org/licenses/mit-license.php
6
+ */
7
+
8
 
9
  (function ($) {
10
  var
11
  defaults = {
12
  className: 'autosizejs',
13
+ append: '',
14
  callback: false
15
  },
16
  hidden = 'hidden',
18
  lineHeight = 'lineHeight',
19
 
20
  // border:0 is unnecessary, but avoids a bug in FireFox on OSX (http://www.jacklmoore.com/autosize#comment-851)
21
+ copy = '<textarea tabindex="-1" style="position:absolute; top:-999px; left:0; right:auto; bottom:auto; border:0; -moz-box-sizing:content-box; -webkit-box-sizing:content-box; box-sizing:content-box; word-wrap:break-word; height:0 !important; min-height:0 !important; overflow:hidden;"/>',
22
+
23
  // line-height is conditionally included because IE7/IE8/old Opera do not return the correct value.
24
  copyStyle = [
25
  'fontFamily',
33
  ],
34
  oninput = 'oninput',
35
  onpropertychange = 'onpropertychange',
36
+
37
  // to keep track which textarea is being mirrored when adjust() is called.
38
  mirrored,
39
 
58
  var
59
  ta = this,
60
  $ta = $(ta),
61
+ minHeight,
 
62
  active,
63
  resize,
64
  boxOffset = 0,
 
65
  callback = $.isFunction(options.callback);
66
 
67
  if ($ta.data('autosize')) {
73
  boxOffset = $ta.outerHeight() - $ta.height();
74
  }
75
 
76
+ minHeight = Math.max(parseInt($ta.css('minHeight'), 10) - boxOffset, $ta.height());
77
+
78
+ resize = ($ta.css('resize') === 'none' || $ta.css('resize') === 'vertical') ? 'none' : 'horizontal';
79
 
80
  $ta.css({
81
  overflow: hidden,
84
  resize: resize
85
  }).data('autosize', true);
86
 
 
 
 
87
  function initMirror() {
88
  mirrored = ta;
89
  mirror.className = options.className;
116
  original = parseInt(ta.style.height,10);
117
 
118
  // Update the width in case the original textarea width has changed
119
+ // A floor of 0 is needed because IE8 returns a negative value for hidden textareas, raising an error.
120
+ mirror.style.width = Math.max($ta.width(), 0) + 'px';
121
 
122
+ // The following three lines can be replaced with `height = mirror.scrollHeight` when dropping IE7 support.
123
  mirror.scrollTop = 0;
 
 
124
  mirror.scrollTop = 9e4;
125
  height = mirror.scrollTop;
 
126
 
127
+ var maxHeight = parseInt($ta.css('maxHeight'), 10);
128
+ // Opera returns '-1px' when max-height is set to 'none'.
129
+ maxHeight = maxHeight && maxHeight > 0 ? maxHeight : 9e4;
130
  if (height > maxHeight) {
131
  height = maxHeight;
132
  overflow = 'scroll';
142
  options.callback.call(ta);
143
  }
144
  }
145
+
146
  // This small timeout gives IE a chance to draw it's scrollbar
147
  // before adjust can be run again (prevents an infinite loop).
148
  setTimeout(function () {
164
  } else {
165
  // Modern Browsers
166
  ta[oninput] = adjust;
 
 
 
 
 
167
  }
168
 
169
+ $(window).resize(function(){
170
+ active = false;
171
+ adjust();
172
+ });
173
 
174
  // Allow for manual triggering if needed.
175
+ $ta.bind('autosize', function(){
176
+ active = false;
177
+ adjust();
178
+ });
179
 
180
  // Call adjust in case the textarea already contains text.
181
  adjust();
182
  });
183
  };
184
+ }(window.jQuery || window.Zepto));
js/jquery.fitvids_fvp-min.js CHANGED
@@ -7,4 +7,4 @@
7
  *
8
  * Date: Thu Sept 01 18:00:00 2011 -0500
9
  */
10
- (function(a){a.fn.fitVids=function(b){var c={customSelector:null};var e=document.createElement("div"),d=document.getElementsByTagName("base")[0]||document.getElementsByTagName("script")[0];e.className="fit-vids-style";e.innerHTML="&shy;<style> .fluid-width-video-wrapper { width: 100%; position: relative; padding: 0; } .fluid-width-video-wrapper iframe, .fluid-width-video-wrapper object, .fluid-width-video-wrapper embed { position: absolute; top: 0; left: 0; width: 100%; height: 100%; } </style>";d.parentNode.insertBefore(e,d);if(b){a.extend(c,b)}return this.each(function(){var f=["iframe[src*='player.vimeo.com']","iframe[src*='www.youtube.com']","iframe[src*='www.youtube-nocookie.com']","iframe[src*='www.kickstarter.com']","iframe[src*='www.liveleak.com']","iframe[src*='www.prochan.com']","object","embed"];if(c.customSelector){f.push(c.customSelector)}var g=a(this).find(f.join(","));g.each(function(){var l=a(this);if(this.tagName.toLowerCase()==="embed"&&l.parent("object").length||l.parent(".fluid-width-video-wrapper").length){return}var h=(this.tagName.toLowerCase()==="object"||(l.attr("height")&&!isNaN(parseInt(l.attr("height"),10))))?parseInt(l.attr("height"),10):l.height(),i=!isNaN(parseInt(l.attr("width"),10))?parseInt(l.attr("width"),10):l.width(),j=h/i;if(!l.attr("id")){var k="fitvid"+Math.floor(Math.random()*999999);l.attr("id",k)}l.wrap('<div class="fluid-width-video-wrapper"></div>').parent(".fluid-width-video-wrapper").css("padding-top",(j*100)+"%");l.removeAttr("height").removeAttr("width")})})}})(jQuery);jQuery(document).ready(function(a){a(".featured_video_plus").fitVids()});
7
  *
8
  * Date: Thu Sept 01 18:00:00 2011 -0500
9
  */
10
+ (function(a){a.fn.fitVids=function(b){var c={customSelector:null};var e=document.createElement("div"),d=document.getElementsByTagName("base")[0]||document.getElementsByTagName("script")[0];e.className="fit-vids-style";e.innerHTML="&shy;<style> .fluid-width-video-wrapper { width: 100%; position: relative; padding: 0; } .fluid-width-video-wrapper iframe, .fluid-width-video-wrapper object, .fluid-width-video-wrapper embed { position: absolute; top: 0; left: 0; width: 100%; height: 100%; } </style>";d.parentNode.insertBefore(e,d);if(b){a.extend(c,b)}return this.each(function(){var f=["iframe[src*='player.vimeo.com']","iframe[src*='www.youtube.com']","iframe[src*='www.youtube-nocookie.com']","iframe[src*='www.kickstarter.com']","iframe[src*='www.liveleak.com']","iframe[src*='www.prochan.com']","object","embed"];if(c.customSelector){f.push(c.customSelector)}var g=a(this).find(f.join(","));g.each(function(){var l=a(this);if(this.tagName.toLowerCase()==="embed"&&l.parent("object").length||l.parent(".fluid-width-video-wrapper").length){return}var h=(this.tagName.toLowerCase()==="object"||(l.attr("height")&&!isNaN(parseInt(l.attr("height"),10))))?parseInt(l.attr("height"),10):l.height(),i=!isNaN(parseInt(l.attr("width"),10))?parseInt(l.attr("width"),10):l.width(),j=h/i;if(!l.attr("id")){var k="fitvid"+Math.floor(Math.random()*999999);l.attr("id",k)}l.wrap('<div class="fluid-width-video-wrapper"></div>').parent(".fluid-width-video-wrapper").css("padding-top",(j*100)+"%");l.removeAttr("height").removeAttr("width")})})}})(jQuery);jQuery(document).ready(function(a){a(".featured_video_plus").fitVids()});
lng/featured-video-plus-de_DE.mo CHANGED
Binary file
lng/featured-video-plus-de_DE.po CHANGED
@@ -1,8 +1,8 @@
1
  msgid ""
2
  msgstr ""
3
  "Project-Id-Version: featured-video-plus 1.3 de_DE\n"
4
- "POT-Creation-Date: 2013-01-16 00:57+0100\n"
5
- "PO-Revision-Date: 2013-01-16 00:57+0100\n"
6
  "Last-Translator: Alexander Höreth <a.hoereth@gmail.com>\n"
7
  "Language-Team: a.hoereth <a.hoereth@gmail.com>\n"
8
  "Language: de_DE\n"
@@ -23,10 +23,10 @@ msgstr "Video URL"
23
  msgid "Fallback: same video, different format"
24
  msgstr "Fallback: gleiche Video, anderes Format"
25
 
26
- #: php/backend.php:89 php/backend.php:533 php/backend.php:540
27
- #: php/backend.php:557 php/backend.php:559
28
  msgid "Featured Video"
29
- msgstr "Artikelvideo"
30
 
31
  #: php/backend.php:120
32
  msgid "Outdated WordPress Version"
@@ -41,66 +41,86 @@ msgstr ""
41
  "Es gibt schon WordPress 3.5! Das Plugin unterstützt alle Versionen ab 3.1 - "
42
  "aber %s ist wirklich zu alt!"
43
 
44
- #: php/backend.php:136 php/backend.php:486
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
45
  msgid "Supported Video Formats"
46
  msgstr "Unterstützte Videoformate"
47
 
48
- #: php/backend.php:136
49
  msgid "or"
50
  msgstr "oder"
51
 
52
- #: php/backend.php:136 php/backend.php:485
53
  msgid "More information"
54
  msgstr "Mehr Informationen"
55
 
56
- #: php/backend.php:141
57
  msgid "Fallback Video"
58
  msgstr "Fallback Video"
59
 
60
- #: php/backend.php:141
61
  msgid ""
62
  "The two input fields should contain the same video but in distinct formats."
63
  msgstr ""
64
  "Die zwei Eingabefelder sollen das gleiche Video in unterschiedlichen "
65
  "Formaten enthalten."
66
 
67
- #: php/backend.php:148
68
  msgid "Hint"
69
  msgstr "Hinweis"
70
 
71
- #: php/backend.php:148
72
  #, php-format
73
  msgid "Take a look into the %sContextual Help%s."
74
  msgstr "Wirf einen Blick in die %sHilfe%s."
75
 
76
- #: php/backend.php:154
 
 
 
 
77
  msgid ""
78
  "For automatically displaying the Featured Video a Featured Image is required."
79
  msgstr ""
80
  "Um das Artikelvideo automatisch im Theme anzeigen zu können, muss ein "
81
  "Artikelbild festgelegt werden."
82
 
83
- #: php/backend.php:159
84
  msgid "Set as Featured Image"
85
- msgstr "Als Artikelbild festlegen"
86
 
87
- #: php/backend.php:163 php/settings.php:66
88
  msgid "The current theme does not support Featured Images"
89
- msgstr "Das aktuelle Theme nutzt keine Artikelbilder."
90
 
91
- #: php/backend.php:163
92
  #, php-format
93
  msgid ""
94
  "To display Featured Videos you need to use the <code>Shortcode</code> or "
95
  "<code>PHP functions</code>. To hide this notice deactivate &quot;<em>Replace "
96
  "Featured Images</em>&quot; in the %sMedia Settings%s."
97
  msgstr ""
98
- "Damit Artikelvideos in deinem Theme angezeigt werden, musst du den "
99
  "<code>Shortcode</code> oder die <code>PHP-Funktionen</code> verwenden. Um "
100
  "diese Warnung zu verstecken, deaktiviere &quot;<em>Artikelbilder ersetzen</"
101
  "em>&quot; in deinen %sMedien Einstellungen%s."
102
 
103
- #: php/backend.php:480
104
  #, php-format
105
  msgid ""
106
  "To use local videos, copy the <code>Link To Media File</code> from your "
@@ -109,7 +129,7 @@ msgstr ""
109
  "Um lokale Videos zu nutzen, kopiere den <code>Link zur Medien-Datei</code> "
110
  "aus deiner %sMediathek%s und füge ihn in das Textfeld ein."
111
 
112
- #: php/backend.php:481
113
  #, php-format
114
  msgid ""
115
  "To use local videos, copy the <code>File URL</code> from your %sMedia Library"
@@ -118,7 +138,7 @@ msgstr ""
118
  "Um lokale Videos zu nutzen, kopiere die <code>Datei-URL</code> aus deiner "
119
  "%sMediathek%s und füge sie in das Textfeld ein."
120
 
121
- #: php/backend.php:485
122
  msgid ""
123
  "The second text field is intended to hold the URL to the same video in a "
124
  "different format. It will be used as fallback if the primary file can not be "
@@ -128,11 +148,11 @@ msgstr ""
128
  "Videoformat gedacht. Dieses zweite Video wird dann als Fallback benutzt, "
129
  "falls das erste Video nicht kompatibel ist."
130
 
131
- #: php/backend.php:488
132
  msgid "Converting your videos"
133
  msgstr "Videos konvertieren"
134
 
135
- #: php/backend.php:489
136
  #, php-format
137
  msgid ""
138
  "Take a look at the %sMiro Video Converter%s. It is open source, lightweight "
@@ -141,11 +161,11 @@ msgstr ""
141
  "Schau dir den %sMiro Video Converter%s an. Er is Open Source, klein, einfach "
142
  "zu verwenden und mit Windows, Mac und Linux kompatibel."
143
 
144
- #: php/backend.php:490
145
  msgid "Fixing upload errors"
146
  msgstr "Videoupload Fehler beheben"
147
 
148
- #: php/backend.php:492
149
  #, php-format
150
  msgid ""
151
  "Read %sthis%s on how to increase the <strong>maximum file upload size</"
@@ -154,7 +174,7 @@ msgstr ""
154
  "Lies %sdas hier%s, um zu erfahren, wie man das <strong>Dateigrößenlimit</"
155
  "strong> erhöht."
156
 
157
- #: php/backend.php:493
158
  #, php-format
159
  msgid ""
160
  "WordPress by default does not support <code>webM</code>. The plugin "
@@ -165,11 +185,11 @@ msgstr ""
165
  "aktiviert die unterstützung, aber manchmal reicht das noch nicht. %sHier%s "
166
  "gibt es mehr Informationen."
167
 
168
- #: php/backend.php:495
169
  msgid "Flash Fallback"
170
  msgstr "Flash Fallback"
171
 
172
- #: php/backend.php:496
173
  #, php-format
174
  msgid ""
175
  "The video player, %sVIDEOJS%s, features an Adobe Flash fallback. All you "
@@ -178,7 +198,7 @@ msgstr ""
178
  "Der Video Player, %sVIDEOJS%s, bietet einen Adobe Flash Fallback. Du musst "
179
  "einfach nur ein <code>mp4</code>-Video einbinden."
180
 
181
- #: php/backend.php:500
182
  msgid ""
183
  "These are some of the tested URL formats. Everything in bold is required, "
184
  "everything in brackets is optional."
@@ -186,39 +206,51 @@ msgstr ""
186
  "Das hier sind einige getestete URL Formate. Alles fettgedruckte ist "
187
  "notwendig, alles in Klammern optional."
188
 
189
- #: php/backend.php:533 php/backend.php:557
190
  msgid "Local Media"
191
  msgstr "Lokale Medien"
192
 
193
- #: php/backend.php:540 php/backend.php:559
194
  msgid "Valid URLs"
195
  msgstr "Video URLs"
196
 
 
 
 
 
197
  #: php/settings.php:23
198
  msgid "Replace Featured Images"
199
- msgstr "Artikelbilder ersetzen"
200
 
201
  #: php/settings.php:24
 
 
 
 
202
  msgid "Video Sizing"
203
  msgstr "Videogröße"
204
 
205
  #: php/settings.php:26
 
 
 
 
206
  msgid "YouTube Player Options"
207
  msgstr "YouTube Player Optionen"
208
 
209
- #: php/settings.php:27
210
  msgid "Vimeo Player Options"
211
  msgstr "Vimeo Player Optionen"
212
 
213
- #: php/settings.php:28
214
  msgid "Dailymotion Player Options"
215
  msgstr "Dailymotion Player Optionen"
216
 
217
- #: php/settings.php:29
218
  msgid "Support"
219
  msgstr "Support"
220
 
221
- #: php/settings.php:43
222
  #, php-format
223
  msgid ""
224
  "To display your featured videos you can either make use of the automatic "
@@ -229,7 +261,7 @@ msgstr ""
229
  "der Artikelbilder nutzen, auf den %s zurückgreifen oder manuel die PHP-"
230
  "Funktionen in deine Theme Dateien integrieren."
231
 
232
- #: php/settings.php:44
233
  #, php-format
234
  msgid ""
235
  "For more information about Shortcode and PHP functions see the %sContextual "
@@ -238,20 +270,20 @@ msgstr ""
238
  "Für mehr Informationen über den Shortcode und die PHP-Funktionen schaue in "
239
  "die %sHilfe%s."
240
 
241
- #: php/settings.php:59
242
  msgid "yes"
243
  msgstr "ja"
244
 
245
- #: php/settings.php:59 php/settings.php:89 php/settings.php:99
246
- #: php/settings.php:130
247
  msgid "default"
248
  msgstr "default"
249
 
250
- #: php/settings.php:60
251
  msgid "no"
252
  msgstr "nein"
253
 
254
- #: php/settings.php:61
255
  msgid ""
256
  "If a Featured Video is available it can be displayed in place of the "
257
  "Featured Image. Still, a Featured Image is required."
@@ -259,7 +291,7 @@ msgstr ""
259
  "Wenn ein Artikelvideo vorhanden ist kann es anstelle des Artikelbildes "
260
  "angezeigt werden. Dafür muss trotzdem ein Artikelbild gesetzt sein!"
261
 
262
- #: php/settings.php:66
263
  msgid ""
264
  "To display Featured Videos you need to use the <code>Shortcode</code> or "
265
  "<code>PHP functions</code>."
@@ -267,15 +299,23 @@ msgstr ""
267
  "Um Artikelvideos anzuzeigen musst du den <code>Shortcode</code> oder die "
268
  "<code>PHP-Funktionen</code> nutzen."
269
 
270
- #: php/settings.php:86
 
 
 
 
 
 
 
 
271
  msgid "Width"
272
  msgstr "Breite"
273
 
274
- #: php/settings.php:96
275
  msgid "Height"
276
  msgstr "Höhe"
277
 
278
- #: php/settings.php:105
279
  msgid ""
280
  "When using <code>auto</code> the video will be adjusted to fit it's parent "
281
  "element while sticking to it's ratio. Using a <code>fixed</code> height and "
@@ -286,105 +326,118 @@ msgstr ""
286
  "beizubehalten. Feste Breite und/oder Höhe kann zu <em>nicht so schönen</em> "
287
  "schwarzen Balken führen."
288
 
289
- #: php/settings.php:108
290
- msgid "Align"
291
- msgstr "Ausrichtung"
292
-
293
- #: php/settings.php:110
294
  msgid "left"
295
  msgstr "links"
296
 
297
- #: php/settings.php:111
298
  msgid "center"
299
  msgstr "zentriert"
300
 
301
- #: php/settings.php:112
302
  msgid "right"
303
  msgstr "rechts"
304
 
305
- #: php/settings.php:135
306
  msgid "VIDEOJS Player Options"
307
  msgstr "VIDEOJS Player Optionen"
308
 
309
- #: php/settings.php:152
310
  msgid "Light Theme"
311
- msgstr "Helle Theme"
312
-
313
- #: php/settings.php:153
314
- msgid "White Progressbar"
315
- msgstr "Weißer Fortschrittsbalken"
316
 
317
- #: php/settings.php:154
318
- msgid "Show Info"
319
- msgstr "Info anzeigen"
320
 
321
- #: php/settings.php:155
322
  msgid "Fullscreen Button"
323
  msgstr "Vollbildschalter"
324
 
325
- #: php/settings.php:156
326
  msgid "Related Videos"
327
  msgstr "Verwandte Videos"
328
 
329
- #: php/settings.php:177
 
 
 
 
 
 
 
 
330
  msgid "Portrait"
331
  msgstr "Portrait"
332
 
333
- #: php/settings.php:178
334
  msgid "Title"
335
  msgstr "Titel"
336
 
337
- #: php/settings.php:179
338
  msgid "Byline"
339
  msgstr "Author"
340
 
341
- #: php/settings.php:182
342
  msgid "Color"
343
  msgstr "Farbe"
344
 
345
- #: php/settings.php:186
346
  msgid "Vimeo Plus Videos might ignore these settings."
347
  msgstr "Vimeo Plus Videos können diese Einstellungen ignorieren."
348
 
349
- #: php/settings.php:207
350
- msgid "Logo"
351
- msgstr "Logo"
352
-
353
- #: php/settings.php:208
354
  msgid "Videoinfo"
355
  msgstr "Videoinfo"
356
 
357
- #: php/settings.php:212
 
 
 
 
358
  msgid "Foreground"
359
  msgstr "Vordergrund"
360
 
361
- #: php/settings.php:217
362
  msgid "Highlight"
363
  msgstr "Hervorhebung"
364
 
365
- #: php/settings.php:222
366
  msgid "Background"
367
  msgstr "Hintergrund"
368
 
369
- #: php/settings.php:236
370
- msgid "Found a bug or <strong>missing a specific video service</strong>?"
 
 
 
 
371
  msgstr ""
372
- "Hast du einen Fehler gefunden oder <strong>fehlt dir eine bestimmte Video "
373
- "Plattform</strong>?"
 
374
 
375
- #: php/settings.php:238
376
- msgid "Do you like the plugin?"
377
- msgstr "Gefällt dir das Plugin?"
 
 
 
 
378
 
379
- #: php/settings.php:238
380
- msgid "rate it"
381
- msgstr "bewerte es"
 
 
 
 
382
 
383
- #: php/settings.php:305
384
  msgid "Displays the video in its default size."
385
  msgstr "Stellt das Video in seiner Standardgröße dar."
386
 
387
- #: php/settings.php:309
388
  msgid ""
389
  "Displays the video with an width of 300 pixel. Height will be fitted to the "
390
  "aspect ratio."
@@ -392,58 +445,80 @@ msgstr ""
392
  "Stellt das Video mit einer breite von 300 Pixeln dar. Die Höhe wird "
393
  "automatisch angepasst, so dass das Seitenverhältniss erhalten bleibt."
394
 
395
- #: php/settings.php:313
396
  msgid "Displays the video with an fixed width and height."
397
  msgstr "Stellt das Video mit fester Breite und Höhe dar."
398
 
399
- #: php/settings.php:324
400
  #, php-format
401
- msgid "All parameters are optional. If %s the current post's id will be used."
 
 
 
402
  msgstr ""
403
- "Alle Parameter sind optional. Wenn %s gilt, wird die ID vom aktuellen "
404
- "Eintrag verwendet."
 
 
405
 
406
- #: php/settings.php:325
407
  #, php-format
408
  msgid ""
409
- "The functions are implemented corresponding to the original %sFeatured Image "
410
- "functions%s: They are intended to be used and to act the same way."
 
411
  msgstr ""
412
- "Die Funktionen sind so implementiert, dass sie sich genauso verhalten wie "
413
- "die originalen %sArtikelbilder-Funktionen%s."
 
414
 
415
- #: php/settings.php:344 php/settings.php:367
416
  msgid "PHP-Functions"
417
  msgstr "PHP-Funktionen"
418
 
419
- #: php/upgrade.php:119 php/upgrade.php:130
420
  msgid "Featured Video Plus was <strong>upgraded</strong>."
421
  msgstr "Featured Video Plus wurde <strong>aktualisiert</strong>."
422
 
423
- #: php/upgrade.php:119
424
  #, php-format
425
  msgid ""
426
- "%s features more customization settings, internationalization, better error "
427
- "handling and experimental LiveLeak integration."
 
428
  msgstr ""
429
- "%s integriert mehr Einstellungsmöglichkeiten, Internationalisierung, "
430
- "bessere Fehlerbehandlung und experimentelle LiveLeak Integration."
 
431
 
432
- #: php/upgrade.php:119 php/upgrade.php:130
433
  #, php-format
434
  msgid "If you like the plugin, please %srate it%s."
435
  msgstr "Wenn dir das Plugin gefällt, bitte %sbewerte es%s."
436
 
437
- #: php/upgrade.php:130
 
 
 
 
 
 
 
 
 
 
 
438
  #, php-format
439
  msgid ""
440
- "%s now supports <strong>Local Videos</strong>, LiveLeak integration "
441
- "(experimental), many more customization settings and better error handling."
 
442
  msgstr ""
443
- "%s integriert unterstützung für <strong>lokale Videos</strong> und LiveLeak "
444
- "(experimentell), mehr Einstellungsmöglichkeiten und bessere Fehlerbehandlung."
 
445
 
446
- #: php/upgrade.php:142
447
  #, php-format
448
  msgid ""
449
  "Featured Video Plus is <strong>ready to use</strong>. There is a new box on "
@@ -454,6 +529,33 @@ msgstr ""
454
  "Einträge gibt es eine neue Box um Artikelvideos hinzuzufügen. Außerdem: "
455
  "<strong>Schau in deine %sMedien Einstellungen%s</strong>."
456
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
457
  #~ msgid ""
458
  #~ "Featured Video Plus was <strong>upgraded</strong>. Version <strong>%s</"
459
  #~ "strong> features more customization settings and a more dynamic admin "
1
  msgid ""
2
  msgstr ""
3
  "Project-Id-Version: featured-video-plus 1.3 de_DE\n"
4
+ "POT-Creation-Date: 2013-03-15 17:05+0100\n"
5
+ "PO-Revision-Date: 2013-03-15 17:13+0100\n"
6
  "Last-Translator: Alexander Höreth <a.hoereth@gmail.com>\n"
7
  "Language-Team: a.hoereth <a.hoereth@gmail.com>\n"
8
  "Language: de_DE\n"
23
  msgid "Fallback: same video, different format"
24
  msgstr "Fallback: gleiche Video, anderes Format"
25
 
26
+ #: php/backend.php:89 php/backend.php:611 php/backend.php:618
27
+ #: php/backend.php:635 php/backend.php:637
28
  msgid "Featured Video"
29
+ msgstr "Beitragsvideo"
30
 
31
  #: php/backend.php:120
32
  msgid "Outdated WordPress Version"
41
  "Es gibt schon WordPress 3.5! Das Plugin unterstützt alle Versionen ab 3.1 - "
42
  "aber %s ist wirklich zu alt!"
43
 
44
+ #: php/backend.php:129
45
+ msgid "Set Featured Video"
46
+ msgstr "Beitragsvideo festlegen"
47
+
48
+ #: php/backend.php:129
49
+ msgid "Set featured video"
50
+ msgstr "Beitragsvideo festlegen"
51
+
52
+ #: php/backend.php:136
53
+ msgid "Set Featured Video Fallback"
54
+ msgstr "Beitragsvideo-Ersatz festlegen"
55
+
56
+ #: php/backend.php:136
57
+ msgid "Set featured video fallback"
58
+ msgstr "Beitragsvideo Fallback festlegen"
59
+
60
+ #: php/backend.php:143 php/backend.php:564
61
  msgid "Supported Video Formats"
62
  msgstr "Unterstützte Videoformate"
63
 
64
+ #: php/backend.php:143
65
  msgid "or"
66
  msgstr "oder"
67
 
68
+ #: php/backend.php:143 php/backend.php:563
69
  msgid "More information"
70
  msgstr "Mehr Informationen"
71
 
72
+ #: php/backend.php:148
73
  msgid "Fallback Video"
74
  msgstr "Fallback Video"
75
 
76
+ #: php/backend.php:148
77
  msgid ""
78
  "The two input fields should contain the same video but in distinct formats."
79
  msgstr ""
80
  "Die zwei Eingabefelder sollen das gleiche Video in unterschiedlichen "
81
  "Formaten enthalten."
82
 
83
+ #: php/backend.php:155
84
  msgid "Hint"
85
  msgstr "Hinweis"
86
 
87
+ #: php/backend.php:155
88
  #, php-format
89
  msgid "Take a look into the %sContextual Help%s."
90
  msgstr "Wirf einen Blick in die %sHilfe%s."
91
 
92
+ #: php/backend.php:162 php/settings.php:392
93
+ msgid "Featured Image"
94
+ msgstr ""
95
+
96
+ #: php/backend.php:162
97
  msgid ""
98
  "For automatically displaying the Featured Video a Featured Image is required."
99
  msgstr ""
100
  "Um das Artikelvideo automatisch im Theme anzeigen zu können, muss ein "
101
  "Artikelbild festgelegt werden."
102
 
103
+ #: php/backend.php:167
104
  msgid "Set as Featured Image"
105
+ msgstr "Als Beitragsbild festlegen"
106
 
107
+ #: php/backend.php:171 php/settings.php:70
108
  msgid "The current theme does not support Featured Images"
109
+ msgstr "Das aktuelle Theme nutzt keine Beitragsbilder."
110
 
111
+ #: php/backend.php:171
112
  #, php-format
113
  msgid ""
114
  "To display Featured Videos you need to use the <code>Shortcode</code> or "
115
  "<code>PHP functions</code>. To hide this notice deactivate &quot;<em>Replace "
116
  "Featured Images</em>&quot; in the %sMedia Settings%s."
117
  msgstr ""
118
+ "Damit Beitragsvideos in deinem Theme angezeigt werden, musst du den "
119
  "<code>Shortcode</code> oder die <code>PHP-Funktionen</code> verwenden. Um "
120
  "diese Warnung zu verstecken, deaktiviere &quot;<em>Artikelbilder ersetzen</"
121
  "em>&quot; in deinen %sMedien Einstellungen%s."
122
 
123
+ #: php/backend.php:558
124
  #, php-format
125
  msgid ""
126
  "To use local videos, copy the <code>Link To Media File</code> from your "
129
  "Um lokale Videos zu nutzen, kopiere den <code>Link zur Medien-Datei</code> "
130
  "aus deiner %sMediathek%s und füge ihn in das Textfeld ein."
131
 
132
+ #: php/backend.php:559
133
  #, php-format
134
  msgid ""
135
  "To use local videos, copy the <code>File URL</code> from your %sMedia Library"
138
  "Um lokale Videos zu nutzen, kopiere die <code>Datei-URL</code> aus deiner "
139
  "%sMediathek%s und füge sie in das Textfeld ein."
140
 
141
+ #: php/backend.php:563
142
  msgid ""
143
  "The second text field is intended to hold the URL to the same video in a "
144
  "different format. It will be used as fallback if the primary file can not be "
148
  "Videoformat gedacht. Dieses zweite Video wird dann als Fallback benutzt, "
149
  "falls das erste Video nicht kompatibel ist."
150
 
151
+ #: php/backend.php:566
152
  msgid "Converting your videos"
153
  msgstr "Videos konvertieren"
154
 
155
+ #: php/backend.php:567
156
  #, php-format
157
  msgid ""
158
  "Take a look at the %sMiro Video Converter%s. It is open source, lightweight "
161
  "Schau dir den %sMiro Video Converter%s an. Er is Open Source, klein, einfach "
162
  "zu verwenden und mit Windows, Mac und Linux kompatibel."
163
 
164
+ #: php/backend.php:568
165
  msgid "Fixing upload errors"
166
  msgstr "Videoupload Fehler beheben"
167
 
168
+ #: php/backend.php:570
169
  #, php-format
170
  msgid ""
171
  "Read %sthis%s on how to increase the <strong>maximum file upload size</"
174
  "Lies %sdas hier%s, um zu erfahren, wie man das <strong>Dateigrößenlimit</"
175
  "strong> erhöht."
176
 
177
+ #: php/backend.php:571
178
  #, php-format
179
  msgid ""
180
  "WordPress by default does not support <code>webM</code>. The plugin "
185
  "aktiviert die unterstützung, aber manchmal reicht das noch nicht. %sHier%s "
186
  "gibt es mehr Informationen."
187
 
188
+ #: php/backend.php:573
189
  msgid "Flash Fallback"
190
  msgstr "Flash Fallback"
191
 
192
+ #: php/backend.php:574
193
  #, php-format
194
  msgid ""
195
  "The video player, %sVIDEOJS%s, features an Adobe Flash fallback. All you "
198
  "Der Video Player, %sVIDEOJS%s, bietet einen Adobe Flash Fallback. Du musst "
199
  "einfach nur ein <code>mp4</code>-Video einbinden."
200
 
201
+ #: php/backend.php:578
202
  msgid ""
203
  "These are some of the tested URL formats. Everything in bold is required, "
204
  "everything in brackets is optional."
206
  "Das hier sind einige getestete URL Formate. Alles fettgedruckte ist "
207
  "notwendig, alles in Klammern optional."
208
 
209
+ #: php/backend.php:611 php/backend.php:635
210
  msgid "Local Media"
211
  msgstr "Lokale Medien"
212
 
213
+ #: php/backend.php:618 php/backend.php:637
214
  msgid "Valid URLs"
215
  msgstr "Video URLs"
216
 
217
+ #: php/settings.php:21
218
+ msgid "Featured Videos"
219
+ msgstr "Beitragsvideos"
220
+
221
  #: php/settings.php:23
222
  msgid "Replace Featured Images"
223
+ msgstr "Beitragsbilder ersetzen"
224
 
225
  #: php/settings.php:24
226
+ msgid "Autoplay"
227
+ msgstr ""
228
+
229
+ #: php/settings.php:25
230
  msgid "Video Sizing"
231
  msgstr "Videogröße"
232
 
233
  #: php/settings.php:26
234
+ msgid "Video Align"
235
+ msgstr "Video-Ausrichtung"
236
+
237
+ #: php/settings.php:28
238
  msgid "YouTube Player Options"
239
  msgstr "YouTube Player Optionen"
240
 
241
+ #: php/settings.php:29
242
  msgid "Vimeo Player Options"
243
  msgstr "Vimeo Player Optionen"
244
 
245
+ #: php/settings.php:30
246
  msgid "Dailymotion Player Options"
247
  msgstr "Dailymotion Player Optionen"
248
 
249
+ #: php/settings.php:31
250
  msgid "Support"
251
  msgstr "Support"
252
 
253
+ #: php/settings.php:45
254
  #, php-format
255
  msgid ""
256
  "To display your featured videos you can either make use of the automatic "
261
  "der Artikelbilder nutzen, auf den %s zurückgreifen oder manuel die PHP-"
262
  "Funktionen in deine Theme Dateien integrieren."
263
 
264
+ #: php/settings.php:46
265
  #, php-format
266
  msgid ""
267
  "For more information about Shortcode and PHP functions see the %sContextual "
270
  "Für mehr Informationen über den Shortcode und die PHP-Funktionen schaue in "
271
  "die %sHilfe%s."
272
 
273
+ #: php/settings.php:62 php/settings.php:86
274
  msgid "yes"
275
  msgstr "ja"
276
 
277
+ #: php/settings.php:62 php/settings.php:88 php/settings.php:111
278
+ #: php/settings.php:121 php/settings.php:142 php/settings.php:160
279
  msgid "default"
280
  msgstr "default"
281
 
282
+ #: php/settings.php:64 php/settings.php:88
283
  msgid "no"
284
  msgstr "nein"
285
 
286
+ #: php/settings.php:65
287
  msgid ""
288
  "If a Featured Video is available it can be displayed in place of the "
289
  "Featured Image. Still, a Featured Image is required."
291
  "Wenn ein Artikelvideo vorhanden ist kann es anstelle des Artikelbildes "
292
  "angezeigt werden. Dafür muss trotzdem ein Artikelbild gesetzt sein!"
293
 
294
+ #: php/settings.php:70
295
  msgid ""
296
  "To display Featured Videos you need to use the <code>Shortcode</code> or "
297
  "<code>PHP functions</code>."
299
  "Um Artikelvideos anzuzeigen musst du den <code>Shortcode</code> oder die "
300
  "<code>PHP-Funktionen</code> nutzen."
301
 
302
+ #: php/settings.php:89
303
+ msgid ""
304
+ "YouTube, Vimeo and Dailymotion videos can autoplay when a single post/page "
305
+ "is being viewed."
306
+ msgstr ""
307
+ "Wenn gesetzt, starten YouTube, Vimeo und Dailymotion Videos automatisch wenn "
308
+ "sie auf der Seite eines einzelnen Beitrags angezeigt werden."
309
+
310
+ #: php/settings.php:108
311
  msgid "Width"
312
  msgstr "Breite"
313
 
314
+ #: php/settings.php:118
315
  msgid "Height"
316
  msgstr "Höhe"
317
 
318
+ #: php/settings.php:127
319
  msgid ""
320
  "When using <code>auto</code> the video will be adjusted to fit it's parent "
321
  "element while sticking to it's ratio. Using a <code>fixed</code> height and "
326
  "beizubehalten. Feste Breite und/oder Höhe kann zu <em>nicht so schönen</em> "
327
  "schwarzen Balken führen."
328
 
329
+ #: php/settings.php:141
 
 
 
 
330
  msgid "left"
331
  msgstr "links"
332
 
333
+ #: php/settings.php:142
334
  msgid "center"
335
  msgstr "zentriert"
336
 
337
+ #: php/settings.php:143
338
  msgid "right"
339
  msgstr "rechts"
340
 
341
+ #: php/settings.php:165
342
  msgid "VIDEOJS Player Options"
343
  msgstr "VIDEOJS Player Optionen"
344
 
345
+ #: php/settings.php:183
346
  msgid "Light Theme"
347
+ msgstr "Helles Design"
 
 
 
 
348
 
349
+ #: php/settings.php:184
350
+ msgid "Info"
351
+ msgstr "Info"
352
 
353
+ #: php/settings.php:185
354
  msgid "Fullscreen Button"
355
  msgstr "Vollbildschalter"
356
 
357
+ #: php/settings.php:186
358
  msgid "Related Videos"
359
  msgstr "Verwandte Videos"
360
 
361
+ #: php/settings.php:187
362
+ msgid "White Progressbar"
363
+ msgstr "Weißer Fortschrittsbalken"
364
+
365
+ #: php/settings.php:189 php/settings.php:241
366
+ msgid "Logo"
367
+ msgstr "Logo"
368
+
369
+ #: php/settings.php:210
370
  msgid "Portrait"
371
  msgstr "Portrait"
372
 
373
+ #: php/settings.php:211
374
  msgid "Title"
375
  msgstr "Titel"
376
 
377
+ #: php/settings.php:212
378
  msgid "Byline"
379
  msgstr "Author"
380
 
381
+ #: php/settings.php:215
382
  msgid "Color"
383
  msgstr "Farbe"
384
 
385
+ #: php/settings.php:219
386
  msgid "Vimeo Plus Videos might ignore these settings."
387
  msgstr "Vimeo Plus Videos können diese Einstellungen ignorieren."
388
 
389
+ #: php/settings.php:242
 
 
 
 
390
  msgid "Videoinfo"
391
  msgstr "Videoinfo"
392
 
393
+ #: php/settings.php:243
394
+ msgid "Syndication Key"
395
+ msgstr "Syndication Schlüssel"
396
+
397
+ #: php/settings.php:247
398
  msgid "Foreground"
399
  msgstr "Vordergrund"
400
 
401
+ #: php/settings.php:252
402
  msgid "Highlight"
403
  msgstr "Hervorhebung"
404
 
405
+ #: php/settings.php:257
406
  msgid "Background"
407
  msgstr "Hintergrund"
408
 
409
+ #: php/settings.php:274
410
+ #, php-format
411
+ msgid ""
412
+ "If you have found a bug or are missing a specific video service, please "
413
+ "%slet me know%s in the support forum. Elsewise, if you like the plugin: "
414
+ "Please %srate it!%s"
415
  msgstr ""
416
+ "Wenn du einen Fehler gefunden hast oder einen bestimmten Video-Anbieter "
417
+ "vermisst, %ssag bescheid%s; Ansonsten, wenn dir das Plugin gefällt, bitte "
418
+ "%sbewerte es!%s"
419
 
420
+ #: php/settings.php:280
421
+ msgid ""
422
+ "The plugin logs it's version, the WordPress version and WordPress language "
423
+ "for internal statistics. Those help for future plugin development."
424
+ msgstr ""
425
+ "Das Plugin speichert seine Version, die WordPress Version und WordPress "
426
+ "Spracheinstellung für eigene Statistiken."
427
 
428
+ #: php/settings.php:282
429
+ msgid ""
430
+ "No personal user information is being collected. Still, you can easily Opt-"
431
+ "Out and have the data deleted:"
432
+ msgstr ""
433
+ "Es werden keine persönlichen Nutzerinformationen gespeichert. Wenn du willst "
434
+ "kannst du dich abmelden und deine Daten werden gelöscht:"
435
 
436
+ #: php/settings.php:368
437
  msgid "Displays the video in its default size."
438
  msgstr "Stellt das Video in seiner Standardgröße dar."
439
 
440
+ #: php/settings.php:372
441
  msgid ""
442
  "Displays the video with an width of 300 pixel. Height will be fitted to the "
443
  "aspect ratio."
445
  "Stellt das Video mit einer breite von 300 Pixeln dar. Die Höhe wird "
446
  "automatisch angepasst, so dass das Seitenverhältniss erhalten bleibt."
447
 
448
+ #: php/settings.php:376
449
  msgid "Displays the video with an fixed width and height."
450
  msgstr "Stellt das Video mit fester Breite und Höhe dar."
451
 
452
+ #: php/settings.php:389
453
  #, php-format
454
+ msgid ""
455
+ "All parameters are optional. If %s the current post's id will be used. %s is "
456
+ "either a string keyword (thumbnail, medium, large or full) or a 2-item array "
457
+ "representing width and height in pixels, e.g. array(32,32)."
458
  msgstr ""
459
+ "Alle Parameter sind optional. Wenn %s gilt, wird die ID des aktuellen "
460
+ "Beitrags genutzt. %s ist entweder ein String (thumbnail, medium, large oder "
461
+ "full) oder ein Array mit zwei Stellen (Breite und Höhe); Zum Beispiel array"
462
+ "(32,32)."
463
 
464
+ #: php/settings.php:392
465
  #, php-format
466
  msgid ""
467
+ "The functions are implemented corresponding to the original %sfunctions%s: "
468
+ "They are intended to be used and to act the same way. Take a look into the "
469
+ "WordPress Codex for further guidance:"
470
  msgstr ""
471
+ "Die Funktionen sind nach den original %sFunktionen%s implementiert. Sie "
472
+ "sollten genauso genutzt werden können und sich genauso verhalten. Schau dir "
473
+ "für mehr Informationen den WordPress Codex an:"
474
 
475
+ #: php/settings.php:415 php/settings.php:438
476
  msgid "PHP-Functions"
477
  msgstr "PHP-Funktionen"
478
 
479
+ #: php/upgrade.php:132 php/upgrade.php:143 php/upgrade.php:154
480
  msgid "Featured Video Plus was <strong>upgraded</strong>."
481
  msgstr "Featured Video Plus wurde <strong>aktualisiert</strong>."
482
 
483
+ #: php/upgrade.php:132
484
  #, php-format
485
  msgid ""
486
+ "%s features a seamless <strong>WP3.5 Media Manager</strong> integration, "
487
+ "time-links (#t=4m2s) for YouTube and Dailymotion, some new options and new "
488
+ "PHP functions for developers."
489
  msgstr ""
490
+ "%s integriert den <strong>WP3.5 Media Manager</strong> nahtlos, bietet time-"
491
+ "links für YouTube und Dailymotion(#t=4m2s), einige neue Einstellungen und "
492
+ "neue PHP Funktionen für Entwickler."
493
 
494
+ #: php/upgrade.php:132 php/upgrade.php:143 php/upgrade.php:154
495
  #, php-format
496
  msgid "If you like the plugin, please %srate it%s."
497
  msgstr "Wenn dir das Plugin gefällt, bitte %sbewerte es%s."
498
 
499
+ #: php/upgrade.php:143
500
+ #, php-format
501
+ msgid ""
502
+ "%s features a seamless WP3.5 Media Manager integration, time-links (#t=4m2s) "
503
+ "for YouTube and Dailymotion, more customization settings and "
504
+ "internationalization."
505
+ msgstr ""
506
+ "%s integriert den <strong>WP3.5 Media Manager</strong> nahtlos, bietet time-"
507
+ "links für YouTube und Dailymotion(#t=4m2s), mehr Einstellungen und "
508
+ "Internationalisierung."
509
+
510
+ #: php/upgrade.php:154
511
  #, php-format
512
  msgid ""
513
+ "%s features support for <strong>Local Videos</strong>, a seamless WP3.5 "
514
+ "Media Manager integration, time-links (#t=4m2s) for YouTube and Dailymotion "
515
+ "and many more customization settings."
516
  msgstr ""
517
+ "%s integriert unterstützung für <strong>lokale Videos</strong>, den neuen "
518
+ "WP3.5 Media Manager, time-links (#t=4m2s) für YouTube und Dailymotion und "
519
+ "viele neue Einstellungsmöglichkeiten."
520
 
521
+ #: php/upgrade.php:166
522
  #, php-format
523
  msgid ""
524
  "Featured Video Plus is <strong>ready to use</strong>. There is a new box on "
529
  "Einträge gibt es eine neue Box um Artikelvideos hinzuzufügen. Außerdem: "
530
  "<strong>Schau in deine %sMedien Einstellungen%s</strong>."
531
 
532
+ #~ msgid ""
533
+ #~ "%s features more customization settings, internationalization, better "
534
+ #~ "error handling and experimental LiveLeak integration."
535
+ #~ msgstr ""
536
+ #~ "%s integriert mehr Einstellungsmöglichkeiten, Internationalisierung, "
537
+ #~ "bessere Fehlerbehandlung und experimentelle LiveLeak Integration."
538
+
539
+ #~ msgid "Align"
540
+ #~ msgstr "Ausrichtung"
541
+
542
+ #~ msgid "Found a bug or <strong>missing a specific video service</strong>?"
543
+ #~ msgstr ""
544
+ #~ "Hast du einen Fehler gefunden oder <strong>fehlt dir eine bestimmte Video "
545
+ #~ "Plattform</strong>?"
546
+
547
+ #~ msgid "Do you like the plugin?"
548
+ #~ msgstr "Gefällt dir das Plugin?"
549
+
550
+ #~ msgid "rate it"
551
+ #~ msgstr "bewerte es"
552
+
553
+ #~ msgid ""
554
+ #~ "All parameters are optional. If %s the current post's id will be used."
555
+ #~ msgstr ""
556
+ #~ "Alle Parameter sind optional. Wenn %s gilt, wird die ID vom aktuellen "
557
+ #~ "Eintrag verwendet."
558
+
559
  #~ msgid ""
560
  #~ "Featured Video Plus was <strong>upgraded</strong>. Version <strong>%s</"
561
  #~ "strong> features more customization settings and a more dynamic admin "
lng/featured-video-plus.pot CHANGED
@@ -1,8 +1,8 @@
1
  msgid ""
2
  msgstr ""
3
  "Project-Id-Version: featured-video-plus 1.3\n"
4
- "POT-Creation-Date: 2013-01-16 00:57+0100\n"
5
- "PO-Revision-Date: 2013-01-16 00:57+0100\n"
6
  "Last-Translator: Alexander Höreth <a.hoereth@gmail.com>\n"
7
  "Language-Team: a.hoereth <a.hoereth@gmail.com>\n"
8
  "Language: en\n"
@@ -23,8 +23,8 @@ msgstr ""
23
  msgid "Fallback: same video, different format"
24
  msgstr ""
25
 
26
- #: php/backend.php:89 php/backend.php:533 php/backend.php:540
27
- #: php/backend.php:557 php/backend.php:559
28
  msgid "Featured Video"
29
  msgstr ""
30
 
@@ -39,50 +39,70 @@ msgid ""
39
  "back to 3.1 - but %s is defenitly to old!"
40
  msgstr ""
41
 
42
- #: php/backend.php:136 php/backend.php:486
43
- msgid "Supported Video Formats"
 
 
 
 
 
 
 
 
44
  msgstr ""
45
 
46
  #: php/backend.php:136
 
 
 
 
 
 
 
 
47
  msgid "or"
48
  msgstr ""
49
 
50
- #: php/backend.php:136 php/backend.php:485
51
  msgid "More information"
52
  msgstr ""
53
 
54
- #: php/backend.php:141
55
  msgid "Fallback Video"
56
  msgstr ""
57
 
58
- #: php/backend.php:141
59
  msgid ""
60
  "The two input fields should contain the same video but in distinct formats."
61
  msgstr ""
62
 
63
- #: php/backend.php:148
64
  msgid "Hint"
65
  msgstr ""
66
 
67
- #: php/backend.php:148
68
  #, php-format
69
  msgid "Take a look into the %sContextual Help%s."
70
  msgstr ""
71
 
72
- #: php/backend.php:154
 
 
 
 
73
  msgid ""
74
  "For automatically displaying the Featured Video a Featured Image is required."
75
  msgstr ""
76
 
77
- #: php/backend.php:159
78
  msgid "Set as Featured Image"
79
  msgstr ""
80
 
81
- #: php/backend.php:163 php/settings.php:66
82
  msgid "The current theme does not support Featured Images"
83
  msgstr ""
84
 
85
- #: php/backend.php:163
86
  #, php-format
87
  msgid ""
88
  "To display Featured Videos you need to use the <code>Shortcode</code> or "
@@ -90,50 +110,50 @@ msgid ""
90
  "Featured Images</em>&quot; in the %sMedia Settings%s."
91
  msgstr ""
92
 
93
- #: php/backend.php:480
94
  #, php-format
95
  msgid ""
96
  "To use local videos, copy the <code>Link To Media File</code> from your "
97
  "%sMedia Library%s and paste it into the text field."
98
  msgstr ""
99
 
100
- #: php/backend.php:481
101
  #, php-format
102
  msgid ""
103
  "To use local videos, copy the <code>File URL</code> from your %sMedia Library"
104
  "%s and paste it into the text field."
105
  msgstr ""
106
 
107
- #: php/backend.php:485
108
  msgid ""
109
  "The second text field is intended to hold the URL to the same video in a "
110
  "different format. It will be used as fallback if the primary file can not be "
111
  "played."
112
  msgstr ""
113
 
114
- #: php/backend.php:488
115
  msgid "Converting your videos"
116
  msgstr ""
117
 
118
- #: php/backend.php:489
119
  #, php-format
120
  msgid ""
121
  "Take a look at the %sMiro Video Converter%s. It is open source, lightweight "
122
  "and compatible with Windows, Mac and Linux."
123
  msgstr ""
124
 
125
- #: php/backend.php:490
126
  msgid "Fixing upload errors"
127
  msgstr ""
128
 
129
- #: php/backend.php:492
130
  #, php-format
131
  msgid ""
132
  "Read %sthis%s on how to increase the <strong>maximum file upload size</"
133
  "strong>."
134
  msgstr ""
135
 
136
- #: php/backend.php:493
137
  #, php-format
138
  msgid ""
139
  "WordPress by default does not support <code>webM</code>. The plugin "
@@ -141,56 +161,68 @@ msgid ""
141
  "you can get more information on this."
142
  msgstr ""
143
 
144
- #: php/backend.php:495
145
  msgid "Flash Fallback"
146
  msgstr ""
147
 
148
- #: php/backend.php:496
149
  #, php-format
150
  msgid ""
151
  "The video player, %sVIDEOJS%s, features an Adobe Flash fallback. All you "
152
  "need to do is provide an <code>mp4</code>-video."
153
  msgstr ""
154
 
155
- #: php/backend.php:500
156
  msgid ""
157
  "These are some of the tested URL formats. Everything in bold is required, "
158
  "everything in brackets is optional."
159
  msgstr ""
160
 
161
- #: php/backend.php:533 php/backend.php:557
162
  msgid "Local Media"
163
  msgstr ""
164
 
165
- #: php/backend.php:540 php/backend.php:559
166
  msgid "Valid URLs"
167
  msgstr ""
168
 
 
 
 
 
169
  #: php/settings.php:23
170
  msgid "Replace Featured Images"
171
  msgstr ""
172
 
173
  #: php/settings.php:24
 
 
 
 
174
  msgid "Video Sizing"
175
  msgstr ""
176
 
177
  #: php/settings.php:26
 
 
 
 
178
  msgid "YouTube Player Options"
179
  msgstr ""
180
 
181
- #: php/settings.php:27
182
  msgid "Vimeo Player Options"
183
  msgstr ""
184
 
185
- #: php/settings.php:28
186
  msgid "Dailymotion Player Options"
187
  msgstr ""
188
 
189
- #: php/settings.php:29
190
  msgid "Support"
191
  msgstr ""
192
 
193
- #: php/settings.php:43
194
  #, php-format
195
  msgid ""
196
  "To display your featured videos you can either make use of the automatic "
@@ -198,199 +230,227 @@ msgid ""
198
  "use of the plugins PHP-functions."
199
  msgstr ""
200
 
201
- #: php/settings.php:44
202
  #, php-format
203
  msgid ""
204
  "For more information about Shortcode and PHP functions see the %sContextual "
205
  "Help%s."
206
  msgstr ""
207
 
208
- #: php/settings.php:59
209
  msgid "yes"
210
  msgstr ""
211
 
212
- #: php/settings.php:59 php/settings.php:89 php/settings.php:99
213
- #: php/settings.php:130
214
  msgid "default"
215
  msgstr ""
216
 
217
- #: php/settings.php:60
218
  msgid "no"
219
  msgstr ""
220
 
221
- #: php/settings.php:61
222
  msgid ""
223
  "If a Featured Video is available it can be displayed in place of the "
224
  "Featured Image. Still, a Featured Image is required."
225
  msgstr ""
226
 
227
- #: php/settings.php:66
228
  msgid ""
229
  "To display Featured Videos you need to use the <code>Shortcode</code> or "
230
  "<code>PHP functions</code>."
231
  msgstr ""
232
 
233
- #: php/settings.php:86
 
 
 
 
 
 
234
  msgid "Width"
235
  msgstr ""
236
 
237
- #: php/settings.php:96
238
  msgid "Height"
239
  msgstr ""
240
 
241
- #: php/settings.php:105
242
  msgid ""
243
  "When using <code>auto</code> the video will be adjusted to fit it's parent "
244
  "element while sticking to it's ratio. Using a <code>fixed</code> height and "
245
  "width might result in <em>not so pretty</em> black bars."
246
  msgstr ""
247
 
248
- #: php/settings.php:108
249
- msgid "Align"
250
- msgstr ""
251
-
252
- #: php/settings.php:110
253
  msgid "left"
254
  msgstr ""
255
 
256
- #: php/settings.php:111
257
  msgid "center"
258
  msgstr ""
259
 
260
- #: php/settings.php:112
261
  msgid "right"
262
  msgstr ""
263
 
264
- #: php/settings.php:135
265
  msgid "VIDEOJS Player Options"
266
  msgstr ""
267
 
268
- #: php/settings.php:152
269
  msgid "Light Theme"
270
  msgstr ""
271
 
272
- #: php/settings.php:153
273
- msgid "White Progressbar"
274
- msgstr ""
275
-
276
- #: php/settings.php:154
277
- msgid "Show Info"
278
  msgstr ""
279
 
280
- #: php/settings.php:155
281
  msgid "Fullscreen Button"
282
  msgstr ""
283
 
284
- #: php/settings.php:156
285
  msgid "Related Videos"
286
  msgstr ""
287
 
288
- #: php/settings.php:177
 
 
 
 
 
 
 
 
289
  msgid "Portrait"
290
  msgstr ""
291
 
292
- #: php/settings.php:178
293
  msgid "Title"
294
  msgstr ""
295
 
296
- #: php/settings.php:179
297
  msgid "Byline"
298
  msgstr ""
299
 
300
- #: php/settings.php:182
301
  msgid "Color"
302
  msgstr ""
303
 
304
- #: php/settings.php:186
305
  msgid "Vimeo Plus Videos might ignore these settings."
306
  msgstr ""
307
 
308
- #: php/settings.php:207
309
- msgid "Logo"
310
  msgstr ""
311
 
312
- #: php/settings.php:208
313
- msgid "Videoinfo"
314
  msgstr ""
315
 
316
- #: php/settings.php:212
317
  msgid "Foreground"
318
  msgstr ""
319
 
320
- #: php/settings.php:217
321
  msgid "Highlight"
322
  msgstr ""
323
 
324
- #: php/settings.php:222
325
  msgid "Background"
326
  msgstr ""
327
 
328
- #: php/settings.php:236
329
- msgid "Found a bug or <strong>missing a specific video service</strong>?"
 
 
 
 
330
  msgstr ""
331
 
332
- #: php/settings.php:238
333
- msgid "Do you like the plugin?"
 
 
334
  msgstr ""
335
 
336
- #: php/settings.php:238
337
- msgid "rate it"
 
 
338
  msgstr ""
339
 
340
- #: php/settings.php:305
341
  msgid "Displays the video in its default size."
342
  msgstr ""
343
 
344
- #: php/settings.php:309
345
  msgid ""
346
  "Displays the video with an width of 300 pixel. Height will be fitted to the "
347
  "aspect ratio."
348
  msgstr ""
349
 
350
- #: php/settings.php:313
351
  msgid "Displays the video with an fixed width and height."
352
  msgstr ""
353
 
354
- #: php/settings.php:324
355
  #, php-format
356
- msgid "All parameters are optional. If %s the current post's id will be used."
 
 
 
357
  msgstr ""
358
 
359
- #: php/settings.php:325
360
  #, php-format
361
  msgid ""
362
- "The functions are implemented corresponding to the original %sFeatured Image "
363
- "functions%s: They are intended to be used and to act the same way."
 
364
  msgstr ""
365
 
366
- #: php/settings.php:344 php/settings.php:367
367
  msgid "PHP-Functions"
368
  msgstr ""
369
 
370
- #: php/upgrade.php:119 php/upgrade.php:130
371
  msgid "Featured Video Plus was <strong>upgraded</strong>."
372
  msgstr ""
373
 
374
- #: php/upgrade.php:119
375
  #, php-format
376
  msgid ""
377
- "%s features more customization settings, internationalization, better error "
378
- "handling and experimental LiveLeak integration."
 
379
  msgstr ""
380
 
381
- #: php/upgrade.php:119 php/upgrade.php:130
382
  #, php-format
383
  msgid "If you like the plugin, please %srate it%s."
384
  msgstr ""
385
 
386
- #: php/upgrade.php:130
 
 
 
 
 
 
 
 
387
  #, php-format
388
  msgid ""
389
- "%s now supports <strong>Local Videos</strong>, LiveLeak integration "
390
- "(experimental), many more customization settings and better error handling."
 
391
  msgstr ""
392
 
393
- #: php/upgrade.php:142
394
  #, php-format
395
  msgid ""
396
  "Featured Video Plus is <strong>ready to use</strong>. There is a new box on "
1
  msgid ""
2
  msgstr ""
3
  "Project-Id-Version: featured-video-plus 1.3\n"
4
+ "POT-Creation-Date: 2013-03-15 17:05+0100\n"
5
+ "PO-Revision-Date: 2013-03-15 17:05+0100\n"
6
  "Last-Translator: Alexander Höreth <a.hoereth@gmail.com>\n"
7
  "Language-Team: a.hoereth <a.hoereth@gmail.com>\n"
8
  "Language: en\n"
23
  msgid "Fallback: same video, different format"
24
  msgstr ""
25
 
26
+ #: php/backend.php:89 php/backend.php:611 php/backend.php:618
27
+ #: php/backend.php:635 php/backend.php:637
28
  msgid "Featured Video"
29
  msgstr ""
30
 
39
  "back to 3.1 - but %s is defenitly to old!"
40
  msgstr ""
41
 
42
+ #: php/backend.php:129
43
+ msgid "Set Featured Video"
44
+ msgstr ""
45
+
46
+ #: php/backend.php:129
47
+ msgid "Set featured video"
48
+ msgstr ""
49
+
50
+ #: php/backend.php:136
51
+ msgid "Set Featured Video Fallback"
52
  msgstr ""
53
 
54
  #: php/backend.php:136
55
+ msgid "Set featured video fallback"
56
+ msgstr ""
57
+
58
+ #: php/backend.php:143 php/backend.php:564
59
+ msgid "Supported Video Formats"
60
+ msgstr ""
61
+
62
+ #: php/backend.php:143
63
  msgid "or"
64
  msgstr ""
65
 
66
+ #: php/backend.php:143 php/backend.php:563
67
  msgid "More information"
68
  msgstr ""
69
 
70
+ #: php/backend.php:148
71
  msgid "Fallback Video"
72
  msgstr ""
73
 
74
+ #: php/backend.php:148
75
  msgid ""
76
  "The two input fields should contain the same video but in distinct formats."
77
  msgstr ""
78
 
79
+ #: php/backend.php:155
80
  msgid "Hint"
81
  msgstr ""
82
 
83
+ #: php/backend.php:155
84
  #, php-format
85
  msgid "Take a look into the %sContextual Help%s."
86
  msgstr ""
87
 
88
+ #: php/backend.php:162 php/settings.php:392
89
+ msgid "Featured Image"
90
+ msgstr ""
91
+
92
+ #: php/backend.php:162
93
  msgid ""
94
  "For automatically displaying the Featured Video a Featured Image is required."
95
  msgstr ""
96
 
97
+ #: php/backend.php:167
98
  msgid "Set as Featured Image"
99
  msgstr ""
100
 
101
+ #: php/backend.php:171 php/settings.php:70
102
  msgid "The current theme does not support Featured Images"
103
  msgstr ""
104
 
105
+ #: php/backend.php:171
106
  #, php-format
107
  msgid ""
108
  "To display Featured Videos you need to use the <code>Shortcode</code> or "
110
  "Featured Images</em>&quot; in the %sMedia Settings%s."
111
  msgstr ""
112
 
113
+ #: php/backend.php:558
114
  #, php-format
115
  msgid ""
116
  "To use local videos, copy the <code>Link To Media File</code> from your "
117
  "%sMedia Library%s and paste it into the text field."
118
  msgstr ""
119
 
120
+ #: php/backend.php:559
121
  #, php-format
122
  msgid ""
123
  "To use local videos, copy the <code>File URL</code> from your %sMedia Library"
124
  "%s and paste it into the text field."
125
  msgstr ""
126
 
127
+ #: php/backend.php:563
128
  msgid ""
129
  "The second text field is intended to hold the URL to the same video in a "
130
  "different format. It will be used as fallback if the primary file can not be "
131
  "played."
132
  msgstr ""
133
 
134
+ #: php/backend.php:566
135
  msgid "Converting your videos"
136
  msgstr ""
137
 
138
+ #: php/backend.php:567
139
  #, php-format
140
  msgid ""
141
  "Take a look at the %sMiro Video Converter%s. It is open source, lightweight "
142
  "and compatible with Windows, Mac and Linux."
143
  msgstr ""
144
 
145
+ #: php/backend.php:568
146
  msgid "Fixing upload errors"
147
  msgstr ""
148
 
149
+ #: php/backend.php:570
150
  #, php-format
151
  msgid ""
152
  "Read %sthis%s on how to increase the <strong>maximum file upload size</"
153
  "strong>."
154
  msgstr ""
155
 
156
+ #: php/backend.php:571
157
  #, php-format
158
  msgid ""
159
  "WordPress by default does not support <code>webM</code>. The plugin "
161
  "you can get more information on this."
162
  msgstr ""
163
 
164
+ #: php/backend.php:573
165
  msgid "Flash Fallback"
166
  msgstr ""
167
 
168
+ #: php/backend.php:574
169
  #, php-format
170
  msgid ""
171
  "The video player, %sVIDEOJS%s, features an Adobe Flash fallback. All you "
172
  "need to do is provide an <code>mp4</code>-video."
173
  msgstr ""
174
 
175
+ #: php/backend.php:578
176
  msgid ""
177
  "These are some of the tested URL formats. Everything in bold is required, "
178
  "everything in brackets is optional."
179
  msgstr ""
180
 
181
+ #: php/backend.php:611 php/backend.php:635
182
  msgid "Local Media"
183
  msgstr ""
184
 
185
+ #: php/backend.php:618 php/backend.php:637
186
  msgid "Valid URLs"
187
  msgstr ""
188
 
189
+ #: php/settings.php:21
190
+ msgid "Featured Videos"
191
+ msgstr ""
192
+
193
  #: php/settings.php:23
194
  msgid "Replace Featured Images"
195
  msgstr ""
196
 
197
  #: php/settings.php:24
198
+ msgid "Autoplay"
199
+ msgstr ""
200
+
201
+ #: php/settings.php:25
202
  msgid "Video Sizing"
203
  msgstr ""
204
 
205
  #: php/settings.php:26
206
+ msgid "Video Align"
207
+ msgstr ""
208
+
209
+ #: php/settings.php:28
210
  msgid "YouTube Player Options"
211
  msgstr ""
212
 
213
+ #: php/settings.php:29
214
  msgid "Vimeo Player Options"
215
  msgstr ""
216
 
217
+ #: php/settings.php:30
218
  msgid "Dailymotion Player Options"
219
  msgstr ""
220
 
221
+ #: php/settings.php:31
222
  msgid "Support"
223
  msgstr ""
224
 
225
+ #: php/settings.php:45
226
  #, php-format
227
  msgid ""
228
  "To display your featured videos you can either make use of the automatic "
230
  "use of the plugins PHP-functions."
231
  msgstr ""
232
 
233
+ #: php/settings.php:46
234
  #, php-format
235
  msgid ""
236
  "For more information about Shortcode and PHP functions see the %sContextual "
237
  "Help%s."
238
  msgstr ""
239
 
240
+ #: php/settings.php:62 php/settings.php:86
241
  msgid "yes"
242
  msgstr ""
243
 
244
+ #: php/settings.php:62 php/settings.php:88 php/settings.php:111
245
+ #: php/settings.php:121 php/settings.php:142 php/settings.php:160
246
  msgid "default"
247
  msgstr ""
248
 
249
+ #: php/settings.php:64 php/settings.php:88
250
  msgid "no"
251
  msgstr ""
252
 
253
+ #: php/settings.php:65
254
  msgid ""
255
  "If a Featured Video is available it can be displayed in place of the "
256
  "Featured Image. Still, a Featured Image is required."
257
  msgstr ""
258
 
259
+ #: php/settings.php:70
260
  msgid ""
261
  "To display Featured Videos you need to use the <code>Shortcode</code> or "
262
  "<code>PHP functions</code>."
263
  msgstr ""
264
 
265
+ #: php/settings.php:89
266
+ msgid ""
267
+ "YouTube, Vimeo and Dailymotion videos can autoplay when a single post/page "
268
+ "is being viewed."
269
+ msgstr ""
270
+
271
+ #: php/settings.php:108
272
  msgid "Width"
273
  msgstr ""
274
 
275
+ #: php/settings.php:118
276
  msgid "Height"
277
  msgstr ""
278
 
279
+ #: php/settings.php:127
280
  msgid ""
281
  "When using <code>auto</code> the video will be adjusted to fit it's parent "
282
  "element while sticking to it's ratio. Using a <code>fixed</code> height and "
283
  "width might result in <em>not so pretty</em> black bars."
284
  msgstr ""
285
 
286
+ #: php/settings.php:141
 
 
 
 
287
  msgid "left"
288
  msgstr ""
289
 
290
+ #: php/settings.php:142
291
  msgid "center"
292
  msgstr ""
293
 
294
+ #: php/settings.php:143
295
  msgid "right"
296
  msgstr ""
297
 
298
+ #: php/settings.php:165
299
  msgid "VIDEOJS Player Options"
300
  msgstr ""
301
 
302
+ #: php/settings.php:183
303
  msgid "Light Theme"
304
  msgstr ""
305
 
306
+ #: php/settings.php:184
307
+ msgid "Info"
 
 
 
 
308
  msgstr ""
309
 
310
+ #: php/settings.php:185
311
  msgid "Fullscreen Button"
312
  msgstr ""
313
 
314
+ #: php/settings.php:186
315
  msgid "Related Videos"
316
  msgstr ""
317
 
318
+ #: php/settings.php:187
319
+ msgid "White Progressbar"
320
+ msgstr ""
321
+
322
+ #: php/settings.php:189 php/settings.php:241
323
+ msgid "Logo"
324
+ msgstr ""
325
+
326
+ #: php/settings.php:210
327
  msgid "Portrait"
328
  msgstr ""
329
 
330
+ #: php/settings.php:211
331
  msgid "Title"
332
  msgstr ""
333
 
334
+ #: php/settings.php:212
335
  msgid "Byline"
336
  msgstr ""
337
 
338
+ #: php/settings.php:215
339
  msgid "Color"
340
  msgstr ""
341
 
342
+ #: php/settings.php:219
343
  msgid "Vimeo Plus Videos might ignore these settings."
344
  msgstr ""
345
 
346
+ #: php/settings.php:242
347
+ msgid "Videoinfo"
348
  msgstr ""
349
 
350
+ #: php/settings.php:243
351
+ msgid "Syndication Key"
352
  msgstr ""
353
 
354
+ #: php/settings.php:247
355
  msgid "Foreground"
356
  msgstr ""
357
 
358
+ #: php/settings.php:252
359
  msgid "Highlight"
360
  msgstr ""
361
 
362
+ #: php/settings.php:257
363
  msgid "Background"
364
  msgstr ""
365
 
366
+ #: php/settings.php:274
367
+ #, php-format
368
+ msgid ""
369
+ "If you have found a bug or are missing a specific video service, please "
370
+ "%slet me know%s in the support forum. Elsewise, if you like the plugin: "
371
+ "Please %srate it!%s"
372
  msgstr ""
373
 
374
+ #: php/settings.php:280
375
+ msgid ""
376
+ "The plugin logs it's version, the WordPress version and WordPress language "
377
+ "for internal statistics. Those help for future plugin development."
378
  msgstr ""
379
 
380
+ #: php/settings.php:282
381
+ msgid ""
382
+ "No personal user information is being collected. Still, you can easily Opt-"
383
+ "Out and have the data deleted:"
384
  msgstr ""
385
 
386
+ #: php/settings.php:368
387
  msgid "Displays the video in its default size."
388
  msgstr ""
389
 
390
+ #: php/settings.php:372
391
  msgid ""
392
  "Displays the video with an width of 300 pixel. Height will be fitted to the "
393
  "aspect ratio."
394
  msgstr ""
395
 
396
+ #: php/settings.php:376
397
  msgid "Displays the video with an fixed width and height."
398
  msgstr ""
399
 
400
+ #: php/settings.php:389
401
  #, php-format
402
+ msgid ""
403
+ "All parameters are optional. If %s the current post's id will be used. %s is "
404
+ "either a string keyword (thumbnail, medium, large or full) or a 2-item array "
405
+ "representing width and height in pixels, e.g. array(32,32)."
406
  msgstr ""
407
 
408
+ #: php/settings.php:392
409
  #, php-format
410
  msgid ""
411
+ "The functions are implemented corresponding to the original %sfunctions%s: "
412
+ "They are intended to be used and to act the same way. Take a look into the "
413
+ "WordPress Codex for further guidance:"
414
  msgstr ""
415
 
416
+ #: php/settings.php:415 php/settings.php:438
417
  msgid "PHP-Functions"
418
  msgstr ""
419
 
420
+ #: php/upgrade.php:132 php/upgrade.php:143 php/upgrade.php:154
421
  msgid "Featured Video Plus was <strong>upgraded</strong>."
422
  msgstr ""
423
 
424
+ #: php/upgrade.php:132
425
  #, php-format
426
  msgid ""
427
+ "%s features a seamless <strong>WP3.5 Media Manager</strong> integration, "
428
+ "time-links (#t=4m2s) for YouTube and Dailymotion, some new options and new "
429
+ "PHP functions for developers."
430
  msgstr ""
431
 
432
+ #: php/upgrade.php:132 php/upgrade.php:143 php/upgrade.php:154
433
  #, php-format
434
  msgid "If you like the plugin, please %srate it%s."
435
  msgstr ""
436
 
437
+ #: php/upgrade.php:143
438
+ #, php-format
439
+ msgid ""
440
+ "%s features a seamless WP3.5 Media Manager integration, time-links (#t=4m2s) "
441
+ "for YouTube and Dailymotion, more customization settings and "
442
+ "internationalization."
443
+ msgstr ""
444
+
445
+ #: php/upgrade.php:154
446
  #, php-format
447
  msgid ""
448
+ "%s features support for <strong>Local Videos</strong>, a seamless WP3.5 "
449
+ "Media Manager integration, time-links (#t=4m2s) for YouTube and Dailymotion "
450
+ "and many more customization settings."
451
  msgstr ""
452
 
453
+ #: php/upgrade.php:166
454
  #, php-format
455
  msgid ""
456
  "Featured Video Plus is <strong>ready to use</strong>. There is a new box on "
php/backend.php CHANGED
@@ -18,7 +18,7 @@ class featured_video_plus_backend {
18
  private $help_urls;
19
 
20
  /**
21
- * Creates a new instace of this class, saves the featured_video_instance and default value for the meta box input.
22
  *
23
  * @since 1.0
24
  *
@@ -64,11 +64,13 @@ class featured_video_plus_backend {
64
  wp_enqueue_script( 'fvp_backend', FVP_URL . 'js/backend-min.js', array( 'jquery','jquery.autosize' ), FVP_VERSION ); // production
65
  //wp_enqueue_script( 'fvp_backend', FVP_URL . 'js/backend.js', array( 'jquery','jquery.autosize'), FVP_VERSION ); // development
66
 
 
67
  $upload_dir = wp_upload_dir();
68
  wp_localize_script( 'fvp_backend', 'fvp_backend_data', array(
69
  'wp_upload_dir' => $upload_dir['baseurl'],
70
  'default_value' => $this->default_value,
71
- 'default_value_sec' => $this->default_value_sec
 
72
  ) );
73
  }
74
 
@@ -107,7 +109,7 @@ class featured_video_plus_backend {
107
  $tmp2 = get_post_meta( $tmp1, '_fvp_image', true);
108
  $has_featimg = empty($tmp1) ? false : true;
109
  $featimg_is_fvp = empty($tmp2) ? false : true;
110
- $has_post_video = $this->featured_video_plus->has_post_video($post_id);
111
 
112
  $options = get_option( 'fvp-settings' );
113
  $meta = unserialize( get_post_meta($post_id, '_fvp_video', true) );
@@ -123,12 +125,21 @@ class featured_video_plus_backend {
123
  echo $this->featured_video_plus->get_the_post_video( $post_id, array(256,144) );
124
 
125
  // input box containing the featured video URL
126
- $full = isset($meta['full']) ? $meta['full'] : $this->default_value;
127
  $legal= isset($meta['valid']) && !$meta['valid'] ? ' fvp_invalid' : '';
128
- echo '<textarea class="fvp_input'.$legal.'" id="fvp_video" name="fvp_video" type="text" title="' . $this->default_value . '" />' . $full . '</textarea>' . "\n";
129
-
130
- $sec = isset($meta['sec']) ? $meta['sec'] : $this->default_value_sec;
131
- echo '<textarea class="fvp_input" id="fvp_sec" name="fvp_sec" type="text" title="' . $this->default_value_sec . '" />' . $sec . '</textarea>' . "\n";
 
 
 
 
 
 
 
 
 
 
132
 
133
  // local video format warning
134
  echo '<div id="fvp_localvideo_format_warning" class="fvp_warning fvp_hidden">'."\n\t".'<p class="description">'."\n\t\t";
@@ -146,11 +157,12 @@ class featured_video_plus_backend {
146
  echo "<div id=\"fvp_help_notice\" class=\"fvp_notice".$class."\">\n\t<p class=\"description\">\n\t\t";
147
  echo '<span style="font-weight: bold;">'.__('Hint', 'featured-video-plus').':</span>&nbsp;'.sprintf(__('Take a look into the %sContextual Help%s.', 'featured-video-plus'), '<a href="#contextual-help'.$wrap.'" id="fvp_help_toggle">', '</a>');
148
  echo "\n\t</p>\n</div>\n";
149
-
 
150
  // no featured image warning
151
  $class = $has_featimg || !$has_post_video || (isset($options['overwrite']) && !$options['overwrite']) ? ' fvp_hidden' : '';
152
  echo '<div id="fvp_featimg_warning" class="fvp_notice'.$class.'">'."\n\t".'<p class="description">';
153
- echo '<span style="font-weight: bold;">Featured Image:</span>&nbsp;'.__('For automatically displaying the Featured Video a Featured Image is required.', 'featured-video-plus');
154
  echo "</p>\n</div>\n";
155
 
156
  // set as featured image
@@ -177,74 +189,52 @@ class featured_video_plus_backend {
177
  ( defined( 'DOING_AJAX' ) && DOING_AJAX ) || // AJAX? Not used here
178
  ( !current_user_can( 'edit_post', $post_id ) ) || // Check user permissions
179
  ( false !== wp_is_post_revision( $post_id ) ) || // Return if it's a post revision
180
- ( ( isset($_POST['fvp_nonce']) && !wp_verify_nonce( $_POST['fvp_nonce'], FVP_NAME ) ) &&
181
- !is_string($set_featimg) )
 
182
  ) return;
183
 
 
184
  $meta = unserialize( get_post_meta($post_id, '_fvp_video', true) );
185
- if( is_string($set_featimg) ) {
186
- $video = $set_featimg;
187
- $set_featimg = true;
188
- } else {
189
- $set_featimg = isset($_POST['fvp_set_featimg']) && !empty($_POST['fvp_set_featimg']) ? true : $set_featimg;
190
-
191
- if( !isset($_POST['fvp_video']) || $_POST['fvp_video'] == $this->default_value )
192
- $video = '';
193
- else
194
- $video = trim($_POST['fvp_video']);
195
- }
196
-
197
- $sec = isset($_POST['fvp_sec']) && !empty($_POST['fvp_sec']) && $_POST['fvp_sec'] != $this->default_value_sec ? trim($_POST['fvp_sec']) : '';
198
-
199
- // something changed
200
- if( ( empty($video) ) || // no video or
201
- ( isset($meta) && ($video != $meta['full'])) ) // different video?
202
- {
203
-
204
- if(!empty($meta)) { // different video!
205
 
206
- // the current featured image is part of fvp
207
- $tmp = get_post_meta( get_post_thumbnail_id($post_id), '_fvp_image', true);
208
- if( !empty( $tmp ) ) {
209
 
210
- // are there other posts with the same featured image?
211
- $tmp2 = $this->get_post_by_custom_meta( '_thumbnail_id', $meta['img'], $post_id );
212
- if( !empty( $tmp2 ) ) { // there aren't, so delete it
213
- $img = $this->get_post_by_custom_meta('_fvp_image', $meta['prov'] . '?' . $meta['id'] );
214
- wp_delete_attachment( $img );
215
- delete_post_meta( $img, '_fvp_image', $meta['prov'] . '?' . $meta['id'] );
216
- }
217
 
218
- delete_post_meta( $post_id, '_thumbnail_id' );
219
- }
220
 
221
- delete_post_meta( $post_id, '_fvp_video' );
222
- }
 
223
 
224
- }
225
 
 
226
  if( empty($video) )
227
  return;
228
 
 
 
 
229
  if( ($video == $meta['full']) &&
230
  (!$set_featimg) &&
231
- (empty($sec) || ( isset($meta['sec']) && $meta['sec'] == $sec ) ) ) // different secondary video?
232
  return;
233
 
234
  $options = get_option( 'fvp-settings' );
235
 
236
- /*
237
- REGEX tested using: http://www.rubular.com/
238
- */
239
-
240
  $local = wp_upload_dir();
241
- preg_match('/(vimeo|youtu|dailymotion|liveleak|' . preg_quote($local['baseurl'], '/') . ')/i', $video, $video_provider);
242
  if( isset($video_provider[1]) )
243
  $video_prov = $video_provider[1];
244
  else $video_prov = '';
245
 
246
  switch ($video_prov) {
247
 
 
248
  case $local['baseurl']:
249
  $ext = pathinfo( $video, PATHINFO_EXTENSION );
250
  if( !isset($ext) || ($ext != 'mp4' && $ext != 'ogv' && $ext != 'webm' && $ext != 'ogg') ) return; // wrong extension
@@ -263,75 +253,98 @@ REGEX tested using: http://www.rubular.com/
263
 
264
  break;
265
 
 
266
  case 'youtu':
267
  $video_prov = 'youtube';
268
-
269
  case 'youtube':
270
- //match provider watch feature id(!) attr(!)
271
- //preg_match('/youtu(?:be\.com|\.be)\/(?:watch)?(?:\?feature=[^\?&]*)*(?:[\?&]v=)?([^\?&\s]+)(?:(?:[&\?]t=)((?:\d+m)?\d+s))?/', $video, $video_data);
272
-
273
- $pattern = '#(?:https?\:\/\/)?(?:www\.)?(?:youtu\.be\/|youtube\.com(?:\/embed\/|\/v\/|\/watch\?v=|\/watch\?.+&v=))([\w-]{11})(?:(?:\?|&)?(?:.*)(?:t=)((?:\d+m)?\d+s))?.*#x';
274
  preg_match($pattern, $video, $video_data);
275
  if( !isset($video_data[1]) )
276
  break;
277
 
278
- $response = wp_remote_get( 'http://youtube.com/get_video_info?video_id=' . $video_data[1] );
 
 
 
279
  if( is_wp_error( $response ) )
280
  break;
281
  parse_str( $response['body'], $data );
282
  if( isset($data['status']) && $data['status'] == 'fail' )
283
  break;
284
 
285
- $video_id = $video_data[1];
286
- if( isset($video_data[2] ) )
287
- $video_attr = $video_data[2];
 
 
 
 
 
 
 
 
 
 
288
 
289
  // generate video metadata
290
  $video_info = array(
291
- 'title' => $data['title'],
292
- 'description' => $data['keywords'],
293
- 'filename' => sanitize_file_name($data['title']),
294
- 'timestamp' => $data['timestamp'],
295
- 'author' => $data['author'],
296
- 'tags' => $data['keywords'],
297
- 'img' => ( isset($data['']) && !empty($data['iurlmaxres']) ) ? $data['iurlmaxres'] : 'http://img.youtube.com/vi/' . $video_id . '/0.jpg'
 
298
  );
299
- break;
300
 
301
- case 'vimeo': // http://developer.vimeo.com/apis/simple
302
- //preg_match('/vimeo.com\/([^#]+)/', $video, $video_data);
303
 
 
 
 
304
  $pattern = '#(?:https?://)?(?:\w+.)?vimeo.com/(?:video/|moogaloop\.swf\?clip_id=)?(\w+)#x';
305
  preg_match($pattern, $video, $video_data);
306
  $video_id = $video_data[1];
307
 
308
- // title, description, upload_date, thumbnail_large, user_name, tags
309
  $response = wp_remote_get( 'http://vimeo.com/api/v2/video/' . $video_id . '.php' );
310
  if( is_wp_error( $response ) || (isset($response['response']['code']) && $response['response']['code'] == '404') )
311
  break;
 
312
  $data = unserialize( $response['body'] );
313
 
 
 
 
 
 
314
  // generate video metadata
315
  $video_info = array(
316
- 'title' => $data[0]['title'],
317
- 'description' => $data[0]['description'],
318
- 'filename' => sanitize_file_name( $data[0]['title'] ),
319
- 'timestamp' => strtotime( $data[0]['upload_date'] ),
320
- 'author' => $data[0]['user_name'],
321
- 'tags' => $data[0]['tags'],
322
- 'img' => $data[0]['thumbnail_large'],
323
- 'url' => $data[0]['url']
324
  );
 
325
  break;
326
 
327
- case 'dailymotion': // http://www.dailymotion.com/doc/api/obj-video.html
328
- preg_match('/dailymotion.com\/video\/([^_#]+)/', $video, $video_data);
 
 
329
  if( !isset($video_data[1]) )
330
  break;
331
 
332
- // http://codex.wordpress.org/HTTP_API
333
- //thumbnail_url,aspect_ratio,description,created_time,embed_url,owner (owner.screenname),tags,title,url
334
- $url = 'https://api.dailymotion.com/video/'.$video_data[1].'?fields=title,description,created_time,owner.screenname,tags,thumbnail_url,thumbnail_large_url,url,aspect_ratio';
 
335
  $request = new WP_Http;
336
  $result = $request->request( $url, array( 'method' => 'GET', 'sslverify' => false) );
337
  if( is_wp_error($result) )
@@ -340,33 +353,51 @@ REGEX tested using: http://www.rubular.com/
340
  if( !isset($data) || (isset($data['error']['code']) && ($data['error']['code'] == 501 || $data['error']['code'] == 400) ) )
341
  break;
342
 
343
- $video_id = $video_data[1];
 
 
 
 
 
 
 
 
 
 
 
 
344
 
345
  // generate video metadata
346
  $video_info = array(
347
- 'title' => $data['title'],
348
- 'description' => $data['description'],
349
- 'filename' => sanitize_file_name($data['title']),
350
- 'timestamp' => $data['created_time'],
351
- 'author' => $data['owner.screenname'],
352
- 'tags' => $data['tags'],
353
- 'img' => ( isset($data['thumbnail_url']) && !empty($data['thumbnail_url']) ) ? $data['thumbnail_url'] : $data['thumbnail_large_url'],
354
- 'url' => $data['url']
355
  );
 
356
  break;
357
 
 
 
 
358
  case 'liveleak': // view-source:http://www.liveleak.com/view?i=45f_1358105976&ajax=1
 
359
  preg_match('/(?:http:\/\/)?(?:www\.)?liveleak.com\/view\?i=([\d\w]{3}_\d{10})/', $video, $video_data);
360
  if( !isset($video_data[1]) )
361
  break;
362
 
 
363
  $response = wp_remote_get( 'http://liveleak.com/view?i='.$video_data[1].'&ajax=1');
364
  if( is_wp_error( $response ) )
365
  break;
366
 
367
- preg_match('#jwplayer\("player_([\d\w]{12})[\d\w]{2}"\)\.setup\({([^}}\))]+)#', $response['body'], $llmeta);
 
368
  if( isset($llmeta[1]) || isset($llmeta[2]) ) {
369
-
370
  $video_id = $llmeta[1];
371
 
372
  $llmeta = explode(',', $llmeta[2]);
@@ -386,14 +417,17 @@ REGEX tested using: http://www.rubular.com/
386
  'timestamp' => time(),
387
  'author' => '', // <strong>By:</strong> <a href="http://www.liveleak.com/c/k-doe">k-doe</a>
388
  'tags' => '', // <strong>Tags:</strong> <a href="browse?q=Drive By">Drive By</a>, <a href="browse?q=Fire Extinguisher">Fire Extinguisher</a><br />
389
- 'img' => trim($data['image'],"\""),
390
  'url' => 'http://liveleak.com/view?i='.$video_data[1]
391
  );
392
  break;
393
  }
 
 
394
  $video_prov = 'prochan';
395
  $type = 'iframe';
396
 
 
397
  case 'prochan':
398
  if($type == 'iframe') {
399
  preg_match('#<iframe.*src="(?:http://)?(?:www\.)?prochan.com/embed\?f=([\d\w]{3}_\d{10})".*></iframe>#', $response['body'], $proframe);
@@ -408,18 +442,20 @@ REGEX tested using: http://www.rubular.com/
408
  if( !isset($video_id) )
409
  $valid = false;
410
 
411
- // do we have a screen capture to pull?
412
  if( isset($video_info['img']) && !empty($video_info['img']) ) {
 
 
413
 
414
- // is this screen capture already existing in our media library?
415
- $video_img = $this->get_post_by_custom_meta('_fvp_image', $video_prov . '?' . $video_id);
416
  if( !isset($video_img) ) {
417
 
418
- // generate attachment post metadata
419
  $video_img_data = array(
420
- 'post_content' => $video_info['description'],
421
- 'post_title' => $video_info['title'],
422
- 'post_name' => $video_info['filename']
423
  );
424
 
425
  // pull external img to local server and add to media library
@@ -429,16 +465,16 @@ REGEX tested using: http://www.rubular.com/
429
  // generate picture metadata
430
  $video_img_meta = wp_get_attachment_metadata( $video_img );
431
  $video_img_meta['image_meta'] = array(
432
- 'aperture' => 0,
433
- 'credit' => $video_id,
434
- 'camera' => $video_prov,
435
- 'caption' => $video_info['description'],
436
  'created_timestamp' => $video_info['timestamp'],
437
- 'copyright' => $video_info['author'],
438
- 'focal_length' => 0,
439
- 'iso' => 0,
440
- 'shutter_speed' => 0,
441
- 'title' => $video_info['title']
442
  );
443
 
444
  // save picture metadata
@@ -454,13 +490,13 @@ REGEX tested using: http://www.rubular.com/
454
  }
455
 
456
  $meta = array(
457
- 'full' => ( isset($data['url']) && !empty($data['url']) ) ? $data['url'] : $video,
458
- 'id' => isset($video_id) ? $video_id : '',
459
- 'sec' => isset($sec) ? $sec : '',
460
- 'sec_id'=> ( isset($video_sec_id) && !empty($video_sec_id) ) ? $video_sec_id : '',
461
- 'img' => isset($video_img) ? $video_img : '',
462
- 'prov' => isset($video_prov) ? $video_prov : '',
463
- 'attr' => isset($video_attr) ? $video_attr : '',
464
  'valid' => $valid
465
  );
466
 
@@ -469,6 +505,53 @@ REGEX tested using: http://www.rubular.com/
469
  return;
470
  }
471
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
472
  /**
473
  * Initializes the help texts.
474
  *
@@ -526,14 +609,14 @@ REGEX tested using: http://www.rubular.com/
526
  return;
527
 
528
  if( get_bloginfo('version') >= 3.3 ) {
529
- // PHP FUNCTIONS HELP TAB
530
  $screen->add_help_tab( array(
531
  'id' => 'fvp_help_localvideos',
532
  'title' => __('Featured Video','featured-video-plus').':&nbsp;'.__('Local Media', 'featured-video-plus'),
533
  'content' => $this->help_localmedia
534
  ));
535
 
536
- // SHORTCODE HELP TAB
537
  $screen->add_help_tab( array(
538
  'id' => 'fvp_help_urls',
539
  'title' => __('Featured Video','featured-video-plus').':&nbsp;'.__('Valid URLs', 'featured-video-plus'),
@@ -587,32 +670,6 @@ REGEX tested using: http://www.rubular.com/
587
  return $links;
588
  }
589
 
590
- /**
591
- * Gets a post by an meta_key meta_value pair. Returns it's post_id.
592
- *
593
- * @see http://codex.wordpress.org/Class_Reference/wpdb
594
- * @see http://dev.mysql.com/doc/refman/5.0/en/regexp.html#operator_regexp
595
- * @since 1.0
596
- *
597
- * @param string $meta_key which meta_key to look for
598
- * @param string $meta_value which meta_value to look for
599
- */
600
- function get_post_by_custom_meta($meta_key, $meta_value, $notThisId = 0) {
601
- global $wpdb;
602
- if( $notThisId > 0 )
603
- $prepared = $wpdb->prepare(
604
- "SELECT post_id FROM {$wpdb->postmeta} WHERE meta_key=%s AND meta_value=%s AND post_id!=%d;",
605
- $meta_key, $meta_value, $notThisId
606
- );
607
- else
608
- $prepared = $wpdb->prepare(
609
- "SELECT post_id FROM {$wpdb->postmeta} WHERE meta_key=%s AND meta_value=%s;",
610
- $meta_key, $meta_value
611
- );
612
-
613
- return $wpdb->get_var( $prepared );
614
- }
615
-
616
  /**
617
  * Gets post id by it's url / guid.
618
  *
18
  private $help_urls;
19
 
20
  /**
21
+ * Creates a new instance of this class, saves the featured_video_instance and default value for the meta box input.
22
  *
23
  * @since 1.0
24
  *
64
  wp_enqueue_script( 'fvp_backend', FVP_URL . 'js/backend-min.js', array( 'jquery','jquery.autosize' ), FVP_VERSION ); // production
65
  //wp_enqueue_script( 'fvp_backend', FVP_URL . 'js/backend.js', array( 'jquery','jquery.autosize'), FVP_VERSION ); // development
66
 
67
+ $wp_35 = get_bloginfo('version') >= 3.5 ? true : false;
68
  $upload_dir = wp_upload_dir();
69
  wp_localize_script( 'fvp_backend', 'fvp_backend_data', array(
70
  'wp_upload_dir' => $upload_dir['baseurl'],
71
  'default_value' => $this->default_value,
72
+ 'default_value_sec' => $this->default_value_sec,
73
+ 'wp_35' => $wp_35
74
  ) );
75
  }
76
 
109
  $tmp2 = get_post_meta( $tmp1, '_fvp_image', true);
110
  $has_featimg = empty($tmp1) ? false : true;
111
  $featimg_is_fvp = empty($tmp2) ? false : true;
112
+ $has_post_video = has_post_video($post_id);
113
 
114
  $options = get_option( 'fvp-settings' );
115
  $meta = unserialize( get_post_meta($post_id, '_fvp_video', true) );
125
  echo $this->featured_video_plus->get_the_post_video( $post_id, array(256,144) );
126
 
127
  // input box containing the featured video URL
 
128
  $legal= isset($meta['valid']) && !$meta['valid'] ? ' fvp_invalid' : '';
129
+ $full = $meta['prov'] == 'local' ? wp_get_attachment_url($meta['id']) : isset($meta['full']) ? $meta['full'] : $this->default_value;
130
+ echo '<div class="fvp_input_wrapper" data-title="'.__('Set Featured Video', 'featured-video-plus').'" data-button="'.__('Set featured video', 'featured-video-plus').'" data-target="#fvp_video">'."\n\t";
131
+ echo '<textarea class="fvp_input'.$legal.'" id="fvp_video" name="fvp_video" type="text">' . $full . '</textarea>' . "\n\t";
132
+ if( !(get_bloginfo('version') < 3.5) )
133
+ echo '<a href="#" class="fvp_video_choose"><span class="fvp_media_icon" style="background-image: url(\''.get_bloginfo('wpurl').'/wp-admin/images/media-button.png\');"></span></a>'."\n";
134
+ echo "</div>\n";
135
+
136
+ $sec = isset($meta['sec']) && !empty($meta['sec']) ? wp_get_attachment_url($meta['sec_id']) : $this->default_value_sec;
137
+ $class = !isset($meta['sec']) || empty($meta['sec']) ? ' defaultTextActive' : '';
138
+ echo '<div class="fvp_input_wrapper" id="fvp_sec_wrapper" data-title="'.__('Set Featured Video Fallback', 'featured-video-plus').'" data-button="'.__('Set featured video fallback', 'featured-video-plus').'" data-target="#fvp_sec">'."\n\t";
139
+ echo '<textarea class="fvp_input'.$class.'" id="fvp_sec" name="fvp_sec" type="text">' . $sec . '</textarea>' . "\n\t";
140
+ if( !(get_bloginfo('version') < 3.5) )
141
+ echo '<a href="#" class="fvp_video_choose"><span class="fvp_media_icon" style="background-image: url(\''.get_bloginfo('wpurl').'/wp-admin/images/media-button.png\');"></span></a>'."\n";
142
+ echo "</div>\n";
143
 
144
  // local video format warning
145
  echo '<div id="fvp_localvideo_format_warning" class="fvp_warning fvp_hidden">'."\n\t".'<p class="description">'."\n\t\t";
157
  echo "<div id=\"fvp_help_notice\" class=\"fvp_notice".$class."\">\n\t<p class=\"description\">\n\t\t";
158
  echo '<span style="font-weight: bold;">'.__('Hint', 'featured-video-plus').':</span>&nbsp;'.sprintf(__('Take a look into the %sContextual Help%s.', 'featured-video-plus'), '<a href="#contextual-help'.$wrap.'" id="fvp_help_toggle">', '</a>');
159
  echo "\n\t</p>\n</div>\n";
160
+ ?>
161
+ <?php
162
  // no featured image warning
163
  $class = $has_featimg || !$has_post_video || (isset($options['overwrite']) && !$options['overwrite']) ? ' fvp_hidden' : '';
164
  echo '<div id="fvp_featimg_warning" class="fvp_notice'.$class.'">'."\n\t".'<p class="description">';
165
+ echo '<span style="font-weight: bold;">'.__('Featured Image').':</span>&nbsp;'.__('For automatically displaying the Featured Video a Featured Image is required.', 'featured-video-plus');
166
  echo "</p>\n</div>\n";
167
 
168
  // set as featured image
189
  ( defined( 'DOING_AJAX' ) && DOING_AJAX ) || // AJAX? Not used here
190
  ( !current_user_can( 'edit_post', $post_id ) ) || // Check user permissions
191
  ( false !== wp_is_post_revision( $post_id ) ) || // Return if it's a post revision
192
+ ( ( isset($_POST['fvp_nonce']) && // WP Form submitted..
193
+ !wp_verify_nonce( $_POST['fvp_nonce'], FVP_NAME ) ) && // ..and wrong nonce?
194
+ !is_string($set_featimg) )
195
  ) return;
196
 
197
+ // get fvp_video post meta data
198
  $meta = unserialize( get_post_meta($post_id, '_fvp_video', true) );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
199
 
200
+ $set_featimg = isset($_POST['fvp_set_featimg']) && !empty($_POST['fvp_set_featimg']) ? true : false;
 
 
201
 
202
+ if( (!isset($_POST['fvp_video'])) || ($_POST['fvp_video'] == $this->default_value) )
203
+ $video = '';
204
+ else
205
+ $video = trim($_POST['fvp_video']);
 
 
 
206
 
207
+ $sec = isset($_POST['fvp_sec']) && !empty($_POST['fvp_sec']) && $_POST['fvp_sec'] != $this->default_value_sec ? trim($_POST['fvp_sec']) : '';
 
208
 
209
+ // Did the video input field value change?
210
+ if( ( (isset($meta) && !empty($meta)) && empty($video) ) )
211
+ $this->delete_featured_video_image($post_id, $meta);
212
 
 
213
 
214
+ // there is no video to save, end process
215
  if( empty($video) )
216
  return;
217
 
218
+ // the video provided is the same as the video we already saved, we do
219
+ // not want to set the featured image and the secondary video did not
220
+ // change either
221
  if( ($video == $meta['full']) &&
222
  (!$set_featimg) &&
223
+ (empty($sec) || ( isset($meta['sec']) && $meta['sec'] == $sec ) ) )
224
  return;
225
 
226
  $options = get_option( 'fvp-settings' );
227
 
228
+ // get the video's provider
 
 
 
229
  $local = wp_upload_dir();
230
+ preg_match('/(vimeo|youtu|dailymotion|liveleak|'.preg_quote($local['baseurl'], '/').')/i', $video, $video_provider);
231
  if( isset($video_provider[1]) )
232
  $video_prov = $video_provider[1];
233
  else $video_prov = '';
234
 
235
  switch ($video_prov) {
236
 
237
+ // local video
238
  case $local['baseurl']:
239
  $ext = pathinfo( $video, PATHINFO_EXTENSION );
240
  if( !isset($ext) || ($ext != 'mp4' && $ext != 'ogv' && $ext != 'webm' && $ext != 'ogg') ) return; // wrong extension
253
 
254
  break;
255
 
256
+ // youtube.com
257
  case 'youtu':
258
  $video_prov = 'youtube';
 
259
  case 'youtube':
260
+ // domain 11 char ID time-link parameter
261
+ $pattern = '#(?:https?\:\/\/)?(?:www\.)?(?:youtu\.be\/|youtube\.com(?:\/embed\/|\/v\/|\/watch\?v=|\/watch\?.+&v=))([\w-]{11})#x';
 
 
262
  preg_match($pattern, $video, $video_data);
263
  if( !isset($video_data[1]) )
264
  break;
265
 
266
+ $video_id = $video_data[1];
267
+
268
+ // access API
269
+ $response = wp_remote_get( 'http://youtube.com/get_video_info?video_id=' . $video_id );
270
  if( is_wp_error( $response ) )
271
  break;
272
  parse_str( $response['body'], $data );
273
  if( isset($data['status']) && $data['status'] == 'fail' )
274
  break;
275
 
276
+ // extract info of a time-link
277
+ preg_match('/t=(?:(\d+)m)?(?:(\d+)s)?/', $video, $attr);
278
+ if( !empty($attr[1] ) || !empty($attr[2]) ) {
279
+ $min = !empty($attr[1]) ? $attr[1]*60 : 0;
280
+ $sek = !empty($attr[2]) ? $attr[2] : 0;
281
+ $video_attr = $min + $sek;
282
+ } else {
283
+ preg_match('/start=(\d+)/', $video, $attr);
284
+ if( !empty($attr[1] ) )
285
+ $video_attr = $attr[1];
286
+ else
287
+ $video_attr = 0;
288
+ }
289
 
290
  // generate video metadata
291
  $video_info = array(
292
+ 'title' => $data['title'],
293
+ 'description' => $data['keywords'],
294
+ 'filename' => sanitize_file_name($data['title']),
295
+ 'timestamp' => $data['timestamp'],
296
+ 'author' => $data['author'],
297
+ 'tags' => $data['keywords'],
298
+ 'img' => ( isset($data['iurlmaxres']) && !empty($data['iurlmaxres']) ) ? $data['iurlmaxres'] : 'http://img.youtube.com/vi/' . $video_id . '/0.jpg',
299
+ 'url' => ( $video_attr > 0 ) ? 'http://youtu.be/'.$video_id.'#t='.floor($video_attr/60).'m'.($video_attr%60).'s' : 'http://youtu.be/'.$video_id
300
  );
 
301
 
302
+ break;
 
303
 
304
+ // vimeo.com
305
+ case 'vimeo':
306
+ // domain video ID
307
  $pattern = '#(?:https?://)?(?:\w+.)?vimeo.com/(?:video/|moogaloop\.swf\?clip_id=)?(\w+)#x';
308
  preg_match($pattern, $video, $video_data);
309
  $video_id = $video_data[1];
310
 
311
+ // access API: http://developer.vimeo.com/apis/simple
312
  $response = wp_remote_get( 'http://vimeo.com/api/v2/video/' . $video_id . '.php' );
313
  if( is_wp_error( $response ) || (isset($response['response']['code']) && $response['response']['code'] == '404') )
314
  break;
315
+ // title, description, upload_date, thumbnail_large, user_name, tags
316
  $data = unserialize( $response['body'] );
317
 
318
+ // extract info of a time-link
319
+ /*preg_match('/#t=((?:\d+m)?(?:\d+s)?)/', $video, $attr);
320
+ if( !empty($attr[1] ) )
321
+ $video_attr = $attr[1];*/
322
+
323
  // generate video metadata
324
  $video_info = array(
325
+ 'title' => $data[0]['title'],
326
+ 'description' => $data[0]['description'],
327
+ 'filename' => sanitize_file_name( $data[0]['title'] ),
328
+ 'timestamp' => strtotime( $data[0]['upload_date'] ),
329
+ 'author' => $data[0]['user_name'],
330
+ 'tags' => $data[0]['tags'],
331
+ 'img' => $data[0]['thumbnail_large'],
332
+ 'url' => $data[0]['url']
333
  );
334
+
335
  break;
336
 
337
+ // dailymotion.com
338
+ case 'dailymotion':
339
+ // domain video ID
340
+ preg_match('/dailymotion.com\/(?:embed\/)?video\/([^_#\?]+)/', $video, $video_data);
341
  if( !isset($video_data[1]) )
342
  break;
343
 
344
+ $video_id = $video_data[1];
345
+
346
+ // access API: http://www.dailymotion.com/doc/api/obj-video.html
347
+ $url = 'https://api.dailymotion.com/video/'.$video_id.'?fields=title,description,created_time,owner.screenname,tags,thumbnail_url,thumbnail_large_url,url,aspect_ratio';
348
  $request = new WP_Http;
349
  $result = $request->request( $url, array( 'method' => 'GET', 'sslverify' => false) );
350
  if( is_wp_error($result) )
353
  if( !isset($data) || (isset($data['error']['code']) && ($data['error']['code'] == 501 || $data['error']['code'] == 400) ) )
354
  break;
355
 
356
+ // extract info of a time-link
357
+ preg_match('/t=(?:(\d+)m)?(?:(\d+)s)?/', $video, $attr);
358
+ if( !empty($attr[1] ) || !empty($attr[2]) ) {
359
+ $min = !empty($attr[1]) ? $attr[1]*60 : 0;
360
+ $sek = !empty($attr[2]) ? $attr[2] : 0;
361
+ $video_attr = $min + $sek;
362
+ } else {
363
+ preg_match('/start=(\d+)/', $video, $attr);
364
+ if( !empty($attr[1] ) )
365
+ $video_attr = $attr[1];
366
+ else
367
+ $video_attr = 0;
368
+ }
369
 
370
  // generate video metadata
371
  $video_info = array(
372
+ 'title' => $data['title'],
373
+ 'description' => $data['description'],
374
+ 'filename' => sanitize_file_name($data['title']),
375
+ 'timestamp' => $data['created_time'],
376
+ 'author' => $data['owner.screenname'],
377
+ 'tags' => implode(', ', $data['tags']),
378
+ 'img' => ( isset($data['thumbnail_url']) && !empty($data['thumbnail_url']) ) ? $data['thumbnail_url'] : $data['thumbnail_large_url'],
379
+ 'url' => 'http://dailymotion.com/video/'.$video_id. ( $video_attr>0 ? '#t='.floor($video_attr/60).'m'.($video_attr%60).'s' : '')
380
  );
381
+
382
  break;
383
 
384
+ // liveleak.com
385
+ // no API provided, the plugin pulls the website and gets the video
386
+ // source url and other metadata from the source code.
387
  case 'liveleak': // view-source:http://www.liveleak.com/view?i=45f_1358105976&ajax=1
388
+ // domain video ID
389
  preg_match('/(?:http:\/\/)?(?:www\.)?liveleak.com\/view\?i=([\d\w]{3}_\d{10})/', $video, $video_data);
390
  if( !isset($video_data[1]) )
391
  break;
392
 
393
+ // no API, get stripped down version of the full website
394
  $response = wp_remote_get( 'http://liveleak.com/view?i='.$video_data[1].'&ajax=1');
395
  if( is_wp_error( $response ) )
396
  break;
397
 
398
+ // run dirty regex on the websites source code to get the actual video URL
399
+ preg_match('#jwplayer\("(?:(?:file)|(?:player))_([\d\w]{10,14})"\)\.setup\({([^}}\))]+)#', $response['body'], $llmeta);
400
  if( isset($llmeta[1]) || isset($llmeta[2]) ) {
 
401
  $video_id = $llmeta[1];
402
 
403
  $llmeta = explode(',', $llmeta[2]);
417
  'timestamp' => time(),
418
  'author' => '', // <strong>By:</strong> <a href="http://www.liveleak.com/c/k-doe">k-doe</a>
419
  'tags' => '', // <strong>Tags:</strong> <a href="browse?q=Drive By">Drive By</a>, <a href="browse?q=Fire Extinguisher">Fire Extinguisher</a><br />
420
+ 'img' => isset($data['image']) ? trim($data['image'],"\"") : '',
421
  'url' => 'http://liveleak.com/view?i='.$video_data[1]
422
  );
423
  break;
424
  }
425
+
426
+ // if the regex fails the video is provided by prochan, not LL
427
  $video_prov = 'prochan';
428
  $type = 'iframe';
429
 
430
+ // prochan.com (only implemented as used by liveleak
431
  case 'prochan':
432
  if($type == 'iframe') {
433
  preg_match('#<iframe.*src="(?:http://)?(?:www\.)?prochan.com/embed\?f=([\d\w]{3}_\d{10})".*></iframe>#', $response['body'], $proframe);
442
  if( !isset($video_id) )
443
  $valid = false;
444
 
445
+ // Do we have a screen capture to pull?
446
  if( isset($video_info['img']) && !empty($video_info['img']) ) {
447
+ // First delete the old image
448
+ $this->delete_featured_video_image($post_id, $meta);
449
 
450
+ // Is this screen capture already existing in our media library?
451
+ $video_img = $this->featured_video_plus->get_post_by_custom_meta('_fvp_image', $video_prov . '?' . $video_id);
452
  if( !isset($video_img) ) {
453
 
454
+ // Generate attachment post metadata
455
  $video_img_data = array(
456
+ 'post_content' => $video_info['description'],
457
+ 'post_title' => $video_info['title'],
458
+ 'post_name' => $video_info['filename']
459
  );
460
 
461
  // pull external img to local server and add to media library
465
  // generate picture metadata
466
  $video_img_meta = wp_get_attachment_metadata( $video_img );
467
  $video_img_meta['image_meta'] = array(
468
+ 'aperture' => 0,
469
+ 'credit' => $video_id,
470
+ 'camera' => $video_prov,
471
+ 'caption' => $video_info['description'],
472
  'created_timestamp' => $video_info['timestamp'],
473
+ 'copyright' => $video_info['author'],
474
+ 'focal_length' => 0,
475
+ 'iso' => 0,
476
+ 'shutter_speed' => 0,
477
+ 'title' => $video_info['title']
478
  );
479
 
480
  // save picture metadata
490
  }
491
 
492
  $meta = array(
493
+ 'full' => isset($video_info['url']) && !empty($video_info['url']) ? $video_info['url'] : $video,
494
+ 'id' => isset($video_id) ? $video_id : '',
495
+ 'sec' => isset($sec) ? $sec : '',
496
+ 'sec_id'=> isset($video_sec_id) && !empty($video_sec_id) ? $video_sec_id : '',
497
+ 'img' => isset($video_img) ? $video_img : '',
498
+ 'prov' => isset($video_prov) ? $video_prov : '',
499
+ 'attr' => isset($video_attr) ? $video_attr : '',
500
  'valid' => $valid
501
  );
502
 
505
  return;
506
  }
507
 
508
+ /**
509
+ * Removes the old featured ima
510
+ * Used since 1.0, got it own function in 1.4
511
+ *
512
+ * @since 1.4
513
+ */
514
+ function delete_featured_video_image($post_id, $meta) {
515
+ delete_post_meta( $post_id, '_fvp_video' );
516
+
517
+ // Unset featured image if it is from this video
518
+ delete_post_meta( $post_id, '_thumbnail_id', $meta['img'] );
519
+
520
+ // Check if other posts use the image, if not we can delete it completely
521
+ $other = $this->featured_video_plus->get_post_by_custom_meta( '_thumbnail_id', $meta['img'] );
522
+ if( empty( $other ) ) {
523
+ wp_delete_attachment( $meta['img'] );
524
+ delete_post_meta( $meta['img'], '_fvp_image', $meta['prov'] . '?' . $meta['id'] );
525
+ }
526
+ }
527
+
528
+ /**
529
+ * Plugin Version, WordPress Version and WordPress Language.
530
+ * Less than WordPress.org, but much more informative for future development.
531
+ *
532
+ * @since 1.4
533
+ *
534
+ * @param bool $out set to true when oppting out
535
+ */
536
+ function featured_video_plus_notify($options, $out = null) {
537
+ if($options['out'] == 1 && $out != 0)
538
+ return $options;
539
+
540
+ if( ($out !== null && $out != $options['out']) || isset($notice) || !isset($options['reged']) || !is_numeric($options['reged']) || ($options['reged']<strtotime("-1 week")) ) {
541
+ $options['out'] = $out == 1 ? 1 : 0;
542
+ $attr = array('body'=> array(
543
+ 'fvp_version' => FVP_VERSION,
544
+ 'wp_version' => get_bloginfo('version'),
545
+ 'wp_language' => get_bloginfo('language'),
546
+ 'out' => $options['out']
547
+ ));
548
+ $response = wp_remote_post( 'http://fvp.ahoereth.yrnxt.com/fvp.php', $attr);
549
+ if( !is_wp_error( $response ) )
550
+ $options['reged'] = is_numeric($response['body']) ? $response['body'] : time();
551
+ }
552
+ return $options;
553
+ }
554
+
555
  /**
556
  * Initializes the help texts.
557
  *
609
  return;
610
 
611
  if( get_bloginfo('version') >= 3.3 ) {
612
+ // LOCALVIDEOS HELP TAB
613
  $screen->add_help_tab( array(
614
  'id' => 'fvp_help_localvideos',
615
  'title' => __('Featured Video','featured-video-plus').':&nbsp;'.__('Local Media', 'featured-video-plus'),
616
  'content' => $this->help_localmedia
617
  ));
618
 
619
+ // LEGAL URLs HELP TAB
620
  $screen->add_help_tab( array(
621
  'id' => 'fvp_help_urls',
622
  'title' => __('Featured Video','featured-video-plus').':&nbsp;'.__('Valid URLs', 'featured-video-plus'),
670
  return $links;
671
  }
672
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
673
  /**
674
  * Gets post id by it's url / guid.
675
  *
php/frontend.php CHANGED
@@ -51,10 +51,25 @@ class featured_video_plus_frontend {
51
  global $_wp_additional_image_sizes;
52
 
53
  $options = get_option( 'fvp-settings' );
54
- if( !$options['overwrite'] || !$this->featured_video_plus->has_post_video( $post_id ) )
55
  return $html;
56
 
57
- return $this->featured_video_plus->get_the_post_video( $post_id, $size );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
58
  }
59
  }
60
  ?>
51
  global $_wp_additional_image_sizes;
52
 
53
  $options = get_option( 'fvp-settings' );
54
+ if( !$options['overwrite'] || !has_post_video( $post_id ) )
55
  return $html;
56
 
57
+ return get_the_post_video( $post_id, $size );
58
+ }
59
+
60
+ /**
61
+ * Shortcode for usage in post or page entries. Echos the post's featured video.
62
+ *
63
+ * @since 1.0
64
+ *
65
+ * @param array $atts can contain the width and/or height how the featured video should be displayed in px, optional
66
+ */
67
+ function shortcode($atts){
68
+ $w = isset($atts['width']) ? $atts['width'] : '';
69
+ $h = isset($atts['height']) ? $atts['height'] : '';
70
+
71
+ if(has_post_video())
72
+ echo get_the_post_video(null, array($w, $h));
73
  }
74
  }
75
  ?>
php/functions.php ADDED
@@ -0,0 +1,89 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /* Requires a featured_video_plus class instance, located in php/general.php
3
+ *
4
+ * @see featured-video-plus.php
5
+ * @see php/general.php
6
+ */
7
+
8
+ /**
9
+ * Echos the current posts featured video
10
+ *
11
+ * @since 1.0
12
+ *
13
+ * @param size
14
+ */
15
+ function the_post_video($size = null) {
16
+ echo get_the_post_video(null, $size);
17
+ }
18
+
19
+ /**
20
+ * Returns the posts featured video
21
+ *
22
+ * @since 1.0
23
+ *
24
+ * @param post_id
25
+ * @param size
26
+ */
27
+ function get_the_post_video($post_id = null, $size = null) {
28
+ global $featured_video_plus;
29
+ return $featured_video_plus->get_the_post_video($post_id, $size);
30
+ }
31
+
32
+ /**
33
+ * Checks if post has a featured video
34
+ *
35
+ * @since 1.0
36
+ *
37
+ * @param post_id
38
+ */
39
+ function has_post_video($post_id = null){
40
+ $post_id = ( null === $post_id ) ? get_the_ID() : $post_id;
41
+
42
+ $meta = unserialize( get_post_meta( $post_id, '_fvp_video', true ) );
43
+ if( !isset($meta) || empty($meta['id']) )
44
+ return false;
45
+
46
+ return true;
47
+ }
48
+
49
+ /**
50
+ * Returns the post video image's url
51
+ *
52
+ * @since 1.4
53
+ *
54
+ * @param post_id
55
+ */
56
+ function get_the_post_video_image_url($post_id = null) {
57
+ $post_id = ( null === $post_id ) ? get_the_ID() : $post_id;
58
+
59
+ $meta = unserialize( get_post_meta( $post_id, '_fvp_video', true ) );
60
+ if( !isset($meta) || empty($meta['id']) )
61
+ return false;
62
+
63
+ global $featured_video_plus;
64
+ $video_img = $featured_video_plus->get_post_by_custom_meta('_fvp_image', $meta['prov'].'?'.$meta['id']);
65
+
66
+ return wp_get_attachment_url( $video_img );
67
+ }
68
+
69
+ /**
70
+ * Returns the post video image img tag including size.
71
+ *
72
+ * @since 1.4
73
+ *
74
+ * @param post_id
75
+ * @param size
76
+ */
77
+ function get_the_post_video_image($post_id = null, $size = null) {
78
+ $meta = unserialize( get_post_meta( $post_id, '_fvp_video', true ) );
79
+ if( !isset($meta) || empty($meta['id']) )
80
+ return false;
81
+
82
+ global $featured_video_plus;
83
+ $id = $featured_video_plus->get_post_by_custom_meta('_fvp_image', $meta['prov'] . '?' . $meta['id']);
84
+ $size = $featured_video_plus->get_size($size);
85
+
86
+ return wp_get_attachment_image($id, $size);
87
+ }
88
+
89
+ ?>
php/general.php CHANGED
@@ -22,13 +22,13 @@ class featured_video_plus {
22
  if( !is_admin() || ( $hook_suffix == 'post.php' && isset($_GET['post']) ) ) {
23
 
24
  // http://videojs.com/
25
- wp_enqueue_script( 'videojs', 'http://vjs.zencdn.net/c/video.js' );
26
- wp_enqueue_style( 'videojs', 'http://vjs.zencdn.net/c/video-js.css' );
27
 
28
  $options = get_option( 'fvp-settings' );
29
  if( $options['sizing']['wmode'] == 'auto' )
30
- //wp_enqueue_script('fvp_fitvids', FVP_URL . 'js/jquery.fitvids_fvp-min.js', array( 'jquery' ), FVP_VERSION, true ); // production
31
- wp_enqueue_script('fvp_fitvids', FVP_URL . 'js/jquery.fitvids_fvp.js', array( 'jquery' ), FVP_VERSION, true ); // development
32
  }
33
  }
34
 
@@ -43,57 +43,41 @@ class featured_video_plus {
43
  * @param bool $container
44
  */
45
  public function get_the_post_video($post_id = null, $size = null) {
 
46
 
47
- if($post_id == null)
48
- $post_id = $GLOBALS['post']->ID;
49
-
50
- if( !$this->has_post_video($post_id) )
51
  return false;
52
 
53
- $meta = unserialize( get_post_meta($post_id, '_fvp_video', true) );
54
- $options = get_option( 'fvp-settings' );
55
-
56
- if( !is_array($size) ) {
57
- if( isset($_wp_additional_image_sizes[$size]) )
58
- $width = $_wp_additional_image_sizes[$size]['width'];
59
- elseif( $size == 'thumbnail' || $size == 'thumb' )
60
- $width = get_option( 'thumbnail_size_w' );
61
- else if( $size == 'medium' )
62
- $width = get_option( 'medium_size_w' );
63
- else if( $size == 'large' )
64
- $width = get_option( 'large_size_w' );
65
- elseif( isset($options['sizing']['wmode']) && $options['sizing']['wmode'] == 'fixed' )
66
- $width = $options['sizing']['width']; // auto width is applied by fitvids JS
67
- else
68
- $width = 560;
69
 
70
- } elseif( !empty( $size[0] ) && is_numeric( $size[0] ) )
71
- $width = $size[0];
72
- else
73
- $width = 560;
74
 
75
- if( isset($size[1]) && !empty( $size[1] ) && is_numeric( $size[1] ) )
76
- $height = $size[1];
77
- else
78
- $height = $options['sizing']['hmode'] == 'auto' ? round($width / 16 * 9) : $options['sizing']['height'];
79
 
80
  if( isset($meta['id']) && !empty($meta['id']) ) {
81
  switch( $meta['prov'] ) {
82
 
83
  case 'local':
84
- $featimg = has_post_thumbnail($post_id) ? wp_get_attachment_url( get_post_thumbnail_id($post_id) ) : '';
 
 
 
 
 
85
 
86
- $ext = pathinfo( $meta['full'], PATHINFO_EXTENSION );
87
- if( $ext != 'mp4' && $ext != 'ogv' && $ext != 'webm' && $ext != 'ogg' ) break;
88
  $ext = $ext == 'ogv' ? 'ogg' : $ext;
89
- $embed = "\n\t".'<video class="video-js vjs-default-skin" controls preload="auto" width="'.$width.'" height="'.$height.'" poster="" data-setup="{}">'; // poster="'.$featimg.'" data-setup="{}"
90
- $embed .= "\n\t\t".'<source src="' . $meta['full'] . '" type="video/'.$ext.'">';
91
 
92
  if( isset($meta['sec_id']) && !empty($meta['sec_id']) ) {
93
- $ext2 = pathinfo( $meta['sec'], PATHINFO_EXTENSION );
 
94
  $ext2 = $ext2 == 'ogv' ? 'ogg' : $ext2;
95
  if( $ext2 == 'mp4' || $ext2 == 'ogv' || $ext2 == 'webm' || $ext2 == 'ogg' )
96
- $embed .= "\n\t\t".'<source src="' . $meta['sec'] . '" type="video/'.$ext2.'">';
97
  }
98
 
99
  $embed .= "\n\t</video>\n";
@@ -101,18 +85,19 @@ class featured_video_plus {
101
 
102
  case 'vimeo':
103
  $options = get_option( 'fvp-settings' );
104
- $embed = "\n\t" . '<iframe src="http://player.vimeo.com/video/'.$meta['id'].'?badge=0&amp;portrait='.$options['vimeo']['portrait'].'&amp;title='.$options['vimeo']['title'].'&amp;byline='.$options['vimeo']['byline'].'&amp;color='.$options['vimeo']['color'].'" width="'.$width.'" height="'.$height.'" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>' . "\n";
 
105
  break;
106
 
107
  case 'youtube':
108
- $youtube['attr'] = isset($meta['attr']) && !empty($meta['attr']) ? '#t=' . $meta['attr'] : '';
109
  $youtube['theme'] = isset($options['youtube']['theme']) ? $options['youtube']['theme'] : 'dark';
110
  $youtube['color'] = isset($options['youtube']['color']) ? $options['youtube']['color'] : 'red';
111
  $youtube['info'] = isset($options['youtube']['info']) ? $options['youtube']['info'] : 1;
 
112
  $youtube['rel'] = isset($options['youtube']['rel']) ? $options['youtube']['rel'] : 1;
113
  $youtube['fs'] = isset($options['youtube']['fs']) ? $options['youtube']['fs'] : 1;
114
 
115
- $src = 'http://www.youtube.com/embed/'.$meta['id'].'?theme='.$youtube['theme'].'&color='.$youtube['color'].'&showinfo='.$youtube['info'].'&origin='.home_url().'&rel='.$youtube['rel'].'&fs='.$youtube['fs'].$youtube['attr'];
116
  $embed = "\n\t" . '<iframe width="'.$width.'" height="'.$height.'" src="'.$src.'" type="text/html" frameborder="0"></iframe>' . "\n";
117
  break;
118
 
@@ -122,7 +107,10 @@ class featured_video_plus {
122
  $dm['background'] = isset($options['dailymotion']['background']) ? $options['dailymotion']['background'] : '171D1B';
123
  $dm['logo'] = isset($options['dailymotion']['logo']) ? $options['dailymotion']['logo'] : 1;
124
  $dm['hideinfo'] = isset($options['dailymotion']['info']) ? 1-$options['dailymotion']['info'] : 0;
125
- $dm['src'] = 'http://www.dailymotion.com/embed/video/'.$meta['id'].'?logo='.$dm['logo'].'&hideInfos='.$dm['hideinfo'].'&foreground=%23'.$dm['foreground'].'&highlight=%23'.$dm['highlight'].'&background=%23'.$dm['background'];
 
 
 
126
  $embed = "\n" . '<iframe width="'.$width.'" height="'.$height.'" src="'.$dm['src'].'" frameborder="0"></iframe>' . "\n";
127
  break;
128
 
@@ -141,7 +129,7 @@ class featured_video_plus {
141
 
142
  }
143
 
144
- $containerstyle = isset($options['sizing']['align']) ? 'style="text-align: '.$options['sizing']['align'].'"' : '';
145
  $embed = "<div class=\"featured_video_plus\"{$containerstyle}>{$embed}</div>\n\n";
146
 
147
  $embed = "\n\n<!-- Featured Video Plus v".FVP_VERSION."-->\n" . $embed;
@@ -152,41 +140,55 @@ class featured_video_plus {
152
  }
153
 
154
  /**
155
- * Checks if current post or post provided by parameter has a featured video.
156
- *
157
- * @since 1.0
158
- *
159
- * @param int $post_id id of post to check for featured video
160
  */
161
- public function has_post_video($post_id = null){
162
-
163
- if($post_id == null)
164
- $post_id = $GLOBALS['post']->ID;
165
 
166
- $meta = unserialize( get_post_meta( $post_id, '_fvp_video', true ) );
 
 
 
 
 
 
 
 
 
 
 
 
167
 
168
- if( !isset($meta) || empty($meta['id']) )
169
- return false;
 
 
170
 
171
- return true;
 
 
 
172
 
 
173
  }
174
 
175
  /**
176
- * Shortcode for usage in post or page entries. Echos the post's featured video.
177
  *
 
 
178
  * @since 1.0
179
  *
180
- * @param array $atts can contain the width and/or height how the featured video should be displayed in px, optional
 
181
  */
182
- function shortcode($atts){
183
-
184
- $w = isset($atts['width']) ? $atts['width'] : '';
185
- $h = isset($atts['height']) ? $atts['height'] : '';
186
-
187
- if($this->has_post_video())
188
- echo $this->get_the_post_video(null, array($w, $h));
189
-
190
  }
191
 
192
  /**
22
  if( !is_admin() || ( $hook_suffix == 'post.php' && isset($_GET['post']) ) ) {
23
 
24
  // http://videojs.com/
25
+ wp_enqueue_script( 'videojs', 'http://vjs.zencdn.net/c/video.js', array(), FVP_VERSION, false );
26
+ wp_enqueue_style( 'videojs', 'http://vjs.zencdn.net/c/video-js.css', array(), FVP_VERSION, false );
27
 
28
  $options = get_option( 'fvp-settings' );
29
  if( $options['sizing']['wmode'] == 'auto' )
30
+ wp_enqueue_script('fvp_fitvids', FVP_URL . 'js/jquery.fitvids_fvp-min.js', array( 'jquery' ), FVP_VERSION, true ); // production
31
+ //wp_enqueue_script('fvp_fitvids', FVP_URL . 'js/jquery.fitvids_fvp.js', array( 'jquery' ), FVP_VERSION, true ); // development
32
  }
33
  }
34
 
43
  * @param bool $container
44
  */
45
  public function get_the_post_video($post_id = null, $size = null) {
46
+ $post_id = ( null === $post_id ) ? get_the_ID() : $post_id;
47
 
48
+ if( !has_post_video($post_id) )
 
 
 
49
  return false;
50
 
51
+ $meta = unserialize( get_post_meta($post_id, '_fvp_video', true) );
52
+ $options= get_option( 'fvp-settings' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
53
 
54
+ $size = $this->get_size($size);
55
+ $width = $size[0];
56
+ $height = $size[1];
 
57
 
58
+ $autoplay = is_single() ? '&autoplay='.$options['autoplay'] : '';
 
 
 
59
 
60
  if( isset($meta['id']) && !empty($meta['id']) ) {
61
  switch( $meta['prov'] ) {
62
 
63
  case 'local':
64
+ //$featimg = has_post_thumbnail($post_id) ? wp_get_attachment_url( get_post_thumbnail_id($post_id) ) : '';
65
+
66
+ $a = wp_get_attachment_url($meta['id']);
67
+ $ext = pathinfo( $a, PATHINFO_EXTENSION );
68
+ if( $ext != 'mp4' && $ext != 'ogv' && $ext != 'webm' && $ext != 'ogg' )
69
+ break;
70
 
 
 
71
  $ext = $ext == 'ogv' ? 'ogg' : $ext;
72
+ $embed = "\n\t".'<video class="video-js vjs-default-skin" controls preload="auto" width="'.$width.'" height="'.$height.'" data-setup="{}">'; // poster="'.$featimg.'" data-setup="{}"
73
+ $embed .= "\n\t\t".'<source src="' . $a . '" type="video/'.$ext.'">';
74
 
75
  if( isset($meta['sec_id']) && !empty($meta['sec_id']) ) {
76
+ $b = wp_get_attachment_url($meta['sec_id']);
77
+ $ext2 = pathinfo( $b, PATHINFO_EXTENSION );
78
  $ext2 = $ext2 == 'ogv' ? 'ogg' : $ext2;
79
  if( $ext2 == 'mp4' || $ext2 == 'ogv' || $ext2 == 'webm' || $ext2 == 'ogg' )
80
+ $embed .= "\n\t\t".'<source src="' . $b . '" type="video/'.$ext2.'">';
81
  }
82
 
83
  $embed .= "\n\t</video>\n";
85
 
86
  case 'vimeo':
87
  $options = get_option( 'fvp-settings' );
88
+ $src = 'http://player.vimeo.com/video/'.$meta['id'].'?badge=0&amp;portrait='.$options['vimeo']['portrait'].'&amp;title='.$options['vimeo']['title'].'&amp;byline='.$options['vimeo']['byline'].'&amp;color='.$options['vimeo']['color'].$autoplay;
89
+ $embed = "\n\t" . '<iframe src="'.$src.'" width="'.$width.'" height="'.$height.'" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>' . "\n";
90
  break;
91
 
92
  case 'youtube':
 
93
  $youtube['theme'] = isset($options['youtube']['theme']) ? $options['youtube']['theme'] : 'dark';
94
  $youtube['color'] = isset($options['youtube']['color']) ? $options['youtube']['color'] : 'red';
95
  $youtube['info'] = isset($options['youtube']['info']) ? $options['youtube']['info'] : 1;
96
+ $youtube['logo'] = isset($options['youtube']['logo']) ? $options['youtube']['logo'] : 1;
97
  $youtube['rel'] = isset($options['youtube']['rel']) ? $options['youtube']['rel'] : 1;
98
  $youtube['fs'] = isset($options['youtube']['fs']) ? $options['youtube']['fs'] : 1;
99
 
100
+ $src = 'http://www.youtube.com/embed/'.$meta['id'].'?theme='.$youtube['theme'].'&color='.$youtube['color'].'&showinfo='.$youtube['info'].'&modestbranding='.$youtube['logo'].'&origin='.esc_attr(home_url()).'&rel='.$youtube['rel'].'&fs='.$youtube['fs'].'&start='.$meta['attr'].$autoplay;
101
  $embed = "\n\t" . '<iframe width="'.$width.'" height="'.$height.'" src="'.$src.'" type="text/html" frameborder="0"></iframe>' . "\n";
102
  break;
103
 
107
  $dm['background'] = isset($options['dailymotion']['background']) ? $options['dailymotion']['background'] : '171D1B';
108
  $dm['logo'] = isset($options['dailymotion']['logo']) ? $options['dailymotion']['logo'] : 1;
109
  $dm['hideinfo'] = isset($options['dailymotion']['info']) ? 1-$options['dailymotion']['info'] : 0;
110
+ $dm['syndication'] = isset($options['dailymotion']['syndication']) ? $options['dailymotion']['syndication'] : '';
111
+ $dm['synd'] = !empty($dm['syndication']) ? '&syndication='.$dm['syndication'] : '';
112
+
113
+ $dm['src'] = 'http://www.dailymotion.com/embed/video/'.$meta['id'].'?logo='.$dm['logo'].'&hideInfos='.$dm['hideinfo'].'&foreground=%23'.$dm['foreground'].'&highlight=%23'.$dm['highlight'].'&background=%23'.$dm['background'].$dm['synd'].'&start='.$meta['attr'].$autoplay;
114
  $embed = "\n" . '<iframe width="'.$width.'" height="'.$height.'" src="'.$dm['src'].'" frameborder="0"></iframe>' . "\n";
115
  break;
116
 
129
 
130
  }
131
 
132
+ $containerstyle = isset($options['sizing']['align']) ? ' style="text-align: '.$options['sizing']['align'].'"' : '';
133
  $embed = "<div class=\"featured_video_plus\"{$containerstyle}>{$embed}</div>\n\n";
134
 
135
  $embed = "\n\n<!-- Featured Video Plus v".FVP_VERSION."-->\n" . $embed;
140
  }
141
 
142
  /**
143
+ * Determine featured video size
 
 
 
 
144
  */
145
+ function get_size($size = null) {
146
+ $options = get_option( 'fvp-settings' );
 
 
147
 
148
+ if( !is_array($size) ) {
149
+ if( isset($_wp_additional_image_sizes[$size]) )
150
+ $width = $_wp_additional_image_sizes[$size]['width'];
151
+ elseif( $size == 'thumbnail' || $size == 'thumb' )
152
+ $width = get_option( 'thumbnail_size_w' );
153
+ else if( $size == 'medium' )
154
+ $width = get_option( 'medium_size_w' );
155
+ else if( $size == 'large' )
156
+ $width = get_option( 'large_size_w' );
157
+ elseif( isset($options['sizing']['wmode']) && $options['sizing']['wmode'] == 'fixed' )
158
+ $width = $options['sizing']['width']; // auto width is applied by fitvids JS
159
+ else
160
+ $width = 560;
161
 
162
+ } elseif( !empty( $size[0] ) && is_numeric( $size[0] ) )
163
+ $width = $size[0];
164
+ else
165
+ $width = 560;
166
 
167
+ if( isset($size[1]) && !empty( $size[1] ) && is_numeric( $size[1] ) )
168
+ $height = $size[1];
169
+ else
170
+ $height = $options['sizing']['hmode'] == 'auto' ? round($width / 16 * 9) : $options['sizing']['height'];
171
 
172
+ return array( $width, $height );
173
  }
174
 
175
  /**
176
+ * Gets a post by an meta_key meta_value pair. Returns it's post_id.
177
  *
178
+ * @see http://codex.wordpress.org/Class_Reference/wpdb
179
+ * @see http://dev.mysql.com/doc/refman/5.0/en/regexp.html#operator_regexp
180
  * @since 1.0
181
  *
182
+ * @param string $meta_key which meta_key to look for
183
+ * @param string $meta_value which meta_value to look for
184
  */
185
+ function get_post_by_custom_meta($meta_key, $meta_value) {
186
+ global $wpdb;
187
+ $prepared = $wpdb->prepare(
188
+ "SELECT post_id FROM {$wpdb->postmeta} WHERE meta_key=%s AND meta_value=%s;",
189
+ $meta_key, $meta_value
190
+ );
191
+ return $wpdb->get_var( $prepared );
 
192
  }
193
 
194
  /**
php/settings.php CHANGED
@@ -3,7 +3,7 @@
3
  * Class containing everything regarding plugin settings on media-settings.php
4
  *
5
  * @author ahoereth
6
- * @version 2013/01/09
7
  * @see ../featured_video_plus.php
8
  * @since 1.3
9
  */
@@ -18,10 +18,12 @@ class featured_video_plus_settings {
18
  * @since 1.0
19
  */
20
  function settings_init() {
21
- add_settings_section('fvp-settings-section', 'Featured Videos', array( &$this, 'settings_content' ), 'media');
22
 
23
  add_settings_field('fvp-settings-overwrite', __('Replace Featured Images', 'featured-video-plus'), array( &$this, 'settings_overwrite' ), 'media', 'fvp-settings-section');
 
24
  add_settings_field('fvp-settings-sizing', __('Video Sizing', 'featured-video-plus'), array( &$this, 'settings_sizing' ), 'media', 'fvp-settings-section');
 
25
  //add_settings_field('fvp-settings-videojs', __('VIDEOJS Player Options', 'featured-video-plus'), array( &$this, 'settings_videojs' ), 'media', 'fvp-settings-section');
26
  add_settings_field('fvp-settings-youtube', __('YouTube Player Options', 'featured-video-plus'), array( &$this, 'settings_youtube' ), 'media', 'fvp-settings-section');
27
  add_settings_field('fvp-settings-vimeo', __('Vimeo Player Options', 'featured-video-plus'), array( &$this, 'settings_vimeo' ), 'media', 'fvp-settings-section');
@@ -56,7 +58,9 @@ class featured_video_plus_settings {
56
  $overwrite = isset($options['overwrite']) ? $options['overwrite'] : false;
57
  ?>
58
 
59
- <input type="radio" name="fvp-settings[overwrite]" id="fvp-settings-overwrite-1" value="true" <?php checked( true, $overwrite, true ) ?>/><label for="fvp-settings-overwrite-1">&nbsp;<?php _e('yes', 'featured-video-plus'); ?>&nbsp;<span style="font-style: italic;">(<?php _e('default', 'featured-video-plus'); ?>)</span></label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
 
 
60
  <input type="radio" name="fvp-settings[overwrite]" id="fvp-settings-overwrite-2" value="false" <?php checked( false, $overwrite, true ) ?>/><label for="fvp-settings-overwrite-2">&nbsp;<?php _e('no', 'featured-video-plus'); ?></label>
61
  <p class="description"><?php _e('If a Featured Video is available it can be displayed in place of the Featured Image. Still, a Featured Image is required.', 'featured-video-plus'); ?></p>
62
 
@@ -67,6 +71,25 @@ if( !current_theme_supports('post-thumbnails') )
67
 
68
  }
69
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
70
  /**
71
  * Displays the setting if the plugin should fit the width of the videos automatically or use fixed widths.
72
  *
@@ -79,8 +102,7 @@ if( !current_theme_supports('post-thumbnails') )
79
  $width = isset($options['sizing']['width' ]) ? $options['sizing']['width' ] : 560;
80
  $height= isset($options['sizing']['height']) ? $options['sizing']['height'] : 315;
81
  $wclass= $wmode == 'auto' ? ' fvp_readonly' : '';
82
- $hclass= $hmode == 'auto' ? ' fvp_readonly' : '';
83
- $align = isset($options['sizing']['align']) ? $options['sizing']['align'] : 'left'; ?>
84
 
85
  <span class="fvp_toggle_input">
86
  <label class="fvp_grouplable"><?php _e('Width', 'featured-video-plus'); ?>:</label>
@@ -104,17 +126,23 @@ if( !current_theme_supports('post-thumbnails') )
104
  <p class="description">
105
  <?php _e('When using <code>auto</code> the video will be adjusted to fit it\'s parent element while sticking to it\'s ratio. Using a <code>fixed</code> height and width might result in <em>not so pretty</em> black bars.', 'featured-video-plus'); ?>
106
  </p>
107
- <span class="fvp_toggle_input">
108
- <label class="fvp_grouplable"><?php _e('Align', 'featured-video-plus'); ?>:</label>
109
- <span class="fvp_grouppart1">
110
- <input type="radio" name="fvp-settings[sizing][align]" id="fvp-settings-align-1" value="left" <?php checked( 'left', $align, true ) ?>/><label for="fvp-settings-align-1">&nbsp;<?php _e('left', 'featured-video-plus'); ?></label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
111
- <input type="radio" name="fvp-settings[sizing][align]" id="fvp-settings-align-2" value="center" <?php checked( 'center',$align, true ) ?>/><label for="fvp-settings-align-2">&nbsp;<?php _e('center', 'featured-video-plus'); ?></label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
112
- <input type="radio" name="fvp-settings[sizing][align]" id="fvp-settings-align-2" value="right" <?php checked( 'right', $align, true ) ?>/><label for="fvp-settings-align-3">&nbsp;<?php _e('right', 'featured-video-plus'); ?></label>
113
- </span>
114
- </span>
115
 
116
  <?php }
117
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
118
  /**
119
  * Displays the settings to style the VIDEOJS player.
120
  *
@@ -122,6 +150,8 @@ if( !current_theme_supports('post-thumbnails') )
122
  * @see http://jlofstedt.com/moonify/
123
  * @see http://videojs.com/
124
  * @since 1.3
 
 
125
  */
126
  function settings_videojs() {
127
  $options = get_option( 'fvp-settings' );
@@ -146,15 +176,18 @@ if( !current_theme_supports('post-thumbnails') )
146
  $youtube['theme'] = isset($options['youtube']['theme']) ? $options['youtube']['theme'] : 'dark';
147
  $youtube['color'] = isset($options['youtube']['color']) ? $options['youtube']['color'] : 'red';
148
  $youtube['info'] = isset($options['youtube']['info']) ? $options['youtube']['info'] : 1;
 
149
  $youtube['rel'] = isset($options['youtube']['rel']) ? $options['youtube']['rel'] : 1;
150
  $youtube['fs'] = isset($options['youtube']['fs']) ? $options['youtube']['fs'] : 1; ?>
151
 
152
  <input type="checkbox" name="fvp-settings[youtube][theme]" id="fvp-settings-youtube-theme" value="light" <?php checked( 'light', $youtube['theme'], 1 ) ?>/><label for="fvp-settings-youtube-theme">&nbsp;<?php _e('Light Theme', 'featured-video-plus'); ?></label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
153
- <input type="checkbox" name="fvp-settings[youtube][color]" id="fvp-settings-youtube-color" value="white" <?php checked( 'white', $youtube['color'], 1 ) ?>/><label for="fvp-settings-youtube-color">&nbsp;<?php _e('White Progressbar', 'featured-video-plus'); ?></label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
154
- <input type="checkbox" name="fvp-settings[youtube][info]" id="fvp-settings-youtube-info" value="true" <?php checked( 1, $youtube['info'], 1 ) ?>/><label for="fvp-settings-youtube-info">&nbsp;<?php _e('Show Info', 'featured-video-plus'); ?></label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
155
  <input type="checkbox" name="fvp-settings[youtube][fs]" id="fvp-settings-youtube-fs" value="true" <?php checked( 1, $youtube['fs'], 1 ) ?>/><label for="fvp-settings-youtube-fs">&nbsp;<?php _e('Fullscreen Button', 'featured-video-plus'); ?></label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
156
- <input type="checkbox" name="fvp-settings[youtube][rel]" id="fvp-settings-youtube-rel" value="true" <?php checked( 1, $youtube['rel'], 1 ) ?>/><label for="fvp-settings-youtube-rel">&nbsp;<?php _e('Related Videos', 'featured-video-plus'); ?></label>
157
-
 
 
 
158
  <?php
159
  }
160
 
@@ -200,12 +233,14 @@ if( !current_theme_supports('post-thumbnails') )
200
  $options = get_option( 'fvp-settings' );
201
  $dailymotion['logo'] = isset($options['dailymotion']['logo']) ? $options['dailymotion']['logo'] : 1;
202
  $dailymotion['info'] = isset($options['dailymotion']['info']) ? $options['dailymotion']['info'] : 1;
 
203
  $dailymotion['foreground'] = isset($options['dailymotion']['foreground']) ? $options['dailymotion']['foreground'] : 'f7fffd';
204
  $dailymotion['highlight' ] = isset($options['dailymotion']['highlight' ]) ? $options['dailymotion']['highlight' ] : 'ffc300';
205
  $dailymotion['background'] = isset($options['dailymotion']['background']) ? $options['dailymotion']['background'] : '171d1b'; ?>
206
 
207
- <input type="checkbox" name="fvp-settings[dailymotion][logo]" id="fvp-settings-dailymotion-logo" value="display" <?php checked( 1, $dailymotion['logo'], 1 ) ?>/><label for="fvp-settings-dailymotion-logo">&nbsp;<?php _e('Logo', 'featured-video-plus'); ?></label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
208
- <input type="checkbox" name="fvp-settings[dailymotion][info]" id="fvp-settings-dailymotion-info" value="display" <?php checked( 1, $dailymotion['info'], 1 ) ?>/><label for="fvp-settings-dailymotion-info">&nbsp;<?php _e('Videoinfo', 'featured-video-plus'); ?></label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
 
209
  <br />
210
  <span class="color-picker" style="position: relative;<?php if( wp_style_is( 'wp-color-picker', 'done' ) ) echo ' top: .6em;'; ?>" >
211
  <input type="text" name="fvp-settings[dailymotion][foreground]" id="fvp-settings-dailymotion-foreground" value="#<?php echo $dailymotion['foreground'] ?>" data-default-color="#f7fffd" />
@@ -222,6 +257,7 @@ if( !current_theme_supports('post-thumbnails') )
222
  <label for="fvp-settings-dailymotion-background" style="display: none;">&nbsp;<?php _e('Background', 'featured-video-plus'); ?></label>
223
  <?php if( !wp_style_is('wp-color-picker', 'registered' ) ) { ?><div class="fvp_colorpicker" id="fvp-settings-dailymotion-background-colorpicker"></div><?php } ?>
224
  </span>
 
225
  <?php
226
  }
227
 
@@ -230,15 +266,23 @@ if( !current_theme_supports('post-thumbnails') )
230
  *
231
  * @since 1.0
232
  */
233
- function settings_rate() { ?>
234
-
235
- <p>
236
- <?php _e('Found a bug or <strong>missing a specific video service</strong>?', 'featured-video-plus'); ?>
237
- <a href="http://wordpress.org/extend/plugins/featured-video/" title="Featured Video Plus Support Forum on wordpress.org" style="font-weight: bold;">Leave a note</a> in the support forum!<br />
238
- <?php _e('Do you like the plugin?', 'featured-video-plus'); ?>&nbsp;<a href="http://wordpress.org/extend/plugins/featured-video-plus/" title="Featured Video Plus on wordpress.org" style="font-weight: bold;"><?php _e('rate it', 'featured-video-plus'); ?></a>.
239
- </p>
 
 
 
 
 
 
 
 
240
 
241
- <?php }
242
 
243
  /**
244
  * Function through which all settings are passed before they are saved. Validate the data.
@@ -250,17 +294,26 @@ if( !current_theme_supports('post-thumbnails') )
250
  $numbers = '#[0-9]{1,4}#';
251
  $options = get_option( 'fvp-settings' );
252
 
253
- // General
254
  $options['overwrite'] = isset($input['overwrite']) && $input['overwrite'] == 'true' ? true : false;
255
 
256
  // Sizing
257
- preg_match($numbers, $input['sizing']['width' ]['fixed'], $width );
258
- preg_match($numbers, $input['sizing']['height']['fixed'], $height);
259
- $options['sizing']['width' ] = isset($width[ 0]) ? $width[ 0] : 560;
260
- $options['sizing']['height'] = isset($height[0]) ? $height[0] : 315;
 
 
 
 
261
  $options['sizing']['wmode' ] = isset($input['sizing']['width' ]['auto'])? 'auto' : 'fixed';
262
  $options['sizing']['hmode' ] = isset($input['sizing']['height' ]['auto'])? 'auto' : 'fixed';
263
- $options['sizing']['align' ] = isset($input['sizing']['align']) ? $input['sizing']['align'] : 'left';
 
 
 
 
 
264
 
265
  // VIDEOJS
266
  //$options['videojs']['skin'] = isset( $input['videojs']['skin'] ) ? $input['videojs']['skin'] : 'videojs';
@@ -269,6 +322,7 @@ if( !current_theme_supports('post-thumbnails') )
269
  $options['youtube']['theme'] = isset($input['youtube']['theme']) && ( $input['youtube']['theme'] == 'light' ) ? 'light' : 'dark';
270
  $options['youtube']['color'] = isset($input['youtube']['color']) && ( $input['youtube']['color'] == 'white' ) ? 'white' : 'red';
271
  $options['youtube']['info'] = isset($input['youtube']['info']) && ( $input['youtube']['info'] == 'true' ) ? 1 : 0;
 
272
  $options['youtube']['rel'] = isset($input['youtube']['rel']) && ( $input['youtube']['rel'] == 'true' ) ? 1 : 0;
273
  $options['youtube']['fs'] = isset($input['youtube']['fs']) && ( $input['youtube']['fs'] == 'true' ) ? 1 : 0;
274
 
@@ -276,19 +330,28 @@ if( !current_theme_supports('post-thumbnails') )
276
  $options['vimeo']['portrait'] = isset($input['vimeo']['portrait'])&& ( $input['vimeo']['portrait'] == 'display' ) ? 1 : 0;
277
  $options['vimeo']['title'] = isset($input['vimeo']['title']) && ( $input['vimeo']['title'] == 'display' ) ? 1 : 0;
278
  $options['vimeo']['byline'] = isset($input['vimeo']['byline']) && ( $input['vimeo']['byline'] == 'display' ) ? 1 : 0;
 
279
  if( isset($options['vimeo']['color']) ) preg_match($hexcolor, $input['vimeo']['color'], $vimeocolor);
280
  $options['vimeo']['color'] = isset($vimeocolor[1]) && !empty($vimeocolor[1]) ? $vimeocolor[1] : '00adef';
281
 
282
  // Dailymotion
283
  $options['dailymotion']['logo'] = isset($input['dailymotion']['logo']) && ( $input['dailymotion']['logo'] == 'display' ) ? 1 : 0;
284
  $options['dailymotion']['info'] = isset($input['dailymotion']['info']) && ( $input['dailymotion']['info'] == 'display' ) ? 1 : 0;
 
 
285
  if( isset($options['dailymotion']['foreground']) ) preg_match($hexcolor, $input['dailymotion']['foreground'], $dm_foreground);
286
- $options['dailymotion']['foreground'] = isset($dm_foreground[1]) && !empty($dm_foreground[1])? $dm_foreground[1] : 'f7fffd';
287
  if( isset($options['dailymotion']['highlight']) ) preg_match($hexcolor, $input['dailymotion']['highlight'], $dm_highlight);
288
- $options['dailymotion']['highlight'] = isset($dm_highlight[1]) && !empty($dm_highlight[1]) ? $dm_highlight[1] : 'ffc300';
289
  if( isset($options['dailymotion']['background']) ) preg_match($hexcolor, $input['dailymotion']['background'], $dm_background);
 
 
290
  $options['dailymotion']['background'] = isset($dm_background[1]) && !empty($dm_background[1])? $dm_background[1] : '171d1b';
291
 
 
 
 
 
 
 
292
  return $options;
293
  }
294
 
@@ -301,29 +364,37 @@ if( !current_theme_supports('post-thumbnails') )
301
  $this->help_shortcode = '
302
  <ul>
303
  <li>
304
- <code>[featured-video]</code><br />
305
  <span style="padding-left: 5px;">'.__('Displays the video in its default size.', 'featured-video-plus').'</span>
306
  </li>
307
  <li>
308
- <code>[featured-video width=560]</code><br />
309
  <span style="padding-left: 5px;">'.__('Displays the video with an width of 300 pixel. Height will be fitted to the aspect ratio.', 'featured-video-plus').'</span>
310
  </li>
311
  <li>
312
- <code>[featured-video width=560 height=315]</code><br />
313
  <span style="padding-left: 5px;">'.__('Displays the video with an fixed width and height.', 'featured-video-plus').'</span>
314
  </li>
315
  </ul>'."\n";
316
 
317
  $this->help_functions ='
318
- <ul>
319
- <li><code>the_post_video(array(width, height))</code></li>
320
- <li><code>has_post_video(post_id = null)</code></li>
321
- <li><code>get_the_post_video(post_id = null, array(width, height))</code></li>
 
 
322
  </ul>
323
  <p>
324
- '.sprintf(__('All parameters are optional. If %s the current post\'s id will be used.', 'featured-video-plus'), '<code>post_id == null</code>').'<br />
325
- '.sprintf(__('The functions are implemented corresponding to the original %sFeatured Image functions%s: They are intended to be used and to act the same way.', 'featured-video-plus'), '<a href="http://codex.wordpress.org/Post_Thumbnails#Function_Reference" title="Post Thumbnails Function Reference">', '</a>').'
326
- </p>'."\n";
 
 
 
 
 
 
327
  }
328
 
329
  /**
3
  * Class containing everything regarding plugin settings on media-settings.php
4
  *
5
  * @author ahoereth
6
+ * @version 2013/02/12
7
  * @see ../featured_video_plus.php
8
  * @since 1.3
9
  */
18
  * @since 1.0
19
  */
20
  function settings_init() {
21
+ add_settings_section('fvp-settings-section', __('Featured Videos', 'featured-video-plus'), array( &$this, 'settings_content' ), 'media');
22
 
23
  add_settings_field('fvp-settings-overwrite', __('Replace Featured Images', 'featured-video-plus'), array( &$this, 'settings_overwrite' ), 'media', 'fvp-settings-section');
24
+ add_settings_field('fvp-settings-autoplay', __('Autoplay', 'featured-video-plus'), array( &$this, 'settings_autoplay' ), 'media', 'fvp-settings-section');
25
  add_settings_field('fvp-settings-sizing', __('Video Sizing', 'featured-video-plus'), array( &$this, 'settings_sizing' ), 'media', 'fvp-settings-section');
26
+ add_settings_field('fvp-settings-align', __('Video Align', 'featured-video-plus'), array( &$this, 'settings_align' ), 'media', 'fvp-settings-section');
27
  //add_settings_field('fvp-settings-videojs', __('VIDEOJS Player Options', 'featured-video-plus'), array( &$this, 'settings_videojs' ), 'media', 'fvp-settings-section');
28
  add_settings_field('fvp-settings-youtube', __('YouTube Player Options', 'featured-video-plus'), array( &$this, 'settings_youtube' ), 'media', 'fvp-settings-section');
29
  add_settings_field('fvp-settings-vimeo', __('Vimeo Player Options', 'featured-video-plus'), array( &$this, 'settings_vimeo' ), 'media', 'fvp-settings-section');
58
  $overwrite = isset($options['overwrite']) ? $options['overwrite'] : false;
59
  ?>
60
 
61
+ <span class="fvp_radio_bumper">
62
+ <input type="radio" name="fvp-settings[overwrite]" id="fvp-settings-overwrite-1" value="true" <?php checked( true, $overwrite, true ) ?>/><label for="fvp-settings-overwrite-1">&nbsp;<?php _e('yes', 'featured-video-plus'); ?>&nbsp;<span style="font-style: italic;">(<?php _e('default', 'featured-video-plus'); ?>)</span></label>
63
+ </span>
64
  <input type="radio" name="fvp-settings[overwrite]" id="fvp-settings-overwrite-2" value="false" <?php checked( false, $overwrite, true ) ?>/><label for="fvp-settings-overwrite-2">&nbsp;<?php _e('no', 'featured-video-plus'); ?></label>
65
  <p class="description"><?php _e('If a Featured Video is available it can be displayed in place of the Featured Image. Still, a Featured Image is required.', 'featured-video-plus'); ?></p>
66
 
71
 
72
  }
73
 
74
+
75
+ /**
76
+ * Displays the setting if videos should autoplay when a single post/page is being viewed.
77
+ *
78
+ * @since 1.4
79
+ */
80
+ function settings_autoplay() {
81
+ $options = get_option( 'fvp-settings' );
82
+ $autoplay = isset($options['autoplay']) ? $options['autoplay'] : 0;
83
+ ?>
84
+
85
+ <span class="fvp_radio_bumper">
86
+ <input type="radio" name="fvp-settings[autoplay]" id="fvp-settings-autoplay-1" value="true" <?php checked( 1, $autoplay ) ?>/><label for="fvp-settings-autoplay-1">&nbsp;<?php _e('yes', 'featured-video-plus'); ?></label>
87
+ </span>
88
+ <input type="radio" name="fvp-settings[autoplay]" id="fvp-settings-autoplay-2" value="false" <?php checked( 0, $autoplay ) ?>/><label for="fvp-settings-autoplay-2">&nbsp;<?php _e('no', 'featured-video-plus'); ?>&nbsp;<span style="font-style: italic;">(<?php _e('default', 'featured-video-plus'); ?>)</span></label>
89
+ <p class="description"><?php _e('YouTube, Vimeo and Dailymotion videos can autoplay when a single post/page is being viewed.', 'featured-video-plus'); ?></p>
90
+
91
+ <?php }
92
+
93
  /**
94
  * Displays the setting if the plugin should fit the width of the videos automatically or use fixed widths.
95
  *
102
  $width = isset($options['sizing']['width' ]) ? $options['sizing']['width' ] : 560;
103
  $height= isset($options['sizing']['height']) ? $options['sizing']['height'] : 315;
104
  $wclass= $wmode == 'auto' ? ' fvp_readonly' : '';
105
+ $hclass= $hmode == 'auto' ? ' fvp_readonly' : ''; ?>
 
106
 
107
  <span class="fvp_toggle_input">
108
  <label class="fvp_grouplable"><?php _e('Width', 'featured-video-plus'); ?>:</label>
126
  <p class="description">
127
  <?php _e('When using <code>auto</code> the video will be adjusted to fit it\'s parent element while sticking to it\'s ratio. Using a <code>fixed</code> height and width might result in <em>not so pretty</em> black bars.', 'featured-video-plus'); ?>
128
  </p>
 
 
 
 
 
 
 
 
129
 
130
  <?php }
131
 
132
+ /**
133
+ * How should the videos be aligned? Only interesting when wmode is set to fixed.
134
+ * Feature integrated in 1.3, got it own function in 1.4
135
+ *
136
+ * @since 1.4
137
+ */
138
+ function settings_align() {
139
+ $align = isset($options['align']) ? $options['align'] : 'center'; ?>
140
+
141
+ <input type="radio" name="fvp-settings[align]" id="fvp-settings-align-1" value="left" <?php checked( 'left', $align, true ) ?>/><label for="fvp-settings-align-1">&nbsp;<?php _e('left', 'featured-video-plus'); ?></label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
142
+ <input type="radio" name="fvp-settings[align]" id="fvp-settings-align-2" value="center" <?php checked( 'center',$align, true ) ?>/><label for="fvp-settings-align-2">&nbsp;<?php _e('center', 'featured-video-plus'); ?>&nbsp;<span style="font-style: italic;">(<?php _e('default', 'featured-video-plus'); ?>)</span></label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
143
+ <input type="radio" name="fvp-settings[align]" id="fvp-settings-align-3" value="right" <?php checked( 'right', $align, true ) ?>/><label for="fvp-settings-align-3">&nbsp;<?php _e('right', 'featured-video-plus'); ?></label>
144
+
145
+ <?php }
146
  /**
147
  * Displays the settings to style the VIDEOJS player.
148
  *
150
  * @see http://jlofstedt.com/moonify/
151
  * @see http://videojs.com/
152
  * @since 1.3
153
+ *
154
+ * NOTE: NOT IN USE YET!
155
  */
156
  function settings_videojs() {
157
  $options = get_option( 'fvp-settings' );
176
  $youtube['theme'] = isset($options['youtube']['theme']) ? $options['youtube']['theme'] : 'dark';
177
  $youtube['color'] = isset($options['youtube']['color']) ? $options['youtube']['color'] : 'red';
178
  $youtube['info'] = isset($options['youtube']['info']) ? $options['youtube']['info'] : 1;
179
+ $youtube['logo'] = isset($options['youtube']['logo']) ? $options['youtube']['logo'] : 1;
180
  $youtube['rel'] = isset($options['youtube']['rel']) ? $options['youtube']['rel'] : 1;
181
  $youtube['fs'] = isset($options['youtube']['fs']) ? $options['youtube']['fs'] : 1; ?>
182
 
183
  <input type="checkbox" name="fvp-settings[youtube][theme]" id="fvp-settings-youtube-theme" value="light" <?php checked( 'light', $youtube['theme'], 1 ) ?>/><label for="fvp-settings-youtube-theme">&nbsp;<?php _e('Light Theme', 'featured-video-plus'); ?></label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
184
+ <input type="checkbox" name="fvp-settings[youtube][info]" id="fvp-settings-youtube-info" value="true" <?php checked( 1, $youtube['info'], 1 ) ?>/><label for="fvp-settings-youtube-info">&nbsp;<?php _e('Info', 'featured-video-plus'); ?></label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
 
185
  <input type="checkbox" name="fvp-settings[youtube][fs]" id="fvp-settings-youtube-fs" value="true" <?php checked( 1, $youtube['fs'], 1 ) ?>/><label for="fvp-settings-youtube-fs">&nbsp;<?php _e('Fullscreen Button', 'featured-video-plus'); ?></label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
186
+ <input type="checkbox" name="fvp-settings[youtube][rel]" id="fvp-settings-youtube-rel" value="true" <?php checked( 1, $youtube['rel'], 1 ) ?>/><label for="fvp-settings-youtube-rel">&nbsp;<?php _e('Related Videos', 'featured-video-plus'); ?></label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
187
+ <input type="checkbox" name="fvp-settings[youtube][color]" id="fvp-settings-youtube-color" value="white" <?php checked( 'white', $youtube['color'], 1 ) ?>/><label for="fvp-settings-youtube-color">&nbsp;<?php _e('White Progressbar', 'featured-video-plus'); ?></label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
188
+ <span id="youtube_logoinput_wrapper"<?php if($youtube['color'] != 'red') echo ' class="fvp_hidden"'; ?>>
189
+ <input type="checkbox" name="fvp-settings[youtube][logo]" id="fvp-settings-youtube-logo" value="true" <?php checked( 1, $youtube['logo'], 1 ) ?>/><label for="fvp-settings-youtube-logo">&nbsp;<?php _e('Logo', 'featured-video-plus'); ?></label>
190
+ </span>
191
  <?php
192
  }
193
 
233
  $options = get_option( 'fvp-settings' );
234
  $dailymotion['logo'] = isset($options['dailymotion']['logo']) ? $options['dailymotion']['logo'] : 1;
235
  $dailymotion['info'] = isset($options['dailymotion']['info']) ? $options['dailymotion']['info'] : 1;
236
+ $dailymotion['synd'] = isset($options['dailymotion']['synd']) ? $options['dailymotion']['syndication']: '';
237
  $dailymotion['foreground'] = isset($options['dailymotion']['foreground']) ? $options['dailymotion']['foreground'] : 'f7fffd';
238
  $dailymotion['highlight' ] = isset($options['dailymotion']['highlight' ]) ? $options['dailymotion']['highlight' ] : 'ffc300';
239
  $dailymotion['background'] = isset($options['dailymotion']['background']) ? $options['dailymotion']['background'] : '171d1b'; ?>
240
 
241
+ <input type="checkbox" name="fvp-settings[dailymotion][logo]" id="fvp-settings-dailymotion-logo" value="display" <?php checked( 1, $dailymotion['logo'], 1 ) ?>/> <label for="fvp-settings-dailymotion-logo">&nbsp;<?php _e('Logo', 'featured-video-plus'); ?></label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
242
+ <input type="checkbox" name="fvp-settings[dailymotion][info]" id="fvp-settings-dailymotion-info" value="display" <?php checked( 1, $dailymotion['info'], 1 ) ?>/> <label for="fvp-settings-dailymotion-info">&nbsp;<?php _e('Videoinfo', 'featured-video-plus'); ?></label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
243
+ <input type="text" name="fvp-settings[dailymotion][synd]" id="fvp-settings-dailymotion-synd" value="<?php echo $dailymotion['synd']; ?>" size="6" /> <label for="fvp-settings-dailymotion-synd">&nbsp;<?php _e('Syndication Key', 'featured-video-plus'); ?></label>
244
  <br />
245
  <span class="color-picker" style="position: relative;<?php if( wp_style_is( 'wp-color-picker', 'done' ) ) echo ' top: .6em;'; ?>" >
246
  <input type="text" name="fvp-settings[dailymotion][foreground]" id="fvp-settings-dailymotion-foreground" value="#<?php echo $dailymotion['foreground'] ?>" data-default-color="#f7fffd" />
257
  <label for="fvp-settings-dailymotion-background" style="display: none;">&nbsp;<?php _e('Background', 'featured-video-plus'); ?></label>
258
  <?php if( !wp_style_is('wp-color-picker', 'registered' ) ) { ?><div class="fvp_colorpicker" id="fvp-settings-dailymotion-background-colorpicker"></div><?php } ?>
259
  </span>
260
+ <br />
261
  <?php
262
  }
263
 
266
  *
267
  * @since 1.0
268
  */
269
+ function settings_rate() {
270
+ $options = get_option( 'fvp-settings' );
271
+ $optout = isset($options['out']) ? $options['out'] : false;
272
+ echo '<p>';
273
+ printf(
274
+ __('If you have found a bug or are missing a specific video service, please %slet me know%s in the support forum. Elsewise, if you like the plugin: Please %srate it!%s', 'featured-video-plus'),
275
+ '<a href="http://wordpress.org/support/plugin/featured-video-plus#plugin-title" title="Featured Video Plus Support Forum on WordPress.org" target="_blank" style="font-weight: bold;">', '</a>',
276
+ '<a href="http://wordpress.org/support/view/plugin-reviews/featured-video-plus#plugin-title" title="Rate Featured Video Plus on WordPress.org" target="_blank" style="font-weight: bold;">', '</a>'
277
+ );
278
+ echo '</p>';
279
+ echo '<p>';
280
+ _e('The plugin logs it\'s version, the WordPress version and WordPress language for internal statistics. Those help for future plugin development.', 'featured-video-plus');
281
+ echo '<br />';
282
+ _e('No personal user information is being collected. Still, you can easily Opt-Out and have the data deleted:', 'featured-video-plus');
283
+ echo '&nbsp;<input type="checkbox" name="fvp-settings[out]" id="fvp-settings-out" value="true"'.checked( 1, $optout, false ).' />';
284
 
285
+ }
286
 
287
  /**
288
  * Function through which all settings are passed before they are saved. Validate the data.
294
  $numbers = '#[0-9]{1,4}#';
295
  $options = get_option( 'fvp-settings' );
296
 
297
+ // Overwrite
298
  $options['overwrite'] = isset($input['overwrite']) && $input['overwrite'] == 'true' ? true : false;
299
 
300
  // Sizing
301
+ if(isset($input['sizing']['width' ]['fixed'])) {
302
+ preg_match($numbers, $input['sizing']['width' ]['fixed'], $width );
303
+ $options['sizing']['width' ] = isset($width[ 0]) ? $width[ 0] : 560;
304
+ }
305
+ if(isset($input['sizing']['height' ]['fixed'])) {
306
+ preg_match($numbers, $input['sizing']['height']['fixed'], $height);
307
+ $options['sizing']['height'] = isset($height[0]) ? $height[0] : 315;
308
+ }
309
  $options['sizing']['wmode' ] = isset($input['sizing']['width' ]['auto'])? 'auto' : 'fixed';
310
  $options['sizing']['hmode' ] = isset($input['sizing']['height' ]['auto'])? 'auto' : 'fixed';
311
+
312
+ // Align
313
+ $options['align' ] = isset($input['align']) ? $input['align'] : 'center';
314
+
315
+ // Autoplay
316
+ $options['autoplay'] = isset($input['autoplay']) && $input['autoplay'] == 'true' ? 1 : 0;
317
 
318
  // VIDEOJS
319
  //$options['videojs']['skin'] = isset( $input['videojs']['skin'] ) ? $input['videojs']['skin'] : 'videojs';
322
  $options['youtube']['theme'] = isset($input['youtube']['theme']) && ( $input['youtube']['theme'] == 'light' ) ? 'light' : 'dark';
323
  $options['youtube']['color'] = isset($input['youtube']['color']) && ( $input['youtube']['color'] == 'white' ) ? 'white' : 'red';
324
  $options['youtube']['info'] = isset($input['youtube']['info']) && ( $input['youtube']['info'] == 'true' ) ? 1 : 0;
325
+ $options['youtube']['logo'] = isset($input['youtube']['logo']) && ( $input['youtube']['logo'] == 'true' ) ? 1 : 0;
326
  $options['youtube']['rel'] = isset($input['youtube']['rel']) && ( $input['youtube']['rel'] == 'true' ) ? 1 : 0;
327
  $options['youtube']['fs'] = isset($input['youtube']['fs']) && ( $input['youtube']['fs'] == 'true' ) ? 1 : 0;
328
 
330
  $options['vimeo']['portrait'] = isset($input['vimeo']['portrait'])&& ( $input['vimeo']['portrait'] == 'display' ) ? 1 : 0;
331
  $options['vimeo']['title'] = isset($input['vimeo']['title']) && ( $input['vimeo']['title'] == 'display' ) ? 1 : 0;
332
  $options['vimeo']['byline'] = isset($input['vimeo']['byline']) && ( $input['vimeo']['byline'] == 'display' ) ? 1 : 0;
333
+
334
  if( isset($options['vimeo']['color']) ) preg_match($hexcolor, $input['vimeo']['color'], $vimeocolor);
335
  $options['vimeo']['color'] = isset($vimeocolor[1]) && !empty($vimeocolor[1]) ? $vimeocolor[1] : '00adef';
336
 
337
  // Dailymotion
338
  $options['dailymotion']['logo'] = isset($input['dailymotion']['logo']) && ( $input['dailymotion']['logo'] == 'display' ) ? 1 : 0;
339
  $options['dailymotion']['info'] = isset($input['dailymotion']['info']) && ( $input['dailymotion']['info'] == 'display' ) ? 1 : 0;
340
+ $options['dailymotion']['syndication'] = isset($input['dailymotion']['synd']) && !empty($input['dailymotion']['synd']) ? $input['dailymotion']['synd'] : '';
341
+
342
  if( isset($options['dailymotion']['foreground']) ) preg_match($hexcolor, $input['dailymotion']['foreground'], $dm_foreground);
 
343
  if( isset($options['dailymotion']['highlight']) ) preg_match($hexcolor, $input['dailymotion']['highlight'], $dm_highlight);
 
344
  if( isset($options['dailymotion']['background']) ) preg_match($hexcolor, $input['dailymotion']['background'], $dm_background);
345
+ $options['dailymotion']['foreground'] = isset($dm_foreground[1]) && !empty($dm_foreground[1])? $dm_foreground[1] : 'f7fffd';
346
+ $options['dailymotion']['highlight'] = isset($dm_highlight[ 1]) && !empty($dm_highlight[ 1])? $dm_highlight[ 1] : 'ffc300';
347
  $options['dailymotion']['background'] = isset($dm_background[1]) && !empty($dm_background[1])? $dm_background[1] : '171d1b';
348
 
349
+ // Opt-Out
350
+ if( isset($input['out']) && $input['out'] == 'true' && !$options['out'] )
351
+ $options = $GLOBALS['featured_video_plus_backend']->featured_video_plus_notify($options, 1 );
352
+ elseif( !isset($input['out']) && isset($options['out']) && $options['out'] )
353
+ $options = $GLOBALS['featured_video_plus_backend']->featured_video_plus_notify($options, 0 );
354
+
355
  return $options;
356
  }
357
 
364
  $this->help_shortcode = '
365
  <ul>
366
  <li>
367
+ <code>[featured-video-plus]</code><br />
368
  <span style="padding-left: 5px;">'.__('Displays the video in its default size.', 'featured-video-plus').'</span>
369
  </li>
370
  <li>
371
+ <code>[featured-video-plus width=560]</code><br />
372
  <span style="padding-left: 5px;">'.__('Displays the video with an width of 300 pixel. Height will be fitted to the aspect ratio.', 'featured-video-plus').'</span>
373
  </li>
374
  <li>
375
+ <code>[featured-video-plus width=560 height=315]</code><br />
376
  <span style="padding-left: 5px;">'.__('Displays the video with an fixed width and height.', 'featured-video-plus').'</span>
377
  </li>
378
  </ul>'."\n";
379
 
380
  $this->help_functions ='
381
+ <ul class="fvp_code_list">
382
+ <li><code>the_post_video( $size )</code></li>
383
+ <li><code>has_post_video( $post_id )</code></li>
384
+ <li><code>get_the_post_video( $post_id, $size )</code></li>
385
+ <li><code>get_the_post_video_image_url( $post_id )</code></li>
386
+ <li><code>get_the_post_video_image( $post_id )</code></li>
387
  </ul>
388
  <p>
389
+ '.sprintf(__('All parameters are optional. If %s the current post\'s id will be used. %s is either a string keyword (thumbnail, medium, large or full) or a 2-item array representing width and height in pixels, e.g. array(32,32).', 'featured-video-plus'), '<code>post_id == null</code>', '<code>$size</code>').'<br />
390
+ </p>
391
+ <p style="margin-bottom: 0;">
392
+ '.sprintf(__('The functions are implemented corresponding to the original %sfunctions%s: They are intended to be used and to act the same way. Take a look into the WordPress Codex for further guidance:', 'featured-video-plus'), '<a href="http://codex.wordpress.org/Post_Thumbnails#Function_Reference" target="_blank">'.__('Featured Image').'&nbsp;', '</a>').'
393
+ </p>
394
+ <ul class="fvp_code_list" style="margin-top: 0;">
395
+ <li><code><a href="http://codex.wordpress.org/Function_Reference/the_post_thumbnail" target="_blank">get_the_post_thumbnail</a></code></li>
396
+ <li><code><a href="http://codex.wordpress.org/Function_Reference/wp_get_attachment_image" target="_blank">wp_get_attachment_image</a></code></li>
397
+ </ul>'."\n";
398
  }
399
 
400
  /**
php/upgrade.php CHANGED
@@ -5,9 +5,9 @@
5
  * @since 1.2
6
  */
7
  function featured_video_plus_upgrade() {
8
- $options = $options_org = get_option( 'fvp-settings', 'none' );
9
 
10
- if( !isset($options) || $options == 'none')
11
  $version = '0';
12
  elseif( !isset($options['version']) )
13
  $version = '1.1';
@@ -21,13 +21,13 @@ function featured_video_plus_upgrade() {
21
 
22
  $options = array(
23
  'overwrite' => true,
24
- 'width' => 'auto',
25
- 'height' => 'auto',
26
- 'vimeo' => array(
27
- 'portrait' => 0,
28
- 'title' => 1,
29
- 'byline' => 1,
30
- 'color' => '00adef'
31
  )
32
  );
33
 
@@ -48,8 +48,6 @@ function featured_video_plus_upgrade() {
48
  case '1.2':
49
  $notice = isset($notice) ? $notice : 'upgrade_12';
50
 
51
- $options['notice'] = $notice;
52
- $options['reged'] = false;
53
  $options['videojs'] = array(
54
  'skin' => 'videojs' //videojs,moonfy,tubejs
55
  );
@@ -61,42 +59,47 @@ function featured_video_plus_upgrade() {
61
  'fs' => 1
62
  );
63
  $options['dailymotion'] = array(
64
- 'foreground' => 'F7FFFD',
65
- 'highlight' => 'FFC300',
66
- 'background' => '171D1B',
67
- 'logo' => 1,
68
- 'info' => 1
69
  );
70
  $options['sizing'] = array(
71
- 'wmode' => $options['width'],
72
- 'hmode' => $options['height'],
73
- 'width' => 560,
74
- 'height' => 315,
75
- 'align' => 'left'
76
  );
77
  unset( $options['width'], $options['height'] );
78
 
 
 
79
 
80
- // this has to be refreshed in every version, stays last
81
- $options['version'] = FVP_VERSION;
82
- break;
 
 
 
 
 
 
 
 
 
83
  }
84
 
85
  $featured_video_plus_notices = new featured_video_plus_notices();
86
  add_action('admin_notices', array( &$featured_video_plus_notices, $notice ) );
87
  }
88
 
89
- // Logs Plugin Version, WordPress Version, WordPress Language once.
90
- // Less than WordPress.org, but much more informative for future development
91
- if( !isset($options['reged']) || !$options['reged'] || ($version != FVP_VERSION) ) {
92
- $options['reged'] = false;
93
- $response = wp_remote_post( 'http://fvp.ahoereth.yrnxt.com/fvp_reg.php', array('body' => array( 'fvp_version' => FVP_VERSION, 'wp_version' => get_bloginfo('version'), 'wp_language' => get_bloginfo('language'), 'fvp_notice' => isset($options['notice']) ? $options['notice'] : 'initial_activation' )));
94
- if( !is_wp_error( $response ) && ($response['body'] == 'success.') )
95
- $options['reged'] = true;
96
- }
97
 
98
  if( $options != $options_org )
99
  update_option( 'fvp-settings', $options );
 
100
  }
101
 
102
  /**
@@ -108,6 +111,27 @@ function featured_video_plus_upgrade() {
108
  * @since 1.2
109
  */
110
  class featured_video_plus_notices {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
111
 
112
  /**
113
  * Upgrade notification 1.2 to current version
@@ -116,7 +140,7 @@ class featured_video_plus_notices {
116
  */
117
  function upgrade_12() {
118
  echo "\n" . '<div class="updated" id="fvp_activation_notification"><p>';
119
- printf(__('Featured Video Plus was <strong>upgraded</strong>.', 'featured-video-plus').'&nbsp'.__('%s features more customization settings, internationalization, better error handling and experimental LiveLeak integration.', 'featured-video-plus').'&nbsp;'.__('If you like the plugin, please %srate it%s.', 'featured-video-plus'), '<strong>Version&nbsp;'.FVP_VERSION.'</strong>', '<a href="http://wordpress.org/extend/plugins/featured-video-plus/" target="_blank">', '</a>');
120
  echo "</p></div>\n";
121
  }
122
 
@@ -127,7 +151,7 @@ class featured_video_plus_notices {
127
  */
128
  function upgrade_11() {
129
  echo "\n" . '<div class="updated" id="fvp_activation_notification"><p>';
130
- printf(__('Featured Video Plus was <strong>upgraded</strong>.', 'featured-video-plus').'&nbsp;'.__('%s now supports <strong>Local Videos</strong>, LiveLeak integration (experimental), many more customization settings and better error handling.', 'featured-video-plus').'&nbsp;'.__('If you like the plugin, please %srate it%s.', 'featured-video-plus'), '<strong>Version&nbsp;'.FVP_VERSION.'</strong>', '<a href="http://wordpress.org/extend/plugins/featured-video-plus/" traget="_blank">','</a>');
131
  echo "</p></div>\n";
132
  }
133
 
5
  * @since 1.2
6
  */
7
  function featured_video_plus_upgrade() {
8
+ $options = $options_org = get_option( 'fvp-settings' );
9
 
10
+ if( !isset($options['overwrite']) )
11
  $version = '0';
12
  elseif( !isset($options['version']) )
13
  $version = '1.1';
21
 
22
  $options = array(
23
  'overwrite' => true,
24
+ 'width' => 'auto',
25
+ 'height' => 'auto',
26
+ 'vimeo' => array(
27
+ 'portrait' => 0,
28
+ 'title' => 1,
29
+ 'byline' => 1,
30
+ 'color' => '00adef'
31
  )
32
  );
33
 
48
  case '1.2':
49
  $notice = isset($notice) ? $notice : 'upgrade_12';
50
 
 
 
51
  $options['videojs'] = array(
52
  'skin' => 'videojs' //videojs,moonfy,tubejs
53
  );
59
  'fs' => 1
60
  );
61
  $options['dailymotion'] = array(
62
+ 'foreground' => 'F7FFFD',
63
+ 'highlight' => 'FFC300',
64
+ 'background' => '171D1B',
65
+ 'logo' => 1,
66
+ 'info' => 1
67
  );
68
  $options['sizing'] = array(
69
+ 'wmode' => $options['width'],
70
+ 'hmode' => $options['height'],
71
+ 'width' => 560,
72
+ 'height' => 315,
73
+ 'align' => 'left'
74
  );
75
  unset( $options['width'], $options['height'] );
76
 
77
+ case '1.3':
78
+ $notice = isset($notice) ? $notice : 'upgrade_13';
79
 
80
+ $options['autoplay'] = 0;
81
+ $options['youtube']['logo'] = 1;
82
+ $options['dailymotion']['syndication'] = '';
83
+ $options['out'] = 0;
84
+
85
+ $options['align'] = $options['sizing']['wmode'] == 'auto' ? 'center' : $options['sizing']['align'];
86
+ unset( $options['sizing']['align'] );
87
+
88
+ // *************************************************************
89
+ $options['version'] = FVP_VERSION;
90
+ $options['reged' ] = false;
91
+ break;
92
  }
93
 
94
  $featured_video_plus_notices = new featured_video_plus_notices();
95
  add_action('admin_notices', array( &$featured_video_plus_notices, $notice ) );
96
  }
97
 
98
+ $options = $GLOBALS['featured_video_plus_backend']->featured_video_plus_notify($options);
 
 
 
 
 
 
 
99
 
100
  if( $options != $options_org )
101
  update_option( 'fvp-settings', $options );
102
+
103
  }
104
 
105
  /**
111
  * @since 1.2
112
  */
113
  class featured_video_plus_notices {
114
+ private $pluginpage;
115
+
116
+ /**
117
+ * Initialize class variables.
118
+ *
119
+ * @since 1.4
120
+ */
121
+ function __construct(){
122
+ $this->pluginpage = 'http://wordpress.org/extend/plugins/featured-video-plus#plugin-title';
123
+ }
124
+
125
+ /**
126
+ * Upgrade notification 1.3 to current version
127
+ *
128
+ * @since 1.4
129
+ */
130
+ function upgrade_13() {
131
+ echo "\n" . '<div class="updated" id="fvp_activation_notification"><p>';
132
+ printf(__('Featured Video Plus was <strong>upgraded</strong>.', 'featured-video-plus').'&nbsp'.__('%s features a seamless <strong>WP3.5 Media Manager</strong> integration, time-links (#t=4m2s) for YouTube and Dailymotion, some new options and new PHP functions for developers.', 'featured-video-plus').'&nbsp;'.__('If you like the plugin, please %srate it%s.', 'featured-video-plus'), '<strong>Version&nbsp;'.FVP_VERSION.'</strong>', '<a href="'.$this->pluginpage.'" target="_blank">', '</a>');
133
+ echo "</p></div>\n";
134
+ }
135
 
136
  /**
137
  * Upgrade notification 1.2 to current version
140
  */
141
  function upgrade_12() {
142
  echo "\n" . '<div class="updated" id="fvp_activation_notification"><p>';
143
+ printf(__('Featured Video Plus was <strong>upgraded</strong>.', 'featured-video-plus').'&nbsp'.__('%s features a seamless WP3.5 Media Manager integration, time-links (#t=4m2s) for YouTube and Dailymotion, more customization settings and internationalization.', 'featured-video-plus').'&nbsp;'.__('If you like the plugin, please %srate it%s.', 'featured-video-plus'), '<strong>Version&nbsp;'.FVP_VERSION.'</strong>', '<a href="'.$this->pluginpage.'" target="_blank">', '</a>');
144
  echo "</p></div>\n";
145
  }
146
 
151
  */
152
  function upgrade_11() {
153
  echo "\n" . '<div class="updated" id="fvp_activation_notification"><p>';
154
+ printf(__('Featured Video Plus was <strong>upgraded</strong>.', 'featured-video-plus').'&nbsp;'.__('%s features support for <strong>Local Videos</strong>, a seamless WP3.5 Media Manager integration, time-links (#t=4m2s) for YouTube and Dailymotion and many more customization settings.', 'featured-video-plus').'&nbsp;'.__('If you like the plugin, please %srate it%s.', 'featured-video-plus'), '<strong>Version&nbsp;'.FVP_VERSION.'</strong>', '<a href="'.$this->pluginpage.'" traget="_blank">','</a>');
155
  echo "</p></div>\n";
156
  }
157
 
readme.txt CHANGED
@@ -10,7 +10,7 @@ License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
  Requires at least: 3.1
12
  Tested up to: 3.5
13
- Stable tag: 1.3
14
 
15
  Add Featured Videos to your posts and pages. Works like magic with most themes which use Featured Images. Local Media, YouTube, Vimeo, Dailymotion.
16
 
@@ -20,12 +20,12 @@ Add Featured Videos to your posts and pages. Works like magic with most themes w
20
  This plugin enables you to define Featured Videos in addition to Featured Images. There are three ways to get the videos onto your page:
21
 
22
  1. If your theme already makes use of Featured Images, these will __automatically__ be replaced by Featured Videos if available. Alternatively you can
23
- 2. insert the `[featured-video-plus]`-__Shortcode__ in your entries or
24
  3. manually use the __PHP functions__ in your theme's source files.
25
 
26
- Beside your __Local Videos__ (`mp4`, `webM` & `ogg/ogv`) you can use videos from __YouTube__ (w/[time-links](http://support.google.com/youtube/bin/answer.py?hl=en&answer=116618 "Link to a specific time in a video")), __Vimeo__ and __Dailymotion__. If you miss a certain video platform: [Leave me a note](http://wordpress.org/support/plugin/featured-video-plus).
27
 
28
- The plugin adds customization options to your Media Settings. Beside aesthetic individualizations you can turn off automatic integration and tweak settings regarding video sizing. By default videos try to dynamically fit their parent containers width.
29
 
30
  = Shortcode =
31
 
@@ -33,11 +33,14 @@ The plugin adds customization options to your Media Settings. Beside aesthetic i
33
  [featured-video-plus width=300]
34
 
35
  = PHP functions =
36
- All parameters are optional. If no post_id is given the current post's id will be used.
37
 
38
- the_post_video(array(width, height))
39
- has_post_video(post_id)
40
- get_the_post_video(post_id, size(width, height))
 
 
 
 
41
 
42
 
43
 
@@ -48,7 +51,7 @@ All parameters are optional. If no post_id is given the current post's id will b
48
  == Installation ==
49
 
50
  1. Visit your WordPress Administration interface and go to Plugins -> Add New
51
- 2. Search for "*Featured Video Plus*", and click "*Install Now*" below the plugins name
52
  3. When the installation finished, click "*Activate Plugin*"
53
 
54
  The plugin is ready to go. Now edit your posts and add video links to the "Featured Video" box on the right! Plugin specific settings can be found under *Settings -> Media*.
@@ -56,36 +59,42 @@ The plugin is ready to go. Now edit your posts and add video links to the "Featu
56
 
57
  == Changelog ==
58
 
59
- = 1.3 =
60
- * Added internationalization capabilities
61
- * Added German translation
62
- * Revamped video sizing
 
 
 
 
 
 
 
63
  * Added customizations for YouTube and Dailymotion
64
- * Plenty better error handling
65
- * Added contextual help on media settings and post edit screen
66
- * Liveleak (experimental, they do not have any API)
 
67
 
68
- = 1.2 =
69
- * __Added support for local videos__
70
- * Allow webM mime type for media upload
71
- * Added Media Settings link in plugin info
72
- * More notices/warnings
73
- * More JS
74
- * minimized JS and CSS
75
- * fixed some other stuff
76
 
77
- = 1.1 =
78
- * __Added Dailymotion__
79
- * fixed youtube 'start at specific time' embeds
80
- * overhaul of the interaction between Featured Videos and Featured Images
81
- * existing featured images will no longer be replaced by newly added featured videos in the administration interface
82
 
83
- = 1.0 =
84
  * Release
85
 
86
 
87
  == Upgrade Notice ==
88
 
 
 
 
89
  = 1.3 =
90
  Internationalization! More user friendly, more customizations.
91
 
@@ -106,22 +115,22 @@ Feature Dailymotion Videos on your posts!
106
  == Frequently Asked Questions ==
107
 
108
  = After adding the URL and saving the post I do not get any video? =
109
- Maybe the plugin does not recognize the URL. Take a look into the contextual help (button on the top right of the post edit screen). There is a list of tested URLs.
110
 
111
  = How do I use my local videos? =
112
  Take a look into the contextual help (button on the top right of the post edit screen).
113
 
114
  = My theme uses Featured Images. Why are my videos not being displayed in place? =
115
  For the videos to be automatically displayed you need to define a Featured Image. This image will never be shown if a video is available.
116
- On the technical side your theme needs to feature [Post Thumbnails](http://codex.wordpress.org/Post_Thumbnails) and make use of `get_the_post_thumbnail()` or `the_post_thumbnail()`, because there is where the plugin hooks into.
117
 
118
  If the automatic integration does not work, you can tell me in the [Support Forum](http://wordpress.org/support/plugin/featured-video-plus) which theme you are using and I will take a look at it and might be able to develop a workaround.
119
 
120
  = How can I make the videos fit the theme? =
121
- Take a look at your media settings and try fixed sizes. For most installations the automatic sizing works fine. If tweaking does not help: [Tell me](http://wordpress.org/support/plugin/featured-video-plus) which theme you are using.
122
 
123
- = What about other video portals? =
124
- Leave me a note in the support forums which you would like and I will consider adding them in the next release.
125
 
126
  = How can I translate the plugin? =
127
  Grap the [featured-video-plus.pot](https://github.com/ahoereth/featured-video-plus/blob/master/lng/featured-video-plus.pot) file, [translate it](http://urbangiraffe.com/articles/translating-wordpress-themes-and-plugins/) and post it in the [Support Forum](http://wordpress.org/support/plugin/featured-video-plus). It will very lik be shipped with the next version.
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
  Requires at least: 3.1
12
  Tested up to: 3.5
13
+ Stable tag: 1.4
14
 
15
  Add Featured Videos to your posts and pages. Works like magic with most themes which use Featured Images. Local Media, YouTube, Vimeo, Dailymotion.
16
 
20
  This plugin enables you to define Featured Videos in addition to Featured Images. There are three ways to get the videos onto your page:
21
 
22
  1. If your theme already makes use of Featured Images, these will __automatically__ be replaced by Featured Videos if available. Alternatively you can
23
+ 2. insert the `[featured-video-plus]`-__Shortcode__ in your posts or
24
  3. manually use the __PHP functions__ in your theme's source files.
25
 
26
+ Beside your __Local Videos__ (`mp4`, `webM` & `ogg/ogv`) you can use videos from __YouTube__, __Vimeo__ and __Dailymotion__. If you miss a certain video platform: [Leave me a note](http://wordpress.org/support/plugin/featured-video-plus). For YouTube and Dailymotion the plugin also features [time-links](http://support.google.com/youtube/bin/answer.py?hl=en&answer=116618).
27
 
28
+ The plugin adds customization options to your Media Settings. Beside aesthetic individualizations for each video platform's player you can turn off automatic integration, turn on autoplay, define your Dailymotion Syndication Key and tweak video sizing. By default videos try to dynamically fit their parent containers width.
29
 
30
  = Shortcode =
31
 
33
  [featured-video-plus width=300]
34
 
35
  = PHP functions =
 
36
 
37
+ the_post_video( $size )
38
+ has_post_video( $post_id )
39
+ get_the_post_video( $post_id, $size )
40
+ get_the_post_video_image_url( $post_id )
41
+ get_the_post_video_image( $post_id )
42
+
43
+ All parameters are optional. If no `$post_id` is given the current post's ID will be used. `$size` is either a string keyword (`thumbnail`, `medium`, `large` or `full`) or a 2-item array representing width and height in pixels, e.g. array(560,320).
44
 
45
 
46
 
51
  == Installation ==
52
 
53
  1. Visit your WordPress Administration interface and go to Plugins -> Add New
54
+ 2. Search for "*Featured Video Plus*", and click "*Install Now*" below the plugin's name
55
  3. When the installation finished, click "*Activate Plugin*"
56
 
57
  The plugin is ready to go. Now edit your posts and add video links to the "Featured Video" box on the right! Plugin specific settings can be found under *Settings -> Media*.
59
 
60
  == Changelog ==
61
 
62
+ = 1.4: 2013-03-15 =
63
+ * __WP 3.5 Media Manager__ seamless integrated
64
+ * Time-links now available for YouTube and Dailymotion (append #t=1m2s)
65
+ * New `autoplay` setting
66
+ * Specify your Dailymotion Syndication Key
67
+ * Added `get_the_post_video_image` & `get_the_post_video_image_url`
68
+ * Local videos no longer break when domain changes or attachment is edited
69
+ * Better Featured Image handling
70
+
71
+ = 1.3: 2013-01-16 =
72
+ * __Internationalization__: Added German translations
73
  * Added customizations for YouTube and Dailymotion
74
+ * Revamped video sizing
75
+ * Better error handling
76
+ * Contextual help on media settings and post edit screen
77
+ * LiveLeak (very experimental, they have no API)
78
 
79
+ = 1.2: 2013-01-09 =
80
+ * __Local Videos__: mp4, webm, ogg
81
+ * More dynamic user interface
82
+ * Minimized JS and CSS
 
 
 
 
83
 
84
+ = 1.1: 2012-12-16 =
85
+ * __Dailymotion__
86
+ * Fixed YouTube time-links
87
+ * Enhanced interaction of Featured Videos & Featured Images
 
88
 
89
+ = 1.0: 2012-12-13 =
90
  * Release
91
 
92
 
93
  == Upgrade Notice ==
94
 
95
+ = 1.4 =
96
+ WP3.5 Media Manager, time-links...
97
+
98
  = 1.3 =
99
  Internationalization! More user friendly, more customizations.
100
 
115
  == Frequently Asked Questions ==
116
 
117
  = After adding the URL and saving the post I do not get any video? =
118
+ Maybe the plugin does not recognize the URL. Take a look into the contextual help (button on the top right of the post edit screen). There is a list what the URLs should look like. If this does not help leave a note in the support forum.
119
 
120
  = How do I use my local videos? =
121
  Take a look into the contextual help (button on the top right of the post edit screen).
122
 
123
  = My theme uses Featured Images. Why are my videos not being displayed in place? =
124
  For the videos to be automatically displayed you need to define a Featured Image. This image will never be shown if a video is available.
125
+ Beside this your theme needs to feature [Post Thumbnails](http://codex.wordpress.org/Post_Thumbnails) and make use of `get_the_post_thumbnail()` or `the_post_thumbnail()`, because these are the core functions the plugin hooks into.
126
 
127
  If the automatic integration does not work, you can tell me in the [Support Forum](http://wordpress.org/support/plugin/featured-video-plus) which theme you are using and I will take a look at it and might be able to develop a workaround.
128
 
129
  = How can I make the videos fit the theme? =
130
+ Take a look at your media settings and try different fixed sizes. If tweaking those does not help: [Tell me](http://wordpress.org/support/plugin/featured-video-plus) which theme you are using.
131
 
132
+ = What about other video providers? =
133
+ Leave me a note in the support forums which video platforms you would like to see in a feature release!
134
 
135
  = How can I translate the plugin? =
136
  Grap the [featured-video-plus.pot](https://github.com/ahoereth/featured-video-plus/blob/master/lng/featured-video-plus.pot) file, [translate it](http://urbangiraffe.com/articles/translating-wordpress-themes-and-plugins/) and post it in the [Support Forum](http://wordpress.org/support/plugin/featured-video-plus). It will very lik be shipped with the next version.