Version Description
- Maintenance: Updated code to work with new playlist options
- Maintenance: Removed embedded URL option due to issues with existing code (see FAQ for details)
- Maintenance: Added further FAQs based on common forum queries
- Maintenance: Wording on options screens changed to better identify differences between players
- Maintenance: Added advertisement to profile screen
- Maintenance: Modified demonstration video and made sponsorship request more visible
- Maintenance: Changes the YouTube admin screen icon
- Enhancement: Download link now uses deturl.com
- Enhancement: Admin Bar link improved in WP 3.3 onwards
- Enhancement: New user upload and search features added
- Enhancement: Now supports ability to specify the time to stop video playback
- Enhancement: Default windowing mode changed to improve performance
- Enhancement: FRAMEBORDER is switchable for the purpose of HTML5 compatibility
- Enhancement: Added internationalisation
- Enhancement: README in admin menu now shows the corresponding README for the version of the plugin you have installed, rather than the latest one
- Enhancement: Added option to admin screen to clear video cache (see FAQ for details)
- Enhancement: Allow recursive shortcodes - that is, shortcodes within the YouTube shortcode
- Bug: Fixed bug in retrieving the video title
- Bug: Resolved various debug messages
- Bug: Fixed bug in MCE button JavaScript
Download this release
Release Info
Developer | dartiss |
Plugin | YouTube Embed |
Version | 2.5 |
Comparing to | |
See all releases |
Code changes from version 2.4.1 to 2.5
- css/{ye-admin UNCOMPRESSED.css → aye-admin UNCOMPRESSED.css} +0 -0
- css/{ye-admin.css → aye-admin.css} +0 -0
- css/{ye-dynamic UNCOMPRESSED.css → aye-dynamic UNCOMPRESSED.css } +2 -2
- css/{ye-dynamic.css → aye-dynamic.css} +0 -0
- css/{ye-tinymce-button UNCOMPRESSED.css → aye-tinymce-button UNCOMPRESSED.css} +0 -0
- css/{ye-tinymce-button-3.1 UNCOMPRESSED.css → aye-tinymce-button-3.1 UNCOMPRESSED.css} +0 -0
- css/{ye-tinymce-button-3.1.css → aye-tinymce-button-3.1.css} +0 -0
- css/{ye-tinymce-button.css → aye-tinymce-button.css} +0 -0
- images/Facebook.png +0 -0
- images/Google+.png +0 -0
- images/RSS.png +0 -0
- images/Twitter.png +0 -0
- images/screen_icon.png +0 -0
- images/themefuse_banner.jpg +0 -0
- includes/about.php +0 -51
- includes/add-scripts.php +0 -52
- includes/admin-bar.php +0 -38
- includes/admin-config.php +0 -283
- includes/{mcebutton.php → aye-add-mce-button.php} +6 -4
- includes/aye-add-scripts.php +52 -0
- includes/aye-add-to-admin-bar.php +107 -0
- includes/aye-admin-config.php +479 -0
- includes/{deprecated.php → aye-deprecated.php} +4 -4
- includes/aye-display-about.php +51 -0
- includes/{display-readme.php → aye-display-readme.php} +6 -4
- includes/aye-function-calls.php +229 -0
- includes/aye-generate-download-code.php +41 -0
- includes/{generate-embed-code.php → aye-generate-embed-code.php} +146 -93
- includes/aye-generate-shorturl-code.php +41 -0
- includes/{generate-thumbnail-code.php → aye-generate-thumbnail-code.php} +9 -9
- includes/{generate-transcript-code.php → aye-generate-transcript-code.php} +15 -12
- includes/{widgets.php → aye-generate-widgets.php} +10 -5
- includes/{options-general.php → aye-options-general.php} +72 -54
- includes/{options-lists.php → aye-options-lists.php} +24 -22
- includes/{options-profiles.php → aye-options-profiles.php} +90 -74
- includes/{options-widgets.php → aye-options-widgets.php} +26 -17
- includes/{set-option-defaults.php → aye-set-defaults.php} +12 -10
- includes/{shared.php → aye-shared-functions.php} +52 -30
- includes/{shortcodes.php → aye-shortcodes.php} +75 -52
- includes/{content.php → aye-update-post-content.php} +32 -58
- includes/function-calls.php +0 -227
- includes/generate-download-code.php +0 -41
- includes/generate-shorturl-code.php +0 -41
- js/{ye-gatracker UNCOMPRESSED.js → aye-ga-tracker UNCOMPRESSED.js} +0 -0
- js/{ye-gatracker.js → aye-ga-tracker.js} +0 -0
- js/{ye-mcebutton UNCOMPRESSED.js → aye-mce-button UNCOMPRESSED.js } +2 -2
- js/{ye-mcebutton.js → aye-mce-button.js} +1 -1
- languages/youtube-embed.mo +0 -0
- languages/youtube-embed.po +1106 -0
- readme.txt +87 -24
- screenshot-2.png +0 -0
- screenshot-3.png +0 -0
- screenshot-4.png +0 -0
- screenshot-5.png +0 -0
- screenshot-6.png +0 -0
- uninstall.php +1 -1
- youtube-embed.php +19 -36
css/{ye-admin UNCOMPRESSED.css → aye-admin UNCOMPRESSED.css}
RENAMED
File without changes
|
css/{ye-admin.css → aye-admin.css}
RENAMED
File without changes
|
css/{ye-dynamic UNCOMPRESSED.css → aye-dynamic UNCOMPRESSED.css }
RENAMED
@@ -6,8 +6,8 @@
|
|
6 |
overflow: hidden;
|
7 |
}
|
8 |
|
9 |
-
.ye-container iframe,
|
10 |
-
.ye-container object,
|
11 |
.ye-container embed {
|
12 |
position: absolute;
|
13 |
top: 0;
|
6 |
overflow: hidden;
|
7 |
}
|
8 |
|
9 |
+
.ye-container iframe,
|
10 |
+
.ye-container object,
|
11 |
.ye-container embed {
|
12 |
position: absolute;
|
13 |
top: 0;
|
css/{ye-dynamic.css → aye-dynamic.css}
RENAMED
File without changes
|
css/{ye-tinymce-button UNCOMPRESSED.css → aye-tinymce-button UNCOMPRESSED.css}
RENAMED
File without changes
|
css/{ye-tinymce-button-3.1 UNCOMPRESSED.css → aye-tinymce-button-3.1 UNCOMPRESSED.css}
RENAMED
File without changes
|
css/{ye-tinymce-button-3.1.css → aye-tinymce-button-3.1.css}
RENAMED
File without changes
|
css/{ye-tinymce-button.css → aye-tinymce-button.css}
RENAMED
File without changes
|
images/Facebook.png
ADDED
Binary file
|
images/Google+.png
ADDED
Binary file
|
images/RSS.png
ADDED
Binary file
|
images/Twitter.png
ADDED
Binary file
|
images/screen_icon.png
CHANGED
Binary file
|
images/themefuse_banner.jpg
ADDED
Binary file
|
includes/about.php
DELETED
@@ -1,51 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* About Page
|
4 |
-
*
|
5 |
-
* About the plugin
|
6 |
-
*
|
7 |
-
* @package YouTubeEmbed
|
8 |
-
* @since 2.0
|
9 |
-
*/
|
10 |
-
?>
|
11 |
-
<div class="wrap">
|
12 |
-
<div class="icon32"><img src="<?php echo plugins_url(); ?>/youtube-embed/images/screen_icon.png" alt="" title="" height="32px" width="32px"/><br /></div>
|
13 |
-
|
14 |
-
<h2><?php _e( 'About Artiss YouTube Embed'); ?></h2>
|
15 |
-
|
16 |
-
<p><?php _e( 'You are using Artiss YouTube Embed version ' . youtube_embed_version . '. It was written by David Artiss.' ); ?></p>
|
17 |
-
|
18 |
-
<a href="http://www.youtube.com/"><img src="<?php echo plugins_url(); ?>/youtube-embed/images/poweredby.png" alt="Powered by YouTube" title="Powered by YouTube" align="right" /></a>
|
19 |
-
|
20 |
-
<?php
|
21 |
-
|
22 |
-
_e( '<h3>Copyrights</h3>' );
|
23 |
-
|
24 |
-
_e( '<p>YouTube, and all associated logos, is the copyright of Google Inc.</p>' );
|
25 |
-
|
26 |
-
_e( '<p>EmbedPlus is copyright. Read the <a href="http://embedplus.com/terms.aspx" target="_blank">Terms & Conditions of Use</a>.</p>' );
|
27 |
-
|
28 |
-
_e( '<h3>Acknowledgements</h3>' );
|
29 |
-
|
30 |
-
_e( '<p>Images have been compressed with <a href="http://www.smushit.com/ysmush.it/">Smush.it</a>.</p>' );
|
31 |
-
|
32 |
-
_e( '<p>JavaScript has been compressed with <a href="http://javascriptcompressor.com/">JavaScript Compressor</a>.</p>' );
|
33 |
-
|
34 |
-
_e( '<p>YouTube icons are courtesy of <a href="http://www.youtube.com/t/creators_downloads">YouTube</a>. Other icons are by <a href="http://p.yusukekamiyamane.com/">Yusuke Kamiyamane</a>.</p>' );
|
35 |
-
|
36 |
-
_e( '<h3>Support Information</h3>' );
|
37 |
-
|
38 |
-
_e( '<p>Useful support information and links can be found by clicking on the Help tab at the top of each of the Artiss YouTube Embed administration screens.</p>' );
|
39 |
-
|
40 |
-
_e( '<h4>This plugin, and all support, is supplied for free, but <a title="Donate" href="http://artiss.co.uk/donate" target="_blank">donations</a> are always welcome.</h4>' );
|
41 |
-
|
42 |
-
_e( '<h3>Stay in Touch</h3>' );
|
43 |
-
|
44 |
-
_e( '<p><a href="http://www.artiss.co.uk/wp-plugins">See the full list</a> of Artiss plugins, including beta releases.</p>' );
|
45 |
-
|
46 |
-
_e( '<p><a href="http://www.twitter.com/artiss_tech">Follow Artiss.co.uk</a> on Twitter.</p>' );
|
47 |
-
|
48 |
-
_e( '<p><a href="http://www.artiss.co.uk/feed">Subscribe</a> to the Artiss.co.uk news feed.</p>' );
|
49 |
-
|
50 |
-
?>
|
51 |
-
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/add-scripts.php
DELETED
@@ -1,52 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Add Scripts
|
4 |
-
*
|
5 |
-
* Add JS and CSS to the main theme and to admin
|
6 |
-
*
|
7 |
-
* @package YouTubeEmbed
|
8 |
-
*/
|
9 |
-
|
10 |
-
/**
|
11 |
-
* Add scripts to theme
|
12 |
-
*
|
13 |
-
* Add styles and scripts to the main theme
|
14 |
-
*
|
15 |
-
* @since 2.4
|
16 |
-
*/
|
17 |
-
|
18 |
-
function ye_main_scripts() {
|
19 |
-
|
20 |
-
wp_enqueue_script( 'ye_ga_js', plugins_url( '/youtube-embed/js/ye-gatracker.js' ) );
|
21 |
-
|
22 |
-
wp_register_style( 'ye_dynamic', plugins_url( '/youtube-embed/css/ye-dynamic.css' ) );
|
23 |
-
|
24 |
-
wp_enqueue_style( 'ye_dynamic' );
|
25 |
-
|
26 |
-
}
|
27 |
-
|
28 |
-
add_action( 'wp_enqueue_scripts', 'ye_main_scripts' );
|
29 |
-
|
30 |
-
/**
|
31 |
-
* Add CSS to admin
|
32 |
-
*
|
33 |
-
* Add stylesheets to the admin screens
|
34 |
-
*
|
35 |
-
* @since 2.0
|
36 |
-
*/
|
37 |
-
|
38 |
-
function ye_admin_css() {
|
39 |
-
|
40 |
-
wp_enqueue_style( 'ye_admin', plugins_url() . '/youtube-embed/css/ye-admin.css' );
|
41 |
-
|
42 |
-
wp_enqueue_style( 'ye_dynamic', plugins_url() . '/youtube-embed/css/ye-dynamic.css' );
|
43 |
-
|
44 |
-
global $wp_version;
|
45 |
-
if ( ( float ) $wp_version >= 3.2 ) { $version = ''; } else { $version = '-3.1'; }
|
46 |
-
|
47 |
-
wp_enqueue_style( 'tinymce_button', plugins_url() . '/youtube-embed/css/ye-tinymce-button' . $version . '.css' );
|
48 |
-
|
49 |
-
}
|
50 |
-
|
51 |
-
add_action( 'admin_print_styles', 'ye_admin_css' );
|
52 |
-
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/admin-bar.php
DELETED
@@ -1,38 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Admin Bar
|
4 |
-
*
|
5 |
-
* Set up Admin Bar links
|
6 |
-
*
|
7 |
-
* @package YouTubeEmbed
|
8 |
-
*/
|
9 |
-
|
10 |
-
/**
|
11 |
-
* Add option to Admin Bar
|
12 |
-
*
|
13 |
-
* Add link to YouTube Embed profile options to Admin Bar. This will only appear
|
14 |
-
* if the user can edit plugins
|
15 |
-
*
|
16 |
-
* @since 2.0
|
17 |
-
*/
|
18 |
-
|
19 |
-
function ye_admin_bar_render() {
|
20 |
-
|
21 |
-
if ( current_user_can( 'edit_plugins' ) ) {
|
22 |
-
|
23 |
-
$options = ye_set_general_defaults();
|
24 |
-
|
25 |
-
if ( $options[ 'admin_bar' ] != '' ) {
|
26 |
-
|
27 |
-
global $wp_admin_bar;
|
28 |
-
$wp_admin_bar -> add_menu( array(
|
29 |
-
'parent' => 'appearance',
|
30 |
-
'id' => 'ye-options',
|
31 |
-
'title' => __( 'YouTube Embed' ),
|
32 |
-
'href' => admin_url( 'admin.php?page=youtube-embed-profiles' ),
|
33 |
-
'meta' => false ) );
|
34 |
-
}
|
35 |
-
}
|
36 |
-
}
|
37 |
-
add_action( 'wp_before_admin_bar_render', 'ye_admin_bar_render' );
|
38 |
-
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/admin-config.php
DELETED
@@ -1,283 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Admin Config Functions
|
4 |
-
*
|
5 |
-
* Various functions relating to the various administration screens
|
6 |
-
*
|
7 |
-
* @package YouTubeEmbed
|
8 |
-
*/
|
9 |
-
|
10 |
-
/**
|
11 |
-
* Admin Screen Initialisation
|
12 |
-
*
|
13 |
-
* Set up admin menu and submenu options
|
14 |
-
*
|
15 |
-
* @since 2.0
|
16 |
-
*
|
17 |
-
* @uses ye_add_submenu Add a submenu, with optional help drop-down
|
18 |
-
*/
|
19 |
-
|
20 |
-
function ye_menu_initialise() {
|
21 |
-
|
22 |
-
add_menu_page( 'YouTube Embed Options', 'YouTube', 'manage_options', 'youtube-embed-general', 'ye_general_options', plugins_url() . '/youtube-embed/images/menu_icon.png' );
|
23 |
-
|
24 |
-
ye_add_submenu( 'YouTube Embed Options', 'Options', 'youtube-embed-general', 'ye_general_options' );
|
25 |
-
ye_add_submenu( 'YouTube Embed Profiles', 'Profiles', 'youtube-embed-profiles', 'ye_profile_options' );
|
26 |
-
ye_add_submenu( 'YouTube Embed Lists', 'Lists', 'youtube-embed-lists', 'ye_list_options' );
|
27 |
-
|
28 |
-
if ( function_exists( 'wp_readme_parser' ) ) {
|
29 |
-
ye_add_submenu( 'YouTube Embed README', 'README', 'youtube-embed-readme', 'ye_support_readme' );
|
30 |
-
}
|
31 |
-
|
32 |
-
ye_add_submenu( 'YouTube Embed About', 'About', 'youtube-embed-about', 'ye_support_about' );
|
33 |
-
|
34 |
-
add_filter( 'plugin_action_links', 'ye_add_settings_link', 10, 2 );
|
35 |
-
}
|
36 |
-
|
37 |
-
add_action( 'admin_menu','ye_menu_initialise' );
|
38 |
-
|
39 |
-
add_filter( 'plugin_row_meta', 'ye_set_plugin_meta', 10, 2 );
|
40 |
-
|
41 |
-
/**
|
42 |
-
* Include general options screen
|
43 |
-
*
|
44 |
-
* XHTML options screen to prompt and update some general plugin options
|
45 |
-
*
|
46 |
-
* @since 2.0
|
47 |
-
*/
|
48 |
-
|
49 |
-
function ye_general_options() {
|
50 |
-
|
51 |
-
include_once( WP_PLUGIN_DIR . "/youtube-embed/includes/options-general.php" );
|
52 |
-
|
53 |
-
}
|
54 |
-
|
55 |
-
/**
|
56 |
-
* Include profile options screen
|
57 |
-
*
|
58 |
-
* XHTML options screen to prompt and update profile options
|
59 |
-
*
|
60 |
-
* @since 2.0
|
61 |
-
*/
|
62 |
-
|
63 |
-
function ye_profile_options() {
|
64 |
-
|
65 |
-
include_once( WP_PLUGIN_DIR . "/youtube-embed/includes/options-profiles.php" );
|
66 |
-
|
67 |
-
}
|
68 |
-
|
69 |
-
/**
|
70 |
-
* Include list options screen
|
71 |
-
*
|
72 |
-
* XHTML options screen to prompt and update list options
|
73 |
-
*
|
74 |
-
* @since 2.0
|
75 |
-
*/
|
76 |
-
|
77 |
-
function ye_list_options() {
|
78 |
-
|
79 |
-
include_once( WP_PLUGIN_DIR . "/youtube-embed/includes/options-lists.php" );
|
80 |
-
|
81 |
-
}
|
82 |
-
|
83 |
-
/**
|
84 |
-
* Include README screen
|
85 |
-
*
|
86 |
-
* Parse and display the README instructions
|
87 |
-
*
|
88 |
-
* @since 2.4
|
89 |
-
*/
|
90 |
-
|
91 |
-
function ye_support_readme() {
|
92 |
-
include_once( WP_PLUGIN_DIR . "/youtube-embed/includes/display-readme.php" );
|
93 |
-
}
|
94 |
-
|
95 |
-
/**
|
96 |
-
* Include about and support screen
|
97 |
-
*
|
98 |
-
* XHTML about screen which will, optionally, display help details as well
|
99 |
-
*
|
100 |
-
* @since 2.0
|
101 |
-
*/
|
102 |
-
|
103 |
-
function ye_support_about() {
|
104 |
-
|
105 |
-
include_once( WP_PLUGIN_DIR . "/youtube-embed/includes/about.php" );
|
106 |
-
|
107 |
-
}
|
108 |
-
|
109 |
-
/**
|
110 |
-
* Add Settings link to plugin list
|
111 |
-
*
|
112 |
-
* Add a Settings link to the options listed against this plugin
|
113 |
-
*
|
114 |
-
* @since 2.0
|
115 |
-
*
|
116 |
-
* @param string $links Current links
|
117 |
-
* @param string $file File in use
|
118 |
-
* @return string Links, now with settings added
|
119 |
-
*/
|
120 |
-
|
121 |
-
function ye_add_settings_link( $links, $file ) {
|
122 |
-
|
123 |
-
static $this_plugin;
|
124 |
-
|
125 |
-
if ( !$this_plugin ) { $this_plugin = plugin_basename( __FILE__ ); }
|
126 |
-
|
127 |
-
if ( strpos( $file, 'youtube-embed.php' ) !== false ) {
|
128 |
-
$settings_link = '<a href="admin.php?page=youtube-embed-general">' . __( 'Settings' ) . '</a>';
|
129 |
-
array_unshift( $links, $settings_link );
|
130 |
-
}
|
131 |
-
|
132 |
-
return $links;
|
133 |
-
}
|
134 |
-
|
135 |
-
/**
|
136 |
-
* Add meta to plugin details
|
137 |
-
*
|
138 |
-
* Add options to plugin meta line
|
139 |
-
*
|
140 |
-
* @since 2.0
|
141 |
-
*
|
142 |
-
* @param string $links Current links
|
143 |
-
* @param string $file File in use
|
144 |
-
* @return string Links, now with settings added
|
145 |
-
*/
|
146 |
-
|
147 |
-
function ye_set_plugin_meta( $links, $file ) {
|
148 |
-
|
149 |
-
if ( strpos( $file, 'youtube-embed.php' ) !== false ) {
|
150 |
-
|
151 |
-
$links = array_merge( $links, array( '<a href="admin.php?page=youtube-embed-about">' . __( 'Support' ) . '</a>' ) );
|
152 |
-
|
153 |
-
$links = array_merge( $links, array( '<a href="http://www.artiss.co.uk/donate">' . __( 'Donate' ) . '</a>' ) );
|
154 |
-
|
155 |
-
}
|
156 |
-
|
157 |
-
return $links;
|
158 |
-
}
|
159 |
-
|
160 |
-
|
161 |
-
/**
|
162 |
-
* Add a submenu and, optionally, help
|
163 |
-
*
|
164 |
-
* Add a submenu and, if using WP 3 and above, help instructions to the drop-down
|
165 |
-
* at the top of the screen
|
166 |
-
*
|
167 |
-
* @since 2.0
|
168 |
-
*
|
169 |
-
* @param string $page_title Title to give menu page
|
170 |
-
* @param string $menu_title Title for menu option
|
171 |
-
* @param string $menu_slug Unique slug for the menu
|
172 |
-
* @param string $function Function name for menu option
|
173 |
-
*/
|
174 |
-
|
175 |
-
function ye_add_submenu( $page_title, $menu_title, $menu_slug, $function ) {
|
176 |
-
|
177 |
-
$profile_slug = add_submenu_page( 'youtube-embed-general', $page_title, $menu_title, 'manage_options', $menu_slug, $function );
|
178 |
-
|
179 |
-
if ( $menu_slug == "youtube-embed-general" ) { $help_text = '<p>This screen allows you to select non-specific options for the Artiss YouTube Embed plugin. For the default embedding settings, please select the <a href="http://www.artiss.co.uk/wp-admin/admin.php?page=youtube-embed-profiles">Profiles</a> administration option.</p>'; }
|
180 |
-
|
181 |
-
if ( $menu_slug == "youtube-embed-profiles" ) { $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.</p>"; }
|
182 |
-
|
183 |
-
if ( $menu_slug == "youtube-embed-lists" ) { $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.</p>'; }
|
184 |
-
|
185 |
-
if ( ( $menu_slug != "youtube-embed-about" ) && ( $menu_slug != "youtube-embed-readme" ) ) {
|
186 |
-
$help_text .= '<p>Remember to click the Save Settings button at the bottom of the screen for new settings to take effect.</p>';
|
187 |
-
} else {
|
188 |
-
$help_text = '<p>This screen provides useful information about this plugin along with methods of support.</p>';
|
189 |
-
}
|
190 |
-
|
191 |
-
$help_text .= '<p><strong>For more information:</strong></p><p><a href="http://www.artiss.co.uk/artiss-youtube-embed">Artiss YouTube Embed Plugin Documentation</a></p><p><a href="http://code.google.com/apis/youtube/player_parameters.html">YouTube Player Documentation</a></p>';
|
192 |
-
|
193 |
-
if ( $menu_slug == "youtube-embed-profiles" ) { $help_text .= '<p><a href="http://embedplus.com/">EmbedPlus website</a></p>'; }
|
194 |
-
|
195 |
-
$help_text .= '<p><a href="http://www.artiss.co.uk/forum/specific-plugins-group2/artiss-youtube-embed-forum7">Artiss YouTube Embed Support Forum</a></p><h4>This plugin, and all support, is supplied for free, but <a title="Donate" href="http://artiss.co.uk/donate" target="_blank">donations</a> are always welcome.</h4>';
|
196 |
-
|
197 |
-
add_contextual_help( $profile_slug, __( $help_text ) );
|
198 |
-
|
199 |
-
return;
|
200 |
-
}
|
201 |
-
|
202 |
-
/**
|
203 |
-
* Detect plugin activation
|
204 |
-
*
|
205 |
-
* Upon detection of activation set an option
|
206 |
-
*
|
207 |
-
* @since 2.4
|
208 |
-
*/
|
209 |
-
|
210 |
-
function ye_plugin_activate() {
|
211 |
-
|
212 |
-
update_option( 'youtube_embed_activated', true );
|
213 |
-
|
214 |
-
}
|
215 |
-
register_activation_hook( WP_PLUGIN_DIR . "/youtube-embed/youtube-embed.php", 'ye_plugin_activate' );
|
216 |
-
|
217 |
-
// If plugin activated, run activation commands and delete option
|
218 |
-
|
219 |
-
global $wp_version;
|
220 |
-
|
221 |
-
if ( get_option( 'youtube_embed_activated' ) && ( ( float ) $wp_version >= 3.3 ) ) {
|
222 |
-
|
223 |
-
add_action( 'admin_enqueue_scripts', 'ye_admin_enqueue_scripts' );
|
224 |
-
|
225 |
-
delete_option( 'youtube_embed_activated' );
|
226 |
-
|
227 |
-
}
|
228 |
-
|
229 |
-
/**
|
230 |
-
* Enqueue Feature Pointer files
|
231 |
-
*
|
232 |
-
* Add the required feature pointer files
|
233 |
-
*
|
234 |
-
* @since 2.4
|
235 |
-
*/
|
236 |
-
|
237 |
-
function ye_admin_enqueue_scripts() {
|
238 |
-
|
239 |
-
wp_enqueue_style( 'wp-pointer' );
|
240 |
-
wp_enqueue_script( 'wp-pointer' );
|
241 |
-
|
242 |
-
add_action( 'admin_print_footer_scripts', 'ye_admin_print_footer_scripts' );
|
243 |
-
}
|
244 |
-
|
245 |
-
/**
|
246 |
-
* Show Feature Pointer
|
247 |
-
*
|
248 |
-
* Display feature pointer
|
249 |
-
*
|
250 |
-
* @since 2.4
|
251 |
-
*/
|
252 |
-
|
253 |
-
function ye_admin_print_footer_scripts() {
|
254 |
-
|
255 |
-
$pointer_content = '<h3>Welcome to Artiss YouTube Embed</h3>';
|
256 |
-
$pointer_content .= '<p style="font-style:italic;">Thank you for installing this plugin.</p>';
|
257 |
-
$pointer_content .= '<p>These new menu options will allow you to configure your videos to just how you want them and provide links for help and support.</p><p>Even if you do nothing else, please visit the Profiles option to check your default video values.';
|
258 |
-
?>
|
259 |
-
<script>
|
260 |
-
jQuery(function () {
|
261 |
-
var body = jQuery(document.body),
|
262 |
-
menu = jQuery('#toplevel_page_youtube-embed-general'),
|
263 |
-
collapse = jQuery('#collapse-menu'),
|
264 |
-
yembed = menu.find("a[href='admin.php?page=youtube-embed-profiles']"),
|
265 |
-
options = {
|
266 |
-
content: '<?php echo $pointer_content; ?>',
|
267 |
-
position: {
|
268 |
-
edge: 'left',
|
269 |
-
align: 'center',
|
270 |
-
of: menu.is('.wp-menu-open') && !menu.is('.folded *') ? yembed : menu
|
271 |
-
},
|
272 |
-
close: function() {
|
273 |
-
}};
|
274 |
-
|
275 |
-
if ( !yembed.length )
|
276 |
-
return;
|
277 |
-
|
278 |
-
body.pointer(options).pointer('open');
|
279 |
-
});
|
280 |
-
</script>
|
281 |
-
<?php
|
282 |
-
}
|
283 |
-
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/{mcebutton.php → aye-add-mce-button.php}
RENAMED
@@ -4,7 +4,7 @@
|
|
4 |
*
|
5 |
* Add extra button(s) to TinyMCE interface
|
6 |
*
|
7 |
-
* @package
|
8 |
*/
|
9 |
|
10 |
/**
|
@@ -12,13 +12,15 @@
|
|
12 |
*
|
13 |
* Add filters (assuming user is editing) for TinyMCE
|
14 |
*
|
|
|
|
|
15 |
* @since 2.0
|
16 |
*/
|
17 |
|
18 |
function youtube_embed_button() {
|
19 |
|
20 |
if ( current_user_can( 'edit_posts' ) ) {
|
21 |
-
$options =
|
22 |
|
23 |
if ( ( get_user_option( 'rich_editing' ) == 'true' ) && ( $options[ 'editor_button' ] != '' ) ) {
|
24 |
add_filter( 'mce_external_plugins', 'add_youtube_embed_mce_plugin' );
|
@@ -26,7 +28,7 @@ function youtube_embed_button() {
|
|
26 |
}
|
27 |
}
|
28 |
}
|
29 |
-
add_action( 'init','youtube_embed_button' );
|
30 |
|
31 |
/**
|
32 |
* Register new TinyMCE button
|
@@ -56,7 +58,7 @@ function register_youtube_embed_button( $buttons ) {
|
|
56 |
*/
|
57 |
|
58 |
function add_youtube_embed_mce_plugin( $plugin_array ) {
|
59 |
-
$plugin_array[ 'YouTube' ] = plugins_url() . '/youtube-embed/js/
|
60 |
return $plugin_array;
|
61 |
}
|
62 |
?>
|
4 |
*
|
5 |
* Add extra button(s) to TinyMCE interface
|
6 |
*
|
7 |
+
* @package Artiss-YouTube-Embed
|
8 |
*/
|
9 |
|
10 |
/**
|
12 |
*
|
13 |
* Add filters (assuming user is editing) for TinyMCE
|
14 |
*
|
15 |
+
* @uses aye_set_general_defaults Set default options
|
16 |
+
*
|
17 |
* @since 2.0
|
18 |
*/
|
19 |
|
20 |
function youtube_embed_button() {
|
21 |
|
22 |
if ( current_user_can( 'edit_posts' ) ) {
|
23 |
+
$options = aye_set_general_defaults();
|
24 |
|
25 |
if ( ( get_user_option( 'rich_editing' ) == 'true' ) && ( $options[ 'editor_button' ] != '' ) ) {
|
26 |
add_filter( 'mce_external_plugins', 'add_youtube_embed_mce_plugin' );
|
28 |
}
|
29 |
}
|
30 |
}
|
31 |
+
add_action( 'init', 'youtube_embed_button' );
|
32 |
|
33 |
/**
|
34 |
* Register new TinyMCE button
|
58 |
*/
|
59 |
|
60 |
function add_youtube_embed_mce_plugin( $plugin_array ) {
|
61 |
+
$plugin_array[ 'YouTube' ] = plugins_url() . '/youtube-embed/js/aye-mce-button.js';
|
62 |
return $plugin_array;
|
63 |
}
|
64 |
?>
|
includes/aye-add-scripts.php
ADDED
@@ -0,0 +1,52 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Add Scripts
|
4 |
+
*
|
5 |
+
* Add JS and CSS to the main theme and to admin
|
6 |
+
*
|
7 |
+
* @package Artiss-YouTube-Embed
|
8 |
+
*/
|
9 |
+
|
10 |
+
/**
|
11 |
+
* Add scripts to theme
|
12 |
+
*
|
13 |
+
* Add styles and scripts to the main theme
|
14 |
+
*
|
15 |
+
* @since 2.4
|
16 |
+
*/
|
17 |
+
|
18 |
+
function aye_main_scripts() {
|
19 |
+
|
20 |
+
wp_enqueue_script( 'aye_ga_js', plugins_url( '/youtube-embed/js/aye-ga-tracker.js' ) );
|
21 |
+
|
22 |
+
wp_register_style( 'aye_dynamic', plugins_url( '/youtube-embed/css/aye-dynamic.css' ) );
|
23 |
+
|
24 |
+
wp_enqueue_style( 'aye_dynamic' );
|
25 |
+
|
26 |
+
}
|
27 |
+
|
28 |
+
add_action( 'wp_enqueue_scripts', 'aye_main_scripts' );
|
29 |
+
|
30 |
+
/**
|
31 |
+
* Add CSS to admin
|
32 |
+
*
|
33 |
+
* Add stylesheets to the admin screens
|
34 |
+
*
|
35 |
+
* @since 2.0
|
36 |
+
*/
|
37 |
+
|
38 |
+
function aye_admin_css() {
|
39 |
+
|
40 |
+
wp_enqueue_style( 'aye_admin', plugins_url() . '/youtube-embed/css/aye-admin.css' );
|
41 |
+
|
42 |
+
wp_enqueue_style( 'aye_dynamic', plugins_url() . '/youtube-embed/css/aye-dynamic.css' );
|
43 |
+
|
44 |
+
global $wp_version;
|
45 |
+
if ( ( float ) $wp_version >= 3.2 ) { $version = ''; } else { $version = '-3.1'; }
|
46 |
+
|
47 |
+
wp_enqueue_style( 'tinymce_button', plugins_url() . '/youtube-embed/css/aye-tinymce-button' . $version . '.css' );
|
48 |
+
|
49 |
+
}
|
50 |
+
|
51 |
+
add_action( 'admin_print_styles', 'aye_admin_css' );
|
52 |
+
?>
|
includes/aye-add-to-admin-bar.php
ADDED
@@ -0,0 +1,107 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Admin Bar
|
4 |
+
*
|
5 |
+
* Set up Admin Bar links
|
6 |
+
*
|
7 |
+
* @package Artiss-YouTube-Embed
|
8 |
+
*/
|
9 |
+
|
10 |
+
/**
|
11 |
+
* Add option to Admin Bar (WP 3.1 - 3.3)
|
12 |
+
*
|
13 |
+
* Add link to YouTube Embed profile options to Admin Bar. This will only appear
|
14 |
+
* if the user can edit plugins
|
15 |
+
* With help from http://technerdia.com/1140_wordpress-admin-bar.html
|
16 |
+
*
|
17 |
+
* @uses aye_set_general_default Set default options
|
18 |
+
*
|
19 |
+
* @since 2.0
|
20 |
+
*/
|
21 |
+
|
22 |
+
function ye_admin_bar_render_3_1() {
|
23 |
+
|
24 |
+
global $wp_version;
|
25 |
+
|
26 |
+
if ( current_user_can( 'edit_plugins' ) && ( ( float ) $wp_version >= 3.1 ) && ( ( float ) $wp_version < 3.3 ) ) {
|
27 |
+
|
28 |
+
$options = ye_set_general_defaults();
|
29 |
+
|
30 |
+
if ( $options[ 'admin_bar' ] != '' ) {
|
31 |
+
|
32 |
+
global $wp_admin_bar;
|
33 |
+
$wp_admin_bar -> add_menu( array(
|
34 |
+
'parent' => 'appearance',
|
35 |
+
'id' => 'ye-options',
|
36 |
+
'title' => __( 'YouTube Embed' ),
|
37 |
+
'href' => admin_url( 'admin.php?page=youtube-embed-profiles' ),
|
38 |
+
'meta' => false ) );
|
39 |
+
}
|
40 |
+
}
|
41 |
+
}
|
42 |
+
|
43 |
+
add_action( 'wp_before_admin_bar_render', 'ye_admin_bar_render_3_1' );
|
44 |
+
|
45 |
+
/**
|
46 |
+
* Add option to Admin Bar (WP 3.3+)
|
47 |
+
*
|
48 |
+
* Add link to YouTube Embed profile options to Admin Bar.
|
49 |
+
* With help from http://technerdia.com/1140_wordpress-admin-bar.html
|
50 |
+
*
|
51 |
+
* @uses aye_set_general_default Set default options
|
52 |
+
*
|
53 |
+
* @since 2.5
|
54 |
+
*/
|
55 |
+
|
56 |
+
function aye_admin_bar_render_3_3( $meta = TRUE ) {
|
57 |
+
|
58 |
+
global $wp_version;
|
59 |
+
|
60 |
+
if ( ( float ) $wp_version >= 3.3 ) {
|
61 |
+
|
62 |
+
$options = aye_set_general_defaults();
|
63 |
+
|
64 |
+
if ( $options[ 'admin_bar' ] != '' ) {
|
65 |
+
|
66 |
+
global $wp_admin_bar;
|
67 |
+
|
68 |
+
if ( !is_user_logged_in() ) { return; }
|
69 |
+
if ( !is_super_admin() || !is_admin_bar_showing() ) { return; }
|
70 |
+
|
71 |
+
$wp_admin_bar -> add_menu( array(
|
72 |
+
'id' => 'aye-menu',
|
73 |
+
'title' => __( 'YouTube Embed' ) ) );
|
74 |
+
|
75 |
+
$wp_admin_bar -> add_menu( array(
|
76 |
+
'parent' => 'aye-menu',
|
77 |
+
'id' => 'aye-options',
|
78 |
+
'title' => __( 'Options' ),
|
79 |
+
'href' => admin_url( 'admin.php?page=aye-general-options' ),
|
80 |
+
'meta' => array( 'target' => '_blank' ) ) );
|
81 |
+
|
82 |
+
$wp_admin_bar -> add_menu( array(
|
83 |
+
'parent' => 'aye-menu',
|
84 |
+
'id' => 'aye-profile',
|
85 |
+
'title' => __( 'Profiles' ),
|
86 |
+
'href' => admin_url( 'admin.php?page=aye-profile-options' ),
|
87 |
+
'meta' => array( 'target' => '_blank' ) ) );
|
88 |
+
|
89 |
+
$wp_admin_bar -> add_menu( array(
|
90 |
+
'parent' => 'aye-menu',
|
91 |
+
'id' => 'aye-lists',
|
92 |
+
'title' => __( 'Lists' ),
|
93 |
+
'href' => admin_url( 'admin.php?page=aye-list-options' ),
|
94 |
+
'meta' => array( 'target' => '_blank' ) ) );
|
95 |
+
|
96 |
+
$wp_admin_bar -> add_menu( array(
|
97 |
+
'parent' => 'aye-menu',
|
98 |
+
'id' => 'aye-readme',
|
99 |
+
'title' => __( 'README' ),
|
100 |
+
'href' => admin_url( 'admin.php?page=aye-support-readme' ),
|
101 |
+
'meta' => array( 'target' => '_blank' ) ) );
|
102 |
+
}
|
103 |
+
}
|
104 |
+
}
|
105 |
+
|
106 |
+
add_action( 'admin_bar_menu', 'aye_admin_bar_render_3_3', 40 );
|
107 |
+
?>
|
includes/aye-admin-config.php
ADDED
@@ -0,0 +1,479 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Admin Config Functions
|
4 |
+
*
|
5 |
+
* Various functions relating to the various administration screens
|
6 |
+
*
|
7 |
+
* @package Artiss-YouTube-Embed
|
8 |
+
*/
|
9 |
+
|
10 |
+
/**
|
11 |
+
* Add Settings link to plugin list
|
12 |
+
*
|
13 |
+
* Add a Settings link to the options listed against this plugin
|
14 |
+
*
|
15 |
+
* @since 2.0
|
16 |
+
*
|
17 |
+
* @param string $links Current links
|
18 |
+
* @param string $file File in use
|
19 |
+
* @return string Links, now with settings added
|
20 |
+
*/
|
21 |
+
|
22 |
+
function aye_add_settings_link( $links, $file ) {
|
23 |
+
|
24 |
+
static $this_plugin;
|
25 |
+
|
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=aye-general-options">' . __( 'Settings' ) . '</a>';
|
30 |
+
array_unshift( $links, $settings_link );
|
31 |
+
}
|
32 |
+
|
33 |
+
return $links;
|
34 |
+
}
|
35 |
+
|
36 |
+
add_filter( 'plugin_action_links', 'aye_add_settings_link', 10, 2 );
|
37 |
+
|
38 |
+
/**
|
39 |
+
* Add meta to plugin details
|
40 |
+
*
|
41 |
+
* Add options to plugin meta line
|
42 |
+
*
|
43 |
+
* @since 2.0
|
44 |
+
*
|
45 |
+
* @param string $links Current links
|
46 |
+
* @param string $file File in use
|
47 |
+
* @return string Links, now with settings added
|
48 |
+
*/
|
49 |
+
|
50 |
+
function aye_set_plugin_meta( $links, $file ) {
|
51 |
+
|
52 |
+
if ( strpos( $file, 'youtube-embed.php' ) !== false ) {
|
53 |
+
|
54 |
+
$links = array_merge( $links, array( '<a href="admin.php?page=aye-display-about">' . __( 'Support' ) . '</a>' ) );
|
55 |
+
|
56 |
+
$links = array_merge( $links, array( '<a href="http://www.artiss.co.uk/donate">' . __( 'Donate' ) . '</a>' ) );
|
57 |
+
}
|
58 |
+
|
59 |
+
return $links;
|
60 |
+
}
|
61 |
+
|
62 |
+
add_filter( 'plugin_row_meta', 'aye_set_plugin_meta', 10, 2 );
|
63 |
+
|
64 |
+
/**
|
65 |
+
* Admin Screen Initialisation
|
66 |
+
*
|
67 |
+
* Set up admin menu and submenu options
|
68 |
+
*
|
69 |
+
* @since 2.0
|
70 |
+
*
|
71 |
+
* @uses aye_contextual_help_type Work out help type
|
72 |
+
*/
|
73 |
+
|
74 |
+
function aye_menu_initialise() {
|
75 |
+
|
76 |
+
// Depending on WordPress version and available functions decide which (if any) contextual help system to use
|
77 |
+
|
78 |
+
$contextual_help = aye_contextual_help_type();
|
79 |
+
|
80 |
+
// Add main admin option
|
81 |
+
|
82 |
+
add_menu_page( __( 'Artiss YouTube Embed Settings' ), __( 'YouTube' ), 'manage_options', 'aye-general-options', 'aye_general_options', plugins_url() . '/youtube-embed/images/menu_icon.png' );
|
83 |
+
|
84 |
+
// Add options sub-menu
|
85 |
+
|
86 |
+
if ( $contextual_help == 'new' ) { global $aye_options_hook; }
|
87 |
+
|
88 |
+
$aye_options_hook = add_submenu_page( 'aye-general-options', __( 'Artiss YouTube Embed Options' ), __( 'Options' ), 'edit_posts', 'aye-general-options', 'aye_general_options' );
|
89 |
+
|
90 |
+
if ( $contextual_help == 'new' ) { add_action( 'load-' . $aye_options_hook, 'aye_add_options_help' ); }
|
91 |
+
|
92 |
+
if ( $contextual_help == 'old' ) { add_contextual_help( $aye_options_hook, aye_options_help() ); }
|
93 |
+
|
94 |
+
// Add profiles sub-menu
|
95 |
+
|
96 |
+
if ( $contextual_help == 'new' ) { global $aye_profiles_hook; }
|
97 |
+
|
98 |
+
$aye_profiles_hook = add_submenu_page( 'aye-general-options', __( 'Artiss YouTube Embed Profiles' ), __( 'Profiles' ), 'edit_posts', 'aye-profile-options', 'aye_profile_options' );
|
99 |
+
|
100 |
+
if ( $contextual_help == 'new' ) { add_action( 'load-' . $aye_profiles_hook, 'aye_add_profiles_help' ); }
|
101 |
+
|
102 |
+
if ( $contextual_help == 'old' ) { add_contextual_help( $aye_profiles_hook, aye_profiles_help() ); }
|
103 |
+
|
104 |
+
// Add lists sub-menu
|
105 |
+
|
106 |
+
if ( $contextual_help == 'new' ) { global $aye_lists_hook; }
|
107 |
+
|
108 |
+
$aye_lists_hook = add_submenu_page( 'aye-general-options', __( 'Artiss YouTube Embed Lists' ), __( 'Lists' ), 'edit_posts', 'aye-list-options', 'aye_list_options' );
|
109 |
+
|
110 |
+
if ( $contextual_help == 'new' ) { add_action( 'load-' . $aye_lists_hook, 'aye_add_lists_help' ); }
|
111 |
+
|
112 |
+
if ( $contextual_help == 'old' ) { add_contextual_help( $aye_lists_hook, aye_lists_help() ); }
|
113 |
+
|
114 |
+
// Add readme sub-menu
|
115 |
+
|
116 |
+
if ( function_exists( 'wp_readme_parser' ) ) {
|
117 |
+
add_submenu_page( 'aye-general-options', __( 'Artiss YouTube Embed README' ), __( 'README' ), 'edit_posts', 'aye-support-readme', 'aye_support_readme' );
|
118 |
+
}
|
119 |
+
|
120 |
+
// Add about sub-menu
|
121 |
+
|
122 |
+
if ( $contextual_help == 'new' ) { global $aye_about_hook; }
|
123 |
+
|
124 |
+
$aye_about_hook = add_submenu_page( 'aye-general-options', __( 'About Artiss YouTube Embed' ), __( 'About' ), 'edit_posts', 'aye-support-about', 'aye_support_about' );
|
125 |
+
|
126 |
+
if ( $contextual_help == 'new' ) { add_action( 'load-' . $aye_about_hook, 'aye_add_about_help' ); }
|
127 |
+
|
128 |
+
if ( $contextual_help == 'old' ) { add_contextual_help( $aye_about_hook, aye_about_help() ); }
|
129 |
+
|
130 |
+
}
|
131 |
+
|
132 |
+
add_action( 'admin_menu', 'aye_menu_initialise' );
|
133 |
+
|
134 |
+
/**
|
135 |
+
* Get contextual help type
|
136 |
+
*
|
137 |
+
* Return whether this WP installation requires the new or old contextual help type, or none at all
|
138 |
+
*
|
139 |
+
* @since 2.5
|
140 |
+
*
|
141 |
+
* @return string Contextual help type - 'new', 'old' or false
|
142 |
+
*/
|
143 |
+
|
144 |
+
function aye_contextual_help_type() {
|
145 |
+
|
146 |
+
global $wp_version;
|
147 |
+
|
148 |
+
$type = false;
|
149 |
+
|
150 |
+
if ( ( float ) $wp_version >= 3.3 ) {
|
151 |
+
$type = 'new';
|
152 |
+
} else {
|
153 |
+
if ( function_exists( 'add_contextual_help' ) ) {
|
154 |
+
$type = 'old';
|
155 |
+
}
|
156 |
+
}
|
157 |
+
|
158 |
+
return $type;
|
159 |
+
}
|
160 |
+
|
161 |
+
/**
|
162 |
+
* Include general options screen
|
163 |
+
*
|
164 |
+
* XHTML options screen to prompt and update some general plugin options
|
165 |
+
*
|
166 |
+
* @since 2.0
|
167 |
+
*/
|
168 |
+
|
169 |
+
function aye_general_options() {
|
170 |
+
|
171 |
+
include_once( WP_PLUGIN_DIR . '/youtube-embed/includes/aye-options-general.php' );
|
172 |
+
|
173 |
+
}
|
174 |
+
|
175 |
+
/**
|
176 |
+
* Include profile options screen
|
177 |
+
*
|
178 |
+
* XHTML options screen to prompt and update profile options
|
179 |
+
*
|
180 |
+
* @since 2.0
|
181 |
+
*/
|
182 |
+
|
183 |
+
function aye_profile_options() {
|
184 |
+
|
185 |
+
include_once( WP_PLUGIN_DIR . '/youtube-embed/includes/aye-options-profiles.php' );
|
186 |
+
|
187 |
+
}
|
188 |
+
|
189 |
+
/**
|
190 |
+
* Include list options screen
|
191 |
+
*
|
192 |
+
* XHTML options screen to prompt and update list options
|
193 |
+
*
|
194 |
+
* @since 2.0
|
195 |
+
*/
|
196 |
+
|
197 |
+
function aye_list_options() {
|
198 |
+
|
199 |
+
include_once( WP_PLUGIN_DIR . '/youtube-embed/includes/aye-options-lists.php' );
|
200 |
+
|
201 |
+
}
|
202 |
+
|
203 |
+
/**
|
204 |
+
* Include README screen
|
205 |
+
*
|
206 |
+
* Parse and display the README instructions
|
207 |
+
*
|
208 |
+
* @since 2.4
|
209 |
+
*/
|
210 |
+
|
211 |
+
function aye_support_readme() {
|
212 |
+
include_once( WP_PLUGIN_DIR . '/youtube-embed/includes/aye-display-readme.php' );
|
213 |
+
}
|
214 |
+
|
215 |
+
/**
|
216 |
+
* Include about and support screen
|
217 |
+
*
|
218 |
+
* XHTML about screen which will, optionally, display help details as well
|
219 |
+
*
|
220 |
+
* @since 2.0
|
221 |
+
*/
|
222 |
+
|
223 |
+
function aye_support_about() {
|
224 |
+
|
225 |
+
include_once( WP_PLUGIN_DIR . '/youtube-embed/includes/aye-display-about.php' );
|
226 |
+
|
227 |
+
}
|
228 |
+
|
229 |
+
/**
|
230 |
+
* Add Options Help
|
231 |
+
*
|
232 |
+
* Add help tab to options screen
|
233 |
+
*
|
234 |
+
* @since 2.5
|
235 |
+
*
|
236 |
+
* @uses aye_options_help Return help text
|
237 |
+
*/
|
238 |
+
|
239 |
+
function aye_add_options_help() {
|
240 |
+
|
241 |
+
global $aye_options_hook;
|
242 |
+
$screen = get_current_screen();
|
243 |
+
|
244 |
+
if ( $screen->id != $aye_options_hook ) { return; }
|
245 |
+
|
246 |
+
$screen -> add_help_tab( array( 'id' => 'aye-options-help-tab', 'title' => __( 'Help' ), 'content' => aye_options_help() ) );
|
247 |
+
}
|
248 |
+
|
249 |
+
/**
|
250 |
+
* Options Help
|
251 |
+
*
|
252 |
+
* Return help text for options screen
|
253 |
+
*
|
254 |
+
* @since 2.5
|
255 |
+
*
|
256 |
+
* @return string Help Text
|
257 |
+
*/
|
258 |
+
|
259 |
+
function aye_options_help() {
|
260 |
+
|
261 |
+
$help_text = '<p>' . __( 'This screen allows you to select non-specific options for the Artiss YouTube Embed plugin. For the default embedding settings, please select the <a href="admin.php?page=aye-profile-options">Profiles</a> administration option.' ) . '</p>';
|
262 |
+
$help_text .= '<p>' . __( 'Remember to click the Save Settings button at the bottom of the screen for new settings to take effect.' ) . '</p>';
|
263 |
+
$help_text .= '<p><strong>' . __( 'For more information:' ) . '</strong></p>';
|
264 |
+
$help_text .= '<p><a href="http://www.artiss.co.uk/artiss-youtube-embed">' . __( 'Artiss YouTube Embed Plugin Documentation' ) . '</a></p>';
|
265 |
+
$help_text .= '<p><a href="http://code.google.com/apis/youtube/player_parameters.html">' . __( 'YouTube Player Documentation' ) . '</a></p>';
|
266 |
+
$help_text .= '<h4>' . __( 'This plugin, and all support, is supplied for free, but <a title="Donate" href="http://artiss.co.uk/donate" target="_blank">donations</a> are always welcome.' ) . '</h4>';
|
267 |
+
|
268 |
+
return $help_text;
|
269 |
+
}
|
270 |
+
|
271 |
+
/**
|
272 |
+
* Add Profiles Help
|
273 |
+
*
|
274 |
+
* Add help tab to profiles screen
|
275 |
+
*
|
276 |
+
* @since 2.5
|
277 |
+
*
|
278 |
+
* @uses aye_profiles_help Return help text
|
279 |
+
*/
|
280 |
+
|
281 |
+
function aye_add_profiles_help() {
|
282 |
+
|
283 |
+
global $aye_profiles_hook;
|
284 |
+
$screen = get_current_screen();
|
285 |
+
|
286 |
+
if ( $screen->id != $aye_profiles_hook ) { return; }
|
287 |
+
|
288 |
+
$screen -> add_help_tab( array( 'id' => 'aye-profiles-help-tab', 'title' => __( 'Help' ), 'content' => aye_profiles_help() ) );
|
289 |
+
}
|
290 |
+
|
291 |
+
/**
|
292 |
+
* Profiles Help
|
293 |
+
*
|
294 |
+
* Return help text for profiles screen
|
295 |
+
*
|
296 |
+
* @since 2.5
|
297 |
+
*
|
298 |
+
* @return string Help Text
|
299 |
+
*/
|
300 |
+
|
301 |
+
function aye_profiles_help() {
|
302 |
+
|
303 |
+
$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.' ) . '</p>';
|
304 |
+
$help_text .= '<p>' . __( 'Remember to click the Save Settings button at the bottom of the screen for new settings to take effect.' ) . '</p>';
|
305 |
+
$help_text .= '<p><strong>' . __( 'For more information:' ) . '</strong></p>';
|
306 |
+
$help_text .= '<p><a href="http://www.artiss.co.uk/artiss-youtube-embed">' . __( 'Artiss YouTube Embed Plugin Documentation' ) . '</a></p>';
|
307 |
+
$help_text .= '<p><a href="http://code.google.com/apis/youtube/player_parameters.html">' . __( 'YouTube Player Documentation' ) . '</a></p>';
|
308 |
+
$help_text .= '<p><a href="http://embedplus.com/">' . __( 'EmbedPlus website' ) . '</a></p>';
|
309 |
+
$help_text .= '<h4>' . __( 'This plugin, and all support, is supplied for free, but <a title="Donate" href="http://artiss.co.uk/donate" target="_blank">donations</a> are always welcome.' ) . '</h4>';
|
310 |
+
|
311 |
+
return $help_text;
|
312 |
+
}
|
313 |
+
|
314 |
+
/**
|
315 |
+
* Add Lists Help
|
316 |
+
*
|
317 |
+
* Add help tab to lists screen
|
318 |
+
*
|
319 |
+
* @since 2.5
|
320 |
+
*
|
321 |
+
* @uses aye_lists_help Return help text
|
322 |
+
*/
|
323 |
+
|
324 |
+
function aye_add_lists_help() {
|
325 |
+
|
326 |
+
global $aye_lists_hook;
|
327 |
+
$screen = get_current_screen();
|
328 |
+
|
329 |
+
if ( $screen->id != $aye_lists_hook ) { return; }
|
330 |
+
|
331 |
+
$screen -> add_help_tab( array( 'id' => 'aye-lists-help-tab', 'title' => __( 'Help' ), 'content' => aye_lists_help() ) );
|
332 |
+
}
|
333 |
+
|
334 |
+
/**
|
335 |
+
* Profiles Help
|
336 |
+
*
|
337 |
+
* Return help text for profiles screen
|
338 |
+
*
|
339 |
+
* @since 2.5
|
340 |
+
*
|
341 |
+
* @return string Help Text
|
342 |
+
*/
|
343 |
+
|
344 |
+
function aye_lists_help() {
|
345 |
+
|
346 |
+
$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.' ) . '</p>';
|
347 |
+
$help_text .= '<p>' . __( 'Remember to click the Save Settings button at the bottom of the screen for new settings to take effect.' ) . '</p>';
|
348 |
+
$help_text .= '<p><strong>' . __( 'For more information:' ) . '</strong></p>';
|
349 |
+
$help_text .= '<p><a href="http://www.artiss.co.uk/artiss-youtube-embed">' . __( 'Artiss YouTube Embed Plugin Documentation' ) . '</a></p>';
|
350 |
+
$help_text .= '<p><a href="http://code.google.com/apis/youtube/player_parameters.html">' . __( 'YouTube Player Documentation' ) . '</a></p>';
|
351 |
+
$help_text .= '<h4>' . __( 'This plugin, and all support, is supplied for free, but <a title="Donate" href="http://artiss.co.uk/donate" target="_blank">donations</a> are always welcome.' ) . '</h4>';
|
352 |
+
|
353 |
+
return $help_text;
|
354 |
+
}
|
355 |
+
|
356 |
+
/**
|
357 |
+
* Add About Help
|
358 |
+
*
|
359 |
+
* Add help tab to about screen
|
360 |
+
*
|
361 |
+
* @since 2.5
|
362 |
+
*
|
363 |
+
* @uses aye_about_help Return help text
|
364 |
+
*/
|
365 |
+
|
366 |
+
function aye_add_about_help() {
|
367 |
+
|
368 |
+
global $aye_about_hook;
|
369 |
+
$screen = get_current_screen();
|
370 |
+
|
371 |
+
if ( $screen->id != $aye_about_hook ) { return; }
|
372 |
+
|
373 |
+
$screen -> add_help_tab( array( 'id' => 'aye-about-help-tab', 'title' => __( 'Help' ), 'content' => aye_about_help() ) );
|
374 |
+
}
|
375 |
+
|
376 |
+
/**
|
377 |
+
* About Help
|
378 |
+
*
|
379 |
+
* Return help text for about screen
|
380 |
+
*
|
381 |
+
* @since 2.5
|
382 |
+
*
|
383 |
+
* @return string Help Text
|
384 |
+
*/
|
385 |
+
|
386 |
+
function aye_about_help() {
|
387 |
+
|
388 |
+
$help_text = '<p>' . __( 'This screen provides useful information about this plugin along with methods of support.' ) . '</p>';
|
389 |
+
$help_text .= '<p><strong>' . __( 'For more information:' ) . '</strong></p>';
|
390 |
+
$help_text .= '<p><a href="http://www.artiss.co.uk/artiss-youtube-embed">' . __( 'Artiss YouTube Embed Plugin Documentation' ) . '</a></p>';
|
391 |
+
$help_text .= '<p><a href="http://code.google.com/apis/youtube/player_parameters.html">' . __( 'YouTube Player Documentation' ) . '</a></p>';
|
392 |
+
$help_text .= '<h4>' . __( 'This plugin, and all support, is supplied for free, but <a title="Donate" href="http://artiss.co.uk/donate" target="_blank">donations</a> are always welcome.' ) . '</h4>';
|
393 |
+
|
394 |
+
return $help_text;
|
395 |
+
}
|
396 |
+
|
397 |
+
/**
|
398 |
+
* Detect plugin activation
|
399 |
+
*
|
400 |
+
* Upon detection of activation set an option
|
401 |
+
*
|
402 |
+
* @since 2.4
|
403 |
+
*/
|
404 |
+
|
405 |
+
function aye_plugin_activate() {
|
406 |
+
|
407 |
+
update_option( 'youtube_embed_activated', true );
|
408 |
+
|
409 |
+
}
|
410 |
+
|
411 |
+
register_activation_hook( WP_PLUGIN_DIR . "/youtube-embed/youtube-embed.php", 'aye_plugin_activate' );
|
412 |
+
|
413 |
+
// If plugin activated, run activation commands and delete option
|
414 |
+
|
415 |
+
global $wp_version;
|
416 |
+
|
417 |
+
if ( get_option( 'youtube_embed_activated' ) && ( ( float ) $wp_version >= 3.3 ) ) {
|
418 |
+
|
419 |
+
add_action( 'admin_enqueue_scripts', 'aye_admin_enqueue_scripts' );
|
420 |
+
|
421 |
+
delete_option( 'youtube_embed_activated' );
|
422 |
+
}
|
423 |
+
|
424 |
+
/**
|
425 |
+
* Enqueue Feature Pointer files
|
426 |
+
*
|
427 |
+
* Add the required feature pointer files
|
428 |
+
*
|
429 |
+
* @since 2.4
|
430 |
+
*/
|
431 |
+
|
432 |
+
function aye_admin_enqueue_scripts() {
|
433 |
+
|
434 |
+
wp_enqueue_style( 'wp-pointer' );
|
435 |
+
wp_enqueue_script( 'wp-pointer' );
|
436 |
+
|
437 |
+
add_action( 'admin_print_footer_scripts', 'aye_admin_print_footer_scripts' );
|
438 |
+
}
|
439 |
+
|
440 |
+
/**
|
441 |
+
* Show Feature Pointer
|
442 |
+
*
|
443 |
+
* Display feature pointer
|
444 |
+
*
|
445 |
+
* @since 2.4
|
446 |
+
*/
|
447 |
+
|
448 |
+
function aye_admin_print_footer_scripts() {
|
449 |
+
|
450 |
+
$pointer_content = '<h3>' . __( 'Welcome to Artiss YouTube Embed' ) . '</h3>';
|
451 |
+
$pointer_content .= '<p style="font-style:italic;">' . __( 'Thank you for installing this plugin.' ) . '</p>';
|
452 |
+
$pointer_content .= '<p>' . __( 'These new menu options will allow you to configure your videos to just how you want them and provide links for help and support.' ) . '</p>';
|
453 |
+
$pointer_content .= '<p>' . __( 'Even if you do nothing else, please visit the Profiles option to check your default video values.' ) . '</p>';
|
454 |
+
?>
|
455 |
+
<script>
|
456 |
+
jQuery(function () {
|
457 |
+
var body = jQuery(document.body),
|
458 |
+
menu = jQuery('#toplevel_page_youtube-embed-general'),
|
459 |
+
collapse = jQuery('#collapse-menu'),
|
460 |
+
yembed = menu.find("a[href='admin.php?page=youtube-embed-profiles']"),
|
461 |
+
options = {
|
462 |
+
content: '<?php echo $pointer_content; ?>',
|
463 |
+
position: {
|
464 |
+
edge: 'left',
|
465 |
+
align: 'center',
|
466 |
+
of: menu.is('.wp-menu-open') && !menu.is('.folded *') ? yembed : menu
|
467 |
+
},
|
468 |
+
close: function() {
|
469 |
+
}};
|
470 |
+
|
471 |
+
if ( !yembed.length )
|
472 |
+
return;
|
473 |
+
|
474 |
+
body.pointer(options).pointer('open');
|
475 |
+
});
|
476 |
+
</script>
|
477 |
+
<?php
|
478 |
+
}
|
479 |
+
?>
|
includes/{deprecated.php → aye-deprecated.php}
RENAMED
@@ -4,18 +4,18 @@
|
|
4 |
*
|
5 |
* Various pieces of code, now deprecated, but kept here for backwards compatibility
|
6 |
*
|
7 |
-
* @package
|
8 |
* @since 2.0
|
9 |
*/
|
10 |
|
11 |
// Shortcode for showing playlists - can now use the standard video shortcode
|
12 |
// In fact, this shortcode now simply directs to the video shortcode
|
13 |
-
add_shortcode( 'youtube_playlist', '
|
14 |
|
15 |
// Shortcode for downloading playlist - in fact, this never worked as option doesn't
|
16 |
// allow playlists. None-the-less, now diverts to standard download shortcode
|
17 |
// and will display an appropriate error
|
18 |
-
add_shortcode( 'download_playlist', '
|
19 |
|
20 |
/**
|
21 |
* Embed a playlist
|
@@ -52,7 +52,7 @@ function youtube_playlist_embed( $content, $paras, $style = '' ) {
|
|
52 |
*/
|
53 |
|
54 |
function get_playlist_download( $id = '' ) {
|
55 |
-
echo
|
56 |
return;
|
57 |
}
|
58 |
?>
|
4 |
*
|
5 |
* Various pieces of code, now deprecated, but kept here for backwards compatibility
|
6 |
*
|
7 |
+
* @package Artiss-YouTube-Embed
|
8 |
* @since 2.0
|
9 |
*/
|
10 |
|
11 |
// Shortcode for showing playlists - can now use the standard video shortcode
|
12 |
// In fact, this shortcode now simply directs to the video shortcode
|
13 |
+
add_shortcode( 'youtube_playlist', 'aye_video_shortcode' );
|
14 |
|
15 |
// Shortcode for downloading playlist - in fact, this never worked as option doesn't
|
16 |
// allow playlists. None-the-less, now diverts to standard download shortcode
|
17 |
// and will display an appropriate error
|
18 |
+
add_shortcode( 'download_playlist', 'aye_video_download' );
|
19 |
|
20 |
/**
|
21 |
* Embed a playlist
|
52 |
*/
|
53 |
|
54 |
function get_playlist_download( $id = '' ) {
|
55 |
+
echo aye_error( __( 'This function does not support playlists' ) );
|
56 |
return;
|
57 |
}
|
58 |
?>
|
includes/aye-display-about.php
ADDED
@@ -0,0 +1,51 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* About Page
|
4 |
+
*
|
5 |
+
* About the plugin
|
6 |
+
*
|
7 |
+
* @package Artiss-YouTube-Embed
|
8 |
+
* @since 2.0
|
9 |
+
*/
|
10 |
+
?>
|
11 |
+
<div class="wrap" style="width: 1010px;">
|
12 |
+
<div class="icon32"><img src="<?php echo plugins_url(); ?>/youtube-embed/images/screen_icon.png" alt="" title="" height="32px" width="32px"/><br /></div>
|
13 |
+
|
14 |
+
<h2><?php _e( 'About Artiss YouTube Embed' ); ?></h2>
|
15 |
+
|
16 |
+
<p><?php echo sprintf( __( 'You are using Artiss YouTube Embed version %s. It was written by David Artiss.' ), youtube_embed_version ); ?></p>
|
17 |
+
|
18 |
+
<a href="http://www.youtube.com/"><img src="<?php echo plugins_url(); ?>/youtube-embed/images/poweredby.png" alt="Powered by YouTube" title="Powered by YouTube" align="right" /></a>
|
19 |
+
|
20 |
+
<?php
|
21 |
+
|
22 |
+
echo '<h3>' . __( 'Copyrights' ) . '</h3>';
|
23 |
+
|
24 |
+
echo '<p>' . __( 'YouTube, and all associated logos, is the copyright of Google Inc.' ) . '</p>';
|
25 |
+
|
26 |
+
echo '<p>' . __( 'EmbedPlus is copyright. Read the <a href="http://embedplus.com/terms.aspx" target="_blank">Terms & Conditions of Use</a>.' ) . '</p>';
|
27 |
+
|
28 |
+
echo '<h3>' . __( 'Acknowledgements' ) . '</h3>';
|
29 |
+
|
30 |
+
echo '<p>' . __( 'Images have been compressed with <a href="http://www.smushit.com/ysmush.it/">Smush.it</a>.' ) . '</p>';
|
31 |
+
|
32 |
+
echo '<p>' . __( 'JavaScript has been compressed with <a href="http://javascriptcompressor.com/">JavaScript Compressor</a>.' ) . '</p>';
|
33 |
+
|
34 |
+
echo '<p>' . __( 'YouTube icons are courtesy of <a href="http://www.youtube.com/t/creators_downloads">YouTube</a>. Other icons are by <a href="http://p.yusukekamiyamane.com/">Yusuke Kamiyamane</a>.' ) . '</p>';
|
35 |
+
|
36 |
+
echo '<h3>' . __( 'Support Information' ) . '</h3>';
|
37 |
+
|
38 |
+
echo '<p>' . __( 'Useful support information and links can be found by clicking on the Help tab at the top of each of the Artiss YouTube Embed administration screens.' ) . '</p>';
|
39 |
+
|
40 |
+
echo '<h4>' . __( 'This plugin, and all support, is supplied for free, but <a title="Donate" href="http://artiss.co.uk/donate" target="_blank">donations</a> are always welcome.' ) . '</h4>';
|
41 |
+
|
42 |
+
echo '<h3>' . __( 'Stay in Touch' ) . '</h3>';
|
43 |
+
|
44 |
+
echo '<p>' . __( '<a href="http://www.artiss.co.uk/wp-plugins">See the full list</a> of Artiss plugins, including beta releases.' ) . '</p>';
|
45 |
+
|
46 |
+
echo '<p>' . __( '<a href="http://www.twitter.com/artiss_tech">Follow Artiss.co.uk</a> on Twitter.' ) . '</p>';
|
47 |
+
|
48 |
+
echo '<p>' . __( '<a href="http://www.artiss.co.uk/feed">Subscribe</a> to the Artiss.co.uk news feed.' ) . '</p>';
|
49 |
+
|
50 |
+
?>
|
51 |
+
</div>
|
includes/{display-readme.php → aye-display-readme.php}
RENAMED
@@ -4,21 +4,23 @@
|
|
4 |
*
|
5 |
* Display the README instructions
|
6 |
*
|
7 |
-
* @package
|
8 |
* @since 2.4
|
9 |
*/
|
10 |
?>
|
11 |
-
<div class="wrap">
|
12 |
<div class="icon32" id="icon-edit-pages"></div>
|
13 |
|
14 |
-
|
|
|
|
|
15 |
|
16 |
<?php
|
17 |
if ( !function_exists( 'wp_readme_parser' ) ) {
|
18 |
echo '<p>You shouldn\'t be able to see this but I guess that odd things can happen!<p>';
|
19 |
echo '<p>To display the README you must install the <a href="http://wordpress.org/extend/plugins/wp-readme-parser/">README Parser plugin</a>.</p>';
|
20 |
} else {
|
21 |
-
echo wp_readme_parser( array( 'exclude' => 'meta,upgrade notice,screenshots,support,changelog,links,installation,licence', 'ignore' => 'For help with this plugin,,for more information and advanced options ' ), '
|
22 |
}
|
23 |
?>
|
24 |
</div>
|
4 |
*
|
5 |
* Display the README instructions
|
6 |
*
|
7 |
+
* @package Artiss-YouTube-Embed
|
8 |
* @since 2.4
|
9 |
*/
|
10 |
?>
|
11 |
+
<div class="wrap" style="width: 1010px;">
|
12 |
<div class="icon32" id="icon-edit-pages"></div>
|
13 |
|
14 |
+
<?php $plugin = 'Artiss YouTube Embed'; ?>
|
15 |
+
|
16 |
+
<h2><?php _e( $plugin . ' README' ); ?></h2>
|
17 |
|
18 |
<?php
|
19 |
if ( !function_exists( 'wp_readme_parser' ) ) {
|
20 |
echo '<p>You shouldn\'t be able to see this but I guess that odd things can happen!<p>';
|
21 |
echo '<p>To display the README you must install the <a href="http://wordpress.org/extend/plugins/wp-readme-parser/">README Parser plugin</a>.</p>';
|
22 |
} else {
|
23 |
+
echo wp_readme_parser( array( 'exclude' => 'meta,upgrade notice,screenshots,support,changelog,links,installation,licence', 'ignore' => 'For help with this plugin,,for more information and advanced options ' ), 'http://plugins.svn.wordpress.org/youtube-embed/tags/' . youtube_embed_version . '/readme.txt' );
|
24 |
}
|
25 |
?>
|
26 |
</div>
|
includes/aye-function-calls.php
ADDED
@@ -0,0 +1,229 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Function Calls
|
4 |
+
*
|
5 |
+
* Various function calls that the user may call directly
|
6 |
+
*
|
7 |
+
* @package Artiss-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 aye_get_parameters Extract parameters from input
|
18 |
+
* @uses aye_get_embed_type Work out the correct embed type to use
|
19 |
+
* @uses aye_set_autohide Set correct autohide parameter
|
20 |
+
* @uses aye_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 = aye_get_parameters( $paras, 'width' );
|
29 |
+
$height = aye_get_parameters( $paras, 'height' );
|
30 |
+
$fullscreen = aye_get_parameters( $paras, 'fullscreen' );
|
31 |
+
$related = aye_get_parameters( $paras, 'related' );
|
32 |
+
$autoplay = aye_get_parameters( $paras, 'autoplay' );
|
33 |
+
$loop = aye_get_parameters( $paras, 'loop' );
|
34 |
+
$start = aye_get_parameters( $paras, 'start' );
|
35 |
+
$info = aye_get_parameters( $paras, 'info' );
|
36 |
+
$annotation = aye_get_parameters( $paras, 'annotation' );
|
37 |
+
$cc = aye_get_parameters( $paras, 'cc' );
|
38 |
+
$link = aye_get_parameters( $paras, 'link' );
|
39 |
+
$react = aye_get_parameters( $paras, 'react' );
|
40 |
+
$stop = aye_get_parameters( $paras, 'stop' );
|
41 |
+
$sweetspot = aye_get_parameters( $paras, 'sweetspot' );
|
42 |
+
$embedplus = aye_get_parameters( $paras, 'embedplus' );
|
43 |
+
$disablekb = aye_get_parameters( $paras, 'disablekb' );
|
44 |
+
$ratio = aye_get_parameters( $paras, 'ratio' );
|
45 |
+
$autohide = aye_get_parameters( $paras, 'autohide' );
|
46 |
+
$controls = aye_get_parameters( $paras, 'controls' );
|
47 |
+
$type = aye_get_parameters( $paras, 'type' );
|
48 |
+
$profile = aye_get_parameters( $paras, 'profile' );
|
49 |
+
$list = aye_get_parameters( $paras, 'list' );
|
50 |
+
$audio = aye_get_parameters( $paras, 'audio' );
|
51 |
+
$template = aye_get_parameters( $paras, 'template' );
|
52 |
+
$hd = aye_get_parameters( $paras, 'hd' );
|
53 |
+
$color = aye_get_parameters( $paras, 'color' );
|
54 |
+
$theme = aye_get_parameters( $paras, 'theme' );
|
55 |
+
$https = aye_get_parameters( $paras, 'ssl' );
|
56 |
+
$title = aye_get_parameters( $paras, 'title' );
|
57 |
+
$dynamic = aye_get_parameters( $paras, 'dynamic' );
|
58 |
+
$search = aye_get_parameters( $paras, 'search' );
|
59 |
+
$user = aye_get_parameters( $paras, 'user' );
|
60 |
+
|
61 |
+
// Get Embed type
|
62 |
+
$type = aye_get_embed_type( $type, $embedplus );
|
63 |
+
|
64 |
+
// Set up Autohide parameter
|
65 |
+
$autohide = aye_set_autohide( $autohide );
|
66 |
+
|
67 |
+
echo aye_generate_youtube_code( $content, $type, $width, $height, aye_convert( $fullscreen ), aye_convert( $related ), aye_convert( $autoplay ), aye_convert( $loop ), $start, aye_convert( $info ), aye_convert_3( $annotation ), aye_convert( $cc ), $style, aye_convert( $link ), aye_convert( $react ), $stop, aye_convert( $sweetspot ), aye_convert( $disablekb ), $ratio, $autohide, aye_convert( $controls ), $profile, $list, aye_convert( $audio ), $template, aye_convert( $hd ), $color, $theme, aye_convert( $https ), $title, aye_convert( $dynamic ), aye_convert( $search ), aye_convert( $user ) );
|
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 aye_get_parameters Extract parameters from a string
|
79 |
+
* @uses aye_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 |
+
*/
|
86 |
+
|
87 |
+
function youtube_thumb_embed( $content, $paras = '', $style = '', $alt = '' ) {
|
88 |
+
|
89 |
+
$class = aye_get_parameters( $paras, 'class' );
|
90 |
+
$rel = aye_get_parameters( $paras, 'rel' );
|
91 |
+
$target = aye_get_parameters( $paras, 'target' );
|
92 |
+
$width = aye_get_parameters( $paras, 'width' );
|
93 |
+
$height = aye_get_parameters( $paras, 'height' );
|
94 |
+
$version = aye_get_parameters( $paras, 'version' );
|
95 |
+
|
96 |
+
echo aye_generate_thumbnail_code( $content, $style, $class, $rel, $target, $width, $height, $alt, $version );
|
97 |
+
|
98 |
+
return;
|
99 |
+
}
|
100 |
+
|
101 |
+
/**
|
102 |
+
* Return video short URL
|
103 |
+
*
|
104 |
+
* Return a short URL for the YouTube video
|
105 |
+
*
|
106 |
+
* @since 2.0
|
107 |
+
*
|
108 |
+
* @uses aye_generate_shorturl_code Display an error
|
109 |
+
*
|
110 |
+
* @param string $id YouTube video ID
|
111 |
+
* @return string Download URL
|
112 |
+
*/
|
113 |
+
|
114 |
+
function youtube_short_url( $id ) {
|
115 |
+
return aye_generate_shorturl_code( $id );
|
116 |
+
}
|
117 |
+
|
118 |
+
/**
|
119 |
+
* Get video download URL
|
120 |
+
*
|
121 |
+
* Return a URL for the video so that it can be downloaded
|
122 |
+
*
|
123 |
+
* @since 2.0
|
124 |
+
*
|
125 |
+
* @uses aye_generate_download_code Get the download URL
|
126 |
+
*
|
127 |
+
* @param string $id YouTube video ID
|
128 |
+
* @return string Download URL
|
129 |
+
*/
|
130 |
+
|
131 |
+
function get_video_download( $id ) {
|
132 |
+
return aye_generate_download_code( $id );
|
133 |
+
}
|
134 |
+
|
135 |
+
/**
|
136 |
+
* Get XML transcript
|
137 |
+
*
|
138 |
+
* Return XML formatted YouTube transcript
|
139 |
+
*
|
140 |
+
* @since 2.0
|
141 |
+
*
|
142 |
+
* @uses aye_error Output an error
|
143 |
+
* @uses aye_extract_id Extract a video ID
|
144 |
+
* @uses aye_get_file Get a file
|
145 |
+
* @uses aye_validate_id Check the video ID is valid
|
146 |
+
*
|
147 |
+
* @param string $id YouTube video ID
|
148 |
+
* @return string Transcript file in XML format
|
149 |
+
*/
|
150 |
+
|
151 |
+
function get_youtube_transcript_xml ( $id ) {
|
152 |
+
|
153 |
+
// Extract the ID if a full URL has been specified
|
154 |
+
$id = aye_extract_id( $id );
|
155 |
+
|
156 |
+
// Check what type of video it is and whether it's valid
|
157 |
+
$embed_type = aye_validate_id( $id );
|
158 |
+
if ( $embed_type != 'v' ) {
|
159 |
+
if ( strlen( $embed_type ) > 1 ) {
|
160 |
+
echo aye_error( $embed_type );
|
161 |
+
} else {
|
162 |
+
echo aye_error( sprintf( __( 'The YouTube ID of %s is invalid.' ), $id ) );
|
163 |
+
}
|
164 |
+
return;
|
165 |
+
}
|
166 |
+
|
167 |
+
// Get transcript file
|
168 |
+
$filename = 'http://video.google.com/timedtext?lang=en&v=' . $id;
|
169 |
+
$xml = aye_get_file( $filename );
|
170 |
+
|
171 |
+
// Check success and return appropriate output
|
172 |
+
if ( $xml[ 'rc' ] > 0 ) {
|
173 |
+
echo aye_error( sprintf( __( 'Could not fetch the transcript file %s.' ), $id ) );
|
174 |
+
return;
|
175 |
+
} else {
|
176 |
+
return $xml;
|
177 |
+
}
|
178 |
+
}
|
179 |
+
|
180 |
+
/**
|
181 |
+
* Get transcript
|
182 |
+
*
|
183 |
+
* Return XHTML formatted YouTube transcript
|
184 |
+
*
|
185 |
+
* @since 2.0
|
186 |
+
*
|
187 |
+
* @uses aye_generate_generatE_transcript Generate the transcript output
|
188 |
+
*
|
189 |
+
* @param string $id YouTube video ID
|
190 |
+
* @return string Transcript file in XHTML format
|
191 |
+
*/
|
192 |
+
|
193 |
+
function get_youtube_transcript( $id ) {
|
194 |
+
return aye_generate_transcript( $id );
|
195 |
+
}
|
196 |
+
|
197 |
+
/**
|
198 |
+
* Get Video Name
|
199 |
+
*
|
200 |
+
* Function to return the name of a YouTube video
|
201 |
+
*
|
202 |
+
* @since 2.0
|
203 |
+
*
|
204 |
+
* @uses aye_extract_id Extract the video ID
|
205 |
+
* @uses aye_validate_id Get the name and video type
|
206 |
+
* @uses aye_error Return an error
|
207 |
+
*
|
208 |
+
* @param string $id Video ID
|
209 |
+
* @return string Video name
|
210 |
+
*/
|
211 |
+
|
212 |
+
function get_youtube_name( $id ) {
|
213 |
+
|
214 |
+
// Extract the ID if a full URL has been specified
|
215 |
+
$id = aye_extract_id( $id );
|
216 |
+
|
217 |
+
// Check what type of video it is and whether it's valid
|
218 |
+
$return = aye_validate_id( $id, true );
|
219 |
+
$embed_type = $return[ 'type' ];
|
220 |
+
if ( strlen( $embed_type ) > 1 ) {
|
221 |
+
echo aye_error( $embed_type );
|
222 |
+
} else {
|
223 |
+
echo aye_error( sprintf( __ ( 'The YouTube ID of %s is invalid.' ), $id ) );
|
224 |
+
}
|
225 |
+
|
226 |
+
// Return the video title
|
227 |
+
return $return['title'];
|
228 |
+
}
|
229 |
+
?>
|
includes/aye-generate-download-code.php
ADDED
@@ -0,0 +1,41 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Generate Download Code
|
4 |
+
*
|
5 |
+
* Create code to allow a YouTube video to be downloaded
|
6 |
+
*
|
7 |
+
* @package Artiss-YouTube-Embed
|
8 |
+
* @since 2.0
|
9 |
+
*
|
10 |
+
* @uses aye_extract_id Extract an ID from a string
|
11 |
+
* @uses aye_validate_id Confirm the type of video
|
12 |
+
* @uses aye_error Display an error
|
13 |
+
*
|
14 |
+
* @param string $id YouTube video ID
|
15 |
+
* @param string $target Link target
|
16 |
+
* @param string $nofollow Use rel="nofollow" ?
|
17 |
+
* @param string $text Text to add link to
|
18 |
+
* @return string URL
|
19 |
+
*/
|
20 |
+
|
21 |
+
function aye_generate_download_code( $id ) {
|
22 |
+
|
23 |
+
if ( $id == '' ) { return aye_error( __ ( 'No YouTube ID was found.' ) ); }
|
24 |
+
|
25 |
+
// Extract the ID if a full URL has been specified
|
26 |
+
$id = aye_extract_id( $id );
|
27 |
+
|
28 |
+
// Check what type of video it is and whether it's valid
|
29 |
+
$embed_type = aye_validate_id( $id );
|
30 |
+
if ( $embed_type != 'v' ) {
|
31 |
+
if ( strlen( $embed_type ) > 1 ) {
|
32 |
+
return aye_error( $embed_type );
|
33 |
+
} else {
|
34 |
+
return aye_error( sprintf( __( 'The YouTube ID of %s is invalid.' ), $id ) );
|
35 |
+
}
|
36 |
+
}
|
37 |
+
|
38 |
+
// Create the link
|
39 |
+
return 'http://deturl.com/www.youtube.com/watch?' . $embed_type . '=' . $id;
|
40 |
+
}
|
41 |
+
?>
|
includes/{generate-embed-code.php → aye-generate-embed-code.php}
RENAMED
@@ -4,7 +4,7 @@
|
|
4 |
*
|
5 |
* Functions calls to generate the required YouTube code
|
6 |
*
|
7 |
-
* @package
|
8 |
*/
|
9 |
|
10 |
/**
|
@@ -14,14 +14,13 @@
|
|
14 |
*
|
15 |
* @since 2.0
|
16 |
*
|
17 |
-
* @uses
|
18 |
-
* @uses
|
19 |
-
* @uses
|
20 |
-
* @uses
|
21 |
-
* @uses
|
22 |
-
* @uses
|
23 |
-
* @uses
|
24 |
-
* @uses ye_set_profile_defaults Set default profile options
|
25 |
*
|
26 |
* @param string $id Video ID
|
27 |
* @param string $type Embed type
|
@@ -53,105 +52,114 @@
|
|
53 |
* @param string $theme Use dark or light theme
|
54 |
* @param string $https Use HTTPS for links
|
55 |
* @param string $title Video title
|
|
|
|
|
|
|
56 |
* @return string Code output
|
57 |
*/
|
58 |
|
59 |
-
function
|
60 |
|
61 |
// Ensure an ID is passed
|
62 |
|
63 |
-
if ( $id == '' ) { return
|
64 |
|
65 |
// Get general options
|
66 |
|
67 |
-
$general =
|
68 |
|
69 |
-
|
70 |
|
71 |
-
|
72 |
|
73 |
-
|
74 |
|
75 |
-
|
76 |
|
77 |
-
|
|
|
78 |
|
79 |
-
|
80 |
-
$list = ye_validate_list( $id, $general[ 'list_no' ] );
|
81 |
-
if ( !is_array( $list ) ) {
|
82 |
|
83 |
-
|
84 |
|
85 |
-
|
86 |
-
|
|
|
87 |
|
88 |
-
|
89 |
|
90 |
-
|
|
|
91 |
|
92 |
-
|
93 |
|
94 |
-
|
95 |
-
delete_transient( 'ye_type_' . $id );
|
96 |
-
delete_transient( 'ye_title_' . $id );
|
97 |
-
}
|
98 |
|
99 |
-
|
100 |
|
101 |
-
|
102 |
-
|
103 |
-
|
|
|
104 |
|
105 |
-
|
106 |
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
} else {
|
111 |
-
$error = $embed_type;
|
112 |
-
}
|
113 |
-
$result = "\n<!-- YouTube Embed v" . youtube_embed_version . " | http://www.artiss.co.uk/artiss-youtube-embed -->\n";
|
114 |
-
$result .= "<!-- " . $error . " -->\n" . ye_decode( $general[ 'error_message' ] ) . "\n<!-- End of YouTube Embed code -->\n";
|
115 |
-
return $result;
|
116 |
-
}
|
117 |
|
118 |
-
|
119 |
|
120 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
121 |
|
122 |
-
|
123 |
|
124 |
-
|
125 |
|
126 |
-
|
127 |
|
128 |
-
|
129 |
-
$id = $list[ array_rand( $list, 1 ) ];
|
130 |
|
131 |
-
|
132 |
|
133 |
-
|
|
|
134 |
|
135 |
-
|
136 |
-
$title = '';
|
137 |
|
138 |
-
|
139 |
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
151 |
|
152 |
// Generate a cache key for the above passed parameters
|
153 |
|
154 |
-
$cache_key = '
|
155 |
|
156 |
// Try and get the output from cache. If it exists, return the code
|
157 |
|
@@ -176,7 +184,7 @@ function ye_generate_youtube_code( $id = '', $type = '', $width = '', $height =
|
|
176 |
} else {
|
177 |
$youtube_url = 'http' . $https . '://www.youtube.com/watch?' . $embed_type . '=' . $id;
|
178 |
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>\n"; }
|
179 |
-
if ( ( $general ['feed'] != 'v' ) or ( $embed_type != 'v' ) ) { $result .= '<p><a href="' . $youtube_url . '">' . __( 'Click here
|
180 |
}
|
181 |
return $result;
|
182 |
}
|
@@ -222,9 +230,11 @@ function ye_generate_youtube_code( $id = '', $type = '', $width = '', $height =
|
|
222 |
|
223 |
$wmode = $options[ 'wmode' ];
|
224 |
|
|
|
|
|
225 |
// Build the required template
|
226 |
|
227 |
-
if ( $template == '' ) { $template = $options[ 'template' ]; } else { $template =
|
228 |
if ( strpos( $template, '%video%' ) === false ) { $template = '%video%'; }
|
229 |
|
230 |
// If a multi-play list has been specified and EmbedPlus selected, use fallback embedding method instead
|
@@ -246,6 +256,10 @@ function ye_generate_youtube_code( $id = '', $type = '', $width = '', $height =
|
|
246 |
}
|
247 |
}
|
248 |
|
|
|
|
|
|
|
|
|
249 |
// Set parameters without default values
|
250 |
|
251 |
if ( $start == '' ) { $start = '0'; }
|
@@ -277,6 +291,10 @@ function ye_generate_youtube_code( $id = '', $type = '', $width = '', $height =
|
|
277 |
if ( $height == '' ) { $height = round( $width / $ratio_to_use, 0); }
|
278 |
}
|
279 |
|
|
|
|
|
|
|
|
|
280 |
// If audio playback option is set, restrict the height to just show the player toolbar
|
281 |
|
282 |
if ( $audio == '1' ) { $height = 27; }
|
@@ -285,21 +303,23 @@ function ye_generate_youtube_code( $id = '', $type = '', $width = '', $height =
|
|
285 |
|
286 |
$tab = '';
|
287 |
$class = 'youtube-player';
|
288 |
-
$paras = '
|
289 |
|
290 |
$embedplus = false;
|
291 |
$swf = false;
|
292 |
$iframe = false;
|
293 |
$chromeless = false;
|
294 |
|
|
|
|
|
295 |
if ( $type != 'v' ) {
|
296 |
$paras .= '&modestbranding=1';
|
297 |
if ( $type == 'm' ) {
|
298 |
-
|
299 |
-
|
300 |
-
|
301 |
-
|
302 |
-
|
303 |
} else {
|
304 |
if ( $type == "c" ) {
|
305 |
$chromeless = true;
|
@@ -307,6 +327,7 @@ function ye_generate_youtube_code( $id = '', $type = '', $width = '', $height =
|
|
307 |
$swf = true;
|
308 |
}
|
309 |
}
|
|
|
310 |
} else {
|
311 |
$iframe = true;
|
312 |
}
|
@@ -341,7 +362,7 @@ function ye_generate_youtube_code( $id = '', $type = '', $width = '', $height =
|
|
341 |
// Add start & stop parameters
|
342 |
|
343 |
if ( $start != 0 ) { $paras .= '&start=' . $start; $paras_ep .= '&start=' . $start; }
|
344 |
-
if ( $stop != 0 ) { $paras_ep .= '&stop=' . $stop; }
|
345 |
|
346 |
// Generate DIVs to wrap around video
|
347 |
|
@@ -362,7 +383,7 @@ function ye_generate_youtube_code( $id = '', $type = '', $width = '', $height =
|
|
362 |
$result .= "\t<param name=\"flashvars\" value=\"ytid=" . $id . $paras_ep . "\" />\n";
|
363 |
}
|
364 |
|
365 |
-
//
|
366 |
|
367 |
$privacy = $general[ 'privacy' ];
|
368 |
if ( $privacy == 1 ) {
|
@@ -371,22 +392,54 @@ function ye_generate_youtube_code( $id = '', $type = '', $width = '', $height =
|
|
371 |
$url_privacy = 'youtube.com';
|
372 |
}
|
373 |
|
374 |
-
|
375 |
-
|
376 |
-
if ( ( $swf ) or ( $chromeless ) or ( ( $embedplus ) && ( ( $fallback == 'o' ) or ( $fallback == 'p' ) ) ) ) {
|
377 |
|
378 |
-
|
379 |
-
|
|
|
|
|
|
|
|
|
|
|
380 |
} else {
|
381 |
-
$
|
382 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
383 |
|
384 |
-
$result .= $tab . "<object class=\"" . $class . "\" type=\"application/x-shockwave-flash\" data=\"" . $
|
385 |
|
386 |
if ( $metadata != 0 ) { $result .= " rel=\"media:video\" resource=\"http" . $https . "://www.youtube.com/" . $embed_type . "/" . $id ."\" xmlns:media=\"http://search.yahoo.com/searchmonkey/media/\""; }
|
387 |
$result .= " >\n";
|
388 |
if ( $metadata != 0 ) { $result .= $tab . "\t<a rel=\"media:thumbnail\" href=\"http://img.youtube.com/vi/" . $id . "/default.jpg\" />\n"; }
|
389 |
-
$result .= $tab . "\t<param name=\"movie\" value=\"
|
390 |
$result .= $tab . "\t<param name=\"wmode\" value=\"" . $wmode . "\" />\n";
|
391 |
if ( $fullscreen == 1 ) { $result .= $tab . "\t<param name=\"allowFullScreen\" value=\"true\" />\n"; }
|
392 |
if ( ( $link != 1 ) && ( $link != '' ) ) { $result .= $tab . "\t<param name=\"allowNetworking\" value=\"internal\" />\n"; }
|
@@ -398,7 +451,7 @@ function ye_generate_youtube_code( $id = '', $type = '', $width = '', $height =
|
|
398 |
|
399 |
if ( ( $iframe ) or ( ( $embedplus ) && ( $fallback == "v" ) ) ) {
|
400 |
if ( $embed_type == "p" ) { $playlist_para = "p/"; } else { $playlist_para = ''; }
|
401 |
-
$result .= $tab . '<iframe frameborder
|
402 |
if ( $fullscreen == 1 ) { $result .= ' allowfullscreen="allowfullscreen"'; }
|
403 |
$result .= " ></iframe>\n";
|
404 |
}
|
@@ -440,7 +493,7 @@ function ye_generate_youtube_code( $id = '', $type = '', $width = '', $height =
|
|
440 |
* @return string The profile number (defaults to 0)
|
441 |
*/
|
442 |
|
443 |
-
function
|
444 |
|
445 |
$profile = 0;
|
446 |
$name = strtolower( $name );
|
@@ -476,7 +529,7 @@ function ye_validate_profile( $name, $number ) {
|
|
476 |
* @return string The list (defaults to blank)
|
477 |
*/
|
478 |
|
479 |
-
function
|
480 |
|
481 |
$list = '';
|
482 |
|
@@ -524,7 +577,7 @@ function ye_validate_list( $name, $number ) {
|
|
524 |
* @return string The parameter value
|
525 |
*/
|
526 |
|
527 |
-
function
|
528 |
|
529 |
// Look for an ampersand
|
530 |
|
@@ -557,12 +610,12 @@ function ye_get_url_para( $id, $para, $current ) {
|
|
557 |
* @return string The decoded string
|
558 |
*/
|
559 |
|
560 |
-
function
|
561 |
|
562 |
$find = array( '&', '"', ''', '<', '>' );
|
563 |
$replace = array( '&', '"', "'", '<', '>' );
|
564 |
|
565 |
-
$decoded = str_replace($find
|
566 |
|
567 |
return $decoded;
|
568 |
}
|
4 |
*
|
5 |
* Functions calls to generate the required YouTube code
|
6 |
*
|
7 |
+
* @package Artiss-YouTube-Embed
|
8 |
*/
|
9 |
|
10 |
/**
|
14 |
*
|
15 |
* @since 2.0
|
16 |
*
|
17 |
+
* @uses aye_error Display an error
|
18 |
+
* @uses aye_extract_id Get the video ID
|
19 |
+
* @uses aye_validate_list Get the requested listr
|
20 |
+
* @uses aye_validate_id Validate the video ID
|
21 |
+
* @uses aye_validate_profile Get the requested profile
|
22 |
+
* @uses aye_set_general_defaults Get general options
|
23 |
+
* @uses aye_set_profile_defaults Set default profile options
|
|
|
24 |
*
|
25 |
* @param string $id Video ID
|
26 |
* @param string $type Embed type
|
52 |
* @param string $theme Use dark or light theme
|
53 |
* @param string $https Use HTTPS for links
|
54 |
* @param string $title Video title
|
55 |
+
* @param string $dynamic Show dynamic output
|
56 |
+
* @param string $search Perform a search
|
57 |
+
* @param string $user Look up user videos
|
58 |
* @return string Code output
|
59 |
*/
|
60 |
|
61 |
+
function aye_generate_youtube_code( $id = '', $type = '', $width = '', $height = '', $fullscreen = '', $related = '', $autoplay = '', $loop = '', $start = '', $info = '', $annotation = '', $cc = '', $style = '', $link = '', $react = '', $stop = '', $sweetspot = '', $disablekb = '', $ratio = '', $autohide = '', $controls = '', $profile = '', $list_style = '', $audio = '', $template = '', $hd = '', $color = '', $theme = '', $https = '', $title = '', $dynamic = '', $search = '', $user = '' ) {
|
62 |
|
63 |
// Ensure an ID is passed
|
64 |
|
65 |
+
if ( $id == '' ) { return aye_error( __( 'No video/playlist ID has been supplied' ) ); }
|
66 |
|
67 |
// Get general options
|
68 |
|
69 |
+
$general = aye_set_general_defaults();
|
70 |
|
71 |
+
// Find the profile, if one is specified
|
72 |
|
73 |
+
$profile = aye_validate_profile( $profile, $general[ 'profile_no' ] );
|
74 |
|
75 |
+
// Get default values if no values are supplied
|
76 |
|
77 |
+
$options = aye_set_profile_defaults( $profile );
|
78 |
|
79 |
+
// If a user look-up or search has been requested, mis-out looking up list details and
|
80 |
+
// simple assign it as an IFRAME video
|
81 |
|
82 |
+
if ( ( $user == 0 ) && ( $search == 0 ) ) {
|
|
|
|
|
83 |
|
84 |
+
// Check it's not a list
|
85 |
|
86 |
+
$playlist_ids = '';
|
87 |
+
$list = aye_validate_list( $id, $general[ 'list_no' ] );
|
88 |
+
if ( !is_array( $list ) ) {
|
89 |
|
90 |
+
// Check if certain parameters are included in the URL
|
91 |
|
92 |
+
$width = aye_get_url_para( $id, 'w', $width );
|
93 |
+
$height = aye_get_url_para( $id, 'h', $height );
|
94 |
|
95 |
+
// Extract the ID if a full URL has been specified
|
96 |
|
97 |
+
$id = aye_extract_id( $id );
|
|
|
|
|
|
|
98 |
|
99 |
+
// Is it being previewed? In which case remove any cache
|
100 |
|
101 |
+
if ( ( preg_match( '/p=([0-9]*)&preview=true/', $_SERVER['QUERY_STRING'] ) == 1 ) && ( $general[ 'preview' ] == 1 ) ) {
|
102 |
+
delete_transient( 'aye_type_' . $id );
|
103 |
+
delete_transient( 'aye_title_' . $id );
|
104 |
+
}
|
105 |
|
106 |
+
// Check what type of video it is and whether it's valid
|
107 |
|
108 |
+
$return = aye_validate_id( $id, true );
|
109 |
+
$title = $return['title'];
|
110 |
+
$embed_type = $return[ 'type' ];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
111 |
|
112 |
+
// If the video is invalid, output an appropriate error
|
113 |
|
114 |
+
if ( ( $embed_type == '' ) or ( strlen ( $embed_type ) != 1 ) ) {
|
115 |
+
if ( $embed_type == '' ) {
|
116 |
+
$error = 'The YouTube ID of ' . $id . ' is invalid.';
|
117 |
+
} else {
|
118 |
+
$error = $embed_type;
|
119 |
+
}
|
120 |
+
$result = "\n<!-- YouTube Embed v" . youtube_embed_version . " | http://www.artiss.co.uk/artiss-youtube-embed -->\n";
|
121 |
+
$result .= "<!-- " . $error . " -->\n" . aye_decode( $general[ 'error_message' ] ) . "\n<!-- End of YouTube Embed code -->\n";
|
122 |
+
return $result;
|
123 |
+
}
|
124 |
|
125 |
+
} else {
|
126 |
|
127 |
+
$embed_type = 'v';
|
128 |
|
129 |
+
// Randomize the video
|
130 |
|
131 |
+
if ( $list_style == 'random' ) { shuffle( $list ); }
|
|
|
132 |
|
133 |
+
// Extract one video randomly
|
134 |
|
135 |
+
if ( $list_style == 'single' ) {
|
136 |
+
$id = $list[ array_rand( $list, 1 ) ];
|
137 |
|
138 |
+
// Build the playlist
|
|
|
139 |
|
140 |
+
} else {
|
141 |
|
142 |
+
$id = $list [ 0 ];
|
143 |
+
$title = '';
|
144 |
+
|
145 |
+
// Build the playlist
|
146 |
+
|
147 |
+
if ( count( $list ) > 1 ) {
|
148 |
+
$loop = 1;
|
149 |
+
while ( $loop < count( $list ) ) {
|
150 |
+
if ( $playlist_ids != '' ) { $playlist_ids .= ','; }
|
151 |
+
$list_id = aye_extract_id( $list[ $loop ] );
|
152 |
+
$playlist_ids .= $list_id;
|
153 |
+
$loop ++;
|
154 |
+
}
|
155 |
+
}
|
156 |
+
}
|
157 |
+
}
|
158 |
+
}
|
159 |
|
160 |
// Generate a cache key for the above passed parameters
|
161 |
|
162 |
+
$cache_key = 'aye_video_' . base64_encode( sha1( $id . $type . $width . $height . $fullscreen . $related . $autoplay . $loop . $start . $info . $annotation . $cc . $style . $link . $react . $stop . $sweetspot . $disablekb . $ratio . $autohide . $controls . $profile . $list_style . $audio . $template . $hd . $color . $theme . $https . $dynamic . $search . $user . $title . print_r( $general, true ) . print_r( $options, true ) . print_r( $list, true ) ) );
|
163 |
|
164 |
// Try and get the output from cache. If it exists, return the code
|
165 |
|
184 |
} else {
|
185 |
$youtube_url = 'http' . $https . '://www.youtube.com/watch?' . $embed_type . '=' . $id;
|
186 |
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>\n"; }
|
187 |
+
if ( ( $general ['feed'] != 'v' ) or ( $embed_type != 'v' ) ) { $result .= '<p><a href="' . $youtube_url . '">' . __( 'Click here to view the video on YouTube' ) . "</a>.</p>\n"; }
|
188 |
}
|
189 |
return $result;
|
190 |
}
|
230 |
|
231 |
$wmode = $options[ 'wmode' ];
|
232 |
|
233 |
+
if ( $theme == '' ) { $theme = $options[ 'theme' ]; }
|
234 |
+
|
235 |
// Build the required template
|
236 |
|
237 |
+
if ( $template == '' ) { $template = $options[ 'template' ]; } else { $template = aye_decode( $template ); }
|
238 |
if ( strpos( $template, '%video%' ) === false ) { $template = '%video%'; }
|
239 |
|
240 |
// If a multi-play list has been specified and EmbedPlus selected, use fallback embedding method instead
|
256 |
}
|
257 |
}
|
258 |
|
259 |
+
// If a playlist, user or search was specified and this is is Chromeless, switch back to IFRAME to allow
|
260 |
+
|
261 |
+
if ( ( ( $embed_type == 'p' ) or ( $user != 0 ) or ( $search != 0 ) ) && ( $type == 'c' ) ) { $type = 'v'; }
|
262 |
+
|
263 |
// Set parameters without default values
|
264 |
|
265 |
if ( $start == '' ) { $start = '0'; }
|
291 |
if ( $height == '' ) { $height = round( $width / $ratio_to_use, 0); }
|
292 |
}
|
293 |
|
294 |
+
// Set Frameborder output
|
295 |
+
|
296 |
+
if ( isset( $general[ 'frameborder' ] ) ) { if ( $general[ 'frameborder' ] == 1 ) { $frameborder = 'frameborder="0" '; } else { $frameborder = ''; } }
|
297 |
+
|
298 |
// If audio playback option is set, restrict the height to just show the player toolbar
|
299 |
|
300 |
if ( $audio == '1' ) { $height = 27; }
|
303 |
|
304 |
$tab = '';
|
305 |
$class = 'youtube-player';
|
306 |
+
$paras = '';
|
307 |
|
308 |
$embedplus = false;
|
309 |
$swf = false;
|
310 |
$iframe = false;
|
311 |
$chromeless = false;
|
312 |
|
313 |
+
if ( ( $type == 'm' ) && ( ( $user != 0 ) or ( $search != 0 ) ) ) { $type = $options[ 'fallback' ]; }
|
314 |
+
|
315 |
if ( $type != 'v' ) {
|
316 |
$paras .= '&modestbranding=1';
|
317 |
if ( $type == 'm' ) {
|
318 |
+
$embedplus = true;
|
319 |
+
$tab = "\t";
|
320 |
+
$embedheight = $height + 32;
|
321 |
+
$class = 'cantembedplus';
|
322 |
+
$fallback = $options[ 'fallback' ];
|
323 |
} else {
|
324 |
if ( $type == "c" ) {
|
325 |
$chromeless = true;
|
327 |
$swf = true;
|
328 |
}
|
329 |
}
|
330 |
+
$paras .= '&version=3';
|
331 |
} else {
|
332 |
$iframe = true;
|
333 |
}
|
362 |
// Add start & stop parameters
|
363 |
|
364 |
if ( $start != 0 ) { $paras .= '&start=' . $start; $paras_ep .= '&start=' . $start; }
|
365 |
+
if ( $stop != 0 ) { $paras_ep .= '&stop=' . $stop; $paras .= '&end=' . $stop; }
|
366 |
|
367 |
// Generate DIVs to wrap around video
|
368 |
|
383 |
$result .= "\t<param name=\"flashvars\" value=\"ytid=" . $id . $paras_ep . "\" />\n";
|
384 |
}
|
385 |
|
386 |
+
// Work out, depending on privacy settings, the main address to use
|
387 |
|
388 |
$privacy = $general[ 'privacy' ];
|
389 |
if ( $privacy == 1 ) {
|
392 |
$url_privacy = 'youtube.com';
|
393 |
}
|
394 |
|
395 |
+
// Generate the first part of the embed URL along with the ID section
|
|
|
|
|
396 |
|
397 |
+
if ( $chromeless ) {
|
398 |
+
$embed_url = 'http' . $https . '://www.youtube.com/apiplayer';
|
399 |
+
$id_paras = '?video_id=' . $id;
|
400 |
+
} else {
|
401 |
+
$embed_url = 'http' . $https . '://www.' . $url_privacy . '/';
|
402 |
+
if ( $type == 'v' ) {
|
403 |
+
$embed_url .= 'embed';
|
404 |
} else {
|
405 |
+
$embed_url .= 'v/';
|
406 |
}
|
407 |
+
$id_paras = $id;
|
408 |
+
if ( $type == 'v' ) { $id_paras = '/' . $id_paras; }
|
409 |
+
}
|
410 |
+
|
411 |
+
// If a playlist, user or download build the ID appropriately
|
412 |
+
|
413 |
+
if ( ( $embed_type == 'p' ) or ( $user != 0 ) or ( $search != 0 ) ) {
|
414 |
+
|
415 |
+
$list_type = '';
|
416 |
+
if ( $embed_type == 'p' ) { $list_type = 'playlist'; }
|
417 |
+
if ( $user != 0 ) { $list_type = 'user_uploads'; }
|
418 |
+
if ( $search != 0 ) { $list_type = 'search'; $id = urlencode( $id ); }
|
419 |
+
|
420 |
+
$id_paras = '';
|
421 |
+
if ( $type == 'p' ) { $id_paras .= 'videoseries'; }
|
422 |
+
$id_paras .= '?listType=' . $list_type . '&list=';
|
423 |
+
if ( ( $embed_type == 'p' ) && ( strtolower( substr ( $id, 0, 2 ) ) != 'pl' ) ) { $id_paras .= 'PL'; }
|
424 |
+
$id_paras .= $id;
|
425 |
+
}
|
426 |
+
|
427 |
+
// Combine URL parts together
|
428 |
+
|
429 |
+
$embed_url .= $id_paras;
|
430 |
+
if ( ( !strpos( $embed_url, '?' ) ) && ( substr( $paras, 0, 5 ) == '&' ) ) { $paras = '?' . substr( $paras, 5 ); }
|
431 |
+
$embed_url .= $paras;
|
432 |
+
|
433 |
+
// Add AS3 YouTube embed code
|
434 |
+
|
435 |
+
if ( ( $swf ) or ( $chromeless ) or ( ( $embedplus ) && ( ( $fallback == 'o' ) or ( $fallback == 'p' ) ) ) ) {
|
436 |
|
437 |
+
$result .= $tab . "<object class=\"" . $class . "\" type=\"application/x-shockwave-flash\" data=\"" . $embed_url . "\" width=\"" . $width . "\" height=\"" . $height . "\" style=\"" . $style . "\"";
|
438 |
|
439 |
if ( $metadata != 0 ) { $result .= " rel=\"media:video\" resource=\"http" . $https . "://www.youtube.com/" . $embed_type . "/" . $id ."\" xmlns:media=\"http://search.yahoo.com/searchmonkey/media/\""; }
|
440 |
$result .= " >\n";
|
441 |
if ( $metadata != 0 ) { $result .= $tab . "\t<a rel=\"media:thumbnail\" href=\"http://img.youtube.com/vi/" . $id . "/default.jpg\" />\n"; }
|
442 |
+
$result .= $tab . "\t<param name=\"movie\" value=\"" . $embed_url . "\" />\n";
|
443 |
$result .= $tab . "\t<param name=\"wmode\" value=\"" . $wmode . "\" />\n";
|
444 |
if ( $fullscreen == 1 ) { $result .= $tab . "\t<param name=\"allowFullScreen\" value=\"true\" />\n"; }
|
445 |
if ( ( $link != 1 ) && ( $link != '' ) ) { $result .= $tab . "\t<param name=\"allowNetworking\" value=\"internal\" />\n"; }
|
451 |
|
452 |
if ( ( $iframe ) or ( ( $embedplus ) && ( $fallback == "v" ) ) ) {
|
453 |
if ( $embed_type == "p" ) { $playlist_para = "p/"; } else { $playlist_para = ''; }
|
454 |
+
$result .= $tab . '<iframe ' . $frameborder . 'style="border: 0;' . $style . '" class="' . $class . '" width="' . $width . '" height="' . $height . '" src="' . $embed_url . '&wmode=' . $wmode . '"';
|
455 |
if ( $fullscreen == 1 ) { $result .= ' allowfullscreen="allowfullscreen"'; }
|
456 |
$result .= " ></iframe>\n";
|
457 |
}
|
493 |
* @return string The profile number (defaults to 0)
|
494 |
*/
|
495 |
|
496 |
+
function aye_validate_profile( $name, $number ) {
|
497 |
|
498 |
$profile = 0;
|
499 |
$name = strtolower( $name );
|
529 |
* @return string The list (defaults to blank)
|
530 |
*/
|
531 |
|
532 |
+
function aye_validate_list( $name, $number ) {
|
533 |
|
534 |
$list = '';
|
535 |
|
577 |
* @return string The parameter value
|
578 |
*/
|
579 |
|
580 |
+
function aye_get_url_para( $id, $para, $current ) {
|
581 |
|
582 |
// Look for an ampersand
|
583 |
|
610 |
* @return string The decoded string
|
611 |
*/
|
612 |
|
613 |
+
function aye_decode( $encoded ) {
|
614 |
|
615 |
$find = array( '&', '"', ''', '<', '>' );
|
616 |
$replace = array( '&', '"', "'", '<', '>' );
|
617 |
|
618 |
+
$decoded = str_replace( $find, $replace, $encoded );
|
619 |
|
620 |
return $decoded;
|
621 |
}
|
includes/aye-generate-shorturl-code.php
ADDED
@@ -0,0 +1,41 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Generate video short URL
|
4 |
+
*
|
5 |
+
* Create a short URL to a YouTube video
|
6 |
+
*
|
7 |
+
* @package Artiss-YouTube-Embed
|
8 |
+
* @since 2.0
|
9 |
+
*
|
10 |
+
* @uses aye_extract_id Extract an ID from a string
|
11 |
+
* @uses aye_validate_id Confirm the type of video
|
12 |
+
* @uses aye_error Display an error
|
13 |
+
*
|
14 |
+
* @param string $id YouTube video ID
|
15 |
+
* @return string $youtube_code Code
|
16 |
+
*/
|
17 |
+
|
18 |
+
function aye_generate_shorturl_code( $id ) {
|
19 |
+
|
20 |
+
// Check that an ID has been specified
|
21 |
+
if ( $id == '' ) {
|
22 |
+
return aye_error( __( 'No video ID has been supplied' ) );
|
23 |
+
} else {
|
24 |
+
|
25 |
+
// Extract the ID if a full URL has been specified
|
26 |
+
$id = aye_extract_id( $id );
|
27 |
+
|
28 |
+
// Check what type of video it is and whether it's valid
|
29 |
+
$embed_type = aye_validate_id( $id );
|
30 |
+
if ( $embed_type != 'v' ) {
|
31 |
+
if ( strlen( $embed_type ) > 1 ) {
|
32 |
+
return aye_error( $embed_type );
|
33 |
+
} else {
|
34 |
+
return aye_error( sprintf( __( 'The YouTube ID of %s is invalid.' ), $id ) );
|
35 |
+
}
|
36 |
+
}
|
37 |
+
|
38 |
+
return 'http://youtu.be/' . $id;
|
39 |
+
}
|
40 |
+
}
|
41 |
+
?>
|
includes/{generate-thumbnail-code.php → aye-generate-thumbnail-code.php}
RENAMED
@@ -4,12 +4,12 @@
|
|
4 |
*
|
5 |
* Generate XHTML compatible YouTube video thumbnail
|
6 |
*
|
7 |
-
* @package
|
8 |
* @since 2.0
|
9 |
*
|
10 |
-
* @uses
|
11 |
-
* @uses
|
12 |
-
* @uses
|
13 |
*
|
14 |
* @param string $id YouTube video ID
|
15 |
* @param string $style Link STYLE
|
@@ -22,19 +22,19 @@
|
|
22 |
* @return string $youtube_code Code
|
23 |
*/
|
24 |
|
25 |
-
function
|
26 |
|
27 |
// Extract the ID if a full URL has been specified
|
28 |
-
$id =
|
29 |
|
30 |
// Check what type of video it is and whether it's valid
|
31 |
-
$embed_type =
|
32 |
|
33 |
if ( $embed_type != 'v' ) {
|
34 |
if ( strlen( $embed_type ) > 1 ) {
|
35 |
-
return
|
36 |
} else {
|
37 |
-
return
|
38 |
}
|
39 |
}
|
40 |
|
4 |
*
|
5 |
* Generate XHTML compatible YouTube video thumbnail
|
6 |
*
|
7 |
+
* @package Artiss-YouTube-Embed
|
8 |
* @since 2.0
|
9 |
*
|
10 |
+
* @uses aye_extract_id Extract an ID from a string
|
11 |
+
* @uses aye_validate_id Confirm the type of video
|
12 |
+
* @uses aye_error Display an error
|
13 |
*
|
14 |
* @param string $id YouTube video ID
|
15 |
* @param string $style Link STYLE
|
22 |
* @return string $youtube_code Code
|
23 |
*/
|
24 |
|
25 |
+
function aye_generate_thumbnail_code( $id, $style, $class, $rel, $target, $width, $height, $alt, $version ) {
|
26 |
|
27 |
// Extract the ID if a full URL has been specified
|
28 |
+
$id = aye_extract_id( $id );
|
29 |
|
30 |
// Check what type of video it is and whether it's valid
|
31 |
+
$embed_type = aye_validate_id( $id );
|
32 |
|
33 |
if ( $embed_type != 'v' ) {
|
34 |
if ( strlen( $embed_type ) > 1 ) {
|
35 |
+
return aye_error( $embed_type );
|
36 |
} else {
|
37 |
+
return aye_error( sprintf( __( 'The YouTube ID of %s is invalid.' ), $id ) );
|
38 |
}
|
39 |
}
|
40 |
|
includes/{generate-transcript-code.php → aye-generate-transcript-code.php}
RENAMED
@@ -4,7 +4,7 @@
|
|
4 |
*
|
5 |
* All functions relating to creating YouTube transcripts
|
6 |
*
|
7 |
-
* @package
|
8 |
* @since 2.0
|
9 |
*/
|
10 |
|
@@ -15,39 +15,42 @@
|
|
15 |
*
|
16 |
* @since 2.0
|
17 |
*
|
18 |
-
* @uses
|
|
|
|
|
|
|
19 |
*
|
20 |
-
* @param string $id
|
21 |
-
* @return string $output
|
22 |
*/
|
23 |
|
24 |
-
function
|
25 |
|
26 |
// Extract the ID if a full URL has been specified
|
27 |
-
$id =
|
28 |
|
29 |
// Check what type of video it is and whether it's valid
|
30 |
-
$embed_type =
|
31 |
if ( $embed_type != 'v' ) {
|
32 |
if ( strlen( $embed_type ) > 1 ) {
|
33 |
-
return
|
34 |
} else {
|
35 |
-
return
|
36 |
}
|
37 |
}
|
38 |
|
39 |
// Get general options
|
40 |
-
$general =
|
41 |
|
42 |
// Check to see if cache is available
|
43 |
if ( $general[ 'transcript_cache' ] != 0 ) {
|
44 |
-
$cache_key = '
|
45 |
$output = get_transient( $cache_key );
|
46 |
if ( $output !== false) { return $output; }
|
47 |
}
|
48 |
|
49 |
// Get transcript file
|
50 |
-
$return =
|
51 |
$xml = $return[ 'file' ];
|
52 |
$output = '';
|
53 |
|
4 |
*
|
5 |
* All functions relating to creating YouTube transcripts
|
6 |
*
|
7 |
+
* @package Artiss-YouTube-Embed
|
8 |
* @since 2.0
|
9 |
*/
|
10 |
|
15 |
*
|
16 |
* @since 2.0
|
17 |
*
|
18 |
+
* @uses aye_extract_id Extract the ID
|
19 |
+
* @uses aye_get_file Get a file
|
20 |
+
* @uses aye_set_general_defaults Set default options
|
21 |
+
* @uses aye_validate_id Validate the ID
|
22 |
*
|
23 |
+
* @param string $id Video ID
|
24 |
+
* @return string $output Transcript output
|
25 |
*/
|
26 |
|
27 |
+
function aye_generate_transcript( $id ) {
|
28 |
|
29 |
// Extract the ID if a full URL has been specified
|
30 |
+
$id = aye_extract_id( $id );
|
31 |
|
32 |
// Check what type of video it is and whether it's valid
|
33 |
+
$embed_type = aye_validate_id( $id );
|
34 |
if ( $embed_type != 'v' ) {
|
35 |
if ( strlen( $embed_type ) > 1 ) {
|
36 |
+
return aye_error( $embed_type );
|
37 |
} else {
|
38 |
+
return aye_error( sprintf( __( 'The YouTube ID of %s is invalid.' ), $id ) );
|
39 |
}
|
40 |
}
|
41 |
|
42 |
// Get general options
|
43 |
+
$general = aye_set_general_defaults();
|
44 |
|
45 |
// Check to see if cache is available
|
46 |
if ( $general[ 'transcript_cache' ] != 0 ) {
|
47 |
+
$cache_key = 'aye_transcript_'.$id;
|
48 |
$output = get_transient( $cache_key );
|
49 |
if ( $output !== false) { return $output; }
|
50 |
}
|
51 |
|
52 |
// Get transcript file
|
53 |
+
$return = aye_get_file( 'http://video.google.com/timedtext?lang=en&v=' . $id );
|
54 |
$xml = $return[ 'file' ];
|
55 |
$output = '';
|
56 |
|
includes/{widgets.php → aye-generate-widgets.php}
RENAMED
@@ -4,7 +4,7 @@
|
|
4 |
*
|
5 |
* Create and display widgets
|
6 |
*
|
7 |
-
* @package
|
8 |
*/
|
9 |
|
10 |
class YouTubeEmbedWidget extends WP_Widget {
|
@@ -22,7 +22,7 @@ class YouTubeEmbedWidget extends WP_Widget {
|
|
22 |
function YouTubeEmbedWidget() {
|
23 |
parent::WP_Widget( 'youtube_embed_widget',
|
24 |
'YouTube Embed',
|
25 |
-
array( 'description' => 'Embed YouTube Widget.', 'class' => 'my-widget-class' )
|
26 |
);
|
27 |
}
|
28 |
|
@@ -52,7 +52,7 @@ class YouTubeEmbedWidget extends WP_Widget {
|
|
52 |
if ( !empty( $title ) ) { echo $before_title . $title . $after_title; }
|
53 |
|
54 |
// Generate the video and output it
|
55 |
-
echo
|
56 |
$instance[ 'type' ],
|
57 |
$instance[ 'width' ],
|
58 |
$instance[ 'height' ],
|
@@ -83,7 +83,9 @@ class YouTubeEmbedWidget extends WP_Widget {
|
|
83 |
'',
|
84 |
'',
|
85 |
$instance[ 'video_title' ],
|
86 |
-
$instance[ 'dynamic' ]
|
|
|
|
|
87 |
|
88 |
// Output the trailer
|
89 |
echo $after_widget;
|
@@ -120,6 +122,9 @@ class YouTubeEmbedWidget extends WP_Widget {
|
|
120 |
$instance[ 'loop' ] = $new_instance[ 'loop' ];
|
121 |
$instance[ 'stop' ] = $new_instance[ 'stop' ];
|
122 |
|
|
|
|
|
|
|
123 |
return $instance;
|
124 |
}
|
125 |
|
@@ -134,7 +139,7 @@ class YouTubeEmbedWidget extends WP_Widget {
|
|
134 |
*/
|
135 |
|
136 |
function form( $instance ) {
|
137 |
-
include ( WP_PLUGIN_DIR . '/youtube-embed/includes/options-widgets.php' );
|
138 |
}
|
139 |
}
|
140 |
|
4 |
*
|
5 |
* Create and display widgets
|
6 |
*
|
7 |
+
* @package Artiss-YouTube-Embed
|
8 |
*/
|
9 |
|
10 |
class YouTubeEmbedWidget extends WP_Widget {
|
22 |
function YouTubeEmbedWidget() {
|
23 |
parent::WP_Widget( 'youtube_embed_widget',
|
24 |
'YouTube Embed',
|
25 |
+
array( 'description' => __( 'Embed YouTube Widget.' ), 'class' => 'my-widget-class' )
|
26 |
);
|
27 |
}
|
28 |
|
52 |
if ( !empty( $title ) ) { echo $before_title . $title . $after_title; }
|
53 |
|
54 |
// Generate the video and output it
|
55 |
+
echo aye_generate_youtube_code ( $instance[ 'id' ],
|
56 |
$instance[ 'type' ],
|
57 |
$instance[ 'width' ],
|
58 |
$instance[ 'height' ],
|
83 |
'',
|
84 |
'',
|
85 |
$instance[ 'video_title' ],
|
86 |
+
$instance[ 'dynamic' ],
|
87 |
+
$instance[ 'search' ],
|
88 |
+
$instance[ 'user' ] );
|
89 |
|
90 |
// Output the trailer
|
91 |
echo $after_widget;
|
122 |
$instance[ 'loop' ] = $new_instance[ 'loop' ];
|
123 |
$instance[ 'stop' ] = $new_instance[ 'stop' ];
|
124 |
|
125 |
+
if ( $new_instance[ 'id_type' ] == 's' ) { $instance[ 'search' ] = '1'; } else { $instance[ 'search' ] = '1'; }
|
126 |
+
if ( $new_instance[ 'id_type' ] == 'u' ) { $instance[ 'user' ] = '1'; } else { $instance[ 'user' ] = '1'; }
|
127 |
+
|
128 |
return $instance;
|
129 |
}
|
130 |
|
139 |
*/
|
140 |
|
141 |
function form( $instance ) {
|
142 |
+
include ( WP_PLUGIN_DIR . '/youtube-embed/includes/aye-options-widgets.php' );
|
143 |
}
|
144 |
}
|
145 |
|
includes/{options-general.php → aye-options-general.php}
RENAMED
@@ -4,75 +4,89 @@
|
|
4 |
*
|
5 |
* Screen for generic options
|
6 |
*
|
7 |
-
* @package
|
8 |
* @since 2.0
|
9 |
*/
|
10 |
|
11 |
?>
|
12 |
-
<div class="wrap">
|
13 |
<div class="icon32"><img src="<?php echo plugins_url(); ?>/youtube-embed/images/screen_icon.png" alt="" title="" height="32px" width="32px"/><br /></div>
|
14 |
-
<h2
|
15 |
|
16 |
<?php
|
17 |
// If options have been updated on screen, update the database
|
|
|
18 |
if ( ( !empty( $_POST ) ) && ( check_admin_referer( 'youtube-embed-general', 'youtube_embed_general_nonce' ) ) ) {
|
19 |
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
|
24 |
// If the number of profiles is less than zero, put it to 0
|
25 |
-
if ( $options[ 'profile_no' ] < 0 ) { $options[ 'profile_no' ] = 0; }
|
26 |
|
27 |
-
|
|
|
|
|
28 |
|
29 |
// If the number of lists is less than 1, put it to 1
|
|
|
30 |
if ( $options[ 'list_no' ] < 1 ) { $options[ 'list_no' ] = 1; }
|
31 |
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
|
51 |
// Update the options
|
|
|
52 |
update_option( 'youtube_embed_general', $options );
|
|
|
53 |
|
54 |
// Update the alternative shortcodes
|
55 |
-
|
|
|
56 |
$shortcode[ 1 ] = trim( $shortcode[ 1 ], '[]' );
|
57 |
-
|
|
|
58 |
$shortcode[ 2 ] = trim( $shortcode[ 2 ], '[]' );
|
|
|
59 |
update_option( 'youtube_embed_shortcode', $shortcode );
|
60 |
|
61 |
-
|
62 |
-
update_option( 'youtube_embed_url', $_POST[ 'youtube_embed_url' ] );
|
63 |
|
64 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
65 |
}
|
66 |
|
67 |
// Get options
|
68 |
-
|
69 |
-
$
|
70 |
-
$
|
|
|
71 |
?>
|
72 |
|
73 |
-
<p><?php _e( 'These are the general settings for Artiss YouTube Embed. Please select <a href="
|
74 |
|
75 |
-
<form method="post" action="<?php echo get_bloginfo( 'wpurl' ).'/wp-admin/admin.php?page=
|
76 |
|
77 |
<span class="yt_heading"><?php _e( 'Embedding' ); ?></span>
|
78 |
|
@@ -82,18 +96,6 @@ $url = ye_set_url_option();
|
|
82 |
<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. <a href="http://www.artiss.co.uk/artiss-youtube-embed/further-help#ye-metadata">Learn more</a>' ); ?></span></td>
|
83 |
</tr>
|
84 |
|
85 |
-
<tr>
|
86 |
-
<th scope="row"><?php _e( 'URL Embedding' ); ?></th>
|
87 |
-
<td><input type="checkbox" name="youtube_embed_url" value="1"<?php if ( $url == "1" ) { echo ' checked="checked"'; } ?>/> <span class="description"><?php _e( 'Override built-in WP processing of YouTube URLs. <a href="http://www.artiss.co.uk/artiss-youtube-embed/further-help#ye-urls">Learn more</a>' ); ?></span></td>
|
88 |
-
</tr>
|
89 |
-
|
90 |
-
<tr>
|
91 |
-
<th scope="row"> <?php _e( 'Profile to use' ); ?></th>
|
92 |
-
<td><select name="youtube_embed_url_profile">
|
93 |
-
<?php ye_generate_profile_list( $options[ 'url_profile' ], $options[ 'profile_no' ] ) ?>
|
94 |
-
</select></td>
|
95 |
-
</tr>
|
96 |
-
|
97 |
<tr>
|
98 |
<th scope="row"><?php _e( 'Comment Embedding' ); ?></th>
|
99 |
<td><input type="checkbox" name="youtube_embed_comments" value="1"<?php if ( $options[ 'comments' ] == "1" ) { echo ' checked="checked"'; } ?>/> <span class="description"><?php _e( 'Allow YouTube URLs in comments - will display as embedded videos. <a href="http://www.artiss.co.uk/artiss-youtube-embed/further-help#ye-comments">Learn more</a>' ); ?></span></td>
|
@@ -102,7 +104,7 @@ $url = ye_set_url_option();
|
|
102 |
<tr>
|
103 |
<th scope="row"> <?php _e( 'Profile to use' ); ?></th>
|
104 |
<td><select name="youtube_embed_comments_profile">
|
105 |
-
<?php
|
106 |
</select></td>
|
107 |
</tr>
|
108 |
|
@@ -138,7 +140,7 @@ $url = ye_set_url_option();
|
|
138 |
<tr>
|
139 |
<th scope="row"> <?php _e( 'Profile to use' ); ?></th>
|
140 |
<td><select name="youtube_embed_alt_profile">
|
141 |
-
<?php
|
142 |
</select></td>
|
143 |
</tr>
|
144 |
|
@@ -150,7 +152,7 @@ $url = ye_set_url_option();
|
|
150 |
<tr>
|
151 |
<th scope="row"> <?php _e( 'Profile to use' ); ?></th>
|
152 |
<td><select name="youtube_embed_alt_profile2">
|
153 |
-
<?php
|
154 |
</select></td>
|
155 |
</tr>
|
156 |
</table>
|
@@ -171,7 +173,7 @@ $url = ye_set_url_option();
|
|
171 |
<tr>
|
172 |
<th scope="row"> <?php _e( 'Profile to use' ); ?></th>
|
173 |
<td><select name="youtube_embed_other_profile">
|
174 |
-
<?php
|
175 |
</select> <span class="description"><?php _e( 'For above 2 options' ); ?></span></td>
|
176 |
</tr>
|
177 |
</table>
|
@@ -221,6 +223,16 @@ $url = ye_set_url_option();
|
|
221 |
<th scope="row"><?php _e( 'Transcript Cache' ); ?></th>
|
222 |
<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' ); ?></span></td>
|
223 |
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
224 |
</table>
|
225 |
|
226 |
<br/><span class="yt_heading"><?php _e( 'YouTube API' ); ?></span>
|
@@ -236,7 +248,7 @@ $url = ye_set_url_option();
|
|
236 |
<option value="2"<?php if ( $options[ 'api' ] == "2" ) { echo " selected='selected'"; } ?>><?php _e ( 'HTTPS API used and errors are reported' ); ?></option>
|
237 |
<option value="3"<?php if ( $options[ 'api' ] == "3" ) { echo " selected='selected'"; } ?>><?php _e ( 'HTTP API used and no errors are reported' ); ?></option>
|
238 |
<option value="4"<?php if ( $options[ 'api' ] == "4" ) { echo " selected='selected'"; } ?>><?php _e ( 'HTTPS API used and no errors are reported' ); ?></option>
|
239 |
-
</select
|
240 |
</tr>
|
241 |
</table>
|
242 |
|
@@ -253,9 +265,15 @@ $url = ye_set_url_option();
|
|
253 |
|
254 |
<table class="form-table"><tr>
|
255 |
<th scope="row"><?php _e( 'Privacy-Enhanced Mode' ); ?></th>
|
256 |
-
<td><input type="checkbox" name="youtube_embed_privacy" value="1"<?php if ( $options[ 'privacy' ] ==
|
257 |
</tr></table>
|
258 |
|
|
|
|
|
|
|
|
|
|
|
|
|
259 |
|
260 |
<?php wp_nonce_field( 'youtube-embed-general','youtube_embed_general_nonce', true, true ); ?>
|
261 |
|
4 |
*
|
5 |
* Screen for generic options
|
6 |
*
|
7 |
+
* @package Artiss-YouTube-Embed
|
8 |
* @since 2.0
|
9 |
*/
|
10 |
|
11 |
?>
|
12 |
+
<div class="wrap" style="width: 1010px;">
|
13 |
<div class="icon32"><img src="<?php echo plugins_url(); ?>/youtube-embed/images/screen_icon.png" alt="" title="" height="32px" width="32px"/><br /></div>
|
14 |
+
<h2><?php _e( 'Artiss YouTube Embed Options' ); ?></h2>
|
15 |
|
16 |
<?php
|
17 |
// If options have been updated on screen, update the database
|
18 |
+
|
19 |
if ( ( !empty( $_POST ) ) && ( check_admin_referer( 'youtube-embed-general', 'youtube_embed_general_nonce' ) ) ) {
|
20 |
|
21 |
+
$options[ 'editor_button' ] = $_POST[ 'youtube_embed_editor_button' ];
|
22 |
+
$options[ 'admin_bar' ] = $_POST[ 'youtube_embed_admin_bar' ];
|
23 |
+
if ( !empty( $_POST[ 'youtube_embed_profile_no' ] ) ) { $options[ 'profile_no' ] = $_POST[ 'youtube_embed_profile_no' ]; }
|
24 |
|
25 |
// If the number of profiles is less than zero, put it to 0
|
|
|
26 |
|
27 |
+
if ( $options[ 'profile_no' ] < 0 ) { $options[ 'profile_no' ] = 0; }
|
28 |
+
|
29 |
+
if ( !empty( $_POST[ 'youtube_embed_list_no' ] ) ) { $options[ 'list_no' ] = $_POST[ 'youtube_embed_list_no' ]; }
|
30 |
|
31 |
// If the number of lists is less than 1, put it to 1
|
32 |
+
|
33 |
if ( $options[ 'list_no' ] < 1 ) { $options[ 'list_no' ] = 1; }
|
34 |
|
35 |
+
if ( !empty( $_POST[ 'youtube_embed_embed_cache' ] ) ) { $options[ 'embed_cache' ] = $_POST[ 'youtube_embed_embed_cache' ]; }
|
36 |
+
if ( !empty( $_POST[ 'youtube_embed_info_cache' ] ) ) { $options[ 'info_cache' ] = $_POST[ 'youtube_embed_info_cache' ]; }
|
37 |
+
if ( !empty( $_POST[ 'youtube_embed_transcript_cache' ] ) ) { $options[ 'transcript_cache' ] = $_POST[ 'youtube_embed_transcript_cache' ]; }
|
38 |
+
if ( !empty( $_POST[ 'youtube_embed_fetch_title' ] ) ) { $options[ 'fetch_title' ] = $_POST[ 'youtube_embed_fetch_title' ]; }
|
39 |
+
if ( !empty( $_POST[ 'youtube_embed_alt_profile' ] ) ) { $options[ 'alt_profile' ] = $_POST[ 'youtube_embed_alt_profile' ]; }
|
40 |
+
if ( !empty( $_POST[ 'youtube_embed_alt_profile2' ] ) ) { $options[ 'alt_profile2' ] = $_POST[ 'youtube_embed_alt_profile2' ]; }
|
41 |
+
$options[ 'bracket' ] = $_POST[ 'youtube_embed_bracket' ];
|
42 |
+
$options[ 'alt' ] = $_POST[ 'youtube_embed_alt' ];
|
43 |
+
if ( !empty( $_POST[ 'youtube_embed_other_profile' ] ) ) { $options[ 'other_profile' ] = $_POST[ 'youtube_embed_other_profile' ]; }
|
44 |
+
$options[ 'comments' ] = $_POST[ 'youtube_embed_comments' ];
|
45 |
+
if ( !empty( $_POST[ 'youtube_embed_comments_profile' ] ) ) { $options[ 'comments_profile' ] = $_POST[ 'youtube_embed_comments_profile' ]; }
|
46 |
+
$options[ 'metadata' ] = $_POST[ 'youtube_embed_metadata' ];
|
47 |
+
if ( !empty( $_POST[ 'youtube_embed_feed' ] ) ) { $options[ 'feed' ] = $_POST[ 'youtube_embed_feed' ]; }
|
48 |
+
if ( !empty( $_POST[ 'youtube_embed_api' ] ) ) { $options[ 'api' ] = $_POST[ 'youtube_embed_api' ]; }
|
49 |
+
if ( !empty( $_POST[ 'youtube_embed_error_message' ] ) ) { $options[ 'error_message' ] = htmlspecialchars( $_POST[ 'youtube_embed_error_message' ] ); }
|
50 |
+
if ( !empty( $_POST[ 'youtube_embed_thumbnail' ] ) ) { $options[ 'thumbnail' ] = $_POST[ 'youtube_embed_thumbnail' ]; }
|
51 |
+
$options[ 'privacy' ] = $_POST[ 'youtube_embed_privacy' ];
|
52 |
+
$options[ 'frameborder' ] = $_POST[ 'youtube_embed_frameborder' ];
|
53 |
|
54 |
// Update the options
|
55 |
+
|
56 |
update_option( 'youtube_embed_general', $options );
|
57 |
+
$update_message = __( 'Settings Saved.' );
|
58 |
|
59 |
// Update the alternative shortcodes
|
60 |
+
|
61 |
+
$shortcode[ 1 ] = $_POST[ 'youtube_embed_shortcode' ];
|
62 |
$shortcode[ 1 ] = trim( $shortcode[ 1 ], '[]' );
|
63 |
+
|
64 |
+
$shortcode[ 2 ] = $_POST[ 'youtube_embed_shortcode2' ];
|
65 |
$shortcode[ 2 ] = trim( $shortcode[ 2 ], '[]' );
|
66 |
+
|
67 |
update_option( 'youtube_embed_shortcode', $shortcode );
|
68 |
|
69 |
+
// If the option to clear the cache has been ticked run an SQL to clear them down
|
|
|
70 |
|
71 |
+
if ( !empty( $_POST[ 'youtube_embed_clear_cache' ] ) ) {
|
72 |
+
global $wpdb;
|
73 |
+
$wpdb -> query( "DELETE FROM $wpdb->options WHERE option_name LIKE '_transient_%ye_video_%'" );
|
74 |
+
$update_message .= ' ' . __( 'Cache cleared.' );
|
75 |
+
}
|
76 |
+
|
77 |
+
echo '<div class="updated fade"><p><strong>' . $update_message . "</strong></p></div>\n";
|
78 |
}
|
79 |
|
80 |
// Get options
|
81 |
+
|
82 |
+
$options = aye_set_general_defaults();
|
83 |
+
$shortcode = aye_set_shortcode_option();
|
84 |
+
$url = aye_set_url_option();
|
85 |
?>
|
86 |
|
87 |
+
<p><?php _e( 'These are the general settings for Artiss YouTube Embed. Please select <a href="admin.php?page=aye-profile-options">Profiles</a> for default embedding settings.' ); ?></p>
|
88 |
|
89 |
+
<form method="post" action="<?php echo get_bloginfo( 'wpurl' ).'/wp-admin/admin.php?page=aye-general-options' ?>">
|
90 |
|
91 |
<span class="yt_heading"><?php _e( 'Embedding' ); ?></span>
|
92 |
|
96 |
<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. <a href="http://www.artiss.co.uk/artiss-youtube-embed/further-help#ye-metadata">Learn more</a>' ); ?></span></td>
|
97 |
</tr>
|
98 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
99 |
<tr>
|
100 |
<th scope="row"><?php _e( 'Comment Embedding' ); ?></th>
|
101 |
<td><input type="checkbox" name="youtube_embed_comments" value="1"<?php if ( $options[ 'comments' ] == "1" ) { echo ' checked="checked"'; } ?>/> <span class="description"><?php _e( 'Allow YouTube URLs in comments - will display as embedded videos. <a href="http://www.artiss.co.uk/artiss-youtube-embed/further-help#ye-comments">Learn more</a>' ); ?></span></td>
|
104 |
<tr>
|
105 |
<th scope="row"> <?php _e( 'Profile to use' ); ?></th>
|
106 |
<td><select name="youtube_embed_comments_profile">
|
107 |
+
<?php aye_generate_profile_list( $options[ 'comments_profile' ], $options[ 'profile_no' ] ) ?>
|
108 |
</select></td>
|
109 |
</tr>
|
110 |
|
140 |
<tr>
|
141 |
<th scope="row"> <?php _e( 'Profile to use' ); ?></th>
|
142 |
<td><select name="youtube_embed_alt_profile">
|
143 |
+
<?php aye_generate_profile_list( $options[ 'alt_profile' ], $options[ 'profile_no' ] ) ?>
|
144 |
</select></td>
|
145 |
</tr>
|
146 |
|
152 |
<tr>
|
153 |
<th scope="row"> <?php _e( 'Profile to use' ); ?></th>
|
154 |
<td><select name="youtube_embed_alt_profile2">
|
155 |
+
<?php aye_generate_profile_list( $options[ 'alt_profile2' ], $options[ 'profile_no' ] ) ?>
|
156 |
</select></td>
|
157 |
</tr>
|
158 |
</table>
|
173 |
<tr>
|
174 |
<th scope="row"> <?php _e( 'Profile to use' ); ?></th>
|
175 |
<td><select name="youtube_embed_other_profile">
|
176 |
+
<?php aye_generate_profile_list( $options[ 'other_profile' ], $options[ 'profile_no' ] ) ?>
|
177 |
</select> <span class="description"><?php _e( 'For above 2 options' ); ?></span></td>
|
178 |
</tr>
|
179 |
</table>
|
223 |
<th scope="row"><?php _e( 'Transcript Cache' ); ?></th>
|
224 |
<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' ); ?></span></td>
|
225 |
</tr>
|
226 |
+
|
227 |
+
<?php
|
228 |
+
global $wpdb;
|
229 |
+
$numposts = $wpdb -> get_var( "SELECT COUNT(*) FROM $wpdb->options WHERE option_name LIKE '_transient_timeout_%ye_video_%'" );
|
230 |
+
?>
|
231 |
+
|
232 |
+
<tr>
|
233 |
+
<th scope="row"><?php _e( 'Clear Cache' ); ?></th>
|
234 |
+
<td><input type="checkbox" name="youtube_embed_clear_cache" value="1"> <span class="description"><?php echo sprintf ( __( 'Select this option to remove all YouTube Embed cache. You currently have %d cached video(s)' ), number_format( $numposts ) ); ?></span></td>
|
235 |
+
</tr>
|
236 |
</table>
|
237 |
|
238 |
<br/><span class="yt_heading"><?php _e( 'YouTube API' ); ?></span>
|
248 |
<option value="2"<?php if ( $options[ 'api' ] == "2" ) { echo " selected='selected'"; } ?>><?php _e ( 'HTTPS API used and errors are reported' ); ?></option>
|
249 |
<option value="3"<?php if ( $options[ 'api' ] == "3" ) { echo " selected='selected'"; } ?>><?php _e ( 'HTTP API used and no errors are reported' ); ?></option>
|
250 |
<option value="4"<?php if ( $options[ 'api' ] == "4" ) { echo " selected='selected'"; } ?>><?php _e ( 'HTTPS API used and no errors are reported' ); ?></option>
|
251 |
+
</select></td>
|
252 |
</tr>
|
253 |
</table>
|
254 |
|
265 |
|
266 |
<table class="form-table"><tr>
|
267 |
<th scope="row"><?php _e( 'Privacy-Enhanced Mode' ); ?></th>
|
268 |
+
<td><input type="checkbox" name="youtube_embed_privacy" value="1"<?php if ( $options[ 'privacy' ] == '1' ) { echo ' checked="checked"'; } ?>/> <span class="description"><?php _e( 'When on, the player on this site will not store cookies' ); ?></span></td>
|
269 |
</tr></table>
|
270 |
|
271 |
+
<br/><span class="yt_heading"><?php _e( 'Compatability' ); ?></span>
|
272 |
+
|
273 |
+
<table class="form-table"><tr>
|
274 |
+
<th scope="row"><?php _e( 'Allow Frame Border on IFRAME' ); ?></th>
|
275 |
+
<td><input type="checkbox" name="youtube_embed_frameborder" value="1"<?php if ( $options[ 'frameborder' ] == '1' ) { echo ' checked="checked"'; } ?>/> <span class="description"><?php _e( 'FRAMEBORDER is not HTML5 compliant' ); ?></span></td>
|
276 |
+
</tr></table>
|
277 |
|
278 |
<?php wp_nonce_field( 'youtube-embed-general','youtube_embed_general_nonce', true, true ); ?>
|
279 |
|
includes/{options-lists.php → aye-options-lists.php}
RENAMED
@@ -4,15 +4,15 @@
|
|
4 |
*
|
5 |
* Screen for specifying different lists and the video IDs within them
|
6 |
*
|
7 |
-
* @package
|
8 |
* @since 2.0
|
9 |
*/
|
10 |
?>
|
11 |
-
<div class="wrap">
|
12 |
|
13 |
<div class="icon32"><img src="<?php echo plugins_url(); ?>/youtube-embed/images/screen_icon.png" alt="" title="" height="32px" width="32px"/><br /></div>
|
14 |
|
15 |
-
<h2
|
16 |
|
17 |
<?php
|
18 |
// Set current list number
|
@@ -23,12 +23,12 @@ if ( $list_no == '' ) { $list_no = 1; }
|
|
23 |
if ( ( !empty( $_POST[ 'Submit' ] ) ) && ( check_admin_referer( 'youtube-embed-general', 'youtube_embed_general_nonce' ) ) ) {
|
24 |
|
25 |
$class = 'updated fade';
|
26 |
-
$message = 'Settings Saved.';
|
27 |
$new_id_list = '';
|
28 |
|
29 |
if ( ( $_POST[ 'youtube_embed_video_list' ] == '' ) or ( $_POST[ 'youtube_embed_name' ] == '' ) ) {
|
30 |
$class = 'error';
|
31 |
-
$message = 'All fields must be completed.';
|
32 |
} else {
|
33 |
$id_array = explode( "\n", $_POST[ 'youtube_embed_video_list' ] );
|
34 |
$loop = 0;
|
@@ -37,10 +37,10 @@ if ( ( !empty( $_POST[ 'Submit' ] ) ) && ( check_admin_referer( 'youtube-embed-g
|
|
37 |
// Loop through the video IDs
|
38 |
while ( $loop < count( $id_array ) ) {
|
39 |
// Extract the ID from the provided data
|
40 |
-
$id = trim(
|
41 |
// Now check its validity
|
42 |
if ( $id != '' ) {
|
43 |
-
$video_info =
|
44 |
if ( $video_info[ 'type' ] != 'v' ) { $valid = false; }
|
45 |
$new_id_list .= $id . "\n";
|
46 |
}
|
@@ -50,7 +50,7 @@ if ( ( !empty( $_POST[ 'Submit' ] ) ) && ( check_admin_referer( 'youtube-embed-g
|
|
50 |
// If one or more IDs weren't valid, output an error
|
51 |
if (!$valid) {
|
52 |
$class = 'error';
|
53 |
-
$message = 'Errors were found with your video list. See the list below for details.';
|
54 |
}
|
55 |
}
|
56 |
|
@@ -70,11 +70,11 @@ if ( ( !empty( $_POST[ 'Submit' ] ) ) && ( check_admin_referer( 'youtube-embed-g
|
|
70 |
}
|
71 |
|
72 |
// Fetch options into an array
|
73 |
-
if ( $class != "error" ) { $options =
|
74 |
-
$general =
|
75 |
?>
|
76 |
|
77 |
-
<form method="post" action="<?php echo get_bloginfo( 'wpurl' ) . '/wp-admin/admin.php?page=
|
78 |
|
79 |
<span class="alignright">
|
80 |
<select name="youtube_embed_list_no">
|
@@ -85,7 +85,7 @@ while ( $loop <= $general[ 'list_no' ] ) {
|
|
85 |
$listfiles = get_option( 'youtube_embed_list' . $loop );
|
86 |
$listname = $listfiles[ 'name' ];
|
87 |
|
88 |
-
if ( $listname == '' ) { $listname = 'List ' . $loop; }
|
89 |
if ( strlen( $listname ) > 30 ) { $listname = substr( $listname, 0, 30 ) . '…'; }
|
90 |
echo '<option value="' . $loop . '"';
|
91 |
if ( $list_no == $loop ) { echo " selected='selected'"; }
|
@@ -98,7 +98,7 @@ while ( $loop <= $general[ 'list_no' ] ) {
|
|
98 |
<input type="submit" name="List" class="button-secondary" value="<?php _e( 'Change list' ); ?>"/>
|
99 |
</span><br/>
|
100 |
|
101 |
-
<?php echo __( 'These are the options for list '
|
102 |
|
103 |
<table class="form-table">
|
104 |
|
@@ -127,34 +127,34 @@ if ( $options[ 'list' ] != '' ) {
|
|
127 |
|
128 |
$id_array = explode( "\n", $options[ 'list' ] );
|
129 |
|
130 |
-
echo
|
131 |
$loop = 0;
|
132 |
|
133 |
while ( $loop < count( $id_array ) ) {
|
134 |
|
135 |
// Extract the ID from the provided data
|
136 |
|
137 |
-
$id = trim(
|
138 |
if ( $id != '' ) {
|
139 |
|
140 |
// Validate the video type
|
141 |
|
142 |
-
$video_info =
|
143 |
$type = $video_info[ 'type' ];
|
144 |
|
145 |
if ( $type == 'p' ) {
|
146 |
-
$text = 'This is a playlist';
|
147 |
$status = '-1';
|
148 |
} else {
|
149 |
if ( $type == '' ) {
|
150 |
-
$text = 'Invalid video ID';
|
151 |
$status = '-2';
|
152 |
} else {
|
153 |
if ( strlen( $type ) != 1 ) {
|
154 |
-
$text = 'YouTube API error';
|
155 |
$status = '-3';
|
156 |
} else {
|
157 |
-
$text = 'Valid video';
|
158 |
$status = '0';
|
159 |
}
|
160 |
}
|
@@ -172,9 +172,11 @@ if ( $options[ 'list' ] != '' ) {
|
|
172 |
|
173 |
echo '"><img src="' . plugins_url() . '/youtube-embed/images/';
|
174 |
if ( $status == 0 ) {
|
175 |
-
|
|
|
176 |
} else {
|
177 |
-
|
|
|
178 |
}
|
179 |
|
180 |
echo "height=\"16px\" width=\"16px\"/> " . $text . "</td>\n\t</tr>\n";
|
4 |
*
|
5 |
* Screen for specifying different lists and the video IDs within them
|
6 |
*
|
7 |
+
* @package Artiss-YouTube-Embed
|
8 |
* @since 2.0
|
9 |
*/
|
10 |
?>
|
11 |
+
<div class="wrap" style="width: 1010px;">
|
12 |
|
13 |
<div class="icon32"><img src="<?php echo plugins_url(); ?>/youtube-embed/images/screen_icon.png" alt="" title="" height="32px" width="32px"/><br /></div>
|
14 |
|
15 |
+
<h2><?php _e( 'Artiss YouTube Embed Lists' ); ?></h2>
|
16 |
|
17 |
<?php
|
18 |
// Set current list number
|
23 |
if ( ( !empty( $_POST[ 'Submit' ] ) ) && ( check_admin_referer( 'youtube-embed-general', 'youtube_embed_general_nonce' ) ) ) {
|
24 |
|
25 |
$class = 'updated fade';
|
26 |
+
$message = __( 'Settings Saved.' );
|
27 |
$new_id_list = '';
|
28 |
|
29 |
if ( ( $_POST[ 'youtube_embed_video_list' ] == '' ) or ( $_POST[ 'youtube_embed_name' ] == '' ) ) {
|
30 |
$class = 'error';
|
31 |
+
$message = __( 'All fields must be completed.' );
|
32 |
} else {
|
33 |
$id_array = explode( "\n", $_POST[ 'youtube_embed_video_list' ] );
|
34 |
$loop = 0;
|
37 |
// Loop through the video IDs
|
38 |
while ( $loop < count( $id_array ) ) {
|
39 |
// Extract the ID from the provided data
|
40 |
+
$id = trim( aye_extract_id( $id_array[ $loop ] ) );
|
41 |
// Now check its validity
|
42 |
if ( $id != '' ) {
|
43 |
+
$video_info = aye_validate_id( $id, true );
|
44 |
if ( $video_info[ 'type' ] != 'v' ) { $valid = false; }
|
45 |
$new_id_list .= $id . "\n";
|
46 |
}
|
50 |
// If one or more IDs weren't valid, output an error
|
51 |
if (!$valid) {
|
52 |
$class = 'error';
|
53 |
+
$message = __( 'Errors were found with your video list. See the list below for details.' );
|
54 |
}
|
55 |
}
|
56 |
|
70 |
}
|
71 |
|
72 |
// Fetch options into an array
|
73 |
+
if ( $class != "error" ) { $options = aye_set_list_defaults( $list_no ); }
|
74 |
+
$general = aye_set_general_defaults();
|
75 |
?>
|
76 |
|
77 |
+
<form method="post" action="<?php echo get_bloginfo( 'wpurl' ) . '/wp-admin/admin.php?page=aye-list-options'; ?>">
|
78 |
|
79 |
<span class="alignright">
|
80 |
<select name="youtube_embed_list_no">
|
85 |
$listfiles = get_option( 'youtube_embed_list' . $loop );
|
86 |
$listname = $listfiles[ 'name' ];
|
87 |
|
88 |
+
if ( $listname == '' ) { $listname = __( 'List' ) . ' ' . $loop; }
|
89 |
if ( strlen( $listname ) > 30 ) { $listname = substr( $listname, 0, 30 ) . '…'; }
|
90 |
echo '<option value="' . $loop . '"';
|
91 |
if ( $list_no == $loop ) { echo " selected='selected'"; }
|
98 |
<input type="submit" name="List" class="button-secondary" value="<?php _e( 'Change list' ); ?>"/>
|
99 |
</span><br/>
|
100 |
|
101 |
+
<?php echo sprintf( __( 'These are the options for list ' ), $list_no) . '<br/>' . __( 'Update the name, if required, and specify a list of YouTube video IDs. Use the drop-down on the right hand side to swap between lists.' ); ?>
|
102 |
|
103 |
<table class="form-table">
|
104 |
|
127 |
|
128 |
$id_array = explode( "\n", $options[ 'list' ] );
|
129 |
|
130 |
+
echo '<table class=\"widefat\">\n<thead>\n\t<tr>\n\t\t<th>' . __( 'Video ID' ) . '</th>\n\t\t<th>' . __( 'Video Title' ) . '</th>\n\t\t<th>' . __( 'Status' ) . "</th>\n\t</tr>\n</thead>\n<tbody>\n";
|
131 |
$loop = 0;
|
132 |
|
133 |
while ( $loop < count( $id_array ) ) {
|
134 |
|
135 |
// Extract the ID from the provided data
|
136 |
|
137 |
+
$id = trim( aye_extract_id( $id_array[ $loop ] ) );
|
138 |
if ( $id != '' ) {
|
139 |
|
140 |
// Validate the video type
|
141 |
|
142 |
+
$video_info = aye_validate_id( $id, true );
|
143 |
$type = $video_info[ 'type' ];
|
144 |
|
145 |
if ( $type == 'p' ) {
|
146 |
+
$text = __( 'This is a playlist' );
|
147 |
$status = '-1';
|
148 |
} else {
|
149 |
if ( $type == '' ) {
|
150 |
+
$text = __( 'Invalid video ID' );
|
151 |
$status = '-2';
|
152 |
} else {
|
153 |
if ( strlen( $type ) != 1 ) {
|
154 |
+
$text = __( 'YouTube API error' );
|
155 |
$status = '-3';
|
156 |
} else {
|
157 |
+
$text = __( 'Valid video' );
|
158 |
$status = '0';
|
159 |
}
|
160 |
}
|
172 |
|
173 |
echo '"><img src="' . plugins_url() . '/youtube-embed/images/';
|
174 |
if ( $status == 0 ) {
|
175 |
+
$alt_text = __( 'The video ID is valid' );
|
176 |
+
echo 'tick.png" alt="' . $alt_text . '" title="' . $alt_text . '" ';
|
177 |
} else {
|
178 |
+
$alt_text = __( 'The video ID is invalid' );
|
179 |
+
echo 'cross.png" alt="' . $alt_text . '" title="' . $alt_text . '" ';
|
180 |
}
|
181 |
|
182 |
echo "height=\"16px\" width=\"16px\"/> " . $text . "</td>\n\t</tr>\n";
|
includes/{options-profiles.php → aye-options-profiles.php}
RENAMED
@@ -4,15 +4,29 @@
|
|
4 |
*
|
5 |
* Screen for specifying different profiles and settings the options for each
|
6 |
*
|
7 |
-
* @package
|
8 |
* @since 2.0
|
9 |
*/
|
10 |
?>
|
11 |
-
<div class="wrap">
|
12 |
|
13 |
<div class="icon32"><img src="<?php echo plugins_url(); ?>/youtube-embed/images/screen_icon.png" alt="" title="" height="32px" width="32px"/><br /></div>
|
14 |
|
15 |
-
<h2
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
16 |
|
17 |
<?php
|
18 |
// Set current profile number
|
@@ -22,43 +36,41 @@ if ( $profile_no == '' ) { $profile_no = 0; }
|
|
22 |
// If options have been updated on screen, update the database
|
23 |
if ( ( !empty( $_POST[ 'Submit' ] ) ) && ( check_admin_referer( 'youtube-embed-profile' , 'youtube_embed_profile_nonce' ) ) ) {
|
24 |
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
$options[ 'playlist' ] = $_POST[ 'youtube_embed_playlist' ];
|
29 |
$options[ 'width' ] = $_POST[ 'youtube_embed_width' ];
|
30 |
-
|
31 |
|
32 |
-
|
33 |
if ( strpos( $options[ 'template' ], '%video%' ) === false ) { $options[ 'template' ] = '%video%'; }
|
34 |
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
$default_size = $_POST[ 'youtube_embed_size' ];
|
62 |
|
63 |
if ( $default_size !== '' ) {
|
64 |
$options[ 'width' ] = ltrim( substr( $default_size, 0, 4 ), '0' );
|
@@ -92,23 +104,26 @@ if ( ( !empty( $_POST[ 'Submit' ] ) ) && ( check_admin_referer( 'youtube-embed-p
|
|
92 |
if ( !empty( $_POST[ 'Video' ] ) ) { $video_type = $_POST[ 'youtube_embed_video_type' ]; } else { $video_type = 'd'; }
|
93 |
|
94 |
// Fetch options into an array
|
95 |
-
$options =
|
96 |
-
$general =
|
97 |
?>
|
98 |
|
99 |
-
<form method="post" action="<?php echo get_bloginfo( 'wpurl' ) . '/wp-admin/admin.php?page=
|
100 |
|
101 |
<span class="alignright">
|
102 |
<select name="youtube_embed_profile_no">
|
103 |
-
<?php
|
104 |
</select>
|
105 |
<input type="submit" name="Profile" class="button-secondary" value="<?php _e('Change profile'); ?>"/>
|
106 |
</span><br/>
|
107 |
|
108 |
<?php
|
109 |
-
|
110 |
-
|
111 |
-
|
|
|
|
|
|
|
112 |
?>
|
113 |
|
114 |
<table class="form-table">
|
@@ -122,23 +137,23 @@ _e( '<br/>Use the drop-down on the right hand side to swap between profiles.' );
|
|
122 |
<tr valign="top">
|
123 |
<th scope="row"><?php _e( 'Video Embed Type' ); ?></th>
|
124 |
<td><span class="description"><?php _e( 'The type of player to use for videos.' ); ?></span><br/>
|
125 |
-
<input type="radio" name="youtube_embed_type" value="v"<?php if ( $options[ 'type' ] == "v" ) { echo ' checked="checked"'; } ?>/><?php
|
126 |
-
<input type="radio" name="youtube_embed_type" value="p"<?php if ( $options[ 'type' ] == "p" ) { echo ' checked="checked"'; } ?>/><?php
|
127 |
-
<input type="radio" name="youtube_embed_type" value="c"<?php if ( $options[ 'type' ] == "c" ) { echo ' checked="checked"'; } ?>/><?php
|
128 |
-
<input type="radio" name="youtube_embed_type" value="m"<?php if ( $options[ 'type' ] == "m" ) { echo ' checked="checked"'; } ?>/><?php
|
129 |
</td>
|
130 |
</tr>
|
131 |
|
132 |
<tr valign="top">
|
133 |
<th scope="row"><?php _e( 'Playlist Embed Type' ); ?></th>
|
134 |
<td><span class="description"><?php _e( 'The type of player to use when showing playlists.' ); ?></span><br/>
|
135 |
-
<input type="radio" name="youtube_embed_playlist" value="v"<?php if ( $options[ 'playlist' ] == "v" ) { echo ' checked="checked"'; } ?>/><?php
|
136 |
-
<input type="radio" name="youtube_embed_playlist" value="o"<?php if ( $options[ 'playlist' ] == "o" ) { echo ' checked="checked"'; } ?>/><?php
|
137 |
</td>
|
138 |
</tr>
|
139 |
</table>
|
140 |
|
141 |
-
<br/><span class="yt_heading"><?php _e( 'All
|
142 |
|
143 |
<table class="form-table">
|
144 |
<tr>
|
@@ -162,11 +177,11 @@ _e( '<br/>Use the drop-down on the right hand side to swap between profiles.' );
|
|
162 |
<th scope="row"><?php _e( 'Default Sizes' ); ?></th>
|
163 |
<td><select name="youtube_embed_size">
|
164 |
<option value=""<?php if ( $default_size == '' ) { echo " selected='selected'"; } ?>><?php _e( 'Use above sizes' ); ?></option>
|
165 |
-
<option value="04800385"<?php if ( $default_size == "04800385" ) { echo " selected='selected'"; } ?>><?php
|
166 |
-
<option value="05600340"<?php if ( $default_size == "05600340" ) { echo " selected='selected'"; } ?>><?php
|
167 |
-
<option value="06400385"<?php if ( $default_size == "06400385" ) { echo " selected='selected'"; } ?>><?php
|
168 |
-
<option value="08530505"<?php if ( $default_size == "08530505" ) { echo " selected='selected'"; } ?>><?php
|
169 |
-
<option value="12800745"<?php if ( $default_size == "12800745" ) { echo " selected='selected'"; } ?>><?php
|
170 |
</select> <span class="description"><?php _e( 'Select one of these default sizes to override the above video sizes' ); ?></span></td>
|
171 |
</tr>
|
172 |
|
@@ -195,8 +210,7 @@ _e( '<br/>Use the drop-down on the right hand side to swap between profiles.' );
|
|
195 |
|
196 |
</table>
|
197 |
|
198 |
-
<br/><span class="yt_heading"><?php _e( '
|
199 |
-
<br/><br/>The following options are not supported by EmbedPlus.
|
200 |
|
201 |
<table class="form-table">
|
202 |
|
@@ -224,6 +238,11 @@ _e( '<br/>Use the drop-down on the right hand side to swap between profiles.' );
|
|
224 |
<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' ); ?></span></td>
|
225 |
</tr>
|
226 |
|
|
|
|
|
|
|
|
|
|
|
227 |
<tr>
|
228 |
<th scope="row"><?php _e( 'Theme' ); ?></th>
|
229 |
<td><select name="youtube_embed_theme">
|
@@ -233,7 +252,7 @@ _e( '<br/>Use the drop-down on the right hand side to swap between profiles.' );
|
|
233 |
</tr>
|
234 |
</table>
|
235 |
|
236 |
-
<br/><span class="yt_heading"><?php _e( '
|
237 |
<br/><br/>The following options are not supported if using EmbedPlus or if the IFRAME player uses HTML5.
|
238 |
|
239 |
<table class="form-table">
|
@@ -258,13 +277,13 @@ _e( '<br/>Use the drop-down on the right hand side to swap between profiles.' );
|
|
258 |
</tr>
|
259 |
|
260 |
<tr>
|
261 |
-
<th scope="row"><?php _e( '
|
262 |
-
<td><input type="checkbox" name="
|
263 |
</tr>
|
264 |
|
265 |
<tr>
|
266 |
-
<th scope="row"><?php _e( '
|
267 |
-
<td><input type="checkbox" name="
|
268 |
</tr>
|
269 |
|
270 |
<tr>
|
@@ -281,8 +300,7 @@ _e( '<br/>Use the drop-down on the right hand side to swap between profiles.' );
|
|
281 |
</tr>
|
282 |
</table>
|
283 |
|
284 |
-
<br/><span class="yt_heading"><?php _e( '
|
285 |
-
<br/><br/>The following options are not supported if using the IFRAME player.
|
286 |
|
287 |
<table class="form-table">
|
288 |
<tr valign="top">
|
@@ -294,20 +312,16 @@ _e( '<br/>Use the drop-down on the right hand side to swap between profiles.' );
|
|
294 |
</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>.' ); ?></span></td>
|
295 |
</tr>
|
296 |
|
297 |
-
<tr>
|
298 |
-
<th scope="row"><?php _e( 'Modest Branding' ); ?></th>
|
299 |
-
<td><input type="checkbox" name="youtube_embed_modest" value="1"<?php if ( $options[ 'modest' ] == "1" ) { echo ' checked="checked"'; } ?>/> <span class="description"><?php _e( 'Reduce branding on video.' ); ?></span></td>
|
300 |
-
</tr>
|
301 |
</table>
|
302 |
|
303 |
-
<br/><span class="yt_heading"><?php _e( 'EmbedPlus
|
304 |
|
305 |
<table class="form-table">
|
306 |
<tr valign="top">
|
307 |
<th scope="row"><?php _e( 'Fallback Embed Type' ); ?></th>
|
308 |
<td><span class="description"><?php _e( 'The type of player to use if Flash is not available and EmbedPlus cannot be used.' ); ?></span><br/>
|
309 |
-
<input type="radio" name="youtube_embed_fallback" value="v"<?php if ( $options[ 'fallback' ] == "v" ) { echo ' checked="checked"'; }
|
310 |
-
<input type="radio" name="youtube_embed_fallback" value="p"<?php if ( $options[ 'fallback' ] == "p" ) { echo ' checked="checked"'; }
|
311 |
</tr>
|
312 |
|
313 |
<tr>
|
@@ -332,8 +346,10 @@ _e( '<br/>Use the drop-down on the right hand side to swap between profiles.' );
|
|
332 |
|
333 |
</form>
|
334 |
|
|
|
|
|
335 |
<a href="#" name="video"></a>
|
336 |
-
<form method="post" action="<?php echo get_bloginfo( 'wpurl' ).'/wp-admin/admin.php?page=
|
337 |
<div class="ytbox_grey">
|
338 |
<h3><?php _e( 'YouTube Video Sample' ); ?></h3>
|
339 |
<p><?php _e( 'This uses the above settings, once they have been saved. <b>Would you like this to be your video? If so, <a href="http://www.artiss.co.uk/contact">contact me</a>!</b>' ); ?></p>
|
@@ -348,11 +364,11 @@ _e( '<br/>Use the drop-down on the right hand side to swap between profiles.' );
|
|
348 |
<input type="submit" name="Video" class="button-secondary" value="<?php _e( 'Change video' ); ?>"/></p>
|
349 |
|
350 |
<p><?php
|
351 |
-
if ( $video_type == "d" ) { $id = '
|
352 |
if ( $video_type == "p" ) { $id = 'YVvn8dpSAt0'; $type = 'm'; }
|
353 |
if ( $video_type == "3" ) { $id = 'NR5UoBY87GM'; $type = ''; ; }
|
354 |
if ( $video_type == "l" ) { $id = '095393D5B42B2266'; $type = ''; }
|
355 |
-
echo
|
356 |
?></p>
|
357 |
</div>
|
358 |
|
4 |
*
|
5 |
* Screen for specifying different profiles and settings the options for each
|
6 |
*
|
7 |
+
* @package Artiss-YouTube-Embed
|
8 |
* @since 2.0
|
9 |
*/
|
10 |
?>
|
11 |
+
<div class="wrap" style="width: 1010px;">
|
12 |
|
13 |
<div class="icon32"><img src="<?php echo plugins_url(); ?>/youtube-embed/images/screen_icon.png" alt="" title="" height="32px" width="32px"/><br /></div>
|
14 |
|
15 |
+
<h2><?php _e( 'Artiss YouTube Embed Profiles' ); ?></h2><br/>
|
16 |
+
|
17 |
+
<div style="width: 990px; height: 220px; border: 1px solid #ddd; padding: 10px;">
|
18 |
+
<a href="http://themefuse.com/wp-themes-shop/?plugin=youtube-embed" target="_blank"><img src="<?php echo plugins_url(); ?>/youtube-embed/images/themefuse_banner.jpg" alt="ThemeFuse.com - Premium WordPress Themes" title="ThemeFuse.com - Premium WordPress Themes" style="float: left; padding-right: 10px;"></a>
|
19 |
+
<h3>Donate</h3>
|
20 |
+
<p>If you like this plugin and appreciate the effort being put into it, <a href="http://www.artiss.co.uk/donate">please consider donating</a>. You can donate via PayPal or purchase something from my Amazon Wish List.</p>
|
21 |
+
<h3>Follow Me</h3>
|
22 |
+
<p>Please stay in touch with the latest news via one of the following social streams...</p>
|
23 |
+
<p align="center">
|
24 |
+
<a href="http://www.twitter.com/artiss_tech"><img src="<?php echo plugins_url(); ?>/youtube-embed/images/Twitter.png" alt="Follow Artiss.co.uk on Twitter" title="Follow Artiss.co.uk on Twitter" style="margin-right: 20px;"></a>
|
25 |
+
<a href="http://www.facebook.com/artiss.co.uk"><img src="<?php echo plugins_url(); ?>/youtube-embed/images/Facebook.png" alt="Follow Artiss.co.uk on Facebook" title="Follow Artiss.co.uk on Facebook" style="margin-right: 20px;"></a>
|
26 |
+
<a href="https://plus.google.com/108446415028687420620?rel=author"><img src="<?php echo plugins_url(); ?>/youtube-embed/images/Google+.png" alt="Follow Artiss.co.uk on Google+" title="Follow Artiss.co.uk on Google+" style="margin-right: 20px;"></a>
|
27 |
+
<a href="http://www.artiss.co.uk/feed"><img src="<?php echo plugins_url(); ?>/youtube-embed/images/RSS.png" alt="Follow Artiss.co.uk on RSS feed" title="Follow Artiss.co.uk on RSS feed"></a>
|
28 |
+
</p>
|
29 |
+
</div><br/>
|
30 |
|
31 |
<?php
|
32 |
// Set current profile number
|
36 |
// If options have been updated on screen, update the database
|
37 |
if ( ( !empty( $_POST[ 'Submit' ] ) ) && ( check_admin_referer( 'youtube-embed-profile' , 'youtube_embed_profile_nonce' ) ) ) {
|
38 |
|
39 |
+
if ( !empty( $_POST[ 'youtube_embed_name' ] ) ) { $options[ 'name' ] = $_POST[ 'youtube_embed_name' ]; }
|
40 |
+
if ( !empty( $_POST[ 'youtube_embed_type' ] ) ) { $options[ 'type' ] = $_POST[ 'youtube_embed_type' ]; }
|
41 |
+
if ( !empty( $_POST[ 'youtube_embed_playlist' ] ) ) { $options[ 'playlist' ] = $_POST[ 'youtube_embed_playlist' ]; }
|
|
|
42 |
$options[ 'width' ] = $_POST[ 'youtube_embed_width' ];
|
43 |
+
$options[ 'height' ] = $_POST[ 'youtube_embed_height' ];
|
44 |
|
45 |
+
$options[ 'template' ] = htmlspecialchars_decode( $_POST[ 'youtube_embed_template' ] );
|
46 |
if ( strpos( $options[ 'template' ], '%video%' ) === false ) { $options[ 'template' ] = '%video%'; }
|
47 |
|
48 |
+
$options[ 'style' ] = $_POST[ 'youtube_embed_style' ];
|
49 |
+
$options[ 'fullscreen' ] = $_POST[ 'youtube_embed_fullscreen' ];
|
50 |
+
$options[ 'autoplay'] = $_POST[ 'youtube_embed_autoplay' ];
|
51 |
+
$options[ 'loop'] = $_POST[ 'youtube_embed_loop' ];
|
52 |
+
$options[ 'cc'] = $_POST[ 'youtube_embed_cc' ];
|
53 |
+
$options[ 'annotation'] = $_POST[ 'youtube_embed_annotation' ];
|
54 |
+
$options[ 'related'] = $_POST[ 'youtube_embed_related' ];
|
55 |
+
$options[ 'info'] = $_POST[ 'youtube_embed_info' ];
|
56 |
+
$options[ 'link'] = $_POST[ 'youtube_embed_link' ];
|
57 |
+
$options[ 'react'] = $_POST[ 'youtube_embed_react' ];
|
58 |
+
$options[ 'sweetspot'] = $_POST[ 'youtube_embed_sweetspot' ];
|
59 |
+
$options[ 'disablekb'] = $_POST[ 'youtube_embed_disablekb' ];
|
60 |
+
if ( !empty( $_POST[ 'youtube_embed_autohide' ] ) ) { $options[ 'autohide'] = $_POST[ 'youtube_embed_autohide' ]; }
|
61 |
+
$options[ 'controls'] = $_POST[ 'youtube_embed_controls' ];
|
62 |
+
if ( !empty( $_POST[ 'youtube_embed_fallback' ] ) ) { $options[ 'fallback'] = $_POST[ 'youtube_embed_fallback' ]; }
|
63 |
+
if ( !empty( $_POST[ 'youtube_embed_wmode' ] ) ) { $options[ 'wmode'] = $_POST[ 'youtube_embed_wmode' ]; }
|
64 |
+
$options[ 'audio'] = $_POST[ 'youtube_embed_audio' ];
|
65 |
+
$options[ 'hd'] = $_POST[ 'youtube_embed_hd' ];
|
66 |
+
if ( !empty( $_POST[ 'youtube_embed_color' ] ) ) { $options[ 'color' ] = $_POST[ 'youtube_embed_color' ]; }
|
67 |
+
if ( !empty( $_POST[ 'youtube_embed_theme' ] ) ) { $options[ 'theme' ] = $_POST[ 'youtube_embed_theme' ]; }
|
68 |
+
$options[ 'https' ] = $_POST[ 'youtube_embed_https' ];
|
69 |
+
$options[ 'modest' ] = $_POST[ 'youtube_embed_modest' ];
|
70 |
+
$options[ 'dynamic' ] = $_POST[ 'youtube_embed_dynamic' ];
|
71 |
+
$options[ 'fixed' ] = $_POST[ 'youtube_embed_fixed' ];
|
72 |
+
|
73 |
+
if ( !empty( $_POST[ 'youtube_embed_size' ] ) ) { $default_size = $_POST[ 'youtube_embed_size' ]; }
|
|
|
74 |
|
75 |
if ( $default_size !== '' ) {
|
76 |
$options[ 'width' ] = ltrim( substr( $default_size, 0, 4 ), '0' );
|
104 |
if ( !empty( $_POST[ 'Video' ] ) ) { $video_type = $_POST[ 'youtube_embed_video_type' ]; } else { $video_type = 'd'; }
|
105 |
|
106 |
// Fetch options into an array
|
107 |
+
$options = aye_set_profile_defaults( $profile_no );
|
108 |
+
$general = aye_set_general_defaults();
|
109 |
?>
|
110 |
|
111 |
+
<form method="post" action="<?php echo get_bloginfo( 'wpurl' ) . '/wp-admin/admin.php?page=aye-profile-options' ?>">
|
112 |
|
113 |
<span class="alignright">
|
114 |
<select name="youtube_embed_profile_no">
|
115 |
+
<?php aye_generate_profile_list( $profile_no, $general[ 'profile_no' ] ) ?>
|
116 |
</select>
|
117 |
<input type="submit" name="Profile" class="button-secondary" value="<?php _e('Change profile'); ?>"/>
|
118 |
</span><br/>
|
119 |
|
120 |
<?php
|
121 |
+
if ( $profile_no == '0' ) {
|
122 |
+
_e( 'These are the options for the default profile.' );
|
123 |
+
} else {
|
124 |
+
sprintf( _e( 'These are the options for profile %s.' ), $profile_no );
|
125 |
+
}
|
126 |
+
echo ' ' . __( 'Use the drop-down on the right hand side to swap between profiles.' );
|
127 |
?>
|
128 |
|
129 |
<table class="form-table">
|
137 |
<tr valign="top">
|
138 |
<th scope="row"><?php _e( 'Video Embed Type' ); ?></th>
|
139 |
<td><span class="description"><?php _e( 'The type of player to use for videos.' ); ?></span><br/>
|
140 |
+
<input type="radio" name="youtube_embed_type" value="v"<?php if ( $options[ 'type' ] == "v" ) { echo ' checked="checked"'; } ?>/><?php echo ' ' . __( 'IFRAME' ); ?><span class="description"><?php echo ' ' . __( 'Uses HTML5, if available. Alternatively, uses AS3 Flash player. This is the current YouTube default..' ); ?></span><br/>
|
141 |
+
<input type="radio" name="youtube_embed_type" value="p"<?php if ( $options[ 'type' ] == "p" ) { echo ' checked="checked"'; } ?>/><?php echo ' ' . __( 'OBJECT' ); ?><span class="description"><?php echo ' ' . __( 'Use the AS3 Flash player.' ); ?></span><br/>
|
142 |
+
<input type="radio" name="youtube_embed_type" value="c"<?php if ( $options[ 'type' ] == "c" ) { echo ' checked="checked"'; } ?>/><?php echo ' ' . __( 'Chromeless' ); ?><span class="description"><?php echo ' ' . __( 'Use the <a href="http://www.artiss.co.uk/artiss-youtube-embed/further-help#ye-chromeless">Chromeless</a> version of the AS3 Flash Player.' ); ?></span><br/>
|
143 |
+
<input type="radio" name="youtube_embed_type" value="m"<?php if ( $options[ 'type' ] == "m" ) { echo ' checked="checked"'; } ?>/><?php echo ' ' . __( 'EmbedPlus' ); ?><span class="description"><?php echo ' ' . __( 'Use <a href="http://www.artiss.co.uk/artiss-youtube-embed/further-help#ye-embedplus">EmbedPlus</a>, if Flash is available.' ); ?></span>
|
144 |
</td>
|
145 |
</tr>
|
146 |
|
147 |
<tr valign="top">
|
148 |
<th scope="row"><?php _e( 'Playlist Embed Type' ); ?></th>
|
149 |
<td><span class="description"><?php _e( 'The type of player to use when showing playlists.' ); ?></span><br/>
|
150 |
+
<input type="radio" name="youtube_embed_playlist" value="v"<?php if ( $options[ 'playlist' ] == "v" ) { echo ' checked="checked"'; } ?>/><?php echo ' ' . __( 'IFRAME' ); ?><br/>
|
151 |
+
<input type="radio" name="youtube_embed_playlist" value="o"<?php if ( $options[ 'playlist' ] == "o" ) { echo ' checked="checked"'; } ?>/><?php echo ' ' . __( 'OBJECT' ); ?><br/>
|
152 |
</td>
|
153 |
</tr>
|
154 |
</table>
|
155 |
|
156 |
+
<br/><span class="yt_heading"><?php _e( 'Options For All Player Types' ); ?></span>
|
157 |
|
158 |
<table class="form-table">
|
159 |
<tr>
|
177 |
<th scope="row"><?php _e( 'Default Sizes' ); ?></th>
|
178 |
<td><select name="youtube_embed_size">
|
179 |
<option value=""<?php if ( $default_size == '' ) { echo " selected='selected'"; } ?>><?php _e( 'Use above sizes' ); ?></option>
|
180 |
+
<option value="04800385"<?php if ( $default_size == "04800385" ) { echo " selected='selected'"; } ?>><?php echo '480x385 4:3'; ?></option>
|
181 |
+
<option value="05600340"<?php if ( $default_size == "05600340" ) { echo " selected='selected'"; } ?>><?php echo '560x340 16:9'; ?></option>
|
182 |
+
<option value="06400385"<?php if ( $default_size == "06400385" ) { echo " selected='selected'"; } ?>><?php echo '640x385 16:9'; ?></option>
|
183 |
+
<option value="08530505"<?php if ( $default_size == "08530505" ) { echo " selected='selected'"; } ?>><?php echo '853x505 16:9'; ?></option>
|
184 |
+
<option value="12800745"<?php if ( $default_size == "12800745" ) { echo " selected='selected'"; } ?>><?php echo '1280x745 16:9'; ?></option>
|
185 |
</select> <span class="description"><?php _e( 'Select one of these default sizes to override the above video sizes' ); ?></span></td>
|
186 |
</tr>
|
187 |
|
210 |
|
211 |
</table>
|
212 |
|
213 |
+
<br/><span class="yt_heading"><?php _e( 'Options Not Supported by EmbedPlus' ); ?></span>
|
|
|
214 |
|
215 |
<table class="form-table">
|
216 |
|
238 |
<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' ); ?></span></td>
|
239 |
</tr>
|
240 |
|
241 |
+
<tr>
|
242 |
+
<th scope="row"><?php _e( 'Information' ); ?></th>
|
243 |
+
<td><input type="checkbox" name="youtube_embed_info" value="1"<?php if ( $options[ 'info' ] == "1" ) { echo ' checked="checked"'; } ?>/> <span class="description"><?php _e( 'Display the video title and uploader before the video starts' ); ?></span></td>
|
244 |
+
</tr>
|
245 |
+
|
246 |
<tr>
|
247 |
<th scope="row"><?php _e( 'Theme' ); ?></th>
|
248 |
<td><select name="youtube_embed_theme">
|
252 |
</tr>
|
253 |
</table>
|
254 |
|
255 |
+
<br/><span class="yt_heading"><?php _e( 'Options for AS3 Player' ); ?></span>
|
256 |
<br/><br/>The following options are not supported if using EmbedPlus or if the IFRAME player uses HTML5.
|
257 |
|
258 |
<table class="form-table">
|
277 |
</tr>
|
278 |
|
279 |
<tr>
|
280 |
+
<th scope="row"><?php _e( 'Link to YouTube' ); ?></th>
|
281 |
+
<td><input type="checkbox" name="youtube_embed_link" value="1"<?php if ( $options[ 'link' ] == "1" ) { echo ' checked="checked"'; } ?>/> <span class="description"><?php _e( 'Video links back to YouTube when clicked' ); ?></span></td>
|
282 |
</tr>
|
283 |
|
284 |
<tr>
|
285 |
+
<th scope="row"><?php _e( 'Modest Branding' ); ?></th>
|
286 |
+
<td><input type="checkbox" name="youtube_embed_modest" value="1"<?php if ( $options[ 'modest' ] == "1" ) { echo ' checked="checked"'; } ?>/> <span class="description"><?php _e( 'Reduce branding on video.' ); ?></span></td>
|
287 |
</tr>
|
288 |
|
289 |
<tr>
|
300 |
</tr>
|
301 |
</table>
|
302 |
|
303 |
+
<br/><span class="yt_heading"><?php _e( 'Options Not Supported by HTML5 Player' ); ?></span>
|
|
|
304 |
|
305 |
<table class="form-table">
|
306 |
<tr valign="top">
|
312 |
</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>.' ); ?></span></td>
|
313 |
</tr>
|
314 |
|
|
|
|
|
|
|
|
|
315 |
</table>
|
316 |
|
317 |
+
<br/><span class="yt_heading"><?php _e( 'Options Only Supported By EmbedPlus' ); ?></span> <span class="description"><?php echo '<a href="http://www.artiss.co.uk/artiss-youtube-embed/further-help#ye-embedplus">' . __( 'Learn more about EmbedPlus' ) . '</a>'; ?></span>
|
318 |
|
319 |
<table class="form-table">
|
320 |
<tr valign="top">
|
321 |
<th scope="row"><?php _e( 'Fallback Embed Type' ); ?></th>
|
322 |
<td><span class="description"><?php _e( 'The type of player to use if Flash is not available and EmbedPlus cannot be used.' ); ?></span><br/>
|
323 |
+
<input type="radio" name="youtube_embed_fallback" value="v"<?php if ( $options[ 'fallback' ] == "v" ) { echo ' checked="checked"'; } ?>/> <?php _e( 'IFRAME' ); ?><br/>
|
324 |
+
<input type="radio" name="youtube_embed_fallback" value="p"<?php if ( $options[ 'fallback' ] == "p" ) { echo ' checked="checked"'; } ?>/> <?php _e( 'OBJECT' ); ?></td>
|
325 |
</tr>
|
326 |
|
327 |
<tr>
|
346 |
|
347 |
</form>
|
348 |
|
349 |
+
<div class="updated fade"><p><strong><?php _e( 'Would you like the video below to be yours? <a href="http://www.artiss.co.uk/contact">Contact me</a> for sponsorship information.' ); ?></strong></p></div>
|
350 |
+
|
351 |
<a href="#" name="video"></a>
|
352 |
+
<form method="post" action="<?php echo get_bloginfo( 'wpurl' ).'/wp-admin/admin.php?page=aye-profile-options#video' ?>">
|
353 |
<div class="ytbox_grey">
|
354 |
<h3><?php _e( 'YouTube Video Sample' ); ?></h3>
|
355 |
<p><?php _e( 'This uses the above settings, once they have been saved. <b>Would you like this to be your video? If so, <a href="http://www.artiss.co.uk/contact">contact me</a>!</b>' ); ?></p>
|
364 |
<input type="submit" name="Video" class="button-secondary" value="<?php _e( 'Change video' ); ?>"/></p>
|
365 |
|
366 |
<p><?php
|
367 |
+
if ( $video_type == "d" ) { $id = '-0Xa4bHcJu8'; $type = ''; }
|
368 |
if ( $video_type == "p" ) { $id = 'YVvn8dpSAt0'; $type = 'm'; }
|
369 |
if ( $video_type == "3" ) { $id = 'NR5UoBY87GM'; $type = ''; ; }
|
370 |
if ( $video_type == "l" ) { $id = '095393D5B42B2266'; $type = ''; }
|
371 |
+
echo aye_generate_youtube_code( $id, $type, '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', $profile_no );
|
372 |
?></p>
|
373 |
</div>
|
374 |
|
includes/{options-widgets.php → aye-options-widgets.php}
RENAMED
@@ -2,9 +2,9 @@
|
|
2 |
|
3 |
// Set default options
|
4 |
|
5 |
-
$default = array( 'titles' => 'YouTube', 'video_title' => '', 'id' => '', 'profile' => '', 'type' => '', 'template' => '', 'style' => '', 'start' => '', 'autoplay' => '', 'width' => '', 'height' => '', 'dynamic' => '', 'list' => '', 'loop' => '', 'stop' => '' );
|
6 |
$instance = wp_parse_args( ( array ) $instance, $default );
|
7 |
-
$general =
|
8 |
|
9 |
// Widget Title field
|
10 |
|
@@ -22,14 +22,30 @@ echo "\r\n" . '<p><label for="' . $field_id . '">' . __( 'Video Title' ) . ': </
|
|
22 |
|
23 |
$field_id = $this -> get_field_id( 'id' );
|
24 |
$field_name = $this -> get_field_name( 'id' );
|
25 |
-
echo "\r\n" . '<p><label for="' . $field_id . '">' . __( 'Video
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
26 |
|
27 |
// Profile field
|
28 |
|
29 |
$field_id = $this -> get_field_id( 'profile' );
|
30 |
$field_name = $this -> get_field_name( 'profile' );
|
31 |
echo "\r\n" . '<p><label for="' . $field_id . '">' . __( 'Profile' ) . ': </label><select name="' . $field_name . '" class="widefat" id="' . $field_id . '">';
|
32 |
-
|
33 |
echo '</select></p>';
|
34 |
|
35 |
// Template
|
@@ -102,6 +118,12 @@ $field_id = $this -> get_field_id( 'start' );
|
|
102 |
$field_name = $this -> get_field_name( 'start' );
|
103 |
echo "\r\n" . '<tr><td width="100%">' . __( 'Start (seconds)' ) . '</td><td><input type="text" size="3" maxlength="3" id="' . $field_id . '" name="' . $field_name . '" value="' . attribute_escape( $instance[ 'start' ] ) . '" /></td></tr>';
|
104 |
|
|
|
|
|
|
|
|
|
|
|
|
|
105 |
echo "</table>\n";
|
106 |
|
107 |
?>
|
@@ -136,18 +158,5 @@ echo '>' . __( 'No' ) . '</option><option value="1"';
|
|
136 |
if ( attribute_escape( $instance[ 'loop' ] ) == '1' ) { echo " selected='selected'"; }
|
137 |
echo '>' . __( 'Yes' ) . '</option></select></td></tr>';
|
138 |
|
139 |
-
echo "</table>\n";
|
140 |
-
?>
|
141 |
-
<h4><?php _e('EmbedPlus Options'); ?></h4>
|
142 |
-
<?php
|
143 |
-
|
144 |
-
echo "<table>\n";
|
145 |
-
|
146 |
-
// Stop field
|
147 |
-
|
148 |
-
$field_id = $this -> get_field_id( 'stop' );
|
149 |
-
$field_name = $this -> get_field_name( 'stop' );
|
150 |
-
echo "\r\n" . '<tr><td width="100%">' . __( 'Stop (seconds)' ) . '</td><td><input type="text" size="3" maxlength="3" id="' . $field_id . '" name="' . $field_name . '" value="' . attribute_escape( $instance[ 'stop' ] ) . '" /></td></tr>';
|
151 |
-
|
152 |
echo "</table>\n";
|
153 |
?>
|
2 |
|
3 |
// Set default options
|
4 |
|
5 |
+
$default = array( 'titles' => 'YouTube', 'video_title' => '', 'id' => '', 'profile' => '', 'type' => '', 'template' => '', 'style' => '', 'start' => '', 'autoplay' => '', 'width' => '', 'height' => '', 'dynamic' => '', 'list' => '', 'loop' => '', 'stop' => '', 'id_type' => '' );
|
6 |
$instance = wp_parse_args( ( array ) $instance, $default );
|
7 |
+
$general = aye_set_general_defaults();
|
8 |
|
9 |
// Widget Title field
|
10 |
|
22 |
|
23 |
$field_id = $this -> get_field_id( 'id' );
|
24 |
$field_name = $this -> get_field_name( 'id' );
|
25 |
+
echo "\r\n" . '<p><label for="' . $field_id . '">' . __( 'Video ID' ) . ': </label><input type="text" class="widefat" id="' . $field_id . '" name="' . $field_name . '" value="' . attribute_escape( $instance[ 'id' ] ) . '" /></p>';
|
26 |
+
|
27 |
+
echo "<table>\n";
|
28 |
+
|
29 |
+
// ID Type
|
30 |
+
|
31 |
+
$field_id = $this -> get_field_id( 'id_type' );
|
32 |
+
$field_name = $this -> get_field_name( 'id_type' );
|
33 |
+
echo "\r\n" . '<tr><td width="100%">' . __( 'ID Type' ) . '</td><td><select name="' . $field_name . '" id="' . $field_id . '"><option value="v"';
|
34 |
+
if ( attribute_escape( $instance[ 'id_type' ] ) == 'v' ) { echo " selected='selected'"; }
|
35 |
+
echo '>' . __( 'Video or Playlist' ) . '</option><option value="s"';
|
36 |
+
if ( attribute_escape( $instance[ 'id_type' ] ) == 's' ) { echo " selected='selected'"; }
|
37 |
+
echo '>' . __( 'Search' ) . '</option><option value="u"';
|
38 |
+
if ( attribute_escape( $instance[ 'id_type' ] ) == 'u' ) { echo " selected='selected'"; }
|
39 |
+
echo '>' . __( 'User' ) . '</option></select></td></tr>';
|
40 |
+
|
41 |
+
echo "</table>\n";
|
42 |
|
43 |
// Profile field
|
44 |
|
45 |
$field_id = $this -> get_field_id( 'profile' );
|
46 |
$field_name = $this -> get_field_name( 'profile' );
|
47 |
echo "\r\n" . '<p><label for="' . $field_id . '">' . __( 'Profile' ) . ': </label><select name="' . $field_name . '" class="widefat" id="' . $field_id . '">';
|
48 |
+
aye_generate_profile_list( attribute_escape( $instance[ 'profile' ] ), $general[ 'profile_no' ] );
|
49 |
echo '</select></p>';
|
50 |
|
51 |
// Template
|
118 |
$field_name = $this -> get_field_name( 'start' );
|
119 |
echo "\r\n" . '<tr><td width="100%">' . __( 'Start (seconds)' ) . '</td><td><input type="text" size="3" maxlength="3" id="' . $field_id . '" name="' . $field_name . '" value="' . attribute_escape( $instance[ 'start' ] ) . '" /></td></tr>';
|
120 |
|
121 |
+
// Stop field
|
122 |
+
|
123 |
+
$field_id = $this -> get_field_id( 'stop' );
|
124 |
+
$field_name = $this -> get_field_name( 'stop' );
|
125 |
+
echo "\r\n" . '<tr><td width="100%">' . __( 'Stop (seconds)' ) . '</td><td><input type="text" size="3" maxlength="3" id="' . $field_id . '" name="' . $field_name . '" value="' . attribute_escape( $instance[ 'stop' ] ) . '" /></td></tr>';
|
126 |
+
|
127 |
echo "</table>\n";
|
128 |
|
129 |
?>
|
158 |
if ( attribute_escape( $instance[ 'loop' ] ) == '1' ) { echo " selected='selected'"; }
|
159 |
echo '>' . __( 'Yes' ) . '</option></select></td></tr>';
|
160 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
161 |
echo "</table>\n";
|
162 |
?>
|
includes/{set-option-defaults.php → aye-set-defaults.php}
RENAMED
@@ -4,7 +4,7 @@
|
|
4 |
*
|
5 |
* Set up default values for the various options
|
6 |
*
|
7 |
-
* @package
|
8 |
*/
|
9 |
|
10 |
/**
|
@@ -17,11 +17,12 @@
|
|
17 |
* @return string Alternative Shortcode
|
18 |
*/
|
19 |
|
20 |
-
function
|
21 |
|
22 |
$shortcode = get_option( 'youtube_embed_shortcode' );
|
23 |
|
24 |
// If setting doesn't exist, set defaults
|
|
|
25 |
if ( $shortcode == '' ) {
|
26 |
$shortcode[ 1 ] = 'youtube_video';
|
27 |
$shortcode[ 2 ] = '';
|
@@ -41,11 +42,12 @@ function ye_set_shortcode_option() {
|
|
41 |
* @return string URL override
|
42 |
*/
|
43 |
|
44 |
-
function
|
45 |
|
46 |
$url = get_option( 'youtube_embed_url' );
|
47 |
|
48 |
// If setting doesn't exist, set defaults
|
|
|
49 |
if ( $url == '' ) { update_option( 'youtube_embed_url', '' ); }
|
50 |
|
51 |
return $url;
|
@@ -61,7 +63,7 @@ function ye_set_url_option() {
|
|
61 |
* @return strings Options array
|
62 |
*/
|
63 |
|
64 |
-
function
|
65 |
$options = get_option( 'youtube_embed_general' );
|
66 |
$changed = false;
|
67 |
$default_error = htmlspecialchars( '<p>The video cannot be shown at the moment. Please try again later.</p>' );
|
@@ -75,7 +77,7 @@ function ye_set_general_defaults() {
|
|
75 |
$changed = true;
|
76 |
} else {
|
77 |
// If array doesn't exist, set defaults
|
78 |
-
$options = array( 'editor_button' => 1, 'admin_bar' => 1, 'profile_no' => 5, 'list_no' => 5, 'info_cache' => 1, 'embed_cache' => 24, 'transcript_cache' => 24, 'alt_profile' => 0, 'alt_profile2' => 0, 'bracket' => '', 'alt' => 0, '
|
79 |
$changed = true;
|
80 |
}
|
81 |
}
|
@@ -97,7 +99,6 @@ function ye_set_general_defaults() {
|
|
97 |
if ( !array_key_exists( 'transcript_cache', $options ) ) { $options[ 'transcript_cache' ] = 24; $changed = true; }
|
98 |
if ( !array_key_exists( 'alt_profile', $options ) ) { $options[ 'alt_profile' ] = 0; $changed = true; }
|
99 |
if ( !array_key_exists( 'alt_profile2', $options ) ) { $options[ 'alt_profile2' ] = 0; $changed = true; }
|
100 |
-
if ( !array_key_exists( 'url_profile', $options ) ) { $options[ 'url_profile' ] = 0; $changed = true; }
|
101 |
if ( !array_key_exists( 'other_profile', $options ) ) { $options[ 'other_profile' ] = 0; $changed = true; }
|
102 |
if ( !array_key_exists( 'comments_profile', $options ) ) { $options[ 'comments_profile' ] = 0; $changed = true; }
|
103 |
if ( !array_key_exists( 'metadata', $options ) ) { $options[ 'metadata' ] = 1; $changed = true; }
|
@@ -105,6 +106,7 @@ function ye_set_general_defaults() {
|
|
105 |
if ( !array_key_exists( 'api', $options ) ) { $options[ 'api' ] = 1; $changed = true; }
|
106 |
if ( !array_key_exists( 'error_message', $options ) ) { $options[ 'error_message' ] = $default_error; $changed = true; }
|
107 |
if ( !array_key_exists( 'thumbnail', $options ) ) { $options[ 'thumbnail' ] = 2; $changed = true; }
|
|
|
108 |
|
109 |
// Update the options, if changed, and return the result
|
110 |
if ( $changed ) { update_option( 'youtube_embed_general', $options ); }
|
@@ -123,7 +125,7 @@ function ye_set_general_defaults() {
|
|
123 |
* @return string Options array
|
124 |
*/
|
125 |
|
126 |
-
function
|
127 |
if ( $profile == 0 ) {
|
128 |
$profname = 'Default';
|
129 |
} else {
|
@@ -150,7 +152,7 @@ function ye_set_profile_defaults( $profile ) {
|
|
150 |
$changed = true;
|
151 |
} else {
|
152 |
// If array doesn't exist, set defaults
|
153 |
-
$options = array( 'width' => $width, 'height' => $height, 'fullscreen' => '', 'template' => '%video%', 'autoplay' => '', 'start' => '0', 'loop' => '', 'cc' => '', 'annotation' => '1', 'related' => '', 'info' => '1', 'link' => '1', 'react' => '1', 'stop' => '0', 'sweetspot' => '1', 'type' => 'v', 'disablekb' => '', 'autohide' => '2', 'controls' => '1', 'playlist' => 'v', 'fallback' => 'v', 'wmode' => '
|
154 |
$changed = true;
|
155 |
}
|
156 |
}
|
@@ -176,7 +178,7 @@ function ye_set_profile_defaults( $profile ) {
|
|
176 |
if ( !array_key_exists( 'controls', $options ) ) { $options[ 'controls' ] = '1'; $changed = true; }
|
177 |
if ( !array_key_exists( 'playlist', $options ) ) { $options[ 'playlist' ] = 'v'; $changed = true; }
|
178 |
if ( !array_key_exists( 'fallback', $options ) ) { $options[ 'fallback' ] = 'v'; $changed = true; }
|
179 |
-
if ( !array_key_exists( 'wmode', $options ) ) { $options[ 'wmode' ] = '
|
180 |
if ( !array_key_exists( 'template', $options ) ) { $options[ 'template' ] = '%video%'; $changed = true; }
|
181 |
if ( !array_key_exists( 'hd', $options ) ) { $options[ 'hd' ] = '1'; $changed = true; }
|
182 |
if ( !array_key_exists( 'color', $options ) ) { $options[ 'color' ] = 'red'; $changed = true; }
|
@@ -204,7 +206,7 @@ function ye_set_profile_defaults( $profile ) {
|
|
204 |
* @return string Options array
|
205 |
*/
|
206 |
|
207 |
-
function
|
208 |
$options = get_option( 'youtube_embed_list' . $list );
|
209 |
$changed = false;
|
210 |
|
4 |
*
|
5 |
* Set up default values for the various options
|
6 |
*
|
7 |
+
* @package Artiss-YouTube-Embed
|
8 |
*/
|
9 |
|
10 |
/**
|
17 |
* @return string Alternative Shortcode
|
18 |
*/
|
19 |
|
20 |
+
function aye_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 ] = '';
|
42 |
* @return string URL override
|
43 |
*/
|
44 |
|
45 |
+
function aye_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;
|
63 |
* @return strings Options array
|
64 |
*/
|
65 |
|
66 |
+
function aye_set_general_defaults() {
|
67 |
$options = get_option( 'youtube_embed_general' );
|
68 |
$changed = false;
|
69 |
$default_error = htmlspecialchars( '<p>The video cannot be shown at the moment. Please try again later.</p>' );
|
77 |
$changed = true;
|
78 |
} else {
|
79 |
// If array doesn't exist, set defaults
|
80 |
+
$options = array( 'editor_button' => 1, 'admin_bar' => 1, 'profile_no' => 5, 'list_no' => 5, 'info_cache' => 1, 'embed_cache' => 24, 'transcript_cache' => 24, 'alt_profile' => 0, 'alt_profile2' => 0, 'bracket' => '', 'alt' => 0, 'other_profile' => 0, 'comments' => '', 'comments_profile' => 0, 'metadata' => 1, 'feed' => 'b', 'api' => 1, 'error_message' => $default_error, 'thumbnail' => 2, 'privacy' => 0, 'frameborder' => 1 );
|
81 |
$changed = true;
|
82 |
}
|
83 |
}
|
99 |
if ( !array_key_exists( 'transcript_cache', $options ) ) { $options[ 'transcript_cache' ] = 24; $changed = true; }
|
100 |
if ( !array_key_exists( 'alt_profile', $options ) ) { $options[ 'alt_profile' ] = 0; $changed = true; }
|
101 |
if ( !array_key_exists( 'alt_profile2', $options ) ) { $options[ 'alt_profile2' ] = 0; $changed = true; }
|
|
|
102 |
if ( !array_key_exists( 'other_profile', $options ) ) { $options[ 'other_profile' ] = 0; $changed = true; }
|
103 |
if ( !array_key_exists( 'comments_profile', $options ) ) { $options[ 'comments_profile' ] = 0; $changed = true; }
|
104 |
if ( !array_key_exists( 'metadata', $options ) ) { $options[ 'metadata' ] = 1; $changed = true; }
|
106 |
if ( !array_key_exists( 'api', $options ) ) { $options[ 'api' ] = 1; $changed = true; }
|
107 |
if ( !array_key_exists( 'error_message', $options ) ) { $options[ 'error_message' ] = $default_error; $changed = true; }
|
108 |
if ( !array_key_exists( 'thumbnail', $options ) ) { $options[ 'thumbnail' ] = 2; $changed = true; }
|
109 |
+
if ( !array_key_exists( 'frameborder', $options ) ) { $options[ 'frameborder' ] = 1; $changed = true; }
|
110 |
|
111 |
// Update the options, if changed, and return the result
|
112 |
if ( $changed ) { update_option( 'youtube_embed_general', $options ); }
|
125 |
* @return string Options array
|
126 |
*/
|
127 |
|
128 |
+
function aye_set_profile_defaults( $profile ) {
|
129 |
if ( $profile == 0 ) {
|
130 |
$profname = 'Default';
|
131 |
} else {
|
152 |
$changed = true;
|
153 |
} else {
|
154 |
// If array doesn't exist, set defaults
|
155 |
+
$options = array( 'width' => $width, 'height' => $height, 'fullscreen' => '', 'template' => '%video%', 'autoplay' => '', 'start' => '0', 'loop' => '', 'cc' => '', 'annotation' => '1', 'related' => '', 'info' => '1', 'link' => '1', 'react' => '1', 'stop' => '0', 'sweetspot' => '1', 'type' => 'v', 'disablekb' => '', 'autohide' => '2', 'controls' => '1', 'playlist' => 'v', 'fallback' => 'v', 'wmode' => 'window', 'audio' => '', 'hd' => '1', 'style' => '', 'color' => 'red', 'theme' => 'dark', 'https' => '0', 'modest' => '1', 'dynamic' => '', 'fixed' => '' );
|
156 |
$changed = true;
|
157 |
}
|
158 |
}
|
178 |
if ( !array_key_exists( 'controls', $options ) ) { $options[ 'controls' ] = '1'; $changed = true; }
|
179 |
if ( !array_key_exists( 'playlist', $options ) ) { $options[ 'playlist' ] = 'v'; $changed = true; }
|
180 |
if ( !array_key_exists( 'fallback', $options ) ) { $options[ 'fallback' ] = 'v'; $changed = true; }
|
181 |
+
if ( !array_key_exists( 'wmode', $options ) ) { $options[ 'wmode' ] = 'window'; $changed = true; }
|
182 |
if ( !array_key_exists( 'template', $options ) ) { $options[ 'template' ] = '%video%'; $changed = true; }
|
183 |
if ( !array_key_exists( 'hd', $options ) ) { $options[ 'hd' ] = '1'; $changed = true; }
|
184 |
if ( !array_key_exists( 'color', $options ) ) { $options[ 'color' ] = 'red'; $changed = true; }
|
206 |
* @return string Options array
|
207 |
*/
|
208 |
|
209 |
+
function aye_set_list_defaults( $list ) {
|
210 |
$options = get_option( 'youtube_embed_list' . $list );
|
211 |
$changed = false;
|
212 |
|
includes/{shared.php → aye-shared-functions.php}
RENAMED
@@ -4,7 +4,7 @@
|
|
4 |
*
|
5 |
* Small utilities shared by a number of other functions
|
6 |
*
|
7 |
-
* @package
|
8 |
*/
|
9 |
|
10 |
/**
|
@@ -19,7 +19,7 @@
|
|
19 |
* @return string Parameter value (if found)
|
20 |
*/
|
21 |
|
22 |
-
function
|
23 |
|
24 |
$start = strpos( strtolower( $input ), $para . '=' );
|
25 |
$content = '';
|
@@ -45,11 +45,12 @@ function ye_get_parameters( $input, $para ) {
|
|
45 |
* @return string Extracted ID
|
46 |
*/
|
47 |
|
48 |
-
function
|
49 |
|
50 |
$id = trim( strip_tags( $id ) );
|
51 |
|
52 |
// Check if it's the full URL, as found in address bar
|
|
|
53 |
$video_pos = strpos( $id, 'youtube.com/watch?', 0 );
|
54 |
|
55 |
if ( $video_pos !== false ) {
|
@@ -65,6 +66,7 @@ function ye_extract_id( $id ) {
|
|
65 |
|
66 |
// Now check to see if it's a full URL, as used in the embed code
|
67 |
// Need to check both video and playlist formats
|
|
|
68 |
$video_pos = strpos( $id, 'youtube.com/v/' );
|
69 |
if ($video_pos === false) { $video_pos = strpos( $id, 'youtube.com/p/' ); }
|
70 |
|
@@ -80,6 +82,7 @@ function ye_extract_id( $id ) {
|
|
80 |
} else {
|
81 |
|
82 |
// Check if it's a shortened URL
|
|
|
83 |
$video_pos = strpos( $id, 'youtu.be/', 0 );
|
84 |
|
85 |
if ( $video_pos !== false ) {
|
@@ -95,6 +98,7 @@ function ye_extract_id( $id ) {
|
|
95 |
}
|
96 |
|
97 |
// Convert video ID characters
|
|
|
98 |
$id = str_replace( '–', '--', $id );
|
99 |
$id = str_replace( '×', 'x', $id );
|
100 |
|
@@ -109,30 +113,35 @@ function ye_extract_id( $id ) {
|
|
109 |
*
|
110 |
* @since 2.0
|
111 |
*
|
|
|
|
|
112 |
* @param string $id Video ID
|
113 |
* @param string $title_needed Whether the title requires extracting
|
114 |
* @return string Array containing file details
|
115 |
*/
|
116 |
|
117 |
-
function
|
118 |
|
119 |
$type = false;
|
120 |
$title = false;
|
121 |
$options = false;
|
122 |
|
123 |
-
$options =
|
124 |
|
125 |
// Attempt to get the video type and title from cache
|
|
|
126 |
if ( $options[ 'info_cache' ] != 0 ) {
|
127 |
-
$type = get_transient( '
|
128 |
-
$title = get_transient( '
|
129 |
}
|
130 |
|
131 |
// Check if items are cached
|
|
|
132 |
$cache = true;
|
133 |
if ( ( !$type ) or ( !$title ) ) { $cache = false; }
|
134 |
|
135 |
// Get video information if not cached
|
|
|
136 |
if ( !$cache ) {
|
137 |
|
138 |
$type = '-';
|
@@ -142,12 +151,15 @@ function ye_validate_id( $id, $title_needed = false ) {
|
|
142 |
if ( ( $options[ 'api' ] == 2 ) or ( $options[ 'api' ] == 4 ) ) { $https = 's'; } else { $https = ''; }
|
143 |
|
144 |
// Check with YouTube API as to whether the ID is a video
|
145 |
-
|
|
|
146 |
if ( $id_check[ 'rc' ] == 0 ) {
|
147 |
if ( $id_check[ 'response' ] != 200 ) {
|
148 |
|
149 |
// Check with YouTube API as to whether the ID is a playlist
|
150 |
-
|
|
|
|
|
151 |
if ( $id_check[ 'rc' ] == 0 ) {
|
152 |
if ( $id_check[ 'response' ] != 200 ) {
|
153 |
$type = '';
|
@@ -162,13 +174,19 @@ function ye_validate_id( $id, $title_needed = false ) {
|
|
162 |
}
|
163 |
|
164 |
// If no type has been assigned then an API error must have occured
|
|
|
165 |
if ( $type == '-' ) {
|
166 |
|
167 |
if ( ( $options[ 'api' ] == 1 ) or ( $options[ 'api' ] == 2 ) ) {
|
|
|
168 |
// If reporting API errors, output it
|
169 |
-
|
|
|
|
|
170 |
} else {
|
|
|
171 |
// If not reporting errors or API switched off, work out whether a video or playlist
|
|
|
172 |
$type = '';
|
173 |
if ( strlen( $id ) == 11 ) {
|
174 |
$type = 'v';
|
@@ -181,22 +199,26 @@ function ye_validate_id( $id, $title_needed = false ) {
|
|
181 |
}
|
182 |
|
183 |
// Update the cache
|
184 |
-
|
|
|
185 |
|
186 |
// If the video is valid extract the title from the XML
|
|
|
187 |
if ( ( $title_needed) && ( $id_check[ 'file' ] != '' ) ) {
|
188 |
|
189 |
// Find title in XML
|
190 |
-
|
|
|
191 |
if ( $tag_start !== false ) {
|
192 |
$tag_end = strpos( $id_check[ 'file' ], '</title>', $tag_start );
|
193 |
if ( $tag_end !== false ) {
|
194 |
-
$title = substr( $id_check[ 'file' ], $tag_start
|
195 |
}
|
196 |
}
|
197 |
|
198 |
// Update the cache
|
199 |
-
|
|
|
200 |
}
|
201 |
}
|
202 |
|
@@ -218,7 +240,7 @@ function ye_validate_id( $id, $title_needed = false ) {
|
|
218 |
* @return string Error output
|
219 |
*/
|
220 |
|
221 |
-
function
|
222 |
|
223 |
return '<p style="color: #f00; font-weight: bold;">Artiss YouTube Embed: ' . $errorin . "</p>\n";
|
224 |
|
@@ -231,15 +253,15 @@ function ye_error( $errorin ) {
|
|
231 |
*
|
232 |
* @since 2.0
|
233 |
*
|
234 |
-
* @uses
|
235 |
*
|
236 |
* @param string $input Input, usually Yes or No
|
237 |
* @return string 1, 0 or blank, depending on input
|
238 |
*/
|
239 |
|
240 |
-
function
|
241 |
|
242 |
-
$input =
|
243 |
$output = '';
|
244 |
if ( $input === true ) { $output = '1'; }
|
245 |
if ( $input === false ) { $output = '0'; }
|
@@ -254,15 +276,15 @@ function ye_convert( $input ) {
|
|
254 |
*
|
255 |
* @since 2.0
|
256 |
*
|
257 |
-
* @uses
|
258 |
*
|
259 |
* @param string $input Input, usually Yes or No
|
260 |
* @return string 1, 3 or blank, depending on input
|
261 |
*/
|
262 |
|
263 |
-
function
|
264 |
|
265 |
-
$input =
|
266 |
$output = '';
|
267 |
if ( $input === true ) { $output = '1'; }
|
268 |
if ( $input === false ) { $output = '3'; }
|
@@ -282,7 +304,7 @@ function ye_convert_3( $input ) {
|
|
282 |
* @return string Blank string or boolean true, false
|
283 |
*/
|
284 |
|
285 |
-
function
|
286 |
|
287 |
$input = strtolower( $input );
|
288 |
if ( ( $input === true ) or ( $input == 'true' ) or ( $input == '1' ) or ( $input == 'yes' ) or ( $input == 'on' ) ) { return true; }
|
@@ -304,7 +326,7 @@ function ye_yes_or_no( $input = '' ) {
|
|
304 |
* @return string Array containing file contents and response
|
305 |
*/
|
306 |
|
307 |
-
function
|
308 |
|
309 |
$rc = 0;
|
310 |
$error = '';
|
@@ -344,16 +366,16 @@ function ye_get_file( $filein, $header = false ) {
|
|
344 |
*
|
345 |
* @since 2.0
|
346 |
*
|
347 |
-
* @uses
|
348 |
*
|
349 |
* @param string $type Current embed type
|
350 |
* @param string $embedplus Whether EmbedPlus embedding is required
|
351 |
* @return string The type of embedding to use
|
352 |
*/
|
353 |
|
354 |
-
function
|
355 |
|
356 |
-
$embedplus =
|
357 |
$type = strtolower( $type );
|
358 |
|
359 |
if ( ( $type == 'embedplus' ) or ( $embedplus == '1' ) ) { $type = 'm'; }
|
@@ -375,7 +397,7 @@ function ye_get_embed_type( $type, $embedplus ) {
|
|
375 |
* @return string Autohide numeric equivalent
|
376 |
*/
|
377 |
|
378 |
-
function
|
379 |
|
380 |
$autohide = strtolower( $autohide );
|
381 |
if ( $autohide == 'no' ) { $autohide = '0'; }
|
@@ -396,18 +418,18 @@ function ye_set_autohide( $autohide ) {
|
|
396 |
* @param string $total The total number of profiles
|
397 |
*/
|
398 |
|
399 |
-
function
|
400 |
|
401 |
echo '<option value="0"';
|
402 |
if ( $current == "0" ) { echo " selected='selected'"; }
|
403 |
-
echo ' >'.__('Default').'</option>';
|
404 |
$loop = 1;
|
405 |
while ( $loop <= $total ) {
|
406 |
|
407 |
$profiles = get_option( 'youtube_embed_profile' . $loop );
|
408 |
$profname = $profiles[ 'name' ];
|
409 |
|
410 |
-
if ( $profname == '' ) { $profname =
|
411 |
if ( strlen( $profname ) > 30 ) { $profname = substr( $profname, 0, 30 ) . '…'; }
|
412 |
echo '<option value="' . $loop . '"';
|
413 |
|
4 |
*
|
5 |
* Small utilities shared by a number of other functions
|
6 |
*
|
7 |
+
* @package Artiss-YouTube-Embed
|
8 |
*/
|
9 |
|
10 |
/**
|
19 |
* @return string Parameter value (if found)
|
20 |
*/
|
21 |
|
22 |
+
function aye_get_parameters( $input, $para ) {
|
23 |
|
24 |
$start = strpos( strtolower( $input ), $para . '=' );
|
25 |
$content = '';
|
45 |
* @return string Extracted ID
|
46 |
*/
|
47 |
|
48 |
+
function aye_extract_id( $id ) {
|
49 |
|
50 |
$id = trim( strip_tags( $id ) );
|
51 |
|
52 |
// Check if it's the full URL, as found in address bar
|
53 |
+
|
54 |
$video_pos = strpos( $id, 'youtube.com/watch?', 0 );
|
55 |
|
56 |
if ( $video_pos !== false ) {
|
66 |
|
67 |
// Now check to see if it's a full URL, as used in the embed code
|
68 |
// Need to check both video and playlist formats
|
69 |
+
|
70 |
$video_pos = strpos( $id, 'youtube.com/v/' );
|
71 |
if ($video_pos === false) { $video_pos = strpos( $id, 'youtube.com/p/' ); }
|
72 |
|
82 |
} else {
|
83 |
|
84 |
// Check if it's a shortened URL
|
85 |
+
|
86 |
$video_pos = strpos( $id, 'youtu.be/', 0 );
|
87 |
|
88 |
if ( $video_pos !== false ) {
|
98 |
}
|
99 |
|
100 |
// Convert video ID characters
|
101 |
+
|
102 |
$id = str_replace( '–', '--', $id );
|
103 |
$id = str_replace( '×', 'x', $id );
|
104 |
|
113 |
*
|
114 |
* @since 2.0
|
115 |
*
|
116 |
+
* @uses aye_set_general_defaults Get the default settings
|
117 |
+
*
|
118 |
* @param string $id Video ID
|
119 |
* @param string $title_needed Whether the title requires extracting
|
120 |
* @return string Array containing file details
|
121 |
*/
|
122 |
|
123 |
+
function aye_validate_id( $id, $title_needed = false ) {
|
124 |
|
125 |
$type = false;
|
126 |
$title = false;
|
127 |
$options = false;
|
128 |
|
129 |
+
$options = aye_set_general_defaults();
|
130 |
|
131 |
// Attempt to get the video type and title from cache
|
132 |
+
|
133 |
if ( $options[ 'info_cache' ] != 0 ) {
|
134 |
+
$type = get_transient( 'aye_type_' . $id );
|
135 |
+
$title = get_transient( 'aye_title_' . $id );
|
136 |
}
|
137 |
|
138 |
// Check if items are cached
|
139 |
+
|
140 |
$cache = true;
|
141 |
if ( ( !$type ) or ( !$title ) ) { $cache = false; }
|
142 |
|
143 |
// Get video information if not cached
|
144 |
+
|
145 |
if ( !$cache ) {
|
146 |
|
147 |
$type = '-';
|
151 |
if ( ( $options[ 'api' ] == 2 ) or ( $options[ 'api' ] == 4 ) ) { $https = 's'; } else { $https = ''; }
|
152 |
|
153 |
// Check with YouTube API as to whether the ID is a video
|
154 |
+
|
155 |
+
$id_check = aye_get_file( 'http' . $https . '://gdata.youtube.com/feeds/api/videos/' . $id . '?v=2', false );
|
156 |
if ( $id_check[ 'rc' ] == 0 ) {
|
157 |
if ( $id_check[ 'response' ] != 200 ) {
|
158 |
|
159 |
// Check with YouTube API as to whether the ID is a playlist
|
160 |
+
|
161 |
+
if ( strtolower( substr( $id, 0, 2 ) ) == 'pl' ) { $id = substr( $id, 2 ); }
|
162 |
+
$id_check = aye_get_file( 'http' . $https . '://gdata.youtube.com/feeds/api/playlists/' . $id . '?v=2', false );
|
163 |
if ( $id_check[ 'rc' ] == 0 ) {
|
164 |
if ( $id_check[ 'response' ] != 200 ) {
|
165 |
$type = '';
|
174 |
}
|
175 |
|
176 |
// If no type has been assigned then an API error must have occured
|
177 |
+
|
178 |
if ( $type == '-' ) {
|
179 |
|
180 |
if ( ( $options[ 'api' ] == 1 ) or ( $options[ 'api' ] == 2 ) ) {
|
181 |
+
|
182 |
// If reporting API errors, output it
|
183 |
+
|
184 |
+
$type = sprintf( __('An error occurred accessing the YouTube API for video ID %s - %s' ), $id, $id_check[ 'error' ] );
|
185 |
+
|
186 |
} else {
|
187 |
+
|
188 |
// If not reporting errors or API switched off, work out whether a video or playlist
|
189 |
+
|
190 |
$type = '';
|
191 |
if ( strlen( $id ) == 11 ) {
|
192 |
$type = 'v';
|
199 |
}
|
200 |
|
201 |
// Update the cache
|
202 |
+
|
203 |
+
set_transient( 'aye_type_' . $id, $type, $options[ 'info_cache' ] * 3600 );
|
204 |
|
205 |
// If the video is valid extract the title from the XML
|
206 |
+
|
207 |
if ( ( $title_needed) && ( $id_check[ 'file' ] != '' ) ) {
|
208 |
|
209 |
// Find title in XML
|
210 |
+
|
211 |
+
$tag_start = strpos( $id_check[ 'file' ], '<title>', 1 ) + 7;
|
212 |
if ( $tag_start !== false ) {
|
213 |
$tag_end = strpos( $id_check[ 'file' ], '</title>', $tag_start );
|
214 |
if ( $tag_end !== false ) {
|
215 |
+
$title = substr( $id_check[ 'file' ], $tag_start, $tag_end - $tag_start );
|
216 |
}
|
217 |
}
|
218 |
|
219 |
// Update the cache
|
220 |
+
|
221 |
+
set_transient( 'aye_title_' . $id, $title, $options[ 'info_cache' ] * 3600 );
|
222 |
}
|
223 |
}
|
224 |
|
240 |
* @return string Error output
|
241 |
*/
|
242 |
|
243 |
+
function aye_error( $errorin ) {
|
244 |
|
245 |
return '<p style="color: #f00; font-weight: bold;">Artiss YouTube Embed: ' . $errorin . "</p>\n";
|
246 |
|
253 |
*
|
254 |
* @since 2.0
|
255 |
*
|
256 |
+
* @uses aye_yes_or_no Convert input to a true or false equivalent
|
257 |
*
|
258 |
* @param string $input Input, usually Yes or No
|
259 |
* @return string 1, 0 or blank, depending on input
|
260 |
*/
|
261 |
|
262 |
+
function aye_convert( $input ) {
|
263 |
|
264 |
+
$input = aye_yes_or_no( $input );
|
265 |
$output = '';
|
266 |
if ( $input === true ) { $output = '1'; }
|
267 |
if ( $input === false ) { $output = '0'; }
|
276 |
*
|
277 |
* @since 2.0
|
278 |
*
|
279 |
+
* @uses aye_yes_or_no Convert input to a true or false equivalent
|
280 |
*
|
281 |
* @param string $input Input, usually Yes or No
|
282 |
* @return string 1, 3 or blank, depending on input
|
283 |
*/
|
284 |
|
285 |
+
function aye_convert_3( $input ) {
|
286 |
|
287 |
+
$input = aye_yes_or_no( $input );
|
288 |
$output = '';
|
289 |
if ( $input === true ) { $output = '1'; }
|
290 |
if ( $input === false ) { $output = '3'; }
|
304 |
* @return string Blank string or boolean true, false
|
305 |
*/
|
306 |
|
307 |
+
function aye_yes_or_no( $input = '' ) {
|
308 |
|
309 |
$input = strtolower( $input );
|
310 |
if ( ( $input === true ) or ( $input == 'true' ) or ( $input == '1' ) or ( $input == 'yes' ) or ( $input == 'on' ) ) { return true; }
|
326 |
* @return string Array containing file contents and response
|
327 |
*/
|
328 |
|
329 |
+
function aye_get_file( $filein, $header = false ) {
|
330 |
|
331 |
$rc = 0;
|
332 |
$error = '';
|
366 |
*
|
367 |
* @since 2.0
|
368 |
*
|
369 |
+
* @uses aye_convert Convert value to a 0 or 1 equivalent
|
370 |
*
|
371 |
* @param string $type Current embed type
|
372 |
* @param string $embedplus Whether EmbedPlus embedding is required
|
373 |
* @return string The type of embedding to use
|
374 |
*/
|
375 |
|
376 |
+
function aye_get_embed_type( $type, $embedplus ) {
|
377 |
|
378 |
+
$embedplus = aye_convert( $embedplus );
|
379 |
$type = strtolower( $type );
|
380 |
|
381 |
if ( ( $type == 'embedplus' ) or ( $embedplus == '1' ) ) { $type = 'm'; }
|
397 |
* @return string Autohide numeric equivalent
|
398 |
*/
|
399 |
|
400 |
+
function aye_set_autohide( $autohide ) {
|
401 |
|
402 |
$autohide = strtolower( $autohide );
|
403 |
if ( $autohide == 'no' ) { $autohide = '0'; }
|
418 |
* @param string $total The total number of profiles
|
419 |
*/
|
420 |
|
421 |
+
function aye_generate_profile_list( $current, $total ) {
|
422 |
|
423 |
echo '<option value="0"';
|
424 |
if ( $current == "0" ) { echo " selected='selected'"; }
|
425 |
+
echo ' >' . __( 'Default' ) . '</option>';
|
426 |
$loop = 1;
|
427 |
while ( $loop <= $total ) {
|
428 |
|
429 |
$profiles = get_option( 'youtube_embed_profile' . $loop );
|
430 |
$profname = $profiles[ 'name' ];
|
431 |
|
432 |
+
if ( $profname == '' ) { $profname = __( 'Profile' ) . ' ' . $loop; }
|
433 |
if ( strlen( $profname ) > 30 ) { $profname = substr( $profname, 0, 30 ) . '…'; }
|
434 |
echo '<option value="' . $loop . '"';
|
435 |
|
includes/{shortcodes.php → aye-shortcodes.php}
RENAMED
@@ -4,7 +4,7 @@
|
|
4 |
*
|
5 |
* Define the various shortcodes
|
6 |
*
|
7 |
-
* @package
|
8 |
* @since 2.0
|
9 |
*/
|
10 |
|
@@ -15,17 +15,18 @@
|
|
15 |
*
|
16 |
* @since 2.0
|
17 |
*
|
18 |
-
* @uses
|
19 |
*
|
20 |
* @param string $paras Shortcode parameters
|
21 |
* @param string $content Shortcode content
|
22 |
* @return string YouTube embed code
|
23 |
*/
|
24 |
|
25 |
-
function
|
26 |
-
return
|
27 |
}
|
28 |
-
|
|
|
29 |
|
30 |
/**
|
31 |
* Alternative Video shortcode 1
|
@@ -34,18 +35,18 @@ add_shortcode( 'youtube', 'ye_video_shortcode_default' );
|
|
34 |
*
|
35 |
* @since 2.0
|
36 |
*
|
37 |
-
* @uses
|
38 |
*
|
39 |
* @param string $paras Shortcode parameters
|
40 |
* @param string $content Shortcode content
|
41 |
* @return string YouTube embed code
|
42 |
*/
|
43 |
|
44 |
-
function
|
45 |
-
return
|
46 |
}
|
47 |
-
$shortcode =
|
48 |
-
if ( $shortcode[ 1 ] != '' ) { add_shortcode( $shortcode[ 1 ], '
|
49 |
|
50 |
/**
|
51 |
* Alternative Video shortcode 2
|
@@ -54,17 +55,17 @@ if ( $shortcode[ 1 ] != '' ) { add_shortcode( $shortcode[ 1 ], 'ye_video_shortco
|
|
54 |
*
|
55 |
* @since 2.0
|
56 |
*
|
57 |
-
* @uses
|
58 |
*
|
59 |
* @param string $paras Shortcode parameters
|
60 |
* @param string $content Shortcode content
|
61 |
* @return string YouTube embed code
|
62 |
*/
|
63 |
|
64 |
-
function
|
65 |
-
return
|
66 |
}
|
67 |
-
if ( $shortcode[ 2 ] != '' ) { add_shortcode( $shortcode[ 2 ], '
|
68 |
|
69 |
/**
|
70 |
* Video shortcode
|
@@ -73,9 +74,10 @@ if ( $shortcode[ 2 ] != '' ) { add_shortcode( $shortcode[ 2 ], 'ye_video_shortco
|
|
73 |
*
|
74 |
* @since 2.0
|
75 |
*
|
76 |
-
* @uses
|
77 |
-
* @uses
|
78 |
-
* @uses
|
|
|
79 |
*
|
80 |
* @param string $paras Shortcode parameters
|
81 |
* @param string $content Shortcode content
|
@@ -83,20 +85,26 @@ if ( $shortcode[ 2 ] != '' ) { add_shortcode( $shortcode[ 2 ], 'ye_video_shortco
|
|
83 |
* @return string YouTube embed code
|
84 |
*/
|
85 |
|
86 |
-
function
|
87 |
|
88 |
-
extract( shortcode_atts( array( 'type' => '', 'width' => '', 'height' => '', 'fullscreen' => '', 'related' => '', 'autoplay' => '', 'loop' => '', 'start' => '', 'info' => '', 'annotation' => '', 'cc' => '', 'style' => '', 'link' => '', 'react' => '', 'stop' => '', 'sweetspot' => '', 'disablekb' => '', 'ratio' => '', 'autohide' => '', 'controls' => '', 'profile' => '', 'embedplus' => '', 'audio' => '', 'id' => '', 'url' => '', 'rel' => '', 'fs' => '', 'cc_load_policy' => '', 'iv_load_policy' => '', 'showinfo' => '', 'youtubeurl' => '', 'template' => '', 'list' => '', 'hd' => '', 'color' => '', 'theme' => '', 'ssl' => '', 'height' => '', 'width' => '', 'title' => '', 'dynamic' => '', 'h' => '', 'w' => '' ), $paras ) );
|
89 |
|
90 |
// If no profile specified and an alternative shortcode used, get that shortcodes default profile
|
|
|
91 |
if ( ( $profile == '' ) && ( $alt_shortcode != '' ) ) {
|
|
|
92 |
// Profile is now blank or 2
|
|
|
93 |
if ( $alt_shortcode == '1' ) { $alt_shortcode = ''; }
|
|
|
94 |
// Get general options
|
95 |
-
|
96 |
-
$
|
|
|
97 |
}
|
98 |
|
99 |
// If an alternative field is set, use it
|
|
|
100 |
if ( ( $id != '' ) && ( $content == '' ) ) { $content = $id; }
|
101 |
if ( ( $url != '' ) && ( $content == '' ) ) { $content = $url; }
|
102 |
if ( ( $youtubeurl != '' ) && ( $content == '' ) ) { $content = $youtubeurl; }
|
@@ -111,6 +119,7 @@ function ye_video_shortcode( $paras = '', $content = '', $callback = '', $alt_sh
|
|
111 |
if ( ( $showinfo != '' ) && ( $info == '' ) ) { $info = $showinfo;}
|
112 |
|
113 |
// If ID was not passed in the content and the first parameter is set, assume that to be the ID
|
|
|
114 |
if ( ( $content == '' ) && ( $paras[ 0 ] != '' ) ) {
|
115 |
$content = $paras[ 0 ];
|
116 |
if ( (substr( $content, 0, 1 ) == ":" ) or ( substr( $content, 0, 1 ) == "=" ) ) { $content = substr( $content, 1 ); }
|
@@ -119,15 +128,18 @@ function ye_video_shortcode( $paras = '', $content = '', $callback = '', $alt_sh
|
|
119 |
}
|
120 |
|
121 |
// Get Embed type
|
122 |
-
|
|
|
123 |
|
124 |
// Set up Autohide parameter
|
125 |
-
|
|
|
126 |
|
127 |
// Create YouTube code
|
128 |
-
$youtube_code = ye_generate_youtube_code( $content, $type, $width, $height, ye_convert( $fullscreen ), ye_convert( $related ), ye_convert( $autoplay ), ye_convert( $loop ), $start, ye_convert( $info ), ye_convert_3( $annotation ), ye_convert( $cc ), $style, ye_convert( $link ), ye_convert( $react ), $stop, ye_convert( $sweetspot ), ye_convert( $disablekb ), $ratio, $autohide, ye_convert( $controls ), $profile, $list, ye_convert( $audio ), $template, ye_convert( $hd ), $color, $theme, ye_convert( $ssl ), $title, ye_convert( $dynamic ) );
|
129 |
|
130 |
-
|
|
|
|
|
131 |
}
|
132 |
|
133 |
/**
|
@@ -137,18 +149,19 @@ function ye_video_shortcode( $paras = '', $content = '', $callback = '', $alt_sh
|
|
137 |
*
|
138 |
* @since 2.0
|
139 |
*
|
140 |
-
* @uses
|
141 |
*
|
142 |
* @param string $paras Shortcode parameters
|
143 |
* @param string $content Shortcode content
|
144 |
* @return string YouTube thumbnail code
|
145 |
*/
|
146 |
|
147 |
-
function
|
148 |
extract( shortcode_atts( array( 'style' => '', 'class' => '', 'rel' => '', 'target' => '', 'width' => '', 'height' => '', 'alt' => '', 'version' => '' ), $paras ) );
|
149 |
-
return
|
150 |
}
|
151 |
-
|
|
|
152 |
|
153 |
/**
|
154 |
* Short URL shortcode
|
@@ -157,18 +170,19 @@ add_shortcode( 'youtube_thumb', 'ye_thumbnail_sc' );
|
|
157 |
*
|
158 |
* @since 2.0
|
159 |
*
|
160 |
-
* @uses
|
161 |
*
|
162 |
* @param string $paras Shortcode parameters
|
163 |
* @param string $content Shortcode content
|
164 |
* @return string YouTube short URL code
|
165 |
*/
|
166 |
|
167 |
-
function
|
168 |
extract( shortcode_atts( array( 'id' => '' ), $paras ) );
|
169 |
-
return
|
170 |
}
|
171 |
-
|
|
|
172 |
|
173 |
/**
|
174 |
* Download shortcode
|
@@ -177,20 +191,23 @@ add_shortcode( 'youtube_url', 'ye_shorturl_sc' );
|
|
177 |
*
|
178 |
* @since 2.0
|
179 |
*
|
180 |
-
* @uses
|
181 |
*
|
182 |
* @param string $paras Shortcode parameters
|
183 |
* @param string $content Shortcode content
|
184 |
* @return string YouTube download link
|
185 |
*/
|
186 |
|
187 |
-
function
|
|
|
188 |
extract( shortcode_atts( array( 'id' => '', 'target' => '', 'nofollow' => '' ), $paras ) );
|
189 |
|
190 |
// Return the URL
|
191 |
-
|
|
|
192 |
|
193 |
// Now add the HTML to the URL (assuming it's not an error)
|
|
|
194 |
if ( substr( $link, 0, 2 ) != '<p' ) {
|
195 |
$link = '<a href="' . $link . '"';
|
196 |
if ( $target != '' ) { $link .= ' target="' . $target . '"'; }
|
@@ -198,9 +215,10 @@ function ye_video_download( $paras = '', $content = '' ) {
|
|
198 |
$link .= '>' . $content . '</a>';
|
199 |
}
|
200 |
|
201 |
-
return $link;
|
202 |
}
|
203 |
-
|
|
|
204 |
|
205 |
/**
|
206 |
* Transcript Shortcode
|
@@ -209,17 +227,18 @@ add_shortcode( 'download_video', 'ye_video_download' );
|
|
209 |
*
|
210 |
* @since 2.0
|
211 |
*
|
212 |
-
* @uses
|
213 |
*
|
214 |
* @param string $paras Shortcode parameters
|
215 |
* @param string $content Shortcode content
|
216 |
* @return string Transcript XHTML
|
217 |
*/
|
218 |
|
219 |
-
function
|
220 |
-
return
|
221 |
}
|
222 |
-
|
|
|
223 |
|
224 |
/**
|
225 |
* Video Name Shortcode
|
@@ -228,27 +247,31 @@ add_shortcode( 'transcript', 'ye_transcript_sc' );
|
|
228 |
*
|
229 |
* @since 2.0
|
230 |
*
|
231 |
-
* @uses
|
232 |
-
* @uses
|
233 |
-
* @uses
|
234 |
*
|
235 |
* @param string $paras Shortcode parameters
|
236 |
* @param string $content Shortcode content
|
237 |
* @return string Video name
|
238 |
*/
|
239 |
|
240 |
-
function
|
241 |
|
242 |
// Extract the ID if a full URL has been specified
|
243 |
-
|
|
|
244 |
|
245 |
// Check what type of video it is and whether it's valid
|
246 |
-
|
247 |
-
|
248 |
-
if (
|
|
|
249 |
|
250 |
// Return the video title
|
251 |
-
|
|
|
252 |
}
|
253 |
-
|
|
|
254 |
?>
|
4 |
*
|
5 |
* Define the various shortcodes
|
6 |
*
|
7 |
+
* @package Artiss-YouTube-Embed
|
8 |
* @since 2.0
|
9 |
*/
|
10 |
|
15 |
*
|
16 |
* @since 2.0
|
17 |
*
|
18 |
+
* @uses aye_video_shortcode Action the shortcode parameters
|
19 |
*
|
20 |
* @param string $paras Shortcode parameters
|
21 |
* @param string $content Shortcode content
|
22 |
* @return string YouTube embed code
|
23 |
*/
|
24 |
|
25 |
+
function aye_video_shortcode_default( $paras = '', $content = '' ) {
|
26 |
+
return do_shortcode( aye_video_shortcode( $paras, $content ) );
|
27 |
}
|
28 |
+
|
29 |
+
add_shortcode( 'youtube', 'aye_video_shortcode_default' );
|
30 |
|
31 |
/**
|
32 |
* Alternative Video shortcode 1
|
35 |
*
|
36 |
* @since 2.0
|
37 |
*
|
38 |
+
* @uses aye_video_shortcode Action the shortcode parameters
|
39 |
*
|
40 |
* @param string $paras Shortcode parameters
|
41 |
* @param string $content Shortcode content
|
42 |
* @return string YouTube embed code
|
43 |
*/
|
44 |
|
45 |
+
function aye_video_shortcode_alt1( $paras = '', $content = '' ) {
|
46 |
+
return do_shortcode( aye_video_shortcode( $paras, $content, '', 1 ) );
|
47 |
}
|
48 |
+
$shortcode = aye_set_shortcode_option();
|
49 |
+
if ( $shortcode[ 1 ] != '' ) { add_shortcode( $shortcode[ 1 ], 'aye_video_shortcode_alt1' ); }
|
50 |
|
51 |
/**
|
52 |
* Alternative Video shortcode 2
|
55 |
*
|
56 |
* @since 2.0
|
57 |
*
|
58 |
+
* @uses aye_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 aye_video_shortcode_alt2( $paras = '', $content = '' ) {
|
66 |
+
return do_shortcode( aye_video_shortcode( $paras, $content, '', 2 ) );
|
67 |
}
|
68 |
+
if ( $shortcode[ 2 ] != '' ) { add_shortcode( $shortcode[ 2 ], 'aye_video_shortcode_alt2' ); }
|
69 |
|
70 |
/**
|
71 |
* Video shortcode
|
74 |
*
|
75 |
* @since 2.0
|
76 |
*
|
77 |
+
* @uses aye_get_embed_type Get the embed type
|
78 |
+
* @uses aye_set_autohide Get the autohide parameter
|
79 |
+
* @uses aye_set_general_defaults Set default options
|
80 |
+
* @uses aye_generate_youtube_code Generate the embed code
|
81 |
*
|
82 |
* @param string $paras Shortcode parameters
|
83 |
* @param string $content Shortcode content
|
85 |
* @return string YouTube embed code
|
86 |
*/
|
87 |
|
88 |
+
function aye_video_shortcode( $paras = '', $content = '', $callback = '', $alt_shortcode = '' ) {
|
89 |
|
90 |
+
extract( shortcode_atts( array( 'type' => '', 'width' => '', 'height' => '', 'fullscreen' => '', 'related' => '', 'autoplay' => '', 'loop' => '', 'start' => '', 'info' => '', 'annotation' => '', 'cc' => '', 'style' => '', 'link' => '', 'react' => '', 'stop' => '', 'sweetspot' => '', 'disablekb' => '', 'ratio' => '', 'autohide' => '', 'controls' => '', 'profile' => '', 'embedplus' => '', 'audio' => '', 'id' => '', 'url' => '', 'rel' => '', 'fs' => '', 'cc_load_policy' => '', 'iv_load_policy' => '', 'showinfo' => '', 'youtubeurl' => '', 'template' => '', 'list' => '', 'hd' => '', 'color' => '', 'theme' => '', 'ssl' => '', 'height' => '', 'width' => '', 'title' => '', 'dynamic' => '', 'h' => '', 'w' => '', 'search' => '', 'user' => '' ), $paras ) );
|
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 = aye_set_general_defaults();
|
103 |
+
$profile = $options[ 'alt_profile' . $alt_shortcode ];
|
104 |
}
|
105 |
|
106 |
// If an alternative field is set, use it
|
107 |
+
|
108 |
if ( ( $id != '' ) && ( $content == '' ) ) { $content = $id; }
|
109 |
if ( ( $url != '' ) && ( $content == '' ) ) { $content = $url; }
|
110 |
if ( ( $youtubeurl != '' ) && ( $content == '' ) ) { $content = $youtubeurl; }
|
119 |
if ( ( $showinfo != '' ) && ( $info == '' ) ) { $info = $showinfo;}
|
120 |
|
121 |
// If ID was not passed in the content and the first parameter is set, assume that to be the ID
|
122 |
+
|
123 |
if ( ( $content == '' ) && ( $paras[ 0 ] != '' ) ) {
|
124 |
$content = $paras[ 0 ];
|
125 |
if ( (substr( $content, 0, 1 ) == ":" ) or ( substr( $content, 0, 1 ) == "=" ) ) { $content = substr( $content, 1 ); }
|
128 |
}
|
129 |
|
130 |
// Get Embed type
|
131 |
+
|
132 |
+
$type = aye_get_embed_type( $type, $embedplus );
|
133 |
|
134 |
// Set up Autohide parameter
|
135 |
+
|
136 |
+
$autohide = aye_set_autohide( $autohide );
|
137 |
|
138 |
// Create YouTube code
|
|
|
139 |
|
140 |
+
$youtube_code = aye_generate_youtube_code( $content, $type, $width, $height, aye_convert( $fullscreen ), aye_convert( $related ), aye_convert( $autoplay ), aye_convert( $loop ), $start, aye_convert( $info ), aye_convert_3( $annotation ), aye_convert( $cc ), $style, aye_convert( $link ), aye_convert( $react ), $stop, aye_convert( $sweetspot ), aye_convert( $disablekb ), $ratio, $autohide, aye_convert( $controls ), $profile, $list, aye_convert( $audio ), $template, aye_convert( $hd ), $color, $theme, aye_convert( $ssl ), $title, aye_convert( $dynamic ), aye_convert( $search ), aye_convert( $user ) );
|
141 |
+
|
142 |
+
return do_shortcode( $youtube_code );
|
143 |
}
|
144 |
|
145 |
/**
|
149 |
*
|
150 |
* @since 2.0
|
151 |
*
|
152 |
+
* @uses aye_generate_thumbnail_code Generate the thumbnail code
|
153 |
*
|
154 |
* @param string $paras Shortcode parameters
|
155 |
* @param string $content Shortcode content
|
156 |
* @return string YouTube thumbnail code
|
157 |
*/
|
158 |
|
159 |
+
function aye_thumbnail_sc( $paras = '', $content = '' ) {
|
160 |
extract( shortcode_atts( array( 'style' => '', 'class' => '', 'rel' => '', 'target' => '', 'width' => '', 'height' => '', 'alt' => '', 'version' => '' ), $paras ) );
|
161 |
+
return do_shortcode( aye_generate_thumbnail_code( $content, $style, $class, $rel, $target, $width, $height, $alt, $version ) );
|
162 |
}
|
163 |
+
|
164 |
+
add_shortcode( 'youtube_thumb', 'aye_thumbnail_sc' );
|
165 |
|
166 |
/**
|
167 |
* Short URL shortcode
|
170 |
*
|
171 |
* @since 2.0
|
172 |
*
|
173 |
+
* @uses aye_generate_shorturl_code Generate the code
|
174 |
*
|
175 |
* @param string $paras Shortcode parameters
|
176 |
* @param string $content Shortcode content
|
177 |
* @return string YouTube short URL code
|
178 |
*/
|
179 |
|
180 |
+
function aye_shorturl_sc( $paras = '', $content = '' ) {
|
181 |
extract( shortcode_atts( array( 'id' => '' ), $paras ) );
|
182 |
+
return do_shortcode( aye_generate_shorturl_code( $id ) );
|
183 |
}
|
184 |
+
|
185 |
+
add_shortcode( 'youtube_url', 'aye_shorturl_sc' );
|
186 |
|
187 |
/**
|
188 |
* Download shortcode
|
191 |
*
|
192 |
* @since 2.0
|
193 |
*
|
194 |
+
* @uses aye_generate_download_code Generate the download code
|
195 |
*
|
196 |
* @param string $paras Shortcode parameters
|
197 |
* @param string $content Shortcode content
|
198 |
* @return string YouTube download link
|
199 |
*/
|
200 |
|
201 |
+
function aye_video_download( $paras = '', $content = '' ) {
|
202 |
+
|
203 |
extract( shortcode_atts( array( 'id' => '', 'target' => '', 'nofollow' => '' ), $paras ) );
|
204 |
|
205 |
// Return the URL
|
206 |
+
|
207 |
+
$link = aye_generate_download_code( $id );
|
208 |
|
209 |
// Now add the HTML to the URL (assuming it's not an error)
|
210 |
+
|
211 |
if ( substr( $link, 0, 2 ) != '<p' ) {
|
212 |
$link = '<a href="' . $link . '"';
|
213 |
if ( $target != '' ) { $link .= ' target="' . $target . '"'; }
|
215 |
$link .= '>' . $content . '</a>';
|
216 |
}
|
217 |
|
218 |
+
return do_shortcode( $link );
|
219 |
}
|
220 |
+
|
221 |
+
add_shortcode( 'download_video', 'aye_video_download' );
|
222 |
|
223 |
/**
|
224 |
* Transcript Shortcode
|
227 |
*
|
228 |
* @since 2.0
|
229 |
*
|
230 |
+
* @uses aye_generate_transcript Generate the transcript
|
231 |
*
|
232 |
* @param string $paras Shortcode parameters
|
233 |
* @param string $content Shortcode content
|
234 |
* @return string Transcript XHTML
|
235 |
*/
|
236 |
|
237 |
+
function aye_transcript_sc( $paras = '', $content = '' ) {
|
238 |
+
return do_shortcode( aye_generate_transcript( $content ) );
|
239 |
}
|
240 |
+
|
241 |
+
add_shortcode( 'transcript', 'aye_transcript_sc' );
|
242 |
|
243 |
/**
|
244 |
* Video Name Shortcode
|
247 |
*
|
248 |
* @since 2.0
|
249 |
*
|
250 |
+
* @uses aye_extract_id Extract the video ID
|
251 |
+
* @uses aye_validate_id Get the name and video type
|
252 |
+
* @uses aye_error Return an error
|
253 |
*
|
254 |
* @param string $paras Shortcode parameters
|
255 |
* @param string $content Shortcode content
|
256 |
* @return string Video name
|
257 |
*/
|
258 |
|
259 |
+
function aye_video_name_shortcode( $paras = '', $content = '' ) {
|
260 |
|
261 |
// Extract the ID if a full URL has been specified
|
262 |
+
|
263 |
+
$id = aye_extract_id( $content );
|
264 |
|
265 |
// Check what type of video it is and whether it's valid
|
266 |
+
|
267 |
+
$return = aye_validate_id( $id, true );
|
268 |
+
if ( !$return[ 'type' ] ) { return aye_error( sprintf( __( 'The YouTube ID of %s is invalid.' ), $id ) ); }
|
269 |
+
if ( strlen( $return[ 'type' ] ) != 1 ) { return aye_error( $return[ 'type' ] ); }
|
270 |
|
271 |
// Return the video title
|
272 |
+
|
273 |
+
return do_shortcode( $return['title'] );
|
274 |
}
|
275 |
+
|
276 |
+
add_shortcode( 'youtube_name', 'aye_video_name_shortcode' );
|
277 |
?>
|
includes/{content.php → aye-update-post-content.php}
RENAMED
@@ -4,7 +4,7 @@
|
|
4 |
*
|
5 |
* Process the post/page content for embed requests
|
6 |
*
|
7 |
-
* @package
|
8 |
* @since 2.0
|
9 |
*/
|
10 |
|
@@ -16,18 +16,18 @@
|
|
16 |
*
|
17 |
* @since 2.0
|
18 |
*
|
19 |
-
* @uses
|
20 |
-
* @uses
|
21 |
-
* @uses
|
22 |
-
* @uses
|
23 |
*
|
24 |
* @param string $content Post/page content
|
25 |
* @return string Resulting post/page content
|
26 |
*/
|
27 |
|
28 |
-
function
|
29 |
|
30 |
-
$options =
|
31 |
|
32 |
// The following are URL modifications
|
33 |
|
@@ -41,29 +41,29 @@ function ye_content_search( $content ) {
|
|
41 |
// Search for httpv URL
|
42 |
$identifier = 'httpv://www.youtube.com/watch?v=';
|
43 |
$search = strpos( $content, $identifier );
|
44 |
-
if ( $search !== false ) { $content =
|
45 |
|
46 |
// Search for httpa URL
|
47 |
$identifier = 'httpa://www.youtube.com/watch?v=';
|
48 |
$search = strpos( $content, $identifier );
|
49 |
-
if ( $search !== false ) { $content =
|
50 |
|
51 |
// Search for httpvh URL
|
52 |
$identifier = 'httpvh://www.youtube.com/watch?v=';
|
53 |
$search = strpos( $content, $identifier );
|
54 |
-
if ( $search !== false ) { $content =
|
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 =
|
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 =
|
67 |
}
|
68 |
}
|
69 |
|
@@ -74,6 +74,7 @@ function ye_content_search( $content ) {
|
|
74 |
if ( $options[ 'bracket' ] == 1 ) {
|
75 |
|
76 |
// Loop around content, looking for brackets - possible YouTube URL within!
|
|
|
77 |
$current_pos = 0;
|
78 |
$bracket_found = true;
|
79 |
|
@@ -89,15 +90,18 @@ function ye_content_search( $content ) {
|
|
89 |
$id = $code;
|
90 |
|
91 |
// Maybe a video ID - validate first
|
|
|
92 |
if ( ( strlen( $code ) == 11 ) && ( !strpos( $code, ' ' ) ) ) {
|
93 |
-
$type =
|
94 |
if ( $type == 'v' ) { $code_found = true; }
|
95 |
}
|
96 |
|
97 |
// Video URL
|
|
|
98 |
if ( ( strpos ($code, 'youtube.com/watch?v=' ) !== false ) && ( !$code_found ) ) { $code_found = true; }
|
99 |
|
100 |
// Other URLs
|
|
|
101 |
if ( ( substr( $code, 0, 8 ) == 'watch?v=' ) && ( !$code_found ) ) {
|
102 |
$id = substr( $code, 8 );
|
103 |
$code_found = true;
|
@@ -108,8 +112,9 @@ function ye_content_search( $content ) {
|
|
108 |
}
|
109 |
|
110 |
// If an ID was found, update the code
|
|
|
111 |
if ( $code_found ) {
|
112 |
-
$ye_code =
|
113 |
$content = str_replace( '[' . $code . ']', $ye_code, $content );
|
114 |
}
|
115 |
}
|
@@ -122,41 +127,7 @@ function ye_content_search( $content ) {
|
|
122 |
|
123 |
return $content;
|
124 |
}
|
125 |
-
add_filter( 'the_content', '
|
126 |
-
|
127 |
-
/**
|
128 |
-
* Embed Handler
|
129 |
-
*
|
130 |
-
* Override the WP embed handler. Allows address and embed URLS types as well as playlists.
|
131 |
-
*
|
132 |
-
* @since 2.0
|
133 |
-
*
|
134 |
-
* @uses ye_set_general_defaults Fetch default profile option
|
135 |
-
* @uses ye_generate_youtube_code Generate the embed code
|
136 |
-
*
|
137 |
-
* @param array $matches The regex matches from the provided regex when calling
|
138 |
-
* @param array $attr Embed attributes
|
139 |
-
* @param string $url The original URL that was matched by the regex
|
140 |
-
* @param array $rawattr The original unmodified attributes
|
141 |
-
* @return string The embed HTML
|
142 |
-
*/
|
143 |
-
|
144 |
-
function ye_embed_handler( $matches, $attr, $url, $rawattr ) {
|
145 |
-
|
146 |
-
$options = ye_set_general_defaults();
|
147 |
-
$code = ye_generate_youtube_code( $matches[ 1 ], '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', $options[ 'url_profile' ], '', '' );
|
148 |
-
|
149 |
-
return $code;
|
150 |
-
}
|
151 |
-
|
152 |
-
$url = ye_set_url_option();
|
153 |
-
if ( $url != '' ) {
|
154 |
-
//$ye_regex = '/http:\/\/(?:www\.)?youtube.*watch\?[pv]=([a-zA-Z0-9\-_]+)/';
|
155 |
-
// http://stackoverflow.com/questions/7654542/youtube-url-regex
|
156 |
-
$ye_regex = '\s*(https?:\/\/www.youtube(?:-nocookie)?.com\/(?:v|embed)\/([a-zA-Z0-9-]+)).*';
|
157 |
-
wp_embed_register_handler( 'youtube', $ye_regex, 'ye_embed_handler' );
|
158 |
-
wp_embed_register_handler( 'youtube_embed', $ye_regex, 'ye_embed_handler' );
|
159 |
-
}
|
160 |
|
161 |
/**
|
162 |
* Convert the Content
|
@@ -165,7 +136,7 @@ if ( $url != '' ) {
|
|
165 |
*
|
166 |
* @since 2.0
|
167 |
*
|
168 |
-
* @uses
|
169 |
*
|
170 |
* @param string $content The post content
|
171 |
* @param string $identifier The text that identifies the embed
|
@@ -176,9 +147,9 @@ if ( $url != '' ) {
|
|
176 |
* @return string Content to return
|
177 |
*/
|
178 |
|
179 |
-
function
|
180 |
|
181 |
-
$code =
|
182 |
$content = str_replace( $identifier.$id.$suffix, $code, $content);
|
183 |
|
184 |
return $content;
|
@@ -191,16 +162,16 @@ function ye_convert_content( $content, $identifier, $id, $audio = '', $suffix =
|
|
191 |
*
|
192 |
* @since 2.0
|
193 |
*
|
194 |
-
* @uses
|
195 |
-
* @uses
|
196 |
*
|
197 |
* @param string $content The comments content
|
198 |
* @return string Content to return
|
199 |
*/
|
200 |
|
201 |
-
function
|
202 |
|
203 |
-
$options =
|
204 |
|
205 |
if ( $options[ 'comments' ] == 1 ) {
|
206 |
|
@@ -213,6 +184,7 @@ function ye_filter_comments( $content ) {
|
|
213 |
if ( ( $prefix != ']' ) && ( $prefix != '"' ) && ( $prefix != "'" ) ) {
|
214 |
|
215 |
// Check if link around video. If so, work out how much more needs stripping out
|
|
|
216 |
$anchor_start = 0;
|
217 |
$anchor_end = 0;
|
218 |
if ( $prefix == ">" ) {
|
@@ -224,10 +196,12 @@ function ye_filter_comments( $content ) {
|
|
224 |
}
|
225 |
|
226 |
// Work out video ID and generate code
|
|
|
227 |
$id = substr( $content, $search + strlen( $identifier ), 11 );
|
228 |
-
$code =
|
229 |
|
230 |
// Now replace the URL with the resultant code
|
|
|
231 |
$first_section = $search - 1 - $anchor_start;
|
232 |
if ( $first_section < 1 ) {
|
233 |
$content = $code . substr( $content, $search + strlen( $identifier ) + 11 + $anchor_end );
|
@@ -244,5 +218,5 @@ function ye_filter_comments( $content ) {
|
|
244 |
}
|
245 |
return $content;
|
246 |
}
|
247 |
-
add_filter( 'comment_text', '
|
248 |
?>
|
4 |
*
|
5 |
* Process the post/page content for embed requests
|
6 |
*
|
7 |
+
* @package Artiss-YouTube-Embed
|
8 |
* @since 2.0
|
9 |
*/
|
10 |
|
16 |
*
|
17 |
* @since 2.0
|
18 |
*
|
19 |
+
* @uses aye_convert_content Convert a URL to the embed code
|
20 |
+
* @uses aye_generate_youtube_code Generate the YouTube embed code
|
21 |
+
* @uses aye_set_general_defaults Get general defaults
|
22 |
+
* @uses aye_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 aye_content_search( $content ) {
|
29 |
|
30 |
+
$options = aye_set_general_defaults();
|
31 |
|
32 |
// The following are URL modifications
|
33 |
|
41 |
// Search for httpv URL
|
42 |
$identifier = 'httpv://www.youtube.com/watch?v=';
|
43 |
$search = strpos( $content, $identifier );
|
44 |
+
if ( $search !== false ) { $content = aye_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 = aye_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 = aye_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 = aye_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 = aye_convert_content( $content, $identifier, substr( $content, $search + strlen( $identifier ), 11 ), '', '::', $options[ 'other_profile' ] ); $changed = true; }
|
67 |
}
|
68 |
}
|
69 |
|
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 |
|
90 |
$id = $code;
|
91 |
|
92 |
// Maybe a video ID - validate first
|
93 |
+
|
94 |
if ( ( strlen( $code ) == 11 ) && ( !strpos( $code, ' ' ) ) ) {
|
95 |
+
$type = aye_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;
|
112 |
}
|
113 |
|
114 |
// If an ID was found, update the code
|
115 |
+
|
116 |
if ( $code_found ) {
|
117 |
+
$ye_code = aye_generate_youtube_code( $id, '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', $options[ 'other_profile' ], '', '' );
|
118 |
$content = str_replace( '[' . $code . ']', $ye_code, $content );
|
119 |
}
|
120 |
}
|
127 |
|
128 |
return $content;
|
129 |
}
|
130 |
+
add_filter( 'the_content', 'aye_content_search' );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
131 |
|
132 |
/**
|
133 |
* Convert the Content
|
136 |
*
|
137 |
* @since 2.0
|
138 |
*
|
139 |
+
* @uses aye_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
|
147 |
* @return string Content to return
|
148 |
*/
|
149 |
|
150 |
+
function aye_convert_content( $content, $identifier, $id, $audio = '', $suffix = '', $profile = '' ) {
|
151 |
|
152 |
+
$code = aye_generate_youtube_code( $id, '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', $profile, '', $audio );
|
153 |
$content = str_replace( $identifier.$id.$suffix, $code, $content);
|
154 |
|
155 |
return $content;
|
162 |
*
|
163 |
* @since 2.0
|
164 |
*
|
165 |
+
* @uses aye_set_general_defaults Get the general defaults
|
166 |
+
* @uses aye_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 aye_filter_comments( $content ) {
|
173 |
|
174 |
+
$options = aye_set_general_defaults();
|
175 |
|
176 |
if ( $options[ 'comments' ] == 1 ) {
|
177 |
|
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 == ">" ) {
|
196 |
}
|
197 |
|
198 |
// Work out video ID and generate code
|
199 |
+
|
200 |
$id = substr( $content, $search + strlen( $identifier ), 11 );
|
201 |
+
$code = aye_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 );
|
218 |
}
|
219 |
return $content;
|
220 |
}
|
221 |
+
add_filter( 'comment_text', 'aye_filter_comments' );
|
222 |
?>
|
includes/function-calls.php
DELETED
@@ -1,227 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Function Calls
|
4 |
-
*
|
5 |
-
* Various function calls that the user may call directly
|
6 |
-
*
|
7 |
-
* @package YouTubeEmbed
|
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 ye_get_parameters Extract parameters from input
|
18 |
-
* @uses ye_get_embed_type Work out the correct embed type to use
|
19 |
-
* @uses ye_set_autohide Set correct autohide parameter
|
20 |
-
* @uses ye_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 = ye_get_parameters( $paras, 'width' );
|
29 |
-
$height = ye_get_parameters( $paras, 'height' );
|
30 |
-
$fullscreen = ye_get_parameters( $paras, 'fullscreen' );
|
31 |
-
$related = ye_get_parameters( $paras, 'related' );
|
32 |
-
$autoplay = ye_get_parameters( $paras, 'autoplay' );
|
33 |
-
$loop = ye_get_parameters( $paras, 'loop' );
|
34 |
-
$start = ye_get_parameters( $paras, 'start' );
|
35 |
-
$info = ye_get_parameters( $paras, 'info' );
|
36 |
-
$annotation = ye_get_parameters( $paras, 'annotation' );
|
37 |
-
$cc = ye_get_parameters( $paras, 'cc' );
|
38 |
-
$link = ye_get_parameters( $paras, 'link' );
|
39 |
-
$react = ye_get_parameters( $paras, 'react' );
|
40 |
-
$stop = ye_get_parameters( $paras, 'stop' );
|
41 |
-
$sweetspot = ye_get_parameters( $paras, 'sweetspot' );
|
42 |
-
$embedplus = ye_get_parameters( $paras, 'embedplus' );
|
43 |
-
$disablekb = ye_get_parameters( $paras, 'disablekb' );
|
44 |
-
$ratio = ye_get_parameters( $paras, 'ratio' );
|
45 |
-
$autohide = ye_get_parameters( $paras, 'autohide' );
|
46 |
-
$controls = ye_get_parameters( $paras, 'controls' );
|
47 |
-
$type = ye_get_parameters( $paras, 'type' );
|
48 |
-
$profile = ye_get_parameters( $paras, 'profile' );
|
49 |
-
$list = ye_get_parameters( $paras, 'list' );
|
50 |
-
$audio = ye_get_parameters( $paras, 'audio' );
|
51 |
-
$template = ye_get_parameters( $paras, 'template' );
|
52 |
-
$hd = ye_get_parameters( $paras, 'hd' );
|
53 |
-
$color = ye_get_parameters( $paras, 'color' );
|
54 |
-
$theme = ye_get_parameters( $paras, 'theme' );
|
55 |
-
$https = ye_get_parameters( $paras, 'ssl' );
|
56 |
-
$title = ye_get_parameters( $paras, 'title' );
|
57 |
-
$dynamic = ye_get_parameters( $paras, 'dynamic' );
|
58 |
-
|
59 |
-
// Get Embed type
|
60 |
-
$type = ye_get_embed_type( $type, $embedplus );
|
61 |
-
|
62 |
-
// Set up Autohide parameter
|
63 |
-
$autohide = ye_set_autohide( $autohide );
|
64 |
-
|
65 |
-
echo ye_generate_youtube_code( $content, $type, $width, $height, ye_convert( $fullscreen ), ye_convert( $related ), ye_convert( $autoplay ), ye_convert( $loop ), $start, ye_convert( $info ), ye_convert_3( $annotation ), ye_convert( $cc ), $style, ye_convert( $link ), ye_convert( $react ), $stop, ye_convert( $sweetspot ), ye_convert( $disablekb ), $ratio, $autohide, ye_convert( $controls ), $profile, $list, ye_convert( $audio ), $template, ye_convert( $hd ), $color, $theme, ye_convert( $https ), $title, ye_convert( $dynamic ) );
|
66 |
-
return;
|
67 |
-
}
|
68 |
-
|
69 |
-
/**
|
70 |
-
* Display a video thumbnail
|
71 |
-
*
|
72 |
-
* Display a thumbnail of a video
|
73 |
-
*
|
74 |
-
* @since 2.0
|
75 |
-
*
|
76 |
-
* @uses ye_get_parameters Extract parameters from a string
|
77 |
-
* @uses ye_generate_thumbnaik_code Get the thumbnail code
|
78 |
-
*
|
79 |
-
* @param string $content YouTube video ID
|
80 |
-
* @param string $paras Parameters
|
81 |
-
* @param string $style CSS information
|
82 |
-
* @param string $alt Alt text
|
83 |
-
*/
|
84 |
-
|
85 |
-
function youtube_thumb_embed( $content, $paras = '', $style = '', $alt = '' ) {
|
86 |
-
|
87 |
-
$class = ye_get_parameters( $paras, 'class' );
|
88 |
-
$rel = ye_get_parameters( $paras, 'rel' );
|
89 |
-
$target = ye_get_parameters( $paras, 'target' );
|
90 |
-
$width = ye_get_parameters( $paras, 'width' );
|
91 |
-
$height = ye_get_parameters( $paras, 'height' );
|
92 |
-
$version = ye_get_parameters( $paras, 'version' );
|
93 |
-
|
94 |
-
echo ye_generate_thumbnail_code( $content, $style, $class, $rel, $target, $width, $height, $alt, $version );
|
95 |
-
|
96 |
-
return;
|
97 |
-
}
|
98 |
-
|
99 |
-
/**
|
100 |
-
* Return video short URL
|
101 |
-
*
|
102 |
-
* Return a short URL for the YouTube video
|
103 |
-
*
|
104 |
-
* @since 2.0
|
105 |
-
*
|
106 |
-
* @uses ye_generate_shorturl_code Display an error
|
107 |
-
*
|
108 |
-
* @param string $id YouTube video ID
|
109 |
-
* @return string Download URL
|
110 |
-
*/
|
111 |
-
|
112 |
-
function youtube_short_url( $id ) {
|
113 |
-
return ye_generate_shorturl_code( $id );
|
114 |
-
}
|
115 |
-
|
116 |
-
/**
|
117 |
-
* Get video download URL
|
118 |
-
*
|
119 |
-
* Return a URL for the video so that it can be downloaded
|
120 |
-
*
|
121 |
-
* @since 2.0
|
122 |
-
*
|
123 |
-
* @uses ye_generate_download_code Get the download URL
|
124 |
-
*
|
125 |
-
* @param string $id YouTube video ID
|
126 |
-
* @return string Download URL
|
127 |
-
*/
|
128 |
-
|
129 |
-
function get_video_download( $id ) {
|
130 |
-
return ye_generate_download_code( $id );
|
131 |
-
}
|
132 |
-
|
133 |
-
/**
|
134 |
-
* Get XML transcript
|
135 |
-
*
|
136 |
-
* Return XML formatted YouTube transcript
|
137 |
-
*
|
138 |
-
* @since 2.0
|
139 |
-
*
|
140 |
-
* @uses ye_error Output an error
|
141 |
-
* @uses ye_extract_id Extract a video ID
|
142 |
-
* @uses ye_get_file Get a file
|
143 |
-
* @uses ye_validate_id Check the video ID is valid
|
144 |
-
*
|
145 |
-
* @param string $id YouTube video ID
|
146 |
-
* @return string Transcript file in XML format
|
147 |
-
*/
|
148 |
-
|
149 |
-
function get_youtube_transcript_xml ( $id ) {
|
150 |
-
|
151 |
-
// Extract the ID if a full URL has been specified
|
152 |
-
$id = ye_extract_id( $id );
|
153 |
-
|
154 |
-
// Check what type of video it is and whether it's valid
|
155 |
-
$embed_type = ye_validate_id( $id );
|
156 |
-
if ( $embed_type != 'v' ) {
|
157 |
-
if ( strlen( $embed_type ) > 1 ) {
|
158 |
-
echo ye_error( $embed_type );
|
159 |
-
} else {
|
160 |
-
echo ye_error( 'The YouTube ID of ' . $id . ' is invalid.' );
|
161 |
-
}
|
162 |
-
return;
|
163 |
-
}
|
164 |
-
|
165 |
-
// Get transcript file
|
166 |
-
$filename = 'http://video.google.com/timedtext?lang=en&v=' . $id;
|
167 |
-
$xml = ye_get_file( $filename );
|
168 |
-
|
169 |
-
// Check success and return appropriate output
|
170 |
-
if ( $xml[ 'rc' ] > 0 ) {
|
171 |
-
echo ye_error( 'Could not fetch the transcript file ' . $filename . '.' );
|
172 |
-
return;
|
173 |
-
} else {
|
174 |
-
return $xml;
|
175 |
-
}
|
176 |
-
}
|
177 |
-
|
178 |
-
/**
|
179 |
-
* Get transcript
|
180 |
-
*
|
181 |
-
* Return XHTML formatted YouTube transcript
|
182 |
-
*
|
183 |
-
* @since 2.0
|
184 |
-
*
|
185 |
-
* @uses ye_generate_generatE_transcript Generate the transcript output
|
186 |
-
*
|
187 |
-
* @param string $id YouTube video ID
|
188 |
-
* @return string Transcript file in XHTML format
|
189 |
-
*/
|
190 |
-
|
191 |
-
function get_youtube_transcript( $id ) {
|
192 |
-
return ye_generate_transcript( $id );
|
193 |
-
}
|
194 |
-
|
195 |
-
/**
|
196 |
-
* Get Video Name
|
197 |
-
*
|
198 |
-
* Function to return the name of a YouTube video
|
199 |
-
*
|
200 |
-
* @since 2.0
|
201 |
-
*
|
202 |
-
* @uses ye_extract_id Extract the video ID
|
203 |
-
* @uses ye_validate_id Get the name and video type
|
204 |
-
* @uses ye_error Return an error
|
205 |
-
*
|
206 |
-
* @param string $id Video ID
|
207 |
-
* @return string Video name
|
208 |
-
*/
|
209 |
-
|
210 |
-
function get_youtube_name( $id ) {
|
211 |
-
|
212 |
-
// Extract the ID if a full URL has been specified
|
213 |
-
$id = ye_extract_id( $id );
|
214 |
-
|
215 |
-
// Check what type of video it is and whether it's valid
|
216 |
-
$return = ye_validate_id( $id, true );
|
217 |
-
$embed_type = $return[ 'type' ];
|
218 |
-
if ( strlen( $embed_type ) > 1 ) {
|
219 |
-
echo ye_error( $embed_type );
|
220 |
-
} else {
|
221 |
-
echo ye_error( 'The YouTube ID of ' . $id . ' is invalid.' );
|
222 |
-
}
|
223 |
-
|
224 |
-
// Return the video title
|
225 |
-
return $return['title'];
|
226 |
-
}
|
227 |
-
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/generate-download-code.php
DELETED
@@ -1,41 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Generate Download Code
|
4 |
-
*
|
5 |
-
* Create code to allow a YouTube video to be downloaded
|
6 |
-
*
|
7 |
-
* @package YouTubeEmbed
|
8 |
-
* @since 2.0
|
9 |
-
*
|
10 |
-
* @uses ye_extract_id Extract an ID from a string
|
11 |
-
* @uses ye_validate_id Confirm the type of video
|
12 |
-
* @uses ye_error Display an error
|
13 |
-
*
|
14 |
-
* @param string $id YouTube video ID
|
15 |
-
* @param string $target Link target
|
16 |
-
* @param string $nofollow Use rel="nofollow" ?
|
17 |
-
* @param string $text Text to add link to
|
18 |
-
* @return string URL
|
19 |
-
*/
|
20 |
-
|
21 |
-
function ye_generate_download_code( $id ) {
|
22 |
-
|
23 |
-
if ( $id == '' ) { return ye_error( 'No YouTube ID was found.' ); }
|
24 |
-
|
25 |
-
// Extract the ID if a full URL has been specified
|
26 |
-
$id = ye_extract_id( $id );
|
27 |
-
|
28 |
-
// Check what type of video it is and whether it's valid
|
29 |
-
$embed_type = ye_validate_id( $id );
|
30 |
-
if ( $embed_type != 'v' ) {
|
31 |
-
if ( strlen( $embed_type ) > 1 ) {
|
32 |
-
return ye_error( $embed_type );
|
33 |
-
} else {
|
34 |
-
return ye_error( 'The YouTube ID of ' . $id . ' is invalid.' );
|
35 |
-
}
|
36 |
-
}
|
37 |
-
|
38 |
-
// Create the link
|
39 |
-
return 'http://www.savevid.com/?url=http://www.youtube.com/watch?' . $embed_type . '=' . $id;
|
40 |
-
}
|
41 |
-
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 YouTubeEmbed
|
8 |
-
* @since 2.0
|
9 |
-
*
|
10 |
-
* @uses ye_extract_id Extract an ID from a string
|
11 |
-
* @uses ye_validate_id Confirm the type of video
|
12 |
-
* @uses ye_error Display an error
|
13 |
-
*
|
14 |
-
* @param string $id YouTube video ID
|
15 |
-
* @return string $youtube_code Code
|
16 |
-
*/
|
17 |
-
|
18 |
-
function ye_generate_shorturl_code( $id ) {
|
19 |
-
|
20 |
-
// Check that an ID has been specified
|
21 |
-
if ( $id == '' ) {
|
22 |
-
return ye_error( 'No video ID has been supplied' );
|
23 |
-
} else {
|
24 |
-
|
25 |
-
// Extract the ID if a full URL has been specified
|
26 |
-
$id = ye_extract_id( $id );
|
27 |
-
|
28 |
-
// Check what type of video it is and whether it's valid
|
29 |
-
$embed_type = ye_validate_id( $id );
|
30 |
-
if ( $embed_type != 'v' ) {
|
31 |
-
if ( strlen( $embed_type ) > 1 ) {
|
32 |
-
return ye_error( $embed_type );
|
33 |
-
} else {
|
34 |
-
return ye_error( 'The YouTube ID of ' . $id . ' is invalid.' );
|
35 |
-
}
|
36 |
-
}
|
37 |
-
|
38 |
-
return 'http://youtu.be/' . $id;
|
39 |
-
}
|
40 |
-
}
|
41 |
-
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
js/{ye-gatracker UNCOMPRESSED.js → aye-ga-tracker UNCOMPRESSED.js}
RENAMED
File without changes
|
js/{ye-gatracker.js → aye-ga-tracker.js}
RENAMED
File without changes
|
js/{ye-mcebutton UNCOMPRESSED.js → aye-mce-button UNCOMPRESSED.js }
RENAMED
@@ -9,13 +9,13 @@
|
|
9 |
} else {
|
10 |
var yeOut = ed.selection.getContent();
|
11 |
}
|
12 |
-
ed.selection.setContent('[youtube]' + yeOut + '[/youtube]');
|
13 |
}
|
14 |
});
|
15 |
},
|
16 |
createControl : function(n, cm) {
|
17 |
return null;
|
18 |
-
}
|
19 |
});
|
20 |
tinymce.PluginManager.add('YouTube', tinymce.plugins.youtube);
|
21 |
})();
|
9 |
} else {
|
10 |
var yeOut = ed.selection.getContent();
|
11 |
}
|
12 |
+
ed.selection.setContent('[youtube]' + yeOut + '[/youtube]');
|
13 |
}
|
14 |
});
|
15 |
},
|
16 |
createControl : function(n, cm) {
|
17 |
return null;
|
18 |
+
}
|
19 |
});
|
20 |
tinymce.PluginManager.add('YouTube', tinymce.plugins.youtube);
|
21 |
})();
|
js/{ye-mcebutton.js → aye-mce-button.js}
RENAMED
@@ -1 +1 @@
|
|
1 |
-
(function(){tinymce.create('tinymce.plugins.youtube',{init:function(ed,url){ed.addButton('YouTube',{title:'YouTube Embed',onclick:function(){if(ed.selection.getContent()==''){var yeOut='Insert video URL or ID here'}else{var yeOut=ed.selection.getContent()}ed.selection.setContent('[youtube]'+yeOut+'[/youtube]')}})},createControl:function(n,cm){return null}
|
1 |
+
(function(){tinymce.create('tinymce.plugins.youtube',{init:function(ed,url){ed.addButton('YouTube',{title:'YouTube Embed',onclick:function(){if(ed.selection.getContent()==''){var yeOut='Insert video URL or ID here'}else{var yeOut=ed.selection.getContent()}ed.selection.setContent('[youtube]'+yeOut+'[/youtube]')}})},createControl:function(n,cm){return null}});tinymce.PluginManager.add('YouTube',tinymce.plugins.youtube)})();
|
languages/youtube-embed.mo
ADDED
Binary file
|
languages/youtube-embed.po
ADDED
@@ -0,0 +1,1106 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
msgid ""
|
2 |
+
msgstr ""
|
3 |
+
"Project-Id-Version: Artiss Currency Converter\n"
|
4 |
+
"Report-Msgid-Bugs-To: \n"
|
5 |
+
"POT-Creation-Date: 2012-05-18 16:19-0000\n"
|
6 |
+
"PO-Revision-Date: 2012-05-18 16:20-0000\n"
|
7 |
+
"Last-Translator: David Artiss <david.artiss@artiss.co.uk>\n"
|
8 |
+
"Language-Team: \n"
|
9 |
+
"MIME-Version: 1.0\n"
|
10 |
+
"Content-Type: text/plain; charset=UTF-8\n"
|
11 |
+
"Content-Transfer-Encoding: 8bit\n"
|
12 |
+
"X-Poedit-KeywordsList: __;_e;esc_attr__;esc_attr_e;esc_html__;esc_html_e;_x;_ex;esc_attr_x;esc_html_x;_n;_nx;_n_noop;_nx_noop\n"
|
13 |
+
"X-Poedit-Basepath: ../\n"
|
14 |
+
"X-Poedit-SearchPath-0: .\n"
|
15 |
+
|
16 |
+
#: includes/aye-add-to-admin-bar.php:36
|
17 |
+
#: includes/aye-add-to-admin-bar.php:73
|
18 |
+
msgid "YouTube Embed"
|
19 |
+
msgstr ""
|
20 |
+
|
21 |
+
#: includes/aye-add-to-admin-bar.php:78
|
22 |
+
#: includes/aye-admin-config.php:88
|
23 |
+
msgid "Options"
|
24 |
+
msgstr ""
|
25 |
+
|
26 |
+
#: includes/aye-add-to-admin-bar.php:85
|
27 |
+
#: includes/aye-admin-config.php:98
|
28 |
+
msgid "Profiles"
|
29 |
+
msgstr ""
|
30 |
+
|
31 |
+
#: includes/aye-add-to-admin-bar.php:92
|
32 |
+
#: includes/aye-admin-config.php:108
|
33 |
+
msgid "Lists"
|
34 |
+
msgstr ""
|
35 |
+
|
36 |
+
#: includes/aye-add-to-admin-bar.php:99
|
37 |
+
#: includes/aye-admin-config.php:117
|
38 |
+
msgid "README"
|
39 |
+
msgstr ""
|
40 |
+
|
41 |
+
#: includes/aye-admin-config.php:29
|
42 |
+
msgid "Settings"
|
43 |
+
msgstr ""
|
44 |
+
|
45 |
+
#: includes/aye-admin-config.php:54
|
46 |
+
msgid "Support"
|
47 |
+
msgstr ""
|
48 |
+
|
49 |
+
#: includes/aye-admin-config.php:56
|
50 |
+
msgid "Donate"
|
51 |
+
msgstr ""
|
52 |
+
|
53 |
+
#: includes/aye-admin-config.php:82
|
54 |
+
msgid "Artiss YouTube Embed Settings"
|
55 |
+
msgstr ""
|
56 |
+
|
57 |
+
#: includes/aye-admin-config.php:82
|
58 |
+
msgid "YouTube"
|
59 |
+
msgstr ""
|
60 |
+
|
61 |
+
#: includes/aye-admin-config.php:88
|
62 |
+
msgid "Artiss YouTube Embed Options"
|
63 |
+
msgstr ""
|
64 |
+
|
65 |
+
#: includes/aye-admin-config.php:98
|
66 |
+
msgid "Artiss YouTube Embed Profiles"
|
67 |
+
msgstr ""
|
68 |
+
|
69 |
+
#: includes/aye-admin-config.php:108
|
70 |
+
msgid "Artiss YouTube Embed Lists"
|
71 |
+
msgstr ""
|
72 |
+
|
73 |
+
#: includes/aye-admin-config.php:117
|
74 |
+
msgid "Artiss YouTube Embed README"
|
75 |
+
msgstr ""
|
76 |
+
|
77 |
+
#: includes/aye-admin-config.php:124
|
78 |
+
#: includes/aye-display-about.php:14
|
79 |
+
msgid "About Artiss YouTube Embed"
|
80 |
+
msgstr ""
|
81 |
+
|
82 |
+
#: includes/aye-admin-config.php:124
|
83 |
+
msgid "About"
|
84 |
+
msgstr ""
|
85 |
+
|
86 |
+
#: includes/aye-admin-config.php:246
|
87 |
+
#: includes/aye-admin-config.php:288
|
88 |
+
#: includes/aye-admin-config.php:331
|
89 |
+
#: includes/aye-admin-config.php:373
|
90 |
+
msgid "Help"
|
91 |
+
msgstr ""
|
92 |
+
|
93 |
+
#: includes/aye-admin-config.php:261
|
94 |
+
msgid "This screen allows you to select non-specific options for the Artiss YouTube Embed plugin. For the default embedding settings, please select the <a href=\"admin.php?page=aye-profile-options\">Profiles</a> administration option."
|
95 |
+
msgstr ""
|
96 |
+
|
97 |
+
#: includes/aye-admin-config.php:262
|
98 |
+
#: includes/aye-admin-config.php:304
|
99 |
+
#: includes/aye-admin-config.php:347
|
100 |
+
msgid "Remember to click the Save Settings button at the bottom of the screen for new settings to take effect."
|
101 |
+
msgstr ""
|
102 |
+
|
103 |
+
#: includes/aye-admin-config.php:263
|
104 |
+
#: includes/aye-admin-config.php:305
|
105 |
+
#: includes/aye-admin-config.php:348
|
106 |
+
#: includes/aye-admin-config.php:389
|
107 |
+
msgid "For more information:"
|
108 |
+
msgstr ""
|
109 |
+
|
110 |
+
#: includes/aye-admin-config.php:264
|
111 |
+
#: includes/aye-admin-config.php:306
|
112 |
+
#: includes/aye-admin-config.php:349
|
113 |
+
#: includes/aye-admin-config.php:390
|
114 |
+
msgid "Artiss YouTube Embed Plugin Documentation"
|
115 |
+
msgstr ""
|
116 |
+
|
117 |
+
#: includes/aye-admin-config.php:265
|
118 |
+
#: includes/aye-admin-config.php:307
|
119 |
+
#: includes/aye-admin-config.php:350
|
120 |
+
#: includes/aye-admin-config.php:391
|
121 |
+
msgid "YouTube Player Documentation"
|
122 |
+
msgstr ""
|
123 |
+
|
124 |
+
#: includes/aye-admin-config.php:266
|
125 |
+
#: includes/aye-admin-config.php:309
|
126 |
+
#: includes/aye-admin-config.php:351
|
127 |
+
#: includes/aye-admin-config.php:392
|
128 |
+
#: includes/aye-display-about.php:40
|
129 |
+
msgid "This plugin, and all support, is supplied for free, but <a title=\"Donate\" href=\"http://artiss.co.uk/donate\" target=\"_blank\">donations</a> are always welcome."
|
130 |
+
msgstr ""
|
131 |
+
|
132 |
+
#: includes/aye-admin-config.php:303
|
133 |
+
msgid "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."
|
134 |
+
msgstr ""
|
135 |
+
|
136 |
+
#: includes/aye-admin-config.php:308
|
137 |
+
msgid "EmbedPlus website"
|
138 |
+
msgstr ""
|
139 |
+
|
140 |
+
#: includes/aye-admin-config.php:346
|
141 |
+
msgid "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."
|
142 |
+
msgstr ""
|
143 |
+
|
144 |
+
#: includes/aye-admin-config.php:388
|
145 |
+
msgid "This screen provides useful information about this plugin along with methods of support."
|
146 |
+
msgstr ""
|
147 |
+
|
148 |
+
#: includes/aye-admin-config.php:450
|
149 |
+
msgid "Welcome to Artiss YouTube Embed"
|
150 |
+
msgstr ""
|
151 |
+
|
152 |
+
#: includes/aye-admin-config.php:451
|
153 |
+
msgid "Thank you for installing this plugin."
|
154 |
+
msgstr ""
|
155 |
+
|
156 |
+
#: includes/aye-admin-config.php:452
|
157 |
+
msgid "These new menu options will allow you to configure your videos to just how you want them and provide links for help and support."
|
158 |
+
msgstr ""
|
159 |
+
|
160 |
+
#: includes/aye-admin-config.php:453
|
161 |
+
msgid "Even if you do nothing else, please visit the Profiles option to check your default video values."
|
162 |
+
msgstr ""
|
163 |
+
|
164 |
+
#: includes/aye-deprecated.php:55
|
165 |
+
msgid "This function does not support playlists"
|
166 |
+
msgstr ""
|
167 |
+
|
168 |
+
#: includes/aye-display-about.php:16
|
169 |
+
#, php-format
|
170 |
+
msgid "You are using Artiss YouTube Embed version %s. It was written by David Artiss."
|
171 |
+
msgstr ""
|
172 |
+
|
173 |
+
#: includes/aye-display-about.php:22
|
174 |
+
msgid "Copyrights"
|
175 |
+
msgstr ""
|
176 |
+
|
177 |
+
#: includes/aye-display-about.php:24
|
178 |
+
msgid "YouTube, and all associated logos, is the copyright of Google Inc."
|
179 |
+
msgstr ""
|
180 |
+
|
181 |
+
#: includes/aye-display-about.php:26
|
182 |
+
msgid "EmbedPlus is copyright. Read the <a href=\"http://embedplus.com/terms.aspx\" target=\"_blank\">Terms & Conditions of Use</a>."
|
183 |
+
msgstr ""
|
184 |
+
|
185 |
+
#: includes/aye-display-about.php:28
|
186 |
+
msgid "Acknowledgements"
|
187 |
+
msgstr ""
|
188 |
+
|
189 |
+
#: includes/aye-display-about.php:30
|
190 |
+
msgid "Images have been compressed with <a href=\"http://www.smushit.com/ysmush.it/\">Smush.it</a>."
|
191 |
+
msgstr ""
|
192 |
+
|
193 |
+
#: includes/aye-display-about.php:32
|
194 |
+
msgid "JavaScript has been compressed with <a href=\"http://javascriptcompressor.com/\">JavaScript Compressor</a>."
|
195 |
+
msgstr ""
|
196 |
+
|
197 |
+
#: includes/aye-display-about.php:34
|
198 |
+
msgid "YouTube icons are courtesy of <a href=\"http://www.youtube.com/t/creators_downloads\">YouTube</a>. Other icons are by <a href=\"http://p.yusukekamiyamane.com/\">Yusuke Kamiyamane</a>."
|
199 |
+
msgstr ""
|
200 |
+
|
201 |
+
#: includes/aye-display-about.php:36
|
202 |
+
msgid "Support Information"
|
203 |
+
msgstr ""
|
204 |
+
|
205 |
+
#: includes/aye-display-about.php:38
|
206 |
+
msgid "Useful support information and links can be found by clicking on the Help tab at the top of each of the Artiss YouTube Embed administration screens."
|
207 |
+
msgstr ""
|
208 |
+
|
209 |
+
#: includes/aye-display-about.php:42
|
210 |
+
msgid "Stay in Touch"
|
211 |
+
msgstr ""
|
212 |
+
|
213 |
+
#: includes/aye-display-about.php:44
|
214 |
+
msgid "<a href=\"http://www.artiss.co.uk/wp-plugins\">See the full list</a> of Artiss plugins, including beta releases."
|
215 |
+
msgstr ""
|
216 |
+
|
217 |
+
#: includes/aye-display-about.php:46
|
218 |
+
msgid "<a href=\"http://www.twitter.com/artiss_tech\">Follow Artiss.co.uk</a> on Twitter."
|
219 |
+
msgstr ""
|
220 |
+
|
221 |
+
#: includes/aye-display-about.php:48
|
222 |
+
msgid "<a href=\"http://www.artiss.co.uk/feed\">Subscribe</a> to the Artiss.co.uk news feed."
|
223 |
+
msgstr ""
|
224 |
+
|
225 |
+
#: includes/aye-display-readme.php:16
|
226 |
+
msgid " README"
|
227 |
+
msgstr ""
|
228 |
+
|
229 |
+
#: includes/aye-function-calls.php:162
|
230 |
+
#: includes/aye-function-calls.php:223
|
231 |
+
#: includes/aye-generate-download-code.php:34
|
232 |
+
#: includes/aye-generate-shorturl-code.php:34
|
233 |
+
#: includes/aye-generate-thumbnail-code.php:37
|
234 |
+
#: includes/aye-generate-transcript-code.php:38
|
235 |
+
#, php-format
|
236 |
+
msgid "The YouTube ID of %s is invalid."
|
237 |
+
msgstr ""
|
238 |
+
|
239 |
+
#: includes/aye-function-calls.php:173
|
240 |
+
#, php-format
|
241 |
+
msgid "Could not fetch the transcript file %s."
|
242 |
+
msgstr ""
|
243 |
+
|
244 |
+
#: includes/aye-generate-download-code.php:23
|
245 |
+
msgid "No YouTube ID was found."
|
246 |
+
msgstr ""
|
247 |
+
|
248 |
+
#: includes/aye-generate-embed-code.php:65
|
249 |
+
msgid "No video/playlist ID has been supplied"
|
250 |
+
msgstr ""
|
251 |
+
|
252 |
+
#: includes/aye-generate-embed-code.php:183
|
253 |
+
msgid "A video list cannot be viewed within this feed - please view the original content"
|
254 |
+
msgstr ""
|
255 |
+
|
256 |
+
#: includes/aye-generate-embed-code.php:187
|
257 |
+
msgid "Click here to view the video on YouTube"
|
258 |
+
msgstr ""
|
259 |
+
|
260 |
+
#: includes/aye-generate-shorturl-code.php:22
|
261 |
+
msgid "No video ID has been supplied"
|
262 |
+
msgstr ""
|
263 |
+
|
264 |
+
#: includes/aye-generate-widgets.php:25
|
265 |
+
msgid "Embed YouTube Widget."
|
266 |
+
msgstr ""
|
267 |
+
|
268 |
+
#: includes/aye-options-general.php:57
|
269 |
+
#: includes/aye-options-lists.php:26
|
270 |
+
msgid "Settings Saved."
|
271 |
+
msgstr ""
|
272 |
+
|
273 |
+
#: includes/aye-options-general.php:74
|
274 |
+
msgid "Cache cleared."
|
275 |
+
msgstr ""
|
276 |
+
|
277 |
+
#: includes/aye-options-general.php:87
|
278 |
+
msgid "These are the general settings for Artiss YouTube Embed. Please select <a href=\"admin.php?page=aye-profile-options\">Profiles</a> for default embedding settings."
|
279 |
+
msgstr ""
|
280 |
+
|
281 |
+
#: includes/aye-options-general.php:91
|
282 |
+
msgid "Embedding"
|
283 |
+
msgstr ""
|
284 |
+
|
285 |
+
#: includes/aye-options-general.php:95
|
286 |
+
msgid "Add Metadata"
|
287 |
+
msgstr ""
|
288 |
+
|
289 |
+
#: includes/aye-options-general.php:96
|
290 |
+
msgid "Allow rich metadata to be added to code. <a href=\"http://www.artiss.co.uk/artiss-youtube-embed/further-help#ye-metadata\">Learn more</a>"
|
291 |
+
msgstr ""
|
292 |
+
|
293 |
+
#: includes/aye-options-general.php:100
|
294 |
+
msgid "Comment Embedding"
|
295 |
+
msgstr ""
|
296 |
+
|
297 |
+
#: includes/aye-options-general.php:101
|
298 |
+
msgid "Allow YouTube URLs in comments - will display as embedded videos. <a href=\"http://www.artiss.co.uk/artiss-youtube-embed/further-help#ye-comments\">Learn more</a>"
|
299 |
+
msgstr ""
|
300 |
+
|
301 |
+
#: includes/aye-options-general.php:105
|
302 |
+
#: includes/aye-options-general.php:141
|
303 |
+
#: includes/aye-options-general.php:153
|
304 |
+
#: includes/aye-options-general.php:174
|
305 |
+
msgid "Profile to use"
|
306 |
+
msgstr ""
|
307 |
+
|
308 |
+
#: includes/aye-options-general.php:112
|
309 |
+
msgid "Feed"
|
310 |
+
msgstr ""
|
311 |
+
|
312 |
+
#: includes/aye-options-general.php:114
|
313 |
+
msgid "Text link"
|
314 |
+
msgstr ""
|
315 |
+
|
316 |
+
#: includes/aye-options-general.php:115
|
317 |
+
msgid "Thumbnail"
|
318 |
+
msgstr ""
|
319 |
+
|
320 |
+
#: includes/aye-options-general.php:116
|
321 |
+
msgid "Thumbnail & Text Link"
|
322 |
+
msgstr ""
|
323 |
+
|
324 |
+
#: includes/aye-options-general.php:117
|
325 |
+
msgid "Videos cannot be embedded in feeds. Select how you wish them to be shown instead"
|
326 |
+
msgstr ""
|
327 |
+
|
328 |
+
#: includes/aye-options-general.php:121
|
329 |
+
msgid "Thumbnail to use"
|
330 |
+
msgstr ""
|
331 |
+
|
332 |
+
#: includes/aye-options-general.php:123
|
333 |
+
#: includes/aye-shared-functions.php:425
|
334 |
+
msgid "Default"
|
335 |
+
msgstr ""
|
336 |
+
|
337 |
+
#: includes/aye-options-general.php:124
|
338 |
+
msgid "Default (HQ)"
|
339 |
+
msgstr ""
|
340 |
+
|
341 |
+
#: includes/aye-options-general.php:125
|
342 |
+
msgid "Start"
|
343 |
+
msgstr ""
|
344 |
+
|
345 |
+
#: includes/aye-options-general.php:126
|
346 |
+
msgid "Middle"
|
347 |
+
msgstr ""
|
348 |
+
|
349 |
+
#: includes/aye-options-general.php:127
|
350 |
+
msgid "End"
|
351 |
+
msgstr ""
|
352 |
+
|
353 |
+
#: includes/aye-options-general.php:128
|
354 |
+
msgid "Which thumbnail to use"
|
355 |
+
msgstr ""
|
356 |
+
|
357 |
+
#: includes/aye-options-general.php:132
|
358 |
+
msgid "Alternative Shortcodes"
|
359 |
+
msgstr ""
|
360 |
+
|
361 |
+
#: includes/aye-options-general.php:136
|
362 |
+
msgid "Alternative Shortcode 1"
|
363 |
+
msgstr ""
|
364 |
+
|
365 |
+
#: includes/aye-options-general.php:148
|
366 |
+
msgid "Alternative Shortcode 2"
|
367 |
+
msgstr ""
|
368 |
+
|
369 |
+
#: includes/aye-options-general.php:160
|
370 |
+
msgid "Migration"
|
371 |
+
msgstr ""
|
372 |
+
|
373 |
+
#: includes/aye-options-general.php:164
|
374 |
+
msgid "Bracket Embedding"
|
375 |
+
msgstr ""
|
376 |
+
|
377 |
+
#: includes/aye-options-general.php:165
|
378 |
+
msgid "Allow embedding using URLs within brackets. Activating impacts performance"
|
379 |
+
msgstr ""
|
380 |
+
|
381 |
+
#: includes/aye-options-general.php:169
|
382 |
+
msgid "Alternative Embedding"
|
383 |
+
msgstr ""
|
384 |
+
|
385 |
+
#: includes/aye-options-general.php:170
|
386 |
+
msgid "Allow all other types of embedding. Activating impacts performance"
|
387 |
+
msgstr ""
|
388 |
+
|
389 |
+
#: includes/aye-options-general.php:177
|
390 |
+
msgid "For above 2 options"
|
391 |
+
msgstr ""
|
392 |
+
|
393 |
+
#: includes/aye-options-general.php:181
|
394 |
+
msgid "Admin Options"
|
395 |
+
msgstr ""
|
396 |
+
|
397 |
+
#: includes/aye-options-general.php:185
|
398 |
+
msgid "Show YouTube Button"
|
399 |
+
msgstr ""
|
400 |
+
|
401 |
+
#: includes/aye-options-general.php:186
|
402 |
+
msgid "Show the YouTube button on the post editor"
|
403 |
+
msgstr ""
|
404 |
+
|
405 |
+
#: includes/aye-options-general.php:190
|
406 |
+
msgid "Add to Admin Bar"
|
407 |
+
msgstr ""
|
408 |
+
|
409 |
+
#: includes/aye-options-general.php:191
|
410 |
+
msgid "Add link to options screen to Admin Bar"
|
411 |
+
msgstr ""
|
412 |
+
|
413 |
+
#: includes/aye-options-general.php:195
|
414 |
+
msgid "Profile & List Sizes"
|
415 |
+
msgstr ""
|
416 |
+
|
417 |
+
#: includes/aye-options-general.php:199
|
418 |
+
msgid "Number of Profiles"
|
419 |
+
msgstr ""
|
420 |
+
|
421 |
+
#: includes/aye-options-general.php:200
|
422 |
+
msgid "Maximum number of profiles"
|
423 |
+
msgstr ""
|
424 |
+
|
425 |
+
#: includes/aye-options-general.php:204
|
426 |
+
msgid "Number of Lists"
|
427 |
+
msgstr ""
|
428 |
+
|
429 |
+
#: includes/aye-options-general.php:205
|
430 |
+
msgid "Maximum number of lists"
|
431 |
+
msgstr ""
|
432 |
+
|
433 |
+
#: includes/aye-options-general.php:209
|
434 |
+
msgid "Performance"
|
435 |
+
msgstr ""
|
436 |
+
|
437 |
+
#: includes/aye-options-general.php:213
|
438 |
+
msgid "Embed Cache"
|
439 |
+
msgstr ""
|
440 |
+
|
441 |
+
#: includes/aye-options-general.php:214
|
442 |
+
msgid "How many hours to retain embed output. 0 to switch off"
|
443 |
+
msgstr ""
|
444 |
+
|
445 |
+
#: includes/aye-options-general.php:218
|
446 |
+
msgid "Video Information Cache"
|
447 |
+
msgstr ""
|
448 |
+
|
449 |
+
#: includes/aye-options-general.php:219
|
450 |
+
msgid "How many hours to retain video information, including it's validity. 0 to switch off"
|
451 |
+
msgstr ""
|
452 |
+
|
453 |
+
#: includes/aye-options-general.php:223
|
454 |
+
msgid "Transcript Cache"
|
455 |
+
msgstr ""
|
456 |
+
|
457 |
+
#: includes/aye-options-general.php:224
|
458 |
+
msgid "How many hours to store transcripts for in cache. 0 to switch off"
|
459 |
+
msgstr ""
|
460 |
+
|
461 |
+
#: includes/aye-options-general.php:233
|
462 |
+
msgid "Clear Cache"
|
463 |
+
msgstr ""
|
464 |
+
|
465 |
+
#: includes/aye-options-general.php:234
|
466 |
+
#, php-format
|
467 |
+
msgid "Select this option to remove all YouTube Embed cache. You currently have %d cached video(s)"
|
468 |
+
msgstr ""
|
469 |
+
|
470 |
+
#: includes/aye-options-general.php:238
|
471 |
+
msgid "YouTube API"
|
472 |
+
msgstr ""
|
473 |
+
|
474 |
+
#: includes/aye-options-general.php:240
|
475 |
+
msgid "The YouTube API is used to validate video IDs and to determine if it is a video or playlist."
|
476 |
+
msgstr ""
|
477 |
+
|
478 |
+
#: includes/aye-options-general.php:244
|
479 |
+
msgid "API State"
|
480 |
+
msgstr ""
|
481 |
+
|
482 |
+
#: includes/aye-options-general.php:246
|
483 |
+
msgid "API should not be used"
|
484 |
+
msgstr ""
|
485 |
+
|
486 |
+
#: includes/aye-options-general.php:247
|
487 |
+
msgid "HTTP API used and errors are reported"
|
488 |
+
msgstr ""
|
489 |
+
|
490 |
+
#: includes/aye-options-general.php:248
|
491 |
+
msgid "HTTPS API used and errors are reported"
|
492 |
+
msgstr ""
|
493 |
+
|
494 |
+
#: includes/aye-options-general.php:249
|
495 |
+
msgid "HTTP API used and no errors are reported"
|
496 |
+
msgstr ""
|
497 |
+
|
498 |
+
#: includes/aye-options-general.php:250
|
499 |
+
msgid "HTTPS API used and no errors are reported"
|
500 |
+
msgstr ""
|
501 |
+
|
502 |
+
#: includes/aye-options-general.php:255
|
503 |
+
msgid "Error Reporting"
|
504 |
+
msgstr ""
|
505 |
+
|
506 |
+
#: includes/aye-options-general.php:257
|
507 |
+
msgid "Playback errors are within the XHTML source code as comments - parameter errors and other types are displayed on the post output."
|
508 |
+
msgstr ""
|
509 |
+
|
510 |
+
#: includes/aye-options-general.php:260
|
511 |
+
msgid "Video Playback Error Message"
|
512 |
+
msgstr ""
|
513 |
+
|
514 |
+
#: includes/aye-options-general.php:261
|
515 |
+
msgid "This is the message that will be shown on the post"
|
516 |
+
msgstr ""
|
517 |
+
|
518 |
+
#: includes/aye-options-general.php:264
|
519 |
+
msgid "Security"
|
520 |
+
msgstr ""
|
521 |
+
|
522 |
+
#: includes/aye-options-general.php:267
|
523 |
+
msgid "Privacy-Enhanced Mode"
|
524 |
+
msgstr ""
|
525 |
+
|
526 |
+
#: includes/aye-options-general.php:268
|
527 |
+
msgid "When on, the player on this site will not store cookies"
|
528 |
+
msgstr ""
|
529 |
+
|
530 |
+
#: includes/aye-options-general.php:271
|
531 |
+
msgid "Compatability"
|
532 |
+
msgstr ""
|
533 |
+
|
534 |
+
#: includes/aye-options-general.php:274
|
535 |
+
msgid "Allow Frame Border on IFRAME"
|
536 |
+
msgstr ""
|
537 |
+
|
538 |
+
#: includes/aye-options-general.php:275
|
539 |
+
msgid "FRAMEBORDER is not HTML5 compliant"
|
540 |
+
msgstr ""
|
541 |
+
|
542 |
+
#: includes/aye-options-general.php:280
|
543 |
+
#: includes/aye-options-lists.php:119
|
544 |
+
#: includes/aye-options-profiles.php:345
|
545 |
+
msgid "Save Settings"
|
546 |
+
msgstr ""
|
547 |
+
|
548 |
+
#: includes/aye-options-lists.php:31
|
549 |
+
msgid "All fields must be completed."
|
550 |
+
msgstr ""
|
551 |
+
|
552 |
+
#: includes/aye-options-lists.php:53
|
553 |
+
msgid "Errors were found with your video list. See the list below for details."
|
554 |
+
msgstr ""
|
555 |
+
|
556 |
+
#: includes/aye-options-lists.php:88
|
557 |
+
msgid "List"
|
558 |
+
msgstr ""
|
559 |
+
|
560 |
+
#: includes/aye-options-lists.php:98
|
561 |
+
msgid "Change list"
|
562 |
+
msgstr ""
|
563 |
+
|
564 |
+
#: includes/aye-options-lists.php:101
|
565 |
+
msgid "These are the options for list "
|
566 |
+
msgstr ""
|
567 |
+
|
568 |
+
#: includes/aye-options-lists.php:101
|
569 |
+
msgid "Update the name, if required, and specify a list of YouTube video IDs. Use the drop-down on the right hand side to swap between lists."
|
570 |
+
msgstr ""
|
571 |
+
|
572 |
+
#: includes/aye-options-lists.php:106
|
573 |
+
msgid "List name"
|
574 |
+
msgstr ""
|
575 |
+
|
576 |
+
#: includes/aye-options-lists.php:108
|
577 |
+
msgid "The name you wish to give this list"
|
578 |
+
msgstr ""
|
579 |
+
|
580 |
+
#: includes/aye-options-lists.php:112
|
581 |
+
msgid "Video IDs (one per line)"
|
582 |
+
msgstr ""
|
583 |
+
|
584 |
+
#: includes/aye-options-lists.php:130
|
585 |
+
#: includes/aye-options-widgets.php:25
|
586 |
+
msgid "Video ID"
|
587 |
+
msgstr ""
|
588 |
+
|
589 |
+
#: includes/aye-options-lists.php:130
|
590 |
+
#: includes/aye-options-widgets.php:19
|
591 |
+
msgid "Video Title"
|
592 |
+
msgstr ""
|
593 |
+
|
594 |
+
#: includes/aye-options-lists.php:130
|
595 |
+
msgid "Status"
|
596 |
+
msgstr ""
|
597 |
+
|
598 |
+
#: includes/aye-options-lists.php:146
|
599 |
+
msgid "This is a playlist"
|
600 |
+
msgstr ""
|
601 |
+
|
602 |
+
#: includes/aye-options-lists.php:150
|
603 |
+
msgid "Invalid video ID"
|
604 |
+
msgstr ""
|
605 |
+
|
606 |
+
#: includes/aye-options-lists.php:154
|
607 |
+
msgid "YouTube API error"
|
608 |
+
msgstr ""
|
609 |
+
|
610 |
+
#: includes/aye-options-lists.php:157
|
611 |
+
msgid "Valid video"
|
612 |
+
msgstr ""
|
613 |
+
|
614 |
+
#: includes/aye-options-lists.php:175
|
615 |
+
msgid "The video ID is valid"
|
616 |
+
msgstr ""
|
617 |
+
|
618 |
+
#: includes/aye-options-lists.php:178
|
619 |
+
msgid "The video ID is invalid"
|
620 |
+
msgstr ""
|
621 |
+
|
622 |
+
#: includes/aye-options-profiles.php:98
|
623 |
+
msgid " Profile Saved."
|
624 |
+
msgstr ""
|
625 |
+
|
626 |
+
#: includes/aye-options-profiles.php:117
|
627 |
+
msgid "Change profile"
|
628 |
+
msgstr ""
|
629 |
+
|
630 |
+
#: includes/aye-options-profiles.php:122
|
631 |
+
msgid "These are the options for the default profile."
|
632 |
+
msgstr ""
|
633 |
+
|
634 |
+
#: includes/aye-options-profiles.php:124
|
635 |
+
#, php-format
|
636 |
+
msgid "These are the options for profile %s."
|
637 |
+
msgstr ""
|
638 |
+
|
639 |
+
#: includes/aye-options-profiles.php:126
|
640 |
+
msgid "Use the drop-down on the right hand side to swap between profiles."
|
641 |
+
msgstr ""
|
642 |
+
|
643 |
+
#: includes/aye-options-profiles.php:132
|
644 |
+
msgid "Profile name"
|
645 |
+
msgstr ""
|
646 |
+
|
647 |
+
#: includes/aye-options-profiles.php:134
|
648 |
+
msgid "The name you wish to give this profile"
|
649 |
+
msgstr ""
|
650 |
+
|
651 |
+
#: includes/aye-options-profiles.php:138
|
652 |
+
msgid "Video Embed Type"
|
653 |
+
msgstr ""
|
654 |
+
|
655 |
+
#: includes/aye-options-profiles.php:139
|
656 |
+
msgid "The type of player to use for videos."
|
657 |
+
msgstr ""
|
658 |
+
|
659 |
+
#: includes/aye-options-profiles.php:140
|
660 |
+
#: includes/aye-options-profiles.php:150
|
661 |
+
#: includes/aye-options-profiles.php:323
|
662 |
+
#: includes/aye-options-widgets.php:95
|
663 |
+
msgid "IFRAME"
|
664 |
+
msgstr ""
|
665 |
+
|
666 |
+
#: includes/aye-options-profiles.php:140
|
667 |
+
msgid "Uses HTML5, if available. Alternatively, uses AS3 Flash player. This is the current YouTube default.."
|
668 |
+
msgstr ""
|
669 |
+
|
670 |
+
#: includes/aye-options-profiles.php:141
|
671 |
+
#: includes/aye-options-profiles.php:151
|
672 |
+
#: includes/aye-options-profiles.php:324
|
673 |
+
#: includes/aye-options-widgets.php:97
|
674 |
+
msgid "OBJECT"
|
675 |
+
msgstr ""
|
676 |
+
|
677 |
+
#: includes/aye-options-profiles.php:141
|
678 |
+
msgid "Use the AS3 Flash player."
|
679 |
+
msgstr ""
|
680 |
+
|
681 |
+
#: includes/aye-options-profiles.php:142
|
682 |
+
#: includes/aye-options-widgets.php:99
|
683 |
+
msgid "Chromeless"
|
684 |
+
msgstr ""
|
685 |
+
|
686 |
+
#: includes/aye-options-profiles.php:142
|
687 |
+
msgid "Use the <a href=\"http://www.artiss.co.uk/artiss-youtube-embed/further-help#ye-chromeless\">Chromeless</a> version of the AS3 Flash Player."
|
688 |
+
msgstr ""
|
689 |
+
|
690 |
+
#: includes/aye-options-profiles.php:143
|
691 |
+
#: includes/aye-options-profiles.php:359
|
692 |
+
#: includes/aye-options-widgets.php:101
|
693 |
+
msgid "EmbedPlus"
|
694 |
+
msgstr ""
|
695 |
+
|
696 |
+
#: includes/aye-options-profiles.php:143
|
697 |
+
msgid "Use <a href=\"http://www.artiss.co.uk/artiss-youtube-embed/further-help#ye-embedplus\">EmbedPlus</a>, if Flash is available."
|
698 |
+
msgstr ""
|
699 |
+
|
700 |
+
#: includes/aye-options-profiles.php:148
|
701 |
+
msgid "Playlist Embed Type"
|
702 |
+
msgstr ""
|
703 |
+
|
704 |
+
#: includes/aye-options-profiles.php:149
|
705 |
+
msgid "The type of player to use when showing playlists."
|
706 |
+
msgstr ""
|
707 |
+
|
708 |
+
#: includes/aye-options-profiles.php:156
|
709 |
+
msgid "Options For All Player Types"
|
710 |
+
msgstr ""
|
711 |
+
|
712 |
+
#: includes/aye-options-profiles.php:160
|
713 |
+
#: includes/aye-options-widgets.php:55
|
714 |
+
msgid "Template"
|
715 |
+
msgstr ""
|
716 |
+
|
717 |
+
#: includes/aye-options-profiles.php:165
|
718 |
+
#: includes/aye-options-widgets.php:61
|
719 |
+
msgid "Style"
|
720 |
+
msgstr ""
|
721 |
+
|
722 |
+
#: includes/aye-options-profiles.php:172
|
723 |
+
msgid "Video size"
|
724 |
+
msgstr ""
|
725 |
+
|
726 |
+
#: includes/aye-options-profiles.php:173
|
727 |
+
msgid "The width x height of the video, in pixels"
|
728 |
+
msgstr ""
|
729 |
+
|
730 |
+
#: includes/aye-options-profiles.php:177
|
731 |
+
msgid "Default Sizes"
|
732 |
+
msgstr ""
|
733 |
+
|
734 |
+
#: includes/aye-options-profiles.php:179
|
735 |
+
msgid "Use above sizes"
|
736 |
+
msgstr ""
|
737 |
+
|
738 |
+
#: includes/aye-options-profiles.php:185
|
739 |
+
msgid "Select one of these default sizes to override the above video sizes"
|
740 |
+
msgstr ""
|
741 |
+
|
742 |
+
#: includes/aye-options-profiles.php:189
|
743 |
+
#: includes/aye-options-widgets.php:79
|
744 |
+
msgid "Dynamically Resize"
|
745 |
+
msgstr ""
|
746 |
+
|
747 |
+
#: includes/aye-options-profiles.php:190
|
748 |
+
msgid "Show full width and resize with the browser"
|
749 |
+
msgstr ""
|
750 |
+
|
751 |
+
#: includes/aye-options-profiles.php:194
|
752 |
+
msgid "Set Maximum Size"
|
753 |
+
msgstr ""
|
754 |
+
|
755 |
+
#: includes/aye-options-profiles.php:195
|
756 |
+
msgid "Use above width to define maximum size"
|
757 |
+
msgstr ""
|
758 |
+
|
759 |
+
#: includes/aye-options-profiles.php:202
|
760 |
+
msgid "Audio Only"
|
761 |
+
msgstr ""
|
762 |
+
|
763 |
+
#: includes/aye-options-profiles.php:203
|
764 |
+
msgid "Only show the toolbar for audio only playback"
|
765 |
+
msgstr ""
|
766 |
+
|
767 |
+
#: includes/aye-options-profiles.php:207
|
768 |
+
#: includes/aye-options-widgets.php:107
|
769 |
+
msgid "Autoplay"
|
770 |
+
msgstr ""
|
771 |
+
|
772 |
+
#: includes/aye-options-profiles.php:208
|
773 |
+
msgid "The video will start playing when the player loads"
|
774 |
+
msgstr ""
|
775 |
+
|
776 |
+
#: includes/aye-options-profiles.php:213
|
777 |
+
msgid "Options Not Supported by EmbedPlus"
|
778 |
+
msgstr ""
|
779 |
+
|
780 |
+
#: includes/aye-options-profiles.php:218
|
781 |
+
msgid "Auto hide"
|
782 |
+
msgstr ""
|
783 |
+
|
784 |
+
#: includes/aye-options-profiles.php:220
|
785 |
+
msgid "Controls & progress bar remain visible"
|
786 |
+
msgstr ""
|
787 |
+
|
788 |
+
#: includes/aye-options-profiles.php:221
|
789 |
+
msgid "Controls & progress bar fade out"
|
790 |
+
msgstr ""
|
791 |
+
|
792 |
+
#: includes/aye-options-profiles.php:222
|
793 |
+
msgid "Progress bar fades"
|
794 |
+
msgstr ""
|
795 |
+
|
796 |
+
#: includes/aye-options-profiles.php:223
|
797 |
+
msgid "Video controls will automatically hide after a video begins playing"
|
798 |
+
msgstr ""
|
799 |
+
|
800 |
+
#: includes/aye-options-profiles.php:227
|
801 |
+
msgid "Controls"
|
802 |
+
msgstr ""
|
803 |
+
|
804 |
+
#: includes/aye-options-profiles.php:228
|
805 |
+
msgid "Video player controls will display"
|
806 |
+
msgstr ""
|
807 |
+
|
808 |
+
#: includes/aye-options-profiles.php:232
|
809 |
+
msgid "SSL"
|
810 |
+
msgstr ""
|
811 |
+
|
812 |
+
#: includes/aye-options-profiles.php:233
|
813 |
+
msgid "Use SSL? <a href=\"http://www.google.com/support/youtube/bin/answer.py?answer=171780&expand=UseHTTPS#HTTPS\">Read more</a>"
|
814 |
+
msgstr ""
|
815 |
+
|
816 |
+
#: includes/aye-options-profiles.php:237
|
817 |
+
#: includes/aye-options-widgets.php:153
|
818 |
+
msgid "Loop Video"
|
819 |
+
msgstr ""
|
820 |
+
|
821 |
+
#: includes/aye-options-profiles.php:238
|
822 |
+
msgid "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"
|
823 |
+
msgstr ""
|
824 |
+
|
825 |
+
#: includes/aye-options-profiles.php:242
|
826 |
+
msgid "Information"
|
827 |
+
msgstr ""
|
828 |
+
|
829 |
+
#: includes/aye-options-profiles.php:243
|
830 |
+
msgid "Display the video title and uploader before the video starts"
|
831 |
+
msgstr ""
|
832 |
+
|
833 |
+
#: includes/aye-options-profiles.php:247
|
834 |
+
msgid "Theme"
|
835 |
+
msgstr ""
|
836 |
+
|
837 |
+
#: includes/aye-options-profiles.php:249
|
838 |
+
msgid "Dark"
|
839 |
+
msgstr ""
|
840 |
+
|
841 |
+
#: includes/aye-options-profiles.php:250
|
842 |
+
msgid "Light"
|
843 |
+
msgstr ""
|
844 |
+
|
845 |
+
#: includes/aye-options-profiles.php:251
|
846 |
+
msgid "Display player controls within a dark or light control bar"
|
847 |
+
msgstr ""
|
848 |
+
|
849 |
+
#: includes/aye-options-profiles.php:255
|
850 |
+
msgid "Options for AS3 Player"
|
851 |
+
msgstr ""
|
852 |
+
|
853 |
+
#: includes/aye-options-profiles.php:260
|
854 |
+
msgid "Annotations"
|
855 |
+
msgstr ""
|
856 |
+
|
857 |
+
#: includes/aye-options-profiles.php:261
|
858 |
+
msgid "Video annotations are shown by default"
|
859 |
+
msgstr ""
|
860 |
+
|
861 |
+
#: includes/aye-options-profiles.php:265
|
862 |
+
msgid "Closed Captions"
|
863 |
+
msgstr ""
|
864 |
+
|
865 |
+
#: includes/aye-options-profiles.php:266
|
866 |
+
msgid "Show closed captions (subtitles) by default, even if the user has turned captions off"
|
867 |
+
msgstr ""
|
868 |
+
|
869 |
+
#: includes/aye-options-profiles.php:270
|
870 |
+
msgid "Disable Keyboard"
|
871 |
+
msgstr ""
|
872 |
+
|
873 |
+
#: includes/aye-options-profiles.php:271
|
874 |
+
msgid "Disable the player keyboard controls"
|
875 |
+
msgstr ""
|
876 |
+
|
877 |
+
#: includes/aye-options-profiles.php:275
|
878 |
+
msgid "Fullscreen"
|
879 |
+
msgstr ""
|
880 |
+
|
881 |
+
#: includes/aye-options-profiles.php:276
|
882 |
+
msgid "A button will allow the viewer to watch the video fullscreen"
|
883 |
+
msgstr ""
|
884 |
+
|
885 |
+
#: includes/aye-options-profiles.php:280
|
886 |
+
msgid "Link to YouTube"
|
887 |
+
msgstr ""
|
888 |
+
|
889 |
+
#: includes/aye-options-profiles.php:281
|
890 |
+
msgid "Video links back to YouTube when clicked"
|
891 |
+
msgstr ""
|
892 |
+
|
893 |
+
#: includes/aye-options-profiles.php:285
|
894 |
+
msgid "Modest Branding"
|
895 |
+
msgstr ""
|
896 |
+
|
897 |
+
#: includes/aye-options-profiles.php:286
|
898 |
+
msgid "Reduce branding on video."
|
899 |
+
msgstr ""
|
900 |
+
|
901 |
+
#: includes/aye-options-profiles.php:290
|
902 |
+
msgid "Progress Bar Colour"
|
903 |
+
msgstr ""
|
904 |
+
|
905 |
+
#: includes/aye-options-profiles.php:292
|
906 |
+
msgid "Red"
|
907 |
+
msgstr ""
|
908 |
+
|
909 |
+
#: includes/aye-options-profiles.php:293
|
910 |
+
msgid "White (desaturated)"
|
911 |
+
msgstr ""
|
912 |
+
|
913 |
+
#: includes/aye-options-profiles.php:294
|
914 |
+
msgid "The colour that will be used in the player's video progress bar to highlight the amount of the video that's already been seen"
|
915 |
+
msgstr ""
|
916 |
+
|
917 |
+
#: includes/aye-options-profiles.php:298
|
918 |
+
msgid "Related Videos"
|
919 |
+
msgstr ""
|
920 |
+
|
921 |
+
#: includes/aye-options-profiles.php:299
|
922 |
+
msgid "Load related videos once playback starts. Also toggles the search option."
|
923 |
+
msgstr ""
|
924 |
+
|
925 |
+
#: includes/aye-options-profiles.php:303
|
926 |
+
msgid "Options Not Supported by HTML5 Player"
|
927 |
+
msgstr ""
|
928 |
+
|
929 |
+
#: includes/aye-options-profiles.php:307
|
930 |
+
msgid "Window Mode"
|
931 |
+
msgstr ""
|
932 |
+
|
933 |
+
#: includes/aye-options-profiles.php:309
|
934 |
+
msgid "Opaque"
|
935 |
+
msgstr ""
|
936 |
+
|
937 |
+
#: includes/aye-options-profiles.php:310
|
938 |
+
msgid "Transparent"
|
939 |
+
msgstr ""
|
940 |
+
|
941 |
+
#: includes/aye-options-profiles.php:311
|
942 |
+
msgid "Window"
|
943 |
+
msgstr ""
|
944 |
+
|
945 |
+
#: includes/aye-options-profiles.php:312
|
946 |
+
msgid "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>."
|
947 |
+
msgstr ""
|
948 |
+
|
949 |
+
#: includes/aye-options-profiles.php:317
|
950 |
+
msgid "Options Only Supported By EmbedPlus"
|
951 |
+
msgstr ""
|
952 |
+
|
953 |
+
#: includes/aye-options-profiles.php:317
|
954 |
+
msgid "Learn more about EmbedPlus"
|
955 |
+
msgstr ""
|
956 |
+
|
957 |
+
#: includes/aye-options-profiles.php:321
|
958 |
+
msgid "Fallback Embed Type"
|
959 |
+
msgstr ""
|
960 |
+
|
961 |
+
#: includes/aye-options-profiles.php:322
|
962 |
+
msgid "The type of player to use if Flash is not available and EmbedPlus cannot be used."
|
963 |
+
msgstr ""
|
964 |
+
|
965 |
+
#: includes/aye-options-profiles.php:328
|
966 |
+
msgid "Play HD"
|
967 |
+
msgstr ""
|
968 |
+
|
969 |
+
#: includes/aye-options-profiles.php:329
|
970 |
+
msgid "Play the video in HD if possible"
|
971 |
+
msgstr ""
|
972 |
+
|
973 |
+
#: includes/aye-options-profiles.php:333
|
974 |
+
msgid "Real-time Reactions"
|
975 |
+
msgstr ""
|
976 |
+
|
977 |
+
#: includes/aye-options-profiles.php:334
|
978 |
+
msgid "Show the Real-time Reactions button"
|
979 |
+
msgstr ""
|
980 |
+
|
981 |
+
#: includes/aye-options-profiles.php:338
|
982 |
+
msgid "Sweet Spots"
|
983 |
+
msgstr ""
|
984 |
+
|
985 |
+
#: includes/aye-options-profiles.php:339
|
986 |
+
msgid "Find sweet spots for the next and previous buttons"
|
987 |
+
msgstr ""
|
988 |
+
|
989 |
+
#: includes/aye-options-profiles.php:349
|
990 |
+
msgid "Would you like the video below to be yours? <a href=\"http://www.artiss.co.uk/contact\">Contact me</a> for sponsorship information."
|
991 |
+
msgstr ""
|
992 |
+
|
993 |
+
#: includes/aye-options-profiles.php:354
|
994 |
+
msgid "YouTube Video Sample"
|
995 |
+
msgstr ""
|
996 |
+
|
997 |
+
#: includes/aye-options-profiles.php:355
|
998 |
+
msgid "This uses the above settings, once they have been saved. <b>Would you like this to be your video? If so, <a href=\"http://www.artiss.co.uk/contact\">contact me</a>!</b>"
|
999 |
+
msgstr ""
|
1000 |
+
|
1001 |
+
#: includes/aye-options-profiles.php:356
|
1002 |
+
msgid "Use the drop-down below to change which parameters the video uses - press the Change Video button to update it."
|
1003 |
+
msgstr ""
|
1004 |
+
|
1005 |
+
#: includes/aye-options-profiles.php:358
|
1006 |
+
msgid "Standard"
|
1007 |
+
msgstr ""
|
1008 |
+
|
1009 |
+
#: includes/aye-options-profiles.php:360
|
1010 |
+
msgid "3D"
|
1011 |
+
msgstr ""
|
1012 |
+
|
1013 |
+
#: includes/aye-options-profiles.php:361
|
1014 |
+
msgid "Playlist"
|
1015 |
+
msgstr ""
|
1016 |
+
|
1017 |
+
#: includes/aye-options-profiles.php:364
|
1018 |
+
msgid "Change video"
|
1019 |
+
msgstr ""
|
1020 |
+
|
1021 |
+
#: includes/aye-options-widgets.php:13
|
1022 |
+
msgid "Widget Title"
|
1023 |
+
msgstr ""
|
1024 |
+
|
1025 |
+
#: includes/aye-options-widgets.php:33
|
1026 |
+
msgid "ID Type"
|
1027 |
+
msgstr ""
|
1028 |
+
|
1029 |
+
#: includes/aye-options-widgets.php:35
|
1030 |
+
msgid "Video or Playlist"
|
1031 |
+
msgstr ""
|
1032 |
+
|
1033 |
+
#: includes/aye-options-widgets.php:37
|
1034 |
+
msgid "Search"
|
1035 |
+
msgstr ""
|
1036 |
+
|
1037 |
+
#: includes/aye-options-widgets.php:39
|
1038 |
+
msgid "User"
|
1039 |
+
msgstr ""
|
1040 |
+
|
1041 |
+
#: includes/aye-options-widgets.php:47
|
1042 |
+
#: includes/aye-shared-functions.php:432
|
1043 |
+
msgid "Profile"
|
1044 |
+
msgstr ""
|
1045 |
+
|
1046 |
+
#: includes/aye-options-widgets.php:67
|
1047 |
+
msgid "Size"
|
1048 |
+
msgstr ""
|
1049 |
+
|
1050 |
+
#: includes/aye-options-widgets.php:81
|
1051 |
+
#: includes/aye-options-widgets.php:93
|
1052 |
+
#: includes/aye-options-widgets.php:109
|
1053 |
+
#: includes/aye-options-widgets.php:141
|
1054 |
+
#: includes/aye-options-widgets.php:155
|
1055 |
+
msgid "Profile default"
|
1056 |
+
msgstr ""
|
1057 |
+
|
1058 |
+
#: includes/aye-options-widgets.php:83
|
1059 |
+
#: includes/aye-options-widgets.php:111
|
1060 |
+
#: includes/aye-options-widgets.php:157
|
1061 |
+
msgid "No"
|
1062 |
+
msgstr ""
|
1063 |
+
|
1064 |
+
#: includes/aye-options-widgets.php:85
|
1065 |
+
#: includes/aye-options-widgets.php:113
|
1066 |
+
#: includes/aye-options-widgets.php:159
|
1067 |
+
msgid "Yes"
|
1068 |
+
msgstr ""
|
1069 |
+
|
1070 |
+
#: includes/aye-options-widgets.php:91
|
1071 |
+
msgid "Embed Type"
|
1072 |
+
msgstr ""
|
1073 |
+
|
1074 |
+
#: includes/aye-options-widgets.php:119
|
1075 |
+
msgid "Start (seconds)"
|
1076 |
+
msgstr ""
|
1077 |
+
|
1078 |
+
#: includes/aye-options-widgets.php:125
|
1079 |
+
msgid "Stop (seconds)"
|
1080 |
+
msgstr ""
|
1081 |
+
|
1082 |
+
#: includes/aye-options-widgets.php:130
|
1083 |
+
msgid "Non-EmbedPlus Options"
|
1084 |
+
msgstr ""
|
1085 |
+
|
1086 |
+
#: includes/aye-options-widgets.php:139
|
1087 |
+
msgid "List Playback"
|
1088 |
+
msgstr ""
|
1089 |
+
|
1090 |
+
#: includes/aye-options-widgets.php:143
|
1091 |
+
msgid "Play each video in order"
|
1092 |
+
msgstr ""
|
1093 |
+
|
1094 |
+
#: includes/aye-options-widgets.php:145
|
1095 |
+
msgid "Play videos randomly"
|
1096 |
+
msgstr ""
|
1097 |
+
|
1098 |
+
#: includes/aye-options-widgets.php:147
|
1099 |
+
msgid "Play one random video"
|
1100 |
+
msgstr ""
|
1101 |
+
|
1102 |
+
#: includes/aye-shared-functions.php:184
|
1103 |
+
#, php-format
|
1104 |
+
msgid "An error occurred accessing the YouTube API for video ID %s - %s"
|
1105 |
+
msgstr ""
|
1106 |
+
|
readme.txt
CHANGED
@@ -1,10 +1,10 @@
|
|
1 |
=== Artiss YouTube Embed ===
|
2 |
Contributors: dartiss
|
3 |
Donate link: http://artiss.co.uk/donate
|
4 |
-
Tags: admin, annotations, artiss, automatic, editor, embed, embedding, embedplus, flash, flv, google, hd, height, iframe, manage, media, plugin, page, play, playlist, post, profile, responsive, sidebar, simple, smart, url, valid, video, widget, width, xhtml, youtube, youtuber
|
5 |
Requires at least: 2.9
|
6 |
Tested up to: 3.3.1
|
7 |
-
Stable tag: 2.
|
8 |
|
9 |
A simple to use method of embedding YouTube videos into your posts and pages but with powerful features for those that need them.
|
10 |
|
@@ -17,10 +17,12 @@ Artiss YouTube Embed (formally YouTube Embed) is an incredibly simple, yet power
|
|
17 |
* Dynamic video sizing for responsive sites
|
18 |
* Allow users to add videos to comments
|
19 |
* Build your own playlists and play them back however you want
|
|
|
20 |
* Create multiple profiles - use them for different videos to get the exact style that you want
|
21 |
* Google compatible metadata is added to the video output - great for SEO!
|
22 |
* Code is cached for maximum performance
|
23 |
* Using a different YouTube plugin? Documentation and tools are provided to help you migrate to Artiss YouTube Embed
|
|
|
24 |
* And much, much more!
|
25 |
|
26 |
It has all the features of other similar plugins - Smart YouTube, for instance. In fact if there's a feature in another YouTube embedding plugin that this doesn't have, let me know - I haven't come across it!
|
@@ -67,6 +69,7 @@ The following parameters will not work with EmbedPlus:
|
|
67 |
* **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.
|
68 |
* **controls** - yes or no, should the controls be shown?
|
69 |
* **https** - yes or no, whether to use HTTPS for the video
|
|
|
70 |
* **loop** - yes or no, whether to start the video again once it ends
|
71 |
* **theme** - dark or light, display player controls (like a 'play' button or volume control) within a dark or light control bar
|
72 |
|
@@ -77,15 +80,19 @@ The following parameters will not work with EmbedPlus or if IFRAME uses HTML5:
|
|
77 |
* **color** - white or red, the colour of the progress bar (see the FAQ about having a white progress bar with the light theme)
|
78 |
* **disablekb** - yes or no, disable keyboard controls
|
79 |
* **fullscreen** - yes or no, this will add the fullscreen button to the toolbar. This also works with EmbedPlus.
|
80 |
-
* **info** - yes or no, show video information
|
81 |
* **link** - yes or no, link video to YouTube
|
82 |
* **related** - yes or no, show related videos
|
|
|
|
|
|
|
|
|
|
|
|
|
83 |
|
84 |
The following parameters are only for use with EmbedPlus:
|
85 |
|
86 |
* **hd** - play the video in HD quality, if available
|
87 |
* **react** - yes or no, this specified whether you wish to show the Real-time Reactions button
|
88 |
-
* **stop** - this stops the video at a specific time, given in seconds
|
89 |
* **sweetspot** - yes or no, this will find sweet spots for the next/prev buttons
|
90 |
|
91 |
== Alternative Shortcodes ==
|
@@ -109,6 +116,8 @@ e.g. `youtube_video_embed( 'Z_sCoHGIpU0', 'width=300&height=200' )`
|
|
109 |
|
110 |
Sidebar 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 default profile.
|
111 |
|
|
|
|
|
112 |
And that's it! You can use unlimited widgets, so you can add different videos to different sidebars.
|
113 |
|
114 |
== Playlists ==
|
@@ -175,6 +184,12 @@ If you wish to use a PHP function call to get the transcript, then you would use
|
|
175 |
|
176 |
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 )`.
|
177 |
|
|
|
|
|
|
|
|
|
|
|
|
|
178 |
== Migration ==
|
179 |
|
180 |
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.
|
@@ -269,12 +284,11 @@ In all cases putting the cache to 0 will switch off caching for that option.
|
|
269 |
|
270 |
**Further Embedding Options**
|
271 |
|
272 |
-
Under the `YouTube` administration menu is a sub-menu named `Options`. Select this and find the section named `Embedding`. There are
|
273 |
|
274 |
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).
|
275 |
-
2.
|
276 |
-
3.
|
277 |
-
4. 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.
|
278 |
|
279 |
In the case of URL and Comment embedding a profile can be selected.
|
280 |
|
@@ -307,7 +321,7 @@ For problems, suggestions or enhancements for this plugin, there is [a dedicated
|
|
307 |
1. Upload the entire `youtube-embed` folder to your wp-content/plugins/ directory.
|
308 |
2. Activate the plugin through the 'Plugins' menu in WordPress.
|
309 |
3. If you're updating from version 2.0.1 or before, please read the FAQ on backwards compatibility.
|
310 |
-
|
311 |
|
312 |
== Frequently Asked Questions ==
|
313 |
|
@@ -369,7 +383,35 @@ You can [read more about this here](http://www.artiss.co.uk/artiss-youtube-embed
|
|
369 |
|
370 |
It uses standard OBJECT and IFRAME coding - this, along with the above standards compliance, means that the output should work on most browsers.
|
371 |
|
372 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
373 |
|
374 |
= Which version of PHP does this plugin work with? =
|
375 |
|
@@ -377,22 +419,40 @@ It has been syntax checked as PHP 4. However, this does not guarantee PHP 4 comp
|
|
377 |
|
378 |
Although I attempt to keep with PHP 4 compatibility there are no guarantees of this.
|
379 |
|
380 |
-
= A new box has appeared on my dashboard all about Artiss plugins =
|
381 |
-
|
382 |
-
That's correct - all Artiss plugins will now add this feature to keep you up-to-date with the latest news and support links. If you wish to switch it off simply click on the "Screen Options" tab at the top and untick "Artiss News & Support".
|
383 |
-
|
384 |
== Screenshots ==
|
385 |
|
386 |
-
1. Artiss YouTube Embed in the administration menu
|
387 |
-
2. The main options screen
|
388 |
-
3. The profiles screen
|
389 |
-
4. The lists screen - videos have been added and validated. The drop-down help is also shown
|
390 |
5. The About screen
|
391 |
6. The default widget options
|
392 |
7. The default visual editor options with the YouTube Embed button
|
393 |
|
394 |
== Changelog ==
|
395 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
396 |
= 2.4.1 =
|
397 |
* Maintenance: Removed dashboard widget
|
398 |
|
@@ -401,9 +461,6 @@ That's correct - all Artiss plugins will now add this feature to keep you up-to-
|
|
401 |
* Maintenance: Removed drop shadow option
|
402 |
* Maintenance: Re-design of widgets, reducing number of parameters down to make it easier to use - use profiles to modify missing parameters
|
403 |
* Maintenance: Updated YouTube icons
|
404 |
-
* Bug: Ensure `showinfo` parameter is set correctly
|
405 |
-
* Bug: If width or height is missing from Profile screen then fill it in based on widescreen format. Otherwise, causes video to break
|
406 |
-
* Bug: Video information was being fetched from caching even if option selected to switch it off. Fixed!
|
407 |
* Enhancement: Added frameborder="0" to IFRAME code
|
408 |
* Enhancement: Added Privacy-Enhanced mode. Doesn't work with Chromeless player.
|
409 |
* Enhancement: Added `title` option, so you can name the video
|
@@ -413,17 +470,20 @@ That's correct - all Artiss plugins will now add this feature to keep you up-to-
|
|
413 |
* Enhancement: Improved matching of URL embedded into post
|
414 |
* Enhancement: If you have the [README Parser plugin](http://wordpress.org/extend/plugins/wp-readme-parser/ "README Parser") installed then a new sub-menu will display the README instructions
|
415 |
* Enhancement: Use WP 3.3 Feature Pointer to highlight new menu when plugin is activated
|
|
|
|
|
|
|
416 |
|
417 |
= 2.3.1 =
|
418 |
* Maintenance: Removed the sponsorship
|
419 |
|
420 |
= 2.3 =
|
421 |
-
* Bug: Fixed incorrect listing of long profile or list names
|
422 |
-
* Bug: Fixed INCLUDE bug in widgets.php
|
423 |
* Enhancement: Editor button will add text between shortcodes if no URL or ID is specified
|
424 |
* Enhancement: Square brackets are stripped from alternative shortcodes on option screen - text added to warn against this too
|
425 |
* Enhancement: Added Chromeless player option
|
426 |
* Enhancement: Increased maximum output length of profile and list names to 30 characters
|
|
|
|
|
427 |
|
428 |
= 2.2 =
|
429 |
* Maintenance: Updated dashboard widget to latest version
|
@@ -535,8 +595,11 @@ That's correct - all Artiss plugins will now add this feature to keep you up-to-
|
|
535 |
|
536 |
== Upgrade Notice ==
|
537 |
|
|
|
|
|
|
|
538 |
= 2.4.1 =
|
539 |
-
*
|
540 |
|
541 |
= 2.4 =
|
542 |
* Numerous improvements, including new option for responsive video output
|
1 |
=== Artiss YouTube Embed ===
|
2 |
Contributors: dartiss
|
3 |
Donate link: http://artiss.co.uk/donate
|
4 |
+
Tags: admin, annotations, artiss, automatic, editor, embed, embedding, embedplus, flash, flv, google, hd, height, iframe, manage, media, plugin, page, play, playlist, post, profile, responsive, search, sidebar, simple, smart, url, user, valid, video, widget, width, xhtml, youtube, youtuber
|
5 |
Requires at least: 2.9
|
6 |
Tested up to: 3.3.1
|
7 |
+
Stable tag: 2.5
|
8 |
|
9 |
A simple to use method of embedding YouTube videos into your posts and pages but with powerful features for those that need them.
|
10 |
|
17 |
* Dynamic video sizing for responsive sites
|
18 |
* Allow users to add videos to comments
|
19 |
* Build your own playlists and play them back however you want
|
20 |
+
* Automatically generate playlists based on user name or search text
|
21 |
* Create multiple profiles - use them for different videos to get the exact style that you want
|
22 |
* Google compatible metadata is added to the video output - great for SEO!
|
23 |
* Code is cached for maximum performance
|
24 |
* Using a different YouTube plugin? Documentation and tools are provided to help you migrate to Artiss YouTube Embed
|
25 |
+
* Fully internationalized ready for translations. **If you would like to add a translation to his plugin then please [contact me](http://artiss.co.uk/contact "Contact")**
|
26 |
* And much, much more!
|
27 |
|
28 |
It has all the features of other similar plugins - Smart YouTube, for instance. In fact if there's a feature in another YouTube embedding plugin that this doesn't have, let me know - I haven't come across it!
|
69 |
* **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.
|
70 |
* **controls** - yes or no, should the controls be shown?
|
71 |
* **https** - yes or no, whether to use HTTPS for the video
|
72 |
+
* **info** - yes or no, show video information
|
73 |
* **loop** - yes or no, whether to start the video again once it ends
|
74 |
* **theme** - dark or light, display player controls (like a 'play' button or volume control) within a dark or light control bar
|
75 |
|
80 |
* **color** - white or red, the colour of the progress bar (see the FAQ about having a white progress bar with the light theme)
|
81 |
* **disablekb** - yes or no, disable keyboard controls
|
82 |
* **fullscreen** - yes or no, this will add the fullscreen button to the toolbar. This also works with EmbedPlus.
|
|
|
83 |
* **link** - yes or no, link video to YouTube
|
84 |
* **related** - yes or no, show related videos
|
85 |
+
* **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
|
86 |
+
* **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
|
87 |
+
|
88 |
+
The following parameters will not work if IFRAME uses HTML5:
|
89 |
+
|
90 |
+
* **stop** - this stops the video at a specific time, given in seconds
|
91 |
|
92 |
The following parameters are only for use with EmbedPlus:
|
93 |
|
94 |
* **hd** - play the video in HD quality, if available
|
95 |
* **react** - yes or no, this specified whether you wish to show the Real-time Reactions button
|
|
|
96 |
* **sweetspot** - yes or no, this will find sweet spots for the next/prev buttons
|
97 |
|
98 |
== Alternative Shortcodes ==
|
116 |
|
117 |
Sidebar 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 default profile.
|
118 |
|
119 |
+
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.
|
120 |
+
|
121 |
And that's it! You can use unlimited widgets, so you can add different videos to different sidebars.
|
122 |
|
123 |
== Playlists ==
|
184 |
|
185 |
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 )`.
|
186 |
|
187 |
+
== Automatically Generate Playlists ==
|
188 |
+
|
189 |
+
YouTube now includes options to automatically generate playlists based upon a user name or a search name.
|
190 |
+
|
191 |
+
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).
|
192 |
+
|
193 |
== Migration ==
|
194 |
|
195 |
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.
|
284 |
|
285 |
**Further Embedding Options**
|
286 |
|
287 |
+
Under the `YouTube` administration menu is a sub-menu named `Options`. Select this and find the section named `Embedding`. There are 3 options here...
|
288 |
|
289 |
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).
|
290 |
+
2. Comment Embedding - tick this to allow YouTube URLs added to comments to be converted to embedded videos.
|
291 |
+
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.
|
|
|
292 |
|
293 |
In the case of URL and Comment embedding a profile can be selected.
|
294 |
|
321 |
1. Upload the entire `youtube-embed` folder to your wp-content/plugins/ directory.
|
322 |
2. Activate the plugin through the 'Plugins' menu in WordPress.
|
323 |
3. If you're updating from version 2.0.1 or before, please read the FAQ on backwards compatibility.
|
324 |
+
4. That's it, you're done - you just need to add the shortcode wherever you need.
|
325 |
|
326 |
== Frequently Asked Questions ==
|
327 |
|
383 |
|
384 |
It uses standard OBJECT and IFRAME coding - this, along with the above standards compliance, means that the output should work on most browsers.
|
385 |
|
386 |
+
= The video output is overlapping or stuttering =
|
387 |
+
|
388 |
+
If you go into the Profile screen in Administration there is a "Window Mode" option. This defines how Flash output interacts with any other around it. "Window" is the default and gives good performance but may cause overlapping. If overlapping is causing an issue try "Opaque".
|
389 |
+
|
390 |
+
= No video is showing =
|
391 |
+
|
392 |
+
If you find no video is showing but there's no error either check the source code of the page. Can you find the text "<!--YouTube Error: bad URL entered-->" in the page? If so, you have Jetpack installed and that is displaying the video instead.
|
393 |
+
|
394 |
+
There are two ways around this.
|
395 |
+
|
396 |
+
First, you could disable all the shortcodes in Jetpack - Jetpack allows you to deactivate certain "modules" of the plugin and, if you can live without the other extra shortcodes, deactivating the shortcodes part will restore functionality back to YouTube Embed
|
397 |
+
|
398 |
+
Alternatively, you can use a secondary shortcode - [youtube_video]. Use this instead of [youtube] and YouTube Embed will render the results without a problem
|
399 |
+
|
400 |
+
This second suggestion will work for any plugin that may use the same shortcode.
|
401 |
+
|
402 |
+
= There used to be an option to allow the plugin to work with YouTube URLs. Where did it go? =
|
403 |
+
|
404 |
+
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.
|
405 |
+
|
406 |
+
If you wish to have full control over your YouTube output I would suggest placing all YouTube URLs within [youtube] shortcodes.
|
407 |
+
|
408 |
+
= My OPTIONS table seems to be full of cache entries for YouTube Embed =
|
409 |
+
|
410 |
+
Cache issues with past versions of the plugin may mean that cache entries have been left behind. The Options menu in YouTube Embed administration now has an additional option in the performance section named "Clear Cache". Simply tick this box and click on the "Save Settings" button to clear out any cache.
|
411 |
+
|
412 |
+
Next to the option it will display how many videos have cache in the database. If this is vastly more than the number of videos on your site it may be necessary to clear the cache down. If you find you keep having to do this please [let me know](http://www.artiss.co.uk/forum "WordPress Plugins Forum").
|
413 |
+
|
414 |
+
Please note - clearing the cache will not just remove any redundant cache as there is no way to identify what is required and what is not. It will therefore remove all cache related to YouTube Embed, therefore having a temporary performance impact on your site as displayed videos are generated and cached again.
|
415 |
|
416 |
= Which version of PHP does this plugin work with? =
|
417 |
|
419 |
|
420 |
Although I attempt to keep with PHP 4 compatibility there are no guarantees of this.
|
421 |
|
|
|
|
|
|
|
|
|
422 |
== Screenshots ==
|
423 |
|
424 |
+
1. Artiss YouTube Embed in the administration menu
|
425 |
+
2. The main options screen
|
426 |
+
3. The profiles screen
|
427 |
+
4. The lists screen - videos have been added and validated. The drop-down help is also shown
|
428 |
5. The About screen
|
429 |
6. The default widget options
|
430 |
7. The default visual editor options with the YouTube Embed button
|
431 |
|
432 |
== Changelog ==
|
433 |
|
434 |
+
= 2.5 =
|
435 |
+
* Maintenance: Updated code to work with new playlist options
|
436 |
+
* Maintenance: Removed embedded URL option due to issues with existing code (see FAQ for details)
|
437 |
+
* Maintenance: Added further FAQs based on common forum queries
|
438 |
+
* Maintenance: Wording on options screens changed to better identify differences between players
|
439 |
+
* Maintenance: Added advertisement to profile screen
|
440 |
+
* Maintenance: Modified demonstration video and made sponsorship request more visible
|
441 |
+
* Maintenance: Changes the YouTube admin screen icon
|
442 |
+
* Enhancement: Download link now uses deturl.com
|
443 |
+
* Enhancement: Admin Bar link improved in WP 3.3 onwards
|
444 |
+
* Enhancement: New user upload and search features added
|
445 |
+
* Enhancement: Now supports ability to specify the time to stop video playback
|
446 |
+
* Enhancement: Default windowing mode changed to improve performance
|
447 |
+
* Enhancement: FRAMEBORDER is switchable for the purpose of HTML5 compatibility
|
448 |
+
* Enhancement: Added internationalisation
|
449 |
+
* Enhancement: README in admin menu now shows the corresponding README for the version of the plugin you have installed, rather than the latest one
|
450 |
+
* Enhancement: Added option to admin screen to clear video cache (see FAQ for details)
|
451 |
+
* Enhancement: Allow recursive shortcodes - that is, shortcodes within the YouTube shortcode
|
452 |
+
* Bug: Fixed bug in retrieving the video title
|
453 |
+
* Bug: Resolved various debug messages
|
454 |
+
* Bug: Fixed bug in MCE button JavaScript
|
455 |
+
|
456 |
= 2.4.1 =
|
457 |
* Maintenance: Removed dashboard widget
|
458 |
|
461 |
* Maintenance: Removed drop shadow option
|
462 |
* Maintenance: Re-design of widgets, reducing number of parameters down to make it easier to use - use profiles to modify missing parameters
|
463 |
* Maintenance: Updated YouTube icons
|
|
|
|
|
|
|
464 |
* Enhancement: Added frameborder="0" to IFRAME code
|
465 |
* Enhancement: Added Privacy-Enhanced mode. Doesn't work with Chromeless player.
|
466 |
* Enhancement: Added `title` option, so you can name the video
|
470 |
* Enhancement: Improved matching of URL embedded into post
|
471 |
* Enhancement: If you have the [README Parser plugin](http://wordpress.org/extend/plugins/wp-readme-parser/ "README Parser") installed then a new sub-menu will display the README instructions
|
472 |
* Enhancement: Use WP 3.3 Feature Pointer to highlight new menu when plugin is activated
|
473 |
+
* Bug: Ensure `showinfo` parameter is set correctly
|
474 |
+
* Bug: If width or height is missing from Profile screen then fill it in based on widescreen format. Otherwise, causes video to break
|
475 |
+
* Bug: Video information was being fetched from caching even if option selected to switch it off. Fixed!
|
476 |
|
477 |
= 2.3.1 =
|
478 |
* Maintenance: Removed the sponsorship
|
479 |
|
480 |
= 2.3 =
|
|
|
|
|
481 |
* Enhancement: Editor button will add text between shortcodes if no URL or ID is specified
|
482 |
* Enhancement: Square brackets are stripped from alternative shortcodes on option screen - text added to warn against this too
|
483 |
* Enhancement: Added Chromeless player option
|
484 |
* Enhancement: Increased maximum output length of profile and list names to 30 characters
|
485 |
+
* Bug: Fixed incorrect listing of long profile or list names
|
486 |
+
* Bug: Fixed INCLUDE bug in widgets.php
|
487 |
|
488 |
= 2.2 =
|
489 |
* Maintenance: Updated dashboard widget to latest version
|
595 |
|
596 |
== Upgrade Notice ==
|
597 |
|
598 |
+
= 2.5 =
|
599 |
+
* Upgrade to add a number of new features (including automatic generation of playlists based on user name or search term) and fix some bugs
|
600 |
+
|
601 |
= 2.4.1 =
|
602 |
+
* Upgrade to remove the dashboard widget
|
603 |
|
604 |
= 2.4 =
|
605 |
* Numerous improvements, including new option for responsive video output
|
screenshot-2.png
CHANGED
Binary file
|
screenshot-3.png
CHANGED
Binary file
|
screenshot-4.png
CHANGED
Binary file
|
screenshot-5.png
CHANGED
Binary file
|
screenshot-6.png
CHANGED
Binary file
|
uninstall.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
*
|
5 |
* Uninstall the plugin by removing any options from the database
|
6 |
*
|
7 |
-
* @package
|
8 |
* @since 2.0
|
9 |
*/
|
10 |
|
4 |
*
|
5 |
* Uninstall the plugin by removing any options from the database
|
6 |
*
|
7 |
+
* @package Artiss-YouTube-Embed
|
8 |
* @since 2.0
|
9 |
*/
|
10 |
|
youtube-embed.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: Artiss YouTube Embed
|
4 |
Plugin URI: http://www.artiss.co.uk/artiss-youtube-embed
|
5 |
Description: Embed YouTube Videos in WordPress
|
6 |
-
Version: 2.
|
7 |
Author: David Artiss
|
8 |
Author URI: http://www.artiss.co.uk
|
9 |
*/
|
@@ -13,69 +13,52 @@ Author URI: http://www.artiss.co.uk
|
|
13 |
*
|
14 |
* Main code - include various functions
|
15 |
*
|
16 |
-
* @package
|
17 |
* @since 2.0
|
18 |
*/
|
19 |
|
20 |
-
define( 'youtube_embed_version', '2.
|
21 |
|
22 |
$functions_dir = WP_PLUGIN_DIR . '/youtube-embed/includes/';
|
23 |
|
24 |
// Include all the various functions
|
25 |
|
26 |
-
include_once( $functions_dir . 'add-scripts.php' );
|
27 |
|
28 |
-
include_once( $functions_dir . 'shared.php' );
|
29 |
|
30 |
-
include_once( $functions_dir . 'set-
|
31 |
|
32 |
-
include_once( $functions_dir . 'admin-bar.php' );
|
33 |
|
34 |
-
include_once( $functions_dir . 'generate-embed-code.php' );
|
35 |
|
36 |
if ( is_admin() ) {
|
37 |
|
38 |
-
include_once( $functions_dir . 'admin-config.php' );
|
39 |
|
40 |
-
include_once( $functions_dir . '
|
41 |
|
42 |
} else {
|
43 |
|
44 |
-
include_once( $functions_dir . 'content.php' );
|
45 |
|
46 |
-
include_once( $functions_dir . 'function-calls.php' );
|
47 |
|
48 |
-
include_once( $functions_dir . 'generate-download-code.php' );
|
49 |
|
50 |
-
include_once( $functions_dir . 'generate-shorturl-code.php' );
|
51 |
|
52 |
-
include_once( $functions_dir . 'generate-thumbnail-code.php' );
|
53 |
|
54 |
-
include_once( $functions_dir . 'generate-transcript-code.php' );
|
55 |
|
56 |
-
include_once( $functions_dir . 'shortcodes.php' );
|
57 |
|
58 |
-
include_once( $functions_dir . 'deprecated.php' );
|
59 |
|
60 |
}
|
61 |
|
62 |
-
include_once($functions_dir . 'widgets.php');
|
63 |
|
64 |
-
/**
|
65 |
-
* Output some useful debug information
|
66 |
-
*
|
67 |
-
* Quick debug task to output version number and plugin directory, in case of queries
|
68 |
-
*
|
69 |
-
* @since 2.0
|
70 |
-
*
|
71 |
-
* @return string Plugin version and plugin directory, seperated by double colons
|
72 |
-
*/
|
73 |
-
|
74 |
-
if ( !is_admin() ) {
|
75 |
-
|
76 |
-
function ye_debug( $paras = '', $content = '' ) { echo youtube_embed_version . ' :: ' . WP_PLUGIN_DIR; }
|
77 |
-
|
78 |
-
add_shortcode( 'ye-debug', 'ye_debug' );
|
79 |
-
|
80 |
-
}
|
81 |
?>
|
3 |
Plugin Name: Artiss YouTube Embed
|
4 |
Plugin URI: http://www.artiss.co.uk/artiss-youtube-embed
|
5 |
Description: Embed YouTube Videos in WordPress
|
6 |
+
Version: 2.5
|
7 |
Author: David Artiss
|
8 |
Author URI: http://www.artiss.co.uk
|
9 |
*/
|
13 |
*
|
14 |
* Main code - include various functions
|
15 |
*
|
16 |
+
* @package Artiss-YouTube-Embed
|
17 |
* @since 2.0
|
18 |
*/
|
19 |
|
20 |
+
define( 'youtube_embed_version', '2.5' );
|
21 |
|
22 |
$functions_dir = WP_PLUGIN_DIR . '/youtube-embed/includes/';
|
23 |
|
24 |
// Include all the various functions
|
25 |
|
26 |
+
include_once( $functions_dir . 'aye-add-scripts.php' ); // Add various scripts
|
27 |
|
28 |
+
include_once( $functions_dir . 'aye-shared-functions.php' ); // Shared routines
|
29 |
|
30 |
+
include_once( $functions_dir . 'aye-set-defaults.php' ); // Set default options
|
31 |
|
32 |
+
include_once( $functions_dir . 'aye-add-to-admin-bar.php' ); // Add link to the admin bar
|
33 |
|
34 |
+
include_once( $functions_dir . 'aye-generate-embed-code.php' ); // Generate YouTube embed code
|
35 |
|
36 |
if ( is_admin() ) {
|
37 |
|
38 |
+
include_once( $functions_dir . 'aye-admin-config.php' ); // Administration configuration
|
39 |
|
40 |
+
include_once( $functions_dir . 'aye-add-mce-button.php' ); // Editor button
|
41 |
|
42 |
} else {
|
43 |
|
44 |
+
include_once( $functions_dir . 'aye-update-post-content.php' ); // Process post content
|
45 |
|
46 |
+
include_once( $functions_dir . 'aye-function-calls.php' ); // Function calls
|
47 |
|
48 |
+
include_once( $functions_dir . 'aye-generate-download-code.php' ); // Generate download URLs
|
49 |
|
50 |
+
include_once( $functions_dir . 'aye-generate-shorturl-code.php' ); // Generate short URLs
|
51 |
|
52 |
+
include_once( $functions_dir . 'aye-generate-thumbnail-code.php' ); // Generate thumbnail code
|
53 |
|
54 |
+
include_once( $functions_dir . 'aye-generate-transcript-code.php' ); // Generate transcripts
|
55 |
|
56 |
+
include_once( $functions_dir . 'aye-shortcodes.php' ); // Shortcodes
|
57 |
|
58 |
+
include_once( $functions_dir . 'aye-deprecated.php' ); // Deprecated options
|
59 |
|
60 |
}
|
61 |
|
62 |
+
include_once($functions_dir . 'aye-generate-widgets.php'); // Generate widgets
|
63 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
64 |
?>
|