Featured Video Plus - Version 1.3

Version Description

  • Added internationalization capabilities
  • Added German translation
  • Revamped video sizing
  • Added customizations for YouTube and Dailymotion
  • Plenty better error handling
  • Added contextual help on media settings and post edit screen
  • Liveleak (experimental, they do not have any API)
Download this release

Release Info

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

Code changes from version 1.2 to 1.3

README.md DELETED
@@ -1,52 +0,0 @@
1
- # Featured Video Plus - WordPress Plugin #
2
- Add Featured Videos to your posts and pages, just like you add Featured Images. Supports your Local Videos, YouTube, Vimeo and Dailymotion.
3
-
4
- [On WordPress.org](http://wordpress.org/extend/plugins/featured-video-plus/)
5
-
6
- ## Description ##
7
- *A picture is worth a thousand words. How many words is a video worth?*
8
-
9
- This plugin enables you to define Featured Videos in addition to Featured Images. Themes using Featured Images automatically display the videos in place.
10
-
11
- There are three ways to get the videos onto your page:
12
-
13
- 1. If your theme already makes use of Featured Images, these will automatically be replaced by Featured Videos if available. Alternatively you can
14
- 2. insert the `[featured-video-plus]` shortcode in your entries or
15
- 3. manually use the PHP functions in your theme's source files.
16
-
17
- Beside your __Local Videos__ (`mp4`, `webM` & `ogg/ogv`) you can use __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).
18
-
19
- The plugin adds some individualization options to your Media Settings. Beside aesthetic customizations you can turn off automatic integration and tweak some technical settings.
20
-
21
- ### Shortcode ###
22
-
23
- [featured-video-plus]
24
- [featured-video-plus width=300]
25
-
26
-
27
- ### Theme functions ###
28
-
29
- the_post_video(array(width, height), fullscreen = true)
30
- has_post_video(post_id)
31
- get_the_post_video(post_id, size(width, height), fullscreen = true)
32
-
33
- All parameters are optional. If no post_id is given the current post's id will be used.
34
-
35
- ## Changelog ##
36
- ### 1.2 ###
37
- * __Added support for local videos__
38
- * Allow webM mime type for media upload
39
- * Added Media Settings link in plugin info
40
- * More notices/warnings
41
- * More JS
42
- * minimized JS and CSS
43
- * fixed some other stuff
44
-
45
- ### 1.1 ###
46
- * __Added Dailymotion__
47
- * fixed youtube 'start at specific time' embeds
48
- * overhaul of the interaction between Featured Videos and Featured Images
49
- * existing featured images will no longer be replaced by newly added featured videos in the administration interface
50
-
51
- ### 1.0 ###
52
- * Release
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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}.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}
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}
css/backend.css CHANGED
@@ -9,6 +9,14 @@
9
  box-sizing: border-box;
10
  }
11
 
 
 
 
 
 
 
 
 
12
  .defaultTextActive {
13
  color: #a1a1a1;
14
  font-style: italic;
@@ -49,4 +57,21 @@
49
  height: 1.1em;
50
  line-height: 1.1em;
51
  font-size: 1em;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
52
  }
9
  box-sizing: border-box;
10
  }
11
 
12
+ .fvp_colorpicker {
13
+ position: absolute;
14
+ bottom: 0; right: -197px;
15
+ background-color: #fff;
16
+ z-index: 100;
17
+ border: 1px solid #ccc;
18
+ }
19
+
20
  .defaultTextActive {
21
  color: #a1a1a1;
22
  font-style: italic;
57
  height: 1.1em;
58
  line-height: 1.1em;
59
  font-size: 1em;
60
+ }
61
+
62
+ .fvp_grouplable {
63
+ width: 100px;
64
+ float: left;
65
+ padding-top: 2px;
66
+ }
67
+ .fvp_grouppart1 {
68
+ width: 200px;
69
+ float: left;
70
+ padding-top: 2px;
71
+ }
72
+ .fvp_readonly {
73
+ color: gray !important;
74
+ }
75
+ .fvp_invalid {
76
+ background-color: #FA8072;
77
  }
featured-video-plus.php CHANGED
@@ -2,9 +2,9 @@
2
  /**
3
  Plugin Name: Featured Video Plus
4
  Plugin URI: https://github.com/ahoereth/featured-video-plus
5
- Description: Featured Videos just like Featured Images.
6
  Author: Alexander Höreth
7
- Version: 1.2
8
  Author URI: http://ahoereth.yrnxt.com
9
  License: GPL2
10
 
@@ -27,28 +27,33 @@ License: GPL2
27
  */
28
 
29
  if (!defined('FVP_VERSION'))
30
- define('FVP_VERSION', '1.2');
31
 
 
 
32
  if (!defined('FVP_NAME'))
33
- define('FVP_NAME', 'featured-video-plus');
34
- //define('FVP_NAME', trim(dirname(plugin_basename(__FILE__)), '/'));
35
 
36
  if (!defined('FVP_DIR'))
37
  define('FVP_DIR', plugin_dir_path(__FILE__));
38
 
39
  if (!defined('FVP_URL'))
40
- define('FVP_URL', WP_PLUGIN_URL . '/' . FVP_NAME);
41
 
42
  // init general class, located in php/general.php
43
  include_once( FVP_DIR . 'php/general.php' );
44
  $featured_video_plus = new featured_video_plus();
45
 
 
 
 
46
  // only on backend / administration interface
