YouTube Embed - Version 2.3

Version Description

  • Bug: Fixed incorrect listing of long profile or list names
  • Bug: Fixed INCLUDE bug in widgets.php
  • Enhancement: Editor button will add text between shortcodes if no URL or ID is specified
  • Enhancement: Square brackets are stripped from alternative shortcodes on option screen - text added to warn against this too
  • Enhancement: Added Chromeless player option
  • Enhancement: Increased maximum output length of profile and list names to 30 characters

=

Download this release

Release Info

Developer dartiss
Plugin Icon 128x128 YouTube Embed
Version 2.3
Comparing to
See all releases

Code changes from version 2.1 to 2.3

images/Thumbs.db DELETED
Binary file
includes/about.php CHANGED
@@ -9,13 +9,24 @@
9
  */
10
  ?>
11
  <div class="wrap">
12
- <div class="icon32"><img src="<?php echo WP_PLUGIN_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 WP_PLUGIN_URL; ?>/youtube-embed/images/poweredby.png" alt="Powered by YouTube" title="Powered by YouTube" align="right" /></a>
19
 
20
  <?php
21
 
@@ -23,7 +34,7 @@ _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 &amp; Conditions of Use</a>.</p>' );
27
 
28
  _e( '<h3>Acknowledgements</h3>' );
29
 
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
+ <?php
17
+ $options = ye_set_general_defaults();
18
+ if ( $options[ 'donation' ] != 1 ) : ?>
19
+
20
+ <div style="text-align: center;"><script type="text/javascript">
21
+ var psHost = (("https:" == document.location.protocol) ? "https://" : "http://");
22
+ document.write(unescape("%3Cscript src='" + psHost + "pluginsponsors.com/direct/spsn/display.php?client=youtube-embed&spot=' type='text/javascript'%3E%3C/script%3E"));
23
+ </script></div>
24
+
25
+ <?php endif; ?>
26
+
27
  <p><?php _e( 'You are using Artiss YouTube Embed version ' . youtube_embed_version . '. It was written by David Artiss.' ); ?></p>
28
 
29
+ <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>
30
 
31
  <?php
32
 
34
 
35
  _e( '<p>YouTube, and all associated logos, is the copyright of Google Inc.</p>' );
36
 
37
+ _e( '<p>EmbedPlus is copyright. Read the <a href="http://embedplus.com/terms.aspx" target="_blank">Terms &amp; Conditions of Use</a>.</p>' );
38
 
39
  _e( '<h3>Acknowledgements</h3>' );
40
 
includes/admin-bar.php CHANGED
@@ -17,13 +17,13 @@
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',
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',
includes/admin-menu.php CHANGED
@@ -19,7 +19,7 @@
19
 
