Version Description
- Maintenance: Removed a number of redundant/broken features. Learn more.
- Maintenance: Updated download link to use KeepVid.
- Maintenance: Re-written admin screen to use WordPress standard method of displaying settings. Oh, and the widget settings too.
- Maintenance: ...speaking of which, revised the options available to widgets.
- Maintenance: Merged many of the files where there wasn't a huge amount of content.
- Maintenance: Renamed menu slugs as they were too generic and may cause clashes with other plugins or themes that are silly enough to do the same thing.
- Enhancement: Revised profile screen to make it clearer, via the art of the icon, which parameters are compatible with which embed type.
- Enhancement: If you go a bit "ape" with the parameters and manual playlists, it's possible to exceed the URL size limit. I've now put a check in place to report this, if it occurs.
- Enhancement: Added modest branding as a parameter (before was only selectable via the profile screen).
- Enhancement: Improved the meta data.
- Bugs: Many of them. Fixed. Hoorah.
Download this release
Release Info
Developer | dartiss |
Plugin | YouTube Embed |
Version | 4.0 |
Comparing to | |
See all releases |
Code changes from version 3.3.5 to 4.0
- css/admin.css +0 -0
- css/admin.min.css +0 -0
- css/main.css +0 -0
- css/main.min.css +0 -0
- images/cross.png +0 -0
- images/flash.png +0 -0
- images/html5.png +0 -0
- images/tick.png +0 -0
- includes/add-mce-button.php +0 -77
- includes/add-scripts.php +52 -0
- includes/add-to-admin-bar.php +0 -61
- includes/admin-config.php +48 -63
- includes/function-calls.php +0 -232
- includes/generate-comments-code.php +0 -147
- includes/generate-download-code.php +0 -42
- includes/generate-embed-code.php +76 -177
- includes/{generate-thumbnail-code.php → generate-other-code.php} +81 -0
- includes/generate-shorturl-code.php +0 -41
- includes/generate-transcript-code.php +0 -97
- includes/generate-widgets.php +82 -21
- includes/options-general.php +99 -162
- includes/options-lists.php +17 -14
- includes/options-profiles.php +165 -188
- includes/options-widgets.php +0 -156
- includes/set-defaults.php +0 -286
- includes/shared-functions.php +215 -74
- includes/shortcodes.php +8 -117
- includes/update-post-content.php +0 -222
- js/{mce4-button.php → mce4-button.js} +1 -10
- js/mce4-button.min.js +1 -0
- js/mce4-button.min.php +0 -3
- languages/youtube-embed.mo +0 -0
- languages/youtube-embed.po +338 -610
- readme.txt +64 -217
- uninstall.php +0 -13
- youtube-embed.php +4 -23
css/admin.css
CHANGED
File without changes
|
css/admin.min.css
CHANGED
File without changes
|
css/main.css
CHANGED
File without changes
|
css/main.min.css
CHANGED
File without changes
|
images/cross.png
CHANGED
Binary file
|
images/flash.png
ADDED
Binary file
|
images/html5.png
ADDED
Binary file
|
images/tick.png
CHANGED
Binary file
|
includes/add-mce-button.php
DELETED
@@ -1,77 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* TinyMCE Button Functions
|
4 |
-
*
|
5 |
-
* Add extra button(s) to TinyMCE interface
|
6 |
-
*
|
7 |
-
* @package YouTube-Embed
|
8 |
-
*/
|
9 |
-
|
10 |
-
/**
|
11 |
-
* Set up TinyMCE button
|
12 |
-
*
|
13 |
-
* Add filters (assuming user is editing) for TinyMCE
|
14 |
-
*
|
15 |
-
* @uses vye_set_general_defaults Set default options
|
16 |
-
*
|
17 |
-
* @since 2.0
|
18 |
-
*/
|
19 |
-
|
20 |
-
function youtube_embed_button() {
|
21 |
-
|
22 |
-
// Ensure user is in rich editor and button option is switched on
|
23 |
-
|
24 |
-
if ( get_user_option( 'rich_editing' ) == 'true' ) {
|
25 |
-
|
26 |
-
$options = vye_set_general_defaults();
|
27 |
-
if ( $options[ 'editor_button' ] != '' ) {
|
28 |
-
|
29 |
-
// Ensure shortcode cookie is set
|
30 |
-
|
31 |
-
$editor_sc = vye_set_editor_sc();
|
32 |
-
|
33 |
-
// Add filters
|
34 |
-
|
35 |
-
add_filter( 'mce_external_plugins', 'add_youtube_embed_mce_plugin' );
|
36 |
-
add_filter( 'mce_buttons', 'register_youtube_embed_button' );
|
37 |
-
}
|
38 |
-
}
|
39 |
-
}
|
40 |
-
add_action( 'init', 'youtube_embed_button' );
|
41 |
-
|
42 |
-
/**
|
43 |
-
* Register new TinyMCE button
|
44 |
-
*
|
45 |
-
* Register details of new TinyMCE button
|
46 |
-
*
|
47 |
-
* @since 2.0
|
48 |
-
*
|
49 |
-
* @param string $buttons TinyMCE button data
|
50 |
-
* @return string TinyMCE button data, but with new YouTube button added
|
51 |
-
*/
|
52 |
-
|
53 |
-
function register_youtube_embed_button( $buttons ) {
|
54 |
-
|
55 |
-
array_push( $buttons, 'mce4_youtube_button' );
|
56 |
-
|
57 |
-
return $buttons;
|
58 |
-
}
|
59 |
-
|
60 |
-
/**
|
61 |
-
* Register TinyMCE Script
|
62 |
-
*
|
63 |
-
* Register JavaScript that will be actioned when the new TinyMCE button is used
|
64 |
-
*
|
65 |
-
* @since 2.0
|
66 |
-
*
|
67 |
-
* @param string $plugin_array Array of MCE plugin data
|
68 |
-
* @return string Array of MCE plugin data, now with URL of MCE script
|
69 |
-
*/
|
70 |
-
|
71 |
-
function add_youtube_embed_mce_plugin( $plugin_array ) {
|
72 |
-
|
73 |
-
$plugin_array[ 'mce4_youtube_button' ] = plugins_url() . '/youtube-embed/js/mce4-button.min.php';
|
74 |
-
|
75 |
-
return $plugin_array;
|
76 |
-
}
|
77 |
-
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/add-scripts.php
CHANGED
@@ -65,4 +65,56 @@ function vye_admin_css() {
|
|
65 |
}
|
66 |
|
67 |
add_action( 'admin_print_styles', 'vye_admin_css' );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
68 |
?>
|
65 |
}
|
66 |
|
67 |
add_action( 'admin_print_styles', 'vye_admin_css' );
|
68 |
+
|
69 |
+
/**
|
70 |
+
* Add option to Admin Bar
|
71 |
+
*
|
72 |
+
* Add link to YouTube Embed profile options to Admin Bar.
|
73 |
+
* With help from http://technerdia.com/1140_wordpress-admin-bar.html
|
74 |
+
*
|
75 |
+
* @uses vye_set_general_default Set default options
|
76 |
+
*
|
77 |
+
* @since 2.5
|
78 |
+
*/
|
79 |
+
|
80 |
+
function vye_admin_bar_render( $meta = TRUE ) {
|
81 |
+
|
82 |
+
$options = vye_set_general_defaults();
|
83 |
+
|
84 |
+
if ( $options[ 'admin_bar' ] != '' ) {
|
85 |
+
|
86 |
+
global $wp_admin_bar;
|
87 |
+
|
88 |
+
if ( !is_user_logged_in() ) { return; }
|
89 |
+
if ( !is_admin_bar_showing() ) { return; }
|
90 |
+
if ( !current_user_can( $options[ 'menu_access' ] ) ) { return; }
|
91 |
+
|
92 |
+
$wp_admin_bar -> add_menu( array(
|
93 |
+
'id' => 'aye-menu',
|
94 |
+
'title' => __( 'YouTube Embed', 'youtube-embed' ) ) );
|
95 |
+
|
96 |
+
$wp_admin_bar -> add_menu( array(
|
97 |
+
'parent' => 'aye-menu',
|
98 |
+
'id' => 'aye-options',
|
99 |
+
'title' => __( 'Options', 'youtube-embed' ),
|
100 |
+
'href' => admin_url( 'admin.php?page=ye-general-options' ),
|
101 |
+
'meta' => array( 'target' => '_blank' ) ) );
|
102 |
+
|
103 |
+
$wp_admin_bar -> add_menu( array(
|
104 |
+
'parent' => 'aye-menu',
|
105 |
+
'id' => 'aye-profile',
|
106 |
+
'title' => __( 'Profiles', 'youtube-embed' ),
|
107 |
+
'href' => admin_url( 'admin.php?page=ye-profile-options' ),
|
108 |
+
'meta' => array( 'target' => '_blank' ) ) );
|
109 |
+
|
110 |
+
$wp_admin_bar -> add_menu( array(
|
111 |
+
'parent' => 'aye-menu',
|
112 |
+
'id' => 'aye-lists',
|
113 |
+
'title' => __( 'Lists', 'youtube-embed' ),
|
114 |
+
'href' => admin_url( 'admin.php?page=ye-list-options' ),
|
115 |
+
'meta' => array( 'target' => '_blank' ) ) );
|
116 |
+
}
|
117 |
+
}
|
118 |
+
|
119 |
+
add_action( 'admin_bar_menu', 'vye_admin_bar_render', 99 );
|
120 |
?>
|
includes/add-to-admin-bar.php
DELETED
@@ -1,61 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Admin Bar
|
4 |
-
*
|
5 |
-
* Set up Admin Bar links
|
6 |
-
*
|
7 |
-
* @package YouTube-Embed
|
8 |
-
*/
|
9 |
-
|
10 |
-
/**
|
11 |
-
* Add option to Admin Bar
|
12 |
-
*
|
13 |
-
* Add link to YouTube Embed profile options to Admin Bar.
|
14 |
-
* With help from http://technerdia.com/1140_wordpress-admin-bar.html
|
15 |
-
*
|
16 |
-
* @uses vye_set_general_default Set default options
|
17 |
-
*
|
18 |
-
* @since 2.5
|
19 |
-
*/
|
20 |
-
|
21 |
-
function vye_admin_bar_render( $meta = TRUE ) {
|
22 |
-
|
23 |
-
$options = vye_set_general_defaults();
|
24 |
-
|
25 |
-
if ( $options[ 'admin_bar' ] != '' ) {
|
26 |
-
|
27 |
-
global $wp_admin_bar;
|
28 |
-
|
29 |
-
if ( !is_user_logged_in() ) { return; }
|
30 |
-
if ( !is_admin_bar_showing() ) { return; }
|
31 |
-
if ( !current_user_can( $options[ 'menu_access' ] ) ) { return; }
|
32 |
-
|
33 |
-
$wp_admin_bar -> add_menu( array(
|
34 |
-
'id' => 'aye-menu',
|
35 |
-
'title' => __( 'YouTube Embed', 'youtube-embed' ) ) );
|
36 |
-
|
37 |
-
$wp_admin_bar -> add_menu( array(
|
38 |
-
'parent' => 'aye-menu',
|
39 |
-
'id' => 'aye-options',
|
40 |
-
'title' => __( 'Options', 'youtube-embed' ),
|
41 |
-
'href' => admin_url( 'admin.php?page=general-options' ),
|
42 |
-
'meta' => array( 'target' => '_blank' ) ) );
|
43 |
-
|
44 |
-
$wp_admin_bar -> add_menu( array(
|
45 |
-
'parent' => 'aye-menu',
|
46 |
-
'id' => 'aye-profile',
|
47 |
-
'title' => __( 'Profiles', 'youtube-embed' ),
|
48 |
-
'href' => admin_url( 'admin.php?page=profile-options' ),
|
49 |
-
'meta' => array( 'target' => '_blank' ) ) );
|
50 |
-
|
51 |
-
$wp_admin_bar -> add_menu( array(
|
52 |
-
'parent' => 'aye-menu',
|
53 |
-
'id' => 'aye-lists',
|
54 |
-
'title' => __( 'Lists', 'youtube-embed' ),
|
55 |
-
'href' => admin_url( 'admin.php?page=list-options' ),
|
56 |
-
'meta' => array( 'target' => '_blank' ) ) );
|
57 |
-
}
|
58 |
-
}
|
59 |
-
|
60 |
-
add_action( 'admin_bar_menu', 'vye_admin_bar_render', 40 );
|
61 |
-
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/admin-config.php
CHANGED
@@ -26,7 +26,7 @@ function vye_add_settings_link( $links, $file ) {
|
|
26 |
if ( !$this_plugin ) { $this_plugin = plugin_basename( __FILE__ ); }
|
27 |
|
28 |
if ( strpos( $file, 'youtube-embed.php' ) !== false ) {
|
29 |
-
$settings_link = '<a href="admin.php?page=general-options">' . __( 'Settings', 'youtube-embed' ) . '</a>';
|
30 |
array_unshift( $links, $settings_link );
|
31 |
}
|
32 |
|
@@ -83,13 +83,13 @@ function vye_menu_initialise() {
|
|
83 |
|
84 |
$menu_icon = 'dashicons-video-alt3';
|
85 |
|
86 |
-
add_menu_page( __( 'About YouTube Embed', 'youtube-embed' ), __( 'YouTube', 'youtube-embed' ), $menu_access, 'general-options', 'vye_general_options', $menu_icon, 12 );
|
87 |
|
88 |
// Add options sub-menu
|
89 |
|
90 |
global $vye_options_hook;
|
91 |
|
92 |
-
$vye_options_hook = add_submenu_page( 'general-options', __( 'YouTube Embed Options', 'youtube-embed' ), __( 'Options', 'youtube-embed' ), $menu_access, 'general-options', 'vye_general_options' );
|
93 |
|
94 |
add_action( 'load-' . $vye_options_hook, 'vye_add_options_help' );
|
95 |
|
@@ -97,7 +97,7 @@ function vye_menu_initialise() {
|
|
97 |
|
98 |
global $vye_profiles_hook;
|
99 |
|
100 |
-
$vye_profiles_hook = add_submenu_page( 'general-options', __( 'YouTube Embed Profiles', 'youtube-embed' ), __( 'Profiles', 'youtube-embed' ), $menu_access, 'profile-options', 'vye_profile_options' );
|
101 |
|
102 |
add_action( 'load-' . $vye_profiles_hook, 'vye_add_profiles_help' );
|
103 |
|
@@ -105,7 +105,7 @@ function vye_menu_initialise() {
|
|
105 |
|
106 |
global $vye_lists_hook;
|
107 |
|
108 |
-
$vye_lists_hook = add_submenu_page( 'general-options', __( 'YouTube Embed Lists', 'youtube-embed' ), __( 'Lists', 'youtube-embed' ), $menu_access, 'list-options', 'vye_list_options' );
|
109 |
|
110 |
add_action( 'load-' . $vye_lists_hook, 'vye_add_lists_help' );
|
111 |
|
@@ -187,8 +187,8 @@ function vye_add_options_help() {
|
|
187 |
|
188 |
function vye_options_help() {
|
189 |
|
190 |
-
$help_text = '<p>' . __( 'This screen allows you to select non-specific options for the YouTube Embed plugin. For the default embedding settings, please select the <a href="admin.php?page=profile-options">Profiles</a> administration option.', 'youtube-embed' ) . '</p>';
|
191 |
-
$help_text .= '<p>' . __( 'Remember to click the Save
|
192 |
$help_text .= '<p><strong>' . __( 'For more information:', 'youtube-embed' ) . '</strong></p>';
|
193 |
$help_text .= '<p><a href="https://wordpress.org/plugins/youtube-embed/">' . __( 'YouTube Embed Plugin Documentation', 'youtube-embed' ) . '</a></p>';
|
194 |
$help_text .= '<p><a href="http://code.google.com/apis/youtube/player_parameters.html">' . __( 'YouTube Player Documentation', 'youtube-embed' ) . '</a></p>';
|
@@ -229,11 +229,13 @@ function vye_add_profiles_help() {
|
|
229 |
function vye_profiles_help() {
|
230 |
|
231 |
$help_text = '<p>' . __( 'This screen allows you to set the options for the default and additional profiles. If you don\'t specify a specific parameter when displaying your YouTube video then the default profile option will be used instead. Additional profiles, which you may name, can be used as well and used as required.', 'youtube-embed' ) . '</p>';
|
232 |
-
$help_text .= '<p>' . __( '
|
|
|
|
|
|
|
233 |
$help_text .= '<p><strong>' . __( 'For more information:' ) . '</strong></p>';
|
234 |
$help_text .= '<p><a href="https://wordpress.org/plugins/youtube-embed/">' . __( 'YouTube Embed Plugin Documentation', 'youtube-embed' ) . '</a></p>';
|
235 |
$help_text .= '<p><a href="http://code.google.com/apis/youtube/player_parameters.html">' . __( 'YouTube Player Documentation', 'youtube-embed' ) . '</a></p>';
|
236 |
-
$help_text .= '<p><a href="http://embedplus.com/">' . __( 'EmbedPlus website', 'youtube-embed' ) . '</a></p>';
|
237 |
|
238 |
return $help_text;
|
239 |
}
|
@@ -271,7 +273,7 @@ function vye_add_lists_help() {
|
|
271 |
function vye_lists_help() {
|
272 |
|
273 |
$help_text = '<p>' . __( 'This screen allows you to create lists of YouTube videos, which may be named. These lists can then be used in preference to a single video ID.', 'youtube-embed' ) . '</p>';
|
274 |
-
$help_text .= '<p>' . __( 'Remember to click the Save
|
275 |
$help_text .= '<p><strong>' . __( 'For more information:', 'youtube-embed' ) . '</strong></p>';
|
276 |
$help_text .= '<p><a href="https://wordpress.org/plugins/youtube-embed/">' . __( 'YouTube Embed Plugin Documentation', 'youtube-embed' ) . '</a></p>';
|
277 |
$help_text .= '<p><a href="http://code.google.com/apis/youtube/player_parameters.html">' . __( 'YouTube Player Documentation', 'youtube-embed' ) . '</a></p>';
|
@@ -280,83 +282,66 @@ function vye_lists_help() {
|
|
280 |
}
|
281 |
|
282 |
/**
|
283 |
-
*
|
284 |
*
|
285 |
-
*
|
286 |
*
|
287 |
-
* @
|
|
|
|
|
288 |
*/
|
289 |
|
290 |
-
function
|
291 |
-
|
292 |
-
update_option( 'youtube_embed_activated', true );
|
293 |
-
|
294 |
-
}
|
295 |
|
296 |
-
|
297 |
|
298 |
-
|
299 |
|
300 |
-
|
|
|
301 |
|
302 |
-
|
303 |
|
304 |
-
|
|
|
|
|
|
|
305 |
}
|
|
|
306 |
|
307 |
/**
|
308 |
-
*
|
|
|
|
|
309 |
*
|
310 |
-
*
|
311 |
*
|
312 |
-
* @
|
|
|
313 |
*/
|
314 |
|
315 |
-
function
|
316 |
|
317 |
-
|
318 |
-
wp_enqueue_script( 'wp-pointer' );
|
319 |
|
320 |
-
|
321 |
}
|
322 |
|
323 |
/**
|
324 |
-
*
|
|
|
|
|
325 |
*
|
326 |
-
*
|
327 |
*
|
328 |
-
* @
|
|
|
329 |
*/
|
330 |
|
331 |
-
function
|
332 |
-
|
333 |
-
$
|
334 |
-
|
335 |
-
$
|
336 |
-
$pointer_content .= '<p>' . __( 'Even if you do nothing else, please visit the Profiles option to check your default video values.', 'youtube-embed' ) . '</p>';
|
337 |
-
?>
|
338 |
-
<script>
|
339 |
-
jQuery(function () {
|
340 |
-
var body = jQuery(document.body),
|
341 |
-
menu = jQuery('#toplevel_page_support-about'),
|
342 |
-
collapse = jQuery('#collapse-menu'),
|
343 |
-
yembed = menu.find("a[href='admin.php?page=profile-options']"),
|
344 |
-
options = {
|
345 |
-
content: '<?php echo $pointer_content; ?>',
|
346 |
-
position: {
|
347 |
-
edge: 'left',
|
348 |
-
align: 'center',
|
349 |
-
of: menu.is('.wp-menu-open') && !menu.is('.folded *') ? yembed : menu
|
350 |
-
},
|
351 |
-
close: function() {
|
352 |
-
}};
|
353 |
-
|
354 |
-
if ( !yembed.length )
|
355 |
-
return;
|
356 |
-
|
357 |
-
body.pointer(options).pointer('open');
|
358 |
-
});
|
359 |
-
</script>
|
360 |
-
<?php
|
361 |
}
|
362 |
?>
|
26 |
if ( !$this_plugin ) { $this_plugin = plugin_basename( __FILE__ ); }
|
27 |
|
28 |
if ( strpos( $file, 'youtube-embed.php' ) !== false ) {
|
29 |
+
$settings_link = '<a href="admin.php?page=ye-general-options">' . __( 'Settings', 'youtube-embed' ) . '</a>';
|
30 |
array_unshift( $links, $settings_link );
|
31 |
}
|
32 |
|
83 |
|
84 |
$menu_icon = 'dashicons-video-alt3';
|
85 |
|
86 |
+
add_menu_page( __( 'About YouTube Embed', 'youtube-embed' ), __( 'YouTube', 'youtube-embed' ), $menu_access, 'ye-general-options', 'vye_general_options', $menu_icon, 12 );
|
87 |
|
88 |
// Add options sub-menu
|
89 |
|
90 |
global $vye_options_hook;
|
91 |
|
92 |
+
$vye_options_hook = add_submenu_page( 'ye-general-options', __( 'YouTube Embed Options', 'youtube-embed' ), __( 'Options', 'youtube-embed' ), $menu_access, 'ye-general-options', 'vye_general_options' );
|
93 |
|
94 |
add_action( 'load-' . $vye_options_hook, 'vye_add_options_help' );
|
95 |
|
97 |
|
98 |
global $vye_profiles_hook;
|
99 |
|
100 |
+
$vye_profiles_hook = add_submenu_page( 'ye-general-options', __( 'YouTube Embed Profiles', 'youtube-embed' ), __( 'Profiles', 'youtube-embed' ), $menu_access, 'ye-profile-options', 'vye_profile_options' );
|
101 |
|
102 |
add_action( 'load-' . $vye_profiles_hook, 'vye_add_profiles_help' );
|
103 |
|
105 |
|
106 |
global $vye_lists_hook;
|
107 |
|
108 |
+
$vye_lists_hook = add_submenu_page( 'ye-general-options', __( 'YouTube Embed Lists', 'youtube-embed' ), __( 'Lists', 'youtube-embed' ), $menu_access, 'ye-list-options', 'vye_list_options' );
|
109 |
|
110 |
add_action( 'load-' . $vye_lists_hook, 'vye_add_lists_help' );
|
111 |
|
187 |
|
188 |
function vye_options_help() {
|
189 |
|
190 |
+
$help_text = '<p>' . __( 'This screen allows you to select non-specific options for the YouTube Embed plugin. For the default embedding settings, please select the <a href="admin.php?page=ye-profile-options">Profiles</a> administration option.', 'youtube-embed' ) . '</p>';
|
191 |
+
$help_text .= '<p>' . __( 'Remember to click the Save Changes button at the bottom of the screen for new settings to take effect.', 'youtube-embed' ) . '</p>';
|
192 |
$help_text .= '<p><strong>' . __( 'For more information:', 'youtube-embed' ) . '</strong></p>';
|
193 |
$help_text .= '<p><a href="https://wordpress.org/plugins/youtube-embed/">' . __( 'YouTube Embed Plugin Documentation', 'youtube-embed' ) . '</a></p>';
|
194 |
$help_text .= '<p><a href="http://code.google.com/apis/youtube/player_parameters.html">' . __( 'YouTube Player Documentation', 'youtube-embed' ) . '</a></p>';
|
229 |
function vye_profiles_help() {
|
230 |
|
231 |
$help_text = '<p>' . __( 'This screen allows you to set the options for the default and additional profiles. If you don\'t specify a specific parameter when displaying your YouTube video then the default profile option will be used instead. Additional profiles, which you may name, can be used as well and used as required.', 'youtube-embed' ) . '</p>';
|
232 |
+
$help_text .= '<p>' . __( 'All settings will work whether the Flash or HTML5 player is used, unless one of the following icons is shown, indicating which format the option works with...', 'youtube-embed' ) . '</p>';
|
233 |
+
$help_text .= "<p><img src='" . plugins_url() . "/youtube-embed/images/flash.png' width='10px'> - " . __( 'Flash player', 'youtube-embed' ) . '</br>';
|
234 |
+
$help_text .= "<img src='" . plugins_url() . "/youtube-embed/images/html5.png' width='10px'> - " . __( 'HTML5 player', 'youtube-embed' ) . '</br>';
|
235 |
+
$help_text .= '<p>' . __( 'Remember to click the Save Changes button at the bottom of the screen for new settings to take effect.', 'youtube-embed' ) . '</p>';
|
236 |
$help_text .= '<p><strong>' . __( 'For more information:' ) . '</strong></p>';
|
237 |
$help_text .= '<p><a href="https://wordpress.org/plugins/youtube-embed/">' . __( 'YouTube Embed Plugin Documentation', 'youtube-embed' ) . '</a></p>';
|
238 |
$help_text .= '<p><a href="http://code.google.com/apis/youtube/player_parameters.html">' . __( 'YouTube Player Documentation', 'youtube-embed' ) . '</a></p>';
|
|
|
239 |
|
240 |
return $help_text;
|
241 |
}
|
273 |
function vye_lists_help() {
|
274 |
|
275 |
$help_text = '<p>' . __( 'This screen allows you to create lists of YouTube videos, which may be named. These lists can then be used in preference to a single video ID.', 'youtube-embed' ) . '</p>';
|
276 |
+
$help_text .= '<p>' . __( 'Remember to click the Save Changes button at the bottom of the screen for new settings to take effect.', 'youtube-embed' ) . '</p>';
|
277 |
$help_text .= '<p><strong>' . __( 'For more information:', 'youtube-embed' ) . '</strong></p>';
|
278 |
$help_text .= '<p><a href="https://wordpress.org/plugins/youtube-embed/">' . __( 'YouTube Embed Plugin Documentation', 'youtube-embed' ) . '</a></p>';
|
279 |
$help_text .= '<p><a href="http://code.google.com/apis/youtube/player_parameters.html">' . __( 'YouTube Player Documentation', 'youtube-embed' ) . '</a></p>';
|
282 |
}
|
283 |
|
284 |
/**
|
285 |
+
* Set up TinyMCE button
|
286 |
*
|
287 |
+
* Add filters (assuming user is editing) for TinyMCE
|
288 |
*
|
289 |
+
* @uses vye_set_general_defaults Set default options
|
290 |
+
*
|
291 |
+
* @since 2.0
|
292 |
*/
|
293 |
|
294 |
+
function youtube_embed_button() {
|
|
|
|
|
|
|
|
|
295 |
|
296 |
+
// Ensure user is in rich editor and button option is switched on
|
297 |
|
298 |
+
if ( get_user_option( 'rich_editing' ) == 'true' ) {
|
299 |
|
300 |
+
$options = vye_set_general_defaults();
|
301 |
+
if ( $options[ 'editor_button' ] != '' ) {
|
302 |
|
303 |
+
// Add filters
|
304 |
|
305 |
+
add_filter( 'mce_external_plugins', 'add_youtube_embed_mce_plugin' );
|
306 |
+
add_filter( 'mce_buttons', 'register_youtube_embed_button' );
|
307 |
+
}
|
308 |
+
}
|
309 |
}
|
310 |
+
add_action( 'init', 'youtube_embed_button' );
|
311 |
|
312 |
/**
|
313 |
+
* Register new TinyMCE button
|
314 |
+
*
|
315 |
+
* Register details of new TinyMCE button
|
316 |
*
|
317 |
+
* @since 2.0
|
318 |
*
|
319 |
+
* @param string $buttons TinyMCE button data
|
320 |
+
* @return string TinyMCE button data, but with new YouTube button added
|
321 |
*/
|
322 |
|
323 |
+
function register_youtube_embed_button( $buttons ) {
|
324 |
|
325 |
+
array_push( $buttons, 'mce4_youtube_button' );
|
|
|
326 |
|
327 |
+
return $buttons;
|
328 |
}
|
329 |
|
330 |
/**
|
331 |
+
* Register TinyMCE Script
|
332 |
+
*
|
333 |
+
* Register JavaScript that will be actioned when the new TinyMCE button is used
|
334 |
*
|
335 |
+
* @since 2.0
|
336 |
*
|
337 |
+
* @param string $plugin_array Array of MCE plugin data
|
338 |
+
* @return string Array of MCE plugin data, now with URL of MCE script
|
339 |
*/
|
340 |
|
341 |
+
function add_youtube_embed_mce_plugin( $plugin_array ) {
|
342 |
+
|
343 |
+
$plugin_array[ 'mce4_youtube_button' ] = plugins_url() . '/youtube-embed/js/mce4-button.min.js';
|
344 |
+
|
345 |
+
return $plugin_array;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
346 |
}
|
347 |
?>
|
includes/function-calls.php
DELETED
@@ -1,232 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Function Calls
|
4 |
-
*
|
5 |
-
* Various function calls that the user may call directly
|
6 |
-
*
|
7 |
-
* @package YouTube-Embed
|
8 |
-
*/
|
9 |
-
|
10 |
-
/**
|
11 |
-
* Embed a YouTube video
|
12 |
-
*
|
13 |
-
* Write out XHTML to embed a YouTube video
|
14 |
-
*
|
15 |
-
* @since 2.0
|
16 |
-
*
|
17 |
-
* @uses vye_get_parameters Extract parameters from input
|
18 |
-
* @uses vye_get_embed_type Work out the correct embed type to use
|
19 |
-
* @uses vye_set_autohide Set correct autohide parameter
|
20 |
-
* @uses vye_generate_youtube_code Generate the YouTube code
|
21 |
-
*
|
22 |
-
* @param string $content YouTube video ID
|
23 |
-
* @param string $paras List of parameters
|
24 |
-
* @param string $style Optional CSS
|
25 |
-
*/
|
26 |
-
|
27 |
-
function youtube_video_embed( $content, $paras = '', $style = '' ) {
|
28 |
-
$width = vye_get_parameters( $paras, 'width' );
|
29 |
-
$height = vye_get_parameters( $paras, 'height' );
|
30 |
-
$fullscreen = vye_get_parameters( $paras, 'fullscreen' );
|
31 |
-
$related = vye_get_parameters( $paras, 'related' );
|
32 |
-
$autoplay = vye_get_parameters( $paras, 'autoplay' );
|
33 |
-
$loop = vye_get_parameters( $paras, 'loop' );
|
34 |
-
$start = vye_get_parameters( $paras, 'start' );
|
35 |
-
$info = vye_get_parameters( $paras, 'info' );
|
36 |
-
$annotation = vye_get_parameters( $paras, 'annotation' );
|
37 |
-
$cc = vye_get_parameters( $paras, 'cc' );
|
38 |
-
$link = vye_get_parameters( $paras, 'link' );
|
39 |
-
$react = vye_get_parameters( $paras, 'react' );
|
40 |
-
$stop = vye_get_parameters( $paras, 'stop' );
|
41 |
-
$sweetspot = vye_get_parameters( $paras, 'sweetspot' );
|
42 |
-
$embedplus = vye_get_parameters( $paras, 'embedplus' );
|
43 |
-
$disablekb = vye_get_parameters( $paras, 'disablekb' );
|
44 |
-
$ratio = vye_get_parameters( $paras, 'ratio' );
|
45 |
-
$autohide = vye_get_parameters( $paras, 'autohide' );
|
46 |
-
$controls = vye_get_parameters( $paras, 'controls' );
|
47 |
-
$type = vye_get_parameters( $paras, 'type' );
|
48 |
-
$profile = vye_get_parameters( $paras, 'profile' );
|
49 |
-
$list = vye_get_parameters( $paras, 'list' );
|
50 |
-
$audio = vye_get_parameters( $paras, 'audio' );
|
51 |
-
$template = vye_get_parameters( $paras, 'template' );
|
52 |
-
$hd = vye_get_parameters( $paras, 'hd' );
|
53 |
-
$color = vye_get_parameters( $paras, 'color' );
|
54 |
-
$theme = vye_get_parameters( $paras, 'theme' );
|
55 |
-
$https = vye_get_parameters( $paras, 'ssl' );
|
56 |
-
$dynamic = vye_get_parameters( $paras, 'dynamic' );
|
57 |
-
$search = vye_get_parameters( $paras, 'search' );
|
58 |
-
$user = vye_get_parameters( $paras, 'user' );
|
59 |
-
$vq = vye_get_parameters( $paras, 'vq' );
|
60 |
-
|
61 |
-
// Get Embed type
|
62 |
-
$type = vye_get_embed_type( $type, $embedplus );
|
63 |
-
|
64 |
-
// Set up Autohide parameter
|
65 |
-
$autohide = vye_set_autohide( $autohide );
|
66 |
-
|
67 |
-
echo vye_generate_youtube_code( $content, $type, $width, $height, vye_convert( $fullscreen ), vye_convert( $related ), vye_convert( $autoplay ), vye_convert( $loop ), $start, vye_convert( $info ), vye_convert_3( $annotation ), vye_convert( $cc ), $style, vye_convert( $link ), vye_convert( $react ), $stop, vye_convert( $sweetspot ), vye_convert( $disablekb ), $ratio, $autohide, $controls, $profile, $list, vye_convert( $audio ), $template, vye_convert( $hd ), $color, $theme, vye_convert( $https ), vye_convert( $dynamic ), vye_convert( $search ), vye_convert( $user ), $vq );
|
68 |
-
return;
|
69 |
-
}
|
70 |
-
|
71 |
-
/**
|
72 |
-
* Display a video thumbnail
|
73 |
-
*
|
74 |
-
* Display a thumbnail of a video
|
75 |
-
*
|
76 |
-
* @since 2.0
|
77 |
-
*
|
78 |
-
* @uses vye_get_parameters Extract parameters from a string
|
79 |
-
* @uses vye_generate_thumbnail_code Get the thumbnail code
|
80 |
-
*
|
81 |
-
* @param string $content YouTube video ID
|
82 |
-
* @param string $paras Parameters
|
83 |
-
* @param string $style CSS information
|
84 |
-
* @param string $alt Alt text
|
85 |
-
* @parm string $nolink Whether to add a link or not
|
86 |
-
*/
|
87 |
-
|
88 |
-
function youtube_thumb_embed( $content, $paras = '', $style = '', $alt = '', $nolink = '' ) {
|
89 |
-
|
90 |
-
$class = vye_get_parameters( $paras, 'class' );
|
91 |
-
$rel = vye_get_parameters( $paras, 'rel' );
|
92 |
-
$target = vye_get_parameters( $paras, 'target' );
|
93 |
-
$width = vye_get_parameters( $paras, 'width' );
|
94 |
-
$height = vye_get_parameters( $paras, 'height' );
|
95 |
-
$version = vye_get_parameters( $paras, 'version' );
|
96 |
-
|
97 |
-
echo vye_generate_thumbnail_code( $content, $style, $class, $rel, $target, $width, $height, $alt, $version, $nolink );
|
98 |
-
|
99 |
-
return;
|
100 |
-
}
|
101 |
-
|
102 |
-
/**
|
103 |
-
* Return video short URL
|
104 |
-
*
|
105 |
-
* Return a short URL for the YouTube video
|
106 |
-
*
|
107 |
-
* @since 2.0
|
108 |
-
*
|
109 |
-
* @uses vye_generate_shorturl_code Display an error
|
110 |
-
*
|
111 |
-
* @param string $id YouTube video ID
|
112 |
-
* @return string Download URL
|
113 |
-
*/
|
114 |
-
|
115 |
-
function youtube_short_url( $id ) {
|
116 |
-
return vye_generate_shorturl_code( $id );
|
117 |
-
}
|
118 |
-
|
119 |
-
/**
|
120 |
-
* Get video download URL
|
121 |
-
*
|
122 |
-
* Return a URL for the video so that it can be downloaded
|
123 |
-
*
|
124 |
-
* @since 2.0
|
125 |
-
*
|
126 |
-
* @uses vye_generate_download_code Get the download URL
|
127 |
-
*
|
128 |
-
* @param string $id YouTube video ID
|
129 |
-
* @return string Download URL
|
130 |
-
*/
|
131 |
-
|
132 |
-
function get_video_download( $id ) {
|
133 |
-
return vye_generate_download_code( $id );
|
134 |
-
}
|
135 |
-
|
136 |
-
/**
|
137 |
-
* Get XML transcript
|
138 |
-
*
|
139 |
-
* Return XML formatted YouTube transcript
|
140 |
-
*
|
141 |
-
* @since 2.0
|
142 |
-
*
|
143 |
-
* @uses vye_error Output an error
|
144 |
-
* @uses vye_extract_id Extract a video ID
|
145 |
-
* @uses vye_get_file Get a file
|
146 |
-
* @uses vye_validate_id Check the video ID is valid
|
147 |
-
*
|
148 |
-
* @param string $id YouTube video ID
|
149 |
-
* @param string $id Language
|
150 |
-
* @return string Transcript file in XML format
|
151 |
-
*/
|
152 |
-
|
153 |
-
function get_youtube_transcript_xml ( $id, $language = 'en' ) {
|
154 |
-
|
155 |
-
// Extract the ID if a full URL has been specified
|
156 |
-
$id = vye_extract_id( $id );
|
157 |
-
|
158 |
-
// Check what type of video it is and whether it's valid
|
159 |
-
$embed_type = vye_validate_id( $id );
|
160 |
-
if ( $embed_type != 'v' ) {
|
161 |
-
if ( strlen( $embed_type ) > 1 ) {
|
162 |
-
echo vye_error( $embed_type );
|
163 |
-
} else {
|
164 |
-
echo vye_error( sprintf( __( 'The YouTube ID of %s is invalid.', 'youtube-embed' ), $id ) );
|
165 |
-
}
|
166 |
-
return;
|
167 |
-
}
|
168 |
-
|
169 |
-
// Get transcript file
|
170 |
-
$filename = 'http://video.google.com/timedtext?lang=' . strtolower( $language ) . '&v=' . $id;
|
171 |
-
$xml = vye_get_file( $filename );
|
172 |
-
|
173 |
-
// Check success and return appropriate output
|
174 |
-
if ( $xml[ 'rc' ] > 0 ) {
|
175 |
-
echo vye_error( sprintf( __( 'Could not fetch the transcript file %s.', 'youtube-embed' ), $id ) );
|
176 |
-
return;
|
177 |
-
} else {
|
178 |
-
return $xml;
|
179 |
-
}
|
180 |
-
}
|
181 |
-
|
182 |
-
/**
|
183 |
-
* Get transcript
|
184 |
-
*
|
185 |
-
* Return XHTML formatted YouTube transcript
|
186 |
-
*
|
187 |
-
* @since 2.0
|
188 |
-
*
|
189 |
-
* @uses vye_generate_generatE_transcript Generate the transcript output
|
190 |
-
*
|
191 |
-
* @param string $id YouTube video ID
|
192 |
-
* @param string $language Language
|
193 |
-
* @return string Transcript file in XHTML format
|
194 |
-
*/
|
195 |
-
|
196 |
-
function get_youtube_transcript( $id, $language = '' ) {
|
197 |
-
return vye_generate_transcript( $id, $language );
|
198 |
-
}
|
199 |
-
|
200 |
-
/**
|
201 |
-
* Get Video Name
|
202 |
-
*
|
203 |
-
* Function to return the name of a YouTube video
|
204 |
-
*
|
205 |
-
* @since 2.0
|
206 |
-
*
|
207 |
-
* @uses vye_extract_id Extract the video ID
|
208 |
-
* @uses vye_validate_id Get the name and video type
|
209 |
-
* @uses vye_error Return an error
|
210 |
-
*
|
211 |
-
* @param string $id Video ID
|
212 |
-
* @return string Video name
|
213 |
-
*/
|
214 |
-
|
215 |
-
function get_youtube_name( $id ) {
|
216 |
-
|
217 |
-
// Extract the ID if a full URL has been specified
|
218 |
-
$id = vye_extract_id( $id );
|
219 |
-
|
220 |
-
// Check what type of video it is and whether it's valid
|
221 |
-
$return = vye_validate_id( $id, true );
|
222 |
-
$embed_type = $return[ 'type' ];
|
223 |
-
if ( strlen( $embed_type ) > 1 ) {
|
224 |
-
echo vye_error( $embed_type );
|
225 |
-
} else {
|
226 |
-
echo vye_error( sprintf( __ ( 'The YouTube ID of %s is invalid.', 'youtube-embed' ), $id ) );
|
227 |
-
}
|
228 |
-
|
229 |
-
// Return the video title
|
230 |
-
return $return['title'];
|
231 |
-
}
|
232 |
-
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/generate-comments-code.php
DELETED
@@ -1,147 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Create comments
|
4 |
-
*
|
5 |
-
* All functions relating to listing video comments
|
6 |
-
*
|
7 |
-
* @package YouTube-Embed
|
8 |
-
* @since 3.2
|
9 |
-
*/
|
10 |
-
|
11 |
-
/**
|
12 |
-
* Get YouTube comments
|
13 |
-
*
|
14 |
-
* Generate output of video comments
|
15 |
-
*
|
16 |
-
* @since 3.2
|
17 |
-
*
|
18 |
-
* @uses vye_extract_id Extract the ID
|
19 |
-
* @uses vye_get_file Get a file
|
20 |
-
* @uses vye_set_general_defaults Set default options
|
21 |
-
* @uses vye_validate_id Validate the ID
|
22 |
-
*
|
23 |
-
* @param string $id Video ID
|
24 |
-
* @param string $language Language
|
25 |
-
* @return string $output Transcript output
|
26 |
-
*/
|
27 |
-
|
28 |
-
function vye_generate_comments( $paras ) {
|
29 |
-
|
30 |
-
extract( $paras );
|
31 |
-
if ( $id == '' ) { return vye_error( __( 'No YouTube ID was specified.', 'youtube-embed' ) ); }
|
32 |
-
|
33 |
-
// Extract the ID if a full URL has been specified
|
34 |
-
|
35 |
-
$id = vye_extract_id( $id );
|
36 |
-
|
37 |
-
// Check what type of video it is and whether it's valid
|
38 |
-
|
39 |
-
$embed_type = vye_validate_id( $id );
|
40 |
-
if ( $embed_type != 'v' ) {
|
41 |
-
if ( strlen( $embed_type ) > 1 ) {
|
42 |
-
return vye_error( $embed_type );
|
43 |
-
} else {
|
44 |
-
return vye_error( sprintf( __( 'The YouTube ID of %s is invalid.', 'youtube-embed' ), $id ) );
|
45 |
-
}
|
46 |
-
}
|
47 |
-
|
48 |
-
// Get general options
|
49 |
-
|
50 |
-
$general = vye_set_general_defaults();
|
51 |
-
|
52 |
-
// Get cache time
|
53 |
-
|
54 |
-
if ( $cache == '' ) { $cache = $general[ 'comments_cache' ]; }
|
55 |
-
|
56 |
-
// Check to see if cache is available
|
57 |
-
|
58 |
-
if ( $cache != 0 ) {
|
59 |
-
$cache_key = 'vye_comments_' . $id;
|
60 |
-
$output = get_transient( $cache_key );
|
61 |
-
$output = false;
|
62 |
-
if ( $output !== false) { return $output; }
|
63 |
-
}
|
64 |
-
|
65 |
-
// Get transcript file
|
66 |
-
|
67 |
-
$return = vye_get_file( 'https://gdata.youtube.com/feeds/api/videos/' . $id . '/comments?orderby=published' );
|
68 |
-
$xml = $return[ 'file' ];
|
69 |
-
$output = '';
|
70 |
-
|
71 |
-
// If comments file exists process the XML and build the output
|
72 |
-
|
73 |
-
if ( $return[ 'rc' ] == 0 ) {
|
74 |
-
|
75 |
-
// Set default values
|
76 |
-
|
77 |
-
$output = "<!-- YouTube Embed v" . youtube_embed_version . " -->\n" . '<div id="comments">' . "\n";
|
78 |
-
$pos = 0;
|
79 |
-
$eof = false;
|
80 |
-
$number = 1;
|
81 |
-
if ( !is_numeric( $avatar ) ) { $avatar = 32; }
|
82 |
-
if ( !is_numeric( $limit ) ) { $limit = 10; }
|
83 |
-
|
84 |
-
$tab = "\t";
|
85 |
-
|
86 |
-
while ( !$eof ) {
|
87 |
-
|
88 |
-
$entry = vye_extract_xml( $xml, 'entry' );
|
89 |
-
if ( $entry != '' ) {
|
90 |
-
|
91 |
-
// Extract field data from XML
|
92 |
-
|
93 |
-
$published = human_time_diff( strtotime( vye_extract_xml( $entry, 'published' ) ) );
|
94 |
-
$comment = vye_extract_xml( $entry, 'content' );
|
95 |
-
$user = vye_extract_xml( $entry, 'name' );
|
96 |
-
$profile_url = 'http://www.youtube.com/user/' . $user;
|
97 |
-
$user_xml_url = vye_extract_xml( $entry, 'uri' );
|
98 |
-
|
99 |
-
// Get user image URL from a seperate XML file
|
100 |
-
|
101 |
-
$image_url = '';
|
102 |
-
$user_xml = wp_remote_get( $user_xml_url );
|
103 |
-
$start_pos = strpos( $user_xml[ 'body' ], '<media:thumbnail url=' );
|
104 |
-
if ( $start_pos !== false ) {
|
105 |
-
$start_pos = $start_pos + 22;
|
106 |
-
$end_pos = strpos( $user_xml[ 'body' ], '/>', $start_pos );
|
107 |
-
if ( $end_pos !== false ) {
|
108 |
-
$end_pos = $end_pos - 2;
|
109 |
-
$image_url = substr( $user_xml[ 'body' ], $start_pos, $end_pos - $start_pos + 1 );
|
110 |
-
}
|
111 |
-
}
|
112 |
-
|
113 |
-
// Using the information fetched above built the comment output
|
114 |
-
|
115 |
-
$output .= '<div id="comment-' . $number . '">' . "\n";
|
116 |
-
$output .= $tag . '<div class="comment-author">' . "\n";
|
117 |
-
if ( is_numeric( $avatar ) ) { $output .= $tab . $tab . '<img alt="" src="' . $image_url . '" class="avatar avatar-' . $avatar . '" height="' . $avatar . 'px" width="' . $avatar . 'px" />' . "\n"; }
|
118 |
-
$output .= $tab . $tab . '<cite class="fn"><a href="' . $profile_url . '" rel="external nofollow" class="url">' . $user . '</a></cite>' . "\n";
|
119 |
-
$output .= $tab . '</div>' . "\n";
|
120 |
-
$output .= $tab . '<div class="comment-meta commentmetadata">' . $published . ' ' . __( 'ago', 'youtube-embed' ) . '</div>' . "\n";
|
121 |
-
$output .= $tab . '<div class="comment-body"><p>' . $comment . '</p></div>' . "\n";
|
122 |
-
$output .= '</div>' . "\n";
|
123 |
-
|
124 |
-
$number++;
|
125 |
-
if ( $number > $limit ) { $eof = true; }
|
126 |
-
|
127 |
-
} else {
|
128 |
-
$eof = true;
|
129 |
-
}
|
130 |
-
|
131 |
-
// Remove current record from the XML file
|
132 |
-
|
133 |
-
$next_record = strpos( $xml, '</entry>' );
|
134 |
-
if ( $next_record !== false ) { $xml = substr( $xml, $next_record + 8 ); }
|
135 |
-
|
136 |
-
}
|
137 |
-
|
138 |
-
$output .= "</div>\n<!-- End of YouTube Embed code -->\n";
|
139 |
-
}
|
140 |
-
|
141 |
-
// Save the cache
|
142 |
-
|
143 |
-
if ( $cache != 0 ) { set_transient( $cache_key, $output, 60 * $cache ); }
|
144 |
-
|
145 |
-
return $output;
|
146 |
-
}
|
147 |
-
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/generate-download-code.php
DELETED
@@ -1,42 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Generate Download Code
|
4 |
-
*
|
5 |
-
* Create code to allow a YouTube video to be downloaded
|
6 |
-
*
|
7 |
-
* @package YouTube-Embed
|
8 |
-
* @since 2.0
|
9 |
-
*
|
10 |
-
* @uses vye_extract_id Extract an ID from a string
|
11 |
-
* @uses vye_validate_id Confirm the type of video
|
12 |
-
* @uses vye_error Display an error
|
13 |
-
*
|
14 |
-
* @param string $id YouTube video ID
|
15 |
-
* @return string Download HTML
|
16 |
-
*/
|
17 |
-
|
18 |
-
function vye_generate_download_code( $id ) {
|
19 |
-
|
20 |
-
if ( $id == '' ) { return vye_error( __ ( 'No YouTube ID was found.', 'youtube-embed' ) ); }
|
21 |
-
|
22 |
-
// Extract the ID if a full URL has been specified
|
23 |
-
|
24 |
-
$id = vye_extract_id( $id );
|
25 |
-
|
26 |
-
// Check what type of video it is and whether it's valid
|
27 |
-
|
28 |
-
$embed_type = vye_validate_id( $id );
|
29 |
-
if ( $embed_type != 'v' ) {
|
30 |
-
if ( strlen( $embed_type ) > 1 ) {
|
31 |
-
return vye_error( $embed_type );
|
32 |
-
} else {
|
33 |
-
return vye_error( sprintf( __( 'The YouTube ID of %s is invalid.', 'youtube-embed' ), $id ) );
|
34 |
-
}
|
35 |
-
}
|
36 |
-
|
37 |
-
// Create the link
|
38 |
-
|
39 |
-
return 'http://www.videodownloadx.com/?video=' . $id;
|
40 |
-
|
41 |
-
}
|
42 |
-
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/generate-embed-code.php
CHANGED
@@ -24,7 +24,6 @@
|
|
24 |
* @uses vye_set_profile_defaults Set default profile options
|
25 |
*
|
26 |
* @param string $id Video ID
|
27 |
-
* @param string $type Embed type
|
28 |
* @param string $width Video width
|
29 |
* @param string $height Video height
|
30 |
* @param string $fullscreen Fullscreen button
|
@@ -36,35 +35,33 @@
|
|
36 |
* @param string $annotation Annotations
|
37 |
* @param string $cc Closed captions
|
38 |
* @param string $style Stylesheet information
|
39 |
-
* @param string $link Link back to YouTube
|
40 |
-
* @param string $react Show EmbedPlus reactions
|
41 |
* @param string $stop Stop in seconds
|
42 |
-
* @param string $sweetspot Show EmbedPlus sweetspots
|
43 |
* @param string $disablekb Disable keyboard controls
|
44 |
* @param string $ratio Video size ratio
|
45 |
* @param string $autohide Autohide controls
|
46 |
* @param string $controls Display controls
|
47 |
* @param string $profile Which profile to use
|
48 |
* @param string $list_style How to use a list, if used
|
49 |
-
* @param string $audio Only show controls, for audio playback
|
50 |
* @param string $template Display template
|
51 |
-
* @param string $hd Use HD, if available
|
52 |
* @param string $color Progress bar color
|
53 |
* @param string $theme Use dark or light theme
|
54 |
* @param string $https Use HTTPS for links
|
55 |
* @param string $dynamic Show dynamic output
|
56 |
* @param string $search Perform a search
|
57 |
* @param string $user Look up user videos
|
58 |
-
* @param
|
59 |
* @return string Code output
|
60 |
*/
|
61 |
|
62 |
-
function vye_generate_youtube_code( $id = '', $
|
63 |
|
64 |
// Ensure an ID is passed
|
65 |
|
66 |
if ( $id == '' ) { return vye_error( __( 'No video/playlist ID has been supplied', 'youtube-embed' ) ); }
|
67 |
|
|
|
|
|
|
|
68 |
// Get general options
|
69 |
|
70 |
$general = vye_set_general_defaults();
|
@@ -77,11 +74,11 @@ function vye_generate_youtube_code( $id = '', $type = '', $width = '', $height =
|
|
77 |
|
78 |
$options = vye_set_profile_defaults( $profile );
|
79 |
|
80 |
-
// If a user look-up or search has been requested,
|
81 |
// simple assign it as an IFRAME video
|
82 |
|
83 |
-
|
84 |
-
|
85 |
|
86 |
if ( ( $user == 0 ) && ( $search == 0 ) ) {
|
87 |
|
@@ -99,28 +96,15 @@ function vye_generate_youtube_code( $id = '', $type = '', $width = '', $height =
|
|
99 |
|
100 |
$id = vye_extract_id( $id );
|
101 |
|
102 |
-
// Is it being previewed? In which case remove any cache
|
103 |
-
|
104 |
-
if ( preg_match( '/p=([0-9]*)&preview=true/', $_SERVER['QUERY_STRING'] ) == 1 ) {
|
105 |
-
delete_transient( 'vye_type_' . $id );
|
106 |
-
delete_transient( 'vye_title_' . $id );
|
107 |
-
}
|
108 |
-
|
109 |
// Check what type of video it is and whether it's valid
|
110 |
|
111 |
-
$
|
112 |
-
$embed_type = $return[ 'type' ];
|
113 |
|
114 |
-
// If the video is invalid, output an
|
115 |
|
116 |
if ( ( $embed_type == '' ) or ( strlen ( $embed_type ) != 1 ) ) {
|
117 |
-
|
118 |
-
|
119 |
-
} else {
|
120 |
-
$error = $embed_type;
|
121 |
-
}
|
122 |
-
$result = "\n<!-- YouTube Embed v" . youtube_embed_version . " -->\n";
|
123 |
-
$result .= "<!-- " . $error . " -->\n" . vye_decode( $general[ 'error_message' ] ) . "\n<!-- End of YouTube Embed code -->\n";
|
124 |
return $result;
|
125 |
}
|
126 |
|
@@ -161,7 +145,7 @@ function vye_generate_youtube_code( $id = '', $type = '', $width = '', $height =
|
|
161 |
|
162 |
// Generate a cache key for the above passed parameters
|
163 |
|
164 |
-
$hash_key = $id . $
|
165 |
if ( isset( $list ) ) { $hash_key .= serialize( $list ); }
|
166 |
if ( isset( $return ) ) { $hash_key .= serialize( $return ); }
|
167 |
|
@@ -170,6 +154,7 @@ function vye_generate_youtube_code( $id = '', $type = '', $width = '', $height =
|
|
170 |
// Try and get the output from cache. If it exists, return the code
|
171 |
|
172 |
if ( ( $general[ 'embed_cache' ] != 0 ) && ( !is_feed() ) && ( $list_style != 'random' ) ) {
|
|
|
173 |
$result = get_transient( $cache_key );
|
174 |
if ( $result !== false) { return $result; }
|
175 |
}
|
@@ -191,11 +176,11 @@ function vye_generate_youtube_code( $id = '', $type = '', $width = '', $height =
|
|
191 |
if ( is_feed () ) {
|
192 |
$result = '';
|
193 |
if ( $playlist_ids != '' ) {
|
194 |
-
$result .= '<p>'.__( 'A video list cannot be viewed within this feed - please view the original content', 'youtube-embed' ).
|
195 |
} else {
|
196 |
$youtube_url = 'http' . $https . '://www.youtube.com/watch?' . $embed_type . '=' . $id;
|
197 |
-
if ( ( $embed_type == 'v' ) && ( $general[ 'feed' ] != 't' ) ) { $result .= '<p><a href="' . $youtube_url . '"><img src="http://img.youtube.com/vi/' . $id . '/' . $general[ 'thumbnail' ] .
|
198 |
-
if ( ( $general ['feed'] != 'v' ) or ( $embed_type != 'v' ) ) { $result .= '<p><a href="' . $youtube_url . '">' . __( 'Click here to view the video on YouTube', 'youtube-embed' ) .
|
199 |
}
|
200 |
return $result;
|
201 |
}
|
@@ -234,18 +219,13 @@ function vye_generate_youtube_code( $id = '', $type = '', $width = '', $height =
|
|
234 |
if ( $info == '' ) { $info = $options[ 'info' ]; }
|
235 |
if ( $annotation == '' ) { $annotation = $options[ 'annotation' ]; }
|
236 |
if ( $cc == '' ) { $cc = $options[ 'cc' ]; }
|
237 |
-
if ( $link == '' ) { $link = $options[ 'link' ]; }
|
238 |
-
if ( $react == '' ) { $react = $options[ 'react' ]; }
|
239 |
-
if ( $sweetspot == '' ) { $sweetspot = $options[ 'sweetspot' ]; }
|
240 |
if ( $disablekb == '' ) { $disablekb = $options[ 'disablekb' ]; }
|
241 |
if ( $autohide == '' ) { $autohide = $options[ 'autohide' ]; }
|
242 |
if ( $controls == '' ) { $controls = $options[ 'controls' ]; }
|
243 |
-
if ( $audio == '' ) { $audio = $options[ 'audio' ]; }
|
244 |
-
if ( $hd == '' ) { $hd = $options[ 'hd' ]; }
|
245 |
if ( $style == '' ) { $style = $options[ 'style' ]; }
|
246 |
if ( $color == '' ) { $color = $options[ 'color' ]; }
|
247 |
if ( $theme == '' ) { $theme = $options[ 'theme' ]; }
|
248 |
-
|
249 |
|
250 |
$wmode = $options[ 'wmode' ];
|
251 |
|
@@ -256,29 +236,11 @@ function vye_generate_youtube_code( $id = '', $type = '', $width = '', $height =
|
|
256 |
if ( $template == '' ) { $template = $options[ 'template' ]; } else { $template = vye_decode( $template ); }
|
257 |
if ( strpos( $template, '%video%' ) === false ) { $template = '%video%'; }
|
258 |
|
259 |
-
// If a multi-play list has been specified and EmbedPlus selected, use fallback embedding method instead
|
260 |
-
|
261 |
-
if ( ( $playlist_ids != '' ) && ( $type == 'm' ) && ( $list_style != 'single' ) ) { $type = $options[ 'fallback' ]; }
|
262 |
-
|
263 |
// If looping and no playlist has been generated, add the current ID
|
264 |
// This is a workaround for the AS3 player which won't otherwise loop
|
265 |
|
266 |
if ( ( $loop == 1 ) && ( $embed_type != 'p' ) && ( $playlist_ids == '' ) ) { $playlist_ids = $id; }
|
267 |
|
268 |
-
// If no type was specified, depending on whether this is a video or playlist, set the specific default
|
269 |
-
|
270 |
-
if ( $type == '' ) {
|
271 |
-
if ( $embed_type == 'v' ) {
|
272 |
-
$type = $options[ 'type' ];
|
273 |
-
} else {
|
274 |
-
$type = $options[ 'playlist' ];
|
275 |
-
}
|
276 |
-
}
|
277 |
-
|
278 |
-
// If a playlist, user or search was specified and this is is Chromeless, switch back to IFRAME to allow
|
279 |
-
|
280 |
-
if ( ( ( $embed_type == 'p' ) or ( $user != 0 ) or ( $search != 0 ) ) && ( $type == 'c' ) ) { $type = 'v'; }
|
281 |
-
|
282 |
// Set parameters without default values
|
283 |
|
284 |
if ( $start == '' ) { $start = '0'; }
|
@@ -315,107 +277,67 @@ function vye_generate_youtube_code( $id = '', $type = '', $width = '', $height =
|
|
315 |
$frameborder = '';
|
316 |
if ( isset( $general[ 'frameborder' ] ) ) { if ( $general[ 'frameborder' ] == 1 ) { $frameborder = 'frameborder="0" '; } }
|
317 |
|
318 |
-
// If audio playback option is set, restrict the height to just show the player toolbar
|
319 |
-
|
320 |
-
if ( $audio == '1' ) { $height = 27; }
|
321 |
-
|
322 |
// Set up embed types
|
323 |
|
324 |
-
$tab = '';
|
325 |
$class = 'youtube-player';
|
326 |
$paras = '?enablejsapi=1';
|
327 |
|
328 |
-
$embedplus = false;
|
329 |
-
$swf = false;
|
330 |
-
$iframe = false;
|
331 |
-
$chromeless = false;
|
332 |
-
|
333 |
-
if ( ( $type == 'm' ) && ( ( $user != 0 ) or ( $search != 0 ) ) ) { $type = $options[ 'fallback' ]; }
|
334 |
-
|
335 |
-
if ( $type != 'v' ) {
|
336 |
-
if ( $type == 'm' ) {
|
337 |
-
$embedplus = true;
|
338 |
-
$tab = "\t";
|
339 |
-
$embedheight = $height + 32;
|
340 |
-
$class = 'cantembedplus';
|
341 |
-
$fallback = $options[ 'fallback' ];
|
342 |
-
} else {
|
343 |
-
if ( $type == "c" ) {
|
344 |
-
$chromeless = true;
|
345 |
-
} else {
|
346 |
-
$swf = true;
|
347 |
-
}
|
348 |
-
}
|
349 |
-
$paras .= '&version=3';
|
350 |
-
} else {
|
351 |
-
$iframe = true;
|
352 |
-
}
|
353 |
-
|
354 |
// Generate parameters to add to URL
|
355 |
|
356 |
-
if ( $
|
357 |
-
if ( $fullscreen
|
358 |
-
if ( $related != 1 ) { $paras .= '&
|
359 |
-
if ( $autoplay == 1 ) { $paras .= '&
|
360 |
-
if ( $loop == 1 ) { $paras .= '&
|
361 |
-
if ( $info != 1 ) { $paras .= '&
|
362 |
-
if ( $annotation != 1 ) { $paras .= '&
|
363 |
-
|
364 |
-
if ( $
|
365 |
-
if ( $
|
366 |
-
if ( $
|
367 |
-
if (
|
368 |
-
if ( strtolower( $
|
369 |
-
if ( $
|
370 |
|
371 |
// If not a playlist, add the playlist parameter
|
372 |
|
373 |
-
if ( ( $playlist_ids != '' ) && ( $playlist_ids != $id ) ) { $paras .= '&
|
374 |
-
|
375 |
-
// Generate EmbedPlus parameters
|
376 |
-
|
377 |
-
$paras_ep = '&width=' . $width . '&height=' . $height;
|
378 |
-
if ( $react != 1 ) { $paras_ep .= '&react=0'; }
|
379 |
-
if ( $sweetspot != 1 ) { $paras_ep .= '&sweetspot=0'; }
|
380 |
-
if ( $hd == 1 ) { $paras_ep .= '&hd=1'; }
|
381 |
|
382 |
// Add start & stop parameters
|
383 |
|
384 |
-
if ( $start != 0 ) { $paras .= '&
|
385 |
-
if ( $stop != 0 ) { $
|
386 |
|
387 |
// Generate DIVs to wrap around video
|
388 |
|
389 |
if ( ( $dynamic == 1) or ( $metadata != 0 ) ) {
|
|
|
|
|
390 |
$result = '<div';
|
391 |
if ( $dynamic == 1 ) { $result .= ' class="ye-container"'; }
|
392 |
if ( $metadata != 0 ) { $result .= ' itemprop="video" itemscope itemtype="http://schema.org/VideoObject"'; }
|
393 |
-
$result .=
|
394 |
-
if ( ( $dynamic == 1 ) && ( $fixed == 1) ) {
|
|
|
|
|
|
|
|
|
|
|
395 |
}
|
396 |
|
397 |
// Add Metadata
|
398 |
|
399 |
if ( $metadata != 0 ) {
|
400 |
-
$newline = "\n";
|
401 |
-
if ( $return[ 'title' ] != '' ) { $result .= '<meta itemprop="name" content="' . htmlentities( $return[ 'title' ] ) . '"/>' . $newline; }
|
402 |
-
$result .= '<meta itemprop="thumbnailUrl" content="http://i.ytimg.com/vi/' . $id . '/hqdefault.jpg" />' . $newline;
|
403 |
-
$result .= '<meta itemprop="embedURL" content="http' . $https . '://www.youtube.com/' . $embed_type . '/' . $id . '" />' . $newline;
|
404 |
-
$result .= '<meta itemprop="height" content="' . $height . '" />' . $newline;
|
405 |
-
$result .= '<meta itemprop="width" content="' . $width . '" />' . $newline;
|
406 |
-
}
|
407 |
-
|
408 |
-
// Add EmbedPlus code
|
409 |
|
410 |
-
|
411 |
-
|
412 |
-
|
413 |
-
|
414 |
-
|
415 |
-
|
416 |
-
|
417 |
-
|
418 |
-
|
419 |
|
420 |
// Work out, depending on privacy settings, the main address to use
|
421 |
|
@@ -430,19 +352,8 @@ function vye_generate_youtube_code( $id = '', $type = '', $width = '', $height =
|
|
430 |
|
431 |
// Generate the first part of the embed URL along with the ID section
|
432 |
|
433 |
-
|
434 |
-
|
435 |
-
$id_paras = '?video_id=' . $id;
|
436 |
-
} else {
|
437 |
-
$embed_url = 'http' . $https . '://www.' . $url_privacy . '/';
|
438 |
-
if ( $type == 'v' ) {
|
439 |
-
$embed_url .= 'embed';
|
440 |
-
} else {
|
441 |
-
$embed_url .= 'v/';
|
442 |
-
}
|
443 |
-
$id_paras = $id;
|
444 |
-
if ( $type == 'v' ) { $id_paras = '/' . $id_paras; }
|
445 |
-
}
|
446 |
|
447 |
// If a playlist, user or download build the ID appropriately
|
448 |
|
@@ -453,9 +364,7 @@ function vye_generate_youtube_code( $id = '', $type = '', $width = '', $height =
|
|
453 |
if ( $user != 0 ) { $list_type = 'user_uploads'; }
|
454 |
if ( $search != 0 ) { $list_type = 'search'; $id = urlencode( $id ); }
|
455 |
|
456 |
-
$id_paras = '';
|
457 |
-
if ( $type == 'p' ) { $id_paras .= 'videoseries'; }
|
458 |
-
$id_paras .= '?listType=' . $list_type . '&list=';
|
459 |
if ( ( $embed_type == 'p' ) && ( strtolower( substr ( $id, 0, 2 ) ) != 'pl' ) ) { $id_paras .= 'PL'; }
|
460 |
$id_paras .= $id;
|
461 |
}
|
@@ -463,50 +372,40 @@ function vye_generate_youtube_code( $id = '', $type = '', $width = '', $height =
|
|
463 |
// Combine URL parts together
|
464 |
|
465 |
$embed_url .= $id_paras;
|
466 |
-
if ( strpos( $embed_url, '?' ) > 0 ) { $paras = '&
|
467 |
-
$embed_url .= $paras;
|
468 |
-
|
469 |
-
// Add AS3 YouTube embed code
|
470 |
-
|
471 |
-
if ( ( $swf ) or ( $chromeless ) or ( ( $embedplus ) && ( ( $fallback == 'o' ) or ( $fallback == 'p' ) ) ) ) {
|
472 |
-
$result .= $tab . "<object class=\"" . $class . "\" type=\"application/x-shockwave-flash\" data=\"" . $embed_url . "\" width=\"" . $width . "\" height=\"" . $height . "\" style=\"" . $style . "\"";
|
473 |
-
$result .= $tab . "\t<param name=\"movie\" value=\"" . $embed_url . "\" />\n";
|
474 |
-
$result .= $tab . "\t<param name=\"wmode\" value=\"" . $wmode . "\" />\n";
|
475 |
-
if ( $fullscreen == 1 ) { $result .= $tab . "\t<param name=\"allowFullScreen\" value=\"true\" />\n"; }
|
476 |
-
if ( ( $link != 1 ) && ( $link != '' ) ) { $result .= $tab . "\t<param name=\"allowNetworking\" value=\"internal\" />\n"; }
|
477 |
-
$result .= $tab . "</object>\n";
|
478 |
-
}
|
479 |
|
480 |
-
//
|
481 |
|
482 |
-
if ( ( $
|
483 |
-
if ( $embed_type == "p" ) { $playlist_para = "p/"; } else { $playlist_para = ''; }
|
484 |
-
$result .= $tab . '<iframe ' . $frameborder . 'style="border: 0;' . $style . '" class="' . $class . '" width="' . $width . '" height="' . $height . '" src="' . $embed_url . '&wmode=' . $wmode . '"';
|
485 |
-
if ( $fullscreen == 1 ) { $result .= ' allowfullscreen="allowfullscreen"'; }
|
486 |
-
$result .= " ></iframe>\n";
|
487 |
-
}
|
488 |
|
489 |
-
//
|
490 |
|
491 |
-
if ( $
|
|
|
|
|
|
|
492 |
|
493 |
// Now apply the template to the result
|
494 |
|
495 |
$end_tag = '';
|
496 |
if ( ( $dynamic == 1 ) or ( $metadata != 0 ) ) {
|
497 |
-
$
|
498 |
-
|
|
|
|
|
|
|
499 |
}
|
500 |
$result = str_replace( '%video%', $result . $end_tag, $template );
|
501 |
|
502 |
// Add the download link, if required
|
503 |
|
504 |
-
if ( $options[ 'download' ] == 1 ) { $result .= '<div style="' . $options[ 'download_style' ] . '" class="aye_download"
|
505 |
|
506 |
// Now add a commented header and trailer
|
507 |
|
508 |
-
$result =
|
509 |
-
$result .=
|
510 |
|
511 |
// Cache the output
|
512 |
|
@@ -616,12 +515,12 @@ function vye_get_url_para( $id, $para, $current ) {
|
|
616 |
// Look for an ampersand
|
617 |
|
618 |
$start_pos = false;
|
619 |
-
if ( strpos( $id, '&
|
620 |
|
621 |
// If a parameter was found, look for the end of it
|
622 |
|
623 |
if ( $start_pos !== false ) {
|
624 |
-
$end_pos = strpos( $id, '&
|
625 |
if ( !$end_pos ) { $end_pos = strlen( $id ); }
|
626 |
|
627 |
// Extract the parameter and return it
|
@@ -653,4 +552,4 @@ function vye_decode( $encoded ) {
|
|
653 |
|
654 |
return $decoded;
|
655 |
}
|
656 |
-
?>
|
24 |
* @uses vye_set_profile_defaults Set default profile options
|
25 |
*
|
26 |
* @param string $id Video ID
|
|
|
27 |
* @param string $width Video width
|
28 |
* @param string $height Video height
|
29 |
* @param string $fullscreen Fullscreen button
|
35 |
* @param string $annotation Annotations
|
36 |
* @param string $cc Closed captions
|
37 |
* @param string $style Stylesheet information
|
|
|
|
|
38 |
* @param string $stop Stop in seconds
|
|
|
39 |
* @param string $disablekb Disable keyboard controls
|
40 |
* @param string $ratio Video size ratio
|
41 |
* @param string $autohide Autohide controls
|
42 |
* @param string $controls Display controls
|
43 |
* @param string $profile Which profile to use
|
44 |
* @param string $list_style How to use a list, if used
|
|
|
45 |
* @param string $template Display template
|
|
|
46 |
* @param string $color Progress bar color
|
47 |
* @param string $theme Use dark or light theme
|
48 |
* @param string $https Use HTTPS for links
|
49 |
* @param string $dynamic Show dynamic output
|
50 |
* @param string $search Perform a search
|
51 |
* @param string $user Look up user videos
|
52 |
+
* @param string $modest Modest browsing
|
53 |
* @return string Code output
|
54 |
*/
|
55 |
|
56 |
+
function vye_generate_youtube_code( $id = '', $width = '', $height = '', $fullscreen = '', $related = '', $autoplay = '', $loop = '', $start = '', $info = '', $annotation = '', $cc = '', $style = '', $stop = '', $disablekb = '', $ratio = '', $autohide = '', $controls = '', $profile = '', $list_style = '', $template = '', $color = '', $theme = '', $https = '', $dynamic = '', $search = '', $user = '', $modest = '' ) {
|
57 |
|
58 |
// Ensure an ID is passed
|
59 |
|
60 |
if ( $id == '' ) { return vye_error( __( 'No video/playlist ID has been supplied', 'youtube-embed' ) ); }
|
61 |
|
62 |
+
$newline = "\n";
|
63 |
+
$tab = "\t";
|
64 |
+
|
65 |
// Get general options
|
66 |
|
67 |
$general = vye_set_general_defaults();
|
74 |
|
75 |
$options = vye_set_profile_defaults( $profile );
|
76 |
|
77 |
+
// If a user look-up or search has been requested, miss out looking up list details and
|
78 |
// simple assign it as an IFRAME video
|
79 |
|
80 |
+
$playlist_ids = '';
|
81 |
+
$embed_type = '';
|
82 |
|
83 |
if ( ( $user == 0 ) && ( $search == 0 ) ) {
|
84 |
|
96 |
|
97 |
$id = vye_extract_id( $id );
|
98 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
99 |
// Check what type of video it is and whether it's valid
|
100 |
|
101 |
+
$embed_type = vye_validate_id( $id );
|
|
|
102 |
|
103 |
+
// If the video is invalid, output an error
|
104 |
|
105 |
if ( ( $embed_type == '' ) or ( strlen ( $embed_type ) != 1 ) ) {
|
106 |
+
$result = $newline . '<!-- YouTube Embed v' . youtube_embed_version . ' -->' . $newline;
|
107 |
+
$result .= sprintf( __( 'The YouTube ID of %s is invalid.', 'youtube-embed' ), $id ) . $newline . '<!-- End of YouTube Embed code -->' . $newline;
|
|
|
|
|
|
|
|
|
|
|
108 |
return $result;
|
109 |
}
|
110 |
|
145 |
|
146 |
// Generate a cache key for the above passed parameters
|
147 |
|
148 |
+
$hash_key = $id . $width . $height . $fullscreen . $related . $autoplay . $loop . $start . $info . $annotation . $cc . $style . $stop . $disablekb . $ratio . $autohide . $controls . $profile . $list_style . $template . $color . $theme . $https . $dynamic . $search . $user . serialize( $general ) . serialize( $options );
|
149 |
if ( isset( $list ) ) { $hash_key .= serialize( $list ); }
|
150 |
if ( isset( $return ) ) { $hash_key .= serialize( $return ); }
|
151 |
|
154 |
// Try and get the output from cache. If it exists, return the code
|
155 |
|
156 |
if ( ( $general[ 'embed_cache' ] != 0 ) && ( !is_feed() ) && ( $list_style != 'random' ) ) {
|
157 |
+
echo 'Getting cache...';
|
158 |
$result = get_transient( $cache_key );
|
159 |
if ( $result !== false) { return $result; }
|
160 |
}
|
176 |
if ( is_feed () ) {
|
177 |
$result = '';
|
178 |
if ( $playlist_ids != '' ) {
|
179 |
+
$result .= '<p>'.__( 'A video list cannot be viewed within this feed - please view the original content', 'youtube-embed' ) . '.</p>' . $newline;
|
180 |
} else {
|
181 |
$youtube_url = 'http' . $https . '://www.youtube.com/watch?' . $embed_type . '=' . $id;
|
182 |
+
if ( ( $embed_type == 'v' ) && ( $general[ 'feed' ] != 't' ) ) { $result .= '<p><a href="' . $youtube_url . '"><img src="http://img.youtube.com/vi/' . $id . '/' . $general[ 'thumbnail' ] . '.jpg"></a></p>' . $newline; }
|
183 |
+
if ( ( $general ['feed'] != 'v' ) or ( $embed_type != 'v' ) ) { $result .= '<p><a href="' . $youtube_url . '">' . __( 'Click here to view the video on YouTube', 'youtube-embed' ) . '</a>.</p>' . $newline; }
|
184 |
}
|
185 |
return $result;
|
186 |
}
|
219 |
if ( $info == '' ) { $info = $options[ 'info' ]; }
|
220 |
if ( $annotation == '' ) { $annotation = $options[ 'annotation' ]; }
|
221 |
if ( $cc == '' ) { $cc = $options[ 'cc' ]; }
|
|
|
|
|
|
|
222 |
if ( $disablekb == '' ) { $disablekb = $options[ 'disablekb' ]; }
|
223 |
if ( $autohide == '' ) { $autohide = $options[ 'autohide' ]; }
|
224 |
if ( $controls == '' ) { $controls = $options[ 'controls' ]; }
|
|
|
|
|
225 |
if ( $style == '' ) { $style = $options[ 'style' ]; }
|
226 |
if ( $color == '' ) { $color = $options[ 'color' ]; }
|
227 |
if ( $theme == '' ) { $theme = $options[ 'theme' ]; }
|
228 |
+
if ( $modest == '' ) { $modest = $options[ 'modest' ]; }
|
229 |
|
230 |
$wmode = $options[ 'wmode' ];
|
231 |
|
236 |
if ( $template == '' ) { $template = $options[ 'template' ]; } else { $template = vye_decode( $template ); }
|
237 |
if ( strpos( $template, '%video%' ) === false ) { $template = '%video%'; }
|
238 |
|
|
|
|
|
|
|
|
|
239 |
// If looping and no playlist has been generated, add the current ID
|
240 |
// This is a workaround for the AS3 player which won't otherwise loop
|
241 |
|
242 |
if ( ( $loop == 1 ) && ( $embed_type != 'p' ) && ( $playlist_ids == '' ) ) { $playlist_ids = $id; }
|
243 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
244 |
// Set parameters without default values
|
245 |
|
246 |
if ( $start == '' ) { $start = '0'; }
|
277 |
$frameborder = '';
|
278 |
if ( isset( $general[ 'frameborder' ] ) ) { if ( $general[ 'frameborder' ] == 1 ) { $frameborder = 'frameborder="0" '; } }
|
279 |
|
|
|
|
|
|
|
|
|
280 |
// Set up embed types
|
281 |
|
|
|
282 |
$class = 'youtube-player';
|
283 |
$paras = '?enablejsapi=1';
|
284 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
285 |
// Generate parameters to add to URL
|
286 |
|
287 |
+
if ( $modest == 1 ) { $paras .= '&modestbranding=1'; }
|
288 |
+
if ( $fullscreen != 1 ) { $paras .= '&fs=0'; }
|
289 |
+
if ( $related != 1 ) { $paras .= '&rel=0'; }
|
290 |
+
if ( $autoplay == 1 ) { $paras .= '&autoplay=1'; }
|
291 |
+
if ( $loop == 1 ) { $paras .= '&loop=1'; }
|
292 |
+
if ( $info != 1 ) { $paras .= '&showinfo=0'; }
|
293 |
+
if ( $annotation != 1 ) { $paras .= '&iv_load_policy=3'; }
|
294 |
+
$paras .= '&cc_load_policy=';
|
295 |
+
if ( $cc == 1 ) { $paras .= '1'; } else { $paras .= '0'; }
|
296 |
+
if ( $disablekb == 1 ) { $paras .= '&disablekb=1'; }
|
297 |
+
if ( $autohide != 2 ) { $paras .= '&autohide=' . $autohide; }
|
298 |
+
if ( $controls != 1 ) { $paras .= '&controls=' . $controls; }
|
299 |
+
if ( strtolower( $color ) != 'red' ) { $paras .= '&color=' . strtolower( $color ); }
|
300 |
+
if ( strtolower( $theme ) != 'dark' ) { $paras .= '&theme=' . strtolower( $theme ); }
|
301 |
|
302 |
// If not a playlist, add the playlist parameter
|
303 |
|
304 |
+
if ( ( $playlist_ids != '' ) && ( $playlist_ids != $id ) ) { $paras .= '&playlist=' . $playlist_ids; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
305 |
|
306 |
// Add start & stop parameters
|
307 |
|
308 |
+
if ( $start != 0 ) { $paras .= '&start=' . $start; }
|
309 |
+
if ( $stop != 0 ) { $paras .= '&end=' . $stop; }
|
310 |
|
311 |
// Generate DIVs to wrap around video
|
312 |
|
313 |
if ( ( $dynamic == 1) or ( $metadata != 0 ) ) {
|
314 |
+
|
315 |
+
$ttab = $tab;
|
316 |
$result = '<div';
|
317 |
if ( $dynamic == 1 ) { $result .= ' class="ye-container"'; }
|
318 |
if ( $metadata != 0 ) { $result .= ' itemprop="video" itemscope itemtype="http://schema.org/VideoObject"'; }
|
319 |
+
$result .= '>' . $newline;
|
320 |
+
if ( ( $dynamic == 1 ) && ( $fixed == 1) ) {
|
321 |
+
$result = '<div style="width: ' . $width . 'px; max-width: 100%">' . $newline . $tab . $result;
|
322 |
+
$ttab .= $tab;
|
323 |
+
}
|
324 |
+
} else {
|
325 |
+
$ttab = '';
|
326 |
}
|
327 |
|
328 |
// Add Metadata
|
329 |
|
330 |
if ( $metadata != 0 ) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
331 |
|
332 |
+
$result .= $ttab . '<meta itemprop="url" content="http' . $https . '://www.youtube.com/' . $embed_type . '/' . $id . '" />' . $newline;
|
333 |
+
$result .= $ttab . '<meta itemprop="name" content="' . get_the_title() . '" />' . $newline;
|
334 |
+
$result .= $ttab . '<meta itemprop="description" content="' . htmlentities( get_the_excerpt() ). '" />' . $newline;
|
335 |
+
$result .= $ttab . '<meta itemprop="uploadDate" content="' . get_the_date( 'c' ) . '" />' . $newline;
|
336 |
+
$result .= $ttab . '<meta itemprop="thumbnailUrl" content="http://i.ytimg.com/vi/' . $id . '/hqdefault.jpg" />' . $newline;
|
337 |
+
$result .= $ttab . '<meta itemprop="embedUrl" content="http' . $https . '://www.youtube.com/embed/' . $id . '" />' . $newline;
|
338 |
+
$result .= $ttab . '<meta itemprop="height" content="' . $height . '" />' . $newline;
|
339 |
+
$result .= $ttab . '<meta itemprop="width" content="' . $width . '" />' . $newline;
|
340 |
+
}
|
341 |
|
342 |
// Work out, depending on privacy settings, the main address to use
|
343 |
|
352 |
|
353 |
// Generate the first part of the embed URL along with the ID section
|
354 |
|
355 |
+
$embed_url = 'http' . $https . '://www.' . $url_privacy . '/embed';
|
356 |
+
$id_paras = '/' . $id;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
357 |
|
358 |
// If a playlist, user or download build the ID appropriately
|
359 |
|
364 |
if ( $user != 0 ) { $list_type = 'user_uploads'; }
|
365 |
if ( $search != 0 ) { $list_type = 'search'; $id = urlencode( $id ); }
|
366 |
|
367 |
+
$id_paras = '?listType=' . $list_type . '&list=';
|
|
|
|
|
368 |
if ( ( $embed_type == 'p' ) && ( strtolower( substr ( $id, 0, 2 ) ) != 'pl' ) ) { $id_paras .= 'PL'; }
|
369 |
$id_paras .= $id;
|
370 |
}
|
372 |
// Combine URL parts together
|
373 |
|
374 |
$embed_url .= $id_paras;
|
375 |
+
if ( strpos( $embed_url, '?' ) > 0 ) { $paras = '&' . substr( $paras, 1 ); }
|
376 |
+
$embed_url .= $paras . '&wmode=' . $wmode;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
377 |
|
378 |
+
// Check length of URL to ensure it doesn't exceed 2000 characters
|
379 |
|
380 |
+
if ( strlen( $embed_url ) > 2000 ) { return vye_error( __( 'The maximum URL length has been exceeded. Please reduce your parameter and/or playlist.', 'youtube-embed' ) ); }
|
|
|
|
|
|
|
|
|
|
|
381 |
|
382 |
+
// Add IFRAME embed code
|
383 |
|
384 |
+
if ( $embed_type == "p" ) { $playlist_para = "p/"; } else { $playlist_para = ''; }
|
385 |
+
$result .= $ttab . '<iframe ' . $frameborder . 'style="border: 0;' . $style . '" class="' . $class . '" width="' . $width . '" height="' . $height . '" src="' . $embed_url . '"';
|
386 |
+
if ( $fullscreen == 1 ) { $result .= ' allowfullscreen="allowfullscreen"'; }
|
387 |
+
$result .= ' ></iframe>' . $newline;
|
388 |
|
389 |
// Now apply the template to the result
|
390 |
|
391 |
$end_tag = '';
|
392 |
if ( ( $dynamic == 1 ) or ( $metadata != 0 ) ) {
|
393 |
+
if ( ( $dynamic == 1 ) && ( $fixed == 1 ) ) {
|
394 |
+
$end_tag .= $tab . '</div>' . $newline . '</div>' . $newline;
|
395 |
+
} else {
|
396 |
+
$end_tag .= '</div>' . $newline;
|
397 |
+
}
|
398 |
}
|
399 |
$result = str_replace( '%video%', $result . $end_tag, $template );
|
400 |
|
401 |
// Add the download link, if required
|
402 |
|
403 |
+
if ( $options[ 'download' ] == 1 ) { $result .= '<div style="' . $options[ 'download_style' ] . '" class="aye_download">' . $newline . $tab . '<a href="' . vye_generate_download_code( $id ) . "\">" . $options[ 'download_text' ] . '</a>' . $newline . '</div>' . $newline; }
|
404 |
|
405 |
// Now add a commented header and trailer
|
406 |
|
407 |
+
$result = $newline . '<!-- YouTube Embed v' . youtube_embed_version . ' -->' . $newline . $result;
|
408 |
+
$result .= '<!-- End of YouTube Embed code -->';
|
409 |
|
410 |
// Cache the output
|
411 |
|
515 |
// Look for an ampersand
|
516 |
|
517 |
$start_pos = false;
|
518 |
+
if ( strpos( $id, '&' . $para . '=' ) !== false ) { $start_pos = strpos( $id, '&' . $para . '=' ) + 6 + strlen( $para ); }
|
519 |
|
520 |
// If a parameter was found, look for the end of it
|
521 |
|
522 |
if ( $start_pos !== false ) {
|
523 |
+
$end_pos = strpos( $id, '&', $start_pos + 1 );
|
524 |
if ( !$end_pos ) { $end_pos = strlen( $id ); }
|
525 |
|
526 |
// Extract the parameter and return it
|
552 |
|
553 |
return $decoded;
|
554 |
}
|
555 |
+
?>
|
includes/{generate-thumbnail-code.php → generate-other-code.php}
RENAMED
@@ -1,4 +1,85 @@
|
|
1 |
<?php
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
/**
|
3 |
* Generate Thumbnail Code
|
4 |
*
|
1 |
<?php
|
2 |
+
/**
|
3 |
+
* Generate Download Code
|
4 |
+
*
|
5 |
+
* Create code to allow a YouTube video to be downloaded
|
6 |
+
*
|
7 |
+
* @package YouTube-Embed
|
8 |
+
* @since 2.0
|
9 |
+
*
|
10 |
+
* @uses vye_extract_id Extract an ID from a string
|
11 |
+
* @uses vye_validate_id Confirm the type of video
|
12 |
+
* @uses vye_error Display an error
|
13 |
+
*
|
14 |
+
* @param string $id YouTube video ID
|
15 |
+
* @return string Download HTML
|
16 |
+
*/
|
17 |
+
|
18 |
+
function vye_generate_download_code( $id ) {
|
19 |
+
|
20 |
+
if ( $id == '' ) { return vye_error( __ ( 'No YouTube ID was found.', 'youtube-embed' ) ); }
|
21 |
+
|
22 |
+
// Extract the ID if a full URL has been specified
|
23 |
+
|
24 |
+
$id = vye_extract_id( $id );
|
25 |
+
|
26 |
+
// Check what type of video it is and whether it's valid
|
27 |
+
|
28 |
+
$embed_type = vye_validate_id( $id );
|
29 |
+
if ( $embed_type != 'v' ) {
|
30 |
+
if ( strlen( $embed_type ) > 1 ) {
|
31 |
+
return vye_error( $embed_type );
|
32 |
+
} else {
|
33 |
+
return vye_error( sprintf( __( 'The YouTube ID of %s is invalid.', 'youtube-embed' ), $id ) );
|
34 |
+
}
|
35 |
+
}
|
36 |
+
|
37 |
+
// Create the link
|
38 |
+
|
39 |
+
return 'http://keepvid.com/?url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D' . $id;
|
40 |
+
|
41 |
+
}
|
42 |
+
|
43 |
+
/**
|
44 |
+
* Generate video short URL
|
45 |
+
*
|
46 |
+
* Create a short URL to a YouTube video
|
47 |
+
*
|
48 |
+
* @package YouTube-Embed
|
49 |
+
* @since 2.0
|
50 |
+
*
|
51 |
+
* @uses vye_extract_id Extract an ID from a string
|
52 |
+
* @uses vye_validate_id Confirm the type of video
|
53 |
+
* @uses vye_error Display an error
|
54 |
+
*
|
55 |
+
* @param string $id YouTube video ID
|
56 |
+
* @return string $youtube_code Code
|
57 |
+
*/
|
58 |
+
|
59 |
+
function vye_generate_shorturl_code( $id ) {
|
60 |
+
|
61 |
+
// Check that an ID has been specified
|
62 |
+
if ( $id == '' ) {
|
63 |
+
return vye_error( __( 'No video ID has been supplied', 'youtube-embed' ) );
|
64 |
+
} else {
|
65 |
+
|
66 |
+
// Extract the ID if a full URL has been specified
|
67 |
+
$id = vye_extract_id( $id );
|
68 |
+
|
69 |
+
// Check what type of video it is and whether it's valid
|
70 |
+
$embed_type = vye_validate_id( $id );
|
71 |
+
if ( $embed_type != 'v' ) {
|
72 |
+
if ( strlen( $embed_type ) > 1 ) {
|
73 |
+
return vye_error( $embed_type );
|
74 |
+
} else {
|
75 |
+
return vye_error( sprintf( __( 'The YouTube ID of %s is invalid.', 'youtube-embed' ), $id ) );
|
76 |
+
}
|
77 |
+
}
|
78 |
+
|
79 |
+
return 'http://youtu.be/' . $id;
|
80 |
+
}
|
81 |
+
}
|
82 |
+
|
83 |
/**
|
84 |
* Generate Thumbnail Code
|
85 |
*
|
includes/generate-shorturl-code.php
DELETED
@@ -1,41 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Generate video short URL
|
4 |
-
*
|
5 |
-
* Create a short URL to a YouTube video
|
6 |
-
*
|
7 |
-
* @package YouTube-Embed
|
8 |
-
* @since 2.0
|
9 |
-
*
|
10 |
-
* @uses vye_extract_id Extract an ID from a string
|
11 |
-
* @uses vye_validate_id Confirm the type of video
|
12 |
-
* @uses vye_error Display an error
|
13 |
-
*
|
14 |
-
* @param string $id YouTube video ID
|
15 |
-
* @return string $youtube_code Code
|
16 |
-
*/
|
17 |
-
|
18 |
-
function vye_generate_shorturl_code( $id ) {
|
19 |
-
|
20 |
-
// Check that an ID has been specified
|
21 |
-
if ( $id == '' ) {
|
22 |
-
return vye_error( __( 'No video ID has been supplied', 'youtube-embed' ) );
|
23 |
-
} else {
|
24 |
-
|
25 |
-
// Extract the ID if a full URL has been specified
|
26 |
-
$id = vye_extract_id( $id );
|
27 |
-
|
28 |
-
// Check what type of video it is and whether it's valid
|
29 |
-
$embed_type = vye_validate_id( $id );
|
30 |
-
if ( $embed_type != 'v' ) {
|
31 |
-
if ( strlen( $embed_type ) > 1 ) {
|
32 |
-
return vye_error( $embed_type );
|
33 |
-
} else {
|
34 |
-
return vye_error( sprintf( __( 'The YouTube ID of %s is invalid.', 'youtube-embed' ), $id ) );
|
35 |
-
}
|
36 |
-
}
|
37 |
-
|
38 |
-
return 'http://youtu.be/' . $id;
|
39 |
-
}
|
40 |
-
}
|
41 |
-
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/generate-transcript-code.php
DELETED
@@ -1,97 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Create Transcript
|
4 |
-
*
|
5 |
-
* All functions relating to creating YouTube transcripts
|
6 |
-
*
|
7 |
-
* @package YouTube-Embed
|
8 |
-
* @since 2.0
|
9 |
-
*/
|
10 |
-
|
11 |
-
/**
|
12 |
-
* Get YouTube Transcript
|
13 |
-
*
|
14 |
-
* Generate re-encoded YouTube transcript
|
15 |
-
*
|
16 |
-
* @since 2.0
|
17 |
-
*
|
18 |
-
* @uses vye_extract_id Extract the ID
|
19 |
-
* @uses vye_get_file Get a file
|
20 |
-
* @uses vye_set_general_defaults Set default options
|
21 |
-
* @uses vye_validate_id Validate the ID
|
22 |
-
*
|
23 |
-
* @param string $id Video ID
|
24 |
-
* @param string $language Language
|
25 |
-
* @return string $output Transcript output
|
26 |
-
*/
|
27 |
-
|
28 |
-
function vye_generate_transcript( $id, $language = 'en' ) {
|
29 |
-
|
30 |
-
// Extract the ID if a full URL has been specified
|
31 |
-
$id = vye_extract_id( $id );
|
32 |
-
|
33 |
-
// Check what type of video it is and whether it's valid
|
34 |
-
$embed_type = vye_validate_id( $id );
|
35 |
-
if ( $embed_type != 'v' ) {
|
36 |
-
if ( strlen( $embed_type ) > 1 ) {
|
37 |
-
return vye_error( $embed_type );
|
38 |
-
} else {
|
39 |
-
return vye_error( sprintf( __( 'The YouTube ID of %s is invalid.', 'youtube-embed' ), $id ) );
|
40 |
-
}
|
41 |
-
}
|
42 |
-
|
43 |
-
// Get general options
|
44 |
-
$general = vye_set_general_defaults();
|
45 |
-
|
46 |
-
// Check to see if cache is available
|
47 |
-
if ( $general[ 'transcript_cache' ] != 0 ) {
|
48 |
-
$cache_key = 'vye_transcript_'.$id;
|
49 |
-
$output = get_transient( $cache_key );
|
50 |
-
if ( $output !== false) { return $output; }
|
51 |
-
}
|
52 |
-
|
53 |
-
// Get transcript file
|
54 |
-
$return = vye_get_file( 'http://video.google.com/timedtext?lang=' . strtolower( $language ) . '&v=' . $id );
|
55 |
-
$xml = $return[ 'file' ];
|
56 |
-
$output = '';
|
57 |
-
|
58 |
-
// If transcript file exists, strip and output
|
59 |
-
if ( $return[ 'rc' ] == 0 ) {
|
60 |
-
$output = "<!-- YouTube Embed v" . youtube_embed_version . " -->\n";
|
61 |
-
$pos = 0;
|
62 |
-
$eof = false;
|
63 |
-
|
64 |
-
while ( !$eof ) {
|
65 |
-
$text_start = strpos( $xml, '<text ',$pos );
|
66 |
-
if ( $text_start !== false ) {
|
67 |
-
|
68 |
-
// Extract the start time
|
69 |
-
$start_start = strpos( $xml, 'start="', $text_start ) + 7;
|
70 |
-
$start_end = strpos( $xml, '"', $start_start ) - 1;
|
71 |
-
$start = substr( $xml, $start_start, $start_end - $start_start + 1 );
|
72 |
-
|
73 |
-
// Convert time format
|
74 |
-
$start = str_pad( floor( $start ), 3, '0', STR_PAD_LEFT );
|
75 |
-
$start = substr( $start, 0, -2 ) . ':' . substr( $start, -2, 2 );
|
76 |
-
|
77 |
-
// Now extract the text
|
78 |
-
$text_start = strpos( $xml, '>', $text_start ) + 1;
|
79 |
-
$text_end = strpos( $xml, '</text>', $text_start ) - 1;
|
80 |
-
$text = substr( $xml, $text_start, $text_end - $text_start + 1 );
|
81 |
-
|
82 |
-
// Now return the output
|
83 |
-
$output .= "<div class=\"Transcript\"><span class=\"TranscriptTime\">" . $start . "</span> <span class=\"TranscriptText\">" . htmlspecialchars_decode( $text ) . "</span></div>\n";
|
84 |
-
$pos = $text_end + 7;
|
85 |
-
} else {
|
86 |
-
$eof = true;
|
87 |
-
}
|
88 |
-
}
|
89 |
-
$output .= "<!-- End of YouTube Embed code -->\n";
|
90 |
-
}
|
91 |
-
|
92 |
-
// Save the cache
|
93 |
-
if ( $general[ 'transcript_cache' ] != 0 ) { set_transient( $cache_key, $output, 3600 * $general[ 'transcript_cache' ] ); }
|
94 |
-
|
95 |
-
return $output;
|
96 |
-
}
|
97 |
-
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/generate-widgets.php
CHANGED
@@ -41,6 +41,7 @@ class YouTubeEmbedWidget extends WP_Widget {
|
|
41 |
*/
|
42 |
|
43 |
function widget( $args, $instance ) {
|
|
|
44 |
extract( $args, EXTR_SKIP );
|
45 |
|
46 |
// Output the header
|
@@ -58,37 +59,33 @@ class YouTubeEmbedWidget extends WP_Widget {
|
|
58 |
|
59 |
// Generate the video and output it
|
60 |
echo vye_generate_youtube_code ( $instance[ 'id' ],
|
61 |
-
$instance[ 'type' ],
|
62 |
-
$instance[ 'width' ],
|
63 |
-
$instance[ 'height' ],
|
64 |
'',
|
65 |
'',
|
66 |
-
$instance[ 'autoplay' ],
|
67 |
-
$instance[ 'loop' ],
|
68 |
-
$instance[ 'start' ],
|
69 |
'',
|
70 |
'',
|
71 |
'',
|
72 |
-
$instance[ 'style' ],
|
73 |
'',
|
|
|
74 |
'',
|
75 |
-
$instance[ 'stop' ],
|
76 |
'',
|
77 |
'',
|
78 |
'',
|
|
|
|
|
|
|
79 |
'',
|
80 |
'',
|
81 |
$instance[ 'profile' ],
|
82 |
$instance[ 'list' ],
|
83 |
'',
|
84 |
-
$instance[ 'template' ],
|
85 |
'',
|
86 |
'',
|
87 |
'',
|
88 |
'',
|
89 |
-
|
90 |
$search,
|
91 |
-
$user
|
|
|
92 |
|
93 |
// Output the trailer
|
94 |
echo $after_widget;
|
@@ -112,21 +109,12 @@ class YouTubeEmbedWidget extends WP_Widget {
|
|
112 |
$instance[ 'titles' ] = strip_tags( $new_instance[ 'titles' ] );
|
113 |
$instance[ 'id' ] = $new_instance[ 'id' ];
|
114 |
$instance[ 'profile' ] = $new_instance[ 'profile' ];
|
115 |
-
$instance[ 'type' ] = $new_instance[ 'type' ];
|
116 |
-
$instance[ 'template' ] = $new_instance[ 'template' ];
|
117 |
-
$instance[ 'style' ] = $new_instance[ 'style' ];
|
118 |
$instance[ 'start' ] = $new_instance[ 'start' ];
|
119 |
-
$instance[ 'autoplay' ] = $new_instance[ 'autoplay' ];
|
120 |
-
$instance[ 'width' ] = $new_instance[ 'width' ];
|
121 |
-
$instance[ 'height' ] = $new_instance[ 'height' ];
|
122 |
-
$instance[ 'dynamic' ] = $new_instance[ 'dynamic' ];
|
123 |
$instance[ 'list' ] = $new_instance[ 'list' ];
|
124 |
-
$instance[ 'loop' ] = $new_instance[ 'loop' ];
|
125 |
$instance[ 'stop' ] = $new_instance[ 'stop' ];
|
126 |
$instance[ 'id_type' ] = $new_instance[ 'id_type' ];
|
127 |
|
128 |
return $instance;
|
129 |
-
|
130 |
}
|
131 |
|
132 |
/**
|
@@ -140,7 +128,80 @@ class YouTubeEmbedWidget extends WP_Widget {
|
|
140 |
*/
|
141 |
|
142 |
function form( $instance ) {
|
143 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
144 |
}
|
145 |
}
|
146 |
|
41 |
*/
|
42 |
|
43 |
function widget( $args, $instance ) {
|
44 |
+
|
45 |
extract( $args, EXTR_SKIP );
|
46 |
|
47 |
// Output the header
|
59 |
|
60 |
// Generate the video and output it
|
61 |
echo vye_generate_youtube_code ( $instance[ 'id' ],
|
|
|
|
|
|
|
62 |
'',
|
63 |
'',
|
|
|
|
|
|
|
64 |
'',
|
65 |
'',
|
66 |
'',
|
|
|
67 |
'',
|
68 |
+
$instance[ 'start' ],
|
69 |
'',
|
|
|
70 |
'',
|
71 |
'',
|
72 |
'',
|
73 |
+
$instance[ 'stop' ],
|
74 |
+
'',
|
75 |
+
'',
|
76 |
'',
|
77 |
'',
|
78 |
$instance[ 'profile' ],
|
79 |
$instance[ 'list' ],
|
80 |
'',
|
|
|
81 |
'',
|
82 |
'',
|
83 |
'',
|
84 |
'',
|
85 |
+
'',
|
86 |
$search,
|
87 |
+
$user,
|
88 |
+
'' );
|
89 |
|
90 |
// Output the trailer
|
91 |
echo $after_widget;
|
109 |
$instance[ 'titles' ] = strip_tags( $new_instance[ 'titles' ] );
|
110 |
$instance[ 'id' ] = $new_instance[ 'id' ];
|
111 |
$instance[ 'profile' ] = $new_instance[ 'profile' ];
|
|
|
|
|
|
|
112 |
$instance[ 'start' ] = $new_instance[ 'start' ];
|
|
|
|
|
|
|
|
|
113 |
$instance[ 'list' ] = $new_instance[ 'list' ];
|
|
|
114 |
$instance[ 'stop' ] = $new_instance[ 'stop' ];
|
115 |
$instance[ 'id_type' ] = $new_instance[ 'id_type' ];
|
116 |
|
117 |
return $instance;
|
|
|
118 |
}
|
119 |
|
120 |
/**
|
128 |
*/
|
129 |
|
130 |
function form( $instance ) {
|
131 |
+
|
132 |
+
// Set default options
|
133 |
+
|
134 |
+
$default = array( 'titles' => 'YouTube', 'id' => '', 'profile' => '', 'start' => '', 'list' => '', 'stop' => '', 'id_type' => 'v' );
|
135 |
+
$instance = wp_parse_args( ( array ) $instance, $default );
|
136 |
+
$general = vye_set_general_defaults();
|
137 |
+
|
138 |
+
// Widget Title field
|
139 |
+
|
140 |
+
$field_id = $this -> get_field_id( 'titles' );
|
141 |
+
$field_name = $this -> get_field_name( 'titles' );
|
142 |
+
echo "\r\n" . '<p><label for="' . $field_id . '">' . __( 'Widget Title', 'youtube-embed' ) . ': </label><input type="text" class="widefat" id="' . $field_id . '" name="' . $field_name . '" value="' . attribute_escape( $instance[ 'titles' ] ).'" /></p>';
|
143 |
+
|
144 |
+
// Video ID field
|
145 |
+
|
146 |
+
$field_id = $this -> get_field_id( 'id' );
|
147 |
+
$field_name = $this -> get_field_name( 'id' );
|
148 |
+
echo "\r\n" . '<p><label for="' . $field_id . '">' . __( 'Video ID', 'youtube-embed' ) . ': </label><input type="text" class="widefat" id="' . $field_id . '" name="' . $field_name . '" value="' . attribute_escape( $instance[ 'id' ] ) . '" /></p>';
|
149 |
+
|
150 |
+
// ID Type
|
151 |
+
|
152 |
+
echo "<table>\n";
|
153 |
+
|
154 |
+
$field_id = $this -> get_field_id( 'id_type' );
|
155 |
+
$field_name = $this -> get_field_name( 'id_type' );
|
156 |
+
echo "\r\n" . '<tr><td width="100%">' . __( 'ID Type', 'youtube-embed' ) . '</td><td><select name="' . $field_name . '" id="' . $field_id . '"><option value="v"';
|
157 |
+
if ( attribute_escape( $instance[ 'id_type' ] ) == 'v' ) { echo " selected='selected'"; }
|
158 |
+
echo '>' . __( 'Video or Playlist', 'youtube-embed' ) . '</option><option value="s"';
|
159 |
+
if ( attribute_escape( $instance[ 'id_type' ] ) == 's' ) { echo " selected='selected'"; }
|
160 |
+
echo '>' . __( 'Search', 'youtube-embed' ) . '</option><option value="u"';
|
161 |
+
if ( attribute_escape( $instance[ 'id_type' ] ) == 'u' ) { echo " selected='selected'"; }
|
162 |
+
echo '>' . __( 'User', 'youtube-embed' ) . '</option></select></td></tr>';
|
163 |
+
|
164 |
+
echo "</table>\n";
|
165 |
+
|
166 |
+
// Profile field
|
167 |
+
|
168 |
+
$field_id = $this -> get_field_id( 'profile' );
|
169 |
+
$field_name = $this -> get_field_name( 'profile' );
|
170 |
+
echo "\r\n" . '<p><label for="' . $field_id . '">' . __( 'Profile', 'youtube-embed' ) . ': </label><select name="' . $field_name . '" class="widefat" id="' . $field_id . '">';
|
171 |
+
vye_generate_profile_list( attribute_escape( $instance[ 'profile' ] ), $general[ 'profile_no' ] );
|
172 |
+
echo '</select></p>';
|
173 |
+
|
174 |
+
echo "<table>\n";
|
175 |
+
|
176 |
+
// Start field
|
177 |
+
|
178 |
+
$field_id = $this -> get_field_id( 'start' );
|
179 |
+
$field_name = $this -> get_field_name( 'start' );
|
180 |
+
echo "\r\n" . '<tr><td width="100%">' . __( 'Start (seconds)', 'youtube-embed' ) . '</td><td><input type="text" size="3" maxlength="3" id="' . $field_id . '" name="' . $field_name . '" value="' . attribute_escape( $instance[ 'start' ] ) . '" /></td></tr>';
|
181 |
+
|
182 |
+
// Stop field
|
183 |
+
|
184 |
+
$field_id = $this -> get_field_id( 'stop' );
|
185 |
+
$field_name = $this -> get_field_name( 'stop' );
|
186 |
+
echo "\r\n" . '<tr><td width="100%">' . __( 'Stop (seconds)', 'youtube-embed' ) . '</td><td><input type="text" size="3" maxlength="3" id="' . $field_id . '" name="' . $field_name . '" value="' . attribute_escape( $instance[ 'stop' ] ) . '" /></td></tr>';
|
187 |
+
|
188 |
+
echo "</table><table>\n";
|
189 |
+
|
190 |
+
// List field
|
191 |
+
|
192 |
+
$field_id = $this -> get_field_id( 'list' );
|
193 |
+
$field_name = $this -> get_field_name( 'list' );
|
194 |
+
echo "\r\n" . '<tr><td width="100%">' . __( 'List Playback', 'youtube-embed' ) . '</td><td><select name="' . $field_name . '" id="' . $field_id . '"><option value=""';
|
195 |
+
if ( attribute_escape( $instance[ 'list' ] ) == '' ) { echo " selected='selected'"; }
|
196 |
+
echo '>' . __( 'Profile default', 'youtube-embed' ) . '</option><option value="order"';
|
197 |
+
if ( attribute_escape( $instance[ 'list' ] ) == 'order' ) { echo " selected='selected'"; }
|
198 |
+
echo '>' . __( 'Play each video in order', 'youtube-embed' ) . '</option><option value="random"';
|
199 |
+
if ( attribute_escape( $instance[ 'list' ] ) == 'random' ) { echo " selected='selected'"; }
|
200 |
+
echo '>' . __( 'Play videos randomly', 'youtube-embed' ) . '</option><option value="single"';
|
201 |
+
if ( attribute_escape( $instance[ 'list' ] ) == 'single' ) { echo " selected='selected'"; }
|
202 |
+
echo '>' . __( 'Play one random video', 'youtube-embed' ) . '</option></select></td></tr>';
|
203 |
+
|
204 |
+
echo "</table>\n";
|
205 |
}
|
206 |
}
|
207 |
|
includes/options-general.php
CHANGED
@@ -8,7 +8,7 @@
|
|
8 |
* @since 2.0
|
9 |
*/
|
10 |
?>
|
11 |
-
<div class="wrap"
|
12 |
<?php
|
13 |
global $wp_version;
|
14 |
if ( ( float ) $wp_version >= 4.3 ) { $heading = '1'; } else { $heading = '2'; }
|
@@ -21,39 +21,24 @@ if ( ( float ) $wp_version >= 4.3 ) { $heading = '1'; } else { $heading = '2'; }
|
|
21 |
|
22 |
if ( ( !empty( $_POST ) ) && ( check_admin_referer( 'youtube-embed-general', 'youtube_embed_general_nonce' ) ) ) {
|
23 |
|
24 |
-
$options[ 'editor_button' ] = $_POST[ 'youtube_embed_editor_button' ];
|
25 |
-
$options[ 'admin_bar' ] = $_POST[ 'youtube_embed_admin_bar' ];
|
26 |
$options[ 'profile_no' ] = $_POST[ 'youtube_embed_profile_no' ];
|
27 |
-
|
28 |
-
// If the number of profiles is less than zero, put it to 0
|
29 |
-
|
30 |
-
if ( $options[ 'profile_no' ] < 0 ) { $options[ 'profile_no' ] = 0; }
|
31 |
-
|
32 |
$options[ 'list_no' ] = $_POST[ 'youtube_embed_list_no' ];
|
33 |
|
34 |
-
// If the number of lists is less than
|
35 |
|
36 |
-
if ( $options[ '
|
|
|
37 |
|
38 |
$options[ 'embed_cache' ] = $_POST[ 'youtube_embed_embed_cache' ];
|
39 |
-
$options[ 'info_cache' ] = $_POST[ 'youtube_embed_info_cache' ];
|
40 |
-
$options[ 'transcript_cache' ] = $_POST[ 'youtube_embed_transcript_cache' ];
|
41 |
-
$options[ 'comments_cache' ] = $_POST[ 'youtube_embed_comments_cache' ];
|
42 |
-
$options[ 'fetch_title' ] = $_POST[ 'youtube_embed_fetch_title' ];
|
43 |
$options[ 'alt_profile' ] = $_POST[ 'youtube_embed_alt_profile' ];
|
44 |
-
$options[ '
|
45 |
-
$options[ 'bracket' ] = $_POST[ 'youtube_embed_bracket' ];
|
46 |
-
$options[ 'alt' ] = $_POST[ 'youtube_embed_alt' ];
|
47 |
-
$options[ 'other_profile' ] = $_POST[ 'youtube_embed_other_profile' ];
|
48 |
-
$options[ 'comments' ] = $_POST[ 'youtube_embed_comments' ];
|
49 |
-
$options[ 'comments_profile' ] = $_POST[ 'youtube_embed_comments_profile' ];
|
50 |
-
$options[ 'metadata' ] = $_POST[ 'youtube_embed_metadata' ];
|
51 |
$options[ 'feed' ] = $_POST[ 'youtube_embed_feed' ];
|
52 |
-
$options[ 'error_message' ] = str_replace( '\"', '"', $_POST[ 'youtube_embed_error_message' ] );
|
53 |
$options[ 'thumbnail' ] = $_POST[ 'youtube_embed_thumbnail' ];
|
54 |
$options[ 'privacy' ] = $_POST[ 'youtube_embed_privacy' ];
|
55 |
-
$options[ 'frameborder' ] = $_POST[ 'youtube_embed_frameborder' ];
|
56 |
-
$options[ 'widgets' ] = $_POST[ 'youtube_embed_widgets' ];
|
57 |
$options[ 'menu_access' ] = $_POST[ 'youtube_embed_menu_access' ];
|
58 |
|
59 |
// Update the options
|
@@ -63,21 +48,11 @@ if ( ( !empty( $_POST ) ) && ( check_admin_referer( 'youtube-embed-general', 'yo
|
|
63 |
|
64 |
// Update the alternative shortcodes
|
65 |
|
66 |
-
$shortcode
|
67 |
-
$shortcode
|
68 |
-
|
69 |
-
$shortcode[ 2 ] = $_POST[ 'youtube_embed_shortcode2' ];
|
70 |
-
$shortcode[ 2 ] = trim( $shortcode[ 2 ], '[]' );
|
71 |
|
72 |
update_option( 'youtube_embed_shortcode', $shortcode );
|
73 |
|
74 |
-
// Update the editor button shortcode, including the cookie
|
75 |
-
|
76 |
-
update_option( 'youtube_embed_editor_sc', $_POST[ 'youtube_embed_editor_sc' ] );
|
77 |
-
|
78 |
-
$expiry = 2147483647; // January 2038 (maximum value to avoid the integer overflow of the 2038 bug)
|
79 |
-
setcookie( 'vye_mce_shortcode', $_POST[ 'youtube_embed_editor_sc' ], $expiry, vye_get_cookie_path() );
|
80 |
-
|
81 |
// If the option to clear the cache has been ticked run an SQL to clear them down
|
82 |
|
83 |
if ( !empty( $_POST[ 'youtube_embed_clear_cache' ] ) ) {
|
@@ -93,222 +68,184 @@ if ( ( !empty( $_POST ) ) && ( check_admin_referer( 'youtube-embed-general', 'yo
|
|
93 |
|
94 |
$options = vye_set_general_defaults();
|
95 |
$shortcode = vye_set_shortcode_option();
|
96 |
-
$url = vye_set_url_option();
|
97 |
-
$editor_sc = vye_set_editor_sc();
|
98 |
?>
|
99 |
|
100 |
-
<p><?php _e( 'These are the general settings for YouTube Embed. Please select <a href="admin.php?page=profile-options">Profiles</a> for default embedding settings.', 'youtube-embed' ); ?></p>
|
101 |
|
102 |
-
<form method="post" action="<?php echo get_bloginfo( 'wpurl' ).'/wp-admin/admin.php?page=general-options' ?>">
|
103 |
|
104 |
-
<h3 class="title"><?php _e( 'Embedding', 'youtube-embed' ); ?></h3>
|
105 |
|
106 |
-
|
107 |
-
<tr>
|
108 |
-
<th scope="row"><?php _e( 'Add Metadata', 'youtube-embed' ); ?></th>
|
109 |
-
<td><input type="checkbox" name="youtube_embed_metadata" value="1"<?php if ( $options[ 'metadata' ] == "1" ) { echo ' checked="checked"'; } ?>/> <span class="description"><?php _e( 'Allow rich metadata to be added to code.', 'youtube-embed' ); ?></span></td>
|
110 |
-
</tr>
|
111 |
|
112 |
<tr>
|
113 |
-
<th scope="row"><?php _e( '
|
114 |
-
<td><input type="checkbox" name="
|
|
|
115 |
</tr>
|
116 |
|
117 |
-
|
118 |
-
<th scope="row"> <?php _e( 'Profile to use', 'youtube-embed' ); ?></th>
|
119 |
-
<td><select name="youtube_embed_comments_profile">
|
120 |
-
<?php vye_generate_profile_list( $options[ 'comments_profile' ], $options[ 'profile_no' ] ) ?>
|
121 |
-
</select></td>
|
122 |
-
</tr>
|
123 |
|
124 |
<tr>
|
125 |
-
<th scope="row"><?php _e( 'Feed', 'youtube-embed' ); ?></th>
|
126 |
<td><select name="youtube_embed_feed">
|
127 |
<option value="t"<?php if ( $options[ 'feed' ] == "t" ) { echo " selected='selected'"; } ?>><?php _e ( 'Text link', 'youtube-embed' ); ?></option>
|
128 |
<option value="v"<?php if ( $options[ 'feed' ] == "v" ) { echo " selected='selected'"; } ?>><?php _e ( 'Thumbnail', 'youtube-embed' ); ?></option>
|
129 |
<option value="b"<?php if ( $options[ 'feed' ] == "b" ) { echo " selected='selected'"; } ?>><?php _e ( 'Thumbnail & Text Link', 'youtube-embed' ); ?></option>
|
130 |
-
</select
|
|
|
131 |
</tr>
|
132 |
|
|
|
|
|
133 |
<tr>
|
134 |
-
<th scope="row"> <?php _e( 'Thumbnail to use', 'youtube-embed' ); ?></th>
|
135 |
<td><select name="youtube_embed_thumbnail">
|
136 |
<option value="default"<?php if ( $options[ 'thumbnail' ] == "default" ) { echo " selected='selected'"; } ?>><?php _e ( 'Default', 'youtube-embed' ); ?></option>
|
137 |
<option value="hqdefault"<?php if ( $options[ 'thumbnail' ] == "hqdefault" ) { echo " selected='selected'"; } ?>><?php _e ( 'Default (HQ)', 'youtube-embed' ); ?></option>
|
138 |
<option value="1"<?php if ( $options[ 'thumbnail' ] == "1" ) { echo " selected='selected'"; } ?>><?php _e ( 'Start', 'youtube-embed' ); ?></option>
|
139 |
<option value="2"<?php if ( $options[ 'thumbnail' ] == "2" ) { echo " selected='selected'"; } ?>><?php _e ( 'Middle', 'youtube-embed' ); ?></option>
|
140 |
<option value="3"<?php if ( $options[ 'thumbnail' ] == "3" ) { echo " selected='selected'"; } ?>><?php _e ( 'End', 'youtube-embed' ); ?></option>
|
141 |
-
</select
|
|
|
142 |
</tr>
|
143 |
|
144 |
-
|
145 |
-
<th scope="row"><?php _e( 'Allow shortcodes in widgets', 'youtube-embed' ); ?></th>
|
146 |
-
<td><input type="checkbox" name="youtube_embed_widgets" value="1"<?php if ( $options[ 'widgets' ] == "1" ) { echo ' checked="checked"'; } ?>/> <span class="description"><?php _e( 'Allow shortcodes to be used in widgets - this will apply to <strong>all</strong> widgets', 'youtube-embed' ); ?></span></td>
|
147 |
-
</tr>
|
148 |
-
</table>
|
149 |
|
150 |
-
|
151 |
|
152 |
-
<table class="form-table">
|
153 |
<tr>
|
154 |
-
<th scope="row"><?php _e( '
|
155 |
-
<td><
|
|
|
|
|
156 |
</tr>
|
157 |
|
158 |
-
|
159 |
-
<th scope="row"> <?php _e( 'Profile to use', 'youtube-embed' ); ?></th>
|
160 |
-
<td><select name="youtube_embed_alt_profile">
|
161 |
-
<?php vye_generate_profile_list( $options[ 'alt_profile' ], $options[ 'profile_no' ] ) ?>
|
162 |
-
</select></td>
|
163 |
-
</tr>
|
164 |
|
165 |
<tr>
|
166 |
-
<th scope="row"><?php _e( 'Alternative Shortcode
|
167 |
-
<td><input type="text" size="30" name="
|
|
|
168 |
</tr>
|
169 |
|
|
|
|
|
170 |
<tr>
|
171 |
-
<th scope="row"> <?php _e( 'Profile to use', 'youtube-embed' ); ?></th>
|
172 |
-
<td><select name="
|
173 |
-
<?php vye_generate_profile_list( $options[ '
|
174 |
</select></td>
|
175 |
</tr>
|
176 |
-
</table>
|
177 |
|
178 |
-
|
179 |
-
|
180 |
-
<table class="form-table">
|
181 |
-
<tr>
|
182 |
-
<th scope="row"><?php _e( 'Bracket Embedding', 'youtube-embed' ); ?></th>
|
183 |
-
<td><input type="checkbox" name="youtube_embed_bracket" value="1"<?php if ( $options[ 'bracket' ] == "1" ) { echo ' checked="checked"'; } ?>/> <span class="description"><?php _e( 'Allow embedding using URLs within brackets. Activating impacts performance', 'youtube-embed' ); ?></span></td>
|
184 |
-
</tr>
|
185 |
|
186 |
-
|
187 |
-
<th scope="row"><?php _e( 'Alternative Embedding', 'youtube-embed' ); ?></th>
|
188 |
-
<td><input type="checkbox" name="youtube_embed_alt" value="1"<?php if ( $options[ 'alt' ] == "1" ) { echo ' checked="checked"'; } ?>/> <span class="description"><?php _e( 'Allow all other types of embedding. Activating impacts performance', 'youtube-embed' ); ?></span></td>
|
189 |
-
</tr>
|
190 |
|
191 |
<tr>
|
192 |
-
<th scope="row"
|
193 |
-
<td><
|
194 |
-
<?php
|
195 |
-
</select> <span class="description"><?php _e( 'For above 2 options', 'youtube-embed' ); ?></span></td>
|
196 |
</tr>
|
197 |
-
</table>
|
198 |
|
199 |
-
|
200 |
|
201 |
-
<table class="form-table">
|
202 |
<tr>
|
203 |
-
<th scope="row"><?php _e( 'Show Editor Button', 'youtube-embed' ); ?></th>
|
204 |
-
<td><input type="checkbox" name="
|
|
|
205 |
</tr>
|
206 |
|
207 |
-
|
208 |
-
<th scope="row"><?php _e( 'Editor Button Shortcode', 'youtube-embed' ); ?></th>
|
209 |
-
<td><input type="text" size="20" name="youtube_embed_editor_sc" value="<?php echo $editor_sc; ?>"/> <span class="description"><?php _e( 'Shortcode for editor button to use.', 'youtube-embed' ); ?></span></td>
|
210 |
-
</tr>
|
211 |
-
|
212 |
-
<tr>
|
213 |
-
<th scope="row"><?php _e( 'Add to Admin Bar', 'youtube-embed' ); ?></th>
|
214 |
-
<td><input type="checkbox" name="youtube_embed_admin_bar" value="1"<?php if ( $options[ 'admin_bar' ] == "1" ) { echo ' checked="checked"'; } ?>/> <span class="description"><?php _e( 'Add link to options screen to Admin Bar', 'youtube-embed' ); ?></span></td>
|
215 |
-
</tr>
|
216 |
|
217 |
<tr>
|
218 |
-
<th scope="row"><?php _e( 'Menu Screen Access', 'youtube-embed' ); ?></th>
|
219 |
<td><select name="youtube_embed_menu_access">
|
220 |
<option value="list_users"<?php if ( $options[ 'menu_access' ] == "list_users" ) { echo " selected='selected'"; } ?>><?php _e ( 'Administrator', 'youtube-embed' ); ?></option>
|
221 |
<option value="edit_pages"<?php if ( $options[ 'menu_access' ] == "edit_pages" ) { echo " selected='selected'"; } ?>><?php _e ( 'Editor', 'youtube-embed' ); ?></option>
|
222 |
<option value="publish_posts"<?php if ( $options[ 'menu_access' ] == "publish_posts" ) { echo " selected='selected'"; } ?>><?php _e ( 'Author', 'youtube-embed' ); ?></option>
|
223 |
<option value="edit_posts"<?php if ( $options[ 'menu_access' ] == "edit_posts" ) { echo " selected='selected'"; } ?>><?php _e ( 'Contributor', 'youtube-embed' ); ?></option>
|
224 |
-
</select
|
|
|
225 |
</tr>
|
226 |
-
</table>
|
227 |
|
228 |
-
|
229 |
|
230 |
-
|
231 |
-
<tr>
|
232 |
-
<th scope="row"><?php _e( 'Number of Profiles', 'youtube-embed' ); ?></th>
|
233 |
-
<td><input type="text" size="2" maxlength="2" name="youtube_embed_profile_no" value="<?php echo $options[ 'profile_no' ]; ?>"/> <span class="description"><?php _e( 'Maximum number of profiles', 'youtube-embed' ); ?></span></td>
|
234 |
-
</tr>
|
235 |
|
236 |
<tr>
|
237 |
-
<th scope="row"><?php _e( 'Number of
|
238 |
-
<td><input type="text" size="2" maxlength="2" name="
|
|
|
239 |
</tr>
|
240 |
-
</table>
|
241 |
|
242 |
-
|
243 |
|
244 |
-
<table class="form-table">
|
245 |
<tr>
|
246 |
-
<th scope="row"><?php _e( '
|
247 |
-
<td><input type="text" size="
|
|
|
248 |
</tr>
|
249 |
|
250 |
-
|
251 |
-
<th scope="row"><?php _e( 'Video Information Cache', 'youtube-embed' ); ?></th>
|
252 |
-
<td><input type="text" size="3" maxlength="3" name="youtube_embed_info_cache" value="<?php echo $options[ 'info_cache' ]; ?>"/> <span class="description"><?php _e( 'How many hours to retain video information, including it\'s validity. 0 to switch off', 'youtube-embed' ); ?></span></td>
|
253 |
-
</tr>
|
254 |
|
255 |
-
|
256 |
-
<th scope="row"><?php _e( 'Transcript Cache', 'youtube-embed' ); ?></th>
|
257 |
-
<td><input type="text" size="3" maxlength="3" name="youtube_embed_transcript_cache" value="<?php echo $options[ 'transcript_cache' ]; ?>"/> <span class="description"><?php _e( 'How many hours to store transcripts for in cache. 0 to switch off', 'youtube-embed' ); ?></span></td>
|
258 |
-
</tr>
|
259 |
-
|
260 |
-
<tr>
|
261 |
-
<th scope="row"><?php _e( 'Comments Cache', 'youtube-embed' ); ?></th>
|
262 |
-
<td><input type="text" size="3" maxlength="3" name="youtube_embed_comments_cache" value="<?php echo $options[ 'comments_cache' ]; ?>"/> <span class="description"><?php _e( 'How many minutes to store video comments for in cache. 0 to switch off', 'youtube-embed' ); ?></span></td>
|
263 |
-
</tr></table>
|
264 |
|
265 |
<?php
|
266 |
global $wpdb;
|
267 |
$video_cache = $wpdb -> get_var( "SELECT COUNT(*) FROM $wpdb->options WHERE option_name LIKE '_transient_timeout_%ye_video_%'" );
|
268 |
-
$type_cache = $wpdb -> get_var( "SELECT COUNT(*) FROM $wpdb->options WHERE option_name LIKE '_transient_timeout_%ye_type_%'" );
|
269 |
-
$title_cache = $wpdb -> get_var( "SELECT COUNT(*) FROM $wpdb->options WHERE option_name LIKE '_transient_timeout_%ye_title_%'" );
|
270 |
-
$comment_cache = $wpdb -> get_var( "SELECT COUNT(*) FROM $wpdb->options WHERE option_name LIKE '_transient_timeout_%vye_commentse_%'" );
|
271 |
|
272 |
-
echo '<p>' . __( 'You currently have cache for', 'youtube_embed' ) . ' ' . number_format( $video_cache ) . ' video' . ( $video_cache <> 1 ? 's' : '' ) .
|
273 |
?>
|
274 |
|
275 |
-
<table class="form-table"
|
276 |
-
|
277 |
-
|
278 |
-
</tr></table>
|
279 |
|
280 |
-
<
|
|
|
|
|
|
|
|
|
281 |
|
282 |
-
|
283 |
|
284 |
-
<
|
285 |
-
<th scope="row"><?php _e( '
|
286 |
-
<td><
|
287 |
-
|
|
|
288 |
|
289 |
-
|
290 |
|
291 |
-
|
292 |
|
293 |
<tr>
|
294 |
-
<th scope="row"><?php _e( 'Privacy-Enhanced Mode', 'youtube-embed' ); ?></th>
|
295 |
<td><select name="youtube_embed_privacy">
|
296 |
<option value="0"<?php if ( $options[ 'privacy' ] == "0" ) { echo " selected='selected'"; } ?>><?php _e ( 'Cookies should always be stored', 'youtube-embed' ); ?></option>
|
297 |
<option value="1"<?php if ( $options[ 'privacy' ] == "1" ) { echo " selected='selected'"; } ?>><?php _e ( 'Cookies should never be stored', 'youtube-embed' ); ?></option>
|
298 |
<option value="2"<?php if ( $options[ 'privacy' ] == "2" ) { echo " selected='selected'"; } ?>><?php _e ( "Cookies should be stored based on user's Do Not Track setting", 'youtube-embed' ); ?></option>
|
299 |
-
</select
|
300 |
-
</
|
|
|
|
|
|
|
301 |
|
302 |
-
|
303 |
|
304 |
-
<
|
305 |
-
<th scope="row"><?php _e( '
|
306 |
-
<td><input type="checkbox" name="youtube_embed_frameborder" value="1"<?php if ( $options[ 'frameborder' ] == '1' ) { echo ' checked="checked"'; }
|
307 |
-
|
|
|
|
|
|
|
|
|
308 |
|
309 |
<?php wp_nonce_field( 'youtube-embed-general','youtube_embed_general_nonce', true, true ); ?>
|
310 |
|
311 |
-
<p class="submit"><input type="submit" name="Submit" class="button-primary" value="<?php _e( 'Save
|
312 |
|
313 |
</form>
|
314 |
|
8 |
* @since 2.0
|
9 |
*/
|
10 |
?>
|
11 |
+
<div class="wrap">
|
12 |
<?php
|
13 |
global $wp_version;
|
14 |
if ( ( float ) $wp_version >= 4.3 ) { $heading = '1'; } else { $heading = '2'; }
|
21 |
|
22 |
if ( ( !empty( $_POST ) ) && ( check_admin_referer( 'youtube-embed-general', 'youtube_embed_general_nonce' ) ) ) {
|
23 |
|
24 |
+
if ( isset( $_POST[ 'youtube_embed_editor_button' ] ) ) { $options[ 'editor_button' ] = $_POST[ 'youtube_embed_editor_button' ]; } else { $options[ 'editor_button' ] = ''; }
|
25 |
+
if ( isset( $_POST[ 'youtube_embed_admin_bar' ] ) ) { $options[ 'admin_bar' ] = $_POST[ 'youtube_embed_admin_bar' ]; } else { $options[ 'admin_bar' ] = ''; }
|
26 |
$options[ 'profile_no' ] = $_POST[ 'youtube_embed_profile_no' ];
|
|
|
|
|
|
|
|
|
|
|
27 |
$options[ 'list_no' ] = $_POST[ 'youtube_embed_list_no' ];
|
28 |
|
29 |
+
// If the number of profiles or lists is less than zero, put it to 0
|
30 |
|
31 |
+
if ( $options[ 'profile_no' ] < 0 ) { $options[ 'profile_no' ] = 0; }
|
32 |
+
if ( $options[ 'list_no' ] < 0 ) { $options[ 'list_no' ] = 0; }
|
33 |
|
34 |
$options[ 'embed_cache' ] = $_POST[ 'youtube_embed_embed_cache' ];
|
|
|
|
|
|
|
|
|
35 |
$options[ 'alt_profile' ] = $_POST[ 'youtube_embed_alt_profile' ];
|
36 |
+
if ( isset( $_POST[ 'youtube_embed_metadata' ] ) ) { $options[ 'metadata' ] = $_POST[ 'youtube_embed_metadata' ]; } else { $options[ 'metadata' ] = ''; }
|
|
|
|
|
|
|
|
|
|
|
|
|
37 |
$options[ 'feed' ] = $_POST[ 'youtube_embed_feed' ];
|
|
|
38 |
$options[ 'thumbnail' ] = $_POST[ 'youtube_embed_thumbnail' ];
|
39 |
$options[ 'privacy' ] = $_POST[ 'youtube_embed_privacy' ];
|
40 |
+
if ( isset( $_POST[ 'youtube_embed_frameborder' ] ) ) { $options[ 'frameborder' ] = $_POST[ 'youtube_embed_frameborder' ]; } else { $options[ 'frameborder' ] = ''; }
|
41 |
+
if ( isset( $_POST[ 'widgets' ] ) ) { $options[ 'widgets' ] = $_POST[ 'youtube_embed_widgets' ]; } else { $options[ 'widgets' ] = ''; }
|
42 |
$options[ 'menu_access' ] = $_POST[ 'youtube_embed_menu_access' ];
|
43 |
|
44 |
// Update the options
|
48 |
|
49 |
// Update the alternative shortcodes
|
50 |
|
51 |
+
$shortcode = $_POST[ 'youtube_embed_shortcode' ];
|
52 |
+
$shortcode = trim( $shortcode, '[]' );
|
|
|
|
|
|
|
53 |
|
54 |
update_option( 'youtube_embed_shortcode', $shortcode );
|
55 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
56 |
// If the option to clear the cache has been ticked run an SQL to clear them down
|
57 |
|
58 |
if ( !empty( $_POST[ 'youtube_embed_clear_cache' ] ) ) {
|
68 |
|
69 |
$options = vye_set_general_defaults();
|
70 |
$shortcode = vye_set_shortcode_option();
|
|
|
|
|
71 |
?>
|
72 |
|
73 |
+
<p><?php _e( 'These are the general settings for YouTube Embed. Please select <a href="admin.php?page=ye-profile-options">Profiles</a> for default embedding settings.', 'youtube-embed' ); ?></p>
|
74 |
|
75 |
+
<form method="post" action="<?php echo get_bloginfo( 'wpurl' ).'/wp-admin/admin.php?page=ye-general-options' ?>">
|
76 |
|
77 |
+
<h3 class="title"><?php _e( 'Embedding', 'youtube-embed' ); ?></h3><table class="form-table">
|
78 |
|
79 |
+
<!-- Add Metadata -->
|
|
|
|
|
|
|
|
|
80 |
|
81 |
<tr>
|
82 |
+
<th scope="row"><label for="youtube_embed_metadata"><?php _e( 'Add Metadata', 'youtube-embed' ); ?></label></th>
|
83 |
+
<td><label for="youtube_embed_metadata"><input type="checkbox" name="youtube_embed_metadata" value="1"<?php if ( $options[ 'metadata' ] == "1" ) { echo ' checked="checked"'; } ?>/>
|
84 |
+
<?php _e( 'Allow rich metadata to be added to code', 'youtube-embed' ); ?></label></td>
|
85 |
</tr>
|
86 |
|
87 |
+
<!-- Feed -->
|
|
|
|
|
|
|
|
|
|
|
88 |
|
89 |
<tr>
|
90 |
+
<th scope="row"><label for="youtube_embed_feed"><?php _e( 'Feed', 'youtube-embed' ); ?></label></th>
|
91 |
<td><select name="youtube_embed_feed">
|
92 |
<option value="t"<?php if ( $options[ 'feed' ] == "t" ) { echo " selected='selected'"; } ?>><?php _e ( 'Text link', 'youtube-embed' ); ?></option>
|
93 |
<option value="v"<?php if ( $options[ 'feed' ] == "v" ) { echo " selected='selected'"; } ?>><?php _e ( 'Thumbnail', 'youtube-embed' ); ?></option>
|
94 |
<option value="b"<?php if ( $options[ 'feed' ] == "b" ) { echo " selected='selected'"; } ?>><?php _e ( 'Thumbnail & Text Link', 'youtube-embed' ); ?></option>
|
95 |
+
</select>
|
96 |
+
<p class="description"><?php _e( 'Videos cannot be embedded in feeds. Select how you wish them to be shown instead.', 'youtube-embed' ); ?></p></td>
|
97 |
</tr>
|
98 |
|
99 |
+
<!-- Feed Thumbnail -->
|
100 |
+
|
101 |
<tr>
|
102 |
+
<th scope="row"><label for="youtube_embed_thumbnail"> <?php _e( 'Thumbnail to use', 'youtube-embed' ); ?></label></th>
|
103 |
<td><select name="youtube_embed_thumbnail">
|
104 |
<option value="default"<?php if ( $options[ 'thumbnail' ] == "default" ) { echo " selected='selected'"; } ?>><?php _e ( 'Default', 'youtube-embed' ); ?></option>
|
105 |
<option value="hqdefault"<?php if ( $options[ 'thumbnail' ] == "hqdefault" ) { echo " selected='selected'"; } ?>><?php _e ( 'Default (HQ)', 'youtube-embed' ); ?></option>
|
106 |
<option value="1"<?php if ( $options[ 'thumbnail' ] == "1" ) { echo " selected='selected'"; } ?>><?php _e ( 'Start', 'youtube-embed' ); ?></option>
|
107 |
<option value="2"<?php if ( $options[ 'thumbnail' ] == "2" ) { echo " selected='selected'"; } ?>><?php _e ( 'Middle', 'youtube-embed' ); ?></option>
|
108 |
<option value="3"<?php if ( $options[ 'thumbnail' ] == "3" ) { echo " selected='selected'"; } ?>><?php _e ( 'End', 'youtube-embed' ); ?></option>
|
109 |
+
</select>
|
110 |
+
<p class="description"><?php _e( 'Choose which thumbnail to use.', 'youtube-embed' ); ?></p></td>
|
111 |
</tr>
|
112 |
|
113 |
+
</table><hr><h3 class="title"><?php _e( 'Shortcodes', 'youtube-embed' ); ?></h3><table class="form-table">
|
|
|
|
|
|
|
|
|
114 |
|
115 |
+
<!-- Shortcodes in Widgets -->
|
116 |
|
|
|
117 |
<tr>
|
118 |
+
<th scope="row"><label for="youtube_embed_widgets"><?php _e( 'Allow shortcodes in widgets', 'youtube-embed' ); ?></label></th>
|
119 |
+
<td><label for="youtube_embed_widgets"><input type="checkbox" name="youtube_embed_widgets" value="1"<?php if ( $options[ 'widgets' ] == "1" ) { echo ' checked="checked"'; } ?>/>
|
120 |
+
<?php _e( 'Allow shortcodes to be used in widgets', 'youtube-embed' ); ?></label>
|
121 |
+
<p class="description"><?php _e( 'This will apply to <strong>all</strong> widgets.', 'youtube-embed' ); ?></p></td>
|
122 |
</tr>
|
123 |
|
124 |
+
<!-- Alternative Shortcode -->
|
|
|
|
|
|
|
|
|
|
|
125 |
|
126 |
<tr>
|
127 |
+
<th scope="row"><label for="youtube_embed_shortcode"><?php _e( 'Alternative Shortcode', 'youtube-embed' ); ?></label></th>
|
128 |
+
<td><input type="text" size="30" name="youtube_embed_shortcode" value="<?php echo $shortcode; ?>"/>
|
129 |
+
<p class="description"><?php _e( 'An alternative shortcode to use.', 'youtube-embed' ); ?></p></td>
|
130 |
</tr>
|
131 |
|
132 |
+
<!-- Alternative Shortcode Profile -->
|
133 |
+
|
134 |
<tr>
|
135 |
+
<th scope="row"><label for="youtube_embed_alt_profile"> <?php _e( 'Profile to use', 'youtube-embed' ); ?></label></th>
|
136 |
+
<td><select name="youtube_embed_alt_profile">
|
137 |
+
<?php vye_generate_profile_list( $options[ 'alt_profile' ], $options[ 'profile_no' ] ) ?>
|
138 |
</select></td>
|
139 |
</tr>
|
|
|
140 |
|
141 |
+
</table><hr><h3 class="title"><?php _e( 'Administration Options', 'youtube-embed' ); ?></h3><table class="form-table">
|
|
|
|
|
|
|
|
|
|
|
|
|
142 |
|
143 |
+
<!-- Editor Button -->
|
|
|
|
|
|
|
144 |
|
145 |
<tr>
|
146 |
+
<th scope="row"><label for="youtube_embed_editor_button"><?php _e( 'Show Editor Button', 'youtube-embed' ); ?></label></th>
|
147 |
+
<td><label for="youtube_embed_editor_button"><input type="checkbox" name="youtube_embed_editor_button" value="1"<?php if ( $options[ 'editor_button' ] == "1" ) { echo ' checked="checked"'; } ?>/>
|
148 |
+
<?php _e( 'Show the YouTube button on the post editor', 'youtube-embed' ); ?></label></td>
|
|
|
149 |
</tr>
|
|
|
150 |
|
151 |
+
<!-- Admin Bar -->
|
152 |
|
|
|
153 |
<tr>
|
154 |
+
<th scope="row"><label for="youtube_embed_admin_bar"><?php _e( 'Show Editor Button', 'youtube-embed' ); ?></label></th>
|
155 |
+
<td><label for="youtube_embed_admin_bar"><input type="checkbox" name="youtube_embed_admin_bar" value="1"<?php if ( $options[ 'admin_bar' ] == "1" ) { echo ' checked="checked"'; } ?>/>
|
156 |
+
<?php _e( 'Add link to options screen to Admin Bar', 'youtube-embed' ); ?></label></td>
|
157 |
</tr>
|
158 |
|
159 |
+
<!-- Menu Screen Access -->
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
160 |
|
161 |
<tr>
|
162 |
+
<th scope="row"><label for="youtube_embed_menu_access"><?php _e( 'Menu Screen Access', 'youtube-embed' ); ?></label></th>
|
163 |
<td><select name="youtube_embed_menu_access">
|
164 |
<option value="list_users"<?php if ( $options[ 'menu_access' ] == "list_users" ) { echo " selected='selected'"; } ?>><?php _e ( 'Administrator', 'youtube-embed' ); ?></option>
|
165 |
<option value="edit_pages"<?php if ( $options[ 'menu_access' ] == "edit_pages" ) { echo " selected='selected'"; } ?>><?php _e ( 'Editor', 'youtube-embed' ); ?></option>
|
166 |
<option value="publish_posts"<?php if ( $options[ 'menu_access' ] == "publish_posts" ) { echo " selected='selected'"; } ?>><?php _e ( 'Author', 'youtube-embed' ); ?></option>
|
167 |
<option value="edit_posts"<?php if ( $options[ 'menu_access' ] == "edit_posts" ) { echo " selected='selected'"; } ?>><?php _e ( 'Contributor', 'youtube-embed' ); ?></option>
|
168 |
+
</select>
|
169 |
+
<p class="description"><?php _e( 'Specify the user access required for the menu screens.', 'youtube-embed' ); ?></p></td>
|
170 |
</tr>
|
|
|
171 |
|
172 |
+
</table><hr><h3 class="title"><?php _e( 'Profile & List Sizes', 'youtube-embed' ); ?></h3><table class="form-table">
|
173 |
|
174 |
+
<!-- Number of Profiles -->
|
|
|
|
|
|
|
|
|
175 |
|
176 |
<tr>
|
177 |
+
<th scope="row"><label for="youtube_embed_profile_no"><?php _e( 'Number of Profiles', 'youtube-embed' ); ?></label></th>
|
178 |
+
<td><input type="text" size="2" maxlength="2" name="youtube_embed_profile_no" value="<?php echo $options[ 'profile_no' ]; ?>"/>
|
179 |
+
<p class="description"><?php _e( 'Maximum number of profiles.', 'youtube-embed' ); ?></p></td>
|
180 |
</tr>
|
|
|
181 |
|
182 |
+
<!-- Number of Lists -->
|
183 |
|
|
|
184 |
<tr>
|
185 |
+
<th scope="row"><label for="youtube_embed_list_no"><?php _e( 'Number of Lists', 'youtube-embed' ); ?></label></th>
|
186 |
+
<td><input type="text" size="2" maxlength="2" name="youtube_embed_list_no" value="<?php echo $options[ 'list_no' ]; ?>"/>
|
187 |
+
<p class="description"><?php _e( 'Maximum number of lists.', 'youtube-embed' ); ?></p></td>
|
188 |
</tr>
|
189 |
|
190 |
+
</table><hr><h3 class="title"><?php _e( 'Performance', 'youtube-embed' ); ?></h3>
|
|
|
|
|
|
|
191 |
|
192 |
+
<!-- Show Cache Stats -->
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
193 |
|
194 |
<?php
|
195 |
global $wpdb;
|
196 |
$video_cache = $wpdb -> get_var( "SELECT COUNT(*) FROM $wpdb->options WHERE option_name LIKE '_transient_timeout_%ye_video_%'" );
|
|
|
|
|
|
|
197 |
|
198 |
+
echo '<p>' . __( 'You currently have cache for', 'youtube_embed' ) . ' ' . number_format( $video_cache ) . ' video' . ( $video_cache <> 1 ? 's' : '' ) . ".</p>\n";
|
199 |
?>
|
200 |
|
201 |
+
<table class="form-table">
|
202 |
+
|
203 |
+
<!-- Embed Cache -->
|
|
|
204 |
|
205 |
+
<tr>
|
206 |
+
<th scope="row"><label for="youtube_embed_embed_cache"><?php _e( 'Embed Cache', 'youtube-embed' ); ?></label></th>
|
207 |
+
<td><input type="text" size="3" maxlength="3" name="youtube_embed_embed_cache" value="<?php echo $options[ 'embed_cache' ]; ?>"/>
|
208 |
+
<p class="description"><?php _e( 'How many hours to retain embed output. 0 to switch off.', 'youtube-embed' ); ?></p></td>
|
209 |
+
</tr>
|
210 |
|
211 |
+
<!-- Clear Cache -->
|
212 |
|
213 |
+
<tr>
|
214 |
+
<th scope="row"><label for="youtube_embed_clear_cache"><?php _e( 'Clear Cache', 'youtube-embed' ); ?></label></th>
|
215 |
+
<td><label for="youtube_embed_clear_cache"><input type="checkbox" name="youtube_embed_clear_cache" value="1">
|
216 |
+
<?php _e( 'Select this option to remove all YouTube Embed cache', 'youtube-embed' ); ?></label></td>
|
217 |
+
</tr>
|
218 |
|
219 |
+
</table><hr><h3 class="title"><?php _e( 'Security', 'youtube-embed' ); ?></h3><table class="form-table">
|
220 |
|
221 |
+
<!-- Privacy-Enhanced Mode -->
|
222 |
|
223 |
<tr>
|
224 |
+
<th scope="row"><label for="youtube_embed_menu_access"><?php _e( 'Privacy-Enhanced Mode', 'youtube-embed' ); ?></label></th>
|
225 |
<td><select name="youtube_embed_privacy">
|
226 |
<option value="0"<?php if ( $options[ 'privacy' ] == "0" ) { echo " selected='selected'"; } ?>><?php _e ( 'Cookies should always be stored', 'youtube-embed' ); ?></option>
|
227 |
<option value="1"<?php if ( $options[ 'privacy' ] == "1" ) { echo " selected='selected'"; } ?>><?php _e ( 'Cookies should never be stored', 'youtube-embed' ); ?></option>
|
228 |
<option value="2"<?php if ( $options[ 'privacy' ] == "2" ) { echo " selected='selected'"; } ?>><?php _e ( "Cookies should be stored based on user's Do Not Track setting", 'youtube-embed' ); ?></option>
|
229 |
+
</select>
|
230 |
+
<p class="description"><?php _e( 'Read more about <a href="http://donottrack.us/">Do Not Track</a>.', 'youtube-embed' ); ?></p></td>
|
231 |
+
</tr>
|
232 |
+
|
233 |
+
</table><hr><h3 class="title"><?php _e( 'Compatibility', 'youtube-embed' ); ?></h3><table class="form-table">
|
234 |
|
235 |
+
<!-- Frame Border -->
|
236 |
|
237 |
+
<tr>
|
238 |
+
<th scope="row"><label for="youtube_embed_frameborder"><?php _e( 'Frame Border', 'youtube-embed' ); ?></label></th>
|
239 |
+
<td><label for="youtube_embed_frameborder"><input type="checkbox" name="youtube_embed_frameborder" value="1"<?php if ( $options[ 'frameborder' ] == '1' ) { echo ' checked="checked"'; } ?>/>
|
240 |
+
<?php _e( 'Allow Frame Border on IFRAME', 'youtube-embed' ); ?></label>
|
241 |
+
<p class="description"><?php _e( 'FRAMEBORDER is not HTML5 compliant.', 'youtube-embed' ); ?></p></td>
|
242 |
+
</tr>
|
243 |
+
|
244 |
+
</table>
|
245 |
|
246 |
<?php wp_nonce_field( 'youtube-embed-general','youtube_embed_general_nonce', true, true ); ?>
|
247 |
|
248 |
+
<p class="submit"><input type="submit" name="Submit" class="button-primary" value="<?php _e( 'Save Changes', 'youtube-embed' ); ?>"/></p>
|
249 |
|
250 |
</form>
|
251 |
|
includes/options-lists.php
CHANGED
@@ -41,8 +41,8 @@ if ( ( !empty( $_POST[ 'Submit' ] ) ) && ( check_admin_referer( 'youtube-embed-g
|
|
41 |
$id = trim( vye_extract_id( $id_array[ $loop ] ) );
|
42 |
// Now check its validity
|
43 |
if ( $id != '' ) {
|
44 |
-
$
|
45 |
-
if ( $
|
46 |
$new_id_list .= $id . "\n";
|
47 |
}
|
48 |
$loop ++;
|
@@ -75,7 +75,7 @@ if ( $class != "error" ) { $options = vye_set_list_defaults( $list_no ); }
|
|
75 |
$general = vye_set_general_defaults();
|
76 |
?>
|
77 |
|
78 |
-
<form method="post" action="<?php echo get_bloginfo( 'wpurl' ) . '/wp-admin/admin.php?page=list-options'; ?>">
|
79 |
|
80 |
<span class="alignright">
|
81 |
<select name="youtube_embed_list_no">
|
@@ -103,21 +103,26 @@ while ( $loop <= $general[ 'list_no' ] ) {
|
|
103 |
|
104 |
<table class="form-table">
|
105 |
|
|
|
|
|
106 |
<tr>
|
107 |
-
<th scope="row"><?php _e( 'List
|
108 |
-
<input type="text" size="20" name="youtube_embed_name" value="<?php echo $options[ 'name' ]; ?>"/>
|
109 |
-
<?php
|
110 |
-
</
|
|
|
|
|
111 |
|
112 |
<tr>
|
113 |
-
<th scope="row"><?php _e( 'Video IDs (one per line)', 'youtube-embed' ); ?></th
|
114 |
-
<textarea name="youtube_embed_video_list"
|
115 |
-
</
|
|
|
116 |
</table>
|
117 |
|
118 |
<?php wp_nonce_field( 'youtube-embed-general','youtube_embed_general_nonce', true, true ); ?>
|
119 |
|
120 |
-
<p class="submit"><input type="submit" name="Submit" class="button-primary" value="<?php _e( 'Save
|
121 |
|
122 |
</form>
|
123 |
|
@@ -140,8 +145,7 @@ if ( $options[ 'list' ] != '' ) {
|
|
140 |
|
141 |
// Validate the video type
|
142 |
|
143 |
-
$
|
144 |
-
$type = $video_info[ 'type' ];
|
145 |
|
146 |
if ( $type == 'p' ) {
|
147 |
$text = __( 'This is a playlist', 'youtube-embed' );
|
@@ -164,7 +168,6 @@ if ( $options[ 'list' ] != '' ) {
|
|
164 |
// Output the video information
|
165 |
|
166 |
echo "\t<tr>\n\t\t<td>" . $id . "</td>\n";
|
167 |
-
echo "\t\t<td>" . $video_info[ 'title' ] . "</td>\n";
|
168 |
echo "\t\t<td style=\"";
|
169 |
|
170 |
if ( $status != 0 ) {
|
41 |
$id = trim( vye_extract_id( $id_array[ $loop ] ) );
|
42 |
// Now check its validity
|
43 |
if ( $id != '' ) {
|
44 |
+
$type = vye_validate_id( $id );
|
45 |
+
if ( $type != 'v' ) { $valid = false; }
|
46 |
$new_id_list .= $id . "\n";
|
47 |
}
|
48 |
$loop ++;
|
75 |
$general = vye_set_general_defaults();
|
76 |
?>
|
77 |
|
78 |
+
<form method="post" action="<?php echo get_bloginfo( 'wpurl' ) . '/wp-admin/admin.php?page=ye-list-options'; ?>">
|
79 |
|
80 |
<span class="alignright">
|
81 |
<select name="youtube_embed_list_no">
|
103 |
|
104 |
<table class="form-table">
|
105 |
|
106 |
+
<!-- List Name -->
|
107 |
+
|
108 |
<tr>
|
109 |
+
<th scope="row"><label for="youtube_embed_name"><?php _e( 'List Name', 'youtube-embed' ); ?></label></th>
|
110 |
+
<td><label for="youtube_embed_name"><input type="text" size="20" name="youtube_embed_name" value="<?php echo $options[ 'name' ]; ?>"/>
|
111 |
+
<?php _e( 'The name you wish to give this list', 'youtube-embed' ); ?></label></td>
|
112 |
+
</tr>
|
113 |
+
|
114 |
+
<!-- Video IDs -->
|
115 |
|
116 |
<tr>
|
117 |
+
<th scope="row"><label for="youtube_embed_video_list"><?php _e( 'Video IDs (one per line)', 'youtube-embed' ); ?></label></th>
|
118 |
+
<td><textarea name="youtube_embed_video_list" rows="10" cols="12" class="large-text code"><?php echo $options[ 'list' ]; ?></textarea></td>
|
119 |
+
</tr>
|
120 |
+
|
121 |
</table>
|
122 |
|
123 |
<?php wp_nonce_field( 'youtube-embed-general','youtube_embed_general_nonce', true, true ); ?>
|
124 |
|
125 |
+
<p class="submit"><input type="submit" name="Submit" class="button-primary" value="<?php _e( 'Save Changes', 'youtube-embed' ); ?>"/></p>
|
126 |
|
127 |
</form>
|
128 |
|
145 |
|
146 |
// Validate the video type
|
147 |
|
148 |
+
$type = vye_validate_id( $id );
|
|
|
149 |
|
150 |
if ( $type == 'p' ) {
|
151 |
$text = __( 'This is a playlist', 'youtube-embed' );
|
168 |
// Output the video information
|
169 |
|
170 |
echo "\t<tr>\n\t\t<td>" . $id . "</td>\n";
|
|
|
171 |
echo "\t\t<td style=\"";
|
172 |
|
173 |
if ( $status != 0 ) {
|
includes/options-profiles.php
CHANGED
@@ -9,11 +9,10 @@
|
|
9 |
*/
|
10 |
?>
|
11 |
|
12 |
-
<?php $demo_video = '
|
13 |
|
14 |
<div class="wrap">
|
15 |
|
16 |
-
<div style="width: 1010px;">
|
17 |
<?php
|
18 |
global $wp_version;
|
19 |
if ( ( float ) $wp_version >= 4.3 ) { $heading = '1'; } else { $heading = '2'; }
|
@@ -32,8 +31,6 @@ if ( $profile_no == '' ) { $profile_no = 0; }
|
|
32 |
if ( ( !empty( $_POST[ 'Submit' ] ) ) && ( check_admin_referer( 'youtube-embed-profile' , 'youtube_embed_profile_nonce' ) ) ) {
|
33 |
|
34 |
$options[ 'name' ] = htmlentities( $_POST[ 'youtube_embed_name' ] );
|
35 |
-
$options[ 'type' ] = $_POST[ 'youtube_embed_type' ];
|
36 |
-
$options[ 'playlist' ] = $_POST[ 'youtube_embed_playlist' ];
|
37 |
$options[ 'width' ] = $_POST[ 'youtube_embed_width' ];
|
38 |
$options[ 'height' ] = $_POST[ 'youtube_embed_height' ];
|
39 |
|
@@ -41,34 +38,26 @@ if ( ( !empty( $_POST[ 'Submit' ] ) ) && ( check_admin_referer( 'youtube-embed-p
|
|
41 |
if ( strpos( $options[ 'template' ], '%video%' ) === false ) { $options[ 'template' ] = '%video%'; }
|
42 |
|
43 |
$options[ 'style' ] = $_POST[ 'youtube_embed_style' ];
|
44 |
-
$options[ 'fullscreen' ] = $_POST[ 'youtube_embed_fullscreen' ];
|
45 |
-
$options[ 'autoplay'] = $_POST[ 'youtube_embed_autoplay' ];
|
46 |
-
$options[ 'loop'] = $_POST[ 'youtube_embed_loop' ];
|
47 |
-
$options[ 'cc'] = $_POST[ 'youtube_embed_cc' ];
|
48 |
-
$options[ 'annotation'] = $_POST[ 'youtube_embed_annotation' ];
|
49 |
-
$options[ 'related'] = $_POST[ 'youtube_embed_related' ];
|
50 |
-
$options[ 'info'] = $_POST[ 'youtube_embed_info' ];
|
51 |
-
$options[ '
|
52 |
-
$options[ 'react'] = $_POST[ 'youtube_embed_react' ];
|
53 |
-
$options[ 'sweetspot'] = $_POST[ 'youtube_embed_sweetspot' ];
|
54 |
-
$options[ 'disablekb'] = $_POST[ 'youtube_embed_disablekb' ];
|
55 |
$options[ 'autohide'] = $_POST[ 'youtube_embed_autohide' ];
|
56 |
$options[ 'controls'] = $_POST[ 'youtube_embed_controls' ];
|
57 |
-
$options[ 'fallback'] = $_POST[ 'youtube_embed_fallback' ];
|
58 |
$options[ 'wmode'] = $_POST[ 'youtube_embed_wmode' ];
|
59 |
-
$options[ 'audio'] = $_POST[ 'youtube_embed_audio' ];
|
60 |
-
$options[ 'hd'] = $_POST[ 'youtube_embed_hd' ];
|
61 |
$options[ 'color' ] = $_POST[ 'youtube_embed_color' ];
|
62 |
$options[ 'theme' ] = $_POST[ 'youtube_embed_theme' ];
|
63 |
-
$options[ 'https' ] = $_POST[ 'youtube_embed_https' ];
|
64 |
-
$options[ '
|
65 |
-
$options[ '
|
66 |
-
$options[ '
|
67 |
-
$options[ '
|
68 |
-
$options[ 'download' ] = $_POST[ 'youtube_embed_download' ];
|
69 |
$options[ 'download_style' ] = $_POST[ 'youtube_embed_download_style' ];
|
70 |
$options[ 'download_text' ] = str_replace( '\"', '"', str_replace( "\'", "'", $_POST[ 'youtube_embed_download_text' ] ) );
|
71 |
-
$options[ 'vq' ] = $_POST[ 'youtube_embed_vq' ];
|
72 |
|
73 |
$default_size = $_POST[ 'youtube_embed_size' ];
|
74 |
|
@@ -110,7 +99,7 @@ $options = vye_set_profile_defaults( $profile_no );
|
|
110 |
$general = vye_set_general_defaults();
|
111 |
?>
|
112 |
|
113 |
-
<form method="post" action="<?php echo get_bloginfo( 'wpurl' ) . '/wp-admin/admin.php?page=profile-options' ?>">
|
114 |
|
115 |
<span class="alignright">
|
116 |
<select name="youtube_embed_profile_no">
|
@@ -130,94 +119,64 @@ echo ' ' . __( 'Use the drop-down on the right hand side to swap between profile
|
|
130 |
|
131 |
<table class="form-table">
|
132 |
|
|
|
|
|
133 |
<tr>
|
134 |
-
<th scope="row"><?php _e( 'Profile
|
135 |
-
<input type="text" size="20" name="youtube_embed_name" value="<?php echo $options[ 'name' ]; ?>"<?php if ( $profile_no == 0 ) { echo ' readonly="readonly"'; } ?>/>
|
136 |
-
<?php if ( $profile_no != 0 ) {
|
137 |
-
</td></tr>
|
138 |
-
|
139 |
-
<tr valign="top">
|
140 |
-
<th scope="row"><?php _e( 'Video Embed Type', 'youtube-embed' ); ?></th>
|
141 |
-
<td><span class="description"><?php _e( 'The type of player to use for videos.', 'youtube-embed' ); ?></span><br/>
|
142 |
-
<input type="radio" name="youtube_embed_type" value="v"<?php if ( $options[ 'type' ] == "v" ) { echo ' checked="checked"'; } ?>/><?php echo ' ' . __( 'IFRAME', 'youtube-embed' ); ?><span class="description"><?php echo ' ' . __( 'Uses AS3 Flash player, if Flash is available. Alternatively, uses HTML5 player. This is the current YouTube default.', 'youtube-embed' ); ?></span><br/>
|
143 |
-
<input type="radio" name="youtube_embed_type" value="p"<?php if ( $options[ 'type' ] == "p" ) { echo ' checked="checked"'; } ?>/><?php echo ' ' . __( 'OBJECT', 'youtube-embed' ); ?><span class="description"><?php echo ' ' . __( 'Use the AS3 Flash player.', 'youtube-embed' ); ?></span><br/>
|
144 |
-
<input type="radio" name="youtube_embed_type" value="c"<?php if ( $options[ 'type' ] == "c" ) { echo ' checked="checked"'; } ?>/><?php echo ' ' . __( 'Chromeless', 'youtube-embed' ); ?><span class="description"><?php echo ' ' . __( 'Use the <a href="http://www.artiss.co.uk/youtube-embed-help#ye-chromeless">Chromeless</a> version of the AS3 Flash Player.', 'youtube-embed' ); ?></span><br/>
|
145 |
-
<input type="radio" name="youtube_embed_type" value="m"<?php if ( $options[ 'type' ] == "m" ) { echo ' checked="checked"'; } ?>/><?php echo ' ' . __( 'EmbedPlus', 'youtube-embed' ); ?><span class="description"><?php echo ' ' . __( 'Use <a href="http://www.artiss.co.uk/youtube-embed-help#ye-embedplus">EmbedPlus</a>, if Flash is available.', 'youtube-embed' ); ?></span>
|
146 |
-
</td>
|
147 |
</tr>
|
148 |
|
149 |
-
|
150 |
-
<th scope="row"><?php _e( 'Playlist Embed Type', 'youtube-embed' ); ?></th>
|
151 |
-
<td><span class="description"><?php _e( 'The type of player to use when showing playlists.', 'youtube-embed' ); ?></span><br/>
|
152 |
-
<input type="radio" name="youtube_embed_playlist" value="v"<?php if ( $options[ 'playlist' ] == "v" ) { echo ' checked="checked"'; } ?>/><?php echo ' ' . __( 'IFRAME', 'youtube-embed' ); ?><br/>
|
153 |
-
<input type="radio" name="youtube_embed_playlist" value="o"<?php if ( $options[ 'playlist' ] == "o" ) { echo ' checked="checked"'; } ?>/><?php echo ' ' . __( 'OBJECT', 'youtube-embed' ); ?><br/>
|
154 |
-
</td>
|
155 |
-
</tr>
|
156 |
-
</table>
|
157 |
|
158 |
-
<table class="form-table">
|
159 |
<tr>
|
160 |
-
<th scope="row"><?php _e( 'Template', 'youtube-embed' ); ?></th>
|
161 |
-
<td><
|
|
|
162 |
</tr>
|
163 |
|
|
|
|
|
164 |
<tr>
|
165 |
-
<th scope="row"><?php _e( 'Style', 'youtube-embed' ); ?></th>
|
166 |
-
<td><input type="text"
|
|
|
167 |
</tr>
|
168 |
|
169 |
-
|
170 |
-
<th scope="row"><?php _e( 'Video Quality', 'youtube-embed' ); ?></th>
|
171 |
-
<td><select name="youtube_embed_vq">
|
172 |
-
<option value=""<?php if ( $options[ 'vq' ] == '' ) { echo " selected='selected'"; } ?>><?php _e( 'Not set', 'youtube-embed' ); ?></option>
|
173 |
-
<option value="small"<?php if ( $options[ 'vq' ] == "small" ) { echo " selected='selected'"; } ?>><?php echo '240p (Small)'; ?></option>
|
174 |
-
<option value="medium"<?php if ( $options[ 'vq' ] == "medium" ) { echo " selected='selected'"; } ?>><?php echo '360p (Medium)'; ?></option>
|
175 |
-
<option value="large"<?php if ( $options[ 'vq' ] == "large" ) { echo " selected='selected'"; } ?>><?php echo '480p (Large)'; ?></option>
|
176 |
-
<option value="hd720"<?php if ( $options[ 'vq' ] == "hd720" ) { echo " selected='selected'"; } ?>><?php echo '720p (HD)'; ?></option>
|
177 |
-
<option value="hd1080"<?php if ( $options[ 'vq' ] == "hd1080" ) { echo " selected='selected'"; } ?>><?php echo '1080p (HD)'; ?></option>
|
178 |
-
</select> <span class="description"><?php _e( 'Specify the required resolution (if available).', 'youtube-embed' ); ?></span></td>
|
179 |
-
</tr>
|
180 |
|
181 |
<tr>
|
182 |
-
<th scope="row"><?php _e( '
|
183 |
-
<td><input type="checkbox" name="
|
|
|
184 |
</tr>
|
185 |
|
|
|
|
|
186 |
<tr>
|
187 |
-
<th scope="row"><?php _e( '
|
188 |
-
<td><
|
|
|
|
|
|
|
|
|
|
|
189 |
</tr>
|
190 |
|
191 |
-
</table>
|
192 |
|
193 |
-
|
194 |
|
195 |
-
<table class="form-table">
|
196 |
<tr>
|
197 |
-
<th scope="row"><?php _e( '
|
198 |
-
<td><input type="
|
|
|
199 |
</tr>
|
200 |
|
201 |
-
|
202 |
-
<th scope="row"><?php _e( 'Download Text', 'youtube-embed' ); ?></th>
|
203 |
-
<td><input type="text" size="40" name="youtube_embed_download_text" value="<?php echo htmlspecialchars( $options[ 'download_text' ] ); ?>"/> <span class="description"><?php _e( 'Text or HTML to display to prompt download', 'youtube-embed' ); ?></span></td>
|
204 |
-
</tr>
|
205 |
|
206 |
<tr>
|
207 |
-
<th scope="row"><?php _e( '
|
208 |
-
<td><input type="text" size="40" name="youtube_embed_download_style" value="<?php echo htmlspecialchars( $options[ 'download_style' ] ); ?>"/> <span class="description"><?php _e( 'CSS elements to apply to video download link', 'youtube-embed' ); ?></span></td>
|
209 |
-
</tr></table>
|
210 |
-
|
211 |
-
<h3 class="title"><?php _e( 'Video Size', 'youtube-embed' ); ?></h3>
|
212 |
-
|
213 |
-
<table class="form-table">
|
214 |
-
<tr>
|
215 |
-
<th scope="row"><?php _e( 'Video size', 'youtube-embed' ); ?></th>
|
216 |
-
<td><input type="text" size="3" maxlength="3" name="youtube_embed_width" value="<?php echo $options[ 'width' ]; ?>"/> x <input type="text" size="3" maxlength="3" name="youtube_embed_height" value="<?php echo $options[ 'height' ]; ?>"/> <span class="description"><?php _e( 'The width x height of the video, in pixels', 'youtube-embed' ); ?></span></td>
|
217 |
-
</tr>
|
218 |
-
|
219 |
-
<tr valign="top">
|
220 |
-
<th scope="row"><?php _e( 'Default Sizes', 'youtube-embed' ); ?></th>
|
221 |
<td><select name="youtube_embed_size">
|
222 |
<option value=""<?php if ( $default_size == '' ) { echo " selected='selected'"; } ?>><?php _e( 'Use above sizes', 'youtube-embed' ); ?></option>
|
223 |
<option value="04800385"<?php if ( $default_size == "04800385" ) { echo " selected='selected'"; } ?>><?php echo '480x385 4:3'; ?></option>
|
@@ -225,174 +184,193 @@ echo ' ' . __( 'Use the drop-down on the right hand side to swap between profile
|
|
225 |
<option value="06400385"<?php if ( $default_size == "06400385" ) { echo " selected='selected'"; } ?>><?php echo '640x385 16:9'; ?></option>
|
226 |
<option value="08530505"<?php if ( $default_size == "08530505" ) { echo " selected='selected'"; } ?>><?php echo '853x505 16:9'; ?></option>
|
227 |
<option value="12800745"<?php if ( $default_size == "12800745" ) { echo " selected='selected'"; } ?>><?php echo '1280x745 16:9'; ?></option>
|
228 |
-
</select
|
229 |
</tr>
|
230 |
|
|
|
|
|
231 |
<tr>
|
232 |
-
<th scope="row"><?php _e( 'Dynamically Resize', 'youtube-embed' ); ?></th>
|
233 |
-
<td><input type="checkbox" name="youtube_embed_dynamic" value="1"<?php if ( $options[ 'dynamic' ] == "1" ) { echo ' checked="checked"'; }
|
|
|
234 |
</tr>
|
235 |
|
|
|
|
|
236 |
<tr>
|
237 |
-
<th scope="row"> <?php _e( 'Set Maximum Size', 'youtube-embed' ); ?></th>
|
238 |
-
<td><input type="checkbox" name="youtube_embed_fixed" value="1"<?php if ( $options[ 'fixed' ] == "1" ) { echo ' checked="checked"'; }
|
|
|
239 |
</tr>
|
240 |
|
241 |
-
</table>
|
242 |
-
|
243 |
-
<h3 class="title"><?php _e( 'Options Not Supported by EmbedPlus', 'youtube-embed' ); ?></h3>
|
244 |
|
245 |
-
|
246 |
|
247 |
<tr>
|
248 |
-
<th scope="row"><?php _e( '
|
249 |
-
<td><
|
250 |
-
|
251 |
-
<option value="1"<?php if ( $options[ 'autohide' ] == "1" ) { echo " selected='selected'"; } ?>><?php _e( 'Controls & progress bar fade out', 'youtube-embed' ); ?></option>
|
252 |
-
<option value="2"<?php if ( $options[ 'autohide' ] == "2" ) { echo " selected='selected'"; } ?>><?php _e( 'Progress bar fades', 'youtube-embed' ); ?></option>
|
253 |
-
</select> <span class="description"><?php _e( 'Video controls will automatically hide after a video begins playing', 'youtube-embed' ); ?></span></td>
|
254 |
</tr>
|
255 |
|
256 |
-
|
257 |
-
<th scope="row"><?php _e( 'Controls', 'youtube-embed' ); ?></th>
|
258 |
-
<td><select name="youtube_embed_controls">
|
259 |
-
<option value="0"<?php if ( $options[ 'controls' ] == "0" ) { echo " selected='selected'"; } ?>><?php _e( 'Controls do not display & Flash player loads immediately', 'youtube-embed' ); ?></option>
|
260 |
-
<option value="1"<?php if ( $options[ 'controls' ] == "1" ) { echo " selected='selected'"; } ?>><?php _e( 'Controls display & Flash player loads immediately', 'youtube-embed' ); ?></option>
|
261 |
-
<option value="2"<?php if ( $options[ 'controls' ] == "2" ) { echo " selected='selected'"; } ?>><?php _e( 'Controls display & Flash player loads once video starts', 'youtube-embed' ); ?></option>
|
262 |
-
</select> <span class="description"><?php _e( 'Whether the video player controls will display. For AS3 player it also defines when the Flash player will load', 'youtube-embed' ); ?></span></td>
|
263 |
-
</tr>
|
264 |
|
265 |
<tr>
|
266 |
-
<th scope="row"
|
267 |
-
<td><input type="checkbox" name="
|
|
|
|
|
268 |
</tr>
|
269 |
|
270 |
-
|
271 |
-
<th scope="row"><?php _e( 'Loop Video', 'youtube-embed' ); ?></th>
|
272 |
-
<td><input type="checkbox" name="youtube_embed_loop" value="1"<?php if ( $options[ 'loop' ] == "1" ) { echo ' checked="checked"'; } ?>/> <span class="description"><?php _e( 'Play the initial video again and again. In the case of a playlist, this will play the entire playlist and then start again at the first video', 'youtube-embed' ); ?></span></td>
|
273 |
-
</tr>
|
274 |
|
275 |
<tr>
|
276 |
-
<th scope="row"><?php _e( '
|
277 |
-
<td><input type="checkbox" name="
|
|
|
278 |
</tr>
|
279 |
|
|
|
|
|
280 |
<tr>
|
281 |
-
<th scope="row"><?php _e( '
|
282 |
-
<td><input type="checkbox" name="
|
|
|
|
|
283 |
</tr>
|
284 |
|
|
|
|
|
|
|
|
|
285 |
<tr>
|
286 |
-
<th scope="row"><?php _e( '
|
287 |
-
<td><
|
288 |
-
|
289 |
-
<
|
290 |
-
</select> <span class="description"><?php _e( 'Display player controls within a dark or light control bar', 'youtube-embed' ); ?></span></td>
|
291 |
</tr>
|
292 |
|
|
|
|
|
293 |
<tr>
|
294 |
-
<th scope="row"><?php _e( '
|
295 |
-
<td><
|
296 |
-
|
297 |
-
<
|
298 |
-
</select> <span class="description"><?php _e( 'The color that will be used in the player\'s video progress bar to highlight the amount of the video that\'s already been seen', 'youtube-embed' ); ?></span></td>
|
299 |
</tr>
|
300 |
|
|
|
|
|
301 |
<tr>
|
302 |
-
<th scope="row"><?php _e( 'Modest Branding', 'youtube-embed' ); ?></th>
|
303 |
-
<td><input type="checkbox" name="youtube_embed_modest" value="1"<?php if ( $options[ 'modest' ] == "1" ) { echo ' checked="checked"'; }
|
|
|
304 |
</tr>
|
305 |
|
306 |
-
</table>
|
307 |
|
308 |
-
|
309 |
-
<?php _e( 'The following options are not supported if using EmbedPlus or if the IFRAME player uses HTML5.' ); ?>
|
310 |
|
311 |
-
<table class="form-table">
|
312 |
<tr>
|
313 |
-
<th scope="row"><?php _e( '
|
314 |
-
<td><
|
|
|
|
|
|
|
|
|
|
|
315 |
</tr>
|
316 |
|
317 |
-
|
318 |
-
<th scope="row"><?php _e( 'Closed Captions', 'youtube-embed' ); ?></th>
|
319 |
-
<td><input type="checkbox" name="youtube_embed_cc" value="1"<?php if ( $options[ 'cc' ] == "1" ) { echo ' checked="checked"'; } ?>/> <span class="description"><?php _e( 'Show closed captions (subtitles) by default, even if the user has turned captions off', 'youtube-embed' ); ?></span></td>
|
320 |
-
</tr>
|
321 |
|
322 |
<tr>
|
323 |
-
<th scope="row"><?php _e( '
|
324 |
-
<td><
|
|
|
|
|
|
|
|
|
|
|
325 |
</tr>
|
326 |
|
|
|
|
|
327 |
<tr>
|
328 |
-
<th scope="row"><?php _e( '
|
329 |
-
<td><input type="checkbox" name="
|
|
|
330 |
</tr>
|
331 |
|
|
|
|
|
332 |
<tr>
|
333 |
-
<th scope="row"><?php _e( '
|
334 |
-
<td><input type="checkbox" name="
|
|
|
335 |
</tr>
|
336 |
|
337 |
-
|
338 |
|
339 |
-
<
|
340 |
-
|
341 |
-
<
|
342 |
-
<
|
343 |
-
<
|
344 |
-
|
345 |
-
<
|
346 |
-
<option value="transparent"<?php if ( $options[ 'wmode' ] == "transparent" ) { echo " selected='selected'"; } ?>><?php _e( 'Transparent', 'youtube-embed' ); ?></option>
|
347 |
-
<option value="window"<?php if ( $options[ 'wmode' ] == "window" ) { echo " selected='selected'"; } ?>><?php _e( 'Window', 'youtube-embed' ); ?></option>
|
348 |
-
</select><span class="description"><?php _e( 'Sets the Window Mode property of the Flash movie for transparency, layering, and positioning in the browser. <a href="http://www.communitymx.com/content/article.cfm?cid=e5141">Learn more</a>.', 'youtube-embed' ); ?></span></td>
|
349 |
</tr>
|
350 |
|
351 |
-
|
352 |
|
353 |
-
<
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
354 |
|
355 |
-
|
356 |
|
357 |
-
|
358 |
-
<tr valign="top">
|
359 |
-
<th scope="row"><?php _e( 'Fallback Embed Type', 'youtube-embed' ); ?></th>
|
360 |
-
<td><span class="description"><?php _e( 'The type of player to use if Flash is not available and EmbedPlus cannot be used.', 'youtube-embed' ); ?></span><br/>
|
361 |
-
<input type="radio" name="youtube_embed_fallback" value="v"<?php if ( $options[ 'fallback' ] == "v" ) { echo ' checked="checked"'; } ?>/> <?php _e( 'IFRAME', 'youtube-embed' ); ?><br/>
|
362 |
-
<input type="radio" name="youtube_embed_fallback" value="p"<?php if ( $options[ 'fallback' ] == "p" ) { echo ' checked="checked"'; } ?>/> <?php _e( 'OBJECT', 'youtube-embed' ); ?></td>
|
363 |
-
</tr>
|
364 |
|
365 |
<tr>
|
366 |
-
<th scope="row"><?php _e( '
|
367 |
-
<td><input type="checkbox" name="
|
|
|
368 |
</tr>
|
369 |
|
|
|
|
|
370 |
<tr>
|
371 |
-
<th scope="row"><?php _e( '
|
372 |
-
<td><input type="
|
|
|
373 |
</tr>
|
374 |
|
|
|
|
|
375 |
<tr>
|
376 |
-
<th scope="row"><?php _e( '
|
377 |
-
<td><input type="
|
|
|
378 |
</tr>
|
|
|
379 |
</table>
|
380 |
|
381 |
<?php wp_nonce_field( 'youtube-embed-profile', 'youtube_embed_profile_nonce', true, true ); ?>
|
382 |
|
383 |
-
<p class="submit"><input type="submit" name="Submit" class="button-primary" value="<?php _e( 'Save
|
384 |
|
385 |
</form>
|
386 |
|
387 |
-
</div>
|
388 |
-
|
389 |
<a href="#" name="video"></a>
|
390 |
-
<form method="post" action="<?php echo get_bloginfo( 'wpurl' ).'/wp-admin/admin.php?page=profile-options#video' ?>">
|
391 |
<h3><?php _e( 'YouTube Video Sample', 'youtube-embed' ); ?></h3>
|
392 |
<p><?php _e( 'The video below uses the above, saved profile settings. Use the drop-down below to change which parameters the video uses - press the Change Video button to update it.', 'youtube-embed' ); ?></p>
|
393 |
<p><select name="youtube_embed_video_type">
|
394 |
<option value="d"<?php if ( $video_type == "d" ) { echo " selected='selected'"; } ?>><?php _e( 'Standard', 'youtube-embed' ); ?></option>
|
395 |
-
<option value="p"<?php if ( $video_type == "p" ) { echo " selected='selected'"; } ?>><?php _e( 'EmbedPlus', 'youtube-embed' ); ?></option>
|
396 |
<option value="3"<?php if ( $video_type == "3" ) { echo " selected='selected'"; } ?>><?php _e( '3D', 'youtube-embed' ); ?></option>
|
397 |
<option value="l"<?php if ( $video_type == "l" ) { echo " selected='selected'"; } ?>><?php _e( 'Playlist', 'youtube-embed' ); ?></option>
|
398 |
</select>
|
@@ -400,11 +378,10 @@ echo ' ' . __( 'Use the drop-down on the right hand side to swap between profile
|
|
400 |
<input type="submit" name="Video" class="button-secondary" value="<?php _e( 'Change video', 'youtube-embed' ); ?>"/></p>
|
401 |
|
402 |
<p><?php
|
403 |
-
if ( $video_type == "d" ) { $id = $demo_video;
|
404 |
-
if ( $video_type == "
|
405 |
-
if ( $video_type == "
|
406 |
-
|
407 |
-
echo vye_generate_youtube_code( $id, $type, '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', $profile_no );
|
408 |
?></p>
|
409 |
|
410 |
</form>
|
9 |
*/
|
10 |
?>
|
11 |
|
12 |
+
<?php $demo_video = 'Wc7cvpQS-xQ'; ?>
|
13 |
|
14 |
<div class="wrap">
|
15 |
|
|
|
16 |
<?php
|
17 |
global $wp_version;
|
18 |
if ( ( float ) $wp_version >= 4.3 ) { $heading = '1'; } else { $heading = '2'; }
|
31 |
if ( ( !empty( $_POST[ 'Submit' ] ) ) && ( check_admin_referer( 'youtube-embed-profile' , 'youtube_embed_profile_nonce' ) ) ) {
|
32 |
|
33 |
$options[ 'name' ] = htmlentities( $_POST[ 'youtube_embed_name' ] );
|
|
|
|
|
34 |
$options[ 'width' ] = $_POST[ 'youtube_embed_width' ];
|
35 |
$options[ 'height' ] = $_POST[ 'youtube_embed_height' ];
|
36 |
|
38 |
if ( strpos( $options[ 'template' ], '%video%' ) === false ) { $options[ 'template' ] = '%video%'; }
|
39 |
|
40 |
$options[ 'style' ] = $_POST[ 'youtube_embed_style' ];
|
41 |
+
if ( isset( $_POST[ 'youtube_embed_fullscreen' ] ) ) { $options[ 'fullscreen' ] = $_POST[ 'youtube_embed_fullscreen' ]; } else { $options[ 'fullscreen' ] = ''; }
|
42 |
+
if ( isset( $_POST[ 'youtube_embed_autoplay' ] ) ) { $options[ 'autoplay'] = $_POST[ 'youtube_embed_autoplay' ]; } else { $options[ 'autoplay' ] = ''; }
|
43 |
+
if ( isset( $_POST[ 'youtube_embed_loop' ] ) ) { $options[ 'loop'] = $_POST[ 'youtube_embed_loop' ]; } else { $options[ 'loop' ] = ''; }
|
44 |
+
if ( isset( $_POST[ 'youtube_embed_cc' ] ) ) { $options[ 'cc'] = $_POST[ 'youtube_embed_cc' ]; } else { $options[ 'cc' ] = ''; }
|
45 |
+
if ( isset( $_POST[ 'youtube_embed_annotation' ] ) ) { $options[ 'annotation'] = $_POST[ 'youtube_embed_annotation' ]; } else { $options[ 'annotation' ] = ''; }
|
46 |
+
if ( isset( $_POST[ 'youtube_embed_related' ] ) ) { $options[ 'related'] = $_POST[ 'youtube_embed_related' ]; } else { $options[ 'related' ] = ''; }
|
47 |
+
if ( isset( $_POST[ 'youtube_embed_info' ] ) ) { $options[ 'info'] = $_POST[ 'youtube_embed_info' ]; } else { $options[ 'info' ] = ''; }
|
48 |
+
if ( isset( $_POST[ 'youtube_embed_disablekb' ] ) ) { $options[ 'disablekb'] = $_POST[ 'youtube_embed_disablekb' ]; } else { $options[ 'disablekb' ] = ''; }
|
|
|
|
|
|
|
49 |
$options[ 'autohide'] = $_POST[ 'youtube_embed_autohide' ];
|
50 |
$options[ 'controls'] = $_POST[ 'youtube_embed_controls' ];
|
|
|
51 |
$options[ 'wmode'] = $_POST[ 'youtube_embed_wmode' ];
|
|
|
|
|
52 |
$options[ 'color' ] = $_POST[ 'youtube_embed_color' ];
|
53 |
$options[ 'theme' ] = $_POST[ 'youtube_embed_theme' ];
|
54 |
+
if ( isset( $_POST[ 'youtube_embed_https' ] ) ) { $options[ 'https' ] = $_POST[ 'youtube_embed_https' ]; } else { $options[ 'https' ] = ''; }
|
55 |
+
if ( isset( $_POST[ 'youtube_embed_modest' ] ) ) { $options[ 'modest' ] = $_POST[ 'youtube_embed_modest' ]; } else { $options[ 'modest' ] = ''; }
|
56 |
+
if ( isset( $_POST[ 'youtube_embed_dynamic' ] ) ) { $options[ 'dynamic' ] = $_POST[ 'youtube_embed_dynamic' ]; } else { $options[ 'dynamic' ] = ''; }
|
57 |
+
if ( isset( $_POST[ 'youtube_embed_fixed' ] ) ) { $options[ 'fixed' ] = $_POST[ 'youtube_embed_fixed' ]; } else { $options[ 'fixed' ] = ''; }
|
58 |
+
if ( isset( $_POST[ 'youtube_embed_download' ] ) ) { $options[ 'download' ] = $_POST[ 'youtube_embed_download' ]; } else { $options[ 'download' ] = ''; }
|
|
|
59 |
$options[ 'download_style' ] = $_POST[ 'youtube_embed_download_style' ];
|
60 |
$options[ 'download_text' ] = str_replace( '\"', '"', str_replace( "\'", "'", $_POST[ 'youtube_embed_download_text' ] ) );
|
|
|
61 |
|
62 |
$default_size = $_POST[ 'youtube_embed_size' ];
|
63 |
|
99 |
$general = vye_set_general_defaults();
|
100 |
?>
|
101 |
|
102 |
+
<form method="post" action="<?php echo get_bloginfo( 'wpurl' ) . '/wp-admin/admin.php?page=ye-profile-options' ?>">
|
103 |
|
104 |
<span class="alignright">
|
105 |
<select name="youtube_embed_profile_no">
|
119 |
|
120 |
<table class="form-table">
|
121 |
|
122 |
+
<!-- Profile Name -->
|
123 |
+
|
124 |
<tr>
|
125 |
+
<th scope="row"><label for="youtube_embed_name"><?php _e( 'Profile Name', 'youtube-embed' ); ?></label></th>
|
126 |
+
<td><label for="youtube_embed_name"><input type="text" size="20" name="youtube_embed_name" value="<?php echo $options[ 'name' ]; ?>"<?php if ( $profile_no == 0 ) { echo ' readonly="readonly"'; } ?>/>
|
127 |
+
<?php if ( $profile_no != 0 ) { _e( 'The name you wish to give this profile', 'youtube-embed' ); } ?></label></td>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
128 |
</tr>
|
129 |
|
130 |
+
<!-- Template -->
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
131 |
|
|
|
132 |
<tr>
|
133 |
+
<th scope="row"><label for="youtube_embed_template"><?php _e( 'Template', 'youtube-embed' ); ?></label></th>
|
134 |
+
<td><textarea name="youtube_embed_template" rows="4" cols="50" class="large-text code"><?php echo htmlspecialchars( $options[ 'template' ] ); ?></textarea>
|
135 |
+
<p class="description"><?php _e( 'Wrapper for video output. Must include <code>%video%</code> tag to show video position.', 'youtube-embed' ); ?></p></td>
|
136 |
</tr>
|
137 |
|
138 |
+
<!-- Style -->
|
139 |
+
|
140 |
<tr>
|
141 |
+
<th scope="row"><label for="youtube_embed_style"><?php _e( 'Style', 'youtube-embed' ); ?></label></th>
|
142 |
+
<td><input type="text" name="youtube_embed_style" class="large-text code" value="<?php echo htmlspecialchars( $options[ 'style' ] ); ?>"/>
|
143 |
+
<p class="description"><?php _e( 'CSS elements to apply to video.', 'youtube-embed' ); ?></p></td>
|
144 |
</tr>
|
145 |
|
146 |
+
<!-- SSL -->
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
147 |
|
148 |
<tr>
|
149 |
+
<th scope="row"><label for="youtube_embed_https"><?php _e( 'SSL', 'youtube-embed' ); ?></label></th>
|
150 |
+
<td><label for="youtube_embed_https"><input type="checkbox" name="youtube_embed_https" value="1"<?php if ( $options[ 'https' ] == "1" ) { echo ' checked="checked"'; } ?>/>
|
151 |
+
<?php _e( 'Use SSL? <a href="http://www.google.com/support/youtube/bin/answer.py?answer=171780&expand=UseHTTPS#HTTPS">Read more</a>', 'youtube-embed' ); ?></label></td>
|
152 |
</tr>
|
153 |
|
154 |
+
<!-- Window Mode -->
|
155 |
+
|
156 |
<tr>
|
157 |
+
<th scope="row"><label for="youtube_embed_wmode"><?php _e( 'Window Mode', 'youtube-embed' ); ?> <img src='<?php echo plugins_url() ; ?>/youtube-embed/images/flash.png' width='10px' align='top'></label></th>
|
158 |
+
<td><select name="youtube_embed_wmode">
|
159 |
+
<option value="opaque"<?php if ( $options[ 'wmode' ] == "opaque" ) { echo " selected='selected'"; } ?>><?php _e( 'Opaque', 'youtube-embed' ); ?></option>
|
160 |
+
<option value="transparent"<?php if ( $options[ 'wmode' ] == "transparent" ) { echo " selected='selected'"; } ?>><?php _e( 'Transparent', 'youtube-embed' ); ?></option>
|
161 |
+
<option value="window"<?php if ( $options[ 'wmode' ] == "window" ) { echo " selected='selected'"; } ?>><?php _e( 'Window', 'youtube-embed' ); ?></option>
|
162 |
+
</select>
|
163 |
+
<p class="description"><?php _e( 'Sets the Window Mode property of the Flash movie for transparency, layering, and positioning in the browser. <a href="http://www.communitymx.com/content/article.cfm?cid=e5141">Learn more</a>.', 'youtube-embed' ); ?></p></td>
|
164 |
</tr>
|
165 |
|
166 |
+
</table><hr><h3 class="title"><?php _e( 'Video Size', 'youtube-embed' ); ?></h3><table class="form-table">
|
167 |
|
168 |
+
<!-- Video Size -->
|
169 |
|
|
|
170 |
<tr>
|
171 |
+
<th scope="row"><label for="youtube_embed_https"><?php _e( 'Video Size', 'youtube-embed' ); ?></label></th>
|
172 |
+
<td><label for="youtube_embed_height"><input type="text" size="3" maxlength="3" name="youtube_embed_width" value="<?php echo $options[ 'width' ]; ?>"/> x <input type="text" size="3" maxlength="3" name="youtube_embed_height" value="<?php echo $options[ 'height' ]; ?>"/>
|
173 |
+
<?php _e( 'The width x height of the video, in pixels', 'youtube-embed' ); ?></label></td>
|
174 |
</tr>
|
175 |
|
176 |
+
<!-- Default Sizes -->
|
|
|
|
|
|
|
177 |
|
178 |
<tr>
|
179 |
+
<th scope="row"><label for="youtube_embed_size"><?php _e( 'Default Sizes', 'youtube-embed' ); ?></label></th>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
180 |
<td><select name="youtube_embed_size">
|
181 |
<option value=""<?php if ( $default_size == '' ) { echo " selected='selected'"; } ?>><?php _e( 'Use above sizes', 'youtube-embed' ); ?></option>
|
182 |
<option value="04800385"<?php if ( $default_size == "04800385" ) { echo " selected='selected'"; } ?>><?php echo '480x385 4:3'; ?></option>
|
184 |
<option value="06400385"<?php if ( $default_size == "06400385" ) { echo " selected='selected'"; } ?>><?php echo '640x385 16:9'; ?></option>
|
185 |
<option value="08530505"<?php if ( $default_size == "08530505" ) { echo " selected='selected'"; } ?>><?php echo '853x505 16:9'; ?></option>
|
186 |
<option value="12800745"<?php if ( $default_size == "12800745" ) { echo " selected='selected'"; } ?>><?php echo '1280x745 16:9'; ?></option>
|
187 |
+
</select><p class="description"><?php _e( 'Select one of these default sizes to override the above video sizes.', 'youtube-embed' ); ?></p></td>
|
188 |
</tr>
|
189 |
|
190 |
+
<!-- Dynamically Resize -->
|
191 |
+
|
192 |
<tr>
|
193 |
+
<th scope="row"><label for="youtube_embed_dynamic"><?php _e( 'Dynamically Resize', 'youtube-embed' ); ?></label></th>
|
194 |
+
<td><label for="youtube_embed_dynamic"><input type="checkbox" name="youtube_embed_dynamic" value="1"<?php if ( $options[ 'dynamic' ] == "1" ) { echo ' checked="checked"'; } ?>/>
|
195 |
+
<?php _e( 'Show full width and resize with the browser', 'youtube-embed' ); ?></label></td>
|
196 |
</tr>
|
197 |
|
198 |
+
<!-- Maximum Size -->
|
199 |
+
|
200 |
<tr>
|
201 |
+
<th scope="row"><label for="youtube_embed_fixed"> <?php _e( 'Set Maximum Size', 'youtube-embed' ); ?></label></th>
|
202 |
+
<td><label for="youtube_embed_fixed"><input type="checkbox" name="youtube_embed_fixed" value="1"<?php if ( $options[ 'fixed' ] == "1" ) { echo ' checked="checked"'; } ?>/>
|
203 |
+
<?php _e( 'Use above width to define maximum size', 'youtube-embed' ); ?></label></td>
|
204 |
</tr>
|
205 |
|
206 |
+
</table><hr><h3 class="title"><?php _e( 'Playback', 'youtube-embed' ); ?></h3><table class="form-table">
|
|
|
|
|
207 |
|
208 |
+
<!-- Autoplay -->
|
209 |
|
210 |
<tr>
|
211 |
+
<th scope="row"><label for="youtube_embed_autoplay"><?php _e( 'Autoplay', 'youtube-embed' ); ?></label></th>
|
212 |
+
<td><label for="youtube_embed_autoplay"><input type="checkbox" name="youtube_embed_autoplay" value="1"<?php if ( $options[ 'autoplay' ] == "1" ) { echo ' checked="checked"'; } ?>/>
|
213 |
+
<?php _e( 'Choose whether the initial video will automatically start to play when the player loads', 'youtube-embed' ); ?></label></td>
|
|
|
|
|
|
|
214 |
</tr>
|
215 |
|
216 |
+
<!-- Loop Video -->
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
217 |
|
218 |
<tr>
|
219 |
+
<th scope="row"><label for="youtube_embed_loop"><?php _e( 'Loop Video', 'youtube-embed' ); ?></label></th>
|
220 |
+
<td><label for="youtube_embed_loop"><input type="checkbox" name="youtube_embed_loop" value="1"<?php if ( $options[ 'loop' ] == "1" ) { echo ' checked="checked"'; } ?>/>
|
221 |
+
<?php _e( 'Play the initial video again and again', 'youtube-embed' ); ?></label>
|
222 |
+
<p class="description"><?php _e( 'In the case of a playlist, this will play the entire playlist and then start again at the first video.', 'youtube-embed' ); ?></p></td>
|
223 |
</tr>
|
224 |
|
225 |
+
<!-- Annotations -->
|
|
|
|
|
|
|
226 |
|
227 |
<tr>
|
228 |
+
<th scope="row"><label for="youtube_embed_annotation"><?php _e( 'Annotations', 'youtube-embed' ); ?></label></th>
|
229 |
+
<td><label for="youtube_embed_annotation"><input type="checkbox" name="youtube_embed_annotation" value="1"<?php if ( $options[ 'annotation' ] == "1" ) { echo ' checked="checked"'; } ?>/>
|
230 |
+
<?php _e( 'Video annotations are shown by default', 'youtube-embed' ); ?></label></td>
|
231 |
</tr>
|
232 |
|
233 |
+
<!-- Closed Captions -->
|
234 |
+
|
235 |
<tr>
|
236 |
+
<th scope="row"><label for="youtube_embed_cc"><?php _e( 'Closed Captions', 'youtube-embed' ); ?></label></th>
|
237 |
+
<td><label for="youtube_embed_cc"><input type="checkbox" name="youtube_embed_cc" value="1"<?php if ( $options[ 'cc' ] == "1" ) { echo ' checked="checked"'; } ?>/>
|
238 |
+
<?php _e( 'Show closed captions (subtitles)', 'youtube-embed' ); ?></label>
|
239 |
+
<p class="description"><?php _e( 'This will even override even the user\'s choice.', 'youtube-embed' ); ?></p></td>
|
240 |
</tr>
|
241 |
|
242 |
+
</table><hr><h3 class="title"><?php _e( 'Information', 'youtube-embed' ); ?></h3><table class="form-table">
|
243 |
+
|
244 |
+
<!-- Info -->
|
245 |
+
|
246 |
<tr>
|
247 |
+
<th scope="row"><label for="youtube_embed_info"><?php _e( 'Information', 'youtube-embed' ); ?></label></th>
|
248 |
+
<td><label for="youtube_embed_info"><input type="checkbox" name="youtube_embed_info" value="1"<?php if ( $options[ 'info' ] == "1" ) { echo ' checked="checked"'; } ?>/>
|
249 |
+
<?php _e( 'Display the video title and uploader before the video starts', 'youtube-embed' ); ?></label>
|
250 |
+
<p class="description"><?php _e( 'If displaying a playlist this will show video thumbnails.', 'youtube-embed' ); ?></p></td>
|
|
|
251 |
</tr>
|
252 |
|
253 |
+
<!-- Related -->
|
254 |
+
|
255 |
<tr>
|
256 |
+
<th scope="row"><label for="youtube_embed_related"><?php _e( 'Related Videos', 'youtube-embed' ); ?></label></th>
|
257 |
+
<td><label for="youtube_embed_related"><input type="checkbox" name="youtube_embed_related" value="1"<?php if ( $options[ 'related' ] == "1" ) { echo ' checked="checked"'; } ?>/>
|
258 |
+
<?php _e( 'Load related videos once playback starts', 'youtube-embed' ); ?></label>
|
259 |
+
<p class="description"><?php _e( 'Also toggles the search option.', 'youtube-embed' ); ?></p></td>
|
|
|
260 |
</tr>
|
261 |
|
262 |
+
<!-- Modest Branding -->
|
263 |
+
|
264 |
<tr>
|
265 |
+
<th scope="row"><label for="youtube_embed_modest"><?php _e( 'Modest Branding', 'youtube-embed' ); ?></label></th>
|
266 |
+
<td><label for="youtube_embed_modest"><input type="checkbox" name="youtube_embed_modest" value="1"<?php if ( $options[ 'modest' ] == "1" ) { echo ' checked="checked"'; } ?>/>
|
267 |
+
<?php _e( 'Reduce branding on video', 'youtube-embed' ); ?></label></td>
|
268 |
</tr>
|
269 |
|
270 |
+
</table><hr><h3 class="title"><?php _e( 'Controls', 'youtube-embed' ); ?></h3><table class="form-table">
|
271 |
|
272 |
+
<!-- Auto Hide -->
|
|
|
273 |
|
|
|
274 |
<tr>
|
275 |
+
<th scope="row"><label for="youtube_embed_autohide"><?php _e( 'Auto hide', 'youtube-embed' ); ?> <img src='<?php echo plugins_url() ; ?>/youtube-embed/images/flash.png' width='10px' align='top'></label></th>
|
276 |
+
<td><select name="youtube_embed_autohide">
|
277 |
+
<option value="0"<?php if ( $options[ 'autohide' ] == "0" ) { echo " selected='selected'"; } ?>><?php _e( 'Controls & progress bar remain visible', 'youtube-embed' ); ?></option>
|
278 |
+
<option value="1"<?php if ( $options[ 'autohide' ] == "1" ) { echo " selected='selected'"; } ?>><?php _e( 'Controls & progress bar fade out', 'youtube-embed' ); ?></option>
|
279 |
+
<option value="2"<?php if ( $options[ 'autohide' ] == "2" ) { echo " selected='selected'"; } ?>><?php _e( 'Progress bar fades', 'youtube-embed' ); ?></option>
|
280 |
+
</select>
|
281 |
+
<p class="description"><?php _e( 'Whether the video controls will automatically hide after a video begins playing.', 'youtube-embed' ); ?></p></td>
|
282 |
</tr>
|
283 |
|
284 |
+
<!-- Controls -->
|
|
|
|
|
|
|
285 |
|
286 |
<tr>
|
287 |
+
<th scope="row"><label for="youtube_embed_controls"><?php _e( 'Controls', 'youtube-embed' ); ?></label></th>
|
288 |
+
<td><select name="youtube_embed_controls">
|
289 |
+
<option value="0"<?php if ( $options[ 'controls' ] == "0" ) { echo " selected='selected'"; } ?>><?php _e( 'Controls do not display & Flash player loads immediately', 'youtube-embed' ); ?></option>
|
290 |
+
<option value="1"<?php if ( $options[ 'controls' ] == "1" ) { echo " selected='selected'"; } ?>><?php _e( 'Controls display & Flash player loads immediately', 'youtube-embed' ); ?></option>
|
291 |
+
<option value="2"<?php if ( $options[ 'controls' ] == "2" ) { echo " selected='selected'"; } ?>><?php _e( 'Controls display & Flash player loads once video starts', 'youtube-embed' ); ?></option>
|
292 |
+
</select>
|
293 |
+
<p class="description"><?php _e( 'Whether the video player controls are displayed. For Flash it also defines when the controls display in the player as well as when the player will load.', 'youtube-embed' ); ?></p></td>
|
294 |
</tr>
|
295 |
|
296 |
+
<!-- Disable Keyboard -->
|
297 |
+
|
298 |
<tr>
|
299 |
+
<th scope="row"><label for="youtube_embed_disablekb"><?php _e( 'Disable Keyboard', 'youtube-embed' ); ?></label></th>
|
300 |
+
<td><label for="youtube_embed_disablekb"><input type="checkbox" name="youtube_embed_disablekb" value="1"<?php if ( $options[ 'disablekb' ] == "1" ) { echo ' checked="checked"'; } ?>/>
|
301 |
+
<?php _e( 'Disable the player keyboard controls', 'youtube-embed' ); ?></label></td>
|
302 |
</tr>
|
303 |
|
304 |
+
<!-- Fullscreen -->
|
305 |
+
|
306 |
<tr>
|
307 |
+
<th scope="row"><label for="youtube_embed_fullscreen"><?php _e( 'Fullscreen', 'youtube-embed' ); ?></label></th>
|
308 |
+
<td><label for="youtube_embed_fullscreen"><input type="checkbox" name="youtube_embed_fullscreen" value="1"<?php if ( $options[ 'fullscreen' ] == "1" ) { echo ' checked="checked"'; } ?>/>
|
309 |
+
<?php _e( 'A button will allow the viewer to watch the video fullscreen', 'youtube-embed' ); ?></label></td>
|
310 |
</tr>
|
311 |
|
312 |
+
<!-- Theme -->
|
313 |
|
314 |
+
<tr>
|
315 |
+
<th scope="row"><label for="youtube_embed_theme"><?php _e( 'Theme', 'youtube-embed' ); ?> <img src='<?php echo plugins_url() ; ?>/youtube-embed/images/flash.png' width='10px' align='top'></label></th>
|
316 |
+
<td><select name="youtube_embed_theme">
|
317 |
+
<option value="dark"<?php if ( $options[ 'theme' ] == "dark" ) { echo " selected='selected'"; } ?>><?php _e( 'Dark', 'youtube-embed' ); ?></option>
|
318 |
+
<option value="light"<?php if ( $options[ 'theme' ] == "light" ) { echo " selected='selected'"; } ?>><?php _e( 'Light', 'youtube-embed' ); ?></option>
|
319 |
+
</select>
|
320 |
+
<p class="description"><?php _e( 'Display player controls within a dark or light control bar.', 'youtube-embed' ); ?></p></td>
|
|
|
|
|
|
|
321 |
</tr>
|
322 |
|
323 |
+
<!-- Color -->
|
324 |
|
325 |
+
<tr>
|
326 |
+
<th scope="row"><label for="youtube_embed_color"><?php _e( 'Progress Bar Color', 'youtube-embed' ); ?></label></th>
|
327 |
+
<td><select name="youtube_embed_color">
|
328 |
+
<option value="red"<?php if ( $options[ 'color' ] == "red" ) { echo " selected='selected'"; } ?>><?php _e( 'Red', 'youtube-embed' ); ?></option>
|
329 |
+
<option value="white"<?php if ( $options[ 'color' ] == "white" ) { echo " selected='selected'"; } ?>><?php _e( 'White (desaturated)', 'youtube-embed' ); ?></option>
|
330 |
+
</select>
|
331 |
+
<p class="description"><?php _e( 'The color that will be used in the player\'s video progress bar to highlight the amount of the video that\'s already been seen.', 'youtube-embed' ); ?></p></td>
|
332 |
+
</tr>
|
333 |
|
334 |
+
</table><hr><h3 class="title"><?php _e( 'Download Link', 'youtube-embed' ); ?></h3><table class="form-table">
|
335 |
|
336 |
+
<!-- Download Link -->
|
|
|
|
|
|
|
|
|
|
|
|
|
337 |
|
338 |
<tr>
|
339 |
+
<th scope="row"><label for="youtube_embed_download"><?php _e( 'Show Download Link', 'youtube-embed' ); ?></label></th>
|
340 |
+
<td><label for="youtube_embed_download"><input type="checkbox" name="youtube_embed_download" value="1"<?php if ( $options[ 'download' ] == "1" ) { echo ' checked="checked"'; } ?>/>
|
341 |
+
<?php echo sprintf( __( 'Show a link to %s under the video', 'youtube-embed' ), '<a href="http://keepvid.com/" rel="nofollow">KeepVid</a>' ); ?></label></td>
|
342 |
</tr>
|
343 |
|
344 |
+
<!-- Download Text -->
|
345 |
+
|
346 |
<tr>
|
347 |
+
<th scope="row"><label for="youtube_embed_download_text"><?php _e( 'Download Text', 'youtube-embed' ); ?></label></th>
|
348 |
+
<td><input type="text" name="youtube_embed_download_text" class="large-text" value="<?php echo htmlspecialchars( $options[ 'download_text' ] ); ?>"/>
|
349 |
+
<p class="description"><?php _e( 'Text or HTML to display to prompt download.', 'youtube-embed' ); ?></p></td>
|
350 |
</tr>
|
351 |
|
352 |
+
<!-- Download Style -->
|
353 |
+
|
354 |
<tr>
|
355 |
+
<th scope="row"><label for="youtube_embed_download_style"><?php _e( 'Download Style', 'youtube-embed' ); ?></label></th>
|
356 |
+
<td><input type="text" name="youtube_embed_download_style" class="large-text code" value="<?php echo htmlspecialchars( $options[ 'download_style' ] ); ?>"/>
|
357 |
+
<p class="description"><?php _e( 'CSS elements to apply to video download link.', 'youtube-embed' ); ?></p></td>
|
358 |
</tr>
|
359 |
+
|
360 |
</table>
|
361 |
|
362 |
<?php wp_nonce_field( 'youtube-embed-profile', 'youtube_embed_profile_nonce', true, true ); ?>
|
363 |
|
364 |
+
<p class="submit"><input type="submit" name="Submit" class="button-primary" value="<?php _e( 'Save Changes', 'youtube-embed' ); ?>"/></p>
|
365 |
|
366 |
</form>
|
367 |
|
|
|
|
|
368 |
<a href="#" name="video"></a>
|
369 |
+
<form method="post" action="<?php echo get_bloginfo( 'wpurl' ).'/wp-admin/admin.php?page=ye-profile-options#video' ?>">
|
370 |
<h3><?php _e( 'YouTube Video Sample', 'youtube-embed' ); ?></h3>
|
371 |
<p><?php _e( 'The video below uses the above, saved profile settings. Use the drop-down below to change which parameters the video uses - press the Change Video button to update it.', 'youtube-embed' ); ?></p>
|
372 |
<p><select name="youtube_embed_video_type">
|
373 |
<option value="d"<?php if ( $video_type == "d" ) { echo " selected='selected'"; } ?>><?php _e( 'Standard', 'youtube-embed' ); ?></option>
|
|
|
374 |
<option value="3"<?php if ( $video_type == "3" ) { echo " selected='selected'"; } ?>><?php _e( '3D', 'youtube-embed' ); ?></option>
|
375 |
<option value="l"<?php if ( $video_type == "l" ) { echo " selected='selected'"; } ?>><?php _e( 'Playlist', 'youtube-embed' ); ?></option>
|
376 |
</select>
|
378 |
<input type="submit" name="Video" class="button-secondary" value="<?php _e( 'Change video', 'youtube-embed' ); ?>"/></p>
|
379 |
|
380 |
<p><?php
|
381 |
+
if ( $video_type == "d" ) { $id = $demo_video; }
|
382 |
+
if ( $video_type == "3" ) { $id = 'NR5UoBY87GM'; }
|
383 |
+
if ( $video_type == "l" ) { $id = '095393D5B42B2266'; }
|
384 |
+
echo vye_generate_youtube_code( $id, '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', $profile_no );
|
|
|
385 |
?></p>
|
386 |
|
387 |
</form>
|
includes/options-widgets.php
DELETED
@@ -1,156 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
// Set default options
|
4 |
-
|
5 |
-
$default = array( 'titles' => 'YouTube', 'id' => '', 'profile' => '', 'type' => '', 'template' => '', 'style' => '', 'start' => '', 'autoplay' => '', 'width' => '', 'height' => '', 'dynamic' => '', 'list' => '', 'loop' => '', 'stop' => '', 'id_type' => 'v' );
|
6 |
-
$instance = wp_parse_args( ( array ) $instance, $default );
|
7 |
-
$general = vye_set_general_defaults();
|
8 |
-
|
9 |
-
// Widget Title field
|
10 |
-
|
11 |
-
$field_id = $this -> get_field_id( 'titles' );
|
12 |
-
$field_name = $this -> get_field_name( 'titles' );
|
13 |
-
echo "\r\n" . '<p><label for="' . $field_id . '">' . __( 'Widget Title', 'youtube-embed' ) . ': </label><input type="text" class="widefat" id="' . $field_id . '" name="' . $field_name . '" value="' . attribute_escape( $instance[ 'titles' ] ).'" /></p>';
|
14 |
-
|
15 |
-
// Video ID field
|
16 |
-
|
17 |
-
$field_id = $this -> get_field_id( 'id' );
|
18 |
-
$field_name = $this -> get_field_name( 'id' );
|
19 |
-
echo "\r\n" . '<p><label for="' . $field_id . '">' . __( 'Video ID', 'youtube-embed' ) . ': </label><input type="text" class="widefat" id="' . $field_id . '" name="' . $field_name . '" value="' . attribute_escape( $instance[ 'id' ] ) . '" /></p>';
|
20 |
-
|
21 |
-
echo "<table>\n";
|
22 |
-
|
23 |
-
// ID Type
|
24 |
-
|
25 |
-
$field_id = $this -> get_field_id( 'id_type' );
|
26 |
-
$field_name = $this -> get_field_name( 'id_type' );
|
27 |
-
echo "\r\n" . '<tr><td width="100%">' . __( 'ID Type', 'youtube-embed' ) . '</td><td><select name="' . $field_name . '" id="' . $field_id . '"><option value="v"';
|
28 |
-
if ( attribute_escape( $instance[ 'id_type' ] ) == 'v' ) { echo " selected='selected'"; }
|
29 |
-
echo '>' . __( 'Video or Playlist', 'youtube-embed' ) . '</option><option value="s"';
|
30 |
-
if ( attribute_escape( $instance[ 'id_type' ] ) == 's' ) { echo " selected='selected'"; }
|
31 |
-
echo '>' . __( 'Search', 'youtube-embed' ) . '</option><option value="u"';
|
32 |
-
if ( attribute_escape( $instance[ 'id_type' ] ) == 'u' ) { echo " selected='selected'"; }
|
33 |
-
echo '>' . __( 'User', 'youtube-embed' ) . '</option></select></td></tr>';
|
34 |
-
|
35 |
-
echo "</table>\n";
|
36 |
-
|
37 |
-
// Profile field
|
38 |
-
|
39 |
-
$field_id = $this -> get_field_id( 'profile' );
|
40 |
-
$field_name = $this -> get_field_name( 'profile' );
|
41 |
-
echo "\r\n" . '<p><label for="' . $field_id . '">' . __( 'Profile', 'youtube-embed' ) . ': </label><select name="' . $field_name . '" class="widefat" id="' . $field_id . '">';
|
42 |
-
vye_generate_profile_list( attribute_escape( $instance[ 'profile' ] ), $general[ 'profile_no' ] );
|
43 |
-
echo '</select></p>';
|
44 |
-
|
45 |
-
// Template
|
46 |
-
|
47 |
-
$field_id = $this -> get_field_id( 'template' );
|
48 |
-
$field_name = $this -> get_field_name( 'template' );
|
49 |
-
echo "\r\n" . '<p><label for="' . $field_id . '">'.__( 'Template', 'youtube-embed' ).': </label><input type="text" class="widefat" id="' . $field_id . '" name="' . $field_name . '" value="' . attribute_escape( $instance[ 'template' ] ) . '" /></p>';
|
50 |
-
|
51 |
-
// Style
|
52 |
-
|
53 |
-
$field_id = $this -> get_field_id( 'style' );
|
54 |
-
$field_name = $this -> get_field_name( 'style' );
|
55 |
-
echo "\r\n" . '<p><label for="' . $field_id . '">'.__( 'Style', 'youtube-embed' ).': </label><input type="text" class="widefat" id="' . $field_id . '" name="' . $field_name . '" value="' . attribute_escape( $instance[ 'style' ] ) . '" /></p>';
|
56 |
-
|
57 |
-
// Size fields
|
58 |
-
|
59 |
-
$field_id = $this -> get_field_id( 'width' );
|
60 |
-
$field_name = $this -> get_field_name( 'width' );
|
61 |
-
echo "\r\n" . '<p><label for="' . $field_id . '">' . __( 'Size', 'youtube-embed' ) . ': </label><input type="text" size="3" maxlength="3" id="' . $field_id . '" name="' . $field_name . '" value="' . attribute_escape( $instance[ 'width' ] ) . '" /> x ';
|
62 |
-
|
63 |
-
$field_id = $this -> get_field_id( 'height' );
|
64 |
-
$field_name = $this -> get_field_name( 'height' );
|
65 |
-
echo '<input type="text" size="3" maxlength="3" id="' . $field_id . '" name="' . $field_name . '" value="' . attribute_escape( $instance[ 'height' ] ) . '" /> pixels</p>';
|
66 |
-
|
67 |
-
echo "<table>\n";
|
68 |
-
|
69 |
-
// Dynamic Resize
|
70 |
-
|
71 |
-
$field_id = $this -> get_field_id( 'dynamic' );
|
72 |
-
$field_name = $this -> get_field_name( 'dynamic' );
|
73 |
-
echo "\r\n" . '<tr><td width="100%">' . __( 'Dynamically Resize', 'youtube-embed' ) . '</td><td><select name="' . $field_name . '" id="' . $field_id . '"><option value=""';
|
74 |
-
if ( attribute_escape( $instance[ 'dynamic' ] ) == '' ) { echo " selected='selected'"; }
|
75 |
-
echo '>' . __( 'Profile default', 'youtube-embed' ) . '</option><option value="0"';
|
76 |
-
if ( attribute_escape( $instance[ 'dynamic' ] ) == '0' ) { echo " selected='selected'"; }
|
77 |
-
echo '>' . __( 'No', 'youtube-embed' ) . '</option><option value="1"';
|
78 |
-
if ( attribute_escape( $instance[ 'dynamic' ] ) == '1' ) { echo " selected='selected'"; }
|
79 |
-
echo '>' . __( 'Yes', 'youtube-embed' ) . '</option></select></td></tr>';
|
80 |
-
|
81 |
-
// Embed type field
|
82 |
-
|
83 |
-
$field_id = $this -> get_field_id( 'type' );
|
84 |
-
$field_name = $this -> get_field_name( 'type' );
|
85 |
-
echo "\r\n" . '<tr><td width="100%">' . __( 'Embed Type', 'youtube-embed' ) . '</td><td><select name="' . $field_name . '" id="' . $field_id . '"><option value=""';
|
86 |
-
if ( attribute_escape( $instance[ 'type' ] ) == '' ) { echo " selected='selected'"; }
|
87 |
-
echo '>' . __( 'Profile default', 'youtube-embed' ) . '</option><option value="v"';
|
88 |
-
if ( attribute_escape( $instance[ 'type' ] ) == 'v' ) { echo " selected='selected'"; }
|
89 |
-
echo '>' . __( 'IFRAME', 'youtube-embed' ) . '</option><option value="p"';
|
90 |
-
if ( attribute_escape( $instance[ 'type' ] ) == 'p' ) { echo " selected='selected'"; }
|
91 |
-
echo '>' . __( 'OBJECT', 'youtube-embed' ) . '</option><option value="m"';
|
92 |
-
if ( attribute_escape( $instance[ 'type' ] ) == 'c' ) { echo " selected='selected'"; }
|
93 |
-
echo '>' . __( 'Chromeless', 'youtube-embed' ) . '</option><option value="c"';
|
94 |
-
if ( attribute_escape( $instance[ 'type' ] ) == 'm' ) { echo " selected='selected'"; }
|
95 |
-
echo '>' . __( 'EmbedPlus', 'youtube-embed' ) . '</option></select></td></tr>';
|
96 |
-
|
97 |
-
// Autoplay field
|
98 |
-
|
99 |
-
$field_id = $this -> get_field_id( 'autoplay' );
|
100 |
-
$field_name = $this -> get_field_name( 'autoplay' );
|
101 |
-
echo "\r\n" . '<tr><td width="100%">' . __( 'Autoplay', 'youtube-embed' ) . '</td><td><select name="' . $field_name . '" id="' . $field_id . '"><option value=""';
|
102 |
-
if ( attribute_escape( $instance[ 'autoplay' ] ) == '' ) { echo " selected='selected'"; }
|
103 |
-
echo '>' . __( 'Profile default', 'youtube-embed' ) . '</option><option value="0"';
|
104 |
-
if ( attribute_escape( $instance[ 'autoplay' ] ) == '0' ) { echo " selected='selected'"; }
|
105 |
-
echo '>' . __( 'No', 'youtube-embed' ) . '</option><option value="1"';
|
106 |
-
if ( attribute_escape( $instance[ 'autoplay' ] ) == '1' ) { echo " selected='selected'"; }
|
107 |
-
echo '>' . __( 'Yes', 'youtube-embed' ) . '</option></select></td></tr>';
|
108 |
-
|
109 |
-
// Start field
|
110 |
-
|
111 |
-
$field_id = $this -> get_field_id( 'start' );
|
112 |
-
$field_name = $this -> get_field_name( 'start' );
|
113 |
-
echo "\r\n" . '<tr><td width="100%">' . __( 'Start (seconds)', 'youtube-embed' ) . '</td><td><input type="text" size="3" maxlength="3" id="' . $field_id . '" name="' . $field_name . '" value="' . attribute_escape( $instance[ 'start' ] ) . '" /></td></tr>';
|
114 |
-
|
115 |
-
// Stop field
|
116 |
-
|
117 |
-
$field_id = $this -> get_field_id( 'stop' );
|
118 |
-
$field_name = $this -> get_field_name( 'stop' );
|
119 |
-
echo "\r\n" . '<tr><td width="100%">' . __( 'Stop (seconds)', 'youtube-embed' ) . '</td><td><input type="text" size="3" maxlength="3" id="' . $field_id . '" name="' . $field_name . '" value="' . attribute_escape( $instance[ 'stop' ] ) . '" /></td></tr>';
|
120 |
-
|
121 |
-
echo "</table>\n";
|
122 |
-
|
123 |
-
?>
|
124 |
-
<h4><?php _e( 'Non-EmbedPlus Options', 'youtube-embed' ); ?></h4>
|
125 |
-
<?php
|
126 |
-
|
127 |
-
echo "<table>\n";
|
128 |
-
|
129 |
-
// List field
|
130 |
-
|
131 |
-
$field_id = $this -> get_field_id( 'list' );
|
132 |
-
$field_name = $this -> get_field_name( 'list' );
|
133 |
-
echo "\r\n" . '<tr><td width="100%">' . __( 'List Playback', 'youtube-embed' ) . '</td><td><select name="' . $field_name . '" id="' . $field_id . '"><option value=""';
|
134 |
-
if ( attribute_escape( $instance[ 'list' ] ) == '' ) { echo " selected='selected'"; }
|
135 |
-
echo '>' . __( 'Profile default', 'youtube-embed' ) . '</option><option value="order"';
|
136 |
-
if ( attribute_escape( $instance[ 'list' ] ) == 'order' ) { echo " selected='selected'"; }
|
137 |
-
echo '>' . __( 'Play each video in order', 'youtube-embed' ) . '</option><option value="random"';
|
138 |
-
if ( attribute_escape( $instance[ 'list' ] ) == 'random' ) { echo " selected='selected'"; }
|
139 |
-
echo '>' . __( 'Play videos randomly', 'youtube-embed' ) . '</option><option value="single"';
|
140 |
-
if ( attribute_escape( $instance[ 'list' ] ) == 'single' ) { echo " selected='selected'"; }
|
141 |
-
echo '>' . __( 'Play one random video', 'youtube-embed' ) . '</option></select></td></tr>';
|
142 |
-
|
143 |
-
// Loop video field
|
144 |
-
|
145 |
-
$field_id = $this -> get_field_id( 'loop' );
|
146 |
-
$field_name = $this -> get_field_name( 'loop' );
|
147 |
-
echo "\r\n" . '<tr><td width="100%">' . __( 'Loop Video', 'youtube-embed' ) . '</td><td><select name="' . $field_name . '" id="' . $field_id . '"><option value=""';
|
148 |
-
if ( attribute_escape( $instance[ 'loop' ] ) == '' ) { echo " selected='selected'"; }
|
149 |
-
echo '>' . __( 'Profile default', 'youtube-embed' ) . '</option><option value="0"';
|
150 |
-
if ( attribute_escape( $instance[ 'loop' ] ) == '0' ) { echo " selected='selected'"; }
|
151 |
-
echo '>' . __( 'No', 'youtube-embed' ) . '</option><option value="1"';
|
152 |
-
if ( attribute_escape( $instance[ 'loop' ] ) == '1' ) { echo " selected='selected'"; }
|
153 |
-
echo '>' . __( 'Yes', 'youtube-embed' ) . '</option></select></td></tr>';
|
154 |
-
|
155 |
-
echo "</table>\n";
|
156 |
-
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/set-defaults.php
DELETED
@@ -1,286 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Set Default Options
|
4 |
-
*
|
5 |
-
* Set up default values for the various options
|
6 |
-
*
|
7 |
-
* @package YouTube-Embed
|
8 |
-
*/
|
9 |
-
|
10 |
-
/**
|
11 |
-
* Function to set Shortcode option
|
12 |
-
*
|
13 |
-
* Looks up shortcode option - if it's not set, assign a default
|
14 |
-
*
|
15 |
-
* @since 2.0
|
16 |
-
*
|
17 |
-
* @return string Alternative Shortcode
|
18 |
-
*/
|
19 |
-
|
20 |
-
function vye_set_shortcode_option() {
|
21 |
-
|
22 |
-
$shortcode = get_option( 'youtube_embed_shortcode' );
|
23 |
-
|
24 |
-
// If setting doesn't exist, set defaults
|
25 |
-
|
26 |
-
if ( $shortcode == '' ) {
|
27 |
-
$shortcode[ 1 ] = 'youtube_video';
|
28 |
-
$shortcode[ 2 ] = '';
|
29 |
-
update_option( 'youtube_embed_shortcode', $shortcode );
|
30 |
-
}
|
31 |
-
|
32 |
-
return $shortcode;
|
33 |
-
}
|
34 |
-
|
35 |
-
/**
|
36 |
-
* Function to set URL option
|
37 |
-
*
|
38 |
-
* Looks up URL option - if it's not set, override the WP URL embedding
|
39 |
-
*
|
40 |
-
* @since 2.0
|
41 |
-
*
|
42 |
-
* @return string URL override
|
43 |
-
*/
|
44 |
-
|
45 |
-
function vye_set_url_option() {
|
46 |
-
|
47 |
-
$url = get_option( 'youtube_embed_url' );
|
48 |
-
|
49 |
-
// If setting doesn't exist, set defaults
|
50 |
-
|
51 |
-
if ( $url == '' ) { update_option( 'youtube_embed_url', '' ); }
|
52 |
-
|
53 |
-
return $url;
|
54 |
-
}
|
55 |
-
|
56 |
-
/**
|
57 |
-
* Function to set editor button shortcode
|
58 |
-
*
|
59 |
-
* Looks up editor button shortcode - sets it if not set-up
|
60 |
-
* Ensures matching cookie is in place
|
61 |
-
*
|
62 |
-
* @since 2.6
|
63 |
-
*
|
64 |
-
* @return string Editor shortcode
|
65 |
-
*/
|
66 |
-
|
67 |
-
function vye_set_editor_sc() {
|
68 |
-
|
69 |
-
$editor_sc = get_option( 'youtube_embed_editor_sc' );
|
70 |
-
|
71 |
-
// If setting doesn't exist, set defaults
|
72 |
-
|
73 |
-
if ( $editor_sc == '' ) { update_option( 'youtube_embed_editor_sc', 'youtube' ); }
|
74 |
-
|
75 |
-
// Return the shortcode
|
76 |
-
|
77 |
-
return $editor_sc;
|
78 |
-
}
|
79 |
-
|
80 |
-
|
81 |
-
/**
|
82 |
-
* Function to set general YouTube options
|
83 |
-
*
|
84 |
-
* Looks up options. If none exist, or some are missing, set default values
|
85 |
-
*
|
86 |
-
* @since 2.0
|
87 |
-
*
|
88 |
-
* @return strings Options array
|
89 |
-
*/
|
90 |
-
|
91 |
-
function vye_set_general_defaults() {
|
92 |
-
|
93 |
-
$options = get_option( 'youtube_embed_general' );
|
94 |
-
$changed = false;
|
95 |
-
$default_error = '<p>' . __( 'The video cannot be shown at the moment. Please try again later.', 'youtube-embed' ) . '</p>';
|
96 |
-
|
97 |
-
// If the old options exist, import them and then delete them
|
98 |
-
|
99 |
-
if ( !is_array( $options ) ) {
|
100 |
-
if ( get_option( 'youtube_embed_editor' ) ) {
|
101 |
-
$old_opts = get_option( 'youtube_embed_editor' );
|
102 |
-
$options[ 'editor_button' ] = $old_opts[ 'youtube' ];
|
103 |
-
delete_option( 'youtube_embed_editor' );
|
104 |
-
$changed = true;
|
105 |
-
} else {
|
106 |
-
$options = array();
|
107 |
-
}
|
108 |
-
}
|
109 |
-
|
110 |
-
// Set current version level. Because this can be used to detect version changes (and to what extent), this information may be useful in future upgrades
|
111 |
-
|
112 |
-
$version_change = false;
|
113 |
-
if ( array_key_exists( 'editor_button', $options ) ) {
|
114 |
-
if ( $options[ 'current_version' ] != youtube_embed_version ) {
|
115 |
-
$version_change = true;
|
116 |
-
}
|
117 |
-
$version_change = true;
|
118 |
-
}
|
119 |
-
|
120 |
-
if ( $version_change ) {
|
121 |
-
$options[ 'current_version' ] = youtube_embed_version;
|
122 |
-
$changed = true;
|
123 |
-
}
|
124 |
-
|
125 |
-
// Because of upgrading, check each option - if not set, apply default
|
126 |
-
|
127 |
-
if ( !array_key_exists( 'editor_button', $options ) ) { $options[ 'editor_button' ] = 1; $changed = true; }
|
128 |
-
if ( !array_key_exists( 'admin_bar', $options ) ) { $options[ 'admin_bar' ] = 1; $changed = true; }
|
129 |
-
if ( !array_key_exists( 'profile_no', $options ) ) { $options[ 'profile_no' ] = 5; $changed = true; }
|
130 |
-
if ( !array_key_exists( 'list_no', $options ) ) { $options[ 'list_no' ] = 5; $changed = true; }
|
131 |
-
if ( !array_key_exists( 'info_cache', $options ) ) { $options[ 'info_cache' ] = 1; $changed = true; }
|
132 |
-
if ( !array_key_exists( 'embed_cache', $options ) ) { $options[ 'embed_cache' ] = 24; $changed = true; }
|
133 |
-
if ( !array_key_exists( 'transcript_cache', $options ) ) { $options[ 'transcript_cache' ] = 24; $changed = true; }
|
134 |
-
if ( !array_key_exists( 'comments_cache', $options ) ) { $options[ 'comments_cache' ] = 60; $changed = true; }
|
135 |
-
if ( !array_key_exists( 'alt_profile', $options ) ) { $options[ 'alt_profile' ] = 0; $changed = true; }
|
136 |
-
if ( !array_key_exists( 'alt_profile2', $options ) ) { $options[ 'alt_profile2' ] = 0; $changed = true; }
|
137 |
-
if ( !array_key_exists( 'bracket', $options ) ) { $options[ 'bracket' ] = ''; $changed = true; }
|
138 |
-
if ( !array_key_exists( 'alt', $options ) ) { $options[ 'alt' ] = 0; $changed = true; }
|
139 |
-
if ( !array_key_exists( 'other_profile', $options ) ) { $options[ 'other_profile' ] = 0; $changed = true; }
|
140 |
-
if ( !array_key_exists( 'comments', $options ) ) { $options[ 'comments' ] = ''; $changed = true; }
|
141 |
-
if ( !array_key_exists( 'comments_profile', $options ) ) { $options[ 'comments_profile' ] = 0; $changed = true; }
|
142 |
-
if ( !array_key_exists( 'metadata', $options ) ) { $options[ 'metadata' ] = 1; $changed = true; }
|
143 |
-
if ( !array_key_exists( 'feed', $options ) ) { $options[ 'feed' ] = 'b'; $changed = true; }
|
144 |
-
if ( !array_key_exists( 'error_message', $options ) ) { $options[ 'error_message' ] = $default_error; $changed = true; }
|
145 |
-
if ( !array_key_exists( 'thumbnail', $options ) ) { $options[ 'thumbnail' ] = 2; $changed = true; }
|
146 |
-
if ( !array_key_exists( 'privacy', $options ) ) { $options[ 'privacy' ] = 0; $changed = true; }
|
147 |
-
if ( !array_key_exists( 'frameborder', $options ) ) { $options[ 'frameborder' ] = 1; $changed = true; }
|
148 |
-
if ( !array_key_exists( 'widgets', $options ) ) { $options[ 'widgets' ] = 0; $changed = true; }
|
149 |
-
if ( !array_key_exists( 'menu_access', $options ) ) { $options[ 'menu_access' ] = 'list_users'; $changed = true; }
|
150 |
-
|
151 |
-
// Update the options, if changed, and return the result
|
152 |
-
|
153 |
-
if ( $changed ) { update_option( 'youtube_embed_general', $options ); }
|
154 |
-
return $options;
|
155 |
-
}
|
156 |
-
|
157 |
-
/**
|
158 |
-
* Function to set YouTube profile options
|
159 |
-
*
|
160 |
-
* Looks up profile options, based on passed profile numer.
|
161 |
-
* If none exist, or some are missing, set default values
|
162 |
-
*
|
163 |
-
* @since 2.0
|
164 |
-
*
|
165 |
-
* @param string $profile Profile number
|
166 |
-
* @return string Options array
|
167 |
-
*/
|
168 |
-
|
169 |
-
function vye_set_profile_defaults( $profile ) {
|
170 |
-
|
171 |
-
if ( $profile == 0 ) {
|
172 |
-
$profname = 'Default';
|
173 |
-
} else {
|
174 |
-
$profname = 'Profile ' . $profile;
|
175 |
-
}
|
176 |
-
$options = get_option( 'youtube_embed_profile' . $profile );
|
177 |
-
|
178 |
-
$changed = false;
|
179 |
-
$new_user = false;
|
180 |
-
|
181 |
-
// Work out default dimensions
|
182 |
-
|
183 |
-
$width = 0;
|
184 |
-
if ( isset( $content_width ) ) { $width = $content_width; }
|
185 |
-
if ( ( $width == 0 ) or ( $width == '' ) ) { $width = 560; }
|
186 |
-
$height = 25 + round( ( $width / 16 ) * 9, 0 );
|
187 |
-
|
188 |
-
// If the old options exist, import them and then delete them
|
189 |
-
|
190 |
-
if ( !is_array( $options ) ) {
|
191 |
-
if ( ( $profile == 0 ) && ( get_option( 'youtube_embed' ) ) ) {
|
192 |
-
$old_opts = get_option( 'youtube_embed' );
|
193 |
-
$options = $old_opts;
|
194 |
-
delete_option( 'youtube_embed' );
|
195 |
-
$changed = true;
|
196 |
-
} else {
|
197 |
-
$options = array();
|
198 |
-
}
|
199 |
-
}
|
200 |
-
|
201 |
-
// Because of upgrading, check each option - if not set, apply default
|
202 |
-
|
203 |
-
if ( !array_key_exists( 'name', $options ) ) { $options[ 'name' ] = $profname; $changed = true; }
|
204 |
-
|
205 |
-
if ( !array_key_exists( 'width', $options ) ) {
|
206 |
-
$options[ 'width' ] = $width;
|
207 |
-
$options[ 'height' ] = $height;
|
208 |
-
$changed = true;
|
209 |
-
}
|
210 |
-
if ( !array_key_exists( 'height', $options ) ) { $options[ 'height' ] = 340; $changed = true; }
|
211 |
-
if ( !array_key_exists( 'fullscreen', $options ) ) { $options[ 'fullscreen' ] = ''; $changed = true; }
|
212 |
-
if ( !array_key_exists( 'template', $options ) ) { $options[ 'template' ] = '%video%'; $changed = true; }
|
213 |
-
if ( !array_key_exists( 'autoplay', $options ) ) { $options[ 'autoplay' ] = ''; $changed = true; }
|
214 |
-
if ( !array_key_exists( 'start', $options ) ) { $options[ 'start' ] = 0; $changed = true; }
|
215 |
-
if ( !array_key_exists( 'loop', $options ) ) { $options[ 'loop' ] = ''; $changed = true; }
|
216 |
-
if ( !array_key_exists( 'cc', $options ) ) { $options[ 'cc' ] = ''; $changed = true; }
|
217 |
-
if ( !array_key_exists( 'annotation', $options ) ) { $options[ 'annotation' ] = 1; $changed = true; }
|
218 |
-
if ( !array_key_exists( 'related', $options ) ) { $options[ 'related' ] = ''; $changed = true; }
|
219 |
-
if ( !array_key_exists( 'info', $options ) ) { $options[ 'info' ] = 1; $changed = true; }
|
220 |
-
if ( !array_key_exists( 'link', $options ) ) { $options[ 'link' ] = 1; $changed = true; }
|
221 |
-
if ( !array_key_exists( 'react', $options ) ) { $options[ 'react' ] = 1; $changed = true; }
|
222 |
-
if ( !array_key_exists( 'stop', $options ) ) { $options[ 'stop' ] = 0; $changed = true; }
|
223 |
-
if ( !array_key_exists( 'sweetspot', $options ) ) { $options[ 'sweetspot' ] = 1; $changed = true; }
|
224 |
-
if ( !array_key_exists( 'type', $options ) ) { $options[ 'type' ] = 'v'; $changed = true; }
|
225 |
-
if ( !array_key_exists( 'disablekb', $options ) ) { $options[ 'disablekb' ] = ''; $changed = true; }
|
226 |
-
if ( !array_key_exists( 'autohide', $options ) ) { $options[ 'autohide' ] = 2; $changed = true; }
|
227 |
-
if ( !array_key_exists( 'controls', $options ) ) { $options[ 'controls' ] = 1; $changed = true; }
|
228 |
-
if ( !array_key_exists( 'playlist', $options ) ) { $options[ 'playlist' ] = 'v'; $changed = true; }
|
229 |
-
if ( !array_key_exists( 'fallback', $options ) ) { $options[ 'fallback' ] = 'v'; $changed = true; }
|
230 |
-
if ( !array_key_exists( 'wmode', $options ) ) { $options[ 'wmode' ] = 'window'; $changed = true; }
|
231 |
-
if ( !array_key_exists( 'audio', $options ) ) { $options[ 'audio' ] = ''; $changed = true; }
|
232 |
-
if ( !array_key_exists( 'hd', $options ) ) { $options[ 'hd' ] = 1; $changed = true; }
|
233 |
-
if ( !array_key_exists( 'style', $options ) ) { $options[ 'style' ] = ''; $changed = true; }
|
234 |
-
if ( !array_key_exists( 'color', $options ) ) { $options[ 'color' ] = 'red'; $changed = true; }
|
235 |
-
if ( !array_key_exists( 'theme', $options ) ) { $options[ 'theme' ] = 'dark'; $changed = true; }
|
236 |
-
if ( !array_key_exists( 'https', $options ) ) { $options[ 'https' ] = 0; $changed = true; }
|
237 |
-
if ( !array_key_exists( 'modest', $options ) ) { $options[ 'modest' ] = 1; $changed = true; }
|
238 |
-
if ( !array_key_exists( 'dynamic', $options ) ) { $options[ 'dynamic' ] = ''; $changed = true; }
|
239 |
-
if ( !array_key_exists( 'fixed', $options ) ) { $options[ 'fixed' ] = ''; $changed = true; }
|
240 |
-
if ( !array_key_exists( 'download', $options ) ) { $options[ 'download' ] = ''; $changed = true; }
|
241 |
-
if ( !array_key_exists( 'download_style', $options ) ) { $options[ 'download_style' ] = ''; $changed = true; }
|
242 |
-
if ( !array_key_exists( 'download_text', $options ) ) { $options[ 'download_text' ] = 'Click here to download the video'; $changed = true; }
|
243 |
-
if ( !array_key_exists( 'vq', $options ) ) { $options[ 'vq' ] = ''; $changed = true; }
|
244 |
-
|
245 |
-
// Update the options, if changed, and return the result
|
246 |
-
|
247 |
-
if ( $changed ) { update_option( 'youtube_embed_profile' . $profile, $options ); }
|
248 |
-
|
249 |
-
// Remove added slashes from template XHTML
|
250 |
-
|
251 |
-
$options[ 'template' ] = stripslashes( $options[ 'template' ] );
|
252 |
-
|
253 |
-
return $options;
|
254 |
-
}
|
255 |
-
|
256 |
-
/**
|
257 |
-
* Function to set default list options
|
258 |
-
*
|
259 |
-
* Looks up list options, based on passed list number.
|
260 |
-
* If none exist, or some are missing, set default values
|
261 |
-
*
|
262 |
-
* @since 2.0
|
263 |
-
*
|
264 |
-
* @param string $list List number
|
265 |
-
* @return string Options array
|
266 |
-
*/
|
267 |
-
|
268 |
-
function vye_set_list_defaults( $list ) {
|
269 |
-
$options = get_option( 'youtube_embed_list' . $list );
|
270 |
-
$changed = false;
|
271 |
-
|
272 |
-
// If array doesn't exist create an empty one
|
273 |
-
|
274 |
-
if ( !is_array( $options ) ) { $options = array(); }
|
275 |
-
|
276 |
-
// Because of upgrading, check each option - if not set, apply default
|
277 |
-
|
278 |
-
if ( !array_key_exists( 'name',$options ) ) { $options[ 'name' ] = 'List ' . $list; $changed = true; }
|
279 |
-
if ( !array_key_exists( 'list',$options ) ) { $options[ 'list' ] = ''; $changed = true; }
|
280 |
-
|
281 |
-
// Update the options, if changed, and return the result
|
282 |
-
|
283 |
-
if ( $changed ) { update_option( 'youtube_embed_list' . $list, $options ); }
|
284 |
-
return $options;
|
285 |
-
}
|
286 |
-
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/shared-functions.php
CHANGED
@@ -164,66 +164,30 @@ function vye_extract_id( $id ) {
|
|
164 |
/**
|
165 |
* Validate video type
|
166 |
*
|
167 |
-
* Function to work out what type of video has been requested
|
168 |
-
* whether it is valid. Also fetches the video title.
|
169 |
*
|
170 |
* @since 2.0
|
171 |
*
|
172 |
-
* @uses vye_set_general_defaults Get the default settings
|
173 |
-
*
|
174 |
* @param string $id Video ID
|
175 |
-
* @param string $title_needed Whether the title requires extracting
|
176 |
* @return string Array containing file details
|
177 |
*/
|
178 |
|
179 |
-
function vye_validate_id( $id
|
180 |
-
|
181 |
-
$type = false;
|
182 |
-
$title = false;
|
183 |
-
$options = false;
|
184 |
-
|
185 |
-
$options = vye_set_general_defaults();
|
186 |
-
|
187 |
-
// Attempt to get the video type and title from cache
|
188 |
-
|
189 |
-
if ( $options[ 'info_cache' ] != 0 ) {
|
190 |
-
$type = get_transient( 'vye_type_' . $id );
|
191 |
-
$title = get_transient( 'vye_title_' . $id );
|
192 |
-
}
|
193 |
-
|
194 |
-
// Check if items are cached
|
195 |
|
196 |
-
$
|
197 |
-
if ( (
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
$type = '';
|
204 |
-
if ( strtolower( substr( $id, 0, 2 ) ) == 'pl') {
|
205 |
-
$type = 'p';
|
206 |
} else {
|
207 |
-
if ( strlen( $id ) ==
|
208 |
-
$type = '
|
209 |
-
} else {
|
210 |
-
if ( strlen( $id ) == 16 ) {
|
211 |
-
$type = 'p';
|
212 |
-
}
|
213 |
}
|
214 |
}
|
215 |
-
|
216 |
-
// Update the cache
|
217 |
-
|
218 |
-
set_transient( 'vye_type_' . $id, $type, $options[ 'info_cache' ] * 3600 );
|
219 |
-
|
220 |
}
|
221 |
|
222 |
-
|
223 |
-
|
224 |
-
$return[ 'type' ] = $type;
|
225 |
-
$return[ 'title' ] = $title;
|
226 |
-
return $return;
|
227 |
}
|
228 |
|
229 |
/**
|
@@ -356,33 +320,6 @@ function vye_get_file( $filein, $header = false ) {
|
|
356 |
return $file_return;
|
357 |
}
|
358 |
|
359 |
-
/**
|
360 |
-
* Function to set embed type
|
361 |
-
*
|
362 |
-
* Depending on embed parameters set a value
|
363 |
-
*
|
364 |
-
* @since 2.0
|
365 |
-
*
|
366 |
-
* @uses vye_convert Convert value to a 0 or 1 equivalent
|
367 |
-
*
|
368 |
-
* @param string $type Current embed type
|
369 |
-
* @param string $embedplus Whether EmbedPlus embedding is required
|
370 |
-
* @return string The type of embedding to use
|
371 |
-
*/
|
372 |
-
|
373 |
-
function vye_get_embed_type( $type, $embedplus ) {
|
374 |
-
|
375 |
-
$embedplus = vye_convert( $embedplus );
|
376 |
-
$type = strtolower( $type );
|
377 |
-
|
378 |
-
if ( ( $type == 'embedplus' ) or ( $embedplus == '1' ) ) { $type = 'm'; }
|
379 |
-
if ( $type == 'iframe' ) { $type = 'v'; }
|
380 |
-
if ( $type == 'object' ) { $type = 'p'; }
|
381 |
-
if ( $type == 'chromeless' ) { $type = 'c'; }
|
382 |
-
|
383 |
-
return $type;
|
384 |
-
}
|
385 |
-
|
386 |
/**
|
387 |
* Convert autohide parameter
|
388 |
*
|
@@ -480,4 +417,208 @@ function vye_extract_xml( $input, $tag ) {
|
|
480 |
|
481 |
return $field;
|
482 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
483 |
?>
|
164 |
/**
|
165 |
* Validate video type
|
166 |
*
|
167 |
+
* Function to work out what type of video has been requested.
|
|
|
168 |
*
|
169 |
* @since 2.0
|
170 |
*
|
|
|
|
|
171 |
* @param string $id Video ID
|
|
|
172 |
* @return string Array containing file details
|
173 |
*/
|
174 |
|
175 |
+
function vye_validate_id( $id ) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
176 |
|
177 |
+
$type = '';
|
178 |
+
if ( strtolower( substr( $id, 0, 2 ) ) == 'pl') {
|
179 |
+
$type = 'p';
|
180 |
+
} else {
|
181 |
+
if ( strlen( $id ) == 11 ) {
|
182 |
+
$type = 'v';
|
|
|
|
|
|
|
|
|
183 |
} else {
|
184 |
+
if ( strlen( $id ) == 16 ) {
|
185 |
+
$type = 'p';
|
|
|
|
|
|
|
|
|
186 |
}
|
187 |
}
|
|
|
|
|
|
|
|
|
|
|
188 |
}
|
189 |
|
190 |
+
return $type;
|
|
|
|
|
|
|
|
|
191 |
}
|
192 |
|
193 |
/**
|
320 |
return $file_return;
|
321 |
}
|
322 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
323 |
/**
|
324 |
* Convert autohide parameter
|
325 |
*
|
417 |
|
418 |
return $field;
|
419 |
}
|
420 |
+
|
421 |
+
/**
|
422 |
+
* Function to set Shortcode option
|
423 |
+
*
|
424 |
+
* Looks up shortcode option - if it's not set, assign a default
|
425 |
+
*
|
426 |
+
* @since 2.0
|
427 |
+
*
|
428 |
+
* @return string Alternative Shortcode
|
429 |
+
*/
|
430 |
+
|
431 |
+
function vye_set_shortcode_option() {
|
432 |
+
|
433 |
+
$shortcode = get_option( 'youtube_embed_shortcode' );
|
434 |
+
|
435 |
+
// If an array, transform to new format
|
436 |
+
|
437 |
+
if ( is_array( $shortcode ) ) {
|
438 |
+
$shortcode = $shortcode[ 1 ];
|
439 |
+
update_option( 'youtube_embed_shortcode', $shortcode );
|
440 |
+
}
|
441 |
+
|
442 |
+
// If setting doesn't exist, set defaults
|
443 |
+
|
444 |
+
if ( $shortcode == '' ) {
|
445 |
+
$shortcode = 'youtube_video';
|
446 |
+
update_option( 'youtube_embed_shortcode', $shortcode );
|
447 |
+
}
|
448 |
+
|
449 |
+
return $shortcode;
|
450 |
+
}
|
451 |
+
|
452 |
+
/**
|
453 |
+
* Function to set general YouTube options
|
454 |
+
*
|
455 |
+
* Looks up options. If none exist, or some are missing, set default values
|
456 |
+
*
|
457 |
+
* @since 2.0
|
458 |
+
*
|
459 |
+
* @return strings Options array
|
460 |
+
*/
|
461 |
+
|
462 |
+
function vye_set_general_defaults() {
|
463 |
+
|
464 |
+
$options = get_option( 'youtube_embed_general' );
|
465 |
+
$changed = false;
|
466 |
+
$default_error = '<p>' . __( 'The video cannot be shown at the moment. Please try again later.', 'youtube-embed' ) . '</p>';
|
467 |
+
|
468 |
+
// If the old options exist, import them and then delete them
|
469 |
+
|
470 |
+
if ( !is_array( $options ) ) {
|
471 |
+
if ( get_option( 'youtube_embed_editor' ) ) {
|
472 |
+
$old_opts = get_option( 'youtube_embed_editor' );
|
473 |
+
$options[ 'editor_button' ] = $old_opts[ 'youtube' ];
|
474 |
+
delete_option( 'youtube_embed_editor' );
|
475 |
+
$changed = true;
|
476 |
+
} else {
|
477 |
+
$options = array();
|
478 |
+
}
|
479 |
+
}
|
480 |
+
|
481 |
+
// Because of upgrading, check each option - if not set, apply default
|
482 |
+
|
483 |
+
if ( !array_key_exists( 'editor_button', $options ) ) { $options[ 'editor_button' ] = 1; $changed = true; }
|
484 |
+
if ( !array_key_exists( 'admin_bar', $options ) ) { $options[ 'admin_bar' ] = 1; $changed = true; }
|
485 |
+
if ( !array_key_exists( 'profile_no', $options ) ) { $options[ 'profile_no' ] = 5; $changed = true; }
|
486 |
+
if ( !array_key_exists( 'list_no', $options ) ) { $options[ 'list_no' ] = 5; $changed = true; }
|
487 |
+
if ( !array_key_exists( 'embed_cache', $options ) ) { $options[ 'embed_cache' ] = 24; $changed = true; }
|
488 |
+
if ( !array_key_exists( 'alt_profile', $options ) ) { $options[ 'alt_profile' ] = 0; $changed = true; }
|
489 |
+
if ( !array_key_exists( 'metadata', $options ) ) { $options[ 'metadata' ] = 1; $changed = true; }
|
490 |
+
if ( !array_key_exists( 'feed', $options ) ) { $options[ 'feed' ] = 'b'; $changed = true; }
|
491 |
+
if ( !array_key_exists( 'thumbnail', $options ) ) { $options[ 'thumbnail' ] = 2; $changed = true; }
|
492 |
+
if ( !array_key_exists( 'privacy', $options ) ) { $options[ 'privacy' ] = 0; $changed = true; }
|
493 |
+
if ( !array_key_exists( 'frameborder', $options ) ) { $options[ 'frameborder' ] = 1; $changed = true; }
|
494 |
+
if ( !array_key_exists( 'widgets', $options ) ) { $options[ 'widgets' ] = 0; $changed = true; }
|
495 |
+
if ( !array_key_exists( 'menu_access', $options ) ) { $options[ 'menu_access' ] = 'list_users'; $changed = true; }
|
496 |
+
|
497 |
+
// Update the options, if changed, and return the result
|
498 |
+
|
499 |
+
if ( $changed ) { update_option( 'youtube_embed_general', $options ); }
|
500 |
+
return $options;
|
501 |
+
}
|
502 |
+
|
503 |
+
/**
|
504 |
+
* Function to set YouTube profile options
|
505 |
+
*
|
506 |
+
* Looks up profile options, based on passed profile numer.
|
507 |
+
* If none exist, or some are missing, set default values
|
508 |
+
*
|
509 |
+
* @since 2.0
|
510 |
+
*
|
511 |
+
* @param string $profile Profile number
|
512 |
+
* @return string Options array
|
513 |
+
*/
|
514 |
+
|
515 |
+
function vye_set_profile_defaults( $profile ) {
|
516 |
+
|
517 |
+
if ( $profile == 0 ) {
|
518 |
+
$profname = 'Default';
|
519 |
+
} else {
|
520 |
+
$profname = 'Profile ' . $profile;
|
521 |
+
}
|
522 |
+
$options = get_option( 'youtube_embed_profile' . $profile );
|
523 |
+
|
524 |
+
$changed = false;
|
525 |
+
$new_user = false;
|
526 |
+
|
527 |
+
// Work out default dimensions
|
528 |
+
|
529 |
+
$width = 0;
|
530 |
+
if ( isset( $content_width ) ) { $width = $content_width; }
|
531 |
+
if ( ( $width == 0 ) or ( $width == '' ) ) { $width = 560; }
|
532 |
+
$height = 25 + round( ( $width / 16 ) * 9, 0 );
|
533 |
+
|
534 |
+
// If the old options exist, import them and then delete them
|
535 |
+
|
536 |
+
if ( !is_array( $options ) ) {
|
537 |
+
if ( ( $profile == 0 ) && ( get_option( 'youtube_embed' ) ) ) {
|
538 |
+
$old_opts = get_option( 'youtube_embed' );
|
539 |
+
$options = $old_opts;
|
540 |
+
delete_option( 'youtube_embed' );
|
541 |
+
$changed = true;
|
542 |
+
} else {
|
543 |
+
$options = array();
|
544 |
+
}
|
545 |
+
}
|
546 |
+
|
547 |
+
// Because of upgrading, check each option - if not set, apply default
|
548 |
+
|
549 |
+
if ( !array_key_exists( 'name', $options ) ) { $options[ 'name' ] = $profname; $changed = true; }
|
550 |
+
|
551 |
+
if ( !array_key_exists( 'width', $options ) ) {
|
552 |
+
$options[ 'width' ] = $width;
|
553 |
+
$options[ 'height' ] = $height;
|
554 |
+
$changed = true;
|
555 |
+
}
|
556 |
+
if ( !array_key_exists( 'height', $options ) ) { $options[ 'height' ] = 340; $changed = true; }
|
557 |
+
if ( !array_key_exists( 'fullscreen', $options ) ) { $options[ 'fullscreen' ] = ''; $changed = true; }
|
558 |
+
if ( !array_key_exists( 'template', $options ) ) { $options[ 'template' ] = '%video%'; $changed = true; }
|
559 |
+
if ( !array_key_exists( 'autoplay', $options ) ) { $options[ 'autoplay' ] = ''; $changed = true; }
|
560 |
+
if ( !array_key_exists( 'start', $options ) ) { $options[ 'start' ] = 0; $changed = true; }
|
561 |
+
if ( !array_key_exists( 'loop', $options ) ) { $options[ 'loop' ] = ''; $changed = true; }
|
562 |
+
if ( !array_key_exists( 'cc', $options ) ) { $options[ 'cc' ] = ''; $changed = true; }
|
563 |
+
if ( !array_key_exists( 'annotation', $options ) ) { $options[ 'annotation' ] = 1; $changed = true; }
|
564 |
+
if ( !array_key_exists( 'related', $options ) ) { $options[ 'related' ] = ''; $changed = true; }
|
565 |
+
if ( !array_key_exists( 'info', $options ) ) { $options[ 'info' ] = 1; $changed = true; }
|
566 |
+
if ( !array_key_exists( 'stop', $options ) ) { $options[ 'stop' ] = 0; $changed = true; }
|
567 |
+
if ( !array_key_exists( 'type', $options ) ) { $options[ 'type' ] = 'v'; $changed = true; }
|
568 |
+
if ( !array_key_exists( 'disablekb', $options ) ) { $options[ 'disablekb' ] = ''; $changed = true; }
|
569 |
+
if ( !array_key_exists( 'autohide', $options ) ) { $options[ 'autohide' ] = 2; $changed = true; }
|
570 |
+
if ( !array_key_exists( 'controls', $options ) ) { $options[ 'controls' ] = 1; $changed = true; }
|
571 |
+
if ( !array_key_exists( 'wmode', $options ) ) { $options[ 'wmode' ] = 'window'; $changed = true; }
|
572 |
+
if ( !array_key_exists( 'style', $options ) ) { $options[ 'style' ] = ''; $changed = true; }
|
573 |
+
if ( !array_key_exists( 'color', $options ) ) { $options[ 'color' ] = 'red'; $changed = true; }
|
574 |
+
if ( !array_key_exists( 'theme', $options ) ) { $options[ 'theme' ] = 'dark'; $changed = true; }
|
575 |
+
if ( !array_key_exists( 'https', $options ) ) { $options[ 'https' ] = 0; $changed = true; }
|
576 |
+
if ( !array_key_exists( 'modest', $options ) ) { $options[ 'modest' ] = 1; $changed = true; }
|
577 |
+
if ( !array_key_exists( 'dynamic', $options ) ) { $options[ 'dynamic' ] = ''; $changed = true; }
|
578 |
+
if ( !array_key_exists( 'fixed', $options ) ) { $options[ 'fixed' ] = ''; $changed = true; }
|
579 |
+
if ( !array_key_exists( 'download', $options ) ) { $options[ 'download' ] = ''; $changed = true; }
|
580 |
+
if ( !array_key_exists( 'download_style', $options ) ) { $options[ 'download_style' ] = ''; $changed = true; }
|
581 |
+
if ( !array_key_exists( 'download_text', $options ) ) { $options[ 'download_text' ] = 'Click here to download the video'; $changed = true; }
|
582 |
+
|
583 |
+
// Update the options, if changed, and return the result
|
584 |
+
|
585 |
+
if ( $changed ) { update_option( 'youtube_embed_profile' . $profile, $options ); }
|
586 |
+
|
587 |
+
// Remove added slashes from template XHTML
|
588 |
+
|
589 |
+
$options[ 'template' ] = stripslashes( $options[ 'template' ] );
|
590 |
+
|
591 |
+
return $options;
|
592 |
+
}
|
593 |
+
|
594 |
+
/**
|
595 |
+
* Function to set default list options
|
596 |
+
*
|
597 |
+
* Looks up list options, based on passed list number.
|
598 |
+
* If none exist, or some are missing, set default values
|
599 |
+
*
|
600 |
+
* @since 2.0
|
601 |
+
*
|
602 |
+
* @param string $list List number
|
603 |
+
* @return string Options array
|
604 |
+
*/
|
605 |
+
|
606 |
+
function vye_set_list_defaults( $list ) {
|
607 |
+
$options = get_option( 'youtube_embed_list' . $list );
|
608 |
+
$changed = false;
|
609 |
+
|
610 |
+
// If array doesn't exist create an empty one
|
611 |
+
|
612 |
+
if ( !is_array( $options ) ) { $options = array(); }
|
613 |
+
|
614 |
+
// Because of upgrading, check each option - if not set, apply default
|
615 |
+
|
616 |
+
if ( !array_key_exists( 'name',$options ) ) { $options[ 'name' ] = 'List ' . $list; $changed = true; }
|
617 |
+
if ( !array_key_exists( 'list',$options ) ) { $options[ 'list' ] = ''; $changed = true; }
|
618 |
+
|
619 |
+
// Update the options, if changed, and return the result
|
620 |
+
|
621 |
+
if ( $changed ) { update_option( 'youtube_embed_list' . $list, $options ); }
|
622 |
+
return $options;
|
623 |
+
}
|
624 |
?>
|
includes/shortcodes.php
CHANGED
@@ -42,30 +42,11 @@ add_shortcode( 'youtube', 'vye_video_shortcode_default' );
|
|
42 |
* @return string YouTube embed code
|
43 |
*/
|
44 |
|
45 |
-
function
|
46 |
-
return do_shortcode( vye_video_shortcode( $paras, $content, '',
|
47 |
}
|
48 |
$shortcode = vye_set_shortcode_option();
|
49 |
-
if ( $shortcode
|
50 |
-
|
51 |
-
/**
|
52 |
-
* Alternative Video shortcode 2
|
53 |
-
*
|
54 |
-
* 2nd alternative shortcode to display video
|
55 |
-
*
|
56 |
-
* @since 2.0
|
57 |
-
*
|
58 |
-
* @uses vye_video_shortcode Action the shortcode parameters
|
59 |
-
*
|
60 |
-
* @param string $paras Shortcode parameters
|
61 |
-
* @param string $content Shortcode content
|
62 |
-
* @return string YouTube embed code
|
63 |
-
*/
|
64 |
-
|
65 |
-
function vye_video_shortcode_alt2( $paras = '', $content = '' ) {
|
66 |
-
return do_shortcode( vye_video_shortcode( $paras, $content, '', 2 ) );
|
67 |
-
}
|
68 |
-
if ( $shortcode[ 2 ] != '' ) { add_shortcode( $shortcode[ 2 ], 'vye_video_shortcode_alt2' ); }
|
69 |
|
70 |
/**
|
71 |
* Video shortcode
|
@@ -85,22 +66,18 @@ if ( $shortcode[ 2 ] != '' ) { add_shortcode( $shortcode[ 2 ], 'vye_video_shortc
|
|
85 |
* @return string YouTube embed code
|
86 |
*/
|
87 |
|
88 |
-
function vye_video_shortcode( $paras = '', $content = '', $callback = '', $alt_shortcode =
|
89 |
|
90 |
-
extract( shortcode_atts( array( '
|
91 |
|
92 |
// If no profile specified and an alternative shortcode used, get that shortcodes default profile
|
93 |
|
94 |
-
if ( ( $profile == '' ) && ( $alt_shortcode
|
95 |
-
|
96 |
-
// Profile is now blank or 2
|
97 |
-
|
98 |
-
if ( $alt_shortcode == '1' ) { $alt_shortcode = ''; }
|
99 |
|
100 |
// Get general options
|
101 |
|
102 |
$options = vye_set_general_defaults();
|
103 |
-
$profile = $options[ 'alt_profile'
|
104 |
}
|
105 |
|
106 |
// If an alternative field is set, use it
|
@@ -132,17 +109,13 @@ function vye_video_shortcode( $paras = '', $content = '', $callback = '', $alt_s
|
|
132 |
}
|
133 |
}
|
134 |
|
135 |
-
// Get Embed type
|
136 |
-
|
137 |
-
$type = vye_get_embed_type( $type, $embedplus );
|
138 |
-
|
139 |
// Set up Autohide parameter
|
140 |
|
141 |
$autohide = vye_set_autohide( $autohide );
|
142 |
|
143 |
// Create YouTube code
|
144 |
|
145 |
-
$youtube_code = vye_generate_youtube_code( $content, $
|
146 |
|
147 |
return do_shortcode( $youtube_code );
|
148 |
}
|
@@ -217,86 +190,4 @@ function vye_video_download( $paras = '', $content = '' ) {
|
|
217 |
}
|
218 |
|
219 |
add_shortcode( 'download_video', 'vye_video_download' );
|
220 |
-
|
221 |
-
/**
|
222 |
-
* Transcript Shortcode
|
223 |
-
*
|
224 |
-
* Shortcode to return YouTube transcripts
|
225 |
-
*
|
226 |
-
* @since 2.0
|
227 |
-
*
|
228 |
-
* @uses vye_generate_transcript Generate the transcript
|
229 |
-
*
|
230 |
-
* @param string $paras Shortcode parameters
|
231 |
-
* @param string $content Shortcode content
|
232 |
-
* @return string Transcript XHTML
|
233 |
-
*/
|
234 |
-
|
235 |
-
function vye_transcript_sc( $paras = '', $content = '' ) {
|
236 |
-
|
237 |
-
extract( shortcode_atts( array( 'language' => '' ), $paras ) );
|
238 |
-
|
239 |
-
return do_shortcode( vye_generate_transcript( $content, $language ) );
|
240 |
-
}
|
241 |
-
|
242 |
-
add_shortcode( 'transcript', 'vye_transcript_sc' );
|
243 |
-
|
244 |
-
/**
|
245 |
-
* Video Name Shortcode
|
246 |
-
*
|
247 |
-
* Shortcode to return the name of a YouTube video
|
248 |
-
*
|
249 |
-
* @since 2.0
|
250 |
-
*
|
251 |
-
* @uses vye_extract_id Extract the video ID
|
252 |
-
* @uses vye_validate_id Get the name and video type
|
253 |
-
* @uses vye_error Return an error
|
254 |
-
*
|
255 |
-
* @param string $paras Shortcode parameters
|
256 |
-
* @param string $content Shortcode content
|
257 |
-
* @return string Video name
|
258 |
-
*/
|
259 |
-
|
260 |
-
function vye_video_name_shortcode( $paras = '', $content = '' ) {
|
261 |
-
|
262 |
-
// Extract the ID if a full URL has been specified
|
263 |
-
|
264 |
-
$id = vye_extract_id( $content );
|
265 |
-
|
266 |
-
// Check what type of video it is and whether it's valid
|
267 |
-
|
268 |
-
$return = vye_validate_id( $id, true );
|
269 |
-
if ( !$return[ 'type' ] ) { return vye_error( sprintf( __( 'The YouTube ID of %s is invalid.', 'youtube-embed' ), $id ) ); }
|
270 |
-
if ( strlen( $return[ 'type' ] ) != 1 ) { return vye_error( $return[ 'type' ] ); }
|
271 |
-
|
272 |
-
// Return the video title
|
273 |
-
|
274 |
-
return do_shortcode( $return['title'] );
|
275 |
-
}
|
276 |
-
|
277 |
-
add_shortcode( 'youtube_name', 'vye_video_name_shortcode' );
|
278 |
-
|
279 |
-
/**
|
280 |
-
* Comments Shortcode
|
281 |
-
*
|
282 |
-
* Shortcode to return YouTube comments
|
283 |
-
*
|
284 |
-
* @since 3.2
|
285 |
-
*
|
286 |
-
* @uses vye_generate_comments Generate the comments
|
287 |
-
*
|
288 |
-
* @param string $paras Shortcode parameters
|
289 |
-
* @param string $content Shortcode content
|
290 |
-
* @return string Comments output
|
291 |
-
*/
|
292 |
-
|
293 |
-
function vye_comments_sc( $paras = '', $content = '' ) {
|
294 |
-
|
295 |
-
$paras = shortcode_atts( array( 'avatar' => '', 'limit' => '', 'cache' => '' ), $paras );
|
296 |
-
$paras[ 'id' ] = $content;
|
297 |
-
|
298 |
-
return do_shortcode( vye_generate_comments( $paras ) );
|
299 |
-
}
|
300 |
-
|
301 |
-
add_shortcode( 'youtube_comments', 'vye_comments_sc' );
|
302 |
?>
|
42 |
* @return string YouTube embed code
|
43 |
*/
|
44 |
|
45 |
+
function vye_video_shortcode_alt( $paras = '', $content = '' ) {
|
46 |
+
return do_shortcode( vye_video_shortcode( $paras, $content, '', true ) );
|
47 |
}
|
48 |
$shortcode = vye_set_shortcode_option();
|
49 |
+
if ( isset( $shortcode ) && $shortcode != '' ) { add_shortcode( $shortcode, 'vye_video_shortcode_alt' ); }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
50 |
|
51 |
/**
|
52 |
* Video shortcode
|
66 |
* @return string YouTube embed code
|
67 |
*/
|
68 |
|
69 |
+
function vye_video_shortcode( $paras = '', $content = '', $callback = '', $alt_shortcode = false ) {
|
70 |
|
71 |
+
extract( shortcode_atts( array( 'width' => '', 'height' => '', 'fullscreen' => '', 'related' => '', 'autoplay' => '', 'loop' => '', 'start' => '', 'info' => '', 'annotation' => '', 'cc' => '', 'style' => '', 'stop' => '', 'disablekb' => '', 'ratio' => '', 'autohide' => '', 'controls' => '', 'profile' => '', 'id' => '', 'url' => '', 'rel' => '', 'fs' => '', 'cc_load_policy' => '', 'iv_load_policy' => '', 'showinfo' => '', 'youtubeurl' => '', 'template' => '', 'list' => '', 'color' => '', 'theme' => '', 'ssl' => '', 'height' => '', 'width' => '', 'dynamic' => '', 'h' => '', 'w' => '', 'search' => '', 'user' => '', 'modest' => '' ), $paras ) );
|
72 |
|
73 |
// If no profile specified and an alternative shortcode used, get that shortcodes default profile
|
74 |
|
75 |
+
if ( ( $profile == '' ) && ( $alt_shortcode ) ) {
|
|
|
|
|
|
|
|
|
76 |
|
77 |
// Get general options
|
78 |
|
79 |
$options = vye_set_general_defaults();
|
80 |
+
$profile = $options[ 'alt_profile' ];
|
81 |
}
|
82 |
|
83 |
// If an alternative field is set, use it
|
109 |
}
|
110 |
}
|
111 |
|
|
|
|
|
|
|
|
|
112 |
// Set up Autohide parameter
|
113 |
|
114 |
$autohide = vye_set_autohide( $autohide );
|
115 |
|
116 |
// Create YouTube code
|
117 |
|
118 |
+
$youtube_code = vye_generate_youtube_code( $content, $width, $height, vye_convert( $fullscreen ), vye_convert( $related ), vye_convert( $autoplay ), vye_convert( $loop ), $start, vye_convert( $info ), vye_convert_3( $annotation ), vye_convert( $cc ), $style, $stop, vye_convert( $disablekb ), $ratio, $autohide, $controls, $profile, $list, $template, $color, $theme, vye_convert( $ssl ), vye_convert( $dynamic ), vye_convert( $search ), vye_convert( $user ), vye_convert( $modest ) );
|
119 |
|
120 |
return do_shortcode( $youtube_code );
|
121 |
}
|
190 |
}
|
191 |
|
192 |
add_shortcode( 'download_video', 'vye_video_download' );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
193 |
?>
|
includes/update-post-content.php
DELETED
@@ -1,222 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Content
|
4 |
-
*
|
5 |
-
* Process the post/page content for embed requests
|
6 |
-
*
|
7 |
-
* @package YouTube-Embed
|
8 |
-
* @since 2.0
|
9 |
-
*/
|
10 |
-
|
11 |
-
/**
|
12 |
-
* Search content for alternative embed methods
|
13 |
-
*
|
14 |
-
* Look through post/page content for various alternative methods of embedding - replace with
|
15 |
-
* embed code.
|
16 |
-
*
|
17 |
-
* @since 2.0
|
18 |
-
*
|
19 |
-
* @uses vye_convert_content Convert a URL to the embed code
|
20 |
-
* @uses vye_generate_youtube_code Generate the YouTube embed code
|
21 |
-
* @uses vye_set_general_defaults Get general defaults
|
22 |
-
* @uses vye_validate_id Validate the video ID
|
23 |
-
*
|
24 |
-
* @param string $content Post/page content
|
25 |
-
* @return string Resulting post/page content
|
26 |
-
*/
|
27 |
-
|
28 |
-
function vye_content_search( $content ) {
|
29 |
-
|
30 |
-
$options = vye_set_general_defaults();
|
31 |
-
|
32 |
-
// The following are URL modifications
|
33 |
-
|
34 |
-
if ( $options[ 'alt' ] == 1 ) {
|
35 |
-
|
36 |
-
$changed = true;
|
37 |
-
while ( $changed ) {
|
38 |
-
|
39 |
-
$changed = false;
|
40 |
-
|
41 |
-
// Search for httpv URL
|
42 |
-
$identifier = 'httpv://www.youtube.com/watch?v=';
|
43 |
-
$search = strpos( $content, $identifier );
|
44 |
-
if ( $search !== false ) { $content = vye_convert_content( $content, $identifier, substr( $content, $search + strlen( $identifier ), 11 ), '', '', $options[ 'other_profile' ] ); $changed = true; }
|
45 |
-
|
46 |
-
// Search for httpa URL
|
47 |
-
$identifier = 'httpa://www.youtube.com/watch?v=';
|
48 |
-
$search = strpos( $content, $identifier );
|
49 |
-
if ( $search !== false ) { $content = vye_convert_content( $content, $identifier, substr( $content, $search + strlen( $identifier ), 11 ), 1, '', $options[ 'other_profile' ] ); $changed = true; }
|
50 |
-
|
51 |
-
// Search for httpvh URL
|
52 |
-
$identifier = 'httpvh://www.youtube.com/watch?v=';
|
53 |
-
$search = strpos( $content, $identifier );
|
54 |
-
if ( $search !== false ) { $content = vye_convert_content( $content, $identifier, substr( $content, $search + strlen( $identifier ), 11 ), '', '', $options[ 'other_profile' ] ); $changed = true; }
|
55 |
-
|
56 |
-
// Search for httpvp playlist URL
|
57 |
-
$identifier = 'httpvp://www.youtube.com/watch?p=';
|
58 |
-
$search = strpos( $content, $identifier );
|
59 |
-
if ( $search !== false ) { $content = vye_convert_content( $content, $identifier, substr( $content, $search + strlen( $identifier ), 16 ), '', '', $options[ 'other_profile' ] ); $changed = true; }
|
60 |
-
|
61 |
-
// Search for youtube:: URL
|
62 |
-
$identifier = 'youtube::';
|
63 |
-
$search = strpos( $content, $identifier );
|
64 |
-
if ( $search !== false ) {
|
65 |
-
$suffix = substr( $content, $search + strlen( $identifier ) + 11, 2 );
|
66 |
-
if ( $suffix == '::' ) { $content = vye_convert_content( $content, $identifier, substr( $content, $search + strlen( $identifier ), 11 ), '', '::', $options[ 'other_profile' ] ); $changed = true; }
|
67 |
-
}
|
68 |
-
}
|
69 |
-
|
70 |
-
}
|
71 |
-
|
72 |
-
// The following are embedding URLs that are within brackets but are not shortcodes
|
73 |
-
|
74 |
-
if ( $options[ 'bracket' ] == 1 ) {
|
75 |
-
|
76 |
-
// Loop around content, looking for brackets - possible YouTube URL within!
|
77 |
-
|
78 |
-
$current_pos = 0;
|
79 |
-
$bracket_found = true;
|
80 |
-
|
81 |
-
while ( $bracket_found ) {
|
82 |
-
$open_bracket = strpos( $content, '[', $current_pos );
|
83 |
-
|
84 |
-
if ($open_bracket !== false) {
|
85 |
-
$close_bracket = strpos( $content, ']', $open_bracket );
|
86 |
-
|
87 |
-
if ( $close_bracket !== false ) {
|
88 |
-
$code = substr( $content, $open_bracket + 1, $close_bracket - $open_bracket - 1 );
|
89 |
-
$code_found = false;
|
90 |
-
$id = $code;
|
91 |
-
|
92 |
-
// Maybe a video ID - validate first
|
93 |
-
|
94 |
-
if ( ( strlen( $code ) == 11 ) && ( !strpos( $code, ' ' ) ) ) {
|
95 |
-
$type = vye_validate_id( $code );
|
96 |
-
if ( $type == 'v' ) { $code_found = true; }
|
97 |
-
}
|
98 |
-
|
99 |
-
// Video URL
|
100 |
-
|
101 |
-
if ( ( strpos ($code, 'youtube.com/watch?v=' ) !== false ) && ( !$code_found ) ) { $code_found = true; }
|
102 |
-
|
103 |
-
// Other URLs
|
104 |
-
|
105 |
-
if ( ( substr( $code, 0, 8 ) == 'watch?v=' ) && ( !$code_found ) ) {
|
106 |
-
$id = substr( $code, 8 );
|
107 |
-
$code_found = true;
|
108 |
-
}
|
109 |
-
if ( ( substr( $code, 0, 2 ) == 'v=' ) && ( !$code_found ) ) {
|
110 |
-
$id = substr( $code, 2 );
|
111 |
-
$code_found = true;
|
112 |
-
}
|
113 |
-
|
114 |
-
// If an ID was found, update the code
|
115 |
-
|
116 |
-
if ( $code_found ) {
|
117 |
-
$ye_code = vye_generate_youtube_code( $id, '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', $options[ 'other_profile' ], '', '' );
|
118 |
-
$content = str_replace( '[' . $code . ']', $ye_code, $content );
|
119 |
-
}
|
120 |
-
}
|
121 |
-
$current_pos = $close_bracket;
|
122 |
-
} else {
|
123 |
-
$bracket_found = false;
|
124 |
-
}
|
125 |
-
}
|
126 |
-
}
|
127 |
-
|
128 |
-
return $content;
|
129 |
-
}
|
130 |
-
add_filter( 'the_content', 'vye_content_search' );
|
131 |
-
|
132 |
-
/**
|
133 |
-
* Convert the Content
|
134 |
-
*
|
135 |
-
* Convert the URL to the embed code
|
136 |
-
*
|
137 |
-
* @since 2.0
|
138 |
-
*
|
139 |
-
* @uses vye_generate_youtube_code Generate the embed code
|
140 |
-
*
|
141 |
-
* @param string $content The post content
|
142 |
-
* @param string $identifier The text that identifies the embed
|
143 |
-
* @param string $id The video ID
|
144 |
-
* @param string $audio Audio only?
|
145 |
-
* @param string $suffix Characters that appear after the video ID
|
146 |
-
* @param string $profile The current profile
|
147 |
-
* @return string Content to return
|
148 |
-
*/
|
149 |
-
|
150 |
-
function vye_convert_content( $content, $identifier, $id, $audio = '', $suffix = '', $profile = '' ) {
|
151 |
-
|
152 |
-
$code = vye_generate_youtube_code( $id, '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', $profile, '', $audio );
|
153 |
-
$content = str_replace( $identifier.$id.$suffix, $code, $content);
|
154 |
-
|
155 |
-
return $content;
|
156 |
-
}
|
157 |
-
|
158 |
-
/**
|
159 |
-
* Filter comments
|
160 |
-
*
|
161 |
-
* Filter comments and add YouTube embeds
|
162 |
-
*
|
163 |
-
* @since 2.0
|
164 |
-
*
|
165 |
-
* @uses vye_set_general_defaults Get the general defaults
|
166 |
-
* @uses vye_generate_youtube_code Generate the YouTube embed code
|
167 |
-
*
|
168 |
-
* @param string $content The comments content
|
169 |
-
* @return string Content to return
|
170 |
-
*/
|
171 |
-
|
172 |
-
function vye_filter_comments( $content ) {
|
173 |
-
|
174 |
-
$options = vye_set_general_defaults();
|
175 |
-
|
176 |
-
if ( $options[ 'comments' ] == 1 ) {
|
177 |
-
|
178 |
-
$identifier = 'http://www.youtube.com/watch?v=';
|
179 |
-
$search_pos = 0;
|
180 |
-
$search = strpos( $content, $identifier, $search_pos );
|
181 |
-
|
182 |
-
while ( $search !== false ) {
|
183 |
-
$prefix = substr( $content, $search - 1, 1 );
|
184 |
-
if ( ( $prefix != ']' ) && ( $prefix != '"' ) && ( $prefix != "'" ) ) {
|
185 |
-
|
186 |
-
// Check if link around video. If so, work out how much more needs stripping out
|
187 |
-
|
188 |
-
$anchor_start = 0;
|
189 |
-
$anchor_end = 0;
|
190 |
-
if ( $prefix == ">" ) {
|
191 |
-
$anchor_pos = strrpos( substr( $content, 0, $search ), '<a' );
|
192 |
-
if ( $anchor_pos !== false ) {
|
193 |
-
$anchor_start = $search - $anchor_pos;
|
194 |
-
$anchor_end = strpos(substr($content,$search),'</a>') - strlen($identifier) - 11;
|
195 |
-
}
|
196 |
-
}
|
197 |
-
|
198 |
-
// Work out video ID and generate code
|
199 |
-
|
200 |
-
$id = substr( $content, $search + strlen( $identifier ), 11 );
|
201 |
-
$code = vye_generate_youtube_code( $id, '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', $options[ 'comments_profile' ], '', '' );
|
202 |
-
|
203 |
-
// Now replace the URL with the resultant code
|
204 |
-
|
205 |
-
$first_section = $search - 1 - $anchor_start;
|
206 |
-
if ( $first_section < 1 ) {
|
207 |
-
$content = $code . substr( $content, $search + strlen( $identifier ) + 11 + $anchor_end );
|
208 |
-
} else {
|
209 |
-
$content = substr( $content, 0, $first_section ) . $code . substr( $content, $search + strlen( $identifier ) + 11 + $anchor_end );
|
210 |
-
}
|
211 |
-
|
212 |
-
$search_pos = $search + strlen( $code ) - $anchor_start;
|
213 |
-
} else {
|
214 |
-
$search_pos = $search + strlen( $identifier ) + 11;
|
215 |
-
}
|
216 |
-
$search = strpos( $content, $identifier, $search_pos - 1);
|
217 |
-
}
|
218 |
-
}
|
219 |
-
return $content;
|
220 |
-
}
|
221 |
-
add_filter( 'comment_text', 'vye_filter_comments' );
|
222 |
-
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
js/{mce4-button.php → mce4-button.js}
RENAMED
@@ -1,13 +1,4 @@
|
|
1 |
-
<?php header('Content-Type: application/javascript'); ?>
|
2 |
(function() {
|
3 |
-
<?php
|
4 |
-
|
5 |
-
// Get cookie of default shortcode to use
|
6 |
-
|
7 |
-
$cookie_name = 'vye_mce_shortcode';
|
8 |
-
if ( isset( $_COOKIE[ $cookie_name ] ) ) { $shortcode = $_COOKIE[ $cookie_name ]; } else { $shortcode = 'youtube'; }
|
9 |
-
?>
|
10 |
-
var shortcode = "<?php echo $shortcode; ?>";
|
11 |
tinymce.PluginManager.add('mce4_youtube_button', function( editor, url ) {
|
12 |
editor.addButton( 'mce4_youtube_button', {
|
13 |
title: 'YouTube Embed',
|
@@ -19,7 +10,7 @@ if ( isset( $_COOKIE[ $cookie_name ] ) ) { $shortcode = $_COOKIE[ $cookie_name ]
|
|
19 |
} else {
|
20 |
var yeOut = selectText;
|
21 |
}
|
22 |
-
editor.insertContent('[
|
23 |
}
|
24 |
});
|
25 |
});
|
|
|
1 |
(function() {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
tinymce.PluginManager.add('mce4_youtube_button', function( editor, url ) {
|
3 |
editor.addButton( 'mce4_youtube_button', {
|
4 |
title: 'YouTube Embed',
|
10 |
} else {
|
11 |
var yeOut = selectText;
|
12 |
}
|
13 |
+
editor.insertContent('[youtube]' + yeOut + '[/youtube]');
|
14 |
}
|
15 |
});
|
16 |
});
|
js/mce4-button.min.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
!function(){tinymce.PluginManager.add("mce4_youtube_button",function(t){t.addButton("mce4_youtube_button",{title:"YouTube Embed",icon:"icon dashicons-video-alt3",onclick:function(){if(selectText=tinymce.activeEditor.selection.getContent({format:"text"}),""==selectText)var e="Insert video URL or ID here";else var e=selectText;t.insertContent("[youtube]"+e+"[/youtube]")}})})}();
|
js/mce4-button.min.php
DELETED
@@ -1,3 +0,0 @@
|
|
1 |
-
<?php header('Content-Type: application/javascript'); ?>(function(){
|
2 |
-
<?php $cookie_name='vye_mce_shortcode';if(isset($_COOKIE[$cookie_name])){$shortcode=$_COOKIE[$cookie_name];}else{$shortcode='youtube';}?>
|
3 |
-
var shortcode="<?php echo $shortcode; ?>";tinymce.PluginManager.add('mce4_youtube_button',function(editor,url){editor.addButton('mce4_youtube_button',{title:'YouTube Embed',icon:'icon dashicons-video-alt3',onclick:function(){selectText=tinymce.activeEditor.selection.getContent({format:'text'});if(selectText==''){var yeOut='Insert video URL or ID here'}else{var yeOut=selectText}editor.insertContent('['+shortcode+']'+yeOut+'[/'+shortcode+']')}})})})();
|
|
|
|
|
|
languages/youtube-embed.mo
CHANGED
Binary file
|
languages/youtube-embed.po
CHANGED
@@ -2,8 +2,8 @@ msgid ""
|
|
2 |
msgstr ""
|
3 |
"Project-Id-Version: Vixy YouTube Embed\n"
|
4 |
"Report-Msgid-Bugs-To: \n"
|
5 |
-
"POT-Creation-Date: 2015-09
|
6 |
-
"PO-Revision-Date: 2015-09
|
7 |
"Last-Translator: David Artiss <david.artiss@artiss.co.uk>\n"
|
8 |
"Language-Team: \n"
|
9 |
"Language: en_GB\n"
|
@@ -17,19 +17,19 @@ msgstr ""
|
|
17 |
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
18 |
"X-Poedit-SearchPath-0: .\n"
|
19 |
|
20 |
-
#: includes/add-
|
21 |
msgid "YouTube Embed"
|
22 |
msgstr ""
|
23 |
|
24 |
-
#: includes/add-
|
25 |
msgid "Options"
|
26 |
msgstr ""
|
27 |
|
28 |
-
#: includes/add-
|
29 |
msgid "Profiles"
|
30 |
msgstr ""
|
31 |
|
32 |
-
#: includes/add-
|
33 |
msgid "Lists"
|
34 |
msgstr ""
|
35 |
|
@@ -57,7 +57,7 @@ msgstr ""
|
|
57 |
msgid "YouTube Embed Options"
|
58 |
msgstr ""
|
59 |
|
60 |
-
#: includes/admin-config.php:100 includes/options-profiles.php:
|
61 |
msgid "YouTube Embed Profiles"
|
62 |
msgstr ""
|
63 |
|
@@ -66,7 +66,7 @@ msgid "YouTube Embed Lists"
|
|
66 |
msgstr ""
|
67 |
|
68 |
#: includes/admin-config.php:175 includes/admin-config.php:216
|
69 |
-
#: includes/admin-config.php:
|
70 |
msgid "Help"
|
71 |
msgstr ""
|
72 |
|
@@ -74,28 +74,28 @@ msgstr ""
|
|
74 |
msgid ""
|
75 |
"This screen allows you to select non-specific options for the YouTube Embed "
|
76 |
"plugin. For the default embedding settings, please select the <a href="
|
77 |
-
"\"admin.php?page=profile-options\">Profiles</a> administration option."
|
78 |
msgstr ""
|
79 |
|
80 |
-
#: includes/admin-config.php:191 includes/admin-config.php:
|
81 |
-
#: includes/admin-config.php:
|
82 |
msgid ""
|
83 |
-
"Remember to click the Save
|
84 |
"new settings to take effect."
|
85 |
msgstr ""
|
86 |
|
87 |
-
#: includes/admin-config.php:192 includes/admin-config.php:
|
88 |
-
#: includes/admin-config.php:
|
89 |
msgid "For more information:"
|
90 |
msgstr ""
|
91 |
|
92 |
-
#: includes/admin-config.php:193 includes/admin-config.php:
|
93 |
-
#: includes/admin-config.php:
|
94 |
msgid "YouTube Embed Plugin Documentation"
|
95 |
msgstr ""
|
96 |
|
97 |
-
#: includes/admin-config.php:194 includes/admin-config.php:
|
98 |
-
#: includes/admin-config.php:
|
99 |
msgid "YouTube Player Documentation"
|
100 |
msgstr ""
|
101 |
|
@@ -108,82 +108,62 @@ msgid ""
|
|
108 |
"required."
|
109 |
msgstr ""
|
110 |
|
111 |
-
#: includes/admin-config.php:
|
112 |
-
msgid "EmbedPlus website"
|
113 |
-
msgstr ""
|
114 |
-
|
115 |
-
#: includes/admin-config.php:273
|
116 |
msgid ""
|
117 |
-
"
|
118 |
-
"
|
|
|
119 |
msgstr ""
|
120 |
|
121 |
-
#: includes/admin-config.php:
|
122 |
-
msgid "
|
123 |
msgstr ""
|
124 |
|
125 |
-
#: includes/admin-config.php:
|
126 |
-
msgid "
|
127 |
msgstr ""
|
128 |
|
129 |
-
#: includes/admin-config.php:
|
130 |
msgid ""
|
131 |
-
"
|
132 |
-
"
|
133 |
msgstr ""
|
134 |
|
135 |
-
#: includes/
|
136 |
-
msgid ""
|
137 |
-
"Even if you do nothing else, please visit the Profiles option to check your "
|
138 |
-
"default video values."
|
139 |
msgstr ""
|
140 |
|
141 |
-
#: includes/
|
142 |
-
#: includes/generate-
|
143 |
-
#: includes/generate-download-code.php:33 includes/generate-embed-code.php:118
|
144 |
-
#: includes/generate-shorturl-code.php:34
|
145 |
-
#: includes/generate-thumbnail-code.php:39
|
146 |
-
#: includes/generate-transcript-code.php:39 includes/shortcodes.php:269
|
147 |
#, php-format
|
148 |
msgid "The YouTube ID of %s is invalid."
|
149 |
msgstr ""
|
150 |
|
151 |
-
#: includes/
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
#: includes/generate-comments-code.php:31
|
157 |
-
msgid "No YouTube ID was specified."
|
158 |
-
msgstr ""
|
159 |
-
|
160 |
-
#: includes/generate-comments-code.php:120
|
161 |
-
msgid "ago"
|
162 |
-
msgstr ""
|
163 |
-
|
164 |
-
#: includes/generate-download-code.php:20
|
165 |
-
msgid "No YouTube ID was found."
|
166 |
msgstr ""
|
167 |
|
168 |
-
#: includes/generate-embed-code.php:
|
169 |
-
msgid "
|
170 |
msgstr ""
|
171 |
|
172 |
-
#: includes/generate-embed-code.php:
|
173 |
msgid ""
|
174 |
-
"
|
175 |
-
"
|
176 |
msgstr ""
|
177 |
|
178 |
-
#: includes/generate-
|
179 |
-
msgid "
|
180 |
msgstr ""
|
181 |
|
182 |
-
#: includes/generate-
|
183 |
msgid "No video ID has been supplied"
|
184 |
msgstr ""
|
185 |
|
186 |
-
#: includes/generate-
|
187 |
#, php-format
|
188 |
msgid "YouTube Video %s"
|
189 |
msgstr ""
|
@@ -192,340 +172,294 @@ msgstr ""
|
|
192 |
msgid "Embed YouTube Widget."
|
193 |
msgstr ""
|
194 |
|
195 |
-
#: includes/
|
196 |
-
msgid "
|
197 |
msgstr ""
|
198 |
|
199 |
-
#: includes/options-
|
200 |
-
msgid "
|
201 |
msgstr ""
|
202 |
|
203 |
-
#: includes/
|
204 |
-
msgid ""
|
205 |
-
"These are the general settings for YouTube Embed. Please select <a href="
|
206 |
-
"\"admin.php?page=profile-options\">Profiles</a> for default embedding "
|
207 |
-
"settings."
|
208 |
msgstr ""
|
209 |
|
210 |
-
#: includes/
|
211 |
-
msgid "
|
212 |
msgstr ""
|
213 |
|
214 |
-
#: includes/
|
215 |
-
msgid "
|
216 |
msgstr ""
|
217 |
|
218 |
-
#: includes/
|
219 |
-
msgid "
|
220 |
msgstr ""
|
221 |
|
222 |
-
#: includes/
|
223 |
-
msgid "
|
224 |
msgstr ""
|
225 |
|
226 |
-
#: includes/
|
227 |
-
msgid "
|
228 |
msgstr ""
|
229 |
|
230 |
-
#: includes/
|
231 |
-
|
232 |
-
msgid "Profile to use"
|
233 |
msgstr ""
|
234 |
|
235 |
-
#: includes/
|
236 |
-
msgid "
|
237 |
msgstr ""
|
238 |
|
239 |
-
#: includes/
|
240 |
-
msgid "
|
241 |
msgstr ""
|
242 |
|
243 |
-
#: includes/
|
244 |
-
msgid "
|
245 |
msgstr ""
|
246 |
|
247 |
-
#: includes/
|
248 |
-
msgid "
|
249 |
msgstr ""
|
250 |
|
251 |
-
#: includes/
|
252 |
-
msgid ""
|
253 |
-
"Videos cannot be embedded in feeds. Select how you wish them to be shown "
|
254 |
-
"instead"
|
255 |
msgstr ""
|
256 |
|
257 |
-
#: includes/options-general.php:
|
258 |
-
msgid "
|
259 |
msgstr ""
|
260 |
|
261 |
-
#: includes/options-general.php:
|
262 |
-
msgid "
|
263 |
msgstr ""
|
264 |
|
265 |
-
#: includes/options-general.php:
|
266 |
-
msgid "
|
|
|
|
|
|
|
267 |
msgstr ""
|
268 |
|
269 |
-
#: includes/options-general.php:
|
270 |
-
msgid "
|
271 |
msgstr ""
|
272 |
|
273 |
-
#: includes/options-general.php:
|
274 |
-
msgid "
|
275 |
msgstr ""
|
276 |
|
277 |
-
#: includes/options-general.php:
|
278 |
-
msgid "
|
279 |
msgstr ""
|
280 |
|
281 |
-
#: includes/options-general.php:
|
282 |
-
msgid "
|
283 |
msgstr ""
|
284 |
|
285 |
-
#: includes/options-general.php:
|
286 |
-
msgid "
|
287 |
msgstr ""
|
288 |
|
289 |
-
#: includes/options-general.php:
|
290 |
-
msgid ""
|
291 |
-
"Allow shortcodes to be used in widgets - this will apply to <strong>all</"
|
292 |
-
"strong> widgets"
|
293 |
msgstr ""
|
294 |
|
295 |
-
#: includes/options-general.php:
|
296 |
-
msgid "
|
297 |
msgstr ""
|
298 |
|
299 |
-
#: includes/options-general.php:
|
300 |
msgid ""
|
301 |
-
"
|
302 |
-
"
|
303 |
-
"without the surrounding square brackets.</strong>"
|
304 |
msgstr ""
|
305 |
|
306 |
-
#: includes/options-general.php:
|
307 |
-
msgid "
|
308 |
msgstr ""
|
309 |
|
310 |
-
#: includes/options-general.php:
|
311 |
-
msgid "
|
312 |
msgstr ""
|
313 |
|
314 |
-
#: includes/options-general.php:
|
315 |
-
msgid "
|
316 |
msgstr ""
|
317 |
|
318 |
-
#: includes/options-general.php:
|
319 |
-
msgid ""
|
320 |
-
"Switch on compatibility with other embedding plugins. For more details "
|
321 |
-
"please <a href=\"http://www.artiss.co.uk/youtube-embed-compatibility\">click "
|
322 |
-
"here</a>."
|
323 |
msgstr ""
|
324 |
|
325 |
-
#: includes/options-general.php:
|
326 |
-
msgid "
|
327 |
msgstr ""
|
328 |
|
329 |
-
#: includes/options-general.php:
|
330 |
-
msgid ""
|
331 |
-
"Allow embedding using URLs within brackets. Activating impacts performance"
|
332 |
msgstr ""
|
333 |
|
334 |
-
#: includes/options-general.php:
|
335 |
-
msgid "
|
336 |
msgstr ""
|
337 |
|
338 |
-
#: includes/options-general.php:
|
339 |
-
msgid "
|
340 |
msgstr ""
|
341 |
|
342 |
-
#: includes/options-general.php:
|
343 |
-
msgid "
|
344 |
msgstr ""
|
345 |
|
346 |
-
#: includes/options-general.php:
|
347 |
-
msgid "
|
348 |
msgstr ""
|
349 |
|
350 |
-
#: includes/options-general.php:
|
351 |
-
msgid "
|
352 |
msgstr ""
|
353 |
|
354 |
-
#: includes/options-general.php:
|
355 |
-
msgid "
|
356 |
msgstr ""
|
357 |
|
358 |
-
#: includes/options-general.php:
|
359 |
-
msgid "
|
360 |
msgstr ""
|
361 |
|
362 |
-
#: includes/options-general.php:
|
363 |
-
msgid "
|
364 |
msgstr ""
|
365 |
|
366 |
-
#: includes/options-general.php:
|
367 |
-
msgid "
|
368 |
msgstr ""
|
369 |
|
370 |
-
#: includes/options-general.php:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
371 |
msgid "Add link to options screen to Admin Bar"
|
372 |
msgstr ""
|
373 |
|
374 |
-
#: includes/options-general.php:
|
375 |
msgid "Menu Screen Access"
|
376 |
msgstr ""
|
377 |
|
378 |
-
#: includes/options-general.php:
|
379 |
msgid "Administrator"
|
380 |
msgstr ""
|
381 |
|
382 |
-
#: includes/options-general.php:
|
383 |
msgid "Editor"
|
384 |
msgstr ""
|
385 |
|
386 |
-
#: includes/options-general.php:
|
387 |
msgid "Author"
|
388 |
msgstr ""
|
389 |
|
390 |
-
#: includes/options-general.php:
|
391 |
msgid "Contributor"
|
392 |
msgstr ""
|
393 |
|
394 |
-
#: includes/options-general.php:
|
395 |
-
msgid "Specify the user access required for the menu screens"
|
396 |
msgstr ""
|
397 |
|
398 |
-
#: includes/options-general.php:
|
399 |
msgid "Profile & List Sizes"
|
400 |
msgstr ""
|
401 |
|
402 |
-
#: includes/options-general.php:
|
403 |
msgid "Number of Profiles"
|
404 |
msgstr ""
|
405 |
|
406 |
-
#: includes/options-general.php:
|
407 |
-
msgid "Maximum number of profiles"
|
408 |
msgstr ""
|
409 |
|
410 |
-
#: includes/options-general.php:
|
411 |
msgid "Number of Lists"
|
412 |
msgstr ""
|
413 |
|
414 |
-
#: includes/options-general.php:
|
415 |
-
msgid "Maximum number of lists"
|
416 |
msgstr ""
|
417 |
|
418 |
-
#: includes/options-general.php:
|
419 |
msgid "Performance"
|
420 |
msgstr ""
|
421 |
|
422 |
-
#: includes/options-general.php:
|
423 |
-
msgid "Embed Cache"
|
424 |
-
msgstr ""
|
425 |
-
|
426 |
-
#: includes/options-general.php:247
|
427 |
-
msgid "How many hours to retain embed output. 0 to switch off"
|
428 |
-
msgstr ""
|
429 |
-
|
430 |
-
#: includes/options-general.php:251
|
431 |
-
msgid "Video Information Cache"
|
432 |
-
msgstr ""
|
433 |
-
|
434 |
-
#: includes/options-general.php:252
|
435 |
-
msgid ""
|
436 |
-
"How many hours to retain video information, including it's validity. 0 to "
|
437 |
-
"switch off"
|
438 |
-
msgstr ""
|
439 |
-
|
440 |
-
#: includes/options-general.php:256
|
441 |
-
msgid "Transcript Cache"
|
442 |
-
msgstr ""
|
443 |
-
|
444 |
-
#: includes/options-general.php:257
|
445 |
-
msgid "How many hours to store transcripts for in cache. 0 to switch off"
|
446 |
-
msgstr ""
|
447 |
-
|
448 |
-
#: includes/options-general.php:261
|
449 |
-
msgid "Comments Cache"
|
450 |
-
msgstr ""
|
451 |
-
|
452 |
-
#: includes/options-general.php:262
|
453 |
-
msgid "How many minutes to store video comments for in cache. 0 to switch off"
|
454 |
-
msgstr ""
|
455 |
-
|
456 |
-
#: includes/options-general.php:272
|
457 |
msgid "You currently have cache for"
|
458 |
msgstr ""
|
459 |
|
460 |
-
#: includes/options-general.php:
|
461 |
-
msgid "
|
462 |
-
msgstr ""
|
463 |
-
|
464 |
-
#: includes/options-general.php:276
|
465 |
-
msgid "Clear Cache"
|
466 |
-
msgstr ""
|
467 |
-
|
468 |
-
#: includes/options-general.php:277
|
469 |
-
msgid "Select this option to remove all YouTube Embed cache."
|
470 |
-
msgstr ""
|
471 |
-
|
472 |
-
#: includes/options-general.php:280
|
473 |
-
msgid "Error Reporting"
|
474 |
msgstr ""
|
475 |
|
476 |
-
#: includes/options-general.php:
|
477 |
-
msgid ""
|
478 |
-
"Playback errors are within the XHTML source code as comments - parameter "
|
479 |
-
"errors and other types are displayed on the post output."
|
480 |
msgstr ""
|
481 |
|
482 |
-
#: includes/options-general.php:
|
483 |
-
msgid "
|
484 |
msgstr ""
|
485 |
|
486 |
-
#: includes/options-general.php:
|
487 |
-
msgid "
|
488 |
msgstr ""
|
489 |
|
490 |
-
#: includes/options-general.php:
|
491 |
msgid "Security"
|
492 |
msgstr ""
|
493 |
|
494 |
-
#: includes/options-general.php:
|
495 |
msgid "Privacy-Enhanced Mode"
|
496 |
msgstr ""
|
497 |
|
498 |
-
#: includes/options-general.php:
|
499 |
msgid "Cookies should always be stored"
|
500 |
msgstr ""
|
501 |
|
502 |
-
#: includes/options-general.php:
|
503 |
msgid "Cookies should never be stored"
|
504 |
msgstr ""
|
505 |
|
506 |
-
#: includes/options-general.php:
|
507 |
msgid "Cookies should be stored based on user's Do Not Track setting"
|
508 |
msgstr ""
|
509 |
|
510 |
-
#: includes/options-general.php:
|
511 |
-
msgid "Read more about <a href=\"http://donottrack.us/\">Do Not Track</a
|
512 |
msgstr ""
|
513 |
|
514 |
-
#: includes/options-general.php:
|
515 |
msgid "Compatibility"
|
516 |
msgstr ""
|
517 |
|
518 |
-
#: includes/options-general.php:
|
|
|
|
|
|
|
|
|
519 |
msgid "Allow Frame Border on IFRAME"
|
520 |
msgstr ""
|
521 |
|
522 |
-
#: includes/options-general.php:
|
523 |
-
msgid "FRAMEBORDER is not HTML5 compliant"
|
524 |
msgstr ""
|
525 |
|
526 |
-
#: includes/options-general.php:
|
527 |
-
#: includes/options-profiles.php:
|
528 |
-
msgid "Save
|
529 |
msgstr ""
|
530 |
|
531 |
#: includes/options-lists.php:32
|
@@ -555,602 +489,396 @@ msgid ""
|
|
555 |
"the drop-down on the right hand side to swap between lists."
|
556 |
msgstr ""
|
557 |
|
558 |
-
#: includes/options-lists.php:
|
559 |
-
msgid "List
|
560 |
msgstr ""
|
561 |
|
562 |
-
#: includes/options-lists.php:
|
563 |
msgid "The name you wish to give this list"
|
564 |
msgstr ""
|
565 |
|
566 |
-
#: includes/options-lists.php:
|
567 |
msgid "Video IDs (one per line)"
|
568 |
msgstr ""
|
569 |
|
570 |
-
#: includes/options-lists.php:
|
571 |
-
msgid "Video ID"
|
572 |
-
msgstr ""
|
573 |
-
|
574 |
-
#: includes/options-lists.php:131
|
575 |
msgid "Video Title"
|
576 |
msgstr ""
|
577 |
|
578 |
-
#: includes/options-lists.php:
|
579 |
msgid "Status"
|
580 |
msgstr ""
|
581 |
|
582 |
-
#: includes/options-lists.php:
|
583 |
msgid "This is a playlist"
|
584 |
msgstr ""
|
585 |
|
586 |
-
#: includes/options-lists.php:
|
587 |
msgid "Invalid video ID"
|
588 |
msgstr ""
|
589 |
|
590 |
-
#: includes/options-lists.php:
|
591 |
msgid "YouTube API error"
|
592 |
msgstr ""
|
593 |
|
594 |
-
#: includes/options-lists.php:
|
595 |
msgid "Valid video"
|
596 |
msgstr ""
|
597 |
|
598 |
-
#: includes/options-lists.php:
|
599 |
msgid "The video ID is valid"
|
600 |
msgstr ""
|
601 |
|
602 |
-
#: includes/options-lists.php:
|
603 |
msgid "The video ID is invalid"
|
604 |
msgstr ""
|
605 |
|
606 |
-
#: includes/options-profiles.php:
|
607 |
msgid " Profile Saved."
|
608 |
msgstr ""
|
609 |
|
610 |
-
#: includes/options-profiles.php:
|
611 |
msgid "Change profile"
|
612 |
msgstr ""
|
613 |
|
614 |
-
#: includes/options-profiles.php:
|
615 |
msgid "These are the options for the default profile."
|
616 |
msgstr ""
|
617 |
|
618 |
-
#: includes/options-profiles.php:
|
619 |
#, php-format
|
620 |
msgid "These are the options for profile %s."
|
621 |
msgstr ""
|
622 |
|
623 |
-
#: includes/options-profiles.php:
|
624 |
msgid "Use the drop-down on the right hand side to swap between profiles."
|
625 |
msgstr ""
|
626 |
|
627 |
-
#: includes/options-profiles.php:
|
628 |
-
msgid "Profile
|
629 |
msgstr ""
|
630 |
|
631 |
-
#: includes/options-profiles.php:
|
632 |
msgid "The name you wish to give this profile"
|
633 |
msgstr ""
|
634 |
|
635 |
-
#: includes/options-profiles.php:
|
636 |
-
msgid "
|
637 |
-
msgstr ""
|
638 |
-
|
639 |
-
#: includes/options-profiles.php:141
|
640 |
-
msgid "The type of player to use for videos."
|
641 |
-
msgstr ""
|
642 |
-
|
643 |
-
#: includes/options-profiles.php:142 includes/options-profiles.php:152
|
644 |
-
#: includes/options-profiles.php:361 includes/options-widgets.php:89
|
645 |
-
msgid "IFRAME"
|
646 |
msgstr ""
|
647 |
|
648 |
-
#: includes/options-profiles.php:
|
649 |
msgid ""
|
650 |
-
"
|
651 |
-
"
|
652 |
msgstr ""
|
653 |
|
654 |
-
#: includes/options-profiles.php:
|
655 |
-
|
656 |
-
msgid "OBJECT"
|
657 |
msgstr ""
|
658 |
|
659 |
#: includes/options-profiles.php:143
|
660 |
-
msgid "
|
661 |
-
msgstr ""
|
662 |
-
|
663 |
-
#: includes/options-profiles.php:144 includes/options-widgets.php:93
|
664 |
-
msgid "Chromeless"
|
665 |
-
msgstr ""
|
666 |
-
|
667 |
-
#: includes/options-profiles.php:144
|
668 |
-
msgid ""
|
669 |
-
"Use the <a href=\"http://www.artiss.co.uk/youtube-embed-help#ye-chromeless"
|
670 |
-
"\">Chromeless</a> version of the AS3 Flash Player."
|
671 |
msgstr ""
|
672 |
|
673 |
-
#: includes/options-profiles.php:
|
674 |
-
|
675 |
-
msgid "EmbedPlus"
|
676 |
msgstr ""
|
677 |
|
678 |
-
#: includes/options-profiles.php:
|
679 |
msgid ""
|
680 |
-
"Use <a href=\"http://www.
|
681 |
-
"\">
|
682 |
msgstr ""
|
683 |
|
684 |
-
#: includes/options-profiles.php:
|
685 |
-
msgid "
|
686 |
msgstr ""
|
687 |
|
688 |
-
#: includes/options-profiles.php:
|
689 |
-
msgid "
|
690 |
msgstr ""
|
691 |
|
692 |
-
#: includes/options-profiles.php:160
|
693 |
-
msgid "
|
694 |
msgstr ""
|
695 |
|
696 |
#: includes/options-profiles.php:161
|
697 |
-
msgid ""
|
698 |
-
"Wrapper for video output. Must include <code>%video%</code> tag to show "
|
699 |
-
"video position"
|
700 |
-
msgstr ""
|
701 |
-
|
702 |
-
#: includes/options-profiles.php:165 includes/options-widgets.php:55
|
703 |
-
msgid "Style"
|
704 |
-
msgstr ""
|
705 |
-
|
706 |
-
#: includes/options-profiles.php:166
|
707 |
-
msgid "CSS elements to apply to video"
|
708 |
-
msgstr ""
|
709 |
-
|
710 |
-
#: includes/options-profiles.php:170
|
711 |
-
msgid "Video Quality"
|
712 |
msgstr ""
|
713 |
|
714 |
-
#: includes/options-profiles.php:
|
715 |
-
msgid "
|
|
|
|
|
|
|
716 |
msgstr ""
|
717 |
|
718 |
-
#: includes/options-profiles.php:
|
719 |
-
msgid "
|
720 |
msgstr ""
|
721 |
|
722 |
-
#: includes/options-profiles.php:
|
723 |
-
msgid "
|
724 |
msgstr ""
|
725 |
|
726 |
-
#: includes/options-profiles.php:
|
727 |
-
msgid "
|
728 |
msgstr ""
|
729 |
|
730 |
-
#: includes/options-profiles.php:
|
731 |
-
msgid "
|
732 |
msgstr ""
|
733 |
|
734 |
-
#: includes/options-profiles.php:
|
735 |
-
msgid "
|
736 |
msgstr ""
|
737 |
|
738 |
#: includes/options-profiles.php:193
|
739 |
-
msgid "
|
740 |
-
msgstr ""
|
741 |
-
|
742 |
-
#: includes/options-profiles.php:197
|
743 |
-
msgid "Show Download Link"
|
744 |
msgstr ""
|
745 |
|
746 |
-
#: includes/options-profiles.php:
|
747 |
-
|
748 |
-
msgid "Show a link to %s under the video"
|
749 |
msgstr ""
|
750 |
|
751 |
-
#: includes/options-profiles.php:
|
752 |
-
msgid "
|
753 |
msgstr ""
|
754 |
|
755 |
#: includes/options-profiles.php:203
|
756 |
-
msgid "
|
757 |
-
msgstr ""
|
758 |
-
|
759 |
-
#: includes/options-profiles.php:207
|
760 |
-
msgid "Download Style"
|
761 |
msgstr ""
|
762 |
|
763 |
-
#: includes/options-profiles.php:
|
764 |
-
msgid "
|
765 |
msgstr ""
|
766 |
|
767 |
#: includes/options-profiles.php:211
|
768 |
-
msgid "
|
769 |
msgstr ""
|
770 |
|
771 |
-
#: includes/options-profiles.php:
|
772 |
-
msgid "
|
|
|
|
|
773 |
msgstr ""
|
774 |
|
775 |
-
#: includes/options-profiles.php:
|
776 |
-
msgid "
|
777 |
msgstr ""
|
778 |
|
779 |
-
#: includes/options-profiles.php:
|
780 |
-
msgid "
|
781 |
msgstr ""
|
782 |
|
783 |
#: includes/options-profiles.php:222
|
784 |
-
msgid "
|
|
|
|
|
785 |
msgstr ""
|
786 |
|
787 |
#: includes/options-profiles.php:228
|
788 |
-
msgid "
|
789 |
-
msgstr ""
|
790 |
-
|
791 |
-
#: includes/options-profiles.php:232 includes/options-widgets.php:73
|
792 |
-
msgid "Dynamically Resize"
|
793 |
msgstr ""
|
794 |
|
795 |
-
#: includes/options-profiles.php:
|
796 |
-
msgid "
|
797 |
msgstr ""
|
798 |
|
799 |
-
#: includes/options-profiles.php:
|
800 |
-
msgid "
|
801 |
msgstr ""
|
802 |
|
803 |
#: includes/options-profiles.php:238
|
804 |
-
msgid "
|
805 |
msgstr ""
|
806 |
|
807 |
-
#: includes/options-profiles.php:
|
808 |
-
msgid "
|
809 |
-
msgstr ""
|
810 |
-
|
811 |
-
#: includes/options-profiles.php:248
|
812 |
-
msgid "Auto hide"
|
813 |
msgstr ""
|
814 |
|
815 |
-
#: includes/options-profiles.php:
|
816 |
-
msgid "
|
817 |
msgstr ""
|
818 |
|
819 |
-
#: includes/options-profiles.php:
|
820 |
-
msgid "
|
821 |
msgstr ""
|
822 |
|
823 |
-
#: includes/options-profiles.php:
|
824 |
-
msgid "
|
825 |
msgstr ""
|
826 |
|
827 |
-
#: includes/options-profiles.php:
|
828 |
-
msgid "
|
829 |
msgstr ""
|
830 |
|
831 |
-
#: includes/options-profiles.php:
|
832 |
-
msgid "
|
833 |
msgstr ""
|
834 |
|
835 |
#: includes/options-profiles.php:259
|
836 |
-
msgid "
|
837 |
-
msgstr ""
|
838 |
-
|
839 |
-
#: includes/options-profiles.php:260
|
840 |
-
msgid "Controls display & Flash player loads immediately"
|
841 |
msgstr ""
|
842 |
|
843 |
-
#: includes/options-profiles.php:
|
844 |
-
msgid "
|
845 |
-
msgstr ""
|
846 |
-
|
847 |
-
#: includes/options-profiles.php:262
|
848 |
-
msgid ""
|
849 |
-
"Whether the video player controls will display. For AS3 player it also "
|
850 |
-
"defines when the Flash player will load"
|
851 |
msgstr ""
|
852 |
|
853 |
#: includes/options-profiles.php:267
|
854 |
-
msgid ""
|
855 |
-
"Use SSL? <a href=\"http://www.google.com/support/youtube/bin/answer.py?"
|
856 |
-
"answer=171780&expand=UseHTTPS#HTTPS\">Read more</a>"
|
857 |
-
msgstr ""
|
858 |
-
|
859 |
-
#: includes/options-profiles.php:271 includes/options-widgets.php:147
|
860 |
-
msgid "Loop Video"
|
861 |
msgstr ""
|
862 |
|
863 |
-
#: includes/options-profiles.php:
|
864 |
-
msgid ""
|
865 |
-
"Play the initial video again and again. In the case of a playlist, this will "
|
866 |
-
"play the entire playlist and then start again at the first video"
|
867 |
msgstr ""
|
868 |
|
869 |
-
#: includes/options-profiles.php:
|
870 |
-
msgid "
|
871 |
msgstr ""
|
872 |
|
873 |
#: includes/options-profiles.php:277
|
874 |
-
msgid ""
|
875 |
-
"Display the video title and uploader before the video starts. If displaying "
|
876 |
-
"a playlist this will show video thumbnails"
|
877 |
-
msgstr ""
|
878 |
-
|
879 |
-
#: includes/options-profiles.php:281
|
880 |
-
msgid "Related Videos"
|
881 |
msgstr ""
|
882 |
|
883 |
-
#: includes/options-profiles.php:
|
884 |
-
msgid ""
|
885 |
-
"Load related videos once playback starts. Also toggles the search option."
|
886 |
msgstr ""
|
887 |
|
888 |
-
#: includes/options-profiles.php:
|
889 |
-
msgid "
|
890 |
msgstr ""
|
891 |
|
892 |
-
#: includes/options-profiles.php:
|
893 |
-
msgid "
|
|
|
|
|
894 |
msgstr ""
|
895 |
|
896 |
#: includes/options-profiles.php:289
|
897 |
-
msgid "
|
898 |
msgstr ""
|
899 |
|
900 |
#: includes/options-profiles.php:290
|
901 |
-
msgid "
|
902 |
-
msgstr ""
|
903 |
-
|
904 |
-
#: includes/options-profiles.php:294
|
905 |
-
msgid "Progress Bar Color"
|
906 |
-
msgstr ""
|
907 |
-
|
908 |
-
#: includes/options-profiles.php:296
|
909 |
-
msgid "Red"
|
910 |
msgstr ""
|
911 |
|
912 |
-
#: includes/options-profiles.php:
|
913 |
-
msgid "
|
914 |
msgstr ""
|
915 |
|
916 |
-
#: includes/options-profiles.php:
|
917 |
msgid ""
|
918 |
-
"
|
919 |
-
"the
|
920 |
msgstr ""
|
921 |
|
922 |
-
#: includes/options-profiles.php:
|
923 |
-
msgid "
|
924 |
msgstr ""
|
925 |
|
926 |
-
#: includes/options-profiles.php:
|
927 |
-
msgid "
|
928 |
msgstr ""
|
929 |
|
930 |
-
#: includes/options-profiles.php:
|
931 |
-
msgid "
|
932 |
msgstr ""
|
933 |
|
934 |
#: includes/options-profiles.php:309
|
935 |
-
msgid ""
|
936 |
-
"The following options are not supported if using EmbedPlus or if the IFRAME "
|
937 |
-
"player uses HTML5."
|
938 |
msgstr ""
|
939 |
|
940 |
-
#: includes/options-profiles.php:
|
941 |
-
msgid "
|
942 |
msgstr ""
|
943 |
|
944 |
-
#: includes/options-profiles.php:
|
945 |
-
msgid "
|
946 |
msgstr ""
|
947 |
|
948 |
#: includes/options-profiles.php:318
|
949 |
-
msgid "
|
950 |
-
msgstr ""
|
951 |
-
|
952 |
-
#: includes/options-profiles.php:319
|
953 |
-
msgid ""
|
954 |
-
"Show closed captions (subtitles) by default, even if the user has turned "
|
955 |
-
"captions off"
|
956 |
msgstr ""
|
957 |
|
958 |
-
#: includes/options-profiles.php:
|
959 |
-
msgid "
|
960 |
msgstr ""
|
961 |
|
962 |
-
#: includes/options-profiles.php:
|
963 |
-
msgid "
|
964 |
msgstr ""
|
965 |
|
966 |
#: includes/options-profiles.php:328
|
967 |
-
msgid "
|
968 |
msgstr ""
|
969 |
|
970 |
#: includes/options-profiles.php:329
|
971 |
-
msgid "
|
972 |
msgstr ""
|
973 |
|
974 |
-
#: includes/options-profiles.php:
|
975 |
-
msgid "
|
|
|
|
|
976 |
msgstr ""
|
977 |
|
978 |
#: includes/options-profiles.php:334
|
979 |
-
msgid "
|
980 |
msgstr ""
|
981 |
|
982 |
#: includes/options-profiles.php:339
|
983 |
-
msgid "
|
984 |
-
msgstr ""
|
985 |
-
|
986 |
-
#: includes/options-profiles.php:343
|
987 |
-
msgid "Window Mode"
|
988 |
-
msgstr ""
|
989 |
-
|
990 |
-
#: includes/options-profiles.php:345
|
991 |
-
msgid "Opaque"
|
992 |
msgstr ""
|
993 |
|
994 |
-
#: includes/options-profiles.php:
|
995 |
-
|
|
|
996 |
msgstr ""
|
997 |
|
998 |
#: includes/options-profiles.php:347
|
999 |
-
msgid "
|
1000 |
-
msgstr ""
|
1001 |
-
|
1002 |
-
#: includes/options-profiles.php:348
|
1003 |
-
msgid ""
|
1004 |
-
"Sets the Window Mode property of the Flash movie for transparency, layering, "
|
1005 |
-
"and positioning in the browser. <a href=\"http://www.communitymx.com/content/"
|
1006 |
-
"article.cfm?cid=e5141\">Learn more</a>."
|
1007 |
msgstr ""
|
1008 |
|
1009 |
-
#: includes/options-profiles.php:
|
1010 |
-
msgid "
|
1011 |
msgstr ""
|
1012 |
|
1013 |
#: includes/options-profiles.php:355
|
1014 |
-
msgid "
|
1015 |
-
msgstr ""
|
1016 |
-
|
1017 |
-
#: includes/options-profiles.php:359
|
1018 |
-
msgid "Fallback Embed Type"
|
1019 |
-
msgstr ""
|
1020 |
-
|
1021 |
-
#: includes/options-profiles.php:360
|
1022 |
-
msgid ""
|
1023 |
-
"The type of player to use if Flash is not available and EmbedPlus cannot be "
|
1024 |
-
"used."
|
1025 |
-
msgstr ""
|
1026 |
-
|
1027 |
-
#: includes/options-profiles.php:366
|
1028 |
-
msgid "Play HD"
|
1029 |
-
msgstr ""
|
1030 |
-
|
1031 |
-
#: includes/options-profiles.php:367
|
1032 |
-
msgid "Play the video in HD if possible"
|
1033 |
-
msgstr ""
|
1034 |
-
|
1035 |
-
#: includes/options-profiles.php:371
|
1036 |
-
msgid "Real-time Reactions"
|
1037 |
-
msgstr ""
|
1038 |
-
|
1039 |
-
#: includes/options-profiles.php:372
|
1040 |
-
msgid "Show the Real-time Reactions button"
|
1041 |
-
msgstr ""
|
1042 |
-
|
1043 |
-
#: includes/options-profiles.php:376
|
1044 |
-
msgid "Sweet Spots"
|
1045 |
msgstr ""
|
1046 |
|
1047 |
-
#: includes/options-profiles.php:
|
1048 |
-
msgid "
|
1049 |
msgstr ""
|
1050 |
|
1051 |
-
#: includes/options-profiles.php:
|
1052 |
msgid "YouTube Video Sample"
|
1053 |
msgstr ""
|
1054 |
|
1055 |
-
#: includes/options-profiles.php:
|
1056 |
msgid ""
|
1057 |
"The video below uses the above, saved profile settings. Use the drop-down "
|
1058 |
"below to change which parameters the video uses - press the Change Video "
|
1059 |
"button to update it."
|
1060 |
msgstr ""
|
1061 |
|
1062 |
-
#: includes/options-profiles.php:
|
1063 |
msgid "Standard"
|
1064 |
msgstr ""
|
1065 |
|
1066 |
-
#: includes/options-profiles.php:
|
1067 |
msgid "3D"
|
1068 |
msgstr ""
|
1069 |
|
1070 |
-
#: includes/options-profiles.php:
|
1071 |
msgid "Playlist"
|
1072 |
msgstr ""
|
1073 |
|
1074 |
-
#: includes/options-profiles.php:
|
1075 |
msgid "Change video"
|
1076 |
msgstr ""
|
1077 |
|
1078 |
-
#: includes/
|
1079 |
-
msgid "Widget Title"
|
1080 |
-
msgstr ""
|
1081 |
-
|
1082 |
-
#: includes/options-widgets.php:27
|
1083 |
-
msgid "ID Type"
|
1084 |
-
msgstr ""
|
1085 |
-
|
1086 |
-
#: includes/options-widgets.php:29
|
1087 |
-
msgid "Video or Playlist"
|
1088 |
-
msgstr ""
|
1089 |
-
|
1090 |
-
#: includes/options-widgets.php:31
|
1091 |
-
msgid "Search"
|
1092 |
-
msgstr ""
|
1093 |
-
|
1094 |
-
#: includes/options-widgets.php:33
|
1095 |
-
msgid "User"
|
1096 |
-
msgstr ""
|
1097 |
-
|
1098 |
-
#: includes/options-widgets.php:41 includes/shared-functions.php:429
|
1099 |
-
msgid "Profile"
|
1100 |
-
msgstr ""
|
1101 |
-
|
1102 |
-
#: includes/options-widgets.php:61
|
1103 |
-
msgid "Size"
|
1104 |
-
msgstr ""
|
1105 |
-
|
1106 |
-
#: includes/options-widgets.php:75 includes/options-widgets.php:87
|
1107 |
-
#: includes/options-widgets.php:103 includes/options-widgets.php:135
|
1108 |
-
#: includes/options-widgets.php:149
|
1109 |
-
msgid "Profile default"
|
1110 |
-
msgstr ""
|
1111 |
-
|
1112 |
-
#: includes/options-widgets.php:77 includes/options-widgets.php:105
|
1113 |
-
#: includes/options-widgets.php:151
|
1114 |
-
msgid "No"
|
1115 |
-
msgstr ""
|
1116 |
-
|
1117 |
-
#: includes/options-widgets.php:79 includes/options-widgets.php:107
|
1118 |
-
#: includes/options-widgets.php:153
|
1119 |
-
msgid "Yes"
|
1120 |
-
msgstr ""
|
1121 |
-
|
1122 |
-
#: includes/options-widgets.php:85
|
1123 |
-
msgid "Embed Type"
|
1124 |
-
msgstr ""
|
1125 |
-
|
1126 |
-
#: includes/options-widgets.php:113
|
1127 |
-
msgid "Start (seconds)"
|
1128 |
-
msgstr ""
|
1129 |
-
|
1130 |
-
#: includes/options-widgets.php:119
|
1131 |
-
msgid "Stop (seconds)"
|
1132 |
-
msgstr ""
|
1133 |
-
|
1134 |
-
#: includes/options-widgets.php:124
|
1135 |
-
msgid "Non-EmbedPlus Options"
|
1136 |
-
msgstr ""
|
1137 |
-
|
1138 |
-
#: includes/options-widgets.php:133
|
1139 |
-
msgid "List Playback"
|
1140 |
-
msgstr ""
|
1141 |
-
|
1142 |
-
#: includes/options-widgets.php:137
|
1143 |
-
msgid "Play each video in order"
|
1144 |
-
msgstr ""
|
1145 |
-
|
1146 |
-
#: includes/options-widgets.php:139
|
1147 |
-
msgid "Play videos randomly"
|
1148 |
-
msgstr ""
|
1149 |
-
|
1150 |
-
#: includes/options-widgets.php:141
|
1151 |
-
msgid "Play one random video"
|
1152 |
-
msgstr ""
|
1153 |
-
|
1154 |
-
#: includes/set-defaults.php:95
|
1155 |
msgid "The video cannot be shown at the moment. Please try again later."
|
1156 |
msgstr ""
|
2 |
msgstr ""
|
3 |
"Project-Id-Version: Vixy YouTube Embed\n"
|
4 |
"Report-Msgid-Bugs-To: \n"
|
5 |
+
"POT-Creation-Date: 2015-11-09 14:20-0000\n"
|
6 |
+
"PO-Revision-Date: 2015-11-09 14:20-0000\n"
|
7 |
"Last-Translator: David Artiss <david.artiss@artiss.co.uk>\n"
|
8 |
"Language-Team: \n"
|
9 |
"Language: en_GB\n"
|
17 |
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
18 |
"X-Poedit-SearchPath-0: .\n"
|
19 |
|
20 |
+
#: includes/add-scripts.php:94 includes/generate-widgets.php:25
|
21 |
msgid "YouTube Embed"
|
22 |
msgstr ""
|
23 |
|
24 |
+
#: includes/add-scripts.php:99 includes/admin-config.php:92
|
25 |
msgid "Options"
|
26 |
msgstr ""
|
27 |
|
28 |
+
#: includes/add-scripts.php:106 includes/admin-config.php:100
|
29 |
msgid "Profiles"
|
30 |
msgstr ""
|
31 |
|
32 |
+
#: includes/add-scripts.php:113 includes/admin-config.php:108
|
33 |
msgid "Lists"
|
34 |
msgstr ""
|
35 |
|
57 |
msgid "YouTube Embed Options"
|
58 |
msgstr ""
|
59 |
|
60 |
+
#: includes/admin-config.php:100 includes/options-profiles.php:20
|
61 |
msgid "YouTube Embed Profiles"
|
62 |
msgstr ""
|
63 |
|
66 |
msgstr ""
|
67 |
|
68 |
#: includes/admin-config.php:175 includes/admin-config.php:216
|
69 |
+
#: includes/admin-config.php:260
|
70 |
msgid "Help"
|
71 |
msgstr ""
|
72 |
|
74 |
msgid ""
|
75 |
"This screen allows you to select non-specific options for the YouTube Embed "
|
76 |
"plugin. For the default embedding settings, please select the <a href="
|
77 |
+
"\"admin.php?page=ye-profile-options\">Profiles</a> administration option."
|
78 |
msgstr ""
|
79 |
|
80 |
+
#: includes/admin-config.php:191 includes/admin-config.php:235
|
81 |
+
#: includes/admin-config.php:276
|
82 |
msgid ""
|
83 |
+
"Remember to click the Save Changes button at the bottom of the screen for "
|
84 |
"new settings to take effect."
|
85 |
msgstr ""
|
86 |
|
87 |
+
#: includes/admin-config.php:192 includes/admin-config.php:236
|
88 |
+
#: includes/admin-config.php:277
|
89 |
msgid "For more information:"
|
90 |
msgstr ""
|
91 |
|
92 |
+
#: includes/admin-config.php:193 includes/admin-config.php:237
|
93 |
+
#: includes/admin-config.php:278
|
94 |
msgid "YouTube Embed Plugin Documentation"
|
95 |
msgstr ""
|
96 |
|
97 |
+
#: includes/admin-config.php:194 includes/admin-config.php:238
|
98 |
+
#: includes/admin-config.php:279
|
99 |
msgid "YouTube Player Documentation"
|
100 |
msgstr ""
|
101 |
|
108 |
"required."
|
109 |
msgstr ""
|
110 |
|
111 |
+
#: includes/admin-config.php:232
|
|
|
|
|
|
|
|
|
112 |
msgid ""
|
113 |
+
"All settings will work whether the Flash or HTML5 player is used, unless one "
|
114 |
+
"of the following icons is shown, indicating which format the option works "
|
115 |
+
"with..."
|
116 |
msgstr ""
|
117 |
|
118 |
+
#: includes/admin-config.php:233
|
119 |
+
msgid "Flash player"
|
120 |
msgstr ""
|
121 |
|
122 |
+
#: includes/admin-config.php:234
|
123 |
+
msgid "HTML5 player"
|
124 |
msgstr ""
|
125 |
|
126 |
+
#: includes/admin-config.php:275
|
127 |
msgid ""
|
128 |
+
"This screen allows you to create lists of YouTube videos, which may be "
|
129 |
+
"named. These lists can then be used in preference to a single video ID."
|
130 |
msgstr ""
|
131 |
|
132 |
+
#: includes/generate-embed-code.php:60
|
133 |
+
msgid "No video/playlist ID has been supplied"
|
|
|
|
|
134 |
msgstr ""
|
135 |
|
136 |
+
#: includes/generate-embed-code.php:107 includes/generate-other-code.php:33
|
137 |
+
#: includes/generate-other-code.php:75 includes/generate-other-code.php:120
|
|
|
|
|
|
|
|
|
138 |
#, php-format
|
139 |
msgid "The YouTube ID of %s is invalid."
|
140 |
msgstr ""
|
141 |
|
142 |
+
#: includes/generate-embed-code.php:179
|
143 |
+
msgid ""
|
144 |
+
"A video list cannot be viewed within this feed - please view the original "
|
145 |
+
"content"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
146 |
msgstr ""
|
147 |
|
148 |
+
#: includes/generate-embed-code.php:183
|
149 |
+
msgid "Click here to view the video on YouTube"
|
150 |
msgstr ""
|
151 |
|
152 |
+
#: includes/generate-embed-code.php:380
|
153 |
msgid ""
|
154 |
+
"The maximum URL length has been exceeded. Please reduce your parameter and/"
|
155 |
+
"or playlist."
|
156 |
msgstr ""
|
157 |
|
158 |
+
#: includes/generate-other-code.php:20
|
159 |
+
msgid "No YouTube ID was found."
|
160 |
msgstr ""
|
161 |
|
162 |
+
#: includes/generate-other-code.php:63
|
163 |
msgid "No video ID has been supplied"
|
164 |
msgstr ""
|
165 |
|
166 |
+
#: includes/generate-other-code.php:132
|
167 |
#, php-format
|
168 |
msgid "YouTube Video %s"
|
169 |
msgstr ""
|
172 |
msgid "Embed YouTube Widget."
|
173 |
msgstr ""
|
174 |
|
175 |
+
#: includes/generate-widgets.php:142
|
176 |
+
msgid "Widget Title"
|
177 |
msgstr ""
|
178 |
|
179 |
+
#: includes/generate-widgets.php:148 includes/options-lists.php:136
|
180 |
+
msgid "Video ID"
|
181 |
msgstr ""
|
182 |
|
183 |
+
#: includes/generate-widgets.php:156
|
184 |
+
msgid "ID Type"
|
|
|
|
|
|
|
185 |
msgstr ""
|
186 |
|
187 |
+
#: includes/generate-widgets.php:158
|
188 |
+
msgid "Video or Playlist"
|
189 |
msgstr ""
|
190 |
|
191 |
+
#: includes/generate-widgets.php:160
|
192 |
+
msgid "Search"
|
193 |
msgstr ""
|
194 |
|
195 |
+
#: includes/generate-widgets.php:162
|
196 |
+
msgid "User"
|
197 |
msgstr ""
|
198 |
|
199 |
+
#: includes/generate-widgets.php:170 includes/shared-functions.php:366
|
200 |
+
msgid "Profile"
|
201 |
msgstr ""
|
202 |
|
203 |
+
#: includes/generate-widgets.php:180
|
204 |
+
msgid "Start (seconds)"
|
205 |
msgstr ""
|
206 |
|
207 |
+
#: includes/generate-widgets.php:186
|
208 |
+
msgid "Stop (seconds)"
|
|
|
209 |
msgstr ""
|
210 |
|
211 |
+
#: includes/generate-widgets.php:194
|
212 |
+
msgid "List Playback"
|
213 |
msgstr ""
|
214 |
|
215 |
+
#: includes/generate-widgets.php:196
|
216 |
+
msgid "Profile default"
|
217 |
msgstr ""
|
218 |
|
219 |
+
#: includes/generate-widgets.php:198
|
220 |
+
msgid "Play each video in order"
|
221 |
msgstr ""
|
222 |
|
223 |
+
#: includes/generate-widgets.php:200
|
224 |
+
msgid "Play videos randomly"
|
225 |
msgstr ""
|
226 |
|
227 |
+
#: includes/generate-widgets.php:202
|
228 |
+
msgid "Play one random video"
|
|
|
|
|
229 |
msgstr ""
|
230 |
|
231 |
+
#: includes/options-general.php:47 includes/options-lists.php:27
|
232 |
+
msgid "Settings Saved."
|
233 |
msgstr ""
|
234 |
|
235 |
+
#: includes/options-general.php:61
|
236 |
+
msgid "Cache cleared."
|
237 |
msgstr ""
|
238 |
|
239 |
+
#: includes/options-general.php:73
|
240 |
+
msgid ""
|
241 |
+
"These are the general settings for YouTube Embed. Please select <a href="
|
242 |
+
"\"admin.php?page=ye-profile-options\">Profiles</a> for default embedding "
|
243 |
+
"settings."
|
244 |
msgstr ""
|
245 |
|
246 |
+
#: includes/options-general.php:77
|
247 |
+
msgid "Embedding"
|
248 |
msgstr ""
|
249 |
|
250 |
+
#: includes/options-general.php:82
|
251 |
+
msgid "Add Metadata"
|
252 |
msgstr ""
|
253 |
|
254 |
+
#: includes/options-general.php:84
|
255 |
+
msgid "Allow rich metadata to be added to code"
|
256 |
msgstr ""
|
257 |
|
258 |
+
#: includes/options-general.php:90
|
259 |
+
msgid "Feed"
|
260 |
msgstr ""
|
261 |
|
262 |
+
#: includes/options-general.php:92
|
263 |
+
msgid "Text link"
|
264 |
msgstr ""
|
265 |
|
266 |
+
#: includes/options-general.php:93
|
267 |
+
msgid "Thumbnail"
|
|
|
|
|
268 |
msgstr ""
|
269 |
|
270 |
+
#: includes/options-general.php:94
|
271 |
+
msgid "Thumbnail & Text Link"
|
272 |
msgstr ""
|
273 |
|
274 |
+
#: includes/options-general.php:96
|
275 |
msgid ""
|
276 |
+
"Videos cannot be embedded in feeds. Select how you wish them to be shown "
|
277 |
+
"instead."
|
|
|
278 |
msgstr ""
|
279 |
|
280 |
+
#: includes/options-general.php:102
|
281 |
+
msgid "Thumbnail to use"
|
282 |
msgstr ""
|
283 |
|
284 |
+
#: includes/options-general.php:104 includes/shared-functions.php:359
|
285 |
+
msgid "Default"
|
286 |
msgstr ""
|
287 |
|
288 |
+
#: includes/options-general.php:105
|
289 |
+
msgid "Default (HQ)"
|
290 |
msgstr ""
|
291 |
|
292 |
+
#: includes/options-general.php:106
|
293 |
+
msgid "Start"
|
|
|
|
|
|
|
294 |
msgstr ""
|
295 |
|
296 |
+
#: includes/options-general.php:107
|
297 |
+
msgid "Middle"
|
298 |
msgstr ""
|
299 |
|
300 |
+
#: includes/options-general.php:108
|
301 |
+
msgid "End"
|
|
|
302 |
msgstr ""
|
303 |
|
304 |
+
#: includes/options-general.php:110
|
305 |
+
msgid "Choose which thumbnail to use."
|
306 |
msgstr ""
|
307 |
|
308 |
+
#: includes/options-general.php:113
|
309 |
+
msgid "Shortcodes"
|
310 |
msgstr ""
|
311 |
|
312 |
+
#: includes/options-general.php:118
|
313 |
+
msgid "Allow shortcodes in widgets"
|
314 |
msgstr ""
|
315 |
|
316 |
+
#: includes/options-general.php:120
|
317 |
+
msgid "Allow shortcodes to be used in widgets"
|
318 |
msgstr ""
|
319 |
|
320 |
+
#: includes/options-general.php:121
|
321 |
+
msgid "This will apply to <strong>all</strong> widgets."
|
322 |
msgstr ""
|
323 |
|
324 |
+
#: includes/options-general.php:127
|
325 |
+
msgid "Alternative Shortcode"
|
326 |
msgstr ""
|
327 |
|
328 |
+
#: includes/options-general.php:129
|
329 |
+
msgid "An alternative shortcode to use."
|
330 |
msgstr ""
|
331 |
|
332 |
+
#: includes/options-general.php:135
|
333 |
+
msgid "Profile to use"
|
334 |
msgstr ""
|
335 |
|
336 |
+
#: includes/options-general.php:141
|
337 |
+
msgid "Administration Options"
|
338 |
msgstr ""
|
339 |
|
340 |
+
#: includes/options-general.php:146 includes/options-general.php:154
|
341 |
+
msgid "Show Editor Button"
|
342 |
+
msgstr ""
|
343 |
+
|
344 |
+
#: includes/options-general.php:148
|
345 |
+
msgid "Show the YouTube button on the post editor"
|
346 |
+
msgstr ""
|
347 |
+
|
348 |
+
#: includes/options-general.php:156
|
349 |
msgid "Add link to options screen to Admin Bar"
|
350 |
msgstr ""
|
351 |
|
352 |
+
#: includes/options-general.php:162
|
353 |
msgid "Menu Screen Access"
|
354 |
msgstr ""
|
355 |
|
356 |
+
#: includes/options-general.php:164
|
357 |
msgid "Administrator"
|
358 |
msgstr ""
|
359 |
|
360 |
+
#: includes/options-general.php:165
|
361 |
msgid "Editor"
|
362 |
msgstr ""
|
363 |
|
364 |
+
#: includes/options-general.php:166
|
365 |
msgid "Author"
|
366 |
msgstr ""
|
367 |
|
368 |
+
#: includes/options-general.php:167
|
369 |
msgid "Contributor"
|
370 |
msgstr ""
|
371 |
|
372 |
+
#: includes/options-general.php:169
|
373 |
+
msgid "Specify the user access required for the menu screens."
|
374 |
msgstr ""
|
375 |
|
376 |
+
#: includes/options-general.php:172
|
377 |
msgid "Profile & List Sizes"
|
378 |
msgstr ""
|
379 |
|
380 |
+
#: includes/options-general.php:177
|
381 |
msgid "Number of Profiles"
|
382 |
msgstr ""
|
383 |
|
384 |
+
#: includes/options-general.php:179
|
385 |
+
msgid "Maximum number of profiles."
|
386 |
msgstr ""
|
387 |
|
388 |
+
#: includes/options-general.php:185
|
389 |
msgid "Number of Lists"
|
390 |
msgstr ""
|
391 |
|
392 |
+
#: includes/options-general.php:187
|
393 |
+
msgid "Maximum number of lists."
|
394 |
msgstr ""
|
395 |
|
396 |
+
#: includes/options-general.php:190
|
397 |
msgid "Performance"
|
398 |
msgstr ""
|
399 |
|
400 |
+
#: includes/options-general.php:198
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
401 |
msgid "You currently have cache for"
|
402 |
msgstr ""
|
403 |
|
404 |
+
#: includes/options-general.php:206
|
405 |
+
msgid "Embed Cache"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
406 |
msgstr ""
|
407 |
|
408 |
+
#: includes/options-general.php:208
|
409 |
+
msgid "How many hours to retain embed output. 0 to switch off."
|
|
|
|
|
410 |
msgstr ""
|
411 |
|
412 |
+
#: includes/options-general.php:214
|
413 |
+
msgid "Clear Cache"
|
414 |
msgstr ""
|
415 |
|
416 |
+
#: includes/options-general.php:216
|
417 |
+
msgid "Select this option to remove all YouTube Embed cache"
|
418 |
msgstr ""
|
419 |
|
420 |
+
#: includes/options-general.php:219
|
421 |
msgid "Security"
|
422 |
msgstr ""
|
423 |
|
424 |
+
#: includes/options-general.php:224
|
425 |
msgid "Privacy-Enhanced Mode"
|
426 |
msgstr ""
|
427 |
|
428 |
+
#: includes/options-general.php:226
|
429 |
msgid "Cookies should always be stored"
|
430 |
msgstr ""
|
431 |
|
432 |
+
#: includes/options-general.php:227
|
433 |
msgid "Cookies should never be stored"
|
434 |
msgstr ""
|
435 |
|
436 |
+
#: includes/options-general.php:228
|
437 |
msgid "Cookies should be stored based on user's Do Not Track setting"
|
438 |
msgstr ""
|
439 |
|
440 |
+
#: includes/options-general.php:230
|
441 |
+
msgid "Read more about <a href=\"http://donottrack.us/\">Do Not Track</a>."
|
442 |
msgstr ""
|
443 |
|
444 |
+
#: includes/options-general.php:233
|
445 |
msgid "Compatibility"
|
446 |
msgstr ""
|
447 |
|
448 |
+
#: includes/options-general.php:238
|
449 |
+
msgid "Frame Border"
|
450 |
+
msgstr ""
|
451 |
+
|
452 |
+
#: includes/options-general.php:240
|
453 |
msgid "Allow Frame Border on IFRAME"
|
454 |
msgstr ""
|
455 |
|
456 |
+
#: includes/options-general.php:241
|
457 |
+
msgid "FRAMEBORDER is not HTML5 compliant."
|
458 |
msgstr ""
|
459 |
|
460 |
+
#: includes/options-general.php:248 includes/options-lists.php:125
|
461 |
+
#: includes/options-profiles.php:364
|
462 |
+
msgid "Save Changes"
|
463 |
msgstr ""
|
464 |
|
465 |
#: includes/options-lists.php:32
|
489 |
"the drop-down on the right hand side to swap between lists."
|
490 |
msgstr ""
|
491 |
|
492 |
+
#: includes/options-lists.php:109
|
493 |
+
msgid "List Name"
|
494 |
msgstr ""
|
495 |
|
496 |
+
#: includes/options-lists.php:111
|
497 |
msgid "The name you wish to give this list"
|
498 |
msgstr ""
|
499 |
|
500 |
+
#: includes/options-lists.php:117
|
501 |
msgid "Video IDs (one per line)"
|
502 |
msgstr ""
|
503 |
|
504 |
+
#: includes/options-lists.php:136
|
|
|
|
|
|
|
|
|
505 |
msgid "Video Title"
|
506 |
msgstr ""
|
507 |
|
508 |
+
#: includes/options-lists.php:136
|
509 |
msgid "Status"
|
510 |
msgstr ""
|
511 |
|
512 |
+
#: includes/options-lists.php:151
|
513 |
msgid "This is a playlist"
|
514 |
msgstr ""
|
515 |
|
516 |
+
#: includes/options-lists.php:155
|
517 |
msgid "Invalid video ID"
|
518 |
msgstr ""
|
519 |
|
520 |
+
#: includes/options-lists.php:159
|
521 |
msgid "YouTube API error"
|
522 |
msgstr ""
|
523 |
|
524 |
+
#: includes/options-lists.php:162
|
525 |
msgid "Valid video"
|
526 |
msgstr ""
|
527 |
|
528 |
+
#: includes/options-lists.php:179
|
529 |
msgid "The video ID is valid"
|
530 |
msgstr ""
|
531 |
|
532 |
+
#: includes/options-lists.php:182
|
533 |
msgid "The video ID is invalid"
|
534 |
msgstr ""
|
535 |
|
536 |
+
#: includes/options-profiles.php:87
|
537 |
msgid " Profile Saved."
|
538 |
msgstr ""
|
539 |
|
540 |
+
#: includes/options-profiles.php:108
|
541 |
msgid "Change profile"
|
542 |
msgstr ""
|
543 |
|
544 |
+
#: includes/options-profiles.php:113
|
545 |
msgid "These are the options for the default profile."
|
546 |
msgstr ""
|
547 |
|
548 |
+
#: includes/options-profiles.php:115
|
549 |
#, php-format
|
550 |
msgid "These are the options for profile %s."
|
551 |
msgstr ""
|
552 |
|
553 |
+
#: includes/options-profiles.php:117
|
554 |
msgid "Use the drop-down on the right hand side to swap between profiles."
|
555 |
msgstr ""
|
556 |
|
557 |
+
#: includes/options-profiles.php:125
|
558 |
+
msgid "Profile Name"
|
559 |
msgstr ""
|
560 |
|
561 |
+
#: includes/options-profiles.php:127
|
562 |
msgid "The name you wish to give this profile"
|
563 |
msgstr ""
|
564 |
|
565 |
+
#: includes/options-profiles.php:133
|
566 |
+
msgid "Template"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
567 |
msgstr ""
|
568 |
|
569 |
+
#: includes/options-profiles.php:135
|
570 |
msgid ""
|
571 |
+
"Wrapper for video output. Must include <code>%video%</code> tag to show "
|
572 |
+
"video position."
|
573 |
msgstr ""
|
574 |
|
575 |
+
#: includes/options-profiles.php:141
|
576 |
+
msgid "Style"
|
|
|
577 |
msgstr ""
|
578 |
|
579 |
#: includes/options-profiles.php:143
|
580 |
+
msgid "CSS elements to apply to video."
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
581 |
msgstr ""
|
582 |
|
583 |
+
#: includes/options-profiles.php:149
|
584 |
+
msgid "SSL"
|
|
|
585 |
msgstr ""
|
586 |
|
587 |
+
#: includes/options-profiles.php:151
|
588 |
msgid ""
|
589 |
+
"Use SSL? <a href=\"http://www.google.com/support/youtube/bin/answer.py?"
|
590 |
+
"answer=171780&expand=UseHTTPS#HTTPS\">Read more</a>"
|
591 |
msgstr ""
|
592 |
|
593 |
+
#: includes/options-profiles.php:157
|
594 |
+
msgid "Window Mode"
|
595 |
msgstr ""
|
596 |
|
597 |
+
#: includes/options-profiles.php:159
|
598 |
+
msgid "Opaque"
|
599 |
msgstr ""
|
600 |
|
601 |
+
#: includes/options-profiles.php:160
|
602 |
+
msgid "Transparent"
|
603 |
msgstr ""
|
604 |
|
605 |
#: includes/options-profiles.php:161
|
606 |
+
msgid "Window"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
607 |
msgstr ""
|
608 |
|
609 |
+
#: includes/options-profiles.php:163
|
610 |
+
msgid ""
|
611 |
+
"Sets the Window Mode property of the Flash movie for transparency, layering, "
|
612 |
+
"and positioning in the browser. <a href=\"http://www.communitymx.com/content/"
|
613 |
+
"article.cfm?cid=e5141\">Learn more</a>."
|
614 |
msgstr ""
|
615 |
|
616 |
+
#: includes/options-profiles.php:166 includes/options-profiles.php:171
|
617 |
+
msgid "Video Size"
|
618 |
msgstr ""
|
619 |
|
620 |
+
#: includes/options-profiles.php:173
|
621 |
+
msgid "The width x height of the video, in pixels"
|
622 |
msgstr ""
|
623 |
|
624 |
+
#: includes/options-profiles.php:179
|
625 |
+
msgid "Default Sizes"
|
626 |
msgstr ""
|
627 |
|
628 |
+
#: includes/options-profiles.php:181
|
629 |
+
msgid "Use above sizes"
|
630 |
msgstr ""
|
631 |
|
632 |
+
#: includes/options-profiles.php:187
|
633 |
+
msgid "Select one of these default sizes to override the above video sizes."
|
634 |
msgstr ""
|
635 |
|
636 |
#: includes/options-profiles.php:193
|
637 |
+
msgid "Dynamically Resize"
|
|
|
|
|
|
|
|
|
638 |
msgstr ""
|
639 |
|
640 |
+
#: includes/options-profiles.php:195
|
641 |
+
msgid "Show full width and resize with the browser"
|
|
|
642 |
msgstr ""
|
643 |
|
644 |
+
#: includes/options-profiles.php:201
|
645 |
+
msgid "Set Maximum Size"
|
646 |
msgstr ""
|
647 |
|
648 |
#: includes/options-profiles.php:203
|
649 |
+
msgid "Use above width to define maximum size"
|
|
|
|
|
|
|
|
|
650 |
msgstr ""
|
651 |
|
652 |
+
#: includes/options-profiles.php:206
|
653 |
+
msgid "Playback"
|
654 |
msgstr ""
|
655 |
|
656 |
#: includes/options-profiles.php:211
|
657 |
+
msgid "Autoplay"
|
658 |
msgstr ""
|
659 |
|
660 |
+
#: includes/options-profiles.php:213
|
661 |
+
msgid ""
|
662 |
+
"Choose whether the initial video will automatically start to play when the "
|
663 |
+
"player loads"
|
664 |
msgstr ""
|
665 |
|
666 |
+
#: includes/options-profiles.php:219
|
667 |
+
msgid "Loop Video"
|
668 |
msgstr ""
|
669 |
|
670 |
+
#: includes/options-profiles.php:221
|
671 |
+
msgid "Play the initial video again and again"
|
672 |
msgstr ""
|
673 |
|
674 |
#: includes/options-profiles.php:222
|
675 |
+
msgid ""
|
676 |
+
"In the case of a playlist, this will play the entire playlist and then start "
|
677 |
+
"again at the first video."
|
678 |
msgstr ""
|
679 |
|
680 |
#: includes/options-profiles.php:228
|
681 |
+
msgid "Annotations"
|
|
|
|
|
|
|
|
|
682 |
msgstr ""
|
683 |
|
684 |
+
#: includes/options-profiles.php:230
|
685 |
+
msgid "Video annotations are shown by default"
|
686 |
msgstr ""
|
687 |
|
688 |
+
#: includes/options-profiles.php:236
|
689 |
+
msgid "Closed Captions"
|
690 |
msgstr ""
|
691 |
|
692 |
#: includes/options-profiles.php:238
|
693 |
+
msgid "Show closed captions (subtitles)"
|
694 |
msgstr ""
|
695 |
|
696 |
+
#: includes/options-profiles.php:239
|
697 |
+
msgid "This will even override even the user's choice."
|
|
|
|
|
|
|
|
|
698 |
msgstr ""
|
699 |
|
700 |
+
#: includes/options-profiles.php:242 includes/options-profiles.php:247
|
701 |
+
msgid "Information"
|
702 |
msgstr ""
|
703 |
|
704 |
+
#: includes/options-profiles.php:249
|
705 |
+
msgid "Display the video title and uploader before the video starts"
|
706 |
msgstr ""
|
707 |
|
708 |
+
#: includes/options-profiles.php:250
|
709 |
+
msgid "If displaying a playlist this will show video thumbnails."
|
710 |
msgstr ""
|
711 |
|
712 |
+
#: includes/options-profiles.php:256
|
713 |
+
msgid "Related Videos"
|
714 |
msgstr ""
|
715 |
|
716 |
+
#: includes/options-profiles.php:258
|
717 |
+
msgid "Load related videos once playback starts"
|
718 |
msgstr ""
|
719 |
|
720 |
#: includes/options-profiles.php:259
|
721 |
+
msgid "Also toggles the search option."
|
|
|
|
|
|
|
|
|
722 |
msgstr ""
|
723 |
|
724 |
+
#: includes/options-profiles.php:265
|
725 |
+
msgid "Modest Branding"
|
|
|
|
|
|
|
|
|
|
|
|
|
726 |
msgstr ""
|
727 |
|
728 |
#: includes/options-profiles.php:267
|
729 |
+
msgid "Reduce branding on video"
|
|
|
|
|
|
|
|
|
|
|
|
|
730 |
msgstr ""
|
731 |
|
732 |
+
#: includes/options-profiles.php:270 includes/options-profiles.php:287
|
733 |
+
msgid "Controls"
|
|
|
|
|
734 |
msgstr ""
|
735 |
|
736 |
+
#: includes/options-profiles.php:275
|
737 |
+
msgid "Auto hide"
|
738 |
msgstr ""
|
739 |
|
740 |
#: includes/options-profiles.php:277
|
741 |
+
msgid "Controls & progress bar remain visible"
|
|
|
|
|
|
|
|
|
|
|
|
|
742 |
msgstr ""
|
743 |
|
744 |
+
#: includes/options-profiles.php:278
|
745 |
+
msgid "Controls & progress bar fade out"
|
|
|
746 |
msgstr ""
|
747 |
|
748 |
+
#: includes/options-profiles.php:279
|
749 |
+
msgid "Progress bar fades"
|
750 |
msgstr ""
|
751 |
|
752 |
+
#: includes/options-profiles.php:281
|
753 |
+
msgid ""
|
754 |
+
"Whether the video controls will automatically hide after a video begins "
|
755 |
+
"playing."
|
756 |
msgstr ""
|
757 |
|
758 |
#: includes/options-profiles.php:289
|
759 |
+
msgid "Controls do not display & Flash player loads immediately"
|
760 |
msgstr ""
|
761 |
|
762 |
#: includes/options-profiles.php:290
|
763 |
+
msgid "Controls display & Flash player loads immediately"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
764 |
msgstr ""
|
765 |
|
766 |
+
#: includes/options-profiles.php:291
|
767 |
+
msgid "Controls display & Flash player loads once video starts"
|
768 |
msgstr ""
|
769 |
|
770 |
+
#: includes/options-profiles.php:293
|
771 |
msgid ""
|
772 |
+
"Whether the video player controls are displayed. For Flash it also defines "
|
773 |
+
"when the controls display in the player as well as when the player will load."
|
774 |
msgstr ""
|
775 |
|
776 |
+
#: includes/options-profiles.php:299
|
777 |
+
msgid "Disable Keyboard"
|
778 |
msgstr ""
|
779 |
|
780 |
+
#: includes/options-profiles.php:301
|
781 |
+
msgid "Disable the player keyboard controls"
|
782 |
msgstr ""
|
783 |
|
784 |
+
#: includes/options-profiles.php:307
|
785 |
+
msgid "Fullscreen"
|
786 |
msgstr ""
|
787 |
|
788 |
#: includes/options-profiles.php:309
|
789 |
+
msgid "A button will allow the viewer to watch the video fullscreen"
|
|
|
|
|
790 |
msgstr ""
|
791 |
|
792 |
+
#: includes/options-profiles.php:315
|
793 |
+
msgid "Theme"
|
794 |
msgstr ""
|
795 |
|
796 |
+
#: includes/options-profiles.php:317
|
797 |
+
msgid "Dark"
|
798 |
msgstr ""
|
799 |
|
800 |
#: includes/options-profiles.php:318
|
801 |
+
msgid "Light"
|
|
|
|
|
|
|
|
|
|
|
|
|
802 |
msgstr ""
|
803 |
|
804 |
+
#: includes/options-profiles.php:320
|
805 |
+
msgid "Display player controls within a dark or light control bar."
|
806 |
msgstr ""
|
807 |
|
808 |
+
#: includes/options-profiles.php:326
|
809 |
+
msgid "Progress Bar Color"
|
810 |
msgstr ""
|
811 |
|
812 |
#: includes/options-profiles.php:328
|
813 |
+
msgid "Red"
|
814 |
msgstr ""
|
815 |
|
816 |
#: includes/options-profiles.php:329
|
817 |
+
msgid "White (desaturated)"
|
818 |
msgstr ""
|
819 |
|
820 |
+
#: includes/options-profiles.php:331
|
821 |
+
msgid ""
|
822 |
+
"The color that will be used in the player's video progress bar to highlight "
|
823 |
+
"the amount of the video that's already been seen."
|
824 |
msgstr ""
|
825 |
|
826 |
#: includes/options-profiles.php:334
|
827 |
+
msgid "Download Link"
|
828 |
msgstr ""
|
829 |
|
830 |
#: includes/options-profiles.php:339
|
831 |
+
msgid "Show Download Link"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
832 |
msgstr ""
|
833 |
|
834 |
+
#: includes/options-profiles.php:341
|
835 |
+
#, php-format
|
836 |
+
msgid "Show a link to %s under the video"
|
837 |
msgstr ""
|
838 |
|
839 |
#: includes/options-profiles.php:347
|
840 |
+
msgid "Download Text"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
841 |
msgstr ""
|
842 |
|
843 |
+
#: includes/options-profiles.php:349
|
844 |
+
msgid "Text or HTML to display to prompt download."
|
845 |
msgstr ""
|
846 |
|
847 |
#: includes/options-profiles.php:355
|
848 |
+
msgid "Download Style"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
849 |
msgstr ""
|
850 |
|
851 |
+
#: includes/options-profiles.php:357
|
852 |
+
msgid "CSS elements to apply to video download link."
|
853 |
msgstr ""
|
854 |
|
855 |
+
#: includes/options-profiles.php:370
|
856 |
msgid "YouTube Video Sample"
|
857 |
msgstr ""
|
858 |
|
859 |
+
#: includes/options-profiles.php:371
|
860 |
msgid ""
|
861 |
"The video below uses the above, saved profile settings. Use the drop-down "
|
862 |
"below to change which parameters the video uses - press the Change Video "
|
863 |
"button to update it."
|
864 |
msgstr ""
|
865 |
|
866 |
+
#: includes/options-profiles.php:373
|
867 |
msgid "Standard"
|
868 |
msgstr ""
|
869 |
|
870 |
+
#: includes/options-profiles.php:374
|
871 |
msgid "3D"
|
872 |
msgstr ""
|
873 |
|
874 |
+
#: includes/options-profiles.php:375
|
875 |
msgid "Playlist"
|
876 |
msgstr ""
|
877 |
|
878 |
+
#: includes/options-profiles.php:378
|
879 |
msgid "Change video"
|
880 |
msgstr ""
|
881 |
|
882 |
+
#: includes/shared-functions.php:466
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
883 |
msgid "The video cannot be shown at the moment. Please try again later."
|
884 |
msgstr ""
|
readme.txt
CHANGED
@@ -1,10 +1,10 @@
|
|
1 |
-
=== YouTube Embed ===
|
2 |
Contributors: dartiss
|
3 |
Donate link: http://artiss.co.uk/donate
|
4 |
Tags: annotations, artiss, chromecast, comments, download, embed, embedding, embedplus, flash, flv, hd, iframe, media, play, playlist, profile, responsive, seo, url, video, widget, youtube, youtuber
|
5 |
Requires at least: 3.9
|
6 |
Tested up to: 4.3.1
|
7 |
-
Stable tag:
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -12,26 +12,24 @@ A simple to use method of embedding YouTube videos into your posts and pages but
|
|
12 |
|
13 |
== Description ==
|
14 |
|
|
|
|
|
15 |
YouTube Embed is an incredibly simple, yet powerful, method of embedding YouTube videos into your WordPress site. Options include:
|
16 |
|
17 |
* XHTML and HTML5 compliant - works with all the latest browsers
|
18 |
-
* Multiple embedding methods available - OBJECT, IFRAME, CHROMELESS and EmbedPlus
|
19 |
* Dynamic video sizing for responsive sites
|
20 |
-
* Allow users to add videos to comments
|
21 |
* Build your own playlists and play them back however you want
|
22 |
* Automatically generate playlists based on user name or search text
|
23 |
* Create multiple profiles - use them for different videos to get the exact style that you want
|
24 |
* Google compatible metadata is added to the video output - great for SEO!
|
25 |
-
* Using a different YouTube plugin? Documentation and tools are provided to help you migrate to YouTube Embed
|
26 |
* Fully internationalized ready for translations. **If you would like to add a translation to his plugin then please [contact me](http://www.artiss.co.uk/plugin-contact "Contact")**
|
27 |
* Support for Do Not Track
|
28 |
* Compatible with [Video SEO for WordPress](http://yoast.com/wordpress/video-seo/ "Video SEO for WordPress")
|
|
|
29 |
* Works "out of the box" with 4K, 60FPS and Chromecast - stream your embedded videos to your TV!
|
30 |
* And much, much more!
|
31 |
|
32 |
-
There are no premium features and no adverts - this is 100% complete and free!
|
33 |
-
|
34 |
-
See the "Other Notes" tab for how to get started as well as the more advanced features. How easy is it to use? The fine people at [Webucator](https://www.webucator.com "Webucator") have put together an excellent video showing you how to get started with it..
|
35 |
|
36 |
https://www.youtube.com/watch?v=Wc7cvpQS-xQ
|
37 |
|
@@ -49,76 +47,50 @@ A basic shortcode will embed your video using your default profile settings. How
|
|
49 |
|
50 |
e.g. `[youtube width=300 height=200]Z_sCoHGIpU0[/youtube]`
|
51 |
|
52 |
-
Which options are available depends upon the embedding type you're using
|
53 |
|
54 |
-
|
55 |
-
|
56 |
-
* **audio** - yes or no, this will hide the video and display just the toolbar (ideal for audio only playback) if switched on
|
57 |
* **autoplay** - yes or no, should the video automatically start playing?
|
|
|
|
|
|
|
|
|
58 |
* **dynamic** - whether to use dynamic sizing or not. When switched on the video will resize when your site does (i.e. responsive). If a video width is supplied this will be the maximum width, otherwise full width will be assumed. Height is ignored and will be worked out automatically.
|
|
|
59 |
* **height** - the video height, in pixels
|
|
|
|
|
60 |
* **list** - if you've specified your own list, use this to select the way the videos should be output. Should be `random` (display videos in a random order), `single` (show just one video, randomly picked from the list) or `order` (show each video in the original order - this is the default)
|
|
|
|
|
61 |
* **profile** - specify a different default profile (see section on Profiles for further details)
|
62 |
* **ratio** - allows you to define a window ratio - specify just a height or width and the ratio will calculate the missing dimension. Uses the format x:x, e.g. 4:3, 16:9
|
|
|
|
|
63 |
* **ssl** - Use SSL or not? Basically, if set on the URL will be HTTPS rather than HTTP.
|
64 |
* **start** - a number of seconds from where to start the video playing
|
|
|
65 |
* **style** - apply CSS elements directly to the video output
|
66 |
* **template** - specify a template (see section on Templates for further details)
|
67 |
-
* **type** - which embedding type to use, this can be `embedplus`, `iframe`, `object` or `chromeless`
|
68 |
-
* **width** - the video width, in pixels
|
69 |
-
* **vq** - the video quality that you'd like - see the seperate section below for further details about this
|
70 |
-
|
71 |
-
The following parameters will not work with EmbedPlus:
|
72 |
-
|
73 |
-
* **autohide** - 0, 1 or 2, this parameter indicates whether the video controls will automatically hide after a video begins playing. The default behaviour, a value of 2, is for the video progress bar to fade out while the player controls (play button, volume control, etc.) remain visible. If this parameter is set to 0, the video progress bar and the video player controls will be visible throughout the video. If this parameter is set to 1, then the video progress bar and the player controls will slide out of view a couple of seconds after the video starts playing. They will only reappear if the user moves her mouse over the video player or presses a key on her keyboard.
|
74 |
-
* **color** - white or red, the colour of the progress bar (see the FAQ about having a white progress bar with the light theme)
|
75 |
-
* **controls** - 0, 1 or 2, this decides whether the controls should display and when the Flash will load. A value of 0 will not show the controls but 1 or 2 will. A value of 2 will load Flash once the user initiates playback - otherwise it's loaded straight away.
|
76 |
-
* **https** - yes or no, whether to use HTTPS for the video
|
77 |
-
* **info** - yes or no, show video information. If displaying a playlist this will show video thumbnails
|
78 |
-
* **loop** - yes or no, whether to start the video again once it ends
|
79 |
-
* **related** - yes or no, show related videos
|
80 |
* **theme** - dark or light, display player controls (like a 'play' button or volume control) within a dark or light control bar
|
81 |
-
|
82 |
-
The following parameters will not work with EmbedPlus or if IFRAME uses HTML5:
|
83 |
-
|
84 |
-
* **annotation** - yes or no, this determines if annotations are shown
|
85 |
-
* **cc** - yes or no, decided whether closed captions (subtitles) are displayed
|
86 |
-
* **disablekb** - yes or no, disable keyboard controls
|
87 |
-
* **fullscreen** - yes or no, this will add the fullscreen button to the toolbar. This also works with EmbedPlus.
|
88 |
-
* **link** - yes or no, link video to YouTube
|
89 |
-
* **search** - yes or no, create a playlist based on a search word. The search word should be specified instead of a video ID. See "Automatically Generate Playlists" option for more details
|
90 |
* **user** - yes or no, create a playlist based on a user's uploads. The search word should be specified instead of a video ID. See "Automatically Generate Playlists" option for more details
|
91 |
-
|
92 |
-
The following parameters will not work if IFRAME uses HTML5:
|
93 |
-
|
94 |
-
* **stop** - this stops the video at a specific time, given in seconds
|
95 |
-
|
96 |
-
The following parameters are only for use with EmbedPlus:
|
97 |
-
|
98 |
-
* **hd** - play the video in HD quality, if available
|
99 |
-
* **react** - yes or no, this specified whether you wish to show the Real-time Reactions button
|
100 |
-
* **sweetspot** - yes or no, this will find sweet spots for the next/prev buttons
|
101 |
|
102 |
== Alternative Shortcodes ==
|
103 |
|
104 |
-
Within administration, selecting `Options` from the `YouTube` menu will provide a list of general options. One
|
105 |
|
106 |
There are 2 reasons why you might want to do this...
|
107 |
|
108 |
1. If migrating from another plugin, it may use a different shortcode - more details can be found in the section named "Migration"
|
109 |
2. If another plugin uses the same shortcode (e.g. Jetpack) this will allow you to specify and use an alternative
|
110 |
|
111 |
-
|
112 |
-
|
113 |
-
== Function Call ==
|
114 |
-
|
115 |
-
As well as a shortcode you can also use a PHP function call to display a video (e.g. in a sidebar). The function is named `youtube_video_embed` and has 2 parameters - the first is the video ID (or URL) and the second is a list of display parameters. The display parameters are the same as those used in the shortcode but are separated by an ampersand.
|
116 |
-
|
117 |
-
e.g. `youtube_video_embed( 'Z_sCoHGIpU0', 'width=300&height=200' )`
|
118 |
|
119 |
== Widgets ==
|
120 |
|
121 |
-
|
122 |
|
123 |
If you wish to display an automatically generated playlist based on user name or search term, simply change the "ID Type" appropriately and then specify the name or search word(s) where the video ID would normally be entered.
|
124 |
|
@@ -140,22 +112,6 @@ Playlists cannot be used along with the EmbedPlus embedding method.
|
|
140 |
|
141 |
A better alternative to playlists is the build-in lists function in YouTube Embed - see the Lists section for further details.
|
142 |
|
143 |
-
== Video Quality ==
|
144 |
-
|
145 |
-
A parameter of `vq` can be used against a video to force a specific resolution (rather than the most appropriate being used).
|
146 |
-
|
147 |
-
**Note: This option is not officially supported by YouTube so should be considered as experimental**
|
148 |
-
|
149 |
-
The following parameters are possible...
|
150 |
-
|
151 |
-
`small` - 240p
|
152 |
-
`medium` - 360p
|
153 |
-
`large` - 480p
|
154 |
-
`hd720` - 720p
|
155 |
-
`hd1080` - 1080p
|
156 |
-
|
157 |
-
A default video quality can also be specified within the profiles screen.
|
158 |
-
|
159 |
== Templates ==
|
160 |
|
161 |
Both in the profile and as a parameter you can specify a template. This allows you to define any CSS that you wish to "wrap" around the YouTube output.
|
@@ -192,47 +148,13 @@ e.g. `[youtube]List 1[/youtube]`
|
|
192 |
|
193 |
There is also a parameter, named `list`, that lets you modify the playback of the list. You can either play each in turn, play them randomly, or have just one played (but picked randomly).
|
194 |
|
195 |
-
==
|
196 |
-
|
197 |
-
Some YouTube videos include transcripts - this is a text output of the speech from the video with timings added. These are available in XML format and can, via a function call or shortcode, be displayed in your post.
|
198 |
-
|
199 |
-
The shortcode `transcript` will display the transcript in your post along with the start time for each line. Simply supply the video ID as a parameter.
|
200 |
-
|
201 |
-
e.g. `[transcript]MSPsrhCPt-0[/transcript]`
|
202 |
-
|
203 |
-
If no transcript exists, nothing will be output.
|
204 |
-
|
205 |
-
There is an additional parameter of `LANGUAGE` which can be used to specify an alternative transcript language (the default is EN).
|
206 |
-
|
207 |
-
e.g. `[transcript language='DE']MSPsrhCPt-0[/transcript]`
|
208 |
-
|
209 |
-
For style purposes, the `SPAN` around the time has a class of `TranscriptTime`, the `SPAN` around the text has a class of `TranscriptText` and the `DIV` around the whole transcript output has a class of `Transcript`.
|
210 |
-
|
211 |
-
If you wish to use a PHP function call to get the transcript, then you would use the format `get_youtube_transcript( ID )`, where ID is the video ID.
|
212 |
-
|
213 |
-
In all of these cases, the original XML format has been changed to a readable output. If, though, you'd like to return the original XML format, then you can use the call `get_youtube_transcript_xml( ID )`.
|
214 |
-
|
215 |
-
== Automatically Generate Playlists ==
|
216 |
|
217 |
YouTube now includes options to automatically generate playlists based upon a user name or a search name.
|
218 |
|
219 |
To use, simply use the `user` or `search` parameter to switch the appropriate option on. Then, instead of a video ID or URL, you should specify either the user name or search word(s).
|
220 |
|
221 |
-
==
|
222 |
-
|
223 |
-
Within administration, selecting `Options` from the `YouTube` menu will provide a list of general options. One section is named `Migration`. There are 2 boxes that can be ticked to activate 2 different types of alternative embedding - these have been provided to allow easy migration from other similar plugins. You can also assign a specific profile to these migrated options.
|
224 |
-
|
225 |
-
The first option, `Bracket Embedding`, allows YouTube IDs to be assigned within brackets - similar to shortcodes but without the actual shortcode name. e.g. `[http://www.youtube.com/watch?v=Z_sCoHGIpU0]`.
|
226 |
-
|
227 |
-
The second option, `Alternative Embedding`, activates a short of other alternative embedding methods.
|
228 |
-
|
229 |
-
In both cases, activating these will impact performance so should only be used if absolutely necessary.
|
230 |
-
|
231 |
-
[Read more details](http://www.artiss.co.uk/youtube-embed-compatibility "YouTube Embed Compatibility") on which options to select for which plugin.
|
232 |
-
|
233 |
-
== Further options ==
|
234 |
-
|
235 |
-
**Thumbnails**
|
236 |
|
237 |
YouTube embed also has the ability to return a thumbnail of a video (sorry, this doesn't work with playlists). There are two methods you can use for this - a shortcode or a function call.
|
238 |
|
@@ -264,19 +186,7 @@ This overrides the `TARGET` and `ALT` elements of the thumbnail.
|
|
264 |
|
265 |
You can also use `nolink` as a parameter with the shortcode, which works in the same way as with the function call.
|
266 |
|
267 |
-
|
268 |
-
|
269 |
-
You can retrieve the name of a video via 1 of 2 methods.
|
270 |
-
|
271 |
-
You can call the PHP function `get_youtube_name`, passing it to the video URL or ID - this will return the name of the video.
|
272 |
-
|
273 |
-
e.g. `echo get_youtube_name( 'Z_sCoHGIpU0' );`
|
274 |
-
|
275 |
-
Alternatively, you can use the shortcode `[youtube_name]`, again passing the video URL or ID. The video name will be displayed.
|
276 |
-
|
277 |
-
e.g. `[youtube_name]Z_sCoHGIpU0[/youtube_name]`
|
278 |
-
|
279 |
-
**Shortened URL**
|
280 |
|
281 |
You may return a short URL for any YouTube video by way of either a function call or a shortcode.
|
282 |
|
@@ -288,7 +198,7 @@ This will create a link to a video using the short URL standard.
|
|
288 |
|
289 |
To use the shortcode method simply insert `[youtube_url id=xx]` anywhere within a post to return a shortened URL. `xx` is the ID of the video.
|
290 |
|
291 |
-
|
292 |
|
293 |
If you wish your users to be able to download a YouTube video or playlist then you can do this automatically or manually via either a shortcode of PHP function call.
|
294 |
|
@@ -306,53 +216,22 @@ Alternatively, you can use the shortcode `download_video`. The content to link i
|
|
306 |
|
307 |
e.g. `[download_video id="Z_sCoHGIpU0" target="_blank"]Download the video[/download_video]`
|
308 |
|
309 |
-
|
310 |
-
|
311 |
-
A shortcode allows you to display any YouTube comments for a video, which will appear in published order.
|
312 |
-
|
313 |
-
Simply use [youtube_comments] with, as usual, the video ID to embed the comments on your post or page. For example...
|
314 |
-
|
315 |
-
[youtube_comments]adVEYkQIxCg[youtube_comments]
|
316 |
-
There are 3 optional parameters that can be specified too...
|
317 |
|
318 |
-
|
319 |
-
limit - the number of comments to display. Default to 10.
|
320 |
-
cache - how long to cache comments for, in minutes. Uses default in settings screen if not specified
|
321 |
-
The comments will use your site's default styling by default but all output has it's own CLASS, allowing you to re-style yourself using CSS.
|
322 |
|
323 |
-
|
324 |
|
325 |
-
|
326 |
|
327 |
-
|
328 |
-
2. Video Information Cache - video IDs are checked with YouTube to ensure that they're valid. This option lets you to specify how often this should be checked. This defaults to 1 hour.
|
329 |
-
3. Transcript Cache - how long to store transcripts. Defaults to 24 hours.
|
330 |
-
|
331 |
-
In all cases putting the cache to 0 will switch off caching for that option.
|
332 |
-
|
333 |
-
**Further Embedding Options**
|
334 |
-
|
335 |
-
Under the `YouTube` administration menu is a sub-menu named `Options`. Select this and find the section named `Embedding`. There are 3 options here...
|
336 |
|
337 |
1. Add Metadata - by default, RDFa metadata is added to video output. This can be switched on or off as required (see the FAQs for more information about metadata usage).
|
338 |
-
2.
|
339 |
-
3. Feed - videos will not appear in feeds so use this option to decide whether you want them to be converted to links and/or thumbnails.
|
340 |
-
|
341 |
-
In the case of URL and Comment embedding a profile can be selected.
|
342 |
-
|
343 |
-
== Licence ==
|
344 |
-
|
345 |
-
This WordPress plugin is licensed under the [GPLv2 (or later)](http://wordpress.org/about/gpl/ "GNU General Public License").
|
346 |
-
|
347 |
-
== Support ==
|
348 |
-
|
349 |
-
For problems, suggestions or enhancements for this plugin, please use the [WordPress forum](https://wordpress.org/support/plugin/youtube-embed "WordPress Plugins Forum").
|
350 |
-
|
351 |
-
**This plugin, and all support, is supplied for free, but [donations](http://artiss.co.uk/donate "Donate") are always welcome.**
|
352 |
|
353 |
== Reviews & Mentions ==
|
354 |
|
355 |
-
[Your YouTube Plugin is fantastic
|
356 |
|
357 |
[New Technology Finds The Most Buzzed-About Parts Of Videos](http://www.socialtimes.com/2011/03/new-technology-finds-the-most-buzzed-about-parts-of-videos-interview/ "New Technology Finds The Most Buzzed-About Parts Of Videos") - SocialTimes.
|
358 |
|
@@ -372,47 +251,17 @@ YouTube Embed can be found and installed via the Plugin menu within WordPress ad
|
|
372 |
|
373 |
== Frequently Asked Questions ==
|
374 |
|
375 |
-
=
|
376 |
-
|
377 |
-
If you play a YouTube video, look at the URL - it will probably look something like this - `http://www.youtube.com/watch?v=L5Y4qzc_JTg`.
|
378 |
-
|
379 |
-
The video ID is the list of letters and numbers after `v=`, in this case `L5Y4qzc_JTg`.
|
380 |
-
|
381 |
-
= When trying to display a video it says "An error occurred accessing the YouTube API" =
|
382 |
-
|
383 |
-
This has been reported by a number of users - for some reason some people are unable to access the YouTube API, which is used by this plugin to determine the video type and whether it's valid or not. If you are one of them then simply go to the `Options` screen within the `YouTube Embed` administration menu and, near the bottom, there is an option to stop reporting API errors.
|
384 |
-
|
385 |
-
If you switch off API errors then the plugin will simply assume all IDs are valid and work out the type from the ID length (which is not set, so if this changes in future it may cause problems!).
|
386 |
-
|
387 |
-
I have requested further information on why these errors may be occurring from the YouTube forum but, as yet, I've had no response. [Click here](http://groups.google.com/group/youtube-api-gdata/browse_thread/thread/764f2f2a3b5863f8?hl=en "YouTube APIs Developer Forum") if you wish to track the request.
|
388 |
-
|
389 |
-
= So if I upgrade to this from an earlier version is it compatible? =
|
390 |
-
|
391 |
-
It should be, yes, but with one exception.
|
392 |
-
|
393 |
-
If you have upgraded from version 2.0.1 or before and used the `style` parameter then it may cause some problems. This is because the `style` parameter now affects the CSS of the video. Before, it added a DIV "wrapper" around the video and applied the styles to this.
|
394 |
-
|
395 |
-
Therefore, if you used the `style` parameter to centre a video this probably doesn't now work. However, you can do this now by using the `template` parameter instead - please read the section on that for further help.
|
396 |
|
397 |
-
|
398 |
|
399 |
-
|
400 |
|
401 |
-
|
402 |
-
|
403 |
-
IFRAME does not work with XHTML so will only validate as XHTML transitional (this includes if you use IFRAME as the fallback to EmbedPlus).
|
404 |
-
|
405 |
-
If you include Metadata then you must use the XHTML Strict + RDFa DOCTYPE - in this case it validates.
|
406 |
-
|
407 |
-
If you don't include Metadata then it will also validate as HTML5 compliant.
|
408 |
-
|
409 |
-
The [W3C Markup Validation Service](http://validator.w3.org/ "W3C Markup Validation Service") was used to test the above.
|
410 |
-
|
411 |
-
You can [read more about this here](http://www.artiss.co.uk/youtube-embed-help#ye-standards "Standards Compliance").
|
412 |
|
413 |
-
|
414 |
|
415 |
-
|
416 |
|
417 |
= The video output is overlapping or stuttering =
|
418 |
|
@@ -430,52 +279,34 @@ Alternatively, you can use a secondary shortcode - [youtube_video]. Use this ins
|
|
430 |
|
431 |
This second suggestion will work for any plugin that may use the same shortcode.
|
432 |
|
433 |
-
= There used to be an option to allow the plugin to work with YouTube URLs. Where did it go? =
|
434 |
-
|
435 |
-
WordPress will, by default, convert YouTube URLs to videos using a very basic default configuration. Earlier versions of this plugin had an option to override this so this plugin would output the results instead (giving you full control of the output). Unfortunately, it stopped working and I do not have enough knowledge on the required WordPress code to work out how to fix it. Rather than leave broken code in place I have removed it.
|
436 |
-
|
437 |
-
If you wish to have full control over your YouTube output I would suggest placing all YouTube URLs within [youtube] shortcodes.
|
438 |
-
|
439 |
= My OPTIONS table seems to be full of cache entries for YouTube Embed =
|
440 |
|
441 |
Due to a housekeeping limitation in WordPress cache entries, which are stored in the OPTIONS table, may get left behind. There are 2 solutions to clearing this.
|
442 |
|
443 |
First of all, in the Options menu in YouTube Embed administration, there is an option in the performance section named "Clear Cache". Simply tick this box and click on the "Save Settings" button to clear out any cache.
|
444 |
|
445 |
-
However, the best option is to install the plugin [
|
446 |
|
447 |
= Is this plugin compatible with Turn Off The Lights? =
|
448 |
|
449 |
-
|
450 |
-
|
451 |
-
I've raised this with the developer of Turn Off The Lights and he is going to implement a change in the future to improve compatibility with responsive video.
|
452 |
-
|
453 |
-
= I get the message "Blocked plug-in" in Safari =
|
454 |
-
|
455 |
-
Your version of Flash is out-of-date and needs updating.
|
456 |
|
457 |
= The "autostart" feature is not working in iOS =
|
458 |
|
459 |
Unfortunately, this is a restriction that has been put in place by Apple.
|
460 |
|
461 |
-
= I
|
462 |
|
463 |
-
|
464 |
|
465 |
-
=
|
466 |
|
467 |
-
|
468 |
|
469 |
= I have another issue or a request =
|
470 |
|
471 |
Before reporting it please bear in mind that this plugin uses the standard YouTube API. Adding extra functionality to the player itself is not possible and there are [known issues](https://code.google.com/p/gdata-issues/issues/list?q=label:API-YouTube "YouTube API Known Issues") with it. I would also recommend performing a Google search for your issue too first, as this will often resolve a lot of queries.
|
472 |
|
473 |
-
= Which version of PHP does this plugin work with? =
|
474 |
-
|
475 |
-
It has been syntax checked as PHP 4. However, this does not guarantee PHP 4 compatibility and the minimum for WordPress is now PHP 5.2.4.
|
476 |
-
|
477 |
-
Although I attempt to keep with PHP 4 compatibility there are no guarantees of this.
|
478 |
-
|
479 |
== Screenshots ==
|
480 |
|
481 |
1. YouTube Embed in the administration menu
|
@@ -487,6 +318,19 @@ Although I attempt to keep with PHP 4 compatibility there are no guarantees of t
|
|
487 |
|
488 |
== Changelog ==
|
489 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
490 |
= 3.3.5 =
|
491 |
* Maintenance: Added missing text domain, ready for automatic translation.
|
492 |
|
@@ -789,6 +633,9 @@ Although I attempt to keep with PHP 4 compatibility there are no guarantees of t
|
|
789 |
|
790 |
== Upgrade Notice ==
|
791 |
|
|
|
|
|
|
|
792 |
= 3.3.5 =
|
793 |
* Update with text domain, ready for automatic translation
|
794 |
|
1 |
+
=== YouTube Embed ===
|
2 |
Contributors: dartiss
|
3 |
Donate link: http://artiss.co.uk/donate
|
4 |
Tags: annotations, artiss, chromecast, comments, download, embed, embedding, embedplus, flash, flv, hd, iframe, media, play, playlist, profile, responsive, seo, url, video, widget, youtube, youtuber
|
5 |
Requires at least: 3.9
|
6 |
Tested up to: 4.3.1
|
7 |
+
Stable tag: 4.0
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
12 |
|
13 |
== Description ==
|
14 |
|
15 |
+
**Version 4 removes a number of existing features. If you're upgrading from a previous version, please [click here](http://www.artiss.co.uk/youtube-embed-removed-features "Removed Features") for further details. If you were using the widget feature then please head to the FAQ before proceeding.**
|
16 |
+
|
17 |
YouTube Embed is an incredibly simple, yet powerful, method of embedding YouTube videos into your WordPress site. Options include:
|
18 |
|
19 |
* XHTML and HTML5 compliant - works with all the latest browsers
|
|
|
20 |
* Dynamic video sizing for responsive sites
|
|
|
21 |
* Build your own playlists and play them back however you want
|
22 |
* Automatically generate playlists based on user name or search text
|
23 |
* Create multiple profiles - use them for different videos to get the exact style that you want
|
24 |
* Google compatible metadata is added to the video output - great for SEO!
|
|
|
25 |
* Fully internationalized ready for translations. **If you would like to add a translation to his plugin then please [contact me](http://www.artiss.co.uk/plugin-contact "Contact")**
|
26 |
* Support for Do Not Track
|
27 |
* Compatible with [Video SEO for WordPress](http://yoast.com/wordpress/video-seo/ "Video SEO for WordPress")
|
28 |
+
* Use [Turn Off The Lights](https://www.turnoffthelights.com/ "Turn Off The Lights")? This plugin works with it beautifully.
|
29 |
* Works "out of the box" with 4K, 60FPS and Chromecast - stream your embedded videos to your TV!
|
30 |
* And much, much more!
|
31 |
|
32 |
+
There are no premium features and no adverts - this is 100% complete and free! See the "Other Notes" tab for how to get started as well as the more advanced features. How easy is it to use? The fine people at [Webucator](https://www.webucator.com "Webucator") have put together an excellent video showing you how to get started with it..
|
|
|
|
|
33 |
|
34 |
https://www.youtube.com/watch?v=Wc7cvpQS-xQ
|
35 |
|
47 |
|
48 |
e.g. `[youtube width=300 height=200]Z_sCoHGIpU0[/youtube]`
|
49 |
|
50 |
+
Which options are available depends upon the embedding type you're using as well as the viewers set-up (for example, whether they have Flash installed or not). You can specify any of the parameters but they may be ignored. Please see the Profile screen in Administration for details of which parameters are supported by which embed method.
|
51 |
|
52 |
+
* **annotation** - yes or no, this determines if annotations are shown
|
53 |
+
* **autohide** - 0, 1 or 2, this parameter indicates whether the video controls will automatically hide after a video begins playing. The default behaviour, a value of 2, is for the video progress bar to fade out while the player controls (play button, volume control, etc.) remain visible. If this parameter is set to 0, the video progress bar and the video player controls will be visible throughout the video. If this parameter is set to 1, then the video progress bar and the player controls will slide out of view a couple of seconds after the video starts playing. They will only reappear if the user moves her mouse over the video player or presses a key on her keyboard.
|
|
|
54 |
* **autoplay** - yes or no, should the video automatically start playing?
|
55 |
+
* **cc** - yes or no, decided whether closed captions (subtitles) are displayed
|
56 |
+
* **color** - white or red, the colour of the progress bar (see the FAQ about having a white progress bar with the light theme)
|
57 |
+
* **controls** - 0, 1 or 2, this decides whether the controls should display and when the Flash will load. A value of 0 will not show the controls but 1 or 2 will. A value of 2 will load Flash once the user initiates playback - otherwise it's loaded straight away.
|
58 |
+
* **disablekb** - yes or no, disable keyboard controls
|
59 |
* **dynamic** - whether to use dynamic sizing or not. When switched on the video will resize when your site does (i.e. responsive). If a video width is supplied this will be the maximum width, otherwise full width will be assumed. Height is ignored and will be worked out automatically.
|
60 |
+
* **fullscreen** - yes or no, this will add the fullscreen button to the toolbar. This also works with EmbedPlus.
|
61 |
* **height** - the video height, in pixels
|
62 |
+
* **https** - yes or no, whether to use HTTPS for the video
|
63 |
+
* **info** - yes or no, show video information. If displaying a playlist this will show video thumbnails
|
64 |
* **list** - if you've specified your own list, use this to select the way the videos should be output. Should be `random` (display videos in a random order), `single` (show just one video, randomly picked from the list) or `order` (show each video in the original order - this is the default)
|
65 |
+
* **loop** - yes or no, whether to start the video again once it ends
|
66 |
+
* **modest** - reduce the branding on the video
|
67 |
* **profile** - specify a different default profile (see section on Profiles for further details)
|
68 |
* **ratio** - allows you to define a window ratio - specify just a height or width and the ratio will calculate the missing dimension. Uses the format x:x, e.g. 4:3, 16:9
|
69 |
+
* **related** - yes or no, show related videos
|
70 |
+
* **search** - yes or no, create a playlist based on a search word. The search word should be specified instead of a video ID. See "Automatically Generate Playlists" option for more details
|
71 |
* **ssl** - Use SSL or not? Basically, if set on the URL will be HTTPS rather than HTTP.
|
72 |
* **start** - a number of seconds from where to start the video playing
|
73 |
+
* **stop** - this stops the video at a specific time, given in seconds
|
74 |
* **style** - apply CSS elements directly to the video output
|
75 |
* **template** - specify a template (see section on Templates for further details)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
76 |
* **theme** - dark or light, display player controls (like a 'play' button or volume control) within a dark or light control bar
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
77 |
* **user** - yes or no, create a playlist based on a user's uploads. The search word should be specified instead of a video ID. See "Automatically Generate Playlists" option for more details
|
78 |
+
* **width** - the video width, in pixels
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
79 |
|
80 |
== Alternative Shortcodes ==
|
81 |
|
82 |
+
Within administration, selecting `Options` from the `YouTube` menu will provide a list of general options. One option is named `Alternative Shortcode` and allows you to specify another shortcode that will work exactly the same as the standard shortcode of `[youtube]`.
|
83 |
|
84 |
There are 2 reasons why you might want to do this...
|
85 |
|
86 |
1. If migrating from another plugin, it may use a different shortcode - more details can be found in the section named "Migration"
|
87 |
2. If another plugin uses the same shortcode (e.g. Jetpack) this will allow you to specify and use an alternative
|
88 |
|
89 |
+
The new shortcode can also have its own default profile assigned to it (see the Profiles section for more details on this).
|
|
|
|
|
|
|
|
|
|
|
|
|
90 |
|
91 |
== Widgets ==
|
92 |
|
93 |
+
Widgets can be easily added. In Administration simply click on the `Widgets` option under the `Appearance` menu. `YouTube Embed` will be one of the listed widgets. Drag it to the appropriate sidebar on the right hand side and then choose your video options - any that aren't specified are taken from your supplied profile.
|
94 |
|
95 |
If you wish to display an automatically generated playlist based on user name or search term, simply change the "ID Type" appropriately and then specify the name or search word(s) where the video ID would normally be entered.
|
96 |
|
112 |
|
113 |
A better alternative to playlists is the build-in lists function in YouTube Embed - see the Lists section for further details.
|
114 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
115 |
== Templates ==
|
116 |
|
117 |
Both in the profile and as a parameter you can specify a template. This allows you to define any CSS that you wish to "wrap" around the YouTube output.
|
148 |
|
149 |
There is also a parameter, named `list`, that lets you modify the playback of the list. You can either play each in turn, play them randomly, or have just one played (but picked randomly).
|
150 |
|
151 |
+
== Automatically Generated Playlists ==
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
152 |
|
153 |
YouTube now includes options to automatically generate playlists based upon a user name or a search name.
|
154 |
|
155 |
To use, simply use the `user` or `search` parameter to switch the appropriate option on. Then, instead of a video ID or URL, you should specify either the user name or search word(s).
|
156 |
|
157 |
+
== Thumbnails ==
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
158 |
|
159 |
YouTube embed also has the ability to return a thumbnail of a video (sorry, this doesn't work with playlists). There are two methods you can use for this - a shortcode or a function call.
|
160 |
|
186 |
|
187 |
You can also use `nolink` as a parameter with the shortcode, which works in the same way as with the function call.
|
188 |
|
189 |
+
== Shortened URL ==
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
190 |
|
191 |
You may return a short URL for any YouTube video by way of either a function call or a shortcode.
|
192 |
|
198 |
|
199 |
To use the shortcode method simply insert `[youtube_url id=xx]` anywhere within a post to return a shortened URL. `xx` is the ID of the video.
|
200 |
|
201 |
+
== Downloading Videos ==
|
202 |
|
203 |
If you wish your users to be able to download a YouTube video or playlist then you can do this automatically or manually via either a shortcode of PHP function call.
|
204 |
|
216 |
|
217 |
e.g. `[download_video id="Z_sCoHGIpU0" target="_blank"]Download the video[/download_video]`
|
218 |
|
219 |
+
== Caching ==
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
220 |
|
221 |
+
Caches are used to improve plugin performance.
|
|
|
|
|
|
|
222 |
|
223 |
+
Under the `YouTube` administration menu is a sub-menu named `Options`. Select this and find the section named `Performance`, under which is the 'Embed Cache' option. This is how long to store the resulting cache code. It will update if you change any parameters so, theoretically, shouldn't need to change. It defaults to 24 hours. In all cases putting the cache to 0 will switch off caching for that option.
|
224 |
|
225 |
+
== Further Embedding Options ==
|
226 |
|
227 |
+
Under the `YouTube` administration menu is a sub-menu named `Options`. Select this and find the section named `Embedding`. There are 2 options here...
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
228 |
|
229 |
1. Add Metadata - by default, RDFa metadata is added to video output. This can be switched on or off as required (see the FAQs for more information about metadata usage).
|
230 |
+
2. Feed - videos will not appear in feeds so use this option to decide whether you want them to be converted to links and/or thumbnails.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
231 |
|
232 |
== Reviews & Mentions ==
|
233 |
|
234 |
+
[Your YouTube Plugin is fantastic-it just saved my life on this site. Thank you!](https://twitter.com/AaronWatters/status/237957701605404672?uid=16257815&iid=am-130280753913455685118891763&nid=4+248 "Twitter - Aaron Watters") - Sonic Clamp.
|
235 |
|
236 |
[New Technology Finds The Most Buzzed-About Parts Of Videos](http://www.socialtimes.com/2011/03/new-technology-finds-the-most-buzzed-about-parts-of-videos-interview/ "New Technology Finds The Most Buzzed-About Parts Of Videos") - SocialTimes.
|
237 |
|
251 |
|
252 |
== Frequently Asked Questions ==
|
253 |
|
254 |
+
= I've upgraded to version 4.0+ from an earlier version and I was using the widget feature to display videos =
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
255 |
|
256 |
+
I previously allowed some, although not all, parameters to be specified within the widget. However, as you can simply create your own profile for widgets I have removed this and, without leaving lots of redundant code behind, it was difficult to keep this backwards compatible.
|
257 |
|
258 |
+
Therefore, if you're upgrading you may find your widgets don't now display correctly. The best thing to do, beforehand if you can, is to create a profile just for the widgets and assign that to each. You'll probably find the video size is the bit most likely to cause issues. Apologies for this.
|
259 |
|
260 |
+
= How do I find the ID of a YouTube video? =
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
261 |
|
262 |
+
If you play a YouTube video, look at the URL - it will probably look something like this - `http://www.youtube.com/watch?v=L5Y4qzc_JTg`.
|
263 |
|
264 |
+
The video ID is the list of letters and numbers after `v=`, in this case `L5Y4qzc_JTg`.
|
265 |
|
266 |
= The video output is overlapping or stuttering =
|
267 |
|
279 |
|
280 |
This second suggestion will work for any plugin that may use the same shortcode.
|
281 |
|
|
|
|
|
|
|
|
|
|
|
|
|
282 |
= My OPTIONS table seems to be full of cache entries for YouTube Embed =
|
283 |
|
284 |
Due to a housekeeping limitation in WordPress cache entries, which are stored in the OPTIONS table, may get left behind. There are 2 solutions to clearing this.
|
285 |
|
286 |
First of all, in the Options menu in YouTube Embed administration, there is an option in the performance section named "Clear Cache". Simply tick this box and click on the "Save Settings" button to clear out any cache.
|
287 |
|
288 |
+
However, the best option is to install the plugin [Transient Cleaner](http://wordpress.org/extend/plugins/artiss-transient-cleaner/ "Transient Cleaner"), which will housekeep the OPTIONS table automatically.
|
289 |
|
290 |
= Is this plugin compatible with Turn Off The Lights? =
|
291 |
|
292 |
+
Yes, it works beautifully with [Turn Off The Lights](https://www.turnoffthelights.com/ "Turn Off The Lights"), thanks to the very kind Develop
|
|
|
|
|
|
|
|
|
|
|
|
|
293 |
|
294 |
= The "autostart" feature is not working in iOS =
|
295 |
|
296 |
Unfortunately, this is a restriction that has been put in place by Apple.
|
297 |
|
298 |
+
= I can't get the video to play at a specific resolution by default =
|
299 |
|
300 |
+
There is no way to specify this - YouTube makes the decision on which version to play depending on a number of factors.
|
301 |
|
302 |
+
= There are black borders on top/underneath my video =
|
303 |
|
304 |
+
This is usually due to using a different ratio than the video was designed for. If you're not sure which ratio to use head to its page on YouTube, click on Share and then Embed and then Show More. A video size will be shown, which you can use to work out the correct ration for the video.
|
305 |
|
306 |
= I have another issue or a request =
|
307 |
|
308 |
Before reporting it please bear in mind that this plugin uses the standard YouTube API. Adding extra functionality to the player itself is not possible and there are [known issues](https://code.google.com/p/gdata-issues/issues/list?q=label:API-YouTube "YouTube API Known Issues") with it. I would also recommend performing a Google search for your issue too first, as this will often resolve a lot of queries.
|
309 |
|
|
|
|
|
|
|
|
|
|
|
|
|
310 |
== Screenshots ==
|
311 |
|
312 |
1. YouTube Embed in the administration menu
|
318 |
|
319 |
== Changelog ==
|
320 |
|
321 |
+
= 4.0 =
|
322 |
+
* Maintenance: Removed a number of redundant/broken features. [Learn more](http://www.artiss.co.uk/youtube-embed-removed-features "Removed Features").
|
323 |
+
* Maintenance: Updated download link to use KeepVid.
|
324 |
+
* Maintenance: Re-written admin screen to use WordPress standard method of displaying settings. Oh, and the widget settings too.
|
325 |
+
* Maintenance: ...speaking of which, revised the options available to widgets.
|
326 |
+
* Maintenance: Merged many of the files where there wasn't a huge amount of content.
|
327 |
+
* Maintenance: Renamed menu slugs as they were too generic and may cause clashes with other plugins or themes that are silly enough to do the same thing.
|
328 |
+
* Enhancement: Revised profile screen to make it clearer, via the art of the icon, which parameters are compatible with which embed type.
|
329 |
+
* Enhancement: If you go a bit "ape" with the parameters and manual playlists, it's possible to exceed the URL size limit. I've now put a check in place to report this, if it occurs.
|
330 |
+
* Enhancement: Added modest branding as a parameter (before was only selectable via the profile screen).
|
331 |
+
* Enhancement: Improved the meta data.
|
332 |
+
* Bugs: Many of them. Fixed. Hoorah.
|
333 |
+
|
334 |
= 3.3.5 =
|
335 |
* Maintenance: Added missing text domain, ready for automatic translation.
|
336 |
|
633 |
|
634 |
== Upgrade Notice ==
|
635 |
|
636 |
+
= 4.0 =
|
637 |
+
* Fixed, squeezed and reduced. Make sure you read the changelog before upgrading!
|
638 |
+
|
639 |
= 3.3.5 =
|
640 |
* Update with text domain, ready for automatic translation
|
641 |
|
uninstall.php
CHANGED
@@ -44,19 +44,6 @@ if ( is_array( $options ) ) {
|
|
44 |
|
45 |
// Delete all other options
|
46 |
|
47 |
-
delete_option( 'widget_youtube_embed_widget' );
|
48 |
-
|
49 |
delete_option( 'youtube_embed_general' );
|
50 |
delete_option( 'youtube_embed_shortcode' );
|
51 |
-
delete_option( 'youtube_embed_url' );
|
52 |
-
delete_option( 'youtube_embed_editor_sc' );
|
53 |
-
delete_option( 'youtube_embed_activated' );
|
54 |
-
|
55 |
-
// Delete cookie
|
56 |
-
|
57 |
-
$path = str_replace( 'http://', '', site_url( '/', 'http' ) );
|
58 |
-
$pos = strpos( $path, '/' );
|
59 |
-
$path = substr( $path, $pos ) . 'wp-content/';
|
60 |
-
|
61 |
-
setcookie( 'vye_mce_shortcode', '', time() - 3600, $path );
|
62 |
?>
|
44 |
|
45 |
// Delete all other options
|
46 |
|
|
|
|
|
47 |
delete_option( 'youtube_embed_general' );
|
48 |
delete_option( 'youtube_embed_shortcode' );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
49 |
?>
|
youtube-embed.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: YouTube Embed
|
4 |
Plugin URI: https://wordpress.org/plugins/youtube-embed/
|
5 |
Description: Embed YouTube Videos in WordPress
|
6 |
-
Version:
|
7 |
Author: David Artiss
|
8 |
Author URI: http://www.artiss.co.uk
|
9 |
Text Domain: youtube-embed
|
@@ -18,7 +18,7 @@ Text Domain: youtube-embed
|
|
18 |
* @since 2.0
|
19 |
*/
|
20 |
|
21 |
-
define( 'youtube_embed_version', '
|
22 |
|
23 |
$functions_dir = WP_PLUGIN_DIR . '/youtube-embed/includes/';
|
24 |
|
@@ -28,38 +28,19 @@ include_once( $functions_dir . 'add-scripts.php' ); // Add various scrip
|
|
28 |
|
29 |
include_once( $functions_dir . 'shared-functions.php' ); // Shared routines
|
30 |
|
31 |
-
include_once( $functions_dir . 'set-defaults.php' ); // Set default options
|
32 |
-
|
33 |
-
include_once( $functions_dir . 'add-to-admin-bar.php' ); // Add link to the admin bar
|
34 |
-
|
35 |
-
include_once( $functions_dir . 'function-calls.php' ); // Function calls
|
36 |
-
|
37 |
include_once( $functions_dir . 'generate-embed-code.php' ); // Generate YouTube embed code
|
38 |
|
39 |
-
include_once( $functions_dir . 'generate-
|
40 |
-
|
41 |
-
include_once( $functions_dir . 'generate-shorturl-code.php' ); // Generate short URLs
|
42 |
-
|
43 |
-
include_once( $functions_dir . 'generate-thumbnail-code.php' ); // Generate thumbnail code
|
44 |
|
45 |
-
include_once( $functions_dir . 'generate-
|
46 |
|
47 |
if ( is_admin() && !( defined( 'DOING_AJAX' ) && DOING_AJAX ) ) {
|
48 |
|
49 |
include_once( $functions_dir . 'admin-config.php' ); // Administration configuration
|
50 |
|
51 |
-
include_once( $functions_dir . 'add-mce-button.php' ); // Editor button
|
52 |
-
|
53 |
} else {
|
54 |
|
55 |
-
include_once( $functions_dir . 'generate-comments-code.php' ); // Generate video comments
|
56 |
-
|
57 |
-
include_once( $functions_dir . 'update-post-content.php' ); // Process post content
|
58 |
-
|
59 |
include_once( $functions_dir . 'shortcodes.php' ); // Shortcodes
|
60 |
|
61 |
}
|
62 |
-
|
63 |
-
include_once($functions_dir . 'generate-widgets.php'); // Generate widgets
|
64 |
-
|
65 |
?>
|
3 |
Plugin Name: YouTube Embed
|
4 |
Plugin URI: https://wordpress.org/plugins/youtube-embed/
|
5 |
Description: Embed YouTube Videos in WordPress
|
6 |
+
Version: 4.0
|
7 |
Author: David Artiss
|
8 |
Author URI: http://www.artiss.co.uk
|
9 |
Text Domain: youtube-embed
|
18 |
* @since 2.0
|
19 |
*/
|
20 |
|
21 |
+
define( 'youtube_embed_version', '4.0' );
|
22 |
|
23 |
$functions_dir = WP_PLUGIN_DIR . '/youtube-embed/includes/';
|
24 |
|
28 |
|
29 |
include_once( $functions_dir . 'shared-functions.php' ); // Shared routines
|
30 |
|
|
|
|
|
|
|
|
|
|
|
|
|
31 |
include_once( $functions_dir . 'generate-embed-code.php' ); // Generate YouTube embed code
|
32 |
|
33 |
+
include_once( $functions_dir . 'generate-other-code.php' ); // Generate download & short URLs & thumbnails
|
|
|
|
|
|
|
|
|
34 |
|
35 |
+
include_once( $functions_dir . 'generate-widgets.php' ); // Generate widgets
|
36 |
|
37 |
if ( is_admin() && !( defined( 'DOING_AJAX' ) && DOING_AJAX ) ) {
|
38 |
|
39 |
include_once( $functions_dir . 'admin-config.php' ); // Administration configuration
|
40 |
|
|
|
|
|
41 |
} else {
|
42 |
|
|
|
|
|
|
|
|
|
43 |
include_once( $functions_dir . 'shortcodes.php' ); // Shortcodes
|
44 |
|
45 |
}
|
|
|
|
|
|
|
46 |
?>
|