47
  if( is_admin() ) {
48
  // plugin upgrade/setup
49
  include_once( FVP_DIR . '/php/upgrade.php' );
50
  add_action( 'admin_init', 'featured_video_plus_upgrade' );
51
 
 
52
  // init backend class, located in php/backend.php
53
  include_once( FVP_DIR . 'php/backend.php' );
54
  $featured_video_plus_backend = new featured_video_plus_backend($featured_video_plus);
@@ -57,9 +62,6 @@ if( is_admin() ) {
57
  add_action('admin_menu', array( &$featured_video_plus_backend, 'metabox_register' ) );
58
  add_action('save_post', array( &$featured_video_plus_backend, 'metabox_save' ) );
59
 
60
- // admin settings
61
- add_action('admin_init', array( &$featured_video_plus_backend, 'settings_init' ) );
62
-
63
  // enqueue admin scripts and styles
64
  add_action('admin_enqueue_scripts', array( &$featured_video_plus_backend, 'enqueue' ) );
65
  add_action('admin_enqueue_scripts', array( &$featured_video_plus, 'enqueue' ) );
@@ -69,6 +71,23 @@ if( is_admin() ) {
69
 
70
  // add upload mime types for HTML5 videos
71
  add_filter('upload_mimes', array( &$featured_video_plus_backend, 'add_upload_mimes' ) );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
72
  }
73
 
74
 
@@ -88,14 +107,14 @@ if( !is_admin() ) {
88
 
89
  // functions which are available to theme developers follow here:
90
  // echos the current posts featured video
91
- function the_post_video($width = '560', $height = '315', $allowfullscreen = true) {
92
- echo get_the_post_video(null, $width, $height, $allowfullscreen, true);
93
  }
94
 
95
  // returns the posts featured video
96
- function get_the_post_video($post_id = null, $width = '560', $height = '315', $allowfullscreen = true) {
97
  global $featured_video_plus;
98
- return $featured_video_plus->get_the_post_video($post_id, $width, $height, $allowfullscreen);
99
  }
100
 
101
  // checks if post has a featured video
2
  /**
3
  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
  */
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);
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' ) );
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' );
83
+ $featured_video_plus_settings = new featured_video_plus_settings();
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
 
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
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=i.val();var g=d("#fvp_sec").val();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_notice").show("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(d.trim(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=i.val();var f=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");d("#fvp_localvideo_notice").hide("show")}if(h.match(fvp_backend_data.wp_upload_dir.replace(/\//g,"\\/"))){var j=/^.*\/(.*)\.(.*)$/g;var g=j.exec(d.trim(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");d("#fvp_localvideo_notice").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")})});
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")})});
js/backend.js CHANGED
@@ -22,7 +22,6 @@ jQuery(document).ready(function($){
22
  }
23
  });
24
 
25
-
26
  /**
27
  * blur both input fields on page load, autosize them and prevent enter
28
  * @see http://www.jacklmoore.com/autosize
@@ -63,20 +62,19 @@ jQuery(document).ready(function($){
63
  * @since 1.2
64
  */
65
  function handleVideoInput( obj ) {
66
- var value = obj.val();
67
- var sec = $('#fvp_sec').val();
68
-
69
 
70
  if ( value.length === 0 || value == fvp_backend_data.default_value ) {
71
  $("#fvp_video").css('backgroundColor', 'white');
72
  $("#fvp_sec").val( fvp_backend_data.default_value_sec ).blur().hide('fast');
73
- $("#fvp_localvideo_notice").show('fast');
74
  $("#fvp_localvideo_format_warning").hide('fast');
75
  }
76
 
77
  if ( value.match( fvp_backend_data.wp_upload_dir.replace(/\//g, "\\\/") ) ) {
78
  var file_extension = /^.*\/(.*)\.(.*)$/g;
79
- var match = file_extension.exec($.trim(value));
80
  if ( match[2] == 'webm' || match[2] == 'mp4' || match[2] == 'ogg' || match[2] == 'ogv' ) {
81
  $("#fvp_sec").show('fast');
82
  $("#fvp_video").css('backgroundColor', 'white');
@@ -107,24 +105,21 @@ jQuery(document).ready(function($){
107
  * @since 1.2
108
  */
109
  function handleSecInput( obj ) {
110
- var value = obj.val();
111
- var prim = $('#fvp_video').val();
112
-
113
 
114
  if ( value.length === 0 || value == fvp_backend_data.default_value ) {
115
  $("#fvp_localvideo_format_warning").hide('fast');
116
  $("#fvp_sec").css('backgroundColor', 'white');
117
- $("#fvp_localvideo_notice").hide('show');
118
  }
119
 
120
  if ( value.match( fvp_backend_data.wp_upload_dir.replace(/\//g, "\\\/") ) ) {
121
  var file_extension = /^.*\/(.*)\.(.*)$/g;
122
- var match = file_extension.exec($.trim(value));
123
  if ( match[2] == 'webm' || match[2] == 'mp4' || match[2] == 'ogg' || match[2] == 'ogv' ) {
124
  distinctContent();
125
  $("#fvp_sec").css('backgroundColor', 'white');
126
  $("#fvp_localvideo_format_warning").hide('fast');
127
- $("#fvp_localvideo_notice").hide('fast');
128
  } else {
129
  distinctContent();
130
  $("#fvp_sec").css('backgroundColor', 'lightYellow');
@@ -172,4 +167,12 @@ jQuery(document).ready(function($){
172
  $("#set-post-thumbnail").click(function() {
173
  $("#fvp_featimg_box_warning").addClass("fvp_hidden");
174
  });
 
 
 
 
 
 
 
 
175
  });
22
  }
23
  });
24
 
 
25
  /**
26
  * blur both input fields on page load, autosize them and prevent enter
27
  * @see http://www.jacklmoore.com/autosize
62
  * @since 1.2
63
  */
64
  function handleVideoInput( obj ) {
65
+ var value = $.trim(obj.val());
66
+ var sec = $.trim($('#fvp_sec').val());
67
+ $("#fvp_help_notice").show('fast');
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');
105
  * @since 1.2
106
  */
107
  function handleSecInput( obj ) {
108
+ var value = $.trim(obj.val());
109
+ var prim = $.trim($('#fvp_video').val());
 
110
 
111
  if ( value.length === 0 || value == fvp_backend_data.default_value ) {
112
  $("#fvp_localvideo_format_warning").hide('fast');
113
  $("#fvp_sec").css('backgroundColor', 'white');
 
114
  }
115
 
116
  if ( value.match( fvp_backend_data.wp_upload_dir.replace(/\//g, "\\\/") ) ) {
117
  var file_extension = /^.*\/(.*)\.(.*)$/g;
118
+ var match = file_extension.exec(value);
119
  if ( match[2] == 'webm' || match[2] == 'mp4' || match[2] == 'ogg' || match[2] == 'ogv' ) {
120
  distinctContent();
121
  $("#fvp_sec").css('backgroundColor', 'white');
122
  $("#fvp_localvideo_format_warning").hide('fast');
 
123
  } else {
124
  distinctContent();
125
  $("#fvp_sec").css('backgroundColor', 'lightYellow');
167
  $("#set-post-thumbnail").click(function() {
168
  $("#fvp_featimg_box_warning").addClass("fvp_hidden");
169
  });
170
+
171
+ /**
172
+ * Toggle for opening the contextual help
173
+ * @since 1.3
174
+ */
175
+ $('#fvp_help_toggle').bind( 'click', function() {
176
+ $('#contextual-help-link').trigger('click');
177
+ });
178
  });
js/backend_35.js CHANGED
@@ -1,19 +1,30 @@
1
  // >=WordPress 3.5
2
  jQuery(document).ready(function($){
3
- var myOptions = {
4
- // you can declare a default color here,
5
- // or in the data-default-color attribute on the input
6
  defaultColor: '#00adef',
7
- // a callback to fire whenever the color changes to a valid color
8
- change: function(event, ui){},
9
- // a callback to fire when the input is emptied or an invalid color
10
- clear: function() {},
11
- // hide the color picker controls on load
12
  hide: true,
13
- // show a group of common colors beneath the square
14
- // or, supply an array of colors to customize further
15
  palettes: new Array('#00adef', '#ff9933', '#c9ff23', '#ff0179', '#ffffff')
16
  };
17
-
18
- $('#fvp-settings-vimeo-color').wpColorPicker(myOptions);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
19
  });
1
  // >=WordPress 3.5
2
  jQuery(document).ready(function($){
3
+ var vimeo_options = {
 
 
4
  defaultColor: '#00adef',
 
 
 
 
 
5
  hide: true,
 
 
6
  palettes: new Array('#00adef', '#ff9933', '#c9ff23', '#ff0179', '#ffffff')
7
  };
8
+ $('#fvp-settings-vimeo-color').wpColorPicker(vimeo_options);
9
+
10
+ var dm_foreground_options = {
11
+ defaultColor: '#f7fffd',
12
+ hide: true,
13
+ palettes: new Array('#E02C72', '#92ADE0', '#E8D9AC', '#C2E165', '#FF0099', '#CFCFCF')
14
+ };
15
+ $('#fvp-settings-dailymotion-foreground').wpColorPicker(dm_foreground_options);
16
+
17
+ var dm_highlight_options = {
18
+ defaultColor: '#ffc300',
19
+ hide: true,
20
+ palettes: new Array('#BF4B78', '#A2ACBF', '#FFF6D9', '#809443', '#C9A1FF', '#834596')
21
+ };
22
+ $('#fvp-settings-dailymotion-highlight').wpColorPicker(dm_highlight_options);
23
+
24
+ var dm_background_options = {
25
+ defaultColor: '#171d1b',
26
+ hide: true,
27
+ palettes: new Array('#260F18', '#202226', '#493D27', '#232912', '#052880', '#000000')
28
+ };
29
+ $('#fvp-settings-dailymotion-background').wpColorPicker(dm_background_options);
30
  });
js/backend_pre35.js CHANGED
@@ -14,20 +14,4 @@ jQuery(document).ready(function($){
14
  $(this).fadeOut();
15
  });
16
  });
17
-
18
- $("#fvp_video").focus(function(srcc) {
19
- if ($(this).val() == $(this)[0].title) {
20
- $(this).removeClass("defaultTextActive");
21
- $(this).val("");
22
- }
23
- });
24
-
25
- $("#fvp_video").blur(function() {
26
- if ($(this).val() == "") {
27
- $(this).addClass("defaultTextActive");
28
- $(this).val($(this)[0].title);
29
- }
30
- });
31
-
32
- $("#fvp_video").blur();
33
  });
14
  $(this).fadeOut();
15
  });
16
  });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
17
  });
js/backend_settings.js ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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')) {
7
+ input.attr('readonly', 'true').addClass('fvp_readonly');
8
+ } else {
9
+ input.removeAttr('readonly').removeClass('fvp_readonly');
10
+ }
11
+ });
12
+
13
+ $('#fvp_help_toggle').bind( 'click', function() {
14
+ $('#contextual-help-link').trigger('click');
15
+ });
16
+ });
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']","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()});
js/jquery.fitvids_fvp.js CHANGED
@@ -1,85 +1,87 @@
1
- /*global jQuery */
2
- /*jshint multistr:true browser:true */
3
- /*!
4
- * FitVids 1.0
5
- *
6
- * Copyright 2011, Chris Coyier - http://css-tricks.com + Dave Rupert - http://daverupert.com
7
- * Credit to Thierry Koblentz - http://www.alistapart.com/articles/creating-intrinsic-ratios-for-video/
8
- * Released under the WTFPL license - http://sam.zoy.org/wtfpl/
9
- *
10
- * Date: Thu Sept 01 18:00:00 2011 -0500
11
- */
12
-
13
- (function( $ ){
14
-
15
- "use strict";
16
-
17
- $.fn.fitVids = function( options ) {
18
- var settings = {
19
- customSelector: null
20
- };
21
-
22
- var div = document.createElement('div'),
23
- ref = document.getElementsByTagName('base')[0] || document.getElementsByTagName('script')[0];
24
-
25
- div.className = 'fit-vids-style';
26
- div.innerHTML = '&shy;<style> \
27
- .fluid-width-video-wrapper { \
28
- width: 100%; \
29
- position: relative; \
30
- padding: 0; \
31
- } \
32
- \
33
- .fluid-width-video-wrapper iframe, \
34
- .fluid-width-video-wrapper object, \
35
- .fluid-width-video-wrapper embed { \
36
- position: absolute; \
37
- top: 0; \
38
- left: 0; \
39
- width: 100%; \
40
- height: 100%; \
41
- } \
42
- </style>';
43
-
44
- ref.parentNode.insertBefore(div,ref);
45
-
46
- if ( options ) {
47
- $.extend( settings, options );
48
- }
49
-
50
- return this.each(function(){
51
- var selectors = [
52
- "iframe[src*='player.vimeo.com']",
53
- "iframe[src*='www.youtube.com']",
54
- "iframe[src*='www.youtube-nocookie.com']",
55
- "iframe[src*='www.kickstarter.com']",
56
- "object",
57
- "embed"
58
- ];
59
-
60
- if (settings.customSelector) {
61
- selectors.push(settings.customSelector);
62
- }
63
-
64
- var $allVideos = $(this).find(selectors.join(','));
65
-
66
- $allVideos.each(function(){
67
- var $this = $(this);
68
- if (this.tagName.toLowerCase() === 'embed' && $this.parent('object').length || $this.parent('.fluid-width-video-wrapper').length) { return; }
69
- var height = ( this.tagName.toLowerCase() === 'object' || ($this.attr('height') && !isNaN(parseInt($this.attr('height'), 10))) ) ? parseInt($this.attr('height'), 10) : $this.height(),
70
- width = !isNaN(parseInt($this.attr('width'), 10)) ? parseInt($this.attr('width'), 10) : $this.width(),
71
- aspectRatio = height / width;
72
- if(!$this.attr('id')){
73
- var videoID = 'fitvid' + Math.floor(Math.random()*999999);
74
- $this.attr('id', videoID);
75
- }
76
- $this.wrap('<div class="fluid-width-video-wrapper"></div>').parent('.fluid-width-video-wrapper').css('padding-top', (aspectRatio * 100)+"%");
77
- $this.removeAttr('height').removeAttr('width');
78
- });
79
- });
80
- };
81
- })( jQuery );
82
-
83
- jQuery(document).ready(function($){
84
- $(".featured_video_plus").fitVids();
 
 
85
  });
1
+ /*global jQuery */
2
+ /*jshint multistr:true browser:true */
3
+ /*!
4
+ * FitVids 1.0
5
+ *
6
+ * Copyright 2011, Chris Coyier - http://css-tricks.com + Dave Rupert - http://daverupert.com
7
+ * Credit to Thierry Koblentz - http://www.alistapart.com/articles/creating-intrinsic-ratios-for-video/
8
+ * Released under the WTFPL license - http://sam.zoy.org/wtfpl/
9
+ *
10
+ * Date: Thu Sept 01 18:00:00 2011 -0500
11
+ */
12
+
13
+ (function( $ ){
14
+
15
+ "use strict";
16
+
17
+ $.fn.fitVids = function( options ) {
18
+ var settings = {
19
+ customSelector: null
20
+ };
21
+
22
+ var div = document.createElement('div'),
23
+ ref = document.getElementsByTagName('base')[0] || document.getElementsByTagName('script')[0];
24
+
25
+ div.className = 'fit-vids-style';
26
+ div.innerHTML = '&shy;<style> \
27
+ .fluid-width-video-wrapper { \
28
+ width: 100%; \
29
+ position: relative; \
30
+ padding: 0; \
31
+ } \
32
+ \
33
+ .fluid-width-video-wrapper iframe, \
34
+ .fluid-width-video-wrapper object, \
35
+ .fluid-width-video-wrapper embed { \
36
+ position: absolute; \
37
+ top: 0; \
38
+ left: 0; \
39
+ width: 100%; \
40
+ height: 100%; \
41
+ } \
42
+ </style>';
43
+
44
+ ref.parentNode.insertBefore(div,ref);
45
+
46
+ if ( options ) {
47
+ $.extend( settings, options );
48
+ }
49
+
50
+ return this.each(function(){
51
+ var selectors = [
52
+ "iframe[src*='player.vimeo.com']",
53
+ "iframe[src*='www.youtube.com']",
54
+ "iframe[src*='www.youtube-nocookie.com']",
55
+ "iframe[src*='www.kickstarter.com']",
56
+ "iframe[src*='www.liveleak.com']",
57
+ "iframe[src*='www.prochan.com']",
58
+ "object",
59
+ "embed"
60
+ ];
61
+
62
+ if (settings.customSelector) {
63
+ selectors.push(settings.customSelector);
64
+ }
65
+
66
+ var $allVideos = $(this).find(selectors.join(','));
67
+
68
+ $allVideos.each(function(){
69
+ var $this = $(this);
70
+ if (this.tagName.toLowerCase() === 'embed' && $this.parent('object').length || $this.parent('.fluid-width-video-wrapper').length) { return; }
71
+ var height = ( this.tagName.toLowerCase() === 'object' || ($this.attr('height') && !isNaN(parseInt($this.attr('height'), 10))) ) ? parseInt($this.attr('height'), 10) : $this.height(),
72
+ width = !isNaN(parseInt($this.attr('width'), 10)) ? parseInt($this.attr('width'), 10) : $this.width(),
73
+ aspectRatio = height / width;
74
+ if(!$this.attr('id')){
75
+ var videoID = 'fitvid' + Math.floor(Math.random()*999999);
76
+ $this.attr('id', videoID);
77
+ }
78
+ $this.wrap('<div class="fluid-width-video-wrapper"></div>').parent('.fluid-width-video-wrapper').css('padding-top', (aspectRatio * 100)+"%");
79
+ $this.removeAttr('height').removeAttr('width');
80
+ });
81
+ });
82
+ };
83
+ })( jQuery );
84
+
85
+ jQuery(document).ready(function($){
86
+ $(".featured_video_plus").fitVids();
87
  });
lng/featured-video-plus-de_DE.mo ADDED
Binary file
lng/featured-video-plus-de_DE.po ADDED
@@ -0,0 +1,476 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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"
9
+ "MIME-Version: 1.0\n"
10
+ "Content-Type: text/plain; charset=UTF-8\n"
11
+ "Content-Transfer-Encoding: 8bit\n"
12
+ "X-Generator: Poedit 1.5.4\n"
13
+ "X-Poedit-KeywordsList: __;_e\n"
14
+ "X-Poedit-Basepath: ..\n"
15
+ "X-Poedit-SourceCharset: UTF-8\n"
16
+ "X-Poedit-SearchPath-0: php\n"
17
+
18
+ #: php/backend.php:32
19
+ msgid "Video URL"
20
+ msgstr "Video URL"
21
+
22
+ #: php/backend.php:33
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"
33
+ msgstr "Veraltete WordPress Version"
34
+
35
+ #: php/backend.php:120
36
+ #, php-format
37
+ msgid ""
38
+ "There is WordPress 3.5 out there! The plugin supports older versions way "
39
+ "back to 3.1 - but %s is defenitly to old!"
40
+ 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 "
107
+ "%sMedia Library%s and paste it into the text field."
108
+ 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"
116
+ "%s and paste it into the text field."
117
+ 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 "
125
+ "played."
126
+ msgstr ""
127
+ "Das zweite Textfeld ist für eine URL zu dem gleichen Video in einem anderen "
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 "
139
+ "and compatible with Windows, Mac and Linux."
140
+ 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</"
152
+ "strong>."
153
+ 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 "
161
+ "activates it, but under some conditions this might not be enough. %sHere%s "
162
+ "you can get more information on this."
163
+ msgstr ""
164
+ "Normalerweise unterstützt WordPress kein <code>webM</code>. Das Plugin "
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 "
176
+ "need to do is provide an <code>mp4</code>-video."
177
+ 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."
185
+ 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 "
225
+ "replacement, use the %s or manually edit your theme's source files to make "
226
+ "use of the plugins PHP-functions."
227
+ msgstr ""
228
+ "Um die Artikelvideos anzuzeigen kannst du entweder das automatische Ersetzen "
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 "
236
+ "Help%s."
237
+ 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."
258
+ 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>."
266
+ 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 "
282
+ "width might result in <em>not so pretty</em> black bars."
283
+ msgstr ""
284
+ "Wenn <code>auto</code> gesetzt ist, wird das jeweilige Video automatisch an "
285
+ "das Elternelement angepasst. Dabei wird versucht, die Seitenverhältnisse "
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."
391
+ 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 "
450
+ "post & page edit screens for you to add videos. <strong>Take a look at your "
451
+ "new %sMedia Settings%s</strong>."
452
+ msgstr ""
453
+ "Featured Video Plus wurde <strong>aktiviert</strong>. Beim bearbeiten deiner "
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 "
460
+ #~ "interface."
461
+ #~ msgstr ""
462
+ #~ "Version %s integriert mehr Einstellungsmöglichkeiten, "
463
+ #~ "Internationalisierung, besseres Fehlerbehandlung und LiveLeak Videos "
464
+ #~ "(experimentell)."
465
+
466
+ #~ msgid ""
467
+ #~ "Featured Video Plus was <strong>upgraded</strong>. Version <strong>%s</"
468
+ #~ "strong> now supports <strong>local videos</strong> and many more "
469
+ #~ "customization settings."
470
+ #~ msgstr ""
471
+ #~ "Version %s integriert <strong>lokale Videos</strong>, LiveLeak Videos "
472
+ #~ "(experimentell), mehr Einstellungsmöglichkeiten, Internationalisierung "
473
+ #~ "und besseres Fehlerbehandlung."
474
+
475
+ #~ msgid "YouTube, Vimeo, Dailymotion; Local Media"
476
+ #~ msgstr "Video Formate"
lng/featured-video-plus.pot ADDED
@@ -0,0 +1,399 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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"
9
+ "MIME-Version: 1.0\n"
10
+ "Content-Type: text/plain; charset=UTF-8\n"
11
+ "Content-Transfer-Encoding: 8bit\n"
12
+ "X-Generator: Poedit 1.5.4\n"
13
+ "X-Poedit-KeywordsList: __;_e\n"
14
+ "X-Poedit-Basepath: ..\n"
15
+ "X-Poedit-SourceCharset: UTF-8\n"
16
+ "X-Poedit-SearchPath-0: php\n"
17
+
18
+ #: php/backend.php:32
19
+ msgid "Video URL"
20
+ msgstr ""
21
+
22
+ #: php/backend.php:33
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
+
31
+ #: php/backend.php:120
32
+ msgid "Outdated WordPress Version"
33
+ msgstr ""
34
+
35
+ #: php/backend.php:120
36
+ #, php-format
37
+ msgid ""
38
+ "There is WordPress 3.5 out there! The plugin supports older versions way "
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 "
89
+ "<code>PHP functions</code>. To hide this notice deactivate &quot;<em>Replace "
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 "
140
+ "activates it, but under some conditions this might not be enough. %sHere%s "
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 "
197
+ "replacement, use the %s or manually edit your theme's source files to make "
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 "
397
+ "post & page edit screens for you to add videos. <strong>Take a look at your "
398
+ "new %sMedia Settings%s</strong>."
399
+ msgstr ""
php/backend.php CHANGED
@@ -14,6 +14,8 @@ class featured_video_plus_backend {
14
  private $featured_video_plus;
15
  private $default_value;
16
  private $default_value_sec;
 
 
17
 
18
  /**
19
  * Creates a new instace of this class, saves the featured_video_instance and default value for the meta box input.
@@ -27,8 +29,8 @@ class featured_video_plus_backend {
27
  wp_die( 'featured_video_plus general instance required!', 'Error!' );
28
 
29
  $this->featured_video_plus = $featured_video_plus_instance;
30
- $this->default_value = 'YouTube, Vimeo, Dailymotion; Local Media';
31
- $this->default_value_sec = 'Fallback: same video, different format';
32
  }
33
 
34
  /**
@@ -46,20 +48,21 @@ class featured_video_plus_backend {
46
  if( wp_style_is( 'wp-color-picker', 'registered' ) ) {
47
  // >=WP3.5
48
  wp_enqueue_style( 'wp-color-picker' );
49
- wp_enqueue_script( 'fvp_backend_35', FVP_URL . '/js/backend_35.js', array( 'wp-color-picker', 'jquery' ) );
50
  } else {
51
  // <WP3.5, fallback for the new WordPress Color Picker which was added in 3.5
52
  wp_enqueue_style( 'farbtastic' );
53
  wp_enqueue_script( 'farbtastic' );
54
- wp_enqueue_script( 'fvp_backend_pre35', FVP_URL . '/js/backend_pre35.js', array( 'jquery' ) );
55
  }
 
56
  }
57
 
58
  // just required on post.php
59
  if($hook_suffix == 'post.php' && isset($_GET['post']) ) {
60
- wp_enqueue_script( 'jquery.autosize', FVP_URL . '/js/jquery.autosize-min.js', array( 'jquery' ) );
61
- wp_enqueue_script( 'fvp_backend', FVP_URL . '/js/backend-min.js', array( 'jquery','jquery.autosize' ) ); // production
62
- //wp_enqueue_script( 'fvp_backend', FVP_URL . '/js/backend.js', array( 'jquery','jquery.autosize' ) ); // development
63
 
64
  $upload_dir = wp_upload_dir();
65
  wp_localize_script( 'fvp_backend', 'fvp_backend_data', array(
@@ -69,8 +72,8 @@ class featured_video_plus_backend {
69
  ) );
70
  }
71
 
72
- wp_enqueue_style( 'fvp_backend', FVP_URL . '/css/backend-min.css' ); // production
73
- //wp_enqueue_style( 'fvp_backend', FVP_URL . '/css/backend.css' ); // development
74
  }
75
 
76
  /**
@@ -82,7 +85,7 @@ class featured_video_plus_backend {
82
  $post_types = get_post_types(array("public" => true));
83
  foreach ($post_types as $post_type) {
84
  if($post_type != 'attachment')
85
- add_meta_box("featured_video_plus-box", 'Featured Video', array( &$this, 'metabox_content' ), $post_type, 'side', 'core');
86
  }
87
  }
88
 
@@ -106,50 +109,57 @@ class featured_video_plus_backend {
106
  $featimg_is_fvp = empty($tmp2) ? false : true;
107
  $has_post_video = $this->featured_video_plus->has_post_video($post_id);
108
 
 
109
  $meta = unserialize( get_post_meta($post_id, '_fvp_video', true) );
110
 
111
  echo "\n\n\n<!-- Featured Video Plus Metabox -->\n";
 
 
 
 
 
112
  // displays the current featured video
113
  if( $has_post_video )
114
- echo '<div id="featured_video_preview" class="featured_video_plus" style="display:block">' . $this->featured_video_plus->get_the_post_video( $post_id, array(256,144) ) . "</div>\n";
115
 
116
  // input box containing the featured video URL
117
  $full = isset($meta['full']) ? $meta['full'] : $this->default_value;
118
- echo '<textarea class="fvp_input" id="fvp_video" name="fvp_video" type="text" title="' . $this->default_value . '" />' . $full . '</textarea>' . "\n";
 
119
 
120
  $sec = isset($meta['sec']) ? $meta['sec'] : $this->default_value_sec;
121
  echo '<textarea class="fvp_input" id="fvp_sec" name="fvp_sec" type="text" title="' . $this->default_value_sec . '" />' . $sec . '</textarea>' . "\n";
122
 
123
  // local video format warning
124
  echo '<div id="fvp_localvideo_format_warning" class="fvp_warning fvp_hidden">'."\n\t".'<p class="description">'."\n\t\t";
125
- echo '<span style="font-weight: bold;">Supported Video Formats:</span> <code>mp4</code>, <code>webM</code> or <code>ogg/ogv</code>. <a href="http://wordpress.org/extend/plugins/featured-video-plus/faq/">More information</a>.';
126
  echo "\n\t</p>\n</div>\n";
127
 
128
  // local videos not distinct warning
129
  echo '<div id="fvp_localvideo_notdistinct_warning" class="fvp_warning fvp_hidden">'."\n\t".'<p class="description">'."\n\t\t";
130
- echo '<span style="font-weight: bold;">Fallback Video:</span> The two input fields should contain the same video but in distinct formats.';
131
  echo "\n\t</p>\n</div>\n";
132
 
133
- // how to use a local video notice
134
- $class = (isset($meta['prov']) && $meta['prov'] != 'local') || (isset($meta['sec']) && !empty($meta['sec'])) ? ' fvp_hidden' : '' ;
135
- $mediahref = (get_bloginfo('version') >= 3.5) ? '<a href="#" class="insert-media" title="Add Media">' : '<a href="media-upload.php?post_id=4&amp;type=video&amp;TB_iframe=1&amp;width=640&amp;height=207" id="add_video" class="thickbox" title="Add Video">';
136
- $urllabel = (get_bloginfo('version') >= 3.5) ? 'Link To Media File' : 'File URL';
137
- echo "<div id=\"fvp_localvideo_notice\" class=\"fvp_notice".$class."\">\n\t<p class=\"description\">\n\t\t";
138
- echo '<span style="font-weight: bold;">Local Media:</span> Use the <code>' . $urllabel . '</code> from your '. $mediahref . 'Media Library</a>.';
139
  echo "\n\t</p>\n</div>\n";
140
 
141
  // no featured image warning
142
- $fvp_settings = get_option( 'fvp-settings' );
143
- $class = $has_featimg || !$has_post_video || (isset($fvp_settings['overwrite']) && !$fvp_settings['overwrite']) ? ' fvp_hidden' : '';
144
  echo '<div id="fvp_featimg_warning" class="fvp_notice'.$class.'">'."\n\t".'<p class="description">';
145
- echo '<span style="font-weight: bold;">Featured Image:</span> For automatically displaying the Featured Video a Featured Image is required.';
146
  echo "</p>\n</div>\n";
147
 
148
  // set as featured image
149
  $class = $meta['prov'] == 'local' || !$has_post_video || ($has_featimg && $featimg_is_fvp) ? ' class="fvp_hidden"' : '';
150
- $text = 'Set as Featured Image';
151
- echo '<p id="fvp_set_featimg_box"'.$class.'>'."\n\t".'<span id="fvp_set_featimg_input">'."\n\t\t".'<input id="fvp_set_featimg" name="fvp_set_featimg" type="checkbox" value="set_featimg" />'."\n\t\t".'<label for="fvp_set_featimg">&nbsp;'.$text.'</label>'."\n\t".'</span>'."\n";
152
- echo "\t".'<a style="display: none;" id="fvp_set_featimg_link" href="#">'.$text.'</a>'."\n".'</p>'."\n";
 
 
153
 
154
  echo "<!-- Featured Video Plus Metabox End-->\n\n\n";
155
  }
@@ -178,13 +188,13 @@ class featured_video_plus_backend {
178
  } else {
179
  $set_featimg = isset($_POST['fvp_set_featimg']) && !empty($_POST['fvp_set_featimg']) ? true : $set_featimg;
180
 
181
- if( !isset($_POST['fvp_video']) && isset( $meta ) )
182
- $video = $meta['full'];
183
  else
184
  $video = trim($_POST['fvp_video']);
185
  }
186
 
187
- $sec = isset($_POST['fvp_sec']) && !empty($_POST['fvp_sec']) ? trim($_POST['fvp_sec']) : '';
188
 
189
  // something changed
190
  if( ( empty($video) ) || // no video or
@@ -225,27 +235,13 @@ class featured_video_plus_backend {
225
 
226
  /*
227
  REGEX tested using: http://www.rubular.com/
228
-
229
- Tested URLs:
230
- http://youtu.be/G_Oj7UI0-pw
231
- https://youtu.be/G_Oj7UI0-pw
232
- http://vimeo.com/32071937
233
- https://vimeo.com/32071937
234
- http://vimeo.com/32071937#embed
235
- http://youtu.be/9Tjg6V1Eoz4?t=2m29s
236
- http://www.youtube.com/watch?v=9Tjg6V1Eoz4&t=2m29s
237
- http://www.youtube.com/watch?v=G_Oj7UI0-pw
238
- http://www.youtube.com/watch?feature=blub&v=G_Oj7UI0-pw
239
  */
240
 
241
  $local = wp_upload_dir();
242
- // match different provider(!)
243
-
244
- preg_match('/(vimeo|youtu|dailymotion|' . preg_quote($local['baseurl'], '/') . ')/i', $video, $video_provider);
245
- if(!isset($video_provider[1]))
246
- return;
247
-
248
- $video_prov = $video_provider[1] == "youtu" ? "youtube" : $video_provider[1];
249
 
250
  switch ($video_prov) {
251
 
@@ -267,19 +263,29 @@ http://www.youtube.com/watch?feature=blub&v=G_Oj7UI0-pw
267
 
268
  break;
269
 
 
 
 
270
  case 'youtube':
271
  //match provider watch feature id(!) attr(!)
272
- preg_match('/youtu(?:be\.com|\.be)\/(?:watch)?(?:\?feature=[^\?&]*)*(?:[\?&]v=)?([^\?&\s]+)(?:(?:[&\?]t=)(\d+m\d+s))?/', $video, $video_data);
 
 
 
 
 
 
 
 
 
 
 
 
 
273
  $video_id = $video_data[1];
274
  if( isset($video_data[2] ) )
275
  $video_attr = $video_data[2];
276
 
277
- // title, allow_embed 0/1, keywords, author, iurlmaxres, thumbnail_url, timestamp, avg_rating
278
- $tmp = download_url( 'http://youtube.com/get_video_info?video_id=' . $video_id );
279
- $data = file_get_contents($tmp);
280
- parse_str($data, $data);
281
- @unlink( $tmp );
282
-
283
  // generate video metadata
284
  $video_info = array(
285
  'title' => $data['title'],
@@ -293,19 +299,17 @@ http://www.youtube.com/watch?feature=blub&v=G_Oj7UI0-pw
293
  break;
294
 
295
  case 'vimeo': // http://developer.vimeo.com/apis/simple
296
- preg_match('/vimeo.com\/([^#]+)/', $video, $video_data);
 
 
 
297
  $video_id = $video_data[1];
298
 
299
  // title, description, upload_date, thumbnail_large, user_name, tags
300
- $url = 'http://vimeo.com/api/v2/video/' . $video_id . '.php';
301
-
302
- if( ini_get('allow_url_fopen') )
303
- $data = unserialize(file_get_contents( $url ));
304
- if( !isset( $data ) || empty( $data ) ) {
305
- $tmp = download_url( $url );
306
- $data = unserialize(file_get_contents($tmp));
307
- @unlink( $tmp );
308
- }
309
 
310
  // generate video metadata
311
  $video_info = array(
@@ -321,15 +325,22 @@ http://www.youtube.com/watch?feature=blub&v=G_Oj7UI0-pw
321
  break;
322
 
323
  case 'dailymotion': // http://www.dailymotion.com/doc/api/obj-video.html
324
- preg_match('/dailymotion.com\/video\/([^_]+)/', $video, $video_data);
325
- $video_id = $video_data[1];
 
326
 
327
  // http://codex.wordpress.org/HTTP_API
328
  //thumbnail_url,aspect_ratio,description,created_time,embed_url,owner (owner.screenname),tags,title,url
329
- $url = 'https://api.dailymotion.com/video/'.$video_id.'?fields=title,description,created_time,owner.screenname,tags,thumbnail_url,thumbnail_large_url,url,aspect_ratio';
330
  $request = new WP_Http;
331
  $result = $request->request( $url, array( 'method' => 'GET', 'sslverify' => false) );
 
 
332
  $data = json_decode($result['body'], true);
 
 
 
 
333
 
334
  // generate video metadata
335
  $video_info = array(
@@ -343,13 +354,62 @@ http://www.youtube.com/watch?feature=blub&v=G_Oj7UI0-pw
343
  'url' => $data['url']
344
  );
345
  break;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
346
  }
347
 
 
348
  if( !isset($video_id) )
349
- return;
350
 
351
  // do we have a screen capture to pull?
352
- if( !empty($video_info['img']) ) {
353
 
354
  // is this screen capture already existing in our media library?
355
  $video_img = $this->get_post_by_custom_meta('_fvp_image', $video_prov . '?' . $video_id);
@@ -394,14 +454,14 @@ http://www.youtube.com/watch?feature=blub&v=G_Oj7UI0-pw
394
  }
395
 
396
  $meta = array(
397
- 'full' => ( isset($data['url']) && !empty($data['url']) ) ? $data['url'] : $video,
398
- 'id' => $video_id,
399
- 'sec' => $sec,
400
- 'sec_id' => ( isset($video_sec_id) && !empty($video_sec_id) ) ? $video_sec_id : '',
401
- 'img' => isset($video_img) ? $video_img : '',
402
- 'prov' => $video_prov,
403
- 'attr' => isset($video_attr) ? $video_attr : '',
404
- 'warn_featimg' => true
405
  );
406
 
407
  update_post_meta( $post_id, '_fvp_video', serialize($meta) );
@@ -410,175 +470,95 @@ http://www.youtube.com/watch?feature=blub&v=G_Oj7UI0-pw
410
  }
411
 
412
  /**
413
- * Initialises the plugin settings section, the settings fields and registers the options field and save function.
414
  *
415
- * @see http://codex.wordpress.org/Settings_API
416
- * @since 1.0
417
  */
418
- function settings_init() {
419
- add_settings_section('fvp-settings-section', 'Featured Video', array( &$this, 'settings_content' ), 'media');
420
-
421
- add_settings_field('fvp-settings-overwrite', 'Replace featured images', array( &$this, 'settings_overwrite' ), 'media', 'fvp-settings-section');
422
- add_settings_field('fvp-settings-width', 'Video width', array( &$this, 'settings_width' ), 'media', 'fvp-settings-section');
423
- add_settings_field('fvp-settings-height', 'Video height', array( &$this, 'settings_height' ), 'media', 'fvp-settings-section');
424
- add_settings_field('fvp-settings-vimeo', 'Vimeo Player Design', array( &$this, 'settings_vimeo' ), 'media', 'fvp-settings-section');
425
- add_settings_field('fvp-settings-rate', 'Support', array( &$this, 'settings_rate' ), 'media', 'fvp-settings-section');
426
-
427
- register_setting('media', 'fvp-settings', array( &$this, 'settings_save' ));
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
428
  }
429
 
430
  /**
431
- * The settings section content. Describes the plugin settings, the php functions and the WordPress shortcode.
432
- *
433
- * @since 1.0
434
- */
435
- function settings_content() { ?>
436
-
437
- <p>To display your featured videos you can either make use of the automatical replacement, use the <code>[featured-video]</code>-shortcode or manually edit your theme's source files to make use of the plugins PHP-functions.</p>
438
- <table>
439
- <tr style="vertical-align: top;">
440
- <td style="width: 50%;">
441
- <h4 style="margin-top: 0">WordPress Shortcode Usage</h4>
442
- <table>
443
- <tr style="vertical-align: top;">
444
- <td><code>[featured-video]</code></td>
445
- <td>Displays the video in its default size, if <code>width</code> below is set to <code>auto</code> 100%, elsewise 560px.</td>
446
- </tr>
447
- <tr style="vertical-align: top;">
448
- <td><code>[featured-video width=300]</code></td>
449
- <td>Displays the video with an width of 300 pixel. Height will be fitted to the aspect ratio.</td>
450
- </tr>
451
- </table>
452
- </td>
453
- <td style="width: 50%;">
454
- <h4 style="margin-top: 0">PHP Function Reference</h4>
455
- <ul>
456
- <li><code>the_post_video(array(width, height), allow_fullscreen = true)</code></li>
457
- <li><code>has_post_video(post_id = null)</code></li>
458
- <li><code>get_the_post_video(post_id = null, array(width, height), allow_fullscreen = true)</code></li>
459
- </ul>
460
- <p class="description">
461
- All parameters are optional. If <code>post_id == null</code> the current post's id will be used.
462
- The functions are implemented with their <a href="http://codex.wordpress.org/Post_Thumbnails#Function_Reference" title="Post Thumbnails Function Reference">"featured image"-counterparts</a> in mind, they can be used the same way.
463
- </p>
464
- </td>
465
- </tr>
466
- </table>
467
-
468
- <?php }
469
-
470
- /**
471
- * Displays the setting if the plugin should display the featured video in place of featured images.
472
- *
473
- * @since 1.0
474
- */
475
- function settings_overwrite() {
476
- $options = get_option( 'fvp-settings' );
477
- $overwrite = isset($options['overwrite']) ? $options['overwrite'] : false;
478
- ?>
479
-
480
- <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;yes&nbsp;<span style="font-style: italic;">(default)</span></label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
481
- <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;no</label>
482
- <p class="description">If a featured video is available, it can be displayed in place of the featured image.<br />For some themes this could result in displaying errors. When using this, try different <code>width</code> and <code>height</code> settings.</p>
483
-
484
- <?php }
485
-
486
- /**
487
- * Displays the setting if the plugin should fit the width of the videos automatically or use fixed widths.
488
- *
489
- * @since 1.0
490
- */
491
- function settings_width() {
492
- $options = get_option( 'fvp-settings' );
493
- $width = isset($options['width']) ? $options['width'] : 'auto'; ?>
494
-
495
- <input type="radio" name="fvp-settings[width]" id="fvp-settings-width-1" value="auto" <?php checked( 'auto', $width, true ) ?>/><label for="fvp-settings-width-1">&nbsp;auto&nbsp;<span style="font-style: italic;">(default)</span></label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
496
- <input type="radio" name="fvp-settings[width]" id="fvp-settings-width-2" value="fixed" <?php checked( 'fixed', $width, true ) ?>/><label for="fvp-settings-width-2">&nbsp;fixed</label>
497
- <p class="description">Using <code>auto</code> the video's width will be adjusted to fit the parent element. Works best in combination with height setted to <code>auto</code> as well.</p>
498
-
499
- <?php }
500
-
501
- /**
502
- * Displays the setting if the plugin should fit the height of the videos automatically to their width/height ratio or use fixed heights, which might result in black bars.
503
  *
504
- * @since 1.0
505
- */
506
- function settings_height() {
507
- $options = get_option( 'fvp-settings' );
508
- $height = isset($options['height']) ? $options['height'] : 'auto'; ?>
509
-
510
- <input type="radio" name="fvp-settings[height]" id="fvp-settings-height-1" value="auto" <?php checked( 'auto', $height, true ) ?>/><label for="fvp-settings-height-1">&nbsp;auto&nbsp;<span style="font-style: italic;">(default)</span></label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
511
- <input type="radio" name="fvp-settings[height]" id="fvp-settings-height-2" value="fixed" <?php checked( 'fixed', $height, true ) ?>/><label for="fvp-settings-height-2">&nbsp;fixed</label>
512
- <p class="description">If using <code>fixed</code> videos may lose their ascpect radio, resulting in <span style="font-style: italic;">not so pretty</span> black bars.</p>
513
-
514
- <?php }
515
-
516
- /**
517
- * Displays the settings to style the vimeo video player. Default: &amp;title=1&amp;portrait=0&amp;byline=1&amp;color=00adef
518
  *
519
- * @see http://developer.vimeo.com/player/embedding
520
- * @see http://make.wordpress.org/core/2012/11/30/new-color-picker-in-wp-3-5/
521
- * @see http://codex.wordpress.org/Function_Reference/wp_style_is
522
- * @since 1.0
523
  */
524
- function settings_vimeo() {
525
- $options = get_option( 'fvp-settings' );
526
- $vimeo['portrait'] = isset($options['vimeo']['portrait']) ? $options['vimeo']['portrait'] : 0;
527
- $vimeo['title'] = isset($options['vimeo']['title']) ? $options['vimeo']['title'] : 1;
528
- $vimeo['byline'] = isset($options['vimeo']['byline']) ? $options['vimeo']['byline'] : 1;
529
- $vimeo['color'] = isset($options['vimeo']['color']) ? $options['vimeo']['color'] : '00adef'; ?>
530
-
531
- <div style="position: relative; bottom: .6em;">
532
- <input type="checkbox" name="fvp-settings[vimeo][portrait]" id="fvp-settings-vimeo-1" value="display" <?php checked( 1, $vimeo['portrait'], 1 ) ?>/><label for="fvp-settings-vimeo-1">&nbsp;Portrait</label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
533
- <input type="checkbox" name="fvp-settings[vimeo][title]" id="fvp-settings-vimeo-2" value="display" <?php checked( 1, $vimeo['title'], 1 ) ?>/><label for="fvp-settings-vimeo-2">&nbsp;Title</label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
534
- <input type="checkbox" name="fvp-settings[vimeo][byline]" id="fvp-settings-vimeo-3" value="display" <?php checked( 1, $vimeo['byline'], 1 ) ?>/><label for="fvp-settings-vimeo-3">&nbsp;Byline</label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
535
- <span class="color-picker" style="position: relative;<?php if( wp_style_is( 'wp-color-picker', 'done' ) ) echo ' top: .6em;'; ?>" >
536
- <input type="text" name="fvp-settings[vimeo][color]" id="fvp-settings-vimeo-color" value="#<?php echo $vimeo['color'] ?>" data-default-color="#00adef" />
537
- <label for="fvp-settings-vimeo-color" style="display: none;">&nbsp;Color</label>
538
- <?php if( !wp_style_is('wp-color-picker', 'registered' ) ) { ?><div style="position: absolute; bottom: 0; right: -197px; background-color: #fff; z-index: 100; border: 1px solid #ccc;" id="fvp-settings-vimeo-colorpicker"></div><?php } ?>
539
- </span>
540
- </div>
541
- <p class="description">These settings could be overwritten by videos from Vimeo Plus members.</p>
542
 
543
- <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
 
544
  }
545
 
546
  /**
547
- * Displays info about rating the plugin, giving feedback and requesting new features
548
  *
549
- * @since 1.0
550
- */
551
- function settings_rate() { ?>
552
-
553
- <p>
554
- Found a bug or <span style="font-weight: bold;">missing a specific video service</span>? <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 plugins support forum!<br />
555
- No? Than please <a href="http://wordpress.org/extend/plugins/featured-video/" title="Featured Video Plus on wordpress.org" style="font-weight: bold;">rate it</a>.<br />
556
- </p>
557
-
558
- <?php }
559
-
560
- /**
561
- * Function through which all settings are passed before they are saved. Validate the data.
562
  *
563
- * @since 1.0
564
  */
565
- function settings_save($input) {
566
- $options = get_option( 'fvp-settings' );
567
-
568
- $options['overwrite'] = isset($input['overwrite']) && $input['overwrite'] == 'true' ? true : false;
569
-
570
- $options['vimeo']['portrait'] = isset($input['vimeo']['portrait'])&& ( $input['vimeo']['portrait'] == 'display' ) ? 1 : 0;
571
- $options['vimeo']['title'] = isset($input['vimeo']['title']) && ( $input['vimeo']['title'] == 'display' ) ? 1 : 0;
572
- $options['vimeo']['byline'] = isset($input['vimeo']['byline']) && ( $input['vimeo']['byline'] == 'display' ) ? 1 : 0;
573
 
574
- if( isset($options['vimeo']['color']) ) {
575
- preg_match('/#?([0123456789abcdef]{3}[0123456789abcdef]{0,3})/i', $input['vimeo']['color'], $color);
576
- $options['vimeo']['color'] = $color[1];
577
- } else
578
- $options['vimeo']['color'] = '00adef';
579
 
580
-
581
- return $options;
582
  }
583
 
584
  /**
@@ -587,7 +567,6 @@ http://www.youtube.com/watch?feature=blub&v=G_Oj7UI0-pw
587
  * @see http://codex.wordpress.org/Plugin_API/Filter_Reference/upload_mimes
588
  * @since 1.2
589
  */
590
-
591
  function add_upload_mimes( $mimes=array() ) {
592
  $mimes['webm'] = 'video/webm';
593
 
14
  private $featured_video_plus;
15
  private $default_value;
16
  private $default_value_sec;
17
+ private $help_localmedia;
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.
29
  wp_die( 'featured_video_plus general instance required!', 'Error!' );
30
 
31
  $this->featured_video_plus = $featured_video_plus_instance;
32
+ $this->default_value = __('Video URL', 'featured-video-plus');
33
+ $this->default_value_sec = __('Fallback: same video, different format', 'featured-video-plus');
34
  }
35
 
36
  /**
48
  if( wp_style_is( 'wp-color-picker', 'registered' ) ) {
49
  // >=WP3.5
50
  wp_enqueue_style( 'wp-color-picker' );
51
+ wp_enqueue_script( 'fvp_backend_35', FVP_URL . 'js/backend_35.js', array( 'wp-color-picker', 'jquery' ), FVP_VERSION );
52
  } else {
53
  // <WP3.5, fallback for the new WordPress Color Picker which was added in 3.5
54
  wp_enqueue_style( 'farbtastic' );
55
  wp_enqueue_script( 'farbtastic' );
56
+ wp_enqueue_script( 'fvp_backend_pre35', FVP_URL . 'js/backend_pre35.js', array( 'jquery' ), FVP_VERSION );
57
  }
58
+ wp_enqueue_script( 'fvp_backend_settings', FVP_URL . 'js/backend_settings.js', array( 'jquery' ), FVP_VERSION );
59
  }
60
 
61
  // just required on post.php
62
  if($hook_suffix == 'post.php' && isset($_GET['post']) ) {
63
+ wp_enqueue_script( 'jquery.autosize', FVP_URL . 'js/jquery.autosize-min.js', array( 'jquery' ), FVP_VERSION );
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(
72
  ) );
73
  }
74
 
75
+ wp_enqueue_style( 'fvp_backend', FVP_URL . 'css/backend-min.css', array(), FVP_VERSION ); // production
76
+ //wp_enqueue_style( 'fvp_backend', FVP_URL . 'css/backend.css', array(), FVP_VERSION ); // development
77
  }
78
 
79
  /**
85
  $post_types = get_post_types(array("public" => true));
86
  foreach ($post_types as $post_type) {
87
  if($post_type != 'attachment')
88
+ add_meta_box("featured_video_plus-box", __('Featured Video', 'featured-video-plus'), array( &$this, 'metabox_content' ), $post_type, 'side', 'core');
89
  }
90
  }
91
 
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) );
114
 
115
  echo "\n\n\n<!-- Featured Video Plus Metabox -->\n";
116
+
117
+ // WordPress Version not supported error
118
+ if( get_bloginfo('version') < 3.1 )
119
+ printf ('<div class="fvp_warning"><p class="description"><strong>'.__('Outdated WordPress Version', 'featured-video-plus').':</strong>&nbsp'.__('There is WordPress 3.5 out there! The plugin supports older versions way back to 3.1 - but %s is defenitly to old!', 'featured-video-plus').'</p></div>', get_bloginfo('version') );
120
+
121
  // displays the current featured video
122
  if( $has_post_video )
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";
135
+ echo '<span style="font-weight: bold;">'.__('Supported Video Formats', 'featured-video-plus').':</span> <code>mp4</code>, <code>webM</code> '.__('or', 'featured-video-plus').' <code>ogg/ogv</code>. <a href="http://wordpress.org/extend/plugins/featured-video-plus/faq/">'.__('More information', 'featured-video-plus').'</a>.';
136
  echo "\n\t</p>\n</div>\n";
137
 
138
  // local videos not distinct warning
139
  echo '<div id="fvp_localvideo_notdistinct_warning" class="fvp_warning fvp_hidden">'."\n\t".'<p class="description">'."\n\t\t";
140
+ echo '<span style="font-weight: bold;">'.__('Fallback Video', 'featured-video-plus').':</span>&nbsp;'.__('The two input fields should contain the same video but in distinct formats.', 'featured-video-plus');
141
  echo "\n\t</p>\n</div>\n";
142
 
143
+ // how to use a local videos notice
144
+ $wrap = get_bloginfo('version') >= 3.3 ? '-wrap' : '';
145
+ $class = isset($meta['full']) && !empty($meta['full']) && isset($meta['valid']) && $meta['valid'] ? ' fvp_hidden' : '';
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
157
  $class = $meta['prov'] == 'local' || !$has_post_video || ($has_featimg && $featimg_is_fvp) ? ' class="fvp_hidden"' : '';
158
+ printf('<p id="fvp_set_featimg_box"'.$class.'>'."\n\t".'<span id="fvp_set_featimg_input">'."\n\t\t".'<input id="fvp_set_featimg" name="fvp_set_featimg" type="checkbox" value="set_featimg" />'."\n\t\t".'<label for="fvp_set_featimg">&nbsp;%s</label>'."\n\t".'</span>'."\n\t".'<a style="display: none;" id="fvp_set_featimg_link" href="#">%s</a>'."\n".'</p>'."\n", __('Set as Featured Image', 'featured-video-plus'), __('Set as Featured Image', 'featured-video-plus') );
159
+
160
+ // current theme does not support Featured Images
161
+ if( !current_theme_supports('post-thumbnails') && $options['overwrite'] )
162
+ echo '<p class="fvp_warning description"><span style="font-weight: bold;">'.__('The current theme does not support Featured Images', 'featured-video-plus').':</span>&nbsp;'.sprintf(__('To display Featured Videos you need to use the <code>Shortcode</code> or <code>PHP functions</code>. To hide this notice deactivate &quot;<em>Replace Featured Images</em>&quot; in the %sMedia Settings%s.', 'featured-video-plus'), '<a href="'.get_admin_url(null, '/options-media.php').'">', '</a>' )."</p>\n\n";
163
 
164
  echo "<!-- Featured Video Plus Metabox End-->\n\n\n";
165
  }
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
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
 
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'],
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(
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) )
338
+ break;
339
  $data = json_decode($result['body'], true);
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(
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]);
373
+ foreach( $llmeta as $line ) {
374
+ $thisline = explode(': ', $line);
375
+ $data[trim($thisline[0])] = trim($thisline[1]);
376
+ }
377
+
378
+ preg_match('#class="section_title".*>([\s\w]+)</span>#', $response['body'], $title);
379
+ preg_match('#id="body_text".*><p>(.*)<\/p><\/#', $response['body'], $desc);
380
+ $data['title'] = isset($title[1]) ? $title[1] : '';
381
+
382
+ $video_info = array(
383
+ 'title' => $data['title'],
384
+ 'description' => isset($desc[1]) ? $desc[1] : '',
385
+ 'filename' => sanitize_file_name($data['title']),
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);
400
+ if( !isset($proframe[1]) )
401
+ break;
402
+ $video_id = $proframe[1];
403
+ }
404
+ break;
405
  }
406
 
407
+ $valid = true;
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);
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
 
467
  update_post_meta( $post_id, '_fvp_video', serialize($meta) );
470
  }
471
 
472
  /**
473
+ * Initializes the help texts.
474
  *
475
+ * @since 1.3
 
476
  */
477
+ public function help() {
478
+ $mediahref = (get_bloginfo('version') >= 3.5) ? '<a href="#" class="insert-media" title="Add Media">' : '<a href="media-upload.php?post_id=4&amp;type=video&amp;TB_iframe=1&amp;width=640&amp;height=207" id="add_video" class="thickbox" title="Add Video">';
479
+ $general = (get_bloginfo('version') >= 3.5) ? sprintf( __('To use local videos, copy the <code>Link To Media File</code> from your %sMedia Library%s and paste it into the text field.', 'featured-video-plus'), $mediahref, '</a>' ) :
480
+ sprintf( __('To use local videos, copy the <code>File URL</code> from your %sMedia Library%s and paste it into the text field.', 'featured-video-plus'), $mediahref, '</a>' );
481
+
482
+ $this->help_localmedia = '
483
+ <h4 style="margin-bottom: 0;"></h4>
484
+ <p>'.$general.'&nbsp;'.__('The second text field is intended to hold the URL to the same video in a different format. It will be used as fallback if the primary file can not be played.','featured-video-plus').'&nbsp;<a href="http://videojs.com/#section4" target="_blank">'.__('More information','featured-video-plus').'</a>.</p>
485
+ <h4 style="margin-bottom: 0;">'.__('Supported Video Formats','featured-video-plus').':</h4>
486
+ <p style="margin-top: 0;"><code>webM</code>, <code>mp4</code>, <code>ogg/ogv</code></p>
487
+ <h4 style="margin-bottom: 0;">'.__('Converting your videos','featured-video-plus').':</h4>
488
+ <p style="margin-top: 0;">'.sprintf(__('Take a look at the %sMiro Video Converter%s. It is open source, lightweight and compatible with Windows, Mac and Linux.','featured-video-plus'),'<a href="http://www.mirovideoconverter.com/" target="_blank">','</a>').'</p>
489
+ <h4 style="margin-bottom: 0;">'.__('Fixing upload errors','featured-video-plus').':</h4>
490
+ <ul style="margin-top: 0;">
491
+ <li>'.sprintf(__('Read %sthis%s on how to increase the <strong>maximum file upload size</strong>.','featured-video-plus'),'<a href="http://www.wpbeginner.com/wp-tutorials/how-to-increase-the-maximum-file-upload-size-in-wordpress/" target="_blank">','</a>').'</li>
492
+ <li>'.sprintf(__('WordPress by default does not support <code>webM</code>. The plugin activates it, but under some conditions this might not be enough. %sHere%s you can get more information on this.','featured-video-plus'),'<a href="http://ottopress.com/2011/howto-html5-video-that-works-almost-everywhere/" target="_blank">','</a>').'</li>
493
+ </ul>
494
+ <h4 style="margin-bottom: 0;">'.__('Flash Fallback','featured-video-plus').':</h4>
495
+ <p style="margin-top: 0;">'.sprintf(__('The video player, %sVIDEOJS%s, features an Adobe Flash fallback. All you need to do is provide an <code>mp4</code>-video.', 'featured-video-plus'),'<a href="http://videojs.com/" target="_blank">','</a>')."</p>\n";
496
+
497
+ $dir = wp_upload_dir();
498
+ $this->help_urls = '
499
+ <p>'.__('These are some of the tested URL formats. Everything in bold is required, everything in brackets is optional.','featured-video-plus').'</p>
500
+ <ul>
501
+ <li>Local Videos:
502
+ <ul><li><code><strong>'.$dir['baseurl'].'/<em>FOLDER/FILENAME.webm|mp4|ogg|ogv</em></strong></code></li></ul></li>
503
+ <li>YouTube:
504
+ <ul><li><code>[http(s)://](www.)<strong>youtu.be/<em>ELEVENCHARS</em></strong>(?random=13)(?t=1m3s)</code></li>
505
+ <li><code>[http(s)://](www.)<strong>youtube.com/watch?v=<em>ELEVENCHARS</em></strong>(?random=13)(?t=1m3s)</code></li>
506
+ <li><code>[http(s)://](www.)<strong>youtube.com/v/<em>ELEVENCHARS</em></strong>(?random=13)(?t=1m3s)</code></li></ul></li>
507
+ <li>Vimeo:
508
+ <ul><li><code>(http(s)://)(www.)<strong>vimeo.com/<em>UNIQUEID</em></strong>(#stuff)</code></li></ul></li>
509
+ <li>Dailymotion:
510
+ <ul><li><code>(http(s)://)(www.)<strong>dailymotion.com/video/<em>UNIQUEID</em></strong>(_video_title)(#stuff)</code></li></ul></li>
511
+ <li>Liveleak:
512
+ <ul><li><code>(http(s)://)(www.)<strong>liveleak.com/view?i=<em>LIV_ELEAKUNQID</em></strong></code></li></ul></li>
513
+ </ul>'."\n";
514
  }
515
 
516
  /**
517
+ * Adds help tabs to contextual help. WordPress 3.3+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
518
  *
519
+ * @see http://codex.wordpress.org/Function_Reference/add_help_tab
 
 
 
 
 
 
 
 
 
 
 
 
 
520
  *
521
+ * @since 1.3
 
 
 
522
  */
523
+ public function tabs() {
524
+ $screen = get_current_screen();
525
+ if( $screen->id != 'post' )
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'),
540
+ 'content' => $this->help_urls
541
+ ));
542
+ }
543
  }
544
 
545
  /**
546
+ * Adds help text to contextual help. WordPress 3.3-
547
  *
548
+ * @see http://wordpress.stackexchange.com/a/35164
 
 
 
 
 
 
 
 
 
 
 
 
549
  *
550
+ * @since 1.3
551
  */
552
+ public function help_pre_33( $contextual_help, $screen_id, $screen ) {
553
+ if( $screen->id != 'post' )
554
+ return $contextual_help;
 
 
 
 
 
555
 
556
+ $contextual_help .= '<hr /><h3>'.__('Featured Video','featured-video-plus').':&nbsp;'.__('Local Media', 'featured-video-plus').'</h3>';
557
+ $contextual_help .= $this->help_localmedia;
558
+ $contextual_help .= '<h3>'.__('Featured Video','featured-video-plus').':&nbsp;'.__('Valid URLs', 'featured-video-plus').'</h3>';
559
+ $contextual_help .= $this->help_urls;
 
560
 
561
+ return $contextual_help;
 
562
  }
563
 
564
  /**
567
  * @see http://codex.wordpress.org/Plugin_API/Filter_Reference/upload_mimes
568
  * @since 1.2
569
  */
 
570
  function add_upload_mimes( $mimes=array() ) {
571
  $mimes['webm'] = 'video/webm';
572
 
php/frontend.php CHANGED
@@ -54,21 +54,7 @@ class featured_video_plus_frontend {
54
  if( !$options['overwrite'] || !$this->featured_video_plus->has_post_video( $post_id ) )
55
  return $html;
56
 
57
- if( isset($_wp_additional_image_sizes[$size]) )
58
- $size = array( $_wp_additional_image_sizes[$size]['width'], $_wp_additional_image_sizes[$size]['height'] );
59
- else {
60
-
61
- if( $size == 'thumbnail' || $size == 'thumb' )
62
- $size = array( get_option( 'thumbnail_size_w' ), get_option( 'thumbnail_size_h' ) );
63
- else if( $size == 'medium' )
64
- $size = array( get_option( 'medium_size_w' ), get_option( 'medium_size_h' ) );
65
- else if( $size == 'large' )
66
- $size = array( get_option( 'large_size_w' ), get_option( 'large_size_h' ) );
67
-
68
- }
69
-
70
  return $this->featured_video_plus->get_the_post_video( $post_id, $size );
71
-
72
  }
73
  }
74
  ?>
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
  ?>
php/general.php CHANGED
@@ -3,7 +3,7 @@
3
  * Class containing all functions needed on front- AND backend. Functions only needed on one of those are found in distinct classes.
4
  *
5
  * @author ahoereth
6
- * @version 2013/01/09
7
  * @see ../featured_video_plus.php
8
  * @see featured_video_plus_backend in backend.php
9
  * @see featured_video_plus_frontend in frontend.php
@@ -20,27 +20,29 @@ class featured_video_plus {
20
  public function enqueue($hook_suffix) {
21
  // just required on post.php
22
  if( !is_admin() || ( $hook_suffix == 'post.php' && isset($_GET['post']) ) ) {
23
- $options = get_option( 'fvp-settings' );
24
 
25
  // http://videojs.com/
26
- wp_enqueue_style( 'videojs', 'http://vjs.zencdn.net/c/video-js.css' );
27
  wp_enqueue_script( 'videojs', 'http://vjs.zencdn.net/c/video.js' );
 
28
 
29
- if( isset($options['width']) && $options['width'] == 'auto' )
30
- wp_enqueue_script('fvp_fitvids', plugins_url(). '/featured-video-plus/js/jquery.fitvids_fvp-min.js', array( 'jquery' ), '20121207', true ); // production
31
- //wp_enqueue_script('fvp_fitvids', plugins_url(). '/featured-video-plus/js/jquery.fitvids_fvp.js', array( 'jquery' ), '20121207', true ); // development
 
32
  }
33
  }
34
 
35
  /**
36
  * Returns the featured video html, ready to echo.
37
  *
 
 
38
  * @param int $post_id
39
  * @param string|array $size
40
  * @param bool $allowfullscreen
41
  * @param bool $container
42
  */
43
- public function get_the_post_video($post_id = null, $size = array( 560, 315 ), $allowfullscreen = true, $container = true) {
44
 
45
  if($post_id == null)
46
  $post_id = $GLOBALS['post']->ID;
@@ -51,8 +53,29 @@ class featured_video_plus {
51
  $meta = unserialize( get_post_meta($post_id, '_fvp_video', true) );
52
  $options = get_option( 'fvp-settings' );
53
 
54
- $width = $size[0];
55
- $height = ($options['height'] == 'auto') ? round($width / 16 * 9) : $size[1];
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
56
 
57
  if( isset($meta['id']) && !empty($meta['id']) ) {
58
  switch( $meta['prov'] ) {
@@ -63,7 +86,7 @@ class featured_video_plus {
63
  $ext = pathinfo( $meta['full'], PATHINFO_EXTENSION );
64
  if( $ext != 'mp4' && $ext != 'ogv' && $ext != 'webm' && $ext != 'ogg' ) break;
65
  $ext = $ext == 'ogv' ? 'ogg' : $ext;
66
- $embed = "\n\t".'<video class="video-js vjs-default-skin" controls preload="auto" width="'.$width.'" height="'.$height.'" >'; // poster="'.$featimg.'" data-setup="{}"
67
  $embed .= "\n\t\t".'<source src="' . $meta['full'] . '" type="video/'.$ext.'">';
68
 
69
  if( isset($meta['sec_id']) && !empty($meta['sec_id']) ) {
@@ -78,24 +101,48 @@ class featured_video_plus {
78
 
79
  case 'vimeo':
80
  $options = get_option( 'fvp-settings' );
81
- $fs = $allowfullscreen ? ' webkitAllowFullScreen mozallowfullscreen allowFullScreen' : '';
82
- $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"'.$fs.'></iframe>' . "\n";
83
  break;
84
 
85
  case 'youtube':
86
- $fs = $allowfullscreen ? 'allowfullscreen' : '';
87
- $attr = '#t=' . $meta['attr'];
88
- $embed = "\n\t" . '<iframe width="'.$width.'" height="'.$height.'" src="http://www.youtube.com/embed/'.$meta['id'].'?rel=0'.$attr.'" frameborder="0" ' . $fs . '></iframe>' . "\n";
 
 
 
 
 
 
89
  break;
90
 
91
  case 'dailymotion':
92
- $embed = "\n" . '<iframe src="http://www.dailymotion.com/embed/video/'.$meta['id'].'?logo=1&amp;info='.$options['vimeo']['title'].'" width="'.$width.'" height="'.$height.'" frameborder="0"></iframe>' . "\n";
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
93
  break;
94
 
95
  }
96
 
97
- if($container)
98
- $embed = "<div class=\"featured_video_plus\">" . $embed . "</div>\n\n";
99
 
100
  $embed = "\n\n<!-- Featured Video Plus v".FVP_VERSION."-->\n" . $embed;
101
 
@@ -107,6 +154,8 @@ class featured_video_plus {
107
  /**
108
  * Checks if current post or post provided by parameter has a featured video.
109
  *
 
 
110
  * @param int $post_id id of post to check for featured video
111
  */
112
  public function has_post_video($post_id = null){
@@ -126,16 +175,27 @@ class featured_video_plus {
126
  /**
127
  * Shortcode for usage in post or page entries. Echos the post's featured video.
128
  *
 
 
129
  * @param array $atts can contain the width and/or height how the featured video should be displayed in px, optional
130
  */
131
  function shortcode($atts){
132
 
133
- $w = isset($atts['width']) ? $atts['width'] : '560';
134
- $h = isset($atts['height']) ? $atts['height'] : '315';
135
 
136
  if($this->has_post_video())
137
- echo $this->get_the_post_video(null, $w, $h, true, false);
 
 
138
 
 
 
 
 
 
 
 
139
  }
140
  }
141
  ?>
3
  * Class containing all functions needed on front- AND backend. Functions only needed on one of those are found in distinct classes.
4
  *
5
  * @author ahoereth
6
+ * @version 2013/01/15
7
  * @see ../featured_video_plus.php
8
  * @see featured_video_plus_backend in backend.php
9
  * @see featured_video_plus_frontend in frontend.php
20
  public function enqueue($hook_suffix) {
21
  // just required on post.php
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
 
35
  /**
36
  * Returns the featured video html, ready to echo.
37
  *
38
+ * @since 1.0
39
+ *
40
  * @param int $post_id
41
  * @param string|array $size
42
  * @param bool $allowfullscreen
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;
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'] ) {
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']) ) {
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
 
119
  case 'dailymotion':
120
+ $dm['foreground'] = isset($options['dailymotion']['foreground']) ? $options['dailymotion']['foreground'] : 'F7FFFD';
121
+ $dm['highlight'] = isset($options['dailymotion']['highlight']) ? $options['dailymotion']['highlight'] : 'FFC300';
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
+
129
+ case 'liveleak':
130
+ $embed = "\n" . '<iframe width="'.$width.'" height="'.$height.'" src="http://www.liveleak.com/ll_embed?f='.$meta['id'].'" frameborder="0" allowfullscreen></iframe>';
131
+ break;
132
+
133
+ case 'prochan':
134
+ $embed = "\n" . '<iframe width="'.$width.'" height="'.$height.'" src="http://www.prochan.com/embed?f='.$meta['id'].'" frameborder="0" allowfullscreen></iframe>';
135
+ break;
136
+
137
+ default:
138
+ $embed = '';
139
+ $container = false;
140
  break;
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;
148
 
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){
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
+ /**
193
+ * Initializes localization i18n
194
+ *
195
+ * @since 1.3
196
+ */
197
+ function language() {
198
+ load_plugin_textdomain('featured-video-plus', FVP_DIR . 'lng/', FVP_NAME . '/lng/' );
199
  }
200
  }
201
  ?>
php/settings.php ADDED
@@ -0,0 +1,376 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
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
+ */
10
+ class featured_video_plus_settings {
11
+ private $help_shortcode;
12
+ private $help_functions;
13
+
14
+ /**
15
+ * Initialises the plugin settings section, the settings fields and registers the options field and save function.
16
+ *
17
+ * @see http://codex.wordpress.org/Settings_API
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');
28
+ add_settings_field('fvp-settings-dailymotion', __('Dailymotion Player Options', 'featured-video-plus'), array( &$this, 'settings_dailymotion' ),'media', 'fvp-settings-section');
29
+ add_settings_field('fvp-settings-rate', __('Support', 'featured-video-plus'), array( &$this, 'settings_rate' ), 'media', 'fvp-settings-section');
30
+
31
+ register_setting('media', 'fvp-settings', array( &$this, 'settings_save' ));
32
+ }
33
+
34
+ /**
35
+ * The settings section content. Describes the plugin settings, the php functions and the WordPress shortcode.
36
+ *
37
+ * @since 1.0
38
+ */
39
+ function settings_content() {
40
+ $wrap = get_bloginfo('version') >= 3.3 ? '-wrap' : ''; ?>
41
+
42
+ <p>
43
+ <?php printf(__('To display your featured videos you can either make use of the automatic replacement, use the %s or manually edit your theme\'s source files to make use of the plugins PHP-functions.', 'featured-video-plus'), '<code>[featured-video-plus]</code>-Shortcode'); ?>
44
+ <?php printf(__('For more information about Shortcode and PHP functions see the %sContextual Help%s.', 'featured-video-plus'), '<a href="#contextual-help'.$wrap.'" id="fvp_help_toggle">', '</a>'); ?>
45
+ </p>
46
+
47
+ <?php }
48
+
49
+ /**
50
+ * Displays the setting if the plugin should display the featured video in place of featured images.
51
+ *
52
+ * @since 1.0
53
+ */
54
+ function settings_overwrite() {
55
+ $options = get_option( 'fvp-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
+
63
+ <?php
64
+ $class = $overwrite ? 'fvp_warning ' : 'fvp_notice ';
65
+ if( !current_theme_supports('post-thumbnails') )
66
+ echo '<p class="'.$class.'description"><span style="font-weight: bold;">'.__('The current theme does not support Featured Images', 'featured-video-plus').':</span>&nbsp;'.__('To display Featured Videos you need to use the <code>Shortcode</code> or <code>PHP functions</code>.', 'featured-video-plus').'</p>'."\n";
67
+
68
+ }
69
+
70
+ /**
71
+ * Displays the setting if the plugin should fit the width of the videos automatically or use fixed widths.
72
+ *
73
+ * @since 1.3
74
+ */
75
+ function settings_sizing() {
76
+ $options = get_option( 'fvp-settings' );
77
+ $wmode = isset($options['sizing']['wmode']) && $options['sizing']['wmode'] == 'auto' ? 'auto' : 'fixed';
78
+ $hmode = isset($options['sizing']['hmode']) && $options['sizing']['hmode'] == 'auto' ? 'auto' : 'fixed';
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>
87
+ <span class="fvp_grouppart1">
88
+ <input class="fvp_toggle" type="checkbox" name="fvp-settings[sizing][width][auto]" id="fvp-settings-width-auto" value="auto" <?php checked( 'auto', $wmode, true ) ?>/>
89
+ <label for="fvp-settings-width-auto">&nbsp;auto&nbsp;<span style="font-style: italic;">(<?php _e('default', 'featured-video-plus'); ?>)</span></label>
90
+ </span>
91
+ <input class="fvp_input<?php echo $wclass; ?>" type="text" name="fvp-settings[sizing][width][fixed]" id="fvp-settings-width-fixed" value="<?php echo $width; ?>" size="4" maxlength="4" style="text-align: right; width: 3em;" <?php if('auto'==$wmode) echo 'readonly="readonly"'; ?>/>
92
+ <label for="fvp-settings-width-fixed">&nbsp;px</label>
93
+ </span>
94
+ <br />
95
+ <span class="fvp_toggle_input">
96
+ <label class="fvp_grouplable"><?php _e('Height', 'featured-video-plus'); ?>:</label>
97
+ <span class="fvp_grouppart1">
98
+ <input class="fvp_toggle" type="checkbox" name="fvp-settings[sizing][height][auto]" id="fvp-settings-height-auto" value="auto" <?php checked( 'auto', $hmode, true ) ?>/>
99
+ <label for="fvp-settings-height-auto">&nbsp;auto&nbsp;<span style="font-style: italic;">(<?php _e('default', 'featured-video-plus'); ?>)</span></label>
100
+ </span>
101
+ <input class="fvp_input<?php echo $hclass; ?>" type="text" name="fvp-settings[sizing][height][fixed]" id="fvp-settings-height-fixed" value="<?php echo $height; ?>" size="4" maxlength="4" style="text-align: right; width: 3em;" <?php if('auto'==$hmode) echo 'readonly="readonly"'; ?>/>
102
+ <label for="fvp-settings-height-fixed">&nbsp;px</label>
103
+ </span>
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
+ *
121
+ * @see https://github.com/zencoder/video-js/blob/master/docs/skins.md
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' );
128
+ $videojs['skin'] = isset($options['videojs']['skin']) ? $options['videojs']['skin'] : 'default'; ?>
129
+
130
+ <input type="radio" name="fvp-settings[videojs][skin]" id="fvp-settings-videojs-skin-1" value="videojs" <?php checked( 'videojs', $videojs['skin'], true ) ?>/><label for="fvp-settings-videojs-skin-1">&nbsp;<?php _e('default', 'featured-video-plus'); ?></label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
131
+ <input type="radio" name="fvp-settings[videojs][skin]" id="fvp-settings-videojs-skin-2" value="tubecss" <?php checked( 'tubecss', $videojs['skin'], true ) ?>/><label for="fvp-settings-videojs-skin-2">&nbsp;TubeCSS</label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
132
+ <input type="radio" name="fvp-settings[videojs][skin]" id="fvp-settings-videojs-skin-3" value="moonify" <?php checked( 'moonify', $videojs['skin'], true ) ?>/><label for="fvp-settings-videojs-skin-3">&nbsp;Moonify</label>&nbsp;(<a style="font-style: italic;" href="http://jlofstedt.com/moonify/" target="_blank">info</a>)&nbsp;&nbsp;&nbsp;&nbsp;
133
+
134
+ <?php
135
+ __('VIDEOJS Player Options', 'featured-video-plus'); // translate it, even if not yet integrated
136
+ }
137
+
138
+ /**
139
+ * Displays the settings to style the YouTube video player.
140
+ *
141
+ * @see https://developers.google.com/youtube/player_parameters
142
+ * @since 1.3
143
+ */
144
+ function settings_youtube() {
145
+ $options = get_option( 'fvp-settings' );
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
+
161
+ /**
162
+ * Displays the settings to style the vimeo video player. Default: &amp;title=1&amp;portrait=0&amp;byline=1&amp;color=00adef
163
+ *
164
+ * @see http://developer.vimeo.com/player/embedding
165
+ * @see http://make.wordpress.org/core/2012/11/30/new-color-picker-in-wp-3-5/
166
+ * @see http://codex.wordpress.org/Function_Reference/wp_style_is
167
+ * @since 1.0
168
+ */
169
+ function settings_vimeo() {
170
+ $options = get_option( 'fvp-settings' );
171
+ $vimeo['portrait'] = isset($options['vimeo']['portrait']) ? $options['vimeo']['portrait'] : 0;
172
+ $vimeo['title' ] = isset($options['vimeo']['title' ]) ? $options['vimeo']['title' ] : 1;
173
+ $vimeo['byline'] = isset($options['vimeo']['byline']) ? $options['vimeo']['byline'] : 1;
174
+ $vimeo['color' ] = isset($options['vimeo']['color' ]) ? $options['vimeo']['color' ] : '00adef'; ?>
175
+
176
+ <div style="position: relative; bottom: .6em;">
177
+ <input type="checkbox" name="fvp-settings[vimeo][portrait]" id="fvp-settings-vimeo-1" value="display" <?php checked( 1, $vimeo['portrait'], 1 ) ?>/><label for="fvp-settings-vimeo-1">&nbsp;<?php _e('Portrait', 'featured-video-plus'); ?></label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
178
+ <input type="checkbox" name="fvp-settings[vimeo][title]" id="fvp-settings-vimeo-2" value="display" <?php checked( 1, $vimeo['title'], 1 ) ?>/><label for="fvp-settings-vimeo-2">&nbsp;<?php _e('Title', 'featured-video-plus'); ?></label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
179
+ <input type="checkbox" name="fvp-settings[vimeo][byline]" id="fvp-settings-vimeo-3" value="display" <?php checked( 1, $vimeo['byline'], 1 ) ?>/><label for="fvp-settings-vimeo-3">&nbsp;<?php _e('Byline', 'featured-video-plus'); ?></label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
180
+ <span class="color-picker" style="position: relative;<?php if( wp_style_is( 'wp-color-picker', 'done' ) ) echo ' top: .6em;'; ?>" >
181
+ <input type="text" name="fvp-settings[vimeo][color]" id="fvp-settings-vimeo-color" value="#<?php echo $vimeo['color'] ?>" data-default-color="#00adef" />
182
+ <label for="fvp-settings-vimeo-color" style="display: none;">&nbsp;<?php _e('Color', 'featured-video-plus'); ?></label>
183
+ <?php if( !wp_style_is('wp-color-picker', 'registered' ) ) { ?><div class="fvp_colorpicker" id="fvp-settings-vimeo-colorpicker"></div><?php } ?>
184
+ </span>
185
+ </div>
186
+ <p class="description"><?php _e('Vimeo Plus Videos might ignore these settings.', 'featured-video-plus'); ?></p>
187
+
188
+ <?php
189
+ }
190
+
191
+ /**
192
+ * Displays the settings to style the Dailymotion video player.
193
+ *
194
+ * @see https://developers.google.com/youtube/player_parameters
195
+ * @see http://make.wordpress.org/core/2012/11/30/new-color-picker-in-wp-3-5/
196
+ * @see http://codex.wordpress.org/Function_Reference/wp_style_is
197
+ * @since 1.3
198
+ */
199
+ function settings_dailymotion() {
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" />
212
+ <label for="fvp-settings-dailymotion-foreground" style="display: none;">&nbsp;<?php _e('Foreground', 'featured-video-plus'); ?></label>
213
+ <?php if( !wp_style_is('wp-color-picker', 'registered' ) ) { ?><div class="fvp_colorpicker" id="fvp-settings-dailymotion-foreground-colorpicker"></div><?php } ?>
214
+ </span>
215
+ <span class="color-picker" style="position: relative;<?php if( wp_style_is( 'wp-color-picker', 'done' ) ) echo ' top: .6em;'; ?>" >
216
+ <input type="text" name="fvp-settings[dailymotion][highlight]" id="fvp-settings-dailymotion-highlight" value="#<?php echo $dailymotion['highlight'] ?>" data-default-color="#ffc300" />
217
+ <label for="fvp-settings-dailymotion-highlight" style="display: none;">&nbsp;<?php _e('Highlight', 'featured-video-plus'); ?></label>
218
+ <?php if( !wp_style_is('wp-color-picker', 'registered' ) ) { ?><div class="fvp_colorpicker" id="fvp-settings-dailymotion-highlight-colorpicker"></div><?php } ?>
219
+ </span>
220
+ <span class="color-picker" style="position: relative;<?php if( wp_style_is( 'wp-color-picker', 'done' ) ) echo ' top: .6em;'; ?>" >
221
+ <input type="text" name="fvp-settings[dailymotion][background]" id="fvp-settings-dailymotion-background" value="#<?php echo $dailymotion['background'] ?>" data-default-color="#171d1b" />
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
+
228
+ /**
229
+ * Displays info about rating the plugin, giving feedback and requesting new features
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.
245
+ *
246
+ * @since 1.0
247
+ */
248
+ function settings_save($input) {
249
+ $hexcolor = '/#?([0123456789abcdef]{3}[0123456789abcdef]{0,3})/i';
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';
267
+
268
+ // YouTube
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
+
275
+ // Vimeo
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
+
295
+ /**
296
+ * Initializes the help texts.
297
+ *
298
+ * @since 1.3
299
+ */
300
+ public function help() {
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
+ /**
330
+ * Adds help tabs to contextual help. WordPress 3.3+
331
+ *
332
+ * @see http://codex.wordpress.org/Function_Reference/add_help_tab
333
+ *
334
+ * @since 1.3
335
+ */
336
+ public function tabs() {
337
+ $screen = get_current_screen();
338
+ if( ($screen->id != 'options-media') || (get_bloginfo('version') < 3.3) )
339
+ return;
340
+
341
+ // PHP FUNCTIONS HELP TAB
342
+ $screen->add_help_tab( array(
343
+ 'id' => 'fvp_help_functions',
344
+ 'title' => 'Featured Video Plus: '.__('PHP-Functions','featured-video-plus'),
345
+ 'content' => $this->help_functions
346
+ ));
347
+
348
+ // SHORTCODE HELP TAB
349
+ $screen->add_help_tab( array(
350
+ 'id' => 'fvp_help_shortcode',
351
+ 'title' => 'Featured Video Plus: Shortcode',
352
+ 'content' => $this->help_shortcode
353
+ ));
354
+ }
355
+
356
+ /**
357
+ * Adds help text to contextual help. WordPress 3.3-
358
+ *
359
+ * @see http://wordpress.stackexchange.com/a/35164
360
+ *
361
+ * @since 1.3
362
+ */
363
+ public function help_pre_33( $contextual_help, $screen_id, $screen ) {
364
+ if( $screen->id != 'options-media' )
365
+ return $contextual_help;
366
+
367
+ $contextual_help .= '<hr /><h3>Featured Video Plus: '.__('PHP-Functions','featured-video-plus').'</h3>';
368
+ $contextual_help .= $this->help_functions;
369
+ $contextual_help .= '<h3>Featured Video Plus: Shortcode</h3>';
370
+ $contextual_help .= $this->help_shortcode;
371
+
372
+ return $contextual_help;
373
+ }
374
+
375
+ }
376
+ ?>
php/upgrade.php CHANGED
@@ -5,10 +5,8 @@
5
  * @since 1.2
6
  */
7
  function featured_video_plus_upgrade() {
 
8
 
9
- $featured_video_plus_notices = new featured_video_plus_notices();
10
-
11
- $options = get_option( 'fvp-settings', 'none' );
12
  if( !isset($options) || $options == 'none')
13
  $version = '0';
14
  elseif( !isset($options['version']) )
@@ -16,42 +14,89 @@ function featured_video_plus_upgrade() {
16
  else
17
  $version = $options['version'];
18
 
19
- switch( $version ) {
20
-
21
- case '0':
22
- $options = array(
23
- 'version' => '1.2',
24
- 'overwrite' => true,
25
- 'width' => 'auto',
26
- 'height' => 'auto',
27
- 'vimeo' => array(
28
- 'portrait' => 0,
29
- 'title' => 1,
30
- 'byline' => 1,
31
- 'color' => '00adef'
32
- )
33
- );
34
-
35
- add_action('admin_notices', array( &$featured_video_plus_notices, 'initial_activation' ) );
36
- break;
37
-
38
- case '1.0':
39
- case '1.1':
40
- $options['version'] = '1.2';
41
-
42
- // remove no longer needed user meta
43
- $users = array_merge( get_users( array( 'role' => 'Administrator' ) ), get_users( array( 'role' => 'Super Admin' ) ) );
44
- foreach( $users as $user ) {
45
- delete_user_meta( $user->ID, 'fvp_activation_notification_ignore' );
46
- }
47
-
48
- add_action('admin_notices', array( &$featured_video_plus_notices, 'upgrade_11' ) );
49
- break;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
50
 
 
 
 
 
 
 
 
51
  }
52
 
53
- update_option( 'fvp-settings', $options );
 
 
 
 
 
 
 
54
 
 
 
55
  }
56
 
57
  /**
@@ -65,24 +110,36 @@ function featured_video_plus_upgrade() {
65
  class featured_video_plus_notices {
66
 
67
  /**
68
- * Upgrade notification 1.1 to 1.2
 
 
 
 
 
 
 
 
 
 
 
69
  *
70
  * @since 1.2
71
  */
72
  function upgrade_11() {
73
  echo "\n" . '<div class="updated" id="fvp_activation_notification"><p>';
74
- printf('Featured Video Plus was <span style="font-weight: bold;">upgraded</span>. Version <span style="font-weight: bold;">1.2</span> now supports <span style="font-weight: bold;">local videos</span>. If you like the plugin please <a href="%1$s">rate it</a>.', 'http://wordpress.org/extend/plugins/featured-video-plus/');
75
  echo "</p></div>\n";
76
  }
77
 
78
  /**
79
  * Notification shown when plugin is newly activated.
 
80
  *
81
  * @since 1.0
82
  */
83
  function initial_activation() {
84
  echo "\n" . '<div class="updated" id="fvp_activation_notification"><p>';
85
- printf('Featured Video Plus is ready to use. There is a new box on post & page edit screens for you to add video URLs. <span style="font-weight: bold;">Take a look at your new <a href="%1$s" title="Media Settings">Media Settings</a></span>.', get_admin_url(null, '/options-media.php?fvp_activation_notification_ignore=0'));
86
  echo "</p></div>\n";
87
  }
88
 
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']) )
14
  else
15
  $version = $options['version'];
16
 
17
+ if( $version != FVP_VERSION ) {
18
+ switch( $version ) {
19
+ case '0':
20
+ $notice = 'initial_activation';
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
+
34
+
35
+ case '1.0':
36
+ case '1.1':
37
+ $notice = isset($notice) ? $notice : 'upgrade_11';
38
+
39
+ if( $version == '1.0' || $version == '1.1' ) {
40
+ // removed this user meta in 1.2
41
+ $users = array_merge( get_users( array( 'role' => 'Administrator' ) ),
42
+ get_users( array( 'role' => 'Super Admin' ) ) );
43
+ foreach( $users as $user )
44
+ delete_user_meta( $user->ID, 'fvp_activation_notification_ignore' );
45
+ }
46
+
47
+
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
+ );
56
+ $options['youtube'] = array(
57
+ 'theme' => 'dark',
58
+ 'color' => 'red',
59
+ 'info' => 1,
60
+ 'rel' => 1,
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
  /**
110
  class featured_video_plus_notices {
111
 
112
  /**
113
+ * Upgrade notification 1.2 to current version
114
+ *
115
+ * @since 1.3
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
+
123
+ /**
124
+ * Upgrade notification 1.1 to current version
125
  *
126
  * @since 1.2
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
 
134
  /**
135
  * Notification shown when plugin is newly activated.
136
+ * Upgrade from 0 to current version
137
  *
138
  * @since 1.0
139
  */
140
  function initial_activation() {
141
  echo "\n" . '<div class="updated" id="fvp_activation_notification"><p>';
142
+ printf(__('Featured Video Plus is <strong>ready to use</strong>. There is a new box on post & page edit screens for you to add videos. <strong>Take a look at your new %sMedia Settings%s</strong>.', 'featured-video-plus'), '<a href="'.get_admin_url(null, '/options-media.php').'" title="Media Settings">', '</a>');
143
  echo "</p></div>\n";
144
  }
145
 
readme.txt CHANGED
@@ -2,7 +2,7 @@
2
  Contributors: a.hoereth
3
  Plugin Name: Featured Video Plus
4
  Plugin URI: https://github.com/ahoereth/featured-video-plus
5
- Tags: featured video, featured image, featured, video, post video, post thumbnail, post, thumbnail, html5, flash, youtube, vimeo, dailymotion, mp4, webm, ogg, ogv
6
  Author: Alexander Höreth
7
  Author URI: http://ahoereth.yrnxt.com/
8
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=a%2ehoereth%40gmail%2ecom
@@ -10,25 +10,22 @@ 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.2
14
-
15
- Add Featured Videos to your posts and pages, just like you add Featured Images. Supports your Local Videos, YouTube, Vimeo and Dailymotion.
16
 
 
17
 
18
  == Description ==
19
  *A picture is worth a thousand words. How many words is a video worth?*
20
 
21
- This plugin enables you to define Featured Videos in addition to Featured Images. Themes using Featured Images automatically display the videos in place.
22
-
23
- There are three ways to get the videos onto your page:
24
 
25
- 1. If your theme already makes use of Featured Images, these will automatically be replaced by Featured Videos if available. Alternatively you can
26
- 2. insert the `[featured-video-plus]` shortcode in your entries or
27
- 3. manually use the PHP functions in your theme's source files.
28
 
29
- Beside your __Local Videos__ (`mp4`, `webM` & `ogg/ogv`) you can use __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).
30
 
31
- The plugin adds some individualization options to your Media Settings. Beside aesthetic customizations you can turn off automatic integration and tweak some technical settings.
32
 
33
  = Shortcode =
34
 
@@ -36,29 +33,38 @@ The plugin adds some individualization options to your Media Settings. Beside ae
36
  [featured-video-plus width=300]
37
 
38
  = PHP functions =
 
39
 
40
- the_post_video(array(width, height), fullscreen = true)
41
  has_post_video(post_id)
42
- get_the_post_video(post_id, size(width, height), fullscreen = true)
43
 
44
- All parameters are optional. If no post_id is given the current post's id will be used.
45
 
46
 
47
 
48
- *This plugin was created with the original [Featured Video](http://wordpress.org/extend/plugins/featured-video/) plugin in mind. __Featured Video Plus__ was freshly coded from ground up to be more powerful, bring you more features and to integrate more seamless into WordPress.*
49
 
50
 
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 plugins 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! If you want to use Local Videos they need to be `mp4`, `webM` or `ogg/ogv`. If you want to change some settings have a look under Settings -> Media.
58
 
59
 
60
  == Changelog ==
61
 
 
 
 
 
 
 
 
 
 
62
  = 1.2 =
63
  * __Added support for local videos__
64
  * Allow webM mime type for media upload
@@ -80,6 +86,9 @@ The plugin is ready to go. Now edit your posts and add video links to the "Featu
80
 
81
  == Upgrade Notice ==
82
 
 
 
 
83
  = 1.2 =
84
  Now featuring your local videos!
85
 
@@ -97,8 +106,10 @@ Feature Dailymotion Videos on your posts!
97
  == Frequently Asked Questions ==
98
 
99
  = After adding the URL and saving the post I do not get any video? =
100
- Maybe the plugin does not recognize the URL. Try the URL you get when clicking on share below a youtube video or the simple vimeo URL, which should look something like this: http://vimeo.com/32071937
101
- If you want to you can post the URL which is not working in the support forums and the plugin might work with it in the next release.
 
 
102
 
103
  = My theme uses Featured Images. Why are my videos not being displayed in place? =
104
  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.
@@ -106,26 +117,11 @@ On the technical side your theme needs to feature [Post Thumbnails](http://codex
106
 
107
  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.
108
 
109
- = Why do my videos do not fit their container? =
110
- Take a look at your media settings and try tweaking the video size. For most installations the sizing works fine by default, if it still does not: I'm [happy to help](http://wordpress.org/support/plugin/featured-video-plus).
111
-
112
- = I activated local video support, how do I use it? =
113
- * Add a __mp4__, __webM__ or __ogv__ video to your Media Library
114
- * Copy the `Link To Media File` and paste it into the Featured Video box
115
- * For better [compatibility](http://videojs.com/#compatibilitychart) upload a second version of the same video with a different format and paste the URL in the second input box as a fallback.
116
-
117
- = What is the easiest way to get my video into these formats? =
118
- Take a look at the [Miro Video Converter](http://www.mirovideoconverter.com/). It is open source, lightweight and compatible with Windows, Mac and Linux.
119
-
120
- = What can I do about those errors I get when uploading my video? =
121
- * Read [this](http://www.wpbeginner.com/wp-tutorials/how-to-increase-the-maximum-file-upload-size-in-wordpress/) on how to increase maximum file upload size.
122
- * WordPress by default does not support webM. The plugin activates it, but under some conditions this might not be enough and you might want to take a look at this [post](http://ottopress.com/2011/howto-html5-video-that-works-almost-everywhere/).
123
-
124
- = What happens if the user does not use a HTML5 compatible browser? =
125
- The video player, [VIDEOJS](http://videojs.com/), features an adobe flash fallback if you provide an MP4 video.
126
 
127
  = What about other video portals? =
128
  Leave me a note in the support forums which you would like and I will consider adding them in the next release.
129
 
130
- = Are there translations available? =
131
- Not yet, but I will add translation capabilities soon. Interested in translating the plugin? Contact me!
2
  Contributors: a.hoereth
3
  Plugin Name: Featured Video Plus
4
  Plugin URI: https://github.com/ahoereth/featured-video-plus
5
+ Tags: featured video, featured image, featured, video, post video, post thumbnail, post, thumbnail, html5, flash, youtube, vimeo, dailymotion, mp4, webm, ogg, ogv, embed
6
  Author: Alexander Höreth
7
  Author URI: http://ahoereth.yrnxt.com/
8
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=a%2ehoereth%40gmail%2ecom
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
 
17
  == Description ==
18
  *A picture is worth a thousand words. How many words is a video worth?*
19
 
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
  [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
 
44
 
45
+ *This plugin was created with the original [Featured Video](http://wordpress.org/extend/plugins/featured-video/) plugin in mind. __Featured Video Plus__ was freshly coded from ground up to bring you more features and to integrate more seamless into WordPress.*
46
 
47
 
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*.
55
 
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
86
 
87
  == Upgrade Notice ==
88
 
89
+ = 1.3 =
90
+ Internationalization! More user friendly, more customizations.
91
+
92
  = 1.2 =
93
  Now featuring your local videos!
94
 
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.
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.