20
  function ye_menu_initialise() {
21
 
22
- add_menu_page( 'YouTube Embed Options', 'YouTube', 'manage_options', 'youtube-embed-general', 'ye_general_options', WP_PLUGIN_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' );
@@ -34,7 +34,7 @@ add_filter( 'plugin_row_meta', 'ye_set_plugin_meta', 10, 2 );
34
  /**
35
  * Include general options screen
36
  *
37
- * XHTML options screen to prompt and update some general plugin options
38
  *
39
  * @since 2.0
40
  */
@@ -46,7 +46,7 @@ function ye_general_options() {
46
  /**
47
  * Include profile options screen
48
  *
49
- * XHTML options screen to prompt and update profile options
50
  *
51
  * @since 2.0
52
  */
@@ -88,10 +88,10 @@ function ye_support_about() {
88
  */
89
 
90
  function ye_menu_css() {
91
- wp_enqueue_style( 'youtube_embed', WP_PLUGIN_URL . '/youtube-embed/css/youtube-embed.css' );
92
  global $wp_version;
93
  if ( ( float ) $wp_version >= 3.2 ) { $version = ''; } else { $version = '-3.1'; }
94
- wp_enqueue_style( 'tinymce_button', WP_PLUGIN_URL . '/youtube-embed/css/tinymce-button' . $version . '.css' );
95
  }
96
  add_action( 'admin_print_styles', 'ye_menu_css' );
97
 
@@ -152,7 +152,7 @@ function ye_set_plugin_meta( $links, $file ) {
152
  *
153
  * @since 2.0
154
  *
155
- * @param string $page_title Title to give menu page
156
  * @param string $menu_title Title for menu option
157
  * @param string $menu_slug Unique slug for the menu
158
  * @param string $function Function name for menu option
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' );
34
  /**
35
  * Include general options screen
36
  *
37
+ * XHTML options screen to prompt and update some general plugin options
38
  *
39
  * @since 2.0
40
  */
46
  /**
47
  * Include profile options screen
48
  *
49
+ * XHTML options screen to prompt and update profile options
50
  *
51
  * @since 2.0
52
  */
88
  */
89
 
90
  function ye_menu_css() {
91
+ wp_enqueue_style( 'youtube_embed', plugins_url() . '/youtube-embed/css/youtube-embed.css' );
92
  global $wp_version;
93
  if ( ( float ) $wp_version >= 3.2 ) { $version = ''; } else { $version = '-3.1'; }
94
+ wp_enqueue_style( 'tinymce_button', plugins_url() . '/youtube-embed/css/tinymce-button' . $version . '.css' );
95
  }
96
  add_action( 'admin_print_styles', 'ye_menu_css' );
97
 
152
  *
153
  * @since 2.0
154
  *
155
+ * @param string $page_title Title to give menu page
156
  * @param string $menu_title Title for menu option
157
  * @param string $menu_slug Unique slug for the menu
158
  * @param string $function Function name for menu option
includes/artiss-dashboard-widget.php CHANGED
@@ -1,8 +1,8 @@
1
  <?php
2
  /**
3
- * Artiss Dashboard Widget (v1.1)
4
  *
5
- * Add a box to the dashboard to display Artiss plugin news and support links
6
  *
7
  * @package YouTubeEmbed
8
  * @since 2.0
@@ -17,63 +17,71 @@
17
 
18
  function artiss_dashboard_widget() {
19
  global $wp_meta_boxes;
20
- wp_add_dashboard_widget( 'artiss_help_widget', 'Artiss Plugin News & Support', 'artiss_plugin_help' );
21
  }
22
  add_action( 'wp_dashboard_setup', 'artiss_dashboard_widget' );
23
 
24
  /**
25
  * Display Dashboard Widget
26
  *
27
- * Show dashboard widget. Fetch top news items from category feed and cache them.
28
  *
29
  */
30
 
31
- function artiss_plugin_help() {
32
 
33
  // Set number of minutes to cache output
34
- $minutes_to_cache = 60;
35
-
36
- // Set number of news items to display
37
- $news_items = 5;
38
 
39
- // Attempt to get the cache
 
40
  $output = get_transient( 'artiss_dashboard_text' );
41
 
42
  // No cache found
43
  if (!$output) {
44
 
45
- $output = '<img src="http://www.artiss.co.uk/wp-content/themes/artiss-1/images/head.png" alt="Artiss.co.uk logo" title="Artiss.co.uk logo" style="float: right; margin-right: 8px; margin-bottom: 4px; padding:2px; padding-bottom: 8px; border: 1px solid #ddd; background-color: #fff;" />';
 
46
 
47
- // Use MagpieRSS to fetch the feed
48
- include_once( ABSPATH . WPINC . '/rss.php' );
49
- $array = fetch_rss( 'http://www.artiss.co.uk/category/wordpress/feed' );
50
 
51
- if ( $array != '' ) {
 
52
 
53
- // If a feed is returned, slice up the results into an array
54
- $items = array_slice( $array -> items, 0, $news_items );
55
 
56
- // Now loop around the result and output
57
- $output .= "<h4>News</h4><br/>\n";
58
- if ( count( $items ) != 0 ) {
59
- $output .= "<ul>\n";
60
- foreach ( $items as $item ) {
61
- $output .= '<li><a href="' . $item[ 'link' ] . '">' . $item[ 'title' ] . "</a></li>\n";
62
- }
63
- $output .= "</ul></br>\n";
64
- } else {
65
- $output .= "No news items were found - please check back later!</br></br>";
66
- }
67
- }
68
 
69
- // Generate support links
70
- $output .= "<h4>Support Links</h4><br/>\n<ul>\n<li><a href=\"http://www.artiss.co.uk\">Artiss.co.uk website</a><br/></li>\n<li><a href=\"http://www.artiss.co.uk/wp-plugins\">Main plugin page</a><br/></li>\n<li><a href=\"http://www.artiss.co.uk/forum\">Plugin forum </a></li>\n</ul></br>\n";
 
 
 
 
 
71
 
72
- // Generate news links
73
- $output .= "<h4>News</h4><br/>\n<ul>\n<li><a href=\"http://www.artiss.co.uk\">Subscribe to the RSS feed</a><br/></li>\n<li><a href=\"http://www.artiss.co.uk/wp-plugins\">Follow us on Twitter</a><br/></li>\n</ul>\n";
74
 
75
- // Add donation link
76
- $output .= "<h5 style=\"text-align: right\"><a href=\"http://www.artiss.co.uk/donate\">Donate</a></h5>";
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
77
 
78
  // Update cache
79
  set_transient( 'artiss_dashboard_text', $output, $minutes_to_cache * 60 );
@@ -81,4 +89,27 @@ function artiss_plugin_help() {
81
 
82
  echo $output;
83
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
84
  ?>
1
  <?php
2
  /**
3
+ * Artiss Dashboard Widget (v1.3)
4
  *
5
+ * Add a box to the dashboard to display Artiss posts, and plugin news and support links
6
  *
7
  * @package YouTubeEmbed
8
  * @since 2.0
17
 
18
  function artiss_dashboard_widget() {
19
  global $wp_meta_boxes;
20
+ wp_add_dashboard_widget( 'artiss_help_widget', 'Artiss News & Support', 'adw_create_widget' );
21
  }
22
  add_action( 'wp_dashboard_setup', 'artiss_dashboard_widget' );
23
 
24
  /**
25
  * Display Dashboard Widget
26
  *
27
+ * Show dashboard widget. Fetch top news items from Twitter cache them.
28
  *
29
  */
30
 
31
+ function adw_create_widget() {
32
 
33
  // Set number of minutes to cache output
34
+ $minutes_to_cache = 120;
 
 
 
35
 
36
+ // Set number of news items to display
37
+ $news_items = 5; // Attempt to get the cache
38
  $output = get_transient( 'artiss_dashboard_text' );
39
 
40
  // No cache found
41
  if (!$output) {
42
 
43
+ // Add donation link
44
+ $output .= "<span style=\"font-size: 0.8em; float: right\"><a href=\"http://www.artiss.co.uk/donate\">Donate</a></span>";
45
 
46
+ // News heading
47
+ $output .= "<span style=\"font-size: 1.1em; font-weight: bold;\">Latest News</span><br/><br/>\n";
 
48
 
49
+ // Fetch the Twitter status'
50
+ $file_return = adw_get_file( 'http://api.twitter.com/1/statuses/user_timeline.xml?screen_name=artiss_tech&count=' . $news_items . '&exclude_replies=true' );
51
 
52
+ if ( $file_return[ 'file' ] != '' ) {
 
53
 
54
+ // Extract Twitter status' and output
 
 
 
 
 
 
 
 
 
 
 
55
 
56
+ $twitter_feed = $file_return[ 'file' ];
57
+
58
+ $output .= "<span style=\"font-weight: bold; font-size: 0.9em;\">Last updated " . date('l jS F \a\t g:ia') . ".</span><br/><br/>\n<ul>\n";
59
+
60
+ $loop = 1;
61
+ $pos = 1;
62
+ while ( $loop < ( $news_items + 1 ) ) {
63
 
64
+ $start = strpos( $twitter_feed, '<text>', $pos );
65
+ $end = strpos( $twitter_feed, '</text>', $start );
66
 
67
+ $status = substr( $twitter_feed, $start + 6, $end - $start - 6 ); // Extract status
68
+ $status = str_replace( 'New blog post: ', '', $status ); // Remove blog post text
69
+ $status = ereg_replace( "[[:alpha:]]+://[^<>[:space:]]+[[:alnum:]/]","<a href=\"\\0\">\\0</a>", $status ); // Add URL links
70
+
71
+ $output .= '<li>' . $status . "</li>\n";
72
+
73
+ $pos = $end+7;
74
+ $loop ++;
75
+ }
76
+ $output .= "</ul>\n";
77
+
78
+ }
79
+
80
+ // Add link to Twitter
81
+ $output .= "<p><a href=\"http://twitter.com/artiss_tech\">Follow us on Twitter</a></p>\n";
82
+
83
+ // Generate support links
84
+ $output .= "<span style=\"font-size: 1.1em; font-weight: bold;\">Support Links</span><br/><br/>\n<ul>\n<li><a href=\"http://www.artiss.co.uk\">Artiss.co.uk website</a><br/></li>\n<li><a href=\"http://www.artiss.co.uk/wp-plugins\">Main plugin page</a><br/></li>\n<li><a href=\"http://www.artiss.co.uk/forum\">Plugin forum </a></li>\n</ul>\n";
85
 
86
  // Update cache
87
  set_transient( 'artiss_dashboard_text', $output, $minutes_to_cache * 60 );
89
 
90
  echo $output;
91
  }
92
+
93
+ /**
94
+ * Fetch a file (1.5)
95
+ * Use WordPress API to fetch a file and check results
96
+ *
97
+ * @package [Plugin Name]
98
+ * @since [version number]
99
+ *
100
+ * @param string $filein File name to fetch
101
+ * @return string Array containing file contents and response
102
+ */
103
+
104
+ function adw_get_file( $filein ) {
105
+
106
+ $fileout = wp_remote_get( $filein );
107
+ if ( !is_wp_error( $response ) ) {
108
+ if ( isset( $fileout[ 'body' ] ) ) { $file_return[ 'file' ] = $fileout[ 'body' ]; }
109
+ if ( isset( $fileout[ 'response '][ 'code' ] ) ) { $file_return[ 'response' ] = $fileout[ 'response' ][ 'code' ]; }
110
+ }
111
+
112
+ return $file_return;
113
+
114
+ }
115
  ?>
includes/content.php CHANGED
@@ -14,7 +14,7 @@
14
  * Look through post/page content for various alternative methods of embedding - replace with
15
  * embed code.
16
  *
17
- * @since 2.0
18
  *
19
  * @uses ye_convert_content Convert a URL to the embed code
20
  * @uses ye_generate_youtube_code Generate the YouTube embed code
@@ -77,9 +77,9 @@ function ye_content_search( $content ) {
77
  $current_pos = 0;
78
  $bracket_found = true;
79
 
80
- while ( $bracket_found ) {
81
  $open_bracket = strpos( $content, '[', $current_pos );
82
-
83
  if ($open_bracket !== false) {
84
  $close_bracket = strpos( $content, ']', $open_bracket );
85
 
@@ -119,17 +119,17 @@ function ye_content_search( $content ) {
119
  }
120
  }
121
  }
122
-
123
  return $content;
124
  }
125
- add_filter( 'the_content', 'ye_content_search' );
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
@@ -142,16 +142,16 @@ add_filter( 'the_content', 'ye_content_search' );
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
  $url = ye_set_url_option();
152
  if ( $url != '' ) {
153
  wp_embed_register_handler( 'youtube', '/http:\/\/(?:www\.)?youtube.*watch\?[pv]=([a-zA-Z0-9\-_]+)/', 'ye_embed_handler' );
154
- wp_embed_register_handler( 'youtube_embed', '/http:\/\/(?:www\.)?youtube.*[pv]\/([a-zA-Z0-9\-_]+)/', 'ye_embed_handler' );
155
  }
156
 
157
  /**
@@ -159,7 +159,7 @@ if ( $url != '' ) {
159
  *
160
  * Convert the URL to the embed code
161
  *
162
- * @since 2.0
163
  *
164
  * @uses ye_generate_youtube_code Generate the embed code
165
  *
@@ -173,10 +173,10 @@ if ( $url != '' ) {
173
  */
174
 
175
  function ye_convert_content( $content, $identifier, $id, $audio = '', $suffix = '', $profile = '' ) {
176
-
177
  $code = ye_generate_youtube_code( $id, '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', $profile, '', $audio );
178
  $content = str_replace( $identifier.$id.$suffix, $code, $content);
179
-
180
  return $content;
181
  }
182
 
@@ -185,7 +185,7 @@ function ye_convert_content( $content, $identifier, $id, $audio = '', $suffix =
185
  *
186
  * Filter comments and add YouTube embeds
187
  *
188
- * @since 2.0
189
  *
190
  * @uses ye_set_general_defaults Get the general defaults
191
  * @uses ye_generate_youtube_code Generate the YouTube embed code
@@ -197,13 +197,13 @@ function ye_convert_content( $content, $identifier, $id, $audio = '', $suffix =
197
  function ye_filter_comments( $content ) {
198
 
199
  $options = ye_set_general_defaults();
200
-
201
  if ( $options[ 'comments' ] == 1 ) {
202
-
203
  $identifier = 'http://www.youtube.com/watch?v=';
204
  $search_pos = 0;
205
  $search = strpos( $content, $identifier, $search_pos );
206
-
207
  while ( $search !== false ) {
208
  $prefix = substr( $content, $search - 1, 1 );
209
  if ( ( $prefix != ']' ) && ( $prefix != '"' ) && ( $prefix != "'" ) ) {
14
  * Look through post/page content for various alternative methods of embedding - replace with
15
  * embed code.
16
  *
17
+ * @since 2.0
18
  *
19
  * @uses ye_convert_content Convert a URL to the embed code
20
  * @uses ye_generate_youtube_code Generate the YouTube embed code
77
  $current_pos = 0;
78
  $bracket_found = true;
79
 
80
+ while ( $bracket_found ) {
81
  $open_bracket = strpos( $content, '[', $current_pos );
82
+
83
  if ($open_bracket !== false) {
84
  $close_bracket = strpos( $content, ']', $open_bracket );
85
 
119
  }
120
  }
121
  }
122
+
123
  return $content;
124
  }
125
+ add_filter( 'the_content', 'ye_content_search' );
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
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
  $url = ye_set_url_option();
152
  if ( $url != '' ) {
153
  wp_embed_register_handler( 'youtube', '/http:\/\/(?:www\.)?youtube.*watch\?[pv]=([a-zA-Z0-9\-_]+)/', 'ye_embed_handler' );
154
+ wp_embed_register_handler( 'youtube_embed', '/http:\/\/(?:www\.)?youtube.*[pv]\/([a-zA-Z0-9\-_]+)/', 'ye_embed_handler' );
155
  }
156
 
157
  /**
159
  *
160
  * Convert the URL to the embed code
161
  *
162
+ * @since 2.0
163
  *
164
  * @uses ye_generate_youtube_code Generate the embed code
165
  *
173
  */
174
 
175
  function ye_convert_content( $content, $identifier, $id, $audio = '', $suffix = '', $profile = '' ) {
176
+
177
  $code = ye_generate_youtube_code( $id, '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', $profile, '', $audio );
178
  $content = str_replace( $identifier.$id.$suffix, $code, $content);
179
+
180
  return $content;
181
  }
182
 
185
  *
186
  * Filter comments and add YouTube embeds
187
  *
188
+ * @since 2.0
189
  *
190
  * @uses ye_set_general_defaults Get the general defaults
191
  * @uses ye_generate_youtube_code Generate the YouTube embed code
197
  function ye_filter_comments( $content ) {
198
 
199
  $options = ye_set_general_defaults();
200
+
201
  if ( $options[ 'comments' ] == 1 ) {
202
+
203
  $identifier = 'http://www.youtube.com/watch?v=';
204
  $search_pos = 0;
205
  $search = strpos( $content, $identifier, $search_pos );
206
+
207
  while ( $search !== false ) {
208
  $prefix = substr( $content, $search - 1, 1 );
209
  if ( ( $prefix != ']' ) && ( $prefix != '"' ) && ( $prefix != "'" ) ) {
includes/function-calls.php CHANGED
@@ -17,7 +17,7 @@
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
@@ -83,7 +83,7 @@ function youtube_video_embed( $content, $paras = '', $style = '' ) {
83
  function youtube_thumb_embed( $content, $paras = '', $style = '', $alt = '' ) {
84
 
85
  $class = ye_get_parameters( $paras, 'class' );
86
- $rel = ye_get_parameters( $paras, 'rel' );
87
  $target = ye_get_parameters( $paras, 'target' );
88
  $width = ye_get_parameters( $paras, 'width' );
89
  $height = ye_get_parameters( $paras, 'height' );
@@ -101,7 +101,7 @@ function youtube_thumb_embed( $content, $paras = '', $style = '', $alt = '' ) {
101
  *
102
  * @since 2.0
103
  *
104
- * @uses ye_generate_shorturl_code Display an error
105
  *
106
  * @param string $id YouTube video ID
107
  * @return string Download URL
@@ -168,7 +168,7 @@ function get_youtube_transcript_xml ( $id ) {
168
  if ( $xml[ 'rc' ] > 0 ) {
169
  echo ye_error( 'Could not fetch the transcript file ' . $filename . '.' );
170
  return;
171
- } else {
172
  return $xml;
173
  }
174
  }
@@ -195,7 +195,7 @@ function get_youtube_transcript( $id ) {
195
  *
196
  * Function to return the name of a YouTube video
197
  *
198
- * @since 2.0
199
  *
200
  * @uses ye_extract_id Extract the video ID
201
  * @uses ye_validate_id Get the name and video type
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
83
  function youtube_thumb_embed( $content, $paras = '', $style = '', $alt = '' ) {
84
 
85
  $class = ye_get_parameters( $paras, 'class' );
86
+ $rel = ye_get_parameters( $paras, 'rel' );
87
  $target = ye_get_parameters( $paras, 'target' );
88
  $width = ye_get_parameters( $paras, 'width' );
89
  $height = ye_get_parameters( $paras, 'height' );
101
  *
102
  * @since 2.0
103
  *
104
+ * @uses ye_generate_shorturl_code Display an error
105
  *
106
  * @param string $id YouTube video ID
107
  * @return string Download URL
168
  if ( $xml[ 'rc' ] > 0 ) {
169
  echo ye_error( 'Could not fetch the transcript file ' . $filename . '.' );
170
  return;
171
+ } else {
172
  return $xml;
173
  }
174
  }
195
  *
196
  * Function to return the name of a YouTube video
197
  *
198
+ * @since 2.0
199
  *
200
  * @uses ye_extract_id Extract the video ID
201
  * @uses ye_validate_id Get the name and video type
includes/generate-download-code.php CHANGED
@@ -12,7 +12,7 @@
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
@@ -33,7 +33,7 @@ function ye_generate_download_code( $id ) {
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;
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
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;
includes/generate-embed-code.php CHANGED
@@ -241,11 +241,12 @@ function ye_generate_youtube_code( $id = '', $type = '', $width = '', $height =
241
  // Set up embed types
242
  $tab = '';
243
  $class = 'youtube-player';
244
- $paras = '?version=3&amp;modestbranding=1';
245
 
246
  $embedplus = false;
247
  $swf = false;
248
  $iframe = false;
 
249
 
250
  if ( $type != 'v' ) {
251
  if ( $type == 'm' ) {
@@ -255,10 +256,14 @@ function ye_generate_youtube_code( $id = '', $type = '', $width = '', $height =
255
  $class = 'cantembedplus';
256
  $fallback = $options[ 'fallback' ];
257
  } else {
258
- $swf = true;
 
 
 
 
259
  }
260
  } else {
261
- $iframe = true;
262
  }
263
 
264
  // Generate parameters to add to URL
@@ -302,12 +307,20 @@ function ye_generate_youtube_code( $id = '', $type = '', $width = '', $height =
302
  }
303
 
304
  // Add AS3 YouTube embed code
305
- if ( ( $swf ) or ( ( $embedplus ) && ( ( $fallback == 'o' ) or ( $fallback == 'p' ) ) ) ) {
306
- $result .= $tab . "<object class=\"" . $class . "\" type=\"application/x-shockwave-flash\" data=\"http" . $https . "://www.youtube.com/" . $embed_type . "/" . $id . $paras . "\" width=\"" . $width . "\" height=\"" . $height . "\" style=\"" . $style . "\"";
 
 
 
 
 
 
 
 
307
  if ( $metadata != 0 ) { $result .= " rel=\"media:video\" resource=\"http" . $https . "://www.youtube.com/" . $embed_type . "/" . $id ."\" xmlns:media=\"http://search.yahoo.com/searchmonkey/media/\""; }
308
  $result .= ">\n";
309
  if ( $metadata != 0 ) { $result .= $tab . "\t<a rel=\"media:thumbnail\" href=\"http://img.youtube.com/vi/" . $id . "/default.jpg\" />\n"; }
310
- $result .= $tab . "\t<param name=\"movie\" value=\"http" . $https . "://www.youtube.com/" . $embed_type . "/" . $id . $paras . "\" />\n";
311
  $result .= $tab . "\t<param name=\"wmode\" value=\"" . $wmode . "\" />\n";
312
  if ( $fullscreen == 1 ) { $result .= $tab . "\t<param name=\"allowFullScreen\" value=\"true\" />\n"; }
313
  if ( ( $link != 1 ) && ( $link != '' ) ) { $result .= $tab . "\t<param name=\"allowNetworking\" value=\"internal\" />\n"; }
@@ -318,7 +331,7 @@ function ye_generate_youtube_code( $id = '', $type = '', $width = '', $height =
318
  // Add IFRAME embed code
319
  if ( ( $iframe ) or ( ( $embedplus ) && ( $fallback == "v" ) ) ) {
320
  if ( $embed_type == "p" ) { $playlist_para = "p/"; } else { $playlist_para = ''; }
321
- $result .= $tab . '<iframe style="border: 0;' . $style . '" class="' . $class . '" width="' . $width . '" height="' . $height . '" src="http' . $https . '://www.youtube.com/embed/' . $playlist_para . $id . '?' . substr( $paras, 1 ) . '&amp;wmode=' . $wmode . '"';
322
  if ( $fullscreen == 1 ) { $result .= ' allowfullscreen="allowfullscreen"'; }
323
  $result .= "></iframe>\n";
324
  }
@@ -327,7 +340,7 @@ function ye_generate_youtube_code( $id = '', $type = '', $width = '', $height =
327
  if ( $embedplus ) { $result .= "</object>\n<!--[if lte IE 6]> <style type=\"text/css\">.cantembedplus{display:none;}</style><![endif]-->\n"; }
328
 
329
  // Add drop shadow
330
- if ( ( is_numeric( $shadow ) ) && ( $shadow != 0 ) ) { $result .= "<br/><img src=\"" . WP_PLUGIN_URL . "/youtube-embed/images/shadow.png\" alt=\"\" title=\"\" height=\"" . $shadow . "\" width=\"" . $width . "\" />\n"; }
331
 
332
  // Now apply the template to the result
333
  $result = str_replace( '%video%', $result, $template );
241
  // Set up embed types
242
  $tab = '';
243
  $class = 'youtube-player';
244
+ $paras = 'version=3&amp;modestbranding=1';
245
 
246
  $embedplus = false;
247
  $swf = false;
248
  $iframe = false;
249
+ $chromeless = false;
250
 
251
  if ( $type != 'v' ) {
252
  if ( $type == 'm' ) {
256
  $class = 'cantembedplus';
257
  $fallback = $options[ 'fallback' ];
258
  } else {
259
+ if ( $type == "c" ) {
260
+ $chromeless = true;
261
+ } else {
262
+ $swf = true;
263
+ }
264
  }
265
  } else {
266
+ $iframe = true;
267
  }
268
 
269
  // Generate parameters to add to URL
307
  }
308
 
309
  // Add AS3 YouTube embed code
310
+ if ( ( $swf ) or ( $chromeless ) or ( ( $embedplus ) && ( ( $fallback == 'o' ) or ( $fallback == 'p' ) ) ) ) {
311
+
312
+ if ( $chromeless ) {
313
+ $url_start = 'http' . $https . '://www.youtube.com/apiplayer?video_id=' . $id . '&';
314
+ } else {
315
+ $url_start = 'http' . $https . '://www.youtube.com/' . $embed_type . '/' . $id . '?';
316
+ }
317
+
318
+ $result .= $tab . "<object class=\"" . $class . "\" type=\"application/x-shockwave-flash\" data=\"" . $url_start . $paras . "\" width=\"" . $width . "\" height=\"" . $height . "\" style=\"" . $style . "\"";
319
+
320
  if ( $metadata != 0 ) { $result .= " rel=\"media:video\" resource=\"http" . $https . "://www.youtube.com/" . $embed_type . "/" . $id ."\" xmlns:media=\"http://search.yahoo.com/searchmonkey/media/\""; }
321
  $result .= ">\n";
322
  if ( $metadata != 0 ) { $result .= $tab . "\t<a rel=\"media:thumbnail\" href=\"http://img.youtube.com/vi/" . $id . "/default.jpg\" />\n"; }
323
+ $result .= $tab . "\t<param name=\"movie\" value=\"http" . $https . "://www.youtube.com/" . $embed_type . "/" . $id . "?" . $paras . "\" />\n";
324
  $result .= $tab . "\t<param name=\"wmode\" value=\"" . $wmode . "\" />\n";
325
  if ( $fullscreen == 1 ) { $result .= $tab . "\t<param name=\"allowFullScreen\" value=\"true\" />\n"; }
326
  if ( ( $link != 1 ) && ( $link != '' ) ) { $result .= $tab . "\t<param name=\"allowNetworking\" value=\"internal\" />\n"; }
331
  // Add IFRAME embed code
332
  if ( ( $iframe ) or ( ( $embedplus ) && ( $fallback == "v" ) ) ) {
333
  if ( $embed_type == "p" ) { $playlist_para = "p/"; } else { $playlist_para = ''; }
334
+ $result .= $tab . '<iframe style="border: 0;' . $style . '" class="' . $class . '" width="' . $width . '" height="' . $height . '" src="http' . $https . '://www.youtube.com/embed/' . $playlist_para . $id . '?' . $paras . '&amp;wmode=' . $wmode . '"';
335
  if ( $fullscreen == 1 ) { $result .= ' allowfullscreen="allowfullscreen"'; }
336
  $result .= "></iframe>\n";
337
  }
340
  if ( $embedplus ) { $result .= "</object>\n<!--[if lte IE 6]> <style type=\"text/css\">.cantembedplus{display:none;}</style><![endif]-->\n"; }
341
 
342
  // Add drop shadow
343
+ if ( ( is_numeric( $shadow ) ) && ( $shadow != 0 ) ) { $result .= "<br/><img src=\"" . plugins_url() . "/youtube-embed/images/shadow.png\" alt=\"\" title=\"\" height=\"" . $shadow . "\" width=\"" . $width . "\" />\n"; }
344
 
345
  // Now apply the template to the result
346
  $result = str_replace( '%video%', $result, $template );
includes/generate-shorturl-code.php CHANGED
@@ -33,7 +33,7 @@ function ye_generate_shorturl_code( $id ) {
33
  } else {
34
  return ye_error( 'The YouTube ID of ' . $id . ' is invalid.' );
35
  }
36
- }
37
 
38
  return 'http://youtu.be/' . $id;
39
  }
33
  } else {
34
  return ye_error( 'The YouTube ID of ' . $id . ' is invalid.' );
35
  }
36
+ }
37
 
38
  return 'http://youtu.be/' . $id;
39
  }
includes/generate-thumbnail-code.php CHANGED
@@ -15,7 +15,7 @@
15
  * @param string $style Link STYLE
16
  * @param string $class Link CLASS
17
  * @param string $rel Link REL
18
- * @param string $target Link target
19
  * @param string $width Width
20
  * @param string $height Height
21
  * @param string $alt ALT text
@@ -23,7 +23,7 @@
23
  */
24
 
25
  function ye_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 = ye_extract_id( $id );
29
 
@@ -37,13 +37,13 @@ function ye_generate_thumbnail_code( $id, $style, $class, $rel, $target, $width,
37
  return ye_error( 'The YouTube ID of ' . $id . ' is invalid.' );
38
  }
39
  }
40
-
41
  $version = strtolower( $version );
42
  if ( ( $version != 'default' ) && ( $version != 'hq' ) && ( $version != 'start' ) && ( $version != 'middle' ) && ( $version != 'end' ) ) { $version = 'default'; }
43
  if ( $version == 'hq' ) { $version = 'hqdefault'; }
44
  if ( $version == 'start' ) { $version = 1; }
45
  if ( $version == 'middle' ) { $version = 2; }
46
- if ( $version == 'end' ) { $version = 3; }
47
 
48
  // Now create the required code
49
  if ( $alt == '' ) { $alt = 'YouTube Video ' . $id; }
15
  * @param string $style Link STYLE
16
  * @param string $class Link CLASS
17
  * @param string $rel Link REL
18
+ * @param string $target Link target
19
  * @param string $width Width
20
  * @param string $height Height
21
  * @param string $alt ALT text
23
  */
24
 
25
  function ye_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 = ye_extract_id( $id );
29
 
37
  return ye_error( 'The YouTube ID of ' . $id . ' is invalid.' );
38
  }
39
  }
40
+
41
  $version = strtolower( $version );
42
  if ( ( $version != 'default' ) && ( $version != 'hq' ) && ( $version != 'start' ) && ( $version != 'middle' ) && ( $version != 'end' ) ) { $version = 'default'; }
43
  if ( $version == 'hq' ) { $version = 'hqdefault'; }
44
  if ( $version == 'start' ) { $version = 1; }
45
  if ( $version == 'middle' ) { $version = 2; }
46
+ if ( $version == 'end' ) { $version = 3; }
47
 
48
  // Now create the required code
49
  if ( $alt == '' ) { $alt = 'YouTube Video ' . $id; }
includes/generate-transcript-code.php CHANGED
@@ -34,7 +34,7 @@ function ye_generate_transcript( $id ) {
34
  } else {
35
  return ye_error( 'The YouTube ID of ' . $id . ' is invalid.' );
36
  }
37
- }
38
 
39
  // Get general options
40
  $general = ye_set_general_defaults();
@@ -85,7 +85,7 @@ function ye_generate_transcript( $id ) {
85
  $output .= "<!-- End of YouTube Embed code -->\n";
86
  }
87
 
88
- // Save the cache
89
  if ( $general[ 'transcript_cache' ] != 0 ) { set_transient( $cache_key, $output, 3600 * $general[ 'transcript_cache' ] ); }
90
 
91
  return $output;
34
  } else {
35
  return ye_error( 'The YouTube ID of ' . $id . ' is invalid.' );
36
  }
37
+ }
38
 
39
  // Get general options
40
  $general = ye_set_general_defaults();
85
  $output .= "<!-- End of YouTube Embed code -->\n";
86
  }
87
 
88
+ // Save the cache
89
  if ( $general[ 'transcript_cache' ] != 0 ) { set_transient( $cache_key, $output, 3600 * $general[ 'transcript_cache' ] ); }
90
 
91
  return $output;
includes/mcebutton.php CHANGED
@@ -16,8 +16,8 @@
16
  */
17
 
18
  function youtube_embed_button() {
19
-
20
- if ( current_user_can( 'edit_pages' ) ) {
21
  $options = ye_set_general_defaults();
22
 
23
  if ( ( get_user_option( 'rich_editing' ) == 'true' ) && ( $options[ 'editor_button' ] != '' ) ) {
@@ -56,7 +56,7 @@ function register_youtube_embed_button( $buttons ) {
56
  */
57
 
58
  function add_youtube_embed_mce_plugin( $plugin_array ) {
59
- $plugin_array[ 'YouTube' ] = WP_PLUGIN_URL . '/youtube-embed/js/mcebutton.js';
60
  return $plugin_array;
61
  }
62
  ?>
16
  */
17
 
18
  function youtube_embed_button() {
19
+
20
+ if ( current_user_can( 'edit_posts' ) ) {
21
  $options = ye_set_general_defaults();
22
 
23
  if ( ( get_user_option( 'rich_editing' ) == 'true' ) && ( $options[ 'editor_button' ] != '' ) ) {
56
  */
57
 
58
  function add_youtube_embed_mce_plugin( $plugin_array ) {
59
+ $plugin_array[ 'YouTube' ] = plugins_url() . '/youtube-embed/js/mcebutton.js';
60
  return $plugin_array;
61
  }
62
  ?>
includes/options-general.php CHANGED
@@ -10,7 +10,7 @@
10
 
11
  ?>
12
  <div class="wrap">
13
- <div class="icon32"><img src="<?php echo WP_PLUGIN_URL; ?>/youtube-embed/images/screen_icon.png" alt="" title="" height="32px" width="32px"/><br /></div>
14
  <h2>Artiss YouTube Embed Options</h2>
15
 
16
  <?php
@@ -46,13 +46,16 @@ if ( ( !empty( $_POST ) ) && ( check_admin_referer( 'youtube-embed-general', 'yo
46
  $options[ 'api' ] = $_POST[ 'youtube_embed_api' ];
47
  $options[ 'error_message' ] = htmlspecialchars( $_POST[ 'youtube_embed_error_message' ] );
48
  $options[ 'thumbnail' ] = $_POST[ 'youtube_embed_thumbnail' ];
 
49
 
50
  // Update the options
51
  update_option( 'youtube_embed_general', $options );
52
 
53
  // Update the alternative shortcodes
54
  $shortcode[ 1 ] = $_POST[ 'youtube_embed_shortcode' ];
55
- $shortcode[ 2 ] = $_POST[ 'youtube_embed_shortcode2' ];
 
 
56
  update_option( 'youtube_embed_shortcode', $shortcode );
57
 
58
  // Update the URL override
@@ -65,7 +68,15 @@ if ( ( !empty( $_POST ) ) && ( check_admin_referer( 'youtube-embed-general', 'yo
65
  $options = ye_set_general_defaults();
66
  $shortcode = ye_set_shortcode_option();
67
  $url = ye_set_url_option();
68
- ?>
 
 
 
 
 
 
 
 
69
 
70
  <p><?php _e( 'These are the general settings for Artiss YouTube Embed. Please select <a href="http://www.artiss.co.uk/wp-admin/admin.php?page=youtube-embed-profiles">Profiles</a> for default embedding settings.' ); ?></p>
71
 
@@ -124,7 +135,7 @@ $url = ye_set_url_option();
124
  </tr>
125
  </table>
126
 
127
- <br/><span class="yt_heading"><?php _e( 'Alternative Shortcodes' ); ?></span><br/><br/>Specify up to 2 alternative shortcodes to compliment the standard <code>[youtube]</code> shortcode.
128
 
129
  <table class="form-table">
130
  <tr>
@@ -241,11 +252,21 @@ $url = ye_set_url_option();
241
 
242
  <p><?php _e( 'Playback errors are within the XHTML source code as comments - parameter errors and other types are displayed on the post output.' ); ?></p>
243
 
244
- <table class="form-table">
245
- <tr>
246
  <th scope="row"><?php _e( 'Video Playback Error Message' ); ?></th>
247
  <td><input type="text" size="60" name="youtube_embed_error_message" value="<?php echo $options[ 'error_message' ]; ?>"/>&nbsp;<span class="description"><?php _e( 'This is the message that will be shown on the post' ); ?></span></td>
248
- </table>
 
 
 
 
 
 
 
 
 
 
 
249
 
250
  <?php wp_nonce_field( 'youtube-embed-general','youtube_embed_general_nonce', true, true ); ?>
251
 
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>Artiss YouTube Embed Options</h2>
15
 
16
  <?php
46
  $options[ 'api' ] = $_POST[ 'youtube_embed_api' ];
47
  $options[ 'error_message' ] = htmlspecialchars( $_POST[ 'youtube_embed_error_message' ] );
48
  $options[ 'thumbnail' ] = $_POST[ 'youtube_embed_thumbnail' ];
49
+ $options[ 'donation' ] = $_POST[ 'youtube_embed_donation' ];
50
 
51
  // Update the options
52
  update_option( 'youtube_embed_general', $options );
53
 
54
  // Update the alternative shortcodes
55
  $shortcode[ 1 ] = $_POST[ 'youtube_embed_shortcode' ];
56
+ $shortcode[ 1 ] = trim( $shortcode[ 1 ], '[]' );
57
+ $shortcode[ 2 ] = $_POST[ 'youtube_embed_shortcode2' ];
58
+ $shortcode[ 2 ] = trim( $shortcode[ 2 ], '[]' );
59
  update_option( 'youtube_embed_shortcode', $shortcode );
60
 
61
  // Update the URL override
68
  $options = ye_set_general_defaults();
69
  $shortcode = ye_set_shortcode_option();
70
  $url = ye_set_url_option();
71
+
72
+ if ( $options[ 'donation' ] != 1 ) : ?>
73
+
74
+ <div style="text-align: center;"><script type="text/javascript">
75
+ var psHost = (("https:" == document.location.protocol) ? "https://" : "http://");
76
+ document.write(unescape("%3Cscript src='" + psHost + "pluginsponsors.com/direct/spsn/display.php?client=youtube-embed&spot=' type='text/javascript'%3E%3C/script%3E"));
77
+ </script></div>
78
+
79
+ <?php endif; ?>
80
 
81
  <p><?php _e( 'These are the general settings for Artiss YouTube Embed. Please select <a href="http://www.artiss.co.uk/wp-admin/admin.php?page=youtube-embed-profiles">Profiles</a> for default embedding settings.' ); ?></p>
82
 
135
  </tr>
136
  </table>
137
 
138
+ <br/><span class="yt_heading"><?php _e( 'Alternative Shortcodes' ); ?></span><br/><br/>Specify up to 2 alternative shortcodes to compliment the standard <code>youtube</code> shortcode. <strong>NB: These should be specified without the surrounding square brackets.</strong>
139
 
140
  <table class="form-table">
141
  <tr>
252
 
253
  <p><?php _e( 'Playback errors are within the XHTML source code as comments - parameter errors and other types are displayed on the post output.' ); ?></p>
254
 
255
+ <table class="form-table"><tr>
 
256
  <th scope="row"><?php _e( 'Video Playback Error Message' ); ?></th>
257
  <td><input type="text" size="60" name="youtube_embed_error_message" value="<?php echo $options[ 'error_message' ]; ?>"/>&nbsp;<span class="description"><?php _e( 'This is the message that will be shown on the post' ); ?></span></td>
258
+ </tr></table>
259
+
260
+ <br/><span class="yt_heading"><?php _e( 'Advertising' ); ?></span>
261
+
262
+ <p><?php _e( 'If you have donated to Artiss.co.uk then you may switch off the PluginSponsors.com advertising present in the plugin option screens.' ); ?></p>
263
+
264
+ <table class="form-table"><tr>
265
+ <th scope="row"><?php _e( 'Donated' ); ?></th>
266
+ <td><input type="checkbox" name="youtube_embed_donation" value="1"<?php if ( $options[ 'donation' ] == "1" ) { echo ' checked="checked"'; } ?>/>&nbsp;<span class="description"><?php _e( 'Tick if you have donated to Artiss.co.uk' ); ?></span></td>
267
+ </tr></table>
268
+
269
+ <br/><a href="http://pluginsponsors.com/lib/privacy/"><?php _e( 'Read the PluginSponsors.com privacy policy.' ); ?></a><br/>
270
 
271
  <?php wp_nonce_field( 'youtube-embed-general','youtube_embed_general_nonce', true, true ); ?>
272
 
includes/options-lists.php CHANGED
@@ -10,7 +10,7 @@
10
  ?>
11
  <div class="wrap">
12
 
13
- <div class="icon32"><img src="<?php echo WP_PLUGIN_URL; ?>/youtube-embed/images/screen_icon.png" alt="" title="" height="32px" width="32px"/><br /></div>
14
 
15
  <h2>Artiss YouTube Embed Lists</h2>
16
 
@@ -72,7 +72,15 @@ if ( ( !empty( $_POST[ 'Submit' ] ) ) && ( check_admin_referer( 'youtube-embed-g
72
  // Fetch options into an array
73
  if ( $class != "error" ) { $options = ye_set_list_defaults( $list_no ); }
74
  $general = ye_set_general_defaults();
75
- ?>
 
 
 
 
 
 
 
 
76
 
77
  <form method="post" action="<?php echo get_bloginfo( 'wpurl' ) . '/wp-admin/admin.php?page=youtube-embed-lists'; ?>">
78
 
@@ -86,6 +94,7 @@ while ( $loop <= $general[ 'list_no' ] ) {
86
  $listname = $listfiles[ 'name' ];
87
 
88
  if ( $listname == '' ) { $listname = 'List ' . $loop; }
 
89
  echo '<option value="' . $loop . '"';
90
  if ( $list_no == $loop ) { echo " selected='selected'"; }
91
  echo '>' . __( $listname ) . "</option>\n";
@@ -103,7 +112,7 @@ while ( $loop <= $general[ 'list_no' ] ) {
103
 
104
  <tr>
105
  <th scope="row"><?php _e( 'List name' ); ?></th><td>
106
- <input type="text" size="20" maxlength="20" name="youtube_embed_name" value="<?php echo $options[ 'name' ]; ?>"/>
107
  <?php echo '&nbsp;<span class="description">' . __( 'The name you wish to give this list' ) . '</span>'; ?>
108
  </td></tr>
109
 
@@ -169,7 +178,7 @@ if ( $options[ 'list' ] != '' ) {
169
  echo 'font-weight: bold; color: #f00;';
170
  }
171
 
172
- echo '"><img src="' . WP_PLUGIN_URL . '/youtube-embed/images/';
173
  if ( $status == 0 ) {
174
  echo 'tick.png" alt="The video ID is valid" title="The video ID is valid" ';
175
  } else {
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>Artiss YouTube Embed Lists</h2>
16
 
72
  // Fetch options into an array
73
  if ( $class != "error" ) { $options = ye_set_list_defaults( $list_no ); }
74
  $general = ye_set_general_defaults();
75
+
76
+ if ( $general[ 'donation' ] != 1 ) : ?>
77
+
78
+ <div style="text-align: center;"><script type="text/javascript">
79
+ var psHost = (("https:" == document.location.protocol) ? "https://" : "http://");
80
+ document.write(unescape("%3Cscript src='" + psHost + "pluginsponsors.com/direct/spsn/display.php?client=youtube-embed&spot=' type='text/javascript'%3E%3C/script%3E"));
81
+ </script></div>
82
+
83
+ <?php endif; ?>
84
 
85
  <form method="post" action="<?php echo get_bloginfo( 'wpurl' ) . '/wp-admin/admin.php?page=youtube-embed-lists'; ?>">
86
 
94
  $listname = $listfiles[ 'name' ];
95
 
96
  if ( $listname == '' ) { $listname = 'List ' . $loop; }
97
+ if ( strlen( $listname ) > 30 ) { $listname = substr( $listname, 0, 30 ) . '&#8230;'; }
98
  echo '<option value="' . $loop . '"';
99
  if ( $list_no == $loop ) { echo " selected='selected'"; }
100
  echo '>' . __( $listname ) . "</option>\n";
112
 
113
  <tr>
114
  <th scope="row"><?php _e( 'List name' ); ?></th><td>
115
+ <input type="text" size="20" name="youtube_embed_name" value="<?php echo $options[ 'name' ]; ?>"/>
116
  <?php echo '&nbsp;<span class="description">' . __( 'The name you wish to give this list' ) . '</span>'; ?>
117
  </td></tr>
118
 
178
  echo 'font-weight: bold; color: #f00;';
179
  }
180
 
181
+ echo '"><img src="' . plugins_url() . '/youtube-embed/images/';
182
  if ( $status == 0 ) {
183
  echo 'tick.png" alt="The video ID is valid" title="The video ID is valid" ';
184
  } else {
includes/options-profiles.php CHANGED
@@ -10,7 +10,7 @@
10
  ?>
11
  <div class="wrap">
12
 
13
- <div class="icon32"><img src="<?php echo WP_PLUGIN_URL; ?>/youtube-embed/images/screen_icon.png" alt="" title="" height="32px" width="32px"/><br /></div>
14
 
15
  <h2>Artiss YouTube Embed Profiles</h2>
16
 
@@ -50,9 +50,9 @@ if ( ( !empty( $_POST[ 'Submit' ] ) ) && ( check_admin_referer( 'youtube-embed-p
50
  $options[ 'shadow'] = $_POST[ 'youtube_embed_shadow' ];
51
  $options[ 'audio'] = $_POST[ 'youtube_embed_audio' ];
52
  $options[ 'hd'] = $_POST[ 'youtube_embed_hd' ];
53
- $options[ 'color' ] = $_POST[ 'youtube_embed_color' ];
54
  $options[ 'theme' ] = $_POST[ 'youtube_embed_theme' ];
55
- $options[ 'https' ] = $_POST[ 'youtube_embed_https' ];
56
 
57
  $default_size = $_POST[ 'youtube_embed_size' ];
58
 
@@ -73,7 +73,16 @@ if ( !empty( $_POST[ 'Video' ] ) ) { $video_type = $_POST[ 'youtube_embed_video_
73
  // Fetch options into an array
74
  $options = ye_set_profile_defaults( $profile_no );
75
  $general = ye_set_general_defaults();
76
- ?>
 
 
 
 
 
 
 
 
 
77
  <form method="post" action="<?php echo get_bloginfo( 'wpurl' ) . '/wp-admin/admin.php?page=youtube-embed-profiles' ?>">
78
 
79
  <span class="alignright">
@@ -93,7 +102,7 @@ _e( '<br/>Use the drop-down on the right hand side to swap between profiles.' );
93
 
94
  <tr>
95
  <th scope="row"><?php _e( 'Profile name' ); ?></th><td>
96
- <input type="text" size="20" maxlength="20" name="youtube_embed_name" value="<?php echo $options[ 'name' ]; ?>"<?php if ( $profile_no == 0 ) { echo ' readonly="readonly"'; } ?>/>
97
  <?php if ( $profile_no != 0 ) { echo '&nbsp;<span class="description">' . __( 'The name you wish to give this profile' ) . '</span>'; } ?>
98
  </td></tr>
99
 
@@ -102,6 +111,7 @@ _e( '<br/>Use the drop-down on the right hand side to swap between profiles.' );
102
  <td><span class="description"><?php _e( 'The type of player to use for videos.' ); ?></span><br/>
103
  <input type="radio" name="youtube_embed_type" value="v"<?php if ( $options[ 'type' ] == "v" ) { echo ' checked="checked"'; } ?>/><?php _e( '&nbsp;IFRAME' ); ?><span class="description"><?php _e( '&nbsp;Uses HTML5, where available. This is the current YouTube default..' ); ?></span><br/>
104
  <input type="radio" name="youtube_embed_type" value="p"<?php if ( $options[ 'type' ] == "p" ) { echo ' checked="checked"'; } ?>/><?php _e( '&nbsp;OBJECT' ); ?><span class="description"><?php _e( '&nbsp;Use the AS3 Flash player.' ); ?></span><br/>
 
105
  <input type="radio" name="youtube_embed_type" value="m"<?php if ( $options[ 'type' ] == "m" ) { echo ' checked="checked"'; } ?>/><?php _e( '&nbsp;EmbedPlus' ); ?><span class="description"><?php _e( '&nbsp;Use <a href="http://www.artiss.co.uk/artiss-youtube-embed/further-help#ye-embedplus">EmbedPlus</a>, if Flash is available.' ); ?></span>
106
  </td>
107
  </tr>
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>Artiss YouTube Embed Profiles</h2>
16
 
50
  $options[ 'shadow'] = $_POST[ 'youtube_embed_shadow' ];
51
  $options[ 'audio'] = $_POST[ 'youtube_embed_audio' ];
52
  $options[ 'hd'] = $_POST[ 'youtube_embed_hd' ];
53
+ $options[ 'color' ] = $_POST[ 'youtube_embed_color' ];
54
  $options[ 'theme' ] = $_POST[ 'youtube_embed_theme' ];
55
+ $options[ 'https' ] = $_POST[ 'youtube_embed_https' ];
56
 
57
  $default_size = $_POST[ 'youtube_embed_size' ];
58
 
73
  // Fetch options into an array
74
  $options = ye_set_profile_defaults( $profile_no );
75
  $general = ye_set_general_defaults();
76
+
77
+ if ( $general[ 'donation' ] != 1 ) : ?>
78
+
79
+ <div style="text-align: center;"><script type="text/javascript">
80
+ var psHost = (("https:" == document.location.protocol) ? "https://" : "http://");
81
+ document.write(unescape("%3Cscript src='" + psHost + "pluginsponsors.com/direct/spsn/display.php?client=youtube-embed&spot=' type='text/javascript'%3E%3C/script%3E"));
82
+ </script></div>
83
+
84
+ <?php endif; ?>
85
+
86
  <form method="post" action="<?php echo get_bloginfo( 'wpurl' ) . '/wp-admin/admin.php?page=youtube-embed-profiles' ?>">
87
 
88
  <span class="alignright">
102
 
103
  <tr>
104
  <th scope="row"><?php _e( 'Profile name' ); ?></th><td>
105
+ <input type="text" size="20" name="youtube_embed_name" value="<?php echo $options[ 'name' ]; ?>"<?php if ( $profile_no == 0 ) { echo ' readonly="readonly"'; } ?>/>
106
  <?php if ( $profile_no != 0 ) { echo '&nbsp;<span class="description">' . __( 'The name you wish to give this profile' ) . '</span>'; } ?>
107
  </td></tr>
108
 
111
  <td><span class="description"><?php _e( 'The type of player to use for videos.' ); ?></span><br/>
112
  <input type="radio" name="youtube_embed_type" value="v"<?php if ( $options[ 'type' ] == "v" ) { echo ' checked="checked"'; } ?>/><?php _e( '&nbsp;IFRAME' ); ?><span class="description"><?php _e( '&nbsp;Uses HTML5, where available. This is the current YouTube default..' ); ?></span><br/>
113
  <input type="radio" name="youtube_embed_type" value="p"<?php if ( $options[ 'type' ] == "p" ) { echo ' checked="checked"'; } ?>/><?php _e( '&nbsp;OBJECT' ); ?><span class="description"><?php _e( '&nbsp;Use the AS3 Flash player.' ); ?></span><br/>
114
+ <input type="radio" name="youtube_embed_type" value="c"<?php if ( $options[ 'type' ] == "c" ) { echo ' checked="checked"'; } ?>/><?php _e( '&nbsp;Chromeless' ); ?><span class="description"><?php _e( '&nbsp;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/>
115
  <input type="radio" name="youtube_embed_type" value="m"<?php if ( $options[ 'type' ] == "m" ) { echo ' checked="checked"'; } ?>/><?php _e( '&nbsp;EmbedPlus' ); ?><span class="description"><?php _e( '&nbsp;Use <a href="http://www.artiss.co.uk/artiss-youtube-embed/further-help#ye-embedplus">EmbedPlus</a>, if Flash is available.' ); ?></span>
116
  </td>
117
  </tr>
includes/options-widgets.php CHANGED
@@ -31,6 +31,8 @@ if ( attribute_escape( $instance[ 'type' ] ) == 'v' ) { echo " selected='selecte
31
  echo '>' . __( 'IFRAME' ) . '</option><option value="p"';
32
  if ( attribute_escape( $instance[ 'type' ] ) == 'p' ) { echo " selected='selected'"; }
33
  echo '>' . __( 'OBJECT' ) . '</option><option value="m"';
 
 
34
  if ( attribute_escape( $instance[ 'type' ] ) == 'm' ) { echo " selected='selected'"; }
35
  echo '>' . __( 'EmbedPlus' ) . '</option></select></p>';
36
 
31
  echo '>' . __( 'IFRAME' ) . '</option><option value="p"';
32
  if ( attribute_escape( $instance[ 'type' ] ) == 'p' ) { echo " selected='selected'"; }
33
  echo '>' . __( 'OBJECT' ) . '</option><option value="m"';
34
+ if ( attribute_escape( $instance[ 'type' ] ) == 'c' ) { echo " selected='selected'"; }
35
+ echo '>' . __( 'Chromeless' ) . '</option><option value="c"';
36
  if ( attribute_escape( $instance[ 'type' ] ) == 'm' ) { echo " selected='selected'"; }
37
  echo '>' . __( 'EmbedPlus' ) . '</option></select></p>';
38
 
includes/shared.php CHANGED
@@ -41,17 +41,17 @@ function ye_get_parameters( $input, $para ) {
41
  *
42
  * @since 2.0
43
  *
44
- * @param string $id Video ID
45
  * @return string Extracted ID
46
  */
47
 
48
  function ye_extract_id( $id ) {
49
-
50
- $id = 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 ) {
56
  $video_pos = $video_pos + 20;
57
  $ampersand_pos = strpos( $id, '&', $video_pos );
@@ -90,7 +90,7 @@ function ye_extract_id( $id ) {
90
  } else {
91
  $id = substr( $id, $video_pos, $ampersand_pos - $video_pos );
92
  }
93
- }
94
  }
95
  }
96
 
@@ -104,12 +104,12 @@ function ye_extract_id( $id ) {
104
  /**
105
  * Validate video type
106
  *
107
- * Function to work out what type of video has been requested and
108
  * whether it is valid. Also fetches the video title.
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
  */
@@ -119,7 +119,7 @@ function ye_validate_id( $id, $title_needed = false ) {
119
  $type = false;
120
  $title = false;
121
  $options = false;
122
-
123
  $options = ye_set_general_defaults();
124
 
125
  // Attempt to get the video type and title from cache
@@ -136,9 +136,9 @@ function ye_validate_id( $id, $title_needed = false ) {
136
  if ( !$cache ) {
137
 
138
  $type = '-';
139
-
140
  if ( $options [ 'api' ] != 0 ) {
141
-
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
@@ -163,10 +163,10 @@ function ye_validate_id( $id, $title_needed = false ) {
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
- $type = 'An error occured accessing the YouTube API for video ID ' . $id . ' - ' . $id_check[ 'error' ];
170
  } else {
171
  // If not reporting errors or API switched off, work out whether a video or playlist
172
  $type = '';
@@ -185,7 +185,7 @@ function ye_validate_id( $id, $title_needed = false ) {
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
  $tag_start = strpos( $id_check[ 'file' ], '<title>', 1 );
191
  if ( $tag_start !== false ) {
@@ -318,7 +318,7 @@ function ye_get_file( $filein, $header = false ) {
318
  $fileout = wp_remote_get( $filein );
319
  if ( is_wp_error( $fileout ) ) {
320
  $error = 'Body: '.$fileout->get_error_message();
321
- $rc = -1;
322
  } else {
323
  if ( isset( $fileout[ 'body' ] ) ) {
324
  $file_return[ 'file' ] = $fileout[ 'body' ];
@@ -359,6 +359,7 @@ function ye_get_embed_type( $type, $embedplus ) {
359
  if ( ( $type == 'embedplus' ) or ( $embedplus == '1' ) ) { $type = 'm'; }
360
  if ( $type == 'iframe' ) { $type = 'v'; }
361
  if ( $type == 'object' ) { $type = 'p'; }
 
362
 
363
  return $type;
364
  }
@@ -396,7 +397,7 @@ function ye_set_autohide( $autohide ) {
396
  */
397
 
398
  function ye_generate_profile_list( $current, $total ) {
399
-
400
  echo '<option value="0"';
401
  if ( $current == "0" ) { echo " selected='selected'"; }
402
  echo ' >'.__('Default').'</option>';
@@ -407,6 +408,7 @@ function ye_generate_profile_list( $current, $total ) {
407
  $profname = $profiles[ 'name' ];
408
 
409
  if ( $profname == '' ) { $profname = "Profile " . $loop; }
 
410
  echo '<option value="' . $loop . '"';
411
 
412
  if ( $current == $loop ) { echo " selected='selected'"; }
41
  *
42
  * @since 2.0
43
  *
44
+ * @param string $id Video ID
45
  * @return string Extracted ID
46
  */
47
 
48
  function ye_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
  $video_pos = strpos( $id, 'youtube.com/watch?', 0 );
54
+
55
  if ( $video_pos !== false ) {
56
  $video_pos = $video_pos + 20;
57
  $ampersand_pos = strpos( $id, '&', $video_pos );
90
  } else {
91
  $id = substr( $id, $video_pos, $ampersand_pos - $video_pos );
92
  }
93
+ }
94
  }
95
  }
96
 
104
  /**
105
  * Validate video type
106
  *
107
+ * Function to work out what type of video has been requested and
108
  * whether it is valid. Also fetches the video title.
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
  */
119
  $type = false;
120
  $title = false;
121
  $options = false;
122
+
123
  $options = ye_set_general_defaults();
124
 
125
  // Attempt to get the video type and title from cache
136
  if ( !$cache ) {
137
 
138
  $type = '-';
139
+
140
  if ( $options [ 'api' ] != 0 ) {
141
+
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
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
+ $type = 'An error occurred accessing the YouTube API for video ID ' . $id . ' - ' . $id_check[ 'error' ];
170
  } else {
171
  // If not reporting errors or API switched off, work out whether a video or playlist
172
  $type = '';
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
  $tag_start = strpos( $id_check[ 'file' ], '<title>', 1 );
191
  if ( $tag_start !== false ) {
318
  $fileout = wp_remote_get( $filein );
319
  if ( is_wp_error( $fileout ) ) {
320
  $error = 'Body: '.$fileout->get_error_message();
321
+ $rc = -1;
322
  } else {
323
  if ( isset( $fileout[ 'body' ] ) ) {
324
  $file_return[ 'file' ] = $fileout[ 'body' ];
359
  if ( ( $type == 'embedplus' ) or ( $embedplus == '1' ) ) { $type = 'm'; }
360
  if ( $type == 'iframe' ) { $type = 'v'; }
361
  if ( $type == 'object' ) { $type = 'p'; }
362
+ if ( $type == 'chromeless' ) { $type = 'c'; }
363
 
364
  return $type;
365
  }
397
  */
398
 
399
  function ye_generate_profile_list( $current, $total ) {
400
+
401
  echo '<option value="0"';
402
  if ( $current == "0" ) { echo " selected='selected'"; }
403
  echo ' >'.__('Default').'</option>';
408
  $profname = $profiles[ 'name' ];
409
 
410
  if ( $profname == '' ) { $profname = "Profile " . $loop; }
411
+ if ( strlen( $profname ) > 30 ) { $profname = substr( $profname, 0, 30 ) . '&#8230;'; }
412
  echo '<option value="' . $loop . '"';
413
 
414
  if ( $current == $loop ) { echo " selected='selected'"; }
includes/shortcodes.php CHANGED
@@ -13,7 +13,7 @@
13
  *
14
  * Main [youtube] shortcode to display video
15
  *
16
- * @since 2.0
17
  *
18
  * @uses ye_video_shortcode Action the shortcode parameters
19
  *
@@ -32,7 +32,7 @@ add_shortcode( 'youtube', 'ye_video_shortcode_default' );
32
  *
33
  * 1st alternative shortcode to display video
34
  *
35
- * @since 2.0
36
  *
37
  * @uses ye_video_shortcode Action the shortcode parameters
38
  *
@@ -52,7 +52,7 @@ if ( $shortcode[ 1 ] != '' ) { add_shortcode( $shortcode[ 1 ], 'ye_video_shortco
52
  *
53
  * 2nd alternative shortcode to display video
54
  *
55
- * @since 2.0
56
  *
57
  * @uses ye_video_shortcode Action the shortcode parameters
58
  *
@@ -71,7 +71,7 @@ if ( $shortcode[ 2 ] != '' ) { add_shortcode( $shortcode[ 2 ], 'ye_video_shortco
71
  *
72
  * Use shortcode parameters to embed a YouTube video or playlist
73
  *
74
- * @since 2.0
75
  *
76
  * @uses ye_get_embed_type Get the embed type
77
  * @uses ye_set_autohide Get the autohide parameter
@@ -85,7 +85,7 @@ if ( $shortcode[ 2 ] != '' ) { add_shortcode( $shortcode[ 2 ], 'ye_video_shortco
85
 
86
  function ye_video_shortcode( $paras = '', $content = '', $callback = '', $alt_shortcode = '' ) {
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' => '', 'https' => '' ), $paras ) );
89
 
90
  // If no profile specified and an alternative shortcode used, get that shortcodes default profile
91
  if ( ( $profile == '' ) && ( $alt_shortcode != '' ) ) {
@@ -101,6 +101,9 @@ function ye_video_shortcode( $paras = '', $content = '', $callback = '', $alt_sh
101
  if ( ( $url != '' ) && ( $content == '' ) ) { $content = $url; }
102
  if ( ( $youtubeurl != '' ) && ( $content == '' ) ) { $content = $youtubeurl; }
103
 
 
 
 
104
  if ( ( $rel != '' ) && ( $related == '' ) ) { $related = $rel;}
105
  if ( ( $fs != '' ) && ( $fullscreen == '' ) ) { $fullscreen = $fs;}
106
  if ( ( $cc_load_policy != '' ) && ( $cc == '' ) ) { $cc = $cc_load_policy;}
@@ -123,7 +126,7 @@ function ye_video_shortcode( $paras = '', $content = '', $callback = '', $alt_sh
123
 
124
  // Create YouTube code
125
  $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( $https ) );
126
-
127
  return $youtube_code;
128
  }
129
 
@@ -132,7 +135,7 @@ function ye_video_shortcode( $paras = '', $content = '', $callback = '', $alt_sh
132
  *
133
  * Shortcode to return the URL for a thumbnail
134
  *
135
- * @since 2.0
136
  *
137
  * @uses ye_generate_thumbnail_code Generate the thumbnail code
138
  *
@@ -152,7 +155,7 @@ add_shortcode( 'youtube_thumb', 'ye_thumbnail_sc' );
152
  *
153
  * Generate a short URL for a YouTube video
154
  *
155
- * @since 2.0
156
  *
157
  * @uses ye_error Show an error
158
  *
@@ -172,7 +175,7 @@ add_shortcode( 'youtube_url', 'ye_shorturl_sc' );
172
  *
173
  * Generate a short URL for a YouTube video
174
  *
175
- * @since 2.0
176
  *
177
  * @uses ye_generate_download_code Generate the download code
178
  *
@@ -204,7 +207,7 @@ add_shortcode( 'download_video', 'ye_video_download' );
204
  *
205
  * Shortcode to return YouTube transcripts
206
  *
207
- * @since 2.0
208
  *
209
  * @uses ye_generate_transcript Generate the transcript
210
  *
@@ -223,7 +226,7 @@ add_shortcode( 'transcript', 'ye_transcript_sc' );
223
  *
224
  * Shortcode to return the name of a YouTube video
225
  *
226
- * @since 2.0
227
  *
228
  * @uses ye_extract_id Extract the video ID
229
  * @uses ye_validate_id Get the name and video type
13
  *
14
  * Main [youtube] shortcode to display video
15
  *
16
+ * @since 2.0
17
  *
18
  * @uses ye_video_shortcode Action the shortcode parameters
19
  *
32
  *
33
  * 1st alternative shortcode to display video
34
  *
35
+ * @since 2.0
36
  *
37
  * @uses ye_video_shortcode Action the shortcode parameters
38
  *
52
  *
53
  * 2nd alternative shortcode to display video
54
  *
55
+ * @since 2.0
56
  *
57
  * @uses ye_video_shortcode Action the shortcode parameters
58
  *
71
  *
72
  * Use shortcode parameters to embed a YouTube video or playlist
73
  *
74
+ * @since 2.0
75
  *
76
  * @uses ye_get_embed_type Get the embed type
77
  * @uses ye_set_autohide Get the autohide parameter
85
 
86
  function ye_video_shortcode( $paras = '', $content = '', $callback = '', $alt_shortcode = '' ) {
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' => '', 'https' => '', 'height' => '', 'width' => '' ), $paras ) );
89
 
90
  // If no profile specified and an alternative shortcode used, get that shortcodes default profile
91
  if ( ( $profile == '' ) && ( $alt_shortcode != '' ) ) {
101
  if ( ( $url != '' ) && ( $content == '' ) ) { $content = $url; }
102
  if ( ( $youtubeurl != '' ) && ( $content == '' ) ) { $content = $youtubeurl; }
103
 
104
+ if ( ( $h != '' ) && ( $height == '' ) ) { $height = $h; }
105
+ if ( ( $w != '' ) && ( $width == '' ) ) { $width = $w; }
106
+
107
  if ( ( $rel != '' ) && ( $related == '' ) ) { $related = $rel;}
108
  if ( ( $fs != '' ) && ( $fullscreen == '' ) ) { $fullscreen = $fs;}
109
  if ( ( $cc_load_policy != '' ) && ( $cc == '' ) ) { $cc = $cc_load_policy;}
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( $https ) );
129
+
130
  return $youtube_code;
131
  }
132
 
135
  *
136
  * Shortcode to return the URL for a thumbnail
137
  *
138
+ * @since 2.0
139
  *
140
  * @uses ye_generate_thumbnail_code Generate the thumbnail code
141
  *
155
  *
156
  * Generate a short URL for a YouTube video
157
  *
158
+ * @since 2.0
159
  *
160
  * @uses ye_error Show an error
161
  *
175
  *
176
  * Generate a short URL for a YouTube video
177
  *
178
+ * @since 2.0
179
  *
180
  * @uses ye_generate_download_code Generate the download code
181
  *
207
  *
208
  * Shortcode to return YouTube transcripts
209
  *
210
+ * @since 2.0
211
  *
212
  * @uses ye_generate_transcript Generate the transcript
213
  *
226
  *
227
  * Shortcode to return the name of a YouTube video
228
  *
229
+ * @since 2.0
230
  *
231
  * @uses ye_extract_id Extract the video ID
232
  * @uses ye_validate_id Get the name and video type
includes/widgets.php CHANGED
@@ -17,7 +17,7 @@ if ( ( float ) $wp_version >= 2.8 ) {
17
  *
18
  * Call WP_Widget class to define widget
19
  *
20
- * @since 2.0
21
  *
22
  * @uses WP_Widget Standard WP_Widget class
23
  */
@@ -34,7 +34,7 @@ if ( ( float ) $wp_version >= 2.8 ) {
34
  *
35
  * Display the YouTube widget
36
  *
37
- * @since 2.0
38
  *
39
  * @uses generate_youtube_code Generate the required YouTube code
40
  *
@@ -91,7 +91,7 @@ if ( ( float ) $wp_version >= 2.8 ) {
91
  *
92
  * Update and save widget
93
  *
94
- * @since 2.0
95
  *
96
  * @param string $new_instance New instance
97
  * @param string $old_instance Old instance
@@ -135,13 +135,13 @@ if ( ( float ) $wp_version >= 2.8 ) {
135
  *
136
  * Define admin file
137
  *
138
- * @since 2.0
139
  *
140
  * @param string $instance Instance
141
  */
142
 
143
  function form( $instance ) {
144
- include( WP_PLUGIN_DIR . '/youtube-embed/includes/options-widgets.php' );
145
  }
146
  }
147
 
17
  *
18
  * Call WP_Widget class to define widget
19
  *
20
+ * @since 2.0
21
  *
22
  * @uses WP_Widget Standard WP_Widget class
23
  */
34
  *
35
  * Display the YouTube widget
36
  *
37
+ * @since 2.0
38
  *
39
  * @uses generate_youtube_code Generate the required YouTube code
40
  *
91
  *
92
  * Update and save widget
93
  *
94
+ * @since 2.0
95
  *
96
  * @param string $new_instance New instance
97
  * @param string $old_instance Old instance
135
  *
136
  * Define admin file
137
  *
138
+ * @since 2.0
139
  *
140
  * @param string $instance Instance
141
  */
142
 
143
  function form( $instance ) {
144
+ include ( WP_PLUGIN_DIR . '/youtube-embed/includes/options-widgets.php' );
145
  }
146
  }
147
 
js/mcebutton UNCOMPRESSED.js CHANGED
@@ -4,7 +4,12 @@
4
  ed.addButton('YouTube', {
5
  title : 'YouTube Embed',
6
  onclick : function() {
7
- ed.selection.setContent('[youtube]' + ed.selection.getContent() + '[/youtube]');
 
 
 
 
 
8
  }
9
  });
10
  },
4
  ed.addButton('YouTube', {
5
  title : 'YouTube Embed',
6
  onclick : function() {
7
+ if (ed.selection.getContent()=='') {
8
+ var yeOut = 'Insert video URL or ID here';
9
+ } else {
10
+ var yeOut = ed.selection.getContent();
11
+ }
12
+ ed.selection.setContent('[youtube]' + yeOut + '[/youtube]');
13
  }
14
  });
15
  },
js/mcebutton.js CHANGED
@@ -1 +1 @@
1
- (function(){tinymce.create('tinymce.plugins.youtube',{init:function(ed,url){ed.addButton('YouTube',{title:'YouTube Embed',onclick:function(){ed.selection.setContent('[youtube]'+ed.selection.getContent()+'[/youtube]')}})},createControl:function(n,cm){return null},});tinymce.PluginManager.add('YouTube',tinymce.plugins.youtube)})();
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)})();
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, sidebar, simple, url, valid, video, widget,width, xhtml, youtube, youtuber
5
  Requires at least: 2.9
6
  Tested up to: 3.2.1
7
- Stable tag: 2.1
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
 
@@ -13,7 +13,7 @@ A simple to use method of embedding YouTube videos into your posts and pages but
13
  Artiss YouTube Embed (formally YouTube Embed) is an incredibly simple, yet powerful, method of embedding YouTube videos into your WordPress site. Options include:
14
 
15
  * XHTML and HTML5 compliant - works with all the latest browsers
16
- * Multiple embedding methods available - OBJECT, IFRAME and EmbedPlus
17
  * Allow users to add videos to comments
18
  * Build your own playlists and play them back however you want
19
  * Create multiple profiles - use them for different videos to get the exact style that you want
@@ -22,6 +22,8 @@ Artiss YouTube Embed (formally YouTube Embed) is an incredibly simple, yet power
22
  * Using a different YouTube plugin? Documentation and tools are provided to help you migrate to Artiss YouTube Embed
23
  * And much, much more!
24
 
 
 
25
  To add a video to a post or page simply use the shortcode `[youtube]video[/youtube]`, where `video` is the ID or URL of the video. Alternatively, you can add one (or more) widgets to your sidebar.
26
 
27
  Within the administration area of your blog you will find a new menu named `YouTube` (see screenshot 1). Click on the `Options` sub-menu to set a number of general options. Alternatively click on the `Profiles` sub-menu to set the default options which define the output of your videos - any videos you display (unless overridden by parameters - more on that later) will use the settings from the Profiles screen.
@@ -53,7 +55,7 @@ The following parameters work with all embed types:
53
  * **start** - a number of seconds from where to start the video playing
54
  * **style** - apply CSS elements directly to the video output
55
  * **template** - specify a template (see section on Templates for further details)
56
- * **type** - which embedding type to use, this can be `embedplus`, `iframe` or `object`
57
  * **width** - the video width, in pixels
58
 
59
  The following parameters will not work with EmbedPlus:
@@ -280,7 +282,7 @@ This WordPress plugin is licensed under the [GPLv2 (or later)](http://wordpress.
280
 
281
  All of my plugins are supported via [my website](http://www.artiss.co.uk "Artiss.co.uk").
282
 
283
- Please feel free to visit the site for plugin updates and development news - either visit the site regularly, follow [my news feed](http://www.artiss.co.uk/feed "RSS News Feed") or [follow me on Twitter](http://www.twitter.com/artiss_tech "Artiss.co.uk on Twitter") (@artiss_tech).
284
 
285
  For problems, suggestions or enhancements for this plugin, there is [a dedicated page](http://www.artiss.co.uk/artiss-youtube-embed "Artiss YouTube Embed") and [a forum](http://www.artiss.co.uk/forum "WordPress Plugins Forum"). The dedicated page will also list any known issues and planned enhancements.
286
 
@@ -319,23 +321,17 @@ Equally, some options are not supported depending on whether you use the IFRAME
319
 
320
  [Read more about which options are supported](http://www.artiss.co.uk/artiss-youtube-embed/further-help#ye-api "API Support").
321
 
322
- = The progress bar doesn't appear as white when I'm using the light coloured theme =
323
-
324
- You can set the progress bar as red or white and the general theme to be dark or light. According to YouTube documentation all variations on this should be possible. However, the white / light combination does not appear to work.
325
-
326
- I have reported this to Google as a bug in their API and, at the time of publishing this, am still awaiting a response.
327
-
328
  = How do I add a border to the video =
329
 
330
  The border option is no longer available with the YouTube player. However, you can use the `style` option to mimic it. Simply add a style of `border: 10px solid #b1b1b1`.
331
 
332
- = When trying to display a video it says "An error occured accessing the YouTube API" =
333
 
334
  This has been reported by a number of users - for some reason some people are unable to access the YouTube API, which is used by this plugin to determine the video type and whether it's valid or not. If you are one of them then simply go to the `Options` screen within the `YouTube Embed` administration menu and, near the bottom, there is an option to stop reporting API errors.
335
 
336
  If you switch off API errors then the plugin will simply assume all IDs are valid and work out the type from the ID length (which is not set, so if this changes in future it may cause problems!).
337
 
338
- I have requested further information on why these errors may be occuring from the YouTube forum but, as yet, I've had no response. [Click here](http://groups.google.com/group/youtube-api-gdata/browse_thread/thread/764f2f2a3b5863f8?hl=en "YouTube APIs Developer Forum") if you wish to track the request.
339
 
340
  = I've upgraded from an earlier version of Artiss YouTube Embed and one of the functions / shortcodes / parameters that I used is no longer documented =
341
 
@@ -375,11 +371,11 @@ However, I can confirm that it's been tested in IE7 (IE8 in compatibility mode),
375
 
376
  It has been syntax checked as PHP 4. However, this does not guarantee PHP 4 compatibility and the minimum for WordPress is now PHP 5.2.4.
377
 
378
- Although I attempt to keep with PHP 4 compatability 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 plugin news and support links. If you wish to switch it off simply click on the "Screen Options" tab at the top and untick "Artiss Plugin News & Support".
383
 
384
  == Screenshots ==
385
 
@@ -396,100 +392,117 @@ That's correct - all Artiss plugins will now add this feature to keep you up-to-
396
  * Initial release
397
 
398
  = 1.1 =
399
- * Updated test video on options screen, as previous one had been removed
400
- * Resulting XHTML code is better formatted, with comments identifying code location
401
- * Confirmed WP 3.0 compatibility
402
 
403
  = 1.2 =
404
- * Minor changes to the XHTML code to prevent warnings from certain validators
405
 
406
  = 1.3 =
407
- * Added transparency option so that videos won't cover up layers
408
 
409
  = 1.3.1 =
410
- * New widget option to specify title
411
 
412
  = 1.4 =
413
- * Now supports multiple widgets - widget code completely re-written
414
- * Support for EmbedPlus added
415
- * Added option to suppress links back to YouTube
416
- * Added functions and shortcodes for returning and outputting available transcripts
417
- * Tidied up code
418
 
419
  = 1.4.1 =
420
- * HD option is available with EmbedPlus - updated the admin and widget screen to reflect this
421
 
422
  = 1.4.2 =
423
- * Fixed bug which meant that people upgrading from previous versions may not be able to display video until they've been to the options screen and re-saved their default options
424
- * Added keyboard disable option
425
 
426
  = 1.5 =
427
- * Added clone of 'youtube' shortcode, called 'youtube_video'
428
- * Editor now has YouTube button, which inserts the YouTube shortcode (this can be switched off in the options screen)
429
- * Added new option to disable keyboard controls
430
- * Added option to supply a ratio, in case height or width are not supplied - the missing parameter will then be calculated
431
- * Option to create a download link (for video and playlist) using function call or shortcode
432
- * You can now change on the options screen which set of parameters the demonstration video uses (i.e. "normal" or EmbedPlus). This allows you to try your options on a different video type without switching to it.
433
 
434
  = 2.0 =
435
- * Renamed to Artiss YouTube Embed from YouTube Embed
436
- * Major re-write, using new coding standards
437
- * New administration screens, introducing multiple profiles and playlists
438
- * AS3 player is now used, AS2 has been retired. Both OBJECT and IFRAME versions can be selected
439
- * Compliancy and browser checked - XHTML and HTML5 compliant and works in all the latest browsers
440
- * Migration options added, allowing compatibility with other similar plugins
441
- * Can now specify full video URL as well as video ID
442
- * No need to use separate shortcode for playlists, as they are automatically detected. Video IDs are also now validated
443
- * Options to allow YouTube URLs not within shortcodes to be accepted, as well as in comments
444
- * RDFa metadata added to code output
445
- * Caching of code and ID checking to improve performance
446
- * Templating system replaces CSS specification
447
- * README completely re-written, contextual help added to admin screens and links to further information
448
- * Improved editor button and link added to admin bar
449
- * Many, many more changes - too many to list!
450
-
451
- = 2.0.1 =
452
- * Enhancement: Changed cache key encoding so that it was compatible with PHP 4
453
- * Enhancement: Added autoplay option to EmbedPlus
454
- * Enhancement: Re-instated `style` option, allowing you to apply a direct set of CSS elements to the output - a requirement if you wish to add a border to the video, for instance
455
- * Maintenance: Updated screens and documentation to show the `start` parameter works with EmbedPlus
456
- * Bug: Fixed incorrect caching of options - was only changing if override parameters were modified
457
- * Bug: Video Information Cache will no longer reset to zero if the Embed cache is greater
458
- * Bug: Added random ID to EmbedPlus output to resolve a bug that can affect IE users
459
-
460
- = 2.0.2 =
461
- * Enhancement: Strip tags from video ID, in case any have crept in
462
- * Enhancement: Tidied some of the widget controls
463
- * Enhancement: You can now specify YouTube short URLs as video IDs
464
- * Bug: Removed reference to jscolor.js script, which isn't used
465
- * Bug: Video IDs beginning with numbers are being confused with list numbers
466
- * Bug: Corrected problem with random single videos being picked from a list
467
- * Bug: Fixed problem with list where one video was being ignored and another repeated
468
- * Bug: Modified widget code to allow for all states to be allowable. Defaults updated
469
- * Bug: YouTube documentation states that if you don't specify the fullscreen parameter it will default to off. It doesn't. Corrected in the code
470
-
471
- = 2.0.3 =
472
- * Enhancement: Decode any passed `template` parameters, as WP may have encoded the content first
473
- * Enhancement: Improved file handling
474
- * Enhancement: Now using HTTPS and version 2 of YouTube gdata API
475
- * Enhancement: New general option to switch off reporting of API errors - will simply accept ID and work out type
476
- * Maintenance: Added details to the README to cover issues with `style` backwards compatibility and YouTube API
477
-
478
- = 2.0.4 =
479
- * Enhancement: Removed HTTPS access to gdata API - will add a switchable option for this in a later release
480
-
481
- = 2.1 =
482
- * Enhancement: New option to switch API options (where HTTP or HTTPS, display messages or not or even switch off)
483
- * Enhancement: Output video playback errors as XHTML comments. Output to post a generic message which can be changed in the options
484
- * Enhancement: Video information is shown in lists screen when first entering (no need to press Save button to display)
485
- * Enhancement: Added new `color` parameter, which allows you to specify the colour of the progress bar
486
- * Enhancement: Added new `theme` parameter, allowing you to specify if the player is dark or light skinned
487
- * Enhancement: Added new `https` parameter, allowing you to use HTTPS instead of HTTP for the video display
488
- * Enhancement: Added new `version` parameter to thumbnails, allowing different versions (including a high resolution one) to be displayed
489
- * Enhancement: Added new administration option to allow the thumbnail used in RSS feeds to be specified
490
- * Enhancement: Log the current plugin version into the database. This may be of use in future upgrades to detect which version the user is upgrading from
491
- * Bug: Fixed video title no longer being fetched since 2.0.3 (because of using v2 of API)
492
- * Bug: Fixed some error output - due to changes made in an earlier release some errors would not display
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
493
 
494
  == Upgrade Notice ==
495
 
@@ -536,4 +549,10 @@ That's correct - all Artiss plugins will now add this feature to keep you up-to-
536
  * Fixed SSL bug by removing HTTPS access to API
537
 
538
  = 2.1 =
539
- * New options to change player colours, chose your thumbnails and control API usage
 
 
 
 
 
 
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, sidebar, simple, smart, url, valid, video, widget, width, xhtml, youtube, youtuber
5
  Requires at least: 2.9
6
  Tested up to: 3.2.1
7
+ Stable tag: 2.3
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
 
13
  Artiss YouTube Embed (formally YouTube Embed) is an incredibly simple, yet powerful, method of embedding YouTube videos into your WordPress site. Options include:
14
 
15
  * XHTML and HTML5 compliant - works with all the latest browsers
16
+ * Multiple embedding methods available - OBJECT, IFRAME, CHROMELESS and EmbedPlus
17
  * Allow users to add videos to comments
18
  * Build your own playlists and play them back however you want
19
  * Create multiple profiles - use them for different videos to get the exact style that you want
22
  * Using a different YouTube plugin? Documentation and tools are provided to help you migrate to Artiss YouTube Embed
23
  * And much, much more!
24
 
25
+ 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!
26
+
27
  To add a video to a post or page simply use the shortcode `[youtube]video[/youtube]`, where `video` is the ID or URL of the video. Alternatively, you can add one (or more) widgets to your sidebar.
28
 
29
  Within the administration area of your blog you will find a new menu named `YouTube` (see screenshot 1). Click on the `Options` sub-menu to set a number of general options. Alternatively click on the `Profiles` sub-menu to set the default options which define the output of your videos - any videos you display (unless overridden by parameters - more on that later) will use the settings from the Profiles screen.
55
  * **start** - a number of seconds from where to start the video playing
56
  * **style** - apply CSS elements directly to the video output
57
  * **template** - specify a template (see section on Templates for further details)
58
+ * **type** - which embedding type to use, this can be `embedplus`, `iframe`, `object` or `chromeless`
59
  * **width** - the video width, in pixels
60
 
61
  The following parameters will not work with EmbedPlus:
282
 
283
  All of my plugins are supported via [my website](http://www.artiss.co.uk "Artiss.co.uk").
284
 
285
+ Please feel free to visit the site for plugin updates and development news - either visit the site regularly or [follow me on Twitter](http://www.twitter.com/artiss_tech "Artiss.co.uk on Twitter") (@artiss_tech).
286
 
287
  For problems, suggestions or enhancements for this plugin, there is [a dedicated page](http://www.artiss.co.uk/artiss-youtube-embed "Artiss YouTube Embed") and [a forum](http://www.artiss.co.uk/forum "WordPress Plugins Forum"). The dedicated page will also list any known issues and planned enhancements.
288
 
321
 
322
  [Read more about which options are supported](http://www.artiss.co.uk/artiss-youtube-embed/further-help#ye-api "API Support").
323
 
 
 
 
 
 
 
324
  = How do I add a border to the video =
325
 
326
  The border option is no longer available with the YouTube player. However, you can use the `style` option to mimic it. Simply add a style of `border: 10px solid #b1b1b1`.
327
 
328
+ = When trying to display a video it says "An error occurred accessing the YouTube API" =
329
 
330
  This has been reported by a number of users - for some reason some people are unable to access the YouTube API, which is used by this plugin to determine the video type and whether it's valid or not. If you are one of them then simply go to the `Options` screen within the `YouTube Embed` administration menu and, near the bottom, there is an option to stop reporting API errors.
331
 
332
  If you switch off API errors then the plugin will simply assume all IDs are valid and work out the type from the ID length (which is not set, so if this changes in future it may cause problems!).
333
 
334
+ I have requested further information on why these errors may be occurring from the YouTube forum but, as yet, I've had no response. [Click here](http://groups.google.com/group/youtube-api-gdata/browse_thread/thread/764f2f2a3b5863f8?hl=en "YouTube APIs Developer Forum") if you wish to track the request.
335
 
336
  = I've upgraded from an earlier version of Artiss YouTube Embed and one of the functions / shortcodes / parameters that I used is no longer documented =
337
 
371
 
372
  It has been syntax checked as PHP 4. However, this does not guarantee PHP 4 compatibility and the minimum for WordPress is now PHP 5.2.4.
373
 
374
+ Although I attempt to keep with PHP 4 compatibility there are no guarantees of this.
375
 
376
  = A new box has appeared on my dashboard all about Artiss plugins =
377
 
378
+ 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".
379
 
380
  == Screenshots ==
381
 
392
  * Initial release
393
 
394
  = 1.1 =
395
+ * Maintenance: Updated test video on options screen, as previous one had been removed
396
+ * Maintenance: Confirmed WP 3.0 compatibility
397
+ * Enhancement: Resulting XHTML code is better formatted, with comments identifying code location
398
 
399
  = 1.2 =
400
+ * Enhancement: Minor changes to the XHTML code to prevent warnings from certain validators
401
 
402
  = 1.3 =
403
+ * Enhancement: Added transparency option so that videos won't cover up layers
404
 
405
  = 1.3.1 =
406
+ * Enhancement: New widget option to specify title
407
 
408
  = 1.4 =
409
+ * Maintenance: Tidied up code
410
+ * Enhancement: Now supports multiple widgets - widget code completely re-written
411
+ * Enhancement: Support for EmbedPlus added
412
+ * Enhancement: Added option to suppress links back to YouTube
413
+ * Enhancement: Added functions and shortcodes for returning and outputting available transcripts
414
 
415
  = 1.4.1 =
416
+ * Enhancement: HD option is available with EmbedPlus - updated the admin and widget screen to reflect this
417
 
418
  = 1.4.2 =
419
+ * Enhancement: Added keyboard disable option
420
+ * Bug: Fixed bug which meant that people upgrading from previous versions may not be able to display video until they've been to the options screen and re-saved their default options
421
 
422
  = 1.5 =
423
+ * Enhancement: Added clone of 'youtube' shortcode, called 'youtube_video'
424
+ * Enhancement: Editor now has YouTube button, which inserts the YouTube shortcode (this can be switched off in the options screen)
425
+ * Enhancement: Added new option to disable keyboard controls
426
+ * Enhancement: Added option to supply a ratio, in case height or width are not supplied - the missing parameter will then be calculated
427
+ * Enhancement: Option to create a download link (for video and playlist) using function call or shortcode
428
+ * Enhancement: You can now change on the options screen which set of parameters the demonstration video uses (i.e. "normal" or EmbedPlus). This allows you to try your options on a different video type without switching to it.
429
 
430
  = 2.0 =
431
+ * Maintenance: Renamed to Artiss YouTube Embed from YouTube Embed
432
+ * Maintenance: Major re-write, using new coding standards
433
+ * Maintenance: AS3 player is now used, AS2 has been retired
434
+ * Maintenance: Compliancy and browser checked - XHTML and HTML5 compliant and works in all the latest browsers
435
+ * Maintenance: README completely re-written, contextual help added to admin screens and links to further information
436
+ * Enhancement: New administration screens, introducing multiple profiles and playlists
437
+ * Enhancement: Both OBJECT and IFRAME versions can be selected
438
+ * Enhancement: Migration options added, allowing compatibility with other similar plugins
439
+ * Enhancement: Can now specify full video URL as well as video ID
440
+ * Enhancement: No need to use separate shortcode for playlists, as they are automatically detected. Video IDs are also now validated
441
+ * Enhancement: Options to allow YouTube URLs not within shortcodes to be accepted, as well as in comments
442
+ * Enhancement: RDFa metadata added to code output
443
+ * Enhancement: Caching of code and ID checking to improve performance
444
+ * Enhancement: Templating system replaces CSS specification
445
+ * Enhancement: Improved editor button and link added to admin bar
446
+ * Enhancement: Many, many more changes - too many to list!
447
+
448
+ = 2.0.1 =
449
+ * Enhancement: Changed cache key encoding so that it was compatible with PHP 4
450
+ * Enhancement: Added autoplay option to EmbedPlus
451
+ * Enhancement: Re-instated `style` option, allowing you to apply a direct set of CSS elements to the output - a requirement if you wish to add a border to the video, for instance
452
+ * Maintenance: Updated screens and documentation to show the `start` parameter works with EmbedPlus
453
+ * Bug: Fixed incorrect caching of options - was only changing if override parameters were modified
454
+ * Bug: Video Information Cache will no longer reset to zero if the Embed cache is greater
455
+ * Bug: Added random ID to EmbedPlus output to resolve a bug that can affect IE users
456
+
457
+ = 2.0.2 =
458
+ * Enhancement: Strip tags from video ID, in case any have crept in
459
+ * Enhancement: Tidied some of the widget controls
460
+ * Enhancement: You can now specify YouTube short URLs as video IDs
461
+ * Bug: Removed reference to jscolor.js script, which isn't used
462
+ * Bug: Video IDs beginning with numbers are being confused with list numbers
463
+ * Bug: Corrected problem with random single videos being picked from a list
464
+ * Bug: Fixed problem with list where one video was being ignored and another repeated
465
+ * Bug: Modified widget code to allow for all states to be allowable. Defaults updated
466
+ * Bug: YouTube documentation states that if you don't specify the fullscreen parameter it will default to off. It doesn't. Corrected in the code
467
+
468
+ = 2.0.3 =
469
+ * Enhancement: Decode any passed `template` parameters, as WP may have encoded the content first
470
+ * Enhancement: Improved file handling
471
+ * Enhancement: Now using HTTPS and version 2 of YouTube gdata API
472
+ * Enhancement: New general option to switch off reporting of API errors - will simply accept ID and work out type
473
+ * Maintenance: Added details to the README to cover issues with `style` backwards compatibility and YouTube API
474
+
475
+ = 2.0.4 =
476
+ * Enhancement: Removed HTTPS access to gdata API - will add a switchable option for this in a later release
477
+
478
+ = 2.1 =
479
+ * Enhancement: New option to switch API options (where HTTP or HTTPS, display messages or not or even switch off)
480
+ * Enhancement: Output video playback errors as XHTML comments. Output to post a generic message which can be changed in the options
481
+ * Enhancement: Video information is shown in lists screen when first entering (no need to press Save button to display)
482
+ * Enhancement: Added new `color` parameter, which allows you to specify the colour of the progress bar
483
+ * Enhancement: Added new `theme` parameter, allowing you to specify if the player is dark or light skinned
484
+ * Enhancement: Added new `https` parameter, allowing you to use HTTPS instead of HTTP for the video display
485
+ * Enhancement: Added new `version` parameter to thumbnails, allowing different versions (including a high resolution one) to be displayed
486
+ * Enhancement: Added new administration option to allow the thumbnail used in RSS feeds to be specified
487
+ * Enhancement: Log the current plugin version into the database. This may be of use in future upgrades to detect which version the user is upgrading from
488
+ * Bug: Fixed video title no longer being fetched since 2.0.3 (because of using v2 of API)
489
+ * Bug: Fixed some error output - due to changes made in an earlier release some errors would not display
490
+
491
+ = 2.2 =
492
+ * Maintenance: Updated dashboard widget to latest version
493
+ * Maintenance: Added advertising banners to options screen - these can be turned off if you donate
494
+ * Enhancement: Replace WP_PLUGIN_URL with plugins_url()
495
+ * Enhancement: Added H and W as alternative shortcode parameters to HEIGHT and WIDTH
496
+ * Enhancement: Editor button should appear for anyone from editor role upwards
497
+ * Enhancement: Removed maximum length from profile and list names. However, only first 20 characters will appear in lists
498
+
499
+ = 2.3 =
500
+ * Bug: Fixed incorrect listing of long profile or list names
501
+ * Bug: Fixed INCLUDE bug in widgets.php
502
+ * Enhancement: Editor button will add text between shortcodes if no URL or ID is specified
503
+ * Enhancement: Square brackets are stripped from alternative shortcodes on option screen - text added to warn against this too
504
+ * Enhancement: Added Chromeless player option
505
+ * Enhancement: Increased maximum output length of profile and list names to 30 characters
506
 
507
  == Upgrade Notice ==
508
 
549
  * Fixed SSL bug by removing HTTPS access to API
550
 
551
  = 2.1 =
552
+ * New options to change player colours, chose your thumbnails and control API usage
553
+
554
+ = 2.2 =
555
+ * Assorted minor improvements
556
+
557
+ = 2.3 =
558
+ * Assorted bug fixes and minor improvements. Also added Chromeless player.
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.1
7
  Author: David Artiss
8
  Author URI: http://www.artiss.co.uk
9
  */
@@ -17,7 +17,7 @@ Author URI: http://www.artiss.co.uk
17
  * @since 2.0
18
  */
19
 
20
- define( 'youtube_embed_version', '2.1' );
21
 
22
  $functions_dir = WP_PLUGIN_DIR . '/youtube-embed/includes/';
23
 
@@ -36,7 +36,7 @@ if ( is_admin() ) {
36
  include_once( $functions_dir . 'admin-menu.php' ); // Administration menus
37
 
38
  include_once( $functions_dir . 'mcebutton.php' ); // Editor button
39
-
40
  if ( !has_action( 'wp_dashboard_setup', 'artiss_dashboard_widget' ) ) {
41
 
42
  include_once( $functions_dir . 'artiss-dashboard-widget.php' ); // Artiss dashboard widget
@@ -44,21 +44,21 @@ if ( is_admin() ) {
44
  }
45
 
46
  } else {
47
-
48
  include_once( $functions_dir . 'content.php' ); // Process post content
49
 
50
  include_once( $functions_dir . 'function-calls.php' ); // Function calls
51
 
52
  include_once( $functions_dir . 'generate-download-code.php' ); // Generate download URLs
53
-
54
  include_once( $functions_dir . 'generate-shorturl-code.php' ); // Generate short URLs
55
-
56
  include_once( $functions_dir . 'generate-thumbnail-code.php' ); // Generate thumbnail code
57
-
58
  include_once( $functions_dir . 'generate-transcript-code.php' ); // Generate transcripts
59
-
60
  include_once( $functions_dir . 'shortcodes.php' ); // Shortcodes
61
-
62
  include_once( $functions_dir . 'deprecated.php' ); // Deprecated options
63
 
64
  }
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.3
7
  Author: David Artiss
8
  Author URI: http://www.artiss.co.uk
9
  */
17
  * @since 2.0
18
  */
19
 
20
+ define( 'youtube_embed_version', '2.3' );
21
 
22
  $functions_dir = WP_PLUGIN_DIR . '/youtube-embed/includes/';
23
 
36
  include_once( $functions_dir . 'admin-menu.php' ); // Administration menus
37
 
38
  include_once( $functions_dir . 'mcebutton.php' ); // Editor button
39
+
40
  if ( !has_action( 'wp_dashboard_setup', 'artiss_dashboard_widget' ) ) {
41
 
42
  include_once( $functions_dir . 'artiss-dashboard-widget.php' ); // Artiss dashboard widget
44
  }
45
 
46
  } else {
47
+
48
  include_once( $functions_dir . 'content.php' ); // Process post content
49
 
50
  include_once( $functions_dir . 'function-calls.php' ); // Function calls
51
 
52
  include_once( $functions_dir . 'generate-download-code.php' ); // Generate download URLs
53
+
54
  include_once( $functions_dir . 'generate-shorturl-code.php' ); // Generate short URLs
55
+
56
  include_once( $functions_dir . 'generate-thumbnail-code.php' ); // Generate thumbnail code
57
+
58
  include_once( $functions_dir . 'generate-transcript-code.php' ); // Generate transcripts
59
+
60
  include_once( $functions_dir . 'shortcodes.php' ); // Shortcodes
61
+
62
  include_once( $functions_dir . 'deprecated.php' ); // Deprecated options
63
 
64
  }